From 09f439d56497b39bce19c25ce5a111c8df2cffee Mon Sep 17 00:00:00 2001 From: aderan Date: Wed, 6 Nov 2024 10:28:25 +0800 Subject: [PATCH] update appliance-plugin to 1.1.2 --- carrot.yml | 2 +- sdk/src/main/assets/whiteboard/{8ffe727 => 317f293} | 0 sdk/src/main/assets/whiteboard/index.html | 2 +- .../whiteboard/{netless.de300972.js => netless.e43af397.js} | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename sdk/src/main/assets/whiteboard/{8ffe727 => 317f293} (100%) rename sdk/src/main/assets/whiteboard/{netless.de300972.js => netless.e43af397.js} (89%) diff --git a/carrot.yml b/carrot.yml index 5c3a5df5..896a0643 100644 --- a/carrot.yml +++ b/carrot.yml @@ -1,4 +1,4 @@ - name: whiteboard-bridge repoPath: ../whiteboard-bridge repoURL: 'https://github.com/netless-io/whiteboard-bridge.git' - commit: 8ffe727 + commit: 317f293 diff --git a/sdk/src/main/assets/whiteboard/8ffe727 b/sdk/src/main/assets/whiteboard/317f293 similarity index 100% rename from sdk/src/main/assets/whiteboard/8ffe727 rename to sdk/src/main/assets/whiteboard/317f293 diff --git a/sdk/src/main/assets/whiteboard/index.html b/sdk/src/main/assets/whiteboard/index.html index 48bf288a..bc6f9da5 100644 --- a/sdk/src/main/assets/whiteboard/index.html +++ b/sdk/src/main/assets/whiteboard/index.html @@ -1 +1 @@ -white-sdk-bridge Application
\ No newline at end of file +white-sdk-bridge Application
\ No newline at end of file diff --git a/sdk/src/main/assets/whiteboard/netless.de300972.js b/sdk/src/main/assets/whiteboard/netless.e43af397.js similarity index 89% rename from sdk/src/main/assets/whiteboard/netless.de300972.js rename to sdk/src/main/assets/whiteboard/netless.e43af397.js index 51e8a540..e6f957e3 100644 --- a/sdk/src/main/assets/whiteboard/netless.de300972.js +++ b/sdk/src/main/assets/whiteboard/netless.e43af397.js @@ -245,7 +245,7 @@ var $p=new jl.j,Xp=function(){function e(e){this.renderer=e}return e.prototype.i * * @pixi/canvas-sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */ff.prototype._renderCanvas=function(e){var t=this._texture;if(t.baseTexture.valid){var r=e.context,n=this.worldTransform,i=t.baseTexture,o=i.getDrawableSource(),a=i.resolution;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var s=new Rl.CanvasRenderTarget(t._frame.width,t._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Up.b.getTintedCanvas(this,this.tint),s.context.drawImage(this._tintedCanvas,0,0)):s.context.drawImage(o,-t._frame.x*a,-t._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=s.context.createPattern(s.canvas,"repeat")}r.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),this.tileTransform.updateLocalTransform();var u=this.tileTransform.localTransform,l=this._width,c=this._height;Jp.identity(),ev.copyFrom(u),this.uvRespectAnchor||ev.translate(-this.anchor.x*l,-this.anchor.y*c),ev.scale(this.tileScale.x/a,this.tileScale.y/a),Jp.prepend(ev),Jp.prepend(n),e.setContextTransform(Jp),r.fillStyle=this._canvasPattern;var h=this.anchor.x*-l,d=this.anchor.y*-c;tv[0].set(h,d),tv[1].set(h+l,d),tv[2].set(h+l,d+c),tv[3].set(h,d+c);for(var f=0;f<4;f++)ev.applyInverse(tv[f],tv[f]);for(r.beginPath(),r.moveTo(tv[0].x,tv[0].y),f=1;f<4;f++)r.lineTo(tv[f].x,tv[f].y);r.closePath(),r.fill()}},Jh.prototype.renderCanvas=function(e){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var t=e.context,r=this.worldTransform,n=!0,i=0,o=0,a=0,s=0;e.setBlendMode(this.blendMode),t.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var u=0;u20&&(e.value=Math.floor(1e3*e.times/e.valueTotal),e.valueTotal=0,e.times=0,e.destroyed||e.emit("update",e.value)),e.prevTime=t,e.destroyed||e.calcFps()}))}},{key:"destroy",value:function(){this.destroyed=!0}}]),r}(Ks.a);!function(e){e.ResourceError="RESOURCE_ERROR",e.RuntimeError="RUNTIME_ERROR",e.RuntimeWarn="RUNTIME_WARN",e.CanvasCrash="CANVAS_CRASH"}(Zp||(Zp={}));var nv=function(e){p(r,e);var t=m(r);function r(e,n){var i,o,a;return x(this,r),o=y(i=t.call(this,n)),a=(this instanceof r?this.constructor:void 0).prototype,Object.setPrototypeOf?Object.setPrototypeOf(o,a):o.__proto__&&(o.__proto__=a),i.errorType=e,i.errorMsg=n,i}return S(r,null,[{key:"transform",value:function(e){return e instanceof r?e:new r(Zp.RuntimeError,e.message)}}]),r}(n(Error));function iv(){return function(e,t,r){var n=r.value;r.value=function(){try{for(var e=arguments.length,t=new Array(e),r=0;r2048||b>2048)&&(x=(y*=2048/_)*b)>2048&&(y*=b/x),w=document.createElement("canvas"),S=Math.ceil(g.width*y),T=Math.ceil(g.height*y),w.width=S,w.height=T,w.getContext("2d").drawImage(g,0,0,S,T),M=w.toDataURL("image/png"),k=new $l.c(M,{resolution:1}),r.abrupt("return",(this.logger.info("load end. "+o,this.taskId||""),this.useCache&&this.localStorage.setItem(u,{scale:y,scaledBase64:M}).catch((function(){})),{baseTexture:k,scale:y}));case 70:case"end":return r.stop()}}),r,this,[[22,34],[39,52]])})))}},{key:"destroy",value:function(){}}]),e}(),mv=function(){function e(t){var r=this;x(this,e),this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=function(e){var t=e/(rd.b.TARGET_FPMS||.06);if(!r.isPaused){r.timestamp+=t,r.callbackList=r.callbackList.filter((function(e){return e&&!e.applied}));for(var n=r.callbackList.length,i=0;i=0&&!this.callbackList[t].running&&this.callbackList.splice(t,1)}},{key:"delay",value:function(e){var t=this;return new Promise((function(r){t.setTimeout(r,e)}))}},{key:"waitUntil",value:function(e,t){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=this.timestamp;case 1:if(e()||!(this.timestamp-n90&&a<270||a<-90&&a>-270)&&(n=-n),i=s*n}return{x:n,y:i}}function Mv(e,t,r,n,i,o){var a,s,u,l,c,h=e,d=t;if(0===Math.round(n))a=i,s=o,c=0;else if(Math.round(n)>=360)a=i,s=o,u=i+2*e*Math.abs(Math.cos(-r/180*Math.PI)),l=o+2*t*Math.sin(-r/180*Math.PI),c=1;else{var f=-(r+n),p=Tv(-r,h,d),v=i-p.x,m=o+p.y,g=Tv(f,h,d);a=g.x+v,s=m-g.y,c=n>=-360&&n<-180?1:n>=-180&&n<0||n>0&&n<180?0:1}return{radiusX:h,radiusY:d,xAxisRotation:0,largeArcFlag:c,sweepFlag:n>0?1:0,endX:a,endY:s,middleX:u,middleY:l}}var kv=function(){function e(){x(this,e),this.pool=[]}return S(e,[{key:"getObject",value:function(e){var t=this.pool.find((function(e){return!e.isUsed}));if(t)return t.isUsed=!0,t.obj;var r={obj:this.createObject(),isUsed:!0,group:e};return this.pool.push(r),r.obj}},{key:"collectObject",value:function(e){var t=this.pool.find((function(t){return t.obj===e}));t&&(t.isUsed=!1,this.resetObject(t.obj))}},{key:"collectObjectByGroup",value:function(e){var t=this;this.pool.filter((function(t){return t.group===e})).forEach((function(e){return t.collectObject(e.obj)}))}}]),e}(),Ev=new(function(e){p(r,e);var t=m(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("version","1.1"),e}},{key:"resetObject",value:function(e){e.removeAttribute("viewBox"),e.removeAttribute("width"),e.removeAttribute("height"),e.innerHTML=""}}]),r}(kv)),Iv=new(function(e){p(r,e);var t=m(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){return document.createElement("img")}},{key:"resetObject",value:function(e){e.removeAttribute("src")}}]),r}(kv)),Av=function(){function e(t){x(this,e),this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null),this.maxResolution=t}return S(e,[{key:"render",value:function(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,l,h,d,f,p,v,m=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.items,o=e.width,a=e.height,s=Iv.getObject(r),u=new $l.c(s,{width:o*n,height:a*n,resolution:1}),l=Ev.getObject(r),this.imgElements.push(s),this.svgElements.push(l),l.setAttribute("viewBox","0 0 ".concat(o," ").concat(a)),l.setAttribute("width",""+o),l.setAttribute("height",""+a),h={},i.forEach((function(e){var t=e.item,r=e.x,i=e.y,o=r+2,a=i+2;t.pathsData.forEach((function(e){var t="";e.cmds.forEach((function(r){var n=c(r,2),i=n[0],s=n[1];t+=i+" ",t+=s.map((function(t){return Sv()(t)||(t.x=t.x+e.offset.x+o,t.y=t.y+e.offset.y+a),t})).reduce((function(e,t){return Sv()(t)?e+=t+" ":e+="".concat(t.x," ").concat(t.y," "),e}),""),t+=" "})),e.pathElement.setAttribute("d",t),l.appendChild(e.pathElement)}));var s=t.width-4-2*t.padding,d=t.height-4-2*t.padding;m.textures[t.hash]={texture:new $l.t(u,new jl.j((o+2)*n,(a+2)*n,s*n,d*n)),pivot:t.pivot,scale:1/n},h[t.hash]=m.hashToIdMap[t.hash]})),f=''+l.outerHTML,d="data:image/svg+xml,"+encodeURIComponent(f).replace(/'/g,"%27").replace(/"/g,"%22"),(p=document.createElement("img")).src=d,t.next=9,new Promise((function(e,t){p.onload=function(){return e("")},p.onerror=function(){return t()}}));case 9:return(v=document.createElement("canvas")).width=p.width*n,v.height=p.height*n,v.getContext("2d").drawImage(p,0,0,v.width,v.height),s.src=v.toDataURL("image/png"),t.next=15,new Promise((function(e,t){s.onload=function(){return e("")},s.onerror=function(){return t()}}));case 15:case"end":return t.stop()}}),t,this)})))}},{key:"getGraphicsData",value:function(e){var t=this.idToHashMap[e]||"";return this.textures[t]||null}},{key:"addGraphics",value:function(e,t,r,n,i,o,a,s,u,l,h){var d,f;if(!a&&!u)return e;var p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A,C,P,N=xv()(r+(null!==(f=null===(d=null==a?void 0:a.width)||void 0===d?void 0:d.toString())&&void 0!==f?f:0)+u+l+h);if(this.hashToIdMap[N]||(this.hashToIdMap[N]=[]),this.hashToIdMap[N].push(e),this.idToHashMap[e]=N,this.graphics.findIndex((function(e){return e.hash===N}))<0){var O=(p=t,v=i,m=o,g=a,y=n,_=u,b=l,x=h,S=[],T={x:Math.abs(y.x),y:Math.abs(y.y)},M=0,k=0,E=0,I=0,A=0,C="none",P=null!==(w=null==g?void 0:g.width)&&void 0!==w?w:0,_?(M=v,k=m,A=0):(C=x||"#ff0000",A=P,E=.5*P,I=.5*P,M=v+P,k=m+P,T.x+=.5*P,T.y+=.5*P),M+=Math.abs(y.x),k+=Math.abs(y.y),E+=Math.abs(y.x),I+=Math.abs(y.y),M+=4,k+=4,E+=2,I+=2,M=Math.ceil(M),k=Math.ceil(k),p.forEach((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==e.fill&&_?t.setAttribute("fill",b||"#ff0000"):t.setAttribute("fill","none"),e.hasStroke&&!_&&(t.setAttribute("stroke-linecap",(null==g?void 0:g.cap)||"butt"),t.setAttribute("stroke-linejoin",(null==g?void 0:g.join)||"miter"),t.setAttribute("stroke-width",A.toString()),t.setAttribute("stroke",C),(null==g?void 0:g.dash)&&t.setAttribute("stroke-dasharray",g.dash));for(var r=e.scale,n=e.path.trim().split(" "),i={x:0,y:0},o={offset:{x:E,y:I},cmds:[],pathElement:t},a=0;a=360?(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.middleX/9525*r.x,y:T.middleY/9525*r.y}]]),o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]])):(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]]))}else if("L"===s){var M=c(u.split(",").map((function(e){return Number(e)})),2),k=M[0],P=M[1];i={x:k,y:P},k=k/9525*r.x,P=P/9525*r.y,o.cmds.push(["L",[{x:k,y:P}]])}else if("QB"===s){var N=c(u.split(",").map((function(e){return Number(e)})),4),O=N[0],R=N[1],D=N[2],L=N[3];i={x:D,y:L},O=O/9525*r.x,R=R/9525*r.y,D=D/9525*r.x,L=L/9525*r.y,o.cmds.push(["Q",[{x:O,y:R},{x:D,y:L}]])}else if("CB"===s){var j=c(u.split(",").map((function(e){return Number(e)})),6),z=j[0],B=j[1],U=j[2],F=j[3],W=j[4],G=j[5];i={x:W,y:G},z=z/9525*r.x,B=B/9525*r.y,U=U/9525*r.x,F=F/9525*r.y,W=W/9525*r.x,G=G/9525*r.y,o.cmds.push(["C",[{x:z,y:B},{x:U,y:F},{x:W,y:G}]])}else"C"===s&&o.cmds.push(["Z",[]])}S.push(o)})),{graphicsWidth:M,graphicsHeight:k,pivot:T,padding:2,pathsData:S}),R=O.graphicsWidth,D=O.graphicsHeight,L=O.pathsData,j=O.pivot,z=O.padding;this.graphics.push({hash:N,pathsData:L,pivot:j,width:R,height:D,padding:z})}return e}},{key:"pack",value:function(){return this.graphics.forEach((function(e){e.width+=4,e.height+=4})),function e(t){for(var r=[],n=t.filter((function(e){var t=e.width<2048&&e.height<2048;return t||r.push(e),t})).sort((function(e,t){return e.width*e.height-t.width*t.height})),i=n.length+1,o=2050,a=2050,s=[],u=null;(o>2048||a>2048)&&n.length>0;)i-=1,o=(u=av()(n.slice(0,i))).width,a=u.height;return u&&s.push(u),r.forEach((function(e){var t=av()([e]);s.push(t)})),i2&&void 0!==arguments[2]?arguments[2]:{type:"el",index:0,id:""},o=this.targets[e.id];return"shape"!==e.type?o:("shape"===e.type&&e.txEl&&(o=null!==(r=null==o?void 0:o.getTextElement(e.txEl.type,e.txEl.range))&&void 0!==r?r:null),"shape"===e.type&&e.bg&&0===i.index&&(t=!1,o=null!==(n=null==o?void 0:o.getBgElement())&&void 0!==n?n:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),t&&o?o.getIterateEntry(i.type,i.index,i.id):(o||this.eventHub.emit("IterateTimeNodeEnd",i.id),o))}},{key:"clearTargets",value:function(){this.targets=Object.create(null)}}]),e}(),Nv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.strokeColorFilter.currentColor},set:function(e){this.target.strokeColorFilter.color=e}},{key:"on",get:function(){return this.target.strokeActive?"true":"false"},set:function(e){this.target.strokeActive="true"===e}}]),e}(),Ov=function e(t){var r=this;x(this,e),this.applyCommand=function(e,t){r.target.applyCommand(e,t)},this.target=t},Rv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"toString",value:function(){return this.color}},{key:"color",get:function(){return this.target.pptColorFilter.currentColor},set:function(e){this.target.pptColorActive&&(this.target.pptColorFilter.color=e)}},{key:"on",get:function(){return this.target.pptColorActive?"true":"false"},set:function(e){this.target.pptColorActive="true"===e}},{key:"designColor",get:function(){return this.target.pptColorFilter.designColor}}]),e}(),Dv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.fillColorFilter.currentColor},set:function(e){this.target.fillActive&&(this.target.fillColorFilter.color=e)}},{key:"on",get:function(){return this.target.fillActive?"true":"false"},set:function(e){this.target.fillActive="true"===e}},{key:"designColor",get:function(){return this.target.fillColorFilter.designColor}}]),e}(),Lv=function(){function e(t,r,n){x(this,e),this.hardHidden=!1,this.designRotation=0,this.target=t,!0===r&&(this.hardHidden=!0),this.designRotation=n}return S(e,[{key:"opacity",get:function(){return this.target.alpha},set:function(e){this.target.alpha=e}},{key:"rotation",get:function(){return this.target.rotation/Math.PI*180},set:function(e){this.target.rotation=e/180*Math.PI+this.designRotation}},{key:"visibility",get:function(){return this.target.visible?"visible":"hidden"},set:function(e){this.visibility===e||this.hardHidden||(this.target.visible="visible"===e)}}]),e}(),jv=function(){function e(t,r){x(this,e),this.actions=[],this.ctx=r,this.object=t,this.object.interactive=!0}return S(e,[{key:"reset",value:function(e){this.object.interactive=!1,this.object.removeAllListeners(),this.object=e,this.object.interactive=!0}},{key:"addAction",value:function(e,t){var r=this;this.actions.push([e,t]),"click"===t?(this.object.addListener("pointertap",(function(){return r.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return r.handleAction(e)}))}},{key:"getOriginHitArea",value:function(){return this.object.hitArea?this.object.hitArea:new jl.k(0,0,this.object.width,this.object.height)}},{key:"handleAction",value:function(e){this.ctx.eventHub.emit(__.hyperlinkTrigger,e),this.execAction(e)}},{key:"execAction",value:function(e){var t,r;if(this.ctx.eventHub.emit(__.userInput),"ppaction://hlinksldjump"===e.action){var n=(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(__.requestGotoSlide,Number(n[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(__.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(__.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(__.requestGotoSlide,i)}else"ppaction://hlinkshowjump?jump=endshow"===e.action?this.ctx.eventHub.emit(__.requestGotoSlide,-1):""===e.action&&(null===(r=e.target)||void 0===r?void 0:r.startsWith("http"))&&this.ctx.eventHub.emit(__.requestOpenUrl,e.target)}}]),e}();function zv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return Math.abs(e-t)<=Math.pow(10,-r)}function Bv(e){return Math.floor(1e6*e)/1e6}var Uv=function(){function e(){x(this,e),this.point={x:0,y:0},this.slope=Math.PI/4}return S(e,[{key:"resolveY",value:function(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}},{key:"distanceToLinearEquation",value:function(e){return zv(this.slope,e.slope)?this.distanceToPoint(e.point):-1}},{key:"distanceToPoint",value:function(t){var r;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;r=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;var n=e.fromPointSlope(t,r),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}},{key:"crossPoint",value:function(e){if(zv(e.slope,this.slope))return null;var t=0,r=0,n=Math.tan(e.slope),i=Math.tan(this.slope),o=this.point,a=o.x,s=o.y,u=e.point,l=u.x,c=u.y;return zv(this.slope,Math.PI/2)?r=n*((t=this.point.x)-l)+c:zv(e.slope,Math.PI/2)?r=i*((t=e.point.x)-a)+s:zv(this.slope,Math.PI)||zv(this.slope,0)?t=((r=this.point.y)-c)/n+l:zv(e.slope,Math.PI)||zv(e.slope,0)?t=((r=e.point.y)-s)/i+a:r=i*((t=(n*l-c+s-i*a)/(n-i))-a)+s,{x:t,y:r}}}],[{key:"fromPointSlope",value:function(t,r){var n=new e;return n.point=t,n.slope=r,n}}]),e}(),Fv=function(){function e(t,r,n){var i,o,a,s,u,l,c=this;x(this,e),this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new jl.j(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new Dl.b,this.ctx=r,this.style=new Lv(this.container,!!t.hardHidden,t.rotation||0),this.designGlobalPosition={x:n.parentGlobalPos.x+(null!==(o=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0),y:n.parentGlobalPos.y+(null!==(s=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new jv(this.container,this.ctx),t.hlinkHover&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil((function(){try{return!!c.container.width}catch(e){return!1}}),3e3).then((function(){try{c.designWidth=c.designWidth||c.container.width}catch(e){}})),this.ctx.clock.waitUntil((function(){try{return!!c.container.height}catch(e){return!1}}),3e3).then((function(){try{c.designHeight=c.designHeight||c.container.height}catch(e){}}))}return S(e,[{key:"updateScale",value:function(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}},{key:"updateTransform",value:function(e){var t,r,n,i,o,a,s,u;this.designWidth=e.width,this.designHeight=e.height,this.designX=null!==(r=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,this.designY=null!==(i=null===(n=e.position)||void 0===n?void 0:n.y)&&void 0!==i?i:0;var l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;var h=null!==(a=null===(o=e.position)||void 0===o?void 0:o.x)&&void 0!==a?a:0,d=null!==(u=null===(s=e.position)||void 0===s?void 0:s.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,e.scale&&(this.designScale={x:e.scale.x,y:e.scale.y},this.container.scale.x=e.scale.x,this.container.scale.y=e.scale.y),e.rotation&&(this.container.rotation=e.rotation);var f=new Nd;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}},{key:"scale",get:function(){return this.scaleOrigin},set:function(e){this.scaleOrigin.x=e.x,this.scaleOrigin.y=e.y,this.updateScale()}},{key:"design_ppt_w",get:function(){return Bv(this.designWidth/this.ctx.stageWidth)}},{key:"design_ppt_h",get:function(){return Bv((this.designHeight||this.container.height)/this.ctx.stageHeight)}},{key:"design_ppt_x",get:function(){return Bv(this.designX/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.designY/this.ctx.stageHeight)}},{key:"ppt_w",get:function(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth},set:function(e){this.designWidth&&(this.scaleExt.x=e*this.ctx.stageWidth/this.designWidth,this.updateScale())}},{key:"ppt_h",get:function(){var e=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*e/this.ctx.stageHeight},set:function(e){this.designHeight&&(this.scaleExt.y=e*this.ctx.stageHeight/this.designHeight,this.updateScale())}},{key:"ppt_x",get:function(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth},set:function(e){this.pptX=e;var t=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=e*this.ctx.stageWidth+this.container.pivot.x*t}},{key:"ppt_y",get:function(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight},set:function(e){this.pptY=e;var t=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=e*this.ctx.stageHeight+this.container.pivot.y*t}},{key:"r",get:function(){return this.container.rotation},set:function(e){this.container.rotation=e}},{key:"xshear",set:function(e){this.container.skew.x=e},get:function(){return this.container.skew.x}},{key:"yshear",set:function(e){this.container.skew.y=e},get:function(){return this.container.skew.y}}]),e}(),Wv=r(112),Gv=r.n(Wv),Vv=function(){function e(t){if(x(this,e),this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;var r=t.match(/-?[0-9]+/g);r&&(this.h=parseInt(r[0],10),this.s=parseInt(r[1],10)/100,this.l=parseInt(r[2],10)/100)}}return S(e,[{key:"isInit",value:function(){return this._isInit}},{key:"by",value:function(e,t){t.h=Math.max(Math.min(this.h+e.h,359),0),t.s=Math.max(Math.min(this.s+e.s,1),0),t.l=Math.max(Math.min(this.l+e.l,1),0),t.a=Math.max(Math.min(this.a+e.a,1),0)}},{key:"fromHexString",value:function(e){var t,r,n=c($v(e),4),i=n[0],o=n[1],a=n[2],s=n[3],u=0,l=Math.max(i,o,a),h=Math.min(i,o,a),d=l-h;r=(l+h)/2,0===d?u=0:l===i?u=(o-a)/d%6*60:l===o?u=60*((a-i)/d+2):l===a&&(u=60*((i-o)/d+4)),t=0===d?0:d/(1-Math.abs(2*r-1)),this.h=u,this.s=t,this.l=r,this.a=s}},{key:"interpolationFrom",value:function(e,t,r){var n=e.h+(this.h-e.h)*t,i=e.s+(this.s-e.s)*t,o=e.l+(this.l-e.l)*t,a=e.a+(this.a-e.a)*t;r.h=Math.max(Math.min(n,359),0),r.s=Math.max(Math.min(i,1),0),r.l=Math.max(Math.min(o,1),0),r.a=Math.max(Math.min(a,1),0)}},{key:"toHexString",value:function(){var e=[0,0,0,0],t=this.h,r=this.s,n=this.l;if(t<360&&t>=0&&r<=1&&r>=0&&n<=1&&n>=0){var i,o=(1-Math.abs(2*n-1))*r,a=o*(1-Math.abs(t/60%2-1)),s=n-o/2;e=[(i=c(t>=0&&t<60?[o,a,0]:t>=60&&t<120?[a,o,0]:t>=120&&t<180?[0,o,a]:t>=180&&t<240?[0,a,o]:t>=240&&t<300?[a,0,o]:[o,0,a],3))[0]+s,i[1]+s,i[2]+s,this.a]}return Xv(e)}}]),e}(),Hv=function(){function e(t){x(this,e),this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}return S(e,[{key:"fromHexString",value:function(e){var t=c($v(e),4),r=t[0],n=t[1],i=t[2],o=t[3];this.r=r,this.g=n,this.b=i,this.a=o}},{key:"isInit",value:function(){return this._isInit}},{key:"interpolationFrom",value:function(e,t,r){r.r=e.r+(this.r-e.r)*t,r.g=e.g+(this.g-e.g)*t,r.b=e.b+(this.b-e.b)*t,r.a=e.a+(this.a-e.a)*t}},{key:"by",value:function(e,t){t.r=Math.min(Math.max(this.r+e.r,0),255),t.g=Math.min(Math.max(this.g+e.g,0),255),t.b=Math.min(Math.max(this.b+e.b,0),255),t.a=Math.min(Math.max(this.a+e.a,0),1)}},{key:"toHexString",value:function(){return Xv([this.r,this.g,this.b,this.a])}}]),e}();function Yv(e){var t=e.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function $v(e){return 0===(e=e.replace(/^#/,"")).substring(6,8).length&&(e+="FF"),[parseInt(e.substring(0,2).padStart(8,"0"),16)/255,parseInt(e.substring(2,4).padStart(8,"0"),16)/255,parseInt(e.substring(4,6).padStart(8,"0"),16)/255,parseInt(e.substring(6,8).padStart(8,"0"),16)/255]}function Xv(e){return"#"+Math.round(255*e[0]).toString(16).padStart(2,"0")+Math.round(255*e[1]).toString(16).padStart(2,"0")+Math.round(255*e[2]).toString(16).padStart(2,"0")+Math.round(255*e[3]).toString(16).padStart(2,"0")}function qv(e,t,r){var n=$v(e),i=$v(t),o=Math.round(255*(n[0]+(i[0]-n[0])*r)),a=Math.round(255*(n[1]+(i[1]-n[1])*r)),s=Math.round(255*(n[2]+(i[2]-n[2])*r)),u=Math.round(255*(n[3]+(i[3]-n[3])*r));return"#"+o.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}var Qv=function(e){p(r,e);var t=m(r);function r(){var e;return x(this,r),(e=t.call(this,void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0})).currentColor="#FFFFFFFF",e.designColor="#FFFFFFFF",e}return S(r,[{key:"color",set:function(e){this.currentColor=e;var t=$v(e);this.uniforms.color=Float32Array.from(t)},get:function(){return this.currentColor}}]),r}($l.k),Zv=new Bp.ColorMatrixFilter;Zv.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];var Kv=new Bp.ColorMatrixFilter;Kv.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];var Jv=new Bp.ColorMatrixFilter;Jv.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];var em=new Bp.ColorMatrixFilter;em.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];var tm={darken:Zv,darkenLess:Kv,lightenLess:em,lighten:Jv},rm=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,{position:{x:e.x,y:e.y},width:e.width,height:e.height},n,i)).fillColorFilter=new Qv,o.fill=new Dv(y(o)),o.json=e,o.ctx=n,o.parentGlobalPos=i.parentGlobalPos,o.global={x:i.parentGlobalPos.x+e.x,y:i.parentGlobalPos.y+e.y},o.updateTransform({position:{x:e.x,y:e.y},width:e.width,height:e.height}),o}return S(r,[{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"getTextElement",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"fillActive",get:function(){var e,t;return(null!==(t=null===(e=this.container.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){var t,r;e?(null!==(r=null===(t=this.container.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}},{key:"renderContainer",get:function(){return this.container}},{key:"interactiveContainer",get:function(){return this.container}},{key:"ppt_x",get:function(){return this.global.x/this.ctx.stageWidth},set:function(e){var t=e*this.ctx.stageWidth-this.global.x,r=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+t+this.container.pivot.x*r}},{key:"ppt_y",get:function(){return this.global.y/this.ctx.stageHeight},set:function(e){var t=e*this.ctx.stageHeight-this.global.y,r=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+t+this.container.pivot.y*r}},{key:"design_ppt_x",get:function(){return Bv(this.global.x/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.global.y/this.ctx.stageHeight)}}]),r}(Fv),nm=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.ctx=t,this.type=r,this.lineWidth=n,this.width=i,this.height=o,this.fillColor=a,this.isHorz=s,this.renderContainer=new Dl.b,this.ghcTextureId="".concat(u,"-text-p").concat(l,"-l").concat(c,"-u").concat(h,"-underLine")}return S(e,[{key:"createPaths",value:function(){if("ww"===this.type)return null;var e,t="M 0,0 L ".concat(9525*this.width,",0"),r=[this.width,this.lineWidth],n=r[0],i=r[1];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,n=(e=[this.lineWidth,this.height])[0],i=e[1]),{paths:[{id:uv(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:xv()(t)}],width:n,height:i}}},{key:"getLineStyle",value:function(){var e={width:this.lineWidth};return"dotted"===this.type&&(e.dash=""+this.lineWidth),e}},{key:"preRender",value:function(){var e=this.createPaths();if(e){var t=e.paths,r=e.width,n=e.height,i=t.reduce((function(e,t){return e+t.hash}),"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,t,i,{x:0,y:0},r,n,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}},{key:"render",value:function(){if(this.ghcTextureId){var e=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);e&&(this.sprite=new Ld,this.sprite.texture=e.texture,this.sprite.pivot.x=e.pivot.x,this.sprite.scale.x=e.scale,this.sprite.scale.y=e.scale)}}},{key:"destroy",value:function(){var e;null===(e=this.sprite)||void 0===e||e.destroy({texture:!0})}}]),e}(),im=134217729;function om(e,t,r,n,i){var o,a,s,u,l=t[0],c=n[0],h=0,d=0;c>l==c>-l?(o=l,l=t[++h]):(o=c,c=n[++d]);var f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=t[++h]):(s=o-((a=c+o)-c),c=n[++d]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=t[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++d]),o=a,0!==s&&(i[f++]=s);for(;h0!=s>0)return u;var l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,r,n,i,o,a){var s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w,S,T,M=e-i,k=r-i,E=t-o,I=n-o;h=(x=(p=M-(f=(d=im*M)-(d-M)))*(m=I-(v=(d=im*I)-(d-I)))-((b=M*I)-f*v-p*v-f*m))-(g=x-(S=(p=E-(f=(d=im*E)-(d-E)))*(m=k-(v=(d=im*k)-(d-k)))-((w=E*k)-f*v-p*v-f*m))),sm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),sm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,sm[2]=y-(T-h)+(g-h),sm[3]=T;var A=function(e,t){for(var r=t[0],n=1;n=C||-A>=C)return A;if(s=e-(M+(h=e-M))+(h-i),l=r-(k+(h=r-k))+(h-i),u=t-(E+(h=t-E))+(h-o),c=n-(I+(h=n-I))+(h-o),0===s&&0===u&&0===l&&0===c)return A;if(C=11093356479670487e-47*a+33306690738754706e-32*Math.abs(A),(A+=M*c+I*s-(E*l+k*u))>=C||-A>=C)return A;h=(x=(p=s-(f=(d=im*s)-(d-s)))*(m=I-(v=(d=im*I)-(d-I)))-((b=s*I)-f*v-p*v-f*m))-(g=x-(S=(p=u-(f=(d=im*u)-(d-u)))*(m=k-(v=(d=im*k)-(d-k)))-((w=u*k)-f*v-p*v-f*m))),hm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),hm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,hm[2]=y-(T-h)+(g-h),hm[3]=T;var P=om(4,sm,4,hm,um);h=(x=(p=M-(f=(d=im*M)-(d-M)))*(m=c-(v=(d=im*c)-(d-c)))-((b=M*c)-f*v-p*v-f*m))-(g=x-(S=(p=E-(f=(d=im*E)-(d-E)))*(m=l-(v=(d=im*l)-(d-l)))-((w=E*l)-f*v-p*v-f*m))),hm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),hm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,hm[2]=y-(T-h)+(g-h),hm[3]=T;var N=om(P,um,4,hm,lm);h=(x=(p=s-(f=(d=im*s)-(d-s)))*(m=c-(v=(d=im*c)-(d-c)))-((b=s*c)-f*v-p*v-f*m))-(g=x-(S=(p=u-(f=(d=im*u)-(d-u)))*(m=l-(v=(d=im*l)-(d-l)))-((w=u*l)-f*v-p*v-f*m))),hm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),hm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,hm[2]=y-(T-h)+(g-h),hm[3]=T;var O=om(N,lm,4,hm,cm);return cm[O-1]}(e,t,r,n,i,o,l)}var fm=Math.pow(2,-52),pm=new Uint32Array(512),vm=function(){function e(t){x(this,e);var r=t.length>>1;if(r>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;var n=Math.max(2*r-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(r)),this._hullPrev=new Uint32Array(r),this._hullNext=new Uint32Array(r),this._hullTri=new Uint32Array(r),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(r),this._dists=new Float64Array(r),this.update()}return S(e,null,[{key:"from",value:function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xm,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wm,i=t.length,o=new Float64Array(2*i),a=0;a>1,a=1/0,s=1/0,u=-1/0,l=-1/0,c=0;cu&&(u=h),d>l&&(l=d),this._ids[c]=c}for(var f,p,v,m=(a+u)/2,g=(s+l)/2,y=1/0,_=0;_0&&(p=S,y=T)}for(var M=e[2*p],k=e[2*p+1],E=1/0,I=0;IL&&(O[R++]=j,L=this._dists[j])}return this.hull=O.subarray(0,R),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(dm(x,w,M,k,C,P)<0){var z=p,B=M,U=k;p=v,M=C,k=P,v=z,C=B,P=U}var F=function(e,t,r,n,i,o){var a=r-e,s=n-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*h)*d,y:t+(a*h-u*c)*d}}(x,w,M,k,C,P);this._cx=F.x,this._cy=F.y;for(var W=0;W0&&Math.abs(X-V)<=fm&&Math.abs(q-H)<=fm)&&(V=X,H=q,$!==f&&$!==p&&$!==v)){for(var Q=0,Z=0,K=this._hashKey(X,q);Z=0;)if((ee=J)===Q){ee=-1;break}if(-1!==ee){var te=this._addTriangle(ee,$,r[ee],-1,-1,n[ee]);n[$]=this._legalize(te+2),n[ee]=te,G++;for(var re=r[ee];J=r[re],dm(X,q,e[2*re],e[2*re+1],e[2*J],e[2*J+1])<0;)te=this._addTriangle(re,$,J,n[$],-1,n[re]),n[$]=this._legalize(te+2),r[re]=re,G--,re=J;if(ee===Q)for(;dm(X,q,e[2*(J=t[ee])],e[2*J+1],e[2*ee],e[2*ee+1])<0;)te=this._addTriangle(J,$,ee,-1,n[ee],n[J]),this._legalize(te+2),n[J]=te,r[ee]=ee,G--,ee=J;this._hullStart=t[$]=ee,r[ee]=t[re]=$,r[$]=re,i[this._hashKey(X,q)]=$,i[this._hashKey(e[2*ee],e[2*ee+1])]=ee}}}this.hull=new Uint32Array(G);for(var ne=0,ie=this._hullStart;ne0?3-i:1+i)/4*this._hashSize))%this._hashSize;var r,n,i}},{key:"_legalize",value:function(e){for(var t=this._triangles,r=this._halfedges,n=this.coords,i=0,o=0;;){var a=r[e],s=e-e%3;if(o=s+(e+2)%3,-1!==a){var u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,h=t[o],d=t[e],f=t[l],p=t[c];if(gm(n[2*h],n[2*h+1],n[2*d],n[2*d+1],n[2*f],n[2*f+1],n[2*p],n[2*p+1])){t[e]=p,t[a]=h;var v=r[c];if(-1===v){var m=this._hullStart;do{if(this._hullTri[m]===c){this._hullTri[m]=e;break}m=this._hullPrev[m]}while(m!==this._hullStart)}this._link(e,v),this._link(a,r[o]),this._link(o,c);var g=u+(a+1)%3;i=r&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{var u=r+1,l=n;bm(e,r+n>>1,u),t[e[r]]>t[e[n]]&&bm(e,r,n),t[e[u]]>t[e[n]]&&bm(e,u,n),t[e[r]]>t[e[u]]&&bm(e,r,u);for(var c=e[u],h=t[c];;){do{u++}while(t[e[u]]h);if(l=l-r?(_m(e,t,u,n),_m(e,t,r,l-1)):(_m(e,t,r,l-1),_m(e,t,u,n))}}function bm(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function xm(e){return e[0]}function wm(e){return e[1]}function Sm(e,t,r){var n=t/2,i=r/2,o=[{x:-n,y:i},{x:-n,y:-i},{x:n,y:i},{x:n,y:-i}],s=[Uv.fromPointSlope({x:-n,y:0},Math.PI/2),Uv.fromPointSlope({x:0,y:i},0),Uv.fromPointSlope({x:n,y:0},Math.PI/2),Uv.fromPointSlope({x:0,y:-i},0)],u=[],l=e.stopList.slice(1,e.stopList.length-1).map((function(o){for(var l,c,h,d=2*Math.PI,f=null!==(c=null===(l=e.line)||void 0===l?void 0:l.ang)&&void 0!==c?c:0;f>d;)f-=d;for(;f<0;)f+=d;var p={x:0,y:0};zv(f,Math.PI/2)?(p.x=0,p.y=r/2-o.pos*r):zv(f,0)?(p.x=o.pos*t-t/2,p.y=0):(p.x=o.pos*t-t/2,p.y=r/2-o.pos*r),f>Math.PI/2&&f<=Math.PI&&(p.x*=-1),f>Math.PI&&f<=2*Math.PI&&(p.y*=-1);var v=Uv.fromPointSlope(p,Math.PI/2-((null===(h=e.line)||void 0===h?void 0:h.ang)||0)),m=s.map((function(e){return v.crossPoint(e)})).filter((function(e){return e&&e.x<=n&&e.x>=-n&&e.y<=i&&e.y>=-i})).map((function(e){return{point:e,color:o.color}})).sort((function(e,t){return t.point.y-e.point.y}));u.push.apply(u,a(m));for(var g=Math.abs(m[1].point.x-m[0].point.x)/10,y=20;y--;){var _=y%2==0?1:-1,b=p.x+_*g,x=v.resolveY(b);b<=n&&b>=-n&&x<=i&&x>=-i&&u.push({point:{x:b,y:x},color:o.color}),g+=g}return v})),c=[],h=[];e:for(var d=0;d= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0) * texColor.a;\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0) * texColor.a;\n }\n}\n",alphaModFix:"\nvec4 transform(vec4 texColor, float arg) {\n return texColor * arg;\n}\n",alphaBiLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < arg) {\n result.a = 0.0;\n } else {\n result.a = 1.0;\n }\n return result;\n}\n",alphaCeiling:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a > 0.0) {\n result.a = 1.0;\n }\n return result;\n}\n",alphaFloor:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < 1.0) {\n result.a = 0.0;\n }\n return result;\n}\n",grayscl:"\nvec4 transform(vec4 texColor, float arg) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n return vec4(avg, avg, avg, texColor.a);\n}\n"},Em=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=km[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Mm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n")),{arg:n})}return r}($l.k),Im=[Tm],Am={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n",changeBulletColor:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n if (texColor.a == 0.0) {\n return texColor;\n } else {\n return arg2;\n }\n}\n",duotone:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n // float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n // vec3 hsl = rgb2hsl(vec3(avg, avg, avg));\n // vec3 result = arg2.rgb * hsl.z + arg1.rgb * (1.0 - hsl.z);\n // return vec4(result * texColor.a, texColor.a);\n \n float brightness = texColor.r * 0.3 + texColor.g * 0.59 + texColor.b * 0.11;\n \n return vec4(\n (arg1.r + brightness * (arg2.r - arg1.r)) * texColor.a,\n (arg1.g + brightness * (arg2.g - arg1.g)) * texColor.a,\n (arg1.b + brightness * (arg2.b - arg1.b)) * texColor.a,\n texColor.a\n );\n}\n"},Cm=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Am[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n".concat(Im.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:Float32Array.from(n),arg2:Float32Array.from(i)})}return r}($l.k),Pm=[Tm],Nm={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n vec3 rgb = texColor.rgb / texColor.a;\n\n // 对比度\n highp float C = arg2 * 255.0;\n highp float F = (259.0 * (255.0 + C)) / (255.0 * (259.0 - C));\n rgb.rgb = F * (rgb.rgb - 0.5) + 0.5;\n\n // 亮度\n rgb.rgb += arg1 * rgb.rgb;\n\n rgb.rgb *= texColor.a;\n return vec4(rgb, texColor.a);\n}\n"},Om=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Nm[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n".concat(Pm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:n,arg2:i})}return r}($l.k),Rm=[Tm],Dm={alphaInv:"\nvec4 transform(vec4 texColor, vec4 arg1) {\n float alpha = 1.0 - texColor.a;\n arg1.rgb = arg1.rgb * alpha;\n arg1.a = alpha;\n return arg1;\n}\n"},Lm=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=Dm[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform sampler2D uSampler;\n\n".concat(Rm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1);\n}\n")),{arg1:Float32Array.from(n)})}return r}($l.k);function jm(e,t){var r=[];return e.forEach((function(e){var n=((null==t?void 0:t.filter)||[]).indexOf(e.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(e.type)>=0&&n)r.push(new Em(e.type,e.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(e.type)>=0&&n){var i=$v(e.args[0]),o=$v(e.args[1]);r.push(new Cm(e.type,i,o))}else if("lum"===e.type&&n)r.push(new Om(e.type,e.args[0],e.args[1]));else if("alphaInv"===e.type&&n){var a=$v(e.args[0]);r.push(new Lm(e.type,a))}})),r}var zm=function(){function e(t,r,n,i,o){x(this,e),this.ctx=t,this.fillStyle=r,this.width=n,this.height=i,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=xv()("".concat(JSON.stringify(r)).concat(Math.ceil(n)).concat(Math.ceil(i)))}return S(e,[{key:"createDisplayObject",value:function(){var e;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){var t=new Ld;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType){var r=new Ld,n=function(e,t,r){var n,i=new Dl.b;if(e.stopList.sort((function(e,t){return e.pos-t.pos})),!e.stopList.find((function(e){return 0===e.pos}))){var o=e.stopList[0];e.stopList.unshift({pos:0,color:o.color})}if(!e.stopList.find((function(e){return 1===e.pos}))){var s=e.stopList[e.stopList.length-1];e.stopList.push({pos:1,color:s.color})}var u=function(e){for(var t=[],r=0,n=e.length;r0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(h.filters=jm(u,this.ctx.featureList)),this.config.fillFloat){var d=this.config.fillFloat.fillRect,f=d.l,p=d.t,v=d.r,m=d.b,g=this.width*(1-f-v),y=this.height*(1-p-m),_=null!==(e=this.config.shapeRotation)&&void 0!==e?e:0,b=new Nd;b.drawRect(0,0,g,y),b.pivot.x=g/2,b.pivot.y=y/2,b.rotation=_;var x=b.getBounds(),w=x.width,S=x.height;h.width=w,h.height=S,h.anchor.x=.5,h.anchor.y=.5,h.rotation=-1*_,h.name="math-texture",0===_?(h.position.x=w/2+f*this.width,h.position.y=S/2+p*this.height):(h.position.x=this.width/2,h.position.y=this.height/2)}else h.width=this.width,h.height=this.height,c.rotate&&(h.position.x=this.width/2,h.position.y=this.height/2,h.anchor.x=.5,h.anchor.y=.5,h.rotation=c.rotate/180*Math.PI);return h}}else if("gifFill"===this.fillStyle.fillType){var T=this.fillStyle,M=T.src,k=T.delays,E=T.filters,I=this.ctx.spriteTexture.getGifFrames(M).map((function(e,t){return{texture:e,time:k[t]||20}})),A=new jp(I,!0);A.name=uv(),A.width=this.width,A.height=this.height,E.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(A.filters=jm(E,this.ctx.featureList));var C=this.fillStyle.loop,P=1;return A.onLoop=function(){P+=1,C>0&&P>C&&A.gotoAndStop(A.totalFrames)},A}return null}},{key:"isSolidFill",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)}},{key:"getSolidFillColor",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)?this.fillStyle.color:"#000000"}},{key:"getClonedDisplayObject",value:function(){var e=this.createDisplayObject();return this.clonedObjects.push(e),e}},{key:"destroy",value:function(){var e;null===(e=this._displayObject)||void 0===e||e.destroy(),this._displayObject=null,this.clonedObjects.forEach((function(e){null==e||e.destroy()})),this.clonedObjects=[]}},{key:"displayObject",get:function(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject},set:function(e){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=e}},{key:"hasFill",get:function(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}}]),e}(),Bm=function(e){p(r,e);var t=m(r);function r(){return x(this,r),t.apply(this,arguments)}return r}($l.k),Um=r(113),Fm=r.n(Um),Wm=r(114),Gm=r.n(Wm),Vm=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,Fm.a,Gm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:$v(e.color),uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:e.rad/2,uSdfPosition:new Float32Array([0,0])})).priority=3,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){var t=Math.ceil(this.json.rad),r=Math.ceil(e.width+2*t),n=Math.ceil(e.height+2*t);return new jl.j(e.x-t,e.y-t,r,n)}},{key:"sdfBox",value:function(e,t){var r=Math.ceil(this.json.rad),n=Math.ceil(e+2*r),i=Math.ceil(t+2*r);return new jl.j(r,r,n,i)}}]),r}(Bm),Hm=r(19),Ym=r.n(Hm),$m=r(115),Xm=r.n($m),qm=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,Ym.a,Xm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:e.rad,uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:1})).priority=2,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(e,t){return new jl.j(0,0,e,t)}}]),r}(Bm),Qm=function e(){x(this,e)},Zm=r(116),Km=r.n(Zm),Jm=function(e){p(r,e);var t=m(r);function r(e){return x(this,r),t.call(this,Ym.a,Km.a,{uColor:$v(e)})}return r}($l.k),eg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).order=1,o.outputTexture=$l.t.WHITE,o.frameTextures=[],o.json=e,o.effectContainer=n,o.outputSprite=new Ld,o.targetScale=i,o.outputSprite.scale.x=o.json.sx,o.outputSprite.scale.y=o.json.sy,o.outputSprite.skew.x=(o.targetScale.x>0?1:-1)*o.json.kx,o.outputSprite.skew.y=(o.targetScale.y>0?1:-1)*o.json.ky,o.outputSprite.filters=[new Bp.BlurFilter(o.json.blurRad/2,4),new Jm(o.json.color)],o}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];if(t){var r=this.effectContainer.getBounds(),n=(this.effectContainer.width-t.width)/2,i=(this.effectContainer.height-t.height)/2,o=new jl.g(r.x,r.y),a=new jl.g(r.x,r.y);switch(this.json.align){case"tl":a.x=r.x,a.y=r.y;break;case"t":a.x=r.x+r.width/2,a.y=r.y,o.x+=r.width/2;break;case"tr":a.x=r.x+r.width,a.y=r.y,o.x+=r.width;break;case"l":a.x=r.x,a.y=r.y+r.height/2,o.y+=r.height/2;break;case"ctr":a.x=r.x+r.width/2,a.y=r.y+r.height/2,o.x+=r.width/2,o.y+=r.height/2;break;case"r":a.x=r.x+r.width,a.y=r.y+r.height/2,o.x+=r.width,o.y+=r.height/2;break;case"bl":a.x=r.x,a.y=r.y+r.height,o.y+=r.height;break;case"b":a.x=r.x+r.width/2,a.y=r.y+r.height,o.x+=r.width/2,o.y+=r.height;break;case"br":a.x=r.x+r.width,a.y=r.y+r.height,o.x+=r.width,o.y+=r.height}var s=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=s.x,this.outputSprite.pivot.y=s.y;var u=new jl.g(this.json.dist,0),l=new jl.d;l.rotate(this.json.dir),l.translate(o.x+n,o.y+i),l.apply({x:u.x,y:u.y},u);var c=this.effectContainer.toLocal(u);this.outputSprite.position.x=c.x,this.outputSprite.position.y=c.y,this.outputSprite.texture=t}}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){}}]),r}(Qm),tg=r(117),rg=r.n(tg),ng=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),i=t.call(this,Ym.a,rg.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:n}),console.log(y(i)),i}return r}($l.k),ig=function(e){p(r,e);var t=m(r);function r(e,n,i,o,a){var s;x(this,r),(s=t.call(this)).order=2,s.outputSprite=new Ld,s.outputTexture=$l.t.WHITE,s.frameTextures=[],s.json=e,s.shapeScaleX=o,s.effectContainer=n,s.rotation=i,s.ctx=a,s.outputSprite.anchor.x=.5,s.outputSprite.anchor.y=.5;var u=s.effectContainer.getBounds();return s.outputSprite.filters=[new Bp.BlurFilter(s.json.blurRad/2,4),new ng(s.json,u.height)],s.outputSprite.alpha=.5,s.outputSprite.rotation=-1===s.shapeScaleX?Math.PI+2*s.rotation:Math.PI-2*s.rotation,s.outputSprite.scale.x=-1,s}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];t&&(this.outputSprite.texture=t)}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){var r=this.effectContainer.getBounds(),n=new jl.g(r.x+r.width/2,r.y+r.height/2),i=new jl.g(n.x,n.y+r.height+this.json.dist),o=this.effectContainer.toLocal(i);this.outputSprite.position.x=o.x+e,this.outputSprite.position.y=o.y+t}}]),r}(Qm),og=r(118),ag=r.n(og),sg=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,Ym.a,ag.a,{})).priority=1,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),r}(Bm),ug=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},lg=function(e){p(r,e);var t=m(r);function r(e,n,i,o,s,u){var l;x(this,r),(l=t.call(this)).effects=[],l.attachs=[],l.frames=new Map,l._targetContainer=new Dl.b,l.frameCount=1,l.ctx=o,l.originWidth=e.width,l.originHeight=e.height,l.cacheKey=i,l.sourceSprite=new Ld;var c,h=M(n);try{for(h.s();!(c=h.n()).done;){var d=c.value;switch(d.type){case"innerShadow":l.effects.push(new sg(d));break;case"softEdge":l.effects.push(new qm(d));break;case"glow":l.effects.push(new Vm(d));break;case"reflection":l.attachs.push(new ig(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new eg(d,e,u))}}}catch(e){h.e(e)}finally{h.f()}l.effects=l.effects.sort((function(e,t){return e.priority-t.priority})),l.attachs=l.attachs.sort((function(e,t){return e.order-t.order}));var f,p=M(l.attachs);try{for(p.s();!(f=p.n()).done;){var v=f.value;l._targetContainer.addChild(v.outputSprite)}}catch(e){p.e(e)}finally{p.f()}l.sourceSprite.name="source-sprite";var m=new jl.j(0,0,l.originWidth,l.originHeight),g=l.effects.map((function(e){return e.filterAreaJustify(m)})),y=g.map((function(e){return e.x})),_=g.map((function(e){return e.y})),b=g.map((function(e){return e.width})),w=g.map((function(e){return e.height}));return l.filterArea=new jl.j(Math.min.apply(Math,a(y).concat([0])),Math.min.apply(Math,a(_).concat([0])),Math.max.apply(Math,a(b).concat([l.originWidth])),Math.max.apply(Math,a(w).concat([l.originHeight]))),l.sourceSprite.filters=l.effects,l.sourceSprite.filterArea=new jl.j(0,0,l.filterArea.width,l.filterArea.height),l._targetSprite=new Ld,l._targetSprite.name="effect-sprite",l._targetContainer.sortableChildren=!0,l._targetSprite.zIndex=999,l._targetContainer.addChild(l._targetSprite),l}return S(r,[{key:"getSdfTexture",value:function(e,t){return ug(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n="".concat(this.cacheKey,"_").concat(e),i=this.effects.map((function(e){return{sdfRect:e.sdfBox(t.width,t.height)}})).reduce((function(e,t){return t.sdfRect?(e.width5&&(t.dist=5),b[e]})),o.ctx.slideScopeEventHub.once("slide-render",(function(e){if(o.ctx.slideIndex===e&&o.effectObject){var t=o.getEffectTexture();if(t){var r=t.texture,n=t.offsetX,i=t.offsetY;o.effectObject.setFrameOffset(n,i),o.effectObject.createFrame(1,r)}}}))}return o}return S(r,[{key:"getEffectTexture",value:function(){var e,t=this.json,r=t.lineHeight,n=t.fillLineHeight,i=t.isHorz,o=t.lineWidth,a=this.effectContainer.getLocalBounds(),s=0,u=0,l=M(this.effectContainer.children);try{for(l.s();!(e=l.n()).done;){var c=e.value;c.pivot.x>s&&(s=c.pivot.x),c.pivot.y>u&&(u=c.pivot.y)}}catch(e){l.e(e)}finally{l.f()}var h=new jl.d;h.translate(s,u);var d=$l.p.create({width:i?a.width:o,height:i?Math.max(n,r):a.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:d,transform:h}),{texture:d,offsetX:s,offsetY:u}}},{key:"createStrokeFill",value:function(){var e=this.json,t=e.stroke,r=e.lineWidth,n=e.lineHeight;return new zm(this.ctx,null==t?void 0:t.fill,r,n,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createStrokeGraphics",value:function(){var e=this.json.stroke,t=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[]}:void 0;return new zm(this.ctx,t,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createTextFill",value:function(){var e=this.json,t=e.isHorz,r=e.fill,n=e.lineWidth,i=e.lineHeight,o=e.fillLineHeight;return t?new zm(this.ctx,null==r?void 0:r.fill,n,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new zm(this.ctx,null==r?void 0:r.fill,o,i,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextGraphics",value:function(){var e,t=this.json,r=t.fill,n=t.content,i="#000000";"solidFill"===(null===(e=null==r?void 0:r.fill)||void 0===e?void 0:e.fillType)&&(i=r.fill.color);var o=(null==r?void 0:r.key)?{fillType:"blipFill",src:r.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new zm(this.ctx,o,(null==r?void 0:r.width)||0,(null==r?void 0:r.height)||0,{useFilter:"◾"===n,useSlideBackgroundFill:!1})}},{key:"getIterateEntry",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"updateTransform",value:function(e){var t,n,i,o,a=this.json.isHorz;e.position={x:a&&null!==(n=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:a?0:null!==(o=null===(i=e.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},e.width=a?this.json.width:this.json.lineWidth,e.height=a?this.json.lineHeight:this.json.height,f(b(r.prototype),"updateTransform",this).call(this,e)}},{key:"preRender",value:function(){var e;null===(e=this.underline)||void 0===e||e.preRender()}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.doRender();case 1:case"end":return e.stop()}}),e,this)})))}),"@TextUnitImpl[doRender]"),e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.effectList&&this.effectList.length>0&&(r="".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(null===(t=this.json.fill)||void 0===t?void 0:t.key,"_").concat(this.json.effectIndexList),this.effectObject=new lg(this.effectContainer,this.effectList,r,this.ctx,0,new jl.g(1,1)),this.effectObject.on("ready",(function(){var e;n.effectContainer.visible=!1,n.effectObject.container.zIndex=10,n.container.addChild(n.effectObject.container),null===(e=n.effectObject)||void 0===e||e.updateFrame(1)})));case 1:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"doRender",value:function(){var e=!1,t=this.json,r=t.lineWidth,n=t.lineHeight,i=t.baseLine,o=t.isHorz,a=t.underline,s=t.stroke,u=t.height,l=t.width,h=t.highlightColor,d=t.x,f=t.y,p=t.content,v=t.fillLineHeight,m=t.fill,g=!1!==this.json.needFill;if(m&&m.fill&&"solidFill"!==m.fill.fillType&&(g=!0),h){var y=new Nd,_=c(Yv(h),2),b=_[0],x=_[1];y.beginFill(b,x),y.drawRect(0,0,o?l:r,o?n:u),y.endFill(),this.textureContainer.addChild(y)}if(this.textGraphics.displayObject){var w=this.textGraphics.displayObject;if(o&&(w.position.y=f>0?f:0),g){var S=this.textFill.displayObject;if(S)S.mask=w,S.addChild(w),S.position.x=-d,w.position.x+=d,e=!0,this.textureContainer.addChild(S);else if(this.textFill.isSolidFill()){var T=new Qv;T.color=this.textFill.getSolidFillColor(),w.filters=[T],e=!0,this.textureContainer.addChild(w)}}else this.textureContainer.addChild(w)}if(this.strokeGraphics.displayObject){var M=this.strokeGraphics.displayObject;if(g){var k=this.strokeFill.displayObject;if(k)k.mask=M,k.addChild(M),o?k.position.y=f>0?f:0:k.position.x=d,this.textureContainer.addChild(k);else if(this.strokeFill.isSolidFill()){o?M.position.y=Math.max(f,0):M.position.x=d;var E=new Qv;E.color=this.strokeFill.getSolidFillColor(),M.filters=[E],e=!0,this.textureContainer.addChild(M)}}else o?M.position.y=f>0?f:0:M.position.x=d,this.textureContainer.addChild(M);var I=s&&m?(s.width-(null==m?void 0:m.width))/4:0;M.position.x-=I}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=a?a-n/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);var A=this.textFill.getClonedDisplayObject();A?(A.mask=this.underline.sprite,A.addChild(this.underline.sprite),this.textureContainer.addChild(A)):this.textureContainer.addChild(this.underline.sprite)}if(e){var C=$l.p.create({width:o?l:r,height:o?Math.max(v,n):u,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:C}),this.cacheSprite.texture=C,o&&f<0&&(this.cacheSprite.position.y=f),this.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.addChild(this.textureContainer);this.container.name=p}},{key:"destroy",value:function(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}]),r}(rm),dg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},fg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n,i)).units=[],o.isHorz=!0,o.hyperLinkMap=new Map,o.hyperLinkContainerMap=new Map,o.effectList=[],i.effectList&&(o.effectList=i.effectList),o}return S(r,[{key:"getIterateElements",value:function(){return this.units}},{key:"getIterateEntry",value:function(e,t,r){return this.units[t]?this.units[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createUnits",value:function(e,t,r,n){for(var i=this,o=function(o,a){n.addSubMTask((function(){return dg(i,void 0,void 0,regeneratorRuntime.mark((function n(){var i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.textUnits[o],a=this.json,s=a.height,u=a.width,l=a.fillHeight,c=a.baseline,h=a.y,d=a.underline,(f=new hg(Object.assign(Object.assign({},i),{lineHeight:s,lineWidth:u,baseLine:c-h,underline:d,fillLineHeight:l||s,isHorz:this.isHorz,shapeId:e,paragraphIndex:t,lineIndex:r,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).preRender(),this.units.push(f),(i.hyperlink||i.hlinkHover)&&(p=new jv(f.container,this.ctx),i.hyperlink&&p.addAction(i.hyperlink,"click"),i.hlinkHover&&p.addAction(i.hlinkHover,"hover"),this.container.sortableChildren=!0);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextLineImpl[createUnits]")},a=0,s=this.json.textUnits.length;a0)return this.iterateElements;var e=this.lines.reduce((function(e,t){return e.concat(t.getIterateElements())}),[]);return this.iterateElements=e,e}},{key:"getIterateEntry",value:function(e,t,r){var n=this.getIterateElements();return n[t]?n[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createLines",value:function(e,t,r){for(var n=this,i=function(i,o){r.addSubMTask((function(){return pg(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=this.json.lines[i],(a=new fg(o,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).isHorz=this.isHorz,a.container.name="line-"+i,a.createUnits(e,t,i,r),this.lines.push(a);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextParagraphImpl[createLines]")},o=0,a=this.json.lines.length;o90&&o<270||o<-90&&o>-270)&&(n=-n),i=-a*n}return{x:n,y:i}}((i=-i)/Math.PI*180,r,n),s=e.x-a.x,u=e.y-a.y;return{centerX:s/9525*t.x,centerY:u/9525*t.y,rx:r/9525*t.x,ry:n/9525*t.y,st:-i,end:-i+o,aClockWise:o<0}}function gg(e){for(var t=new os,r=e.scale,n={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=bg(s.paths[0].path,this.json.width,this.json.height,i,o),s.paths.unshift(Object.assign(Object.assign({},s.paths[0]),{path:d}))),f=function(e,t,r,n){if(!_g[r])return null;var i=_g[r].top(gg(t)),o=_g[r].bottom(gg(e));if(i.length!==o.length)return null;for(var a=Math.min(i.length,o.length),s=1/(a-1),u=[],l=[],c=new Array(2*a).fill("").map((function(e,t){return t})),h=0;h0&&(this.textColorFilter.color=e)},get:function(){return this.textColorFilter.color}},{key:"on",get:function(){var e;return(null!==(e=this.container.filters)&&void 0!==e?e:[]).length>0?"true":"false"},set:function(e){var t;"true"===e?(null!==(t=this.container.filters)&&void 0!==t?t:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}}]),e}(),Sg=function(){function e(t){x(this,e),this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}return S(e,[{key:"setPivot",value:function(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;default:this.pivot={x:this.width,y:this.height/2}}}},{key:"generatePaths",value:function(){this.hash="arrow-"+xv()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}},{key:"getUnitPath",value:function(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}},{key:"setScaleFromLineWidth",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}},{key:"setScaleFromSize",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}]),e}(),Tg=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.id=t,this.ctx=r,this.paths=n,this.hash=i,this.nept=o,this.width=a,this.height=s,this.lineStyle=u,this.shouldFill=l,this.bgColor=c,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}return S(e,[{key:"pointDis",value:function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}},{key:"isPoint",value:function(e){return Number.isNaN(Number(e.x))||Number.isNaN(Number(e.y))}},{key:"isSquare",value:function(e,t){var r=this;if("MLLLC"!==e.join("")&&"MLLLCC"!==e.join(""))return!1;var n=t.filter((function(e){return!r.isPoint(e)}));if(4!==n.length)return!1;var i,o=Math.min.apply(Math,a(n.map((function(e){return e.x})))),s=Math.min.apply(Math,a(n.map((function(e){return e.y})))),u=Math.max.apply(Math,a(n.map((function(e){return e.x})))),l=Math.max.apply(Math,a(n.map((function(e){return e.y})))),c=M(n);try{for(c.s();!(i=c.n()).done;){var h=i.value;if(h.x!==o&&h.x!==u||h.y!==s&&h.y!==l)return!1}}catch(e){c.e(e)}finally{c.f()}return!0}},{key:"rectangleDetect",value:function(e){if(1!==e.length)return!1;var t=e[0].path.trim().split(" ");if(10!==t.length)return!1;for(var r=[],n=[],i=0;ir&&(r=o.pivot.x),o.pivot.y>n&&(n=o.pivot.y)}}catch(e){i.e(e)}finally{i.f()}var a=new jl.d;if(a.translate(r,n),0===this.effectContainer.children.length)return null;var s=$l.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:s,transform:a}),{texture:s,offsetX:r,offsetY:n}}},{key:"createStrokeGraphics",value:function(){var e,t,r,n,i=this.json,o=i.id,a=i.geometry,s=i.lineStyle,u=(null==a?void 0:a.lineTransform)||kg,l=u.width,c=u.height,h=u.pivot,d=l||this.json.width,f=c||this.json.height,p="solidFill"===(null===(e=null==s?void 0:s.fill)||void 0===e?void 0:e.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(t=s.fill)||void 0===t?void 0:t.fillType)?new Tg(o+"-path-graphics",this.ctx,null!==(r=null==a?void 0:a.paths)&&void 0!==r?r:[],null!==(n=null==a?void 0:a.hash)&&void 0!==n?n:"",h||{x:0,y:0},d,f,s,!1,null,p):null}},{key:"createStrokeFill",value:function(){var e=c(this.calculateFillObjectOffset(),2),t=e[0],r=e[1],n=this.json,i=n.geometry,o=n.lineStyle,a=n.width,s=n.height,u=(null==i?void 0:i.lineTransform)||kg,l=Sv()(null==o?void 0:o.width)?o.width:1;return new zm(this.ctx,null==o?void 0:o.fill,(u.width||a)+l+t,Math.max((u.height||s)+l,r),{useFilter:!0,useSlideBackgroundFill:!1})}},{key:"createBackgroundGraphics",value:function(){var e,t=this.json,r=t.geometry,n=t.lineStyle,i=t.fillStyle,o=t.id,a=(null==r?void 0:r.lineTransform)||kg,s=a.width,u=a.height,l=a.pivot,c=s||this.json.width,h=u||this.json.height,d="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new Tg(o+"-bg-graphics",this.ctx,null!==(e=null==r?void 0:r.paths)&&void 0!==e?e:[],(null==r?void 0:r.hash)||"",l||{x:0,y:0},c,h,n,!0,d,null):null}},{key:"createBackgroundFill",value:function(){var e,t,r,n,i=this.json,o=i.fillStyle,a=i.width,s=i.height,u=i.lineStyle,l=i.geometry,c=(null==l?void 0:l.fillTransform)||kg,h={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},d=this.useGroupFill&&(null===(e=this.option.groupSize)||void 0===e?void 0:e.w)?this.option.groupSize.w:c.width||a,f=this.useGroupFill&&(null===(t=this.option.groupSize)||void 0===t?void 0:t.h)?this.option.groupSize.h:c.height||s;return new zm(this.ctx,o,d+(null!==(r=null==u?void 0:u.width)&&void 0!==r?r:0),f+(null!==(n=null==u?void 0:u.width)&&void 0!==n?n:0),h)}},{key:"createBackground",value:function(){var e,t,r,n,i,o,a,s,u,l,c,h,d=(null===(e=this.json.geometry)||void 0===e?void 0:e.fillTransform)||kg,f=d.pivot,p=d.width,v=d.height,m=this.backgroundFill.displayObject;m?(this.json.useBgFill&&(null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)?(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,m.pivot.x=(null===(n=this.json.position)||void 0===n?void 0:n.x)||0,m.pivot.y=(null===(i=this.json.position)||void 0===i?void 0:i.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(m.height=v||this.designHeight,m.width=p||this.designWidth,m instanceof jp&&m.play(),(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(m.width,m.height))&&(m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(m.width,m.height))&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(m.x=f.x,m.y=f.y),this.useGroupFill&&(m.x-=null!==(l=null===(u=this.json.position)||void 0===u?void 0:u.x)&&void 0!==l?l:0,m.y-=null!==(h=null===(c=this.json.position)||void 0===c?void 0:c.y)&&void 0!==h?h:0),this.effectContainer.addChild(m)):this.backgroundFill.hasFill&&(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}},{key:"createPathFill",value:function(){var e,t,r,n=this.strokeFill.displayObject,i=null===(e=this.strokeGraphics)||void 0===e?void 0:e.displayObject,o=c(this.calculateFillObjectOffset(),2),a=o[0],s=o[1];n?((null===(t=this.strokeGraphics)||void 0===t?void 0:t.isNeedMask(n.width,n.height))&&i&&(this.needCacheAsBitMap=!0,n.pivot.x=i.pivot.x,n.pivot.y=i.pivot.y,i.pivot.x=0,i.pivot.y=0,n.mask=i,n.addChild(i),n.position.x=-a/2,n.position.y=-s/2,i.position.x=a/2,i.position.y=s/2),this.effectContainer.addChild(n)):this.strokeFill.hasFill&&(null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}},{key:"createFilledPathMask",value:function(){var e,t,r,n,i=(null===(t=null===(e=this.json.geometry)||void 0===e?void 0:e.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],o=M(i);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.ctx.graphicsTexture.getGraphicsData(a.id);if(s){var u=new Ld(s.texture);u.pivot.x=s.pivot.x,u.pivot.y=s.pivot.y,u.scale.x=s.scale,u.scale.y=s.scale;var l=this.backgroundFill.getClonedDisplayObject(),c=null===(r=this.backgroundGraphics)||void 0===r?void 0:r.getClonedDisplayObject(),h=l||c;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=u,h.filters=[tm[a.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(h),this.effectContainer.addChild(u))}}}catch(e){o.e(e)}finally{o.f()}}},{key:"createArrow",value:function(){var e=this;this.arrowList.length&&this.arrowList.forEach((function(t){var r,n=e.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(n){var i=n.texture,o=new Ld(i);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,o.scale.x=n.scale,o.scale.y=n.scale,null===(r=e.backgroundGraphics)||void 0===r||r.addArrows(o)}}))}},{key:"generateArrowList",value:function(){var e,t,r=this,n=this.json,i=n.lineArrowList,o=n.lineStyle,a=n.id,s="solidFill"===(null===(e=null==o?void 0:o.fill)||void 0===e?void 0:e.fillType)?o.fill.color:null;null===(t=i||[])||void 0===t||t.forEach((function(e,t){var n,i,u,l,c,h,d,f,p=new Sg(Object.assign(Object.assign({},e),{position:{x:e.position.x-(null!==(u=null===(i=null===(n=r.json.geometry)||void 0===n?void 0:n.lineTransform)||void 0===i?void 0:i.pivot.x)&&void 0!==u?u:0),y:e.position.y-(null!==(h=null===(c=null===(l=r.json.geometry)||void 0===l?void 0:l.lineTransform)||void 0===c?void 0:c.pivot.y)&&void 0!==h?h:0)},fillStyle:null==o?void 0:o.fill,lineWidth:null!==(d=null==o?void 0:o.width)&&void 0!==d?d:0}));p.graphicsId="".concat(a,"-arrow-").concat(t,"-graphics"),p.textureId="".concat(a,"-arrow-").concat(t,"-fill"),r.ctx.graphicsTexture.addGraphics(p.graphicsId,null!==(f=p.paths)&&void 0!==f?f:[],p.hash,{x:0,y:0},p.width,p.height,void 0,r.ctx.objectPoolGroup,!0,s,null),r.arrowList.push(p)}))}},{key:"calculateFillObjectOffset",value:function(){var e=0,t=0;return this.arrowList.length&&(e=this.arrowList.reduce((function(e,t){return Math.max(e,t.width)}),0),t=this.arrowList.reduce((function(e,t){return Math.max(e,t.height)}),0)),[e,t]}},{key:"preRender",value:function(e){var t,r,n,i=this,o=this.json,a=o.lineStyle,s=o.geometry,u=(null==s?void 0:s.lineTransform)||kg,l=u.width,c=u.height,h=l||this.json.width,d=c||this.json.height,f=(null===(t=null==s?void 0:s.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],p="solidFill"===(null===(r=null==a?void 0:a.fill)||void 0===r?void 0:r.fillType)?a.fill.color:null;e.addSubMTask((function(){return Mg(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=M(f);try{for(t.s();!(r=t.n()).done;)n=r.value,this.ctx.graphicsTexture.addGraphics(n.id,[n],n.hash,((null==s?void 0:s.lineTransform)||kg).pivot,h,d,a,this.ctx.objectPoolGroup,!0,null,p)}catch(e){t.e(e)}finally{t.f()}case 2:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[addGraphics]"),null===(n=this.text)||void 0===n||n.createParagraphs(this.json.id,e)}},{key:"subClassRender",value:function(){return Mg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return Mg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(r=this.backgroundGraphics)||void 0===r||r.render(),this.createBackground(),e.next=5,this.subClassRender();case 5:this.createFilledPathMask(),this.createPathFill(),this.createArrow();case 8:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[render]"),this.text&&this.text.render(e),e.addSubMTask((function(){return Mg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(r=this.json.textBody)||void 0===r?void 0:r.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(p=null!==(n=this.json.scale)&&void 0!==n?n:{x:1,y:1},v=p.x,m=p.y,this.text.container.scale.x=m<0?-Math.abs(v):Math.abs(v),this.text.container.scale.y=m,this.text.container.position.x=(null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0)+this.text.x,this.text.container.position.y=(null!==(s=null===(a=this.json.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container))):(this.text&&(this.json.textRotation&&(this.text.container.rotation=this.json.textRotation,g=this.text,y=g.width,_=g.height,b=this.text.container.position,x=b.x,w=b.y,this.text.container.pivot.x=y/2,this.text.container.pivot.y=_/2,this.text.container.x=x+y/2,this.text.container.y=w+_/2),Gv()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape&&(S=this.json.rotation||0,this.text.container.rotation=-S,T=this.text.width,this.text.container.position.x=T),this.text.container.zIndex=100,M=null===(u=this.json.effectList)||void 0===u?void 0:u.find((function(e){return"outerShadow"===e.type})),k=null===(l=this.json.effectList)||void 0===l?void 0:l.find((function(e){return"softEdge"===e.type})),E=null===(c=this.json.effectList)||void 0===c?void 0:c.find((function(e){return"glow"===e.type})),M&&1!==M.sx||k||E?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)),this.renderContainer.addChild(this.container)),"background"===this.json.id&&this.ctx.hasBackgroundFillShape&&(I=$l.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)}),this.ctx.renderer.render(this.renderContainer,{renderTexture:I}),this.ctx.bgTexture=I),this.json.effectList&&this.json.effectList.length>0&&(null===(h=this.ctx.featureList)||void 0===h?void 0:h.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new lg(this.effectContainer,this.json.effectList,"".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(this.json.id),this.ctx,this.json.rotation||0,new jl.g((null===(d=this.json.scale)||void 0===d?void 0:d.x)||1,(null===(f=this.json.scale)||void 0===f?void 0:f.y)||1)),function(e){var t,r,n;return"gifFill"===(null===(t=e.fillStyle)||void 0===t?void 0:t.fillType)||"gifFill"===(null===(n=null===(r=e.lineStyle)||void 0===r?void 0:r.fill)||void 0===n?void 0:n.fillType)||!!e.picFill&&"gifFill"===e.picFill.fillType}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",(function(){var e;A.effectContainer.visible=!1,A.effectObject.container.zIndex=10,A.container.addChild(A.effectObject.container),null===(e=A.effectObject)||void 0===e||e.updateFrame(1),A.applyEffectCacheAsBitMap(!0)})));case 3:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r;"gifFill"!==(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)&&(null===(r=this.effectObject)||void 0===r||r.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)})))}},{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"destroy",value:function(){var e,t,r,n;null===(e=this.text)||void 0===e||e.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(t=this.backgroundGraphics)||void 0===t||t.destroy(),this.strokeFill.destroy(),null===(r=this.strokeGraphics)||void 0===r||r.destroy(),this.renderContainer.destroy(),null===(n=this.arrowRenderTexture)||void 0===n||n.destroy(!0),this.arrowList=[],this.effectDisposer()}},{key:"interactiveContainer",get:function(){return this.renderContainer}},{key:"strokeActive",get:function(){var e,t,r,n,i,o,a;return this.strokeFill.displayObject?(null!==(r=null===(t=null===(e=this.strokeFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a,s=this.strokeFill.displayObject;e?s&&(null!==(r=null===(t=s.filters)||void 0===t?void 0:t.indexOf(this.strokeColorFilter))&&void 0!==r?r:-1)<0?s.filters=[this.strokeColorFilter]:(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.strokeGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):s?s.filters=[]:(null===(a=this.strokeGraphics)||void 0===a?void 0:a.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}},{key:"pptColorActive",get:function(){var e,t;return(null!==(t=null===(e=this.renderContainer.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){this.renderContainer.filters=e?[this.pptColorFilter]:[]}},{key:"fillActive",get:function(){var e,t,r,n,i,o,a;return this.backgroundFill.displayObject?(null!==(r=null===(t=null===(e=this.backgroundFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a;e?this.backgroundFill.displayObject&&(null!==(r=null===(t=this.backgroundFill.displayObject.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.backgroundGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}}]),r}(Fv),Ig=r(119),Ag=new(r.n(Ig).a),Cg=Ag.getDevice(),Pg=Ag.getBrowser(),Ng=Ag.getOS(),Og={isDesktop:function(){var e=!0;return"mobile"===Cg.type&&(e=!1),/Samsung/.test(Pg.name||"")&&(e=!1),window.__nativeTags&&window.__nativeTags.platform&&(e=!1),e},isIOS:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(e=!0),Ng.name&&/iOS/.test(Ng.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),Ng.name&&/android/i.test(Ng.name)&&(e=!0),e},isLowGpuMemory:function(){var e,t,r=null!==(t=null===(e=window.__nativeTags)||void 0===e?void 0:e.platform)&&void 0!==t?t:"";if(r){var n=r.split(" ");if(n[1]){if(/^iPad/.test(n[1])){var i=n[1].match(/^iPad(\d+)/);return!(i&&i[1]&&parseInt(i[1],10)>=6)}if(/^iPhone/.test(n[1])){var o=n[1].match(/^iPhone(\d+)/);return!(o&&o[1]&&parseInt(o[1],10)>=9)}return!1}return!1}return!0}},Rg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function Dg(e,t){for(var r in t)e.style[r]=t[r]}var Lg="median-container",jg=1500,zg=300,Bg=50,Ug="0",Fg="1",Wg=.4,Gg=function(){function e(t){var r,n,i=this;x(this,e),this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.fadeState={in:!1,out:!1},this.changeMediaProgress=function(e){if(i.ctx.isPlayerPaused())i.ctx.logger.info("Media controller prevent seek event with paused state",i.ctx.taskId);else{e.stopPropagation();var t=e.offsetX/i.progress.clientWidth*i.duration;i.medianIsEnd=!1,"interactive"!==i.ctx.mode&&i.jumpToTime(t),"local"!==i.ctx.mode&&i.ctx.eventHub.emit(__.mediaSeek,{id:i.targetId,time:t,isPlaying:i.media.isPlaying}),i.delayHide()}},this.jumpToTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Rg(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,dv((function(){return!!n.duration}),3e3);case 2:r=Math.floor(e)+this.start,this.media.currentTime!==r&&(this.media.currentTime=r,this.changeBookmarkIndex(r,r>this.media.currentTime));case 4:case"end":return t.stop()}}),t,this)})))},this.showController=function(e){e.stopPropagation(),i.show()},this.getMediaDuration=function(){i.duration&&!Number.isNaN(i.duration)||(i.duration=i.media.duration,i.start&&(i.duration-=i.start,i.jumpToTime()),i.end&&(i.duration-=i.end)),i.totalTime.innerText=e.formatTime(i.duration)},this.playMedia=function(){return Rg(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="none",this.pauseButton.style.display="block",e.next=4,this.media.play();case 4:this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach((function(e){e()})),this.delayHide();case 7:case"end":return e.stop()}}),e,this)})))},this.pauseMedia=function(){return Rg(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="block",this.pauseButton.style.display="none",e.next=4,this.media.pause();case 4:case"end":return e.stop()}}),e,this)})))},this.onMouseOut=function(e){e.stopPropagation(),i.hide()},this.mediaTimeUpdate=function(){return Rg(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.media.currentTime-this.start,t.t0=this.duration>0&&(Math.abs(r-this.duration)<.3||r>this.duration),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(__.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle();case 9:if(this.currentTime.innerText=e.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!(this.bookmarkList&&this.bookmarkList.length>0)){t.next=14;break}(n=this.bookmarkList[this.pickBookmarkIndex])&&n.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit("shape ".concat(this.shapeId," onMediaBookmark ").concat(n.name)),this.pickBookmarkIndex+=1);case 14:this.fadeHit(r);case 15:case"end":return t.stop()}}),t,this)})))},this.onPauseMedia=function(){i.playButton.style.display="block",i.pauseButton.style.display="none"},this.onPlayMedia=function(){i.fadeState={in:!1,out:!1},i.fadeHit(0),i.playButton.style.display="none",i.pauseButton.style.display="block",i.playCallBackList.forEach((function(e){e()})),i.media.currentTime0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","polyline");return n.setAttributeNS(null,"points","35 0, 477 256, 35 512"),n.setAttributeNS(null,"fill","#000000"),r.appendChild(n),r}},{key:"generatePauseButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dg(r,{height:e+"px"}),r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttributeNS(null,"x","35"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width","148"),n.setAttributeNS(null,"height","512");var i=n.cloneNode(!0);return i.setAttributeNS(null,"x","330"),r.append(n,i),r}},{key:"generateFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dg(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),r.appendChild(n),document.body.appendChild(r),r}},{key:"generateExitFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dg(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),i.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),r.appendChild(n),r.appendChild(i),document.body.appendChild(r),r}},{key:"createButton",value:function(){var e={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};Dg(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Dg(t,{height:"20px"}),this.playButton.appendChild(t),Dg(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var r=this.generatePauseButton();if(Dg(r,{height:"20px"}),this.pauseButton.appendChild(r),this.isVideo){var n=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(n),Dg(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Dg(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Dg(e,{width:"100px"}),this.currentTime.innerText="00:00";var t=document.createElement("span");return t.innerText="/",e.append(this.currentTime,t,this.totalTime),e}},{key:"createProgress",value:function(){var e={flex:"1",position:"relative"};this.isVideo||(e.marginRight="10px"),Dg(this.progress,e);var t=document.createElement("div");Dg(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Dg(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}},{key:"fadeHit",value:function(e){if(this.info.fade){var t=this.info.fade,r=t.start,n=t.end;r&&!this.fadeState.in&&e>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,r)),n&&!this.fadeState.out&&e>=this.duration-n/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,n))}}},{key:"changeBookmarkIndex",value:function(e,t){if(this.bookmarkList&&0!==this.bookmarkList.length){if(this.pickBookmarkIndex>0)for(var r=0;re){this.pickBookmarkIndex=r;break}if(t){for(var n=this.pickBookmarkIndex-1,i=0;il?l/r:1);s.y=s.y+this.height-n,s.x=Math.max(s.x,0),s.x=Math.min(s.x,o-r*c),s.y=Math.max(s.y,0),s.y=Math.min(s.y,a-n),Dg(this.mediaController,{height:n+"px",borderRadius:n/2+"px",width:r+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:s.x+"px",top:s.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:"scale(".concat(c,")"),transformOrigin:"0 100%"}),this.fullscreenStatus&&Dg(this.mediaController,{left:"0",top:a-n+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Dg(this.mediaController,{display:"none",transition:"opacity ".concat(Wg,"s")}),this.createButton();var e=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,e,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}},{key:"addPlayCallBack",value:function(e){this.playCallBackList.push(e)}},{key:"fullscreenPlay",value:function(){this.fullscreenStatus=!0,"interactive"!==this.ctx.mode&&this.media.requestFullscreen(),"local"!==this.ctx.mode&&this.ctx.eventHub.emit(__.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}},{key:"changeFullScreenState",value:function(e,t,r){r===this.ctx.slideIndex&&(e&&this.targetId===t?this.fullscreenStatus=e:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}},{key:"bindEvent",value:function(){Og.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this._pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"unbindEvent",value:function(){var e;Og.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),null===(e=this.containerObserver)||void 0===e||e.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"show",value:function(){this.setControllerPosition(),this.mediaController.style.opacity=Fg,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}},{key:"hide",value:function(){this.fullscreenStatus?this.mediaController.style.opacity=Ug:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),jg)}},{key:"destroy",value:function(){var e;this.unbindEvent(),this.playCallBackList=[],null===(e=this.container)||void 0===e||e.removeChild(this.mediaController)}},{key:"clippedDuration",get:function(){return this.duration}}],[{key:"formatTime",value:function(e){var t="00:00";if(e){var r=Math.floor(e/60),n=String(r<0?0:r).padStart(2,"0"),i=Math.floor(e%60);t="".concat(n,":").concat(String(i<0?0:i).padStart(2,"0"))}return t}}]),e}(),Vg=r(120),Hg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o,a,s,u;return x(this,r),(a=t.call(this)).isGlobalPause=!1,a.lastTime=-1,a.howl=null,a.rctClient=null,a.isHowlEnd=!1,a.isHowlLoadEmit=!1,a.staticEventId=1001,a._catParams=void 0,a.url=e,a.runningAudio=n,i&&(a._catParams=i),b_.RtcAudioClazz?(a.rctClient=new b_.RtcAudioClazz(e,null===(s=a._catParams)||void 0===s?void 0:s.start,null===(u=a._catParams)||void 0===u?void 0:u.end),a.rctClient.on("load",(function(){return a.emit("load")})),a.rctClient.on("pause",(function(){return a.emit("pause")})),a.rctClient.on("play",(function(){a.startTimeChangeEmit(),a.emit("play")})),a.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){a.emit("resumeAllAudioInterruptByAudioSessionChanged")}))):(a.howl=new Vg.Howl({src:[e]}),o=c(a.howl._getSoundIds(),1),a.staticEventId=o[0],a.howl.load(),a.howl.on("load",(function(){a.isHowlLoadEmit=!0,a.emit("load")})),a.howl.on("pause",(function(){return a.emit("pause")})),a.howl.on("play",(function(){a.isHowlLoadEmit||a.emit("load"),a.isHowlEnd=!1,a.startTimeChangeEmit(),a.emit("play")})),a.howl.on("end",(function(){a.isHowlEnd=!0}))),a}return S(r,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout((function(){e.isPaused||e.startTimeChangeEmit()}),300)}},{key:"play",value:function(){var e,t,r;this.runningAudio.has(this.url)&&(null===(e=this.runningAudio.get(this.url))||void 0===e||e.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(this.staticEventId),null===(r=this.rctClient)||void 0===r||r.play(),this.runningAudio.set(this.url,this)}},{key:"fade",value:function(e,t,r){this.howl&&this.howl.fade(e,t,r)}},{key:"pause",value:function(){var e,t;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),null===(t=this.rctClient)||void 0===t||t.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"globalPause",value:function(){this.isPaused||(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"stop",value:function(){var e;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"destroy",value:function(){var e,t,r,n,i,o,a,s;null===(e=this.howl)||void 0===e||e.stop(this.staticEventId),null===(t=this.howl)||void 0===t||t.unload(),null===(r=this.rctClient)||void 0===r||r.pause(),null===(n=this.rctClient)||void 0===n||n.destroy(),null===(i=this.rctClient)||void 0===i||i.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(a=this.rctClient)||void 0===a||a.removeAllListeners("pause"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"volume",value:function(e){this.rctClient?this.rctClient.volume(e):this.howl&&this.howl.volume(e)}},{key:"currentTime",get:function(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek(this.staticEventId):-1},set:function(e){this.rctClient?this.rctClient.currentTime=e:this.howl&&this.howl.seek(e,this.staticEventId)}},{key:"duration",get:function(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration(this.staticEventId):0}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&!this.howl.playing(this.staticEventId)}}]),r}(Ks.a),Yg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},$g=function(e){p(r,e);var t=m(r);function r(e){var n,i,o,a,s,u,l,c;x(this,r),(n=t.call(this)).type="video",n.sprite=new Ld,n.isPlaying=!1,n.isGlobalPause=!1,n.fullscreen=!1,n.url="",n.isLoaded=!1,n.onVideoResourceLoaded=function(){n.isLoaded=!0},n.onVideoStalled=function(){n.ctx.logger.warn(n.url+", Failed to fetch data, but trying.",n.ctx.taskId)},n.updateVolume=function(e){n.rtcAudio.volume(e)},n.syncFullscreenVideoState=function(e){var t=e.targetId,r=e.state;e.slideIndex===n.ctx.slideIndex&&t===n.id&&(r?(n.requestFullscreen(),n.ctx.latestChangeFullscreenTargetId=t):n.requestCancelFullscreen())},n.id=e.id,n.start=null===(i=e.video.cut)||void 0===i?void 0:i.start,n.end=null===(o=e.video.cut)||void 0===o?void 0:o.end,n.fullscreen=null!==(a=e.video.fullscreen)&&void 0!==a&&a,n.container=e.container,n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var h=e.video.src;n.videoResource=new $l.w(h,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),null===(s=n.videoElement)||void 0===s||s.addEventListener("stalled",n.onVideoStalled),null===(u=n.videoElement)||void 0===u||u.addEventListener("loadedmetadata",n.onVideoResourceLoaded),n.url=e.video.src;var d=e.video.src.replace(/4$/,"3");n.ctx.loaderDelegate&&(d=n.ctx.loaderDelegate.redirectMedia(d),n.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(d," by delegate."),e.ctx.taskId)),n.rtcAudio=new Hg(d,e.ctx.runningAudio,{start:null===(l=e.video.cut)||void 0===l?void 0:l.start,end:null===(c=e.video.cut)||void 0===c?void 0:c.end}),n.rtcAudio.on("timeupdate",(function(e){if(n.videoElement){var t=n.videoElement.currentTime;Math.abs(t-e)>.5&&(n.videoElement.currentTime=e)}})),n.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){var e;null===(e=n.videoElement)||void 0===e||e.pause(),setTimeout((function(){var e;n.rtcAudio.isPaused||null===(e=n.videoElement)||void 0===e||e.play()}),200)}));var f=e.video,p=e.width,v=e.height,m=e.target;n.controller=new Gg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:p,height:v,target:m,media:y(n),info:f,canvasElement:e.canvasElement}),n.controller.addPlayCallBack((function(){n.sprite.width=p,n.sprite.height=v,n.ctx.clock.setTimeout((function(){n.sprite.visible=!0}),50)}));var g=new $l.c(null,{height:v,width:p});return g.resource=n.videoResource,n.videoResource.bind(g),n.sprite=new Ld,n.sprite.visible=!1,n.sprite.texture=new $l.t(g),n.sprite.interactive=!0,n.container.addChild(n.sprite),n.sprite.on("mouseover",(function(e){e.stopPropagation(),n.controller.show()})),n.sprite.on("mouseout",(function(e){e.stopPropagation(),n.controller.hide()})),["durationchange","timeupdate","pause","play"].forEach((function(e){var t;null===(t=n.videoElement)||void 0===t||t.addEventListener(e,(function(){"timeupdate"===e&&n.isPlaying,n.emit(e)}))})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n.ctx.globalEventHub.on("syncFullscreenVideoState",n.syncFullscreenVideoState),n}return S(r,[{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),e.next=4,this.load();case 4:return e.next=6,this.ctx.clock.waitUntil((function(){var e=r.videoElement;return!!(e&&e.videoWidth>0)}),3e3);case 6:(t=this.videoElement)&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.on("play",(function(){var e;null===(e=r.videoElement)||void 0===e||e.play(),r.fullscreen&&r.controller.fullscreenPlay()})),this.rtcAudio.play());case 8:case"end":return e.stop()}}),e,this)})))}},{key:"load",value:function(){return this.videoResource.load()}},{key:"pause",value:function(){var e,t=this;this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.once("pause",(function(){var e;null===(e=t.videoElement)||void 0===e||e.pause()})),this.rtcAudio.pause(),null===(e=this.videoElement)||void 0===e||e.pause()}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dv((function(){return r.isLoaded}),5e3);case 2:t=new $l.t(this.sprite.texture.baseTexture),this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"requestCancelFullscreen",value:function(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}},{key:"destroy",value:function(){var e,t,r;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),null===(e=this.videoElement)||void 0===e||e.removeEventListener("stalled",this.onVideoStalled),null===(t=this.videoElement)||void 0===t||t.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(r=this.videoResource)||void 0===r||r.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}},{key:"fadeIn",value:function(e,t){this.rtcAudio.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"videoElement",get:function(){return this.videoResource.source}},{key:"currentTime",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:0},set:function(e){this.rtcAudio.currentTime=e,this.videoElement&&(this.videoElement.currentTime=e)}},{key:"paused",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.paused)||void 0===t||t}},{key:"duration",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.duration)&&void 0!==t?t:0}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}}]),r}(Ks.a),Xg=function(e){p(r,e);var t=m(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).type="audio",n.isPlaying=!1,n.isGlobalPause=!1,n.updateVolume=function(e){n.audioPlayer.volume(e)},n.id=e.id;var a=e.audio.src;n.audioPlayer=new Hg(a,e.ctx.runningAudio,{start:null===(i=e.audio.cut)||void 0===i?void 0:i.start,end:null===(o=e.audio.cut)||void 0===o?void 0:o.end}),e.audio.cut&&(n.start=e.audio.cut.start,n.end=e.audio.cut.end),n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var s=e.width,u=e.height,l=e.target;return n.controller=new Gg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:u,width:s,target:l,media:y(n),info:e.audio,canvasElement:e.canvasElement}),n.audioPlayer.on("load",(function(){return n.emit("durationchange")})),n.audioPlayer.on("timeupdate",(function(){return n.emit("timeupdate")})),n.audioPlayer.on("pause",(function(){return n.emit("pause")})),n.audioPlayer.on("play",(function(){return n.emit("play")})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n}return S(r,[{key:"load",value:function(){return Promise.resolve()}},{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){}},{key:"requestCancelFullscreen",value:function(){}},{key:"destroy",value:function(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}},{key:"fadeIn",value:function(e,t){this.audioPlayer.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"currentTime",get:function(){return this.audioPlayer.currentTime},set:function(e){this.audioPlayer.currentTime=e}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}},{key:"paused",get:function(){return this.audioPlayer.isPaused}},{key:"isPaused",get:function(){return this.audioPlayer.isPaused}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),r}(Ks.a),qg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Qg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,Object.assign(Object.assign({},e),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),n,i)).isInteractiveOutside=!1,o.cmd=new Ov(y(o)),o.media=null==e?void 0:e.media,o.container.name=e.id+"_container_[Picture]",o.renderContainer.name=e.id+"_render_container_[Picture]",o.picFill=new zm(o.ctx,e.picFill,e.width,e.height,{useFilter:!0,useSlideBackgroundFill:!1}),o}return S(r,[{key:"applyCommand",value:function(e,t){var r,n,i,o;if("call"===t)if(/playFrom\(([0-9.]+)\)/.test(e)){var a=e.match(/playFrom\(([0-9.]+)\)/),s=Number(a[1]||"0");null===(r=this.mediaPlayer)||void 0===r||r.controller.playMediaFromCtrl(!0),Math.abs(s)>.1&&(null===(n=this.mediaPlayer)||void 0===n||n.controller.jumpToTime(s))}else"custom-pause"===e?null===(i=this.mediaPlayer)||void 0===i||i.controller.pauseMediaFromCtrl(!0):"togglePause"===e?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):"stop"===e&&(null===(o=this.mediaPlayer)||void 0===o||o.stop())}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r,n;"gifFill"===(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)||this.media&&"video"===this.media.type||"gifFill"===(null===(r=this.json.picFill)||void 0===r?void 0:r.fillType)||null===(n=this.effectObject)||void 0===n||n.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)}))}},{key:"renderPic",value:function(){var e,t,r,n,i,o;return qg(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,l,c,h,d=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(s=this.picFill.displayObject)){a.next=15;break}if(s.name=this.json.id+"_pic_fill_[Picture]",u=null===(e=this.backgroundGraphics)||void 0===e?void 0:e.getClonedDisplayObject(),(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.isNeedMask(s.width,s.height))&&u&&(s.mask=u,this.effectContainer.addChild(u)),s.width=this.designWidth,s.height=this.designHeight,s instanceof jp&&this.ctx.slideScopeEventHub.once("slide-render",(function(e){var t;d.ctx.slideIndex===e&&(null===(t=d.effectObject)||void 0===t||t.setFrameCount(s.totalFrames),s.play(),s.onFrameChange=function(e){if(d.effectObject)if(d.effectObject.hasFrame(e))d.effectObject.updateFrame(e);else{var t=d.getEffectTexture();t&&(d.effectObject.createFrame(e,t.texture),d.effectObject.setFrameOffset(t.offsetX,t.offsetY))}})})),this.effectContainer.addChild(s),!this.media){a.next=13;break}if(l=this.media.src,"audio"===this.media.type&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),!this.ctx.urlInterrupter){a.next=12;break}return c=Date.now(),a.next=10,this.ctx.urlInterrupter(l);case 10:l=a.sent,this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-c),this.ctx.taskId);case 12:this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info("redirect media url to ".concat(l," by delegate."),this.ctx.taskId)),this.media.src=l;case 13:"video"===(null===(r=this.media)||void 0===r?void 0:r.type)&&this.media.src?(this.mediaPlayer=new $g({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.effectContainer,canvasElement:this.ctx.view}),(null===(n=this.mediaPlayer)||void 0===n?void 0:n.sprite)&&u&&(h=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.getClonedDisplayObject())&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))):"audio"===(null===(o=this.media)||void 0===o?void 0:o.type)&&this.media.src&&(this.mediaPlayer=new Xg({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view,fade:this.media.fade})),this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,Og.isDesktop()?(this.container.on("mouseover",(function(){d.mediaPlayer.showController()})),this.container.on("mouseout",(function(){d.mediaPlayer.hideController()}),!1)):this.container.on("pointerdown",(function(){d.mediaPlayer.showController()})));case 15:case"end":return a.stop()}}),a,this)})))}},{key:"preRender",value:function(e){f(b(r.prototype),"preRender",this).call(this,e)}},{key:"subClassRender",value:function(){return qg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.renderPic();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"clearOnSlideChange",value:function(){f(b(r.prototype),"clearOnSlideChange",this).call(this),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}},{key:"initOnReuse",value:function(){f(b(r.prototype),"initOnReuse",this).call(this),this.mediaPlayer&&(this.container.interactive=!0)}},{key:"destroy",value:function(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}]),r}(Eg),Zg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Kg=function(e){p(r,e);var t=m(r);function r(e,n,i,o){var a;return x(this,r),(a=t.call(this,e,n,i)).children=[],a.cacheSprite=new Ld,a.cacheContainer=new Dl.b,a.json=e,a.json.fillStyle&&"groupFill"===a.json.fillStyle.fillType&&i.groupFillStyle&&(a.json.fillStyle=i.groupFillStyle),a.container.name=e.id+"_container_[Container]",a.cacheContainer.name=e.id+"_cache_container_[Container]",a.ctx.timingTargets.addTarget(e.id,y(a)),a.updateTransform(a.json),a.fillObject=new zm(a.ctx,e.fillStyle,e.width,e.height,{useFilter:!1,useSlideBackgroundFill:!1}),a.createChildren(o),a}return S(r,[{key:"createChildren",value:function(e){for(var t,n,i,o,a=this,s={x:null!==(n=null===(t=this.json.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},u=function(t,n){e.addSubMTask((function(){return Zg(a,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.children[t],o=null,this.ctx.featureList&&this.ctx.featureList.smartArt&&("Shape"===(null==i?void 0:i.type)||"Picture"===(null==i?void 0:i.type))&&this.ctx.smartArtShapeList&&(a=i.id,(u=this.ctx.smartArtShapeList.find((function(e){return e.id===a})))&&(i=u)),l={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}},"Shape"===(null==i?void 0:i.type)?o=new Eg(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new Qg(i,this.ctx,l):"Container"===(null==i?void 0:i.type)&&(o=new r(i,this.ctx,l,e)),o&&this.children.push(o);case 4:case"end":return n.stop()}}),n,this)})))}),"@ContainerImpl[child.init]")},l=0,c=this.json.children.length;l1&&void 0!==arguments[1]?arguments[1]:{};if(e)if(e.delay&&e.delay>0){var r=a.ctx.clock.setTimeout((function(){e.event&&(a.cond[e.event]=!0,a.detectTrigger(t))}),e.delay);a.timeoutIds.push(r)}else a.cond[e.event]=!0,a.detectTrigger(t);else a.detectTrigger(t)},a.id=e,a.ctx=o,a.eventHubs=i,n.forEach((function(e){a.addCond(e)})),a}return S(r,[{key:"setTriggerParams",value:function(e){this.triggerParams=e}},{key:"addCond",value:function(e){var t=this,r=function(){for(var r=arguments.length,n=new Array(r),i=0;i0&&(this.cond[e.event]=!1,this.eventHubs.runtime.addListener(e.event,r)):this.cond[e.event]=!1)}},{key:"isTrigger",value:function(){var e=this;return Object.keys(this.cond).every((function(t){return!!e.cond[t]}))}},{key:"isTriggerWithoutParent",value:function(){var e=this;return Object.keys(this.cond).filter((function(e){return"self"!==e})).every((function(t){return!!e.cond[t]}))}},{key:"detectTrigger",value:function(e){var t=this;if(Object.keys(this.cond).every((function(e){return!!t.cond[e]}))){Object.keys(this.cond).forEach((function(e){t.cond[e]=!1}));var r=this.triggerParams;this.triggerParams=void 0,this.emit("active",r,e)}}},{key:"reset",value:function(){var e=this;Object.keys(this.cond).forEach((function(t){e.cond[t]=!1})),this.timeoutIds.forEach((function(t){return e.ctx.clock.clearTimeout(t)}))}}]),r}(Ks.a),ey=function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r),(n=t.call(this)).isTimeNodeEndSync=!1,n.interactiveListeners=[],n.runtimeNodeEventHub=new Ks.a,n._currentSeqIndex=0,n._currentSeqState="idle",n.isForward=!0,n.autoPlay=!1,n.handlePrev=function(){var e,t,r,i,o,a,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.hasPrev()||!n.isMainSeq?"idle"===n.currentSeqState?(n.decrSeqIndex(),null===(e=n.commonTimeNode.children[n.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToStart(),null===(t=n.commonTimeNode.children[n.currentSeqIndex])||void 0===t||t.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"running"===n.currentSeqState?(null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.seekToStart(),null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"end"===n.currentSeqState&&(n.currentSeqIndex>=n.commonTimeNode.children.length&&(n.currentSeqIndex=n.commonTimeNode.children.length-1),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.seekToStart(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.clearSubList(),n.currentSeqState="idle"):n.globalEventHub.emit("c:prev slide",s)},n.handleNext=function(e,t){var r,i,o,a;if(n.isTimeNodeEndSync&&(n.isTimeNodeEndSync=!1,n.currentSeqState="idle",n.currentSeqIndex=0),!n.hasNext()&&n.isMainSeq&&t)n.globalEventHub.emit("c:next slide",e);else{if(n.isInteractiveSeq){n.globalEventHub.emit("shape slide onNext"+(n.json.ctn.id||""));var s={result:null};n.findChildInfiniteRepeat(n.commonTimeNode,s),1===n.commonTimeNode.children.length&&s.result&&(s.result.json.subTnLst||[]).length>0&&0===n.currentSeqIndex&&"running"===n.currentSeqState&&n.commonTimeNode.allChildrenEndHandle()}"idle"===n.currentSeqState?null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.startTimeNodeForce():"running"===n.currentSeqState?(null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToEnd(!1,!0),n.currentSeqState="end",n.incrSeqIndex(),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.startTimeNodeForce()):"end"===n.currentSeqState&&(n.incrSeqIndex(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.startTimeNodeForce())}};var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,h=e.eventHub,d=e.iterateIndex,f=e.iterateId,p=e.isInInteractiveSeq;return n.isMainSeq="mainSeq"===i.ctn.nodeType,n.isInteractiveSeq="interactiveSeq"===i.ctn.nodeType,n.id=i.ctn.id,n.isIterate=a,n.json=i,n.ctx=l,n.globalEventHub=h,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:h,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:d,iterateId:f,isInInteractiveSeq:p||n.isInteractiveSeq,fromSeqId:n.isInteractiveSeq?n.json.ctn.id:""}),n.bindShapeEvent(),n.nextConds=new Jg("mainSeq",i.nextCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.prevConds=new Jg("mainSeq",i.preCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.commonTimeNode.on("timeNodeRestart",(function(){n.currentSeqIndex=0,n.currentSeqState="idle"})),n.commonTimeNode.on("childTimeNodeStart",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="running",n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepStart,t)})),n.commonTimeNode.on("childTimeNodeEnd",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="end",n.autoPlay&&n.ctx.clock.setTimeout((function(){n.handleNext(!1,!0)})),n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepEnd,t)})),n.commonTimeNode.on("timeNodeEndSync",(function(){n.isTimeNodeEndSync=!0,n.commonTimeNode.resetForRepeat()})),n.commonTimeNode.on("timeNodeDestroy",(function(){n.interactiveListeners.forEach((function(e){var t=c(e,2),r=t[0],n=t[1];r&&n&&r.interactiveContainer.removeListener("pointerdown",n)})),n.interactiveListeners=[]})),n.nextConds.on("active",(function(e,t){Array.isArray(t)?n.handleNext(t[0],t[1]):n.handleNext(t,!0)})),n.prevConds.on("active",(function(e,t){Array.isArray(t)?n.handlePrev(t[0]):n.handlePrev(t)})),n}return S(r,[{key:"startAutoPlay",value:function(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}},{key:"incrSeqIndex",value:function(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}},{key:"decrSeqIndex",value:function(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}},{key:"hasPrev",value:function(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}},{key:"hasNext",value:function(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}},{key:"findChildInfiniteRepeat",value:function(e,t){var r=this;e.isInfiniteRepeat()?t.result=e:e.children.map((function(e){return e.commonTimeNode})).forEach((function(e){return r.findChildInfiniteRepeat(e,t)}))}},{key:"bindShapeEvent",value:function(){var e=this;"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach((function(t){if(/^shape/.test(t.event)){var r=t.event.split(" ")[1];if(r){var n=e.ctx.timingTargets.getTargetById(r);if(n){n.interactiveContainer.interactive=!0,n.interactiveContainer.cursor="pointer";var i=function(){e.ctx.eventHub.emit(__.userInput);var t="shape ".concat(r," onClick"),n=e.ctx.mode;"interactive"!==n&&"sync"!==n||e.ctx.eventHub.emit(__.interactiveSeqAction,{action:t,seqId:e.json.ctn.id}),"sync"!==n&&"local"!==n||e.globalEventHub.emit(t)};n.interactiveContainer.on("pointerdown",i),e.interactiveListeners.push([n,i])}}}}))}},{key:"setCurrentStep",value:function(e,t){var r=this.commonTimeNode.children.length;if(!(e>r)){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);var n=e;if(this.commonTimeNode.seekToStart(),-1===n&&(n=r-1),0!==n||"start"!==t){if(n>=0&&n=1){var r=n.json.cBhvr.attrList[0];n.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");var i=n.json.cBhvr.to||n.json.to;i&&n.timingTarget&&ty(n.timingTarget,r,i)}})),n}return S(r,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),oy=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==("undefined"==typeof Reflect?"undefined":T(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},ay=function(){function e(t,r){x(this,e),this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:function(e){return e/Math.PI*180},exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:function(e){return e/180*Math.PI},rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=r,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}return S(e,[{key:"parseFmla",value:function(e){var t=e.replace(/#ppt_h/g,"(".concat(this.timingTarget.design_ppt_h,")"));return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/#ppt_w/g,"(".concat(this.timingTarget.design_ppt_w,")"))).replace(/#ppt_x/g,"(".concat(this.timingTarget.design_ppt_x,")"))).replace(/#ppt_y/g,"(".concat(this.timingTarget.design_ppt_y,")"))).replace(/ppt_w/g,"vars.ppt_w")).replace(/ppt_h/g,"vars.ppt_h")).replace(/ppt_x/g,"vars.ppt_x")).replace(/ppt_y/g,"vars.ppt_y")).replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach((function(e){var r=new RegExp("([^a-z])".concat(e,"([^a-z])"),"g");t=t.replace(r,(function(t,r,n){return"".concat(r,"math.").concat(e).concat(n)}))})),new Function("vars","math","$","return "+t)}}]),e}(),sy=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n)).value=e.val.value,i&&(o.fmla=o.parseFmla(i)),o}return S(r,[{key:"resolveValue",value:function(){return this.value}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue()-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],sy.prototype,"interpolationFrom",null);var uy=function(e){p(r,e);var t=m(r);function r(e,n){var i,o;return x(this,r),(i=t.call(this,e,n)).value=null===(o=e.val)||void 0===o?void 0:o.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r);return t>this.time&&["hidden","visible"].indexOf(n)<0&&(n=this.resolveValue()),n}},{key:"resolveValue",value:function(){return this.value||""}}]),r}(ay);oy([iv()],uy.prototype,"interpolationFrom",null);var ly=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).fn=i.parseFmla(i.val),i}return S(r,[{key:"resolveValue",value:function(e){return this.fn(e,this.math,1)}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue(r)-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],ly.prototype,"interpolationFrom",null);var cy=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).value=e.val.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t){return qv(e.resolveValue(),this.value,t)}},{key:"resolveValue",value:function(){return this.value}}]),r}(ay);oy([iv()],cy.prototype,"interpolationFrom",null);var hy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},n.keyFrames=[],n.isColorAnim=!1,n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]))},n.updateVars=function(){var e,t,r,i;(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_h)&&(n.vars.ppt_h=n.timingTarget.ppt_h),(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_w)&&(n.vars.ppt_w=n.timingTarget.ppt_w),(null===(r=n.timingTarget)||void 0===r?void 0:r.ppt_x)&&(n.vars.ppt_x=n.timingTarget.ppt_x),(null===(i=n.timingTarget)||void 0===i?void 0:i.ppt_y)&&(n.vars.ppt_y=n.timingTarget.ppt_y),n.isColorAnim},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=n.keyFrames.findIndex((function(e){return r<=e[0]})),o=n.json.cBhvr.attrList;if(i<0){var a=n.keyFrames[n.keyFrames.length-1];n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],a[1].resolveValue(n.vars))}else{var s=i-1,u=n.keyFrames[i],l=n.keyFrames[s]||u,c=u[0]-l[0]==0?1:(r-l[0])/(u[0]-l[0]),h=u[1].interpolationFrom(l[1],c,n.vars);n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],h)}},n.onSeekToStart=function(){null!==n.startVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.createVal)},n.initKeyFrames(),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timelineStart",n.updateVars),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.createVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]),n}return S(r,[{key:"initKeyFrames",value:function(){var e,t=this.json.valueType;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){var r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===t&&this.timingTarget){var n=new ly(r,this.timingTarget);this.keyFrames.push([r.time,n])}}var i={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===t&&this.timingTarget){var o=new ly(i,this.timingTarget);this.keyFrames.push([i.time,o])}}else if(this.json.by){var a={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===t&&this.timingTarget){var s=new ly(a,this.timingTarget);this.keyFrames.push([a.time,s])}var u={time:1,val:{type:"string",value:((null===(e=a.val)||void 0===e?void 0:e.value)||"")+"+"+this.json.by},fmla:""};if("num"===t&&this.timingTarget){var l=new ly(u,this.timingTarget);this.keyFrames.push([u.time,l])}}if(this.json.tavLst.length>0){var c,h=M(this.json.tavLst);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(d.val&&this.timingTarget){var f=null;"string"===d.val.type?"num"===t?f=new ly(d,this.timingTarget):"str"===t&&(f=new uy(d,this.timingTarget)):"number"===d.val.type?f=new sy(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new cy(d,this.timingTarget)):"boolean"===d.val.type&&console.warn("not implements"),f&&this.keyFrames.push([d.time,f])}}}catch(e){h.e(e)}finally{h.f()}}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),dy=function(e){p(r,e);var t=m(r);function r(e,n,i){return x(this,r),t.call(this,e,n,i)}return S(r,[{key:"percent",set:function(e){this.uniforms.percent=e}},{key:"transition",set:function(e){this.uniforms.transition=e}}]),r}($l.k),fy=r(121),py=r.n(fy),vy=r(122),my=r.n(vy),gy=r(123),yy=r.n(gy),_y=r(124),by=r.n(_y),xy=r(9),wy=r.n(xy),Sy=r(125),Ty=r.n(Sy),My=r(126),ky=r.n(My),Ey="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAr5QTFRFAAAATwAAOQAAZgAAKwAAPAAAPQAA7AAA/wAA/QAAugAA5QAAsQAAwQAAsAAAfwAAawAASQAAZAAAOAAAJwAALAAALQAAqQAAiwAAmgAA5AAA7QAAtQAAhQAALwAAfAAAXwAAYQAAigAAuQAAfgAAswAAcgAArQAAqgAAZwAAaQAAMgAAGAAAiAAAjwAA1gAA6QAA+wAA7wAA2AAAbQAA2gAA3QAAuwAA3wAA2QAAxQAA0QAAzwAA0gAAXQAAYAAADAAADwAAGQAALgAAjgAAcAAAzQAAwgAA+gAA3AAAGwAAoAAAowAAcQAAVwAA1QAAIQAAWQAA5wAAsgAAuAAASwAAbwAARwAAMAAAnAAAUQAAaAAA9wAA4gAAPwAAbAAAOwAAlwAA0wAAjQAAvAAAwwAAkwAAQQAAvgAAnwAAvQAA0AAA2wAAwAAAWwAATQAACwAABwAAQgAAtgAAgwAAvwAAgQAAlgAAEAAAxgAAtwAAmAAARgAAjAAAdwAAqwAArwAAywAAYgAACAAAmwAAHwAApQAA8QAAdAAAbgAAFgAAgAAAogAAewAAXgAA6AAA9gAA/AAAzgAA3gAAkgAAngAAdQAARAAAmQAATgAAUgAAJQAAIgAAqAAARQAAPgAAxwAACQAAAgAAMQAAiQAAhwAA4AAAUAAABQAAeQAAygAA9AAAFQAAVQAAyAAANQAA4wAAKAAAWAAAZQAApwAA4QAAyQAAXAAAkQAArAAAdgAApgAAHgAA8gAA/gAA6gAA8wAAFwAAHQAAhgAArgAAnQAANAAASAAA7gAAlQAAJgAA+AAA8AAANwAAJAAAHAAANgAAkAAAKQAAoQAAzAAABgAAFAAATAAAeAAAAQAADgAAggAA6wAAEQAAfQAAVAAA9QAAIAAADQAAEgAAVgAA5gAAQAAABAAA1wAA+QAAUHExBAAAJDlJREFUeJwlevk/lPv7/2XtOrKNsWcbzGCMJSmSpSxJZtQkjPEOg5mxRWns+xpZyr5ECGmcLIOsdVK2oyJbcVI0J8fp/Bff2+d7/+BhPO6Z1+u+ruf1XF4GAEAGZOXkFRQBTiD+dgKVTiqrqKqpq5M0ZMmaWtoAOrp6+qcMDMFIzdiEYmpmbqJBpVlYWtFJitYMG1sbFTskLvvTDmcQHM+ec3ImXp13uYCubvB/l7sHkC9eAk8jcy9Eb5/LvldQzQ+v+jsw1ZAlfwYDAK5dZ98IvIlBwXRNXVYIJ9TpLJUb9j9LvBVOj4jkRVGj/Y1i8AwiH09eEwhjMU4uXtsiAWLlqInMcLh+28okKRnuhNy945lic0+Uqu7NdErDdB/5DBo7MwuE4J+dw8jIzcsvwEIUFFGEisWQm1ACpcZlxF7vl1c8YMCJyqrqGio+fFRbVw8NjU2uec0isNWhVuq2XMPzmjcRBVHhSWCtXaPR2mZoybHzL0TUfmxPabeR6yg/+6QTY83VQNOkSwkbumsgkgzwtKe8tDdHYM7ts3sW1Q/Pn3PEWaGmYjoje+B3ewx9bM4V0LNfDB5XL3/o5v1hSBi5fzvQkQESOkQOwiiwI++5YBdkDjFIrKEx3cZK4Ti8eAlZpjcnYMSHKG0ygKKVeFSLRpOZNL9p19Ku1Q9enKlp45lZiQGr7hlWS17RKWp03mv8481cQnwBUNTAXwIUeAvsJwCCTnV4FyJC9CrKYDnOT91DpRZSG8Bsn7pAw2Ihd7Hn7R0hynXezjQcvQTyMGgUjV12kiW75XaR7Z9OK9kD0/j6ckfyk/fcPHCkvkz48NG/r3p4FeRpoQa9JA74sJAOcLubirEPqXqTpZ1hNzUN5exoNVbk5RmSOQqcJix5yWvvRZZ9nyay+tqAsb6U76oAwo3wgXvJkK6sCpOYQBTIdT6cg92rSxWh16pdV2c8NnDzfQhveqvND4k6aAB0ssWnHuL2yZQ7AHLzJTgUrreyZeWewhawpw1RMDWYHLP1OcNQgKzwlKVP5JV5crB7cZ+NRJ6AB3wx/x3RsEufEkozLu+g7+zkekfLbFQo8byEubp5ld7Ot2CQKxJ7qguZxF4SB3ozQF2pCEIbcaFxg6eAr0/MbeHb1DCK+vQCA3j4YTcwjNiWyEgcq1dRlfnXsq31K3hhhvNX/CYM0JC+asxk91d+7ahTr6AAaTAn3U2lTBfjIc1pr5VEX94yw8uIZhWQVAHQj66iLErxDLqNmN0wuO9hYf6FN+boQb1FjENYJAiWKrru2ejWzoZX6M9A91p2Sw1TTRT/rdDQsyiOT1f6br4fKm6Fpeb9qocNfvYOLPAuczuA5BTbeVT2O/ghlkYEScGHX0Df3StfyMT4iYHCTEQTLj04iWePVx6aomPYGLc08OXB+drJLqoq42/wXqB5eagtaqR+ZAPsymG8utBxt1rO8zFTPHITA50gCMQ4Gw7tQBZFo0DBsWb5ExlyKoBbvRAO7jdv6U8jMYne4Y+iWXmg53gvbNYsGg+gU3elEnaeXB/ufFUKJiyZdNZemo10NviBxr65KE1k/Rijg8KTan5647eoiJQAYPIL+9fuHPb/VSMucg/bcJHzKt557SPRYF8voq1+2SIWmSgQCZo2ZjhlymMigEZdZQ3MzX6wmmMTECwNWieLpWDlKihSZ2sVVwNX9AmecOXtMHP7C/WwPzvKbZqiJIYFZ7PuZngFJmNi9YatOLLQU77vGbS6PzGdsQVn/Ad7nQyALeZVbm01GA72t5bvR/aWTWVIIEVDwDJanzjqAc8QuFl4Yr9/2WTdPVPmHCtY7ZEZ4mJoDqURsbWcaHwtmIqJWrIXshpck5ilsHlYM34YFFXTG3dGzKrDMBxB8gsDn7G3bW/TDpe51ALDmy5KQW8lUgg4guspE7TN7wCTbFWnf7gBB16vuHtYoXsWo14j1cD9/Z+oyj5GF95jqI9KG0s6YtJ0N0jtISrVAZQcIO251QuKrBIaH7k2hLK/Mw8pyNmCnott3tGm6XjT9DsZUps7H8DCHwjc731hFRtTaF2UQ572Ca4Qp/On0RVdmFD0A219YL4DcFBN/lnfBvNr12E0W2MSZatepyNLVIbbFIg7jaYfoR/4W1VUKqL6zsF4NpNiq4orZEhCEjExd7AQ2j+B6GMOPmekeA7+DsM0IAsIqj31xrtAzvWqBsjmIWC6+uBONItM9R+HA8rGHxptX9JAF/G0L6QEiy3McdFEhp4+YNA0FHNwnW0/RFFEtwHRb/hwQsbzX/heYihsB6nNVJssfHnqQe/acYKMv8LqcRe7aEF7Y6ugtWxKLILeNmlzVF277PqxIg8dSxpo5gsaMBFxfgwvdWBhOvzOHHHzx4JUHLNpyc8LUzkLcfiIv3A2jQxpeQ1iL4IKUJ1dTmigtKLpgi6QjX2d8ISbHl1B8bH0UEbnI2DMVm5h4+6Ko+kTd3VVSVPGkpp4/p+BW7/faCjBhlD7MoDqRpcOJxz6lBe8gWYtBP80qaKf86k0FP9L1ziS+Y1m8MPaWpcD8BXkG2flILIvKvoC/hr8upkS1N2pwbQD5NtZmC6iNb2JUVJTRDoZxTXibAjQDp3w/y5Bhld8zynk7OU1S3S3LPnJLvjhzcfUaKeYeJwtkmPDDbYpWt0gTaf8e/gL32vUwV1i7lHVD65CN0n+CySLiHLZfbSx/XYollUUj09xeL/Cjqg2DUp2eM7igsEZPyXlnve63tfjYjZSbBwtUf7mlAhvX0N/CzxFIKE25lol9uEzuf4B95AK6EAVtXBSn3XGA6bVuISAxQuuFKTClSg4xz/VEivy43BYA1UY4x7aSd/i1RMdwdgzi68x0JEYIfLBbEMag6Kcur0R3WGGtXvT2744+WPE4QaWz1rrbq5fEmwQTMwOLPRNs2jAJiPTPpAjXA48lyGNDo/aEnNyEv39YQtTIKcLY2gVw/SWl2eGCgmvgRKcowIU96xWM6PvyJhk/4dRHbP4A2JaG+uq0xb1J15Gaa++VgngHKhh3L3grVzTsa95kyjw3wgZLYViuASK6smRQA8Ds39GAisCnrN+wiGik1BsIZfpFhk9aVvJNr+pUWJbSmxoOAqRzseBsHsCPJ+9EvFA6HLDuymPuB3VbLuUAeRzs5AnmhdV52drj6JdA/9JE6GEWqDZIrYYlrYCDM7hLcefRsAoFiZc4P3tYx5qFsH9ttFzAL0L/lgSwvjbS4Hlik7xGLuSVfejKzFhvtnHF3039B8VGq1UCpg4+cLt0KMDi46N3M5F9YWHiD/InKc21mDdj2pCGZNgqLihu2j14oFnH9dxycOd1FsVBZ+cMEBkuu0U7wwPJEfc9SWATH9MuG0EvfyJPxuf9enmuy3ipIOtB/Tq8fRSfpzQFs03/H+7yBgpxgsOgaPD69B90NfAH5SMhqmB4xns1ARtQlmao4VcBTRTDeuo6wPwzlIp/AQcGagk6KNOsPIQxV8P+wi/EIUDDVLWFGWvjTzIZnkLRH1UoJhWpXMTjPAjt3UAX17p6WGAJwxrWKi26AC0+gNR2jzhlwfEJrgvQCombOyaY8/bLwB9fMvueMLQvWNkBKGC0lq0Ht3KzP5jCcE4StVpESb3tdp2iHeZtLDMQ26rGa6n0GpULC4tIz4jBBxadsL3wHdFQPwahEAq1xR5rwJkcKwXQrx0f6F7awZw4fPbGa1gUiXJVpYOUgng1Il6/kdwHeGfQlS+PdZEZ/WbBBOmQjvC0LG6wpXRfApSSh5UP+GjCtGd2HwGkHtuvHkJDGvpqBlcXLXap5CKR9eJRzlgZ8W4zK891g7/yQl4SpDRz5B6E6FEUxFv8K/4i/p8Hn1DOZxLx2FQHi3X/cwgM0LCK+TZnTMszAMO3JUIXyO6zOQNiThG4OXOrwJNCE8XwV95JJ175KWLydZwJE882VhaOGyWMiSKcP771g4kaYKUFB2Dmz0JUdUk75Pplh8T7VBZwUY90zTpUDwWxIJNQ4p3+oSPgHVcJUQVskdpHklpVCunu2AMvq7HI2HuekbnizilxbZeVzVwQLUBT133fJUvswkKMu+OHgCDmIJX9+b8TDTiXIyTQUrXPXFm5NsIOF7X6snH0GkbLAqxPlJ9ecWoX5Ywy8Vl/GgAlgE21JAfp4T0F8NwItrDq/BXLuXDsET46eLTOOKK5svMyhZ3Ah1ePwHOvYdijiwWbAEJnbIP5V95SOcbXM43qIJm+5G32UABbhvaNNvRffVynh4jmDDQ3V+XtC1dHWnr5PFwd9Ds2UdVaIEHmECBo9V1OAz0w9Q7ZONc7xXtF+8+ETCmmX+G7+2+flmEDTEww2Dr5eQAbJggPltoLQ9vmismCRLQYIvSsXqDWOIS85DgRSlAhWjGdOxACJXNVdyGoSxA1lu2eETiYQrdn23iL9SxSRCa5LgEX0CruBRSxHIQWrdV/mq5qOUyNgs9QUYv+xsmlhwRichkxSqZko2RwH46USV7CUofNLnT23rewuaB+3Y+8g82zzjibgmdChhbQRFk34o/zPECaRHy7wKj5wlFDE8H30Jva81PwVlVT/UNLeH5C/T9cIDrBy3capubs5y2F7ATbAwpRvThn7BsaBvwbu0BBMDxHEtAsSE3DVOdF+kWWcXsfX3AFYeWSbrZP/TS/H80MGryotBYxj1U8rWXomZeevT+aQ0crFNLeulQLpiCr0J3rB5jTS3MR+wbSYRJirC2/5eEGCMHpzOUFWEplMsWaW0SVaCL8y8rZVI4hiy4qyEC7CW0YwNHTGLxvJ2vW6GNMctZQNF8YFxN+y/di6ENOZNtphmlCkIZsU3uvDqzlidm8vQCrkUfzYk6D4AYr6tk+mccy/i8xBKFQzibM/wWTIysZ6cDt/XhySBb1niUMBJRN+ILdWbj7Z6dnUgLZELPYXWeyXNhzV48NvUbAWzWEC0lD8PwVIGTt6rveS3h3gX3XiVRg1O5poRFvgPCL17nEx324dKJT5AC5OU7RFWXuEp0U1v+MRgY7mxikdoB4lle086YyXrr61aA8eVem+VOaY1TKn/sOxOeRhIcR4AZLNrygau7faIG/T/vTPO010Kbci6K9mAYPE3+D/Q/02VDHhOfPxxTud5MF+8KsrdY8Bw4TELjh26cdDiBfCo2ptEyDRsJrRk1KZcvgta3ckuK5CRPn7AxcptUHMpozoAU68b9ElVYL1uhaVz7RTJwRJ15W+0X8HZs7gUMi9wPAEik099Y6ilYhW7j1KNLmlFXlRwAb+NvU+PbN1AfHY1t+/sN4J1JVfn7FDYLloP1Scsg9GA3s2b6XMPgHYNbve6n3ghsmK0WGyzvNrCU7t0veADh7RGOKA7vXwYQc0uuPZMJMUQMLbBdz+2kFzkStJJNFEvH/f/cT1wnXJfsflkfnn+qJe89nGfU5c6Fpsd3vp8y31fD+eHg8uZSYXdwqcoBT9DS0aTRKoaZrdSqk0KtkFZb4+BBqXAnpKdyVLXBuP5clrK5wxSYyIWrghPCaNnLhJkp/A3x8fsMgMczROQeBhpGULvpU+ZNQqKLZQMr2c5uvEvEMHOemnBn5rN1M88Y+/TkhOxUIBP/2P2jr1+oIelfW2KEQFOnrjfGzrGWUsS6YsjIBTxTDwc64bw+fGhfW5AnvnpxLYAJDBm2lJ6rvaNZZMrsfTANYByHtYSbJahyNwhmaepqjdIPb+zS9jVAgfRHPZEjU1Gd3rhA/5cI2/I7HkyV/yE2rhd7VLRC+6h3nRnBwqHqGw2HNB46i9yPFIYrAbBjbP8Xiw3DuyzbyCf9d4TVDRcSKQussrgoejwBiAjYwZi0qcQK8KuYyotDvMBHuWgDgNhVUXyHsaOlkxmK4H0+NoRd5BhMX9v+E0DX3JzZF4fOt9EZhbDdj5dngkuAUBvofWKvSxgvWN/JXhGtuib/SxfY8KRQCXuP9M9m4RKN/YNl9WjkI76xL/vI3tkUW8UwNyBJ97wf3vZkr8zgZWjt09M51pPhhhhIa5n7iOjQUKxcVfAILZl0T4jc7FxaD1109JL9Ca0sSBbrEuNCQcFBiIv+SZSJPYe/1EYItPw54SrCk2fKxMmvjDJ19ORWT937dR9t2yrEWeJCbBTuaVFvARwhlXYkVrmPmMoeHL//5uHAvRj2Y8axOXO33AUsW/qXsBWn9CxkKIYN1C7xCb9tfTfE+3+m+utf4yM6L/i+ic02U8cQ2F98GKWj7KuD2pLDXkPCLCOzaCvJfwOemmSw+9kphfUY4yI+yj5/MmQxX+dJTNMaPNhkZY4Wbc3tEQKBn08wseAkoa6qqIQUIOD3kPmDGdgoM1ToC4KklkiDUBk4Uk/Fidp8zCJcFBMgHj+etTxbRFeHvwhf80CiSt3z3DIFYl6k1lWLVvRBn0lpMVKj6PITC0tar9jbVAPhHP8k4rhblOqCcOdqrAPy67Z1WL4TfMfVx0GLrHQJyH8iQUus8lkFKuv5kcYrNvW13YfKuZ89ORAmC15BmyKxBFilYKq8dxQRWdqGLLb8Rij6WrIs7/mxVyFptbrarK6uDO1v3yxzOWQjtaz2W/01pTvN/Omyfx8D2VGPK80olW8HfnliYW8J7UjIcIlewB+DJW6whrBEqHlPOAQ8W/xs1Hn5GmuasOM+K9M5T9RYI+PMwnvMsCTG6r+dbVXfMESA2YjneGLq0D1CQv4w2JrzNXBsshiH+QHHQa2Mr/AZ4I3FCYwSF30Bqgti3TOnZKmjAfxUANcv/0JqQQ2HHnOhMOwJodHns6/25Jg743Q1lQ+KbmEPuPq51Bt83snYTH17IxKtNv2roT2epeJDTPX4a0X9SZHNHJqSie0RtRDgKb5JGNRAJr4h2aypQVI68DWseD13hXjPfFQtgcpsWw3+bHWbYNMQ5bN4cjo9d8aBirB8/oJdnePZQoxNeCAZZbotwjOCA0wROeUdcuZjnmA4UdjXjcB5b5xb9AZYmwdFSH2DdhvscW5z5QnIMnYTFRngKajbkSdjvvVyWw6LwIJWxlYhshBPGlg4xDUFZOFLf2UlA4MUe8DA8TIea+IX2smNzuP0vmleE8ArQR+UsNqTqekrljgz0+vhX5+FaB5qs3t9J5cPuwScX+MPS/UkluQXNh5WrJFM9p4CGban0P71P43YKxglb2X+cyKQ94h/diX4v9RaCpnBsnLBEiBNo/0idpiYrznuGrJbXrCBGfcS8UOZNOTvW4hnUTwJkuVcBHodNx3R8t5LtTDmf9/EmsNByWOE4XyHplSzut+ilAlOYAW6FAoMlRP17j9CYvp40MImU7d5GfS2Drx+GW3yciuygcSeJPwW0wzd8Jx7iITtZPchNXC6aPAtKQrB2xa8z53r/+NXr2nhyLPFySAhSY0IYOQBgKT6h3kSWUhtwoeuSh11H23xn6OOue1lRwSZFtnWn9cdSaaEGqWp9dYsa7+ChyZcubQzxJjXzXLk9h89vBXfZGDIlvpsP4QIbmPMjqxhqsBfefv19nkI6ATGqFQsHNSKV1bi5RDhNzYOR3Ckunra8gfjADKT/ll0bAtT+Gyj2d7NLfv1oX/s3Dxbwcs6upK916xmn4Cn9qoUPECeybc02KdxfxGRB0zT8l0Zikliu1neuQQ0TmnzytBG1jCdcA7AUAfwLbEnAjIqNRI/tr3AS3HHzaJJ1AVHLTuHM72nkWqYVDDf+j66wmI+h8Lmvxl4OGEXnX3JOrwBz08R7ELtwHigs810rOj0viiWN/+sC7Ni5oBKQ6bZk8eHN3PYLZzQgVjEb5jNex3lMrEC0EzpQ3faNx4xd523exujDDnuf5ZP5S7v7/UuKqkqW2X94NfxXy7549ho3WWi6n1Vt7ABUIeJc5cdqWkRZrf4aNACabeODzxEINKtnW6CGh5734US98i9pjARiQfrdT+ax6iuaQ68hRSbykUQcJUr4DoFBkm4wgd2hq4tBIt5iGqkmIYjIK97X2Ac+y7Al6Eas2r5VF3EkYVixIGsqzlkm0RXA05xqwaznFZjzk8V80Y+iIDhMyNdfSpEMp3IheR2cbKGSnSfWK1HK5rU73te+Y+mp46Jt6oD3xe3/MKUzoD2UBzNmu3iQW2uCJHd2ne9t/x3h7lnn4kBxCEAK//UgVlyjyz9W5JHgDWu3g3OlGHBZO/680MjgZCrLsuOfLU+5jPl2Pxck02uqzyqmPlhPA0isbdnhRis6Qh/S179zV226tq30IMf1KqJ+bHgSCHhjM64dbIL8GGt21vGOEXP+/AJcER6NjIb286TKSzTCCidNp6Zf3rpsWZnG5dNhuEqU94Fd2sYHaDOgM3A3LO9nxQazFRTOJsT7cD4eScDOsG8UfQGqlmCqM7L0/3ZpnWylRSPqBu/B+eHEfYNZO+0QTaWrYVbLURYIK4TWR8iESRGfHHQWgthnGCFSR6XhpDR2Xtq0uhr2QQvOUVv8Giw6ImYIgOdd8OPo1dxm1hQCQV84zTzso6krY75wTfRjcwV5Geb/tJ4owfFd8kC7FDPX9B9mBYVZ0zuK21vYoVpvazdgKlwKfwFKZSgPgFfDQtTRYNOvy6JNZ7OeYCWEFJq/hygT5KPD9mIbenEBsAvHdzCG/K5iPb4S4aP/YhnMDJHIP/icNM6ztIK9gkRRdA71nyoMef+2jb3neklwx0pHH2SIdKb2jwOWG3JCmYK4Iva+7eEG0a3If9Da4KaFAGMYlTTCfFBFSoyK7YMSwyuICgV8M49c7bf4VqtKi5LOaLKCJlVZ5zBpLrIr9LvsMNctO/oiM3ab/MknNJPPbnirNLPbGflQrRr2aJJYXg/QIsh8k1PXzz+z9w5gIxiXea4P0RlO2OUDqhJdvv8EBpRLy6Z9p8GR+FFKgDHcGsMkkbMnJz0q7hAhDVdF3sCfBM6hj2P4SlE5njIsBmSky6FhkNYd2UfgLt37a35+BEvupCA+Jh5kmC5dWaGeQNmz35EEQvhwZG3qxKo/RZr66hM7IJ5Won7gh78anK172Zt3buKAMKyMDjzdR9ufcCZ0zU4DOA5RKIgkAMTbytB3LQFlT5MH/An6qfRJPjj2dg5WFP3mdlZkwFePrA+3eN2Wu0A+WAFKZrztzJRibcqCweEddxU/PSGWxOnjHtOUDzfDk9lEvDDj39cFH1E9dVeQLGVI3Qgeo0M34dZ6K/3cb9BBZcZf8uS+BivagqBuLW31L60FMADuX1jiTur3n1ZrBrIgpkFO//0OmyT9qWthHcnwzLRswTdDbgUflRNCAvfaODDSX8vQLo7QBDltK42Y/OdFbS1zUYFLv6qSiV43zDiUrcAtbEqoMVBPa37+RMTuT1gmrJVH1qqYsi12cyakNWPLrTGqg9NO1KY2vPwISkCnxobu6FodJWlXUwABhb1LwveepTps6Tt0E8j+tabfLiI+MdLLWSxLqA1cJON1hz8aZkisUWXUMhNOQpLrIR062CCV3Bg0ZwlU9OhbKefT1NjDog/g2q+TAW89zQllayE0d/y9qAdSAucb3iKOXZYzSSmdealQNS1IL3qMUpowYU6uuO7LEqyPD05MgXvXy6frzzrkpBXlAx+J30gur7J4OT/ziwA3fvIcKvLAHet4sqms0BCkZk6CKbyRPu8Xqwsv5KGfYcI4thniGI9nFwFwt1bfZm9racBom20+/R8n0upa1EAueM5b9A7lN3BE9empZqOTj5NkKNeCf630MV2jeKeEP8cImJ5W9l3gYGDg1wPxxZcmBvsZ4qZXUMim6a/M2jKAsHtYvPN1A0FsH3AAbpFvCxA200RpdN9ME2nSQL2g5pg9OIw6KkYT3gKe7QmWrItoXK1c/XBbJQ6pVOca2BzfQfoOCTygsFljpEPDG+tBLrte+jUDP2DcYKLisBjhgtTZnAmgmg8/Aus/awVIZGqScBZ1xa/82qG7rzT0BDLldEs0sP5HS8oNhU3lhDue5NS0TUt0T7YTZvSGH0HEYEs97dJ7xpNO1TKokYmLWenco4PvNEsv2hQ85pcgDjlA29jwVT9IoAcXQGCnhPG8fgYyhJ64NNzBiWf5p1XdoBx+xtXoPiVbK44FcHipEqTaar9/ruKsdneZuJmevOHPOjhmtvwVVX8Nmx+/eftj7gZmxlF3ocI/n5T0byPxzPfMi24AxSQeAGjdI3Q4hc5ffAT7v7F89ZNEgj6fheuHl2hjRQlG4EMMwpiAnsm1HT499a+zKPMejH0uAfnT4JyItDTiDQ4l5DoO/sQZ0HkzGpiM8KQNwaHk0Un9WaO+yuA1ZTV9z8Jm13bqwTlfNHncIi8M/kHQMFhMF7Imo2mUw/Sox7Bh3W6UplqvEiy+g2NvVzFPCtGkHSTLuFSL2CtGzpPY+E5O0PK3HSbUnBzNBZodkNnUAlch2Zk9/9F8JuAYBirgoVpE7QyheJ33WDOysDFYMSXBdm20XfXCWcGzsGyvXE8FJN7EadsGjIDzZ+GtIUEBWuQ6o87kaDvo4eplYs4dz6P06lSSCA0yAvpXKD1djjC8dnWdYtWsLpl4Fplhje74Y6i/M7VMSQnRvD54/CC4LPzx4vghhIOzVo6bLzl7QIHPvVyM/drqBBZ3tW1lYqvXfauRfH5WHe+RcHI+xxeqDECqJ9tdXLyy9L7RqxyUaZKwmlAux+zEzdzITSRlr36YuSm0LBhTpkivodWytR6BNULFxftqF42QqKLmoog9WlYNRb4GtNm93bHuxBvV5VcOUeY6N/9xDutwbqYhaN3rIzpg1M6XfrYctTdA5Msr2v4Aydmb+Nl2/Eqw+jSXYvctmuDHYUAei0pUc6E5N1bULPEjHAr+HI3gwDjpDg0nE2fMkXneCumq9ifZR5IKUOqn0aDIfN64olrhaHfV4msozkdG/3j5HHqsf5Els8kwvDrCaK4/BXb+YzYC00mJEOu8njPsKgB9dG+FjqqeToCsJKLTvHS+iQTnqFquCJ+yCckuDaHLnP4GzroGg7BelrYZWStEFay3j+vkEuXHy3B2zG5xBqSx+/pxoEOv+OfiCfq5QMCCNq26xXC+1DZ+eQdH2jJ9FXSh9yrISZTk56jTzMIzG9+Ye+pumQffxmh2lcvPXjmNWL3PoOgRpkx4o/TZzE2y3IMtEZNxpNUlBqFlnBVXuPS0TIBkF+ZfvW3y2bGWD14zb8Cju5+wiSW1pIIRRtD0DeaxOLIvup5BZ2R2QfQVx6ryHH4H/rls/fRJy6KIdsJ/qVsWrBZaKgKOhP0GOUjA16wS+vlpcmot72SIWJWQDwyiD04TLSU6LyObtnOC2W5QA0OCGXHtlTi9Cyh95AIL8UU6AaQOaDSDfuf3DbxO4065WUdqPZ6Zj9S26jGlhDs/3mX1c4h+to5J2UwvgO3dkFtmKMBF3OuQvskMsOO8R5FnXblT4zMUpkjhs3m1ygag6zQWKfFOQCFM8jmAFtaCpCqDX77xqhE3B99uGU3UT+41SufAp9fQENvgk5lwqneywazIE9IpGT8v23sBPibAHG34mLWiivxnjk8p2S5ofshihnLQd4CU5ABpVcMX/5Hg39Jm55k+hgxugBCGIR5KmY+qz6US5/wKYimBbjTOSBlyD9OiYpWxtoLH6PcoaUdK0dW4vKR121dfMwumvgSBf8g0fsVN0w8jbplh7Df1FVC9wZuTbZStSswGJu6IngHRvBgOFag8F3hwPVNuUYjxNngNURuMvnnOvway+3l+1sK7aILbzdSzAxUCtG9/CaaHsBFIVzMWEH7upNL6Hr6P+oI4i+VqT6NyQrYUMkRXYd2P1ZjEMDaJ1rrurxTBgTfMw9cZe8SHIAz0JA7jpgDmr+InVbg0HrkFNZVhQ2uBKn75tLEZwfMp2azBhkglsAXDPx2BccwTDGmnsjRDh2jHh9ynTQY4vLqcuv/NWRlP8sFHWyxSmm38ikF1UoTywoZL0oFE4I4ujqIcvCuo+0ABPohIMdyq8EqgTcogXcYNCGdgvytDCA/fwt2eG78+OAANOgmKkOI8WdjE3FaFdqW6rx/oOBunJoqMLOwnPtv67Cw7PY8c4jFvek2G/hk1Thivu5Pf2iV8YDA8DyziBPz6MKlF9XQlRt7ZRV09nZrygwo00ME7IpFuOiEsUrd14UcCvNC/DPkbFmqB1uQIg477mFiq2niVADUYnvdjiQPNpFfMTo4yg4X+tDW3rmH2WE9E2rY0ES40wM6QRwaQL5/fepJULkj3Zc6L1ItuWmO6zXbvou399GBCPcQwB2+rRpubsw03qWL2iRyHH9Afl/YHuFYa8v7zEXDEigXJo9RAtTM4BTzElQhSgePv55AmHTo4W9v4SmkPDlLIhOpcXBK4GO2AnyzeN0MaKP7umX9bZAfc5LA84bxj3frYCxezbP9KG7QeJzevIhiAU4p/j+y2OyMV2mxNgAAAABJRU5ErkJggg==",Iy=r(127),Ay=r.n(Iy),Cy=r(128),Py=r.n(Cy),Ny=r(129),Oy=r.n(Ny),Ry=r(130),Dy=r.n(Ry),Ly=r(131),jy=r.n(Ly),zy=r(132),By=r.n(zy),Uy=r(133),Fy=r.n(Uy),Wy=r(134),Gy=r.n(Wy),Vy=r(135),Hy=r.n(Vy),Yy={wipe:function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r);var i=1;return"up"===e?i=1:"down"===e?i=2:"left"===e?i=3:"right"===e&&(i=4),(n=t.call(this,my.a,py.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,n}return r}(dy),fade:function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r);var i=1;return"out"===e?i=-1:"in"===e&&(i=1),(n=t.call(this,void 0,yy.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),n}return r}(dy),blinds:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,by.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n}return r}(dy),checkerboard:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Ty.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,n}return r}(dy),dissolve:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,ky.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),randombar:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Ay.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n.setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),circle:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Py.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),box:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Oy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),diamond:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Dy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),plus:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,jy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),barn:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,By.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="inHorizontal"===e?1:"outHorizontal"===e?2:"outVertical"===e?3:0,n}return r}(dy),strips:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Fy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="upLeft"===e?1:"downRight"===e?2:"upRight"===e?3:0,n}return r}(dy),wedge:function(e){p(r,e);var t=m(r);function r(e){return x(this,r),t.call(this,wy.a,Gy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return r}(dy),wheel:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Hy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,n}return r}(dy)},$y=function(e){p(r,e);var t=m(r);function r(e){var n,i;x(this,r),(n=t.call(this,e)).filterType="",n.isConflict=!1,n.activeWhenConflict="prev",n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r;if(n.filter){n.filter.percent=n.commonTimeNode.applyTimeFilter(i);var o=null===(t=n.timingTarget)||void 0===t?void 0:t.container.getBounds();o&&(n.filter.uniforms.uBoundRect=new Float32Array([o.x,o.y,o.width,o.height]))}i>=1&&n.timingTarget&&n.ctx.clock.setTimeout((function(){n.removeFilter()}),34)},n.onSeekToStart=function(){n.timingTarget&&n.removeFilter()},n.onSeekToEnd=function(){n.timingTarget&&n.removeFilter()},n.onDestroy=function(){n.removeFilter()},n.commonTimeNode.on("timelineStart",(function(){n.filter&&n.timingTarget&&(n.timingTarget.container.filters&&0!==n.timingTarget.container.filters.length?n.timingTarget.container.filters.push(n.filter):n.timingTarget.container.filters=[n.filter])})),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate);var o=1;"out"===e.json.transition&&(o=-1);var a=null===(i=e.json.filter)||void 0===i?void 0:i.match(/^([a-zA-Z]+)(\((.+)\))?/);if(a){var s=a[1],u=a[3];Yy[s]&&(n.filter=new Yy[s](u),n.filterType="".concat(s,"-").concat(u),n.filter&&(n.filter.transition=o))}return n}return S(r,[{key:"removeFilter",value:function(){var e,t=this;if((null===(e=this.timingTarget)||void 0===e?void 0:e.container.filters)&&this.filter){var r=this.timingTarget.container.filters.findIndex((function(e){return e===t.filter}));r>=0&&this.timingTarget.container.filters.splice(r,1)}}},{key:"modifyAttrKey",get:function(){return this.filterType}}]),r}(ny),Xy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startPos=null,n.onTimeNodeStart=function(){var e,t;n.startPos={x:(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_x)||0,y:(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_y)||0}},n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r,o=null===(t=n.path)||void 0===t?void 0:t.getPoint(i);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+ +n.timingTarget.design_ppt_y)},n.onSeekToStart=function(){n.timingTarget&&n.startPos&&(n.timingTarget.ppt_x=n.startPos.x,n.timingTarget.ppt_y=n.startPos.y)},n.onSeekToEnd=function(){var e,t,r,i=null!==(t=null===(e=n.commonTimeNode.json)||void 0===e?void 0:e.spd)&&void 0!==t?t:1,o=null===(r=n.path)||void 0===r?void 0:r.getPoint(i>0?1:0);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+n.timingTarget.design_ppt_y)},n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n.createPath(),n}return S(r,[{key:"createPath",value:function(){var e,t,r=new os,n=null===(e=this.json.path)||void 0===e?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(n){var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=a)||s(t)||k(t)||h(),l=u[0],f=u.slice(1);if("M"===l){var p=c(f.map((function(e){return Number(e)})),2),v=p[0],m=p[1];r.moveTo(v,m)}else if("L"===l){var g=c(f.map((function(e){return Number(e)})),2),y=g[0],_=g[1];r.lineTo(y,_)}else if("C"===l){var b=c(f.map((function(e){return Number(e)})),6),x=b[0],w=b[1],S=b[2],T=b[3],E=b[4],I=b[5];r.bezierCurveTo(x,w,S,T,E,I)}else if("Z"===l)r.closePath();else if("E"===l)console.warn("not implements");else if("c"===l){var A=c(f.map((function(e){return Number(e)})),6),C=A[0],P=A[1],N=A[2],O=A[3],R=A[4],D=A[5],L=r.currentPoint;r.bezierCurveTo(C+L.x,P+L.y,N+L.x,O+L.y,R+L.x,D+L.y)}else if("l"===l){var j=r.currentPoint,z=c(f.map((function(e){return Number(e)})),2),B=z[0],U=z[1];r.lineTo(B+j.x,U+j.y)}else if("m"===l){var F=r.currentPoint,W=c(f.map((function(e){return Number(e)})),2),G=W[0],V=W[1];r.moveTo(G+F.x,V+F.y)}}}catch(e){o.e(e)}finally{o.f()}}this.path=r}},{key:"modifyAttrKey",get:function(){return"motion"}}]),r}(ny),qy=function(e){p(r,e);var t=m(r);function r(e){var n,i;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.onTimelineStart=function(e){e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t,r,i,o,a,s=e.duration,u=e.delta/s,l={x:1,y:1};if(n.to){var c=null!==(t=n.from)&&void 0!==t?t:{x:null!==(i=null===(r=n.startVal)||void 0===r?void 0:r.x)&&void 0!==i?i:1,y:null!==(a=null===(o=n.startVal)||void 0===o?void 0:o.y)&&void 0!==a?a:1};l.x=c.x+(n.to.x-c.x)*u,l.y=c.y+(n.to.y-c.y)*u}else if(n.by){var h={x:n.by.x,y:n.by.y};l.x=1+(h.x-1)*u,l.y=1+(h.y-1)*u}n.timingTarget&&(n.timingTarget.scale=l)},n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y})},n.onSeekToStart=function(){n.timingTarget&&n.startVal&&(n.timingTarget.scale=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&(n.timingTarget.scale=n.createVal)},n.from=e.json.from,n.to=e.json.to,n.by=e.json.by,n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),(null===(i=n.timingTarget)||void 0===i?void 0:i.scale.x)&&(n.createVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y}),n}return S(r,[{key:"updateCurrentValue",value:function(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}},{key:"modifyAttrKey",get:function(){return"scale"}}]),r}(ny),Qy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isTimelineStart=!1,n.startColorString=null,n.currentColorString="#FFFFFFFF",n.onTimelineStart=function(e){if(!n.isTimelineStart){n.isTimelineStart=!0,e.isReverse||n.updateCurrentValue(),n.from.isInit()||n.from.fromHexString(n.currentColorString),n.to.isInit()||n.from.by(n.by,n.to);var t=c(n.json.cBhvr.attrList[0].split("."),1)[0];ty(n.timingTarget,t+".on","true")}},n.onTimeNodeEnd=function(){var e=n.json.cBhvr.attrList[0];if("remove"===n.json.cBhvr.ctn.fill){var t=c(e.split("."),1)[0];ty(n.timingTarget,t+".on","false")}n.isTimelineStart=!1},n.onSeekToStart=function(){var e,t=n.json.cBhvr.attrList[0];if(n.timingTarget){n.onTimeUpdate({duration:1,delta:0});var r="ppt_c.color"===t||"text.color"===t;if((null===(e=n.timingTarget.fill)||void 0===e?void 0:e.designColor.toUpperCase())===n.from.toHexString().toUpperCase()||r){var i=c(t.split("."),1)[0];ty(n.timingTarget,i+".on","false")}}},n.onTimeNodeStart=function(){if(n.timingTarget){var e=n.json.cBhvr.attrList[0],t=ry(n.timingTarget,e);t&&(n.startColorString=t)}},n.onTimeUpdate=function(e){var t=e.delta/e.duration;if(n.to.interpolationFrom(n.from,t,n.target),n.timingTarget){var r=n.json.cBhvr.attrList[0];ty(n.timingTarget,r,n.target.toHexString())}},n.onSeekToEnd=function(){n.isTimelineStart||n.onTimelineStart({isReverse:!1,activeCount:0,id:""}),n.onTimeUpdate({duration:1,delta:1})},n.replaceAttrToRelation(),"rgb"===n.json.clrSpc?(n.from=new Hv(n.json.from),n.to=new Hv(n.json.to),n.by=new Hv(n.json.by),n.target=new Hv):(n.from=new Vv(n.json.from),n.to=new Vv(n.json.to),n.by=new Vv(n.json.by),n.target=new Vv),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeEnd",n.onTimeNodeEnd),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n}return S(r,[{key:"replaceAttrToRelation",value:function(){var e=this.json.cBhvr.attrList[0];"ppt_c"!==e?"style.color"===e&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}},{key:"updateCurrentValue",value:function(){if(this.timingTarget){var e=this.json.cBhvr.attrList[0],t=ry(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),Zy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.lastVal=null,n.onTimelineStart=function(e){n.lastVal=null,e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=0;if(void 0!==n.from&&void 0!==n.to){var o=(i=n.from)+(n.to-i)*r;n.timingTarget&&(n.timingTarget.r=o)}else if(void 0!==n.by){n.lastVal||(n.lastVal=0);var a=n.by*r-n.lastVal;n.lastVal=n.by*r,n.timingTarget&&(n.timingTarget.r+=a)}},n.onTimeNodeCreate=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.createVal=n.timingTarget.r)},n.onTimeNodeStart=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.startVal=n.timingTarget.r)},n.onSeekToStart=function(){n.timingTarget&&null!==n.startVal&&(n.timingTarget.r=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){n.timingTarget&&null!==n.createVal&&(n.timingTarget.r=n.createVal),n.startVal=null},n.from=n.json.from,n.to=n.json.to,n.by=n.json.by,n.by?n.isConflict=!1:n.isConflict=!0,n.onTimeNodeCreate(),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n}return S(r,[{key:"updateCurrentValue",value:function(){var e;this.currentVal=null===(e=this.timingTarget)||void 0===e?void 0:e.r}},{key:"modifyAttrKey",get:function(){return"rotate"}}]),r}(ny),Ky=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isApplied=!1,n.onTimeUpdate=function(){var e,t,r=n.json,i=r.cmd,o=r.cmdType;!n.isApplied&&i&&o&&(n.isApplied=!0,null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand(i,o),n.commonTimeNode.seekToEnd(!1))},n.onSeekToStart=function(){var e,t;n.commonTimeNode.isInInteractiveSeq||null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand("custom-pause","call")},n.onSeekToEnd=function(){},n.commonTimeNode.on("timeNodeStart",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeNodeEnd",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("seekToStart",n.onSeekToStart),n.commonTimeNode.on("seekToEnd",n.onSeekToEnd),n}return S(r,[{key:"modifyAttrKey",get:function(){var e,t,r,n;return(null!==(t=null===(e=this.json)||void 0===e?void 0:e.cmd)&&void 0!==t?t:"")+(null!==(n=null===(r=this.json)||void 0===r?void 0:r.cmdType)&&void 0!==n?n:"")}}]),r}(ny),Jy=function e(t){var r=this;x(this,e),this.runtimeNodeEventHub=new Ks.a,this.onVolumeUpdate=function(e){r.audio.volume(e)},this.stopAudio=function(){r.audio.stop()},this.destroy=function(){r.stopAudio(),r.audio.destroy(),r.ctx.activeMedia.delete(r.audio),r.ctx.volumeAdjuster.off("update",r.onVolumeUpdate)};var n=t.json,i=t.isIterate,o=t.isSub,a=t.eventHub,s=t.ctx,u=t.parent,l=t.iterateType,c=t.iterateIndex,h=t.iterateId,d=t.isInInteractiveSeq,f=t.fromSeqId;this.json=n,this.id=n.cMediaNode.ctn.id,this.commonTimeNode=new t_({json:n.cMediaNode.ctn,isSub:o,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:s,parent:u,isIterate:i,iterateType:l,iterateIndex:c,iterateId:h,isInInteractiveSeq:d,fromSeqId:f});var p=n.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info("redirect media url from ".concat(n.cMediaNode.tgtEl," to ").concat(p," by delegate."),s.taskId)),this.audio=new Hg(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",(function(){r.audio.volume(s.volumeAdjuster.volume),r.audio.play()})),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)};function e_(e){return(null===(t=e)||void 0===t?void 0:t.cBhvr)?e.cBhvr.ctn:function(e){var t,r;return!!(null===(r=null===(t=e)||void 0===t?void 0:t.cMediaNode)||void 0===r?void 0:r.ctn)}(e)?e.cMediaNode.ctn:e.ctn;var t}var t_=function(e){p(r,e);var t=m(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).uuid=uv(),n.isSub=!1,n.isShadow=!1,n.startCount=0,n.applyCount=0,n.isReverse=!1,n.isConflictDispose=!1,n.isIterateEnd=!1,n.parentTimeNode=null,n.isActive=!1,n.isDestroy=!1,n.shouldSeekOnStart=!1,n.repeatTimeoutId="",n.iterateShadows=[],n.isEndEventsEmitted=!1,n.tmFilter=[],n.timeDelta=0,n.isIterate=!1,n.iterateType="el",n.iterateIndex=0,n.children=[],n.subList=[],n.duration=0,n.isNegativeSpeed=!1,n.handleEndCond=function(){n.isActive&&(n.isActive=!1,n.isInfiniteRepeat()?n.repeatTimeNodeEnd():n.seekToEnd(!1,!0))},n.handleActive=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(n.isActive=!0,n.isConflictDispose=!1,n.applyCount+=1,n.json.iterate||n.emit("timeNodeStart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startCount>0&&n.json.restart){if("never"===n.json.restart)return;"whenNotActive"!==n.json.restart&&"always"!==n.json.restart||(n.seekToStart(),n.emit("timeNodeRestart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startTimeLine(e))}else n.startTimeLine(e)},n.updateTimeLine=function(e){var t=e/(rd.b.TARGET_FPMS||.06);n.timeDelta+=t,n.duration-n.timeDelta<=t&&(n.timeDelta=n.duration),n.timeDelta0&&void 0!==arguments[0]&&arguments[0];(n.isTimeNodeEnd()||e)&&(n.isActive=!1,n.isSub&&n.destroy(),n.emitEndEvents())};var a=e.isSub,s=e.isIterate,u=e.ctx,l=e.eventHubs,c=e.parent,h=e.json,d=e.iterateType,f=e.iterateId,p=e.iterateIndex,v=e.isInInteractiveSeq,m=e.fromSeqId;n.isSub=a,n.fromSeqId=m,n.isInInteractiveSeq=v,n.isIterate=s,n.parentTimeNode=c,n.json=h,n.ctx=u,n.iterateIndex=p,n.eventHubs=l,n.iterateType=d,n.iterateId=f,n.tmFilter=null!==(o=null===(i=h.tmFilter)||void 0===i?void 0:i.split(";").map((function(e){return e.split(",").map((function(e){return parseFloat(e.trim())}))})))&&void 0!==o?o:[];var g=Number(n.json.dur),y=n.json.spd||1;if(n.isNegativeSpeed=y<0,Number.isNaN(g)||(n.duration=g/Math.abs(y)),n.uuid+="--"+n.json.id,n.setPreStyle(),h.childTnLst&&n.createChildren(h.childTnLst),n.startConds=new Jg(n.json.id||"",h.stCondLst,l,n.ctx),n.endConds=new Jg(n.json.id||"",h.endCondLst,l,n.ctx),h.endSync&&(n.endSync=new Jg(n.json.id||"",[h.endSync],l,n.ctx),n.endSync.on("active",(function(){var e;"interactiveSeq"===n.json.nodeType&&(n.isActive=!1,n.shouldSeekOnStart=!0,n.emit("timeNodeEndSync"),null===(e=n.endSync)||void 0===e||e.reset())}))),n.startConds.on("active",(function(e){n.isActive||(n.shouldSeekOnStart&&(n.shouldSeekOnStart=!1,n.seekToStart()),n.handleActive(e))})),n.endConds.on("active",(function(){n.handleEndCond(),n.children.forEach((function(e){return e.commonTimeNode.handleEndCond()}))})),n.parentTimeNode&&n.parentTimeNode.on("timeNodeStart",(function(){n.applyCount=0})),n.isSub&&"nextClick"===n.json.masterRel){var _="shape slide onNext"+n.fromSeqId;n.startConds.addCond({event:_})}return n.json.iterate&&!1===n.isIterate&&n.createIterateShadow(),n}return S(r,[{key:"createIterateShadow",value:function(){var e=this,t=uv(),n=!0,i=0;for(this.ctx.eventHub.on("IterateTimeNodeEnd",(function r(i){i===t&&(n=!1,e.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))}));n;){var o=JSON.parse(JSON.stringify(this.json)),a=new r({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[i]=a,i+=1}}},{key:"isInfiniteRepeat",value:function(){return this.json.repeatCount>999999998}},{key:"getReverse",value:function(){return this.isReverse}},{key:"setReverse",value:function(e){this.isReverse=e}},{key:"createTimeNode",value:function(e,t){var r=null,n={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return"seq"===e.type?r=new ey(n):"par"===e.type?r=new r_(n):"set"===e.type?r=new iy(n):"anim"===e.type?r=new hy(n):"animEffect"===e.type?r=new $y(n):"animMotion"===e.type?r=new Xy(n):"animScale"===e.type?r=new qy(n):"animClr"===e.type?r=new Qy(n):"animRot"===e.type?r=new Zy(n):"cmd"===e.type?r=new Ky(n):"audio"===e.type&&(r=new Jy(n)),r}},{key:"createSubList",value:function(e){var t=this;this.subList&&this.subList.forEach((function(e){return e.commonTimeNode.destroy()})),this.subList=[],e.forEach((function(e){var r=t.createTimeNode(e,!0);r&&t.subList.push(r)}))}},{key:"bindCommonTimeNodeEvent",value:function(e){var t=this;e.commonTimeNode.on("timeNodeStart",(function(e){t.emit("childTimeNodeStart",e)})),e.commonTimeNode.on("timeNodeEnd",(function(e){t.emit("childTimeNodeEnd",e),t.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))&&(t.json.iterate||t.allChildrenEndHandle())}))}},{key:"createChildren",value:function(e){var t=this;function r(e){return e_(e).presetOrder}function n(e){return/^slide/.test(e)?"slide":/^layout/.test(e)?"layout":/^master/.test(e)?"master":"unknow"}var i=["master","layout","slide","unknow"];e&&e[0]&&r(e[0])?a(e).sort((function(e,t){var o,a,s,u,l=e_(e).id,c=e_(t).id;if(l&&c){var h=n(l),d=n(c);return h===d?(null!==(o=r(e))&&void 0!==o?o:0)-(null!==(a=r(t))&&void 0!==a?a:0):i.indexOf(h)-i.indexOf(d)}return(null!==(s=r(e))&&void 0!==s?s:0)-(null!==(u=r(t))&&void 0!==u?u:0)})).forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))})):e.forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))}))}},{key:"playReverse",value:function(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach((function(e){return e.commonTimeNode.playReverse()}))}},{key:"allChildrenEndHandle",value:function(){var e=this;if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout((function(){e.seekToStart(!1),e.resetForRepeat(),e.startTimeNodeRepeat()})):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}},{key:"resetForRepeat",value:function(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach((function(e){return e.commonTimeNode.resetForRepeat()}))}},{key:"startSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.startTimeNode()}))}},{key:"startReverseTimeLine",value:function(){this.isEndEventsEmitted=!1,this.timeDelta=0;var e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(__.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(__.animateStart),this.ctx.ticker.add(this.updateTimeLine))}},{key:"startTimeLine",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit("time ".concat(this.json.id," begin")),this.eventHubs.global.emit("time ".concat(this.json.id," onBegin")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," begin"))),this.json.iterate)this.startIterate();else{this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});var r=1e3/this.ctx.ticker.maxFPS;this.duration<=r&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce((function(){e.onTimeLineEnd()}))):this.duration>r&&(this.ctx.eventHub.emit(__.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}}},{key:"startIterate",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.json.iterate){e.next=24;break}this.isIterateEnd=!1,t=M(this.iterateShadows),e.prev=3,t.s();case 5:if((r=t.n()).done){e.next=15;break}if(n=r.value,!this.isIterateEnd){e.next=9;break}return e.abrupt("break",15);case 9:return n.children.forEach((function(e){e.commonTimeNode.startTimeNode()})),n.applyCount+=1,e.next=13,this.ctx.clock.delay(this.json.iterate.interval);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),t.e(e.t0);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.onTimeLineEnd();case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])})))}},{key:"applyTimeFilter",value:function(e){if(!this.tmFilter.every((function(e){return Sv()(e[0])&&Sv()(e[1])})))return e;for(var t=0;t0?this.tmFilter[this.tmFilter.length-1][1]:e}},{key:"isNatureTimeEnd",value:function(){return this.duration>=0&&this.timeDelta>=this.duration}},{key:"findTargets",value:function(){var e=[];return function t(r){r.forEach((function(r){var n,i,o;r.cBhvr&&r.cBhvr.target&&e.findIndex((function(e){return e.id===r.cBhvr.target.id}))<0&&e.push(r.cBhvr.target),(null===(i=null===(n=null==r?void 0:r.cBhvr)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&t(r.cBhvr.ctn.childTnLst),(null===(o=null==r?void 0:r.ctn)||void 0===o?void 0:o.childTnLst)&&r.ctn.childTnLst.length>0&&t(r.ctn.childTnLst)}))}(this.json.childTnLst||[]),e}},{key:"setPreStyle",value:function(){var e=this;this.json.presetClass&&this.findTargets().forEach((function(t){if(e.json.iterate)for(var r=0,n=!0;n;){var i=e.ctx.timingTargets.getTarget(t,!0,{type:e.json.iterate.type,index:r,id:""});i&&(e.setPreStyleForTarget(i),r+=1),n=!!i}else{var o=e.ctx.timingTargets.getTarget(t,!1);o&&e.setPreStyleForTarget(o)}}))}},{key:"setPreStyleForTarget",value:function(e){var t,r;if(e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset)if("entr"===this.json.presetClass){var n=null===(r=null===(t=this.json)||void 0===t?void 0:t.childTnLst)||void 0===r?void 0:r.filter((function(e){return"set"===e.type&&"visible"===e.to}));(null==n?void 0:n.length)&&(e.hasPreset=!0,e.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass||"emph"===this.json.presetClass)&&(e.hasPreset=!0,e.style.visibility="visible")}},{key:"startTimeNodeRepeat",value:function(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}},{key:"startTimeNodeForce",value:function(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}},{key:"startTimeNode",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.isDestroy){this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);var t=this.json.stCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];t&&this.startConds.condHandle(t);var r=this.json.endCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];r&&this.endConds.condHandle(r),this.startConds.condHandle()}}},{key:"onTimeLineEnd",value:function(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}},{key:"clearSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.destroy()}))}},{key:"seekToStart",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(t){return t.seekToStart(e)}));if(e)for(var t=this.subList.length-1;t>=0;t--){var r=this.subList[t];null==r||r.commonTimeNode.seekToStart()}for(var n=this.children.length-1;n>=0;n--){var i=this.children[n];null==i||i.commonTimeNode.seekToStart()}if(this.children.length>1)for(var o=this.children.length-1;o>=0;o--){var a=this.children[o];null==a||a.commonTimeNode.seekToStart()}}},{key:"repeatTimeNodeEnd",value:function(){this.dispose(),this.children.forEach((function(e){e.commonTimeNode.isActive=!1,e.commonTimeNode.dispose()}))}},{key:"dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isConflictDispose=e,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(__.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(e){}this.startConds.reset(),this.endConds.reset()}},{key:"seekToEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isInfiniteRepeat()){!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();var r=this.json.autoRev||e;if(r?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(e){return e.seekToEnd(r,t)}));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach((function(e){return e.commonTimeNode.seekToEnd(r,t)})),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach((function(e){return e.commonTimeNode.seekToEnd(!1)})),this.clearSubList())}}},{key:"isTimeNodeEndWhenDetectEndSync",value:function(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"isTimeNodeEnd",value:function(){var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEnd()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"emitEndEvents",value:function(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit("time ".concat(this.json.id," end")),this.eventHubs.global.emit("time ".concat(this.json.id," onEnd")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," end")),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}},{key:"collectStartValue",value:function(){this.emit("timeNodeCreate"),this.children.forEach((function(e){return e.commonTimeNode.collectStartValue()}))}},{key:"destroy",value:function(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach((function(e){return e.commonTimeNode.destroy()})),this.clearSubList()}}]),r}(Ks.a),r_=function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r),(n=t.call(this)).isRunning=!1,n.runtimeNodeEventHub=new Ks.a;var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,c=e.eventHub,h=e.iterateIndex,d=e.iterateId,f=e.isInInteractiveSeq,p=e.fromSeqId;return n.id=i.ctn.id,n.json=i,n.ctx=l,n.isIterate=a,n.globalEventHub=c,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:c,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:h,iterateId:d,isInInteractiveSeq:f,fromSeqId:p}),n.commonTimeNode.on("timeNodeStart",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.setReverse(n.commonTimeNode.getReverse()),e.commonTimeNode.startTimeNode()})),n.isRunning||(n.isRunning=!0,n.globalEventHub.emit("runtime ".concat(n.id," begin")),n.emit("begin"))})),n.commonTimeNode.on("timeNodeRepeat",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.startTimeNode(!1)}))})),n.commonTimeNode.on("timeNodeEnd",(function(){n.commonTimeNode.isTimeNodeEnd()&&n.isRunning&&(n.isRunning=!1,n.globalEventHub.emit("runtime ".concat(n.id," end")),n.emit("end")),"exit"===n.commonTimeNode.json.presetClass&&n.commonTimeNode.children.length>=1&&n.commonTimeNode.children[n.commonTimeNode.children.length-1]instanceof iy&&n.commonTimeNode.children.forEach((function(e){e instanceof iy||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),n}return r}(Ks.a),n_=function(){function e(t,r,n){x(this,e),this.json=t,this.ctx=n,this.globalEventHub=r;var i=t.timeNodeList.find((function(e){return"par"===e.type&&"tmRoot"===e.ctn.nodeType}));i&&(this.tmRoot=new r_({json:i,isSub:!1,isIterate:!1,eventHub:r,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"mainSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))}return S(e,[{key:"findSeq",value:function(e){var t;return null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.find((function(t){var r,n,i;return"seq"===(null===(r=t.json)||void 0===r?void 0:r.type)&&(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.id)===e}))}},{key:"start",value:function(){var e,t;return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.json.autoPlayMainSeq){r.next=6;break}return r.next=3,this.ctx.clock.delay(16);case 3:null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode(),r.next=7;break;case 6:null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode();case 7:case"end":return r.stop()}}),r,this)})))}},{key:"setMainSeqApplied",value:function(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}},{key:"collectMainSeqStartValue",value:function(){var e;null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.collectStartValue()}},{key:"setMainSeqStep",value:function(e,t){var r;-1===e&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(r=this.mainSeq)||void 0===r||r.setCurrentStep(e,t)}},{key:"destroy",value:function(){var e;this.globalEventHub.removeAllListeners(),null===(e=this.tmRoot)||void 0===e||e.commonTimeNode.destroy()}},{key:"hasMainSeq",value:function(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}},{key:"currentMainSeqState",value:function(){return this.mainSeq?this.mainSeq.currentState:null}},{key:"currentMainSeqStep",value:function(){return this.mainSeq?this.mainSeq.currentStep:0}},{key:"currentMainSeqLength",value:function(){return this.mainSeq?this.mainSeq.stepLength:0}},{key:"mainSeqHasNextStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasNext()}},{key:"mainSeqHasPrevStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasPrev()}},{key:"seekInteractiveSeqToEnd",value:function(e){var t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n=this.findSeq(e);n&&n.setCurrentStep(t,r)}},{key:"resetAllInteractiveSeq",value:function(){var e;((null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.filter((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"interactiveSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))||[]).forEach((function(e){e.setCurrentStep(0,"start")}))}},{key:"applyInteractiveAction",value:function(e){this.globalEventHub.emit(e)}}]),e}(),i_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o_=function(e){p(r,e);var t=m(r);function r(e,n,i,o){var a;x(this,r),(a=t.call(this,{id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},n,{parentGlobalPos:i},o)).isRendered=!1,a.isTimingStartValueCollected=!1,a.json=e,a.json.smartArtShapeList&&(n.smartArtShapeList=a.json.smartArtShapeList),n.hasBackgroundFillShape=a.detectUseBackgroundFill(a.json),a.container.visible=!1,a.ctx=n;var s=new Nd;return s.beginFill(16777215),s.drawRect(0,0,e.width,e.height),s.endFill(),a.container.addChild(s),a}return S(r,[{key:"detectUseBackgroundFill",value:function(e){var t=this;return!!e&&("Picture"===e.type||"Shape"===e.type?e.useBgFill:!(!e.children||!Array.isArray(e.children))&&e.children.some((function(e){return t.detectUseBackgroundFill(e)})))}},{key:"initOnReuse",value:function(){var e=this;f(b(r.prototype),"initOnReuse",this).call(this),this.ctx.timingEventHub.on("c:prev slide",(function(t){e.ctx.eventHub.emit(__.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,r){e.ctx.eventHub.emit(__.requestNextSlide,t,r)}))}},{key:"applyEffectCacheAsBitMap",value:function(e){this.children.forEach((function(t){return t.applyEffectCacheAsBitMap(e)}))}},{key:"render",value:function(e){var t=this;this.isRendered||(this.collectAnimatedIds().forEach((function(e){return t.ctx.animatedIds.add(e)})),this.isRendered=!0,f(b(r.prototype),"render",this).call(this,e),e.addSubMTask((function(){return i_(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.eventHub.emit("StageRenderEnd");case 1:case"end":return e.stop()}}),e,this)})))}),"@StageImpl[emit.StageRenderEnd]"))}},{key:"isListTimeNode",value:function(e){return["excel","seq","par"].indexOf(e.type)>=0}},{key:"isAnimatedTimeNode",value:function(e){return!!e.cBhvr}},{key:"collectAnimatedIdsForTimeNode",value:function(e,t){var r,n=this;this.isListTimeNode(e)?null===(r=e.ctn.childTnLst)||void 0===r||r.forEach((function(e){n.collectAnimatedIdsForTimeNode(e,t)})):this.isAnimatedTimeNode(e)&&t.push(e.cBhvr.target.id)}},{key:"collectAnimatedIds",value:function(){var e=this,t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach((function(r){e.collectAnimatedIdsForTimeNode(r,t)})),t}},{key:"createTiming",value:function(){this.json.timing&&!this.timing&&(this.timing=new n_(this.json.timing,this.ctx.timingEventHub,this.ctx))}},{key:"startTiming",value:function(){var e;return(null===(e=this.timing)||void 0===e?void 0:e.start())||Promise.resolve()}},{key:"setMainSeqApplied",value:function(){var e;null===(e=this.timing)||void 0===e||e.setMainSeqApplied()}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.timing)||void 0===r||r.setMainSeqStep(e,t)}},{key:"collectMainSeqStartValue",value:function(){var e;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(e=this.timing)||void 0===e||e.collectMainSeqStartValue())}},{key:"hasTiming",value:function(){return!!this.timing}},{key:"clearOnSlideChange",value:function(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),f(b(r.prototype),"clearOnSlideChange",this).call(this)}},{key:"clearOnTransactionEnd",value:function(){var e,t;this.ctx.timingTargets.getTargets().forEach((function(e){e.hasPreset=!1})),null===(e=this.timing)||void 0===e||e.resetAllInteractiveSeq(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0}},{key:"destroy",value:function(){var e,t;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(e=this.ctx.bgTexture)||void 0===e||e.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0,f(b(r.prototype),"destroy",this).call(this)}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqStep())&&void 0!==t?t:0}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"mainSeqState",value:function(){return this.timing?this.timing.currentMainSeqState():null}},{key:"nextStep",value:function(e,t){var r;this.hasTiming()&&(null===(r=this.timing)||void 0===r?void 0:r.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",e,t)):this.ctx.eventHub.emit(__.requestNextSlide,e,t)}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hasTiming()&&(null===(e=this.timing)||void 0===e?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(__.requestPrevSlide,t)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.timing)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.timing)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.timing)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){return i_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=this.ctx.medias[e],n.t0=i,!n.t0){n.next=21;break}if(!t){n.next=18;break}if(!r){n.next=14;break}return n.next=7,dv((function(){return i.clippedDuration>0}),5e3);case 7:if(n.t1=r=0&&t.tasks.splice(r,1)})),e.once("task-error",(function(){var r=t.tasks.indexOf(e);r>=0&&t.tasks.splice(r,1)}))}},{key:"start",value:function(){this.couldRunning=!0}},{key:"stop",value:function(){this.couldRunning=!1}}]),e}(),s_=function(e){return new Promise((function(t){return setTimeout(t,e)}))},u_=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).slideIndex=e,o.taskId=n,o.logger=i,o.uuid=uv(),o.isCancel=!1,o.tasks=[],o}return S(r,[{key:"isEmpty",value:function(){return 0===this.tasks.length}},{key:"addMTask",value:function(e,t){this.tasks.push({fn:e,state:"wait",sub:[],name:t})}},{key:"addSubMTask",value:function(e,t){var r=this.tasks.findIndex((function(e){return"running"===e.state}));r<0&&(r=0),this.tasks[r].sub.push({fn:e,state:"wait",sub:[],name:t})}},{key:"cancel",value:function(){this.tasks=[],this.isCancel=!0}},{key:"applyNext",value:function(){var e=this;if(!this.tasks.some((function(e){return"running"===e.state}))&&!this.tasks.some((function(e){return"error"===e.state})))if(this.tasks.every((function(e){return"finish"===e.state})))this.isCancel||this.emit("task-finish");else{var t=this.tasks.find((function(e){return"wait"===e.state}));t&&(t.state="running",t.fn.apply(null).then((function(){if(t.state="finish",t.sub.length>0){var r,n=e.tasks.findIndex((function(e){return e===t}));(r=e.tasks).splice.apply(r,[n+1,0].concat(a(t.sub)))}})).catch((function(r){t.state="error",e.logger.error("".concat(r," ").concat(r.stack),e.taskId),e.emit("task-error",nv.transform(r),e.slideIndex)})))}}},{key:"applyAll",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.tasks.every((function(e){return"finish"===e.state}))){e.next=14;break}if(!this.tasks.some((function(e){return"running"===e.state}))){e.next=6;break}return e.next=4,s_(16);case 4:e.next=12;break;case 6:if(!this.tasks.some((function(e){return"error"===e.state}))){e.next=8;break}return e.abrupt("return");case 8:return e.delegateYield(regeneratorRuntime.mark((function e(){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.tasks.find((function(e){return"wait"===e.state})))){e.next=17;break}return r.state="running",e.prev=3,e.next=6,hv((function(){return r.fn.apply(null)}),6e4);case 6:if(e.t0=e.sent,e.t1=lv,e.t0!==e.t1){e.next=10;break}throw new nv(Zp.RuntimeError,"subtask ".concat(r.name," apply timeout"));case 10:r.state="finish",r.sub.length>0&&(i=t.tasks.findIndex((function(e){return e===r})),(n=t.tasks).splice.apply(n,[i+1,0].concat(a(r.sub)))),e.next=17;break;case 13:return e.prev=13,e.t2=e.catch(3),o=(null==e.t2?void 0:e.t2.errorType)?e.t2:new nv(Zp.RuntimeError,"subtask ".concat(r.name," error. ").concat(e.t2)),r.state="error",t.logger.error("".concat(e.t2," ").concat(e.t2.stack),t.taskId),t.emit("task-error",nv.transform(o),t.slideIndex),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,13]])}))(),"t0",9);case 9:if("break"!==e.t0){e.next=12;break}return e.abrupt("break",14);case 12:e.next=0;break;case 14:!this.isCancel&&this.tasks.every((function(e){return"finish"===e.state}))&&this.emit("task-finish");case 15:case"end":return e.stop()}}),e,this)})))}}]),r}(Ks.a),l_=function(){function e(t,r){var n=this;x(this,e),this.renderer=t,this.localStorage=r,this.worker=null,this.outputData=new Map,this.loadingSdfKeys=new Set;var i=new Blob(['\nself.onmessage = function(e) {\n var data = e.data.data;\n var key = e.data.key;\n var height = Math.ceil(e.data.height);\n var width = Math.ceil(e.data.width);\n if (!data || !key) {\n return;\n }\n var maxDis = 0;\n var d = [];\n var p = [];\n var maxInt = Number.MAX_SAFE_INTEGER || 255 * 255 * 255;\n var setD = function(x, y, v) { d[y * width + x] = v; };\n var getD = function(x, y) { return d[y * width + x]; };\n var setP = function(x, y, v) { p[y * width + x] = v; };\n var getP = function(x, y) { return p[y * width + x]; };\n var isContains = function(x, y) { return x >= 0 && x < width && y >= 0 && y < height; };\n var isInterior = function(x, y) { return data[(y * width + x) * 4 + 3] > 10; };\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var c = isInterior(x, y);\n var t = isContains(x, y - 1) ? isInterior(x, y - 1) : false;\n var b = isContains(x, y + 1) ? isInterior(x, y + 1) : false;\n var l = isContains(x - 1, y) ? isInterior(x - 1, y) : false;\n var r = isContains(x + 1, y) ? isInterior(x + 1, y) : false;\n if (c !== t || c !== b || c !== l || c !== r) {\n setD(x, y, 0);\n setP(x, y, [x, y]);\n } else {\n setD(x, y, maxInt);\n setP(x, y, [-1, -1]);\n }\n }\n }\n \n var f = function (x, y, dir) {\n var d1 = 1;\n var d2 = Math.sqrt(2);\n var dx;\n var dy;\n var od;\n switch (dir) {\n case "TL": dx = -1; dy = -1; od = d2; break;\n case "T": dx = 0; dy = -1; od = d1; break;\n case "TR": dx = 1; dy = -1; od = d2; break;\n case "L": dx = -1; dy = 0; od = d1; break;\n case "R": dx = 1; dy = 0; od = d1; break;\n case "BL": dx = -1; dy = 1; od = d2; break;\n case "B": dx = 0; dy = 1; od = d1; break;\n case "BR": dx = 1; dy = 1; od = d2; break;\n }\n var b = isContains(x + dx, y + dy);\n var cb = b ? getD(x + dx, y + dy) : maxInt;\n if (cb + od < getD(x, y)) {\n var p = b ? getP(x + dx, y + dy) : [-1, -1];\n var dis = Math.sqrt(Math.pow(x - p[0], 2) + Math.pow(y - p[1], 2));\n setP(x, y, p);\n setD(x, y, dis);\n if (dis > maxDis) {\n maxDis = dis;\n }\n }\n };\n \n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var dirs = ["TL", "T", "TR", "L"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n for (var y = height - 1; y >= 0; -- y) {\n for (var x = width - 1; x >= 0; -- x) {\n var dirs = ["R", "BL", "B", "BR"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n var outputData = [];\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n outputData.push(isInterior(x, y) ? 255: 0);\n outputData.push(0);\n outputData.push(0);\n outputData.push(Math.ceil(getD(x, y) / maxDis * 255));\n }\n }\n self.postMessage({\n key, outputData, maxDis\n });\n};\n'],{type:"text/javascript"});this.worker=new Worker(URL.createObjectURL(i)),this.worker.onmessage=function(e){n.outputData.set(e.data.key,{data:e.data.outputData,maxDis:e.data.maxDis})},this.outputData.set("111","222")}return S(e,[{key:"createSdfByWorker",value:function(e,t,r,n,i,o,a,s){var u=document.createElement("canvas");u.width=i,u.height=o;var l=u.getContext("2d");if(l&&this.worker){l.drawImage(a,e,t,r,n);var c=l.getImageData(0,0,i,o).data;this.worker.postMessage({data:c,key:s,width:i,height:o})}}},{key:"createSdf",value:function(e,t,r){var n=document.createElement("canvas");n.width=e,n.height=t;var i=n.getContext("2d");if(!i)return{src:"",maxDis:1};i.drawImage(r,0,0);for(var o=0,a=i.getImageData(0,0,e,t).data,s=[],u=[],l=function(t,r,n){s[r*e+t]=n},c=function(t,r){return s[r*e+t]},h=function(t,r,n){u[r*e+t]=n},d=function(r,n){return r>=0&&r=0&&n10},p=0;po&&(o=m)}},w=0;w=0;--k)for(var E=e-1;E>=0;--E)for(var I=0,A=["R","BL","B","BR"];It.maxResolution.x||s>t.maxResolution.y){var n=(r=t.maxResolution.x/a)*s;n>t.maxResolution.y&&(r*=t.maxResolution.y/n)}return o.loadSpriteSheetItem(t.url,t.taskId,e,r)}),"@StagePool[spriteTexture.loadSpriteSheetItem]")})),Promise.resolve()}),"@StagePool[loadSpriteSheets]")}},{key:"createStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){var n=t.stageJsons[e],i=t.stageCtxs[e],o=new o_(n,i,{x:0,y:0},r);return t.stageImpls[e]=o,Promise.resolve()}),"@StagePool[createStage]")}},{key:"preRenderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return t.stageImpls[e].preRender(r),Promise.resolve()}),"@StagePool[preRenderStage]")}},{key:"createGraphicsTexture",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(n=this.stageCtxs[e]).graphicsTexture.pack().forEach((function(e,t){r.addSubMTask((function(){return n.graphicsTexture.render(e,t,i.objPoolGroup,1)}),"@StagePool[graphicsTexture.render]")}));case 2:case"end":return t.stop()}}),t,this)})))}),"@StagePool[createGraphicsTexture]")}},{key:"renderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.stageImpls[e],t.next=3,n.render(r);case 3:case"end":return t.stop()}}),t,this)})))}),"@StagePool[renderStage]")}},{key:"destroyStageByIndex",value:function(e){"load"===this.stageStates[e].state&&this.stageStates[e].task.cancel(),delete this.stageStates[e],this.stageImpls[e].destroy(),delete this.stageImpls[e],delete this.stageCtxs[e]}},{key:"destroyStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);Math.abs(e.currentStageIndex-r)>e.cacheCount&&e.destroyStageByIndex(r)}))}},{key:"destroyAllStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);e.destroyStageByIndex(r)}))}},{key:"preload",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stageImpls[e]||this.stageStates[e])return Promise.resolve();var n=new u_(e,this.taskId,this.logger);return n.on("task-error",(function(e,r){delete t.stageStates[r],delete t.stageImpls[r],delete t.stageCtxs[r],t.errorChannel.emit("error",e,r)})),this.stageStates[e]={state:"load",task:n},this.createCtx(e),this.loadStageJson(e),this.loadSpriteSheets(e),this.createStage(e),this.preRenderStage(e),this.createGraphicsTexture(e),this.renderStage(e),this.microTaskManager.addTask(n),r?n.applyAll():new Promise((function(r){n.once("task-finish",(function(){t.stageStates[e].state="finish",Object.keys(t.stageStates).length>2*t.cacheCount+1&&t.destroyStage(),r()}))}))}},{key:"getStageJson",value:function(e){return this.stageJsons[e]||null}},{key:"getStage",value:function(e){return c_(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.currentStageIndex=e,"finish"!==(null==(r=this.stageStates[e])?void 0:r.state)||!this.stageImpls[e]){t.next=6;break}t.t0=this.stageImpls[e],t.next=16;break;case 6:if("load"!==(null==r?void 0:r.state)){t.next=12;break}return t.next=9,r.task.applyAll();case 9:t.t1=this.stageImpls[e],t.next=15;break;case 12:return t.next=14,this.preload(e,!0);case 14:t.t1=this.stageImpls[e];case 15:t.t0=t.t1;case 16:return t.abrupt("return",t.t0);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"destroy",value:function(){this.runningAudio.clear(),this.sdfManager.destroy()}}]),e}(),d_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},f_=function(){function e(t){var r,n=this;x(this,e),this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,null===(r=e.localCache)||void 0===r||r.ready((function(e){e||(n.isIndexDBReady=!0)})).catch((function(){t.warn("local storage not ready",n.taskId)}))}return S(e,[{key:"attachTaskId",value:function(e){this.taskId=e}},{key:"getItem",value:function(t){return d_(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null,!this.couldUseIndexDBCache||!e.localCache){r.next=10;break}return r.prev=2,r.next=5,hv((function(){return e.localCache.getItem("".concat(i.taskId,"/").concat(t))}),500);case 5:n=r.sent,r.next=10;break;case 8:r.prev=8,r.t0=r.catch(2);case 10:return r.abrupt("return",(n=n===lv?null:n)||this.memoryCache.get(t)||null);case 11:case"end":return r.stop()}}),r,this,[[2,8]])})))}},{key:"setItem",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return d_(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(this.couldUseIndexDBCache){i.next=2;break}return i.abrupt("return",(n&&this.memoryCache.set(t,r),Promise.resolve()));case 2:if(!e.localCache){i.next=13;break}return o=null,i.prev=4,i.next=7,hv((function(){return e.localCache.setItem("".concat(a.taskId,"/").concat(t),r).catch((function(){n&&a.memoryCache.set(t,r)}))}),500);case 7:o=i.sent,i.next=12;break;case 10:i.prev=10,i.t0=i.catch(4);case 12:o!==lv&&null!==o||!n||this.memoryCache.set(t,r);case 13:case"end":return i.stop()}}),i,this,[[4,10]])})))}},{key:"dispose",value:function(){var t,r=this;this.memoryCache=new Map,this.couldUseIndexDBCache&&(null===(t=e.localCache)||void 0===t||t.keys().then((function(t){t.filter((function(e){return e.indexOf(r.taskId)>=0})).forEach((function(t){var r;null===(r=e.localCache)||void 0===r||r.removeItem(t).catch((function(){}))}))})).catch((function(){})))}},{key:"couldUseIndexDBCache",get:function(){return this.isIndexDBReady&&this.taskId.length>0}}]),e}();f_.localCache=null;try{f_.localCache=_.createInstance({name:"slide_local_cache",driver:_.INDEXEDDB,version:1})}catch(u){}var p_=new jl.j,v_=function(){function e(t){x(this,e),this.localStorage=t}return S(e,[{key:"canvas",value:function(t,r,n,i){var o,a,s,u=!1,l=!1;t&&(t instanceof $l.p?s=t:(s=r.generateTexture(t),l=!0)),s?(o=s.baseTexture.resolution,a=s.frame,u=!1,r.renderTexture.bind(s)):(o=r.resolution,u=!0,(a=p_).width=r.width,a.height=r.height,r.renderTexture.bind(null));var c=Math.floor(a.width*o+1e-4),h=Math.floor(a.height*o+1e-4),d=document.createElement("canvas");d.width=c,d.height=h;var f=d.getContext("2d");if(!f)throw new Error("ctx");if(n)f.putImageData(n,0,0);else{var p=f.getImageData(0,0,c,h),v=new Uint8Array(4*c*h),m=r.gl;m.readPixels(a.x*o,a.y*o,c,h,m.RGBA,m.UNSIGNED_BYTE,v),e.arrayPostDivide(v,p.data),f.putImageData(p,0,0),i&&this.localStorage.setItem(i,p).catch((function(){}))}if(u){var g=document.createElement("canvas");g.width=c,g.height=h;var y=g.getContext("2d");y.scale(1,-1),y.drawImage(d,0,-h),d=g}return l&&(null==s||s.destroy(!0)),d}}],[{key:"arrayPostDivide",value:function(e,t){for(var r=0;r1&&(e=1),this._volume=e,this.emit("update",this._volume)}}]),r}(Ks.a),g_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Rl.skipHello();var y_={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip",gallery:"Gallery",switch:"Switch",prism:"Prism",doors:"Doors"},__={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",mediaStop:"mediaStop",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",requestOpenUrl:"requestOpenUrl",userInput:"userInput",fullscreenChange:"fullscreenChange",changeLocalFullscreenState:"changeLocalFullscreenState"},b_=function(e){p(r,e);var t=m(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(this,r),(n=t.call(this)).errorChannel=new Ks.a,n.transactionPlayer=null,n.isForward=!0,n.drawCall=0,n.scale=1,n._isPaused=!1,n.maxResolution=new jl.g(0,0),n.isNVIDIA=!1,n.fps=new rv,n.designWidth=0,n.designHeight=0,n.currentIndex=0,n.slideCount=0,n.runtime={drawCall:0,fps:0},n.globalEventHub=new Ks.a,n.globalVideoBackground=new Nd,n.globalVideoSprite=new Ld,n.onMousemoveTimeout=null,n.cacheFunctionMap=new Map,n.isPlayerPaused=function(){return n._isPaused},n.onWebGLLost=function(){n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost."))},n.fullscreenOnMousemove=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!0}),n.onMousemoveTimeout&&clearTimeout(n.onMousemoveTimeout),n.onMousemoveTimeout=setTimeout((function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})}),jg)},n.fullscreenOnMouseleave=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})},n.calculateFullscreenVideoPosition=function(e){var t=e.width,r=e.height,i=y(n),o=i.designWidth,a=i.designHeight,s=Math.min(o/t,a/r);return{x:(o-t*s)/2,y:(a-r*s)/2,width:t*s,height:r*s}},n.onRequestFullscreenVideo=function(e){var t=e.texture,r=e.index,i=e.targetId;if(r===n.currentIndex){n.onRequestCancelFullscreenVideo(),n.globalVideoBackground.width=n.designWidth,n.globalVideoBackground.height=n.designHeight,n.globalVideoBackground.beginFill(0,1),n.globalVideoBackground.drawRect(0,0,n.designWidth,n.designHeight),n.globalVideoBackground.endFill(),n.globalVideoBackground.interactive=!0,n.app.stage.addChild(n.globalVideoBackground);var o=n.calculateFullscreenVideoPosition(t),a=o.x,s=o.y,u=o.width,l=o.height;n.globalVideoSprite.texture=t,n.globalVideoSprite.width=u,n.globalVideoSprite.height=l,n.globalVideoSprite.position.x=a,n.globalVideoSprite.position.y=s,n.globalVideoBackground.addChild(n.globalVideoSprite),n.globalEventHub.emit("onFullscreenChange",{status:!0,targetId:i,slideIndex:n.currentIndex}),n.clearFullscreenEventListenersWithAppView();var c={handleEvent:function(){var e;null===(e=n.currentStage)||void 0===e||e.ctx.eventHub.emit(__.userInput)}};if(n.app.view.addEventListener("pointerdown",c,!1),n.cacheFunctionMap.set("pointerdown",c),Og.isDesktop()){var h={handleEvent:function(){n.fullscreenOnMouseleave({index:r,targetId:i})}};n.app.view.addEventListener("mouseout",h,!1);var d={handleEvent:function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:r,targetId:i,status:!0})}};n.app.view.addEventListener("mouseover",d,!1);var f={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("mousemove",f,!1),n.cacheFunctionMap.set("mouseover",d),n.cacheFunctionMap.set("mousemove",f),n.cacheFunctionMap.set("mouseout",h)}else{var p={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("touchstart",p,!1),n.cacheFunctionMap.set("touchstart",p)}}else t.destroy(!1)},n.onRequestCancelFullscreenVideo=function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.globalVideoSprite.texture.destroy(!1);try{n.globalVideoBackground.removeChild(n.globalVideoSprite)}catch(e){n.logger.error("removeChild error: PPTPlayer:1057",n.taskId)}try{n.app.stage.removeChild(n.globalVideoBackground)}catch(e){n.logger.error("removeChild error: PPTPlayer:1062",n.taskId)}n.globalEventHub.emit("onFullscreenChange",{status:!1,slideIndex:n.currentIndex,targetId:null===(e=n.currentStage)||void 0===e?void 0:e.ctx.latestChangeFullscreenTargetId}),n.clearFullscreenEventListenersWithAppView(),r&&n.emit(__.changeLocalFullscreenState,{status:!1,slideIndex:n.currentIndex,targetId:null===(t=n.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},n.logger=e.logger,n.tracker=e.tracker,n.mode=e.mode,n.volumeAdjuster=e.volumeAdjuster,n.localStorage=new f_(n.logger),n.cachedExtract=new v_(n.localStorage),n.config={minFPS:ru()(i.minFPS)?30:i.minFPS,maxFPS:ru()(i.maxFPS)?40:i.maxFPS,resolution:ru()(i.resolution)?1:i.resolution,autoFPS:!ru()(i.autoFPS)&&i.autoFPS,autoResolution:!ru()(i.autoResolution)&&i.autoResolution,transactionBgColor:ru()(i.transactionBgColor)?0:i.transactionBgColor,maxResolutionLevel:n.getMaxResolution(i.maxResolutionLevel),forceCanvas:!ru()(i.forceCanvas)&&i.forceCanvas,enableNvidiaDetect:!ru()(i.enableNvidiaDetect)&&i.enableNvidiaDetect},n.updateMaxResolutionLevel(n.config.maxResolutionLevel),n.loader=new vv(n.localStorage,e.useLocalCache,n.logger,n.tracker,e.resourceTimeout,e.loadDelegate,e.urlInterrupter);var o=Rl.isWebGLSupported();n.app=new Xl({antialias:!0,autoDensity:!1,backgroundColor:16777215,forceCanvas:n.config.forceCanvas||!o}),globalThis.__PIXI_APP__=n.app,n.tracker({name:"slidePlayerCreate",result:"",reason:"",payload:{webgl:o,resolution:n.config.resolution,minFPS:n.config.minFPS,maxFPS:n.config.maxFPS,maxResolutionLevel:n.config.maxResolutionLevel,forceCanvas:n.config.forceCanvas}}),n.updateConfig(n.config),n.app.ticker.maxFPS=60,n.app.ticker.minFPS=n.config.minFPS,n.app.ticker.maxFPS=n.config.maxFPS,n.app.view.style.zIndex="1",n.app.stage.sortableChildren=!0;var a=n.app.renderer;if(a.gl){var s=a.gl.drawElements,u=a.gl.getExtension("WEBGL_debug_renderer_info"),l=a.gl.getParameter(u.UNMASKED_RENDERER_WEBGL);/nvidia/i.test(l)&&n.config.enableNvidiaDetect&&(n.isNVIDIA=!0),a.gl.drawElements=function(){for(var e=arguments.length,t=new Array(e),r=0;r=t&&n.updateResolution(i)}}else if(e>n.config.maxFPS&&n.config.autoResolution){var o=n.scale*n.config.resolution,a=n.app.renderer.resolution,s=Math.min(o,a+.1);s<=n.config.resolution&&n.updateResolution(s)}})),n.app.ticker.add((function(){n.runtime.drawCall=n.drawCall,n.runtime.fps=Math.floor(n.app.ticker.minFPS),n.drawCall=0}),null,zl.c.LOW),n.clock=new mv(n.app.ticker),n.objPoolGroup=uv(),n.stagePool=new h_(n.loader,n.mode,n.app.renderer,n.app.ticker,n.app.view,n.clock,n.objPoolGroup,n.errorChannel,n.localStorage,n.logger,e.loadDelegate,e.urlInterrupter,n.isPlayerPaused,n.maxResolution,n.volumeAdjuster,n.config.forceCanvas,n.globalEventHub),n.app.view.addEventListener("webglcontextlost",n.onWebGLLost);try{n.config.forceCanvas||(n.transactionPlayer=new Ol)}catch(s){/Error creating WebGL context/.test(s.message)?n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost.")):n.errorChannel.emit("error",new nv(Zp.RuntimeWarn,s.message))}return n.globalEventHub.on("requestFullscreen",n.onRequestFullscreenVideo),n.globalEventHub.on("requestCancelFullscreen",n.onRequestCancelFullscreenVideo),n}return S(r,[{key:"getMaxResolution",value:function(e){return!ru()(e)&&Number.isInteger(e)?(e<1&&(e=1),e>4&&(e=4),e):r.platform.isAndroid()||r.platform.isIOS()?2:4}},{key:"updateMaxResolutionLevel",value:function(e){e<0&&(e=0),e>4&&(e=4);var t=[640,960,1280,1920,3200][e],r=[360,540,720,1080,1800][e];this.maxResolution.set(t,r)}},{key:"updateConfig",value:function(e){ru()(e.maxFPS)||ru()(e.minFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS,this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),ru()(e.resolution)||(this.config.resolution=e.resolution,this.updateResolution(this.scale*this.config.resolution)),ru()(e.autoFPS)||(this.config.autoFPS=e.autoFPS),ru()(e.autoResolution)||(this.config.autoResolution=e.autoResolution),ru()(e.transactionBgColor)||(this.config.transactionBgColor=e.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),ru()(e.maxResolutionLevel)||(this.config.maxResolutionLevel=e.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}},{key:"preload",value:function(e){return g_(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e<1||e>this.slideCount,t.t0){t.next=6;break}return this.logger.info("preload slide ".concat(e," begin"),this.taskId),t.next=5,this.stagePool.preload(e);case 5:this.logger.info("preload slide ".concat(e," end"),this.taskId);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setResourceData",value:function(e,t){this.logger.info("ppt player init config: "+JSON.stringify(this.config),e),this.logger.info("set resource to "+t,e),this.taskId=e,this.url=t,this.stagePool.setResourceData(e,t),this.localStorage.attachTaskId(e),this.loader.attachTaskId(e)}},{key:"setInteractive",value:function(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}},{key:"translateEvent",value:function(e,t){var r=this;t.forEach((function(t){e.on(t,(function(){for(var e,n,i,o,a=arguments.length,s=new Array(a),u=0;u0&&this.view&&p&&(m=s.json.transition,!this.isForward&&(null==p?void 0:p.json.transition)&&(m=p.json.transition),g=this.getTransactionTexture(p,this.view,null,null),this.initTransactionPlayer(m),null===(r=this.transactionPlayer)||void 0===r||r.setPrevTexture(g),v=!0),this.app.stage.addChild(s.container),this.updateResolution(this.config.resolution*this.scale),p){p.clearOnTransactionEnd();try{this.app.stage.removeChild(p.container)}catch(e){this.logger.error("removeChild error: PPTPlayer:622",this.taskId)}}if(!(s.json.transition&&s.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&v)){i.next=31;break}return i.next=24,this.getTransactionTexture(s,this.view,u,l);case 24:return y=i.sent,this.transactionPlayer.setNextTexture(y),i.next=28,this.transactionPlayer.play();case 28:if(_=this.transactionPlayer.renderer.domElement,this.view.parentElement&&_)try{this.view.parentElement.removeChild(_)}catch(e){this.logger.error("removeChild error: PPTPlayer:637",this.taskId)}null===(n=this.transactionPlayer)||void 0===n||n.dispose();case 31:if(!this.isForward){i.next=36;break}return i.next=34,s.startTiming();case 34:i.next=37;break;case 36:s.setMainSeqApplied();case 37:s.ctx.slideScopeEventHub.emit("slide-render",s.ctx.slideIndex),this.emit(__.renderEnd,e),this.emit(__.slideChange,e),s.ctx.isRendering=!1,this.preload(e+1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e+1)})),this.preload(e-1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-a,"ms"),this.taskId),this.tracker({name:"slidePageChange",reason:"",result:"",payload:{duration:Date.now()-a,from:o,to:e}});case 45:case"end":return i.stop()}}),i,this)})))}},{key:"getTransactionTexture",value:function(e,t,r,n){var i=$l.p.create({width:e.json.width,height:e.json.height,resolution:1});this.app.renderer.render(e.container,{renderTexture:i});var o=this.cachedExtract.canvas(i,this.app.renderer,n,r);return new W(o)}},{key:"renderToBase64",value:function(e,t,r){return g_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.stagePool.getStage(e);case 2:if(!(i=n.sent)){n.next=10;break}return o=i.json,a=o.width,s=o.height,this.designWidth=a,this.designHeight=s,u=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:u}),l=this.app.renderer.plugins.extract.base64(u,r),n.abrupt("return",(this.stagePool.destroyStageByIndex(e),l));case 10:return n.abrupt("return","__null__");case 11:case"end":return n.stop()}}),n,this)})))}},{key:"renderMainSeqToBase64",value:function(e,t,r){return g_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l,c,h,d,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=[],n.next=3,this.stagePool.getStage(e);case 3:if((o=n.sent).createTiming(),o)for(a=o.json,s=a.width,u=a.height,this.designWidth=s,this.designHeight=u,l=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),o.container.visible=!0,c=o.mainSeqLength(),o.setMainSeqStep(0,"start"),this.app.renderer.render(o.container,{renderTexture:l}),h=this.app.renderer.plugins.extract.base64(l,r),i.push(h),d=0;dr.maxResolution.x||n*r.designHeight>r.maxResolution.y;)n-=.1;r.app.renderer.resolution=n,r.app.renderer.plugins.interaction.resolution=r.app.renderer.resolution,r.app.renderer.resize(r.designWidth,r.designHeight),eu()(t)&&t()}))}},{key:"nextStep",value:function(e,t){var r;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(r=this.currentStage)||void 0===r||r.nextStep(e,t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(e=this.currentStage)||void 0===e||e.prevStep(t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqStep())&&void 0!==t?t:0}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMainSeqStep(e,t)}},{key:"mainSeqState",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqState())&&void 0!==t?t:null}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"nextTick",value:function(e){this.app.ticker.addOnce((function(){e()}),zl.c.LOW)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.currentStage)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){var n;return g_(this,void 0,void 0,regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(n=this.currentStage)||void 0===n?void 0:n.setMediaState(e,t,r);case 2:case"end":return i.stop()}}),i,this)})))}},{key:"setMediaCurrentTime",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMediaCurrentTime(e,t)}},{key:"pause",value:function(){var e;this.app.ticker.stop(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalPause()})),this._isPaused=!0}},{key:"resume",value:function(){var e;this._isPaused=!1,this.app.ticker.start(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalResume()}))}},{key:"getSnapshot",value:function(){return this.currentStage&&this.getBase64(this.currentStage)||""}},{key:"clearLocalCache",value:function(){this.localStorage.dispose()}},{key:"clearFullscreenEventListenersWithAppView",value:function(){var e=this;["mousemove","mouseout","mouseover","touchstart","pointerdown"].forEach((function(t){e.cacheFunctionMap.has(t)&&(e.app.view.removeEventListener(t,e.cacheFunctionMap.get(t),!1),e.cacheFunctionMap.delete(t))}))}},{key:"syncFullscreenVideoState",value:function(e){this.globalEventHub.emit("syncFullscreenVideoState",e)}},{key:"destroy",value:function(){var e;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost),this.app.renderer.filter.texturePool.clear(!0),Ev.collectObjectByGroup(this.objPoolGroup),Iv.collectObjectByGroup(this.objPoolGroup),null===(e=this.transactionPlayer)||void 0===e||e.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy(),this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext(),this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),this.tracker({name:"slidePlayerDestroy",result:"",reason:"",payload:{}})}catch(e){}}},{key:"view",get:function(){return this.app.renderer?this.app.view:null}},{key:"nextSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}},{key:"prevSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}}],[{key:"clearLocalCache",value:function(){var e;null===(e=f_.localCache)||void 0===e||e.clear().catch((function(){}))}}]),r}(Ks.a);b_.platform=Og,b_.RtcAudioClazz=null;var x_,w_=new Map,S_=r(136),T_=r.n(S_),M_=r(24),k_=r.n(M_),E_=r(50),I_=r.n(E_),A_=[],C_="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(x_||(x_={}));var P_,N_=function(e){return Object.freeze(e)},O_=function(e,t){this.inlineSize=e,this.blockSize=t,N_(this)},R_=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,N_(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),D_=function(e){return e instanceof SVGElement&&"getBBox"in e},L_=function(e){if(D_(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},j_=function(e){var t;if(e instanceof Element)return!0;var r=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},z_="undefined"!=typeof window?window:{},B_=new WeakMap,U_=/auto|scroll/,F_=/^tb|vertical/,W_=/msie|trident/i.test(z_.navigator&&z_.navigator.userAgent),G_=function(e){return parseFloat(e||"0")},V_=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new O_((r?t:e)||0,(r?e:t)||0)},H_=N_({devicePixelContentBoxSize:V_(),borderBoxSize:V_(),contentBoxSize:V_(),contentRect:new R_(0,0,0,0)}),Y_=function(e,t){if(void 0===t&&(t=!1),B_.has(e)&&!t)return B_.get(e);if(L_(e))return B_.set(e,H_),H_;var r=getComputedStyle(e),n=D_(e)&&e.ownerSVGElement&&e.getBBox(),i=!W_&&"border-box"===r.boxSizing,o=F_.test(r.writingMode||""),a=!n&&U_.test(r.overflowY||""),s=!n&&U_.test(r.overflowX||""),u=n?0:G_(r.paddingTop),l=n?0:G_(r.paddingRight),c=n?0:G_(r.paddingBottom),h=n?0:G_(r.paddingLeft),d=n?0:G_(r.borderTopWidth),f=n?0:G_(r.borderRightWidth),p=n?0:G_(r.borderBottomWidth),v=h+l,m=u+c,g=(n?0:G_(r.borderLeftWidth))+f,y=d+p,_=s?e.offsetHeight-y-e.clientHeight:0,b=a?e.offsetWidth-g-e.clientWidth:0,x=i?v+g:0,w=i?m+y:0,S=n?n.width:G_(r.width)-x-b,T=n?n.height:G_(r.height)-w-_,M=S+v+b+g,k=T+m+_+y,E=N_({devicePixelContentBoxSize:V_(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:V_(M,k,o),contentBoxSize:V_(S,T,o),contentRect:new R_(h,u,S,T)});return B_.set(e,E),E},$_=function(e,t,r){var n=Y_(e,r),i=n.borderBoxSize,o=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(t){case x_.DEVICE_PIXEL_CONTENT_BOX:return a;case x_.BORDER_BOX:return i;default:return o}},X_=function(e){var t=Y_(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=N_([t.borderBoxSize]),this.contentBoxSize=N_([t.contentBoxSize]),this.devicePixelContentBoxSize=N_([t.devicePixelContentBoxSize])},q_=function(e){if(L_(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},Q_=function(){var e=1/0,t=[];A_.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new X_(t.target),i=q_(t.target);n.push(r),t.lastReportedSize=$_(t.target,t.observedBox),ie?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},K_=[],J_=0,eb={attributes:!0,characterData:!0,childList:!0,subtree:!0},tb=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rb=function(e){return void 0===e&&(e=0),Date.now()+e},nb=!1,ib=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!nb){nb=!0;var r,n=rb(e);r=function(){var r=!1;try{r=function(){var e,t=0;for(Z_(t);A_.some((function(e){return e.activeTargets.length>0}));)t=Q_(),Z_(t);return A_.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:C_}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=C_),window.dispatchEvent(e)),t>0}()}finally{if(nb=!1,e=n-rb(),!J_)return;r?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!P_){var t=0,r=document.createTextNode("");new MutationObserver((function(){return K_.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),P_=function(){r.textContent="".concat(t?t--:t++)}}K_.push(e),P_()}((function(){requestAnimationFrame(r)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,eb)};document.body?t():z_.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),tb.forEach((function(t){return z_.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),tb.forEach((function(t){return z_.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ob=function(e){!J_&&e>0&&ib.start(),!(J_+=e)&&ib.stop()},ab=function(){function e(e,t){this.target=e,this.observedBox=t||x_.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=$_(this.target,this.observedBox,!0);return e=this.target,D_(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),sb=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ub=new WeakMap,lb=function(e,t){for(var r=0;r=0&&(i&&A_.splice(A_.indexOf(r),1),r.observationTargets.splice(n,1),ob(-1))},e.disconnect=function(e){var t=this,r=ub.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),hb=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cb.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.unobserve(this,e)},e.prototype.disconnect=function(){cb.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),db=function(){function e(e,t,r,n,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=r,this.index=e,this.slideIndex=t,this.eventHub=n,this.id=i}return e.prototype.apply=function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var e;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(null===(r=e.tasks[i])||void 0===r||r.apply()),n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask()),e.eventHub.emit("task-end-"+t.id)})),this.eventHub.on("task-error",(function(t){var r=t.task,n=e.tasks.findIndex((function(e){return e.index===r.index}));n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask())}))}return e.prototype.replaceIdleTask=function(){for(var e,t=this,r=new Set,n=0,i=this.tasks.length;n=0;r--)t=[e[r].apply(this,t)];return t[0]}},each:function(e,t,r){if(e)if(vb&&e.forEach&&e.forEach===vb)e.forEach(t,r);else if(e.length===e.length+0){var n,i=void 0;for(i=0,n=e.length;i1?gb.toArray(arguments):arguments[0];return gb.each(yb,(function(t){if(t.litmus(e))return gb.each(t.conversions,(function(t,r){if(_b=t.read(e),!1===bb&&!1!==_b)return bb=_b,_b.conversionName=r,_b.conversion=t,gb.BREAK})),gb.BREAK})),bb},wb=void 0,Sb={hsv_to_rgb:function(e,t,r){var n=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),o=r*(1-t),a=r*(1-i*t),s=r*(1-(1-i)*t),u=[[r,s,o],[a,r,o],[o,r,s],[o,a,r],[s,o,r],[r,o,a]][n];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,r){var n=Math.min(e,t,r),i=Math.max(e,t,r),o=i-n,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=e===i?(t-r)/o:t===i?2+(r-e)/o:4+(e-t)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/i,v:i/255})},rgb_to_hex:function(e,t,r){var n=this.hex_with_component(0,2,e);return n=this.hex_with_component(n,1,t),this.hex_with_component(n,0,r)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,r){return r<<(wb=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var Wb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=n||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,gb.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=Fb(i.__impliedStep),i}return Ib(t,e),kb(t,[{key:"setValue",value:function(e){var r=e;return void 0!==this.__min&&rthis.__max&&(r=this.__max),void 0!==this.__step&&r%this.__step!=0&&(r=Math.round(r/this.__step)*this.__step),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,r)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=Fb(e),this}}]),t}(Ob),Gb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,n));i.__truncationSuspended=!1;var o=i,a=void 0;function s(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=a-e.clientY;o.setValue(o.getValue()+t*o.__impliedStep),a=e.clientY}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),jb.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);gb.isNaN(e)||o.setValue(e)})),jb.bind(i.__input,"blur",(function(){s()})),jb.bind(i.__input,"mousedown",(function(e){jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),a=e.clientY})),jb.bind(i.__input,"keydown",(function(e){13===e.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,s())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e,r,n;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),r=this.__precision,n=Math.pow(10,r),Math.round(e*n)/n),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb);function Vb(e,t,r,n,i){return n+(e-t)/(r-t)*(i-n)}var Hb=function(e){function t(e,r,n,i,o){Mb(this,t);var a=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,{min:n,max:i,step:o})),s=a;function u(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(Vb(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function c(e){var t=e.touches[0].clientX,r=s.__background.getBoundingClientRect();s.setValue(Vb(t,r.left,r.right,s.__min,s.__max))}function h(){jb.unbind(window,"touchmove",c),jb.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),jb.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),u(e)})),jb.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(jb.bind(window,"touchmove",c),jb.bind(window,"touchend",h),c(e))})),jb.addClass(a.__background,"slider"),jb.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb),Yb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===n?"Fire":n,jb.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),jb.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Ib(t,e),kb(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Ob),$b=function(e){function t(e,r){Mb(this,t);var n=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));n.__color=new Cb(n.getValue()),n.__temp=new Cb(0);var i=n;n.domElement=document.createElement("div"),jb.makeSelectable(n.domElement,!1),n.__selector=document.createElement("div"),n.__selector.className="selector",n.__saturation_field=document.createElement("div"),n.__saturation_field.className="saturation-field",n.__field_knob=document.createElement("div"),n.__field_knob.className="field-knob",n.__field_knob_border="2px solid ",n.__hue_knob=document.createElement("div"),n.__hue_knob.className="hue-knob",n.__hue_field=document.createElement("div"),n.__hue_field.className="hue-field",n.__input=document.createElement("input"),n.__input.type="text",n.__input_textShadow="0 1px 1px ",jb.bind(n.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),jb.bind(n.__input,"blur",h),jb.bind(n.__selector,"mousedown",(function(){jb.addClass(this,"drag").bind(window,"mouseup",(function(){jb.removeClass(i.__selector,"drag")}))})),jb.bind(n.__selector,"touchstart",(function(){jb.addClass(this,"drag").bind(window,"touchend",(function(){jb.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),jb.bind(window,"mousemove",f),jb.bind(window,"touchmove",f),jb.bind(window,"mouseup",l),jb.bind(window,"touchend",l)}function u(e){p(e),jb.bind(window,"mousemove",p),jb.bind(window,"touchmove",p),jb.bind(window,"mouseup",c),jb.bind(window,"touchend",c)}function l(){jb.unbind(window,"mousemove",f),jb.unbind(window,"touchmove",f),jb.unbind(window,"mouseup",l),jb.unbind(window,"touchend",l),d()}function c(){jb.unbind(window,"mousemove",p),jb.unbind(window,"touchmove",p),jb.unbind(window,"mouseup",c),jb.unbind(window,"touchend",c),d()}function h(){var e=xb(this.value);!1!==e?(i.__color.__state=e,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__saturation_field.getBoundingClientRect(),r=e.touches&&e.touches[0]||e,n=r.clientX,o=r.clientY,a=(n-t.left)/(t.right-t.left),s=1-(o-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),i.__color.v=s,i.__color.s=a,i.setValue(i.__color.toOriginal()),!1}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__hue_field.getBoundingClientRect(),r=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return r>1?r=1:r<0&&(r=0),i.__color.h=360*r,i.setValue(i.__color.toOriginal()),!1}return gb.extend(n.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),gb.extend(n.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:n.__field_knob_border+(n.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),gb.extend(n.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),gb.extend(n.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),gb.extend(a.style,{width:"100%",height:"100%",background:"none"}),qb(a,"top","rgba(0,0,0,0)","#000"),gb.extend(n.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=n.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",gb.extend(n.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:n.__input_textShadow+"rgba(0,0,0,0.7)"}),jb.bind(n.__saturation_field,"mousedown",s),jb.bind(n.__saturation_field,"touchstart",s),jb.bind(n.__field_knob,"mousedown",s),jb.bind(n.__field_knob,"touchstart",s),jb.bind(n.__hue_field,"mousedown",u),jb.bind(n.__hue_field,"touchstart",u),n.__saturation_field.appendChild(a),n.__selector.appendChild(n.__field_knob),n.__selector.appendChild(n.__saturation_field),n.__selector.appendChild(n.__hue_field),n.__hue_field.appendChild(n.__hue_knob),n.domElement.appendChild(n.__input),n.domElement.appendChild(n.__selector),n.updateDisplay(),n}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=xb(this.getValue());if(!1!==e){var t=!1;gb.each(Cb.COMPONENTS,(function(r){if(!gb.isUndefined(e[r])&&!gb.isUndefined(this.__color.__state[r])&&e[r]!==this.__color.__state[r])return t=!0,{}}),this),t&&gb.extend(this.__color.__state,e)}gb.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,n=255-r;gb.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,qb(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),gb.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+n+","+n+","+n+",.7)"})}}]),t}(Ob),Xb=["-moz-","-o-","-webkit-","-ms-",""];function qb(e,t,r,n){e.style.background="",gb.each(Xb,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+r+" 0%, "+n+" 100%); "}))}var Qb='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',Zb=function(e,t){var r=e[t];return gb.isArray(arguments[2])||gb.isObject(arguments[2])?new Bb(e,t,arguments[2]):gb.isNumber(r)?gb.isNumber(arguments[2])&&gb.isNumber(arguments[3])?gb.isNumber(arguments[4])?new Hb(e,t,arguments[2],arguments[3],arguments[4]):new Hb(e,t,arguments[2],arguments[3]):gb.isNumber(arguments[4])?new Gb(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Gb(e,t,{min:arguments[2],max:arguments[3]}):gb.isString(r)?new Ub(e,t):gb.isFunction(r)?new Yb(e,t,""):gb.isBoolean(r)?new zb(e,t):null},Kb=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},Jb=function(){function e(){Mb(this,e),this.backgroundElement=document.createElement("div"),gb.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),jb.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),gb.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;jb.bind(this.backgroundElement,"click",(function(){t.hide()}))}return kb(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),gb.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",jb.unbind(e.domElement,"webkitTransitionEnd",t),jb.unbind(e.domElement,"transitionend",t),jb.unbind(e.domElement,"oTransitionEnd",t)};jb.bind(this.domElement,"webkitTransitionEnd",t),jb.bind(this.domElement,"transitionend",t),jb.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-jb.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-jb.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var r=t||document,n=document.createElement("style");n.type="text/css",n.innerHTML=e;var i=r.getElementsByTagName("head")[0];try{i.appendChild(n)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var ex=function(){try{return!!window.localStorage}catch(e){return!1}}(),tx=void 0,rx=!0,nx=void 0,ix=!1,ox=[],ax=function e(t){var r=this,n=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),jb.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=gb.defaults(n,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),n=gb.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),gb.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),gb.isUndefined(n.parent)&&n.hideable&&ox.push(this),n.resizable=gb.isUndefined(n.parent)&&n.resizable,n.autoPlace&&gb.isUndefined(n.scrollable)&&(n.scrollable=!0);var i,o=ex&&"true"===localStorage.getItem(dx(this,"isLocal")),a=void 0,s=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return r.parent?r.getRoot().preset:n.load.preset},set:function(e){r.parent?r.getRoot().preset=e:n.load.preset=e,function(e){for(var t=0;t1){var n=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:n,factoryArgs:[gb.toArray(arguments)]})}if(gb.isArray(t)||gb.isObject(t)){var i=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:i,factoryArgs:[t]})}},name:function(e){return r.__li.firstElementChild.firstElementChild.innerHTML=e,r},listen:function(){return r.__gui.listen(r),r},remove:function(){return r.__gui.remove(r),r}}),r instanceof Hb){var n=new Gb(r.object,r.property,{min:r.__min,max:r.__max,step:r.__step});gb.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=r[e],i=n[e];r[e]=n[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(n,e),t.apply(r,e)}})),jb.addClass(t,"has-slider"),r.domElement.insertBefore(n.domElement,r.domElement.firstElementChild)}else if(r instanceof Gb){var i=function(t){if(gb.isNumber(r.__min)&&gb.isNumber(r.__max)){var n=r.__li.firstElementChild.firstElementChild.innerHTML,i=r.__gui.__listening.indexOf(r)>-1;r.remove();var o=hx(e,r.object,r.property,{before:r.__li.nextElementSibling,factoryArgs:[r.__min,r.__max,r.__step]});return o.name(n),i&&o.listen(),o}return t};r.min=gb.compose(i,r.min),r.max=gb.compose(i,r.max)}else r instanceof zb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__checkbox,"click")})),jb.bind(r.__checkbox,"click",(function(e){e.stopPropagation()}))):r instanceof Yb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__button,"click")})),jb.bind(t,"mouseover",(function(){jb.addClass(r.__button,"hover")})),jb.bind(t,"mouseout",(function(){jb.removeClass(r.__button,"hover")}))):r instanceof $b&&(jb.addClass(t,"color"),r.updateDisplay=gb.compose((function(e){return t.style.borderLeftColor=r.__color.toString(),e}),r.updateDisplay),r.updateDisplay());r.setValue=gb.compose((function(t){return e.getRoot().__preset_select&&r.isModified()&&lx(e.getRoot(),!0),t}),r.setValue)}(e,u,i),e.__controllers.push(i),i}function dx(e,t){return document.location.href+"."+t}function fx(e,t,r){var n=document.createElement("option");n.innerHTML=t,n.value=t,e.__preset_select.appendChild(n),r&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function px(e,t){t.style.display=e.useLocalStorage?"block":"none"}function vx(e){var t=e.__save_row=document.createElement("li");jb.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),jb.addClass(t,"save-row");var r=document.createElement("span");r.innerHTML=" ",jb.addClass(r,"button gears");var n=document.createElement("span");n.innerHTML="Save",jb.addClass(n,"button"),jb.addClass(n,"save");var i=document.createElement("span");i.innerHTML="New",jb.addClass(i,"button"),jb.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",jb.addClass(o,"button"),jb.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?gb.each(e.load.remembered,(function(t,r){fx(e,r,r===e.preset)})):fx(e,"Default",!1),jb.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=gx(this)),e.folders={},gb.each(this.__folders,(function(t,r){e.folders[r]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=gx(this),lx(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=gx(this,!0)),this.load.remembered[e]=gx(this),this.preset=e,fx(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){gb.each(this.__controllers,(function(t){this.getRoot().load.remembered?cx(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),gb.each(this.__folders,(function(e){e.revert(e)})),e||lx(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&Kb.call(window,(function(){e(t)})),gb.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){gb.each(this.__controllers,(function(e){e.updateDisplay()})),gb.each(this.__folders,(function(e){e.updateDisplay()}))}});var yx=ax,_x=function(){function e(e){this.player=e}return Object.defineProperty(e.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(e){this.player.updateConfig({resolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var e,t;return(null===(e=this.player.view)||void 0===e?void 0:e.width)+"*"+(null===(t=this.player.view)||void 0===t?void 0:t.height)},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(e){this.player.updateConfig({minFPS:e,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(e){this.player.updateConfig({maxFPS:e,minFPS:this.player.config.minFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(e){this.player.updateConfig({autoResolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(e){this.player.updateConfig({autoFPS:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(e){this.player.updateConfig({transactionBgColor:e})},enumerable:!1,configurable:!0}),e}(),bx=function(){function e(e,t){var r;this.config=new _x(e),this.anchor=t,r=this.createControllerGUI(),this.gui=r[0],this.controller=r[1],this.createStats()}return e.prototype.createStats=function(){var e=this;this.stateId=setInterval((function(){e.controller.frameRate.updateDisplay(),e.controller.size.updateDisplay(),e.controller.minFPS.updateDisplay(),e.controller.drawFrames.updateDisplay(),e.controller.maxFPS.updateDisplay(),e.controller.resolution.updateDisplay(),e.controller.autoFps.updateDisplay(),e.controller.autoResolution.updateDisplay(),e.controller.drawCall.updateDisplay()}),16)},e.prototype.createControllerGUI=function(){var e=new yx({autoPlace:!0,closed:!0});e.domElement.style.opacity=".6",e.domElement.style.transformOrigin="100% 0",e.domElement.style.transform="scale(1)",this.anchor.appendChild(e.domElement),e.domElement.style.position="absolute",e.domElement.style.right="0",e.domElement.style.top="0",e.domElement.style.zIndex="2";var t={frameRate:e.add(this.config,"frameRate"),drawFrames:e.add(this.config,"drawFrames"),drawCall:e.add(this.config,"drawCall"),size:e.add(this.config,"size"),minFPS:e.add(this.config,"minFPS",0,60),maxFPS:e.add(this.config,"maxFPS",0,60),resolution:e.add(this.config,"resolution",.5,8,.5),autoResolution:e.add(this.config,"autoResolution"),autoFps:e.add(this.config,"autoFPS"),transactionBgColor:e.addColor(this.config,"backgroundColor")};return[e,t]},e.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch(e){}},e}(),xx=function(){function e(e){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&t.fn(e).then((function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))},this.fn=e}return e.prototype.destroy=function(){this.isDestroy=!0},e.prototype.addTask=function(e){this.tasks.push(e),this.isScheduling||this.schedule()},e}(),wx=function(){function e(e){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=e}return e.prototype.addLock=function(e,t){var r=this;this.available&&(this.locks[e]=t,this.autoUnlock[e]=window.setTimeout((function(){delete r.locks[e]}),3e3))},e.prototype.unlock=function(e,t){this.available&&t&&this.locks[e]&&this.locks[e]===t&&(window.clearTimeout(this.autoUnlock[e]),delete this.locks[e])},e.prototype.isLocked=function(e){return!!this.available&&!!this.locks[e]},e}(),Sx=function(){function e(){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var t=e.tasks.shift();t&&!e.isDestroy&&(t.status="running",t.fn.apply(null).then((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})).catch((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})))}}return e.prototype.getRunningTask=function(){return this.tasks[0]&&"running"===this.tasks[0].status?this.tasks[0]:null},e.prototype.addTask=function(e,t){var r={type:e,status:"wait",fn:t},n=this.getRunningTask();n&&e===n.type||(this.tasks=this.tasks.filter((function(t){return t.type!==e})),this.tasks.push(r),this.isScheduling||this.schedule())},e.prototype.destroy=function(){this.isDestroy=!0},e}(),Tx=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Mx=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.config.buffer||e))return[2];t=this.logList.splice(0),r=function(){i.logList=t.concat(i.logList),i.retryTimes>3&&i.pause(),i.retryTimes+=1},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:t})})];case 2:return o.sent().ok?this.retryTimes=0:r(),[3,4];case 3:return n=o.sent(),console.warn(n),r(),[3,4];case 4:return[2]}}))}))},e.prototype.setEnable=function(e){this.enable!==e&&(e?this.start():this.pause())},e}();function Ex(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var i,o,a,s;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(r=e.replace(/^.*__internal__/,""),t=this.resourceList.find((function(e){return e.indexOf(r)>=0}))||e),this.config.urlInterrupter?[2,this.config.urlInterrupter(t)]:[2,Promise.resolve(t)]}))}))},n.userInputHandle=function(){n.userInputTime=Date.now()},n.handleViewTouchStart=function(){window.clearTimeout(n.touchStartId),n.isTouchStart=!0,n.touchStartId=setTimeout((function(){n.isTouchStart=!1}),350)},n.handleViewTouchEnd=function(){n.isTouchStart&&(n.isTouchStart=!1,n.handleViewClick())},n.handleSlideRef=function(){console.log(n),window.__slide=n},n.receiveSyncHandler=function(e){return Px(n,void 0,void 0,(function(){var t,r,n,i,o,a=this;return Nx(this,(function(s){switch(s.label){case 0:return Sv()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(Lx.syncEventLag),this._receiveIncrId=e.incrId||0),this.logger.info("sync receive "+JSON.stringify(e),this.taskId),"nextStep"!==e.type?[3,1]:(this.mainSeqStep!==e.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(e.next,"start"),this.player.nextTick((function(){a.doNextStep(!0,e.clientId||"")}))):this.doNextStep(!0,e.clientId||""),[3,6]);case 1:return"prevStep"!==e.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===e.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(e.next+1,"start"),null===(t=this.player)||void 0===t||t.nextTick((function(){a.doPrevStep(!0)}))),[3,6]);case 2:return"interactiveAnim"!==e.type?[3,3]:(this.player?this.player.applyInteractiveAction(e.action):this.__slideState.interactiveSeqState[e.seqId]?this.__slideState.interactiveSeqState[e.seqId].step+=1:this.__slideState.interactiveSeqState[e.seqId]={step:0,state:"end"},[3,6]);case 3:return"renderSlide"!==e.type?[3,5]:[4,this.doRenderSlide(e.index,e.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===e.type?(null===(r=this.player)||void 0===r||r.setMediaState(e.id,!0),this.__slideState.mediaState[e.id]=e.state):"mediaPause"===e.type?(null===(n=this.player)||void 0===n||n.setMediaState(e.id,!1),this.__slideState.mediaState[e.id]=e.state):"mediaSeek"===e.type?(null===(i=this.player)||void 0===i||i.setMediaCurrentTime(e.id,e.time),this.__slideState.mediaState[e.id]=e.state):"mediaFullscreen"===e.type&&(e.targetId&&this.__slideState.mediaState[e.targetId]?this.__slideState.mediaState[e.targetId].fullscreen=e.state:this.__slideState.mediaState[e.targetId]={fullscreen:e.state,type:"pause",time:0},null===(o=this.player)||void 0===o||o.syncFullscreenVideoState({targetId:e.targetId,state:e.state,slideIndex:e.slideIndex})),s.label=6;case 6:return[2]}}))}))},n.flushDebounce=function(){n.resizeView.flush(),n.handleViewClick.flush()},n.handlePrevSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.prevSlideIndex)>=1&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!1):this.renderSlide(t,!1)),[2]):[2]}))}))},n.handleNextSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.nextSlideIndex)<=this.slideCount&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!0):this.renderSlide(t,!0)),[2]):[2]}))}))},n.handleGotoSlide=function(e){if(e<=n.slideCount&&e>=1){var t=n.slideState.currentSlideIndex<=e;n.renderSlide(e,t)}else-1===e&&n.renderSlide(n.slideCount,!0)},t.instances.push(n),n.config=n.initSlideConfig(r),n.tracker=function(e){r.whiteTracker&&r.whiteTracker.commit({name:e.name,reason:e.reason,result:e.result,payload:Cx(Cx({},e.payload),{slideId:n.randomId,taskId:n.taskId})},{slideVersion:n.version||""})},t.trackLogger.setEnable(!!n.config.enableTracking),n.logger={info:function(e,r){var i;t.appendLogString("INFO - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"info",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.info;o&&o("["+r+"] "+e)},warn:function(e,r){var i;t.appendLogString("WARN - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"warn",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.warn;o&&o("["+r+"] "+e)},error:function(e,r){var i;t.appendLogString("ERROR - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"error",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.error;o&&o("["+r+"] "+e)}},n.logger.info("new slide with clientId: "+n.config.clientId+", version: "+n.version,n.taskId),n.tracker({name:"initSlide",result:"",reason:"",payload:{taskId:n.taskId}}),n.anchor=n.config.anchor,n.syncQueue=new xx(n.receiveSyncHandler),n.lock=new wx("interactive"===n.mode),n.cacheImage.style.position="absolute",n.cacheImage.style.zIndex="100",n.setMedianControllerAttribute(),n.canvasContainer.style.position="relative",n.canvasContainer.style.fontSize="0",n.canvasContainer.appendChild(n.medianController),n.frame.appendChild(n.canvasContainer),n.frameResizeObserver.observe(n.frame),n.on(Lx.syncReceive,(function(e){n.lock.unlock(e.type,e.uuid),n.syncQueue.addTask(e)})),n.renderingTaskManager.eventHub.on("task-error",(function(e){var t=e.error,r=e.task,i=nv.transform(t);i.errorType===Zp.RuntimeWarn?n.logger.warn(i.message,n.taskId):n.logger.error(i.message,n.taskId),n.isLoading=!1,n.reportError(i,r.slideIndex)})),window.addEventListener("__slide_ref__",n.handleSlideRef),n.resizeView=k_()(n.resizeView.bind(n),50),n.player=n.initPlayer(n.config),n.config.controller&&n.createController(),n.player.view&&n.canvasContainer.appendChild(n.player.view),n.handleViewClick=k_()(n.handleViewClick,300),n.player.errorChannel.on("error",(function(e,t){var r=nv.transform(e);r.errorType===Zp.RuntimeWarn?n.logger.warn(r.message,n.taskId):n.logger.error(r.message,n.taskId),n.isLoading=!1,n.reportError(e,t),n.tracker({name:"slideError",reason:r.errorMsg,result:"",payload:{code:r.errorType}})})),window.addEventListener("message",n.recoverHandler),t.volumeAdjuster.on("update",n._updateVolumeByStaticAdjuster),n.volumeAdjuster.volume=t.volumeAdjuster.volume,n}var r,n;return Ax(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),Px(this,void 0,void 0,(function(){return Nx(this,(function(r){switch(r.label){case 0:if(!(t._tempLog.length>131072||e&&t._tempLog.length>0))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,null==Bx?void 0:Bx.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:case 3:return r.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,r.label=5;case 5:return[2]}}))}))},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(e){return Px(this,void 0,void 0,(function(){var r,n,i,o,a;return Nx(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!Bx)return[3,13];r=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return r=(s.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return s.sent(),[3,5];case 5:n=0,i=r,s.label=6;case 6:if(!(n500&&e.enableGlobalClick&&e.nextStep()}))},t.prototype.createController=function(){this.player&&(this.playerController=new bx(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2",this.medianController.style.fontSize="16px"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var e=this.frame.getBoundingClientRect(),t=e.width,r=e.height;this.frameWidth=t,this.frameHeight=r,this.resizeView()}},t.prototype.updateFixedFrameSize=function(e,t,r){this.config.fixedFrameSize&&(this.frameWidth=e,this.frameHeight=t,this.frame.style.width=e+"px",this.frame.style.height=t+"px",this.resizeView(r))},t.prototype._resizeView=function(e){var t,r,n=this,i=this.width,o=this.height;if(i>0&&o>0){var a=this.frameWidth/i,s=a*o;s>this.frameHeight&&(a*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(a,this.resize,e),this.cacheImage.style.transform="scale("+a+")",this.medianController.style.transform="scale("+a+")",this.medianController.setAttribute("data-scale",a.toString()),this.isInitResized||(this.isInitResized=!0,null===(r=this.player)||void 0===r||r.clock.setTimeout((function(){n.frame.style.visibility="visible"}),32))}},t.prototype.setSlideState=function(e){var t,r,n;return Px(this,void 0,void 0,(function(){var i,o=this;return Nx(this,(function(a){switch(a.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,null===(t=this.player)||void 0===t||t.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,null===(r=this.player)||void 0===r||r.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,null===(n=this.player)||void 0===n?void 0:n.clock.waitUntil((function(){var t,r;return(null===(t=o.player)||void 0===t?void 0:t.currentIndex)===e.currentSlideIndex&&(null===(r=o.player)||void 0===r?void 0:r.currentStage)}),3e3)];case 3:return a.sent(),i=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(i=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(i=!0,this.__slideState.mainSeqState=e.mainSeqState),i&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),[4,Rx(1500)];case 4:return a.sent(),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),this.isSyncingSlideState=!1,[2]}}))}))},t.prototype.initInteractiveSeq=function(e){var t;for(var r in e.interactiveSeqState){var n=e.interactiveSeqState[r];null===(t=this.player)||void 0===t||t.setInteractiveSeqState(r,n.step,"idle"===n.state?"start":"end")}},t.prototype.initMedia=function(e){var t,r,n;for(var i in e.mediaState){var o=e.mediaState[i],a=this.__slideState.mediaState[i];if(null===(t=this.player)||void 0===t||t.syncFullscreenVideoState({targetId:i,state:!!o.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!a||o.type!==a.type||o.time!==a.time)if("play"===o.type){var s=(this.timestamp()-o.time)/1e3;null===(r=this.player)||void 0===r||r.setMediaState(i,!0,s)}else null===(n=this.player)||void 0===n||n.setMediaState(i,!1,o.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,t.sent().json()];case 3:return[2,[(e=t.sent()).width,e.height]];case 4:return t.sent(),[2,[0,0]];case 5:return[2]}}))}))},t.prototype.getSlideCountAsync=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,t){var r;this.taskId=e,null===(r=this.player)||void 0===r||r.setResourceData(e,t),this.__slideState.taskId=e,this.__slideState.url=t,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:t})},t.prototype.setResourceList=function(e,t){var r;this.taskId=e,this.resourceList=t,null===(r=this.player)||void 0===r||r.setResourceData(e,"__internal__"),this.__slideState.taskId=e,this.__slideState.url="__internal__"},t.prototype._renderSlide=function(e){var t;return Px(this,void 0,void 0,(function(){var r=this;return Nx(this,(function(n){switch(n.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),this.flushDebounce(),[4,null===(t=this.player)||void 0===t?void 0:t.renderSlide(e)]);case 1:return n.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout((function(){var e,t;if("hidden"===(null===(t=null===(e=r.player)||void 0===e?void 0:e.view)||void 0===t?void 0:t.style.visibility)&&(r.player.view.style.visibility="visible"),"hidden"===r.frame.style.visibility&&(r.frame.style.visibility="visible"),r.needClearCacheImage)try{r.frame.removeChild(r.cacheImage)}catch(e){r.logger.error("removeChild error Slide.ts:1553",r.taskId)}}),100),[2]}}))}))},t.prototype.renderSlide=function(e,t){if(void 0===t&&(t=!0),this.player){var r=Number(e);(r!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(r>this.slideCount&&this.slideCount>0||this.poseRenderSlide(r,t))}},t.prototype.needCreateNewPlayer=function(){var e=b_.platform.isLowGpuMemory()?15:30;return(b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,t){"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t}):"sync"===this.mode?(this.doRenderSlide(e,t),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t})):this.doRenderSlide(e,t)},t.prototype.doRenderSlide=function(e,t){var r,n,i,o=this;if(void 0===t&&(t=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var a=this.player.getSnapshot();this.cacheImage.src=a,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(r=this.playerController)||void 0===r||r.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,(null===(n=this.config)||void 0===n?void 0:n.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(i=null==this?void 0:this.player)||void 0===i?void 0:i.view)&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var s=Math.random().toString(32).substr(2);return this.player.isForward=t,this.renderingTaskManager.addTask((function(){return o._renderSlide(e)}),e,s),new Promise((function(e){o.renderingTaskManager.eventHub.once("task-end-"+s,e)}))},t.prototype.getSnapshot=function(){var e,t;return null!==(t=null===(e=this.player)||void 0===e?void 0:e.getSnapshot())&&void 0!==t?t:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(Lx.slideStepEnd),this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doNextStep=function(e,t){if(this.player){var r=!this.config.clientId||t===this.config.clientId;this.player.nextStep(e,r);var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(Lx.slideStepStart),this.player.mainSeqHasPrevStep()?"interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(e){if(void 0===e&&(e=!1),this.player){this.player.prevStep(e);var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var e=this.slideState;!T_()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(Lx.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var t=Math.random().toString(32).substr(2);this.lock.addLock(e.type,t);var r=Cx(Cx({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(r.incrId=this.dispatchIncrId),this.emit(Lx.syncDispatch,r),this.logger.info("sync dispatch "+JSON.stringify(r),this.taskId)}},t.prototype.setMainSeqStep=function(e,t){var r;null===(r=this.player)||void 0===r||r.setMainSeqStep(e,t)},t.prototype.setInteractive=function(e){var t;this.interactive=e,null===(t=this.player)||void 0===t||t.setInteractive(e)},t.prototype.pause=function(){var e;null===(e=this.player)||void 0===e||e.pause()},t.prototype.resume=function(){var e;null===(e=this.player)||void 0===e||e.resume()},t.prototype._doFrozen=function(){var e;return Px(this,void 0,void 0,(function(){var t,r,n,i=this;return Nx(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.tracker({name:"frozenSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.view&&this.player?[4,this.player.clock.waitUntil((function(){return!i.isLoading}),6e4)]:[3,2];case 1:for(r in o.sent(),t=this.player.getSnapshot()||"",this.cacheImage.src=t,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(e=this.playerController)||void 0===e||e.destroy(),this.player=void 0,this.__slideState.mediaState)n=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Cx(Cx({},n),{frozenTime:this.timestamp()});o.label=2;case 2:return[2]}}))}))},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",(function(){return e._doFrozen()}))},t.prototype._doRelease=function(){var e,t;return Px(this,void 0,void 0,(function(){var r,n,i,o;return Nx(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",this.taskId),this.tracker({name:"releaseSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.player)return[2];for(n in this.player=this.initPlayer(this.config),(null===(e=this.config)||void 0===e?void 0:e.controller)&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=I_()(jx),r.mediaState)"play"===(i=r.mediaState[n]).type&&(o=Math.max(null!==(t=i.frozenTime)&&void 0!==t?t:0,i.time),i.time=this.timestamp()-(o-i.time),i.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return a.sent(),[4,this.player.clock.delay(333)];case 2:a.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch(e){this.logger.error("removeChild error Slide.ts:1934",this.taskId)}return[2]}}))}))},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",(function(){return e._doRelease()}))},t.prototype._doDestroy=function(){var e,r,n,i,o=this;this.logger.info("do destroy slide",this.taskId),this.tracker({name:"destroySlide",reason:"",result:"",payload:{taskId:this.taskId}});var a=t.instances.findIndex((function(e){return e.randomId===o.randomId}));if(a>=0&&t.instances.splice(a,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(e=this.player)||void 0===e||e.removeAllListeners(),null===(r=this.player)||void 0===r||r.destroy(),null===(n=this.player)||void 0===n||n.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners(),null===(i=this.player)||void 0===i?void 0:i.view)try{this.anchor.removeChild(this.player.view)}catch(e){this.logger.error("removeChild error Slide.ts:1982",this.taskId)}try{this.anchor.removeChild(this.frame)}catch(e){this.logger.error("removeChild error Slide.ts:1988",this.taskId)}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,Rx(100)]:[3,3];case 2:return t.sent(),e+=1,[3,1];case 3:return[2]}}))}))},t.prototype.preload=function(e){return this.player?this.player.preload(e):Promise.resolve()},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then((function(){e._doDestroy()})):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;null===(e=this.player)||void 0===e||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,t=0===this.mainSeqLength||this.mainSeqStep>=this.mainSeqLength-1,r="end"===this.mainSeqState||"running"===this.mainSeqState||null==this.mainSeqState;return!(e&&t&&r)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=1===this.player.currentIndex,t=0===this.mainSeqLength||0===this.mainSeqStep,r="idle"===this.mainSeqState||null===this.mainSeqState;return!(e&&t&&r)},t.prototype.snapshot=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return Px(this,void 0,void 0,(function(){return Nx(this,(function(t){return this.player?[2,this.player.snapshotWithTimingEnd(e)]:[2,null]}))}))},t.prototype.updateGlobalVolume=function(e){this.volumeAdjuster.volume=e},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){b_.clearLocalCache()},t.disposeLocalCache=function(){},r=t,t.preloadResource=Ex,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(e){var r,n;e.context({logger:{info:function(e){t.appendLogString("INFO - "+(new Date).toISOString()+" - "+e+"\n")},warn:function(e){t.appendLogString("WARN - "+(new Date).toISOString()+" - "+e+"\n")},error:function(e){t.appendLogString("ERROR - "+(new Date).toISOString()+" - "+e+"\n")}}}),r=e,(n=w_.get(r.hookPoint)||[]).push(r),w_.set(r.hookPoint,n)},t.volumeAdjuster=new m_,t.trackLogger=new kx,t.handleFrozenAllSlide=function(){t.instances.forEach((function(e){e.player&&(t._tempFrozenIds.push(e.randomId),e.frozen())}))},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach((function(e){var r=t.instances.find((function(t){return t.randomId===e}));r&&r.release()})),t._tempFrozenIds=[]},t.handleLogReport=function(e){return Px(void 0,void 0,void 0,(function(){var n,i,o,a,s,u;return Nx(r,(function(r){switch(r.label){case 0:return[4,t.flushLog(!0)];case 1:if(r.sent(),!Bx)return[3,12];n=[],r.label=2;case 2:return r.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return n=(r.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return r.sent(),[3,5];case 5:if(0===n.length)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:e},"*"),[2];i=0,o=n,r.label=6;case 6:if(!(i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);o>3&&a&&Object.defineProperty(t,r,a)}([(n="Slide.initConfig",function(e,t,r){var i=r.value;r.value=function(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?F(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(B),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=z()}while(this.disposers.has(e));return e}}]),e}();function F(e){return function(){return e.forEach(B)}}function W(e,t,r){return Math.min(Math.max(e,t),r)}var G={exports:{}},V={exports:{}},H=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Y=Array.prototype.concat,$=Array.prototype.slice,X=V.exports=function(e){for(var t=[],r=0,n=e.length;r=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},ee.to.keyword=function(e){return K[e.slice(0,3)]};var ne=G.exports,ie=function(){function e(t){var r=this;x(this,e),this.enable=t,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=function(e){var t,n;e instanceof CustomEvent?t=e.detail:"object"===T(n=e.data)&&null!==n&&(t=e.data),t&&("boolean"==typeof t.slide?r.enable=t.slide:"__instance"===t.slide?console.log(r):"__debug"===t.slide&&Object.values(r.apps).forEach((function(e){var t,r;null==(r=null==(t=e.controller)?void 0:t.slide)||r.createController()})))},this.initialize()}return S(e,[{key:"setAppContext",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).context=t,this.log("[Slide] new ".concat(e))}},{key:"setAppController",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).controller=t}},{key:"deleteApp",value:function(e){delete this.apps[e],this.log("[Slide] delete ".concat(e))}},{key:"initialize",value:function(){window.addEventListener("message",this._onMessage)}},{key:"dispose",value:function(){window.removeEventListener("message",this._onMessage)}},{key:"log",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).info.apply(e,arguments);else if(this.enable){var t;(t=console).log.apply(t,arguments)}}},{key:"verbose",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).debug.apply(e,arguments);else if(this.enable&&"verbose"===this.level){var t;(t=console).log.apply(t,arguments)}}},{key:"warn",value:function(){var e,t;this.roomLogger?(e=this.roomLogger).warn.apply(e,arguments):(t=console).warn.apply(t,arguments)}}]),e}(),oe=new ie(!1),ae=oe.log.bind(oe),se=oe.verbose.bind(oe);function ue(e){try{var t=window.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"!==t&&"transparent"!==t)return t;if(e.parentElement)return ue(e.parentElement)}catch(e){}return"#ffffff"}var le="";function ce(e){return le||(le=function(e){var t=ne.get(e);if(t&&"rgb"===t.model){var r=t.value,n=(((255&Math.round(r[0]))<<16)+((255&Math.round(r[1]))<<8)+(255&Math.round(r[2]))).toString(16);return"#"+"000000".substring(n.length)+n}return e}(ue(e)),ae("[Slide] guess bg color",le)),le}var he=function(e){return e.tracker};function de(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.width,n=e.height,i=e.slideCount,o=e.slideState,a=o.taskId,s=o.url,u=[],l=function(e){var i=t.find((function(t){return t.indexOf("preview/".concat(e,".png"))>=0}));i?u.push({width:r,height:n,thumbnail:i,src:"ppt"}):u.push({width:r,height:n,thumbnail:"".concat(s,"/").concat(a,"/preview/").concat(e,".png"),src:"ppt"})},c=1;c<=i;++c)l(c);return u}function fe(e,t,r,n){var i,o=r.slideState.currentSlideIndex;if(o>0&&t.getIsWritable()){var a=[n,o].join("/");if("page"!==e.scenePathType(a)){e.removeScenes(n);for(var s=r.slideCount,u=[],l=1;l<=s;++l)u.push({name:"".concat(l)});e.putScenes(n,u)}(t.getBox().focus?e.state.sceneState.scenePath:(null==(i=t.getView())?void 0:i.focusScenePath)||"")!==a&&t.setScenePath(a)}}var pe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=pe;var ve={taskId:"",url:"",state:null,resourceList:[],previewList:[]},me=function(){},ge=function(){function e(t){var r,n=this,i=t.context,o=t.anchor,a=t.onRenderStart,s=t.onPageChanged,u=t.onTransitionStart,c=t.onTransitionEnd,h=t.onNavigate,d=t.onError,f=t.onRenderError,p=t.showRenderError,v=t.invisibleBehavior;x(this,e),this.sideEffect=new U,this.previewList=[],this.ready=!1,this.readyPromise=new Promise((function(e){n.resolveReady=function(){n.ready?ae("[Slide] render end"):setTimeout((function(){n.ready=!0,e()}),1e3)}})),this.onSyncDispatch=function(e){if(n.context.getIsWritable()&&n.room){var t={type:L.SLIDE_EVENTS.syncDispatch,payload:e};se("[Slide] dispatch",JSON.stringify(e)),n.context.dispatchMagixEvent(L.SLIDE_EVENTS.syncDispatch,t)}},this.magixEventListener=function(e){var t=e.payload,r=t.type,i=t.payload;r===L.SLIDE_EVENTS.syncDispatch&&(n.syncStateOnce(),se("[Slide] receive",JSON.stringify(i)),n.slide.emit(L.SLIDE_EVENTS.syncReceive,i))},this.onStateChange=function(e){n.context.getIsWritable()&&(se("[Slide] state change",JSON.stringify(e,null,2)),n.context.storage.setState({state:e}))},this.pollCount=0,this.pollReadyState=function(){n.ready?1===n._toFreeze?n.freeze():-1===n._toFreeze&&n.unfreeze():n.pollCount<40?(n.pollCount++,setTimeout(n.pollReadyState,500)):(n.pollCount=0,ae("[Slide] init timeout"))},this._pageCount=0,this.destroyed=!1,this.timestamp=function(){return n.room&&n.room.calibrationTimestamp?n.room.calibrationTimestamp:n.player?n.player.beginTimestamp+n.player.progressTime:Date.now()},this.isFrozen=!1,this._toFreeze=0,this.freeze=function(){n.isFrozen=!0,n.ready?(ae("[Slide] freeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.frozen():n.slide.pause()):n._toFreeze=1},this.unfreeze=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.visible){e.next=2;break}return e.abrupt("return");case 2:n.isFrozen=!1,n.ready?(ae("[Slide] unfreeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.release():n.slide.resume()):n._toFreeze=-1;case 4:case"end":return e.stop()}}),e)}))),this.onVisibilityChange=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n.visible="visible"===document.visibilityState)?(ae("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:n.savedIsFrozen}),n.savedIsFrozen||n.unfreeze()):(n.savedIsFrozen=n.isFrozen,ae("[Slide] freeze because tab becomes invisible"),n.freeze());case 1:case"end":return e.stop()}}),e)}))),this.invisibleBehavior=null!=v?v:"frozen",this.onRenderStart=a,this.onPageChanged=s,this.onTransitionStart=u,this.onTransitionEnd=c,this.onNavigate=h||me,this.onError=d,this.onRenderError=f,this.showRenderError=null==p||p,this.context=i,this.room=i.getRoom(),this.player=this.room?void 0:i.getDisplayer(),r=this.room||this.player,oe.roomLogger=r.logger,this.slide=this.createSlide(o,{whiteTracker:he(i.getDisplayer())}),this.syncStateOnceFlag=!this.context.isAddApp,this.visible="visible"===document.visibilityState,this.savedIsFrozen=!1,this.initialize()}return S(e,[{key:"jumpToPage",value:function(e,t){this.ready&&(e=W(e,1,this.pageCount),this.onNavigate(e,t),this.slide.renderSlide(e))}},{key:"initialize",value:function(){this.registerEventListeners(),this.kickStart()}},{key:"kickStart",value:function(){var e=this.context,t=this.slide;e.getIsWritable()&&e.storage.ensureState(ve);var r=e.storage.state,n=r.taskId,i=r.url,o=r.resourceList,a=r.previewList,s=r.state;this.previewList=a,o&&o.length>0?t.setResourceList(n,o):t.setResource(n,i||pe),s?(ae("[Slide] init with state",JSON.stringify(s)),this.syncStateOnceFlag=!1,t.setSlideState(s)):e.isAddApp&&(ae("[Slide] init by renderSlide",1),t.renderSlide(1)),this.pollReadyState()}},{key:"registerEventListeners",value:function(){var e=this,t=this.context,r=this.slide,n=this.sideEffect.addDisposer(t.storage.addStateChangedListener((function(){t.storage.state.state&&(e.syncStateOnce(),e.sideEffect.flush(n))})));this.sideEffect.add((function(){return t.addMagixEventListener(L.SLIDE_EVENTS.syncDispatch,e.magixEventListener,{fireSelfEventAfterCommit:!0})})),r.on(L.SLIDE_EVENTS.renderStart,this.onRenderStart),r.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),r.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),r.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.renderError,this.onError),r.on(L.SLIDE_EVENTS.stateChange,this.onStateChange),r.on(L.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),r.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add((function(){return document.addEventListener("visibilitychange",e.onVisibilityChange),function(){return document.removeEventListener("visibilitychange",e.onVisibilityChange)}}))}},{key:"syncStateOnce",value:function(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(ve);var e=this.context.storage.state.state;e&&(ae("[Slide] sync with state (once)",JSON.stringify(e)),this.slide.setSlideState(e),this.syncStateOnceFlag=!1)}}},{key:"createSlide",value:function(e){var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.context.getAppOptions()||{},a=new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=o.enableGlobalClick)||t,renderOptions:{minFPS:o.minFPS||25,maxFPS:o.maxFPS||30,autoFPS:null==(r=o.autoFPS)||r,autoResolution:null==(n=o.autoResolution)||n,resolution:o.resolution,transactionBgColor:o.bgColor||ce(e),maxResolutionLevel:o.maxResolutionLevel,forceCanvas:o.forceCanvas,enableNvidiaDetect:o.enableNvidiaDetect},fixedFrameSize:o.fixedFrameSize,loaderDelegate:o.loaderDelegate,navigatorDelegate:o.navigatorDelegate,urlInterrupter:o.urlInterrupter,resourceTimeout:o.resourceTimeout,rtcAudio:o.rtcAudio,useLocalCache:o.useLocalCache,logger:o.logger,whiteTracker:i.whiteTracker,timestamp:this.timestamp});return a}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.destroyed||(ae("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}},{key:"pageCount",get:function(){return this._pageCount>0||(this._pageCount=this.slide.slideCount),this._pageCount}},{key:"page",get:function(){return this.slide.slideState.currentSlideIndex}}]),e}();var ye="undefined"!=typeof window,_e=ye&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),be=ye&&"IntersectionObserver"in window,xe=ye&&"classList"in document.createElement("p"),we=ye&&window.devicePixelRatio>1,Se={elements_selector:".lazy",container:_e||ye?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Te=function(e){return Object.assign({},Se,e)},Me=function(e,t){var r,n="LazyLoad::Initialized",i=new e(t);try{r=new CustomEvent(n,{detail:{instance:i}})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(n,!1,!1,{instance:i})}window.dispatchEvent(r)},ke="src",Ee="srcset",Ie="sizes",Ae="poster",Ce="llOriginalAttrs",Pe="data",Ne="loading",Oe="loaded",Re="applied",De="error",Le="native",je="data-",ze="ll-status",Be=function(e,t){return e.getAttribute(je+t)},Ue=function(e){return Be(e,ze)},Fe=function(e,t){return function(e,t,r){var n=je+t;null!==r?e.setAttribute(n,r):e.removeAttribute(n)}(e,ze,t)},We=function(e){return Fe(e,null)},Ge=function(e){return null===Ue(e)},Ve=function(e){return Ue(e)===Le},He=[Ne,Oe,Re,De],Ye=function(e,t,r,n){e&&(void 0===n?void 0===r?e(t):e(t,r):e(t,r,n))},$e=function(e,t){xe?e.classList.add(t):e.className+=(e.className?" ":"")+t},Xe=function(e,t){xe?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},qe=function(e){return e.llTempImage},Qe=function(e,t){if(t){var r=t._observer;r&&r.unobserve(e)}},Ze=function(e,t){e&&(e.loadingCount+=t)},Ke=function(e,t){e&&(e.toLoadCount=t)},Je=function(e){for(var t,r=[],n=0;t=e.children[n];n+=1)"SOURCE"===t.tagName&&r.push(t);return r},et=function(e,t){var r=e.parentNode;r&&"PICTURE"===r.tagName&&Je(r).forEach(t)},tt=function(e,t){Je(e).forEach(t)},rt=[ke],nt=[ke,Ae],it=[ke,Ee,Ie],ot=[Pe],at=function(e){return!!e[Ce]},st=function(e){return e[Ce]},ut=function(e){return delete e[Ce]},lt=function(e,t){if(!at(e)){var r={};t.forEach((function(t){r[t]=e.getAttribute(t)})),e[Ce]=r}},ct=function(e,t){if(at(e)){var r=st(e);t.forEach((function(t){!function(e,t,r){r?e.setAttribute(t,r):e.removeAttribute(t)}(e,t,r[t])}))}},ht=function(e,t,r){$e(e,t.class_applied),Fe(e,Re),r&&(t.unobserve_completed&&Qe(e,t),Ye(t.callback_applied,e,r))},dt=function(e,t,r){$e(e,t.class_loading),Fe(e,Ne),r&&(Ze(r,1),Ye(t.callback_loading,e,r))},ft=function(e,t,r){r&&e.setAttribute(t,r)},pt=function(e,t){ft(e,Ie,Be(e,t.data_sizes)),ft(e,Ee,Be(e,t.data_srcset)),ft(e,ke,Be(e,t.data_src))},vt={IMG:function(e,t){et(e,(function(e){lt(e,it),pt(e,t)})),lt(e,it),pt(e,t)},IFRAME:function(e,t){lt(e,rt),ft(e,ke,Be(e,t.data_src))},VIDEO:function(e,t){tt(e,(function(e){lt(e,rt),ft(e,ke,Be(e,t.data_src))})),lt(e,nt),ft(e,Ae,Be(e,t.data_poster)),ft(e,ke,Be(e,t.data_src)),e.load()},OBJECT:function(e,t){lt(e,ot),ft(e,Pe,Be(e,t.data_src))}},mt=["IMG","IFRAME","VIDEO","OBJECT"],gt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||Ye(e.callback_finish,t)},yt=function(e,t,r){e.addEventListener(t,r),e.llEvLisnrs[t]=r},_t=function(e,t,r){e.removeEventListener(t,r)},bt=function(e){return!!e.llEvLisnrs},xt=function(e){if(bt(e)){var t=e.llEvLisnrs;for(var r in t){var n=t[r];_t(e,r,n)}delete e.llEvLisnrs}},wt=function(e,t,r){!function(e){delete e.llTempImage}(e),Ze(r,-1),function(e){e&&(e.toLoadCount-=1)}(r),Xe(e,t.class_loading),t.unobserve_completed&&Qe(e,r)},St=function(e,t,r){var n=qe(e)||e;if(!bt(n)){!function(e,t,r){bt(e)||(e.llEvLisnrs={});var n="VIDEO"===e.tagName?"loadeddata":"load";yt(e,n,t),yt(e,"error",r)}(n,(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_loaded),Fe(t,Oe),Ye(r.callback_loaded,t,n),i||gt(r,n)}(0,e,t,r),xt(n)}),(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_error),Fe(t,De),Ye(r.callback_error,t,n),r.restore_on_error&&ct(t,it),i||gt(r,n)}(0,e,t,r),xt(n)}))}},Tt=function(e,t,r){!function(e){e.llTempImage=document.createElement("IMG")}(e),St(e,t,r),function(e){at(e)||(e[Ce]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,r){var n=Be(e,t.data_bg),i=Be(e,t.data_bg_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage='url("'.concat(o,'")'),qe(e).setAttribute(ke,o),dt(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_multi),i=Be(e,t.data_bg_multi_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage=o,ht(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_set);if(n){var i=n.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),ht(e,t,r)}}(e,t,r)},Mt=function(e,t,r){St(e,t,r),function(e,t,r){var n=vt[e.tagName];n&&(n(e,t),dt(e,t,r))}(e,t,r)},kt=function(e,t,r){!function(e){return mt.indexOf(e.tagName)>-1}(e)?Tt(e,t,r):Mt(e,t,r)},Et=function(e,t,r){e.setAttribute("loading","lazy"),St(e,t,r),function(e,t){var r=vt[e.tagName];r&&r(e,t)}(e,t),Fe(e,Le)},It=function(e){e.removeAttribute(ke),e.removeAttribute(Ee),e.removeAttribute(Ie)},At=function(e){et(e,(function(e){ct(e,it)})),ct(e,it)},Ct={IMG:At,IFRAME:function(e){ct(e,rt)},VIDEO:function(e){tt(e,(function(e){ct(e,rt)})),ct(e,nt),e.load()},OBJECT:function(e){ct(e,ot)}},Pt=function(e){var t=Ct[e.tagName];t?t(e):function(e){if(at(e)){var t=st(e);e.style.backgroundImage=t.backgroundImage}}(e)},Nt=function(e,t){Pt(e),function(e,t){Ge(e)||Ve(e)||(Xe(e,t.class_entered),Xe(e,t.class_exited),Xe(e,t.class_applied),Xe(e,t.class_loading),Xe(e,t.class_loaded),Xe(e,t.class_error))}(e,t),We(e),ut(e)},Ot=function(e,t,r,n){r.cancel_on_exit&&function(e){return Ue(e)===Ne}(e)&&"IMG"===e.tagName&&(xt(e),function(e){et(e,(function(e){It(e)})),It(e)}(e),At(e),Xe(e,r.class_loading),Ze(n,-1),We(e),Ye(r.callback_cancel,e,t,n))},Rt=function(e,t,r,n){var i=function(e){return He.indexOf(Ue(e))>=0}(e);Fe(e,"entered"),$e(e,r.class_entered),Xe(e,r.class_exited),function(e,t,r){t.unobserve_entered&&Qe(e,r)}(e,r,n),Ye(r.callback_enter,e,t,n),i||kt(e,r,n)},Dt=["IMG","IFRAME","VIDEO"],Lt=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},jt=function(e,t,r){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Rt(e.target,e,t,r):function(e,t,r,n){Ge(e)||($e(e,r.class_exited),Ot(e,t,r,n),Ye(r.callback_exit,e,t,n))}(e.target,e,t,r)}))},zt=function(e,t){be&&!Lt(e)&&(t._observer=new IntersectionObserver((function(r){jt(r,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},Bt=function(e){return Array.prototype.slice.call(e)},Ut=function(e){return e.container.querySelectorAll(e.elements_selector)},Ft=function(e){return function(e){return Ue(e)===De}(e)},Wt=function(e,t){return function(e){return Bt(e).filter(Ge)}(e||Ut(t))},Gt=function(e,t){var r;(r=Ut(e),Bt(r).filter(Ft)).forEach((function(t){Xe(t,e.class_error),We(t)})),t.update()},Vt=function(e,t){var r=Te(e);this._settings=r,this.loadingCount=0,zt(r,this),function(e,t){ye&&(t._onlineHandler=function(){Gt(e,t)},window.addEventListener("online",t._onlineHandler))}(r,this),this.update(t)};Vt.prototype={update:function(e){var t,r,n=this._settings,i=Wt(e,n);(Ke(this,i.length),!_e&&be)?Lt(n)?function(e,t,r){e.forEach((function(e){-1!==Dt.indexOf(e.tagName)&&Et(e,t,r)})),Ke(r,0)}(i,n,this):(t=this._observer,r=i,function(e){e.disconnect()}(t),function(e,t){t.forEach((function(t){e.observe(t)}))}(t,r)):this.loadAll(i)},destroy:function(){var e;this._observer&&this._observer.disconnect(),e=this,ye&&window.removeEventListener("online",e._onlineHandler),Ut(this._settings).forEach((function(e){ut(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,r=this._settings;Wt(e,r).forEach((function(e){Qe(e,t),kt(e,r,t)}))},restoreAll:function(){var e=this._settings;Ut(e).forEach((function(t){Nt(t,e)}))}},Vt.load=function(e,t){var r=Te(t);kt(e,r)},Vt.resetStatus=function(e){We(e)},ye&&function(e,t){if(t)if(t.length)for(var r,n=0;r=t[n];n+=1)Me(e,r);else Me(e,t)}(Vt,window.lazyLoadOptions);var Ht=function(){function e(t){var r=this,n=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=t.onPagesReady,s=t.urlInterrupter;x(this,e),this._pages=[],this.pageIndex=0,this.setPaused=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new U,this.readonly=n,this.onNewPageIndex=i,this.onPlay=o,this.onPagesReady=a,this.urlInterrupter=s||function(e){return e},this.render()}var t;return S(e,[{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e}},{key:"destroy",value:function(){var e;null==(e=this.previewLazyLoad)||e.destroy(),this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}},{key:"refreshTotalPage",value:function(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t,this.refreshPreview(),this.sideEffect.addEventListener(t,"click",(function(t){var r;if(!e.readonly){var n=null==(r=t.target.dataset)?void 0:r.pageIndex;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(n),"preview"),e.togglePreview(!1))}}))}return this.$preview}},{key:"refreshPreview",value:(t=l(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=this.$preview,i=this.wrapClassName("preview-page"),o=this.wrapClassName("preview-page-name");n.firstChild;)n.firstChild.remove();for(a=[],s=0,u=this.pages.length;s0?"":"none"}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer"));var r=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-sidebar")),r.setAttribute("viewBox","0 0 64 64");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(r,"click",(function(){e.readonly||e.togglePreview()})),this.$btnSidebar=r,this.$btnSidebar.style.display="none",this.$footer.appendChild(r);var n=document.createElement("div");n.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),r.appendChild(n),r}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1,"navigation")})),n.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-play")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),r.appendChild(n),r}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-pause")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),r.appendChild(n),r}(this.namespace));this.$btnPlay=o,this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(e.setPlaying(),e.onPlay&&e.onPlay())})),n.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1,"navigation")})),n.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1,"input")}));var l=document.createElement("span");this.$totalPage=l,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(n),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,r){var n=document.createElement("button");return n.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),n.appendChild(t),r&&n.appendChild(r),n}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&(this.previewLazyLoad||(this.previewLazyLoad=new Vt({container:this.$preview,elements_selector:".".concat(this.wrapClassName("preview-page>img"))})),this.$preview.scrollTo({top:t.offsetTop-16}))}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"pages",set:function(e){this._pages=e,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage(),this.onPagesReady&&this.onPagesReady(e)},get:function(){return this._pages}}]),e}(),Yt=new Set(["clicker"]),$t=function(){},Xt=function(){function e(t){var n=this,i=t.box,o=t.view,a=t.mountSlideController,s=t.mountWhiteboard,u=t.baseScenePath,c=t.appId,h=t.urlInterrupter,d=t.onPagesReady,f=t.onNavigate;x(this,e),this.slideController=null,this.isViewMounted=!1,this.onError=function(e){var t,r,i=e.error,o=e.index;n.viewer.setPaused(),(null==(t=n.slideController)?void 0:t.showRenderError)&&(n.$overlay.textContent="Error on slide[page=".concat(n.slideController.page,"]: ").concat(i.message),n.$overlay.style.opacity="1"),(null==(r=n.slideController)?void 0:r.onRenderError)&&n.slideController.onRenderError(i,o),oe.warn("[Slide] render error",i)},this.onRenderStart=function(){n.$whiteboardView.classList.add(n.wrapClassName("wb-view-hidden")),n.viewer.setPlaying()},this.onRenderEnd=function(){},this.onPageChanged=function(){clearTimeout(n._onPageChangedTimer),n._onPageChangedTimer=setTimeout(n._onPageChanged,200)},this._onPageChangedTimer=0,this._onPageChanged=function(){n.$overlay.style.opacity="",n.$whiteboardView.classList.remove(n.wrapClassName("wb-view-hidden"))},this.refreshPages=function(){n.slideController&&(n.viewer.pages=de(n.slideController.slide,n.slideController.previewList),n.viewer.setPageIndex(n.getPageIndex(n.slideController.page)),n.scaleDocsToFit())},this.scaleDocsToFit=function(){if(n.slideController){var e=n.slideController.slide,t=e.width,r=e.height;t&&r&&(n.whiteboardView.moveCameraToContain({originX:-t/2,originY:-r/2,width:t,height:r,animationMode:"immediately"}),n.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return n.whiteboardView.camera.scale},minContentMode:function(){return n.whiteboardView.camera.scale},centerX:0,centerY:0,width:t,height:r}),n.isViewMounted||(n.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),n.mountWhiteboard(n.$whiteboardView)))}},this.onPlay=function(){n.slideController&&n.slideController.slide.nextStep()},this.onNewPageIndex=function(e,t){n.slideController&&n.slideController.jumpToPage(e+1,t)},this.sideEffect=new U,this.namespace="netless-app-slide",this.toPdf=l(regeneratorRuntime.mark((function e(){var t,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.slideController){e.next=3;break}return n.reportProgress(100,null),e.abrupt("return");case 3:if(t=n.slideController.slide,i=1920,o=document.createElement("canvas"),a=o.getContext("2d"),s=t.slideCount,u=t.width,l=t.height,c=Math.floor(u),h=Math.floor(l),c>i&&(c=i,h=Math.floor(l*c/u)),h>i&&(h=i,c=Math.floor(u*h/l)),o.width=c,o.height=h,(d=document.createElement("canvas")).width=c,d.height=h,(f=d.getContext("2d"))&&n.getWhiteSnapshot&&a){e.next=21;break}return n.reportProgress(100,null),e.abrupt("return",null);case 21:return p=c>h?"l":"p",e.next=24,Promise.resolve().then(r.bind(r,88877));case 24:v=e.sent,m=v.jsPDF,g=new m({format:[c,h],orientation:p,compress:!0}),y=1;case 28:if(!(y<=s)){e.next=57;break}return _=null,e.prev=30,e.next=33,n.slideController.slide.snapshotWithTimingEnd(y);case 33:_=e.sent,e.next=38;break;case 36:e.prev=36,e.t0=e.catch(30);case 38:if(!_){e.next=40;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("img")).src=_,e.next=4,new Promise((function(e){return t.onload=e}));case 4:a.drawImage(t,0,0,c,h);case 5:case"end":return e.stop()}}),e)}))(),"t1",40);case 40:return f.clearRect(0,0,c,h),n.getWhiteSnapshot(y,d,f,u,l),e.prev=42,e.delegateYield(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.toDataURL("image/png"),(r=document.createElement("img")).src=t,e.next=5,new Promise((function(e){return r.onload=e}));case 5:a.drawImage(r,0,0,c,h);case 6:case"end":return e.stop()}}),e)}))(),"t2",44);case 44:e.next=48;break;case 46:e.prev=46,e.t3=e.catch(42);case 48:b=o.toDataURL("image/jpeg",.6),y>1&&g.addPage(),g.addImage(b,"JPEG",0,0,c,h,"","FAST"),a.clearRect(0,0,c,h),Math.ceil(y/s*100)<100&&n.reportProgress(Math.ceil(y/s*100),null);case 54:y++,e.next=28;break;case 57:x=g.output("arraybuffer"),w=n.box.title,n.reportProgress(100,{pdf:x,title:w});case 60:case"end":return e.stop()}}),e,null,[[30,36],[42,46]])}))),this.box=i,this.whiteboardView=o,this.mountSlideController=a,this.mountWhiteboard=s,this.onNavigate=f||$t,this.baseScenePath=u,this.appId=c,this.viewer=new Ht({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h,onPagesReady:d}),this.sideEffect.add((function(){var e=function(e){n.setReadonly(e)};return i.events.on("readonly",e),function(){return i.events.off("readonly",e)}})),this.sideEffect.add((function(){var e=function(e){"@netless/_request_save_pdf_"===e.data.type&&e.data.appId===n.appId&&n.toPdf().catch((function(){return n.reportProgress(100,null)}))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}})),this.render()}return S(e,[{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",(function(t){if(e.box.focus&&e.slideController&&!function(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.slideController.slide.prevStep(),e.onNavigate(e.slideController.page,"keydown");break;case"ArrowRight":case"ArrowDown":e.slideController.slide.nextStep(),e.onNavigate(e.slideController.page,"keydown")}}))}},{key:"renderOverlay",value:function(){if(!this.$overlay){var e=document.createElement("div");e.className=this.wrapClassName("overlay"),this.$overlay=e}return this.$overlay}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"renderWhiteboardView",value:function(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}},{key:"mount",value:function(){var e=this;return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onNavigate:this.onNavigate,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){return e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"unmount",value:function(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.viewer.setReadonly(e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"toggleClickThrough",value:function(e){this.$whiteboardView.style.pointerEvents=!e||Yt.has(e)?"none":"auto"}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"getWhiteSnapshot",value:function(e,t,r,n,i){this.whiteboardView.screenshotToCanvas(r,"".concat(this.baseScenePath,"/").concat(e),t.width,t.height,{centerX:0,centerY:0,scale:Math.min(t.width/n,t.height/i)})}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),qt=!1,Qt=2;t.FreezerLength=Qt;var Zt=function(e){return"["+e+"]"},Kt={map:new Map,boxes:new Map,queue:[],validateQueue:function(){var e=this;for(this.queue.sort((function(t,r){var n,i,o,a;return-((null!=(i=null==(n=e.boxes.get(t))?void 0:n.zIndex)?i:0)-(null!=(a=null==(o=e.boxes.get(r))?void 0:o.zIndex)?a:0))})),ae("[Slide] freezer: validate",Zt(this.queue));this.queue.length>Qt;){var t=this.queue.pop(),r=this.map.get(t);r&&(ae("[Slide] freezer: validate-freeze",t,Zt(this.queue)),r.freeze())}},set:function(e,t,r){ae("[Slide] freezer: add",e,Zt(this.queue)),this.map.set(e,t),this.boxes.set(e,r),this.queue.includes(e)||this.queue.unshift(e),this.validateQueue()},delete:function(e){this.map.delete(e),this.boxes.delete(e),this.queue=this.queue.filter((function(t){return t!==e})),ae("[Slide] freezer: delete",e,Zt(this.queue))},focus:function(e){var t=this.map.get(e),r=this.queue.indexOf(e);r>-1&&this.queue.splice(r,1),this.queue.unshift(e),this.validateQueue(),ae("[Slide] freezer: focus",e,Zt(this.queue)),t&&t.unfreeze()}};t.apps=Kt;var Jt=new Set;var er=new Set;t.addHooks=function(e){qt=!0,e.on("focus",(function(e){var t=e.appId;Kt.focus(t)})),e.on("created",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;er.forEach((function(e){return e(t)}))}))};var tr=function(){return".netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden;transition:opacity .2s}.netless-app-slide-wb-view-hidden{opacity:0}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}\n"}();var rr=function(){function e(t){var r=this;x(this,e),this.slide=null,this.debug=!1,this.previewList=[],this.sideEffect=new U,this.ready=!1,this.readyPromise=new Promise((function(e){r.resolveReady=function(){r.ready=!0,e()}})),this.hotkeyListener=function(e){if(r.slide)switch(e.key){case"ArrowUp":case"ArrowLeft":r.slide.prevStep();break;case"ArrowRight":case"ArrowDown":r.slide.nextStep()}},this.onPageChanged=function(e){r.viewer.setPageIndex(e-1)},this.onTransitionStart=function(){r.viewer.setPlaying()},this.onTransitionEnd=function(){r.viewer.setPaused()},this.onError=function(e){var t=e.error;r.viewer.setPaused(),console.warn("[Slide] render error",t)},this.destroyed=!1,this.refreshPages=function(){r.slide&&(r.viewer.pages=de(r.slide,r.previewList),r.viewer.setPageIndex(r.getPageIndex(r.slide.slideState.currentSlideIndex)))},this.onPlay=function(){r.slide&&r.slide.nextStep()},this.onNewPageIndex=function(e){r.slide&&r.slide.slideCount>0&&r.slide.renderSlide(W(e+1,1,r.slide.slideCount))},this.namespace="netless-app-slide",this.target=t.target,this.bgColor=ce(this.target),this.viewer=new Ht({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}return S(e,[{key:"render",value:function(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}},{key:"registerHotKeys",value:function(e){this.sideEffect.addEventListener(e,"keydown",this.hotkeyListener,void 0,"hotkey")}},{key:"mount",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new L.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),r.length>0?this.slide.setResourceList(e,r):this.slide.setResource(e,t),this.slide.renderSlide(1),this.previewList=n}},{key:"renderStyle",value:function(){var e=document.createElement("style");return e.appendChild(document.createTextNode(tr)),e}},{key:"registerEventListeners",value:function(){if(this.slide){var e=this.slide;e.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),e.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.renderError,this.onError),e.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();t.SlidePreviewer=rr;var nr=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=nr;var ir="0.2.60";t.version=ir;var or={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.60"),e.getIsWritable()&&e.storage.ensureState(ve),!e.storage.state.taskId)throw new Error("[Slide] no taskId");var r=e.getView();if(!r)throw new Error("[Slide] no view, please set scenePath on addApp()");r.disableCameraTransform=!0;var n=e.getBox();n.mountStyles(tr);try{n.$content.dataset.appSlideVersion=ir}catch(e){}var i=e.getInitScenePath(),o=null,a=function(t){var r=e.getRoom();if(o&&o.slideController){var n=!1;r&&e.getIsWritable()&&(fe(r,e,o.slideController.slide,i),n=!0),ae("[Slide] page to",t,n?"(synced)":""),o.viewer.setPageIndex(t-1),o.viewer.setPaused(),o.onPageChanged();var a=o.viewer.pages.length;a>0&&e.dispatchAppEvent("pageStateChange",{index:t-1,length:a})}};o=new Xt({box:n,view:r,mountSlideController:function(t){var r,o,s=e.getAppOptions()||{},u=new ge((r=D({context:e},t),o={onPageChanged:a,onNavigate:t.onNavigate,onRenderError:s.onRenderError,showRenderError:s.showRenderError,invisibleBehavior:s.invisibleBehavior},A(r,C(o))));return qt&&Kt.set(e.appId,u,n),oe.setAppController(e.appId,u),u.readyPromise.then(t.onReady).then((function(){var r=e.getRoom(),n=!1;r&&e.getIsWritable()&&(fe(r,e,u.slide,i),n=!0);var o=u.slide.slideState.currentSlideIndex;ae("[Slide] page to",o,n?"(synced)":"","(on ready)"),u.slide.on("renderEnd",t.onRenderEnd)})),u},mountWhiteboard:e.mountView.bind(e),baseScenePath:i,appId:e.appId,urlInterrupter:null==(t=e.getAppOptions())?void 0:t.urlInterrupter,onPagesReady:function(t){var r=t.length,n=(null==o?void 0:o.viewer.pageIndex)||0;e.dispatchAppEvent("pageStateChange",{index:n,length:r})},onNavigate:function(e,t){ae("[Slide] user navigate to",e,t?"(".concat(t,")"):"")}});var s=e.getRoom(),u=new U;return u.add((function(){var t;return oe.setAppContext(e.appId,e),oe.enable=(null==(t=e.getAppOptions())?void 0:t.debug)||!1,oe.level="debug",function(){return oe.deleteApp(e.appId)}})),s&&(o.toggleClickThrough(s.state.memberState.currentApplianceName),u.add((function(){var e=function(e){e.memberState&&o&&o.toggleClickThrough(e.memberState.currentApplianceName)};return s.callbacks.on("onRoomStateChanged",e),function(){return s.callbacks.off("onRoomStateChanged",e)}}))),e.emitter.on("destroy",(function(){ae("[Slide] destroy",e.appId),qt&&Kt.delete(e.appId),u.flushAll(),o&&(o.destroy(),o=null)})),o.mount(),{viewer:function(){return o},controller:function(){return null==o?void 0:o.slideController},slide:function(){var e;return null==(e=null==o?void 0:o.slideController)?void 0:e.slide},nextStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.nextStep(),!0)},prevStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.prevStep(),!0)},position:function(){var e=null==o?void 0:o.slideController;if(e)return[e.page,e.pageCount]},nextPage:function(){var e=null==o?void 0:o.slideController;if(e){var t=e.page,r=e.pageCount;if(r>0&&t0&&t>1)return e.jumpToPage(t-1),!0}return!1},jumpToPage:function(e){var t=null==o?void 0:o.slideController;if(t){var r=t.page,n=t.pageCount;if(n>0&&r>0&&r<=n)return t.jumpToPage(e),!0}return!1}}}};t.default=or;var ar=L.Slide;t.Slide=ar},60064:function(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});var n=r(66835);t.ActiveContainerType=n.ActiveContainerType,t.ApplianceMultiPlugin=n.ApplianceMultiPlugin,t.ApplianceNames=n.ApplianceNames,t.ApplianceSigleWrapper=n.ApplianceSigleWrapper,t.ApplianceSinglePlugin=n.ApplianceSinglePlugin,t.ECanvasShowType=n.ECanvasShowType,t.EDataType=n.EDataType,t.EMatrixrRelationType=n.EMatrixrRelationType,t.EPostMessageType=n.EPostMessageType,t.EScaleType=n.EScaleType,t.EStrokeType=n.EStrokeType,t.EToolsKey=n.EToolsKey,t.ElayerType=n.ElayerType,t.EmitEventType=n.EmitEventType,t.EventMessageType=n.EventMessageType,t.EvevtWorkState=n.EvevtWorkState,t.EvevtWorkType=n.EvevtWorkType,t.InternalMsgEmitterType=n.InternalMsgEmitterType,t.ShapeType=n.ShapeType,t.fullWorkerUrl=n.fullWorker,t.subWorkerUrl=n.subWorker},66835:function(e,t,r){function n(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t,r){return i=x()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&g(i,r.prototype),i},i.apply(null,arguments)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}}function u(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||p(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 l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){a=!0,i=e})),f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function p(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;S(this,e),this.x=t,this.y=r,this.z=n}return M(e,[{key:"setz",value:function(e){return this.z=e,this}},{key:"setXY",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y;return this.x=e,this.y=t,this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z;return this.x=e,this.y=t,this.z=r,this}},{key:"setTo",value:function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.z,a=void 0===o?1:o;return this.x=r,this.y=i,this.z=a,this}},{key:"rot",value:function(e){if(0===e)return this;var t=this.x,r=this.y,n=Math.sin(e),i=Math.cos(e);return this.x=t*i-r*n,this.y=t*n+r*i,this}},{key:"rotWith",value:function(e,t){if(0===t)return this;var r=this.x-e.x,n=this.y-e.y,i=Math.sin(t),o=Math.cos(t);return this.x=e.x+(r*o-n*i),this.y=e.y+(r*i+n*o),this}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subXY",value:function(e,t){return this.x-=e,this.y-=t,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addXY",value:function(e,t){return this.x+=e,this.y+=t,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"clamp",value:function(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,e),void 0!==t&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this}},{key:"div",value:function(e){return this.x/=e,this.y/=e,this}},{key:"divV",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"mul",value:function(e){return this.x*=e,this.y*=e,this}},{key:"mulV",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"abs",value:function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this}},{key:"nudge",value:function(t,r){var n=e.Tan(t,this);return this.add(n.mul(r))}},{key:"neg",value:function(){return this.x*=-1,this.y*=-1,this}},{key:"cross",value:function(e){return this.x=this.y*e.z-this.z*e.y,this.y=this.z*e.x-this.x*e.z,this}},{key:"dpr",value:function(t){return e.Dpr(this,t)}},{key:"cpr",value:function(t){return e.Cpr(this,t)}},{key:"len2",value:function(){return e.Len2(this)}},{key:"len",value:function(){return e.Len(this)}},{key:"pry",value:function(t){return e.Pry(this,t)}},{key:"per",value:function(){var e=this.x,t=this.y;return this.x=t,this.y=-e,this}},{key:"uni",value:function(){return e.Uni(this)}},{key:"tan",value:function(t){return e.Tan(this,t)}},{key:"dist",value:function(t){return e.Dist(this,t)}},{key:"distanceToLineSegment",value:function(t,r){return e.DistanceToLineSegment(t,r,this)}},{key:"slope",value:function(t){return e.Slope(this,t)}},{key:"snapToGrid",value:function(e){return this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this}},{key:"angle",value:function(t){return e.Angle(this,t)}},{key:"toAngle",value:function(){return e.ToAngle(this)}},{key:"lrp",value:function(e,t){return this.x=this.x+(e.x-this.x)*t,this.y=this.y+(e.y-this.y)*t,this}},{key:"equals",value:function(t,r){return e.Equals(this,t,r)}},{key:"equalsXY",value:function(t,r){return e.EqualsXY(this,t,r)}},{key:"norm",value:function(){var e=this.len();return this.x=0===e?0:this.x/e,this.y=0===e?0:this.y/e,this}},{key:"toFixed",value:function(){return e.ToFixed(this)}},{key:"toString",value:function(){return e.ToString(e.ToFixed(this))}},{key:"toJson",value:function(){return e.ToJson(this)}},{key:"toArray",value:function(){return e.ToArray(this)}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Add",value:function(t,r){return new e(t.x+r.x,t.y+r.y)}},{key:"AddXY",value:function(t,r,n){return new e(t.x+r,t.y+n)}},{key:"Sub",value:function(t,r){return new e(t.x-r.x,t.y-r.y)}},{key:"SubXY",value:function(t,r,n){return new e(t.x-r,t.y-n)}},{key:"AddScalar",value:function(t,r){return new e(t.x+r,t.y+r)}},{key:"SubScalar",value:function(t,r){return new e(t.x-r,t.y-r)}},{key:"Div",value:function(t,r){return new e(t.x/r,t.y/r)}},{key:"Mul",value:function(t,r){return new e(t.x*r,t.y*r)}},{key:"DivV",value:function(t,r){return new e(t.x/r.x,t.y/r.y)}},{key:"MulV",value:function(t,r){return new e(t.x*r.x,t.y*r.y)}},{key:"Neg",value:function(t){return new e(-t.x,-t.y)}},{key:"Per",value:function(t){return new e(t.y,-t.x)}},{key:"Dist2",value:function(t,r){return e.Sub(t,r).len2()}},{key:"Abs",value:function(t){return new e(Math.abs(t.x),Math.abs(t.y))}},{key:"Dist",value:function(e,t){return Math.hypot(e.y-t.y,e.x-t.x)}},{key:"Dpr",value:function(e,t){return e.x*t.x+e.y*t.y}},{key:"Cross",value:function(t,r){return new e(t.y*r.z-t.z*r.y,t.z*r.x-t.x*r.z)}},{key:"Cpr",value:function(e,t){return e.x*t.y-t.x*e.y}},{key:"Len2",value:function(e){return e.x*e.x+e.y*e.y}},{key:"Len",value:function(e){return Math.hypot(e.x,e.y)}},{key:"Pry",value:function(t,r){return e.Dpr(t,r)/e.Len(r)}},{key:"Uni",value:function(t){return e.Div(t,e.Len(t))}},{key:"Tan",value:function(t,r){return e.Uni(e.Sub(t,r))}},{key:"Min",value:function(t,r){return new e(Math.min(t.x,r.x),Math.min(t.y,r.y))}},{key:"Max",value:function(t,r){return new e(Math.max(t.x,r.x),Math.max(t.y,r.y))}},{key:"From",value:function(t){return(new e).add(t)}},{key:"FromArray",value:function(t){return new e(t[0],t[1])}},{key:"Rot",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Math.sin(r),i=Math.cos(r);return new e(t.x*i-t.y*n,t.x*n+t.y*i)}},{key:"RotWith",value:function(t,r,n){var i=t.x-r.x,o=t.y-r.y,a=Math.sin(n),s=Math.cos(n);return new e(r.x+(i*s-o*a),r.y+(i*a+o*s))}},{key:"NearestPointOnLineThroughPoint",value:function(t,r,n){return e.Mul(r,e.Sub(n,t).pry(r)).add(t)}},{key:"NearestPointOnLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=e.Tan(r,t),a=e.Add(t,e.Mul(o,e.Sub(n,t).pry(o)));if(i){if(a.xMath.max(t.x,r.x))return e.Cast(t.x>r.x?t:r);if(a.yMath.max(t.y,r.y))return e.Cast(t.y>r.y?t:r)}return a}},{key:"DistanceToLineThroughPoint",value:function(t,r,n){return e.Dist(n,e.NearestPointOnLineThroughPoint(t,r,n))}},{key:"DistanceToLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e.Dist(n,e.NearestPointOnLineSegment(t,r,n,i))}},{key:"Snap",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}},{key:"Cast",value:function(t){return t instanceof e?t:e.From(t)}},{key:"Slope",value:function(e,t){return e.x===t.y?NaN:(e.y-t.y)/(e.x-t.x)}},{key:"Angle",value:function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}},{key:"Lrp",value:function(t,r,n){return e.Sub(r,t).mul(n).add(t)}},{key:"Med",value:function(t,r){return new e((t.x+r.x)/2,(t.y+r.y)/2)}},{key:"Equals",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-4;return Math.abs(e.x-t.x)2&&void 0!==arguments[2]?arguments[2]:1e-4;return e.Equals(t,r,n)&&Math.abs((t.z||0)-(r.z||0))1&&void 0!==arguments[1]?arguments[1]:2;return new e(+t.x.toFixed(r),+t.y.toFixed(r),+t.z.toFixed(r))}},{key:"Nudge",value:function(t,r,n){return e.Add(t,e.Tan(r,t).mul(n))}},{key:"ToString",value:function(e){return"".concat(e.x,", ").concat(e.y)}},{key:"ToAngle",value:function(e){var t=Math.atan2(e.y,e.x);return t<0&&(t+=2*Math.PI),t}},{key:"FromAngle",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.cos(t)*r,Math.sin(t)*r)}},{key:"ToArray",value:function(e){return[e.x,e.y,e.z]}},{key:"ToJson",value:function(e){return{x:e.x,y:e.y,z:e.z}}},{key:"Average",value:function(t){for(var r=t.length,n=new e(0,0),i=0;i2&&void 0!==arguments[2]?arguments[2]:6,i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:8;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}}]),e}(),ne=function(e){return e<.5?2*e*e:(4-2*e)*e-1},ie=function(e){m(r,e);var t=y(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return S(this,r),(e=t.call(this,n,i,o)).x=n,e.y=i,e.z=o,e.v=a,e.t=s,e.a=u,e}return M(r,[{key:"setA",value:function(e){this.a=e}},{key:"setT",value:function(e){this.t=e}},{key:"setv",value:function(e){return this.v={x:e.x,y:e.y},this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.v,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.a;return this.x=e,this.y=t,this.z=r,this.v=n,this.t=i,this.a=o,this}},{key:"clone",value:function(){var e=this.x,t=this.y,n=this.z,i=this.v,o=this.t,a=this.a;return new r(e,t,n,{x:i.x,y:i.y},o,a)}},{key:"distance",value:function(e){return r.GetDistance(this,e)}},{key:"isNear",value:function(e,t){return r.IsNear(this,e,t)}},{key:"getAngleByPoints",value:function(e,t){return r.GetAngleByPoints(e,this,t)}},{key:"timestamp",get:function(){return this.t}},{key:"pressure",get:function(){return this.z}},{key:"angleNum",get:function(){return this.a}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Sub",value:function(e,t){return new r(e.x-t.x,e.y-t.y)}},{key:"Add",value:function(e,t){return new r(e.x+t.x,e.y+t.y)}},{key:"GetDistance",value:function(e,t){return r.Len(e.clone().sub(t))}},{key:"GetAngleByPoints",value:function(e,t,r){var n=t.x-e.x,i=r.x-t.x,o=t.y-e.y,a=r.y-t.y,s=0,u=Math.sqrt(n*n+o*o),l=Math.sqrt(i*i+a*a);if(u&&l){var c=n*i+o*a,h=n*a-o*i;s=180+(h=h>0?1:-1)*(s=(s=Math.acos(c/(u*l)))/Math.PI*180)}return s}},{key:"IsNear",value:function(e,t,n){return r.Len(e.clone().sub(t))3&&void 0!==arguments[3]?arguments[3]:2,o=e.x-t.x,a=e.y-t.y,s=Math.sin(n),u=Math.cos(n),l=Math.pow(10,i),c=Math.floor((t.x+(o*u-a*s))*l)/l,h=Math.floor((t.y+(o*s+a*u))*l)/l;return new r(c,h)}},{key:"GetDotStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,i=new re(1,1),o=Math.PI+.001,a=r.Add(e,r.Sub(e,i).uni().per().mul(-t)),s=[],u=1/n,l=u;l<=1;l+=u)s.push(r.RotWith(a,e,2*o*l));return s}},{key:"GetSemicircleStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,o=n*(Math.PI+.001),a=[],s=1/i,u=s;u<=1;u+=s)a.push(r.RotWith(t,e,o*u));return a}}]),r}(re),oe=("undefined"==typeof globalThis?"undefined":k(globalThis))<"u"?globalThis:("undefined"==typeof window?"undefined":k(window))<"u"?window:(void 0===r.g?"undefined":k(r.g))<"u"?r.g:("undefined"==typeof self?"undefined":k(self))<"u"?self:{};function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se="object"==k(oe)&&oe&&oe.Object===Object&&oe,ue=se,le="object"==("undefined"==typeof self?"undefined":k(self))&&self&&self.Object===Object&&self,ce=ue||le||Function("return this")(),he=ce.Symbol,de=he,fe=Object.prototype,pe=fe.hasOwnProperty,ve=fe.toString,me=de?de.toStringTag:void 0;var ge=function(e){var t=pe.call(e,me),r=e[me];try{e[me]=void 0;var n=!0}catch(e){}var i=ve.call(e);return n&&(t?e[me]=r:delete e[me]),i},ye=Object.prototype.toString;var _e=function(e){return ye.call(e)},be=ge,xe=_e,we=he?he.toStringTag:void 0;var Se=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":we&&we in Object(e)?be(e):xe(e)};var Te=function(e){return null!=e&&"object"==k(e)},Me=Se,ke=Te;var Ee=function(e){return"number"==typeof e||ke(e)&&"[object Number]"==Me(e)},Ie=ae(Ee);var Ae=function(){this.__data__=[],this.size=0};var Ce=function(e,t){return e===t||e!=e&&t!=t},Pe=Ce;var Ne=function(e,t){for(var r=e.length;r--;)if(Pe(e[r][0],t))return r;return-1},Oe=Ne,Re=Array.prototype.splice;var De=function(e){var t=this.__data__,r=Oe(t,e);return!(r<0)&&(r==t.length-1?t.pop():Re.call(t,r,1),--this.size,!0)},Le=Ne;var je=function(e){var t=this.__data__,r=Le(t,e);return r<0?void 0:t[r][1]},ze=Ne;var Be=function(e){return ze(this.__data__,e)>-1},Ue=Ne;var Fe=function(e,t){var r=this.__data__,n=Ue(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},We=Ae,Ge=De,Ve=je,He=Be,Ye=Fe;function $e(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Kr=Se,Jr=Zr,en=Te,tn={};tn["[object Float32Array]"]=tn["[object Float64Array]"]=tn["[object Int8Array]"]=tn["[object Int16Array]"]=tn["[object Int32Array]"]=tn["[object Uint8Array]"]=tn["[object Uint8ClampedArray]"]=tn["[object Uint16Array]"]=tn["[object Uint32Array]"]=!0,tn["[object Arguments]"]=tn["[object Array]"]=tn["[object ArrayBuffer]"]=tn["[object Boolean]"]=tn["[object DataView]"]=tn["[object Date]"]=tn["[object Error]"]=tn["[object Function]"]=tn["[object Map]"]=tn["[object Number]"]=tn["[object Object]"]=tn["[object RegExp]"]=tn["[object Set]"]=tn["[object String]"]=tn["[object WeakMap]"]=!1;var rn=function(e){return en(e)&&Jr(e.length)&&!!tn[Kr(e)]};var nn=function(e){return function(t){return e(t)}},on={exports:{}};!function(e,t){var r=se,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(on,on.exports);var an=on.exports,sn=rn,un=nn,ln=an&&an.isTypedArray,cn=ln?un(ln):sn,hn=Rr,dn=Vr,fn=Hr,pn=Xr,vn=Qr,mn=cn,gn=Object.prototype.hasOwnProperty;var yn=function(e,t){var r=fn(e),n=!r&&dn(e),i=!r&&!n&&pn(e),o=!r&&!n&&!i&&mn(e),a=r||n||i||o,s=a?hn(e.length,String):[],u=s.length;for(var l in e)(t||gn.call(e,l))&&(!a||!("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||vn(l,u)))&&s.push(l);return s},_n=Object.prototype;var bn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_n)};var xn=function(e,t){return function(r){return e(t(r))}},wn=xn(Object.keys,Object),Sn=bn,Tn=wn,Mn=Object.prototype.hasOwnProperty;var kn=function(e){if(!Sn(e))return Tn(e);var t=[];for(var r in Object(e))Mn.call(e,r)&&"constructor"!=r&&t.push(r);return t},En=nt,In=Zr;var An=function(e){return null!=e&&In(e.length)&&!En(e)},Cn=yn,Pn=kn,Nn=An;var On=function(e){return Nn(e)?Cn(e):Pn(e)},Rn=Or,Dn=On;var Ln=function(e,t){return e&&Rn(t,Dn(t),e)};var jn=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},zn=et,Bn=bn,Un=jn,Fn=Object.prototype.hasOwnProperty;var Wn=function(e){if(!zn(e))return Un(e);var t=Bn(e),r=[];for(var n in e)"constructor"==n&&(t||!Fn.call(e,n))||r.push(n);return r},Gn=yn,Vn=Wn,Hn=An;var Yn=function(e){return Hn(e)?Gn(e,!0):Vn(e)},$n=Or,Xn=Yn;var qn=function(e,t){return e&&$n(t,Xn(t),e)},Qn={exports:{}};!function(e,t){var r=ce,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n?r.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}}(Qn,Qn.exports);var Zn=Qn.exports;var Kn=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r1&&void 0!==arguments[1])||arguments[1],r=e.length;if(r<2)return"";var n=e[0],i=e[1];if(2===r)return"M".concat(iu(n),"L").concat(iu(i));for(var o="",a=2,s=r-1;a3?"T":"").concat(o,"L").concat(iu(e[r-1]))}var ba=function(){function e(t){S(this,e),I(this,"syncUnitTime",ya.syncOpt.interval),I(this,"vNodes"),I(this,"drawLayer"),I(this,"fullLayer"),I(this,"workId");var r=t.vNodes,n=t.fullLayer,i=t.drawLayer,o=t.workId,a=t.toolsOpt;this.vNodes=r,this.fullLayer=n,this.drawLayer=i,this.workId=o,this.syncUnitTime=a.syncUnitTime||this.syncUnitTime}return M(e,[{key:"filterSamePoints",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.01;return e.reduce((function(e,r){var n=e[e.length-1];return(r&&!n||r&&n&&!r.isNear(n,t))&&e.push(r),e}),[])}},{key:"setWorkId",value:function(e){this.workId=e}},{key:"getWorkId",value:function(){return this.workId}},{key:"getWorkOptions",value:function(){return this.workOptions}},{key:"setWorkOptions",value:function(e){var t,r,n;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var i=null==(t=this.workId)?void 0:t.toString(),o=i&&(null==(r=this.vNodes)?void 0:r.get(i))||void 0;i&&o&&(o.opt=e,null==(n=this.vNodes)||n.setInfo(i,o))}},{key:"updataOptService",value:function(t){var r,n,i,o=null==(r=this.workId)?void 0:r.toString();if(o&&t){var a=this.fullLayer.getElementsByName(o)||this.drawLayer&&this.drawLayer.getElementsByName(o)||[];if(1!==a.length)return;var s=a[0],u=t.pos,l=t.zIndex,c=t.scale,h=t.angle,d=t.translate,f={};Ie(l)&&(f.zIndex=l),u&&(f.pos=[u[0],u[1]]),c&&(f.scale=c),h&&(f.rotate=h),d&&(f.translate=d),s.attr(f);var p=null==s?void 0:s.getBoundingClientRect();return p&&(i=Ys(i,{x:Math.floor(p.x-e.SafeBorderPadding),y:Math.floor(p.y-e.SafeBorderPadding),w:Math.floor(p.width+2*e.SafeBorderPadding),h:Math.floor(p.height+2*e.SafeBorderPadding)})),null==(n=this.vNodes)||n.setInfo(o,{rect:i,centerPos:u}),i}}},{key:"drawEraserlines",value:function(e){var t,r=e.group,n=e.eraserlines,i=e.pos,o=e.layer,a=e.isClear,s=void 0===a||a,u=!!o.parent.gl,l=f(n);try{for(l.s();!(t=l.n()).done;){var c,h=t.value,d=h.thickness,p=f(h.op);try{for(p.s();!(c=p.n()).done;){var v=c.value.map((function(e,t){return t%2?e-i[1]:e-i[0]})),m={pos:[0,0],d:_a(this.computEraserPoints(v,d),!0),fillColor:"rgba(0,0,0,1)"},g=new C.Path(m);s&&(g.addEventListener("beforerender",(function(e){var t=e.detail.context;u?t.blendFuncSeparate(t.ZERO,t.ZERO,t.ZERO,t.ZERO):t.globalCompositeOperation="destination-out"})),g.addEventListener("afterrender",(function(e){var t=e.detail.context;u?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):t.globalCompositeOperation="source-over"}))),r.append(g)}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}}},{key:"computEraserPoints",value:function(e,t){var r=Math.ceil(t/2);return 2===e.length?this.computDot(e,r):this.computLine(e,r)}},{key:"computDot",value:function(e,t){var r=new ie(e[0],e[1]);return ie.GetDotStroke(r,t,8)}},{key:"computLine",value:function(e,t){for(var r,n,i=[],o=[],a=0;a1)for(var s=1;sthis.syncUnitTime&&(m=!0,this.syncTimestamp=h[0].taskId,this.syncIndex=this.tmpPoints.length),i||o)){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({attrs:v,tasks:h,effects:d,layer:y,replaceId:s})}if(i)return f>10&&this.tmpPoints.splice(0,f-10),{rect:p,type:X.DrawWork,dataType:Y.Local};var _=[];return this.tmpPoints.slice(g).forEach((function(e){_.push(e.x,e.y,t.computRadius(e.z,t.workOptions.thickness))})),c(c({},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local,rect:p,op:m?_:void 0,index:m?3*g:void 0,updateNodeOpt:{useAnimation:!0}})}},{key:"consumeAll",value:function(e){var t,r=this.workId;if(e.data){var n=e.data,i=n.op,o=n.workState;null!=i&&i.length&&o===$.Done&&this.workOptions.strokeType===U.Stroke&&this.updateTempPointsWithPressureWhenDone(i)}var a,s=this.transformDataAll(!0),u={name:r},l=this.fullLayer;if(s.length&&(a=this.draw({attrs:u,tasks:s,replaceId:r,layer:l})),this.tmpPoints.length<2)return this.replace(l,r),{type:X.RemoveNode,removeIds:[r],rect:a};var h=[];this.tmpPoints.map((function(e){h.push(e.x,e.y,e.z)})),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var d=Sa(h);return null==(t=this.vNodes)||t.setInfo(r,{rect:a,op:h,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&xa.getCenterPos(a,l)}),c(c({},this.baseConsumeResult),{},{rect:a,type:X.FullWork,dataType:Y.Local,ops:d,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}})}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId;this.tmpPoints.length=0;for(var a=0;a0){var u=this.tmpPoints[this.tmpPoints.length-1],l=re.Sub(s,u).uni();s.setv(l)}this.tmpPoints.push(s)}if(!(this.tmpPoints.length<2)){var c,h=this.transformDataAll(!0),d=null==(t=this.workId)?void 0:t.toString(),f={name:d};if(d&&h.length){var p=i?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({attrs:f,tasks:h,replaceId:o,layer:p}),null==(r=this.vNodes)||r.setInfo(d,{rect:c,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&xa.getCenterPos(c,p)})}return c}}},{key:"transformDataAll",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(t,e&&this.workOptions.thickness||void 0)}},{key:"draw",value:function(e){var t,r=this,n=e.attrs,i=e.tasks,o=e.replaceId,a=e.effects,s=e.layer,l=this.workOptions,h=l.strokeColor,d=l.strokeType,f=l.thickness,p=l.zIndex,v=l.scale,m=l.rotate,g=l.translate,y=l.eraserlines;null!=a&&a.size&&(a.forEach((function(e){var t;null==(t=s.getElementById(e+""))||t.remove()})),a.clear());for(var _=[],b=s.worldPosition,x=s.worldScaling,w=0;w1&&(s=e[n+1].point.v);var u=re.Per(s).mul(a);t.push(ie.Sub(o,u)),r.push(ie.Add(o,u))}var l=e[e.length-1],c=ie.GetSemicircleStroke(l.point,t[t.length-1],-1,8),h=ie.GetSemicircleStroke(e[0].point,r[0],-1,8),d=t.concat(c,r.reverse(),h);return{ps:d,rect:Xs(d)}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:ie.GetDotStroke(t,r,8),rect:n}}},{key:"transformData",value:function(e,t){var r=e.op,n=e.workState,i=this.tmpPoints.length-1,o=[];if(null!=r&&r.length&&n){var a=this.workOptions,s=a.strokeType,u=a.thickness,l=new Set;i=s===U.Stroke?this.updateTempPointsWithPressure(r,u,l):this.updateTempPoints(r,u,l);var c=t?this.tmpPoints:this.tmpPoints.slice(i);return{tasks:o=this.getTaskPoints(c,u),effects:l,consumeIndex:i}}return{tasks:o,consumeIndex:i}}},{key:"computRadius",value:function(e,t){return.03*e*t+.5*t}},{key:"getMinZ",value:function(e,t){return 100*((t||Math.max(1,Math.floor(.3*e)))-.5*e)/e/3}},{key:"getTaskPoints",value:function(e,t){var r,n=[];if(0===e.length)return[];for(var i=0,o=e[0].x,a=e[0].y,s=[o,a],l=[],c=e[0].t;i0&&i270){var g=null==(r=l.pop())?void 0:r.point.clone();g&&n.push({taskId:c,pos:s,points:[].concat(u(l),[{point:g,radius:v}])}),s=[o=e[i].x,a=e[i].y];var y=h.x-o,_=h.y-a;l=[{point:new ie(y,_,p),radius:v}],c=Date.now()}}i++}return n.push({taskId:c,pos:s,points:l}),n}},{key:"updateTempPointsWithPressure",value:function(e,t,r){for(var n=Date.now(),i=this.tmpPoints.length,o=i,a=0;a1)for(var d=s-1;d>0;){var f=this.tmpPoints[d].distance(this.tmpPoints[d-1]),p=Math.max(this.tmpPoints[d].z-this.uniThickness*f,0);if(this.tmpPoints[d-1].z>=p)break;this.tmpPoints[d-1].setz(p),o=Math.min(o,d-1),d--}}else o=1/0;else{u.setv(h);var v=u.distance(c),m=Math.max(c.z-this.uniThickness*v,0);s>1&&re.Equals(h,c.v,.02)&&(m>0||c.z<=0)&&(r&&c.t&&r.add(c.t),this.tmpPoints.pop(),o=Math.min(l,o)),u.setz(m),this.tmpPoints.push(u)}}else this.tmpPoints.push(u)}if(o===1/0)return this.tmpPoints.length;var g=i;if(o===i){g=Math.max(g-1,0);var y=this.tmpPoints[g].t;y&&(null==r||r.add(y))}else{var _=i-1;for(g=o;_>=0;){var b=this.tmpPoints[_].t;if(b&&(null==r||r.add(b),_<=o)){g=_,_=-1;break}_--}}return this.tmpPoints[g].setT(n),g}},{key:"updateTempPoints",value:function(e,t,r){for(var n,i=Date.now(),o=this.tmpPoints.length,a=o,s=0;s=0;){var m=null==(n=this.tmpPoints[v])?void 0:n.t;if(m&&(null==r||r.add(m),v<=a)){f=v,v=-1;break}v--}}return this.tmpPoints[f].setT(i),f}},{key:"updateTempPointsWithPressureWhenDone",value:function(e){for(var t=this.workOptions.thickness,r=e.length,n=this.getMinZ(t),i=0;i1&&u.z===n)break;if(a.isNear(u,t/2)){if(r<3&&u.z1))for(var h=o-1;h>0;){var d=this.tmpPoints[h].distance(this.tmpPoints[h-1]),f=Math.max(this.tmpPoints[h].z-this.uniThickness*d,-t/4);if(this.tmpPoints[h-1].z>=f)break;this.tmpPoints[h-1].setz(f),h--}}else{a.setv(l);var p=Math.max(u.z-this.uniThickness*c,n);o>1&&re.Equals(l,u.v,.02)&&u.z<=0&&this.tmpPoints.pop(),a.setz(p),this.tmpPoints.push(a)}}else this.tmpPoints.push(a)}}}],[{key:"updateNodeOpt",value:function(e){var t,r,n=e.node,i=e.opt,o=e.vNodes,a=i.strokeColor,s=i.strokeType,u=o.get(n.name);return a&&("GROUP"===n.tagName?nu(n)?n.setAttribute("bgcolor",a):n.children.forEach((function(e){e.setAttribute("strokeColor",a),e.getAttribute("fillColor")&&e.setAttribute("fillColor",a)})):(n.setAttribute("strokeColor",a),n.setAttribute("fillColor",a)),null!=(t=null==u?void 0:u.opt)&&t.strokeColor&&(u.opt.strokeColor=a)),s&&null!=u&&u.opt&&null!=(r=u.opt)&&r.strokeType&&(u.opt.strokeType=s),u&&o.setInfo(n.name,u),xa.updateNodeOpt(e)}}]),r}(xa),ka=function(e){m(n,e);var t,r=y(n);function n(e){var t;return S(this,n),t=r.call(this,e),I(b(t),"toolsType",H.LaserPen),I(b(t),"canRotate",!1),I(b(t),"scaleType",K.none),I(b(t),"syncTimestamp"),I(b(t),"syncIndex",0),I(b(t),"tmpPoints",[]),I(b(t),"workOptions"),I(b(t),"consumeIndex",0),t.workOptions=e.toolsOpt,t.syncTimestamp=0,t}return M(n,[{key:"combineConsume",value:function(){}},{key:"setWorkOptions",value:function(e){d(w(n.prototype),"setWorkOptions",this).call(this,e),this.syncTimestamp=Date.now()}},{key:"consume",value:function(e){var t=e.data,r=e.isSubWorker,n=t.workId,i=t.op;if(0===(null==i?void 0:i.length))return{type:X.None};if(this.updateTempPoints(i||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:X.None};var o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType,l=Xs(this.tmpPoints,s),h=!1,d=this.syncIndex,f=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,0===this.syncTimestamp&&(this.syncTimestamp=Date.now());var p={name:null==n?void 0:n.toString(),opacity:1,lineDash:u===U.Dotted?[1,2*s]:u===U.LongDotted?[s,2*s]:void 0,strokeColor:a,lineCap:"round",lineWidth:s,anchor:[.5,.5]},v=this.getTaskPoints(f);if(v.length){var m=Date.now();m-this.syncTimestamp>this.syncUnitTime&&(h=!0,this.syncTimestamp=m,this.syncIndex=this.tmpPoints.length),r&&this.draw({attrs:p,tasks:v,isDot:!1,layer:this.drawLayer||this.fullLayer})}var g=[];return this.tmpPoints.slice(d).forEach((function(e){g.push(e.x,e.y)})),c({rect:{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]},type:X.DrawWork,dataType:Y.Local,op:h?g:void 0,index:h?2*d:void 0},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t,r=null==(e=this.workId)?void 0:e.toString();if(this.tmpPoints.length-1>this.consumeIndex){var n=this.tmpPoints.slice(this.consumeIndex),i=1===n.length,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(i){var l=this.computDotStroke({point:n[0],radius:s/2});n=l.ps,t=l.rect}else t=Xs(this.tmpPoints,s);var h={name:null==r?void 0:r.toString(),fillColor:i?a:void 0,opacity:1,lineDash:u!==U.Dotted||i?u!==U.LongDotted||i?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:i?void 0:"round",lineWidth:i?0:s,anchor:[.5,.5]},d=this.getTaskPoints(n);d.length&&this.draw({attrs:h,tasks:d,isDot:i,layer:this.drawLayer||this.fullLayer})}var f=[];this.tmpPoints.forEach((function(e){f.push(e.x,e.y)}));var p=Sa(f);return c({rect:t&&{x:t.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:t.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:t.w*this.fullLayer.worldScaling[0],h:t.h*this.fullLayer.worldScaling[1]},type:X.FullWork,dataType:Y.Local,ops:p,index:2*this.syncIndex},this.baseConsumeResult)}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r=e.op,n=e.replaceId,i=e.isFullWork,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(!r.length){var l=Xs(this.tmpPoints,s);return{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]}}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var h,d=this.tmpPoints.slice(c),f=1===d.length;if(f){var p=this.computDotStroke({point:d[0],radius:s/2});d=p.ps,h=p.rect}else h=Xs(this.tmpPoints,s);var v={name:null==(t=this.workId)?void 0:t.toString(),fillColor:f?a:void 0,opacity:1,lineDash:u!==U.Dotted||f?u!==U.LongDotted||f?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:f?void 0:"round",lineWidth:f?0:s,anchor:[.5,.5]},m=this.getTaskPoints(d);if(m.length){var g=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:v,tasks:m,isDot:f,replaceId:n,layer:g})}return{x:h.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:h.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:h.w*this.fullLayer.worldScaling[0],h:h.h*this.fullLayer.worldScaling[1]}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:ie.GetDotStroke(t,r,8),rect:n}}},{key:"updateTempPoints",value:function(e){for(var t=this.tmpPoints.length,r=0;r0&&n270){var f=null==(t=s.pop())?void 0:t.clone();f&&r.push({pos:a,points:[].concat(u(s),[f])}),a=[i=e[n].x,o=e[n].y];var p=l.x-i,v=l.y-o;s=[new ie(p,v)]}}n++}return r.push({pos:a,points:s}),r}},{key:"removeLocal",value:function(){}},{key:"removeService",value:function(e){var t,r=[];return this.fullLayer.getElementsByName(e).forEach((function(n){if(n.name===e){var i=n.getBoundingClientRect();t=Ys(t,{x:i.x,y:i.y,w:i.width,h:i.height}),r.push(n)}})),r.length&&r.forEach((function(e){return e.remove()})),t}}]),n}(xa),Ea=function(e){m(r,e);var t=y(r);function r(e,n){var i;return S(this,r),i=t.call(this,e),I(b(i),"canRotate",!1),I(b(i),"scaleType",K.none),I(b(i),"toolsType",H.Eraser),I(b(i),"serviceWork"),I(b(i),"tmpPoints",[]),I(b(i),"workOptions"),I(b(i),"worldPosition"),I(b(i),"worldScaling"),I(b(i),"eraserRect"),I(b(i),"eraserPolyline"),i.serviceWork=n,i.workOptions=e.toolsOpt,i.worldPosition=i.fullLayer.worldPosition,i.worldScaling=i.fullLayer.worldScaling,i}return M(r,[{key:"combineConsume",value:function(){}},{key:"consumeService",value:function(){}},{key:"setWorkOptions",value:function(e){d(w(r.prototype),"setWorkOptions",this).call(this,e)}},{key:"createEraserRect",value:function(e){var t=e[0]*this.worldScaling[0]+this.worldPosition[0],n=e[1]*this.worldScaling[1]+this.worldPosition[1],i=r.eraserSizes[this.workOptions.thickness],o=i.width,a=i.height;this.eraserRect={x:t-.5*o,y:n-.5*a,w:o,h:a},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h]}},{key:"computRectCenterPoints",value:function(){var e=this.tmpPoints.slice(-2);if(4===this.tmpPoints.length){var t=new re(this.tmpPoints[0],this.tmpPoints[1]),n=new re(this.tmpPoints[2],this.tmpPoints[3]),i=re.Sub(n,t).uni(),o=re.Dist(t,n),a=r.eraserSizes[this.workOptions.thickness],s=a.width,u=a.height,l=Math.min(s,u),c=Math.round(o/l);if(c>1){for(var h=[],d=0;d1?N.polyline(c.map((function(e){return e.XY})),this.eraserPolyline).length&&o.add(s.name):o.add(s.name),t=Ys(t,p))}}}catch(e){a.e(e)}finally{a.f()}return o.forEach((function(e){var t,r=n.fullLayer.getElementsByName(e);n.fullLayer.removeChild(r[0]),null==(t=n.vNodes)||t.delete(e)})),t&&(t.x-=xa.SafeBorderPadding,t.y-=xa.SafeBorderPadding,t.w+=2*xa.SafeBorderPadding,t.h+=2*xa.SafeBorderPadding),t}},{key:"consume",value:function(e){var t=e.data.op;if(!t||0===t.length)return c({type:X.None},this.baseConsumeResult);var r=this.tmpPoints.length;if(r>1&&this.isNear([t[0],t[1]],[this.tmpPoints[r-2],this.tmpPoints[r-1]]))return c({type:X.None},this.baseConsumeResult);r<3?this.tmpPoints.push(t[0],t[1]):this.tmpPoints.splice(2,2,t[0],t[1]);var n,i=this.computRectCenterPoints(),o=new Set;if(!this.vNodes)return c({type:X.None},this.baseConsumeResult);for(var a=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap)),s=0;ss))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var h=-1,d=!0,f=2&r?new Ua:void 0;for(o.set(e,t),o.set(t,e);++h0&&void 0!==arguments[0])||arguments[0],t=Xs(this.tmpPoints);if(0===t.w||0===t.h)return{selectIds:[],intersectRect:void 0,subNodeMap:new Map};var r=this.vNodes.getRectIntersectRange(t,e),n=r.rectRange,i=r.nodeRange;return{selectIds:u(i.keys()),intersectRect:n,subNodeMap:i}}},{key:"updateTempPoints",value:function(e){var t=this.tmpPoints.length,r=e.length;if(r>1){var n=new ie(e[r-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[r-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);2===t?this.tmpPoints.splice(1,1,n):this.tmpPoints.push(n)}}},{key:"drawSelector",value:function(e){var t=this,r=e.drawRect,i=e.subNodeMap,o=e.selectorId,a=e.layer,s=e.isService,u=new C.Group({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:o,name:o,zIndex:9999}),l=[];if(s){var c=new C.Rect({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:n.selectorBorderId});l.push(c)}i.forEach((function(e,n){var o=[e.rect.x+e.rect.w/2-r.x,e.rect.y+e.rect.h/2-r.y],a=new C.Rect({normalize:!0,pos:o,lineWidth:1,strokeColor:i.size>1?t.selectorColor||t.workOptions.strokeColor:void 0,width:e.rect.w,height:e.rect.h,id:"selector-".concat(n),name:"selector-".concat(n)});l.push(a)})),l&&u.append.apply(u,l),(null==a?void 0:a.parent).appendChild(u)}},{key:"draw",value:function(e,t,r){var n,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=r.intersectRect,s=r.subNodeMap;null==(i=null==(n=t.parent)?void 0:n.getElementById(e))||i.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:s,selectorId:e,layer:t,isService:o})}},{key:"getSelecteorInfo",value:function(e){this.scaleType=K.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0,this.thickness=void 0,this.strokeType=void 0,this.useStroke=!1;var t,r,n=new Set,i=!0,o=f(e.values());try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.opt,l=a.canRotate,c=a.scaleType,h=a.toolsType;this.selectorColor=this.workOptions.strokeColor,s.strokeColor&&(this.strokeColor=s.strokeColor),s.fillColor&&(this.fillColor=s.fillColor),s.textOpt&&(this.textOpt=s.textOpt),s.thickness&&(this.thickness=s.thickness),h!==H.Pencil&&(i=!1),s.strokeType&&(this.strokeType=s.strokeType),h===H.SpeechBalloon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=s.placement),h===H.Polygon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices),h===H.Star&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices,this.shapeOpt.innerRatio=s.innerRatio,this.shapeOpt.innerVerticeStep=s.innerVerticeStep),h===H.Text&&(this.textOpt=s),1===e.size&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=l,this.scaleType=c),c===K.none&&(this.scaleType=c),h===H.Image&&(t=a)}}catch(e){o.e(e)}finally{o.f()}i&&(this.useStroke=!0),n.size&&(this.toolsTypes=u(n)),t&&(1===e.size?(this.canLock=!0,t.opt.locked&&(this.isLocked=!0,this.scaleType=K.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1,this.thickness=void 0,this.strokeType=void 0,this.useStroke=void 0)):e.size>1&&!t.opt.locked&&(this.canLock=!1,this.canRotate=!1))}},{key:"getChildrenPoints",value:function(){var e,t;if(this.scaleType===K.both&&1===(null==(e=this.selectIds)?void 0:e.length)){var r=this.selectIds[0],n=null==(t=this.vNodes.get(r))?void 0:t.op;if(n){for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:Ca,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];2===e.length&&function(){var i,o,a=e[0],s=e[1],l=u(t.vNodes.getRectIntersectRange({x:a,y:s,w:0,h:0},!1).nodeRange.values()).sort((function(e,t){return(t.opt.zIndex||0)-(e.opt.zIndex||0)})),c=f(l);try{for(c.s();!(o=c.n()).done;){var h=o.value;if(Hs(t.fullLayer.getElementsByName(h.name)).find((function(e){return e.isPointCollision(a,s)}))){i=h;break}}}catch(e){c.e(e)}finally{c.f()}if(i){var d=i.name;if(!xs(t.oldSelectRect,i.rect)){var p=new Map([[d,i]]);t.getSelecteorInfo(p),t.draw(r,t.fullLayer,{intersectRect:i.rect,subNodeMap:p,selectIds:t.selectIds||[]},n)}t.selectIds=[d],t.oldSelectRect=i.rect}}()}},{key:"unSelectedAllIds",value:function(){var e,t,r=f(this.vNodes.curNodeMap.entries());try{for(r.s();!(t=r.n()).done;){var n=o(t.value,2),i=n[0],a=n[1];a.isSelected&&(e=Ys(e,a.rect),this.vNodes.unSelected(i))}}catch(e){r.e(e)}finally{r.f()}return e}},{key:"unSelectedByIds",value:function(e){var t,r,n=f(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&o.isSelected&&(t=Ys(t,o.rect),this.vNodes.unSelected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"selectedByIds",value:function(e){var t,r,n=f(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&(t=Ys(t,o.rect),this.vNodes.selected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getSelectorRect",value:function(e,t){var r,n,i=null==(r=e.parent)?void 0:r.getElementById(t),o=null==i?void 0:i.getBoundingClientRect();return o&&(n=Ys(n,{x:Math.floor(o.x),y:Math.floor(o.y),w:Math.floor(o.width+1),h:Math.floor(o.height+1)})),n}},{key:"isCanFillColor",value:function(e){return e===H.Ellipse||e===H.Triangle||e===H.Rectangle||e===H.Polygon||e===H.Star||e===H.SpeechBalloon}},{key:"updateSelector",value:(t=s(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,h,d,p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A,C,P,N,O,R,D,L,j,z;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.updateSelectorOpt,i=t.selectIds,o=t.vNodes,a=t.willSerializeData,s=t.worker,u=t.offset,l=this.fullLayer){e.next=3;break}return e.abrupt("return");case 3:if(d=new Map,p=n.originPoint,v=n.workState,m=n.angle,g=n.translate,y=n.dir,_=n.scale,u&&(n.translate=g?[g[0]+u[0],g[1]+u[1]]:u),!(p||g||Ie(m))){e.next=9;break}if(v!==$.Start||!i){e.next=8;break}return e.abrupt("return",(o.setTargetAssignKeys(i),{type:X.Select,dataType:Y.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:b=o.getLastTarget();case 9:if(!i){e.next=60;break}x=f(i),e.prev=11,x.s();case 13:if((w=x.n()).done){e.next=52;break}if(S=w.value,!(T=o.get(S))){e.next=50;break}if(M=T.toolsType,!(k=(null==l?void 0:l.getElementsByName(S))[0])){e.next=50;break}if(E=!1,I=!1,A=c({},n),!M){e.next=50;break}if(A.thickness&&T.opt.thickness&&(E=T.opt.thickness!==A.thickness),A.strokeType&&null!=(r=T.opt)&&r.strokeType&&(I=T.opt.strokeType!==A.strokeType),C=null==b?void 0:b.get(S),null==(P=Gs(M))||P.updateNodeOpt({node:k,opt:A,vNodes:o,willSerializeData:a,targetNode:C}),!(T&&s&&(a&&(A.angle||A.translate)||A.originPoint&&A.scenePoint&&A.scale||A.pointMap&&A.pointMap.has(S)||M===H.Text&&(A.fontSize||A.translate||A.textInfos&&A.textInfos.get(S))||M===H.Image&&(A.angle||A.translate||A.scale)||M===A.toolsType&&A.willRefresh||E||I))){e.next=49;break}if(null==(N=s.createWorkShapeNode({workId:S,toolsType:M,toolsOpt:T.opt}))||N.setWorkId(S),O=void 0,M!==H.Image){e.next=35;break}return e.next=32,N.consumeServiceAsync({isFullWork:!0,replaceId:S,worker:s});case 32:O=e.sent,e.next=48;break;case 35:if(M!==H.Text){e.next=41;break}return e.next=38,N.consumeServiceAsync({isFullWork:!0,replaceId:S});case 38:O=e.sent,e.next=48;break;case 41:e.prev=41,O=null==N?void 0:N.consumeService({op:T.op,isFullWork:!0,replaceId:S}),e.next=48;break;case 45:return e.prev=45,e.t0=e.catch(41),e.abrupt("continue",50);case 48:O&&(T.rect=O);case 49:T&&(d.set(S,T),h=Ys(h,T.rect));case 50:e.next=13;break;case 52:e.next=57;break;case 54:e.prev=54,e.t1=e.catch(11),x.e(e.t1);case 57:return e.prev=57,x.f(),e.finish(57);case 60:if(b&&v===$.Done&&(o.deleteLastTarget(),b=void 0),R=h,!(p&&g&&_&&y&&R)||u){e.next=80;break}D=[[R.x,R.y],[R.x+R.w,R.y],[R.x+R.w,R.y+R.h],[R.x,R.y+R.h]],e.t2=y,e.next="top"===e.t2||"topLeft"===e.t2||"left"===e.t2?67:"topRight"===e.t2?69:"right"===e.t2||"bottomRight"===e.t2||"bottom"===e.t2?71:"bottomLeft"===e.t2?73:75;break;case 67:return L=g[0]>0&&g[1]>0?D[0]:g[0]>0?D[3]:g[1]>0?D[1]:D[2],e.abrupt("break",75);case 69:return L=g[0]<0&&g[1]>0?D[1]:g[0]<0?D[2]:g[1]>0?D[0]:D[3],e.abrupt("break",75);case 71:return L=g[0]<0&&g[1]<0?D[2]:g[0]<0?D[1]:g[1]<0?D[3]:D[0],e.abrupt("break",75);case 73:return L=g[0]>0&&g[1]<0?D[3]:g[0]>0?D[0]:g[1]<0?D[2]:D[1],e.abrupt("break",75);case 75:if(j=L&&[p[0]-L[0],p[1]-L[1]]||[0,0],xs(j,[0,0])){e.next=80;break}return e.next=79,this.updateSelector(c(c({},t),{},{updateSelectorOpt:{},offset:j}));case 79:return e.abrupt("return",e.sent);case 80:return this.getSelecteorInfo(d),this.draw(Ca,l,{selectIds:i||[],subNodeMap:d,intersectRect:R}),z=Ys(this.oldSelectRect,R),e.abrupt("return",(this.oldSelectRect=R,{type:X.Select,dataType:Y.Local,selectRect:R,renderRect:h,rect:Ys(z,R),selectIds:i}));case 83:case"end":return e.stop()}}),e,this,[[11,54,57,60],[41,45]])}))),function(e){return t.apply(this,arguments)})},{key:"blurSelector",value:function(){var e=this.unSelectedAllIds();return{type:X.Select,dataType:Y.Local,rect:e,selectIds:[],willSyncService:!0}}},{key:"getRightServiceId",value:function(e){return e.replace(Aa,"-")}},{key:"selectServiceNode",value:function(e,t,r){var n,i=this,o=t.selectIds,a=this.getRightServiceId(e),s=this.getSelectorRect(this.fullLayer,a),u=new Map;return null==o||o.forEach((function(e){var t=i.vNodes.get(e);t&&(n=Ys(n,t.rect),u.set(e,t))})),this.getSelecteorInfo(u),this.draw(a,this.fullLayer,{intersectRect:n,selectIds:o||[],subNodeMap:u},r),Ys(n,s)}},{key:"reRenderSelector",value:function(){var e,t,r=this,n=new Map;return null==(e=this.selectIds)||e.forEach((function(e){var i=r.vNodes.get(e);i&&(t=Ys(t,i.rect),n.set(e,i))}),this),this.getSelecteorInfo(n),this.draw(Ca,this.fullLayer,{intersectRect:t,subNodeMap:n,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t}},{key:"updateSelectIds",value:function(e){var t,r,n=null==(t=this.selectIds)?void 0:t.filter((function(t){return!e.includes(t)}));(null!=n&&n.length&&(r=this.unSelectedByIds(n)),e.length)&&(r=Ys(r,this.selectedByIds(e)));return this.selectIds=e,{bgRect:r,selectRect:this.reRenderSelector()}}},{key:"cursorHover",value:function(e){var t,r,n=this.oldSelectRect;this.selectIds=[];var i=null==(t=this.workId)?void 0:t.toString(),o=[e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];return this.selectSingleTool(o,i,!0),this.oldSelectRect&&!xs(n,this.oldSelectRect)?{type:X.CursorHover,dataType:Y.Local,rect:Ys(n,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1}:(null!=(r=this.selectIds)&&r.length||(this.oldSelectRect=void 0),n&&!this.oldSelectRect?(this.cursorBlur(),{type:X.CursorHover,dataType:Y.Local,rect:n,selectorColor:this.selectorColor,willSyncService:!1}):void 0)}},{key:"cursorBlur",value:function(){var e,t;this.selectIds=[];var r=null==(e=this.workId)?void 0:e.toString();(null==(t=this.fullLayer)?void 0:t.parent).children.forEach((function(e){e.name===r&&e.remove()}))}}]),n}(xa);I(ws,"selectorBorderId","selector-border");var Ss=ws,Ts=function(e){m(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),I(b(n),"canRotate",!1),I(b(n),"scaleType",K.both),I(b(n),"toolsType",H.Arrow),I(b(n),"tmpPoints",[]),I(b(n),"workOptions"),I(b(n),"oldRect"),I(b(n),"arrowTipWidth"),I(b(n),"syncTimestamp"),n.workOptions=e.toolsOpt,n.arrowTipWidth=4*n.workOptions.thickness,n.syncTimestamp=0,n.syncUnitTime=50,n}return M(r,[{key:"consume",value:function(e){var t,r,n=e.data,i=e.isFullWork,o=e.isSubWorker,a=e.isMainThread,s=this.workId,l=n.op,h=null==l?void 0:l.length;if(!h||h<2)return{type:X.None};if(0===this.tmpPoints.length?(this.tmpPoints=[new ie(l[0],l[1])],t=!1):t=this.updateTempPoints(l),!t)return{type:X.None};if(o||a){var d=i?this.fullLayer:this.drawLayer||this.fullLayer;r=this.draw({workId:s,layer:d})}if(!o){var f=Date.now();return f-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=f,c(c({},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0})):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c(c({rect:p},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local})}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:xa.getCenterPos(n,r)}),c(c({rect:n},this.baseConsumeResult),{},{type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0})}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=n.strokeType,h=n.eraserlines,d=r.worldPosition,f=r.worldScaling,p=this.computDrawPoints(o),v=p.points,m=p.pos,g=p.rect,y=p.isTriangle,_=p.trianglePoints,b=p.trianglePos,x=[g.x+g.w/2,g.y+g.h/2],w={pos:x,name:t,id:t,zIndex:a,anchor:[.5,.5],size:[g.w,g.h]};s&&(w.scale=s),u&&(w.rotate=u),l&&(w.translate=l);var S=new C.Group(w),T={points:_,pos:[b[0]-x[0],b[1]-x[1]],fillColor:i,strokeColor:i,lineWidth:0,normalize:!1},M=new C.Polyline(T);if(S.append(M),!y&&v&&m){var k={points:v,pos:[m[0]-x[0],m[1]-x[1]],fillColor:i,strokeColor:i,lineDash:c!==U.Dotted||y?c!==U.LongDotted||y?void 0:[o,2*o]:[1,2*o],lineCap:c===U.Normal?void 0:"round",lineWidth:o,normalize:!1},E=new C.Polyline(k);S.append(E)}if(h&&this.drawEraserlines({group:S,eraserlines:h,pos:x,layer:r}),this.replace(r,t,S),s||u||l){var I=S.getBoundingClientRect();return{x:Math.floor(I.x-xa.SafeBorderPadding),y:Math.floor(I.y-xa.SafeBorderPadding),w:Math.floor(I.width+2*xa.SafeBorderPadding),h:Math.floor(I.height+2*xa.SafeBorderPadding)}}return{x:Math.floor(g.x*f[0]+d[0]-xa.SafeBorderPadding),y:Math.floor(g.y*f[1]+d[1]-xa.SafeBorderPadding),w:Math.floor(g.w*f[0]+2*xa.SafeBorderPadding),h:Math.floor(g.h*f[1]+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(e):this.computTrianglePoints()}},{key:"computFullArrowPoints",value:function(e){var t=this,r=re.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=re.Per(r).mul(e/2),i=ie.Sub(this.tmpPoints[0],n),o=ie.Add(this.tmpPoints[0],n),a=re.Mul(r,this.arrowTipWidth),s=re.Sub(this.tmpPoints[1],a),u=ie.Sub(s,n),l=ie.Add(s,n),c=re.Per(r).mul(1.5*e),h=ie.Sub(s,c),d=ie.Add(s,c),f=[this.tmpPoints[0],s],p=[h,this.tmpPoints[1],d],v=[i,o].concat(p,[u,l]);return{trianglePoints:p.map((function(e){return ie.Sub(e,t.tmpPoints[1]).XY})).flat(1),trianglePos:this.tmpPoints[1].XY,points:f.map((function(e){return ie.Sub(e,t.tmpPoints[0]).XY})).flat(1),rect:Xs(v),isTriangle:!1,pos:this.tmpPoints[0].XY}}},{key:"computTrianglePoints",value:function(){var e=this,t=re.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=re.Per(t).mul(Math.floor(3*r/8)),i=ie.Sub(this.tmpPoints[0],n),o=ie.Add(this.tmpPoints[0],n),a=[i,this.tmpPoints[1],o];return{trianglePoints:a.map((function(t){return ie.Sub(t,e.tmpPoints[1]).XY})).flat(1),trianglePos:this.tmpPoints[1].XY,rect:Xs(a),isTriangle:!0}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=f,c(c({type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0})):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&xa.getCenterPos(n,r)}),c(c({rect:n,type:X.FullWork,dataType:Y.Local},this.baseConsumeResult),{},{ops:o,isSync:!0})}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.scale,h=i.rotate,d=i.translate,f=i.strokeType,p=i.eraserlines,v=r.worldScaling,m=this.computDrawPoints(s),g=m.radius,y=m.rect,_=m.pos,b={pos:_,name:t,id:t,radius:g,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:f===U.Dotted?[1,2*s]:f===U.LongDotted?[s,2*s]:void 0},x={name:t,id:t,zIndex:u,pos:_,anchor:[.5,.5],size:[y.w,y.h]};l&&(x.scale=l),h&&(x.rotate=h),d&&(x.translate=d);var w=new C.Group(x);if(n){var S=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/v[0],1/v[1]]});w.append(S)}var T=new C.Ellipse(c(c({},b),{},{pos:[0,0]}));w.append(T),p&&this.drawEraserlines({group:w,eraserlines:p,pos:_,layer:r}),this.replace(r,t,w);var M=w.getBoundingClientRect();return{x:Math.floor(M.x-xa.SafeBorderPadding),y:Math.floor(M.y-xa.SafeBorderPadding),w:Math.floor(M.width+2*xa.SafeBorderPadding),h:Math.floor(M.height+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){var t=Xs(this.tmpPoints);return{rect:Xs(this.tmpPoints,e),pos:[Math.floor(t.x+t.w/2),Math.floor(t.y+t.h/2)],radius:[Math.floor(t.w/2),Math.floor(t.h/2)]}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:h.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(l,this.oldRect);return this.oldRect=l,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,i=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var o=r.flat(1),a=Sa(o);return null==(e=this.vNodes)||e.setInfo(t,{rect:i,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&xa.getCenterPos(i,n)}),c({rect:i,type:X.FullWork,dataType:Y.Local,ops:a,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=e.ps,o=e.replaceId,a=this.workOptions,s=a.strokeColor,u=a.fillColor,l=a.thickness,h=a.zIndex,d=a.scale,f=a.rotate,p=a.translate,v=a.strokeType,m=a.eraserlines,g=r.worldPosition,y=r.worldScaling,_=this.computDrawPoints(i),b=_.points,x=_.rect,w=_.pos,S={close:!0,normalize:!0,points:b,lineWidth:l,fillColor:"transparent"!==u&&u||void 0,strokeColor:s,lineJoin:"round",lineCap:"round",lineDash:v===U.Dotted?[1,2*l]:v===U.LongDotted?[l,2*l]:void 0},T={x:Math.floor(x.x*y[0]+g[0]-xa.SafeBorderPadding),y:Math.floor(x.y*y[1]+g[1]-xa.SafeBorderPadding),w:Math.floor(x.w*y[0]+2*xa.SafeBorderPadding),h:Math.floor(x.h*y[0]+2*xa.SafeBorderPadding)},M=new C.Group({name:t,id:t,zIndex:h,pos:w,anchor:[.5,.5],size:[x.w,x.h],scale:d,rotate:f,translate:p}),k=new C.Polyline(c(c({},S),{},{pos:[0,0]}));if(M.appendChild(k),n){var E=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/y[0],1/y[1]]});M.appendChild(E)}if(m&&this.drawEraserlines({group:M,eraserlines:m,pos:w,layer:r}),this.replace(r,o||t,M),d||f||p){var I=M.getBoundingClientRect();return{x:Math.floor(I.x-xa.SafeBorderPadding),y:Math.floor(I.y-xa.SafeBorderPadding),w:Math.floor(I.width+2*xa.SafeBorderPadding),h:Math.floor(I.height+2*xa.SafeBorderPadding)}}return T}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId,a=null==(t=this.workId)?void 0:t.toString();if(a){for(var s=[],u=0;uthis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,h=i.innerVerticeStep,d=i.innerRatio,f=i.scale,p=i.rotate,v=i.translate,m=i.strokeType,g=i.eraserlines,y=r.worldScaling,_=this.computDrawPoints(s,l,h,d),b=_.rect,x=_.pos,w={close:!0,points:_.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:m===U.Dotted?[1,2*s]:m===U.LongDotted?[s,2*s]:void 0},S={name:t,id:t,zIndex:u,pos:x,anchor:[.5,.5],size:[b.w,b.h]};f&&(S.scale=f),p&&(S.rotate=p),v&&(S.translate=v);var T=new C.Group(S);if(n){var M=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/y[0],1/y[1]]});T.append(M)}var k=new C.Polyline(c(c({},w),{},{pos:[0,0]}));T.append(k),g&&this.drawEraserlines({group:T,eraserlines:g,pos:x,layer:r}),this.replace(r,t,T);var E=T.getBoundingClientRect();return{x:Math.floor(E.x-xa.SafeBorderPadding),y:Math.floor(E.y-xa.SafeBorderPadding),w:Math.floor(E.width+2*xa.SafeBorderPadding),h:Math.floor(E.height+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t,r,n){for(var i=Xs(this.tmpPoints),o=[Math.floor(i.x+i.w/2),Math.floor(i.y+i.h/2)],a=ru(i.w,i.h),s=Math.floor(Math.min(i.w,i.h)/2),u=n*s,l=[],c=2*Math.PI/t,h=0;hthis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,h=i.scale,d=i.rotate,f=i.translate,p=i.strokeType,v=i.eraserlines,m=r.worldScaling,g=this.computDrawPoints(s,l),y=g.rect,_=g.pos,b={close:!0,points:g.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:p===U.Dotted?[1,2*s]:p===U.LongDotted?[s,2*s]:void 0},x={name:t,id:t,zIndex:u,pos:_,anchor:[.5,.5],size:[y.w,y.h]};h&&(x.scale=h),d&&(x.rotate=d),f&&(x.translate=f);var w=new C.Group(x);if(n){var S=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/m[0],1/m[1]]});w.append(S)}var T=new C.Polyline(c(c({},b),{},{pos:[0,0]}));w.append(T),v&&this.drawEraserlines({group:w,eraserlines:v,pos:_,layer:r}),this.replace(r,t,w);var M=w.getBoundingClientRect();return{x:Math.floor(M.x-xa.SafeBorderPadding),y:Math.floor(M.y-xa.SafeBorderPadding),w:Math.floor(M.width+2*xa.SafeBorderPadding),h:Math.floor(M.height+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t){for(var r=Xs(this.tmpPoints),n=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)],i=ru(r.w,r.h),o=Math.floor(Math.min(r.w,r.h)/2),a=[],s=2*Math.PI/t,u=0;u0&&void 0!==arguments[0]?arguments[0]:10,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=null,s=[];i||o?i&&!o?a=e.twoBezier:i&&o&&(a=e.threeBezier):a=e.oneBezier;for(var u=0;uthis.syncUnitTime?(this.syncTimestamp=p,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var v=Ys(l,this.oldRect);return this.oldRect=l,c({rect:v,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.fillColor,a=n.thickness,s=n.zIndex,u=n.placement,l=n.scale,h=n.rotate,d=n.translate,f=n.strokeType,p=n.eraserlines,v=this.computDrawPoints(a,u),m=v.rect,g=v.pos,y={points:v.points.map((function(e){return e.XY})),lineWidth:a,fillColor:"transparent"!==o&&o||void 0,strokeColor:i,normalize:!0,className:"".concat(g[0],",").concat(g[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:f===U.Dotted?[1,2*a]:f===U.LongDotted?[a,2*a]:void 0},_={name:t,id:t,zIndex:s,pos:g,anchor:[.5,.5],size:[m.w,m.h]};l&&(_.scale=l),h&&(_.rotate=h),d&&(_.translate=d);var b=new C.Group(_),x=new C.Polyline(c(c({},y),{},{pos:[0,0]}));b.append(x),p&&this.drawEraserlines({group:b,eraserlines:p,pos:g,layer:r}),this.replace(r,t,b);var w=b.getBoundingClientRect();return{x:Math.floor(w.x-xa.SafeBorderPadding),y:Math.floor(w.y-xa.SafeBorderPadding),w:Math.floor(w.width+2*xa.SafeBorderPadding),h:Math.floor(w.height+2*xa.SafeBorderPadding)}}},{key:"transformControlPoints",value:function(e){var t=Xs(this.tmpPoints);switch(e){case"bottom":case"bottomLeft":case"bottomRight":var r=t.y+t.h*this.ratio;return[new re(t.x,t.y,0),new re(t.x+t.w,t.y,0),new re(t.x+t.w,r,0),new re(t.x,r,0)];case"top":case"topLeft":case"topRight":var n=t.y+t.h*(1-this.ratio);return[new re(t.x,n,0),new re(t.x+t.w,n,0),new re(t.x+t.w,t.y+t.h,0),new re(t.x,t.y+t.h,0)];case"left":case"leftBottom":case"leftTop":var i=t.x+t.w*(1-this.ratio);return[new re(i,t.y,0),new re(t.x+t.w,t.y,0),new re(t.x+t.w,t.y+t.h,0),new re(i,t.y+t.h,0)];case"right":case"rightBottom":case"rightTop":var o=t.x+t.w*this.ratio;return[new re(t.x,t.y,0),new re(o,t.y,0),new re(o,t.y+t.h,0),new re(t.x,t.y+t.h,0)]}}},{key:"computDrawPoints",value:function(e,t){var r=Xs(this.tmpPoints),n=this.transformControlPoints(t),i=Math.floor(.1*r.w),o=Math.floor(.1*r.h),a=[],s=re.Add(n[0],new re(0,o,0)),l=re.Add(n[0],new re(i,0,0)),c=As.getBezierPoints(10,s,n[0],l),h=re.Sub(n[1],new re(i,0,0)),d=re.Add(n[1],new re(0,o,0)),f=As.getBezierPoints(10,h,n[1],d),p=re.Sub(n[2],new re(0,o,0)),v=re.Sub(n[2],new re(i,0,0)),m=As.getBezierPoints(10,p,n[2],v),g=re.Add(n[3],new re(i,0,0)),y=re.Sub(n[3],new re(0,o,0)),_=As.getBezierPoints(10,g,n[3],y),b=i*(1-this.ratio)*10,x=o*(1-this.ratio)*10;switch(t){case"bottom":var w=re.Sub(n[2],new re(5*i-b/2,0,0)),S=re.Sub(n[2],new re(5*i,-x,0)),T=re.Sub(n[2],new re(5*i+b/2,0,0));a.push.apply(a,[S,T].concat(u(_),u(c),u(f),u(m),[w]));break;case"bottomRight":var M=re.Sub(n[2],new re(1.1*i,0,0)),k=re.Sub(n[2],new re(1.1*i+b/2,-x,0)),E=re.Sub(n[2],new re(1.1*i+b,0,0));a.push.apply(a,[k,E].concat(u(_),u(c),u(f),u(m),[M]));break;case"bottomLeft":var I=re.Add(n[3],new re(1.1*i+b,0,0)),A=re.Add(n[3],new re(1.1*i+b/2,x,0)),C=re.Add(n[3],new re(1.1*i,0,0));a.push.apply(a,[A,C].concat(u(_),u(c),u(f),u(m),[I]));break;case"top":var P=re.Sub(n[1],new re(5*i-b/2,0,0)),N=re.Sub(n[1],new re(5*i,x,0)),O=re.Sub(n[1],new re(5*i+b/2,0,0));a.push.apply(a,[N,P].concat(u(f),u(m),u(_),u(c),[O]));break;case"topRight":var R=re.Sub(n[1],new re(1.1*i,0,0)),D=re.Sub(n[1],new re(1.1*i+b/2,x,0)),L=re.Sub(n[1],new re(1.1*i+b,0,0));a.push.apply(a,[D,R].concat(u(f),u(m),u(_),u(c),[L]));break;case"topLeft":var j=re.Add(n[0],new re(1.1*i+b,0,0)),z=re.Add(n[0],new re(1.1*i+b/2,-x,0)),B=re.Add(n[0],new re(1.1*i,0,0));a.push.apply(a,[z,j].concat(u(f),u(m),u(_),u(c),[B]));break;case"left":var U=re.Add(n[0],new re(0,5*o-x/2,0)),F=re.Add(n[0],new re(-b,5*o,0)),W=re.Add(n[0],new re(0,5*o+x/2,0));a.push.apply(a,[F,U].concat(u(c),u(f),u(m),u(_),[W]));break;case"leftTop":var G=re.Add(n[0],new re(0,1.1*o,0)),V=re.Add(n[0],new re(-b,1.1*o+x/2,0)),H=re.Add(n[0],new re(0,1.1*o+x,0));a.push.apply(a,[V,G].concat(u(c),u(f),u(m),u(_),[H]));break;case"leftBottom":var Y=re.Sub(n[3],new re(0,1.1*o+x,0)),$=re.Sub(n[3],new re(b,1.1*o+x/2,0)),X=re.Sub(n[3],new re(0,1.1*o,0));a.push.apply(a,[$,Y].concat(u(c),u(f),u(m),u(_),[X]));break;case"right":var q=re.Add(n[1],new re(0,5*o-x/2,0)),Q=re.Add(n[1],new re(b,5*o,0)),Z=re.Add(n[1],new re(0,5*o+x/2,0));a.push.apply(a,[Q,Z].concat(u(m),u(_),u(c),u(f),[q]));break;case"rightTop":var K=re.Add(n[1],new re(0,1.1*o,0)),J=re.Add(n[1],new re(b,1.1*o+x/2,0)),ee=re.Add(n[1],new re(0,1.1*o+x,0));a.push.apply(a,[J,ee].concat(u(m),u(_),u(c),u(f),[K]));break;case"rightBottom":var te=re.Sub(n[2],new re(0,1.1*o+x,0)),ne=re.Sub(n[2],new re(-b,1.1*o+x/2,0)),ie=re.Sub(n[2],new re(0,1.1*o,0));a.push.apply(a,[ne,ie].concat(u(m),u(_),u(c),u(f),[te]))}var oe=Xs(this.tmpPoints,e);return{rect:oe,pos:[Math.floor(oe.x+oe.w/2),Math.floor(oe.y+oe.h/2)],points:a}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i)||ie.Sub(n,r).XY.includes(0))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a0?K.proportional:K.all}},{key:"updateNodeOpt",value:function(e){var t=e.node,r=e.opt,i=e.vNodes,o=e.targetNode,a=r.translate,s=r.originPoint,u=r.scenePoint,l=r.scale,c=r.angle,h=r.isLocked,d=r.zIndex,f=o&&pa(o)||i.get(t.name);if(f){var p=t.parent;if(p){if(Ie(d)&&(t.setAttribute("zIndex",d),f.opt.zIndex=d),Rs(h)&&(f.opt.locked=h),s&&u&&l&&a){var v=f.opt,m=v.centerX,g=v.centerY,y=v.width,_=v.height,b=!1!==v.uniformScale?[l[0],l[0]]:l,x=[m,g],w=[m,g];Js(w,u,b,a);var S=[w[0]-x[0],w[1]-x[1]];if(f.centerPos=[f.centerPos[0]+S[0],f.centerPos[1]+S[1]],f.opt.width=Math.round(y*b[0]),f.opt.height=Math.round(_*b[1]),f.opt.centerX=w[0],f.opt.centerY=w[1],f.opt.eraserlines)for(var T=0,M=Object.values(f.opt.eraserlines);Tthis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=n.strokeType,h=n.eraserlines,d=r.worldPosition,f=r.worldScaling,p=this.computDrawPoints(o,c),v=p.d,m=p.rect,g=p.isDot,y=[m.x+m.w/2,m.y+m.h/2],_=new C.Group({pos:y,anchor:[.5,.5],size:[m.w,m.h],name:t,id:t,normalize:!0,zIndex:a}),b={pos:[0,0],normalize:!0,d:v,fillColor:i,strokeColor:i,lineDash:c!==U.Dotted||g?c!==U.LongDotted||g?void 0:[o,2*o]:[1,2*o],lineCap:c===U.Normal||g?void 0:"round",lineWidth:c===U.Normal||g?0:o};s&&(b.scale=s),u&&(b.rotate=u),l&&(b.translate=l);var x=new C.Path(b);if(_.append(x),h&&this.drawEraserlines({group:_,eraserlines:h,pos:y,layer:r}),this.replace(r,t,_),u||s||l){var w=x.getBoundingClientRect();return{x:Math.floor(w.x-xa.SafeBorderPadding),y:Math.floor(w.y-xa.SafeBorderPadding),w:Math.floor(w.width+2*xa.SafeBorderPadding),h:Math.floor(w.height+2*xa.SafeBorderPadding)}}return{x:Math.floor(m.x*f[0]+d[0]-xa.SafeBorderPadding),y:Math.floor(m.y*f[1]+d[1]-xa.SafeBorderPadding),w:Math.floor(m.w*f[0]+2*xa.SafeBorderPadding),h:Math.floor(m.h*f[1]+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(e,t):this.computDotPoints(e)}},{key:"computFullPoints",value:function(e,t){var r=re.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=re.Per(r).mul(e/2),i=ie.Sub(this.tmpPoints[0],n),o=ie.Add(this.tmpPoints[0],n),a=ie.Sub(this.tmpPoints[1],n),s=ie.Add(this.tmpPoints[1],n),l=ie.GetSemicircleStroke(this.tmpPoints[1],a,-1,8),c=ie.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),h=[i,a].concat(u(l),[s,o],u(c));return{d:t!==U.Normal?_a(this.tmpPoints,!1):_a(h,!0),rect:Xs(h),isDot:!1,pos:this.tmpPoints[0].XY}}},{key:"computDotPoints",value:function(e){var t=ie.GetDotStroke(this.tmpPoints[0],e/2,8);return{d:_a(t,!0),rect:Xs(t),isDot:!0,pos:this.tmpPoints[0].XY}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a"u"&&this.workOptions.workState===$.Done||l});case 8:return h=e.sent,e.abrupt("return",(null==(o=this.vNodes)||o.setInfo(a,{rect:h,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:h&&xa.getCenterPos(h,c)}),h));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updataOptService",value:function(){}},{key:"updataOptServiceAsync",value:(r=s(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.workId){e.next=2;break}return e.abrupt("return");case 2:if(o=this.workId.toString(),a=t.fontColor,s=t.fontBgColor,u=t.bold,l=t.italic,c=t.lineThrough,h=t.underline,d=t.zIndex,f=null==(n=this.vNodes)?void 0:n.get(o)){e.next=5;break}return e.abrupt("return");case 5:return a&&(f.opt.fontColor=a),s&&(f.opt.fontBgColor=s),u&&(f.opt.bold=u),l&&(f.opt.italic=l),Rs(c)&&(f.opt.lineThrough=c),Rs(h)&&(f.opt.underline=h),Ie(d)&&(f.opt.zIndex=d),this.oldRect=f.rect,e.next=8,this.draw({workId:o,layer:this.fullLayer,isDrawLabel:k(r)>"u"&&this.workOptions.workState===$.Done||r});case 8:return p=e.sent,e.abrupt("return",(null==(i=this.vNodes)||i.setInfo(o,{rect:p,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:p&&xa.getCenterPos(p,this.fullLayer)}),p));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0}}],[{key:"getSafetySnippetRatio",value:function(e){var t=(null==e?void 0:e.parent).displayRatio||1,r=Math.ceil(10*e.worldScaling[0])/10,n=r;return r>=.2&&r<1?n=r*t:r<=2&&r>=1?n=r*t*1.6:r>2&&r<=3?n=r*t*1.4:r>3&&r<=4?n=r*t*.8:r>4&&(n=r*t*.6),Math.floor(1e3*n)/1e3}},{key:"getSafetySnippetFontLength",value:function(e){return Math.floor(3*a.textImageSnippetSize/4/e)||1}},{key:"createLabels",value:(t=s(regeneratorRuntime.mark((function e(t,r,n){var i,o,s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A,P,N,O,R,D,L,j,z,B,U,F,W,G,V,H,Y,$,X,q,Q,Z,K,J,ee,te,re,ne;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],s=n.x,u=n.y,l=null==(i=r.parent)?void 0:i.parent,c=l.width,h=l.height,d=wa(t.text),f=d.length,p=t.fontSize,v=t.lineHeight,m=t.bold,g=t.textAlign,y=t.italic,_=t.fontFamily,b=t.verticalAlign,x=t.fontColor,w=t.fontBgColor,S=t.underline,T=t.lineThrough,M=a.getSafetySnippetRatio(r)||1,k=Math.floor(p*M),E=a.getSafetySnippetFontLength(k),I=0,A=0;case 3:if(!(A=c||(L[1]+R[1]+q)*r.worldScaling[1]+u<=0||(L[1]+R[1])*r.worldScaling[1]+u>=h)&&(G.disconnect(),H=!1),H&&B.push(G))),U+=E;case 25:e.next=14;break;case 27:D[0]=z,"italic"===y&&(D[0]=D[0]+j*p),I=Math.max(I,D[0]),Q=!0,((R[0]+D[0])*r.worldScaling[0]+s<=0||R[0]*r.worldScaling[0]+s>=c||(R[1]+D[1])*r.worldScaling[0]+u<=0||R[1]*r.worldScaling[1]+u>=h)&&(Q=!1),Q&&(S&&(Z=Math.floor(p/10),K={normalize:!1,pos:[0,1.1*p+Z/2],lineWidth:Z,points:[0,0,Math.ceil(D[0]),0],strokeColor:x,className:"underline"},J=new C.Polyline(K),B.push(J)),T&&(ee={normalize:!1,pos:[0,1.2*p/2],lineWidth:Math.floor(p/10),points:[0,0,Math.ceil(D[0]),0],strokeColor:x,className:"lineThrough"},te=new C.Polyline(ee),B.push(te)),re={pos:R,anchor:[0,0],size:D,bgcolor:w},(ne=new C.Group(re)).append.apply(ne,B),o.push(ne));case 30:A++,e.next=3;break;case 33:return e.abrupt("return",{labels:o,maxWidth:I});case 34:case"end":return e.stop()}}),e)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"updateNodeOpt",value:function(e){var t=e.node,r=e.opt,n=e.vNodes,i=e.targetNode,o=r.fontBgColor,a=r.fontColor,s=r.translate,u=r.originPoint,l=r.scenePoint,c=r.scale,h=r.bold,d=r.italic,f=r.lineThrough,p=r.underline,v=r.fontSize,m=r.textInfos,g=r.zIndex,y=i&&pa(i)||n.get(t.name);if(y&&t.parent){var _=y.opt;if(Ie(g)&&(t.setAttribute("zIndex",g),y.opt.zIndex=g),a&&_.fontColor&&(_.fontColor=a,t.children.forEach((function(e){"GROUP"===e.tagName&&e.children.forEach((function(e){"LABEL"===e.tagName?(e.setAttribute("fillColor",a),e.setAttribute("strokeColor",a)):"POLYLINE"===e.tagName&&e.setAttribute("strokeColor",a)}))}))),o&&_.fontBgColor&&(_.fontBgColor=o,t.children.forEach((function(e){"GROUP"===e.tagName&&e.setAttribute("bgcolor",o)}))),h&&(_.bold=h),d&&(_.italic=d),Rs(f)&&(_.lineThrough=f),Rs(p)&&(_.underline=p),v&&(_.fontSize=v),u&&l&&c&&i&&_.boxPoint){var b=null==m?void 0:m.get(t.name);if(b){var x=b.fontSize,w=b.boxSize;_.boxSize=w||_.boxSize,_.fontSize=x||_.fontSize}var S=[_.boxPoint[0],_.boxPoint[1]];Js(_.boxPoint,l,c,s);var T=[y.op[0],y.op[1]],M=[T[0]-S[0],T[1]-S[1]];if(y.centerPos=[y.centerPos[0]+M[0],y.centerPos[1]+M[1]],y.opt.eraserlines)for(var k=0,E=Object.values(y.opt.eraserlines);k1){for(var h=[],d=0;d-1){var a=[],s=i.slice(0,o+1);if(re.Equals(i[o],t[0])||s.push(t[0].clone().setz(i[o].z)),s.length>1&&a.push(s),o+t.length-11&&a.push(l)}return{v:(r.splice.apply(r,[n,1].concat(a)),r)}}},i=0;i0&&t.isSamePoint(e,n[r-1]))})),o=[],a=0;a1){var x=N.polyline(g.map((function(e){return e.XY})),this.eraserPolyline);if(x.length&&(a.add(h.name),!v))for(var w=this.translateIntersect(x),S=this.cutPolyline(w,g),T=function(e){var t="".concat(c,"_s_").concat(e),r=[];S[e].forEach((function(e){r.push((e.x-n.worldPosition[0])/n.worldScaling[0],(e.y-n.worldPosition[1])/n.worldScaling[1],e.z)})),h.opt&&h.toolsType&&n.vNodes&&(n.vNodes.setInfo(t,{rect:b,op:r,opt:h.opt,canRotate:h.canRotate,scaleType:h.scaleType,toolsType:h.toolsType}),s.set(t,{workId:t,op:r,opt:h.opt,toolsType:h.toolsType}))},M=0;M1&&this.isNear([t[0],t[1]],[this.tmpPoints[r-2],this.tmpPoints[r-1]]))return c({type:X.None},this.baseConsumeResult);r<3?this.tmpPoints.push(t[0],t[1]):this.tmpPoints.splice(2,2,t[0],t[1]);var n,i=this.computRectCenterPoints(),o=new Set,a=new Map;if(!this.vNodes)return c({type:X.None},this.baseConsumeResult);this.vNodes.setTarget();for(var s=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.getLastTarget())),l=0;l0){var o=this.tmpPoints[this.tmpPoints.length-1],a=re.Sub(i,o).uni();i.setv(a)}this.tmpPoints.push(i)}if(!(this.tmpPoints.length<2)){var s=2*this.tmpPoints[0].z,u=r?this.fullLayer:this.drawLayer||this.fullLayer;return this.draw({consumePoints:this.tmpPoints,layer:u,thickness:s})}}},{key:"updateTempPoints",value:function(e,t){for(var r=this.tmpPoints.length-1,n=Date.now(),i=0;i270)&&(i[++a]=[c.XY])}}1===this.tmpPoints.length&&0===i.length&&i.push([this.tmpPoints[0].XY,this.tmpPoints[0].XY]);var d,p=new Map,v=f(n.entries());try{for(v.s();!(d=v.n()).done;){var m,g=o(d.value,2),y=g[0],_=g[1],b=Qs(_.rect,[-t[0],-t[1]]),x=[(b={x:b.x/this.worldScaling[0],y:b.y/this.worldScaling[1],w:b.w/this.worldScaling[0],h:b.h/this.worldScaling[1]}).x,b.y,b.x+b.w,b.y+b.h],w=[],S=[],T=f(i);try{for(T.s();!(m=T.n()).done;){var M=m.value;N.polyline(M,x,w)}}catch(e){T.e(e)}finally{T.f()}if(w.length&&_.opt){var k,E=f(w);try{for(E.s();!(k=E.n()).done;){for(var I=k.value,A=[],C=0;Cthis.syncUnitTime&&(p=!0,this.syncTimestamp=v[0].t,this.syncIndex=this.tmpPoints.length);var g=[];return this.tmpPoints.slice(f).forEach((function(e){g.push(e.x,e.y,s/2)})),c(c({},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local,rect:m,op:p?g:void 0,index:p?3*f:void 0,updateNodeOpt:{useAnimation:!0}})}},{key:"draw",value:function(e){var t=e.consumePoints,r=e.layer,n=e.thickness,i=this.workId,o=r.getElementsByName(this.workId)[0],a=Xs(t,n),s=[{op:[t.map((function(e){return[e.x,e.y]})).flat(1)],thickness:n}];return o||(o=new C.Group({normalize:!0,name:i,pos:[0,0],anchor:[.5,.5],bgcolor:"rgba(0,0,0,0.3)",zIndex:9999}),r.appendChild(o)),this.drawEraserlines({group:o,eraserlines:s,pos:[0,0],layer:r,isClear:!0}),a={x:Math.floor(a.x*this.worldScaling[0]+this.worldPosition[0]-xa.SafeBorderPadding),y:Math.floor(a.y*this.worldScaling[1]+this.worldPosition[1]-xa.SafeBorderPadding),w:Math.floor(a.w*this.worldScaling[0]+2*xa.SafeBorderPadding),h:Math.floor(a.h*this.worldScaling[1]+2*xa.SafeBorderPadding)}}},{key:"consumeAll",value:function(){var e,t=this.fullLayer.getElementsByName(this.workId);if(t.length&&(e=xa.getRectFromLayer(this.fullLayer,this.workId)),t.forEach((function(e){e.remove(),e.disconnect()})),!this.tmpPoints.length)return c({type:X.None},this.baseConsumeResult);var r=this.workOptions.thickness,i=n.eraserSizes[r],o=i.width,a=i.height,s=Math.max(o,a)/this.worldScaling[0],u=this.getChangeNodes(s);if(null==u||!u.size)return c(c({type:X.FullWork},this.baseConsumeResult),{},{rect:e});var l=[];this.tmpPoints.map((function(e){l.push(e.x,e.y,s/2)}));var h=Sa(l);return c(c({},this.baseConsumeResult),{},{type:X.FullWork,dataType:Y.Local,rect:e,ops:h,willUpdateNodes:u})}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0}}]),n}(xa);I(Fs,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var Ws=Fs;function Gs(e){switch(e){case H.Arrow:return Ts;case H.Pencil:return Ma;case H.Straight:return Ls;case H.Ellipse:return Ms;case H.Polygon:case H.Triangle:return Is;case H.Star:case H.Rhombus:return Es;case H.Rectangle:return ks;case H.SpeechBalloon:return Cs;case H.Text:return zs;case H.LaserPen:return ka;case H.Eraser:return Ia;case H.PencilEraser:return Us;case H.BitMapEraser:return Ws;case H.Selector:return Ss;case H.Image:return Ds}}function Vs(e,t){var r=e.toolsType,i=n(e,["toolsType"]);switch(r){case H.Arrow:return new Ts(i);case H.Pencil:return new Ma(i);case H.Straight:return new Ls(i);case H.Ellipse:return new Ms(i);case H.Polygon:case H.Triangle:return new Is(i);case H.Star:case H.Rhombus:return new Es(i);case H.Rectangle:return new ks(i);case H.SpeechBalloon:return new Cs(i);case H.Text:return new zs(i);case H.LaserPen:return new ka(i);case H.Eraser:return new Ia(i,t);case H.BitMapEraser:return new Ws(i);case H.PencilEraser:return new Us(i,t);case H.Selector:return i.vNodes?new Ss(c(c({},i),{},{vNodes:i.vNodes,drawLayer:i.fullLayer})):void 0;case H.Image:return new Ds(i);default:return}}function Hs(e){var t,r=[],n=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"],i=f(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;if("GROUP"===o.tagName&&o.children.length)return Hs(o.children);o.tagName&&n.includes(o.tagName)&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r}function Ys(e,t){if(e&&t){var r=Math.min(e.x,t.x),n=Math.min(e.y,t.y);return{x:r,y:n,w:Math.max(e.x+e.w,t.x+t.w)-r,h:Math.max(e.y+e.h,t.y+t.h)-n}}return t||e}function $s(e,t){if(e&&t){var r=Math.min(e.originX,t.originX),n=Math.min(e.originY,t.originY);return{originX:r,originY:n,width:Math.max(e.originX+e.width,t.originX+t.width)-r,height:Math.max(e.originY+e.height,t.originY+t.height)-n}}return t||e}function Xs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r={x:0,y:0,w:0,h:0},n=1/0,i=1/0,a=-1/0,s=-1/0;return e.forEach((function(e){var r=o(e.XY,2),u=r[0],l=r[1];n=Math.min(n,u-t),i=Math.min(i,l-t),a=Math.max(a,u+t),s=Math.max(s,l+t)})),r.x=n,r.y=i,r.w=a-n,r.h=s-i,r}function qs(e,t){return!(e.x+e.wt.x+t.w||e.y+e.ht.y+t.h)}function Qs(e,t){return{x:e.x+t[0],y:e.y+t[1],w:e.w,h:e.h}}function Zs(e,t){var r=function(e,t){var r=new re(e.x,e.y),n=new re(e.x+e.w,e.y),i=new re(e.x+e.w,e.y+e.h),o=new re(e.x,e.y+e.h),a=new re(e.x+e.w/2,e.y+e.h/2),s=Math.PI*t/180;return[re.RotWith(r,a,s),re.RotWith(n,a,s),re.RotWith(i,a,s),re.RotWith(o,a,s)]}(e,t);return Xs(r)}function Ks(e,t,r){for(var n=new re(t[0],t[1]),i=0;i3&&void 0!==arguments[3]?arguments[3]:[0,0],i=new re(t[0],t[1]),o=0;o3&&void 0!==arguments[3]?arguments[3]:[0,0],i=new re(t[0],t[1]),o=0;o=t.x&&e[0]<=t.x+t.w&&e[1]>=t.y&&e[1]<=t.y+t.h}function ru(e,t){return[e<=t?1:e/t,t<=e?1:t/e]}var nu=function(e){if("GROUP"===e.tagName){var t=Object.getOwnPropertySymbols(e).find((function(e){return"Symbol(sealed)"===e.toString()}));if(t&&e[t])return!0}return!1};function iu(e){return"".concat(au(e.x),",").concat(au(e.y)," ")}function ou(e,t){return"".concat(au((e.x+t.x)/2),",").concat(au((e.y+t.y)/2)," ")}function au(e){return+e.toFixed(4)}var su=function(e,t){return new Promise((function(e){window.requestIdleCallback?requestIdleCallback((function(){e(1)}),{timeout:t}):setTimeout((function(){e(2)}),t)})).then((function(){e()}),(function(){e()}))},uu=function(e){var t=(null==e?void 0:e.webkitBackingStorePixelRatio)||(null==e?void 0:e.mozBackingStorePixelRatio)||(null==e?void 0:e.msBackingStorePixelRatio)||(null==e?void 0:e.oBackingStorePixelRatio)||(null==e?void 0:e.backingStorePixelRatio)||1;return Math.max(1,(window.devicePixelRatio||1)/t)};function lu(e){for(var t=0,r=0;r=1&&n<=126||65376<=n&&n<=65439?t++:t+=2}return t}var cu=function(e){m(r,e);var t=y(r);function r(e,n,i){var o;return S(this,r),o=t.call(this,e,n),I(b(o),"authSpace"),I(b(o),"namespace"),I(b(o),"serviceStorage",{}),I(b(o),"storage",{}),I(b(o),"authStorage",{}),I(b(o),"stateDisposer"),I(b(o),"authDisposer"),I(b(o),"asyncClockState",!1),r.syncInterval=.5*(i||r.syncInterval),o.namespace=r.namespace,o.authSpace=r.authSpace,o.serviceStorage=o.getNamespaceData(),o.storage=R.cloneDeep(o.serviceStorage),o.authStorage=o.getAuthSpaceData(),o}return M(r,[{key:"getViewIdBySecenPath",value:function(e){for(var t=this.getNamespaceData(),r=0,n=Object.entries(t);r0)){r.next=17;break}c.diffView=s,h=0,d=Object.entries(s);case 6:if(!(h0)){r.next=34;break}c.diffScenePath=u,m=0,g=Object.entries(u);case 20:if(!(m0)){r.next=53;break}c.diffData=l,T=0,M=Object.entries(l);case 37:if(!(T0&&e(c);case 54:case"end":return r.stop()}}),r)}))))}},{key:"removeStorageStateListener",value:function(){this.stateDisposer&&this.stateDisposer()}},{key:"diffFunByView",value:function(e,t){var r,n=Ta(e),i=Ta(t),o={},a={},s={},u=f(i);try{for(u.s();!(r=u.n()).done;){var l=r.value;n.includes(l)&&void 0!==e[l]||(o[l]={newValue:t[l],oldValue:void 0})}}catch(e){u.e(e)}finally{u.f()}var c,h=f(n);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!R.isEqual(e[d],t[d]))if(i.includes(d)&&void 0!==t[d]){var p=this.diffFunByScenePath(e[d],t[d],d);Object.assign(a,p.diffScenePath),Object.assign(s,p.diffData)}else o[d]={newValue:void 0,oldValue:e[d]}}}catch(e){h.e(e)}finally{h.f()}return{diffData:s,diffScenePath:a,diffView:o}}},{key:"diffFunByScenePath",value:function(e,t,r){var n,i=Ta(e),o=Ta(t),a={},s={},u=f(o);try{for(u.s();!(n=u.n()).done;){var l=n.value;i.includes(l)&&void 0!==e[l]||(a[l]={newValue:t[l],oldValue:void 0,viewId:r})}}catch(e){u.e(e)}finally{u.f()}var c,h=f(i);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!R.isEqual(e[d],t[d]))if(o.includes(d)&&void 0!==t[d]){var p=this.diffFunByKeys(e[d],t[d],d,r);Object.assign(s,p)}else a[d]={newValue:void 0,oldValue:e[d],viewId:r}}}catch(e){h.e(e)}finally{h.f()}return{diffScenePath:a,diffData:s}}},{key:"diffFunByKeys",value:function(e,t,r,n){var i,o=Ta(e),a=Ta(t),s={},u=f(a);try{for(u.s();!(i=u.n()).done;){var l=i.value;(!o.includes(l)||void 0===e[l])&&(s[l]={oldValue:void 0,newValue:t[l],viewId:n,scenePath:r})}}catch(e){u.e(e)}finally{u.f()}var c,h=f(o);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!R.isEqual(e[d],t[d])){if(!a.includes(d)||void 0===t[d]){s[d]={newValue:void 0,oldValue:e[d],viewId:n,scenePath:r};continue}a.includes(d)&&(s[d]={oldValue:e[d],newValue:t[d],viewId:n,scenePath:r})}}}catch(e){h.e(e)}finally{h.f()}return s}},{key:"transformKey",value:function(e){return this.uid+Aa+e}},{key:"isOwn",value:function(e){return e.split(Aa)[0]===this.uid}},{key:"dispatch",value:function(e){var t=this,r=e.type,n=e.workId,i=e.ops,o=e.index,a=e.opt,s=e.toolsType,u=e.removeIds,l=e.updateNodeOpt,h=e.op,d=e.selectIds,f=e.isSync,p=e.scenePath,v=e.viewId;if(v)switch(r){case X.Clear:var m={};p&&this.storage[v]&&this.storage[v][p]?(delete this.storage[v][p],this.setState(m,{isSync:f,viewId:v,scenePath:p})):this.storage[v]&&(delete this.storage[v],this.setState(m,{isSync:f,viewId:v,scenePath:""}));break;case X.CreateWork:if(p&&n&&s&&a){var g=this.isLocalId(n.toString())?this.transformKey(n):n;this.control.renderControl.isUsePageAuth(v)&&this.control.renderControl.addRenderPageElementId({viewId:v,scenePath:p,elementId:g.toString()}),this.updateValue(g.toString(),{type:X.CreateWork,workId:n,toolsType:s,opt:a},{isSync:f,viewId:v,scenePath:p})}break;case X.DrawWork:if(p&&n&&"number"==typeof o&&null!=h&&h.length){var y=this.isLocalId(n.toString())?this.transformKey(n):n,_=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][y]||void 0;if(null!=_&&_.ops||(null==_?void 0:_.type)===X.FullWork)return;var b=o?((null==_?void 0:_.op)||[]).slice(0,o).concat(h):h||(null==_?void 0:_.op),x=s||(null==_?void 0:_.toolsType),w=a||(null==_?void 0:_.opt),S=l||(null==_?void 0:_.updateNodeOpt);n&&x&&w&&b&&(this.control.renderControl.isUsePageAuth(v)&&this.control.renderControl.addRenderPageElementId({viewId:v,scenePath:p,elementId:y.toString()}),this.updateValue(y.toString(),c(c({},_),{},{type:X.DrawWork,workId:n,updateNodeOpt:S,toolsType:x,opt:w,op:b,index:o}),{isSync:f,viewId:v,scenePath:p}))}break;case X.FullWork:if(p&&n){var T=this.isLocalId(n.toString())?this.transformKey(n):n,M=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][T]||void 0,k=l||(null==M?void 0:M.updateNodeOpt),E=s||(null==M?void 0:M.toolsType),I=a||(null==M?void 0:M.opt),A=i||(null==M?void 0:M.ops);E&&I&&(this.control.renderControl.isUsePageAuth(v)&&this.control.renderControl.addRenderPageElementId({viewId:v,scenePath:p,elementId:T.toString()}),this.updateValue(T.toString(),{type:X.FullWork,updateNodeOpt:k,workId:T,toolsType:E,opt:I,ops:A},{isSync:f,viewId:v,scenePath:p}))}break;case X.RemoveNode:if(p&&null!=u&&u.length){var C=u.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e}));this.storage[v]&&this.storage[v][p]&&Object.keys(this.storage[v][p]).map((function(e){null!=C&&C.includes(e)&&(t.control.renderControl.isUsePageAuth(v)&&t.control.renderControl.delRenderPageElementId({viewId:v,scenePath:p,elementId:e}),t.updateValue(e,void 0,{isSync:f,viewId:v,scenePath:p}))}))}break;case X.UpdateNode:if(p&&n&&(l||i||a)){var P=this.isLocalId(n.toString())?this.transformKey(n):n,N=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][P]||void 0;N&&(N.updateNodeOpt=l,(i||h)&&(N.ops=i,N.op=h),a&&(N.opt=a),N.type=X.FullWork,this.updateValue(P.toString(),N,{isSync:f,viewId:v,scenePath:p}))}break;case X.Select:if(!p)return;var O;null!=d&&d.length&&(O=d.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e})));var R=this.transformKey(Ca),D=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][R]||void 0,L=a||(null==D?void 0:D.opt);O&&this.checkOtherSelector(R,O,{isSync:f,viewId:v,scenePath:p}),this.updateValue(R,O&&{type:X.Select,toolsType:H.Selector,opt:L,selectIds:O},{isSync:f,viewId:v,scenePath:p})}}},{key:"checkOtherSelector",value:function(e,t,r){for(var n=r.viewId,i=r.scenePath,o=0,a=Object.keys(this.storage[n][i]);o0&&(u.selectIds=l),this.updateValue(s,l.length&&u||void 0,r)}}}}},{key:"setState",value:function(e,t){for(var r=t.viewId,n=t.scenePath,i=Ta(e),o=0;o0&&void 0!==arguments[0]&&arguments[0],r=Ta(this.serviceStorage),n=Ta(this.storage),i=new Map,a=f(r);try{for(a.s();!(e=a.n()).done;){var s=e.value;n.includes(s)?R.isEqual(this.serviceStorage[s],this.storage[s])||this.syncViewData(s,t):i.set(s,void 0)}}catch(e){a.e(e)}finally{a.f()}var u,l=f(n);try{for(l.s();!(u=l.n()).done;){var c=u.value;r.includes(c)||i.set(c,this.storage[c])}}catch(e){l.e(e)}finally{l.f()}if(i.size>5)this.syncStorageView(this.storage,t);else{var h,d=f(i.entries());try{for(d.s();!(h=d.n()).done;){var p=o(h.value,2),v=p[0],m=p[1];this.syncUpdataView(v,m,t)}}catch(e){d.e(e)}finally{d.f()}}}},{key:"syncViewData",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ta(this.serviceStorage[e]),i=Ta(this.storage[e]),a=new Map,s=f(n);try{for(s.s();!(t=s.n()).done;){var u=t.value;i.includes(u)?R.isEqual(this.serviceStorage[e][u],this.storage[e][u])||this.syncScenePathData(e,u,r):a.set(u,void 0)}}catch(e){s.e(e)}finally{s.f()}var l,c=f(i);try{for(c.s();!(l=c.n()).done;){var h=l.value;n.includes(h)||a.set(h,this.storage[e][h])}}catch(e){c.e(e)}finally{c.f()}if(a.size>5)this.syncStorageScenePath(e,this.storage[e],r);else{var d,p=f(a.entries());try{for(p.s();!(d=p.n()).done;){var v=o(d.value,2),m=v[0],g=v[1];this.syncUpdataScenePath(e,m,g,r)}}catch(e){p.e(e)}finally{p.f()}}}},{key:"syncScenePathData",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Ta(this.serviceStorage[e][t]),a=Ta(this.storage[e][t]),s=new Map,u=f(i);try{for(u.s();!(r=u.n()).done;){var l=r.value;a.includes(l)?R.isEqual(this.serviceStorage[e][t][l],this.storage[e][t][l])||s.set(l,this.storage[e][t][l]):s.set(l,void 0)}}catch(e){u.e(e)}finally{u.f()}var c,h=f(a);try{for(h.s();!(c=h.n()).done;){var d=c.value;i.includes(d)||s.set(d,this.storage[e][t][d])}}catch(e){h.e(e)}finally{h.f()}if(s.size>5)this.syncStorageKey(e,t,this.storage[e][t],n);else{var p,v=f(s.entries());try{for(v.s();!(p=v.n()).done;){var m=o(p.value,2),g=m[0],y=m[1];this.syncUpdataKey(e,t,g,y,n)}}catch(e){v.e(e)}finally{v.f()}}}},{key:"syncUpdataView",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(this.serviceStorage).length?(n||(void 0===t?delete this.serviceStorage[e]:this.serviceStorage[e]=R.cloneDeep(t)),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)):this.syncStorageView(this.storage,n)}},{key:"syncStorageView",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r||e&&(this.serviceStorage=R.cloneDeep(e)),null==(t=this.plugin)||t.updateAttributes([this.namespace],e)}},{key:"syncUpdataScenePath",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.keys(this.serviceStorage[e]).length?(i||(void 0===r?delete this.serviceStorage[e][t]:this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)):this.syncStorageScenePath(e,this.storage[e],i)}},{key:"syncStorageScenePath",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n||t&&(this.serviceStorage[e]=t),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)}},{key:"syncUpdataKey",value:function(e,t,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object.keys(this.serviceStorage[e][t]).length?(o||(void 0===n?delete this.serviceStorage[e][t][r]:this.serviceStorage[e][t][r]=n),null==(i=this.plugin)||i.updateAttributes([this.namespace,e,t,r],n)):this.syncStorageKey(e,t,this.storage[e][t],o)}},{key:"syncStorageKey",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i||(this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)}},{key:"keyTransformWorkId",value:function(e){var t=e.split(Aa);return 2===t.length?t[1]:e}},{key:"destroy",value:function(){this.removeStorageStateListener(),this.serviceStorage={},this.storage={},this.removeAuthStateListener(),this.authStorage={}}},{key:"setAuth",value:function(e,t){var r,n=e.writable,i=e.readOnly,o=e.renderAuth,a=e.pageAuth;!0===n||R.isArray(n)&&n.length?this.authStorage.writable=n:delete this.authStorage.writable,!0===i||R.isArray(i)&&i.length?this.authStorage.readOnly=i:delete this.authStorage.readOnly,o&&Object.keys(o).length?this.authStorage.renderAuth=o:delete this.authStorage.renderAuth,a&&Object.keys(a).length?this.authStorage.pageAuth=a:delete this.authStorage.pageAuth,t&&(null==(r=this.plugin)||r.updateAttributes([this.authSpace],this.authStorage))}},{key:"dispatchAuth",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.type,n=e.writeData,i=e.viewId,o=e.renderData,a=e.pageData;switch(r){case X.AuthWriter:if(n){var s=n.writable,u=n.readOnly;this.setAuth(c(c({},this.authStorage),{},{writable:s,readOnly:u}),t);break}break;case X.AuthReader:if(i)if(o&&(o.render||o.hide||o.clear)){var l=this.authStorage.renderAuth||{};l[i]=o,this.setAuth(c(c({},this.authStorage),{},{renderAuth:l}),t)}else{var h=this.authStorage.renderAuth;h&&null!=h&&h[i]&&(null==h||delete h[i],this.setAuth(c(c({},this.authStorage),{},{renderAuth:h}),t))}break;case X.AuthPage:if(i)if(a){var d=this.authStorage.pageAuth||{};d[i]=a,this.setAuth(c(c({},this.authStorage),{},{pageAuth:d}),t)}else{var f=this.authStorage.pageAuth;f&&null!=f&&f[i]&&(null==f||delete f[i],this.setAuth(c(c({},this.authStorage),{},{pageAuth:f}),t))}}}},{key:"addAuthStateListener",value:function(e){var t=this;this.authDisposer=A.autorun(s(regeneratorRuntime.mark((function r(){var n,i,o,a,s,u,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t.getAuthSpaceData(),i=n.writable,o=n.readOnly,a=n.renderAuth,s=n.pageAuth,(!R.isEqual(i,t.authStorage.writable)||!R.isEqual(o,t.authStorage.readOnly))&&(t.authStorage.writable=i,t.authStorage.readOnly=o,t.control.renderControl.syncWriteable(i,o)),R.isEqual(a,t.authStorage.renderAuth)||(u=t.diffAuthFun(t.authStorage.renderAuth||{},a||{}),t.authStorage.renderAuth=a),R.isEqual(s,t.authStorage.pageAuth)||(l=t.diffAuthPageFun(t.authStorage.pageAuth||{},s||{}),t.authStorage.pageAuth=s),(u||l)&&e(u,l);case 3:case"end":return r.stop()}}),r)}))))}},{key:"removeAuthStateListener",value:function(){this.authDisposer&&this.authDisposer()}},{key:"diffAuthFun",value:function(e,t){var r,n=Ta(e),i=Ta(t),o={},a=f(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;n.includes(s)&&void 0!==e[s]||(o[s]={newValue:t[s],oldValue:void 0})}}catch(e){a.e(e)}finally{a.f()}var u,l=f(n);try{for(l.s();!(u=l.n()).done;){var c=u.value;if(!R.isEqual(e[c],t[c])){if(!i.includes(c)||void 0===t[c]){o[c]={newValue:void 0,oldValue:e[c]};continue}o[c]={newValue:t[c],oldValue:e[c]}}}}catch(e){l.e(e)}finally{l.f()}return o}},{key:"diffAuthPageFun",value:function(e,t){var r,n=Ta(e),i=Ta(t),o={},a=f(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;n.includes(s)&&void 0!==e[s]||(o[s]={newValue:t[s],oldValue:void 0})}}catch(e){a.e(e)}finally{a.f()}var u,l=f(n);try{for(l.s();!(u=l.n()).done;){var c=u.value;if(!R.isEqual(e[c],t[c])){if(!i.includes(c)||void 0===t[c]){o[c]={newValue:void 0,oldValue:e[c]};continue}o[c]={newValue:t[c],oldValue:e[c]}}}}catch(e){l.e(e)}finally{l.f()}return o}}]),r}(function(){function e(t,r){S(this,e),I(this,"plugin"),I(this,"uid"),I(this,"control"),this.control=t,this.plugin=r,this.uid=r.displayer.uid}return M(e,[{key:"getNamespaceData",value:function(){var e;return A.toJS(null==(e=this.plugin)?void 0:e.attributes[this.namespace])||{}}},{key:"getAuthSpaceData",value:function(){var e;return A.toJS(null==(e=this.plugin)?void 0:e.attributes[this.authSpace])||{}}},{key:"getUidFromKey",value:function(e){return 2===e.split(Aa).length&&e.split(Aa)[0]||this.uid}},{key:"isLocalId",value:function(e){return 1===e.split(Aa).length}},{key:"getLocalId",value:function(e){return e.split(Aa)[1]}},{key:"isSelector",value:function(e){return this.getLocalId(e)===Ca}}]),e}());I(cu,"namespace","PluginState"),I(cu,"authSpace","PluginAuth"),I(cu,"syncInterval",500);var hu=cu,du=function(){function e(){S(this,e),I(this,"roomMembers",[]),I(this,"onChangeHooks",new Set)}return M(e,[{key:"setRoomMembers",value:function(e){this.executChangeUidHook(this.roomMembers,e),this.roomMembers=e}},{key:"executChangeUidHook",value:function(e,t){var r={online:t.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session})),offline:e.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session}))};this.onChangeHooks.forEach((function(e){return e(r)}))}},{key:"getAllRoomMembers",value:function(){return this.roomMembers}},{key:"getRoomMember",value:function(e){return this.roomMembers.find((function(t){var r;return(null==(r=t.payload)?void 0:r.uid)===e}))}},{key:"isOnLine",value:function(e){return!this.getRoomMember(e)}},{key:"onUidChangeHook",value:function(e){this.onChangeHooks.add(e)}},{key:"destroy",value:function(){this.onChangeHooks.clear()}}]),e}(),fu=function(e){return e[e.Text=1]="Text",e[e.Shape=2]="Shape",e}(fu||{}),pu="mainView",vu=function(){function e(){S(this,e)}return M(e,[{key:"createProxy",value:function(t){var r=new Proxy(t,{get:function(t,r,n){var i=e.interceptors.hasOwnProperty(r)?e.interceptors:t;return Reflect.get(i,r,n)}});return e.proxyToRaw.set(r,t),r}}]),e}();I(vu,"proxyToRaw",new WeakMap),I(vu,"interceptors",{entries:function(){var e;return(e=vu.proxyToRaw.get(this)).entries.apply(e,arguments)},forEach:function(){var e;return(e=vu.proxyToRaw.get(this)).forEach.apply(e,arguments)},size:function(){return vu.proxyToRaw.get(this).size},get:function(e){return vu.proxyToRaw.get(this).get(e)},set:function(e,t){return vu.proxyToRaw.get(this).set(e,t)},delete:function(e,t){return vu.proxyToRaw.get(this).delete(e)},clear:function(){return vu.proxyToRaw.get(this).clear()}});var mu=vu,gu=function(){function e(t){S(this,e),I(this,"internalMsgEmitter"),I(this,"control"),I(this,"editors"),I(this,"activeId"),I(this,"proxyMap"),I(this,"taskqueue",new Map);var r=t.control,n=t.internalMsgEmitter;this.control=r,this.internalMsgEmitter=n;var i=new Map;this.proxyMap=new mu;var o=this,a=mu.interceptors.set;mu.interceptors.set=function(e,t){return o.interceptors.set(e,t),a.call(this,e,t)};var s=mu.interceptors.delete;mu.interceptors.delete=function(e,t){return o.interceptors.delete(e,t),s.call(this,e)},this.editors=this.proxyMap.createProxy(i)}var t;return M(e,[{key:"filterEditor",value:function(e){var t=new Map;return this.editors.forEach((function(r,n){r.viewId===e&&t.set(n,r)})),t}},{key:"computeTextActive",value:function(e,t){var r,n,i,o,a=null==(r=this.control.viewContainerManager)?void 0:r.transformToScenePoint(e,t),s=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);t&&s&&(null==(i=this.control.worker)||i.taskBatchData.add({msgType:X.GetTextActive,dataType:Y.Local,op:a,viewId:t,scenePath:s}),null==(o=this.control.worker)||o.runAnimation())}},{key:"checkEmptyTextBlur",value:function(){var e,t,r=this.activeId,n=f(this.editors.entries());try{for(n.s();!(t=n.n()).done;){var i=o(t.value,2),a=i[0],s=i[1];if(s.opt.uid&&s.opt.uid===(null==(e=this.collector)?void 0:e.uid)){r=a;break}}}catch(e){n.e(e)}finally{n.f()}if(r){var u=this.editors.get(r);(null==u?void 0:u.opt.text)&&(null==u?void 0:u.opt.text.replace(/\s*,/g,""))?this.unActive(r):this.delete(r,!0,!0)}}},{key:"onCameraChange",value:function(e,t){var r,n,i,a=f(this.editors.entries());try{for(a.s();!(i=a.n()).done;){var s=o(i.value,2),u=s[0],l=s[1];if(l.viewId===t){var c=l.opt,h=c.boxPoint,d=c.boxSize,p=h&&(null==(r=this.control.viewContainerManager)?void 0:r.transformToOriginPoint(h,l.viewId)),v=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);if(v&&t){var m={x:p&&p[0]||0,y:p&&p[1]||0,w:d&&d[0]||0,h:d&&d[1]||0,opt:l.opt,scale:e.scale,type:fu.Text,viewId:t,scenePath:v,canWorker:!1,canSync:!1};this.editors.set(u,m),this.control.viewContainerManager.setActiveTextEditor(t,this.activeId)}}}}catch(e){a.e(e)}finally{a.f()}}},{key:"onServiceDerive",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.msgType,a=e.viewId,s=e.scenePath,u=e.dataType;if(n&&a&&s){var l=n.toString();if(o!==X.RemoveNode){var c=i.boxPoint,h=i.boxSize,d=c&&(null==(t=this.control.viewContainerManager)?void 0:t.transformToOriginPoint(c,a)),f=this.control.viewContainerManager.getView(a),p={x:d&&d[0]||0,y:d&&d[1]||0,w:h&&h[0]||0,h:h&&h[1]||0,opt:i,type:fu.Text,canWorker:!0,canSync:!1,dataType:u,scale:(null==(r=null==f?void 0:f.cameraOpt)?void 0:r.scale)||1,viewId:a,scenePath:s};this.editors.set(l,p),u===Y.Service&&i.workState===$.Done&&this.activeId===l&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(a,this.activeId)}else this.delete(l,!0,!0)}}},{key:"updateForViewEdited",value:function(e,t){var r;this.editors.set(e,t);var n=null==(r=this.taskqueue.get(e))?void 0:r.resolve;n&&n(t)}},{key:"active",value:function(e){var t,r=this.editors.get(e);r&&r.viewId&&(r.opt.workState=$.Start,r.opt.uid=null==(t=this.collector)?void 0:t.uid,this.activeId=e,r.canWorker=!0,r.canSync=!0,this.editors.set(e,r),this.control.viewContainerManager.setActiveTextEditor(r.viewId,this.activeId))}},{key:"unActive",value:function(e){var t=this.editors.get(e);t&&t.viewId&&(t.opt.workState=$.Done,t.opt.uid=void 0,t.canWorker=!0,t.canSync=!0,this.editors.set(e,t),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(t.viewId,this.activeId))}},{key:"createTextForMasterController",value:function(e,t){var r,i=e.workId,o=e.isActive,a=n(e,["workId","isActive"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,a.viewId),a.opt.uid=null==(r=this.collector)?void 0:r.uid,o&&(this.activeId=i),a.dataType=Y.Local,a.canWorker=!0,a.canSync=!0,this.editors.set(i,a),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId)}},{key:"updateTextForMasterController",value:function(e,t){var r,i=e.workId,o=n(e,["workId"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,o.viewId);var a=this.editors.get(i)||{};o.opt&&(o.opt.uid=null==(r=this.collector)?void 0:r.uid),o.dataType=Y.Local,this.editors.set(i,c(c({},a),o)),this.control.viewContainerManager.setActiveTextEditor(o.viewId,this.activeId)}},{key:"updateTextControllerWithEffectAsync",value:(t=s(regeneratorRuntime.mark((function e(t,r){var i,o,a,s,u,l,h,d,f,p=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.workId,a=n(t,["workId"]),r&&this.internalMsgEmitter.emit("addUndoTicker",r,a.viewId),s=this.editors.get(o)||{},a.opt&&(a.opt.uid=null==(i=this.collector)?void 0:i.uid),a.dataType=Y.Local,u=c(c({},s),a),this.editors.set(o,u),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId),!this.taskqueue.has(o)){e.next=11;break}return(l=this.taskqueue.get(o))&&(l.clocker&&clearTimeout(l.clocker),this.taskqueue.delete(o)),e.next=10,this.updateTextControllerWithEffectAsync(t);case 10:return e.abrupt("return",e.sent);case 11:return h=setTimeout((function(){var e,t=null==(e=p.taskqueue.get(o))?void 0:e.resolve;t&&t(u)}),50),e.next=14,new Promise((function(e){p.taskqueue.set(o,{resolve:e,clocker:h})}));case 14:return d=e.sent,f=this.taskqueue.get(o),e.abrupt("return",(f&&(f.clocker&&clearTimeout(f.clocker),this.taskqueue.delete(o)),d));case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"updateTextForWorker",value:function(e,t){var r=e.workId,i=e.isActive,o=n(e,["workId","isActive"]),a=c(c({},this.editors.get(r)||{}),o);if(i)return a.canWorker=!1,a.canSync=!1,this.editors.set(r,a),void this.active(r);this.editors.set(r,a),this.control.viewContainerManager.setActiveTextEditor(o.viewId,this.activeId),t&&this.internalMsgEmitter.emit("addUndoTicker",t,o.viewId)}},{key:"get",value:function(e){return this.editors.get(e)}},{key:"delete",value:function(e,t,r){var n=this.editors.get(e);if(n){var i=n.viewId;n.canSync=t,n.canWorker=r,this.editors.delete(e),this.activeId===e&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(i,this.activeId)}}},{key:"deleteBatch",value:function(e,t,r){var n,i=new Set,o=f(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.editors.get(a);if(s){var u=s.viewId;s.canSync=t,s.canWorker=r,this.editors.delete(a),this.activeId===a&&(this.activeId=void 0),i.add(u)}}}catch(e){o.e(e)}finally{o.f()}var l,c=f(i);try{for(c.s();!(l=c.n()).done;){var h=l.value;this.control.viewContainerManager.setActiveTextEditor(h,this.activeId)}}catch(e){c.e(e)}finally{c.f()}}},{key:"clear",value:function(e,t){var r=this;this.editors.forEach((function(n,i){n.viewId===e&&(t&&(n.canSync=!1),n.canWorker=!1,r.editors.delete(i))})),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(e,this.activeId)}},{key:"destory",value:function(){this.editors.clear(),this.activeId=void 0}},{key:"collector",get:function(){return this.control.collector}},{key:"interceptors",get:function(){var e=this;return{set:function(t,r){var n,i,o,a,s,u,l,c;if(!e.collector)return!0;var h=r.viewId,d=r.scenePath,f=r.canSync,p=r.canWorker,v=r.type,m=r.opt,g=r.dataType;if(!p&&!f)return!0;var y=(null==(n=e.collector)?void 0:n.isLocalId(t))?null==(i=e.collector)?void 0:i.transformKey(t):t,_=(null==(o=e.collector)?void 0:o.storage[h])&&e.collector.storage[h][d]&&e.collector.storage[h][d][y]||void 0;_?_.toolsType===H.Text&&(p&&(e.control.worker.queryTaskBatchData({workId:t,msgType:X.UpdateNode}).forEach((function(t){var r;null==(r=e.control.worker)||r.taskBatchData.delete(t)})),null==(l=e.control.worker)||l.taskBatchData.add({workId:t,msgType:X.UpdateNode,dataType:g||Y.Local,toolsType:H.Text,opt:m,viewId:h,scenePath:d,willRefresh:!0}),null==(c=e.control.worker)||c.runAnimation()),f&&su((function(){var r;null==(r=e.collector)||r.dispatch({type:X.UpdateNode,workId:t,toolsType:H.Text,opt:m,viewId:h,scenePath:d})}),e.control.worker.maxLastSyncTime)):v===fu.Text&&(f&&(null==(a=e.collector)||a.dispatch({type:m.text&&X.FullWork||X.CreateWork,workId:t,toolsType:H.Text,opt:m,isSync:!0,viewId:h,scenePath:d})),p&&(null==(s=e.control.worker)||s.taskBatchData.add({workId:t,msgType:m.text&&X.FullWork||X.CreateWork,dataType:g||Y.Local,toolsType:H.Text,opt:m,viewId:h,scenePath:d,willRefresh:!0}),null==(u=e.control.worker)||u.runAnimation()))},delete:function(t){var r,n;if(!e.collector)return!0;var i=e.editors.get(t);if(!i)return!0;var o=i.viewId,a=i.scenePath,s=i.canSync,u=i.canWorker;if(!u&&!s)return!0;u&&(null==(r=e.control.worker)||r.taskBatchData.add({workId:t,toolsType:H.Text,msgType:X.RemoveNode,dataType:Y.Local,viewId:o,scenePath:a,willRefresh:!0}),null==(n=e.control.worker)||n.runAnimation()),s&&su((function(){var r;null==(r=e.collector)||r.dispatch({type:X.RemoveNode,removeIds:[t],toolsType:H.Text,viewId:o,scenePath:a})}),e.control.worker.maxLastSyncTime)},clear:function(){return!0}}}}]),e}(),yu=function(){function e(t){var r,n;S(this,e),I(this,"expirationTime",ya.cursor.expirationTime),I(this,"internalMsgEmitter"),I(this,"control"),I(this,"eventName","applianc-cursor"),I(this,"displayer"),I(this,"roomMember"),I(this,"animationId"),I(this,"maxLastSyncTime",ya.syncOpt.interval),I(this,"willSendEventWorkers",[]),I(this,"willConsumeEventWorkers",new Map),I(this,"sendEventTimerId"),I(this,"animationDrawWorkers",new Map),I(this,"animationEventWorkers",new Map),I(this,"cursorInfoMap",new Map),I(this,"doneRenderCursorInfoMap",new Map),I(this,"eventCollector");var i=t.control,o=t.internalMsgEmitter;this.internalMsgEmitter=o,this.control=i,this.roomMember=i.roomMember,this.maxLastSyncTime=(null==(n=null==(r=this.control.pluginOptions)?void 0:r.syncOpt)?void 0:n.interval)||this.maxLastSyncTime}return M(e,[{key:"activeCollector",value:function(){this.control.plugin&&(this.displayer=this.control.room||this.control.play,this.displayer.addMagixEventListener(this.eventName,this.mainMagixEventListener.bind(this)))}},{key:"mainMagixEventListener",value:function(e){var t,r=e.event,n=e.payload;if(r===this.eventName){var i=n.uid,o=n.op,a=n.type;if((null==(t=this.control.collector)?void 0:t.uid)!==i&&a===Q.Cursor&&null!=o&&o.length){var s,u=this.willConsumeEventWorkers.get(i)||[],l=f(o);try{for(l.s();!(s=l.n()).done;){var h=s.value,d=h.viewId;R.isNumber(h.consumPoint[0])&&R.isNumber(h.consumPoint[1])&&(h.consumPoint=this.control.viewContainerManager.transformToOriginPoint(h.consumPoint,d)),this.control.renderControl.isFilterCursor(d)&&u.unshift(c(c({},h),{},{timestamp:Date.now()}))}}catch(e){l.e(e)}finally{l.f()}this.willConsumeEventWorkers.set(i,u),this.runAnimation()}}}},{key:"onFocusViewChange",value:function(){this.checkDrawWorks(),this.runAnimation()}},{key:"updateRoomMembers",value:function(e){var t,r=e.offline,n=f(this.cursorInfoMap.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;i&&r.includes(i)&&this.cursorInfoMap.delete(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"getKey",value:function(e,t){return"".concat(e).concat(Aa).concat(t)}},{key:"getUidAndviewId",value:function(e){var t=o(e.split(Aa),2);return{uid:t[0],viewId:t[1]}}},{key:"runAnimation",value:function(){this.animationId||(this.animationId=requestAnimationFrame(this.animationCursor.bind(this)))}},{key:"checkDrawWorks",value:function(){var e,t,r=this.control.viewContainerManager.focuedViewId,n=f(this.animationDrawWorkers.entries());try{for(n.s();!(t=n.n()).done;){var i=o(t.value,2),a=i[0],s=i[1],u=this.getUidAndviewId(a),l=u.viewId;u.uid!==(null==(e=this.control.collector)?void 0:e.uid)&&l!==r&&s.workState===$.Done&&(s.consumPoint=[void 0,void 0])}}catch(e){n.e(e)}finally{n.f()}}},{key:"animationCursor",value:function(){this.animationId=void 0;var e,t=Date.now(),r=f(this.animationDrawWorkers.entries());try{for(r.s();!(e=r.n()).done;){var i=o(e.value,2),a=i[0],s=i[1],u=this.getUidAndviewId(a),l=u.uid,c=u.viewId,h=this.roomMember.getRoomMember(l);if(h){var d=s.consumPoint,p=s.timestamp,v=s.workState,m=this.cursorInfoMap.get(c)||new Map;d&&R.isNumber(d[0])&&R.isNumber(d[1])&&p+this.expirationTime>t?m.set(h.memberId,{x:d[0],y:d[1],roomMember:h,timestamp:p,type:1,workState:v}):m.delete(h.memberId),m.size?this.cursorInfoMap.set(c,m):this.cursorInfoMap.delete(c),this.animationDrawWorkers.delete(a)}else this.animationDrawWorkers.delete(a)}}catch(e){r.e(e)}finally{r.f()}var g,y=new Set,_=f(this.cursorInfoMap.entries());try{for(_.s();!(g=_.n()).done;){var b=o(g.value,2),x=b[0],w=b[1];if(w){var S,T=f(w.entries());try{for(T.s();!(S=T.n()).done;){var M=o(S.value,2),k=M[0],E=M[1];1===E.type&&E.workState!==$.Done&&y.add(k)}}catch(e){T.e(e)}finally{T.f()}}else this.cursorInfoMap.delete(x)}}catch(e){_.e(e)}finally{_.f()}var I,A=f(this.willConsumeEventWorkers.entries());try{for(A.s();!(I=A.n()).done;){var C=o(I.value,2),P=C[0],N=C[1],O=this.roomMember.getRoomMember(P);if(R.isNumber(null==O?void 0:O.memberId)&&!y.has(O.memberId)){var D=N.pop();D?this.animationEventWorkers.set(P,D):this.willConsumeEventWorkers.delete(P)}}}catch(e){A.e(e)}finally{A.f()}var L,j=f(this.animationEventWorkers.entries());try{for(j.s();!(L=j.n()).done;){var z=o(L.value,2),B=z[0],U=z[1],F=this.roomMember.getRoomMember(B);if(F){var W=U.viewId,V=U.consumPoint,H=U.timestamp,Y=this.cursorInfoMap.get(W)||new Map;V&&R.isNumber(V[0])&&R.isNumber(V[1])&&H+this.expirationTime>t?Y.set(F.memberId,{x:V[0],y:V[1],roomMember:F,timestamp:H,type:0}):Y.delete(F.memberId),Y.size?this.cursorInfoMap.set(W,Y):this.cursorInfoMap.delete(W),this.animationEventWorkers.delete(B)}else this.animationEventWorkers.delete(B)}}catch(e){j.e(e)}finally{j.f()}var X,q=f(this.doneRenderCursorInfoMap.keys());try{for(q.s();!(X=q.n()).done;){var Q=X.value;this.cursorInfoMap.has(Q)||(this.doneRenderCursorInfoMap.delete(Q),this.internalMsgEmitter.emit([G.Cursor,Q],[]))}}catch(e){q.e(e)}finally{q.f()}var Z,K=f(this.cursorInfoMap.entries());try{for(K.s();!(Z=K.n()).done;){var J=o(Z.value,2),ee=J[0],te=J[1];if(null!=te&&te.size){var re,ne=[],ie=f(te.entries());try{for(ie.s();!(re=ie.n()).done;){var oe=o(re.value,2),ae=oe[0],se=oe[1],ue=se.timestamp,le=n(se,["timestamp"]);ue+this.expirationTime>t?ne.push(le):(te.delete(ae),0===te.size&&(this.cursorInfoMap.delete(ee),this.doneRenderCursorInfoMap.delete(ee),this.internalMsgEmitter.emit([G.Cursor,ee],[])))}}catch(e){ie.e(e)}finally{ie.f()}var ce=this.doneRenderCursorInfoMap.get(ee);R.isEqual(ce,ne)||(this.doneRenderCursorInfoMap.set(ee,ne),this.internalMsgEmitter.emit([G.Cursor,ee],ne))}else this.cursorInfoMap.delete(ee),this.doneRenderCursorInfoMap.delete(ee),this.internalMsgEmitter.emit([G.Cursor,ee],[])}}catch(e){K.e(e)}finally{K.f()}(this.willConsumeEventWorkers.size||this.cursorInfoMap.size)&&this.runAnimation()}},{key:"sendEvent",value:function(e,t){var r=this;if(this.displayer&&A.isRoom(this.displayer)){var n=R.isNumber(e[0])&&R.isNumber(e[1])&&this.control.viewContainerManager.transformToScenePoint(e,t)||[void 0,void 0];this.willSendEventWorkers.push({consumPoint:n,viewId:t}),this.sendEventTimerId||(this.sendEventTimerId=setTimeout((function(){r.dispatchMagixEvent()}),this.maxLastSyncTime))}}},{key:"dispatchMagixEvent",value:function(){var e;this.displayer.dispatchMagixEvent(this.eventName,{type:Q.Cursor,op:R.cloneDeep(this.willSendEventWorkers),uid:null==(e=this.control.collector)?void 0:e.uid}),this.willSendEventWorkers.length=0,this.sendEventTimerId&&(clearTimeout(this.sendEventTimerId),this.sendEventTimerId=void 0)}},{key:"collectServiceCursor",value:function(e){var t,r=e.op,n=e.uid,i=e.workState,a=e.viewId;if(n&&r&&i&&a){var s=this.roomMember.getRoomMember(n);if(!s||n===(null==(t=this.control.collector)?void 0:t.uid))return;var u=this.getKey(n,a),l=[void 0,void 0];if(R.isNumber(r[0])&&R.isNumber(r[1])){var c=o(this.control.viewContainerManager.transformToOriginPoint(r,a),2);l=[c[0],c[1]]}if(i===$.Start){var h,d=f(this.cursorInfoMap.values());try{for(d.s();!(h=d.n()).done;){var p=h.value;if(null!=p&&p.size){var v,m=f(p.keys());try{for(m.s();!(v=m.n()).done;){var g=v.value;g===s.memberId&&p.delete(g)}}catch(e){m.e(e)}finally{m.f()}}}}catch(e){d.e(e)}finally{d.f()}}var y={consumPoint:l,workState:i,viewId:a,timestamp:Date.now()};if(i===$.Start||i===$.Done){var _=this.willConsumeEventWorkers.get(n);i===$.Start&&_&&this.willConsumeEventWorkers.delete(n),_&&i===$.Done&&(y.timestamp=y.timestamp-this.expirationTime)}this.animationDrawWorkers.set(u,y),this.runAnimation()}}},{key:"unabled",value:function(){var e;this.displayer&&A.isRoom(this.displayer)&&(this.willSendEventWorkers.length=0,this.displayer.dispatchMagixEvent(this.eventName,{type:Q.Cursor,op:[{viewId:this.control.viewContainerManager.focuedViewId,consumPoint:[void 0,void 0]}],uid:null==(e=this.control.collector)?void 0:e.uid}),this.sendEventTimerId&&(clearTimeout(this.sendEventTimerId),this.sendEventTimerId=void 0))}},{key:"clearViewCursor",value:function(e){var t,r,n,i,a=f(this.animationDrawWorkers.entries());try{for(a.s();!(i=a.n()).done;){var s=o(i.value,1)[0];this.getUidAndviewId(s).uid===(null==(t=this.control.collector)?void 0:t.uid)&&e==e&&this.animationDrawWorkers.delete(s)}}catch(e){a.e(e)}finally{a.f()}var u,l=f(this.willConsumeEventWorkers.entries());try{for(l.s();!(u=l.n()).done;){var c=o(u.value,1)[0];c===(null==(r=this.control.collector)?void 0:r.uid)&&this.willConsumeEventWorkers.delete(c)}}catch(e){l.e(e)}finally{l.f()}var h,d=f(this.animationEventWorkers.entries());try{for(d.s();!(h=d.n()).done;){var p=o(h.value,1)[0];p===(null==(n=this.control.collector)?void 0:n.uid)&&this.animationEventWorkers.delete(p)}}catch(e){d.e(e)}finally{d.f()}var v,m=f(this.cursorInfoMap.entries());try{for(m.s();!(v=m.n()).done;){var g=o(v.value,1)[0];g==g&&(this.cursorInfoMap.delete(g),this.doneRenderCursorInfoMap.delete(g),this.internalMsgEmitter.emit([G.Cursor,g],[]))}}catch(e){m.e(e)}finally{m.f()}}},{key:"stopAnimation",value:function(){this.animationDrawWorkers.clear(),this.willConsumeEventWorkers.clear(),this.cursorInfoMap.clear()}},{key:"destroy",value:function(){var e;null==(e=this.displayer)||e.removeMagixEventListener(this.eventName),this.stopAnimation()}}]),e}(),_u=function(){function e(){S(this,e),I(this,"useEmtMsg"),I(this,"emtType"),I(this,"control"),I(this,"mainEngine")}return M(e,[{key:"registerForMainEngine",value:function(e,t){return this.emtType=e,this.control=t,this.mainEngine=t.worker,this.mainEngine.internalMsgEmitter.on([this.emtType,this.emitEventType],this.collect.bind(this)),this}},{key:"destroy",value:function(){this.emtType&&this.mainEngine&&this.mainEngine.internalMsgEmitter.off([this.emtType,this.emitEventType],this.collect.bind(this))}},{key:"collectForLocalWorker",value:function(e,t){var r,n,i,a,s=this,u=f(e);try{for(u.s();!(a=u.n()).done;){var l=o(a.value,2),c=l[0],h=l[1];null==(r=this.mainEngine)||r.queryTaskBatchData(h).forEach((function(e){var t;null==(t=s.mainEngine)||t.taskBatchData.delete(e)})),null==(n=this.mainEngine)||n.taskBatchData.add(c)}}catch(e){u.e(e)}finally{u.f()}t?this.mainEngine.consume():null==(i=this.mainEngine)||i.runAnimation()}},{key:"collectForServiceWorker",value:function(e){var t=this;su((function(){e.forEach((function(e){var r;null==(r=t.serviceColloctor)||r.dispatch(e)}))}),this.mainEngine.maxLastSyncTime)}},{key:"pause",value:function(){var e;if(this.lastEmtData){this.useEmtMsg=!0;var t=c(c({},this.lastEmtData),{},{workState:$.Done});this.collect(t,!0),null==(e=bl.InternalMsgEmitter)||e.emit(W.ActiveMethod,!1)}}},{key:"recover",value:function(){var e;this.useEmtMsg&&bl.InternalMsgEmitter.hasListeners(W.ActiveMethod)&&(null==(e=bl.InternalMsgEmitter)||e.emit(W.ActiveMethod,!0))}},{key:"serviceColloctor",get:function(){return this.control.collector}}],[{key:"dispatch",value:function(e,t,r){var n;null==(n=bl.InternalMsgEmitter)||n.emit([e,t],r)}}]),e}(),bu=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"lastEmtData"),I(b(e),"emitEventType",W.CopyNode),e}return M(r,[{key:"collect",value:function(e){var t;if(this.serviceColloctor&&this.mainEngine){var r=e.workIds,n=e.viewId,i=this.control.viewContainerManager.getView(n);if(null!=i&&i.displayer){var o=i.focusScenePath,a=Date.now();this.mainEngine.internalMsgEmitter.emit("addUndoTicker",a,n);var s,u=f(r);try{for(u.s();!(s=u.n()).done;){var l=s.value,h=l.toString(),d=this.serviceColloctor.isLocalId(h)?this.serviceColloctor.transformKey(l):h,p=null==(t=this.serviceColloctor.getStorageData(n,o))?void 0:t[d];if(p){if(l===Ca){var v=p&&this.copySelector({viewId:n,store:p});v&&this.pasteSelector(c(c({},v),{},{viewId:n,scenePath:o,undoTickerId:a}));break}if(p.toolsType===H.Text&&p.opt&&p.opt.workState&&p.opt.workState!==$.Done){var m=p&&this.copyText({viewId:n,store:p});m&&this.pasteText(c(c({},m),{},{viewId:n,scenePath:o,key:d,store:p,undoTickerId:a}));break}}}}catch(e){u.e(e)}finally{u.f()}}}}},{key:"copyText",value:function(e){var t=e.viewId,r=e.store,n=this.control.viewContainerManager.getView(t);if(this.serviceColloctor&&n){var i=null==n?void 0:n.cameraOpt,o=i&&[i.centerX,i.centerY],a=r.opt;return{bgCenter:o,textCenter:a.boxPoint&&a.boxSize&&[a.boxPoint[0]+a.boxSize[0]/2,a.boxPoint[1]+a.boxSize[1]/2]}}}},{key:"pasteText",value:function(e){var t,r,n=e.bgCenter,i=e.textCenter,o=e.store,a=e.key,s=e.viewId,u=e.scenePath,l=e.undoTickerId,h=this.control.viewContainerManager.getView(s);if(this.serviceColloctor&&h){var d=Math.floor(30*Math.random()+1),f=(null==(t=h.cameraOpt)?void 0:t.scale)||1,p=n&&i&&[n[0]-i[0]+d,n[1]-i[1]+d]||[d/f,d/f],v=(this.serviceColloctor.isLocalId(a)?a:this.serviceColloctor.getLocalId(a.toString()))+"-"+l;if(o.toolsType===H.Text&&o.opt){var m=o.opt;if(m&&m.boxPoint&&m.text){m.workState=$.Done;var g=m.boxPoint;m.boxPoint=[g[0]+p[0],g[1]+p[1]],m.workState=$.Done;var y=this.control.viewContainerManager.transformToOriginPoint(m.boxPoint,s);this.control.textEditorManager.createTextForMasterController({workId:v,x:y[0],y:y[1],opt:m,scale:(null==(r=h.cameraOpt)?void 0:r.scale)||1,type:fu.Text,isActive:!1,viewId:s,scenePath:u}),this.collectForServiceWorker([c(c({},o),{},{opt:m,type:X.FullWork,workId:v,viewId:s,scenePath:u})])}}}}},{key:"copySelector",value:function(e){var t,r,n,i,o,a,s,u,l,c=e.viewId,h=e.store,d=this.control.viewContainerManager.getView(c),p=h.selectIds;if(this.serviceColloctor&&null!=p&&p.length&&d){var v=new Map,m={offset:{x:0,y:0},cameraOpt:{centerX:(null==(t=d.cameraOpt)?void 0:t.centerX)||0,centerY:(null==(r=d.cameraOpt)?void 0:r.centerY)||0,scale:(null==(n=d.cameraOpt)?void 0:n.scale)||1}},g=this.control.hasOffscreenCanvas()&&(null==(i=d.displayer.canvasBgRef.current)?void 0:i.getBoundingClientRect())||(null==(o=d.displayer.canvasContainerRef.current)?void 0:o.getBoundingClientRect()),y=null==(s=null==(a=d.displayer)?void 0:a.floatBarRef.current)?void 0:s.getBoundingClientRect(),_=g&&[g.x+g.width/2,g.y+g.height/2],b=y&&[y.x+y.width/2,y.y+y.height/2],x=_&&d.viewData&&d.viewData.convertToPointInWorld({x:_[0],y:_[1]}),w=b&&d.viewData&&d.viewData.convertToPointInWorld({x:b[0],y:b[1]});x&&w&&(m.offset={x:x.x-w.x,y:x.y-w.y});var S,T=f(p);try{for(T.s();!(S=T.n()).done;){var M=S.value,k=null==(l=null==(u=this.serviceColloctor)?void 0:u.getStorageData(d.id,d.focusScenePath))?void 0:l[M];k&&v.set(M,k)}}catch(e){T.e(e)}finally{T.f()}return{copyStores:v,copyCoordInfo:m}}}},{key:"pasteSelector",value:function(e){var t,r=e.copyStores,n=e.copyCoordInfo,i=e.viewId,a=e.scenePath,s=e.undoTickerId,u=this.control.viewContainerManager.getView(i);if(r.size&&this.serviceColloctor&&u){var l,h=n.offset,d=(n.cameraOpt,Math.floor(30*Math.random()+1)),p=[h.x+d,h.y+d],v=[],m=[],g=f(r.entries());try{for(g.s();!(l=g.n()).done;){var y=o(l.value,2),_=y[0],b=y[1],x=(this.serviceColloctor.isLocalId(_)?_:this.serviceColloctor.getLocalId(_.toString()))+"-"+s,w={useAnimation:!1};if(b.toolsType===H.Text&&b.opt){var S=b.opt;if(S&&S.boxPoint&&S.text){S.workState=$.Done;var T=S.boxPoint;S.boxPoint=[T[0]+p[0],T[1]+p[1]],S.workState=$.Done;var M=this.control.viewContainerManager.transformToOriginPoint(S.boxPoint,i);this.control.textEditorManager.createTextForMasterController({workId:x,x:M[0],y:M[1],opt:S,scale:(null==(t=u.cameraOpt)?void 0:t.scale)||1,type:fu.Text,isActive:!1,viewId:i,scenePath:a})}m.push(c(c({},b),{},{opt:S,type:X.FullWork,workId:x,viewId:i,scenePath:a}))}else{if(b.toolsType===H.Image&&(b.opt.uuid=x,b.opt.centerX=b.opt.centerX+p[0],b.opt.centerY=b.opt.centerY+p[1]),b.ops){var k=wa(b.ops).map((function(e,t){var r=t%3;return 0===r?e+p[0]:1===r?e+p[1]:e})),E=Sa(k);b.ops=E}m.push(c(c({},b),{},{updateNodeOpt:w,type:X.FullWork,workId:x,viewId:i,scenePath:a})),v.push([c(c({},b),{},{updateNodeOpt:w,workId:x,msgType:X.FullWork,dataType:Y.Local,emitEventType:W.CopyNode,willSyncService:!1,willRefresh:!0,viewId:i}),{workId:x,msgType:X.FullWork,emitEventType:W.CopyNode}])}}}catch(e){g.e(e)}finally{g.f()}v.length&&this.collectForLocalWorker(v),m.length&&this.collectForServiceWorker(m)}}}]),r}(_u);function xu(e,t,r){return"#"+((e<<16)+(t<<8)+r).toString(16).padStart(6,"0")}function wu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return"rgba("+parseInt("0x"+e.slice(1,3))+","+parseInt("0x"+e.slice(3,5))+","+parseInt("0x"+e.slice(5,7))+","+t+")"}function Su(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return"rgba(".concat(e,",").concat(t,",").concat(r,",").concat(n,")")}function Tu(e){var t=e.split(","),r=parseInt(t[0].split("(")[1]),n=parseInt(t[1]),i=parseInt(t[2]),o=Number(t[3].split(")")[0]);return[xu(r,n,i),o]}function Mu(e){var t=e.split(",");return[parseInt(t[0].split("(")[1]),parseInt(t[1]),parseInt(t[2]),Number(t[3].split(")")[0])]}function ku(e){return"transparent"===e}var Eu=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"lastEmtData"),I(b(e),"emitEventType",W.SetColorNode),I(b(e),"undoTickerId"),e}return M(r,[{key:"setTextColor",value:function(e,t,r,n){var i=r.fontColor,o=r.fontBgColor;t.opt&&(i&&(t.opt.fontColor=i),o&&(t.opt.fontBgColor=o),this.control.textEditorManager.updateTextForMasterController({workId:e,opt:t.opt,viewId:n,canSync:!0,canWorker:!0}))}},{key:"collect",value:function(e){var t=this;if(this.serviceColloctor&&this.mainEngine){var r=e.workIds,n=e.strokeColor,i=e.fillColor,a=e.fontColor,s=e.fontBgColor,l=e.viewId,c=e.workState,h=e.thickness,d=e.strokeType,f=this.control.viewContainerManager.getView(l);if(null!=f&&f.displayer){var p=f.focusScenePath,v=u(r),m=this.serviceColloctor.storage,g=[],y={};for((c===$.Start||!this.undoTickerId&&c===$.Done)&&(this.undoTickerId=Date.now(),this.mainEngine.internalMsgEmitter.emit("addUndoTicker",this.undoTickerId,l));v.length;){var _=v.pop();if(_){var b=_.toString(),x=this.serviceColloctor.isLocalId(b),w=x?this.serviceColloctor.transformKey(_):b,S=b;!x&&this.serviceColloctor.isOwn(S)&&(S=this.serviceColloctor.getLocalId(S));var T=m[l][p][w]||void 0;if(T){var M=T.updateNodeOpt||{};if(a||s){if(a){M.fontColor=a;var k=o(Mu(a),4),E=k[0],I=k[1],A=k[2],C=k[3];y.textColor=[E,I,A],y.textOpacity=C}if(s)if(M.fontBgColor=ku(s)?"transparent":s,ku(s))y.textBgColor=void 0,y.textBgOpacity=void 0;else{var P=o(Mu(s),4),N=P[0],O=P[1],R=P[2],D=P[3];y.textBgColor=[N,O,R],y.textBgOpacity=D}if(T.toolsType===H.Text&&T.opt&&c!==$.Start){this.setTextColor(S,pa(T),M,l),c===$.Done&&(this.undoTickerId=void 0);continue}}if(n){M.strokeColor=n;var L=o(Mu(n),4),j=L[0],z=L[1],B=L[2],U=L[3];y.strokeColor=[j,z,B],y.strokeOpacity=U}if(i)if(M.fillColor=ku(i)?"transparent":i,ku(i))y.fillColor=void 0,y.fillOpacity=void 0;else{var F=o(Mu(i),4),W=F[0],G=F[1],V=F[2],q=F[3];y.fillColor=[W,G,V],y.fillOpacity=q}h&&(M.thickness=h,y.strokeWidth=h),d&&(M.strokeType=d,y.strokeType=d);var Q={workId:S,msgType:X.UpdateNode,dataType:Y.Local,updateNodeOpt:M,emitEventType:this.emitEventType,willRefresh:!0,willRefreshSelector:!0,willSyncService:!0,textUpdateForWoker:!0,viewId:l};g.push([Q,{workId:S,msgType:X.UpdateNode,emitEventType:this.emitEventType}])}}}g.length&&(c===$.Done&&(this.undoTickerId=void 0),this.collectForLocalWorker(g)),Object.keys(y).length&&setTimeout((function(){var e;null==(e=t.control.room)||e.setMemberState(y)}),0)}}}}]),r}(_u),Iu=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"lastEmtData"),I(b(e),"emitEventType",W.ZIndexNode),I(b(e),"zIndexMap",new Map),e}return M(r,[{key:"clearZIndex",value:function(e){this.zIndexMap.delete(e)}},{key:"getMinZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.min)||0}},{key:"getMaxZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.max)||0}},{key:"setMaxZIndex",value:function(e,t){var r=this.getMinZIndex(t);this.zIndexMap.set(t,{min:r,max:e})}},{key:"setMinZIndex",value:function(e,t){var r=this.getMaxZIndex(t);this.zIndexMap.set(t,{min:e,max:r})}},{key:"addMaxLayer",value:function(e){var t=this.getMaxZIndex(e)+1;this.setMaxZIndex(t,e)}},{key:"addMinLayer",value:function(e){var t=this.getMinZIndex(e)-1;this.setMinZIndex(t,e)}},{key:"correct",value:function(e){for(var t=e.sort((function(e,t){return e[1]-t[1]})),r=1;r((null==(a=null==(o=l[f(e,t.serviceColloctor)])?void 0:o.opt)?void 0:a.zIndex)||0)?1:et.wokerDrawCount){var u,l=[],c=f(n);try{for(c.s();!(u=c.n()).done;){var h=u.value;h.imageBitmap&&(h.isUnClose=!0,l.push(h))}}catch(e){c.e(e)}finally{c.f()}t.reRenders.set(t.subWorkerDrawCount,l)}else t.reRenders.size&&t.clearReRenders(t.subWorkerDrawCount)}a.length&&t.viewContainerManager.render(a)}};case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"clearReRenders",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,r=f(this.reRenders.keys());try{for(r.s();!(e=r.n()).done;){var n=e.value;if(R.isNumber(Number(n))&&Number(n)<=t){var i=this.reRenders.get(Number(n));null==i||i.forEach((function(e){var t;null==(t=e.imageBitmap)||t.close()})),this.reRenders.delete(n)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"getLockSentEventCursor",value:function(){return this.isLockSentEventCursor}},{key:"setLockSentEventCursor",value:function(e){this.isLockSentEventCursor=e}},{key:"getTasksqueueState",value:function(){return this.useTasksqueue&&$.Doing||$.Done}},{key:"setMaxDrawCount",value:function(e){this.maxDrawCount=e}},{key:"getWorkDrawCount",value:function(){return this.wokerDrawCount}},{key:"getSubWorkerDrawCount",value:function(){return this.subWorkerDrawCount}},{key:"getMaxDrawCount",value:function(){return this.maxDrawCount}},{key:"setWorkDrawCount",value:function(e){this.wokerDrawCount=e}},{key:"setSubWorkerDrawCount",value:function(e){this.subWorkerDrawCount=e}},{key:"setWorkerTasksqueueCount",value:function(e){var t=Math.max(this.workerTasksqueueCount||0,e);this.workerTasksqueueCount=t}},{key:"collectorSyncData",value:function(e){var t,r,n,i,o=this,a=!1,s=f(e);try{var u=function(){var e=i.value,s=e.type,u=e.selectIds,l=e.opt,h=e.selectRect,d=e.strokeColor,f=e.fillColor,p=e.willSyncService,v=e.isSync,m=e.imageBitmap,g=e.canvasHeight,y=e.canvasWidth,_=e.rect,b=e.op,x=e.canTextEdit,w=e.points,S=e.selectorColor,T=e.canRotate,M=e.scaleType,k=e.textOpt,E=e.toolsType,I=e.workId,A=e.viewId,C=e.dataType,P=e.canLock,N=e.isLocked,O=e.shapeOpt,D=e.toolsTypes,L=e.thickness,j=e.strokeType,z=e.useStroke,B=e.isgl,U=e.imageSrc,F=e.isSubWorker;if(!A)return{v:void 0};var W=e.scenePath||o.viewContainerManager.getCurScenePath(A);switch(s){case X.Select:var G=null!=u&&u.length?c(c({},h),{},{selectIds:u,canvasHeight:g,canvasWidth:y,points:w}):void 0;G&&null!=l&&l.strokeColor&&(G.selectorColor=l.strokeColor),G&&S&&(G.selectorColor=S),G&&d&&(G.strokeColor=d),G&&null!=l&&l.fillColor&&(G.fillColor=l.fillColor),G&&f&&(G.fillColor=f),G&&R.isBoolean(T)&&(G.canRotate=T),G&&M&&(G.scaleType=M),G&&x&&(G.canTextEdit=x),G&&k&&(G.textOpt=k),G&&R.isBoolean(P)&&(G.canLock=P),G&&R.isBoolean(N)&&(G.isLocked=N),G&&O&&(G.shapeOpt=O),G&&D&&(G.toolsTypes=D),G&&L&&(G.thickness=L),G&&j&&(G.strokeType=j),G&&R.isBoolean(z)&&(G.useStroke=z),A&&o.viewContainerManager.showFloatBar(A,!!G,G),p&&(null==(t=o.collector)||t.dispatch({type:s,selectIds:u,opt:l,isSync:v,viewId:A,scenePath:W}));break;case X.Snapshot:if(m&&W){var V=o.snapshotMap.get(W);V&&V(m)}break;case X.BoundingBox:if(_&&W){var $=o.boundingRectMap.get(W);$&&$(_)}break;case X.Cursor:b&&o.control.cursor.collectServiceCursor(c({},e));break;case X.Clear:if(A){o.viewContainerManager.showFloatBar(A,!1);var q=null==(r=o.clearAllResolveMap.get(A))?void 0:r.resolve;q&&q(A)}break;case X.TextUpdate:if(E===H.Text&&I&&A){var Q=o.viewContainerManager.transformToOriginPoint((null==l?void 0:l.boxPoint)||[0,0],A),Z=(null==l?void 0:l.boxSize)||[0,0],K=null==(n=o.viewContainerManager.getView(A))?void 0:n.cameraOpt;l?o.control.textEditorManager.updateTextForWorker({x:Q[0],y:Q[1],w:Z[0],h:Z[1],scale:(null==K?void 0:K.scale)||1,workId:I,opt:l,dataType:C,viewId:A,canSync:p||!1,canWorker:!1}):o.control.textEditorManager.delete(I,p||!1,!1)}break;case X.GetTextActive:E===H.Text&&I&&A&&o.control.textEditorManager.updateTextForWorker({workId:I,isActive:!0,viewId:A,dataType:Y.Local,canWorker:!1,canSync:!0},Date.now());break;case X.GetImageBitMap:U&&I&&A&&Wu({src:U,isgl:B}).then((function(e){var t,r=new Set;if(r.add({msgType:X.GetImageBitMap,dataType:Y.Local,workId:I,viewId:A,imageSrc:U,isSubWorker:F,imageBitmap:e}),o.control.hasOffscreenCanvas()){var n=F?o.subWorker:o.fullWorker;e?n.postMessage(r,[e]):n.postMessage(r)}else null==(t=o.mainThread)||t.consume(r)}));break;default:a=!0}};for(s.s();!(i=s.n()).done;){var l=u();if("object"===k(l))return l.v}}catch(e){s.e(e)}finally{s.f()}a&&su((function(){o.collectorAsyncData(e)}),this.maxLastSyncTime)}},{key:"collectorAsyncData",value:function(e){var t,r,n,i,o,a=this,s=f(e);try{var u=function(){var e=o.value,s=e.type,u=e.op,l=e.workId,c=e.index,h=e.removeIds,d=e.ops,f=e.opt,p=e.updateNodeOpt,v=e.toolsType,m=e.isSync,g=e.viewId,y=e.isLockSentEventCursor,_=e.nextTasks;if(!g)return console.error("collectorAsyncData",e),{v:void 0};var b=e.scenePath||a.viewContainerManager.getCurScenePath(g);switch(s){case X.None:y&&su((function(){a.setLockSentEventCursor(!1)}),a.maxLastSyncTime);break;case X.DrawWork:null==(t=a.collector)||t.dispatch({type:s,op:u,opt:f,toolsType:v,workId:l,index:c,isSync:m,viewId:g,scenePath:b,updateNodeOpt:p});break;case X.FullWork:null==(r=a.collector)||r.dispatch({type:s,ops:d,workId:l,updateNodeOpt:p,opt:f,toolsType:v,isSync:m,viewId:g,scenePath:b}),a.willSelectorWorkId&&l&&l.toString()===a.willSelectorWorkId&&a.control.runEffectWork((function(){a.setShapeSelectorByWorkId(a.willSelectorWorkId,g),a.willSelectorWorkId=void 0}));break;case X.UpdateNode:null==(n=a.collector)||n.dispatch({type:s,updateNodeOpt:p,workId:l,opt:f,ops:d,op:u,isSync:m,viewId:g,scenePath:b});break;case X.RemoveNode:h&&a.control.textEditorManager.deleteBatch(h,!1,!1),null==(i=a.collector)||i.dispatch({type:s,removeIds:h,isSync:m,viewId:g,scenePath:b}),a.willSelectorWorkId&&null!=h&&h.includes(a.willSelectorWorkId)&&(a.willSelectorWorkId=void 0)}_&&su((function(){a.collectorAsyncData(_)}),a.maxLastSyncTime)};for(s.s();!(o=s.n()).done;){var l=u();if("object"===k(l))return l.v}}catch(e){s.e(e)}finally{s.f()}}},{key:"onLocalEventEnd",value:(i=s(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,u,l,c,h,d,p,v,m,g,y=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.viewContainerManager.getView(r)){e.next=3;break}return e.abrupt("return");case 3:o=i.focusScenePath,a=i.cameraOpt,u=this.viewContainerManager.transformToScenePoint(t,r),l=[],c=f(this.localPointsBatchData.keys()),e.prev=5,c.s();case 7:if((h=c.n()).done){e.next=19;break}if(d=h.value,(null==(n=this.currentToolsData)?void 0:n.toolsType)!==H.Text){e.next=16;break}return p=this.getLocalPointInfo(d),(v=null==p?void 0:p.state)&&v===$.Start&&((m=this.currentLocalWorkData.toolsOpt).workState=$.Doing,m.boxPoint=u,m.boxSize=[m.fontSize,m.fontSize],this.control.textEditorManager.checkEmptyTextBlur(),this.control.textEditorManager.createTextForMasterController({workId:Date.now().toString(),x:t[0],y:t[1],scale:(null==a?void 0:a.scale)||1,opt:m,type:fu.Text,isActive:!0,viewId:r,scenePath:o},Date.now())),this.deleteLocalPoint(d),e.abrupt("continue",17);case 16:this.pushLocalPoint(d,u,$.Done,r),l.push(d);case 17:e.next=7;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(5),c.e(e.t0);case 24:return e.prev=24,c.f(),e.finish(24);case 27:if(!l.length){e.next=43;break}return e.prev=28,e.next=31,new Promise((function(e){setTimeout(s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l.forEach((function(e){y.setLocalPointIsFullWork(e)})),y.delayWorkStateToDoneResolve=e,y.consume();case 1:case"end":return t.stop()}}),t)}))),0)}));case 31:if(e.t1=e.sent,!e.t1){e.next=34;break}e.t1=l[0];case 34:if(!e.t1){e.next=37;break}g=l[0],l.forEach((function(e){y.deleteLocalPoint(e)})),this.willSelectorWorkId=g.toString();case 37:e.next=42;break;case 39:e.prev=39,e.t2=e.catch(28),console.log("error",e.t2);case 42:this.delayWorkStateToDoneResolve=void 0,l.length=0;case 43:case"end":return e.stop()}}),e,this,[[5,21,24,27],[28,39]])}))),function(e,t){return i.apply(this,arguments)})},{key:"onLocalEventDoing",value:function(e,t){var r;if((null==(r=this.currentToolsData)?void 0:r.toolsType)!==H.Text){this.currentLocalWorkData.workState===$.Start&&this.setCurrentLocalWorkData(c(c({},this.currentLocalWorkData),{},{workState:$.Doing}));var n,i=!1,a=f(this.localPointsBatchData.entries());try{for(a.s();!(n=a.n()).done;){var s=o(n.value,2),u=s[0],l=s[1].state;if(this.isAbled()&&l!==$.Pending){var h=this.viewContainerManager.transformToScenePoint(e,t);this.pushLocalPoint(u,h,l===$.Start?$.Doing:l,t),i=!0}}}catch(e){a.e(e)}finally{a.f()}i?this.runAnimation():this.useTasksqueue||this.hoverCursor(e,t)}}},{key:"onLocalEventStart",value:function(e,t){var r,n,i,o,a,s;this.viewContainerManager.focuedViewId!==t&&this.viewContainerManager.setFocuedViewId(t),this.isCanDrawWork&&this.control.room&&!this.control.room.disableDeviceInputs&&(this.control.room.disableDeviceInputs=!0);var u=(null==(r=this.currentToolsData)?void 0:r.toolsType)===H.Selector?Ca:Date.now(),l=this.setZIndex(t);this.setCurrentLocalWorkData({workState:$.Start,toolsOpt:l,viewId:t});var c=this.viewContainerManager.transformToScenePoint(e,t);if(this.pushLocalPoint(u,c,$.Start,t,l),(null==(n=this.currentToolsData)?void 0:n.toolsType)!==H.Text){if(this.control.textEditorManager.checkEmptyTextBlur(),this.isCanRecordUndoRedo&&this.internalMsgEmitter.emit("addUndoTicker",u,t),u&&l&&null!=(i=this.currentToolsData)&&i.toolsType&&this.isCanStartEventConsum&&this.prepareOnceWork({workId:u,toolsOpt:l,viewId:t},null==(o=this.currentToolsData)?void 0:o.toolsType),this.maxDrawCount=0,this.wokerDrawCount=0,this.subWorkerDrawCount=0,this.clearReRenders(1/0),null==(a=this.subMainThreadWorker)||a.clearDrawCount(t),this.isCanDrawWork){var h=this.viewContainerManager.getCurScenePath(t);h&&null!=(s=this.collector)&&s.hasSelector(t,h)&&this.blurSelector(t,h)}this.consume()}}},{key:"setLocalPointIsFullWork",value:function(e){var t=this.getLocalPointInfo(e);t&&(t.isFullWork=!0,this.localPointsBatchData.set(e,t))}},{key:"pushLocalPoint",value:function(e,t,r,n,i){var o=this.getLocalPointInfo(e);r===$.Start?o={state:$.Start,points:t,opt:i||this.currentLocalWorkData.toolsOpt,isFullWork:!1,viewId:n}:o&&(o.state=r,o.points.push(t[0],t[1])),o&&this.localPointsBatchData.set(e,o)}},{key:"deleteLocalPoint",value:function(e){this.localPointsBatchData.delete(e)}},{key:"getLocalPointInfo",value:function(e){return this.localPointsBatchData.get(e)}},{key:"getLocalPointsInfo",value:function(){return this.localPointsBatchData}},{key:"correctStorage",value:function(e,t,r){var n,i=this,a=new Map,s=[];Object.keys(e).forEach((function(t){var r,n,i=null==(n=null==(r=e[t])?void 0:r.opt)?void 0:n.zIndex;R.isNumber(i)&&s.push([t,i])}));var u=s.length&&(null==(n=this.zIndexNodeMethod)?void 0:n.correct(s))||[];this.zIndexNodeMethod&&u.length&&(this.zIndexNodeMethod.setMinZIndex(u[0][1]||0,t),this.zIndexNodeMethod.setMaxZIndex(u[u.length-1][1]||0,t));var l,c=f(u);try{for(c.s();!(l=c.n()).done;){var h=o(l.value,2),d=h[0],p=h[1];if(e[d]){var v=e[d];v.opt&&R.isNumber(v.opt.zIndex)&&v.opt.zIndex!==p&&(v.opt.zIndex=p,a.set(d,v))}}}catch(e){c.e(e)}finally{c.f()}return a.size&&a.forEach((function(n,o){var a;null==(a=i.collector)||a.updateValue(o,n,{viewId:t,scenePath:r,isSync:!0}),e[o]=n})),e}},{key:"originalEventLintener",value:(n=s(regeneratorRuntime.mark((function e(t,r,n){var i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAbled()){e.next=2;break}return e.abrupt("return");case 2:if(a=null==(i=this.collector)?void 0:i.uid,s=this.viewContainerManager.getCurScenePath(n),a&&!this.control.renderControl.isWriteable(a)){e.next=25;break}e.t0=null==(o=this.currentToolsData)?void 0:o.toolsType,e.next=e.t0===H.Eraser||e.t0===H.PencilEraser||e.t0===H.BitMapEraser?7:10;break;case 7:if(!a||this.control.renderControl.isClearAble({uid:a,viewId:n,scenePath:s})){e.next=9;break}return e.abrupt("return");case 9:case 12:return e.abrupt("break",13);case 10:if(!a||this.control.renderControl.isRenderAble({uid:a,viewId:n,scenePath:s})){e.next=12;break}return e.abrupt("return");case 13:e.t1=t,e.next=e.t1===$.Start?16:e.t1===$.Doing?18:e.t1===$.Done?20:25;break;case 16:return this.setLocalWorkViewId(n),n&&this.onLocalEventStart(r,n),e.abrupt("break",25);case 18:return n&&n===this.getLocalWorkViewId()&&this.onLocalEventDoing(r,n),e.abrupt("break",25);case 20:if(e.t2=n&&n===this.getLocalWorkViewId(),!e.t2){e.next=24;break}return e.next=24,this.onLocalEventEnd(r,n);case 24:return e.abrupt("break",25);case 25:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"getLocalWorkViewId",value:function(){return this.localWorkViewId}},{key:"setLocalWorkViewId",value:function(e){this.localWorkViewId=e}},{key:"setCurrentToolsData",value:function(e){var t,r,n,i=e.toolsType,o=(null==(t=this.currentToolsData)?void 0:t.toolsType)!==e.toolsType;if(d(w(v.prototype),"setCurrentToolsData",this).call(this,e),o){var a,s=f(null==(r=this.viewContainerManager)?void 0:r.getAllViews());try{for(s.s();!(a=s.n()).done;){var u=a.value;if(u){var l=u.id,h=u.focusScenePath;o&&l&&h&&(null!=(n=this.collector)&&n.hasSelector(l,h)&&this.blurSelector(l,h),this.control.textEditorManager.checkEmptyTextBlur())}}}catch(e){s.e(e)}finally{s.f()}this.taskBatchData.add({msgType:X.UpdateTools,dataType:Y.Local,toolsType:i,opt:c(c({},e.toolsOpt),{},{syncUnitTime:this.maxLastSyncTime}),isRunSubWork:this.isRunSubWork,viewId:Pa}),this.runAnimation()}}},{key:"prepareOnceWork",value:function(e,t){var r=this,n=e.workId,i=e.toolsOpt,o=e.viewId;this.queryTaskBatchData({msgType:X.CreateWork,dataType:Y.Local,viewId:o,toolsType:t}).forEach((function(e){r.taskBatchData.delete(e)})),this.taskBatchData.add({msgType:X.CreateWork,workId:n,toolsType:t,opt:c(c({},i),{},{syncUnitTime:this.maxLastSyncTime}),dataType:Y.Local,isRunSubWork:this.isRunSubWork,viewId:o}),this.runAnimation()}},{key:"createViewWorker",value:function(e,t){var r=t.offscreenCanvasOpt,n=t.layerOpt,i=t.dpr,o=t.cameraOpt;this.taskBatchData.add({msgType:X.Init,dataType:Y.Local,viewId:e,offscreenCanvasOpt:r,layerOpt:n,dpr:i,cameraOpt:o,isRunSubWork:!0,isSafari:-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")}),this.isBusy&&this.destroyTaskQueue(),this.consume()}},{key:"destroyViewWorker",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getLocalWorkViewId()===e&&this.setLocalWorkViewId(void 0),this.zIndexNodeMethod&&this.zIndexNodeMethod.clearZIndex(e),this.taskBatchData.add({msgType:X.Destroy,dataType:Y.Local,viewId:e,isRunSubWork:!0}),this.consume(),r||null==(t=this.collector)||t.dispatch({type:X.Clear,viewId:e}),this.control.renderControl.destoryByViewId(e,r)}},{key:"onServiceDerive",value:function(e,t){var r,n,i,o,a,s=this,u=t.newValue,l=t.oldValue,c=t.viewId,h=t.scenePath,d=R.cloneDeep(u)||{},f=e,p=d.type;if(!u&&l){if(f&&(null==(r=this.collector)?void 0:r.getLocalId(f))===Ca)return void(this.collector.isOwn(f)?this.blurSelector(c,h):this.blurSelector(c,h,f));if(p=X.RemoveNode,l.toolsType===H.LaserPen)return}var v=null==(n=this.viewContainerManager.getView(c))?void 0:n.focusScenePath;if(!v||v===h){if(p&&f){if(!this.control.renderControl.isFilterAble({viewId:c,elementId:e,scenePath:h},p))return;var m=d;if(m.workId=null!=(i=this.collector)&&i.isOwn(f)?null==(o=this.collector)?void 0:o.getLocalId(f):f,m.msgType=p,m.toolsType===H.LaserPen&&(m.isRunSubWork=!0),m.dataType=Y.Service,m.viewId=c,m.scenePath=h,m.selectIds&&(m.selectIds=m.selectIds.map((function(e){var t,r;return null!=(t=s.collector)&&t.isOwn(e)?null==(r=s.collector)?void 0:r.getLocalId(e):e}))),m&&m.toolsType===H.Text||(null==l?void 0:l.toolsType)===H.Text)return void this.control.textEditorManager.onServiceDerive(m);this.taskBatchData.add(m)}this.runAnimation();var g=t.newValue&&(null==(a=t.newValue.opt)?void 0:a.zIndex);if(this.zIndexNodeMethod&&R.isNumber(g)){var y=this.zIndexNodeMethod.getMinZIndex(c);this.zIndexNodeMethod.getMaxZIndex(c)g&&this.zIndexNodeMethod.setMinZIndex(g,c)}}}},{key:"pullServiceData",value:function(e,t){var r,n,i,o,a=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isAsync:!1,useAnimation:!1},u=null==(r=this.collector)?void 0:r.getStorageData(e,t),l=s.isAsync,c=s.useAnimation;if(u){u=this.correctStorage(u,e,t);for(var h=Object.keys(u),d=0,f=h;dDate.now()&&(s.push(c.toString()),this.taskBatchData.add({msgType:X.RemoveNode,workId:c,viewId:p,dataType:Y.Local,isRunSubWork:!0}));var g=v.map((function(e){return e}));this.taskBatchData.add({op:g,workState:$.Done,workId:c,dataType:Y.Local,msgType:X.DrawWork,isRunSubWork:this.isRunSubWork,toolsType:null==(t=this.currentToolsData)?void 0:t.toolsType,viewId:p,opt:m,scenePath:p&&this.viewContainerManager.getCurScenePath(p)}),a=!0}this.deleteLocalPoint(c)}}}catch(e){u.e(e)}finally{u.f()}if((a||s.length)&&(this.consume(),s.length)){var y=null==(r=this.viewContainerManager.getView(e))?void 0:r.focusScenePath;null==(n=this.collector)||n.dispatch({type:X.RemoveNode,removeIds:s,viewId:e,scenePath:y})}}},{key:"removeDrawingWork",value:function(e){var t,r,n,i=[],a=f(this.localPointsBatchData.entries());try{for(a.s();!(n=a.n()).done;){var s=o(n.value,2),u=s[0],l=s[1],c=l.state,h=l.viewId;(e===h&&c===$.Start||c===$.Doing)&&(this.deleteLocalPoint(u),c===$.Doing&&this.isCanDrawWork&&(i.push(u.toString()),this.taskBatchData.add({msgType:X.RemoveNode,workId:u,viewId:h,dataType:Y.Local,isRunSubWork:!0})))}}catch(e){a.e(e)}finally{a.f()}if(i.length){this.consume();var d=null==(t=this.viewContainerManager.getView(e))?void 0:t.focusScenePath;null==(r=this.collector)||r.dispatch({type:X.RemoveNode,removeIds:i,viewId:e,scenePath:d})}}},{key:"hoverCursor",value:function(e,t){var r,n=this;if((null==(r=this.currentToolsData)?void 0:r.toolsType)===H.Selector){var i=this.viewContainerManager.getView(t);if(i&&i.displayer&&i.displayer.vDom){var o=i.displayer.vDom.state.floatBarData;if(o)if(tu(e,{x:o.x,y:o.y,w:o.w,h:o.h}))return}var a=this.viewContainerManager.transformToScenePoint(e,t),s={msgType:X.CursorHover,dataType:Y.Local,point:a,toolsType:this.currentToolsData.toolsType,opt:this.currentToolsData.toolsOpt,isRunSubWork:!1,viewId:t};this.queryTaskBatchData({msgType:X.CursorHover,dataType:Y.Local,toolsType:this.currentToolsData.toolsType,viewId:t}).forEach((function(e){n.taskBatchData.delete(e)})),this.taskBatchData.add(s),this.runAnimation()}}},{key:"blurCursor",value:function(e){var t,r=this;if((null==(t=this.currentToolsData)?void 0:t.toolsType)===H.Selector){var n={msgType:X.CursorBlur,dataType:Y.Local,isRunSubWork:!1,viewId:e};this.queryTaskBatchData({msgType:X.CursorHover,dataType:Y.Local,viewId:e}).forEach((function(e){r.taskBatchData.delete(e)})),this.taskBatchData.add(n),this.consume()}}},{key:"sendCursorEvent",value:function(e,t){var r,n;if(this.currentLocalWorkData&&this.currentLocalWorkData.workState!==$.Unwritable&&this.currentToolsData&&this.isCanSentCursor){var i=null==(r=this.collector)?void 0:r.uid,o=this.viewContainerManager.getCurScenePath(t);switch(null==(n=this.currentToolsData)?void 0:n.toolsType){case H.Eraser:case H.PencilEraser:case H.BitMapEraser:if(i&&!this.control.renderControl.isClearAble({uid:i,viewId:t,filterLocalSelf:!1,scenePath:o}))return;break;default:if(i&&!this.control.renderControl.isWriteable(i)||i&&!this.control.renderControl.isRenderAble({uid:i,viewId:t,filterLocalSelf:!1,scenePath:o}))return}var a=[void 0,void 0];this.currentToolsData&&this.isCanSentCursor&&!this.localPointsBatchData.size&&!this.getLockSentEventCursor()&&(a=e,this.control.cursor.sendEvent(a,t))}}},{key:"getBoundingRect",value:function(e){var t,r,n=this;if(!(null==(t=this.boundingRectMap)?void 0:t.get(e))){var i=null==(r=this.collector)?void 0:r.getScenePathData(e);if(!i)return;if(Object.keys(i).forEach((function(e){var t;(null==(t=n.collector)?void 0:t.getLocalId(e))===Ca&&delete i[e]})),Object.keys(i).length&&this.viewContainerManager.mainView&&this.viewContainerManager.mainView.cameraOpt){var o={msgType:X.BoundingBox,dataType:Y.Local,scenePath:e,scenes:i,cameraOpt:c({},this.viewContainerManager.mainView.cameraOpt),isRunSubWork:!0,viewId:this.viewContainerManager.mainView.id};return this.taskBatchData.add(o),this.runAnimation(),new Promise((function(t){n.boundingRectMap.set(e,t)})).then((function(t){return n.boundingRectMap.delete(e),t}))}}}},{key:"getSnapshot",value:function(e,t,r,n){var i,o,a,s,u,l=this;if(!(null==(i=this.snapshotMap)?void 0:i.get(e))){var h=null==(o=this.collector)?void 0:o.getViewIdBySecenPath(e);if(!h)return;var d=null==(a=this.collector)?void 0:a.getStorageData(h,e);if(!d)return;if(Object.keys(d).forEach((function(e){var t;(null==(t=l.collector)?void 0:t.getLocalId(e))===Ca&&delete d[e]})),Object.keys(d).length){var f=this.viewContainerManager.mainView;if(!f)return;var p=t||(null==(s=f.cameraOpt)?void 0:s.width),v=r||(null==(u=f.cameraOpt)?void 0:u.height),m={msgType:X.Snapshot,dataType:Y.Local,scenePath:e,scenes:d,w:p,h:v,cameraOpt:n&&c(c({},n),{},{width:p,height:v})||f.cameraOpt,isRunSubWork:!0,viewId:f.id};return this.taskBatchData.add(m),this.runAnimation(),new Promise((function(t){l.snapshotMap.set(e,t)})).then((function(t){return l.snapshotMap.delete(e),t}))}}}},{key:"queryTaskBatchData",value:function(e){var t=[];if(e){var r,n=f(this.taskBatchData.values());try{for(n.s();!(r=n.n()).done;){for(var i=r.value,a=!0,s=0,u=Object.entries(e);s=t||r<0||h&&e-l>=o}function m(){var e=ul();if(v(e))return g(e);s=setTimeout(m,function(e){var r=t-(e-u);return h?hl(r,o-(e-l)):r}(e))}function g(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=ul(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(m,t),f(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=ll(t)||0,sl(r)&&(c=!!r.leading,o=(h="maxWait"in r)?cl(ll(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(ul())},y},fl=dl,pl=et;var vl=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return pl(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),fl(e,t,{leading:n,maxWait:t,trailing:i})},ml=ae(vl),gl=function(){function e(t){var r;S(this,e),I(this,"internalMsgEmitter"),I(this,"control"),I(this,"roomHotkeyCheckers"),I(this,"tmpCopyStore",new Map),I(this,"tmpCopyCoordInfo");var n=t.control,i=t.internalMsgEmitter;this.control=n,this.internalMsgEmitter=i,this.roomHotkeyCheckers=(null==(r=this.control.room)?void 0:r.viewsParams.hotKeys.nodes)||[]}return M(e,[{key:"getEventKey",value:function(e){return"keydown"===e.type?"KeyDown":"KeyUp"}},{key:"onActiveHotkey",value:function(e){var t,r,n,i=this.control.viewContainerManager.focuedViewId,o=null==(t=this.control.viewContainerManager.focuedView)?void 0:t.focusScenePath;if(i&&o)switch(e){case"delete":this.isSelector&&null!=(r=this.collector)&&r.hasSelector(i,o)&&zu.emitMethod(G.MainEngine,W.DeleteNode,{workIds:[Ca],viewId:i});break;case"copy":this.isSelector&&null!=(n=this.collector)&&n.hasSelector(i,o)&&this.copySelectorToTemp(i,o);break;case"paste":this.tmpCopyStore.size&&this.pasteTempToFocusView(i,o)}("changeToPencil"===e||"redo"===e||"undo"===e)&&this.onSelfActiveHotkey(e)}},{key:"colloctHotkey",value:function(e){if(this.isUseSelf){var t=this.checkHotkey(e);t&&this.onSelfActiveHotkey(t)}}},{key:"onSelfActiveHotkey",value:function(e){switch(e){case"changeToPencil":this.setMemberState({currentApplianceName:B.pencil,useNewPencil:!0});break;case"changeToArrow":this.setMemberState({currentApplianceName:B.arrow});break;case"changeToClick":this.setMemberState({currentApplianceName:B.clicker});break;case"changeToEllipse":this.setMemberState({currentApplianceName:B.ellipse});break;case"changeToEraser":this.setMemberState({currentApplianceName:B.eraser,isLine:!0});break;case"changeToHand":this.setMemberState({currentApplianceName:B.hand});break;case"changeToLaserPointer":this.setMemberState({currentApplianceName:B.laserPointer});break;case"changeToSelector":this.setMemberState({currentApplianceName:B.selector});break;case"changeToRectangle":this.setMemberState({currentApplianceName:B.rectangle});break;case"changeToStraight":this.setMemberState({currentApplianceName:B.straight});break;case"redo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.redo();break;case"undo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.undo();break;case"changeToText":this.setMemberState({currentApplianceName:B.text})}}},{key:"checkHotkey",value:function(e){var t,r=f(this.roomHotkeyCheckers);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.kind;if((0,n.checker)({nativeEvent:e,kind:this.getEventKey(e),key:e.key,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},this.keyboardKind))return i}}catch(e){r.e(e)}finally{r.f()}}},{key:"copySelectorToTemp",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(W.CopyNode);if(i&&this.collector&&o){var a=this.collector.transformKey(Ca),s=this.collector.getStorageData(e,t);if(s){var u=s[a],l=u&&o.copySelector({viewId:e,store:u});l&&(this.tmpCopyCoordInfo=null==l?void 0:l.copyCoordInfo,this.tmpCopyStore=null==l?void 0:l.copyStores)}}}},{key:"pasteTempToFocusView",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(W.CopyNode);if(i&&this.tmpCopyCoordInfo&&this.tmpCopyStore.size&&this.collector&&o&&i.viewData&&this.tmpCopyCoordInfo){var a=R.cloneDeep(this.tmpCopyCoordInfo.offset),s=this.tmpCopyCoordInfo.cameraOpt,u=i.viewData.camera;a.x=a.x+u.centerX-s.centerX,a.y=a.y+u.centerY-s.centerY;var l=Date.now();this.control.worker.internalMsgEmitter.emit("addUndoTicker",l,e),o.pasteSelector({viewId:e,scenePath:t,copyStores:R.cloneDeep(this.tmpCopyStore),copyCoordInfo:{offset:a,cameraOpt:u},undoTickerId:l})}}},{key:"setMemberState",value:function(e){var t;null==(t=this.control.room)||t.setMemberState(e)}},{key:"isUseSelf",get:function(){var e;return(null==(e=this.control.room)?void 0:e.disableDeviceInputs)||!1}},{key:"isSelector",get:function(){var e;return(null==(e=this.control.worker.currentToolsData)?void 0:e.toolsType)===H.Selector}},{key:"collector",get:function(){return this.control.collector}},{key:"mainEngine",get:function(){return this.control.worker}},{key:"keyboardKind",get:function(){return/^Mac/i.test(navigator.platform)?"mac":"windows"}}]),e}(),yl=function(){function e(t){S(this,e),I(this,"control"),I(this,"roomMemberManager"),I(this,"worker"),I(this,"writeableUids",new Set),I(this,"readonlyUids",new Set),I(this,"renderUids",new Map),I(this,"pageAuth",new Map),I(this,"isCurWrite",!0),I(this,"isLocalRender",!1);var r=t.control;this.control=r,this.roomMemberManager=r.roomMember,this.worker=r.worker}return M(e,[{key:"addPage",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e.viewId,o=e.render,a=void 0===o?"localSelf":o,s=e.elementIds,u=e.pageId,l=void 0===u?null==(t=this.control.collector)?void 0:t.uid:u,c=this.pageAuth.get(i)||new Map,h=this.control.viewContainerManager.getCurScenePath(i);if(h&&l){var d=c.get(h)||{render:"localSelf",pages:new Map};n&&(d.render=a);var f=d.pages.get(l)||new Set;f.size&&this.delElementIds(i,h,f);var p=s&&this.cloneElementIds(i,h,s,l)||new Set;d.pages.set(l,p),c.set(h,d),this.pageAuth.set(i,c)}n&&this.pageAuthEffect(i),this.isLocalRender=!1;var v=this.serializablePageData(i);null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthPage,viewId:i,pageData:v},!0)}},{key:"delPage",value:function(e,t){var r,n,i=this.pageAuth.get(t);if(i){var o=u(i.keys()).find((function(t){var r=i.get(t);return!(!r||!r.pages.has(e))}));if(o){var a=i.get(o);if(a){var s=a.render,l=a.pages,c="localSelf"===s?null==(r=this.control.collector)?void 0:r.uid:s,h=l.get(e);null!=h&&h.size&&this.delElementIds(t,o,h),l.delete(e),c===e&&this.pageAuthEffect(t)}var d=this.serializablePageData(t);null==(n=this.control.collector)||n.dispatchAuth({type:X.AuthPage,viewId:t,pageData:d},!0)}}}},{key:"delViewPage",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pageAuth.get(e)){if(r)return this.pageAuth.delete(e),void(null==(t=this.control.collector)||t.dispatchAuth({type:X.AuthPage,viewId:e},r));this.pageAuth.delete(e)}}},{key:"clearRenderPage",value:function(e,t){var r,n,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this.pageAuth.get(e);if(o){var a=o.get(t);if(a){var s=a.render,u=a.pages,l="localSelf"===s?null==(r=this.control.collector)?void 0:r.uid:s;if(l){if(i){var c=u.get(l);c&&this.delElementIds(e,t,c)}u.set(l,new Set)}}if(i){var h=this.serializablePageData(e);null==(n=this.control.collector)||n.dispatchAuth({type:X.AuthPage,viewId:e,pageData:h},i)}}}},{key:"hasPage",value:function(e,t,r){var n=this.pageAuth.get(t);if(!n)return!1;var i=n.get(r);return!!i&&i.pages.has(e)}},{key:"getPageInfo",value:function(e,t,r){var n=this.pageAuth.get(t);if(n){var i=n.get(r);return i?i.pages.get(e):void 0}}},{key:"addRenderPageElementId",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.viewId,a=e.elementId,s=e.scenePath,u=this.pageAuth.get(o);if(!u)throw new Error("no view info in viewId: ".concat(o));var l=u.get(s);if(l){var c=l.render,h=l.pages,d="localSelf"===c?null==(t=this.control.collector)?void 0:t.uid:c;if(d&&h.has(d)){var f=h.get(d)||new Set;f.add(a),h.set(d,f)}}if(i&&this.pageAuthEffect(o),n){var p=this.serializablePageData(o);null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthPage,viewId:o,pageData:p},n)}}},{key:"delRenderPageElementId",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.viewId,a=e.elementId,s=e.scenePath,u=this.pageAuth.get(o);if(!u)throw new Error("no view info in viewId: ".concat(o));var l=u.get(s);if(l){var c=l.render,h=l.pages,d="localSelf"===c?null==(t=this.control.collector)?void 0:t.uid:c;if(d&&h.has(d)){var f=h.get(d);f&&(f.delete(a),h.set(d,f))}}if(i&&this.pageAuthEffect(o),n){var p=this.serializablePageData(o);null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthPage,viewId:o,pageData:p},n)}}},{key:"setPageRender",value:function(e,t,r){var n,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.pageAuth.get(e);if(!o)throw new Error("no view info in viewId: ".concat(e));var a=o.get(t);if(a&&(a.render=r),t===this.control.viewContainerManager.getCurScenePath(e)&&this.pageAuthEffect(e),i||(this.isLocalRender=!0),i){this.isLocalRender=!1;var s=this.serializablePageData(e);null==(n=this.control.collector)||n.dispatchAuth({type:X.AuthPage,viewId:e,pageData:s},i)}}},{key:"onSetWriteable",value:function(e){var t,r=!1;e!==this.isCurWrite&&(r=!0),this.isCurWrite=e;var n=null==(t=this.control.collector)?void 0:t.uid;n&&this.publishOneWriteAble(n,e?"write":"readOnly",r)}},{key:"getCurWriteable",value:function(){return this.isCurWrite}},{key:"isWriteable",value:function(e){return!(!R.isSet(this.readonlyUids)||this.readonlyUids.has(e))||!(!R.isSet(this.writeableUids)||!this.writeableUids.has(e))}},{key:"isRenderAble",value:function(e){var t,r,n=e.uid,i=e.viewId,o=e.filterLocalSelf,a=void 0===o||o,s=e.scenePath,u=this.renderUids.get(i);if(u){var l=u.render,c=u.hide;if(void 0===l&&void 0===c)return!0;if(R.isSet(l)){if(l.has(n)||a&&(null==(t=this.control.collector)?void 0:t.uid)===n&&l.has("localSelf"))return!0}else if(!0===l&&(!c||R.isSet(c)&&!c.has(n)&&(!a||!c.has("localSelf")||(null==(r=this.control.collector)?void 0:r.uid)!==n)))return!0;return!1}var h=this.pageAuth.get(i);if(h&&s){var d=h.get(s);if(d){var f=d.render;if(f)return!("localSelf"===f&&!a)}}return!0}},{key:"isClearAble",value:function(e){var t,r=e.uid,n=e.viewId,i=e.filterLocalSelf,o=void 0===i||i,a=e.scenePath,s=this.renderUids.get(n);if(s){var u=s.clear;return!!(void 0===u||!0===u||R.isSet(u)&&(u.has(r)||o&&(null==(t=this.control.collector)?void 0:t.uid)===r&&u.has("localSelf")))}var l=this.pageAuth.get(n);if(l&&a){var c=l.get(a);if(c){var h=c.render;if(h)return!("localSelf"===h&&!o)}}return!0}},{key:"isFilterAble",value:function(e,t){var r,n,i,o,a=e.viewId,s=e.scenePath,u=e.elementId,l=this.renderUids.get(a);if(l&&u){var c=l.render,h=l.hide;if(void 0===c&&void 0===h)return!0;var d=null==(r=this.control.collector)?void 0:r.getUidFromKey(u);return!!d&&!((!R.isSet(c)||!(c.has(d)||c.has("localSelf")&&(null==(n=this.control.collector)?void 0:n.uid)===d))&&(!0!==c||h&&(!R.isSet(h)||h.has(d)||h.has("localSelf")&&(null==(i=this.control.collector)?void 0:i.uid)===d)))}var f=this.pageAuth.get(a);if(f&&s&&u){var p=f.get(s);if(p){var v=p.render,m=p.pages;if(!v)return!0;var g=null==(o=this.control.collector)?void 0:o.uid,y="localSelf"===v?g:v,_=y&&m.get(y)||void 0;if(_){if(t===X.RemoveNode)return!0;return _.has(u)}return!1}}return!0}},{key:"isFilterCursor",value:function(e){if(this.isUsePageAuth(e)){var t=this.control.viewContainerManager.getCurScenePath(e),r=this.pageAuth.get(e);if(t&&r){var n=r.get(t);if(n)return"localSelf"!==n.render}}return!0}},{key:"isUsePageAuth",value:function(e){var t;if(!this.pageAuth.has(e))return!1;var r=this.control.viewContainerManager.getCurScenePath(e);return r&&(null==(t=this.pageAuth.get(e))?void 0:t.has(r))||!1}},{key:"publishWriteAble",value:function(e,t){var r;if(!0===e)this.writeableUids=!0;else if(R.isArray(e)){var n=new Set(e);this.writeableUids=n}else this.writeableUids=new Set;if(!0===t)this.readonlyUids=!0;else if(R.isArray(t)){var i=new Set(t);this.readonlyUids=i}else this.readonlyUids=new Set;null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthWriter,writeData:{writable:e,readOnly:t}}),this.writeEffect()}},{key:"publishOneWriteAble",value:function(e,t){var r,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(R.isString(e)){switch(t){case"write":R.isSet(this.writeableUids)&&this.writeableUids.add(e),R.isSet(this.readonlyUids)&&this.readonlyUids.has(e)&&this.readonlyUids.delete(e);break;case"readOnly":R.isSet(this.readonlyUids)&&this.readonlyUids.add(e),R.isSet(this.writeableUids)&&this.writeableUids.has(e)&&this.writeableUids.delete(e)}n&&(null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthWriter,writeData:{writable:!0===this.writeableUids||Array.from(this.writeableUids),readOnly:!0===this.readonlyUids||Array.from(this.readonlyUids)}})),this.writeEffect()}}},{key:"publishRender",value:function(e){var t,r=e.viewId,n=e.option,i=e.isSync,o=void 0===i||i;if(n){var a={},s=n.render,u=n.hide,l=n.clear;s&&(a.render=!0===s||new Set(s)),u&&(a.hide=!0===u||new Set(u)),l&&(a.clear=!0===l||new Set(l)),this.renderUids.set(r,a)}else this.renderUids.delete(r);o&&(null==(t=this.control.collector)||t.dispatchAuth({type:X.AuthReader,viewId:r,renderData:n},o)),this.renderEffect(r)}},{key:"publishOneRender",value:function(e,t,r){var n,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.renderUids.get(e);switch(r){case"show":o?(o.render||(o.render=new Set),R.isSet(o.render)&&o.render.add(t),R.isSet(o.hide)&&o.hide.delete(t)):this.renderUids.set(e,{render:new Set([t])});break;case"hide":o?(o.hide||(o.hide=new Set),R.isSet(o.hide)&&o.hide.add(t),R.isSet(o.render)&&o.render.delete(t)):this.renderUids.set(e,{hide:new Set([t])})}if(o?this.renderUids.set(e,o):this.renderUids.delete(e),i){var a={};if(o)for(var s=0,u=Object.keys(o);s3&&void 0!==arguments[3])||arguments[3],o=this.renderUids.get(e);if(r?o?(o.clear||(o.clear=new Set),R.isSet(o.clear)&&o.clear.add(t)):this.renderUids.set(e,{clear:new Set([t])}):o&&R.isSet(o.clear)&&o.clear.has(t)&&o.clear.delete(t),o?this.renderUids.set(e,o):this.renderUids.delete(e),i){var a={};if(o)for(var s=0,u=Object.keys(o);s2&&void 0!==arguments[2]&&arguments[2],n=!1;if(t){for(var i=this.pageAuth.get(e)||new Map,a=0,s=Object.entries(t);a1&&void 0!==arguments[1]&&arguments[1];R.isSet(this.readonlyUids)&&null!=(t=this.readonlyUids)&&t.has(e)&&(this.renderUids.delete(e),n||null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthReader,viewId:e})),this.pageAuth.has(e)&&this.control.renderControl.delViewPage(e,!n)}},{key:"renderEffect",value:function(e){var t,r=this,n=null==(t=this.control.viewContainerManager.getView(e))?void 0:t.focusScenePath;n&&this.worker.clearViewScenePath(e,!0).then((function(){var t;r.worker.pullServiceData(e,n,{isAsync:!0,useAnimation:!1}),r.worker.sendClearUids(e,null==(t=r.renderUids.get(e))?void 0:t.clear)}))}},{key:"writeEffect",value:function(){var e,t,r,n,i,o=this.writeableUids,a=this.readonlyUids;if(null!=(e=this.control.collector)&&e.uid){if(!0===o)return R.isSet(a)&&a.has(this.control.collector.uid)?void(null==(t=this.control.room)||t.setWritable(!1)):void(null==(r=this.control.room)||r.setWritable(!0));if(R.isSet(o)){if(o.has(this.control.collector.uid))return void(null==(n=this.control.room)||n.setWritable(!0));if(R.isSet(a)&&a.has(this.control.collector.uid)||!0===a)return void(null==(i=this.control.room)||i.setWritable(!1))}}}},{key:"pageAuthEffect",value:function(e){var t,r=this,n=null==(t=this.control.viewContainerManager.getView(e))?void 0:t.focusScenePath;n&&this.worker.clearViewScenePath(e,!0).then((function(){r.worker.pullServiceData(e,n,{isAsync:!0,useAnimation:!1}),r.worker.sendClearUids(e,!0)}))}},{key:"serializablePageData",value:function(e){var t,r,n,i=this.pageAuth.get(e);if(i){var a,s={},u=f(i);try{for(u.s();!(a=u.n()).done;){var l,c=o(a.value,2),h=c[0],d=c[1],p=d.render,v=d.pages,m={},g=f(v);try{for(g.s();!(l=g.n()).done;){var y=o(l.value,2),_=y[0],b=y[1];m[_]=Array.from(b)}}catch(e){g.e(e)}finally{g.f()}var x=this.isLocalRender&&(null==(n=null==(r=null==(t=this.control.collector)?void 0:t.authStorage.pageAuth)?void 0:r[e])?void 0:n[h].render)||p;s[h]={render:x,pages:m}}}catch(e){u.e(e)}finally{u.f()}return s}}},{key:"cloneElementIds",value:function(e,t,r,n){var i,o,a=null==(i=this.control.collector)?void 0:i.getStorageData(e,t),s=new Set;if(a)for(var u=0,l=Object.keys(a);u1&&void 0!==arguments[1])||arguments[1],i=null==(t=this.collector)?void 0:t.uid;i&&(null==(r=this.renderControl)||r.publishOneWriteAble(i,e?"write":"readOnly",n))}},{key:"filterRenderByUid",value:function(e,t){var r,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.viewContainerManager.getView(e)&&(null==(r=this.renderControl)||r.publishRender({viewId:e,option:t,isSync:n}))}},{key:"cancelFilterRender",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];null==(t=this.renderControl)||t.publishRender({viewId:e,isSync:r})}}]),e}();I(_l,"InternalMsgEmitter",new O);var bl=_l,xl=function(){function e(t){var r=this;S(this,e),I(this,"emitter",new O),I(this,"undoStack"),I(this,"redoStack"),I(this,"worker"),I(this,"control"),I(this,"room"),I(this,"isTicking"),I(this,"undoTickerId"),I(this,"viewId"),I(this,"scenePath"),I(this,"tickStartStorerCache"),I(this,"excludeIds",new Set),I(this,"onChangeScene",R.debounce((function(){var e=r.control.viewContainerManager.getCurScenePath(r.viewId);if(e){var t=r.undoStack.filter((function(t){return t.scenePath===e})).length,n=r.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===n&&r.tickStartStorerCache&&r.scenePath===e&&(t=1),r.emitter.emit("onCanUndoStepsUpdate",t),r.emitter.emit("onCanRedoStepsUpdate",n)}}),e.waitTime));var n=t.control,i=t.internalMsgEmitter,o=t.viewId;this.control=n,this.emitter=i,this.undoStack=[],this.redoStack=[],this.room=n.room,this.worker=n.worker,this.isTicking=!1,this.viewId=o}return M(e,[{key:"addExcludeIds",value:function(e){if(this.isTicking){var t,r=f(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.excludeIds.add(n)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"undoTickerStart",value:function(e,t){if(this.collector&&(this.undoTickerId!==e||this.scenePath!==t)){!this.undoTickerId&&!this.tickStartStorerCache&&!this.scenePath&&this.emitter.emit("onCanUndoStepsUpdate",1),this.undoTickerId&&this.viewId&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath),this.isTicking=!0;var r=this.collector.transformKey(Ca);this.excludeIds.add(r),this.undoTickerId=e,this.scenePath=t;var n=this.collector.getStorageData(this.viewId,t)||{};this.tickStartStorerCache=new Map(Object.entries(R.cloneDeep(n)))}}},{key:"undoTickerEndSync",value:function(t,r,n){var i,o;if(t===this.undoTickerId&&n===this.scenePath&&r===this.viewId&&this.tickStartStorerCache){var a=(null==(i=this.collector)?void 0:i.storage[r])&&(null==(o=this.collector)?void 0:o.storage[r][n])||{},s=this.diffFun(this.tickStartStorerCache,new Map(Object.entries(a)));s.size&&(this.undoStack.push({id:t,type:2,data:R.cloneDeep(s),scenePath:n}),this.undoStack.length>e.MaxStackLength&&this.undoStack.shift(),this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)),this.redoStack.length&&(this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)),this.isTicking=!1,this.scenePath=void 0,this.tickStartStorerCache=void 0,this.undoTickerId=void 0,this.excludeIds.clear()}}},{key:"undo",value:function(e){this.undoTickerId&&this.tickStartStorerCache&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath);for(var t=this.undoStack.length-1;t>=0;){if(this.undoStack[t].scenePath===e){var r=this.undoStack[t];r&&(this.redoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r)),this.undoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),n}},{key:"redo",value:function(e){for(var t=this.redoStack.length-1;t>=0;){if(this.redoStack[t].scenePath===e){var r=this.redoStack[t];r&&(!this.undoTickerId&&r.tickStartStorerCache?(this.undoTickerId=r.id,this.tickStartStorerCache=r.tickStartStorerCache,this.scenePath=r.scenePath):this.undoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r,!0)),this.redoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),i}},{key:"clear",value:function(){this.clearUndo(),this.clearRedo()}},{key:"clearUndo",value:function(){this.undoStack.length=0,this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)}},{key:"clearRedo",value:function(){this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)}},{key:"canUndo",value:function(){return!!this.undoStack.length}},{key:"canRedo",value:function(){return!!this.redoStack.length}},{key:"onFocusView",value:function(){var e=this.control.viewContainerManager.getCurScenePath(this.viewId);if(e){var t=this.undoStack.filter((function(t){return t.scenePath===e})).length,r=this.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===r&&this.tickStartStorerCache&&this.scenePath===e&&(t=1),this.emitter.emit("onCanUndoStepsUpdate",t),this.emitter.emit("onCanRedoStepsUpdate",r)}}},{key:"diffFun",value:function(e,t){var r,n=new Set,i=e.keys(),o=t.keys(),a=f(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!this.excludeIds.has(s)){var u=e.get(s),l=t.get(s);if(u&&l){if(R.isEqual(l,u))continue;n.add({dataType:3,key:s,data:[u,l]})}else u&&n.add({dataType:2,key:s,data:u})}}}catch(e){a.e(e)}finally{a.f()}var c,h=f(o);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!this.excludeIds.has(d)){var p=t.get(d);p&&!e.has(d)&&n.add({dataType:1,key:d,data:p})}}}catch(e){h.e(e)}finally{h.f()}return n}},{key:"isDrawEffectiveScene",value:function(e,t){var r=e.key;return!t.includes(r)}},{key:"isDeleteEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=f(t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===Ca&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(null!=(n=null==u?void 0:u.selectIds)&&n.includes(o))return!1}}catch(e){s.e(e)}finally{s.f()}return!0}},{key:"isOldEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=f(t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===Ca&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(null!=(n=null==u?void 0:u.selectIds)&&n.includes(o))return!1}}catch(e){s.e(e)}finally{s.f()}return!0}},{key:"isNewEffectiveScene",value:function(e,t){var r=e.key;return!!t.includes(r)}},{key:"refreshPlugin",value:function(e){var t,r,n,i,o,a,s,u,l,c,h,d,p,v,m,g,y,_,b,x,w,S=this,T=arguments.length>1&&void 0!==arguments[1]&&arguments[1],M=e.scenePath,k=e.data;if(k&&this.collector){var E,I=f(k.values());try{for(I.s();!(E=I.n()).done;){var A=E.value,C=A.dataType,P=A.data,N=A.key,O=this.collector.getStorageData(this.viewId,M),R=O&&Object.keys(O)||[];switch(C){case 1:if(T?this.isDrawEffectiveScene(A,R):this.isDeleteEffectiveScene(A,R,M))if(T&&!Array.isArray(P)){if(null!=(t=P.updateNodeOpt)&&t.useAnimation&&(P.updateNodeOpt.useAnimation=!1),(null==(r=this.collector)?void 0:r.getLocalId(N))===Ca&&null!=(n=this.collector)&&n.isOwn(A.key)){var D=P.selectIds;if(D){var L,j=R.filter((function(e){var t,r;return(null==(t=S.collector)?void 0:t.getLocalId(e))===Ca&&!(null!=(r=S.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=S.collector)?void 0:t.storage[S.viewId][M][e]})),z=!1,B=f(j);try{for(B.s();!(L=B.n()).done;)for(var U=L.value,F=0;F1&&void 0!==arguments[1]&&arguments[1],r=this.appViews.get(e);r&&(this.control.textEditorManager.clear(e,t),r.displayer.destroy(),this.appViews.delete(e))}},{key:"createMianView",value:function(e){var t=this;this.mainView=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}})}},{key:"createAppView",value:function(e){var t=this,r=e.id,n=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}});this.appViews.set(r,n)}},{key:"isAppView",value:function(e){return e!==pu&&this.appViews.has(e)}},{key:"getView",value:function(e){var t;return e===pu?this.mainView:null==(t=this.appViews)?void 0:t.get(e)}},{key:"getCurScenePath",value:function(e){var t=this.getView(e);if(t)return t.focusScenePath}},{key:"getAllViews",value:function(){return[this.mainView].concat(u(this.appViews.values()))}},{key:"setViewScenePath",value:function(e,t){var r;if(e===pu&&this.mainView)this.mainView.focusScenePath=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.focusScenePath=t)}}},{key:"setViewData",value:function(e,t){var r;if(e===pu&&this.mainView)this.mainView.viewData=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.viewData=t)}}},{key:"setFocuedViewId",value:function(e){var t;this.focuedViewId=e,this.focuedView=e===pu?this.mainView:e&&(null==(t=this.appViews)?void 0:t.get(e))||void 0,this.control.cursor.onFocusViewChange(),this.focuedView&&this.focuedView.displayer.commiter.onFocusView()}},{key:"setViewFocusScenePath",value:function(e,t){var r,n;(n=e===pu?this.mainView:null==(r=this.appViews)?void 0:r.get(e))&&(n.focusScenePath=t)}},{key:"destroy",value:function(){var e,t=this;this.internalMsgEmitter.removeAllListeners("addUndoTicker"),this.internalMsgEmitter.removeAllListeners("excludeIds"),null==(e=this.mainView)||e.displayer.destroy(),this.appViews.forEach((function(e){t.destroyAppView(e.id,!0),t.control.worker.destroyViewWorker(e.id)}))}},{key:"setFocuedViewCameraOpt",value:function(e){if(this.focuedView){var t=this.focuedView.cameraOpt;R.isEqual(t,e)||(this.focuedView.cameraOpt=e)}}},{key:"transformToOriginPoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointOnScreen(e[0],e[1]);return[n.x,n.y]}return e}},{key:"transformToScenePoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointInWorld({x:e[0],y:e[1]});return[n.x,n.y]}return e}},{key:"render",value:function(e){var t,r,n,i,o,a,s,u,l,c,h,d,p,v,m,g,y,_,b=f(e);try{for(b.s();!(_=b.n()).done;){var x=_.value,w=x.rect,S=x.imageBitmap,T=x.isClear,M=x.isUnClose,k=x.drawCanvas,E=x.clearCanvas,I=x.viewId,A=null==(t=this.getView(I))?void 0:t.displayer;if(A&&w){var C=A.dpr,P=A.canvasBgRef,N=A.canvasFloatRef,O=A.canvasServiceFloatRef,R=A.canvasTopRef,D=Math.floor(w.w*C),L=Math.floor(w.h*C),j=w.x*C,z=w.y*C;if(T){switch(E){case q.TopFloat:null==(n=null==(r=R.current)?void 0:r.getContext("2d"))||n.clearRect(j,z,D,L);break;case q.Float:null==(o=null==(i=N.current)?void 0:i.getContext("2d"))||o.clearRect(j,z,D,L);break;case q.ServiceFloat:null==(s=null==(a=O.current)?void 0:a.getContext("2d"))||s.clearRect(j,z,D,L);break;case q.Bg:null==(l=null==(u=P.current)?void 0:u.getContext("2d"))||l.clearRect(j,z,D,L)}continue}if(k&&S)switch(k){case q.TopFloat:null==(h=null==(c=R.current)?void 0:c.getContext("2d"))||h.drawImage(S,0,0,D,L,j,z,D,L);break;case q.Float:null==(p=null==(d=N.current)?void 0:d.getContext("2d"))||p.drawImage(S,0,0,D,L,j,z,D,L);break;case q.ServiceFloat:null==(m=null==(v=O.current)?void 0:v.getContext("2d"))||m.drawImage(S,0,0,D,L,j,z,D,L);break;case q.Bg:null==(y=null==(g=P.current)?void 0:g.getContext("2d"))||y.drawImage(S,0,0,D,L,j,z,D,L)}if(M)continue;null==S||S.close()}}}catch(e){b.e(e)}finally{b.f()}}},{key:"showFloatBar",value:function(e,t,r){var n=this.getView(e),i=null==n?void 0:n.displayer.vDom;i&&i.showFloatBar(t,r)}},{key:"setActiveTextEditor",value:function(e,t){var r=this.getView(e),n=null==r?void 0:r.displayer.vDom;n&&n.setActiveTextEditor(t)}}]),e}();I(Ml,"defaultCameraOpt",{centerX:0,centerY:0,scale:1}),I(Ml,"defaultScreenCanvasOpt",{autoRender:!1,contextType:"webgl2"}),I(Ml,"defaultLayerOpt",{offscreen:!0,handleEvent:!1,depth:!1});var kl=function(){function e(t,r,n){var i=this;S(this,e),I(this,"viewId"),I(this,"control"),I(this,"internalMsgEmitter"),I(this,"commiter"),I(this,"cachePoint"),I(this,"cacheCursorPoint"),I(this,"active",!0),I(this,"mousedown",(function(e){if(i.active&&0===e.button&&i.viewId){i.control.worker.checkDrawingWork(i.viewId),i.reflashContainerOffset();var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener($.Start,t,i.viewId)}})),I(this,"mousemove",(function(e){if(i.active&&i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener($.Doing,t,i.viewId)}})),I(this,"mouseup",(function(e){if(i.active&&0===e.button&&i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener($.Done,t,i.viewId),i.cachePoint=void 0}})),I(this,"touchstart",(function(e){var t;if(i.active){if(!Sl(e))return i.control.worker.unWritable(),void(i.viewId&&i.control.worker.removeDrawingWork(i.viewId));if(i.viewId){if(!i.control.worker.isAbled()){var r=null==(t=i.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&i.control.effectViewContainer(r)}i.control.worker.checkDrawingWork(i.viewId),i.reflashContainerOffset();var n=i.getPoint(e);i.cachePoint=n,n&&i.control.worker.originalEventLintener($.Start,n,i.viewId)}}})),I(this,"touchmove",(function(e){if(i.active){if(!Sl(e))return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener($.Doing,t,i.viewId)}}})),I(this,"touchend",(function(e){if(i.active){if(!Sl(e)||!i.control.worker.isAbled())return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener($.Done,t,i.viewId),i.cachePoint=void 0}}})),I(this,"cursorMouseMove",R.throttle((function(e){var t=i.getPoint(e);i.cacheCursorPoint&&R.isEqual(t,i.cacheCursorPoint)||!i.viewId||(i.cacheCursorPoint=t,t&&i.control.worker.sendCursorEvent(t,i.viewId))}),30,{leading:!1})),I(this,"cursorMouseLeave",R.throttle((function(){i.viewId&&(i.cacheCursorPoint=[void 0,void 0],i.control.worker.sendCursorEvent(i.cacheCursorPoint,i.viewId))}),30,{leading:!1})),I(this,"keydown",(function(e){i.control.hotkeyManager.colloctHotkey(e)})),this.viewId=t,this.control=r,this.internalMsgEmitter=n;var o={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new wl(o)}var t;return M(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case H.Text:case H.Pencil:case H.LaserPen:case H.Arrow:case H.Straight:case H.Rectangle:case H.Ellipse:case H.Star:case H.Polygon:case H.SpeechBalloon:case H.Eraser:case H.PencilEraser:case H.BitMapEraser:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===H.Text?"cursor-text":r===H.Eraser||r===H.PencilEraser||r===H.BitMapEraser?"cursor-eraser":r===H.Pencil||r===H.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"updateSize",value:function(){this.setCanvassStyle(),this.reflashContainerOffset()}},{key:"setViewId",value:function(e){this.viewId=e}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.control.cursor.clearViewCursor(this.viewId),this.internalMsgEmitter.removeAllListeners([G.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Tl(e);if(t&&R.isNumber(t.x)&&R.isNumber(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener($.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),e.addEventListener("touchstart",this.touchstart,{capture:!0,passive:!1}),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,{capture:!0,passive:!1}),window.addEventListener("mouseup",this.mouseup,!1),window.addEventListener("touchmove",this.touchmove,{capture:!0,passive:!1}),window.addEventListener("touchend",this.touchend,{capture:!0,passive:!1}),e.addEventListener("mousemove",this.cursorMouseMove,!1),e.addEventListener("mouseleave",this.cursorMouseLeave,!1),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}(),El=function(){function e(t,r){var n=this;S(this,e),I(this,"viewId",pu),I(this,"control"),I(this,"internalMsgEmitter"),I(this,"commiter"),I(this,"cachePoint"),I(this,"cacheCursorPoint"),I(this,"active",!0),I(this,"mousedown",(function(e){if(n.active&&0===e.button){n.control.worker.checkDrawingWork(n.viewId),n.reflashContainerOffset();var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener($.Start,t,n.viewId)}})),I(this,"mousemove",(function(e){if(n.active){var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener($.Doing,t,n.viewId)}})),I(this,"mouseup",(function(e){if(n.active&&0===e.button){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener($.Done,t,n.viewId),n.cachePoint=void 0}})),I(this,"touchstart",(function(e){var t;if(n.active){if(!Sl(e))return n.control.worker.unWritable(),void(n.viewId&&n.control.worker.removeDrawingWork(n.viewId));if(!n.control.worker.isAbled()){var r=null==(t=n.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&n.control.effectViewContainer(r)}n.control.worker.checkDrawingWork(n.viewId),n.reflashContainerOffset();var i=n.getPoint(e);n.cachePoint=i,i&&n.control.worker.originalEventLintener($.Start,i,n.viewId)}})),I(this,"touchmove",(function(e){if(n.active){if(!Sl(e))return n.control.worker.unWritable(),void(n.viewId&&n.control.worker.removeDrawingWork(n.viewId));var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener($.Doing,t,n.viewId)}})),I(this,"touchend",(function(e){if(n.active)if(Sl(e)&&n.control.worker.isAbled()){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener($.Done,t,n.viewId),n.cachePoint=void 0}else n.control.worker.removeDrawingWork(n.viewId)})),I(this,"cursorMouseMove",R.throttle((function(e){var t=n.getPoint(e);n.cacheCursorPoint&&R.isEqual(t,n.cacheCursorPoint)||(n.cacheCursorPoint=t,t&&n.control.worker.sendCursorEvent(t,n.viewId))}),30,{leading:!1})),I(this,"cursorMouseLeave",R.throttle((function(){n.cacheCursorPoint=[void 0,void 0],n.control.worker.sendCursorEvent(n.cacheCursorPoint,n.viewId)}),30,{leading:!1})),I(this,"keydown",(function(e){n.control.hotkeyManager.colloctHotkey(e)})),this.control=t,this.internalMsgEmitter=r;var i={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new wl(i)}var t;return M(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case H.Text:case H.Pencil:case H.LaserPen:case H.Arrow:case H.Straight:case H.Rectangle:case H.Ellipse:case H.Star:case H.Polygon:case H.SpeechBalloon:case H.Eraser:case H.PencilEraser:case H.BitMapEraser:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===H.Text?"cursor-text":r===H.Eraser||r===H.PencilEraser||r===H.BitMapEraser?"cursor-eraser":r===H.Pencil||r===H.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"updateSize",value:function(){this.setCanvassStyle()}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.control.cursor.destroy(),this.internalMsgEmitter.removeAllListeners([G.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Tl(e);if(t&&R.isNumber(t.x)&&R.isNumber(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener($.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,{capture:!1,passive:!1}),window.addEventListener("mouseup",this.mouseup,!1),e.addEventListener("touchstart",this.touchstart,{capture:!0,passive:!1}),window.addEventListener("touchmove",this.touchmove,{capture:!0,passive:!1}),window.addEventListener("touchend",this.touchend,{capture:!0,passive:!1}),e.addEventListener("mousemove",this.cursorMouseMove,!0),e.addEventListener("mouseleave",this.cursorMouseLeave,!0),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}(),Il="index-module__Container__nLsM3",Al="index-module__CanvasBox__j2Xe-",Cl="index-module__FloatCanvas__d1YR7",Pl="index-module__TopFloatCanvas__7IaCw",Nl="index-module__CanvasBoxSub__hcMeK",Ol="index-module__SnapshotBox__--eeE",Rl="index-module__FloatBar__cm-EL",Dl="index-module__RotateBtn__HSSkf",Ll="index-module__ResizeBtn__yjvda",jl="index-module__CursorBox__2UHvI",zl="index-module__TextEditorContainer__Qm8KC",Bl="index-module__ResizeTowBox__HOllX",Ul="index-module__FloatBarBtn__FJrOG",Fl={delete:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDZ2NmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY2aDBtMS0yYTIgMiAwIDAgMSAyLTJoMmEyIDIgMCAwIDEgMiAyaDBNMyA0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",duplicate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0xMSAySDZhMSAxIDAgMCAwLTEgMXY4YTEgMSAwIDAgMCAxIDFoNmExIDEgMCAwIDAgMS0xVjRoMGwtMi0yeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PHBhdGggZD0iTTExIDJ2MWExIDEgMCAwIDAgMSAxaDFsLTItMnoiLz48cGF0aCBkPSJNOSAxNEg0YTEgMSAwIDAgMS0xLTFWNWgwIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48L2c+PC9zdmc+","layer-pressed":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzMzODFGRiIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",layer:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",rotate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEzIDZhNiA2IDAgMSAxLTMuNzA5IDEuMjgzIi8+PHBhdGggZD0ibTEzIDYgMS40MTQgMi40NUwxMyA2bDIuNDUtMS40MTQiLz48L2c+PC9zdmc+","rotation-button":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+",rotation:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjRkZGIiBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+","font-colors-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","font-colors":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","to-bottom":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDEwdjhtMCAwLTItMm0yIDIgMi0ybS00IDZoMTJtLTYtNGg2bS02LTRoNm0tNi00aDYiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+","to-top":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDIydi04bTAgMC0yIDJtMi0yIDIgMm0tNC02aDEybS02IDRoNm0tNiA0aDZtLTYgNGg2IiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","bold-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",bold:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","underline-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",underline:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","italic-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",italic:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","unlock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiMzMzgxRkYiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0xYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDN2MyIgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+","lock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiM0NDRFNjAiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0zYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDV2MyIgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+",shapes:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","shapes-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","font-style-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","font-style":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",polygon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==","polygon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","polygon-vertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTA3NyAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU0My40NzQ1MjYgNDIuMzA3MzY4YTExOS4zNzY4NDIgMTE5LjM3Njg0MiAwIDAgMSAxMTAuODA3NTc5IDE2My44NGwxOTAuNTcxNzkgMTM4LjYxNzI2NGExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEgODMuMzc1MTU4IDIxOC43MDQ4NDJsLTc0LjMyMDg0MiAyMjguODM3MDUyYTExOS4zMjI5NDcgMTE5LjMyMjk0NyAwIDAgMS02MS4yNzgzMTYgMjIxLjg4NDYzMmMtNDYuNzgwNjMyIDAtODcuMzA5NDc0LTI2Ljk0NzM2OC0xMDYuODczMjYzLTY2LjEyODg0MmgtMjg5LjQxNDczN2ExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEtMTc5LjczODk0OC0xNDcuODMzMjYzbC03Mi4yNzI4NDItMjIyLjY5MzA1My0zLjM5NTM2OCAwLjEwNzc4OUExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAwIDEgMjEuODI3MzY4IDQ2Ni43Mjg0MjFMMjEuNTU3ODk1IDQ1OC4yMTMwNTNhMTE5LjM3Njg0MiAxMTkuMzc2ODQyIDAgMCAxIDE4My44MzQ5NDctMTAwLjUxMzY4NWwyMjMuNTAxNDc0LTE2Mi4zODQ4NDJhMTE5LjQzMDczNyAxMTkuNDMwNzM3IDAgMCAxIDExNC41ODAyMS0xNTMuMDYxMDUyek0yODkuNDE0NzM3IDg0MC4wNTcyNjNhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6IG01MDMuMTYxMjYzIDBhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6TTQ2Mi42ODYzMTYgMjQ5LjU4NjUyNkwyNDguMTMxMzY4IDQwNS41NTc4OTVhMTE5LjMyMjk0NyAxMTkuMzIyOTQ3IDAgMCAxLTQyLjg0NjMxNSAxNTMuMjIyNzM3bDcwLjcwOTg5NCAyMTcuMzU3NDczYTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMSAxMzIuNDE5MzY5IDEwOC4yMjA2MzJINjczLjY4NDIxMWExMTkuNDMwNzM3IDExOS40MzA3MzcgMCAwIDEgMTE5LjE2MTI2My0xMDguOTc1MTU4bDcxLjE0MTA1Mi0yMTguOTc0MzE2YTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMS02Mi4wODY3MzctMTY0LjIxNzI2M2wtMTg2LjM2OC0xMzUuMjc1Nzg5Yy0xOS45OTQ5NDcgMTUuMDkwNTI2LTQ1LjAwMjEwNSAyNC4xNDQ4NDItNzIuMDU3MjYzIDI0LjE0NDg0MmExMTguOTQ1Njg0IDExOC45NDU2ODQgMCAwIDEtODAuNzg4MjEtMzEuNDc0NTI3eiBtLTMyMS43NTE1NzkgMTUzLjkyMzM2OWE1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQwNjMxNiA1NC43MDMxNTggNTQuNzAzMTU4IDAgMCAwIDAtMTA5LjQwNjMxNnogbTc2Ny43MzA1MjYtMTIuNTU3NDc0YTU0LjcwMzE1OCA1NC43MDMxNTggMCAxIDAgMCAxMDkuNDA2MzE2IDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE2eiBtLTM2NS4xOTA3MzctMjg0LjAyNTI2M2E1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQ2MDIxIDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE1eiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",star:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","star-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","star-innerVertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTg1LjMzMzMzMyAwYTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODEuNDA4IDU5LjczMzMzM2g0OC4yMTMzMzR2ODUuMzMzMzM0TDE3MC42NjY2NjcgMTQ0Ljk4MTMzM1Y4NTMuMzMzMzMzaDY5My4zMzMzMzNsLTI2LjQ1MzMzMy02My40ODggNzguNzYyNjY2LTMyLjc2OCAzMi44NTMzMzQgNzguNzYyNjY3LTQyLjI0IDE3LjQ5MzMzM0g5MzguNjY2NjY3YTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODQuNzM2IDc1LjM0OTMzNEwxMDI0IDkzOC42NjY2NjdhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS0xNzAuNjY2NjY3IDBIMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxLTg1LjMzMzMzNC04NS4zMzMzMzRWMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxIDAtMTcwLjY2NjY2N3ogbTc2NS4zNTQ2NjcgNTk5LjQ2NjY2N2wzMi44NTMzMzMgNzguNzYyNjY2LTc4Ljg0OCAzMi44NTMzMzQtMzIuNzY4LTc4Ljc2MjY2NyA3OC43NjI2NjctMzIuODUzMzMzeiBtLTY1LjcwNjY2Ny0xNTcuNTI1MzM0bDMyLjg1MzMzNCA3OC43NjI2NjctNzguNzYyNjY3IDMyLjg1MzMzMy0zMi43NjgtNzguNzYyNjY2IDc4Ljc2MjY2Ny0zMi44NTMzMzR6TTcxOS4zNiAyODQuNDE2bDMyLjg1MzMzMyA3OC43NjI2NjctNzguNzYyNjY2IDMyLjg1MzMzMy0zMi44NTMzMzQtNzguNzYyNjY3IDc4Ljc2MjY2Ny0zMi44NTMzMzN6IG0tNjUuNjIxMzMzLTE1Ny41MjUzMzNsMzIuODUzMzMzIDc4Ljc2MjY2Ni03OC43NjI2NjcgMzIuODUzMzM0LTMyLjg1MzMzMy03OC43NjI2NjcgNzguNzYyNjY3LTMyLjg1MzMzM3pNMzg1LjcwNjY2NyA1OS43MzMzMzN2ODUuMzMzMzM0aC04NS4zMzMzMzR2LTg1LjMzMzMzNGg4NS4zMzMzMzR6IG0xNzAuNjY2NjY2IDB2ODUuMzMzMzM0aC04NS4zMzMzMzN2LTg1LjMzMzMzNGg4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIiA+PC9wYXRoPjwvc3ZnPg==","star-innerRatio":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU2OS4zNDQgNDQ5LjUzNmwxNDYuOTQ0IDI4LjY3MiAxLjAyNC00LjYwOHY0LjYwOGgxLjAyNGM5LjcyOCAwIDE2Ljg5Ni03LjY4IDIwLjQ4LTE0Ljg0OGwxLjAyNC0yLjA0OHYtMi41NmMwLTUuNjMyIDAtMTEuMjY0LTUuMTItMTYuMzg0LTMuMDcyLTMuMDcyLTcuMTY4LTcuMTY4LTEyLjgtNy42OGwtMTI0LjkyOC0yNC4wNjRMNTQxLjY5NiAyODYuNzJjLTIuMDQ4LTQuNjA4LTYuNjU2LTguMTkyLTExLjc3Ni05LjcyOC01LjEyLTEuNTM2LTEwLjc1Mi0xLjUzNi0xNS4zNiAxLjAyNGwtMS41MzYgMC41MTItMS4wMjQgMS4wMjRjLTguMTkyIDguMTkyLTEwLjc1MiAxOS40NTYtNi42NTYgMjcuMTM2bDY0IDE0Mi44NDh6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PHBhdGggZD0iTTkzMS4zMjggNDAzLjQ1NmMtMTAuMjQtMzUuMzI4LTM4LjQtNjEuNDQtNzEuNjgtNjYuNTZsLTE4NC44MzItMzUuODQtODIuNDMyLTE4Mi43ODRjLTEyLjgtMzMuMjgtNDYuMDgtNTYuMzItODAuMzg0LTU2LjMyLTMzLjc5MiAwLTY0LjUxMiAyMC40OC03OS44NzIgNTMuNzZMMzQ5LjE4NCAyOTkuMDA4bC0xODQuMzIgMzUuMzI4Yy0zMy43OTIgNS4xMi02MS45NTIgMzEuMjMyLTcyLjE5MiA2Ni41Ni05LjcyOCAzNC4zMDQtMS4wMjQgNzIuMTkyIDIzLjA0IDk4LjgxNmwxMzEuNTg0IDEzMy42MzItMzUuODQgMTk2LjYwOGMtNS42MzIgMzQuODE2IDguNzA0IDcxLjY4IDM1Ljg0IDk0LjIwOCAxMy44MjQgMTEuMjY0IDM0LjMwNCAxOC40MzIgNTIuMjI0IDE4LjQzMiAxNi44OTYgMCAyOS42OTYtMy4wNzIgNDEuNDcyLTEwLjI0bDE2OC45Ni05MS4xMzYgMTY2LjkxMiA5MS4xMzYgMS4wMjQgMC41MTJjMTYuODk2IDYuNjU2IDI5LjY5NiA5LjcyOCA0MC40NDggOS43MjggMTQuMzM2IDAgMjcuNjQ4LTQuMDk2IDQwLjQ0OC03LjY4IDQuNjA4LTEuNTM2IDkuNzI4LTMuMDcyIDE0Ljg0OC00LjA5NmwyLjU2LTAuNTEyIDIuMDQ4LTEuNTM2YzI1LjA4OC0yMy4wNCAzNy44ODgtNTguODggMzIuNzY4LTkzLjY5NmwtMzMuMjgtMTk2LjYwOCAxMzEuNTg0LTEzNi4xOTJjMjQuMDY0LTI3LjY0OCAzMi4yNTYtNjIuOTc2IDIyLjAxNi05OC44MTZ6TTI3Ni45OTIgODM2LjA5Nmw0MS45ODQtMjMxLjkzNi0xNTcuMTg0LTE1OS4yMzJjLTUuNjMyLTUuNjMyLTguMTkyLTE3LjQwOC02LjY1Ni0yOS4xODQgMy41ODQtMTAuMjQgMTAuMjQtMTYuMzg0IDE5LjQ1Ni0xNy45MmwyMTguMTEyLTQxLjk4NCA5Ni4yNTYtMjE1LjU1MmMzLjA3Mi03LjE2OCAxMi44LTE0LjMzNiAyMC40OC0xNC4zMzZzMTcuNDA4IDcuMTY4IDIwLjQ4IDE0Ljg0OGw5OC4zMDQgMjE1LjA0IDIxOC4xMTIgNDEuOTg0YzcuMTY4IDEuNTM2IDE1LjM2IDcuMTY4IDE2Ljg5NiAxNi4zODR2My4wNzJjMi4wNDggMTEuNzc2LTAuNTEyIDIyLjUyOC02LjY1NiAzMC43Mkw2OTkuOTA0IDYwOS4yOGwzOS45MzYgMjMxLjQyNGMxLjUzNiAxMC43NTItMi4wNDggMjAuNDgtMTAuMjQgMjcuMTM2bC0xLjAyNCAwLjUxMmMtMi41NiAyLjU2LTYuNjU2IDQuMDk2LTExLjI2NCA0LjA5Ni0yLjA0OCAwLTcuMTY4LTEuNTM2LTExLjI2NC0zLjU4NGwtMTk3LjEyLTEwOC4wMzItMTk5LjE2OCAxMDIuOTEyYy00LjA5NiAyLjA0OC05LjIxNiAzLjU4NC0xMS43NzYgMy41ODQtNC42MDggMC04LjcwNC0xLjUzNi0xMS4yNjQtNC4wOTZsLTEuMDI0LTAuNTEyYy02LjY1Ni02LjE0NC0xMC43NTItMTYuMzg0LTguNzA0LTI2LjYyNHoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=",speechBallon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=","speechBallon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48L3N2Zz4=","speechBallon-placement":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU3NiAyMTMuMzMzMzMzbDIyLjYxMzMzMyAyMi42MTMzMzRhMzIgMzIgMCAwIDAgMC00NS4yMjY2NjdMNTc2IDIxMy4zMzMzMzN6IG0tNjIuNzItMTA3Ljk0NjY2NmEzMiAzMiAwIDEgMC00NS4yMjY2NjcgNDUuMjI2NjY2bDQ1LjIyNjY2Ny00NS4yMjY2NjZ6IG0tNDUuMjI2NjY3IDE3MC42NjY2NjZhMzIgMzIgMCAwIDAgNDUuMjI2NjY3IDQ1LjIyNjY2N2wtNDUuMjI2NjY3LTQ1LjIyNjY2N3pNNDQ4IDgxMC42NjY2NjdsLTIyLjYxMzMzMy0yMi42MTMzMzRhMzIgMzIgMCAwIDAgMCA0NS4yMjY2NjdsMjIuNjEzMzMzLTIyLjYxMzMzM3ogbTEwNy45NDY2NjctNjIuNzJhMzIgMzIgMCAxIDAtNDUuMjI2NjY3LTQ1LjIyNjY2N2w0NS4yMjY2NjcgNDUuMjI2NjY3eiBtLTQ1LjIyNjY2NyAxNzAuNjY2NjY2YTMyIDMyIDAgMSAwIDQ1LjIyNjY2Ny00NS4yMjY2NjZsLTQ1LjIyNjY2NyA0NS4yMjY2NjZ6TTgxMC42NjY2NjcgNTc2bC0yMi42MTMzMzQgMjIuNjEzMzMzYTMyIDMyIDAgMCAwIDQ1LjIyNjY2NyAwTDgxMC42NjY2NjcgNTc2eiBtMTA3Ljk0NjY2Ni02Mi43MmEzMiAzMiAwIDEgMC00NS4yMjY2NjYtNDUuMjI2NjY3bDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAtNDUuMjI2NjY3IDQ1LjIyNjY2N2w0NS4yMjY2NjctNDUuMjI2NjY3ek0yMTMuMzMzMzMzIDQ0OGwyMi42MTMzMzQtMjIuNjEzMzMzYTMyIDMyIDAgMCAwLTQ1LjIyNjY2NyAwbDIyLjYxMzMzMyAyMi42MTMzMzN6IG02Mi43MiAxMDcuOTQ2NjY3YTMyIDMyIDAgMCAwIDQ1LjIyNjY2Ny00NS4yMjY2NjdsLTQ1LjIyNjY2NyA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAgNDUuMjI2NjY2IDQ1LjIyNjY2N2wtNDUuMjI2NjY2LTQ1LjIyNjY2N3pNMzA5LjMzMzMzMyAyMTMuMzMzMzMzQTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMjM0LjY2NjY2NyAyODh2NjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDM3My4zMzMzMzMgMjEzLjMzMzMzM2gtNjR6TTIzNC42NjY2NjcgMjg4QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMTYwIDIxMy4zMzMzMzNoLTY0QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAyMzQuNjY2NjY3IDM1MnYtNjR6TTE2MCAyMTMuMzMzMzMzYzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2NnYtNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDk2IDIxMy4zMzMzMzNoNjR6TTIzNC42NjY2NjcgMTM4LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NiA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIzNC42NjY2NjcgNzQuNjY2NjY3djY0ek0zNDEuMzMzMzMzIDI0NS4zMzMzMzNoMjM0LjY2NjY2N3YtNjRIMzQxLjMzMzMzM3Y2NHogbTI1Ny4yOC01NC42MTMzMzNsLTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NiA4NS4zMzMzMzQgODUuMzMzMzM0IDQ1LjIyNjY2Ni00NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsLTg1LjMzMzMzNCA4NS4zMzMzMzMgNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2Njd6TTY1MC42NjY2NjcgODEwLjY2NjY2N2ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2NiAxMzguNjY2NjY2di02NEE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxIDcxNC42NjY2NjcgODEwLjY2NjY2N2gtNjR6IG0xMzguNjY2NjY2IDEzOC42NjY2NjZBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDkyOCA4MTAuNjY2NjY3aC02NGE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxLTc0LjY2NjY2NyA3NC42NjY2NjZ2NjR6TTkyOCA4MTAuNjY2NjY3YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY3LTEzOC42NjY2Njd2NjRjNDEuMjE2IDAgNzQuNjY2NjY3IDMzLjQ1MDY2NyA3NC42NjY2NjcgNzQuNjY2NjY3aDY0eiBtLTEzOC42NjY2NjctMTM4LjY2NjY2N0ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgNjUwLjY2NjY2NyA4MTAuNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY2LTc0LjY2NjY2N3YtNjR6IG0tMTA2LjY2NjY2NiAxMDYuNjY2NjY3aC0yMzQuNjY2NjY3djY0SDY4Mi42NjY2Njd2LTY0eiBtLTIxMi4wNTMzMzQgNTQuNjEzMzMzbDg1LjMzMzMzNC04NS4zMzMzMzMtNDUuMjI2NjY3LTQ1LjIyNjY2Ny04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsODUuMzMzMzMzIDg1LjMzMzMzMyA0NS4yMjY2NjctNDUuMjI2NjY2LTg1LjMzMzMzNC04NS4zMzMzMzQtNDUuMjI2NjY2IDQ1LjIyNjY2N3pNNjcyIDIzNC42NjY2NjdBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDgxMC42NjY2NjcgMzczLjMzMzMzM3YtNjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjctNzQuNjY2NjY2aC02NHpNODEwLjY2NjY2NyAzNzMuMzMzMzMzYTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAxMzguNjY2NjY2LTEzOC42NjY2NjZoLTY0QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgODEwLjY2NjY2NyAzMDkuMzMzMzMzdjY0eiBtMTM4LjY2NjY2Ni0xMzguNjY2NjY2QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCA4MTAuNjY2NjY3IDk2djY0YzQxLjIxNiAwIDc0LjY2NjY2NyAzMy40NTA2NjcgNzQuNjY2NjY2IDc0LjY2NjY2N2g2NHpNODEwLjY2NjY2NyA5NmExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAtMTM4LjY2NjY2NyAxMzguNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2N3YtNjR6TTc3OC42NjY2NjcgMzQxLjMzMzMzM3YyMzQuNjY2NjY3aDY0VjM0MS4zMzMzMzNoLTY0eiBtNTQuNjEzMzMzIDI1Ny4yOGw4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2NjctODUuMzMzMzM0IDg1LjMzMzMzNCA0NS4yMjY2NjcgNDUuMjI2NjY2eiBtMC00NS4yMjY2NjZsLTg1LjMzMzMzMy04NS4zMzMzMzQtNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2Ny00NS4yMjY2NjZ6TTEzOC42NjY2NjcgNzg5LjMzMzMzM2MwLTQxLjIxNiAzMy40NTA2NjctNzQuNjY2NjY3IDc0LjY2NjY2Ni03NC42NjY2NjZ2LTY0YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY2IDEzOC42NjY2NjZoNjR6TTIxMy4zMzMzMzMgNzE0LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NyA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIxMy4zMzMzMzMgNjUwLjY2NjY2N3Y2NHogbTc0LjY2NjY2NyA3NC42NjY2NjZBNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMSAyMTMuMzMzMzMzIDg2NHY2NGExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2Ny0xMzguNjY2NjY3aC02NHpNMjEzLjMzMzMzMyA4NjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjYtNzQuNjY2NjY3aC02NEExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMjEzLjMzMzMzMyA5Mjh2LTY0ek0yNDUuMzMzMzMzIDY4Mi42NjY2Njd2LTIzNC42NjY2NjdoLTY0VjY4Mi42NjY2NjdoNjR6IG0tNTQuNjEzMzMzLTIxMi4wNTMzMzRsODUuMzMzMzMzIDg1LjMzMzMzNCA0NS4yMjY2NjctNDUuMjI2NjY3LTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NnogbTAtNDUuMjI2NjY2bC04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2NjcgODUuMzMzMzM0LTg1LjMzMzMzNC00NS4yMjY2NjctNDUuMjI2NjY2eiIgIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4="};function Wl(e){return Fl[e]}var Gl=function(e){var t=e.workIds,r=e.mananger;return L.createElement("div",{className:"button normal-button",style:{touchAction:"none"},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.DeleteNode,{workIds:t||[Ca],viewId:r.viewId})},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.DeleteNode,{workIds:t||[Ca],viewId:r.viewId})}},L.createElement("img",{alt:"icon",src:Wl("delete")}))},Vl=function(e){var t=e.workIds,r=e.viewId;return L.createElement("div",{className:"button normal-button",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.CopyNode,{workIds:t||[Ca],viewId:r})},onTouchEnd:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.CopyNode,{workIds:t||[Ca],viewId:r})}},L.createElement("img",{alt:"icon",src:Wl("duplicate")}))},Hl=function(e){var t=e.icon,r=e.onClickHandler,n=e.onTouchEndHandler;return L.createElement("div",{className:"button normal-button",onClick:r,onTouchEnd:n},L.createElement("img",{src:Wl(t)}))},Yl=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=L.useContext(Hc),a=i.floatBarData,s=i.mananger,u=o(L.useState([]),2),l=u[0],c=u[1],h=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==a?void 0:a.y)&&null!=s&&s.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>180){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==s?void 0:s.height)-n.current.offsetTop-a.y<120){var t={top:"inherit",bottom:50};return t}}}),[null==n?void 0:n.current,a,s]),d=L.useMemo((function(){return t?L.createElement("div",{className:"image-layer-menu",style:h},L.createElement(Hl,{icon:"to-top",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Top,viewId:null==s?void 0:s.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Top,viewId:null==s?void 0:s.viewId})}}),L.createElement(Hl,{icon:"to-bottom",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Bottom,viewId:null==s?void 0:s.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Bottom,viewId:null==s?void 0:s.viewId})}})):null}),[t,h]);return L.useEffect((function(){R.isEqual(null==a?void 0:a.selectIds,l)||null!=a&&a.selectIds&&!R.isEqual(null==a?void 0:a.selectIds,l)&&(c(null==a?void 0:a.selectIds),r(!1))}),[t,a,l,r]),L.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},d,L.createElement("img",{alt:"icon",src:Wl(t?"layer-pressed":"layer")}))},$l=function(){return L.createElement("svg",{style:{marginLeft:"2px"},viewBox:"0 0 1025 1024",width:"14",height:"14"},L.createElement("path",{d:"M1016.5248 493.8752c-9.984-9.984-26.2144-9.984-36.1984 0l-183.6032 183.6032c-29.952 29.952-78.6944 29.952-108.5952 0l-239.2064-239.2064c-14.4384-14.4384-22.3744-33.6896-22.3744-54.3232s7.936-39.8848 22.3744-54.3232l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984s-26.2144-9.984-36.1984 0l-183.6032 183.6032c-24.1152 24.1152-37.376 56.2176-37.376 90.5216 0 14.592 2.4576 28.8256 7.0656 42.1888l-374.8864 374.8864c-4.8128 4.8128-7.4752 11.3152-7.4752 18.1248l0 76.8c0 14.1312 11.4688 25.6 25.6 25.6l486.4 0c6.8096 0 13.312-2.7136 18.1248-7.4752l170.0864-170.0864c13.3632 4.6592 27.5968 7.0656 42.1888 7.0656 34.2528 0 66.4064-13.2608 90.5216-37.376l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984zM501.4016 870.4l-450.2016 0 0-40.6016 358.5024-358.5024c1.024 1.0752 1.9968 2.1504 3.0208 3.1744l239.2064 239.2064c1.024 1.024 2.0992 2.048 3.1744 3.0208l-153.7024 153.7024z",fill:"#000000"}))},Xl=function(e){var t=e.activeColor,r=e.onClickHandler,n=e.onTouchEndHandler;return L.createElement("div",{className:"font-color-button ".concat("transparent"===t?"active":""),onClick:r,onTouchEnd:n},L.createElement("div",{className:"circle none"}))},ql=function(e){var t=e.color,r=e.activeColor,n=e.onClickHandler,i=e.onTouchEndHandler;return L.createElement("div",{className:"font-color-button ".concat(t===r?"active":""),onClick:n,onTouchEnd:i},L.createElement("div",{className:"circle",style:{backgroundColor:wu(t,1)}}))},Ql=function(e){var t=e.opacity,r=e.activeColor,n=e.setCurOpacity,i=o(L.useState({x:108,y:0}),2),a=i[0],s=i[1];if(L.useEffect((function(){s({x:100*t+8,y:0})}),[]),!r)return null;var u=R.throttle((function(e,i){e.cancelable&&e.preventDefault(),e.stopPropagation(),i.x!==(null==a?void 0:a.x)&&s({x:i.x,y:0});var o=Math.min(Math.max(i.x-8,0),100)/100;t!==o&&n(o,r,$.Doing)}),100,{leading:!1}),l=R.throttle((function(e,t){e.cancelable&&e.preventDefault(),e.stopPropagation(),t.x!==(null==a?void 0:a.x)&&s({x:t.x,y:0});var i=Math.min(Math.max(t.x-8,0),100)/100;n(i,r,$.Done)}),100,{leading:!1});return L.createElement("div",{className:"font-color-opacity",style:{marginLeft:"10px"},onClick:function(e){var t=e.nativeEvent.offsetX,i=Math.min(Math.max(t-12,0),100)/100;s({x:100*i+8,y:0}),n(i,r,$.Done)}},L.createElement("div",{className:"range-color",style:{background:"linear-gradient(to right, ".concat(wu(r,0),", ").concat(wu(r,1),")")}}),L.createElement("div",{className:"range-opacity"},L.createElement(j,{bounds:"parent",axis:"x",position:a,onDrag:u,onStart:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t,r,$.Start)},onStop:l},L.createElement("div",{className:"circle",style:{backgroundColor:wu(r,t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}}))))},Zl=function(e){var t=e.min,r=e.max,n=e.activeNumber,i=e.setActiveNumber,a=e.color,s=o(L.useState({x:108,y:0}),2),u=s[0],l=s[1];if(L.useEffect((function(){var e=Math.ceil((n-t)/(r-t)*100)+8;l({x:e,y:0})}),[]),!n)return null;var c=R.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation(),o.x!==(null==u?void 0:u.x)&&l({x:o.x,y:0});var a=Math.ceil(Math.max(o.x-8,0)/100*(r-t)+t);n!==a&&i(a,$.Doing)}),100,{leading:!1}),h=R.throttle((function(e,n){e.cancelable&&e.preventDefault(),e.stopPropagation(),n.x!==(null==u?void 0:u.x)&&l({x:n.x,y:0});var o=Math.ceil(Math.max(n.x-8,0)/100*(r-t)+t);i(o,$.Done)}),100,{leading:!1});return L.createElement("div",{className:"font-color-opacity",style:{marginLeft:"10px"},onClick:function(e){var n=e.nativeEvent.offsetX,o=Math.ceil(Math.max(n-12,0)/100*(r-t)+t),a=Math.ceil((o-t)/(r-t)*100)+8;l({x:a,y:0}),i(o,$.Done)}},L.createElement("div",{className:"range-color",style:{backgroundColor:a}}),L.createElement("div",{className:"range-opacity"},L.createElement(j,{bounds:"parent",axis:"x",position:u,onDrag:c,onStart:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),i(n,$.Start)},onStop:h},L.createElement("div",{className:"circle",style:{backgroundColor:a},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}},L.createElement("div",{className:"range-opacity-data-icon"},n)))))},Kl=function(e){var t=e.useStroke,r=e.color,n=e.activeStrokeType,i=e.setStrokeType;return L.createElement("div",{className:"stroke-type-box"},!!t&&L.createElement("div",{className:"stroke-type-box-item Stroke ".concat(n===U.Stroke&&"active"),style:{backgroundColor:r},onClick:function(){i(U.Stroke)},onTouchEnd:function(){i(U.Stroke)}}),L.createElement("div",{className:"stroke-type-box-item Normal ".concat(n===U.Normal&&"active"),style:{borderColor:r},onClick:function(){i(U.Normal)},onTouchEnd:function(){i(U.Normal)}}),L.createElement("div",{className:"stroke-type-box-item Dotted ".concat(n===U.Dotted&&"active"),style:{borderColor:r},onClick:function(){i(U.Dotted)},onTouchEnd:function(){i(U.Dotted)}}),L.createElement("div",{className:"stroke-type-box-item LongDotted ".concat(n===U.LongDotted&&"active"),style:{borderColor:r},onClick:function(){i(U.LongDotted)},onTouchEnd:function(){i(U.LongDotted)}}))},Jl=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=L.useContext(Hc),a=i.floatBarData,s=i.floatBarColors,l=i.mananger,c=i.setFloatBarData,h=o(L.useState(),2),d=h[0],f=h[1],p=o(L.useState(1),2),v=p[0],m=p[1];L.useEffect((function(){if(null!=a&&a.strokeColor){var e=o(Tu(a.strokeColor),2),t=e[0],r=e[1];f(t),m(r)}}),[a]);var g=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==a?void 0:a.y)&&null!=l&&l.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>180){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==l?void 0:l.height)-n.current.offsetTop-a.y<120){var t={top:"inherit",bottom:50};return t}}}),[(null==n?void 0:n.current)&&a,null==l?void 0:l.height]),y=L.useMemo((function(){return L.createElement(Ql,{key:"strokeColors",opacity:v,activeColor:d,setCurOpacity:function(e,t,r){r===$.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===$.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),m(e);var n=wu(t,e);null!=a&&a.strokeColor&&c({strokeColor:n}),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],strokeColor:n,workState:r,viewId:null==l?void 0:l.viewId})}})}),[v,d,null==l?void 0:l.control.room,null==l?void 0:l.viewId,a]),_=L.useMemo((function(){return d&&null!=a&&a.thickness?L.createElement(Zl,{key:"strokeThickness",min:1,max:10,activeNumber:a.thickness,setActiveNumber:function(e,t){t===$.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),t===$.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),null!=a&&a.thickness&&c({thickness:e}),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],thickness:e,workState:t,viewId:null==l?void 0:l.viewId})},color:d}):null}),[d,null==a?void 0:a.thickness,null==l?void 0:l.control.room,null==l?void 0:l.viewId]),b=L.useMemo((function(){return d&&null!=a&&a.strokeType?L.createElement(Kl,{key:"strokeType",useStroke:null==a?void 0:a.useStroke,activeStrokeType:a.strokeType,setStrokeType:function(e){a.strokeType&&c({strokeType:e}),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],strokeType:e,workState:$.Done,viewId:null==l?void 0:l.viewId})},color:d}):null}),[d,null==a?void 0:a.strokeType,null==l?void 0:l.control.room,null==l?void 0:l.viewId,null==a?void 0:a.useStroke]),x=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:g,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},b,_,L.createElement("div",{className:"font-colors-line"}),s.concat().map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:d,onTouchEndHandler:function(e){e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,c({strokeColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,strokeColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,c({strokeColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,strokeColor:t,viewId:null==l?void 0:l.viewId})}})})),y):null}),[t,s,y,d,v,a,null==l?void 0:l.viewId,g]),w=L.useMemo((function(){return d?L.createElement("div",{className:"color-bar-ring",style:{backgroundColor:wu(d,v)}},L.createElement("div",{className:"circle"})):null}),[d,v]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},w,x)},ec=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=L.useContext(Hc),a=i.floatBarData,s=i.floatBarColors,l=i.mananger,c=i.setFloatBarData,h=o(L.useState(),2),d=h[0],f=h[1],p=o(L.useState(1),2),v=p[0],m=p[1];L.useEffect((function(){if(null!=a&&a.fillColor){var e=o("transparent"===(null==a?void 0:a.fillColor)&&["transparent",1]||Tu(a.fillColor),2),t=e[0],r=e[1];f(t),m(r)}}),[a]);var g=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==a?void 0:a.y)&&null!=l&&l.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==l?void 0:l.height)-n.current.offsetTop-a.y<140){var t={top:"inherit",bottom:50};return t}}}),[null==n?void 0:n.current,a,null==l?void 0:l.height]),y=L.useMemo((function(){return d&&"transparent"!==d?L.createElement(Ql,{key:"fillColors",opacity:v||0,activeColor:d,setCurOpacity:function(e,t,r){r===$.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===$.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),m(e);var n=wu(t,e);null!=a&&a.fillColor&&(a.fillColor=n,c({fillColor:n})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],fillColor:d&&wu(t,e),workState:r,viewId:null==l?void 0:l.viewId})}}):null}),[d,v,null==l?void 0:l.control.room,null==l?void 0:l.viewId,a]),_=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:g,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement(Xl,{activeColor:d,onTouchEndHandler:function(e){e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})}}),s.map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:d,onTouchEndHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})}})})),y):null}),[t,d,s,y,a,null==l?void 0:l.viewId,v,g]),b=L.useMemo((function(){var e=d&&"transparent"!==d&&wu(d,v)||"transparent";return L.createElement("div",{className:"color-bar-fill"},L.createElement("div",{className:"circle",style:{backgroundColor:e}}))}),[d,v]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},b,_)},tc=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,a=e.floatBarRef,s=L.useContext(Hc),l=s.floatBarColors,c=s.mananger,h=s.setFloatBarData,d=s.floatBarData,f=o(L.useState(),2),p=f[0],v=f[1],m=o(L.useState(1),2),g=m[0],y=m[1];L.useEffect((function(){if(null!=n&&n.fontColor){var e=o("transparent"===(null==n?void 0:n.fontColor)&&["transparent",0]||Tu(n.fontColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontColor]);var _=L.useMemo((function(){if(null!=a&&a.current&&R.isNumber(null==d?void 0:d.y)&&null!=c&&c.height){if(a.current.offsetTop&&a.current.offsetTop+d.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==c?void 0:c.height)-a.current.offsetTop-d.y<120){var t={top:"inherit",bottom:50};return t}}}),[null==a?void 0:a.current,d,c]),b=L.useMemo((function(){return p&&"transparent"!==p?L.createElement(Ql,{key:"fontColors",opacity:g,activeColor:p,setCurOpacity:function(e,t,r){r===$.Start&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!0),r===$.Done&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!1),y(e);var n=wu(t,e);null!=d&&d.textOpt&&(d.textOpt.fontColor=n,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],fontColor:p&&n,workState:r,viewId:null==c?void 0:c.viewId})}}):null}),[p,g,null==c?void 0:c.control.room,null==c?void 0:c.viewId,null==d?void 0:d.textOpt,i]),x=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},l.map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontColor:t,viewId:null==c?void 0:c.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontColor:t,viewId:null==c?void 0:c.viewId})}})})),b):null}),[t,l,b,p,g,null==d?void 0:d.textOpt,i,null==c?void 0:c.viewId,_]),w=L.useMemo((function(){var e=p&&"transparent"!==p&&wu(p,g)||"transparent";return L.createElement("div",{className:"color-bar"},L.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,g]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},L.createElement("img",{alt:"icon",src:Wl("font-colors")}),w,x)},rc=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,a=e.floatBarRef,s=L.useContext(Hc),l=s.floatBarColors,c=s.mananger,h=s.setFloatBarData,d=s.floatBarData,f=o(L.useState(),2),p=f[0],v=f[1],m=o(L.useState(1),2),g=m[0],y=m[1];L.useEffect((function(){if(null!=n&&n.fontBgColor){var e=o("transparent"===(null==n?void 0:n.fontBgColor)&&["transparent",1]||Tu(n.fontBgColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontBgColor]);var _=L.useMemo((function(){if(null!=a&&a.current&&R.isNumber(null==d?void 0:d.y)&&null!=c&&c.height){if(a.current.offsetTop&&a.current.offsetTop+d.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==c?void 0:c.height)-a.current.offsetTop-d.y<120){var t={top:"inherit",bottom:50};return t}}}),[null==a?void 0:a.current,d,c]),b=L.useMemo((function(){return p&&"transparent"!==p?L.createElement(Ql,{key:"fontBgColor",opacity:g||0,activeColor:p,setCurOpacity:function(e,t,r){r===$.Start&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!0),r===$.Done&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!1),y(e);var n=wu(t,e);null!=d&&d.textOpt&&(d.textOpt.fontBgColor=n,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],fontBgColor:p&&wu(t,e),workState:r,viewId:null==c?void 0:c.viewId})}}):null}),[p,g,null==c?void 0:c.control.room,null==c?void 0:c.viewId,null==d?void 0:d.textOpt,i]),x=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement(Xl,{activeColor:p,onTouchEndHandler:function(e){e.stopPropagation();var t="transparent";v(t),null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:t,viewId:null==c?void 0:c.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation();var t="transparent";v(t),null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:t,viewId:null==c?void 0:c.viewId})}}),l.map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:wu(r,g),viewId:null==c?void 0:c.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:wu(r,g),viewId:null==c?void 0:c.viewId})}})})),b):null}),[t,l,b,g,p,null==d?void 0:d.textOpt,i,null==c?void 0:c.viewId,_]),w=L.useMemo((function(){var e=p&&"transparent"!==p&&wu(p,g)||"transparent";return L.createElement("div",{className:"color-bar",style:{marginTop:0}},L.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,g]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},L.createElement($l,null),w,x)},nc=function(e){var t=e.bold,r=e.setBold,n=e.workIds,i=e.viewId,o=function(e){var o="bold"===t?"normal":"bold";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,bold:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl("bold"===t?"bold-active":"bold")}))},ic=function(e){var t=e.underline,r=e.setUnderline,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,underline:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl(t?"underline-active":"underline")}))},oc=function(e){var t=e.lineThrough,r=e.setLineThrough,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,lineThrough:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl(t?"line-through-active":"line-through")}))},ac=function(e){var t=e.italic,r=e.setItalic,n=e.workIds,i=e.viewId,o=function(e){var o="italic"===t?"normal":"italic";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,italic:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl("italic"===t?"italic-active":"italic")}))},sc=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,a=e.style,s=e.floatBarRef,u=L.useContext(Hc),l=u.mananger,c=u.floatBarData,h=o(L.useState("normal"),2),d=h[0],f=h[1],p=o(L.useState("normal"),2),v=p[0],m=p[1],g=o(L.useState(!1),2),y=g[0],_=g[1],b=o(L.useState(!1),2),x=b[0],w=b[1];L.useEffect((function(){null!=n&&n.bold&&f(n.bold),R.isBoolean(null==n?void 0:n.underline)&&_(n.underline||!1),R.isBoolean(null==n?void 0:n.lineThrough)&&w(n.lineThrough||!1),null!=n&&n.italic&&m(n.italic)}),[n]);var S=L.useMemo((function(){if(a&&null!=s&&s.current&&R.isNumber(null==c?void 0:c.y)&&null!=l&&l.height){if(s.current.offsetTop&&s.current.offsetTop+c.y>180){var e={top:"inherit",bottom:50};return e}if(!s.current.offsetTop&&(null==l?void 0:l.height)-s.current.offsetTop-c.y<120){var t={top:"inherit",bottom:50};return t}}}),[a,null==s?void 0:s.current,c,l]),T=L.useMemo((function(){return t?L.createElement("div",{className:"font-style-menu",style:S,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement(nc,{workIds:i||[Ca],bold:d,setBold:f,viewId:null==l?void 0:l.viewId}),L.createElement(ic,{workIds:i||[Ca],underline:y,setUnderline:_,viewId:null==l?void 0:l.viewId}),L.createElement(oc,{workIds:i||[Ca],lineThrough:x,setLineThrough:w,viewId:null==l?void 0:l.viewId}),L.createElement(ac,{workIds:i||[Ca],italic:v,setItalic:m,viewId:null==l?void 0:l.viewId})):null}),[t,i,d,null==l?void 0:l.viewId,y,x,v,S]);return L.createElement("div",{className:"button normal-button ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},L.createElement("img",{alt:"icon",src:Wl(t?"font-style-active":"font-style")}),T)},uc=Object.freeze([12,14,18,24,36,48,64,80,144,288]),lc=["top","topLeft","topRight","bottom","bottomLeft","bottomRight","left","leftTop","leftBottom","right","rightTop","rightBottom"],cc=function(e){var t=e.style,r=e.onClickHandler;return L.createElement("div",{className:"font-size-menu",style:t,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},uc.map((function(e){return L.createElement("div",{className:"font-size-btn",key:e,onClick:function(){r(e)},onTouchEnd:function(){r(e)}},e)})))},hc=function(e){var t=L.useRef(null),r=e.open,n=e.setOpen,i=e.textOpt,a=e.workIds,s=e.floatBarRef,u=L.useContext(Hc),l=u.mananger,c=u.floatBarData,h=o(L.useState(0),2),d=h[0],f=h[1],p=o(L.useState(),2),v=p[0],m=p[1],g=uc.length-1;L.useEffect((function(){null!=i&&i.fontSize&&(f(i.fontSize),t.current&&(t.current.value=i.fontSize.toString()))}),[null==i?void 0:i.fontSize]);var y=L.useMemo((function(){if(null!=s&&s.current&&R.isNumber(null==c?void 0:c.y)&&null!=l&&l.height){if(s.current.offsetTop&&s.current.offsetTop+c.y>180){var e={top:"inherit",bottom:35};return e}if(!s.current.offsetTop&&(null==l?void 0:l.height)-s.current.offsetTop-c.y<120){var t={top:"inherit",bottom:35};return t}}}),[null==s?void 0:s.current,c,l]);var _=function(e){var r;null==(r=t.current)||r.blur(),n(!1),x(e)},b=L.useMemo((function(){return r?L.createElement(cc,{onClickHandler:_,style:y}):null}),[r,_,y]),x=function(e){e>uc[g]&&(e=uc[g]),e=uc[0]&&e<=uc[g]&&zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:a||[Ca],fontSize:e,viewId:null==l?void 0:l.viewId})}(e)};return L.useEffect((function(){return function(){null!=l&&l.control.room&&R.isBoolean(v)&&(l.control.room.disableDeviceInputs=v)}}),[l,v]),L.createElement("div",{className:"button normal-button font-size-barBtn",style:{width:50},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement("input",{className:"font-size-input",ref:t,onTouchEnd:function(){t.current&&t.current.focus()},onClick:function(){n(!r),t.current&&t.current.focus()},onKeyDown:function(e){if("Backspace"===e.key){var t=window.getSelection(),r=null==t?void 0:t.getRangeAt(0);if(null!=r&&r.collapsed)return e.cancelable&&e.preventDefault(),document.execCommand("delete",!1),!1}return!1},onKeyUp:function(e){var r;if(t.current){var i=t.current.value,o=parseInt(i);isNaN(o)?t.current.value="0":t.current.value=o.toString(),o&&"Enter"===e.key&&(x(o),null==(r=t.current)||r.blur(),n(!1))}},onFocus:function(){null!=l&&l.control.room&&!l.control.room.disableDeviceInputs&&(m(l.control.room.disableDeviceInputs),l.control.room.disableDeviceInputs=!0)},onBlur:function(){null!=l&&l.control.room&&R.isBoolean(v)&&(l.control.room.disableDeviceInputs=v)}}),L.createElement("div",{className:"font-size-btns"},L.createElement("div",{className:"font-size-add",onClick:function(){x(d+uc[0])},onTouchEnd:function(){x(d+uc[0])}}),L.createElement("div",{className:"font-size-cut",onClick:function(){x(d-uc[0])},onTouchEnd:function(){x(d-uc[0])}})),b)},dc=function(e){var t=e.workIds,r=e.mananger,n=e.islocked;return L.createElement("div",{className:"button normal-button",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.SetLock,{workIds:t||[Ca],isLocked:!n,viewId:null==r?void 0:r.viewId})},onTouchEnd:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.SetLock,{workIds:t||[Ca],isLocked:!n,viewId:null==r?void 0:r.viewId})}},L.createElement("img",{alt:"icon",src:Wl(n?"unlock-new":"lock-new")}))},fc=function(e){var t=e.icon,r=e.min,n=e.max,i=e.step,a=e.value,s=e.onInputHandler,u=o(L.useState(0),2),l=u[0],c=u[1],h=L.useRef(null),d=function(e){e>n&&(e=n),e=r&&i<=n&&d(i)}}),L.createElement("div",{className:"input-number-btns"},L.createElement("div",{className:"input-number-add",onClick:function(){d(l+i)},onTouchEnd:function(){d(l+i)}}),L.createElement("div",{className:"input-number-cut",onClick:function(){d(l-i)},onTouchEnd:function(){d(l-i)}})))},pc=function(e){var t=e.icon,r=e.min,n=e.max,i=e.step,o=e.value,a=e.onInputHandler;return L.createElement("div",{className:"button input-button"},L.createElement("img",{src:Wl(t)}),L.createElement(vc,{min:r,max:n,step:i,value:o,onInputHandler:a}))},vc=function(e){var t=e.value,r=e.min,n=e.max,i=e.onInputHandler,a=o(L.useState({x:0,y:0}),2),s=a[0],u=a[1];L.useEffect((function(){u({x:100*t,y:0})}),[]);var l=R.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var a=Math.floor(Math.max(o.x,100*r));a=Math.floor(Math.min(a,100*n)),o.x!==(null==s?void 0:s.x)&&u({x:a,y:0});var l=a/100;t!==l&&i(l)}),100,{leading:!1}),c=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()},h=R.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var a=Math.floor(Math.max(o.x,100*r));a=Math.floor(Math.min(a,100*n)),o.x!==(null==s?void 0:s.x)&&u({x:a,y:0});var l=a/100;t!==l&&i(l)}),100,{leading:!1});return L.createElement("div",{className:"range-number-container",onClick:function(e){var o=e.nativeEvent.offsetX-6,a=Math.floor(Math.max(o,100*r));a=Math.floor(Math.min(a,100*n)),u({x:a,y:0});var s=a/100;t!==s&&i(s)}},L.createElement("div",{className:"range-number-color"}),L.createElement("div",{className:"range-number"},L.createElement(j,{bounds:"parent",axis:"x",position:s,onDrag:l,onStart:c,onStop:h},L.createElement("div",{className:"circle",onClick:c}))))},mc=function(e){var t=e.icon,r=e.value,n=e.onChangeHandler,i=e.style,a=o(L.useState(0),2),s=a[0],u=a[1],l=o(L.useState(),2),c=l[0],h=l[1],d=L.useRef(null),f=L.useCallback((function(e){e>=lc.length&&(e=0),e<0&&(e=lc.length-1),u(e),n(lc[e]),h(!1),d.current&&(d.current.value=lc[e])}),[n]),p=L.useMemo((function(){if(i&&i.bottom){var e={top:"inherit",bottom:50};return e}}),[i]);L.useEffect((function(){r&&(u(lc.indexOf(r)),d.current&&(d.current.value=r))}),[r]);var v=L.useMemo((function(){return c?L.createElement(gc,{options:lc,onClickHandler:f,style:p}):null}),[c,f,p]);return L.createElement("div",{className:"button input-button"},L.createElement("img",{src:Wl(t)}),L.createElement("input",{readOnly:!0,className:"input-number",type:"text",ref:d,onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),d.current&&d.current.focus()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),d.current&&(d.current.focus(),h(!c))}}),L.createElement("div",{className:"input-number-btns"},L.createElement("div",{className:"input-number-add",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s+1)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s+1)}}),L.createElement("div",{className:"input-number-cut",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s-1)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s-1)}})),v)},gc=function(e){var t=e.options,r=e.style,n=e.onClickHandler;return L.createElement("div",{className:"select-option-menu",style:r,onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},t.map((function(e,t){return L.createElement("div",{className:"select-option-btn",key:e,onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t)}},e)})))},yc=function(e){var t=e.mananger,r=e.innerRatio,n=e.innerVerticeStep,i=e.vertices;return L.createElement(L.Fragment,null,L.createElement(fc,{value:i,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Star,viewId:t.viewId,vertices:e})}}),L.createElement(fc,{value:n,icon:"star-innerVertex",min:1,max:100,step:1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Star,viewId:t.viewId,innerVerticeStep:e})}}),L.createElement(pc,{value:r,icon:"star-innerRatio",min:.1,max:1,step:.1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Star,viewId:t.viewId,innerRatio:e})}}))},_c=function(e){var t=e.mananger,r=e.vertices;return L.createElement(fc,{value:r,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Polygon,viewId:t.viewId,vertices:e})}})},bc=function(e){var t=e.mananger,r=e.placement;return L.createElement(mc,{value:r,icon:"speechBallon-placement",onChangeHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.SpeechBalloon,viewId:t.viewId,placement:e})}})},xc=function(e){var t=e.icon,r=e.isActive,n=e.onClickHandler,i=e.onTouchEndHandler;return L.createElement("div",{className:"button tab-button ".concat(r?"active":""),onClick:n,onTouchEnd:i},L.createElement("img",{src:Wl(t)}))},wc=function(e){var t=e.toolsTypes,r=e.style,n=e.mananger,i=e.shapeOpt,a=o(L.useState(),2),s=a[0],u=a[1];L.useEffect((function(){t.includes(H.Polygon)?u(H.Polygon):t.includes(H.Star)?u(H.Star):u(H.SpeechBalloon)}),[t]);var l=function(e,t){t.cancelable&&t.preventDefault(),null==t||t.stopPropagation(),u(e)},c=L.useMemo((function(){return s===H.Polygon&&n&&i.vertices?L.createElement(_c,{vertices:i.vertices,mananger:n}):null}),[n,s,i]),h=L.useMemo((function(){return s===H.Star&&n&&i.vertices&&i.innerVerticeStep&&i.innerRatio?L.createElement(yc,{mananger:n,vertices:i.vertices,innerVerticeStep:i.innerVerticeStep,innerRatio:i.innerRatio}):null}),[n,s,i]),d=L.useMemo((function(){return s===H.SpeechBalloon&&n&&i.placement?L.createElement(bc,{mananger:n,placement:i.placement}):null}),[n,s,i]);return L.createElement("div",{className:"shapeOpt-sub-menu",style:r,onClick:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.cancelable&&e.preventDefault()}},L.createElement("div",{className:"shapeOpt-sub-menu-tabs"},t.includes(H.Polygon)&&L.createElement(xc,{isActive:s===H.Polygon,icon:s===H.Polygon?"polygon-active":"polygon",onClickHandler:l.bind(void 0,H.Polygon),onTouchEndHandler:l.bind(void 0,H.Polygon)})||null,t.includes(H.Star)&&L.createElement(xc,{isActive:s===H.Star,icon:s===H.Star?"star-active":"star",onClickHandler:l.bind(void 0,H.Star),onTouchEndHandler:l.bind(void 0,H.Star)})||null,t.includes(H.SpeechBalloon)&&L.createElement(xc,{isActive:s===H.SpeechBalloon,icon:s===H.SpeechBalloon?"speechBallon-active":"speechBallon",onClickHandler:l.bind(void 0,H.SpeechBalloon),onTouchEndHandler:l.bind(void 0,H.SpeechBalloon)})||null),L.createElement("div",{className:"shapeOpt-sub-menu-content"},c,h,d))},Sc=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=e.toolsTypes,a=e.shapeOpt,s=L.useContext(Hc),u=s.floatBarData,l=s.mananger,c=o(L.useState([]),2),h=c[0],d=c[1],f=o(L.useState(),2),p=f[0],v=f[1],m=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==u?void 0:u.x)&&R.isNumber(null==u?void 0:u.y)&&null!=l&&l.height){if(n.current.offsetTop&&n.current.offsetTop+u.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==l?void 0:l.height)-n.current.offsetTop-(null==u?void 0:u.y)<140){var t={top:"inherit",bottom:50};return t}}}),[n,null==u?void 0:u.x,null==u?void 0:u.y,null==l?void 0:l.height]),g=L.useMemo((function(){return t&&i&&l&&a?(l.control.room&&!l.control.room.disableDeviceInputs&&(v(l.control.room.disableDeviceInputs),l.control.room.disableDeviceInputs=!0),L.createElement(wc,{shapeOpt:a,style:m,toolsTypes:i,mananger:l})):(null!=l&&l.control.room&&R.isBoolean(p)&&(l.control.room.disableDeviceInputs=p),null)}),[t,m,i,l,a]);return L.useEffect((function(){R.isEqual(null==u?void 0:u.selectIds,h)||null!=u&&u.selectIds&&!R.isEqual(null==u?void 0:u.selectIds,h)&&(d(null==u?void 0:u.selectIds),r(!1))}),[t,u,h,r]),L.useEffect((function(){return function(){t&&null!=l&&l.control.room&&R.isBoolean(p)&&(l.control.room.disableDeviceInputs=p)}}),[t,l,p]),L.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},g,L.createElement("img",{alt:"icon",src:Wl(t?"shapes-active":"shapes")}))},Tc=L.memo((function(e){var t=e.textOpt,r=e.workIds,n=e.noLayer,i=e.position,a=L.useContext(Hc),s=a.floatBarData,u=a.mananger,l=o(L.useState(0),2),c=l[0],h=l[1],d=o(L.useState(),2),f=d[0],p=d[1],v=L.useRef(null);L.useEffect((function(){var e,r,n,o,a={},l=(null==s?void 0:s.w)||(null==(e=null==t?void 0:t.boxSize)?void 0:e[0])||0,c=(null==s?void 0:s.h)||(null==(r=null==t?void 0:t.boxSize)?void 0:r[1])||0;if(i&&l&&c&&null!=u&&u.width&&null!=u&&u.height){if(i.y<60?i.y+c0?a.top=62:a.top=62-i.y:a.top=0,i.x<0)a.left=3-i.x;else if(i.x+((null==(n=v.current)?void 0:n.offsetWidth)||l)>u.width){var h=u.width-((null==(o=v.current)?void 0:o.offsetWidth)||l)-i.x;a.left=h}p(a)}else p(void 0)}),[v,i,null==s?void 0:s.w,null==s?void 0:s.h,null==u?void 0:u.width,null==u?void 0:u.height,null==t?void 0:t.boxSize]);var m=L.useMemo((function(){return null!=s&&s.fillColor?L.createElement(ec,{floatBarRef:v,open:3===c,setOpen:function(e){h(!0===e?3:0)}}):null}),[null==s?void 0:s.fillColor,c,v]),g=L.useMemo((function(){return null!=s&&s.strokeColor?L.createElement(Jl,{floatBarRef:v,open:2===c,setOpen:function(e){h(!0===e?2:0)}}):null}),[null==s?void 0:s.strokeColor,c,v]),y=L.useMemo((function(){return null!=t&&t.fontColor&&null!=u&&u.viewId?L.createElement(tc,{floatBarRef:v,open:4===c,setOpen:function(e){h(!0===e?4:0)},textOpt:t,workIds:r}):null}),[t,c,r,u,v]),_=L.useMemo((function(){return null!=t&&t.fontBgColor&&null!=u&&u.viewId?L.createElement(rc,{floatBarRef:v,open:5===c,setOpen:function(e){h(!0===e?5:0)},textOpt:t,workIds:r}):null}),[t,c,r,u,v]),b=L.useMemo((function(){return t&&null!=u&&u.viewId?L.createElement(sc,{floatBarRef:v,open:6===c,setOpen:function(e){h(!0===e?6:0)},textOpt:t,workIds:r,style:f}):null}),[t,c,r,u,f,v]),x=L.useMemo((function(){return t&&null!=u&&u.viewId?L.createElement(hc,{open:7===c,setOpen:function(e){h(!0===e?7:0)},textOpt:t,workIds:r,floatBarRef:v}):null}),[t,c,r,u,v]),w=L.useMemo((function(){return n?null:L.createElement(Yl,{open:1===c,setOpen:function(e){h(!0===e?1:0)},floatBarRef:v})}),[n,c,v]),S=L.useMemo((function(){return null!=s&&s.canLock&&u?L.createElement(dc,{workIds:r,mananger:u,islocked:s.isLocked}):null}),[s,u,r]),T=L.useMemo((function(){return u&&null!=u&&u.viewId&&f&&null!=s&&s.shapeOpt&&null!=s&&s.toolsTypes?L.createElement(Sc,{open:8===c,setOpen:function(e){h(!0===e?8:0)},floatBarRef:v,workIds:r,toolsTypes:s.toolsTypes,shapeOpt:s.shapeOpt}):null}),[s,u,c,f,r,v]);return L.createElement("div",{className:"appliance-plugin-floatbtns",style:f,ref:v,onMouseOver:function(e){return e.stopPropagation(),e.cancelable&&e.preventDefault(),null==u||u.control.worker.blurCursor(u.viewId),!1},onMouseMove:function(e){return e.stopPropagation(),e.cancelable&&e.preventDefault(),!1}},u&&L.createElement(Gl,{workIds:r,mananger:u}),w,S,!(null==u||!u.viewId)&&L.createElement(Vl,{workIds:r,viewId:u.viewId}),T,x,b,y,_,g,m)})),Mc=function(e){var t=e.data,r=e.isActive,n=e.manager,i=e.workId,o=t.opt,a=t.scale,s=t.translate,u=t.x,l=t.y,c="scale(".concat(a||1,") ").concat(s&&"translate("+s[0]+"px,"+s[1]+"px)"||""),h=o.fontSize,d=o.fontFamily,f=o.underline,p=o.fontColor,v=o.lineThrough,m=o.textAlign,g=o.strokeColor,y=o.lineHeight,_=o.bold,b=o.italic,x=o.uid,w=o.workState,S=h,T=y||1.2*S,M={fontSize:"".concat(S,"px"),lineHeight:"".concat(T,"px"),color:p,borderColor:g,minHeight:"".concat(T,"px"),paddingRight:"".concat("italic"===b?Math.round(.3*S):5,"px")};d&&(M.fontFamily="".concat(d)),(v||f)&&(M.textDecoration="".concat(v?"line-through":"").concat(f?" underline":"")),_&&(M.fontWeight="".concat(_)),b&&(M.fontStyle="".concat(b)),m&&(M.textAlign="".concat(m));var k=L.useMemo((function(){var e=[];if(o.text)for(var t=wa(o.text),r=0;r
":'
').concat(n,"
")}else e='
');return e}),[m.fontBgColor,m.text]),B=L.useMemo((function(){return"string"==typeof z?L.createElement("div",{id:r,suppressContentEditableWarning:!0,contentEditable:!0,className:"editor",ref:N,style:O,onKeyDown:F,onKeyUp:a,onClick:U,onTouchEnd:U,onFocus:s,onPaste:G,onInput:V,dangerouslySetInnerHTML:{__html:z}}):null}),[z,O,r]);function U(){N.current&&N.current.focus(),h()}function F(e){if("Backspace"===e.key){var t=window.getSelection(),r=null==t?void 0:t.getRangeAt(0);if(null!=r&&r.collapsed)return e.cancelable&&e.preventDefault(),document.execCommand("delete",!1),!1}return h(),!1}function W(e,t){var r=null==window?void 0:window.getSelection();if(null!=r&&r.rangeCount&&e&&r&&r.anchorNode){var n=r.anchorOffset,i=r.anchorNode.textContent||"",o=i.slice(0,n)||"",a=i.slice(n)||"";!function(e,t,r){var n=null==window?void 0:window.getSelection();if(null==n||!n.rangeCount||!n.anchorNode)return;var i=e.split(/\n/),o=n.anchorNode.parentNode;o===r&&(o=n.anchorNode);for(var a,s=u(r.childNodes),l=[],c=n.anchorOffset;s.length;){var h=s.pop();if(h){if(h===o){var d=i[0];1===i.length&&(c=i[0].length,d=i[0].concat(t)),"#text"===o.nodeName?(o.textContent=d,a=o):"DIV"===o.nodeName&&(o.innerText=d,a=o.childNodes[0]);break}l.push(h),r.removeChild(h)}}if(i.length>1)for(var p=1;p":g.innerText=v,r.appendChild(g),p===i.length-1&&(a=g.childNodes[0])}if(l.length){l.reverse();var y,_=f(l);try{for(_.s();!(y=_.n()).done;){var b=y.value;r.appendChild(b)}}catch(e){_.e(e)}finally{_.f()}}if(a&&"#text"===a.nodeName){n.deleteFromDocument();var x=document.createRange(),w=Math.min(c,(null==a?void 0:a.length)||0);x.setStart(a,w),x.collapse(!0),n.removeAllRanges(),n.addRange(x)}}(o.concat(e)||"",a,t)}}function G(e){if(e.cancelable&&e.preventDefault(),e.stopPropagation(),N.current){var t=(e.clipboardData||window.clipboardData).getData("text"),r=null==window?void 0:window.getSelection();if(null==r||!r.rangeCount)return;t&&r&&r.anchorNode&&W(t,N.current),h()}}function V(e){a(e),h()}return L.useEffect((function(){B&&N.current&&(N.current.click(),setTimeout((function(){var e;if(N.current){var t=null==window?void 0:window.getSelection(),r=N.current.lastChild;if(t&&r){var n=document.createRange(),i=(null==(e=r.textContent)?void 0:e.length)||0;"#text"===(null==r?void 0:r.nodeName)?n.setStart(r,i):n.setStart(r,i?1:0),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}}),20))}),[B,N.current]),L.useEffect((function(){var e,t,n,i;if(B&&(null!=(e=N.current)&&e.offsetWidth||null!=(t=N.current)&&t.offsetHeight||null!=(n=N.current)&&n.offsetLeft||null!=(i=N.current)&&i.offsetTop)){var o=[N.current.offsetWidth,N.current.offsetHeight];(P&&P[0]!==o[0]&&P[1]!==o[1]||!P)&&l({activeTextId:r,update:{boxSize:o,workState:$.Doing}})}}),[P,B,O,r]),L.createElement(L.Fragment,null,j,L.createElement("div",{className:"editor-box",style:D,onFocus:function(){c.control.room&&!c.control.room.disableDeviceInputs&&(v(c.control.room.disableDeviceInputs),c.control.room.disableDeviceInputs=!0)},onBlur:function(){null!=c&&c.control.room&&R.isBoolean(p)&&(c.control.room.disableDeviceInputs=p)}},B))},Ic=function(e){m(r,e);var t=y(r);function r(e){return S(this,r),t.call(this,e)}return M(r,[{key:"getInnerText",value:function(e){for(var t=[],r=0;rthis.maxScreenshotWidth&&(f=this.maxScreenshotWidth/h*f,h=this.maxScreenshotWidth),d>this.maxScreenshotHeight&&(f=Math.min(this.maxScreenshotHeight/d*f,f),d=this.maxScreenshotHeight),u.scale=f,p=document.createElement("canvas"),v=p.getContext("2d"),p.width=h*(l||1),p.height=d*(l||1),v&&((t.mainView||n).screenshotToCanvas(v,o,h,d,u,l),r.drawImage(p,Math.floor((a-h)/2),Math.floor((s-d)/2),h*(l||1),d*(l||1),0,0,h,d),p.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(c=i.currentManager)?void 0:c.screenshotToCanvas(r,o,h,d,u,Math.floor((a-h)/2),Math.floor((s-d)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,o,a,s,u){var l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"),(t.mainView||n).scenePreview(r,o,a,s,u),(l=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",o.append(l),getComputedStyle(o).position||(o.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=9;break}return e.next=9,i.currentManager.scenePreview(r,l);case 9:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),fillSceneSnapshotAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,o,a,s,u){var l,c,h,d,f,p,v,m,g,y,_,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"),o.innerHTML="",(t.mainView||n).fillSceneSnapshot(r,o,a,s,u),l=a||t.mainView.size.width,c=s||t.mainView.size.height,e.next=4,this.getBoundingRectAsync(r);case 4:if((h=e.sent)||(h={originX:0,originY:0,width:l,height:c}),d=Math.max(null==h?void 0:h.width,l),f=Math.max(null==h?void 0:h.height,c),p=1,v=d>l&&Math.min(l/d,p)||p,m=f>c&&Math.min(c/f,p)||p,v<=m?(d=v<1&&l||d,f=Math.floor(f*v)+1,p=v):v>m&&(f=m<1&&c||f,d=Math.floor(d*m)+1,p=m),g={scale:p,centerX:h.originX+h.width/2,centerY:h.originY+h.height/2},y=document.createElement("canvas"),_=y.getContext("2d"),y.width=d,y.height=f,e.t0=_,!e.t0){e.next=16;break}return e.next=16,this.screenshotToCanvasAsync(_,r,d,f,g,devicePixelRatio);case 16:(b=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",b.src=y.toDataURL(),b.onload=function(){y.remove()},b.onerror=function(){y.remove(),b.remove()},o.append(b),getComputedStyle(o).position||(o.style.position="relative");case 18:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(n)&&n.isWritable?Qc.InternalMsgEmitter.on(e,t):o.call(n.callbacks,e,t)},_callbacksOnce:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(n)&&n.isWritable?Qc.InternalMsgEmitter.on(e,t):u.call(n.callbacks,e,t)},_callbacksOff:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(n)&&n.isWritable?Qc.InternalMsgEmitter.off(e,t):a.call(n.callbacks,e,t)},canRedoSteps:function(){if(i.logger.info("[ApplianceMultiPlugin] canRedoSteps"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,t=null==e?void 0:e.focusScenePath;if(e&&t)return e.displayer.commiter.redoStack.filter((function(e){return e.scenePath===t})).length}return 0},canUndoSteps:function(){if(i.logger.info("[ApplianceMultiPlugin] canUndoSteps"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,t=null==e?void 0:e.focusScenePath;if(e&&t)return e.displayer.commiter.undoStack.filter((function(e){return e.scenePath===t})).length}return 0},undo:function(){return i.logger.info("[ApplianceMultiPlugin] undo"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceMultiPlugin] redo"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(){i.logger.info("[ApplianceMultiPlugin] cleanCurrentScene"),i.currentManager&&A.isRoom(n)&&n.isWritable&&(i.currentManager.cleanCurrentScene(),l.call(t))},insertImage:function(e){i.logger.info("[ApplianceMultiPlugin] insertImage"),i.currentManager&&A.isRoom(n)&&n.isWritable&&i.currentManager.worker.insertImage("mainView",e)},lockImage:function(e,t){i.logger.info("[ApplianceMultiPlugin] lockImage"),i.currentManager&&A.isRoom(n)&&n.isWritable&&i.currentManager.worker.lockImage("mainView",e,t)},completeImageUpload:function(e,t){i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&A.isRoom(n)&&n.isWritable&&i.currentManager.worker.completeImageUpload("mainView",e,t)},getImagesInformation:function(e){return i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&A.isRoom(n)&&n.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return i.logger.info("[ApplianceMultiPlugin] callbacks bind"),c(c({},n.callbacks),{},{on:f._callbacksOn.bind(f),once:f._callbacksOnce.bind(f),off:f._callbacksOff.bind(f)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceMultiPlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0)},setMemberState:function(e){i.logger.info("[ApplianceMultiPlugin] setMemberState");var r=Object.keys(e);if(A.isRoom(n)&&n.isWritable)return r.includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===B.laserPen?(e.currentApplianceName=B.pencil,e.useLaserPen=!0):e.currentApplianceName&&e.currentApplianceName===B.pencil&&(e.useLaserPen=!1)),void h.call(t.mainView,e);throw new Error("setMemberState must be called in writable room")},setPerformancePriority:function(e){i.logger.info("[ApplianceMultiPlugin] setPriority"),i.currentManager&&i.currentManager.setPriority(e)}},(p=function(e,t){i.logger.info("[ApplianceMultiPlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||k(e[t])>"u"?e[t]=f[t]:"callbacks"===t&&(e.callbacks.on=f._callbacksOn.bind(f),e.callbacks.off=f._callbacksOff.bind(f),e.callbacks.once=f._callbacksOnce.bind(f))})(t,"undo"),p(t,"redo"),p(t,"cleanCurrentScene"),p(t,"insertImage"),p(t,"completeImageUpload"),p(t,"lockImage"),p(n,"getImagesInformation"),p(n,"callbacks"),p(n,"screenshotToCanvasAsync"),p(n,"getBoundingRectAsync"),p(n,"scenePreviewAsync"),p(n,"fillSceneSnapshotAsync"),p(t.mainView,"setMemberState"),Object.defineProperty(t,"canUndoSteps",{get:function(){return f.canUndoSteps()}}),Object.defineProperty(t,"canRedoSteps",{get:function(){return f.canRedoSteps()}}),Qc.InternalMsgEmitter.on("onCanUndoStepsUpdate",(function(e){t.emitter.emit("canUndoStepsChange",e)})),Qc.InternalMsgEmitter.on("onCanRedoStepsUpdate",(function(e){t.emitter.emit("canRedoStepsChange",e)})),v=c(c({},f),{},{callbacks:f.callbacks()}),e.abrupt("return",(t._appliancePlugin=v,t._appliancePlugin));case 15:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createApplianceMultiPlugin",value:(t=s(regeneratorRuntime.mark((function e(t,r){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.createInvisiblePlugin(i,{});case 3:e.next=16;break;case 5:if(e.prev=5,e.t0=e.catch(0),t.isWritable){e.next=16;break}return e.next=10,t.setWritable(!0);case 10:return e.next=12,this.createApplianceMultiPlugin(t,r);case 12:return n=e.sent,e.next=15,t.setWritable(!1);case 15:return e.abrupt("return",n);case 16:if(o=t.getInvisiblePlugin(r),e.t1=o,e.t1){e.next=22;break}return e.next=21,i.createApplianceMultiPlugin(t,r);case 21:o=e.sent;case 22:return e.abrupt("return",o);case 23:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,r){return t.apply(this,arguments)})}]),i}(A.InvisiblePlugin);I(Zc,"kind","appliance-multi-plugin"),I(Zc,"currentManager"),I(Zc,"logger",{info:console.log,warn:console.warn,error:console.error}),I(Zc,"options",ya),I(Zc,"createCurrentManager",(function(e,t,r){Zc.currentManager&&Zc.currentManager.destroy();var n={plugin:r,displayer:e.displayer,options:t},i=new Qc(n);Zc.logger.info("[ApplianceMultiPlugin] refresh ApplianceMultiManager object"),i.setWindowManager(e),Zc.currentManager=i}));var Kc=Zc,Jc=function(e){m(r,e);var t=y(r);function r(e,n){var i;return S(this,r),i=t.call(this,e,n),I(b(i),"width",1e3),I(b(i),"height",1e3),I(b(i),"dpr",1),I(b(i),"vDom"),I(b(i),"viewId",pu),I(b(i),"eventTragetElement"),I(b(i),"snapshotContainerRef"),I(b(i),"canvasContainerRef",L.createRef()),I(b(i),"subLocalCanvasContainerRef",L.createRef()),I(b(i),"canvasTopRef",L.createRef()),I(b(i),"canvasServiceFloatRef",L.createRef()),I(b(i),"canvasFloatRef",L.createRef()),I(b(i),"canvasBgRef",L.createRef()),I(b(i),"floatBarRef",L.createRef()),I(b(i),"containerOffset",{x:0,y:0}),i.control.hasOffscreenCanvas()||(i.snapshotContainerRef=L.createRef()),i}return M(r,[{key:"setCanvassStyle",value:function(){if(this.eventTragetElement){var e=this.eventTragetElement.offsetWidth,t=this.eventTragetElement.offsetHeight;e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=uu()),e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=uu(),this.width=e,this.height=t),e&&t&&this.canvasBgRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=uu(this.canvasBgRef.current.getContext("2d")),this.width=e,this.height=t,this.canvasBgRef.current.width=e*this.dpr,this.canvasBgRef.current.height=t*this.dpr,this.canvasFloatRef.current&&(this.canvasFloatRef.current.width=e*this.dpr,this.canvasFloatRef.current.height=t*this.dpr),this.canvasServiceFloatRef.current&&(this.canvasServiceFloatRef.current.width=e*this.dpr,this.canvasServiceFloatRef.current.height=t*this.dpr),this.canvasTopRef.current&&(this.canvasTopRef.current.width=e*this.dpr,this.canvasTopRef.current.height=t*this.dpr))}}},{key:"createMainViewDisplayer",value:function(e){return this.vDom||(this.containerOffset=this.getContainerOffset(e,this.containerOffset),this.eventTragetElement=e.parentElement.children[0],e.innerHTML="",D.render(L.createElement(Yc,{viewId:this.viewId,mananger:this,refs:{canvasServiceFloatRef:this.canvasServiceFloatRef,canvasFloatRef:this.canvasFloatRef,canvasBgRef:this.canvasBgRef,floatBarRef:this.floatBarRef,canvasTopRef:this.canvasTopRef,canvasContainerRef:this.canvasContainerRef,snapshotContainerRef:this.snapshotContainerRef,subLocalCanvasContainerRef:this.subLocalCanvasContainerRef}}),e),this.control.room&&this.bindDisplayerEvent(this.eventTragetElement)),this}}]),r}(El),eh=function(e){m(i,e);var t,r=y(i);function i(e){var t;return S(this,i),t=r.call(this,e),I(b(t),"focuedViewId"),I(b(t),"control"),I(b(t),"focuedView"),t.control=e.control,t}return M(i,[{key:"bindMainView",value:function(){if(this.control.divMainView){var e=new Jc(this.control,bl.InternalMsgEmitter);this.focuedViewId=pu;var t=e.width,r=e.height,o={dpr:e.dpr,originalPoint:[t/2,r/2],offscreenCanvasOpt:c(c({},i.defaultScreenCanvasOpt),{},{width:t,height:r}),layerOpt:c(c({},i.defaultLayerOpt),{},{width:t,height:r}),cameraOpt:c(c({},i.defaultCameraOpt),{},{width:t,height:r})},a=this.control.room&&this.control.room.mainView||this.control.play&&this.control.play.mainView;if(a){var s=a.camera,u=s.scale,l=n(s,["scale"]);o.cameraOpt=c(c(c({},o.cameraOpt),l),{},{scale:u===1/0?1:u}),this.createMianView({id:pu,displayer:e,focusScenePath:a.focusScenePath||a.scenePath,cameraOpt:o.cameraOpt,viewData:a}),this.focuedView=this.mainView,e.createMainViewDisplayer(this.control.divMainView)}}}},{key:"getViewInitData",value:function(e){var t,r=this.getView(e);if(r){var o=r.displayer,a=o.width,s=o.height,u=o.dpr;null!=(t=this.control.pluginOptions.canvasOpt)&&t.contextType&&(i.defaultScreenCanvasOpt.contextType=this.control.pluginOptions.canvasOpt.contextType);var l={dpr:u,originalPoint:[a/2,s/2],offscreenCanvasOpt:c(c({},i.defaultScreenCanvasOpt),{},{width:a,height:s}),layerOpt:c(c({},i.defaultLayerOpt),{},{width:a,height:s}),cameraOpt:c(c({},i.defaultCameraOpt),{},{width:a,height:s})};if(r.viewData){var h=r.viewData.camera,d=h.scale,f=n(h,["scale"]);l.cameraOpt=c(c(c({},l.cameraOpt),f),{},{scale:d===1/0?1:d})}return l}}},{key:"mountView",value:(t=s(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.getView(t))){e.next=9;break}if(e.t0=this.control.worker.isActive,e.t0){e.next=7;break}return this.control.cursor.activeCollector(),e.next=7,this.control.activeWorker();case 7:(i=this.getViewInitData(t))&&(null==(r=this.control.worker)||r.createViewWorker(t,i)),n.focusScenePath&&this.control.collector&&this.control.worker.pullServiceData(t,n.focusScenePath,{isAsync:!0,useAnimation:!1});case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),i}(Ml),th=function(e){m(n,e);var t,r=y(n);function n(e){var t;S(this,n),t=r.call(this,e),I(b(t),"viewContainerManager"),I(b(t),"divMainView"),I(b(t),"onCameraChange",ml((function(e){var r,n=t.viewContainerManager.mainView;n&&n.cameraOpt&&(n.cameraOpt.width!==e.width||n.cameraOpt.height!==e.height)&&(null==(r=t.viewContainerManager.mainView)||r.displayer.updateSize()),t.viewContainerManager.setFocuedViewCameraOpt(e)}),20,{leading:!1}));var i={control:b(t),internalMsgEmitter:n.InternalMsgEmitter};return t.viewContainerManager=new eh(i),t}return M(n,[{key:"init",value:function(){var e=this;n.InternalMsgEmitter.on(G.BindMainView,(function(t){e.divMainView=t,e.plugin&&!e.viewContainerManager.mainView&&e.viewContainerManager.bindMainView()}))}},{key:"activePlugin",value:function(){var e=this;this.plugin&&this.divMainView&&!this.viewContainerManager.mainView&&this.viewContainerManager.bindMainView(),this.collector&&(this.collector.addStorageStateListener((function(t){var r,n;if(null!=(r=e.collector)&&r.storage&&0===Object.keys(e.collector.storage).length)null==(n=e.worker)||n.clearViewScenePath(pu,!0);else{var i,a,s=t.diffView,l=t.diffScenePath,c=t.diffData,h=new Map;if(s)Object.keys(s).forEach((function(t){var r,n=s[t];if(n&&!n.newValue)null==(r=e.worker)||r.clearViewScenePath(t,!0),n.oldValue&&(i=n.oldValue);else if(n&&n.newValue){for(var o=0,a=Object.keys(n.newValue);othis.maxScreenshotWidth&&(d=this.maxScreenshotWidth/c*d,c=this.maxScreenshotWidth),h>this.maxScreenshotHeight&&(d=Math.min(this.maxScreenshotHeight/h*d,d),h=this.maxScreenshotHeight),s.scale=d,f=document.createElement("canvas"),p=f.getContext("2d"),f.width=c*(u||1),f.height=h*(u||1),p&&(t.screenshotToCanvas(p,n,c,h,s,u),r.drawImage(f,Math.floor((o-c)/2),Math.floor((a-h)/2),c*(u||1),h*(u||1),0,0,c,h),f.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(l=i.currentManager)?void 0:l.screenshotToCanvas(r,n,c,h,s,Math.floor((o-c)/2),Math.floor((a-h)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,n,o,a,s){var u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"),t.scenePreview(r,n,o,a,s),(u=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",n.append(u),getComputedStyle(n).position||(n.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=9;break}return e.next=9,i.currentManager.scenePreview(r,u);case 9:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),fillSceneSnapshotAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,n,o,a,s){var u,l,c,h,d,f,p,v,m,g,y,_,b,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"),n.innerHTML="",t.fillSceneSnapshot(r,n,o,a,s),c=o||(null==(u=t.state.cameraState)?void 0:u.width)||0,h=a||(null==(l=t.state.cameraState)?void 0:l.height)||0,e.next=4,this.getBoundingRectAsync(r);case 4:if((d=e.sent)||(d={originX:0,originY:0,width:c,height:h}),f=Math.max(null==d?void 0:d.width,c),p=Math.max(null==d?void 0:d.height,h),v=1,m=f>c&&Math.min(c/f,v)||v,g=p>h&&Math.min(h/p,v)||v,m<=g?(f=m<1&&c||f,p=Math.floor(p*m)+1,v=m):m>g&&(p=g<1&&h||p,f=Math.floor(f*g)+1,v=g),y={scale:v,centerX:d.originX+d.width/2,centerY:d.originY+d.height/2},_=document.createElement("canvas"),b=_.getContext("2d"),_.width=f,_.height=p,e.t0=b,!e.t0){e.next=16;break}return e.next=16,this.screenshotToCanvasAsync(b,r,f,p,y,devicePixelRatio);case 16:(x=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",x.src=_.toDataURL(),x.onload=function(){_.remove()},x.onerror=function(){_.remove(),x.remove()},n.append(x),getComputedStyle(n).position||(n.style.position="relative");case 18:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(t)&&t.isWritable?th.InternalMsgEmitter.on(e,r):n.call(t.callbacks,e,r)},_callbacksOnce:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(t)&&t.isWritable?th.InternalMsgEmitter.on(e,r):a.call(t.callbacks,e,r)},_callbacksOff:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(t)&&t.isWritable?th.InternalMsgEmitter.off(e,r):o.call(t.callbacks,e,r)},canRedoSteps:function(){if(i.logger.info("[ApplianceSinglePlugin] canRedoSteps"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,r=null==e?void 0:e.focusScenePath;if(e&&r)return e.displayer.commiter.redoStack.filter((function(e){return e.scenePath===r})).length}return 0},canUndoSteps:function(){if(i.logger.info("[ApplianceSinglePlugin] canUndoSteps"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,r=null==e?void 0:e.focusScenePath;if(e&&r)return e.displayer.commiter.undoStack.filter((function(e){return e.scenePath===r})).length}return 0},undo:function(){return i.logger.info("[ApplianceSinglePlugin] undo"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceSinglePlugin] redo"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(e){i.logger.info("[ApplianceSinglePlugin] cleanCurrentScene"),i.currentManager&&A.isRoom(t)&&t.isWritable&&(i.currentManager.cleanCurrentScene(),u.call(t,e))},insertImage:function(e){i.logger.info("[ApplianceSinglePlugin] insertImage"),i.currentManager&&A.isRoom(t)&&t.isWritable&&i.currentManager.worker.insertImage("mainView",e)},lockImage:function(e,r){i.logger.info("[ApplianceSinglePlugin] lockImage"),i.currentManager&&A.isRoom(t)&&t.isWritable&&i.currentManager.worker.lockImage("mainView",e,r)},completeImageUpload:function(e,r){i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&A.isRoom(t)&&t.isWritable&&i.currentManager.worker.completeImageUpload("mainView",e,r)},getImagesInformation:function(e){return i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&A.isRoom(t)&&t.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return c(c({},t.callbacks),{},{on:d._callbacksOn.bind(d),once:d._callbacksOnce.bind(d),off:d._callbacksOff.bind(d)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceSinglePlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0,i.cursorAdapter=void 0)},setMemberState:function(e){i.logger.info("[ApplianceSinglePlugin] setMemberState");var r=Object.keys(e);if(A.isRoom(t)&&t.isWritable)return r.includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===B.laserPen?(e.currentApplianceName=B.pencil,e.useLaserPen=!0):e.currentApplianceName&&e.currentApplianceName===B.pencil&&(e.useLaserPen=!1)),void l(e);throw new Error("setMemberState must be called in writable room")},setPerformancePriority:function(e){i.logger.info("[ApplianceSinglePlugin] setPriority"),i.currentManager&&i.currentManager.setPriority(e)}},(f=function(e,t){i.logger.info("[ApplianceSinglePlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||k(e[t])>"u"?e[t]=d[t]:"callbacks"===t&&(e.callbacks.on=d._callbacksOn.bind(d),e.callbacks.off=d._callbacksOff.bind(d),e.callbacks.once=d._callbacksOnce.bind(d))})(t,"undo"),f(t,"redo"),f(t,"cleanCurrentScene"),f(t,"insertImage"),f(t,"completeImageUpload"),f(t,"lockImage"),f(t,"getImagesInformation"),f(t,"callbacks"),f(t,"screenshotToCanvasAsync"),f(t,"getBoundingRectAsync"),f(t,"scenePreviewAsync"),f(t,"fillSceneSnapshotAsync"),f(t,"setMemberState"),Object.defineProperty(t,"canUndoSteps",{get:function(){return d.canUndoSteps()}}),Object.defineProperty(t,"canRedoSteps",{get:function(){return d.canRedoSteps()}}),p=c(c({},d),{},{callbacks:d.callbacks()}),e.abrupt("return",(t._appliancePlugin=p,t._appliancePlugin));case 16:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createAppliancePlugin",value:(t=s(regeneratorRuntime.mark((function e(t,r){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.createInvisiblePlugin(i,{});case 3:e.next=16;break;case 5:if(e.prev=5,e.t0=e.catch(0),t.isWritable){e.next=16;break}return e.next=10,t.setWritable(!0);case 10:return e.next=12,this.createAppliancePlugin(t,r);case 12:return n=e.sent,e.next=15,t.setWritable(!1);case 15:return e.abrupt("return",n);case 16:if(o=t.getInvisiblePlugin(r),e.t1=o,e.t1){e.next=22;break}return e.next=21,i.createAppliancePlugin(t,r);case 21:o=e.sent;case 22:return e.abrupt("return",o);case 23:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,r){return t.apply(this,arguments)})},{key:"effectInstance",value:function(){if(i.cursorAdapter){var e=i.cursorAdapter.onAddedCursor;i.cursorAdapter.onAddedCursor=function(t){t.onCursorMemberChanged=function(e){try{e.appliance===B.pencil||e.appliance===B.shape||e.appliance===B.text||e.appliance===B.arrow||e.appliance===B.straight||e.appliance===B.rectangle||e.appliance===B.ellipse||e.appliance===B.eraser?null!=t&&t.divElement&&(t.divElement.style.display="none"):null!=t&&t.divElement&&(t.divElement.style.display="block")}catch(e){}},e.call(i.cursorAdapter,t)}}}}]),i}(A.InvisiblePlugin);I(rh,"kind","appliance-aids-single-plugin"),I(rh,"cursorAdapter"),I(rh,"currentManager"),I(rh,"logger",{info:console.log,warn:console.warn,error:console.error}),I(rh,"options",ya),I(rh,"createCurrentManager",(function(e,t,r){rh.currentManager&&rh.currentManager.destroy();var n=new th({plugin:r,displayer:e,options:t});n.init(),rh.logger.info("[ApplianceSinglePlugin] refresh ApplianceSingleManager object"),rh.currentManager=n}));var nh=rh,ih=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"mainViewRef",null),e}return M(r,[{key:"componentDidMount",value:function(){r.emiter||(r.emiter=th.InternalMsgEmitter),r.emiter.emit(G.BindMainView,this.mainViewRef)}},{key:"render",value:function(){var e=this;return L.createElement(L.Fragment,null,this.props.children,L.createElement("div",{className:"appliance-plugin-main-view-displayer",ref:function(t){return e.mainViewRef=t}}))}}]),r}(L.Component);I(ih,"emiter");var oh=ih;t.ActiveContainerType=V,t.ApplianceMultiPlugin=Kc,t.ApplianceNames=B,t.ApplianceSigleWrapper=oh,t.ApplianceSinglePlugin=nh,t.Cursor_Hover_Id="cursorhover",t.DefaultAppliancePluginOptions=ya,t.ECanvasShowType=q,t.EDataType=Y,t.EMatrixrRelationType=ee,t.EPostMessageType=X,t.EScaleType=K,t.EStrokeType=U,t.EToolsKey=H,t.ElayerType=Z,t.EmitEventType=W,t.EventMessageType=Q,t.EvevtWorkState=$,t.EvevtWorkType=J,t.InternalMsgEmitterType=G,t.Main_View_Id=pu,t.ShapeType=F,t.Storage_Selector_key=Ca,t.Storage_Splitter=Aa,t.Storage_ViewId_ALL=Pa,t.Task_Time_Interval=20,t.ViewContainerManager=Ml,t.checkOp=function(e){var t,r=f(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(isNaN(n)||n===1/0||n===-1/0)return!1}}catch(e){r.e(e)}finally{r.f()}return!0},t.cloneDeep=pa,t.computRect=Ys,t.fullWorker="/fullWorker.js",t.getRectMatrixrRelation=function(e,t){return e.x+e.wt.x+t.w||e.y+e.ht.y+t.h?ee.outside:e.x>=t.x&&e.y>=t.y&&e.x+e.w<=t.x+t.w&&e.y+e.h<=t.y+t.h?ee.inside:ee.intersect},t.getShapeInstance=Vs,t.getShapeTools=Gs,t.isBoolean=Rs,t.isEqual=xs,t.isIntersect=qs,t.isIntersectForPoint=tu,t.isNumber=Ie,t.isSet=zo,t.subWorker="/subWorker.js",t.throttle=ml,t.transformToNormalData=wa,t.transformToSerializableData=Sa},46482:function(e,t,r){function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u(e);if(t){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||y(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 c(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function h(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){h(o,n,i,a,s,"next",e)}function s(e){h(o,n,i,a,s,"throw",e)}a(void 0)}))}}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=new Map,a=g(this.curNodeMap.entries());try{for(a.s();!(r=a.n()).done;){var s=m(r.value,2),u=s[0],l=s[1];if(k.isIntersect(e,l.rect)){if(n&&l.toolsType===k.EToolsKey.Image&&l.opt.locked||i&&l.toolsType===k.EToolsKey.Text&&(l.opt.workState===k.EvevtWorkState.Doing||l.opt.workState===k.EvevtWorkState.Start))continue;t=k.computRect(t,l.rect),o.set(u,l)}}}catch(e){a.e(e)}finally{a.f()}return{rectRange:t,nodeRange:o}}},{key:"getNodeRectFormShape",value:function(e,t){var r=k.getShapeTools(t.toolsType);return this.fullLayer&&(null==r?void 0:r.getRectFromLayer(this.fullLayer,e))}},{key:"updateNodeRect",value:function(e){var t=this.curNodeMap.get(e);if(t){var r=this.getNodeRectFormShape(e,t);if(!r)return void this.curNodeMap.delete(e);t.rect=r,this.curNodeMap.set(e,t)}}},{key:"updateHighLevelNodesRect",value:function(e){this.highLevelIds=e;var t,r=g(this.highLevelIds.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;this.updateNodeRect(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"updateLowLevelNodesRect",value:function(){var e,t,r=g(this.curNodeMap.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;null!=(e=this.highLevelIds)&&e.has(n)||this.updateNodeRect(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"clearHighLevelIds",value:function(){this.highLevelIds=void 0}},{key:"setTargetAssignKeys",value:function(e){var t,r=new Map,n=g(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.curNodeMap.get(i);o&&r.set(i,k.cloneDeep(o))}}catch(e){n.e(e)}finally{n.f()}return this.targetNodeMap.push(k.cloneDeep(r)),this.targetNodeMap.length-1}},{key:"setTarget",value:function(){return this.targetNodeMap.push(k.cloneDeep(this.curNodeMap)),this.targetNodeMap.length-1}},{key:"getLastTarget",value:function(){return this.targetNodeMap[this.targetNodeMap.length-1]}},{key:"deleteLastTarget",value:function(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1)}},{key:"getTarget",value:function(e){return this.targetNodeMap[e]}},{key:"deleteTarget",value:function(e){this.targetNodeMap.length=e}},{key:"clearTarget",value:function(){this.targetNodeMap.length=0}},{key:"isLocalWorkId",value:function(e){return 1===e.split(k.Storage_Splitter).length}},{key:"isCanClearWorkId",value:function(e){if(void 0===this.canClearUids||!0===this.canClearUids)return!0;if(k.isSet(this.canClearUids)){var t=e.split(k.Storage_Splitter);if(1===t.length)return this.canClearUids.has("localSelf");if(2===t.length)return this.canClearUids.has(t[0])}return!1}}]),e}(),C=function(){function e(t){b(this,e),M(this,"vNodes"),M(this,"thread"),M(this,"serviceWorkShapes",new Map),M(this,"localWorkShapes",new Map),M(this,"tmpOpt"),M(this,"animationId"),M(this,"syncUnitTime",k.DefaultAppliancePluginOptions.syncOpt.interval),this.vNodes=t.vNodes,this.thread=t.thread}return w(e,[{key:"createLocalWork",value:function(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r){var i=t.toString();!this.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:r}),this.setWorkOptions(i,r)}}},{key:"getLocalWorkShape",value:function(e){return this.localWorkShapes.get(e)}},{key:"createLocalWorkShape",value:function(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(p(p({},r),{},{workId:e}));return n&&this.localWorkShapes.set(e,{node:n,toolsType:n.toolsType,workState:k.EvevtWorkState.Start}),n}}},{key:"canUseTopLayer",value:function(e){return e===k.EToolsKey.LaserPen}},{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.topLayer.children.length&&(this.thread.topLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.serviceWorkShapes.clear(),this.localWorkShapes.clear()}},{key:"consumeDraw",value:function(e){var t=e.workId;if(e.dataType===k.EDataType.Service)this.activeServiceWorkShape(e);else{var r=null==t?void 0:t.toString(),n=r&&this.localWorkShapes.get(r);if(!n)return;var i=n.node.consume({data:e,isFullWork:!1,isSubWorker:!0});i.rect&&(n.result=i,n.workState=k.EvevtWorkState.Doing,r&&this.localWorkShapes.set(r,n))}this.runAnimation()}},{key:"setToolsOpt",value:function(e){var t;this.tmpOpt=e,null!=(t=e.toolsOpt)&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime)}},{key:"getToolsOpt",value:function(){return this.tmpOpt}},{key:"createWorkShapeNode",value:function(e){if(e.toolsType===k.EToolsKey.LaserPen)return k.getShapeInstance(p(p({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.topLayer,drawLayer:this.thread.topLayer}))}},{key:"setNodeKey",value:function(e,t,r,n){return t.toolsType=r,t.node=this.createWorkShapeNode({workId:e,toolsType:r,toolsOpt:n}),t}},{key:"activeServiceWorkShape",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.toolsType,a=e.type,s=e.updateNodeOpt,u=e.ops,l=e.op;if(n){var c=n.toString(),h=null==(t=this.vNodes.get(c))?void 0:t.rect;if(null==(r=this.serviceWorkShapes)||!r.has(c)){var d={toolsType:o,animationWorkData:l||[],animationIndex:0,type:a,updateNodeOpt:s,ops:u,oldRect:h};o&&i&&(d=this.setNodeKey(c,d,o,i)),this.serviceWorkShapes.set(c,d)}var f=this.serviceWorkShapes.get(c);a&&(f.type=a),u&&(f.animationWorkData=k.transformToNormalData(u),f.ops=u),s&&(f.updateNodeOpt=s),l&&(f.animationWorkData=l),f.node&&f.node.getWorkId()!==c&&f.node.setWorkId(c),h&&(f.oldRect=h),o&&i&&(f.toolsType!==o&&o&&i&&this.setNodeKey(c,f,o,i),f.node&&f.node.setWorkOptions(i))}}},{key:"computNextAnimationIndex",value:function(e,t){var r,n=(null==(r=e.node)?void 0:r.syncUnitTime)||this.syncUnitTime,i=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/n)*t;return Math.min((e.animationIndex||0)+(i||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:function(){var e,t,r,n,i=this;this.animationId=void 0;var o,a=!1,s=new Map,u=[],l=g(this.serviceWorkShapes.entries());try{for(l.s();!(o=l.n()).done;){var c=m(o.value,2),h=c[0],d=c[1];switch(d.toolsType){case k.EToolsKey.LaserPen:var f=this.computNextAnimationIndex(d,8),p=Math.max(0,d.animationIndex||0),v=(d.animationWorkData||[]).slice(p,f);if((d.animationIndex||0)0&&void 0!==arguments[0]&&arguments[0],r=this.workShapes.get(k.Storage_Selector_key);if(r){if(r&&(null==(e=r.selectIds)||!e.length))return this.blurSelector();var n=r.reRenderSelector();n&&this.thread.post({sp:[{type:k.EPostMessageType.Select,selectIds:r.selectIds,selectRect:n,willSyncService:t,viewId:this.thread.viewId,points:r.getChildrenPoints(),textOpt:r.textOpt,selectorColor:r.selectorColor,strokeColor:r.strokeColor,fillColor:r.fillColor,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,opt:r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}]})}}},{key:"blurSelector",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.workShapes.get(k.Storage_Selector_key),i=null==n?void 0:n.blurSelector(),this.clearWorkShapeNodeCache(k.Storage_Selector_key),(null==(r=this.thread.fullLayer)?void 0:r.parent).children.forEach((function(e){e.name===k.Storage_Selector_key&&e.remove()})),i&&((o=[]).push(p(p({},i),{},{isSync:null==t?void 0:t.isSync})),this.thread.post({sp:o}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"clearWorkShapeNodeCache",value:function(e){var t;null==(t=this.getWorkShape(e))||t.clearTmpPoints(),this.workShapes.delete(e)}},{key:"drawBitMapEraser",value:function(e){var t=[];e.op&&t.push(e),t.length&&this.thread.post({sp:t})}},{key:"drawBitMapEraserFull",value:(t=d(regeneratorRuntime.mark((function e(t,r,n){var i,o,a,s,u,l,h,d,f,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.willUpdateNodes,o=r.scenePath,a=c(r,["willUpdateNodes","scenePath"]),s=t.getWorkId(),u=[p(p({},a),{},{workId:s,scenePath:o,updateNodeOpt:{useAnimation:!1},isSync:!0,nextTasks:[{type:k.EPostMessageType.RemoveNode,removeIds:[s],viewId:this.thread.viewId}]})],n&&u.push({type:k.EPostMessageType.None,isLockSentEventCursor:n}),null==i||!i.size){e.next=6;break}return e.next=4,null==t?void 0:t.reRenderEffectNodes({willUpdateNodes:i,worker:this});case 4:l=g(i);try{for(l.s();!(h=l.n()).done;)d=m(h.value,2),f=d[0],v=d[1],u.push({type:k.EPostMessageType.UpdateNode,dataType:k.EDataType.Local,opt:v.opt,workId:f,updateNodeOpt:{useAnimation:!1}})}catch(e){l.e(e)}finally{l.f()}case 6:u.length&&this.thread.post({sp:u});case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"drawPencilEraser",value:function(e,t){var r,n,i=this,o=[];if(null!=(r=e.newWorkDatas)&&r.size){var a,s=g(e.newWorkDatas.values());try{for(s.s();!(a=s.n()).done;){var u=a.value,l=u.workId.toString();this.batchEraserWorks.add(l),o.push({type:k.EPostMessageType.FullWork,workId:l,ops:k.transformToSerializableData(u.op),opt:u.opt,toolsType:u.toolsType,updateNodeOpt:{useAnimation:!1}})}}catch(e){s.e(e)}finally{s.f()}delete e.newWorkDatas}null==(n=e.removeIds)||n.forEach((function(e){i.batchEraserRemoveNodes.add(e)})),t&&o.push({type:k.EPostMessageType.None,isLockSentEventCursor:t}),e.rect,this.thread.post({sp:o}),this.batchEraserCombine()}},{key:"drawEraser",value:function(e,t){var r=[];e.removeIds&&r.push(e),t&&r.push({type:k.EPostMessageType.None,isLockSentEventCursor:t}),this.thread.post({sp:r})}},{key:"updateBatchEraserCombineNode",value:function(e,t){var r,n=this,i=g(t.keys());try{for(i.s();!(r=i.n()).done;){var o=r.value;this.thread.fullLayer.getElementsByName(o).forEach((function(e){e.remove()}))}}catch(e){i.e(e)}finally{i.f()}e.forEach((function(e){var t=n.vNodes.get(e);if(t&&t.toolsType===k.EToolsKey.Pencil&&!n.thread.fullLayer.getElementsByName(e)[0]){var r=n.setFullWork(p(p({},t),{},{workId:e}));r&&r.consumeService({op:t.op,isFullWork:!0})}}))}},{key:"getWorkShape",value:function(e){return this.workShapes.get(e)}},{key:"getWorkShapes",value:function(){return this.workShapes}},{key:"consumeDraw",value:function(e,t){var r=e.op,n=e.workId,i=e.scenePath;if(null!=r&&r.length&&n){var o=n.toString(),a=this.workShapes.get(o);if(!a)return;var s=a.toolsType;if(s===k.EToolsKey.LaserPen)return;switch(this.drawWorkActiveId&&this.drawWorkActiveId!==o&&(this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:i,viewId:this.thread.viewId,msgType:k.EPostMessageType.DrawWork,dataType:k.EDataType.Local},t),this.drawWorkActiveId=void 0),!this.drawWorkActiveId&&o!==k.Storage_Selector_key&&(this.drawWorkActiveId=o),s){case k.EToolsKey.Selector:var u=a.consume({data:e,isFullWork:!0});u.type===k.EPostMessageType.Select&&(u.selectIds&&t.runReverseSelectWork(u.selectIds),this.thread.post({sp:[u]}));break;case k.EToolsKey.PencilEraser:var l=a.consume({data:e,isFullWork:!0});null!=l&&l.rect&&this.drawPencilEraser(l);break;case k.EToolsKey.BitMapEraser:var c=a.consume({data:e,isFullWork:!0});null!=c&&c.rect&&this.drawBitMapEraser(c);break;case k.EToolsKey.Eraser:var h=a.consume({data:e,isFullWork:!0});null!=h&&h.rect&&this.drawEraser(h);break;case k.EToolsKey.Arrow:case k.EToolsKey.Straight:case k.EToolsKey.Ellipse:case k.EToolsKey.Rectangle:case k.EToolsKey.Star:case k.EToolsKey.Polygon:case k.EToolsKey.SpeechBalloon:case k.EToolsKey.Pencil:var d=a.consume({data:e,isFullWork:!1,isMainThread:!0});d&&(this.drawCount++,this.thread.post({drawCount:this.drawCount,sp:d.op&&[p(p({},d),{},{scenePath:i})]||void 0}))}}}},{key:"consumeDrawAll",value:function(e,t){var r,n,i,o,a=e.workId,s=e.scenePath,u=e.isLockSentEventCursor;if(a){var l=a.toString();this.drawWorkActiveId===l&&(this.drawWorkActiveId=void 0);var c=this.workShapes.get(l);if(!c)return;var h=c.toolsType;if(h===k.EToolsKey.LaserPen)return;var d=this.workShapes.get(k.Cursor_Hover_Id),f=null==(r=null==d?void 0:d.selectIds)?void 0:r[0],v=c.consumeAll({data:e});switch(h){case k.EToolsKey.Selector:v.selectIds&&f&&null!=(n=v.selectIds)&&n.includes(f)&&d.cursorBlur(),v.type===k.EPostMessageType.Select&&(v.selectIds&&t.runReverseSelectWork(v.selectIds),this.thread.post({sp:[p(p({},v),{},{scenePath:s})]})),null!=(i=c.selectIds)&&i.length?c.clearTmpPoints():this.clearWorkShapeNodeCache(l);break;case k.EToolsKey.PencilEraser:this.drawPencilEraser(p(p({},v),{},{scenePath:s}),u),c.clearTmpPoints();break;case k.EToolsKey.BitMapEraser:(v.rect||null!=(o=v.newWorkDatas)&&o.size)&&this.drawBitMapEraserFull(c,v,u);break;case k.EToolsKey.Eraser:this.drawEraser(p(p({},v),{},{scenePath:s}),u),c.clearTmpPoints();break;case k.EToolsKey.Arrow:case k.EToolsKey.Straight:case k.EToolsKey.Ellipse:case k.EToolsKey.Rectangle:case k.EToolsKey.Star:case k.EToolsKey.Polygon:case k.EToolsKey.SpeechBalloon:case k.EToolsKey.Pencil:var m=[];u&&m.push({type:k.EPostMessageType.None,isLockSentEventCursor:u}),v&&(m.push(v),this.drawCount=0,this.thread.post({drawCount:this.drawCount,sp:m})),this.clearWorkShapeNodeCache(l)}}}},{key:"getToolsOpt",value:function(){return this.tmpOpt}},{key:"setToolsOpt",value:function(e){var t;this.tmpOpt=e,null!=(t=e.toolsOpt)&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime)}},{key:"setWorkOptions",value:function(e,t){var r=this.workShapes.get(e);if(!r&&this.tmpOpt){var n=this.tmpOpt.toolsType;this.tmpOpt.toolsOpt=t,(r=this.createWorkShapeNode({workId:e,toolsType:n,toolsOpt:t}))&&this.workShapes.set(e,r),this.setToolsOpt(this.tmpOpt)}t.syncUnitTime||(t.syncUnitTime=this.syncUnitTime),null==r||r.setWorkOptions(t)}},{key:"createWorkShapeNode",value:function(e){return k.getShapeInstance(p(p({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.localLayer}),this.thread.serviceWork)}}]),e}(),N=function(){function e(t){b(this,e),M(this,"vNodes"),M(this,"thread"),M(this,"workShapes",new Map),M(this,"selectorWorkShapes",new Map),M(this,"willRunEffectSelectorIds",new Set),M(this,"runEffectId"),M(this,"animationId"),M(this,"syncUnitTime",k.DefaultAppliancePluginOptions.syncOpt.interval),this.vNodes=t.vNodes,this.thread=t.thread}var t,r;return w(e,[{key:"loadImageBitMap",value:(r=d(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.thread.loadImageBitMap(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.serviceLayer.children.length&&(this.thread.serviceLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear()}},{key:"runEffect",value:function(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0))}},{key:"effectRunSelector",value:function(){var e=this;this.runEffectId=void 0,this.willRunEffectSelectorIds.forEach((function(t){var r,n,i=e.selectorWorkShapes.get(t);i&&i.selectIds&&(null==(r=i.node)||r.selectServiceNode(t,i,!0)),null!=(n=null==i?void 0:i.selectIds)&&n.length||e.selectorWorkShapes.delete(t)})),this.willRunEffectSelectorIds.clear()}},{key:"runSelectWork",value:function(e){this.activeSelectorShape(e);var t=e.workId,r=null==t?void 0:t.toString();r&&this.willRunEffectSelectorIds.add(r),this.runEffect()}},{key:"removeWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();if(r){if(this.workShapes.get(r))return this.workShapes.delete(r),void this.removeNode(r,e);this.removeNode(r,e)}}},{key:"consumeFull",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"runReverseSelectWork",value:function(e){var t=this;e.forEach((function(e){t.selectorWorkShapes.forEach((function(r,n){var i;if(null!=(i=r.selectIds)&&i.length){var o=r.selectIds.indexOf(e);o>-1&&(r.selectIds.splice(o,1),t.willRunEffectSelectorIds.add(n))}}))})),this.willRunEffectSelectorIds.size&&this.runEffect()}},{key:"consumeDraw",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"computNextAnimationIndex",value:function(e,t){var r=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:(t=d(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f,p,v,y,_,b,x,w,S,T=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.animationId=void 0,y=!1,_=new Map,b=g(this.workShapes.entries()),e.prev=4,w=regeneratorRuntime.mark((function e(){var g,b,w,S,M,E,I,A,C,P;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g=m(x.value,2),b=g[0],w=g[1],e.t0=w.toolsType,e.next=e.t0===k.EToolsKey.Image?4:e.t0===k.EToolsKey.Text?9:e.t0===k.EToolsKey.Arrow||e.t0===k.EToolsKey.Straight||e.t0===k.EToolsKey.Rectangle||e.t0===k.EToolsKey.Ellipse||e.t0===k.EToolsKey.Star||e.t0===k.EToolsKey.Polygon||e.t0===k.EToolsKey.SpeechBalloon?17:e.t0===k.EToolsKey.Pencil?20:33;break;case 4:return e.next=6,null==(t=w.node)?void 0:t.consumeServiceAsync({isFullWork:!0,worker:T});case 6:return T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),T.workShapes.delete(b),e.abrupt("break",33);case 9:if(e.t1=w.node,!e.t1){e.next=16;break}return e.next=13,null==(r=w.node)?void 0:r.consumeServiceAsync({isFullWork:!0,replaceId:b});case 13:T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),null==(n=w.node)||n.clearTmpPoints(),T.workShapes.delete(b);case 16:return e.abrupt("break",33);case 17:return S=!!w.ops,null!=(i=w.animationWorkData)&&i.length&&(M=w.oldRect,null==(o=w.node)||o.consumeService({op:w.animationWorkData,isFullWork:S}),S&&(T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),null==(a=w.node)||a.clearTmpPoints(),T.workShapes.delete(b)),_.set(b,{workState:M?w.ops?k.EvevtWorkState.Done:k.EvevtWorkState.Doing:k.EvevtWorkState.Start,op:w.animationWorkData.filter((function(e,t){if(t%3!=2)return!0})).slice(-2)}),w.animationWorkData.length=0),e.abrupt("break",33);case 20:if(w.useAnimation||!w.ops){e.next=24;break}null==(s=w.node)||s.consumeService({op:w.animationWorkData||[],isFullWork:!0,replaceId:b}),null==(u=w.node)||u.updataOptService(w.updateNodeOpt),T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),null==(l=w.node)||l.clearTmpPoints(),T.workShapes.delete(b),e.next=32;break;case 24:if(!w.useAnimation){e.next=32;break}if(!w.isDel){e.next=28;break}return null==(c=w.node)||c.clearTmpPoints(),T.workShapes.delete(b),e.abrupt("break",33);case 28:return E=T.computNextAnimationIndex(w,3),I=w.isDiff?0:Math.max(0,(w.animationIndex||0)-3),A=(w.animationWorkData||[]).slice(I,E),C=null==(d=null==(h=w.node)?void 0:h.getWorkId())?void 0:d.toString(),(w.animationIndex||0)-1&&this.removeSelectWork(t),this.thread.fullLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.thread.serviceLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.vNodes.delete(e)}},{key:"removeSelectWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();r&&(this.activeSelectorShape(e),this.willRunEffectSelectorIds.add(r)),this.runEffect()}},{key:"activeSelectorShape",value:function(e){var t,r,n,i=e.workId,o=e.opt,a=e.toolsType,s=e.type,u=e.selectIds;if(i){var l=i.toString();if(null==(t=this.selectorWorkShapes)||!t.has(l)){var c={toolsType:a,selectIds:u,type:s,opt:o};a&&o&&(c=this.setNodeKey(l,c,a,o)),null==(r=this.selectorWorkShapes)||r.set(l,c)}var h=null==(n=this.selectorWorkShapes)?void 0:n.get(l);s&&(h.type=s),h.node&&h.node.getWorkId()!==l&&h.node.setWorkId(l),h.selectIds=u||[]}}},{key:"setNodeKey",value:function(e,t,r,n){return t.toolsType=r,t.node=k.getShapeInstance({toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.serviceLayer,workId:e},this),t}}]),e}(),O=function(){function e(){b(this,e),M(this,"localWork"),M(this,"serviceWork"),M(this,"threadEngine")}return w(e,[{key:"registerMainThread",value:function(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this}}]),e}(),R=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.CopyNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.FullWork||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,e.t0=n,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.consumeFull(t);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),a}(O),D=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetColorNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,o=t.isSync,a=t.textUpdateForWoker,s=r.sp||[];if(i){var u,l=g(n.entries());try{for(l.s();!(u=l.n()).done;){var c=m(u.value,2),h=c[0],d=c[1];a&&d.toolsType===k.EToolsKey.Text?s.push(p(p({},d),{},{workId:h,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):s.push(p(p({},d),{},{workId:h,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}))}}catch(e){l.e(e)}finally{l.f()}}return{sp:s}}}]),a}(O),L=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.ZIndexNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,o=t.isSync,a=r.sp||[];if(i&&a){var s,u=g(n.entries());try{for(u.s();!(s=u.n()).done;){var l=m(s.value,2),c=l[0],h=l[1];a.push(p(p({},h),{},{workId:c,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}))}}catch(e){u.e(e)}finally{u.f()}}return{sp:a}}}]),a}(O),j=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.TranslateNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.workId,o=t.updateNodeOpt,a=t.willRefreshSelector,s=t.willSyncService,u=t.willSerializeData,l=t.textUpdateForWoker,c=t.emitEventType,e.t0=i===k.Storage_Selector_key&&o,!e.t0){e.next=9;break}if(!(o.workState===k.EvevtWorkState.Done&&null!=o&&o.translate&&(o.translate[0]||o.translate[1])||o.workState!==k.EvevtWorkState.Done)){e.next=8;break}return e.next=6,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:o,willRefreshSelector:a,willSyncService:s,willSerializeData:u,isSync:!0,textUpdateForWoker:l,emitEventType:c,callback:this.updateSelectorCallback});case 6:e.next=9;break;case 8:o.workState===k.EvevtWorkState.Done&&(null==(n=this.localWork)||n.vNodes.deleteLastTarget());case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=t.updateSelectorOpt,l=t.textUpdateForWoker,c=u.workState,h=r.sp||[];if(c===k.EvevtWorkState.Start)return{sp:[],render:[]};var d=null==o?void 0:o.selectRect;if(a){c===k.EvevtWorkState.Doing&&h.push({type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:d,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});var f,v=g(n.entries());try{for(v.s();!(f=v.n()).done;){var y=m(f.value,2),_=y[0],b=y[1];l&&b.toolsType===k.EToolsKey.Text?h.push(p(p({},b),{},{workId:_,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):h.push(p(p({},b),{},{workId:_,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){v.e(e)}finally{v.f()}}return{sp:h}}}]),a}(O),z=function(e){n(i,e);var t,r=o(i);function i(){var e;return b(this,i),e=r.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.DeleteNode),e}return w(i,[{key:"consume",value:(t=d(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!1);case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),i}(O),B=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.ScaleNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willSyncService,a=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willSyncService:o,willSerializeData:a,isSync:!0,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,o=e.newServiceStore,a=t.updateSelectorOpt,s=t.willSyncService,u=a.workState,l=r.sp||[],c=null==i?void 0:i.selectRect;if(u===k.EvevtWorkState.Start)return{sp:[],render:[]};if(s){l.push({type:k.EPostMessageType.Select,selectIds:n.selectIds,selectRect:c,willSyncService:!0,isSync:!0,points:u===k.EvevtWorkState.Done&&n.getChildrenPoints()||void 0,textOpt:n.textOpt});var h,d=g(o.entries());try{for(d.s();!(h=d.n()).done;){var f=m(h.value,2),v=f[0],y=f[1];y.toolsType===k.EToolsKey.Text?l.push(p(p({},y),{},{workId:v,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):l.push(p(p({},y),{},{workId:v,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}))}}catch(e){d.e(e)}finally{d.f()}}return{sp:l}}}]),a}(O),U=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.RotateNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.emitEventType,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,emitEventType:u,isSync:!0,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,o=e.newServiceStore,a=t.updateSelectorOpt,s=t.willSyncService,u=t.willSerializeData,l=t.isSync,c=a.workState,h=r.sp||[],d=null==i?void 0:i.selectRect;if(s){u&&c===k.EvevtWorkState.Done&&h.push({type:k.EPostMessageType.Select,selectIds:n.selectIds,selectRect:d,willSyncService:!0,isSync:l,points:n.getChildrenPoints()});var f,v=g(o.entries());try{for(v.s();!(f=v.n()).done;){var y=m(f.value,2),_=y[0],b=y[1];h.push(p(p({},b),{},{workId:_,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){v.e(e)}finally{v.f()}}return{sp:h}}}]),a}(O),F=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetFontStyle),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=t.updateSelectorOpt,l=t.textUpdateForWoker,c=r.sp||[],h=null==o?void 0:o.selectRect;if(a&&c){u.fontSize&&c.push({type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:h,willSyncService:a,isSync:s,points:i.getChildrenPoints()});var d,f=g(n.entries());try{for(f.s();!(d=f.n()).done;){var v=m(d.value,2),y=v[0],_=v[1];l&&_.toolsType===k.EToolsKey.Text?c.push(p(p({},_),{},{workId:y,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):c.push(p(p({},_),{},{workId:y,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){f.e(e)}finally{f.f()}}return{sp:c}}}]),a}(O),W=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetPoint),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:s,isSync:!0,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=r.sp||[],l=null==o?void 0:o.selectRect;if(a&&u){var c,h=g(n.entries());try{for(h.s();!(c=h.n()).done;){var d=m(c.value,2),f=d[0],v=d[1];u.push(p(p({},v),{},{workId:f,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){h.e(e)}finally{h.f()}u.push({type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:l,willSyncService:a,isSync:s,points:i.getChildrenPoints()})}return{sp:u}}}]),a}(O),G=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetLock),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=t.updateSelectorOpt,l=r.sp||[],c=null==o?void 0:o.selectRect;if(a&&l){var h,d=g(n.entries());try{for(d.s();!(h=d.n()).done;){var f=m(h.value,2),v=f[0],y=f[1];l.push(p(p({},y),{},{workId:v,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){d.e(e)}finally{d.f()}l.push({isLocked:u.isLocked,selectorColor:i.selectorColor,scaleType:i.scaleType,canRotate:i.canRotate,type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:c,willSyncService:a,isSync:s})}return{sp:l}}}]),a}(O),V=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetShapeOpt),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,o=t.isSync,a=r.sp||[];if(i&&a){var s,u=g(n.entries());try{for(u.s();!(s=u.n()).done;){var l=m(s.value,2),c=l[0],h=l[1];a.push(p(p({},h),{},{workId:c,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}))}}catch(e){u.e(e)}finally{u.f()}}return{sp:a}}}]),a}(O),H=function(){function e(t){var r=this;b(this,e),M(this,"builders",new Map),this.builders=new Map(t.map((function(e){return[e,r.build(e)]})))}var t;return w(e,[{key:"build",value:function(e){switch(e){case k.EmitEventType.TranslateNode:return new j;case k.EmitEventType.ZIndexNode:return new L;case k.EmitEventType.CopyNode:return new R;case k.EmitEventType.SetColorNode:return new D;case k.EmitEventType.DeleteNode:return new z;case k.EmitEventType.ScaleNode:return new B;case k.EmitEventType.RotateNode:return new U;case k.EmitEventType.SetFontStyle:return new F;case k.EmitEventType.SetPoint:return new W;case k.EmitEventType.SetLock:return new G;case k.EmitEventType.SetShapeOpt:return new V}}},{key:"registerForMainThread",value:function(e){return this.builders.forEach((function(t){t&&t.registerMainThread(e)})),this}},{key:"consumeForMainThread",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=g(this.builders.values()),e.prev=1,r.s();case 3:if((n=r.n()).done){e.next=11;break}return i=n.value,e.next=7,null==i?void 0:i.consume(t);case 7:if(!e.sent){e.next=9;break}return e.abrupt("return",!0);case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),r.e(e.t0);case 16:return e.prev=16,r.f(),e.finish(16);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(e){return t.apply(this,arguments)})}]),e}(),Y=function(){function e(t,r){b(this,e),M(this,"viewId"),M(this,"fullLayer"),M(this,"topLayer"),M(this,"localLayer"),M(this,"serviceLayer"),M(this,"snapshotFullLayer"),M(this,"vNodes"),M(this,"master"),M(this,"opt"),M(this,"cameraOpt"),M(this,"scene"),M(this,"localWork"),M(this,"serviceWork"),M(this,"topWork"),M(this,"taskUpdateCameraId"),M(this,"debounceUpdateCameraId"),M(this,"debounceUpdateCache",new Set),M(this,"mainThreadPostId"),M(this,"combinePostMsg",new Set),M(this,"methodBuilder"),M(this,"cacheImages",new Map),M(this,"imageResolveMap",new Map),this.viewId=t,this.opt=r,this.scene=this.createScene(p(p({},r.canvasOpt),{},{container:r.container})),this.master=r.master;var n=k.DefaultAppliancePluginOptions.bufferSize.full,i=k.DefaultAppliancePluginOptions.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:this.viewId===k.Main_View_Id?n:i})),this.topLayer=this.createLayer("topLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:(this.viewId,k.Main_View_Id,i)})),this.localLayer=this.createLayer("localLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:(this.viewId,k.Main_View_Id,i)})),this.serviceLayer=this.createLayer("serviceLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:(this.viewId,k.Main_View_Id,i)})),this.vNodes=new A(t,this.scene);var o={thread:this,vNodes:this.vNodes};this.localWork=new P(o),this.serviceWork=new N(o),this.topWork=new C(o),this.vNodes.init(this.fullLayer),this.methodBuilder=new H([k.EmitEventType.CopyNode,k.EmitEventType.SetColorNode,k.EmitEventType.DeleteNode,k.EmitEventType.RotateNode,k.EmitEventType.ScaleNode,k.EmitEventType.TranslateNode,k.EmitEventType.ZIndexNode,k.EmitEventType.SetFontStyle,k.EmitEventType.SetPoint,k.EmitEventType.SetLock,k.EmitEventType.SetShapeOpt]).registerForMainThread(this)}var t,r,n,i,o;return w(e,[{key:"getCachedImages",value:function(e){return this.cacheImages.get(e)}},{key:"clearCacheImages",value:function(){this.cacheImages.forEach((function(e){return e.close()})),this.cacheImages.clear()}},{key:"clearImageResolveMap",value:function(){this.imageResolveMap.forEach((function(e){var t=e.timer;t&&clearTimeout(t)})),this.imageResolveMap.clear()}},{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(o=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h,d,f,p,v,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.methodBuilder.consumeForMainThread(t);case 2:if(e.sent){e.next=43;break}n=t.msgType,i=t.toolsType,o=t.opt,a=t.dataType,s=t.workId,u=t.workState,l=t.imageSrc,c=t.imageBitmap,h=null==s?void 0:s.toString(),e.t0=n,e.next=e.t0===k.EPostMessageType.AuthClear?7:e.t0===k.EPostMessageType.Destroy?10:e.t0===k.EPostMessageType.Clear?12:e.t0===k.EPostMessageType.UpdateCamera?14:e.t0===k.EPostMessageType.UpdateTools?17:e.t0===k.EPostMessageType.CreateWork?19:e.t0===k.EPostMessageType.DrawWork?25:e.t0===k.EPostMessageType.UpdateNode||e.t0===k.EPostMessageType.FullWork?27:e.t0===k.EPostMessageType.RemoveNode?32:e.t0===k.EPostMessageType.Select?35:e.t0===k.EPostMessageType.CursorHover?37:e.t0===k.EPostMessageType.GetTextActive?39:e.t0===k.EPostMessageType.GetImageBitMap?41:43;break;case 7:return d=t.clearUids,f=t.localUid,this.vNodes.setCanClearUids(d),this.vNodes.setLocalUid(f),e.abrupt("break",43);case 10:return this.destroy(),e.abrupt("break",43);case 12:return this.clearAll(),e.abrupt("break",43);case 14:return e.next=16,this.updateCamera(t);case 16:return e.abrupt("break",43);case 17:return i&&o&&(p={toolsType:i,toolsOpt:o},this.topWork.canUseTopLayer(i)?this.topWork.setToolsOpt(p):this.localWork.setToolsOpt(p)),e.abrupt("break",43);case 19:if(!(h&&o&&i)){e.next=24;break}if(!this.topWork.canUseTopLayer(i)){e.next=23;break}return this.topWork.getToolsOpt()||this.topWork.setToolsOpt({toolsType:i,toolsOpt:o}),this.topWork.setWorkOptions(h,o),e.abrupt("break",43);case 23:this.localWork.getToolsOpt()||this.localWork.setToolsOpt({toolsType:i,toolsOpt:o}),this.localWork.setWorkOptions(h,o);case 24:return e.abrupt("break",43);case 25:return u===k.EvevtWorkState.Done&&a===k.EDataType.Local?this.consumeDrawAll(a,t):this.consumeDraw(a,t),e.abrupt("break",43);case 27:if(!i||!this.topWork.canUseTopLayer(i)){e.next=30;break}return this.consumeDrawAll(a,t),e.abrupt("break",43);case 30:return this.consumeFull(a,t),e.abrupt("break",43);case 32:return e.next=34,this.removeNode(t);case 34:return e.abrupt("return");case 35:return a===k.EDataType.Service&&(s===k.Storage_Selector_key?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t)),e.abrupt("break",43);case 37:return this.localWork.cursorHover(t),e.abrupt("break",43);case 39:return a===k.EDataType.Local&&this.localWork.checkTextActive(t),e.abrupt("break",43);case 41:return l&&c&&this.cacheImages.set(l,c),s&&(v=s.toString(),(m=null==(r=this.imageResolveMap.get(v))?void 0:r.resolve)&&m(v)),e.abrupt("break",43);case 43:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"loadImageBitMap",value:(i=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.toolsType,n=t.opt,i=t.workId,!(r===k.EToolsKey.Image&&n&&n.src&&i)){e.next=9;break}if(o=n.src,a=this.cacheImages.has(o),s=i.toString(),a){e.next=8;break}return e.next=6,new Promise((function(e){var t=l.imageResolveMap.get(s)||{resolve:void 0,timer:void 0};t.timer&&clearTimeout(t.timer),t.resolve=e,t.timer=setTimeout((function(){var e=l.imageResolveMap.get(s);null!=e&&e.resolve&&e.resolve(s)}),5e3),l.imageResolveMap.set(s,t),l.opt.post({sp:[{imageSrc:o,workId:s,viewId:l.viewId,isgl:!!l.fullLayer.parent.gl,isSubWorker:!1,type:k.EPostMessageType.GetImageBitMap}]})}));case 6:u=e.sent,this.imageResolveMap.delete(u);case 8:return e.abrupt("return",this.cacheImages.get(o));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"removeNode",value:(n=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.dataType,n=t.workId,i=t.removeIds,o=i||[],n&&o.push(n.toString()),!o.length){e.next=24;break}a=g(o),e.prev=3,a.s();case 5:if((s=a.n()).done){e.next=16;break}if(s.value!==k.Storage_Selector_key){e.next=11;break}return e.next=10,this.localWork.removeSelector(t);case 10:return e.abrupt("continue",14);case 11:return r===k.EDataType.Local?this.localWork.removeWork(t):r===k.EDataType.Service&&this.serviceWork.removeWork(t),e.next=14,this.localWork.colloctEffectSelectWork(t);case 14:e.next=5;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),a.e(e.t0);case 21:return e.prev=21,a.f(),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[3,18,21,24]])}))),function(e){return n.apply(this,arguments)})},{key:"consumeFull",value:(r=d(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localWork.colloctEffectSelectWork(r);case 2:if(n=e.sent,e.t0=n&&t===k.EDataType.Local,!e.t0){e.next=7;break}return e.next=7,this.localWork.consumeFull(n);case 7:n&&t===k.EDataType.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"setCameraOpt",value:function(e){this.cameraOpt=e;var t=e.scale,r=e.centerX,n=e.centerY,i=e.width,o=e.height;(i!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:i,height:o}),this.fullLayer.setAttribute("scale",[t,t]),this.fullLayer.setAttribute("translate",[-r,-n]),this.topLayer.setAttribute("scale",[t,t]),this.topLayer.setAttribute("translate",[-r,-n]),this.localLayer.setAttribute("scale",[t,t]),this.localLayer.setAttribute("translate",[-r,-n]),this.serviceLayer.setAttribute("scale",[t,t]),this.serviceLayer.setAttribute("translate",[-r,-n])}},{key:"runBatchPostData",value:function(){this.mainThreadPostId||(this.mainThreadPostId=requestAnimationFrame(this.combinePost.bind(this)))}},{key:"combinePostData",value:function(){var e;this.mainThreadPostId=void 0;var t,r,n=[],i=g(this.combinePostMsg.values());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(null!=(e=o.sp)&&e.length){var a,s=g(o.sp);try{for(s.s();!(a=s.n()).done;){var u,l=a.value,c=!1,h=g(n);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(I.isEqual(l,d)){c=!0;break}}}catch(e){h.e(e)}finally{h.f()}c||n.push(l)}}catch(e){s.e(e)}finally{s.f()}}I.isNumber(o.drawCount)&&(t=o.drawCount)}}catch(e){i.e(e)}finally{i.f()}return this.combinePostMsg.clear(),{sp:n,drawCount:t}}},{key:"combinePost",value:function(){var e,t,r=this,n=this.combinePostData(),i=null==(e=n.sp)?void 0:e.filter((function(e){return e.type!==k.EPostMessageType.None||e.isLockSentEventCursor}));null!=i&&i.length?n.sp=i.map((function(e){return e.viewId?e:p(p({},e),{},{viewId:r.viewId})})):delete n.sp,void 0===n.drawCount&&delete n.drawCount,(null!=n&&n.drawCount||null!=(t=n.sp)&&t.length)&&this.opt.post(n)}},{key:"clearAll",value:function(){this.fullLayer.children.length&&(this.fullLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.fullLayer.removeAllChildren()),this.clearCacheImages(),this.clearImageResolveMap(),this.localWork.clearAll(),this.topWork.clearAll(),this.serviceWork.clearAll(),this.vNodes.clear(),this.post({sp:[{type:k.EPostMessageType.Clear}]})}},{key:"consumeDrawAll",value:function(e,t){var r=t.toolsType,n=t.workId;if(n){var i=n.toString();if(r&&this.topWork.canUseTopLayer(r))return e===k.EDataType.Local&&(this.topWork.getLocalWorkShape(n.toString())||this.topWork.createLocalWork(t)),void this.topWork.consumeDrawAll(t);e===k.EDataType.Local&&(this.localWork.getWorkShape(i)||this.localWork.createLocalWork(t),this.localWork.consumeDrawAll(t,this.serviceWork))}}},{key:"consumeDraw",value:function(e,t){var r=t.opt,n=t.workId,i=t.toolsType;if(n&&i&&r){var o=n.toString();return this.topWork.canUseTopLayer(i)?(e===k.EDataType.Local&&(this.topWork.getLocalWorkShape(o)||this.topWork.createLocalWork(t)),void this.topWork.consumeDraw(t)):void(e===k.EDataType.Local?(this.localWork.getWorkShape(o)||this.localWork.createLocalWork(t),this.localWork.consumeDraw(t,this.serviceWork)):e===k.EDataType.Service&&this.serviceWork.consumeDraw(t))}}},{key:"updateCamera",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h,d,f,p,v,y,_,b,x,w,S,T,M,E,A,C,P,N,O,R,D,L,j,z,B,U,F,W,G,V,H,Y,$,X,q,Q,Z,K,J,ee,te=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.cameraOpt,i=t.scenePath,!n||I.isEqual(this.cameraOpt,n)){e.next=37;break}if(this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0),!i){e.next=28;break}o=!1,a=g(this.localWork.getWorkShapes().entries()),e.prev=5,a.s();case 7:if((s=a.n()).done){e.next=17;break}u=m(s.value,2),l=u[0],c=u[1],e.t0=c.toolsType,e.next=e.t0===k.EToolsKey.Text||e.t0===k.EToolsKey.BitMapEraser||e.t0===k.EToolsKey.PencilEraser||e.t0===k.EToolsKey.Eraser||e.t0===k.EToolsKey.Selector||e.t0===k.EToolsKey.LaserPen?12:13;break;case 12:return e.abrupt("break",15);case 13:return l!==k.Cursor_Hover_Id&&l!==k.Storage_Selector_key&&(o=!0),e.abrupt("break",15);case 15:e.next=7;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(5),a.e(e.t1);case 22:return e.prev=22,a.f(),e.finish(22);case 25:if(!o){e.next=28;break}return this.taskUpdateCameraId=setTimeout((function(){te.taskUpdateCameraId=void 0,te.updateCamera(t)}),k.Task_Time_Interval),e.abrupt("return");case 28:h=new Map,d=g(this.vNodes.getNodesByType(k.EToolsKey.Text).entries());try{for(d.s();!(f=d.n()).done;)p=m(f.value,2),v=p[0],y=p[1],_=y.rect,h.set(v,I.cloneDeep(_))}catch(e){d.e(e)}finally{d.f()}if(b=new Set(h.keys()),x=!1,this.localWork.hasSelector()&&(w=null==(r=this.localWork.getSelector())?void 0:r.selectIds)){x=!0,S=g(w);try{for(S.s();!(T=S.n()).done;)M=T.value,b.add(M)}catch(e){S.e(e)}finally{S.f()}}if(E=!1,this.serviceWork.selectorWorkShapes.size){A=g(this.serviceWork.selectorWorkShapes.values());try{for(A.s();!(C=A.n()).done;)if(P=C.value,N=P.selectIds){E=!0,O=g(N);try{for(O.s();!(R=O.n()).done;)D=R.value,b.add(D)}catch(e){O.e(e)}finally{O.f()}}}catch(e){A.e(e)}finally{A.f()}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(b),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId),L=g(h.entries());try{for(L.s();!(j=L.n()).done;)z=m(j.value,2),B=z[0],U=z[1],(F=this.vNodes.get(B))&&(W=U,G=F.rect,V=this.getSceneRect(),H=k.getRectMatrixrRelation(W,V),Y=k.getRectMatrixrRelation(G,V),$=!1,(H!==Y||W.w!==G.w||W.h!==G.h||Y===k.EMatrixrRelationType.intersect)&&($=!0),$&&(X=F.toolsType,q=F.opt,X===k.EToolsKey.Text&&q.workState===k.EvevtWorkState.Done&&this.debounceUpdateCache.add(B)))}catch(e){L.e(e)}finally{L.f()}if(x&&this.localWork.reRenderSelector(),E){Q=g(this.serviceWork.selectorWorkShapes.entries());try{for(Q.s();!(Z=Q.n()).done;)K=m(Z.value,2),J=K[0],ee=K[1],this.serviceWork.runSelectWork({workId:J,selectIds:ee.selectIds,msgType:k.EPostMessageType.Select,dataType:k.EDataType.Service,viewId:this.viewId})}catch(e){Q.e(e)}finally{Q.f()}}this.debounceUpdateCameraId=setTimeout((function(){var e;te.debounceUpdateCameraId=void 0;var t,r=[],n=g(te.debounceUpdateCache.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null==(e=te.fullLayer)?void 0:e.getElementsByName(i)[0]){var o=te.vNodes.get(i);if(o){var a=o.toolsType,s=o.opt,u=o.rect,l=te.localWork.setFullWork({toolsType:a,opt:s,workId:i});if(l){var c=te.getSceneRect(),h=k.getRectMatrixrRelation(u,c);r.push(l.consumeServiceAsync({isFullWork:!0,replaceId:i,isDrawLabel:h!==k.EMatrixrRelationType.outside}))}}}te.debounceUpdateCache.delete(i)}}catch(e){n.e(e)}finally{n.f()}te.vNodes.updateLowLevelNodesRect(),te.vNodes.clearHighLevelIds()}),k.Task_Time_Interval)}case 37:case"end":return e.stop()}}),e,this,[[5,19,22,25]])}))),function(e){return t.apply(this,arguments)})},{key:"getSceneRect",value:function(){var e=this.scene,t=e.width,r=e.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(r)}}},{key:"createScene",value:function(e){return new E.Scene(p(p({displayRatio:this.opt.displayer.dpr,depth:!1,desynchronized:!0},e),{},{autoRender:!0,id:this.viewId,contextType:"2d"}))}},{key:"createLayer",value:function(e,t,r){var n=r.width,i=r.height,o="canvas-".concat(e),a=t.layer(o,p(p({},r),{},{offscreen:!1})),s=new E.Group({anchor:[.5,.5],pos:[.5*n,.5*i],size:[n,i],name:"viewport",id:e});return a.append(s),s}},{key:"updateScene",value:function(e){this.scene.attr(p({},e));var t=e.width,r=e.height;this.scene.width=t,this.scene.height=r,this.updateLayer({width:t,height:r})}},{key:"updateLayer",value:function(e){var t=e.width,r=e.height;this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",r),this.fullLayer.setAttribute("size",[t,r]),this.fullLayer.setAttribute("pos",[.5*t,.5*r]),this.topLayer.parent.setAttribute("width",t),this.topLayer.parent.setAttribute("height",r),this.topLayer.setAttribute("size",[t,r]),this.topLayer.setAttribute("pos",[.5*t,.5*r]),this.localLayer.parent.setAttribute("width",t),this.localLayer.parent.setAttribute("height",r),this.localLayer.setAttribute("size",[t,r]),this.localLayer.setAttribute("pos",[.5*t,.5*r]),this.serviceLayer.parent.setAttribute("width",t),this.serviceLayer.parent.setAttribute("height",r),this.serviceLayer.setAttribute("size",[t,r]),this.serviceLayer.setAttribute("pos",[.5*t,.5*r])}},{key:"destroy",value:function(){this.clearCacheImages(),this.clearImageResolveMap(),this.vNodes.clear(),this.fullLayer.remove(),this.topLayer.remove(),this.localLayer.remove(),this.serviceLayer.remove(),this.scene.remove(),this.localWork.destroy(),this.serviceWork.destroy(),this.topWork.destroy()}}]),e}(),$=function(){function e(t,r){b(this,e),M(this,"viewId"),M(this,"fullLayer"),M(this,"master"),M(this,"opt"),M(this,"scene"),M(this,"mainThreadPostId"),M(this,"combinePostMsg",new Set),M(this,"workShapes",new Map),M(this,"cacheImages",new Map),M(this,"imageResolveMap",new Map),this.viewId=t,this.opt=r,this.scene=this.createScene(p(p({},r.canvasOpt),{},{container:r.container})),this.master=r.master,this.fullLayer=this.createLayer("fullLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:this.viewId===k.Main_View_Id?6e3:3e3}))}var t,r,n,i,o,a;return w(e,[{key:"getCachedImages",value:function(e){return this.cacheImages.get(e)}},{key:"clearCacheImages",value:function(){this.cacheImages.forEach((function(e){return e.close()})),this.cacheImages.clear()}},{key:"clearImageResolveMap",value:function(){this.imageResolveMap.forEach((function(e){var t=e.timer;t&&clearTimeout(t)})),this.imageResolveMap.clear()}},{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(a=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.msgType,i=t.imageSrc,o=t.imageBitmap,a=t.workId,e.t0=n,e.next=e.t0===k.EPostMessageType.Snapshot?4:e.t0===k.EPostMessageType.BoundingBox?8:e.t0===k.EPostMessageType.GetImageBitMap?12:14;break;case 4:return e.next=6,this.getSnapshot(t);case 6:case 10:return this.destroy(),e.abrupt("return");case 8:return e.next=10,this.getBoundingRect(t);case 12:return i&&o&&this.cacheImages.set(i,o),a&&(s=a.toString(),(u=null==(r=this.imageResolveMap.get(s))?void 0:r.resolve)&&u(s)),e.abrupt("break",14);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"loadImageBitMap",value:(o=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.toolsType,n=t.opt,i=t.workId,!(r===k.EToolsKey.Image&&n&&n.src&&i)){e.next=9;break}if(o=n.src,a=this.cacheImages.has(o),s=i.toString(),a){e.next=8;break}return e.next=6,new Promise((function(e){var t=l.imageResolveMap.get(s)||{resolve:void 0,timer:void 0};t.timer&&clearTimeout(t.timer),t.resolve=e,t.timer=setTimeout((function(){var e=l.imageResolveMap.get(s);null!=e&&e.resolve&&e.resolve(s)}),5e3),l.imageResolveMap.set(s,t),l.opt.post({sp:[{imageSrc:o,workId:s,viewId:l.viewId,isgl:!!l.fullLayer.parent.gl,isSubWorker:!0,type:k.EPostMessageType.GetImageBitMap}]})}));case 6:u=e.sent,this.imageResolveMap.delete(u);case 8:return e.abrupt("return",this.cacheImages.get(o));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"createWorkShapeNode",value:function(e){return k.getShapeInstance(p(p({},e),{},{fullLayer:this.fullLayer,drawLayer:void 0}))}},{key:"setFullWork",value:function(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r&&n){var i,o=t.toString();return t&&this.workShapes.has(o)?null==(i=this.workShapes.get(o))||i.setWorkOptions(r):i=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:o}),i?(this.workShapes.set(o,i),i):void 0}}},{key:"runFullWork",value:(i=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.setFullWork(t),i=t.ops&&k.transformToNormalData(t.ops),!n){e.next=17;break}if(s=null==(r=n.getWorkId())?void 0:r.toString(),n.toolsType!==k.EToolsKey.Image){e.next=9;break}return e.next=6,n.consumeServiceAsync({isFullWork:!0,worker:this});case 6:o=e.sent,e.next=16;break;case 9:if(n.toolsType!==k.EToolsKey.Text){e.next=15;break}return e.next=12,n.consumeServiceAsync({isFullWork:!0,replaceId:s,isDrawLabel:!0});case 12:o=e.sent,e.next=16;break;case 15:o=n.consumeService({op:i,isFullWork:!0,replaceId:s}),a=(null==t?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);case 16:return e.abrupt("return",k.computRect(o,a));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getSnapshot",value:(n=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h,d,f,v,g,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,o=t.w,a=t.h,!(r&&n&&i)){e.next=23;break}this.setCameraOpt(i),u=0,l=Object.entries(n);case 4:if(!(u0&&Math.floor(e.w*this.opt.displayer.dpr||1)||1,o=e.h>0&&Math.floor(e.h*this.opt.displayer.dpr||1)||1;return createImageBitmap(this.fullLayer.parent.canvas,r,n,i,o,t)}},{key:"getSnapshotRender",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.scenePath,o=t.options,(null==(r=this.fullLayer)?void 0:r.parent).render(),e.next=4,this.getRectImageBitmap(this.getSceneRect(),o);case 4:(a=e.sent)&&(this.post({sp:[{type:k.EPostMessageType.Snapshot,scenePath:i,imageBitmap:a,viewId:this.viewId}]}),null==(n=this.fullLayer)||n.removeAllChildren());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getBoundingRect",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,!(r&&n&&i)){e.next=19;break}this.setCameraOpt(i),a=0,s=Object.entries(n);case 4:if(!(a20&&(e.value=Math.floor(1e3*e.times/e.valueTotal),e.valueTotal=0,e.times=0,e.destroyed||e.emit("update",e.value)),e.prevTime=t,e.destroyed||e.calcFps()}))}},{key:"destroy",value:function(){this.destroyed=!0}}]),r}(Ks.a);!function(e){e.ResourceError="RESOURCE_ERROR",e.RuntimeError="RUNTIME_ERROR",e.RuntimeWarn="RUNTIME_WARN",e.CanvasCrash="CANVAS_CRASH"}(Zp||(Zp={}));var nv=function(e){p(r,e);var t=m(r);function r(e,n){var i,o,a;return x(this,r),o=y(i=t.call(this,n)),a=(this instanceof r?this.constructor:void 0).prototype,Object.setPrototypeOf?Object.setPrototypeOf(o,a):o.__proto__&&(o.__proto__=a),i.errorType=e,i.errorMsg=n,i}return S(r,null,[{key:"transform",value:function(e){return e instanceof r?e:new r(Zp.RuntimeError,e.message)}}]),r}(n(Error));function iv(){return function(e,t,r){var n=r.value;r.value=function(){try{for(var e=arguments.length,t=new Array(e),r=0;r2048||b>2048)&&(x=(y*=2048/_)*b)>2048&&(y*=b/x),w=document.createElement("canvas"),S=Math.ceil(g.width*y),T=Math.ceil(g.height*y),w.width=S,w.height=T,w.getContext("2d").drawImage(g,0,0,S,T),M=w.toDataURL("image/png"),k=new $l.c(M,{resolution:1}),r.abrupt("return",(this.logger.info("load end. "+o,this.taskId||""),this.useCache&&this.localStorage.setItem(u,{scale:y,scaledBase64:M}).catch((function(){})),{baseTexture:k,scale:y}));case 70:case"end":return r.stop()}}),r,this,[[22,34],[39,52]])})))}},{key:"destroy",value:function(){}}]),e}(),mv=function(){function e(t){var r=this;x(this,e),this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=function(e){var t=e/(rd.b.TARGET_FPMS||.06);if(!r.isPaused){r.timestamp+=t,r.callbackList=r.callbackList.filter((function(e){return e&&!e.applied}));for(var n=r.callbackList.length,i=0;i=0&&!this.callbackList[t].running&&this.callbackList.splice(t,1)}},{key:"delay",value:function(e){var t=this;return new Promise((function(r){t.setTimeout(r,e)}))}},{key:"waitUntil",value:function(e,t){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=this.timestamp;case 1:if(e()||!(this.timestamp-n90&&a<270||a<-90&&a>-270)&&(n=-n),i=s*n}return{x:n,y:i}}function Mv(e,t,r,n,i,o){var a,s,u,l,c,h=e,d=t;if(0===Math.round(n))a=i,s=o,c=0;else if(Math.round(n)>=360)a=i,s=o,u=i+2*e*Math.abs(Math.cos(-r/180*Math.PI)),l=o+2*t*Math.sin(-r/180*Math.PI),c=1;else{var f=-(r+n),p=Tv(-r,h,d),v=i-p.x,m=o+p.y,g=Tv(f,h,d);a=g.x+v,s=m-g.y,c=n>=-360&&n<-180?1:n>=-180&&n<0||n>0&&n<180?0:1}return{radiusX:h,radiusY:d,xAxisRotation:0,largeArcFlag:c,sweepFlag:n>0?1:0,endX:a,endY:s,middleX:u,middleY:l}}var kv=function(){function e(){x(this,e),this.pool=[]}return S(e,[{key:"getObject",value:function(e){var t=this.pool.find((function(e){return!e.isUsed}));if(t)return t.isUsed=!0,t.obj;var r={obj:this.createObject(),isUsed:!0,group:e};return this.pool.push(r),r.obj}},{key:"collectObject",value:function(e){var t=this.pool.find((function(t){return t.obj===e}));t&&(t.isUsed=!1,this.resetObject(t.obj))}},{key:"collectObjectByGroup",value:function(e){var t=this;this.pool.filter((function(t){return t.group===e})).forEach((function(e){return t.collectObject(e.obj)}))}}]),e}(),Ev=new(function(e){p(r,e);var t=m(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("version","1.1"),e}},{key:"resetObject",value:function(e){e.removeAttribute("viewBox"),e.removeAttribute("width"),e.removeAttribute("height"),e.innerHTML=""}}]),r}(kv)),Iv=new(function(e){p(r,e);var t=m(r);function r(){return x(this,r),t.apply(this,arguments)}return S(r,[{key:"createObject",value:function(){return document.createElement("img")}},{key:"resetObject",value:function(e){e.removeAttribute("src")}}]),r}(kv)),Av=function(){function e(t){x(this,e),this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null),this.maxResolution=t}return S(e,[{key:"render",value:function(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,l,h,d,f,p,v,m=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.items,o=e.width,a=e.height,s=Iv.getObject(r),u=new $l.c(s,{width:o*n,height:a*n,resolution:1}),l=Ev.getObject(r),this.imgElements.push(s),this.svgElements.push(l),l.setAttribute("viewBox","0 0 ".concat(o," ").concat(a)),l.setAttribute("width",""+o),l.setAttribute("height",""+a),h={},i.forEach((function(e){var t=e.item,r=e.x,i=e.y,o=r+2,a=i+2;t.pathsData.forEach((function(e){var t="";e.cmds.forEach((function(r){var n=c(r,2),i=n[0],s=n[1];t+=i+" ",t+=s.map((function(t){return Sv()(t)||(t.x=t.x+e.offset.x+o,t.y=t.y+e.offset.y+a),t})).reduce((function(e,t){return Sv()(t)?e+=t+" ":e+="".concat(t.x," ").concat(t.y," "),e}),""),t+=" "})),e.pathElement.setAttribute("d",t),l.appendChild(e.pathElement)}));var s=t.width-4-2*t.padding,d=t.height-4-2*t.padding;m.textures[t.hash]={texture:new $l.t(u,new jl.j((o+2)*n,(a+2)*n,s*n,d*n)),pivot:t.pivot,scale:1/n},h[t.hash]=m.hashToIdMap[t.hash]})),f=''+l.outerHTML,d="data:image/svg+xml,"+encodeURIComponent(f).replace(/'/g,"%27").replace(/"/g,"%22"),(p=document.createElement("img")).src=d,t.next=9,new Promise((function(e,t){p.onload=function(){return e("")},p.onerror=function(){return t()}}));case 9:return(v=document.createElement("canvas")).width=p.width*n,v.height=p.height*n,v.getContext("2d").drawImage(p,0,0,v.width,v.height),s.src=v.toDataURL("image/png"),t.next=15,new Promise((function(e,t){s.onload=function(){return e("")},s.onerror=function(){return t()}}));case 15:case"end":return t.stop()}}),t,this)})))}},{key:"getGraphicsData",value:function(e){var t=this.idToHashMap[e]||"";return this.textures[t]||null}},{key:"addGraphics",value:function(e,t,r,n,i,o,a,s,u,l,h){var d,f;if(!a&&!u)return e;var p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A,C,P,N=xv()(r+(null!==(f=null===(d=null==a?void 0:a.width)||void 0===d?void 0:d.toString())&&void 0!==f?f:0)+u+l+h);if(this.hashToIdMap[N]||(this.hashToIdMap[N]=[]),this.hashToIdMap[N].push(e),this.idToHashMap[e]=N,this.graphics.findIndex((function(e){return e.hash===N}))<0){var O=(p=t,v=i,m=o,g=a,y=n,_=u,b=l,x=h,S=[],T={x:Math.abs(y.x),y:Math.abs(y.y)},M=0,k=0,E=0,I=0,A=0,C="none",P=null!==(w=null==g?void 0:g.width)&&void 0!==w?w:0,_?(M=v,k=m,A=0):(C=x||"#ff0000",A=P,E=.5*P,I=.5*P,M=v+P,k=m+P,T.x+=.5*P,T.y+=.5*P),M+=Math.abs(y.x),k+=Math.abs(y.y),E+=Math.abs(y.x),I+=Math.abs(y.y),M+=4,k+=4,E+=2,I+=2,M=Math.ceil(M),k=Math.ceil(k),p.forEach((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==e.fill&&_?t.setAttribute("fill",b||"#ff0000"):t.setAttribute("fill","none"),e.hasStroke&&!_&&(t.setAttribute("stroke-linecap",(null==g?void 0:g.cap)||"butt"),t.setAttribute("stroke-linejoin",(null==g?void 0:g.join)||"miter"),t.setAttribute("stroke-width",A.toString()),t.setAttribute("stroke",C),(null==g?void 0:g.dash)&&t.setAttribute("stroke-dasharray",g.dash));for(var r=e.scale,n=e.path.trim().split(" "),i={x:0,y:0},o={offset:{x:E,y:I},cmds:[],pathElement:t},a=0;a=360?(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.middleX/9525*r.x,y:T.middleY/9525*r.y}]]),o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]])):(i={x:T.endX,y:T.endY},o.cmds.push(["A",[T.radiusX/9525*r.x,T.radiusY/9525*r.y,T.xAxisRotation,T.largeArcFlag,T.sweepFlag,{x:T.endX/9525*r.x,y:T.endY/9525*r.y}]]))}else if("L"===s){var M=c(u.split(",").map((function(e){return Number(e)})),2),k=M[0],P=M[1];i={x:k,y:P},k=k/9525*r.x,P=P/9525*r.y,o.cmds.push(["L",[{x:k,y:P}]])}else if("QB"===s){var N=c(u.split(",").map((function(e){return Number(e)})),4),O=N[0],R=N[1],D=N[2],L=N[3];i={x:D,y:L},O=O/9525*r.x,R=R/9525*r.y,D=D/9525*r.x,L=L/9525*r.y,o.cmds.push(["Q",[{x:O,y:R},{x:D,y:L}]])}else if("CB"===s){var j=c(u.split(",").map((function(e){return Number(e)})),6),z=j[0],B=j[1],U=j[2],F=j[3],W=j[4],G=j[5];i={x:W,y:G},z=z/9525*r.x,B=B/9525*r.y,U=U/9525*r.x,F=F/9525*r.y,W=W/9525*r.x,G=G/9525*r.y,o.cmds.push(["C",[{x:z,y:B},{x:U,y:F},{x:W,y:G}]])}else"C"===s&&o.cmds.push(["Z",[]])}S.push(o)})),{graphicsWidth:M,graphicsHeight:k,pivot:T,padding:2,pathsData:S}),R=O.graphicsWidth,D=O.graphicsHeight,L=O.pathsData,j=O.pivot,z=O.padding;this.graphics.push({hash:N,pathsData:L,pivot:j,width:R,height:D,padding:z})}return e}},{key:"pack",value:function(){return this.graphics.forEach((function(e){e.width+=4,e.height+=4})),function e(t){for(var r=[],n=t.filter((function(e){var t=e.width<2048&&e.height<2048;return t||r.push(e),t})).sort((function(e,t){return e.width*e.height-t.width*t.height})),i=n.length+1,o=2050,a=2050,s=[],u=null;(o>2048||a>2048)&&n.length>0;)i-=1,o=(u=av()(n.slice(0,i))).width,a=u.height;return u&&s.push(u),r.forEach((function(e){var t=av()([e]);s.push(t)})),i2&&void 0!==arguments[2]?arguments[2]:{type:"el",index:0,id:""},o=this.targets[e.id];return"shape"!==e.type?o:("shape"===e.type&&e.txEl&&(o=null!==(r=null==o?void 0:o.getTextElement(e.txEl.type,e.txEl.range))&&void 0!==r?r:null),"shape"===e.type&&e.bg&&0===i.index&&(t=!1,o=null!==(n=null==o?void 0:o.getBgElement())&&void 0!==n?n:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),t&&o?o.getIterateEntry(i.type,i.index,i.id):(o||this.eventHub.emit("IterateTimeNodeEnd",i.id),o))}},{key:"clearTargets",value:function(){this.targets=Object.create(null)}}]),e}(),Nv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.strokeColorFilter.currentColor},set:function(e){this.target.strokeColorFilter.color=e}},{key:"on",get:function(){return this.target.strokeActive?"true":"false"},set:function(e){this.target.strokeActive="true"===e}}]),e}(),Ov=function e(t){var r=this;x(this,e),this.applyCommand=function(e,t){r.target.applyCommand(e,t)},this.target=t},Rv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"toString",value:function(){return this.color}},{key:"color",get:function(){return this.target.pptColorFilter.currentColor},set:function(e){this.target.pptColorActive&&(this.target.pptColorFilter.color=e)}},{key:"on",get:function(){return this.target.pptColorActive?"true":"false"},set:function(e){this.target.pptColorActive="true"===e}},{key:"designColor",get:function(){return this.target.pptColorFilter.designColor}}]),e}(),Dv=function(){function e(t){x(this,e),this.target=t}return S(e,[{key:"color",get:function(){return this.target.fillColorFilter.currentColor},set:function(e){this.target.fillActive&&(this.target.fillColorFilter.color=e)}},{key:"on",get:function(){return this.target.fillActive?"true":"false"},set:function(e){this.target.fillActive="true"===e}},{key:"designColor",get:function(){return this.target.fillColorFilter.designColor}}]),e}(),Lv=function(){function e(t,r,n){x(this,e),this.hardHidden=!1,this.designRotation=0,this.target=t,!0===r&&(this.hardHidden=!0),this.designRotation=n}return S(e,[{key:"opacity",get:function(){return this.target.alpha},set:function(e){this.target.alpha=e}},{key:"rotation",get:function(){return this.target.rotation/Math.PI*180},set:function(e){this.target.rotation=e/180*Math.PI+this.designRotation}},{key:"visibility",get:function(){return this.target.visible?"visible":"hidden"},set:function(e){this.visibility===e||this.hardHidden||(this.target.visible="visible"===e)}}]),e}(),jv=function(){function e(t,r){x(this,e),this.actions=[],this.ctx=r,this.object=t,this.object.interactive=!0}return S(e,[{key:"reset",value:function(e){this.object.interactive=!1,this.object.removeAllListeners(),this.object=e,this.object.interactive=!0}},{key:"addAction",value:function(e,t){var r=this;this.actions.push([e,t]),"click"===t?(this.object.addListener("pointertap",(function(){return r.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return r.handleAction(e)}))}},{key:"getOriginHitArea",value:function(){return this.object.hitArea?this.object.hitArea:new jl.k(0,0,this.object.width,this.object.height)}},{key:"handleAction",value:function(e){this.ctx.eventHub.emit(__.hyperlinkTrigger,e),this.execAction(e)}},{key:"execAction",value:function(e){var t,r;if(this.ctx.eventHub.emit(__.userInput),"ppaction://hlinksldjump"===e.action){var n=(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(__.requestGotoSlide,Number(n[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(__.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(__.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(__.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(__.requestGotoSlide,i)}else"ppaction://hlinkshowjump?jump=endshow"===e.action?this.ctx.eventHub.emit(__.requestGotoSlide,-1):""===e.action&&(null===(r=e.target)||void 0===r?void 0:r.startsWith("http"))&&this.ctx.eventHub.emit(__.requestOpenUrl,e.target)}}]),e}();function zv(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return Math.abs(e-t)<=Math.pow(10,-r)}function Bv(e){return Math.floor(1e6*e)/1e6}var Uv=function(){function e(){x(this,e),this.point={x:0,y:0},this.slope=Math.PI/4}return S(e,[{key:"resolveY",value:function(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}},{key:"distanceToLinearEquation",value:function(e){return zv(this.slope,e.slope)?this.distanceToPoint(e.point):-1}},{key:"distanceToPoint",value:function(t){var r;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;r=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;var n=e.fromPointSlope(t,r),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}},{key:"crossPoint",value:function(e){if(zv(e.slope,this.slope))return null;var t=0,r=0,n=Math.tan(e.slope),i=Math.tan(this.slope),o=this.point,a=o.x,s=o.y,u=e.point,l=u.x,c=u.y;return zv(this.slope,Math.PI/2)?r=n*((t=this.point.x)-l)+c:zv(e.slope,Math.PI/2)?r=i*((t=e.point.x)-a)+s:zv(this.slope,Math.PI)||zv(this.slope,0)?t=((r=this.point.y)-c)/n+l:zv(e.slope,Math.PI)||zv(e.slope,0)?t=((r=e.point.y)-s)/i+a:r=i*((t=(n*l-c+s-i*a)/(n-i))-a)+s,{x:t,y:r}}}],[{key:"fromPointSlope",value:function(t,r){var n=new e;return n.point=t,n.slope=r,n}}]),e}(),Fv=function(){function e(t,r,n){var i,o,a,s,u,l,c=this;x(this,e),this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new jl.j(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new Dl.b,this.ctx=r,this.style=new Lv(this.container,!!t.hardHidden,t.rotation||0),this.designGlobalPosition={x:n.parentGlobalPos.x+(null!==(o=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0),y:n.parentGlobalPos.y+(null!==(s=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new jv(this.container,this.ctx),t.hlinkHover&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil((function(){try{return!!c.container.width}catch(e){return!1}}),3e3).then((function(){try{c.designWidth=c.designWidth||c.container.width}catch(e){}})),this.ctx.clock.waitUntil((function(){try{return!!c.container.height}catch(e){return!1}}),3e3).then((function(){try{c.designHeight=c.designHeight||c.container.height}catch(e){}}))}return S(e,[{key:"updateScale",value:function(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}},{key:"updateTransform",value:function(e){var t,r,n,i,o,a,s,u;this.designWidth=e.width,this.designHeight=e.height,this.designX=null!==(r=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,this.designY=null!==(i=null===(n=e.position)||void 0===n?void 0:n.y)&&void 0!==i?i:0;var l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;var h=null!==(a=null===(o=e.position)||void 0===o?void 0:o.x)&&void 0!==a?a:0,d=null!==(u=null===(s=e.position)||void 0===s?void 0:s.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,e.scale&&(this.designScale={x:e.scale.x,y:e.scale.y},this.container.scale.x=e.scale.x,this.container.scale.y=e.scale.y),e.rotation&&(this.container.rotation=e.rotation);var f=new Nd;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}},{key:"scale",get:function(){return this.scaleOrigin},set:function(e){this.scaleOrigin.x=e.x,this.scaleOrigin.y=e.y,this.updateScale()}},{key:"design_ppt_w",get:function(){return Bv(this.designWidth/this.ctx.stageWidth)}},{key:"design_ppt_h",get:function(){return Bv((this.designHeight||this.container.height)/this.ctx.stageHeight)}},{key:"design_ppt_x",get:function(){return Bv(this.designX/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.designY/this.ctx.stageHeight)}},{key:"ppt_w",get:function(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth},set:function(e){this.designWidth&&(this.scaleExt.x=e*this.ctx.stageWidth/this.designWidth,this.updateScale())}},{key:"ppt_h",get:function(){var e=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*e/this.ctx.stageHeight},set:function(e){this.designHeight&&(this.scaleExt.y=e*this.ctx.stageHeight/this.designHeight,this.updateScale())}},{key:"ppt_x",get:function(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth},set:function(e){this.pptX=e;var t=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=e*this.ctx.stageWidth+this.container.pivot.x*t}},{key:"ppt_y",get:function(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight},set:function(e){this.pptY=e;var t=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=e*this.ctx.stageHeight+this.container.pivot.y*t}},{key:"r",get:function(){return this.container.rotation},set:function(e){this.container.rotation=e}},{key:"xshear",set:function(e){this.container.skew.x=e},get:function(){return this.container.skew.x}},{key:"yshear",set:function(e){this.container.skew.y=e},get:function(){return this.container.skew.y}}]),e}(),Wv=r(112),Gv=r.n(Wv),Vv=function(){function e(t){if(x(this,e),this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;var r=t.match(/-?[0-9]+/g);r&&(this.h=parseInt(r[0],10),this.s=parseInt(r[1],10)/100,this.l=parseInt(r[2],10)/100)}}return S(e,[{key:"isInit",value:function(){return this._isInit}},{key:"by",value:function(e,t){t.h=Math.max(Math.min(this.h+e.h,359),0),t.s=Math.max(Math.min(this.s+e.s,1),0),t.l=Math.max(Math.min(this.l+e.l,1),0),t.a=Math.max(Math.min(this.a+e.a,1),0)}},{key:"fromHexString",value:function(e){var t,r,n=c($v(e),4),i=n[0],o=n[1],a=n[2],s=n[3],u=0,l=Math.max(i,o,a),h=Math.min(i,o,a),d=l-h;r=(l+h)/2,0===d?u=0:l===i?u=(o-a)/d%6*60:l===o?u=60*((a-i)/d+2):l===a&&(u=60*((i-o)/d+4)),t=0===d?0:d/(1-Math.abs(2*r-1)),this.h=u,this.s=t,this.l=r,this.a=s}},{key:"interpolationFrom",value:function(e,t,r){var n=e.h+(this.h-e.h)*t,i=e.s+(this.s-e.s)*t,o=e.l+(this.l-e.l)*t,a=e.a+(this.a-e.a)*t;r.h=Math.max(Math.min(n,359),0),r.s=Math.max(Math.min(i,1),0),r.l=Math.max(Math.min(o,1),0),r.a=Math.max(Math.min(a,1),0)}},{key:"toHexString",value:function(){var e=[0,0,0,0],t=this.h,r=this.s,n=this.l;if(t<360&&t>=0&&r<=1&&r>=0&&n<=1&&n>=0){var i,o=(1-Math.abs(2*n-1))*r,a=o*(1-Math.abs(t/60%2-1)),s=n-o/2;e=[(i=c(t>=0&&t<60?[o,a,0]:t>=60&&t<120?[a,o,0]:t>=120&&t<180?[0,o,a]:t>=180&&t<240?[0,a,o]:t>=240&&t<300?[a,0,o]:[o,0,a],3))[0]+s,i[1]+s,i[2]+s,this.a]}return Xv(e)}}]),e}(),Hv=function(){function e(t){x(this,e),this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}return S(e,[{key:"fromHexString",value:function(e){var t=c($v(e),4),r=t[0],n=t[1],i=t[2],o=t[3];this.r=r,this.g=n,this.b=i,this.a=o}},{key:"isInit",value:function(){return this._isInit}},{key:"interpolationFrom",value:function(e,t,r){r.r=e.r+(this.r-e.r)*t,r.g=e.g+(this.g-e.g)*t,r.b=e.b+(this.b-e.b)*t,r.a=e.a+(this.a-e.a)*t}},{key:"by",value:function(e,t){t.r=Math.min(Math.max(this.r+e.r,0),255),t.g=Math.min(Math.max(this.g+e.g,0),255),t.b=Math.min(Math.max(this.b+e.b,0),255),t.a=Math.min(Math.max(this.a+e.a,0),1)}},{key:"toHexString",value:function(){return Xv([this.r,this.g,this.b,this.a])}}]),e}();function Yv(e){var t=e.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function $v(e){return 0===(e=e.replace(/^#/,"")).substring(6,8).length&&(e+="FF"),[parseInt(e.substring(0,2).padStart(8,"0"),16)/255,parseInt(e.substring(2,4).padStart(8,"0"),16)/255,parseInt(e.substring(4,6).padStart(8,"0"),16)/255,parseInt(e.substring(6,8).padStart(8,"0"),16)/255]}function Xv(e){return"#"+Math.round(255*e[0]).toString(16).padStart(2,"0")+Math.round(255*e[1]).toString(16).padStart(2,"0")+Math.round(255*e[2]).toString(16).padStart(2,"0")+Math.round(255*e[3]).toString(16).padStart(2,"0")}function qv(e,t,r){var n=$v(e),i=$v(t),o=Math.round(255*(n[0]+(i[0]-n[0])*r)),a=Math.round(255*(n[1]+(i[1]-n[1])*r)),s=Math.round(255*(n[2]+(i[2]-n[2])*r)),u=Math.round(255*(n[3]+(i[3]-n[3])*r));return"#"+o.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}var Qv=function(e){p(r,e);var t=m(r);function r(){var e;return x(this,r),(e=t.call(this,void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0})).currentColor="#FFFFFFFF",e.designColor="#FFFFFFFF",e}return S(r,[{key:"color",set:function(e){this.currentColor=e;var t=$v(e);this.uniforms.color=Float32Array.from(t)},get:function(){return this.currentColor}}]),r}($l.k),Zv=new Bp.ColorMatrixFilter;Zv.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];var Kv=new Bp.ColorMatrixFilter;Kv.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];var Jv=new Bp.ColorMatrixFilter;Jv.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];var em=new Bp.ColorMatrixFilter;em.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];var tm={darken:Zv,darkenLess:Kv,lightenLess:em,lighten:Jv},rm=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,{position:{x:e.x,y:e.y},width:e.width,height:e.height},n,i)).fillColorFilter=new Qv,o.fill=new Dv(y(o)),o.json=e,o.ctx=n,o.parentGlobalPos=i.parentGlobalPos,o.global={x:i.parentGlobalPos.x+e.x,y:i.parentGlobalPos.y+e.y},o.updateTransform({position:{x:e.x,y:e.y},width:e.width,height:e.height}),o}return S(r,[{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"getTextElement",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"fillActive",get:function(){var e,t;return(null!==(t=null===(e=this.container.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){var t,r;e?(null!==(r=null===(t=this.container.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}},{key:"renderContainer",get:function(){return this.container}},{key:"interactiveContainer",get:function(){return this.container}},{key:"ppt_x",get:function(){return this.global.x/this.ctx.stageWidth},set:function(e){var t=e*this.ctx.stageWidth-this.global.x,r=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+t+this.container.pivot.x*r}},{key:"ppt_y",get:function(){return this.global.y/this.ctx.stageHeight},set:function(e){var t=e*this.ctx.stageHeight-this.global.y,r=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+t+this.container.pivot.y*r}},{key:"design_ppt_x",get:function(){return Bv(this.global.x/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Bv(this.global.y/this.ctx.stageHeight)}}]),r}(Fv),nm=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.ctx=t,this.type=r,this.lineWidth=n,this.width=i,this.height=o,this.fillColor=a,this.isHorz=s,this.renderContainer=new Dl.b,this.ghcTextureId="".concat(u,"-text-p").concat(l,"-l").concat(c,"-u").concat(h,"-underLine")}return S(e,[{key:"createPaths",value:function(){if("ww"===this.type)return null;var e,t="M 0,0 L ".concat(9525*this.width,",0"),r=[this.width,this.lineWidth],n=r[0],i=r[1];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,n=(e=[this.lineWidth,this.height])[0],i=e[1]),{paths:[{id:uv(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:xv()(t)}],width:n,height:i}}},{key:"getLineStyle",value:function(){var e={width:this.lineWidth};return"dotted"===this.type&&(e.dash=""+this.lineWidth),e}},{key:"preRender",value:function(){var e=this.createPaths();if(e){var t=e.paths,r=e.width,n=e.height,i=t.reduce((function(e,t){return e+t.hash}),"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,t,i,{x:0,y:0},r,n,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}},{key:"render",value:function(){if(this.ghcTextureId){var e=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);e&&(this.sprite=new Ld,this.sprite.texture=e.texture,this.sprite.pivot.x=e.pivot.x,this.sprite.scale.x=e.scale,this.sprite.scale.y=e.scale)}}},{key:"destroy",value:function(){var e;null===(e=this.sprite)||void 0===e||e.destroy({texture:!0})}}]),e}(),im=134217729;function om(e,t,r,n,i){var o,a,s,u,l=t[0],c=n[0],h=0,d=0;c>l==c>-l?(o=l,l=t[++h]):(o=c,c=n[++d]);var f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=t[++h]):(s=o-((a=c+o)-c),c=n[++d]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=t[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++d]),o=a,0!==s&&(i[f++]=s);for(;h0!=s>0)return u;var l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,r,n,i,o,a){var s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w,S,T,M=e-i,k=r-i,E=t-o,I=n-o;h=(x=(p=M-(f=(d=im*M)-(d-M)))*(m=I-(v=(d=im*I)-(d-I)))-((b=M*I)-f*v-p*v-f*m))-(g=x-(S=(p=E-(f=(d=im*E)-(d-E)))*(m=k-(v=(d=im*k)-(d-k)))-((w=E*k)-f*v-p*v-f*m))),sm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),sm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,sm[2]=y-(T-h)+(g-h),sm[3]=T;var A=function(e,t){for(var r=t[0],n=1;n=C||-A>=C)return A;if(s=e-(M+(h=e-M))+(h-i),l=r-(k+(h=r-k))+(h-i),u=t-(E+(h=t-E))+(h-o),c=n-(I+(h=n-I))+(h-o),0===s&&0===u&&0===l&&0===c)return A;if(C=11093356479670487e-47*a+33306690738754706e-32*Math.abs(A),(A+=M*c+I*s-(E*l+k*u))>=C||-A>=C)return A;h=(x=(p=s-(f=(d=im*s)-(d-s)))*(m=I-(v=(d=im*I)-(d-I)))-((b=s*I)-f*v-p*v-f*m))-(g=x-(S=(p=u-(f=(d=im*u)-(d-u)))*(m=k-(v=(d=im*k)-(d-k)))-((w=u*k)-f*v-p*v-f*m))),hm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),hm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,hm[2]=y-(T-h)+(g-h),hm[3]=T;var P=om(4,sm,4,hm,um);h=(x=(p=M-(f=(d=im*M)-(d-M)))*(m=c-(v=(d=im*c)-(d-c)))-((b=M*c)-f*v-p*v-f*m))-(g=x-(S=(p=E-(f=(d=im*E)-(d-E)))*(m=l-(v=(d=im*l)-(d-l)))-((w=E*l)-f*v-p*v-f*m))),hm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),hm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,hm[2]=y-(T-h)+(g-h),hm[3]=T;var N=om(P,um,4,hm,lm);h=(x=(p=s-(f=(d=im*s)-(d-s)))*(m=c-(v=(d=im*c)-(d-c)))-((b=s*c)-f*v-p*v-f*m))-(g=x-(S=(p=u-(f=(d=im*u)-(d-u)))*(m=l-(v=(d=im*l)-(d-l)))-((w=u*l)-f*v-p*v-f*m))),hm[0]=x-(g+h)+(h-S),h=(_=b-((y=b+g)-(h=y-b))+(g-h))-(g=_-w),hm[1]=_-(g+h)+(h-w),h=(T=y+g)-y,hm[2]=y-(T-h)+(g-h),hm[3]=T;var O=om(N,lm,4,hm,cm);return cm[O-1]}(e,t,r,n,i,o,l)}var fm=Math.pow(2,-52),pm=new Uint32Array(512),vm=function(){function e(t){x(this,e);var r=t.length>>1;if(r>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;var n=Math.max(2*r-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(r)),this._hullPrev=new Uint32Array(r),this._hullNext=new Uint32Array(r),this._hullTri=new Uint32Array(r),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(r),this._dists=new Float64Array(r),this.update()}return S(e,null,[{key:"from",value:function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xm,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wm,i=t.length,o=new Float64Array(2*i),a=0;a>1,a=1/0,s=1/0,u=-1/0,l=-1/0,c=0;cu&&(u=h),d>l&&(l=d),this._ids[c]=c}for(var f,p,v,m=(a+u)/2,g=(s+l)/2,y=1/0,_=0;_0&&(p=S,y=T)}for(var M=e[2*p],k=e[2*p+1],E=1/0,I=0;IL&&(O[R++]=j,L=this._dists[j])}return this.hull=O.subarray(0,R),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(dm(x,w,M,k,C,P)<0){var z=p,B=M,U=k;p=v,M=C,k=P,v=z,C=B,P=U}var F=function(e,t,r,n,i,o){var a=r-e,s=n-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*h)*d,y:t+(a*h-u*c)*d}}(x,w,M,k,C,P);this._cx=F.x,this._cy=F.y;for(var W=0;W0&&Math.abs(X-V)<=fm&&Math.abs(q-H)<=fm)&&(V=X,H=q,$!==f&&$!==p&&$!==v)){for(var Q=0,Z=0,K=this._hashKey(X,q);Z=0;)if((ee=J)===Q){ee=-1;break}if(-1!==ee){var te=this._addTriangle(ee,$,r[ee],-1,-1,n[ee]);n[$]=this._legalize(te+2),n[ee]=te,G++;for(var re=r[ee];J=r[re],dm(X,q,e[2*re],e[2*re+1],e[2*J],e[2*J+1])<0;)te=this._addTriangle(re,$,J,n[$],-1,n[re]),n[$]=this._legalize(te+2),r[re]=re,G--,re=J;if(ee===Q)for(;dm(X,q,e[2*(J=t[ee])],e[2*J+1],e[2*ee],e[2*ee+1])<0;)te=this._addTriangle(J,$,ee,-1,n[ee],n[J]),this._legalize(te+2),n[J]=te,r[ee]=ee,G--,ee=J;this._hullStart=t[$]=ee,r[ee]=t[re]=$,r[$]=re,i[this._hashKey(X,q)]=$,i[this._hashKey(e[2*ee],e[2*ee+1])]=ee}}}this.hull=new Uint32Array(G);for(var ne=0,ie=this._hullStart;ne0?3-i:1+i)/4*this._hashSize))%this._hashSize;var r,n,i}},{key:"_legalize",value:function(e){for(var t=this._triangles,r=this._halfedges,n=this.coords,i=0,o=0;;){var a=r[e],s=e-e%3;if(o=s+(e+2)%3,-1!==a){var u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,h=t[o],d=t[e],f=t[l],p=t[c];if(gm(n[2*h],n[2*h+1],n[2*d],n[2*d+1],n[2*f],n[2*f+1],n[2*p],n[2*p+1])){t[e]=p,t[a]=h;var v=r[c];if(-1===v){var m=this._hullStart;do{if(this._hullTri[m]===c){this._hullTri[m]=e;break}m=this._hullPrev[m]}while(m!==this._hullStart)}this._link(e,v),this._link(a,r[o]),this._link(o,c);var g=u+(a+1)%3;i=r&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{var u=r+1,l=n;bm(e,r+n>>1,u),t[e[r]]>t[e[n]]&&bm(e,r,n),t[e[u]]>t[e[n]]&&bm(e,u,n),t[e[r]]>t[e[u]]&&bm(e,r,u);for(var c=e[u],h=t[c];;){do{u++}while(t[e[u]]h);if(l=l-r?(_m(e,t,u,n),_m(e,t,r,l-1)):(_m(e,t,r,l-1),_m(e,t,u,n))}}function bm(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function xm(e){return e[0]}function wm(e){return e[1]}function Sm(e,t,r){var n=t/2,i=r/2,o=[{x:-n,y:i},{x:-n,y:-i},{x:n,y:i},{x:n,y:-i}],s=[Uv.fromPointSlope({x:-n,y:0},Math.PI/2),Uv.fromPointSlope({x:0,y:i},0),Uv.fromPointSlope({x:n,y:0},Math.PI/2),Uv.fromPointSlope({x:0,y:-i},0)],u=[],l=e.stopList.slice(1,e.stopList.length-1).map((function(o){for(var l,c,h,d=2*Math.PI,f=null!==(c=null===(l=e.line)||void 0===l?void 0:l.ang)&&void 0!==c?c:0;f>d;)f-=d;for(;f<0;)f+=d;var p={x:0,y:0};zv(f,Math.PI/2)?(p.x=0,p.y=r/2-o.pos*r):zv(f,0)?(p.x=o.pos*t-t/2,p.y=0):(p.x=o.pos*t-t/2,p.y=r/2-o.pos*r),f>Math.PI/2&&f<=Math.PI&&(p.x*=-1),f>Math.PI&&f<=2*Math.PI&&(p.y*=-1);var v=Uv.fromPointSlope(p,Math.PI/2-((null===(h=e.line)||void 0===h?void 0:h.ang)||0)),m=s.map((function(e){return v.crossPoint(e)})).filter((function(e){return e&&e.x<=n&&e.x>=-n&&e.y<=i&&e.y>=-i})).map((function(e){return{point:e,color:o.color}})).sort((function(e,t){return t.point.y-e.point.y}));u.push.apply(u,a(m));for(var g=Math.abs(m[1].point.x-m[0].point.x)/10,y=20;y--;){var _=y%2==0?1:-1,b=p.x+_*g,x=v.resolveY(b);b<=n&&b>=-n&&x<=i&&x>=-i&&u.push({point:{x:b,y:x},color:o.color}),g+=g}return v})),c=[],h=[];e:for(var d=0;d= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0) * texColor.a;\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0) * texColor.a;\n }\n}\n",alphaModFix:"\nvec4 transform(vec4 texColor, float arg) {\n return texColor * arg;\n}\n",alphaBiLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < arg) {\n result.a = 0.0;\n } else {\n result.a = 1.0;\n }\n return result;\n}\n",alphaCeiling:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a > 0.0) {\n result.a = 1.0;\n }\n return result;\n}\n",alphaFloor:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < 1.0) {\n result.a = 0.0;\n }\n return result;\n}\n",grayscl:"\nvec4 transform(vec4 texColor, float arg) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n return vec4(avg, avg, avg, texColor.a);\n}\n"},Em=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=km[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Mm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n")),{arg:n})}return r}($l.k),Im=[Tm],Am={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n",changeBulletColor:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n if (texColor.a == 0.0) {\n return texColor;\n } else {\n return arg2;\n }\n}\n",duotone:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n // float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n // vec3 hsl = rgb2hsl(vec3(avg, avg, avg));\n // vec3 result = arg2.rgb * hsl.z + arg1.rgb * (1.0 - hsl.z);\n // return vec4(result * texColor.a, texColor.a);\n \n float brightness = texColor.r * 0.3 + texColor.g * 0.59 + texColor.b * 0.11;\n \n return vec4(\n (arg1.r + brightness * (arg2.r - arg1.r)) * texColor.a,\n (arg1.g + brightness * (arg2.g - arg1.g)) * texColor.a,\n (arg1.b + brightness * (arg2.b - arg1.b)) * texColor.a,\n texColor.a\n );\n}\n"},Cm=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Am[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n".concat(Im.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:Float32Array.from(n),arg2:Float32Array.from(i)})}return r}($l.k),Pm=[Tm],Nm={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n vec3 rgb = texColor.rgb / texColor.a;\n\n // 对比度\n highp float C = arg2 * 255.0;\n highp float F = (259.0 * (255.0 + C)) / (255.0 * (259.0 - C));\n rgb.rgb = F * (rgb.rgb - 0.5) + 0.5;\n\n // 亮度\n rgb.rgb += arg1 * rgb.rgb;\n\n rgb.rgb *= texColor.a;\n return vec4(rgb, texColor.a);\n}\n"},Om=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),t.call(this,void 0,(o=Nm[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n".concat(Pm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:n,arg2:i})}return r}($l.k),Rm=[Tm],Dm={alphaInv:"\nvec4 transform(vec4 texColor, vec4 arg1) {\n float alpha = 1.0 - texColor.a;\n arg1.rgb = arg1.rgb * alpha;\n arg1.a = alpha;\n return arg1;\n}\n"},Lm=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),t.call(this,void 0,(i=Dm[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform sampler2D uSampler;\n\n".concat(Rm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1);\n}\n")),{arg1:Float32Array.from(n)})}return r}($l.k);function jm(e,t){var r=[];return e.forEach((function(e){var n=((null==t?void 0:t.filter)||[]).indexOf(e.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(e.type)>=0&&n)r.push(new Em(e.type,e.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(e.type)>=0&&n){var i=$v(e.args[0]),o=$v(e.args[1]);r.push(new Cm(e.type,i,o))}else if("lum"===e.type&&n)r.push(new Om(e.type,e.args[0],e.args[1]));else if("alphaInv"===e.type&&n){var a=$v(e.args[0]);r.push(new Lm(e.type,a))}})),r}var zm=function(){function e(t,r,n,i,o){x(this,e),this.ctx=t,this.fillStyle=r,this.width=n,this.height=i,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=xv()("".concat(JSON.stringify(r)).concat(Math.ceil(n)).concat(Math.ceil(i)))}return S(e,[{key:"createDisplayObject",value:function(){var e;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){var t=new Ld;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType){var r=new Ld,n=function(e,t,r){var n,i=new Dl.b;if(e.stopList.sort((function(e,t){return e.pos-t.pos})),!e.stopList.find((function(e){return 0===e.pos}))){var o=e.stopList[0];e.stopList.unshift({pos:0,color:o.color})}if(!e.stopList.find((function(e){return 1===e.pos}))){var s=e.stopList[e.stopList.length-1];e.stopList.push({pos:1,color:s.color})}var u=function(e){for(var t=[],r=0,n=e.length;r0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(h.filters=jm(u,this.ctx.featureList)),this.config.fillFloat){var d=this.config.fillFloat.fillRect,f=d.l,p=d.t,v=d.r,m=d.b,g=this.width*(1-f-v),y=this.height*(1-p-m),_=null!==(e=this.config.shapeRotation)&&void 0!==e?e:0,b=new Nd;b.drawRect(0,0,g,y),b.pivot.x=g/2,b.pivot.y=y/2,b.rotation=_;var x=b.getBounds(),w=x.width,S=x.height;h.width=w,h.height=S,h.anchor.x=.5,h.anchor.y=.5,h.rotation=-1*_,h.name="math-texture",0===_?(h.position.x=w/2+f*this.width,h.position.y=S/2+p*this.height):(h.position.x=this.width/2,h.position.y=this.height/2)}else h.width=this.width,h.height=this.height,c.rotate&&(h.position.x=this.width/2,h.position.y=this.height/2,h.anchor.x=.5,h.anchor.y=.5,h.rotation=c.rotate/180*Math.PI);return h}}else if("gifFill"===this.fillStyle.fillType){var T=this.fillStyle,M=T.src,k=T.delays,E=T.filters,I=this.ctx.spriteTexture.getGifFrames(M).map((function(e,t){return{texture:e,time:k[t]||20}})),A=new jp(I,!0);A.name=uv(),A.width=this.width,A.height=this.height,E.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(A.filters=jm(E,this.ctx.featureList));var C=this.fillStyle.loop,P=1;return A.onLoop=function(){P+=1,C>0&&P>C&&A.gotoAndStop(A.totalFrames)},A}return null}},{key:"isSolidFill",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)}},{key:"getSolidFillColor",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)?this.fillStyle.color:"#000000"}},{key:"getClonedDisplayObject",value:function(){var e=this.createDisplayObject();return this.clonedObjects.push(e),e}},{key:"destroy",value:function(){var e;null===(e=this._displayObject)||void 0===e||e.destroy(),this._displayObject=null,this.clonedObjects.forEach((function(e){null==e||e.destroy()})),this.clonedObjects=[]}},{key:"displayObject",get:function(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject},set:function(e){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=e}},{key:"hasFill",get:function(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}}]),e}(),Bm=function(e){p(r,e);var t=m(r);function r(){return x(this,r),t.apply(this,arguments)}return r}($l.k),Um=r(113),Fm=r.n(Um),Wm=r(114),Gm=r.n(Wm),Vm=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,Fm.a,Gm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:$v(e.color),uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:e.rad/2,uSdfPosition:new Float32Array([0,0])})).priority=3,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){var t=Math.ceil(this.json.rad),r=Math.ceil(e.width+2*t),n=Math.ceil(e.height+2*t);return new jl.j(e.x-t,e.y-t,r,n)}},{key:"sdfBox",value:function(e,t){var r=Math.ceil(this.json.rad),n=Math.ceil(e+2*r),i=Math.ceil(t+2*r);return new jl.j(r,r,n,i)}}]),r}(Bm),Hm=r(19),Ym=r.n(Hm),$m=r(115),Xm=r.n($m),qm=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,Ym.a,Xm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:e.rad,uSdfSampler:$l.t.WHITE,uSdfReady:0,uSdfMaxDis:1})).priority=2,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(e,t){return new jl.j(0,0,e,t)}}]),r}(Bm),Qm=function e(){x(this,e)},Zm=r(116),Km=r.n(Zm),Jm=function(e){p(r,e);var t=m(r);function r(e){return x(this,r),t.call(this,Ym.a,Km.a,{uColor:$v(e)})}return r}($l.k),eg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).order=1,o.outputTexture=$l.t.WHITE,o.frameTextures=[],o.json=e,o.effectContainer=n,o.outputSprite=new Ld,o.targetScale=i,o.outputSprite.scale.x=o.json.sx,o.outputSprite.scale.y=o.json.sy,o.outputSprite.skew.x=(o.targetScale.x>0?1:-1)*o.json.kx,o.outputSprite.skew.y=(o.targetScale.y>0?1:-1)*o.json.ky,o.outputSprite.filters=[new Bp.BlurFilter(o.json.blurRad/2,4),new Jm(o.json.color)],o}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];if(t){var r=this.effectContainer.getBounds(),n=(this.effectContainer.width-t.width)/2,i=(this.effectContainer.height-t.height)/2,o=new jl.g(r.x,r.y),a=new jl.g(r.x,r.y);switch(this.json.align){case"tl":a.x=r.x,a.y=r.y;break;case"t":a.x=r.x+r.width/2,a.y=r.y,o.x+=r.width/2;break;case"tr":a.x=r.x+r.width,a.y=r.y,o.x+=r.width;break;case"l":a.x=r.x,a.y=r.y+r.height/2,o.y+=r.height/2;break;case"ctr":a.x=r.x+r.width/2,a.y=r.y+r.height/2,o.x+=r.width/2,o.y+=r.height/2;break;case"r":a.x=r.x+r.width,a.y=r.y+r.height/2,o.x+=r.width,o.y+=r.height/2;break;case"bl":a.x=r.x,a.y=r.y+r.height,o.y+=r.height;break;case"b":a.x=r.x+r.width/2,a.y=r.y+r.height,o.x+=r.width/2,o.y+=r.height;break;case"br":a.x=r.x+r.width,a.y=r.y+r.height,o.x+=r.width,o.y+=r.height}var s=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=s.x,this.outputSprite.pivot.y=s.y;var u=new jl.g(this.json.dist,0),l=new jl.d;l.rotate(this.json.dir),l.translate(o.x+n,o.y+i),l.apply({x:u.x,y:u.y},u);var c=this.effectContainer.toLocal(u);this.outputSprite.position.x=c.x,this.outputSprite.position.y=c.y,this.outputSprite.texture=t}}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){}}]),r}(Qm),tg=r(117),rg=r.n(tg),ng=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),i=t.call(this,Ym.a,rg.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:n}),console.log(y(i)),i}return r}($l.k),ig=function(e){p(r,e);var t=m(r);function r(e,n,i,o,a){var s;x(this,r),(s=t.call(this)).order=2,s.outputSprite=new Ld,s.outputTexture=$l.t.WHITE,s.frameTextures=[],s.json=e,s.shapeScaleX=o,s.effectContainer=n,s.rotation=i,s.ctx=a,s.outputSprite.anchor.x=.5,s.outputSprite.anchor.y=.5;var u=s.effectContainer.getBounds();return s.outputSprite.filters=[new Bp.BlurFilter(s.json.blurRad/2,4),new ng(s.json,u.height)],s.outputSprite.alpha=.5,s.outputSprite.rotation=-1===s.shapeScaleX?Math.PI+2*s.rotation:Math.PI-2*s.rotation,s.outputSprite.scale.x=-1,s}return S(r,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];t&&(this.outputSprite.texture=t)}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){var r=this.effectContainer.getBounds(),n=new jl.g(r.x+r.width/2,r.y+r.height/2),i=new jl.g(n.x,n.y+r.height+this.json.dist),o=this.effectContainer.toLocal(i);this.outputSprite.position.x=o.x+e,this.outputSprite.position.y=o.y+t}}]),r}(Qm),og=r(118),ag=r.n(og),sg=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,Ym.a,ag.a,{})).priority=1,n.json=e,n}return S(r,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),r}(Bm),ug=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},lg=function(e){p(r,e);var t=m(r);function r(e,n,i,o,s,u){var l;x(this,r),(l=t.call(this)).effects=[],l.attachs=[],l.frames=new Map,l._targetContainer=new Dl.b,l.frameCount=1,l.ctx=o,l.originWidth=e.width,l.originHeight=e.height,l.cacheKey=i,l.sourceSprite=new Ld;var c,h=M(n);try{for(h.s();!(c=h.n()).done;){var d=c.value;switch(d.type){case"innerShadow":l.effects.push(new sg(d));break;case"softEdge":l.effects.push(new qm(d));break;case"glow":l.effects.push(new Vm(d));break;case"reflection":l.attachs.push(new ig(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new eg(d,e,u))}}}catch(e){h.e(e)}finally{h.f()}l.effects=l.effects.sort((function(e,t){return e.priority-t.priority})),l.attachs=l.attachs.sort((function(e,t){return e.order-t.order}));var f,p=M(l.attachs);try{for(p.s();!(f=p.n()).done;){var v=f.value;l._targetContainer.addChild(v.outputSprite)}}catch(e){p.e(e)}finally{p.f()}l.sourceSprite.name="source-sprite";var m=new jl.j(0,0,l.originWidth,l.originHeight),g=l.effects.map((function(e){return e.filterAreaJustify(m)})),y=g.map((function(e){return e.x})),_=g.map((function(e){return e.y})),b=g.map((function(e){return e.width})),w=g.map((function(e){return e.height}));return l.filterArea=new jl.j(Math.min.apply(Math,a(y).concat([0])),Math.min.apply(Math,a(_).concat([0])),Math.max.apply(Math,a(b).concat([l.originWidth])),Math.max.apply(Math,a(w).concat([l.originHeight]))),l.sourceSprite.filters=l.effects,l.sourceSprite.filterArea=new jl.j(0,0,l.filterArea.width,l.filterArea.height),l._targetSprite=new Ld,l._targetSprite.name="effect-sprite",l._targetContainer.sortableChildren=!0,l._targetSprite.zIndex=999,l._targetContainer.addChild(l._targetSprite),l}return S(r,[{key:"getSdfTexture",value:function(e,t){return ug(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n="".concat(this.cacheKey,"_").concat(e),i=this.effects.map((function(e){return{sdfRect:e.sdfBox(t.width,t.height)}})).reduce((function(e,t){return t.sdfRect?(e.width5&&(t.dist=5),b[e]})),o.ctx.slideScopeEventHub.once("slide-render",(function(e){if(o.ctx.slideIndex===e&&o.effectObject){var t=o.getEffectTexture();if(t){var r=t.texture,n=t.offsetX,i=t.offsetY;o.effectObject.setFrameOffset(n,i),o.effectObject.createFrame(1,r)}}}))}return o}return S(r,[{key:"getEffectTexture",value:function(){var e,t=this.json,r=t.lineHeight,n=t.fillLineHeight,i=t.isHorz,o=t.lineWidth,a=this.effectContainer.getLocalBounds(),s=0,u=0,l=M(this.effectContainer.children);try{for(l.s();!(e=l.n()).done;){var c=e.value;c.pivot.x>s&&(s=c.pivot.x),c.pivot.y>u&&(u=c.pivot.y)}}catch(e){l.e(e)}finally{l.f()}var h=new jl.d;h.translate(s,u);var d=$l.p.create({width:i?a.width:o,height:i?Math.max(n,r):a.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:d,transform:h}),{texture:d,offsetX:s,offsetY:u}}},{key:"createStrokeFill",value:function(){var e=this.json,t=e.stroke,r=e.lineWidth,n=e.lineHeight;return new zm(this.ctx,null==t?void 0:t.fill,r,n,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createStrokeGraphics",value:function(){var e=this.json.stroke,t=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[]}:void 0;return new zm(this.ctx,t,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createTextFill",value:function(){var e=this.json,t=e.isHorz,r=e.fill,n=e.lineWidth,i=e.lineHeight,o=e.fillLineHeight;return t?new zm(this.ctx,null==r?void 0:r.fill,n,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new zm(this.ctx,null==r?void 0:r.fill,o,i,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextGraphics",value:function(){var e,t=this.json,r=t.fill,n=t.content,i="#000000";"solidFill"===(null===(e=null==r?void 0:r.fill)||void 0===e?void 0:e.fillType)&&(i=r.fill.color);var o=(null==r?void 0:r.key)?{fillType:"blipFill",src:r.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new zm(this.ctx,o,(null==r?void 0:r.width)||0,(null==r?void 0:r.height)||0,{useFilter:"◾"===n,useSlideBackgroundFill:!1})}},{key:"getIterateEntry",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"updateTransform",value:function(e){var t,n,i,o,a=this.json.isHorz;e.position={x:a&&null!==(n=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:a?0:null!==(o=null===(i=e.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},e.width=a?this.json.width:this.json.lineWidth,e.height=a?this.json.lineHeight:this.json.height,f(b(r.prototype),"updateTransform",this).call(this,e)}},{key:"preRender",value:function(){var e;null===(e=this.underline)||void 0===e||e.preRender()}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.doRender();case 1:case"end":return e.stop()}}),e,this)})))}),"@TextUnitImpl[doRender]"),e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.effectList&&this.effectList.length>0&&(r="".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(null===(t=this.json.fill)||void 0===t?void 0:t.key,"_").concat(this.json.effectIndexList),this.effectObject=new lg(this.effectContainer,this.effectList,r,this.ctx,0,new jl.g(1,1)),this.effectObject.on("ready",(function(){var e;n.effectContainer.visible=!1,n.effectObject.container.zIndex=10,n.container.addChild(n.effectObject.container),null===(e=n.effectObject)||void 0===e||e.updateFrame(1)})));case 1:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"doRender",value:function(){var e=!1,t=this.json,r=t.lineWidth,n=t.lineHeight,i=t.baseLine,o=t.isHorz,a=t.underline,s=t.stroke,u=t.height,l=t.width,h=t.highlightColor,d=t.x,f=t.y,p=t.content,v=t.fillLineHeight,m=t.fill,g=!1!==this.json.needFill;if(m&&m.fill&&"solidFill"!==m.fill.fillType&&(g=!0),h){var y=new Nd,_=c(Yv(h),2),b=_[0],x=_[1];y.beginFill(b,x),y.drawRect(0,0,o?l:r,o?n:u),y.endFill(),this.textureContainer.addChild(y)}if(this.textGraphics.displayObject){var w=this.textGraphics.displayObject;if(o&&(w.position.y=f>0?f:0),g){var S=this.textFill.displayObject;if(S)S.mask=w,S.addChild(w),S.position.x=-d,w.position.x+=d,e=!0,this.textureContainer.addChild(S);else if(this.textFill.isSolidFill()){var T=new Qv;T.color=this.textFill.getSolidFillColor(),w.filters=[T],e=!0,this.textureContainer.addChild(w)}}else this.textureContainer.addChild(w)}if(this.strokeGraphics.displayObject){var M=this.strokeGraphics.displayObject;if(g){var k=this.strokeFill.displayObject;if(k)k.mask=M,k.addChild(M),o?k.position.y=f>0?f:0:k.position.x=d,this.textureContainer.addChild(k);else if(this.strokeFill.isSolidFill()){o?M.position.y=Math.max(f,0):M.position.x=d;var E=new Qv;E.color=this.strokeFill.getSolidFillColor(),M.filters=[E],e=!0,this.textureContainer.addChild(M)}}else o?M.position.y=f>0?f:0:M.position.x=d,this.textureContainer.addChild(M);var I=s&&m?(s.width-(null==m?void 0:m.width))/4:0;M.position.x-=I}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=a?a-n/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);var A=this.textFill.getClonedDisplayObject();A?(A.mask=this.underline.sprite,A.addChild(this.underline.sprite),this.textureContainer.addChild(A)):this.textureContainer.addChild(this.underline.sprite)}if(e){var C=$l.p.create({width:o?l:r,height:o?Math.max(v,n):u,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:C}),this.cacheSprite.texture=C,o&&f<0&&(this.cacheSprite.position.y=f),this.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.addChild(this.textureContainer);this.container.name=p}},{key:"destroy",value:function(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}]),r}(rm),dg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},fg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n,i)).units=[],o.isHorz=!0,o.hyperLinkMap=new Map,o.hyperLinkContainerMap=new Map,o.effectList=[],i.effectList&&(o.effectList=i.effectList),o}return S(r,[{key:"getIterateElements",value:function(){return this.units}},{key:"getIterateEntry",value:function(e,t,r){return this.units[t]?this.units[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createUnits",value:function(e,t,r,n){for(var i=this,o=function(o,a){n.addSubMTask((function(){return dg(i,void 0,void 0,regeneratorRuntime.mark((function n(){var i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.textUnits[o],a=this.json,s=a.height,u=a.width,l=a.fillHeight,c=a.baseline,h=a.y,d=a.underline,(f=new hg(Object.assign(Object.assign({},i),{lineHeight:s,lineWidth:u,baseLine:c-h,underline:d,fillLineHeight:l||s,isHorz:this.isHorz,shapeId:e,paragraphIndex:t,lineIndex:r,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).preRender(),this.units.push(f),(i.hyperlink||i.hlinkHover)&&(p=new jv(f.container,this.ctx),i.hyperlink&&p.addAction(i.hyperlink,"click"),i.hlinkHover&&p.addAction(i.hlinkHover,"hover"),this.container.sortableChildren=!0);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextLineImpl[createUnits]")},a=0,s=this.json.textUnits.length;a0)return this.iterateElements;var e=this.lines.reduce((function(e,t){return e.concat(t.getIterateElements())}),[]);return this.iterateElements=e,e}},{key:"getIterateEntry",value:function(e,t,r){var n=this.getIterateElements();return n[t]?n[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",r),null)}},{key:"preRender",value:function(){}},{key:"applyEffectCacheAsBitMap",value:function(){}},{key:"createLines",value:function(e,t,r){for(var n=this,i=function(i,o){r.addSubMTask((function(){return pg(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=this.json.lines[i],(a=new fg(o,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).isHorz=this.isHorz,a.container.name="line-"+i,a.createUnits(e,t,i,r),this.lines.push(a);case 2:case"end":return n.stop()}}),n,this)})))}),"@TextParagraphImpl[createLines]")},o=0,a=this.json.lines.length;o90&&o<270||o<-90&&o>-270)&&(n=-n),i=-a*n}return{x:n,y:i}}((i=-i)/Math.PI*180,r,n),s=e.x-a.x,u=e.y-a.y;return{centerX:s/9525*t.x,centerY:u/9525*t.y,rx:r/9525*t.x,ry:n/9525*t.y,st:-i,end:-i+o,aClockWise:o<0}}function gg(e){for(var t=new os,r=e.scale,n={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=bg(s.paths[0].path,this.json.width,this.json.height,i,o),s.paths.unshift(Object.assign(Object.assign({},s.paths[0]),{path:d}))),f=function(e,t,r,n){if(!_g[r])return null;var i=_g[r].top(gg(t)),o=_g[r].bottom(gg(e));if(i.length!==o.length)return null;for(var a=Math.min(i.length,o.length),s=1/(a-1),u=[],l=[],c=new Array(2*a).fill("").map((function(e,t){return t})),h=0;h0&&(this.textColorFilter.color=e)},get:function(){return this.textColorFilter.color}},{key:"on",get:function(){var e;return(null!==(e=this.container.filters)&&void 0!==e?e:[]).length>0?"true":"false"},set:function(e){var t;"true"===e?(null!==(t=this.container.filters)&&void 0!==t?t:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}}]),e}(),Sg=function(){function e(t){x(this,e),this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}return S(e,[{key:"setPivot",value:function(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;default:this.pivot={x:this.width,y:this.height/2}}}},{key:"generatePaths",value:function(){this.hash="arrow-"+xv()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}},{key:"getUnitPath",value:function(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}},{key:"setScaleFromLineWidth",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}},{key:"setScaleFromSize",value:function(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}]),e}(),Tg=function(){function e(t,r,n,i,o,a,s,u,l,c,h){x(this,e),this.id=t,this.ctx=r,this.paths=n,this.hash=i,this.nept=o,this.width=a,this.height=s,this.lineStyle=u,this.shouldFill=l,this.bgColor=c,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}return S(e,[{key:"pointDis",value:function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}},{key:"isPoint",value:function(e){return Number.isNaN(Number(e.x))||Number.isNaN(Number(e.y))}},{key:"isSquare",value:function(e,t){var r=this;if("MLLLC"!==e.join("")&&"MLLLCC"!==e.join(""))return!1;var n=t.filter((function(e){return!r.isPoint(e)}));if(4!==n.length)return!1;var i,o=Math.min.apply(Math,a(n.map((function(e){return e.x})))),s=Math.min.apply(Math,a(n.map((function(e){return e.y})))),u=Math.max.apply(Math,a(n.map((function(e){return e.x})))),l=Math.max.apply(Math,a(n.map((function(e){return e.y})))),c=M(n);try{for(c.s();!(i=c.n()).done;){var h=i.value;if(h.x!==o&&h.x!==u||h.y!==s&&h.y!==l)return!1}}catch(e){c.e(e)}finally{c.f()}return!0}},{key:"rectangleDetect",value:function(e){if(1!==e.length)return!1;var t=e[0].path.trim().split(" ");if(10!==t.length)return!1;for(var r=[],n=[],i=0;ir&&(r=o.pivot.x),o.pivot.y>n&&(n=o.pivot.y)}}catch(e){i.e(e)}finally{i.f()}var a=new jl.d;if(a.translate(r,n),0===this.effectContainer.children.length)return null;var s=$l.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:s,transform:a}),{texture:s,offsetX:r,offsetY:n}}},{key:"createStrokeGraphics",value:function(){var e,t,r,n,i=this.json,o=i.id,a=i.geometry,s=i.lineStyle,u=(null==a?void 0:a.lineTransform)||kg,l=u.width,c=u.height,h=u.pivot,d=l||this.json.width,f=c||this.json.height,p="solidFill"===(null===(e=null==s?void 0:s.fill)||void 0===e?void 0:e.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(t=s.fill)||void 0===t?void 0:t.fillType)?new Tg(o+"-path-graphics",this.ctx,null!==(r=null==a?void 0:a.paths)&&void 0!==r?r:[],null!==(n=null==a?void 0:a.hash)&&void 0!==n?n:"",h||{x:0,y:0},d,f,s,!1,null,p):null}},{key:"createStrokeFill",value:function(){var e=c(this.calculateFillObjectOffset(),2),t=e[0],r=e[1],n=this.json,i=n.geometry,o=n.lineStyle,a=n.width,s=n.height,u=(null==i?void 0:i.lineTransform)||kg,l=Sv()(null==o?void 0:o.width)?o.width:1;return new zm(this.ctx,null==o?void 0:o.fill,(u.width||a)+l+t,Math.max((u.height||s)+l,r),{useFilter:!0,useSlideBackgroundFill:!1})}},{key:"createBackgroundGraphics",value:function(){var e,t=this.json,r=t.geometry,n=t.lineStyle,i=t.fillStyle,o=t.id,a=(null==r?void 0:r.lineTransform)||kg,s=a.width,u=a.height,l=a.pivot,c=s||this.json.width,h=u||this.json.height,d="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new Tg(o+"-bg-graphics",this.ctx,null!==(e=null==r?void 0:r.paths)&&void 0!==e?e:[],(null==r?void 0:r.hash)||"",l||{x:0,y:0},c,h,n,!0,d,null):null}},{key:"createBackgroundFill",value:function(){var e,t,r,n,i=this.json,o=i.fillStyle,a=i.width,s=i.height,u=i.lineStyle,l=i.geometry,c=(null==l?void 0:l.fillTransform)||kg,h={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},d=this.useGroupFill&&(null===(e=this.option.groupSize)||void 0===e?void 0:e.w)?this.option.groupSize.w:c.width||a,f=this.useGroupFill&&(null===(t=this.option.groupSize)||void 0===t?void 0:t.h)?this.option.groupSize.h:c.height||s;return new zm(this.ctx,o,d+(null!==(r=null==u?void 0:u.width)&&void 0!==r?r:0),f+(null!==(n=null==u?void 0:u.width)&&void 0!==n?n:0),h)}},{key:"createBackground",value:function(){var e,t,r,n,i,o,a,s,u,l,c,h,d=(null===(e=this.json.geometry)||void 0===e?void 0:e.fillTransform)||kg,f=d.pivot,p=d.width,v=d.height,m=this.backgroundFill.displayObject;m?(this.json.useBgFill&&(null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)?(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,m.pivot.x=(null===(n=this.json.position)||void 0===n?void 0:n.x)||0,m.pivot.y=(null===(i=this.json.position)||void 0===i?void 0:i.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(m.height=v||this.designHeight,m.width=p||this.designWidth,m instanceof jp&&m.play(),(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(m.width,m.height))&&(m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(m.width,m.height))&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(m.x=f.x,m.y=f.y),this.useGroupFill&&(m.x-=null!==(l=null===(u=this.json.position)||void 0===u?void 0:u.x)&&void 0!==l?l:0,m.y-=null!==(h=null===(c=this.json.position)||void 0===c?void 0:c.y)&&void 0!==h?h:0),this.effectContainer.addChild(m)):this.backgroundFill.hasFill&&(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}},{key:"createPathFill",value:function(){var e,t,r,n=this.strokeFill.displayObject,i=null===(e=this.strokeGraphics)||void 0===e?void 0:e.displayObject,o=c(this.calculateFillObjectOffset(),2),a=o[0],s=o[1];n?((null===(t=this.strokeGraphics)||void 0===t?void 0:t.isNeedMask(n.width,n.height))&&i&&(this.needCacheAsBitMap=!0,n.pivot.x=i.pivot.x,n.pivot.y=i.pivot.y,i.pivot.x=0,i.pivot.y=0,n.mask=i,n.addChild(i),n.position.x=-a/2,n.position.y=-s/2,i.position.x=a/2,i.position.y=s/2),this.effectContainer.addChild(n)):this.strokeFill.hasFill&&(null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}},{key:"createFilledPathMask",value:function(){var e,t,r,n,i=(null===(t=null===(e=this.json.geometry)||void 0===e?void 0:e.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],o=M(i);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.ctx.graphicsTexture.getGraphicsData(a.id);if(s){var u=new Ld(s.texture);u.pivot.x=s.pivot.x,u.pivot.y=s.pivot.y,u.scale.x=s.scale,u.scale.y=s.scale;var l=this.backgroundFill.getClonedDisplayObject(),c=null===(r=this.backgroundGraphics)||void 0===r?void 0:r.getClonedDisplayObject(),h=l||c;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=u,h.filters=[tm[a.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(h),this.effectContainer.addChild(u))}}}catch(e){o.e(e)}finally{o.f()}}},{key:"createArrow",value:function(){var e=this;this.arrowList.length&&this.arrowList.forEach((function(t){var r,n=e.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(n){var i=n.texture,o=new Ld(i);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,o.scale.x=n.scale,o.scale.y=n.scale,null===(r=e.backgroundGraphics)||void 0===r||r.addArrows(o)}}))}},{key:"generateArrowList",value:function(){var e,t,r=this,n=this.json,i=n.lineArrowList,o=n.lineStyle,a=n.id,s="solidFill"===(null===(e=null==o?void 0:o.fill)||void 0===e?void 0:e.fillType)?o.fill.color:null;null===(t=i||[])||void 0===t||t.forEach((function(e,t){var n,i,u,l,c,h,d,f,p=new Sg(Object.assign(Object.assign({},e),{position:{x:e.position.x-(null!==(u=null===(i=null===(n=r.json.geometry)||void 0===n?void 0:n.lineTransform)||void 0===i?void 0:i.pivot.x)&&void 0!==u?u:0),y:e.position.y-(null!==(h=null===(c=null===(l=r.json.geometry)||void 0===l?void 0:l.lineTransform)||void 0===c?void 0:c.pivot.y)&&void 0!==h?h:0)},fillStyle:null==o?void 0:o.fill,lineWidth:null!==(d=null==o?void 0:o.width)&&void 0!==d?d:0}));p.graphicsId="".concat(a,"-arrow-").concat(t,"-graphics"),p.textureId="".concat(a,"-arrow-").concat(t,"-fill"),r.ctx.graphicsTexture.addGraphics(p.graphicsId,null!==(f=p.paths)&&void 0!==f?f:[],p.hash,{x:0,y:0},p.width,p.height,void 0,r.ctx.objectPoolGroup,!0,s,null),r.arrowList.push(p)}))}},{key:"calculateFillObjectOffset",value:function(){var e=0,t=0;return this.arrowList.length&&(e=this.arrowList.reduce((function(e,t){return Math.max(e,t.width)}),0),t=this.arrowList.reduce((function(e,t){return Math.max(e,t.height)}),0)),[e,t]}},{key:"preRender",value:function(e){var t,r,n,i=this,o=this.json,a=o.lineStyle,s=o.geometry,u=(null==s?void 0:s.lineTransform)||kg,l=u.width,c=u.height,h=l||this.json.width,d=c||this.json.height,f=(null===(t=null==s?void 0:s.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],p="solidFill"===(null===(r=null==a?void 0:a.fill)||void 0===r?void 0:r.fillType)?a.fill.color:null;e.addSubMTask((function(){return Mg(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=M(f);try{for(t.s();!(r=t.n()).done;)n=r.value,this.ctx.graphicsTexture.addGraphics(n.id,[n],n.hash,((null==s?void 0:s.lineTransform)||kg).pivot,h,d,a,this.ctx.objectPoolGroup,!0,null,p)}catch(e){t.e(e)}finally{t.f()}case 2:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[addGraphics]"),null===(n=this.text)||void 0===n||n.createParagraphs(this.json.id,e)}},{key:"subClassRender",value:function(){return Mg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return Mg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(r=this.backgroundGraphics)||void 0===r||r.render(),this.createBackground(),e.next=5,this.subClassRender();case 5:this.createFilledPathMask(),this.createPathFill(),this.createArrow();case 8:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[render]"),this.text&&this.text.render(e),e.addSubMTask((function(){return Mg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(r=this.json.textBody)||void 0===r?void 0:r.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(p=null!==(n=this.json.scale)&&void 0!==n?n:{x:1,y:1},v=p.x,m=p.y,this.text.container.scale.x=m<0?-Math.abs(v):Math.abs(v),this.text.container.scale.y=m,this.text.container.position.x=(null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0)+this.text.x,this.text.container.position.y=(null!==(s=null===(a=this.json.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container))):(this.text&&(this.json.textRotation&&(this.text.container.rotation=this.json.textRotation,g=this.text,y=g.width,_=g.height,b=this.text.container.position,x=b.x,w=b.y,this.text.container.pivot.x=y/2,this.text.container.pivot.y=_/2,this.text.container.x=x+y/2,this.text.container.y=w+_/2),Gv()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape&&(S=this.json.rotation||0,this.text.container.rotation=-S,T=this.text.width,this.text.container.position.x=T),this.text.container.zIndex=100,M=null===(u=this.json.effectList)||void 0===u?void 0:u.find((function(e){return"outerShadow"===e.type})),k=null===(l=this.json.effectList)||void 0===l?void 0:l.find((function(e){return"softEdge"===e.type})),E=null===(c=this.json.effectList)||void 0===c?void 0:c.find((function(e){return"glow"===e.type})),M&&1!==M.sx||k||E?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)),this.renderContainer.addChild(this.container)),"background"===this.json.id&&this.ctx.hasBackgroundFillShape&&(I=$l.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)}),this.ctx.renderer.render(this.renderContainer,{renderTexture:I}),this.ctx.bgTexture=I),this.json.effectList&&this.json.effectList.length>0&&(null===(h=this.ctx.featureList)||void 0===h?void 0:h.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new lg(this.effectContainer,this.json.effectList,"".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(this.json.id),this.ctx,this.json.rotation||0,new jl.g((null===(d=this.json.scale)||void 0===d?void 0:d.x)||1,(null===(f=this.json.scale)||void 0===f?void 0:f.y)||1)),function(e){var t,r,n;return"gifFill"===(null===(t=e.fillStyle)||void 0===t?void 0:t.fillType)||"gifFill"===(null===(n=null===(r=e.lineStyle)||void 0===r?void 0:r.fill)||void 0===n?void 0:n.fillType)||!!e.picFill&&"gifFill"===e.picFill.fillType}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",(function(){var e;A.effectContainer.visible=!1,A.effectObject.container.zIndex=10,A.container.addChild(A.effectObject.container),null===(e=A.effectObject)||void 0===e||e.updateFrame(1),A.applyEffectCacheAsBitMap(!0)})));case 3:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r;"gifFill"!==(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)&&(null===(r=this.effectObject)||void 0===r||r.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)})))}},{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"destroy",value:function(){var e,t,r,n;null===(e=this.text)||void 0===e||e.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(t=this.backgroundGraphics)||void 0===t||t.destroy(),this.strokeFill.destroy(),null===(r=this.strokeGraphics)||void 0===r||r.destroy(),this.renderContainer.destroy(),null===(n=this.arrowRenderTexture)||void 0===n||n.destroy(!0),this.arrowList=[],this.effectDisposer()}},{key:"interactiveContainer",get:function(){return this.renderContainer}},{key:"strokeActive",get:function(){var e,t,r,n,i,o,a;return this.strokeFill.displayObject?(null!==(r=null===(t=null===(e=this.strokeFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a,s=this.strokeFill.displayObject;e?s&&(null!==(r=null===(t=s.filters)||void 0===t?void 0:t.indexOf(this.strokeColorFilter))&&void 0!==r?r:-1)<0?s.filters=[this.strokeColorFilter]:(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.strokeGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):s?s.filters=[]:(null===(a=this.strokeGraphics)||void 0===a?void 0:a.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}},{key:"pptColorActive",get:function(){var e,t;return(null!==(t=null===(e=this.renderContainer.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){this.renderContainer.filters=e?[this.pptColorFilter]:[]}},{key:"fillActive",get:function(){var e,t,r,n,i,o,a;return this.backgroundFill.displayObject?(null!==(r=null===(t=null===(e=this.backgroundFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==r?r:-1)>0:(null!==(a=null===(o=null===(i=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,r,n,i,o,a;e?this.backgroundFill.displayObject&&(null!==(r=null===(t=this.backgroundFill.displayObject.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==r?r:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)&&(null!==(o=null===(i=this.backgroundGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}}]),r}(Fv),Ig=r(119),Ag=new(r.n(Ig).a),Cg=Ag.getDevice(),Pg=Ag.getBrowser(),Ng=Ag.getOS(),Og={isDesktop:function(){var e=!0;return"mobile"===Cg.type&&(e=!1),/Samsung/.test(Pg.name||"")&&(e=!1),window.__nativeTags&&window.__nativeTags.platform&&(e=!1),e},isIOS:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(e=!0),Ng.name&&/iOS/.test(Ng.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),Ng.name&&/android/i.test(Ng.name)&&(e=!0),e},isLowGpuMemory:function(){var e,t,r=null!==(t=null===(e=window.__nativeTags)||void 0===e?void 0:e.platform)&&void 0!==t?t:"";if(r){var n=r.split(" ");if(n[1]){if(/^iPad/.test(n[1])){var i=n[1].match(/^iPad(\d+)/);return!(i&&i[1]&&parseInt(i[1],10)>=6)}if(/^iPhone/.test(n[1])){var o=n[1].match(/^iPhone(\d+)/);return!(o&&o[1]&&parseInt(o[1],10)>=9)}return!1}return!1}return!0}},Rg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function Dg(e,t){for(var r in t)e.style[r]=t[r]}var Lg="median-container",jg=1500,zg=300,Bg=50,Ug="0",Fg="1",Wg=.4,Gg=function(){function e(t){var r,n,i=this;x(this,e),this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.fadeState={in:!1,out:!1},this.changeMediaProgress=function(e){if(i.ctx.isPlayerPaused())i.ctx.logger.info("Media controller prevent seek event with paused state",i.ctx.taskId);else{e.stopPropagation();var t=e.offsetX/i.progress.clientWidth*i.duration;i.medianIsEnd=!1,"interactive"!==i.ctx.mode&&i.jumpToTime(t),"local"!==i.ctx.mode&&i.ctx.eventHub.emit(__.mediaSeek,{id:i.targetId,time:t,isPlaying:i.media.isPlaying}),i.delayHide()}},this.jumpToTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Rg(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,dv((function(){return!!n.duration}),3e3);case 2:r=Math.floor(e)+this.start,this.media.currentTime!==r&&(this.media.currentTime=r,this.changeBookmarkIndex(r,r>this.media.currentTime));case 4:case"end":return t.stop()}}),t,this)})))},this.showController=function(e){e.stopPropagation(),i.show()},this.getMediaDuration=function(){i.duration&&!Number.isNaN(i.duration)||(i.duration=i.media.duration,i.start&&(i.duration-=i.start,i.jumpToTime()),i.end&&(i.duration-=i.end)),i.totalTime.innerText=e.formatTime(i.duration)},this.playMedia=function(){return Rg(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="none",this.pauseButton.style.display="block",e.next=4,this.media.play();case 4:this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach((function(e){e()})),this.delayHide();case 7:case"end":return e.stop()}}),e,this)})))},this.pauseMedia=function(){return Rg(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="block",this.pauseButton.style.display="none",e.next=4,this.media.pause();case 4:case"end":return e.stop()}}),e,this)})))},this.onMouseOut=function(e){e.stopPropagation(),i.hide()},this.mediaTimeUpdate=function(){return Rg(i,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.media.currentTime-this.start,t.t0=this.duration>0&&(Math.abs(r-this.duration)<.3||r>this.duration),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(__.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle();case 9:if(this.currentTime.innerText=e.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!(this.bookmarkList&&this.bookmarkList.length>0)){t.next=14;break}(n=this.bookmarkList[this.pickBookmarkIndex])&&n.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit("shape ".concat(this.shapeId," onMediaBookmark ").concat(n.name)),this.pickBookmarkIndex+=1);case 14:this.fadeHit(r);case 15:case"end":return t.stop()}}),t,this)})))},this.onPauseMedia=function(){i.playButton.style.display="block",i.pauseButton.style.display="none"},this.onPlayMedia=function(){i.fadeState={in:!1,out:!1},i.fadeHit(0),i.playButton.style.display="none",i.pauseButton.style.display="block",i.playCallBackList.forEach((function(e){e()})),i.media.currentTime0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","polyline");return n.setAttributeNS(null,"points","35 0, 477 256, 35 512"),n.setAttributeNS(null,"fill","#000000"),r.appendChild(n),r}},{key:"generatePauseButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dg(r,{height:e+"px"}),r.setAttributeNS(null,"viewBox","0 0 512 512"),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"width",t.toString());var n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttributeNS(null,"x","35"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width","148"),n.setAttributeNS(null,"height","512");var i=n.cloneNode(!0);return i.setAttributeNS(null,"x","330"),r.append(n,i),r}},{key:"generateFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dg(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),r.appendChild(n),document.body.appendChild(r),r}},{key:"generateExitFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=document.createElementNS("http://www.w3.org/2000/svg","svg");Dg(r,{height:e+"px",width:t+"px"}),r.setAttributeNS(null,"width",t.toString()),r.setAttributeNS(null,"height",e.toString()),r.setAttributeNS(null,"viewBox","0 0 1024 1024");var n=document.createElementNS("http://www.w3.org/2000/svg","path"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),i.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),r.appendChild(n),r.appendChild(i),document.body.appendChild(r),r}},{key:"createButton",value:function(){var e={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};Dg(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Dg(t,{height:"20px"}),this.playButton.appendChild(t),Dg(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var r=this.generatePauseButton();if(Dg(r,{height:"20px"}),this.pauseButton.appendChild(r),this.isVideo){var n=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(n),Dg(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Dg(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Dg(e,{width:"100px"}),this.currentTime.innerText="00:00";var t=document.createElement("span");return t.innerText="/",e.append(this.currentTime,t,this.totalTime),e}},{key:"createProgress",value:function(){var e={flex:"1",position:"relative"};this.isVideo||(e.marginRight="10px"),Dg(this.progress,e);var t=document.createElement("div");Dg(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Dg(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}},{key:"fadeHit",value:function(e){if(this.info.fade){var t=this.info.fade,r=t.start,n=t.end;r&&!this.fadeState.in&&e>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,r)),n&&!this.fadeState.out&&e>=this.duration-n/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,n))}}},{key:"changeBookmarkIndex",value:function(e,t){if(this.bookmarkList&&0!==this.bookmarkList.length){if(this.pickBookmarkIndex>0)for(var r=0;re){this.pickBookmarkIndex=r;break}if(t){for(var n=this.pickBookmarkIndex-1,i=0;il?l/r:1);s.y=s.y+this.height-n,s.x=Math.max(s.x,0),s.x=Math.min(s.x,o-r*c),s.y=Math.max(s.y,0),s.y=Math.min(s.y,a-n),Dg(this.mediaController,{height:n+"px",borderRadius:n/2+"px",width:r+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:s.x+"px",top:s.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:"scale(".concat(c,")"),transformOrigin:"0 100%"}),this.fullscreenStatus&&Dg(this.mediaController,{left:"0",top:a-n+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Dg(this.mediaController,{display:"none",transition:"opacity ".concat(Wg,"s")}),this.createButton();var e=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,e,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}},{key:"addPlayCallBack",value:function(e){this.playCallBackList.push(e)}},{key:"fullscreenPlay",value:function(){this.fullscreenStatus=!0,"interactive"!==this.ctx.mode&&this.media.requestFullscreen(),"local"!==this.ctx.mode&&this.ctx.eventHub.emit(__.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}},{key:"changeFullScreenState",value:function(e,t,r){r===this.ctx.slideIndex&&(e&&this.targetId===t?this.fullscreenStatus=e:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}},{key:"bindEvent",value:function(){Og.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this._pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"unbindEvent",value:function(){var e;Og.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),null===(e=this.containerObserver)||void 0===e||e.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"show",value:function(){this.setControllerPosition(),this.mediaController.style.opacity=Fg,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}},{key:"hide",value:function(){this.fullscreenStatus?this.mediaController.style.opacity=Ug:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),jg)}},{key:"destroy",value:function(){var e;this.unbindEvent(),this.playCallBackList=[],null===(e=this.container)||void 0===e||e.removeChild(this.mediaController)}},{key:"clippedDuration",get:function(){return this.duration}}],[{key:"formatTime",value:function(e){var t="00:00";if(e){var r=Math.floor(e/60),n=String(r<0?0:r).padStart(2,"0"),i=Math.floor(e%60);t="".concat(n,":").concat(String(i<0?0:i).padStart(2,"0"))}return t}}]),e}(),Vg=r(120),Hg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o,a,s,u;return x(this,r),(a=t.call(this)).isGlobalPause=!1,a.lastTime=-1,a.howl=null,a.rctClient=null,a.isHowlEnd=!1,a.isHowlLoadEmit=!1,a.staticEventId=1001,a._catParams=void 0,a.url=e,a.runningAudio=n,i&&(a._catParams=i),b_.RtcAudioClazz?(a.rctClient=new b_.RtcAudioClazz(e,null===(s=a._catParams)||void 0===s?void 0:s.start,null===(u=a._catParams)||void 0===u?void 0:u.end),a.rctClient.on("load",(function(){return a.emit("load")})),a.rctClient.on("pause",(function(){return a.emit("pause")})),a.rctClient.on("play",(function(){a.startTimeChangeEmit(),a.emit("play")})),a.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){a.emit("resumeAllAudioInterruptByAudioSessionChanged")}))):(a.howl=new Vg.Howl({src:[e]}),o=c(a.howl._getSoundIds(),1),a.staticEventId=o[0],a.howl.load(),a.howl.on("load",(function(){a.isHowlLoadEmit=!0,a.emit("load")})),a.howl.on("pause",(function(){return a.emit("pause")})),a.howl.on("play",(function(){a.isHowlLoadEmit||a.emit("load"),a.isHowlEnd=!1,a.startTimeChangeEmit(),a.emit("play")})),a.howl.on("end",(function(){a.isHowlEnd=!0}))),a}return S(r,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout((function(){e.isPaused||e.startTimeChangeEmit()}),300)}},{key:"play",value:function(){var e,t,r;this.runningAudio.has(this.url)&&(null===(e=this.runningAudio.get(this.url))||void 0===e||e.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(this.staticEventId),null===(r=this.rctClient)||void 0===r||r.play(),this.runningAudio.set(this.url,this)}},{key:"fade",value:function(e,t,r){this.howl&&this.howl.fade(e,t,r)}},{key:"pause",value:function(){var e,t;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),null===(t=this.rctClient)||void 0===t||t.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"globalPause",value:function(){this.isPaused||(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"stop",value:function(){var e;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"destroy",value:function(){var e,t,r,n,i,o,a,s;null===(e=this.howl)||void 0===e||e.stop(this.staticEventId),null===(t=this.howl)||void 0===t||t.unload(),null===(r=this.rctClient)||void 0===r||r.pause(),null===(n=this.rctClient)||void 0===n||n.destroy(),null===(i=this.rctClient)||void 0===i||i.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(a=this.rctClient)||void 0===a||a.removeAllListeners("pause"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"volume",value:function(e){this.rctClient?this.rctClient.volume(e):this.howl&&this.howl.volume(e)}},{key:"currentTime",get:function(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek(this.staticEventId):-1},set:function(e){this.rctClient?this.rctClient.currentTime=e:this.howl&&this.howl.seek(e,this.staticEventId)}},{key:"duration",get:function(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration(this.staticEventId):0}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&!this.howl.playing(this.staticEventId)}}]),r}(Ks.a),Yg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},$g=function(e){p(r,e);var t=m(r);function r(e){var n,i,o,a,s,u,l,c;x(this,r),(n=t.call(this)).type="video",n.sprite=new Ld,n.isPlaying=!1,n.isGlobalPause=!1,n.fullscreen=!1,n.url="",n.isLoaded=!1,n.onVideoResourceLoaded=function(){n.isLoaded=!0},n.onVideoStalled=function(){n.ctx.logger.warn(n.url+", Failed to fetch data, but trying.",n.ctx.taskId)},n.updateVolume=function(e){n.rtcAudio.volume(e)},n.syncFullscreenVideoState=function(e){var t=e.targetId,r=e.state;e.slideIndex===n.ctx.slideIndex&&t===n.id&&(r?(n.requestFullscreen(),n.ctx.latestChangeFullscreenTargetId=t):n.requestCancelFullscreen())},n.id=e.id,n.start=null===(i=e.video.cut)||void 0===i?void 0:i.start,n.end=null===(o=e.video.cut)||void 0===o?void 0:o.end,n.fullscreen=null!==(a=e.video.fullscreen)&&void 0!==a&&a,n.container=e.container,n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var h=e.video.src;n.videoResource=new $l.w(h,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),null===(s=n.videoElement)||void 0===s||s.addEventListener("stalled",n.onVideoStalled),null===(u=n.videoElement)||void 0===u||u.addEventListener("loadedmetadata",n.onVideoResourceLoaded),n.url=e.video.src;var d=e.video.src.replace(/4$/,"3");n.ctx.loaderDelegate&&(d=n.ctx.loaderDelegate.redirectMedia(d),n.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(d," by delegate."),e.ctx.taskId)),n.rtcAudio=new Hg(d,e.ctx.runningAudio,{start:null===(l=e.video.cut)||void 0===l?void 0:l.start,end:null===(c=e.video.cut)||void 0===c?void 0:c.end}),n.rtcAudio.on("timeupdate",(function(e){if(n.videoElement){var t=n.videoElement.currentTime;Math.abs(t-e)>.5&&(n.videoElement.currentTime=e)}})),n.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){var e;null===(e=n.videoElement)||void 0===e||e.pause(),setTimeout((function(){var e;n.rtcAudio.isPaused||null===(e=n.videoElement)||void 0===e||e.play()}),200)}));var f=e.video,p=e.width,v=e.height,m=e.target;n.controller=new Gg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:p,height:v,target:m,media:y(n),info:f,canvasElement:e.canvasElement}),n.controller.addPlayCallBack((function(){n.sprite.width=p,n.sprite.height=v,n.ctx.clock.setTimeout((function(){n.sprite.visible=!0}),50)}));var g=new $l.c(null,{height:v,width:p});return g.resource=n.videoResource,n.videoResource.bind(g),n.sprite=new Ld,n.sprite.visible=!1,n.sprite.texture=new $l.t(g),n.sprite.interactive=!0,n.container.addChild(n.sprite),n.sprite.on("mouseover",(function(e){e.stopPropagation(),n.controller.show()})),n.sprite.on("mouseout",(function(e){e.stopPropagation(),n.controller.hide()})),["durationchange","timeupdate","pause","play"].forEach((function(e){var t;null===(t=n.videoElement)||void 0===t||t.addEventListener(e,(function(){"timeupdate"===e&&n.isPlaying,n.emit(e)}))})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n.ctx.globalEventHub.on("syncFullscreenVideoState",n.syncFullscreenVideoState),n}return S(r,[{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),e.next=4,this.load();case 4:return e.next=6,this.ctx.clock.waitUntil((function(){var e=r.videoElement;return!!(e&&e.videoWidth>0)}),3e3);case 6:(t=this.videoElement)&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.on("play",(function(){var e;null===(e=r.videoElement)||void 0===e||e.play(),r.fullscreen&&r.controller.fullscreenPlay()})),this.rtcAudio.play());case 8:case"end":return e.stop()}}),e,this)})))}},{key:"load",value:function(){return this.videoResource.load()}},{key:"pause",value:function(){var e,t=this;this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.once("pause",(function(){var e;null===(e=t.videoElement)||void 0===e||e.pause()})),this.rtcAudio.pause(),null===(e=this.videoElement)||void 0===e||e.pause()}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dv((function(){return r.isLoaded}),5e3);case 2:t=new $l.t(this.sprite.texture.baseTexture),this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"requestCancelFullscreen",value:function(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}},{key:"destroy",value:function(){var e,t,r;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),null===(e=this.videoElement)||void 0===e||e.removeEventListener("stalled",this.onVideoStalled),null===(t=this.videoElement)||void 0===t||t.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(r=this.videoResource)||void 0===r||r.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}},{key:"fadeIn",value:function(e,t){this.rtcAudio.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"videoElement",get:function(){return this.videoResource.source}},{key:"currentTime",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:0},set:function(e){this.rtcAudio.currentTime=e,this.videoElement&&(this.videoElement.currentTime=e)}},{key:"paused",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.paused)||void 0===t||t}},{key:"duration",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.duration)&&void 0!==t?t:0}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}}]),r}(Ks.a),Xg=function(e){p(r,e);var t=m(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).type="audio",n.isPlaying=!1,n.isGlobalPause=!1,n.updateVolume=function(e){n.audioPlayer.volume(e)},n.id=e.id;var a=e.audio.src;n.audioPlayer=new Hg(a,e.ctx.runningAudio,{start:null===(i=e.audio.cut)||void 0===i?void 0:i.start,end:null===(o=e.audio.cut)||void 0===o?void 0:o.end}),e.audio.cut&&(n.start=e.audio.cut.start,n.end=e.audio.cut.end),n.ctx=e.ctx,n.ctx.medias[n.id]=y(n);var s=e.width,u=e.height,l=e.target;return n.controller=new Gg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:u,width:s,target:l,media:y(n),info:e.audio,canvasElement:e.canvasElement}),n.audioPlayer.on("load",(function(){return n.emit("durationchange")})),n.audioPlayer.on("timeupdate",(function(){return n.emit("timeupdate")})),n.audioPlayer.on("pause",(function(){return n.emit("pause")})),n.audioPlayer.on("play",(function(){return n.emit("play")})),n.ctx.activeMedia.add(y(n)),n.ctx.volumeAdjuster.on("update",n.updateVolume),n}return S(r,[{key:"load",value:function(){return Promise.resolve()}},{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(__.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){}},{key:"requestCancelFullscreen",value:function(){}},{key:"destroy",value:function(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}},{key:"fadeIn",value:function(e,t){this.audioPlayer.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"currentTime",get:function(){return this.audioPlayer.currentTime},set:function(e){this.audioPlayer.currentTime=e}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}},{key:"paused",get:function(){return this.audioPlayer.isPaused}},{key:"isPaused",get:function(){return this.audioPlayer.isPaused}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),r}(Ks.a),qg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Qg=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,Object.assign(Object.assign({},e),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),n,i)).isInteractiveOutside=!1,o.cmd=new Ov(y(o)),o.media=null==e?void 0:e.media,o.container.name=e.id+"_container_[Picture]",o.renderContainer.name=e.id+"_render_container_[Picture]",o.picFill=new zm(o.ctx,e.picFill,e.width,e.height,{useFilter:!0,useSlideBackgroundFill:!1}),o}return S(r,[{key:"applyCommand",value:function(e,t){var r,n,i,o;if("call"===t)if(/playFrom\(([0-9.]+)\)/.test(e)){var a=e.match(/playFrom\(([0-9.]+)\)/),s=Number(a[1]||"0");null===(r=this.mediaPlayer)||void 0===r||r.controller.playMediaFromCtrl(!0),Math.abs(s)>.1&&(null===(n=this.mediaPlayer)||void 0===n||n.controller.jumpToTime(s))}else"custom-pause"===e?null===(i=this.mediaPlayer)||void 0===i||i.controller.pauseMediaFromCtrl(!0):"togglePause"===e?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):"stop"===e&&(null===(o=this.mediaPlayer)||void 0===o||o.stop())}},{key:"applyEffectCacheAsBitMap",value:function(e){var t,r,n;"gifFill"===(null===(t=this.json.fillStyle)||void 0===t?void 0:t.fillType)||this.media&&"video"===this.media.type||"gifFill"===(null===(r=this.json.picFill)||void 0===r?void 0:r.fillType)||null===(n=this.effectObject)||void 0===n||n.container.children.forEach((function(t){"effect-sprite"!==t.name&&(t.cacheAsBitmap=e)}))}},{key:"renderPic",value:function(){var e,t,r,n,i,o;return qg(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,l,c,h,d=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(s=this.picFill.displayObject)){a.next=15;break}if(s.name=this.json.id+"_pic_fill_[Picture]",u=null===(e=this.backgroundGraphics)||void 0===e?void 0:e.getClonedDisplayObject(),(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.isNeedMask(s.width,s.height))&&u&&(s.mask=u,this.effectContainer.addChild(u)),s.width=this.designWidth,s.height=this.designHeight,s instanceof jp&&this.ctx.slideScopeEventHub.once("slide-render",(function(e){var t;d.ctx.slideIndex===e&&(null===(t=d.effectObject)||void 0===t||t.setFrameCount(s.totalFrames),s.play(),s.onFrameChange=function(e){if(d.effectObject)if(d.effectObject.hasFrame(e))d.effectObject.updateFrame(e);else{var t=d.getEffectTexture();t&&(d.effectObject.createFrame(e,t.texture),d.effectObject.setFrameOffset(t.offsetX,t.offsetY))}})})),this.effectContainer.addChild(s),!this.media){a.next=13;break}if(l=this.media.src,"audio"===this.media.type&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),!this.ctx.urlInterrupter){a.next=12;break}return c=Date.now(),a.next=10,this.ctx.urlInterrupter(l);case 10:l=a.sent,this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-c),this.ctx.taskId);case 12:this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info("redirect media url to ".concat(l," by delegate."),this.ctx.taskId)),this.media.src=l;case 13:"video"===(null===(r=this.media)||void 0===r?void 0:r.type)&&this.media.src?(this.mediaPlayer=new $g({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.effectContainer,canvasElement:this.ctx.view}),(null===(n=this.mediaPlayer)||void 0===n?void 0:n.sprite)&&u&&(h=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.getClonedDisplayObject())&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))):"audio"===(null===(o=this.media)||void 0===o?void 0:o.type)&&this.media.src&&(this.mediaPlayer=new Xg({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view,fade:this.media.fade})),this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,Og.isDesktop()?(this.container.on("mouseover",(function(){d.mediaPlayer.showController()})),this.container.on("mouseout",(function(){d.mediaPlayer.hideController()}),!1)):this.container.on("pointerdown",(function(){d.mediaPlayer.showController()})));case 15:case"end":return a.stop()}}),a,this)})))}},{key:"preRender",value:function(e){f(b(r.prototype),"preRender",this).call(this,e)}},{key:"subClassRender",value:function(){return qg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.renderPic();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"clearOnSlideChange",value:function(){f(b(r.prototype),"clearOnSlideChange",this).call(this),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}},{key:"initOnReuse",value:function(){f(b(r.prototype),"initOnReuse",this).call(this),this.mediaPlayer&&(this.container.interactive=!0)}},{key:"destroy",value:function(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}]),r}(Eg),Zg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Kg=function(e){p(r,e);var t=m(r);function r(e,n,i,o){var a;return x(this,r),(a=t.call(this,e,n,i)).children=[],a.cacheSprite=new Ld,a.cacheContainer=new Dl.b,a.json=e,a.json.fillStyle&&"groupFill"===a.json.fillStyle.fillType&&i.groupFillStyle&&(a.json.fillStyle=i.groupFillStyle),a.container.name=e.id+"_container_[Container]",a.cacheContainer.name=e.id+"_cache_container_[Container]",a.ctx.timingTargets.addTarget(e.id,y(a)),a.updateTransform(a.json),a.fillObject=new zm(a.ctx,e.fillStyle,e.width,e.height,{useFilter:!1,useSlideBackgroundFill:!1}),a.createChildren(o),a}return S(r,[{key:"createChildren",value:function(e){for(var t,n,i,o,a=this,s={x:null!==(n=null===(t=this.json.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,y:null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},u=function(t,n){e.addSubMTask((function(){return Zg(a,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=this.json.children[t],o=null,this.ctx.featureList&&this.ctx.featureList.smartArt&&("Shape"===(null==i?void 0:i.type)||"Picture"===(null==i?void 0:i.type))&&this.ctx.smartArtShapeList&&(a=i.id,(u=this.ctx.smartArtShapeList.find((function(e){return e.id===a})))&&(i=u)),l={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}},"Shape"===(null==i?void 0:i.type)?o=new Eg(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new Qg(i,this.ctx,l):"Container"===(null==i?void 0:i.type)&&(o=new r(i,this.ctx,l,e)),o&&this.children.push(o);case 4:case"end":return n.stop()}}),n,this)})))}),"@ContainerImpl[child.init]")},l=0,c=this.json.children.length;l1&&void 0!==arguments[1]?arguments[1]:{};if(e)if(e.delay&&e.delay>0){var r=a.ctx.clock.setTimeout((function(){e.event&&(a.cond[e.event]=!0,a.detectTrigger(t))}),e.delay);a.timeoutIds.push(r)}else a.cond[e.event]=!0,a.detectTrigger(t);else a.detectTrigger(t)},a.id=e,a.ctx=o,a.eventHubs=i,n.forEach((function(e){a.addCond(e)})),a}return S(r,[{key:"setTriggerParams",value:function(e){this.triggerParams=e}},{key:"addCond",value:function(e){var t=this,r=function(){for(var r=arguments.length,n=new Array(r),i=0;i0&&(this.cond[e.event]=!1,this.eventHubs.runtime.addListener(e.event,r)):this.cond[e.event]=!1)}},{key:"isTrigger",value:function(){var e=this;return Object.keys(this.cond).every((function(t){return!!e.cond[t]}))}},{key:"isTriggerWithoutParent",value:function(){var e=this;return Object.keys(this.cond).filter((function(e){return"self"!==e})).every((function(t){return!!e.cond[t]}))}},{key:"detectTrigger",value:function(e){var t=this;if(Object.keys(this.cond).every((function(e){return!!t.cond[e]}))){Object.keys(this.cond).forEach((function(e){t.cond[e]=!1}));var r=this.triggerParams;this.triggerParams=void 0,this.emit("active",r,e)}}},{key:"reset",value:function(){var e=this;Object.keys(this.cond).forEach((function(t){e.cond[t]=!1})),this.timeoutIds.forEach((function(t){return e.ctx.clock.clearTimeout(t)}))}}]),r}(Ks.a),ey=function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r),(n=t.call(this)).isTimeNodeEndSync=!1,n.interactiveListeners=[],n.runtimeNodeEventHub=new Ks.a,n._currentSeqIndex=0,n._currentSeqState="idle",n.isForward=!0,n.autoPlay=!1,n.handlePrev=function(){var e,t,r,i,o,a,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.hasPrev()||!n.isMainSeq?"idle"===n.currentSeqState?(n.decrSeqIndex(),null===(e=n.commonTimeNode.children[n.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToStart(),null===(t=n.commonTimeNode.children[n.currentSeqIndex])||void 0===t||t.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"running"===n.currentSeqState?(null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.seekToStart(),null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),n.currentSeqState="idle"):"end"===n.currentSeqState&&(n.currentSeqIndex>=n.commonTimeNode.children.length&&(n.currentSeqIndex=n.commonTimeNode.children.length-1),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.seekToStart(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.clearSubList(),n.currentSeqState="idle"):n.globalEventHub.emit("c:prev slide",s)},n.handleNext=function(e,t){var r,i,o,a;if(n.isTimeNodeEndSync&&(n.isTimeNodeEndSync=!1,n.currentSeqState="idle",n.currentSeqIndex=0),!n.hasNext()&&n.isMainSeq&&t)n.globalEventHub.emit("c:next slide",e);else{if(n.isInteractiveSeq){n.globalEventHub.emit("shape slide onNext"+(n.json.ctn.id||""));var s={result:null};n.findChildInfiniteRepeat(n.commonTimeNode,s),1===n.commonTimeNode.children.length&&s.result&&(s.result.json.subTnLst||[]).length>0&&0===n.currentSeqIndex&&"running"===n.currentSeqState&&n.commonTimeNode.allChildrenEndHandle()}"idle"===n.currentSeqState?null===(r=n.commonTimeNode.children[n.currentSeqIndex])||void 0===r||r.commonTimeNode.startTimeNodeForce():"running"===n.currentSeqState?(null===(i=n.commonTimeNode.children[n.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToEnd(!1,!0),n.currentSeqState="end",n.incrSeqIndex(),null===(o=n.commonTimeNode.children[n.currentSeqIndex])||void 0===o||o.commonTimeNode.startTimeNodeForce()):"end"===n.currentSeqState&&(n.incrSeqIndex(),null===(a=n.commonTimeNode.children[n.currentSeqIndex])||void 0===a||a.commonTimeNode.startTimeNodeForce())}};var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,h=e.eventHub,d=e.iterateIndex,f=e.iterateId,p=e.isInInteractiveSeq;return n.isMainSeq="mainSeq"===i.ctn.nodeType,n.isInteractiveSeq="interactiveSeq"===i.ctn.nodeType,n.id=i.ctn.id,n.isIterate=a,n.json=i,n.ctx=l,n.globalEventHub=h,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:h,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:d,iterateId:f,isInInteractiveSeq:p||n.isInteractiveSeq,fromSeqId:n.isInteractiveSeq?n.json.ctn.id:""}),n.bindShapeEvent(),n.nextConds=new Jg("mainSeq",i.nextCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.prevConds=new Jg("mainSeq",i.preCondLst,{global:h,runtime:n.runtimeNodeEventHub},n.ctx),n.commonTimeNode.on("timeNodeRestart",(function(){n.currentSeqIndex=0,n.currentSeqState="idle"})),n.commonTimeNode.on("childTimeNodeStart",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="running",n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepStart,t)})),n.commonTimeNode.on("childTimeNodeEnd",(function(e){var t=n.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(n.currentSeqIndex=t),n.currentSeqState="end",n.autoPlay&&n.ctx.clock.setTimeout((function(){n.handleNext(!1,!0)})),n.isMainSeq&&n.ctx.eventHub.emit(__.mainSeqStepEnd,t)})),n.commonTimeNode.on("timeNodeEndSync",(function(){n.isTimeNodeEndSync=!0,n.commonTimeNode.resetForRepeat()})),n.commonTimeNode.on("timeNodeDestroy",(function(){n.interactiveListeners.forEach((function(e){var t=c(e,2),r=t[0],n=t[1];r&&n&&r.interactiveContainer.removeListener("pointerdown",n)})),n.interactiveListeners=[]})),n.nextConds.on("active",(function(e,t){Array.isArray(t)?n.handleNext(t[0],t[1]):n.handleNext(t,!0)})),n.prevConds.on("active",(function(e,t){Array.isArray(t)?n.handlePrev(t[0]):n.handlePrev(t)})),n}return S(r,[{key:"startAutoPlay",value:function(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}},{key:"incrSeqIndex",value:function(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}},{key:"decrSeqIndex",value:function(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}},{key:"hasPrev",value:function(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}},{key:"hasNext",value:function(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}},{key:"findChildInfiniteRepeat",value:function(e,t){var r=this;e.isInfiniteRepeat()?t.result=e:e.children.map((function(e){return e.commonTimeNode})).forEach((function(e){return r.findChildInfiniteRepeat(e,t)}))}},{key:"bindShapeEvent",value:function(){var e=this;"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach((function(t){if(/^shape/.test(t.event)){var r=t.event.split(" ")[1];if(r){var n=e.ctx.timingTargets.getTargetById(r);if(n){n.interactiveContainer.interactive=!0,n.interactiveContainer.cursor="pointer";var i=function(){e.ctx.eventHub.emit(__.userInput);var t="shape ".concat(r," onClick"),n=e.ctx.mode;"interactive"!==n&&"sync"!==n||e.ctx.eventHub.emit(__.interactiveSeqAction,{action:t,seqId:e.json.ctn.id}),"sync"!==n&&"local"!==n||e.globalEventHub.emit(t)};n.interactiveContainer.on("pointerdown",i),e.interactiveListeners.push([n,i])}}}}))}},{key:"setCurrentStep",value:function(e,t){var r=this.commonTimeNode.children.length;if(!(e>r)){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);var n=e;if(this.commonTimeNode.seekToStart(),-1===n&&(n=r-1),0!==n||"start"!==t){if(n>=0&&n=1){var r=n.json.cBhvr.attrList[0];n.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");var i=n.json.cBhvr.to||n.json.to;i&&n.timingTarget&&ty(n.timingTarget,r,i)}})),n}return S(r,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),oy=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==("undefined"==typeof Reflect?"undefined":T(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},ay=function(){function e(t,r){x(this,e),this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:function(e){return e/Math.PI*180},exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:function(e){return e/180*Math.PI},rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=r,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}return S(e,[{key:"parseFmla",value:function(e){var t=e.replace(/#ppt_h/g,"(".concat(this.timingTarget.design_ppt_h,")"));return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/#ppt_w/g,"(".concat(this.timingTarget.design_ppt_w,")"))).replace(/#ppt_x/g,"(".concat(this.timingTarget.design_ppt_x,")"))).replace(/#ppt_y/g,"(".concat(this.timingTarget.design_ppt_y,")"))).replace(/ppt_w/g,"vars.ppt_w")).replace(/ppt_h/g,"vars.ppt_h")).replace(/ppt_x/g,"vars.ppt_x")).replace(/ppt_y/g,"vars.ppt_y")).replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach((function(e){var r=new RegExp("([^a-z])".concat(e,"([^a-z])"),"g");t=t.replace(r,(function(t,r,n){return"".concat(r,"math.").concat(e).concat(n)}))})),new Function("vars","math","$","return "+t)}}]),e}(),sy=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this,e,n)).value=e.val.value,i&&(o.fmla=o.parseFmla(i)),o}return S(r,[{key:"resolveValue",value:function(){return this.value}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue()-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],sy.prototype,"interpolationFrom",null);var uy=function(e){p(r,e);var t=m(r);function r(e,n){var i,o;return x(this,r),(i=t.call(this,e,n)).value=null===(o=e.val)||void 0===o?void 0:o.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r);return t>this.time&&["hidden","visible"].indexOf(n)<0&&(n=this.resolveValue()),n}},{key:"resolveValue",value:function(){return this.value||""}}]),r}(ay);oy([iv()],uy.prototype,"interpolationFrom",null);var ly=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).fn=i.parseFmla(i.val),i}return S(r,[{key:"resolveValue",value:function(e){return this.fn(e,this.math,1)}},{key:"interpolationFrom",value:function(e,t,r){var n=e.resolveValue(r),i=n+(this.resolveValue(r)-n)*t;return e.fmla?e.fmla(r,this.math,i):i}}]),r}(ay);oy([iv()],ly.prototype,"interpolationFrom",null);var cy=function(e){p(r,e);var t=m(r);function r(e,n){var i;return x(this,r),(i=t.call(this,e,n)).value=e.val.value,i}return S(r,[{key:"interpolationFrom",value:function(e,t){return qv(e.resolveValue(),this.value,t)}},{key:"resolveValue",value:function(){return this.value}}]),r}(ay);oy([iv()],cy.prototype,"interpolationFrom",null);var hy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},n.keyFrames=[],n.isColorAnim=!1,n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]))},n.updateVars=function(){var e,t,r,i;(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_h)&&(n.vars.ppt_h=n.timingTarget.ppt_h),(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_w)&&(n.vars.ppt_w=n.timingTarget.ppt_w),(null===(r=n.timingTarget)||void 0===r?void 0:r.ppt_x)&&(n.vars.ppt_x=n.timingTarget.ppt_x),(null===(i=n.timingTarget)||void 0===i?void 0:i.ppt_y)&&(n.vars.ppt_y=n.timingTarget.ppt_y),n.isColorAnim},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=n.keyFrames.findIndex((function(e){return r<=e[0]})),o=n.json.cBhvr.attrList;if(i<0){var a=n.keyFrames[n.keyFrames.length-1];n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],a[1].resolveValue(n.vars))}else{var s=i-1,u=n.keyFrames[i],l=n.keyFrames[s]||u,c=u[0]-l[0]==0?1:(r-l[0])/(u[0]-l[0]),h=u[1].interpolationFrom(l[1],c,n.vars);n.timingTarget&&o&&o[0]&&ty(n.timingTarget,o[0],h)}},n.onSeekToStart=function(){null!==n.startVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&ty(n.timingTarget,n.json.cBhvr.attrList[0],n.createVal)},n.initKeyFrames(),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timelineStart",n.updateVars),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.createVal=ry(n.timingTarget,n.json.cBhvr.attrList[0]),n}return S(r,[{key:"initKeyFrames",value:function(){var e,t=this.json.valueType;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){var r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===t&&this.timingTarget){var n=new ly(r,this.timingTarget);this.keyFrames.push([r.time,n])}}var i={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===t&&this.timingTarget){var o=new ly(i,this.timingTarget);this.keyFrames.push([i.time,o])}}else if(this.json.by){var a={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===t&&this.timingTarget){var s=new ly(a,this.timingTarget);this.keyFrames.push([a.time,s])}var u={time:1,val:{type:"string",value:((null===(e=a.val)||void 0===e?void 0:e.value)||"")+"+"+this.json.by},fmla:""};if("num"===t&&this.timingTarget){var l=new ly(u,this.timingTarget);this.keyFrames.push([u.time,l])}}if(this.json.tavLst.length>0){var c,h=M(this.json.tavLst);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(d.val&&this.timingTarget){var f=null;"string"===d.val.type?"num"===t?f=new ly(d,this.timingTarget):"str"===t&&(f=new uy(d,this.timingTarget)):"number"===d.val.type?f=new sy(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new cy(d,this.timingTarget)):"boolean"===d.val.type&&console.warn("not implements"),f&&this.keyFrames.push([d.time,f])}}}catch(e){h.e(e)}finally{h.f()}}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),dy=function(e){p(r,e);var t=m(r);function r(e,n,i){return x(this,r),t.call(this,e,n,i)}return S(r,[{key:"percent",set:function(e){this.uniforms.percent=e}},{key:"transition",set:function(e){this.uniforms.transition=e}}]),r}($l.k),fy=r(121),py=r.n(fy),vy=r(122),my=r.n(vy),gy=r(123),yy=r.n(gy),_y=r(124),by=r.n(_y),xy=r(9),wy=r.n(xy),Sy=r(125),Ty=r.n(Sy),My=r(126),ky=r.n(My),Ey="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAr5QTFRFAAAATwAAOQAAZgAAKwAAPAAAPQAA7AAA/wAA/QAAugAA5QAAsQAAwQAAsAAAfwAAawAASQAAZAAAOAAAJwAALAAALQAAqQAAiwAAmgAA5AAA7QAAtQAAhQAALwAAfAAAXwAAYQAAigAAuQAAfgAAswAAcgAArQAAqgAAZwAAaQAAMgAAGAAAiAAAjwAA1gAA6QAA+wAA7wAA2AAAbQAA2gAA3QAAuwAA3wAA2QAAxQAA0QAAzwAA0gAAXQAAYAAADAAADwAAGQAALgAAjgAAcAAAzQAAwgAA+gAA3AAAGwAAoAAAowAAcQAAVwAA1QAAIQAAWQAA5wAAsgAAuAAASwAAbwAARwAAMAAAnAAAUQAAaAAA9wAA4gAAPwAAbAAAOwAAlwAA0wAAjQAAvAAAwwAAkwAAQQAAvgAAnwAAvQAA0AAA2wAAwAAAWwAATQAACwAABwAAQgAAtgAAgwAAvwAAgQAAlgAAEAAAxgAAtwAAmAAARgAAjAAAdwAAqwAArwAAywAAYgAACAAAmwAAHwAApQAA8QAAdAAAbgAAFgAAgAAAogAAewAAXgAA6AAA9gAA/AAAzgAA3gAAkgAAngAAdQAARAAAmQAATgAAUgAAJQAAIgAAqAAARQAAPgAAxwAACQAAAgAAMQAAiQAAhwAA4AAAUAAABQAAeQAAygAA9AAAFQAAVQAAyAAANQAA4wAAKAAAWAAAZQAApwAA4QAAyQAAXAAAkQAArAAAdgAApgAAHgAA8gAA/gAA6gAA8wAAFwAAHQAAhgAArgAAnQAANAAASAAA7gAAlQAAJgAA+AAA8AAANwAAJAAAHAAANgAAkAAAKQAAoQAAzAAABgAAFAAATAAAeAAAAQAADgAAggAA6wAAEQAAfQAAVAAA9QAAIAAADQAAEgAAVgAA5gAAQAAABAAA1wAA+QAAUHExBAAAJDlJREFUeJwlevk/lPv7/2XtOrKNsWcbzGCMJSmSpSxJZtQkjPEOg5mxRWns+xpZyr5ECGmcLIOsdVK2oyJbcVI0J8fp/Bff2+d7/+BhPO6Z1+u+ruf1XF4GAEAGZOXkFRQBTiD+dgKVTiqrqKqpq5M0ZMmaWtoAOrp6+qcMDMFIzdiEYmpmbqJBpVlYWtFJitYMG1sbFTskLvvTDmcQHM+ec3ImXp13uYCubvB/l7sHkC9eAk8jcy9Eb5/LvldQzQ+v+jsw1ZAlfwYDAK5dZ98IvIlBwXRNXVYIJ9TpLJUb9j9LvBVOj4jkRVGj/Y1i8AwiH09eEwhjMU4uXtsiAWLlqInMcLh+28okKRnuhNy945lic0+Uqu7NdErDdB/5DBo7MwuE4J+dw8jIzcsvwEIUFFGEisWQm1ACpcZlxF7vl1c8YMCJyqrqGio+fFRbVw8NjU2uec0isNWhVuq2XMPzmjcRBVHhSWCtXaPR2mZoybHzL0TUfmxPabeR6yg/+6QTY83VQNOkSwkbumsgkgzwtKe8tDdHYM7ts3sW1Q/Pn3PEWaGmYjoje+B3ewx9bM4V0LNfDB5XL3/o5v1hSBi5fzvQkQESOkQOwiiwI++5YBdkDjFIrKEx3cZK4Ti8eAlZpjcnYMSHKG0ygKKVeFSLRpOZNL9p19Ku1Q9enKlp45lZiQGr7hlWS17RKWp03mv8481cQnwBUNTAXwIUeAvsJwCCTnV4FyJC9CrKYDnOT91DpRZSG8Bsn7pAw2Ihd7Hn7R0hynXezjQcvQTyMGgUjV12kiW75XaR7Z9OK9kD0/j6ckfyk/fcPHCkvkz48NG/r3p4FeRpoQa9JA74sJAOcLubirEPqXqTpZ1hNzUN5exoNVbk5RmSOQqcJix5yWvvRZZ9nyay+tqAsb6U76oAwo3wgXvJkK6sCpOYQBTIdT6cg92rSxWh16pdV2c8NnDzfQhveqvND4k6aAB0ssWnHuL2yZQ7AHLzJTgUrreyZeWewhawpw1RMDWYHLP1OcNQgKzwlKVP5JV5crB7cZ+NRJ6AB3wx/x3RsEufEkozLu+g7+zkekfLbFQo8byEubp5ld7Ot2CQKxJ7qguZxF4SB3ozQF2pCEIbcaFxg6eAr0/MbeHb1DCK+vQCA3j4YTcwjNiWyEgcq1dRlfnXsq31K3hhhvNX/CYM0JC+asxk91d+7ahTr6AAaTAn3U2lTBfjIc1pr5VEX94yw8uIZhWQVAHQj66iLErxDLqNmN0wuO9hYf6FN+boQb1FjENYJAiWKrru2ejWzoZX6M9A91p2Sw1TTRT/rdDQsyiOT1f6br4fKm6Fpeb9qocNfvYOLPAuczuA5BTbeVT2O/ghlkYEScGHX0Df3StfyMT4iYHCTEQTLj04iWePVx6aomPYGLc08OXB+drJLqoq42/wXqB5eagtaqR+ZAPsymG8utBxt1rO8zFTPHITA50gCMQ4Gw7tQBZFo0DBsWb5ExlyKoBbvRAO7jdv6U8jMYne4Y+iWXmg53gvbNYsGg+gU3elEnaeXB/ufFUKJiyZdNZemo10NviBxr65KE1k/Rijg8KTan5647eoiJQAYPIL+9fuHPb/VSMucg/bcJHzKt557SPRYF8voq1+2SIWmSgQCZo2ZjhlymMigEZdZQ3MzX6wmmMTECwNWieLpWDlKihSZ2sVVwNX9AmecOXtMHP7C/WwPzvKbZqiJIYFZ7PuZngFJmNi9YatOLLQU77vGbS6PzGdsQVn/Ad7nQyALeZVbm01GA72t5bvR/aWTWVIIEVDwDJanzjqAc8QuFl4Yr9/2WTdPVPmHCtY7ZEZ4mJoDqURsbWcaHwtmIqJWrIXshpck5ilsHlYM34YFFXTG3dGzKrDMBxB8gsDn7G3bW/TDpe51ALDmy5KQW8lUgg4guspE7TN7wCTbFWnf7gBB16vuHtYoXsWo14j1cD9/Z+oyj5GF95jqI9KG0s6YtJ0N0jtISrVAZQcIO251QuKrBIaH7k2hLK/Mw8pyNmCnott3tGm6XjT9DsZUps7H8DCHwjc731hFRtTaF2UQ572Ca4Qp/On0RVdmFD0A219YL4DcFBN/lnfBvNr12E0W2MSZatepyNLVIbbFIg7jaYfoR/4W1VUKqL6zsF4NpNiq4orZEhCEjExd7AQ2j+B6GMOPmekeA7+DsM0IAsIqj31xrtAzvWqBsjmIWC6+uBONItM9R+HA8rGHxptX9JAF/G0L6QEiy3McdFEhp4+YNA0FHNwnW0/RFFEtwHRb/hwQsbzX/heYihsB6nNVJssfHnqQe/acYKMv8LqcRe7aEF7Y6ugtWxKLILeNmlzVF277PqxIg8dSxpo5gsaMBFxfgwvdWBhOvzOHHHzx4JUHLNpyc8LUzkLcfiIv3A2jQxpeQ1iL4IKUJ1dTmigtKLpgi6QjX2d8ISbHl1B8bH0UEbnI2DMVm5h4+6Ko+kTd3VVSVPGkpp4/p+BW7/faCjBhlD7MoDqRpcOJxz6lBe8gWYtBP80qaKf86k0FP9L1ziS+Y1m8MPaWpcD8BXkG2flILIvKvoC/hr8upkS1N2pwbQD5NtZmC6iNb2JUVJTRDoZxTXibAjQDp3w/y5Bhld8zynk7OU1S3S3LPnJLvjhzcfUaKeYeJwtkmPDDbYpWt0gTaf8e/gL32vUwV1i7lHVD65CN0n+CySLiHLZfbSx/XYollUUj09xeL/Cjqg2DUp2eM7igsEZPyXlnve63tfjYjZSbBwtUf7mlAhvX0N/CzxFIKE25lol9uEzuf4B95AK6EAVtXBSn3XGA6bVuISAxQuuFKTClSg4xz/VEivy43BYA1UY4x7aSd/i1RMdwdgzi68x0JEYIfLBbEMag6Kcur0R3WGGtXvT2744+WPE4QaWz1rrbq5fEmwQTMwOLPRNs2jAJiPTPpAjXA48lyGNDo/aEnNyEv39YQtTIKcLY2gVw/SWl2eGCgmvgRKcowIU96xWM6PvyJhk/4dRHbP4A2JaG+uq0xb1J15Gaa++VgngHKhh3L3grVzTsa95kyjw3wgZLYViuASK6smRQA8Ds39GAisCnrN+wiGik1BsIZfpFhk9aVvJNr+pUWJbSmxoOAqRzseBsHsCPJ+9EvFA6HLDuymPuB3VbLuUAeRzs5AnmhdV52drj6JdA/9JE6GEWqDZIrYYlrYCDM7hLcefRsAoFiZc4P3tYx5qFsH9ttFzAL0L/lgSwvjbS4Hlik7xGLuSVfejKzFhvtnHF3039B8VGq1UCpg4+cLt0KMDi46N3M5F9YWHiD/InKc21mDdj2pCGZNgqLihu2j14oFnH9dxycOd1FsVBZ+cMEBkuu0U7wwPJEfc9SWATH9MuG0EvfyJPxuf9enmuy3ipIOtB/Tq8fRSfpzQFs03/H+7yBgpxgsOgaPD69B90NfAH5SMhqmB4xns1ARtQlmao4VcBTRTDeuo6wPwzlIp/AQcGagk6KNOsPIQxV8P+wi/EIUDDVLWFGWvjTzIZnkLRH1UoJhWpXMTjPAjt3UAX17p6WGAJwxrWKi26AC0+gNR2jzhlwfEJrgvQCombOyaY8/bLwB9fMvueMLQvWNkBKGC0lq0Ht3KzP5jCcE4StVpESb3tdp2iHeZtLDMQ26rGa6n0GpULC4tIz4jBBxadsL3wHdFQPwahEAq1xR5rwJkcKwXQrx0f6F7awZw4fPbGa1gUiXJVpYOUgng1Il6/kdwHeGfQlS+PdZEZ/WbBBOmQjvC0LG6wpXRfApSSh5UP+GjCtGd2HwGkHtuvHkJDGvpqBlcXLXap5CKR9eJRzlgZ8W4zK891g7/yQl4SpDRz5B6E6FEUxFv8K/4i/p8Hn1DOZxLx2FQHi3X/cwgM0LCK+TZnTMszAMO3JUIXyO6zOQNiThG4OXOrwJNCE8XwV95JJ175KWLydZwJE882VhaOGyWMiSKcP771g4kaYKUFB2Dmz0JUdUk75Pplh8T7VBZwUY90zTpUDwWxIJNQ4p3+oSPgHVcJUQVskdpHklpVCunu2AMvq7HI2HuekbnizilxbZeVzVwQLUBT133fJUvswkKMu+OHgCDmIJX9+b8TDTiXIyTQUrXPXFm5NsIOF7X6snH0GkbLAqxPlJ9ecWoX5Ywy8Vl/GgAlgE21JAfp4T0F8NwItrDq/BXLuXDsET46eLTOOKK5svMyhZ3Ah1ePwHOvYdijiwWbAEJnbIP5V95SOcbXM43qIJm+5G32UABbhvaNNvRffVynh4jmDDQ3V+XtC1dHWnr5PFwd9Ds2UdVaIEHmECBo9V1OAz0w9Q7ZONc7xXtF+8+ETCmmX+G7+2+flmEDTEww2Dr5eQAbJggPltoLQ9vmismCRLQYIvSsXqDWOIS85DgRSlAhWjGdOxACJXNVdyGoSxA1lu2eETiYQrdn23iL9SxSRCa5LgEX0CruBRSxHIQWrdV/mq5qOUyNgs9QUYv+xsmlhwRichkxSqZko2RwH46USV7CUofNLnT23rewuaB+3Y+8g82zzjibgmdChhbQRFk34o/zPECaRHy7wKj5wlFDE8H30Jva81PwVlVT/UNLeH5C/T9cIDrBy3capubs5y2F7ATbAwpRvThn7BsaBvwbu0BBMDxHEtAsSE3DVOdF+kWWcXsfX3AFYeWSbrZP/TS/H80MGryotBYxj1U8rWXomZeevT+aQ0crFNLeulQLpiCr0J3rB5jTS3MR+wbSYRJirC2/5eEGCMHpzOUFWEplMsWaW0SVaCL8y8rZVI4hiy4qyEC7CW0YwNHTGLxvJ2vW6GNMctZQNF8YFxN+y/di6ENOZNtphmlCkIZsU3uvDqzlidm8vQCrkUfzYk6D4AYr6tk+mccy/i8xBKFQzibM/wWTIysZ6cDt/XhySBb1niUMBJRN+ILdWbj7Z6dnUgLZELPYXWeyXNhzV48NvUbAWzWEC0lD8PwVIGTt6rveS3h3gX3XiVRg1O5poRFvgPCL17nEx324dKJT5AC5OU7RFWXuEp0U1v+MRgY7mxikdoB4lle086YyXrr61aA8eVem+VOaY1TKn/sOxOeRhIcR4AZLNrygau7faIG/T/vTPO010Kbci6K9mAYPE3+D/Q/02VDHhOfPxxTud5MF+8KsrdY8Bw4TELjh26cdDiBfCo2ptEyDRsJrRk1KZcvgta3ckuK5CRPn7AxcptUHMpozoAU68b9ElVYL1uhaVz7RTJwRJ15W+0X8HZs7gUMi9wPAEik099Y6ilYhW7j1KNLmlFXlRwAb+NvU+PbN1AfHY1t+/sN4J1JVfn7FDYLloP1Scsg9GA3s2b6XMPgHYNbve6n3ghsmK0WGyzvNrCU7t0veADh7RGOKA7vXwYQc0uuPZMJMUQMLbBdz+2kFzkStJJNFEvH/f/cT1wnXJfsflkfnn+qJe89nGfU5c6Fpsd3vp8y31fD+eHg8uZSYXdwqcoBT9DS0aTRKoaZrdSqk0KtkFZb4+BBqXAnpKdyVLXBuP5clrK5wxSYyIWrghPCaNnLhJkp/A3x8fsMgMczROQeBhpGULvpU+ZNQqKLZQMr2c5uvEvEMHOemnBn5rN1M88Y+/TkhOxUIBP/2P2jr1+oIelfW2KEQFOnrjfGzrGWUsS6YsjIBTxTDwc64bw+fGhfW5AnvnpxLYAJDBm2lJ6rvaNZZMrsfTANYByHtYSbJahyNwhmaepqjdIPb+zS9jVAgfRHPZEjU1Gd3rhA/5cI2/I7HkyV/yE2rhd7VLRC+6h3nRnBwqHqGw2HNB46i9yPFIYrAbBjbP8Xiw3DuyzbyCf9d4TVDRcSKQussrgoejwBiAjYwZi0qcQK8KuYyotDvMBHuWgDgNhVUXyHsaOlkxmK4H0+NoRd5BhMX9v+E0DX3JzZF4fOt9EZhbDdj5dngkuAUBvofWKvSxgvWN/JXhGtuib/SxfY8KRQCXuP9M9m4RKN/YNl9WjkI76xL/vI3tkUW8UwNyBJ97wf3vZkr8zgZWjt09M51pPhhhhIa5n7iOjQUKxcVfAILZl0T4jc7FxaD1109JL9Ca0sSBbrEuNCQcFBiIv+SZSJPYe/1EYItPw54SrCk2fKxMmvjDJ19ORWT937dR9t2yrEWeJCbBTuaVFvARwhlXYkVrmPmMoeHL//5uHAvRj2Y8axOXO33AUsW/qXsBWn9CxkKIYN1C7xCb9tfTfE+3+m+utf4yM6L/i+ic02U8cQ2F98GKWj7KuD2pLDXkPCLCOzaCvJfwOemmSw+9kphfUY4yI+yj5/MmQxX+dJTNMaPNhkZY4Wbc3tEQKBn08wseAkoa6qqIQUIOD3kPmDGdgoM1ToC4KklkiDUBk4Uk/Fidp8zCJcFBMgHj+etTxbRFeHvwhf80CiSt3z3DIFYl6k1lWLVvRBn0lpMVKj6PITC0tar9jbVAPhHP8k4rhblOqCcOdqrAPy67Z1WL4TfMfVx0GLrHQJyH8iQUus8lkFKuv5kcYrNvW13YfKuZ89ORAmC15BmyKxBFilYKq8dxQRWdqGLLb8Rij6WrIs7/mxVyFptbrarK6uDO1v3yxzOWQjtaz2W/01pTvN/Omyfx8D2VGPK80olW8HfnliYW8J7UjIcIlewB+DJW6whrBEqHlPOAQ8W/xs1Hn5GmuasOM+K9M5T9RYI+PMwnvMsCTG6r+dbVXfMESA2YjneGLq0D1CQv4w2JrzNXBsshiH+QHHQa2Mr/AZ4I3FCYwSF30Bqgti3TOnZKmjAfxUANcv/0JqQQ2HHnOhMOwJodHns6/25Jg743Q1lQ+KbmEPuPq51Bt83snYTH17IxKtNv2roT2epeJDTPX4a0X9SZHNHJqSie0RtRDgKb5JGNRAJr4h2aypQVI68DWseD13hXjPfFQtgcpsWw3+bHWbYNMQ5bN4cjo9d8aBirB8/oJdnePZQoxNeCAZZbotwjOCA0wROeUdcuZjnmA4UdjXjcB5b5xb9AZYmwdFSH2DdhvscW5z5QnIMnYTFRngKajbkSdjvvVyWw6LwIJWxlYhshBPGlg4xDUFZOFLf2UlA4MUe8DA8TIea+IX2smNzuP0vmleE8ArQR+UsNqTqekrljgz0+vhX5+FaB5qs3t9J5cPuwScX+MPS/UkluQXNh5WrJFM9p4CGban0P71P43YKxglb2X+cyKQ94h/diX4v9RaCpnBsnLBEiBNo/0idpiYrznuGrJbXrCBGfcS8UOZNOTvW4hnUTwJkuVcBHodNx3R8t5LtTDmf9/EmsNByWOE4XyHplSzut+ilAlOYAW6FAoMlRP17j9CYvp40MImU7d5GfS2Drx+GW3yciuygcSeJPwW0wzd8Jx7iITtZPchNXC6aPAtKQrB2xa8z53r/+NXr2nhyLPFySAhSY0IYOQBgKT6h3kSWUhtwoeuSh11H23xn6OOue1lRwSZFtnWn9cdSaaEGqWp9dYsa7+ChyZcubQzxJjXzXLk9h89vBXfZGDIlvpsP4QIbmPMjqxhqsBfefv19nkI6ATGqFQsHNSKV1bi5RDhNzYOR3Ckunra8gfjADKT/ll0bAtT+Gyj2d7NLfv1oX/s3Dxbwcs6upK916xmn4Cn9qoUPECeybc02KdxfxGRB0zT8l0Zikliu1neuQQ0TmnzytBG1jCdcA7AUAfwLbEnAjIqNRI/tr3AS3HHzaJJ1AVHLTuHM72nkWqYVDDf+j66wmI+h8Lmvxl4OGEXnX3JOrwBz08R7ELtwHigs810rOj0viiWN/+sC7Ni5oBKQ6bZk8eHN3PYLZzQgVjEb5jNex3lMrEC0EzpQ3faNx4xd523exujDDnuf5ZP5S7v7/UuKqkqW2X94NfxXy7549ho3WWi6n1Vt7ABUIeJc5cdqWkRZrf4aNACabeODzxEINKtnW6CGh5734US98i9pjARiQfrdT+ax6iuaQ68hRSbykUQcJUr4DoFBkm4wgd2hq4tBIt5iGqkmIYjIK97X2Ac+y7Al6Eas2r5VF3EkYVixIGsqzlkm0RXA05xqwaznFZjzk8V80Y+iIDhMyNdfSpEMp3IheR2cbKGSnSfWK1HK5rU73te+Y+mp46Jt6oD3xe3/MKUzoD2UBzNmu3iQW2uCJHd2ne9t/x3h7lnn4kBxCEAK//UgVlyjyz9W5JHgDWu3g3OlGHBZO/680MjgZCrLsuOfLU+5jPl2Pxck02uqzyqmPlhPA0isbdnhRis6Qh/S179zV226tq30IMf1KqJ+bHgSCHhjM64dbIL8GGt21vGOEXP+/AJcER6NjIb286TKSzTCCidNp6Zf3rpsWZnG5dNhuEqU94Fd2sYHaDOgM3A3LO9nxQazFRTOJsT7cD4eScDOsG8UfQGqlmCqM7L0/3ZpnWylRSPqBu/B+eHEfYNZO+0QTaWrYVbLURYIK4TWR8iESRGfHHQWgthnGCFSR6XhpDR2Xtq0uhr2QQvOUVv8Giw6ImYIgOdd8OPo1dxm1hQCQV84zTzso6krY75wTfRjcwV5Geb/tJ4owfFd8kC7FDPX9B9mBYVZ0zuK21vYoVpvazdgKlwKfwFKZSgPgFfDQtTRYNOvy6JNZ7OeYCWEFJq/hygT5KPD9mIbenEBsAvHdzCG/K5iPb4S4aP/YhnMDJHIP/icNM6ztIK9gkRRdA71nyoMef+2jb3neklwx0pHH2SIdKb2jwOWG3JCmYK4Iva+7eEG0a3If9Da4KaFAGMYlTTCfFBFSoyK7YMSwyuICgV8M49c7bf4VqtKi5LOaLKCJlVZ5zBpLrIr9LvsMNctO/oiM3ab/MknNJPPbnirNLPbGflQrRr2aJJYXg/QIsh8k1PXzz+z9w5gIxiXea4P0RlO2OUDqhJdvv8EBpRLy6Z9p8GR+FFKgDHcGsMkkbMnJz0q7hAhDVdF3sCfBM6hj2P4SlE5njIsBmSky6FhkNYd2UfgLt37a35+BEvupCA+Jh5kmC5dWaGeQNmz35EEQvhwZG3qxKo/RZr66hM7IJ5Won7gh78anK172Zt3buKAMKyMDjzdR9ufcCZ0zU4DOA5RKIgkAMTbytB3LQFlT5MH/An6qfRJPjj2dg5WFP3mdlZkwFePrA+3eN2Wu0A+WAFKZrztzJRibcqCweEddxU/PSGWxOnjHtOUDzfDk9lEvDDj39cFH1E9dVeQLGVI3Qgeo0M34dZ6K/3cb9BBZcZf8uS+BivagqBuLW31L60FMADuX1jiTur3n1ZrBrIgpkFO//0OmyT9qWthHcnwzLRswTdDbgUflRNCAvfaODDSX8vQLo7QBDltK42Y/OdFbS1zUYFLv6qSiV43zDiUrcAtbEqoMVBPa37+RMTuT1gmrJVH1qqYsi12cyakNWPLrTGqg9NO1KY2vPwISkCnxobu6FodJWlXUwABhb1LwveepTps6Tt0E8j+tabfLiI+MdLLWSxLqA1cJON1hz8aZkisUWXUMhNOQpLrIR062CCV3Bg0ZwlU9OhbKefT1NjDog/g2q+TAW89zQllayE0d/y9qAdSAucb3iKOXZYzSSmdealQNS1IL3qMUpowYU6uuO7LEqyPD05MgXvXy6frzzrkpBXlAx+J30gur7J4OT/ziwA3fvIcKvLAHet4sqms0BCkZk6CKbyRPu8Xqwsv5KGfYcI4thniGI9nFwFwt1bfZm9racBom20+/R8n0upa1EAueM5b9A7lN3BE9empZqOTj5NkKNeCf630MV2jeKeEP8cImJ5W9l3gYGDg1wPxxZcmBvsZ4qZXUMim6a/M2jKAsHtYvPN1A0FsH3AAbpFvCxA200RpdN9ME2nSQL2g5pg9OIw6KkYT3gKe7QmWrItoXK1c/XBbJQ6pVOca2BzfQfoOCTygsFljpEPDG+tBLrte+jUDP2DcYKLisBjhgtTZnAmgmg8/Aus/awVIZGqScBZ1xa/82qG7rzT0BDLldEs0sP5HS8oNhU3lhDue5NS0TUt0T7YTZvSGH0HEYEs97dJ7xpNO1TKokYmLWenco4PvNEsv2hQ85pcgDjlA29jwVT9IoAcXQGCnhPG8fgYyhJ64NNzBiWf5p1XdoBx+xtXoPiVbK44FcHipEqTaar9/ruKsdneZuJmevOHPOjhmtvwVVX8Nmx+/eftj7gZmxlF3ocI/n5T0byPxzPfMi24AxSQeAGjdI3Q4hc5ffAT7v7F89ZNEgj6fheuHl2hjRQlG4EMMwpiAnsm1HT499a+zKPMejH0uAfnT4JyItDTiDQ4l5DoO/sQZ0HkzGpiM8KQNwaHk0Un9WaO+yuA1ZTV9z8Jm13bqwTlfNHncIi8M/kHQMFhMF7Imo2mUw/Sox7Bh3W6UplqvEiy+g2NvVzFPCtGkHSTLuFSL2CtGzpPY+E5O0PK3HSbUnBzNBZodkNnUAlch2Zk9/9F8JuAYBirgoVpE7QyheJ33WDOysDFYMSXBdm20XfXCWcGzsGyvXE8FJN7EadsGjIDzZ+GtIUEBWuQ6o87kaDvo4eplYs4dz6P06lSSCA0yAvpXKD1djjC8dnWdYtWsLpl4Fplhje74Y6i/M7VMSQnRvD54/CC4LPzx4vghhIOzVo6bLzl7QIHPvVyM/drqBBZ3tW1lYqvXfauRfH5WHe+RcHI+xxeqDECqJ9tdXLyy9L7RqxyUaZKwmlAux+zEzdzITSRlr36YuSm0LBhTpkivodWytR6BNULFxftqF42QqKLmoog9WlYNRb4GtNm93bHuxBvV5VcOUeY6N/9xDutwbqYhaN3rIzpg1M6XfrYctTdA5Msr2v4Aydmb+Nl2/Eqw+jSXYvctmuDHYUAei0pUc6E5N1bULPEjHAr+HI3gwDjpDg0nE2fMkXneCumq9ifZR5IKUOqn0aDIfN64olrhaHfV4msozkdG/3j5HHqsf5Els8kwvDrCaK4/BXb+YzYC00mJEOu8njPsKgB9dG+FjqqeToCsJKLTvHS+iQTnqFquCJ+yCckuDaHLnP4GzroGg7BelrYZWStEFay3j+vkEuXHy3B2zG5xBqSx+/pxoEOv+OfiCfq5QMCCNq26xXC+1DZ+eQdH2jJ9FXSh9yrISZTk56jTzMIzG9+Ye+pumQffxmh2lcvPXjmNWL3PoOgRpkx4o/TZzE2y3IMtEZNxpNUlBqFlnBVXuPS0TIBkF+ZfvW3y2bGWD14zb8Cju5+wiSW1pIIRRtD0DeaxOLIvup5BZ2R2QfQVx6ryHH4H/rls/fRJy6KIdsJ/qVsWrBZaKgKOhP0GOUjA16wS+vlpcmot72SIWJWQDwyiD04TLSU6LyObtnOC2W5QA0OCGXHtlTi9Cyh95AIL8UU6AaQOaDSDfuf3DbxO4065WUdqPZ6Zj9S26jGlhDs/3mX1c4h+to5J2UwvgO3dkFtmKMBF3OuQvskMsOO8R5FnXblT4zMUpkjhs3m1ygag6zQWKfFOQCFM8jmAFtaCpCqDX77xqhE3B99uGU3UT+41SufAp9fQENvgk5lwqneywazIE9IpGT8v23sBPibAHG34mLWiivxnjk8p2S5ofshihnLQd4CU5ABpVcMX/5Hg39Jm55k+hgxugBCGIR5KmY+qz6US5/wKYimBbjTOSBlyD9OiYpWxtoLH6PcoaUdK0dW4vKR121dfMwumvgSBf8g0fsVN0w8jbplh7Df1FVC9wZuTbZStSswGJu6IngHRvBgOFag8F3hwPVNuUYjxNngNURuMvnnOvway+3l+1sK7aILbzdSzAxUCtG9/CaaHsBFIVzMWEH7upNL6Hr6P+oI4i+VqT6NyQrYUMkRXYd2P1ZjEMDaJ1rrurxTBgTfMw9cZe8SHIAz0JA7jpgDmr+InVbg0HrkFNZVhQ2uBKn75tLEZwfMp2azBhkglsAXDPx2BccwTDGmnsjRDh2jHh9ynTQY4vLqcuv/NWRlP8sFHWyxSmm38ikF1UoTywoZL0oFE4I4ujqIcvCuo+0ABPohIMdyq8EqgTcogXcYNCGdgvytDCA/fwt2eG78+OAANOgmKkOI8WdjE3FaFdqW6rx/oOBunJoqMLOwnPtv67Cw7PY8c4jFvek2G/hk1Thivu5Pf2iV8YDA8DyziBPz6MKlF9XQlRt7ZRV09nZrygwo00ME7IpFuOiEsUrd14UcCvNC/DPkbFmqB1uQIg477mFiq2niVADUYnvdjiQPNpFfMTo4yg4X+tDW3rmH2WE9E2rY0ES40wM6QRwaQL5/fepJULkj3Zc6L1ItuWmO6zXbvou399GBCPcQwB2+rRpubsw03qWL2iRyHH9Afl/YHuFYa8v7zEXDEigXJo9RAtTM4BTzElQhSgePv55AmHTo4W9v4SmkPDlLIhOpcXBK4GO2AnyzeN0MaKP7umX9bZAfc5LA84bxj3frYCxezbP9KG7QeJzevIhiAU4p/j+y2OyMV2mxNgAAAABJRU5ErkJggg==",Iy=r(127),Ay=r.n(Iy),Cy=r(128),Py=r.n(Cy),Ny=r(129),Oy=r.n(Ny),Ry=r(130),Dy=r.n(Ry),Ly=r(131),jy=r.n(Ly),zy=r(132),By=r.n(zy),Uy=r(133),Fy=r.n(Uy),Wy=r(134),Gy=r.n(Wy),Vy=r(135),Hy=r.n(Vy),Yy={wipe:function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r);var i=1;return"up"===e?i=1:"down"===e?i=2:"left"===e?i=3:"right"===e&&(i=4),(n=t.call(this,my.a,py.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,n}return r}(dy),fade:function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r);var i=1;return"out"===e?i=-1:"in"===e&&(i=1),(n=t.call(this,void 0,yy.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),n}return r}(dy),blinds:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,by.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n}return r}(dy),checkerboard:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Ty.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,n}return r}(dy),dissolve:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,ky.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),randombar:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Ay.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,n.setTextTure(),n}return S(r,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=$l.t.from(Ey)}}]),r}(dy),circle:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Py.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),box:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Oy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),diamond:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Dy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),plus:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,jy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,n}return r}(dy),barn:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,By.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="inHorizontal"===e?1:"outHorizontal"===e?2:"outVertical"===e?3:0,n}return r}(dy),strips:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Fy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="upLeft"===e?1:"downRight"===e?2:"upRight"===e?3:0,n}return r}(dy),wedge:function(e){p(r,e);var t=m(r);function r(e){return x(this,r),t.call(this,wy.a,Gy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return r}(dy),wheel:function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,wy.a,Hy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,n}return r}(dy)},$y=function(e){p(r,e);var t=m(r);function r(e){var n,i;x(this,r),(n=t.call(this,e)).filterType="",n.isConflict=!1,n.activeWhenConflict="prev",n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r;if(n.filter){n.filter.percent=n.commonTimeNode.applyTimeFilter(i);var o=null===(t=n.timingTarget)||void 0===t?void 0:t.container.getBounds();o&&(n.filter.uniforms.uBoundRect=new Float32Array([o.x,o.y,o.width,o.height]))}i>=1&&n.timingTarget&&n.ctx.clock.setTimeout((function(){n.removeFilter()}),34)},n.onSeekToStart=function(){n.timingTarget&&n.removeFilter()},n.onSeekToEnd=function(){n.timingTarget&&n.removeFilter()},n.onDestroy=function(){n.removeFilter()},n.commonTimeNode.on("timelineStart",(function(){n.filter&&n.timingTarget&&(n.timingTarget.container.filters&&0!==n.timingTarget.container.filters.length?n.timingTarget.container.filters.push(n.filter):n.timingTarget.container.filters=[n.filter])})),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate);var o=1;"out"===e.json.transition&&(o=-1);var a=null===(i=e.json.filter)||void 0===i?void 0:i.match(/^([a-zA-Z]+)(\((.+)\))?/);if(a){var s=a[1],u=a[3];Yy[s]&&(n.filter=new Yy[s](u),n.filterType="".concat(s,"-").concat(u),n.filter&&(n.filter.transition=o))}return n}return S(r,[{key:"removeFilter",value:function(){var e,t=this;if((null===(e=this.timingTarget)||void 0===e?void 0:e.container.filters)&&this.filter){var r=this.timingTarget.container.filters.findIndex((function(e){return e===t.filter}));r>=0&&this.timingTarget.container.filters.splice(r,1)}}},{key:"modifyAttrKey",get:function(){return this.filterType}}]),r}(ny),Xy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startPos=null,n.onTimeNodeStart=function(){var e,t;n.startPos={x:(null===(e=n.timingTarget)||void 0===e?void 0:e.ppt_x)||0,y:(null===(t=n.timingTarget)||void 0===t?void 0:t.ppt_y)||0}},n.onTimeUpdate=function(e){var t,r=e.duration,i=e.delta/r,o=null===(t=n.path)||void 0===t?void 0:t.getPoint(i);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+ +n.timingTarget.design_ppt_y)},n.onSeekToStart=function(){n.timingTarget&&n.startPos&&(n.timingTarget.ppt_x=n.startPos.x,n.timingTarget.ppt_y=n.startPos.y)},n.onSeekToEnd=function(){var e,t,r,i=null!==(t=null===(e=n.commonTimeNode.json)||void 0===e?void 0:e.spd)&&void 0!==t?t:1,o=null===(r=n.path)||void 0===r?void 0:r.getPoint(i>0?1:0);n.timingTarget&&o&&(n.timingTarget.ppt_x=o.x+n.timingTarget.design_ppt_x,n.timingTarget.ppt_y=o.y+n.timingTarget.design_ppt_y)},n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n.createPath(),n}return S(r,[{key:"createPath",value:function(){var e,t,r=new os,n=null===(e=this.json.path)||void 0===e?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(n){var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=a)||s(t)||k(t)||h(),l=u[0],f=u.slice(1);if("M"===l){var p=c(f.map((function(e){return Number(e)})),2),v=p[0],m=p[1];r.moveTo(v,m)}else if("L"===l){var g=c(f.map((function(e){return Number(e)})),2),y=g[0],_=g[1];r.lineTo(y,_)}else if("C"===l){var b=c(f.map((function(e){return Number(e)})),6),x=b[0],w=b[1],S=b[2],T=b[3],E=b[4],I=b[5];r.bezierCurveTo(x,w,S,T,E,I)}else if("Z"===l)r.closePath();else if("E"===l)console.warn("not implements");else if("c"===l){var A=c(f.map((function(e){return Number(e)})),6),C=A[0],P=A[1],N=A[2],O=A[3],R=A[4],D=A[5],L=r.currentPoint;r.bezierCurveTo(C+L.x,P+L.y,N+L.x,O+L.y,R+L.x,D+L.y)}else if("l"===l){var j=r.currentPoint,z=c(f.map((function(e){return Number(e)})),2),B=z[0],U=z[1];r.lineTo(B+j.x,U+j.y)}else if("m"===l){var F=r.currentPoint,W=c(f.map((function(e){return Number(e)})),2),G=W[0],V=W[1];r.moveTo(G+F.x,V+F.y)}}}catch(e){o.e(e)}finally{o.f()}}this.path=r}},{key:"modifyAttrKey",get:function(){return"motion"}}]),r}(ny),qy=function(e){p(r,e);var t=m(r);function r(e){var n,i;return x(this,r),(n=t.call(this,e)).isConflict=!0,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.onTimelineStart=function(e){e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t,r,i,o,a,s=e.duration,u=e.delta/s,l={x:1,y:1};if(n.to){var c=null!==(t=n.from)&&void 0!==t?t:{x:null!==(i=null===(r=n.startVal)||void 0===r?void 0:r.x)&&void 0!==i?i:1,y:null!==(a=null===(o=n.startVal)||void 0===o?void 0:o.y)&&void 0!==a?a:1};l.x=c.x+(n.to.x-c.x)*u,l.y=c.y+(n.to.y-c.y)*u}else if(n.by){var h={x:n.by.x,y:n.by.y};l.x=1+(h.x-1)*u,l.y=1+(h.y-1)*u}n.timingTarget&&(n.timingTarget.scale=l)},n.onTimeNodeStart=function(){n.timingTarget&&(n.startVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y})},n.onSeekToStart=function(){n.timingTarget&&n.startVal&&(n.timingTarget.scale=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){null!==n.createVal&&n.timingTarget&&(n.timingTarget.scale=n.createVal)},n.from=e.json.from,n.to=e.json.to,n.by=e.json.by,n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),(null===(i=n.timingTarget)||void 0===i?void 0:i.scale.x)&&(n.createVal={x:n.timingTarget.scale.x,y:n.timingTarget.scale.y}),n}return S(r,[{key:"updateCurrentValue",value:function(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}},{key:"modifyAttrKey",get:function(){return"scale"}}]),r}(ny),Qy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isTimelineStart=!1,n.startColorString=null,n.currentColorString="#FFFFFFFF",n.onTimelineStart=function(e){if(!n.isTimelineStart){n.isTimelineStart=!0,e.isReverse||n.updateCurrentValue(),n.from.isInit()||n.from.fromHexString(n.currentColorString),n.to.isInit()||n.from.by(n.by,n.to);var t=c(n.json.cBhvr.attrList[0].split("."),1)[0];ty(n.timingTarget,t+".on","true")}},n.onTimeNodeEnd=function(){var e=n.json.cBhvr.attrList[0];if("remove"===n.json.cBhvr.ctn.fill){var t=c(e.split("."),1)[0];ty(n.timingTarget,t+".on","false")}n.isTimelineStart=!1},n.onSeekToStart=function(){var e,t=n.json.cBhvr.attrList[0];if(n.timingTarget){n.onTimeUpdate({duration:1,delta:0});var r="ppt_c.color"===t||"text.color"===t;if((null===(e=n.timingTarget.fill)||void 0===e?void 0:e.designColor.toUpperCase())===n.from.toHexString().toUpperCase()||r){var i=c(t.split("."),1)[0];ty(n.timingTarget,i+".on","false")}}},n.onTimeNodeStart=function(){if(n.timingTarget){var e=n.json.cBhvr.attrList[0],t=ry(n.timingTarget,e);t&&(n.startColorString=t)}},n.onTimeUpdate=function(e){var t=e.delta/e.duration;if(n.to.interpolationFrom(n.from,t,n.target),n.timingTarget){var r=n.json.cBhvr.attrList[0];ty(n.timingTarget,r,n.target.toHexString())}},n.onSeekToEnd=function(){n.isTimelineStart||n.onTimelineStart({isReverse:!1,activeCount:0,id:""}),n.onTimeUpdate({duration:1,delta:1})},n.replaceAttrToRelation(),"rgb"===n.json.clrSpc?(n.from=new Hv(n.json.from),n.to=new Hv(n.json.to),n.by=new Hv(n.json.by),n.target=new Hv):(n.from=new Vv(n.json.from),n.to=new Vv(n.json.to),n.by=new Vv(n.json.by),n.target=new Vv),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeNodeEnd",n.onTimeNodeEnd),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onSeekToStart),n}return S(r,[{key:"replaceAttrToRelation",value:function(){var e=this.json.cBhvr.attrList[0];"ppt_c"!==e?"style.color"===e&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}},{key:"updateCurrentValue",value:function(){if(this.timingTarget){var e=this.json.cBhvr.attrList[0],t=ry(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),r}(ny),Zy=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.startVal=null,n.createVal=null,n.lastVal=null,n.onTimelineStart=function(e){n.lastVal=null,e.isReverse||n.updateCurrentValue()},n.onTimeUpdate=function(e){var t=e.duration,r=e.delta/t,i=0;if(void 0!==n.from&&void 0!==n.to){var o=(i=n.from)+(n.to-i)*r;n.timingTarget&&(n.timingTarget.r=o)}else if(void 0!==n.by){n.lastVal||(n.lastVal=0);var a=n.by*r-n.lastVal;n.lastVal=n.by*r,n.timingTarget&&(n.timingTarget.r+=a)}},n.onTimeNodeCreate=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.createVal=n.timingTarget.r)},n.onTimeNodeStart=function(){var e;Sv()(null===(e=n.timingTarget)||void 0===e?void 0:e.r)&&(n.startVal=n.timingTarget.r)},n.onSeekToStart=function(){n.timingTarget&&null!==n.startVal&&(n.timingTarget.r=n.startVal)},n.onSeekToEnd=function(){n.onTimeUpdate({duration:1,delta:1,isReverse:!1})},n.onDestroy=function(){n.timingTarget&&null!==n.createVal&&(n.timingTarget.r=n.createVal),n.startVal=null},n.from=n.json.from,n.to=n.json.to,n.by=n.json.by,n.by?n.isConflict=!1:n.isConflict=!0,n.onTimeNodeCreate(),n.commonTimeNode.on("timeNodeStart",n.onTimeNodeStart),n.commonTimeNode.on("timeNodeCreate",n.onTimeNodeStart),n.commonTimeNode.on("timelineStart",n.onTimelineStart),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("timeNodeDestroy",n.onDestroy),n}return S(r,[{key:"updateCurrentValue",value:function(){var e;this.currentVal=null===(e=this.timingTarget)||void 0===e?void 0:e.r}},{key:"modifyAttrKey",get:function(){return"rotate"}}]),r}(ny),Ky=function(e){p(r,e);var t=m(r);function r(e){var n;return x(this,r),(n=t.call(this,e)).isConflict=!1,n.activeWhenConflict="next",n.isApplied=!1,n.onTimeUpdate=function(){var e,t,r=n.json,i=r.cmd,o=r.cmdType;!n.isApplied&&i&&o&&(n.isApplied=!0,null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand(i,o),n.commonTimeNode.seekToEnd(!1))},n.onSeekToStart=function(){var e,t;n.commonTimeNode.isInInteractiveSeq||null===(t=null===(e=n.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand("custom-pause","call")},n.onSeekToEnd=function(){},n.commonTimeNode.on("timeNodeStart",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeNodeEnd",(function(){n.isApplied=!1})),n.commonTimeNode.on("timeUpdate",n.onTimeUpdate),n.commonTimeNode.on("seekToStart",n.onSeekToStart),n.commonTimeNode.on("seekToEnd",n.onSeekToEnd),n}return S(r,[{key:"modifyAttrKey",get:function(){var e,t,r,n;return(null!==(t=null===(e=this.json)||void 0===e?void 0:e.cmd)&&void 0!==t?t:"")+(null!==(n=null===(r=this.json)||void 0===r?void 0:r.cmdType)&&void 0!==n?n:"")}}]),r}(ny),Jy=function e(t){var r=this;x(this,e),this.runtimeNodeEventHub=new Ks.a,this.onVolumeUpdate=function(e){r.audio.volume(e)},this.stopAudio=function(){r.audio.stop()},this.destroy=function(){r.stopAudio(),r.audio.destroy(),r.ctx.activeMedia.delete(r.audio),r.ctx.volumeAdjuster.off("update",r.onVolumeUpdate)};var n=t.json,i=t.isIterate,o=t.isSub,a=t.eventHub,s=t.ctx,u=t.parent,l=t.iterateType,c=t.iterateIndex,h=t.iterateId,d=t.isInInteractiveSeq,f=t.fromSeqId;this.json=n,this.id=n.cMediaNode.ctn.id,this.commonTimeNode=new t_({json:n.cMediaNode.ctn,isSub:o,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:s,parent:u,isIterate:i,iterateType:l,iterateIndex:c,iterateId:h,isInInteractiveSeq:d,fromSeqId:f});var p=n.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info("redirect media url from ".concat(n.cMediaNode.tgtEl," to ").concat(p," by delegate."),s.taskId)),this.audio=new Hg(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",(function(){r.audio.volume(s.volumeAdjuster.volume),r.audio.play()})),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)};function e_(e){return(null===(t=e)||void 0===t?void 0:t.cBhvr)?e.cBhvr.ctn:function(e){var t,r;return!!(null===(r=null===(t=e)||void 0===t?void 0:t.cMediaNode)||void 0===r?void 0:r.ctn)}(e)?e.cMediaNode.ctn:e.ctn;var t}var t_=function(e){p(r,e);var t=m(r);function r(e){var n,i,o;x(this,r),(n=t.call(this)).uuid=uv(),n.isSub=!1,n.isShadow=!1,n.startCount=0,n.applyCount=0,n.isReverse=!1,n.isConflictDispose=!1,n.isIterateEnd=!1,n.parentTimeNode=null,n.isActive=!1,n.isDestroy=!1,n.shouldSeekOnStart=!1,n.repeatTimeoutId="",n.iterateShadows=[],n.isEndEventsEmitted=!1,n.tmFilter=[],n.timeDelta=0,n.isIterate=!1,n.iterateType="el",n.iterateIndex=0,n.children=[],n.subList=[],n.duration=0,n.isNegativeSpeed=!1,n.handleEndCond=function(){n.isActive&&(n.isActive=!1,n.isInfiniteRepeat()?n.repeatTimeNodeEnd():n.seekToEnd(!1,!0))},n.handleActive=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(n.isActive=!0,n.isConflictDispose=!1,n.applyCount+=1,n.json.iterate||n.emit("timeNodeStart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startCount>0&&n.json.restart){if("never"===n.json.restart)return;"whenNotActive"!==n.json.restart&&"always"!==n.json.restart||(n.seekToStart(),n.emit("timeNodeRestart",{id:n.uuid,activeCount:n.applyCount,isReverse:n.isReverse}),n.startTimeLine(e))}else n.startTimeLine(e)},n.updateTimeLine=function(e){var t=e/(rd.b.TARGET_FPMS||.06);n.timeDelta+=t,n.duration-n.timeDelta<=t&&(n.timeDelta=n.duration),n.timeDelta0&&void 0!==arguments[0]&&arguments[0];(n.isTimeNodeEnd()||e)&&(n.isActive=!1,n.isSub&&n.destroy(),n.emitEndEvents())};var a=e.isSub,s=e.isIterate,u=e.ctx,l=e.eventHubs,c=e.parent,h=e.json,d=e.iterateType,f=e.iterateId,p=e.iterateIndex,v=e.isInInteractiveSeq,m=e.fromSeqId;n.isSub=a,n.fromSeqId=m,n.isInInteractiveSeq=v,n.isIterate=s,n.parentTimeNode=c,n.json=h,n.ctx=u,n.iterateIndex=p,n.eventHubs=l,n.iterateType=d,n.iterateId=f,n.tmFilter=null!==(o=null===(i=h.tmFilter)||void 0===i?void 0:i.split(";").map((function(e){return e.split(",").map((function(e){return parseFloat(e.trim())}))})))&&void 0!==o?o:[];var g=Number(n.json.dur),y=n.json.spd||1;if(n.isNegativeSpeed=y<0,Number.isNaN(g)||(n.duration=g/Math.abs(y)),n.uuid+="--"+n.json.id,n.setPreStyle(),h.childTnLst&&n.createChildren(h.childTnLst),n.startConds=new Jg(n.json.id||"",h.stCondLst,l,n.ctx),n.endConds=new Jg(n.json.id||"",h.endCondLst,l,n.ctx),h.endSync&&(n.endSync=new Jg(n.json.id||"",[h.endSync],l,n.ctx),n.endSync.on("active",(function(){var e;"interactiveSeq"===n.json.nodeType&&(n.isActive=!1,n.shouldSeekOnStart=!0,n.emit("timeNodeEndSync"),null===(e=n.endSync)||void 0===e||e.reset())}))),n.startConds.on("active",(function(e){n.isActive||(n.shouldSeekOnStart&&(n.shouldSeekOnStart=!1,n.seekToStart()),n.handleActive(e))})),n.endConds.on("active",(function(){n.handleEndCond(),n.children.forEach((function(e){return e.commonTimeNode.handleEndCond()}))})),n.parentTimeNode&&n.parentTimeNode.on("timeNodeStart",(function(){n.applyCount=0})),n.isSub&&"nextClick"===n.json.masterRel){var _="shape slide onNext"+n.fromSeqId;n.startConds.addCond({event:_})}return n.json.iterate&&!1===n.isIterate&&n.createIterateShadow(),n}return S(r,[{key:"createIterateShadow",value:function(){var e=this,t=uv(),n=!0,i=0;for(this.ctx.eventHub.on("IterateTimeNodeEnd",(function r(i){i===t&&(n=!1,e.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))}));n;){var o=JSON.parse(JSON.stringify(this.json)),a=new r({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[i]=a,i+=1}}},{key:"isInfiniteRepeat",value:function(){return this.json.repeatCount>999999998}},{key:"getReverse",value:function(){return this.isReverse}},{key:"setReverse",value:function(e){this.isReverse=e}},{key:"createTimeNode",value:function(e,t){var r=null,n={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return"seq"===e.type?r=new ey(n):"par"===e.type?r=new r_(n):"set"===e.type?r=new iy(n):"anim"===e.type?r=new hy(n):"animEffect"===e.type?r=new $y(n):"animMotion"===e.type?r=new Xy(n):"animScale"===e.type?r=new qy(n):"animClr"===e.type?r=new Qy(n):"animRot"===e.type?r=new Zy(n):"cmd"===e.type?r=new Ky(n):"audio"===e.type&&(r=new Jy(n)),r}},{key:"createSubList",value:function(e){var t=this;this.subList&&this.subList.forEach((function(e){return e.commonTimeNode.destroy()})),this.subList=[],e.forEach((function(e){var r=t.createTimeNode(e,!0);r&&t.subList.push(r)}))}},{key:"bindCommonTimeNodeEvent",value:function(e){var t=this;e.commonTimeNode.on("timeNodeStart",(function(e){t.emit("childTimeNodeStart",e)})),e.commonTimeNode.on("timeNodeEnd",(function(e){t.emit("childTimeNodeEnd",e),t.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))&&(t.json.iterate||t.allChildrenEndHandle())}))}},{key:"createChildren",value:function(e){var t=this;function r(e){return e_(e).presetOrder}function n(e){return/^slide/.test(e)?"slide":/^layout/.test(e)?"layout":/^master/.test(e)?"master":"unknow"}var i=["master","layout","slide","unknow"];e&&e[0]&&r(e[0])?a(e).sort((function(e,t){var o,a,s,u,l=e_(e).id,c=e_(t).id;if(l&&c){var h=n(l),d=n(c);return h===d?(null!==(o=r(e))&&void 0!==o?o:0)-(null!==(a=r(t))&&void 0!==a?a:0):i.indexOf(h)-i.indexOf(d)}return(null!==(s=r(e))&&void 0!==s?s:0)-(null!==(u=r(t))&&void 0!==u?u:0)})).forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))})):e.forEach((function(e){var r=t.createTimeNode(e,!1);r&&(t.bindCommonTimeNodeEvent(r),t.children.push(r))}))}},{key:"playReverse",value:function(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach((function(e){return e.commonTimeNode.playReverse()}))}},{key:"allChildrenEndHandle",value:function(){var e=this;if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout((function(){e.seekToStart(!1),e.resetForRepeat(),e.startTimeNodeRepeat()})):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}},{key:"resetForRepeat",value:function(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach((function(e){return e.commonTimeNode.resetForRepeat()}))}},{key:"startSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.startTimeNode()}))}},{key:"startReverseTimeLine",value:function(){this.isEndEventsEmitted=!1,this.timeDelta=0;var e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(__.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(__.animateStart),this.ctx.ticker.add(this.updateTimeLine))}},{key:"startTimeLine",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit("time ".concat(this.json.id," begin")),this.eventHubs.global.emit("time ".concat(this.json.id," onBegin")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," begin"))),this.json.iterate)this.startIterate();else{this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});var r=1e3/this.ctx.ticker.maxFPS;this.duration<=r&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce((function(){e.onTimeLineEnd()}))):this.duration>r&&(this.ctx.eventHub.emit(__.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}}},{key:"startIterate",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.json.iterate){e.next=24;break}this.isIterateEnd=!1,t=M(this.iterateShadows),e.prev=3,t.s();case 5:if((r=t.n()).done){e.next=15;break}if(n=r.value,!this.isIterateEnd){e.next=9;break}return e.abrupt("break",15);case 9:return n.children.forEach((function(e){e.commonTimeNode.startTimeNode()})),n.applyCount+=1,e.next=13,this.ctx.clock.delay(this.json.iterate.interval);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),t.e(e.t0);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.onTimeLineEnd();case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])})))}},{key:"applyTimeFilter",value:function(e){if(!this.tmFilter.every((function(e){return Sv()(e[0])&&Sv()(e[1])})))return e;for(var t=0;t0?this.tmFilter[this.tmFilter.length-1][1]:e}},{key:"isNatureTimeEnd",value:function(){return this.duration>=0&&this.timeDelta>=this.duration}},{key:"findTargets",value:function(){var e=[];return function t(r){r.forEach((function(r){var n,i,o;r.cBhvr&&r.cBhvr.target&&e.findIndex((function(e){return e.id===r.cBhvr.target.id}))<0&&e.push(r.cBhvr.target),(null===(i=null===(n=null==r?void 0:r.cBhvr)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&t(r.cBhvr.ctn.childTnLst),(null===(o=null==r?void 0:r.ctn)||void 0===o?void 0:o.childTnLst)&&r.ctn.childTnLst.length>0&&t(r.ctn.childTnLst)}))}(this.json.childTnLst||[]),e}},{key:"setPreStyle",value:function(){var e=this;this.json.presetClass&&this.findTargets().forEach((function(t){if(e.json.iterate)for(var r=0,n=!0;n;){var i=e.ctx.timingTargets.getTarget(t,!0,{type:e.json.iterate.type,index:r,id:""});i&&(e.setPreStyleForTarget(i),r+=1),n=!!i}else{var o=e.ctx.timingTargets.getTarget(t,!1);o&&e.setPreStyleForTarget(o)}}))}},{key:"setPreStyleForTarget",value:function(e){var t,r;if(e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset)if("entr"===this.json.presetClass){var n=null===(r=null===(t=this.json)||void 0===t?void 0:t.childTnLst)||void 0===r?void 0:r.filter((function(e){return"set"===e.type&&"visible"===e.to}));(null==n?void 0:n.length)&&(e.hasPreset=!0,e.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass||"emph"===this.json.presetClass)&&(e.hasPreset=!0,e.style.visibility="visible")}},{key:"startTimeNodeRepeat",value:function(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}},{key:"startTimeNodeForce",value:function(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}},{key:"startTimeNode",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.isDestroy){this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);var t=this.json.stCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];t&&this.startConds.condHandle(t);var r=this.json.endCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];r&&this.endConds.condHandle(r),this.startConds.condHandle()}}},{key:"onTimeLineEnd",value:function(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}},{key:"clearSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.destroy()}))}},{key:"seekToStart",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(t){return t.seekToStart(e)}));if(e)for(var t=this.subList.length-1;t>=0;t--){var r=this.subList[t];null==r||r.commonTimeNode.seekToStart()}for(var n=this.children.length-1;n>=0;n--){var i=this.children[n];null==i||i.commonTimeNode.seekToStart()}if(this.children.length>1)for(var o=this.children.length-1;o>=0;o--){var a=this.children[o];null==a||a.commonTimeNode.seekToStart()}}},{key:"repeatTimeNodeEnd",value:function(){this.dispose(),this.children.forEach((function(e){e.commonTimeNode.isActive=!1,e.commonTimeNode.dispose()}))}},{key:"dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isConflictDispose=e,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(__.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(e){}this.startConds.reset(),this.endConds.reset()}},{key:"seekToEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isInfiniteRepeat()){!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();var r=this.json.autoRev||e;if(r?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(e){return e.seekToEnd(r,t)}));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach((function(e){return e.commonTimeNode.seekToEnd(r,t)})),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach((function(e){return e.commonTimeNode.seekToEnd(!1)})),this.clearSubList())}}},{key:"isTimeNodeEndWhenDetectEndSync",value:function(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"isTimeNodeEnd",value:function(){var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEnd()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"emitEndEvents",value:function(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit("time ".concat(this.json.id," end")),this.eventHubs.global.emit("time ".concat(this.json.id," onEnd")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," end")),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}},{key:"collectStartValue",value:function(){this.emit("timeNodeCreate"),this.children.forEach((function(e){return e.commonTimeNode.collectStartValue()}))}},{key:"destroy",value:function(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach((function(e){return e.commonTimeNode.destroy()})),this.clearSubList()}}]),r}(Ks.a),r_=function(e){p(r,e);var t=m(r);function r(e){var n;x(this,r),(n=t.call(this)).isRunning=!1,n.runtimeNodeEventHub=new Ks.a;var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,c=e.eventHub,h=e.iterateIndex,d=e.iterateId,f=e.isInInteractiveSeq,p=e.fromSeqId;return n.id=i.ctn.id,n.json=i,n.ctx=l,n.isIterate=a,n.globalEventHub=c,n.commonTimeNode=new t_({json:i.ctn,isSub:s,eventHubs:{global:c,runtime:n.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:h,iterateId:d,isInInteractiveSeq:f,fromSeqId:p}),n.commonTimeNode.on("timeNodeStart",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.setReverse(n.commonTimeNode.getReverse()),e.commonTimeNode.startTimeNode()})),n.isRunning||(n.isRunning=!0,n.globalEventHub.emit("runtime ".concat(n.id," begin")),n.emit("begin"))})),n.commonTimeNode.on("timeNodeRepeat",(function(){n.commonTimeNode.children.forEach((function(e){e.commonTimeNode.startTimeNode(!1)}))})),n.commonTimeNode.on("timeNodeEnd",(function(){n.commonTimeNode.isTimeNodeEnd()&&n.isRunning&&(n.isRunning=!1,n.globalEventHub.emit("runtime ".concat(n.id," end")),n.emit("end")),"exit"===n.commonTimeNode.json.presetClass&&n.commonTimeNode.children.length>=1&&n.commonTimeNode.children[n.commonTimeNode.children.length-1]instanceof iy&&n.commonTimeNode.children.forEach((function(e){e instanceof iy||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),n}return r}(Ks.a),n_=function(){function e(t,r,n){x(this,e),this.json=t,this.ctx=n,this.globalEventHub=r;var i=t.timeNodeList.find((function(e){return"par"===e.type&&"tmRoot"===e.ctn.nodeType}));i&&(this.tmRoot=new r_({json:i,isSub:!1,isIterate:!1,eventHub:r,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"mainSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))}return S(e,[{key:"findSeq",value:function(e){var t;return null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.find((function(t){var r,n,i;return"seq"===(null===(r=t.json)||void 0===r?void 0:r.type)&&(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.id)===e}))}},{key:"start",value:function(){var e,t;return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.json.autoPlayMainSeq){r.next=6;break}return r.next=3,this.ctx.clock.delay(16);case 3:null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode(),r.next=7;break;case 6:null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode();case 7:case"end":return r.stop()}}),r,this)})))}},{key:"setMainSeqApplied",value:function(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}},{key:"collectMainSeqStartValue",value:function(){var e;null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.collectStartValue()}},{key:"setMainSeqStep",value:function(e,t){var r;-1===e&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(r=this.mainSeq)||void 0===r||r.setCurrentStep(e,t)}},{key:"destroy",value:function(){var e;this.globalEventHub.removeAllListeners(),null===(e=this.tmRoot)||void 0===e||e.commonTimeNode.destroy()}},{key:"hasMainSeq",value:function(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}},{key:"currentMainSeqState",value:function(){return this.mainSeq?this.mainSeq.currentState:null}},{key:"currentMainSeqStep",value:function(){return this.mainSeq?this.mainSeq.currentStep:0}},{key:"currentMainSeqLength",value:function(){return this.mainSeq?this.mainSeq.stepLength:0}},{key:"mainSeqHasNextStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasNext()}},{key:"mainSeqHasPrevStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasPrev()}},{key:"seekInteractiveSeqToEnd",value:function(e){var t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n=this.findSeq(e);n&&n.setCurrentStep(t,r)}},{key:"resetAllInteractiveSeq",value:function(){var e;((null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.filter((function(e){var t,r,n;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"interactiveSeq"===(null===(n=null===(r=e.json)||void 0===r?void 0:r.ctn)||void 0===n?void 0:n.nodeType)})))||[]).forEach((function(e){e.setCurrentStep(0,"start")}))}},{key:"applyInteractiveAction",value:function(e){this.globalEventHub.emit(e)}}]),e}(),i_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o_=function(e){p(r,e);var t=m(r);function r(e,n,i,o){var a;x(this,r),(a=t.call(this,{id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},n,{parentGlobalPos:i},o)).isRendered=!1,a.isTimingStartValueCollected=!1,a.json=e,a.json.smartArtShapeList&&(n.smartArtShapeList=a.json.smartArtShapeList),n.hasBackgroundFillShape=a.detectUseBackgroundFill(a.json),a.container.visible=!1,a.ctx=n;var s=new Nd;return s.beginFill(16777215),s.drawRect(0,0,e.width,e.height),s.endFill(),a.container.addChild(s),a}return S(r,[{key:"detectUseBackgroundFill",value:function(e){var t=this;return!!e&&("Picture"===e.type||"Shape"===e.type?e.useBgFill:!(!e.children||!Array.isArray(e.children))&&e.children.some((function(e){return t.detectUseBackgroundFill(e)})))}},{key:"initOnReuse",value:function(){var e=this;f(b(r.prototype),"initOnReuse",this).call(this),this.ctx.timingEventHub.on("c:prev slide",(function(t){e.ctx.eventHub.emit(__.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,r){e.ctx.eventHub.emit(__.requestNextSlide,t,r)}))}},{key:"applyEffectCacheAsBitMap",value:function(e){this.children.forEach((function(t){return t.applyEffectCacheAsBitMap(e)}))}},{key:"render",value:function(e){var t=this;this.isRendered||(this.collectAnimatedIds().forEach((function(e){return t.ctx.animatedIds.add(e)})),this.isRendered=!0,f(b(r.prototype),"render",this).call(this,e),e.addSubMTask((function(){return i_(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.eventHub.emit("StageRenderEnd");case 1:case"end":return e.stop()}}),e,this)})))}),"@StageImpl[emit.StageRenderEnd]"))}},{key:"isListTimeNode",value:function(e){return["excel","seq","par"].indexOf(e.type)>=0}},{key:"isAnimatedTimeNode",value:function(e){return!!e.cBhvr}},{key:"collectAnimatedIdsForTimeNode",value:function(e,t){var r,n=this;this.isListTimeNode(e)?null===(r=e.ctn.childTnLst)||void 0===r||r.forEach((function(e){n.collectAnimatedIdsForTimeNode(e,t)})):this.isAnimatedTimeNode(e)&&t.push(e.cBhvr.target.id)}},{key:"collectAnimatedIds",value:function(){var e=this,t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach((function(r){e.collectAnimatedIdsForTimeNode(r,t)})),t}},{key:"createTiming",value:function(){this.json.timing&&!this.timing&&(this.timing=new n_(this.json.timing,this.ctx.timingEventHub,this.ctx))}},{key:"startTiming",value:function(){var e;return(null===(e=this.timing)||void 0===e?void 0:e.start())||Promise.resolve()}},{key:"setMainSeqApplied",value:function(){var e;null===(e=this.timing)||void 0===e||e.setMainSeqApplied()}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.timing)||void 0===r||r.setMainSeqStep(e,t)}},{key:"collectMainSeqStartValue",value:function(){var e;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(e=this.timing)||void 0===e||e.collectMainSeqStartValue())}},{key:"hasTiming",value:function(){return!!this.timing}},{key:"clearOnSlideChange",value:function(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),f(b(r.prototype),"clearOnSlideChange",this).call(this)}},{key:"clearOnTransactionEnd",value:function(){var e,t;this.ctx.timingTargets.getTargets().forEach((function(e){e.hasPreset=!1})),null===(e=this.timing)||void 0===e||e.resetAllInteractiveSeq(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0}},{key:"destroy",value:function(){var e,t;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(e=this.ctx.bgTexture)||void 0===e||e.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0,f(b(r.prototype),"destroy",this).call(this)}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqStep())&&void 0!==t?t:0}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"mainSeqState",value:function(){return this.timing?this.timing.currentMainSeqState():null}},{key:"nextStep",value:function(e,t){var r;this.hasTiming()&&(null===(r=this.timing)||void 0===r?void 0:r.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",e,t)):this.ctx.eventHub.emit(__.requestNextSlide,e,t)}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hasTiming()&&(null===(e=this.timing)||void 0===e?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(__.requestPrevSlide,t)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.timing)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.timing)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.timing)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){return i_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=this.ctx.medias[e],n.t0=i,!n.t0){n.next=21;break}if(!t){n.next=18;break}if(!r){n.next=14;break}return n.next=7,dv((function(){return i.clippedDuration>0}),5e3);case 7:if(n.t1=r=0&&t.tasks.splice(r,1)})),e.once("task-error",(function(){var r=t.tasks.indexOf(e);r>=0&&t.tasks.splice(r,1)}))}},{key:"start",value:function(){this.couldRunning=!0}},{key:"stop",value:function(){this.couldRunning=!1}}]),e}(),s_=function(e){return new Promise((function(t){return setTimeout(t,e)}))},u_=function(e){p(r,e);var t=m(r);function r(e,n,i){var o;return x(this,r),(o=t.call(this)).slideIndex=e,o.taskId=n,o.logger=i,o.uuid=uv(),o.isCancel=!1,o.tasks=[],o}return S(r,[{key:"isEmpty",value:function(){return 0===this.tasks.length}},{key:"addMTask",value:function(e,t){this.tasks.push({fn:e,state:"wait",sub:[],name:t})}},{key:"addSubMTask",value:function(e,t){var r=this.tasks.findIndex((function(e){return"running"===e.state}));r<0&&(r=0),this.tasks[r].sub.push({fn:e,state:"wait",sub:[],name:t})}},{key:"cancel",value:function(){this.tasks=[],this.isCancel=!0}},{key:"applyNext",value:function(){var e=this;if(!this.tasks.some((function(e){return"running"===e.state}))&&!this.tasks.some((function(e){return"error"===e.state})))if(this.tasks.every((function(e){return"finish"===e.state})))this.isCancel||this.emit("task-finish");else{var t=this.tasks.find((function(e){return"wait"===e.state}));t&&(t.state="running",t.fn.apply(null).then((function(){if(t.state="finish",t.sub.length>0){var r,n=e.tasks.findIndex((function(e){return e===t}));(r=e.tasks).splice.apply(r,[n+1,0].concat(a(t.sub)))}})).catch((function(r){t.state="error",e.logger.error("".concat(r," ").concat(r.stack),e.taskId),e.emit("task-error",nv.transform(r),e.slideIndex)})))}}},{key:"applyAll",value:function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.tasks.every((function(e){return"finish"===e.state}))){e.next=14;break}if(!this.tasks.some((function(e){return"running"===e.state}))){e.next=6;break}return e.next=4,s_(16);case 4:e.next=12;break;case 6:if(!this.tasks.some((function(e){return"error"===e.state}))){e.next=8;break}return e.abrupt("return");case 8:return e.delegateYield(regeneratorRuntime.mark((function e(){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.tasks.find((function(e){return"wait"===e.state})))){e.next=17;break}return r.state="running",e.prev=3,e.next=6,hv((function(){return r.fn.apply(null)}),6e4);case 6:if(e.t0=e.sent,e.t1=lv,e.t0!==e.t1){e.next=10;break}throw new nv(Zp.RuntimeError,"subtask ".concat(r.name," apply timeout"));case 10:r.state="finish",r.sub.length>0&&(i=t.tasks.findIndex((function(e){return e===r})),(n=t.tasks).splice.apply(n,[i+1,0].concat(a(r.sub)))),e.next=17;break;case 13:return e.prev=13,e.t2=e.catch(3),o=(null==e.t2?void 0:e.t2.errorType)?e.t2:new nv(Zp.RuntimeError,"subtask ".concat(r.name," error. ").concat(e.t2)),r.state="error",t.logger.error("".concat(e.t2," ").concat(e.t2.stack),t.taskId),t.emit("task-error",nv.transform(o),t.slideIndex),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,13]])}))(),"t0",9);case 9:if("break"!==e.t0){e.next=12;break}return e.abrupt("break",14);case 12:e.next=0;break;case 14:!this.isCancel&&this.tasks.every((function(e){return"finish"===e.state}))&&this.emit("task-finish");case 15:case"end":return e.stop()}}),e,this)})))}}]),r}(Ks.a),l_=function(){function e(t,r){var n=this;x(this,e),this.renderer=t,this.localStorage=r,this.worker=null,this.outputData=new Map,this.loadingSdfKeys=new Set;var i=new Blob(['\nself.onmessage = function(e) {\n var data = e.data.data;\n var key = e.data.key;\n var height = Math.ceil(e.data.height);\n var width = Math.ceil(e.data.width);\n if (!data || !key) {\n return;\n }\n var maxDis = 0;\n var d = [];\n var p = [];\n var maxInt = Number.MAX_SAFE_INTEGER || 255 * 255 * 255;\n var setD = function(x, y, v) { d[y * width + x] = v; };\n var getD = function(x, y) { return d[y * width + x]; };\n var setP = function(x, y, v) { p[y * width + x] = v; };\n var getP = function(x, y) { return p[y * width + x]; };\n var isContains = function(x, y) { return x >= 0 && x < width && y >= 0 && y < height; };\n var isInterior = function(x, y) { return data[(y * width + x) * 4 + 3] > 10; };\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var c = isInterior(x, y);\n var t = isContains(x, y - 1) ? isInterior(x, y - 1) : false;\n var b = isContains(x, y + 1) ? isInterior(x, y + 1) : false;\n var l = isContains(x - 1, y) ? isInterior(x - 1, y) : false;\n var r = isContains(x + 1, y) ? isInterior(x + 1, y) : false;\n if (c !== t || c !== b || c !== l || c !== r) {\n setD(x, y, 0);\n setP(x, y, [x, y]);\n } else {\n setD(x, y, maxInt);\n setP(x, y, [-1, -1]);\n }\n }\n }\n \n var f = function (x, y, dir) {\n var d1 = 1;\n var d2 = Math.sqrt(2);\n var dx;\n var dy;\n var od;\n switch (dir) {\n case "TL": dx = -1; dy = -1; od = d2; break;\n case "T": dx = 0; dy = -1; od = d1; break;\n case "TR": dx = 1; dy = -1; od = d2; break;\n case "L": dx = -1; dy = 0; od = d1; break;\n case "R": dx = 1; dy = 0; od = d1; break;\n case "BL": dx = -1; dy = 1; od = d2; break;\n case "B": dx = 0; dy = 1; od = d1; break;\n case "BR": dx = 1; dy = 1; od = d2; break;\n }\n var b = isContains(x + dx, y + dy);\n var cb = b ? getD(x + dx, y + dy) : maxInt;\n if (cb + od < getD(x, y)) {\n var p = b ? getP(x + dx, y + dy) : [-1, -1];\n var dis = Math.sqrt(Math.pow(x - p[0], 2) + Math.pow(y - p[1], 2));\n setP(x, y, p);\n setD(x, y, dis);\n if (dis > maxDis) {\n maxDis = dis;\n }\n }\n };\n \n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var dirs = ["TL", "T", "TR", "L"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n for (var y = height - 1; y >= 0; -- y) {\n for (var x = width - 1; x >= 0; -- x) {\n var dirs = ["R", "BL", "B", "BR"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n var outputData = [];\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n outputData.push(isInterior(x, y) ? 255: 0);\n outputData.push(0);\n outputData.push(0);\n outputData.push(Math.ceil(getD(x, y) / maxDis * 255));\n }\n }\n self.postMessage({\n key, outputData, maxDis\n });\n};\n'],{type:"text/javascript"});this.worker=new Worker(URL.createObjectURL(i)),this.worker.onmessage=function(e){n.outputData.set(e.data.key,{data:e.data.outputData,maxDis:e.data.maxDis})},this.outputData.set("111","222")}return S(e,[{key:"createSdfByWorker",value:function(e,t,r,n,i,o,a,s){var u=document.createElement("canvas");u.width=i,u.height=o;var l=u.getContext("2d");if(l&&this.worker){l.drawImage(a,e,t,r,n);var c=l.getImageData(0,0,i,o).data;this.worker.postMessage({data:c,key:s,width:i,height:o})}}},{key:"createSdf",value:function(e,t,r){var n=document.createElement("canvas");n.width=e,n.height=t;var i=n.getContext("2d");if(!i)return{src:"",maxDis:1};i.drawImage(r,0,0);for(var o=0,a=i.getImageData(0,0,e,t).data,s=[],u=[],l=function(t,r,n){s[r*e+t]=n},c=function(t,r){return s[r*e+t]},h=function(t,r,n){u[r*e+t]=n},d=function(r,n){return r>=0&&r=0&&n10},p=0;po&&(o=m)}},w=0;w=0;--k)for(var E=e-1;E>=0;--E)for(var I=0,A=["R","BL","B","BR"];It.maxResolution.x||s>t.maxResolution.y){var n=(r=t.maxResolution.x/a)*s;n>t.maxResolution.y&&(r*=t.maxResolution.y/n)}return o.loadSpriteSheetItem(t.url,t.taskId,e,r)}),"@StagePool[spriteTexture.loadSpriteSheetItem]")})),Promise.resolve()}),"@StagePool[loadSpriteSheets]")}},{key:"createStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){var n=t.stageJsons[e],i=t.stageCtxs[e],o=new o_(n,i,{x:0,y:0},r);return t.stageImpls[e]=o,Promise.resolve()}),"@StagePool[createStage]")}},{key:"preRenderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return t.stageImpls[e].preRender(r),Promise.resolve()}),"@StagePool[preRenderStage]")}},{key:"createGraphicsTexture",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(n=this.stageCtxs[e]).graphicsTexture.pack().forEach((function(e,t){r.addSubMTask((function(){return n.graphicsTexture.render(e,t,i.objPoolGroup,1)}),"@StagePool[graphicsTexture.render]")}));case 2:case"end":return t.stop()}}),t,this)})))}),"@StagePool[createGraphicsTexture]")}},{key:"renderStage",value:function(e){var t=this,r=this.stageStates[e].task;r.addMTask((function(){return c_(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.stageImpls[e],t.next=3,n.render(r);case 3:case"end":return t.stop()}}),t,this)})))}),"@StagePool[renderStage]")}},{key:"destroyStageByIndex",value:function(e){"load"===this.stageStates[e].state&&this.stageStates[e].task.cancel(),delete this.stageStates[e],this.stageImpls[e].destroy(),delete this.stageImpls[e],delete this.stageCtxs[e]}},{key:"destroyStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);Math.abs(e.currentStageIndex-r)>e.cacheCount&&e.destroyStageByIndex(r)}))}},{key:"destroyAllStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var r=parseInt(t,10);e.destroyStageByIndex(r)}))}},{key:"preload",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stageImpls[e]||this.stageStates[e])return Promise.resolve();var n=new u_(e,this.taskId,this.logger);return n.on("task-error",(function(e,r){delete t.stageStates[r],delete t.stageImpls[r],delete t.stageCtxs[r],t.errorChannel.emit("error",e,r)})),this.stageStates[e]={state:"load",task:n},this.createCtx(e),this.loadStageJson(e),this.loadSpriteSheets(e),this.createStage(e),this.preRenderStage(e),this.createGraphicsTexture(e),this.renderStage(e),this.microTaskManager.addTask(n),r?n.applyAll():new Promise((function(r){n.once("task-finish",(function(){t.stageStates[e].state="finish",Object.keys(t.stageStates).length>2*t.cacheCount+1&&t.destroyStage(),r()}))}))}},{key:"getStageJson",value:function(e){return this.stageJsons[e]||null}},{key:"getStage",value:function(e){return c_(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.currentStageIndex=e,"finish"!==(null==(r=this.stageStates[e])?void 0:r.state)||!this.stageImpls[e]){t.next=6;break}t.t0=this.stageImpls[e],t.next=16;break;case 6:if("load"!==(null==r?void 0:r.state)){t.next=12;break}return t.next=9,r.task.applyAll();case 9:t.t1=this.stageImpls[e],t.next=15;break;case 12:return t.next=14,this.preload(e,!0);case 14:t.t1=this.stageImpls[e];case 15:t.t0=t.t1;case 16:return t.abrupt("return",t.t0);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"destroy",value:function(){this.runningAudio.clear(),this.sdfManager.destroy()}}]),e}(),d_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},f_=function(){function e(t){var r,n=this;x(this,e),this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,null===(r=e.localCache)||void 0===r||r.ready((function(e){e||(n.isIndexDBReady=!0)})).catch((function(){t.warn("local storage not ready",n.taskId)}))}return S(e,[{key:"attachTaskId",value:function(e){this.taskId=e}},{key:"getItem",value:function(t){return d_(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null,!this.couldUseIndexDBCache||!e.localCache){r.next=10;break}return r.prev=2,r.next=5,hv((function(){return e.localCache.getItem("".concat(i.taskId,"/").concat(t))}),500);case 5:n=r.sent,r.next=10;break;case 8:r.prev=8,r.t0=r.catch(2);case 10:return r.abrupt("return",(n=n===lv?null:n)||this.memoryCache.get(t)||null);case 11:case"end":return r.stop()}}),r,this,[[2,8]])})))}},{key:"setItem",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return d_(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(this.couldUseIndexDBCache){i.next=2;break}return i.abrupt("return",(n&&this.memoryCache.set(t,r),Promise.resolve()));case 2:if(!e.localCache){i.next=13;break}return o=null,i.prev=4,i.next=7,hv((function(){return e.localCache.setItem("".concat(a.taskId,"/").concat(t),r).catch((function(){n&&a.memoryCache.set(t,r)}))}),500);case 7:o=i.sent,i.next=12;break;case 10:i.prev=10,i.t0=i.catch(4);case 12:o!==lv&&null!==o||!n||this.memoryCache.set(t,r);case 13:case"end":return i.stop()}}),i,this,[[4,10]])})))}},{key:"dispose",value:function(){var t,r=this;this.memoryCache=new Map,this.couldUseIndexDBCache&&(null===(t=e.localCache)||void 0===t||t.keys().then((function(t){t.filter((function(e){return e.indexOf(r.taskId)>=0})).forEach((function(t){var r;null===(r=e.localCache)||void 0===r||r.removeItem(t).catch((function(){}))}))})).catch((function(){})))}},{key:"couldUseIndexDBCache",get:function(){return this.isIndexDBReady&&this.taskId.length>0}}]),e}();f_.localCache=null;try{f_.localCache=_.createInstance({name:"slide_local_cache",driver:_.INDEXEDDB,version:1})}catch(u){}var p_=new jl.j,v_=function(){function e(t){x(this,e),this.localStorage=t}return S(e,[{key:"canvas",value:function(t,r,n,i){var o,a,s,u=!1,l=!1;t&&(t instanceof $l.p?s=t:(s=r.generateTexture(t),l=!0)),s?(o=s.baseTexture.resolution,a=s.frame,u=!1,r.renderTexture.bind(s)):(o=r.resolution,u=!0,(a=p_).width=r.width,a.height=r.height,r.renderTexture.bind(null));var c=Math.floor(a.width*o+1e-4),h=Math.floor(a.height*o+1e-4),d=document.createElement("canvas");d.width=c,d.height=h;var f=d.getContext("2d");if(!f)throw new Error("ctx");if(n)f.putImageData(n,0,0);else{var p=f.getImageData(0,0,c,h),v=new Uint8Array(4*c*h),m=r.gl;m.readPixels(a.x*o,a.y*o,c,h,m.RGBA,m.UNSIGNED_BYTE,v),e.arrayPostDivide(v,p.data),f.putImageData(p,0,0),i&&this.localStorage.setItem(i,p).catch((function(){}))}if(u){var g=document.createElement("canvas");g.width=c,g.height=h;var y=g.getContext("2d");y.scale(1,-1),y.drawImage(d,0,-h),d=g}return l&&(null==s||s.destroy(!0)),d}}],[{key:"arrayPostDivide",value:function(e,t){for(var r=0;r1&&(e=1),this._volume=e,this.emit("update",this._volume)}}]),r}(Ks.a),g_=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Rl.skipHello();var y_={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip",gallery:"Gallery",switch:"Switch",prism:"Prism",doors:"Doors"},__={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",mediaStop:"mediaStop",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",requestOpenUrl:"requestOpenUrl",userInput:"userInput",fullscreenChange:"fullscreenChange",changeLocalFullscreenState:"changeLocalFullscreenState"},b_=function(e){p(r,e);var t=m(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(this,r),(n=t.call(this)).errorChannel=new Ks.a,n.transactionPlayer=null,n.isForward=!0,n.drawCall=0,n.scale=1,n._isPaused=!1,n.maxResolution=new jl.g(0,0),n.isNVIDIA=!1,n.fps=new rv,n.designWidth=0,n.designHeight=0,n.currentIndex=0,n.slideCount=0,n.runtime={drawCall:0,fps:0},n.globalEventHub=new Ks.a,n.globalVideoBackground=new Nd,n.globalVideoSprite=new Ld,n.onMousemoveTimeout=null,n.cacheFunctionMap=new Map,n.isPlayerPaused=function(){return n._isPaused},n.onWebGLLost=function(){n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost."))},n.fullscreenOnMousemove=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!0}),n.onMousemoveTimeout&&clearTimeout(n.onMousemoveTimeout),n.onMousemoveTimeout=setTimeout((function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})}),jg)},n.fullscreenOnMouseleave=function(e){var t=e.index,r=e.targetId;n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:r,status:!1})},n.calculateFullscreenVideoPosition=function(e){var t=e.width,r=e.height,i=y(n),o=i.designWidth,a=i.designHeight,s=Math.min(o/t,a/r);return{x:(o-t*s)/2,y:(a-r*s)/2,width:t*s,height:r*s}},n.onRequestFullscreenVideo=function(e){var t=e.texture,r=e.index,i=e.targetId;if(r===n.currentIndex){n.onRequestCancelFullscreenVideo(),n.globalVideoBackground.width=n.designWidth,n.globalVideoBackground.height=n.designHeight,n.globalVideoBackground.beginFill(0,1),n.globalVideoBackground.drawRect(0,0,n.designWidth,n.designHeight),n.globalVideoBackground.endFill(),n.globalVideoBackground.interactive=!0,n.app.stage.addChild(n.globalVideoBackground);var o=n.calculateFullscreenVideoPosition(t),a=o.x,s=o.y,u=o.width,l=o.height;n.globalVideoSprite.texture=t,n.globalVideoSprite.width=u,n.globalVideoSprite.height=l,n.globalVideoSprite.position.x=a,n.globalVideoSprite.position.y=s,n.globalVideoBackground.addChild(n.globalVideoSprite),n.globalEventHub.emit("onFullscreenChange",{status:!0,targetId:i,slideIndex:n.currentIndex}),n.clearFullscreenEventListenersWithAppView();var c={handleEvent:function(){var e;null===(e=n.currentStage)||void 0===e||e.ctx.eventHub.emit(__.userInput)}};if(n.app.view.addEventListener("pointerdown",c,!1),n.cacheFunctionMap.set("pointerdown",c),Og.isDesktop()){var h={handleEvent:function(){n.fullscreenOnMouseleave({index:r,targetId:i})}};n.app.view.addEventListener("mouseout",h,!1);var d={handleEvent:function(){n.globalEventHub.emit("controllerShowStatusChange",{slideIndex:r,targetId:i,status:!0})}};n.app.view.addEventListener("mouseover",d,!1);var f={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("mousemove",f,!1),n.cacheFunctionMap.set("mouseover",d),n.cacheFunctionMap.set("mousemove",f),n.cacheFunctionMap.set("mouseout",h)}else{var p={handleEvent:function(){n.fullscreenOnMousemove({index:r,targetId:i})}};n.app.view.addEventListener("touchstart",p,!1),n.cacheFunctionMap.set("touchstart",p)}}else t.destroy(!1)},n.onRequestCancelFullscreenVideo=function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.globalVideoSprite.texture.destroy(!1);try{n.globalVideoBackground.removeChild(n.globalVideoSprite)}catch(e){n.logger.error("removeChild error: PPTPlayer:1057",n.taskId)}try{n.app.stage.removeChild(n.globalVideoBackground)}catch(e){n.logger.error("removeChild error: PPTPlayer:1062",n.taskId)}n.globalEventHub.emit("onFullscreenChange",{status:!1,slideIndex:n.currentIndex,targetId:null===(e=n.currentStage)||void 0===e?void 0:e.ctx.latestChangeFullscreenTargetId}),n.clearFullscreenEventListenersWithAppView(),r&&n.emit(__.changeLocalFullscreenState,{status:!1,slideIndex:n.currentIndex,targetId:null===(t=n.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},n.logger=e.logger,n.tracker=e.tracker,n.mode=e.mode,n.volumeAdjuster=e.volumeAdjuster,n.localStorage=new f_(n.logger),n.cachedExtract=new v_(n.localStorage),n.config={minFPS:ru()(i.minFPS)?30:i.minFPS,maxFPS:ru()(i.maxFPS)?40:i.maxFPS,resolution:ru()(i.resolution)?1:i.resolution,autoFPS:!ru()(i.autoFPS)&&i.autoFPS,autoResolution:!ru()(i.autoResolution)&&i.autoResolution,transactionBgColor:ru()(i.transactionBgColor)?0:i.transactionBgColor,maxResolutionLevel:n.getMaxResolution(i.maxResolutionLevel),forceCanvas:!ru()(i.forceCanvas)&&i.forceCanvas,enableNvidiaDetect:!ru()(i.enableNvidiaDetect)&&i.enableNvidiaDetect},n.updateMaxResolutionLevel(n.config.maxResolutionLevel),n.loader=new vv(n.localStorage,e.useLocalCache,n.logger,n.tracker,e.resourceTimeout,e.loadDelegate,e.urlInterrupter);var o=Rl.isWebGLSupported();n.app=new Xl({antialias:!0,autoDensity:!1,backgroundColor:16777215,forceCanvas:n.config.forceCanvas||!o}),globalThis.__PIXI_APP__=n.app,n.tracker({name:"slidePlayerCreate",result:"",reason:"",payload:{webgl:o,resolution:n.config.resolution,minFPS:n.config.minFPS,maxFPS:n.config.maxFPS,maxResolutionLevel:n.config.maxResolutionLevel,forceCanvas:n.config.forceCanvas}}),n.updateConfig(n.config),n.app.ticker.maxFPS=60,n.app.ticker.minFPS=n.config.minFPS,n.app.ticker.maxFPS=n.config.maxFPS,n.app.view.style.zIndex="1",n.app.stage.sortableChildren=!0;var a=n.app.renderer;if(a.gl){var s=a.gl.drawElements,u=a.gl.getExtension("WEBGL_debug_renderer_info"),l=a.gl.getParameter(u.UNMASKED_RENDERER_WEBGL);/nvidia/i.test(l)&&n.config.enableNvidiaDetect&&(n.isNVIDIA=!0),a.gl.drawElements=function(){for(var e=arguments.length,t=new Array(e),r=0;r=t&&n.updateResolution(i)}}else if(e>n.config.maxFPS&&n.config.autoResolution){var o=n.scale*n.config.resolution,a=n.app.renderer.resolution,s=Math.min(o,a+.1);s<=n.config.resolution&&n.updateResolution(s)}})),n.app.ticker.add((function(){n.runtime.drawCall=n.drawCall,n.runtime.fps=Math.floor(n.app.ticker.minFPS),n.drawCall=0}),null,zl.c.LOW),n.clock=new mv(n.app.ticker),n.objPoolGroup=uv(),n.stagePool=new h_(n.loader,n.mode,n.app.renderer,n.app.ticker,n.app.view,n.clock,n.objPoolGroup,n.errorChannel,n.localStorage,n.logger,e.loadDelegate,e.urlInterrupter,n.isPlayerPaused,n.maxResolution,n.volumeAdjuster,n.config.forceCanvas,n.globalEventHub),n.app.view.addEventListener("webglcontextlost",n.onWebGLLost);try{n.config.forceCanvas||(n.transactionPlayer=new Ol)}catch(s){/Error creating WebGL context/.test(s.message)?n.errorChannel.emit("error",new nv(Zp.CanvasCrash,"webgl context lost.")):n.errorChannel.emit("error",new nv(Zp.RuntimeWarn,s.message))}return n.globalEventHub.on("requestFullscreen",n.onRequestFullscreenVideo),n.globalEventHub.on("requestCancelFullscreen",n.onRequestCancelFullscreenVideo),n}return S(r,[{key:"getMaxResolution",value:function(e){return!ru()(e)&&Number.isInteger(e)?(e<1&&(e=1),e>4&&(e=4),e):r.platform.isAndroid()||r.platform.isIOS()?2:4}},{key:"updateMaxResolutionLevel",value:function(e){e<0&&(e=0),e>4&&(e=4);var t=[640,960,1280,1920,3200][e],r=[360,540,720,1080,1800][e];this.maxResolution.set(t,r)}},{key:"updateConfig",value:function(e){ru()(e.maxFPS)||ru()(e.minFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS,this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),ru()(e.resolution)||(this.config.resolution=e.resolution,this.updateResolution(this.scale*this.config.resolution)),ru()(e.autoFPS)||(this.config.autoFPS=e.autoFPS),ru()(e.autoResolution)||(this.config.autoResolution=e.autoResolution),ru()(e.transactionBgColor)||(this.config.transactionBgColor=e.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),ru()(e.maxResolutionLevel)||(this.config.maxResolutionLevel=e.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}},{key:"preload",value:function(e){return g_(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e<1||e>this.slideCount,t.t0){t.next=6;break}return this.logger.info("preload slide ".concat(e," begin"),this.taskId),t.next=5,this.stagePool.preload(e);case 5:this.logger.info("preload slide ".concat(e," end"),this.taskId);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setResourceData",value:function(e,t){this.logger.info("ppt player init config: "+JSON.stringify(this.config),e),this.logger.info("set resource to "+t,e),this.taskId=e,this.url=t,this.stagePool.setResourceData(e,t),this.localStorage.attachTaskId(e),this.loader.attachTaskId(e)}},{key:"setInteractive",value:function(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}},{key:"translateEvent",value:function(e,t){var r=this;t.forEach((function(t){e.on(t,(function(){for(var e,n,i,o,a=arguments.length,s=new Array(a),u=0;u0&&this.view&&p&&(m=s.json.transition,!this.isForward&&(null==p?void 0:p.json.transition)&&(m=p.json.transition),g=this.getTransactionTexture(p,this.view,null,null),this.initTransactionPlayer(m),null===(r=this.transactionPlayer)||void 0===r||r.setPrevTexture(g),v=!0),this.app.stage.addChild(s.container),this.updateResolution(this.config.resolution*this.scale),p){p.clearOnTransactionEnd();try{this.app.stage.removeChild(p.container)}catch(e){this.logger.error("removeChild error: PPTPlayer:622",this.taskId)}}if(!(s.json.transition&&s.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&v)){i.next=31;break}return i.next=24,this.getTransactionTexture(s,this.view,u,l);case 24:return y=i.sent,this.transactionPlayer.setNextTexture(y),i.next=28,this.transactionPlayer.play();case 28:if(_=this.transactionPlayer.renderer.domElement,this.view.parentElement&&_)try{this.view.parentElement.removeChild(_)}catch(e){this.logger.error("removeChild error: PPTPlayer:637",this.taskId)}null===(n=this.transactionPlayer)||void 0===n||n.dispose();case 31:if(!this.isForward){i.next=36;break}return i.next=34,s.startTiming();case 34:i.next=37;break;case 36:s.setMainSeqApplied();case 37:s.ctx.slideScopeEventHub.emit("slide-render",s.ctx.slideIndex),this.emit(__.renderEnd,e),this.emit(__.slideChange,e),s.ctx.isRendering=!1,this.preload(e+1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e+1)})),this.preload(e-1).catch((function(t){b.errorChannel.emit("error",nv.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-a,"ms"),this.taskId),this.tracker({name:"slidePageChange",reason:"",result:"",payload:{duration:Date.now()-a,from:o,to:e}});case 45:case"end":return i.stop()}}),i,this)})))}},{key:"getTransactionTexture",value:function(e,t,r,n){var i=$l.p.create({width:e.json.width,height:e.json.height,resolution:1});this.app.renderer.render(e.container,{renderTexture:i});var o=this.cachedExtract.canvas(i,this.app.renderer,n,r);return new W(o)}},{key:"renderToBase64",value:function(e,t,r){return g_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.stagePool.getStage(e);case 2:if(!(i=n.sent)){n.next=10;break}return o=i.json,a=o.width,s=o.height,this.designWidth=a,this.designHeight=s,u=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:u}),l=this.app.renderer.plugins.extract.base64(u,r),n.abrupt("return",(this.stagePool.destroyStageByIndex(e),l));case 10:return n.abrupt("return","__null__");case 11:case"end":return n.stop()}}),n,this)})))}},{key:"renderMainSeqToBase64",value:function(e,t,r){return g_(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,l,c,h,d,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=[],n.next=3,this.stagePool.getStage(e);case 3:if((o=n.sent).createTiming(),o)for(a=o.json,s=a.width,u=a.height,this.designWidth=s,this.designHeight=u,l=$l.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),o.container.visible=!0,c=o.mainSeqLength(),o.setMainSeqStep(0,"start"),this.app.renderer.render(o.container,{renderTexture:l}),h=this.app.renderer.plugins.extract.base64(l,r),i.push(h),d=0;dr.maxResolution.x||n*r.designHeight>r.maxResolution.y;)n-=.1;r.app.renderer.resolution=n,r.app.renderer.plugins.interaction.resolution=r.app.renderer.resolution,r.app.renderer.resize(r.designWidth,r.designHeight),eu()(t)&&t()}))}},{key:"nextStep",value:function(e,t){var r;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(r=this.currentStage)||void 0===r||r.nextStep(e,t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(e=this.currentStage)||void 0===e||e.prevStep(t)}catch(e){this.errorChannel.emit("error",nv.transform(e),this.currentIndex)}}}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqStep())&&void 0!==t?t:0}},{key:"setMainSeqStep",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMainSeqStep(e,t)}},{key:"mainSeqState",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqState())&&void 0!==t?t:null}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"nextTick",value:function(e){this.app.ticker.addOnce((function(){e()}),zl.c.LOW)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,r){var n;null===(n=this.currentStage)||void 0===n||n.setInteractiveSeqState(e,t,r)}},{key:"setMediaState",value:function(e,t,r){var n;return g_(this,void 0,void 0,regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(n=this.currentStage)||void 0===n?void 0:n.setMediaState(e,t,r);case 2:case"end":return i.stop()}}),i,this)})))}},{key:"setMediaCurrentTime",value:function(e,t){var r;null===(r=this.currentStage)||void 0===r||r.setMediaCurrentTime(e,t)}},{key:"pause",value:function(){var e;this.app.ticker.stop(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalPause()})),this._isPaused=!0}},{key:"resume",value:function(){var e;this._isPaused=!1,this.app.ticker.start(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalResume()}))}},{key:"getSnapshot",value:function(){return this.currentStage&&this.getBase64(this.currentStage)||""}},{key:"clearLocalCache",value:function(){this.localStorage.dispose()}},{key:"clearFullscreenEventListenersWithAppView",value:function(){var e=this;["mousemove","mouseout","mouseover","touchstart","pointerdown"].forEach((function(t){e.cacheFunctionMap.has(t)&&(e.app.view.removeEventListener(t,e.cacheFunctionMap.get(t),!1),e.cacheFunctionMap.delete(t))}))}},{key:"syncFullscreenVideoState",value:function(e){this.globalEventHub.emit("syncFullscreenVideoState",e)}},{key:"destroy",value:function(){var e;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost),this.app.renderer.filter.texturePool.clear(!0),Ev.collectObjectByGroup(this.objPoolGroup),Iv.collectObjectByGroup(this.objPoolGroup),null===(e=this.transactionPlayer)||void 0===e||e.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy(),this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext(),this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),this.tracker({name:"slidePlayerDestroy",result:"",reason:"",payload:{}})}catch(e){}}},{key:"view",get:function(){return this.app.renderer?this.app.view:null}},{key:"nextSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}},{key:"prevSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}}],[{key:"clearLocalCache",value:function(){var e;null===(e=f_.localCache)||void 0===e||e.clear().catch((function(){}))}}]),r}(Ks.a);b_.platform=Og,b_.RtcAudioClazz=null;var x_,w_=new Map,S_=r(136),T_=r.n(S_),M_=r(24),k_=r.n(M_),E_=r(50),I_=r.n(E_),A_=[],C_="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(x_||(x_={}));var P_,N_=function(e){return Object.freeze(e)},O_=function(e,t){this.inlineSize=e,this.blockSize=t,N_(this)},R_=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,N_(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),D_=function(e){return e instanceof SVGElement&&"getBBox"in e},L_=function(e){if(D_(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},j_=function(e){var t;if(e instanceof Element)return!0;var r=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},z_="undefined"!=typeof window?window:{},B_=new WeakMap,U_=/auto|scroll/,F_=/^tb|vertical/,W_=/msie|trident/i.test(z_.navigator&&z_.navigator.userAgent),G_=function(e){return parseFloat(e||"0")},V_=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new O_((r?t:e)||0,(r?e:t)||0)},H_=N_({devicePixelContentBoxSize:V_(),borderBoxSize:V_(),contentBoxSize:V_(),contentRect:new R_(0,0,0,0)}),Y_=function(e,t){if(void 0===t&&(t=!1),B_.has(e)&&!t)return B_.get(e);if(L_(e))return B_.set(e,H_),H_;var r=getComputedStyle(e),n=D_(e)&&e.ownerSVGElement&&e.getBBox(),i=!W_&&"border-box"===r.boxSizing,o=F_.test(r.writingMode||""),a=!n&&U_.test(r.overflowY||""),s=!n&&U_.test(r.overflowX||""),u=n?0:G_(r.paddingTop),l=n?0:G_(r.paddingRight),c=n?0:G_(r.paddingBottom),h=n?0:G_(r.paddingLeft),d=n?0:G_(r.borderTopWidth),f=n?0:G_(r.borderRightWidth),p=n?0:G_(r.borderBottomWidth),v=h+l,m=u+c,g=(n?0:G_(r.borderLeftWidth))+f,y=d+p,_=s?e.offsetHeight-y-e.clientHeight:0,b=a?e.offsetWidth-g-e.clientWidth:0,x=i?v+g:0,w=i?m+y:0,S=n?n.width:G_(r.width)-x-b,T=n?n.height:G_(r.height)-w-_,M=S+v+b+g,k=T+m+_+y,E=N_({devicePixelContentBoxSize:V_(Math.round(S*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:V_(M,k,o),contentBoxSize:V_(S,T,o),contentRect:new R_(h,u,S,T)});return B_.set(e,E),E},$_=function(e,t,r){var n=Y_(e,r),i=n.borderBoxSize,o=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(t){case x_.DEVICE_PIXEL_CONTENT_BOX:return a;case x_.BORDER_BOX:return i;default:return o}},X_=function(e){var t=Y_(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=N_([t.borderBoxSize]),this.contentBoxSize=N_([t.contentBoxSize]),this.devicePixelContentBoxSize=N_([t.devicePixelContentBoxSize])},q_=function(e){if(L_(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},Q_=function(){var e=1/0,t=[];A_.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new X_(t.target),i=q_(t.target);n.push(r),t.lastReportedSize=$_(t.target,t.observedBox),ie?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},K_=[],J_=0,eb={attributes:!0,characterData:!0,childList:!0,subtree:!0},tb=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rb=function(e){return void 0===e&&(e=0),Date.now()+e},nb=!1,ib=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!nb){nb=!0;var r,n=rb(e);r=function(){var r=!1;try{r=function(){var e,t=0;for(Z_(t);A_.some((function(e){return e.activeTargets.length>0}));)t=Q_(),Z_(t);return A_.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:C_}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=C_),window.dispatchEvent(e)),t>0}()}finally{if(nb=!1,e=n-rb(),!J_)return;r?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!P_){var t=0,r=document.createTextNode("");new MutationObserver((function(){return K_.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),P_=function(){r.textContent="".concat(t?t--:t++)}}K_.push(e),P_()}((function(){requestAnimationFrame(r)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,eb)};document.body?t():z_.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),tb.forEach((function(t){return z_.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),tb.forEach((function(t){return z_.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ob=function(e){!J_&&e>0&&ib.start(),!(J_+=e)&&ib.stop()},ab=function(){function e(e,t){this.target=e,this.observedBox=t||x_.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=$_(this.target,this.observedBox,!0);return e=this.target,D_(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),sb=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ub=new WeakMap,lb=function(e,t){for(var r=0;r=0&&(i&&A_.splice(A_.indexOf(r),1),r.observationTargets.splice(n,1),ob(-1))},e.disconnect=function(e){var t=this,r=ub.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),hb=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cb.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j_(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cb.unobserve(this,e)},e.prototype.disconnect=function(){cb.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),db=function(){function e(e,t,r,n,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=r,this.index=e,this.slideIndex=t,this.eventHub=n,this.id=i}return e.prototype.apply=function(){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var e;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(null===(r=e.tasks[i])||void 0===r||r.apply()),n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask()),e.eventHub.emit("task-end-"+t.id)})),this.eventHub.on("task-error",(function(t){var r=t.task,n=e.tasks.findIndex((function(e){return e.index===r.index}));n>=0&&(e.tasks.splice(n,1),e.replaceIdleTask())}))}return e.prototype.replaceIdleTask=function(){for(var e,t=this,r=new Set,n=0,i=this.tasks.length;n=0;r--)t=[e[r].apply(this,t)];return t[0]}},each:function(e,t,r){if(e)if(vb&&e.forEach&&e.forEach===vb)e.forEach(t,r);else if(e.length===e.length+0){var n,i=void 0;for(i=0,n=e.length;i1?gb.toArray(arguments):arguments[0];return gb.each(yb,(function(t){if(t.litmus(e))return gb.each(t.conversions,(function(t,r){if(_b=t.read(e),!1===bb&&!1!==_b)return bb=_b,_b.conversionName=r,_b.conversion=t,gb.BREAK})),gb.BREAK})),bb},wb=void 0,Sb={hsv_to_rgb:function(e,t,r){var n=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),o=r*(1-t),a=r*(1-i*t),s=r*(1-(1-i)*t),u=[[r,s,o],[a,r,o],[o,r,s],[o,a,r],[s,o,r],[r,o,a]][n];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,r){var n=Math.min(e,t,r),i=Math.max(e,t,r),o=i-n,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=e===i?(t-r)/o:t===i?2+(r-e)/o:4+(e-t)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/i,v:i/255})},rgb_to_hex:function(e,t,r){var n=this.hex_with_component(0,2,e);return n=this.hex_with_component(n,1,t),this.hex_with_component(n,0,r)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,r){return r<<(wb=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var Wb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=n||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,gb.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=Fb(i.__impliedStep),i}return Ib(t,e),kb(t,[{key:"setValue",value:function(e){var r=e;return void 0!==this.__min&&rthis.__max&&(r=this.__max),void 0!==this.__step&&r%this.__step!=0&&(r=Math.round(r/this.__step)*this.__step),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,r)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=Fb(e),this}}]),t}(Ob),Gb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,n));i.__truncationSuspended=!1;var o=i,a=void 0;function s(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=a-e.clientY;o.setValue(o.getValue()+t*o.__impliedStep),a=e.clientY}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),jb.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);gb.isNaN(e)||o.setValue(e)})),jb.bind(i.__input,"blur",(function(){s()})),jb.bind(i.__input,"mousedown",(function(e){jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),a=e.clientY})),jb.bind(i.__input,"keydown",(function(e){13===e.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,s())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e,r,n;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),r=this.__precision,n=Math.pow(10,r),Math.round(e*n)/n),Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb);function Vb(e,t,r,n,i){return n+(e-t)/(r-t)*(i-n)}var Hb=function(e){function t(e,r,n,i,o){Mb(this,t);var a=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,{min:n,max:i,step:o})),s=a;function u(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(Vb(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){jb.unbind(window,"mousemove",u),jb.unbind(window,"mouseup",l),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function c(e){var t=e.touches[0].clientX,r=s.__background.getBoundingClientRect();s.setValue(Vb(t,r.left,r.right,s.__min,s.__max))}function h(){jb.unbind(window,"touchmove",c),jb.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),jb.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),jb.bind(window,"mousemove",u),jb.bind(window,"mouseup",l),u(e)})),jb.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(jb.bind(window,"touchmove",c),jb.bind(window,"touchend",h),c(e))})),jb.addClass(a.__background,"slider"),jb.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Eb(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Wb),Yb=function(e){function t(e,r,n){Mb(this,t);var i=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===n?"Fire":n,jb.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),jb.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Ib(t,e),kb(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Ob),$b=function(e){function t(e,r){Mb(this,t);var n=Ab(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));n.__color=new Cb(n.getValue()),n.__temp=new Cb(0);var i=n;n.domElement=document.createElement("div"),jb.makeSelectable(n.domElement,!1),n.__selector=document.createElement("div"),n.__selector.className="selector",n.__saturation_field=document.createElement("div"),n.__saturation_field.className="saturation-field",n.__field_knob=document.createElement("div"),n.__field_knob.className="field-knob",n.__field_knob_border="2px solid ",n.__hue_knob=document.createElement("div"),n.__hue_knob.className="hue-knob",n.__hue_field=document.createElement("div"),n.__hue_field.className="hue-field",n.__input=document.createElement("input"),n.__input.type="text",n.__input_textShadow="0 1px 1px ",jb.bind(n.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),jb.bind(n.__input,"blur",h),jb.bind(n.__selector,"mousedown",(function(){jb.addClass(this,"drag").bind(window,"mouseup",(function(){jb.removeClass(i.__selector,"drag")}))})),jb.bind(n.__selector,"touchstart",(function(){jb.addClass(this,"drag").bind(window,"touchend",(function(){jb.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),jb.bind(window,"mousemove",f),jb.bind(window,"touchmove",f),jb.bind(window,"mouseup",l),jb.bind(window,"touchend",l)}function u(e){p(e),jb.bind(window,"mousemove",p),jb.bind(window,"touchmove",p),jb.bind(window,"mouseup",c),jb.bind(window,"touchend",c)}function l(){jb.unbind(window,"mousemove",f),jb.unbind(window,"touchmove",f),jb.unbind(window,"mouseup",l),jb.unbind(window,"touchend",l),d()}function c(){jb.unbind(window,"mousemove",p),jb.unbind(window,"touchmove",p),jb.unbind(window,"mouseup",c),jb.unbind(window,"touchend",c),d()}function h(){var e=xb(this.value);!1!==e?(i.__color.__state=e,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__saturation_field.getBoundingClientRect(),r=e.touches&&e.touches[0]||e,n=r.clientX,o=r.clientY,a=(n-t.left)/(t.right-t.left),s=1-(o-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),i.__color.v=s,i.__color.s=a,i.setValue(i.__color.toOriginal()),!1}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__hue_field.getBoundingClientRect(),r=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return r>1?r=1:r<0&&(r=0),i.__color.h=360*r,i.setValue(i.__color.toOriginal()),!1}return gb.extend(n.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),gb.extend(n.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:n.__field_knob_border+(n.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),gb.extend(n.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),gb.extend(n.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),gb.extend(a.style,{width:"100%",height:"100%",background:"none"}),qb(a,"top","rgba(0,0,0,0)","#000"),gb.extend(n.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=n.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",gb.extend(n.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:n.__input_textShadow+"rgba(0,0,0,0.7)"}),jb.bind(n.__saturation_field,"mousedown",s),jb.bind(n.__saturation_field,"touchstart",s),jb.bind(n.__field_knob,"mousedown",s),jb.bind(n.__field_knob,"touchstart",s),jb.bind(n.__hue_field,"mousedown",u),jb.bind(n.__hue_field,"touchstart",u),n.__saturation_field.appendChild(a),n.__selector.appendChild(n.__field_knob),n.__selector.appendChild(n.__saturation_field),n.__selector.appendChild(n.__hue_field),n.__hue_field.appendChild(n.__hue_knob),n.domElement.appendChild(n.__input),n.domElement.appendChild(n.__selector),n.updateDisplay(),n}return Ib(t,e),kb(t,[{key:"updateDisplay",value:function(){var e=xb(this.getValue());if(!1!==e){var t=!1;gb.each(Cb.COMPONENTS,(function(r){if(!gb.isUndefined(e[r])&&!gb.isUndefined(this.__color.__state[r])&&e[r]!==this.__color.__state[r])return t=!0,{}}),this),t&&gb.extend(this.__color.__state,e)}gb.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,n=255-r;gb.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,qb(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),gb.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+n+","+n+","+n+",.7)"})}}]),t}(Ob),Xb=["-moz-","-o-","-webkit-","-ms-",""];function qb(e,t,r,n){e.style.background="",gb.each(Xb,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+r+" 0%, "+n+" 100%); "}))}var Qb='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',Zb=function(e,t){var r=e[t];return gb.isArray(arguments[2])||gb.isObject(arguments[2])?new Bb(e,t,arguments[2]):gb.isNumber(r)?gb.isNumber(arguments[2])&&gb.isNumber(arguments[3])?gb.isNumber(arguments[4])?new Hb(e,t,arguments[2],arguments[3],arguments[4]):new Hb(e,t,arguments[2],arguments[3]):gb.isNumber(arguments[4])?new Gb(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Gb(e,t,{min:arguments[2],max:arguments[3]}):gb.isString(r)?new Ub(e,t):gb.isFunction(r)?new Yb(e,t,""):gb.isBoolean(r)?new zb(e,t):null},Kb=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},Jb=function(){function e(){Mb(this,e),this.backgroundElement=document.createElement("div"),gb.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),jb.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),gb.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;jb.bind(this.backgroundElement,"click",(function(){t.hide()}))}return kb(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),gb.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",jb.unbind(e.domElement,"webkitTransitionEnd",t),jb.unbind(e.domElement,"transitionend",t),jb.unbind(e.domElement,"oTransitionEnd",t)};jb.bind(this.domElement,"webkitTransitionEnd",t),jb.bind(this.domElement,"transitionend",t),jb.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-jb.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-jb.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var r=t||document,n=document.createElement("style");n.type="text/css",n.innerHTML=e;var i=r.getElementsByTagName("head")[0];try{i.appendChild(n)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var ex=function(){try{return!!window.localStorage}catch(e){return!1}}(),tx=void 0,rx=!0,nx=void 0,ix=!1,ox=[],ax=function e(t){var r=this,n=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),jb.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=gb.defaults(n,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),n=gb.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),gb.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),gb.isUndefined(n.parent)&&n.hideable&&ox.push(this),n.resizable=gb.isUndefined(n.parent)&&n.resizable,n.autoPlace&&gb.isUndefined(n.scrollable)&&(n.scrollable=!0);var i,o=ex&&"true"===localStorage.getItem(dx(this,"isLocal")),a=void 0,s=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return r.parent?r.getRoot().preset:n.load.preset},set:function(e){r.parent?r.getRoot().preset=e:n.load.preset=e,function(e){for(var t=0;t1){var n=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:n,factoryArgs:[gb.toArray(arguments)]})}if(gb.isArray(t)||gb.isObject(t)){var i=r.__li.nextElementSibling;return r.remove(),hx(e,r.object,r.property,{before:i,factoryArgs:[t]})}},name:function(e){return r.__li.firstElementChild.firstElementChild.innerHTML=e,r},listen:function(){return r.__gui.listen(r),r},remove:function(){return r.__gui.remove(r),r}}),r instanceof Hb){var n=new Gb(r.object,r.property,{min:r.__min,max:r.__max,step:r.__step});gb.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=r[e],i=n[e];r[e]=n[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(n,e),t.apply(r,e)}})),jb.addClass(t,"has-slider"),r.domElement.insertBefore(n.domElement,r.domElement.firstElementChild)}else if(r instanceof Gb){var i=function(t){if(gb.isNumber(r.__min)&&gb.isNumber(r.__max)){var n=r.__li.firstElementChild.firstElementChild.innerHTML,i=r.__gui.__listening.indexOf(r)>-1;r.remove();var o=hx(e,r.object,r.property,{before:r.__li.nextElementSibling,factoryArgs:[r.__min,r.__max,r.__step]});return o.name(n),i&&o.listen(),o}return t};r.min=gb.compose(i,r.min),r.max=gb.compose(i,r.max)}else r instanceof zb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__checkbox,"click")})),jb.bind(r.__checkbox,"click",(function(e){e.stopPropagation()}))):r instanceof Yb?(jb.bind(t,"click",(function(){jb.fakeEvent(r.__button,"click")})),jb.bind(t,"mouseover",(function(){jb.addClass(r.__button,"hover")})),jb.bind(t,"mouseout",(function(){jb.removeClass(r.__button,"hover")}))):r instanceof $b&&(jb.addClass(t,"color"),r.updateDisplay=gb.compose((function(e){return t.style.borderLeftColor=r.__color.toString(),e}),r.updateDisplay),r.updateDisplay());r.setValue=gb.compose((function(t){return e.getRoot().__preset_select&&r.isModified()&&lx(e.getRoot(),!0),t}),r.setValue)}(e,u,i),e.__controllers.push(i),i}function dx(e,t){return document.location.href+"."+t}function fx(e,t,r){var n=document.createElement("option");n.innerHTML=t,n.value=t,e.__preset_select.appendChild(n),r&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function px(e,t){t.style.display=e.useLocalStorage?"block":"none"}function vx(e){var t=e.__save_row=document.createElement("li");jb.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),jb.addClass(t,"save-row");var r=document.createElement("span");r.innerHTML=" ",jb.addClass(r,"button gears");var n=document.createElement("span");n.innerHTML="Save",jb.addClass(n,"button"),jb.addClass(n,"save");var i=document.createElement("span");i.innerHTML="New",jb.addClass(i,"button"),jb.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",jb.addClass(o,"button"),jb.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?gb.each(e.load.remembered,(function(t,r){fx(e,r,r===e.preset)})):fx(e,"Default",!1),jb.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=gx(this)),e.folders={},gb.each(this.__folders,(function(t,r){e.folders[r]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=gx(this),lx(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=gx(this,!0)),this.load.remembered[e]=gx(this),this.preset=e,fx(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){gb.each(this.__controllers,(function(t){this.getRoot().load.remembered?cx(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),gb.each(this.__folders,(function(e){e.revert(e)})),e||lx(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&Kb.call(window,(function(){e(t)})),gb.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){gb.each(this.__controllers,(function(e){e.updateDisplay()})),gb.each(this.__folders,(function(e){e.updateDisplay()}))}});var yx=ax,_x=function(){function e(e){this.player=e}return Object.defineProperty(e.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(e){this.player.updateConfig({resolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var e,t;return(null===(e=this.player.view)||void 0===e?void 0:e.width)+"*"+(null===(t=this.player.view)||void 0===t?void 0:t.height)},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(e){this.player.updateConfig({minFPS:e,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(e){this.player.updateConfig({maxFPS:e,minFPS:this.player.config.minFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(e){this.player.updateConfig({autoResolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(e){this.player.updateConfig({autoFPS:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(e){this.player.updateConfig({transactionBgColor:e})},enumerable:!1,configurable:!0}),e}(),bx=function(){function e(e,t){var r;this.config=new _x(e),this.anchor=t,r=this.createControllerGUI(),this.gui=r[0],this.controller=r[1],this.createStats()}return e.prototype.createStats=function(){var e=this;this.stateId=setInterval((function(){e.controller.frameRate.updateDisplay(),e.controller.size.updateDisplay(),e.controller.minFPS.updateDisplay(),e.controller.drawFrames.updateDisplay(),e.controller.maxFPS.updateDisplay(),e.controller.resolution.updateDisplay(),e.controller.autoFps.updateDisplay(),e.controller.autoResolution.updateDisplay(),e.controller.drawCall.updateDisplay()}),16)},e.prototype.createControllerGUI=function(){var e=new yx({autoPlace:!0,closed:!0});e.domElement.style.opacity=".6",e.domElement.style.transformOrigin="100% 0",e.domElement.style.transform="scale(1)",this.anchor.appendChild(e.domElement),e.domElement.style.position="absolute",e.domElement.style.right="0",e.domElement.style.top="0",e.domElement.style.zIndex="2";var t={frameRate:e.add(this.config,"frameRate"),drawFrames:e.add(this.config,"drawFrames"),drawCall:e.add(this.config,"drawCall"),size:e.add(this.config,"size"),minFPS:e.add(this.config,"minFPS",0,60),maxFPS:e.add(this.config,"maxFPS",0,60),resolution:e.add(this.config,"resolution",.5,8,.5),autoResolution:e.add(this.config,"autoResolution"),autoFps:e.add(this.config,"autoFPS"),transactionBgColor:e.addColor(this.config,"backgroundColor")};return[e,t]},e.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch(e){}},e}(),xx=function(){function e(e){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&t.fn(e).then((function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))},this.fn=e}return e.prototype.destroy=function(){this.isDestroy=!0},e.prototype.addTask=function(e){this.tasks.push(e),this.isScheduling||this.schedule()},e}(),wx=function(){function e(e){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=e}return e.prototype.addLock=function(e,t){var r=this;this.available&&(this.locks[e]=t,this.autoUnlock[e]=window.setTimeout((function(){delete r.locks[e]}),3e3))},e.prototype.unlock=function(e,t){this.available&&t&&this.locks[e]&&this.locks[e]===t&&(window.clearTimeout(this.autoUnlock[e]),delete this.locks[e])},e.prototype.isLocked=function(e){return!!this.available&&!!this.locks[e]},e}(),Sx=function(){function e(){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var t=e.tasks.shift();t&&!e.isDestroy&&(t.status="running",t.fn.apply(null).then((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})).catch((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})))}}return e.prototype.getRunningTask=function(){return this.tasks[0]&&"running"===this.tasks[0].status?this.tasks[0]:null},e.prototype.addTask=function(e,t){var r={type:e,status:"wait",fn:t},n=this.getRunningTask();n&&e===n.type||(this.tasks=this.tasks.filter((function(t){return t.type!==e})),this.tasks.push(r),this.isScheduling||this.schedule())},e.prototype.destroy=function(){this.isDestroy=!0},e}(),Tx=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Mx=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.config.buffer||e))return[2];t=this.logList.splice(0),r=function(){i.logList=t.concat(i.logList),i.retryTimes>3&&i.pause(),i.retryTimes+=1},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:t})})];case 2:return o.sent().ok?this.retryTimes=0:r(),[3,4];case 3:return n=o.sent(),console.warn(n),r(),[3,4];case 4:return[2]}}))}))},e.prototype.setEnable=function(e){this.enable!==e&&(e?this.start():this.pause())},e}();function Ex(e,t,r,n){return function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var i,o,a,s;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(r=e.replace(/^.*__internal__/,""),t=this.resourceList.find((function(e){return e.indexOf(r)>=0}))||e),this.config.urlInterrupter?[2,this.config.urlInterrupter(t)]:[2,Promise.resolve(t)]}))}))},n.userInputHandle=function(){n.userInputTime=Date.now()},n.handleViewTouchStart=function(){window.clearTimeout(n.touchStartId),n.isTouchStart=!0,n.touchStartId=setTimeout((function(){n.isTouchStart=!1}),350)},n.handleViewTouchEnd=function(){n.isTouchStart&&(n.isTouchStart=!1,n.handleViewClick())},n.handleSlideRef=function(){console.log(n),window.__slide=n},n.receiveSyncHandler=function(e){return Px(n,void 0,void 0,(function(){var t,r,n,i,o,a=this;return Nx(this,(function(s){switch(s.label){case 0:return Sv()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(Lx.syncEventLag),this._receiveIncrId=e.incrId||0),this.logger.info("sync receive "+JSON.stringify(e),this.taskId),"nextStep"!==e.type?[3,1]:(this.mainSeqStep!==e.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(e.next,"start"),this.player.nextTick((function(){a.doNextStep(!0,e.clientId||"")}))):this.doNextStep(!0,e.clientId||""),[3,6]);case 1:return"prevStep"!==e.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===e.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(e.next+1,"start"),null===(t=this.player)||void 0===t||t.nextTick((function(){a.doPrevStep(!0)}))),[3,6]);case 2:return"interactiveAnim"!==e.type?[3,3]:(this.player?this.player.applyInteractiveAction(e.action):this.__slideState.interactiveSeqState[e.seqId]?this.__slideState.interactiveSeqState[e.seqId].step+=1:this.__slideState.interactiveSeqState[e.seqId]={step:0,state:"end"},[3,6]);case 3:return"renderSlide"!==e.type?[3,5]:[4,this.doRenderSlide(e.index,e.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===e.type?(null===(r=this.player)||void 0===r||r.setMediaState(e.id,!0),this.__slideState.mediaState[e.id]=e.state):"mediaPause"===e.type?(null===(n=this.player)||void 0===n||n.setMediaState(e.id,!1),this.__slideState.mediaState[e.id]=e.state):"mediaSeek"===e.type?(null===(i=this.player)||void 0===i||i.setMediaCurrentTime(e.id,e.time),this.__slideState.mediaState[e.id]=e.state):"mediaFullscreen"===e.type&&(e.targetId&&this.__slideState.mediaState[e.targetId]?this.__slideState.mediaState[e.targetId].fullscreen=e.state:this.__slideState.mediaState[e.targetId]={fullscreen:e.state,type:"pause",time:0},null===(o=this.player)||void 0===o||o.syncFullscreenVideoState({targetId:e.targetId,state:e.state,slideIndex:e.slideIndex})),s.label=6;case 6:return[2]}}))}))},n.flushDebounce=function(){n.resizeView.flush(),n.handleViewClick.flush()},n.handlePrevSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.prevSlideIndex)>=1&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!1):this.renderSlide(t,!1)),[2]):[2]}))}))},n.handleNextSlide=function(e){return void 0===e&&(e=!1),Px(n,void 0,void 0,(function(){var t,r;return Nx(this,(function(n){return this.player?((t=this.player.nextSlideIndex)<=this.slideCount&&((null===(r=this.config.navigatorDelegate)||void 0===r?void 0:r.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!0):this.renderSlide(t,!0)),[2]):[2]}))}))},n.handleGotoSlide=function(e){if(e<=n.slideCount&&e>=1){var t=n.slideState.currentSlideIndex<=e;n.renderSlide(e,t)}else-1===e&&n.renderSlide(n.slideCount,!0)},t.instances.push(n),n.config=n.initSlideConfig(r),n.tracker=function(e){r.whiteTracker&&r.whiteTracker.commit({name:e.name,reason:e.reason,result:e.result,payload:Cx(Cx({},e.payload),{slideId:n.randomId,taskId:n.taskId})},{slideVersion:n.version||""})},t.trackLogger.setEnable(!!n.config.enableTracking),n.logger={info:function(e,r){var i;t.appendLogString("INFO - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"info",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.info;o&&o("["+r+"] "+e)},warn:function(e,r){var i;t.appendLogString("WARN - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"warn",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.warn;o&&o("["+r+"] "+e)},error:function(e,r){var i;t.appendLogString("ERROR - "+(new Date).toISOString()+" - {"+n.randomId+"}["+r+"] "+e+"\n"),t.trackLogger.addLog(e,"error",r,n.randomId);var o=null===(i=n.config.logger)||void 0===i?void 0:i.error;o&&o("["+r+"] "+e)}},n.logger.info("new slide with clientId: "+n.config.clientId+", version: "+n.version,n.taskId),n.tracker({name:"initSlide",result:"",reason:"",payload:{taskId:n.taskId}}),n.anchor=n.config.anchor,n.syncQueue=new xx(n.receiveSyncHandler),n.lock=new wx("interactive"===n.mode),n.cacheImage.style.position="absolute",n.cacheImage.style.zIndex="100",n.setMedianControllerAttribute(),n.canvasContainer.style.position="relative",n.canvasContainer.style.fontSize="0",n.canvasContainer.appendChild(n.medianController),n.frame.appendChild(n.canvasContainer),n.frameResizeObserver.observe(n.frame),n.on(Lx.syncReceive,(function(e){n.lock.unlock(e.type,e.uuid),n.syncQueue.addTask(e)})),n.renderingTaskManager.eventHub.on("task-error",(function(e){var t=e.error,r=e.task,i=nv.transform(t);i.errorType===Zp.RuntimeWarn?n.logger.warn(i.message,n.taskId):n.logger.error(i.message,n.taskId),n.isLoading=!1,n.reportError(i,r.slideIndex)})),window.addEventListener("__slide_ref__",n.handleSlideRef),n.resizeView=k_()(n.resizeView.bind(n),50),n.player=n.initPlayer(n.config),n.config.controller&&n.createController(),n.player.view&&n.canvasContainer.appendChild(n.player.view),n.handleViewClick=k_()(n.handleViewClick,300),n.player.errorChannel.on("error",(function(e,t){var r=nv.transform(e);r.errorType===Zp.RuntimeWarn?n.logger.warn(r.message,n.taskId):n.logger.error(r.message,n.taskId),n.isLoading=!1,n.reportError(e,t),n.tracker({name:"slideError",reason:r.errorMsg,result:"",payload:{code:r.errorType}})})),window.addEventListener("message",n.recoverHandler),t.volumeAdjuster.on("update",n._updateVolumeByStaticAdjuster),n.volumeAdjuster.volume=t.volumeAdjuster.volume,n}var r,n;return Ax(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),Px(this,void 0,void 0,(function(){return Nx(this,(function(r){switch(r.label){case 0:if(!(t._tempLog.length>131072||e&&t._tempLog.length>0))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,null==Bx?void 0:Bx.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:case 3:return r.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,r.label=5;case 5:return[2]}}))}))},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(e){return Px(this,void 0,void 0,(function(){var r,n,i,o,a;return Nx(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!Bx)return[3,13];r=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return r=(s.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return s.sent(),[3,5];case 5:n=0,i=r,s.label=6;case 6:if(!(n500&&e.enableGlobalClick&&e.nextStep()}))},t.prototype.createController=function(){this.player&&(this.playerController=new bx(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2",this.medianController.style.fontSize="16px"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var e=this.frame.getBoundingClientRect(),t=e.width,r=e.height;this.frameWidth=t,this.frameHeight=r,this.resizeView()}},t.prototype.updateFixedFrameSize=function(e,t,r){this.config.fixedFrameSize&&(this.frameWidth=e,this.frameHeight=t,this.frame.style.width=e+"px",this.frame.style.height=t+"px",this.resizeView(r))},t.prototype._resizeView=function(e){var t,r,n=this,i=this.width,o=this.height;if(i>0&&o>0){var a=this.frameWidth/i,s=a*o;s>this.frameHeight&&(a*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(a,this.resize,e),this.cacheImage.style.transform="scale("+a+")",this.medianController.style.transform="scale("+a+")",this.medianController.setAttribute("data-scale",a.toString()),this.isInitResized||(this.isInitResized=!0,null===(r=this.player)||void 0===r||r.clock.setTimeout((function(){n.frame.style.visibility="visible"}),32))}},t.prototype.setSlideState=function(e){var t,r,n;return Px(this,void 0,void 0,(function(){var i,o=this;return Nx(this,(function(a){switch(a.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,null===(t=this.player)||void 0===t||t.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,null===(r=this.player)||void 0===r||r.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,null===(n=this.player)||void 0===n?void 0:n.clock.waitUntil((function(){var t,r;return(null===(t=o.player)||void 0===t?void 0:t.currentIndex)===e.currentSlideIndex&&(null===(r=o.player)||void 0===r?void 0:r.currentStage)}),3e3)];case 3:return a.sent(),i=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(i=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(i=!0,this.__slideState.mainSeqState=e.mainSeqState),i&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),[4,Rx(1500)];case 4:return a.sent(),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),this.isSyncingSlideState=!1,[2]}}))}))},t.prototype.initInteractiveSeq=function(e){var t;for(var r in e.interactiveSeqState){var n=e.interactiveSeqState[r];null===(t=this.player)||void 0===t||t.setInteractiveSeqState(r,n.step,"idle"===n.state?"start":"end")}},t.prototype.initMedia=function(e){var t,r,n;for(var i in e.mediaState){var o=e.mediaState[i],a=this.__slideState.mediaState[i];if(null===(t=this.player)||void 0===t||t.syncFullscreenVideoState({targetId:i,state:!!o.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!a||o.type!==a.type||o.time!==a.time)if("play"===o.type){var s=(this.timestamp()-o.time)/1e3;null===(r=this.player)||void 0===r||r.setMediaState(i,!0,s)}else null===(n=this.player)||void 0===n||n.setMediaState(i,!1,o.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,t.sent().json()];case 3:return[2,[(e=t.sent()).width,e.height]];case 4:return t.sent(),[2,[0,0]];case 5:return[2]}}))}))},t.prototype.getSlideCountAsync=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,t){var r;this.taskId=e,null===(r=this.player)||void 0===r||r.setResourceData(e,t),this.__slideState.taskId=e,this.__slideState.url=t,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:t})},t.prototype.setResourceList=function(e,t){var r;this.taskId=e,this.resourceList=t,null===(r=this.player)||void 0===r||r.setResourceData(e,"__internal__"),this.__slideState.taskId=e,this.__slideState.url="__internal__"},t.prototype._renderSlide=function(e){var t;return Px(this,void 0,void 0,(function(){var r=this;return Nx(this,(function(n){switch(n.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),this.flushDebounce(),[4,null===(t=this.player)||void 0===t?void 0:t.renderSlide(e)]);case 1:return n.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout((function(){var e,t;if("hidden"===(null===(t=null===(e=r.player)||void 0===e?void 0:e.view)||void 0===t?void 0:t.style.visibility)&&(r.player.view.style.visibility="visible"),"hidden"===r.frame.style.visibility&&(r.frame.style.visibility="visible"),r.needClearCacheImage)try{r.frame.removeChild(r.cacheImage)}catch(e){r.logger.error("removeChild error Slide.ts:1553",r.taskId)}}),100),[2]}}))}))},t.prototype.renderSlide=function(e,t){if(void 0===t&&(t=!0),this.player){var r=Number(e);(r!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(r>this.slideCount&&this.slideCount>0||this.poseRenderSlide(r,t))}},t.prototype.needCreateNewPlayer=function(){var e=b_.platform.isLowGpuMemory()?15:30;return(b_.platform.isIOS()||b_.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,t){"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t}):"sync"===this.mode?(this.doRenderSlide(e,t),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t})):this.doRenderSlide(e,t)},t.prototype.doRenderSlide=function(e,t){var r,n,i,o=this;if(void 0===t&&(t=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var a=this.player.getSnapshot();this.cacheImage.src=a,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(r=this.playerController)||void 0===r||r.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,(null===(n=this.config)||void 0===n?void 0:n.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(i=null==this?void 0:this.player)||void 0===i?void 0:i.view)&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var s=Math.random().toString(32).substr(2);return this.player.isForward=t,this.renderingTaskManager.addTask((function(){return o._renderSlide(e)}),e,s),new Promise((function(e){o.renderingTaskManager.eventHub.once("task-end-"+s,e)}))},t.prototype.getSnapshot=function(){var e,t;return null!==(t=null===(e=this.player)||void 0===e?void 0:e.getSnapshot())&&void 0!==t?t:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(Lx.slideStepEnd),this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doNextStep=function(e,t){if(this.player){var r=!this.config.clientId||t===this.config.clientId;this.player.nextStep(e,r);var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(Lx.slideStepStart),this.player.mainSeqHasPrevStep()?"interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(e){if(void 0===e&&(e=!1),this.player){this.player.prevStep(e);var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var e=this.slideState;!T_()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(Lx.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var t=Math.random().toString(32).substr(2);this.lock.addLock(e.type,t);var r=Cx(Cx({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(r.incrId=this.dispatchIncrId),this.emit(Lx.syncDispatch,r),this.logger.info("sync dispatch "+JSON.stringify(r),this.taskId)}},t.prototype.setMainSeqStep=function(e,t){var r;null===(r=this.player)||void 0===r||r.setMainSeqStep(e,t)},t.prototype.setInteractive=function(e){var t;this.interactive=e,null===(t=this.player)||void 0===t||t.setInteractive(e)},t.prototype.pause=function(){var e;null===(e=this.player)||void 0===e||e.pause()},t.prototype.resume=function(){var e;null===(e=this.player)||void 0===e||e.resume()},t.prototype._doFrozen=function(){var e;return Px(this,void 0,void 0,(function(){var t,r,n,i=this;return Nx(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.tracker({name:"frozenSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.view&&this.player?[4,this.player.clock.waitUntil((function(){return!i.isLoading}),6e4)]:[3,2];case 1:for(r in o.sent(),t=this.player.getSnapshot()||"",this.cacheImage.src=t,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(e=this.playerController)||void 0===e||e.destroy(),this.player=void 0,this.__slideState.mediaState)n=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Cx(Cx({},n),{frozenTime:this.timestamp()});o.label=2;case 2:return[2]}}))}))},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",(function(){return e._doFrozen()}))},t.prototype._doRelease=function(){var e,t;return Px(this,void 0,void 0,(function(){var r,n,i,o;return Nx(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",this.taskId),this.tracker({name:"releaseSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.player)return[2];for(n in this.player=this.initPlayer(this.config),(null===(e=this.config)||void 0===e?void 0:e.controller)&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=I_()(jx),r.mediaState)"play"===(i=r.mediaState[n]).type&&(o=Math.max(null!==(t=i.frozenTime)&&void 0!==t?t:0,i.time),i.time=this.timestamp()-(o-i.time),i.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return a.sent(),[4,this.player.clock.delay(333)];case 2:a.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch(e){this.logger.error("removeChild error Slide.ts:1934",this.taskId)}return[2]}}))}))},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",(function(){return e._doRelease()}))},t.prototype._doDestroy=function(){var e,r,n,i,o=this;this.logger.info("do destroy slide",this.taskId),this.tracker({name:"destroySlide",reason:"",result:"",payload:{taskId:this.taskId}});var a=t.instances.findIndex((function(e){return e.randomId===o.randomId}));if(a>=0&&t.instances.splice(a,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(e=this.player)||void 0===e||e.removeAllListeners(),null===(r=this.player)||void 0===r||r.destroy(),null===(n=this.player)||void 0===n||n.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners(),null===(i=this.player)||void 0===i?void 0:i.view)try{this.anchor.removeChild(this.player.view)}catch(e){this.logger.error("removeChild error Slide.ts:1982",this.taskId)}try{this.anchor.removeChild(this.frame)}catch(e){this.logger.error("removeChild error Slide.ts:1988",this.taskId)}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return Px(this,void 0,void 0,(function(){var e;return Nx(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,Rx(100)]:[3,3];case 2:return t.sent(),e+=1,[3,1];case 3:return[2]}}))}))},t.prototype.preload=function(e){return this.player?this.player.preload(e):Promise.resolve()},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then((function(){e._doDestroy()})):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;null===(e=this.player)||void 0===e||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,t=0===this.mainSeqLength||this.mainSeqStep>=this.mainSeqLength-1,r="end"===this.mainSeqState||"running"===this.mainSeqState||null==this.mainSeqState;return!(e&&t&&r)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=1===this.player.currentIndex,t=0===this.mainSeqLength||0===this.mainSeqStep,r="idle"===this.mainSeqState||null===this.mainSeqState;return!(e&&t&&r)},t.prototype.snapshot=function(){return Px(this,void 0,void 0,(function(){return Nx(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return Px(this,void 0,void 0,(function(){return Nx(this,(function(t){return this.player?[2,this.player.snapshotWithTimingEnd(e)]:[2,null]}))}))},t.prototype.updateGlobalVolume=function(e){this.volumeAdjuster.volume=e},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){b_.clearLocalCache()},t.disposeLocalCache=function(){},r=t,t.preloadResource=Ex,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(e){var r,n;e.context({logger:{info:function(e){t.appendLogString("INFO - "+(new Date).toISOString()+" - "+e+"\n")},warn:function(e){t.appendLogString("WARN - "+(new Date).toISOString()+" - "+e+"\n")},error:function(e){t.appendLogString("ERROR - "+(new Date).toISOString()+" - "+e+"\n")}}}),r=e,(n=w_.get(r.hookPoint)||[]).push(r),w_.set(r.hookPoint,n)},t.volumeAdjuster=new m_,t.trackLogger=new kx,t.handleFrozenAllSlide=function(){t.instances.forEach((function(e){e.player&&(t._tempFrozenIds.push(e.randomId),e.frozen())}))},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach((function(e){var r=t.instances.find((function(t){return t.randomId===e}));r&&r.release()})),t._tempFrozenIds=[]},t.handleLogReport=function(e){return Px(void 0,void 0,void 0,(function(){var n,i,o,a,s,u;return Nx(r,(function(r){switch(r.label){case 0:return[4,t.flushLog(!0)];case 1:if(r.sent(),!Bx)return[3,12];n=[],r.label=2;case 2:return r.trys.push([2,4,,5]),[4,Bx.keys()];case 3:return n=(r.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return r.sent(),[3,5];case 5:if(0===n.length)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:e},"*"),[2];i=0,o=n,r.label=6;case 6:if(!(i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);o>3&&a&&Object.defineProperty(t,r,a)}([(n="Slide.initConfig",function(e,t,r){var i=r.value;r.value=function(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?F(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),r=e();return r?this.addDisposer(r,t):t}},{key:"addEventListener",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,r,n),this.addDisposer((function(){return e.removeEventListener(t,r,n)}),i),i}},{key:"setTimeout",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){r.remove(n),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),n)}},{key:"setInterval",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),n=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(n)}),r)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(B),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=z()}while(this.disposers.has(e));return e}}]),e}();function F(e){return function(){return e.forEach(B)}}function W(e,t,r){return Math.min(Math.max(e,t),r)}var G={exports:{}},V={exports:{}},H=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Y=Array.prototype.concat,$=Array.prototype.slice,X=V.exports=function(e){for(var t=[],r=0,n=e.length;r=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},ee.to.keyword=function(e){return K[e.slice(0,3)]};var ne=G.exports,ie=function(){function e(t){var r=this;x(this,e),this.enable=t,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=function(e){var t,n;e instanceof CustomEvent?t=e.detail:"object"===T(n=e.data)&&null!==n&&(t=e.data),t&&("boolean"==typeof t.slide?r.enable=t.slide:"__instance"===t.slide?console.log(r):"__debug"===t.slide&&Object.values(r.apps).forEach((function(e){var t,r;null==(r=null==(t=e.controller)?void 0:t.slide)||r.createController()})))},this.initialize()}return S(e,[{key:"setAppContext",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).context=t,this.log("[Slide] new ".concat(e))}},{key:"setAppController",value:function(e,t){var r;((r=this.apps)[e]||(r[e]={})).controller=t}},{key:"deleteApp",value:function(e){delete this.apps[e],this.log("[Slide] delete ".concat(e))}},{key:"initialize",value:function(){window.addEventListener("message",this._onMessage)}},{key:"dispose",value:function(){window.removeEventListener("message",this._onMessage)}},{key:"log",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).info.apply(e,arguments);else if(this.enable){var t;(t=console).log.apply(t,arguments)}}},{key:"verbose",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).debug.apply(e,arguments);else if(this.enable&&"verbose"===this.level){var t;(t=console).log.apply(t,arguments)}}},{key:"warn",value:function(){var e,t;this.roomLogger?(e=this.roomLogger).warn.apply(e,arguments):(t=console).warn.apply(t,arguments)}}]),e}(),oe=new ie(!1),ae=oe.log.bind(oe),se=oe.verbose.bind(oe);function ue(e){try{var t=window.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"!==t&&"transparent"!==t)return t;if(e.parentElement)return ue(e.parentElement)}catch(e){}return"#ffffff"}var le="";function ce(e){return le||(le=function(e){var t=ne.get(e);if(t&&"rgb"===t.model){var r=t.value,n=(((255&Math.round(r[0]))<<16)+((255&Math.round(r[1]))<<8)+(255&Math.round(r[2]))).toString(16);return"#"+"000000".substring(n.length)+n}return e}(ue(e)),ae("[Slide] guess bg color",le)),le}var he=function(e){return e.tracker};function de(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.width,n=e.height,i=e.slideCount,o=e.slideState,a=o.taskId,s=o.url,u=[],l=function(e){var i=t.find((function(t){return t.indexOf("preview/".concat(e,".png"))>=0}));i?u.push({width:r,height:n,thumbnail:i,src:"ppt"}):u.push({width:r,height:n,thumbnail:"".concat(s,"/").concat(a,"/preview/").concat(e,".png"),src:"ppt"})},c=1;c<=i;++c)l(c);return u}function fe(e,t,r,n){var i,o=r.slideState.currentSlideIndex;if(o>0&&t.getIsWritable()){var a=[n,o].join("/");if("page"!==e.scenePathType(a)){e.removeScenes(n);for(var s=r.slideCount,u=[],l=1;l<=s;++l)u.push({name:"".concat(l)});e.putScenes(n,u)}(t.getBox().focus?e.state.sceneState.scenePath:(null==(i=t.getView())?void 0:i.focusScenePath)||"")!==a&&t.setScenePath(a)}}var pe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=pe;var ve={taskId:"",url:"",state:null,resourceList:[],previewList:[]},me=function(){},ge=function(){function e(t){var r,n=this,i=t.context,o=t.anchor,a=t.onRenderStart,s=t.onPageChanged,u=t.onTransitionStart,c=t.onTransitionEnd,h=t.onNavigate,d=t.onError,f=t.onRenderError,p=t.showRenderError,v=t.invisibleBehavior;x(this,e),this.sideEffect=new U,this.previewList=[],this.ready=!1,this.readyPromise=new Promise((function(e){n.resolveReady=function(){n.ready?ae("[Slide] render end"):setTimeout((function(){n.ready=!0,e()}),1e3)}})),this.onSyncDispatch=function(e){if(n.context.getIsWritable()&&n.room){var t={type:L.SLIDE_EVENTS.syncDispatch,payload:e};se("[Slide] dispatch",JSON.stringify(e)),n.context.dispatchMagixEvent(L.SLIDE_EVENTS.syncDispatch,t)}},this.magixEventListener=function(e){var t=e.payload,r=t.type,i=t.payload;r===L.SLIDE_EVENTS.syncDispatch&&(n.syncStateOnce(),se("[Slide] receive",JSON.stringify(i)),n.slide.emit(L.SLIDE_EVENTS.syncReceive,i))},this.onStateChange=function(e){n.context.getIsWritable()&&(se("[Slide] state change",JSON.stringify(e,null,2)),n.context.storage.setState({state:e}))},this.pollCount=0,this.pollReadyState=function(){n.ready?1===n._toFreeze?n.freeze():-1===n._toFreeze&&n.unfreeze():n.pollCount<40?(n.pollCount++,setTimeout(n.pollReadyState,500)):(n.pollCount=0,ae("[Slide] init timeout"))},this._pageCount=0,this.destroyed=!1,this.timestamp=function(){return n.room&&n.room.calibrationTimestamp?n.room.calibrationTimestamp:n.player?n.player.beginTimestamp+n.player.progressTime:Date.now()},this.isFrozen=!1,this._toFreeze=0,this.freeze=function(){n.isFrozen=!0,n.ready?(ae("[Slide] freeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.frozen():n.slide.pause()):n._toFreeze=1},this.unfreeze=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.visible){e.next=2;break}return e.abrupt("return");case 2:n.isFrozen=!1,n.ready?(ae("[Slide] unfreeze",n.context.appId),"frozen"===n.invisibleBehavior?n.slide.release():n.slide.resume()):n._toFreeze=-1;case 4:case"end":return e.stop()}}),e)}))),this.onVisibilityChange=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n.visible="visible"===document.visibilityState)?(ae("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:n.savedIsFrozen}),n.savedIsFrozen||n.unfreeze()):(n.savedIsFrozen=n.isFrozen,ae("[Slide] freeze because tab becomes invisible"),n.freeze());case 1:case"end":return e.stop()}}),e)}))),this.invisibleBehavior=null!=v?v:"frozen",this.onRenderStart=a,this.onPageChanged=s,this.onTransitionStart=u,this.onTransitionEnd=c,this.onNavigate=h||me,this.onError=d,this.onRenderError=f,this.showRenderError=null==p||p,this.context=i,this.room=i.getRoom(),this.player=this.room?void 0:i.getDisplayer(),r=this.room||this.player,oe.roomLogger=r.logger,this.slide=this.createSlide(o,{whiteTracker:he(i.getDisplayer())}),this.syncStateOnceFlag=!this.context.isAddApp,this.visible="visible"===document.visibilityState,this.savedIsFrozen=!1,this.initialize()}return S(e,[{key:"jumpToPage",value:function(e,t){this.ready&&(e=W(e,1,this.pageCount),this.onNavigate(e,t),this.slide.renderSlide(e))}},{key:"initialize",value:function(){this.registerEventListeners(),this.kickStart()}},{key:"kickStart",value:function(){var e=this.context,t=this.slide;e.getIsWritable()&&e.storage.ensureState(ve);var r=e.storage.state,n=r.taskId,i=r.url,o=r.resourceList,a=r.previewList,s=r.state;this.previewList=a,o&&o.length>0?t.setResourceList(n,o):t.setResource(n,i||pe),s?(ae("[Slide] init with state",JSON.stringify(s)),this.syncStateOnceFlag=!1,t.setSlideState(s)):e.isAddApp&&(ae("[Slide] init by renderSlide",1),t.renderSlide(1)),this.pollReadyState()}},{key:"registerEventListeners",value:function(){var e=this,t=this.context,r=this.slide,n=this.sideEffect.addDisposer(t.storage.addStateChangedListener((function(){t.storage.state.state&&(e.syncStateOnce(),e.sideEffect.flush(n))})));this.sideEffect.add((function(){return t.addMagixEventListener(L.SLIDE_EVENTS.syncDispatch,e.magixEventListener,{fireSelfEventAfterCommit:!0})})),r.on(L.SLIDE_EVENTS.renderStart,this.onRenderStart),r.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),r.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),r.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),r.on(L.SLIDE_EVENTS.renderError,this.onError),r.on(L.SLIDE_EVENTS.stateChange,this.onStateChange),r.on(L.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),r.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add((function(){return document.addEventListener("visibilitychange",e.onVisibilityChange),function(){return document.removeEventListener("visibilitychange",e.onVisibilityChange)}}))}},{key:"syncStateOnce",value:function(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(ve);var e=this.context.storage.state.state;e&&(ae("[Slide] sync with state (once)",JSON.stringify(e)),this.slide.setSlideState(e),this.syncStateOnceFlag=!1)}}},{key:"createSlide",value:function(e){var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.context.getAppOptions()||{},a=new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=o.enableGlobalClick)||t,renderOptions:{minFPS:o.minFPS||25,maxFPS:o.maxFPS||30,autoFPS:null==(r=o.autoFPS)||r,autoResolution:null==(n=o.autoResolution)||n,resolution:o.resolution,transactionBgColor:o.bgColor||ce(e),maxResolutionLevel:o.maxResolutionLevel,forceCanvas:o.forceCanvas,enableNvidiaDetect:o.enableNvidiaDetect},fixedFrameSize:o.fixedFrameSize,loaderDelegate:o.loaderDelegate,navigatorDelegate:o.navigatorDelegate,urlInterrupter:o.urlInterrupter,resourceTimeout:o.resourceTimeout,rtcAudio:o.rtcAudio,useLocalCache:o.useLocalCache,logger:o.logger,whiteTracker:i.whiteTracker,timestamp:this.timestamp});return a}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.destroyed||(ae("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}},{key:"pageCount",get:function(){return this._pageCount>0||(this._pageCount=this.slide.slideCount),this._pageCount}},{key:"page",get:function(){return this.slide.slideState.currentSlideIndex}}]),e}();var ye="undefined"!=typeof window,_e=ye&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),be=ye&&"IntersectionObserver"in window,xe=ye&&"classList"in document.createElement("p"),we=ye&&window.devicePixelRatio>1,Se={elements_selector:".lazy",container:_e||ye?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Te=function(e){return Object.assign({},Se,e)},Me=function(e,t){var r,n="LazyLoad::Initialized",i=new e(t);try{r=new CustomEvent(n,{detail:{instance:i}})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(n,!1,!1,{instance:i})}window.dispatchEvent(r)},ke="src",Ee="srcset",Ie="sizes",Ae="poster",Ce="llOriginalAttrs",Pe="data",Ne="loading",Oe="loaded",Re="applied",De="error",Le="native",je="data-",ze="ll-status",Be=function(e,t){return e.getAttribute(je+t)},Ue=function(e){return Be(e,ze)},Fe=function(e,t){return function(e,t,r){var n=je+t;null!==r?e.setAttribute(n,r):e.removeAttribute(n)}(e,ze,t)},We=function(e){return Fe(e,null)},Ge=function(e){return null===Ue(e)},Ve=function(e){return Ue(e)===Le},He=[Ne,Oe,Re,De],Ye=function(e,t,r,n){e&&(void 0===n?void 0===r?e(t):e(t,r):e(t,r,n))},$e=function(e,t){xe?e.classList.add(t):e.className+=(e.className?" ":"")+t},Xe=function(e,t){xe?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},qe=function(e){return e.llTempImage},Qe=function(e,t){if(t){var r=t._observer;r&&r.unobserve(e)}},Ze=function(e,t){e&&(e.loadingCount+=t)},Ke=function(e,t){e&&(e.toLoadCount=t)},Je=function(e){for(var t,r=[],n=0;t=e.children[n];n+=1)"SOURCE"===t.tagName&&r.push(t);return r},et=function(e,t){var r=e.parentNode;r&&"PICTURE"===r.tagName&&Je(r).forEach(t)},tt=function(e,t){Je(e).forEach(t)},rt=[ke],nt=[ke,Ae],it=[ke,Ee,Ie],ot=[Pe],at=function(e){return!!e[Ce]},st=function(e){return e[Ce]},ut=function(e){return delete e[Ce]},lt=function(e,t){if(!at(e)){var r={};t.forEach((function(t){r[t]=e.getAttribute(t)})),e[Ce]=r}},ct=function(e,t){if(at(e)){var r=st(e);t.forEach((function(t){!function(e,t,r){r?e.setAttribute(t,r):e.removeAttribute(t)}(e,t,r[t])}))}},ht=function(e,t,r){$e(e,t.class_applied),Fe(e,Re),r&&(t.unobserve_completed&&Qe(e,t),Ye(t.callback_applied,e,r))},dt=function(e,t,r){$e(e,t.class_loading),Fe(e,Ne),r&&(Ze(r,1),Ye(t.callback_loading,e,r))},ft=function(e,t,r){r&&e.setAttribute(t,r)},pt=function(e,t){ft(e,Ie,Be(e,t.data_sizes)),ft(e,Ee,Be(e,t.data_srcset)),ft(e,ke,Be(e,t.data_src))},vt={IMG:function(e,t){et(e,(function(e){lt(e,it),pt(e,t)})),lt(e,it),pt(e,t)},IFRAME:function(e,t){lt(e,rt),ft(e,ke,Be(e,t.data_src))},VIDEO:function(e,t){tt(e,(function(e){lt(e,rt),ft(e,ke,Be(e,t.data_src))})),lt(e,nt),ft(e,Ae,Be(e,t.data_poster)),ft(e,ke,Be(e,t.data_src)),e.load()},OBJECT:function(e,t){lt(e,ot),ft(e,Pe,Be(e,t.data_src))}},mt=["IMG","IFRAME","VIDEO","OBJECT"],gt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||Ye(e.callback_finish,t)},yt=function(e,t,r){e.addEventListener(t,r),e.llEvLisnrs[t]=r},_t=function(e,t,r){e.removeEventListener(t,r)},bt=function(e){return!!e.llEvLisnrs},xt=function(e){if(bt(e)){var t=e.llEvLisnrs;for(var r in t){var n=t[r];_t(e,r,n)}delete e.llEvLisnrs}},wt=function(e,t,r){!function(e){delete e.llTempImage}(e),Ze(r,-1),function(e){e&&(e.toLoadCount-=1)}(r),Xe(e,t.class_loading),t.unobserve_completed&&Qe(e,r)},St=function(e,t,r){var n=qe(e)||e;if(!bt(n)){!function(e,t,r){bt(e)||(e.llEvLisnrs={});var n="VIDEO"===e.tagName?"loadeddata":"load";yt(e,n,t),yt(e,"error",r)}(n,(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_loaded),Fe(t,Oe),Ye(r.callback_loaded,t,n),i||gt(r,n)}(0,e,t,r),xt(n)}),(function(i){!function(e,t,r,n){var i=Ve(t);wt(t,r,n),$e(t,r.class_error),Fe(t,De),Ye(r.callback_error,t,n),r.restore_on_error&&ct(t,it),i||gt(r,n)}(0,e,t,r),xt(n)}))}},Tt=function(e,t,r){!function(e){e.llTempImage=document.createElement("IMG")}(e),St(e,t,r),function(e){at(e)||(e[Ce]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,r){var n=Be(e,t.data_bg),i=Be(e,t.data_bg_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage='url("'.concat(o,'")'),qe(e).setAttribute(ke,o),dt(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_multi),i=Be(e,t.data_bg_multi_hidpi),o=we&&i?i:n;o&&(e.style.backgroundImage=o,ht(e,t,r))}(e,t,r),function(e,t,r){var n=Be(e,t.data_bg_set);if(n){var i=n.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),ht(e,t,r)}}(e,t,r)},Mt=function(e,t,r){St(e,t,r),function(e,t,r){var n=vt[e.tagName];n&&(n(e,t),dt(e,t,r))}(e,t,r)},kt=function(e,t,r){!function(e){return mt.indexOf(e.tagName)>-1}(e)?Tt(e,t,r):Mt(e,t,r)},Et=function(e,t,r){e.setAttribute("loading","lazy"),St(e,t,r),function(e,t){var r=vt[e.tagName];r&&r(e,t)}(e,t),Fe(e,Le)},It=function(e){e.removeAttribute(ke),e.removeAttribute(Ee),e.removeAttribute(Ie)},At=function(e){et(e,(function(e){ct(e,it)})),ct(e,it)},Ct={IMG:At,IFRAME:function(e){ct(e,rt)},VIDEO:function(e){tt(e,(function(e){ct(e,rt)})),ct(e,nt),e.load()},OBJECT:function(e){ct(e,ot)}},Pt=function(e){var t=Ct[e.tagName];t?t(e):function(e){if(at(e)){var t=st(e);e.style.backgroundImage=t.backgroundImage}}(e)},Nt=function(e,t){Pt(e),function(e,t){Ge(e)||Ve(e)||(Xe(e,t.class_entered),Xe(e,t.class_exited),Xe(e,t.class_applied),Xe(e,t.class_loading),Xe(e,t.class_loaded),Xe(e,t.class_error))}(e,t),We(e),ut(e)},Ot=function(e,t,r,n){r.cancel_on_exit&&function(e){return Ue(e)===Ne}(e)&&"IMG"===e.tagName&&(xt(e),function(e){et(e,(function(e){It(e)})),It(e)}(e),At(e),Xe(e,r.class_loading),Ze(n,-1),We(e),Ye(r.callback_cancel,e,t,n))},Rt=function(e,t,r,n){var i=function(e){return He.indexOf(Ue(e))>=0}(e);Fe(e,"entered"),$e(e,r.class_entered),Xe(e,r.class_exited),function(e,t,r){t.unobserve_entered&&Qe(e,r)}(e,r,n),Ye(r.callback_enter,e,t,n),i||kt(e,r,n)},Dt=["IMG","IFRAME","VIDEO"],Lt=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},jt=function(e,t,r){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Rt(e.target,e,t,r):function(e,t,r,n){Ge(e)||($e(e,r.class_exited),Ot(e,t,r,n),Ye(r.callback_exit,e,t,n))}(e.target,e,t,r)}))},zt=function(e,t){be&&!Lt(e)&&(t._observer=new IntersectionObserver((function(r){jt(r,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},Bt=function(e){return Array.prototype.slice.call(e)},Ut=function(e){return e.container.querySelectorAll(e.elements_selector)},Ft=function(e){return function(e){return Ue(e)===De}(e)},Wt=function(e,t){return function(e){return Bt(e).filter(Ge)}(e||Ut(t))},Gt=function(e,t){var r;(r=Ut(e),Bt(r).filter(Ft)).forEach((function(t){Xe(t,e.class_error),We(t)})),t.update()},Vt=function(e,t){var r=Te(e);this._settings=r,this.loadingCount=0,zt(r,this),function(e,t){ye&&(t._onlineHandler=function(){Gt(e,t)},window.addEventListener("online",t._onlineHandler))}(r,this),this.update(t)};Vt.prototype={update:function(e){var t,r,n=this._settings,i=Wt(e,n);(Ke(this,i.length),!_e&&be)?Lt(n)?function(e,t,r){e.forEach((function(e){-1!==Dt.indexOf(e.tagName)&&Et(e,t,r)})),Ke(r,0)}(i,n,this):(t=this._observer,r=i,function(e){e.disconnect()}(t),function(e,t){t.forEach((function(t){e.observe(t)}))}(t,r)):this.loadAll(i)},destroy:function(){var e;this._observer&&this._observer.disconnect(),e=this,ye&&window.removeEventListener("online",e._onlineHandler),Ut(this._settings).forEach((function(e){ut(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,r=this._settings;Wt(e,r).forEach((function(e){Qe(e,t),kt(e,r,t)}))},restoreAll:function(){var e=this._settings;Ut(e).forEach((function(t){Nt(t,e)}))}},Vt.load=function(e,t){var r=Te(t);kt(e,r)},Vt.resetStatus=function(e){We(e)},ye&&function(e,t){if(t)if(t.length)for(var r,n=0;r=t[n];n+=1)Me(e,r);else Me(e,t)}(Vt,window.lazyLoadOptions);var Ht=function(){function e(t){var r=this,n=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=t.onPagesReady,s=t.urlInterrupter;x(this,e),this._pages=[],this.pageIndex=0,this.setPaused=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=function(){r.$btnPlay.classList.toggle(r.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new U,this.readonly=n,this.onNewPageIndex=i,this.onPlay=o,this.onPagesReady=a,this.urlInterrupter=s||function(e){return e},this.render()}var t;return S(e,[{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e}},{key:"destroy",value:function(){var e;null==(e=this.previewLazyLoad)||e.destroy(),this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}},{key:"refreshTotalPage",value:function(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t,this.refreshPreview(),this.sideEffect.addEventListener(t,"click",(function(t){var r;if(!e.readonly){var n=null==(r=t.target.dataset)?void 0:r.pageIndex;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(n),"preview"),e.togglePreview(!1))}}))}return this.$preview}},{key:"refreshPreview",value:(t=l(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=this.$preview,i=this.wrapClassName("preview-page"),o=this.wrapClassName("preview-page-name");n.firstChild;)n.firstChild.remove();for(a=[],s=0,u=this.pages.length;s0?"":"none"}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer"));var r=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-sidebar")),r.setAttribute("viewBox","0 0 64 64");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(r,"click",(function(){e.readonly||e.togglePreview()})),this.$btnSidebar=r,this.$btnSidebar.style.display="none",this.$footer.appendChild(r);var n=document.createElement("div");n.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),r.appendChild(n),r}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1,"navigation")})),n.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-play")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),r.appendChild(n),r}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-pause")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),r.appendChild(n),r}(this.namespace));this.$btnPlay=o,this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(e.setPlaying(),e.onPlay&&e.onPlay())})),n.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");r.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),r.setAttribute("viewBox","0 0 500 500");var n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),r.appendChild(n),r}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1,"navigation")})),n.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1,"input")}));var l=document.createElement("span");this.$totalPage=l,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(n),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,r){var n=document.createElement("button");return n.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),n.appendChild(t),r&&n.appendChild(r),n}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&(this.previewLazyLoad||(this.previewLazyLoad=new Vt({container:this.$preview,elements_selector:".".concat(this.wrapClassName("preview-page>img"))})),this.$preview.scrollTo({top:t.offsetTop-16}))}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"pages",set:function(e){this._pages=e,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage(),this.onPagesReady&&this.onPagesReady(e)},get:function(){return this._pages}}]),e}(),Yt=new Set(["clicker"]),$t=function(){},Xt=function(){function e(t){var n=this,i=t.box,o=t.view,a=t.mountSlideController,s=t.mountWhiteboard,u=t.baseScenePath,c=t.appId,h=t.urlInterrupter,d=t.onPagesReady,f=t.onNavigate;x(this,e),this.slideController=null,this.isViewMounted=!1,this.onError=function(e){var t,r,i=e.error,o=e.index;n.viewer.setPaused(),(null==(t=n.slideController)?void 0:t.showRenderError)&&(n.$overlay.textContent="Error on slide[page=".concat(n.slideController.page,"]: ").concat(i.message),n.$overlay.style.opacity="1"),(null==(r=n.slideController)?void 0:r.onRenderError)&&n.slideController.onRenderError(i,o),oe.warn("[Slide] render error",i)},this.onRenderStart=function(){n.$whiteboardView.classList.add(n.wrapClassName("wb-view-hidden")),n.viewer.setPlaying()},this.onRenderEnd=function(){},this.onPageChanged=function(){clearTimeout(n._onPageChangedTimer),n._onPageChangedTimer=setTimeout(n._onPageChanged,200)},this._onPageChangedTimer=0,this._onPageChanged=function(){n.$overlay.style.opacity="",n.$whiteboardView.classList.remove(n.wrapClassName("wb-view-hidden"))},this.refreshPages=function(){n.slideController&&(n.viewer.pages=de(n.slideController.slide,n.slideController.previewList),n.viewer.setPageIndex(n.getPageIndex(n.slideController.page)),n.scaleDocsToFit())},this.scaleDocsToFit=function(){if(n.slideController){var e=n.slideController.slide,t=e.width,r=e.height;t&&r&&(n.whiteboardView.moveCameraToContain({originX:-t/2,originY:-r/2,width:t,height:r,animationMode:"immediately"}),n.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return n.whiteboardView.camera.scale},minContentMode:function(){return n.whiteboardView.camera.scale},centerX:0,centerY:0,width:t,height:r}),n.isViewMounted||(n.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),n.mountWhiteboard(n.$whiteboardView)))}},this.onPlay=function(){n.slideController&&n.slideController.slide.nextStep()},this.onNewPageIndex=function(e,t){n.slideController&&n.slideController.jumpToPage(e+1,t)},this.sideEffect=new U,this.namespace="netless-app-slide",this.toPdf=l(regeneratorRuntime.mark((function e(){var t,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.slideController){e.next=3;break}return n.reportProgress(100,null),e.abrupt("return");case 3:if(t=n.slideController.slide,i=1920,o=document.createElement("canvas"),a=o.getContext("2d"),s=t.slideCount,u=t.width,l=t.height,c=Math.floor(u),h=Math.floor(l),c>i&&(c=i,h=Math.floor(l*c/u)),h>i&&(h=i,c=Math.floor(u*h/l)),o.width=c,o.height=h,(d=document.createElement("canvas")).width=c,d.height=h,(f=d.getContext("2d"))&&n.getWhiteSnapshot&&a){e.next=21;break}return n.reportProgress(100,null),e.abrupt("return",null);case 21:return p=c>h?"l":"p",e.next=24,Promise.resolve().then(r.bind(r,88877));case 24:v=e.sent,m=v.jsPDF,g=new m({format:[c,h],orientation:p,compress:!0}),y=1;case 28:if(!(y<=s)){e.next=57;break}return _=null,e.prev=30,e.next=33,n.slideController.slide.snapshotWithTimingEnd(y);case 33:_=e.sent,e.next=38;break;case 36:e.prev=36,e.t0=e.catch(30);case 38:if(!_){e.next=40;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("img")).src=_,e.next=4,new Promise((function(e){return t.onload=e}));case 4:a.drawImage(t,0,0,c,h);case 5:case"end":return e.stop()}}),e)}))(),"t1",40);case 40:return f.clearRect(0,0,c,h),n.getWhiteSnapshot(y,d,f,u,l),e.prev=42,e.delegateYield(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.toDataURL("image/png"),(r=document.createElement("img")).src=t,e.next=5,new Promise((function(e){return r.onload=e}));case 5:a.drawImage(r,0,0,c,h);case 6:case"end":return e.stop()}}),e)}))(),"t2",44);case 44:e.next=48;break;case 46:e.prev=46,e.t3=e.catch(42);case 48:b=o.toDataURL("image/jpeg",.6),y>1&&g.addPage(),g.addImage(b,"JPEG",0,0,c,h,"","FAST"),a.clearRect(0,0,c,h),Math.ceil(y/s*100)<100&&n.reportProgress(Math.ceil(y/s*100),null);case 54:y++,e.next=28;break;case 57:x=g.output("arraybuffer"),w=n.box.title,n.reportProgress(100,{pdf:x,title:w});case 60:case"end":return e.stop()}}),e,null,[[30,36],[42,46]])}))),this.box=i,this.whiteboardView=o,this.mountSlideController=a,this.mountWhiteboard=s,this.onNavigate=f||$t,this.baseScenePath=u,this.appId=c,this.viewer=new Ht({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h,onPagesReady:d}),this.sideEffect.add((function(){var e=function(e){n.setReadonly(e)};return i.events.on("readonly",e),function(){return i.events.off("readonly",e)}})),this.sideEffect.add((function(){var e=function(e){"@netless/_request_save_pdf_"===e.data.type&&e.data.appId===n.appId&&n.toPdf().catch((function(){return n.reportProgress(100,null)}))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}})),this.render()}return S(e,[{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",(function(t){if(e.box.focus&&e.slideController&&!function(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.slideController.slide.prevStep(),e.onNavigate(e.slideController.page,"keydown");break;case"ArrowRight":case"ArrowDown":e.slideController.slide.nextStep(),e.onNavigate(e.slideController.page,"keydown")}}))}},{key:"renderOverlay",value:function(){if(!this.$overlay){var e=document.createElement("div");e.className=this.wrapClassName("overlay"),this.$overlay=e}return this.$overlay}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"renderWhiteboardView",value:function(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}},{key:"mount",value:function(){var e=this;return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onNavigate:this.onNavigate,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){return e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"unmount",value:function(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.viewer.setReadonly(e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"toggleClickThrough",value:function(e){this.$whiteboardView.style.pointerEvents=!e||Yt.has(e)?"none":"auto"}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"getWhiteSnapshot",value:function(e,t,r,n,i){this.whiteboardView.screenshotToCanvas(r,"".concat(this.baseScenePath,"/").concat(e),t.width,t.height,{centerX:0,centerY:0,scale:Math.min(t.width/n,t.height/i)})}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),qt=!1,Qt=2;t.FreezerLength=Qt;var Zt=function(e){return"["+e+"]"},Kt={map:new Map,boxes:new Map,queue:[],validateQueue:function(){var e=this;for(this.queue.sort((function(t,r){var n,i,o,a;return-((null!=(i=null==(n=e.boxes.get(t))?void 0:n.zIndex)?i:0)-(null!=(a=null==(o=e.boxes.get(r))?void 0:o.zIndex)?a:0))})),ae("[Slide] freezer: validate",Zt(this.queue));this.queue.length>Qt;){var t=this.queue.pop(),r=this.map.get(t);r&&(ae("[Slide] freezer: validate-freeze",t,Zt(this.queue)),r.freeze())}},set:function(e,t,r){ae("[Slide] freezer: add",e,Zt(this.queue)),this.map.set(e,t),this.boxes.set(e,r),this.queue.includes(e)||this.queue.unshift(e),this.validateQueue()},delete:function(e){this.map.delete(e),this.boxes.delete(e),this.queue=this.queue.filter((function(t){return t!==e})),ae("[Slide] freezer: delete",e,Zt(this.queue))},focus:function(e){var t=this.map.get(e),r=this.queue.indexOf(e);r>-1&&this.queue.splice(r,1),this.queue.unshift(e),this.validateQueue(),ae("[Slide] freezer: focus",e,Zt(this.queue)),t&&t.unfreeze()}};t.apps=Kt;var Jt=new Set;var er=new Set;t.addHooks=function(e){qt=!0,e.on("focus",(function(e){var t=e.appId;Kt.focus(t)})),e.on("created",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;er.forEach((function(e){return e(t)}))}))};var tr=function(){return".netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden;transition:opacity .2s}.netless-app-slide-wb-view-hidden{opacity:0}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}\n"}();var rr=function(){function e(t){var r=this;x(this,e),this.slide=null,this.debug=!1,this.previewList=[],this.sideEffect=new U,this.ready=!1,this.readyPromise=new Promise((function(e){r.resolveReady=function(){r.ready=!0,e()}})),this.hotkeyListener=function(e){if(r.slide)switch(e.key){case"ArrowUp":case"ArrowLeft":r.slide.prevStep();break;case"ArrowRight":case"ArrowDown":r.slide.nextStep()}},this.onPageChanged=function(e){r.viewer.setPageIndex(e-1)},this.onTransitionStart=function(){r.viewer.setPlaying()},this.onTransitionEnd=function(){r.viewer.setPaused()},this.onError=function(e){var t=e.error;r.viewer.setPaused(),console.warn("[Slide] render error",t)},this.destroyed=!1,this.refreshPages=function(){r.slide&&(r.viewer.pages=de(r.slide,r.previewList),r.viewer.setPageIndex(r.getPageIndex(r.slide.slideState.currentSlideIndex)))},this.onPlay=function(){r.slide&&r.slide.nextStep()},this.onNewPageIndex=function(e){r.slide&&r.slide.slideCount>0&&r.slide.renderSlide(W(e+1,1,r.slide.slideCount))},this.namespace="netless-app-slide",this.target=t.target,this.bgColor=ce(this.target),this.viewer=new Ht({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}return S(e,[{key:"render",value:function(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}},{key:"registerHotKeys",value:function(e){this.sideEffect.addEventListener(e,"keydown",this.hotkeyListener,void 0,"hotkey")}},{key:"mount",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new L.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),r.length>0?this.slide.setResourceList(e,r):this.slide.setResource(e,t),this.slide.renderSlide(1),this.previewList=n}},{key:"renderStyle",value:function(){var e=document.createElement("style");return e.appendChild(document.createTextNode(tr)),e}},{key:"registerEventListeners",value:function(){if(this.slide){var e=this.slide;e.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),e.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.renderError,this.onError),e.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();t.SlidePreviewer=rr;var nr=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=nr;var ir="0.2.60";t.version=ir;var or={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.60"),e.getIsWritable()&&e.storage.ensureState(ve),!e.storage.state.taskId)throw new Error("[Slide] no taskId");var r=e.getView();if(!r)throw new Error("[Slide] no view, please set scenePath on addApp()");r.disableCameraTransform=!0;var n=e.getBox();n.mountStyles(tr);try{n.$content.dataset.appSlideVersion=ir}catch(e){}var i=e.getInitScenePath(),o=null,a=function(t){var r=e.getRoom();if(o&&o.slideController){var n=!1;r&&e.getIsWritable()&&(fe(r,e,o.slideController.slide,i),n=!0),ae("[Slide] page to",t,n?"(synced)":""),o.viewer.setPageIndex(t-1),o.viewer.setPaused(),o.onPageChanged();var a=o.viewer.pages.length;a>0&&e.dispatchAppEvent("pageStateChange",{index:t-1,length:a})}};o=new Xt({box:n,view:r,mountSlideController:function(t){var r,o,s=e.getAppOptions()||{},u=new ge((r=D({context:e},t),o={onPageChanged:a,onNavigate:t.onNavigate,onRenderError:s.onRenderError,showRenderError:s.showRenderError,invisibleBehavior:s.invisibleBehavior},A(r,C(o))));return qt&&Kt.set(e.appId,u,n),oe.setAppController(e.appId,u),u.readyPromise.then(t.onReady).then((function(){var r=e.getRoom(),n=!1;r&&e.getIsWritable()&&(fe(r,e,u.slide,i),n=!0);var o=u.slide.slideState.currentSlideIndex;ae("[Slide] page to",o,n?"(synced)":"","(on ready)"),u.slide.on("renderEnd",t.onRenderEnd)})),u},mountWhiteboard:e.mountView.bind(e),baseScenePath:i,appId:e.appId,urlInterrupter:null==(t=e.getAppOptions())?void 0:t.urlInterrupter,onPagesReady:function(t){var r=t.length,n=(null==o?void 0:o.viewer.pageIndex)||0;e.dispatchAppEvent("pageStateChange",{index:n,length:r})},onNavigate:function(e,t){ae("[Slide] user navigate to",e,t?"(".concat(t,")"):"")}});var s=e.getRoom(),u=new U;return u.add((function(){var t;return oe.setAppContext(e.appId,e),oe.enable=(null==(t=e.getAppOptions())?void 0:t.debug)||!1,oe.level="debug",function(){return oe.deleteApp(e.appId)}})),s&&(o.toggleClickThrough(s.state.memberState.currentApplianceName),u.add((function(){var e=function(e){e.memberState&&o&&o.toggleClickThrough(e.memberState.currentApplianceName)};return s.callbacks.on("onRoomStateChanged",e),function(){return s.callbacks.off("onRoomStateChanged",e)}}))),e.emitter.on("destroy",(function(){ae("[Slide] destroy",e.appId),qt&&Kt.delete(e.appId),u.flushAll(),o&&(o.destroy(),o=null)})),o.mount(),{viewer:function(){return o},controller:function(){return null==o?void 0:o.slideController},slide:function(){var e;return null==(e=null==o?void 0:o.slideController)?void 0:e.slide},nextStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.nextStep(),!0)},prevStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.prevStep(),!0)},position:function(){var e=null==o?void 0:o.slideController;if(e)return[e.page,e.pageCount]},nextPage:function(){var e=null==o?void 0:o.slideController;if(e){var t=e.page,r=e.pageCount;if(r>0&&t0&&t>1)return e.jumpToPage(t-1),!0}return!1},jumpToPage:function(e){var t=null==o?void 0:o.slideController;if(t){var r=t.page,n=t.pageCount;if(n>0&&r>0&&r<=n)return t.jumpToPage(e),!0}return!1}}}};t.default=or;var ar=L.Slide;t.Slide=ar},60064:function(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});var n=r(57763);t.ActiveContainerType=n.ActiveContainerType,t.ApplianceMultiPlugin=n.ApplianceMultiPlugin,t.ApplianceNames=n.ApplianceNames,t.ApplianceSigleWrapper=n.ApplianceSigleWrapper,t.ApplianceSinglePlugin=n.ApplianceSinglePlugin,t.ECanvasShowType=n.ECanvasShowType,t.EDataType=n.EDataType,t.EMatrixrRelationType=n.EMatrixrRelationType,t.EPostMessageType=n.EPostMessageType,t.EScaleType=n.EScaleType,t.EStrokeType=n.EStrokeType,t.EToolsKey=n.EToolsKey,t.ElayerType=n.ElayerType,t.EmitEventType=n.EmitEventType,t.EventMessageType=n.EventMessageType,t.EvevtWorkState=n.EvevtWorkState,t.EvevtWorkType=n.EvevtWorkType,t.InternalMsgEmitterType=n.InternalMsgEmitterType,t.ShapeType=n.ShapeType,t.fullWorkerUrl=n.fullWorker,t.subWorkerUrl=n.subWorker},39819:function(e,t,r){function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u(e);if(t){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||y(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 c(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function h(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){h(o,n,i,a,s,"next",e)}function s(e){h(o,n,i,a,s,"throw",e)}a(void 0)}))}}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=new Map,a=g(this.curNodeMap.entries());try{for(a.s();!(r=a.n()).done;){var s=m(r.value,2),u=s[0],l=s[1];if(k.isIntersect(e,l.rect)){if(n&&l.toolsType===k.EToolsKey.Image&&l.opt.locked||i&&l.toolsType===k.EToolsKey.Text&&(l.opt.workState===k.EvevtWorkState.Doing||l.opt.workState===k.EvevtWorkState.Start))continue;t=k.computRect(t,l.rect),o.set(u,l)}}}catch(e){a.e(e)}finally{a.f()}return{rectRange:t,nodeRange:o}}},{key:"getNodeRectFormShape",value:function(e,t){var r=k.getShapeTools(t.toolsType);return this.fullLayer&&(null==r?void 0:r.getRectFromLayer(this.fullLayer,e))}},{key:"updateNodeRect",value:function(e){var t=this.curNodeMap.get(e);if(t){var r=this.getNodeRectFormShape(e,t);if(!r)return void this.curNodeMap.delete(e);t.rect=r,this.curNodeMap.set(e,t)}}},{key:"updateHighLevelNodesRect",value:function(e){this.highLevelIds=e;var t,r=g(this.highLevelIds.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;this.updateNodeRect(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"updateLowLevelNodesRect",value:function(){var e,t,r=g(this.curNodeMap.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;null!=(e=this.highLevelIds)&&e.has(n)||this.updateNodeRect(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"clearHighLevelIds",value:function(){this.highLevelIds=void 0}},{key:"setTargetAssignKeys",value:function(e){var t,r=new Map,n=g(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.curNodeMap.get(i);o&&r.set(i,k.cloneDeep(o))}}catch(e){n.e(e)}finally{n.f()}return this.targetNodeMap.push(k.cloneDeep(r)),this.targetNodeMap.length-1}},{key:"setTarget",value:function(){return this.targetNodeMap.push(k.cloneDeep(this.curNodeMap)),this.targetNodeMap.length-1}},{key:"getLastTarget",value:function(){return this.targetNodeMap[this.targetNodeMap.length-1]}},{key:"deleteLastTarget",value:function(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1)}},{key:"getTarget",value:function(e){return this.targetNodeMap[e]}},{key:"deleteTarget",value:function(e){this.targetNodeMap.length=e}},{key:"clearTarget",value:function(){this.targetNodeMap.length=0}},{key:"isLocalWorkId",value:function(e){return 1===e.split(k.Storage_Splitter).length}},{key:"isCanClearWorkId",value:function(e){if(void 0===this.canClearUids||!0===this.canClearUids)return!0;if(k.isSet(this.canClearUids)){var t=e.split(k.Storage_Splitter);if(1===t.length)return this.canClearUids.has("localSelf");if(2===t.length)return this.canClearUids.has(t[0])}return!1}}]),e}(),C=function(){function e(t){b(this,e),M(this,"vNodes"),M(this,"thread"),M(this,"serviceWorkShapes",new Map),M(this,"localWorkShapes",new Map),M(this,"tmpOpt"),M(this,"animationId"),M(this,"syncUnitTime",k.DefaultAppliancePluginOptions.syncOpt.interval),this.vNodes=t.vNodes,this.thread=t.thread}return w(e,[{key:"createLocalWork",value:function(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r){var i=t.toString();!this.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:r}),this.setWorkOptions(i,r)}}},{key:"getLocalWorkShape",value:function(e){return this.localWorkShapes.get(e)}},{key:"createLocalWorkShape",value:function(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(p(p({},r),{},{workId:e}));return n&&this.localWorkShapes.set(e,{node:n,toolsType:n.toolsType,workState:k.EvevtWorkState.Start}),n}}},{key:"canUseTopLayer",value:function(e){return e===k.EToolsKey.LaserPen}},{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.topLayer.children.length&&(this.thread.topLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.serviceWorkShapes.clear(),this.localWorkShapes.clear()}},{key:"consumeDraw",value:function(e){var t=e.workId;if(e.dataType===k.EDataType.Service)this.activeServiceWorkShape(e);else{var r=null==t?void 0:t.toString(),n=r&&this.localWorkShapes.get(r);if(!n)return;var i=n.node.consume({data:e,isFullWork:!1,isSubWorker:!0});i.rect&&(n.result=i,n.workState=k.EvevtWorkState.Doing,r&&this.localWorkShapes.set(r,n))}this.runAnimation()}},{key:"setToolsOpt",value:function(e){var t;this.tmpOpt=e,null!=(t=e.toolsOpt)&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime)}},{key:"getToolsOpt",value:function(){return this.tmpOpt}},{key:"createWorkShapeNode",value:function(e){if(e.toolsType===k.EToolsKey.LaserPen)return k.getShapeInstance(p(p({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.topLayer,drawLayer:this.thread.topLayer}))}},{key:"setNodeKey",value:function(e,t,r,n){return t.toolsType=r,t.node=this.createWorkShapeNode({workId:e,toolsType:r,toolsOpt:n}),t}},{key:"activeServiceWorkShape",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.toolsType,a=e.type,s=e.updateNodeOpt,u=e.ops,l=e.op;if(n){var c=n.toString(),h=null==(t=this.vNodes.get(c))?void 0:t.rect;if(null==(r=this.serviceWorkShapes)||!r.has(c)){var d={toolsType:o,animationWorkData:l||[],animationIndex:0,type:a,updateNodeOpt:s,ops:u,oldRect:h};o&&i&&(d=this.setNodeKey(c,d,o,i)),this.serviceWorkShapes.set(c,d)}var f=this.serviceWorkShapes.get(c);a&&(f.type=a),u&&(f.animationWorkData=k.transformToNormalData(u),f.ops=u),s&&(f.updateNodeOpt=s),l&&(f.animationWorkData=l),f.node&&f.node.getWorkId()!==c&&f.node.setWorkId(c),h&&(f.oldRect=h),o&&i&&(f.toolsType!==o&&o&&i&&this.setNodeKey(c,f,o,i),f.node&&f.node.setWorkOptions(i))}}},{key:"computNextAnimationIndex",value:function(e,t){var r,n=(null==(r=e.node)?void 0:r.syncUnitTime)||this.syncUnitTime,i=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/n)*t;return Math.min((e.animationIndex||0)+(i||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:function(){var e,t,r,n,i=this;this.animationId=void 0;var o,a=!1,s=new Map,u=[],l=g(this.serviceWorkShapes.entries());try{for(l.s();!(o=l.n()).done;){var c=m(o.value,2),h=c[0],d=c[1];switch(d.toolsType){case k.EToolsKey.LaserPen:var f=this.computNextAnimationIndex(d,8),p=Math.max(0,d.animationIndex||0),v=(d.animationWorkData||[]).slice(p,f);if((d.animationIndex||0)0&&void 0!==arguments[0]&&arguments[0],r=this.workShapes.get(k.Storage_Selector_key);if(r){if(r&&(null==(e=r.selectIds)||!e.length))return this.blurSelector();var n=r.reRenderSelector();n&&this.thread.post({sp:[{type:k.EPostMessageType.Select,selectIds:r.selectIds,selectRect:n,willSyncService:t,viewId:this.thread.viewId,points:r.getChildrenPoints(),textOpt:r.textOpt,selectorColor:r.selectorColor,strokeColor:r.strokeColor,fillColor:r.fillColor,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,opt:r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}]})}}},{key:"blurSelector",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.workShapes.get(k.Storage_Selector_key),i=null==n?void 0:n.blurSelector(),this.clearWorkShapeNodeCache(k.Storage_Selector_key),(null==(r=this.thread.fullLayer)?void 0:r.parent).children.forEach((function(e){e.name===k.Storage_Selector_key&&e.remove()})),i&&((o=[]).push(p(p({},i),{},{isSync:null==t?void 0:t.isSync})),this.thread.post({sp:o}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"clearWorkShapeNodeCache",value:function(e){var t;null==(t=this.getWorkShape(e))||t.clearTmpPoints(),this.workShapes.delete(e)}},{key:"drawBitMapEraser",value:function(e){var t=[];e.op&&t.push(e),t.length&&this.thread.post({sp:t})}},{key:"drawBitMapEraserFull",value:(t=d(regeneratorRuntime.mark((function e(t,r,n){var i,o,a,s,u,l,h,d,f,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.willUpdateNodes,o=r.scenePath,a=c(r,["willUpdateNodes","scenePath"]),s=t.getWorkId(),u=[p(p({},a),{},{workId:s,scenePath:o,updateNodeOpt:{useAnimation:!1},isSync:!0,nextTasks:[{type:k.EPostMessageType.RemoveNode,removeIds:[s],viewId:this.thread.viewId}]})],n&&u.push({type:k.EPostMessageType.None,isLockSentEventCursor:n}),null==i||!i.size){e.next=6;break}return e.next=4,null==t?void 0:t.reRenderEffectNodes({willUpdateNodes:i,worker:this});case 4:l=g(i);try{for(l.s();!(h=l.n()).done;)d=m(h.value,2),f=d[0],v=d[1],u.push({type:k.EPostMessageType.UpdateNode,dataType:k.EDataType.Local,opt:v.opt,workId:f,updateNodeOpt:{useAnimation:!1}})}catch(e){l.e(e)}finally{l.f()}case 6:u.length&&this.thread.post({sp:u});case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"drawPencilEraser",value:function(e,t){var r,n,i=this,o=[];if(null!=(r=e.newWorkDatas)&&r.size){var a,s=g(e.newWorkDatas.values());try{for(s.s();!(a=s.n()).done;){var u=a.value,l=u.workId.toString();this.batchEraserWorks.add(l),o.push({type:k.EPostMessageType.FullWork,workId:l,ops:k.transformToSerializableData(u.op),opt:u.opt,toolsType:u.toolsType,updateNodeOpt:{useAnimation:!1}})}}catch(e){s.e(e)}finally{s.f()}delete e.newWorkDatas}null==(n=e.removeIds)||n.forEach((function(e){i.batchEraserRemoveNodes.add(e)})),t&&o.push({type:k.EPostMessageType.None,isLockSentEventCursor:t}),e.rect,this.thread.post({sp:o}),this.batchEraserCombine()}},{key:"drawEraser",value:function(e,t){var r=[];e.removeIds&&r.push(e),t&&r.push({type:k.EPostMessageType.None,isLockSentEventCursor:t}),this.thread.post({sp:r})}},{key:"updateBatchEraserCombineNode",value:function(e,t){var r,n=this,i=g(t.keys());try{for(i.s();!(r=i.n()).done;){var o=r.value;this.thread.fullLayer.getElementsByName(o).forEach((function(e){e.remove()}))}}catch(e){i.e(e)}finally{i.f()}e.forEach((function(e){var t=n.vNodes.get(e);if(t&&t.toolsType===k.EToolsKey.Pencil&&!n.thread.fullLayer.getElementsByName(e)[0]){var r=n.setFullWork(p(p({},t),{},{workId:e}));r&&r.consumeService({op:t.op,isFullWork:!0})}}))}},{key:"getWorkShape",value:function(e){return this.workShapes.get(e)}},{key:"getWorkShapes",value:function(){return this.workShapes}},{key:"consumeDraw",value:function(e,t){var r=e.op,n=e.workId,i=e.scenePath;if(null!=r&&r.length&&n){var o=n.toString(),a=this.workShapes.get(o);if(!a)return;var s=a.toolsType;if(s===k.EToolsKey.LaserPen)return;switch(this.drawWorkActiveId&&this.drawWorkActiveId!==o&&(this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:i,viewId:this.thread.viewId,msgType:k.EPostMessageType.DrawWork,dataType:k.EDataType.Local},t),this.drawWorkActiveId=void 0),!this.drawWorkActiveId&&o!==k.Storage_Selector_key&&(this.drawWorkActiveId=o),s){case k.EToolsKey.Selector:var u=a.consume({data:e,isFullWork:!0});u.type===k.EPostMessageType.Select&&(u.selectIds&&t.runReverseSelectWork(u.selectIds),this.thread.post({sp:[u]}));break;case k.EToolsKey.PencilEraser:var l=a.consume({data:e,isFullWork:!0});null!=l&&l.rect&&this.drawPencilEraser(l);break;case k.EToolsKey.BitMapEraser:var c=a.consume({data:e,isFullWork:!0});null!=c&&c.rect&&this.drawBitMapEraser(c);break;case k.EToolsKey.Eraser:var h=a.consume({data:e,isFullWork:!0});null!=h&&h.rect&&this.drawEraser(h);break;case k.EToolsKey.Arrow:case k.EToolsKey.Straight:case k.EToolsKey.Ellipse:case k.EToolsKey.Rectangle:case k.EToolsKey.Star:case k.EToolsKey.Polygon:case k.EToolsKey.SpeechBalloon:case k.EToolsKey.Pencil:var d=a.consume({data:e,isFullWork:!1,isMainThread:!0});d&&(this.drawCount++,this.thread.post({drawCount:this.drawCount,sp:d.op&&[p(p({},d),{},{scenePath:i})]||void 0}))}}}},{key:"consumeDrawAll",value:function(e,t){var r,n,i,o,a=e.workId,s=e.scenePath,u=e.isLockSentEventCursor;if(a){var l=a.toString();this.drawWorkActiveId===l&&(this.drawWorkActiveId=void 0);var c=this.workShapes.get(l);if(!c)return;var h=c.toolsType;if(h===k.EToolsKey.LaserPen)return;var d=this.workShapes.get(k.Cursor_Hover_Id),f=null==(r=null==d?void 0:d.selectIds)?void 0:r[0],v=c.consumeAll({data:e});switch(h){case k.EToolsKey.Selector:v.selectIds&&f&&null!=(n=v.selectIds)&&n.includes(f)&&d.cursorBlur(),v.type===k.EPostMessageType.Select&&(v.selectIds&&t.runReverseSelectWork(v.selectIds),this.thread.post({sp:[p(p({},v),{},{scenePath:s})]})),null!=(i=c.selectIds)&&i.length?c.clearTmpPoints():this.clearWorkShapeNodeCache(l);break;case k.EToolsKey.PencilEraser:this.drawPencilEraser(p(p({},v),{},{scenePath:s}),u),c.clearTmpPoints();break;case k.EToolsKey.BitMapEraser:(v.rect||null!=(o=v.newWorkDatas)&&o.size)&&this.drawBitMapEraserFull(c,v,u);break;case k.EToolsKey.Eraser:this.drawEraser(p(p({},v),{},{scenePath:s}),u),c.clearTmpPoints();break;case k.EToolsKey.Arrow:case k.EToolsKey.Straight:case k.EToolsKey.Ellipse:case k.EToolsKey.Rectangle:case k.EToolsKey.Star:case k.EToolsKey.Polygon:case k.EToolsKey.SpeechBalloon:case k.EToolsKey.Pencil:var m=[];u&&m.push({type:k.EPostMessageType.None,isLockSentEventCursor:u}),v&&(m.push(v),this.drawCount=0,this.thread.post({drawCount:this.drawCount,sp:m})),this.clearWorkShapeNodeCache(l)}}}},{key:"getToolsOpt",value:function(){return this.tmpOpt}},{key:"setToolsOpt",value:function(e){var t;this.tmpOpt=e,null!=(t=e.toolsOpt)&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime)}},{key:"setWorkOptions",value:function(e,t){var r=this.workShapes.get(e);if(!r&&this.tmpOpt){var n=this.tmpOpt.toolsType;this.tmpOpt.toolsOpt=t,(r=this.createWorkShapeNode({workId:e,toolsType:n,toolsOpt:t}))&&this.workShapes.set(e,r),this.setToolsOpt(this.tmpOpt)}t.syncUnitTime||(t.syncUnitTime=this.syncUnitTime),null==r||r.setWorkOptions(t)}},{key:"createWorkShapeNode",value:function(e){return k.getShapeInstance(p(p({},e),{},{vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.localLayer}),this.thread.serviceWork)}}]),e}(),N=function(){function e(t){b(this,e),M(this,"vNodes"),M(this,"thread"),M(this,"workShapes",new Map),M(this,"selectorWorkShapes",new Map),M(this,"willRunEffectSelectorIds",new Set),M(this,"runEffectId"),M(this,"animationId"),M(this,"syncUnitTime",k.DefaultAppliancePluginOptions.syncOpt.interval),this.vNodes=t.vNodes,this.thread=t.thread}var t,r;return w(e,[{key:"loadImageBitMap",value:(r=d(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.thread.loadImageBitMap(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"destroy",value:function(){this.clearAll()}},{key:"clearAll",value:function(){this.thread.serviceLayer.children.length&&(this.thread.serviceLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.thread.serviceLayer.removeAllChildren()),this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear()}},{key:"runEffect",value:function(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0))}},{key:"effectRunSelector",value:function(){var e=this;this.runEffectId=void 0,this.willRunEffectSelectorIds.forEach((function(t){var r,n,i=e.selectorWorkShapes.get(t);i&&i.selectIds&&(null==(r=i.node)||r.selectServiceNode(t,i,!0)),null!=(n=null==i?void 0:i.selectIds)&&n.length||e.selectorWorkShapes.delete(t)})),this.willRunEffectSelectorIds.clear()}},{key:"runSelectWork",value:function(e){this.activeSelectorShape(e);var t=e.workId,r=null==t?void 0:t.toString();r&&this.willRunEffectSelectorIds.add(r),this.runEffect()}},{key:"removeWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();if(r){if(this.workShapes.get(r))return this.workShapes.delete(r),void this.removeNode(r,e);this.removeNode(r,e)}}},{key:"consumeFull",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"runReverseSelectWork",value:function(e){var t=this;e.forEach((function(e){t.selectorWorkShapes.forEach((function(r,n){var i;if(null!=(i=r.selectIds)&&i.length){var o=r.selectIds.indexOf(e);o>-1&&(r.selectIds.splice(o,1),t.willRunEffectSelectorIds.add(n))}}))})),this.willRunEffectSelectorIds.size&&this.runEffect()}},{key:"consumeDraw",value:function(e){this.activeWorkShape(e),this.runAnimation()}},{key:"computNextAnimationIndex",value:function(e,t){var r=Math.floor(32*(e.animationWorkData||[]).slice(e.animationIndex).length/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.animationWorkData||[]).length)}},{key:"animationDraw",value:(t=d(regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,l,c,h,d,f,p,v,y,_,b,x,w,S,T=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.animationId=void 0,y=!1,_=new Map,b=g(this.workShapes.entries()),e.prev=4,w=regeneratorRuntime.mark((function e(){var g,b,w,S,M,E,I,A,C,P;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g=m(x.value,2),b=g[0],w=g[1],e.t0=w.toolsType,e.next=e.t0===k.EToolsKey.Image?4:e.t0===k.EToolsKey.Text?9:e.t0===k.EToolsKey.Arrow||e.t0===k.EToolsKey.Straight||e.t0===k.EToolsKey.Rectangle||e.t0===k.EToolsKey.Ellipse||e.t0===k.EToolsKey.Star||e.t0===k.EToolsKey.Polygon||e.t0===k.EToolsKey.SpeechBalloon?17:e.t0===k.EToolsKey.Pencil?20:33;break;case 4:return e.next=6,null==(t=w.node)?void 0:t.consumeServiceAsync({isFullWork:!0,worker:T});case 6:return T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),T.workShapes.delete(b),e.abrupt("break",33);case 9:if(e.t1=w.node,!e.t1){e.next=16;break}return e.next=13,null==(r=w.node)?void 0:r.consumeServiceAsync({isFullWork:!0,replaceId:b});case 13:T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),null==(n=w.node)||n.clearTmpPoints(),T.workShapes.delete(b);case 16:return e.abrupt("break",33);case 17:return S=!!w.ops,null!=(i=w.animationWorkData)&&i.length&&(M=w.oldRect,null==(o=w.node)||o.consumeService({op:w.animationWorkData,isFullWork:S}),S&&(T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),null==(a=w.node)||a.clearTmpPoints(),T.workShapes.delete(b)),_.set(b,{workState:M?w.ops?k.EvevtWorkState.Done:k.EvevtWorkState.Doing:k.EvevtWorkState.Start,op:w.animationWorkData.filter((function(e,t){if(t%3!=2)return!0})).slice(-2)}),w.animationWorkData.length=0),e.abrupt("break",33);case 20:if(w.useAnimation||!w.ops){e.next=24;break}null==(s=w.node)||s.consumeService({op:w.animationWorkData||[],isFullWork:!0,replaceId:b}),null==(u=w.node)||u.updataOptService(w.updateNodeOpt),T.selectorWorkShapes.forEach((function(e,t){var r;null!=(r=e.selectIds)&&r.includes(b)&&(T.willRunEffectSelectorIds.add(t),T.runEffect())})),null==(l=w.node)||l.clearTmpPoints(),T.workShapes.delete(b),e.next=32;break;case 24:if(!w.useAnimation){e.next=32;break}if(!w.isDel){e.next=28;break}return null==(c=w.node)||c.clearTmpPoints(),T.workShapes.delete(b),e.abrupt("break",33);case 28:return E=T.computNextAnimationIndex(w,3),I=w.isDiff?0:Math.max(0,(w.animationIndex||0)-3),A=(w.animationWorkData||[]).slice(I,E),C=null==(d=null==(h=w.node)?void 0:h.getWorkId())?void 0:d.toString(),(w.animationIndex||0)-1&&this.removeSelectWork(t),this.thread.fullLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.thread.serviceLayer.getElementsByName(e).forEach((function(e){e.remove()})),this.vNodes.delete(e)}},{key:"removeSelectWork",value:function(e){var t=e.workId,r=null==t?void 0:t.toString();r&&(this.activeSelectorShape(e),this.willRunEffectSelectorIds.add(r)),this.runEffect()}},{key:"activeSelectorShape",value:function(e){var t,r,n,i=e.workId,o=e.opt,a=e.toolsType,s=e.type,u=e.selectIds;if(i){var l=i.toString();if(null==(t=this.selectorWorkShapes)||!t.has(l)){var c={toolsType:a,selectIds:u,type:s,opt:o};a&&o&&(c=this.setNodeKey(l,c,a,o)),null==(r=this.selectorWorkShapes)||r.set(l,c)}var h=null==(n=this.selectorWorkShapes)?void 0:n.get(l);s&&(h.type=s),h.node&&h.node.getWorkId()!==l&&h.node.setWorkId(l),h.selectIds=u||[]}}},{key:"setNodeKey",value:function(e,t,r,n){return t.toolsType=r,t.node=k.getShapeInstance({toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.thread.fullLayer,drawLayer:this.thread.serviceLayer,workId:e},this),t}}]),e}(),O=function(){function e(){b(this,e),M(this,"localWork"),M(this,"serviceWork"),M(this,"threadEngine")}return w(e,[{key:"registerMainThread",value:function(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this}}]),e}(),R=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.CopyNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.FullWork||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,e.t0=n,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.consumeFull(t);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),a}(O),D=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetColorNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,o=t.isSync,a=t.textUpdateForWoker,s=r.sp||[];if(i){var u,l=g(n.entries());try{for(l.s();!(u=l.n()).done;){var c=m(u.value,2),h=c[0],d=c[1];a&&d.toolsType===k.EToolsKey.Text?s.push(p(p({},d),{},{workId:h,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):s.push(p(p({},d),{},{workId:h,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}))}}catch(e){l.e(e)}finally{l.f()}}return{sp:s}}}]),a}(O),L=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.ZIndexNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,o=t.isSync,a=r.sp||[];if(i&&a){var s,u=g(n.entries());try{for(u.s();!(s=u.n()).done;){var l=m(s.value,2),c=l[0],h=l[1];a.push(p(p({},h),{},{workId:c,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}))}}catch(e){u.e(e)}finally{u.f()}}return{sp:a}}}]),a}(O),j=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.TranslateNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.workId,o=t.updateNodeOpt,a=t.willRefreshSelector,s=t.willSyncService,u=t.willSerializeData,l=t.textUpdateForWoker,c=t.emitEventType,e.t0=i===k.Storage_Selector_key&&o,!e.t0){e.next=9;break}if(!(o.workState===k.EvevtWorkState.Done&&null!=o&&o.translate&&(o.translate[0]||o.translate[1])||o.workState!==k.EvevtWorkState.Done)){e.next=8;break}return e.next=6,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:o,willRefreshSelector:a,willSyncService:s,willSerializeData:u,isSync:!0,textUpdateForWoker:l,emitEventType:c,callback:this.updateSelectorCallback});case 6:e.next=9;break;case 8:o.workState===k.EvevtWorkState.Done&&(null==(n=this.localWork)||n.vNodes.deleteLastTarget());case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=t.updateSelectorOpt,l=t.textUpdateForWoker,c=u.workState,h=r.sp||[];if(c===k.EvevtWorkState.Start)return{sp:[],render:[]};var d=null==o?void 0:o.selectRect;if(a){c===k.EvevtWorkState.Doing&&h.push({type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:d,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});var f,v=g(n.entries());try{for(v.s();!(f=v.n()).done;){var y=m(f.value,2),_=y[0],b=y[1];l&&b.toolsType===k.EToolsKey.Text?h.push(p(p({},b),{},{workId:_,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):h.push(p(p({},b),{},{workId:_,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){v.e(e)}finally{v.f()}}return{sp:h}}}]),a}(O),z=function(e){n(i,e);var t,r=o(i);function i(){var e;return b(this,i),e=r.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.DeleteNode),e}return w(i,[{key:"consume",value:(t=d(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!1);case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]),i}(O),B=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.ScaleNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willSyncService,a=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willSyncService:o,willSerializeData:a,isSync:!0,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,o=e.newServiceStore,a=t.updateSelectorOpt,s=t.willSyncService,u=a.workState,l=r.sp||[],c=null==i?void 0:i.selectRect;if(u===k.EvevtWorkState.Start)return{sp:[],render:[]};if(s){l.push({type:k.EPostMessageType.Select,selectIds:n.selectIds,selectRect:c,willSyncService:!0,isSync:!0,points:u===k.EvevtWorkState.Done&&n.getChildrenPoints()||void 0,textOpt:n.textOpt});var h,d=g(o.entries());try{for(d.s();!(h=d.n()).done;){var f=m(h.value,2),v=f[0],y=f[1];y.toolsType===k.EToolsKey.Text?l.push(p(p({},y),{},{workId:v,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):l.push(p(p({},y),{},{workId:v,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}))}}catch(e){d.e(e)}finally{d.f()}}return{sp:l}}}]),a}(O),U=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.RotateNode),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.emitEventType,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,emitEventType:u,isSync:!0,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.workShapeNode,i=e.res,o=e.newServiceStore,a=t.updateSelectorOpt,s=t.willSyncService,u=t.willSerializeData,l=t.isSync,c=a.workState,h=r.sp||[],d=null==i?void 0:i.selectRect;if(s){u&&c===k.EvevtWorkState.Done&&h.push({type:k.EPostMessageType.Select,selectIds:n.selectIds,selectRect:d,willSyncService:!0,isSync:l,points:n.getChildrenPoints()});var f,v=g(o.entries());try{for(v.s();!(f=v.n()).done;){var y=m(f.value,2),_=y[0],b=y[1];h.push(p(p({},b),{},{workId:_,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}))}}catch(e){v.e(e)}finally{v.f()}}return{sp:h}}}]),a}(O),F=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetFontStyle),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=5;break}return e.next=4,this.consumeForLocalWorker(t);case 4:return e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=t.updateSelectorOpt,l=t.textUpdateForWoker,c=r.sp||[],h=null==o?void 0:o.selectRect;if(a&&c){u.fontSize&&c.push({type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:h,willSyncService:a,isSync:s,points:i.getChildrenPoints()});var d,f=g(n.entries());try{for(f.s();!(d=f.n()).done;){var v=m(d.value,2),y=v[0],_=v[1];l&&_.toolsType===k.EToolsKey.Text?c.push(p(p({},_),{},{workId:y,type:k.EPostMessageType.TextUpdate,dataType:k.EDataType.Local,willSyncService:!0})):c.push(p(p({},_),{},{workId:y,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){f.e(e)}finally{f.f()}}return{sp:c}}}]),a}(O),W=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetPoint),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,u=t.textUpdateForWoker,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:s,isSync:!0,textUpdateForWoker:u,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=r.sp||[],l=null==o?void 0:o.selectRect;if(a&&u){var c,h=g(n.entries());try{for(h.s();!(c=h.n()).done;){var d=m(c.value,2),f=d[0],v=d[1];u.push(p(p({},v),{},{workId:f,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){h.e(e)}finally{h.f()}u.push({type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:l,willSyncService:a,isSync:s,points:i.getChildrenPoints()})}return{sp:u}}}]),a}(O),G=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetLock),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=e.workShapeNode,o=e.res,a=t.willSyncService,s=t.isSync,u=t.updateSelectorOpt,l=r.sp||[],c=null==o?void 0:o.selectRect;if(a&&l){var h,d=g(n.entries());try{for(d.s();!(h=d.n()).done;){var f=m(h.value,2),v=f[0],y=f[1];l.push(p(p({},y),{},{workId:v,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}))}}catch(e){d.e(e)}finally{d.f()}l.push({isLocked:u.isLocked,selectorColor:i.selectorColor,scaleType:i.scaleType,canRotate:i.canRotate,type:k.EPostMessageType.Select,selectIds:i.selectIds,selectRect:c,willSyncService:a,isSync:s})}return{sp:l}}}]),a}(O),V=function(e){n(a,e);var t,r,i=o(a);function a(){var e;return b(this,a),e=i.apply(this,arguments),M(s(e),"emitEventType",k.EmitEventType.SetShapeOpt),e}return w(a,[{key:"consume",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.msgType,n=t.dataType,i=t.emitEventType,r!==k.EPostMessageType.UpdateNode||n!==k.EDataType.Local||i!==this.emitEventType){e.next=3;break}return e.abrupt("return",(this.consumeForLocalWorker(t),!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"consumeForLocalWorker",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.workId,i=t.updateNodeOpt,o=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,e.t0=n===k.Storage_Selector_key&&i,!e.t0){e.next=5;break}return e.next=5,null==(r=this.localWork)?void 0:r.updateSelector({updateSelectorOpt:i,willRefreshSelector:o,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateSelectorCallback",value:function(e){var t=e.param,r=e.postData,n=e.newServiceStore,i=t.willSyncService,o=t.isSync,a=r.sp||[];if(i&&a){var s,u=g(n.entries());try{for(u.s();!(s=u.n()).done;){var l=m(s.value,2),c=l[0],h=l[1];a.push(p(p({},h),{},{workId:c,type:k.EPostMessageType.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}))}}catch(e){u.e(e)}finally{u.f()}}return{sp:a}}}]),a}(O),H=function(){function e(t){var r=this;b(this,e),M(this,"builders",new Map),this.builders=new Map(t.map((function(e){return[e,r.build(e)]})))}var t;return w(e,[{key:"build",value:function(e){switch(e){case k.EmitEventType.TranslateNode:return new j;case k.EmitEventType.ZIndexNode:return new L;case k.EmitEventType.CopyNode:return new R;case k.EmitEventType.SetColorNode:return new D;case k.EmitEventType.DeleteNode:return new z;case k.EmitEventType.ScaleNode:return new B;case k.EmitEventType.RotateNode:return new U;case k.EmitEventType.SetFontStyle:return new F;case k.EmitEventType.SetPoint:return new W;case k.EmitEventType.SetLock:return new G;case k.EmitEventType.SetShapeOpt:return new V}}},{key:"registerForMainThread",value:function(e){return this.builders.forEach((function(t){t&&t.registerMainThread(e)})),this}},{key:"consumeForMainThread",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=g(this.builders.values()),e.prev=1,r.s();case 3:if((n=r.n()).done){e.next=11;break}return i=n.value,e.next=7,null==i?void 0:i.consume(t);case 7:if(!e.sent){e.next=9;break}return e.abrupt("return",!0);case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),r.e(e.t0);case 16:return e.prev=16,r.f(),e.finish(16);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(e){return t.apply(this,arguments)})}]),e}(),Y=function(){function e(t,r){b(this,e),M(this,"viewId"),M(this,"fullLayer"),M(this,"topLayer"),M(this,"localLayer"),M(this,"serviceLayer"),M(this,"snapshotFullLayer"),M(this,"vNodes"),M(this,"master"),M(this,"opt"),M(this,"cameraOpt"),M(this,"scene"),M(this,"localWork"),M(this,"serviceWork"),M(this,"topWork"),M(this,"taskUpdateCameraId"),M(this,"debounceUpdateCameraId"),M(this,"debounceUpdateCache",new Set),M(this,"mainThreadPostId"),M(this,"combinePostMsg",new Set),M(this,"methodBuilder"),M(this,"cacheImages",new Map),M(this,"imageResolveMap",new Map),this.viewId=t,this.opt=r,this.scene=this.createScene(p(p({},r.canvasOpt),{},{container:r.container})),this.master=r.master;var n=k.DefaultAppliancePluginOptions.bufferSize.full,i=k.DefaultAppliancePluginOptions.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:this.viewId===k.Main_View_Id?n:i})),this.topLayer=this.createLayer("topLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:(this.viewId,k.Main_View_Id,i)})),this.localLayer=this.createLayer("localLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:(this.viewId,k.Main_View_Id,i)})),this.serviceLayer=this.createLayer("serviceLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:(this.viewId,k.Main_View_Id,i)})),this.vNodes=new A(t,this.scene);var o={thread:this,vNodes:this.vNodes};this.localWork=new P(o),this.serviceWork=new N(o),this.topWork=new C(o),this.vNodes.init(this.fullLayer),this.methodBuilder=new H([k.EmitEventType.CopyNode,k.EmitEventType.SetColorNode,k.EmitEventType.DeleteNode,k.EmitEventType.RotateNode,k.EmitEventType.ScaleNode,k.EmitEventType.TranslateNode,k.EmitEventType.ZIndexNode,k.EmitEventType.SetFontStyle,k.EmitEventType.SetPoint,k.EmitEventType.SetLock,k.EmitEventType.SetShapeOpt]).registerForMainThread(this)}var t,r,n,i,o;return w(e,[{key:"getCachedImages",value:function(e){return this.cacheImages.get(e)}},{key:"clearCacheImages",value:function(){this.cacheImages.forEach((function(e){return e.close()})),this.cacheImages.clear()}},{key:"clearImageResolveMap",value:function(){this.imageResolveMap.forEach((function(e){var t=e.timer;t&&clearTimeout(t)})),this.imageResolveMap.clear()}},{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(o=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h,d,f,p,v,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.methodBuilder.consumeForMainThread(t);case 2:if(e.sent){e.next=43;break}n=t.msgType,i=t.toolsType,o=t.opt,a=t.dataType,s=t.workId,u=t.workState,l=t.imageSrc,c=t.imageBitmap,h=null==s?void 0:s.toString(),e.t0=n,e.next=e.t0===k.EPostMessageType.AuthClear?7:e.t0===k.EPostMessageType.Destroy?10:e.t0===k.EPostMessageType.Clear?12:e.t0===k.EPostMessageType.UpdateCamera?14:e.t0===k.EPostMessageType.UpdateTools?17:e.t0===k.EPostMessageType.CreateWork?19:e.t0===k.EPostMessageType.DrawWork?25:e.t0===k.EPostMessageType.UpdateNode||e.t0===k.EPostMessageType.FullWork?27:e.t0===k.EPostMessageType.RemoveNode?32:e.t0===k.EPostMessageType.Select?35:e.t0===k.EPostMessageType.CursorHover?37:e.t0===k.EPostMessageType.GetTextActive?39:e.t0===k.EPostMessageType.GetImageBitMap?41:43;break;case 7:return d=t.clearUids,f=t.localUid,this.vNodes.setCanClearUids(d),this.vNodes.setLocalUid(f),e.abrupt("break",43);case 10:return this.destroy(),e.abrupt("break",43);case 12:return this.clearAll(),e.abrupt("break",43);case 14:return e.next=16,this.updateCamera(t);case 16:return e.abrupt("break",43);case 17:return i&&o&&(p={toolsType:i,toolsOpt:o},this.topWork.canUseTopLayer(i)?this.topWork.setToolsOpt(p):this.localWork.setToolsOpt(p)),e.abrupt("break",43);case 19:if(!(h&&o&&i)){e.next=24;break}if(!this.topWork.canUseTopLayer(i)){e.next=23;break}return this.topWork.getToolsOpt()||this.topWork.setToolsOpt({toolsType:i,toolsOpt:o}),this.topWork.setWorkOptions(h,o),e.abrupt("break",43);case 23:this.localWork.getToolsOpt()||this.localWork.setToolsOpt({toolsType:i,toolsOpt:o}),this.localWork.setWorkOptions(h,o);case 24:return e.abrupt("break",43);case 25:return u===k.EvevtWorkState.Done&&a===k.EDataType.Local?this.consumeDrawAll(a,t):this.consumeDraw(a,t),e.abrupt("break",43);case 27:if(!i||!this.topWork.canUseTopLayer(i)){e.next=30;break}return this.consumeDrawAll(a,t),e.abrupt("break",43);case 30:return this.consumeFull(a,t),e.abrupt("break",43);case 32:return e.next=34,this.removeNode(t);case 34:return e.abrupt("return");case 35:return a===k.EDataType.Service&&(s===k.Storage_Selector_key?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t)),e.abrupt("break",43);case 37:return this.localWork.cursorHover(t),e.abrupt("break",43);case 39:return a===k.EDataType.Local&&this.localWork.checkTextActive(t),e.abrupt("break",43);case 41:return l&&c&&this.cacheImages.set(l,c),s&&(v=s.toString(),(m=null==(r=this.imageResolveMap.get(v))?void 0:r.resolve)&&m(v)),e.abrupt("break",43);case 43:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"loadImageBitMap",value:(i=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.toolsType,n=t.opt,i=t.workId,!(r===k.EToolsKey.Image&&n&&n.src&&i)){e.next=9;break}if(o=n.src,a=this.cacheImages.has(o),s=i.toString(),a){e.next=8;break}return e.next=6,new Promise((function(e){var t=l.imageResolveMap.get(s)||{resolve:void 0,timer:void 0};t.timer&&clearTimeout(t.timer),t.resolve=e,t.timer=setTimeout((function(){var e=l.imageResolveMap.get(s);null!=e&&e.resolve&&e.resolve(s)}),5e3),l.imageResolveMap.set(s,t),l.opt.post({sp:[{imageSrc:o,workId:s,viewId:l.viewId,isgl:!!l.fullLayer.parent.gl,isSubWorker:!1,type:k.EPostMessageType.GetImageBitMap}]})}));case 6:u=e.sent,this.imageResolveMap.delete(u);case 8:return e.abrupt("return",this.cacheImages.get(o));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"removeNode",value:(n=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.dataType,n=t.workId,i=t.removeIds,o=i||[],n&&o.push(n.toString()),!o.length){e.next=24;break}a=g(o),e.prev=3,a.s();case 5:if((s=a.n()).done){e.next=16;break}if(s.value!==k.Storage_Selector_key){e.next=11;break}return e.next=10,this.localWork.removeSelector(t);case 10:return e.abrupt("continue",14);case 11:return r===k.EDataType.Local?this.localWork.removeWork(t):r===k.EDataType.Service&&this.serviceWork.removeWork(t),e.next=14,this.localWork.colloctEffectSelectWork(t);case 14:e.next=5;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),a.e(e.t0);case 21:return e.prev=21,a.f(),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[3,18,21,24]])}))),function(e){return n.apply(this,arguments)})},{key:"consumeFull",value:(r=d(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localWork.colloctEffectSelectWork(r);case 2:if(n=e.sent,e.t0=n&&t===k.EDataType.Local,!e.t0){e.next=7;break}return e.next=7,this.localWork.consumeFull(n);case 7:n&&t===k.EDataType.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"setCameraOpt",value:function(e){this.cameraOpt=e;var t=e.scale,r=e.centerX,n=e.centerY,i=e.width,o=e.height;(i!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:i,height:o}),this.fullLayer.setAttribute("scale",[t,t]),this.fullLayer.setAttribute("translate",[-r,-n]),this.topLayer.setAttribute("scale",[t,t]),this.topLayer.setAttribute("translate",[-r,-n]),this.localLayer.setAttribute("scale",[t,t]),this.localLayer.setAttribute("translate",[-r,-n]),this.serviceLayer.setAttribute("scale",[t,t]),this.serviceLayer.setAttribute("translate",[-r,-n])}},{key:"runBatchPostData",value:function(){this.mainThreadPostId||(this.mainThreadPostId=requestAnimationFrame(this.combinePost.bind(this)))}},{key:"combinePostData",value:function(){var e;this.mainThreadPostId=void 0;var t,r,n=[],i=g(this.combinePostMsg.values());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(null!=(e=o.sp)&&e.length){var a,s=g(o.sp);try{for(s.s();!(a=s.n()).done;){var u,l=a.value,c=!1,h=g(n);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(I.isEqual(l,d)){c=!0;break}}}catch(e){h.e(e)}finally{h.f()}c||n.push(l)}}catch(e){s.e(e)}finally{s.f()}}I.isNumber(o.drawCount)&&(t=o.drawCount)}}catch(e){i.e(e)}finally{i.f()}return this.combinePostMsg.clear(),{sp:n,drawCount:t}}},{key:"combinePost",value:function(){var e,t,r=this,n=this.combinePostData(),i=null==(e=n.sp)?void 0:e.filter((function(e){return e.type!==k.EPostMessageType.None||e.isLockSentEventCursor}));null!=i&&i.length?n.sp=i.map((function(e){return e.viewId?e:p(p({},e),{},{viewId:r.viewId})})):delete n.sp,void 0===n.drawCount&&delete n.drawCount,(null!=n&&n.drawCount||null!=(t=n.sp)&&t.length)&&this.opt.post(n)}},{key:"clearAll",value:function(){this.fullLayer.children.length&&(this.fullLayer.parent.children.forEach((function(e){"viewport"!==e.name&&e.remove()})),this.fullLayer.removeAllChildren()),this.clearCacheImages(),this.clearImageResolveMap(),this.localWork.clearAll(),this.topWork.clearAll(),this.serviceWork.clearAll(),this.vNodes.clear(),this.post({sp:[{type:k.EPostMessageType.Clear}]})}},{key:"consumeDrawAll",value:function(e,t){var r=t.toolsType,n=t.workId;if(n){var i=n.toString();if(r&&this.topWork.canUseTopLayer(r))return e===k.EDataType.Local&&(this.topWork.getLocalWorkShape(n.toString())||this.topWork.createLocalWork(t)),void this.topWork.consumeDrawAll(t);e===k.EDataType.Local&&(this.localWork.getWorkShape(i)||this.localWork.createLocalWork(t),this.localWork.consumeDrawAll(t,this.serviceWork))}}},{key:"consumeDraw",value:function(e,t){var r=t.opt,n=t.workId,i=t.toolsType;if(n&&i&&r){var o=n.toString();return this.topWork.canUseTopLayer(i)?(e===k.EDataType.Local&&(this.topWork.getLocalWorkShape(o)||this.topWork.createLocalWork(t)),void this.topWork.consumeDraw(t)):void(e===k.EDataType.Local?(this.localWork.getWorkShape(o)||this.localWork.createLocalWork(t),this.localWork.consumeDraw(t,this.serviceWork)):e===k.EDataType.Service&&this.serviceWork.consumeDraw(t))}}},{key:"updateCamera",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h,d,f,p,v,y,_,b,x,w,S,T,M,E,A,C,P,N,O,R,D,L,j,z,B,U,F,W,G,V,H,Y,$,X,q,Q,Z,K,J,ee,te=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.cameraOpt,i=t.scenePath,!n||I.isEqual(this.cameraOpt,n)){e.next=37;break}if(this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0),!i){e.next=28;break}o=!1,a=g(this.localWork.getWorkShapes().entries()),e.prev=5,a.s();case 7:if((s=a.n()).done){e.next=17;break}u=m(s.value,2),l=u[0],c=u[1],e.t0=c.toolsType,e.next=e.t0===k.EToolsKey.Text||e.t0===k.EToolsKey.BitMapEraser||e.t0===k.EToolsKey.PencilEraser||e.t0===k.EToolsKey.Eraser||e.t0===k.EToolsKey.Selector||e.t0===k.EToolsKey.LaserPen?12:13;break;case 12:return e.abrupt("break",15);case 13:return l!==k.Cursor_Hover_Id&&l!==k.Storage_Selector_key&&(o=!0),e.abrupt("break",15);case 15:e.next=7;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(5),a.e(e.t1);case 22:return e.prev=22,a.f(),e.finish(22);case 25:if(!o){e.next=28;break}return this.taskUpdateCameraId=setTimeout((function(){te.taskUpdateCameraId=void 0,te.updateCamera(t)}),k.Task_Time_Interval),e.abrupt("return");case 28:h=new Map,d=g(this.vNodes.getNodesByType(k.EToolsKey.Text).entries());try{for(d.s();!(f=d.n()).done;)p=m(f.value,2),v=p[0],y=p[1],_=y.rect,h.set(v,I.cloneDeep(_))}catch(e){d.e(e)}finally{d.f()}if(b=new Set(h.keys()),x=!1,this.localWork.hasSelector()&&(w=null==(r=this.localWork.getSelector())?void 0:r.selectIds)){x=!0,S=g(w);try{for(S.s();!(T=S.n()).done;)M=T.value,b.add(M)}catch(e){S.e(e)}finally{S.f()}}if(E=!1,this.serviceWork.selectorWorkShapes.size){A=g(this.serviceWork.selectorWorkShapes.values());try{for(A.s();!(C=A.n()).done;)if(P=C.value,N=P.selectIds){E=!0,O=g(N);try{for(O.s();!(R=O.n()).done;)D=R.value,b.add(D)}catch(e){O.e(e)}finally{O.f()}}}catch(e){A.e(e)}finally{A.f()}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(b),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId),L=g(h.entries());try{for(L.s();!(j=L.n()).done;)z=m(j.value,2),B=z[0],U=z[1],(F=this.vNodes.get(B))&&(W=U,G=F.rect,V=this.getSceneRect(),H=k.getRectMatrixrRelation(W,V),Y=k.getRectMatrixrRelation(G,V),$=!1,(H!==Y||W.w!==G.w||W.h!==G.h||Y===k.EMatrixrRelationType.intersect)&&($=!0),$&&(X=F.toolsType,q=F.opt,X===k.EToolsKey.Text&&q.workState===k.EvevtWorkState.Done&&this.debounceUpdateCache.add(B)))}catch(e){L.e(e)}finally{L.f()}if(x&&this.localWork.reRenderSelector(),E){Q=g(this.serviceWork.selectorWorkShapes.entries());try{for(Q.s();!(Z=Q.n()).done;)K=m(Z.value,2),J=K[0],ee=K[1],this.serviceWork.runSelectWork({workId:J,selectIds:ee.selectIds,msgType:k.EPostMessageType.Select,dataType:k.EDataType.Service,viewId:this.viewId})}catch(e){Q.e(e)}finally{Q.f()}}this.debounceUpdateCameraId=setTimeout((function(){var e;te.debounceUpdateCameraId=void 0;var t,r=[],n=g(te.debounceUpdateCache.values());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(null==(e=te.fullLayer)?void 0:e.getElementsByName(i)[0]){var o=te.vNodes.get(i);if(o){var a=o.toolsType,s=o.opt,u=o.rect,l=te.localWork.setFullWork({toolsType:a,opt:s,workId:i});if(l){var c=te.getSceneRect(),h=k.getRectMatrixrRelation(u,c);r.push(l.consumeServiceAsync({isFullWork:!0,replaceId:i,isDrawLabel:h!==k.EMatrixrRelationType.outside}))}}}te.debounceUpdateCache.delete(i)}}catch(e){n.e(e)}finally{n.f()}te.vNodes.updateLowLevelNodesRect(),te.vNodes.clearHighLevelIds()}),k.Task_Time_Interval)}case 37:case"end":return e.stop()}}),e,this,[[5,19,22,25]])}))),function(e){return t.apply(this,arguments)})},{key:"getSceneRect",value:function(){var e=this.scene,t=e.width,r=e.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(r)}}},{key:"createScene",value:function(e){return new E.Scene(p(p({displayRatio:this.opt.displayer.dpr,depth:!1,desynchronized:!0},e),{},{autoRender:!0,id:this.viewId,contextType:"2d"}))}},{key:"createLayer",value:function(e,t,r){var n=r.width,i=r.height,o="canvas-".concat(e),a=t.layer(o,p(p({},r),{},{offscreen:!1})),s=new E.Group({anchor:[.5,.5],pos:[.5*n,.5*i],size:[n,i],name:"viewport",id:e});return a.append(s),s}},{key:"updateScene",value:function(e){this.scene.attr(p({},e));var t=e.width,r=e.height;this.scene.width=t,this.scene.height=r,this.updateLayer({width:t,height:r})}},{key:"updateLayer",value:function(e){var t=e.width,r=e.height;this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",r),this.fullLayer.setAttribute("size",[t,r]),this.fullLayer.setAttribute("pos",[.5*t,.5*r]),this.topLayer.parent.setAttribute("width",t),this.topLayer.parent.setAttribute("height",r),this.topLayer.setAttribute("size",[t,r]),this.topLayer.setAttribute("pos",[.5*t,.5*r]),this.localLayer.parent.setAttribute("width",t),this.localLayer.parent.setAttribute("height",r),this.localLayer.setAttribute("size",[t,r]),this.localLayer.setAttribute("pos",[.5*t,.5*r]),this.serviceLayer.parent.setAttribute("width",t),this.serviceLayer.parent.setAttribute("height",r),this.serviceLayer.setAttribute("size",[t,r]),this.serviceLayer.setAttribute("pos",[.5*t,.5*r])}},{key:"destroy",value:function(){this.clearCacheImages(),this.clearImageResolveMap(),this.vNodes.clear(),this.fullLayer.remove(),this.topLayer.remove(),this.localLayer.remove(),this.serviceLayer.remove(),this.scene.remove(),this.localWork.destroy(),this.serviceWork.destroy(),this.topWork.destroy()}}]),e}(),$=function(){function e(t,r){b(this,e),M(this,"viewId"),M(this,"fullLayer"),M(this,"master"),M(this,"opt"),M(this,"scene"),M(this,"mainThreadPostId"),M(this,"combinePostMsg",new Set),M(this,"workShapes",new Map),M(this,"cacheImages",new Map),M(this,"imageResolveMap",new Map),this.viewId=t,this.opt=r,this.scene=this.createScene(p(p({},r.canvasOpt),{},{container:r.container})),this.master=r.master,this.fullLayer=this.createLayer("fullLayer",this.scene,p(p({},r.layerOpt),{},{bufferSize:this.viewId===k.Main_View_Id?6e3:3e3}))}var t,r,n,i,o,a;return w(e,[{key:"getCachedImages",value:function(e){return this.cacheImages.get(e)}},{key:"clearCacheImages",value:function(){this.cacheImages.forEach((function(e){return e.close()})),this.cacheImages.clear()}},{key:"clearImageResolveMap",value:function(){this.imageResolveMap.forEach((function(e){var t=e.timer;t&&clearTimeout(t)})),this.imageResolveMap.clear()}},{key:"post",value:function(e){this.combinePostMsg.add(e),this.runBatchPostData()}},{key:"on",value:(a=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.msgType,i=t.imageSrc,o=t.imageBitmap,a=t.workId,e.t0=n,e.next=e.t0===k.EPostMessageType.Snapshot?4:e.t0===k.EPostMessageType.BoundingBox?8:e.t0===k.EPostMessageType.GetImageBitMap?12:14;break;case 4:return e.next=6,this.getSnapshot(t);case 6:case 10:return this.destroy(),e.abrupt("return");case 8:return e.next=10,this.getBoundingRect(t);case 12:return i&&o&&this.cacheImages.set(i,o),a&&(s=a.toString(),(u=null==(r=this.imageResolveMap.get(s))?void 0:r.resolve)&&u(s)),e.abrupt("break",14);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"loadImageBitMap",value:(o=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.toolsType,n=t.opt,i=t.workId,!(r===k.EToolsKey.Image&&n&&n.src&&i)){e.next=9;break}if(o=n.src,a=this.cacheImages.has(o),s=i.toString(),a){e.next=8;break}return e.next=6,new Promise((function(e){var t=l.imageResolveMap.get(s)||{resolve:void 0,timer:void 0};t.timer&&clearTimeout(t.timer),t.resolve=e,t.timer=setTimeout((function(){var e=l.imageResolveMap.get(s);null!=e&&e.resolve&&e.resolve(s)}),5e3),l.imageResolveMap.set(s,t),l.opt.post({sp:[{imageSrc:o,workId:s,viewId:l.viewId,isgl:!!l.fullLayer.parent.gl,isSubWorker:!0,type:k.EPostMessageType.GetImageBitMap}]})}));case 6:u=e.sent,this.imageResolveMap.delete(u);case 8:return e.abrupt("return",this.cacheImages.get(o));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"createWorkShapeNode",value:function(e){return k.getShapeInstance(p(p({},e),{},{fullLayer:this.fullLayer,drawLayer:void 0}))}},{key:"setFullWork",value:function(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r&&n){var i,o=t.toString();return t&&this.workShapes.has(o)?null==(i=this.workShapes.get(o))||i.setWorkOptions(r):i=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:o}),i?(this.workShapes.set(o,i),i):void 0}}},{key:"runFullWork",value:(i=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.setFullWork(t),i=t.ops&&k.transformToNormalData(t.ops),!n){e.next=17;break}if(s=null==(r=n.getWorkId())?void 0:r.toString(),n.toolsType!==k.EToolsKey.Image){e.next=9;break}return e.next=6,n.consumeServiceAsync({isFullWork:!0,worker:this});case 6:o=e.sent,e.next=16;break;case 9:if(n.toolsType!==k.EToolsKey.Text){e.next=15;break}return e.next=12,n.consumeServiceAsync({isFullWork:!0,replaceId:s,isDrawLabel:!0});case 12:o=e.sent,e.next=16;break;case 15:o=n.consumeService({op:i,isFullWork:!0,replaceId:s}),a=(null==t?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);case 16:return e.abrupt("return",k.computRect(o,a));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getSnapshot",value:(n=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h,d,f,v,g,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,o=t.w,a=t.h,!(r&&n&&i)){e.next=23;break}this.setCameraOpt(i),u=0,l=Object.entries(n);case 4:if(!(u0&&Math.floor(e.w*this.opt.displayer.dpr||1)||1,o=e.h>0&&Math.floor(e.h*this.opt.displayer.dpr||1)||1;return createImageBitmap(this.fullLayer.parent.canvas,r,n,i,o,t)}},{key:"getSnapshotRender",value:(r=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.scenePath,o=t.options,(null==(r=this.fullLayer)?void 0:r.parent).render(),e.next=4,this.getRectImageBitmap(this.getSceneRect(),o);case 4:(a=e.sent)&&(this.post({sp:[{type:k.EPostMessageType.Snapshot,scenePath:i,imageBitmap:a,viewId:this.viewId}]}),null==(n=this.fullLayer)||n.removeAllChildren());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getBoundingRect",value:(t=d(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.scenePath,n=t.scenes,i=t.cameraOpt,!(r&&n&&i)){e.next=19;break}this.setCameraOpt(i),a=0,s=Object.entries(n);case 4:if(!(a=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t,r){return i=x()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&g(i,r.prototype),i},i.apply(null,arguments)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}}function u(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||p(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 l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){a=!0,i=e})),f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function p(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;S(this,e),this.x=t,this.y=r,this.z=n}return M(e,[{key:"setz",value:function(e){return this.z=e,this}},{key:"setXY",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y;return this.x=e,this.y=t,this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z;return this.x=e,this.y=t,this.z=r,this}},{key:"setTo",value:function(e){var t=e.x,r=void 0===t?0:t,n=e.y,i=void 0===n?0:n,o=e.z,a=void 0===o?1:o;return this.x=r,this.y=i,this.z=a,this}},{key:"rot",value:function(e){if(0===e)return this;var t=this.x,r=this.y,n=Math.sin(e),i=Math.cos(e);return this.x=t*i-r*n,this.y=t*n+r*i,this}},{key:"rotWith",value:function(e,t){if(0===t)return this;var r=this.x-e.x,n=this.y-e.y,i=Math.sin(t),o=Math.cos(t);return this.x=e.x+(r*o-n*i),this.y=e.y+(r*i+n*o),this}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subXY",value:function(e,t){return this.x-=e,this.y-=t,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addXY",value:function(e,t){return this.x+=e,this.y+=t,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"clamp",value:function(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,e),void 0!==t&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this}},{key:"div",value:function(e){return this.x/=e,this.y/=e,this}},{key:"divV",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"mul",value:function(e){return this.x*=e,this.y*=e,this}},{key:"mulV",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"abs",value:function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this}},{key:"nudge",value:function(t,r){var n=e.Tan(t,this);return this.add(n.mul(r))}},{key:"neg",value:function(){return this.x*=-1,this.y*=-1,this}},{key:"cross",value:function(e){return this.x=this.y*e.z-this.z*e.y,this.y=this.z*e.x-this.x*e.z,this}},{key:"dpr",value:function(t){return e.Dpr(this,t)}},{key:"cpr",value:function(t){return e.Cpr(this,t)}},{key:"len2",value:function(){return e.Len2(this)}},{key:"len",value:function(){return e.Len(this)}},{key:"pry",value:function(t){return e.Pry(this,t)}},{key:"per",value:function(){var e=this.x,t=this.y;return this.x=t,this.y=-e,this}},{key:"uni",value:function(){return e.Uni(this)}},{key:"tan",value:function(t){return e.Tan(this,t)}},{key:"dist",value:function(t){return e.Dist(this,t)}},{key:"distanceToLineSegment",value:function(t,r){return e.DistanceToLineSegment(t,r,this)}},{key:"slope",value:function(t){return e.Slope(this,t)}},{key:"snapToGrid",value:function(e){return this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this}},{key:"angle",value:function(t){return e.Angle(this,t)}},{key:"toAngle",value:function(){return e.ToAngle(this)}},{key:"lrp",value:function(e,t){return this.x=this.x+(e.x-this.x)*t,this.y=this.y+(e.y-this.y)*t,this}},{key:"equals",value:function(t,r){return e.Equals(this,t,r)}},{key:"equalsXY",value:function(t,r){return e.EqualsXY(this,t,r)}},{key:"norm",value:function(){var e=this.len();return this.x=0===e?0:this.x/e,this.y=0===e?0:this.y/e,this}},{key:"toFixed",value:function(){return e.ToFixed(this)}},{key:"toString",value:function(){return e.ToString(e.ToFixed(this))}},{key:"toJson",value:function(){return e.ToJson(this)}},{key:"toArray",value:function(){return e.ToArray(this)}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Add",value:function(t,r){return new e(t.x+r.x,t.y+r.y)}},{key:"AddXY",value:function(t,r,n){return new e(t.x+r,t.y+n)}},{key:"Sub",value:function(t,r){return new e(t.x-r.x,t.y-r.y)}},{key:"SubXY",value:function(t,r,n){return new e(t.x-r,t.y-n)}},{key:"AddScalar",value:function(t,r){return new e(t.x+r,t.y+r)}},{key:"SubScalar",value:function(t,r){return new e(t.x-r,t.y-r)}},{key:"Div",value:function(t,r){return new e(t.x/r,t.y/r)}},{key:"Mul",value:function(t,r){return new e(t.x*r,t.y*r)}},{key:"DivV",value:function(t,r){return new e(t.x/r.x,t.y/r.y)}},{key:"MulV",value:function(t,r){return new e(t.x*r.x,t.y*r.y)}},{key:"Neg",value:function(t){return new e(-t.x,-t.y)}},{key:"Per",value:function(t){return new e(t.y,-t.x)}},{key:"Dist2",value:function(t,r){return e.Sub(t,r).len2()}},{key:"Abs",value:function(t){return new e(Math.abs(t.x),Math.abs(t.y))}},{key:"Dist",value:function(e,t){return Math.hypot(e.y-t.y,e.x-t.x)}},{key:"Dpr",value:function(e,t){return e.x*t.x+e.y*t.y}},{key:"Cross",value:function(t,r){return new e(t.y*r.z-t.z*r.y,t.z*r.x-t.x*r.z)}},{key:"Cpr",value:function(e,t){return e.x*t.y-t.x*e.y}},{key:"Len2",value:function(e){return e.x*e.x+e.y*e.y}},{key:"Len",value:function(e){return Math.hypot(e.x,e.y)}},{key:"Pry",value:function(t,r){return e.Dpr(t,r)/e.Len(r)}},{key:"Uni",value:function(t){return e.Div(t,e.Len(t))}},{key:"Tan",value:function(t,r){return e.Uni(e.Sub(t,r))}},{key:"Min",value:function(t,r){return new e(Math.min(t.x,r.x),Math.min(t.y,r.y))}},{key:"Max",value:function(t,r){return new e(Math.max(t.x,r.x),Math.max(t.y,r.y))}},{key:"From",value:function(t){return(new e).add(t)}},{key:"FromArray",value:function(t){return new e(t[0],t[1])}},{key:"Rot",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Math.sin(r),i=Math.cos(r);return new e(t.x*i-t.y*n,t.x*n+t.y*i)}},{key:"RotWith",value:function(t,r,n){var i=t.x-r.x,o=t.y-r.y,a=Math.sin(n),s=Math.cos(n);return new e(r.x+(i*s-o*a),r.y+(i*a+o*s))}},{key:"NearestPointOnLineThroughPoint",value:function(t,r,n){return e.Mul(r,e.Sub(n,t).pry(r)).add(t)}},{key:"NearestPointOnLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=e.Tan(r,t),a=e.Add(t,e.Mul(o,e.Sub(n,t).pry(o)));if(i){if(a.xMath.max(t.x,r.x))return e.Cast(t.x>r.x?t:r);if(a.yMath.max(t.y,r.y))return e.Cast(t.y>r.y?t:r)}return a}},{key:"DistanceToLineThroughPoint",value:function(t,r,n){return e.Dist(n,e.NearestPointOnLineThroughPoint(t,r,n))}},{key:"DistanceToLineSegment",value:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e.Dist(n,e.NearestPointOnLineSegment(t,r,n,i))}},{key:"Snap",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}},{key:"Cast",value:function(t){return t instanceof e?t:e.From(t)}},{key:"Slope",value:function(e,t){return e.x===t.y?NaN:(e.y-t.y)/(e.x-t.x)}},{key:"Angle",value:function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}},{key:"Lrp",value:function(t,r,n){return e.Sub(r,t).mul(n).add(t)}},{key:"Med",value:function(t,r){return new e((t.x+r.x)/2,(t.y+r.y)/2)}},{key:"Equals",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-4;return Math.abs(e.x-t.x)2&&void 0!==arguments[2]?arguments[2]:1e-4;return e.Equals(t,r,n)&&Math.abs((t.z||0)-(r.z||0))1&&void 0!==arguments[1]?arguments[1]:2;return new e(+t.x.toFixed(r),+t.y.toFixed(r),+t.z.toFixed(r))}},{key:"Nudge",value:function(t,r,n){return e.Add(t,e.Tan(r,t).mul(n))}},{key:"ToString",value:function(e){return"".concat(e.x,", ").concat(e.y)}},{key:"ToAngle",value:function(e){var t=Math.atan2(e.y,e.x);return t<0&&(t+=2*Math.PI),t}},{key:"FromAngle",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new e(Math.cos(t)*r,Math.sin(t)*r)}},{key:"ToArray",value:function(e){return[e.x,e.y,e.z]}},{key:"ToJson",value:function(e){return{x:e.x,y:e.y,z:e.z}}},{key:"Average",value:function(t){for(var r=t.length,n=new e(0,0),i=0;i2&&void 0!==arguments[2]?arguments[2]:6,i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:8;return new e(Math.round(t.x/r)*r,Math.round(t.y/r)*r)}}]),e}(),ne=function(e){return e<.5?2*e*e:(4-2*e)*e-1},ie=function(e){m(r,e);var t=y(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return S(this,r),(e=t.call(this,n,i,o)).x=n,e.y=i,e.z=o,e.v=a,e.t=s,e.a=u,e}return M(r,[{key:"setA",value:function(e){this.a=e}},{key:"setT",value:function(e){this.t=e}},{key:"setv",value:function(e){return this.v={x:e.x,y:e.y},this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.x,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.v,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.a;return this.x=e,this.y=t,this.z=r,this.v=n,this.t=i,this.a=o,this}},{key:"clone",value:function(){var e=this.x,t=this.y,n=this.z,i=this.v,o=this.t,a=this.a;return new r(e,t,n,{x:i.x,y:i.y},o,a)}},{key:"distance",value:function(e){return r.GetDistance(this,e)}},{key:"isNear",value:function(e,t){return r.IsNear(this,e,t)}},{key:"getAngleByPoints",value:function(e,t){return r.GetAngleByPoints(e,this,t)}},{key:"timestamp",get:function(){return this.t}},{key:"pressure",get:function(){return this.z}},{key:"angleNum",get:function(){return this.a}},{key:"XY",get:function(){return[this.x,this.y]}}],[{key:"Sub",value:function(e,t){return new r(e.x-t.x,e.y-t.y)}},{key:"Add",value:function(e,t){return new r(e.x+t.x,e.y+t.y)}},{key:"GetDistance",value:function(e,t){return r.Len(e.clone().sub(t))}},{key:"GetAngleByPoints",value:function(e,t,r){var n=t.x-e.x,i=r.x-t.x,o=t.y-e.y,a=r.y-t.y,s=0,u=Math.sqrt(n*n+o*o),l=Math.sqrt(i*i+a*a);if(u&&l){var c=n*i+o*a,h=n*a-o*i;s=180+(h=h>0?1:-1)*(s=(s=Math.acos(c/(u*l)))/Math.PI*180)}return s}},{key:"IsNear",value:function(e,t,n){return r.Len(e.clone().sub(t))3&&void 0!==arguments[3]?arguments[3]:2,o=e.x-t.x,a=e.y-t.y,s=Math.sin(n),u=Math.cos(n),l=Math.pow(10,i),c=Math.floor((t.x+(o*u-a*s))*l)/l,h=Math.floor((t.y+(o*s+a*u))*l)/l;return new r(c,h)}},{key:"GetDotStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,i=new re(1,1),o=Math.PI+.001,a=r.Add(e,r.Sub(e,i).uni().per().mul(-t)),s=[],u=1/n,l=u;l<=1;l+=u)s.push(r.RotWith(a,e,2*o*l));return s}},{key:"GetSemicircleStroke",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,o=n*(Math.PI+.001),a=[],s=1/i,u=s;u<=1;u+=s)a.push(r.RotWith(t,e,o*u));return a}}]),r}(re),oe=("undefined"==typeof globalThis?"undefined":k(globalThis))<"u"?globalThis:("undefined"==typeof window?"undefined":k(window))<"u"?window:(void 0===r.g?"undefined":k(r.g))<"u"?r.g:("undefined"==typeof self?"undefined":k(self))<"u"?self:{};function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se="object"==k(oe)&&oe&&oe.Object===Object&&oe,ue=se,le="object"==("undefined"==typeof self?"undefined":k(self))&&self&&self.Object===Object&&self,ce=ue||le||Function("return this")(),he=ce.Symbol,de=he,fe=Object.prototype,pe=fe.hasOwnProperty,ve=fe.toString,me=de?de.toStringTag:void 0;var ge=function(e){var t=pe.call(e,me),r=e[me];try{e[me]=void 0;var n=!0}catch(e){}var i=ve.call(e);return n&&(t?e[me]=r:delete e[me]),i},ye=Object.prototype.toString;var _e=function(e){return ye.call(e)},be=ge,xe=_e,we=he?he.toStringTag:void 0;var Se=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":we&&we in Object(e)?be(e):xe(e)};var Te=function(e){return null!=e&&"object"==k(e)},Me=Se,ke=Te;var Ee=function(e){return"number"==typeof e||ke(e)&&"[object Number]"==Me(e)},Ie=ae(Ee);var Ae=function(){this.__data__=[],this.size=0};var Ce=function(e,t){return e===t||e!=e&&t!=t},Pe=Ce;var Ne=function(e,t){for(var r=e.length;r--;)if(Pe(e[r][0],t))return r;return-1},Oe=Ne,Re=Array.prototype.splice;var De=function(e){var t=this.__data__,r=Oe(t,e);return!(r<0)&&(r==t.length-1?t.pop():Re.call(t,r,1),--this.size,!0)},Le=Ne;var je=function(e){var t=this.__data__,r=Le(t,e);return r<0?void 0:t[r][1]},ze=Ne;var Be=function(e){return ze(this.__data__,e)>-1},Ue=Ne;var Fe=function(e,t){var r=this.__data__,n=Ue(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},We=Ae,Ge=De,Ve=je,He=Be,Ye=Fe;function $e(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Kr=Se,Jr=Zr,en=Te,tn={};tn["[object Float32Array]"]=tn["[object Float64Array]"]=tn["[object Int8Array]"]=tn["[object Int16Array]"]=tn["[object Int32Array]"]=tn["[object Uint8Array]"]=tn["[object Uint8ClampedArray]"]=tn["[object Uint16Array]"]=tn["[object Uint32Array]"]=!0,tn["[object Arguments]"]=tn["[object Array]"]=tn["[object ArrayBuffer]"]=tn["[object Boolean]"]=tn["[object DataView]"]=tn["[object Date]"]=tn["[object Error]"]=tn["[object Function]"]=tn["[object Map]"]=tn["[object Number]"]=tn["[object Object]"]=tn["[object RegExp]"]=tn["[object Set]"]=tn["[object String]"]=tn["[object WeakMap]"]=!1;var rn=function(e){return en(e)&&Jr(e.length)&&!!tn[Kr(e)]};var nn=function(e){return function(t){return e(t)}},on={exports:{}};!function(e,t){var r=se,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(on,on.exports);var an=on.exports,sn=rn,un=nn,ln=an&&an.isTypedArray,cn=ln?un(ln):sn,hn=Rr,dn=Vr,fn=Hr,pn=Xr,vn=Qr,mn=cn,gn=Object.prototype.hasOwnProperty;var yn=function(e,t){var r=fn(e),n=!r&&dn(e),i=!r&&!n&&pn(e),o=!r&&!n&&!i&&mn(e),a=r||n||i||o,s=a?hn(e.length,String):[],u=s.length;for(var l in e)(t||gn.call(e,l))&&(!a||!("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||vn(l,u)))&&s.push(l);return s},_n=Object.prototype;var bn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_n)};var xn=function(e,t){return function(r){return e(t(r))}},wn=xn(Object.keys,Object),Sn=bn,Tn=wn,Mn=Object.prototype.hasOwnProperty;var kn=function(e){if(!Sn(e))return Tn(e);var t=[];for(var r in Object(e))Mn.call(e,r)&&"constructor"!=r&&t.push(r);return t},En=nt,In=Zr;var An=function(e){return null!=e&&In(e.length)&&!En(e)},Cn=yn,Pn=kn,Nn=An;var On=function(e){return Nn(e)?Cn(e):Pn(e)},Rn=Or,Dn=On;var Ln=function(e,t){return e&&Rn(t,Dn(t),e)};var jn=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},zn=et,Bn=bn,Un=jn,Fn=Object.prototype.hasOwnProperty;var Wn=function(e){if(!zn(e))return Un(e);var t=Bn(e),r=[];for(var n in e)"constructor"==n&&(t||!Fn.call(e,n))||r.push(n);return r},Gn=yn,Vn=Wn,Hn=An;var Yn=function(e){return Hn(e)?Gn(e,!0):Vn(e)},$n=Or,Xn=Yn;var qn=function(e,t){return e&&$n(t,Xn(t),e)},Qn={exports:{}};!function(e,t){var r=ce,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n?r.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}}(Qn,Qn.exports);var Zn=Qn.exports;var Kn=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r1&&void 0!==arguments[1])||arguments[1],r=e.length;if(r<2)return"";var n=e[0],i=e[1];if(2===r)return"M".concat(iu(n),"L").concat(iu(i));for(var o="",a=2,s=r-1;a3?"T":"").concat(o,"L").concat(iu(e[r-1]))}var ba=function(){function e(t){S(this,e),I(this,"syncUnitTime",ya.syncOpt.interval),I(this,"vNodes"),I(this,"drawLayer"),I(this,"fullLayer"),I(this,"workId");var r=t.vNodes,n=t.fullLayer,i=t.drawLayer,o=t.workId,a=t.toolsOpt;this.vNodes=r,this.fullLayer=n,this.drawLayer=i,this.workId=o,this.syncUnitTime=a.syncUnitTime||this.syncUnitTime}return M(e,[{key:"filterSamePoints",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.01;return e.reduce((function(e,r){var n=e[e.length-1];return(r&&!n||r&&n&&!r.isNear(n,t))&&e.push(r),e}),[])}},{key:"setWorkId",value:function(e){this.workId=e}},{key:"getWorkId",value:function(){return this.workId}},{key:"getWorkOptions",value:function(){return this.workOptions}},{key:"setWorkOptions",value:function(e){var t,r,n;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var i=null==(t=this.workId)?void 0:t.toString(),o=i&&(null==(r=this.vNodes)?void 0:r.get(i))||void 0;i&&o&&(o.opt=e,null==(n=this.vNodes)||n.setInfo(i,o))}},{key:"updataOptService",value:function(t){var r,n,i,o=null==(r=this.workId)?void 0:r.toString();if(o&&t){var a=this.fullLayer.getElementsByName(o)||this.drawLayer&&this.drawLayer.getElementsByName(o)||[];if(1!==a.length)return;var s=a[0],u=t.pos,l=t.zIndex,c=t.scale,h=t.angle,d=t.translate,f={};Ie(l)&&(f.zIndex=l),u&&(f.pos=[u[0],u[1]]),c&&(f.scale=c),h&&(f.rotate=h),d&&(f.translate=d),s.attr(f);var p=null==s?void 0:s.getBoundingClientRect();return p&&(i=Ys(i,{x:Math.floor(p.x-e.SafeBorderPadding),y:Math.floor(p.y-e.SafeBorderPadding),w:Math.floor(p.width+2*e.SafeBorderPadding),h:Math.floor(p.height+2*e.SafeBorderPadding)})),null==(n=this.vNodes)||n.setInfo(o,{rect:i,centerPos:u}),i}}},{key:"drawEraserlines",value:function(e){var t,r=e.group,n=e.eraserlines,i=e.pos,o=e.layer,a=e.isClear,s=void 0===a||a,u=!!o.parent.gl,l=f(n);try{for(l.s();!(t=l.n()).done;){var c,h=t.value,d=h.thickness,p=f(h.op);try{for(p.s();!(c=p.n()).done;){var v=c.value.map((function(e,t){return t%2?e-i[1]:e-i[0]})),m={pos:[0,0],d:_a(this.computEraserPoints(v,d),!0),fillColor:"rgba(0,0,0,1)"},g=new C.Path(m);s&&(g.addEventListener("beforerender",(function(e){var t=e.detail.context;u?t.blendFuncSeparate(t.ZERO,t.ZERO,t.ZERO,t.ZERO):t.globalCompositeOperation="destination-out"})),g.addEventListener("afterrender",(function(e){var t=e.detail.context;u?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):t.globalCompositeOperation="source-over"}))),r.append(g)}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}}},{key:"computEraserPoints",value:function(e,t){var r=Math.ceil(t/2);return 2===e.length?this.computDot(e,r):this.computLine(e,r)}},{key:"computDot",value:function(e,t){var r=new ie(e[0],e[1]);return ie.GetDotStroke(r,t,8)}},{key:"computLine",value:function(e,t){for(var r,n,i=[],o=[],a=0;a1)for(var s=1;sthis.syncUnitTime&&(m=!0,this.syncTimestamp=h[0].taskId,this.syncIndex=this.tmpPoints.length),i||o)){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({attrs:v,tasks:h,effects:d,layer:y,replaceId:s})}if(i)return f>10&&this.tmpPoints.splice(0,f-10),{rect:p,type:X.DrawWork,dataType:Y.Local};var _=[];return this.tmpPoints.slice(g).forEach((function(e){_.push(e.x,e.y,t.computRadius(e.z,t.workOptions.thickness))})),c(c({},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local,rect:p,op:m?_:void 0,index:m?3*g:void 0,updateNodeOpt:{useAnimation:!0}})}},{key:"consumeAll",value:function(e){var t,r=this.workId;if(e.data){var n=e.data,i=n.op,o=n.workState;null!=i&&i.length&&o===$.Done&&this.workOptions.strokeType===U.Stroke&&this.updateTempPointsWithPressureWhenDone(i)}var a,s=this.transformDataAll(!0),u={name:r},l=this.fullLayer;if(s.length&&(a=this.draw({attrs:u,tasks:s,replaceId:r,layer:l})),this.tmpPoints.length<2)return this.replace(l,r),{type:X.RemoveNode,removeIds:[r],rect:a};var h=[];this.tmpPoints.map((function(e){h.push(e.x,e.y,e.z)})),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var d=Sa(h);return null==(t=this.vNodes)||t.setInfo(r,{rect:a,op:h,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&xa.getCenterPos(a,l)}),c(c({},this.baseConsumeResult),{},{rect:a,type:X.FullWork,dataType:Y.Local,ops:d,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}})}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId;this.tmpPoints.length=0;for(var a=0;a0){var u=this.tmpPoints[this.tmpPoints.length-1],l=re.Sub(s,u).uni();s.setv(l)}this.tmpPoints.push(s)}if(!(this.tmpPoints.length<2)){var c,h=this.transformDataAll(!0),d=null==(t=this.workId)?void 0:t.toString(),f={name:d};if(d&&h.length){var p=i?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({attrs:f,tasks:h,replaceId:o,layer:p}),null==(r=this.vNodes)||r.setInfo(d,{rect:c,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&xa.getCenterPos(c,p)})}return c}}},{key:"transformDataAll",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(t,e&&this.workOptions.thickness||void 0)}},{key:"draw",value:function(e){var t,r=this,n=e.attrs,i=e.tasks,o=e.replaceId,a=e.effects,s=e.layer,l=this.workOptions,h=l.strokeColor,d=l.strokeType,f=l.thickness,p=l.zIndex,v=l.scale,m=l.rotate,g=l.translate,y=l.eraserlines;null!=a&&a.size&&(a.forEach((function(e){var t;null==(t=s.getElementById(e+""))||t.remove()})),a.clear());for(var _=[],b=s.worldPosition,x=s.worldScaling,w=0;w1&&(s=e[n+1].point.v);var u=re.Per(s).mul(a);t.push(ie.Sub(o,u)),r.push(ie.Add(o,u))}var l=e[e.length-1],c=ie.GetSemicircleStroke(l.point,t[t.length-1],-1,8),h=ie.GetSemicircleStroke(e[0].point,r[0],-1,8),d=t.concat(c,r.reverse(),h);return{ps:d,rect:Xs(d)}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:ie.GetDotStroke(t,r,8),rect:n}}},{key:"transformData",value:function(e,t){var r=e.op,n=e.workState,i=this.tmpPoints.length-1,o=[];if(null!=r&&r.length&&n){var a=this.workOptions,s=a.strokeType,u=a.thickness,l=new Set;i=s===U.Stroke?this.updateTempPointsWithPressure(r,u,l):this.updateTempPoints(r,u,l);var c=t?this.tmpPoints:this.tmpPoints.slice(i);return{tasks:o=this.getTaskPoints(c,u),effects:l,consumeIndex:i}}return{tasks:o,consumeIndex:i}}},{key:"computRadius",value:function(e,t){return.03*e*t+.5*t}},{key:"getMinZ",value:function(e,t){return 100*((t||Math.max(1,Math.floor(.3*e)))-.5*e)/e/3}},{key:"getTaskPoints",value:function(e,t){var r,n=[];if(0===e.length)return[];for(var i=0,o=e[0].x,a=e[0].y,s=[o,a],l=[],c=e[0].t;i0&&i270){var g=null==(r=l.pop())?void 0:r.point.clone();g&&n.push({taskId:c,pos:s,points:[].concat(u(l),[{point:g,radius:v}])}),s=[o=e[i].x,a=e[i].y];var y=h.x-o,_=h.y-a;l=[{point:new ie(y,_,p),radius:v}],c=Date.now()}}i++}return n.push({taskId:c,pos:s,points:l}),n}},{key:"updateTempPointsWithPressure",value:function(e,t,r){for(var n=Date.now(),i=this.tmpPoints.length,o=i,a=0;a1)for(var d=s-1;d>0;){var f=this.tmpPoints[d].distance(this.tmpPoints[d-1]),p=Math.max(this.tmpPoints[d].z-this.uniThickness*f,0);if(this.tmpPoints[d-1].z>=p)break;this.tmpPoints[d-1].setz(p),o=Math.min(o,d-1),d--}}else o=1/0;else{u.setv(h);var v=u.distance(c),m=Math.max(c.z-this.uniThickness*v,0);s>1&&re.Equals(h,c.v,.02)&&(m>0||c.z<=0)&&(r&&c.t&&r.add(c.t),this.tmpPoints.pop(),o=Math.min(l,o)),u.setz(m),this.tmpPoints.push(u)}}else this.tmpPoints.push(u)}if(o===1/0)return this.tmpPoints.length;var g=i;if(o===i){g=Math.max(g-1,0);var y=this.tmpPoints[g].t;y&&(null==r||r.add(y))}else{var _=i-1;for(g=o;_>=0;){var b=this.tmpPoints[_].t;if(b&&(null==r||r.add(b),_<=o)){g=_,_=-1;break}_--}}return this.tmpPoints[g].setT(n),g}},{key:"updateTempPoints",value:function(e,t,r){for(var n,i=Date.now(),o=this.tmpPoints.length,a=o,s=0;s=0;){var m=null==(n=this.tmpPoints[v])?void 0:n.t;if(m&&(null==r||r.add(m),v<=a)){f=v,v=-1;break}v--}}return this.tmpPoints[f].setT(i),f}},{key:"updateTempPointsWithPressureWhenDone",value:function(e){for(var t=this.workOptions.thickness,r=e.length,n=this.getMinZ(t),i=0;i1&&u.z===n)break;if(a.isNear(u,t/2)){if(r<3&&u.z1))for(var h=o-1;h>0;){var d=this.tmpPoints[h].distance(this.tmpPoints[h-1]),f=Math.max(this.tmpPoints[h].z-this.uniThickness*d,-t/4);if(this.tmpPoints[h-1].z>=f)break;this.tmpPoints[h-1].setz(f),h--}}else{a.setv(l);var p=Math.max(u.z-this.uniThickness*c,n);o>1&&re.Equals(l,u.v,.02)&&u.z<=0&&this.tmpPoints.pop(),a.setz(p),this.tmpPoints.push(a)}}else this.tmpPoints.push(a)}}}],[{key:"updateNodeOpt",value:function(e){var t,r,n=e.node,i=e.opt,o=e.vNodes,a=i.strokeColor,s=i.strokeType,u=o.get(n.name);return a&&("GROUP"===n.tagName?nu(n)?n.setAttribute("bgcolor",a):n.children.forEach((function(e){e.setAttribute("strokeColor",a),e.getAttribute("fillColor")&&e.setAttribute("fillColor",a)})):(n.setAttribute("strokeColor",a),n.setAttribute("fillColor",a)),null!=(t=null==u?void 0:u.opt)&&t.strokeColor&&(u.opt.strokeColor=a)),s&&null!=u&&u.opt&&null!=(r=u.opt)&&r.strokeType&&(u.opt.strokeType=s),u&&o.setInfo(n.name,u),xa.updateNodeOpt(e)}}]),r}(xa),ka=function(e){m(n,e);var t,r=y(n);function n(e){var t;return S(this,n),t=r.call(this,e),I(b(t),"toolsType",H.LaserPen),I(b(t),"canRotate",!1),I(b(t),"scaleType",K.none),I(b(t),"syncTimestamp"),I(b(t),"syncIndex",0),I(b(t),"tmpPoints",[]),I(b(t),"workOptions"),I(b(t),"consumeIndex",0),t.workOptions=e.toolsOpt,t.syncTimestamp=0,t}return M(n,[{key:"combineConsume",value:function(){}},{key:"setWorkOptions",value:function(e){d(w(n.prototype),"setWorkOptions",this).call(this,e),this.syncTimestamp=Date.now()}},{key:"consume",value:function(e){var t=e.data,r=e.isSubWorker,n=t.workId,i=t.op;if(0===(null==i?void 0:i.length))return{type:X.None};if(this.updateTempPoints(i||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:X.None};var o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType,l=Xs(this.tmpPoints,s),h=!1,d=this.syncIndex,f=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,0===this.syncTimestamp&&(this.syncTimestamp=Date.now());var p={name:null==n?void 0:n.toString(),opacity:1,lineDash:u===U.Dotted?[1,2*s]:u===U.LongDotted?[s,2*s]:void 0,strokeColor:a,lineCap:"round",lineWidth:s,anchor:[.5,.5]},v=this.getTaskPoints(f);if(v.length){var m=Date.now();m-this.syncTimestamp>this.syncUnitTime&&(h=!0,this.syncTimestamp=m,this.syncIndex=this.tmpPoints.length),r&&this.draw({attrs:p,tasks:v,isDot:!1,layer:this.drawLayer||this.fullLayer})}var g=[];return this.tmpPoints.slice(d).forEach((function(e){g.push(e.x,e.y)})),c({rect:{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]},type:X.DrawWork,dataType:Y.Local,op:h?g:void 0,index:h?2*d:void 0},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t,r=null==(e=this.workId)?void 0:e.toString();if(this.tmpPoints.length-1>this.consumeIndex){var n=this.tmpPoints.slice(this.consumeIndex),i=1===n.length,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(i){var l=this.computDotStroke({point:n[0],radius:s/2});n=l.ps,t=l.rect}else t=Xs(this.tmpPoints,s);var h={name:null==r?void 0:r.toString(),fillColor:i?a:void 0,opacity:1,lineDash:u!==U.Dotted||i?u!==U.LongDotted||i?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:i?void 0:"round",lineWidth:i?0:s,anchor:[.5,.5]},d=this.getTaskPoints(n);d.length&&this.draw({attrs:h,tasks:d,isDot:i,layer:this.drawLayer||this.fullLayer})}var f=[];this.tmpPoints.forEach((function(e){f.push(e.x,e.y)}));var p=Sa(f);return c({rect:t&&{x:t.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:t.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:t.w*this.fullLayer.worldScaling[0],h:t.h*this.fullLayer.worldScaling[1]},type:X.FullWork,dataType:Y.Local,ops:p,index:2*this.syncIndex},this.baseConsumeResult)}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}},{key:"consumeService",value:function(e){var t,r=e.op,n=e.replaceId,i=e.isFullWork,o=this.workOptions,a=o.strokeColor,s=o.thickness,u=o.strokeType;if(!r.length){var l=Xs(this.tmpPoints,s);return{x:l.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:l.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:l.w*this.fullLayer.worldScaling[0],h:l.h*this.fullLayer.worldScaling[1]}}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var h,d=this.tmpPoints.slice(c),f=1===d.length;if(f){var p=this.computDotStroke({point:d[0],radius:s/2});d=p.ps,h=p.rect}else h=Xs(this.tmpPoints,s);var v={name:null==(t=this.workId)?void 0:t.toString(),fillColor:f?a:void 0,opacity:1,lineDash:u!==U.Dotted||f?u!==U.LongDotted||f?void 0:[s,2*s]:[1,2*s],strokeColor:a,lineCap:f?void 0:"round",lineWidth:f?0:s,anchor:[.5,.5]},m=this.getTaskPoints(d);if(m.length){var g=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:v,tasks:m,isDot:f,replaceId:n,layer:g})}return{x:h.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:h.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:h.w*this.fullLayer.worldScaling[0],h:h.h*this.fullLayer.worldScaling[1]}}},{key:"computDotStroke",value:function(e){var t=e.point,r=e.radius,n={x:t.x-r,y:t.y-r,w:2*r,h:2*r};return{ps:ie.GetDotStroke(t,r,8),rect:n}}},{key:"updateTempPoints",value:function(e){for(var t=this.tmpPoints.length,r=0;r0&&n270){var f=null==(t=s.pop())?void 0:t.clone();f&&r.push({pos:a,points:[].concat(u(s),[f])}),a=[i=e[n].x,o=e[n].y];var p=l.x-i,v=l.y-o;s=[new ie(p,v)]}}n++}return r.push({pos:a,points:s}),r}},{key:"removeLocal",value:function(){}},{key:"removeService",value:function(e){var t,r=[];return this.fullLayer.getElementsByName(e).forEach((function(n){if(n.name===e){var i=n.getBoundingClientRect();t=Ys(t,{x:i.x,y:i.y,w:i.width,h:i.height}),r.push(n)}})),r.length&&r.forEach((function(e){return e.remove()})),t}}]),n}(xa),Ea=function(e){m(r,e);var t=y(r);function r(e,n){var i;return S(this,r),i=t.call(this,e),I(b(i),"canRotate",!1),I(b(i),"scaleType",K.none),I(b(i),"toolsType",H.Eraser),I(b(i),"serviceWork"),I(b(i),"tmpPoints",[]),I(b(i),"workOptions"),I(b(i),"worldPosition"),I(b(i),"worldScaling"),I(b(i),"eraserRect"),I(b(i),"eraserPolyline"),i.serviceWork=n,i.workOptions=e.toolsOpt,i.worldPosition=i.fullLayer.worldPosition,i.worldScaling=i.fullLayer.worldScaling,i}return M(r,[{key:"combineConsume",value:function(){}},{key:"consumeService",value:function(){}},{key:"setWorkOptions",value:function(e){d(w(r.prototype),"setWorkOptions",this).call(this,e)}},{key:"createEraserRect",value:function(e){var t=e[0]*this.worldScaling[0]+this.worldPosition[0],n=e[1]*this.worldScaling[1]+this.worldPosition[1],i=r.eraserSizes[this.workOptions.thickness],o=i.width,a=i.height;this.eraserRect={x:t-.5*o,y:n-.5*a,w:o,h:a},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h]}},{key:"computRectCenterPoints",value:function(){var e=this.tmpPoints.slice(-2);if(4===this.tmpPoints.length){var t=new re(this.tmpPoints[0],this.tmpPoints[1]),n=new re(this.tmpPoints[2],this.tmpPoints[3]),i=re.Sub(n,t).uni(),o=re.Dist(t,n),a=r.eraserSizes[this.workOptions.thickness],s=a.width,u=a.height,l=Math.min(s,u),c=Math.round(o/l);if(c>1){for(var h=[],d=0;d1?N.polyline(c.map((function(e){return e.XY})),this.eraserPolyline).length&&o.add(s.name):o.add(s.name),t=Ys(t,p))}}}catch(e){a.e(e)}finally{a.f()}return o.forEach((function(e){var t,r=n.fullLayer.getElementsByName(e);n.fullLayer.removeChild(r[0]),null==(t=n.vNodes)||t.delete(e)})),t&&(t.x-=xa.SafeBorderPadding,t.y-=xa.SafeBorderPadding,t.w+=2*xa.SafeBorderPadding,t.h+=2*xa.SafeBorderPadding),t}},{key:"consume",value:function(e){var t=e.data.op;if(!t||0===t.length)return c({type:X.None},this.baseConsumeResult);var r=this.tmpPoints.length;if(r>1&&this.isNear([t[0],t[1]],[this.tmpPoints[r-2],this.tmpPoints[r-1]]))return c({type:X.None},this.baseConsumeResult);r<3?this.tmpPoints.push(t[0],t[1]):this.tmpPoints.splice(2,2,t[0],t[1]);var n,i=this.computRectCenterPoints(),o=new Set;if(!this.vNodes)return c({type:X.None},this.baseConsumeResult);for(var a=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap)),s=0;ss))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var h=-1,d=!0,f=2&r?new Ua:void 0;for(o.set(e,t),o.set(t,e);++h0&&void 0!==arguments[0])||arguments[0],t=Xs(this.tmpPoints);if(0===t.w||0===t.h)return{selectIds:[],intersectRect:void 0,subNodeMap:new Map};var r=this.vNodes.getRectIntersectRange(t,e),n=r.rectRange,i=r.nodeRange;return{selectIds:u(i.keys()),intersectRect:n,subNodeMap:i}}},{key:"updateTempPoints",value:function(e){var t=this.tmpPoints.length,r=e.length;if(r>1){var n=new ie(e[r-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[r-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);2===t?this.tmpPoints.splice(1,1,n):this.tmpPoints.push(n)}}},{key:"drawSelector",value:function(e){var t=this,r=e.drawRect,i=e.subNodeMap,o=e.selectorId,a=e.layer,s=e.isService,u=new C.Group({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:o,name:o,zIndex:9999}),l=[];if(s){var c=new C.Rect({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:n.selectorBorderId});l.push(c)}i.forEach((function(e,n){var o=[e.rect.x+e.rect.w/2-r.x,e.rect.y+e.rect.h/2-r.y],a=new C.Rect({normalize:!0,pos:o,lineWidth:1,strokeColor:i.size>1?t.selectorColor||t.workOptions.strokeColor:void 0,width:e.rect.w,height:e.rect.h,id:"selector-".concat(n),name:"selector-".concat(n)});l.push(a)})),l&&u.append.apply(u,l),(null==a?void 0:a.parent).appendChild(u)}},{key:"draw",value:function(e,t,r){var n,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=r.intersectRect,s=r.subNodeMap;null==(i=null==(n=t.parent)?void 0:n.getElementById(e))||i.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:s,selectorId:e,layer:t,isService:o})}},{key:"getSelecteorInfo",value:function(e){this.scaleType=K.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0,this.thickness=void 0,this.strokeType=void 0,this.useStroke=!1;var t,r,n=new Set,i=!0,o=f(e.values());try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.opt,l=a.canRotate,c=a.scaleType,h=a.toolsType;this.selectorColor=this.workOptions.strokeColor,s.strokeColor&&(this.strokeColor=s.strokeColor),s.fillColor&&(this.fillColor=s.fillColor),s.textOpt&&(this.textOpt=s.textOpt),s.thickness&&(this.thickness=s.thickness),h!==H.Pencil&&(i=!1),s.strokeType&&(this.strokeType=s.strokeType),h===H.SpeechBalloon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=s.placement),h===H.Polygon&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices),h===H.Star&&(n.add(h),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=s.vertices,this.shapeOpt.innerRatio=s.innerRatio,this.shapeOpt.innerVerticeStep=s.innerVerticeStep),h===H.Text&&(this.textOpt=s),1===e.size&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=l,this.scaleType=c),c===K.none&&(this.scaleType=c),h===H.Image&&(t=a)}}catch(e){o.e(e)}finally{o.f()}i&&(this.useStroke=!0),n.size&&(this.toolsTypes=u(n)),t&&(1===e.size?(this.canLock=!0,t.opt.locked&&(this.isLocked=!0,this.scaleType=K.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1,this.thickness=void 0,this.strokeType=void 0,this.useStroke=void 0)):e.size>1&&!t.opt.locked&&(this.canLock=!1,this.canRotate=!1))}},{key:"getChildrenPoints",value:function(){var e,t;if(this.scaleType===K.both&&1===(null==(e=this.selectIds)?void 0:e.length)){var r=this.selectIds[0],n=null==(t=this.vNodes.get(r))?void 0:t.op;if(n){for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:Ca,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];2===e.length&&function(){var i,o,a=e[0],s=e[1],l=u(t.vNodes.getRectIntersectRange({x:a,y:s,w:0,h:0},!1).nodeRange.values()).sort((function(e,t){return(t.opt.zIndex||0)-(e.opt.zIndex||0)})),c=f(l);try{for(c.s();!(o=c.n()).done;){var h=o.value;if(Hs(t.fullLayer.getElementsByName(h.name)).find((function(e){return e.isPointCollision(a,s)}))){i=h;break}}}catch(e){c.e(e)}finally{c.f()}if(i){var d=i.name;if(!xs(t.oldSelectRect,i.rect)){var p=new Map([[d,i]]);t.getSelecteorInfo(p),t.draw(r,t.fullLayer,{intersectRect:i.rect,subNodeMap:p,selectIds:t.selectIds||[]},n)}t.selectIds=[d],t.oldSelectRect=i.rect}}()}},{key:"unSelectedAllIds",value:function(){var e,t,r=f(this.vNodes.curNodeMap.entries());try{for(r.s();!(t=r.n()).done;){var n=o(t.value,2),i=n[0],a=n[1];a.isSelected&&(e=Ys(e,a.rect),this.vNodes.unSelected(i))}}catch(e){r.e(e)}finally{r.f()}return e}},{key:"unSelectedByIds",value:function(e){var t,r,n=f(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&o.isSelected&&(t=Ys(t,o.rect),this.vNodes.unSelected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"selectedByIds",value:function(e){var t,r,n=f(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=this.vNodes.get(i);o&&(t=Ys(t,o.rect),this.vNodes.selected(i))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getSelectorRect",value:function(e,t){var r,n,i=null==(r=e.parent)?void 0:r.getElementById(t),o=null==i?void 0:i.getBoundingClientRect();return o&&(n=Ys(n,{x:Math.floor(o.x),y:Math.floor(o.y),w:Math.floor(o.width+1),h:Math.floor(o.height+1)})),n}},{key:"isCanFillColor",value:function(e){return e===H.Ellipse||e===H.Triangle||e===H.Rectangle||e===H.Polygon||e===H.Star||e===H.SpeechBalloon}},{key:"updateSelector",value:(t=s(regeneratorRuntime.mark((function e(t){var r,n,i,o,a,s,u,l,h,d,p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A,C,P,N,O,R,D,L,j,z;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.updateSelectorOpt,i=t.selectIds,o=t.vNodes,a=t.willSerializeData,s=t.worker,u=t.offset,l=this.fullLayer){e.next=3;break}return e.abrupt("return");case 3:if(d=new Map,p=n.originPoint,v=n.workState,m=n.angle,g=n.translate,y=n.dir,_=n.scale,u&&(n.translate=g?[g[0]+u[0],g[1]+u[1]]:u),!(p||g||Ie(m))){e.next=9;break}if(v!==$.Start||!i){e.next=8;break}return e.abrupt("return",(o.setTargetAssignKeys(i),{type:X.Select,dataType:Y.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:b=o.getLastTarget();case 9:if(!i){e.next=60;break}x=f(i),e.prev=11,x.s();case 13:if((w=x.n()).done){e.next=52;break}if(S=w.value,!(T=o.get(S))){e.next=50;break}if(M=T.toolsType,!(k=(null==l?void 0:l.getElementsByName(S))[0])){e.next=50;break}if(E=!1,I=!1,A=c({},n),!M){e.next=50;break}if(A.thickness&&T.opt.thickness&&(E=T.opt.thickness!==A.thickness),A.strokeType&&null!=(r=T.opt)&&r.strokeType&&(I=T.opt.strokeType!==A.strokeType),C=null==b?void 0:b.get(S),null==(P=Gs(M))||P.updateNodeOpt({node:k,opt:A,vNodes:o,willSerializeData:a,targetNode:C}),!(T&&s&&(a&&(A.angle||A.translate)||A.originPoint&&A.scenePoint&&A.scale||A.pointMap&&A.pointMap.has(S)||M===H.Text&&(A.fontSize||A.translate||A.textInfos&&A.textInfos.get(S))||M===H.Image&&(A.angle||A.translate||A.scale)||M===A.toolsType&&A.willRefresh||E||I))){e.next=49;break}if(null==(N=s.createWorkShapeNode({workId:S,toolsType:M,toolsOpt:T.opt}))||N.setWorkId(S),O=void 0,M!==H.Image){e.next=35;break}return e.next=32,N.consumeServiceAsync({isFullWork:!0,replaceId:S,worker:s});case 32:O=e.sent,e.next=48;break;case 35:if(M!==H.Text){e.next=41;break}return e.next=38,N.consumeServiceAsync({isFullWork:!0,replaceId:S});case 38:O=e.sent,e.next=48;break;case 41:e.prev=41,O=null==N?void 0:N.consumeService({op:T.op,isFullWork:!0,replaceId:S}),e.next=48;break;case 45:return e.prev=45,e.t0=e.catch(41),e.abrupt("continue",50);case 48:O&&(T.rect=O);case 49:T&&(d.set(S,T),h=Ys(h,T.rect));case 50:e.next=13;break;case 52:e.next=57;break;case 54:e.prev=54,e.t1=e.catch(11),x.e(e.t1);case 57:return e.prev=57,x.f(),e.finish(57);case 60:if(b&&v===$.Done&&(o.deleteLastTarget(),b=void 0),R=h,!(p&&g&&_&&y&&R)||u){e.next=80;break}D=[[R.x,R.y],[R.x+R.w,R.y],[R.x+R.w,R.y+R.h],[R.x,R.y+R.h]],e.t2=y,e.next="top"===e.t2||"topLeft"===e.t2||"left"===e.t2?67:"topRight"===e.t2?69:"right"===e.t2||"bottomRight"===e.t2||"bottom"===e.t2?71:"bottomLeft"===e.t2?73:75;break;case 67:return L=g[0]>0&&g[1]>0?D[0]:g[0]>0?D[3]:g[1]>0?D[1]:D[2],e.abrupt("break",75);case 69:return L=g[0]<0&&g[1]>0?D[1]:g[0]<0?D[2]:g[1]>0?D[0]:D[3],e.abrupt("break",75);case 71:return L=g[0]<0&&g[1]<0?D[2]:g[0]<0?D[1]:g[1]<0?D[3]:D[0],e.abrupt("break",75);case 73:return L=g[0]>0&&g[1]<0?D[3]:g[0]>0?D[0]:g[1]<0?D[2]:D[1],e.abrupt("break",75);case 75:if(j=L&&[p[0]-L[0],p[1]-L[1]]||[0,0],xs(j,[0,0])){e.next=80;break}return e.next=79,this.updateSelector(c(c({},t),{},{updateSelectorOpt:{},offset:j}));case 79:return e.abrupt("return",e.sent);case 80:return this.getSelecteorInfo(d),this.draw(Ca,l,{selectIds:i||[],subNodeMap:d,intersectRect:R}),z=Ys(this.oldSelectRect,R),e.abrupt("return",(this.oldSelectRect=R,{type:X.Select,dataType:Y.Local,selectRect:R,renderRect:h,rect:Ys(z,R),selectIds:i}));case 83:case"end":return e.stop()}}),e,this,[[11,54,57,60],[41,45]])}))),function(e){return t.apply(this,arguments)})},{key:"blurSelector",value:function(){var e=this.unSelectedAllIds();return{type:X.Select,dataType:Y.Local,rect:e,selectIds:[],willSyncService:!0}}},{key:"getRightServiceId",value:function(e){return e.replace(Aa,"-")}},{key:"selectServiceNode",value:function(e,t,r){var n,i=this,o=t.selectIds,a=this.getRightServiceId(e),s=this.getSelectorRect(this.fullLayer,a),u=new Map;return null==o||o.forEach((function(e){var t=i.vNodes.get(e);t&&(n=Ys(n,t.rect),u.set(e,t))})),this.getSelecteorInfo(u),this.draw(a,this.fullLayer,{intersectRect:n,selectIds:o||[],subNodeMap:u},r),Ys(n,s)}},{key:"reRenderSelector",value:function(){var e,t,r=this,n=new Map;return null==(e=this.selectIds)||e.forEach((function(e){var i=r.vNodes.get(e);i&&(t=Ys(t,i.rect),n.set(e,i))}),this),this.getSelecteorInfo(n),this.draw(Ca,this.fullLayer,{intersectRect:t,subNodeMap:n,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t}},{key:"updateSelectIds",value:function(e){var t,r,n=null==(t=this.selectIds)?void 0:t.filter((function(t){return!e.includes(t)}));(null!=n&&n.length&&(r=this.unSelectedByIds(n)),e.length)&&(r=Ys(r,this.selectedByIds(e)));return this.selectIds=e,{bgRect:r,selectRect:this.reRenderSelector()}}},{key:"cursorHover",value:function(e){var t,r,n=this.oldSelectRect;this.selectIds=[];var i=null==(t=this.workId)?void 0:t.toString(),o=[e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];return this.selectSingleTool(o,i,!0),this.oldSelectRect&&!xs(n,this.oldSelectRect)?{type:X.CursorHover,dataType:Y.Local,rect:Ys(n,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1}:(null!=(r=this.selectIds)&&r.length||(this.oldSelectRect=void 0),n&&!this.oldSelectRect?(this.cursorBlur(),{type:X.CursorHover,dataType:Y.Local,rect:n,selectorColor:this.selectorColor,willSyncService:!1}):void 0)}},{key:"cursorBlur",value:function(){var e,t;this.selectIds=[];var r=null==(e=this.workId)?void 0:e.toString();(null==(t=this.fullLayer)?void 0:t.parent).children.forEach((function(e){e.name===r&&e.remove()}))}}]),n}(xa);I(ws,"selectorBorderId","selector-border");var Ss=ws,Ts=function(e){m(r,e);var t=y(r);function r(e){var n;return S(this,r),n=t.call(this,e),I(b(n),"canRotate",!1),I(b(n),"scaleType",K.both),I(b(n),"toolsType",H.Arrow),I(b(n),"tmpPoints",[]),I(b(n),"workOptions"),I(b(n),"oldRect"),I(b(n),"arrowTipWidth"),I(b(n),"syncTimestamp"),n.workOptions=e.toolsOpt,n.arrowTipWidth=4*n.workOptions.thickness,n.syncTimestamp=0,n.syncUnitTime=50,n}return M(r,[{key:"consume",value:function(e){var t,r,n=e.data,i=e.isFullWork,o=e.isSubWorker,a=e.isMainThread,s=this.workId,l=n.op,h=null==l?void 0:l.length;if(!h||h<2)return{type:X.None};if(0===this.tmpPoints.length?(this.tmpPoints=[new ie(l[0],l[1])],t=!1):t=this.updateTempPoints(l),!t)return{type:X.None};if(o||a){var d=i?this.fullLayer:this.drawLayer||this.fullLayer;r=this.draw({workId:s,layer:d})}if(!o){var f=Date.now();return f-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=f,c(c({},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0})):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c(c({rect:p},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local})}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:xa.getCenterPos(n,r)}),c(c({rect:n},this.baseConsumeResult),{},{type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0})}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=n.strokeType,h=n.eraserlines,d=r.worldPosition,f=r.worldScaling,p=this.computDrawPoints(o),v=p.points,m=p.pos,g=p.rect,y=p.isTriangle,_=p.trianglePoints,b=p.trianglePos,x=[g.x+g.w/2,g.y+g.h/2],w={pos:x,name:t,id:t,zIndex:a,anchor:[.5,.5],size:[g.w,g.h]};s&&(w.scale=s),u&&(w.rotate=u),l&&(w.translate=l);var S=new C.Group(w),T={points:_,pos:[b[0]-x[0],b[1]-x[1]],fillColor:i,strokeColor:i,lineWidth:0,normalize:!1},M=new C.Polyline(T);if(S.append(M),!y&&v&&m){var k={points:v,pos:[m[0]-x[0],m[1]-x[1]],fillColor:i,strokeColor:i,lineDash:c!==U.Dotted||y?c!==U.LongDotted||y?void 0:[o,2*o]:[1,2*o],lineCap:c===U.Normal?void 0:"round",lineWidth:o,normalize:!1},E=new C.Polyline(k);S.append(E)}if(h&&this.drawEraserlines({group:S,eraserlines:h,pos:x,layer:r}),this.replace(r,t,S),s||u||l){var I=S.getBoundingClientRect();return{x:Math.floor(I.x-xa.SafeBorderPadding),y:Math.floor(I.y-xa.SafeBorderPadding),w:Math.floor(I.width+2*xa.SafeBorderPadding),h:Math.floor(I.height+2*xa.SafeBorderPadding)}}return{x:Math.floor(g.x*f[0]+d[0]-xa.SafeBorderPadding),y:Math.floor(g.y*f[1]+d[1]-xa.SafeBorderPadding),w:Math.floor(g.w*f[0]+2*xa.SafeBorderPadding),h:Math.floor(g.h*f[1]+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(e):this.computTrianglePoints()}},{key:"computFullArrowPoints",value:function(e){var t=this,r=re.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=re.Per(r).mul(e/2),i=ie.Sub(this.tmpPoints[0],n),o=ie.Add(this.tmpPoints[0],n),a=re.Mul(r,this.arrowTipWidth),s=re.Sub(this.tmpPoints[1],a),u=ie.Sub(s,n),l=ie.Add(s,n),c=re.Per(r).mul(1.5*e),h=ie.Sub(s,c),d=ie.Add(s,c),f=[this.tmpPoints[0],s],p=[h,this.tmpPoints[1],d],v=[i,o].concat(p,[u,l]);return{trianglePoints:p.map((function(e){return ie.Sub(e,t.tmpPoints[1]).XY})).flat(1),trianglePos:this.tmpPoints[1].XY,points:f.map((function(e){return ie.Sub(e,t.tmpPoints[0]).XY})).flat(1),rect:Xs(v),isTriangle:!1,pos:this.tmpPoints[0].XY}}},{key:"computTrianglePoints",value:function(){var e=this,t=re.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=re.Per(t).mul(Math.floor(3*r/8)),i=ie.Sub(this.tmpPoints[0],n),o=ie.Add(this.tmpPoints[0],n),a=[i,this.tmpPoints[1],o];return{trianglePoints:a.map((function(t){return ie.Sub(t,e.tmpPoints[1]).XY})).flat(1),trianglePos:this.tmpPoints[1].XY,rect:Xs(a),isTriangle:!0}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=f,c(c({type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0})):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&xa.getCenterPos(n,r)}),c(c({rect:n,type:X.FullWork,dataType:Y.Local},this.baseConsumeResult),{},{ops:o,isSync:!0})}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.scale,h=i.rotate,d=i.translate,f=i.strokeType,p=i.eraserlines,v=r.worldScaling,m=this.computDrawPoints(s),g=m.radius,y=m.rect,_=m.pos,b={pos:_,name:t,id:t,radius:g,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:f===U.Dotted?[1,2*s]:f===U.LongDotted?[s,2*s]:void 0},x={name:t,id:t,zIndex:u,pos:_,anchor:[.5,.5],size:[y.w,y.h]};l&&(x.scale=l),h&&(x.rotate=h),d&&(x.translate=d);var w=new C.Group(x);if(n){var S=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/v[0],1/v[1]]});w.append(S)}var T=new C.Ellipse(c(c({},b),{},{pos:[0,0]}));w.append(T),p&&this.drawEraserlines({group:w,eraserlines:p,pos:_,layer:r}),this.replace(r,t,w);var M=w.getBoundingClientRect();return{x:Math.floor(M.x-xa.SafeBorderPadding),y:Math.floor(M.y-xa.SafeBorderPadding),w:Math.floor(M.width+2*xa.SafeBorderPadding),h:Math.floor(M.height+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e){var t=Xs(this.tmpPoints);return{rect:Xs(this.tmpPoints,e),pos:[Math.floor(t.x+t.w/2),Math.floor(t.y+t.h/2)],radius:[Math.floor(t.w/2),Math.floor(t.h/2)]}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;athis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:h.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(l,this.oldRect);return this.oldRect=l,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,i=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var o=r.flat(1),a=Sa(o);return null==(e=this.vNodes)||e.setInfo(t,{rect:i,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&xa.getCenterPos(i,n)}),c({rect:i,type:X.FullWork,dataType:Y.Local,ops:a,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=e.ps,o=e.replaceId,a=this.workOptions,s=a.strokeColor,u=a.fillColor,l=a.thickness,h=a.zIndex,d=a.scale,f=a.rotate,p=a.translate,v=a.strokeType,m=a.eraserlines,g=r.worldPosition,y=r.worldScaling,_=this.computDrawPoints(i),b=_.points,x=_.rect,w=_.pos,S={close:!0,normalize:!0,points:b,lineWidth:l,fillColor:"transparent"!==u&&u||void 0,strokeColor:s,lineJoin:"round",lineCap:"round",lineDash:v===U.Dotted?[1,2*l]:v===U.LongDotted?[l,2*l]:void 0},T={x:Math.floor(x.x*y[0]+g[0]-xa.SafeBorderPadding),y:Math.floor(x.y*y[1]+g[1]-xa.SafeBorderPadding),w:Math.floor(x.w*y[0]+2*xa.SafeBorderPadding),h:Math.floor(x.h*y[0]+2*xa.SafeBorderPadding)},M=new C.Group({name:t,id:t,zIndex:h,pos:w,anchor:[.5,.5],size:[x.w,x.h],scale:d,rotate:f,translate:p}),k=new C.Polyline(c(c({},S),{},{pos:[0,0]}));if(M.appendChild(k),n){var E=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/y[0],1/y[1]]});M.appendChild(E)}if(m&&this.drawEraserlines({group:M,eraserlines:m,pos:w,layer:r}),this.replace(r,o||t,M),d||f||p){var I=M.getBoundingClientRect();return{x:Math.floor(I.x-xa.SafeBorderPadding),y:Math.floor(I.y-xa.SafeBorderPadding),w:Math.floor(I.width+2*xa.SafeBorderPadding),h:Math.floor(I.height+2*xa.SafeBorderPadding)}}return T}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=e.replaceId,a=null==(t=this.workId)?void 0:t.toString();if(a){for(var s=[],u=0;uthis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,h=i.innerVerticeStep,d=i.innerRatio,f=i.scale,p=i.rotate,v=i.translate,m=i.strokeType,g=i.eraserlines,y=r.worldScaling,_=this.computDrawPoints(s,l,h,d),b=_.rect,x=_.pos,w={close:!0,points:_.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:m===U.Dotted?[1,2*s]:m===U.LongDotted?[s,2*s]:void 0},S={name:t,id:t,zIndex:u,pos:x,anchor:[.5,.5],size:[b.w,b.h]};f&&(S.scale=f),p&&(S.rotate=p),v&&(S.translate=v);var T=new C.Group(S);if(n){var M=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/y[0],1/y[1]]});T.append(M)}var k=new C.Polyline(c(c({},w),{},{pos:[0,0]}));T.append(k),g&&this.drawEraserlines({group:T,eraserlines:g,pos:x,layer:r}),this.replace(r,t,T);var E=T.getBoundingClientRect();return{x:Math.floor(E.x-xa.SafeBorderPadding),y:Math.floor(E.y-xa.SafeBorderPadding),w:Math.floor(E.width+2*xa.SafeBorderPadding),h:Math.floor(E.height+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t,r,n){for(var i=Xs(this.tmpPoints),o=[Math.floor(i.x+i.w/2),Math.floor(i.y+i.h/2)],a=ru(i.w,i.h),s=Math.floor(Math.min(i.w,i.h)/2),u=n*s,l=[],c=2*Math.PI/t,h=0;hthis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=e.isDrawing,i=this.workOptions,o=i.strokeColor,a=i.fillColor,s=i.thickness,u=i.zIndex,l=i.vertices,h=i.scale,d=i.rotate,f=i.translate,p=i.strokeType,v=i.eraserlines,m=r.worldScaling,g=this.computDrawPoints(s,l),y=g.rect,_=g.pos,b={close:!0,points:g.points,lineWidth:s,fillColor:"transparent"!==a&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:p===U.Dotted?[1,2*s]:p===U.LongDotted?[s,2*s]:void 0},x={name:t,id:t,zIndex:u,pos:_,anchor:[.5,.5],size:[y.w,y.h]};h&&(x.scale=h),d&&(x.rotate=d),f&&(x.translate=f);var w=new C.Group(x);if(n){var S=new C.Path({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/m[0],1/m[1]]});w.append(S)}var T=new C.Polyline(c(c({},b),{},{pos:[0,0]}));w.append(T),v&&this.drawEraserlines({group:w,eraserlines:v,pos:_,layer:r}),this.replace(r,t,w);var M=w.getBoundingClientRect();return{x:Math.floor(M.x-xa.SafeBorderPadding),y:Math.floor(M.y-xa.SafeBorderPadding),w:Math.floor(M.width+2*xa.SafeBorderPadding),h:Math.floor(M.height+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t){for(var r=Xs(this.tmpPoints),n=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)],i=ru(r.w,r.h),o=Math.floor(Math.min(r.w,r.h)/2),a=[],s=2*Math.PI/t,u=0;u0&&void 0!==arguments[0]?arguments[0]:10,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=null,s=[];i||o?i&&!o?a=e.twoBezier:i&&o&&(a=e.threeBezier):a=e.oneBezier;for(var u=0;uthis.syncUnitTime?(this.syncTimestamp=p,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var v=Ys(l,this.oldRect);return this.oldRect=l,c({rect:v,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.fillColor,a=n.thickness,s=n.zIndex,u=n.placement,l=n.scale,h=n.rotate,d=n.translate,f=n.strokeType,p=n.eraserlines,v=this.computDrawPoints(a,u),m=v.rect,g=v.pos,y={points:v.points.map((function(e){return e.XY})),lineWidth:a,fillColor:"transparent"!==o&&o||void 0,strokeColor:i,normalize:!0,className:"".concat(g[0],",").concat(g[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:f===U.Dotted?[1,2*a]:f===U.LongDotted?[a,2*a]:void 0},_={name:t,id:t,zIndex:s,pos:g,anchor:[.5,.5],size:[m.w,m.h]};l&&(_.scale=l),h&&(_.rotate=h),d&&(_.translate=d);var b=new C.Group(_),x=new C.Polyline(c(c({},y),{},{pos:[0,0]}));b.append(x),p&&this.drawEraserlines({group:b,eraserlines:p,pos:g,layer:r}),this.replace(r,t,b);var w=b.getBoundingClientRect();return{x:Math.floor(w.x-xa.SafeBorderPadding),y:Math.floor(w.y-xa.SafeBorderPadding),w:Math.floor(w.width+2*xa.SafeBorderPadding),h:Math.floor(w.height+2*xa.SafeBorderPadding)}}},{key:"transformControlPoints",value:function(e){var t=Xs(this.tmpPoints);switch(e){case"bottom":case"bottomLeft":case"bottomRight":var r=t.y+t.h*this.ratio;return[new re(t.x,t.y,0),new re(t.x+t.w,t.y,0),new re(t.x+t.w,r,0),new re(t.x,r,0)];case"top":case"topLeft":case"topRight":var n=t.y+t.h*(1-this.ratio);return[new re(t.x,n,0),new re(t.x+t.w,n,0),new re(t.x+t.w,t.y+t.h,0),new re(t.x,t.y+t.h,0)];case"left":case"leftBottom":case"leftTop":var i=t.x+t.w*(1-this.ratio);return[new re(i,t.y,0),new re(t.x+t.w,t.y,0),new re(t.x+t.w,t.y+t.h,0),new re(i,t.y+t.h,0)];case"right":case"rightBottom":case"rightTop":var o=t.x+t.w*this.ratio;return[new re(t.x,t.y,0),new re(o,t.y,0),new re(o,t.y+t.h,0),new re(t.x,t.y+t.h,0)]}}},{key:"computDrawPoints",value:function(e,t){var r=Xs(this.tmpPoints),n=this.transformControlPoints(t),i=Math.floor(.1*r.w),o=Math.floor(.1*r.h),a=[],s=re.Add(n[0],new re(0,o,0)),l=re.Add(n[0],new re(i,0,0)),c=As.getBezierPoints(10,s,n[0],l),h=re.Sub(n[1],new re(i,0,0)),d=re.Add(n[1],new re(0,o,0)),f=As.getBezierPoints(10,h,n[1],d),p=re.Sub(n[2],new re(0,o,0)),v=re.Sub(n[2],new re(i,0,0)),m=As.getBezierPoints(10,p,n[2],v),g=re.Add(n[3],new re(i,0,0)),y=re.Sub(n[3],new re(0,o,0)),_=As.getBezierPoints(10,g,n[3],y),b=i*(1-this.ratio)*10,x=o*(1-this.ratio)*10;switch(t){case"bottom":var w=re.Sub(n[2],new re(5*i-b/2,0,0)),S=re.Sub(n[2],new re(5*i,-x,0)),T=re.Sub(n[2],new re(5*i+b/2,0,0));a.push.apply(a,[S,T].concat(u(_),u(c),u(f),u(m),[w]));break;case"bottomRight":var M=re.Sub(n[2],new re(1.1*i,0,0)),k=re.Sub(n[2],new re(1.1*i+b/2,-x,0)),E=re.Sub(n[2],new re(1.1*i+b,0,0));a.push.apply(a,[k,E].concat(u(_),u(c),u(f),u(m),[M]));break;case"bottomLeft":var I=re.Add(n[3],new re(1.1*i+b,0,0)),A=re.Add(n[3],new re(1.1*i+b/2,x,0)),C=re.Add(n[3],new re(1.1*i,0,0));a.push.apply(a,[A,C].concat(u(_),u(c),u(f),u(m),[I]));break;case"top":var P=re.Sub(n[1],new re(5*i-b/2,0,0)),N=re.Sub(n[1],new re(5*i,x,0)),O=re.Sub(n[1],new re(5*i+b/2,0,0));a.push.apply(a,[N,P].concat(u(f),u(m),u(_),u(c),[O]));break;case"topRight":var R=re.Sub(n[1],new re(1.1*i,0,0)),D=re.Sub(n[1],new re(1.1*i+b/2,x,0)),L=re.Sub(n[1],new re(1.1*i+b,0,0));a.push.apply(a,[D,R].concat(u(f),u(m),u(_),u(c),[L]));break;case"topLeft":var j=re.Add(n[0],new re(1.1*i+b,0,0)),z=re.Add(n[0],new re(1.1*i+b/2,-x,0)),B=re.Add(n[0],new re(1.1*i,0,0));a.push.apply(a,[z,j].concat(u(f),u(m),u(_),u(c),[B]));break;case"left":var U=re.Add(n[0],new re(0,5*o-x/2,0)),F=re.Add(n[0],new re(-b,5*o,0)),W=re.Add(n[0],new re(0,5*o+x/2,0));a.push.apply(a,[F,U].concat(u(c),u(f),u(m),u(_),[W]));break;case"leftTop":var G=re.Add(n[0],new re(0,1.1*o,0)),V=re.Add(n[0],new re(-b,1.1*o+x/2,0)),H=re.Add(n[0],new re(0,1.1*o+x,0));a.push.apply(a,[V,G].concat(u(c),u(f),u(m),u(_),[H]));break;case"leftBottom":var Y=re.Sub(n[3],new re(0,1.1*o+x,0)),$=re.Sub(n[3],new re(b,1.1*o+x/2,0)),X=re.Sub(n[3],new re(0,1.1*o,0));a.push.apply(a,[$,Y].concat(u(c),u(f),u(m),u(_),[X]));break;case"right":var q=re.Add(n[1],new re(0,5*o-x/2,0)),Q=re.Add(n[1],new re(b,5*o,0)),Z=re.Add(n[1],new re(0,5*o+x/2,0));a.push.apply(a,[Q,Z].concat(u(m),u(_),u(c),u(f),[q]));break;case"rightTop":var K=re.Add(n[1],new re(0,1.1*o,0)),J=re.Add(n[1],new re(b,1.1*o+x/2,0)),ee=re.Add(n[1],new re(0,1.1*o+x,0));a.push.apply(a,[J,ee].concat(u(m),u(_),u(c),u(f),[K]));break;case"rightBottom":var te=re.Sub(n[2],new re(0,1.1*o+x,0)),ne=re.Sub(n[2],new re(-b,1.1*o+x/2,0)),ie=re.Sub(n[2],new re(0,1.1*o,0));a.push.apply(a,[ne,ie].concat(u(m),u(_),u(c),u(f),[te]))}var oe=Xs(this.tmpPoints,e);return{rect:oe,pos:[Math.floor(oe.x+oe.w/2),Math.floor(oe.y+oe.h/2)],points:a}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i)||ie.Sub(n,r).XY.includes(0))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a0?K.proportional:K.all}},{key:"updateNodeOpt",value:function(e){var t=e.node,r=e.opt,i=e.vNodes,o=e.targetNode,a=r.translate,s=r.originPoint,u=r.scenePoint,l=r.scale,c=r.angle,h=r.isLocked,d=r.zIndex,f=o&&pa(o)||i.get(t.name);if(f){var p=t.parent;if(p){if(Ie(d)&&(t.setAttribute("zIndex",d),f.opt.zIndex=d),Rs(h)&&(f.opt.locked=h),s&&u&&l&&a){var v=f.opt,m=v.centerX,g=v.centerY,y=v.width,_=v.height,b=!1!==v.uniformScale?[l[0],l[0]]:l,x=[m,g],w=[m,g];Js(w,u,b,a);var S=[w[0]-x[0],w[1]-x[1]];if(f.centerPos=[f.centerPos[0]+S[0],f.centerPos[1]+S[1]],f.opt.width=Math.round(y*b[0]),f.opt.height=Math.round(_*b[1]),f.opt.centerX=w[0],f.opt.centerY=w[1],f.opt.eraserlines)for(var T=0,M=Object.values(f.opt.eraserlines);Tthis.syncUnitTime?(this.syncTimestamp=f,c({type:X.DrawWork,dataType:Y.Local,op:this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:X.None}}var p=Ys(r,this.oldRect);return this.oldRect=r,c({rect:p,type:X.DrawWork,dataType:Y.Local},this.baseConsumeResult)}},{key:"consumeAll",value:function(){var e,t=this.workId;if(this.tmpPoints.length<2)return{type:X.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map((function(e){return[].concat(u(e.XY),[0])})).flat(1),o=Sa(i);return null==(e=this.vNodes)||e.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&xa.getCenterPos(n,r)}),c({rect:n,type:X.FullWork,dataType:Y.Local,ops:o,isSync:!0},this.baseConsumeResult)}},{key:"draw",value:function(e){var t=e.workId,r=e.layer,n=this.workOptions,i=n.strokeColor,o=n.thickness,a=n.zIndex,s=n.scale,u=n.rotate,l=n.translate,c=n.strokeType,h=n.eraserlines,d=r.worldPosition,f=r.worldScaling,p=this.computDrawPoints(o,c),v=p.d,m=p.rect,g=p.isDot,y=[m.x+m.w/2,m.y+m.h/2],_=new C.Group({pos:y,anchor:[.5,.5],size:[m.w,m.h],name:t,id:t,normalize:!0,zIndex:a}),b={pos:[0,0],normalize:!0,d:v,fillColor:i,strokeColor:i,lineDash:c!==U.Dotted||g?c!==U.LongDotted||g?void 0:[o,2*o]:[1,2*o],lineCap:c===U.Normal||g?void 0:"round",lineWidth:c===U.Normal||g?0:o};s&&(b.scale=s),u&&(b.rotate=u),l&&(b.translate=l);var x=new C.Path(b);if(_.append(x),h&&this.drawEraserlines({group:_,eraserlines:h,pos:y,layer:r}),this.replace(r,t,_),u||s||l){var w=x.getBoundingClientRect();return{x:Math.floor(w.x-xa.SafeBorderPadding),y:Math.floor(w.y-xa.SafeBorderPadding),w:Math.floor(w.width+2*xa.SafeBorderPadding),h:Math.floor(w.height+2*xa.SafeBorderPadding)}}return{x:Math.floor(m.x*f[0]+d[0]-xa.SafeBorderPadding),y:Math.floor(m.y*f[1]+d[1]-xa.SafeBorderPadding),w:Math.floor(m.w*f[0]+2*xa.SafeBorderPadding),h:Math.floor(m.h*f[1]+2*xa.SafeBorderPadding)}}},{key:"computDrawPoints",value:function(e,t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(e,t):this.computDotPoints(e)}},{key:"computFullPoints",value:function(e,t){var r=re.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=re.Per(r).mul(e/2),i=ie.Sub(this.tmpPoints[0],n),o=ie.Add(this.tmpPoints[0],n),a=ie.Sub(this.tmpPoints[1],n),s=ie.Add(this.tmpPoints[1],n),l=ie.GetSemicircleStroke(this.tmpPoints[1],a,-1,8),c=ie.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),h=[i,a].concat(u(l),[s,o],u(c));return{d:t!==U.Normal?_a(this.tmpPoints,!1):_a(h,!0),rect:Xs(h),isDot:!1,pos:this.tmpPoints[0].XY}}},{key:"computDotPoints",value:function(e){var t=ie.GetDotStroke(this.tmpPoints[0],e/2,8);return{d:_a(t,!0),rect:Xs(t),isDot:!0,pos:this.tmpPoints[0].XY}}},{key:"updateTempPoints",value:function(e){var t=e.slice(-2),r=new ie(t[0],t[1]),n=this.tmpPoints[0],i=this.workOptions.thickness;if(n.isNear(r,i))return!1;if(2===this.tmpPoints.length){if(r.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=r}else this.tmpPoints.push(r);return!0}},{key:"consumeService",value:function(e){var t,r,n=e.op,i=e.isFullWork,o=null==(t=this.workId)?void 0:t.toString();if(o){this.tmpPoints.length=0;for(var a=0;a"u"&&this.workOptions.workState===$.Done||l});case 8:return h=e.sent,e.abrupt("return",(null==(o=this.vNodes)||o.setInfo(a,{rect:h,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:h&&xa.getCenterPos(h,c)}),h));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updataOptService",value:function(){}},{key:"updataOptServiceAsync",value:(r=s(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.workId){e.next=2;break}return e.abrupt("return");case 2:if(o=this.workId.toString(),a=t.fontColor,s=t.fontBgColor,u=t.bold,l=t.italic,c=t.lineThrough,h=t.underline,d=t.zIndex,f=null==(n=this.vNodes)?void 0:n.get(o)){e.next=5;break}return e.abrupt("return");case 5:return a&&(f.opt.fontColor=a),s&&(f.opt.fontBgColor=s),u&&(f.opt.bold=u),l&&(f.opt.italic=l),Rs(c)&&(f.opt.lineThrough=c),Rs(h)&&(f.opt.underline=h),Ie(d)&&(f.opt.zIndex=d),this.oldRect=f.rect,e.next=8,this.draw({workId:o,layer:this.fullLayer,isDrawLabel:k(r)>"u"&&this.workOptions.workState===$.Done||r});case 8:return p=e.sent,e.abrupt("return",(null==(i=this.vNodes)||i.setInfo(o,{rect:p,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:p&&xa.getCenterPos(p,this.fullLayer)}),p));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0}}],[{key:"getSafetySnippetRatio",value:function(e){var t=(null==e?void 0:e.parent).displayRatio||1,r=Math.ceil(10*e.worldScaling[0])/10,n=r;return r>=.2&&r<1?n=r*t:r<=2&&r>=1?n=r*t*1.6:r>2&&r<=3?n=r*t*1.4:r>3&&r<=4?n=r*t*.8:r>4&&(n=r*t*.6),Math.floor(1e3*n)/1e3}},{key:"getSafetySnippetFontLength",value:function(e){return Math.floor(3*a.textImageSnippetSize/4/e)||1}},{key:"createLabels",value:(t=s(regeneratorRuntime.mark((function e(t,r,n){var i,o,s,u,l,c,h,d,f,p,v,m,g,y,_,b,x,w,S,T,M,k,E,I,A,P,N,O,R,D,L,j,z,B,U,F,W,G,V,H,Y,$,X,q,Q,Z,K,J,ee,te,re,ne;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],s=n.x,u=n.y,l=null==(i=r.parent)?void 0:i.parent,c=l.width,h=l.height,d=wa(t.text),f=d.length,p=t.fontSize,v=t.lineHeight,m=t.bold,g=t.textAlign,y=t.italic,_=t.fontFamily,b=t.verticalAlign,x=t.fontColor,w=t.fontBgColor,S=t.underline,T=t.lineThrough,M=a.getSafetySnippetRatio(r)||1,k=Math.floor(p*M),E=a.getSafetySnippetFontLength(k),I=0,A=0;case 3:if(!(A=c||(L[1]+R[1]+q)*r.worldScaling[1]+u<=0||(L[1]+R[1])*r.worldScaling[1]+u>=h)&&(G.disconnect(),H=!1),H&&B.push(G))),U+=E;case 25:e.next=14;break;case 27:D[0]=z,"italic"===y&&(D[0]=D[0]+j*p),I=Math.max(I,D[0]),Q=!0,((R[0]+D[0])*r.worldScaling[0]+s<=0||R[0]*r.worldScaling[0]+s>=c||(R[1]+D[1])*r.worldScaling[0]+u<=0||R[1]*r.worldScaling[1]+u>=h)&&(Q=!1),Q&&(S&&(Z=Math.floor(p/10),K={normalize:!1,pos:[0,1.1*p+Z/2],lineWidth:Z,points:[0,0,Math.ceil(D[0]),0],strokeColor:x,className:"underline"},J=new C.Polyline(K),B.push(J)),T&&(ee={normalize:!1,pos:[0,1.2*p/2],lineWidth:Math.floor(p/10),points:[0,0,Math.ceil(D[0]),0],strokeColor:x,className:"lineThrough"},te=new C.Polyline(ee),B.push(te)),re={pos:R,anchor:[0,0],size:D,bgcolor:w},(ne=new C.Group(re)).append.apply(ne,B),o.push(ne));case 30:A++,e.next=3;break;case 33:return e.abrupt("return",{labels:o,maxWidth:I});case 34:case"end":return e.stop()}}),e)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"updateNodeOpt",value:function(e){var t=e.node,r=e.opt,n=e.vNodes,i=e.targetNode,o=r.fontBgColor,a=r.fontColor,s=r.translate,u=r.originPoint,l=r.scenePoint,c=r.scale,h=r.bold,d=r.italic,f=r.lineThrough,p=r.underline,v=r.fontSize,m=r.textInfos,g=r.zIndex,y=i&&pa(i)||n.get(t.name);if(y&&t.parent){var _=y.opt;if(Ie(g)&&(t.setAttribute("zIndex",g),y.opt.zIndex=g),a&&_.fontColor&&(_.fontColor=a,t.children.forEach((function(e){"GROUP"===e.tagName&&e.children.forEach((function(e){"LABEL"===e.tagName?(e.setAttribute("fillColor",a),e.setAttribute("strokeColor",a)):"POLYLINE"===e.tagName&&e.setAttribute("strokeColor",a)}))}))),o&&_.fontBgColor&&(_.fontBgColor=o,t.children.forEach((function(e){"GROUP"===e.tagName&&e.setAttribute("bgcolor",o)}))),h&&(_.bold=h),d&&(_.italic=d),Rs(f)&&(_.lineThrough=f),Rs(p)&&(_.underline=p),v&&(_.fontSize=v),u&&l&&c&&i&&_.boxPoint){var b=null==m?void 0:m.get(t.name);if(b){var x=b.fontSize,w=b.boxSize;_.boxSize=w||_.boxSize,_.fontSize=x||_.fontSize}var S=[_.boxPoint[0],_.boxPoint[1]];Js(_.boxPoint,l,c,s);var T=[y.op[0],y.op[1]],M=[T[0]-S[0],T[1]-S[1]];if(y.centerPos=[y.centerPos[0]+M[0],y.centerPos[1]+M[1]],y.opt.eraserlines)for(var k=0,E=Object.values(y.opt.eraserlines);k1){for(var h=[],d=0;d-1){var a=[],s=i.slice(0,o+1);if(re.Equals(i[o],t[0])||s.push(t[0].clone().setz(i[o].z)),s.length>1&&a.push(s),o+t.length-11&&a.push(l)}return{v:(r.splice.apply(r,[n,1].concat(a)),r)}}},i=0;i0&&t.isSamePoint(e,n[r-1]))})),o=[],a=0;a1){var x=N.polyline(g.map((function(e){return e.XY})),this.eraserPolyline);if(x.length&&(a.add(h.name),!v))for(var w=this.translateIntersect(x),S=this.cutPolyline(w,g),T=function(e){var t="".concat(c,"_s_").concat(e),r=[];S[e].forEach((function(e){r.push((e.x-n.worldPosition[0])/n.worldScaling[0],(e.y-n.worldPosition[1])/n.worldScaling[1],e.z)})),h.opt&&h.toolsType&&n.vNodes&&(n.vNodes.setInfo(t,{rect:b,op:r,opt:h.opt,canRotate:h.canRotate,scaleType:h.scaleType,toolsType:h.toolsType}),s.set(t,{workId:t,op:r,opt:h.opt,toolsType:h.toolsType}))},M=0;M1&&this.isNear([t[0],t[1]],[this.tmpPoints[r-2],this.tmpPoints[r-1]]))return c({type:X.None},this.baseConsumeResult);r<3?this.tmpPoints.push(t[0],t[1]):this.tmpPoints.splice(2,2,t[0],t[1]);var n,i=this.computRectCenterPoints(),o=new Set,a=new Map;if(!this.vNodes)return c({type:X.None},this.baseConsumeResult);this.vNodes.setTarget();for(var s=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.getLastTarget())),l=0;l0){var o=this.tmpPoints[this.tmpPoints.length-1],a=re.Sub(i,o).uni();i.setv(a)}this.tmpPoints.push(i)}if(!(this.tmpPoints.length<2)){var s=2*this.tmpPoints[0].z,u=r?this.fullLayer:this.drawLayer||this.fullLayer;return this.draw({consumePoints:this.tmpPoints,layer:u,thickness:s})}}},{key:"updateTempPoints",value:function(e,t){for(var r=this.tmpPoints.length-1,n=Date.now(),i=0;i270)&&(i[++a]=[c.XY])}}1===this.tmpPoints.length&&0===i.length&&i.push([this.tmpPoints[0].XY,this.tmpPoints[0].XY]);var d,p=new Map,v=f(n.entries());try{for(v.s();!(d=v.n()).done;){var m,g=o(d.value,2),y=g[0],_=g[1],b=Qs(_.rect,[-t[0],-t[1]]),x=[(b={x:b.x/this.worldScaling[0],y:b.y/this.worldScaling[1],w:b.w/this.worldScaling[0],h:b.h/this.worldScaling[1]}).x,b.y,b.x+b.w,b.y+b.h],w=[],S=[],T=f(i);try{for(T.s();!(m=T.n()).done;){var M=m.value;N.polyline(M,x,w)}}catch(e){T.e(e)}finally{T.f()}if(w.length&&_.opt){var k,E=f(w);try{for(E.s();!(k=E.n()).done;){for(var I=k.value,A=[],C=0;Cthis.syncUnitTime&&(p=!0,this.syncTimestamp=v[0].t,this.syncIndex=this.tmpPoints.length);var g=[];return this.tmpPoints.slice(f).forEach((function(e){g.push(e.x,e.y,s/2)})),c(c({},this.baseConsumeResult),{},{type:X.DrawWork,dataType:Y.Local,rect:m,op:p?g:void 0,index:p?3*f:void 0,updateNodeOpt:{useAnimation:!0}})}},{key:"draw",value:function(e){var t=e.consumePoints,r=e.layer,n=e.thickness,i=this.workId,o=r.getElementsByName(this.workId)[0],a=Xs(t,n),s=[{op:[t.map((function(e){return[e.x,e.y]})).flat(1)],thickness:n}];return o||(o=new C.Group({normalize:!0,name:i,pos:[0,0],anchor:[.5,.5],bgcolor:"rgba(0,0,0,0.3)",zIndex:9999}),r.appendChild(o)),this.drawEraserlines({group:o,eraserlines:s,pos:[0,0],layer:r,isClear:!0}),a={x:Math.floor(a.x*this.worldScaling[0]+this.worldPosition[0]-xa.SafeBorderPadding),y:Math.floor(a.y*this.worldScaling[1]+this.worldPosition[1]-xa.SafeBorderPadding),w:Math.floor(a.w*this.worldScaling[0]+2*xa.SafeBorderPadding),h:Math.floor(a.h*this.worldScaling[1]+2*xa.SafeBorderPadding)}}},{key:"consumeAll",value:function(){var e,t=this.fullLayer.getElementsByName(this.workId);if(t.length&&(e=xa.getRectFromLayer(this.fullLayer,this.workId)),t.forEach((function(e){e.remove(),e.disconnect()})),!this.tmpPoints.length)return c({type:X.None},this.baseConsumeResult);var r=this.workOptions.thickness,i=n.eraserSizes[r],o=i.width,a=i.height,s=Math.max(o,a)/this.worldScaling[0],u=this.getChangeNodes(s);if(null==u||!u.size)return c(c({type:X.FullWork},this.baseConsumeResult),{},{rect:e});var l=[];this.tmpPoints.map((function(e){l.push(e.x,e.y,s/2)}));var h=Sa(l);return c(c({},this.baseConsumeResult),{},{type:X.FullWork,dataType:Y.Local,rect:e,ops:h,willUpdateNodes:u})}},{key:"clearTmpPoints",value:function(){this.tmpPoints.length=0}}]),n}(xa);I(Fs,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var Ws=Fs;function Gs(e){switch(e){case H.Arrow:return Ts;case H.Pencil:return Ma;case H.Straight:return Ls;case H.Ellipse:return Ms;case H.Polygon:case H.Triangle:return Is;case H.Star:case H.Rhombus:return Es;case H.Rectangle:return ks;case H.SpeechBalloon:return Cs;case H.Text:return zs;case H.LaserPen:return ka;case H.Eraser:return Ia;case H.PencilEraser:return Us;case H.BitMapEraser:return Ws;case H.Selector:return Ss;case H.Image:return Ds}}function Vs(e,t){var r=e.toolsType,i=n(e,["toolsType"]);switch(r){case H.Arrow:return new Ts(i);case H.Pencil:return new Ma(i);case H.Straight:return new Ls(i);case H.Ellipse:return new Ms(i);case H.Polygon:case H.Triangle:return new Is(i);case H.Star:case H.Rhombus:return new Es(i);case H.Rectangle:return new ks(i);case H.SpeechBalloon:return new Cs(i);case H.Text:return new zs(i);case H.LaserPen:return new ka(i);case H.Eraser:return new Ia(i,t);case H.BitMapEraser:return new Ws(i);case H.PencilEraser:return new Us(i,t);case H.Selector:return i.vNodes?new Ss(c(c({},i),{},{vNodes:i.vNodes,drawLayer:i.fullLayer})):void 0;case H.Image:return new Ds(i);default:return}}function Hs(e){var t,r=[],n=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"],i=f(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;if("GROUP"===o.tagName&&o.children.length)return Hs(o.children);o.tagName&&n.includes(o.tagName)&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r}function Ys(e,t){if(e&&t){var r=Math.min(e.x,t.x),n=Math.min(e.y,t.y);return{x:r,y:n,w:Math.max(e.x+e.w,t.x+t.w)-r,h:Math.max(e.y+e.h,t.y+t.h)-n}}return t||e}function $s(e,t){if(e&&t){var r=Math.min(e.originX,t.originX),n=Math.min(e.originY,t.originY);return{originX:r,originY:n,width:Math.max(e.originX+e.width,t.originX+t.width)-r,height:Math.max(e.originY+e.height,t.originY+t.height)-n}}return t||e}function Xs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r={x:0,y:0,w:0,h:0},n=1/0,i=1/0,a=-1/0,s=-1/0;return e.forEach((function(e){var r=o(e.XY,2),u=r[0],l=r[1];n=Math.min(n,u-t),i=Math.min(i,l-t),a=Math.max(a,u+t),s=Math.max(s,l+t)})),r.x=n,r.y=i,r.w=a-n,r.h=s-i,r}function qs(e,t){return!(e.x+e.wt.x+t.w||e.y+e.ht.y+t.h)}function Qs(e,t){return{x:e.x+t[0],y:e.y+t[1],w:e.w,h:e.h}}function Zs(e,t){var r=function(e,t){var r=new re(e.x,e.y),n=new re(e.x+e.w,e.y),i=new re(e.x+e.w,e.y+e.h),o=new re(e.x,e.y+e.h),a=new re(e.x+e.w/2,e.y+e.h/2),s=Math.PI*t/180;return[re.RotWith(r,a,s),re.RotWith(n,a,s),re.RotWith(i,a,s),re.RotWith(o,a,s)]}(e,t);return Xs(r)}function Ks(e,t,r){for(var n=new re(t[0],t[1]),i=0;i3&&void 0!==arguments[3]?arguments[3]:[0,0],i=new re(t[0],t[1]),o=0;o3&&void 0!==arguments[3]?arguments[3]:[0,0],i=new re(t[0],t[1]),o=0;o=t.x&&e[0]<=t.x+t.w&&e[1]>=t.y&&e[1]<=t.y+t.h}function ru(e,t){return[e<=t?1:e/t,t<=e?1:t/e]}var nu=function(e){if("GROUP"===e.tagName){var t=Object.getOwnPropertySymbols(e).find((function(e){return"Symbol(sealed)"===e.toString()}));if(t&&e[t])return!0}return!1};function iu(e){return"".concat(au(e.x),",").concat(au(e.y)," ")}function ou(e,t){return"".concat(au((e.x+t.x)/2),",").concat(au((e.y+t.y)/2)," ")}function au(e){return+e.toFixed(4)}var su=function(e,t){return new Promise((function(e){window.requestIdleCallback?requestIdleCallback((function(){e(1)}),{timeout:t}):setTimeout((function(){e(2)}),t)})).then((function(){e()}),(function(){e()}))},uu=function(e){var t=(null==e?void 0:e.webkitBackingStorePixelRatio)||(null==e?void 0:e.mozBackingStorePixelRatio)||(null==e?void 0:e.msBackingStorePixelRatio)||(null==e?void 0:e.oBackingStorePixelRatio)||(null==e?void 0:e.backingStorePixelRatio)||1;return Math.max(1,(window.devicePixelRatio||1)/t)};function lu(e){for(var t=0,r=0;r=1&&n<=126||65376<=n&&n<=65439?t++:t+=2}return t}var cu=function(e){m(r,e);var t=y(r);function r(e,n,i){var o;return S(this,r),o=t.call(this,e,n),I(b(o),"authSpace"),I(b(o),"namespace"),I(b(o),"serviceStorage",{}),I(b(o),"storage",{}),I(b(o),"authStorage",{}),I(b(o),"stateDisposer"),I(b(o),"authDisposer"),I(b(o),"asyncClockState",!1),r.syncInterval=.5*(i||r.syncInterval),o.namespace=r.namespace,o.authSpace=r.authSpace,o.serviceStorage=o.getNamespaceData(),o.storage=R.cloneDeep(o.serviceStorage),o.authStorage=o.getAuthSpaceData(),o}return M(r,[{key:"getViewIdBySecenPath",value:function(e){for(var t=this.getNamespaceData(),r=0,n=Object.entries(t);r0)){r.next=17;break}c.diffView=s,h=0,d=Object.entries(s);case 6:if(!(h0)){r.next=34;break}c.diffScenePath=u,m=0,g=Object.entries(u);case 20:if(!(m0)){r.next=53;break}c.diffData=l,T=0,M=Object.entries(l);case 37:if(!(T0&&e(c);case 54:case"end":return r.stop()}}),r)}))))}},{key:"removeStorageStateListener",value:function(){this.stateDisposer&&this.stateDisposer()}},{key:"diffFunByView",value:function(e,t){var r,n=Ta(e),i=Ta(t),o={},a={},s={},u=f(i);try{for(u.s();!(r=u.n()).done;){var l=r.value;n.includes(l)&&void 0!==e[l]||(o[l]={newValue:t[l],oldValue:void 0})}}catch(e){u.e(e)}finally{u.f()}var c,h=f(n);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!R.isEqual(e[d],t[d]))if(i.includes(d)&&void 0!==t[d]){var p=this.diffFunByScenePath(e[d],t[d],d);Object.assign(a,p.diffScenePath),Object.assign(s,p.diffData)}else o[d]={newValue:void 0,oldValue:e[d]}}}catch(e){h.e(e)}finally{h.f()}return{diffData:s,diffScenePath:a,diffView:o}}},{key:"diffFunByScenePath",value:function(e,t,r){var n,i=Ta(e),o=Ta(t),a={},s={},u=f(o);try{for(u.s();!(n=u.n()).done;){var l=n.value;i.includes(l)&&void 0!==e[l]||(a[l]={newValue:t[l],oldValue:void 0,viewId:r})}}catch(e){u.e(e)}finally{u.f()}var c,h=f(i);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!R.isEqual(e[d],t[d]))if(o.includes(d)&&void 0!==t[d]){var p=this.diffFunByKeys(e[d],t[d],d,r);Object.assign(s,p)}else a[d]={newValue:void 0,oldValue:e[d],viewId:r}}}catch(e){h.e(e)}finally{h.f()}return{diffScenePath:a,diffData:s}}},{key:"diffFunByKeys",value:function(e,t,r,n){var i,o=Ta(e),a=Ta(t),s={},u=f(a);try{for(u.s();!(i=u.n()).done;){var l=i.value;(!o.includes(l)||void 0===e[l])&&(s[l]={oldValue:void 0,newValue:t[l],viewId:n,scenePath:r})}}catch(e){u.e(e)}finally{u.f()}var c,h=f(o);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!R.isEqual(e[d],t[d])){if(!a.includes(d)||void 0===t[d]){s[d]={newValue:void 0,oldValue:e[d],viewId:n,scenePath:r};continue}a.includes(d)&&(s[d]={oldValue:e[d],newValue:t[d],viewId:n,scenePath:r})}}}catch(e){h.e(e)}finally{h.f()}return s}},{key:"transformKey",value:function(e){return this.uid+Aa+e}},{key:"isOwn",value:function(e){return e.split(Aa)[0]===this.uid}},{key:"dispatch",value:function(e){var t=this,r=e.type,n=e.workId,i=e.ops,o=e.index,a=e.opt,s=e.toolsType,u=e.removeIds,l=e.updateNodeOpt,h=e.op,d=e.selectIds,f=e.isSync,p=e.scenePath,v=e.viewId;if(v)switch(r){case X.Clear:var m={};p&&this.storage[v]&&this.storage[v][p]?(delete this.storage[v][p],this.setState(m,{isSync:f,viewId:v,scenePath:p})):this.storage[v]&&(delete this.storage[v],this.setState(m,{isSync:f,viewId:v,scenePath:""}));break;case X.CreateWork:if(p&&n&&s&&a){var g=this.isLocalId(n.toString())?this.transformKey(n):n;this.control.renderControl.isUsePageAuth(v)&&this.control.renderControl.addRenderPageElementId({viewId:v,scenePath:p,elementId:g.toString()}),this.updateValue(g.toString(),{type:X.CreateWork,workId:n,toolsType:s,opt:a},{isSync:f,viewId:v,scenePath:p})}break;case X.DrawWork:if(p&&n&&"number"==typeof o&&null!=h&&h.length){var y=this.isLocalId(n.toString())?this.transformKey(n):n,_=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][y]||void 0;if(null!=_&&_.ops||(null==_?void 0:_.type)===X.FullWork)return;var b=o?((null==_?void 0:_.op)||[]).slice(0,o).concat(h):h||(null==_?void 0:_.op),x=s||(null==_?void 0:_.toolsType),w=a||(null==_?void 0:_.opt),S=l||(null==_?void 0:_.updateNodeOpt);n&&x&&w&&b&&(this.control.renderControl.isUsePageAuth(v)&&this.control.renderControl.addRenderPageElementId({viewId:v,scenePath:p,elementId:y.toString()}),this.updateValue(y.toString(),c(c({},_),{},{type:X.DrawWork,workId:n,updateNodeOpt:S,toolsType:x,opt:w,op:b,index:o}),{isSync:f,viewId:v,scenePath:p}))}break;case X.FullWork:if(p&&n){var T=this.isLocalId(n.toString())?this.transformKey(n):n,M=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][T]||void 0,k=l||(null==M?void 0:M.updateNodeOpt),E=s||(null==M?void 0:M.toolsType),I=a||(null==M?void 0:M.opt),A=i||(null==M?void 0:M.ops);E&&I&&(this.control.renderControl.isUsePageAuth(v)&&this.control.renderControl.addRenderPageElementId({viewId:v,scenePath:p,elementId:T.toString()}),this.updateValue(T.toString(),{type:X.FullWork,updateNodeOpt:k,workId:T,toolsType:E,opt:I,ops:A},{isSync:f,viewId:v,scenePath:p}))}break;case X.RemoveNode:if(p&&null!=u&&u.length){var C=u.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e}));this.storage[v]&&this.storage[v][p]&&Object.keys(this.storage[v][p]).map((function(e){null!=C&&C.includes(e)&&(t.control.renderControl.isUsePageAuth(v)&&t.control.renderControl.delRenderPageElementId({viewId:v,scenePath:p,elementId:e}),t.updateValue(e,void 0,{isSync:f,viewId:v,scenePath:p}))}))}break;case X.UpdateNode:if(p&&n&&(l||i||a)){var P=this.isLocalId(n.toString())?this.transformKey(n):n,N=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][P]||void 0;N&&(N.updateNodeOpt=l,(i||h)&&(N.ops=i,N.op=h),a&&(N.opt=a),N.type=X.FullWork,this.updateValue(P.toString(),N,{isSync:f,viewId:v,scenePath:p}))}break;case X.Select:if(!p)return;var O;null!=d&&d.length&&(O=d.map((function(e){return t.isLocalId(e+"")?t.transformKey(e):e})));var R=this.transformKey(Ca),D=this.storage[v]&&this.storage[v][p]&&this.storage[v][p][R]||void 0,L=a||(null==D?void 0:D.opt);O&&this.checkOtherSelector(R,O,{isSync:f,viewId:v,scenePath:p}),this.updateValue(R,O&&{type:X.Select,toolsType:H.Selector,opt:L,selectIds:O},{isSync:f,viewId:v,scenePath:p})}}},{key:"checkOtherSelector",value:function(e,t,r){for(var n=r.viewId,i=r.scenePath,o=0,a=Object.keys(this.storage[n][i]);o0&&(u.selectIds=l),this.updateValue(s,l.length&&u||void 0,r)}}}}},{key:"setState",value:function(e,t){for(var r=t.viewId,n=t.scenePath,i=Ta(e),o=0;o0&&void 0!==arguments[0]&&arguments[0],r=Ta(this.serviceStorage),n=Ta(this.storage),i=new Map,a=f(r);try{for(a.s();!(e=a.n()).done;){var s=e.value;n.includes(s)?R.isEqual(this.serviceStorage[s],this.storage[s])||this.syncViewData(s,t):i.set(s,void 0)}}catch(e){a.e(e)}finally{a.f()}var u,l=f(n);try{for(l.s();!(u=l.n()).done;){var c=u.value;r.includes(c)||i.set(c,this.storage[c])}}catch(e){l.e(e)}finally{l.f()}if(i.size>5)this.syncStorageView(this.storage,t);else{var h,d=f(i.entries());try{for(d.s();!(h=d.n()).done;){var p=o(h.value,2),v=p[0],m=p[1];this.syncUpdataView(v,m,t)}}catch(e){d.e(e)}finally{d.f()}}}},{key:"syncViewData",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ta(this.serviceStorage[e]),i=Ta(this.storage[e]),a=new Map,s=f(n);try{for(s.s();!(t=s.n()).done;){var u=t.value;i.includes(u)?R.isEqual(this.serviceStorage[e][u],this.storage[e][u])||this.syncScenePathData(e,u,r):a.set(u,void 0)}}catch(e){s.e(e)}finally{s.f()}var l,c=f(i);try{for(c.s();!(l=c.n()).done;){var h=l.value;n.includes(h)||a.set(h,this.storage[e][h])}}catch(e){c.e(e)}finally{c.f()}if(a.size>5)this.syncStorageScenePath(e,this.storage[e],r);else{var d,p=f(a.entries());try{for(p.s();!(d=p.n()).done;){var v=o(d.value,2),m=v[0],g=v[1];this.syncUpdataScenePath(e,m,g,r)}}catch(e){p.e(e)}finally{p.f()}}}},{key:"syncScenePathData",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Ta(this.serviceStorage[e][t]),a=Ta(this.storage[e][t]),s=new Map,u=f(i);try{for(u.s();!(r=u.n()).done;){var l=r.value;a.includes(l)?R.isEqual(this.serviceStorage[e][t][l],this.storage[e][t][l])||s.set(l,this.storage[e][t][l]):s.set(l,void 0)}}catch(e){u.e(e)}finally{u.f()}var c,h=f(a);try{for(h.s();!(c=h.n()).done;){var d=c.value;i.includes(d)||s.set(d,this.storage[e][t][d])}}catch(e){h.e(e)}finally{h.f()}if(s.size>5)this.syncStorageKey(e,t,this.storage[e][t],n);else{var p,v=f(s.entries());try{for(v.s();!(p=v.n()).done;){var m=o(p.value,2),g=m[0],y=m[1];this.syncUpdataKey(e,t,g,y,n)}}catch(e){v.e(e)}finally{v.f()}}}},{key:"syncUpdataView",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(this.serviceStorage).length?(n||(void 0===t?delete this.serviceStorage[e]:this.serviceStorage[e]=R.cloneDeep(t)),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)):this.syncStorageView(this.storage,n)}},{key:"syncStorageView",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r||e&&(this.serviceStorage=R.cloneDeep(e)),null==(t=this.plugin)||t.updateAttributes([this.namespace],e)}},{key:"syncUpdataScenePath",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.keys(this.serviceStorage[e]).length?(i||(void 0===r?delete this.serviceStorage[e][t]:this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)):this.syncStorageScenePath(e,this.storage[e],i)}},{key:"syncStorageScenePath",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n||t&&(this.serviceStorage[e]=t),null==(r=this.plugin)||r.updateAttributes([this.namespace,e],t)}},{key:"syncUpdataKey",value:function(e,t,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object.keys(this.serviceStorage[e][t]).length?(o||(void 0===n?delete this.serviceStorage[e][t][r]:this.serviceStorage[e][t][r]=n),null==(i=this.plugin)||i.updateAttributes([this.namespace,e,t,r],n)):this.syncStorageKey(e,t,this.storage[e][t],o)}},{key:"syncStorageKey",value:function(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i||(this.serviceStorage[e][t]=r),null==(n=this.plugin)||n.updateAttributes([this.namespace,e,t],r)}},{key:"keyTransformWorkId",value:function(e){var t=e.split(Aa);return 2===t.length?t[1]:e}},{key:"destroy",value:function(){this.removeStorageStateListener(),this.serviceStorage={},this.storage={},this.removeAuthStateListener(),this.authStorage={}}},{key:"setAuth",value:function(e,t){var r,n=e.renderAuth,i=e.pageAuth;n&&Object.keys(n).length?this.authStorage.renderAuth=n:delete this.authStorage.renderAuth,i&&Object.keys(i).length?this.authStorage.pageAuth=i:delete this.authStorage.pageAuth,t&&(null==(r=this.plugin)||r.updateAttributes([this.authSpace],this.authStorage))}},{key:"dispatchAuth",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.type,n=e.viewId,i=e.renderData,o=e.pageData;switch(r){case X.AuthReader:if(n)if(i&&(i.render||i.hide||i.clear)){var a=this.authStorage.renderAuth||{};a[n]=i,this.setAuth(c(c({},this.authStorage),{},{renderAuth:a}),t)}else{var s=this.authStorage.renderAuth;s&&null!=s&&s[n]&&(null==s||delete s[n],this.setAuth(c(c({},this.authStorage),{},{renderAuth:s}),t))}break;case X.AuthPage:if(n)if(o){var u=this.authStorage.pageAuth||{};u[n]=o,this.setAuth(c(c({},this.authStorage),{},{pageAuth:u}),t)}else{var l=this.authStorage.pageAuth;l&&null!=l&&l[n]&&(null==l||delete l[n],this.setAuth(c(c({},this.authStorage),{},{pageAuth:l}),t))}}}},{key:"addAuthStateListener",value:function(e){var t=this;this.authDisposer=A.autorun(s(regeneratorRuntime.mark((function r(){var n,i,o,a,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t.getAuthSpaceData(),i=n.renderAuth,o=n.pageAuth,R.isEqual(i,t.authStorage.renderAuth)||(a=t.diffAuthFun(t.authStorage.renderAuth||{},i||{}),t.authStorage.renderAuth=i),R.isEqual(o,t.authStorage.pageAuth)||(s=t.diffAuthPageFun(t.authStorage.pageAuth||{},o||{}),t.authStorage.pageAuth=o),(a||s)&&e(a,s);case 2:case"end":return r.stop()}}),r)}))))}},{key:"removeAuthStateListener",value:function(){this.authDisposer&&this.authDisposer()}},{key:"diffAuthFun",value:function(e,t){var r,n=Ta(e),i=Ta(t),o={},a=f(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;n.includes(s)&&void 0!==e[s]||(o[s]={newValue:t[s],oldValue:void 0})}}catch(e){a.e(e)}finally{a.f()}var u,l=f(n);try{for(l.s();!(u=l.n()).done;){var c=u.value;if(!R.isEqual(e[c],t[c])){if(!i.includes(c)||void 0===t[c]){o[c]={newValue:void 0,oldValue:e[c]};continue}o[c]={newValue:t[c],oldValue:e[c]}}}}catch(e){l.e(e)}finally{l.f()}return o}},{key:"diffAuthPageFun",value:function(e,t){var r,n=Ta(e),i=Ta(t),o={},a=f(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;n.includes(s)&&void 0!==e[s]||(o[s]={newValue:t[s],oldValue:void 0})}}catch(e){a.e(e)}finally{a.f()}var u,l=f(n);try{for(l.s();!(u=l.n()).done;){var c=u.value;if(!R.isEqual(e[c],t[c])){if(!i.includes(c)||void 0===t[c]){o[c]={newValue:void 0,oldValue:e[c]};continue}o[c]={newValue:t[c],oldValue:e[c]}}}}catch(e){l.e(e)}finally{l.f()}return o}}]),r}(function(){function e(t,r){S(this,e),I(this,"plugin"),I(this,"uid"),I(this,"control"),this.control=t,this.plugin=r,this.uid=r.displayer.uid}return M(e,[{key:"getNamespaceData",value:function(){var e;return A.toJS(null==(e=this.plugin)?void 0:e.attributes[this.namespace])||{}}},{key:"getAuthSpaceData",value:function(){var e;return A.toJS(null==(e=this.plugin)?void 0:e.attributes[this.authSpace])||{}}},{key:"getUidFromKey",value:function(e){return 2===e.split(Aa).length&&e.split(Aa)[0]||this.uid}},{key:"isLocalId",value:function(e){return 1===e.split(Aa).length}},{key:"getLocalId",value:function(e){return e.split(Aa)[1]}},{key:"isSelector",value:function(e){return this.getLocalId(e)===Ca}}]),e}());I(cu,"namespace","PluginState"),I(cu,"authSpace","PluginAuth"),I(cu,"syncInterval",500);var hu=cu,du=function(){function e(){S(this,e),I(this,"roomMembers",[]),I(this,"onChangeHooks",new Set)}return M(e,[{key:"setRoomMembers",value:function(e){this.executChangeUidHook(this.roomMembers,e),this.roomMembers=e}},{key:"executChangeUidHook",value:function(e,t){var r={online:t.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session})),offline:e.map((function(e){var t;return(null==(t=e.payload)?void 0:t.uid)||e.session}))};this.onChangeHooks.forEach((function(e){return e(r)}))}},{key:"getAllRoomMembers",value:function(){return this.roomMembers}},{key:"getRoomMember",value:function(e){return this.roomMembers.find((function(t){var r;return(null==(r=t.payload)?void 0:r.uid)===e}))}},{key:"isOnLine",value:function(e){return!this.getRoomMember(e)}},{key:"onUidChangeHook",value:function(e){this.onChangeHooks.add(e)}},{key:"destroy",value:function(){this.onChangeHooks.clear()}}]),e}(),fu=function(e){return e[e.Text=1]="Text",e[e.Shape=2]="Shape",e}(fu||{}),pu="mainView",vu=function(){function e(){S(this,e)}return M(e,[{key:"createProxy",value:function(t){var r=new Proxy(t,{get:function(t,r,n){var i=e.interceptors.hasOwnProperty(r)?e.interceptors:t;return Reflect.get(i,r,n)}});return e.proxyToRaw.set(r,t),r}}]),e}();I(vu,"proxyToRaw",new WeakMap),I(vu,"interceptors",{entries:function(){var e;return(e=vu.proxyToRaw.get(this)).entries.apply(e,arguments)},forEach:function(){var e;return(e=vu.proxyToRaw.get(this)).forEach.apply(e,arguments)},size:function(){return vu.proxyToRaw.get(this).size},get:function(e){return vu.proxyToRaw.get(this).get(e)},set:function(e,t){return vu.proxyToRaw.get(this).set(e,t)},delete:function(e,t){return vu.proxyToRaw.get(this).delete(e)},clear:function(){return vu.proxyToRaw.get(this).clear()}});var mu=vu,gu=function(){function e(t){S(this,e),I(this,"internalMsgEmitter"),I(this,"control"),I(this,"editors"),I(this,"activeId"),I(this,"proxyMap"),I(this,"taskqueue",new Map);var r=t.control,n=t.internalMsgEmitter;this.control=r,this.internalMsgEmitter=n;var i=new Map;this.proxyMap=new mu;var o=this,a=mu.interceptors.set;mu.interceptors.set=function(e,t){return o.interceptors.set(e,t),a.call(this,e,t)};var s=mu.interceptors.delete;mu.interceptors.delete=function(e,t){return o.interceptors.delete(e,t),s.call(this,e)},this.editors=this.proxyMap.createProxy(i)}var t;return M(e,[{key:"filterEditor",value:function(e){var t=new Map;return this.editors.forEach((function(r,n){r.viewId===e&&t.set(n,r)})),t}},{key:"computeTextActive",value:function(e,t){var r,n,i,o,a=null==(r=this.control.viewContainerManager)?void 0:r.transformToScenePoint(e,t),s=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);t&&s&&(null==(i=this.control.worker)||i.taskBatchData.add({msgType:X.GetTextActive,dataType:Y.Local,op:a,viewId:t,scenePath:s}),null==(o=this.control.worker)||o.runAnimation())}},{key:"checkEmptyTextBlur",value:function(){var e,t,r=this.activeId,n=f(this.editors.entries());try{for(n.s();!(t=n.n()).done;){var i=o(t.value,2),a=i[0],s=i[1];if(s.opt.uid&&s.opt.uid===(null==(e=this.collector)?void 0:e.uid)){r=a;break}}}catch(e){n.e(e)}finally{n.f()}if(r){var u=this.editors.get(r);(null==u?void 0:u.opt.text)&&(null==u?void 0:u.opt.text.replace(/\s*,/g,""))?this.unActive(r):this.delete(r,!0,!0)}}},{key:"onCameraChange",value:function(e,t){var r,n,i,a=f(this.editors.entries());try{for(a.s();!(i=a.n()).done;){var s=o(i.value,2),u=s[0],l=s[1];if(l.viewId===t){var c=l.opt,h=c.boxPoint,d=c.boxSize,p=h&&(null==(r=this.control.viewContainerManager)?void 0:r.transformToOriginPoint(h,l.viewId)),v=null==(n=this.control.viewContainerManager)?void 0:n.getCurScenePath(t);if(v&&t){var m={x:p&&p[0]||0,y:p&&p[1]||0,w:d&&d[0]||0,h:d&&d[1]||0,opt:l.opt,scale:e.scale,type:fu.Text,viewId:t,scenePath:v,canWorker:!1,canSync:!1};this.editors.set(u,m),this.control.viewContainerManager.setActiveTextEditor(t,this.activeId)}}}}catch(e){a.e(e)}finally{a.f()}}},{key:"onServiceDerive",value:function(e){var t,r,n=e.workId,i=e.opt,o=e.msgType,a=e.viewId,s=e.scenePath,u=e.dataType;if(n&&a&&s){var l=n.toString();if(o!==X.RemoveNode){var c=i.boxPoint,h=i.boxSize,d=c&&(null==(t=this.control.viewContainerManager)?void 0:t.transformToOriginPoint(c,a)),f=this.control.viewContainerManager.getView(a),p={x:d&&d[0]||0,y:d&&d[1]||0,w:h&&h[0]||0,h:h&&h[1]||0,opt:i,type:fu.Text,canWorker:!0,canSync:!1,dataType:u,scale:(null==(r=null==f?void 0:f.cameraOpt)?void 0:r.scale)||1,viewId:a,scenePath:s};this.editors.set(l,p),u===Y.Service&&i.workState===$.Done&&this.activeId===l&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(a,this.activeId)}else this.delete(l,!0,!0)}}},{key:"updateForViewEdited",value:function(e,t){var r;this.editors.set(e,t);var n=null==(r=this.taskqueue.get(e))?void 0:r.resolve;n&&n(t)}},{key:"active",value:function(e){var t,r=this.editors.get(e);r&&r.viewId&&(r.opt.workState=$.Start,r.opt.uid=null==(t=this.collector)?void 0:t.uid,this.activeId=e,r.canWorker=!0,r.canSync=!0,this.editors.set(e,r),this.control.viewContainerManager.setActiveTextEditor(r.viewId,this.activeId))}},{key:"unActive",value:function(e){var t=this.editors.get(e);t&&t.viewId&&(t.opt.workState=$.Done,t.opt.uid=void 0,t.canWorker=!0,t.canSync=!0,this.editors.set(e,t),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(t.viewId,this.activeId))}},{key:"createTextForMasterController",value:function(e,t){var r,i=e.workId,o=e.isActive,a=n(e,["workId","isActive"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,a.viewId),a.opt.uid=null==(r=this.collector)?void 0:r.uid,o&&(this.activeId=i),a.dataType=Y.Local,a.canWorker=!0,a.canSync=!0,this.editors.set(i,a),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId)}},{key:"updateTextForMasterController",value:function(e,t){var r,i=e.workId,o=n(e,["workId"]);t&&this.internalMsgEmitter.emit("addUndoTicker",t,o.viewId);var a=this.editors.get(i)||{};o.opt&&(o.opt.uid=null==(r=this.collector)?void 0:r.uid),o.dataType=Y.Local,this.editors.set(i,c(c({},a),o)),this.control.viewContainerManager.setActiveTextEditor(o.viewId,this.activeId)}},{key:"updateTextControllerWithEffectAsync",value:(t=s(regeneratorRuntime.mark((function e(t,r){var i,o,a,s,u,l,h,d,f,p=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.workId,a=n(t,["workId"]),r&&this.internalMsgEmitter.emit("addUndoTicker",r,a.viewId),s=this.editors.get(o)||{},a.opt&&(a.opt.uid=null==(i=this.collector)?void 0:i.uid),a.dataType=Y.Local,u=c(c({},s),a),this.editors.set(o,u),this.control.viewContainerManager.setActiveTextEditor(a.viewId,this.activeId),!this.taskqueue.has(o)){e.next=11;break}return(l=this.taskqueue.get(o))&&(l.clocker&&clearTimeout(l.clocker),this.taskqueue.delete(o)),e.next=10,this.updateTextControllerWithEffectAsync(t);case 10:return e.abrupt("return",e.sent);case 11:return h=setTimeout((function(){var e,t=null==(e=p.taskqueue.get(o))?void 0:e.resolve;t&&t(u)}),50),e.next=14,new Promise((function(e){p.taskqueue.set(o,{resolve:e,clocker:h})}));case 14:return d=e.sent,f=this.taskqueue.get(o),e.abrupt("return",(f&&(f.clocker&&clearTimeout(f.clocker),this.taskqueue.delete(o)),d));case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"updateTextForWorker",value:function(e,t){var r=e.workId,i=e.isActive,o=n(e,["workId","isActive"]),a=c(c({},this.editors.get(r)||{}),o);if(i)return a.canWorker=!1,a.canSync=!1,this.editors.set(r,a),void this.active(r);this.editors.set(r,a),this.control.viewContainerManager.setActiveTextEditor(o.viewId,this.activeId),t&&this.internalMsgEmitter.emit("addUndoTicker",t,o.viewId)}},{key:"get",value:function(e){return this.editors.get(e)}},{key:"delete",value:function(e,t,r){var n=this.editors.get(e);if(n){var i=n.viewId;n.canSync=t,n.canWorker=r,this.editors.delete(e),this.activeId===e&&(this.activeId=void 0),this.control.viewContainerManager.setActiveTextEditor(i,this.activeId)}}},{key:"deleteBatch",value:function(e,t,r){var n,i=new Set,o=f(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.editors.get(a);if(s){var u=s.viewId;s.canSync=t,s.canWorker=r,this.editors.delete(a),this.activeId===a&&(this.activeId=void 0),i.add(u)}}}catch(e){o.e(e)}finally{o.f()}var l,c=f(i);try{for(c.s();!(l=c.n()).done;){var h=l.value;this.control.viewContainerManager.setActiveTextEditor(h,this.activeId)}}catch(e){c.e(e)}finally{c.f()}}},{key:"clear",value:function(e,t){var r=this;this.editors.forEach((function(n,i){n.viewId===e&&(t&&(n.canSync=!1),n.canWorker=!1,r.editors.delete(i))})),this.activeId=void 0,this.control.viewContainerManager.setActiveTextEditor(e,this.activeId)}},{key:"destory",value:function(){this.editors.clear(),this.activeId=void 0}},{key:"collector",get:function(){return this.control.collector}},{key:"interceptors",get:function(){var e=this;return{set:function(t,r){var n,i,o,a,s,u,l,c;if(!e.collector)return!0;var h=r.viewId,d=r.scenePath,f=r.canSync,p=r.canWorker,v=r.type,m=r.opt,g=r.dataType;if(!p&&!f)return!0;var y=(null==(n=e.collector)?void 0:n.isLocalId(t))?null==(i=e.collector)?void 0:i.transformKey(t):t,_=(null==(o=e.collector)?void 0:o.storage[h])&&e.collector.storage[h][d]&&e.collector.storage[h][d][y]||void 0;_?_.toolsType===H.Text&&(p&&(e.control.worker.queryTaskBatchData({workId:t,msgType:X.UpdateNode}).forEach((function(t){var r;null==(r=e.control.worker)||r.taskBatchData.delete(t)})),null==(l=e.control.worker)||l.taskBatchData.add({workId:t,msgType:X.UpdateNode,dataType:g||Y.Local,toolsType:H.Text,opt:m,viewId:h,scenePath:d,willRefresh:!0}),null==(c=e.control.worker)||c.runAnimation()),f&&su((function(){var r;null==(r=e.collector)||r.dispatch({type:X.UpdateNode,workId:t,toolsType:H.Text,opt:m,viewId:h,scenePath:d})}),e.control.worker.maxLastSyncTime)):v===fu.Text&&(f&&(null==(a=e.collector)||a.dispatch({type:m.text&&X.FullWork||X.CreateWork,workId:t,toolsType:H.Text,opt:m,isSync:!0,viewId:h,scenePath:d})),p&&(null==(s=e.control.worker)||s.taskBatchData.add({workId:t,msgType:m.text&&X.FullWork||X.CreateWork,dataType:g||Y.Local,toolsType:H.Text,opt:m,viewId:h,scenePath:d,willRefresh:!0}),null==(u=e.control.worker)||u.runAnimation()))},delete:function(t){var r,n;if(!e.collector)return!0;var i=e.editors.get(t);if(!i)return!0;var o=i.viewId,a=i.scenePath,s=i.canSync,u=i.canWorker;if(!u&&!s)return!0;u&&(null==(r=e.control.worker)||r.taskBatchData.add({workId:t,toolsType:H.Text,msgType:X.RemoveNode,dataType:Y.Local,viewId:o,scenePath:a,willRefresh:!0}),null==(n=e.control.worker)||n.runAnimation()),s&&su((function(){var r;null==(r=e.collector)||r.dispatch({type:X.RemoveNode,removeIds:[t],toolsType:H.Text,viewId:o,scenePath:a})}),e.control.worker.maxLastSyncTime)},clear:function(){return!0}}}}]),e}(),yu=function(){function e(t){var r,n;S(this,e),I(this,"expirationTime",ya.cursor.expirationTime),I(this,"internalMsgEmitter"),I(this,"control"),I(this,"eventName","applianc-cursor"),I(this,"displayer"),I(this,"roomMember"),I(this,"animationId"),I(this,"maxLastSyncTime",ya.syncOpt.interval),I(this,"willSendEventWorkers",[]),I(this,"willConsumeEventWorkers",new Map),I(this,"sendEventTimerId"),I(this,"animationDrawWorkers",new Map),I(this,"animationEventWorkers",new Map),I(this,"cursorInfoMap",new Map),I(this,"doneRenderCursorInfoMap",new Map),I(this,"eventCollector");var i=t.control,o=t.internalMsgEmitter;this.internalMsgEmitter=o,this.control=i,this.roomMember=i.roomMember,this.maxLastSyncTime=(null==(n=null==(r=this.control.pluginOptions)?void 0:r.syncOpt)?void 0:n.interval)||this.maxLastSyncTime}return M(e,[{key:"activeCollector",value:function(){this.control.plugin&&(this.displayer=this.control.room||this.control.play,this.displayer.addMagixEventListener(this.eventName,this.mainMagixEventListener.bind(this)))}},{key:"mainMagixEventListener",value:function(e){var t,r=e.event,n=e.payload;if(r===this.eventName){var i=n.uid,o=n.op,a=n.type;if((null==(t=this.control.collector)?void 0:t.uid)!==i&&a===Q.Cursor&&null!=o&&o.length){var s,u=this.willConsumeEventWorkers.get(i)||[],l=f(o);try{for(l.s();!(s=l.n()).done;){var h=s.value,d=h.viewId;R.isNumber(h.consumPoint[0])&&R.isNumber(h.consumPoint[1])&&(h.consumPoint=this.control.viewContainerManager.transformToOriginPoint(h.consumPoint,d)),this.control.renderControl.isFilterCursor(d)&&u.unshift(c(c({},h),{},{timestamp:Date.now()}))}}catch(e){l.e(e)}finally{l.f()}this.willConsumeEventWorkers.set(i,u),this.runAnimation()}}}},{key:"onFocusViewChange",value:function(){this.checkDrawWorks(),this.runAnimation()}},{key:"updateRoomMembers",value:function(e){var t,r=e.offline,n=f(this.cursorInfoMap.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;i&&r.includes(i)&&this.cursorInfoMap.delete(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"getKey",value:function(e,t){return"".concat(e).concat(Aa).concat(t)}},{key:"getUidAndviewId",value:function(e){var t=o(e.split(Aa),2);return{uid:t[0],viewId:t[1]}}},{key:"runAnimation",value:function(){this.animationId||(this.animationId=requestAnimationFrame(this.animationCursor.bind(this)))}},{key:"checkDrawWorks",value:function(){var e,t,r=this.control.viewContainerManager.focuedViewId,n=f(this.animationDrawWorkers.entries());try{for(n.s();!(t=n.n()).done;){var i=o(t.value,2),a=i[0],s=i[1],u=this.getUidAndviewId(a),l=u.viewId;u.uid!==(null==(e=this.control.collector)?void 0:e.uid)&&l!==r&&s.workState===$.Done&&(s.consumPoint=[void 0,void 0])}}catch(e){n.e(e)}finally{n.f()}}},{key:"animationCursor",value:function(){this.animationId=void 0;var e,t=Date.now(),r=f(this.animationDrawWorkers.entries());try{for(r.s();!(e=r.n()).done;){var i=o(e.value,2),a=i[0],s=i[1],u=this.getUidAndviewId(a),l=u.uid,c=u.viewId,h=this.roomMember.getRoomMember(l);if(h){var d=s.consumPoint,p=s.timestamp,v=s.workState,m=this.cursorInfoMap.get(c)||new Map;d&&R.isNumber(d[0])&&R.isNumber(d[1])&&p+this.expirationTime>t?m.set(h.memberId,{x:d[0],y:d[1],roomMember:h,timestamp:p,type:1,workState:v}):m.delete(h.memberId),m.size?this.cursorInfoMap.set(c,m):this.cursorInfoMap.delete(c),this.animationDrawWorkers.delete(a)}else this.animationDrawWorkers.delete(a)}}catch(e){r.e(e)}finally{r.f()}var g,y=new Set,_=f(this.cursorInfoMap.entries());try{for(_.s();!(g=_.n()).done;){var b=o(g.value,2),x=b[0],w=b[1];if(w){var S,T=f(w.entries());try{for(T.s();!(S=T.n()).done;){var M=o(S.value,2),k=M[0],E=M[1];1===E.type&&E.workState!==$.Done&&y.add(k)}}catch(e){T.e(e)}finally{T.f()}}else this.cursorInfoMap.delete(x)}}catch(e){_.e(e)}finally{_.f()}var I,A=f(this.willConsumeEventWorkers.entries());try{for(A.s();!(I=A.n()).done;){var C=o(I.value,2),P=C[0],N=C[1],O=this.roomMember.getRoomMember(P);if(R.isNumber(null==O?void 0:O.memberId)&&!y.has(O.memberId)){var D=N.pop();D?this.animationEventWorkers.set(P,D):this.willConsumeEventWorkers.delete(P)}}}catch(e){A.e(e)}finally{A.f()}var L,j=f(this.animationEventWorkers.entries());try{for(j.s();!(L=j.n()).done;){var z=o(L.value,2),B=z[0],U=z[1],F=this.roomMember.getRoomMember(B);if(F){var W=U.viewId,V=U.consumPoint,H=U.timestamp,Y=this.cursorInfoMap.get(W)||new Map;V&&R.isNumber(V[0])&&R.isNumber(V[1])&&H+this.expirationTime>t?Y.set(F.memberId,{x:V[0],y:V[1],roomMember:F,timestamp:H,type:0}):Y.delete(F.memberId),Y.size?this.cursorInfoMap.set(W,Y):this.cursorInfoMap.delete(W),this.animationEventWorkers.delete(B)}else this.animationEventWorkers.delete(B)}}catch(e){j.e(e)}finally{j.f()}var X,q=f(this.doneRenderCursorInfoMap.keys());try{for(q.s();!(X=q.n()).done;){var Q=X.value;this.cursorInfoMap.has(Q)||(this.doneRenderCursorInfoMap.delete(Q),this.internalMsgEmitter.emit([G.Cursor,Q],[]))}}catch(e){q.e(e)}finally{q.f()}var Z,K=f(this.cursorInfoMap.entries());try{for(K.s();!(Z=K.n()).done;){var J=o(Z.value,2),ee=J[0],te=J[1];if(null!=te&&te.size){var re,ne=[],ie=f(te.entries());try{for(ie.s();!(re=ie.n()).done;){var oe=o(re.value,2),ae=oe[0],se=oe[1],ue=se.timestamp,le=n(se,["timestamp"]);ue+this.expirationTime>t?ne.push(le):(te.delete(ae),0===te.size&&(this.cursorInfoMap.delete(ee),this.doneRenderCursorInfoMap.delete(ee),this.internalMsgEmitter.emit([G.Cursor,ee],[])))}}catch(e){ie.e(e)}finally{ie.f()}var ce=this.doneRenderCursorInfoMap.get(ee);R.isEqual(ce,ne)||(this.doneRenderCursorInfoMap.set(ee,ne),this.internalMsgEmitter.emit([G.Cursor,ee],ne))}else this.cursorInfoMap.delete(ee),this.doneRenderCursorInfoMap.delete(ee),this.internalMsgEmitter.emit([G.Cursor,ee],[])}}catch(e){K.e(e)}finally{K.f()}(this.willConsumeEventWorkers.size||this.cursorInfoMap.size)&&this.runAnimation()}},{key:"sendEvent",value:function(e,t){var r=this;if(this.displayer&&A.isRoom(this.displayer)){var n=R.isNumber(e[0])&&R.isNumber(e[1])&&this.control.viewContainerManager.transformToScenePoint(e,t)||[void 0,void 0];this.willSendEventWorkers.push({consumPoint:n,viewId:t}),this.sendEventTimerId||(this.sendEventTimerId=setTimeout((function(){r.dispatchMagixEvent()}),this.maxLastSyncTime))}}},{key:"dispatchMagixEvent",value:function(){var e;this.displayer.dispatchMagixEvent(this.eventName,{type:Q.Cursor,op:R.cloneDeep(this.willSendEventWorkers),uid:null==(e=this.control.collector)?void 0:e.uid}),this.willSendEventWorkers.length=0,this.sendEventTimerId&&(clearTimeout(this.sendEventTimerId),this.sendEventTimerId=void 0)}},{key:"collectServiceCursor",value:function(e){var t,r=e.op,n=e.uid,i=e.workState,a=e.viewId;if(n&&r&&i&&a){var s=this.roomMember.getRoomMember(n);if(!s||n===(null==(t=this.control.collector)?void 0:t.uid))return;var u=this.getKey(n,a),l=[void 0,void 0];if(R.isNumber(r[0])&&R.isNumber(r[1])){var c=o(this.control.viewContainerManager.transformToOriginPoint(r,a),2);l=[c[0],c[1]]}if(i===$.Start){var h,d=f(this.cursorInfoMap.values());try{for(d.s();!(h=d.n()).done;){var p=h.value;if(null!=p&&p.size){var v,m=f(p.keys());try{for(m.s();!(v=m.n()).done;){var g=v.value;g===s.memberId&&p.delete(g)}}catch(e){m.e(e)}finally{m.f()}}}}catch(e){d.e(e)}finally{d.f()}}var y={consumPoint:l,workState:i,viewId:a,timestamp:Date.now()};if(i===$.Start||i===$.Done){var _=this.willConsumeEventWorkers.get(n);i===$.Start&&_&&this.willConsumeEventWorkers.delete(n),_&&i===$.Done&&(y.timestamp=y.timestamp-this.expirationTime)}this.animationDrawWorkers.set(u,y),this.runAnimation()}}},{key:"unabled",value:function(){var e;this.displayer&&A.isRoom(this.displayer)&&(this.willSendEventWorkers.length=0,this.displayer.dispatchMagixEvent(this.eventName,{type:Q.Cursor,op:[{viewId:this.control.viewContainerManager.focuedViewId,consumPoint:[void 0,void 0]}],uid:null==(e=this.control.collector)?void 0:e.uid}),this.sendEventTimerId&&(clearTimeout(this.sendEventTimerId),this.sendEventTimerId=void 0))}},{key:"clearViewCursor",value:function(e){var t,r,n,i,a=f(this.animationDrawWorkers.entries());try{for(a.s();!(i=a.n()).done;){var s=o(i.value,1)[0];this.getUidAndviewId(s).uid===(null==(t=this.control.collector)?void 0:t.uid)&&e==e&&this.animationDrawWorkers.delete(s)}}catch(e){a.e(e)}finally{a.f()}var u,l=f(this.willConsumeEventWorkers.entries());try{for(l.s();!(u=l.n()).done;){var c=o(u.value,1)[0];c===(null==(r=this.control.collector)?void 0:r.uid)&&this.willConsumeEventWorkers.delete(c)}}catch(e){l.e(e)}finally{l.f()}var h,d=f(this.animationEventWorkers.entries());try{for(d.s();!(h=d.n()).done;){var p=o(h.value,1)[0];p===(null==(n=this.control.collector)?void 0:n.uid)&&this.animationEventWorkers.delete(p)}}catch(e){d.e(e)}finally{d.f()}var v,m=f(this.cursorInfoMap.entries());try{for(m.s();!(v=m.n()).done;){var g=o(v.value,1)[0];g==g&&(this.cursorInfoMap.delete(g),this.doneRenderCursorInfoMap.delete(g),this.internalMsgEmitter.emit([G.Cursor,g],[]))}}catch(e){m.e(e)}finally{m.f()}}},{key:"stopAnimation",value:function(){this.animationDrawWorkers.clear(),this.willConsumeEventWorkers.clear(),this.cursorInfoMap.clear()}},{key:"destroy",value:function(){var e;null==(e=this.displayer)||e.removeMagixEventListener(this.eventName),this.stopAnimation()}}]),e}(),_u=function(){function e(){S(this,e),I(this,"useEmtMsg"),I(this,"emtType"),I(this,"control"),I(this,"mainEngine")}return M(e,[{key:"registerForMainEngine",value:function(e,t){return this.emtType=e,this.control=t,this.mainEngine=t.worker,this.mainEngine.internalMsgEmitter.on([this.emtType,this.emitEventType],this.collect.bind(this)),this}},{key:"destroy",value:function(){this.emtType&&this.mainEngine&&this.mainEngine.internalMsgEmitter.off([this.emtType,this.emitEventType],this.collect.bind(this))}},{key:"collectForLocalWorker",value:function(e,t){var r,n,i,a,s=this,u=f(e);try{for(u.s();!(a=u.n()).done;){var l=o(a.value,2),c=l[0],h=l[1];null==(r=this.mainEngine)||r.queryTaskBatchData(h).forEach((function(e){var t;null==(t=s.mainEngine)||t.taskBatchData.delete(e)})),null==(n=this.mainEngine)||n.taskBatchData.add(c)}}catch(e){u.e(e)}finally{u.f()}t?this.mainEngine.consume():null==(i=this.mainEngine)||i.runAnimation()}},{key:"collectForServiceWorker",value:function(e){var t=this;su((function(){e.forEach((function(e){var r;null==(r=t.serviceColloctor)||r.dispatch(e)}))}),this.mainEngine.maxLastSyncTime)}},{key:"pause",value:function(){var e;if(this.lastEmtData){this.useEmtMsg=!0;var t=c(c({},this.lastEmtData),{},{workState:$.Done});this.collect(t,!0),null==(e=bl.InternalMsgEmitter)||e.emit(W.ActiveMethod,!1)}}},{key:"recover",value:function(){var e;this.useEmtMsg&&bl.InternalMsgEmitter.hasListeners(W.ActiveMethod)&&(null==(e=bl.InternalMsgEmitter)||e.emit(W.ActiveMethod,!0))}},{key:"serviceColloctor",get:function(){return this.control.collector}}],[{key:"dispatch",value:function(e,t,r){var n;null==(n=bl.InternalMsgEmitter)||n.emit([e,t],r)}}]),e}(),bu=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"lastEmtData"),I(b(e),"emitEventType",W.CopyNode),e}return M(r,[{key:"collect",value:function(e){var t;if(this.serviceColloctor&&this.mainEngine){var r=e.workIds,n=e.viewId,i=this.control.viewContainerManager.getView(n);if(null!=i&&i.displayer){var o=i.focusScenePath,a=Date.now();this.mainEngine.internalMsgEmitter.emit("addUndoTicker",a,n);var s,u=f(r);try{for(u.s();!(s=u.n()).done;){var l=s.value,h=l.toString(),d=this.serviceColloctor.isLocalId(h)?this.serviceColloctor.transformKey(l):h,p=null==(t=this.serviceColloctor.getStorageData(n,o))?void 0:t[d];if(p){if(l===Ca){var v=p&&this.copySelector({viewId:n,store:p});v&&this.pasteSelector(c(c({},v),{},{viewId:n,scenePath:o,undoTickerId:a}));break}if(p.toolsType===H.Text&&p.opt&&p.opt.workState&&p.opt.workState!==$.Done){var m=p&&this.copyText({viewId:n,store:p});m&&this.pasteText(c(c({},m),{},{viewId:n,scenePath:o,key:d,store:p,undoTickerId:a}));break}}}}catch(e){u.e(e)}finally{u.f()}}}}},{key:"copyText",value:function(e){var t=e.viewId,r=e.store,n=this.control.viewContainerManager.getView(t);if(this.serviceColloctor&&n){var i=null==n?void 0:n.cameraOpt,o=i&&[i.centerX,i.centerY],a=r.opt;return{bgCenter:o,textCenter:a.boxPoint&&a.boxSize&&[a.boxPoint[0]+a.boxSize[0]/2,a.boxPoint[1]+a.boxSize[1]/2]}}}},{key:"pasteText",value:function(e){var t,r,n=e.bgCenter,i=e.textCenter,o=e.store,a=e.key,s=e.viewId,u=e.scenePath,l=e.undoTickerId,h=this.control.viewContainerManager.getView(s);if(this.serviceColloctor&&h){var d=Math.floor(30*Math.random()+1),f=(null==(t=h.cameraOpt)?void 0:t.scale)||1,p=n&&i&&[n[0]-i[0]+d,n[1]-i[1]+d]||[d/f,d/f],v=(this.serviceColloctor.isLocalId(a)?a:this.serviceColloctor.getLocalId(a.toString()))+"-"+l;if(o.toolsType===H.Text&&o.opt){var m=o.opt;if(m&&m.boxPoint&&m.text){m.workState=$.Done;var g=m.boxPoint;m.boxPoint=[g[0]+p[0],g[1]+p[1]],m.workState=$.Done;var y=this.control.viewContainerManager.transformToOriginPoint(m.boxPoint,s);this.control.textEditorManager.createTextForMasterController({workId:v,x:y[0],y:y[1],opt:m,scale:(null==(r=h.cameraOpt)?void 0:r.scale)||1,type:fu.Text,isActive:!1,viewId:s,scenePath:u}),this.collectForServiceWorker([c(c({},o),{},{opt:m,type:X.FullWork,workId:v,viewId:s,scenePath:u})])}}}}},{key:"copySelector",value:function(e){var t,r,n,i,o,a,s,u,l,c=e.viewId,h=e.store,d=this.control.viewContainerManager.getView(c),p=h.selectIds;if(this.serviceColloctor&&null!=p&&p.length&&d){var v=new Map,m={offset:{x:0,y:0},cameraOpt:{centerX:(null==(t=d.cameraOpt)?void 0:t.centerX)||0,centerY:(null==(r=d.cameraOpt)?void 0:r.centerY)||0,scale:(null==(n=d.cameraOpt)?void 0:n.scale)||1}},g=this.control.hasOffscreenCanvas()&&(null==(i=d.displayer.canvasBgRef.current)?void 0:i.getBoundingClientRect())||(null==(o=d.displayer.canvasContainerRef.current)?void 0:o.getBoundingClientRect()),y=null==(s=null==(a=d.displayer)?void 0:a.floatBarRef.current)?void 0:s.getBoundingClientRect(),_=g&&[g.x+g.width/2,g.y+g.height/2],b=y&&[y.x+y.width/2,y.y+y.height/2],x=_&&d.viewData&&d.viewData.convertToPointInWorld({x:_[0],y:_[1]}),w=b&&d.viewData&&d.viewData.convertToPointInWorld({x:b[0],y:b[1]});x&&w&&(m.offset={x:x.x-w.x,y:x.y-w.y});var S,T=f(p);try{for(T.s();!(S=T.n()).done;){var M=S.value,k=null==(l=null==(u=this.serviceColloctor)?void 0:u.getStorageData(d.id,d.focusScenePath))?void 0:l[M];k&&v.set(M,k)}}catch(e){T.e(e)}finally{T.f()}return{copyStores:v,copyCoordInfo:m}}}},{key:"pasteSelector",value:function(e){var t,r=e.copyStores,n=e.copyCoordInfo,i=e.viewId,a=e.scenePath,s=e.undoTickerId,u=this.control.viewContainerManager.getView(i);if(r.size&&this.serviceColloctor&&u){var l,h=n.offset,d=(n.cameraOpt,Math.floor(30*Math.random()+1)),p=[h.x+d,h.y+d],v=[],m=[],g=f(r.entries());try{for(g.s();!(l=g.n()).done;){var y=o(l.value,2),_=y[0],b=y[1],x=(this.serviceColloctor.isLocalId(_)?_:this.serviceColloctor.getLocalId(_.toString()))+"-"+s,w={useAnimation:!1};if(b.toolsType===H.Text&&b.opt){var S=b.opt;if(S&&S.boxPoint&&S.text){S.workState=$.Done;var T=S.boxPoint;S.boxPoint=[T[0]+p[0],T[1]+p[1]],S.workState=$.Done;var M=this.control.viewContainerManager.transformToOriginPoint(S.boxPoint,i);this.control.textEditorManager.createTextForMasterController({workId:x,x:M[0],y:M[1],opt:S,scale:(null==(t=u.cameraOpt)?void 0:t.scale)||1,type:fu.Text,isActive:!1,viewId:i,scenePath:a})}m.push(c(c({},b),{},{opt:S,type:X.FullWork,workId:x,viewId:i,scenePath:a}))}else{if(b.toolsType===H.Image&&(b.opt.uuid=x,b.opt.centerX=b.opt.centerX+p[0],b.opt.centerY=b.opt.centerY+p[1]),b.ops){var k=wa(b.ops).map((function(e,t){var r=t%3;return 0===r?e+p[0]:1===r?e+p[1]:e})),E=Sa(k);b.ops=E}m.push(c(c({},b),{},{updateNodeOpt:w,type:X.FullWork,workId:x,viewId:i,scenePath:a})),v.push([c(c({},b),{},{updateNodeOpt:w,workId:x,msgType:X.FullWork,dataType:Y.Local,emitEventType:W.CopyNode,willSyncService:!1,willRefresh:!0,viewId:i}),{workId:x,msgType:X.FullWork,emitEventType:W.CopyNode}])}}}catch(e){g.e(e)}finally{g.f()}v.length&&this.collectForLocalWorker(v),m.length&&this.collectForServiceWorker(m)}}}]),r}(_u);function xu(e,t,r){return"#"+((e<<16)+(t<<8)+r).toString(16).padStart(6,"0")}function wu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return"rgba("+parseInt("0x"+e.slice(1,3))+","+parseInt("0x"+e.slice(3,5))+","+parseInt("0x"+e.slice(5,7))+","+t+")"}function Su(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return"rgba(".concat(e,",").concat(t,",").concat(r,",").concat(n,")")}function Tu(e){var t=e.split(","),r=parseInt(t[0].split("(")[1]),n=parseInt(t[1]),i=parseInt(t[2]),o=Number(t[3].split(")")[0]);return[xu(r,n,i),o]}function Mu(e){var t=e.split(",");return[parseInt(t[0].split("(")[1]),parseInt(t[1]),parseInt(t[2]),Number(t[3].split(")")[0])]}function ku(e){return"transparent"===e}var Eu=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"lastEmtData"),I(b(e),"emitEventType",W.SetColorNode),I(b(e),"undoTickerId"),e}return M(r,[{key:"setTextColor",value:function(e,t,r,n){var i=r.fontColor,o=r.fontBgColor;t.opt&&(i&&(t.opt.fontColor=i),o&&(t.opt.fontBgColor=o),this.control.textEditorManager.updateTextForMasterController({workId:e,opt:t.opt,viewId:n,canSync:!0,canWorker:!0}))}},{key:"collect",value:function(e){var t=this;if(this.serviceColloctor&&this.mainEngine){var r=e.workIds,n=e.strokeColor,i=e.fillColor,a=e.fontColor,s=e.fontBgColor,l=e.viewId,c=e.workState,h=e.thickness,d=e.strokeType,f=this.control.viewContainerManager.getView(l);if(null!=f&&f.displayer){var p=f.focusScenePath,v=u(r),m=this.serviceColloctor.storage,g=[],y={};for((c===$.Start||!this.undoTickerId&&c===$.Done)&&(this.undoTickerId=Date.now(),this.mainEngine.internalMsgEmitter.emit("addUndoTicker",this.undoTickerId,l));v.length;){var _=v.pop();if(_){var b=_.toString(),x=this.serviceColloctor.isLocalId(b),w=x?this.serviceColloctor.transformKey(_):b,S=b;!x&&this.serviceColloctor.isOwn(S)&&(S=this.serviceColloctor.getLocalId(S));var T=m[l][p][w]||void 0;if(T){var M=T.updateNodeOpt||{};if(a||s){if(a){M.fontColor=a;var k=o(Mu(a),4),E=k[0],I=k[1],A=k[2],C=k[3];y.textColor=[E,I,A],y.textOpacity=C}if(s)if(M.fontBgColor=ku(s)?"transparent":s,ku(s))y.textBgColor=void 0,y.textBgOpacity=void 0;else{var P=o(Mu(s),4),N=P[0],O=P[1],R=P[2],D=P[3];y.textBgColor=[N,O,R],y.textBgOpacity=D}if(T.toolsType===H.Text&&T.opt&&c!==$.Start){this.setTextColor(S,pa(T),M,l),c===$.Done&&(this.undoTickerId=void 0);continue}}if(n){M.strokeColor=n;var L=o(Mu(n),4),j=L[0],z=L[1],B=L[2],U=L[3];y.strokeColor=[j,z,B],y.strokeOpacity=U}if(i)if(M.fillColor=ku(i)?"transparent":i,ku(i))y.fillColor=void 0,y.fillOpacity=void 0;else{var F=o(Mu(i),4),W=F[0],G=F[1],V=F[2],q=F[3];y.fillColor=[W,G,V],y.fillOpacity=q}h&&(M.thickness=h,y.strokeWidth=h),d&&(M.strokeType=d,y.strokeType=d);var Q={workId:S,msgType:X.UpdateNode,dataType:Y.Local,updateNodeOpt:M,emitEventType:this.emitEventType,willRefresh:!0,willRefreshSelector:!0,willSyncService:!0,textUpdateForWoker:!0,viewId:l};g.push([Q,{workId:S,msgType:X.UpdateNode,emitEventType:this.emitEventType}])}}}g.length&&(c===$.Done&&(this.undoTickerId=void 0),this.collectForLocalWorker(g)),Object.keys(y).length&&setTimeout((function(){var e;null==(e=t.control.room)||e.setMemberState(y)}),0)}}}}]),r}(_u),Iu=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"lastEmtData"),I(b(e),"emitEventType",W.ZIndexNode),I(b(e),"zIndexMap",new Map),e}return M(r,[{key:"clearZIndex",value:function(e){this.zIndexMap.delete(e)}},{key:"getMinZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.min)||0}},{key:"getMaxZIndex",value:function(e){var t;return(null==(t=this.zIndexMap.get(e))?void 0:t.max)||0}},{key:"setMaxZIndex",value:function(e,t){var r=this.getMinZIndex(t);this.zIndexMap.set(t,{min:r,max:e})}},{key:"setMinZIndex",value:function(e,t){var r=this.getMaxZIndex(t);this.zIndexMap.set(t,{min:e,max:r})}},{key:"addMaxLayer",value:function(e){var t=this.getMaxZIndex(e)+1;this.setMaxZIndex(t,e)}},{key:"addMinLayer",value:function(e){var t=this.getMinZIndex(e)-1;this.setMinZIndex(t,e)}},{key:"correct",value:function(e){for(var t=e.sort((function(e,t){return e[1]-t[1]})),r=1;r((null==(a=null==(o=l[f(e,t.serviceColloctor)])?void 0:o.opt)?void 0:a.zIndex)||0)?1:et.wokerDrawCount){var u,l=[],c=f(n);try{for(c.s();!(u=c.n()).done;){var h=u.value;h.imageBitmap&&(h.isUnClose=!0,l.push(h))}}catch(e){c.e(e)}finally{c.f()}t.reRenders.set(t.subWorkerDrawCount,l)}else t.reRenders.size&&t.clearReRenders(t.subWorkerDrawCount)}a.length&&t.viewContainerManager.render(a)}};case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"clearReRenders",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,r=f(this.reRenders.keys());try{for(r.s();!(e=r.n()).done;){var n=e.value;if(R.isNumber(Number(n))&&Number(n)<=t){var i=this.reRenders.get(Number(n));null==i||i.forEach((function(e){var t;null==(t=e.imageBitmap)||t.close()})),this.reRenders.delete(n)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"getLockSentEventCursor",value:function(){return this.isLockSentEventCursor}},{key:"setLockSentEventCursor",value:function(e){this.isLockSentEventCursor=e}},{key:"getTasksqueueState",value:function(){return this.useTasksqueue&&$.Doing||$.Done}},{key:"setMaxDrawCount",value:function(e){this.maxDrawCount=e}},{key:"getWorkDrawCount",value:function(){return this.wokerDrawCount}},{key:"getSubWorkerDrawCount",value:function(){return this.subWorkerDrawCount}},{key:"getMaxDrawCount",value:function(){return this.maxDrawCount}},{key:"setWorkDrawCount",value:function(e){this.wokerDrawCount=e}},{key:"setSubWorkerDrawCount",value:function(e){this.subWorkerDrawCount=e}},{key:"setWorkerTasksqueueCount",value:function(e){var t=Math.max(this.workerTasksqueueCount||0,e);this.workerTasksqueueCount=t}},{key:"collectorSyncData",value:function(e){var t,r,n,i,o=this,a=!1,s=f(e);try{var u=function(){var e=i.value,s=e.type,u=e.selectIds,l=e.opt,h=e.selectRect,d=e.strokeColor,f=e.fillColor,p=e.willSyncService,v=e.isSync,m=e.imageBitmap,g=e.canvasHeight,y=e.canvasWidth,_=e.rect,b=e.op,x=e.canTextEdit,w=e.points,S=e.selectorColor,T=e.canRotate,M=e.scaleType,k=e.textOpt,E=e.toolsType,I=e.workId,A=e.viewId,C=e.dataType,P=e.canLock,N=e.isLocked,O=e.shapeOpt,D=e.toolsTypes,L=e.thickness,j=e.strokeType,z=e.useStroke,B=e.isgl,U=e.imageSrc,F=e.isSubWorker;if(!A)return{v:void 0};var W=e.scenePath||o.viewContainerManager.getCurScenePath(A);switch(s){case X.Select:var G=null!=u&&u.length?c(c({},h),{},{selectIds:u,canvasHeight:g,canvasWidth:y,points:w}):void 0;G&&null!=l&&l.strokeColor&&(G.selectorColor=l.strokeColor),G&&S&&(G.selectorColor=S),G&&d&&(G.strokeColor=d),G&&null!=l&&l.fillColor&&(G.fillColor=l.fillColor),G&&f&&(G.fillColor=f),G&&R.isBoolean(T)&&(G.canRotate=T),G&&M&&(G.scaleType=M),G&&x&&(G.canTextEdit=x),G&&k&&(G.textOpt=k),G&&R.isBoolean(P)&&(G.canLock=P),G&&R.isBoolean(N)&&(G.isLocked=N),G&&O&&(G.shapeOpt=O),G&&D&&(G.toolsTypes=D),G&&L&&(G.thickness=L),G&&j&&(G.strokeType=j),G&&R.isBoolean(z)&&(G.useStroke=z),A&&o.viewContainerManager.showFloatBar(A,!!G,G),p&&(null==(t=o.collector)||t.dispatch({type:s,selectIds:u,opt:l,isSync:v,viewId:A,scenePath:W}));break;case X.Snapshot:if(m&&W){var V=o.snapshotMap.get(W);V&&V(m)}break;case X.BoundingBox:if(_&&W){var $=o.boundingRectMap.get(W);$&&$(_)}break;case X.Cursor:b&&o.control.cursor.collectServiceCursor(c({},e));break;case X.Clear:if(A){o.viewContainerManager.showFloatBar(A,!1);var q=null==(r=o.clearAllResolveMap.get(A))?void 0:r.resolve;q&&q(A)}break;case X.TextUpdate:if(E===H.Text&&I&&A){var Q=o.viewContainerManager.transformToOriginPoint((null==l?void 0:l.boxPoint)||[0,0],A),Z=(null==l?void 0:l.boxSize)||[0,0],K=null==(n=o.viewContainerManager.getView(A))?void 0:n.cameraOpt;l?o.control.textEditorManager.updateTextForWorker({x:Q[0],y:Q[1],w:Z[0],h:Z[1],scale:(null==K?void 0:K.scale)||1,workId:I,opt:l,dataType:C,viewId:A,canSync:p||!1,canWorker:!1}):o.control.textEditorManager.delete(I,p||!1,!1)}break;case X.GetTextActive:E===H.Text&&I&&A&&o.control.textEditorManager.updateTextForWorker({workId:I,isActive:!0,viewId:A,dataType:Y.Local,canWorker:!1,canSync:!0},Date.now());break;case X.GetImageBitMap:U&&I&&A&&Wu({src:U,isgl:B}).then((function(e){var t,r=new Set;if(r.add({msgType:X.GetImageBitMap,dataType:Y.Local,workId:I,viewId:A,imageSrc:U,isSubWorker:F,imageBitmap:e}),o.control.hasOffscreenCanvas()){var n=F?o.subWorker:o.fullWorker;e?n.postMessage(r,[e]):n.postMessage(r)}else null==(t=o.mainThread)||t.consume(r)}));break;default:a=!0}};for(s.s();!(i=s.n()).done;){var l=u();if("object"===k(l))return l.v}}catch(e){s.e(e)}finally{s.f()}a&&su((function(){o.collectorAsyncData(e)}),this.maxLastSyncTime)}},{key:"collectorAsyncData",value:function(e){var t,r,n,i,o,a=this,s=f(e);try{var u=function(){var e=o.value,s=e.type,u=e.op,l=e.workId,c=e.index,h=e.removeIds,d=e.ops,f=e.opt,p=e.updateNodeOpt,v=e.toolsType,m=e.isSync,g=e.viewId,y=e.isLockSentEventCursor,_=e.nextTasks;if(!g)return console.error("collectorAsyncData",e),{v:void 0};var b=e.scenePath||a.viewContainerManager.getCurScenePath(g);switch(s){case X.None:y&&su((function(){a.setLockSentEventCursor(!1)}),a.maxLastSyncTime);break;case X.DrawWork:null==(t=a.collector)||t.dispatch({type:s,op:u,opt:f,toolsType:v,workId:l,index:c,isSync:m,viewId:g,scenePath:b,updateNodeOpt:p});break;case X.FullWork:null==(r=a.collector)||r.dispatch({type:s,ops:d,workId:l,updateNodeOpt:p,opt:f,toolsType:v,isSync:m,viewId:g,scenePath:b}),a.willSelectorWorkId&&l&&l.toString()===a.willSelectorWorkId&&a.control.runEffectWork((function(){a.setShapeSelectorByWorkId(a.willSelectorWorkId,g),a.willSelectorWorkId=void 0}));break;case X.UpdateNode:null==(n=a.collector)||n.dispatch({type:s,updateNodeOpt:p,workId:l,opt:f,ops:d,op:u,isSync:m,viewId:g,scenePath:b});break;case X.RemoveNode:h&&a.control.textEditorManager.deleteBatch(h,!1,!1),null==(i=a.collector)||i.dispatch({type:s,removeIds:h,isSync:m,viewId:g,scenePath:b}),a.willSelectorWorkId&&null!=h&&h.includes(a.willSelectorWorkId)&&(a.willSelectorWorkId=void 0)}_&&su((function(){a.collectorAsyncData(_)}),a.maxLastSyncTime)};for(s.s();!(o=s.n()).done;){var l=u();if("object"===k(l))return l.v}}catch(e){s.e(e)}finally{s.f()}}},{key:"onLocalEventEnd",value:(i=s(regeneratorRuntime.mark((function e(t,r){var n,i,o,a,u,l,c,h,d,p,v,m,g,y=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.viewContainerManager.getView(r)){e.next=3;break}return e.abrupt("return");case 3:o=i.focusScenePath,a=i.cameraOpt,u=this.viewContainerManager.transformToScenePoint(t,r),l=[],c=f(this.localPointsBatchData.keys()),e.prev=5,c.s();case 7:if((h=c.n()).done){e.next=19;break}if(d=h.value,(null==(n=this.currentToolsData)?void 0:n.toolsType)!==H.Text){e.next=16;break}return p=this.getLocalPointInfo(d),(v=null==p?void 0:p.state)&&v===$.Start&&((m=this.currentLocalWorkData.toolsOpt).workState=$.Doing,m.boxPoint=u,m.boxSize=[m.fontSize,m.fontSize],this.control.textEditorManager.checkEmptyTextBlur(),this.control.textEditorManager.createTextForMasterController({workId:Date.now().toString(),x:t[0],y:t[1],scale:(null==a?void 0:a.scale)||1,opt:m,type:fu.Text,isActive:!0,viewId:r,scenePath:o},Date.now())),this.deleteLocalPoint(d),e.abrupt("continue",17);case 16:this.pushLocalPoint(d,u,$.Done,r),l.push(d);case 17:e.next=7;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(5),c.e(e.t0);case 24:return e.prev=24,c.f(),e.finish(24);case 27:if(!l.length){e.next=43;break}return e.prev=28,e.next=31,new Promise((function(e){setTimeout(s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l.forEach((function(e){y.setLocalPointIsFullWork(e)})),y.delayWorkStateToDoneResolve=e,y.consume();case 1:case"end":return t.stop()}}),t)}))),0)}));case 31:if(e.t1=e.sent,!e.t1){e.next=34;break}e.t1=l[0];case 34:if(!e.t1){e.next=37;break}g=l[0],l.forEach((function(e){y.deleteLocalPoint(e)})),this.willSelectorWorkId=g.toString();case 37:e.next=42;break;case 39:e.prev=39,e.t2=e.catch(28),console.log("error",e.t2);case 42:this.delayWorkStateToDoneResolve=void 0,l.length=0;case 43:case"end":return e.stop()}}),e,this,[[5,21,24,27],[28,39]])}))),function(e,t){return i.apply(this,arguments)})},{key:"onLocalEventDoing",value:function(e,t){var r;if((null==(r=this.currentToolsData)?void 0:r.toolsType)!==H.Text){this.currentLocalWorkData.workState===$.Start&&this.setCurrentLocalWorkData(c(c({},this.currentLocalWorkData),{},{workState:$.Doing}));var n,i=!1,a=f(this.localPointsBatchData.entries());try{for(a.s();!(n=a.n()).done;){var s=o(n.value,2),u=s[0],l=s[1].state;if(this.isAbled()&&l!==$.Pending){var h=this.viewContainerManager.transformToScenePoint(e,t);this.pushLocalPoint(u,h,l===$.Start?$.Doing:l,t),i=!0}}}catch(e){a.e(e)}finally{a.f()}i?this.runAnimation():this.useTasksqueue||this.hoverCursor(e,t)}}},{key:"onLocalEventStart",value:function(e,t){var r,n,i,o,a,s;this.viewContainerManager.focuedViewId!==t&&this.viewContainerManager.setFocuedViewId(t),this.isCanDrawWork&&this.control.room&&!this.control.room.disableDeviceInputs&&(this.control.room.disableDeviceInputs=!0);var u=(null==(r=this.currentToolsData)?void 0:r.toolsType)===H.Selector?Ca:Date.now(),l=this.setZIndex(t);this.setCurrentLocalWorkData({workState:$.Start,toolsOpt:l,viewId:t});var c=this.viewContainerManager.transformToScenePoint(e,t);if(this.pushLocalPoint(u,c,$.Start,t,l),(null==(n=this.currentToolsData)?void 0:n.toolsType)!==H.Text){if(this.control.textEditorManager.checkEmptyTextBlur(),this.isCanRecordUndoRedo&&this.internalMsgEmitter.emit("addUndoTicker",u,t),u&&l&&null!=(i=this.currentToolsData)&&i.toolsType&&this.isCanStartEventConsum&&this.prepareOnceWork({workId:u,toolsOpt:l,viewId:t},null==(o=this.currentToolsData)?void 0:o.toolsType),this.maxDrawCount=0,this.wokerDrawCount=0,this.subWorkerDrawCount=0,this.clearReRenders(1/0),null==(a=this.subMainThreadWorker)||a.clearDrawCount(t),this.isCanDrawWork){var h=this.viewContainerManager.getCurScenePath(t);h&&null!=(s=this.collector)&&s.hasSelector(t,h)&&this.blurSelector(t,h)}this.consume()}}},{key:"setLocalPointIsFullWork",value:function(e){var t=this.getLocalPointInfo(e);t&&(t.isFullWork=!0,this.localPointsBatchData.set(e,t))}},{key:"pushLocalPoint",value:function(e,t,r,n,i){var o=this.getLocalPointInfo(e);r===$.Start?o={state:$.Start,points:t,opt:i||this.currentLocalWorkData.toolsOpt,isFullWork:!1,viewId:n}:o&&(o.state=r,o.points.push(t[0],t[1])),o&&this.localPointsBatchData.set(e,o)}},{key:"deleteLocalPoint",value:function(e){this.localPointsBatchData.delete(e)}},{key:"getLocalPointInfo",value:function(e){return this.localPointsBatchData.get(e)}},{key:"getLocalPointsInfo",value:function(){return this.localPointsBatchData}},{key:"correctStorage",value:function(e,t,r){var n,i=this,a=new Map,s=[];Object.keys(e).forEach((function(t){var r,n,i=null==(n=null==(r=e[t])?void 0:r.opt)?void 0:n.zIndex;R.isNumber(i)&&s.push([t,i])}));var u=s.length&&(null==(n=this.zIndexNodeMethod)?void 0:n.correct(s))||[];this.zIndexNodeMethod&&u.length&&(this.zIndexNodeMethod.setMinZIndex(u[0][1]||0,t),this.zIndexNodeMethod.setMaxZIndex(u[u.length-1][1]||0,t));var l,c=f(u);try{for(c.s();!(l=c.n()).done;){var h=o(l.value,2),d=h[0],p=h[1];if(e[d]){var v=e[d];v.opt&&R.isNumber(v.opt.zIndex)&&v.opt.zIndex!==p&&(v.opt.zIndex=p,a.set(d,v))}}}catch(e){c.e(e)}finally{c.f()}return a.size&&a.forEach((function(n,o){var a;null==(a=i.collector)||a.updateValue(o,n,{viewId:t,scenePath:r,isSync:!0}),e[o]=n})),e}},{key:"originalEventLintener",value:(n=s(regeneratorRuntime.mark((function e(t,r,n){var i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAbled()){e.next=2;break}return e.abrupt("return");case 2:if(a=null==(i=this.collector)?void 0:i.uid,s=this.viewContainerManager.getCurScenePath(n),a&&!this.control.renderControl.isWriteable()){e.next=25;break}e.t0=null==(o=this.currentToolsData)?void 0:o.toolsType,e.next=e.t0===H.Eraser||e.t0===H.PencilEraser||e.t0===H.BitMapEraser?7:10;break;case 7:if(!a||this.control.renderControl.isClearAble({uid:a,viewId:n,scenePath:s})){e.next=9;break}return e.abrupt("return");case 9:case 12:return e.abrupt("break",13);case 10:if(!a||this.control.renderControl.isRenderAble({uid:a,viewId:n,scenePath:s})){e.next=12;break}return e.abrupt("return");case 13:e.t1=t,e.next=e.t1===$.Start?16:e.t1===$.Doing?18:e.t1===$.Done?20:25;break;case 16:return this.setLocalWorkViewId(n),n&&this.onLocalEventStart(r,n),e.abrupt("break",25);case 18:return n&&n===this.getLocalWorkViewId()&&this.onLocalEventDoing(r,n),e.abrupt("break",25);case 20:if(e.t2=n&&n===this.getLocalWorkViewId(),!e.t2){e.next=24;break}return e.next=24,this.onLocalEventEnd(r,n);case 24:return e.abrupt("break",25);case 25:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"getLocalWorkViewId",value:function(){return this.localWorkViewId}},{key:"setLocalWorkViewId",value:function(e){this.localWorkViewId=e}},{key:"setCurrentToolsData",value:function(e){var t,r,n,i=e.toolsType,o=(null==(t=this.currentToolsData)?void 0:t.toolsType)!==e.toolsType;if(d(w(v.prototype),"setCurrentToolsData",this).call(this,e),o){var a,s=f(null==(r=this.viewContainerManager)?void 0:r.getAllViews());try{for(s.s();!(a=s.n()).done;){var u=a.value;if(u){var l=u.id,h=u.focusScenePath;o&&l&&h&&(null!=(n=this.collector)&&n.hasSelector(l,h)&&this.blurSelector(l,h),this.control.textEditorManager.checkEmptyTextBlur())}}}catch(e){s.e(e)}finally{s.f()}this.taskBatchData.add({msgType:X.UpdateTools,dataType:Y.Local,toolsType:i,opt:c(c({},e.toolsOpt),{},{syncUnitTime:this.maxLastSyncTime}),isRunSubWork:this.isRunSubWork,viewId:Pa}),this.runAnimation()}}},{key:"prepareOnceWork",value:function(e,t){var r=this,n=e.workId,i=e.toolsOpt,o=e.viewId;this.queryTaskBatchData({msgType:X.CreateWork,dataType:Y.Local,viewId:o,toolsType:t}).forEach((function(e){r.taskBatchData.delete(e)})),this.taskBatchData.add({msgType:X.CreateWork,workId:n,toolsType:t,opt:c(c({},i),{},{syncUnitTime:this.maxLastSyncTime}),dataType:Y.Local,isRunSubWork:this.isRunSubWork,viewId:o}),this.runAnimation()}},{key:"createViewWorker",value:function(e,t){var r=t.offscreenCanvasOpt,n=t.layerOpt,i=t.dpr,o=t.cameraOpt;this.taskBatchData.add({msgType:X.Init,dataType:Y.Local,viewId:e,offscreenCanvasOpt:r,layerOpt:n,dpr:i,cameraOpt:o,isRunSubWork:!0,isSafari:-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")}),this.isBusy&&this.destroyTaskQueue(),this.consume()}},{key:"destroyViewWorker",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getLocalWorkViewId()===e&&this.setLocalWorkViewId(void 0),this.zIndexNodeMethod&&this.zIndexNodeMethod.clearZIndex(e),this.taskBatchData.add({msgType:X.Destroy,dataType:Y.Local,viewId:e,isRunSubWork:!0}),this.consume(),r||null==(t=this.collector)||t.dispatch({type:X.Clear,viewId:e}),this.control.renderControl.destoryByViewId(e,r)}},{key:"onServiceDerive",value:function(e,t){var r,n,i,o,a,s=this,u=t.newValue,l=t.oldValue,c=t.viewId,h=t.scenePath,d=R.cloneDeep(u)||{},f=e,p=d.type;if(!u&&l){if(f&&(null==(r=this.collector)?void 0:r.getLocalId(f))===Ca)return void(this.collector.isOwn(f)?this.blurSelector(c,h):this.blurSelector(c,h,f));if(p=X.RemoveNode,l.toolsType===H.LaserPen)return}var v=null==(n=this.viewContainerManager.getView(c))?void 0:n.focusScenePath;if(!v||v===h){if(p&&f){if(!this.control.renderControl.isFilterAble({viewId:c,elementId:e,scenePath:h},p))return;var m=d;if(m.workId=null!=(i=this.collector)&&i.isOwn(f)?null==(o=this.collector)?void 0:o.getLocalId(f):f,m.msgType=p,m.toolsType===H.LaserPen&&(m.isRunSubWork=!0),m.dataType=Y.Service,m.viewId=c,m.scenePath=h,m.selectIds&&(m.selectIds=m.selectIds.map((function(e){var t,r;return null!=(t=s.collector)&&t.isOwn(e)?null==(r=s.collector)?void 0:r.getLocalId(e):e}))),m&&m.toolsType===H.Text||(null==l?void 0:l.toolsType)===H.Text)return void this.control.textEditorManager.onServiceDerive(m);this.taskBatchData.add(m)}this.runAnimation();var g=t.newValue&&(null==(a=t.newValue.opt)?void 0:a.zIndex);if(this.zIndexNodeMethod&&R.isNumber(g)){var y=this.zIndexNodeMethod.getMinZIndex(c);this.zIndexNodeMethod.getMaxZIndex(c)g&&this.zIndexNodeMethod.setMinZIndex(g,c)}}}},{key:"pullServiceData",value:function(e,t){var r,n,i,o,a=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isAsync:!1,useAnimation:!1},u=null==(r=this.collector)?void 0:r.getStorageData(e,t),l=s.isAsync,c=s.useAnimation;if(u){this.control.renderControl.isWriteable()&&(u=this.correctStorage(u,e,t));for(var h=Object.keys(u),d=0,f=h;dDate.now()&&(s.push(c.toString()),this.taskBatchData.add({msgType:X.RemoveNode,workId:c,viewId:p,dataType:Y.Local,isRunSubWork:!0}));var g=v.map((function(e){return e}));this.taskBatchData.add({op:g,workState:$.Done,workId:c,dataType:Y.Local,msgType:X.DrawWork,isRunSubWork:this.isRunSubWork,toolsType:null==(t=this.currentToolsData)?void 0:t.toolsType,viewId:p,opt:m,scenePath:p&&this.viewContainerManager.getCurScenePath(p)}),a=!0}this.deleteLocalPoint(c)}}}catch(e){u.e(e)}finally{u.f()}if((a||s.length)&&(this.consume(),s.length)){var y=null==(r=this.viewContainerManager.getView(e))?void 0:r.focusScenePath;null==(n=this.collector)||n.dispatch({type:X.RemoveNode,removeIds:s,viewId:e,scenePath:y})}}},{key:"removeDrawingWork",value:function(e){var t,r,n,i=[],a=f(this.localPointsBatchData.entries());try{for(a.s();!(n=a.n()).done;){var s=o(n.value,2),u=s[0],l=s[1],c=l.state,h=l.viewId;(e===h&&c===$.Start||c===$.Doing)&&(this.deleteLocalPoint(u),c===$.Doing&&this.isCanDrawWork&&(i.push(u.toString()),this.taskBatchData.add({msgType:X.RemoveNode,workId:u,viewId:h,dataType:Y.Local,isRunSubWork:!0})))}}catch(e){a.e(e)}finally{a.f()}if(i.length){this.consume();var d=null==(t=this.viewContainerManager.getView(e))?void 0:t.focusScenePath;null==(r=this.collector)||r.dispatch({type:X.RemoveNode,removeIds:i,viewId:e,scenePath:d})}}},{key:"hoverCursor",value:function(e,t){var r,n=this;if((null==(r=this.currentToolsData)?void 0:r.toolsType)===H.Selector){var i=this.viewContainerManager.getView(t);if(i&&i.displayer&&i.displayer.vDom){var o=i.displayer.vDom.state.floatBarData;if(o)if(tu(e,{x:o.x,y:o.y,w:o.w,h:o.h}))return}var a=this.viewContainerManager.transformToScenePoint(e,t),s={msgType:X.CursorHover,dataType:Y.Local,point:a,toolsType:this.currentToolsData.toolsType,opt:this.currentToolsData.toolsOpt,isRunSubWork:!1,viewId:t};this.queryTaskBatchData({msgType:X.CursorHover,dataType:Y.Local,toolsType:this.currentToolsData.toolsType,viewId:t}).forEach((function(e){n.taskBatchData.delete(e)})),this.taskBatchData.add(s),this.runAnimation()}}},{key:"blurCursor",value:function(e){var t,r=this;if((null==(t=this.currentToolsData)?void 0:t.toolsType)===H.Selector){var n={msgType:X.CursorBlur,dataType:Y.Local,isRunSubWork:!1,viewId:e};this.queryTaskBatchData({msgType:X.CursorHover,dataType:Y.Local,viewId:e}).forEach((function(e){r.taskBatchData.delete(e)})),this.taskBatchData.add(n),this.consume()}}},{key:"sendCursorEvent",value:function(e,t){var r,n;if(this.currentLocalWorkData&&this.currentLocalWorkData.workState!==$.Unwritable&&this.currentToolsData&&this.isCanSentCursor){var i=null==(r=this.collector)?void 0:r.uid,o=this.viewContainerManager.getCurScenePath(t);switch(null==(n=this.currentToolsData)?void 0:n.toolsType){case H.Eraser:case H.PencilEraser:case H.BitMapEraser:if(i&&!this.control.renderControl.isClearAble({uid:i,viewId:t,filterLocalSelf:!1,scenePath:o}))return;break;default:if(i&&!this.control.renderControl.isWriteable()||i&&!this.control.renderControl.isRenderAble({uid:i,viewId:t,filterLocalSelf:!1,scenePath:o}))return}var a=[void 0,void 0];this.currentToolsData&&this.isCanSentCursor&&!this.localPointsBatchData.size&&!this.getLockSentEventCursor()&&(a=e,this.control.cursor.sendEvent(a,t))}}},{key:"getBoundingRect",value:function(e){var t,r,n=this;if(!(null==(t=this.boundingRectMap)?void 0:t.get(e))){var i=null==(r=this.collector)?void 0:r.getScenePathData(e);if(!i)return;if(Object.keys(i).forEach((function(e){var t;(null==(t=n.collector)?void 0:t.getLocalId(e))===Ca&&delete i[e]})),Object.keys(i).length&&this.viewContainerManager.mainView&&this.viewContainerManager.mainView.cameraOpt){var o={msgType:X.BoundingBox,dataType:Y.Local,scenePath:e,scenes:i,cameraOpt:c({},this.viewContainerManager.mainView.cameraOpt),isRunSubWork:!0,viewId:this.viewContainerManager.mainView.id};return this.taskBatchData.add(o),this.runAnimation(),new Promise((function(t){n.boundingRectMap.set(e,t)})).then((function(t){return n.boundingRectMap.delete(e),t}))}}}},{key:"getSnapshot",value:function(e,t,r,n){var i,o,a,s,u,l=this;if(!(null==(i=this.snapshotMap)?void 0:i.get(e))){var h=null==(o=this.collector)?void 0:o.getViewIdBySecenPath(e);if(!h)return;var d=null==(a=this.collector)?void 0:a.getStorageData(h,e);if(!d)return;if(Object.keys(d).forEach((function(e){var t;(null==(t=l.collector)?void 0:t.getLocalId(e))===Ca&&delete d[e]})),Object.keys(d).length){var f=this.viewContainerManager.mainView;if(!f)return;var p=t||(null==(s=f.cameraOpt)?void 0:s.width),v=r||(null==(u=f.cameraOpt)?void 0:u.height),m={msgType:X.Snapshot,dataType:Y.Local,scenePath:e,scenes:d,w:p,h:v,cameraOpt:n&&c(c({},n),{},{width:p,height:v})||f.cameraOpt,isRunSubWork:!0,viewId:f.id};return this.taskBatchData.add(m),this.runAnimation(),new Promise((function(t){l.snapshotMap.set(e,t)})).then((function(t){return l.snapshotMap.delete(e),t}))}}}},{key:"queryTaskBatchData",value:function(e){var t=[];if(e){var r,n=f(this.taskBatchData.values());try{for(n.s();!(r=n.n()).done;){for(var i=r.value,a=!0,s=0,u=Object.entries(e);s=t||r<0||h&&e-l>=o}function m(){var e=ul();if(v(e))return g(e);s=setTimeout(m,function(e){var r=t-(e-u);return h?hl(r,o-(e-l)):r}(e))}function g(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=ul(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(m,t),f(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=ll(t)||0,sl(r)&&(c=!!r.leading,o=(h="maxWait"in r)?cl(ll(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(ul())},y},fl=dl,pl=et;var vl=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return pl(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),fl(e,t,{leading:n,maxWait:t,trailing:i})},ml=ae(vl),gl=function(){function e(t){var r;S(this,e),I(this,"internalMsgEmitter"),I(this,"control"),I(this,"roomHotkeyCheckers"),I(this,"tmpCopyStore",new Map),I(this,"tmpCopyCoordInfo");var n=t.control,i=t.internalMsgEmitter;this.control=n,this.internalMsgEmitter=i,this.roomHotkeyCheckers=(null==(r=this.control.room)?void 0:r.viewsParams.hotKeys.nodes)||[]}return M(e,[{key:"getEventKey",value:function(e){return"keydown"===e.type?"KeyDown":"KeyUp"}},{key:"onActiveHotkey",value:function(e){var t,r,n,i=this.control.viewContainerManager.focuedViewId,o=null==(t=this.control.viewContainerManager.focuedView)?void 0:t.focusScenePath;if(i&&o)switch(e){case"delete":this.isSelector&&null!=(r=this.collector)&&r.hasSelector(i,o)&&zu.emitMethod(G.MainEngine,W.DeleteNode,{workIds:[Ca],viewId:i});break;case"copy":this.isSelector&&null!=(n=this.collector)&&n.hasSelector(i,o)&&this.copySelectorToTemp(i,o);break;case"paste":this.tmpCopyStore.size&&this.pasteTempToFocusView(i,o)}("changeToPencil"===e||"redo"===e||"undo"===e)&&this.onSelfActiveHotkey(e)}},{key:"colloctHotkey",value:function(e){if(this.isUseSelf){var t=this.checkHotkey(e);t&&this.onSelfActiveHotkey(t)}}},{key:"onSelfActiveHotkey",value:function(e){switch(e){case"changeToPencil":this.setMemberState({currentApplianceName:B.pencil,useNewPencil:!0});break;case"changeToArrow":this.setMemberState({currentApplianceName:B.arrow});break;case"changeToClick":this.setMemberState({currentApplianceName:B.clicker});break;case"changeToEllipse":this.setMemberState({currentApplianceName:B.ellipse});break;case"changeToEraser":this.setMemberState({currentApplianceName:B.eraser,isLine:!0});break;case"changeToHand":this.setMemberState({currentApplianceName:B.hand});break;case"changeToLaserPointer":this.setMemberState({currentApplianceName:B.laserPointer});break;case"changeToSelector":this.setMemberState({currentApplianceName:B.selector});break;case"changeToRectangle":this.setMemberState({currentApplianceName:B.rectangle});break;case"changeToStraight":this.setMemberState({currentApplianceName:B.straight});break;case"redo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.redo();break;case"undo":this.control.room&&!this.control.room.disableSerialization&&this.control.viewContainerManager.undo();break;case"changeToText":this.setMemberState({currentApplianceName:B.text})}}},{key:"checkHotkey",value:function(e){var t,r=f(this.roomHotkeyCheckers);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.kind;if((0,n.checker)({nativeEvent:e,kind:this.getEventKey(e),key:e.key,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},this.keyboardKind))return i}}catch(e){r.e(e)}finally{r.f()}}},{key:"copySelectorToTemp",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(W.CopyNode);if(i&&this.collector&&o){var a=this.collector.transformKey(Ca),s=this.collector.getStorageData(e,t);if(s){var u=s[a],l=u&&o.copySelector({viewId:e,store:u});l&&(this.tmpCopyCoordInfo=null==l?void 0:l.copyCoordInfo,this.tmpCopyStore=null==l?void 0:l.copyStores)}}}},{key:"pasteTempToFocusView",value:function(e,t){var r,n,i=this.control.viewContainerManager.getView(e),o=null==(n=null==(r=this.mainEngine)?void 0:r.methodBuilder)?void 0:n.getBuilder(W.CopyNode);if(i&&this.tmpCopyCoordInfo&&this.tmpCopyStore.size&&this.collector&&o&&i.viewData&&this.tmpCopyCoordInfo){var a=R.cloneDeep(this.tmpCopyCoordInfo.offset),s=this.tmpCopyCoordInfo.cameraOpt,u=i.viewData.camera;a.x=a.x+u.centerX-s.centerX,a.y=a.y+u.centerY-s.centerY;var l=Date.now();this.control.worker.internalMsgEmitter.emit("addUndoTicker",l,e),o.pasteSelector({viewId:e,scenePath:t,copyStores:R.cloneDeep(this.tmpCopyStore),copyCoordInfo:{offset:a,cameraOpt:u},undoTickerId:l})}}},{key:"setMemberState",value:function(e){var t;null==(t=this.control.room)||t.setMemberState(e)}},{key:"isUseSelf",get:function(){var e;return(null==(e=this.control.room)?void 0:e.disableDeviceInputs)||!1}},{key:"isSelector",get:function(){var e;return(null==(e=this.control.worker.currentToolsData)?void 0:e.toolsType)===H.Selector}},{key:"collector",get:function(){return this.control.collector}},{key:"mainEngine",get:function(){return this.control.worker}},{key:"keyboardKind",get:function(){return/^Mac/i.test(navigator.platform)?"mac":"windows"}}]),e}(),yl=function(){function e(t){var r;S(this,e),I(this,"control"),I(this,"roomMemberManager"),I(this,"worker"),I(this,"renderUids",new Map),I(this,"pageAuth",new Map),I(this,"isLocalRender",!1),I(this,"isCurWritable",!1);var n=t.control;this.control=n,this.roomMemberManager=n.roomMember,this.worker=n.worker,this.isCurWritable=(null==(r=this.control.room)?void 0:r.isWritable)||!1}return M(e,[{key:"onWritableChange",value:function(e){this.isCurWritable=e}},{key:"addPage",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e.viewId,o=e.render,a=void 0===o?"localSelf":o,s=e.elementIds,u=e.pageId,l=void 0===u?null==(t=this.control.collector)?void 0:t.uid:u,c=this.pageAuth.get(i)||new Map,h=this.control.viewContainerManager.getCurScenePath(i);if(h&&l){var d=c.get(h)||{render:"localSelf",pages:new Map};n&&(d.render=a);var f=d.pages.get(l)||new Set;f.size&&this.delElementIds(i,h,f);var p=s&&this.cloneElementIds(i,h,s,l)||new Set;d.pages.set(l,p),c.set(h,d),this.pageAuth.set(i,c)}n&&this.pageAuthEffect(i),this.isLocalRender=!1;var v=this.serializablePageData(i);null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthPage,viewId:i,pageData:v},!0)}},{key:"delPage",value:function(e,t){var r,n,i=this.pageAuth.get(t);if(i){var o=u(i.keys()).find((function(t){var r=i.get(t);return!(!r||!r.pages.has(e))}));if(o){var a=i.get(o);if(a){var s=a.render,l=a.pages,c="localSelf"===s?null==(r=this.control.collector)?void 0:r.uid:s,h=l.get(e);null!=h&&h.size&&this.delElementIds(t,o,h),l.delete(e),c===e&&this.pageAuthEffect(t)}var d=this.serializablePageData(t);null==(n=this.control.collector)||n.dispatchAuth({type:X.AuthPage,viewId:t,pageData:d},!0)}}}},{key:"delViewPage",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pageAuth.get(e)){if(r)return this.pageAuth.delete(e),void(null==(t=this.control.collector)||t.dispatchAuth({type:X.AuthPage,viewId:e},r));this.pageAuth.delete(e)}}},{key:"clearRenderPage",value:function(e,t){var r,n,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this.pageAuth.get(e);if(o){var a=o.get(t);if(a){var s=a.render,u=a.pages,l="localSelf"===s?null==(r=this.control.collector)?void 0:r.uid:s;if(l){if(i){var c=u.get(l);c&&this.delElementIds(e,t,c)}u.set(l,new Set)}}if(i){var h=this.serializablePageData(e);null==(n=this.control.collector)||n.dispatchAuth({type:X.AuthPage,viewId:e,pageData:h},i)}}}},{key:"hasPage",value:function(e,t,r){var n=this.pageAuth.get(t);if(!n)return!1;var i=n.get(r);return!!i&&i.pages.has(e)}},{key:"getPageInfo",value:function(e,t,r){var n=this.pageAuth.get(t);if(n){var i=n.get(r);return i?i.pages.get(e):void 0}}},{key:"addRenderPageElementId",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.viewId,a=e.elementId,s=e.scenePath,u=this.pageAuth.get(o);if(!u)throw new Error("no view info in viewId: ".concat(o));var l=u.get(s);if(l){var c=l.render,h=l.pages,d="localSelf"===c?null==(t=this.control.collector)?void 0:t.uid:c;if(d&&h.has(d)){var f=h.get(d)||new Set;f.add(a),h.set(d,f)}}if(i&&this.pageAuthEffect(o),n){var p=this.serializablePageData(o);null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthPage,viewId:o,pageData:p},n)}}},{key:"delRenderPageElementId",value:function(e){var t,r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.viewId,a=e.elementId,s=e.scenePath,u=this.pageAuth.get(o);if(!u)throw new Error("no view info in viewId: ".concat(o));var l=u.get(s);if(l){var c=l.render,h=l.pages,d="localSelf"===c?null==(t=this.control.collector)?void 0:t.uid:c;if(d&&h.has(d)){var f=h.get(d);f&&(f.delete(a),h.set(d,f))}}if(i&&this.pageAuthEffect(o),n){var p=this.serializablePageData(o);null==(r=this.control.collector)||r.dispatchAuth({type:X.AuthPage,viewId:o,pageData:p},n)}}},{key:"setPageRender",value:function(e,t,r){var n,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.pageAuth.get(e);if(!o)throw new Error("no view info in viewId: ".concat(e));var a=o.get(t);if(a&&(a.render=r),t===this.control.viewContainerManager.getCurScenePath(e)&&this.pageAuthEffect(e),i||(this.isLocalRender=!0),i){this.isLocalRender=!1;var s=this.serializablePageData(e);null==(n=this.control.collector)||n.dispatchAuth({type:X.AuthPage,viewId:e,pageData:s},i)}}},{key:"isWriteable",value:function(){return this.isCurWritable}},{key:"isRenderAble",value:function(e){var t,r,n=e.uid,i=e.viewId,o=e.filterLocalSelf,a=void 0===o||o,s=e.scenePath,u=this.renderUids.get(i);if(u){var l=u.render,c=u.hide;if(void 0===l&&void 0===c)return!0;if(R.isSet(l)){if(l.has(n)||a&&(null==(t=this.control.collector)?void 0:t.uid)===n&&l.has("localSelf"))return!0}else if(!0===l&&(!c||R.isSet(c)&&!c.has(n)&&(!a||!c.has("localSelf")||(null==(r=this.control.collector)?void 0:r.uid)!==n)))return!0;return!1}var h=this.pageAuth.get(i);if(h&&s){var d=h.get(s);if(d){var f=d.render;if(f)return!("localSelf"===f&&!a)}}return!0}},{key:"isClearAble",value:function(e){var t,r=e.uid,n=e.viewId,i=e.filterLocalSelf,o=void 0===i||i,a=e.scenePath,s=this.renderUids.get(n);if(s){var u=s.clear;return!!(void 0===u||!0===u||R.isSet(u)&&(u.has(r)||o&&(null==(t=this.control.collector)?void 0:t.uid)===r&&u.has("localSelf")))}var l=this.pageAuth.get(n);if(l&&a){var c=l.get(a);if(c){var h=c.render;if(h)return!("localSelf"===h&&!o)}}return!0}},{key:"isFilterAble",value:function(e,t){var r,n,i,o,a=e.viewId,s=e.scenePath,u=e.elementId,l=this.renderUids.get(a);if(l&&u){var c=l.render,h=l.hide;if(void 0===c&&void 0===h)return!0;var d=null==(r=this.control.collector)?void 0:r.getUidFromKey(u);return!!d&&!((!R.isSet(c)||!(c.has(d)||c.has("localSelf")&&(null==(n=this.control.collector)?void 0:n.uid)===d))&&(!0!==c||h&&(!R.isSet(h)||h.has(d)||h.has("localSelf")&&(null==(i=this.control.collector)?void 0:i.uid)===d)))}var f=this.pageAuth.get(a);if(f&&s&&u){var p=f.get(s);if(p){var v=p.render,m=p.pages;if(!v)return!0;var g=null==(o=this.control.collector)?void 0:o.uid,y="localSelf"===v?g:v,_=y&&m.get(y)||void 0;if(_){if(t===X.RemoveNode)return!0;return _.has(u)}return!1}}return!0}},{key:"isFilterCursor",value:function(e){if(this.isUsePageAuth(e)){var t=this.control.viewContainerManager.getCurScenePath(e),r=this.pageAuth.get(e);if(t&&r){var n=r.get(t);if(n)return"localSelf"!==n.render}}return!0}},{key:"isUsePageAuth",value:function(e){var t;if(!this.pageAuth.has(e))return!1;var r=this.control.viewContainerManager.getCurScenePath(e);return r&&(null==(t=this.pageAuth.get(e))?void 0:t.has(r))||!1}},{key:"publishRender",value:function(e){var t,r=e.viewId,n=e.option,i=e.isSync,o=void 0===i||i;if(n){var a={},s=n.render,u=n.hide,l=n.clear;s&&(a.render=!0===s||new Set(s)),u&&(a.hide=!0===u||new Set(u)),l&&(a.clear=!0===l||new Set(l)),this.renderUids.set(r,a)}else this.renderUids.delete(r);o&&(null==(t=this.control.collector)||t.dispatchAuth({type:X.AuthReader,viewId:r,renderData:n},o)),this.renderEffect(r)}},{key:"publishOneRender",value:function(e,t,r){var n,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.renderUids.get(e);switch(r){case"show":o?(o.render||(o.render=new Set),R.isSet(o.render)&&o.render.add(t),R.isSet(o.hide)&&o.hide.delete(t)):this.renderUids.set(e,{render:new Set([t])});break;case"hide":o?(o.hide||(o.hide=new Set),R.isSet(o.hide)&&o.hide.add(t),R.isSet(o.render)&&o.render.delete(t)):this.renderUids.set(e,{hide:new Set([t])})}if(o?this.renderUids.set(e,o):this.renderUids.delete(e),i){var a={};if(o)for(var s=0,u=Object.keys(o);s3&&void 0!==arguments[3])||arguments[3],o=this.renderUids.get(e);if(r?o?(o.clear||(o.clear=new Set),R.isSet(o.clear)&&o.clear.add(t)):this.renderUids.set(e,{clear:new Set([t])}):o&&R.isSet(o.clear)&&o.clear.has(t)&&o.clear.delete(t),o?this.renderUids.set(e,o):this.renderUids.delete(e),i){var a={};if(o)for(var s=0,u=Object.keys(o);s2&&void 0!==arguments[2]&&arguments[2],n=!1;if(t){for(var i=this.pageAuth.get(e)||new Map,a=0,s=Object.entries(t);a1&&void 0!==arguments[1]&&arguments[1];this.renderUids.has(e)&&(this.renderUids.delete(e),r||null==(t=this.control.collector)||t.dispatchAuth({type:X.AuthReader,viewId:e})),this.pageAuth.has(e)&&this.control.renderControl.delViewPage(e,!r)}},{key:"renderEffect",value:function(e){var t,r=this,n=null==(t=this.control.viewContainerManager.getView(e))?void 0:t.focusScenePath;n&&this.worker.clearViewScenePath(e,!0).then((function(){var t;r.worker.pullServiceData(e,n,{isAsync:!0,useAnimation:!1}),r.worker.sendClearUids(e,null==(t=r.renderUids.get(e))?void 0:t.clear)}))}},{key:"pageAuthEffect",value:function(e){var t,r=this,n=null==(t=this.control.viewContainerManager.getView(e))?void 0:t.focusScenePath;n&&this.worker.clearViewScenePath(e,!0).then((function(){r.worker.pullServiceData(e,n,{isAsync:!0,useAnimation:!1}),r.worker.sendClearUids(e,!0)}))}},{key:"serializablePageData",value:function(e){var t,r,n,i=this.pageAuth.get(e);if(i){var a,s={},u=f(i);try{for(u.s();!(a=u.n()).done;){var l,c=o(a.value,2),h=c[0],d=c[1],p=d.render,v=d.pages,m={},g=f(v);try{for(g.s();!(l=g.n()).done;){var y=o(l.value,2),_=y[0],b=y[1];m[_]=Array.from(b)}}catch(e){g.e(e)}finally{g.f()}var x=this.isLocalRender&&(null==(n=null==(r=null==(t=this.control.collector)?void 0:t.authStorage.pageAuth)?void 0:r[e])?void 0:n[h].render)||p;s[h]={render:x,pages:m}}}catch(e){u.e(e)}finally{u.f()}return s}}},{key:"cloneElementIds",value:function(e,t,r,n){var i,o,a=null==(i=this.control.collector)?void 0:i.getStorageData(e,t),s=new Set;if(a)for(var u=0,l=Object.keys(a);u2&&void 0!==arguments[2])||arguments[2];this.viewContainerManager.getView(e)&&(null==(r=this.renderControl)||r.publishRender({viewId:e,option:t,isSync:n}))}},{key:"cancelFilterRender",value:function(e){var t,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];null==(t=this.renderControl)||t.publishRender({viewId:e,isSync:r})}}]),e}();I(_l,"InternalMsgEmitter",new O);var bl=_l,xl=function(){function e(t){var r=this;S(this,e),I(this,"emitter",new O),I(this,"undoStack"),I(this,"redoStack"),I(this,"worker"),I(this,"control"),I(this,"room"),I(this,"isTicking"),I(this,"undoTickerId"),I(this,"viewId"),I(this,"scenePath"),I(this,"tickStartStorerCache"),I(this,"excludeIds",new Set),I(this,"onChangeScene",R.debounce((function(){var e=r.control.viewContainerManager.getCurScenePath(r.viewId);if(e){var t=r.undoStack.filter((function(t){return t.scenePath===e})).length,n=r.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===n&&r.tickStartStorerCache&&r.scenePath===e&&(t=1),r.emitter.emit("onCanUndoStepsUpdate",t),r.emitter.emit("onCanRedoStepsUpdate",n)}}),e.waitTime));var n=t.control,i=t.internalMsgEmitter,o=t.viewId;this.control=n,this.emitter=i,this.undoStack=[],this.redoStack=[],this.room=n.room,this.worker=n.worker,this.isTicking=!1,this.viewId=o}return M(e,[{key:"addExcludeIds",value:function(e){if(this.isTicking){var t,r=f(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.excludeIds.add(n)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"undoTickerStart",value:function(e,t){if(this.collector&&(this.undoTickerId!==e||this.scenePath!==t)){!this.undoTickerId&&!this.tickStartStorerCache&&!this.scenePath&&this.emitter.emit("onCanUndoStepsUpdate",1),this.undoTickerId&&this.viewId&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath),this.isTicking=!0;var r=this.collector.transformKey(Ca);this.excludeIds.add(r),this.undoTickerId=e,this.scenePath=t;var n=this.collector.getStorageData(this.viewId,t)||{};this.tickStartStorerCache=new Map(Object.entries(R.cloneDeep(n)))}}},{key:"undoTickerEndSync",value:function(t,r,n){var i,o;if(t===this.undoTickerId&&n===this.scenePath&&r===this.viewId&&this.tickStartStorerCache){var a=(null==(i=this.collector)?void 0:i.storage[r])&&(null==(o=this.collector)?void 0:o.storage[r][n])||{},s=this.diffFun(this.tickStartStorerCache,new Map(Object.entries(a)));s.size&&(this.undoStack.push({id:t,type:2,data:R.cloneDeep(s),scenePath:n}),this.undoStack.length>e.MaxStackLength&&this.undoStack.shift(),this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)),this.redoStack.length&&(this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)),this.isTicking=!1,this.scenePath=void 0,this.tickStartStorerCache=void 0,this.undoTickerId=void 0,this.excludeIds.clear()}}},{key:"undo",value:function(e){this.undoTickerId&&this.tickStartStorerCache&&this.scenePath&&this.undoTickerEndSync(this.undoTickerId,this.viewId,this.scenePath);for(var t=this.undoStack.length-1;t>=0;){if(this.undoStack[t].scenePath===e){var r=this.undoStack[t];r&&(this.redoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r)),this.undoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),n}},{key:"redo",value:function(e){for(var t=this.redoStack.length-1;t>=0;){if(this.redoStack[t].scenePath===e){var r=this.redoStack[t];r&&(!this.undoTickerId&&r.tickStartStorerCache?(this.undoTickerId=r.id,this.tickStartStorerCache=r.tickStartStorerCache,this.scenePath=r.scenePath):this.undoStack.push(r),2===r.type&&r.data&&this.refreshPlugin(r,!0)),this.redoStack.splice(t,1);break}t--}var n=this.undoStack.filter((function(t){return t.scenePath===e})).length,i=this.redoStack.filter((function(t){return t.scenePath===e})).length;return this.emitter.emit("onCanUndoStepsUpdate",n),this.emitter.emit("onCanRedoStepsUpdate",i),i}},{key:"clear",value:function(){this.clearUndo(),this.clearRedo()}},{key:"clearUndo",value:function(){this.undoStack.length=0,this.emitter.emit("onCanUndoStepsUpdate",this.undoStack.length)}},{key:"clearRedo",value:function(){this.redoStack.length=0,this.emitter.emit("onCanRedoStepsUpdate",this.redoStack.length)}},{key:"canUndo",value:function(){return!!this.undoStack.length}},{key:"canRedo",value:function(){return!!this.redoStack.length}},{key:"onFocusView",value:function(){var e=this.control.viewContainerManager.getCurScenePath(this.viewId);if(e){var t=this.undoStack.filter((function(t){return t.scenePath===e})).length,r=this.redoStack.filter((function(t){return t.scenePath===e})).length;0===t&&0===r&&this.tickStartStorerCache&&this.scenePath===e&&(t=1),this.emitter.emit("onCanUndoStepsUpdate",t),this.emitter.emit("onCanRedoStepsUpdate",r)}}},{key:"diffFun",value:function(e,t){var r,n=new Set,i=e.keys(),o=t.keys(),a=f(i);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!this.excludeIds.has(s)){var u=e.get(s),l=t.get(s);if(u&&l){if(R.isEqual(l,u))continue;n.add({dataType:3,key:s,data:[u,l]})}else u&&n.add({dataType:2,key:s,data:u})}}}catch(e){a.e(e)}finally{a.f()}var c,h=f(o);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(!this.excludeIds.has(d)){var p=t.get(d);p&&!e.has(d)&&n.add({dataType:1,key:d,data:p})}}}catch(e){h.e(e)}finally{h.f()}return n}},{key:"isDrawEffectiveScene",value:function(e,t){var r=e.key;return!t.includes(r)}},{key:"isDeleteEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=f(t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===Ca&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(null!=(n=null==u?void 0:u.selectIds)&&n.includes(o))return!1}}catch(e){s.e(e)}finally{s.f()}return!0}},{key:"isOldEffectiveScene",value:function(e,t,r){var n,i=this,o=e.key;if(!t.includes(o))return!1;var a,s=f(t.filter((function(e){var t,r;return(null==(t=i.collector)?void 0:t.getLocalId(e))===Ca&&!(null!=(r=i.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=i.collector)?void 0:t.storage[i.viewId][r][e]})));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(null!=(n=null==u?void 0:u.selectIds)&&n.includes(o))return!1}}catch(e){s.e(e)}finally{s.f()}return!0}},{key:"isNewEffectiveScene",value:function(e,t){var r=e.key;return!!t.includes(r)}},{key:"refreshPlugin",value:function(e){var t,r,n,i,o,a,s,u,l,c,h,d,p,v,m,g,y,_,b,x,w,S=this,T=arguments.length>1&&void 0!==arguments[1]&&arguments[1],M=e.scenePath,k=e.data;if(k&&this.collector){var E,I=f(k.values());try{for(I.s();!(E=I.n()).done;){var A=E.value,C=A.dataType,P=A.data,N=A.key,O=this.collector.getStorageData(this.viewId,M),R=O&&Object.keys(O)||[];switch(C){case 1:if(T?this.isDrawEffectiveScene(A,R):this.isDeleteEffectiveScene(A,R,M))if(T&&!Array.isArray(P)){if(null!=(t=P.updateNodeOpt)&&t.useAnimation&&(P.updateNodeOpt.useAnimation=!1),(null==(r=this.collector)?void 0:r.getLocalId(N))===Ca&&null!=(n=this.collector)&&n.isOwn(A.key)){var D=P.selectIds;if(D){var L,j=R.filter((function(e){var t,r;return(null==(t=S.collector)?void 0:t.getLocalId(e))===Ca&&!(null!=(r=S.collector)&&r.isOwn(e))})).map((function(e){var t;return null==(t=S.collector)?void 0:t.storage[S.viewId][M][e]})),z=!1,B=f(j);try{for(B.s();!(L=B.n()).done;)for(var U=L.value,F=0;F1&&void 0!==arguments[1]&&arguments[1],r=this.appViews.get(e);r&&(this.control.textEditorManager.clear(e,t),r.displayer.destroy(),this.appViews.delete(e))}},{key:"createMianView",value:function(e){var t=this;this.mainView=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}})}},{key:"createAppView",value:function(e){var t=this,r=e.id,n=new Proxy(e,{set:function(e,r,n){return t.control.worker.isActive&&t.validator(e,r,n),e[r]=n,!0}});this.appViews.set(r,n)}},{key:"isAppView",value:function(e){return e!==pu&&this.appViews.has(e)}},{key:"getView",value:function(e){var t;return e===pu?this.mainView:null==(t=this.appViews)?void 0:t.get(e)}},{key:"getCurScenePath",value:function(e){var t=this.getView(e);if(t)return t.focusScenePath}},{key:"getAllViews",value:function(){return[this.mainView].concat(u(this.appViews.values()))}},{key:"setViewScenePath",value:function(e,t){var r;if(e===pu&&this.mainView)this.mainView.focusScenePath=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.focusScenePath=t)}}},{key:"setViewData",value:function(e,t){var r;if(e===pu&&this.mainView)this.mainView.viewData=t;else{var n=e&&(null==(r=this.appViews)?void 0:r.get(e))||void 0;n&&(n.viewData=t)}}},{key:"setFocuedViewId",value:function(e){var t;this.focuedViewId=e,this.focuedView=e===pu?this.mainView:e&&(null==(t=this.appViews)?void 0:t.get(e))||void 0,this.control.cursor.onFocusViewChange(),this.focuedView&&this.focuedView.displayer.commiter.onFocusView()}},{key:"setViewFocusScenePath",value:function(e,t){var r,n;(n=e===pu?this.mainView:null==(r=this.appViews)?void 0:r.get(e))&&(n.focusScenePath=t)}},{key:"destroy",value:function(){var e,t=this;this.internalMsgEmitter.removeAllListeners("addUndoTicker"),this.internalMsgEmitter.removeAllListeners("excludeIds"),null==(e=this.mainView)||e.displayer.destroy(),this.appViews.forEach((function(e){t.destroyAppView(e.id,!0),t.control.worker.destroyViewWorker(e.id)}))}},{key:"setFocuedViewCameraOpt",value:function(e){if(this.focuedView){var t=this.focuedView.cameraOpt;R.isEqual(t,e)||(this.focuedView.cameraOpt=e)}}},{key:"transformToOriginPoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointOnScreen(e[0],e[1]);return[n.x,n.y]}return e}},{key:"transformToScenePoint",value:function(e,t){var r=this.getView(t);if(null!=r&&r.viewData){var n=r.viewData.convertToPointInWorld({x:e[0],y:e[1]});return[n.x,n.y]}return e}},{key:"render",value:function(e){var t,r,n,i,o,a,s,u,l,c,h,d,p,v,m,g,y,_,b=f(e);try{for(b.s();!(_=b.n()).done;){var x=_.value,w=x.rect,S=x.imageBitmap,T=x.isClear,M=x.isUnClose,k=x.drawCanvas,E=x.clearCanvas,I=x.viewId,A=null==(t=this.getView(I))?void 0:t.displayer;if(A&&w){var C=A.dpr,P=A.canvasBgRef,N=A.canvasFloatRef,O=A.canvasServiceFloatRef,R=A.canvasTopRef,D=Math.floor(w.w*C),L=Math.floor(w.h*C),j=w.x*C,z=w.y*C;if(T){switch(E){case q.TopFloat:null==(n=null==(r=R.current)?void 0:r.getContext("2d"))||n.clearRect(j,z,D,L);break;case q.Float:null==(o=null==(i=N.current)?void 0:i.getContext("2d"))||o.clearRect(j,z,D,L);break;case q.ServiceFloat:null==(s=null==(a=O.current)?void 0:a.getContext("2d"))||s.clearRect(j,z,D,L);break;case q.Bg:null==(l=null==(u=P.current)?void 0:u.getContext("2d"))||l.clearRect(j,z,D,L)}continue}if(k&&S)switch(k){case q.TopFloat:null==(h=null==(c=R.current)?void 0:c.getContext("2d"))||h.drawImage(S,0,0,D,L,j,z,D,L);break;case q.Float:null==(p=null==(d=N.current)?void 0:d.getContext("2d"))||p.drawImage(S,0,0,D,L,j,z,D,L);break;case q.ServiceFloat:null==(m=null==(v=O.current)?void 0:v.getContext("2d"))||m.drawImage(S,0,0,D,L,j,z,D,L);break;case q.Bg:null==(y=null==(g=P.current)?void 0:g.getContext("2d"))||y.drawImage(S,0,0,D,L,j,z,D,L)}if(M)continue;null==S||S.close()}}}catch(e){b.e(e)}finally{b.f()}}},{key:"showFloatBar",value:function(e,t,r){var n=this.getView(e),i=null==n?void 0:n.displayer.vDom;i&&i.showFloatBar(t,r)}},{key:"setActiveTextEditor",value:function(e,t){var r=this.getView(e),n=null==r?void 0:r.displayer.vDom;n&&n.setActiveTextEditor(t)}}]),e}();I(Ml,"defaultCameraOpt",{centerX:0,centerY:0,scale:1}),I(Ml,"defaultScreenCanvasOpt",{autoRender:!1,contextType:"webgl2"}),I(Ml,"defaultLayerOpt",{offscreen:!0,handleEvent:!1,depth:!1});var kl=function(){function e(t,r,n){var i=this;S(this,e),I(this,"viewId"),I(this,"control"),I(this,"internalMsgEmitter"),I(this,"commiter"),I(this,"cachePoint"),I(this,"cacheCursorPoint"),I(this,"active",!0),I(this,"mousedown",(function(e){if(i.active&&0===e.button&&i.viewId){i.control.worker.checkDrawingWork(i.viewId),i.reflashContainerOffset();var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener($.Start,t,i.viewId)}})),I(this,"mousemove",(function(e){if(i.active&&i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener($.Doing,t,i.viewId)}})),I(this,"mouseup",(function(e){if(i.active&&0===e.button&&i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener($.Done,t,i.viewId),i.cachePoint=void 0}})),I(this,"touchstart",(function(e){var t;if(i.active){if(!Sl(e))return i.control.worker.unWritable(),void(i.viewId&&i.control.worker.removeDrawingWork(i.viewId));if(i.viewId){if(!i.control.worker.isAbled()){var r=null==(t=i.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&i.control.effectViewContainer(r)}i.control.worker.checkDrawingWork(i.viewId),i.reflashContainerOffset();var n=i.getPoint(e);i.cachePoint=n,n&&i.control.worker.originalEventLintener($.Start,n,i.viewId)}}})),I(this,"touchmove",(function(e){if(i.active){if(!Sl(e))return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e);i.cachePoint=t,t&&i.control.worker.originalEventLintener($.Doing,t,i.viewId)}}})),I(this,"touchend",(function(e){if(i.active){if(!Sl(e)||!i.control.worker.isAbled())return i.control.worker.unWritable(),void i.control.worker.removeDrawingWork(i.viewId);if(i.viewId){var t=i.getPoint(e)||i.cachePoint;t&&i.control.worker.originalEventLintener($.Done,t,i.viewId),i.cachePoint=void 0}}})),I(this,"cursorMouseMove",R.throttle((function(e){var t=i.getPoint(e);i.cacheCursorPoint&&R.isEqual(t,i.cacheCursorPoint)||!i.viewId||(i.cacheCursorPoint=t,t&&i.control.worker.sendCursorEvent(t,i.viewId))}),30,{leading:!1})),I(this,"cursorMouseLeave",R.throttle((function(){i.viewId&&(i.cacheCursorPoint=[void 0,void 0],i.control.worker.sendCursorEvent(i.cacheCursorPoint,i.viewId))}),30,{leading:!1})),I(this,"keydown",(function(e){i.control.hotkeyManager.colloctHotkey(e)})),this.viewId=t,this.control=r,this.internalMsgEmitter=n;var o={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new wl(o)}var t;return M(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case H.Text:case H.Pencil:case H.LaserPen:case H.Arrow:case H.Straight:case H.Rectangle:case H.Ellipse:case H.Star:case H.Polygon:case H.SpeechBalloon:case H.Eraser:case H.PencilEraser:case H.BitMapEraser:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===H.Text?"cursor-text":r===H.Eraser||r===H.PencilEraser||r===H.BitMapEraser?"cursor-eraser":r===H.Pencil||r===H.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"updateSize",value:function(){this.setCanvassStyle(),this.reflashContainerOffset()}},{key:"setViewId",value:function(e){this.viewId=e}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.control.cursor.clearViewCursor(this.viewId),this.internalMsgEmitter.removeAllListeners([G.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Tl(e);if(t&&R.isNumber(t.x)&&R.isNumber(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener($.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),e.addEventListener("touchstart",this.touchstart,{capture:!0,passive:!1}),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,{capture:!0,passive:!1}),window.addEventListener("mouseup",this.mouseup,!1),window.addEventListener("touchmove",this.touchmove,{capture:!0,passive:!1}),window.addEventListener("touchend",this.touchend,{capture:!0,passive:!1}),e.addEventListener("mousemove",this.cursorMouseMove,!1),e.addEventListener("mouseleave",this.cursorMouseLeave,!1),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}(),El=function(){function e(t,r){var n=this;S(this,e),I(this,"viewId",pu),I(this,"control"),I(this,"internalMsgEmitter"),I(this,"commiter"),I(this,"cachePoint"),I(this,"cacheCursorPoint"),I(this,"active",!0),I(this,"mousedown",(function(e){if(n.active&&0===e.button){n.control.worker.checkDrawingWork(n.viewId),n.reflashContainerOffset();var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener($.Start,t,n.viewId)}})),I(this,"mousemove",(function(e){if(n.active){var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener($.Doing,t,n.viewId)}})),I(this,"mouseup",(function(e){if(n.active&&0===e.button){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener($.Done,t,n.viewId),n.cachePoint=void 0}})),I(this,"touchstart",(function(e){var t;if(n.active){if(!Sl(e))return n.control.worker.unWritable(),void(n.viewId&&n.control.worker.removeDrawingWork(n.viewId));if(!n.control.worker.isAbled()){var r=null==(t=n.control.worker.getCurrentToolsData())?void 0:t.toolsType;r&&n.control.effectViewContainer(r)}n.control.worker.checkDrawingWork(n.viewId),n.reflashContainerOffset();var i=n.getPoint(e);n.cachePoint=i,i&&n.control.worker.originalEventLintener($.Start,i,n.viewId)}})),I(this,"touchmove",(function(e){if(n.active){if(!Sl(e))return n.control.worker.unWritable(),void(n.viewId&&n.control.worker.removeDrawingWork(n.viewId));var t=n.getPoint(e);n.cachePoint=t,t&&n.control.worker.originalEventLintener($.Doing,t,n.viewId)}})),I(this,"touchend",(function(e){if(n.active)if(Sl(e)&&n.control.worker.isAbled()){var t=n.getPoint(e)||n.cachePoint;t&&n.control.worker.originalEventLintener($.Done,t,n.viewId),n.cachePoint=void 0}else n.control.worker.removeDrawingWork(n.viewId)})),I(this,"cursorMouseMove",R.throttle((function(e){var t=n.getPoint(e);n.cacheCursorPoint&&R.isEqual(t,n.cacheCursorPoint)||(n.cacheCursorPoint=t,t&&n.control.worker.sendCursorEvent(t,n.viewId))}),30,{leading:!1})),I(this,"cursorMouseLeave",R.throttle((function(){n.cacheCursorPoint=[void 0,void 0],n.control.worker.sendCursorEvent(n.cacheCursorPoint,n.viewId)}),30,{leading:!1})),I(this,"keydown",(function(e){n.control.hotkeyManager.colloctHotkey(e)})),this.control=t,this.internalMsgEmitter=r;var i={control:this.control,internalMsgEmitter:this.internalMsgEmitter,viewId:this.viewId};this.commiter=new wl(i)}var t;return M(e,[{key:"bindToolsClass",value:function(){var e,t,r=null==(t=null==(e=this.control.worker)?void 0:e.currentToolsData)?void 0:t.toolsType;switch(r){case H.Text:case H.Pencil:case H.LaserPen:case H.Arrow:case H.Straight:case H.Rectangle:case H.Ellipse:case H.Star:case H.Polygon:case H.SpeechBalloon:case H.Eraser:case H.PencilEraser:case H.BitMapEraser:this.eventTragetElement&&(this.eventTragetElement.className="netless-whiteboard ".concat(r===H.Text?"cursor-text":r===H.Eraser||r===H.PencilEraser||r===H.BitMapEraser?"cursor-eraser":r===H.Pencil||r===H.LaserPen?"cursor-pencil":"cursor-arrow"))}}},{key:"mountView",value:function(){this.setCanvassStyle(),this.control.viewContainerManager.mountView(this.viewId)}},{key:"updateSize",value:function(){this.setCanvassStyle()}},{key:"reflashContainerOffset",value:function(){this.eventTragetElement&&(this.containerOffset=this.getContainerOffset(this.eventTragetElement,{x:0,y:0}))}},{key:"destroy",value:function(){this.eventTragetElement&&this.removeDisplayerEvent(this.eventTragetElement),this.vDom=void 0,this.control.cursor.destroy(),this.internalMsgEmitter.removeAllListeners([G.Cursor,this.viewId])}},{key:"getPoint",value:function(e){var t=Tl(e);if(t&&R.isNumber(t.x)&&R.isNumber(t.y))return[t.x-this.containerOffset.x,t.y-this.containerOffset.y]}},{key:"setActive",value:function(e){this.active=e}},{key:"stopEventHandler",value:(t=s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.cachePoint,!e.t0){e.next=5;break}return e.next=4,this.control.worker.originalEventLintener($.Done,this.cachePoint,this.viewId);case 4:this.cachePoint=void 0;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getTranslate",value:function(e){var t=(e.style.WebkitTransform||getComputedStyle(e,"").getPropertyValue("-webkit-transform")||e.style.transform||getComputedStyle(e,"").getPropertyValue("transform")).match(/-?[0-9]+\.?[0-9]*/g);return[t&&parseInt(t[0])||0,t&&parseInt(t[1])||0]}},{key:"getContainerOffset",value:function(e,t){var r,n=this.getTranslate(e),i={x:t.x+e.offsetLeft+n[0],y:t.y+e.offsetTop+n[1]};return null!=(r=e.offsetParent)&&r.nodeName&&"BODY"!==e.offsetParent.nodeName&&(i=this.getContainerOffset(e.offsetParent,i)),i}},{key:"bindDisplayerEvent",value:function(e){e.addEventListener("mousedown",this.mousedown,!1),window.addEventListener("mouseleave",this.mouseup,!1),window.addEventListener("mousemove",this.mousemove,{capture:!1,passive:!1}),window.addEventListener("mouseup",this.mouseup,!1),e.addEventListener("touchstart",this.touchstart,{capture:!0,passive:!1}),window.addEventListener("touchmove",this.touchmove,{capture:!0,passive:!1}),window.addEventListener("touchend",this.touchend,{capture:!0,passive:!1}),e.addEventListener("mousemove",this.cursorMouseMove,!0),e.addEventListener("mouseleave",this.cursorMouseLeave,!0),e.addEventListener("keydown",this.keydown,!0)}},{key:"removeDisplayerEvent",value:function(e){e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("mouseleave",this.mouseup),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("mousemove",this.cursorMouseMove),e.removeEventListener("mouseleave",this.cursorMouseLeave),e.removeEventListener("keydown",this.keydown)}}]),e}(),Il="index-module__Container__nLsM3",Al="index-module__CanvasBox__j2Xe-",Cl="index-module__FloatCanvas__d1YR7",Pl="index-module__TopFloatCanvas__7IaCw",Nl="index-module__CanvasBoxSub__hcMeK",Ol="index-module__SnapshotBox__--eeE",Rl="index-module__FloatBar__cm-EL",Dl="index-module__RotateBtn__HSSkf",Ll="index-module__ResizeBtn__yjvda",jl="index-module__CursorBox__2UHvI",zl="index-module__TextEditorContainer__Qm8KC",Bl="index-module__ResizeTowBox__HOllX",Ul="index-module__FloatBarBtn__FJrOG",Fl={delete:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDZ2NmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY2aDBtMS0yYTIgMiAwIDAgMSAyLTJoMmEyIDIgMCAwIDEgMiAyaDBNMyA0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",duplicate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0xMSAySDZhMSAxIDAgMCAwLTEgMXY4YTEgMSAwIDAgMCAxIDFoNmExIDEgMCAwIDAgMS0xVjRoMGwtMi0yeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PHBhdGggZD0iTTExIDJ2MWExIDEgMCAwIDAgMSAxaDFsLTItMnoiLz48cGF0aCBkPSJNOSAxNEg0YTEgMSAwIDAgMS0xLTFWNWgwIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48L2c+PC9zdmc+","layer-pressed":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzMzODFGRiIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",layer:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTE2IDEwLTYgNCA2IDQgNi00em0tNiA4IDYgNCA2LTQiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+",rotate:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEzIDZhNiA2IDAgMSAxLTMuNzA5IDEuMjgzIi8+PHBhdGggZD0ibTEzIDYgMS40MTQgMi40NUwxMyA2bDIuNDUtMS40MTQiLz48L2c+PC9zdmc+","rotation-button":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+",rotation:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjRkZGIiBvcGFjaXR5PSIuMDEiIGQ9Ik0wIDI0VjBoMjR2MjR6Ii8+PHBhdGggZD0iTTUuNzI0IDUuNzI0QTguODQ3IDguODQ3IDAgMCAxIDEyIDMuMTI1YzIuMjcxIDAgNC41NDMuODY2IDYuMjc2IDIuNmE4Ljg0NiA4Ljg0NiAwIDAgMSAyLjU5OCA2LjE0IDguODQ5IDguODQ5IDAgMCAxLTIuNTU5IDYuMzdsLTEuNS0uOTgzQTcuMTA1IDcuMTA1IDAgMCAwIDE5LjEyNSAxMmE3LjEwMyA3LjEwMyAwIDAgMC0yLjA4Ny01LjAzOEE3LjEwMyA3LjEwMyAwIDAgMCAxMiA0Ljg3NWE3LjEwMyA3LjEwMyAwIDAgMC01LjAzOCAyLjA4NyA3LjEwMSA3LjEwMSAwIDAgMC0yLjA4NiA0LjkyIDcuMTAzIDcuMTAzIDAgMCAwIDEuNzY2IDQuODE1bDEuOTQ1LTEuNTg0IDIuMzk0IDcuMTgyLTcuMjIyLTIuNDA4IDEuNzkxLTEuNzlBOC44NDYgOC44NDYgMCAwIDEgMy4xMjUgMTJjMC0yLjI3MS44NjYtNC41NDMgMi42LTYuMjc2eiIgc3Ryb2tlPSIjRkZGIiBzdHJva2Utd2lkdGg9Ii41IiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+","font-colors-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","font-colors":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQgMTEgNC05IDQgOU02IDdoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","to-bottom":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDEwdjhtMCAwLTItMm0yIDIgMi0ybS00IDZoMTJtLTYtNGg2bS02LTRoNm0tNi00aDYiIHN0cm9rZT0iIzQ0NEU2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+","to-top":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDIydi04bTAgMC0yIDJtMi0yIDIgMm0tNC02aDEybS02IDRoNm0tNiA0aDZtLTYgNGg2IiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","bold-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",bold:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAySDhhMi41IDIuNSAwIDAgMSAwIDVINS41aDBtLTEgMGg0YTMgMyAwIDAgMSAwIDZoLTQgMG0wIDFWMiIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","underline-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",underline:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDJ2NWE0IDQgMCAxIDEtOCAwVjJoME0zIDE0aDEwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiMzMzgxRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","line-through":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGg4bS0xLTNhMyAzIDAgMCAwLTMtM2gtLjkzOEEyLjY0IDIuNjQgMCAwIDAgNC41IDRhMi41NyAyLjU3IDAgMCAwIDEuMzQ0IDIuOTIybDQuMzEyIDIuMTU2QTIuNTcgMi41NyAwIDAgMSAxMS41IDEyYTIuNjQgMi42NCAwIDAgMS0yLjU2MiAySDdhMyAzIDAgMCAxLTMtM2gwIiBzdHJva2U9IiM0NDRFNjAiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==","italic-active":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjMzM4MUZGIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",italic:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgMTQgOSAyTTUgMTRoNE03IDJoNCIgc3Ryb2tlPSIjNDQ0RTYwIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=","unlock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiMzMzgxRkYiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0xYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDN2MyIgc3Ryb2tlPSIjMzM4MUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+","lock-new":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiM0NDRFNjAiIGN4PSIxNiIgY3k9IjE3IiByPSIxIi8+PHJlY3Qgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjExIiB5PSIxNCIgd2lkdGg9IjEwIiBoZWlnaHQ9IjgiIHJ4PSIyIi8+PHBhdGggZD0iTTEzIDE0di0zYTMgMyAwIDAgMSA2IDB2MWgwbS0zIDV2MyIgc3Ryb2tlPSIjNDQ0RTYwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+",shapes:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","shapes-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTY4Mi42NjY2NjcgMTAyNEM2ODIuNjY2NjY3IDEwMjQgNjgyLjY2NjY2NyAxMDI0IDY4Mi42NjY2NjcgMTAyNEwxNzAuNjY2NjY3IDEwMjRjLTE3LjA2NjY2NyAwLTI5Ljg2NjY2Ny04LjUzMzMzMy0zOC40LTIxLjMzMzMzMy04LjUzMzMzMy0xMi44LTguNTMzMzMzLTI5Ljg2NjY2NyAwLTQyLjY2NjY2N2wyNTYtMzg0YzE3LjA2NjY2Ny0yNS42IDU1LjQ2NjY2Ny0yNS42IDcyLjUzMzMzMyAwbDI1MS43MzMzMzMgMzc5LjczMzMzM2M4LjUzMzMzMyA4LjUzMzMzMyAxMi44IDE3LjA2NjY2NyAxMi44IDI5Ljg2NjY2N0M3MjUuMzMzMzMzIDEwMDYuOTMzMzMzIDcwOC4yNjY2NjcgMTAyNCA2ODIuNjY2NjY3IDEwMjR6TTI1MS43MzMzMzMgOTM4LjY2NjY2N2wzNTQuMTMzMzMzIDBMNDI2LjY2NjY2NyA2NzQuMTMzMzMzIDI1MS43MzMzMzMgOTM4LjY2NjY2N3oiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48cGF0aCBkPSJNOTgxLjMzMzMzMyA3MjUuMzMzMzMzbC0zNDEuMzMzMzMzIDBjLTI1LjYgMC00Mi42NjY2NjctMTcuMDY2NjY3LTQyLjY2NjY2Ny00Mi42NjY2NjdMNTk3LjMzMzMzMyAzNDEuMzMzMzMzYzAtMjUuNiAxNy4wNjY2NjctNDIuNjY2NjY3IDQyLjY2NjY2Ny00Mi42NjY2NjdsMzQxLjMzMzMzMyAwYzI1LjYgMCA0Mi42NjY2NjcgMTcuMDY2NjY3IDQyLjY2NjY2NyA0Mi42NjY2NjdsMCAzNDEuMzMzMzMzQzEwMjQgNzA4LjI2NjY2NyAxMDA2LjkzMzMzMyA3MjUuMzMzMzMzIDk4MS4zMzMzMzMgNzI1LjMzMzMzM3pNNjgyLjY2NjY2NyA2NDBsMjU2IDBMOTM4LjY2NjY2NyAzODRsLTI1NiAwTDY4Mi42NjY2NjcgNjQweiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjxwYXRoIGQ9Ik0yNzcuMzMzMzMzIDU1NC42NjY2NjdDMTIzLjczMzMzMyA1NTQuNjY2NjY3IDAgNDMwLjkzMzMzMyAwIDI3Ny4zMzMzMzNTMTIzLjczMzMzMyAwIDI3Ny4zMzMzMzMgMCA1NTQuNjY2NjY3IDEyMy43MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDQzMC45MzMzMzMgNTU0LjY2NjY2NyAyNzcuMzMzMzMzIDU1NC42NjY2Njd6TTI3Ny4zMzMzMzMgODUuMzMzMzMzQzE3MC42NjY2NjcgODUuMzMzMzMzIDg1LjMzMzMzMyAxNzAuNjY2NjY3IDg1LjMzMzMzMyAyNzcuMzMzMzMzUzE3MC42NjY2NjcgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDQ2OS4zMzMzMzMgNDY5LjMzMzMzMyAzODQgNDY5LjMzMzMzMyAyNzcuMzMzMzMzIDM4NCA4NS4zMzMzMzMgMjc3LjMzMzMzMyA4NS4zMzMzMzN6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","font-style-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","font-style":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTM2MC4yMzQ2NjcgMjEzLjMzMzMzM0w1NTQuNjY2NjY3IDc3Ni4yNzczMzNoLTc2LjU0NGwtNTQuNjEzMzM0LTE3Mi4wMzJIMjE0LjE4NjY2N2wtNTUuNDY2NjY3IDE3Mi4wMzJIODUuMzMzMzMzTDI3OS43NjUzMzMgMjEzLjMzMzMzM2g4MC40NjkzMzR6IG00MTAuMDI2NjY2IDE3My44MjRjOTAuMTEyIDAgMTI4LjM0MTMzMyA2MC43NTczMzMgMTI4LjM0MTMzNCAxNTIuMjM0NjY3djIyOC4wMTA2NjdoLTUxLjJsLTUuNDYxMzM0LTQ0LjM3MzMzNGgtMi4wNDhjLTM1LjQ5ODY2NyAyOS4zNTQ2NjctNzcuMTQxMzMzIDUzLjI0OC0xMjIuODggNTMuMjQ4LTYyLjEyMjY2NyAwLTEwOC41NDQtMzguMjI5MzMzLTEwOC41NDQtMTA1LjEzMDY2NiAwLTgwLjU1NDY2NyA3MC4zMTQ2NjctMTIwLjgzMiAyMjguMDEwNjY3LTEzOC41ODEzMzQgMC00Ny43ODY2NjctMTUuNzAxMzMzLTkzLjUyNTMzMy03Ni40NTg2NjctOTMuNTI1MzMzLTQzLjAwOCAwLTgxLjkyIDE5Ljc5NzMzMy0xMTEuMjc0NjY2IDM5LjU5NDY2N2wtMjQuNTc2LTQzLjAwOGMzNC4xMzMzMzMtMjEuODQ1MzMzIDg2LjY5ODY2Ny00OC40NjkzMzMgMTQ2LjA5MDY2Ni00OC40NjkzMzR6IG02Ni4yMTg2NjcgMTg2LjM2OGMtMTI0LjkyOCAxNS4wMTg2NjctMTY3LjI1MzMzMyA0NS43Mzg2NjctMTY3LjI1MzMzMyA5My41MjUzMzQgMCA0Mi4zMjUzMzMgMjguNjcyIDU5LjM5MiA2NS41MzYgNTkuMzkyIDM2LjE4MTMzMyAwIDY1LjUzNi0xNy4wNjY2NjcgMTAxLjcxNzMzMy00OS4xNTJ6TTMyMC4zODQgMjcwLjkzMzMzM2gtMy4xMTQ2NjdjLTE3Ljk2MjY2NyA2Ni4wNDgtMzYuNjkzMzMzIDEyNi43Mi01Ny4wMDI2NjYgMTkwLjQ2NGwtMjguMTYgODYuMDE2aDE3My4zOTczMzNsLTI3LjMwNjY2Ny04Ni4wMTZBNDkxMy40OTMzMzMgNDkxMy40OTMzMzMgMCAwIDEgMzIwLjM4NCAyNzAuOTMzMzMzeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",polygon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==","polygon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkzMy4xMiA0OTAuNjY2NjY3bC0xOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwLTM3LjEyLTIxLjMzMzMzM2gtMzg0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAtMzcuMTIgMjEuMzMzMzMzbC0xOTIgMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAgNDIuNjY2NjY2bDE5MiAzMzIuMzczMzM0YTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAwIDAgMzcuMTIgMjEuMzMzMzMzaDM4NGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDM3LjEyLTIxLjMzMzMzM2wxOTItMzMyLjM3MzMzNGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMCAwIDAtNDIuNjY2NjY2eiBtLTI1NiAzMTEuMDRIMzQ0Ljc0NjY2N0wxNzcuMDY2NjY3IDUxMmwxNjcuNjgtMjg5LjcwNjY2N2gzMzQuNTA2NjY2TDg0Ni45MzMzMzMgNTEyeiIgZmlsbD0iIzMzODFGRiI+PC9wYXRoPjwvc3ZnPg==","polygon-vertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTA3NyAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU0My40NzQ1MjYgNDIuMzA3MzY4YTExOS4zNzY4NDIgMTE5LjM3Njg0MiAwIDAgMSAxMTAuODA3NTc5IDE2My44NGwxOTAuNTcxNzkgMTM4LjYxNzI2NGExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEgODMuMzc1MTU4IDIxOC43MDQ4NDJsLTc0LjMyMDg0MiAyMjguODM3MDUyYTExOS4zMjI5NDcgMTE5LjMyMjk0NyAwIDAgMS02MS4yNzgzMTYgMjIxLjg4NDYzMmMtNDYuNzgwNjMyIDAtODcuMzA5NDc0LTI2Ljk0NzM2OC0xMDYuODczMjYzLTY2LjEyODg0MmgtMjg5LjQxNDczN2ExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAxIDEtMTc5LjczODk0OC0xNDcuODMzMjYzbC03Mi4yNzI4NDItMjIyLjY5MzA1My0zLjM5NTM2OCAwLjEwNzc4OUExMTkuMzc2ODQyIDExOS4zNzY4NDIgMCAwIDEgMjEuODI3MzY4IDQ2Ni43Mjg0MjFMMjEuNTU3ODk1IDQ1OC4yMTMwNTNhMTE5LjM3Njg0MiAxMTkuMzc2ODQyIDAgMCAxIDE4My44MzQ5NDctMTAwLjUxMzY4NWwyMjMuNTAxNDc0LTE2Mi4zODQ4NDJhMTE5LjQzMDczNyAxMTkuNDMwNzM3IDAgMCAxIDExNC41ODAyMS0xNTMuMDYxMDUyek0yODkuNDE0NzM3IDg0MC4wNTcyNjNhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6IG01MDMuMTYxMjYzIDBhNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDEgMCAwIDEwOS40MDYzMTYgNTQuNzAzMTU4IDU0LjcwMzE1OCAwIDAgMCAwLTEwOS40MDYzMTZ6TTQ2Mi42ODYzMTYgMjQ5LjU4NjUyNkwyNDguMTMxMzY4IDQwNS41NTc4OTVhMTE5LjMyMjk0NyAxMTkuMzIyOTQ3IDAgMCAxLTQyLjg0NjMxNSAxNTMuMjIyNzM3bDcwLjcwOTg5NCAyMTcuMzU3NDczYTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMSAxMzIuNDE5MzY5IDEwOC4yMjA2MzJINjczLjY4NDIxMWExMTkuNDMwNzM3IDExOS40MzA3MzcgMCAwIDEgMTE5LjE2MTI2My0xMDguOTc1MTU4bDcxLjE0MTA1Mi0yMTguOTc0MzE2YTExOS40MzA3MzcgMTE5LjQzMDczNyAwIDAgMS02Mi4wODY3MzctMTY0LjIxNzI2M2wtMTg2LjM2OC0xMzUuMjc1Nzg5Yy0xOS45OTQ5NDcgMTUuMDkwNTI2LTQ1LjAwMjEwNSAyNC4xNDQ4NDItNzIuMDU3MjYzIDI0LjE0NDg0MmExMTguOTQ1Njg0IDExOC45NDU2ODQgMCAwIDEtODAuNzg4MjEtMzEuNDc0NTI3eiBtLTMyMS43NTE1NzkgMTUzLjkyMzM2OWE1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQwNjMxNiA1NC43MDMxNTggNTQuNzAzMTU4IDAgMCAwIDAtMTA5LjQwNjMxNnogbTc2Ny43MzA1MjYtMTIuNTU3NDc0YTU0LjcwMzE1OCA1NC43MDMxNTggMCAxIDAgMCAxMDkuNDA2MzE2IDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE2eiBtLTM2NS4xOTA3MzctMjg0LjAyNTI2M2E1NC43MDMxNTggNTQuNzAzMTU4IDAgMSAwIDAgMTA5LjQ2MDIxIDU0LjcwMzE1OCA1NC43MDMxNTggMCAwIDAgMC0xMDkuNDA2MzE1eiIgZmlsbD0iIzQ0NEU2MCI+PC9wYXRoPjwvc3ZnPg==",star:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjNDQ0RTYwIj48L3BhdGg+PC9zdmc+","star-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTkwOC4xIDM1My4xbC0yNTMuOS0zNi45TDU0MC43IDg2LjFjLTMuMS02LjMtOC4yLTExLjQtMTQuNS0xNC41LTE1LjgtNy44LTM1LTEuMy00Mi45IDE0LjVMMzY5LjggMzE2LjJsLTI1My45IDM2LjljLTcgMS0xMy40IDQuMy0xOC4zIDkuMy0xMi4zIDEyLjctMTIuMSAzMi45IDAuNiA0NS4zbDE4My43IDE3OS4xLTQzLjQgMjUyLjljLTEuMiA2LjktMC4xIDE0LjEgMy4yIDIwLjMgOC4yIDE1LjYgMjcuNiAyMS43IDQzLjIgMTMuNEw1MTIgNzU0bDIyNy4xIDExOS40YzYuMiAzLjMgMTMuNCA0LjQgMjAuMyAzLjIgMTcuNC0zIDI5LjEtMTkuNSAyNi4xLTM2LjlsLTQzLjQtMjUyLjkgMTgzLjctMTc5LjFjNS00LjkgOC4zLTExLjMgOS4zLTE4LjMgMi43LTE3LjUtOS41LTMzLjctMjctMzYuM3pNNjY0LjggNTYxLjZsMzYuMSAyMTAuM0w1MTIgNjcyLjcgMzIzLjEgNzcybDM2LjEtMjEwLjMtMTUyLjgtMTQ5TDQxNy42IDM4MiA1MTIgMTkwLjcgNjA2LjQgMzgybDIxMS4yIDMwLjctMTUyLjggMTQ4Ljl6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PC9zdmc+","star-innerVertex":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTg1LjMzMzMzMyAwYTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODEuNDA4IDU5LjczMzMzM2g0OC4yMTMzMzR2ODUuMzMzMzM0TDE3MC42NjY2NjcgMTQ0Ljk4MTMzM1Y4NTMuMzMzMzMzaDY5My4zMzMzMzNsLTI2LjQ1MzMzMy02My40ODggNzguNzYyNjY2LTMyLjc2OCAzMi44NTMzMzQgNzguNzYyNjY3LTQyLjI0IDE3LjQ5MzMzM0g5MzguNjY2NjY3YTg1LjMzMzMzMyA4NS4zMzMzMzMgMCAwIDEgODQuNzM2IDc1LjM0OTMzNEwxMDI0IDkzOC42NjY2NjdhODUuMzMzMzMzIDg1LjMzMzMzMyAwIDAgMS0xNzAuNjY2NjY3IDBIMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxLTg1LjMzMzMzNC04NS4zMzMzMzRWMTcwLjY2NjY2N2E4NS4zMzMzMzMgODUuMzMzMzMzIDAgMSAxIDAtMTcwLjY2NjY2N3ogbTc2NS4zNTQ2NjcgNTk5LjQ2NjY2N2wzMi44NTMzMzMgNzguNzYyNjY2LTc4Ljg0OCAzMi44NTMzMzQtMzIuNzY4LTc4Ljc2MjY2NyA3OC43NjI2NjctMzIuODUzMzMzeiBtLTY1LjcwNjY2Ny0xNTcuNTI1MzM0bDMyLjg1MzMzNCA3OC43NjI2NjctNzguNzYyNjY3IDMyLjg1MzMzMy0zMi43NjgtNzguNzYyNjY2IDc4Ljc2MjY2Ny0zMi44NTMzMzR6TTcxOS4zNiAyODQuNDE2bDMyLjg1MzMzMyA3OC43NjI2NjctNzguNzYyNjY2IDMyLjg1MzMzMy0zMi44NTMzMzQtNzguNzYyNjY3IDc4Ljc2MjY2Ny0zMi44NTMzMzN6IG0tNjUuNjIxMzMzLTE1Ny41MjUzMzNsMzIuODUzMzMzIDc4Ljc2MjY2Ni03OC43NjI2NjcgMzIuODUzMzM0LTMyLjg1MzMzMy03OC43NjI2NjcgNzguNzYyNjY3LTMyLjg1MzMzM3pNMzg1LjcwNjY2NyA1OS43MzMzMzN2ODUuMzMzMzM0aC04NS4zMzMzMzR2LTg1LjMzMzMzNGg4NS4zMzMzMzR6IG0xNzAuNjY2NjY2IDB2ODUuMzMzMzM0aC04NS4zMzMzMzN2LTg1LjMzMzMzNGg4NS4zMzMzMzN6IiBmaWxsPSIjNDQ0RTYwIiA+PC9wYXRoPjwvc3ZnPg==","star-innerRatio":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU2OS4zNDQgNDQ5LjUzNmwxNDYuOTQ0IDI4LjY3MiAxLjAyNC00LjYwOHY0LjYwOGgxLjAyNGM5LjcyOCAwIDE2Ljg5Ni03LjY4IDIwLjQ4LTE0Ljg0OGwxLjAyNC0yLjA0OHYtMi41NmMwLTUuNjMyIDAtMTEuMjY0LTUuMTItMTYuMzg0LTMuMDcyLTMuMDcyLTcuMTY4LTcuMTY4LTEyLjgtNy42OGwtMTI0LjkyOC0yNC4wNjRMNTQxLjY5NiAyODYuNzJjLTIuMDQ4LTQuNjA4LTYuNjU2LTguMTkyLTExLjc3Ni05LjcyOC01LjEyLTEuNTM2LTEwLjc1Mi0xLjUzNi0xNS4zNiAxLjAyNGwtMS41MzYgMC41MTItMS4wMjQgMS4wMjRjLTguMTkyIDguMTkyLTEwLjc1MiAxOS40NTYtNi42NTYgMjcuMTM2bDY0IDE0Mi44NDh6IiBmaWxsPSIjMzM4MUZGIj48L3BhdGg+PHBhdGggZD0iTTkzMS4zMjggNDAzLjQ1NmMtMTAuMjQtMzUuMzI4LTM4LjQtNjEuNDQtNzEuNjgtNjYuNTZsLTE4NC44MzItMzUuODQtODIuNDMyLTE4Mi43ODRjLTEyLjgtMzMuMjgtNDYuMDgtNTYuMzItODAuMzg0LTU2LjMyLTMzLjc5MiAwLTY0LjUxMiAyMC40OC03OS44NzIgNTMuNzZMMzQ5LjE4NCAyOTkuMDA4bC0xODQuMzIgMzUuMzI4Yy0zMy43OTIgNS4xMi02MS45NTIgMzEuMjMyLTcyLjE5MiA2Ni41Ni05LjcyOCAzNC4zMDQtMS4wMjQgNzIuMTkyIDIzLjA0IDk4LjgxNmwxMzEuNTg0IDEzMy42MzItMzUuODQgMTk2LjYwOGMtNS42MzIgMzQuODE2IDguNzA0IDcxLjY4IDM1Ljg0IDk0LjIwOCAxMy44MjQgMTEuMjY0IDM0LjMwNCAxOC40MzIgNTIuMjI0IDE4LjQzMiAxNi44OTYgMCAyOS42OTYtMy4wNzIgNDEuNDcyLTEwLjI0bDE2OC45Ni05MS4xMzYgMTY2LjkxMiA5MS4xMzYgMS4wMjQgMC41MTJjMTYuODk2IDYuNjU2IDI5LjY5NiA5LjcyOCA0MC40NDggOS43MjggMTQuMzM2IDAgMjcuNjQ4LTQuMDk2IDQwLjQ0OC03LjY4IDQuNjA4LTEuNTM2IDkuNzI4LTMuMDcyIDE0Ljg0OC00LjA5NmwyLjU2LTAuNTEyIDIuMDQ4LTEuNTM2YzI1LjA4OC0yMy4wNCAzNy44ODgtNTguODggMzIuNzY4LTkzLjY5NmwtMzMuMjgtMTk2LjYwOCAxMzEuNTg0LTEzNi4xOTJjMjQuMDY0LTI3LjY0OCAzMi4yNTYtNjIuOTc2IDIyLjAxNi05OC44MTZ6TTI3Ni45OTIgODM2LjA5Nmw0MS45ODQtMjMxLjkzNi0xNTcuMTg0LTE1OS4yMzJjLTUuNjMyLTUuNjMyLTguMTkyLTE3LjQwOC02LjY1Ni0yOS4xODQgMy41ODQtMTAuMjQgMTAuMjQtMTYuMzg0IDE5LjQ1Ni0xNy45MmwyMTguMTEyLTQxLjk4NCA5Ni4yNTYtMjE1LjU1MmMzLjA3Mi03LjE2OCAxMi44LTE0LjMzNiAyMC40OC0xNC4zMzZzMTcuNDA4IDcuMTY4IDIwLjQ4IDE0Ljg0OGw5OC4zMDQgMjE1LjA0IDIxOC4xMTIgNDEuOTg0YzcuMTY4IDEuNTM2IDE1LjM2IDcuMTY4IDE2Ljg5NiAxNi4zODR2My4wNzJjMi4wNDggMTEuNzc2LTAuNTEyIDIyLjUyOC02LjY1NiAzMC43Mkw2OTkuOTA0IDYwOS4yOGwzOS45MzYgMjMxLjQyNGMxLjUzNiAxMC43NTItMi4wNDggMjAuNDgtMTAuMjQgMjcuMTM2bC0xLjAyNCAwLjUxMmMtMi41NiAyLjU2LTYuNjU2IDQuMDk2LTExLjI2NCA0LjA5Ni0yLjA0OCAwLTcuMTY4LTEuNTM2LTExLjI2NC0zLjU4NGwtMTk3LjEyLTEwOC4wMzItMTk5LjE2OCAxMDIuOTEyYy00LjA5NiAyLjA0OC05LjIxNiAzLjU4NC0xMS43NzYgMy41ODQtNC42MDggMC04LjcwNC0xLjUzNi0xMS4yNjQtNC4wOTZsLTEuMDI0LTAuNTEyYy02LjY1Ni02LjE0NC0xMC43NTItMTYuMzg0LTguNzA0LTI2LjYyNHoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=",speechBallon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4=","speechBallon-active":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTgzMiA4MzJINDQ4bC0xMjggMTkyLTEyOC0xOTJjLTEwNi4wNDggMC0xOTItODYuMDE2LTE5Mi0xOTJWMTkyYTE5MiAxOTIgMCAwIDEgMTkyLTE5Mmg2NDBjMTA1Ljk4NCAwIDE5MiA4NS45NTIgMTkyIDE5MnY0NDhjMCAxMDUuOTg0LTg2LjAxNiAxOTItMTkyIDE5MnogbTY0LTY0MGE2NCA2NCAwIDAgMC02NC02NEgxOTJDMTU2LjY3MiAxMjggMTI4IDE1Ni42NzIgMTI4IDE5MnY0NDhhNjQgNjQgMCAwIDAgNjQgNjRoNDIuNjg4TDMyMCA4MzJsODUuMzEyLTEyOEg4MzJjMzUuMzkyIDAgNjQtMjguNjA4IDY0LTY0VjE5MnoiIGZpbGw9IiMzMzgxRkYiPjwvcGF0aD48L3N2Zz4=","speechBallon-placement":"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTU3NiAyMTMuMzMzMzMzbDIyLjYxMzMzMyAyMi42MTMzMzRhMzIgMzIgMCAwIDAgMC00NS4yMjY2NjdMNTc2IDIxMy4zMzMzMzN6IG0tNjIuNzItMTA3Ljk0NjY2NmEzMiAzMiAwIDEgMC00NS4yMjY2NjcgNDUuMjI2NjY2bDQ1LjIyNjY2Ny00NS4yMjY2NjZ6IG0tNDUuMjI2NjY3IDE3MC42NjY2NjZhMzIgMzIgMCAwIDAgNDUuMjI2NjY3IDQ1LjIyNjY2N2wtNDUuMjI2NjY3LTQ1LjIyNjY2N3pNNDQ4IDgxMC42NjY2NjdsLTIyLjYxMzMzMy0yMi42MTMzMzRhMzIgMzIgMCAwIDAgMCA0NS4yMjY2NjdsMjIuNjEzMzMzLTIyLjYxMzMzM3ogbTEwNy45NDY2NjctNjIuNzJhMzIgMzIgMCAxIDAtNDUuMjI2NjY3LTQ1LjIyNjY2N2w0NS4yMjY2NjcgNDUuMjI2NjY3eiBtLTQ1LjIyNjY2NyAxNzAuNjY2NjY2YTMyIDMyIDAgMSAwIDQ1LjIyNjY2Ny00NS4yMjY2NjZsLTQ1LjIyNjY2NyA0NS4yMjY2NjZ6TTgxMC42NjY2NjcgNTc2bC0yMi42MTMzMzQgMjIuNjEzMzMzYTMyIDMyIDAgMCAwIDQ1LjIyNjY2NyAwTDgxMC42NjY2NjcgNTc2eiBtMTA3Ljk0NjY2Ni02Mi43MmEzMiAzMiAwIDEgMC00NS4yMjY2NjYtNDUuMjI2NjY3bDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAtNDUuMjI2NjY3IDQ1LjIyNjY2N2w0NS4yMjY2NjctNDUuMjI2NjY3ek0yMTMuMzMzMzMzIDQ0OGwyMi42MTMzMzQtMjIuNjEzMzMzYTMyIDMyIDAgMCAwLTQ1LjIyNjY2NyAwbDIyLjYxMzMzMyAyMi42MTMzMzN6IG02Mi43MiAxMDcuOTQ2NjY3YTMyIDMyIDAgMCAwIDQ1LjIyNjY2Ny00NS4yMjY2NjdsLTQ1LjIyNjY2NyA0NS4yMjY2Njd6IG0tMTcwLjY2NjY2Ni00NS4yMjY2NjdhMzIgMzIgMCAxIDAgNDUuMjI2NjY2IDQ1LjIyNjY2N2wtNDUuMjI2NjY2LTQ1LjIyNjY2N3pNMzA5LjMzMzMzMyAyMTMuMzMzMzMzQTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMjM0LjY2NjY2NyAyODh2NjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDM3My4zMzMzMzMgMjEzLjMzMzMzM2gtNjR6TTIzNC42NjY2NjcgMjg4QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgMTYwIDIxMy4zMzMzMzNoLTY0QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAyMzQuNjY2NjY3IDM1MnYtNjR6TTE2MCAyMTMuMzMzMzMzYzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2NnYtNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDk2IDIxMy4zMzMzMzNoNjR6TTIzNC42NjY2NjcgMTM4LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NiA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIzNC42NjY2NjcgNzQuNjY2NjY3djY0ek0zNDEuMzMzMzMzIDI0NS4zMzMzMzNoMjM0LjY2NjY2N3YtNjRIMzQxLjMzMzMzM3Y2NHogbTI1Ny4yOC01NC42MTMzMzNsLTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NiA4NS4zMzMzMzQgODUuMzMzMzM0IDQ1LjIyNjY2Ni00NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsLTg1LjMzMzMzNCA4NS4zMzMzMzMgNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2Njd6TTY1MC42NjY2NjcgODEwLjY2NjY2N2ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2NiAxMzguNjY2NjY2di02NEE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxIDcxNC42NjY2NjcgODEwLjY2NjY2N2gtNjR6IG0xMzguNjY2NjY2IDEzOC42NjY2NjZBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDkyOCA4MTAuNjY2NjY3aC02NGE3NC42NjY2NjcgNzQuNjY2NjY3IDAgMCAxLTc0LjY2NjY2NyA3NC42NjY2NjZ2NjR6TTkyOCA4MTAuNjY2NjY3YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY3LTEzOC42NjY2Njd2NjRjNDEuMjE2IDAgNzQuNjY2NjY3IDMzLjQ1MDY2NyA3NC42NjY2NjcgNzQuNjY2NjY3aDY0eiBtLTEzOC42NjY2NjctMTM4LjY2NjY2N0ExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgNjUwLjY2NjY2NyA4MTAuNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY2LTc0LjY2NjY2N3YtNjR6IG0tMTA2LjY2NjY2NiAxMDYuNjY2NjY3aC0yMzQuNjY2NjY3djY0SDY4Mi42NjY2Njd2LTY0eiBtLTIxMi4wNTMzMzQgNTQuNjEzMzMzbDg1LjMzMzMzNC04NS4zMzMzMzMtNDUuMjI2NjY3LTQ1LjIyNjY2Ny04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2Njd6IG0tNDUuMjI2NjY2IDBsODUuMzMzMzMzIDg1LjMzMzMzMyA0NS4yMjY2NjctNDUuMjI2NjY2LTg1LjMzMzMzNC04NS4zMzMzMzQtNDUuMjI2NjY2IDQ1LjIyNjY2N3pNNjcyIDIzNC42NjY2NjdBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDgxMC42NjY2NjcgMzczLjMzMzMzM3YtNjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjctNzQuNjY2NjY2aC02NHpNODEwLjY2NjY2NyAzNzMuMzMzMzMzYTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCAxMzguNjY2NjY2LTEzOC42NjY2NjZoLTY0QTc0LjY2NjY2NyA3NC42NjY2NjcgMCAwIDEgODEwLjY2NjY2NyAzMDkuMzMzMzMzdjY0eiBtMTM4LjY2NjY2Ni0xMzguNjY2NjY2QTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMCA4MTAuNjY2NjY3IDk2djY0YzQxLjIxNiAwIDc0LjY2NjY2NyAzMy40NTA2NjcgNzQuNjY2NjY2IDc0LjY2NjY2N2g2NHpNODEwLjY2NjY2NyA5NmExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAtMTM4LjY2NjY2NyAxMzguNjY2NjY3aDY0YzAtNDEuMjE2IDMzLjQ1MDY2Ny03NC42NjY2NjcgNzQuNjY2NjY3LTc0LjY2NjY2N3YtNjR6TTc3OC42NjY2NjcgMzQxLjMzMzMzM3YyMzQuNjY2NjY3aDY0VjM0MS4zMzMzMzNoLTY0eiBtNTQuNjEzMzMzIDI1Ny4yOGw4NS4zMzMzMzMtODUuMzMzMzMzLTQ1LjIyNjY2Ni00NS4yMjY2NjctODUuMzMzMzM0IDg1LjMzMzMzNCA0NS4yMjY2NjcgNDUuMjI2NjY2eiBtMC00NS4yMjY2NjZsLTg1LjMzMzMzMy04NS4zMzMzMzQtNDUuMjI2NjY3IDQ1LjIyNjY2NyA4NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2Ny00NS4yMjY2NjZ6TTEzOC42NjY2NjcgNzg5LjMzMzMzM2MwLTQxLjIxNiAzMy40NTA2NjctNzQuNjY2NjY3IDc0LjY2NjY2Ni03NC42NjY2NjZ2LTY0YTEzOC42NjY2NjcgMTM4LjY2NjY2NyAwIDAgMC0xMzguNjY2NjY2IDEzOC42NjY2NjZoNjR6TTIxMy4zMzMzMzMgNzE0LjY2NjY2N2M0MS4yMTYgMCA3NC42NjY2NjcgMzMuNDUwNjY3IDc0LjY2NjY2NyA3NC42NjY2NjZoNjRBMTM4LjY2NjY2NyAxMzguNjY2NjY3IDAgMCAwIDIxMy4zMzMzMzMgNjUwLjY2NjY2N3Y2NHogbTc0LjY2NjY2NyA3NC42NjY2NjZBNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMSAyMTMuMzMzMzMzIDg2NHY2NGExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMTM4LjY2NjY2Ny0xMzguNjY2NjY3aC02NHpNMjEzLjMzMzMzMyA4NjRhNzQuNjY2NjY3IDc0LjY2NjY2NyAwIDAgMS03NC42NjY2NjYtNzQuNjY2NjY3aC02NEExMzguNjY2NjY3IDEzOC42NjY2NjcgMCAwIDAgMjEzLjMzMzMzMyA5Mjh2LTY0ek0yNDUuMzMzMzMzIDY4Mi42NjY2Njd2LTIzNC42NjY2NjdoLTY0VjY4Mi42NjY2NjdoNjR6IG0tNTQuNjEzMzMzLTIxMi4wNTMzMzRsODUuMzMzMzMzIDg1LjMzMzMzNCA0NS4yMjY2NjctNDUuMjI2NjY3LTg1LjMzMzMzMy04NS4zMzMzMzMtNDUuMjI2NjY3IDQ1LjIyNjY2NnogbTAtNDUuMjI2NjY2bC04NS4zMzMzMzMgODUuMzMzMzMzIDQ1LjIyNjY2NiA0NS4yMjY2NjcgODUuMzMzMzM0LTg1LjMzMzMzNC00NS4yMjY2NjctNDUuMjI2NjY2eiIgIGZpbGw9IiM0NDRFNjAiPjwvcGF0aD48L3N2Zz4="};function Wl(e){return Fl[e]}var Gl=function(e){var t=e.workIds,r=e.mananger;return L.createElement("div",{className:"button normal-button",style:{touchAction:"none"},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.DeleteNode,{workIds:t||[Ca],viewId:r.viewId})},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.DeleteNode,{workIds:t||[Ca],viewId:r.viewId})}},L.createElement("img",{alt:"icon",src:Wl("delete")}))},Vl=function(e){var t=e.workIds,r=e.viewId;return L.createElement("div",{className:"button normal-button",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.CopyNode,{workIds:t||[Ca],viewId:r})},onTouchEnd:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.CopyNode,{workIds:t||[Ca],viewId:r})}},L.createElement("img",{alt:"icon",src:Wl("duplicate")}))},Hl=function(e){var t=e.icon,r=e.onClickHandler,n=e.onTouchEndHandler;return L.createElement("div",{className:"button normal-button",onClick:r,onTouchEnd:n},L.createElement("img",{src:Wl(t)}))},Yl=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=L.useContext(Hc),a=i.floatBarData,s=i.mananger,u=o(L.useState([]),2),l=u[0],c=u[1],h=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==a?void 0:a.y)&&null!=s&&s.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>180){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==s?void 0:s.height)-n.current.offsetTop-a.y<120){var t={top:"inherit",bottom:50};return t}}}),[null==n?void 0:n.current,a,s]),d=L.useMemo((function(){return t?L.createElement("div",{className:"image-layer-menu",style:h},L.createElement(Hl,{icon:"to-top",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Top,viewId:null==s?void 0:s.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Top,viewId:null==s?void 0:s.viewId})}}),L.createElement(Hl,{icon:"to-bottom",onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Bottom,viewId:null==s?void 0:s.viewId})},onTouchEndHandler:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.ZIndexNode,{workIds:[Ca],layer:Z.Bottom,viewId:null==s?void 0:s.viewId})}})):null}),[t,h]);return L.useEffect((function(){R.isEqual(null==a?void 0:a.selectIds,l)||null!=a&&a.selectIds&&!R.isEqual(null==a?void 0:a.selectIds,l)&&(c(null==a?void 0:a.selectIds),r(!1))}),[t,a,l,r]),L.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},d,L.createElement("img",{alt:"icon",src:Wl(t?"layer-pressed":"layer")}))},$l=function(){return L.createElement("svg",{style:{marginLeft:"2px"},viewBox:"0 0 1025 1024",width:"14",height:"14"},L.createElement("path",{d:"M1016.5248 493.8752c-9.984-9.984-26.2144-9.984-36.1984 0l-183.6032 183.6032c-29.952 29.952-78.6944 29.952-108.5952 0l-239.2064-239.2064c-14.4384-14.4384-22.3744-33.6896-22.3744-54.3232s7.936-39.8848 22.3744-54.3232l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984s-26.2144-9.984-36.1984 0l-183.6032 183.6032c-24.1152 24.1152-37.376 56.2176-37.376 90.5216 0 14.592 2.4576 28.8256 7.0656 42.1888l-374.8864 374.8864c-4.8128 4.8128-7.4752 11.3152-7.4752 18.1248l0 76.8c0 14.1312 11.4688 25.6 25.6 25.6l486.4 0c6.8096 0 13.312-2.7136 18.1248-7.4752l170.0864-170.0864c13.3632 4.6592 27.5968 7.0656 42.1888 7.0656 34.2528 0 66.4064-13.2608 90.5216-37.376l183.6032-183.6032c9.984-9.984 9.984-26.2144 0-36.1984zM501.4016 870.4l-450.2016 0 0-40.6016 358.5024-358.5024c1.024 1.0752 1.9968 2.1504 3.0208 3.1744l239.2064 239.2064c1.024 1.024 2.0992 2.048 3.1744 3.0208l-153.7024 153.7024z",fill:"#000000"}))},Xl=function(e){var t=e.activeColor,r=e.onClickHandler,n=e.onTouchEndHandler;return L.createElement("div",{className:"font-color-button ".concat("transparent"===t?"active":""),onClick:r,onTouchEnd:n},L.createElement("div",{className:"circle none"}))},ql=function(e){var t=e.color,r=e.activeColor,n=e.onClickHandler,i=e.onTouchEndHandler;return L.createElement("div",{className:"font-color-button ".concat(t===r?"active":""),onClick:n,onTouchEnd:i},L.createElement("div",{className:"circle",style:{backgroundColor:wu(t,1)}}))},Ql=function(e){var t=e.opacity,r=e.activeColor,n=e.setCurOpacity,i=o(L.useState({x:108,y:0}),2),a=i[0],s=i[1];if(L.useEffect((function(){s({x:100*t+8,y:0})}),[]),!r)return null;var u=R.throttle((function(e,i){e.cancelable&&e.preventDefault(),e.stopPropagation(),i.x!==(null==a?void 0:a.x)&&s({x:i.x,y:0});var o=Math.min(Math.max(i.x-8,0),100)/100;t!==o&&n(o,r,$.Doing)}),100,{leading:!1}),l=R.throttle((function(e,t){e.cancelable&&e.preventDefault(),e.stopPropagation(),t.x!==(null==a?void 0:a.x)&&s({x:t.x,y:0});var i=Math.min(Math.max(t.x-8,0),100)/100;n(i,r,$.Done)}),100,{leading:!1});return L.createElement("div",{className:"font-color-opacity",style:{marginLeft:"10px"},onClick:function(e){var t=e.nativeEvent.offsetX,i=Math.min(Math.max(t-12,0),100)/100;s({x:100*i+8,y:0}),n(i,r,$.Done)}},L.createElement("div",{className:"range-color",style:{background:"linear-gradient(to right, ".concat(wu(r,0),", ").concat(wu(r,1),")")}}),L.createElement("div",{className:"range-opacity"},L.createElement(j,{bounds:"parent",axis:"x",position:a,onDrag:u,onStart:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t,r,$.Start)},onStop:l},L.createElement("div",{className:"circle",style:{backgroundColor:wu(r,t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}}))))},Zl=function(e){var t=e.min,r=e.max,n=e.activeNumber,i=e.setActiveNumber,a=e.color,s=o(L.useState({x:108,y:0}),2),u=s[0],l=s[1];if(L.useEffect((function(){var e=Math.ceil((n-t)/(r-t)*100)+8;l({x:e,y:0})}),[]),!n)return null;var c=R.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation(),o.x!==(null==u?void 0:u.x)&&l({x:o.x,y:0});var a=Math.ceil(Math.max(o.x-8,0)/100*(r-t)+t);n!==a&&i(a,$.Doing)}),100,{leading:!1}),h=R.throttle((function(e,n){e.cancelable&&e.preventDefault(),e.stopPropagation(),n.x!==(null==u?void 0:u.x)&&l({x:n.x,y:0});var o=Math.ceil(Math.max(n.x-8,0)/100*(r-t)+t);i(o,$.Done)}),100,{leading:!1});return L.createElement("div",{className:"font-color-opacity",style:{marginLeft:"10px"},onClick:function(e){var n=e.nativeEvent.offsetX,o=Math.ceil(Math.max(n-12,0)/100*(r-t)+t),a=Math.ceil((o-t)/(r-t)*100)+8;l({x:a,y:0}),i(o,$.Done)}},L.createElement("div",{className:"range-color",style:{backgroundColor:a}}),L.createElement("div",{className:"range-opacity"},L.createElement(j,{bounds:"parent",axis:"x",position:u,onDrag:c,onStart:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),i(n,$.Start)},onStop:h},L.createElement("div",{className:"circle",style:{backgroundColor:a},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}},L.createElement("div",{className:"range-opacity-data-icon"},n)))))},Kl=function(e){var t=e.useStroke,r=e.color,n=e.activeStrokeType,i=e.setStrokeType;return L.createElement("div",{className:"stroke-type-box"},!!t&&L.createElement("div",{className:"stroke-type-box-item Stroke ".concat(n===U.Stroke&&"active"),style:{backgroundColor:r},onClick:function(){i(U.Stroke)},onTouchEnd:function(){i(U.Stroke)}}),L.createElement("div",{className:"stroke-type-box-item Normal ".concat(n===U.Normal&&"active"),style:{borderColor:r},onClick:function(){i(U.Normal)},onTouchEnd:function(){i(U.Normal)}}),L.createElement("div",{className:"stroke-type-box-item Dotted ".concat(n===U.Dotted&&"active"),style:{borderColor:r},onClick:function(){i(U.Dotted)},onTouchEnd:function(){i(U.Dotted)}}),L.createElement("div",{className:"stroke-type-box-item LongDotted ".concat(n===U.LongDotted&&"active"),style:{borderColor:r},onClick:function(){i(U.LongDotted)},onTouchEnd:function(){i(U.LongDotted)}}))},Jl=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=L.useContext(Hc),a=i.floatBarData,s=i.floatBarColors,l=i.mananger,c=i.setFloatBarData,h=o(L.useState(),2),d=h[0],f=h[1],p=o(L.useState(1),2),v=p[0],m=p[1];L.useEffect((function(){if(null!=a&&a.strokeColor){var e=o(Tu(a.strokeColor),2),t=e[0],r=e[1];f(t),m(r)}}),[a]);var g=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==a?void 0:a.y)&&null!=l&&l.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>180){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==l?void 0:l.height)-n.current.offsetTop-a.y<120){var t={top:"inherit",bottom:50};return t}}}),[(null==n?void 0:n.current)&&a,null==l?void 0:l.height]),y=L.useMemo((function(){return L.createElement(Ql,{key:"strokeColors",opacity:v,activeColor:d,setCurOpacity:function(e,t,r){r===$.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===$.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),m(e);var n=wu(t,e);null!=a&&a.strokeColor&&c({strokeColor:n}),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],strokeColor:n,workState:r,viewId:null==l?void 0:l.viewId})}})}),[v,d,null==l?void 0:l.control.room,null==l?void 0:l.viewId,a]),_=L.useMemo((function(){return d&&null!=a&&a.thickness?L.createElement(Zl,{key:"strokeThickness",min:1,max:10,activeNumber:a.thickness,setActiveNumber:function(e,t){t===$.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),t===$.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),null!=a&&a.thickness&&c({thickness:e}),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],thickness:e,workState:t,viewId:null==l?void 0:l.viewId})},color:d}):null}),[d,null==a?void 0:a.thickness,null==l?void 0:l.control.room,null==l?void 0:l.viewId]),b=L.useMemo((function(){return d&&null!=a&&a.strokeType?L.createElement(Kl,{key:"strokeType",useStroke:null==a?void 0:a.useStroke,activeStrokeType:a.strokeType,setStrokeType:function(e){a.strokeType&&c({strokeType:e}),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],strokeType:e,workState:$.Done,viewId:null==l?void 0:l.viewId})},color:d}):null}),[d,null==a?void 0:a.strokeType,null==l?void 0:l.control.room,null==l?void 0:l.viewId,null==a?void 0:a.useStroke]),x=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:g,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},b,_,L.createElement("div",{className:"font-colors-line"}),s.concat().map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:d,onTouchEndHandler:function(e){e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,c({strokeColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,strokeColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.strokeColor&&(a.strokeColor=t,c({strokeColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,strokeColor:t,viewId:null==l?void 0:l.viewId})}})})),y):null}),[t,s,y,d,v,a,null==l?void 0:l.viewId,g]),w=L.useMemo((function(){return d?L.createElement("div",{className:"color-bar-ring",style:{backgroundColor:wu(d,v)}},L.createElement("div",{className:"circle"})):null}),[d,v]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},w,x)},ec=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=L.useContext(Hc),a=i.floatBarData,s=i.floatBarColors,l=i.mananger,c=i.setFloatBarData,h=o(L.useState(),2),d=h[0],f=h[1],p=o(L.useState(1),2),v=p[0],m=p[1];L.useEffect((function(){if(null!=a&&a.fillColor){var e=o("transparent"===(null==a?void 0:a.fillColor)&&["transparent",1]||Tu(a.fillColor),2),t=e[0],r=e[1];f(t),m(r)}}),[a]);var g=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==a?void 0:a.y)&&null!=l&&l.height){if(n.current.offsetTop&&n.current.offsetTop+a.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==l?void 0:l.height)-n.current.offsetTop-a.y<140){var t={top:"inherit",bottom:50};return t}}}),[null==n?void 0:n.current,a,null==l?void 0:l.height]),y=L.useMemo((function(){return d&&"transparent"!==d?L.createElement(Ql,{key:"fillColors",opacity:v||0,activeColor:d,setCurOpacity:function(e,t,r){r===$.Start&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!0),r===$.Done&&null!=l&&l.control.room&&(l.control.room.disableDeviceInputs=!1),m(e);var n=wu(t,e);null!=a&&a.fillColor&&(a.fillColor=n,c({fillColor:n})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],fillColor:d&&wu(t,e),workState:r,viewId:null==l?void 0:l.viewId})}}):null}),[d,v,null==l?void 0:l.control.room,null==l?void 0:l.viewId,a]),_=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:g,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement(Xl,{activeColor:d,onTouchEndHandler:function(e){e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f("transparent");var t="transparent";null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})}}),s.map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:d,onTouchEndHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(r);var t=wu(r,v);null!=a&&a.fillColor&&(a.fillColor=t,c({fillColor:t})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:[Ca],workState:$.Done,fillColor:t,viewId:null==l?void 0:l.viewId})}})})),y):null}),[t,d,s,y,a,null==l?void 0:l.viewId,v,g]),b=L.useMemo((function(){var e=d&&"transparent"!==d&&wu(d,v)||"transparent";return L.createElement("div",{className:"color-bar-fill"},L.createElement("div",{className:"circle",style:{backgroundColor:e}}))}),[d,v]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},b,_)},tc=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,a=e.floatBarRef,s=L.useContext(Hc),l=s.floatBarColors,c=s.mananger,h=s.setFloatBarData,d=s.floatBarData,f=o(L.useState(),2),p=f[0],v=f[1],m=o(L.useState(1),2),g=m[0],y=m[1];L.useEffect((function(){if(null!=n&&n.fontColor){var e=o("transparent"===(null==n?void 0:n.fontColor)&&["transparent",0]||Tu(n.fontColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontColor]);var _=L.useMemo((function(){if(null!=a&&a.current&&R.isNumber(null==d?void 0:d.y)&&null!=c&&c.height){if(a.current.offsetTop&&a.current.offsetTop+d.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==c?void 0:c.height)-a.current.offsetTop-d.y<120){var t={top:"inherit",bottom:50};return t}}}),[null==a?void 0:a.current,d,c]),b=L.useMemo((function(){return p&&"transparent"!==p?L.createElement(Ql,{key:"fontColors",opacity:g,activeColor:p,setCurOpacity:function(e,t,r){r===$.Start&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!0),r===$.Done&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!1),y(e);var n=wu(t,e);null!=d&&d.textOpt&&(d.textOpt.fontColor=n,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],fontColor:p&&n,workState:r,viewId:null==c?void 0:c.viewId})}}):null}),[p,g,null==c?void 0:c.control.room,null==c?void 0:c.viewId,null==d?void 0:d.textOpt,i]),x=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},l.map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontColor:t,viewId:null==c?void 0:c.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontColor:t,viewId:null==c?void 0:c.viewId})}})})),b):null}),[t,l,b,p,g,null==d?void 0:d.textOpt,i,null==c?void 0:c.viewId,_]),w=L.useMemo((function(){var e=p&&"transparent"!==p&&wu(p,g)||"transparent";return L.createElement("div",{className:"color-bar"},L.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,g]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},L.createElement("img",{alt:"icon",src:Wl("font-colors")}),w,x)},rc=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,a=e.floatBarRef,s=L.useContext(Hc),l=s.floatBarColors,c=s.mananger,h=s.setFloatBarData,d=s.floatBarData,f=o(L.useState(),2),p=f[0],v=f[1],m=o(L.useState(1),2),g=m[0],y=m[1];L.useEffect((function(){if(null!=n&&n.fontBgColor){var e=o("transparent"===(null==n?void 0:n.fontBgColor)&&["transparent",1]||Tu(n.fontBgColor),2),t=e[0],r=e[1];v(t),y(r)}}),[null==n?void 0:n.fontBgColor]);var _=L.useMemo((function(){if(null!=a&&a.current&&R.isNumber(null==d?void 0:d.y)&&null!=c&&c.height){if(a.current.offsetTop&&a.current.offsetTop+d.y>180){var e={top:"inherit",bottom:50};return e}if(!a.current.offsetTop&&(null==c?void 0:c.height)-a.current.offsetTop-d.y<120){var t={top:"inherit",bottom:50};return t}}}),[null==a?void 0:a.current,d,c]),b=L.useMemo((function(){return p&&"transparent"!==p?L.createElement(Ql,{key:"fontBgColor",opacity:g||0,activeColor:p,setCurOpacity:function(e,t,r){r===$.Start&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!0),r===$.Done&&null!=c&&c.control.room&&(c.control.room.disableDeviceInputs=!1),y(e);var n=wu(t,e);null!=d&&d.textOpt&&(d.textOpt.fontBgColor=n,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],fontBgColor:p&&wu(t,e),workState:r,viewId:null==c?void 0:c.viewId})}}):null}),[p,g,null==c?void 0:c.control.room,null==c?void 0:c.viewId,null==d?void 0:d.textOpt,i]),x=L.useMemo((function(){return t?L.createElement("div",{className:"font-colors-menu",style:_,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement(Xl,{activeColor:p,onTouchEndHandler:function(e){e.stopPropagation();var t="transparent";v(t),null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:t,viewId:null==c?void 0:c.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation();var t="transparent";v(t),null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:t,viewId:null==c?void 0:c.viewId})}}),l.map((function(e,t){var r=xu.apply(void 0,u(e));return L.createElement(ql,{key:t,color:r,activeColor:p,onTouchEndHandler:function(e){e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:wu(r,g),viewId:null==c?void 0:c.viewId})},onClickHandler:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),v(r);var t=wu(r,g);null!=d&&d.textOpt&&(d.textOpt.fontBgColor=t,h({textOpt:d.textOpt})),zu.emitMethod(G.MainEngine,W.SetColorNode,{workIds:i||[Ca],workState:$.Done,fontBgColor:wu(r,g),viewId:null==c?void 0:c.viewId})}})})),b):null}),[t,l,b,g,p,null==d?void 0:d.textOpt,i,null==c?void 0:c.viewId,_]),w=L.useMemo((function(){var e=p&&"transparent"!==p&&wu(p,g)||"transparent";return L.createElement("div",{className:"color-bar",style:{marginTop:0}},L.createElement("div",{className:"color-bar-color",style:{backgroundColor:e}}))}),[p,g]);return L.createElement("div",{className:"button normal-button font-colors-icon ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},L.createElement($l,null),w,x)},nc=function(e){var t=e.bold,r=e.setBold,n=e.workIds,i=e.viewId,o=function(e){var o="bold"===t?"normal":"bold";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,bold:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl("bold"===t?"bold-active":"bold")}))},ic=function(e){var t=e.underline,r=e.setUnderline,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,underline:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl(t?"underline-active":"underline")}))},oc=function(e){var t=e.lineThrough,r=e.setLineThrough,n=e.workIds,i=e.viewId,o=function(e){var o=!t;e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,lineThrough:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl(t?"line-through-active":"line-through")}))},ac=function(e){var t=e.italic,r=e.setItalic,n=e.workIds,i=e.viewId,o=function(e){var o="italic"===t?"normal":"italic";e.cancelable&&e.preventDefault(),null==e||e.stopPropagation(),r(o),zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:n,viewId:i,italic:o})};return L.createElement("div",{className:"font-style-button",onClick:o,onTouchEnd:o},L.createElement("img",{alt:"icon",src:Wl("italic"===t?"italic-active":"italic")}))},sc=function(e){var t=e.open,r=e.setOpen,n=e.textOpt,i=e.workIds,a=e.style,s=e.floatBarRef,u=L.useContext(Hc),l=u.mananger,c=u.floatBarData,h=o(L.useState("normal"),2),d=h[0],f=h[1],p=o(L.useState("normal"),2),v=p[0],m=p[1],g=o(L.useState(!1),2),y=g[0],_=g[1],b=o(L.useState(!1),2),x=b[0],w=b[1];L.useEffect((function(){null!=n&&n.bold&&f(n.bold),R.isBoolean(null==n?void 0:n.underline)&&_(n.underline||!1),R.isBoolean(null==n?void 0:n.lineThrough)&&w(n.lineThrough||!1),null!=n&&n.italic&&m(n.italic)}),[n]);var S=L.useMemo((function(){if(a&&null!=s&&s.current&&R.isNumber(null==c?void 0:c.y)&&null!=l&&l.height){if(s.current.offsetTop&&s.current.offsetTop+c.y>180){var e={top:"inherit",bottom:50};return e}if(!s.current.offsetTop&&(null==l?void 0:l.height)-s.current.offsetTop-c.y<120){var t={top:"inherit",bottom:50};return t}}}),[a,null==s?void 0:s.current,c,l]),T=L.useMemo((function(){return t?L.createElement("div",{className:"font-style-menu",style:S,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement(nc,{workIds:i||[Ca],bold:d,setBold:f,viewId:null==l?void 0:l.viewId}),L.createElement(ic,{workIds:i||[Ca],underline:y,setUnderline:_,viewId:null==l?void 0:l.viewId}),L.createElement(oc,{workIds:i||[Ca],lineThrough:x,setLineThrough:w,viewId:null==l?void 0:l.viewId}),L.createElement(ac,{workIds:i||[Ca],italic:v,setItalic:m,viewId:null==l?void 0:l.viewId})):null}),[t,i,d,null==l?void 0:l.viewId,y,x,v,S]);return L.createElement("div",{className:"button normal-button ".concat(t&&"active"),onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},L.createElement("img",{alt:"icon",src:Wl(t?"font-style-active":"font-style")}),T)},uc=Object.freeze([12,14,18,24,36,48,64,80,144,288]),lc=["top","topLeft","topRight","bottom","bottomLeft","bottomRight","left","leftTop","leftBottom","right","rightTop","rightBottom"],cc=function(e){var t=e.style,r=e.onClickHandler;return L.createElement("div",{className:"font-size-menu",style:t,onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},uc.map((function(e){return L.createElement("div",{className:"font-size-btn",key:e,onClick:function(){r(e)},onTouchEnd:function(){r(e)}},e)})))},hc=function(e){var t=L.useRef(null),r=e.open,n=e.setOpen,i=e.textOpt,a=e.workIds,s=e.floatBarRef,u=L.useContext(Hc),l=u.mananger,c=u.floatBarData,h=o(L.useState(0),2),d=h[0],f=h[1],p=o(L.useState(),2),v=p[0],m=p[1],g=uc.length-1;L.useEffect((function(){null!=i&&i.fontSize&&(f(i.fontSize),t.current&&(t.current.value=i.fontSize.toString()))}),[null==i?void 0:i.fontSize]);var y=L.useMemo((function(){if(null!=s&&s.current&&R.isNumber(null==c?void 0:c.y)&&null!=l&&l.height){if(s.current.offsetTop&&s.current.offsetTop+c.y>180){var e={top:"inherit",bottom:35};return e}if(!s.current.offsetTop&&(null==l?void 0:l.height)-s.current.offsetTop-c.y<120){var t={top:"inherit",bottom:35};return t}}}),[null==s?void 0:s.current,c,l]);var _=function(e){var r;null==(r=t.current)||r.blur(),n(!1),x(e)},b=L.useMemo((function(){return r?L.createElement(cc,{onClickHandler:_,style:y}):null}),[r,_,y]),x=function(e){e>uc[g]&&(e=uc[g]),e=uc[0]&&e<=uc[g]&&zu.emitMethod(G.MainEngine,W.SetFontStyle,{workIds:a||[Ca],fontSize:e,viewId:null==l?void 0:l.viewId})}(e)};return L.useEffect((function(){return function(){null!=l&&l.control.room&&R.isBoolean(v)&&(l.control.room.disableDeviceInputs=v)}}),[l,v]),L.createElement("div",{className:"button normal-button font-size-barBtn",style:{width:50},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},L.createElement("input",{className:"font-size-input",ref:t,onTouchEnd:function(){t.current&&t.current.focus()},onClick:function(){n(!r),t.current&&t.current.focus()},onKeyDown:function(e){if("Backspace"===e.key){var t=window.getSelection(),r=null==t?void 0:t.getRangeAt(0);if(null!=r&&r.collapsed)return e.cancelable&&e.preventDefault(),document.execCommand("delete",!1),!1}return!1},onKeyUp:function(e){var r;if(t.current){var i=t.current.value,o=parseInt(i);isNaN(o)?t.current.value="0":t.current.value=o.toString(),o&&"Enter"===e.key&&(x(o),null==(r=t.current)||r.blur(),n(!1))}},onFocus:function(){null!=l&&l.control.room&&!l.control.room.disableDeviceInputs&&(m(l.control.room.disableDeviceInputs),l.control.room.disableDeviceInputs=!0)},onBlur:function(){null!=l&&l.control.room&&R.isBoolean(v)&&(l.control.room.disableDeviceInputs=v)}}),L.createElement("div",{className:"font-size-btns"},L.createElement("div",{className:"font-size-add",onClick:function(){x(d+uc[0])},onTouchEnd:function(){x(d+uc[0])}}),L.createElement("div",{className:"font-size-cut",onClick:function(){x(d-uc[0])},onTouchEnd:function(){x(d-uc[0])}})),b)},dc=function(e){var t=e.workIds,r=e.mananger,n=e.islocked;return L.createElement("div",{className:"button normal-button",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),zu.emitMethod(G.MainEngine,W.SetLock,{workIds:t||[Ca],isLocked:!n,viewId:null==r?void 0:r.viewId})},onTouchEnd:function(e){e.stopPropagation(),zu.emitMethod(G.MainEngine,W.SetLock,{workIds:t||[Ca],isLocked:!n,viewId:null==r?void 0:r.viewId})}},L.createElement("img",{alt:"icon",src:Wl(n?"unlock-new":"lock-new")}))},fc=function(e){var t=e.icon,r=e.min,n=e.max,i=e.step,a=e.value,s=e.onInputHandler,u=o(L.useState(0),2),l=u[0],c=u[1],h=L.useRef(null),d=function(e){e>n&&(e=n),e=r&&i<=n&&d(i)}}),L.createElement("div",{className:"input-number-btns"},L.createElement("div",{className:"input-number-add",onClick:function(){d(l+i)},onTouchEnd:function(){d(l+i)}}),L.createElement("div",{className:"input-number-cut",onClick:function(){d(l-i)},onTouchEnd:function(){d(l-i)}})))},pc=function(e){var t=e.icon,r=e.min,n=e.max,i=e.step,o=e.value,a=e.onInputHandler;return L.createElement("div",{className:"button input-button"},L.createElement("img",{src:Wl(t)}),L.createElement(vc,{min:r,max:n,step:i,value:o,onInputHandler:a}))},vc=function(e){var t=e.value,r=e.min,n=e.max,i=e.onInputHandler,a=o(L.useState({x:0,y:0}),2),s=a[0],u=a[1];L.useEffect((function(){u({x:100*t,y:0})}),[]);var l=R.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var a=Math.floor(Math.max(o.x,100*r));a=Math.floor(Math.min(a,100*n)),o.x!==(null==s?void 0:s.x)&&u({x:a,y:0});var l=a/100;t!==l&&i(l)}),100,{leading:!1}),c=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()},h=R.throttle((function(e,o){e.cancelable&&e.preventDefault(),e.stopPropagation();var a=Math.floor(Math.max(o.x,100*r));a=Math.floor(Math.min(a,100*n)),o.x!==(null==s?void 0:s.x)&&u({x:a,y:0});var l=a/100;t!==l&&i(l)}),100,{leading:!1});return L.createElement("div",{className:"range-number-container",onClick:function(e){var o=e.nativeEvent.offsetX-6,a=Math.floor(Math.max(o,100*r));a=Math.floor(Math.min(a,100*n)),u({x:a,y:0});var s=a/100;t!==s&&i(s)}},L.createElement("div",{className:"range-number-color"}),L.createElement("div",{className:"range-number"},L.createElement(j,{bounds:"parent",axis:"x",position:s,onDrag:l,onStart:c,onStop:h},L.createElement("div",{className:"circle",onClick:c}))))},mc=function(e){var t=e.icon,r=e.value,n=e.onChangeHandler,i=e.style,a=o(L.useState(0),2),s=a[0],u=a[1],l=o(L.useState(),2),c=l[0],h=l[1],d=L.useRef(null),f=L.useCallback((function(e){e>=lc.length&&(e=0),e<0&&(e=lc.length-1),u(e),n(lc[e]),h(!1),d.current&&(d.current.value=lc[e])}),[n]),p=L.useMemo((function(){if(i&&i.bottom){var e={top:"inherit",bottom:50};return e}}),[i]);L.useEffect((function(){r&&(u(lc.indexOf(r)),d.current&&(d.current.value=r))}),[r]);var v=L.useMemo((function(){return c?L.createElement(gc,{options:lc,onClickHandler:f,style:p}):null}),[c,f,p]);return L.createElement("div",{className:"button input-button"},L.createElement("img",{src:Wl(t)}),L.createElement("input",{readOnly:!0,className:"input-number",type:"text",ref:d,onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),d.current&&d.current.focus()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),d.current&&(d.current.focus(),h(!c))}}),L.createElement("div",{className:"input-number-btns"},L.createElement("div",{className:"input-number-add",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s+1)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s+1)}}),L.createElement("div",{className:"input-number-cut",onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s-1)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),f(s-1)}})),v)},gc=function(e){var t=e.options,r=e.style,n=e.onClickHandler;return L.createElement("div",{className:"select-option-menu",style:r,onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},t.map((function(e,t){return L.createElement("div",{className:"select-option-btn",key:e,onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t)},onTouchEnd:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),n(t)}},e)})))},yc=function(e){var t=e.mananger,r=e.innerRatio,n=e.innerVerticeStep,i=e.vertices;return L.createElement(L.Fragment,null,L.createElement(fc,{value:i,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Star,viewId:t.viewId,vertices:e})}}),L.createElement(fc,{value:n,icon:"star-innerVertex",min:1,max:100,step:1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Star,viewId:t.viewId,innerVerticeStep:e})}}),L.createElement(pc,{value:r,icon:"star-innerRatio",min:.1,max:1,step:.1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Star,viewId:t.viewId,innerRatio:e})}}))},_c=function(e){var t=e.mananger,r=e.vertices;return L.createElement(fc,{value:r,icon:"polygon-vertex",min:3,max:100,step:1,onInputHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.Polygon,viewId:t.viewId,vertices:e})}})},bc=function(e){var t=e.mananger,r=e.placement;return L.createElement(mc,{value:r,icon:"speechBallon-placement",onChangeHandler:function(e){zu.emitMethod(G.MainEngine,W.SetShapeOpt,{workIds:[Ca],toolsType:H.SpeechBalloon,viewId:t.viewId,placement:e})}})},xc=function(e){var t=e.icon,r=e.isActive,n=e.onClickHandler,i=e.onTouchEndHandler;return L.createElement("div",{className:"button tab-button ".concat(r?"active":""),onClick:n,onTouchEnd:i},L.createElement("img",{src:Wl(t)}))},wc=function(e){var t=e.toolsTypes,r=e.style,n=e.mananger,i=e.shapeOpt,a=o(L.useState(),2),s=a[0],u=a[1];L.useEffect((function(){t.includes(H.Polygon)?u(H.Polygon):t.includes(H.Star)?u(H.Star):u(H.SpeechBalloon)}),[t]);var l=function(e,t){t.cancelable&&t.preventDefault(),null==t||t.stopPropagation(),u(e)},c=L.useMemo((function(){return s===H.Polygon&&n&&i.vertices?L.createElement(_c,{vertices:i.vertices,mananger:n}):null}),[n,s,i]),h=L.useMemo((function(){return s===H.Star&&n&&i.vertices&&i.innerVerticeStep&&i.innerRatio?L.createElement(yc,{mananger:n,vertices:i.vertices,innerVerticeStep:i.innerVerticeStep,innerRatio:i.innerRatio}):null}),[n,s,i]),d=L.useMemo((function(){return s===H.SpeechBalloon&&n&&i.placement?L.createElement(bc,{mananger:n,placement:i.placement}):null}),[n,s,i]);return L.createElement("div",{className:"shapeOpt-sub-menu",style:r,onClick:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.cancelable&&e.preventDefault()}},L.createElement("div",{className:"shapeOpt-sub-menu-tabs"},t.includes(H.Polygon)&&L.createElement(xc,{isActive:s===H.Polygon,icon:s===H.Polygon?"polygon-active":"polygon",onClickHandler:l.bind(void 0,H.Polygon),onTouchEndHandler:l.bind(void 0,H.Polygon)})||null,t.includes(H.Star)&&L.createElement(xc,{isActive:s===H.Star,icon:s===H.Star?"star-active":"star",onClickHandler:l.bind(void 0,H.Star),onTouchEndHandler:l.bind(void 0,H.Star)})||null,t.includes(H.SpeechBalloon)&&L.createElement(xc,{isActive:s===H.SpeechBalloon,icon:s===H.SpeechBalloon?"speechBallon-active":"speechBallon",onClickHandler:l.bind(void 0,H.SpeechBalloon),onTouchEndHandler:l.bind(void 0,H.SpeechBalloon)})||null),L.createElement("div",{className:"shapeOpt-sub-menu-content"},c,h,d))},Sc=function(e){var t=e.open,r=e.setOpen,n=e.floatBarRef,i=e.toolsTypes,a=e.shapeOpt,s=L.useContext(Hc),u=s.floatBarData,l=s.mananger,c=o(L.useState([]),2),h=c[0],d=c[1],f=o(L.useState(),2),p=f[0],v=f[1],m=L.useMemo((function(){if(null!=n&&n.current&&R.isNumber(null==u?void 0:u.x)&&R.isNumber(null==u?void 0:u.y)&&null!=l&&l.height){if(n.current.offsetTop&&n.current.offsetTop+u.y>200){var e={top:"inherit",bottom:50};return e}if(!n.current.offsetTop&&(null==l?void 0:l.height)-n.current.offsetTop-(null==u?void 0:u.y)<140){var t={top:"inherit",bottom:50};return t}}}),[n,null==u?void 0:u.x,null==u?void 0:u.y,null==l?void 0:l.height]),g=L.useMemo((function(){return t&&i&&l&&a?(l.control.room&&!l.control.room.disableDeviceInputs&&(v(l.control.room.disableDeviceInputs),l.control.room.disableDeviceInputs=!0),L.createElement(wc,{shapeOpt:a,style:m,toolsTypes:i,mananger:l})):(null!=l&&l.control.room&&R.isBoolean(p)&&(l.control.room.disableDeviceInputs=p),null)}),[t,m,i,l,a]);return L.useEffect((function(){R.isEqual(null==u?void 0:u.selectIds,h)||null!=u&&u.selectIds&&!R.isEqual(null==u?void 0:u.selectIds,h)&&(d(null==u?void 0:u.selectIds),r(!1))}),[t,u,h,r]),L.useEffect((function(){return function(){t&&null!=l&&l.control.room&&R.isBoolean(p)&&(l.control.room.disableDeviceInputs=p)}}),[t,l,p]),L.createElement("div",{className:"button normal-button ".concat(t&&"active"),onClick:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)},onTouchEnd:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(!t)}},g,L.createElement("img",{alt:"icon",src:Wl(t?"shapes-active":"shapes")}))},Tc=L.memo((function(e){var t=e.textOpt,r=e.workIds,n=e.noLayer,i=e.position,a=L.useContext(Hc),s=a.floatBarData,u=a.mananger,l=o(L.useState(0),2),c=l[0],h=l[1],d=o(L.useState(),2),f=d[0],p=d[1],v=L.useRef(null);L.useEffect((function(){var e,r,n,o,a={},l=(null==s?void 0:s.w)||(null==(e=null==t?void 0:t.boxSize)?void 0:e[0])||0,c=(null==s?void 0:s.h)||(null==(r=null==t?void 0:t.boxSize)?void 0:r[1])||0;if(i&&l&&c&&null!=u&&u.width&&null!=u&&u.height){if(i.y<60?i.y+c0?a.top=62:a.top=62-i.y:a.top=0,i.x<0)a.left=3-i.x;else if(i.x+((null==(n=v.current)?void 0:n.offsetWidth)||l)>u.width){var h=u.width-((null==(o=v.current)?void 0:o.offsetWidth)||l)-i.x;a.left=h}p(a)}else p(void 0)}),[v,i,null==s?void 0:s.w,null==s?void 0:s.h,null==u?void 0:u.width,null==u?void 0:u.height,null==t?void 0:t.boxSize]);var m=L.useMemo((function(){return null!=s&&s.fillColor?L.createElement(ec,{floatBarRef:v,open:3===c,setOpen:function(e){h(!0===e?3:0)}}):null}),[null==s?void 0:s.fillColor,c,v]),g=L.useMemo((function(){return null!=s&&s.strokeColor?L.createElement(Jl,{floatBarRef:v,open:2===c,setOpen:function(e){h(!0===e?2:0)}}):null}),[null==s?void 0:s.strokeColor,c,v]),y=L.useMemo((function(){return null!=t&&t.fontColor&&null!=u&&u.viewId?L.createElement(tc,{floatBarRef:v,open:4===c,setOpen:function(e){h(!0===e?4:0)},textOpt:t,workIds:r}):null}),[t,c,r,u,v]),_=L.useMemo((function(){return null!=t&&t.fontBgColor&&null!=u&&u.viewId?L.createElement(rc,{floatBarRef:v,open:5===c,setOpen:function(e){h(!0===e?5:0)},textOpt:t,workIds:r}):null}),[t,c,r,u,v]),b=L.useMemo((function(){return t&&null!=u&&u.viewId?L.createElement(sc,{floatBarRef:v,open:6===c,setOpen:function(e){h(!0===e?6:0)},textOpt:t,workIds:r,style:f}):null}),[t,c,r,u,f,v]),x=L.useMemo((function(){return t&&null!=u&&u.viewId?L.createElement(hc,{open:7===c,setOpen:function(e){h(!0===e?7:0)},textOpt:t,workIds:r,floatBarRef:v}):null}),[t,c,r,u,v]),w=L.useMemo((function(){return n?null:L.createElement(Yl,{open:1===c,setOpen:function(e){h(!0===e?1:0)},floatBarRef:v})}),[n,c,v]),S=L.useMemo((function(){return null!=s&&s.canLock&&u?L.createElement(dc,{workIds:r,mananger:u,islocked:s.isLocked}):null}),[s,u,r]),T=L.useMemo((function(){return u&&null!=u&&u.viewId&&f&&null!=s&&s.shapeOpt&&null!=s&&s.toolsTypes?L.createElement(Sc,{open:8===c,setOpen:function(e){h(!0===e?8:0)},floatBarRef:v,workIds:r,toolsTypes:s.toolsTypes,shapeOpt:s.shapeOpt}):null}),[s,u,c,f,r,v]);return L.createElement("div",{className:"appliance-plugin-floatbtns",style:f,ref:v,onMouseOver:function(e){return e.stopPropagation(),e.cancelable&&e.preventDefault(),null==u||u.control.worker.blurCursor(u.viewId),!1},onMouseMove:function(e){return e.stopPropagation(),e.cancelable&&e.preventDefault(),!1}},u&&L.createElement(Gl,{workIds:r,mananger:u}),w,S,!(null==u||!u.viewId)&&L.createElement(Vl,{workIds:r,viewId:u.viewId}),T,x,b,y,_,g,m)})),Mc=function(e){var t=e.data,r=e.isActive,n=e.manager,i=e.workId,o=t.opt,a=t.scale,s=t.translate,u=t.x,l=t.y,c="scale(".concat(a||1,") ").concat(s&&"translate("+s[0]+"px,"+s[1]+"px)"||""),h=o.fontSize,d=o.fontFamily,f=o.underline,p=o.fontColor,v=o.lineThrough,m=o.textAlign,g=o.strokeColor,y=o.lineHeight,_=o.bold,b=o.italic,x=o.uid,w=o.workState,S=h,T=y||1.2*S,M={fontSize:"".concat(S,"px"),lineHeight:"".concat(T,"px"),color:p,borderColor:g,minHeight:"".concat(T,"px"),paddingRight:"".concat("italic"===b?Math.round(.3*S):5,"px")};d&&(M.fontFamily="".concat(d)),(v||f)&&(M.textDecoration="".concat(v?"line-through":"").concat(f?" underline":"")),_&&(M.fontWeight="".concat(_)),b&&(M.fontStyle="".concat(b)),m&&(M.textAlign="".concat(m));var k=L.useMemo((function(){var e=[];if(o.text)for(var t=wa(o.text),r=0;r
":'
').concat(n,"
")}else e='
');return e}),[m.fontBgColor,m.text]),B=L.useMemo((function(){return"string"==typeof z?L.createElement("div",{id:r,suppressContentEditableWarning:!0,contentEditable:!0,className:"editor",ref:N,style:O,onKeyDown:F,onKeyUp:a,onClick:U,onTouchEnd:U,onFocus:s,onPaste:G,onInput:V,dangerouslySetInnerHTML:{__html:z}}):null}),[z,O,r]);function U(){N.current&&N.current.focus(),h()}function F(e){if("Backspace"===e.key){var t=window.getSelection(),r=null==t?void 0:t.getRangeAt(0);if(null!=r&&r.collapsed)return e.cancelable&&e.preventDefault(),document.execCommand("delete",!1),!1}return h(),!1}function W(e,t){var r=null==window?void 0:window.getSelection();if(null!=r&&r.rangeCount&&e&&r&&r.anchorNode){var n=r.anchorOffset,i=r.anchorNode.textContent||"",o=i.slice(0,n)||"",a=i.slice(n)||"";!function(e,t,r){var n=null==window?void 0:window.getSelection();if(null==n||!n.rangeCount||!n.anchorNode)return;var i=e.split(/\n/),o=n.anchorNode.parentNode;o===r&&(o=n.anchorNode);for(var a,s=u(r.childNodes),l=[],c=n.anchorOffset;s.length;){var h=s.pop();if(h){if(h===o){var d=i[0];1===i.length&&(c=i[0].length,d=i[0].concat(t)),"#text"===o.nodeName?(o.textContent=d,a=o):"DIV"===o.nodeName&&(o.innerText=d,a=o.childNodes[0]);break}l.push(h),r.removeChild(h)}}if(i.length>1)for(var p=1;p":g.innerText=v,r.appendChild(g),p===i.length-1&&(a=g.childNodes[0])}if(l.length){l.reverse();var y,_=f(l);try{for(_.s();!(y=_.n()).done;){var b=y.value;r.appendChild(b)}}catch(e){_.e(e)}finally{_.f()}}if(a&&"#text"===a.nodeName){n.deleteFromDocument();var x=document.createRange(),w=Math.min(c,(null==a?void 0:a.length)||0);x.setStart(a,w),x.collapse(!0),n.removeAllRanges(),n.addRange(x)}}(o.concat(e)||"",a,t)}}function G(e){if(e.cancelable&&e.preventDefault(),e.stopPropagation(),N.current){var t=(e.clipboardData||window.clipboardData).getData("text"),r=null==window?void 0:window.getSelection();if(null==r||!r.rangeCount)return;t&&r&&r.anchorNode&&W(t,N.current),h()}}function V(e){a(e),h()}return L.useEffect((function(){B&&N.current&&(N.current.click(),setTimeout((function(){var e;if(N.current){var t=null==window?void 0:window.getSelection(),r=N.current.lastChild;if(t&&r){var n=document.createRange(),i=(null==(e=r.textContent)?void 0:e.length)||0;"#text"===(null==r?void 0:r.nodeName)?n.setStart(r,i):n.setStart(r,i?1:0),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}}),20))}),[B,N.current]),L.useEffect((function(){var e,t,n,i;if(B&&(null!=(e=N.current)&&e.offsetWidth||null!=(t=N.current)&&t.offsetHeight||null!=(n=N.current)&&n.offsetLeft||null!=(i=N.current)&&i.offsetTop)){var o=[N.current.offsetWidth,N.current.offsetHeight];(P&&P[0]!==o[0]&&P[1]!==o[1]||!P)&&l({activeTextId:r,update:{boxSize:o,workState:$.Doing}})}}),[P,B,O,r]),L.createElement(L.Fragment,null,j,L.createElement("div",{className:"editor-box",style:D,onFocus:function(){c.control.room&&!c.control.room.disableDeviceInputs&&(v(c.control.room.disableDeviceInputs),c.control.room.disableDeviceInputs=!0)},onBlur:function(){null!=c&&c.control.room&&R.isBoolean(p)&&(c.control.room.disableDeviceInputs=p)}},B))},Ic=function(e){m(r,e);var t=y(r);function r(e){return S(this,r),t.call(this,e)}return M(r,[{key:"getInnerText",value:function(e){for(var t=[],r=0;rthis.maxScreenshotWidth&&(f=this.maxScreenshotWidth/h*f,h=this.maxScreenshotWidth),d>this.maxScreenshotHeight&&(f=Math.min(this.maxScreenshotHeight/d*f,f),d=this.maxScreenshotHeight),u.scale=f,p=document.createElement("canvas"),v=p.getContext("2d"),p.width=h*(l||1),p.height=d*(l||1),v&&((t.mainView||n).screenshotToCanvas(v,o,h,d,u,l),r.drawImage(p,Math.floor((a-h)/2),Math.floor((s-d)/2),h*(l||1),d*(l||1),0,0,h,d),p.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(c=i.currentManager)?void 0:c.screenshotToCanvas(r,o,h,d,u,Math.floor((a-h)/2),Math.floor((s-d)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,o,a,s,u){var l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"),(t.mainView||n).scenePreview(r,o,a,s,u),(l=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",o.append(l),getComputedStyle(o).position||(o.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=9;break}return e.next=9,i.currentManager.scenePreview(r,l);case 9:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),fillSceneSnapshotAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,o,a,s,u){var l,c,h,d,f,p,v,m,g,y,_,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"),o.innerHTML="",(t.mainView||n).fillSceneSnapshot(r,o,a,s,u),l=a||t.mainView.size.width,c=s||t.mainView.size.height,e.next=4,this.getBoundingRectAsync(r);case 4:if((h=e.sent)||(h={originX:0,originY:0,width:l,height:c}),d=Math.max(null==h?void 0:h.width,l),f=Math.max(null==h?void 0:h.height,c),p=1,v=d>l&&Math.min(l/d,p)||p,m=f>c&&Math.min(c/f,p)||p,v<=m?(d=v<1&&l||d,f=Math.floor(f*v)+1,p=v):v>m&&(f=m<1&&c||f,d=Math.floor(d*m)+1,p=m),g={scale:p,centerX:h.originX+h.width/2,centerY:h.originY+h.height/2},y=document.createElement("canvas"),_=y.getContext("2d"),y.width=d,y.height=f,e.t0=_,!e.t0){e.next=16;break}return e.next=16,this.screenshotToCanvasAsync(_,r,d,f,g,devicePixelRatio);case 16:(b=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",b.src=y.toDataURL(),b.onload=function(){y.remove()},b.onerror=function(){y.remove(),b.remove()},o.append(b),getComputedStyle(o).position||(o.style.position="relative");case 18:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(n)&&n.isWritable?Qc.InternalMsgEmitter.on(e,t):o.call(n.callbacks,e,t)},_callbacksOnce:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(n)&&n.isWritable?Qc.InternalMsgEmitter.on(e,t):u.call(n.callbacks,e,t)},_callbacksOff:function(e,t){i.logger.info("[ApplianceMultiPlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(n)&&n.isWritable?Qc.InternalMsgEmitter.off(e,t):a.call(n.callbacks,e,t)},canRedoSteps:function(){if(i.logger.info("[ApplianceMultiPlugin] canRedoSteps"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,t=null==e?void 0:e.focusScenePath;if(e&&t)return e.displayer.commiter.redoStack.filter((function(e){return e.scenePath===t})).length}return 0},canUndoSteps:function(){if(i.logger.info("[ApplianceMultiPlugin] canUndoSteps"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,t=null==e?void 0:e.focusScenePath;if(e&&t)return e.displayer.commiter.undoStack.filter((function(e){return e.scenePath===t})).length}return 0},undo:function(){return i.logger.info("[ApplianceMultiPlugin] undo"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceMultiPlugin] redo"),i.currentManager&&A.isRoom(n)&&!n.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(){i.logger.info("[ApplianceMultiPlugin] cleanCurrentScene"),i.currentManager&&A.isRoom(n)&&n.isWritable&&(i.currentManager.cleanCurrentScene(),l.call(t))},insertImage:function(e){i.logger.info("[ApplianceMultiPlugin] insertImage"),i.currentManager&&A.isRoom(n)&&n.isWritable&&i.currentManager.worker.insertImage("mainView",e)},lockImage:function(e,t){i.logger.info("[ApplianceMultiPlugin] lockImage"),i.currentManager&&A.isRoom(n)&&n.isWritable&&i.currentManager.worker.lockImage("mainView",e,t)},completeImageUpload:function(e,t){i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&A.isRoom(n)&&n.isWritable&&i.currentManager.worker.completeImageUpload("mainView",e,t)},getImagesInformation:function(e){return i.logger.info("[ApplianceMultiPlugin] completeImageUpload"),i.currentManager&&A.isRoom(n)&&n.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return i.logger.info("[ApplianceMultiPlugin] callbacks bind"),c(c({},n.callbacks),{},{on:f._callbacksOn.bind(f),once:f._callbacksOnce.bind(f),off:f._callbacksOff.bind(f)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceMultiPlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0)},setMemberState:function(e){i.logger.info("[ApplianceMultiPlugin] setMemberState");var r=Object.keys(e);if(A.isRoom(n)&&n.isWritable)return r.includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===B.laserPen?(e.currentApplianceName=B.pencil,e.useLaserPen=!0):e.currentApplianceName&&e.currentApplianceName===B.pencil&&(e.useLaserPen=!1)),void h.call(t.mainView,e);throw new Error("[ApplianceMultiPlugin] setMemberState must be called in writable room")},setPerformancePriority:function(e){i.logger.info("[ApplianceMultiPlugin] setPriority"),i.currentManager&&i.currentManager.setPriority(e)}},(p=function(e,t){i.logger.info("[ApplianceMultiPlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||k(e[t])>"u"?e[t]=f[t]:"callbacks"===t&&(e.callbacks.on=f._callbacksOn.bind(f),e.callbacks.off=f._callbacksOff.bind(f),e.callbacks.once=f._callbacksOnce.bind(f))})(t,"undo"),p(t,"redo"),p(t,"cleanCurrentScene"),p(t,"insertImage"),p(t,"completeImageUpload"),p(t,"lockImage"),p(n,"getImagesInformation"),p(n,"callbacks"),p(n,"screenshotToCanvasAsync"),p(n,"getBoundingRectAsync"),p(n,"scenePreviewAsync"),p(n,"fillSceneSnapshotAsync"),p(t.mainView,"setMemberState"),Object.defineProperty(t,"canUndoSteps",{get:function(){return f.canUndoSteps()}}),Object.defineProperty(t,"canRedoSteps",{get:function(){return f.canRedoSteps()}}),Qc.InternalMsgEmitter.on("onCanUndoStepsUpdate",(function(e){t.emitter.emit("canUndoStepsChange",e)})),Qc.InternalMsgEmitter.on("onCanRedoStepsUpdate",(function(e){t.emitter.emit("canRedoStepsChange",e)})),v=c(c({},f),{},{callbacks:f.callbacks()}),e.abrupt("return",(t._appliancePlugin=v,t._appliancePlugin));case 15:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createApplianceMultiPlugin",value:(t=s(regeneratorRuntime.mark((function e(t,r){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.createInvisiblePlugin(i,{});case 3:e.next=16;break;case 5:if(e.prev=5,e.t0=e.catch(0),t.isWritable){e.next=16;break}return e.next=10,t.setWritable(!0);case 10:return e.next=12,this.createApplianceMultiPlugin(t,r);case 12:return n=e.sent,e.next=15,t.setWritable(!1);case 15:return e.abrupt("return",n);case 16:if(o=t.getInvisiblePlugin(r),e.t1=o,e.t1){e.next=22;break}return e.next=21,i.createApplianceMultiPlugin(t,r);case 21:o=e.sent;case 22:return e.abrupt("return",o);case 23:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,r){return t.apply(this,arguments)})}]),i}(A.InvisiblePlugin);I(Zc,"kind","appliance-multi-plugin"),I(Zc,"currentManager"),I(Zc,"logger",{info:console.log,warn:console.warn,error:console.error}),I(Zc,"options",ya),I(Zc,"createCurrentManager",(function(e,t,r){Zc.currentManager&&Zc.currentManager.destroy();var n={plugin:r,displayer:e.displayer,options:t},i=new Qc(n);Zc.logger.info("[ApplianceMultiPlugin] refresh ApplianceMultiManager object"),i.setWindowManager(e),Zc.currentManager=i}));var Kc=Zc,Jc=function(e){m(r,e);var t=y(r);function r(e,n){var i;return S(this,r),i=t.call(this,e,n),I(b(i),"width",1e3),I(b(i),"height",1e3),I(b(i),"dpr",1),I(b(i),"vDom"),I(b(i),"viewId",pu),I(b(i),"eventTragetElement"),I(b(i),"snapshotContainerRef"),I(b(i),"canvasContainerRef",L.createRef()),I(b(i),"subLocalCanvasContainerRef",L.createRef()),I(b(i),"canvasTopRef",L.createRef()),I(b(i),"canvasServiceFloatRef",L.createRef()),I(b(i),"canvasFloatRef",L.createRef()),I(b(i),"canvasBgRef",L.createRef()),I(b(i),"floatBarRef",L.createRef()),I(b(i),"containerOffset",{x:0,y:0}),i.control.hasOffscreenCanvas()||(i.snapshotContainerRef=L.createRef()),i}return M(r,[{key:"setCanvassStyle",value:function(){if(this.eventTragetElement){var e=this.eventTragetElement.offsetWidth,t=this.eventTragetElement.offsetHeight;e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=uu()),e&&t&&this.canvasContainerRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=uu(),this.width=e,this.height=t),e&&t&&this.canvasBgRef.current&&(e!==this.width||t!==this.height)&&(this.dpr=uu(this.canvasBgRef.current.getContext("2d")),this.width=e,this.height=t,this.canvasBgRef.current.width=e*this.dpr,this.canvasBgRef.current.height=t*this.dpr,this.canvasFloatRef.current&&(this.canvasFloatRef.current.width=e*this.dpr,this.canvasFloatRef.current.height=t*this.dpr),this.canvasServiceFloatRef.current&&(this.canvasServiceFloatRef.current.width=e*this.dpr,this.canvasServiceFloatRef.current.height=t*this.dpr),this.canvasTopRef.current&&(this.canvasTopRef.current.width=e*this.dpr,this.canvasTopRef.current.height=t*this.dpr))}}},{key:"createMainViewDisplayer",value:function(e){return this.vDom||(this.containerOffset=this.getContainerOffset(e,this.containerOffset),this.eventTragetElement=e.parentElement.children[0],e.innerHTML="",D.render(L.createElement(Yc,{viewId:this.viewId,mananger:this,refs:{canvasServiceFloatRef:this.canvasServiceFloatRef,canvasFloatRef:this.canvasFloatRef,canvasBgRef:this.canvasBgRef,floatBarRef:this.floatBarRef,canvasTopRef:this.canvasTopRef,canvasContainerRef:this.canvasContainerRef,snapshotContainerRef:this.snapshotContainerRef,subLocalCanvasContainerRef:this.subLocalCanvasContainerRef}}),e),this.control.room&&this.bindDisplayerEvent(this.eventTragetElement)),this}}]),r}(El),eh=function(e){m(i,e);var t,r=y(i);function i(e){var t;return S(this,i),t=r.call(this,e),I(b(t),"focuedViewId"),I(b(t),"control"),I(b(t),"focuedView"),t.control=e.control,t}return M(i,[{key:"bindMainView",value:function(){if(this.control.divMainView){var e=new Jc(this.control,bl.InternalMsgEmitter);this.focuedViewId=pu;var t=e.width,r=e.height,o={dpr:e.dpr,originalPoint:[t/2,r/2],offscreenCanvasOpt:c(c({},i.defaultScreenCanvasOpt),{},{width:t,height:r}),layerOpt:c(c({},i.defaultLayerOpt),{},{width:t,height:r}),cameraOpt:c(c({},i.defaultCameraOpt),{},{width:t,height:r})},a=this.control.room&&this.control.room.mainView||this.control.play&&this.control.play.mainView;if(a){var s=a.camera,u=s.scale,l=n(s,["scale"]);o.cameraOpt=c(c(c({},o.cameraOpt),l),{},{scale:u===1/0?1:u}),this.createMianView({id:pu,displayer:e,focusScenePath:a.focusScenePath||a.scenePath,cameraOpt:o.cameraOpt,viewData:a}),this.focuedView=this.mainView,e.createMainViewDisplayer(this.control.divMainView)}}}},{key:"getViewInitData",value:function(e){var t,r=this.getView(e);if(r){var o=r.displayer,a=o.width,s=o.height,u=o.dpr;null!=(t=this.control.pluginOptions.canvasOpt)&&t.contextType&&(i.defaultScreenCanvasOpt.contextType=this.control.pluginOptions.canvasOpt.contextType);var l={dpr:u,originalPoint:[a/2,s/2],offscreenCanvasOpt:c(c({},i.defaultScreenCanvasOpt),{},{width:a,height:s}),layerOpt:c(c({},i.defaultLayerOpt),{},{width:a,height:s}),cameraOpt:c(c({},i.defaultCameraOpt),{},{width:a,height:s})};if(r.viewData){var h=r.viewData.camera,d=h.scale,f=n(h,["scale"]);l.cameraOpt=c(c(c({},l.cameraOpt),f),{},{scale:d===1/0?1:d})}return l}}},{key:"mountView",value:(t=s(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.getView(t))){e.next=9;break}if(e.t0=this.control.worker.isActive,e.t0){e.next=7;break}return this.control.cursor.activeCollector(),e.next=7,this.control.activeWorker();case 7:(i=this.getViewInitData(t))&&(null==(r=this.control.worker)||r.createViewWorker(t,i)),n.focusScenePath&&this.control.collector&&this.control.worker.pullServiceData(t,n.focusScenePath,{isAsync:!0,useAnimation:!1});case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),i}(Ml),th=function(e){m(n,e);var t,r=y(n);function n(e){var t;S(this,n),t=r.call(this,e),I(b(t),"viewContainerManager"),I(b(t),"divMainView"),I(b(t),"onCameraChange",ml((function(e){var r,n=t.viewContainerManager.mainView;n&&n.cameraOpt&&(n.cameraOpt.width!==e.width||n.cameraOpt.height!==e.height)&&(null==(r=t.viewContainerManager.mainView)||r.displayer.updateSize()),t.viewContainerManager.setFocuedViewCameraOpt(e)}),20,{leading:!1}));var i={control:b(t),internalMsgEmitter:n.InternalMsgEmitter};return t.viewContainerManager=new eh(i),t}return M(n,[{key:"init",value:function(){var e=this;n.InternalMsgEmitter.on(G.BindMainView,(function(t){e.divMainView=t,e.plugin&&!e.viewContainerManager.mainView&&e.viewContainerManager.bindMainView()}))}},{key:"activePlugin",value:function(){var e=this;this.plugin&&this.divMainView&&!this.viewContainerManager.mainView&&this.viewContainerManager.bindMainView(),this.collector&&(this.collector.addStorageStateListener((function(t){var r,n;if(null!=(r=e.collector)&&r.storage&&0===Object.keys(e.collector.storage).length)null==(n=e.worker)||n.clearViewScenePath(pu,!0);else{var i,a,s=t.diffView,l=t.diffScenePath,c=t.diffData,h=new Map;if(s)Object.keys(s).forEach((function(t){var r,n=s[t];if(n&&!n.newValue)null==(r=e.worker)||r.clearViewScenePath(t,!0),n.oldValue&&(i=n.oldValue);else if(n&&n.newValue){for(var o=0,a=Object.keys(n.newValue);othis.maxScreenshotWidth&&(d=this.maxScreenshotWidth/c*d,c=this.maxScreenshotWidth),h>this.maxScreenshotHeight&&(d=Math.min(this.maxScreenshotHeight/h*d,d),h=this.maxScreenshotHeight),s.scale=d,f=document.createElement("canvas"),p=f.getContext("2d"),f.width=c*(u||1),f.height=h*(u||1),p&&(t.screenshotToCanvas(p,n,c,h,s,u),r.drawImage(f,Math.floor((o-c)/2),Math.floor((a-h)/2),c*(u||1),h*(u||1),0,0,c,h),f.remove()),e.t0=i.currentManager,!e.t0){e.next=11;break}return e.next=11,null==(l=i.currentManager)?void 0:l.screenshotToCanvas(r,n,c,h,s,Math.floor((o-c)/2),Math.floor((a-h)/2));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),scenePreviewAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,n,o,a,s){var u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"),t.scenePreview(r,n,o,a,s),(u=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",n.append(u),getComputedStyle(n).position||(n.style.position="relative"),e.t0=i.currentManager,!e.t0){e.next=9;break}return e.next=9,i.currentManager.scenePreview(r,u);case 9:case"end":return e.stop()}}),e)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),fillSceneSnapshotAsync:function(){var e=s(regeneratorRuntime.mark((function e(r,n,o,a,s){var u,l,c,h,d,f,p,v,m,g,y,_,b,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"),n.innerHTML="",t.fillSceneSnapshot(r,n,o,a,s),c=o||(null==(u=t.state.cameraState)?void 0:u.width)||0,h=a||(null==(l=t.state.cameraState)?void 0:l.height)||0,e.next=4,this.getBoundingRectAsync(r);case 4:if((d=e.sent)||(d={originX:0,originY:0,width:c,height:h}),f=Math.max(null==d?void 0:d.width,c),p=Math.max(null==d?void 0:d.height,h),v=1,m=f>c&&Math.min(c/f,v)||v,g=p>h&&Math.min(h/p,v)||v,m<=g?(f=m<1&&c||f,p=Math.floor(p*m)+1,v=m):m>g&&(p=g<1&&h||p,f=Math.floor(f*g)+1,v=g),y={scale:v,centerX:d.originX+d.width/2,centerY:d.originY+d.height/2},_=document.createElement("canvas"),b=_.getContext("2d"),_.width=f,_.height=p,e.t0=b,!e.t0){e.next=16;break}return e.next=16,this.screenshotToCanvasAsync(b,r,f,p,y,devicePixelRatio);case 16:(x=document.createElement("img")).className="appliance-plugin-fill-scene-snapshot-img",x.src=_.toDataURL(),x.onload=function(){_.remove()},x.onerror=function(){_.remove(),x.remove()},n.append(x),getComputedStyle(n).position||(n.style.position="relative");case 18:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o){return e.apply(this,arguments)}}(),_callbacksOn:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(t)&&t.isWritable?th.InternalMsgEmitter.on(e,r):n.call(t.callbacks,e,r)},_callbacksOnce:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(t)&&t.isWritable?th.InternalMsgEmitter.on(e,r):a.call(t.callbacks,e,r)},_callbacksOff:function(e,r){i.logger.info("[ApplianceSinglePlugin] callbacks ".concat(e)),("onCanUndoStepsUpdate"===e||"onCanRedoStepsUpdate"===e)&&A.isRoom(t)&&t.isWritable?th.InternalMsgEmitter.off(e,r):o.call(t.callbacks,e,r)},canRedoSteps:function(){if(i.logger.info("[ApplianceSinglePlugin] canRedoSteps"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,r=null==e?void 0:e.focusScenePath;if(e&&r)return e.displayer.commiter.redoStack.filter((function(e){return e.scenePath===r})).length}return 0},canUndoSteps:function(){if(i.logger.info("[ApplianceSinglePlugin] canUndoSteps"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization){var e=i.currentManager.viewContainerManager.focuedView,r=null==e?void 0:e.focusScenePath;if(e&&r)return e.displayer.commiter.undoStack.filter((function(e){return e.scenePath===r})).length}return 0},undo:function(){return i.logger.info("[ApplianceSinglePlugin] undo"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.undo():0},redo:function(){return i.logger.info("[ApplianceSinglePlugin] redo"),i.currentManager&&A.isRoom(t)&&!t.disableSerialization?i.currentManager.viewContainerManager.redo():0},cleanCurrentScene:function(e){i.logger.info("[ApplianceSinglePlugin] cleanCurrentScene"),i.currentManager&&A.isRoom(t)&&t.isWritable&&(i.currentManager.cleanCurrentScene(),u.call(t,e))},insertImage:function(e){i.logger.info("[ApplianceSinglePlugin] insertImage"),i.currentManager&&A.isRoom(t)&&t.isWritable&&i.currentManager.worker.insertImage("mainView",e)},lockImage:function(e,r){i.logger.info("[ApplianceSinglePlugin] lockImage"),i.currentManager&&A.isRoom(t)&&t.isWritable&&i.currentManager.worker.lockImage("mainView",e,r)},completeImageUpload:function(e,r){i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&A.isRoom(t)&&t.isWritable&&i.currentManager.worker.completeImageUpload("mainView",e,r)},getImagesInformation:function(e){return i.logger.info("[ApplianceSinglePlugin] completeImageUpload"),i.currentManager&&A.isRoom(t)&&t.isWritable?i.currentManager.worker.getImagesInformation(e):[]},callbacks:function(){return c(c({},t.callbacks),{},{on:d._callbacksOn.bind(d),once:d._callbacksOnce.bind(d),off:d._callbacksOff.bind(d)})},destroy:function(){i.currentManager&&(i.logger.info("[ApplianceSinglePlugin] destroy"),i.currentManager.destroy(),i.currentManager=void 0,i.cursorAdapter=void 0)},setMemberState:function(e){i.logger.info("[ApplianceSinglePlugin] setMemberState");var r=Object.keys(e);if(A.isRoom(t)&&t.isWritable)return r.includes("currentApplianceName")&&(e.currentApplianceName&&e.currentApplianceName===B.laserPen?(e.currentApplianceName=B.pencil,e.useLaserPen=!0):e.currentApplianceName&&e.currentApplianceName===B.pencil&&(e.useLaserPen=!1)),void l(e);throw new Error("setMemberState must be called in writable room")},setPerformancePriority:function(e){i.logger.info("[ApplianceSinglePlugin] setPriority"),i.currentManager&&i.currentManager.setPriority(e)}},(f=function(e,t){i.logger.info("[ApplianceSinglePlugin] injectMethodToObject ".concat(t)),"function"==typeof e[t]||k(e[t])>"u"?e[t]=d[t]:"callbacks"===t&&(e.callbacks.on=d._callbacksOn.bind(d),e.callbacks.off=d._callbacksOff.bind(d),e.callbacks.once=d._callbacksOnce.bind(d))})(t,"undo"),f(t,"redo"),f(t,"cleanCurrentScene"),f(t,"insertImage"),f(t,"completeImageUpload"),f(t,"lockImage"),f(t,"getImagesInformation"),f(t,"callbacks"),f(t,"screenshotToCanvasAsync"),f(t,"getBoundingRectAsync"),f(t,"scenePreviewAsync"),f(t,"fillSceneSnapshotAsync"),f(t,"setMemberState"),Object.defineProperty(t,"canUndoSteps",{get:function(){return d.canUndoSteps()}}),Object.defineProperty(t,"canRedoSteps",{get:function(){return d.canRedoSteps()}}),p=c(c({},d),{},{callbacks:d.callbacks()}),e.abrupt("return",(t._appliancePlugin=p,t._appliancePlugin));case 16:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"onCreate",value:function(e){e&&i.currentManager&&(i.currentManager.bindPlugin(e),e.init(e.displayer))}},{key:"createAppliancePlugin",value:(t=s(regeneratorRuntime.mark((function e(t,r){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.createInvisiblePlugin(i,{});case 3:e.next=16;break;case 5:if(e.prev=5,e.t0=e.catch(0),t.isWritable){e.next=16;break}return e.next=10,t.setWritable(!0);case 10:return e.next=12,this.createAppliancePlugin(t,r);case 12:return n=e.sent,e.next=15,t.setWritable(!1);case 15:return e.abrupt("return",n);case 16:if(o=t.getInvisiblePlugin(r),e.t1=o,e.t1){e.next=22;break}return e.next=21,i.createAppliancePlugin(t,r);case 21:o=e.sent;case 22:return e.abrupt("return",o);case 23:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,r){return t.apply(this,arguments)})},{key:"effectInstance",value:function(){if(i.cursorAdapter){var e=i.cursorAdapter.onAddedCursor;i.cursorAdapter.onAddedCursor=function(t){t.onCursorMemberChanged=function(e){try{e.appliance===B.pencil||e.appliance===B.shape||e.appliance===B.text||e.appliance===B.arrow||e.appliance===B.straight||e.appliance===B.rectangle||e.appliance===B.ellipse||e.appliance===B.eraser?null!=t&&t.divElement&&(t.divElement.style.display="none"):null!=t&&t.divElement&&(t.divElement.style.display="block")}catch(e){}},e.call(i.cursorAdapter,t)}}}}]),i}(A.InvisiblePlugin);I(rh,"kind","appliance-aids-single-plugin"),I(rh,"cursorAdapter"),I(rh,"currentManager"),I(rh,"logger",{info:console.log,warn:console.warn,error:console.error}),I(rh,"options",ya),I(rh,"createCurrentManager",(function(e,t,r){rh.currentManager&&rh.currentManager.destroy();var n=new th({plugin:r,displayer:e,options:t});n.init(),rh.logger.info("[ApplianceSinglePlugin] refresh ApplianceSingleManager object"),rh.currentManager=n}));var nh=rh,ih=function(e){m(r,e);var t=y(r);function r(){var e;return S(this,r),e=t.apply(this,arguments),I(b(e),"mainViewRef",null),e}return M(r,[{key:"componentDidMount",value:function(){r.emiter||(r.emiter=th.InternalMsgEmitter),r.emiter.emit(G.BindMainView,this.mainViewRef)}},{key:"render",value:function(){var e=this;return L.createElement(L.Fragment,null,this.props.children,L.createElement("div",{className:"appliance-plugin-main-view-displayer",ref:function(t){return e.mainViewRef=t}}))}}]),r}(L.Component);I(ih,"emiter");var oh=ih;t.ActiveContainerType=V,t.ApplianceMultiPlugin=Kc,t.ApplianceNames=B,t.ApplianceSigleWrapper=oh,t.ApplianceSinglePlugin=nh,t.Cursor_Hover_Id="cursorhover",t.DefaultAppliancePluginOptions=ya,t.ECanvasShowType=q,t.EDataType=Y,t.EMatrixrRelationType=ee,t.EPostMessageType=X,t.EScaleType=K,t.EStrokeType=U,t.EToolsKey=H,t.ElayerType=Z,t.EmitEventType=W,t.EventMessageType=Q,t.EvevtWorkState=$,t.EvevtWorkType=J,t.InternalMsgEmitterType=G,t.Main_View_Id=pu,t.ShapeType=F,t.Storage_Selector_key=Ca,t.Storage_Splitter=Aa,t.Storage_ViewId_ALL=Pa,t.Task_Time_Interval=20,t.ViewContainerManager=Ml,t.checkOp=function(e){var t,r=f(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(isNaN(n)||n===1/0||n===-1/0)return!1}}catch(e){r.e(e)}finally{r.f()}return!0},t.cloneDeep=pa,t.computRect=Ys,t.fullWorker="/fullWorker.js",t.getRectMatrixrRelation=function(e,t){return e.x+e.wt.x+t.w||e.y+e.ht.y+t.h?ee.outside:e.x>=t.x&&e.y>=t.y&&e.x+e.w<=t.x+t.w&&e.y+e.h<=t.y+t.h?ee.inside:ee.intersect},t.getShapeInstance=Vs,t.getShapeTools=Gs,t.isBoolean=Rs,t.isEqual=xs,t.isIntersect=qs,t.isIntersectForPoint=tu,t.isNumber=Ie,t.isSet=zo,t.subWorker="/subWorker.js",t.throttle=ml,t.transformToNormalData=wa,t.transformToSerializableData=Sa},15599:function(e,t,r){var n;function i(e){return i="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},i(e)} /*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 @@ -314,4 +314,4 @@ PERFORMANCE OF THIS SOFTWARE. * LICENSE file in the root directory of this source tree. */ var Uu=xt.exports,Fu=Et,Wu=zu.exports;function Gu(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rt}return!1}function Cl(e,t,r,n,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o}var Pl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){Pl[e]=new Cl(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];Pl[t]=new Cl(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){Pl[e]=new Cl(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){Pl[e]=new Cl(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){Pl[e]=new Cl(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){Pl[e]=new Cl(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){Pl[e]=new Cl(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){Pl[e]=new Cl(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){Pl[e]=new Cl(e,5,!1,e.toLowerCase(),null,!1)}));var Nl=/[\-:]([a-z])/g;function Ol(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(Nl,Ol);Pl[t]=new Cl(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Nl,Ol);Pl[t]=new Cl(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Nl,Ol);Pl[t]=new Cl(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){Pl[e]=new Cl(e,1,!1,e.toLowerCase(),null,!1)})),Pl.xlinkHref=new Cl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){Pl[e]=new Cl(e,1,!1,e.toLowerCase(),null,!0)}));var Rl=Uu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Dl(e,t,r,n){var i=Pl.hasOwnProperty(t)?Pl[t]:null;(null!==i?0===i.type:!n&&!(!(2=r.length))throw Error(Gu(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:rc(r)}}function mc(e,t){var r=rc(t.value),n=rc(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function gc(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var yc="http://www.w3.org/1999/xhtml",_c="http://www.w3.org/2000/svg";function bc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xc(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?bc(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var wc,Sc=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction((function(){return e(t,r)}))}:e}((function(e,t){if(e.namespaceURI!==_c||"innerHTML"in e)e.innerHTML=t;else{for((wc=wc||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=wc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Tc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}function Mc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var kc={animationend:Mc("Animation","AnimationEnd"),animationiteration:Mc("Animation","AnimationIteration"),animationstart:Mc("Animation","AnimationStart"),transitionend:Mc("Transition","TransitionEnd")},Ec={},Ic={};function Ac(e){if(Ec[e])return Ec[e];if(!kc[e])return e;var t,r=kc[e];for(t in r)if(r.hasOwnProperty(t)&&t in Ic)return Ec[e]=r[t];return e}cl&&(Ic=document.createElement("div").style,"AnimationEvent"in window||(delete kc.animationend.animation,delete kc.animationiteration.animation,delete kc.animationstart.animation),"TransitionEvent"in window||delete kc.transitionend.transition);var Cc=Ac("animationend"),Pc=Ac("animationiteration"),Nc=Ac("animationstart"),Oc=Ac("transitionend"),Rc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dc=new("function"==typeof WeakMap?WeakMap:Map);function Lc(e){var t=Dc.get(e);return void 0===t&&(t=new Map,Dc.set(e,t)),t}function jc(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function zc(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Bc(e){if(jc(e)!==e)throw Error(Gu(188))}function Uc(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=jc(e)))throw Error(Gu(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(n=i.return)){r=n;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===r)return Bc(i),e;if(o===n)return Bc(i),t;o=o.sibling}throw Error(Gu(188))}if(r.return!==n.return)r=i,n=o;else{for(var a=!1,s=i.child;s;){if(s===r){a=!0,r=i,n=o;break}if(s===n){a=!0,n=i,r=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===r){a=!0,r=o,n=i;break}if(s===n){a=!0,n=o,r=i;break}s=s.sibling}if(!a)throw Error(Gu(189))}}if(r.alternate!==n)throw Error(Gu(190))}if(3!==r.tag)throw Error(Gu(188));return r.stateNode.current===r?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Fc(e,t){if(null==t)throw Error(Gu(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Wc(e,t,r){Array.isArray(e)?e.forEach(t,r):e&&t.call(r,e)}var Gc=null;function Vc(e){if(e){var t=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(t))for(var n=0;nXc.length&&Xc.push(e)}function Qc(e,t,r,n){if(Xc.length){var i=Xc.pop();return i.topLevelType=e,i.eventSystemFlags=n,i.nativeEvent=t,i.targetInst=r,i}return{topLevelType:e,eventSystemFlags:n,nativeEvent:t,targetInst:r,ancestors:[]}}function Zc(e){var t=e.targetInst,r=t;do{if(!r){e.ancestors.push(r);break}var n=r;if(3===n.tag)n=n.stateNode.containerInfo;else{for(;n.return;)n=n.return;n=3!==n.tag?null:n.stateNode.containerInfo}if(!n)break;5!==(t=r.tag)&&6!==t||e.ancestors.push(r),r=fd(n)}while(r);for(r=0;r=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xh(n)}}function Qh(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Qh(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Zh(){for(var e=window,t=$h();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=$h((e=t.contentWindow).document)}return t}function Kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Jh="$?",ed="$!",td=null,rd=null;function nd(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function id(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==x(t.dangerouslySetInnerHTML)&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var od="function"==typeof setTimeout?setTimeout:void 0,ad="function"==typeof clearTimeout?clearTimeout:void 0;function sd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function ud(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||r===ed||r===Jh){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var ld=Math.random().toString(36).slice(2),cd="__reactInternalInstance$"+ld,hd="__reactEventHandlers$"+ld,dd="__reactContainere$"+ld;function fd(e){var t=e[cd];if(t)return t;for(var r=e.parentNode;r;){if(t=r[dd]||r[cd]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=ud(e);null!==e;){if(r=e[cd])return r;e=ud(e)}return t}r=(e=r).parentNode}return null}function pd(e){return!(e=e[cd]||e[dd])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function vd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Gu(33))}function md(e){return e[hd]||null}function gd(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function yd(e,t){var r=e.stateNode;if(!r)return null;var n=Zu(r);if(!n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(Gu(231,t,x(r)));return r}function _d(e,t,r){(t=yd(e,r.dispatchConfig.phasedRegistrationNames[t]))&&(r._dispatchListeners=Fc(r._dispatchListeners,t),r._dispatchInstances=Fc(r._dispatchInstances,e))}function bd(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,r=[];t;)r.push(t),t=gd(t);for(t=r.length;0this.eventPool.length&&this.eventPool.push(e)}function Od(e){e.eventPool=[],e.getPooled=Pd,e.release=Nd}Fu(Cd.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Id)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Id)},persist:function(){this.isPersistent=Id},isPersistent:Ad,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Ad,this._dispatchInstances=this._dispatchListeners=null}}),Cd.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Cd.extend=function(e){function t(){}function r(){return n.apply(this,arguments)}var n=this;t.prototype=n.prototype;var i=new t;return Fu(i,r.prototype),r.prototype=i,r.prototype.constructor=r,r.Interface=Fu({},n.Interface,e),r.extend=n.extend,Od(r),r},Od(Cd);var Rd=Cd.extend({data:null}),Dd=Cd.extend({data:null}),Ld=[9,13,27,32],jd=cl&&"CompositionEvent"in window,zd=null;cl&&"documentMode"in document&&(zd=document.documentMode);var Bd=cl&&"TextEvent"in window&&!zd,Ud=cl&&(!jd||zd&&8=zd),Fd=String.fromCharCode(32),Wd={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Gd=!1;function Vd(e,t){switch(e){case"keyup":return-1!==Ld.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Hd(e){return"object"==x(e=e.detail)&&"data"in e?e.data:null}var Yd=!1;var $d={eventTypes:Wd,extractEvents:function(e,t,r,n){var i;if(jd)e:{switch(e){case"compositionstart":var o=Wd.compositionStart;break e;case"compositionend":o=Wd.compositionEnd;break e;case"compositionupdate":o=Wd.compositionUpdate;break e}o=void 0}else Yd?Vd(e,r)&&(o=Wd.compositionEnd):"keydown"===e&&229===r.keyCode&&(o=Wd.compositionStart);return o?(Ud&&"ko"!==r.locale&&(Yd||o!==Wd.compositionStart?o===Wd.compositionEnd&&Yd&&(i=Ed()):(Md="value"in(Td=n)?Td.value:Td.textContent,Yd=!0)),o=Rd.getPooled(o,t,r,n),i?o.data=i:null!==(i=Hd(r))&&(o.data=i),Sd(o),i=o):i=null,(e=Bd?function(e,t){switch(e){case"compositionend":return Hd(t);case"keypress":return 32!==t.which?null:(Gd=!0,Fd);case"textInput":return(e=t.data)===Fd&&Gd?null:e;default:return null}}(e,r):function(e,t){if(Yd)return"compositionend"===e||!jd&&Vd(e,t)?(e=Ed(),kd=Md=Td=null,Yd=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,If={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Af=null,Cf=null,Pf=null,Nf=!1;function Of(e,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Nf||null==Af||Af!==$h(r)?null:("selectionStart"in(r=Af)&&Kh(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Pf&&kf(Pf,r)?null:(Pf=r,(e=Cd.getPooled(If.select,Cf,e,t)).type="select",e.target=Af,Sd(e),e))}var Rf={eventTypes:If,extractEvents:function(e,t,r,n,i,o){if(!(o=!(i=o||(n.window===n?n.document:9===n.nodeType?n:n.ownerDocument)))){e:{i=Lc(i),o=ul.onSelect;for(var a=0;aXf||(e.current=$f[Xf],$f[Xf]=null,Xf--)}function Qf(e,t){Xf++,$f[Xf]=e.current,e.current=t}var Zf={},Kf={current:Zf},Jf={current:!1},ep=Zf;function tp(e,t){var r=e.type.contextTypes;if(!r)return Zf;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in r)o[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rp(e){return null!=(e=e.childContextTypes)}function np(){qf(Jf),qf(Kf)}function ip(e,t,r){if(Kf.current!==Zf)throw Error(Gu(168));Qf(Kf,t),Qf(Jf,r)}function op(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in e))throw Error(Gu(108,ec(t)||"Unknown",i));return Fu({},r,{},n)}function ap(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zf,ep=Kf.current,Qf(Kf,e),Qf(Jf,Jf.current),!0}function sp(e,t,r){var n=e.stateNode;if(!n)throw Error(Gu(169));r?(e=op(e,t,ep),n.__reactInternalMemoizedMergedChildContext=e,qf(Jf),qf(Kf),Qf(Kf,e)):qf(Jf),Qf(Jf,r)}var up=Wu.unstable_runWithPriority,lp=Wu.unstable_scheduleCallback,cp=Wu.unstable_cancelCallback,hp=Wu.unstable_requestPaint,dp=Wu.unstable_now,fp=Wu.unstable_getCurrentPriorityLevel,pp=Wu.unstable_ImmediatePriority,vp=Wu.unstable_UserBlockingPriority,mp=Wu.unstable_NormalPriority,gp=Wu.unstable_LowPriority,yp=Wu.unstable_IdlePriority,_p={},bp=Wu.unstable_shouldYield,xp=void 0!==hp?hp:function(){},wp=null,Sp=null,Tp=!1,Mp=dp(),kp=1e4>Mp?dp:function(){return dp()-Mp};function Ep(){switch(fp()){case pp:return 99;case vp:return 98;case mp:return 97;case gp:return 96;case yp:return 95;default:throw Error(Gu(332))}}function Ip(e){switch(e){case 99:return pp;case 98:return vp;case 97:return mp;case 96:return gp;case 95:return yp;default:throw Error(Gu(332))}}function Ap(e,t){return e=Ip(e),up(e,t)}function Cp(e,t,r){return e=Ip(e),lp(e,t,r)}function Pp(e){return null===wp?(wp=[e],Sp=lp(pp,Op)):wp.push(e),_p}function Np(){if(null!==Sp){var e=Sp;Sp=null,cp(e)}Op()}function Op(){if(!Tp&&null!==wp){Tp=!0;var e=0;try{var t=wp;Ap(99,(function(){for(;e=t&&(mm=!0),e.firstContext=null)}function Vp(e,t){if(Bp!==e&&!1!==t&&0!==t)if(("number"!=typeof t||1073741823===t)&&(Bp=e,t=1073741823),t={context:e,observedBits:t,next:null},null===zp){if(null===jp)throw Error(Gu(308));zp=t,jp.dependencies={expirationTime:0,firstContext:t,responders:null}}else zp=zp.next=t;return e._currentValue}var Hp=!1;function Yp(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function $p(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Xp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function qp(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function Qp(e,t){var r=e.alternate;null!==r&&$p(r,e),null===(r=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=r.next,r.next=t)}function Zp(e,t,r,n){var i=e.updateQueue;Hp=!1;var o=i.baseQueue,a=i.shared.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}o=a,i.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=a))}if(null!==o){s=o.next;var u=i.baseState,l=0,c=null,h=null,d=null;if(null!==s)for(var f=s;;){if((a=f.expirationTime)l&&(l=a)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:f.suspenseConfig,tag:f.tag,payload:f.payload,callback:f.callback,next:null}),qg(a,f.suspenseConfig);e:{var v=e,m=f;switch(a=t,p=r,m.tag){case 1:if("function"==typeof(v=m.payload)){u=v.call(p,u,a);break e}u=v;break e;case 3:v.effectTag=-4097&v.effectTag|64;case 0:if(null==(a="function"==typeof(v=m.payload)?v.call(p,u,a):v))break e;u=Fu({},u,a);break e;case 2:Hp=!0}}null!==f.callback&&(e.effectTag|=32,null===(a=i.effects)?i.effects=[f]:a.push(f))}if(null===(f=f.next)||f===s){if(null===(a=i.shared.pending))break;f=o.next=a.next,a.next=s,i.baseQueue=o=a,i.shared.pending=null}}null===d?c=u:d.next=h,i.baseState=c,i.baseQueue=d,Qg(l),e.expirationTime=l,e.memoizedState=u}}function Kp(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;tv?(m=p,p=null):m=p.sibling;var g=d(i,p,s[v],u);if(null===g){null===p&&(p=m);break}e&&p&&null===g.alternate&&t(i,p),a=o(g,a,v),null===c?l=g:c.sibling=g,c=g,p=m}if(v===s.length)return r(i,p),l;if(null===p){for(;vv?(m=p,p=null):m=p.sibling;var y=d(i,p,g.value,u);if(null===y){null===p&&(p=m);break}e&&p&&null===y.alternate&&t(i,p),a=o(y,a,v),null===c?l=y:c.sibling=y,c=y,p=m}if(g.done)return r(i,p),l;if(null===p){for(;!g.done;v++,g=s.next())null!==(g=h(i,g.value,u))&&(a=o(g,a,v),null===c?l=g:c.sibling=g,c=g);return l}for(p=n(i,p);!g.done;v++,g=s.next())null!==(g=f(p,i,v,g.value,u))&&(e&&null!==g.alternate&&p.delete(null===g.key?v:g.key),a=o(g,a,v),null===c?l=g:c.sibling=g,c=g);return e&&p.forEach((function(e){return t(i,e)})),l}(s,u,l,c);if(v&&lv(s,l),void 0===l&&!p)switch(s.tag){case 1:case 0:throw s=s.type,Error(Gu(152,s.displayName||s.name||"Component"))}return r(s,u)}}var hv=cv(!0),dv=cv(!1),fv={},pv={current:fv},vv={current:fv},mv={current:fv};function gv(e){if(e===fv)throw Error(Gu(174));return e}function yv(e,t){switch(Qf(mv,t),Qf(vv,e),Qf(pv,fv),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xc(null,"");break;default:t=xc(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}qf(pv),Qf(pv,t)}function _v(){qf(pv),qf(vv),qf(mv)}function bv(e){gv(mv.current);var t=gv(pv.current),r=xc(t,e.type);t!==r&&(Qf(vv,e),Qf(pv,r))}function xv(e){vv.current===e&&(qf(pv),qf(vv))}var wv={current:0};function Sv(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||r.data===Jh||r.data===ed))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Tv(e,t){return{responder:e,props:t}}var Mv=Rl.ReactCurrentDispatcher,kv=Rl.ReactCurrentBatchConfig,Ev=0,Iv=null,Av=null,Cv=null,Pv=!1;function Nv(){throw Error(Gu(321))}function Ov(e,t){if(null===t)return!1;for(var r=0;ro))throw Error(Gu(301));o+=1,Cv=Av=null,t.updateQueue=null,Mv.current=om,e=r(n,i)}while(t.expirationTime===Ev)}if(Mv.current=rm,t=null!==Av&&null!==Av.next,Ev=0,Cv=Av=Iv=null,Pv=!1,t)throw Error(Gu(300));return e}function Dv(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Cv?Iv.memoizedState=Cv=e:Cv=Cv.next=e,Cv}function Lv(){if(null===Av){var e=Iv.alternate;e=null!==e?e.memoizedState:null}else e=Av.next;var t=null===Cv?Iv.memoizedState:Cv.next;if(null!==t)Cv=t,Av=e;else{if(null===e)throw Error(Gu(310));e={memoizedState:(Av=e).memoizedState,baseState:Av.baseState,baseQueue:Av.baseQueue,queue:Av.queue,next:null},null===Cv?Iv.memoizedState=Cv=e:Cv=Cv.next=e}return Cv}function jv(e,t){return"function"==typeof t?t(e):t}function zv(e){var t=Lv(),r=t.queue;if(null===r)throw Error(Gu(311));r.lastRenderedReducer=e;var n=Av,i=n.baseQueue,o=r.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}n.baseQueue=i=o,r.pending=null}if(null!==i){i=i.next,n=n.baseState;var s=a=o=null,u=i;do{var l=u.expirationTime;if(lIv.expirationTime&&(Iv.expirationTime=l,Qg(l))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:u.suspenseConfig,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),qg(l,u.suspenseConfig),n=u.eagerReducer===e?u.eagerState:e(n,u.action);u=u.next}while(null!==u&&u!==i);null===s?o=n:s.next=a,Tf(n,t.memoizedState)||(mm=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=s,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function Bv(e){var t=Lv(),r=t.queue;if(null===r)throw Error(Gu(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,o=t.memoizedState;if(null!==i){r.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);Tf(o,t.memoizedState)||(mm=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function Uv(e){var t=Dv();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:jv,lastRenderedState:e}).dispatch=tm.bind(null,Iv,e),[t.memoizedState,e]}function Fv(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=Iv.updateQueue)?(t={lastEffect:null},Iv.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Wv(){return Lv().memoizedState}function Gv(e,t,r,n){var i=Dv();Iv.effectTag|=e,i.memoizedState=Fv(1|t,r,void 0,void 0===n?null:n)}function Vv(e,t,r,n){var i=Lv();n=void 0===n?null:n;var o=void 0;if(null!==Av){var a=Av.memoizedState;if(o=a.destroy,null!==n&&Ov(n,a.deps))return void Fv(t,r,o,n)}Iv.effectTag|=e,i.memoizedState=Fv(1|t,r,o,n)}function Hv(e,t){return Gv(516,4,e,t)}function Yv(e,t){return Vv(516,4,e,t)}function $v(e,t){return Vv(4,2,e,t)}function Xv(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function qv(e,t,r){return r=null!=r?r.concat([e]):null,Vv(4,2,Xv.bind(null,t,e),r)}function Qv(){}function Zv(e,t){return Dv().memoizedState=[e,void 0===t?null:t],e}function Kv(e,t){var r=Lv();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&Ov(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Jv(e,t){var r=Lv();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&Ov(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function em(e,t,r){var n=Ep();Ap(98>n?98:n,(function(){e(!0)})),Ap(97<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=a.createElement(i,{is:n.is}):(e=a.createElement(i),"select"===i&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,i),e[cd]=t,e[hd]=n,km(e,t),t.stateNode=e,a=Gh(i,n),i){case"iframe":case"object":case"embed":Ph("load",e),s=n;break;case"video":case"audio":for(s=0;sn.tailExpiration&&1t)&&Ng.set(e,t))}}function Bg(e,t){e.expirationTime=(e=r>(e=e.nextKnownPendingLevel)?r:e)&&t!==e?0:e}function Fg(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Pp(Gg.bind(null,e));else{var t=Ug(e),r=e.callbackNode;if(0===t)null!==r&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var n=Lg();if(1073741823===t?n=99:1===t||2===t?n=95:n=0>=(n=10*(1073741821-t)-10*(1073741821-n))?99:250>=n?98:5250>=n?97:95,null!==r){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=n)return;r!==_p&&cp(r)}e.callbackExpirationTime=t,e.callbackPriority=n,t=1073741823===t?Pp(Gg.bind(null,e)):Cp(n,Wg.bind(null,e),{timeout:10*(1073741821-t)-kp()}),e.callbackNode=t}}}function Wg(e,t){if(Dg=0,t)return My(e,t=Lg()),Fg(e),null;var r=Ug(e);if(0!==r){if(t=e.callbackNode,0!=(48&fg))throw Error(Gu(327));if(oy(),e===pg&&r===mg||Yg(e,r),null!==vg){var n=fg;fg|=ug;for(var i=Xg();;)try{Kg();break}catch(t){$g(e,t)}if(Up(),fg=n,ag.current=i,1===gg)throw t=yg,Yg(e,r),Sy(e,r),Fg(e),t;if(null===vg)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=r,n=gg,pg=null,n){case cg:case 1:throw Error(Gu(345));case 2:My(e,2=r){e.lastPingedTime=r,Yg(e,r);break}}if(0!==(o=Ug(e))&&o!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}e.timeoutHandle=od(ry.bind(null,e),i);break}ry(e);break;case dg:if(Sy(e,r),r===(n=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=ty(i)),Sg&&(0===(i=e.lastPingedTime)||i>=r)){e.lastPingedTime=r,Yg(e,r);break}if(0!==(i=Ug(e))&&i!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}if(1073741823!==bg?n=10*(1073741821-bg)-kp():1073741823===_g?n=0:(n=10*(1073741821-_g)-5e3,0>(n=(i=kp())-n)&&(n=0),(r=10*(1073741821-r)-i)<(n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*og(n/1960))-n)&&(n=r)),10=(n=0|a.busyMinDurationMs)?n=0:(i=0|a.busyDelayMs,n=(o=kp()-(10*(1073741821-o)-(0|a.timeoutMs||5e3)))<=i?0:i+n-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+tc(a))}5!==gg&&(gg=2),s=zm(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=t,Qp(h,rg(h,u,t));break e;case 1:u=s;var b=h.type,w=h.stateNode;if(0==(64&h.effectTag)&&("function"==typeof b.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===Ig||!Ig.has(w)))){h.effectTag|=4096,h.expirationTime=t,Qp(h,ng(h,u,t));break e}}h=h.return}while(null!==h)}vg=ey(vg)}catch(e){t=e;continue}break}}function Xg(){var e=ag.current;return ag.current=rm,null===e?rm:e}function qg(e,t){e<_g&&2wg&&(wg=e)}function Zg(){for(;null!==vg;)vg=Jg(vg)}function Kg(){for(;null!==vg&&!bp();)vg=Jg(vg)}function Jg(e){var t=ig(e.alternate,e,mg);return e.memoizedProps=e.pendingProps,null===t&&(t=ey(e)),sg.current=null,t}function ey(e){vg=e;do{var t=vg.alternate;if(e=vg.return,0==(2048&vg.effectTag)){if(t=Lm(t,vg,mg),1===mg||1!==vg.childExpirationTime){for(var r=0,n=vg.child;null!==n;){var i=n.expirationTime,o=n.childExpirationTime;i>r&&(r=i),o>r&&(r=o),n=n.sibling}vg.childExpirationTime=r}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=vg.firstEffect),null!==vg.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=vg.firstEffect),e.lastEffect=vg.lastEffect),1(e=e.childExpirationTime)?t:e}function ry(e){var t=Ep();return Ap(99,ny.bind(null,e,t)),null}function ny(e,t){do{oy()}while(null!==Cg);if(0!=(48&fg))throw Error(Gu(327));var r=e.finishedWork,n=e.finishedExpirationTime;if(null===r)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,r===e.current)throw Error(Gu(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=ty(r);if(e.firstPendingTime=i,n<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n<=e.firstSuspendedTime&&(e.firstSuspendedTime=n-1),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===pg&&(vg=pg=null,mg=0),1s&&(l=s,s=a,a=l),l=qh(_,a),c=qh(_,s),l&&c&&(1!==x.rangeCount||x.anchorNode!==l.node||x.anchorOffset!==l.offset||x.focusNode!==c.node||x.focusOffset!==c.offset)&&((b=b.createRange()).setStart(l.node,l.offset),x.removeAllRanges(),a>s?(x.addRange(b),x.extend(c.node,c.offset)):(b.setEnd(c.node,c.offset),x.addRange(b))))),b=[],x=_);x=x.parentNode;)1===x.nodeType&&b.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof _.focus&&_.focus(),_=0;_=r?Cm(e,t,r):(Qf(wv,1&wv.current),null!==(t=Rm(e,t,r))?t.sibling:null);Qf(wv,1&wv.current);break;case 19:if(n=t.childExpirationTime>=r,0!=(64&e.effectTag)){if(n)return Om(e,t,r);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Qf(wv,wv.current),!n)return null}return Rm(e,t,r)}mm=!1}}else mm=!1;switch(t.expirationTime=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=tp(t,Kf.current),Gp(t,r),i=Rv(null,t,n,e,i,r),t.effectTag|=1,"object"==x(i)&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,rp(n)){var o=!0;ap(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Yp(t);var a=n.getDerivedStateFromProps;"function"==typeof a&&tv(t,n,a,e),i.updater=rv,t.stateNode=i,i._reactInternalFiber=t,av(t,n,e,r),t=Tm(null,t,n,!0,o,r)}else t.tag=0,gm(null,t,i,r),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"==typeof e)return vy(e)?1:0;if(null!=e){if((e=e.$$typeof)===Yl)return 11;if(e===ql)return 14}return 2}(i),e=Dp(i,e),o){case 0:t=wm(null,t,i,e,r);break e;case 1:t=Sm(null,t,i,e,r);break e;case 11:t=ym(null,t,i,e,r);break e;case 14:t=_m(null,t,i,Dp(i.type,e),n,r);break e}throw Error(Gu(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,wm(e,t,n,i=t.elementType===n?i:Dp(n,i),r);case 1:return n=t.type,i=t.pendingProps,Sm(e,t,n,i=t.elementType===n?i:Dp(n,i),r);case 3:if(Mm(t),n=t.updateQueue,null===e||null===n)throw Error(Gu(282));if(n=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,$p(e,t),Zp(t,n,null,r),(n=t.memoizedState.element)===i)pm(),t=Rm(e,t,r);else{if((i=t.stateNode.hydrate)&&(sm=sd(t.stateNode.containerInfo.firstChild),am=t,i=um=!0),i)for(r=dv(t,null,n,r),t.child=r;r;)r.effectTag=-3&r.effectTag|1024,r=r.sibling;else gm(e,t,n,r),pm();t=t.child}return t;case 5:return bv(t),null===e&&hm(t),n=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,id(n,i)?a=null:null!==o&&id(n,o)&&(t.effectTag|=16),xm(e,t),4&t.mode&&1!==r&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(gm(e,t,a,r),t=t.child),t;case 6:return null===e&&hm(t),null;case 13:return Cm(e,t,r);case 4:return yv(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=hv(t,null,n,r):gm(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,ym(e,t,n,i=t.elementType===n?i:Dp(n,i),r);case 7:return gm(e,t,t.pendingProps,r),t.child;case 8:case 12:return gm(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value;var s=t.type._context;if(Qf(Lp,s._currentValue),s._currentValue=o,null!==a)if(s=a.value,0===(o=Tf(s,o)?0:0|("function"==typeof n._calculateChangedBits?n._calculateChangedBits(s,o):1073741823))){if(a.children===i.children&&!Jf.current){t=Rm(e,t,r);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var u=s.dependencies;if(null!==u){a=s.child;for(var l=u.firstContext;null!==l;){if(l.context===n&&0!=(l.observedBits&o)){1===s.tag&&((l=Xp(r,null)).tag=2,qp(s,l)),s.expirationTime=t&&e<=t}function Sy(e,t){var r=e.firstSuspendedTime,n=e.lastSuspendedTime;rt||0===r)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Ty(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var r=e.firstSuspendedTime;0!==r&&(t>=r?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function My(e,t){var r=e.lastExpiredTime;(0===r||r>t)&&(e.lastExpiredTime=t)}function ky(e,t,r,n){var i=t.current,o=Lg(),a=Jp.suspense;o=jg(o,i,a);e:if(r){t:{if(jc(r=r._reactInternalFiber)!==r||1!==r.tag)throw Error(Gu(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(rp(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(Gu(171))}if(1===r.tag){var u=r.type;if(rp(u)){r=op(r,u,s);break e}}r=s}else r=Zf;return null===t.context?t.context=r:t.pendingContext=r,(t=Xp(o,a)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),qp(i,t),zg(i,o),o}function Ey(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Iy(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=t||r<0||h&&e-l>=o}function m(){var e,r,n=m_();if(v(n))return g(n);s=setTimeout(m,(r=t-((e=n)-u),h?y_(r,o-(e-l)):r))}function g(e){return s=void 0,d&&n?f(e):(n=i=void 0,a)}function y(){var e=m_(),r=v(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(m,t),f(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=v_(t)||0,c_(r)&&(c=!!r.leading,o=(h="maxWait"in r)?g_(v_(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(m_())},y}var b_=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).seeking=!1,n.mobileSeeking=!1,n.track=null,n.hoverTime=null,n.offset=0,n.secondsPrefix="00:00:",n.minutesPrefix="00:",n.seekPause=!1,n.handleTouchSeeking=function(e){for(var t=0,r=0;rthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),r=e%3600,n=Math.floor(r/60),i=Math.ceil(r%60);return{hh:t.toString(),mm:n<10?"0"+n:n.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),r=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+r.ss:this.props.total+this.offset<3600?this.minutesPrefix+r.mm+":"+r.ss:r.hh+":"+r.mm+":"+r.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:fr.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return fr.createElement("div",{className:"seek-slider"},fr.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},fr.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),r}(xt.exports.Component),x_=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).stageVolume=0,n.updateVolumeTimer=0,n.onVolumeSeeking=!1,n.onClickOperationButton=function(){n.props.paused?n.props.play():n.props.pause()},n.operationButton=function(){return n.props.paused?fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},n.operationVolumeButton=function(){return n.props.volume>.9?fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):0===n.props.volume?fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):fr.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="})},n.handleClickVolume=function(){0===n.props.volume?0!==n.stageVolume?n.props.setVolume(n.stageVolume):n.props.setVolume(1):(n.stageVolume=n.props.volume,n.props.setVolume(0))},n.onChange=function(e){n.setState({currentTime:e}),e&&n.changeTime(e)},n.changeTime=__((function(e){n.props.setCurrentTime(e)}),50),n.onVolumeChange=function(e){n.changeVolume(e),n.setState({seekVolume:e/100})},n.changeVolume=__((function(e){n.props.setVolume(e/100)}),50),n.onVolumeSeekStart=function(){n.onVolumeSeeking=!0},n.onVolumeSeekEnd=__((function(){n.onVolumeSeeking=!1}),500),n.onProgressSeekStart=function(){return n.setState({isPlayerSeeking:!0})},n.onProgressSeekEnd=__((function(){n.setState({isPlayerSeeking:!1})}),500),n.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},n.stageVolume=e.volume,n}return b(r,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,r=t.duration,n=t.currentTime;return fr.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},fr.createElement("div",{className:"player-controller-progress"},fr.createElement(b_,{total:r,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),fr.createElement("div",{className:"player-controller-actions"},fr.createElement("div",{className:"player-controller-actions-left"},fr.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),fr.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},fr.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),fr.createElement("div",{className:"player-volume-slider"},fr.createElement(b_,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),fr.createElement("div",{className:"player-mid-box-time"},w_(Math.floor(n/1e3))," /"," ",w_(Math.floor(r/1e3)))))}}]),r}(xt.exports.Component);function w_(e){var t=e%60,r=(e-t)/60;if(r>=60){var n=r%60;return"".concat(S_((r-n)/60),":").concat(S_(n),":").concat(S_(t))}return"".concat(S_(r),":").concat(S_(t))}function S_(e){return e<=9?"0".concat(e):"".concat(e)}var T_,M_,k_=99999;(M_=T_||(T_={}))[M_.Idle=0]="Idle",M_[M_.Playing=1]="Playing",M_[M_.Paused=2]="Paused";var E_={};function I_(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i>> Play Success",{playingId:t})})),E_[t].playState=1):I_(">>> Skip Play",{playingId:t,state:E_[t].playState})}function i(e){E_[e].playState=0,E_[e].previousVideoJSAdvance=0,E_[e].previousSeekTargetTime=0,E_[e].previousBeginSeekTime=0}t.one("ready",(function(){var r,o=(null==(r=null==t?void 0:t.tagAttributes)?void 0:r.src)||"";o.endsWith("mp3")||o.endsWith("wav")||o.endsWith("m4a")||(I_(">>> Mute js player",{src:o}),t.muted(!0),t.muted=function(e){return!1});var a,s,u=(a=k_--,s={playState:T_.Idle,previousVideoJSAdvance:0,previousSeekTargetTime:0,previousBeginSeekTime:0},E_[a]=s,a);I_(">>> Setup",{playingId:u,src:o}),e.addListener("error",(function(e){I_(">>> Error",{soundId:e}),i(e)})),e.addListener("effectFinished",(function(e){I_(">>> Finished",{soundId:e}),i(e)})),t.on("play",(function(){switch(E_[u].playState){case 0:I_(">>> Start play",{playingId:u}),n(u);break;case 2:I_(">>> Resume play",{playingId:u}),e.resumeEffect(u),E_[u].playState=1}})),t.on("pause",(function(){var t=E_[u].playState;if(1===t)I_(">>> Pause play",{playingId:u}),e.pauseEffect(u),E_[u].playState=2;else I_(">>> Skip Pause",{playingId:u,currenState:t})})),t.on("timeupdate",(function(){E_[u],e.getEffectCurrentPosition(u).then((function(r){var i=E_[u],o=r/1e3,a=t.currentTime(),s=0!==i.previousSeekTargetTime&&0!==i.previousBeginSeekTime;if(I_(">>> EffectSecond rtc: ".concat(o," js: ").concat(a," seeking: ").concat(s),{playingId:u}),0!=i.playState){if(!(s&&o0){var c=a-o,h=Math.abs(c);if(h>.5)if(s){var d=i.previousSeekTargetTime-o,f=Date.now()/1e3-l,p=f+(c>0?c:0),v=a+p;y(v,u),I_(">>> Start seeking after seeking lag",{jsPlayerTime:a,rtcEffectTime:o,jsPlayerTimerAdvance:c,lastSeekingCost:f,estimatedRTCLag:p,targetRTCSeekTime:v,previousBeginSeekTime:l,timeElapse:d})}else if(h>10)y(a,u),I_(">>> DirectSeek",{time:a,rtcEffectTime:o,jsPlayerTimerAdvance:c});else{var m=i.previousVideoJSAdvance,g=a+0;i.previousVideoJSAdvance=0,y(g,u),I_(">>> Start seeking with lag",{jsPlayerTime:a,rtcEffectTime:o,jsPlayerTimerAdvance:c,previousAdvance:m,estimatedRTCLag:0,targetRTCSeekTime:g})}else s&&(I_(">>> SeekingFinish no lag",{jsPlayerTime:a,rtcEffectTime:o,jsPlayerTimerAdvance:c,previousBeginSeekTime:l,rtcLagTolerance:.5}),i.previousBeginSeekTime=0,i.previousSeekTargetTime=0)}}else I_(">>> Skip timupdate",{playingId:u,state:i.playState,jsTime:t.currentTime(),rtcEffectTime:o})}else t.paused()||(I_(">>> Play effect due to time update.",{playingId:u}),n(u));function y(t,r){e.setEffectPosition(r,1e3*t),i.previousBeginSeekTime=Date.now()/1e3,i.previousSeekTargetTime=t}}))})),t.on("dispose",(function(){E_[u].playState&&(e.stopEffect(u),delete E_[u],I_(">>> Dispose",{playingId:u}))}))}))}var C_=function(e){s(r,e);var t=u(r);function r(){var e;return y(this,r),(e=t.apply(this,arguments)).putAttributes=function(t){var r=e.props.context,n=r.getAttributes()||{};for(var i in t)n[i]!==t[i]&&r.updateAttributes([i],t[i])},e}return b(r,[{key:"render",value:function(){var e=this.props.context,t=e.getRoom(),r=t?void 0:e.getDisplayer(),n=this.putAttributes;return fr.createElement(P_,{room:t,player:r,context:e,plugin:{putAttributes:n}})}}]),r}(xt.exports.Component),P_=function(e){s(r,e);var t=u(r);function r(e){var n;return y(this,r),(n=t.call(this,e)).alertMask=null,n.container=fr.createRef(),n.controllerHiddenTimer=0,n.syncPlayerTimer=0,n.retryCount=0,n.decreaseRetryTimer=0,n.noSoundSyncCount=0,n.showController=function(){n.setState({controllerVisible:!0}),n.debounceHidingController()},n.play=function(){var e,t=null==(e=n.props.room)?void 0:e.calibrationTimestamp;n.debug(">>> play",{paused:!1,hostTime:t}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!1,hostTime:t})},n.pause=function(){var e=qy(n.getAttributes(),n.props);n.debug(">>> pause",{paused:!0,currentTime:e}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:e})},n.setVolume=function(e){n.debug(">>> volume",{volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e}),n.isEnabled()&&n.props.plugin.putAttributes({volume:e,muted:0===e})},n.setCurrentTime=function(e){var t,r=null==(t=n.props.room)?void 0:t.calibrationTimestamp;n.debug(">>> seek",{currentTime:e/1e3,hostTime:r}),n.isEnabled()&&n.props.plugin.putAttributes({currentTime:e/1e3,hostTime:r})},n.resetPlayer=function(){var e;null==(e=n.player)||e.autoplay(!1),n.state.NoSound||(n.debug(">>> ended",{paused:!0,currentTime:0}),n.isEnabled()&&n.props.plugin.putAttributes({paused:!0,currentTime:0}))},n.syncPlayerWithAttributes=function(){var e,t=n.getAttributes();if(t){var r=n.player;if(r&&(!n.state.NoSound||(n.noSoundSyncCount+=1)%8==0)){r.paused()!==t.paused&&(n.debug("<<< paused -> %o",t.paused),t.paused?r.pause():null==(e=r.play())||e.catch(n.catchPlayFail)),r.muted()!==t.muted&&(n.debug("<<< muted -> %o",t.muted),r.muted(t.muted)),r.volume()!==t.volume&&(n.debug("<<< volume -> %o",t.volume),r.volume(t.volume));var i=qy(t,n.props),o=$y.currentTimeMaxError;n.state.NoSound&&(o*=3),i>r.duration()?n.resetPlayer():Math.abs(r.currentTime()-i)>o&&(n.debug("<<< currentTime -> %o",i),r.currentTime(i))}}},n.debounceHidingController=function(){n.controllerHiddenTimer&&(clearTimeout(n.controllerHiddenTimer),n.controllerHiddenTimer=0),n.controllerHiddenTimer=setTimeout((function(){n.setState({controllerVisible:!1}),n.controllerHiddenTimer=0}),3e3)},n.decreaseRetryCount=function(){n.player&&n.retryCount>0&&(n.retryCount=n.retryCount-1)},n.catchPlayFail=function(e){var t,r,i=String(e);if(Qy&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=n.player)||t.autoplay("any"),n.setState({NoSound:!0});else{var o=null==(r=n.player)?void 0:r.error();o&&(n.retryCount<=3?(n.initPlayer(),n.retryCount=n.retryCount+1):(n.debug("catch videojs media error",o),n.setState({MediaError:!0}))),n.debug("catch error",e)}},n.fixPlayFail=function(){n.debug("try to fix play state"),n.setState({NoSound:!1});var e=n.getAttributes(),t=e.muted,r=e.volume;n.player&&(n.player.muted(t),n.player.volume(r))},n.initPlayer=g(regeneratorRuntime.mark((function e(){var t,r,i,o,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=n.player)||t.dispose(),n.player=void 0,n.debug("creating elements ..."),r=n.getAttributes(),i=r.type,o=r.src,a=r.poster,(s=document.createElement("div")).setAttribute("data-vjs-player",""),(u=document.createElement("video")).className="video-js",a&&(u.poster=a),u.setAttribute("playsInline",""),u.setAttribute("webkit-playsinline",""),l=document.createElement("source"),new URL(o).pathname.endsWith(".m3u8")?l.type="application/x-mpegURL":u.src=o,l.src=o,i&&(l.type=i),u.appendChild(l),s.appendChild(u),n.container.current.appendChild(s),e.next=14,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 14:n.debug("initializing videojs() ..."),c=X.default(u),n.player=c,window.player=c,c.one("loadedmetadata",n.gracefullyUpdate),void 0!==(h=window.__mediaPlayerAudioEffectClient)&&A_(h,c,o),c.on("ready",(function(){var e;null==(e=$y.onPlayer)||e.call($y,c),c.on("timeupdate",n.gracefullyUpdate),c.on("volumechange",n.gracefullyUpdate),c.on("seeked",n.gracefullyUpdate),c.on("play",n.gracefullyUpdate),c.on("pause",n.gracefullyUpdate),c.on("ended",n.resetPlayer)})),c.on("error",n.catchPlayFail),n.setState({MediaError:!1});case 19:case"end":return e.stop()}}),e)}))),n.gracefullyUpdate=function(){return n.setState({updater:!n.state.updater})},n.setupAlert=function(e){e&&(e.addEventListener("touchstart",n.fixPlayFail),e.addEventListener("click",n.fixPlayFail)),n.alertMask=e},n.setupReload=function(e){e&&(e.addEventListener("touchstart",n.initPlayer),e.addEventListener("click",n.initPlayer))},n.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(e.room),n}return b(r,[{key:"getAttributes",value:function(){var e=this.props.context.getAttributes();if(e){if(e=Vy(Vy({},Hy),e),this.player){var t=qy(e,this.props),r=this.player.duration();!e.paused&&t>r&&(n=Vy({},e),e=zy(n,By({currentTime:0,paused:!0})),this.resetPlayer())}var n;return e}}},{key:"isShowingPoster",value:function(){var e=this.getAttributes();return!(null!=e&&e.src)||Zy.some((function(t){return e.src.endsWith(t)}))}},{key:"render",value:function(){var e,t;if(!this.props.room&&!this.props.player)return null;var r=this.getAttributes();if(!r)return null;var n=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),i=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return fr.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},fr.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&fr.createElement("div",{className:"video-js-plugin-poster"},r.poster&&fr.createElement("img",{src:r.poster,alt:"",draggable:!1})),fr.createElement(x_,{duration:n,volume:r.volume,setVolume:this.setVolume,paused:r.paused,play:this.play,pause:this.pause,currentTime:1e3*qy(r,this.props),setCurrentTime:this.setCurrentTime,buffered:n*i,visible:!0}),this.state.NoSound&&fr.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&fr.createElement("div",{className:"videojs-plugin-recovery-mode"},fr.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:z.AnimationMode.Immediately;if(this.inDisplaySceneDir){var t=this.attributes,r=t.width,n=void 0===r?1280:r,i=t.height,o=void 0===i?720:i,a=n?-n/2:0,s=o?-o/2:0;this.manager.moveCameraToContain({originX:a,originY:s,width:n,height:o,animationMode:e})}}},{key:"handleSetPage",value:function(e){if(!this.isReplay&&this.attributes.displaySceneDir){var t=e.payload,r=this.displayer,n=r.entireScenes()[this.attributes.displaySceneDir];if(!n||n.length!==t){var i=function(e,t){return new Array(e).fill(0).map((function(e,r){return t(r)}))}(t,(function(e){return{name:String(e+1)}}));r.putScenes(this.attributes.displaySceneDir,i),this.manager.setMainViewScenePath(this.attributes.displaySceneDir)}}}},{key:"listenIframe",value:function(t){var r=this;t.url&&this.iframe.src!==t.url&&(this.src_url_equal_anchor||(this.src_url_equal_anchor=document.createElement("a")),this.src_url_equal_anchor.href=t.url,this.src_url_equal_anchor.href!==this.iframe.src&&(this.iframe.src=t.url)),this.iframe.width="".concat(t.width,"px"),this.iframe.height="".concat(t.height,"px"),this.sideEffectManager.addEventListener(this.iframe,"load",(function(t){var n;r.postMessage({kind:"Init",payload:{attributes:r.attributes,roomState:null==(n=e.displayer)?void 0:n.state,currentPage:r.currentPage,observerId:r.displayer.observerId}}),e.emitter.emit("IframeLoad",t),r.sideEffectManager.addDisposer(e.emitter.on("Ready",(function(){var e;r.postMessage(null==(e=r.attributes.lastEvent)?void 0:e.payload)})),L_),r.computedStyleAndIframeDisplay()}),void 0,U_)}},{key:"listenDisplayerState",value:function(){var e=this;this.isReplay&&(this.displayer._phase===z.PlayerPhase.Playing&&this.computedStyleAndIframeDisplay(),this.sideEffectManager.add((function(){return e.displayer.callbacks.on("onPhaseChanged",e.onPhaseChangedListener),function(){return e.displayer.callbacks.off("onPhaseChanged",e.onPhaseChangedListener)}}),F_)),this.computedStyleAndIframeDisplay()}},{key:"computedStyleAndIframeDisplay",value:function(){this.computedStyle(this.displayer.state),this.computedIframeDisplay(this.displayer.state,this.attributes)}},{key:"listenDisplayerCallbacks",value:function(){this.displayer.callbacks.on(this.callbackName,this.stateChangeListener)}},{key:"computedStyle",value:function(e){var t=this.manager.cameraState,r=this.attributes.width||1280,n=this.attributes.height||720;if(this.iframe){var i=t.width,o=t.height,a=t.scale,s=t.centerX,u=t.centerY,l=this.rootRect||{x:0,y:0},c="".concat(i/2+l.x,"px"),h="".concat(o/2+l.y,"px"),d=-u*a+(o-n)/2*a,f=["position: absolute;","border: 0.1px solid rgba(0,0,0,0);","top: 0px;","left: 0px;","transform-origin: ".concat(c," ").concat(h,";"),"transform: translate(".concat(-s*a+(i-r)/2*a,"px,").concat(d,"px) scale(").concat(a,", ").concat(a,");")];this.cssList=f,this.computedZindex(),this.updateStyle()}}},{key:"computedIframeDisplay",value:function(t,r){this.inDisplaySceneDir?e.emitter.emit("DispayIframe"):e.emitter.emit("HideIframe")}},{key:"computedZindex",value:function(){var e="z-index: -1;",t=this.cssList.findIndex((function(t){return t===e}));-1!==t&&this.cssList.splice(t,1),(!this.isClicker()||this.isDisableInput)&&this.cssList.push(e)}},{key:"updateStyle",value:function(){this.iframe.style.cssText=this.cssList.join(" ")}},{key:"messageListener",value:function(e){if(ot("<<<",JSON.stringify(e.data)),e.origin===this.iframeOrigin){var t=e.data;switch(t.kind){case"SetAttributes":this.handleSetAttributes(t);break;case"RegisterMagixEvent":this.handleRegisterMagixEvent(t);break;case"RemoveMagixEvent":this.handleRemoveMagixEvent(t);break;case"DispatchMagixEvent":this.handleDispatchMagixEvent(t);break;case"RemoveAllMagixEvent":this.handleRemoveAllMagixEvent();break;case"NextPage":this.handleNextPage();break;case"PrevPage":this.handlePrevPage();break;case"SDKCreate":this.handleSDKCreate();break;case"SetPage":this.handleSetPage(t);break;case"GetAttributes":this.handleGetAttributes();break;case"PageTo":this.handlePageTo(t);break;default:ot("".concat(t.kind," not allow event."))}}}},{key:"handleSDKCreate",value:function(){this.postMessage({kind:"Init",payload:{attributes:this.attributes,roomState:this.displayer.state,currentPage:this.currentPage,observerId:this.displayer.observerId}})}},{key:"handleDispatchMagixEvent",value:function(e){var t=e.payload;this.appManager.safeDispatchMagixEvent(t.event,t.payload)}},{key:"handleSetAttributes",value:function(e){this.setAttributes(e.payload)}},{key:"handleRegisterMagixEvent",value:function(e){var t=this,r=e.payload,n=function(e){e.authorId!==t.displayer.observerId&&t.postMessage({kind:"ReciveMagixEvent",payload:e})};this.magixEventMap.set(r,n),this.displayer.addMagixEventListener(r,n)}},{key:"handleRemoveMagixEvent",value:function(e){var t=e.payload,r=this.magixEventMap.get(t);this.displayer.removeMagixEventListener(t,r)}},{key:"handleNextPage",value:function(){this.manager.canOperate&&(this.manager.nextPage(),this.dispatchMagixEvent("NextPage",{}))}},{key:"handlePrevPage",value:function(){this.manager.canOperate&&(this.manager.prevPage(),this.dispatchMagixEvent("PrevPage",{}))}},{key:"handlePageTo",value:function(e){if(this.manager.canOperate){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;this.manager.setMainViewSceneIndex(t-1),this.dispatchMagixEvent("PageTo",t-1)}}},{key:"handleRemoveAllMagixEvent",value:function(){var e=this;this.magixEventMap.forEach((function(t,r){e.displayer.removeMagixEventListener(r,t)})),this.magixEventMap.clear()}},{key:"handleGetAttributes",value:function(){this.postMessage({kind:"GetAttributes",payload:this.attributes})}},{key:"postMessage",value:function(e){var t;this.iframe&&(null==(t=this.iframe.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))}},{key:"dispatchMagixEvent",value:function(e,t){this.manager.canOperate&&(this.setAttributes({lastEvent:{name:e,payload:t}}),this.displayer.dispatchMagixEvent(e,t))}},{key:"isClicker",value:function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)}},{key:"attributes",get:function(){return this.appManager.store.getIframeBridge()}},{key:"isReplay",get:function(){return this.manager.isReplay}},{key:"callbackName",get:function(){return this.isReplay?"onPlayerStateChanged":"onRoomStateChanged"}},{key:"iframeOrigin",get:function(){if(this.iframe)try{return new URL(this.iframe.src).origin}catch(e){console.warn(e)}}},{key:"currentIndex",get:function(){return this.manager.mainViewSceneIndex}},{key:"currentPage",get:function(){return this.currentIndex+1}},{key:"totalPage",get:function(){return this.manager.mainViewScenesLength}},{key:"readonly",get:function(){return!this.displayer.isWritable}},{key:"inDisplaySceneDir",get:function(){return this.manager.mainViewSceneDir===this.attributes.displaySceneDir}},{key:"isDisableInput",get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs}}],[{key:"onCreate",value:function(t){e.emitter.emit("StartCreate"),e.emitter.emit("OnCreate",t),e.emitter.emit("created")}}]),e}(),H_=V_;H_.kind="IframeBridge",H_.hiddenClass="netless-iframe-brdige-hidden",H_.emitter=new $.default,H_.displayer=null,H_.alreadyCreate=!1;var Y_=new Oo({emitter:se}),$_=function(e){s(m,e);var t,r,n,i,o,a,l,c,h,d,f,p,v=u(m);function m(e){var t;return y(this,m),(t=v.call(this,e)).version="0.4.75",t.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.28",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@hyrious/dts":"^0.2.2","@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.9","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1","side-effect-manager":"0.1.5",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.9.9",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t.emitter=oe,t.viewMode=z.ViewMode.Broadcaster,t.isReplay=z.isPlayer(t.displayer),t._cursorUIDs=[],t.containerSizeRatio=m.containerSizeRatio,m.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.28",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@hyrious/dts":"^0.2.2","@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.9","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1","side-effect-manager":"0.1.5",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.9.9",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t}return b(m,[{key:"bindContainer",value:function(e){var t,r,n,i,o,a;if(z.isRoom(this.displayer)&&this.room.phase!==z.RoomPhase.Connected)throw new Fe;if(m.isCreated&&m.container)m.container.firstChild&&e.appendChild(m.container.firstChild);else if(m.params){var s=m.params,u=m.initContainer(this,e,s);this.boxManager&&this.boxManager.destroy();var l=function(e,t,r,n,i){return new Oi({safeSetAttributes:function(t){return e.safeSetAttributes(t)},getMainView:function(){return e.mainView},updateAppState:function(){var t,r;return null==(r=e.appManager)?void 0:(t=r.store).updateAppState.apply(t,arguments)},canOperate:function(){return e.canOperate},notifyContainerRectUpdate:function(t){var r;return null==(r=e.appManager)?void 0:r.notifyContainerRectUpdate(t)},cleanFocus:function(){var t;return null==(t=e.appManager)?void 0:t.store.cleanFocus()},setAppFocus:function(t){var r;return null==(r=e.appManager)?void 0:r.store.setAppFocus(t,!0)},callbacks:t,emitter:r,boxEmitter:n},i)}(this,oe,se,st,{collectorContainer:s.collectorContainer,collectorStyles:s.collectorStyles,prefersColorScheme:s.prefersColorScheme});this.boxManager=l,null==(t=this.appManager)||t.setBoxManager(l),this.bindMainView(u,s.disableCameraTransform),m.wrapper&&(null==(r=this.cursorManager)||r.setupWrapper(m.wrapper))}se.emit("updateManagerRect"),null==(n=this.appManager)||n.refresh(),null==(i=this.appManager)||i.resetMaximized(),null==(o=this.appManager)||o.resetMinimized(),null==(a=this.appManager)||a.displayerWritableListener(!this.room.isWritable),m.container=e}},{key:"bindCollectorContainer",value:function(e){m.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):m.params&&(m.params.collectorContainer=e)}},{key:"addApp",value:(p=g(regeneratorRuntime.mark((function e(t){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=2;break}return e.abrupt("return",this.appManager.rootDirRemoving?new Promise((function(e,n){se.once("rootDirRemoved").then(g(regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,r._addApp(t);case 3:o=i.sent,e(o),i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),n(i.t0.message);case 10:case"end":return i.stop()}}),i,null,[[0,7]])}))))})):this._addApp(t));case 2:throw new De;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"_addApp",value:(f=g(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=21;break}if(t.kind&&"string"==typeof t.kind){e.next=3;break}throw new je;case 3:return t.src&&"string"==typeof t.src&&_e.register({kind:t.kind,src:t.src}),e.next=6,null==(r=_e.appClasses.get(t.kind))?void 0:r();case 6:if(!((o=e.sent)&&(null==(n=o.config)?void 0:n.singleton)&&this.appManager.appProxies.has(t.kind))){e.next=9;break}throw new Oe;case 9:if(void 0!==(a=this.setupScenePath(t,this.appManager))){e.next=14;break}e.t0=void 0,e.next=18;break;case 14:return null!=(i=null==t?void 0:t.options)&&i.scenePath&&(t.options.scenePath=Ie(t.options.scenePath)),e.next=17,this.appManager.addApp(t,Boolean(a));case 17:e.t0=e.sent;case 18:return e.abrupt("return",e.t0);case 21:throw new De;case 22:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"setupScenePath",value:function(e,t){var r=!1;if(e.options){var n=e.options,i=n.scenePath,o=n.scenes;if(i){if(!function(e){return e.startsWith("/")}(i))throw new Be;for(var a=0,s=Object.keys(this.apps||{});a0&&(this.isDynamicPPT(o)?(r=!0,Me(this.displayer)[i]||ke(this.room,i,o)):Me(this.displayer)[i]||ke(this.room,i,[{name:o[0].name}])),i&&void 0===o&&ke(this.room,i,[{}])}return r}},{key:"setMainViewScenePath",value:(d=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewScenePath(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(h=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewSceneIndex(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"nextPage",value:(c=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex+1)>=this.mainViewScenesLength)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the last page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"prevPage",value:(l=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex-1)<0)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the first page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"jumpPage",value:(a=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=11;break}if(!(t<0||t>=this.pageState.length)){e.next=5;break}e.t1=(console.warn("[WindowManager]: index ".concat(t," out of range")),!1),e.next=8;break;case 5:return e.next=7,this.appManager.setMainViewSceneIndex(t);case 7:e.t1=!0;case 8:e.t0=e.t1,e.next=12;break;case 11:e.t0=!1;case 12:return e.abrupt("return",e.t0);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"addPage",value:(o=g(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appManager&&(r=null==t?void 0:t.after,n=null==t?void 0:t.scene,r?(i=this.mainViewSceneIndex+1,this.room.putScenes(ne,[n||{}],i)):this.room.putScenes(ne,[n||{}]));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"removePage",value:(i=g(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=5;break}return r=void 0===t?this.pageState.index:t,e.abrupt("return",1===this.pageState.length?(console.warn("[WindowManager]: can not remove the last page"),!1):r<0||r>=this.pageState.length?(console.warn("[WindowManager]: index ".concat(t," out of range")),!1):this.appManager.removeSceneByIndex(r));case 5:return e.abrupt("return",!1);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getMainViewScenePath",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewScenePath()}},{key:"getMainViewSceneIndex",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewSceneIndex()}},{key:"setReadonly",value:function(e){var t;this.readonly=e,null==(t=this.boxManager)||t.setReadonly(e),se.emit("setReadonly",e)}},{key:"switchMainViewToWriter",value:function(){var e;return null==(e=this.appManager)?void 0:e.mainViewProxy.mainViewClickHandler()}},{key:"onAppDestroy",value:function(e,t){!function(e,t){se.once(e).then(t)}("destroy-".concat(e),t)}},{key:"onAppEvent",value:function(e,t){return se.on("custom-".concat(e),t)}},{key:"setViewMode",value:function(e){var t,r,n,i;(e===z.ViewMode.Broadcaster||e===z.ViewMode.Follower)&&(this.canOperate&&e===z.ViewMode.Broadcaster&&(null==(t=this.appManager)||t.mainViewProxy.setCameraAndSize()),null==(r=this.appManager)||r.mainViewProxy.start()),e===z.ViewMode.Freedom&&(null==(n=this.appManager)||n.mainViewProxy.stop()),this.viewMode=e,null==(i=this.appManager)||i.mainViewProxy.setViewMode(e)}},{key:"setBoxState",value:function(e){if(this.canOperate)switch(e){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0)}}},{key:"setMaximized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMaximized(e,!1)}},{key:"setMinimized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMinimized(e,!1)}},{key:"setFullscreen",value:function(e){var t;this._fullscreen!==e&&(this._fullscreen=e,null==(t=m.sizer)||t.classList.toggle("netless-window-manager-fullscreen",e),oe.emit("fullscreenChange",e))}},{key:"setCursorUIDs",value:function(e){var t,r;if(this._cursorUIDs=e||[],0===this._cursorUIDs.length)null==(t=this._cursorUIDsStyleDOM)||t.remove();else{this._cursorUIDsStyleDOM||(this._cursorUIDsStyleDOM=document.createElement("style")),null==(r=m.playground)||r.appendChild(this._cursorUIDsStyleDOM);var n,i="[data-cursor-uid] { display: none }",o=S(this._cursorUIDs);try{for(o.s();!(n=o.n()).done;){var a=n.value;i+='\n[data-cursor-uid="'.concat(a,'"] { display: flex }')}}catch(e){o.e(e)}finally{o.f()}this._cursorUIDsStyleDOM.textContent=i}}},{key:"queryAll",value:function(){var e;return Array.from((null==(e=this.appManager)?void 0:e.appProxies.values())||[])}},{key:"queryOne",value:function(e){var t;return null==(t=this.appManager)?void 0:t.appProxies.get(e)}},{key:"closeApp",value:(n=g(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null==(r=this.appManager)?void 0:r.closeApp(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"focusApp",value:function(e){var t,r,n,i=null==(t=this.boxManager)?void 0:t.getBox(e);i&&(null==(r=this.boxManager)||r.focusBox({appId:e},!1),(null==(n=this.boxManager)?void 0:n.teleBoxManager).makeBoxTop(i,!1))}},{key:"moveCamera",value:function(e){var t,r=this,n=j.omit(e,["animationMode"]),i=O({},this.mainView.camera);j.isEqual(O(O({},i),n),i)||(this.mainView.moveCamera(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCamera,e),setTimeout((function(){var e;null==(e=r.appManager)||e.mainViewProxy.setCameraAndSize()}),500))}},{key:"moveCameraToContain",value:function(e){var t,r=this;this.mainView.moveCameraToContain(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCameraToContain,e),setTimeout((function(){var e;null==(e=r.appManager)||e.mainViewProxy.setCameraAndSize()}),500)}},{key:"convertToPointInWorld",value:function(e){return this.mainView.convertToPointInWorld(e)}},{key:"setCameraBound",value:function(e){this.mainView.setCameraBound(e)}},{key:"onDestroy",value:function(){this._destroy()}},{key:"destroy",value:function(){this._destroy()}},{key:"_destroy",value:function(){var e,t,r,n,i;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(r=this.cursorManager)||r.destroy(),m.container=void 0,m.wrapper=void 0,m.sizer=void 0,m.isCreated=!1,m.playground&&(null==(n=m.playground.parentNode)||n.removeChild(m.playground)),m.params=void 0,null==(i=this._iframeBridge)||i.destroy(),this._iframeBridge=void 0,ot("Destroyed")}},{key:"bindMainView",value:function(e,t){var r;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),null==(r=this.cursorManager)||r.setMainViewDivElement(e))}},{key:"safeSetAttributes",value:function(e){this.canOperate&&this.setAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.canOperate&&this.updateAttributes(e,t)}},{key:"setPrefersColorScheme",value:function(e){var t,r;null==(r=null==(t=this.appManager)?void 0:t.boxManager)||r.setPrefersColorScheme(e)}},{key:"cleanCurrentScene",value:function(){var e;ot("clean current scene"),null==(e=this.focusedView)||e.cleanCurrentScene()}},{key:"redo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.redo())||0}},{key:"undo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.undo())||0}},{key:"delete",value:function(){var e;null==(e=this.focusedView)||e.delete()}},{key:"copy",value:function(){var e;null==(e=this.focusedView)||e.copy()}},{key:"paste",value:function(){var e;null==(e=this.focusedView)||e.paste()}},{key:"duplicate",value:function(){var e;null==(e=this.focusedView)||e.duplicate()}},{key:"insertText",value:function(e,t,r){var n;return(null==(n=this.focusedView)?void 0:n.insertText(e,t,r))||""}},{key:"insertImage",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.insertImage(e)}},{key:"completeImageUpload",value:function(e,t){var r;return null==(r=this.focusedView)?void 0:r.completeImageUpload(e,t)}},{key:"lockImage",value:function(e,t){var r;return null==(r=this.focusedView)?void 0:r.lockImage(e,t)}},{key:"lockImages",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.lockImages(e)}},{key:"refresh",value:function(){var e;this._refresh(),null==(e=this.appManager)||e.dispatchInternalEvent(q.Refresh)}},{key:"_refresh",value:function(){var e,t;null==(e=this.appManager)||e.mainViewProxy.rebind(),m.container&&this.bindContainer(m.container),null==(t=this.appManager)||t.refresher.refresh()}},{key:"setContainerSizeRatio",value:function(e){if(!(j.isNumber(e)&&e>0))throw new Error("[WindowManager]: updateContainerSizeRatio error, ratio must be a positive number. but got ".concat(e));m.containerSizeRatio=e,this.containerSizeRatio=e,se.emit("containerSizeRatioUpdate",e)}},{key:"isDynamicPPT",value:function(e){var t,r,n=null==(r=null==(t=e[0])?void 0:t.ppt)?void 0:r.src;return null==n?void 0:n.startsWith("pptx://")}},{key:"ensureAttributes",value:(r=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=j.isNull(this.attributes),!e.t0){e.next=4;break}return e.next=4,Ce(50);case 4:j.isObject(this.attributes)&&(this.attributes[nt.Apps]||this.safeSetAttributes(w({},nt.Apps,{})),this.attributes[nt.Cursors]||this.safeSetAttributes(w({},nt.Cursors,{})),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:ie}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[nt.Registered]||this.safeSetAttributes(w({},nt.Registered,{})),this.attributes[nt.IframeBridge]||this.safeSetAttributes(w({},nt.IframeBridge,{})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getIframeBridge",value:function(){if(!this.appManager)throw new Error("[WindowManager]: should call getIframeBridge() after await mount()");return this._iframeBridge||(this._iframeBridge=new H_(this,this.appManager)),this._iframeBridge}},{key:"cursorUIDs",get:function(){return this._cursorUIDs}},{key:"mainView",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new De}},{key:"camera",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new De}},{key:"cameraState",get:function(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new De}},{key:"apps",get:function(){var e;return null==(e=this.appManager)?void 0:e.store.apps()}},{key:"boxState",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.boxState;throw new De}},{key:"darkMode",get:function(){var e,t;return Boolean(null==(t=null==(e=this.appManager)?void 0:e.boxManager)?void 0:t.darkMode)}},{key:"prefersColorScheme",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.prefersColorScheme;throw new De}},{key:"focused",get:function(){return this.attributes.focus}},{key:"focusedView",get:function(){var e,t;return(null==(t=null==(e=this.appManager)?void 0:e.focusApp)?void 0:t.view)||this.mainView}},{key:"polling",get:function(){var e;return(null==(e=this.appManager)?void 0:e.polling)||!1},set:function(e){this.appManager&&(this.appManager.polling=e)}},{key:"cursorStyle",get:function(){var e;return(null==(e=this.cursorManager)?void 0:e.style)||"default"},set:function(e){if(!this.cursorManager)throw new Error("[WindowManager]: cursor is not enabled, please set { cursor: true }.");this.cursorManager.style=e}},{key:"mainViewSceneIndex",get:function(){var e;return(null==(e=this._pageState)?void 0:e.index)||0}},{key:"mainViewSceneDir",get:function(){var e;if(this.appManager)return null==(e=this.appManager)?void 0:e.getMainViewSceneDir();throw new De}},{key:"topApp",get:function(){var e,t;return null==(t=null==(e=this.boxManager)?void 0:e.getTopBox())?void 0:t.id}},{key:"mainViewScenesLength",get:function(){var e;return(null==(e=this._pageState)?void 0:e.length)||0}},{key:"canRedoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canRedoSteps)||0}},{key:"canUndoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canUndoSteps)||0}},{key:"sceneState",get:function(){if(this.appManager)return this.appManager.sceneState;throw new De}},{key:"pageState",get:function(){if(this._pageState)return this._pageState.toObject();throw new De}},{key:"fullscreen",get:function(){return Boolean(this._fullscreen)}},{key:"canOperate",get:function(){return!!z.isRoom(this.displayer)&&(this.displayer.isWritable&&this.displayer.phase===z.RoomPhase.Connected)}},{key:"room",get:function(){return this.displayer}}],[{key:"onCreate",value:function(e){m._resolve(e)}},{key:"mount",value:(t=g(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.room,m.container=t.container,m.supportAppliancePlugin=t.supportAppliancePlugin,n=t.containerSizeRatio,i=t.debug,o=t.cursor,m.params=t,m.displayer=t.room,vt(),!z.isRoom(r)){e.next=11;break}if(r.phase===z.RoomPhase.Connected){e.next=7;break}throw new Error("[WindowManager]: Room only Connected can be mount");case 7:return r.phase===z.RoomPhase.Connected&&r.isWritable&&(r.disableSerialization=!1),e.next=10,this.initManager(r);case 10:a=e.sent;case 11:if(!m.isCreated){e.next=13;break}throw new Error("[WindowManager]: Already created cannot be created again");case 13:if(this.debug=Boolean(i),this.debug&&Xy({verbose:!0}),ot("Already insert room",a),!z.isRoom(this.displayer)){e.next=18;break}if(a){e.next=16;break}throw new Error("[WindowManager]: init InvisiblePlugin failed");case 16:e.next=20;break;case 18:return e.next=20,Y.default(function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.getInvisiblePlugin(m.kind)){e.next=2;break}throw ot("manager is empty. retrying ".concat(t)),new Error;case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),{retries:10,maxTimeout:5e3});case 20:if(a){e.next=22;break}throw new Error("[WindowManager]: create manager failed");case 22:return n&&(m.containerSizeRatio=n),e.next=25,a.ensureAttributes();case 25:return a._fullscreen=t.fullscreen,a.appManager=new pt(a),a.appManager.polling=t.polling||!1,a._pageState=new No(a.appManager),a.cursorManager=new Po(a.appManager,Boolean(o),t.cursorOptions,t.applianceIcons),n&&(a.containerSizeRatio=n),t.container&&a.bindContainer(t.container),Ro(r,a),se.emit("onCreated"),m.isCreated=!0,e.prev=35,e.next=38,ue();case 38:e.next=43;break;case 40:e.prev=40,e.t0=e.catch(35),console.warn("[WindowManager]: indexedDB open failed"),console.log(e.t0);case 43:return e.abrupt("return",a);case 44:case"end":return e.stop()}}),e,this,[[35,40]])}))),function(e){return t.apply(this,arguments)})},{key:"initManager",value:function(e){return gt(e)}},{key:"initContainer",value:function(e,t,r){var n=r.chessboard,i=r.overwriteStyles,o=r.fullscreen;m.container||(m.container=t);var a=function(e){var t=document.createElement("div");t.className="netless-window-manager-playground";var r=document.createElement("div");r.className="netless-window-manager-sizer";var n=document.createElement("div");n.className="netless-window-manager-wrapper";var i=document.createElement("div");return i.className="netless-window-manager-main-view",t.appendChild(r),r.appendChild(n),n.appendChild(i),e.appendChild(t),X_.wrapper=n,{playground:t,wrapper:n,sizer:r,mainViewElement:i}}(t),s=a.playground,u=a.wrapper,l=a.sizer,c=a.mainViewElement;if(m.playground=s,n&&l.classList.add("netless-window-manager-chess-sizer"),o&&l.classList.add("netless-window-manager-fullscreen"),i){var h=document.createElement("style");h.textContent=i,s.appendChild(h)}return e.containerResizeObserver=bt.create(s,l,u,se),m.wrapper=u,m.sizer=l,c}},{key:"register",value:function(e){return _e.register(e)}},{key:"unregister",value:function(e){return _e.unregister(e)}},{key:"registered",get:function(){return _e.registered}}]),m}(z.InvisiblePlugin),X_=$_;X_.kind="WindowManager",X_.debug=!1,X_.containerSizeRatio=9/16,X_.isCreated=!1,X_._resolve=function(e){},X_.debug&&Xy({verbose:!0}),X_.register({kind:Du.kind,src:Du}),X_.register({kind:N_.kind,src:N_}),t.AppCreateError=Oe,t.AppManagerNotInitError=De,t.AppNotRegisterError=Re,t.BindContainerRoomPhaseInvalidError=Fe,t.BoxManagerNotFoundError=Ue,t.BoxNotCreatedError=ze,t.BuiltinApps=O_,t.DomEvents=D_,t.IframeBridge=H_,t.IframeEvents=R_,t.InvalidScenePath=Be,t.ParamsInvalidError=je,t.WhiteWebSDKInvalidError=Le,t.WindowManager=X_,t.calculateNextIndex=at,t.reconnectRefresher=Y_},6513:function(e,t,r){var n=r(49766).Buffer;function i(e){return i="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},i(e)}function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.xml2json=t.xml2js=t.json2xml=t.js2xml=void 0;var a=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],u=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c=!1;function h(){c=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}function f(e){var t;c||h();for(var r=e.length,n=r%3,i="",o=[],a=16383,u=0,l=r-n;ul?l:u+a));return 1===n?(t=e[r-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}function p(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)}function v(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[r+f]=255&a,f+=p,a/=256,l-=8);e[r+f-p]|=128*v}var m={}.toString,g=Array.isArray||function(e){return"[object Array]"==m.call(e)};function y(){return b.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(e,t){if(y()=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return 0|e}function k(e){return!(null==e||!e._isBuffer)}function E(e,t){if(k(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ee(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return te(e).length;default:if(n)return ee(e).length;t=(""+t).toLowerCase(),n=!0}}function I(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return G(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return F(this,t,r);case"latin1":case"binary":return W(this,t,r);case"base64":return z(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function A(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function C(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=b.from(t,n)),k(t))return 0===t.length?-1:P(e,t,r,n,i);if("number"==typeof t)return t&=255,b.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):P(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function P(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function z(e,t,r){return 0===t&&r===e.length?f(e):f(e.slice(t,r))}function B(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=U)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},b.prototype.compare=function(e,t,r,n,i){if(!k(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return N(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":return R(this,e,t,r);case"latin1":case"binary":return D(this,e,t,r);case"base64":return L(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var U=4096;function F(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function Y(e,t,r,n,i,o){if(!k(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function $(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function X(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function q(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Q(e,t,r,n,i){return i||q(e,0,r,4),v(e,t,r,n,23,4),r+4}function Z(e,t,r,n,i){return i||q(e,0,r,8),v(e,t,r,n,52,8),r+8}b.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},b.prototype.readUInt8=function(e,t){return t||H(e,1,this.length),this[e]},b.prototype.readUInt16LE=function(e,t){return t||H(e,2,this.length),this[e]|this[e+1]<<8},b.prototype.readUInt16BE=function(e,t){return t||H(e,2,this.length),this[e]<<8|this[e+1]},b.prototype.readUInt32LE=function(e,t){return t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},b.prototype.readUInt32BE=function(e,t){return t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},b.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},b.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},b.prototype.readInt8=function(e,t){return t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},b.prototype.readInt16LE=function(e,t){t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt16BE=function(e,t){t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt32LE=function(e,t){return t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},b.prototype.readInt32BE=function(e,t){return t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},b.prototype.readFloatLE=function(e,t){return t||H(e,4,this.length),p(this,e,!0,23,4)},b.prototype.readFloatBE=function(e,t){return t||H(e,4,this.length),p(this,e,!1,23,4)},b.prototype.readDoubleLE=function(e,t){return t||H(e,8,this.length),p(this,e,!0,52,8)},b.prototype.readDoubleBE=function(e,t){return t||H(e,8,this.length),p(this,e,!1,52,8)},b.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Y(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},b.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,1,255,0),b.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},b.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},b.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},b.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):X(this,e,t,!0),t+4},b.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):X(this,e,t,!1),t+4},b.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Y(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},b.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Y(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},b.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,1,127,-128),b.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},b.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},b.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},b.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,2147483647,-2147483648),b.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):X(this,e,t,!0),t+4},b.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),b.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):X(this,e,t,!1),t+4},b.prototype.writeFloatLE=function(e,t,r){return Q(this,e,t,!0,r)},b.prototype.writeFloatBE=function(e,t,r){return Q(this,e,t,!1,r)},b.prototype.writeDoubleLE=function(e,t,r){return Z(this,e,t,!0,r)},b.prototype.writeDoubleBE=function(e,t,r){return Z(this,e,t,!1,r)},b.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!b.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function te(e){return function(e){var t,r,n,i,o,a;c||h();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new l(3*s/4-o),n=o>0?s-4:s;var d=0;for(t=0,r=0;t>16&255,a[d++]=i>>8&255,a[d++]=255&i;return 2===o?(i=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,a[d++]=255&i):1===o&&(i=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,a[d++]=i>>8&255,a[d++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function re(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ne(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ie={};function oe(){}function ae(){ae.init.call(this)}function se(e){return void 0===e._maxListeners?ae.defaultMaxListeners:e._maxListeners}function ue(e,t,r){if(t)e.call(r);else for(var n=e.length,i=me(e,n),o=0;o0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function pe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function ve(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function me(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function ge(){throw new Error("setTimeout has not been defined")}function ye(){throw new Error("clearTimeout has not been defined")}oe.prototype=Object.create(null),ae.EventEmitter=ae,ae.usingDomains=!1,ae.prototype.domain=void 0,ae.prototype._events=void 0,ae.prototype._maxListeners=void 0,ae.defaultMaxListeners=10,ae.init=function(){this.domain=null,ae.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new oe,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ae.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ae.prototype.getMaxListeners=function(){return se(this)},ae.prototype.emit=function(e){var t,r,n,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:ue(r,c,this);break;case 2:le(r,c,this,arguments[1]);break;case 3:ce(r,c,this,arguments[1],arguments[2]);break;case 4:he(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new oe,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var _e=ge,be=ye;function xe(e){if(_e===setTimeout)return setTimeout(e,0);if((_e===ge||!_e)&&setTimeout)return _e=setTimeout,setTimeout(e,0);try{return _e(e,0)}catch(t){try{return _e.call(null,e,0)}catch(t){return _e.call(this,e,0)}}}"function"==typeof a.setTimeout&&(_e=setTimeout),"function"==typeof a.clearTimeout&&(be=clearTimeout);var we,Se=[],Te=!1,Me=-1;function ke(){Te&&we&&(Te=!1,we.length?Se=we.concat(Se):Me=-1,Se.length&&Ee())}function Ee(){if(!Te){var e=xe(ke);Te=!0;for(var t=Se.length;t;){for(we=Se,Se=[];++Me1)for(var r=1;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),et(t)?r.showHidden=t:t&&ct(r,t),nt(r.showHidden)&&(r.showHidden=!1),nt(r.depth)&&(r.depth=2),nt(r.colors)&&(r.colors=!1),nt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=qe),Ze(r,e,r.depth)}function qe(e,t){var r=Xe.styles[t];return r?"["+Xe.colors[r][0]+"m"+e+"["+Xe.colors[r][1]+"m":e}function Qe(e,t){return e}function Ze(e,t,r){if(e.customInspect&&t&&ut(t.inspect)&&t.inspect!==Xe&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return rt(n)||(n=Ze(e,n,r)),n}var i=function(e,t){if(nt(t))return e.stylize("undefined","undefined");if(rt(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(et(t))return e.stylize(""+t,"boolean");if(tt(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),st(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ke(t);if(0===o.length){if(ut(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(it(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(at(t))return e.stylize(Date.prototype.toString.call(t),"date");if(st(t))return Ke(t)}var u,l,c="",h=!1,d=["{","}"];(u=t,Array.isArray(u)&&(h=!0,d=["[","]"]),ut(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return it(t)&&(c=" "+RegExp.prototype.toString.call(t)),at(t)&&(c=" "+Date.prototype.toUTCString.call(t)),st(t)&&(c=" "+Ke(t)),0!==o.length||h&&0!=t.length?r<0?it(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=h?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,d)):d[0]+c+d[1]}function Ke(e){return"["+Error.prototype.toString.call(e)+"]"}function Je(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),ht(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=tt(r)?Ze(e,u.value,null):Ze(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),nt(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function et(e){return"boolean"==typeof e}function tt(e){return null===e}function rt(e){return"string"==typeof e}function nt(e){return void 0===e}function it(e){return ot(e)&&"[object RegExp]"===lt(e)}function ot(e){return"object"===i(e)&&null!==e}function at(e){return ot(e)&&"[object Date]"===lt(e)}function st(e){return ot(e)&&("[object Error]"===lt(e)||e instanceof Error)}function ut(e){return"function"==typeof e}function lt(e){return Object.prototype.toString.call(e)}function ct(e,t){if(!t||!ot(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function ht(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dt(){this.head=null,this.tail=null,this.length=0}Xe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Xe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},dt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},dt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},dt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},dt.prototype.clear=function(){this.head=this.tail=null,this.length=0},dt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},dt.prototype.concat=function(e){if(0===this.length)return b.alloc(0);if(1===this.length)return this.head.data;for(var t=b.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var ft=b.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pt(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!ft(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=mt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=gt;break;default:return void(this.write=vt)}this.charBuffer=new b(6),this.charReceived=0,this.charLength=0}function vt(e){return e.toString(this.encoding)}function mt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function gt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}pt.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},pt.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},pt.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t};var yt=Object.freeze({__proto__:null,StringDecoder:pt});xt.ReadableState=bt;var _t=function(e){if(nt(Ye)&&(Ye=Fe.env.NODE_DEBUG||""),e=e.toUpperCase(),!$e[e])if(new RegExp("\\b"+e+"\\b","i").test(Ye)){$e[e]=function(){var t=Ve.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else $e[e]=function(){};return $e[e]}("stream");function bt(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof qt&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new dt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new pt(e.encoding),this.encoding=e.encoding)}function xt(e){if(!(this instanceof xt))return new xt(e);this._readableState=new bt(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ae.call(this)}function wt(e,t,r,n,i){var o=function(e,t){var r=null;b.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Mt(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||n||(r=t.decoder.write(r),u=!t.objectMode&&0===r.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Mt(e))),function(e,t){t.readingMore||(t.readingMore=!0,Ie(Et,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=St?e=St:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Mt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_t("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ie(kt,e):kt(e))}function kt(e){_t("emit readable"),e.emit("readable"),Ct(e)}function Et(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=b.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function Nt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ie(Ot,t,e))}function Ot(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Rt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return _t("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Nt(this):Mt(this),null;if(0===(e=Tt(e,t))&&t.ended)return 0===t.length&&Nt(this),null;var n,i=t.needReadable;return _t("need readable",i),(0===t.length||t.length-e0?Pt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Nt(this)),null!==n&&this.emit("data",n),n},xt.prototype._read=function(e){this.emit("error",new Error("not implemented"))},xt.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,_t("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){_t("onunpipe"),e===r&&l()}function a(){_t("onend"),e.end()}n.endEmitted?Ie(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;_t("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,Ct(e))}}(r);e.on("drain",s);var u=!1;function l(){_t("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",l),r.removeListener("data",h),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var c=!1;function h(t){_t("ondata"),c=!1,!1!==e.write(t)||c||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Rt(n.pipes,e))&&!u&&(_t("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function d(t){var r;_t("onerror",t),v(),e.removeListener("error",d),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function f(){e.removeListener("finish",p),v()}function p(){_t("onfinish"),e.removeListener("close",f),v()}function v(){_t("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",r),n.flowing||(_t("pipe resume"),r.resume()),e},xt.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},zt.prototype._write=function(e,t,r){r(new Error("not implemented"))},zt.prototype._writev=null,zt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Vt(e,t),r&&(t.finished?Ie(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},We(qt,xt);for(var Yt=Object.keys(zt.prototype),$t=0;$t"===a?(k(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=S.TEXT):v(a)?(n.state=S.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case S.SGML_DECL_QUOTED:a===n.q&&(n.state=S.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case S.DOCTYPE:">"===a?(n.state=S.TEXT,k(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=S.DOCTYPE_DTD:v(a)&&(n.state=S.DOCTYPE_QUOTED,n.q=a));continue;case S.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:n.doctype+=a,"]"===a?n.state=S.DOCTYPE:v(a)&&(n.state=S.DOCTYPE_DTD_QUOTED,n.q=a);continue;case S.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=S.DOCTYPE_DTD,n.q="");continue;case S.COMMENT:"-"===a?n.state=S.COMMENT_ENDING:n.comment+=a;continue;case S.COMMENT_ENDING:"-"===a?(n.state=S.COMMENT_ENDED,n.comment=I(n.opt,n.comment),n.comment&&k(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==a?(P(n,"Malformed comment"),n.comment+="--"+a,n.state=S.COMMENT):n.state=S.TEXT;continue;case S.CDATA:"]"===a?n.state=S.CDATA_ENDING:n.cdata+=a;continue;case S.CDATA_ENDING:"]"===a?n.state=S.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===a?(n.cdata&&k(n,"oncdata",n.cdata),k(n,"onclosecdata"),n.cdata="",n.state=S.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=S.CDATA);continue;case S.PROC_INST:"?"===a?n.state=S.PROC_INST_ENDING:p(a)?n.state=S.PROC_INST_BODY:n.procInstName+=a;continue;case S.PROC_INST_BODY:if(!n.procInstBody&&p(a))continue;"?"===a?n.state=S.PROC_INST_ENDING:n.procInstBody+=a;continue;case S.PROC_INST_ENDING:">"===a?(k(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=S.TEXT):(n.procInstBody+="?"+a,n.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:g(h,a)?n.tagName+=a:(N(n),">"===a?D(n):"/"===a?n.state=S.OPEN_TAG_SLASH:(p(a)||P(n,"Invalid character in tag name"),n.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===a?(D(n,!0),L(n)):(P(n,"Forward-slash in opening tag not followed by >"),n.state=S.ATTRIB);continue;case S.ATTRIB:if(p(a))continue;">"===a?D(n):"/"===a?n.state=S.OPEN_TAG_SLASH:g(c,a)?(n.attribName=a,n.attribValue="",n.state=S.ATTRIB_NAME):P(n,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===a?n.state=S.ATTRIB_VALUE:">"===a?(P(n,"Attribute without value"),n.attribValue=n.attribName,R(n),D(n)):p(a)?n.state=S.ATTRIB_NAME_SAW_WHITE:g(h,a)?n.attribName+=a:P(n,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=S.ATTRIB_VALUE;else{if(p(a))continue;P(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",k(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?D(n):g(c,a)?(n.attribName=a,n.state=S.ATTRIB_NAME):(P(n,"Invalid attribute name"),n.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(p(a))continue;v(a)?(n.q=a,n.state=S.ATTRIB_VALUE_QUOTED):(P(n,"Unquoted attribute value"),n.state=S.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case S.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=S.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}R(n),n.q="",n.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:p(a)?n.state=S.ATTRIB:">"===a?D(n):"/"===a?n.state=S.OPEN_TAG_SLASH:g(c,a)?(P(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=S.ATTRIB_NAME):P(n,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!m(a)){"&"===a?n.state=S.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}R(n),">"===a?D(n):n.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(n.tagName)">"===a?L(n):g(h,a)?n.tagName+=a:n.script?(n.script+=""===a?L(n):P(n,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var l,_;switch(n.state){case S.TEXT_ENTITY:l=S.TEXT,_="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:l=S.ATTRIB_VALUE_QUOTED,_="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:l=S.ATTRIB_VALUE_UNQUOTED,_="attribValue"}";"===a?(n[_]+=j(n),n.entity="",n.state=l):g(n.entity.length?f:d,a)?n.entity+=a:(P(n,"Invalid character in entity name"),n[_]+="&"+n.entity+a,n.entity="",n.state=l);continue;default:throw new Error(n,"Unknown state: "+n.state)}n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,o=0,a=r.length;on)switch(r[o]){case"textNode":E(t);break;case"cdata":k(t,"oncdata",t.cdata),t.cdata="";break;case"script":k(t,"onscript",t.script),t.script="";break;default:A(t,"Max buffer length exceeded: "+r[o])}i=Math.max(i,s)}var u=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=u+t.position}(n);return n} -/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;E(e=this),""!==e.cdata&&(k(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(k(e,"onscript",e.script),e.script="")}};try{t=nr.Stream}catch(e){t=function(){}}var o=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,r){if(!(this instanceof a))return new a(e,r);t.apply(this),this._parser=new n(e,r),this.writable=!0,this.readable=!0;var i=this;this._parser.onend=function(){i.emit("end")},this._parser.onerror=function(e){i.emit("error",e),i._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(i,"on"+e,{get:function(){return i._parser["on"+e]},set:function(t){if(!t)return i.removeAllListeners(e),i._parser["on"+e]=t,t;i.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof b.isBuffer&&b.isBuffer(e)){if(!this._decoder){var t=ir.StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,r){var n=this;return n._parser["on"+e]||-1===o.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),t.prototype.on.call(n,e,r)};var s="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",l={xml:s,xmlns:u},c=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function v(e){return'"'===e||"'"===e}function m(e){return">"===e||p(e)}function g(e,t){return e.test(t)}function y(e,t){return!g(e,t)}var _,x,w,S=0;for(var T in e.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var r=e.ENTITIES[t],n="number"==typeof r?String.fromCharCode(r):r;e.ENTITIES[t]=n})),e.STATE)e.STATE[e.STATE[T]]=T;function M(e,t,r){e[t]&&e[t](r)}function k(e,t,r){e.textNode&&E(e),M(e,t,r)}function E(e){e.textNode=I(e.opt,e.textNode),e.textNode&&M(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function A(e,t){return E(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,M(e,"onerror",t),e}function C(e){return e.sawRoot&&!e.closedRoot&&P(e,"Unclosed root tag"),e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT&&A(e,"Unexpected end"),E(e),e.c="",e.closed=!0,M(e,"onend"),n.call(e,e.strict,e.opt),e}function P(e,t){if("object"!==i(e)||!(e instanceof n))throw new Error("bad call to strictFail");e.strict&&A(e,t)}function N(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,k(e,"onopentagstart",r)}function O(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],i=r[1];return t&&"xmlns"===e&&(n="xmlns",i=""),{prefix:n,local:i}}function R(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=O(e.attribName,!0),r=t.prefix,n=t.local;if("xmlns"===r)if("xml"===n&&e.attribValue!==s)P(e,"xml: prefix must be bound to "+s+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==u)P(e,"xmlns: prefix must be bound to "+u+"\nActual: "+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,k(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var r=e.tag,n=O(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(P(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix);var i=e.tags[e.tags.length-1]||e;r.ns&&i.ns!==r.ns&&Object.keys(r.ns).forEach((function(t){k(e,"onopennamespace",{prefix:t,uri:r.ns[t]})}));for(var o=0,a=e.attribList.length;o",e.tagName="",void(e.state=S.SCRIPT);k(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--;){if(e.tags[t].name===n)break;P(e,"Unexpected close tag")}if(t<0)return P(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=S.TEXT);e.tagName=r;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,k(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==u.ns&&Object.keys(o.ns).forEach((function(t){var r=o.ns[t];k(e,"onclosenamespace",{prefix:t,uri:r})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=S.TEXT}function j(e){var t,r=e.entity,n=r.toLowerCase(),i="";return e.ENTITIES[r]?e.ENTITIES[r]:e.ENTITIES[n]?e.ENTITIES[n]:("#"===(r=n).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),i=(t=parseInt(r,16)).toString(16)):(r=r.slice(1),i=(t=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==r?(P(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function z(e,t){"<"===t?(e.state=S.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(P(e,"Non-whitespace before first tag."),e.textNode=t,e.state=S.TEXT)}function B(e,t){var r="";return t1114111||x(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(i+1===o||n.length>r)&&(a+=_.apply(null,n),n.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(e)}(ie);var or,ar,sr=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},ur=sr,lr={copyOptions:function(e){var t,r={};for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r},ensureFlagExists:function(e,t){e in t&&"boolean"==typeof t[e]||(t[e]=!1)},ensureSpacesExists:function(e){(!("spaces"in e)||"number"!=typeof e.spaces&&"string"!=typeof e.spaces)&&(e.spaces=0)},ensureAlwaysArrayExists:function(e){"alwaysArray"in e&&("boolean"==typeof e.alwaysArray||ur(e.alwaysArray))||(e.alwaysArray=!1)},ensureKeyExists:function(e,t){e+"Key"in t&&"string"==typeof t[e+"Key"]||(t[e+"Key"]=t.compact?"_"+e:e)},checkFnExists:function(e,t){return e+"Fn"in t}},cr=ie,hr=lr,dr=sr;function fr(e){var t=Number(e);if(!isNaN(t))return t;var r=e.toLowerCase();return"true"===r||"false"!==r&&e}function pr(e,t){var r;if(or.compact){if(!ar[or[e+"Key"]]&&(dr(or.alwaysArray)?-1!==or.alwaysArray.indexOf(or[e+"Key"]):or.alwaysArray)&&(ar[or[e+"Key"]]=[]),ar[or[e+"Key"]]&&!dr(ar[or[e+"Key"]])&&(ar[or[e+"Key"]]=[ar[or[e+"Key"]]]),e+"Fn"in or&&"string"==typeof t&&(t=or[e+"Fn"](t,ar)),"instruction"===e&&("instructionFn"in or||"instructionNameFn"in or))for(r in t)if(t.hasOwnProperty(r))if("instructionFn"in or)t[r]=or.instructionFn(t[r],r,ar);else{var n=t[r];delete t[r],t[or.instructionNameFn(r,n,ar)]=n}dr(ar[or[e+"Key"]])?ar[or[e+"Key"]].push(t):ar[or[e+"Key"]]=t}else{ar[or.elementsKey]||(ar[or.elementsKey]=[]);var i={};if(i[or.typeKey]=e,"instruction"===e){for(r in t)if(t.hasOwnProperty(r))break;i[or.nameKey]="instructionNameFn"in or?or.instructionNameFn(r,t,ar):r,or.instructionHasAttributes?(i[or.attributesKey]=t[r][or.attributesKey],"instructionFn"in or&&(i[or.attributesKey]=or.instructionFn(i[or.attributesKey],r,ar))):("instructionFn"in or&&(t[r]=or.instructionFn(t[r],r,ar)),i[or.instructionKey]=t[r])}else e+"Fn"in or&&(t=or[e+"Fn"](t,ar)),i[or[e+"Key"]]=t;or.addParent&&(i[or.parentKey]=ar),ar[or.elementsKey].push(i)}}function vr(e){var t;if("attributesFn"in or&&e&&(e=or.attributesFn(e,ar)),(or.trim||"attributeValueFn"in or||"attributeNameFn"in or||or.nativeTypeAttributes)&&e)for(t in e)if(e.hasOwnProperty(t)&&(or.trim&&(e[t]=e[t].trim()),or.nativeTypeAttributes&&(e[t]=fr(e[t])),"attributeValueFn"in or&&(e[t]=or.attributeValueFn(e[t],t,ar)),"attributeNameFn"in or)){var r=e[t];delete e[t],e[or.attributeNameFn(t,e[t],ar)]=r}return e}function mr(e){var t={};if(e.body&&("xml"===e.name.toLowerCase()||or.instructionHasAttributes)){for(var r,n=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(r=n.exec(e.body));)t[r[1]]=r[2]||r[3]||r[4];t=vr(t)}if("xml"===e.name.toLowerCase()){if(or.ignoreDeclaration)return;ar[or.declarationKey]={},Object.keys(t).length&&(ar[or.declarationKey][or.attributesKey]=t),or.addParent&&(ar[or.declarationKey][or.parentKey]=ar)}else{if(or.ignoreInstruction)return;or.trim&&(e.body=e.body.trim());var i={};or.instructionHasAttributes&&Object.keys(t).length?(i[e.name]={},i[e.name][or.attributesKey]=t):i[e.name]=e.body,pr("instruction",i)}}function gr(e,t){var r;if("object"===i(e)&&(t=e.attributes,e=e.name),t=vr(t),"elementNameFn"in or&&(e=or.elementNameFn(e,ar)),or.compact){var n;if(r={},!or.ignoreAttributes&&t&&Object.keys(t).length)for(n in r[or.attributesKey]={},t)t.hasOwnProperty(n)&&(r[or.attributesKey][n]=t[n]);!(e in ar)&&(dr(or.alwaysArray)?-1!==or.alwaysArray.indexOf(e):or.alwaysArray)&&(ar[e]=[]),ar[e]&&!dr(ar[e])&&(ar[e]=[ar[e]]),dr(ar[e])?ar[e].push(r):ar[e]=r}else ar[or.elementsKey]||(ar[or.elementsKey]=[]),(r={})[or.typeKey]="element",r[or.nameKey]=e,!or.ignoreAttributes&&t&&Object.keys(t).length&&(r[or.attributesKey]=t),or.alwaysChildren&&(r[or.elementsKey]=[]),ar[or.elementsKey].push(r);r[or.parentKey]=ar,ar=r}function yr(e){or.ignoreText||(e.trim()||or.captureSpacesBetweenElements)&&(or.trim&&(e=e.trim()),or.nativeType&&(e=fr(e)),or.sanitize&&(e=e.replace(/&/g,"&").replace(//g,">")),pr("text",e))}function _r(e){or.ignoreComment||(or.trim&&(e=e.trim()),pr("comment",e))}function br(e){var t=ar[or.parentKey];or.addParent||delete ar[or.parentKey],ar=t}function xr(e){or.ignoreCdata||(or.trim&&(e=e.trim()),pr("cdata",e))}function wr(e){or.ignoreDoctype||(e=e.replace(/^ /,""),or.trim&&(e=e.trim()),pr("doctype",e))}function Sr(e){e.note=e,"onErrorFn"in or&&or.onErrorFn(e)}var Tr=function(e,t){var r=cr.parser(!0,{}),n={};ar=n,or=function(e){return or=hr.copyOptions(e),hr.ensureFlagExists("ignoreDeclaration",or),hr.ensureFlagExists("ignoreInstruction",or),hr.ensureFlagExists("ignoreAttributes",or),hr.ensureFlagExists("ignoreText",or),hr.ensureFlagExists("ignoreComment",or),hr.ensureFlagExists("ignoreCdata",or),hr.ensureFlagExists("ignoreDoctype",or),hr.ensureFlagExists("compact",or),hr.ensureFlagExists("alwaysChildren",or),hr.ensureFlagExists("addParent",or),hr.ensureFlagExists("trim",or),hr.ensureFlagExists("nativeType",or),hr.ensureFlagExists("nativeTypeAttributes",or),hr.ensureFlagExists("sanitize",or),hr.ensureFlagExists("instructionHasAttributes",or),hr.ensureFlagExists("captureSpacesBetweenElements",or),hr.ensureAlwaysArrayExists(or),hr.ensureKeyExists("declaration",or),hr.ensureKeyExists("instruction",or),hr.ensureKeyExists("attributes",or),hr.ensureKeyExists("text",or),hr.ensureKeyExists("comment",or),hr.ensureKeyExists("cdata",or),hr.ensureKeyExists("doctype",or),hr.ensureKeyExists("type",or),hr.ensureKeyExists("name",or),hr.ensureKeyExists("elements",or),hr.ensureKeyExists("parent",or),or}(t),r.opt={strictEntities:!0},r.onopentag=gr,r.ontext=yr,r.oncomment=_r,r.onclosetag=br,r.onerror=Sr,r.oncdata=xr,r.ondoctype=wr,r.onprocessinginstruction=mr;try{r.write(e).close()}catch(e){}if(n[or.elementsKey]){var i=n[or.elementsKey];delete n[or.elementsKey],n[or.elementsKey]=i,delete n.text}return n};t.xml2js=Tr;var Mr=lr,kr=Tr;t.xml2json=function(e,t){var r,n,i,o;return r=function(e){var t=Mr.copyOptions(e);return Mr.ensureSpacesExists(t),t}(t),n=kr(e,r),o="compact"in r&&r.compact?"_parent":"parent",i="addParent"in r&&r.addParent?JSON.stringify(n,(function(e,t){return e===o?"_":t}),r.spaces):JSON.stringify(n,null,r.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};var Er,Ir,Ar=lr,Cr=sr;function Pr(e,t,r){return(!r&&e.spaces?"\n":"")+Array(t+1).join(e.spaces)}function Nr(e,t,r){if(t.ignoreAttributes)return"";"attributesFn"in t&&(e=t.attributesFn(e,Ir,Er));var n,i,o,a,s=[];for(n in e)e.hasOwnProperty(n)&&null!==e[n]&&void 0!==e[n]&&(a=t.noQuotesForNativeAttributes&&"string"!=typeof e[n]?"":'"',i=(i=""+e[n]).replace(/&/g,"&").replace(/"}function Rr(e,t,r){if(t.ignoreInstruction)return"";var n;for(n in e)if(e.hasOwnProperty(n))break;var o="instructionNameFn"in t?t.instructionNameFn(n,e[n],Ir,Er):n;if("object"===i(e[n]))return Er=e,Ir=o,"";var a=e[n]?e[n]:"";return"instructionFn"in t&&(a=t.instructionFn(a,n,Ir,Er)),""}function Dr(e,t){return t.ignoreComment?"":"\x3c!--"+("commentFn"in t?t.commentFn(e,Ir,Er):e)+"--\x3e"}function Lr(e,t){return t.ignoreCdata?"":"","]]]]>"))+"]]>"}function jr(e,t){return t.ignoreDoctype?"":""}function zr(e,t){return t.ignoreText?"":(e=(e=(e=""+e).replace(/&/g,"&")).replace(/&/g,"&").replace(//g,">"),"textFn"in t?t.textFn(e,Ir,Er):e)}function Br(e,t,r,n){return e.reduce((function(e,i){var o=Pr(t,r,n&&!e);switch(i.type){case"element":return e+o+function(e,t,r){Er=e,Ir=e.name;var n=[],i="elementNameFn"in t?t.elementNameFn(e.name,e):e.name;n.push("<"+i),e[t.attributesKey]&&n.push(Nr(e[t.attributesKey],t,r));var o=e[t.elementsKey]&&e[t.elementsKey].length||e[t.attributesKey]&&"preserve"===e[t.attributesKey]["xml:space"];return o||(o="fullTagEmptyElementFn"in t?t.fullTagEmptyElementFn(e.name,e):t.fullTagEmptyElement),o?(n.push(">"),e[t.elementsKey]&&e[t.elementsKey].length&&(n.push(Br(e[t.elementsKey],t,r+1)),Er=e,Ir=e.name),n.push(t.spaces&&function(e,t){var r;if(e.elements&&e.elements.length)for(r=0;r")):n.push("/>"),n.join("")}(i,t,r);case"comment":return e+o+Dr(i[t.commentKey],t);case"doctype":return e+o+jr(i[t.doctypeKey],t);case"cdata":return e+(t.indentCdata?o:"")+Lr(i[t.cdataKey],t);case"text":return e+(t.indentText?o:"")+zr(i[t.textKey],t);case"instruction":var a={};return a[i[t.nameKey]]=i[t.attributesKey]?i:i[t.instructionKey],e+(t.indentInstruction?o:"")+Rr(a,t,r)}}),"")}function Ur(e,t,r){var n;for(n in e)if(e.hasOwnProperty(n))switch(n){case t.parentKey:case t.attributesKey:break;case t.textKey:if(t.indentText||r)return!0;break;case t.cdataKey:if(t.indentCdata||r)return!0;break;case t.instructionKey:if(t.indentInstruction||r)return!0;break;case t.doctypeKey:case t.commentKey:default:return!0}return!1}function Fr(e,t,r,n,o){Er=e,Ir=t;var a="elementNameFn"in r?r.elementNameFn(t,e):t;if(null==e||""===e)return"fullTagEmptyElementFn"in r&&r.fullTagEmptyElementFn(t,e)||r.fullTagEmptyElement?"<"+a+">":"<"+a+"/>";var s=[];if(t){if(s.push("<"+a),"object"!==i(e))return s.push(">"+zr(e,r)+""),s.join("");e[r.attributesKey]&&s.push(Nr(e[r.attributesKey],r,n));var u=Ur(e,r,!0)||e[r.attributesKey]&&"preserve"===e[r.attributesKey]["xml:space"];if(u||(u="fullTagEmptyElementFn"in r?r.fullTagEmptyElementFn(t,e):r.fullTagEmptyElement),!u)return s.push("/>"),s.join("");s.push(">")}return s.push(Wr(e,r,n+1,!1)),Er=e,Ir=t,t&&s.push((o?Pr(r,n,!1):"")+""),s.join("")}function Wr(e,t,r,n){var i,o,a,s=[];for(o in e)if(e.hasOwnProperty(o))for(a=Cr(e[o])?e[o]:[e[o]],i=0;i=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t=1?1:1-Math.pow(2,-10*h);},easeInOutExpo:function easeInOutExpo(h){return h<=0?0:h>=1?1:h<0.5?Math.pow(2,20*h-10)/2:(2-Math.pow(2,-20*h+10))/2;}};var _=/*#__PURE__*/function(){function _(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,_);this.x=r,this.y=t,this.z=e;}return _createClass(_,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(r){return this.z=r,this;}},{key:"setXY",value:function setXY(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;return this.x=r,this.y=t,this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=r,this.y=t,this.z=e,this;}},{key:"setTo",value:function setTo(_ref){var _ref$x=_ref.x,r=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,e=_ref$z===void 0?1:_ref$z;return this.x=r,this.y=t,this.z=e,this;}},{key:"rot",value:function rot(r){if(r===0)return this;var t=this.x,e=this.y,n=Math.sin(r),i=Math.cos(r);return this.x=t*i-e*n,this.y=t*n+e*i,this;}},{key:"rotWith",value:function rotWith(r,t){if(t===0)return this;var e=this.x-r.x,n=this.y-r.y,i=Math.sin(t),a=Math.cos(t);return this.x=r.x+(e*a-n*i),this.y=r.y+(e*i+n*a),this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z;return new _(r,t,e);}},{key:"sub",value:function sub(r){return this.x-=r.x,this.y-=r.y,this;}},{key:"subXY",value:function subXY(r,t){return this.x-=r,this.y-=t,this;}},{key:"subScalar",value:function subScalar(r){return this.x-=r,this.y-=r,this;}},{key:"add",value:function add(r){return this.x+=r.x,this.y+=r.y,this;}},{key:"addXY",value:function addXY(r,t){return this.x+=r,this.y+=t,this;}},{key:"addScalar",value:function addScalar(r){return this.x+=r,this.y+=r,this;}},{key:"clamp",value:function clamp(r,t){return this.x=Math.max(this.x,r),this.y=Math.max(this.y,r),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(r){return this.x/=r,this.y/=r,this;}},{key:"divV",value:function divV(r){return this.x/=r.x,this.y/=r.y,this;}},{key:"mul",value:function mul(r){return this.x*=r,this.y*=r,this;}},{key:"mulV",value:function mulV(r){return this.x*=r.x,this.y*=r.y,this;}},{key:"abs",value:function abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this;}},{key:"nudge",value:function nudge(r,t){var e=_.Tan(r,this);return this.add(e.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(r){return this.x=this.y*r.z-this.z*r.y,this.y=this.z*r.x-this.x*r.z,this;}},{key:"dpr",value:function dpr(r){return _.Dpr(this,r);}},{key:"cpr",value:function cpr(r){return _.Cpr(this,r);}},{key:"len2",value:function len2(){return _.Len2(this);}},{key:"len",value:function len(){return _.Len(this);}},{key:"pry",value:function pry(r){return _.Pry(this,r);}},{key:"per",value:function per(){var r=this.x,t=this.y;return this.x=t,this.y=-r,this;}},{key:"uni",value:function uni(){return _.Uni(this);}},{key:"tan",value:function tan(r){return _.Tan(this,r);}},{key:"dist",value:function dist(r){return _.Dist(this,r);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(r,t){return _.DistanceToLineSegment(r,t,this);}},{key:"slope",value:function slope(r){return _.Slope(this,r);}},{key:"snapToGrid",value:function snapToGrid(r){return this.x=Math.round(this.x/r)*r,this.y=Math.round(this.y/r)*r,this;}},{key:"angle",value:function angle(r){return _.Angle(this,r);}},{key:"toAngle",value:function toAngle(){return _.ToAngle(this);}},{key:"lrp",value:function lrp(r,t){return this.x=this.x+(r.x-this.x)*t,this.y=this.y+(r.y-this.y)*t,this;}},{key:"equals",value:function equals(r,t){return _.Equals(this,r,t);}},{key:"equalsXY",value:function equalsXY(r,t){return _.EqualsXY(this,r,t);}},{key:"norm",value:function norm(){var r=this.len();return this.x=r===0?0:this.x/r,this.y=r===0?0:this.y/r,this;}},{key:"toFixed",value:function toFixed(){return _.ToFixed(this);}},{key:"toString",value:function toString(){return _.ToString(_.ToFixed(this));}},{key:"toJson",value:function toJson(){return _.ToJson(this);}},{key:"toArray",value:function toArray(){return _.ToArray(this);}}],[{key:"Add",value:function Add(r,t){return new _(r.x+t.x,r.y+t.y);}},{key:"AddXY",value:function AddXY(r,t,e){return new _(r.x+t,r.y+e);}},{key:"Sub",value:function Sub(r,t){return new _(r.x-t.x,r.y-t.y);}},{key:"SubXY",value:function SubXY(r,t,e){return new _(r.x-t,r.y-e);}},{key:"AddScalar",value:function AddScalar(r,t){return new _(r.x+t,r.y+t);}},{key:"SubScalar",value:function SubScalar(r,t){return new _(r.x-t,r.y-t);}},{key:"Div",value:function Div(r,t){return new _(r.x/t,r.y/t);}},{key:"Mul",value:function Mul(r,t){return new _(r.x*t,r.y*t);}},{key:"DivV",value:function DivV(r,t){return new _(r.x/t.x,r.y/t.y);}},{key:"MulV",value:function MulV(r,t){return new _(r.x*t.x,r.y*t.y);}},{key:"Neg",value:function Neg(r){return new _(-r.x,-r.y);}},{key:"Per",value:function Per(r){return new _(r.y,-r.x);}},{key:"Dist2",value:function Dist2(r,t){return _.Sub(r,t).len2();}},{key:"Abs",value:function Abs(r){return new _(Math.abs(r.x),Math.abs(r.y));}},{key:"Dist",value:function Dist(r,t){return Math.hypot(r.y-t.y,r.x-t.x);}},{key:"Dpr",value:function Dpr(r,t){return r.x*t.x+r.y*t.y;}},{key:"Cross",value:function Cross(r,t){return new _(r.y*t.z-r.z*t.y,r.z*t.x-r.x*t.z// A.z = A.x * V.y - A.y * V.x\n);}},{key:"Cpr",value:function Cpr(r,t){return r.x*t.y-t.x*r.y;}},{key:"Len2",value:function Len2(r){return r.x*r.x+r.y*r.y;}},{key:"Len",value:function Len(r){return Math.hypot(r.x,r.y);}},{key:"Pry",value:function Pry(r,t){return _.Dpr(r,t)/_.Len(t);}},{key:"Uni",value:function Uni(r){return _.Div(r,_.Len(r));}},{key:"Tan",value:function Tan(r,t){return _.Uni(_.Sub(r,t));}},{key:"Min",value:function Min(r,t){return new _(Math.min(r.x,t.x),Math.min(r.y,t.y));}},{key:"Max",value:function Max(r,t){return new _(Math.max(r.x,t.x),Math.max(r.y,t.y));}},{key:"From",value:function From(r){return new _().add(r);}},{key:"FromArray",value:function FromArray(r){return new _(r[0],r[1]);}},{key:"Rot",value:function Rot(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=Math.sin(t),n=Math.cos(t);return new _(r.x*n-r.y*e,r.x*e+r.y*n);}},{key:"RotWith",value:function RotWith(r,t,e){var n=r.x-t.x,i=r.y-t.y,a=Math.sin(e),o=Math.cos(e);return new _(t.x+(n*o-i*a),t.y+(n*a+i*o));}/**\n * Get the nearest point on a line with a known unit vector that passes through point A\n *\n * ```ts\n * Vec.nearestPointOnLineThroughPoint(A, u, Point)\n * ```\n *\n * @param A - Any point on the line\n * @param u - The unit vector for the line.\n * @param P - A point not on the line to test.\n */},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(r,t,e){return _.Mul(t,_.Sub(e,r).pry(t)).add(r);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var i=_.Tan(t,r),a=_.Add(r,_.Mul(i,_.Sub(e,r).pry(i)));if(n){if(a.xMath.max(r.x,t.x))return _.Cast(r.x>t.x?r:t);if(a.yMath.max(r.y,t.y))return _.Cast(r.y>t.y?r:t);}return a;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(r,t,e){return _.Dist(e,_.NearestPointOnLineThroughPoint(r,t,e));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return _.Dist(e,_.NearestPointOnLineSegment(r,t,e,n));}},{key:"Snap",value:function Snap(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}},{key:"Cast",value:function Cast(r){return r instanceof _?r:_.From(r);}},{key:"Slope",value:function Slope(r,t){return r.x===t.y?NaN:(r.y-t.y)/(r.x-t.x);}},{key:"Angle",value:function Angle(r,t){return Math.atan2(t.y-r.y,t.x-r.x);}},{key:"Lrp",value:function Lrp(r,t,e){return _.Sub(t,r).mul(e).add(r);}},{key:"Med",value:function Med(r,t){return new _((r.x+t.x)/2,(r.y+t.y)/2);}},{key:"Equals",value:function Equals(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(r.x-t.x)2&&arguments[2]!==undefined?arguments[2]:1e-4;return _.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))1&&arguments[1]!==undefined?arguments[1]:2;return new _(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t));}},{key:"Nudge",value:function Nudge(r,t,e){return _.Add(r,_.Tan(t,r).mul(e));}},{key:"ToString",value:function ToString(r){return"".concat(r.x,", ").concat(r.y);}},{key:"ToAngle",value:function ToAngle(r){var t=Math.atan2(r.y,r.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.cos(r)*t,Math.sin(r)*t);}},{key:"ToArray",value:function ToArray(r){return[r.x,r.y,r.z];}},{key:"ToJson",value:function ToJson(r){var t=r.x,e=r.y,n=r.z;return{x:t,y:e,z:n};}},{key:"Average",value:function Average(r){var t=r.length,e=new _(0,0);for(var n=0;n2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:8;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}}]);}();var ki=function ki(h){return h<0.5?2*h*h:-1+(4-2*h)*h;};var xt=/*#__PURE__*/function(_ref2){function xt(){var _this13;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,xt);_this13=_callSuper(this,xt,[r,t,e]),_this13.x=r,_this13.y=t,_this13.z=e,_this13.v=n,_this13.t=i,_this13.a=a;return _this13;}_inherits(xt,_ref2);return _createClass(xt,[{key:"timestamp",get:function get(){return this.t;}},{key:"pressure",get:function get(){return this.z;}},{key:"angleNum",get:function get(){return this.a;}},{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setA",value:function setA(r){this.a=r;}},{key:"setT",value:function setT(r){this.t=r;}},{key:"setv",value:function setv(r){return this.v={x:r.x,y:r.y},this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a,o={x:n.x,y:n.y};return new xt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return xt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return xt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return xt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new xt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new xt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return xt.Len(r.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(r,t,e){var n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,o=e.y-t.y;var s=0;var l=Math.sqrt(n*n+a*a),d=Math.sqrt(i*i+o*o);if(l&&d){var c=n*i+a*o;s=Math.acos(c/(l*d)),s=s/Math.PI*180;var p=n*o-a*i;p=p>0?1:-1,s=180+p*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return xt.Len(r.clone().sub(t))3&&arguments[3]!==undefined?arguments[3]:2;var i=r.x-t.x,a=r.y-t.y,o=Math.sin(e),s=Math.cos(e),l=Math.pow(10,n),d=Math.floor((t.x+(i*s-a*o))*l)/l,c=Math.floor((t.y+(i*o+a*s))*l)/l;return new xt(d,c);}/**\n * 根据圆心和半径,获取圆上的等份点\n * @param o 圆心\n * @param radius 半径 \n * @param average 均分数\n * @returns \n */},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new _(1,1),i=Math.PI+1e-3,a=xt.Add(r,xt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,l=s;l<=1;l+=s)o.push(xt.RotWith(a,r,i*2*l));return o;}/**\n * 根据圆心和圆上的起始点,获取半圆上的等份点\n * @param o 圆心 \n * @param p 圆弧起始点\n * @param radian 1,逆时针180度 -1,顺时针 \n * @param average 均分数\n * @returns \n */},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var i=e*(Math.PI+1e-3),a=[];for(var o=1/n,s=o;s<=1;s+=o)a.push(xt.RotWith(t,r,i*s));return a;}}]);}(_);var Wt=/******/function(h){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={/******/i:e,/******/l:!1,/******/exports:{}/******/};return h[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=h,t.c=r,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i});},t.r=function(e){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,n){if(n&1&&(e=t(e)),n&8||n&4&&_typeof(e)=="object"&&e&&e.__esModule)return e;var i=/* @__PURE__ */Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),n&2&&typeof e!="string")for(var a in e)t.d(i,a,function(o){return e[o];}.bind(null,a));return i;},t.n=function(e){var n=e&&e.__esModule?(/******/function(){return e["default"];}):(/******/function(){return e;});return t.d(n,"a",n),n;},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n);},t.p="/js/",t(t.s=0);}([/* 0 */ /***/function(h,r,t){t.r(r),t.d(r,"version",function(){return K;}),t.d(r,"helpers",function(){return W;}),t.d(r,"createElement",function(){return w;}),t.d(r,"isSpriteNode",function(){return I;}),t.d(r,"registerNode",function(){return A;});var e=t(12);t.d(r,"ENV",function(){return e.ENV;});var n=t(68);t.d(r,"requestAnimationFrame",function(){return n.requestAnimationFrame;}),t.d(r,"cancelAnimationFrame",function(){return n.cancelAnimationFrame;});var i=t(70);t.d(r,"Node",function(){return i["default"];});var a=t(217);t.d(r,"Cloud",function(){return a["default"];});var o=t(219);t.d(r,"Block",function(){return o["default"];});var s=t(224);t.d(r,"Sprite",function(){return s["default"];});var l=t(226);t.d(r,"Path",function(){return l["default"];});var d=t(229);t.d(r,"Rect",function(){return d["default"];});var c=t(231);t.d(r,"Triangle",function(){return c["default"];});var p=t(236);t.d(r,"Parallel",function(){return p["default"];});var y=t(238);t.d(r,"Regular",function(){return y["default"];});var P=t(240);t.d(r,"Star",function(){return P["default"];});var T=t(242);t.d(r,"Ellipse",function(){return T["default"];});var v=t(244);t.d(r,"Arc",function(){return v["default"];});var x=t(246);t.d(r,"Ring",function(){return x["default"];});var f=t(232);t.d(r,"Polyline",function(){return f["default"];});var g=t(248);t.d(r,"Label",function(){return g["default"];});var u=t(250);t.d(r,"Group",function(){return u["default"];});var m=t(286);t.d(r,"Layer",function(){return m["default"];});var M=t(287);t.d(r,"SpriteSvg",function(){return M["default"];});var E=t(289);t.d(r,"LayerWorker",function(){return E["default"];});var R=t(290);t.d(r,"Scene",function(){return R["default"];});var b=t(213),O=t(221);t.d(r,"Color",function(){return O.Color;}),t.d(r,"Gradient",function(){return O.Gradient;});var L=t(72);t(1).glMatrix.setMatrixArrayType(Array);var w=b["default"].createElement,I=b["default"].isSpriteNode,A=b["default"].registerNode,W={parseColor:O.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};var z;z="3.8.3";var K=z;},/* 1 */ /***/function(h,r,t){t.r(r);var e=t(2);t.d(r,"glMatrix",function(){return e;});var n=t(3);t.d(r,"mat2",function(){return n;});var i=t(4);t.d(r,"mat2d",function(){return i;});var a=t(5);t.d(r,"mat3",function(){return a;});var o=t(6);t.d(r,"mat4",function(){return o;});var s=t(7);t.d(r,"quat",function(){return s;});var l=t(10);t.d(r,"quat2",function(){return l;});var d=t(11);t.d(r,"vec2",function(){return d;});var c=t(8);t.d(r,"vec3",function(){return c;});var p=t(9);t.d(r,"vec4",function(){return p;});},/* 2 */ /***/function(h,r,t){t.r(r),t.d(r,"EPSILON",function(){return e;}),t.d(r,"ARRAY_TYPE",function(){return n;}),t.d(r,"RANDOM",function(){return i;}),t.d(r,"setMatrixArrayType",function(){return a;}),t.d(r,"toRadian",function(){return s;}),t.d(r,"equals",function(){return l;});var e=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function a(d){n=d;}var o=Math.PI/180;function s(d){return d*o;}function l(d,c){return Math.abs(d-c)<=e*Math.max(1,Math.abs(d),Math.abs(c));}Math.hypot||(Math.hypot=function(){for(var d=0,c=arguments.length;c--;)d+=arguments[c]*arguments[c];return Math.sqrt(d);});},/* 3 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return l;}),t.d(r,"transpose",function(){return d;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return P;}),t.d(r,"rotate",function(){return T;}),t.d(r,"scale",function(){return v;}),t.d(r,"fromRotation",function(){return x;}),t.d(r,"fromScaling",function(){return f;}),t.d(r,"str",function(){return g;}),t.d(r,"frob",function(){return u;}),t.d(r,"LDU",function(){return m;}),t.d(r,"add",function(){return M;}),t.d(r,"subtract",function(){return E;}),t.d(r,"exactEquals",function(){return R;}),t.d(r,"equals",function(){return b;}),t.d(r,"multiplyScalar",function(){return O;}),t.d(r,"multiplyScalarAndAdd",function(){return L;}),t.d(r,"mul",function(){return w;}),t.d(r,"sub",function(){return I;});var e=t(2);function n(){var A=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(A[1]=0,A[2]=0),A[0]=1,A[3]=1,A;}function i(A){var W=new e.ARRAY_TYPE(4);return W[0]=A[0],W[1]=A[1],W[2]=A[2],W[3]=A[3],W;}function a(A,W){return A[0]=W[0],A[1]=W[1],A[2]=W[2],A[3]=W[3],A;}function o(A){return A[0]=1,A[1]=0,A[2]=0,A[3]=1,A;}function s(A,W,z,K){var k=new e.ARRAY_TYPE(4);return k[0]=A,k[1]=W,k[2]=z,k[3]=K,k;}function l(A,W,z,K,k){return A[0]=W,A[1]=z,A[2]=K,A[3]=k,A;}function d(A,W){if(A===W){var z=W[1];A[1]=W[2],A[2]=z;}else A[0]=W[0],A[1]=W[2],A[2]=W[1],A[3]=W[3];return A;}function c(A,W){var z=W[0],K=W[1],k=W[2],q=W[3],U=z*q-k*K;return U?(U=1/U,A[0]=q*U,A[1]=-K*U,A[2]=-k*U,A[3]=z*U,A):null;}function p(A,W){var z=W[0];return A[0]=W[3],A[1]=-W[1],A[2]=-W[2],A[3]=z,A;}function y(A){return A[0]*A[3]-A[2]*A[1];}function P(A,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1],nt=z[2],rt=z[3];return A[0]=K*G+q*Z,A[1]=k*G+U*Z,A[2]=K*nt+q*rt,A[3]=k*nt+U*rt,A;}function T(A,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=Math.sin(z),Z=Math.cos(z);return A[0]=K*Z+q*G,A[1]=k*Z+U*G,A[2]=K*-G+q*Z,A[3]=k*-G+U*Z,A;}function v(A,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1];return A[0]=K*G,A[1]=k*G,A[2]=q*Z,A[3]=U*Z,A;}function x(A,W){var z=Math.sin(W),K=Math.cos(W);return A[0]=K,A[1]=z,A[2]=-z,A[3]=K,A;}function f(A,W){return A[0]=W[0],A[1]=0,A[2]=0,A[3]=W[1],A;}function g(A){return"mat2("+A[0]+", "+A[1]+", "+A[2]+", "+A[3]+")";}function u(A){return Math.hypot(A[0],A[1],A[2],A[3]);}function m(A,W,z,K){return A[2]=K[2]/K[0],z[0]=K[0],z[1]=K[1],z[3]=K[3]-A[2]*z[1],[A,W,z];}function M(A,W,z){return A[0]=W[0]+z[0],A[1]=W[1]+z[1],A[2]=W[2]+z[2],A[3]=W[3]+z[3],A;}function E(A,W,z){return A[0]=W[0]-z[0],A[1]=W[1]-z[1],A[2]=W[2]-z[2],A[3]=W[3]-z[3],A;}function R(A,W){return A[0]===W[0]&&A[1]===W[1]&&A[2]===W[2]&&A[3]===W[3];}function b(A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=W[0],G=W[1],Z=W[2],nt=W[3];return Math.abs(z-U)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(U))&&Math.abs(K-G)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(G))&&Math.abs(k-Z)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(Z))&&Math.abs(q-nt)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(nt));}function O(A,W,z){return A[0]=W[0]*z,A[1]=W[1]*z,A[2]=W[2]*z,A[3]=W[3]*z,A;}function L(A,W,z,K){return A[0]=W[0]+z[0]*K,A[1]=W[1]+z[1]*K,A[2]=W[2]+z[2]*K,A[3]=W[3]+z[3]*K,A;}var w=P,I=E;},/* 4 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return l;}),t.d(r,"invert",function(){return d;}),t.d(r,"determinant",function(){return c;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotate",function(){return y;}),t.d(r,"scale",function(){return P;}),t.d(r,"translate",function(){return T;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromScaling",function(){return x;}),t.d(r,"fromTranslation",function(){return f;}),t.d(r,"str",function(){return g;}),t.d(r,"frob",function(){return u;}),t.d(r,"add",function(){return m;}),t.d(r,"subtract",function(){return M;}),t.d(r,"multiplyScalar",function(){return E;}),t.d(r,"multiplyScalarAndAdd",function(){return R;}),t.d(r,"exactEquals",function(){return b;}),t.d(r,"equals",function(){return O;}),t.d(r,"mul",function(){return L;}),t.d(r,"sub",function(){return w;});var e=t(2);function n(){var I=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(I[1]=0,I[2]=0,I[4]=0,I[5]=0),I[0]=1,I[3]=1,I;}function i(I){var A=new e.ARRAY_TYPE(6);return A[0]=I[0],A[1]=I[1],A[2]=I[2],A[3]=I[3],A[4]=I[4],A[5]=I[5],A;}function a(I,A){return I[0]=A[0],I[1]=A[1],I[2]=A[2],I[3]=A[3],I[4]=A[4],I[5]=A[5],I;}function o(I){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=0,I[5]=0,I;}function s(I,A,W,z,K,k){var q=new e.ARRAY_TYPE(6);return q[0]=I,q[1]=A,q[2]=W,q[3]=z,q[4]=K,q[5]=k,q;}function l(I,A,W,z,K,k,q){return I[0]=A,I[1]=W,I[2]=z,I[3]=K,I[4]=k,I[5]=q,I;}function d(I,A){var W=A[0],z=A[1],K=A[2],k=A[3],q=A[4],U=A[5],G=W*k-z*K;return G?(G=1/G,I[0]=k*G,I[1]=-z*G,I[2]=-K*G,I[3]=W*G,I[4]=(K*U-k*q)*G,I[5]=(z*q-W*U)*G,I):null;}function c(I){return I[0]*I[3]-I[1]*I[2];}function p(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=W[0],nt=W[1],rt=W[2],tt=W[3],J=W[4],ht=W[5];return I[0]=z*Z+k*nt,I[1]=K*Z+q*nt,I[2]=z*rt+k*tt,I[3]=K*rt+q*tt,I[4]=z*J+k*ht+U,I[5]=K*J+q*ht+G,I;}function y(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=Math.sin(W),nt=Math.cos(W);return I[0]=z*nt+k*Z,I[1]=K*nt+q*Z,I[2]=z*-Z+k*nt,I[3]=K*-Z+q*nt,I[4]=U,I[5]=G,I;}function P(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=W[0],nt=W[1];return I[0]=z*Z,I[1]=K*Z,I[2]=k*nt,I[3]=q*nt,I[4]=U,I[5]=G,I;}function T(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=W[0],nt=W[1];return I[0]=z,I[1]=K,I[2]=k,I[3]=q,I[4]=z*Z+k*nt+U,I[5]=K*Z+q*nt+G,I;}function v(I,A){var W=Math.sin(A),z=Math.cos(A);return I[0]=z,I[1]=W,I[2]=-W,I[3]=z,I[4]=0,I[5]=0,I;}function x(I,A){return I[0]=A[0],I[1]=0,I[2]=0,I[3]=A[1],I[4]=0,I[5]=0,I;}function f(I,A){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=A[0],I[5]=A[1],I;}function g(I){return"mat2d("+I[0]+", "+I[1]+", "+I[2]+", "+I[3]+", "+I[4]+", "+I[5]+")";}function u(I){return Math.hypot(I[0],I[1],I[2],I[3],I[4],I[5],1);}function m(I,A,W){return I[0]=A[0]+W[0],I[1]=A[1]+W[1],I[2]=A[2]+W[2],I[3]=A[3]+W[3],I[4]=A[4]+W[4],I[5]=A[5]+W[5],I;}function M(I,A,W){return I[0]=A[0]-W[0],I[1]=A[1]-W[1],I[2]=A[2]-W[2],I[3]=A[3]-W[3],I[4]=A[4]-W[4],I[5]=A[5]-W[5],I;}function E(I,A,W){return I[0]=A[0]*W,I[1]=A[1]*W,I[2]=A[2]*W,I[3]=A[3]*W,I[4]=A[4]*W,I[5]=A[5]*W,I;}function R(I,A,W,z){return I[0]=A[0]+W[0]*z,I[1]=A[1]+W[1]*z,I[2]=A[2]+W[2]*z,I[3]=A[3]+W[3]*z,I[4]=A[4]+W[4]*z,I[5]=A[5]+W[5]*z,I;}function b(I,A){return I[0]===A[0]&&I[1]===A[1]&&I[2]===A[2]&&I[3]===A[3]&&I[4]===A[4]&&I[5]===A[5];}function O(I,A){var W=I[0],z=I[1],K=I[2],k=I[3],q=I[4],U=I[5],G=A[0],Z=A[1],nt=A[2],rt=A[3],tt=A[4],J=A[5];return Math.abs(W-G)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(G))&&Math.abs(z-Z)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(Z))&&Math.abs(K-nt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(nt))&&Math.abs(k-rt)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(rt))&&Math.abs(q-tt)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(tt))&&Math.abs(U-J)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(J));}var L=p,w=M;},/* 5 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"fromMat4",function(){return i;}),t.d(r,"clone",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return l;}),t.d(r,"identity",function(){return d;}),t.d(r,"transpose",function(){return c;}),t.d(r,"invert",function(){return p;}),t.d(r,"adjoint",function(){return y;}),t.d(r,"determinant",function(){return P;}),t.d(r,"multiply",function(){return T;}),t.d(r,"translate",function(){return v;}),t.d(r,"rotate",function(){return x;}),t.d(r,"scale",function(){return f;}),t.d(r,"fromTranslation",function(){return g;}),t.d(r,"fromRotation",function(){return u;}),t.d(r,"fromScaling",function(){return m;}),t.d(r,"fromMat2d",function(){return M;}),t.d(r,"fromQuat",function(){return E;}),t.d(r,"normalFromMat4",function(){return R;}),t.d(r,"projection",function(){return b;}),t.d(r,"str",function(){return O;}),t.d(r,"frob",function(){return L;}),t.d(r,"add",function(){return w;}),t.d(r,"subtract",function(){return I;}),t.d(r,"multiplyScalar",function(){return A;}),t.d(r,"multiplyScalarAndAdd",function(){return W;}),t.d(r,"exactEquals",function(){return z;}),t.d(r,"equals",function(){return K;}),t.d(r,"mul",function(){return k;}),t.d(r,"sub",function(){return q;});var e=t(2);function n(){var U=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(U[1]=0,U[2]=0,U[3]=0,U[5]=0,U[6]=0,U[7]=0),U[0]=1,U[4]=1,U[8]=1,U;}function i(U,G){return U[0]=G[0],U[1]=G[1],U[2]=G[2],U[3]=G[4],U[4]=G[5],U[5]=G[6],U[6]=G[8],U[7]=G[9],U[8]=G[10],U;}function a(U){var G=new e.ARRAY_TYPE(9);return G[0]=U[0],G[1]=U[1],G[2]=U[2],G[3]=U[3],G[4]=U[4],G[5]=U[5],G[6]=U[6],G[7]=U[7],G[8]=U[8],G;}function o(U,G){return U[0]=G[0],U[1]=G[1],U[2]=G[2],U[3]=G[3],U[4]=G[4],U[5]=G[5],U[6]=G[6],U[7]=G[7],U[8]=G[8],U;}function s(U,G,Z,nt,rt,tt,J,ht,dt){var B=new e.ARRAY_TYPE(9);return B[0]=U,B[1]=G,B[2]=Z,B[3]=nt,B[4]=rt,B[5]=tt,B[6]=J,B[7]=ht,B[8]=dt,B;}function l(U,G,Z,nt,rt,tt,J,ht,dt,B){return U[0]=G,U[1]=Z,U[2]=nt,U[3]=rt,U[4]=tt,U[5]=J,U[6]=ht,U[7]=dt,U[8]=B,U;}function d(U){return U[0]=1,U[1]=0,U[2]=0,U[3]=0,U[4]=1,U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function c(U,G){if(U===G){var Z=G[1],nt=G[2],rt=G[5];U[1]=G[3],U[2]=G[6],U[3]=Z,U[5]=G[7],U[6]=nt,U[7]=rt;}else U[0]=G[0],U[1]=G[3],U[2]=G[6],U[3]=G[1],U[4]=G[4],U[5]=G[7],U[6]=G[2],U[7]=G[5],U[8]=G[8];return U;}function p(U,G){var Z=G[0],nt=G[1],rt=G[2],tt=G[3],J=G[4],ht=G[5],dt=G[6],B=G[7],F=G[8],Y=F*J-ht*B,X=-F*tt+ht*dt,N=B*tt-J*dt,$=Z*Y+nt*X+rt*N;return $?($=1/$,U[0]=Y*$,U[1]=(-F*nt+rt*B)*$,U[2]=(ht*nt-rt*J)*$,U[3]=X*$,U[4]=(F*Z-rt*dt)*$,U[5]=(-ht*Z+rt*tt)*$,U[6]=N*$,U[7]=(-B*Z+nt*dt)*$,U[8]=(J*Z-nt*tt)*$,U):null;}function y(U,G){var Z=G[0],nt=G[1],rt=G[2],tt=G[3],J=G[4],ht=G[5],dt=G[6],B=G[7],F=G[8];return U[0]=J*F-ht*B,U[1]=rt*B-nt*F,U[2]=nt*ht-rt*J,U[3]=ht*dt-tt*F,U[4]=Z*F-rt*dt,U[5]=rt*tt-Z*ht,U[6]=tt*B-J*dt,U[7]=nt*dt-Z*B,U[8]=Z*J-nt*tt,U;}function P(U){var G=U[0],Z=U[1],nt=U[2],rt=U[3],tt=U[4],J=U[5],ht=U[6],dt=U[7],B=U[8];return G*(B*tt-J*dt)+Z*(-B*rt+J*ht)+nt*(dt*rt-tt*ht);}function T(U,G,Z){var nt=G[0],rt=G[1],tt=G[2],J=G[3],ht=G[4],dt=G[5],B=G[6],F=G[7],Y=G[8],X=Z[0],N=Z[1],$=Z[2],S=Z[3],C=Z[4],D=Z[5],j=Z[6],H=Z[7],V=Z[8];return U[0]=X*nt+N*J+$*B,U[1]=X*rt+N*ht+$*F,U[2]=X*tt+N*dt+$*Y,U[3]=S*nt+C*J+D*B,U[4]=S*rt+C*ht+D*F,U[5]=S*tt+C*dt+D*Y,U[6]=j*nt+H*J+V*B,U[7]=j*rt+H*ht+V*F,U[8]=j*tt+H*dt+V*Y,U;}function v(U,G,Z){var nt=G[0],rt=G[1],tt=G[2],J=G[3],ht=G[4],dt=G[5],B=G[6],F=G[7],Y=G[8],X=Z[0],N=Z[1];return U[0]=nt,U[1]=rt,U[2]=tt,U[3]=J,U[4]=ht,U[5]=dt,U[6]=X*nt+N*J+B,U[7]=X*rt+N*ht+F,U[8]=X*tt+N*dt+Y,U;}function x(U,G,Z){var nt=G[0],rt=G[1],tt=G[2],J=G[3],ht=G[4],dt=G[5],B=G[6],F=G[7],Y=G[8],X=Math.sin(Z),N=Math.cos(Z);return U[0]=N*nt+X*J,U[1]=N*rt+X*ht,U[2]=N*tt+X*dt,U[3]=N*J-X*nt,U[4]=N*ht-X*rt,U[5]=N*dt-X*tt,U[6]=B,U[7]=F,U[8]=Y,U;}function f(U,G,Z){var nt=Z[0],rt=Z[1];return U[0]=nt*G[0],U[1]=nt*G[1],U[2]=nt*G[2],U[3]=rt*G[3],U[4]=rt*G[4],U[5]=rt*G[5],U[6]=G[6],U[7]=G[7],U[8]=G[8],U;}function g(U,G){return U[0]=1,U[1]=0,U[2]=0,U[3]=0,U[4]=1,U[5]=0,U[6]=G[0],U[7]=G[1],U[8]=1,U;}function u(U,G){var Z=Math.sin(G),nt=Math.cos(G);return U[0]=nt,U[1]=Z,U[2]=0,U[3]=-Z,U[4]=nt,U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function m(U,G){return U[0]=G[0],U[1]=0,U[2]=0,U[3]=0,U[4]=G[1],U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function M(U,G){return U[0]=G[0],U[1]=G[1],U[2]=0,U[3]=G[2],U[4]=G[3],U[5]=0,U[6]=G[4],U[7]=G[5],U[8]=1,U;}function E(U,G){var Z=G[0],nt=G[1],rt=G[2],tt=G[3],J=Z+Z,ht=nt+nt,dt=rt+rt,B=Z*J,F=nt*J,Y=nt*ht,X=rt*J,N=rt*ht,$=rt*dt,S=tt*J,C=tt*ht,D=tt*dt;return U[0]=1-Y-$,U[3]=F-D,U[6]=X+C,U[1]=F+D,U[4]=1-B-$,U[7]=N-S,U[2]=X-C,U[5]=N+S,U[8]=1-B-Y,U;}function R(U,G){var Z=G[0],nt=G[1],rt=G[2],tt=G[3],J=G[4],ht=G[5],dt=G[6],B=G[7],F=G[8],Y=G[9],X=G[10],N=G[11],$=G[12],S=G[13],C=G[14],D=G[15],j=Z*ht-nt*J,H=Z*dt-rt*J,V=Z*B-tt*J,Q=nt*dt-rt*ht,it=nt*B-tt*ht,st=rt*B-tt*dt,ct=F*S-Y*$,gt=F*C-X*$,at=F*D-N*$,ot=Y*C-X*S,ft=Y*D-N*S,mt=X*D-N*C,yt=j*mt-H*ft+V*ot+Q*at-it*gt+st*ct;return yt?(yt=1/yt,U[0]=(ht*mt-dt*ft+B*ot)*yt,U[1]=(dt*at-J*mt-B*gt)*yt,U[2]=(J*ft-ht*at+B*ct)*yt,U[3]=(rt*ft-nt*mt-tt*ot)*yt,U[4]=(Z*mt-rt*at+tt*gt)*yt,U[5]=(nt*at-Z*ft-tt*ct)*yt,U[6]=(S*st-C*it+D*Q)*yt,U[7]=(C*V-$*st-D*H)*yt,U[8]=($*it-S*V+D*j)*yt,U):null;}function b(U,G,Z){return U[0]=2/G,U[1]=0,U[2]=0,U[3]=0,U[4]=-2/Z,U[5]=0,U[6]=-1,U[7]=1,U[8]=1,U;}function O(U){return"mat3("+U[0]+", "+U[1]+", "+U[2]+", "+U[3]+", "+U[4]+", "+U[5]+", "+U[6]+", "+U[7]+", "+U[8]+")";}function L(U){return Math.hypot(U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8]);}function w(U,G,Z){return U[0]=G[0]+Z[0],U[1]=G[1]+Z[1],U[2]=G[2]+Z[2],U[3]=G[3]+Z[3],U[4]=G[4]+Z[4],U[5]=G[5]+Z[5],U[6]=G[6]+Z[6],U[7]=G[7]+Z[7],U[8]=G[8]+Z[8],U;}function I(U,G,Z){return U[0]=G[0]-Z[0],U[1]=G[1]-Z[1],U[2]=G[2]-Z[2],U[3]=G[3]-Z[3],U[4]=G[4]-Z[4],U[5]=G[5]-Z[5],U[6]=G[6]-Z[6],U[7]=G[7]-Z[7],U[8]=G[8]-Z[8],U;}function A(U,G,Z){return U[0]=G[0]*Z,U[1]=G[1]*Z,U[2]=G[2]*Z,U[3]=G[3]*Z,U[4]=G[4]*Z,U[5]=G[5]*Z,U[6]=G[6]*Z,U[7]=G[7]*Z,U[8]=G[8]*Z,U;}function W(U,G,Z,nt){return U[0]=G[0]+Z[0]*nt,U[1]=G[1]+Z[1]*nt,U[2]=G[2]+Z[2]*nt,U[3]=G[3]+Z[3]*nt,U[4]=G[4]+Z[4]*nt,U[5]=G[5]+Z[5]*nt,U[6]=G[6]+Z[6]*nt,U[7]=G[7]+Z[7]*nt,U[8]=G[8]+Z[8]*nt,U;}function z(U,G){return U[0]===G[0]&&U[1]===G[1]&&U[2]===G[2]&&U[3]===G[3]&&U[4]===G[4]&&U[5]===G[5]&&U[6]===G[6]&&U[7]===G[7]&&U[8]===G[8];}function K(U,G){var Z=U[0],nt=U[1],rt=U[2],tt=U[3],J=U[4],ht=U[5],dt=U[6],B=U[7],F=U[8],Y=G[0],X=G[1],N=G[2],$=G[3],S=G[4],C=G[5],D=G[6],j=G[7],H=G[8];return Math.abs(Z-Y)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(Y))&&Math.abs(nt-X)<=e.EPSILON*Math.max(1,Math.abs(nt),Math.abs(X))&&Math.abs(rt-N)<=e.EPSILON*Math.max(1,Math.abs(rt),Math.abs(N))&&Math.abs(tt-$)<=e.EPSILON*Math.max(1,Math.abs(tt),Math.abs($))&&Math.abs(J-S)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(S))&&Math.abs(ht-C)<=e.EPSILON*Math.max(1,Math.abs(ht),Math.abs(C))&&Math.abs(dt-D)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(D))&&Math.abs(B-j)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(j))&&Math.abs(F-H)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(H));}var k=T,q=I;},/* 6 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"identity",function(){return l;}),t.d(r,"transpose",function(){return d;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return P;}),t.d(r,"translate",function(){return T;}),t.d(r,"scale",function(){return v;}),t.d(r,"rotate",function(){return x;}),t.d(r,"rotateX",function(){return f;}),t.d(r,"rotateY",function(){return g;}),t.d(r,"rotateZ",function(){return u;}),t.d(r,"fromTranslation",function(){return m;}),t.d(r,"fromScaling",function(){return M;}),t.d(r,"fromRotation",function(){return E;}),t.d(r,"fromXRotation",function(){return R;}),t.d(r,"fromYRotation",function(){return b;}),t.d(r,"fromZRotation",function(){return O;}),t.d(r,"fromRotationTranslation",function(){return L;}),t.d(r,"fromQuat2",function(){return w;}),t.d(r,"getTranslation",function(){return I;}),t.d(r,"getScaling",function(){return A;}),t.d(r,"getRotation",function(){return W;}),t.d(r,"fromRotationTranslationScale",function(){return z;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return K;}),t.d(r,"fromQuat",function(){return k;}),t.d(r,"frustum",function(){return q;}),t.d(r,"perspective",function(){return U;}),t.d(r,"perspectiveFromFieldOfView",function(){return G;}),t.d(r,"ortho",function(){return Z;}),t.d(r,"lookAt",function(){return nt;}),t.d(r,"targetTo",function(){return rt;}),t.d(r,"str",function(){return tt;}),t.d(r,"frob",function(){return J;}),t.d(r,"add",function(){return ht;}),t.d(r,"subtract",function(){return dt;}),t.d(r,"multiplyScalar",function(){return B;}),t.d(r,"multiplyScalarAndAdd",function(){return F;}),t.d(r,"exactEquals",function(){return Y;}),t.d(r,"equals",function(){return X;}),t.d(r,"mul",function(){return N;}),t.d(r,"sub",function(){return $;});var e=t(2);function n(){var S=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S;}function i(S){var C=new e.ARRAY_TYPE(16);return C[0]=S[0],C[1]=S[1],C[2]=S[2],C[3]=S[3],C[4]=S[4],C[5]=S[5],C[6]=S[6],C[7]=S[7],C[8]=S[8],C[9]=S[9],C[10]=S[10],C[11]=S[11],C[12]=S[12],C[13]=S[13],C[14]=S[14],C[15]=S[15],C;}function a(S,C){return S[0]=C[0],S[1]=C[1],S[2]=C[2],S[3]=C[3],S[4]=C[4],S[5]=C[5],S[6]=C[6],S[7]=C[7],S[8]=C[8],S[9]=C[9],S[10]=C[10],S[11]=C[11],S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15],S;}function o(S,C,D,j,H,V,Q,it,st,ct,gt,at,ot,ft,mt,yt){var pt=new e.ARRAY_TYPE(16);return pt[0]=S,pt[1]=C,pt[2]=D,pt[3]=j,pt[4]=H,pt[5]=V,pt[6]=Q,pt[7]=it,pt[8]=st,pt[9]=ct,pt[10]=gt,pt[11]=at,pt[12]=ot,pt[13]=ft,pt[14]=mt,pt[15]=yt,pt;}function s(S,C,D,j,H,V,Q,it,st,ct,gt,at,ot,ft,mt,yt,pt){return S[0]=C,S[1]=D,S[2]=j,S[3]=H,S[4]=V,S[5]=Q,S[6]=it,S[7]=st,S[8]=ct,S[9]=gt,S[10]=at,S[11]=ot,S[12]=ft,S[13]=mt,S[14]=yt,S[15]=pt,S;}function l(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function d(S,C){if(S===C){var D=C[1],j=C[2],H=C[3],V=C[6],Q=C[7],it=C[11];S[1]=C[4],S[2]=C[8],S[3]=C[12],S[4]=D,S[6]=C[9],S[7]=C[13],S[8]=j,S[9]=V,S[11]=C[14],S[12]=H,S[13]=Q,S[14]=it;}else S[0]=C[0],S[1]=C[4],S[2]=C[8],S[3]=C[12],S[4]=C[1],S[5]=C[5],S[6]=C[9],S[7]=C[13],S[8]=C[2],S[9]=C[6],S[10]=C[10],S[11]=C[14],S[12]=C[3],S[13]=C[7],S[14]=C[11],S[15]=C[15];return S;}function c(S,C){var D=C[0],j=C[1],H=C[2],V=C[3],Q=C[4],it=C[5],st=C[6],ct=C[7],gt=C[8],at=C[9],ot=C[10],ft=C[11],mt=C[12],yt=C[13],pt=C[14],Tt=C[15],Rt=D*it-j*Q,Ot=D*st-H*Q,Et=D*ct-V*Q,Ct=j*st-H*it,At=j*ct-V*it,Ht=H*ct-V*st,$t=gt*yt-at*mt,zt=gt*pt-ot*mt,Gt=gt*Tt-ft*mt,Kt=at*pt-ot*yt,Yt=at*Tt-ft*yt,Vt=ot*Tt-ft*pt,Dt=Rt*Vt-Ot*Yt+Et*Kt+Ct*Gt-At*zt+Ht*$t;return Dt?(Dt=1/Dt,S[0]=(it*Vt-st*Yt+ct*Kt)*Dt,S[1]=(H*Yt-j*Vt-V*Kt)*Dt,S[2]=(yt*Ht-pt*At+Tt*Ct)*Dt,S[3]=(ot*At-at*Ht-ft*Ct)*Dt,S[4]=(st*Gt-Q*Vt-ct*zt)*Dt,S[5]=(D*Vt-H*Gt+V*zt)*Dt,S[6]=(pt*Et-mt*Ht-Tt*Ot)*Dt,S[7]=(gt*Ht-ot*Et+ft*Ot)*Dt,S[8]=(Q*Yt-it*Gt+ct*$t)*Dt,S[9]=(j*Gt-D*Yt-V*$t)*Dt,S[10]=(mt*At-yt*Et+Tt*Rt)*Dt,S[11]=(at*Et-gt*At-ft*Rt)*Dt,S[12]=(it*zt-Q*Kt-st*$t)*Dt,S[13]=(D*Kt-j*zt+H*$t)*Dt,S[14]=(yt*Ot-mt*Ct-pt*Rt)*Dt,S[15]=(gt*Ct-at*Ot+ot*Rt)*Dt,S):null;}function p(S,C){var D=C[0],j=C[1],H=C[2],V=C[3],Q=C[4],it=C[5],st=C[6],ct=C[7],gt=C[8],at=C[9],ot=C[10],ft=C[11],mt=C[12],yt=C[13],pt=C[14],Tt=C[15];return S[0]=it*(ot*Tt-ft*pt)-at*(st*Tt-ct*pt)+yt*(st*ft-ct*ot),S[1]=-(j*(ot*Tt-ft*pt)-at*(H*Tt-V*pt)+yt*(H*ft-V*ot)),S[2]=j*(st*Tt-ct*pt)-it*(H*Tt-V*pt)+yt*(H*ct-V*st),S[3]=-(j*(st*ft-ct*ot)-it*(H*ft-V*ot)+at*(H*ct-V*st)),S[4]=-(Q*(ot*Tt-ft*pt)-gt*(st*Tt-ct*pt)+mt*(st*ft-ct*ot)),S[5]=D*(ot*Tt-ft*pt)-gt*(H*Tt-V*pt)+mt*(H*ft-V*ot),S[6]=-(D*(st*Tt-ct*pt)-Q*(H*Tt-V*pt)+mt*(H*ct-V*st)),S[7]=D*(st*ft-ct*ot)-Q*(H*ft-V*ot)+gt*(H*ct-V*st),S[8]=Q*(at*Tt-ft*yt)-gt*(it*Tt-ct*yt)+mt*(it*ft-ct*at),S[9]=-(D*(at*Tt-ft*yt)-gt*(j*Tt-V*yt)+mt*(j*ft-V*at)),S[10]=D*(it*Tt-ct*yt)-Q*(j*Tt-V*yt)+mt*(j*ct-V*it),S[11]=-(D*(it*ft-ct*at)-Q*(j*ft-V*at)+gt*(j*ct-V*it)),S[12]=-(Q*(at*pt-ot*yt)-gt*(it*pt-st*yt)+mt*(it*ot-st*at)),S[13]=D*(at*pt-ot*yt)-gt*(j*pt-H*yt)+mt*(j*ot-H*at),S[14]=-(D*(it*pt-st*yt)-Q*(j*pt-H*yt)+mt*(j*st-H*it)),S[15]=D*(it*ot-st*at)-Q*(j*ot-H*at)+gt*(j*st-H*it),S;}function y(S){var C=S[0],D=S[1],j=S[2],H=S[3],V=S[4],Q=S[5],it=S[6],st=S[7],ct=S[8],gt=S[9],at=S[10],ot=S[11],ft=S[12],mt=S[13],yt=S[14],pt=S[15],Tt=C*Q-D*V,Rt=C*it-j*V,Ot=C*st-H*V,Et=D*it-j*Q,Ct=D*st-H*Q,At=j*st-H*it,Ht=ct*mt-gt*ft,$t=ct*yt-at*ft,zt=ct*pt-ot*ft,Gt=gt*yt-at*mt,Kt=gt*pt-ot*mt,Yt=at*pt-ot*yt;return Tt*Yt-Rt*Kt+Ot*Gt+Et*zt-Ct*$t+At*Ht;}function P(S,C,D){var j=C[0],H=C[1],V=C[2],Q=C[3],it=C[4],st=C[5],ct=C[6],gt=C[7],at=C[8],ot=C[9],ft=C[10],mt=C[11],yt=C[12],pt=C[13],Tt=C[14],Rt=C[15],Ot=D[0],Et=D[1],Ct=D[2],At=D[3];return S[0]=Ot*j+Et*it+Ct*at+At*yt,S[1]=Ot*H+Et*st+Ct*ot+At*pt,S[2]=Ot*V+Et*ct+Ct*ft+At*Tt,S[3]=Ot*Q+Et*gt+Ct*mt+At*Rt,Ot=D[4],Et=D[5],Ct=D[6],At=D[7],S[4]=Ot*j+Et*it+Ct*at+At*yt,S[5]=Ot*H+Et*st+Ct*ot+At*pt,S[6]=Ot*V+Et*ct+Ct*ft+At*Tt,S[7]=Ot*Q+Et*gt+Ct*mt+At*Rt,Ot=D[8],Et=D[9],Ct=D[10],At=D[11],S[8]=Ot*j+Et*it+Ct*at+At*yt,S[9]=Ot*H+Et*st+Ct*ot+At*pt,S[10]=Ot*V+Et*ct+Ct*ft+At*Tt,S[11]=Ot*Q+Et*gt+Ct*mt+At*Rt,Ot=D[12],Et=D[13],Ct=D[14],At=D[15],S[12]=Ot*j+Et*it+Ct*at+At*yt,S[13]=Ot*H+Et*st+Ct*ot+At*pt,S[14]=Ot*V+Et*ct+Ct*ft+At*Tt,S[15]=Ot*Q+Et*gt+Ct*mt+At*Rt,S;}function T(S,C,D){var j=D[0],H=D[1],V=D[2],Q,it,st,ct,gt,at,ot,ft,mt,yt,pt,Tt;return C===S?(S[12]=C[0]*j+C[4]*H+C[8]*V+C[12],S[13]=C[1]*j+C[5]*H+C[9]*V+C[13],S[14]=C[2]*j+C[6]*H+C[10]*V+C[14],S[15]=C[3]*j+C[7]*H+C[11]*V+C[15]):(Q=C[0],it=C[1],st=C[2],ct=C[3],gt=C[4],at=C[5],ot=C[6],ft=C[7],mt=C[8],yt=C[9],pt=C[10],Tt=C[11],S[0]=Q,S[1]=it,S[2]=st,S[3]=ct,S[4]=gt,S[5]=at,S[6]=ot,S[7]=ft,S[8]=mt,S[9]=yt,S[10]=pt,S[11]=Tt,S[12]=Q*j+gt*H+mt*V+C[12],S[13]=it*j+at*H+yt*V+C[13],S[14]=st*j+ot*H+pt*V+C[14],S[15]=ct*j+ft*H+Tt*V+C[15]),S;}function v(S,C,D){var j=D[0],H=D[1],V=D[2];return S[0]=C[0]*j,S[1]=C[1]*j,S[2]=C[2]*j,S[3]=C[3]*j,S[4]=C[4]*H,S[5]=C[5]*H,S[6]=C[6]*H,S[7]=C[7]*H,S[8]=C[8]*V,S[9]=C[9]*V,S[10]=C[10]*V,S[11]=C[11]*V,S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15],S;}function x(S,C,D,j){var H=j[0],V=j[1],Q=j[2],it=Math.hypot(H,V,Q),st,ct,gt,at,ot,ft,mt,yt,pt,Tt,Rt,Ot,Et,Ct,At,Ht,$t,zt,Gt,Kt,Yt,Vt,Dt,Qt;return it0?(D[0]=(it*Q+gt*j+st*V-ct*H)*2/at,D[1]=(st*Q+gt*H+ct*j-it*V)*2/at,D[2]=(ct*Q+gt*V+it*H-st*j)*2/at):(D[0]=(it*Q+gt*j+st*V-ct*H)*2,D[1]=(st*Q+gt*H+ct*j-it*V)*2,D[2]=(ct*Q+gt*V+it*H-st*j)*2),L(S,C,D),S;}function I(S,C){return S[0]=C[12],S[1]=C[13],S[2]=C[14],S;}function A(S,C){var D=C[0],j=C[1],H=C[2],V=C[4],Q=C[5],it=C[6],st=C[8],ct=C[9],gt=C[10];return S[0]=Math.hypot(D,j,H),S[1]=Math.hypot(V,Q,it),S[2]=Math.hypot(st,ct,gt),S;}function W(S,C){var D=new e.ARRAY_TYPE(3);A(D,C);var j=1/D[0],H=1/D[1],V=1/D[2],Q=C[0]*j,it=C[1]*H,st=C[2]*V,ct=C[4]*j,gt=C[5]*H,at=C[6]*V,ot=C[8]*j,ft=C[9]*H,mt=C[10]*V,yt=Q+gt+mt,pt=0;return yt>0?(pt=Math.sqrt(yt+1)*2,S[3]=0.25*pt,S[0]=(at-ft)/pt,S[1]=(ot-st)/pt,S[2]=(it-ct)/pt):Q>gt&&Q>mt?(pt=Math.sqrt(1+Q-gt-mt)*2,S[3]=(at-ft)/pt,S[0]=0.25*pt,S[1]=(it+ct)/pt,S[2]=(ot+st)/pt):gt>mt?(pt=Math.sqrt(1+gt-Q-mt)*2,S[3]=(ot-st)/pt,S[0]=(it+ct)/pt,S[1]=0.25*pt,S[2]=(at+ft)/pt):(pt=Math.sqrt(1+mt-Q-gt)*2,S[3]=(it-ct)/pt,S[0]=(ot+st)/pt,S[1]=(at+ft)/pt,S[2]=0.25*pt),S;}function z(S,C,D,j){var H=C[0],V=C[1],Q=C[2],it=C[3],st=H+H,ct=V+V,gt=Q+Q,at=H*st,ot=H*ct,ft=H*gt,mt=V*ct,yt=V*gt,pt=Q*gt,Tt=it*st,Rt=it*ct,Ot=it*gt,Et=j[0],Ct=j[1],At=j[2];return S[0]=(1-(mt+pt))*Et,S[1]=(ot+Ot)*Et,S[2]=(ft-Rt)*Et,S[3]=0,S[4]=(ot-Ot)*Ct,S[5]=(1-(at+pt))*Ct,S[6]=(yt+Tt)*Ct,S[7]=0,S[8]=(ft+Rt)*At,S[9]=(yt-Tt)*At,S[10]=(1-(at+mt))*At,S[11]=0,S[12]=D[0],S[13]=D[1],S[14]=D[2],S[15]=1,S;}function K(S,C,D,j,H){var V=C[0],Q=C[1],it=C[2],st=C[3],ct=V+V,gt=Q+Q,at=it+it,ot=V*ct,ft=V*gt,mt=V*at,yt=Q*gt,pt=Q*at,Tt=it*at,Rt=st*ct,Ot=st*gt,Et=st*at,Ct=j[0],At=j[1],Ht=j[2],$t=H[0],zt=H[1],Gt=H[2],Kt=(1-(yt+Tt))*Ct,Yt=(ft+Et)*Ct,Vt=(mt-Ot)*Ct,Dt=(ft-Et)*At,Qt=(1-(ot+Tt))*At,Re=(pt+Rt)*At,Ie=(mt+Ot)*Ht,jr=(pt-Rt)*Ht,$r=(1-(ot+yt))*Ht;return S[0]=Kt,S[1]=Yt,S[2]=Vt,S[3]=0,S[4]=Dt,S[5]=Qt,S[6]=Re,S[7]=0,S[8]=Ie,S[9]=jr,S[10]=$r,S[11]=0,S[12]=D[0]+$t-(Kt*$t+Dt*zt+Ie*Gt),S[13]=D[1]+zt-(Yt*$t+Qt*zt+jr*Gt),S[14]=D[2]+Gt-(Vt*$t+Re*zt+$r*Gt),S[15]=1,S;}function k(S,C){var D=C[0],j=C[1],H=C[2],V=C[3],Q=D+D,it=j+j,st=H+H,ct=D*Q,gt=j*Q,at=j*it,ot=H*Q,ft=H*it,mt=H*st,yt=V*Q,pt=V*it,Tt=V*st;return S[0]=1-at-mt,S[1]=gt+Tt,S[2]=ot-pt,S[3]=0,S[4]=gt-Tt,S[5]=1-ct-mt,S[6]=ft+yt,S[7]=0,S[8]=ot+pt,S[9]=ft-yt,S[10]=1-ct-at,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function q(S,C,D,j,H,V,Q){var it=1/(D-C),st=1/(H-j),ct=1/(V-Q);return S[0]=V*2*it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=V*2*st,S[6]=0,S[7]=0,S[8]=(D+C)*it,S[9]=(H+j)*st,S[10]=(Q+V)*ct,S[11]=-1,S[12]=0,S[13]=0,S[14]=Q*V*2*ct,S[15]=0,S;}function U(S,C,D,j,H){var V=1/Math.tan(C/2),Q;return S[0]=V/D,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=V,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,H!=null&&H!==1/0?(Q=1/(j-H),S[10]=(H+j)*Q,S[14]=2*H*j*Q):(S[10]=-1,S[14]=-2*j),S;}function G(S,C,D,j){var H=Math.tan(C.upDegrees*Math.PI/180),V=Math.tan(C.downDegrees*Math.PI/180),Q=Math.tan(C.leftDegrees*Math.PI/180),it=Math.tan(C.rightDegrees*Math.PI/180),st=2/(Q+it),ct=2/(H+V);return S[0]=st,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=ct,S[6]=0,S[7]=0,S[8]=-((Q-it)*st*0.5),S[9]=(H-V)*ct*0.5,S[10]=j/(D-j),S[11]=-1,S[12]=0,S[13]=0,S[14]=j*D/(D-j),S[15]=0,S;}function Z(S,C,D,j,H,V,Q){var it=1/(C-D),st=1/(j-H),ct=1/(V-Q);return S[0]=-2*it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*st,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*ct,S[11]=0,S[12]=(C+D)*it,S[13]=(H+j)*st,S[14]=(Q+V)*ct,S[15]=1,S;}function nt(S,C,D,j){var H,V,Q,it,st,ct,gt,at,ot,ft,mt=C[0],yt=C[1],pt=C[2],Tt=j[0],Rt=j[1],Ot=j[2],Et=D[0],Ct=D[1],At=D[2];return Math.abs(mt-Et)0&&(ft=1/Math.sqrt(ft),gt*=ft,at*=ft,ot*=ft);var mt=st*ot-ct*at,yt=ct*gt-it*ot,pt=it*at-st*gt;return ft=mt*mt+yt*yt+pt*pt,ft>0&&(ft=1/Math.sqrt(ft),mt*=ft,yt*=ft,pt*=ft),S[0]=mt,S[1]=yt,S[2]=pt,S[3]=0,S[4]=at*pt-ot*yt,S[5]=ot*mt-gt*pt,S[6]=gt*yt-at*mt,S[7]=0,S[8]=gt,S[9]=at,S[10]=ot,S[11]=0,S[12]=H,S[13]=V,S[14]=Q,S[15]=1,S;}function tt(S){return"mat4("+S[0]+", "+S[1]+", "+S[2]+", "+S[3]+", "+S[4]+", "+S[5]+", "+S[6]+", "+S[7]+", "+S[8]+", "+S[9]+", "+S[10]+", "+S[11]+", "+S[12]+", "+S[13]+", "+S[14]+", "+S[15]+")";}function J(S){return Math.hypot(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15]);}function ht(S,C,D){return S[0]=C[0]+D[0],S[1]=C[1]+D[1],S[2]=C[2]+D[2],S[3]=C[3]+D[3],S[4]=C[4]+D[4],S[5]=C[5]+D[5],S[6]=C[6]+D[6],S[7]=C[7]+D[7],S[8]=C[8]+D[8],S[9]=C[9]+D[9],S[10]=C[10]+D[10],S[11]=C[11]+D[11],S[12]=C[12]+D[12],S[13]=C[13]+D[13],S[14]=C[14]+D[14],S[15]=C[15]+D[15],S;}function dt(S,C,D){return S[0]=C[0]-D[0],S[1]=C[1]-D[1],S[2]=C[2]-D[2],S[3]=C[3]-D[3],S[4]=C[4]-D[4],S[5]=C[5]-D[5],S[6]=C[6]-D[6],S[7]=C[7]-D[7],S[8]=C[8]-D[8],S[9]=C[9]-D[9],S[10]=C[10]-D[10],S[11]=C[11]-D[11],S[12]=C[12]-D[12],S[13]=C[13]-D[13],S[14]=C[14]-D[14],S[15]=C[15]-D[15],S;}function B(S,C,D){return S[0]=C[0]*D,S[1]=C[1]*D,S[2]=C[2]*D,S[3]=C[3]*D,S[4]=C[4]*D,S[5]=C[5]*D,S[6]=C[6]*D,S[7]=C[7]*D,S[8]=C[8]*D,S[9]=C[9]*D,S[10]=C[10]*D,S[11]=C[11]*D,S[12]=C[12]*D,S[13]=C[13]*D,S[14]=C[14]*D,S[15]=C[15]*D,S;}function F(S,C,D,j){return S[0]=C[0]+D[0]*j,S[1]=C[1]+D[1]*j,S[2]=C[2]+D[2]*j,S[3]=C[3]+D[3]*j,S[4]=C[4]+D[4]*j,S[5]=C[5]+D[5]*j,S[6]=C[6]+D[6]*j,S[7]=C[7]+D[7]*j,S[8]=C[8]+D[8]*j,S[9]=C[9]+D[9]*j,S[10]=C[10]+D[10]*j,S[11]=C[11]+D[11]*j,S[12]=C[12]+D[12]*j,S[13]=C[13]+D[13]*j,S[14]=C[14]+D[14]*j,S[15]=C[15]+D[15]*j,S;}function Y(S,C){return S[0]===C[0]&&S[1]===C[1]&&S[2]===C[2]&&S[3]===C[3]&&S[4]===C[4]&&S[5]===C[5]&&S[6]===C[6]&&S[7]===C[7]&&S[8]===C[8]&&S[9]===C[9]&&S[10]===C[10]&&S[11]===C[11]&&S[12]===C[12]&&S[13]===C[13]&&S[14]===C[14]&&S[15]===C[15];}function X(S,C){var D=S[0],j=S[1],H=S[2],V=S[3],Q=S[4],it=S[5],st=S[6],ct=S[7],gt=S[8],at=S[9],ot=S[10],ft=S[11],mt=S[12],yt=S[13],pt=S[14],Tt=S[15],Rt=C[0],Ot=C[1],Et=C[2],Ct=C[3],At=C[4],Ht=C[5],$t=C[6],zt=C[7],Gt=C[8],Kt=C[9],Yt=C[10],Vt=C[11],Dt=C[12],Qt=C[13],Re=C[14],Ie=C[15];return Math.abs(D-Rt)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(Rt))&&Math.abs(j-Ot)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Ot))&&Math.abs(H-Et)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(Et))&&Math.abs(V-Ct)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(Ct))&&Math.abs(Q-At)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(At))&&Math.abs(it-Ht)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(Ht))&&Math.abs(st-$t)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs($t))&&Math.abs(ct-zt)<=e.EPSILON*Math.max(1,Math.abs(ct),Math.abs(zt))&&Math.abs(gt-Gt)<=e.EPSILON*Math.max(1,Math.abs(gt),Math.abs(Gt))&&Math.abs(at-Kt)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs(Kt))&&Math.abs(ot-Yt)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Yt))&&Math.abs(ft-Vt)<=e.EPSILON*Math.max(1,Math.abs(ft),Math.abs(Vt))&&Math.abs(mt-Dt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Dt))&&Math.abs(yt-Qt)<=e.EPSILON*Math.max(1,Math.abs(yt),Math.abs(Qt))&&Math.abs(pt-Re)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Re))&&Math.abs(Tt-Ie)<=e.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(Ie));}var N=P,$=dt;},/* 7 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return o;}),t.d(r,"identity",function(){return s;}),t.d(r,"setAxisAngle",function(){return l;}),t.d(r,"getAxisAngle",function(){return d;}),t.d(r,"getAngle",function(){return c;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotateX",function(){return y;}),t.d(r,"rotateY",function(){return P;}),t.d(r,"rotateZ",function(){return T;}),t.d(r,"calculateW",function(){return v;}),t.d(r,"exp",function(){return x;}),t.d(r,"ln",function(){return f;}),t.d(r,"pow",function(){return g;}),t.d(r,"slerp",function(){return u;}),t.d(r,"random",function(){return m;}),t.d(r,"invert",function(){return M;}),t.d(r,"conjugate",function(){return E;}),t.d(r,"fromMat3",function(){return R;}),t.d(r,"fromEuler",function(){return b;}),t.d(r,"str",function(){return O;}),t.d(r,"clone",function(){return L;}),t.d(r,"fromValues",function(){return w;}),t.d(r,"copy",function(){return I;}),t.d(r,"set",function(){return A;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return z;}),t.d(r,"scale",function(){return K;}),t.d(r,"dot",function(){return k;}),t.d(r,"lerp",function(){return q;}),t.d(r,"length",function(){return U;}),t.d(r,"len",function(){return G;}),t.d(r,"squaredLength",function(){return Z;}),t.d(r,"sqrLen",function(){return nt;}),t.d(r,"normalize",function(){return rt;}),t.d(r,"exactEquals",function(){return tt;}),t.d(r,"equals",function(){return J;}),t.d(r,"rotationTo",function(){return ht;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return B;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0),F[3]=1,F;}function s(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F;}function l(F,Y,X){X=X*0.5;var N=Math.sin(X);return F[0]=N*Y[0],F[1]=N*Y[1],F[2]=N*Y[2],F[3]=Math.cos(X),F;}function d(F,Y){var X=Math.acos(Y[3])*2,N=Math.sin(X/2);return N>e.EPSILON?(F[0]=Y[0]/N,F[1]=Y[1]/N,F[2]=Y[2]/N):(F[0]=1,F[1]=0,F[2]=0),X;}function c(F,Y){var X=k(F,Y);return Math.acos(2*X*X-1);}function p(F,Y,X){var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=X[0],j=X[1],H=X[2],V=X[3];return F[0]=N*V+C*D+$*H-S*j,F[1]=$*V+C*j+S*D-N*H,F[2]=S*V+C*H+N*j-$*D,F[3]=C*V-N*D-$*j-S*H,F;}function y(F,Y,X){X*=0.5;var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=Math.sin(X),j=Math.cos(X);return F[0]=N*j+C*D,F[1]=$*j+S*D,F[2]=S*j-$*D,F[3]=C*j-N*D,F;}function P(F,Y,X){X*=0.5;var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=Math.sin(X),j=Math.cos(X);return F[0]=N*j-S*D,F[1]=$*j+C*D,F[2]=S*j+N*D,F[3]=C*j-$*D,F;}function T(F,Y,X){X*=0.5;var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=Math.sin(X),j=Math.cos(X);return F[0]=N*j+$*D,F[1]=$*j-N*D,F[2]=S*j+C*D,F[3]=C*j-S*D,F;}function v(F,Y){var X=Y[0],N=Y[1],$=Y[2];return F[0]=X,F[1]=N,F[2]=$,F[3]=Math.sqrt(Math.abs(1-X*X-N*N-$*$)),F;}function x(F,Y){var X=Y[0],N=Y[1],$=Y[2],S=Y[3],C=Math.sqrt(X*X+N*N+$*$),D=Math.exp(S),j=C>0?D*Math.sin(C)/C:0;return F[0]=X*j,F[1]=N*j,F[2]=$*j,F[3]=D*Math.cos(C),F;}function f(F,Y){var X=Y[0],N=Y[1],$=Y[2],S=Y[3],C=Math.sqrt(X*X+N*N+$*$),D=C>0?Math.atan2(C,S)/C:0;return F[0]=X*D,F[1]=N*D,F[2]=$*D,F[3]=0.5*Math.log(X*X+N*N+$*$+S*S),F;}function g(F,Y,X){return f(F,Y),K(F,F,X),x(F,F),F;}function u(F,Y,X,N){var $=Y[0],S=Y[1],C=Y[2],D=Y[3],j=X[0],H=X[1],V=X[2],Q=X[3],it,st,ct,gt,at;return st=$*j+S*H+C*V+D*Q,st<0&&(st=-st,j=-j,H=-H,V=-V,Q=-Q),1-st>e.EPSILON?(it=Math.acos(st),ct=Math.sin(it),gt=Math.sin((1-N)*it)/ct,at=Math.sin(N*it)/ct):(gt=1-N,at=N),F[0]=gt*$+at*j,F[1]=gt*S+at*H,F[2]=gt*C+at*V,F[3]=gt*D+at*Q,F;}function m(F){var Y=e.RANDOM(),X=e.RANDOM(),N=e.RANDOM(),$=Math.sqrt(1-Y),S=Math.sqrt(Y);return F[0]=$*Math.sin(2*Math.PI*X),F[1]=$*Math.cos(2*Math.PI*X),F[2]=S*Math.sin(2*Math.PI*N),F[3]=S*Math.cos(2*Math.PI*N),F;}function M(F,Y){var X=Y[0],N=Y[1],$=Y[2],S=Y[3],C=X*X+N*N+$*$+S*S,D=C?1/C:0;return F[0]=-X*D,F[1]=-N*D,F[2]=-$*D,F[3]=S*D,F;}function E(F,Y){return F[0]=-Y[0],F[1]=-Y[1],F[2]=-Y[2],F[3]=Y[3],F;}function R(F,Y){var X=Y[0]+Y[4]+Y[8],N;if(X>0)N=Math.sqrt(X+1),F[3]=0.5*N,N=0.5/N,F[0]=(Y[5]-Y[7])*N,F[1]=(Y[6]-Y[2])*N,F[2]=(Y[1]-Y[3])*N;else{var $=0;Y[4]>Y[0]&&($=1),Y[8]>Y[$*3+$]&&($=2);var S=($+1)%3,C=($+2)%3;N=Math.sqrt(Y[$*3+$]-Y[S*3+S]-Y[C*3+C]+1),F[$]=0.5*N,N=0.5/N,F[3]=(Y[S*3+C]-Y[C*3+S])*N,F[S]=(Y[S*3+$]+Y[$*3+S])*N,F[C]=(Y[C*3+$]+Y[$*3+C])*N;}return F;}function b(F,Y,X,N){var $=0.5*Math.PI/180;Y*=$,X*=$,N*=$;var S=Math.sin(Y),C=Math.cos(Y),D=Math.sin(X),j=Math.cos(X),H=Math.sin(N),V=Math.cos(N);return F[0]=S*j*V-C*D*H,F[1]=C*D*V+S*j*H,F[2]=C*j*H-S*D*V,F[3]=C*j*V+S*D*H,F;}function O(F){return"quat("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}var L=a.clone,w=a.fromValues,I=a.copy,A=a.set,W=a.add,z=p,K=a.scale,k=a.dot,q=a.lerp,U=a.length,G=U,Z=a.squaredLength,nt=Z,rt=a.normalize,tt=a.exactEquals,J=a.equals,ht=function(){var F=i.create(),Y=i.fromValues(1,0,0),X=i.fromValues(0,1,0);return function(N,$,S){var C=i.dot($,S);return C<-0.999999?(i.cross(F,Y,$),i.len(F)<1e-6&&i.cross(F,X,$),i.normalize(F,F),l(N,F,Math.PI),N):C>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(F,$,S),N[0]=F[0],N[1]=F[1],N[2]=F[2],N[3]=1+C,rt(N,N));};}(),dt=function(){var F=o(),Y=o();return function(X,N,$,S,C,D){return u(F,N,C,D),u(Y,$,S,D),u(X,F,Y,2*D*(1-D)),X;};}(),B=function(){var F=n.create();return function(Y,X,N,$){return F[0]=N[0],F[3]=N[1],F[6]=N[2],F[1]=$[0],F[4]=$[1],F[7]=$[2],F[2]=-X[0],F[5]=-X[1],F[8]=-X[2],rt(Y,R(Y,F));};}();},/* 8 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"length",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return l;}),t.d(r,"add",function(){return d;}),t.d(r,"subtract",function(){return c;}),t.d(r,"multiply",function(){return p;}),t.d(r,"divide",function(){return y;}),t.d(r,"ceil",function(){return P;}),t.d(r,"floor",function(){return T;}),t.d(r,"min",function(){return v;}),t.d(r,"max",function(){return x;}),t.d(r,"round",function(){return f;}),t.d(r,"scale",function(){return g;}),t.d(r,"scaleAndAdd",function(){return u;}),t.d(r,"distance",function(){return m;}),t.d(r,"squaredDistance",function(){return M;}),t.d(r,"squaredLength",function(){return E;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return w;}),t.d(r,"lerp",function(){return I;}),t.d(r,"hermite",function(){return A;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return z;}),t.d(r,"transformMat4",function(){return K;}),t.d(r,"transformMat3",function(){return k;}),t.d(r,"transformQuat",function(){return q;}),t.d(r,"rotateX",function(){return U;}),t.d(r,"rotateY",function(){return G;}),t.d(r,"rotateZ",function(){return Z;}),t.d(r,"angle",function(){return nt;}),t.d(r,"zero",function(){return rt;}),t.d(r,"str",function(){return tt;}),t.d(r,"exactEquals",function(){return J;}),t.d(r,"equals",function(){return ht;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return B;}),t.d(r,"div",function(){return F;}),t.d(r,"dist",function(){return Y;}),t.d(r,"sqrDist",function(){return X;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return $;}),t.d(r,"forEach",function(){return S;});var e=t(2);function n(){var C=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(C[0]=0,C[1]=0,C[2]=0),C;}function i(C){var D=new e.ARRAY_TYPE(3);return D[0]=C[0],D[1]=C[1],D[2]=C[2],D;}function a(C){var D=C[0],j=C[1],H=C[2];return Math.hypot(D,j,H);}function o(C,D,j){var H=new e.ARRAY_TYPE(3);return H[0]=C,H[1]=D,H[2]=j,H;}function s(C,D){return C[0]=D[0],C[1]=D[1],C[2]=D[2],C;}function l(C,D,j,H){return C[0]=D,C[1]=j,C[2]=H,C;}function d(C,D,j){return C[0]=D[0]+j[0],C[1]=D[1]+j[1],C[2]=D[2]+j[2],C;}function c(C,D,j){return C[0]=D[0]-j[0],C[1]=D[1]-j[1],C[2]=D[2]-j[2],C;}function p(C,D,j){return C[0]=D[0]*j[0],C[1]=D[1]*j[1],C[2]=D[2]*j[2],C;}function y(C,D,j){return C[0]=D[0]/j[0],C[1]=D[1]/j[1],C[2]=D[2]/j[2],C;}function P(C,D){return C[0]=Math.ceil(D[0]),C[1]=Math.ceil(D[1]),C[2]=Math.ceil(D[2]),C;}function T(C,D){return C[0]=Math.floor(D[0]),C[1]=Math.floor(D[1]),C[2]=Math.floor(D[2]),C;}function v(C,D,j){return C[0]=Math.min(D[0],j[0]),C[1]=Math.min(D[1],j[1]),C[2]=Math.min(D[2],j[2]),C;}function x(C,D,j){return C[0]=Math.max(D[0],j[0]),C[1]=Math.max(D[1],j[1]),C[2]=Math.max(D[2],j[2]),C;}function f(C,D){return C[0]=Math.round(D[0]),C[1]=Math.round(D[1]),C[2]=Math.round(D[2]),C;}function g(C,D,j){return C[0]=D[0]*j,C[1]=D[1]*j,C[2]=D[2]*j,C;}function u(C,D,j,H){return C[0]=D[0]+j[0]*H,C[1]=D[1]+j[1]*H,C[2]=D[2]+j[2]*H,C;}function m(C,D){var j=D[0]-C[0],H=D[1]-C[1],V=D[2]-C[2];return Math.hypot(j,H,V);}function M(C,D){var j=D[0]-C[0],H=D[1]-C[1],V=D[2]-C[2];return j*j+H*H+V*V;}function E(C){var D=C[0],j=C[1],H=C[2];return D*D+j*j+H*H;}function R(C,D){return C[0]=-D[0],C[1]=-D[1],C[2]=-D[2],C;}function b(C,D){return C[0]=1/D[0],C[1]=1/D[1],C[2]=1/D[2],C;}function O(C,D){var j=D[0],H=D[1],V=D[2],Q=j*j+H*H+V*V;return Q>0&&(Q=1/Math.sqrt(Q)),C[0]=D[0]*Q,C[1]=D[1]*Q,C[2]=D[2]*Q,C;}function L(C,D){return C[0]*D[0]+C[1]*D[1]+C[2]*D[2];}function w(C,D,j){var H=D[0],V=D[1],Q=D[2],it=j[0],st=j[1],ct=j[2];return C[0]=V*ct-Q*st,C[1]=Q*it-H*ct,C[2]=H*st-V*it,C;}function I(C,D,j,H){var V=D[0],Q=D[1],it=D[2];return C[0]=V+H*(j[0]-V),C[1]=Q+H*(j[1]-Q),C[2]=it+H*(j[2]-it),C;}function A(C,D,j,H,V,Q){var it=Q*Q,st=it*(2*Q-3)+1,ct=it*(Q-2)+Q,gt=it*(Q-1),at=it*(3-2*Q);return C[0]=D[0]*st+j[0]*ct+H[0]*gt+V[0]*at,C[1]=D[1]*st+j[1]*ct+H[1]*gt+V[1]*at,C[2]=D[2]*st+j[2]*ct+H[2]*gt+V[2]*at,C;}function W(C,D,j,H,V,Q){var it=1-Q,st=it*it,ct=Q*Q,gt=st*it,at=3*Q*st,ot=3*ct*it,ft=ct*Q;return C[0]=D[0]*gt+j[0]*at+H[0]*ot+V[0]*ft,C[1]=D[1]*gt+j[1]*at+H[1]*ot+V[1]*ft,C[2]=D[2]*gt+j[2]*at+H[2]*ot+V[2]*ft,C;}function z(C,D){D=D||1;var j=e.RANDOM()*2*Math.PI,H=e.RANDOM()*2-1,V=Math.sqrt(1-H*H)*D;return C[0]=Math.cos(j)*V,C[1]=Math.sin(j)*V,C[2]=H*D,C;}function K(C,D,j){var H=D[0],V=D[1],Q=D[2],it=j[3]*H+j[7]*V+j[11]*Q+j[15];return it=it||1,C[0]=(j[0]*H+j[4]*V+j[8]*Q+j[12])/it,C[1]=(j[1]*H+j[5]*V+j[9]*Q+j[13])/it,C[2]=(j[2]*H+j[6]*V+j[10]*Q+j[14])/it,C;}function k(C,D,j){var H=D[0],V=D[1],Q=D[2];return C[0]=H*j[0]+V*j[3]+Q*j[6],C[1]=H*j[1]+V*j[4]+Q*j[7],C[2]=H*j[2]+V*j[5]+Q*j[8],C;}function q(C,D,j){var H=j[0],V=j[1],Q=j[2],it=j[3],st=D[0],ct=D[1],gt=D[2],at=V*gt-Q*ct,ot=Q*st-H*gt,ft=H*ct-V*st,mt=V*ft-Q*ot,yt=Q*at-H*ft,pt=H*ot-V*at,Tt=it*2;return at*=Tt,ot*=Tt,ft*=Tt,mt*=2,yt*=2,pt*=2,C[0]=st+at+mt,C[1]=ct+ot+yt,C[2]=gt+ft+pt,C;}function U(C,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[0],Q[1]=V[1]*Math.cos(H)-V[2]*Math.sin(H),Q[2]=V[1]*Math.sin(H)+V[2]*Math.cos(H),C[0]=Q[0]+j[0],C[1]=Q[1]+j[1],C[2]=Q[2]+j[2],C;}function G(C,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[2]*Math.sin(H)+V[0]*Math.cos(H),Q[1]=V[1],Q[2]=V[2]*Math.cos(H)-V[0]*Math.sin(H),C[0]=Q[0]+j[0],C[1]=Q[1]+j[1],C[2]=Q[2]+j[2],C;}function Z(C,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[0]*Math.cos(H)-V[1]*Math.sin(H),Q[1]=V[0]*Math.sin(H)+V[1]*Math.cos(H),Q[2]=V[2],C[0]=Q[0]+j[0],C[1]=Q[1]+j[1],C[2]=Q[2]+j[2],C;}function nt(C,D){var j=C[0],H=C[1],V=C[2],Q=D[0],it=D[1],st=D[2],ct=Math.sqrt(j*j+H*H+V*V),gt=Math.sqrt(Q*Q+it*it+st*st),at=ct*gt,ot=at&&L(C,D)/at;return Math.acos(Math.min(Math.max(ot,-1),1));}function rt(C){return C[0]=0,C[1]=0,C[2]=0,C;}function tt(C){return"vec3("+C[0]+", "+C[1]+", "+C[2]+")";}function J(C,D){return C[0]===D[0]&&C[1]===D[1]&&C[2]===D[2];}function ht(C,D){var j=C[0],H=C[1],V=C[2],Q=D[0],it=D[1],st=D[2];return Math.abs(j-Q)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Q))&&Math.abs(H-it)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(it))&&Math.abs(V-st)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(st));}var dt=c,B=p,F=y,Y=m,X=M,N=a,$=E,S=function(){var C=n();return function(D,j,H,V,Q,it){var st,ct;for(j||(j=3),H||(H=0),V?ct=Math.min(V*j+H,D.length):ct=D.length,st=H;st0&&(S=1/Math.sqrt(S)),B[0]=Y*S,B[1]=X*S,B[2]=N*S,B[3]=$*S,B;}function L(B,F){return B[0]*F[0]+B[1]*F[1]+B[2]*F[2]+B[3]*F[3];}function w(B,F,Y,X){var N=Y[0]*X[1]-Y[1]*X[0],$=Y[0]*X[2]-Y[2]*X[0],S=Y[0]*X[3]-Y[3]*X[0],C=Y[1]*X[2]-Y[2]*X[1],D=Y[1]*X[3]-Y[3]*X[1],j=Y[2]*X[3]-Y[3]*X[2],H=F[0],V=F[1],Q=F[2],it=F[3];return B[0]=V*j-Q*D+it*C,B[1]=-(H*j)+Q*S-it*$,B[2]=H*D-V*S+it*N,B[3]=-(H*C)+V*$-Q*N,B;}function I(B,F,Y,X){var N=F[0],$=F[1],S=F[2],C=F[3];return B[0]=N+X*(Y[0]-N),B[1]=$+X*(Y[1]-$),B[2]=S+X*(Y[2]-S),B[3]=C+X*(Y[3]-C),B;}function A(B,F){F=F||1;var Y,X,N,$,S,C;do Y=e.RANDOM()*2-1,X=e.RANDOM()*2-1,S=Y*Y+X*X;while(S>=1);do N=e.RANDOM()*2-1,$=e.RANDOM()*2-1,C=N*N+$*$;while(C>=1);var D=Math.sqrt((1-S)/C);return B[0]=F*Y,B[1]=F*X,B[2]=F*N*D,B[3]=F*$*D,B;}function W(B,F,Y){var X=F[0],N=F[1],$=F[2],S=F[3];return B[0]=Y[0]*X+Y[4]*N+Y[8]*$+Y[12]*S,B[1]=Y[1]*X+Y[5]*N+Y[9]*$+Y[13]*S,B[2]=Y[2]*X+Y[6]*N+Y[10]*$+Y[14]*S,B[3]=Y[3]*X+Y[7]*N+Y[11]*$+Y[15]*S,B;}function z(B,F,Y){var X=F[0],N=F[1],$=F[2],S=Y[0],C=Y[1],D=Y[2],j=Y[3],H=j*X+C*$-D*N,V=j*N+D*X-S*$,Q=j*$+S*N-C*X,it=-S*X-C*N-D*$;return B[0]=H*j+it*-S+V*-D-Q*-C,B[1]=V*j+it*-C+Q*-S-H*-D,B[2]=Q*j+it*-D+H*-C-V*-S,B[3]=F[3],B;}function K(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=0,B;}function k(B){return"vec4("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+")";}function q(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3];}function U(B,F){var Y=B[0],X=B[1],N=B[2],$=B[3],S=F[0],C=F[1],D=F[2],j=F[3];return Math.abs(Y-S)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(S))&&Math.abs(X-C)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(C))&&Math.abs(N-D)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(D))&&Math.abs($-j)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(j));}var G=d,Z=c,nt=p,rt=u,tt=m,J=M,ht=E,dt=function(){var B=n();return function(F,Y,X,N,$,S){var C,D;for(Y||(Y=4),X||(X=0),N?D=Math.min(N*Y+X,F.length):D=F.length,C=X;C0){Y=Math.sqrt(Y);var X=F[0]/Y,N=F[1]/Y,$=F[2]/Y,S=F[3]/Y,C=F[4],D=F[5],j=F[6],H=F[7],V=X*C+N*D+$*j+S*H;B[0]=X,B[1]=N,B[2]=$,B[3]=S,B[4]=(C-X*V)/Y,B[5]=(D-N*V)/Y,B[6]=(j-$*V)/Y,B[7]=(H-S*V)/Y;}return B;}function J(B){return"quat2("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+")";}function ht(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3]&&B[4]===F[4]&&B[5]===F[5]&&B[6]===F[6]&&B[7]===F[7];}function dt(B,F){var Y=B[0],X=B[1],N=B[2],$=B[3],S=B[4],C=B[5],D=B[6],j=B[7],H=F[0],V=F[1],Q=F[2],it=F[3],st=F[4],ct=F[5],gt=F[6],at=F[7];return Math.abs(Y-H)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(H))&&Math.abs(X-V)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(V))&&Math.abs(N-Q)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(Q))&&Math.abs($-it)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(it))&&Math.abs(S-st)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(st))&&Math.abs(C-ct)<=e.EPSILON*Math.max(1,Math.abs(C),Math.abs(ct))&&Math.abs(D-gt)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(gt))&&Math.abs(j-at)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(at));}},/* 11 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return l;}),t.d(r,"subtract",function(){return d;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return p;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return P;}),t.d(r,"min",function(){return T;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return x;}),t.d(r,"scale",function(){return f;}),t.d(r,"scaleAndAdd",function(){return g;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return m;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return E;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return w;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return A;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return z;}),t.d(r,"transformMat3",function(){return K;}),t.d(r,"transformMat4",function(){return k;}),t.d(r,"rotate",function(){return q;}),t.d(r,"angle",function(){return U;}),t.d(r,"zero",function(){return G;}),t.d(r,"str",function(){return Z;}),t.d(r,"exactEquals",function(){return nt;}),t.d(r,"equals",function(){return rt;}),t.d(r,"len",function(){return tt;}),t.d(r,"sub",function(){return J;}),t.d(r,"mul",function(){return ht;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return B;}),t.d(r,"sqrDist",function(){return F;}),t.d(r,"sqrLen",function(){return Y;}),t.d(r,"forEach",function(){return X;});var e=t(2);function n(){var N=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0),N;}function i(N){var $=new e.ARRAY_TYPE(2);return $[0]=N[0],$[1]=N[1],$;}function a(N,$){var S=new e.ARRAY_TYPE(2);return S[0]=N,S[1]=$,S;}function o(N,$){return N[0]=$[0],N[1]=$[1],N;}function s(N,$,S){return N[0]=$,N[1]=S,N;}function l(N,$,S){return N[0]=$[0]+S[0],N[1]=$[1]+S[1],N;}function d(N,$,S){return N[0]=$[0]-S[0],N[1]=$[1]-S[1],N;}function c(N,$,S){return N[0]=$[0]*S[0],N[1]=$[1]*S[1],N;}function p(N,$,S){return N[0]=$[0]/S[0],N[1]=$[1]/S[1],N;}function y(N,$){return N[0]=Math.ceil($[0]),N[1]=Math.ceil($[1]),N;}function P(N,$){return N[0]=Math.floor($[0]),N[1]=Math.floor($[1]),N;}function T(N,$,S){return N[0]=Math.min($[0],S[0]),N[1]=Math.min($[1],S[1]),N;}function v(N,$,S){return N[0]=Math.max($[0],S[0]),N[1]=Math.max($[1],S[1]),N;}function x(N,$){return N[0]=Math.round($[0]),N[1]=Math.round($[1]),N;}function f(N,$,S){return N[0]=$[0]*S,N[1]=$[1]*S,N;}function g(N,$,S,C){return N[0]=$[0]+S[0]*C,N[1]=$[1]+S[1]*C,N;}function u(N,$){var S=$[0]-N[0],C=$[1]-N[1];return Math.hypot(S,C);}function m(N,$){var S=$[0]-N[0],C=$[1]-N[1];return S*S+C*C;}function M(N){var $=N[0],S=N[1];return Math.hypot($,S);}function E(N){var $=N[0],S=N[1];return $*$+S*S;}function R(N,$){return N[0]=-$[0],N[1]=-$[1],N;}function b(N,$){return N[0]=1/$[0],N[1]=1/$[1],N;}function O(N,$){var S=$[0],C=$[1],D=S*S+C*C;return D>0&&(D=1/Math.sqrt(D)),N[0]=$[0]*D,N[1]=$[1]*D,N;}function L(N,$){return N[0]*$[0]+N[1]*$[1];}function w(N,$,S){var C=$[0]*S[1]-$[1]*S[0];return N[0]=N[1]=0,N[2]=C,N;}function I(N,$,S,C){var D=$[0],j=$[1];return N[0]=D+C*(S[0]-D),N[1]=j+C*(S[1]-j),N;}function A(N,$){$=$||1;var S=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(S)*$,N[1]=Math.sin(S)*$,N;}function W(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[2]*D,N[1]=S[1]*C+S[3]*D,N;}function z(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[2]*D+S[4],N[1]=S[1]*C+S[3]*D+S[5],N;}function K(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[3]*D+S[6],N[1]=S[1]*C+S[4]*D+S[7],N;}function k(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[4]*D+S[12],N[1]=S[1]*C+S[5]*D+S[13],N;}function q(N,$,S,C){var D=$[0]-S[0],j=$[1]-S[1],H=Math.sin(C),V=Math.cos(C);return N[0]=D*V-j*H+S[0],N[1]=D*H+j*V+S[1],N;}function U(N,$){var S=N[0],C=N[1],D=$[0],j=$[1],H=Math.sqrt(S*S+C*C)*Math.sqrt(D*D+j*j),V=H&&(S*D+C*j)/H;return Math.acos(Math.min(Math.max(V,-1),1));}function G(N){return N[0]=0,N[1]=0,N;}function Z(N){return"vec2("+N[0]+", "+N[1]+")";}function nt(N,$){return N[0]===$[0]&&N[1]===$[1];}function rt(N,$){var S=N[0],C=N[1],D=$[0],j=$[1];return Math.abs(S-D)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(D))&&Math.abs(C-j)<=e.EPSILON*Math.max(1,Math.abs(C),Math.abs(j));}var tt=M,J=d,ht=c,dt=p,B=u,F=m,Y=E,X=function(){var N=n();return function($,S,C,D,j,H){var V,Q;for(S||(S=2),C||(C=0),D?Q=Math.min(D*S+C,$.length):Q=$.length,V=C;V1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var I=w.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var A=L;L={getContext:function getContext(){return A;},width:w.width,height:w.height},A.canvas=L,I="2d";}if(this[M]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(w.contextType=I,this[g]=Object.assign({},P,w),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[g].webgl2=!0);var _A=new e["default"](L,this[g]);I==="webgl2"&&!_A.isWebGL2&&(w.contextType="webgl"),Object(y.createShaders)(_A),Object(y.applyShader)(_A),Object(y.createCloudShaders)(_A);var W=_A.gl;W.clearColor(0,0,0,0),W.blendFuncSeparate(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA,W.ONE,W.ONE_MINUS_SRC_ALPHA),this[x]=_A;}else this[f]=new i["default"](L,this[g]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(b,[{key:"canvas",get:function get(){return this[M];}},{key:"canvasRenderer",get:function get(){return this[f];}},{key:"glRenderer",get:function get(){return this[x];}},{key:"isWebGL2",get:function get(){return this[x]&&this[x].isWebGL2;}},{key:"options",get:function get(){return this[g];}},{key:"globalTransformMatrix",get:function get(){var L=this[u];return[L[0],L[1],L[3],L[4],L[6],L[7]];}},{key:"viewMatrix",get:function get(){return this[u];}},{key:m,value:function value(){var L=this[x]||this[f];if(this[x]){var _this$canvas=this.canvas,w=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[w,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,w=_this$canvas2.height,I=[// translation\n1,0,0,0,1,0,-L/2,-w/2,1],A=[// scale\n2/L,0,0,0,-2/w,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),A,I);this.projectionMatrix=W,this[x]&&this[x].gl.viewport(0,0,L,w);}},{key:"createTexture",value:function createTexture(L,w){return(this[x]||this[f]).createTexture(L,w);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$useImageBitmap=_ref3.useImageBitmap,w=_ref3$useImageBitmap===void 0?!1:_ref3$useImageBitmap;return(this[x]||this[f]).loadTexture(L,{useImageBitmap:w});}},{key:"createText",value:function createText(L){var _ref4=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref4$font=_ref4.font,w=_ref4$font===void 0?"16px arial":_ref4$font,_ref4$fillColor=_ref4.fillColor,I=_ref4$fillColor===void 0?null:_ref4$fillColor,_ref4$strokeColor=_ref4.strokeColor,A=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[x]){var z=p["default"].createText(L,{font:w,fillColor:I,strokeColor:A,strokeWidth:W});return{image:this.createTexture(z.image),rect:z.rect};}return{_img:{font:w,fillColor:I,strokeColor:A,strokeWidth:W,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref5.vertex,w=_ref5.fragment,I=_ref5.options;if(this[x]){var A=this[x].compileSync(w,L);return A._attribOpts=I,A;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref6$vertex=_ref6.vertex,L=_ref6$vertex===void 0?T:_ref6$vertex,_ref6$fragment=_ref6.fragment,w=_ref6$fragment===void 0?v:_ref6$fragment,I=_ref6.options;return this.createProgram({vertex:L,fragment:w,options:I});}},{key:"useProgram",value:function useProgram(L){var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[x]){var I=Object.assign({},L._attribOpts,w);return this[x].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[x]||this[f]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$f;if(this[x]){var w=this[x].gl;w.clear(w.COLOR_BUFFER_BIT);}else(_this$f=this[f]).clear.apply(_this$f,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(L){var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,w=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var A=this[x]||this[f],W=I||L.program;if(this[x]){var z=A.gl;if(w&&z.clear(z.COLOR_BUFFER_BIT),W)A.program!==W&&this.useProgram(W,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});else{var K=L.mesh.meshData,k=!!K.uniforms.u_texSampler,q=!!K.uniforms.u_filterFlag,U=!!K.uniforms.u_radialGradientVector,G=L.hasCloudColor,Z=L.hasCloudFilter,nt=!!K.uniforms.u_clipSampler;Object(y.applyCloudShader)(A,{hasTexture:k,hasFilter:q,hasGradient:U,hasCloudColor:G,hasCloudFilter:Z,hasClipPath:nt});}this[m](),A.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(z,L),E(A),L.afterRender&&L.afterRender(z,L);}else A.setTransform(this.globalTransformMatrix),A.drawMeshCloud(L,{clear:w,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(L){var _this14=this;var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$clear=_ref8.clear,w=_ref8$clear===void 0?!1:_ref8$clear,_ref8$program=_ref8.program,I=_ref8$program===void 0?null:_ref8$program;var A=this[x]||this[f];if(this[x]){var W=A.fbo,z=Object(a["default"])(this,L,I==null),K=A.gl;w&&K.clear(K.COLOR_BUFFER_BIT);var k=!Object(c.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator12=_createForOfIteratorHelper(z),_step12;try{var _loop=function _loop(){var q=_step12.value;_this14._drawCalls++;var U=I||q.program;if(q instanceof d["default"])_this14.drawMeshCloud(q,{clear:w,program:U});else{var _this14$canvas=_this14.canvas,G=_this14$canvas.width,Z=_this14$canvas.height;if(q.beforeRender&&q.beforeRender(K,q),q.pass.length&&((!_this14.fbo||_this14.fbo.width!==G||_this14.fbo.height!==Z)&&(_this14.fbo={width:G,height:Z,target:A.createFBO(),buffer:A.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),A.bindFBO(_this14.fbo.target)),!U&&q.filterCanvas){Object(y.applyShader)(A,{hasTexture:!0});var nt=_this14.filterContext;nt||(nt=p["default"].createCanvas(G,Z).getContext("2d"),_this14.filterContext=nt);var rt=L[q.packIndex],tt=rt.filter,J=L[q.packIndex+1],ht=L[q.packIndex-1];(!ht||!ht.filterCanvas||ht.filter!==tt)&&(!J||!J.filterCanvas||J.filter!==tt)?(k?(nt.save(),Object(o.drawMesh2D)(rt,nt,!1),nt.restore(),Object(o.applyFilter)(nt,tt)):Object(o.drawMesh2D)(rt,nt,!0),_this14[m](),R(A,nt,G,Z)):(k&&nt.save(),Object(o.drawMesh2D)(rt,nt,!1),k&&nt.restore(),(!J||!J.filterCanvas||rt.filter!==J.filter)&&(Object(o.applyFilter)(nt,tt),_this14[m](),R(A,nt,G,Z)));}else{if(U)A.program!==U&&_this14.useProgram(U,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _nt=!!q.uniforms.u_texSampler,_rt=!!q.uniforms.u_filterFlag,_tt=!!q.uniforms.u_radialGradientVector,_J=!!q.uniforms.u_clipSampler;Object(y.applyShader)(A,{hasTexture:_nt,hasFilter:_rt,hasGradient:_tt,hasClipPath:_J});}q.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[m](),A.setMeshData([q]),E(A);}if(q.pass.length){var _nt2=q.pass.length;q.pass.forEach(function(rt,tt){rt.blend=q.enableBlend,rt.setTexture(A.fbo.texture),tt===_nt2-1?A.bindFBO(W):(_this14.fbo.swap(),A.bindFBO(_this14.fbo.target)),rt.program?A.useProgram(rt.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),A.useProgram(_this14.defaultPassProgram)),A.setMeshData([rt.meshData]),K.clear(K.COLOR_BUFFER_BIT),E(A);});}q.afterRender&&q.afterRender(K,q);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else A.setTransform(this.globalTransformMatrix),A.drawMeshes(L,{clear:w});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,w=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){w[_key-1]=arguments[_key];}var I=w.length;if(I<2)throw new TypeError("Failed to execute \'drawImage\' on \'Renderer\': 3 arguments required, but only ".concat(w.length+1," present."));if(I!==2&&I!==4&&I!==8)throw new TypeError("Failed to execute \'drawImage\' on \'Renderer\': Valid arities are: [3, 5, 9], but ".concat(w.length+1," arguments provided."));var A=null,W=null;I===2?A=[w[0],w[1],L.width,L.height]:I===4?A=w:I===8&&(W=w.slice(0,4),A=w.slice(4));var z=this.createTexture(L),_this$canvas3=this.canvas,K=_this$canvas3.width,k=_this$canvas3.height,q=new s["default"]();q.rect(A[0],A[1],K,k);var U=new l["default"](q,{width:K,height:k});U.setTexture(z,{rect:A,srcRect:W}),this.drawMeshes([U]),this.deleteTexture(z);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[u]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var w=this[u];for(var _len2=arguments.length,L=new Array(_len2),_key2=0;_key2<_len2;_key2++){L[_key2]=arguments[_key2];}return this[u]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),w,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,w){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,w]),this.globalTransform.apply(this,_toConsumableArray(I));}},{key:"globalRotate",value:function globalRotate(L){var _ref10=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref11=_slicedToArray(_ref10,2),w=_ref11[0],I=_ref11[1];var A=n.mat3.create();return A=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),A,[w,I]),A=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),A,L),A=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),A,[-w,-I]),this.globalTransform.apply(this,_toConsumableArray(A));}},{key:"globalScale",value:function globalScale(L){var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),I=_ref13[0],A=_ref13[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,A]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[L,w]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-A]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(L){var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref14=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref15=_slicedToArray(_ref14,2),I=_ref15[0],A=_ref15[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,A]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(w),Math.tan(L),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-A]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,w,I){var A=this.globalTransformMatrix;I&&(A=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),A,I));var W=L*A[0]+w*A[2]+A[4],z=L*A[1]+w*A[3]+A[5];return[W,z];}}]);}();},/* 14 */ /***/function(h,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(16),n=t(17),i=t(18),a=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(P,T,v){return T in P?Object.defineProperty(P,T,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[T]=v,P;}var s={};function l(P){var T=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var v=[],x=P.length;for(var f=0;f1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,v),this.canvas=T;var x;this.options.webgl2&&(x=T.getContext("webgl2",this.options)),x==null&&(x=Object(e.setupWebGL)(T,this.options),this.aia_ext=x.getExtension("ANGLE_instanced_arrays")),this.gl=x,x.viewport(0,0,T.width,T.height),x.clearColor(0,0,0,0),x.blendFuncSeparate(x.SRC_ALPHA,x.ONE_MINUS_SRC_ALPHA,x.ONE,x.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(y,[{key:"program",get:function get(){var T=this.gl;return T.getParameter(T.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()\n// WebGLRenderingContext.uniformMatrix[234]fv()\n},{key:"_declareUniform",value:function _declareUniform(T,v){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var f=this.gl,g=f.getUniformLocation(T,v);var u;var m=this;if(/^sampler/.test(x)){var M=T._samplerMap,E=T._bindTextures;Object.defineProperty(T.uniforms,v,{get:function get(){return u;},set:function set(R){u=R;var b=M[v]!=null?M[v]:E.length;E[b]=R,c(f,R,b),M[v]||(M[v]=b,f.uniform1i(g,b)),m.options.autoUpdate&&m.update();},configurable:!1,enumerable:!0});}else{var _M=x.indexOf("Matrix")===0,_E=!_M&&/v$/.test(x),R=f["uniform".concat(x)].bind(f);Object.defineProperty(T.uniforms,v,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_M?R(g,!1,b):_E?R(g,b):R.apply(void 0,[g].concat(_toConsumableArray(b))),m.options.autoUpdate&&m.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var T=this.program;T.meshData.forEach(function(v,x){var f=v.positions,g=v.cells,u=v.instanceCount,m=v.cellsCount,M=v.attributes,E=v.uniforms,R=v.textureCoord,b=v.enableBlend,O=_this15.gl;var L=v.mode!=null?v.mode:O.TRIANGLES;typeof L=="string"&&(L=O[L]),b?O.enable(O.BLEND):O.disable(O.BLEND),O.bindBuffer(O.ARRAY_BUFFER,T._buffers.verticesBuffer),O.bufferData(O.ARRAY_BUFFER,f,O.STATIC_DRAW),g&&(O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,T._buffers.cellsBuffer),O.bufferData(O.ELEMENT_ARRAY_BUFFER,g,O.STATIC_DRAW));var w=[];M&&Object.values(M).forEach(function(_ref16){var A=_ref16.name,W=_ref16.data,z=_ref16.divisor;if(O.bindBuffer(O.ARRAY_BUFFER,T._buffers[A]),O.bufferData(O.ARRAY_BUFFER,W,O.STATIC_DRAW),z!=null){var K=O.getAttribLocation(T,A);K>=0&&(O.enableVertexAttribArray(K),w.push(K),O.vertexAttribDivisor?O.vertexAttribDivisor(K,z):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(K,z));}}),E&&Object.entries(E).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),A=_ref18[0],W=_ref18[1];_this15.uniforms[A]=W;});var I;if(!g){var A=T._dimension;I=f.length/A;}if(T._enableTextures&&T._buffers.texCoordBuffer){var _A2=R||l(f,T._dimension);O.bindBuffer(O.ARRAY_BUFFER,T._buffers.texCoordBuffer),O.bufferData(O.ARRAY_BUFFER,y.FLOAT(_A2),O.STATIC_DRAW);}u!=null?(g?O.drawElementsInstanced?O.drawElementsInstanced(L,m,O.UNSIGNED_SHORT,0,u):_this15.aia_ext&&_this15.aia_ext.drawElementsInstancedANGLE(L,m,O.UNSIGNED_SHORT,0,u):O.drawArraysInstanced?O.drawArraysInstanced(L,0,I,u):_this15.aia_ext.drawArraysInstancedANGLE(L,0,I,u),w.forEach(function(A){O.vertexAttribDivisor?O.vertexAttribDivisor(A,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(A,null);})):g?O.drawElements(L,m,O.UNSIGNED_SHORT,0):O.drawArrays(L,0,I);});}},{key:"isWebGL2",get:function get(){return(typeof WebGL2RenderingContext==="undefined"?"undefined":_typeof(WebGL2RenderingContext))<"u"&&this.gl instanceof WebGL2RenderingContext;}},{key:"enableTextures",get:function get(){return this.program&&this.program._enableTextures;}},{key:"uniforms",get:function get(){var T=this.program;if(!T||!T.uniforms)throw Error("No avaliable program.");return T.uniforms;}},{key:"deleteProgram",value:function deleteProgram(T){var v=this.gl;this.program===T&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),v.useProgram(null));var x=this.programs.indexOf(T);x>=0&&this.programs.splice(x,1),d(v,T),v.deleteProgram(T);}/**\n [{\n positions: ...\n cells: ...\n textureCoord: ...\n attributes: {name: {data:..., normalize: true}},\n uniforms: ...\n }]\n */},{key:"setMeshData",value:function setMeshData(T){var _this16=this;Array.isArray(T)||(T=[T]);var v=this.program;v.meshData=T.map(function(_ref19){var x=_ref19.mode,f=_ref19.positions,g=_ref19.instanceCount,u=_ref19.cells,m=_ref19.cellsCount,M=_ref19.attributes,E=_ref19.uniforms,R=_ref19.textureCoord,b=_ref19.enableBlend;var O={positions:y.FLOAT(f),uniforms:E,enableBlend:!!b,textureCoord:y.FLOAT(R)};if(u&&(O.cells=y.USHORT(u),O.cellsCount=m||O.cells.length),x!=null&&(O.mode=x),g!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");O.instanceCount=g;}if(M){var L={};Object.entries(M).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),w=_ref21[0],I=_ref21[1];if(!v._attribute[w])v._attribute[w]="ignored";else if(v._attribute[w]!=="ignored"){var _v$_attribute$w=v._attribute[w],A=_v$_attribute$w.name,W=_v$_attribute$w.type;var z=I.data||I;if(Array.isArray(z)&&(z=y[W](z)),L[w]={name:A,data:z},I.divisor!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[w].divisor=I.divisor;}}}),O.attributes=L;}return O;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(T,v){var _this17=this;var x=/^\\s*uniform\\s+sampler/mg.test(T);T==null&&(T=i["default"]),v==null&&(v=x?a["default"]:n["default"]);var f=this.gl,g=Object(e.createProgram)(f,v,T);g.shaderText={vertexShader:v,fragmentShader:T},g._buffers={},g._attribute={},g.uniforms={},g._samplerMap={},g._bindTextures=[];var u=new RegExp("(?:attribute|in) vec(\\\\d) ".concat(this.options.vertexPosition),"im");var m=v.match(u);m&&(g._dimension=Number(m[1]));var M=new RegExp("(?:attribute|in) vec(\\\\d) ".concat(this.options.vertexTextureCoord),"im");m=v.match(M),m&&(g._texCoordSize=Number(m[1]));var E=/^\\s*(?:attribute|in) (\\w+?)(\\d*) (\\w+)/gim;if(m=v.match(E),m)for(var O=0;O=0,g._enableTextures&&(g._buffers.texCoordBuffer=f.createBuffer()),this.programs.push(g),g;}},{key:"useProgram",value:function useProgram(T){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var x=this.gl;x.useProgram(T);var f=T._dimension;x.bindBuffer(x.ARRAY_BUFFER,T._buffers.verticesBuffer);var g=x.getAttribLocation(T,this.options.vertexPosition);if(x.vertexAttribPointer(g,f,x.FLOAT,!1,0,0),x.enableVertexAttribArray(g),T._enableTextures){x.bindBuffer(x.ARRAY_BUFFER,T._buffers.texCoordBuffer);var u=x.getAttribLocation(T,this.options.vertexTextureCoord);x.vertexAttribPointer(u,T._texCoordSize||2,x.FLOAT,!1,0,0),x.enableVertexAttribArray(u);}if(Object.entries(T._attribute).forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],m=_ref23[1];if(m!=="ignored"){var M=m.size,E=v[u]||{},R=!!E.normalize;var b=E.type||"FLOAT";var O=E.key||u;b==="UBYTE"&&(b="UNSIGNED_BYTE"),b==="USHORT"&&(b="UNSIGNED_SHORT"),m.type=b,O&&O!==u&&(T._attribute[O]=m),x.bindBuffer(x.ARRAY_BUFFER,T._buffers[u]);var L=x.getAttribLocation(T,u);L>=0&&(x.vertexAttribPointer(L,M,x[b],R,0,0),x.enableVertexAttribArray(L));}}),!T.meshData){var _u2=[[-1,-1,0,1].slice(0,f),[1,-1,0,1].slice(0,f),[1,1,0,1].slice(0,f),[-1,1,0,1].slice(0,f)],m=[[0,1,3],[3,1,2]];this.setMeshData({positions:_u2,cells:m});}return T;}},{key:"compileSync",value:function compileSync(T,v){T=T||i["default"];var x={};function f(M){M=M.replace(/^\\s*/mg,"");var E=[],R=M.match(/^#pragma\\s+include\\s+.*/mg);if(R){for(var b=0;b|")/);if(L){var w=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),x[I])E.push("/* included ".concat(I," */"));else if(x[I]=!0,w==="lib"){var A=f(s[I]);E.push(A);}else if(w==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}E.forEach(function(b){M=M.replace(/^#pragma\\s+include\\s+.*/m,b);});}return M;}var g=f(T),u=v?f(v):null;return this.createProgram(g,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(T,v){var x,f,_f2,g,u;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_f2=function _f4(){_f2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(M){var E,R,b,L,w,I,A,_A3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:M=M.replace(/^\\s*/mg,"");E=[],R=M.match(/^#pragma\\s+include\\s+.*/mg);if(!R){_context11.next=32;break;}b=0;case 4:if(!(b|")/);if(!L){_context11.next=28;break;}w=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),x[I])){_context11.next=13;break;}E.push("/* included ".concat(I," */"));_context11.next=28;break;case 13:if(!(x[I]=!0,w==="lib")){_context11.next=20;break;}_context11.next=16;return f(s[I]);case 16:A=_context11.sent;E.push(A);_context11.next=28;break;case 20:if(!(w==="link")){_context11.next=28;break;}_context11.next=23;return y.fetchShader(I);case 23:_A3=_context11.sent;_context11.next=26;return f(_A3);case 26:_A3=_context11.sent;E.push(_A3);case 28:b++;_context11.next=4;break;case 31:E.forEach(function(b){M=M.replace(/^#pragma\\s+include\\s+.*/m,b);});case 32:return _context11.abrupt("return",M);case 33:case"end":return _context11.stop();}},_callee11);}));return _f2.apply(this,arguments);};f=function _f3(_x13){return _f2.apply(this,arguments);};T=T||i["default"];x={};_context12.next=6;return f(T);case 6:g=_context12.sent;if(!v){_context12.next=13;break;}_context12.next=10;return f(v);case 10:_context12.t0=_context12.sent;_context12.next=14;break;case 13:_context12.t0=null;case 14:u=_context12.t0;return _context12.abrupt("return",this.createProgram(g,u));case 16:case"end":return _context12.stop();}},_callee12,this);}));function compile(_x11,_x12){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(T){var v,_args13=arguments;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:v=_args13.length>1&&_args13[1]!==undefined?_args13[1]:null;_context13.next=3;return y.fetchShader(T);case 3:T=_context13.sent;_context13.t0=v;if(!_context13.t0){_context13.next=9;break;}_context13.next=8;return y.fetchShader(v);case 8:v=_context13.sent;case 9:return _context13.abrupt("return",this.compile(T,v));case 10:case"end":return _context13.stop();}},_callee13,this);}));function load(_x14){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this18=this;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref24=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref24$wrapS=_ref24.wrapS,v=_ref24$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapS,_ref24$wrapT=_ref24.wrapT,x=_ref24$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapT,_ref24$minFilter=_ref24.minFilter,f=_ref24$minFilter===void 0?this.gl.LINEAR:_ref24$minFilter,_ref24$magFilter=_ref24.magFilter,g=_ref24$magFilter===void 0?this.gl.LINEAR:_ref24$magFilter;var u=this.gl,m=Array.isArray(T)?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),u.activeTexture(u.TEXTURE0+this._max_texture_image_units-1);var M=u.createTexture();u.bindTexture(m,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,E=_this$canvas4.width,R=_this$canvas4.height;if(T){if(m===u.TEXTURE_CUBE_MAP)for(var b=0;b<6;b++)u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,T[b]);else u.texImage2D(m,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,T);}else if(m===u.TEXTURE_CUBE_MAP)for(var _b=0;_b<6;_b++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_b,0,u.RGBA,E,R,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(m,0,u.RGBA,E,R,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(m,u.TEXTURE_MIN_FILTER,f),u.texParameteri(m,u.TEXTURE_MAG_FILTER,g),u.texParameteri(m,u.TEXTURE_WRAP_S,v),u.texParameteri(m,u.TEXTURE_WRAP_T,x),m===u.TEXTURE_CUBE_MAP&&(T.width=T[0].width,T.height=T[0].height),u.bindTexture(m,null),M._img=T||{width:E,height:R},M["delete"]=function(){_this18.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(T){var v=T._img;this.gl.deleteTexture(T),typeof v.close=="function"&&v.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(T){var _ref25,_ref25$useImageBitmap,v,x,_args14=arguments;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_ref25=_args14.length>1&&_args14[1]!==undefined?_args14[1]:{},_ref25$useImageBitmap=_ref25.useImageBitmap,v=_ref25$useImageBitmap===void 0?!0:_ref25$useImageBitmap;_context14.next=3;return y.loadImage(T,{useImageBitmap:v});case 3:x=_context14.sent;return _context14.abrupt("return",this.createTexture(x));case 5:case"end":return _context14.stop();}},_callee14,this);}));function loadTexture(_x15){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$color=_ref26.color,T=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,v=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,x=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,f=_ref26$stencil===void 0?!!this.options.stencil:_ref26$stencil;var g=this.gl,u=g.createFramebuffer();g.bindFramebuffer(g.FRAMEBUFFER,u);var m=[];for(var R=0;R0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=T;}},{key:"render",value:function render(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,T=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var v=this.gl;var x=this.program;x||(x=this.createProgram(),this.useProgram(x)),this.fbo&&v.bindFramebuffer(v.FRAMEBUFFER,this.fbo);var f=this.options.depth;f&&v.enable(v.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(f?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var g=this._renderFrameID;this._draw(),this.fbo&&v.bindFramebuffer(v.FRAMEBUFFER,null),this._renderFrameID===g&&(this._renderFrameID=null);}},{key:"update",value:function update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)));}}],[{key:"addLibs",value:function addLibs(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,T);}},{key:"FLOAT",value:function FLOAT(T,v){return Object(e.pointsToBuffer)(T,Float32Array,v);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(T,v){return Object(e.pointsToBuffer)(T,Uint8Array,v);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(T,v){return Object(e.pointsToBuffer)(T,Uint16Array,v);}},{key:"BYTE",value:function BYTE(T,v){return Object(e.pointsToBuffer)(T,Int8Array,v);}},{key:"SHORT",value:function SHORT(T,v){return Object(e.pointsToBuffer)(T,Int16Array,v);}}]);}();o(y,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(y,"UBYTE",y.UNSIGNED_BYTE),o(y,"USHORT",y.UNSIGNED_SHORT),o(y,"fetchShader",e.fetchShader),o(y,"loadImage",e.loadImage);},/* 16 */ /***/function(h,r,t){t.r(r),t.d(r,"setupWebGL",function(){return n;}),t.d(r,"createProgram",function(){return i;}),t.d(r,"pointsToBuffer",function(){return a;}),t.d(r,"loadImage",function(){return s;}),t.d(r,"fetchShader",function(){return d;}),t(1).glMatrix.setMatrixArrayType(Array);function e(c,p){var y=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var P=null;for(var T=0;T1&&arguments[1]!==undefined?arguments[1]:Float32Array;var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(y&&!(y instanceof p))throw new TypeError("Wrong buffer type.");if(c==null||c instanceof p)return c;if(c[0]==null||c[0].length==null)return y?(y.set(c,0),y):new p(c);var P=c[0].length,T=c.length;y||(y=new p(P*T));var v=0;for(var _x19=0;_x191&&arguments[1]!==undefined?arguments[1]:{},_ref28$useImageBitmap=_ref28.useImageBitmap,p=_ref28$useImageBitmap===void 0?!0:_ref28$useImageBitmap,_ref28$alias=_ref28.alias,y=_ref28$alias===void 0?null:_ref28$alias;if(!o[c]){if(typeof Image=="function"){var P=new Image();typeof c=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(c)&&(P.crossOrigin="anonymous"),o[c]=new Promise(function(T){P.onload=function(){p&&typeof createImageBitmap=="function"?createImageBitmap(P,{imageOrientation:"flipY"}).then(function(v){o[c]=v,y&&(o[y]=v),T(v);}):(o[c]=P,y&&(o[y]=P),T(P));},P.src=c;}),y&&(o[y]=o[c]);}else if(typeof fetch=="function")return fetch(c,{method:"GET",mode:"cors",cache:"default"}).then(function(P){return P.blob();}).then(function(P){return createImageBitmap(P,{imageOrientation:"flipY"}).then(function(T){return o[c]=T,y&&(o[y]=T),T;});});}return o[c];}var l={};function d(_x20){return _d2.apply(this,arguments);}function _d2(){_d2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(c){var p,y;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!l[c]){_context15.next=2;break;}return _context15.abrupt("return",l[c]);case 2:_context15.next=4;return fetch(c);case 4:p=_context15.sent;if(!(p.status>=200&&p.status<300)){_context15.next=10;break;}_context15.next=8;return p.text();case 8:y=_context15.sent;return _context15.abrupt("return",(l[c]=y,y));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context15.stop();}},_callee15);}));return _d2.apply(this,arguments);}},/* 17 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n gl_Position = vec4(a_vertexPosition, 1);\\n}";},/* 18 */ /***/function(h,r,t){t.r(r),r["default"]="#ifdef GL_ES\\nprecision mediump float;\\n#endif\\n\\nvoid main() {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);\\n}";},/* 19 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec4 a_vertexPosition;\\nattribute vec2 a_vertexTextureCoord;\\nvarying vec2 vTextureCoord;\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n gl_Position = a_vertexPosition;\\n vTextureCoord = a_vertexTextureCoord;\\n}";},/* 20 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return a;});var e=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var a=/*#__PURE__*/function(){function a(s,l){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=l,this[i]=[1,0,0,1,0,0];}return _createClass(a,[{key:"createTexture",value:function createTexture(s){return{_img:s};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s){var l;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return e["default"].loadImage(s,{useImageBitmap:!1});case 2:l=_context16.sent;return _context16.abrupt("return",this.createTexture(l));case 4:case"end":return _context16.stop();}},_callee16,this);}));function loadTexture(_x21){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(s){return s;}},{key:"clear",value:function clear(s,l,d,c){var p=this.context;s=s||0,l=l||0,d=d||p.canvas.width-s,c=c||p.canvas.height-l,p.clearRect(s,l,d,c);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,l=_ref29$clear===void 0?!1:_ref29$clear;var d=[];for(var c=0;c1&&arguments[1]!==undefined?arguments[1]:{},_ref30$clear=_ref30.clear,l=_ref30$clear===void 0?!1:_ref30$clear,_ref30$hook=_ref30.hook,d=_ref30$hook===void 0?!0:_ref30$hook;var c=this.context;l&&c.clearRect(0,0,c.canvas.width,c.canvas.height);var p=null;var _c$canvas=c.canvas,y=_c$canvas.width,P=_c$canvas.height,T=s.length;s.forEach(function(v,x){var _v$_cloudOptions,_this19$filterBuffer;var f,g,u,m,M;d&&v.beforeRender&&v.beforeRender(c,v),v._cloudOptions&&((_v$_cloudOptions=_slicedToArray(v._cloudOptions,5),f=_v$_cloudOptions[0],g=_v$_cloudOptions[1],u=_v$_cloudOptions[2],m=_v$_cloudOptions[3],M=_v$_cloudOptions[4]),v=v.mesh);var E=v.filter;if(M&&(E=E?"".concat(E," ").concat(M):M),E&&!_this19.filterBuffer&&_this19.filterBuffer!==!1){var R=e["default"].createCanvas(y,P);R?_this19.filterBuffer=R.getContext("2d"):_this19.filterBuffer=!1;}p&&p!==E&&(Object(n.applyFilter)(_this19.filterBuffer,p),c.drawImage(_this19.filterBuffer.canvas,0,0,y,P),_this19.filterBuffer.clearRect(0,0,y,P),p=null),E&&_this19.filterBuffer?(_this19.filterBuffer.save(),(_this19$filterBuffer=_this19.filterBuffer).transform.apply(_this19$filterBuffer,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(v,_this19.filterBuffer,!1,f,g,u,m),_this19.filterBuffer.restore(),x===T-1?(Object(n.applyFilter)(_this19.filterBuffer,E),c.drawImage(_this19.filterBuffer.canvas,0,0,y,P),_this19.filterBuffer.clearRect(0,0,y,P)):p=E):(c.save(),c.transform.apply(c,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(v,c,!1,f,g,u,m),c.restore()),d&&v.afterRender&&v.afterRender(c,v);});}},{key:"setTransform",value:function setTransform(s){this[i]=s;}}]);}();},/* 21 */ /***/function(h,r,t){t.r(r),function(e){var n=t(14),i=t(23),a=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function s(y,P){var T=y.style,v=y.variant,x=y.weight,f=y.stretch,g=y.size,u=y.pxLineHeight,m=y.family;return f==="normal"?"".concat(T," ").concat(v," ").concat(x," ").concat(g*P,"px/").concat(u*P,"px ").concat(m):"".concat(T," ").concat(v," ").concat(x," ").concat(f," ").concat(g*P,"px/").concat(u*P,"px ").concat(m);}function l(y,_ref31){var P=_ref31.font,T=_ref31.fillColor,v=_ref31.strokeColor,x=_ref31.strokeWidth,_ref31$ratio=_ref31.ratio,f=_ref31$ratio===void 0?1:_ref31$ratio,g=_ref31.textCanvas,_ref31$cachable=_ref31.cachable,u=_ref31$cachable===void 0?!1:_ref31$cachable;var m;if(u){m=[y,P,String(T),String(v),String(x)].join("###");var z=o[m];if(z)return z;}g||(g=c(1,1));var M=g.getContext("2d");M.save(),M.font=P;var _M$measureText=M.measureText(y),E=_M$measureText.width;M.restore();var R=Object(i["default"])(P),b=Math.max(R.pxLineHeight,R.pxHeight*1.13);/italic|oblique/.test(P)&&(E+=b*Math.tan(15*Math.PI/180)),!T&&!v&&(T="#000");var O=M.canvas,L=Math.ceil(E),w=Math.ceil(b);O.width=Math.round(L*f),O.height=Math.round(w*f),M.save(),M.font=s(R,f),M.textAlign="center",M.textBaseline="middle";var I=O.height*0.5+R.pxHeight*0.05*f,A=O.width*0.5;if(T){if(Array.isArray(T))T=Object(a["default"])(T);else if(T.vector){var _z;var _T=T,K=_T.vector,k=_T.colors;K.length===6?_z=M.createRadialGradient.apply(M,_toConsumableArray(K)):_z=M.createLinearGradient.apply(M,_toConsumableArray(K)),k.forEach(function(_ref32){var q=_ref32.offset,U=_ref32.color;_z.addColorStop(q,U);}),T=_z;}M.fillStyle=T,M.fillText(y,A,I);}if(v){if(M.lineWidth=x*f,Array.isArray(v))v=Object(a["default"])(v);else if(v.vector){var _z2;var _v=v,_K=_v.vector,_k=_v.colors;_K.length===6?_z2=M.createRadialGradient.apply(M,_toConsumableArray(_K)):_z2=M.createLinearGradient.apply(M,_toConsumableArray(_K)),_k.forEach(function(_ref33){var q=_ref33.offset,U=_ref33.color;_z2.addColorStop(q,U);}),v=_z2;}M.strokeStyle=v,M.strokeText(y,A,I);}M.restore();var W={image:g,rect:[0,0,L,w]};return u&&(o[m]=W),W;}var d=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var y=navigator.userAgent.toLowerCase().match(/chrome\\/(\\d+)/);y&&(d=Number(y[1])<70);}function c(y,P){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var v=T.offscreen||!d&&T.offscreen!==!1;var x;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?x=e.createCanvas(y,P,T):v&&typeof OffscreenCanvas=="function"?x=new OffscreenCanvas(y,P):(x=document.createElement("canvas"),x.width=y,x.height=P),x;}var p={createCanvas:c,createText:l,loadImage:n["default"].loadImage};r["default"]=p;}.call(this,t(22));},/* 22 */ /***/function(h,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused2){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}h.exports=t;},/* 23 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return T;}),t(1).glMatrix.setMatrixArrayType(Array);function e(v,x){if(typeof v=="string"){var u=v.trim().match(/^([\\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);u?v={size:parseFloat(u[1]),unit:u[2]}:v={size:parseInt(v,10),unit:"px"};}var _v2=v,f=_v2.size,g=_v2.unit;if(g==="pt")f/=0.75;else if(g==="pc")f*=16;else if(g==="in")f*=96;else if(g==="cm")f*=96/2.54;else if(g==="mm")f*=96/25.4;else if(g==="em"||g==="rem"||g==="ex"){if(!x&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;x=e(_u3,16);}f*=x,g==="ex"&&(f/=2);}else if(g==="q")f*=96/25.4/4;else if(g==="vw"||g==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u4=g==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;f*=_u4/100;}}else if((g==="vmax"||g==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u5=document.documentElement.clientWidth,m=document.documentElement.clientHeight;g==="vmax"?f*=Math.max(_u5,m)/100:f*=Math.min(_u5,m)/100;}return f;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",s="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",l="\'([^\']+)\'|\\"([^\\"]+)\\"|([\\\\w-]|[\\u4E00-\\u9FA5])+",d=new RegExp("(".concat(n,") +"),"i"),c=new RegExp("(".concat(i,") +"),"i"),p=new RegExp("(".concat(a,") +"),"i"),y=new RegExp("(".concat(o,") +"),"i"),P=new RegExp("([\\\\d\\\\.]+)("+s+")(?:\\\\/([\\\\d\\\\.]+)("+s+"))? *((?:"+l+")( *, *(?:"+l+"))*)");function T(v,x){var f=P.exec(v);if(!f)return;var g=parseFloat(f[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(f[1]),unit:f[2],lineHeight:Number.isFinite(g)?g:void 0,lineHeightUnit:f[4],family:f[5].replace(/ *, */g,",")},m=v.substring(0,f.index),M=d.exec(m),E=c.exec(m),R=p.exec(m),b=y.exec(m);return M&&(u.weight=M[1]),E&&(u.style=E[1]),R&&(u.variant=R[1]),b&&(u.stretch=b[1]),u.pxHeight=e({size:u.size,unit:u.unit},x),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},x),u;}},/* 24 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 */ /***/function(h,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),t.d(r,"drawMesh2D",function(){return l;});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(d,c){var p=d.canvas;d.save(),d.filter=c,d.drawImage(p,0,0,p.width,p.height),d.restore();}function s(d,c){var p=/rgba\\((\\d+),(\\d+),(\\d+),(\\d+)\\)/;d=d.match(p).slice(1,5).map(Number),c=c.match(p).slice(1,5).map(Number);var y=[],P=c[3];for(var T=0;T<4;T++)y[T]=Object(a.mix)(d[T],c[T],P);return"rgba(".concat(y.join(),")");}function l(d,c){var p=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var y=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var P=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var T=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var v=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;c.save();var x=!1,f=!1;if(c.globalAlpha=d.getOpacity(),d._updateMatrix&&d.transformScale/d.contours.scale>1.5&&d.accurate(d.transformScale),d.lineWidth){var m=d.gradient&&d.gradient.stroke;if(m){var _m=m,M=_m.vector,E=_m.colors;if(M.length===6)m=c.createRadialGradient.apply(c,_toConsumableArray(M));else if(M.length===4)m=c.createLinearGradient.apply(c,_toConsumableArray(M));else if(M.length===3)m=c.createCircularGradient.apply(c,_toConsumableArray(M));else throw new TypeError("Invalid vector dimension.");E.forEach(function(_ref34){var R=_ref34.offset,b=_ref34.color;var O=Object(n["default"])(b);P&&(O=s(O,P)),m.addColorStop(R,O);}),c.strokeStyle=m,x=!0;}else d.strokeStyle&&(P?c.strokeStyle=s(d.strokeStyle,P):c.strokeStyle=d.strokeStyle,x=!0);}x&&(c.lineWidth=d.lineWidth,c.lineJoin=d.lineJoin,c.lineCap=d.lineCap,c.miterLimit=d.miterLimit,d.lineDash&&(c.setLineDash(d.lineDash),d.lineDashOffset&&(c.lineDashOffset=d.lineDashOffset)));var g=d.gradient&&d.gradient.fill;if(g){var _g2=g,_m2=_g2.vector,_M2=_g2.colors;if(_m2.length===6)g=c.createRadialGradient.apply(c,_toConsumableArray(_m2));else if(_m2.length===4)g=c.createLinearGradient.apply(c,_toConsumableArray(_m2));else if(_m2.length===3)g=c.createCircularGradient.apply(c,_toConsumableArray(_m2));else throw new TypeError("Invalid vector dimension.");_M2.forEach(function(_ref35){var E=_ref35.offset,R=_ref35.color;var b=Object(n["default"])(R);P&&(b=s(b,P)),g.addColorStop(E,b);}),c.fillStyle=g,f=!0;}else d.fillStyle&&(y?c.fillStyle=s(d.fillStyle,y):c.fillStyle=d.fillStyle,f=!0);if(v&&c.transform.apply(c,_toConsumableArray(v)),c.transform.apply(c,_toConsumableArray(d.transformMatrix)),d.clipPath){var _m3=d.clipPath,_M3=new Path2D(_m3);c.clip(_M3);}var u=d.contours.length;if(d.contours.forEach(function(m,M){var E=m.length,R=E>1&&e.vec2.equals(m[0],m[E-1]),b=M===u-1&&d.texture;if(m&&E>0){if(f||x||b){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(m[0]));for(var O=1;Os&&(_ref36=[s,o],o=_ref36[0],s=_ref36[1],_ref36),as?s:a;}function n(a,o,s){return a*(1-s)+o*s;}function i(a,o){var _a2=_slicedToArray(a,2),s=_a2[0],l=_a2[1];return[s*o[0]+l*o[2]+o[4],s*o[1]+l*o[3]+o[5]];}},/* 27 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(l,d,c){var p=l.uniforms||{},y=d.uniforms||{};if(p.u_texSampler&&y.u_texSampler&&p.u_texSampler!==y.u_texSampler)return!1;var P=Object.keys(p),T=Object.keys(y),v=P.indexOf("u_texSampler"),x=T.indexOf("u_texSampler");if(v>=0&&P.splice(v,1),x>=0&&T.splice(x,1),P.length!==T.length)return!1;var f=P.every(function(g){var u=p[g],m=y[g];if(u===m)return!0;if(u.length&&m.length&&u.length===m.length){for(var M=0;M2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(){var p,y,P,T,v,_x22,_f6,u,g,_u6,m;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:p=[],y=l.options.bufferSize;P=0,T=!1;v=0;case 3:if(!(vy)){_context17.next=31;break;}_context17.t1=p.length;if(!_context17.t1){_context17.next=27;break;}_context17.next=27;return o(p,T);case 27:P=0;T=!1;_context17.next=39;break;case 31:if(!P){_context17.next=39;break;}m=p[p.length-1];_context17.t2=m&&(m.filterCanvas||m.afterRender||_x22.beforeRender||m.pass.length||_x22.pass.length||m.program!==_x22.program||!i(m,_x22,p));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(p,T);case 37:P=0;T=!1;case 39:p.push(_x22),T=T||_x22.enableBlend,P+=g;case 40:_context17.t3=v===d.length-1&&p.length;if(!_context17.t3){_context17.next=44;break;}_context17.next=44;return o(p,T);case 44:v++;_context17.next=3;break;case 47:case"end":return _context17.stop();}},_callee17);})();}},/* 28 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var e={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(a,o){var s=0,l=0,d=0,c=0,p=0,y=0,P=0;var T=a[0].program;for(var v=0;v0&&(u.a_sourceRect=p);var m={positions:s,cells:l,attributes:u,uniforms:v,cellsCount:T*3,program:x};return d&&d.length&&(m.textureCoord=d),g&&y.length>0&&(u.a_clipUV=y),m;}},/* 29 */ /***/function(h,r,t){t.r(r);var e=t(1),n=t(30),i=t(26),a=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(u,m){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(u);m&&(E=E.filter(function(R){return Object.getOwnPropertyDescriptor(u,R).enumerable;})),M.push.apply(M,E);}return M;}function s(u){for(var m=1;m1&&arguments[1]!==undefined?arguments[1]:null;var M=new Float32Array(3*u),E=new Float32Array(3*u),R=new Float32Array(4*u),b=new Float32Array(4*u),O=new Float32Array(4*u),L=new Float32Array(4*u),w=new Float32Array(4*u),I=new Uint8Array(u),A=new Uint8Array(4*u),W=new Uint8Array(4*u);return m&&(M.set(m.transform0,0),E.set(m.transform1,0),R.set(m.color0,0),b.set(m.color1,0),O.set(m.color2,0),L.set(m.color3,0),w.set(m.color4,0),I.set(m.frameIndex,0),A.set(m.fillColor,0),W.set(m.strokeColor,0)),{bufferSize:u,transform0:M,transform1:E,color0:R,color1:b,color2:O,color3:L,color4:w,frameIndex:I,fillColor:A,strokeColor:W};}r["default"]=/*#__PURE__*/function(){function _class(u){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref37=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref37$buffer=_ref37.buffer,M=_ref37$buffer===void 0?1e3:_ref37$buffer;_classCallCheck(this,_class);M=Math.max(M,m),this[c]=m,this[d]=u,this[f]=g(M),this[P]=[],this[y]=[],this[v]=!1,this[x]=!1,this[p]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var m=this[c];for(var M=u;M=this[c]||u<0)throw new Error("Out of range.");var _this$f2=this[f],m=_this$f2.transform0,M=_this$f2.transform1,E=_this$f2.color0,R=_this$f2.color1,b=_this$f2.color2,O=_this$f2.color3,L=_this$f2.color4,w=_this$f2.frameIndex,I=_this$f2.fillColor,A=_this$f2.strokeColor;m.set(m.subarray(3*(u+1)),3*u),M.set(M.subarray(3*(u+1)),3*u),E.set(E.subarray(4*(u+1)),4*u),R.set(R.subarray(4*(u+1)),4*u),b.set(b.subarray(4*(u+1)),4*u),O.set(O.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),w.set(w.subarray(u+1),u),I.set(I.subarray(4*(u+1)),4*u),A.set(A.subarray(4*(u+1)),4*u);for(var W in this[y])W===u?delete this[y][W]:W>u&&(this[y][W-1]=this[y][W],delete this[y][W]);this[c]--;}},{key:"setColorTransform",value:function setColorTransform(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$f3=this[f],M=_this$f3.color0,E=_this$f3.color1,R=_this$f3.color2,b=_this$f3.color3,O=_this$f3.color4;return m!=null?(M.set([m[0],m[5],m[10],m[15]],u),E.set([m[1],m[6],m[11],m[16]],u),R.set([m[2],m[7],m[12],m[17]],u),b.set([m[3],m[8],m[13],m[18]],u),O.set([m[4],m[9],m[14],m[19]],u),this[p]=this[p]||m[18]<1,this[x]=!0):(M.set([1,0,0,0],u),E.set([0,1,0,0],u),R.set([0,0,1,0],u),b.set([0,0,0,1],u),O.set([0,0,0,0],u)),this;}},{key:"getColorTransform",value:function getColorTransform(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$f4=this[f],m=_this$f4.color0,M=_this$f4.color1,E=_this$f4.color2,R=_this$f4.color3,b=_this$f4.color4;return[m[u],M[u],E[u],R[u],b[u],m[u+1],M[u+1],E[u+1],R[u+1],b[u+1],m[u+2],M[u+2],E[u+2],R[u+2],b[u+2],m[u+3],M[u+3],E[u+3],R[u+3],b[u+3]];}},{key:"transformColor",value:function transformColor(u,m){var M=this.getColorTransform(u);return M=Object(n.multiply)(M,m),this.setColorTransform(u,M),this;}},{key:"setFillColor",value:function setFillColor(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof m=="string"&&(m=Object(a["default"])(m)),m[3]>0&&(this[v]=!0),this[f].fillColor.set(m.map(function(M){return Math.round(255*M);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof m=="string"&&(m=Object(a["default"])(m)),m[3]>0&&(this[v]=!0),this[f].strokeColor.set(m.map(function(M){return Math.round(255*M);}),4*u);}},{key:"getCloudRGBA",value:function getCloudRGBA(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$f5=this[f],m=_this$f5.fillColor,M=_this$f5.strokeColor,E=[m[u],m[u+1],m[u+2],m[u+3]],R=[M[u],M[u+1],M[u+2],M[u+3]];return E[3]/=255,R[3]/=255,{fill:"rgba(".concat(E.join(),")"),stroke:"rgba(".concat(R.join(),")")};}},{key:"grayscale",value:function grayscale(u,m){this.transformColor(u,Object(n.grayscale)(m)),this._getFilter(u).push("grayscale(".concat(100*m,"%)"));}},{key:"brightness",value:function brightness(u,m){this.transformColor(u,Object(n.brightness)(m)),this._getFilter(u).push("brightness(".concat(100*m,"%)"));}},{key:"saturate",value:function saturate(u,m){this.transformColor(u,Object(n.saturate)(m)),this._getFilter(u).push("saturate(".concat(100*m,"%)"));}},{key:"contrast",value:function contrast(u,m){this.transformColor(u,Object(n.contrast)(m)),this._getFilter(u).push("contrast(".concat(100*m,"%)"));}},{key:"invert",value:function invert(u,m){this.transformColor(u,Object(n.invert)(m)),this._getFilter(u).push("invert(".concat(100*m,"%)"));}},{key:"sepia",value:function sepia(u,m){this.transformColor(u,Object(n.sepia)(m)),this._getFilter(u).push("sepia(".concat(100*m,"%)"));}},{key:"opacity",value:function opacity(u,m){this.transformColor(u,Object(n.opacity)(m)),this._getFilter(u).push("opacity(".concat(100*m,"%)"));}},{key:"hueRotate",value:function hueRotate(u,m){this.transformColor(u,Object(n.hueRotate)(m)),this._getFilter(u).push("hue-rotate(".concat(m,"deg)"));}},{key:"setTransform",value:function setTransform(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=3,m==null&&(m=[1,0,0,1,0,0]);var _this$f6=this[f],M=_this$f6.transform0,E=_this$f6.transform1;return M.set([m[0],m[2],m[4]],u),E.set([m[1],m[3],m[5]],u),this;}},{key:"getTransform",value:function getTransform(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=3;var _this$f7=this[f],m=_this$f7.transform0,M=_this$f7.transform1;return[m[u],M[u],m[u+1],M[u+1],m[u+2],M[u+2]];}},{key:"getTextureFrame",value:function getTextureFrame(u){return this[P][this[f].frameIndex[u]];}},{key:"setTextureFrames",value:function setTextureFrames(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[d].setTexture(u[0],m),this[P]=u,this[T]=m;}},{key:"setFrameIndex",value:function setFrameIndex(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");var M=this[P].length;if(M<=0)throw new Error("No frames");this[f].frameIndex[u]=m%M;}},{key:"amount",get:function get(){return this[c];},set:function set(u){var m=this[c];u!==m&&(u>this[f].bufferSize&&(this[f]=g(Math.max(u,this[f].bufferSize+1e3),this[f])),this[c]=u,u>m&&this.initBuffer(m));}},{key:"meshData",get:function get(){var _this$d$meshData=this[d].meshData,u=_this$d$meshData.attributes,m=_this$d$meshData.cells,M=_this$d$meshData.positions,E=_this$d$meshData.textureCoord,R=_this$d$meshData.uniforms,b=this[P],O={attributes:s({},u),cells:m,positions:M,textureCoord:E,uniforms:s({},R),instanceCount:this[c],enableBlend:this.enableBlend};b.length&&b.forEach(function(G,Z){O.uniforms["u_texFrame".concat(Z)]=G;});var _this$f8=this[f],L=_this$f8.transform0,w=_this$f8.transform1,I=_this$f8.color0,A=_this$f8.color1,W=_this$f8.color2,z=_this$f8.color3,K=_this$f8.color4,k=_this$f8.fillColor,q=_this$f8.strokeColor,U=_this$f8.frameIndex;return this[d].uniforms.u_texSampler&&(O.attributes.a_frameIndex={data:U,divisor:1}),O.attributes.a_transform0={data:L,divisor:1},O.attributes.a_transform1={data:w,divisor:1},O.attributes.a_colorCloud0={data:I,divisor:1},O.attributes.a_colorCloud1={data:A,divisor:1},O.attributes.a_colorCloud2={data:W,divisor:1},O.attributes.a_colorCloud3={data:z,divisor:1},O.attributes.a_colorCloud4={data:K,divisor:1},this.hasCloudColor&&(O.attributes.a_fillCloudColor={data:k,divisor:1},O.attributes.a_strokeCloudColor={data:q,divisor:1}),O;}},{key:"setProgram",value:function setProgram(u){this[d].setProgram(u);}},{key:"program",get:function get(){return this[d].program;}},{key:"transform",value:function transform(u,m){var M=this.getTransform(u);return m=e.mat2d.multiply(Array.of(0,0,0,0,0,0),M,m),this.setTransform(u,m),this;}},{key:"translate",value:function translate(u,_ref38){var _ref39=_slicedToArray(_ref38,2),m=_ref39[0],M=_ref39[1];var E=e.mat2d.create();return E=e.mat2d.translate(Array.of(0,0,0,0,0,0),E,[m,M]),this.transform(u,E);}},{key:"rotate",value:function rotate(u,m){var _ref40=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref41=_slicedToArray(_ref40,2),M=_ref41[0],E=_ref41[1];var R=e.mat2d.create();return R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[M,E]),R=e.mat2d.rotate(Array.of(0,0,0,0,0,0),R,m),R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[-M,-E]),this.transform(u,R);}},{key:"scale",value:function scale(u,_ref42){var _ref43=_slicedToArray(_ref42,2),m=_ref43[0],_ref43$=_ref43[1],M=_ref43$===void 0?m:_ref43$;var _ref44=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref45=_slicedToArray(_ref44,2),E=_ref45[0],R=_ref45[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[E,R]),b=e.mat2d.scale(Array.of(0,0,0,0,0,0),b,[m,M]),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-E,-R]),this.transform(u,b);}},{key:"skew",value:function skew(u,_ref46){var _ref47=_slicedToArray(_ref46,2),m=_ref47[0],_ref47$=_ref47[1],M=_ref47$===void 0?m:_ref47$;var _ref48=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref49=_slicedToArray(_ref48,2),E=_ref49[0],R=_ref49[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[E,R]),b=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,e.mat2d.fromValues(1,Math.tan(M),Math.tan(m),1,0,0)),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-E,-R]),this.transform(u,b);}},{key:"isPointCollision",value:function isPointCollision(u,_ref50){var _this$d;var _ref51=_slicedToArray(_ref50,2),m=_ref51[0],M=_ref51[1];var E=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var R=this.getTransform(u),b=Object(i.transformPoint)([m,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),R));return(_this$d=this[d]).isPointCollision.apply(_this$d,_toConsumableArray(b).concat([E]));}},{key:"isPointInFill",value:function isPointInFill(u,_ref52){var _ref53=_slicedToArray(_ref52,2),m=_ref53[0],M=_ref53[1];return this.isPointCollision(u,[m,M],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(u,_ref54){var _ref55=_slicedToArray(_ref54,2),m=_ref55[0],M=_ref55[1];return this.isPointCollision(u,[m,M],"stroke");}}]);}();},/* 30 */ /***/function(h,r,t){t.r(r),t.d(r,"multiply",function(){return n;}),t.d(r,"grayscale",function(){return i;}),t.d(r,"brightness",function(){return a;}),t.d(r,"saturate",function(){return o;}),t.d(r,"contrast",function(){return s;}),t.d(r,"invert",function(){return l;}),t.d(r,"sepia",function(){return d;}),t.d(r,"opacity",function(){return c;}),t.d(r,"hueRotate",function(){return p;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(y,P){var T=[],v=y[0],x=y[1],f=y[2],g=y[3],u=y[4],m=y[5],M=y[6],E=y[7],R=y[8],b=y[9],O=y[10],L=y[11],w=y[12],I=y[13],A=y[14],W=y[15],z=y[16],K=y[17],k=y[18],q=y[19];var U=P[0],G=P[1],Z=P[2],nt=P[3],rt=P[4];return T[0]=U*v+G*m+Z*O+nt*W,T[1]=U*x+G*M+Z*L+nt*z,T[2]=U*f+G*E+Z*w+nt*K,T[3]=U*g+G*R+Z*I+nt*k,T[4]=U*u+G*b+Z*A+nt*q+rt,U=P[5],G=P[6],Z=P[7],nt=P[8],rt=P[9],T[5]=U*v+G*m+Z*O+nt*W,T[6]=U*x+G*M+Z*L+nt*z,T[7]=U*f+G*E+Z*w+nt*K,T[8]=U*g+G*R+Z*I+nt*k,T[9]=U*u+G*b+Z*A+nt*q+rt,U=P[10],G=P[11],Z=P[12],nt=P[13],rt=P[14],T[10]=U*v+G*m+Z*O+nt*W,T[11]=U*x+G*M+Z*L+nt*z,T[12]=U*f+G*E+Z*w+nt*K,T[13]=U*g+G*R+Z*I+nt*k,T[14]=U*u+G*b+Z*A+nt*q+rt,U=P[15],G=P[16],Z=P[17],nt=P[18],rt=P[19],T[15]=U*v+G*m+Z*O+nt*W,T[16]=U*x+G*M+Z*L+nt*z,T[17]=U*f+G*E+Z*w+nt*K,T[18]=U*g+G*R+Z*I+nt*k,T[19]=U*u+G*b+Z*A+nt*q+rt,T;}function i(y){y=Object(e.clamp)(0,1,y);var P=0.2126*y,T=0.7152*y,v=0.0722*y;return[P+1-y,T,v,0,0,P,T+1-y,v,0,0,P,T,v+1-y,0,0,0,0,0,1,0];}function a(y){return[y,0,0,0,0,0,y,0,0,0,0,0,y,0,0,0,0,0,1,0];}function o(y){var P=0.2126*(1-y),T=0.7152*(1-y),v=0.0722*(1-y);return[P+y,T,v,0,0,P,T+y,v,0,0,P,T,v+y,0,0,0,0,0,1,0];}function s(y){var P=0.5*(1-y);return[y,0,0,0,P,0,y,0,0,P,0,0,y,0,P,0,0,0,1,0];}function l(y){var P=1-2*y;return[P,0,0,0,y,0,P,0,0,y,0,0,P,0,y,0,0,0,1,0];}function d(y){return[1-0.607*y,0.769*y,0.189*y,0,0,0.349*y,1-0.314*y,0.168*y,0,0,0.272*y,0.534*y,1-0.869*y,0,0,0,0,0,1,0];}function c(y){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,y,0];}function p(y){var P=y/180*Math.PI,T=Math.cos(P),v=Math.sin(P),x=0.2126,f=0.7152,g=0.0722;return[x+T*(1-x)+v*-x,f+T*-f+v*-f,g+T*-g+v*(1-g),0,0,x+T*-x+v*0.143,f+T*(1-f)+v*0.14,g+T*-g+v*-0.283,0,0,x+T*-x+v*-(1-x),f+T*-f+v*f,g+T*(1-g)+v*g,0,0,0,0,0,1,0];}},/* 31 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);function i(a){var o=n()(a);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 */ /***/function(h,r,t){var e=t(33),n=t(37),i=t(39);h.exports=function(o){var s,l=e(o);return l.space?(s=Array(3),s[0]=i(l.values[0],0,255),s[1]=i(l.values[1],0,255),s[2]=i(l.values[2],0,255),l.space[0]==="h"&&(s=n.rgb(s)),s.push(i(l.alpha,0,1)),s):[];};},/* 33 */ /***/function(h,r,t){(function(e){var n=t(34),i=t(35),a=t(36);h.exports=s;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function s(l){var d,c=[],p=1,y;if(typeof l=="string"){if(n[l])c=n[l].slice(),y="rgb";else if(l==="transparent")p=0,y="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(l)){var P=l.slice(1),T=P.length,v=T<=4;p=1,v?(c=[parseInt(P[0]+P[0],16),parseInt(P[1]+P[1],16),parseInt(P[2]+P[2],16)],T===4&&(p=parseInt(P[3]+P[3],16)/255)):(c=[parseInt(P[0]+P[1],16),parseInt(P[2]+P[3],16),parseInt(P[4]+P[5],16)],T===8&&(p=parseInt(P[6]+P[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),y="rgb";}else if(d=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(l)){var x=d[1],f=x==="rgb",P=x.replace(/a$/,"");y=P;var T=P==="cmyk"?4:P==="gray"?1:3;c=d[2].trim().split(/\\s*,\\s*/).map(function(M,E){if(/%$/.test(M))return E===T?parseFloat(M)/100:P==="rgb"?parseFloat(M)*255/100:parseFloat(M);if(P[E]==="h"){if(/deg$/.test(M))return parseFloat(M);if(o[M]!==void 0)return o[M];}return parseFloat(M);}),x===P&&c.push(1),p=f||c[T]===void 0?1:c[T],c=c.slice(0,T);}else l.length>10&&/[0-9](?:\\s|\\/)/.test(l)&&(c=l.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),y=l.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(l))y="rgb",c=[l>>>16,(l&65280)>>>8,l&255];else if(i(l)){var g=a(l.r,l.red,l.R,null);g!==null?(y="rgb",c=[g,a(l.g,l.green,l.G),a(l.b,l.blue,l.B)]):(y="hsl",c=[a(l.h,l.hue,l.H),a(l.s,l.saturation,l.S),a(l.l,l.lightness,l.L,l.b,l.brightness)]),p=a(l.a,l.alpha,l.opacity,1),l.opacity!=null&&(p/=100);}else(Array.isArray(l)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(l))&&(c=[l[0],l[1],l[2]],y="rgb",p=l.length===4?l[3]:1);return{space:y,values:c,alpha:p};}}).call(this,t(22));},/* 34 */ /***/function(h,r,t){h.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};},/* 35 */ /***/function(h,r,t){var e=Object.prototype.toString;h.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 */ /***/function(h,r){h.exports=function(){for(var t=0;t1&&d--,6*d<1?p=s+(l-s)*6*d:2*d<1?p=l:3*d<2?p=s+(l-s)*(2/3-d)*6:p=s,c[y]=p*255;return c;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,o=n[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),d=l-s,c,p,y;return l===s?c=0:i===l?c=(a-o)/d:a===l?c=2+(o-i)/d:o===l&&(c=4+(i-a)/d),c=Math.min(c*60,360),c<0&&(c+=360),y=(s+l)/2,l===s?p=0:y<=0.5?p=d/(l+s):p=d/(2-l-s),[c,p*100,y*100];};},/* 38 */ /***/function(h,r,t){h.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 */ /***/function(h,r){h.exports=t;function t(e,n,i){return ni?i:e:en?n:e;}},/* 40 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return g;});var e=t(41),n=/* @__PURE__ */t.n(e),i=t(42),a=/* @__PURE__ */t.n(i),o=t(43),s=/* @__PURE__ */t.n(o),l=t(44),d=t(46),c=/* @__PURE__ */t.n(d),p=t(53),y=t(55);t(1).glMatrix.setMatrixArrayType(Array);var P=Symbol("contours"),T=Symbol("path"),v=Symbol("simplify"),x=Symbol("scale"),f=2*Math.PI;var g=/*#__PURE__*/function(){function g(){var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,g);typeof m=="string"&&(m={path:m}),m.path?this[T]=n()(m.path):this[T]=[],this[P]=null,this[v]=m.simplify!=null?m.simplify:0,this[x]=m.scale!=null?m.scale:2;}return _createClass(g,[{key:"contours",get:function get(){var m=null;if(!this[P]&&this[T]){var M=Object(l["default"])(s()(this[T]));this[P]=c()(M,this[x],this[v]),this[P].path=M,this[P].simplify=this[v],this[P].scale=this[x];}return this[P]&&(m=this[P].map(function(M){return _toConsumableArray(M);}),m.path=this[P].path,m.simplify=this[P].simplify,m.scale=this[P].scale),m;}},{key:"path",get:function get(){return this[T];}},{key:"simplify",get:function get(){return this[v];}},{key:"boundingBox",get:function get(){var m=this.contours;if(m&&m.length){var M=m.reduce(function(E,R){return[].concat(_toConsumableArray(E),_toConsumableArray(R));});return a()(M);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var m=this.boundingBox;return m?[0.5*(m[0][0]+m[1][0]),0.5*(m[0][1]+m[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$T;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var E=Object(l["default"])(s()(this[T])).map(function(_ref56){var _ref57=_toArray(_ref56),R=_ref57[0],b=_ref57.slice(1);var O=[R];for(var L=0;L7&&arguments[7]!==undefined?arguments[7]:0;if(O+=b,L+=b,E<=0||R<=0||L===O)return;Lf&&(L=O+f);var I=L-O;I>=f&&(L-=1e-3);var A=this[T].length>0&&IMath.PI?1:0;w&&(k=1-k),A+=W.join(" "),A+="A".concat(E," ").concat(R," 0 ").concat(k," ").concat(K," ").concat(z.join(" ")),I>=f&&(A+="Z"),this.addPath(A);}},{key:"arc",value:function arc(m,M,E,R,b){var O=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(m,M,E,E,0,R,b,O);}},{key:"arcTo",value:function arcTo(m,M,E,R,b,O,L){this[P]=null,this[T].push(["A",m,M,E,R,b,O,L]);}},{key:"moveTo",value:function moveTo(m,M){this[P]=null,this[T].push(["M",m,M]);}},{key:"lineTo",value:function lineTo(m,M){this[P]=null,this[T].push(["L",m,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(m,M,E,R,b,O){this[P]=null,this[T].push(["C",m,M,E,R,b,O]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(m,M,E,R){this[P]=null,this[T].push(["Q",m,M,E,R]);}},{key:"rect",value:function rect(m,M,E,R){var b="M".concat(m," ").concat(M,"L").concat(m+E," ").concat(M,"L").concat(m+E," ").concat(M+R,"L").concat(m," ").concat(M+R,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[P]=null;var m=[];var M=this[T].length;M>0&&(m=this[T][M-1]),m[0]!=="Z"&&m[0]!=="z"&&this[T].push(["Z"]);}}]);}();},/* 41 */ /***/function(h,r){h.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(o){var s=[];return o.replace(e,function(l,d,c){var p=d.toLowerCase();for(c=a(c),p=="m"&&c.length>2&&(s.push([d].concat(c.splice(0,2))),p="l",d=d=="m"?"l":"L");;){if(c.length==t[p])return c.unshift(d),s.push(c);if(c.length4?(d=u[u.length-4],c=u[u.length-3]):(d=v,c=x),l.push(u);}return l;}function i(o,s,l,d){return["C",o,s,l,d,l,d];}function a(o,s,l,d,c,p){return["C",o/3+2/3*l,s/3+2/3*d,c/3+2/3*l,p/3+2/3*d,c,p];}},/* 45 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(s,l,d,c){var p=s*c-l*d<0?-1:1;var y=s*d+l*c;return y>1&&(y=1),y<-1&&(y=-1),p*Math.acos(y);}function i(s,l,d,c,p,y,P,T,v,x){var f=x*(s-d)/2+v*(l-c)/2,g=-v*(s-d)/2+x*(l-c)/2,u=P*P,m=T*T,M=f*f,E=g*g;var R=u*m-u*E-m*M;R<0&&(R=0),R/=u*E+m*M,R=Math.sqrt(R)*(p===y?-1:1);var b=R*P/T*g,O=R*-T/P*f,L=x*b-v*O+(s+d)/2,w=v*b+x*O+(l+c)/2,I=(f-b)/P,A=(g-O)/T,W=(-f-b)/P,z=(-g-O)/T,K=n(1,0,I,A);var k=n(I,A,W,z);return y===0&&k>0&&(k-=e),y===1&&k<0&&(k+=e),[L,w,K,k];}function a(s,l){var d=1.3333333333333333*Math.tan(l/4),c=Math.cos(s),p=Math.sin(s),y=Math.cos(s+l),P=Math.sin(s+l);return[c,p,c-p*d,p+c*d,y+P*d,P-y*d,y,P];}function o(s,l,d,c,p,y,P,T,v){var x=Math.sin(v*e/360),f=Math.cos(v*e/360),g=f*(s-d)/2+x*(l-c)/2,u=-x*(s-d)/2+f*(l-c)/2;if(g===0&&u===0)return[];if(P===0||T===0)return[];P=Math.abs(P),T=Math.abs(T);var m=g*g/(P*P)+u*u/(T*T);m>1&&(P*=Math.sqrt(m),T*=Math.sqrt(m));var M=i(s,l,d,c,p,y,P,T,x,f),E=[];var R=M[2],b=M[3];var O=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=O;for(var L=0;L0&&(T.push(v),v=[]);else if(f[0]==="C")d(v,y,x,f),a(x,f[5],f[6]);else throw new Error("illegal type in SVG: "+f[0]);}),v.length>0&&T.push(v),T.map(function(f){return i(f,P||0);});};},/* 47 */ /***/function(h,r,t){h.exports=t(48)();},/* 48 */ /***/function(h,r){function t(n){return[n[0],n[1]];}function e(n,i){return[n,i];}h.exports=function(i){i=i||{};var a=typeof i.recursion=="number"?i.recursion:8,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,s=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,l=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,d=i.angleTolerance||0,c=i.cuspLimit||0;return function(T,v,x,f,g,u){u||(u=[]),g=typeof g=="number"?g:1;var m=s/g;return m*=m,p(T,v,x,f,u,m),u;};function p(P,T,v,x,f,g){f.push(t(P));var u=P[0],m=P[1],M=T[0],E=T[1],R=v[0],b=v[1],O=x[0],L=x[1];y(u,m,M,E,R,b,O,L,f,g,0),f.push(t(x));}function y(P,T,v,x,f,g,u,m,M,E,R){if(!(R>a)){var b=Math.PI,O=(P+v)/2,L=(T+x)/2,w=(v+f)/2,I=(x+g)/2,A=(f+u)/2,W=(g+m)/2,z=(O+w)/2,K=(L+I)/2,k=(w+A)/2,q=(I+W)/2,U=(z+k)/2,G=(K+q)/2;if(R>0){var Z=u-P,nt=m-T,rt=Math.abs((v-u)*nt-(x-m)*Z),tt=Math.abs((f-u)*nt-(g-m)*Z),J,ht;if(rt>o&&tt>o){if((rt+tt)*(rt+tt)<=E*(Z*Z+nt*nt)){if(d=b&&(J=2*b-J),ht>=b&&(ht=2*b-ht),J+htc){M.push(e(v,x));return;}if(ht>c){M.push(e(f,g));return;}}}}else if(rt>o){if(rt*rt<=E*(Z*Z+nt*nt)){if(d=b&&(J=2*b-J),Jc){M.push(e(v,x));return;}}}else if(tt>o){if(tt*tt<=E*(Z*Z+nt*nt)){if(d=b&&(J=2*b-J),Jc){M.push(e(f,g));return;}}}else if(Z=U-(P+u)/2,nt=G-(T+m)/2,Z*Z+nt*nt<=E){M.push(e(U,G));return;}}y(P,T,O,L,z,K,U,G,M,E,R+1),y(U,G,k,q,A,W,u,m,M,E,R+1);}}};},/* 49 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return i;}),t.d(r,"clone",function(){return n;}),t.d(r,"copy",function(){return a;}),t.d(r,"scaleAndAdd",function(){return o;}),t.d(r,"dot",function(){return s;}),t.d(r,"rotate",function(){return l;}),t.d(r,"cross",function(){return d;}),t.d(r,"sub",function(){return c;}),t.d(r,"add",function(){return p;}),t.d(r,"computeMiter",function(){return v;}),t.d(r,"normal",function(){return x;}),t.d(r,"direction",function(){return f;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(g){return[g[0],g[1]];}function i(){return[0,0];}var a=e.vec2.copy,o=e.vec2.scaleAndAdd,s=e.vec2.dot,l=e.vec2.rotate,d=e.vec2.cross,c=e.vec2.sub,p=e.vec2.add,y=e.vec2.normalize,P=e.vec2.set,T=i();function v(g,u,m,M,E){p(g,m,M),y(g,g),P(u,-g[1],g[0]),P(T,-m[1],m[0]);var R=E/s(u,T);return Math.abs(R);}function x(g,u){return P(g,-u[1],u[0]),g;}function f(g,u,m){return c(g,u,m),y(g,g),g;}},/* 50 */ /***/function(h,r,t){var e=t(51),n=t(52);h.exports=function(a,o){return a=e(a,o),a=n(a,o),a;},h.exports.radialDistance=e,h.exports.douglasPeucker=n;},/* 51 */ /***/function(h,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a;}h.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var a=i*i,o=n[0],s=[o],l,d=1,c=n.length;da&&(s.push(l),o=l);return o!==l&&s.push(l),s;};},/* 52 */ /***/function(h,r){function t(n,i,a){var o=i[0],s=i[1],l=a[0]-o,d=a[1]-s;if(l!==0||d!==0){var c=((n[0]-o)*l+(n[1]-s)*d)/(l*l+d*d);c>1?(o=a[0],s=a[1]):c>0&&(o+=l*c,s+=d*c);}return l=n[0]-o,d=n[1]-s,l*l+d*d;}function e(n,i,a,o,s){for(var l=o,d,c=i+1;cl&&(d=c,l=p);}l>o&&(d-i>1&&e(n,i,d,o,s),s.push(n[d]),a-d>1&&e(n,d,a,o,s));}h.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var o=a*a,s=i.length-1,l=[i[0]];return e(i,0,s,o,l),l.push(i[s]),l;};},/* 53 */ /***/function(h,r,t){t.r(r),t.d(r,"getTotalLength",function(){return n;}),t.d(r,"getPointAtLength",function(){return a;}),t.d(r,"getDashContours",function(){return o;});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(s){if(s.totalLength!=null)return s.totalLength;var l=0;return s.forEach(function(d){var c=d[0];for(var p=1;p2&&arguments[2]!==undefined?arguments[2]:!0;if(l=Number(l),!Number.isFinite(l))throw new TypeError("Failed to execute \'getPointAtLength\' on figure: The provided float value is non-finite.");if(l<=0)throw new TypeError("Length must > 0");var c=n(s);if(l>=c){var y=s[s.length-1],P=y[y.length-2],T=y[y.length-1],v=Math.atan2(T[1]-P[1],T[0]-P[0]);return{current:s.map(function(x){return _toConsumableArray(x);}),point:{x:T[0],y:T[1],angle:v}};}var p=[];for(var _y2=0;_y20&&p[_y2].push([m.x,m.y]),!d)return{current:p,point:m};var M=[],E=_y2;for(;_y20){do d-=l[c%T],c++;while(d>0);d<0&&(p=-d,c--);}else if(d<0){c=-1;do d+=l[c%T+T-1],c--;while(d<0);d>=0&&(c++,p=l[c%T+T-1]-d);}do{var v=i(y,p);y=v.rest,++c%2&&P.push.apply(P,_toConsumableArray(v.current));var _x26=c%T;_x26<0&&(_x26+=T),p=l[_x26];}while(y);return P;}},/* 54 */ /***/function(h,r,t){t.r(r),t.d(r,"normalize",function(){return e;}),t.d(r,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(_ref58,s,l,d){var _ref59=_slicedToArray(_ref58,3),i=_ref59[0],a=_ref59[1],o=_ref59[2];return i=i*2/s-1,a=1-a*2/l,Number.isFinite(d)?(o=o*2/d-1,[i,a,o]):[i,a];}function n(_ref60,_ref61){var _ref62=_slicedToArray(_ref60,3),i=_ref62[0],a=_ref62[1],_ref62$=_ref62[2],o=_ref62$===void 0?0:_ref62$;var _ref63=_slicedToArray(_ref61,3),s=_ref63[0],l=_ref63[1],_ref63$=_ref63[2],d=_ref63$===void 0?0:_ref63$;return Math.hypot(s-i,l-a,d-o);}},/* 55 */ /***/function(h,r,t){t.r(r),t.d(r,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(i,a,o,s,l){l%=e,l<0&&(l+=e);var d=Math.tan(l);if(Math.abs(d)<1e5){var c=a-d*i,p=1/Math.pow(o,2)+Math.pow(d,2)/Math.pow(s,2);var y=-1;(l<=Math.PI/2||l>3*Math.PI/2)&&(y=1);var P=y*Math.sqrt(1/p)+i,T=d*P+c;return[P,T];}return l=0)&&Object.prototype.propertyIsEnumerable.call(X,S)&&($[S]=X[S]);}return $;}function u(X,N){if(X==null)return{};var $={},S=Object.keys(X),C,D;for(D=0;D=0)&&($[C]=X[C]);return $;}var m=Symbol("mesh"),M=Symbol("contours"),E=Symbol("stroke"),R=Symbol("fill"),b=Symbol("strokeColor"),O=Symbol("fillColor"),L=Symbol("transform"),w=Symbol("invertTransform"),I=Symbol("uniforms"),A=Symbol("texOptions"),W=Symbol("blend"),z=Symbol("applyTexture"),K=Symbol("applyTransform"),k=Symbol("applyGradientTransform"),q=Symbol("applyProgram"),U=Symbol("gradient"),G=Symbol("filter"),Z=Symbol("opacity"),nt=Symbol("program"),rt=Symbol("attributes"),tt=Symbol("pass"),J=Symbol("clipContext"),ht=Symbol("applyClipPath");function dt(X,N){var $=X[1][0]-X[0][0],S=X[1][1]-X[0][1],C=[];for(var D=0;D1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[nt]=N,this[m]&&this[q](N);}},{key:"program",get:function get(){return this[nt];}},{key:"setAttribute",value:function setAttribute(N,$){$==null?delete this[rt][N]:this[rt][N]=$;}},{key:"getOpacity",value:function getOpacity(){return this[Z];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[m]&&this[m].positions.forEach(function($){$[2]=1/$[2]>0?N:-N;}),this[Z]=N;}},{key:"setClipPath",value:function setClipPath(N){this.clipPath=N,this[I].u_clipSampler&&this[I].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[m]&&delete this[m].attributes.a_clipUV,N&&this[m]&&this[ht]();}},{key:ht,value:function value(){if(this.clipPath){this[J]||(this[J]=f["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],$=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),S=_this$boundingBox$2[0],C=_this$boundingBox$2[1];S&&C&&(this[J].width=S-N,this[J].height=C-$);var D=this[J].getContext("2d"),j=new Path2D(this.clipPath);D.clearRect(0,0,this[J].width,this[J].height),D.save(),D.translate(-N,-$),D.fillStyle="white",D.fill(j),D.restore(),this[m].clipPath=this[J];var H=dt(this.boundingBox,this[m].position0);this[m].attributes.a_clipUV=H;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(c.getPointAtLength)(this[M],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(c.getTotalLength)(this[M]);}},{key:"blend",get:function get(){return this[W]==null?"auto":this[W];},set:function set(N){this[W]=N,this[m]&&(this[m].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[m]&&this[m].boundingBox)return this[m].boundingBox;var N=this.meshData;if(N){var $=N.position0;if($.length)N.boundingBox=i()($);else return[[0,0],[0,0]];return N.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var N=this.boundingBox;return N?[0.5*(N[0][0]+N[1][0]),0.5*(N[0][1]+N[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[R]?this[R].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[E]?this[E].lineWidth:0;}},{key:"lineCap",get:function get(){return this[E]?this[E].lineCap:"";}},{key:"lineJoin",get:function get(){return this[E]?this[E].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[E]?this[E].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[b]&&this[b][3]!==0?Object(s["default"])(this[b]):"";}},{key:"lineDash",get:function get(){return this[E]?this[E].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[E]?this[E].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[O]&&this[O][3]!==0?Object(s["default"])(this[O]):"";}},{key:"gradient",get:function get(){return this[U];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].u_texSampler._img,options:this[A]}:null;}},{key:"enableBlend",get:function get(){return this[W]===!0||this[W]===!1?this[W]:this[Z]<1||this[b]!=null&&this[b][3]<1||this[O]!=null&&this[O][3]<1||this[I].u_colorMatrix!=null&&this[I].u_colorMatrix[18]<1||this[I].u_radialGradientVector!=null||this.beforeRender||this.afterRender;}},{key:"filterCanvas",get:function get(){return /blur|drop-shadow|url/.test(this.filter);}},{key:"filter",get:function get(){return this[G].join(" ");}},{key:"transformMatrix",get:function get(){return this[L];}},{key:"invertMatrix",get:function get(){if(!this[w]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[w]=N;}return this[w];}},{key:"transformScale",get:function get(){var N=this[L];return Math.max(Math.hypot(N[0],N[1]),Math.hypot(N[2],N[3]));}},{key:"uniforms",get:function get(){return this[I];}},{key:"pass",get:function get(){return this[tt];}},{key:q,value:function value(N){var $=this[rt],S=this[m].position0,C=Object.entries(N._attribute);for(var D=0;D1.5&&this.accurate(this.transformScale),!this[m]){!this[R]&&!this[E]&&this.setFill();var N=this[M],$={};if(N&&N.length){if(this[R])try{var D=y()(N,this[R]);D.positions=D.positions.map(function(j){return j.push(_this20[Z]),j;}),D.attributes={a_color:Array.from({length:D.positions.length}).map(function(){return _this20[O].map(function(j){return Math.round(255*j);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),\n},$.fill=D;}catch(_unused3){}if(this[E]){var _D=this[E].lineDash;var j=N;if(_D){var V=this[E].lineDashOffset;j=Object(c.getDashContours)(N,_D,V);}var H=j.map(function(V,Q){var it=V.length>1&&e.vec2.equals(V[0],V[V.length-1]),st=_this20[E].build(V,it);return y()([st]);});H.forEach(function(V){V.positions=V.positions.map(function(Q){return Q.push(-_this20[Z]),Q;}),V.attributes={a_color:Array.from({length:V.positions.length}).map(function(){return _this20[b].map(function(Q){return Math.round(255*Q);});})};}),$.stroke=Object(o["default"])(H);}}var S=Object(o["default"])([$.fill,$.stroke]);S.fillPointCount=$.fill?$.fill.positions.length:0,S.enableBlend=this.enableBlend,S.position0=S.positions.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),D=_ref70[0],j=_ref70[1],H=_ref70[2];return[D,j,H];}),S.uniforms=this[I],this[m]=S,this[I].u_texSampler&&this[z](S,this[A]);var C=this[L];Object(d.isUnitTransform)(C)||(this[K](S,C),this[I].u_radialGradientVector&&this[k]()),this.clipPath&&this[ht](),this[nt]&&this[q](this[nt]);}return this._updateMatrix&&(this[m].matrix=this[L],this[K](this[m],this[L]),this[I].u_radialGradientVector&&this[k]()),this[m];}},{key:K,value:function value(N,$){var S=N.positions,C=N.position0;for(var D=0;D0){if($.rotated){var at=it*Q[0]+st*Q[2]+Q[4],ot=it*Q[1]+st*Q[3]+Q[5];it=at;st=ot;}var gt=B([it,st],[V[0]/V[2],V[1]/V[3],V[2],V[3]],$);return $.repeat&&(gt[2]=1),gt;}return[-1,-1,-1];});}if(H){var _Q2=[H[0]/D,H[1]/j,H[2]/D,H[3]/j];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_Q2);});}else N.attributes.a_sourceRect=N.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(N){if(!this.contours)return;if(this.contours.path){var S=this.contours.simplify,C=F(this.contours.path,2*N,S);this[m]=null,this[M]=C;}}},{key:"canIgnore",value:function canIgnore(){var N=this[E]==null||this[E].lineWidth===0||this[b][3]===0,$=this[R]==null||this[O][3]===0,S=this[I].u_radialGradientVector==null,C=this[I].u_texSampler==null;return this[Z]===0||this[nt]==null&&N&&$&&S&&C&&!this.beforeRender&&!this.afterRender;}// join: \'miter\' or \'bevel\'\n// cap: \'butt\' or \'square\'\n// lineDash: null\n// lineDashOffset: 0\n},{key:"setStroke",value:function setStroke(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$thickness=_ref73.thickness,N=_ref73$thickness===void 0?1:_ref73$thickness,_ref73$cap=_ref73.cap,$=_ref73$cap===void 0?"butt":_ref73$cap,_ref73$join=_ref73.join,S=_ref73$join===void 0?"miter":_ref73$join,_ref73$miterLimit=_ref73.miterLimit,C=_ref73$miterLimit===void 0?10:_ref73$miterLimit,_ref73$color=_ref73.color,D=_ref73$color===void 0?[0,0,0,0]:_ref73$color,_ref73$lineDash=_ref73.lineDash,j=_ref73$lineDash===void 0?null:_ref73$lineDash,_ref73$lineDashOffset=_ref73.lineDashOffset,H=_ref73$lineDashOffset===void 0?0:_ref73$lineDashOffset,_ref73$roundSegments=_ref73.roundSegments,V=_ref73$roundSegments===void 0?20:_ref73$roundSegments;return this[m]=null,this[E]=new a["default"]({lineWidth:N,lineCap:$,lineJoin:S,miterLimit:C,roundSegments:V}),typeof D=="string"&&(D=Object(v["default"])(D)),this[b]=D,this[E].lineDash=j,this[E].lineDashOffset=H,this;}},{key:"setFill",value:function setFill(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref74$rule=_ref74.rule,N=_ref74$rule===void 0?this.fillRule:_ref74$rule,_ref74$color=_ref74.color,$=_ref74$color===void 0?[0,0,0,0]:_ref74$color;return this[m]=null,this[R]={rule:N},typeof $=="string"&&($=Object(v["default"])($)),this[O]=$,this;}/**\n options: {\n scale: false,\n repeat: false,\n rotated: false,\n rect: [10, 10],\n srcRect: [...],\n hidden: false,\n }\n */},{key:"setTexture",value:function setTexture(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,S=_N.image,C=_N.rect;if(N=S,$.rect)for(var D=0;D<$.rect.length;D++)C[D]=$.rect[D];$.rect=C;}return this[R]||this.setFill(),this.setUniforms({u_texSampler:N}),this[m]&&this[z](this[m],$),this[A]=$,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,$=_ref75.colors,_ref75$type=_ref75.type,S=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,$=_ref76.colors,_ref76$type=_ref76.type,S=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,$=_ref77.colors,_ref77$type=_ref77.type,S=_ref77$type===void 0?"fill":_ref77$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:$,type:S});}/**\n vector: [x0, y0, r0, x1, y1, r1],\n colors: [{offset:0, color}, {offset:1, color}, ...],\n */},{key:"setGradient",value:function setGradient(){var _ref78=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref78.vector,$=_ref78.colors,_ref78$type=_ref78.type,S=_ref78$type===void 0?"fill":_ref78$type;$=$.map(function(_ref79){var j=_ref79.offset,H=_ref79.color;return typeof H=="string"&&(H=Object(v["default"])(H)),{offset:j,color:H};}),this[U]=this[U]||{},this[U][S]={vector:N,colors:$},$.sort(function(j,H){return j.offset-H.offset;});var C=[];$.forEach(function(_ref80){var j=_ref80.offset,H=_ref80.color;C.push.apply(C,[j].concat(_toConsumableArray(H)));});var D;if(N.length===4?D=[N[0],N[1],0,N[2],N[3],0]:D=_toConsumableArray(N),C.length<40&&C.push(-1),C.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=D,this[I].u_colorSteps=C,S==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[k](),this;}},{key:"setUniforms",value:function setUniforms(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[I],N),this;}},{key:"setTransform",value:function setTransform(){var $=this[L];for(var _len3=arguments.length,N=new Array(_len3),_key3=0;_key3<_len3;_key3++){N[_key3]=arguments[_key3];}return e.mat2d.equals(N,$)||(this[L]=N,delete this[w],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var $=this[L];for(var _len4=arguments.length,N=new Array(_len4),_key4=0;_key4<_len4;_key4++){N[_key4]=arguments[_key4];}return this[L]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),$,N),delete this[w],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,$){var S=e.mat2d.create();return S=e.mat2d.translate(Array.of(0,0,0,0,0,0),S,[N,$]),this.transform.apply(this,_toConsumableArray(S));}},{key:"rotate",value:function rotate(N){var _ref81=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref82=_slicedToArray(_ref81,2),$=_ref82[0],S=_ref82[1];var C=e.mat2d.create();return C=e.mat2d.translate(Array.of(0,0,0,0,0,0),C,[$,S]),C=e.mat2d.rotate(Array.of(0,0,0,0,0,0),C,N),C=e.mat2d.translate(Array.of(0,0,0,0,0,0),C,[-$,-S]),this.transform.apply(this,_toConsumableArray(C));}},{key:"scale",value:function scale(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),S=_ref84[0],C=_ref84[1];var D=e.mat2d.create();return D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[S,C]),D=e.mat2d.scale(Array.of(0,0,0,0,0,0),D,[N,$]),D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-S,-C]),this.transform.apply(this,_toConsumableArray(D));}},{key:"skew",value:function skew(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref85=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref86=_slicedToArray(_ref85,2),S=_ref86[0],C=_ref86[1];var D=e.mat2d.create();return D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[S,C]),D=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,e.mat2d.fromValues(1,Math.tan($),Math.tan(N),1,0,0)),D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-S,-C]),this.transform.apply(this,_toConsumableArray(D));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[G].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,N=new Array(_len5),_key5=0;_key5<_len5;_key5++){N[_key5]=arguments[_key5];}return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this;}// apply linear color transform\n},{key:"transformColor",value:function transformColor(){var $=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return $?$=Object(l.multiply)($,N):$=N,this.setColorTransform.apply(this,_toConsumableArray($)),this;}},{key:"blur",value:function blur(N){return this[G].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var C=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(C)&&(C=Object(s["default"])(C)),this[G].push("drop-shadow(".concat(N,"px ").concat($,"px ").concat(S,"px ").concat(C,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371\n},{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[G].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(l.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.sepia)(N)));}},{key:"url",value:function url(N){return this[G].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var C=this.meshData,D=C.positions,j=C.cells,H=this.invertMatrix,V=H[0]*N+H[2]*$+H[4],Q=H[1]*N+H[3]*$+H[5],it=this.boundingBox;if(Vit[1][0]||Qit[1][1])return!1;function st(_ref87,_ref88,_ref89){var _ref90=_slicedToArray(_ref87,2),ct=_ref90[0],gt=_ref90[1];var _ref91=_slicedToArray(_ref88,2),at=_ref91[0],ot=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],mt=_ref92[1];var yt=ft-at,pt=mt-ot,Tt=((ct-at)*yt+(gt-ot)*pt)/(Math.pow(yt,2)+Math.pow(pt,2));return Tt>=0&&Tt<=1;}for(var ct=0;ct=C.fillPointCount)break;if(S==="stroke"&>[0]1&&arguments[1]!==undefined?arguments[1]:{};var S=$.width,C=$.height,D=g($,["width","height"]);var j=new x["default"]();j.rect(0,0,S,C);var H=new Y(j,{width:S,height:C});H.setUniforms(D),H.setProgram(N),this[tt].push(H);}}]);}();},/* 57 */ /***/function(h,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e.Stroke;},/* 58 */ /***/function(h,r,t){t.r(r),t.d(r,"Stroke",function(){return d;});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),o=Object(e.create)(),s=Object(e.create)(),l=1e20;var d=/*#__PURE__*/function(){function d(){var _ref93=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref93$lineWidth=_ref93.lineWidth,T=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,v=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,x=_ref93$miterLimit===void 0?10:_ref93$miterLimit,_ref93$lineCap=_ref93.lineCap,f=_ref93$lineCap===void 0?"butt":_ref93$lineCap,_ref93$roundSegments=_ref93.roundSegments,g=_ref93$roundSegments===void 0?20:_ref93$roundSegments;_classCallCheck(this,d);this.lineWidth=T,this.lineJoin=v,this.miterLimit=x,this.lineCap=f,this.roundSegments=g,this._normal=null;}return _createClass(d,[{key:"build",value:function build(T){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var x=T.length;if(T=_toConsumableArray(T),x<2)return T;v&&((T[0][0]!==T[x-1][0]||T[0][1]!==T[x-1][1])&&T.push(_toConsumableArray(T[0])),T.push(_toConsumableArray(T[1]))),x=T.length,this._normal=null;var f={left:[],right:[]},g=this.lineWidth/2,u=this.lineCap;if(!v&&u==="square"){Object(e.direction)(i,T[0],T[1]),Object(e.scaleAndAdd)(T[0],T[0],i,g);var M=T.length-1;Object(e.direction)(i,T[M],T[M-1]),Object(e.scaleAndAdd)(T[M],T[M],i,g);}for(var _M4=1;_M4this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,x,this._normal,-g*R),c(T,n,R);var O=1/0;v&&(O=Math.min(O,Math.hypot(x[0]-v[0],x[1]-v[1]))),f&&(O=Math.min(O,Math.hypot(f[0]-x[0],f[1]-x[1])));var L=Math.max(g,Math.min(E,O));if(Object(e.scaleAndAdd)(n,x,s,L*R),c(T,n,-R),f)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,x,n,-g*R),M){var w=Object(e.clone)(n),I=R>0?T.left[T.left.length-1]:T.right[T.right.length-1],A=Object(e.clone)(x),W=Object(e.sub)(Object(e.create)(),I,A),z=Object(e.sub)(Object(e.create)(),w,A),K=Math.PI/this.roundSegments;for(var k=0;k0?P.left.push(Object(e.clone)(T)):P.right.push(Object(e.clone)(T));}function p(P,T,v,x){var f=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,T,v,-x),c(P,n,-f),Object(e.scaleAndAdd)(n,T,v,x),c(P,n,f);}function y(_ref94,v){var P=_ref94.left,T=_ref94.right;var x=Object(e.create)(),f=Object(e.create)();var g=P[0],u=T[0],m=[0.5*(g[0]+u[0]),0.5*(g[1]+u[1])];Object(e.sub)(f,g,m);for(var M=1;M<=v;M++){var E=-1*Math.PI*M/v;Object(e.rotate)(x,f,[0,0],E),Object(e.add)(n,m,x),P.unshift(Object(e.clone)(n));}g=T[T.length-1],u=P[P.length-1],m=[0.5*(g[0]+u[0]),0.5*(g[1]+u[1])],Object(e.sub)(f,g,m);for(var _M5=1;_M5<=v;_M5++){var _E2=-1*Math.PI*_M5/v;Object(e.rotate)(x,f,[0,0],_E2),Object(e.add)(n,m,x),T.push(Object(e.clone)(n));}}},/* 59 */ /***/function(h,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);h.exports=function(i,a){if(a=a||{},i=i.filter(function(v){return v.length>2;}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(v){return v.reduce(function(x,f){return x.concat(f);});});var o=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var s=e.tesselate(n({contours:i,windingRule:o,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),l=[],d=0;dOnext and b->Onext are exchanged. This can have various effects\n * depending on whether a and b belong to different face or vertex rings.\n * For more explanation see tessMeshSplice() below.\n */ // static void Splice( TESShalfEdge *a, TESShalfEdge *b )\nsplice_:function splice_(f,g){var u=f.Onext,m=g.Onext;u.Sym.Lnext=g,m.Sym.Lnext=f,f.Onext=m,g.Onext=u;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the\n * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives\n * a place to insert the new vertex in the global vertex list. We insert\n * the new vertex *before* vNext so that algorithms which walk the vertex\n * list will not see the newly created vertices.\n */ //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )\nmakeVertex_:function makeVertex_(f,g,u){var m=f;i(m!==null);var M=u.prev;m.prev=M,M.next=m,m.next=u,u.prev=m,m.anEdge=g;var E=g;do E.Org=m,E=E.Onext;while(E!==g);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left\n * face of all edges in the face loop to which eOrig belongs. "fNext" gives\n * a place to insert the new face in the global face list. We insert\n * the new face *before* fNext so that algorithms which walk the face\n * list will not see the newly created faces.\n */ // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )\nmakeFace_:function makeFace_(f,g,u){var m=f;i(m!==null);var M=u.prev;m.prev=M,M.next=m,m.next=u,u.prev=m,m.anEdge=g,m.trail=null,m.marked=!1,m.inside=u.inside;var E=g;do E.Lface=m,E=E.Lnext;while(E!==g);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),\n * and removes from the global edge list.\n */ //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )\nkillEdge_:function killEdge_(f){f.Sym.sideOnext <- OLD( eDst->Onext )\n *\teDst->Onext <- OLD( eOrg->Onext )\n * where OLD(...) means the value before the meshSplice operation.\n *\n * This can have two effects on the vertex structure:\n * - if eOrg->Org != eDst->Org, the two vertices are merged together\n * - if eOrg->Org == eDst->Org, the origin is split into two vertices\n * In both cases, eDst->Org is changed and eOrg->Org is untouched.\n *\n * Similarly (and independently) for the face structure,\n * - if eOrg->Lface == eDst->Lface, one loop is split into two\n * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one\n * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.\n *\n * Some special cases:\n * If eDst == eOrg, the operation has no effect.\n * If eDst == eOrg->Lnext, the new face will have a single edge.\n * If eDst == eOrg->Lprev, the old face will have a single edge.\n * If eDst == eOrg->Onext, the new vertex will have a single edge.\n * If eDst == eOrg->Oprev, the old vertex will have a single edge.\n */ //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )\nsplice:function splice(f,g){var u=!1,m=!1;if(f!==g){if(g.Org!==f.Org&&(m=!0,this.killVertex_(g.Org,f.Org)),g.Lface!==f.Lface&&(u=!0,this.killFace_(g.Lface,f.Lface)),this.splice_(g,f),!m){var M=new a();this.makeVertex_(M,g,f.Org),f.Org.anEdge=f;}if(!u){var E=new o();this.makeFace_(E,g,f.Lface),f.Lface.anEdge=f;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:\n * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop\n * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;\n * the newly created loop will contain eDel->Dst. If the deletion of eDel\n * would create isolated vertices, those are deleted as well.\n *\n * This function could be implemented as two calls to tessMeshSplice\n * plus a few calls to memFree, but this would allocate and delete\n * unnecessary vertices and faces.\n */ //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )\n"delete":function _delete(f){var g=f.Sym,u=!1;if(f.Lface!==f.Rface&&(u=!0,this.killFace_(f.Lface,f.Rface)),f.Onext===f)this.killVertex_(f.Org,null);else if(f.Rface.anEdge=f.Oprev,f.Org.anEdge=f.Onext,this.splice_(f,f.Oprev),!u){var m=new o();this.makeFace_(m,f,f.Lface);}g.Onext===g?(this.killVertex_(g.Org,null),this.killFace_(g.Lface,null)):(f.Lface.anEdge=g.Oprev,g.Org.anEdge=g.Onext,this.splice_(g,g.Oprev)),this.killEdge_(f);},/******************** Other Edge Operations **********************/ /* All these routines can be implemented with the basic edge\n * operations above. They are provided for convenience and efficiency.\n */ /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that\n * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.\n * eOrg and eNew will have the same left face.\n */ // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );\naddEdgeVertex:function addEdgeVertex(f){var g=this.makeEdge_(f),u=g.Sym;this.splice_(g,f.Lnext),g.Org=f.Dst;var m=new a();return this.makeVertex_(m,u,g.Org),g.Lface=u.Lface=f.Lface,g;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,\n * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.\n * eOrg and eNew will have the same left face.\n */ // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );\nsplitEdge:function splitEdge(f,g){var u=this.addEdgeVertex(f),m=u.Sym;return this.splice_(f.Sym,f.Sym.Oprev),this.splice_(f.Sym,m),f.Dst=m.Org,m.Dst.anEdge=m.Sym,m.Rface=f.Rface,m.winding=f.winding,m.Sym.winding=f.Sym.winding,m;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst\n * to eDst->Org, and returns the corresponding half-edge eNew.\n * If eOrg->Lface == eDst->Lface, this splits one loop into two,\n * and the newly created loop is eNew->Lface. Otherwise, two disjoint\n * loops are merged into one, and the loop eDst->Lface is destroyed.\n *\n * If (eOrg == eDst), the new face will have only two edges.\n * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.\n * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.\n */ // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );\nconnect:function connect(f,g){var u=!1,m=this.makeEdge_(f),M=m.Sym;if(g.Lface!==f.Lface&&(u=!0,this.killFace_(g.Lface,f.Lface)),this.splice_(m,f.Lnext),this.splice_(M,g),m.Org=f.Dst,M.Org=g.Org,m.Lface=M.Lface=f.Lface,f.Lface.anEdge=M,!u){var E=new o();this.makeFace_(E,m,f.Lface);}return m;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the\n * global face list. All edges of fZap will have a NULL pointer as their\n * left face. Any edges which also have a NULL pointer as their right face\n * are deleted entirely (along with any isolated vertices this produces).\n * An entire mesh can be deleted by zapping its faces, one at a time,\n * in any order. Zapped faces cannot be used in further mesh operations!\n */zapFace:function zapFace(f){var g=f.anEdge,u,m,M,E,R;m=g.Lnext;do u=m,m=u.Lnext,u.Lface=null,u.Rface===null&&(u.Onext===u?this.killVertex_(u.Org,null):(u.Org.anEdge=u.Onext,this.splice_(u,u.Oprev)),M=u.Sym,M.Onext===M?this.killVertex_(M.Org,null):(M.Org.anEdge=M.Onext,this.splice_(M,M.Oprev)),this.killEdge_(u));while(u!=g);E=f.prev,R=f.next,R.prev=E,E.next=R;},countFaceVerts_:function countFaceVerts_(f){var g=f.anEdge,u=0;do u++,g=g.Lnext;while(g!==f.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )\nmergeConvexFaces:function mergeConvexFaces(f){var g,u,m,M,E,R,b;for(g=this.fHead.next;g!==this.fHead;g=g.next)if(g.inside)for(u=g.anEdge,E=u.Org;m=u.Lnext,M=u.Sym,M&&M.Lface&&M.Lface.inside&&(R=this.countFaceVerts_(g),b=this.countFaceVerts_(M.Lface),R+b-2<=f&&n.vertCCW(u.Lprev.Org,u.Org,M.Lnext.Lnext.Org)&&n.vertCCW(M.Lprev.Org,M.Org,u.Lnext.Lnext.Org)&&(m=M.Lnext,this["delete"](M),u=null,M=null)),!(u&&u.Lnext.Org===E);)u=m;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.\n */check:function check(){var f=this.fHead,g=this.vHead,u=this.eHead,m,M,E,R,b,O;for(M=f,M=f;(m=M.next)!==f;M=m){i(m.prev===M),b=m.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Lface===m),b=b.Lnext;while(b!==m.anEdge);}for(i(m.prev===M&&m.anEdge===null),R=g,R=g;(E=R.next)!==g;R=E){i(E.prev===R),b=E.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Org===E),b=b.Onext;while(b!==E.anEdge);}for(i(E.prev===R&&E.anEdge===null),O=u,O=u;(b=O.next)!==u;O=b)i(b.Sym.next===O.Sym),i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Org!==null),i(b.Dst!==null),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b);i(b.Sym.next===O.Sym&&b.Sym===this.eHeadSym&&b.Sym.Sym===b&&b.Org===null&&b.Dst===null&&b.Lface===null&&b.Rface===null);}},n.vertEq=function(f,g){return f.s===g.s&&f.t===g.t;},n.vertLeq=function(f,g){return f.s0?m0?(g.t-u.t)*m+(g.t-f.t)*M:0;},n.transEval=function(f,g,u){i(n.transLeq(f,g)&&n.transLeq(g,u));var m=g.t-f.t,M=u.t-g.t;return m+M>0?m0?(g.s-u.s)*m+(g.s-f.s)*M:0;},n.vertCCW=function(f,g,u){return f.s*(g.t-u.t)+g.s*(u.t-f.t)+u.s*(f.t-g.t)>=0;},n.interpolate=function(f,g,u,m){return f=f<0?0:f,u=u<0?0:u,f<=u?u===0?(g+m)/2:g+(m-g)*(f/(f+u)):m+(g-m)*(u/(f+u));},n.intersect=function(f,g,u,m,M){var E,R,b;n.vertLeq(f,g)||(b=f,f=g,g=b),n.vertLeq(u,m)||(b=u,u=m,m=b),n.vertLeq(f,u)||(b=f,f=u,u=b,b=g,g=m,m=b),n.vertLeq(u,g)?n.vertLeq(g,m)?(E=n.edgeEval(f,u,g),R=n.edgeEval(u,g,m),E+R<0&&(E=-E,R=-R),M.s=n.interpolate(E,u.s,R,g.s)):(E=n.edgeSign(f,u,g),R=-n.edgeSign(f,m,g),E+R<0&&(E=-E,R=-R),M.s=n.interpolate(E,u.s,R,m.s)):M.s=(u.s+g.s)/2,n.transLeq(f,g)||(b=f,f=g,g=b),n.transLeq(u,m)||(b=u,u=m,m=b),n.transLeq(f,u)||(b=f,f=u,u=b,b=g,g=m,m=b),n.transLeq(u,g)?n.transLeq(g,m)?(E=n.transEval(f,u,g),R=n.transEval(u,g,m),E+R<0&&(E=-E,R=-R),M.t=n.interpolate(E,u.t,R,g.t)):(E=n.transSign(f,u,g),R=-n.transSign(f,m,g),E+R<0&&(E=-E,R=-R),M.t=n.interpolate(E,u.t,R,m.t)):M.t=(u.t+g.t)/2;};function d(){this.key=null,this.next=null,this.prev=null;}function c(f,g){this.head=new d(),this.head.next=this.head,this.head.prev=this.head,this.frame=f,this.leq=g;}c.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(f){return this.insertBefore(this.head,f);},search:function search(f){var g=this.head;do g=g.next;while(g.key!==null&&!this.leq(this.frame,f,g.key));return g;},insertBefore:function insertBefore(f,g){do f=f.prev;while(f.key!==null&&!this.leq(this.frame,f.key,g));var u=new d();return u.key=g,u.next=f.next,f.next.prev=u,u.prev=f,f.next=u,u;},"delete":function _delete(f){f.next.prev=f.prev,f.prev.next=f.next;}};function p(){this.handle=null;}function y(){this.key=null,this.node=null;}function P(f,g){this.size=0,this.max=f,this.nodes=[],this.nodes.length=f+1;var u;for(u=0;uthis.size||this.leq(u[m].key,u[M].key)){g[f].handle=m,u[m].node=f;break;}g[f].handle=M,u[M].node=f,f=E;}},floatUp_:function floatUp_(f){var g=this.nodes,u=this.handles,m,M,E;for(m=g[f].handle;;){if(E=f>>1,M=g[E].handle,E===0||this.leq(u[M].key,u[m].key)){g[f].handle=m,u[m].node=f;break;}g[f].handle=M,u[M].node=f,f=E;}},init:function init(){for(var f=this.size;f>=1;--f)this.floatDown_(f);this.initialized=!0;},min:function min(){return this.handles[this.nodes[1].handle].key;},/* really pqHeapInsert */ /* returns INV_HANDLE iff out of memory */ //PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )\ninsert:function insert(f){var g,u;if(g=++this.size,g*2>this.max){this.max*=2;var m,M;for(M=this.nodes.length,this.nodes.length=this.max+1,m=M;m0&&(f[1].handle=f[this.size].handle,g[f[1].handle].node=1,g[u].key=null,g[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),m;},"delete":function _delete(f){var g=this.nodes,u=this.handles,m;i(f>=1&&f<=this.max&&u[f].key!==null),m=u[f].node,g[m].handle=g[this.size].handle,u[g[m].handle].node=m,--this.size,m<=this.size&&(m<=1||this.leq(u[g[m>>1].handle].key,u[g[m].handle].key)?this.floatDown_(m):this.floatUp_(m)),u[f].key=null,u[f].node=this.freeList,this.freeList=f;}};function T(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var v={};v.regionBelow=function(f){return f.nodeUp.prev.key;},v.regionAbove=function(f){return f.nodeUp.next.key;},v.debugEvent=function(f){},v.addWinding=function(f,g){f.winding+=g.winding,f.Sym.winding+=g.Sym.winding;},v.edgeLeq=function(f,g,u){var m=f.event,R,b,M=g.eUp,E=u.eUp;if(M.Dst===m)return E.Dst===m?n.vertLeq(M.Org,E.Org)?n.edgeSign(E.Dst,M.Org,E.Org)<=0:n.edgeSign(M.Dst,E.Org,M.Org)>=0:n.edgeSign(E.Dst,m,E.Org)<=0;if(E.Dst===m)return n.edgeSign(M.Dst,m,M.Org)>=0;var R=n.edgeEval(M.Dst,m,M.Org),b=n.edgeEval(E.Dst,m,E.Org);return R>=b;},v.deleteRegion=function(f,g){g.fixUpperEdge&&i(g.eUp.winding===0),g.eUp.activeRegion=null,f.dict["delete"](g.nodeUp);},v.fixUpperEdge=function(f,g,u){i(g.fixUpperEdge),f.mesh["delete"](g.eUp),g.fixUpperEdge=!1,g.eUp=u,u.activeRegion=g;},v.topLeftRegion=function(f,g){var u=g.eUp.Org,m;do g=v.regionAbove(g);while(g.eUp.Org===u);if(g.fixUpperEdge){if(m=f.mesh.connect(v.regionBelow(g).eUp.Sym,g.eUp.Lnext),m===null)return null;v.fixUpperEdge(f,g,m),g=v.regionAbove(g);}return g;},v.topRightRegion=function(f){var g=f.eUp.Dst;do f=v.regionAbove(f);while(f.eUp.Dst===g);return f;},v.addRegionBelow=function(f,g,u){var m=new T();return m.eUp=u,m.nodeUp=f.dict.insertBefore(g.nodeUp,m),m.fixUpperEdge=!1,m.sentinel=!1,m.dirty=!1,u.activeRegion=m,m;},v.isWindingInside=function(f,g){switch(f.windingRule){case e.WINDING_ODD:return(g&1)!==0;case e.WINDING_NONZERO:return g!==0;case e.WINDING_POSITIVE:return g>0;case e.WINDING_NEGATIVE:return g<0;case e.WINDING_ABS_GEQ_TWO:return g>=2||g<=-2;}return i(!1),!1;},v.computeWinding=function(f,g){g.windingNumber=v.regionAbove(g).windingNumber+g.eUp.winding,g.inside=v.isWindingInside(f,g.windingNumber);},v.finishRegion=function(f,g){var u=g.eUp,m=u.Lface;m.inside=g.inside,m.anEdge=u,v.deleteRegion(f,g);},v.finishLeftRegions=function(f,g,u){for(var m,R,M=null,E=g,R=g.eUp;E!==u;){if(E.fixUpperEdge=!1,M=v.regionBelow(E),m=M.eUp,m.Org!=R.Org){if(!M.fixUpperEdge){v.finishRegion(f,E);break;}m=f.mesh.connect(R.Lprev,m.Sym),v.fixUpperEdge(f,M,m);}R.Onext!==m&&(f.mesh.splice(m.Oprev,m),f.mesh.splice(R,m)),v.finishRegion(f,E),R=M.eUp,E=M;}return R;},v.addRightEdges=function(f,g,u,m,M,E){var R,b,O,L,w=!0;O=u;do i(n.vertLeq(O.Org,O.Dst)),v.addRegionBelow(f,g,O.Sym),O=O.Onext;while(O!==m);for(M===null&&(M=v.regionBelow(g).eUp.Rprev),b=g,L=M;R=v.regionBelow(b),O=R.eUp.Sym,O.Org===L.Org;)O.Onext!==L&&(f.mesh.splice(O.Oprev,O),f.mesh.splice(L.Oprev,O)),R.windingNumber=b.windingNumber-O.winding,R.inside=v.isWindingInside(f,R.windingNumber),b.dirty=!0,!w&&v.checkForRightSplice(f,b)&&(v.addWinding(O,L),v.deleteRegion(f,b),f.mesh["delete"](L)),w=!1,b=R,L=O;b.dirty=!0,i(b.windingNumber-O.winding===R.windingNumber),E&&v.walkDirtyRegions(f,b);},v.spliceMergeVertices=function(f,g,u){f.mesh.splice(g,u);},v.vertexWeights=function(f,g,u){var m=n.vertL1dist(g,f),M=n.vertL1dist(u,f),E=0.5*M/(m+M),R=0.5*m/(m+M);f.coords[0]+=E*g.coords[0]+R*u.coords[0],f.coords[1]+=E*g.coords[1]+R*u.coords[1],f.coords[2]+=E*g.coords[2]+R*u.coords[2];},v.getIntersectData=function(f,g,u,m,M,E){g.coords[0]=g.coords[1]=g.coords[2]=0,g.idx=-1,v.vertexWeights(g,u,m),v.vertexWeights(g,M,E);},v.checkForRightSplice=function(f,g){var u=v.regionBelow(g),m=g.eUp,M=u.eUp;if(n.vertLeq(m.Org,M.Org)){if(n.edgeSign(M.Dst,m.Org,M.Org)>0)return!1;n.vertEq(m.Org,M.Org)?m.Org!==M.Org&&(f.pq["delete"](m.Org.pqHandle),v.spliceMergeVertices(f,M.Oprev,m)):(f.mesh.splitEdge(M.Sym),f.mesh.splice(m,M.Oprev),g.dirty=u.dirty=!0);}else{if(n.edgeSign(m.Dst,M.Org,m.Org)<0)return!1;v.regionAbove(g).dirty=g.dirty=!0,f.mesh.splitEdge(m.Sym),f.mesh.splice(M.Oprev,m);}return!0;},v.checkForLeftSplice=function(f,g){var u=v.regionBelow(g),m=g.eUp,M=u.eUp,E;if(i(!n.vertEq(m.Dst,M.Dst)),n.vertLeq(m.Dst,M.Dst)){if(n.edgeSign(m.Dst,M.Dst,m.Org)<0)return!1;v.regionAbove(g).dirty=g.dirty=!0,E=f.mesh.splitEdge(m),f.mesh.splice(M.Sym,E),E.Lface.inside=g.inside;}else{if(n.edgeSign(M.Dst,m.Dst,M.Org)>0)return!1;g.dirty=u.dirty=!0,E=f.mesh.splitEdge(M),f.mesh.splice(m.Lnext,M.Sym),E.Rface.inside=g.inside;}return!0;},v.checkForIntersect=function(f,g){var u=v.regionBelow(g),m=g.eUp,M=u.eUp,E=m.Org,R=M.Org,b=m.Dst,O=M.Dst,L,w,I=new a(),A,W;if(i(!n.vertEq(O,b)),i(n.edgeSign(b,f.event,E)<=0),i(n.edgeSign(O,f.event,R)>=0),i(E!==f.event&&R!==f.event),i(!g.fixUpperEdge&&!u.fixUpperEdge),E===R||(L=Math.min(E.t,b.t),w=Math.max(R.t,O.t),L>w))return!1;if(n.vertLeq(E,R)){if(n.edgeSign(O,E,R)>0)return!1;}else if(n.edgeSign(b,R,E)<0)return!1;return v.debugEvent(f),n.intersect(b,E,O,R,I),i(Math.min(E.t,b.t)<=I.t),i(I.t<=Math.max(R.t,O.t)),i(Math.min(O.s,b.s)<=I.s),i(I.s<=Math.max(R.s,E.s)),n.vertLeq(I,f.event)&&(I.s=f.event.s,I.t=f.event.t),A=n.vertLeq(E,R)?E:R,n.vertLeq(A,I)&&(I.s=A.s,I.t=A.t),n.vertEq(I,E)||n.vertEq(I,R)?(v.checkForRightSplice(f,g),!1):!n.vertEq(b,f.event)&&n.edgeSign(b,f.event,I)>=0||!n.vertEq(O,f.event)&&n.edgeSign(O,f.event,I)<=0?O===f.event?(f.mesh.splitEdge(m.Sym),f.mesh.splice(M.Sym,m),g=v.topLeftRegion(f,g),m=v.regionBelow(g).eUp,v.finishLeftRegions(f,v.regionBelow(g),u),v.addRightEdges(f,g,m.Oprev,m,m,!0),!0):b===f.event?(f.mesh.splitEdge(M.Sym),f.mesh.splice(m.Lnext,M.Oprev),u=g,g=v.topRightRegion(g),W=v.regionBelow(g).eUp.Rprev,u.eUp=M.Oprev,M=v.finishLeftRegions(f,u,null),v.addRightEdges(f,g,M.Onext,m.Rprev,W,!0),!0):(n.edgeSign(b,f.event,I)>=0&&(v.regionAbove(g).dirty=g.dirty=!0,f.mesh.splitEdge(m.Sym),m.Org.s=f.event.s,m.Org.t=f.event.t),n.edgeSign(O,f.event,I)<=0&&(g.dirty=u.dirty=!0,f.mesh.splitEdge(M.Sym),M.Org.s=f.event.s,M.Org.t=f.event.t),!1):(f.mesh.splitEdge(m.Sym),f.mesh.splitEdge(M.Sym),f.mesh.splice(M.Oprev,m),m.Org.s=I.s,m.Org.t=I.t,m.Org.pqHandle=f.pq.insert(m.Org),v.getIntersectData(f,m.Org,E,b,R,O),v.regionAbove(g).dirty=g.dirty=u.dirty=!0,!1);},v.walkDirtyRegions=function(f,g){for(var u=v.regionBelow(g),m,M;;){for(;u.dirty;)g=u,u=v.regionBelow(u);if(!g.dirty&&(u=g,g=v.regionAbove(g),g===null||!g.dirty))return;if(g.dirty=!1,m=g.eUp,M=u.eUp,m.Dst!==M.Dst&&v.checkForLeftSplice(f,g)&&(u.fixUpperEdge?(v.deleteRegion(f,u),f.mesh["delete"](M),u=v.regionBelow(g),M=u.eUp):g.fixUpperEdge&&(v.deleteRegion(f,g),f.mesh["delete"](m),g=v.regionAbove(u),m=g.eUp)),m.Org!==M.Org)if(m.Dst!==M.Dst&&!g.fixUpperEdge&&!u.fixUpperEdge&&(m.Dst===f.event||M.Dst===f.event)){if(v.checkForIntersect(f,g))return;}else v.checkForRightSplice(f,g);m.Org===M.Org&&m.Dst===M.Dst&&(v.addWinding(M,m),v.deleteRegion(f,g),f.mesh["delete"](m),g=v.regionAbove(u));}},v.connectRightVertex=function(f,g,u){var m,M=u.Onext,E=v.regionBelow(g),R=g.eUp,b=E.eUp,O=!1;if(R.Dst!==b.Dst&&v.checkForIntersect(f,g),n.vertEq(R.Org,f.event)&&(f.mesh.splice(M.Oprev,R),g=v.topLeftRegion(f,g),M=v.regionBelow(g).eUp,v.finishLeftRegions(f,v.regionBelow(g),E),O=!0),n.vertEq(b.Org,f.event)&&(f.mesh.splice(u,b.Oprev),u=v.finishLeftRegions(f,E,null),O=!0),O){v.addRightEdges(f,g,u.Onext,M,M,!0);return;}n.vertLeq(b.Org,R.Org)?m=b.Oprev:m=R,m=f.mesh.connect(u.Lprev,m),v.addRightEdges(f,g,m,m.Onext,m.Onext,!1),m.Sym.activeRegion.fixUpperEdge=!0,v.walkDirtyRegions(f,g);},v.connectLeftDegenerate=function(f,g,u){var m,M,E,R,b;if(m=g.eUp,n.vertEq(m.Org,u)){i(!1/*TOLERANCE_NONZERO*/),v.spliceMergeVertices(f,m,u.anEdge);return;}if(!n.vertEq(m.Dst,u)){f.mesh.splitEdge(m.Sym),g.fixUpperEdge&&(f.mesh["delete"](m.Onext),g.fixUpperEdge=!1),f.mesh.splice(u.anEdge,m),v.sweepEvent(f,u);return;}i(!1/*TOLERANCE_NONZERO*/),g=v.topRightRegion(g),b=v.regionBelow(g),E=b.eUp.Sym,M=R=E.Onext,b.fixUpperEdge&&(i(M!==E),v.deleteRegion(f,b),f.mesh["delete"](E),E=M.Oprev),f.mesh.splice(u.anEdge,E),n.edgeGoesLeft(M)||(M=null),v.addRightEdges(f,g,E.Onext,R,M,!0);},v.connectLeftVertex=function(f,g){var u,m,M,E,R,b,O=new T();if(O.eUp=g.anEdge.Sym,u=f.dict.search(O).key,m=v.regionBelow(u),!!m){if(E=u.eUp,R=m.eUp,n.edgeSign(E.Dst,g,E.Org)===0){v.connectLeftDegenerate(f,u,g);return;}if(M=n.vertLeq(R.Dst,E.Dst)?u:m,u.inside||M.fixUpperEdge){if(M===u)b=f.mesh.connect(g.anEdge.Sym,E.Lnext);else{var L=f.mesh.connect(R.Dnext,g.anEdge);b=L.Sym;}M.fixUpperEdge?v.fixUpperEdge(f,M,b):v.computeWinding(f,v.addRegionBelow(f,u,b)),v.sweepEvent(f,g);}else v.addRightEdges(f,u,g.anEdge,g.anEdge,null,!0);}},v.sweepEvent=function(f,g){f.event=g,v.debugEvent(f);for(var u=g.anEdge;u.activeRegion===null;)if(u=u.Onext,u===g.anEdge){v.connectLeftVertex(f,g);return;}var m=v.topLeftRegion(f,u.activeRegion);i(m!==null);var M=v.regionBelow(m),E=M.eUp,R=v.finishLeftRegions(f,M,null);R.Onext===E?v.connectRightVertex(f,m,R):v.addRightEdges(f,m,R.Onext,E,E,!0);},v.addSentinel=function(f,g,u,m){var M=new T(),E=f.mesh.makeEdge();E.Org.s=u,E.Org.t=m,E.Dst.s=g,E.Dst.t=m,f.event=E.Dst,M.eUp=E,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=f.dict.insert(M);},v.initEdgeDict=function(f){f.dict=new c(f,v.edgeLeq);var g=f.bmax[0]-f.bmin[0],u=f.bmax[1]-f.bmin[1],m=f.bmin[0]-g,M=f.bmax[0]+g,E=f.bmin[1]-u,R=f.bmax[1]+u;v.addSentinel(f,m,M,E),v.addSentinel(f,m,M,R);},v.doneEdgeDict=function(f){for(var g,u=0;(g=f.dict.min().key)!==null;)g.sentinel||(i(g.fixUpperEdge),i(++u===1)),i(g.windingNumber===0),v.deleteRegion(f,g);},v.removeDegenerateEdges=function(f){var g,u,m,M=f.mesh.eHead;for(g=M.next;g!==M;g=u)u=g.next,m=g.Lnext,n.vertEq(g.Org,g.Dst)&&g.Lnext.Lnext!==g&&(v.spliceMergeVertices(f,m,g),f.mesh["delete"](g),g=m,m=g.Lnext),m.Lnext===g&&(m!==g&&((m===u||m===u.Sym)&&(u=u.next),f.mesh["delete"](m)),(g===u||g===u.Sym)&&(u=u.next),f.mesh["delete"](g));},v.initPriorityQ=function(f){var g,u,m,M=0;for(m=f.mesh.vHead,u=m.next;u!==m;u=u.next)M++;for(M+=8,g=f.pq=new P(M,n.vertLeq),m=f.mesh.vHead,u=m.next;u!==m;u=u.next)u.pqHandle=g.insert(u);return u!==m?!1:(g.init(),!0);},v.donePriorityQ=function(f){f.pq=null;},v.removeDegenerateFaces=function(f,g){var u,m,M;for(u=g.fHead.next;u!==g.fHead;u=m)m=u.next,M=u.anEdge,i(M.Lnext!==M),M.Lnext.Lnext===M&&(v.addWinding(M.Onext,M),f.mesh["delete"](M));return!0;},v.computeInterior=function(f){var g,u;if(v.removeDegenerateEdges(f),!v.initPriorityQ(f))return!1;for(v.initEdgeDict(f);(g=f.pq.extractMin())!==null;){for(;u=f.pq.min(),!(u===null||!n.vertEq(u,g));)u=f.pq.extractMin(),v.spliceMergeVertices(f,g.anEdge,u.anEdge);v.sweepEvent(f,g);}return f.event=f.dict.min().key.eUp.Org,v.debugEvent(f),v.doneEdgeDict(f),v.donePriorityQ(f),v.removeDegenerateFaces(f,f.mesh)?(f.mesh.check(),!0):!1;};function x(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=e.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0;}x.prototype={dot_:function dot_(f,g){return f[0]*g[0]+f[1]*g[1]+f[2]*g[2];},normalize_:function normalize_(f){var g=f[0]*f[0]+f[1]*f[1]+f[2]*f[2];i(g>0),g=Math.sqrt(g),f[0]/=g,f[1]/=g,f[2]/=g;},longAxis_:function longAxis_(f){var g=0;return Math.abs(f[1])>Math.abs(f[0])&&(g=1),Math.abs(f[2])>Math.abs(f[g])&&(g=2),g;},computeNormal_:function computeNormal_(f){var g,u,m,M,E,R,b=[0,0,0],O=[0,0,0],L=[0,0,0],w=[0,0,0],I=[0,0,0],A=[null,null,null],W=[null,null,null],z=this.mesh.vHead,K;for(g=z.next,K=0;K<3;++K)M=g.coords[K],O[K]=M,W[K]=g,b[K]=M,A[K]=g;for(g=z.next;g!==z;g=g.next)for(K=0;K<3;++K)M=g.coords[K],Mb[K]&&(b[K]=M,A[K]=g);if(K=0,b[1]-O[1]>b[0]-O[0]&&(K=1),b[2]-O[2]>b[K]-O[K]&&(K=2),O[K]>=b[K]){f[0]=0,f[1]=0,f[2]=1;return;}for(R=0,u=W[K],m=A[K],L[0]=u.coords[0]-m.coords[0],L[1]=u.coords[1]-m.coords[1],L[2]=u.coords[2]-m.coords[2],g=z.next;g!==z;g=g.next)w[0]=g.coords[0]-m.coords[0],w[1]=g.coords[1]-m.coords[1],w[2]=g.coords[2]-m.coords[2],I[0]=L[1]*w[2]-L[2]*w[1],I[1]=L[2]*w[0]-L[0]*w[2],I[2]=L[0]*w[1]-L[1]*w[0],E=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],E>R&&(R=E,f[0]=I[0],f[1]=I[1],f[2]=I[2]);R<=0&&(f[0]=f[1]=f[2]=0,f[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var f,g,u=this.mesh.fHead,m,M=this.mesh.vHead,E;for(f=0,g=u.next;g!==u;g=g.next)if(E=g.anEdge,!(E.winding<=0))do f+=(E.Org.s-E.Dst.s)*(E.Org.t+E.Dst.t),E=E.Lnext;while(E!==g.anEdge);if(f<0){for(m=M.next;m!==M;m=m.next)m.t=-m.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/*\t#ifdef FOR_TRITE_TEST_PROGRAM\n #include \n extern int RandomSweep;\n #define S_UNIT_X\t(RandomSweep ? (2*drand48()-1) : 1.0)\n #define S_UNIT_Y\t(RandomSweep ? (2*drand48()-1) : 0.0)\n #else\n #if defined(SLANTED_SWEEP) */ /* The "feature merging" is not intended to be complete. There are\n * special cases where edges are nearly parallel to the sweep line\n * which are not implemented. The algorithm should still behave\n * robustly (ie. produce a reasonable tesselation) in the presence\n * of such edges, however it may miss features which could have been\n * merged. We could minimize this effect by choosing the sweep line\n * direction to be something unusual (ie. not parallel to one of the\n * coordinate axes).\n */ /*\t#define S_UNIT_X\t(TESSreal)0.50941539564955385\t// Pre-normalized\n #define S_UNIT_Y\t(TESSreal)0.86052074622010633\n #else\n #define S_UNIT_X\t(TESSreal)1.0\n #define S_UNIT_Y\t(TESSreal)0.0\n #endif\n #endif*/ /* Determine the polygon normal and project vertices onto the plane\n * of the polygon.\n */projectPolygon_:function projectPolygon_(){var f,g=this.mesh.vHead,u=[0,0,0],m,M,E,R,b=!1;for(u[0]=this.normal[0],u[1]=this.normal[1],u[2]=this.normal[2],u[0]===0&&u[1]===0&&u[2]===0&&(this.computeNormal_(u),b=!0),m=this.sUnit,M=this.tUnit,E=this.longAxis_(u),m[E]=0,m[(E+1)%3]=1,m[(E+2)%3]=0,M[E]=0,M[(E+1)%3]=0,M[(E+2)%3]=u[E]>0?1:-1,f=g.next;f!==g;f=f.next)f.s=this.dot_(f.coords,m),f.t=this.dot_(f.coords,M);for(b&&this.checkOrientation_(),R=!0,f=g.next;f!==g;f=f.next)R?(this.bmin[0]=this.bmax[0]=f.s,this.bmin[1]=this.bmax[1]=f.t,R=!1):(f.sthis.bmax[0]&&(this.bmax[0]=f.s),f.tthis.bmax[1]&&(this.bmax[1]=f.t));},addWinding_:function addWinding_(f,g){f.winding+=g.winding,f.Sym.winding+=g.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region\n * (what else would it do??) The region must consist of a single\n * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this\n * case means that any vertical line intersects the interior of the\n * region in a single interval. \n *\n * Tessellation consists of adding interior edges (actually pairs of\n * half-edges), to split the region into non-overlapping triangles.\n *\n * The basic idea is explained in Preparata and Shamos (which I don\'\'t\n * have handy right now), although their implementation is more\n * complicated than this one. The are two edge chains, an upper chain\n * and a lower chain. We process all vertices from both chains in order,\n * from right to left.\n *\n * The algorithm ensures that the following invariant holds after each\n * vertex is processed: the untessellated region consists of two\n * chains, where one chain (say the upper) is a single edge, and\n * the other chain is concave. The left vertex of the single edge\n * is always to the left of all vertices in the concave chain.\n *\n * Each step consists of adding the rightmost unprocessed vertex to one\n * of the two chains, and forming a fan of triangles from the rightmost\n * of two chain endpoints. Determining whether we can add each triangle\n * to the fan is a simple orientation test. By making the fan as large\n * as possible, we restore the invariant (check it yourself).\n */ //\tint tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )\ntessellateMonoRegion_:function tessellateMonoRegion_(f,g){var u,m;for(u=g.anEdge,i(u.Lnext!==u&&u.Lnext.Lnext!==u);n.vertLeq(u.Dst,u.Org);u=u.Lprev);for(;n.vertLeq(u.Org,u.Dst);u=u.Lnext);for(m=u.Lprev;u.Lnext!==m;)if(n.vertLeq(u.Dst,m.Org)){for(;m.Lnext!==u&&(n.edgeGoesLeft(m.Lnext)||n.edgeSign(m.Org,m.Dst,m.Lnext.Dst)<=0);){var M=f.connect(m.Lnext,m);m=M.Sym;}m=m.Lprev;}else{for(;m.Lnext!==u&&(n.edgeGoesRight(u.Lprev)||n.edgeSign(u.Dst,u.Org,u.Lprev.Org)>=0);){var M=f.connect(u,u.Lprev);u=M.Sym;}u=u.Lnext;}for(i(m.Lnext!==u);m.Lnext.Lnext!==u;){var M=f.connect(m.Lnext,m);m=M.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of\n * the mesh which is marked "inside" the polygon. Each such region\n * must be monotone.\n */ //int tessMeshTessellateInterior( TESSmesh *mesh )\ntessellateInterior_:function tessellateInterior_(f){var g,u;for(g=f.fHead.next;g!==f.fHead;g=u)if(u=g.next,g.inside&&!this.tessellateMonoRegion_(f,g))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces\n * which are not marked "inside" the polygon. Since further mesh operations\n * on NULL faces are not allowed, the main purpose is to clean up the\n * mesh so that exterior loops are not represented in the data structure.\n */ //void tessMeshDiscardExterior( TESSmesh *mesh )\ndiscardExterior_:function discardExterior_(f){var g,u;for(g=f.fHead.next;g!==f.fHead;g=u)u=g.next,g.inside||f.zapFace(g);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the\n * winding numbers on all edges so that regions marked "inside" the\n * polygon have a winding number of "value", and regions outside\n * have a winding number of 0.\n *\n * If keepOnlyBoundary is TRUE, it also deletes all edges which do not\n * separate an interior region from an exterior one.\n */ //\tint tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )\nsetWindingNumber_:function setWindingNumber_(f,g,u){var m,M;for(m=f.eHead.next;m!==f.eHead;m=M)M=m.next,m.Rface.inside!==m.Lface.inside?m.winding=m.Lface.inside?g:-g:u?f["delete"](m):m.winding=0;},getNeighbourFace_:function getNeighbourFace_(f){return!f.Rface||!f.Rface.inside?-1:f.Rface.n;},outputPolymesh_:function outputPolymesh_(f,g,u,m){var M,E,R,b=0,O=0,L,w;for(u>3&&f.mergeConvexFaces(u),M=f.vHead.next;M!==f.vHead;M=M.next)M.n=-1;for(E=f.fHead.next;E!==f.fHead;E=E.next)if(E.n=-1,!!E.inside){R=E.anEdge,L=0;do M=R.Org,M.n===-1&&(M.n=O,O++),L++,R=R.Lnext;while(R!==E.anEdge);i(L<=u),E.n=b,++b;}for(this.elementCount=b,g===e.CONNECTED_POLYGONS&&(b*=2),this.elements=[],this.elements.length=b*u,this.vertexCount=O,this.vertices=[],this.vertices.length=O*m,this.vertexIndices=[],this.vertexIndices.length=O,M=f.vHead.next;M!==f.vHead;M=M.next)if(M.n!==-1){var I=M.n*m;this.vertices[I+0]=M.coords[0],this.vertices[I+1]=M.coords[1],m>2&&(this.vertices[I+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx;}var A=0;for(E=f.fHead.next;E!==f.fHead;E=E.next)if(E.inside){R=E.anEdge,L=0;do M=R.Org,this.elements[A++]=M.n,L++,R=R.Lnext;while(R!==E.anEdge);for(w=L;w2&&(this.vertices[b++]=m.Org.coords[2]),this.vertexIndices[O++]=m.Org.idx,R++,m=m.Lnext;while(m!==M);this.elements[L++]=E,this.elements[L++]=R,E+=R;}},addContour:function addContour(f,g){var u,m;for(this.mesh===null&&(this.mesh=new l()),f<2&&(f=2),f>3&&(f=3),u=null,m=0;m2?u.Org.coords[2]=g[m+2]:u.Org.coords[2]=0,u.Org.idx=this.vertexIndexCounter++,u.winding=1,u.Sym.winding=-1;},//\tint tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )\ntesselate:function tesselate(f,g,u,m,M){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,M&&(this.normal[0]=M[0],this.normal[1]=M[1],this.normal[2]=M[2]),this.windingRule=f,m<2&&(m=2),m>3&&(m=3),!this.mesh)return!1;this.projectPolygon_(),v.computeInterior(this);var E=this.mesh;return g===e.BOUNDARY_CONTOURS?this.setWindingNumber_(E,1,!0):this.tessellateInterior_(E),E.check(),g===e.BOUNDARY_CONTOURS?this.outputContours_(E,m):this.outputPolymesh_(E,g,u,m),!0;}};},/* 62 */ /***/function(h,r){h.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,P=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,T=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,v=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,x=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var f=P|T<<1|v<<2|x<<3;var g=y[o][f];Array.isArray(g)&&(g=y.createProgram.apply(y,_toConsumableArray(g)),y[o][f]=g),y.program!==g&&y.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var d=[];function c(y){for(var P=0;P<64;P++){var T=[],v=!!(P&1),_x28=!!(P&2),_f11=!!(P&4),g=!!(P&8),u=!!(P&16),m=!!(P&32);v&&T.push("#define TEXTURE 1"),_x28&&T.push("#define FILTER 1"),_f11&&T.push("#define GRADIENT 1"),g&&T.push("#define CLOUDCOLOR 1"),u&&T.push("#define CLOUDFILTER 1"),m&&T.push("#define CLIPPATH 1");var M="".concat(T.join("\\n"),"\\n"),E=[];if(v){E.push("uniform sampler2D u_texSampler;");for(var R=0;R<12;R++)E.push("uniform sampler2D u_texFrame".concat(R,";"));}m&&E.push("uniform sampler2D u_clipSampler;"),d[P]=[M+E.join("\\n")+a["default"],M+i["default"]];}}function p(y){var _ref96=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref96$hasTexture=_ref96.hasTexture,P=_ref96$hasTexture===void 0?!1:_ref96$hasTexture,_ref96$hasFilter=_ref96.hasFilter,T=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,v=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,x=_ref96$hasCloudColor===void 0?!1:_ref96$hasCloudColor,_ref96$hasCloudFilter=_ref96.hasCloudFilter,f=_ref96$hasCloudFilter===void 0?!1:_ref96$hasCloudFilter,_ref96$hasClipPath=_ref96.hasClipPath,g=_ref96$hasClipPath===void 0?!1:_ref96$hasClipPath;var u=P|T<<1|v<<2|x<<3|f<<4|g<<5;var m=d[u];Array.isArray(m)&&(m=y.createProgram.apply(y,_toConsumableArray(m)),d[u]=m),y.program!==m&&y.useProgram(m,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});}},/* 64 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\\nattribute vec4 a_color;\\nvarying vec4 vColor;\\nvarying float flagBackground;\\nuniform vec2 u_resolution;\\nuniform mat3 viewMatrix;\\nuniform mat3 projectionMatrix;\\n\\n#ifdef TEXTURE\\nattribute vec3 a_vertexTextureCoord;\\nvarying vec3 vTextureCoord;\\nattribute vec4 a_sourceRect;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nattribute vec2 a_clipUV;\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef GRADIENT\\nuniform float u_radialGradientVector[6];\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\n#endif\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n\\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\\n gl_Position = vec4(pos.xy, 1.0, 1.0);\\n\\n#ifdef GRADIENT\\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\\n float h = u_resolution.y;\\n vg1.y = h - vg1.y;\\n vg2.y = h - vg2.y;\\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\\n#endif\\n \\n flagBackground = a_vertexPosition.z;\\n vColor = a_color;\\n\\n#ifdef TEXTURE\\n vTextureCoord = a_vertexTextureCoord;\\n vSourceRect = a_sourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\n vClipUV = a_clipUV;\\n#endif\\n}";},/* 65 */ /***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\\n\\nvarying vec4 vColor;\\nvarying float flagBackground;\\n\\n#ifdef TEXTURE\\nvarying vec3 vTextureCoord;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef FILTER\\nuniform int u_filterFlag;\\nuniform float u_colorMatrix[20];\\n#endif\\n\\n#ifdef GRADIENT\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\nuniform float u_colorSteps[40];\\nuniform int u_gradientType;\\n// uniform float u_radialGradientVector[6];\\n\\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\\n float t;\\n // center circle radius\\n float cr = gv1.z;\\n // focal circle radius\\n float fr = gv2.z;\\n\\n if(cr > 0.0 || fr > 0.0) {\\n // radial gradient\\n vec2 center = gv1.xy;\\n vec2 focal = gv2.xy;\\n float x = focal.x - gl_FragCoord.x;\\n float y = focal.y - gl_FragCoord.y;\\n float dx = focal.x - center.x;\\n float dy = focal.y - center.y;\\n float dr = cr - fr;\\n float a = dx * dx + dy * dy - dr * dr;\\n float b = -2.0 * (y * dy + x * dx + fr * dr);\\n float c = x * x + y * y - fr * fr;\\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\\n } else {\\n // linear gradient\\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\\n vec2 v2 = gv2.xy - gv1.xy;\\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\\n }\\n\\n vec4 colors[8];\\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\\n \\n float steps[8];\\n steps[0] = colorSteps[0];\\n steps[1] = colorSteps[5];\\n steps[2] = colorSteps[10];\\n steps[3] = colorSteps[15];\\n steps[4] = colorSteps[20];\\n steps[5] = colorSteps[25];\\n steps[6] = colorSteps[30];\\n steps[7] = colorSteps[35];\\n\\n color = colors[0];\\n for (int i = 1; i < 8; i++) {\\n if (steps[i] < 0.0 || steps[i] > 1.0) {\\n break;\\n }\\n if(steps[i] == steps[i - 1]) {\\n color = colors[i];\\n } else {\\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\\n }\\n if (steps[i] >= t) {\\n break;\\n }\\n }\\n}\\n#endif\\n\\n#ifdef FILTER\\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\\n float r = color.r, g = color.g, b = color.b, a = color.a;\\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\\n}\\n#endif\\n\\nvoid main() {\\n vec4 color = vColor;\\n float opacity = abs(flagBackground);\\n\\n#ifdef GRADIENT\\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\\n }\\n#endif\\n\\n if(opacity < 1.0) {\\n color.a *= opacity;\\n }\\n\\n#ifdef TEXTURE\\n if(flagBackground > 0.0) {\\n vec3 texCoord = vTextureCoord;\\n\\n if(texCoord.z == 1.0) {\\n texCoord = fract(texCoord);\\n }\\n\\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\\n if(vSourceRect.z > 0.0) {\\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\\n }\\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\\n float alpha = texColor.a;\\n if(opacity < 1.0) {\\n texColor.a *= opacity;\\n alpha *= mix(0.465, 1.0, opacity);\\n }\\n // color = mix(color, texColor, texColor.a);\\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\\n }\\n }\\n#endif\\n\\n#ifdef FILTER\\n if(u_filterFlag > 0) {\\n transformColor(color, u_colorMatrix);\\n }\\n#endif\\n\\n#ifdef CLIPPATH\\n float clip = texture2D(u_clipSampler, vClipUV).r;\\n color *= clip;\\n#endif\\n\\n gl_FragColor = color;\\n}";},/* 66 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\\nattribute vec4 a_color;\\nvarying vec4 vColor;\\nvarying float flagBackground;\\nattribute vec3 a_transform0;\\nattribute vec3 a_transform1;\\nuniform vec2 u_resolution;\\nuniform mat3 viewMatrix;\\nuniform mat3 projectionMatrix;\\n\\n#ifdef TEXTURE\\nattribute vec3 a_vertexTextureCoord;\\nvarying vec3 vTextureCoord;\\nattribute float a_frameIndex;\\nvarying float frameIndex;\\nattribute vec4 a_sourceRect;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nattribute vec2 a_clipUV;\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef CLOUDFILTER\\nattribute vec4 a_colorCloud0;\\nattribute vec4 a_colorCloud1;\\nattribute vec4 a_colorCloud2;\\nattribute vec4 a_colorCloud3;\\nattribute vec4 a_colorCloud4;\\nvarying vec4 colorCloud0;\\nvarying vec4 colorCloud1;\\nvarying vec4 colorCloud2;\\nvarying vec4 colorCloud3;\\nvarying vec4 colorCloud4;\\n#endif\\n\\n#ifdef CLOUDCOLOR\\nattribute vec4 a_fillCloudColor;\\nattribute vec4 a_strokeCloudColor;\\n#endif\\n\\n#ifdef GRADIENT\\nuniform float u_radialGradientVector[6];\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\n#endif\\n\\nvoid main() {\\n gl_PointSize = 1.0;\\n\\n mat3 modelMatrix = mat3(\\n a_transform0.x, a_transform1.x, 0, \\n a_transform0.y, a_transform1.y, 0,\\n a_transform0.z, a_transform1.z, 1\\n );\\n\\n vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(a_vertexPosition.xy, 1.0);\\n gl_Position = vec4(pos.xy, 1.0, 1.0);\\n\\n#ifdef GRADIENT\\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\\n float h = u_resolution.y;\\n vg1.y = h - vg1.y;\\n vg2.y = h - vg2.y;\\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\\n#endif\\n \\n flagBackground = a_vertexPosition.z;\\n\\n#ifdef CLOUDCOLOR\\n if(flagBackground > 0.0) {\\n vColor = mix(a_color, a_fillCloudColor, a_fillCloudColor.a);\\n } else {\\n vColor = mix(a_color, a_strokeCloudColor, a_strokeCloudColor.a);\\n }\\n#else\\n vColor = a_color;\\n#endif\\n\\n#ifdef TEXTURE\\n vTextureCoord = a_vertexTextureCoord;\\n frameIndex = a_frameIndex;\\n vSourceRect = a_sourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\n vClipUV = a_clipUV;\\n#endif\\n\\n#ifdef CLOUDFILTER\\n colorCloud0 = a_colorCloud0;\\n colorCloud1 = a_colorCloud1;\\n colorCloud2 = a_colorCloud2;\\n colorCloud3 = a_colorCloud3;\\n colorCloud4 = a_colorCloud4;\\n#endif\\n}";},/* 67 */ /***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\\n\\nvarying vec4 vColor;\\nvarying float flagBackground;\\n\\n#ifdef TEXTURE\\nvarying float frameIndex;\\nvarying vec3 vTextureCoord;\\nvarying vec4 vSourceRect;\\n#endif\\n\\n#ifdef CLIPPATH\\nvarying vec2 vClipUV;\\n#endif\\n\\n#ifdef FILTER\\nuniform int u_filterFlag;\\nuniform float u_colorMatrix[20];\\n#endif\\n\\n#ifdef CLOUDFILTER\\nvarying vec4 colorCloud0;\\nvarying vec4 colorCloud1;\\nvarying vec4 colorCloud2;\\nvarying vec4 colorCloud3;\\nvarying vec4 colorCloud4;\\n#endif\\n\\n#ifdef GRADIENT\\nvarying vec3 vGradientVector1;\\nvarying vec3 vGradientVector2;\\nuniform float u_colorSteps[40];\\nuniform int u_gradientType;\\n\\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\\n float t;\\n // center circle radius\\n float cr = gv1.z;\\n // focal circle radius\\n float fr = gv2.z;\\n\\n if(cr > 0.0 || fr > 0.0) {\\n // radial gradient\\n vec2 center = gv1.xy;\\n vec2 focal = gv2.xy;\\n float x = focal.x - gl_FragCoord.x;\\n float y = focal.y - gl_FragCoord.y;\\n float dx = focal.x - center.x;\\n float dy = focal.y - center.y;\\n float dr = cr - fr;\\n float a = dx * dx + dy * dy - dr * dr;\\n float b = -2.0 * (y * dy + x * dx + fr * dr);\\n float c = x * x + y * y - fr * fr;\\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\\n } else {\\n // linear gradient\\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\\n vec2 v2 = gv2.xy - gv1.xy;\\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\\n }\\n\\n vec4 colors[8];\\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\\n \\n float steps[8];\\n steps[0] = colorSteps[0];\\n steps[1] = colorSteps[5];\\n steps[2] = colorSteps[10];\\n steps[3] = colorSteps[15];\\n steps[4] = colorSteps[20];\\n steps[5] = colorSteps[25];\\n steps[6] = colorSteps[30];\\n steps[7] = colorSteps[35];\\n\\n color = colors[0];\\n for (int i = 1; i < 8; i++) {\\n if (steps[i] < 0.0 || steps[i] > 1.0) {\\n break;\\n }\\n if(steps[i] == steps[i - 1]) {\\n color = colors[i];\\n } else {\\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\\n }\\n if (steps[i] >= t) {\\n break;\\n }\\n }\\n}\\n#endif\\n\\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\\n float r = color.r, g = color.g, b = color.b, a = color.a;\\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\\n}\\n\\n#ifdef CLOUDFILTER\\nvoid buildCloudColor(inout float colorCloudMatrix[20]) {\\n colorCloudMatrix[0] = colorCloud0[0];\\n colorCloudMatrix[1] = colorCloud1[0];\\n colorCloudMatrix[2] = colorCloud2[0];\\n colorCloudMatrix[3] = colorCloud3[0];\\n colorCloudMatrix[4] = colorCloud4[0];\\n\\n colorCloudMatrix[5] = colorCloud0[1];\\n colorCloudMatrix[6] = colorCloud1[1];\\n colorCloudMatrix[7] = colorCloud2[1];\\n colorCloudMatrix[8] = colorCloud3[1];\\n colorCloudMatrix[9] = colorCloud4[1];\\n\\n colorCloudMatrix[10] = colorCloud0[2];\\n colorCloudMatrix[11] = colorCloud1[2];\\n colorCloudMatrix[12] = colorCloud2[2];\\n colorCloudMatrix[13] = colorCloud3[2];\\n colorCloudMatrix[14] = colorCloud4[2];\\n\\n colorCloudMatrix[15] = colorCloud0[3];\\n colorCloudMatrix[16] = colorCloud1[3];\\n colorCloudMatrix[17] = colorCloud2[3];\\n colorCloudMatrix[18] = colorCloud3[3];\\n colorCloudMatrix[19] = colorCloud4[3];\\n}\\n#endif\\n\\nvoid main() {\\n vec4 color = vColor;\\n float opacity = abs(flagBackground);\\n\\n#ifdef GRADIENT\\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\\n }\\n#endif\\n\\n if(opacity < 1.0) {\\n color.a *= opacity;\\n }\\n\\n#ifdef TEXTURE\\n if(flagBackground > 0.0) {\\n vec3 texCoord = vTextureCoord;\\n\\n if(texCoord.z == 1.0) {\\n texCoord = fract(texCoord);\\n }\\n\\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\\n if(vSourceRect.z > 0.0) {\\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\\n }\\n if(frameIndex < 0.0) {\\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\\n color = mix(color, texColor, texColor.a);\\n } else {\\n int index = int(floor(clamp(0.0, 11.0, frameIndex)));\\n vec4 texColor;\\n if(index == 0) texColor = texture2D(u_texFrame0, texCoord.xy);\\n else if(index == 1) texColor = texture2D(u_texFrame1, texCoord.xy);\\n else if(index == 2) texColor = texture2D(u_texFrame2, texCoord.xy);\\n else if(index == 3) texColor = texture2D(u_texFrame3, texCoord.xy);\\n else if(index == 4) texColor = texture2D(u_texFrame4, texCoord.xy);\\n else if(index == 5) texColor = texture2D(u_texFrame5, texCoord.xy);\\n else if(index == 6) texColor = texture2D(u_texFrame6, texCoord.xy);\\n else if(index == 7) texColor = texture2D(u_texFrame7, texCoord.xy);\\n else if(index == 8) texColor = texture2D(u_texFrame8, texCoord.xy);\\n else if(index == 9) texColor = texture2D(u_texFrame9, texCoord.xy);\\n else if(index == 10) texColor = texture2D(u_texFrame10, texCoord.xy);\\n else texColor = texture2D(u_texFrame11, texCoord.xy);\\n float alpha = texColor.a;\\n if(opacity < 1.0) {\\n texColor.a *= opacity;\\n alpha *= mix(0.465, 1.0, opacity);\\n }\\n // color = mix(color, texColor, texColor.a);\\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\\n }\\n }\\n }\\n#endif\\n\\n#ifdef FILTER\\n if(u_filterFlag > 0) {\\n transformColor(color, u_colorMatrix);\\n }\\n#endif\\n\\n#ifdef CLOUDFILTER\\n float colorCloudMatrix[20];\\n buildCloudColor(colorCloudMatrix);\\n transformColor(color, colorCloudMatrix);\\n#endif\\n\\n#ifdef CLIPPATH\\n float clip = texture2D(u_clipSampler, vClipUV).r;\\n color *= clip;\\n#endif\\n\\n gl_FragColor = color;\\n}";},/* 68 */ /***/function(h,r,t){t.r(r),function(e,n){t.d(r,"requestAnimationFrame",function(){return a;}),t.d(r,"cancelAnimationFrame",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(e)<"u"&&e.hrtime){var _e$hrtime=e.hrtime(),_e$hrtime2=_slicedToArray(_e$hrtime,2),s=_e$hrtime2[0],l=_e$hrtime2[1];return s*1e3+l*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var a,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,o=n.cancelAnimationFrame):(a=function a(s){return setTimeout(function(){s(i());},16);},o=function o(s){return clearTimeout(s);});}.call(this,t(69),t(22));},/* 69 */ /***/function(h,r){var t=h.exports={},e,n;function i(){throw new Error("setTimeout has not been defined");}function a(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i;}catch(_unused4){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused5){n=a;}})();function o(x){if(e===setTimeout)return setTimeout(x,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(x,0);try{return e(x,0);}catch(_unused6){try{return e.call(null,x,0);}catch(_unused7){return e.call(this,x,0);}}}function s(x){if(n===clearTimeout)return clearTimeout(x);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(x);try{return n(x);}catch(_unused8){try{return n.call(null,x);}catch(_unused9){return n.call(this,x);}}}var l=[],d=!1,c,p=-1;function y(){!d||!c||(d=!1,c.length?l=c.concat(l):p=-1,l.length&&P());}function P(){if(!d){var x=o(y);d=!0;for(var f=l.length;f;){for(c=l,l=[];++p1)for(var g=1;g0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,R);this.attributes=new this.constructor.Attr(this),this[T]={width:300,height:150},Object.assign(this.attributes,O),this[v]=/* @__PURE__ */new Set(),this[x]={},this[f]={};}return _createClass(R,[{key:"ancestors",get:function get(){var O=this.parent;var L=[];for(;O;)L.push(O),O=O.parent;return L;}},{key:"animations",get:function get(){return this[v];}},{key:"filters",get:function get(){return this[g]||this.parent&&this.parent.filters;}},{key:"isVisible",get:function get(){return!1;}},{key:"layer",get:function get(){return this.parent?this.parent.layer:null;}},{key:"localMatrix",get:function get(){var O=this.transformMatrix,_this$attributes=this.attributes,L=_this$attributes.x,w=_this$attributes.y;return O[4]+=L,O[5]+=w,O;}},{key:"opacity",get:function get(){var O=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(O*=this.parent.opacity),O;}},{key:"parentNode",get:function get(){return this.parent;}},{key:"nextSibling",get:function get(){return this.getNodeNearBy(1);}},{key:"previousSibling",get:function get(){return this.getNodeNearBy(-1);}},{key:"program",get:function get(){return this[m];}/* get parent defined by connect method */},{key:"renderer",get:function get(){return this.parent?this.parent.renderer:null;}},{key:"renderMatrix",get:function get(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;var O=this.localMatrix;var L=this.parent;if(L){var w=L.__cacheRenderMatrix||L.renderMatrix;w&&(O=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,O));}return O;}},{key:"worldScaling",get:function get(){var O=this.renderMatrix;return[Math.hypot(O[0],O[1]),Math.hypot(O[2],O[3])];}},{key:"worldRotation",get:function get(){var O=this.renderMatrix;return Math.atan2(O[1],O[3]);}},{key:"worldPosition",get:function get(){var O=this.renderMatrix;return[O[4],O[5]];}},{key:"uniforms",get:function get(){return this[E];}/* get zOrder defined by connect method */ /* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(O){this.attributes.className=O;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(O){this.attributes.id=O;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(O){this.attributes.name=O;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(O){this.attributes.zIndex=O;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[M]||{};}},{key:"activateAnimations",value:function activateAnimations(){var O=this.layer;if(O){var L=this[v];L.forEach(function(I){I.baseTimeline=O.timeline,I.play(),I.finished.then(function(){L["delete"](I);});});var w=this.children;w&&w.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(O,L){var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};O==="mousewheel"&&(O="wheel"),typeof w=="boolean"&&(w={capture:w});var _w8=w,I=_w8.capture,A=_w8.once,W=I?f:x;return this[W][O]=this[W][O]||[],this[W][O].push({listener:L,once:A}),this;}},{key:"animate",value:function animate(O,L){var _this21=this;var w=new i["default"](this,O,L);return this.effects&&w.applyEffects(this.effects),this.layer&&(w.baseTimeline=this.layer.timeline,w.play(),w.finished.then(function(){_this21[v]["delete"](w);})),this[v].add(w),w;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,O=new Array(_len7),_key7=0;_key7<_len7;_key7++){O[_key7]=arguments[_key7];}if(O.length===0)return this.attributes[P];if(O.length>1){var L=O[0],w=O[1];return typeof w=="function"&&(w=w(this.attr(L))),this.setAttribute(L,w),this;}return typeof O[0]=="string"?this.getAttribute(O[0]):(Object.assign(this.attributes,O[0]),this);}},{key:"cloneNode",value:function cloneNode(){var O=new this.constructor(),L=this.attributes[y];return O.attr(L),O;}},{key:"connect",value:function connect(O,L){Object.defineProperty(this,"parent",{value:O,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:L,writable:!1,configurable:!0}),O.timeline&&this.activateAnimations(),this.setResolution(O.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:O,zOrder:L}});}},{key:"contains",value:function contains(O){for(;O&&this!==O;)O=O.parent;return!!O;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[v].forEach(function(L){return L.cancel();});var O=this.children;O&&O.forEach(function(L){L.deactivateAnimations&&L.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var O=this.parent,L=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:O,zOrder:L}}),O&&O.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(O){var _this22=this;O instanceof o["default"]||(O=new o["default"](O)),O.target=this;var L=O.type;L==="mousewheel"&&(L="wheel");var w=[this];var I=this.parent;for(;O.bubbles&&I;)w.push(I),I=I.parent;for(var A=w.length-1;A>=0;A--){var W=w[A],z=W[f]&&W[f][L];if(z&&z.length&&(O.currentTarget=W,z.forEach(function(_ref97){var K=_ref97.listener,k=_ref97.once;K.call(_this22,O),k&&w.removeEventListener(K);}),delete O.currentTarget),!O.bubbles&&O.cancelBubble)break;}if(!O.cancelBubble)for(var _A4=0;_A40&&arguments[0]!==undefined?arguments[0]:[];var L=this.mesh;if(L){if(Object(s.applyFilters)(L,this.filters),O.push(L),this[m]){L.setProgram(this[m]);var w=this[M];w&&Object.entries(w).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),A=_ref100[0],W=_ref100[1];L.setAttribute(A,W);});var I=this[E];if(this[E]){var A={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],z=_ref102[1];typeof z=="function"&&(z=z(_this23,W)),A[W]=z;}),L.setUniforms(A);}}Object(l["default"])(this,L);}return O;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(O){return this.attributes[O];}},{key:"getListeners",value:function getListeners(O){var _ref103=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref103$capture=_ref103.capture,L=_ref103$capture===void 0?!1:_ref103$capture;return _toConsumableArray(this[L?f:x][O]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(O===0)return this;var L=this.parent.children,w=L.indexOf(this);return L[w+O];}},{key:"getWorldPosition",value:function getWorldPosition(O,L){var w=this.renderMatrix,I=O*w[0]+L*w[2]+w[4],A=O*w[1]+L*w[3]+w[5];return[I,A];}},{key:"getOffsetPosition",value:function getOffsetPosition(O,L){var w=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=O*w[0]+L*w[2]+w[4],A=O*w[1]+L*w[3]+w[5];return[I,A];}},{key:"getResolution",value:function getResolution(){return c({},this[T]);}},{key:"isPointCollision",value:function isPointCollision(O,L){if(!this.mesh)return!1;var w=this.attributes.pointerEvents;if(w==="none"||w!=="all"&&!this.isVisible)return!1;var I="both";return w==="visibleFill"&&(I="fill"),w==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(O,L,I);}},{key:"onPropertyChange",value:function onPropertyChange(O,L,w){O!=="id"&&O!=="name"&&O!=="className"&&O!=="pointerEvents"&&O!=="passEvents"&&this.forceUpdate(),O==="filter"&&(this[g]=Object(s.parseFilterString)(L)),O==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(O,L){O==="attrs"&&this.attr(L),this.attributes[O]=L;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)\n},{key:"setProgram",value:function setProgram(O){this[m]=O,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(O,L){this[M]=this[M]||{},this[M][O]=L,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(O){this[E]=this[E]||{},Object.assign(this[E],O),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref104){var O=_ref104.width,L=_ref104.height;var _this$T3=this[T],w=_this$T3.width,I=_this$T3.height;(w!==O||I!==L)&&(this[T]={width:O,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:O,height:L}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[u]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[u]=this.attributes.display,this.attributes.display="none");}},{key:"releaseMouseCapture",value:function releaseMouseCapture(){this.layer&&this.layer.__mouseCapturedTarget===this&&(this.layer.__mouseCapturedTarget=null);}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"removeAllListeners",value:function removeAllListeners(O){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof L=="boolean"&&(L={capture:L});var I=L.capture?f:x;return this[I][O]&&(this[I][O]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(O){this.setAttribute(O,null);}},{key:"removeEventListener",value:function removeEventListener(O,L){var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof w=="boolean"&&(w={capture:w});var A=w.capture?f:x;if(this[A][O]){var W=this[A][O];if(W)for(var z=0;z1&&arguments[1]!==undefined?arguments[1]:"linear";var w=this,I=Symbol("animation");L=L||"linear";var A=0;return _typeof(O)=="object"&&(A=O.delay||0,O=O.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var z=this[I];z&&z.cancel(W);}),"end",function end(){var W=this[I];W&&(W.playState==="running"||W.playState==="pending")&&W.finish();}),"reverse",function reverse(){var W=this[I];if(W)if(W.playState==="running"||W.playState==="pending")W.playbackRate=-W.playbackRate;else{var z=W.timing.direction;W.timing.direction=z==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,z){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,z)),Object.entries(W).forEach(function(_ref105){var _ref106=_slicedToArray(_ref105,2),K=_ref106[0],k=_ref106[1];typeof k=="function"&&(W[K]=k(w.attr(K)));}),this[I]=w.animate([W],{duration:O*1e3,delay:A*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();p(R,"Attr",n["default"]),a["default"].registerNode(R,"node");},/* 71 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),s=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),d=Symbol["for"]("spritejs_attributes"),c=Symbol["for"]("spritejs_changedAttrs"),p=Symbol("subject"),y=Symbol("attr"),P=Symbol("default"),T=Symbol("alias");function v(b,_ref108){var _ref109=_slicedToArray(_ref108,2),O=_ref109[0],L=_ref109[1];var w=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(b).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),I=_ref111[0],A=_ref111[1];if((O||L)&&(w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[O,L])),I==="matrix")w=e.mat2d.multiply(w,w,A);else if(I==="offsetTranslate")w[4]+=A[0],w[5]+=A[1];else if(I==="offsetRotate")w=e.mat2d.rotate(Array.of(0,0,0,0,0,0),w,A);else if(I==="skew"){var _A5=_slicedToArray(A,2),W=_A5[0],z=_A5[1];w=e.mat2d.multiply(w,w,e.mat2d.fromValues(1,Math.tan(z),Math.tan(W),1,0,0));}else e.mat2d[I](w,w,A);(O||L)&&(w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-O,-L]));}),w;}var x=Symbol("transformMatrix"),f=Symbol("transforms"),g=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),m=Symbol("offsetFigure");function M(b,O,L){var w=b[y][O];if(b[s](O,L,!1)||b[u]!==O){var A=b[f];A.has(O)&&A["delete"](O),L&&(O==="rotate"&&(L=Math.PI*L/180),O==="scale"&&(L=L.map(function(W){return Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5;})),A.set(O,L)),b[x]=null,b[p].onPropertyChange(O,L,w,b);}}function E(b){var O=b[m],L=b.offsetDistance*O.getTotalLength(),w=O.getPointAtLength(L);if(w){var I=b[f];var A=b.offsetRotate;A==="auto"?A=w.angle:A==="reverse"?A=Math.PI+w.angle:A=Math.PI*A/180,I.set("offsetRotate",A),I.set("offsetTranslate",[w.x,w.y]),b[x]=null;}}var R=/*#__PURE__*/function(){function R(O){var _this24=this;_classCallCheck(this,R);this[p]=O,this[y]={},this[x]=e.mat2d.fromValues(1,0,0,1,0,0),this[f]=/* @__PURE__ */new Map(),this[P]={},this[T]=[],Object.defineProperty(O,"transformMatrix",{get:function get(){return _this24[x]||(_this24[x]=v(_this24[f],_this24.transformOrigin)),_toConsumableArray(_this24[x]);}}),this[a]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",// none | visible | visibleFill | visibleStroke | all\nfilter:"none",display:""}),this[o]("class","pos"),this[g]=/* @__PURE__ */new Set(),this[m]=new n.Figure2D({scale:5,simplify:0});}return _createClass(R,[{key:c,get:function get(){var _this25=this;var O={};return _toConsumableArray(this[g]).forEach(function(L){O[L]=_this25[y][L];}),O;}},{key:d,get:function get(){var O=Object.assign({},this[y]);for(var L=0;L2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[y][O],A=this[p];return L==null&&(L=this[P][O]),Object(i.compareValue)(I,L)?!1:(this[y][O]=L,this[g].has(O)&&this[g]["delete"](O),this[g].add(O),this[u]=O,w&&A.onPropertyChange(O,L,I,this),!0);}},{key:l,value:function value(O){return this[y][O];}},{key:"id",get:function get(){return this[l]("id");},set:function set(O){this[s]("id",O);}},{key:"name",get:function get(){return this[l]("name");},set:function set(O){this[s]("name",O);}},{key:"className",get:function get(){return this[l]("className");},set:function set(O){this[s]("className",O);}},{key:"class",get:function get(){return this.className;},set:function set(O){this.className=O;}},{key:"x",get:function get(){return this[l]("x");},set:function set(O){this[s]("x",Object(i.toNumber)(O));}},{key:"y",get:function get(){return this[l]("y");},set:function set(O){this[s]("y",Object(i.toNumber)(O));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(O){O=Object(i.toArray)(O),Array.isArray(O)||(O=[O,O]),this.x=O[0],this.y=O[1];}},{key:"transform",get:function get(){return this[l]("transform");},set:function set(O){var L=null;if(Array.isArray(O)&&(L=O,O="matrix(".concat(O.map(i.toNumber).join(),")")),typeof O=="string")O=O.replace(/\\s*,\\s*/g,",");else if(O!=null)throw new TypeError("Invalid transform value.");var w=this[y].transform;if(this[s]("transform",O,!1)){var I=this[f];if(I.has("matrix")&&I["delete"]("matrix"),L)I.set("matrix",L);else if(O){var A=O.match(/(matrix|translate|rotate|scale|skew)\\([^()]+\\)/g);if(A){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var z=0;z1?_len8-1:0),_key8=1;_key8<_len8;_key8++){L[_key8-1]=arguments[_key8];}return O[a].apply(O,L);}},{key:"declareAlias",value:function declareAlias(O){for(var _len9=arguments.length,L=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){L[_key9-1]=arguments[_key9];}return O[o].apply(O,L);}},{key:"setAttribute",value:function setAttribute(O){for(var _len10=arguments.length,L=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){L[_key10-1]=arguments[_key10];}return O[s].apply(O,L);}},{key:"getAttribute",value:function getAttribute(O){for(var _len11=arguments.length,L=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){L[_key11-1]=arguments[_key11];}return O[l].apply(O,L);}},{key:"getAttributes",value:function getAttributes(O){return O[d];}},{key:"getChangedAttributes",value:function getChangedAttributes(O){return O[c];}}]);}();},/* 72 */ /***/function(h,r,t){t.r(r),t.d(r,"sizeToPixel",function(){return e;}),t.d(r,"toString",function(){return n;}),t.d(r,"toNumber",function(){return i;}),t.d(r,"toArray",function(){return a;}),t.d(r,"compareValue",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function e(s,l){var d=s.trim().match(/^([\\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);d?s={size:parseFloat(d[1]),unit:d[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,c=_s3.size,p=_s3.unit;if(p==="pt")c/=0.75;else if(p==="pc")c*=16;else if(p==="in")c*=96;else if(p==="cm")c*=96/2.54;else if(p==="mm")c*=96/25.4;else if(p==="em"||p==="rem"||p==="ex"){if(!l&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var y=getComputedStyle(document.documentElement).fontSize;y?l=e(y,16):l=16;}c*=l,p==="ex"&&(c/=2);}else if(p==="q")c*=96/25.4/4;else if(p==="vw"||p==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y3=p==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;c*=_y3/100;}}else if((p==="vmax"||p==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y4=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;p==="vmax"?c*=Math.max(_y4,P)/100:c*=Math.min(_y4,P)/100;}return c;}function n(s){return s==null?s:String(s);}function i(s){if(s==null)return s;if(typeof s=="string"&&(s=e(s)),!Number.isFinite(s))throw new TypeError("Invalid value");return s;}function a(s){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\\s,]+/g)),Array.isArray(s)&&(l&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,l){if(Array.isArray(s)&&Array.isArray(l)){if(s.length!==l.length)return!1;for(var d=0;dx-T?P:y;},e.Effects.fillColor=d,e.Effects.strokeColor=d,e.Effects.bgcolor=d,e.Effects.borderColor=d,e.Effects.text=c;var p=/*#__PURE__*/function(_e$Animator){function p(P,T,v){var _this26;_classCallCheck(this,p);var x=P.attr();Object.entries(x).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),f=_ref113[0],g=_ref113[1];x[f]=e.Effects[f]?g:l(g);}),T=T.map(function(f){var g=s({},f);var u={};return Object.entries(g).forEach(function(_ref114){var _ref115=_slicedToArray(_ref114,2),m=_ref115[0],M=_ref115[1];u[m]=e.Effects[m]?M:l(M);}),u;}),_this26=_callSuper(this,p,[x,T,v]),_this26.target=P,_this26.setter=function(f,g){g.attr(f);};return _this26;}_inherits(p,_e$Animator);return _createClass(p,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(p,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this27=this;return _superPropGet(p,"finished",this,1).then(function(){var P=_this27;return new Promise(function(T){function v(){P.setter(P.frame,P.target);var x=P.playState;x==="finished"||x==="idle"?(Object(a.cancelAnimationFrame)(P.requestId),T()):Object(a.requestAnimationFrame)(v);}v();});});}},{key:"finish",value:function finish(){_superPropGet(p,"finish",this,3)([]),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(p,"play",this,3)([]),this.setter(this.frame,this.target);var P=this;this.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(function T(){var v=P.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&v.layer&&v.layer.canvas&&!document.documentElement.contains(v.layer.canvas)){P.cancel();return;}var x=P.playState;P.setter(P.frame,P.target),x!=="idle"&&(x==="running"?P.requestId=Object(a.requestAnimationFrame)(T):(x==="paused"||x==="pending"&&P.timeline.currentTime<0)&&P.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(T);}));});});}},{key:"cancel",value:function cancel(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),P?(this.setter(this.frame,this.target),_superPropGet(p,"cancel",this,3)([])):(_superPropGet(p,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(e.Animator);},/* 74 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=d(e),i=t(187),a=d(i),o=t(188),s=t(190),l=d(s);function d(c){return c&&c.__esModule?c:{"default":c};}r.Animator=l["default"],r.Easings=o.Easings,r.Effects=a["default"],r.Timeline=n["default"];},/* 75 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=f(e),i=t(133),a=f(i),o=t(141),s=f(o),l=t(164),d=f(l),c=t(170),p=f(c),y=t(171),P=f(y),T=t(175),v=f(T),x=t(186);function f(w){return w&&w.__esModule?w:{"default":w};}var g=(0,x.createNowTime)(),u={originTime:0,playbackRate:1},m=(0,v["default"])("timeMark"),M=(0,v["default"])("playbackRate"),E=(0,v["default"])("timers"),R=(0,v["default"])("originTime"),b=(0,v["default"])("setTimer"),O=(0,v["default"])("parent"),L=function(){function w(I,A){(0,p["default"])(this,w),I instanceof w&&(A=I,I={}),I=(0,d["default"])({},u,I),A&&(this[O]=A);var W=I.nowtime||g;if(A)Object.defineProperty(this,"globalTime",{get:function get(){return A.currentTime;}});else{var z=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-z;}});}this[m]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[O]&&(this[m][0].globalEntropy=this[O].entropy),this[R]=I.originTime,this[M]=I.playbackRate,this[E]=new s["default"]();}return(0,P["default"])(w,[{key:"markTime",value:function value(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=A.time,z=W===void 0?this.currentTime:W,K=A.entropy,k=K===void 0?this.entropy:K,q=A.playbackRate,U=q===void 0?this.playbackRate:q,G={globalTime:this.globalTime,localTime:z,entropy:k,playbackRate:U,globalEntropy:this.globalEntropy};this[m].push(G);}},{key:"fork",value:function value(A){return new w(A,this);}},{key:"seekGlobalTime",value:function value(A){var W=this.seekTimeMark(A),z=this[m][W],K=z.entropy,k=z.playbackRate,q=z.globalTime;return q+(A-K)/Math.abs(k);}},{key:"seekLocalTime",value:function value(A){var W=this.seekTimeMark(A),z=this[m][W],K=z.localTime,k=z.entropy,q=z.playbackRate;return q>0?K+(A-k):K-(A-k);}},{key:"seekTimeMark",value:function value(A){var W=this[m],z=0,K=W.length-1;if(A<=W[z].entropy)return z;if(A>=W[K].entropy)return K;for(var k=Math.floor((z+K)/2);k>z&&kW[k].entropy&&(z=k),k=Math.floor((z+K)/2);}return z;}},{key:"updateTimers",value:function value(){var A=this,W=[].concat((0,a["default"])(this[E]));W.forEach(function(z){var K=(0,n["default"])(z,2),k=K[0],q=K[1];A[b](q.handler,q.time,k);});}},{key:"clearTimeout",value:function(I){function A(W){return I.apply(this,arguments);}return A.toString=function(){return I.toString();},A;}(function(I){var A=this[E].get(I);A&&A.timerID!=null&&(this[O]?this[O].clearTimeout(A.timerID):clearTimeout(A.timerID)),this[E]["delete"](I);})},{key:"clearInterval",value:function value(A){return this.clearTimeout(A);}},{key:"clear",value:function value(){var A=this,W=this[E];[].concat((0,a["default"])(W.keys())).forEach(function(z){A.clearTimeout(z);});}/*\n setTimeout(func, {delay: 100, isEntropy: true})\n setTimeout(func, {entropy: 100})\n setTimeout(func, 100})\n */},{key:"setTimeout",value:function value(A){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](A,W);}},{key:"setInterval",value:function value(A){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},z=this,K=this[b](function k(){z[b](k,W,K),A();},W);return K;}},{key:b,value:function value(A,W){var z=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,v["default"])("timerID");W=(0,x.formatDelay)(W);var k=this[E].get(K),q=void 0,U=null,G=void 0,Z=void 0;k?(this.clearTimeout(K),W.isEntropy?q=(W.delay-(this.entropy-k.startEntropy))/Math.abs(this.playbackRate):q=(W.delay-(this.currentTime-k.startTime))/this.playbackRate,G=k.startTime,Z=k.startEntropy):(q=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),G=this.currentTime,Z=this.entropy);var nt=this[O],rt=nt?nt.setTimeout.bind(nt):setTimeout,tt=W.heading;return!nt&&tt===!1&&q<0&&(q=1/0),(isFinite(q)||nt)&&(q=Math.ceil(q),rt!==setTimeout&&(q={delay:q,heading:tt}),U=rt(function(){z[E]["delete"](K),A();},q)),this[E].set(K,{timerID:U,handler:A,time:W,startTime:G,startEntropy:Z}),K;}},{key:"parent",get:function get(){return this[O];}},{key:"lastTimeMark",get:function get(){return this[m][this[m].length-1];}},{key:"currentTime",get:function get(){var A=this.lastTimeMark,W=A.localTime,z=A.globalTime;return W+(this.globalTime-z)*this.playbackRate;},set:function set(A){var W=this,z=this.currentTime,K=A,k=this[E];this.markTime({time:A}),[].concat((0,a["default"])(k)).forEach(function(q){var U=(0,n["default"])(q,2),G=U[0],Z=U[1];if(k.has(G)){var nt=Z.time,rt=nt.isEntropy,tt=nt.delay,J=nt.heading,ht=Z.handler,dt=Z.startTime;if(rt)tt===0&&(ht(),W.clearTimeout(G));else{var B=dt+tt;(tt===0||J!==!1&&(K-z)*tt<=0||z<=B&&B<=K||z>=B&&B>=K)&&(ht(),W.clearTimeout(G));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.\n// If current playbackRate is negative, the currentTime should go backwards\n// while the entropy remain to go forwards.\n// Both of the initial values is set to -originTime\n},{key:"entropy",get:function get(){var A=this.lastTimeMark,W=A.entropy,z=A.globalEntropy;return W+Math.abs((this.globalEntropy-z)*this.playbackRate);},// get globalTime() {\n// if(this[_parent]) {\n// return this[_parent].currentTime;\n// }\n// return nowtime();\n// }\n// change entropy will NOT cause currentTime changing but may influence the pass\n// and the future of the timeline. (It may change the result of seek***Time)\n// While entropy is set, all the marks behind will be droped\nset:function set(A){if(this.entropy>A){var W=this.seekTimeMark(A);this[m].length=W+1;}this.markTime({entropy:A}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[O]?this[O].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[M];},set:function set(A){A!==this.playbackRate&&(this.markTime({playbackRate:A}),this[M]=A,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var A=this.parent;A;){if(A.playbackRate===0)return!0;A=A.parent;}return!1;}}]),w;}();r["default"]=L;},/* 76 */ /***/function(h,r,t){r.__esModule=!0;var e=t(77),n=o(e),i=t(129),a=o(i);function o(s){return s&&s.__esModule?s:{"default":s};}r["default"]=/* @__PURE__ */function(){function s(l,d){var c=[],p=!0,y=!1,P=void 0;try{for(var T=(0,a["default"])(l),v;!(p=(v=T.next()).done)&&(c.push(v.value),!(d&&c.length===d));p=!0);}catch(x){y=!0,P=x;}finally{try{!p&&T["return"]&&T["return"]();}finally{if(y)throw P;}}return c;}return function(l,d){if(Array.isArray(l))return l;if((0,n["default"])(Object(l)))return s(l,d);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 */ /***/function(h,r,t){h.exports={"default":t(78),__esModule:!0};},/* 78 */ /***/function(h,r,t){t(79),t(125),h.exports=t(127);},/* 79 */ /***/function(h,r,t){t(80);for(var e=t(91),n=t(95),i=t(83),a=t(122)("toStringTag"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,l):s=="values"?n(0,o[l]):n(0,[l,o[l]]);},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries");},/* 81 */ /***/function(h,r){h.exports=function(){};},/* 82 */ /***/function(h,r){h.exports=function(t,e){return{value:e,done:!!t};};},/* 83 */ /***/function(h,r){h.exports={};},/* 84 */ /***/function(h,r,t){var e=t(85),n=t(87);h.exports=function(i){return e(n(i));};},/* 85 */ /***/function(h,r,t){var e=t(86);h.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n);};},/* 86 */ /***/function(h,r){var t={}.toString;h.exports=function(e){return t.call(e).slice(8,-1);};},/* 87 */ /***/function(h,r){h.exports=function(t){if(t==null)throw TypeError("Can\'t call method on "+t);return t;};},/* 88 */ /***/function(h,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),o=t(83),s=t(107),l=t(121),d=t(123),c=t(122)("iterator"),p=!([].keys&&"next"in[].keys()),y="@@iterator",P="keys",T="values",v=function v(){return this;};h.exports=function(x,f,g,u,m,M,E){s(g,f,u);var R=function R(U){if(!p&&U in w)return w[U];switch(U){case P:return function(){return new g(this,U);};case T:return function(){return new g(this,U);};}return function(){return new g(this,U);};},b=f+" Iterator",O=m==T,L=!1,w=x.prototype,I=w[c]||w[y]||m&&w[m],A=I||R(m),W=m?O?R("entries"):A:void 0,z=f=="Array"&&w.entries||I,K,k,q;if(z&&(q=d(z.call(new x())),q!==Object.prototype&&q.next&&(l(q,b,!0),!e&&typeof q[c]!="function"&&a(q,c,v))),O&&I&&I.name!==T&&(L=!0,A=function A(){return I.call(this);}),(!e||E)&&(p||L||!w[c])&&a(w,c,A),o[f]=A,o[b]=v,m)if(K={values:O?A:R(T),keys:M?A:R(P),entries:W},E)for(k in K)k in w||i(w,k,K[k]);else n(n.P+n.F*(p||L),f,K);return K;};},/* 89 */ /***/function(h,r){h.exports=!0;},/* 90 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),o=t(105),s="prototype",_l2=function l(d,c,p){var y=d&_l2.F,P=d&_l2.G,T=d&_l2.S,v=d&_l2.P,x=d&_l2.B,f=d&_l2.W,g=P?n:n[c]||(n[c]={}),u=g[s],m=P?e:T?e[c]:(e[c]||{})[s],M,E,R;P&&(p=c);for(M in p)E=!y&&m&&m[M]!==void 0,!(E&&o(g,M))&&(R=E?m[M]:p[M],g[M]=P&&typeof m[M]!="function"?p[M]:x&&E?i(R,e):f&&m[M]==R?function(b){var O=function O(L,w,I){if(this instanceof b){switch(arguments.length){case 0:return new b();case 1:return new b(L);case 2:return new b(L,w);}return new b(L,w,I);}return b.apply(this,arguments);};return O[s]=b[s],O;}(R):v&&typeof R=="function"?i(Function.call,R):R,v&&((g.virtual||(g.virtual={}))[M]=R,d&_l2.R&&u&&!u[M]&&a(u,M,R)));};_l2.F=1,_l2.G=2,_l2.S=4,_l2.P=8,_l2.B=16,_l2.W=32,_l2.U=64,_l2.R=128,h.exports=_l2;},/* 91 */ /***/function(h,r){var t=h.exports=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window.Math==Math?window:(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t);},/* 92 */ /***/function(h,r){var t=h.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 */ /***/function(h,r,t){var e=t(94);h.exports=function(n,i,a){if(e(n),i===void 0)return n;switch(a){case 1:return function(o){return n.call(i,o);};case 2:return function(o,s){return n.call(i,o,s);};case 3:return function(o,s,l){return n.call(i,o,s,l);};}return function(){return n.apply(i,arguments);};};},/* 94 */ /***/function(h,r){h.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=t(100)?function(i,a,o){return e.f(i,a,n(1,o));}:function(i,a,o){return i[a]=o,i;};},/* 96 */ /***/function(h,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(s,l,d){if(e(s),l=i(l,!0),e(d),n)try{return a(s,l,d);}catch(_unused10){}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(s[l]=d.value),s;};},/* 97 */ /***/function(h,r,t){var e=t(98);h.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n;};},/* 98 */ /***/function(h,r){h.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 */ /***/function(h,r,t){h.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 */ /***/function(h,r,t){h.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 */ /***/function(h,r){h.exports=function(t){try{return!!t();}catch(_unused11){return!0;}};},/* 102 */ /***/function(h,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);h.exports=function(a){return i?n.createElement(a):{};};},/* 103 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n))return n;var a,o;if(i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(o=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n)))return o;throw TypeError("Can\'t convert object to primitive value");};},/* 104 */ /***/function(h,r){h.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e};};},/* 105 */ /***/function(h,r){var t={}.hasOwnProperty;h.exports=function(e,n){return t.call(e,n);};},/* 106 */ /***/function(h,r,t){h.exports=t(95);},/* 107 */ /***/function(h,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this;}),h.exports=function(o,s,l){o.prototype=e(a,{next:n(1,l)}),i(o,s+" Iterator");};},/* 108 */ /***/function(h,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),o=function o(){},s="prototype",_l3=function l(){var d=t(102)("iframe"),c=i.length,p="<",y=">",P;for(d.style.display="none",t(120).appendChild(d),d.src="javascript:",P=d.contentWindow.document,P.open(),P.write(p+"script"+y+"document.F=Object"+p+"/script"+y),P.close(),_l3=P.F;c--;)delete _l3[s][i[c]];return _l3();};h.exports=Object.create||function(c,p){var y;return c!==null?(o[s]=e(c),y=new o(),o[s]=null,y[a]=c):y=_l3(),p===void 0?y:n(y,p);};},/* 109 */ /***/function(h,r,t){var e=t(96),n=t(97),i=t(110);h.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var l=i(s),d=l.length,c=0,p;d>c;)e.f(o,p=l[c++],s[p]);return o;};},/* 110 */ /***/function(h,r,t){var e=t(111),n=t(119);h.exports=Object.keys||function(a){return e(a,n);};},/* 111 */ /***/function(h,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");h.exports=function(o,s){var l=n(o),d=0,c=[],p;for(p in l)p!=a&&e(l,p)&&c.push(p);for(;s.length>d;)e(l,p=s[d++])&&(~i(c,p)||c.push(p));return c;};},/* 112 */ /***/function(h,r,t){var e=t(84),n=t(113),i=t(115);h.exports=function(a){return function(o,s,l){var d=e(o),c=n(d.length),p=i(l,c),y;if(a&&s!=s){for(;c>p;)if(y=d[p++],y!=y)return!0;}else for(;c>p;p++)if((a||p in d)&&d[p]===s)return a||p||0;return!a&&-1;};};},/* 113 */ /***/function(h,r,t){var e=t(114),n=Math.min;h.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 */ /***/function(h,r){var t=Math.ceil,e=Math.floor;h.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 */ /***/function(h,r,t){var e=t(114),n=Math.max,i=Math.min;h.exports=function(a,o){return a=e(a),a<0?n(a+o,0):i(a,o);};},/* 116 */ /***/function(h,r,t){var e=t(117)("keys"),n=t(118);h.exports=function(i){return e[i]||(e[i]=n(i));};},/* 117 */ /***/function(h,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(h.exports=function(o,s){return a[o]||(a[o]=s!==void 0?s:{});})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 */ /***/function(h,r){var t=0,e=Math.random();h.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36));};},/* 119 */ /***/function(h,r){h.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 */ /***/function(h,r,t){var e=t(91).document;h.exports=e&&e.documentElement;},/* 121 */ /***/function(h,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");h.exports=function(a,o,s){a&&!n(a=s?a:a.prototype,i)&&e(a,i,{configurable:!0,value:o});};},/* 122 */ /***/function(h,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",o=h.exports=function(s){return e[s]||(e[s]=a&&i[s]||(a?i:n)("Symbol."+s));};o.store=e;},/* 123 */ /***/function(h,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;h.exports=Object.getPrototypeOf||function(o){return o=n(o),e(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?a:null;};},/* 124 */ /***/function(h,r,t){var e=t(87);h.exports=function(n){return Object(e(n));};},/* 125 */ /***/function(h,r,t){var e=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,i=this._i,a;return i>=n.length?{value:void 0,done:!0}:(a=e(n,i),this._i+=a.length,{value:a,done:!1});});},/* 126 */ /***/function(h,r,t){var e=t(114),n=t(87);h.exports=function(i){return function(a,o){var s=String(n(a)),l=e(o),d=s.length,c,p;return l<0||l>=d?i?"":void 0:(c=s.charCodeAt(l),c<55296||c>56319||l+1===d||(p=s.charCodeAt(l+1))<56320||p>57343?i?s.charAt(l):c:i?s.slice(l,l+2):(c-55296<<10)+(p-56320)+65536);};};},/* 127 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).isIterable=function(a){var o=Object(a);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(e(o));};},/* 128 */ /***/function(h,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(/* @__PURE__ */function(){return arguments;}())=="Arguments",a=function a(o,s){try{return o[s];}catch(_unused12){}};h.exports=function(o){var s,l,d;return o===void 0?"Undefined":o===null?"Null":typeof(l=a(s=Object(o),n))=="string"?l:i?e(s):(d=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":d;};},/* 129 */ /***/function(h,r,t){h.exports={"default":t(130),__esModule:!0};},/* 130 */ /***/function(h,r,t){t(79),t(125),h.exports=t(131);},/* 131 */ /***/function(h,r,t){var e=t(97),n=t(132);h.exports=t(92).getIterator=function(i){var a=n(i);if(typeof a!="function")throw TypeError(i+" is not iterable!");return e(a.call(i));};},/* 132 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)];};},/* 133 */ /***/function(h,r,t){r.__esModule=!0;var e=t(134),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=function(a){if(Array.isArray(a)){for(var o=0,s=Array(a.length);o1?arguments[1]:void 0,x=v!==void 0,f=0,g=d(y),u,m,M,E;if(x&&(v=e(v,T>2?arguments[2]:void 0,2)),g!=null&&!(P==Array&&o(g)))for(E=g.call(y),m=new P();!(M=E.next()).done;f++)l(m,f,x?a(E,v,[M.value,f],!0):M.value);else for(u=s(y.length),m=new P(u);u>f;f++)l(m,f,x?v(y[f],f):y[f]);return m.length=f,m;}});},/* 137 */ /***/function(h,r,t){var e=t(97);h.exports=function(n,i,a,o){try{return o?i(e(a)[0],a[1]):i(a);}catch(l){var s=n["return"];throw s!==void 0&&e(s.call(n)),l;}};},/* 138 */ /***/function(h,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;h.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a);};},/* 139 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=function(i,a,o){a in i?e.f(i,a,n(0,o)):i[a]=o;};},/* 140 */ /***/function(h,r,t){var e=t(122)("iterator"),n=!1;try{var i=[7][e]();i["return"]=function(){n=!0;},Array.from(i,function(){throw 2;});}catch(_unused13){}h.exports=function(a,o){if(!o&&!n)return!1;var s=!1;try{var l=[7],d=l[e]();d.next=function(){return{done:s=!0};},l[e]=function(){return d;},a(l);}catch(_unused14){}return s;};},/* 141 */ /***/function(h,r,t){h.exports={"default":t(142),__esModule:!0};},/* 142 */ /***/function(h,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),h.exports=t(92).Map;},/* 143 */ /***/function(h,r){},/* 144 */ /***/function(h,r,t){var e=t(145),n=t(151),i="Map";h.exports=t(152)(i,function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)\nget:function get(o){var s=e.getEntry(n(this,i),o);return s&&s.v;},// 23.1.3.9 Map.prototype.set(key, value)\nset:function set(o,s){return e.def(n(this,i),o===0?0:o,s);}},e,!0);},/* 145 */ /***/function(h,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),o=t(147),s=t(148),l=t(88),d=t(82),c=t(149),p=t(100),y=t(150).fastKey,P=t(151),T=p?"_s":"size",v=function v(x,f){var g=y(f),u;if(g!=="F")return x._i[g];for(u=x._f;u;u=u.n)if(u.k==f)return u;};h.exports={getConstructor:function getConstructor(x,f,g,u){var m=x(function(M,E){o(M,m,f,"_i"),M._t=f,M._i=n(null),M._f=void 0,M._l=void 0,M[T]=0,E!=null&&s(E,g,M[u],M);});return i(m.prototype,{// 23.1.3.1 Map.prototype.clear()\n// 23.2.3.2 Set.prototype.clear()\nclear:function clear(){for(var E=P(this,f),R=E._i,b=E._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete R[b.i];E._f=E._l=void 0,E[T]=0;},// 23.1.3.3 Map.prototype.delete(key)\n// 23.2.3.4 Set.prototype.delete(value)\n"delete":function _delete(M){var E=P(this,f),R=v(E,M);if(R){var b=R.n,O=R.p;delete E._i[R.i],R.r=!0,O&&(O.n=b),b&&(b.p=O),E._f==R&&(E._f=b),E._l==R&&(E._l=O),E[T]--;}return!!R;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\nforEach:function forEach(E){P(this,f);for(var R=a(E,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(R(b.v,b.k,this);b&&b.r;)b=b.p;},// 23.1.3.7 Map.prototype.has(key)\n// 23.2.3.7 Set.prototype.has(value)\nhas:function has(E){return!!v(P(this,f),E);}}),p&&e(m.prototype,"size",{get:function get(){return P(this,f)[T];}}),m;},def:function def(x,f,g){var u=v(x,f),m,M;return u?u.v=g:(x._l=u={i:M=y(f,!0),// <- index\nk:f,// <- key\nv:g,// <- value\np:m=x._l,// <- previous entry\nn:void 0,// <- next entry\nr:!1// <- removed\n},x._f||(x._f=u),m&&(m.n=u),x[T]++,M!=="F"&&(x._i[M]=u)),x;},getEntry:v,setStrong:function setStrong(x,f,g){l(x,f,function(u,m){this._t=P(u,f),this._k=m,this._l=void 0;},function(){for(var u=this,m=u._k,M=u._l;M&&M.r;)M=M.p;return!u._t||!(u._l=M=M?M.n:u._t._f)?(u._t=void 0,d(1)):m=="keys"?d(0,M.k):m=="values"?d(0,M.v):d(0,[M.k,M.v]);},g?"entries":"values",!g,!0),c(f);}};},/* 146 */ /***/function(h,r,t){var e=t(95);h.exports=function(n,i,a){for(var o in i)a&&n[o]?n[o]=i[o]:e(n,o,i[o]);return n;};},/* 147 */ /***/function(h,r){h.exports=function(t,e,n,i){if(!(t instanceof e)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 */ /***/function(h,c,t){var e=t(93),n=t(137),i=t(138),a=t(97),o=t(113),s=t(132),l={},d={},c=h.exports=function(p,y,P,T,v){var x=v?function(){return p;}:s(p),f=e(P,T,y?2:1),g=0,u,m,M,E;if(typeof x!="function")throw TypeError(p+" is not iterable!");if(i(x)){for(u=o(p.length);u>g;g++)if(E=y?f(a(m=p[g])[0],m[1]):f(p[g]),E===l||E===d)return E;}else for(M=x.call(p);!(m=M.next()).done;)if(E=n(M,f,m.value,y),E===l||E===d)return E;};c.BREAK=l,c.RETURN=d;},/* 149 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),o=t(122)("species");h.exports=function(s){var l=typeof n[s]=="function"?n[s]:e[s];a&&l&&!l[o]&&i.f(l,o,{configurable:!0,get:function get(){return this;}});};},/* 150 */ /***/function(h,r,t){var e=t(118)("meta"),n=t(98),i=t(105),a=t(96).f,o=0,s=Object.isExtensible||function(){return!0;},l=!t(101)(function(){return s(Object.preventExtensions({}));}),d=function d(T){a(T,e,{value:{i:"O"+ ++o,// object ID\nw:{}// weak collections IDs\n}});},c=function c(T,v){if(!n(T))return _typeof(T)=="symbol"?T:(typeof T=="string"?"S":"P")+T;if(!i(T,e)){if(!s(T))return"F";if(!v)return"E";d(T);}return T[e].i;},p=function p(T,v){if(!i(T,e)){if(!s(T))return!0;if(!v)return!1;d(T);}return T[e].w;},y=function y(T){return l&&P.NEED&&s(T)&&!i(T,e)&&d(T),T;},P=h.exports={KEY:e,NEED:!1,fastKey:c,getWeak:p,onFreeze:y};},/* 151 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 */ /***/function(h,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),o=t(95),s=t(146),l=t(148),d=t(147),c=t(98),p=t(121),y=t(96).f,P=t(153)(0),T=t(100);h.exports=function(v,x,f,g,u,m){var M=e[v],E=M,R=u?"set":"add",b=E&&E.prototype,O={};return!T||typeof E!="function"||!(m||b.forEach&&!a(function(){new E().entries().next();}))?(E=g.getConstructor(x,v,u,R),s(E.prototype,f),i.NEED=!0):(E=x(function(L,w){d(L,E,v,"_c"),L._c=new M(),w!=null&&l(w,u,L[R],L);}),P("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var w=L=="add"||L=="set";L in b&&!(m&&L=="clear")&&o(E.prototype,L,function(I,A){if(d(this,E,L),!w&&m&&!c(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,A);return w?this:W;});}),m||y(E.prototype,"size",{get:function get(){return this._c.size;}})),p(E,v),O[v]=E,n(n.G+n.W+n.F,O),m||g.setStrong(E,v,u),E;};},/* 153 */ /***/function(h,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),o=t(154);h.exports=function(s,l){var d=s==1,c=s==2,p=s==3,y=s==4,P=s==6,T=s==5||P,v=l||o;return function(x,f,g){for(var u=i(x),m=n(u),M=e(f,g,3),E=a(m.length),R=0,b=d?v(x,E):c?v(x,0):void 0,O,L;E>R;R++)if((T||R in m)&&(O=m[R],L=M(O,R,u),s)){if(d)b[R]=L;else if(L)switch(s){case 3:return!0;case 5:return O;case 6:return R;case 2:b.push(O);}else if(y)return!1;}return P?-1:p||y?y:b;};};},/* 154 */ /***/function(h,r,t){var e=t(155);h.exports=function(n,i){return new(e(n))(i);};},/* 155 */ /***/function(h,r,t){var e=t(98),n=t(156),i=t(122)("species");h.exports=function(a){var o;return n(a)&&(o=a.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),e(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 */ /***/function(h,r,t){var e=t(86);h.exports=Array.isArray||function(i){return e(i)=="Array";};},/* 157 */ /***/function(h,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")});},/* 158 */ /***/function(h,r,t){var e=t(128),n=t(159);h.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn\'t generic");return n(this);};};},/* 159 */ /***/function(h,r,t){var e=t(148);h.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a;};},/* 160 */ /***/function(h,r,t){t(161)("Map");},/* 161 */ /***/function(h,r,t){var e=t(90);h.exports=function(n){e(e.S,n,{of:function of(){for(var a=arguments.length,o=new Array(a);a--;)o[a]=arguments[a];return new this(o);}});};},/* 162 */ /***/function(h,r,t){t(163)("Map");},/* 163 */ /***/function(h,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);h.exports=function(o){e(e.S,o,{from:function from(l){var d=arguments[1],c,p,y,P;return n(this),c=d!==void 0,c&&n(d),l==null?new this():(p=[],c?(y=0,P=i(d,arguments[2],2),a(l,!1,function(T){p.push(P(T,y++));})):a(l,!1,p.push,p),new this(p));}});};},/* 164 */ /***/function(h,r,t){h.exports={"default":t(165),__esModule:!0};},/* 165 */ /***/function(h,r,t){t(166),h.exports=t(92).Object.assign;},/* 166 */ /***/function(h,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),o=t(124),s=t(85),l=Object.assign;h.exports=!l||t(101)(function(){var d={},c={},p=Symbol(),y="abcdefghijklmnopqrst";return d[p]=7,y.split("").forEach(function(P){c[P]=P;}),l({},d)[p]!=7||Object.keys(l({},c)).join("")!=y;})?function(c,p){for(var y=o(c),P=arguments.length,T=1,v=i.f,x=a.f;P>T;)for(var f=s(arguments[T++]),g=v?n(f).concat(v(f)):n(f),u=g.length,m=0,M;u>m;)M=g[m++],(!e||x.call(f,M))&&(y[M]=f[M]);return y;}:l;},/* 168 */ /***/function(h,r){r.f=Object.getOwnPropertySymbols;},/* 169 */ /***/function(h,r){r.f={}.propertyIsEnumerable;},/* 170 */ /***/function(h,r,t){r.__esModule=!0,r["default"]=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 */ /***/function(h,r,t){r.__esModule=!0;var e=t(172),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=/* @__PURE__ */function(){function a(o,s){for(var l=0;lyt;)_$2(ot,Tt=mt[yt++],ft[Tt]);return ot;},C=function C(ot,ft){return ft===void 0?R(ot):S(R(ot),ft);},D=function D(ot){var ft=nt.call(this,ot=M(ot,!0));return this===ht&&n(tt,ot)&&!n(J,ot)?!1:ft||!n(this,ot)||!n(tt,ot)||n(this,G)&&this[G][ot]?ft:!0;},j=function j(ot,ft){if(ot=m(ot),ft=M(ft,!0),!(ot===ht&&n(tt,ft)&&!n(J,ft))){var mt=A(ot,ft);return mt&&n(tt,ft)&&!(n(ot,G)&&ot[G][ft])&&(mt.enumerable=!0),mt;}},H=function H(ot){for(var ft=z(m(ot)),mt=[],yt=0,pt;ft.length>yt;)!n(tt,pt=ft[yt++])&&pt!=G&&pt!=s&&mt.push(pt);return mt;},V=function V(ot){for(var ft=ot===ht,mt=z(ft?J:m(ot)),yt=[],pt=0,Tt;mt.length>pt;)n(tt,Tt=mt[pt++])&&(!ft||n(ht,Tt))&&yt.push(tt[Tt]);return yt;};dt||(_K2=function K(){if(this instanceof _K2)throw TypeError("Symbol is not a constructor!");var ot=p(arguments.length>0?arguments[0]:void 0),_ft=function ft(mt){this===ht&&_ft.call(J,mt),n(this,G)&&n(this[G],ot)&&(this[G][ot]=!1),Y(this,ot,E(1,mt));};return i&&F&&Y(ht,ot,{configurable:!0,set:_ft}),X(ot);},o(_K2[U],"toString",function(){return this._k;}),O.f=j,w.f=_$2,t(182).f=b.f=H,t(169).f=D,L.f=V,i&&!t(89)&&o(ht,"propertyIsEnumerable",D,!0),P.f=function(at){return X(y(at));}),a(a.G+a.W+a.F*!dt,{Symbol:_K2});for(var Q=// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;Q.length>it;)y(Q[it++]);for(var st=I(y.store),ct=0;st.length>ct;)T(st[ct++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)\n"for":function _for(at){return n(rt,at+="")?rt[at]:rt[at]=_K2(at);},// 19.4.2.5 Symbol.keyFor(sym)\nkeyFor:function keyFor(ot){if(!N(ot))throw TypeError(ot+" is not a symbol!");for(var ft in rt)if(rt[ft]===ot)return ft;},useSetter:function useSetter(){F=!0;},useSimple:function useSimple(){F=!1;}}),a(a.S+a.F*!dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])\ncreate:C,// 19.1.2.4 Object.defineProperty(O, P, Attributes)\ndefineProperty:_$2,// 19.1.2.3 Object.defineProperties(O, Properties)\ndefineProperties:S,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\ngetOwnPropertyDescriptor:j,// 19.1.2.7 Object.getOwnPropertyNames(O)\ngetOwnPropertyNames:H,// 19.1.2.8 Object.getOwnPropertySymbols(O)\ngetOwnPropertySymbols:V});var gt=l(function(){L.f(1);});a(a.S+a.F*gt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(ot){return L.f(u(ot));}}),k&&a(a.S+a.F*(!dt||l(function(){var at=_K2();return q([at])!="[null]"||q({a:at})!="{}"||q(Object(at))!="{}";})),"JSON",{stringify:function stringify(ot){for(var ft=[ot],mt=1,yt,pt;arguments.length>mt;)ft.push(arguments[mt++]);if(pt=yt=ft[1],!(!g(yt)&&ot===void 0||N(ot)))return x(yt)||(yt=function yt(Tt,Rt){if(typeof pt=="function"&&(Rt=pt.call(this,Tt,Rt)),!N(Rt))return Rt;}),ft[1]=yt,q.apply(k,ft);}}),_K2[U][Z]||t(95)(_K2[U],Z,_K2[U].valueOf),c(_K2,"Symbol"),c(Math,"Math",!0),c(e.JSON,"JSON",!0);},/* 178 */ /***/function(h,r,t){r.f=t(122);},/* 179 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),o=t(96).f;h.exports=function(s){var l=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in l)&&o(l,s,{value:a.f(s)});};},/* 180 */ /***/function(h,r,t){var e=t(110),n=t(168),i=t(169);h.exports=function(a){var o=e(a),s=n.f;if(s)for(var l=s(a),d=i.f,c=0,p;l.length>c;)d.call(a,p=l[c++])&&o.push(p);return o;};},/* 181 */ /***/function(h,r,t){var e=t(84),n=t(182).f,i={}.toString,a=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(s){try{return n(s);}catch(_unused15){return a.slice();}};h.exports.f=function(l){return a&&i.call(l)=="[object Window]"?o(l):n(e(l));};},/* 182 */ /***/function(h,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n);};},/* 183 */ /***/function(h,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),o=t(105),s=t(99),l=Object.getOwnPropertyDescriptor;r.f=t(100)?l:function(c,p){if(c=i(c),p=a(p,!0),s)try{return l(c,p);}catch(_unused16){}if(o(c,p))return n(!e.f.call(c,p),c[p]);};},/* 184 */ /***/function(h,r,t){t(179)("asyncIterator");},/* 185 */ /***/function(h,r,t){t(179)("observable");},/* 186 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.createNowTime=e,r.formatDelay=n;function e(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame\n"default":function _default(n,i,a,o,s){return typeof n=="number"&&typeof i=="number"?n+(a-o)/(s-o)*(i-n):a-o>s-a?i:n;}};},/* 188 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.parseEasing=r.Easings=void 0;var e=t(76),n=l(e),i=t(133),a=l(i),o=t(141),s=l(o);function l(x){return x&&x.__esModule?x:{"default":x};}var d=t(189),c=new s["default"]();function p(){for(var x=arguments.length,f=Array(x),g=0;g1&&arguments[1]!==void 0?arguments[1]:"end";return function(g,u){for(var m=1;m0?g=E:f=E;while(Math.abs(M)>n&&++R=e?T(b,A,f,u):W===0?A:P(b,O,O+o,f,u);}return function(O){return O===0?0:O===1?1:p(R(O),g,m);};};},/* 190 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=g(e),i=t(204),a=g(i),o=t(164),s=g(o),l=t(170),d=g(l),c=t(171),p=g(c),y=t(175),P=g(y),T=t(75),v=g(T),x=t(208),f=t(188);function g(W){return W&&W.__esModule?W:{"default":W};}var u=(0,P["default"])("timing"),m=(0,P["default"])("keyframes"),M=(0,P["default"])("initState"),E=(0,P["default"])("readyDefer"),R=(0,P["default"])("finishedDefer"),b=(0,P["default"])("effects"),O=(0,P["default"])("activeReadyTimer"),L=(0,P["default"])("activeFinishTimer"),w=(0,P["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},A=function(){function W(z,K,k){var q=this;if((0,d["default"])(this,W),Array.isArray(z)){var U=[z[0],z,K];z=U[0],K=U[1],k=U[2];}typeof k=="number"&&(k={duration:k}),this[u]=(0,s["default"])({},I,k),this[u].easing=(0,f.parseEasing)(this[u].easing),this[m]=(0,x.calculateFramesOffset)(K);var G=this[m][this[m].length-1];this[M]={},(0,a["default"])(G).forEach(function(Z){Object.prototype.hasOwnProperty.call(z,Z)&&Z!=="easing"&&Z!=="offset"&&(q[M][Z]=z[Z]);}),this[m]=this[m].map(function(Z){return(0,s["default"])({},q[M],Z);}),this[m][0].offset!==0&&this[m].unshift((0,s["default"])({},this[M],{offset:0})),G.offset<1&&this[m].push((0,s["default"])({},G,{offset:1})),this[b]={},this.timeline=null;}return(0,p["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:O,value:function value(){var K=this;this[E]&&!this[E].timerID&&(this.timeline.currentTime<0?this[E].timerID=this.timeline.setTimeout(function(){K[E].resolve(),delete K[E];},{delay:-this.timeline.currentTime,heading:!1}):this[E].timerID=this.timeline.setTimeout(function(){K[E].resolve(),delete K[E];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var K=this,k=this[u],q=k.duration,U=k.iterations,G=k.endDelay,Z=Math.ceil(q*U+G-this.timeline.currentTime)+1;this[R]&&!this[R].timerID&&(this[R].timerID=this.timeline.setTimeout(function(){K[R].resolve(),K[w](E),K[w](R);},{delay:Z,heading:!1}),this[R].reverseTimerID=this.timeline.setTimeout(function(){K[R].resolve(),K[w](E),K[w](R),K.timeline=null;},{delay:-this[u].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var K=this[u],k=K.delay,q=K.playbackRate,U=K.timeline;this.timeline=new v["default"]({originTime:k,playbackRate:q},U),this[O](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[O]());}},{key:w,value:function value(K){var k=this[K],q=this.timeline;k&&q&&(q.clearTimeout(k.timerID),k.reverseTimerID&&q.clearTimeout(k.reverseTimerID)),delete this[K];}},{key:"cancel",value:function value(){this[w](E),this[w](R),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[w](E),this[w](R);}},{key:"applyEffects",value:function value(K){return(0,s["default"])(this[b],K);}},{key:"playbackRate",get:function get(){return this[u].playbackRate;},set:function set(K){this.timeline&&(this.timeline.playbackRate=K),this[u].playbackRate=K;}},{key:"playState",get:function get(){var K=this.timeline,k=this[u],q=k.iterations,U=k.duration,G=k.endDelay,Z="running";if(K==null)Z="idle";else if(K.paused)Z="paused";else if(K.currentTime<0)Z="pending";else{var nt=K.currentTime-q*U;nt>0&&nt=G&&(Z="finished");}return Z;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var K=this[u],k=K.duration,q=K.iterations,U=this.timeline,G=this.playState,Z=void 0;if(G==="idle")Z=0;else if(G==="paused"&&U.currentTime<0)Z=0;else if(G==="pending"){if(U.currentTime<0)Z=0;else{var nt=U.seekLocalTime(q*k);Z=(0,x.periodicity)(nt,k)[1]/k;}}else(G==="running"||G==="paused")&&(Z=(0,x.periodicity)(U.currentTime,k)[1]/k);return G==="finished"&&(Z=(0,x.periodicity)(q,1)[1]),Z;}},{key:"frame",get:function get(){var K=this.playState,k=this[M],q=this[u].fill;if(K==="idle")return k;var U=this.timeline.currentTime,G=this[m].slice(0),Z=(0,x.getProgress)(this.timeline,this[u],this.progress),nt=Z.p,rt=Z.inverted,tt=k;return U<0&&K==="pending"?(q==="backwards"||q==="both")&&(tt=rt?G[G.length-1]:G[0]):(K!=="pending"&&K!=="finished"||q==="forwards"||q==="both")&&(tt=(0,x.getCurrentFrame)(this[u],G,this[b],nt)),tt;}},{key:"timing",get:function get(){return this[u];}},{key:"effects",get:function get(){return this[b];}},{key:"baseTimeline",set:function set(K){this[u].timeline=K;},get:function get(){return this[u].timeline;}},{key:"ready",get:function get(){return this[E]?this[E].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[E]=(0,x.defer)(),this.timeline&&this[O](),this[E]?this[E].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[R]||(this[R]=(0,x.defer)(),this.timeline&&this[L]()),this[R].promise);}}]),W;}();r["default"]=A;},/* 191 */ /***/function(h,r,t){h.exports={"default":t(192),__esModule:!0};},/* 192 */ /***/function(h,r,t){t(143),t(125),t(79),t(193),t(202),t(203),h.exports=t(92).Promise;},/* 193 */ /***/function(h,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),o=t(90),s=t(98),l=t(94),d=t(147),c=t(148),p=t(194),y=t(195).set,P=t(197)(),T=t(198),v=t(199),x=t(200),f=t(201),g="Promise",u=n.TypeError,m=n.process,M=m&&m.versions,E=M&&M.v8||"",_R=n[g],b=a(m)=="process",O=function O(){},L,w,I,A,W=w=T.f,z=!!function(){try{var rt=_R.resolve(1),tt=(rt.constructor={})[t(122)("species")]=function(J){J(O,O);};return(b||typeof PromiseRejectionEvent=="function")&&rt.then(O)instanceof tt&&E.indexOf("6.6")!==0&&x.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),K=function K(rt){var tt;return s(rt)&&typeof(tt=rt.then)=="function"?tt:!1;},k=function k(rt,tt){if(!rt._n){rt._n=!0;var J=rt._c;P(function(){for(var ht=rt._v,dt=rt._s==1,B=0,F=function F(Y){var X=dt?Y.ok:Y.fail,N=Y.resolve,$=Y.reject,S=Y.domain,C,D,j;try{X?(dt||(rt._h==2&&G(rt),rt._h=1),X===!0?C=ht:(S&&S.enter(),C=X(ht),S&&(S.exit(),j=!0)),C===Y.promise?$(u("Promise-chain cycle")):(D=K(C))?D.call(C,N,$):N(C)):$(ht);}catch(H){S&&!j&&S.exit(),$(H);}};J.length>B;)F(J[B++]);rt._c=[],rt._n=!1,tt&&!rt._h&&q(rt);});}},q=function q(rt){y.call(n,function(){var tt=rt._v,J=U(rt),ht,dt,B;if(J&&(ht=v(function(){b?m.emit("unhandledRejection",tt,rt):(dt=n.onunhandledrejection)?dt({promise:rt,reason:tt}):(B=n.console)&&B.error&&B.error("Unhandled promise rejection",tt);}),rt._h=b||U(rt)?2:1),rt._a=void 0,J&&ht.e)throw ht.v;});},U=function U(rt){return rt._h!==1&&(rt._a||rt._c).length===0;},G=function G(rt){y.call(n,function(){var tt;b?m.emit("rejectionHandled",rt):(tt=n.onrejectionhandled)&&tt({promise:rt,reason:rt._v});});},Z=function Z(rt){var tt=this;tt._d||(tt._d=!0,tt=tt._w||tt,tt._v=rt,tt._s=2,tt._a||(tt._a=tt._c.slice()),k(tt,!0));},_nt3=function nt(rt){var tt=this,J;if(!tt._d){tt._d=!0,tt=tt._w||tt;try{if(tt===rt)throw u("Promise can\'t be resolved itself");(J=K(rt))?P(function(){var ht={_w:tt,_d:!1};try{J.call(rt,i(_nt3,ht,1),i(Z,ht,1));}catch(dt){Z.call(ht,dt);}}):(tt._v=rt,tt._s=1,k(tt,!1));}catch(ht){Z.call({_w:tt,_d:!1},ht);}}};z||(_R=function R(tt){d(this,_R,g,"_h"),l(tt),L.call(this);try{tt(i(_nt3,this,1),i(Z,this,1));}catch(J){Z.call(this,J);}},L=function L(tt){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},L.prototype=t(146)(_R.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\nthen:function then(tt,J){var ht=W(p(this,_R));return ht.ok=typeof tt=="function"?tt:!0,ht.fail=typeof J=="function"&&J,ht.domain=b?m.domain:void 0,this._c.push(ht),this._a&&this._a.push(ht),this._s&&k(this,!1),ht.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)\n"catch":function _catch(rt){return this.then(void 0,rt);}}),I=function I(){var rt=new L();this.promise=rt,this.resolve=i(_nt3,rt,1),this.reject=i(Z,rt,1);},T.f=W=function W(rt){return rt===_R||rt===A?new I(rt):w(rt);}),o(o.G+o.W+o.F*!z,{Promise:_R}),t(121)(_R,g),t(149)(g),A=t(92)[g],o(o.S+o.F*!z,g,{// 25.4.4.5 Promise.reject(r)\nreject:function reject(tt){var J=W(this),ht=J.reject;return ht(tt),J.promise;}}),o(o.S+o.F*(e||!z),g,{// 25.4.4.6 Promise.resolve(x)\nresolve:function resolve(tt){return f(e&&this===A?_R:this,tt);}}),o(o.S+o.F*!(z&&t(140)(function(rt){_R.all(rt)["catch"](O);})),g,{// 25.4.4.1 Promise.all(iterable)\nall:function all(tt){var J=this,ht=W(J),dt=ht.resolve,B=ht.reject,F=v(function(){var Y=[],X=0,N=1;c(tt,!1,function($){var S=X++,C=!1;Y.push(void 0),N++,J.resolve($).then(function(D){C||(C=!0,Y[S]=D,--N||dt(Y));},B);}),--N||dt(Y);});return F.e&&B(F.v),ht.promise;},// 25.4.4.4 Promise.race(iterable)\nrace:function race(tt){var J=this,ht=W(J),dt=ht.reject,B=v(function(){c(tt,!1,function(F){J.resolve(F).then(ht.resolve,dt);});});return B.e&&dt(B.v),ht.promise;}});},/* 194 */ /***/function(h,r,t){var e=t(97),n=t(94),i=t(122)("species");h.exports=function(a,o){var s=e(a).constructor,l;return s===void 0||(l=e(s)[i])==null?o:n(l);};},/* 195 */ /***/function(h,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,l=o.setImmediate,d=o.clearImmediate,c=o.MessageChannel,p=o.Dispatch,y=0,P={},T="onreadystatechange",v,x,f,g=function g(){var m=+this;if(P.hasOwnProperty(m)){var M=P[m];delete P[m],M();}},u=function u(m){g.call(m.data);};(!l||!d)&&(l=function l(M){for(var E=[],R=1;arguments.length>R;)E.push(arguments[R++]);return P[++y]=function(){n(typeof M=="function"?M:Function(M),E);},v(y),y;},d=function d(M){delete P[M];},t(86)(s)=="process"?v=function v(m){s.nextTick(e(g,m,1));}:p&&p.now?v=function v(m){p.now(e(g,m,1));}:c?(x=new c(),f=x.port2,x.port1.onmessage=u,v=e(f.postMessage,f,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(v=function v(m){o.postMessage(m+"","*");},o.addEventListener("message",u,!1)):T in a("script")?v=function v(m){i.appendChild(a("script"))[T]=function(){i.removeChild(this),g.call(m);};}:v=function v(m){setTimeout(e(g,m,1),0);}),h.exports={set:l,clear:d};},/* 196 */ /***/function(h,r){h.exports=function(t,e,n){var i=n===void 0;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3]);}return t.apply(n,e);};},/* 197 */ /***/function(h,r,t){var e=t(91),n=t(195).set,i=e.MutationObserver||e.WebKitMutationObserver,a=e.process,o=e.Promise,s=t(86)(a)=="process";h.exports=function(){var l,d,c,p=function p(){var v,x;for(s&&(v=a.domain)&&v.exit();l;){x=l.fn,l=l.next;try{x();}catch(f){throw l?c():d=void 0,f;}}d=void 0,v&&v.enter();};if(s)c=function c(){a.nextTick(p);};else if(i&&!(e.navigator&&e.navigator.standalone)){var y=!0,P=document.createTextNode("");new i(p).observe(P,{characterData:!0}),c=function c(){P.data=y=!y;};}else if(o&&o.resolve){var T=o.resolve(void 0);c=function c(){T.then(p);};}else c=function c(){n.call(e,p);};return function(v){var x={fn:v,next:void 0};d&&(d.next=x),l||(l=x,c()),d=x;};};},/* 198 */ /***/function(h,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,l){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=l;}),this.resolve=e(a),this.reject=e(o);}h.exports.f=function(i){return new n(i);};},/* 199 */ /***/function(h,r){h.exports=function(t){try{return{e:!1,v:t()};}catch(e){return{e:!0,v:e};}};},/* 200 */ /***/function(h,r,t){var e=t(91),n=e.navigator;h.exports=n&&n.userAgent||"";},/* 201 */ /***/function(h,r,t){var e=t(97),n=t(98),i=t(198);h.exports=function(a,o){if(e(a),n(o)&&o.constructor===a)return o;var s=i.f(a),l=s.resolve;return l(o),s.promise;};},/* 202 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),o=t(201);e(e.P+e.R,"Promise",{"finally":function _finally(s){var l=a(this,n.Promise||i.Promise),d=typeof s=="function";return this.then(d?function(c){return o(l,s()).then(function(){return c;});}:s,d?function(c){return o(l,s()).then(function(){throw c;});}:s);}});},/* 203 */ /***/function(h,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{"try":function _try(a){var o=n.f(this),s=i(a);return(s.e?o.reject:o.resolve)(s.v),o.promise;}});},/* 204 */ /***/function(h,r,t){h.exports={"default":t(205),__esModule:!0};},/* 205 */ /***/function(h,r,t){t(206),h.exports=t(92).Object.keys;},/* 206 */ /***/function(h,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a));};});},/* 207 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(101);h.exports=function(a,o){var s=(n.Object||{})[a]||Object[a],l={};l[a]=o(s),e(e.S+e.F*i(function(){s(1);}),"Object",l);};},/* 208 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=P(e),i=t(209),a=P(i),o=t(164),s=P(o),l=t(191),d=P(l);r.defer=T,r.periodicity=v,r.calculateFramesOffset=x,r.getProgress=f,r.getCurrentFrame=u;var c=t(188),p=t(187),y=P(p);function P(m){return m&&m.__esModule?m:{"default":m};}function T(){var m={};return m.promise=new d["default"](function(M,E){m.resolve=M,m.reject=E;}),m;}function v(m,M){var E=Math.floor(m/M),R=m-E*M;return R===0&&E>0&&(R=M,E--),[E,R];}function x(m){m=m.slice(0);var M=m[0],E=m[m.length-1];E.offset=E.offset||1,M.offset=M.offset||0;for(var R=0,b=-1,O=0;O1)for(var I=(L.offset-R)/w,A=0;A0){var W=m[O].easing!=null;m[O]=(0,s["default"])({},m[O-1],m[O]),W||delete m[O].easing;}}return m;}function f(m,M,E){var R=m.currentTime,b=M.direction,O=M.duration,L=!1;if(b==="reverse")E=1-E,L=!0;else if(b==="alternate"||b==="alternate-reverse"){var w=Math.floor(R/O);E===1&&w--,w%2^b==="alternate-reverse"&&(E=1-E,L=!0);}return{p:E,inverted:L};}function g(m,M,E,R){var b={};return(0,a["default"])(M).forEach(function(O){var L=(0,n["default"])(O,2),w=L[0],I=L[1];if(w!=="offset"&&w!=="easing"){var A=E[w]||E["default"],W=A(m[w],I,R,m.offset,M.offset);W!=null&&(b[w]=W);}}),b;}function u(m,M,E,R){var b=m.easing,O=m.effect;O||(E=(0,s["default"])({},y["default"],E));var L={};R=b(R,M);for(var w=1;w=R||w===M.length-1){var W=M[w-1],z=W.offset,K=W.easing,k=R;if(K){var q=A-z;k=K((R-z)/q)*q+z;}O?L=O(W,I,k,z,A):L=g(W,I,E,k);break;}}return L;}},/* 209 */ /***/function(h,r,t){h.exports={"default":t(210),__esModule:!0};},/* 210 */ /***/function(h,r,t){t(211),h.exports=t(92).Object.entries;},/* 211 */ /***/function(h,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function entries(a){return n(a);}});},/* 212 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;h.exports=function(o){return function(s){for(var l=i(s),d=n(l),c=d.length,p=0,y=[],P;c>p;)P=d[p++],(!e||a.call(l,P))&&y.push(o?[P,l[P]]:l[P]);return y;};};},/* 213 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);var e=/* @__PURE__ */new Map();function n(a){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];a=a.toLowerCase();var l=e.get(a);if(!l)throw new TypeError("Invalid node: ".concat(a));var d=new l(o);return s.forEach(function(c){d.appendChild(c);}),d;}var i={registerNode:function registerNode(a,o){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),e.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));e.set(o,a),Object.defineProperties(a.prototype,{nodeType:{value:s},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(a,o){return n(o);},isSpriteNode:function isSpriteNode(a){return e.has(a.toLowerCase());}};r["default"]=i;},/* 214 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");var o=/*#__PURE__*/function(){function o(l){var _ref116=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref116$bubbles=_ref116.bubbles,d=_ref116$bubbles===void 0?null:_ref116$bubbles;_classCallCheck(this,o);if(typeof l=="string"?(this[e]=l,this[n]=!!d):(this[e]=l.type,this[i]=l,this[n]=d!=null?!!d:!!l.bubbles,l.detail&&(this[a]=l.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(l){this[i]=l;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[e];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[a];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 */ /***/function(h,r,t){t.r(r),t.d(r,"parseFilterString",function(){return n;}),t.d(r,"applyFilters",function(){return i;});var e=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a=a.trim(),!a||a==="none")return null;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(([^()]*(?:\\(.*\\))*[^()]*)\\))+$/i,s=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(([^()]*(?:\\(.*\\))*[^()]*)\\))+?/ig),l=[];return s&&s.forEach(function(d){var c=d.match(o);if(!c)throw new TypeError("Invalid fitler string.");var _c3=_slicedToArray(c,3),p=_c3[1],y=_c3[2];p=p.toLowerCase(),y=y.trim().match(/([^( )]+|([^( )]+\\(.*\\)))(?=\\s|$)/g).map(function(P,T){var v;return p==="url"||p==="drop-shadow"&&T===3?v=P:v=Object(e.toNumber)(P),/%$/.test(P)&&(v/=100),v;}),l.push({type:p,args:y});}),l;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref117){var s=_ref117.type,l=_ref117.args;var d=s;d==="drop-shadow"?d="dropShadow":d==="hue-rotate"&&(d="hueRotate"),a[d].apply(a,_toConsumableArray(l));});}},/* 216 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i){if(!i)return;var a=n.getListeners("beforerender"),o=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=function(s){n.dispatchEvent({type:"beforerender",detail:{context:s}});}:a.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(s){n.dispatchEvent({type:"afterrender",detail:{context:s}});}:o.length||(i.afterRender=null);}},/* 217 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(12),n=t(218),i=t(70),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("amount"),s=Symbol("meshCloud");var l=/*#__PURE__*/function(_i$default){function l(c){var _this28;var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,l);_this28=_callSuper(this,l),_this28.meshNode=c,c.connect(_assertThisInitialized(_this28)),_this28[o]=p,_this28[s]=null;return _this28;}_inherits(l,_i$default);return _createClass(l,[{key:"meshCloud",get:function get(){var c=this.meshNode,p=this[o];return!this[s]&&c.mesh&&(this[s]=new e.MeshCloud(c.mesh,p)),this[s];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(c){this[o]=c,this[s]&&(this[s].amount=c);}},{key:"brightness",value:function brightness(c,p){this.meshCloud&&(this.meshCloud.brightness(c,p),this.forceUpdate());}},{key:"contrast",value:function contrast(c,p){this.meshCloud&&(this.meshCloud.contrast(c,p),this.forceUpdate());}},{key:"delete",value:function _delete(c){this.meshCloud&&(this.meshCloud["delete"](c),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this29=this;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(l,"draw",this,3)([c]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var p=this.shaderAttrs;p&&Object.entries(p).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),P=_ref119[0],T=_ref119[1];_this29.meshCloud.mesh.setAttribute(P,T);});var y=this.uniforms;if(this.uniforms){var P={};Object.entries(y).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),T=_ref121[0],v=_ref121[1];typeof v=="function"&&(v=v(_this29,T)),P[T]=v;}),this.meshCloud.mesh.setUniforms(P);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),c.push(this.meshCloud);}return c;}},{key:"getTransform",value:function getTransform(c){if(this.meshCloud)return this.meshCloud.getTransform(c);}},{key:"grayscale",value:function grayscale(c,p){this.meshCloud&&(this.meshCloud.grayscale(c,p),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(c,p){this.meshCloud&&(this.meshCloud.hueRotate(c,p),this.forceUpdate());}},{key:"invert",value:function invert(c,p){this.meshCloud&&(this.meshCloud.invert(c,p),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(c,p){if(!this.meshCloud)return!1;var y=this.attributes.pointerEvents;if(y==="none"||y!=="all"&&!this.isVisible)return!1;var P="both";y==="visibleFill"&&(P="fill"),y==="visibleStroke"&&(P="stroke");for(var T=0;T2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),y=_ref123[0],P=_ref123[1];var T=Math.PI*p/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,v=_this$meshNode$attrib.x,_x29=_this$meshNode$attrib.y;this.meshCloud.rotate(c,T,[y+v,P+_x29]),this.forceUpdate();}}},{key:"saturate",value:function saturate(c,p){this.meshCloud&&(this.meshCloud.saturate(c,p),this.forceUpdate());}},{key:"scale",value:function scale(c,_ref124){var _ref125=_slicedToArray(_ref124,2),p=_ref125[0],_ref125$=_ref125[1],y=_ref125$===void 0?p:_ref125$;var _ref126=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref127=_slicedToArray(_ref126,2),P=_ref127[0],T=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,v=_this$meshNode$attrib2.x,_x30=_this$meshNode$attrib2.y,_f12=1e-5;Math.abs(p)<_f12&&(p=1/p>0?_f12:-_f12),Math.abs(y)<_f12&&(y=1/y>0?_f12:-_f12),this.meshCloud.scale(c,[p,y],[P+v,T+_x30]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(c,p){this.meshCloud&&(this.meshCloud.setColorTransform(c,p),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(c,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setFillColor(c,p),this.forceUpdate());}},{key:"sepia",value:function sepia(c,p){this.meshCloud&&(this.meshCloud.sepia(c,p),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref128){var c=_ref128.width,p=_ref128.height;_superPropGet(l,"setResolution",this,3)([{width:c,height:p}]),this.meshNode.setResolution({width:c,height:p});}},{key:"setStrokeColor",value:function setStrokeColor(c,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setStrokeColor(c,p),this.forceUpdate());}},{key:"setTransform",value:function setTransform(c,p){this.meshCloud&&(this.meshCloud.setTransform(c,p),this.forceUpdate());}},{key:"skew",value:function skew(c,_ref129){var _ref130=_slicedToArray(_ref129,2),p=_ref130[0],_ref130$=_ref130[1],y=_ref130$===void 0?p:_ref130$;var _ref131=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref132=_slicedToArray(_ref131,2),P=_ref132[0],T=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,v=_this$meshNode$attrib3.x,_x31=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[p,y],[P+v,T+_x31]),this.forceUpdate();}}},{key:"transform",value:function transform(c,p){this.meshCloud&&(this.meshCloud.transform(c,p),this.forceUpdate());}},{key:"transformColor",value:function transformColor(c,p){this.meshCloud&&(this.meshCloud.transformColor(c,p),this.forceUpdate());}},{key:"translate",value:function translate(c,_ref133){var _ref134=_slicedToArray(_ref133,2),p=_ref134[0],y=_ref134[1];this.meshCloud&&(this.meshCloud.translate(c,[p,y]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(l,"cloud");},/* 218 */ /***/function(h,r,t){t.r(r),t.d(r,"loadTexture",function(){return a;}),t.d(r,"applyTexture",function(){return o;}),t.d(r,"createTexture",function(){return l;}),t.d(r,"deleteTexture",function(){return d;}),t.d(r,"drawTexture",function(){return p;}),t.d(r,"loadFrames",function(){return y;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(P,T){if(i[P])return i[P];var v=e.ENV.loadImage(P,{alias:T,useImageBitmap:!1});return v!==null&&v!==void 0?v:P;}function o(_x32,_x33,_x34){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(P,T,v){var x,_P$attributes,_f13,g,u,m;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:x=T;typeof T=="string"&&(x=a(T));_context18.t0=x&&typeof x.then=="function";if(!_context18.t0){_context18.next=7;break;}_context18.next=6;return x;case 6:x=_context18.sent;case 7:if(!(T===P.attributes.texture)){_context18.next=11;break;}x&&x.image&&(x.sourceRect&&(P.attributes.sourceRect=x.sourceRect),P.textureImageRotated=!!x.rotated,x=x.image);_P$attributes=P.attributes,_f13=_P$attributes.width,g=_P$attributes.height,u=_P$attributes.textureRect,m=P.textureImage;P.textureImage=x,v&&m!==x&&!u&&(_f13==null||g==null)&&P.updateContours(),P.forceUpdate();case 11:return _context18.abrupt("return",x);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function l(P,T){if(T[s]=T[s]||/* @__PURE__ */new Map(),T[s].has(P))return T[s].get(P);var v=T.createTexture(P);return!/^blob:/.test(P.src)&&typeof P.getContext!="function"&&T[s].set(P,v),v;}function d(P,T){if(T[s]&&T[s].has(P)){var v=T[s].get(P);return T.deleteTexture(v),T[s]["delete"](P),!0;}return!1;}var c=Symbol("textureContext");function p(P,T){var v=P.textureImage instanceof String?String(P.textureImage):P.textureImage,x=P.textureImageRotated,f=T.texture,g=P.renderer;if(v){var u=P.originalContentRect;var m=P.attributes.textureRect;var M=P.attributes.textureRepeat,E=P.attributes.sourceRect;if(!f||P[c]&&P[c]!==g||f.image!==v||f.options.repeat!==M||!Object(n.compareValue)(f.options.rect,m)||!Object(n.compareValue)(f.options.srcRect,E)){var R=l(v,g);m?(m[0]+=u[0],m[1]+=u[1]):m=u;var b=null;f&&!g[s].has(f.image)&&(!f.options||!f.options.hidden)&&(b=T.uniforms.u_texSampler),T.setTexture(R,{rect:m,repeat:M,srcRect:E,rotated:x}),b&&b["delete"]&&b["delete"](),P[c]=g;}}else if(f){var _u8=null;!g[s].has(f.image)&&(!f.options||!f.options.hidden)&&(_u8=T.uniforms.u_texSampler),T.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function y(_x35,_x36){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(P,T){var v,x;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.t0=typeof T=="string";if(!_context19.t0){_context19.next=7;break;}_context19.next=4;return fetch(T,{method:"GET",mode:"cors",cache:"default"});case 4:_context19.next=6;return _context19.sent.json();case 6:T=_context19.sent;case 7:_context19.next=9;return a(P);case 9:v=_context19.sent;x=T.frames;return _context19.abrupt("return",(Object.entries(x).forEach(function(_ref135){var _ref136=_slicedToArray(_ref135,2),f=_ref136[0],g=_ref136[1];var _g$frame=g.frame,u=_g$frame.x,m=_g$frame.y,M=_g$frame.w,E=_g$frame.h;var R=[u,m,M,E];var b=g.rotated;b&&(R=[R[0],R[1],R[3],R[2]]),i[f]={image:v,sourceRect:R,rotated:b};}),v));case 12:case"end":return _context19.stop();}},_callee19);}));return _y5.apply(this,arguments);}},/* 219 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(1),n=t(12),i=t(70),a=t(220),o=t(221),s=t(222),l=t(213),d=t(223);t(1).glMatrix.setMatrixArrayType(Array);function c(P,T,v){return T in P?Object.defineProperty(P,T,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[T]=v,P;}var p=Symbol("mesh");var y=/*#__PURE__*/function(_i$default2){function y(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);return _callSuper(this,y,[T]);}_inherits(y,_i$default2);return _createClass(y,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,T=_this$attributes2.paddingTop,v=_this$attributes2.paddingRight,x=_this$attributes2.paddingBottom,f=_this$attributes2.paddingLeft,g=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],m=_this$contentSize[1];return[f+u+v+g,T+m+x+g];}// content + padding\n},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,T=_this$attributes3.paddingTop,v=_this$attributes3.paddingRight,x=_this$attributes3.paddingBottom,f=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),g=_this$contentSize2[0],u=_this$contentSize2[1];return[f+g+v,T+u+x];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,T=_this$attributes4.width,v=_this$attributes4.height,x=_this$attributes4.boxSizing,f=_this$attributes4.paddingTop,g=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,m=_this$attributes4.paddingLeft;if(T=T||0,v=v||0,x==="border-box"){var M=2*this.attributes.borderWidth;T-=M+g+m,v-=M+f+u,T=Math.max(0,T),v=Math.max(0,v);}return[T,v];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),T=_this$borderSize[0],v=_this$borderSize[1];return T>0&&v>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var T=this.clientBox;if(T){var _v5;var v=this[p];if(v)v.box!==T&&(v.contours=T.contours,v.box=T);else{v=new n.Mesh2D(T),v.box=T;var _f14=this.attributes.bgcolor;if(Object(o.setFillColor)(v,{color:_f14}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,m=_this$attributes5.borderWidth,M=_this$attributes5.borderDash,E=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(v,{color:u,lineWidth:m,lineDash:M,lineDashOffset:E});}this[p]=v;var g=this.attributes.clipPath;g&&this[p].setClipPath(g);}var _x37=this.opacity;return v.getOpacity()!==_x37&&v.setOpacity(_x37),(_v5=v).setTransform.apply(_v5,_toConsumableArray(this.renderMatrix)),v;}return null;}// content + padding + border\n},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,T=_this$attributes6.paddingTop,v=_this$attributes6.paddingRight,x=_this$attributes6.paddingBottom,f=_this$attributes6.paddingLeft,g=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),u=_this$contentSize3[0],m=_this$contentSize3[1],M=2*g;return[f+u+v+M,T+m+x+M];}},{key:"originalClientRect",get:function get(){if(this.mesh){var T=this.mesh.boundingBox;return[T[0][0],T[0][1],T[1][0]-T[0][0],T[1][1]-T[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),T=_this$originalClientR[0],v=_this$originalClientR[1],x=_this$originalClientR[2],f=_this$originalClientR[3],g=this.attributes.padding;return[T+g[0],v+g[1],x-g[0]-g[2],f-g[1]-g[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var T=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(T=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,T));var v=null;if(this.mesh){v=_toConsumableArray(this.mesh.boundingBox);var _x38=this.attributes.borderWidth;_x38&&(v[0]=[v[0][0]-_x38,v[0][1]-_x38],v[1]=[v[1][0]+_x38,v[1][1]+_x38]);}return Object(d["default"])(v,T);}// transformPoint(x, y) {\n// const m = mat2d.invert(this.renderMatrix);\n// const newX = x * m[0] + y * m[2] + m[4];\n// const newY = x * m[1] + y * m[3] + m[5];\n// return [newX, newY];\n// }\n/* override */},{key:"onPropertyChange",value:function onPropertyChange(T,v,x){if(_superPropGet(y,"onPropertyChange",this,3)([T,v,x]),(T==="anchorX"||T==="anchorY"||T==="boxSizing"||T==="width"||T==="height"||T==="borderWidth"||T==="paddingLeft"||T==="paddingRight"||T==="paddingTop"||T==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(T))&&this.updateContours(),this[p]&&T==="clipPath"&&this[p].setClipPath(v),this[p]&&T==="bgcolor"&&Object(o.setFillColor)(this[p],{color:v}),this[p]&&(T==="borderColor"||T==="borderWidth"||T==="borderDash"||T==="borderDashOffset")){var _this$attributes7=this.attributes,_f15=_this$attributes7.borderColor,g=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,m=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[p],{color:_f15,lineWidth:g,lineDash:g?u:0,lineDashOffset:m});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,T=_this$attributes8.anchorX,v=_this$attributes8.anchorY,x=_this$attributes8.borderWidth,f=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),g=_this$borderSize2[0],u=_this$borderSize2[1],m=this.offsetSize,M=0.5*x,E=-T*m[0]+M,R=-v*m[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[E,R,g,u],f);}}]);}(i["default"]);c(y,"Attr",a["default"]),l["default"].registerNode(y,"block");},/* 220 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return d;});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_declareAlias");var d=/*#__PURE__*/function(_e$default){function d(p){var _this30;_classCallCheck(this,d);_this30=_callSuper(this,d,[p]),_this30[s]({anchorX:0,anchorY:0,/* anchor */width:void 0,height:void 0,/* size */borderWidth:0,borderColor:"rgba(0,0,0,1)",/* border */borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],/* borderRadius */bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,/* padding */boxSizing:"content-box",clipPath:void 0}),_this30[l]("anchor","size","border","borderRadius","padding");return _this30;}_inherits(d,_e$default);return _createClass(d,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(p){this[a]("anchorX",Object(n.toNumber)(p));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(p){this[a]("anchorY",Object(n.toNumber)(p));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.anchorX=p[0],this.anchorY=p[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(p){this[a]("width",Object(n.toNumber)(p));}},{key:"height",get:function get(){return this[o]("height");},set:function set(p){this[a]("height",Object(n.toNumber)(p));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(p){this[a]("borderWidth",Object(n.toNumber)(p));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(p){this[a]("borderColor",Object(i.parseColor)(p));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p]),this.borderWidth=p[0],p[1]!=null&&(this.borderColor=p[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(p){p=Object(n.toArray)(p,!0),p!=null&&!Array.isArray(p)&&(p=[p]),this[a]("borderDash",p?p.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(p){this[a]("borderDashOffset",Object(n.toNumber)(p));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopLeftRadius",p.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopRightRadius",p.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomRightRadius",p.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomLeftRadius",p.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(p){if(p=Object(n.toArray)(p),!Array.isArray(p))p=Array(8).fill(p);else if(p.length===2)p=[p[0],p[1],p[0],p[1],p[0],p[1],p[0],p[1]];else if(p.length===4)p=[p[0],p[1],p[2],p[3],p[0],p[1],p[2],p[3]];else if(p.length===6)p=[p[0],p[1],p[2],p[3],p[4],p[5],p[2],p[3]];else if(p.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[p[0],p[1]],this.borderTopRightRadius=[p[2],p[3]],this.borderBottomRightRadius=[p[4],p[5]],this.borderBottomLeftRadius=[p[6],p[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(p){this[a]("bgcolor",Object(i.parseColor)(p));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(p){this[a]("paddingTop",Object(n.toNumber)(p));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(p){this[a]("paddingRight",Object(n.toNumber)(p));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(p){this[a]("paddingBottom",Object(n.toNumber)(p));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(p){this[a]("paddingLeft",Object(n.toNumber)(p));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)?p.length===2?p=[p[0],p[1],p[0],p[1]]:p.length===3&&(p=[p[0],p[1],p[2],p[1]]):p=[p,p,p,p],this.paddingTop=p[0],this.paddingRight=p[1],this.paddingBottom=p[2],this.paddingLeft=p[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(p){this[a]("clipPath",p);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(p){if(p!=null&&p!=="border-box"&&p!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",p);}}]);}(e["default"]);},/* 221 */ /***/function(h,r,t){t.r(r),t.d(r,"Gradient",function(){return i;}),t.d(r,"isTransparent",function(){return a;}),t.d(r,"parseColor",function(){return o;}),t.d(r,"setFillColor",function(){return l;}),t.d(r,"setStrokeColor",function(){return d;}),t.d(r,"Color",function(){return c;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref137){var y=_ref137.vector,P=_ref137.colors;_classCallCheck(this,i);if(!Array.isArray(y)||y.length!==4&&y.length!==6&&y.length!==3)throw new TypeError("Invalid gradient");this.vector=y,this.colors=P.map(function(_ref138){var T=_ref138.offset,v=_ref138.color;return{offset:T,color:o(v)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(p){return p instanceof i?!1:p==null?!0:n()(p)[3]===0;}function o(p){if(p==null||(p||(p="transparent"),p instanceof i))return p;var y=n()(p);if(!y||!y.length)throw new TypeError("Invalid color value.");return"rgba(".concat(y.join(),")");}function s(p,y,P){var T=p.boundingBox[0];if(P.vector){var v=P.vector,_x39=P.colors;v.length===4?(v=[v[0]+T[0],v[1]+T[1],v[2]+T[0],v[3]+T[1]],p.setLinearGradient({vector:v,colors:_x39,type:y})):v.length===3?(v=[v[0]+T[0],v[1]+T[1],v[2]],p.setCircularGradient({vector:v,colors:_x39,type:y})):(v=[v[0]+T[0],v[1]+T[1],v[2],v[3]+T[0],v[4]+T[1],v[5]],p.setRadialGradient({vector:v,colors:_x39,type:y}));}else p.gradient&&p.gradient[y]&&(delete p.gradient[y],delete p.uniforms.u_radialGradientVector);}function l(p,_ref139){var y=_ref139.color,_ref139$rule=_ref139.rule,P=_ref139$rule===void 0?"nonzero":_ref139$rule;return s(p,"fill",y),y.vector||p.setFill({color:y,rule:P}),p;}function d(p,_ref140){var y=_ref140.color,P=_ref140.lineWidth,T=_ref140.lineCap,v=_ref140.lineJoin,x=_ref140.lineDash,f=_ref140.lineDashOffset,g=_ref140.miterLimit,u=_ref140.roundSegments;s(p,"stroke",y),y.vector&&(y=[0,0,0,1]),p.setStroke({color:y,thickness:P,cap:T,join:v,miterLimit:g,lineDash:x,lineDashOffset:f,roundSegments:u});}var c=/*#__PURE__*/function(_Array){function c(){var _y6,_y7,_n2,_n3;var _this31;var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var v=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,c);return _possibleConstructorReturn(_this31,(Array.isArray(y)&&(_y6=y,_y7=_slicedToArray(_y6,4),y=_y7[0],P=_y7[1],T=_y7[2],v=_y7[3],_y6),typeof y=="string"&&((_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],P=_n3[1],T=_n3[2],v=_n3[3]),y/=255,P/=255,T/=255),_this31=_callSuper(this,c,[y,P,T,v]),_assertThisInitialized(_this31)));}_inherits(c,_Array);return _createClass(c,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(y){this[0]=y/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(y){this[1]=y/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(y){this[2]=y/255;}},{key:"a",get:function get(){return this[3];},set:function set(y){this[3]=y;}},{key:"hex",get:function get(){var y="0".concat(this.r.toString(16)).slice(-2),P="0".concat(this.g.toString(16)).slice(-2),T="0".concat(this.b.toString(16)).slice(-2);var v;return this.a<1&&(v=Math.round(this[3]*255),v="0".concat(v.toString(16)).slice(-2)),"#".concat(y).concat(P).concat(T).concat(v||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(y){return typeof y=="string"&&(y=n()(y),y[0]/=255,y[1]/=255,y[2]/=255),this[0]=y[0],this[1]=y[1],this[2]=y[2],this[3]=y[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 */ /***/function(h,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,l){var d=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var c=0.5522848,p=s/2*c,y=l/2*c,P=a+s,T=o+l,v=a+s/2,x=o+l/2;d==="leftTop"?(i.moveTo(a,x),i.bezierCurveTo(a,x-y,v-p,o,v,o)):d==="rightTop"?i.bezierCurveTo(v+p,o,P,x-y,P,x):d==="rightBottom"?i.bezierCurveTo(P,x+y,v+p,T,v,T):d==="leftBottom"&&i.bezierCurveTo(v-p,T,a,x+y,a,x);}function n(i,_ref141,d){var _ref142=_slicedToArray(_ref141,4),a=_ref142[0],o=_ref142[1],s=_ref142[2],l=_ref142[3];if(!d||Array.isArray(d)&&d.every(function(c){return c===0;}))i.beginPath(),i.rect(a,o,s,l);else{typeof d=="number"&&(d=Array(8).fill(d));var _d$map=d.map(function(g,u){return u%2?Math.min(g,l/2):Math.min(g,s/2);}),_d$map2=_slicedToArray(_d$map,8),c=_d$map2[0],p=_d$map2[1],y=_d$map2[2],P=_d$map2[3],T=_d$map2[4],v=_d$map2[5],_x40=_d$map2[6],_f16=_d$map2[7];i.beginPath(),i.moveTo(a,o+p),e(i,a,o,c*2,p*2,"leftTop"),i.lineTo(a+s-y,o),e(i,a+s-y*2,o,y*2,P*2,"rightTop"),i.lineTo(a+s,o+l-v),e(i,a+s-T*2,o+l-v*2,T*2,v*2,"rightBottom"),i.lineTo(a+_x40,o+l),e(i,a,o+l-_f16*2,_x40*2,_f16*2,"leftBottom"),i.closePath();}return i;}},/* 223 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array),r["default"]=function(e,n){if(!e)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _e2=_slicedToArray(e,2),_e2$=_slicedToArray(_e2[0],2),i=_e2$[0],a=_e2$[1],_e2$2=_slicedToArray(_e2[1],2),o=_e2$2[0],s=_e2$2[1],l=i*n[0]+a*n[2]+n[4],d=i*n[1]+a*n[3]+n[5],c=o*n[0]+a*n[2]+n[4],p=o*n[1]+a*n[3]+n[5],y=o*n[0]+s*n[2]+n[4],P=o*n[1]+s*n[3]+n[5],T=i*n[0]+s*n[2]+n[4],v=i*n[1]+s*n[3]+n[5],x=Math.min(l,c,y,T),f=Math.min(d,p,P,v),g=Math.max(l,c,y,T),u=Math.max(d,p,P,v);return{x:x,y:f,width:g-x,height:u-f,left:x,top:f,right:g,bottom:u};};},/* 224 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(d,c,p){return c in d?Object.defineProperty(d,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[c]=p,d;}var s=Symbol("textureTask");var l=/*#__PURE__*/function(_n$default){function l(){var _this32;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,l);typeof c=="string"&&(c={texture:c}),_this32=_callSuper(this,l,[c]);return _this32;}/* override */_inherits(l,_n$default);return _createClass(l,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(l,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),c=_superPropGet3[0],p=_superPropGet3[1];var _this$attributes9=this.attributes,y=_this$attributes9.width,P=_this$attributes9.height;if(y==null||P==null){var T=this.textureImage,v=this.attributes.textureRect,_x41=this.attributes.sourceRect;if(v)y==null&&(c=v[0]+v[2]),P==null&&(p=v[1]+v[3]);else if(_x41){var _f17=this.layer?this.layer.displayRatio:1;y==null&&(c=_x41[2]/_f17),P==null&&(p=_x41[3]/_f17);}else if(T){var _f18=this.layer?this.layer.displayRatio:1;y==null&&(c=T.width/_f18),P==null&&(p=T.height/_f18);}}return[c,p];}},{key:"textureImageReady",get:function get(){return this[s]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(l,"draw",this,3)([c]);var p=this.mesh;return p&&Object(e.drawTexture)(this,p),c;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(c,p,y){if(_superPropGet(l,"onPropertyChange",this,3)([c,p,y]),c==="texture"&&(this[s]=Object(e.applyTexture)(this,p,!0)),c==="textureRect"){var _this$attributes10=this.attributes,P=_this$attributes10.width,T=_this$attributes10.height;(P==null||T==null)&&this.updateContours();}}}]);}(n["default"]);o(l,"Attr",i["default"]),a["default"].registerNode(l,"sprite");},/* 225 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_e$default2){function o(l){var _this33;_classCallCheck(this,o);_this33=_callSuper(this,o,[l]),_this33[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this33;}_inherits(o,_e$default2);return _createClass(o,[{key:"texture",get:function get(){return this[a]("texture");},set:function set(l){this[i]("texture",l);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(l){this[i]("textureRect",l);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(l){this[i]("sourceRect",l);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(l){this[i]("textureRepeat",!!l);}}]);}(e["default"]);},/* 226 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return P;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),o=t(228),s=t(221),l=t(218),d=t(213),c=t(223);t(1).glMatrix.setMatrixArrayType(Array);function p(T,v,x){return v in T?Object.defineProperty(T,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[v]=x,T;}var y=Symbol("mesh");var P=/*#__PURE__*/function(_a$default){function P(){var _this34;var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof v=="string"&&(v={d:v}),_this34=_callSuper(this,P,[v]),_this34.effects={d:function d(x,f,g,u,m){var _i$a;var M=(g-u)/(m-u);if(M<=0)return x;if(M>=1)return f;var E=i.a._preprocessing(i.a.path2shapes(x),i.a.path2shapes(f)),R=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(E).concat([M]))[0];return R.reduce(function(O,L){return"".concat(O).concat(L.slice(2).join(" ")," ");},"M".concat(R[0][0]," ").concat(R[0][1],"C")).trim();}};return _this34;}/* override */_inherits(P,_a$default);return _createClass(P,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var v=this.path;if(v){var _x43;var _x42=this[y];if(_x42)_x42.path!==v&&(_x42.contours=v.contours,_x42.path=v);else{_x42=new e.Mesh2D(this.path),_x42.path=v;var g=this.attributes.fillColor,u=this.attributes.fillRule;g&&Object(s.setFillColor)(_x42,{color:g,rule:u});var m=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&m>0){var _this$attributes11=this.attributes,R=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,O=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,w=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_x42,{color:M,lineWidth:m,lineCap:R,lineJoin:b,miterLimit:O,lineDash:L,lineDashOffset:w,roundSegments:I});}this[y]=_x42;var E=this.attributes.clipPath;E&&this[y].setClipPath(E);}var _f19=this.opacity;return _x42.getOpacity()!==_f19&&_x42.setOpacity(_f19),(_x43=_x42).setTransform.apply(_x43,_toConsumableArray(this.renderMatrix)),_x42;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var v=this.path.boundingBox;return[v[0][0],v[0][1],v[1][0]-v[0][0],v[1][1]-v[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var v=this.mesh.boundingBox;return[v[0][0],v[0][1],v[1][0]-v[0][0],v[1][1]-v[0][1]];}return[0,0,0,0];}},{key:"originalClientCenter",get:function get(){return this.mesh?this.mesh.boundingCenter:[0,0];}},{key:"d",get:function get(){return this.attributes.d;}/* override */,set:function set(v){this.attributes.d=v;}},{key:"draw",value:function draw(){var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(P,"draw",this,3)([v]);var x=this.mesh;return x&&Object(l.drawTexture)(this,x),v;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var v=null;return this.mesh&&(v=this.mesh.boundingBox),Object(c["default"])(v,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(v){if(this.mesh){var _x44=this.mesh.getPointAtLength(v);if(_x44)return[_x44.x,_x44.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,x,f){if(_superPropGet(P,"onPropertyChange",this,3)([v,x,f]),(v==="d"||v==="normalize")&&this.updateContours(),this[y]&&(v==="fillColor"||v==="fillRule")){var _this$attributes12=this.attributes,g=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(s.setFillColor)(this[y],{color:g,rule:u});}if(this[y]&&(v==="strokeColor"||v==="lineWidth"||v==="lineCap"||v==="lineJoin"||v==="lineDash"||v==="lineDashOffset"||v==="roundSegments")){var _this$attributes13=this.attributes,_g4=_this$attributes13.strokeColor,_u9=_this$attributes13.lineWidth;if(_g4&&_u9>0){var _this$attributes14=this.attributes,m=_this$attributes14.lineCap,M=_this$attributes14.lineJoin,E=_this$attributes14.lineDash,R=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,O=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[y],{color:_g4,lineCap:m,lineJoin:M,lineWidth:_u9,lineDash:E,lineDashOffset:R,miterLimit:b,roundSegments:O});}}this[y]&&v==="clipPath"&&this[y].setClipPath(x),v==="texture"&&Object(l.applyTexture)(this,x);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);p(P,"Attr",o["default"]),d["default"].registerNode(P,"path");},/* 227 */ /***/function(h,r,t){(function(e,n){h.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(w,I){var A=[],W=!0,z=!1,K=void 0;try{for(var k=w[Symbol.iterator](),q;!(W=(q=k.next()).done)&&(A.push(q.value),!(I&&A.length===I));W=!0);}catch(U){z=!0,K=U;}finally{try{!W&&k["return"]&&k["return"]();}finally{if(z)throw K;}}return A;}return function(w,I){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return L(w,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(w,I,A,W,z,K,k){var q=w.x,U=w.y;q*=I,U*=A;var G=W*q-z*U,Z=z*q+W*U;return{x:G+K,y:Z+k};},a=function a(w,I){var A=1.3333333333333333*Math.tan(I/4),W=Math.cos(w),z=Math.sin(w),K=Math.cos(w+I),k=Math.sin(w+I);return[{x:W-z*A,y:z+W*A},{x:K+k*A,y:k-K*A},{x:K,y:k}];},o=function o(w,I,A,W){var z=w*W-I*A<0?-1:1,K=Math.sqrt(w*w+I*I),k=Math.sqrt(w*w+I*I),q=w*A+I*W,U=q/(K*k);return U>1&&(U=1),U<-1&&(U=-1),z*Math.acos(U);},s=function s(w,I,A,W,z,K,k,q,U,G,Z,nt){var rt=Math.pow(z,2),tt=Math.pow(K,2),J=Math.pow(Z,2),ht=Math.pow(nt,2),dt=rt*tt-rt*ht-tt*J;dt<0&&(dt=0),dt/=rt*ht+tt*J,dt=Math.sqrt(dt)*(k===q?-1:1);var B=dt*z/K*nt,F=dt*-K/z*Z,Y=G*B-U*F+(w+A)/2,X=U*B+G*F+(I+W)/2,N=(Z-B)/z,$=(nt-F)/K,S=(-Z-B)/z,C=(-nt-F)/K,D=o(1,0,N,$),j=o(N,$,S,C);return q===0&&j>0&&(j-=n),q===1&&j<0&&(j+=n),[Y,X,D,j];},l=function l(w){var I=w.px,A=w.py,W=w.cx,z=w.cy,K=w.rx,k=w.ry,q=w.xAxisRotation,U=q===void 0?0:q,G=w.largeArcFlag,Z=G===void 0?0:G,nt=w.sweepFlag,rt=nt===void 0?0:nt,tt=[];if(K===0||k===0)return[];var J=Math.sin(U*n/360),ht=Math.cos(U*n/360),dt=ht*(I-W)/2+J*(A-z)/2,B=-J*(I-W)/2+ht*(A-z)/2;if(dt===0&&B===0)return[];K=Math.abs(K),k=Math.abs(k);var F=Math.pow(dt,2)/Math.pow(K,2)+Math.pow(B,2)/Math.pow(k,2);F>1&&(K*=Math.sqrt(F),k*=Math.sqrt(F));var Y=s(I,A,W,z,K,k,Z,rt,J,ht,dt,B),X=e(Y,4),N=X[0],$=X[1],S=X[2],C=X[3],D=Math.max(Math.ceil(Math.abs(C)/(n/4)),1);C/=D;for(var j=0;j2&&(w.push([A].concat(W.splice(0,2))),z="l",A=A=="m"?"l":"L");;){if(W.length==d[z])return W.unshift(A),w.push(W);if(W.lengthL-1&&(z-=L),A[z]=W;}w.push(A);}return w;}function m(L){for(var w=[],I=0;IW-1&&(A-=W);};function R(L,w,I,A,W,z,K,k,q){return{left:b(L,w,I,A,W,z,K,k,q),right:b(K,k,W,z,I,A,L,w,1-q,!0)};}function b(L,w,I,A,W,z,K,k,q,U){var G=(I-L)*q+L,Z=(A-w)*q+w,nt=(W-I)*q+I,rt=(z-A)*q+A,tt=(K-W)*q+W,J=(k-z)*q+z,ht=(nt-G)*q+G,dt=(rt-Z)*q+Z,B=(tt-nt)*q+nt,F=(J-rt)*q+rt,Y=(B-ht)*q+ht,X=(F-dt)*q+dt;return U?[Y,X,ht,dt,G,Z,L,w]:[L,w,G,Z,ht,dt,Y,X];}E._splitCurves=function(L,w){for(var I=0,A=0;I=L.length-1&&(A=0);}};function O(L,w){for(var I=function I(z){var K=L[L.length-1],k=[];K.forEach(function(q){k.push(q.slice(0));}),L.push(k);},A=0;AA?O(z,I-A):IU?q=Z){G=I,K(G,1),z(G),cancelAnimationFrame(U);return;}var J=q(tt/Z);G=E._lerp(A[0],A[1],J),K(G,J),U=requestAnimationFrame(rt);};nt();},E;});},/* 228 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");var l=/*#__PURE__*/function(_e$default3){function l(c){var _this35;_classCallCheck(this,l);_this35=_callSuper(this,l,[c]),_this35[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// \'miter\' or \'bevel\' or \'round\'\nlineCap:"butt",// \'butt\' or \'square\' or \'round\'\nroundSegments:20,// default roundSegment if lineJoin or lineCap is round\nlineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this35;}_inherits(l,_e$default3);return _createClass(l,[{key:"d",get:function get(){return this[s]("d");},set:function set(c){this[o]("d",c);}},{key:"normalize",get:function get(){return this[s]("normalize");},set:function set(c){this[o]("normalize",!!c);}},{key:"fillColor",get:function get(){return this[s]("fillColor");},set:function set(c){this[o]("fillColor",Object(n.parseColor)(c));}},{key:"fillRule",get:function get(){return this[s]("fillRule");},set:function set(c){if(c!=null&&c!=="nonzero"&&c!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",c);}},{key:"strokeColor",get:function get(){return this[s]("strokeColor");},set:function set(c){this[o]("strokeColor",Object(n.parseColor)(c));}},{key:"lineWidth",get:function get(){return this[s]("lineWidth");},set:function set(c){this[o]("lineWidth",Object(i.toNumber)(c));}},{key:"lineJoin",get:function get(){return this[s]("lineJoin");},set:function set(c){if(c!=null&&c!=="miter"&&c!=="bevel"&&c!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",c);}},{key:"lineCap",get:function get(){return this[s]("lineCap");},set:function set(c){if(c!=null&&c!=="butt"&&c!=="square"&&c!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",c);}},{key:"lineDash",get:function get(){return this[s]("lineDash");},set:function set(c){c=Object(i.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c]),this[o]("lineDash",c?c.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[s]("lineDashOffset");},set:function set(c){this[o]("lineDashOffset",Object(i.toNumber)(c));}},{key:"miterLimit",get:function get(){return this[s]("miterLimit");},set:function set(c){this[o]("miterLimit",Object(i.toNumber)(c));}},{key:"roundSegments",get:function get(){return this[s]("roundSegments");},set:function set(c){this[o]("roundSegments",c);}},{key:"texture",get:function get(){return this[s]("texture");},set:function set(c){this[o]("texture",c);}},{key:"textureRect",get:function get(){return this[s]("textureRect");},set:function set(c){this[o]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[s]("sourceRect");},set:function set(c){this[o]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[s]("textureRepeat");},set:function set(c){this[o]("textureRepeat",!!c);}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(c){this[o]("clipPath",c);}}]);}(e["default"]);},/* 229 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,s;}var o=/*#__PURE__*/function(_e$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,l=_this$attributes15.width,d=_this$attributes15.height;return l>0&&d>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return d;});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_declareAlias");function l(c){var p=c.width,y=c.height;return"M0 0L".concat(p," 0L").concat(p," ").concat(y,"L0 ").concat(y,"Z");}var d=/*#__PURE__*/function(_e$default5){function d(p){var _this36;_classCallCheck(this,d);_this36=_callSuper(this,d,[p]),_this36[i]({width:0,height:0/* size */}),_this36[s]("size");return _this36;}// readonly\n_inherits(d,_e$default5);return _createClass(d,[{key:"d",get:function get(){return this[o]("d");},set:function set(p){}// eslint-disable-line no-empty-function\n},{key:"width",get:function get(){return this[o]("width");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("width",p)){var y=l(this);this[a]("d",y);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("height",p)){var y=l(this);this[a]("d",y);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}}]);}(e["default"]);},/* 231 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,s;}var o=/*#__PURE__*/function(_e$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default6);return _createClass(o,[{key:"isVisible",get:function get(){var l=this.attributes.sides;return l[0]>0&&l[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,s;}var o=/*#__PURE__*/function(_e$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var l=this.attributes.points;return l.length>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),l=Symbol["for"]("spritejs_declareAlias");function d(p){var y=p.points,P=p.smooth,T=p.smoothRange,v=p.close,x=[];for(var g=0;g1&&arguments[1]!==undefined?arguments[1]:[0];function a(l){var d=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var p,y,P,T;if((n[l].x===n[l+1].x||n[l].y===n[l+1].y)&&(d=0,c=0),l<1?(p=n[0].x+(n[1].x-n[0].x)*d,y=n[0].y+(n[1].y-n[0].y)*d):(p=n[l].x+(n[l+1].x-n[l-1].x)*d,y=n[l].y+(n[l+1].y-n[l-1].y)*d),l>n.length-3){var v=n.length-1;P=n[v].x-(n[v].x-n[v-1].x)*c,T=n[v].y-(n[v].y-n[v-1].y)*c;}else P=n[l+1].x-(n[l+2].x-n[l].x)*c,T=n[l+1].y-(n[l+2].y-n[l].y)*c;return[{x:p,y:y},{x:P,y:T}];}n=n.map(function(_ref143){var _ref144=_slicedToArray(_ref143,2),l=_ref144[0],d=_ref144[1];return{x:l,y:d};});var o="",s=0;return n.forEach(function(l,d){if(d===0)o+="M".concat(l.x," ").concat(l.y);else{for(;d>i[s];)s++;if(s%2){var _a3=a(d-1),_a4=_slicedToArray(_a3,2),c=_a4[0],p=_a4[1];o+="C".concat([c.x,c.y,p.x,p.y,l.x,l.y].join(" "));}else o+="L".concat(l.x," ").concat(l.y);}}),o;}},/* 235 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(d){var _d$sides=_slicedToArray(d.sides,2),c=_d$sides[0],p=_d$sides[1];var y=d.angle%360;return y<0&&(y+=360),y=Math.PI*y/180,[0,0,c,0,p*Math.cos(y),p*Math.sin(y)];}var l=/*#__PURE__*/function(_e$default9){function l(c){var _this38;_classCallCheck(this,l);_this38=_callSuper(this,l,[c]),_this38[i]({sides:[0,0],angle:60,closeType:"normal"});return _this38;}// readonly\n_inherits(l,_e$default9);return _createClass(l,[{key:"points",get:function get(){return _superPropGet(l,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function\n},{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}}]);}(e["default"]);},/* 236 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,s;}var o=/*#__PURE__*/function(_e$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var l=this.attributes.sides;return l[0]>0&&l[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(d){var _d$sides2=_slicedToArray(d.sides,2),c=_d$sides2[0],p=_d$sides2[1];var y=d.angle%360;y<0&&(y+=360),y=Math.PI*y/180;var P=p*Math.cos(y),T=p*Math.sin(y);return[0,0,c,0,P+c,T,P,T];}var l=/*#__PURE__*/function(_e$default11){function l(c){var _this39;_classCallCheck(this,l);_this39=_callSuper(this,l,[c]),_this39[i]({sides:[0,0],angle:90,closeType:"normal"});return _this39;}// readonly\n_inherits(l,_e$default11);return _createClass(l,[{key:"points",get:function get(){return _superPropGet(l,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function\n},{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}}]);}(e["default"]);},/* 238 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,s;}var o=/*#__PURE__*/function(_e$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default12);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"regular");},/* 239 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(d){var c=d.edges,p=d.radius,y=d.offsetAngle,P=Math.PI*y/180-0.5*Math.PI;if(c<3||p<=0)return[];var T=[];for(var v=0;v0&&d>0&&c!==p&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),l=Symbol["for"]("spritejs_declareAlias");function d(p){var y=p.radiusX,P=p.radiusY,T=p.startAngle,v=p.endAngle,x=p.direction,f=p.closeType,g=x==="anitclockwise",u=new e.Figure2D();return f==="sector"&&u.moveTo(0,0),u.ellipse(0,0,y,P,0,Math.PI*T/180,Math.PI*v/180,g),f!=="none"&&u.closePath(),u.path.reduce(function(E,R){return E+R.join(" ");},"");}var c=/*#__PURE__*/function(_n$default2){function c(y){var _this42;_classCallCheck(this,c);_this42=_callSuper(this,c,[y]),_this42[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise\ncloseType:"none"// none | sector | normal\n}),_this42[l]("radius","angle");return _this42;}// readonly\n_inherits(c,_n$default2);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function\n},{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusX",y)){var P=d(this);this[o]("d",P);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusY",y)){var P=d(this);this[o]("d",P);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.radiusX=y[0],this.radiusY=y[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}},{key:"direction",get:function get(){return this[s]("direction");},set:function set(y){if(y!=null&&y!=="clockwise"&&y!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",y);}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="sector"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var P=d(this);this[o]("d",P);}}}]);}(n["default"]);},/* 244 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,s;}var o=/*#__PURE__*/function(_e$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default17);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"arc");},/* 245 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_e$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_e$default18);return _createClass(i,[{key:"radius",get:function get(){return _superPropGet(i,"radiusX",this,1);},set:function set(o){o=Object(n.toNumber)(o),_superPropSet(i,"radiusX",o,this,1,1),_superPropSet(i,"radiusY",o,this,1,1);}}]);}(e["default"]);},/* 246 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,s;}var o=/*#__PURE__*/function(_e$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,l=_this$attributes17.innerRadius,d=_this$attributes17.outerRadius,c=_this$attributes17.startAngle,p=_this$attributes17.endAngle;return(l>0||d>0)&&c!==p&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),l=Symbol["for"]("spritejs_declareAlias");function d(p){var _ref145;var y=p.innerRadius,P=p.outerRadius,T=p.startAngle,v=p.endAngle;var x=new e.Figure2D();if(T=Math.PI*T/180,v=Math.PI*v/180,y>P&&(_ref145=[P,y],y=_ref145[0],P=_ref145[1],_ref145),y<=0&&x.moveTo(0,0),x.arc(0,0,P,T,v,!1),y>0){var u=Math.PI*2;v=u&&(v=T+u-1e-6),x.arc(0,0,y,v,T,!0);}return x.closePath(),x.path.reduce(function(u,m){return u+m.join(" ");},"");}var c=/*#__PURE__*/function(_n$default3){function c(y){var _this43;_classCallCheck(this,c);_this43=_callSuper(this,c,[y]),_this43[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this43[l]("radius","angle");return _this43;}// readonly\n_inherits(c,_n$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function\n},{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("innerRadius",y)){var P=d(this);this[o]("d",P);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("outerRadius",y)){var P=d(this);this[o]("d",P);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.innerRadius=y[0],this.outerRadius=y[1];}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}}]);}(n["default"]);},/* 248 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return P;});var e=t(12),n=t(218),i=t(219),a=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(T,v,x){return v in T?Object.defineProperty(T,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[v]=x,T;}var l=Symbol("textImage"),d=Symbol("textImageTask"),c=Symbol("textureContext"),p=Symbol("updateTextureRect"),y=Symbol("textCanvas");var P=/*#__PURE__*/function(_i$default3){function P(){var _this44;var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof v=="string"&&(v={text:v}),_this44=_callSuper(this,P,[v]);return _this44;}/* override */_inherits(P,_i$default3);return _createClass(P,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(P,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),v=_superPropGet5[0],x=_superPropGet5[1];var _this$attributes18=this.attributes,f=_this$attributes18.width,g=_this$attributes18.height;if(f==null||g==null){var u=this[l];u&&(f==null&&(v=u.rect[2]),g==null&&(x=u.rect[3]));}return[v,x];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(v){this.attributes.text=v;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(v){this.attributes.text=v;}},{key:"textImage",get:function get(){return this[l]||{};}},{key:"textImageReady",get:function get(){return this[d]||Promise.resolve();}/* override */},{key:"draw",value:function draw(v){_superPropGet(P,"draw",this,3)([v]);var x=this.mesh;if(x){var _f22=this[l];if(_f22){var g=x.texture;if(!g||this[c]&&this[c]!==this.renderer||_f22.needsUpdate?(_f22.needsUpdate=!1,Object(n.deleteTexture)(_f22.image,this.renderer),g=Object(n.createTexture)(_f22.image,this.renderer),this[p]=!0):g=x.uniforms.u_texSampler,this[p]){var _f22$rect$slice=_f22.rect.slice(2),_f22$rect$slice2=_slicedToArray(_f22$rect$slice,2),u=_f22$rect$slice2[0],m=_f22$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),M=_this$contentSize4[0],E=_this$contentSize4[1],R=this.attributes.textAlign,b=this.attributes.verticalAlign;var O=0;R==="center"?O=(M-u)/2:(R==="right"||R==="end")&&(O=M-u);var L=this.attributes.fontSize,w=this.attributes.lineHeight;var I=0;b==="top"?I=(L-w)/2:b==="bottom"&&(I=(w-L)/2);var _this$attributes19=this.attributes,A=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,z=this.attributes.borderWidth;O+=A+z,I+=W+z;var _this$attributes20=this.attributes,K=_this$attributes20.anchorX,k=_this$attributes20.anchorY;O-=this.offsetSize[0]*K,I-=this.offsetSize[1]*k,x.setTexture(g,{rect:[O,I,u,m]}),this[p]=!1,this[c]=this.renderer;}}}return v;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,x,f){v==="text"||v==="fontSize"||v==="fontFamily"||v==="fontStyle"||v==="fontVariant"||v==="fontWeight"||v==="fontStretch"||v==="lineHeight"||v==="strokeColor"||v==="fillColor"||v==="strokeWidth"?this.updateText():((v==="textAlign"||v==="verticalAlign")&&(this[p]=!0),_superPropGet(P,"onPropertyChange",this,3)([v,x,f]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(P,"updateContours",this,3)([]),this[p]=!0;}},{key:"updateText",value:function updateText(){var _this45=this;this[d]||(this[d]=Promise.resolve().then(function(){_this45[d]=null;var _this45$attributes=_this45.attributes,v=_this45$attributes.text,x=_this45$attributes.font,f=_this45$attributes.fillColor,g=_this45$attributes.strokeColor,u=_this45$attributes.strokeWidth,m=_this45.layer?_this45.layer.displayRatio:1;return _this45[y]=_this45[y]||e.ENV.createCanvas(1,1),_this45[l]=e.ENV.createText(v,{font:x,fillColor:f,strokeColor:g,strokeWidth:u,parseFont:e.parseFont,ratio:m,textCanvas:_this45[y]}),_this45[l].needsUpdate=!0,_this45.updateContours(),_this45.forceUpdate(),_this45[l];}));}}]);}(i["default"]);s(P,"Attr",a["default"]),o["default"].registerNode(P,"label");},/* 249 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),d=Symbol["for"]("spritejs_declareAlias");var c=/*#__PURE__*/function(_a$default2){function c(y){var _this46;_classCallCheck(this,c);_this46=_callSuper(this,c,[y]),_this46[o]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this46[d]("font");return _this46;}_inherits(c,_a$default2);return _createClass(c,[{key:"text",get:function get(){return this[l]("text")||" ";},set:function set(y){this[s]("text",y);}},{key:"fontSize",get:function get(){return this[l]("fontSize");},set:function set(y){this[s]("fontSize",Object(n.toNumber)(y));}},{key:"fontFamily",get:function get(){return this[l]("fontFamily");},set:function set(y){this[s]("fontFamily",y);}},{key:"fontStyle",get:function get(){return this[l]("fontStyle");},set:function set(y){this[s]("fontStyle",y);}},{key:"fontVariant",get:function get(){return this[l]("fontVariant");},set:function set(y){this[s]("fontVariant",y);}},{key:"fontWeight",get:function get(){return this[l]("fontWeight");},set:function set(y){this[s]("fontWeight",y);}},{key:"fontStretch",get:function get(){return this[l]("fontStretch");},set:function set(y){this[s]("fontStretch",y);}},{key:"lineHeight",get:function get(){return this[l]("lineHeight")||this.fontSize;},set:function set(y){this[s]("lineHeight",Object(n.toNumber)(y));}},{key:"textAlign",get:function get(){return this[l]("textAlign");},set:function set(y){this[s]("textAlign",y);}},{key:"strokeColor",get:function get(){return this[l]("strokeColor");},set:function set(y){this[s]("strokeColor",Object(i.parseColor)(y));}},{key:"strokeWidth",get:function get(){return this[l]("strokeWidth");},set:function set(y){this[s]("strokeWidth",Object(n.toNumber)(y));}},{key:"verticalAlign",get:function get(){return this[l]("verticalAlign");},set:function set(y){this[s]("verticalAlign",y);}},{key:"fillColor",get:function get(){return this[l]("fillColor");},set:function set(y){this[s]("fillColor",Object(i.parseColor)(y));}},{key:"font",get:function get(){var y=this.fontStyle,P=this.fontVariant,T=this.fontWeight,v=this.fontStretch,x=this.fontSize,f=this.lineHeight,g=this.fontFamily;return"".concat(y," ").concat(P," ").concat(T," ").concat(v," ").concat(x,"px/").concat(f,"px ").concat(g);},set:function set(y){if(y==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var P=Object(e.parseFont)(y);this.fontStyle=P.style,this.fontVariant=P.variant,this.fontWeight=P.weight,this.fontStretch=P.stretch,this.fontSize=Object(n.toNumber)("".concat(P.size).concat(P.unit)),P.lineHeight&&(this.lineHeight=P.pxLineHeight),this.fontFamily=P.family;}}}]);}(a["default"]);},/* 250 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(12),n=t(219),i=t(251),a=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function s(P,T,v){return T in P?Object.defineProperty(P,T,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[T]=v,P;}var l=Symbol("zOrder"),d=Symbol("ordered"),c=Symbol("children"),p=Symbol("sealed");var y=/*#__PURE__*/function(_n$default4){function y(){var _this47;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);_this47=_callSuper(this,y,[T]),_this47[c]=[],_this47[d]=null,_this47[l]=0;return _this47;}_inherits(y,_n$default4);return _createClass(y,[{key:"childNodes",get:function get(){return this[c];}},{key:"children",get:function get(){return this[c];}},{key:"orderedChildren",get:function get(){return this[d]||(this[d]=_toConsumableArray(this[c]),this[d].sort(function(T,v){return T.zIndex-v.zIndex||T.zOrder-v.zOrder;})),this[d];}},{key:"append",value:function append(){var _this48=this;for(var _len12=arguments.length,T=new Array(_len12),_key12=0;_key12<_len12;_key12++){T[_key12]=arguments[_key12];}return T.map(function(v){return _this48.appendChild(v);});}},{key:"appendChild",value:function appendChild(T){return T.remove(),this[c].push(T),T.connect(this,this[l]++),this[d]&&(this[d].length&&T.zIndex 0 && this[_children].length > 0;\n// }\n/* override */},{key:"cloneNode",value:function cloneNode(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var v=_superPropGet(y,"cloneNode",this,3)([]);return T&&this[c].forEach(function(x){var f=x.cloneNode(T);v.appendChild(f);}),v;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(T){var v=this.orderedChildren;for(var _x47=v.length-1;_x47>=0;_x47--)if(v[_x47].dispatchPointerEvent(T))return!0;return _superPropGet(y,"dispatchPointerEvent",this,3)([T]);}/* override */},{key:"draw",value:function draw(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(y,"draw",this,3)([T]),!this[p]&&this.attributes.display!=="none"){var v=this.orderedChildren;for(var _x48=0;_x48=0;v--)T[v].remove();}},{key:"removeChild",value:function removeChild(T){var v=this[c].indexOf(T);if(v>=0){if(this[c].splice(v,1),this[d]){var _x49=this[d].indexOf(T);this[d].splice(_x49,1);}return T.disconnect(this),T;}return null;}},{key:"reorder",value:function reorder(){this[d]=null;}},{key:"seal",value:function seal(){function T(g,u){var m=[];for(var M=0;M-1;){for(f=g=v[x],v[x]=null,u=!0;g;){if(v.indexOf(g)>-1){u=!1,v.splice(x,1);break;}g=s(g);}u&&(v[x]=f);}return v;}var d={isTag:a,existsOne:function existsOne(v,x){return x.some(function(f){return a(f)?v(f)||d.existsOne(v,o(f)):!1;});},getSiblings:function getSiblings(v){var x=s(v);return x&&o(x);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(v,x){if(v.nodeType===1&&x==="class"||x==="id")return v[x];if(this.hasAttrib(v,x)){var _f24=v.attributes[x];return Array.isArray(_f24)&&(_f24="[".concat(_f24.join(),"]")),String(_f24);}},hasAttrib:function hasAttrib(v,x){return v.attributes[x]!=null;},removeSubsets:l,getName:function getName(v){return v.tagName?v.tagName.toLowerCase():null;},findOne:function v(x,f){var g=null;for(var u=0,m=f.length;u0&&(g=v(x,M));}return g;},findAll:function v(x,f){var g=[];for(var u=0,m=f.length;u\nComment:"comment",//\x3c!-- ... --\x3e\nScript:"script",//