go-viee-fetch-Demo/public/static/lib/plugin/ht-animationplayer.js
2025-08-25 20:25:55 +08:00

2 lines
207 KiB
JavaScript

this.ht=this.ht||{},this.ht.animationplayer=function(){"use strict";function e(t,a){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e(t,a)}function t(a,i,n){return t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(t,a,i){var n=[null];n.push.apply(n,a);var r=new(Function.bind.apply(t,n));return i&&e(r,i.prototype),r},t.apply(null,arguments)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,i=new Array(t);a<t;a++)i[a]=e[a];return i}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(e,t):void 0}}function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(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 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},r(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var i,n,r,o,s=[],l=!0,c=!1;try{if(r=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(i=r.call(a)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=a.return&&(o=a.return(),Object(o)!==o))return}finally{if(c)throw n}}return s}}(e,t)||i(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.")}()}var s=ht.Default;function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var i=a.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}function f(e,t){for(var a=0;a<t.length;a++){var i=t[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function h(e,t,a){return t&&f(e.prototype,t),a&&f(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){if(e)return void 0!==e.t?e.t:e.time}function p(e){return void 0!==e.v?e.v:e.value}function d(e){return void 0!==e.r?e.r:e.repeat}function v(e){return void 0!==e.e?e.e:e.endTime}function m(e){return void 0!==e.ax?e.ax:e.anchorX}function y(e){return void 0!==e.ay?e.ay:e.anchorY}function g(e){return void 0!==e.w?e.w:e.width}function _(e){return void 0!==e.h?e.h:e.height}function b(e,t,a){if(e=e.split("$")[0],t){if("number"==typeof t[0]){var i={};return"opacity"===e?(i.t=t[5*a],i.v=t[5*a+1],i.c=t[5*a+2],i.cp=t[5*a+3],i.ob=t[5*a+4]):"m_opacity"===e?(i.t=t[5*a],i.v=t[5*a+1],i.c=t[5*a+2],i.cp=t[5*a+3],i.mob=t[5*a+4]):-1!==["clip","fillClip","s_clip","s_bgClip"].indexOf(e)?(i.t=t[5*a],i.v=t[5*a+1],i.c=t[5*a+2],i.cp=t[5*a+3],i.cd=t[5*a+4]):"gradient"===e||"s_gradient"===e?(i.t=t[5*a],i.v=t[5*a+1],i.c=t[5*a+2],i.cp=t[5*a+3],i.sgp=t[5*a+4]):(i.t=t[4*a],i.v=t[4*a+1],i.c=t[4*a+2],i.cp=t[4*a+3]),i}return t[a]}}function k(e,t){var a=0;return t&&(a="opacity"===(e=e.split("$")[0])||"m_opacity"===e||-1!==["clip","fillClip","s_clip","s_bgClip"].indexOf(e)||"gradient"===e||"s_gradient"===e?t.length/5:t.length/4),a}function w(e,t,a,i){null!=i&&("opacity"===(e=e.split("$")[0])||"m_opacity"===e||-1!==["clip","fillClip","s_clip","s_bgClip"].indexOf(e)||"gradient"===e||"s_gradient"===e?t[5*a]=i:t[4*a]=i)}function x(e,t,a,i){null!=i&&("opacity"===(e=e.split("$")[0])||"m_opacity"===e||-1!==["clip","fillClip","s_clip","s_bgClip"].indexOf(e)||"gradient"===e||"s_gradient"===e?t[5*a+1]=i:t[4*a+1]=i)}function A(e){for(var t in e)Array.isArray(e[t])&&(e[t]=P(t,e[t]))}function P(e,t){if("number"==typeof t[0])return t;e=e.split("$")[0];for(var a=[],i=0;i<t.length;i++){var n=t[i];n&&null!==n.t&&("opacity"===e?a.push(n.t,n.v,n.c,n.cp,n.ob):"m_opacity"===e?a.push(n.t,n.v,n.c,n.cp,n.mob):-1!==["clip","fillClip","s_clip","s_bgClip"].indexOf(e)?a.push(n.t,n.v,n.c,n.cp,n.cd):"gradient"===e||"s_gradient"===e?a.push(n.t,n.v,n.c,n.cp,n.sgp):a.push(n.t,n.v,n.c,n.cp))}return a}function S(e,t){var a;if(!(a=window.editor?de().g2d:ht.animationplayer.g2d))return[];e=se(e);var i=[{points:[],segments:[]}];if(t)for(var n=0;n<t.length;n++){var r=t[n];switch(r){case 1:0!==n&&i.push({points:[],segments:[]}),i[i.length-1].points.push(e.shift());break;case 2:i[i.length-1].points.push(e.shift());break;case 3:i[i.length-1].points.push(e.shift()),i[i.length-1].points.push(e.shift());break;case 4:i[i.length-1].points.push(e.shift()),i[i.length-1].points.push(e.shift()),i[i.length-1].points.push(e.shift())}i[i.length-1].segments.push(r)}else i[0].points=e;for(var o=[],s=0,l=Math.ceil(100/i.length),c=0;c<i.length;c++){var f=i[c];if(f){var h=s,u=(c+1)*l;c===i.length-1&&(u=101),s+=l;for(var p=f.points,d=f.segments,v=h;v<u;v++){var m=100*(v-h)/(u-1-h),y=a.getPercentPositionOfPath(p,d,m);Math.abs(m)<1e-4&&(y.moveTo=1),o.push(y)}}}return o}function I(e,t,a,i){var n=[];if(window.editor){if(e.a("ht.animation_symbolBind"))for(var r=ve().getDatas().toArray((function(e){return e.a("ht.animation_symbolBind")})),o=0;o<r.length;o++){var s=r[o];s.a("ht.animation_symbolNail")&&n.push(s)}return M(n,t,a)}if(ht.animationplayer.symbolNails)for(var l in ht.animationplayer.symbolNails){if(-1!==l.split("_").indexOf(i)){n=ht.animationplayer.symbolNails[l];break}}return M(n,t,a)}function M(e,t,a){var i,n=[],r=[],o=[],s=[],l=[],c=[];if(e&&e.length){for(var f=0;f<e.length;f++){var h=e[f];if(window.editor){var u=h.getPosition();l.push([u.x,u.y])}else l.push(h)}c=re(l)}else{var p=re(t.points),d=re(a.points);if(!t.segments){t.segments=[];for(var v=0;v<p.length;v++)0===v?t.segments.push(1):t.segments.push(2)}for(var m=0;m<t.segments.length;m++){switch(t.segments[m]){case 1:case 2:l.push([p[0].x,p[0].y]),p.shift(),c.push([d[0].x,d[0].y]),d.shift();break;case 4:p.shift(),p.shift(),l.push([p[0].x,p[0].y]),p.shift(),d.shift(),d.shift(),c.push([d[0].x,d[0].y]),d.shift()}}}if(!(i=window.editor?de().g2d:ht.animationplayer.g2d))return[];for(var y=new ht.List,g=new ht.List,_=new ht.List,b=new ht.List,k=0;k<t.points.length;k++){var w=t.points[k];y.add({x:w.x,y:w.y})}for(var x=0;x<a.points.length;x++){var A=a.points[x];g.add({x:A.x,y:A.y})}t.segments?_.addAll(t.segments):_=void 0;var P=t.invert;a.segments?b.addAll(a.segments):b=void 0;for(var S=0;S<l.length;S++){var I=l[S],M=c[S],C=void 0,T=void 0;try{C=i.getNeareastPositionOfPath(y,_,I,!0).percent,T=i.getNeareastPositionOfPath(g,b,M,!0).percent,o.push(C),s.push(T)}catch(e){console.warn(e)}}o.push(o[0]+1),s.push(s[0]+(P?-1:1)),F(o,!1),F(s,P);for(var D=0;D<o.length-1;D++)for(var B=o[D],O=o[D+1],z=s[D],E=s[D+1],R=0;R<=100;R++){var V=N(R*(O-B)+100*B),L=N(R*(E-z)+100*z);if(null!==V&&null!==L){var H=i.getPercentPositionOfPath(y,_,N(R*(O-B)+100*B)),j=i.getPercentPositionOfPath(g,b,N(R*(E-z)+100*z));n.push(H),r.push(j)}}return[n,r]}function F(e,t){for(var a=1;a<e.length;a++){var i=e[a-1],n=e[a];if(t)for(;n>i;)n-=1;else for(;n<i;)n+=1;e[a]=n}}function N(e){return 100===e?null:e>=0?e%100:e%100+100}function C(){var e,t;if(window.editor&&window.editor.dm){var a=function(){var e=editor.dm.a("animation");e||editor.dm.a("animation",{v:"0.23"});return editor.dm.a("animation")}();a&&(e=a.symbolNails)}else e=ht.animationplayer.symbolNails;if(e&&(window.editor&&window.editor.dm?t=ve():ht.animationplayer.g2d&&(t=ht.animationplayer.g2d.dm()),t)){var i=t.getDatas().toArray(),n={};for(var r in e)for(var o=r.split("_"),s=0;s<i.length;s++){var l=i[s],c=l.s("prefix");if(-1!==o.indexOf(c)){var f=n[r];f||(f=ne(),n[r]=f),l.a("ht.animation_symbolBind",f)}}for(var h=0;h<i.length;h++){var u=i[h];if("7d5ec550-4517-11ec-88d2-d5de520499e1.json"===u.getImage()){u.a("ht.animation_symbolNail",!0);var p=u.getPosition();e:for(var d in e)for(var v=e[d],m=0;m<v.length;m++){var y=v[m];if(p.x===y[0]&&p.y===y[1]){u.a("ht.animation_symbolBind",n[d]);break e}}}}}}function T(e,t,a,i){return a-D(i-e,0,a,i)+t}function D(e,t,a,i){return(e/=i)<1/2.75?a*(7.5625*e*e)+t:e<2/2.75?a*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?a*(7.5625*(e-=2.25/2.75)*e+.9375)+t:a*(7.5625*(e-=2.625/2.75)*e+.984375)+t}function B(e,t,a,i,n){var r;switch(e){case"Linear":r=function(e,t,a,i){return a*e/i+t}(t,a,i,n);break;case"Back.easeIn":r=function(e,t,a,i,n){return void 0===n&&(n=1.70158),a*(e/=i)*e*((n+1)*e-n)+t}(t,a,i,n);break;case"Back.easeOut":r=function(e,t,a,i,n){return void 0===n&&(n=1.70158),a*((e=e/i-1)*e*((n+1)*e+n)+1)+t}(t,a,i,n);break;case"Back.easeInOut":r=function(e,t,a,i,n){return void 0===n&&(n=1.70158),(e/=i/2)<1?a/2*(e*e*((1+(n*=1.525))*e-n))+t:a/2*((e-=2)*e*((1+(n*=1.525))*e+n)+2)+t}(t,a,i,n);break;case"Bounce.easeIn":r=T(t,a,i,n);break;case"Bounce.easeOut":r=D(t,a,i,n);break;case"Bounce.easeInOut":r=function(e,t,a,i){return e<i/2?.5*T(2*e,0,a,i)+t:.5*D(2*e-i,0,a,i)+.5*a+t}(t,a,i,n);break;case"Circ.easeIn":r=function(e,t,a,i){return-a*(Math.sqrt(1-(e/=i)*e)-1)+t}(t,a,i,n);break;case"Circ.easeOut":r=function(e,t,a,i){return a*Math.sqrt(1-(e=e/i-1)*e)+t}(t,a,i,n);break;case"Circ.easeInOut":r=function(e,t,a,i){return(e/=i/2)<1?-a/2*(Math.sqrt(1-e*e)-1)+t:a/2*(Math.sqrt(1-(e-=2)*e)+1)+t}(t,a,i,n);break;case"Cubic.easeIn":r=function(e,t,a,i){return a*(e/=i)*e*e+t}(t,a,i,n);break;case"Cubic.easeOut":r=function(e,t,a,i){return a*((e=e/i-1)*e*e+1)+t}(t,a,i,n);break;case"Cubic.easeInOut":r=function(e,t,a,i){return(e/=i/2)<1?a/2*e*e*e+t:a/2*((e-=2)*e*e+2)+t}(t,a,i,n);break;case"Elastic.easeIn":r=function(e,t,a,i,n,r){return 0===e?t:1==(e/=i)?t+a:(r||(r=.3*i),!n||n<Math.abs(a)?(n=a,o=r/4):o=r/(2*Math.PI)*Math.asin(a/n),-n*Math.pow(2,10*(e-=1))*Math.sin((e*i-o)*(2*Math.PI)/r)+t);var o}(t,a,i,n);break;case"Elastic.easeOut":r=function(e,t,a,i,n,r){return 0===e?t:1==(e/=i)?t+a:(r||(r=.3*i),!n||n<Math.abs(a)?(n=a,o=r/4):o=r/(2*Math.PI)*Math.asin(a/n),n*Math.pow(2,-10*e)*Math.sin((e*i-o)*(2*Math.PI)/r)+a+t);var o}(t,a,i,n);break;case"Elastic.easeInOut":r=function(e,t,a,i,n,r){return 0===e?t:2==(e/=i/2)?t+a:(r||(r=i*(.3*1.5)),!n||n<Math.abs(a)?(n=a,o=r/4):o=r/(2*Math.PI)*Math.asin(a/n),e<1?n*Math.pow(2,10*(e-=1))*Math.sin((e*i-o)*(2*Math.PI)/r)*-.5+t:n*Math.pow(2,-10*(e-=1))*Math.sin((e*i-o)*(2*Math.PI)/r)*.5+a+t);var o}(t,a,i,n);break;case"Expo.easeIn":r=function(e,t,a,i){return 0===e?t:a*Math.pow(2,10*(e/i-1))+t}(t,a,i,n);break;case"Expo.easeOut":r=function(e,t,a,i){return e===i?t+a:a*(1-Math.pow(2,-10*e/i))+t}(t,a,i,n);break;case"Expo.easeInOut":r=function(e,t,a,i){return 0===e?t:e===i?t+a:(e/=i/2)<1?a/2*Math.pow(2,10*(e-1))+t:a/2*(2-Math.pow(2,-10*--e))+t}(t,a,i,n);break;case"Quad.easeIn":r=function(e,t,a,i){return a*(e/=i)*e+t}(t,a,i,n);break;case"Quad.easeOut":r=function(e,t,a,i){return-a*(e/=i)*(e-2)+t}(t,a,i,n);break;case"Quad.easeInOut":r=function(e,t,a,i){return(e/=i/2)<1?a/2*e*e+t:-a/2*(--e*(e-2)-1)+t}(t,a,i,n);break;case"Quart.easeIn":r=function(e,t,a,i){return a*(e/=i)*e*e*e+t}(t,a,i,n);break;case"Quart.easeOut":r=function(e,t,a,i){return-a*((e=e/i-1)*e*e*e-1)+t}(t,a,i,n);break;case"Quart.easeInOut":r=function(e,t,a,i){return(e/=i/2)<1?a/2*e*e*e*e+t:-a/2*((e-=2)*e*e*e-2)+t}(t,a,i,n);break;case"Quint.easeIn":r=function(e,t,a,i){return a*(e/=i)*e*e*e*e+t}(t,a,i,n);break;case"Quint.easeOut":r=function(e,t,a,i){return a*((e=e/i-1)*e*e*e*e+1)+t}(t,a,i,n);break;case"Quint.easeInOut":r=function(e,t,a,i){return(e/=i/2)<1?a/2*e*e*e*e*e+t:a/2*((e-=2)*e*e*e*e+2)+t}(t,a,i,n);break;case"Sine.easeIn":r=function(e,t,a,i){return-a*Math.cos(e/i*(Math.PI/2))+a+t}(t,a,i,n);break;case"Sine.easeOut":r=function(e,t,a,i){return a*Math.sin(e/i*(Math.PI/2))+t}(t,a,i,n);break;case"Sine.easeInOut":r=function(e,t,a,i){return-a/2*(Math.cos(Math.PI*e/i)-1)+t}(t,a,i,n);break;case"Jump":r=function(e,t){return t}(0,a);break;default:Array.isArray(e)&&(r=function(e,t,a,i,n){return function(e,t,a,i,n){var r=1-e,o=1-e;return r*r*r*t+3*o*o*e*a+3*(1-e)*e*e*i+e*e*e*n}(t/n,a,a+e[1]*i,a+e[3]*i,a+i)}(e,t,a,i,n))}return r}function O(e,t,a,i,n){var r=oe(e),o=oe(t);if(r&&o){for(var s=[],l=0;l<r.length;l++){var c=B(a,i,r[l],o[l]-r[l],n);s.push(c)}return s}}function z(e,t,a,i,n){for(var r=[],o=0;o<e.length;o++){var s=B(a,i,e[o],t[o]-e[o],n);r.push(s)}return r}function E(e,t,a,i,n,r,o){var s;if(!(s=window.editor?de().dividedPoints:ht.animationplayer.dividedPoints))return{points:[],segments:[]};var l=[],c=[],f=null;if(s)s.has(e)?l=s.get(e):(e.points.length===t.points.length?(f=I(r,e,t,o))&&(l=f[0]):l=S(e.points,e.segments),s.set(e,l)),s.has(t)?c=s.get(t):(e.points.length===t.points.length?(f=I(r,e,t,o))&&(c=f[1]):c=S(t.points,t.segments),s.set(t,c));else{if(s=new Map,e.points.length===t.points.length){var h=I(r,e,t,o);h&&(l=h[0]||[],c=h[1]||[])}else l=S(e.points,e.segments),c=S(t.points,t.segments);if(s.set(e,l),s.set(t,c),window.editor){var u=pe();ht.animationeditor[u].dividedPoints=s}else ht.animationplayer.dividedPoints=s}l.length!==c.length&&(c=S(t.points,t.segments),l.length!==c.length&&(l=S(e.points,e.segments)));for(var p=[],d=[],v=0;v<l.length;v++){var m=l[v],y=c[v];if(m.moveTo?d.push(1):d.push(2),Array.isArray(m))for(var g=0;g<m.length;g++){var _=m[g],b=y[g];_.moveTo?d.push(1):d.push(2);var k=B(a,i,_.x,b.x-_.x,n),w=B(a,i,_.y,b.y-_.y,n);p.push({x:k,y:w})}else{var x=B(a,i,m.x,y.x-m.x,n),A=B(a,i,m.y,y.y-m.y,n);p.push({x:x,y:A})}}return{points:p,segments:d}}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,a=function(t,a){e(t,a)};return ht.Default.registerHeartbeat(a,t),a}function V(e){ht.Default.unregisterHeartbeat(e)}function L(e,t,a){var i;if(i="number"==typeof e[0]?b(a,e,t):e[t]){var n=i.v;return a=a.split("$")[0],-1!==["s_b_color","s_s_color","s_bg","s_gradient","s_d_color","bg","gradient","d_color","b_color","s_color","fog","color","h_color","wf_opacity","lp_color","ls_color","ld_color","lr_color","flow_blend","points_color","text_color","s_text_color","sky_color","e_bodyColor","e_color","scene_highlightColor","_gis.baseMapFilter","m_diffuse","m_emissive","m_rimColor","m_specularColor","custom:bp_mat_cloud_ground_color","splat_blend","mr_bg","mr_ref"].indexOf(a)?oe(n):"s_move"===a?{x:n.x,y:n.y,w:g(n),h:_(n),ax:m(n),ay:y(n)}:n}}function H(e,t,a,i,n,r){if(e&&a){if(null===i)return;switch(a){case"s_move":i=function(e,t){var a=t.x,i=t.y,n=g(t),r=_(t),o=m(t),s=y(t);return void 0===o&&(o=.5),void 0===s&&(s=.5),[a-n*o,i-r*s,n,r]}(0,i),e.a(t+".rect",i);break;case"s_angle":e.a(t+".rotation",i);break;case"s_x_anchor":e.a(t+".anchorX",i);break;case"s_y_anchor":e.a(t+".anchorY",i);break;case"s_x_s":e.a(t+".scaleX",i);break;case"s_y_s":e.a(t+".scaleY",i);break;case"s_opacity":e.a(t+".opacity",i);break;case"s_s_color":i&&e.a(t+".shadowColor","rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")");break;case"s_s_blur":e.a(t+".shadowBlur",i);break;case"s_s_offsetX":e.a(t+".shadowOffsetX",i);break;case"s_s_offsetY":e.a(t+".shadowOffsetY",i);break;case"s_bg":i&&e.a(t+".background","rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")");break;case"s_gradient":if(i&&Array.isArray(i[1])){for(var o=0;o<i[1].length;o++)Array.isArray(i[1][o])&&(i[1][o]="rgba("+i[1][o][0]+","+i[1][o][1]+","+i[1][o][2]+","+i[1][o][3]+")");e.a(t+".gradientPack",i[1]),i[0]&&e.a(t+".gradientColor","rgba("+i[0][0]+","+i[0][1]+","+i[0][2]+","+i[0][3]+")")}else r&&e.a(t+".gradientPack",r),i&&e.a(t+".gradientColor","rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")");break;case"s_b_width":e.a(t+".borderWidth",i);break;case"s_b_color":i&&e.a(t+".borderColor","rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")");break;case"s_b_gradient":if(i&&Array.isArray(i)){for(var s=0;s<i.length;s++)Array.isArray(i[s])&&(i[s]="rgba("+i[s][0]+","+i[s][1]+","+i[s][2]+","+i[s][3]+")");e.a(t+".borderGradientPack",i)}break;case"s_d_color":i&&e.a(t+".dashColor","rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")");break;case"s_d_offset":e.a(t+".dashOffset",i);break;case"s_d_width":e.a(t+".dashWidth",i);break;case"s_points":var l=[],c=[];i.segments&&(c=i.segments);for(var f=0;f<i.points.length;f++){var h=i.points[f];l.push(h.x,h.y),i.segments||(0===f?c.push(1):c.push(2))}e.a(t+".points",l),e.a(t+".segments",c);break;case"s_clip":n&&e.a(t+".clipDirection",n),e.a(t+".clipPercentage",i);break;case"s_bgClip":n&&e.a(t+".fillClipDirection",n),e.a(t+".fillClipPercentage",i);break;case"s_text":e.a(t+".text",Math.floor(i));break;case"s_text_color":i&&e.a(t+".color","rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")");break;case"arc_from":e.a(t+".arcFrom",i);break;case"arc_to":e.a(t+".arcTo",i)}}}function j(e,t){try{var a,i,n=e.dm();if(t)a=t;else a=null===(i=de())||void 0===i?void 0:i.animateListOnClick;var r=n.a("ht.animationSpeeds");if(r)for(var o=0;o<r.length;o++){var s=r[o];if(a===s[0])return s[1]}return 1}catch(e){console.warn("checkFileSpeed")}}s.containsPoint,s.removeHTML,s.appendToScreen,document&&ht.Default.createCanvas().getContext("2d");var $=ht.Default;function G(e){var t=e.getPosition3d(),a=new ht.Math.Vector3(t),i=new ht.Math.Vector3(1,1,1),n=e.getQuaternion();e._matrixWorld.compose(a,n,i)}$.drawText,$.drawImage;var W=function(e,t,a,i,n){ht.Node.call(this),ht.Default.setRenderLayerInfo("waterLayer",{priority:10001,clearDepth:!1});var r=this;r.setRenderLayer("waterLayer");var o=new q,s=new ht.Math.Vector3,l=new ht.Math.Vector3,c=new ht.Math.Vector3,f=new ht.Math.Matrix4,h=new ht.Math.Vector3(0,0,-1),u=new ht.Math.Vector4,p=new ht.Math.Vector3,d=new ht.Math.Vector3,v=new ht.Math.Vector4;n.setCullingMask("main"),n.s({"camera.aspect":1,"camera.fovy":50*Math.PI/180,"camera.near":.1,"camera.far":15e3}),n.getProjectMatrix(),n._matrixWorld=new ht.Math.Matrix4,n.attachRenderTarget(a),r._matrixWorld=new ht.Math.Matrix4,r.update=function(){var a=e.getCamera();if(a._matrixWorld=new ht.Math.Matrix4,a.getProjectMatrix(),G(r),G(a),l.setFromMatrixPosition(r._matrixWorld),c.setFromMatrixPosition(a._matrixWorld),f.extractRotation(r._matrixWorld),s.set(0,0,1),s.applyMatrix4(f),p.subVectors(l,c),!(p.dot(s)>0)){p.reflect(s).negate(),p.add(l),f.extractRotation(a._matrixWorld),h.set(0,0,-1),h.applyMatrix4(f),h.add(c),d.subVectors(l,h),d.reflect(s).negate(),d.add(l),n.p3(p.x,p.y,p.z);var m=new ht.Math.Vector3(0,1,0);m.applyMatrix4(f),m.reflect(s),n.lookAt([d.x,d.y,d.z],[m.x,m.y,m.z]),n.s("camera.far",a.s("camera.far")),G(n),n.setProjectMatrix(a.getProjectMatrix()),n.setViewMatrix((new ht.Math.Matrix4).getInverse(n._matrixWorld)),t.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),t.multiply((new ht.Math.Matrix4).copy(n._projectMatrix));var y=new ht.Math.Matrix4;y.getInverse(n._matrixWorld),t.multiply(y),o.setFromNormalAndCoplanarPoint(s,l),o.applyMatrix4(y),u.set(o.normal.x,o.normal.y,o.normal.z,o.constant);var g=n.getProjectMatrix();v.x=(Math.sign(u.x)+g[8])/g[0],v.y=(Math.sign(u.y)+g[9])/g[5],v.z=-1,v.w=(1+g[10])/g[14],u.multiplyScalar(2/u.dot(v)),g[2]=u.x,g[6]=u.y,g[10]=u.z+1-0,g[14]=u.w,n.setProjectMatrix(g),i.setFromMatrixPosition(a._matrixWorld),n.render(e)}}};W.prototype=Object.create(ht.Node.prototype),W.prototype.constructor=W;var U=new ht.Math.Matrix3,J=new ht.Math.Vector3,q=function(){this.normal=new ht.Math.Vector3(1,0,0),this.constant=0};q.prototype.constructor=q,q.prototype.setFromNormalAndCoplanarPoint=function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},q.prototype.applyMatrix4=function(e){var t=U.getNormalMatrix(e),a=this.coplanarPoint(J).applyMatrix4(e),i=this.normal.applyMatrix3(t).normalize();return this.constant=-a.dot(i),this},q.prototype.coplanarPoint=function(e){return void 0===e&&(e=new ht.Math.Vector3),e.copy(this.normal).multiplyScalar(-this.constant)};var K={vs:[-1e4,1e4,0,1e4,1e4,0,-1e4,-1e4,0,1e4,-1e4,0],ns:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,0,0,1,0],is:[0,2,1,2,3,1]};function X(e,t){var a=e[0].a("ht.animationBoneIds");if(a){for(var i=(t?t.dm():ve()).getDatas().toArray(),n=[],r=0;r<a.length;r++)for(var o=a[r],s=0;s<i.length;s++){var l=i[s];if(l.a("ht.animationBoneId")===o){n.push(l);break}}!function(e,t){if(e.length)for(var a=0;a<e.length;a++){for(var i=e[a],n=i.getPoints(),r=i.a("originPoints"),o=i.a("ht.animationBoneId"),s={},l=0;l<t.length;l++){var c=t[l],f=c.a("matrixWorld"),h=c.a("originMatrixWorld"),u=c.a("boneWeight");if(u){var p=u[o];if(p)for(var d in p){var v=p[d];if(v){var m=r[Number(d)],y=new ht.Math.Vector2(m.x,m.y),g=h.clone().invert().prepend(f).apply(y);g.x*=v/100,g.y*=v/100,s[d]?(s[d].x+=g.x,s[d].y+=g.y):s[d]={x:g.x,y:g.y}}}}}for(var _ in s){var b=s[_];n.set(Number(_),{x:b.x,y:b.y})}}}(n,e)}}function Y(e){var t=e.a("cb");if(t&&t.length)for(var a=ve(),i=e.a("matrixWorld"),n=0;n<t.length;n++){var r=a.getDataByTag(t[n]),o=r.a("matrix");r.a("matrixWorld",o.clone().prepend(i)),Y(r)}}function Q(e,t,a){var i=e.a("cb");if(i&&i.length){var n;n=a?a.dm():ve();for(var r=0;r<i.length;r++){var o=n.getDataByTag(i[r]);if(o){var s=o.a("matrix").clone().prepend(t);o.a("matrixWorld",s);var l=s.decompose();l&&(o.a("byParent",!0),o.setPosition(l.translateX,l.translateY),o.setRotation(l.rotation),o.a("byParent",void 0)),Q(o,s,a)}}}}function Z(e){var t=e.getPosition(),a=e.getRotation(),i=new ht.Math.Matrix2d(a,t.x,t.y);e.a("matrixWorld",i)}function ee(e,t,a){var i;if(i=a||de().g2d){i.disableDirtyRect();for(var n=function(t){var n;if(a)n=ht.animationplayer.bone2DListener[t.getId()];else{var r=pe();n=ht.animationeditor[r].bone2DListener[t.getId()]}if(!n)if(n=t.onPropertyChanged,a)ht.animationplayer.bone2DListener[t.getId()]=n;else{var o=pe();ht.animationeditor[o].bone2DListener[t.getId()]=n}var s=function(){t.onPropertyChanged=function(r){if((n.apply(t,[r]),window.editor)&&de().onBoneSerialize)return;"rotation"===r.property?t.a("byChild")||t.a("byParent")||(Z(t),Q(t,t.a("matrixWorld"),a),X(e,a)):"position"===r.property&&(t.a("byParent")||(Z(t),Q(t,t.a("matrixWorld"),a),void 0===t.a("p")||t.a("bySameLevel")||(function(e,t){var a=(t?t.dm():ve()).getDataByTag(e.a("p")),i=e.getPosition();if(a){var n=a.getPosition(),r=Math.pow((n.x-i.x)*(n.x-i.x)+(n.y-i.y)*(n.y-i.y),.5);a.setSize(r,25);var o=new ht.Math.Vector2(n.x,n.y),s=new ht.Math.Vector2(n.x+100,n.y),l=new ht.Math.Vector2(i.x,i.y),c=(new ht.Math.Vector2).subVectors(s,o),f=(new ht.Math.Vector2).subVectors(l,o),h=c.clone().cross(f),u=c.length(),p=f.length(),d=c.dot(f)/(u*p),v=Math.acos(d);h<0&&(v*=-1),a.a("byChild",!0),a.setRotation(v),a.a("byChild",void 0);var m=new ht.Math.Matrix2d(v,n.x,n.y);a.a("matrixWorld",m)}}(t,a),function(e,t){for(var a=t.a("boneIndex"),i=a.split("_"),n=[],r=0;r<e.length;r++){var o=e[r],s=o.a("boneIndex");if(s!==a){var l=s.split("_");if(l.length===i.length){for(var c=!0,f=0;f<i.length-1;f++)i[f]!==l[f]&&(c=!1);c&&n.push(o)}}}if(n.length)for(var h=0;h<n.length;h++){var u=n[h],p=t.getPosition();u.a("bySameLevel",!0),u.setPosition(p.x,p.y),u.a("bySameLevel",void 0);var d=u.getRotation(),v=new ht.Math.Matrix2d(d,p.x,p.y);u.a("matrixWorld",v),Y(u)}}(e,t)),X(e,a),i.iv()))}};if(a){var l=Date.now();!function e(){var a=requestAnimationFrame(e);t.onPropertyChanged=function(e){(n.apply(t,[e]),-1===["a:matrix","a:matrixWorld","a:originMatrixWorld"].indexOf(e.property))?(cancelAnimationFrame(a),s()):Date.now()-l>500&&(cancelAnimationFrame(a),s())}}()}else s()},r=0;r<e.length;r++){var o=e[r];t?(o.a("ht.boneListener",!0),n(o)):o.a("ht.boneListener")||(o.a("ht.boneListener",!0),n(o))}}}function te(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(e?e.dm():ve()).getDatas().toArray(),a={},i=0;i<t.length;i++){var n=t[i];if(void 0!==n.a("boneIndex")){var r=n.a("ht.animationBoneIds");if(r){var o=r.join("_");a[o]||(a[o]=[]),a[o].push(n)}}}for(var s in a){var l=a[s];ee(l,!0,e),ae(l)}}function ae(e){for(var t=0;t<e.length;t++){var a=e[t],i=a.a("matrix"),n=a.a("matrixWorld"),r=a.a("originMatrixWorld");!i||i instanceof ht.Math.Matrix2d||a.a("matrix",ie(i)),!n||n instanceof ht.Math.Matrix2d||a.a("matrixWorld",ie(n)),!r||r instanceof ht.Math.Matrix2d||a.a("originMatrixWorld",ie(r))}}function ie(e){var t=new ht.Math.Matrix2d;return t.set(e.a,e.b,e.c,e.d,e.tx,e.ty),t}function ne(){return""+Date.now()+Math.floor(1e3*Math.random())}function re(e){if(e)return JSON.parse(JSON.stringify(e))}function oe(e){var t;if(e&&"string"==typeof e)return e.split("#").length>1?(t=function(e){var t;e=e.toString();var a=function(e){for(var a=[],i=e.length,n=0;n<i;n++)48<=(t=e.charCodeAt(n))&&t<58?t-=48:t=(223&t)-65+10,a[n]=t;return a.reduce((function(e,t){return e=16*e+t}),0)},i=a(e.substring(0,2)),n=a(e.substring(2,4)),r=a(e.substring(4,6));return e.length>6?[i,n,r,a(e.substring(6,8))]:[i,n,r]}(t=e.split("#")[1]),3===t.length?(t.push(1),t):t):e.split("rgba(").length>1?(t=e.split("rgba(")[1].split(")")[0].split(","),[Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])]):e.split("rgb(").length>1?(t=e.split("rgb(")[1].split(")")[0].split(","),[Number(t[0]),Number(t[1]),Number(t[2]),1]):[(t=ht.Default.toColorData(e))[0],t[1],t[2],t[3]/255]}function se(e){return null===e||"object"!==r(e)?e:e instanceof Date?new Date(e.getTime()):Array.isArray(e)?e.map((function(e){return se(e)})):e instanceof Object?Object.keys(e).reduce((function(t,a){return t[a]=se(e[a]),t}),{}):void console.error("Unable to copy obj! Its type isn't supported.")}function le(e,t){var a=e[t];if(!a||"number"==typeof a)return!0;void 0!==a.edge&&delete a.edge,void 0!==a.animationType&&delete a.animationType,void 0!==a.currentPos&&delete a.currentPos,void 0!==a.cp&&delete a.cp,void 0!==a.time&&(a.t=a.time,delete a.time),void 0!==a.value&&(a.v=se(a.value),delete a.value),void 0!==a.animationCurve&&(a.c=se(a.animationCurve),delete a.animationCurve),void 0!==a.opacity_bool&&(a.ob=a.opacity_bool,delete a.opacity_bool),void 0!==a.m_opacity_bool&&(a.mob=a.m_opacity_bool,delete a.m_opacity_bool),void 0!==a.m_ob&&(a.mob=a.m_ob,delete a.m_ob),void 0!==a.clipDirection&&(a.cd=a.clipDirection,delete a.clipDirection)}function ce(e,t){e[0]&&"number"!=typeof e[0]&&(void 0!==e[t].currentPos&&delete e[t].currentPos,void 0!==e[t].time&&(e[t].t=e[t].time,delete e[t].time),void 0!==e[t].value&&(e[t].v=se(e[t].value),delete e[t].value),e[t].animationType&&delete e[t].animationType,e[t].animationCurve&&(e[t].c=e[t].animationCurve,delete e[t].animationCurve),void 0===e[t].c&&(e[t].c=0),e[t].clipDirection&&(e[t].cd=e[t].clipDirection,delete e[t].clipDirection),e[t].cp=0)}function fe(e,t,a){if(void 0!==e[t]){if(["scene_highlightColor","mr_bg","mr_ref"].includes(t)){var i=e[t];return"rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")"}return e[t]}return a}function he(e,t,a,i,n){var r,o,s,l,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,f=a.split("$"),h=b(a,e,t),u=b(a,e,t+1);if(h&&u&&void 0!==h.t&&void 0!==u.t){var p=h.c;if(p||(p="Linear"),"custom"===f[0].split(":")[0])return"string"==typeof h.v?h.v.includes(".")?h.v:(r=O(h.v,u.v,p,i-h.t,u.t-h.t),Array.isArray(r)?"rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")":void 0):Array.isArray(h.v)?r=z(h.v,u.v,p,i-h.t,u.t-h.t):"number"==typeof h.v?(s=u.t-h.t,l=u.v-h.v,r=B(p,i-h.t,h.v,l,s)):void 0;if(-1!==["s_b_color","s_s_color","s_bg","s_gradient","s_d_color","bg","gradient","d_color","b_color","s_color","fog","color","h_color","wf_opacity","lp_color","ls_color","ld_color","lr_color","flow_blend","points_color","text_color","s_text_color","sky_color","e_bodyColor","e_color","scene_highlightColor","_gis.baseMapFilter","m_diffuse","m_emissive","m_rimColor","m_specularColor","custom:bp_mat_cloud_ground_color","splat_blend","mr_bg","mr_ref"].indexOf(f[0])){if(r=O(h.v,u.v,p,i-h.t,u.t-h.t),"gradient"===f[0]||"s_gradient"===f[0]){var d=function(e,t,a,i,n){if(e&&t&&e.sgp&&t.sgp){ue(e,t,"sgp");var r=[];r.push(e.sgp[0]);for(var o=1;o<e.sgp.length;o++){var s=e.sgp[o],l=t.sgp[o];if("number"==typeof s){var c=B(a,i-e.t,s,l-s,n);r.push(c)}else if("string"==typeof s){var f=O(s,l,a,i-e.t,n);r.push(f)}}return r}}(h,u,p,i,u.t-h.t);if(d&&d[0])return[r,d]}return r}if(-1!==["b_gradient","s_b_gradient"].indexOf(f[0]))return r=function(e,t,a,i,n){if(e&&t&&e.v&&t.v){ue(e,t,"v");var r=[];r.push(e.v[0]);for(var o=1;o<e.v.length;o++){var s=e.v[o],l=t.v[o];if("number"==typeof s){var c=B(a,i-e.t,s,l-s,n);r.push(c)}else if("string"==typeof s){var f=O(s,l,a,i-e.t,n);r.push(f)}}return r}}(h,u,p,i,u.t-h.t),r;if(-1!==["m_diffuse","m_emissive","m_rimColor","m_specularColor"].indexOf(f[0]))return r=O(h.v,u.v,p,i-h.t,u.t-h.t);if("s_move"===f[0])return r=function(e,t,a,i,n){var r=B(a,i,e.x,t.x-e.x,n),o=B(a,i,e.y,t.y-e.y,n),s=B(a,i,g(e),g(t)-g(e),n),l=B(a,i,_(e),_(t)-_(e),n),c=m(e),f=y(t);return void 0===c&&(c=.5),void 0===f&&(f=.5),{x:r,y:o,w:s,h:l,ax:c,ay:f}}(h.v,u.v,p,i-h.t,u.t-h.t),r;if("s_points"===f[0]){var v,w,x;if(window.editor){var A=de();A&&(v=A.byBeforeFrame,w=A.byNextFrame,x=A.byCtrlDrag)}if(v||w||x){for(var P=k(a,e),S=0;S<P;S++){var I=b(a,e,S);if(I&&I.t===i){r=I.v;break}}void 0===r&&(r=E(h.v,u.v,p,i-h.t,u.t-h.t,n,c))}else r=E(h.v,u.v,p,i-h.t,u.t-h.t,n,c);return r}if(-1!==["hue","saturation","lightness","env_p","bone","shadow_bounding","m_normalScale","lr_size","custom:bp_mat_cloud_light_dir","c_up","mr_nor","mr_pos"].indexOf(f[0]))return r=z(h.v,u.v,p,i-h.t,u.t-h.t);if("symbol"===f[0])return r=i===u.t?u.v:h.v;if(-1!==["x_r","y_r","z_r","x_euler","y_euler","z_euler"].indexOf(f[0])){var M;if(n.a("ht.animation_trajectory"))if(Math.abs(u.v-h.v)>Math.PI)return M=h.v>=0?2*Math.PI+u.v:-2*Math.PI+u.v,o=h.v,s=u.t-h.t,l=M-h.v,r=B(p,i-h.t,o,l,s),isNaN(r)?void 0:r}else{if("mat"===f[0]||"host"===f[0])return h.v;if(-1!==["pathAnimation_animStart","pathAnimation_animMoveEye","ld","h_mode"].indexOf(f[0]))return h.v}return"img"===f[0]||"shape3d"===f[0]?(o=h.v,r=B("Jump",i-h.t,o)):(o=Number(h.v),s=u.t-h.t,l=u.v-h.v,r=B(p,i-h.t,o,l,s)),"number"==typeof r&&isNaN(r)?void 0:r}}function ue(e,t,a){var i,n,r;"string"==typeof e[a]?i="string":"linear"===e[a][0]?i="linear":"radial"===e[a][0]&&(i="radial"),"string"==typeof t[a]?n="string":"linear"===t[a][0]?n="linear":"radial"===t[a][0]&&(n="radial"),"string"===(r="string"!==i?i:n)?(e[a]=["linear",.5,0,.5,1,0,e[a],1,e[a]],t[a]=["linear",.5,0,.5,1,0,t[a],1,t[a]]):"linear"===r?("string"===i&&(e[a]=["linear",.5,0,.5,1,0,e[a],1,e[a]]),"string"===n?t[a]=["linear",.5,0,.5,1,0,t[a],1,t[a]]:"radial"===n&&(t[a]=["linear",.5,0,.5,1,0,t[a][5],1,t[a][7]])):"radial"===r&&("string"===i&&(e[a]=["radial",.5,.5,.5,0,e[a],1,e[a]]),"string"===n?t[a]=["radial",.5,.5,.5,0,t[a],1,t[a]]:"linear"===n&&(t[a]=["radial",.5,.5,.5,0,t[a][6],1,t[a][8]]))}function pe(){var e=window.editor.mainTabView.getCurrentTab();if(e){var t=e.getTag();if(t)return t}}function de(e){var t;if(e)return null===(t=ht.animationeditor)||void 0===t?void 0:t[e];var a,i=pe();return i?null===(a=ht.animationeditor)||void 0===a?void 0:a[i]:void 0}function ve(e){var t;if((t=e||pe())&&ht.animationeditor[t]){if(ht.animationeditor[t].dataModel2D)return ht.animationeditor[t].dataModel2D;if(ht.animationeditor[t].dataModel3D)return ht.animationeditor[t].dataModel3D}}function me(){return"0.23.15.2"}var ye=function(){function e(){l(this,e),this._onSymbolAnimation=!1,this._idsForNodeHasSymbolAnimation=[],this._stop={},this._animateIndex=0,this._animateIndexMap={},this._currentAnimateId=[],this._nowDate={},this._currentAnimateTime={},this._speed=1,this._length=0,this._finishParamsSet=new Set,this._finishParamsSet2=new Set,this._endFrame=null,this._onPause=null,this._pauseAnimateIndex=[],this._eventObj={},this._eventFunc={},this._eventScope={},this._notifier=null}return h(e,[{key:"checkSymbolAnimation",value:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0;this._idsForNodeHasSymbolAnimation.length=0;var n,o=new Map,s=[],l=[],c=function(a){var i,n=a.getId();if(e instanceof ht.graph.GraphView?a.getImage&&(i=a.getImage()):i=function(e){return e.s("shape3d.image")?"object"===r(e.s("shape3d.image"))?e.s("shape3d.image").image:e.s("shape3d.image"):e.s("shape3d.top.image")?e.s("shape3d.top.image"):e.s("shape3d.bottom.image")?e.s("shape3d.bottom.image"):e.s("shape3d.from.image")?e.s("shape3d.from.image"):e.s("shape3d.to.image")?e.s("shape3d.to.image"):e.s("all.image")?e.s("all.image"):e.s("top.image")?e.s("top.image"):e.s("bottom.image")?e.s("bottom.image"):e.s("front.image")?e.s("front.image"):e.s("back.image")?e.s("back.image"):e.s("left.image")?e.s("left.image"):e.s("right.image")?e.s("right.image"):void 0}(a),i){var c=ht.Default.getImage(i);c?(t.checkSymbolNails(c),o.set(n,c)):(s.push(i),l.push(n))}};a?c(a):e.dm().getDatas().each((function(e){c(e)}));var f=function(){o.forEach((function(e,a){var i=e.animation;if(i){i.animationSpeed&&!n&&(n=i.animationSpeed);var o={};o.nodeId=a;var s=i.animationVersion;if(s||(s=i.v),s||(s="0.20"),s){var l=s.split(".");if("0"===l[0]&&Number(l[1])<21)for(var c in i){var f=i[c];if("object"===r(f))for(var h in f){var u=f[h];for(var p in u){var d=u[p];if(Array.isArray(d))for(var v=0;v<d.length;v++)ce(d,v)}void 0!==u.repeat&&(u.r=u.repeat,delete u.repeat),void 0!==u.endTime&&(u.e=u.endTime,delete u.endTime),A(u)}}}o.value=i,t._idsForNodeHasSymbolAnimation.push(o)}})),t._speed=n||1,C(),i&&i()};if(s.length){var h=Date.now();!function e(){var t;t=ht.animationplayer._raf?ht.animationplayer._raf(e):requestAnimationFrame(e),0===s.length&&(ht.animationplayer._caf?ht.animationplayer._caf(t):cancelAnimationFrame(t),f()),Date.now()-h>1e5&&(ht.animationplayer._caf?ht.animationplayer._caf(t):cancelAnimationFrame(t));for(var a=0;a<s.length;a++){var i=s[a],n=ht.Default.getImage(i);if(n){s.splice(a,1);var r=l.splice(a,1);o.set(r[0],n);break}}}()}else f()}},{key:"checkSymbolNails",value:function(e){var t=e.animation;if(t){var a=t.symbolNails;if(a)for(var i in ht.animationplayer.symbolNails||(ht.animationplayer.symbolNails={}),a)ht.animationplayer.symbolNails[i]||(ht.animationplayer.symbolNails[i]=a[i])}}},{key:"checkSymbolAnimationKey",value:function(e){if(e){var t=this._idsForNodeHasSymbolAnimation;if(t.length){for(var a,i=0;i<t.length;i++){var n=t[i];if(n.nodeId===e.getId()){a=n.value;break}}if(a){var o=[];for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];if("object"===r(l))for(var c in l)l.hasOwnProperty(c)&&o.push(c+e.getId())}if(o.length)return o}}}}},{key:"_getSymbolFileNameByNode",value:function(e){if(e){var t=this._idsForNodeHasSymbolAnimation;if(t.length){for(var a,i=0;i<t.length;i++){var n=t[i];if(n.nodeId===e.getId()){a=n.value;break}}if(a){var o=[];for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];if("object"===r(l))for(var c in l)l.hasOwnProperty(c)&&o.push(c)}return o}}}}},{key:"setCurrentFrame",value:function(e,t,a,i){var n=this._idsForNodeHasSymbolAnimation;if(a)for(var r=0;r<n.length;r++){var o=n[r],s=o.nodeId,l=o.value;if(a.getId()===s){var c=this.getArrsToPlay(a,l,t);for(var f in c)if(c.hasOwnProperty(f)){var h=this._getKeyFromFileNameAndNodeId(f,s);h||(h=f+"$"+s+"$"+this._animateIndex);var u=c[f];for(var p in u)u.hasOwnProperty(p)&&"endTime"!==p&&"endFrame"!==p&&"e"!==p&&"repeat"!==p&&"r"!==p&&(this._currentAnimateTime[h]=i/60,this.playAnimate(a,h,p,u[p],null,null))}break}}else for(var d=0;d<n.length;d++){var v=n[d],m=v.nodeId,y=v.value,g=e.dm().getDataById(m),_=this.getArrsToPlay(g,y,t);for(var b in _)if(_.hasOwnProperty(b)){var k=b+"$"+m,w=_[b];for(var x in w)w.hasOwnProperty(x)&&"endTime"!==x&&"endFrame"!==x&&"e"!==x&&"repeat"!==x&&"r"!==x&&(this._currentAnimateTime[k]=i/60,this.playAnimate(g,k,x,w[x],null,null))}}}},{key:"_getKeyFromFileNameAndNodeId",value:function(e,t){for(var a in this._currentAnimateTime){var i=a.split("$");if(i[0]===e&&i[1]===t)return a}}},{key:"setRepeat",value:function(e,t,a){this._idsForNodeHasSymbolAnimation.length||this.checkSymbolAnimation(e);for(var i=this._idsForNodeHasSymbolAnimation,n=0;n<i.length;n++){var o=i[n].value;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s];"object"===r(l)&&l[t]&&(l[t].r=a)}}}},{key:"playDuring",value:function(e,t,a,i,n,r,o){void 0!==n&&(i>n&&(console.warn("ht.animationplayer: start frame > end frame"),i=n),this._endFrame=n),this.setCurrentFrame(e,t,a,i),this.play(e,t,a,r,o)}},{key:"play",value:function(e,t,a,i,n,r,o){var s;this._onPause?s=o:(this._animateIndex++,this._length=0,s=this._animateIndex);var l=this._idsForNodeHasSymbolAnimation;if(a)for(var c=0;c<l.length;c++){var f=l[c],h=f.nodeId,u=f.value;if(a.getId()===h){var p=this.playSingle(a,u,t);p&&this.setAnimate(a,p,i,n,r,s);break}}else{for(var d={},v=0;v<l.length;v++){var m=l[v],y=m.nodeId,g=m.value,_=e.dm().getDataById(y),b=this.playSingle(_,g,t);b&&(d[y]=b)}this.setAnimates(e,d,i,n,r,s)}return e.invalidateAll(),s}},{key:"playSingle",value:function(e,t,a){if(e)return this.getArrsToPlay(e,t,a)}},{key:"getArrsToPlay",value:function(e,t,a){var i=function(e,t,a,i){if(e){t[a]?t[a][i]||(t[a][i]={}):(t[a]={},t[a][i]={});var n=e[a];if(n){t[a].endFrame=v(n),t[a].repeat=d(n);var r={};for(var o in n)n.hasOwnProperty(o)&&Array.isArray(n[o])&&n[o].length&&(r[o]=n[o]);t[a][i]=r}}};if(e){var n={};for(var o in t)if(t.hasOwnProperty(o)){var s=t[o];if("object"===r(s))if(a)i(s,n,a,o);else for(var l in s)s.hasOwnProperty(l)&&i(s,n,l,o)}return n}}},{key:"setAnimate",value:function(e,t,a,i,n,r){var o=this,s=1,l=e.getId();if(s=n||this._speed,!this._onPause)for(var c in t)if(t.hasOwnProperty(c)){var f=c+"$"+l+"$"+r;this._nowDate[f]=Date.now(),this._currentAnimateTime[f]=s>=0?0:t[c].endFrame/60,this._animateIndexMap[r]?this._animateIndexMap[r].push(f):this._animateIndexMap[r]=[f],this._length++}var h=null;null!==this._endFrame&&(h=this._endFrame,this._endFrame=null);!function n(){for(var c in ht.animationplayer._raf?o._currentAnimateId[r]=ht.animationplayer._raf(n):o._currentAnimateId[r]=requestAnimationFrame(n),t)if(t.hasOwnProperty(c)){var f=c+"$"+l+"$"+r;if(!o._stop[f]){var u=t[c],p=u.endFrame;null!==h&&(p=h);var d=u.repeat,v=Date.now(),m=void 0;m=o._onPause?0:(v-o._nowDate[f])/1e3,o._nowDate[f]=v,o._currentAnimateTime[f]+=s*m;var y=null;if(s<0&&(y=!0),!y&&o._currentAnimateTime[f]>=p/60){if(d)o._currentAnimateTime[f]=p/60,o.playerSingle(u,e,f,d,y),o._currentAnimateTime[f]=0,o.playerSingle(u,e,f,d,y);else if(o._currentAnimateTime[f]=p/60,o.playerSingle(u,e,f,d,y),o._currentAnimateTime[f]=0,o.checkEnd(f),a&&(o.fireEvent(a,i),o._eventFunc[a]))for(var g=0;g<o._eventFunc[a].length;g++)o.removeEvent(a,o._eventFunc[a][g],o._eventScope[a][g])}else if(y&&o._currentAnimateTime[f]<=0){if(d)o._currentAnimateTime[f]=0,o.playerSingle(u,e,f,d,y),o._currentAnimateTime[f]=p/60,o.playerSingle(u,e,f,d,y);else if(o._currentAnimateTime[f]=0,o.playerSingle(u,e,f,d,y),o._currentAnimateTime[f]=p/60,o.checkEnd(f),a&&(o.fireEvent(a,i),o._eventFunc[a]))for(var _=0;_<o._eventFunc[a].length;_++)o.removeEvent(a,o._eventFunc[a][_],o._eventScope[a][_])}else o.playerSingle(u,e,f,d,y)}}}()}},{key:"playerSingle",value:function(e,t,a,i,n){for(var r in e)e.hasOwnProperty(r)&&"endTime"!==r&&"e"!==r&&"repeat"!==r&&"r"!==r&&this.playAnimate(t,a,r,e[r],i,n)}},{key:"setAnimates",value:function(e,t,a,i,n,r){var o=this,s=1;if(s=n||this._speed,!this._onPause)for(var l in t){var c=t[l];for(var f in c)if(c.hasOwnProperty(f)){var h=f+"$"+l+"$"+r;this._currentAnimateTime[h]=s>=0?0:c[f].endFrame/60,this._nowDate[h]=Date.now(),this._animateIndexMap[r]?this._animateIndexMap[r].push(h):this._animateIndexMap[r]=[h],this._length++}}var u=null;null!==this._endFrame&&(u=this._endFrame,this._endFrame=null);!function n(){for(var l in ht.animationplayer._raf?o._currentAnimateId[r]=ht.animationplayer._raf(n):o._currentAnimateId[r]=requestAnimationFrame(n),t){var c=e.dm().getDataById(l),f=t[l];for(var h in f)if(f.hasOwnProperty(h)){var p=h+"$"+l+"$"+r;if(!o._stop[p]){var d=f[h],v=d.endFrame;null!==u&&(v=u);var m=d.repeat,y=Date.now(),g=void 0;g=o._onPause?0:(y-o._nowDate[p])/1e3,o._nowDate[p]=y,o._currentAnimateTime[p]+=s*g;var _=null;if(s<0&&(_=!0),!_&&o._currentAnimateTime[p]>=v/60){if(m)o._currentAnimateTime[p]=v/60,o.playerSingle(d,c,p,m,_),o._currentAnimateTime[p]=0,o.playerSingle(d,c,p,m,_);else if(o._currentAnimateTime[p]=v/60,o.playerSingle(d,c,p,m,_),o._currentAnimateTime[p]=0,o.checkEnd(p),a&&(o.fireEvent(a,i),o._eventFunc[a]))for(var b=0;b<o._eventFunc[a].length;b++)o.removeEvent(a,o._eventFunc[a][b],o._eventScope[a][b])}else if(_&&o._currentAnimateTime[p]<=0){if(m)o._currentAnimateTime[p]=0,o.playerSingle(d,c,p,m,_),o._currentAnimateTime[p]=v/60,o.playerSingle(d,c,p,m,_);else if(o._currentAnimateTime[p]=0,o.playerSingle(d,c,p,m,_),o._currentAnimateTime[p]=v/60,o.checkEnd(p),a&&(o.fireEvent(a,i),o._eventFunc[a]))for(var k=0;k<o._eventFunc[a].length;k++)o.removeEvent(a,o._eventFunc[a][k],o._eventScope[a][k])}else o.playerSingle(d,c,p,m,_)}}}}()}},{key:"fireEvent",value:function(e,t){var a=this._eventObj[e];a&&a.fire(t)}},{key:"addEvent",value:function(e,t,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=this._eventObj[e];n||(n=this._eventObj[e]=new ht.Notifier),n.add(t,a,i),this._eventFunc[e]?(this._eventScope[e].push(a),this._eventFunc[e].push(t)):(this._eventFunc[e]=[t],this._eventScope[e]=[a])}},{key:"removeEvent",value:function(e,t,a){var i=this._eventObj[e];i&&i.remove(t,a)}},{key:"playAnimate",value:function(e,t,a,i,n,r){for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];if(Array.isArray(s)&&s.length>1){var l=k(o,s),c=b(o,s,l-1),f=b(o,s,0);if(c&&!r&&this._currentAnimateTime[t]>=c.t/60)if(n)for(var h=0;h<l-1;h++){H(e,a,o,L(s,l-1,o),c.cd,c.sgp)}else{if(!this._finishParamsSet.has(t+a+o))for(var u=0;u<l-1;u++){H(e,a,o,L(s,l-1,o),c.cd,c.sgp)}this._finishParamsSet.has(t+a+o)||this._finishParamsSet.add(t+a+o)}else if(f&&r&&this._currentAnimateTime[t]<=f.t/60)if(n)for(var p=0;p<l-1;p++){H(e,a,o,L(s,0,o),f.cd,f.sgp)}else{if(!this._finishParamsSet2.has(t+a+o))for(var d=0;d<l-1;d++){H(e,a,o,L(s,0,o),f.cd,f.sgp)}this._finishParamsSet2.has(t+a+o)||this._finishParamsSet2.add(t+a+o)}else if(f)for(var v=0;v<l-1;v++){var m=b(o,s,v),y=b(o,s,v+1);if(m&&y&&this._currentAnimateTime[t]>=m.t/60&&this._currentAnimateTime[t]<=y.t/60){var g=he(s,v,o,60*this._currentAnimateTime[t],e,a);void 0!==g&&(r?H(e,a,o,g,y.cd,y.sgp):H(e,a,o,g,m.cd,m.sgp))}else if(this._currentAnimateTime[t]<f.t/60){var _=L(s,0,o);void 0!==_&&H(e,a,o,_,f.cd,f.sgp)}}}}}},{key:"stopAnimate",value:function(e){var t=this;this._finishParamsSet.clear(),this._finishParamsSet2.clear();var a=function(e,a){if(e&&a){ht.animationplayer._caf?ht.animationplayer._caf(t._currentAnimateId[e]):cancelAnimationFrame(t._currentAnimateId[e]),delete t._currentAnimateId[e],delete t._animateIndexMap[e];for(var i=0;i<a.length;i++){var n=a[i];delete t._nowDate[n],delete t._stop[n],t._length--,delete t._currentAnimateTime[n],Object.keys(t._stop).length===t._length&&(t._onSymbolAnimation=!1)}}};if(void 0!==e)if(isNaN(e)){var i=e.split("$");if(2===i.length)for(var n in this._animateIndexMap)for(var r=this._animateIndexMap[n],o=0;o<r.length;o++){var s=r[o].split("$");i[0]===s[0]&&i[1]===s[1]&&a(n,r)}else if(3===i.length)for(var l in this._animateIndexMap){var c=this._animateIndexMap[l];-1!==c.indexOf(e)&&a(l,c)}}else{if(this._currentAnimateId.hasOwnProperty(e))a(e,this._animateIndexMap[e])}else this._currentAnimateId.forEach((function(e){ht.animationplayer._caf?ht.animationplayer._caf(e):cancelAnimationFrame(e)})),this._nowDate={},this._stop={},this._length=0,this._currentAnimateTime={},this._animateIndexMap={},this._onSymbolAnimation=!1}},{key:"checkEnd",value:function(e){this._stop[e]=!0,this._notifier&&this._notifier.fire({fileName:e.split("$")[0],type:"symbolEnd"}),Object.keys(this._stop).length===this._length&&this.stopAnimate(e)}},{key:"getCurrentFrame",value:function(e,t){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e&&t){var i=t.getId(),n=this._getKeyFromFileNameAndNodeId(e,i);if(n)return a?Math.round(60*this._currentAnimateTime[n]):60*this._currentAnimateTime[n]}}},{key:"pause",value:function(e){if(void 0!==e)ht.animationplayer._caf?ht.animationplayer._caf(this._currentAnimateId[e]):cancelAnimationFrame(this._currentAnimateId[e]),this._pauseAnimateIndex.push(e);else for(var t in this._currentAnimateId.forEach((function(e){ht.animationplayer._caf?ht.animationplayer._caf(e):cancelAnimationFrame(e)})),this._currentAnimateTime){var a=t.split("$"),i=Number(a[2]);-1===this._pauseAnimateIndex.indexOf(i)&&this._pauseAnimateIndex.push(i)}}},{key:"resume",value:function(e,t,a){if(this._onPause=!0,t)for(var i=0;i<this._pauseAnimateIndex.length;i++){var n=this._pauseAnimateIndex[i];this.play(e,t,a,null,null,null,n)}else if(a){var r=this._getSymbolFileNameByNode(a);if(r&&r.length)for(var o=0;o<this._pauseAnimateIndex.length;o++)for(var s=this._pauseAnimateIndex[o],l=0;l<r.length;l++){var c=r[l];this.play(e,c,a,null,null,null,s)}}this._onPause=null}}]),e}();function ge(e,t,a,i,n,r,o,s,l,c,f,h,u){if(null!==r){var p,d,v=0;if(n){if(void 0!==r&&function(e,t,a,i,n){if(!e._transactionMap||["x_p","y_p","y_r","x_s","y_s","x_size","y_size","x_anchor","y_anchor"].indexOf(a)<0)return!1;var r=e._transactionMap[t.getId()];r||(e._transactionMap[t.getId()]=r={node:t,specialParameters:n});return r[a]=i,!0}(e,a,i,r,u))return;if("ht_animation_cameraFor2D"===a.getTag())switch(i){case"x_t":h.setTranslateX(r);break;case"y_t":h.setTranslateY(r);break;case"zoom":h.setZoom(r)}else switch(i){case"opacity":a.s("opacity",r);break;case"layer":h.dm().moveTo(a,r);break;case"x_anchor":a.setAnchorX(r);break;case"y_anchor":a.setAnchorY(r);break;case"clip":a.s("clip.direction")&&(a.s("clip.percentage",r),s&&a.s("clip.direction",s));break;case"fillClip":a.s("shape.fill.clip.direction")&&(a.s("shape.fill.clip.percentage",r),s&&a.s("shape.fill.clip.direction",s));break;case"bg":a.s("shape.background","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"gradient":if(r)if(Array.isArray(r[1])){for(var m=0;m<r[1].length;m++)Array.isArray(r[1][m])&&(r[1][m]="rgba("+r[1][m][0]+","+r[1][m][1]+","+r[1][m][2]+","+r[1][m][3]+")");r[1]&&a.s("shape.gradient.pack",r[1]),r[0]&&a.s("shape.gradient.color","rgba("+r[0][0]+","+r[0][1]+","+r[0][2]+","+r[0][3]+")")}else c&&a.s("shape.gradient.pack",c),a.s("shape.gradient.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"b_width":a.s("shape.border.width",r);break;case"b_color":a.s("shape.border.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"b_depth":a.s("shape.depth",r);break;case"b_gradient":if(r&&Array.isArray(r)){for(var y=0;y<r.length;y++)Array.isArray(r[y])&&(r[y]="rgba("+r[y][0]+","+r[y][1]+","+r[y][2]+","+r[y][3]+")");a.s("shape.border.gradient.pack",r)}break;case"d_width":a.s("shape.dash.width",r);break;case"d_color":a.s("shape.dash.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"d_offset":a.s("shape.dash.offset",r);break;case"s_blur":a.s("shadow2.blur",r);break;case"s_x":a.s("shadow2.offset.x",r);break;case"s_y":a.s("shadow2.offset.y",r);break;case"s_color":a.s("shadow2.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"text":isNaN(r)||a.s("text",Math.floor(r));break;case"text_color":a.s("text.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"arc_from":a.s("shape.arc.from",r);break;case"arc_to":a.s("shape.arc.to",r);break;case"s_points":a.setPoints(r.points),a.setSegments(r.segments);break;case"color":a.s("body.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"img":a.setImage(r);break;default:if(i){var g=i.split(":");g[1]&&(a.a(g[1],r),e._customCB[g[1]+"_"+a.getId()]&&e._customCB[g[1]+"_"+a.getId()](r,e.getCurrentFrame(t,a,!1)),e._customCB[g[1]]&&e._customCB[g[1]](r,e.getCurrentFrame(t,null,!1)))}}}else{var _,b,k,w,x,A,P,S,I,M,F,N=i.split("$");if(i=N[0],void 0!==r&&function(e,t,a,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(!e._transactionMap||["x_s","y_s","z_s","x_p","y_p","z_p","x_r","y_r","z_r","x_size","y_size","z_size","x_local","y_local","z_local","x_euler","y_euler","z_euler","anchor3d_x","anchor3d_y","anchor3d_z","x_up","y_up","z_up","_gis.lng","_gis.lat","_gis.height","_gis.heading","_gis.pitch","_gis.roll","scene_fovy","scene_near","scene_far","scene_highlightWidth","scene_highlightColor","scene_highlightGlow","scene_highlightStrength","custom:bp_mat_cloud_time","custom:bp_mat_cloud_ground_color","custom:bp_mat_cloud_light_dir","custom:bp_mat_cloud_fog","custom:bp_mat_cloud_size","custom:bp_mat_cloud_covr","custom:bp_mat_cloud_dens","c_up","pathAnimation_animStart","pathAnimation_animMoveEye","splat_blend","splat_scale","splat_opacityScale","ld","h_mode","mr_bg","mr_ref","mr_blur","mr_nor","mr_pos","mr_thd"].indexOf(a)<0&&"batch"!==a.split(":")[0])return!1;var r=e._transactionMap[t.getId()];r||(e._transactionMap[t.getId()]=r={node:t,specialParameters:n});r[a]=i,"c_up"===a&&(ht.AnimationPlayer.c_up=i);return!0}(e,a,i,r,u))return;switch(void 0!==N[1]&&(v=f||(isNaN(N[1])?N[1]:Number(N[1]))),i){case"opacity":if(o=!(!o||0===o),ht.CSGShape&&a instanceof ht.CSGShape)a.s("all.transparent")!==o&&a.s("all.transparent",o),a.s("all.opacity",r);else if(a instanceof ht.Shape){if(a instanceof ht.Polyline)a.s("shape3d.transparent")!==o&&a.s("shape3d.transparent",o),a.s("shape3d.opacity",r);else-1===a.getThickness()?(a.s("shape3d.transparent")!==o&&a.s("shape3d.transparent",o),a.s("shape3d.opacity",r)):(a.s("all.transparent")!==o&&a.s("all.transparent",o),a.s("all.opacity",r))}else a.s("shape3d")?(a.s("shape3d.transparent")!==o&&a.s("shape3d.transparent",o),a.s("shape3d.opacity",r)):(a.s("all.transparent")!==o&&a.s("all.transparent",o),a.s("all.opacity",r));break;case"wf_opacity":Array.isArray(r)&&a.s("wf.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"alphaTest":a.s("alphaTest",r);break;case"u":a instanceof ht.Shape?a instanceof ht.Polyline?_=a.s("shape3d.uv.offset"):-1===(x=a.getThickness())?a.s("shape3d.discard.selectable")?_=a.s("shape3d.uv.offset"):a.s("shape3d.top.discard.selectable")?_=a.s("shape3d.top.uv.offset"):a.s("shape3d.bottom.discard.selectable")&&(_=a.s("shape3d.bottom.uv.offset")):_=a.s("all.uv.offset"):_=a.s("shape3d")?a.s("shape3d.uv.offset"):a.s("all.uv.offset"),w=_&&_.length?[r,_[1]]:[r,0],a instanceof ht.Shape?a instanceof ht.Polyline?a.s("shape3d.uv.offset",w):-1===x?a.s("shape3d.discard.selectable")?a.s("shape3d.uv.offset",w):a.s("shape3d.top.discard.selectable")?a.s("shape3d.top.uv.offset",w):a.s("shape3d.bottom.discard.selectable")&&a.s("shape3d.bottom.uv.offset",w):a.s("all.uv.offset",w):a.s("shape3d")?a.s("shape3d.uv.offset",w):a.s("all.uv.offset",w);break;case"u_top":a instanceof ht.Shape?-1===(x=a.getThickness())?a.s("shape3d.top.discard.selectable")&&(_=a.s("shape3d.top.uv.offset")):_=a.s("top.uv.offset"):_=a.s("shape3d")?a.s("shape3d.top.uv.offset"):a.s("top.uv.offset"),w=_&&_.length?[r,_[1]]:[r,0],a instanceof ht.Shape?-1===x?a.s("shape3d.top.discard.selectable")&&a.s("shape3d.top.uv.offset",w):a.s("top.uv.offset",w):a.s("shape3d")?a.s("shape3d.top.uv.offset",w):a.s("top.uv.offset",w);break;case"u_bottom":a instanceof ht.Shape?-1===(x=a.getThickness())?a.s("shape3d.bottom.discard.selectable")&&(_=a.s("shape3d.bottom.uv.offset")):_=a.s("bottom.uv.offset"):_=a.s("shape3d")?a.s("shape3d.bottom.uv.offset"):a.s("bottom.uv.offset"),w=_&&_.length?[r,_[1]]:[r,0],a instanceof ht.Shape?-1===x?a.s("shape3d.bottom.discard.selectable")&&a.s("shape3d.bottom.uv.offset",w):a.s("bottom.uv.offset",w):a.s("shape3d")?a.s("shape3d.bottom.uv.offset",w):a.s("bottom.uv.offset",w);break;case"u_scale":a instanceof ht.Shape?a instanceof ht.Polyline?b=a.s("shape3d.uv.scale"):-1===(x=a.getThickness())?a.s("shape3d.discard.selectable")?b=a.s("shape3d.uv.scale"):a.s("shape3d.top.discard.selectable")?b=a.s("shape3d.top.uv.scale"):a.s("shape3d.bottom.discard.selectable")&&(b=a.s("shape3d.bottom.uv.scale")):b=a.s("all.uv.scale"):b=a.s("shape3d")?a.s("shape3d.uv.scale"):a.s("all.uv.scale"),w=b&&b.length?[r,b[1]]:[r,0],a instanceof ht.Shape?a instanceof ht.Polyline?a.s("shape3d.uv.scale",w):-1===x?a.s("shape3d.discard.selectable")?a.s("shape3d.uv.scale",w):a.s("shape3d.top.discard.selectable")?a.s("shape3d.top.uv.scale",w):a.s("shape3d.bottom.discard.selectable")&&a.s("shape3d.bottom.uv.scale",w):a.s("all.uv.scale",w):a.s("shape3d")?a.s("shape3d.uv.scale",w):a.s("all.uv.scale",w);break;case"u_anchor":if(void 0===r){if(a instanceof ht.Shape)if(a instanceof ht.Polyline)k=a.s("shape3d.uv.anchor");else k=-1===a.getThickness()?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor");else k=a.s("shape3d")?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor");return k&&k.length?k[0]:0}var C;C=(k=a instanceof ht.Shape?a instanceof ht.Polyline||-1===(x=a.getThickness())?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor"):a.s("shape3d")?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor"))&&k.length?[r,k[1]]:[r,0],a instanceof ht.Shape?a instanceof ht.Polyline||-1===x?a.s("shape3d.uv.anchor",C):a.s("all.uv.anchor",C):a.s("shape3d")?a.s("shape3d.uv.anchor",C):a.s("all.uv.anchor",C);break;case"v":a instanceof ht.Shape?a instanceof ht.Polyline?_=a.s("shape3d.uv.offset"):-1===(x=a.getThickness())?a.s("shape3d.discard.selectable")?_=a.s("shape3d.uv.offset"):a.s("shape3d.top.discard.selectable")?_=a.s("shape3d.top.uv.offset"):a.s("shape3d.bottom.discard.selectable")&&(_=a.s("shape3d.bottom.uv.offset")):_=a.s("all.uv.offset"):_=a.s("shape3d")?a.s("shape3d.uv.offset"):a.s("all.uv.offset"),w=_&&_.length?[_[0],r]:[0,r],a instanceof ht.Shape?a instanceof ht.Polyline?a.s("shape3d.uv.offset",w):-1===x?a.s("shape3d.discard.selectable")?a.s("shape3d.uv.offset",w):a.s("shape3d.top.discard.selectable")?a.s("shape3d.top.uv.offset",w):a.s("shape3d.bottom.discard.selectable")&&a.s("shape3d.bottom.uv.offset",w):a.s("all.uv.offset",w):a.s("shape3d")?a.s("shape3d.uv.offset",w):a.s("all.uv.offset",w);break;case"v_top":a instanceof ht.Shape?-1===(x=a.getThickness())?a.s("shape3d.top.discard.selectable")&&(_=a.s("shape3d.top.uv.offset")):_=a.s("top.uv.offset"):_=a.s("shape3d")?a.s("shape3d.top.uv.offset"):a.s("top.uv.offset"),w=_&&_.length?[_[0],r]:[0,r],a instanceof ht.Shape?-1===x?a.s("shape3d.top.discard.selectable")&&a.s("shape3d.top.uv.offset",w):a.s("top.uv.offset",w):a.s("shape3d")?a.s("shape3d.top.uv.offset",w):a.s("top.uv.offset",w);break;case"v_bottom":a instanceof ht.Shape?-1===(x=a.getThickness())?a.s("shape3d.bottom.discard.selectable")&&(_=a.s("shape3d.bottom.uv.offset")):_=a.s("bottom.uv.offset"):_=a.s("shape3d")?a.s("shape3d.bottom.uv.offset"):a.s("bottom.uv.offset"),w=_&&_.length?[_[0],r]:[0,r],a instanceof ht.Shape?-1===x?a.s("shape3d.bottom.discard.selectable")&&a.s("shape3d.bottom.uv.offset",w):a.s("bottom.uv.offset",w):a.s("shape3d")?a.s("shape3d.bottom.uv.offset",w):a.s("bottom.uv.offset",w);break;case"v_scale":a instanceof ht.Shape?a instanceof ht.Polyline?b=a.s("shape3d.uv.scale"):-1===(x=a.getThickness())?a.s("shape3d.discard.selectable")?b=a.s("shape3d.uv.scale"):a.s("shape3d.top.discard.selectable")?b=a.s("shape3d.top.uv.scale"):a.s("shape3d.bottom.discard.selectable")&&(b=a.s("shape3d.bottom.uv.scale")):b=a.s("all.uv.scale"):b=a.s("shape3d")?a.s("shape3d.uv.scale"):a.s("all.uv.scale"),w=b&&b.length?[b[0],r]:[0,r],a instanceof ht.Shape?a instanceof ht.Polyline?a.s("shape3d.uv.scale",w):-1===x?a.s("shape3d.discard.selectable")?a.s("shape3d.uv.scale",w):a.s("shape3d.top.discard.selectable")?a.s("shape3d.top.uv.scale",w):a.s("shape3d.bottom.discard.selectable")&&a.s("shape3d.bottom.uv.scale",w):a.s("all.uv.scale",w):a.s("shape3d")?a.s("shape3d.uv.scale",w):a.s("all.uv.scale",w);break;case"v_anchor":if(void 0===r){if(a instanceof ht.Shape)if(a instanceof ht.Polyline)k=a.s("shape3d.uv.anchor");else k=-1===a.getThickness()?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor");else k=a.s("shape3d")?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor");return k&&k.length?k[1]:0}var T;T=(k=a instanceof ht.Shape?a instanceof ht.Polyline||-1===(x=a.getThickness())?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor"):a.s("shape3d")?a.s("shape3d.uv.anchor"):a.s("all.uv.anchor"))&&k.length?[k[0],r]:[0,r],a instanceof ht.Shape?a instanceof ht.Polyline||-1===x?a.s("shape3d.uv.anchor",T):a.s("all.uv.anchor",T):a.s("shape3d")?a.s("shape3d.uv.anchor",T):a.s("all.uv.anchor",T);break;case"uv_r":a instanceof ht.Shape?a instanceof ht.Polyline?a.s("shape3d.uv.rotation",r):-1===(x=a.getThickness())?a.s("shape3d.discard.selectable")?a.s("shape3d.uv.rotation",r):a.s("shape3d.top.discard.selectable")?a.s("shape3d.top.uv.rotation",r):a.s("shape3d.bottom.discard.selectable")&&a.s("shape3d.bottom.uv.rotation",r):a.s("all.uv.rotation",r):a.s("shape3d")?a.s("shape3d.uv.rotation",r):a.s("all.uv.rotation",r);break;case"clip":a.s("3d.clip.direction")&&(a.s("3d.clip.percentage",r),s&&a.s("3d.clip.direction")!==s&&a.s("3d.clip.direction",s));break;case"hue":h.setPostProcessingValue("HueSaturation","hue",r);break;case"color":case"e_bodyColor":a.s("body.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"saturation":h.setPostProcessingValue("HueSaturation","saturation",r);break;case"lightness":h.setPostProcessingValue("HueSaturation","lightness",r);break;case"fog":h.setFogColor("rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"fog_near":h.setFogNear(r);break;case"fog_far":h.setFogFar(r);break;case"fog_density":"exp2"===h.dm().a("sceneFogMode")?r?h.setFogDensity(1/r):h.setFogDensity(0):h.dm().a("sceneFogDensity",r);break;case"h_color":h.setHeadlightColor("rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"h_intensity":h.setHeadlightIntensity(r);break;case"h_ambient":h.setHeadlightAmbientIntensity(r);break;case"bloom_s":(p=h.getPostProcessingModule("Bloom"))&&(p.strength=r);break;case"bloom_r":(p=h.getPostProcessingModule("Bloom"))&&(p.radius=r);break;case"bloom_t":(p=h.getPostProcessingModule("Bloom"))&&(p.threshold=r);break;case"h_range":h.dm().a("sceneHeadlightRange",r);break;case"env_reflect":a.s("envmap",r);break;case"env_headlight":a.s("headlight.ambientIntensity",r);break;case"env_roughness":a.s("roughness",r);break;case"envSphere_intensity":(P=h.getEnvmap())&&P.length&&P[v]&&(P[v].intensity=r,h.invalidateEnvmap(v));break;case"envSphere_angle":(P=h.getEnvmap())&&P.length&&P[v]&&P[v].image&&P[v].image.comps&&(P[v].image.comps[0].offset=r,h.invalidateEnvmap(v));break;case"bone":a.setRotation3d(r[0],r[1],r[2]);break;case"d_color":a.s("edge.dash.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")"),a.s("shape.dash.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"d_offset":a.s("edge.dash.offset",r),a.s("shape.dash.offset",r);break;case"e_width":a.s("edge.width",r);break;case"e_u":(S=a.s("shape3d.uv.offset"))&&a.s("shape3d.uv.offset",[r,S[1]]);break;case"e_v":(S=a.s("shape3d.uv.offset"))&&a.s("shape3d.uv.offset",[S[0],r]);break;case"e_color":a.s("edge.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"lp_color":case"ld_color":case"lr_color":a.s("light.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"lp_intensity":case"ls_intensity":case"ld_intensity":case"lr_intensity":a.s("light.intensity",r);break;case"lp_range":case"ls_range":a.s("light.range",r);break;case"ls_color":r&&a.s("light.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"ls_angle":a.s("light.angle",r);break;case"ls_exponent":a.s("light.exponent",r);break;case"ls_x":(d=a.s("light.center"))&&a.s("light.center",[r,d[1],d[2]]);break;case"ls_y":(d=a.s("light.center"))&&a.s("light.center",[d[0],r,d[2]]);break;case"ls_z":(d=a.s("light.center"))&&a.s("light.center",[d[0],d[1],r]);break;case"lr_size":a.s("light.size",r);break;case"flow_intensity":a.s("effect.flow.intensity",r);break;case"flow_blend":r&&a.s("effect.flow.blend","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"wf_normEpsilon":a.s("wf.normEpsilon",r);break;case"points_color":r&&a.s("points.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"points_size":a.s("points.size",r);break;case"points_opacity":a.s("points.opacity",r);break;case"points_scale_u":(I=a.s("points.uv.scale"))||(I=[1,1]),I[0]=r,a.s("points.uv.scale",I);break;case"points_scale_v":(I=a.s("points.uv.scale"))||(I=[1,1]),I[1]=r,a.s("points.uv.scale",I);break;case"points_offset_u":(M=a.s("points.uv.offset"))||(M=[0,0]),M[0]=r,a.s("points.uv.offset",M);break;case"points_offset_v":(M=a.s("points.uv.offset"))||(M=[0,0]),M[1]=r,a.s("points.uv.offset",M);break;case"shadow_bias":h.setShadowBias(r);break;case"shadow_intensity":h.setShadowIntensity(r);break;case"shadow_radius":h.setShadowRadius(r);break;case"shadow_x":h.setShadowDegreeX(r);break;case"shadow_z":h.setShadowDegreeZ(r);break;case"shadow_bounding":h.setShadowBounding(r);break;case"sky_x":(A=h.getSkyBox())&&(A.r3([r,A.r3()[1],A.r3()[2]]),h.iv());break;case"sky_y":(A=h.getSkyBox())&&(A.r3([A.r3()[0],r,A.r3()[2]]),h.iv());break;case"sky_z":(A=h.getSkyBox())&&(A.r3([A.r3()[0],A.r3()[1],r]),h.iv());break;case"sky_color":(A=h.getSkyBox())&&(A.s("body.color","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")"),h.iv());break;case"sky_diameter":(A=h.getSkyBox())&&(A.s3(r,r,r),h.iv());break;case"brightness":a.s("brightness",r);break;case"dofAperture":h.setPostProcessingValue("Dof","aperture",r);break;case"dofMaxBlur":h.setPostProcessingValue("Dof","maxblur",r);break;case"dofFocus":h.setPostProcessingValue("Dof","focus",r);break;case"dofRange":h.setPostProcessingValue("Dof","range",r);break;case"dofDensityInverse":h.setPostProcessingValue("Dof","densityInverse",r);break;case"mat":a.s("matDef",r);break;case"shape3d":a.s("shape3d",r);break;case"img":a instanceof ht.Shape?a instanceof ht.Polyline?a.s("shape3d.image",r):-1===(x=a.getThickness())?a.s("shape3d.visible")?a.s("shape3d.image",r):a.s("shape3d.top.visible")?a.s("shape3d.top.image",r):a.s("shape3d.bottom.visible")&&a.s("shape3d.bottom.image",r):a.s("all.visible")?a.s("all.image",r):a.s("top.visible")?a.s("top.image",r):a.s("bottom.visible")?a.s("bottom.image",r):a.s("front.visible")?a.s("front.image",r):a.s("back.visible")?a.s("back.image",r):a.s("left.visible")?a.s("left.image",r):a.s("right.visible")&&a.s("right.image",r):a.s("shape3d")?a.s("shape3d.image",r):a.s("all.image",r);break;case"shape3d.section.angle":a.s("shape3d.section.angle",r);break;case"shape3d.section.twist":a.s("shape3d.section.twist",r);break;case"shape3d.polyline.depth":a.s("shape3d.polyline.depth",r);break;case"shape3d.polyline.offset":a.s("shape3d.polyline.offset",r);break;case"shape3d.polyline.radiusScale":a.s("shape3d.polyline.radiusScale",r);break;case"shape3d.polyline.scaleOffset":a.s("shape3d.polyline.scaleOffset",r);break;case"sceneLut_intensity":h.setPostProcessingValue("Lut","intensity",r);break;case"side":a.s("shape3d.side",r);break;case"sideFrom":a.s("shape3d.side.from",r);break;case"sideTo":a.s("shape3d.side.to",r);break;case"resolution":a.s("shape3d.resolution",r);break;case"torusRadius":a.s("shape3d.torus.radius",r);break;case"startAngle":a.s("shape3d.start.angle",r);break;case"sweepAngle":a.s("shape3d.sweep.angle",r);break;case"thickness":a.setThickness&&a.setThickness(r);break;case"scene_ssaoAoRadius":h.dm().a("sceneSsaoAoRadius",r);break;case"scene_ssaoDistanceFalloff":h.dm().a("sceneSsaoDistanceFalloff",r);break;case"scene_ssaoDenoiseIterations":h.dm().a("sceneSsaoDenoiseIterations",r);break;case"scene_ssaoIntensity":h.dm().a("sceneSsaoIntensity",r);break;case"host":if("null"===r)a.setHost(null);else{var D=h.dm().getDataByTag(r);D&&a.setHost(D)}break;case"m_fresnelIntensity":f&&a.setMaterial(f,"fresnelIntensity",r);break;case"m_uvRotation":f&&a.setMaterial(f,"uvRotation",r);break;case"m_uvScale_u":if(f){var B=a.getMaterial(f,"uvScale");B&&a.setMaterial(f,"uvScale",[r,B[1]])}break;case"m_uvScale_v":if(f){var O=a.getMaterial(f,"uvScale");O&&a.setMaterial(f,"uvScale",[O[0],r])}break;case"m_uvOffset_u":if(f){var z=a.getMaterial(f,"uvOffset");z&&a.setMaterial(f,"uvOffset",[r,z[1]])}break;case"m_uvOffset_v":if(f){var E=a.getMaterial(f,"uvOffset");E&&a.setMaterial(f,"uvOffset",[E[0],r])}break;case"m_uvAnchor_u":if(f){var R=a.getMaterial(f,"uvAnchor");R&&a.setMaterial(f,"uvAnchor",[r,R[1]])}break;case"m_uvAnchor_v":if(f){var V=a.getMaterial(f,"uvAnchor");V&&a.setMaterial(f,"uvAnchor",[V[0],r])}break;case"m_diffuse":f&&a.setMaterial(f,"diffuse","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"m_roughness":f&&a.setMaterial(f,"roughness",r);break;case"m_metalness":f&&a.setMaterial(f,"metalness",r);break;case"m_aoMapIntensity":f&&a.setMaterial(f,"aoMapIntensity",r);break;case"m_normalScale":f&&a.setMaterial(f,"normalScale",r);break;case"m_emissive":f&&a.setMaterial(f,"emissive","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"m_opacity":if(f)a.getMaterial(f,"transparent")!==(l=!(!l||0===l))&&a.setMaterial(f,"transparent",l),a.setMaterial(f,"opacity",r);break;case"m_alphaTest":f&&a.setMaterial(f,"alphaTest",r);break;case"m_lightMapIntensity":f&&a.setMaterial(f,"lightMapIntensity",r);break;case"m_rimColor":f&&a.setMaterial(f,"rimColor","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"m_rimPower":f&&a.setMaterial(f,"rimPower",r);break;case"m_transmission":f&&a.setMaterial(f,"transmission",r);break;case"m_thickness":f&&a.setMaterial(f,"thickness",r);break;case"m_ior":f&&a.setMaterial(f,"ior",r);break;case"m_specularIntensity":f&&a.setMaterial(f,"specularIntensity",r);break;case"m_specularColor":f&&a.setMaterial(f,"specularColor","rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")");break;case"m_envMapIntensity":f&&a.setMaterial(f,"envMapIntensity",r);break;case"_gis.baseMapFilter":(F=h.dm().gismap)&&F.setBaseMapFilter&&F.setBaseMapFilter(!1,"rgb("+r[0]+","+r[1]+","+r[2]+")",0);break;default:if(i){var L=i.split(":");if(L[1]&&!function(e,t,a){if("material.frame"===t){var i=ht.animationplayer.g3d,n=ht.animationplayer.materialSwitchImageRenderTargetNodes;if(i&&n){var r=n[""+e.getId()];r&&(r.s("shape3d").mat.frame=a,i.renderScene())}return!0}}(a,L[1],r)&&"custom"===L[0])if("string"==typeof v)a.setMaterial(v,L[1],r);else{if(L[1].startsWith("p_"))!function(e,t,a){var i=t.split("_")[1];if(void 0!==a){var n="set".concat(i.charAt(0).toUpperCase()+i.slice(1));"function"==typeof e[n]&&e[n](a)}else{var r="get".concat(i.charAt(0).toUpperCase()+i.slice(1));if("function"==typeof e[r])e[r]()}}(a,L[1],r);else if(h.queryBonePose&&L[1].startsWith("animation.time")){var H=L[1].split("_")[1];if(H){var j=a.getAttaches();if(j&&j.size()){var $=h.queryBonePose(a);if($){var G=$[H];G&&j.forEach((function(e){e.p3(G.getPosition().toArray())}))}}}a.a("animation.time",r)}else a.a(L[1],r);e._customCB[L[1]+"_"+a.getId()]&&e._customCB[L[1]+"_"+a.getId()](r,e.getCurrentFrame(t,a,!1)),e._customCB[L[1]]&&e._customCB[L[1]](r,e.getCurrentFrame(t,null,!1))}}}}}}function _e(e){e._transactionMap={}}function be(e,a,i,r,o){if(i)for(var s in e._transactionMap){var l=e._transactionMap[s],c=l.node;if("x_anchor"in l||"y_anchor"in l){var f=c.getAnchor();c.setAnchor(fe(l,"x_anchor",f.x),fe(l,"y_anchor",f.y))}if("x_size"in l||"y_size"in l){var h=c.getSize();c.setSize(fe(l,"x_size",h.width),fe(l,"y_size",h.height))}if("x_s"in l||"y_s"in l){var u=c.getScale();c.setScale(fe(l,"x_s",u.x),fe(l,"y_s",u.y))}if("y_r"in l){var p=c.getRotation();c.setRotation(fe(l,"y_r",p))}if("x_p"in l||"y_p"in l){var d=c.getPosition();c.setPosition(fe(l,"x_p",d.x),fe(l,"y_p",d.y))}}else{var v,m={},y=function(){var i=e._transactionMap[g],s=i.node,l=i.specialParameters;if("anchor3d_x"in i||"anchor3d_y"in i||"anchor3d_z"in i){var c=s.getAnchor3d(),f=fe(i,"anchor3d_x",c.x),h=fe(i,"anchor3d_y",c.y),u=fe(i,"anchor3d_z",c.z);s.setAnchor3d(f,h,u)}if("x_size"in i||"y_size"in i||"z_size"in i){var p=s.getSize3d();s instanceof ht.Block&&(0===p[0]&&(p[0]=.01),0===p[1]&&(p[1]=.01),0===p[2]&&(p[2]=.01)),s.setSize3d(fe(i,"x_size",p[0]),fe(i,"y_size",p[1]),fe(i,"z_size",p[2]))}if("x_s"in i||"y_s"in i||"z_s"in i){var d=s.getScale3d();s instanceof ht.Block&&(0===d[0]&&(d[0]=.01),0===d[1]&&(d[1]=.01),0===d[2]&&(d[2]=.01)),s.setScale3d(fe(i,"x_s",d[0]),fe(i,"y_s",d[1]),fe(i,"z_s",d[2]))}if("x_euler"in i||"y_euler"in i||"z_euler"in i){var y=s.getLocalEuler(),_=fe(i,"x_euler",y.x),b=fe(i,"y_euler",y.y),k=fe(i,"z_euler",y.z);y.x=_,y.y=b,y.z=k,s.setLocalEuler(y)}if("x_r"in i||"y_r"in i||"z_r"in i){var w=s.r3();s.r3(fe(i,"x_r",w[0]),fe(i,"y_r",w[1]),fe(i,"z_r",w[2]))}if("x_local"in i||"y_local"in i||"z_local"in i){var x=s.getLocalPosition3d();s.setLocalPosition3d([fe(i,"x_local",x.x),fe(i,"y_local",x.y),fe(i,"z_local",x.z)])}if("x_p"in i||"y_p"in i||"z_p"in i){var A=s.p3(),P=[fe(i,"x_p",A[0]),fe(i,"y_p",A[1]),fe(i,"z_p",A[2])];if(l)"gis1"===l?function(e,t,a){if(ht.Default.position3dToGis&&ht.Default.getRenderedGisGroundP3){var i=ht.Default.position3dToGis(a),r=ht.Default.getRenderedGisGroundP3([i],e,2e5)[0];0===r[0]?t.p3.apply(t,n(a)):t.p3.apply(t,n(r))}}(a,s,P):s.p3.apply(s,P);else{var S=null,I=s.getAttaches();I&&I.forEach((function(e){"ht_animation_camera_center"===e.getTag()&&(S=e)})),S?(s.p3.apply(s,P),Se(a,S,r,m,o)):s.p3.apply(s,P)}}if("x_up"in i||"y_up"in i||"z_up"in i){var M=a.getUp(),F=fe(i,"x_up",M[0]),N=fe(i,"y_up",M[1]),C=fe(i,"z_up",M[2]);a.setUp(F,N,C)}"pathAnimation_animStart"in i&&(fe(i,"pathAnimation_animStart",s.a("animStart"))?s.a("animStart")||s.a("animStart",!0):s.a("animStart")&&s.a("animStart",!1));"pathAnimation_animMoveEye"in i&&(fe(i,"pathAnimation_animMoveEye",s.a("animMoveEye"))?s.a("animMoveEye")||s.a("animMoveEye",!0):s.a("animMoveEye")&&s.a("animMoveEye",!1));if("mr_bg"in i||"mr_ref"in i||"mr_blur"in i||"mr_thd"in i){var T=fe(i,"mr_bg",s.s("shape3d.reflector.background")),D=fe(i,"mr_ref",s.s("shape3d.reflector.color")),B=fe(i,"mr_blur",s.s("shape3d.reflector.blur")),O=fe(i,"mr_thd",s.s("shape3d.reflector.normal.threshold"));s.s("shape3d.reflector.background",T),s.s("shape3d.reflector.color",D),s.s("shape3d.reflector.blur",B),s.s("shape3d.reflector.normal.threshold",O)}if("mr_nor"in i||"mr_pos"in i){var z=fe(i,"mr_nor",s.s("shape3d.reflector.normal")),E=fe(i,"mr_pos",s.s("shape3d.reflector.position"));s.s("shape3d.reflector.normal",z),s.s("shape3d.reflector.position",E)}if("_gis.lng"in i||"_gis.lat"in i||"_gis.height"in i){var R=fe(i,"_gis.lng",s.a("_gis.lng")),V=fe(i,"_gis.lat",s.a("_gis.lat")),L=fe(i,"_gis.height",s.a("_gis.height"));s.a("_gis.lng",R),s.a("_gis.lat",V),s.a("_gis.height",L)}if("_gis.heading"in i||"_gis.pitch"in i||"_gis.roll"in i){var H=fe(i,"_gis.heading",s.a("_gis.heading")),j=fe(i,"_gis.pitch",s.a("_gis.pitch")),$=fe(i,"_gis.roll",s.a("_gis.roll"));s.a("_gis.heading",H),s.a("_gis.pitch",j),s.a("_gis.roll",$)}"ld"in i&&(fe(i,"ld",s.s("light.disabled"))?s.s("light.disabled")||s.s("light.disabled",!0):s.s("light.disabled")&&s.s("light.disabled",!1));if("scene_highlightWidth"in i){var G,W=null===(G=a.getHighlightGroups)||void 0===G?void 0:G.call(a);if(W&&W[0]){var U=W[0].width;W[0].width=fe(i,"scene_highlightWidth",U),v=!0}else{var J=a.getHighlightWidth();a.dm().a("sceneHighlightWidth",fe(i,"scene_highlightWidth",J)),a.setHighlightWidth(J)}}if("scene_highlightColor"in i){var q,K=null===(q=a.getHighlightGroups)||void 0===q?void 0:q.call(a);if(K&&K[0]){var X=K[0].color;K[0].color=fe(i,"scene_highlightColor",X),v=!0}else{var Y=a.getHighlightColor();a.dm().a("sceneHighlightColor",fe(i,"scene_highlightColor",Y)),a.setHighlightColor(Y)}}if("scene_highlightGlow"in i){var Q,Z=null===(Q=a.getHighlightGroups)||void 0===Q?void 0:Q.call(a);if(Z&&Z[0]){var ee=Z[0].glow;Z[0].glow=fe(i,"scene_highlightGlow",ee),v=!0}else{var te=a.getHighlightGlow();a.dm().a("sceneHighlightGlow",fe(i,"scene_highlightGlow",te)),a.setHighlightGlow(te)}}if("scene_highlightStrength"in i){var ae,ie=null===(ae=a.getHighlightGroups)||void 0===ae?void 0:ae.call(a);if(ie&&ie[0]){var ne=ie[0].strength;ie[0].strength=fe(i,"scene_highlightStrength",ne),v=!0}else{var re=a.getHighlightStrength();a.dm().a("sceneHighlightStrength",fe(i,"scene_highlightStrength",re)),a.setHighlightStrength(re)}}"h_mode"in i&&(fe(i,"h_mode",s.s("highlight.mode"))?s.s("highlight.mode")||s.s("highlight.mode",!0):s.s("highlight.mode")&&s.s("highlight.mode",!1));if(Object.keys(i).some((function(e){return e.startsWith("batch:")})))for(var oe in i)if(oe.startsWith("batch:")){var se=oe.split(":"),le=se.pop();se.shift();var ce=se.join(":"),he=a.getBatchInfoMap();if(he&&ce){var ue=he[ce];if(ue){if("opacity"===le)ue.opacity=fe(i,oe,ue.opacity);else if("color"===le)ue.color=fe(i,oe,ue.color);else if("u_offset"===le){var pe=ue.uvOffset;pe&&(pe[0]=fe(i,oe,pe[0]))}else if("v_offset"===le){var de=ue.uvOffset;de&&(de[1]=fe(i,oe,de[1]))}v=!0}}}if(i["custom:bp_mat_cloud_time"]){var ve=s.s("shape3d");ve&&ve.mat&&(ve.mat.time=fe(i,"custom:bp_mat_cloud_time",ve.mat.time),s.iv(),ke(a))}if(i["custom:bp_mat_cloud_ground_color"]){var me=s.s("shape3d");me&&me.mat&&(me.mat.groundColor=fe(i,"custom:bp_mat_cloud_ground_color",me.mat.groundColor),s.iv(),ke(a))}if(i["custom:bp_mat_cloud_light_dir"]){var ye=s.s("shape3d");if(ye&&ye.mat){var ge=fe(i,"custom:bp_mat_cloud_light_dir",ye.mat.light_dir);Array.isArray(ge)&&(ge=t(ht.Math.Vector3,n(ge))),ye.mat.light_dir=ge,s.iv(),ke(a)}}if(i["custom:bp_mat_cloud_fog"]){var _e=s.s("shape3d");_e&&_e.mat&&(_e.mat.fog=fe(i,"custom:bp_mat_cloud_fog",_e.mat.fog),s.iv(),ke(a))}if(i["custom:bp_mat_cloud_size"]){var be=s.s("shape3d");be&&be.mat&&(be.mat.cloud_size=fe(i,"custom:bp_mat_cloud_size",be.mat.cloud_size),s.iv(),ke(a))}if(i["custom:bp_mat_cloud_covr"]){var xe=s.s("shape3d");xe&&xe.mat&&(xe.mat.cloud_covr=fe(i,"custom:bp_mat_cloud_covr",xe.mat.cloud_covr),s.iv(),ke(a))}if(i["custom:bp_mat_cloud_dens"]){var Pe=s.s("shape3d");Pe&&Pe.mat&&(Pe.mat.cloud_dens=fe(i,"custom:bp_mat_cloud_dens",Pe.mat.cloud_dens),s.iv(),ke(a))}if("scene_fovy"in i||"scene_near"in i||"scene_far"in i)if(s instanceof ht.Camera){var Ie=fe(i,"scene_fovy",s.s("camera.fovy")),Me=fe(i,"scene_near",s.s("camera.near")),Fe=fe(i,"scene_far",s.s("camera.far"));s.s("camera.fovy",Ie),s.s("camera.near",Me),s.s("camera.far",Fe)}else{var Ne=fe(i,"scene_fovy",a.dm().a("sceneFovy")),Ce=fe(i,"scene_near",a.dm().a("sceneNear")),Te=fe(i,"scene_far",a.dm().a("sceneFar"));a.dm().a("sceneFovy",Ne),a.dm().a("sceneNear",Ce),a.dm().a("sceneFar",Te)}if("splat_blend"in i||"splat_scale"in i||"splat_opacityScale"in i){var De=fe(i,"splat_blend",s.s("splat.blend"));De&&(Array.isArray(De)?s.s("splat.blend","rgba("+De[0]+","+De[1]+","+De[2]+","+De[3]+")"):s.s("splat.blend",De));var Be=fe(i,"splat_scale",s.s("splat.scale"));s.s("splat.scale",Be);var Oe=fe(i,"splat_opacityScale",s.s("splat.opacity.scale"));s.s("splat.opacity.scale",Oe)}"ht_animation_camera"===s.getTag()?s instanceof ht.Camera?void 0===i.x_p&&void 0===i.y_p&&void 0===i.z_p&&void 0===i.x_r&&void 0===i.y_r&&void 0===i.z_r&&void 0===i["_gis.lng"]&&void 0===i["_gis.lat"]&&void 0===i["_gis.height"]&&void 0===i["_gis.heading"]&&void 0===i["_gis.pitch"]&&void 0===i["_gis.roll"]&&void 0===i.scene_fovy&&void 0===i.scene_near&&void 0===i.scene_far||we(a,s,r,i,m,o):void 0===i.x_p&&void 0===i.y_p&&void 0===i.z_p||Ae(a,r):"ht_animation_camera_center"===s.getTag()&&Se(a,s,r,m,o)};for(var g in e._transactionMap)y();if(delete e._transactionMap,m.sync){var _=a.dm().getDataByTag("ht_animation_camera");m.centerPos&&_.lookAt(m.centerPos,m.up),a.syncFromCamera(_)}v&&a.iv()}}function ke(e){var t=e.dm().getDataByTag("ht_animation_cubeCamera");t&&t.render(e);var a=e.dm().getDataByTag("ht_blueprint_mat_skyMain");a&&a.iv()}function we(e,t,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=arguments.length>4?arguments[4]:void 0,r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if("ht_animation_camera"===t.getTag()){var o=e.dm().getDataByTag("ht_animation_camera_center");if(o){var s=o.a("ht.animationList");s&&s[a]&&(i&&i.c_up?xe(t,o,i.c_up,n):xe(t,o,null,n))}r&&(n.sync=!0)}else{var l=e.dm().getDataByTag("ht_animation_camera");l&&(xe(l,t,ht.AnimationPlayer.c_up,n),function(e,t,a){if(e&&t&&a){var i=t.a("ht.animationList"),n=e.a("ht.animationList");if(n&&i&&n[a]&&i[a])return!0}}(l,t,a)&&r&&(n.sync=!0))}}function xe(e,t,a,i){var n=t.p3();a||(a=e.getUp()),i.centerPos=n,i.up=a}function Ae(e,t){e&&function(e,t){var a=e.dm().getDataByTag("ht_animation_camera");if(a){var i,n=a.p3(),r=e.dm().getDataByTag("ht_animation_camera_center");if(r){var o=r.a("ht.animationList");if(o&&o[t]){i=!0;var s=r.p3();Pe(e,n),e.setCenter(s),a.lookAt(s,"back")}}i||(Pe(e,n),function(e,t,a,i){var n=new ht.Math.Vector3(0,0,1),r=t.r3(),o=t.getRotationMode();(function(e,t,a){switch(a){case"xyz":e.applyAxisAngle(new ht.Math.Vector3(1,0,0),t[0]),e.applyAxisAngle(new ht.Math.Vector3(0,1,0),t[1]+Math.PI),e.applyAxisAngle(new ht.Math.Vector3(0,0,1),t[2]);break;case"xzy":e.applyAxisAngle(new ht.Math.Vector3(1,0,0),t[0]),e.applyAxisAngle(new ht.Math.Vector3(0,0,1),t[2]),e.applyAxisAngle(new ht.Math.Vector3(0,1,0),t[1]+Math.PI);break;case"yxz":e.applyAxisAngle(new ht.Math.Vector3(0,1,0),t[1]+Math.PI),e.applyAxisAngle(new ht.Math.Vector3(1,0,0),t[0]),e.applyAxisAngle(new ht.Math.Vector3(0,0,1),t[2]);break;case"yzx":e.applyAxisAngle(new ht.Math.Vector3(0,1,0),t[1]+Math.PI),e.applyAxisAngle(new ht.Math.Vector3(0,0,1),t[2]),e.applyAxisAngle(new ht.Math.Vector3(1,0,0),t[0]);break;case"zxy":e.applyAxisAngle(new ht.Math.Vector3(0,0,1),t[2]),e.applyAxisAngle(new ht.Math.Vector3(1,0,0),t[0]),e.applyAxisAngle(new ht.Math.Vector3(0,1,0),t[1]+Math.PI);break;case"zyx":e.applyAxisAngle(new ht.Math.Vector3(0,0,1),t[2]),e.applyAxisAngle(new ht.Math.Vector3(0,1,0),t[1]+Math.PI),e.applyAxisAngle(new ht.Math.Vector3(1,0,0),t[0])}})(n,r,o),n.setLength(1e3),n.add(new ht.Math.Vector3(a[0],a[1],a[2])),n.x=Number(n.x.toFixed(2)),n.y=Number(n.y.toFixed(2)),n.z=Number(n.z.toFixed(2)),i?e.setCenter([n.x,n.y,n.z]):(e.setEye(a),e.setCenter([0,0,0]))}(e,a,n,!0)),function(e){if(e&&e instanceof ht.graph3d.Graph3dView){var t=e.getCenter(),a=e.getEye();t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&(t[1]=t[1]+1,e.setCenter(t))}}(e)}}(e,t)}function Pe(e,t){ht.animationplayer._setEye?ht.animationplayer._setEye(t):e.setEye(t)}function Se(e,t,a,i,n){var r=e.dm().getDataByTag("ht_animation_camera");r&&(r instanceof ht.Camera?we(e,t,a,null,i,n):Ae(e,a))}function Ie(e,t,a,i,n){for(var r=0;r<a[i].length;r++){var o=a[i][r],s=o.b,l=o.d,c=o.n;o.u||n>=s&&n<=s+l&&(o.u=1,"glitch"===c&&Me(e,t,o))}}function Me(e,t,a){if(a){var i,n=a.d/60;e._vfxAnimate=R((function(r,o){i||(i=r),r-i>n&&(t.setPostProcessingValue("Glitch","enable",!1),V(e._vfxAnimate),delete e._vfxAnimate,delete a.u)}),1500),t.setPostProcessingValue("Glitch","enable",!0)}}var Fe=function(){function e(){l(this,e),this._animationMapForResume=new Map,this._animationResume=new Set,this._animationId=new Map,this._animationCurrentTime=new Map,this._animationCurrentTimeForNode=new Map,this._finishParamsSet=new Set,this._finishParamsSet2=new Set,this._eventObj={},this._eventFunc={},this._eventScope={},this._version="0.23",this._versionLimit=1,this._speed=1,this._speed2=null,this._endFrame=null,this._endFrameForBackward=0,this._symbolAnimationPlayer=new ye,this._onRootDataUpdatedSetted=!1,this._onRootDataUpdated=!1,this._displayCallback=[],this._triggerBySetCurrent=null,this._notifier=new ht.Notifier,this._symbolAnimationPlayer._notifier=this._notifier,ht.animationplayer.player2d||this.disableRootCheck(!0),ht.animationplayer.bone2DListener||(ht.animationplayer.bone2DListener={}),this._limit=1e-5,this._clipperCurrentAllSpeed=[],this._clipNodeIdMap={},this._clipperFrontReview=[],this._clipperBackReview=[],this._clipperBeginFrame=[],this._clipperBeginFrameForSet=[],this._clipperFileArrForPlay=[],this._clipperFileArrForPlayInverse=[],this._clipperInit=[],this._clipperAnimationId=[],this._clipperAnimationId_1=[],this._clipperAnimationId_2s=[],this._repeatPauseOffset=[],this._repeatTriggerByPause=[],this._repeatTriggerByPauseNum=[],this._hasPausedRepeat=[],this._clipFiles=[],this._clipLoopHandle={},this._customCB={}}return h(e,[{key:"setSpeed",value:function(e){this._speed=e,this._symbolAnimationPlayer._speed=e}},{key:"changeSpeedOnPlaying",value:function(e){this._speed2=e}},{key:"clearSpeed",value:function(){this._speed=1,this._symbolAnimationPlayer._speed=1,this._speed2=null}},{key:"setRepeat",value:function(e,t,a){e&&e.dm&&e.dm().getDatas().each((function(e){if(e.a&&e.a("ht.animationList")){var i=e.a("ht.animationList");if(i){var n=i[t];n&&(n.r=a)}}}))}},{key:"getRepeat",value:function(e,t){if(e&&e.dm)for(var a=e.dm().getDatas(),i=0;i<a.size();i++){var n=a.get(i);if(n.a&&n.a("ht.animationList")){var r=n.a("ht.animationList");if(r){var o=r[t];if(o)return o.r}}}}},{key:"disableRootCheck",value:function(e){this._onRootDataUpdatedSetted=e,this._onRootDataUpdated=e}},{key:"setCurrentFrame",value:function(e,t,a,i,n,r){var o="2D"===this._checkType(e);this._checkNeedConvert(e),r||(a?this.removeByNode(t,a):this.remove(t));var s=this.init(e.dm());if(s){var l=s.get(t);if(l){if(this._triggerBySetCurrent=!0,_e(this),a){var c=l.arrsToPlay.get(a);o?this._playAnimate(c,a,i/60,o,null,null,t):this._playAnimate(c,a,i/60,o,e,null,t)}else o?this._playAnimates(i/60,o,null,null,t):this._playAnimates(i/60,o,e,null,t);be(this,e,o,t,n),this._triggerBySetCurrent=null}}}},{key:"getCurrentFrame",value:function(e,t){var a,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e&&void 0!==(a=t?this._animationCurrentTimeForNode.get(e+"_"+t.getId()):this._animationCurrentTime.get(e)))return i?Math.ceil(60*a):60*a}},{key:"getEndFrame",value:function(e,t){if(e&&e.dm)for(var a=e.dm().getDatas(),i=0;i<a.size();i++){var n=a.get(i).a("ht.animationList");if(n){var r=n[t];if(r)return v(r)}}}},{key:"playDuring",value:function(e,t,a,i,n,r,o,s){var l=!0;!e||e instanceof ht.graph.GraphView||e instanceof ht.graph3d.Graph3dView||(t=e.fileName,a=e.node,i=e.startFrame,n=e.endFrame,r=e.eventKey,o=e.eventParams,s=e.speed,l=void 0===e.firstPerson||e.firstPerson,e=e.view),this._checkNeedConvert(e),this._notifier.fire({fileName:t,type:"playDuring"}),i=Number(i),n=Number(n),void 0===s?(s=this._speed,i>n?this._speed>0&&(s*=-1):this._speed<0&&(s*=-1)):(s=Number(s),i>n?s>0&&(s*=-1):s<0&&(s*=-1)),this._endFrame=n,this.setCurrentFrame(e,t,a,i,l,!1),a?this._animationCurrentTimeForNode.set(t+"_"+a.getId(),i/60):this._animationCurrentTime.set(t,i/60),this.play({view:e,fileName:t,node:a,eventKey:r,eventParams:o,speed:s,firstPerson:l})}},{key:"scaleFrame",value:function(e,t,a,i){var n=function(e){var a=e.a("ht.animationList");if(a&&a.hasOwnProperty(t)){var n=a[t];for(var r in n.e*=i,n)if(n.hasOwnProperty(r))for(var o=n[r],s=k(r,o),l=0;l<s;l++){var c=b(r,o,l);c&&(c.t*=i,w(r,o,l,c.t))}}};a?n(a):e.dm().getDatas().each((function(e){n(e)}))}},{key:"addEvent",value:function(e,t,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=this._eventObj[e];n||(n=this._eventObj[e]=new ht.Notifier),n.add(t,a,i),this._eventFunc[e]?(this._eventScope[e].push(a),this._eventFunc[e].push(t)):(this._eventFunc[e]=[t],this._eventScope[e]=[a])}},{key:"removeEvent",value:function(e,t,a){var i=this._eventObj[e];i&&i.remove(t,a)}},{key:"clearEvents",value:function(e){delete this._eventObj[e],delete this._eventFunc[e],delete this._eventScope[e]}},{key:"fireEvent",value:function(e,t){var a=this._eventObj[e];a&&a.fire(t)}},{key:"init",value:function(e){var t=this;if(e&&e instanceof ht.DataModel&&e.a("ht.animationList")){this._animateMap||(this._animateMap=new Map);var a=e.getDatas(),i=new ht.List;a.each((function(e){e.a("ht.animationList")&&i.add(e)}));for(var n=e.a("ht.animationList"),r=function(){var e=n[o],a=new Map,r=!1,s=0;i.each((function(t){var i=t.a("ht.animationList");if(i.hasOwnProperty(e)){var n=i[e];r=n.r,n.e>s&&(s=n.e);var o=new Map;for(var l in n)n.hasOwnProperty(l)&&n[l].length&&(o.set(l,n[l]),a.set(t,o))}}));var l={endFrame:s,repeat:r,arrsToPlay:a};t._animateMap.set(e,l)},o=0;o<n.length;o++)r();return this._animateMap}}},{key:"resetDisplay",value:function(e){if(this._onRootDataUpdatedSetted=!1,this._onRootDataUpdated=!1,e){var t=e.dm().a("ht.animationList");if(t&&t.length){var a=e.dm().getDatas();a&&a.forEach((function(e){t.forEach((function(t){e.a&&e.a("ht.animationReset_"+t)&&e.a("ht.animationReset_"+t,void 0)}))}))}}}},{key:"getFileEndTime",value:function(e,t){for(var a=e.dm().getDatas().toArray(),i=0;i<a.length;i++){var n=a[i].a("ht.animationList");if(n&&n.hasOwnProperty(t)){var r=v(n[t]);if(r)return r}}return 0}},{key:"getFileEndTimeByNode",value:function(e,t){if(e&&t){var a=e.a("ht.animationList");if(a&&a.hasOwnProperty(t)){var i=v(a[t]);if(i)return i}}return 0}},{key:"disableHistoryManager",value:function(e){if(e){var t=e.dm();t.disableHistoryManager&&(t._historyManager||ht.HistoryManager)&&t.disableHistoryManager()}}},{key:"enableHistoryManager",value:function(e){if(e){var t=e.dm();t.enableHistoryManager&&(t._historyManager||ht.HistoryManager)&&t.enableHistoryManager()}}},{key:"play",value:function(e,t){var a=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],l=!(arguments.length>7&&void 0!==arguments[7])||arguments[7],c=!0;if(!e||e instanceof ht.graph.GraphView||e instanceof ht.graph3d.Graph3dView||(t=e.fileName,i=e.node,n=e.eventKey,r=e.eventParams,o=e.speed,s=void 0===e.clear||e.clear,l=void 0===e.needFireEvent||e.needFireEvent,c=void 0===e.firstPerson||e.firstPerson,e=e.view),l&&this._notifier.fire({fileName:t,type:"play"}),e&&t){this._checkNeedConvert(e);var f=e.dm();this._checkImages(f,t,(function(){o||(o=j(e,t)),s&&(i?a.removeByNode(t,i,!1):a.remove(t,!1));var l=f.a("ht.animationSpeed");l?a._speed<0?a._speed=-l:a._speed=l:a._speed<0&&(a._speed*=-1);var h=a._checkType(e),u=function(){var s=Date.now();if(!i&&a._animationResume.has(t))a._animationResume.delete(t);else if(i&&a._animationResume.has(t+"_"+i.getId()))a._animationResume.delete(t+"_"+i.getId());else{if(!i&&a._animationMapForResume.has(t))return;if(i&&a._animationMapForResume.has(t+"_"+i.getId()))return;var l={animationView:e,type:h,fileName:t,currentNode:i,eventKey:n,eventParams:r,animationSpeed:o};i?(a._animationMapForResume.set(t+"_"+i.getId(),l),a._animationId.set(t+"_"+i.getId(),null)):(a._animationMapForResume.set(t,l),a._animationId.set(t,null))}if(i?a._animationCurrentTimeForNode.has(t+"_"+i.getId())||a._animationCurrentTimeForNode.set(t+"_"+i.getId(),0):a._animationCurrentTime.has(t)||a._animationCurrentTime.set(t,0),a.init(f)){a._version=f.a("ht.animationVersion"),a._version||(a._version="0.4");var u="2D"===h;if(i){var p={currentNode:i,fileName:t,nowDate:s,flag2D:u,eventKey:n,eventParams:r,animationSpeed:o,firstPerson:c};a.playSingle(e,p)}else{var d={fileName:t,nowDate:s,flag2D:u,eventKey:n,eventParams:r,animationSpeed:o,firstPerson:c};a.playMultiple(e,d)}}};"2D"===h?(a._onRootDataUpdatedSetted||(a._onRootDataUpdatedSetted=!0,e.onRootDataUpdated=function(){a._onRootDataUpdated||(a._onRootDataUpdated=!0,a._displayCallback.forEach((function(e){e.func2(),e.func()})))}),a._onRootDataUpdated?(a.resetPosition(e,t,null,o),u()):a._displayCallback.push({func:u,func2:function(){a.resetPosition(e,t,null,o)}})):u()}))}}},{key:"playBackward",value:function(e,t,a,i,n,r){var o=!0;if(!e||e instanceof ht.graph.GraphView||e instanceof ht.graph3d.Graph3dView||(t=e.fileName,a=e.node,i=e.eventKey,n=e.eventParams,r=e.speed,o=void 0===e.firstPerson||e.firstPerson,e=e.view),this._checkNeedConvert(e),this._notifier.fire({fileName:t,type:"playBackward"}),r||(r=j(e,t)),a)if(this._animationCurrentTimeForNode.has(t+"_"+a.getId()))this.removeByNode(t,a,!1);else{var s=this.getFileEndTimeByNode(a,t);this._animationCurrentTimeForNode.set(t+"_"+a.getId(),s/60)}else if(this._animationCurrentTime.has(t))this.remove(t,!1);else{var l=this.getFileEndTime(e,t);this._animationCurrentTime.set(t,l/60)}this._endFrame=0,r?(r>0&&(r*=-1),this.play({view:e,fileName:t,node:a,eventKey:i,eventParams:n,speed:r,needFireEvent:!1,firstPerson:o})):(this._speed>0&&(r=-this._speed),this.play({view:e,fileName:t,node:a,eventKey:i,eventParams:n,speed:r,needFireEvent:!1,firstPerson:o}))}},{key:"playSymbol",value:function(e,t,a,i,n,r){var o=this;!e||e instanceof ht.graph.GraphView||e instanceof ht.graph3d.Graph3dView||(t=e.fileName,a=e.node,i=e.eventKey,n=e.eventParams,r=e.speed,e=e.view),this.setViewToGlobal(e),this._notifier.fire({fileName:t,type:"playSymbol"});this._symbolAnimationPlayer.checkSymbolAnimation(e,a,(function(){return o._symbolAnimationPlayer.play(e,t,a,i,n,r)}))}},{key:"playBackwardSymbol",value:function(e,t,a,i,n,r){var o=this;!e||e instanceof ht.graph.GraphView||e instanceof ht.graph3d.Graph3dView||(t=e.fileName,a=e.node,i=e.eventKey,n=e.eventParams,r=e.speed,e=e.view),this.setViewToGlobal(e),this._notifier.fire({fileName:t,type:"playBackwardSymbol"});this._symbolAnimationPlayer.checkSymbolAnimation(e,a,(function(){r?o._symbolAnimationPlayer.play(e,t,a,i,n,-r):(r=-o._symbolAnimationPlayer._speed,o._symbolAnimationPlayer.play(e,t,a,i,n,r))}))}},{key:"removeSymbolAnimation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this._notifier.fire({type:"beforeRemoveSymbol"}),e&&t){var a=e+"$"+t.getId();this._symbolAnimationPlayer.stopAnimate(a)}else if(e)if("string"==typeof e)if(e.split("$").length>1)this._symbolAnimationPlayer.stopAnimate(e);else{var i=[],n=this._symbolAnimationPlayer._animateIndexMap;for(var r in n){var o=n[r];if(o)if(Array.isArray(o))for(var s=0;s<o.length;s++){e===o[s].split("$")[0]&&i.push(o[s])}else e===o.split("$")[0]&&i.push(o)}for(var l=0;l<i.length;l++)this._symbolAnimationPlayer.stopAnimate(i[l])}else{var c=e.getId(),f=[],h=this._symbolAnimationPlayer._animateIndexMap;for(var u in h){var p=h[u];if(p)for(var d=0;d<p.length;d++){var v=p[d];c+""===v.split("$")[1]&&f.push(v)}}for(var m=0;m<f.length;m++)this._symbolAnimationPlayer.stopAnimate(f[m])}else this._symbolAnimationPlayer.stopAnimate();this._notifier.fire({type:"afterRemoveSymbol"})}},{key:"addSymbolEvent",value:function(e,t,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._symbolAnimationPlayer.addEvent(e,t,a,i)}},{key:"removeSymbolEvent",value:function(e,t,a){this._symbolAnimationPlayer.removeEvent(e,t,a)}},{key:"setSymbolCurrentFrame",value:function(e,t,a,i){var n=this;this._symbolAnimationPlayer.checkSymbolAnimation(e,a,(function(){n._symbolAnimationPlayer.setCurrentFrame(e,t,a,i)}))}},{key:"playSymbolDuring",value:function(e,t,a,i,n,r,o){var s=this;this.setViewToGlobal(e),this._notifier.fire({fileName:t,type:"playSymbolDuring"});this._symbolAnimationPlayer.checkSymbolAnimation(e,a,(function(){s._symbolAnimationPlayer.playDuring(e,t,a,i,n,r,o)}))}},{key:"setSymbolRepeat",value:function(e,t,a){this._symbolAnimationPlayer.setRepeat(e,t,a)}},{key:"pauseSymbol",value:function(){this._notifier.fire({type:"beforePauseSymbol"}),this._symbolAnimationPlayer.pause(),this._notifier.fire({type:"afterPauseSymbol"})}},{key:"resumeSymbol",value:function(e,t,a){this._notifier.fire({type:"resumeSymbol"}),void 0!==t&&this._symbolAnimationPlayer.resume(e,t,a)}},{key:"getSymbolCurrentFrame",value:function(e,t){return this._symbolAnimationPlayer.getCurrentFrame(e,t)}},{key:"setViewToGlobal",value:function(e){e instanceof ht.graph.GraphView?ht.animationplayer.g2d||(ht.animationplayer.g2d=e):e instanceof ht.graph3d.Graph3dView&&(ht.animationplayer.g3d||(ht.animationplayer.g3d=e))}},{key:"playSingle",value:function(e,t){var a=t.currentNode,i=t.fileName,n=t.nowDate,r=t.flag2D,o=t.eventKey,s=t.eventParams,l=t.animationSpeed,c=t.firstPerson,f=this._animateMap.get(i);if(f){var h=f.repeat,u=f.endFrame,p=f.arrsToPlay;null!==this._endFrame&&(this._endFrameForBackward=u,u=this._endFrame,this._endFrame=null);var d=p.get(a);if(!d)return void this._animationMapForResume.delete(i+"_"+a.getId());var v={fileName:i,currentNode:a,arrToPlay:d,nowDate:n,repeat:h,endFrame:u,flag2D:r,eventKey:o,eventParams:s,animationSpeed:l,firstPerson:c};this._setAnimate(v,e)}}},{key:"playMultiple",value:function(e,t){var a=t.fileName,i=t.nowDate,n=t.flag2D,r=t.eventKey,o=t.eventParams,s=t.animationSpeed,l=t.firstPerson,c=this._animateMap.get(a);if(c){var f=c.repeat,h=c.endFrame;null!==this._endFrame&&(this._endFrameForBackward=h,h=this._endFrame,this._endFrame=null);var u={fileName:a,nowDate:i,repeat:f,endFrame:h,flag2D:n,eventKey:r,eventParams:o,animationSpeed:s,firstPerson:l};this._setAnimates(u,e)}}},{key:"pause",value:function(e,t){var a;(this._notifier.fire({fileName:e,type:"beforePause"}),void 0!==e)&&(a=t?this._animationId.get(e+"_"+t.getId()):this._animationId.get(e),ht.animationplayer._caf?ht.animationplayer._caf(a):V(a),t?this._animationResume.add(e+"_"+t.getId()):this._animationResume.add(e),this._animationId.delete(a),this._finishParamsSet.clear(),this._notifier.fire({fileName:e,type:"afterPause"}))}},{key:"resume",value:function(e,t){var a,i,n,r,o,s;void 0!==e&&(this._notifier.fire({fileName:e,node:t,type:"beforeResume"}),(a=t?this._animationMapForResume.get(e+"_"+t.getId()):this._animationMapForResume.get(e))&&(i=a.animationView,n=a.currentNode,r=a.eventKey,o=a.eventParams,s=a.animationSpeed),void 0===s&&(s=this._speed?this._speed:1),s>0?this.play(i,e,n,r,o,s):this.playBackward(i,e,n,r,o,s),this._notifier.fire({fileName:e,node:t,type:"afterResume"}))}},{key:"remove",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._notifier.fire({fileName:e,type:"beforeRemove"}),void 0!==e){var a=this._animationId.get(e);ht.animationplayer._caf?ht.animationplayer._caf(a):V(a),this._animationId.delete(e),this._animationMapForResume.delete(e),t&&this._animationCurrentTime.delete(e),this._animationResume.delete(e),this._finishParamsSet.clear(),this._finishParamsSet2.clear(),this._notifier.fire({fileName:e,type:"afterRemove"})}}},{key:"removeByNode",value:function(e,t){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this._notifier.fire({fileName:e,node:t,type:"beforeRemoveByNode"}),void 0!==e){var i=this._animationId.get(e+"_"+t.getId());ht.animationplayer._caf?ht.animationplayer._caf(i):V(i),this._animationId.delete(e+"_"+t.getId()),this._animationMapForResume.delete(e+"_"+t.getId()),a&&this._animationCurrentTimeForNode.delete(e+"_"+t.getId()),this._animationResume.delete(e+"_"+t.getId()),this._finishParamsSet.clear(),this._finishParamsSet2.clear(),this._notifier.fire({fileName:e,node:t,type:"afterRemoveByNode"})}}},{key:"removeAll",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._notifier.fire({type:"beforeRemoveAll"});var i=e.dm().a("ht.animationList");if(i)for(var n=0;n<i.length;n++){var r=i[n];this.remove(r,a)}if(t)for(var o in this._eventFunc){var s=this._eventScope[o],l=this._eventFunc[o];if(l&&s)for(var c=0;c<l.length;c++){var f=l[c],h=s[c];this.removeEvent(o,f,h)}this.clearEvents(o)}this._notifier.fire({type:"afterRemoveAll"})}},{key:"removeAllByNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._notifier.fire({type:"beforeRemoveAllByNode"});for(var i=e.dm().getDatas().toArray(),n=0;n<i.length;n++){var r=i[n],o=r.a("ht.animationList");if(o)for(var s=0;s<o.length;s++){var l=o[s];this.removeByNode(l,r,a)}}if(t)for(var c in this._eventFunc){var f=this._eventScope[c],h=this._eventFunc[c];if(h&&f)for(var u=0;u<h.length;u++){var p=h[u],d=f[u];this.removeEvent(c,p,d)}this.clearEvents(c)}this._notifier.fire({type:"afterRemoveAllByNode"})}},{key:"resetProperties",value:function(e,t,a,i,n){}},{key:"clearParse",value:function(){this._resumeDate=0}},{key:"resetPosition",value:function(e,t,a,i){i||(i=1),e.dm().getDatas().each((function(e){if((!e.a("ht.animationReset_"+t)||a)&&e.getPosition){var n=e.getPosition(),r=e.a("ht.animationList");if(r){var o=r[t];if(o){if(e.a("ht.animationReset_"+t,!0),o.x_p){var s=o.x_p,l=0,c=k("x_p",s);if(i>0)for(var f=0;f<c;f++){var h=b("x_p",s,f);0===f?(l=n.x-h.v,x("x_p",s,f,n.x)):x("x_p",s,f,h.v+l)}else for(var u=c-1;u>-1;u--){var p=b("x_p",s,u);u===c-1?(l=n.x-p.v,x("x_p",s,u,n.x)):x("x_p",s,u,p.v+l)}}if(o.y_p){var d=o.y_p,v=0,m=k("y_p",d);if(i>0)for(var y=0;y<m;y++){var g=b("y_p",d,y);0===y?(v=n.y-g.v,x("y_p",d,y,n.y)):x("y_p",d,y,g.v+v)}else for(var _=m-1;_>-1;_--){var w=b("y_p",d,_);_===m-1?(v=n.y-w.v,x("y_p",d,_,n.y)):x("y_p",d,_,w.v+v)}}}}}}))}},{key:"loadImages",value:function(e){for(var t=e.dm().getDatas().toArray(),a=0;a<t.length;a++){var i=t[a].a("ht.animationList");if(i)for(var n in i){var r=i[n];if(r){var o=r.img;if(o)for(var s=0;s<o.length;s++){var l=p(o[s]);l&&ht.Default.getImage(l)}}}}}},{key:"getNotifier",value:function(){return this._notifier}},{key:"getVersion",value:function(){return"0.23.15.2"}},{key:"initBone2D",value:function(e){te(e)}},{key:"getCurrentFileNames",value:function(){var e=[];return this._animationCurrentTime.forEach((function(t,a){e.push(a)})),e}},{key:"playAnimations",value:function(e){var t=this,a=this,i=e.view,n=e.speed,r=e.index,o=e.loop,s=e.fileName,l=i.dm(),c=l.a("ht.animationClip");this._clipFiles=l.a("ht.animationClipFileName")||[];var f=l.a("ht.animationClipVFX");if(r=s?this._getClipIndexByName(s):this._getClipIndex(r),Array.isArray(c)&&(c=c[r]),this._repeatPauseOffset[r]||(this._repeatPauseOffset[r]=0),c&&Object.keys(c).length){this._clipperBeginFrame[r]||(this._clipperFrontReview[r]={},this._clipperBackReview[r]={}),this._notifier.fire({type:"playAnimations",index:r,fileName:this._getClipNameByIndex(r)}),this._setClipperFileArrForPlay(c,r),this._clipperInit[r]?this._clipperBeginFrame[r]||n>0&&this._reviewClip(i,c,0,"back",null,r):(this._clipperInit[r]=!0,n>0&&this._reviewClip(i,c,0,"back",null,r));var h,u,p=this._getClipSpeed(l,n,r),d=this._getClipEndFrame(c),v=this._clipperBeginFrame[r]?this._clipperBeginFrame[r]:0;if(o?this._setClipLoop(i,r):u=this._checkClipperRepeatFile(r),u){if(this._clipperAnimationId_1[r]=R((function(e){h||(h=e);var n=(e-h)/1e3,o=t._clipperCurrentAllSpeed[r]?t._clipperCurrentAllSpeed[r]:p,s=v+o*n*60;t._clipperBeginFrame[r]=s,t._clipperBeginFrameForSet[r]=s,o>0&&s>d||o<0&&s<0?(t._reviewClip(i,c,d,null,u[0],r),t._notifier.fire({type:"beforeRemoveAnimations",index:r,fileName:t._getClipNameByIndex(r)}),V(t._clipperAnimationId_1[r]),t._clipperAnimationId_1[r]=null,t._notifier.fire({type:"afterRemoveAnimations",index:r,fileName:t._getClipNameByIndex(r)})):(f&&f[r]&&Ie(a,i,f,r,s),t._reviewClip(i,c,s,null,u[0],r))})),this._hasPausedRepeat[r])return;var m=u[1];this._clipperAnimationId_2s[r]?this._clipperAnimationId_2s[r].length=0:this._clipperAnimationId_2s[r]=[];for(var y=function(e){var a,n=m[e][0],o=n.b,s=n.b+n.d,l=!0,f=1;t._clipperAnimationId_2s[r][e]=R((function(n){if(a||(a=n),l){var u=(n-h)/1e3,d=t._clipperCurrentAllSpeed[r]?t._clipperCurrentAllSpeed[r]:p;if(v>=o)l=!1,f=1,a=n;else{if(!(v+d*u*60>=o))return;l=!1,f=1,a=n}}t._repeatTriggerByPause[r]?(t._repeatPauseOffset[r]+=t._repeatTriggerByPauseNum[r],t._repeatTriggerByPauseNum[r]=0,t._repeatTriggerByPause[r]=null):t._repeatTriggerByPauseNum[r]=n-a;var y=(n-a+t._repeatPauseOffset[r])/1e3,g=o+f*y*60;g>s?(g=s,t._reviewClip(i,c,g,null,m[e],r),g=o,t._reviewClip(i,c,g,null,m[e],r),a=n,t._repeatPauseOffset[r]=0):t._reviewClip(i,c,g,null,m[e],r)}))},g=0;g<m.length;g++)y(g)}else{this._clipperAnimationId[r]=R((function(e){h||(h=e),t._playUnLoopClip(i,c,e,h,r,p,v,d,f)}))}}}},{key:"_getClipIndex",value:function(e){return e?"string"==typeof e&&(e=this._getClipIndexByName(e)):e=0,e}},{key:"_getClipIndexByName",value:function(e){var t;return-1===(t=this._clipFiles.indexOf(e))&&(t=0),t}},{key:"_getClipNameByIndex",value:function(e){var t=this._clipFiles[e];if(t)return t}},{key:"_setClipLoop",value:function(e,t){var a=this;if(!this._clipLoopHandle[t+""]){var i=function(i){i&&"afterRemoveAnimations"===i.type&&i.index===t&&a.playAnimations({view:e,index:t,loop:!0})};this._clipLoopHandle[t+""]=i,this._notifier.add(i)}}},{key:"destroyAnimations",value:function(){this._notifier.fire({type:"beforeDestroyAnimations"});var e=[];for(var t in this._clipperAnimationId)this.removeAnimations(Number(t));if(this._clipperAnimationId_1.length)for(var a=0;a<this._clipperAnimationId_1.length;a++)-1===e.indexOf(a)&&e.push(a);if(this._clipperAnimationId_2s.length)for(var i=0;i<this._clipperAnimationId_2s.length;i++)-1===e.indexOf(i)&&e.push(i);for(var n=0;n<e.length;n++){var r=e[n];this.removeAnimations(r),this._clipperCurrentAllSpeed[r]=null,this._clipperBeginFrame[r]=null,this._clipperInit[r]=null,this._clipperFrontReview[r]=null,this._clipperBackReview[r]=null,this._clipperBeginFrameForSet[r]=null,this._clipFiles[r]&&delete this._clipFiles[r],this._clipperFileArrForPlay[r]&&(this._clipperFileArrForPlay[r].length=0,delete this._clipperFileArrForPlay[r]),this._clipperFileArrForPlayInverse[r]&&(this._clipperFileArrForPlayInverse[r].length=0,delete this._clipperFileArrForPlayInverse[r])}this._finishParamsSet.clear(),this._finishParamsSet2.clear(),this._clipNodeIdMap={},this._animateMap&&this._animateMap.clear(),this._notifier.fire({type:"afterDestroyAnimations"}),this.unregisterCustomCallback()}},{key:"removeAnimations",value:function(e){if(e=this._getClipIndex(e),this._notifier.fire({type:"beforeRemoveAnimations",index:e,fileName:this._getClipNameByIndex(e)}),this._hasPausedRepeat[e]=null,this._repeatTriggerByPause[e]=null,this._repeatPauseOffset[e]=0,this._repeatTriggerByPauseNum[e]=0,this._clipperAnimationId_1[e]&&(V(this._clipperAnimationId_1[e]),this._clipperAnimationId_1[e]=null),this._clipperAnimationId_2s[e]&&this._clipperAnimationId_2s[e].length){for(var t=0;t<this._clipperAnimationId_2s[e].length;t++)V(this._clipperAnimationId_2s[e][t]);this._clipperAnimationId_2s[e].length=0}this._clipperCurrentAllSpeed[e]=null;var a=this._clipLoopHandle[e+""];a&&(this._notifier.remove(a),delete this._clipLoopHandle[e+""]),this._stopClipAnimation(!1,!1,e)}},{key:"pauseAnimations",value:function(e,t){t=this._getClipIndex(t),this._notifier.fire({type:"beforePauseAnimations",index:t,fileName:this._getClipNameByIndex(t)}),this._stopClipAnimation(!0,e,t)}},{key:"setAnimationsSpeed",value:function(e,t){isNaN(e)||(t=this._getClipIndex(t),this._clipperCurrentAllSpeed[t]=e)}},{key:"setAnimationsCurrentFrame",value:function(e,t,a,i){i=this._getClipIndex(i),this._clipperAnimationId[i]&&this._stopClipAnimation(!1,!1,i),this._clipperFrontReview[i]={},this._clipperBackReview[i]={};var n=e.dm().a("ht.animationClip");this._setClipperFileArrForPlay(n,i);var r="front";if(void 0!==a?1===a&&(r="back"):t<this._clipperBeginFrameForSet[i]&&(r="back"),"front"===r)this._reviewClip(e,n,0,"back",null,i);else if(this._clipperFileArrForPlay[i]){for(var o=0,s=0;s<this._clipperFileArrForPlay[i].length;s++){var l=this._clipperFileArrForPlay[i][s];if(l){var c=l.b+l.d;c>o&&(o=c)}}this._reviewClip(e,n,o,"front",null,i)}this._reviewClip(e,n,t,r,null,i),this._clipperBeginFrame[i]=t,this._clipperBeginFrameForSet[i]=t}},{key:"getAnimationsCurrentFrame",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=this._getClipIndex(e),t?Math.ceil(this._clipperBeginFrame[e]):this._clipperBeginFrame[e]}},{key:"playAnimationsDuring",value:function(e,t,a,i,n){var r=this;t=this._getClipIndex(t);var o=e.dm(),s=o.a("ht.animationClip"),l=s[t],c=o.a("ht.animationClipVFX");this._setClipperFileArrForPlay(s,t);var f,h=this._getClipSpeed(o,n,t);this._clipperAnimationId[t]=R((function(n){f||(f=n),r._playUnLoopClip(e,l,n,f,t,h,a,i,c)}))}},{key:"syncCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e instanceof ht.graph3d.Graph3dView){var a,i,n=e.dm().getDataByTag("ht_animation_camera");if(n)if(n instanceof ht.Camera)t||(a=n.p3(),i=n.r3()),e.getCamera(n),t||(n.p3(a),n.r3(i))}}},{key:"registerCustomCallback",value:function(e,t,a){if(e&&t&&"function"==typeof t)if(a){var i=a.getId();this._customCB[e+"_"+i]=t}else this._customCB[e]=t}},{key:"unregisterCustomCallback",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(e)if(t){var a=t.getId();delete this._customCB[e+"_"+a]}else delete this._customCB[e];else this._customCB={}}},{key:"_playUnLoopClip",value:function(e,t,a,i,n,r,o,s,l){var c=(a-i)/1e3,f=this._clipperCurrentAllSpeed[n]?this._clipperCurrentAllSpeed[n]:r,h=o+f*c*60;this._clipperBeginFrame[n]=h,this._clipperBeginFrameForSet[n]=h,f>0&&h>s||f<0&&h<0?(this._reviewClip(e,t,s,!1,null,n),this._notifier.fire({type:"beforeRemoveAnimations",index:n,fileName:this._getClipNameByIndex(n)}),this._stopClipAnimation(!1,!1,n)):(l&&l[n]&&Ie(this,e,l,n,h),this._reviewClip(e,t,h,!1,null,n))}},{key:"_checkClipperRepeatFile",value:function(e){var t=this._clipperFileArrForPlay[e];if(t&&t.length){for(var a=[],i=[],n=0;n<t.length;n++){var r=t[n];r&&(r.r?i.push(r):a.push(r))}if(i.length){for(var o=[],s=0;s<i.length;s++)o.push([i[s]]);return[a,o]}}}},{key:"_setClipperFileArrForPlay",value:function(e,t){if(this._clipperFileArrForPlay[t]||(this._clipperFileArrForPlay[t]=[],this._clipperFileArrForPlayInverse[t]=[]),!this._clipperFileArrForPlay[t].length){Array.isArray(e)&&(e=e[t]);var a=Object.keys(e);a.sort((function(e,t){return Number(e.split("$").pop())-Number(t.split("$").pop())}));var i=[],n=[],r=se(e);a.forEach((function(e){r[e].forEach((function(t,a){t.f=e,t.j=a,void 0!==t.o?i[t.o]=t:i.push(t)}))}));for(var o=i.length-1;o>=0;o--)n.push(i[o]);this._clipperFileArrForPlay[t]=i,this._clipperFileArrForPlayInverse[t]=n}}},{key:"_checkType",value:function(e){var t;return e instanceof ht.graph.GraphView?t="2D":e instanceof ht.graph3d.Graph3dView&&(t="3D"),t}},{key:"_checkNeedConvert",value:function(e){var t=e.dm(),a=t.a("ht.animationVersion");if(a){var i=(a+="").split(".");"0"===i[0]&&Number(i[1])<21&&this._convertObjToArr(t)}}},{key:"_setAnimate",value:function(e,t){var a=this,i=this,n=e.fileName,r=e.currentNode,o=e.arrToPlay,s=e.nowDate,l=e.repeat,c=e.endFrame,f=e.flag2D,h=e.eventKey,u=e.eventParams,p=e.animationSpeed,d=e.firstPerson,v=this._animationCurrentTimeForNode.get(n+"_"+r.getId()),m=1;m=p||this._speed;var y,g=null,_=function e(p,_){if(ht.animationplayer._raf&&(y=ht.animationplayer._raf(e),a._animationId.set(n+"_"+r.getId(),y)),g=!1,_e(i),function(e,i){var h,u;h=ht.animationplayer._raf?Date.now():e,a._playAnimate(o,r,v,f,t,l,n),ht.animationplayer._raf?(u=(h-s)/1e3,s=h):u=i/1e3;var p=null;a._speed2?(v+=a._speed2*u,a._speed2<0&&(p=!0)):(v+=m*u,m<0&&(p=!0)),a._animationCurrentTimeForNode.set(n+"_"+r.getId(),v),!p&&v>=c/60?(l?(v=c/60,a._animationCurrentTimeForNode.set(n+"_"+r.getId(),c/60),a._playAnimate(o,r,c/60,f,t,l,n),v=0,a._animationCurrentTimeForNode.set(n+"_"+r.getId(),0)):(a._currentAnimateTime=c/60,a._animationCurrentTimeForNode.set(n+"_"+r.getId(),c/60),a._playAnimate(o,r,c/60,f,t,l,n),a.removeByNode(n,r),g=!0),a._notifier.fire({fileName:n,type:"end",node:r,frame:c})):p&&v<=c/60&&(l?(v=c/60,a._animationCurrentTimeForNode.set(n+"_"+r.getId(),c/60),a._playAnimate(o,r,c/60,f,t,l,n),v=a._endFrameForBackward/60,a._animationCurrentTimeForNode.set(n+"_"+r.getId(),a._endFrameForBackward/60)):(a._currentAnimateTime=c/60,a._animationCurrentTimeForNode.set(n+"_"+r.getId(),c/60),a._playAnimate(o,r,c/60,f,t,l,n),a.removeByNode(n,r),g=!0),a._notifier.fire({fileName:n,type:"backwardEnd",node:r,frame:c}))}(p,_),be(i,t,f,n,d),g&&h&&(a.fireEvent(h,u),a._eventFunc[h])){for(var b=0;b<a._eventFunc[h].length;b++)a.removeEvent(h,a._eventFunc[h][b],a._eventScope[h][b]);a.clearEvents(h)}};ht.animationplayer._raf?_():(y=R(_),this._animationId.set(n+"_"+r.getId(),y))}},{key:"_setAnimates",value:function(e,t){var a=this,i=this,n=e.fileName,r=e.nowDate,o=e.repeat,s=e.endFrame,l=e.flag2D,c=e.eventKey,f=e.eventParams,h=e.animationSpeed,u=e.firstPerson,p=this._animationCurrentTime.get(n),d=1;d=h||this._speed;var v,m=null,y=function e(h,y){if(ht.animationplayer._raf&&(v=ht.animationplayer._raf(e),a._animationId.set(n,v)),m=!1,_e(i),function(e,i){var c,f;c=ht.animationplayer._raf?Date.now():e,a._playAnimates(p,l,t,o,n),ht.animationplayer._raf?(f=(c-r)/1e3,r=c):f=i/1e3;var h=null;a._speed2?(p+=a._speed2*f,a._speed2<0&&(h=!0)):(p+=d*f,d<0&&(h=!0)),a._animationCurrentTime.set(n,p),!h&&p>=s/60?(o?(p=s/60,a._animationCurrentTime.set(n,s/60),a._playAnimates(s/60,l,t,o,n),p=0,a._animationCurrentTime.set(n,0)):(p=s/60,a._animationCurrentTime.set(n,s/60),a._playAnimates(s/60,l,t,o,n),a.remove(n),m=!0),a._notifier.fire({fileName:n,type:"end",frame:s})):h&&p<=s/60&&(o?(p=s/60,a._animationCurrentTime.set(n,s/60),a._playAnimates(s/60,l,t,o,n),p=a._endFrameForBackward/60,a._animationCurrentTime.set(n,a._endFrameForBackward/60)):(p=s/60,a._animationCurrentTime.set(n,s/60),a._playAnimates(s/60,l,t,o,n),a.remove(n),m=!0),a._notifier.fire({fileName:n,type:"backwardEnd",frame:s}))}(h,y),be(i,t,l,n,u),m&&c&&(a.fireEvent(c,f),a._eventFunc[c])){for(var g=0;g<a._eventFunc[c].length;g++)a.removeEvent(c,a._eventFunc[c][g],a._eventScope[c][g]);a.clearEvents(c)}};ht.animationplayer._raf?y():(v=R(y),this._animationId.set(n,v))}},{key:"_playAnimate",value:function(e,t,a,i,n,r,o){var s=this,l=this;e.forEach((function(e,c){var f=c.split("$");if(Array.isArray(e)&&e.length>1){var h=k(c,e),u=b(c,e,h-1);if(u&&a>=u.t/60)if(r){var p=L(e,h-1,c);s._changeAnimationProperty(o,h-1,e,c,i,t,n,p,u.ob,u.cd,u.mob,u.sgp,f[1],u.cp)}else if(s._triggerBySetCurrent){var d=L(e,h-1,c);s._changeAnimationProperty(o,h-1,e,c,i,t,n,d,u.ob,u.cd,u.mob,u.sgp,f[1],u.cp)}else{if(!s._finishParamsSet.has(e)){var v=L(e,h-1,c);s._changeAnimationProperty(o,h-1,e,c,i,t,n,v,u.ob,u.cd,u.mob,u.sgp,f[1],u.cp)}s._finishParamsSet.has(e)||s._finishParamsSet.add(e)}else{var m=b(c,e,0);if(m&&a<=m.t/60)if(r){var y=L(e,0,c);s._changeAnimationProperty(o,0,e,c,i,t,n,y,m.ob,m.cd,m.mob,m.sgp,f[1],m.cp)}else if(s._triggerBySetCurrent){var g=L(e,0,c);s._changeAnimationProperty(o,0,e,c,i,t,n,g,m.ob,m.cd,m.mob,m.sgp,f[1],m.cp)}else{if(!s._finishParamsSet2.has(e)){var _=L(e,0,c);s._changeAnimationProperty(o,0,e,c,i,t,n,_,m.ob,m.cd,m.mob,m.sgp,f[1],m.cp)}s._finishParamsSet2.has(e)||s._finishParamsSet2.add(e)}else for(var w=0;w<h-1;w++){var x=b(c,e,w),A=b(c,e,w+1);if(x&&A&&a>=x.t/60&&a<=A.t/60){var P=he(e,w,c,60*a,t);null!=P&&ge(l,o,t,c,i,P,x.ob,x.cd,x.mob,x.sgp,f[1],n,x.cp)}}}}}))}},{key:"_playAnimates",value:function(e,t,a,i,n){var r=this,o=this,s=this._animateMap.get(n);if(s){var l=s.arrsToPlay;l&&l.forEach((function(s,l){s.forEach((function(s,c){var f=c.split("$");if(Array.isArray(s)&&s.length>5){var h=k(c,s),u=b(c,s,h-1);if(u&&e>=u.t/60)if(i){var p=L(s,h-1,c);r._changeAnimationProperty(n,h-1,s,c,t,l,a,p,u.ob,u.cd,u.mob,u.sgp,f[1],u.cp),l.a("ht.animationResetTime")&&e>=l.a("ht.animationResetTime")/60&&r._notifier.fire({fileName:n,node:l,type:"repeatEnd"})}else if(r._triggerBySetCurrent){var d=L(s,h-1,c);r._changeAnimationProperty(n,h-1,s,c,t,l,a,d,u.ob,u.cd,u.mob,u.sgp,f[1],u.cp)}else{if(!r._finishParamsSet.has(s)){var v=L(s,h-1,c);r._changeAnimationProperty(n,h-1,s,c,t,l,a,v,u.ob,u.cd,u.mob,u.sgp,f[1],u.cp)}r._finishParamsSet.has(s)||r._finishParamsSet.add(s)}else{var m=b(c,s,0);if(m&&e<=m.t/60)if(i){var y=L(s,0,c);r._changeAnimationProperty(n,0,s,c,t,l,a,y,m.ob,m.cd,m.mob,m.sgp,f[1],m.cp)}else if(r._triggerBySetCurrent){var g=L(s,0,c);r._changeAnimationProperty(n,0,s,c,t,l,a,g,m.ob,m.cd,m.mob,m.sgp,f[1],m.cp)}else{if(!r._finishParamsSet2.has(s)){var _=L(s,0,c);r._changeAnimationProperty(n,0,s,c,t,l,a,_,m.ob,m.cd,m.mob,m.sgp,f[1],m.cp)}r._finishParamsSet2.has(s)||r._finishParamsSet2.add(s)}else for(var w=0;w<h-1;w++){var x=b(c,s,w),A=b(c,s,w+1);if(x&&A&&e>=x.t/60&&e<=A.t/60){var P=he(s,w,c,60*e,l);null!=P&&ge(o,n,l,c,t,P,x.ob,x.cd,x.mob,x.sgp,f[1],a,x.cp)}}}}}))}))}}},{key:"_changeAnimationProperty",value:function(e,t,a,i,n,r,o,s,l,c,f,h,u,p){ge(this,e,r,i,n,s,l,c,f,h,u,o,p)}},{key:"_stopClipAnimation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(V(this._clipperAnimationId[a]),this._clipperAnimationId[a]=null,e){if(this._clipperAnimationId_1[a]&&(V(this._clipperAnimationId_1[a]),this._clipperAnimationId_1[a]=null),t){if(this._hasPausedRepeat[a]=null,this._repeatTriggerByPause[a]=!0,this._clipperAnimationId_2s[a]&&this._clipperAnimationId_2s[a].length){for(var i=0;i<this._clipperAnimationId_2s[a].length;i++)V(this._clipperAnimationId_2s[a][i]);this._clipperAnimationId_2s[a].length=0}}else this._hasPausedRepeat[a]=!0;this._notifier.fire({type:"afterPauseAnimations",index:a,fileName:this._getClipNameByIndex(a)})}else this._clipperFrontReview[a]={},this._clipperBackReview[a]={},this._clipperBeginFrame[a]=null,this._clipperBeginFrameForSet[a]=null,this._clipFiles[a]&&delete this._clipFiles[a],this._clipperFileArrForPlay[a]&&(this._clipperFileArrForPlay[a].length=0,delete this._clipperFileArrForPlay[a]),this._clipperFileArrForPlayInverse[a]&&(this._clipperFileArrForPlayInverse[a].length=0,delete this._clipperFileArrForPlayInverse[a]),this._notifier.fire({type:"afterRemoveAnimations",index:a,fileName:this._getClipNameByIndex(a)})}},{key:"_getClipSpeed",value:function(e,t,a){var i=e.a("ht.animationClipSpeed"),n=1;return t?n=t:i&&(n=Array.isArray(i)?i[a]:i),n}},{key:"_getClipEndFrame",value:function(e){var t=0;for(var a in e)for(var i=e[a],n=0;n<i.length;n++){var r=i[n],o=r.b+r.d;t<o&&(t=o)}return t}},{key:"_getFbxNodeByClipId",value:function(e,t){var a;return this._clipNodeIdMap[t]?a=this._clipNodeIdMap[t]:(a=this._getNodeByClipId(e,t),this._clipNodeIdMap[t]=a),a}},{key:"_getNodeByClipId",value:function(e,t){for(var a=e.getDatas().toArray(),i=0;i<a.length;i++){var n=a[i];if(n.a("ht.clipId")===t)return n}}},{key:"_reviewClip",value:function(e,t,a,i,n,r){n||(n=this._clipperFileArrForPlay[r]),i&&("back"===i?(n=this._clipperFileArrForPlayInverse[r],this._resetOrderByFrontButton2(n)):this._resetOrderByFrontButton(n)),this._clipperFrontReview[r]||(this._clipperFrontReview[r]={}),this._clipperBackReview[r]||(this._clipperBackReview[r]={});for(var o=0;o<n.length;o++){var s=n[o];if(s)if(s.n){var l=this._getFbxNodeByClipId(e.dm(),s.n);if(l)if(a<=s.b){if(i){if("front"===i&&s.b>a)continue;if(!this._clipperFrontReview[r][s.f+"_"+s.j]){if(this._clipperFrontReview[r][s.f+"_"+(s.j-1)])continue;this._clipperFrontReview[r][s.f+"_"+s.j]=1,this._setClipperFbxFront(l,s.f,s),delete this._clipperBackReview[r][s.f+"_"+s.j]}}}else if(a>s.b&&a-s.b<s.d-this._limit)this._setClipperFbxCenter(l,s.f,s,a),i&&(delete this._clipperFrontReview[r][s.f+"_"+s.j],delete this._clipperBackReview[r][s.f+"_"+s.j]);else if(a-s.b>=s.d-this._limit){if("back"===i&&s.b+s.d<a)continue;this._clipperBackReview[r][s.f+"_"+s.j]||(this._clipperBackReview[r][s.f+"_"+s.j]=1,this._setClipperFbxBack(l,s.f,s),delete this._clipperFrontReview[r][s.f+"_"+s.j])}}else if(a<=s.b){if(i){if("front"===i&&s.b>a)continue;if(!this._clipperFrontReview[r][s.f+"_"+s.j]){if(this._clipperFrontReview[r][s.f+"_"+(s.j-1)])continue;this._clipperFrontReview[r][s.f+"_"+s.j]=1,this._setClipperFront(e,s.f,s),delete this._clipperBackReview[r][s.f+"_"+s.j]}}}else if(a>s.b&&a-s.b<s.d-this._limit)this._setClipperCenter(e,s.f,s,a),i&&(delete this._clipperFrontReview[r][s.f+"_"+s.j],delete this._clipperBackReview[r][s.f+"_"+s.j]);else if(a-s.b>=s.d-this._limit){if("back"===i&&s.b+s.d<a)continue;this._clipperBackReview[r][s.f+"_"+s.j]||(this._clipperBackReview[r][s.f+"_"+s.j]=1,this._setClipperBack(e,s.f,s),delete this._clipperFrontReview[r][s.f+"_"+s.j])}}}},{key:"_resetOrderByFrontButton",value:function(e){e.sort((function(e,t){return e.b+e.d-(t.b+t.d)}))}},{key:"_resetOrderByFrontButton2",value:function(e){e.sort((function(e,t){return t.b-e.b}))}},{key:"_setClipperFront",value:function(e,t,a){var i,n=a.s||1;i=a.i?(a.od-(a.b-a.ob))*n:(a.b-a.ob)*n;var r=t.split("$")[0];this.setCurrentFrame(e,r,null,i,!0,!0)}},{key:"_setClipperCenter",value:function(e,t,a,i){var n,r=a.s||1;n=a.i?(a.ob+a.od-i)*r:(i-a.ob)*r;var o=t.split("$")[0];this.setCurrentFrame(e,o,null,n,!0,!0)}},{key:"_setClipperBack",value:function(e,t,a){var i,n=a.s||1;i=a.i?(a.od-(a.b-a.ob+a.d))*n:(a.b-a.ob+a.d)*n;var r=t.split("$")[0];this.setCurrentFrame(e,r,null,i,!0,!0)}},{key:"_setClipperFbxFront",value:function(e,t,a){var i=t.split("$")[0],n=a.s||1;a.i?e.getAnimation(i)&&e.playAnimation(i,0,(a.od-(a.b-a.ob))*n/60,"once"):e.playAnimation(i,0,(a.b-a.ob)*n/60,"once")}},{key:"_setClipperFbxCenter",value:function(e,t,a,i){var n=t.split("$")[0],r=a.s||1;a.i?e.playAnimation(n,0,(a.ob+a.od-i)*r/60,"once"):e.playAnimation(n,0,(i-a.ob)*r/60,"once")}},{key:"_setClipperFbxBack",value:function(e,t,a){var i=t.split("$")[0],n=a.s||1;a.i?e.playAnimation(i,0,(a.od-(a.b-a.ob+a.d))*n/60,"once"):e.getAnimation(i)&&e.playAnimation(i,0,(a.b-a.ob+a.d)*n/60,"once")}},{key:"_convertObjToArr",value:function(e){for(var t=e.getDatas().toArray(),a=0;a<t.length;a++){var i=t[a].a("ht.animationList");if(i)for(var n in i){var r=i[n];for(var o in r){var s=r[o];if(Array.isArray(s))for(var l=0;l<s.length;l++)le(s,l)}void 0!==r.repeat&&(r.r=r.repeat,delete r.repeat),void 0!==r.endTime&&(r.e=r.endTime,delete r.endTime),this._objsToArray(r)}}}},{key:"_objsToArray",value:function(e){for(var t in e)Array.isArray(e[t])&&(e[t]=this._objToArr(t,e[t]))}},{key:"_objToArr",value:function(e,t){if(e=e.split("$")[0],"number"==typeof t[0])return t;for(var a=[],i=0;i<t.length;i++){var n=t[i];null!=n&&"object"===r(n)&&(void 0!==n.time&&(n.t=n.time,delete n.time),void 0!==n.value&&(n.v=n.value,delete n.value),n.animationCurve?(n.c=n.animationCurve,delete n.animationCurve):n.c=0,n.cp=0,"opacity"===e?(void 0!==n.opacity_bool&&(n.ob=n.opacity_bool),a.push(n.t,n.v,n.c,n.cp,n.ob)):"m_opacity"===e?(void 0!==n.m_opacity_bool&&(n.mob=n.m_opacity_bool),a.push(n.t,n.v,n.c,n.cp,n.mob)):-1!==["clip","fillClip","s_clip","s_bgClip"].indexOf(e)?(n.clipDirection&&(n.cd=n.clipDirection),a.push(n.t,n.v,n.c,n.cp,n.cd)):"gradient"===e||"s_gradient"===e?a.push(n.t,n.v,n.c,n.cp,n.sgp):a.push(n.t,n.v,n.c,n.cp))}return a}},{key:"_checkImages",value:function(e,t,a){for(var i=e.getDatas().toArray(),n=[],r=0;r<i.length;r++){var o=i[r].a("ht.animationList");if(o){var s=o[t];if(s&&s.img)for(var l=k("img",s.img),c=0;c<l;c++){var f=b("img",s.img,c),h=f.v||f.value;h&&-1===n.indexOf(h)&&n.push(h)}}}if(n.length){var u,p,d=[];p=R((function(e){u||(u=e);for(var t=0;t<n.length;t++){ht.Default.getImage(n[t])&&-1===d.indexOf(n[t])&&d.push(n[t])}d.length===n.length?(V(p),a()):e-u>1e5&&V(p)}))}else a()}}]),e}();function Ne(e,t,a,i,n,r){var o=i.split("$");switch(o[0]){case"event":!function(e,t,a){e.event=t,void 0!==a&&("variableListener"===t?e.variableListener=a:e.callbackId=a)}(t,o[1],n);break;case"action":!function(e,t,a,i,n){t.action=a,("playSymbol"===a||"playNodeSymbol"===a)&&(t.symbolFile="waitForInput");var r;if(void 0!==i)switch(a){case"defaultHoverClick":case"switchState":t.default=i.default,t.hover=i.hover,t.click=i.click;break;case"enterLeaveAnimation":case"enterLeaveScale":case"enterLeaveScale3D":t.enter=i.enter,t.leave=i.leave;break;case"switchViewpoint":case"resetView":case"move3DView":r=i.eye.split(","),t.eye=r.slice(),r=i.center.split(","),t.center=r.slice(),t.time=i.time;break;case"mouseDownUpAnimation":t.down=i.down,t.up=i.up;break;case"setBooleanProperty":case"setProperty":case"setStringProperty":t.propertyName=i.propertyName,t.propertyValue=i.propertyValue,t.tags=i.tags;break;case"triggerEvent":t.triggerEvent=i.event,t.tags=i.tags;break;case"setVariable":case"set3DVariable":case"setVariableIn2D":case"condition":t.variableName=i.variableName,t.variableValue=i.variableValue;break;case"moveView":r=i.eye.split(","),t.eye=r.slice(),r=i.center.split(","),t.center=r.slice(),t.time=i.time,t.easing=i.easing;break;case"dataBinding":t.dataBinding=i;break;case"continuousPlay":t.continuousPlay=i;break;case"continuousPlay2":t.count=i.count,t.offset=i.offset;break;case"playAnimationWithSpeed":case"playBackwardWithSpeed":t.speed=i;break;case"setSymbolState":t.symbolState=i;break;case"playDuring3D":t.begin=i.begin,t.end=i.end,t.speed=i.speed;break;case"playFbxAnimation":t.name=i.name,t.speed=i.speed,t.start=i.start,t.loop=i.loop;break;case"shadowBounding":t.minHeight=i.minHeight,t.minValue=i.minValue,t.maxHeight=i.maxHeight,t.maxValue=i.maxValue;break;case"adsorb":t.adsorbTag=i;break;case"distanceCheck":t.tag1=i.tag1,t.tag2=i.tag2,t.distance=i.distance,t.property=i.property,t.changeValue=i.changeValue;break;case"setAnimationsCurrentFrame":t.fileName=i.fileName,t.frame=i.frame,t.type=i.type}void 0!==n&&(t.onAlternateIndex=n)}(0,t,o[1],n,r);break;case"fileName":!function(e,t){e.fileName=t}(t,o[1]);break;case"boolean":case"booleanInOtherView":!function(e,t){e.boolean=t}(t,o[1]);break;case"number":!function(e,t){e.number=t}(t,o[1]);break;case"string":!function(e,t){e.string=t}(t,o[1]);break;case"result":!function(e,t,a){var i=e.tool,n=e.symbolFile;if(i){if(i.delay&&"waitForInput"===i.delay)return void(i.delay=a);if(i.delayOnce&&"waitForInput"===i.delayOnce)return void(i.delayOnce=a)}if("waitForInput"===n)return void(e.symbolFile=a);"false"===t?a=!1:"true"===t&&(a=!0);e.result?e.result2={type:t,value:a}:e.result={type:t,value:a}}(t,o[1],n);break;case"tool":!function(e,t,a,i,n){t.tool||(t.tool={});void 0===n?t.tool[i]="waitForInput":t.tool[i]?t.otherTool?t.otherTool.push({type:i,value:n}):t.otherTool=[{type:i,value:n}]:t.tool[i]=n}(0,t,0,o[1],n);break;case"material":!function(e,t,a){e.material={type:t,value:a}}(t,o[1],n);break;case"bp_gis":!function(e,t,a){var i;e.action=t,"gisMoveView"===t&&(i=a.position.split(","),e.position=i.slice(),i=a.angle.split(","),e.angle=i.slice(),e.time=a.time,e.maximumHeight=a.maximumHeight)}(t,o[1],n)}}var Ce="\nuniform mat4 uModelMatrix;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectMatrix;\n\nattribute vec3 vs;\n\nuniform mat4 textureMatrix;\n\nvarying vec4 mirrorCoord;\nvarying vec4 worldPosition;\n\nvoid main() {\n\tmirrorCoord = uModelMatrix * vec4( vs, 1.0 );\n\tworldPosition = mirrorCoord.xyzw;\n\tmirrorCoord = textureMatrix * mirrorCoord;\n\tgl_Position = uProjectMatrix * uModelViewMatrix * vec4(vs, 1.0);\n}\n",Te="\nuniform sampler2D mirrorSampler;\nuniform float alpha;\nuniform float time;\nuniform float size;\nuniform float distortionScale;\nuniform sampler2D normalSampler;\nuniform vec3 sunColor;\nuniform vec3 sunDirection;\nuniform vec3 eye;\nuniform vec3 waterColor;\n\nvarying vec4 mirrorCoord;\nvarying vec4 worldPosition;\n\nvec4 getNoise( vec2 uv ) {\n\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);\n\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );\n\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );\n\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );\n\tvec4 noise = texture2D( normalSampler, uv0 ) +\n\t\ttexture2D( normalSampler, uv1 ) +\n\t\ttexture2D( normalSampler, uv2 ) +\n\t\ttexture2D( normalSampler, uv3 );\n\treturn noise * 0.5 - 1.0;\n}\nfloat getShadowMask() {\n\tfloat shadow = 1.0;\n\treturn shadow;\n}\nvoid main() {\n\tvec4 noise = getNoise( worldPosition.xz * size );\n\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );\n\tvec3 worldToEye = eye-worldPosition.xyz;\n\tvec3 eyeDirection = normalize( worldToEye);\n\tfloat distance = length(worldToEye);\n\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;\n\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );\n\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );\n\tfloat rf0 = 0.3;\n\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );\n\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;\n\tvec3 albedo = mix(\n\t scatter * getShadowMask(),\n\t ( vec3( 0.1 ) + reflectionSample * 0.9 ),\n\t reflectance\n );\n\tgl_FragColor = vec4( albedo, alpha);\n}\n",De="uniform mat4 uModelMatrix;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectMatrix;\nattribute vec3 vs;\nvarying vec3 worldPosition;\nvoid main() {\n worldPosition = (uModelMatrix * vec4(vs, 1.0)).xyz;\n gl_Position = uProjectMatrix * uModelViewMatrix * vec4(vs, 1.0);\n}\n\n// FS\n\nuniform vec3 groundColor;\nuniform sampler2D noiseMap;\nuniform vec3 light_dir;\nuniform float fog;\nuniform float cloud_size;\nuniform float cloud_covr;\nuniform float cloud_dens;\nuniform float time;\n\nvarying vec3 worldPosition;\n\nconst int U_SAMPLE = {{U_SAMPLE}};\nconst int U_STEP = {{U_STEP}};\n\nconst float c = 6.36e6;\nconst float d = 6.38e6;\n\nconst float g = 0.76;\nconst float h = g*g;\nconst float icc = 1.0/8e3;\nconst float jcc = 1.0/1200.0;\nconst float pi = 3.141592653589793;\n\nconst vec3 vm = vec3(0, -c, 0);\nconst vec3 vn = vec3(2.1e-5);\nconst vec3 vo = vec3(5.8e-6, 1.35e-5, 3.31e-5);\n\nfloat noise(in vec3 x){\n vec3 p = floor(x);\n vec3 f = fract(x);\n f = f*f*(3.0-2.0*f);\n vec2 uv = (p.xy+vec2(37.0, 17.0)*p.z) + f.xy;\n vec2 rg = texture2D(noiseMap, (uv+0.5)/256.0, -16.0).yx;\n return mix(rg.x, rg.y, f.z);\n}\n\nfloat NOISE(vec3 r){\n r.xz += time;\n r *= 0.5;\n float s;\n s = 0.5 * noise(r);\n r = r * 2.52;\n s += 0.25 * noise(r);\n r = r * 2.53;\n s += 0.125 * noise(r);\n r = r * 2.51;\n s += 0.0625 * noise(r);\n r = r * 2.53;\n s += 0.03125 * noise(r);\n r = r*2.52;\n s += 0.015625 * noise(r);\n return s;\n}\n\nfloat MakeNoise(vec3 r){\n\n float s, t;\n s = NOISE(r * 2e-4 * (1.0 - cloud_size));\n t = (1.0 - cloud_covr) * 0.5 + 0.2;\n s = smoothstep(t, t+.2, s);\n s *= 0.5*cloud_dens;\n return s;\n\n}\n\nvoid cloudLayer(in vec3 r, out float s, out float t, out float u){\n\n float v, w;\n v = length(r-vm) - c;\n w=0.0;\n if (5e3 < v && v < 1e4) w = MakeNoise(r) * sin(pi*(v-5e3)/5e3);\n s = exp(-v*icc) + fog;\n t = exp(-v*jcc) + w + fog;\n u = w + fog;\n\n}\n\nfloat ca(in vec3 r, in vec3 s, in float t){\n\n vec3 u = r-vm;\n float v, w, x, y, z, A;\n v = dot(u, s);\n w = dot(u, u)-t*t;\n x = v*v-w;\n if (x<0.0) return -1.0;\n y = sqrt(x);\n z = -v-y;\n A = -v+y;\n return z >= 0.0 ? z : A;\n\n}\n\nvec3 makeSky(in vec3 r, in vec3 s, out float t){\n\n float u, v, w, x, y, z, A, B, C, m, F;\n vec3 p = normalize(light_dir);\n u = ca(r, s, d);\n v = dot(s, p);\n w = 1.0+v*v;\n x = 0.0596831*w;\n y = 0.0253662*(1.0-h)*w/((2.0+h)*pow(abs(1.0+h-2.0*g*v), 1.5));\n z = 50.*pow(abs(1.+dot(s, -p)), 2.0)*dot(vec3(0, 1, 0), p)*(1.0-cloud_covr)*(1.0-min(fog, 1.0));\n A = 0.0;\n B = 0.0;\n C = 0.0;\n m = 0.0;\n vec3 D, E;\n D = vec3(0);\n E = vec3(0);\n F = u / float(U_SAMPLE);\n\n for (int G=0; G<U_SAMPLE; ++G){\n float H, J, K, L, M;\n H = float(G)*F;\n vec3 I = r + s * H;\n L = 0.0;\n cloudLayer(I, J, K, L);\n J *= F;\n K *= F;\n A += J;\n B += K;\n C += L;\n M = ca(I, p, d);\n if (M > 0.0){\n float N, O, P, Q;\n N=M/float(U_STEP);\n O=0.0;\n P=0.0;\n Q=0.0;\n for (int R=0; R<U_STEP; ++R){\n float S, U, V, W;\n S = float(R)*N;\n vec3 T=I+p*S;\n W = 0.0;\n cloudLayer(T, U, V, W);\n O+=U*N;\n P+=V*N;\n Q+=W*N;\n }\n vec3 S = exp(-(vo*(O+A)+vn*(P+B)));\n m+=L;\n D+=S*J;\n E+=S*K+z*m;\n }\n else return vec3(0.0);\n }\n t = m * 0.0125;// /80.0;\n return ((D * vo * x) + (E * vn * y)) * 15.0;\n}\n\nvoid main(){\n vec3 light = normalize(light_dir);\n vec3 r = normalize(worldPosition);\n float uvy = acos(r.y) / pi;\n float top = uvy <= 0.505 ? 1.0 : smoothstep(1.0, 0.0, (uvy-0.505)*25.0);\n float low = uvy > 0.505 ? 1.0 : smoothstep(1.0, 0.0, (0.505-uvy)*100.0);\n vec3 s = vec3(0, 0.99, 0);\n float m = 0.0;\n vec3 sky = clamp(makeSky(s, r, m), vec3(0.0), vec3(10000.0));\n float luma = 0.005 + max(dot(vec3(0, 1.0, 0), light), 0.0) * 0.2;\n sky = mix(groundColor*luma, sky, top);\n float alpha = clamp(m + low, 0.0, 0.99) + 0.01;\n vec3 color = pow(abs(sky), vec3(.5));\n gl_FragColor = vec4(color, alpha);\n}\n",Be="uniform mat4 uModelMatrix;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectMatrix;\nattribute vec3 vs;\nvarying vec3 worldPosition;\nvoid main() {\n worldPosition = (uModelMatrix * vec4(vs, 1.0)).xyz;\n gl_Position = uProjectMatrix * uModelViewMatrix * vec4(vs, 1.0);\n}\n\n// FS\n\nuniform vec3 light_dir;\nuniform sampler2D tDome;\nuniform samplerCube tCube;\n\nvarying vec3 worldPosition;\n\nconst float pi = 3.141592653589793;\nvec3 M33(vec3 e){\n return e-floor(e*(1./289.))*289.;\n}\nvec4 M44(vec4 e){\n return e-floor(e*(1./289.))*289.;\n}\nvec4 N(vec4 e){\n return M44((e*34.+1.)*e);\n}\nvec4 O(vec4 e){\n return 1.79284291400159-.85373472095314*e;\n}\nfloat P(vec3 e){\n const vec2 f=vec2(1./6.,1./3.);\n const vec4 g=vec4(0,.5,1,2);\n vec3 h,i,j,k,l,m,n,o,p,s,G,H,I,J;\n h=floor(e+dot(e,f.yyy));\n i=e-h+dot(h,f.xxx);\n j=step(i.yzx,i.xyz);\n k=1.-j;l=min(j.xyz,k.zxy);\n m=max(j.xyz,k.zxy);\n n=i-l+f.xxx;\n o=i-m+f.yyy;\n p=i-g.yyy;\n h=M33(h);\n vec4 q,t,u,v,w,x,y,z,A,B,C,D,E,F,K,L;\n q=N(N(N(h.z+vec4(0,l.z,m.z,1))+h.y+vec4(0,l.y,m.y,1))+h.x+vec4(0,l.x,m.x,1));\n float r = 0.142857142857;\n s=r*g.wyz-g.xzx;\n t=q-49.*floor(q*s.z*s.z);\n u=floor(t*s.z);\n v=floor(t-7.*u);\n w=u*s.x+s.yyyy;\n x=v*s.x+s.yyyy;\n y=1.-abs(w)-abs(x);\n z=vec4(w.xy,x.xy);\n A=vec4(w.zw,x.zw);\n B=floor(z)*2.+1.;\n C=floor(A)*2.+1.;\n D=-step(y,vec4(0));\n E=z.xzyw+B.xzyw*D.xxyy;\n F=A.xzyw+C.xzyw*D.zzww;\n G=vec3(E.xy,y.x);\n H=vec3(E.zw,y.y);\n I=vec3(F.xy,y.z);\n J=vec3(F.zw,y.w);\n K=O(vec4(dot(G,G),dot(H,H),dot(I,I),dot(J,J)));\n G*=K.x;\n H*=K.y;\n I*=K.z;\n J*=K.w;\n L=max(.6-vec4(dot(i,i),dot(n,n),dot(o,o),dot(p,p)),0.);\n L=L*L;\n return 21.*dot(L*L,vec4(dot(G,i),dot(H,n),dot(I,o),dot(J,p)))+.5;\n}\n\nvec2 Q(vec3 e){\n return vec2(.5+atan(e.z,e.x)/(2.*pi),.5+atan(e.y,length(e.xz))/pi);\n}\n\nmat3 R(vec3 e,vec3 f){\n vec3 g,h;\n g=normalize(cross(f,e));\n h=normalize(cross(e,g));\n return mat3(g.x,g.y,g.z,h.x,h.y,h.z,e.x,e.y,e.z);\n}\n\nvoid main(){\n\n vec3 light = normalize( light_dir );\n vec3 e = normalize( worldPosition );\n vec3 f = R( light, vec3(0,1,0) )*e;\n vec3 milk = texture2D( tDome, Q(f) ).rgb;\n float h,j,k,l;\n h=(milk.x+milk.y+milk.z)/3.;\n const float i=1.0;\n j=P(f*i*134.);\n j+=P( f*i*370.);\n j+=P( f*i*870.);\n k=pow(abs(j),9.)*2e-4;\n l=pow(abs(j),19.)*1e-8;\n vec3 star = clamp(mix(normalize(milk)*(l+k*h),milk,h*.1),0.,2.);\n vec4 final_tex = textureCube( tCube, e );\n star = star*(1.0-final_tex.a)*clamp(pow(abs(1.-light.y),10.),0.,1.);\n gl_FragColor = vec4( star + final_tex.rgb,1);\n\n}\n";function Oe(e,t,a){ht.animationplayer.blueprintplayer.materialExplodeId&&(cancelAnimationFrame(ht.animationplayer.blueprintplayer.materialExplodeId),delete ht.animationplayer.blueprintplayer.materialExplodeId);var i=e.view,n=e.notifier,r=t.material.value,o=r.tag,s=r.max,l=r.offset,c=r.count;ht.Default.setShader("ht.material.explode.glsl","\n vec3 mod289(vec3 x)\n {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n }\n \n vec4 mod289(vec4 x)\n {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n }\n \n vec4 permute(vec4 x)\n {\n return mod289(((x*34.0)+1.0)*x);\n }\n \n vec4 taylorInvSqrt(vec4 r)\n {\n return 1.79284291400159 - 0.85373472095314 * r;\n }\n \n vec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n }\n \n float cnoise(vec3 P)\n {\n vec3 Pi0 = floor(P);\n vec3 Pi1 = Pi0 + vec3(1.0); \n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P);\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n \n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n \n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n \n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n \n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n \n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n \n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n \n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n }\n \n float pnoise(vec3 P, vec3 rep)\n {\n vec3 Pi0 = mod(floor(P), rep); \n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep);\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P);\n vec3 Pf1 = Pf0 - vec3(1.0);\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n \n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n \n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n \n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n \n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n \n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n \n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n \n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n }\n \n attribute vec3 vs;\n attribute vec3 ns;\n \n uniform mat4 uProjectMatrix;\n uniform mat4 uModelViewMatrix;\n \n varying float noise;\n uniform float time;\n \n float turbulence( vec3 p ) {\n float w = 100.0;\n float t = -.5;\n for (float f = 1.0 ; f <= 10.0 ; f++ ){\n float power = pow( 2.0, f );\n t += abs( pnoise( vec3( power * p ), vec3( 10.0, 10.0, 10.0 ) ) / power );\n }\n return t;\n }\n \n void main() {\n noise = 10.0 * -.10 * turbulence( .5 * ns + time );\n float b = 5.0 * pnoise( 0.05 * vs + vec3( 2.0 * time ), vec3( 100.0 ) );\n float displacement = - 10. * noise + b;\n vec3 newPosition = vs + ns * displacement;\n gl_Position = uProjectMatrix * uModelViewMatrix * vec4( newPosition, 1.0 );\n }\n \n // FS\n \n //varying vec2 vUv;\n varying float noise;\n uniform sampler2D tExplosion;\n \n float random( vec3 scale, float seed ) {\n return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed ) ;\n }\n \n void main() {\n float r = 0.01 * random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );\n vec2 tPos = vec2( 0, 1.3 * noise + r );\n tPos.y = 1.0 - tPos.y;\n vec4 color = texture2D( tExplosion, tPos );\n gl_FragColor = vec4( color.rgb, 1.0 );\n }"),ht.Default.xhrLoad("ade72b80-f958-11ed-86f4-615e86a5372c.json",(function(e){var t=ht.Default.parse(e);!function(e){var t=Date.now(),a=function a(){var i=requestAnimationFrame(a),n=ht.Default.getImage("2c2e1810-f958-11ed-86f4-615e86a5372c.png");n?(e(n),cancelAnimationFrame(i)):Date.now()-t>1e4&&cancelAnimationFrame(i)};a()}((function(e){var r={model3d:!0,mesh:{vs:t.vs,ns:t.ns},mat:{type:"ht.material.explode.glsl",time:0,tExplosion:e}};if(!o||(a=i.dm().getDataByTag(o))){a.s("shape3d",r);var f=a.getScale3d()[0];l=void 0!==l?Number(l):.1,s=void 0!==s?Number(s):60,c=void 0!==c?Number(c):1;var h=Date.now(),u=0;!function e(){var t=requestAnimationFrame(e);ht.animationplayer.blueprintplayer.materialExplodeId=t,r.mat.time=25e-5*(Date.now()-h),f+=l,a.s3(f,f,f),f>s&&(u++,0!==c&&(u>=c?(cancelAnimationFrame(t),delete ht.animationplayer.blueprintplayer.materialExplodeId,n&&n.fire({type:"afterMaterialExplode",node:a})):(h=Date.now(),f=a.getScale3d()[0])))}()}}))}))}function ze(e,t,a,i,n){var r=new ht.Node,o={model3d:!0,mesh:{vs:[-1,-1,-1,1,1,-1,1,1],is:[0,1,2,2,1,3]},mat:{type:a,u_resolution:[512,512],image1:i,image2:n,frame:0}};r.s("shape3d",o);var s=new ht.graph3d.RenderTarget(e,e.getGL(),512,512,{minFilter:ht.graph3d.WebGLConstants.NEAREST,magFilter:ht.graph3d.WebGLConstants.NEAREST});t.s("shape3d.image",s.uuid),ht.animationplayer.materialSwitchImageRenderTargetNodes||(ht.animationplayer.materialSwitchImageRenderTargetNodes={}),ht.animationplayer.materialSwitchImageRenderTargetNodes[""+t.getId()]=r;var l=e.onPreRender;e.onPreRender=function(){l&&l.call(e),e.renderModel(s,o)}}function Ee(e){return e?ht.animationplayer.player3d._storeForRenderHTML[e]:ht.animationplayer.player3d._store}function Re(e){return e?ht.animationplayer.g3dForRenderHTML[e]:ht.animationplayer.g3d}function Ve(e){switch(e){case"Linear":default:return function(e){return e};case"Back.easeIn":return function(e){return function(e,t,a,i,n){void 0===n&&(n=1.70158);return a*(e/=i)*e*((n+1)*e-n)+t}(e,0,1,1)};case"Back.easeOut":return function(e){return function(e,t,a,i,n){void 0===n&&(n=1.70158);return a*((e=e/i-1)*e*((n+1)*e+n)+1)+t}(e,0,1,1)};case"Back.easeInOut":return function(e){return function(e,t,a,i,n){void 0===n&&(n=1.70158);if((e/=i/2)<1)return a/2*(e*e*((1+(n*=1.525))*e-n))+t;return a/2*((e-=2)*e*((1+(n*=1.525))*e+n)+2)+t}(e,0,1,1)};case"Bounce.easeIn":return function(e){return Le(e,0,1,1)};case"Bounce.easeOut":return function(e){return He(e,0,1,1)};case"Bounce.easeInOut":return function(e){return function(e,t,a,i){return e<i/2?.5*Le(2*e,0,a,i)+t:.5*He(2*e-i,0,a,i)+.5*a+t}(e,0,1,1)};case"Circ.easeIn":return function(e){return function(e,t,a,i){return-a*(Math.sqrt(1-(e/=i)*e)-1)+t}(e,0,1,1)};case"Circ.easeOut":return function(e){return function(e,t,a,i){return a*Math.sqrt(1-(e=e/i-1)*e)+t}(e,0,1,1)};case"Circ.easeInOut":return function(e){return function(e,t,a,i){if((e/=i/2)<1)return-a/2*(Math.sqrt(1-e*e)-1)+t;return a/2*(Math.sqrt(1-(e-=2)*e)+1)+t}(e,0,1,1)};case"Cubic.easeIn":return function(e){return function(e,t,a,i){return a*(e/=i)*e*e+t}(e,0,1,1)};case"Cubic.easeOut":return function(e){return function(e,t,a,i){return a*((e=e/i-1)*e*e+1)+t}(e,0,1,1)};case"Cubic.easeInOut":return function(e){return function(e,t,a,i){if((e/=i/2)<1)return a/2*e*e*e+t;return a/2*((e-=2)*e*e+2)+t}(e,0,1,1)};case"Elastic.easeIn":return function(e){return function(e,t,a,i,n,r){if(0===e)return t;if(1==(e/=i))return t+a;r||(r=.3*i);var o;!n||n<Math.abs(a)?(n=a,o=r/4):o=r/(2*Math.PI)*Math.asin(a/n);return-n*Math.pow(2,10*(e-=1))*Math.sin((e*i-o)*(2*Math.PI)/r)+t}(e,0,1,1,0,0)};case"Elastic.easeOut":return function(e){return function(e,t,a,i,n,r){if(0===e)return t;if(1==(e/=i))return t+a;r||(r=.3*i);var o;!n||n<Math.abs(a)?(n=a,o=r/4):o=r/(2*Math.PI)*Math.asin(a/n);return n*Math.pow(2,-10*e)*Math.sin((e*i-o)*(2*Math.PI)/r)+a+t}(e,0,1,1,0,0)};case"Elastic.easeInOut":return function(e){return function(e,t,a,i,n,r){if(0===e)return t;if(2==(e/=i/2))return t+a;r||(r=i*(.3*1.5));var o;!n||n<Math.abs(a)?(n=a,o=r/4):o=r/(2*Math.PI)*Math.asin(a/n);if(e<1)return n*Math.pow(2,10*(e-=1))*Math.sin((e*i-o)*(2*Math.PI)/r)*-.5+t;return n*Math.pow(2,-10*(e-=1))*Math.sin((e*i-o)*(2*Math.PI)/r)*.5+a+t}(e,0,1,1,0,0)};case"Expo.easeIn":return function(e){return function(e,t,a,i){return 0===e?t:a*Math.pow(2,10*(e/i-1))+t}(e,0,1,1)};case"Expo.easeOut":return function(e){return function(e,t,a,i){return e===i?t+a:a*(1-Math.pow(2,-10*e/i))+t}(e,0,1,1)};case"Expo.easeInOut":return function(e){return function(e,t,a,i){if(0===e)return t;if(e===i)return t+a;if((e/=i/2)<1)return a/2*Math.pow(2,10*(e-1))+t;return a/2*(2-Math.pow(2,-10*--e))+t}(e,0,1,1)};case"Quad.easeIn":return function(e){return function(e,t,a,i){return a*(e/=i)*e+t}(e,0,1,1)};case"Quad.easeOut":return function(e){return function(e,t,a,i){return-a*(e/=i)*(e-2)+t}(e,0,1,1)};case"Quad.easeInOut":return function(e){return function(e,t,a,i){if((e/=i/2)<1)return a/2*e*e+t;return-a/2*(--e*(e-2)-1)+t}(e,0,1,1)};case"Quart.easeIn":return function(e){return function(e,t,a,i){return a*(e/=i)*e*e*e+t}(e,0,1,1)};case"Quart.easeOut":return function(e){return function(e,t,a,i){return-a*((e=e/i-1)*e*e*e-1)+t}(e,0,1,1)};case"Quart.easeInOut":return function(e){return function(e,t,a,i){if((e/=i/2)<1)return a/2*e*e*e*e+t;return-a/2*((e-=2)*e*e*e-2)+t}(e,0,1,1)};case"Quint.easeIn":return function(e){return function(e,t,a,i){return a*(e/=i)*e*e*e*e+t}(e,0,1,1)};case"Quint.easeOut":return function(e){return function(e,t,a,i){return a*((e=e/i-1)*e*e*e*e+1)+t}(e,0,1,1)};case"Quint.easeInOut":return function(e){return function(e,t,a,i){if((e/=i/2)<1)return a/2*e*e*e*e*e+t;return a/2*((e-=2)*e*e*e*e+2)+t}(e,0,1,1)};case"Sine.easeIn":return function(e){return function(e,t,a,i){return-a*Math.cos(e/i*(Math.PI/2))+a+t}(e,0,1,1)};case"Sine.easeOut":return function(e){return function(e,t,a,i){return a*Math.sin(e/i*(Math.PI/2))+t}(e,0,1,1)};case"Sine.easeInOut":return function(e){return function(e,t,a,i){return-a/2*(Math.cos(Math.PI*e/i)-1)+t}(e,0,1,1)}}}function Le(e,t,a,i){return a-He(i-e,0,a,i)+t}function He(e,t,a,i){return(e/=i)<1/2.75?a*(7.5625*e*e)+t:e<2/2.75?a*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?a*(7.5625*(e-=2.25/2.75)*e+.9375)+t:a*(7.5625*(e-=2.625/2.75)*e+.984375)+t}function je(e,t,a){var i=t.callbackId,n=t.tool,r=a.getId();n&&n.alternate&&ot(e,t,a,n.alternate);var o=JSON.parse(JSON.stringify(t));o.nodeId=r,e.callbacks[i]?e.callbacks[i].push(o):e.callbacks[i]=[o]}function $e(e,t,a,i){var n=t.event,r=t.action,o=t.tool,s=t.material;n?-1!==["setBooleanProperty","setProperty","setStringProperty"].indexOf(r)?(a.s("interactive",!0),at(e,t,a,i)):"callback"!==n&&"init"!==n&&o&&o.alternate?(a.s("interactive",!0),ot(e,t,a,o.alternate)):s?(a.s("interactive",!0),t.action=s.type,We(e,t,a,i)):"init"===n?o&&o.alternate?function(e,t,a){var i=t.tool.alternate;if(i){var n=e.alternates,r=t.onAlternateIndex,o=JSON.parse(JSON.stringify(t));o.nodeId=a.getId(),n[i]?n[i][r]?n[i][r].push(o):n[i][r]=[o]:n[i]={onAlternateIndex:[o]}}}(e,t,a):Ge(e,t,a,i):"variableListener"===n?function(e,t,a,i){var n=t.action,r=t.variableListener,o=t.tool,s=function s(l){if("variableChange"===l.type&&l.name===r&&o&&o.condition&&o.condition.variableName===r){var c=o.condition.variableValue,f=c.split(">");if(f.length>1&&Number(l.value)>Number(f[1]))return Ke(e,t,a,n,i),void e.notifier.remove(s);var h=c.split("=");if(h.length>1&&Number(l.value)===Number(h[1]))return Ke(e,t,a,n,i),void e.notifier.remove(s);var u=c.split("<");u.length>1&&Number(l.value)===Number(u[1])&&(Ke(e,t,a,n,i),e.notifier.remove(s))}};e.notifier.add(s)}(e,t,a,i):"callback"===n?Ge(e,t,a,i):n.startsWith("Key")?function(e,t,a,i){if(!e._keydownHandler){var n=function(t){var a=e._keys;if(a)for(var i in a){if(i.split("Key")[1].toLowerCase()===t.key.toLowerCase()){var n=a[i];if(n)for(var r=function(){var t=n[o];if(t.tool&&t.tool.delay&&!isNaN(t.tool.delay)){var a=Number(t.tool.delay);setTimeout((function(){Ke(e,t,t.node,t.action,t.renderHTMLId)}),a)}else Ke(e,t,t.node,t.action,t.renderHTMLId)},o=0;o<n.length;o++)r()}}};e.view.getView().addEventListener("keydown",n)}e._keys[t.event]||(e._keys[t.event]=[]);t.node=a,t.renderHTMLId=i,e._keys[t.event].push(t)}(e,t,a,i):(a.s("interactive",!0),We(e,t,a,i)):o&&o.triggerOthers?rt(e,t,a,o.triggerOthers,i):o&&o.triggerOthersIn2D?function(e,t,a,i,n){var r=i.event,o=i.tags;if(t.triggerOthersIn2D=!0,ht.animationplayer.player2d)if("init"===r)for(var s=o.split("$"),l=0;l<s.length;l++){var c=s[l];Ge(e,t,ht.animationplayer.player2d._store.view.dm().getDataByTag(c),n)}else a.s("interactive",!0),t.event=r,We(e,t,a,n)}(e,t,a,o.triggerOthersIn2D,i):o&&o.triggerOthersIn3D?function(e,t,a,i,n){var r=i.event,o=i.tags;t.triggerOthersIn3D=!0;var s=function(){if("init"===r)for(var i=o.split("$"),s=0;s<i.length;s++){var l=i[s],c=Ee(n).view.dm().getDataByTag(l);Ge(e,t,c,n)}else a.s("interactive",!0),t.event=r,We(e,t,a,n)},l=0,c=function e(){var t=requestAnimationFrame(e);(++l>600||ht.animationplayer.player3d)&&(s(),cancelAnimationFrame(t))};ht.animationplayer.player3d?s():c()}(e,t,a,o.triggerOthersIn3D,i):o&&o.triggerOthers2?rt(e,t,a,o.triggerOthers2,i):s?function(e,t,a,i,n){if(ht.Default.setShader){var r=i.type,o=i.value;switch(r){case"sea":!function(e){e.alpha=Number(e.alpha),e.scale=Number(e.scale),e.size=Number(e.size),ht.Default.setImage("ht.material.waterImage","d971c570-0ca2-11ec-94a4-9d4ca1924ae3.png");var t=ht.animationplayer.g3d;if(ht.Default.setShader&&t){var a=e;a.time=0,ht.Default.setShader("ht.material.sea.glsl",Ce,Te);var i=new ht.Math.Matrix4,n=t.getGL(),r=new ht.graph3d.RenderTarget(t,n,512,512,{minFilter:n.LinearFilter,maxFilter:n.LinearFilter,format:n.RGBFormat}),o=new ht.Math.Vector3(0,0,0),s=new ht.Camera,l=new W(t,i,r,o,s),c={model3d:!0,mesh:{vs:K.vs,uv:K.uv,ns:K.ns},mat:{type:"ht.material.sea.glsl",mirrorSampler:r.texture,normalSampler:"ht.material.waterImage",alpha:a.alpha,time:a.time,distortionScale:a.scale,size:a.size,sunColor:"#777777",sunDirection:new ht.Math.Vector3(.70707,.70707,0).normalize(),waterColor:"#3b4c5a",textureMatrix:i.getElements(),eye:t.getEye()}};K.is&&(c.mesh.is=K.is),l.s("shape3d",c),l.setSize3d(1,1,1),l.setRotation3d(-Math.PI/2,0,0),l.s({"3d.selectable":!1,"shape3d.reverse.cull":!0,"shape3d.transparent":!0}),l.update(),t.dm().add(l);var f=new Date;!function e(){var t=requestAnimationFrame(e);ht.animationplayer.blueprintplayer.materialSeaId=t;var i=new Date;a.time+=.1*(1+(i-f)/1e3),f=i,l.update(),c.mat.time=a.time,l.iv()}()}}(o);break;case"sky":!function(e,t){var a=e.view;if(a){var i=a.dm().getDataByTag("ht_animation_cubeCamera");if(i){a.setRenderLayerInfo("skyLayer",{priority:200,clearDepth:!1,ignore:!0}),i.setCullingMask("skyLayer");var n=new ht.graph3d.RenderTarget(a,a.getGL(),512,512,{cube:!0});i.attachRenderTarget(n);var r=a.dm().getDataByTag("ht_blueprint_mat_skyMain");r&&(ht.Default.setShader("bp_sky2.glsl",Be),r.s("shape3d").mat.tCube=i.renderTarget.texture)}var o=a.dm().getDataByTag("ht_blueprint_mat_sky");if(o){var s=o.a("u_sample")||128,l=o.a("u_step")||8,c=De;c=(c=c.replace("{{U_SAMPLE}}",s.toString())).replace("{{U_STEP}}",l.toString()),ht.Default.setShader("bp_sky.glsl",c)}}}(e);break;case"material_switchImage":!function(e,t){var a=t.image1,i=t.image2,n=ht.animationplayer.g3d;ht.Default.setShader&&a&&i&&n&&(ht.Default.setShader("ht.material.switchImage_shader.glsl","\n attribute vec2 vs;\n void main() {\n gl_Position = vec4(vs, 0, 1);\n }\n // FS\n uniform vec2 u_resolution;\n uniform sampler2D image1;\n uniform sampler2D image2;\n uniform float frame;\n void main() {\n vec2 vUV = gl_FragCoord.xy / u_resolution.xy;\n float x = 0.8;\n x = abs(sin(frame));\n x = smoothstep(0.0,1.0,(x*2.0+vUV.y-1.0));\n vec4 color = mix(texture2D(image1, vUV*(1.0-x)), texture2D(image2, vUV*x), x);\n gl_FragColor = color;\n }\n "),ze(n,e,"ht.material.switchImage_shader.glsl",a,i))}(a,o);break;case"material_switchImage2":!function(e,t){var a=t.image1,i=t.image2,n=ht.animationplayer.g3d;ht.Default.setShader&&a&&i&&n&&(ht.Default.setShader("ht.material.switchImage2_shader.glsl","\n attribute vec2 vs;\n void main() {\n gl_Position = vec4(vs, 0, 1);\n }\n // FS\n uniform vec2 u_resolution;\n uniform float frame;\n uniform sampler2D image1;\n uniform sampler2D image2;\n #define PI 3.14159265\n void main() {\n vec2 vUV = gl_FragCoord.xy / u_resolution.xy;\n vUV -= 0.5;\n float radius = fract(frame * 0.5);\n float distance = length(vUV);\n float delta = atan(vUV.y, vUV.x) +radians(1.0 - fract(frame * 0.5)) * 100.0 * (radius - distance) / radius;\n if(distance <= radius) {\n vUV = distance * vec2(cos(delta), sin(delta));\n gl_FragColor = texture2D(image1, vUV - 0.5);\n }else{\n gl_FragColor = texture2D(image2, vUV - 0.5);\n }\n }\n "),ze(n,e,"ht.material.switchImage2_shader.glsl",a,i))}(a,o);break;case"material_explode":Oe(e,a,o)}}}(e,0,a,s):r&&(a.s("interactive",!0),Xe(e,t,a,r,i))}function Ge(e,t,a,i){var n=t.action,r=t.tool;if(r&&r.delay){var o=setTimeout((function(){Ke(e,t,a,n,i)}),Number(r.delay));e.notifier.fire({type:"delay",node:a,action:n,timeoutId:o,delayTime:r.delay})}else{if(r&&r.delayOnce){if(!a.a("ht.animation_delayOnce")){var s=a.a("ht.blueprintId");if(void 0!==s&&!ht.animationplayer.delayOnce[s])return ht.animationplayer.delayOnce[s]=!0,void setTimeout((function(){Ke(e,t,a,n,i)}),Number(r.delayOnce))}}else{if(r&&r.timer)return void Ze(r,Ke,[e,t,a,n,i]);if(r&&r.condition){var l=r.condition,c=l.variableName.split(".");if(!(c.length>1)){return void nt(e,r.condition,(function(){Ke(e,t,a,n,i)}))}if(c[0]+"."+c[1]=="ht.eye")return void function(e,t,a,i,n){var r=i.variableName,o=i.variableValue,s=e.view,l=r.split("."),c=function(e){var t=e.split("=");if(t.length<2)if((t=e.split(">")).length<2){if((t=e.split("<")).length<2)return;t[0]="<"}else t[0]=">";else t[0]="=";return t}(o);if(!c)return;t.nodeId=a.getId(),t.comparisonOperator=c;var f=r+c[0];t.conditionName=f;var h=JSON.parse(JSON.stringify(t));e.conditionActions[f]?e.conditionActions[f].push(h):e.conditionActions[f]=[h];e.eyeChangeHandle||(e.eyeChangeHandle=!0,s.mp((function(t){if("eye"===t.property){var a=t.newValue;"x"===l[2]?lt(e,a,0,n):"y"===l[2]?lt(e,a,1,n):"z"===l[2]&&lt(e,a,2,n)}})))}(e,t,a,l,i)}}Ke(e,t,a,n,i)}}function We(e,t,a,i){var n=t.event;if("clickBackground"===n)if(e.backgroundActions)e.backgroundActions.push(JSON.parse(JSON.stringify(t)));else{var r=e.view;e.backgroundActions=[JSON.parse(JSON.stringify(t))];var o=function(t){"clickBackground"===t.kind&&qe(e,null,e.backgroundActions,i)};r.mi(o),e.mi.push(o)}else if("doubleClickBackground"===n)if(e.dbcBackgroundActions)t.currentView=e.currentView,e.dbcBackgroundActions.push(JSON.parse(JSON.stringify(t)));else{var s=e.view;t.currentView=e.currentView,e.dbcBackgroundActions=[JSON.parse(JSON.stringify(t))];var l=function(t){"doubleClickBackground"===t.kind&&qe(e,null,e.dbcBackgroundActions,i)};s.mi(l),e.mi.push(l)}else{var c,f=a.getId();e.nodeActions[f]?-1===e.nodeActions[f].indexOf(n)?(e.nodeActions[f].push(n),c=JSON.parse(JSON.stringify(t)),a.a(n+"$Actions",[c]),Je(e,a,n,i)):(c=JSON.parse(JSON.stringify(t)),a.a(n+"$Actions").push(c)):(e.nodeActions[f]=[n],c=JSON.parse(JSON.stringify(t)),a.a(n+"$Actions",[c]),Je(e,a,n,i))}}function Ue(e,t,a,i,n,r){if(t){var o=t.getId();e.nodeActions[o]?-1===e.nodeActions[o].indexOf(a)?(e.nodeActions[o].push(a),t.a(a+"$Actions",[{func:i,callbackParams:n}]),Je(e,t,a,r)):t.a(a+"$Actions").push({func:i,callbackParams:n}):(e.nodeActions[o]=[a],t.a(a+"$Actions",[{func:i,callbackParams:n}]),Je(e,t,a,r))}else qe(e,null,i,r)}function Je(e,t,a,i){var n=this,r=t.s(a);t.s(a,(function(o,s,l){qe(e,s,t.a(a+"$Actions"),i),r&&r.apply(n,[o,s,l])})),function(e,t,a,i){-1!==["onDown","onClick","onDoubleClick","onBeginDrag"].indexOf(a)&&tt(e,t,i)}(e,t,a,i)}function qe(e,t,a,i){if(a)for(var n=function(){var n=a[r];if("init"===n.event)return 0;if(void 0!==n.currentView&&e.currentView!==n.currentView)return 0;var o=n.alternateCount,s=n.alternateIndex,l=n.onAlternateIndex,c=n.func;if(void 0!==o){var f=e.alternates[s][l];return f&&st(e,f,t,s,o,null,i),0}if(c){var h=n.callbackParams;if(h&&(h.player2d||h.player3d))return c(h.player2d,h.player3d),0;c(h)}else{var u=n.action,p=n.tool;if(p&&p.condition){nt(e,p.condition,(function(){if(p.delay){var a=setTimeout((function(){if(p.triggerOthers2)for(var a=p.triggerOthers2.split("$"),r=0;r<a.length;r++){var o=a[r],s=e.view.dm().getDataByTag(o);Ke(e,n,s,u,i)}else Ke(e,n,t,u,i)}),Number(p.delay));e.notifier.fire({type:"delay",node:t,action:u,timeoutId:a,delayTime:p.delay})}else{if(p.delayOnce){var r=t.a("ht.blueprintId");if(void 0!==r&&!ht.animationplayer.delayOnce[r])return ht.animationplayer.delayOnce[r]=!0,void setTimeout((function(){if(p.triggerOthers2)for(var a=p.triggerOthers2.split("$"),r=0;r<a.length;r++){var o=a[r],s=e.view.dm().getDataByTag(o);Ke(e,n,s,u,i)}else Ke(e,n,t,u,i)}),Number(p.delayOnce))}else{if(p.timer){if(p.triggerOthers2)for(var o=p.triggerOthers2.split("$"),s=0;s<o.length;s++){var l=o[s],c=e.view.dm().getDataByTag(l);Ze(p,Ke,[e,n,c,u,i])}else Ze(p,Ke,[e,n,t,u,i]);return}if(p.triggerOthers2){for(var f=p.triggerOthers2.split("$"),h=0;h<f.length;h++){var d=f[h],v=e.view.dm().getDataByTag(d);Ke(e,n,v,u,i)}return}}Ke(e,n,t,u,i)}}))}else if(p&&(p.triggerOthers||p.triggerOthers2))for(var d=(p.triggerOthers?p.triggerOthers.tags:p.triggerOthers2).split("$"),v=function(){var a=d[m],r=e.view.dm().getDataByTag(a);if(p.delay){var o=setTimeout((function(){Ke(e,n,r,u,i)}),Number(p.delay));return e.notifier.fire({type:"delay",node:t,action:u,timeoutId:o,delayTime:p.delay}),0}if(p.delayOnce){var s=r.a("ht.blueprintId");if(void 0!==s&&!ht.animationplayer.delayOnce[s])return ht.animationplayer.delayOnce[s]=!0,setTimeout((function(){Ke(e,n,r,u,i)}),Number(p.delayOnce)),0}else if(p.timer)return Ze(p,Ke,[e,n,r,u,i]),0;Ke(e,n,r,u,i)},m=0;m<d.length;m++)v();else if(p&&p.triggerOthersIn2D){var y=p.triggerOthersIn2D.tags;if(ht.animationplayer.player2d)for(var g=y.split("$"),_=function(){var a=g[b],r=ht.animationplayer.player2d._store.view.dm().getDataByTag(a);if(p.delay){var o=setTimeout((function(){Ke(e,n,r,u,i)}),Number(p.delay));return e.notifier.fire({type:"delay",node:t,action:u,timeoutId:o,delayTime:p.delay}),0}if(p.delayOnce){var s=r.a("ht.blueprintId");if(void 0!==s&&!ht.animationplayer.delayOnce[s])return ht.animationplayer.delayOnce[s]=!0,setTimeout((function(){Ke(e,n,r,u,i)}),Number(p.delayOnce)),0}else if(p.timer)return Ze(p,Ke,[e,n,r,u,i]),0;Ke(e,n,r,u,i)},b=0;b<g.length;b++)_()}else if(p&&p.triggerOthersIn3D){var k=p.triggerOthersIn3D.tags;if(ht.animationplayer.player3d)for(var w=k.split("$"),x=function(){var a=w[A],r=Ee(i).view.dm().getDataByTag(a);if(p.delay){var o=setTimeout((function(){Ke(e,n,r,u,i)}),Number(p.delay));return e.notifier.fire({type:"delay",node:t,action:u,timeoutId:o,delayTime:p.delay}),0}if(p.delayOnce){var s=r.a("ht.blueprintId");if(void 0!==s&&!ht.animationplayer.delayOnce[s])return ht.animationplayer.delayOnce[s]=!0,setTimeout((function(){Ke(e,n,r,u,i)}),Number(p.delayOnce)),0}else if(p.timer)return Ze(p,Ke,[e,n,r,u,i]),0;Ke(e,n,r,u,i)},A=0;A<w.length;A++)x()}else{if(p&&p.delay){var P=setTimeout((function(){var a=ht.Default.clone(n);a.event="init",Ke(e,a,t,u,i)}),Number(p.delay));return e.notifier.fire({type:"delay",node:t,action:u,timeoutId:P,delayTime:p.delay}),0}if(p&&p.delayOnce){var S=t.a("ht.blueprintId");if(void 0!==S&&!ht.animationplayer.delayOnce[S])return ht.animationplayer.delayOnce[S]=!0,setTimeout((function(){Ke(e,n,t,u,i)}),Number(p.delayOnce)),0}else if(p&&p.timer)return Ze(p,Ke,[e,n,t,u,i]),0;Ke(e,n,t,u,i)}}},r=0;r<a.length;r++)n()}function Ke(e,t,a,i,n){var r,o,s=this,l=e.view,c=e.player,f=e.viewType,h=t.fileName,u=t.result,p=t.symbolFile,d=t.tool;switch(d&&(d.callbackTriggerOthers?a=l.dm().getDataByTag(d.callbackTriggerOthers):d.triggerOthers?a=l.dm().getDataByTag(d.triggerOthers):d.triggerOthers2&&(a=l.dm().getDataByTag(d.triggerOthers2))),i){case"playAnimation":if(e.notifier.fire({type:"beforePlayAnimation",node:a}),d&&d.triggerCallback){var v=d.triggerCallback,m="blueprintFinish_"+v+"$"+h;c.addEvent(m,(function t(){e.notifier.fire({type:"afterPlayAnimation",node:a});for(var i=0;i<e.callbacks[v].length;i++){var r=e.callbacks[v][i];$e(e,r,a,n)}c.removeEvent(m,t,s),c.clearEvents(m)}),this),c.play(l,h,null,m),l.iv()}else{var y=(r=ne())+"$"+h;if(t.triggerOthersIn2D){if(ht.animationplayer.player2d){var g=ht.animationplayer.player2d._store.player,_=ht.animationplayer.player2d._store.view;o=function(){e.notifier.fire({type:"afterPlayAnimation",node:a}),g.removeEvent(y,o,s),g.clearEvents(y)},g.addEvent(y,o,this),g.play(_,h,null,y),_.iv()}}else if(t.triggerOthersIn3D){if(ht.animationplayer.player3d){var b=Ee(n).player,k=Ee(n).view;o=function(){e.notifier.fire({type:"afterPlayAnimation",node:a}),b.removeEvent(y,o,s),b.clearEvents(y)},b.addEvent(y,o,this),b.play(k,h,null,y),k.iv()}}else r=ne(),o=function(){e.notifier.fire({type:"afterPlayAnimation",node:a}),c.removeEvent(y,o,s),c.clearEvents(y)},c.addEvent(y,o,this),c.play(l,h,null,y),l.iv()}break;case"removeAnimation":e.notifier.fire({type:"beforeRemoveAnimation",node:a}),c.remove(h),e.notifier.fire({type:"afterRemoveAnimation",node:a});break;case"remove3DAnimation":e.notifier.fire({type:"beforeRemove3DAnimation",node:a}),ht.animationplayer.player3d&&Ee(n).player.remove(u.value),e.notifier.fire({type:"afterRemove3DAnimation",node:a});break;case"removeAll":e.notifier.fire({type:"beforeRemoveAll",node:a}),c.removeAll(l),e.notifier.fire({type:"afterRemoveAll",node:a});break;case"resumeAnimation":e.notifier.fire({type:"beforeResumeAnimation",node:a}),c.resume(h),e.notifier.fire({type:"afterResumeAnimation",node:a});break;case"switchPage":e.notifier.fire({type:"beforeSwitchPage",node:a}),et(l,u.value),e.notifier.fire({type:"afterSwitchPage",node:a});break;case"switchPage2":e.notifier.fire({type:"beforeSwitchPage2",node:a}),function(e,t,a){if("display"===e.viewType){var i=Re(a);i&&et(i,t)}else if("scene"===e.viewType){var n=ht.animationplayer.g2d;n&&et(n,t)}}(e,u.value,n),e.notifier.fire({type:"afterSwitchPage2",node:a});break;case"gisSwitchPage":e.notifier.fire({type:"beforeGisSwitchPage",node:a}),function(e,t,a){var i=ht.animationplayer.player3d;if(i){var n=i._cacheMap,r=ht.animationplayer.g3d;i._store.player.removeAll(r);var o,s=new ht.graph3d.Graph3dView,l=r.getView(),c=l.nextSibling,f=l.parentElement,h=l.querySelector("div");if(h)o=l.querySelector("canvas").nextSibling;r.dispose(!0),r.dm().clear(),f.removeChild(l),i.destroy(),function(e){e.addToDOM=function(e,t,a,i){var n=this,r=n.getView(),o=r.style;e=e||document.body,t?e.insertBefore(r,t):e.appendChild(r),a&&(i&&r.contains(i)?r.insertBefore(a,i):r.appendChild(a)),o.left="0",o.right="0",o.top="0",o.bottom="0",n.iv()};var t=function(){ht.animationplayer.g3d&&ht.animationplayer.g3d.iv()};window.addEventListener("resize",t),ht.animationplayer.player3d._windowEvents.push({type:"resize",handler:t})}(s),n[t]?s.deserialize(n[t],{reset:!0}):s.deserialize(t,{reset:!0,finishFunc:function(e){n[t]=ht.Default.parse(e)}}),s.addToDOM(f,c,h,o)}}(0,u.value),e.notifier.fire({type:"afterGisSwitchPage",node:a});break;case"setCurrentFrame":e.notifier.fire({type:"beforeSetCurrentFrame",node:a}),c.setCurrentFrame(l,h,null,Number(u.value)),e.notifier.fire({type:"afterSetCurrentFrame",node:a});break;case"playSymbol":if(e.notifier.fire({type:"beforePlaySymbol",node:a}),d&&d.triggerCallback){var w=d.triggerCallback;o=function(){e.notifier.fire({type:"afterPlaySymbol",node:a});for(var t=0;t<e.callbacks[w].length;t++){var i=e.callbacks[w][t];$e(e,i,a)}c.removeSymbolEvent("blueprintFinish_"+w,o,s)},c.addSymbolEvent("blueprintFinish_"+w,o,this),c.playSymbol(l,p,null,"blueprintFinish_"+w)}else r=ne(),o=function(){e.notifier.fire({type:"afterPlaySymbol",node:a}),c.removeSymbolEvent(r,o,s)},c.addSymbolEvent(r,o,this),c.playSymbol(l,p,null,r);break;case"changeProperty":var x;if(e.notifier.fire({type:"beforeChangeProperty",node:a}),x=void 0!==t.number?t.number:void 0!==t.boolean?t.boolean:t.string,u)if(t.triggerOthersIn2D)Qe(e,a,ht.animationplayer.player2d._store.viewType,x,u.value);else if(t.triggerOthersIn3D)Qe(e,a,Ee(n).viewType,x,u.value);else if(a)Qe(e,a,f,x,u.value);else if(t.tool){var A=t.tool.triggerOthers||t.tool.triggerOthers2;if(A)for(var P=A.split("$"),S=0;S<P.length;S++){var I=P[S],M=l.dm().getDataByTag(I);Qe(e,M,f,x,u.value)}}e.notifier.fire({type:"afterChangeProperty",node:a});break;case"playNodeAnimation":if(e.notifier.fire({type:"beforePlayNodeAnimation",node:a}),d&&d.triggerCallback){var F=d.triggerCallback,N="blueprintFinish_"+F+"$"+h;o=function(){e.notifier.fire({type:"afterPlayNodeAnimation",node:a});for(var t=0;t<e.callbacks[F].length;t++){var i=e.callbacks[F][t];$e(e,i,a)}c.removeEvent(N,o,s),c.clearEvents(N)},c.addEvent(N,o,this),c.play(l,h,a,N)}else{var C=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayNodeAnimation",node:a}),c.removeEvent(C,o,s),c.clearEvents(C)},c.addEvent(C,o,this),c.play(l,h,a,C)}break;case"pauseAnimation":e.notifier.fire({type:"beforePauseAnimation",node:a}),c.pause(h),e.notifier.fire({type:"afterPauseAnimation",node:a});break;case"playNodeSymbol":e.notifier.fire({type:"beforePlayNodeSymbol",node:a});var T=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayNodeSymbol",node:a}),c.removeEvent(T,o,s),c.clearEvents(T)},c.addEvent(T,o,this),c.playSymbol(l,p,a,T);break;case"removeSymbolAnimation":var D;e.notifier.fire({type:"beforeRemoveSymbolAnimation",node:a}),u.value&&(D=u.value,c.removeSymbolAnimation(D)),e.notifier.fire({type:"afterRemoveSymbolAnimation",node:a});break;case"switchImage":e.notifier.fire({type:"beforeSwitchImage",node:a}),function(e,t){e&&e.setImage(t)}(a,u.value),e.notifier.fire({type:"afterSwitchImage",node:a});break;case"playAnimationIn3D":if(e.notifier.fire({type:"beforePlayAnimationIn3D",node:a}),Re(n)&&ht.animationplayer.player3d){var B=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayAnimationIn3D",node:a}),Ee(n).player.removeEvent(B,o,s),Ee(n).player.clearEvents(B)},Ee(n).player.addEvent(B,o,this),Ee(n).player.play(Re(n),u.value,null,B)}break;case"playAnimationIn2D":if(e.notifier.fire({type:"beforePlayAnimationIn2D",node:a}),ht.animationplayer.g2d&&ht.animationplayer.player2d){var O=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayAnimationIn2D",node:a}),ht.animationplayer.player2d._store.player.removeEvent(O,o,s),ht.animationplayer.player2d._store.player.clearEvents(O)},ht.animationplayer.player2d._store.player.addEvent(O,o,this),ht.animationplayer.player2d._store.player.play(ht.animationplayer.g2d,u.value,null,O),ht.animationplayer.g2d.iv()}break;case"playBackwardAnimation":if(e.notifier.fire({type:"beforePlayBackwardAnimation",node:a}),d&&d.triggerCallback){var z=d.triggerCallback;r=ne();var E="blueprintFinish_"+z+"$"+h;o=function(){e.notifier.fire({type:"afterPlayBackwardAnimation",node:a});for(var t=0;t<e.callbacks[z].length;t++){var i=e.callbacks[z][t];$e(e,i,a)}c.removeEvent(E,o,s),c.clearEvents(E)},c.addEvent(E,o,this),c.playBackward(l,h,null,E),l.iv()}else{var R=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayBackwardAnimation",node:a}),c.removeEvent(R,o,s),c.clearEvents(R)},c.addEvent(R,o,this),c.playBackward(l,h,null,R)}break;case"playBackwardNodeAnimation":if(e.notifier.fire({type:"beforePlayBackwardNodeAnimation",node:a}),d&&d.triggerCallback){var V=d.triggerCallback;r=ne();var L="blueprintFinish_"+V+"$"+h;o=function(){e.notifier.fire({type:"afterPlayBackwardNodeAnimation",node:a});for(var t=0;t<e.callbacks[V].length;t++){var i=e.callbacks[V][t];$e(e,i,a)}c.removeEvent(L,o,s),c.clearEvents(L)},c.addEvent(L,o,this),c.playBackward(l,h,a,L),l.iv()}else{var H=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayBackwardNodeAnimation",node:a}),c.removeEvent(H,o,s),c.clearEvents(H)},c.addEvent(H,o,this),c.playBackward(l,h,a,H)}break;case"playBackwardAnimationIn3D":if(e.notifier.fire({type:"beforePlayBackwardAnimationIn3D",node:a}),Re(n)&&ht.animationplayer.player3d){var j=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayBackwardAnimationIn3D",node:a}),Ee(n).player.removeEvent(j,o,s),Ee(n).player.clearEvents(j)},Ee(n).player.addEvent(j,o,this),Ee(n).player.playBackward(Re(n),u.value,null,j)}break;case"playBackwardAnimationIn2D":if(e.notifier.fire({type:"beforePlayBackwardAnimationIn2D",node:a}),ht.animationplayer.g2d&&ht.animationplayer.player2d){var $=(r=ne())+"$"+h;o=function(){e.notifier.fire({type:"afterPlayBackwardAnimationIn2D",node:a}),ht.animationplayer.player2d._store.player.removeEvent($,o,s),ht.animationplayer.player2d._store.player.clearEvents($)},ht.animationplayer.player2d._store.player.addEvent($,o,this),ht.animationplayer.player2d._store.player.playBackward(ht.animationplayer.g2d,u.value,null,$),ht.animationplayer.g2d.iv()}break;case"fireEvent":u&&u.value&&(e.notifier.fire({type:"beforeFireEvent",node:a}),e.notifier.fire(u.value),e.notifier.fire({type:"afterFireEvent",node:a}));break;case"bone2D":e.notifier.fire({type:"beforeBone2D",node:a}),function(e){var t=e.view;te(t)}(e),e.notifier.fire({type:"afterBone2D",node:a});break;case"playFbxAnimation":e.notifier.fire({type:"beforePlayFbxAnimation",node:a}),function(e,t,a,i){var n=t.name,r=t.speed,o=t.start,s=t.loop,l=t.tool;if(!n||!a)return;(r=Number(r))||0!==r&&(r=1);(o=Number(o))||(o=0);s||(s="repeat");if(a.playAnimation){if("once"===s&&l){if(l.resultStorage){var c,f=l.resultStorage,h=a.onPropertyChanged;a.onPropertyChanged=function(e){h.apply(a,[e]),"animationIteration"===e.property&&cancelAnimationFrame(c)},function t(){c=requestAnimationFrame(t);var i=a.getCurrentAnimationState();i&&(e.variable[f]=i.time,e.notifier.fire({type:"variableChange",name:f,value:i.time}))}()}if(l.triggerCallback){var u=l.triggerCallback,p=function(){e.notifier.fire({type:"afterPlayFbxAnimation",node:a});for(var t=0;t<e.callbacks[u].length;t++){var n=e.callbacks[u][t];$e(e,n,a,i)}},d=a.onPropertyChanged;a.onPropertyChanged=function(e){d.apply(a,[e]),"animationIteration"===e.property&&p()}}}a.playAnimation(n,r,o,s)}}(e,t,a,n);break;default:Xe(e,t,a,i,n)}}function Xe(e,t,a,i,n){var r=this,o=t.result,s=t.tool;switch(s&&s.callbackTriggerOthers&&(a=e.view.dm().getDataByTag(s.callbackTriggerOthers)),i){case"defaultHoverClick":e.notifier.fire({type:"beforeDefaultHoverClick",node:a}),function(e,t,a,i){var n=t.default,r=t.hover,o=t.click;if(n){var s=function(t){var a=t.node,i=t.imagePath1;a.a("onDown")||(e.view instanceof ht.graph.GraphView?a.setImage(i):a.s("shape3d.image",i))};s({node:a,imagePath1:n}),Ue(e,a,"onLeave",s,{node:a,imagePath1:n},i)}if(r){var l=function(t){var a=t.node,i=t.imagePath2;a.a("onDown")||(e.view instanceof ht.graph.GraphView?a.setImage(i):a.s("shape3d.image",i))};Ue(e,a,"onEnter",l,{node:a,imagePath2:r},i),l({node:a,imagePath2:r})}if(o){var c=function(t){var a=t.node,i=t.imagePath2,n=t.imagePath3;a.a("onDown")?(a.a("onDown",!1),i&&(e.view instanceof ht.graph.GraphView?a.setImage(i):a.s("shape3d.image",i))):(a.a("onDown",!0),e.view instanceof ht.graph.GraphView?a.setImage(n):a.s("shape3d.image",n))};Ue(e,a,"onDown",c,{node:a,imagePath2:r,imagePath3:o},i),c({node:a,imagePath2:r,imagePath3:o})}}(e,t,a,n),e.notifier.fire({type:"afterDefaultHoverClick",node:a});break;case"switchState":e.notifier.fire({type:"beforeSwitchState",node:a}),function(e,t,a,i){var n=t.default,r=t.hover,o=t.click;if(n){var s=function(e){var t=e.node,a=e.imagePath1;t.a("onDown")||(t.s("state",a),t.iv())};s({node:a,imagePath1:n}),Ue(e,a,"onLeave",s,{node:a,imagePath1:n},i)}if(r){var l=function(e){var t=e.node,a=e.imagePath2;t.a("onDown")||(t.s("state",a),t.iv())};l({node:a,imagePath2:r}),Ue(e,a,"onEnter",l,{node:a,imagePath2:r},i)}if(o){var c=function(e){var t=e.node,a=e.imagePath2,i=e.imagePath3;t.a("onDown")?(t.a("onDown",!1),a&&(t.s("state",a),t.iv())):(t.a("onDown",!0),t.s("state",i),t.iv())};Ue(e,a,"onDown",c,{node:a,imagePath2:r,imagePath3:o},i),c({node:a,imagePath2:r,imagePath3:o})}}(e,t,a),e.notifier.fire({type:"afterSwitchState",node:a});break;case"enterLeaveAnimation":e.notifier.fire({type:"beforeEnterLeaveAnimation",node:a}),function(e,t,a,i){var n=t.enter,r=t.leave;if(n&&r){var o=0,s=function(){0!==(o=e.player.getCurrentFrame(r)||0)&&(o=c-o)<0&&(o=0),e.player.remove(r),e.player.playDuring(e.view,n,null,o,c)},l=function(){0!==(o=e.player.getCurrentFrame(n)||0)&&(o=f-o)<0&&(o=0),e.player.remove(n),e.player.playDuring(e.view,r,null,o,f)},c=e.player.getEndFrame(e.view,n),f=e.player.getEndFrame(e.view,r),h=function(e){var t=e.node;t.a("onEnter")||(s(t),t.a("onEnter",!0),t.a("onLeave",!1))};Ue(e,a,"onEnter",h,{node:a},i),h({node:a});var u=function(e){var t=e.node;t.a("onLeave")||(l(t),t.a("onLeave",!0),t.a("onEnter",!1))};Ue(e,a,"onLeave",u,{node:a},i),u({node:a})}}(e,t,a),e.notifier.fire({type:"afterEnterLeaveAnimation",node:a});break;case"enterLeaveScale":e.notifier.fire({type:"beforeEnterLeaveScale",node:a}),function(e,t,a,i){var n=Number(t.enter),r=Number(t.leave);if(!isNaN(n)&&!isNaN(r)){var o=function(e){e.setScale(n,n)},s=function(e){e.setScale(r,r)},l=function(e){var t=e.node;t.a("onEnter")||(o(t),t.a("onEnter",!0),t.a("onLeave",!1))};Ue(e,a,"onEnter",l,{node:a},i),l({node:a});var c=function(e){var t=e.node;t.a("onLeave")||(s(t),t.a("onLeave",!0),t.a("onEnter",!1))};Ue(e,a,"onLeave",c,{node:a},i),l({node:a})}}(e,t,a),e.notifier.fire({type:"afterEnterLeaveScale",node:a});break;case"enterLeaveScale3D":e.notifier.fire({type:"beforeEnterLeaveScale3D",node:a}),function(e,t,a,i){var n=Number(t.enter),r=Number(t.leave);if(!isNaN(n)&&!isNaN(r)){var o=function(e){e.setScale3d(n,n,n)},s=function(e){e.setScale3d(r,r,r)},l=function(e){var t=e.node;t.a("onEnter")||(o(t),t.a("onEnter",!0),t.a("onLeave",!1))};Ue(e,a,"onEnter",l,{node:a},i),l({node:a});var c=function(e){var t=e.node;t.a("onLeave")||(s(t),t.a("onLeave",!0),t.a("onEnter",!1))};Ue(e,a,"onLeave",c,{node:a},i)}}(e,t,a),e.notifier.fire({type:"afterEnterLeaveScale3D",node:a});break;case"cursor":e.notifier.fire({type:"beforeCursor",node:a}),tt(e,a,n),e.notifier.fire({type:"afterCursor",node:a});break;case"switchViewpoint":e.notifier.fire({type:"beforeSwitchViewpoint",node:a}),function(e,t,a,i){var n=t.eye,r=t.center,o=t.time,s=function(e){var t=e.view,a=e.eye,i=e.center,n=e.time;t.moveCamera(a,i,{duration:Number(n),easing:function(e){return e}})};Ue(e,a,"onDown",s,{view:e.view,eye:n,center:r,time:o},i),s({view:e.view,eye:n,center:r,time:o})}(e,t,a),e.notifier.fire({type:"afterSwitchViewpoint",node:a});break;case"mouseDownUpAnimation":e.notifier.fire({type:"beforeMouseDownUpAnimation",node:a}),function(e,t,a,i){var n=t.down,r=t.up;if(n&&r){var o=0,s=function(){0!==(o=e.player.getCurrentFrame(r)||0)&&(o=c-o)<0&&(o=0),e.player.remove(r),e.player.playDuring(e.view,n,null,o,c)},l=function(){0!==(o=e.player.getCurrentFrame(n)||0)&&(o=f-o)<0&&(o=0),e.player.remove(n),e.player.playDuring(e.view,r,null,o,f)},c=e.player.getEndFrame(e.view,n),f=e.player.getEndFrame(e.view,r),h=function(e){var t=e.node;t.a("onDown")||(s(),t.a("onDown",!0),t.a("onUp",!1))};Ue(e,a,"onDown",h,{node:a},i),h({node:a});var u=function(e){var t=e.node;t.a("onUp")||(l(),t.a("onUp",!0),t.a("onDown",!1))};Ue(e,a,"onUp",u,{node:a},i),u({node:a})}}(e,t,a),e.notifier.fire({type:"afterMouseDownUpAnimation",node:a});break;case"setProperty":e.notifier.fire({type:"beforeSetProperty",node:a}),at(e,t,a,n),e.notifier.fire({type:"afterSetProperty",node:a});break;case"triggerEvent":e.notifier.fire({type:"beforeTriggerEvent",node:a}),function(e,t,a,i){var n=t.triggerEvent,r=t.tags;r=r.split("$");var o=Re(i),s=function(t){if(n&&r&&t)if("onDown"===n||"onClick"===n){var o=function(e){for(var t=e.tags,a=e.g3d,i=0;i<t.length;i++){var n=t[i],r=a.dm().getDataByTag(n);if(r){r.s("interactive",!0);var o=a.toViewPosition(r.p3()),s=new MouseEvent("mousedown",{clientX:o.x,clientY:o.y});a.getView().dispatchEvent(s)}}};Ue(e,a,"onDown",o,{tags:r,g3d:t},i),o({tags:r,g3d:t})}else if("init"===n)for(var s=function(){var e=r[l],a=t.dm().getDataByTag(e);if(a){a.s("interactive",!0);var i=t.toViewPosition(a.p3()),n=new MouseEvent("mousedown",{clientX:i.x,clientY:i.y}),o=new MouseEvent("mouseup",{clientX:i.x,clientY:i.y,bubbles:!0});setTimeout((function(){t.getView().dispatchEvent(n),t.getView().dispatchEvent(o)}),500)}},l=0;l<r.length;l++)s()};if(o)s(o);else{var l=0;(function e(){var t=requestAnimationFrame(e);(ht.animationplayer.parsed3D||l>300)&&(cancelAnimationFrame(t),ht.animationplayer.parsed3D&&s(Re(i))),l++})()}}(e,t,a),e.notifier.fire({type:"afterTriggerEvent",node:a});break;case"clickChangeImage":e.notifier.fire({type:"beforeClickChangeImage",node:a}),function(e,t,a,i){if(a){var n=a.split("$"),r=0,o=function(e){var t=e.urls,a=e.node;r>=t.length&&(r=0);var i=t[r];a.setImage(i),r++};Ue(e,t,"onDown",o,{node:t,urls:n},i),o({node:t,urls:n})}}(e,a,o.value,n),e.notifier.fire({type:"afterClickChangeImage",node:a});break;case"setVariable":e.notifier.fire({type:"beforeSetVariable",node:a}),function(e,t){var a=t.variableName,i=t.variableValue;i&&(i.startsWith("-")?e.variable[a]=Number(e.variable[a])-Number(i.substring(1)):i.startsWith("+")?e.variable[a]=Number(e.variable[a])+Number(i.substring(1)):e.variable[a]=i)}(e,t),e.notifier.fire({type:"afterSetVariable",node:a});break;case"set3DVariable":e.notifier.fire({type:"beforeSet3DVariable",node:a}),function(e,t){var a=t.variableName,i=t.variableValue;setTimeout((function(){var e=ht.animationplayer.player3d;e&&(e._store.variable[a]=i)}),50)}(0,t),e.notifier.fire({type:"afterSet3DVariable",node:a});break;case"setVariableIn2D":e.notifier.fire({type:"beforeSetVariableIn2D",node:a}),function(e,t){if(ht.animationplayer.player2d){var a=t.variableName,i=t.variableValue;setTimeout((function(){ht.animationplayer.player2d._store.variable[a]=i}),50)}}(0,t),e.notifier.fire({type:"afterSetVariableIn2D",node:a});break;case"resetView":e.notifier.fire({type:"beforeResetView",node:a}),function(e,t){var a=t.eye,i=t.center,n=t.time;a&&i&&(e.view.reset=function(){e.view.moveCamera(a,i,{duration:Number(n),easing:function(e){return e}})})}(e,t),e.notifier.fire({type:"afterResetView",node:a});break;case"moveView":e.notifier.fire({type:"beforeMoveView",node:a}),it(e,t,a,n),e.notifier.fire({type:"afterMoveView",node:a});break;case"move3DView":e.notifier.fire({type:"beforeMove3DView",node:a}),it(e,t,a,n),e.notifier.fire({type:"afterMove3DView",node:a});break;case"dataBinding":e.notifier.fire({type:"beforeDataBinding",node:a}),function(e,t,a){var i=t.dataBinding,n=t.result;a.a(i,n.value),a.iv()}(0,t,a),e.notifier.fire({type:"afterDataBinding",node:a});break;case"canvasBg":e.notifier.fire({type:"beforeCanvasBg",node:a}),function(e,t){var a=e.view,i=t.result;a.getCanvas().style.background=i.value}(e,t),e.notifier.fire({type:"afterCanvasBg",node:a});break;case"continuousPlay":e.notifier.fire({type:"beforeContinuousPlay",node:a}),function(e,t,a){if(a){var i=a.s("batch"),n=Number(t.continuousPlay),r=t.fileName,o=[];e.view.dm().getDatas().each((function(e){e.s("batch")===i&&o.push(e)}));for(var s=0,l=0;l<o.length;l++){var c=o[l].a("ht.animationList");if(c){var f=c[r];if(f)for(var h in f){var p=f[h];if(Array.isArray(p))for(var d=0;d<k(h,p);d++){var v=b(h,p,d);v&&(v.t+=n*l,s<u(v)&&(s=u(v)))}}}}for(var m=0;m<o.length;m++){var y=o[m].a("ht.animationList");if(y){var g=y[r];g&&(void 0!==g.e?g.e=s:g.endTime=s)}}e.player.play(e.view,r)}}(e,t,a),e.notifier.fire({type:"afterContinuousPlay",node:a});break;case"continuousPlay2":e.notifier.fire({type:"beforeContinuousPlay2",node:a}),function(e,t,a){if(a){a.s("shape3d.color","red");var i=a.s("batch");if(!i)return;var n=a.a("ht.animationList");if(n){var r=a.s3(),o=a.getScale3d(),s=a.p3(),l=a.getAnchor3d(),c=Number(t.offset),f=Number(t.count),h=t.fileName,p=n[h],m=d(p),y=v(p);a.a("ht.animationResetTime",y);var g=y+c*(f-1);void 0!==p.e?p.e=g:p.endTime=g;for(var _=[a.getId()],w=[a],x=1;x<f;x++){var A=c*x,P=new ht.Node;_.push(P.getId()),w.push(P),P.s("shape3d",a.s("shape3d")),P.s("batch",i),P.setAnchor3d(l),P.s3(r),P.setScale3d(o),P.p3(s),e.view.dm().add(P);var S={repeat:m,endFrame:g},I=0;for(var M in p){var F=p[M];if(Array.isArray(F)){for(var N=re(F),C=0;C<N.length;C++){var T=N[C];void 0!==T.t?T.t+=A:T.time+=A,I<u(T)&&(I=u(T))}S[M]=N}}P.a("ht.animationResetTime",I),P.a("ht.animationList",{}),P.a("ht.animationList")[h]=S}if(m){var D=e.player.getNotifier(),B=0;D.add((function(t){if(t.fileName===h&&"repeatEnd"===t.type){var a=t.node.getId();if(-1!==_.indexOf(a))if(B++,e.player._animateMap.get(h).arrsToPlay.get(t.node).forEach((function(e){for(var a=0;a<e.length;a++)void 0!==e[a].t?e[a].t+=y:e[a].time+=y,a===e.length-1&&t.node.a("ht.animationResetTime",u(e[a]));B===f&&u(e[e.length-1])})),B===f){e.player.remove(h);for(var i=0;i<w.length;i++){var n=w[i],r=n.a("ht.animationResetTime");n.a("ht.animationResetTime",void 0);var o=n.a("ht.animationList")[h];void 0!==o.e?o.e=y:o.endTime=y;var s=r-g;if(s<0)for(;s<0;)s+=y;var l=(w.length-1-i)*c;for(var p in l>y&&(l%=y),o){var d=o[p];if(Array.isArray(d)){for(var v=0,m=0;m<k(p,d);m++){var x=b(p,d,m);x&&(0===m&&(v=u(x)),x.t-=v)}for(var A=void 0,P=0;P<d.length-1;P++)if(l>=u(d[P])&&l<=u(d[P+1])){A={t:0,v:d[P].value+(d[P+1].value-d[P].value)*(l-u(d[P]))/(u(d[P+1])-u(d[P]))};break}var S=void 0,I=void 0;if(s!==y&&0!==s){S=void 0!==d[0].v?d.shift().v:d.shift().value,I=void 0!==d[d.length-1].v?d.pop().v:d.pop().value;for(var M=0;M<d.length;M++){var F=d[M];F&&(u(F)>l&&u(F)<=y?F.t-=l:u(F)>=0&&u(F)<=l&&(F.t+=y-l))}d.push(A),d.push({t:s,v:I}),d.push({t:s+.01,v:S}),d.push({t:y,v:A.value})}for(var N=0;N<d.length-1;N++)for(var C=N+1;C<d.length;C++)if(u(d[N])>u(d[C])){var T=d[N];d[N]=d[C],d[C]=T}}}}e.player.play(e.view,h)}}})),e.player.play(e.view,h)}else e.player.play(e.view,h)}}}(e,t,a),e.notifier.fire({type:"afterContinuousPlay2",node:a});break;case"playAnimationWithSpeed":e.notifier.fire({type:"beforePlayAnimationWithSpeed",node:a}),function(e,t){var a=t.fileName,i=t.speed,n=e.player,r=e.view;n.play(r,a,null,null,null,i)}(e,t),e.notifier.fire({type:"afterPlayAnimationWithSpeed",node:a});break;case"playBackwardWithSpeed":e.notifier.fire({type:"beforePlayBackwardWithSpeed",node:a}),function(e,t){var a=t.fileName,i=t.speed,n=e.player,r=e.view;n.playBackward(r,a,null,null,null,i)}(e,t),e.notifier.fire({type:"afterPlayBackwardWithSpeed",node:a});break;case"setSymbolState":e.notifier.fire({type:"beforeSetSymbolState",node:a}),function(e,t,a){var i=t.symbolState;a.s("state",i),a.iv()}(0,t,a),e.notifier.fire({type:"afterSetSymbolState",node:a});break;case"playDuring3D":if(s&&s.triggerCallback){var l=s.triggerCallback,c="blueprintFinish_"+l+"$"+t.fileName;e.player.addEvent(c,(function t(){e.notifier.fire({type:"afterPlayDuring3D",node:a});for(var i=0;i<e.callbacks[l].length;i++){var n=e.callbacks[l][i];$e(e,n,a)}e.player.removeEvent(c,t,r),e.player.clearEvents(c)}),this),e.notifier.fire({type:"beforePlayDuring3D",node:a}),Ye(e,t,a,c),e.view.iv()}else e.notifier.fire({type:"beforePlayDuring3D",node:a}),Ye(e,t),e.notifier.fire({type:"afterPlayDuring3D",node:a});break;case"bgm":e.notifier.fire({type:"beforeBgm",node:a}),function(e,t,a){var i=document.createElement("audio"),n=t.result;function r(){if(i.canPlayType("audio/mpeg")){var t=n.value;t&&(t=ht.Default.convertURL(t)),-1===e.bgm.indexOf(t)&&(i.src=t,e.bgm.push(t),i.play())}document.removeEventListener("click",r)}document.addEventListener("click",r)}(e,t),e.notifier.fire({type:"afterBgm",node:a});break;case"shadowBounding":e.notifier.fire({type:"beforeShadowBounding",node:a}),function(e,t,a){if(!e||!t||!a)return void console.error("handleShadowBounding: Invalid arguments.");var i=e.view;if(!i||"function"!=typeof i.mp||"function"!=typeof i.getCurrentShadowBounding)return void console.error("handleShadowBounding: Invalid view object or missing required methods.");var n=t.minHeight,r=t.minValue,o=t.maxHeight,s=t.maxValue;if("number"!=typeof n||"number"!=typeof r||"number"!=typeof o||"number"!=typeof s)return void console.error("handleShadowBounding: Invalid state values.");var l=i.mp,c=function(e,t,a){return e+a*(t-e)};try{i.mp((function(e){if(l&&"function"==typeof l&&l.apply(a,[e]),e&&"eye"===e.property&&e.newValue&&Array.isArray(e.newValue)){var t=i.getCurrentShadowBounding();Array.isArray(t)&&t.length>=4&&(t[0]=e.newValue[0]||0,t[1]=0,t[2]=e.newValue[2]||0,e.newValue[1]<=n?t[3]=r:e.newValue[1]>=o?t[3]=s:t[3]=c(r,s,(e.newValue[1]-n)/(o-n)),"function"==typeof i.setShadowBounding?i.setShadowBounding(t):console.error("handleShadowBounding: setShadowBounding method not found on view."))}}))}catch(e){console.error("handleShadowBounding encountered an error:",e)}}(e,t,a),e.notifier.fire({type:"afterShadowBounding",node:a});break;case"adsorb":e.notifier.fire({type:"beforeAdsorb",node:a}),function(e,t,a,i){var n=Re(i);if(n){var r=t.adsorbTag;if(r){var o=n.dm().getDataByTag(r);o&&a.setHost(o)}else a.setHost(null)}}(0,t,a,n),e.notifier.fire({type:"afterAdsorb",node:a});break;case"pauseAnimations":e.notifier.fire({type:"beforePauseAnimations",node:a}),function(e,t,a,i){var n=e.player,r=t.result;if(r){var o=r.value;o&&n.pauseAnimations(!1,o)}}(e,t),e.notifier.fire({type:"afterPauseAnimations",node:a});break;case"removeAnimations":e.notifier.fire({type:"beforeRemoveAnimations",node:a}),function(e,t,a,i){var n=e.player,r=t.result;if(r){var o=r.value;o&&n.removeAnimations(o)}}(e,t),e.notifier.fire({type:"afterRemoveAnimations",node:a});break;case"playAnimations":e.notifier.fire({type:"beforePlayAnimations",node:a}),function(e,t,a,i){var n=e.view,r=e.player,o=t.tool,s=t.result;if(o&&o.triggerCallback){var l=o.triggerCallback,c=r.getNotifier(),f=function t(n){if(n&&"afterRemoveAnimations"===n.type){for(var r=0;r<e.callbacks[l].length;r++){var o=e.callbacks[l][r];$e(e,o,a,i)}c.remove(t)}};c.add(f)}if(s){var h=s.value;h&&r.playAnimations({view:n,index:h})}}(e,t,a,n),e.notifier.fire({type:"afterPlayAnimations",node:a});break;case"playLoopAnimations":e.notifier.fire({type:"beforePlayLoopAnimations",node:a}),function(e,t){var a=e.view,i=e.player,n=t.result;if(n){var r=n.value;r&&i.playAnimations({view:a,fileName:r,loop:!0})}}(e,t),e.notifier.fire({type:"afterPlayLoopAnimations",node:a});break;case"removeLoopAnimations":e.notifier.fire({type:"beforeRemoveLoopAnimations",node:a}),function(e,t){var a=e.player,i=t.result;if(i){var n=i.value;n&&a.removeAnimations(n)}}(e,t),e.notifier.fire({type:"afterRemoveLoopAnimations",node:a});break;case"setAnimationsCurrentFrame":e.notifier.fire({type:"beforeSetAnimationsCurrentFrame",node:a}),function(e,t){var a=e.view,i=e.player,n=t.fileName,r=t.frame,o=t.type;o=!o||isNaN(o)?0:Number(o);r=isNaN(r)?0:Number(r);i.setAnimationsCurrentFrame(a,r,o,n)}(e,t),e.notifier.fire({type:"afterSetAnimationsCurrentFrame",node:a});break;case"material_explode":e.notifier.fire({type:"beforeMaterialExplode",node:a}),Oe(e,t,a);break;case"gisMoveView":e.notifier.fire({type:"beforeGisMoveView",node:a}),function(e,t,a,i){var n=t.position,r=t.angle,o=t.time,s=t.maximumHeight;t.event;var l=function(){var e=Re(i),t=function(e){if(e){var t=e.dm().gismap;t&&t.flyTo({position:[Number(n[0]),Number(n[1])],height:Number(n[2]),heading:Number(r[0]),pitch:Number(r[1]),roll:Number(r[2]),animation:{duration:Number(o)||0},cesiumOptions:{maximumHeight:Number(s)||30}})}};if(e)t(e);else{var a=0;(function e(){var n=requestAnimationFrame(e);Re(i)||a>600?(cancelAnimationFrame(n),t(Re(i))):a++})()}};l()}(0,t,0,n),e.notifier.fire({type:"afterGisMoveView",node:a});break;case"distanceCheck":e.notifier.fire({type:"beforeDistanceCheck",node:a}),function(e,t){var a,i,n=e.view,r=t.tag1,o=t.tag2,s=t.distance,l=t.property,c=t.changeValue,f=n.dm().getDataByTag(r),h=n.dm().getDataByTag(o);if(c){var u=(c=c.replace(/\s*/g,"")).split("|");a=ft(u[0]),i=ft(u[1]),s=isNaN(s)?0:Number(s)}if(f&&h){var p=!1,d=function(e){if(e.data===h&&("position"===e.property||"elevation"===e.property)){var t=f.p3(),n=h.p3(),r=Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)+Math.pow(t[2]-n[2],2));if(!p&&r<=s){p=!0;var o=l.split(":");"s"===o[0]?f.s(o[1],a):"a"===o[0]&&f.a(o[1],a)}else if(p&&r>s){p=!1;var c=l.split(":");"s"===c[0]?f.s(c[1],i):"a"===c[0]&&f.a(c[1],i)}}};n.dm().md(d),e.md.push(d)}}(e,t),e.notifier.fire({type:"afterDistanceCheck",node:a});break;default:if(s&&s.triggerOthers){e.notifier.fire({type:"beforeTriggerOthers",node:a});var f=s.triggerCallback,h=s.triggerOthers.tags;h=h.split("$");for(var p=0;p<h.length;p++){var m=h[p],y=e.view.dm().getDataByTag(m);if(y&&f)for(var g=0;g<e.callbacks[f].length;g++){var _=e.callbacks[f][g],w=_.alternateCount,x=_.alternateIndex,A=_.onAlternateIndex;if(void 0!==w){var P=e.alternates[x][A];P&&st(e,P,y,x,w,t,n)}else $e(e,_,y)}}e.notifier.fire({type:"afterTriggerOthers",node:a})}else if(s&&s.triggerOthersIn2D){e.notifier.fire({type:"beforeTriggerOthersIn2D",node:a});var S=s.triggerCallback,I=s.triggerOthersIn2D.tags;I=I.split("$");for(var M=0;M<I.length;M++){var F=I[M],N=e.view.dm().getDataByTag(F);if(N&&S)for(var C=0;C<e.callbacks[S].length;C++){var T=e.callbacks[S][C],D=T.alternateCount,B=T.alternateIndex,O=T.onAlternateIndex;if(void 0!==D){var z=e.alternates[B][O];z&&st(e,z,N,B,D,t,n)}else $e(e,T,N)}}e.notifier.fire({type:"afterTriggerOthersIn2D",node:a})}else if(s&&s.triggerOthersIn3D){e.notifier.fire({type:"beforeTriggerOthersIn3D",node:a});var E=s.triggerCallback,R=s.triggerOthersIn3D.tags;R=R.split("$");for(var V=0;V<R.length;V++){var L=R[V],H=e.view.dm().getDataByTag(L);if(H&&E)for(var j=0;j<e.callbacks[E].length;j++){var $=e.callbacks[E][j],G=$.alternateCount,W=$.alternateIndex,U=$.onAlternateIndex;if(void 0!==G){var J=e.alternates[W][U];J&&st(e,J,H,W,G,t,n)}else $e(e,$,H)}}e.notifier.fire({type:"afterTriggerOthersIn3D",node:a})}}}function Ye(e,t,a,i){var n=t.begin,r=t.end,o=t.speed,s=t.fileName,l=e.player,c=e.view;l.playDuring(c,s,null,n,r,i,null,o)}function Qe(e,t,a,i,n,o){if(t){if("object"===r(n)){var s=n,l=s.start,c=s.end;l=Number(l),c=Number(c),n=Math.floor(Math.random()*(c-l+1))+l}else if("string"==typeof n){var f=n.split(":");if("a"===f[0]){var h=f[1];if(!h)return;if(n=Number(e.variable[h]),isNaN(n))return}}switch(i){case"positionX":"display"===a?t.setPosition(Number(n),t.getPosition().y):t.p3(Number(n),t.p3()[1],t.p3()[2]);break;case"positionY":"display"===a?t.setPosition(t.getPosition().x,Number(n)):t.p3(t.p3()[0],Number(n),t.p3()[2]);break;case"positionZ":t.setPosition(t.p3()[0],t.p3()[1],Number(n));break;case"width":t.setWidth(Number(n));break;case"height":t.setHeight(Number(n));break;case"sizeX":"display"===a?t.setSize(Number(n),t.getSize().y):t.s3(Number(n),t.s3()[1],t.s3()[2]);break;case"sizeY":"display"===a?t.setSize(t.getSize().x,Number(n)):t.s3(t.s3()[0],Number(n),t.s3()[2]);break;case"sizeZ":t.s3(t.s3()[0],t.s3()[1],Number(n));break;case"anchorX":t.setAnchorX(Number(n));break;case"anchorY":"display"===a?t.setAnchorY(Number(n)):t.setElevation(Number(n));break;case"anchorZ":t.setAnchorY(Number(n));break;case"scaleX":t.setScaleX(Number(n));break;case"scaleY":"display"===a?t.setScaleY(Number(n)):t.setScaleTall(Number(n));break;case"scaleZ":t.setScaleY(Number(n));break;case"rotation":t.setRotation(Number(n)*Math.PI/180);break;case"rotationX":t.setRotationX(Number(n));break;case"rotationY":t.setRotationY(Number(n));break;case"rotationZ":t.setRotationZ(Number(n));break;case"opacity":"display"===a?t.s("opacity",Number(n)):t.s("shape3d")?t.s("shape3d.opacity",Number(n)):t.s("all.opacity",Number(n));break;case"clip":"display"===a?t.s("clip.percentage",Number(n)):t.s("3d.clip.percentage",Number(n));break;case"brightness":t.s("brightness",Number(n));break;case"visible":"true"===n?n=!0:"false"===n&&(n=!1),"display"===a?t.s("2d.visible",n):t.s("3d.visible",n);break;case"highlight":"true"===n?n=!0:"false"===n&&(n=!1),t.s("highlight.mode",n);break;case"closeLight":"true"===n?n=!0:"false"===n&&(n=void 0),t.s("light.disabled",n);break;case"particleStart":"true"===n?n=!0:"false"===n&&(n=void 0),t.a("particleStart",n);break;case"particleTriggerEmit":"true"===n?n=!0:"false"===n&&(n=void 0),t.a("particleTriggerEmit",n);break;case"shadow":"true"===n?n=!0:"false"===n&&(n=void 0),Re(o)&&(n?Re(o).enableShadow():Re(o).disableShadow());break;case"shadow2D":"true"===n?n=!0:"false"===n&&(n=void 0),t.s("shadow2",n);break;case"text":t.s("text",n);break;case"bodyColor":t.s("body.color",n)}}}function Ze(e,t,a){var i=e.timer,r=i.interval,o=i.time;r=Number(r),o=Number(o);var s=0,l=Date.now();!function e(){var i=requestAnimationFrame(e),c=Date.now();c-l>=r&&(t.apply(void 0,n(a)),s++,l=c,s>=o&&cancelAnimationFrame(i))}()}function et(e,t){if(e instanceof ht.graph3d.Graph3dView){var a=ht.animationplayer.player3d;if(a){var i=a._cacheMap;a._store.player.removeAll(e),i[t]&&a._store.currentView!==t?(e.dm().clear(),e.deserialize(i[t],{reset:!0}),a._store.currentView=t):(e.dm().clear(),e.deserialize(t,{reset:!0,finishFunc:function(e){i[t]=ht.Default.parse(e)}}),a._store.currentView=t)}}else{var n=ht.animationplayer.player2d;if(n){var r=n._cacheMap;n._store.player.removeAll(e),n._store.player.removeSymbolAnimation(),r[t]&&n._store.currentView!==t?(e.dm().clear(),e.deserialize(r[t],{reset:!0,finishFunc:function(a){if(r[t].a.bottomView){var i=r[t].a.bottomView;if(r[t].a.is3dBottomView){var n=ht.animationplayer.player3d;if(n){n._store.player.removeAll(e);var o=n._cacheMap;o[i]&&n._store.currentView!==i&&(n._store.view.dm().clear(),n._store.deserialize(o[i],{reset:!0}),n._store.currentView=i)}}}}}),n._store.currentView=t):(e.dm().clear(),e.deserialize(t,{reset:!0,finishFunc:function(a){var i=ht.Default.parse(a);if(r[t]=i,i.a.bottomView){var n=i.a.bottomView;if(i.a.is3dBottomView){var o=ht.animationplayer.player3d;o&&(o._store.player.removeAll(e),o._store.view.dm().clear(),o._store.view.deserialize(n,{reset:!0,finishFunc:function(t){var a=ht.Default.parse(t);o._cacheMap[n]=a,o._store.view.addToDOM(),e.addToDOM(o._store.view.getView()),e.setZoomable(!1)}}),o._store.currentView=n)}}}}),n._store.currentView=t)}}}function tt(e,t,a){if(!t.a("ht.blueprintCursor")){t.a("ht.blueprintCursor",!0);Ue(e,t,"onEnter",(function(e){e.view.getView().style.cursor="pointer"}),{view:e.view},a),Ue(e,t,"onLeave",(function(e){e.view.getView().style.cursor="default"}),{view:e.view},a)}}function at(e,t,a,i){var n=t.propertyName,r=t.propertyValue,o=t.tags,s=t.event,l=function(){for(var a=o.split(","),s=0;s<a.length;s++){var l=a[s];if(t.triggerOthersIn2D){if(ht.animationplayer.player2d){var c=ht.animationplayer.player2d._store.view.dm().getDataByTag(l),f=ht.animationplayer.player2d._store.viewType;Qe(e,c,f,n,r)}}else if(t.triggerOthersIn3D){if(ht.animationplayer.player3d){var h=Ee(i).view.dm().getDataByTag(l),u=Ee(i).viewType;Qe(e,h,u,n,r)}}else{var p=e.view.dm().getDataByTag(l);p&&Qe(e,p,e.viewType,n,r)}}};Ue(e,a,s,l,null,i),l()}function it(e,t,a,i){var n=t.eye,r=t.center,o=t.time;t.event;var s=t.easing;!function(){var e=Re(i),t=function(e){e&&("Jump"===s?(e.setEye(n),e.setCenter(r)):e.moveCamera(n,r,{duration:Number(o),easing:Ve(s)}))};if(e)t(e);else{var a=0;!function e(){var n=requestAnimationFrame(e);Re(i)||a>600?(cancelAnimationFrame(n),t(Re(i))):a++}()}}()}function nt(e,t,a,i){if(void 0!==t)if(Array.isArray(t)){for(var r=!0,o=0;o<t.length;o++){var s=t[o],l=s.type,c=s.value;if("condition"===l){var f=c.variableName,h=c.variableValue;if(e.variable[f]!==h){r=!1;break}}}r&&(Array.isArray(i)?a.apply(void 0,n(i)):a(i))}else{var u=t.variableName,p=t.variableValue,d=!1;(function(e,t){if(void 0===t)return e.undefinedVariable||(e.undefinedVariable={}),!e.undefinedVariable[t]&&(e.undefinedVariable[t]=!0,!0)})(e,p)&&(d=!0),d||(p.startsWith("<")?Number(e.variable[u])<Number(p.substring(1))&&(d=!0):p.startsWith(">")?Number(e.variable[u])>Number(p.substring(1))&&(d=!0):p.startsWith("<=")?e.variable[u]<=p.substring(2)&&(d=!0):p.startsWith(">=")?e.variable[u]>=p.substring(2)&&(d=!0):p.startsWith("=")?e.variable[u]===p.substring(1)&&(d=!0):e.variable[u]===p&&(d=!0)),d&&(Array.isArray(i)?a.apply(void 0,n(i)):a(i))}else Array.isArray(i)?a.apply(void 0,n(i)):a(i)}function rt(e,t,a,i,n){var r=i.event,o=i.tags;if("init"===r)for(var s=o.split("$"),l=0;l<s.length;l++){var c=s[l],f=e.view.dm().getDataByTag(c);Ge(e,t,f,n)}else r&&(a.s("interactive",!0),t.event=r,We(e,t,a,n))}function ot(e,t,a,i){t.nodeId=a.getId();var n=t.onAlternateIndex;t.alternateIndex=i,e.alternates[i]?(e.alternates[i][n]?(t.alternateCount=e.alternates[i].length,e.alternates[i][n].push(JSON.parse(JSON.stringify(t)))):(t.alternateCount=e.alternates[i].length+1,e.alternates[i][n]=[JSON.parse(JSON.stringify(t))]),e.maxAlternate[i]=e.alternates[i].length):(t.alternateCount=1,e.alternates[i]=[],e.alternates[i][n]=[JSON.parse(JSON.stringify(t))],e.maxAlternate[i]=1)}function st(e,t,a,i,n,r,o){var s;if(s=r?i+"_"+r.processId:i,e.currentAlternate[s]||(e.currentAlternate[s]=1),n===e.currentAlternate[s])if(e.currentAlternate[s]===e.maxAlternate[i]?e.timeOut[s]||(e.timeOut[s]=!0,setTimeout((function(){e.timeOut[s]=null,e.currentAlternate[s]=1}),100)):e.timeOut[s]||(e.timeOut[s]=!0,setTimeout((function(){e.timeOut[s]=null,e.currentAlternate[s]+=1}),100)),r)for(var l=0;l<t.length;l++){var c=t[l];$e(e,c,a,o)}else for(var f=0;f<t.length;f++){var h=t[f];h.event="init",h.tool.alternate=null,$e(e,h,a,o)}}function lt(e,t,a,i){for(var n in e.conditionActions){var r=e.conditionActions[n],o=void 0;if(r&&r.length)for(var s=0;s<r.length;s++){var l=r[s],c=l.otherTool;c&&(o=!0),nt(e,c,ct,[e,l,t,a,i])}o||(e.conditionActions[n].length=0)}}function ct(e,t,a,i,n){var r=t.comparisonOperator,o=e.view.dm().getDataById(t.nodeId);"="===r[0]?a[i]===Number(r[1])&&Ke(e,t,o,t.action,n):">"===r[0]?a[i]>Number(r[1])&&Ke(e,t,o,t.action,n):"<"===r[0]&&a[i]<Number(r[1])&&Ke(e,t,o,t.action,n)}function ft(e){if(void 0!==e&&"string"==typeof e)return"TRUE"===e.toUpperCase()||"FALSE"!==e.toUpperCase()&&e}var ut=function(){function e(t,a){l(this,e),this._viewType=null,this._cacheMap={},this._store={view:t},this._store.notifier=new ht.Notifier,a&&a.a&&a.a["ht.blueprintId"]&&(this._store.id=a.a["ht.blueprintId"]),this._windowEvents=[]}return h(e,[{key:"init",value:function(e){ht.animationplayer.delayOnce||(ht.animationplayer.delayOnce={}),this._initStore(e);var t=this._store.view.dm();this._deserializeNodes(t,this._store),"scene"===this._store.viewType?ht.animationplayer.parsed3D=!0:"display"===this._store.viewType&&te(this._store.view)}},{key:"initRenderHTML",value:function(e,t,a){null==t&&(t=ht.Math.generateUUID()),this._storeForRenderHTML||(this._storeForRenderHTML={}),this._storeForRenderHTML[t]={view:e},this._storeForRenderHTML[t].notifier=new ht.Notifier,ht.animationplayer.delayOnceForRenderHTML||(ht.animationplayer.delayOnceForRenderHTML={},ht.animationplayer.delayOnceForRenderHTML[t]={}),ht.animationplayer.g3dForRenderHTML||(ht.animationplayer.g3dForRenderHTML={}),ht.animationplayer.g3dForRenderHTML[t]=e,this._initStoreForRenderHTML(t,a);var i=this._storeForRenderHTML[t].view.dm();return this._deserializeNodes(i,this._storeForRenderHTML[t],t),"scene"===this._storeForRenderHTML.viewType?(ht.animationeditor.parsed3DForRenderHTML||(ht.animationeditor.parsed3DForRenderHTML={}),ht.animationplayer.parsed3DForRenderHTML[t]=!0):this._storeForRenderHTML[t].viewType,t}},{key:"_initG2d",value:function(){var e=this,t=this._store.view.getView(),a=function(t){e._store.view.getDataAt(t)&&t.stopPropagation()};t.addEventListener("mousedown",a),t.addEventListener("click",a),t.addEventListener("touchstart",a),t.addEventListener("wheel",a)}},{key:"_initStore",value:function(e){this._store.view instanceof ht.graph.GraphView?(this._store.viewType="display",this._initG2d()):this._store.viewType="scene",this._store.player=new Fe,this._store.nodeActions={},this._store.conditionActions={},e||(this._store.variable={}),this._store.others={},this._store.alternates={},this._store.currentAlternate={},this._store.maxAlternate={},this._store.callbacks={},this._store.timeOut={},this._store.continuousPlayNodes=[],this._store.currentView="",this._store.processList=[],this._store.bgm=[],this._store.mi=[],this._store.md=[],this._store._keydownHandler=null,this._store._keys={}}},{key:"_initStoreForRenderHTML",value:function(e,t){this._storeForRenderHTML[e].view instanceof ht.graph.GraphView?(this._storeForRenderHTML[e].viewType="display",this._initG2d()):this._storeForRenderHTML[e].viewType="scene",this._storeForRenderHTML[e].player=new Fe,this._storeForRenderHTML[e].nodeActions={},this._storeForRenderHTML[e].conditionActions={},t||(this._storeForRenderHTML[e].variable={}),this._storeForRenderHTML[e].others={},this._storeForRenderHTML[e].alternates={},this._storeForRenderHTML[e].currentAlternate={},this._storeForRenderHTML[e].maxAlternate={},this._storeForRenderHTML[e].callbacks={},this._storeForRenderHTML[e].timeOut={},this._storeForRenderHTML[e].continuousPlayNodes=[],this._storeForRenderHTML[e].currentView="",this._storeForRenderHTML[e].processList=[],this._storeForRenderHTML[e].bgm=[]}},{key:"_deserializeNodes",value:function(e,t,a){var i=this,n=e.getDatas();this._checkSourceAttach(n),this._checkMergedCustomNode(n);var r=[],o=[];n.each((function(e){var t,a=e.a("ht.blueprint");if(a){t=Array.isArray(a)?a:[a];for(var n=0;n<t.length;n++){var s=t[n],l=i._parseNodes(s);e.a("ht.blueprintCallback")?o.push({blueprintLines:l,node:e}):r.push({blueprintLines:l,node:e})}}})),this._parseBlueprint(o,t,a),this._parseBlueprint(r,t,a),function(e,t){var a,i=this,n=e.alternates,r=[];for(var o in n)if(n.hasOwnProperty(o)){var s=n[o];for(var l in s)if(s.hasOwnProperty(l)){var c=s[l];a||(a=c[0].event);for(var f=0;f<c.length;f++){var h=c[f],u=h.nodeId,p=e.view.dm().getDataById(u);p&&("init"===a?r.push([h,p]):We(e,h,p,t))}}}if(r.length){for(var d=0;d<r.length-1;d++)for(var v=r[d],m=d+1;m<r.length;m++){var y=r[m];if(v[0].onAlternateIndex>y[0].onAlternateIndex){var g=r[d];r[d]=r[m],r[m]=g}}for(var _=e.view,b=e.player,k=function(){var e,t,a;if(w!==r.length-1&&(e=r[w+1],t=e[0],a=e[1]),w<r.length-2){var n="ht_animation_initAlternates_"+w+"$"+t.fileName,o="ht_animation_initAlternates_"+(w+1)+"$"+t.fileName;b.addEvent(n,(function e(){"playAnimation"===t.action?(b.removeEvent(n,e,i),b.clearEvents(n),t.tool.delay?setTimeout((function(){b.play(_,t.fileName,null,o)}),Number(t.tool.delay)):b.play(_,t.fileName,null,o)):"playNodeAnimation"===t.action&&(b.removeEvent(n,e,i),b.clearEvents(n),t.tool.delay?setTimeout((function(){b.play(_,t.fileName,a,o)}),Number(t.tool.delay)):b.play(_,t.fileName,a,o))}),i)}else if(w===r.length-2){var s="ht_animation_initAlternates_"+w+"$"+t.fileName;b.addEvent(s,(function e(){"playAnimation"===t.action?(b.removeEvent(s,e,i),b.clearEvents(s),t.tool.delay?setTimeout((function(){b.play(_,t.fileName,null)}),Number(t.tool.delay)):b.play(_,t.fileName,null)):"playNodeAnimation"===t.action&&(b.removeEvent(s,e,i),b.clearEvents(s),t.tool.delay?setTimeout((function(){b.play(_,t.fileName,a)}),Number(t.tool.delay)):b.play(_,t.fileName,a))}),i)}},w=0;w<r.length;w++)k();var x=r[0],A=x[0],P=x[1];"playAnimation"===A.action?A.tool.delay?setTimeout((function(){b.play(_,A.fileName,null,"ht_animation_initAlternates_0")}),Number(A.tool.delay)):b.play(_,A.fileName,null,"ht_animation_initAlternates_0"):"playNodeAnimation"===A.action&&(A.tool.delay?setTimeout((function(){b.play(_,A.fileName,P,"ht_animation_initAlternates_0")}),Number(A.tool.delay)):b.play(_,A.fileName,P,"ht_animation_initAlternates_0"))}}(t,a)}},{key:"_checkSourceAttach",value:function(e){var t={linkArr:[],blueprint:[]},a={node:[],link:[]};e.each((function(e){var i=e.a("ht.blueprint");if(i){var n=i.h,r=i.a;n&&(a.node.push(e),a.link.push(n)),r&&(t.linkArr.push(r),t.blueprint.push(i))}}));for(var i=0;i<t.linkArr.length;i++)for(var n=t.linkArr[i],r=t.blueprint[i],o=0;o<a.link.length;o++){var s=a.link[o];if(-1!==n.indexOf(s))a.node[o].a("ht.blueprint",r)}}},{key:"_checkMergedCustomNode",value:function(e){var t=this;e.each((function(e){var a=e.a("ht.blueprint");if(a){var i=a.c;if(i&&i.length)for(var n=0;n<i.length;n++){var r=i[n],o=r.i;if(o&&"custom"===o.split("$")[0]){for(var s=[],l=r.v,c=0;c<l.length;c++){for(var f=l[c],h=f.event,u=f.action,p=f.value,d={i:"event$"+h,c:[]},v=0;v<u.length;v++){var m=u[v],y=p[v];t._checkAction(d,m,y)}s.push({c:[d]})}e.a("ht.blueprint",s)}}}}))}},{key:"_checkAction",value:function(e,t,a){switch(t){case"playAnimation":case"playNodeAnimation":case"removeAnimation":case"pauseAnimation":e.c.push({i:"action$"+t,c:[{i:"fileName$"+a,c:[]}]});break;case"switchPage":case"gisSwitchPage":case"setCurrentFrame":case"playSymbol":case"playNodeSymbol":case"switchImage":e.c.push({i:"action$"+t,c:[{i:"result$input",v:a,c:[]}]});break;default:e.c.push({i:"action$changeProperty",c:[{i:"number$"+t,c:[{i:"result$input",v:a,c:[]}]}]})}}},{key:"_parseNodes",value:function(e){var t=e.c,a=[],i=function e(t,i,n){var r=t[i],o=r.i,s=r.c,l=r.v,c=r.onAlternateIndex,f={i:o};if(void 0!==l&&(f.v=l),void 0!==c&&(f.onAlternateIndex=c),n.push(f),s.length)if(1===s.length)e(s,0,n);else{for(var h=[n],u=1;u<s.length;u++)h.push(n.slice());for(var p=0;p<s.length;p++)e(s,p,h[p])}else a.push(n)};if(t&&t.length)for(var n=0;n<t.length;n++){i(t,n,[])}return a}},{key:"_parseBlueprint",value:function(e,t,a){for(var i=0;i<e.length;i++)for(var n=e[i],r=n.blueprintLines,o=n.node,s=0;s<r.length;s++){for(var l=r[s],c={},f=0;f<l.length;f++){var h=l[f],u=h.i;Ne(0,c,0,u,h.v,h.onAlternateIndex),t.processList.push({rootId:o.getId(),processIndex:u+"_"+s,nodeIndex:u+"_"+s+"_"+f})}c.processId=i+"_"+s,void 0!==c.callbackId?je(t,c,o):$e(t,c,o,a)}}},{key:"clearStore",value:function(e,t){if(e)if(t)e[t]={};else for(var a=Object.keys(e),i=0;i<a.length;i++)delete e[a[i]];else t?this._storeForRenderHTML[t]={}:this._store={}}},{key:"getVersion",value:function(){return"0.23.15.2"}},{key:"getPlayer",value:function(){return this._store.player}},{key:"getPlayerForRenderHTML",value:function(e){return this._storeForRenderHTML[e].player}},{key:"setCurrentView",value:function(e){this._store.currentView=e}},{key:"setCurrentViewForRenderHTML",value:function(e,t){this._storeForRenderHTML[e].currentView=t}},{key:"getProcessList",value:function(){return this._store.processList}},{key:"getNotifier",value:function(){return this._store.notifier}},{key:"getNotifierForRenderHTML",value:function(e){return this._storeForRenderHTML[e].notifier}},{key:"addNodeEvent",value:function(e,t,a){e&&Ue(this._store,e,t,a,{player2d:ht.animationplayer.player2d,player3d:ht.animationplayer.player3d})}},{key:"addNodeEventForRenderHTML",value:function(e,t,a,i){t&&Ue(this._store,t,a,i,{player2d:ht.animationplayer.player2d,player3d:ht.animationplayer.player3d},e)}},{key:"checkNodeEventExist",value:function(e,t){var a=e.getAttrObject();for(var i in a)if(i.split("$Actions")[0]===t)return!0;return!1}},{key:"runCallback",value:function(e,t){if(e){var a=this._store.callbacks[e];if(a)for(var i=0;i<a.length;i++){var n=a[i];$e(this._store,n,t)}}}},{key:"runCallbackForRenderHTML",value:function(e,t,a){if(t){var i=this._storeForRenderHTML[e].callbacks[t];if(i)for(var n=0;n<i.length;n++){var r=i[n];$e(this._storeForRenderHTML[e],r,a,e)}}}},{key:"buildRelationships",value:function(e,t){ht.animationplayer.relationships||(ht.animationplayer.relationships={}),ht.animationplayer.relationships[e]=t}},{key:"removeMaterialExplode",value:function(){ht.animationplayer.blueprintplayer.materialExplodeId&&(cancelAnimationFrame(ht.animationplayer.blueprintplayer.materialExplodeId),delete ht.animationplayer.blueprintplayer.materialExplodeId)}},{key:"removeMaterialSea",value:function(){ht.animationplayer.blueprintplayer.materialSeaId&&(cancelAnimationFrame(ht.animationplayer.blueprintplayer.materialSeaId),delete ht.animationplayer.blueprintplayer.materialSeaId)}},{key:"removeMaterialSky",value:function(){ht.animationplayer.blueprintplayer.materialSkyId&&(cancelAnimationFrame(ht.animationplayer.blueprintplayer.materialSkyId),delete ht.animationplayer.blueprintplayer.materialSkyId)}},{key:"destroy",value:function(){if(this._store.mi.length){for(var e=0;e<this._store.mi.length;e++)this._store.view.umi(this._store.mi[e]);this._store.mi.length=0}if(this._store.md.length){for(var t=0;t<this._store.md.length;t++)this._store.view.dm().umd(this._store.md[t]);this._store.md.length=0}if(this._store._keydownHandler&&(this._store.view.removeEventListener("keydown",this._store._keydownHandler),this._store._keys=null),this._windowEvents.length){for(var a=0;a<this._windowEvents.length;a++)window.removeEventListener(this._windowEvents[a].type,this._windowEvents[a].handler);this._windowEvents.length=0}this.clearStore(),delete ht.animationplayer.g2d,delete ht.animationplayer.g3d}}]),e}();function pt(e,t,a,i){var n=e[t],r=a.getCurrentPrefix();if(n&&n.func&&"string"==typeof n.func){var s=o(n.func.split("@"),2);return s[0],(r||"")+s[1]}return null}var dt=Fe;return dt.getVersion=me,dt.blueprintplayer=dt.BlueprintPlayer=ut,dt.symbolAnimationPlayer=ye,dt.overrideTimerFunc=function(e,t){dt._raf=e,dt._caf=t},dt.overrideSetEyeFunc=function(e){dt._setEye=e},dt.getSymbolMask=function(e,t,a,i,n,r,o){if(r&&o){var s=ht.Default.getImage(o),l=ht.Default.getImage(r);if(l&&s){var c=t.x,f=t.y,h=t.width,u=t.height;if(e.save(),e.beginPath(),l.comps){var p=l.comps[0],d=p.points,v=p.segments;if(d){if(d instanceof ht.List)d=d.toArray();else if(Array.isArray(d)){for(var m=[],y=0;y<d.length/2;y++)m.push({x:d[2*y],y:d[2*y+1]});d=m}if(v){var g,_,b;v instanceof ht.List&&(v=v.toArray());for(var k=0;k<v.length;k++)switch(v[k]){case 1:g=d.shift(),e.moveTo(c+g.x,f+g.y);break;case 2:g=d.shift(),e.lineTo(c+g.x,f+g.y);break;case 3:g=d.shift(),_=d.shift(),e.quadraticCurveTo(c+g.x,f+g.y,c+_.x,f+_.y);break;case 4:g=d.shift(),_=d.shift(),b=d.shift(),e.bezierCurveTo(c+g.x,f+g.y,c+_.x,f+_.y,c+b.x,f+b.y);break;case 5:e.closePath()}}else for(var w=0;w<d.length;w++)0===w?e.moveTo(d[w].x,d[w].y):e.lineTo(d[w].x,d[w].y);p.closePath&&e.closePath(),e.clip()}}ht.Default.drawStretchImage(e,s,"enterUniform",c,f,h,u,i,n),e.restore()}}},dt.drawScrollBar=function(e,t,a,i){var r,o,s,l,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},f=arguments.length>5?arguments[5]:void 0,h=t.x,u=t.y,p=t.width,d=t.height,v=a.width,m=a.height,y=i.x,g=i.y,_=null,b=null,k=c.color,w=void 0===k?"red":k,x=c.barWidth,A=void 0===x?8:x,P=c.gap,S=void 0===P?2:P,I=c.visible;if(e.save(),m>d){var M,F=d*(l=d/m);if(b=[h+p-A-S,u+-g*l,A,Math.max(F,30)],o=d-m,I)e.beginPath(),(M=ht.Default).drawRoundRect.apply(M,[e].concat(n(b),[Math.min(A,F)/2])),e.fillStyle=w,e.fill()}if(v-2>p){var N,C=p*(s=p/v);if(_=[h+-y*s,u+d-A-S,Math.max(C,30),A],r=p-v,I)e.beginPath(),(N=ht.Default).drawRoundRect.apply(N,[e].concat(n(_),[Math.min(A,C)/2])),e.fillStyle=w,e.fill()}f.scrollInfo={scrollBarX:_,scrollBarY:b,scaleX:s,scaleY:l,minX:r,minY:o},e.restore()},dt.roundRect=function(e,t,a,i,n,r,o,s){r<=0||(i<2*r&&(r=i/2),n<2*r&&(r=n/2),e.beginPath(),"stroke"===s?e.strokeStyle=o:"fill"===s&&(e.fillStyle=o),e.moveTo(t+r,a),e.arcTo(t+i,a,t+i,a+n,r),e.arcTo(t+i,a+n,t,a+n,r),e.arcTo(t,a+n,t,a,r),e.arcTo(t,a,t+i,a,r),e.closePath(),"stroke"===s?e.stroke():"fill"===s&&e.fill())},dt.handleScroll=function(e,t,a,i,n,r,o){var s,l,c=ht.vector.getVectorInfo(i,a,e),f=c.scrollInfo,h=c.scrollSpeed||1;if(s=pt(e,"translateY",a),l=pt(e,"translateX",a),f){var u=f.scrollBarX,p=f.scrollBarY,d=f.minX,v=f.minY,m=(t.wheelDeltaX||-t.deltaX||0)/40*5*h,y=(t.wheelDeltaY||-t.deltaY||0)/40*5*h,g=!1;if(p&&s&&y){var _=(a.a(s)||0)+y;_=Math.min(0,_),_=Math.max(v,_),a.a(s,_),g=!0}if(u&&l&&m){var b=(a.a(l)||0)+m;b=Math.min(0,b),b=Math.max(d,b),a.a(l,b),g=!0}if(!g&&u&&!p&&l&&y){var k=(a.a(l)||0)+y;k=Math.min(0,k),k=Math.max(d,k),a.a(l,k)}var w=c.autoHideScrollBar;(u||p)&&w&&(c.scrollBarVisible=!0,function(e,t){e._hideBarTimer&&(clearTimeout(e._hideBarTimer),e._hideBarTimer=null);e._hideBarTimer=setTimeout((function(){t._scrollDragInfo||(t.scrollBarVisible=!1,e.iv())}),1e3)}(a,c)),a.iv()}},dt}(),this.ht.AnimationPlayer=this.ht.animationplayer;