@netless/appliance-plugin 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,437 @@
1
+ var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["render"],_excluded4=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],t.indexOf(o)>=0||{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)>=0)continue;t[n]=r[n];}return t;}function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=_superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1;}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f);}else _defineProperty(o,r,t);return!0;},set(e,r,t,o);}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t;}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},e:function e(r){throw r;},f:F};}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 o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=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<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=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<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}var Ei=Object.defineProperty;var Ai=function Ai(f,r,t){return r in f?Ei(f,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):f[r]=t;};var nt=function nt(f,r,t){return Ai(f,_typeof(r)!="symbol"?r+"":r,t),t;};var Vt=/* @__PURE__ */function(f){return f.Normal="Normal",f.Stroke="Stroke",f.Dotted="Dotted",f.LongDotted="LongDotted",f;}(Vt||{}),Lt=/* @__PURE__ */function(f){return f.None="None",f.ShowFloatBar="ShowFloatBar",f.ZIndexFloatBar="ZIndexFloatBar",f.DeleteNode="DeleteNode",f.CopyNode="CopyNode",f.ZIndexActive="ZIndexActive",f.ZIndexNode="ZIndexNode",f.RotateNode="RotateNode",f.SetColorNode="SetColorNode",f.TranslateNode="TranslateNode",f.ScaleNode="ScaleNode",f.OriginalEvent="OriginalEvent",f.CreateScene="CreateScene",f.ActiveCursor="ActiveCursor",f.MoveCursor="MoveCursor",f.CommandEditor="CommandEditor",f.SetEditorData="SetEditorData",f.SetFontStyle="SetFontStyle",f.SetPoint="SetPoint",f.SetLock="SetLock",f.SetShapeOpt="SetShapeOpt",f.CameraChange="CameraChange",f.ActiveMethod="ActiveMethod",f;}(Lt||{}),gt=/* @__PURE__ */function(f){return f[f.Pencil=1]="Pencil",f[f.Eraser=2]="Eraser",f[f.Selector=3]="Selector",f[f.Clicker=4]="Clicker",f[f.Arrow=5]="Arrow",f[f.Hand=6]="Hand",f[f.LaserPen=7]="LaserPen",f[f.Text=8]="Text",f[f.Straight=9]="Straight",f[f.Rectangle=10]="Rectangle",f[f.Ellipse=11]="Ellipse",f[f.Star=12]="Star",f[f.Triangle=13]="Triangle",f[f.Rhombus=14]="Rhombus",f[f.Polygon=15]="Polygon",f[f.SpeechBalloon=16]="SpeechBalloon",f[f.Image=17]="Image",f;}(gt||{}),Tt=/* @__PURE__ */function(f){return f[f.Local=1]="Local",f[f.Service=2]="Service",f[f.Worker=3]="Worker",f;}(Tt||{}),It=/* @__PURE__ */function(f){return f[f.Pending=0]="Pending",f[f.Start=1]="Start",f[f.Doing=2]="Doing",f[f.Done=3]="Done",f[f.Unwritable=4]="Unwritable",f;}(It||{}),ft=/* @__PURE__ */function(f){return f[f.None=0]="None",f[f.Init=1]="Init",f[f.UpdateCamera=2]="UpdateCamera",f[f.UpdateTools=3]="UpdateTools",f[f.CreateWork=4]="CreateWork",f[f.DrawWork=5]="DrawWork",f[f.FullWork=6]="FullWork",f[f.UpdateNode=7]="UpdateNode",f[f.RemoveNode=8]="RemoveNode",f[f.Clear=9]="Clear",f[f.Select=10]="Select",f[f.Destroy=11]="Destroy",f[f.Snapshot=12]="Snapshot",f[f.BoundingBox=13]="BoundingBox",f[f.Cursor=14]="Cursor",f[f.TextUpdate=15]="TextUpdate",f[f.GetTextActive=16]="GetTextActive",f[f.TasksQueue=17]="TasksQueue",f[f.CursorHover=18]="CursorHover",f[f.CursorBlur=19]="CursorBlur",f[f.Console=20]="Console",f;}(ft||{}),me=/* @__PURE__ */function(f){return f.Webgl2="webgl2",f.Webgl="webgl",f.Canvas2d="2d",f;}(me||{}),xt=/* @__PURE__ */function(f){return f[f.None=0]="None",f[f.Bg=1]="Bg",f[f.ServiceFloat=2]="ServiceFloat",f[f.Float=3]="Float",f[f.TopFloat=4]="TopFloat",f;}(xt||{}),zt=/* @__PURE__ */function(f){return f[f.none=1]="none",f[f.all=2]="all",f[f.both=3]="both",f[f.proportional=4]="proportional",f;}(zt||{}),xe=/* @__PURE__ */function(f){return f[f.inside=0]="inside",f[f.outside=1]="outside",f[f.intersect=2]="intersect",f;}(xe||{});var te=/*#__PURE__*/function(){function te(){_classCallCheck(this,te);nt(this,"localWork");nt(this,"serviceWork");nt(this,"scene");}return _createClass(te,[{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.localWork=r,this.serviceWork=t,this.scene=e,this;}}]);}();var Ci=/*#__PURE__*/function(_te){function Ci(){var _this;_classCallCheck(this,Ci);_this=_callSuper(this,Ci,arguments);nt(_this,"emitEventType",Lt.CopyNode);return _this;}_inherits(Ci,_te);return _createClass(Ci,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.FullWork&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,e;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:e=t.workId;_context.t0=e;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t,this.scene);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(te);var pr="++",wt="selector",Ri="all";var Ii=/*#__PURE__*/function(_te2){function Ii(){var _this2;_classCallCheck(this,Ii);_this2=_callSuper(this,Ii,arguments);nt(_this2,"emitEventType",Lt.SetColorNode);return _this2;}_inherits(Ii,_te2);return _createClass(Ii,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context2.t0=e===wt&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context2.stop();}},_callee2,this);}));function consumeForLocalWorker(_x2){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=e.textUpdateForWoker,c=n.render||[],p=n.sp||[];if(a){var _iterator2=_createForOfIteratorHelper(i.entries()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=_slicedToArray(_step2.value,2),h=_step2$value[0],v=_step2$value[1];s&&v.toolsType===gt.Text?p.push(_objectSpread(_objectSpread({},v),{},{workId:h,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},v),{},{workId:h,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:c,sp:p};}}]);}(te);var Li=/*#__PURE__*/function(_te3){function Li(){var _this3;_classCallCheck(this,Li);_this3=_callSuper(this,Li,arguments);nt(_this3,"emitEventType",Lt.ZIndexNode);return _this3;}_inherits(Li,_te3);return _createClass(Li,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context3.t0=e===wt&&n;if(!_context3.t0){_context3.next=5;break;}_context3.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context3.stop();}},_callee3,this);}));function consumeForLocalWorker(_x3){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],c=n.sp||[];if(a&&c){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),p=_step3$value[0],h=_step3$value[1];c.push(_objectSpread(_objectSpread({},h),{},{workId:p,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:c};}}]);}(te);var bi=/*#__PURE__*/function(_te4){function bi(){var _this4;_classCallCheck(this,bi);_this4=_callSuper(this,bi,arguments);nt(_this4,"emitEventType",Lt.TranslateNode);return _this4;}_inherits(bi,_te4);return _createClass(bi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var p,h,e,n,i,a,o,s,c;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker,c=t.emitEventType;_context4.t0=e===wt&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===It.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==It.Done)){_context4.next=8;break;}_context4.next=6;return(p=this.localWork)==null?void 0:p.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:c,scene:this.scene,callback:this.updateSelectorCallback});case 6:_context4.next=9;break;case 8:n.workState===It.Done&&((h=this.localWork)==null||h.vNodes.deleteLastTarget());case 9:case"end":return _context4.stop();}},_callee4,this);}));function consumeForLocalWorker(_x4){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=e.updateSelectorOpt,h=e.textUpdateForWoker,v=p.workState,y=n.render||[],M=n.sp||[];if(v===It.Start)return{sp:[],render:[]};var T=o==null?void 0:o.selectRect;if(s){M.push({type:ft.Select,selectIds:a.selectIds,selectRect:T,willSyncService:!0,isSync:!0,points:v===It.Done&&a.getChildrenPoints()||void 0,textOpt:a.textOpt});var _iterator4=_createForOfIteratorHelper(i.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),m=_step4$value[0],x=_step4$value[1];h&&x.toolsType===gt.Text?M.push(_objectSpread(_objectSpread({},x),{},{workId:m,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):M.push(_objectSpread(_objectSpread({},x),{},{workId:m,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:M};}}]);}(te);var Di=/*#__PURE__*/function(_te5){function Di(){var _this5;_classCallCheck(this,Di);_this5=_callSuper(this,Di,arguments);nt(_this5,"emitEventType",Lt.DeleteNode);return _this5;}_inherits(Di,_te5);return _createClass(Di,[{key:"consume",value:function consume(){return!1;}}]);}(te);var wi=/*#__PURE__*/function(_te6){function wi(){var _this6;_classCallCheck(this,wi);_this6=_callSuper(this,wi,arguments);nt(_this6,"emitEventType",Lt.ScaleNode);return _this6;}_inherits(wi,_te6);return _createClass(wi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t){var o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willSyncService,a=t.willSerializeData;_context5.t0=e===wt&&n;if(!_context5.t0){_context5.next=5;break;}_context5.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return _context5.stop();}},_callee5,this);}));function consumeForLocalWorker(_x5){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,c=e.willSyncService,p=s.workState,h=n.render||[],v=n.sp||[],y=a==null?void 0:a.selectRect;if(p===It.Start)return{sp:[],render:[]};if(c){v.push({type:ft.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:p===It.Done&&i.getChildrenPoints()||void 0,textOpt:i.textOpt});var _iterator5=_createForOfIteratorHelper(o.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),M=_step5$value[0],T=_step5$value[1];T.toolsType===gt.Text?v.push(_objectSpread(_objectSpread({},T),{},{workId:M,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):v.push(_objectSpread(_objectSpread({},T),{},{workId:M,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:h,sp:v};}}]);}(te);var Ni=/*#__PURE__*/function(_te7){function Ni(){var _this7;_classCallCheck(this,Ni);_this7=_callSuper(this,Ni,arguments);nt(_this7,"emitEventType",Lt.RotateNode);return _this7;}_inherits(Ni,_te7);return _createClass(Ni,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.emitEventType;_context6.t0=e===wt&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,emitEventType:s,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback});case 5:case"end":return _context6.stop();}},_callee6,this);}));function consumeForLocalWorker(_x6){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,c=e.willSyncService,p=e.willSerializeData,h=e.isSync,v=s.workState,y=n.render||[],M=n.sp||[],T=a==null?void 0:a.selectRect;if(c){p&&v===It.Done&&M.push({type:ft.Select,selectIds:i.selectIds,selectRect:T,willSyncService:!0,isSync:h,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt});var _iterator6=_createForOfIteratorHelper(o.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),m=_step6$value[0],x=_step6$value[1];M.push(_objectSpread(_objectSpread({},x),{},{workId:m,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:M};}}]);}(te);var Wi=/*#__PURE__*/function(_te8){function Wi(){var _this8;_classCallCheck(this,Wi);_this8=_callSuper(this,Wi,arguments);nt(_this8,"emitEventType",Lt.SetFontStyle);return _this8;}_inherits(Wi,_te8);return _createClass(Wi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context7.t0=e===wt&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context7.stop();}},_callee7,this);}));function consumeForLocalWorker(_x7){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=e.updateSelectorOpt,h=e.textUpdateForWoker,v=n.render||[],y=n.sp||[],M=o==null?void 0:o.selectRect;if(s&&y){p.fontSize&&y.push({type:ft.Select,selectIds:a.selectIds,selectRect:M,willSyncService:s,isSync:c,points:a.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(i.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),T=_step7$value[0],m=_step7$value[1];h&&m.toolsType===gt.Text?y.push(_objectSpread(_objectSpread({},m),{},{workId:T,type:ft.TextUpdate,dataType:Tt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},m),{},{workId:T,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:v,sp:y};}}]);}(te);var Bi=/*#__PURE__*/function(_te9){function Bi(){var _this9;_classCallCheck(this,Bi);_this9=_callSuper(this,Bi,arguments);nt(_this9,"emitEventType",Lt.SetPoint);return _this9;}_inherits(Bi,_te9);return _createClass(Bi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context8.t0=e===wt&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context8.stop();}},_callee8,this);}));function consumeForLocalWorker(_x8){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=n.render||[],h=n.sp||[],v=o==null?void 0:o.selectRect;if(s&&h){var _iterator8=_createForOfIteratorHelper(i.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),y=_step8$value[0],M=_step8$value[1];h.push(_objectSpread(_objectSpread({},M),{},{workId:y,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}h.push({type:ft.Select,selectIds:a.selectIds,selectRect:v,willSyncService:s,isSync:c,points:a.getChildrenPoints()});}return{render:p,sp:h};}}]);}(te);var Fi=/*#__PURE__*/function(_te10){function Fi(){var _this10;_classCallCheck(this,Fi);_this10=_callSuper(this,Fi,arguments);nt(_this10,"emitEventType",Lt.SetLock);return _this10;}_inherits(Fi,_te10);return _createClass(Fi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context9.t0=e===wt&&n;if(!_context9.t0){_context9.next=5;break;}_context9.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context9.stop();}},_callee9,this);}));function consumeForLocalWorker(_x9){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,p=e.updateSelectorOpt,h=n.render||[],v=n.sp||[],y=o==null?void 0:o.selectRect;if(s&&v){var _iterator9=_createForOfIteratorHelper(i.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),M=_step9$value[0],T=_step9$value[1];v.push(_objectSpread(_objectSpread({},T),{},{workId:M,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}v.push({isLocked:p.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:ft.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:c});}return{render:h,sp:v};}}]);}(te);var Ui=/*#__PURE__*/function(_te11){function Ui(){var _this11;_classCallCheck(this,Ui);_this11=_callSuper(this,Ui,arguments);nt(_this11,"emitEventType",Lt.SetShapeOpt);return _this11;}_inherits(Ui,_te11);return _createClass(Ui,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ft.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context10.t0=e===wt&&n;if(!_context10.t0){_context10.next=5;break;}_context10.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context10.stop();}},_callee10,this);}));function consumeForLocalWorker(_x10){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],c=n.sp||[];if(a&&c){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),p=_step10$value[0],h=_step10$value[1];c.push(_objectSpread(_objectSpread({},h),{},{workId:p,type:ft.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:c};}}]);}(te);var ji=/*#__PURE__*/function(){function ji(r){var _this12=this;_classCallCheck(this,ji);nt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(ji,[{key:"build",value:function build(r){switch(r){case Lt.TranslateNode:return new bi();case Lt.ZIndexNode:return new Li();case Lt.CopyNode:return new Ci();case Lt.SetColorNode:return new Ii();case Lt.DeleteNode:return new Di();case Lt.ScaleNode:return new wi();case Lt.RotateNode:return new Ni();case Lt.SetFontStyle:return new Wi();case Lt.SetPoint:return new Bi();case Lt.SetLock:return new Fi();case Lt.SetShapeOpt:return new Ui();}}},{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.builders.forEach(function(n){n&&n.registerForWorker(r,t,e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(r){var _iterator11=_createForOfIteratorHelper(this.builders.values()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var t=_step11.value;if(t!=null&&t.consume(r))return!0;}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return!1;}}]);}();var $i={linear:function linear(f){return f;},easeInQuad:function easeInQuad(f){return f*f;},easeOutQuad:function easeOutQuad(f){return f*(2-f);},easeInOutQuad:function easeInOutQuad(f){return f<0.5?2*f*f:-1+(4-2*f)*f;},easeInCubic:function easeInCubic(f){return f*f*f;},easeOutCubic:function easeOutCubic(f){return--f*f*f+1;},easeInOutCubic:function easeInOutCubic(f){return f<0.5?4*f*f*f:(f-1)*(2*f-2)*(2*f-2)+1;},easeInQuart:function easeInQuart(f){return f*f*f*f;},easeOutQuart:function easeOutQuart(f){return 1- --f*f*f*f;},easeInOutQuart:function easeInOutQuart(f){return f<0.5?8*f*f*f*f:1-8*--f*f*f*f;},easeInQuint:function easeInQuint(f){return f*f*f*f*f;},easeOutQuint:function easeOutQuint(f){return 1+--f*f*f*f*f;},easeInOutQuint:function easeInOutQuint(f){return f<0.5?16*f*f*f*f*f:1+16*--f*f*f*f*f;},easeInSine:function easeInSine(f){return 1-Math.cos(f*Math.PI/2);},easeOutSine:function easeOutSine(f){return Math.sin(f*Math.PI/2);},easeInOutSine:function easeInOutSine(f){return-(Math.cos(Math.PI*f)-1)/2;},easeInExpo:function easeInExpo(f){return f<=0?0:Math.pow(2,10*f-10);},easeOutExpo:function easeOutExpo(f){return f>=1?1:1-Math.pow(2,-10*f);},easeInOutExpo:function easeInOutExpo(f){return f<=0?0:f>=1?1:f<0.5?Math.pow(2,20*f-10)/2:(2-Math.pow(2,-20*f+10))/2;}};var tt=/*#__PURE__*/function(){function tt(){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,tt);this.x=r,this.y=t,this.z=e;}return _createClass(tt,[{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 tt(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=tt.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 tt.Dpr(this,r);}},{key:"cpr",value:function cpr(r){return tt.Cpr(this,r);}},{key:"len2",value:function len2(){return tt.Len2(this);}},{key:"len",value:function len(){return tt.Len(this);}},{key:"pry",value:function pry(r){return tt.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 tt.Uni(this);}},{key:"tan",value:function tan(r){return tt.Tan(this,r);}},{key:"dist",value:function dist(r){return tt.Dist(this,r);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(r,t){return tt.DistanceToLineSegment(r,t,this);}},{key:"slope",value:function slope(r){return tt.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 tt.Angle(this,r);}},{key:"toAngle",value:function toAngle(){return tt.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 tt.Equals(this,r,t);}},{key:"equalsXY",value:function equalsXY(r,t){return tt.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 tt.ToFixed(this);}},{key:"toString",value:function toString(){return tt.ToString(tt.ToFixed(this));}},{key:"toJson",value:function toJson(){return tt.ToJson(this);}},{key:"toArray",value:function toArray(){return tt.ToArray(this);}}],[{key:"Add",value:function Add(r,t){return new tt(r.x+t.x,r.y+t.y);}},{key:"AddXY",value:function AddXY(r,t,e){return new tt(r.x+t,r.y+e);}},{key:"Sub",value:function Sub(r,t){return new tt(r.x-t.x,r.y-t.y);}},{key:"SubXY",value:function SubXY(r,t,e){return new tt(r.x-t,r.y-e);}},{key:"AddScalar",value:function AddScalar(r,t){return new tt(r.x+t,r.y+t);}},{key:"SubScalar",value:function SubScalar(r,t){return new tt(r.x-t,r.y-t);}},{key:"Div",value:function Div(r,t){return new tt(r.x/t,r.y/t);}},{key:"Mul",value:function Mul(r,t){return new tt(r.x*t,r.y*t);}},{key:"DivV",value:function DivV(r,t){return new tt(r.x/t.x,r.y/t.y);}},{key:"MulV",value:function MulV(r,t){return new tt(r.x*t.x,r.y*t.y);}},{key:"Neg",value:function Neg(r){return new tt(-r.x,-r.y);}},{key:"Per",value:function Per(r){return new tt(r.y,-r.x);}},{key:"Dist2",value:function Dist2(r,t){return tt.Sub(r,t).len2();}},{key:"Abs",value:function Abs(r){return new tt(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 tt(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
2
+ );}},{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 tt.Dpr(r,t)/tt.Len(t);}},{key:"Uni",value:function Uni(r){return tt.Div(r,tt.Len(r));}},{key:"Tan",value:function Tan(r,t){return tt.Uni(tt.Sub(r,t));}},{key:"Min",value:function Min(r,t){return new tt(Math.min(r.x,t.x),Math.min(r.y,t.y));}},{key:"Max",value:function Max(r,t){return new tt(Math.max(r.x,t.x),Math.max(r.y,t.y));}},{key:"From",value:function From(r){return new tt().add(r);}},{key:"FromArray",value:function FromArray(r){return new tt(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 tt(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 tt(t.x+(n*o-i*a),t.y+(n*a+i*o));}/**
3
+ * Get the nearest point on a line with a known unit vector that passes through point A
4
+ *
5
+ * ```ts
6
+ * Vec.nearestPointOnLineThroughPoint(A, u, Point)
7
+ * ```
8
+ *
9
+ * @param A - Any point on the line
10
+ * @param u - The unit vector for the line.
11
+ * @param P - A point not on the line to test.
12
+ */},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(r,t,e){return tt.Mul(t,tt.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=tt.Tan(t,r),a=tt.Add(r,tt.Mul(i,tt.Sub(e,r).pry(i)));if(n){if(a.x<Math.min(r.x,t.x))return tt.Cast(r.x<t.x?r:t);if(a.x>Math.max(r.x,t.x))return tt.Cast(r.x>t.x?r:t);if(a.y<Math.min(r.y,t.y))return tt.Cast(r.y<t.y?r:t);if(a.y>Math.max(r.y,t.y))return tt.Cast(r.y>t.y?r:t);}return a;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(r,t,e){return tt.Dist(e,tt.NearestPointOnLineThroughPoint(r,t,e));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return tt.Dist(e,tt.NearestPointOnLineSegment(r,t,e,n));}},{key:"Snap",value:function Snap(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new tt(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}},{key:"Cast",value:function Cast(r){return r instanceof tt?r:tt.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 tt.Sub(t,r).mul(e).add(r);}},{key:"Med",value:function Med(r,t){return new tt((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)<e&&Math.abs(r.y-t.y)<e;}},{key:"EqualsXY",value:function EqualsXY(r,t,e){return r.x===t&&r.y===e;}},{key:"EqualsXYZ",value:function EqualsXYZ(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return tt.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))<e;}},{key:"Clockwise",value:function Clockwise(r,t,e){return(e.x-r.x)*(t.y-r.y)-(t.x-r.x)*(e.y-r.y)<0;}},{key:"Rescale",value:function Rescale(r,t){var e=tt.Len(r);return new tt(t*r.x/e,t*r.y/e);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(r,t,e){return tt.Sub(r,e).mul(t).add(e);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(r,t,e){return tt.Sub(r,e).mulV(t).add(e);}},{key:"ToFixed",value:function ToFixed(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new tt(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t));}},{key:"Nudge",value:function Nudge(r,t,e){return tt.Add(r,tt.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 tt(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 tt(0,0);for(var n=0;n<t;n++)e.add(r[n]);return e.div(t);}},{key:"Clamp",value:function Clamp(r,t,e){return e===void 0?new tt(Math.min(Math.max(r.x,t)),Math.min(Math.max(r.y,t))):new tt(Math.min(Math.max(r.x,t),e),Math.min(Math.max(r.y,t),e));}/**
13
+ * Get an array of points (with simulated pressure) between two points.
14
+ *
15
+ * @param A - The first point.
16
+ * @param B - The second point.
17
+ * @param steps - The number of points to return.
18
+ */},{key:"PointsBetween",value:function PointsBetween(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i<e;i++){var a=$i.easeInQuad(i/(e-1)),o=tt.Lrp(r,t,a);o.z=Math.min(1,0.5+Math.abs(0.5-zi(a))*0.65),n.push(o);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new tt(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}}]);}();var zi=function zi(f){return f<0.5?2*f*f:-1+(4-2*f)*f;};var Be=(typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?globalThis:(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:(typeof global==="undefined"?"undefined":_typeof(global))<"u"?global:(typeof self==="undefined"?"undefined":_typeof(self))<"u"?self:{};function ue(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f["default"]:f;}var Gi=_typeof(Be)=="object"&&Be&&Be.Object===Object&&Be,In=Gi,Hi=In,Ki=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,Vi=Hi||Ki||Function("return this")(),ee=Vi,Yi=ee,Xi=Yi.Symbol,Ne=Xi,Wr=Ne,Ln=Object.prototype,Ji=Ln.hasOwnProperty,Qi=Ln.toString,Le=Wr?Wr.toStringTag:void 0;function Zi(f){var r=Ji.call(f,Le),t=f[Le];try{f[Le]=void 0;var e=!0;}catch(_unused){}var n=Qi.call(f);return e&&(r?f[Le]=t:delete f[Le]),n;}var ki=Zi,qi=Object.prototype,_i=qi.toString;function ts(f){return _i.call(f);}var es=ts,Br=Ne,rs=ki,ns=es,is="[object Null]",ss="[object Undefined]",Fr=Br?Br.toStringTag:void 0;function os(f){return f==null?f===void 0?ss:is:Fr&&Fr in Object(f)?rs(f):ns(f);}var he=os;function as(f){return f!=null&&_typeof(f)=="object";}var ne=as,ls=he,cs=ne,fs="[object Number]";function us(f){return typeof f=="number"||cs(f)&&ls(f)==fs;}var hs=us,qt=/* @__PURE__ */ue(hs);function ds(){this.__data__=[],this.size=0;}var gs=ds;function ps(f,r){return f===r||f!==f&&r!==r;}var vr=ps,vs=vr;function ms(f,r){for(var t=f.length;t--;)if(vs(f[t][0],r))return t;return-1;}var Ze=ms,ys=Ze,Ss=Array.prototype,xs=Ss.splice;function Ts(f){var r=this.__data__,t=ys(r,f);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():xs.call(r,t,1),--this.size,!0;}var Ms=Ts,Os=Ze;function Ps(f){var r=this.__data__,t=Os(r,f);return t<0?void 0:r[t][1];}var Es=Ps,As=Ze;function Cs(f){return As(this.__data__,f)>-1;}var Rs=Cs,Is=Ze;function Ls(f,r){var t=this.__data__,e=Is(t,f);return e<0?(++this.size,t.push([f,r])):t[e][1]=r,this;}var bs=Ls,Ds=gs,ws=Ms,Ns=Es,Ws=Rs,Bs=bs;function Oe(f){var r=-1,t=f==null?0:f.length;for(this.clear();++r<t;){var e=f[r];this.set(e[0],e[1]);}}Oe.prototype.clear=Ds;Oe.prototype["delete"]=ws;Oe.prototype.get=Ns;Oe.prototype.has=Ws;Oe.prototype.set=Bs;var ke=Oe,Fs=ke;function Us(){this.__data__=new Fs(),this.size=0;}var js=Us;function $s(f){var r=this.__data__,t=r["delete"](f);return this.size=r.size,t;}var zs=$s;function Gs(f){return this.__data__.get(f);}var Hs=Gs;function Ks(f){return this.__data__.has(f);}var Vs=Ks;function Ys(f){var r=_typeof(f);return f!=null&&(r=="object"||r=="function");}var ae=Ys,Xs=he,Js=ae,Qs="[object AsyncFunction]",Zs="[object Function]",ks="[object GeneratorFunction]",qs="[object Proxy]";function _s(f){if(!Js(f))return!1;var r=Xs(f);return r==Zs||r==ks||r==Qs||r==qs;}var bn=_s,to=ee,eo=to["__core-js_shared__"],ro=eo,nr=ro,Ur=function(){var f=/[^.]+$/.exec(nr&&nr.keys&&nr.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:"";}();function no(f){return!!Ur&&Ur in f;}var io=no,so=Function.prototype,oo=so.toString;function ao(f){if(f!=null){try{return oo.call(f);}catch(_unused2){}try{return f+"";}catch(_unused3){}}return"";}var Dn=ao,lo=bn,co=io,fo=ae,uo=Dn,ho=/[\\^$.*+?()[\]{}|]/g,go=/^\[object .+?Constructor\]$/,po=Function.prototype,vo=Object.prototype,mo=po.toString,yo=vo.hasOwnProperty,So=RegExp("^"+mo.call(yo).replace(ho,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xo(f){if(!fo(f)||co(f))return!1;var r=lo(f)?So:go;return r.test(uo(f));}var To=xo;function Mo(f,r){return f==null?void 0:f[r];}var Oo=Mo,Po=To,Eo=Oo;function Ao(f,r){var t=Eo(f,r);return Po(t)?t:void 0;}var de=Ao,Co=de,Ro=ee,Io=Co(Ro,"Map"),mr=Io,Lo=de,bo=Lo(Object,"create"),qe=bo,jr=qe;function Do(){this.__data__=jr?jr(null):{},this.size=0;}var wo=Do;function No(f){var r=this.has(f)&&delete this.__data__[f];return this.size-=r?1:0,r;}var Wo=No,Bo=qe,Fo="__lodash_hash_undefined__",Uo=Object.prototype,jo=Uo.hasOwnProperty;function $o(f){var r=this.__data__;if(Bo){var t=r[f];return t===Fo?void 0:t;}return jo.call(r,f)?r[f]:void 0;}var zo=$o,Go=qe,Ho=Object.prototype,Ko=Ho.hasOwnProperty;function Vo(f){var r=this.__data__;return Go?r[f]!==void 0:Ko.call(r,f);}var Yo=Vo,Xo=qe,Jo="__lodash_hash_undefined__";function Qo(f,r){var t=this.__data__;return this.size+=this.has(f)?0:1,t[f]=Xo&&r===void 0?Jo:r,this;}var Zo=Qo,ko=wo,qo=Wo,_o=zo,ta=Yo,ea=Zo;function Pe(f){var r=-1,t=f==null?0:f.length;for(this.clear();++r<t;){var e=f[r];this.set(e[0],e[1]);}}Pe.prototype.clear=ko;Pe.prototype["delete"]=qo;Pe.prototype.get=_o;Pe.prototype.has=ta;Pe.prototype.set=ea;var ra=Pe,$r=ra,na=ke,ia=mr;function sa(){this.size=0,this.__data__={hash:new $r(),map:new(ia||na)(),string:new $r()};}var oa=sa;function aa(f){var r=_typeof(f);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?f!=="__proto__":f===null;}var la=aa,ca=la;function fa(f,r){var t=f.__data__;return ca(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var _e=fa,ua=_e;function ha(f){var r=ua(this,f)["delete"](f);return this.size-=r?1:0,r;}var da=ha,ga=_e;function pa(f){return ga(this,f).get(f);}var va=pa,ma=_e;function ya(f){return ma(this,f).has(f);}var Sa=ya,xa=_e;function Ta(f,r){var t=xa(this,f),e=t.size;return t.set(f,r),this.size+=t.size==e?0:1,this;}var Ma=Ta,Oa=oa,Pa=da,Ea=va,Aa=Sa,Ca=Ma;function Ee(f){var r=-1,t=f==null?0:f.length;for(this.clear();++r<t;){var e=f[r];this.set(e[0],e[1]);}}Ee.prototype.clear=Oa;Ee.prototype["delete"]=Pa;Ee.prototype.get=Ea;Ee.prototype.has=Aa;Ee.prototype.set=Ca;var wn=Ee,Ra=ke,Ia=mr,La=wn,ba=200;function Da(f,r){var t=this.__data__;if(t instanceof Ra){var e=t.__data__;if(!Ia||e.length<ba-1)return e.push([f,r]),this.size=++t.size,this;t=this.__data__=new La(e);}return t.set(f,r),this.size=t.size,this;}var wa=Da,Na=ke,Wa=js,Ba=zs,Fa=Hs,Ua=Vs,ja=wa;function Ae(f){var r=this.__data__=new Na(f);this.size=r.size;}Ae.prototype.clear=Wa;Ae.prototype["delete"]=Ba;Ae.prototype.get=Fa;Ae.prototype.has=Ua;Ae.prototype.set=ja;var Nn=Ae;function $a(f,r){for(var t=-1,e=f==null?0:f.length;++t<e&&r(f[t],t,f)!==!1;);return f;}var za=$a,Ga=de,Ha=function(){try{var f=Ga(Object,"defineProperty");return f({},"",{}),f;}catch(_unused4){}}(),Wn=Ha,zr=Wn;function Ka(f,r,t){r=="__proto__"&&zr?zr(f,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):f[r]=t;}var Bn=Ka,Va=Bn,Ya=vr,Xa=Object.prototype,Ja=Xa.hasOwnProperty;function Qa(f,r,t){var e=f[r];(!(Ja.call(f,r)&&Ya(e,t))||t===void 0&&!(r in f))&&Va(f,r,t);}var Fn=Qa,Za=Fn,ka=Bn;function qa(f,r,t,e){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var o=r[i],s=e?e(t[o],f[o],o,t,f):void 0;s===void 0&&(s=f[o]),n?ka(t,o,s):Za(t,o,s);}return t;}var tr=qa;function _a(f,r){for(var t=-1,e=Array(f);++t<f;)e[t]=r(t);return e;}var tl=_a,el=he,rl=ne,nl="[object Arguments]";function il(f){return rl(f)&&el(f)==nl;}var sl=il,Gr=sl,ol=ne,Un=Object.prototype,al=Un.hasOwnProperty,ll=Un.propertyIsEnumerable,cl=Gr(/* @__PURE__ */function(){return arguments;}())?Gr:function(f){return ol(f)&&al.call(f,"callee")&&!ll.call(f,"callee");},jn=cl,fl=Array.isArray,We=fl,je={exports:{}};function ul(){return!1;}var hl=ul;je.exports;(function(f,r){var t=ee,e=hl,n=r&&!r.nodeType&&r,i=n&&!0&&f&&!f.nodeType&&f,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.isBuffer:void 0,c=s||e;f.exports=c;})(je,je.exports);var yr=je.exports,dl=9007199254740991,gl=/^(?:0|[1-9]\d*)$/;function pl(f,r){var _r2;var t=_typeof(f);return r=(_r2=r)!==null&&_r2!==void 0?_r2:dl,!!r&&(t=="number"||t!="symbol"&&gl.test(f))&&f>-1&&f%1==0&&f<r;}var vl=pl,ml=9007199254740991;function yl(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=ml;}var $n=yl,Sl=he,xl=$n,Tl=ne,Ml="[object Arguments]",Ol="[object Array]",Pl="[object Boolean]",El="[object Date]",Al="[object Error]",Cl="[object Function]",Rl="[object Map]",Il="[object Number]",Ll="[object Object]",bl="[object RegExp]",Dl="[object Set]",wl="[object String]",Nl="[object WeakMap]",Wl="[object ArrayBuffer]",Bl="[object DataView]",Fl="[object Float32Array]",Ul="[object Float64Array]",jl="[object Int8Array]",$l="[object Int16Array]",zl="[object Int32Array]",Gl="[object Uint8Array]",Hl="[object Uint8ClampedArray]",Kl="[object Uint16Array]",Vl="[object Uint32Array]",Bt={};Bt[Fl]=Bt[Ul]=Bt[jl]=Bt[$l]=Bt[zl]=Bt[Gl]=Bt[Hl]=Bt[Kl]=Bt[Vl]=!0;Bt[Ml]=Bt[Ol]=Bt[Wl]=Bt[Pl]=Bt[Bl]=Bt[El]=Bt[Al]=Bt[Cl]=Bt[Rl]=Bt[Il]=Bt[Ll]=Bt[bl]=Bt[Dl]=Bt[wl]=Bt[Nl]=!1;function Yl(f){return Tl(f)&&xl(f.length)&&!!Bt[Sl(f)];}var Xl=Yl;function Jl(f){return function(r){return f(r);};}var er=Jl,$e={exports:{}};$e.exports;(function(f,r){var t=In,e=r&&!r.nodeType&&r,n=e&&!0&&f&&!f.nodeType&&f,i=n&&n.exports===e,a=i&&t.process,o=function(){try{var s=n&&n.require&&n.require("util").types;return s||a&&a.binding&&a.binding("util");}catch(_unused5){}}();f.exports=o;})($e,$e.exports);var Sr=$e.exports,Ql=Xl,Zl=er,Hr=Sr,Kr=Hr&&Hr.isTypedArray,kl=Kr?Zl(Kr):Ql,zn=kl,ql=tl,_l=jn,tc=We,ec=yr,rc=vl,nc=zn,ic=Object.prototype,sc=ic.hasOwnProperty;function oc(f,r){var t=tc(f),e=!t&&_l(f),n=!t&&!e&&ec(f),i=!t&&!e&&!n&&nc(f),a=t||e||n||i,o=a?ql(f.length,String):[],s=o.length;for(var c in f)(r||sc.call(f,c))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
19
+ c=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
20
+ n&&(c=="offset"||c=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
21
+ i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||// Skip index properties.
22
+ rc(c,s)))&&o.push(c);return o;}var Gn=oc,ac=Object.prototype;function lc(f){var r=f&&f.constructor,t=typeof r=="function"&&r.prototype||ac;return f===t;}var xr=lc;function cc(f,r){return function(t){return f(r(t));};}var Hn=cc,fc=Hn,uc=fc(Object.keys,Object),hc=uc,dc=xr,gc=hc,pc=Object.prototype,vc=pc.hasOwnProperty;function mc(f){if(!dc(f))return gc(f);var r=[];for(var t in Object(f))vc.call(f,t)&&t!="constructor"&&r.push(t);return r;}var yc=mc,Sc=bn,xc=$n;function Tc(f){return f!=null&&xc(f.length)&&!Sc(f);}var Tr=Tc,Mc=Gn,Oc=yc,Pc=Tr;function Ec(f){return Pc(f)?Mc(f):Oc(f);}var Mr=Ec,Ac=tr,Cc=Mr;function Rc(f,r){return f&&Ac(r,Cc(r),f);}var Ic=Rc;function Lc(f){var r=[];if(f!=null)for(var t in Object(f))r.push(t);return r;}var bc=Lc,Dc=ae,wc=xr,Nc=bc,Wc=Object.prototype,Bc=Wc.hasOwnProperty;function Fc(f){if(!Dc(f))return Nc(f);var r=wc(f),t=[];for(var e in f)e=="constructor"&&(r||!Bc.call(f,e))||t.push(e);return t;}var Uc=Fc,jc=Gn,$c=Uc,zc=Tr;function Gc(f){return zc(f)?jc(f,!0):$c(f);}var Or=Gc,Hc=tr,Kc=Or;function Vc(f,r){return f&&Hc(r,Kc(r),f);}var Yc=Vc,ze={exports:{}};ze.exports;(function(f,r){var t=ee,e=r&&!r.nodeType&&r,n=e&&!0&&f&&!f.nodeType&&f,i=n&&n.exports===e,a=i?t.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(c,p){if(p)return c.slice();var h=c.length,v=o?o(h):new c.constructor(h);return c.copy(v),v;}f.exports=s;})(ze,ze.exports);var Xc=ze.exports;function Jc(f,r){var t=-1,e=f.length;for(r||(r=Array(e));++t<e;)r[t]=f[t];return r;}var Qc=Jc;function Zc(f,r){for(var t=-1,e=f==null?0:f.length,n=0,i=[];++t<e;){var a=f[t];r(a,t,f)&&(i[n++]=a);}return i;}var Kn=Zc;function kc(){return[];}var Vn=kc,qc=Kn,_c=Vn,tf=Object.prototype,ef=tf.propertyIsEnumerable,Vr=Object.getOwnPropertySymbols,rf=Vr?function(f){return f==null?[]:(f=Object(f),qc(Vr(f),function(r){return ef.call(f,r);}));}:_c,Pr=rf,nf=tr,sf=Pr;function of(f,r){return nf(f,sf(f),r);}var af=of;function lf(f,r){for(var t=-1,e=r.length,n=f.length;++t<e;)f[n+t]=r[t];return f;}var Er=lf,cf=Hn,ff=cf(Object.getPrototypeOf,Object),Yn=ff,uf=Er,hf=Yn,df=Pr,gf=Vn,pf=Object.getOwnPropertySymbols,vf=pf?function(f){for(var r=[];f;)uf(r,df(f)),f=hf(f);return r;}:gf,Xn=vf,mf=tr,yf=Xn;function Sf(f,r){return mf(f,yf(f),r);}var xf=Sf,Tf=Er,Mf=We;function Of(f,r,t){var e=r(f);return Mf(f)?e:Tf(e,t(f));}var Jn=Of,Pf=Jn,Ef=Pr,Af=Mr;function Cf(f){return Pf(f,Af,Ef);}var Qn=Cf,Rf=Jn,If=Xn,Lf=Or;function bf(f){return Rf(f,Lf,If);}var Df=bf,wf=de,Nf=ee,Wf=wf(Nf,"DataView"),Bf=Wf,Ff=de,Uf=ee,jf=Ff(Uf,"Promise"),$f=jf,zf=de,Gf=ee,Hf=zf(Gf,"Set"),Zn=Hf,Kf=de,Vf=ee,Yf=Kf(Vf,"WeakMap"),Xf=Yf,cr=Bf,fr=mr,ur=$f,hr=Zn,dr=Xf,kn=he,Ce=Dn,Yr="[object Map]",Jf="[object Object]",Xr="[object Promise]",Jr="[object Set]",Qr="[object WeakMap]",Zr="[object DataView]",Qf=Ce(cr),Zf=Ce(fr),kf=Ce(ur),qf=Ce(hr),_f=Ce(dr),le=kn;(cr&&le(new cr(new ArrayBuffer(1)))!=Zr||fr&&le(new fr())!=Yr||ur&&le(ur.resolve())!=Xr||hr&&le(new hr())!=Jr||dr&&le(new dr())!=Qr)&&(le=function le(f){var r=kn(f),t=r==Jf?f.constructor:void 0,e=t?Ce(t):"";if(e)switch(e){case Qf:return Zr;case Zf:return Yr;case kf:return Xr;case qf:return Jr;case _f:return Qr;}return r;});var rr=le,tu=Object.prototype,eu=tu.hasOwnProperty;function ru(f){var r=f.length,t=new f.constructor(r);return r&&typeof f[0]=="string"&&eu.call(f,"index")&&(t.index=f.index,t.input=f.input),t;}var nu=ru,iu=ee,su=iu.Uint8Array,qn=su,kr=qn;function ou(f){var r=new f.constructor(f.byteLength);return new kr(r).set(new kr(f)),r;}var Ar=ou,au=Ar;function lu(f,r){var t=r?au(f.buffer):f.buffer;return new f.constructor(t,f.byteOffset,f.byteLength);}var cu=lu,fu=/\w*$/;function uu(f){var r=new f.constructor(f.source,fu.exec(f));return r.lastIndex=f.lastIndex,r;}var hu=uu,qr=Ne,_r=qr?qr.prototype:void 0,tn=_r?_r.valueOf:void 0;function du(f){return tn?Object(tn.call(f)):{};}var gu=du,pu=Ar;function vu(f,r){var t=r?pu(f.buffer):f.buffer;return new f.constructor(t,f.byteOffset,f.length);}var mu=vu,yu=Ar,Su=cu,xu=hu,Tu=gu,Mu=mu,Ou="[object Boolean]",Pu="[object Date]",Eu="[object Map]",Au="[object Number]",Cu="[object RegExp]",Ru="[object Set]",Iu="[object String]",Lu="[object Symbol]",bu="[object ArrayBuffer]",Du="[object DataView]",wu="[object Float32Array]",Nu="[object Float64Array]",Wu="[object Int8Array]",Bu="[object Int16Array]",Fu="[object Int32Array]",Uu="[object Uint8Array]",ju="[object Uint8ClampedArray]",$u="[object Uint16Array]",zu="[object Uint32Array]";function Gu(f,r,t){var e=f.constructor;switch(r){case bu:return yu(f);case Ou:case Pu:return new e(+f);case Du:return Su(f,t);case wu:case Nu:case Wu:case Bu:case Fu:case Uu:case ju:case $u:case zu:return Mu(f,t);case Eu:return new e();case Au:case Iu:return new e(f);case Cu:return xu(f);case Ru:return new e();case Lu:return Tu(f);}}var Hu=Gu,Ku=ae,en=Object.create,Vu=/* @__PURE__ */function(){function f(){}return function(r){if(!Ku(r))return{};if(en)return en(r);f.prototype=r;var t=new f();return f.prototype=void 0,t;};}(),Yu=Vu,Xu=Yu,Ju=Yn,Qu=xr;function Zu(f){return typeof f.constructor=="function"&&!Qu(f)?Xu(Ju(f)):{};}var ku=Zu,qu=rr,_u=ne,th="[object Map]";function eh(f){return _u(f)&&qu(f)==th;}var rh=eh,nh=rh,ih=er,rn=Sr,nn=rn&&rn.isMap,sh=nn?ih(nn):nh,oh=sh,ah=rr,lh=ne,ch="[object Set]";function fh(f){return lh(f)&&ah(f)==ch;}var uh=fh,hh=uh,dh=er,sn=Sr,on=sn&&sn.isSet,gh=on?dh(on):hh,ph=gh,vh=Nn,mh=za,yh=Fn,Sh=Ic,xh=Yc,Th=Xc,Mh=Qc,Oh=af,Ph=xf,Eh=Qn,Ah=Df,Ch=rr,Rh=nu,Ih=Hu,Lh=ku,bh=We,Dh=yr,wh=oh,Nh=ae,Wh=ph,Bh=Mr,Fh=Or,Uh=1,jh=2,$h=4,_n="[object Arguments]",zh="[object Array]",Gh="[object Boolean]",Hh="[object Date]",Kh="[object Error]",ti="[object Function]",Vh="[object GeneratorFunction]",Yh="[object Map]",Xh="[object Number]",ei="[object Object]",Jh="[object RegExp]",Qh="[object Set]",Zh="[object String]",kh="[object Symbol]",qh="[object WeakMap]",_h="[object ArrayBuffer]",td="[object DataView]",ed="[object Float32Array]",rd="[object Float64Array]",nd="[object Int8Array]",id="[object Int16Array]",sd="[object Int32Array]",od="[object Uint8Array]",ad="[object Uint8ClampedArray]",ld="[object Uint16Array]",cd="[object Uint32Array]",Wt={};Wt[_n]=Wt[zh]=Wt[_h]=Wt[td]=Wt[Gh]=Wt[Hh]=Wt[ed]=Wt[rd]=Wt[nd]=Wt[id]=Wt[sd]=Wt[Yh]=Wt[Xh]=Wt[ei]=Wt[Jh]=Wt[Qh]=Wt[Zh]=Wt[kh]=Wt[od]=Wt[ad]=Wt[ld]=Wt[cd]=!0;Wt[Kh]=Wt[ti]=Wt[qh]=!1;function Ue(f,r,t,e,n,i){var a,o=r&Uh,s=r&jh,c=r&$h;if(t&&(a=n?t(f,e,n,i):t(f)),a!==void 0)return a;if(!Nh(f))return f;var p=bh(f);if(p){if(a=Rh(f),!o)return Mh(f,a);}else{var h=Ch(f),v=h==ti||h==Vh;if(Dh(f))return Th(f,o);if(h==ei||h==_n||v&&!n){if(a=s||v?{}:Lh(f),!o)return s?Ph(f,xh(a,f)):Oh(f,Sh(a,f));}else{if(!Wt[h])return n?f:{};a=Ih(f,h,o);}}i||(i=new vh());var y=i.get(f);if(y)return y;i.set(f,a),Wh(f)?f.forEach(function(m){a.add(Ue(m,r,t,m,f,i));}):wh(f)&&f.forEach(function(m,x){a.set(x,Ue(m,r,t,x,f,i));});var M=c?s?Ah:Eh:s?Fh:Bh,T=p?void 0:M(f);return mh(T||f,function(m,x){T&&(x=m,m=f[x]),yh(a,x,Ue(m,r,t,x,f,i));}),a;}var fd=Ue,ud=fd,hd=1,dd=4;function gd(f){return ud(f,hd|dd);}var pd=gd,Xt=/* @__PURE__ */ue(pd);var ri="1.0.3",vd="@netless/appliance-plugin",md=typeof OffscreenCanvas=="function"?"worker":"mainThread";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var f=window.__netlessUA||"";f+=" ".concat(vd,"@").concat(ri,"_").concat(md),window.__netlessUA=f;}var ie={syncOpt:{interval:200},canvasOpt:{contextType:me.Canvas2d},cdn:{subWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/subWorker.js",fullWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/fullWorker.js"},cursor:{expirationTime:5e3},bufferSize:{full:2e4,sub:1e3}},Qt=/*#__PURE__*/function(){function Qt(r){_classCallCheck(this,Qt);nt(this,"syncUnitTime",ie.syncOpt.interval);nt(this,"vNodes");nt(this,"drawLayer");nt(this,"fullLayer");nt(this,"workId");var t=r.vNodes,e=r.fullLayer,n=r.drawLayer,i=r.workId,a=r.toolsOpt;this.vNodes=t,this.fullLayer=e,this.drawLayer=n,this.workId=i,this.syncUnitTime=a.syncUnitTime||this.syncUnitTime;}return _createClass(Qt,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return r.reduce(function(e,n){var i=e[e.length-1];return(n&&!i||n&&i&&!n.isNear(i,t))&&e.push(n),e;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(r){this.workId=r;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(r){var n,i,a;this.workOptions=r,this.syncUnitTime=r.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),e=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&e&&(e.opt=r,(a=this.vNodes)==null||a.setInfo(t,e));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(r){var n,i;var t;var e=(n=this.workId)==null?void 0:n.toString();if(e&&r){var a=this.fullLayer.getElementsByName(e)||this.drawLayer&&this.drawLayer.getElementsByName(e)||[];if(a.length!==1)return;var o=a[0],s=r.pos,c=r.zIndex,p=r.scale,h=r.angle,v=r.translate,y={};qt(c)&&(y.zIndex=c),s&&(y.pos=[s[0],s[1]]),p&&(y.scale=p),h&&(y.rotate=h),v&&(y.translate=v),o.attr(y);var M=o==null?void 0:o.getBoundingClientRect();return M&&(t=Ot(t,{x:Math.floor(M.x-Qt.SafeBorderPadding),y:Math.floor(M.y-Qt.SafeBorderPadding),w:Math.floor(M.width+Qt.SafeBorderPadding*2),h:Math.floor(M.height+Qt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"replace",value:function replace(r,t,e){var _this13=this;var o;var n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(var s=1;s<n.length;s++)r.removeChild(n[s]),n[s].disconnect();e?r.replaceChild(e,n[0]):r.removeChild(n[0]),n[0].disconnect();}else e&&r.append(e);this.fullLayer===r?(o=this.drawLayer)==null||o.getElementsByName(t).forEach(function(s){var c;(c=_this13.drawLayer)==null||c.removeChild(s),s.disconnect();}):this.fullLayer.getElementsByName(t).forEach(function(s){_this13.fullLayer.removeChild(s),s.disconnect();});}}],[{key:"updateNodeOpt",value:function updateNodeOpt(r){var t=r.node,e=r.opt,n=r.vNodes,i=r.willSerializeData,a=r.targetNode,o=e.zIndex,s=e.translate,c=e.angle,p=e.originPoint,h=e.scenePoint,v=e.scale,y=e.pointMap;var M;var T=a&&Xt(a)||n.get(t.name);if(!T)return;qt(o)&&(t.setAttribute("zIndex",o),T.opt.zIndex=o);var m=t.parent;if(m){if(p&&v&&a){var x=[T.op[0],T.op[1]];Dr(T.op,h,v,s);var l=[T.op[0],T.op[1]],d=[l[0]-x[0],l[1]-x[1]];T.centerPos=[T.centerPos[0]+d[0],T.centerPos[1]+d[1]],T.opt.translate=void 0,T.opt.scale=void 0;}else if(s){if(t.setAttribute("translate",s),T.opt.translate=s,a){var _x11=[s[0]*m.worldScaling[0],s[1]*m.worldScaling[1]];M=N0(T.rect,_x11),T.rect=M;}else{var _x12=Qt.getRectFromLayer(m,t.name);T.rect=_x12||T.rect;}}else if(qt(c))if(t.setAttribute("rotate",c),T.opt.rotate=c,a)M=mi(T.rect,c),T.rect=M;else{var _x13=Qt.getRectFromLayer(m,t.name);T.rect=_x13||T.rect;}if(y){var _x14=y.get(t.name);if(_x14)for(var _l2=0,_d2=0;_l2<T.op.length;_l2+=3,_d2++)T.op[_l2]=_x14[_d2][0],T.op[_l2+1]=_x14[_d2][1];}if(i&&!(p&&v&&a)){if(s){var _x15=T.op.map(function(l,d){var u=d%3;return u===0?l+s[0]:u===1?l+s[1]:l;});T.op=_x15,T.centerPos=[T.centerPos[0]+s[0],T.centerPos[1]+s[1]],T!=null&&T.opt&&(T.opt.translate=void 0);}else if(qt(c)){var _x16=T.op;B0(_x16,T.centerPos,c),T.op=_x16,T!=null&&T.opt&&(T.opt.rotate=void 0);}}T&&n.setInfo(t.name,T);}}},{key:"getCenterPos",value:function getCenterPos(r,t){var e=t.worldPosition,n=t.worldScaling;return[(r.x+r.w/2-e[0])/n[0],(r.y+r.h/2-e[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(r,t){var e=r.getElementsByName(t)[0];if(e){var n=e.getBoundingClientRect();return{x:Math.floor(n.x-Qt.SafeBorderPadding),y:Math.floor(n.y-Qt.SafeBorderPadding),w:Math.floor(n.width+Qt.SafeBorderPadding*2),h:Math.floor(n.height+Qt.SafeBorderPadding*2)};}}}]);}();nt(Qt,"SafeBorderPadding",10);var yt=Qt;var Nt=/******/function(f){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={/******/i:e,/******/l:!1,/******/exports:{}/******/};return f[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=f,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(f,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 D;}),t.d(r,"isSpriteNode",function(){return I;}),t.d(r,"registerNode",function(){return C;});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 c=t(226);t.d(r,"Path",function(){return c["default"];});var p=t(229);t.d(r,"Rect",function(){return p["default"];});var h=t(231);t.d(r,"Triangle",function(){return h["default"];});var v=t(236);t.d(r,"Parallel",function(){return v["default"];});var y=t(238);t.d(r,"Regular",function(){return y["default"];});var M=t(240);t.d(r,"Star",function(){return M["default"];});var T=t(242);t.d(r,"Ellipse",function(){return T["default"];});var m=t(244);t.d(r,"Arc",function(){return m["default"];});var x=t(246);t.d(r,"Ring",function(){return x["default"];});var l=t(232);t.d(r,"Polyline",function(){return l["default"];});var d=t(248);t.d(r,"Label",function(){return d["default"];});var u=t(250);t.d(r,"Group",function(){return u["default"];});var g=t(286);t.d(r,"Layer",function(){return g["default"];});var O=t(287);t.d(r,"SpriteSvg",function(){return O["default"];});var A=t(289);t.d(r,"LayerWorker",function(){return A["default"];});var R=t(290);t.d(r,"Scene",function(){return R["default"];});var b=t(213),E=t(221);t.d(r,"Color",function(){return E.Color;}),t.d(r,"Gradient",function(){return E.Gradient;});var L=t(72);t(1).glMatrix.setMatrixArrayType(Array);var D=b["default"].createElement,I=b["default"].isSpriteNode,C=b["default"].registerNode,W={parseColor:E.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};var G;G="3.8.3";var K=G;},/* 1 */ /***/function(f,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 c=t(10);t.d(r,"quat2",function(){return c;});var p=t(11);t.d(r,"vec2",function(){return p;});var h=t(8);t.d(r,"vec3",function(){return h;});var v=t(9);t.d(r,"vec4",function(){return v;});},/* 2 */ /***/function(f,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 c;});var e=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function a(p){n=p;}var o=Math.PI/180;function s(p){return p*o;}function c(p,h){return Math.abs(p-h)<=e*Math.max(1,Math.abs(p),Math.abs(h));}Math.hypot||(Math.hypot=function(){for(var p=0,h=arguments.length;h--;)p+=arguments[h]*arguments[h];return Math.sqrt(p);});},/* 3 */ /***/function(f,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 c;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return h;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return M;}),t.d(r,"rotate",function(){return T;}),t.d(r,"scale",function(){return m;}),t.d(r,"fromRotation",function(){return x;}),t.d(r,"fromScaling",function(){return l;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return u;}),t.d(r,"LDU",function(){return g;}),t.d(r,"add",function(){return O;}),t.d(r,"subtract",function(){return A;}),t.d(r,"exactEquals",function(){return R;}),t.d(r,"equals",function(){return b;}),t.d(r,"multiplyScalar",function(){return E;}),t.d(r,"multiplyScalarAndAdd",function(){return L;}),t.d(r,"mul",function(){return D;}),t.d(r,"sub",function(){return I;});var e=t(2);function n(){var C=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C;}function i(C){var W=new e.ARRAY_TYPE(4);return W[0]=C[0],W[1]=C[1],W[2]=C[2],W[3]=C[3],W;}function a(C,W){return C[0]=W[0],C[1]=W[1],C[2]=W[2],C[3]=W[3],C;}function o(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=1,C;}function s(C,W,G,K){var X=new e.ARRAY_TYPE(4);return X[0]=C,X[1]=W,X[2]=G,X[3]=K,X;}function c(C,W,G,K,X){return C[0]=W,C[1]=G,C[2]=K,C[3]=X,C;}function p(C,W){if(C===W){var G=W[1];C[1]=W[2],C[2]=G;}else C[0]=W[0],C[1]=W[2],C[2]=W[1],C[3]=W[3];return C;}function h(C,W){var G=W[0],K=W[1],X=W[2],Z=W[3],B=G*Z-X*K;return B?(B=1/B,C[0]=Z*B,C[1]=-K*B,C[2]=-X*B,C[3]=G*B,C):null;}function v(C,W){var G=W[0];return C[0]=W[3],C[1]=-W[1],C[2]=-W[2],C[3]=G,C;}function y(C){return C[0]*C[3]-C[2]*C[1];}function M(C,W,G){var K=W[0],X=W[1],Z=W[2],B=W[3],z=G[0],Q=G[1],et=G[2],_=G[3];return C[0]=K*z+Z*Q,C[1]=X*z+B*Q,C[2]=K*et+Z*_,C[3]=X*et+B*_,C;}function T(C,W,G){var K=W[0],X=W[1],Z=W[2],B=W[3],z=Math.sin(G),Q=Math.cos(G);return C[0]=K*Q+Z*z,C[1]=X*Q+B*z,C[2]=K*-z+Z*Q,C[3]=X*-z+B*Q,C;}function m(C,W,G){var K=W[0],X=W[1],Z=W[2],B=W[3],z=G[0],Q=G[1];return C[0]=K*z,C[1]=X*z,C[2]=Z*Q,C[3]=B*Q,C;}function x(C,W){var G=Math.sin(W),K=Math.cos(W);return C[0]=K,C[1]=G,C[2]=-G,C[3]=K,C;}function l(C,W){return C[0]=W[0],C[1]=0,C[2]=0,C[3]=W[1],C;}function d(C){return"mat2("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+")";}function u(C){return Math.hypot(C[0],C[1],C[2],C[3]);}function g(C,W,G,K){return C[2]=K[2]/K[0],G[0]=K[0],G[1]=K[1],G[3]=K[3]-C[2]*G[1],[C,W,G];}function O(C,W,G){return C[0]=W[0]+G[0],C[1]=W[1]+G[1],C[2]=W[2]+G[2],C[3]=W[3]+G[3],C;}function A(C,W,G){return C[0]=W[0]-G[0],C[1]=W[1]-G[1],C[2]=W[2]-G[2],C[3]=W[3]-G[3],C;}function R(C,W){return C[0]===W[0]&&C[1]===W[1]&&C[2]===W[2]&&C[3]===W[3];}function b(C,W){var G=C[0],K=C[1],X=C[2],Z=C[3],B=W[0],z=W[1],Q=W[2],et=W[3];return Math.abs(G-B)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(B))&&Math.abs(K-z)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(z))&&Math.abs(X-Q)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Q))&&Math.abs(Z-et)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(et));}function E(C,W,G){return C[0]=W[0]*G,C[1]=W[1]*G,C[2]=W[2]*G,C[3]=W[3]*G,C;}function L(C,W,G,K){return C[0]=W[0]+G[0]*K,C[1]=W[1]+G[1]*K,C[2]=W[2]+G[2]*K,C[3]=W[3]+G[3]*K,C;}var D=M,I=A;},/* 4 */ /***/function(f,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 c;}),t.d(r,"invert",function(){return p;}),t.d(r,"determinant",function(){return h;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotate",function(){return y;}),t.d(r,"scale",function(){return M;}),t.d(r,"translate",function(){return T;}),t.d(r,"fromRotation",function(){return m;}),t.d(r,"fromScaling",function(){return x;}),t.d(r,"fromTranslation",function(){return l;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return u;}),t.d(r,"add",function(){return g;}),t.d(r,"subtract",function(){return O;}),t.d(r,"multiplyScalar",function(){return A;}),t.d(r,"multiplyScalarAndAdd",function(){return R;}),t.d(r,"exactEquals",function(){return b;}),t.d(r,"equals",function(){return E;}),t.d(r,"mul",function(){return L;}),t.d(r,"sub",function(){return D;});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 C=new e.ARRAY_TYPE(6);return C[0]=I[0],C[1]=I[1],C[2]=I[2],C[3]=I[3],C[4]=I[4],C[5]=I[5],C;}function a(I,C){return I[0]=C[0],I[1]=C[1],I[2]=C[2],I[3]=C[3],I[4]=C[4],I[5]=C[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,C,W,G,K,X){var Z=new e.ARRAY_TYPE(6);return Z[0]=I,Z[1]=C,Z[2]=W,Z[3]=G,Z[4]=K,Z[5]=X,Z;}function c(I,C,W,G,K,X,Z){return I[0]=C,I[1]=W,I[2]=G,I[3]=K,I[4]=X,I[5]=Z,I;}function p(I,C){var W=C[0],G=C[1],K=C[2],X=C[3],Z=C[4],B=C[5],z=W*X-G*K;return z?(z=1/z,I[0]=X*z,I[1]=-G*z,I[2]=-K*z,I[3]=W*z,I[4]=(K*B-X*Z)*z,I[5]=(G*Z-W*B)*z,I):null;}function h(I){return I[0]*I[3]-I[1]*I[2];}function v(I,C,W){var G=C[0],K=C[1],X=C[2],Z=C[3],B=C[4],z=C[5],Q=W[0],et=W[1],_=W[2],st=W[3],q=W[4],ht=W[5];return I[0]=G*Q+X*et,I[1]=K*Q+Z*et,I[2]=G*_+X*st,I[3]=K*_+Z*st,I[4]=G*q+X*ht+B,I[5]=K*q+Z*ht+z,I;}function y(I,C,W){var G=C[0],K=C[1],X=C[2],Z=C[3],B=C[4],z=C[5],Q=Math.sin(W),et=Math.cos(W);return I[0]=G*et+X*Q,I[1]=K*et+Z*Q,I[2]=G*-Q+X*et,I[3]=K*-Q+Z*et,I[4]=B,I[5]=z,I;}function M(I,C,W){var G=C[0],K=C[1],X=C[2],Z=C[3],B=C[4],z=C[5],Q=W[0],et=W[1];return I[0]=G*Q,I[1]=K*Q,I[2]=X*et,I[3]=Z*et,I[4]=B,I[5]=z,I;}function T(I,C,W){var G=C[0],K=C[1],X=C[2],Z=C[3],B=C[4],z=C[5],Q=W[0],et=W[1];return I[0]=G,I[1]=K,I[2]=X,I[3]=Z,I[4]=G*Q+X*et+B,I[5]=K*Q+Z*et+z,I;}function m(I,C){var W=Math.sin(C),G=Math.cos(C);return I[0]=G,I[1]=W,I[2]=-W,I[3]=G,I[4]=0,I[5]=0,I;}function x(I,C){return I[0]=C[0],I[1]=0,I[2]=0,I[3]=C[1],I[4]=0,I[5]=0,I;}function l(I,C){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=C[0],I[5]=C[1],I;}function d(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 g(I,C,W){return I[0]=C[0]+W[0],I[1]=C[1]+W[1],I[2]=C[2]+W[2],I[3]=C[3]+W[3],I[4]=C[4]+W[4],I[5]=C[5]+W[5],I;}function O(I,C,W){return I[0]=C[0]-W[0],I[1]=C[1]-W[1],I[2]=C[2]-W[2],I[3]=C[3]-W[3],I[4]=C[4]-W[4],I[5]=C[5]-W[5],I;}function A(I,C,W){return I[0]=C[0]*W,I[1]=C[1]*W,I[2]=C[2]*W,I[3]=C[3]*W,I[4]=C[4]*W,I[5]=C[5]*W,I;}function R(I,C,W,G){return I[0]=C[0]+W[0]*G,I[1]=C[1]+W[1]*G,I[2]=C[2]+W[2]*G,I[3]=C[3]+W[3]*G,I[4]=C[4]+W[4]*G,I[5]=C[5]+W[5]*G,I;}function b(I,C){return I[0]===C[0]&&I[1]===C[1]&&I[2]===C[2]&&I[3]===C[3]&&I[4]===C[4]&&I[5]===C[5];}function E(I,C){var W=I[0],G=I[1],K=I[2],X=I[3],Z=I[4],B=I[5],z=C[0],Q=C[1],et=C[2],_=C[3],st=C[4],q=C[5];return Math.abs(W-z)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(z))&&Math.abs(G-Q)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(Q))&&Math.abs(K-et)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(et))&&Math.abs(X-_)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(_))&&Math.abs(Z-st)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(st))&&Math.abs(B-q)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(q));}var L=v,D=O;},/* 5 */ /***/function(f,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 c;}),t.d(r,"identity",function(){return p;}),t.d(r,"transpose",function(){return h;}),t.d(r,"invert",function(){return v;}),t.d(r,"adjoint",function(){return y;}),t.d(r,"determinant",function(){return M;}),t.d(r,"multiply",function(){return T;}),t.d(r,"translate",function(){return m;}),t.d(r,"rotate",function(){return x;}),t.d(r,"scale",function(){return l;}),t.d(r,"fromTranslation",function(){return d;}),t.d(r,"fromRotation",function(){return u;}),t.d(r,"fromScaling",function(){return g;}),t.d(r,"fromMat2d",function(){return O;}),t.d(r,"fromQuat",function(){return A;}),t.d(r,"normalFromMat4",function(){return R;}),t.d(r,"projection",function(){return b;}),t.d(r,"str",function(){return E;}),t.d(r,"frob",function(){return L;}),t.d(r,"add",function(){return D;}),t.d(r,"subtract",function(){return I;}),t.d(r,"multiplyScalar",function(){return C;}),t.d(r,"multiplyScalarAndAdd",function(){return W;}),t.d(r,"exactEquals",function(){return G;}),t.d(r,"equals",function(){return K;}),t.d(r,"mul",function(){return X;}),t.d(r,"sub",function(){return Z;});var e=t(2);function n(){var B=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(B[1]=0,B[2]=0,B[3]=0,B[5]=0,B[6]=0,B[7]=0),B[0]=1,B[4]=1,B[8]=1,B;}function i(B,z){return B[0]=z[0],B[1]=z[1],B[2]=z[2],B[3]=z[4],B[4]=z[5],B[5]=z[6],B[6]=z[8],B[7]=z[9],B[8]=z[10],B;}function a(B){var z=new e.ARRAY_TYPE(9);return z[0]=B[0],z[1]=B[1],z[2]=B[2],z[3]=B[3],z[4]=B[4],z[5]=B[5],z[6]=B[6],z[7]=B[7],z[8]=B[8],z;}function o(B,z){return B[0]=z[0],B[1]=z[1],B[2]=z[2],B[3]=z[3],B[4]=z[4],B[5]=z[5],B[6]=z[6],B[7]=z[7],B[8]=z[8],B;}function s(B,z,Q,et,_,st,q,ht,dt){var F=new e.ARRAY_TYPE(9);return F[0]=B,F[1]=z,F[2]=Q,F[3]=et,F[4]=_,F[5]=st,F[6]=q,F[7]=ht,F[8]=dt,F;}function c(B,z,Q,et,_,st,q,ht,dt,F){return B[0]=z,B[1]=Q,B[2]=et,B[3]=_,B[4]=st,B[5]=q,B[6]=ht,B[7]=dt,B[8]=F,B;}function p(B){return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=1,B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function h(B,z){if(B===z){var Q=z[1],et=z[2],_=z[5];B[1]=z[3],B[2]=z[6],B[3]=Q,B[5]=z[7],B[6]=et,B[7]=_;}else B[0]=z[0],B[1]=z[3],B[2]=z[6],B[3]=z[1],B[4]=z[4],B[5]=z[7],B[6]=z[2],B[7]=z[5],B[8]=z[8];return B;}function v(B,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=z[4],ht=z[5],dt=z[6],F=z[7],U=z[8],V=U*q-ht*F,J=-U*st+ht*dt,N=F*st-q*dt,$=Q*V+et*J+_*N;return $?($=1/$,B[0]=V*$,B[1]=(-U*et+_*F)*$,B[2]=(ht*et-_*q)*$,B[3]=J*$,B[4]=(U*Q-_*dt)*$,B[5]=(-ht*Q+_*st)*$,B[6]=N*$,B[7]=(-F*Q+et*dt)*$,B[8]=(q*Q-et*st)*$,B):null;}function y(B,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=z[4],ht=z[5],dt=z[6],F=z[7],U=z[8];return B[0]=q*U-ht*F,B[1]=_*F-et*U,B[2]=et*ht-_*q,B[3]=ht*dt-st*U,B[4]=Q*U-_*dt,B[5]=_*st-Q*ht,B[6]=st*F-q*dt,B[7]=et*dt-Q*F,B[8]=Q*q-et*st,B;}function M(B){var z=B[0],Q=B[1],et=B[2],_=B[3],st=B[4],q=B[5],ht=B[6],dt=B[7],F=B[8];return z*(F*st-q*dt)+Q*(-F*_+q*ht)+et*(dt*_-st*ht);}function T(B,z,Q){var et=z[0],_=z[1],st=z[2],q=z[3],ht=z[4],dt=z[5],F=z[6],U=z[7],V=z[8],J=Q[0],N=Q[1],$=Q[2],S=Q[3],P=Q[4],w=Q[5],j=Q[6],H=Q[7],Y=Q[8];return B[0]=J*et+N*q+$*F,B[1]=J*_+N*ht+$*U,B[2]=J*st+N*dt+$*V,B[3]=S*et+P*q+w*F,B[4]=S*_+P*ht+w*U,B[5]=S*st+P*dt+w*V,B[6]=j*et+H*q+Y*F,B[7]=j*_+H*ht+Y*U,B[8]=j*st+H*dt+Y*V,B;}function m(B,z,Q){var et=z[0],_=z[1],st=z[2],q=z[3],ht=z[4],dt=z[5],F=z[6],U=z[7],V=z[8],J=Q[0],N=Q[1];return B[0]=et,B[1]=_,B[2]=st,B[3]=q,B[4]=ht,B[5]=dt,B[6]=J*et+N*q+F,B[7]=J*_+N*ht+U,B[8]=J*st+N*dt+V,B;}function x(B,z,Q){var et=z[0],_=z[1],st=z[2],q=z[3],ht=z[4],dt=z[5],F=z[6],U=z[7],V=z[8],J=Math.sin(Q),N=Math.cos(Q);return B[0]=N*et+J*q,B[1]=N*_+J*ht,B[2]=N*st+J*dt,B[3]=N*q-J*et,B[4]=N*ht-J*_,B[5]=N*dt-J*st,B[6]=F,B[7]=U,B[8]=V,B;}function l(B,z,Q){var et=Q[0],_=Q[1];return B[0]=et*z[0],B[1]=et*z[1],B[2]=et*z[2],B[3]=_*z[3],B[4]=_*z[4],B[5]=_*z[5],B[6]=z[6],B[7]=z[7],B[8]=z[8],B;}function d(B,z){return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=1,B[5]=0,B[6]=z[0],B[7]=z[1],B[8]=1,B;}function u(B,z){var Q=Math.sin(z),et=Math.cos(z);return B[0]=et,B[1]=Q,B[2]=0,B[3]=-Q,B[4]=et,B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function g(B,z){return B[0]=z[0],B[1]=0,B[2]=0,B[3]=0,B[4]=z[1],B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function O(B,z){return B[0]=z[0],B[1]=z[1],B[2]=0,B[3]=z[2],B[4]=z[3],B[5]=0,B[6]=z[4],B[7]=z[5],B[8]=1,B;}function A(B,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=Q+Q,ht=et+et,dt=_+_,F=Q*q,U=et*q,V=et*ht,J=_*q,N=_*ht,$=_*dt,S=st*q,P=st*ht,w=st*dt;return B[0]=1-V-$,B[3]=U-w,B[6]=J+P,B[1]=U+w,B[4]=1-F-$,B[7]=N-S,B[2]=J-P,B[5]=N+S,B[8]=1-F-V,B;}function R(B,z){var Q=z[0],et=z[1],_=z[2],st=z[3],q=z[4],ht=z[5],dt=z[6],F=z[7],U=z[8],V=z[9],J=z[10],N=z[11],$=z[12],S=z[13],P=z[14],w=z[15],j=Q*ht-et*q,H=Q*dt-_*q,Y=Q*F-st*q,k=et*dt-_*ht,rt=et*F-st*ht,it=_*F-st*dt,lt=U*S-V*$,ut=U*P-J*$,at=U*w-N*$,ot=V*P-J*S,ct=V*w-N*S,vt=J*w-N*P,mt=j*vt-H*ct+Y*ot+k*at-rt*ut+it*lt;return mt?(mt=1/mt,B[0]=(ht*vt-dt*ct+F*ot)*mt,B[1]=(dt*at-q*vt-F*ut)*mt,B[2]=(q*ct-ht*at+F*lt)*mt,B[3]=(_*ct-et*vt-st*ot)*mt,B[4]=(Q*vt-_*at+st*ut)*mt,B[5]=(et*at-Q*ct-st*lt)*mt,B[6]=(S*it-P*rt+w*k)*mt,B[7]=(P*Y-$*it-w*H)*mt,B[8]=($*rt-S*Y+w*j)*mt,B):null;}function b(B,z,Q){return B[0]=2/z,B[1]=0,B[2]=0,B[3]=0,B[4]=-2/Q,B[5]=0,B[6]=-1,B[7]=1,B[8]=1,B;}function E(B){return"mat3("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+", "+B[8]+")";}function L(B){return Math.hypot(B[0],B[1],B[2],B[3],B[4],B[5],B[6],B[7],B[8]);}function D(B,z,Q){return B[0]=z[0]+Q[0],B[1]=z[1]+Q[1],B[2]=z[2]+Q[2],B[3]=z[3]+Q[3],B[4]=z[4]+Q[4],B[5]=z[5]+Q[5],B[6]=z[6]+Q[6],B[7]=z[7]+Q[7],B[8]=z[8]+Q[8],B;}function I(B,z,Q){return B[0]=z[0]-Q[0],B[1]=z[1]-Q[1],B[2]=z[2]-Q[2],B[3]=z[3]-Q[3],B[4]=z[4]-Q[4],B[5]=z[5]-Q[5],B[6]=z[6]-Q[6],B[7]=z[7]-Q[7],B[8]=z[8]-Q[8],B;}function C(B,z,Q){return B[0]=z[0]*Q,B[1]=z[1]*Q,B[2]=z[2]*Q,B[3]=z[3]*Q,B[4]=z[4]*Q,B[5]=z[5]*Q,B[6]=z[6]*Q,B[7]=z[7]*Q,B[8]=z[8]*Q,B;}function W(B,z,Q,et){return B[0]=z[0]+Q[0]*et,B[1]=z[1]+Q[1]*et,B[2]=z[2]+Q[2]*et,B[3]=z[3]+Q[3]*et,B[4]=z[4]+Q[4]*et,B[5]=z[5]+Q[5]*et,B[6]=z[6]+Q[6]*et,B[7]=z[7]+Q[7]*et,B[8]=z[8]+Q[8]*et,B;}function G(B,z){return B[0]===z[0]&&B[1]===z[1]&&B[2]===z[2]&&B[3]===z[3]&&B[4]===z[4]&&B[5]===z[5]&&B[6]===z[6]&&B[7]===z[7]&&B[8]===z[8];}function K(B,z){var Q=B[0],et=B[1],_=B[2],st=B[3],q=B[4],ht=B[5],dt=B[6],F=B[7],U=B[8],V=z[0],J=z[1],N=z[2],$=z[3],S=z[4],P=z[5],w=z[6],j=z[7],H=z[8];return Math.abs(Q-V)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(V))&&Math.abs(et-J)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(J))&&Math.abs(_-N)<=e.EPSILON*Math.max(1,Math.abs(_),Math.abs(N))&&Math.abs(st-$)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs($))&&Math.abs(q-S)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(S))&&Math.abs(ht-P)<=e.EPSILON*Math.max(1,Math.abs(ht),Math.abs(P))&&Math.abs(dt-w)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(w))&&Math.abs(F-j)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(j))&&Math.abs(U-H)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(H));}var X=T,Z=I;},/* 6 */ /***/function(f,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 c;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return h;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return M;}),t.d(r,"translate",function(){return T;}),t.d(r,"scale",function(){return m;}),t.d(r,"rotate",function(){return x;}),t.d(r,"rotateX",function(){return l;}),t.d(r,"rotateY",function(){return d;}),t.d(r,"rotateZ",function(){return u;}),t.d(r,"fromTranslation",function(){return g;}),t.d(r,"fromScaling",function(){return O;}),t.d(r,"fromRotation",function(){return A;}),t.d(r,"fromXRotation",function(){return R;}),t.d(r,"fromYRotation",function(){return b;}),t.d(r,"fromZRotation",function(){return E;}),t.d(r,"fromRotationTranslation",function(){return L;}),t.d(r,"fromQuat2",function(){return D;}),t.d(r,"getTranslation",function(){return I;}),t.d(r,"getScaling",function(){return C;}),t.d(r,"getRotation",function(){return W;}),t.d(r,"fromRotationTranslationScale",function(){return G;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return K;}),t.d(r,"fromQuat",function(){return X;}),t.d(r,"frustum",function(){return Z;}),t.d(r,"perspective",function(){return B;}),t.d(r,"perspectiveFromFieldOfView",function(){return z;}),t.d(r,"ortho",function(){return Q;}),t.d(r,"lookAt",function(){return et;}),t.d(r,"targetTo",function(){return _;}),t.d(r,"str",function(){return st;}),t.d(r,"frob",function(){return q;}),t.d(r,"add",function(){return ht;}),t.d(r,"subtract",function(){return dt;}),t.d(r,"multiplyScalar",function(){return F;}),t.d(r,"multiplyScalarAndAdd",function(){return U;}),t.d(r,"exactEquals",function(){return V;}),t.d(r,"equals",function(){return J;}),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 P=new e.ARRAY_TYPE(16);return P[0]=S[0],P[1]=S[1],P[2]=S[2],P[3]=S[3],P[4]=S[4],P[5]=S[5],P[6]=S[6],P[7]=S[7],P[8]=S[8],P[9]=S[9],P[10]=S[10],P[11]=S[11],P[12]=S[12],P[13]=S[13],P[14]=S[14],P[15]=S[15],P;}function a(S,P){return S[0]=P[0],S[1]=P[1],S[2]=P[2],S[3]=P[3],S[4]=P[4],S[5]=P[5],S[6]=P[6],S[7]=P[7],S[8]=P[8],S[9]=P[9],S[10]=P[10],S[11]=P[11],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15],S;}function o(S,P,w,j,H,Y,k,rt,it,lt,ut,at,ot,ct,vt,mt){var pt=new e.ARRAY_TYPE(16);return pt[0]=S,pt[1]=P,pt[2]=w,pt[3]=j,pt[4]=H,pt[5]=Y,pt[6]=k,pt[7]=rt,pt[8]=it,pt[9]=lt,pt[10]=ut,pt[11]=at,pt[12]=ot,pt[13]=ct,pt[14]=vt,pt[15]=mt,pt;}function s(S,P,w,j,H,Y,k,rt,it,lt,ut,at,ot,ct,vt,mt,pt){return S[0]=P,S[1]=w,S[2]=j,S[3]=H,S[4]=Y,S[5]=k,S[6]=rt,S[7]=it,S[8]=lt,S[9]=ut,S[10]=at,S[11]=ot,S[12]=ct,S[13]=vt,S[14]=mt,S[15]=pt,S;}function c(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 p(S,P){if(S===P){var w=P[1],j=P[2],H=P[3],Y=P[6],k=P[7],rt=P[11];S[1]=P[4],S[2]=P[8],S[3]=P[12],S[4]=w,S[6]=P[9],S[7]=P[13],S[8]=j,S[9]=Y,S[11]=P[14],S[12]=H,S[13]=k,S[14]=rt;}else S[0]=P[0],S[1]=P[4],S[2]=P[8],S[3]=P[12],S[4]=P[1],S[5]=P[5],S[6]=P[9],S[7]=P[13],S[8]=P[2],S[9]=P[6],S[10]=P[10],S[11]=P[14],S[12]=P[3],S[13]=P[7],S[14]=P[11],S[15]=P[15];return S;}function h(S,P){var w=P[0],j=P[1],H=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],at=P[9],ot=P[10],ct=P[11],vt=P[12],mt=P[13],pt=P[14],St=P[15],Rt=w*rt-j*k,Pt=w*it-H*k,Et=w*lt-Y*k,At=j*it-H*rt,Ct=j*lt-Y*rt,Gt=H*lt-Y*it,Ut=ut*mt-at*vt,jt=ut*pt-ot*vt,$t=ut*St-ct*vt,Ht=at*pt-ot*mt,Kt=at*St-ct*mt,Yt=ot*St-ct*pt,bt=Rt*Yt-Pt*Kt+Et*Ht+At*$t-Ct*jt+Gt*Ut;return bt?(bt=1/bt,S[0]=(rt*Yt-it*Kt+lt*Ht)*bt,S[1]=(H*Kt-j*Yt-Y*Ht)*bt,S[2]=(mt*Gt-pt*Ct+St*At)*bt,S[3]=(ot*Ct-at*Gt-ct*At)*bt,S[4]=(it*$t-k*Yt-lt*jt)*bt,S[5]=(w*Yt-H*$t+Y*jt)*bt,S[6]=(pt*Et-vt*Gt-St*Pt)*bt,S[7]=(ut*Gt-ot*Et+ct*Pt)*bt,S[8]=(k*Kt-rt*$t+lt*Ut)*bt,S[9]=(j*$t-w*Kt-Y*Ut)*bt,S[10]=(vt*Ct-mt*Et+St*Rt)*bt,S[11]=(at*Et-ut*Ct-ct*Rt)*bt,S[12]=(rt*jt-k*Ht-it*Ut)*bt,S[13]=(w*Ht-j*jt+H*Ut)*bt,S[14]=(mt*Pt-vt*At-pt*Rt)*bt,S[15]=(ut*At-at*Pt+ot*Rt)*bt,S):null;}function v(S,P){var w=P[0],j=P[1],H=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],at=P[9],ot=P[10],ct=P[11],vt=P[12],mt=P[13],pt=P[14],St=P[15];return S[0]=rt*(ot*St-ct*pt)-at*(it*St-lt*pt)+mt*(it*ct-lt*ot),S[1]=-(j*(ot*St-ct*pt)-at*(H*St-Y*pt)+mt*(H*ct-Y*ot)),S[2]=j*(it*St-lt*pt)-rt*(H*St-Y*pt)+mt*(H*lt-Y*it),S[3]=-(j*(it*ct-lt*ot)-rt*(H*ct-Y*ot)+at*(H*lt-Y*it)),S[4]=-(k*(ot*St-ct*pt)-ut*(it*St-lt*pt)+vt*(it*ct-lt*ot)),S[5]=w*(ot*St-ct*pt)-ut*(H*St-Y*pt)+vt*(H*ct-Y*ot),S[6]=-(w*(it*St-lt*pt)-k*(H*St-Y*pt)+vt*(H*lt-Y*it)),S[7]=w*(it*ct-lt*ot)-k*(H*ct-Y*ot)+ut*(H*lt-Y*it),S[8]=k*(at*St-ct*mt)-ut*(rt*St-lt*mt)+vt*(rt*ct-lt*at),S[9]=-(w*(at*St-ct*mt)-ut*(j*St-Y*mt)+vt*(j*ct-Y*at)),S[10]=w*(rt*St-lt*mt)-k*(j*St-Y*mt)+vt*(j*lt-Y*rt),S[11]=-(w*(rt*ct-lt*at)-k*(j*ct-Y*at)+ut*(j*lt-Y*rt)),S[12]=-(k*(at*pt-ot*mt)-ut*(rt*pt-it*mt)+vt*(rt*ot-it*at)),S[13]=w*(at*pt-ot*mt)-ut*(j*pt-H*mt)+vt*(j*ot-H*at),S[14]=-(w*(rt*pt-it*mt)-k*(j*pt-H*mt)+vt*(j*it-H*rt)),S[15]=w*(rt*ot-it*at)-k*(j*ot-H*at)+ut*(j*it-H*rt),S;}function y(S){var P=S[0],w=S[1],j=S[2],H=S[3],Y=S[4],k=S[5],rt=S[6],it=S[7],lt=S[8],ut=S[9],at=S[10],ot=S[11],ct=S[12],vt=S[13],mt=S[14],pt=S[15],St=P*k-w*Y,Rt=P*rt-j*Y,Pt=P*it-H*Y,Et=w*rt-j*k,At=w*it-H*k,Ct=j*it-H*rt,Gt=lt*vt-ut*ct,Ut=lt*mt-at*ct,jt=lt*pt-ot*ct,$t=ut*mt-at*vt,Ht=ut*pt-ot*vt,Kt=at*pt-ot*mt;return St*Kt-Rt*Ht+Pt*$t+Et*jt-At*Ut+Ct*Gt;}function M(S,P,w){var j=P[0],H=P[1],Y=P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],at=P[8],ot=P[9],ct=P[10],vt=P[11],mt=P[12],pt=P[13],St=P[14],Rt=P[15],Pt=w[0],Et=w[1],At=w[2],Ct=w[3];return S[0]=Pt*j+Et*rt+At*at+Ct*mt,S[1]=Pt*H+Et*it+At*ot+Ct*pt,S[2]=Pt*Y+Et*lt+At*ct+Ct*St,S[3]=Pt*k+Et*ut+At*vt+Ct*Rt,Pt=w[4],Et=w[5],At=w[6],Ct=w[7],S[4]=Pt*j+Et*rt+At*at+Ct*mt,S[5]=Pt*H+Et*it+At*ot+Ct*pt,S[6]=Pt*Y+Et*lt+At*ct+Ct*St,S[7]=Pt*k+Et*ut+At*vt+Ct*Rt,Pt=w[8],Et=w[9],At=w[10],Ct=w[11],S[8]=Pt*j+Et*rt+At*at+Ct*mt,S[9]=Pt*H+Et*it+At*ot+Ct*pt,S[10]=Pt*Y+Et*lt+At*ct+Ct*St,S[11]=Pt*k+Et*ut+At*vt+Ct*Rt,Pt=w[12],Et=w[13],At=w[14],Ct=w[15],S[12]=Pt*j+Et*rt+At*at+Ct*mt,S[13]=Pt*H+Et*it+At*ot+Ct*pt,S[14]=Pt*Y+Et*lt+At*ct+Ct*St,S[15]=Pt*k+Et*ut+At*vt+Ct*Rt,S;}function T(S,P,w){var j=w[0],H=w[1],Y=w[2],k,rt,it,lt,ut,at,ot,ct,vt,mt,pt,St;return P===S?(S[12]=P[0]*j+P[4]*H+P[8]*Y+P[12],S[13]=P[1]*j+P[5]*H+P[9]*Y+P[13],S[14]=P[2]*j+P[6]*H+P[10]*Y+P[14],S[15]=P[3]*j+P[7]*H+P[11]*Y+P[15]):(k=P[0],rt=P[1],it=P[2],lt=P[3],ut=P[4],at=P[5],ot=P[6],ct=P[7],vt=P[8],mt=P[9],pt=P[10],St=P[11],S[0]=k,S[1]=rt,S[2]=it,S[3]=lt,S[4]=ut,S[5]=at,S[6]=ot,S[7]=ct,S[8]=vt,S[9]=mt,S[10]=pt,S[11]=St,S[12]=k*j+ut*H+vt*Y+P[12],S[13]=rt*j+at*H+mt*Y+P[13],S[14]=it*j+ot*H+pt*Y+P[14],S[15]=lt*j+ct*H+St*Y+P[15]),S;}function m(S,P,w){var j=w[0],H=w[1],Y=w[2];return S[0]=P[0]*j,S[1]=P[1]*j,S[2]=P[2]*j,S[3]=P[3]*j,S[4]=P[4]*H,S[5]=P[5]*H,S[6]=P[6]*H,S[7]=P[7]*H,S[8]=P[8]*Y,S[9]=P[9]*Y,S[10]=P[10]*Y,S[11]=P[11]*Y,S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15],S;}function x(S,P,w,j){var H=j[0],Y=j[1],k=j[2],rt=Math.hypot(H,Y,k),it,lt,ut,at,ot,ct,vt,mt,pt,St,Rt,Pt,Et,At,Ct,Gt,Ut,jt,$t,Ht,Kt,Yt,bt,Zt;return rt<e.EPSILON?null:(rt=1/rt,H*=rt,Y*=rt,k*=rt,it=Math.sin(w),lt=Math.cos(w),ut=1-lt,at=P[0],ot=P[1],ct=P[2],vt=P[3],mt=P[4],pt=P[5],St=P[6],Rt=P[7],Pt=P[8],Et=P[9],At=P[10],Ct=P[11],Gt=H*H*ut+lt,Ut=Y*H*ut+k*it,jt=k*H*ut-Y*it,$t=H*Y*ut-k*it,Ht=Y*Y*ut+lt,Kt=k*Y*ut+H*it,Yt=H*k*ut+Y*it,bt=Y*k*ut-H*it,Zt=k*k*ut+lt,S[0]=at*Gt+mt*Ut+Pt*jt,S[1]=ot*Gt+pt*Ut+Et*jt,S[2]=ct*Gt+St*Ut+At*jt,S[3]=vt*Gt+Rt*Ut+Ct*jt,S[4]=at*$t+mt*Ht+Pt*Kt,S[5]=ot*$t+pt*Ht+Et*Kt,S[6]=ct*$t+St*Ht+At*Kt,S[7]=vt*$t+Rt*Ht+Ct*Kt,S[8]=at*Yt+mt*bt+Pt*Zt,S[9]=ot*Yt+pt*bt+Et*Zt,S[10]=ct*Yt+St*bt+At*Zt,S[11]=vt*Yt+Rt*bt+Ct*Zt,P!==S&&(S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S);}function l(S,P,w){var j=Math.sin(w),H=Math.cos(w),Y=P[4],k=P[5],rt=P[6],it=P[7],lt=P[8],ut=P[9],at=P[10],ot=P[11];return P!==S&&(S[0]=P[0],S[1]=P[1],S[2]=P[2],S[3]=P[3],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[4]=Y*H+lt*j,S[5]=k*H+ut*j,S[6]=rt*H+at*j,S[7]=it*H+ot*j,S[8]=lt*H-Y*j,S[9]=ut*H-k*j,S[10]=at*H-rt*j,S[11]=ot*H-it*j,S;}function d(S,P,w){var j=Math.sin(w),H=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[8],ut=P[9],at=P[10],ot=P[11];return P!==S&&(S[4]=P[4],S[5]=P[5],S[6]=P[6],S[7]=P[7],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[0]=Y*H-lt*j,S[1]=k*H-ut*j,S[2]=rt*H-at*j,S[3]=it*H-ot*j,S[8]=Y*j+lt*H,S[9]=k*j+ut*H,S[10]=rt*j+at*H,S[11]=it*j+ot*H,S;}function u(S,P,w){var j=Math.sin(w),H=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[4],ut=P[5],at=P[6],ot=P[7];return P!==S&&(S[8]=P[8],S[9]=P[9],S[10]=P[10],S[11]=P[11],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[0]=Y*H+lt*j,S[1]=k*H+ut*j,S[2]=rt*H+at*j,S[3]=it*H+ot*j,S[4]=lt*H-Y*j,S[5]=ut*H-k*j,S[6]=at*H-rt*j,S[7]=ot*H-it*j,S;}function g(S,P){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]=P[0],S[13]=P[1],S[14]=P[2],S[15]=1,S;}function O(S,P){return S[0]=P[0],S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=P[1],S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=P[2],S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function A(S,P,w){var j=w[0],H=w[1],Y=w[2],k=Math.hypot(j,H,Y),rt,it,lt;return k<e.EPSILON?null:(k=1/k,j*=k,H*=k,Y*=k,rt=Math.sin(P),it=Math.cos(P),lt=1-it,S[0]=j*j*lt+it,S[1]=H*j*lt+Y*rt,S[2]=Y*j*lt-H*rt,S[3]=0,S[4]=j*H*lt-Y*rt,S[5]=H*H*lt+it,S[6]=Y*H*lt+j*rt,S[7]=0,S[8]=j*Y*lt+H*rt,S[9]=H*Y*lt-j*rt,S[10]=Y*Y*lt+it,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S);}function R(S,P){var w=Math.sin(P),j=Math.cos(P);return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=j,S[6]=w,S[7]=0,S[8]=0,S[9]=-w,S[10]=j,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function b(S,P){var w=Math.sin(P),j=Math.cos(P);return S[0]=j,S[1]=0,S[2]=-w,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=w,S[9]=0,S[10]=j,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function E(S,P){var w=Math.sin(P),j=Math.cos(P);return S[0]=j,S[1]=w,S[2]=0,S[3]=0,S[4]=-w,S[5]=j,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 L(S,P,w){var j=P[0],H=P[1],Y=P[2],k=P[3],rt=j+j,it=H+H,lt=Y+Y,ut=j*rt,at=j*it,ot=j*lt,ct=H*it,vt=H*lt,mt=Y*lt,pt=k*rt,St=k*it,Rt=k*lt;return S[0]=1-(ct+mt),S[1]=at+Rt,S[2]=ot-St,S[3]=0,S[4]=at-Rt,S[5]=1-(ut+mt),S[6]=vt+pt,S[7]=0,S[8]=ot+St,S[9]=vt-pt,S[10]=1-(ut+ct),S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S;}function D(S,P){var w=new e.ARRAY_TYPE(3),j=-P[0],H=-P[1],Y=-P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],at=j*j+H*H+Y*Y+k*k;return at>0?(w[0]=(rt*k+ut*j+it*Y-lt*H)*2/at,w[1]=(it*k+ut*H+lt*j-rt*Y)*2/at,w[2]=(lt*k+ut*Y+rt*H-it*j)*2/at):(w[0]=(rt*k+ut*j+it*Y-lt*H)*2,w[1]=(it*k+ut*H+lt*j-rt*Y)*2,w[2]=(lt*k+ut*Y+rt*H-it*j)*2),L(S,P,w),S;}function I(S,P){return S[0]=P[12],S[1]=P[13],S[2]=P[14],S;}function C(S,P){var w=P[0],j=P[1],H=P[2],Y=P[4],k=P[5],rt=P[6],it=P[8],lt=P[9],ut=P[10];return S[0]=Math.hypot(w,j,H),S[1]=Math.hypot(Y,k,rt),S[2]=Math.hypot(it,lt,ut),S;}function W(S,P){var w=new e.ARRAY_TYPE(3);C(w,P);var j=1/w[0],H=1/w[1],Y=1/w[2],k=P[0]*j,rt=P[1]*H,it=P[2]*Y,lt=P[4]*j,ut=P[5]*H,at=P[6]*Y,ot=P[8]*j,ct=P[9]*H,vt=P[10]*Y,mt=k+ut+vt,pt=0;return mt>0?(pt=Math.sqrt(mt+1)*2,S[3]=0.25*pt,S[0]=(at-ct)/pt,S[1]=(ot-it)/pt,S[2]=(rt-lt)/pt):k>ut&&k>vt?(pt=Math.sqrt(1+k-ut-vt)*2,S[3]=(at-ct)/pt,S[0]=0.25*pt,S[1]=(rt+lt)/pt,S[2]=(ot+it)/pt):ut>vt?(pt=Math.sqrt(1+ut-k-vt)*2,S[3]=(ot-it)/pt,S[0]=(rt+lt)/pt,S[1]=0.25*pt,S[2]=(at+ct)/pt):(pt=Math.sqrt(1+vt-k-ut)*2,S[3]=(rt-lt)/pt,S[0]=(ot+it)/pt,S[1]=(at+ct)/pt,S[2]=0.25*pt),S;}function G(S,P,w,j){var H=P[0],Y=P[1],k=P[2],rt=P[3],it=H+H,lt=Y+Y,ut=k+k,at=H*it,ot=H*lt,ct=H*ut,vt=Y*lt,mt=Y*ut,pt=k*ut,St=rt*it,Rt=rt*lt,Pt=rt*ut,Et=j[0],At=j[1],Ct=j[2];return S[0]=(1-(vt+pt))*Et,S[1]=(ot+Pt)*Et,S[2]=(ct-Rt)*Et,S[3]=0,S[4]=(ot-Pt)*At,S[5]=(1-(at+pt))*At,S[6]=(mt+St)*At,S[7]=0,S[8]=(ct+Rt)*Ct,S[9]=(mt-St)*Ct,S[10]=(1-(at+vt))*Ct,S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S;}function K(S,P,w,j,H){var Y=P[0],k=P[1],rt=P[2],it=P[3],lt=Y+Y,ut=k+k,at=rt+rt,ot=Y*lt,ct=Y*ut,vt=Y*at,mt=k*ut,pt=k*at,St=rt*at,Rt=it*lt,Pt=it*ut,Et=it*at,At=j[0],Ct=j[1],Gt=j[2],Ut=H[0],jt=H[1],$t=H[2],Ht=(1-(mt+St))*At,Kt=(ct+Et)*At,Yt=(vt-Pt)*At,bt=(ct-Et)*Ct,Zt=(1-(ot+St))*Ct,Re=(pt+Rt)*Ct,Ie=(vt+Pt)*Gt,wr=(pt-Rt)*Gt,Nr=(1-(ot+mt))*Gt;return S[0]=Ht,S[1]=Kt,S[2]=Yt,S[3]=0,S[4]=bt,S[5]=Zt,S[6]=Re,S[7]=0,S[8]=Ie,S[9]=wr,S[10]=Nr,S[11]=0,S[12]=w[0]+Ut-(Ht*Ut+bt*jt+Ie*$t),S[13]=w[1]+jt-(Kt*Ut+Zt*jt+wr*$t),S[14]=w[2]+$t-(Yt*Ut+Re*jt+Nr*$t),S[15]=1,S;}function X(S,P){var w=P[0],j=P[1],H=P[2],Y=P[3],k=w+w,rt=j+j,it=H+H,lt=w*k,ut=j*k,at=j*rt,ot=H*k,ct=H*rt,vt=H*it,mt=Y*k,pt=Y*rt,St=Y*it;return S[0]=1-at-vt,S[1]=ut+St,S[2]=ot-pt,S[3]=0,S[4]=ut-St,S[5]=1-lt-vt,S[6]=ct+mt,S[7]=0,S[8]=ot+pt,S[9]=ct-mt,S[10]=1-lt-at,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function Z(S,P,w,j,H,Y,k){var rt=1/(w-P),it=1/(H-j),lt=1/(Y-k);return S[0]=Y*2*rt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y*2*it,S[6]=0,S[7]=0,S[8]=(w+P)*rt,S[9]=(H+j)*it,S[10]=(k+Y)*lt,S[11]=-1,S[12]=0,S[13]=0,S[14]=k*Y*2*lt,S[15]=0,S;}function B(S,P,w,j,H){var Y=1/Math.tan(P/2),k;return S[0]=Y/w,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y,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?(k=1/(j-H),S[10]=(H+j)*k,S[14]=2*H*j*k):(S[10]=-1,S[14]=-2*j),S;}function z(S,P,w,j){var H=Math.tan(P.upDegrees*Math.PI/180),Y=Math.tan(P.downDegrees*Math.PI/180),k=Math.tan(P.leftDegrees*Math.PI/180),rt=Math.tan(P.rightDegrees*Math.PI/180),it=2/(k+rt),lt=2/(H+Y);return S[0]=it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=lt,S[6]=0,S[7]=0,S[8]=-((k-rt)*it*0.5),S[9]=(H-Y)*lt*0.5,S[10]=j/(w-j),S[11]=-1,S[12]=0,S[13]=0,S[14]=j*w/(w-j),S[15]=0,S;}function Q(S,P,w,j,H,Y,k){var rt=1/(P-w),it=1/(j-H),lt=1/(Y-k);return S[0]=-2*rt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*it,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*lt,S[11]=0,S[12]=(P+w)*rt,S[13]=(H+j)*it,S[14]=(k+Y)*lt,S[15]=1,S;}function et(S,P,w,j){var H,Y,k,rt,it,lt,ut,at,ot,ct,vt=P[0],mt=P[1],pt=P[2],St=j[0],Rt=j[1],Pt=j[2],Et=w[0],At=w[1],Ct=w[2];return Math.abs(vt-Et)<e.EPSILON&&Math.abs(mt-At)<e.EPSILON&&Math.abs(pt-Ct)<e.EPSILON?c(S):(ut=vt-Et,at=mt-At,ot=pt-Ct,ct=1/Math.hypot(ut,at,ot),ut*=ct,at*=ct,ot*=ct,H=Rt*ot-Pt*at,Y=Pt*ut-St*ot,k=St*at-Rt*ut,ct=Math.hypot(H,Y,k),ct?(ct=1/ct,H*=ct,Y*=ct,k*=ct):(H=0,Y=0,k=0),rt=at*k-ot*Y,it=ot*H-ut*k,lt=ut*Y-at*H,ct=Math.hypot(rt,it,lt),ct?(ct=1/ct,rt*=ct,it*=ct,lt*=ct):(rt=0,it=0,lt=0),S[0]=H,S[1]=rt,S[2]=ut,S[3]=0,S[4]=Y,S[5]=it,S[6]=at,S[7]=0,S[8]=k,S[9]=lt,S[10]=ot,S[11]=0,S[12]=-(H*vt+Y*mt+k*pt),S[13]=-(rt*vt+it*mt+lt*pt),S[14]=-(ut*vt+at*mt+ot*pt),S[15]=1,S);}function _(S,P,w,j){var H=P[0],Y=P[1],k=P[2],rt=j[0],it=j[1],lt=j[2],ut=H-w[0],at=Y-w[1],ot=k-w[2],ct=ut*ut+at*at+ot*ot;ct>0&&(ct=1/Math.sqrt(ct),ut*=ct,at*=ct,ot*=ct);var vt=it*ot-lt*at,mt=lt*ut-rt*ot,pt=rt*at-it*ut;return ct=vt*vt+mt*mt+pt*pt,ct>0&&(ct=1/Math.sqrt(ct),vt*=ct,mt*=ct,pt*=ct),S[0]=vt,S[1]=mt,S[2]=pt,S[3]=0,S[4]=at*pt-ot*mt,S[5]=ot*vt-ut*pt,S[6]=ut*mt-at*vt,S[7]=0,S[8]=ut,S[9]=at,S[10]=ot,S[11]=0,S[12]=H,S[13]=Y,S[14]=k,S[15]=1,S;}function st(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 q(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,P,w){return S[0]=P[0]+w[0],S[1]=P[1]+w[1],S[2]=P[2]+w[2],S[3]=P[3]+w[3],S[4]=P[4]+w[4],S[5]=P[5]+w[5],S[6]=P[6]+w[6],S[7]=P[7]+w[7],S[8]=P[8]+w[8],S[9]=P[9]+w[9],S[10]=P[10]+w[10],S[11]=P[11]+w[11],S[12]=P[12]+w[12],S[13]=P[13]+w[13],S[14]=P[14]+w[14],S[15]=P[15]+w[15],S;}function dt(S,P,w){return S[0]=P[0]-w[0],S[1]=P[1]-w[1],S[2]=P[2]-w[2],S[3]=P[3]-w[3],S[4]=P[4]-w[4],S[5]=P[5]-w[5],S[6]=P[6]-w[6],S[7]=P[7]-w[7],S[8]=P[8]-w[8],S[9]=P[9]-w[9],S[10]=P[10]-w[10],S[11]=P[11]-w[11],S[12]=P[12]-w[12],S[13]=P[13]-w[13],S[14]=P[14]-w[14],S[15]=P[15]-w[15],S;}function F(S,P,w){return S[0]=P[0]*w,S[1]=P[1]*w,S[2]=P[2]*w,S[3]=P[3]*w,S[4]=P[4]*w,S[5]=P[5]*w,S[6]=P[6]*w,S[7]=P[7]*w,S[8]=P[8]*w,S[9]=P[9]*w,S[10]=P[10]*w,S[11]=P[11]*w,S[12]=P[12]*w,S[13]=P[13]*w,S[14]=P[14]*w,S[15]=P[15]*w,S;}function U(S,P,w,j){return S[0]=P[0]+w[0]*j,S[1]=P[1]+w[1]*j,S[2]=P[2]+w[2]*j,S[3]=P[3]+w[3]*j,S[4]=P[4]+w[4]*j,S[5]=P[5]+w[5]*j,S[6]=P[6]+w[6]*j,S[7]=P[7]+w[7]*j,S[8]=P[8]+w[8]*j,S[9]=P[9]+w[9]*j,S[10]=P[10]+w[10]*j,S[11]=P[11]+w[11]*j,S[12]=P[12]+w[12]*j,S[13]=P[13]+w[13]*j,S[14]=P[14]+w[14]*j,S[15]=P[15]+w[15]*j,S;}function V(S,P){return S[0]===P[0]&&S[1]===P[1]&&S[2]===P[2]&&S[3]===P[3]&&S[4]===P[4]&&S[5]===P[5]&&S[6]===P[6]&&S[7]===P[7]&&S[8]===P[8]&&S[9]===P[9]&&S[10]===P[10]&&S[11]===P[11]&&S[12]===P[12]&&S[13]===P[13]&&S[14]===P[14]&&S[15]===P[15];}function J(S,P){var w=S[0],j=S[1],H=S[2],Y=S[3],k=S[4],rt=S[5],it=S[6],lt=S[7],ut=S[8],at=S[9],ot=S[10],ct=S[11],vt=S[12],mt=S[13],pt=S[14],St=S[15],Rt=P[0],Pt=P[1],Et=P[2],At=P[3],Ct=P[4],Gt=P[5],Ut=P[6],jt=P[7],$t=P[8],Ht=P[9],Kt=P[10],Yt=P[11],bt=P[12],Zt=P[13],Re=P[14],Ie=P[15];return Math.abs(w-Rt)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(Rt))&&Math.abs(j-Pt)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Pt))&&Math.abs(H-Et)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(Et))&&Math.abs(Y-At)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(At))&&Math.abs(k-Ct)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(Ct))&&Math.abs(rt-Gt)<=e.EPSILON*Math.max(1,Math.abs(rt),Math.abs(Gt))&&Math.abs(it-Ut)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(Ut))&&Math.abs(lt-jt)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs(jt))&&Math.abs(ut-$t)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs($t))&&Math.abs(at-Ht)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs(Ht))&&Math.abs(ot-Kt)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Kt))&&Math.abs(ct-Yt)<=e.EPSILON*Math.max(1,Math.abs(ct),Math.abs(Yt))&&Math.abs(vt-bt)<=e.EPSILON*Math.max(1,Math.abs(vt),Math.abs(bt))&&Math.abs(mt-Zt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Zt))&&Math.abs(pt-Re)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Re))&&Math.abs(St-Ie)<=e.EPSILON*Math.max(1,Math.abs(St),Math.abs(Ie));}var N=M,$=dt;},/* 7 */ /***/function(f,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 c;}),t.d(r,"getAxisAngle",function(){return p;}),t.d(r,"getAngle",function(){return h;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotateX",function(){return y;}),t.d(r,"rotateY",function(){return M;}),t.d(r,"rotateZ",function(){return T;}),t.d(r,"calculateW",function(){return m;}),t.d(r,"exp",function(){return x;}),t.d(r,"ln",function(){return l;}),t.d(r,"pow",function(){return d;}),t.d(r,"slerp",function(){return u;}),t.d(r,"random",function(){return g;}),t.d(r,"invert",function(){return O;}),t.d(r,"conjugate",function(){return A;}),t.d(r,"fromMat3",function(){return R;}),t.d(r,"fromEuler",function(){return b;}),t.d(r,"str",function(){return E;}),t.d(r,"clone",function(){return L;}),t.d(r,"fromValues",function(){return D;}),t.d(r,"copy",function(){return I;}),t.d(r,"set",function(){return C;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return G;}),t.d(r,"scale",function(){return K;}),t.d(r,"dot",function(){return X;}),t.d(r,"lerp",function(){return Z;}),t.d(r,"length",function(){return B;}),t.d(r,"len",function(){return z;}),t.d(r,"squaredLength",function(){return Q;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return _;}),t.d(r,"exactEquals",function(){return st;}),t.d(r,"equals",function(){return q;}),t.d(r,"rotationTo",function(){return ht;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return F;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var U=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(U[0]=0,U[1]=0,U[2]=0),U[3]=1,U;}function s(U){return U[0]=0,U[1]=0,U[2]=0,U[3]=1,U;}function c(U,V,J){J=J*0.5;var N=Math.sin(J);return U[0]=N*V[0],U[1]=N*V[1],U[2]=N*V[2],U[3]=Math.cos(J),U;}function p(U,V){var J=Math.acos(V[3])*2,N=Math.sin(J/2);return N>e.EPSILON?(U[0]=V[0]/N,U[1]=V[1]/N,U[2]=V[2]/N):(U[0]=1,U[1]=0,U[2]=0),J;}function h(U,V){var J=X(U,V);return Math.acos(2*J*J-1);}function v(U,V,J){var N=V[0],$=V[1],S=V[2],P=V[3],w=J[0],j=J[1],H=J[2],Y=J[3];return U[0]=N*Y+P*w+$*H-S*j,U[1]=$*Y+P*j+S*w-N*H,U[2]=S*Y+P*H+N*j-$*w,U[3]=P*Y-N*w-$*j-S*H,U;}function y(U,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),j=Math.cos(J);return U[0]=N*j+P*w,U[1]=$*j+S*w,U[2]=S*j-$*w,U[3]=P*j-N*w,U;}function M(U,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),j=Math.cos(J);return U[0]=N*j-S*w,U[1]=$*j+P*w,U[2]=S*j+N*w,U[3]=P*j-$*w,U;}function T(U,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),j=Math.cos(J);return U[0]=N*j+$*w,U[1]=$*j-N*w,U[2]=S*j+P*w,U[3]=P*j-S*w,U;}function m(U,V){var J=V[0],N=V[1],$=V[2];return U[0]=J,U[1]=N,U[2]=$,U[3]=Math.sqrt(Math.abs(1-J*J-N*N-$*$)),U;}function x(U,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=Math.sqrt(J*J+N*N+$*$),w=Math.exp(S),j=P>0?w*Math.sin(P)/P:0;return U[0]=J*j,U[1]=N*j,U[2]=$*j,U[3]=w*Math.cos(P),U;}function l(U,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=Math.sqrt(J*J+N*N+$*$),w=P>0?Math.atan2(P,S)/P:0;return U[0]=J*w,U[1]=N*w,U[2]=$*w,U[3]=0.5*Math.log(J*J+N*N+$*$+S*S),U;}function d(U,V,J){return l(U,V),K(U,U,J),x(U,U),U;}function u(U,V,J,N){var $=V[0],S=V[1],P=V[2],w=V[3],j=J[0],H=J[1],Y=J[2],k=J[3],rt,it,lt,ut,at;return it=$*j+S*H+P*Y+w*k,it<0&&(it=-it,j=-j,H=-H,Y=-Y,k=-k),1-it>e.EPSILON?(rt=Math.acos(it),lt=Math.sin(rt),ut=Math.sin((1-N)*rt)/lt,at=Math.sin(N*rt)/lt):(ut=1-N,at=N),U[0]=ut*$+at*j,U[1]=ut*S+at*H,U[2]=ut*P+at*Y,U[3]=ut*w+at*k,U;}function g(U){var V=e.RANDOM(),J=e.RANDOM(),N=e.RANDOM(),$=Math.sqrt(1-V),S=Math.sqrt(V);return U[0]=$*Math.sin(2*Math.PI*J),U[1]=$*Math.cos(2*Math.PI*J),U[2]=S*Math.sin(2*Math.PI*N),U[3]=S*Math.cos(2*Math.PI*N),U;}function O(U,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=J*J+N*N+$*$+S*S,w=P?1/P:0;return U[0]=-J*w,U[1]=-N*w,U[2]=-$*w,U[3]=S*w,U;}function A(U,V){return U[0]=-V[0],U[1]=-V[1],U[2]=-V[2],U[3]=V[3],U;}function R(U,V){var J=V[0]+V[4]+V[8],N;if(J>0)N=Math.sqrt(J+1),U[3]=0.5*N,N=0.5/N,U[0]=(V[5]-V[7])*N,U[1]=(V[6]-V[2])*N,U[2]=(V[1]-V[3])*N;else{var $=0;V[4]>V[0]&&($=1),V[8]>V[$*3+$]&&($=2);var S=($+1)%3,P=($+2)%3;N=Math.sqrt(V[$*3+$]-V[S*3+S]-V[P*3+P]+1),U[$]=0.5*N,N=0.5/N,U[3]=(V[S*3+P]-V[P*3+S])*N,U[S]=(V[S*3+$]+V[$*3+S])*N,U[P]=(V[P*3+$]+V[$*3+P])*N;}return U;}function b(U,V,J,N){var $=0.5*Math.PI/180;V*=$,J*=$,N*=$;var S=Math.sin(V),P=Math.cos(V),w=Math.sin(J),j=Math.cos(J),H=Math.sin(N),Y=Math.cos(N);return U[0]=S*j*Y-P*w*H,U[1]=P*w*Y+S*j*H,U[2]=P*j*H-S*w*Y,U[3]=P*j*Y+S*w*H,U;}function E(U){return"quat("+U[0]+", "+U[1]+", "+U[2]+", "+U[3]+")";}var L=a.clone,D=a.fromValues,I=a.copy,C=a.set,W=a.add,G=v,K=a.scale,X=a.dot,Z=a.lerp,B=a.length,z=B,Q=a.squaredLength,et=Q,_=a.normalize,st=a.exactEquals,q=a.equals,ht=function(){var U=i.create(),V=i.fromValues(1,0,0),J=i.fromValues(0,1,0);return function(N,$,S){var P=i.dot($,S);return P<-0.999999?(i.cross(U,V,$),i.len(U)<1e-6&&i.cross(U,J,$),i.normalize(U,U),c(N,U,Math.PI),N):P>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(U,$,S),N[0]=U[0],N[1]=U[1],N[2]=U[2],N[3]=1+P,_(N,N));};}(),dt=function(){var U=o(),V=o();return function(J,N,$,S,P,w){return u(U,N,P,w),u(V,$,S,w),u(J,U,V,2*w*(1-w)),J;};}(),F=function(){var U=n.create();return function(V,J,N,$){return U[0]=N[0],U[3]=N[1],U[6]=N[2],U[1]=$[0],U[4]=$[1],U[7]=$[2],U[2]=-J[0],U[5]=-J[1],U[8]=-J[2],_(V,R(V,U));};}();},/* 8 */ /***/function(f,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 c;}),t.d(r,"add",function(){return p;}),t.d(r,"subtract",function(){return h;}),t.d(r,"multiply",function(){return v;}),t.d(r,"divide",function(){return y;}),t.d(r,"ceil",function(){return M;}),t.d(r,"floor",function(){return T;}),t.d(r,"min",function(){return m;}),t.d(r,"max",function(){return x;}),t.d(r,"round",function(){return l;}),t.d(r,"scale",function(){return d;}),t.d(r,"scaleAndAdd",function(){return u;}),t.d(r,"distance",function(){return g;}),t.d(r,"squaredDistance",function(){return O;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"hermite",function(){return C;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return G;}),t.d(r,"transformMat4",function(){return K;}),t.d(r,"transformMat3",function(){return X;}),t.d(r,"transformQuat",function(){return Z;}),t.d(r,"rotateX",function(){return B;}),t.d(r,"rotateY",function(){return z;}),t.d(r,"rotateZ",function(){return Q;}),t.d(r,"angle",function(){return et;}),t.d(r,"zero",function(){return _;}),t.d(r,"str",function(){return st;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return ht;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return F;}),t.d(r,"div",function(){return U;}),t.d(r,"dist",function(){return V;}),t.d(r,"sqrDist",function(){return J;}),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 P=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(P[0]=0,P[1]=0,P[2]=0),P;}function i(P){var w=new e.ARRAY_TYPE(3);return w[0]=P[0],w[1]=P[1],w[2]=P[2],w;}function a(P){var w=P[0],j=P[1],H=P[2];return Math.hypot(w,j,H);}function o(P,w,j){var H=new e.ARRAY_TYPE(3);return H[0]=P,H[1]=w,H[2]=j,H;}function s(P,w){return P[0]=w[0],P[1]=w[1],P[2]=w[2],P;}function c(P,w,j,H){return P[0]=w,P[1]=j,P[2]=H,P;}function p(P,w,j){return P[0]=w[0]+j[0],P[1]=w[1]+j[1],P[2]=w[2]+j[2],P;}function h(P,w,j){return P[0]=w[0]-j[0],P[1]=w[1]-j[1],P[2]=w[2]-j[2],P;}function v(P,w,j){return P[0]=w[0]*j[0],P[1]=w[1]*j[1],P[2]=w[2]*j[2],P;}function y(P,w,j){return P[0]=w[0]/j[0],P[1]=w[1]/j[1],P[2]=w[2]/j[2],P;}function M(P,w){return P[0]=Math.ceil(w[0]),P[1]=Math.ceil(w[1]),P[2]=Math.ceil(w[2]),P;}function T(P,w){return P[0]=Math.floor(w[0]),P[1]=Math.floor(w[1]),P[2]=Math.floor(w[2]),P;}function m(P,w,j){return P[0]=Math.min(w[0],j[0]),P[1]=Math.min(w[1],j[1]),P[2]=Math.min(w[2],j[2]),P;}function x(P,w,j){return P[0]=Math.max(w[0],j[0]),P[1]=Math.max(w[1],j[1]),P[2]=Math.max(w[2],j[2]),P;}function l(P,w){return P[0]=Math.round(w[0]),P[1]=Math.round(w[1]),P[2]=Math.round(w[2]),P;}function d(P,w,j){return P[0]=w[0]*j,P[1]=w[1]*j,P[2]=w[2]*j,P;}function u(P,w,j,H){return P[0]=w[0]+j[0]*H,P[1]=w[1]+j[1]*H,P[2]=w[2]+j[2]*H,P;}function g(P,w){var j=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return Math.hypot(j,H,Y);}function O(P,w){var j=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return j*j+H*H+Y*Y;}function A(P){var w=P[0],j=P[1],H=P[2];return w*w+j*j+H*H;}function R(P,w){return P[0]=-w[0],P[1]=-w[1],P[2]=-w[2],P;}function b(P,w){return P[0]=1/w[0],P[1]=1/w[1],P[2]=1/w[2],P;}function E(P,w){var j=w[0],H=w[1],Y=w[2],k=j*j+H*H+Y*Y;return k>0&&(k=1/Math.sqrt(k)),P[0]=w[0]*k,P[1]=w[1]*k,P[2]=w[2]*k,P;}function L(P,w){return P[0]*w[0]+P[1]*w[1]+P[2]*w[2];}function D(P,w,j){var H=w[0],Y=w[1],k=w[2],rt=j[0],it=j[1],lt=j[2];return P[0]=Y*lt-k*it,P[1]=k*rt-H*lt,P[2]=H*it-Y*rt,P;}function I(P,w,j,H){var Y=w[0],k=w[1],rt=w[2];return P[0]=Y+H*(j[0]-Y),P[1]=k+H*(j[1]-k),P[2]=rt+H*(j[2]-rt),P;}function C(P,w,j,H,Y,k){var rt=k*k,it=rt*(2*k-3)+1,lt=rt*(k-2)+k,ut=rt*(k-1),at=rt*(3-2*k);return P[0]=w[0]*it+j[0]*lt+H[0]*ut+Y[0]*at,P[1]=w[1]*it+j[1]*lt+H[1]*ut+Y[1]*at,P[2]=w[2]*it+j[2]*lt+H[2]*ut+Y[2]*at,P;}function W(P,w,j,H,Y,k){var rt=1-k,it=rt*rt,lt=k*k,ut=it*rt,at=3*k*it,ot=3*lt*rt,ct=lt*k;return P[0]=w[0]*ut+j[0]*at+H[0]*ot+Y[0]*ct,P[1]=w[1]*ut+j[1]*at+H[1]*ot+Y[1]*ct,P[2]=w[2]*ut+j[2]*at+H[2]*ot+Y[2]*ct,P;}function G(P,w){w=w||1;var j=e.RANDOM()*2*Math.PI,H=e.RANDOM()*2-1,Y=Math.sqrt(1-H*H)*w;return P[0]=Math.cos(j)*Y,P[1]=Math.sin(j)*Y,P[2]=H*w,P;}function K(P,w,j){var H=w[0],Y=w[1],k=w[2],rt=j[3]*H+j[7]*Y+j[11]*k+j[15];return rt=rt||1,P[0]=(j[0]*H+j[4]*Y+j[8]*k+j[12])/rt,P[1]=(j[1]*H+j[5]*Y+j[9]*k+j[13])/rt,P[2]=(j[2]*H+j[6]*Y+j[10]*k+j[14])/rt,P;}function X(P,w,j){var H=w[0],Y=w[1],k=w[2];return P[0]=H*j[0]+Y*j[3]+k*j[6],P[1]=H*j[1]+Y*j[4]+k*j[7],P[2]=H*j[2]+Y*j[5]+k*j[8],P;}function Z(P,w,j){var H=j[0],Y=j[1],k=j[2],rt=j[3],it=w[0],lt=w[1],ut=w[2],at=Y*ut-k*lt,ot=k*it-H*ut,ct=H*lt-Y*it,vt=Y*ct-k*ot,mt=k*at-H*ct,pt=H*ot-Y*at,St=rt*2;return at*=St,ot*=St,ct*=St,vt*=2,mt*=2,pt*=2,P[0]=it+at+vt,P[1]=lt+ot+mt,P[2]=ut+ct+pt,P;}function B(P,w,j,H){var Y=[],k=[];return Y[0]=w[0]-j[0],Y[1]=w[1]-j[1],Y[2]=w[2]-j[2],k[0]=Y[0],k[1]=Y[1]*Math.cos(H)-Y[2]*Math.sin(H),k[2]=Y[1]*Math.sin(H)+Y[2]*Math.cos(H),P[0]=k[0]+j[0],P[1]=k[1]+j[1],P[2]=k[2]+j[2],P;}function z(P,w,j,H){var Y=[],k=[];return Y[0]=w[0]-j[0],Y[1]=w[1]-j[1],Y[2]=w[2]-j[2],k[0]=Y[2]*Math.sin(H)+Y[0]*Math.cos(H),k[1]=Y[1],k[2]=Y[2]*Math.cos(H)-Y[0]*Math.sin(H),P[0]=k[0]+j[0],P[1]=k[1]+j[1],P[2]=k[2]+j[2],P;}function Q(P,w,j,H){var Y=[],k=[];return Y[0]=w[0]-j[0],Y[1]=w[1]-j[1],Y[2]=w[2]-j[2],k[0]=Y[0]*Math.cos(H)-Y[1]*Math.sin(H),k[1]=Y[0]*Math.sin(H)+Y[1]*Math.cos(H),k[2]=Y[2],P[0]=k[0]+j[0],P[1]=k[1]+j[1],P[2]=k[2]+j[2],P;}function et(P,w){var j=P[0],H=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2],lt=Math.sqrt(j*j+H*H+Y*Y),ut=Math.sqrt(k*k+rt*rt+it*it),at=lt*ut,ot=at&&L(P,w)/at;return Math.acos(Math.min(Math.max(ot,-1),1));}function _(P){return P[0]=0,P[1]=0,P[2]=0,P;}function st(P){return"vec3("+P[0]+", "+P[1]+", "+P[2]+")";}function q(P,w){return P[0]===w[0]&&P[1]===w[1]&&P[2]===w[2];}function ht(P,w){var j=P[0],H=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2];return Math.abs(j-k)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(k))&&Math.abs(H-rt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(rt))&&Math.abs(Y-it)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(it));}var dt=h,F=v,U=y,V=g,J=O,N=a,$=A,S=function(){var P=n();return function(w,j,H,Y,k,rt){var it,lt;for(j||(j=3),H||(H=0),Y?lt=Math.min(Y*j+H,w.length):lt=w.length,it=H;it<lt;it+=j)P[0]=w[it],P[1]=w[it+1],P[2]=w[it+2],k(P,P,rt),w[it]=P[0],w[it+1]=P[1],w[it+2]=P[2];return w;};}();},/* 9 */ /***/function(f,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 c;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return h;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return M;}),t.d(r,"min",function(){return T;}),t.d(r,"max",function(){return m;}),t.d(r,"round",function(){return x;}),t.d(r,"scale",function(){return l;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return O;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat4",function(){return W;}),t.d(r,"transformQuat",function(){return G;}),t.d(r,"zero",function(){return K;}),t.d(r,"str",function(){return X;}),t.d(r,"exactEquals",function(){return Z;}),t.d(r,"equals",function(){return B;}),t.d(r,"sub",function(){return z;}),t.d(r,"mul",function(){return Q;}),t.d(r,"div",function(){return et;}),t.d(r,"dist",function(){return _;}),t.d(r,"sqrDist",function(){return st;}),t.d(r,"len",function(){return q;}),t.d(r,"sqrLen",function(){return ht;}),t.d(r,"forEach",function(){return dt;});var e=t(2);function n(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[3]=0),F;}function i(F){var U=new e.ARRAY_TYPE(4);return U[0]=F[0],U[1]=F[1],U[2]=F[2],U[3]=F[3],U;}function a(F,U,V,J){var N=new e.ARRAY_TYPE(4);return N[0]=F,N[1]=U,N[2]=V,N[3]=J,N;}function o(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F;}function s(F,U,V,J,N){return F[0]=U,F[1]=V,F[2]=J,F[3]=N,F;}function c(F,U,V){return F[0]=U[0]+V[0],F[1]=U[1]+V[1],F[2]=U[2]+V[2],F[3]=U[3]+V[3],F;}function p(F,U,V){return F[0]=U[0]-V[0],F[1]=U[1]-V[1],F[2]=U[2]-V[2],F[3]=U[3]-V[3],F;}function h(F,U,V){return F[0]=U[0]*V[0],F[1]=U[1]*V[1],F[2]=U[2]*V[2],F[3]=U[3]*V[3],F;}function v(F,U,V){return F[0]=U[0]/V[0],F[1]=U[1]/V[1],F[2]=U[2]/V[2],F[3]=U[3]/V[3],F;}function y(F,U){return F[0]=Math.ceil(U[0]),F[1]=Math.ceil(U[1]),F[2]=Math.ceil(U[2]),F[3]=Math.ceil(U[3]),F;}function M(F,U){return F[0]=Math.floor(U[0]),F[1]=Math.floor(U[1]),F[2]=Math.floor(U[2]),F[3]=Math.floor(U[3]),F;}function T(F,U,V){return F[0]=Math.min(U[0],V[0]),F[1]=Math.min(U[1],V[1]),F[2]=Math.min(U[2],V[2]),F[3]=Math.min(U[3],V[3]),F;}function m(F,U,V){return F[0]=Math.max(U[0],V[0]),F[1]=Math.max(U[1],V[1]),F[2]=Math.max(U[2],V[2]),F[3]=Math.max(U[3],V[3]),F;}function x(F,U){return F[0]=Math.round(U[0]),F[1]=Math.round(U[1]),F[2]=Math.round(U[2]),F[3]=Math.round(U[3]),F;}function l(F,U,V){return F[0]=U[0]*V,F[1]=U[1]*V,F[2]=U[2]*V,F[3]=U[3]*V,F;}function d(F,U,V,J){return F[0]=U[0]+V[0]*J,F[1]=U[1]+V[1]*J,F[2]=U[2]+V[2]*J,F[3]=U[3]+V[3]*J,F;}function u(F,U){var V=U[0]-F[0],J=U[1]-F[1],N=U[2]-F[2],$=U[3]-F[3];return Math.hypot(V,J,N,$);}function g(F,U){var V=U[0]-F[0],J=U[1]-F[1],N=U[2]-F[2],$=U[3]-F[3];return V*V+J*J+N*N+$*$;}function O(F){var U=F[0],V=F[1],J=F[2],N=F[3];return Math.hypot(U,V,J,N);}function A(F){var U=F[0],V=F[1],J=F[2],N=F[3];return U*U+V*V+J*J+N*N;}function R(F,U){return F[0]=-U[0],F[1]=-U[1],F[2]=-U[2],F[3]=-U[3],F;}function b(F,U){return F[0]=1/U[0],F[1]=1/U[1],F[2]=1/U[2],F[3]=1/U[3],F;}function E(F,U){var V=U[0],J=U[1],N=U[2],$=U[3],S=V*V+J*J+N*N+$*$;return S>0&&(S=1/Math.sqrt(S)),F[0]=V*S,F[1]=J*S,F[2]=N*S,F[3]=$*S,F;}function L(F,U){return F[0]*U[0]+F[1]*U[1]+F[2]*U[2]+F[3]*U[3];}function D(F,U,V,J){var N=V[0]*J[1]-V[1]*J[0],$=V[0]*J[2]-V[2]*J[0],S=V[0]*J[3]-V[3]*J[0],P=V[1]*J[2]-V[2]*J[1],w=V[1]*J[3]-V[3]*J[1],j=V[2]*J[3]-V[3]*J[2],H=U[0],Y=U[1],k=U[2],rt=U[3];return F[0]=Y*j-k*w+rt*P,F[1]=-(H*j)+k*S-rt*$,F[2]=H*w-Y*S+rt*N,F[3]=-(H*P)+Y*$-k*N,F;}function I(F,U,V,J){var N=U[0],$=U[1],S=U[2],P=U[3];return F[0]=N+J*(V[0]-N),F[1]=$+J*(V[1]-$),F[2]=S+J*(V[2]-S),F[3]=P+J*(V[3]-P),F;}function C(F,U){U=U||1;var V,J,N,$,S,P;do V=e.RANDOM()*2-1,J=e.RANDOM()*2-1,S=V*V+J*J;while(S>=1);do N=e.RANDOM()*2-1,$=e.RANDOM()*2-1,P=N*N+$*$;while(P>=1);var w=Math.sqrt((1-S)/P);return F[0]=U*V,F[1]=U*J,F[2]=U*N*w,F[3]=U*$*w,F;}function W(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3];return F[0]=V[0]*J+V[4]*N+V[8]*$+V[12]*S,F[1]=V[1]*J+V[5]*N+V[9]*$+V[13]*S,F[2]=V[2]*J+V[6]*N+V[10]*$+V[14]*S,F[3]=V[3]*J+V[7]*N+V[11]*$+V[15]*S,F;}function G(F,U,V){var J=U[0],N=U[1],$=U[2],S=V[0],P=V[1],w=V[2],j=V[3],H=j*J+P*$-w*N,Y=j*N+w*J-S*$,k=j*$+S*N-P*J,rt=-S*J-P*N-w*$;return F[0]=H*j+rt*-S+Y*-w-k*-P,F[1]=Y*j+rt*-P+k*-S-H*-w,F[2]=k*j+rt*-w+H*-P-Y*-S,F[3]=U[3],F;}function K(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=0,F;}function X(F){return"vec4("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}function Z(F,U){return F[0]===U[0]&&F[1]===U[1]&&F[2]===U[2]&&F[3]===U[3];}function B(F,U){var V=F[0],J=F[1],N=F[2],$=F[3],S=U[0],P=U[1],w=U[2],j=U[3];return Math.abs(V-S)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(S))&&Math.abs(J-P)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(P))&&Math.abs(N-w)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(w))&&Math.abs($-j)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(j));}var z=p,Q=h,et=v,_=u,st=g,q=O,ht=A,dt=function(){var F=n();return function(U,V,J,N,$,S){var P,w;for(V||(V=4),J||(J=0),N?w=Math.min(N*V+J,U.length):w=U.length,P=J;P<w;P+=V)F[0]=U[P],F[1]=U[P+1],F[2]=U[P+2],F[3]=U[P+3],$(F,F,S),U[P]=F[0],U[P+1]=F[1],U[P+2]=F[2],U[P+3]=F[3];return U;};}();},/* 10 */ /***/function(f,r,t){t.r(r),t.d(r,"create",function(){return a;}),t.d(r,"clone",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"fromRotationTranslationValues",function(){return c;}),t.d(r,"fromRotationTranslation",function(){return p;}),t.d(r,"fromTranslation",function(){return h;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromMat4",function(){return y;}),t.d(r,"copy",function(){return M;}),t.d(r,"identity",function(){return T;}),t.d(r,"set",function(){return m;}),t.d(r,"getReal",function(){return x;}),t.d(r,"getDual",function(){return l;}),t.d(r,"setReal",function(){return d;}),t.d(r,"setDual",function(){return u;}),t.d(r,"getTranslation",function(){return g;}),t.d(r,"translate",function(){return O;}),t.d(r,"rotateX",function(){return A;}),t.d(r,"rotateY",function(){return R;}),t.d(r,"rotateZ",function(){return b;}),t.d(r,"rotateByQuatAppend",function(){return E;}),t.d(r,"rotateByQuatPrepend",function(){return L;}),t.d(r,"rotateAroundAxis",function(){return D;}),t.d(r,"add",function(){return I;}),t.d(r,"multiply",function(){return C;}),t.d(r,"mul",function(){return W;}),t.d(r,"scale",function(){return G;}),t.d(r,"dot",function(){return K;}),t.d(r,"lerp",function(){return X;}),t.d(r,"invert",function(){return Z;}),t.d(r,"conjugate",function(){return B;}),t.d(r,"length",function(){return z;}),t.d(r,"len",function(){return Q;}),t.d(r,"squaredLength",function(){return et;}),t.d(r,"sqrLen",function(){return _;}),t.d(r,"normalize",function(){return st;}),t.d(r,"str",function(){return q;}),t.d(r,"exactEquals",function(){return ht;}),t.d(r,"equals",function(){return dt;});var e=t(2),n=t(7),i=t(6);function a(){var F=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[4]=0,F[5]=0,F[6]=0,F[7]=0),F[3]=1,F;}function o(F){var U=new e.ARRAY_TYPE(8);return U[0]=F[0],U[1]=F[1],U[2]=F[2],U[3]=F[3],U[4]=F[4],U[5]=F[5],U[6]=F[6],U[7]=F[7],U;}function s(F,U,V,J,N,$,S,P){var w=new e.ARRAY_TYPE(8);return w[0]=F,w[1]=U,w[2]=V,w[3]=J,w[4]=N,w[5]=$,w[6]=S,w[7]=P,w;}function c(F,U,V,J,N,$,S){var P=new e.ARRAY_TYPE(8);P[0]=F,P[1]=U,P[2]=V,P[3]=J;var w=N*0.5,j=$*0.5,H=S*0.5;return P[4]=w*J+j*V-H*U,P[5]=j*J+H*F-w*V,P[6]=H*J+w*U-j*F,P[7]=-w*F-j*U-H*V,P;}function p(F,U,V){var J=V[0]*0.5,N=V[1]*0.5,$=V[2]*0.5,S=U[0],P=U[1],w=U[2],j=U[3];return F[0]=S,F[1]=P,F[2]=w,F[3]=j,F[4]=J*j+N*w-$*P,F[5]=N*j+$*S-J*w,F[6]=$*j+J*P-N*S,F[7]=-J*S-N*P-$*w,F;}function h(F,U){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=U[0]*0.5,F[5]=U[1]*0.5,F[6]=U[2]*0.5,F[7]=0,F;}function v(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function y(F,U){var V=n.create();i.getRotation(V,U);var J=new e.ARRAY_TYPE(3);return i.getTranslation(J,U),p(F,V,J),F;}function M(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F[4]=U[4],F[5]=U[5],F[6]=U[6],F[7]=U[7],F;}function T(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function m(F,U,V,J,N,$,S,P,w){return F[0]=U,F[1]=V,F[2]=J,F[3]=N,F[4]=$,F[5]=S,F[6]=P,F[7]=w,F;}var x=n.copy;function l(F,U){return F[0]=U[4],F[1]=U[5],F[2]=U[6],F[3]=U[7],F;}var d=n.copy;function u(F,U){return F[4]=U[0],F[5]=U[1],F[6]=U[2],F[7]=U[3],F;}function g(F,U){var V=U[4],J=U[5],N=U[6],$=U[7],S=-U[0],P=-U[1],w=-U[2],j=U[3];return F[0]=(V*j+$*S+J*w-N*P)*2,F[1]=(J*j+$*P+N*S-V*w)*2,F[2]=(N*j+$*w+V*P-J*S)*2,F;}function O(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3],P=V[0]*0.5,w=V[1]*0.5,j=V[2]*0.5,H=U[4],Y=U[5],k=U[6],rt=U[7];return F[0]=J,F[1]=N,F[2]=$,F[3]=S,F[4]=S*P+N*j-$*w+H,F[5]=S*w+$*P-J*j+Y,F[6]=S*j+J*w-N*P+k,F[7]=-J*P-N*w-$*j+rt,F;}function A(F,U,V){var J=-U[0],N=-U[1],$=-U[2],S=U[3],P=U[4],w=U[5],j=U[6],H=U[7],Y=P*S+H*J+w*$-j*N,k=w*S+H*N+j*J-P*$,rt=j*S+H*$+P*N-w*J,it=H*S-P*J-w*N-j*$;return n.rotateX(F,U,V),J=F[0],N=F[1],$=F[2],S=F[3],F[4]=Y*S+it*J+k*$-rt*N,F[5]=k*S+it*N+rt*J-Y*$,F[6]=rt*S+it*$+Y*N-k*J,F[7]=it*S-Y*J-k*N-rt*$,F;}function R(F,U,V){var J=-U[0],N=-U[1],$=-U[2],S=U[3],P=U[4],w=U[5],j=U[6],H=U[7],Y=P*S+H*J+w*$-j*N,k=w*S+H*N+j*J-P*$,rt=j*S+H*$+P*N-w*J,it=H*S-P*J-w*N-j*$;return n.rotateY(F,U,V),J=F[0],N=F[1],$=F[2],S=F[3],F[4]=Y*S+it*J+k*$-rt*N,F[5]=k*S+it*N+rt*J-Y*$,F[6]=rt*S+it*$+Y*N-k*J,F[7]=it*S-Y*J-k*N-rt*$,F;}function b(F,U,V){var J=-U[0],N=-U[1],$=-U[2],S=U[3],P=U[4],w=U[5],j=U[6],H=U[7],Y=P*S+H*J+w*$-j*N,k=w*S+H*N+j*J-P*$,rt=j*S+H*$+P*N-w*J,it=H*S-P*J-w*N-j*$;return n.rotateZ(F,U,V),J=F[0],N=F[1],$=F[2],S=F[3],F[4]=Y*S+it*J+k*$-rt*N,F[5]=k*S+it*N+rt*J-Y*$,F[6]=rt*S+it*$+Y*N-k*J,F[7]=it*S-Y*J-k*N-rt*$,F;}function E(F,U,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=U[0],w=U[1],j=U[2],H=U[3];return F[0]=P*S+H*J+w*$-j*N,F[1]=w*S+H*N+j*J-P*$,F[2]=j*S+H*$+P*N-w*J,F[3]=H*S-P*J-w*N-j*$,P=U[4],w=U[5],j=U[6],H=U[7],F[4]=P*S+H*J+w*$-j*N,F[5]=w*S+H*N+j*J-P*$,F[6]=j*S+H*$+P*N-w*J,F[7]=H*S-P*J-w*N-j*$,F;}function L(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3],P=V[0],w=V[1],j=V[2],H=V[3];return F[0]=J*H+S*P+N*j-$*w,F[1]=N*H+S*w+$*P-J*j,F[2]=$*H+S*j+J*w-N*P,F[3]=S*H-J*P-N*w-$*j,P=V[4],w=V[5],j=V[6],H=V[7],F[4]=J*H+S*P+N*j-$*w,F[5]=N*H+S*w+$*P-J*j,F[6]=$*H+S*j+J*w-N*P,F[7]=S*H-J*P-N*w-$*j,F;}function D(F,U,V,J){if(Math.abs(J)<e.EPSILON)return M(F,U);var N=Math.hypot(V[0],V[1],V[2]);J=J*0.5;var $=Math.sin(J),S=$*V[0]/N,P=$*V[1]/N,w=$*V[2]/N,j=Math.cos(J),H=U[0],Y=U[1],k=U[2],rt=U[3];F[0]=H*j+rt*S+Y*w-k*P,F[1]=Y*j+rt*P+k*S-H*w,F[2]=k*j+rt*w+H*P-Y*S,F[3]=rt*j-H*S-Y*P-k*w;var it=U[4],lt=U[5],ut=U[6],at=U[7];return F[4]=it*j+at*S+lt*w-ut*P,F[5]=lt*j+at*P+ut*S-it*w,F[6]=ut*j+at*w+it*P-lt*S,F[7]=at*j-it*S-lt*P-ut*w,F;}function I(F,U,V){return F[0]=U[0]+V[0],F[1]=U[1]+V[1],F[2]=U[2]+V[2],F[3]=U[3]+V[3],F[4]=U[4]+V[4],F[5]=U[5]+V[5],F[6]=U[6]+V[6],F[7]=U[7]+V[7],F;}function C(F,U,V){var J=U[0],N=U[1],$=U[2],S=U[3],P=V[4],w=V[5],j=V[6],H=V[7],Y=U[4],k=U[5],rt=U[6],it=U[7],lt=V[0],ut=V[1],at=V[2],ot=V[3];return F[0]=J*ot+S*lt+N*at-$*ut,F[1]=N*ot+S*ut+$*lt-J*at,F[2]=$*ot+S*at+J*ut-N*lt,F[3]=S*ot-J*lt-N*ut-$*at,F[4]=J*H+S*P+N*j-$*w+Y*ot+it*lt+k*at-rt*ut,F[5]=N*H+S*w+$*P-J*j+k*ot+it*ut+rt*lt-Y*at,F[6]=$*H+S*j+J*w-N*P+rt*ot+it*at+Y*ut-k*lt,F[7]=S*H-J*P-N*w-$*j+it*ot-Y*lt-k*ut-rt*at,F;}var W=C;function G(F,U,V){return F[0]=U[0]*V,F[1]=U[1]*V,F[2]=U[2]*V,F[3]=U[3]*V,F[4]=U[4]*V,F[5]=U[5]*V,F[6]=U[6]*V,F[7]=U[7]*V,F;}var K=n.dot;function X(F,U,V,J){var N=1-J;return K(U,V)<0&&(J=-J),F[0]=U[0]*N+V[0]*J,F[1]=U[1]*N+V[1]*J,F[2]=U[2]*N+V[2]*J,F[3]=U[3]*N+V[3]*J,F[4]=U[4]*N+V[4]*J,F[5]=U[5]*N+V[5]*J,F[6]=U[6]*N+V[6]*J,F[7]=U[7]*N+V[7]*J,F;}function Z(F,U){var V=et(U);return F[0]=-U[0]/V,F[1]=-U[1]/V,F[2]=-U[2]/V,F[3]=U[3]/V,F[4]=-U[4]/V,F[5]=-U[5]/V,F[6]=-U[6]/V,F[7]=U[7]/V,F;}function B(F,U){return F[0]=-U[0],F[1]=-U[1],F[2]=-U[2],F[3]=U[3],F[4]=-U[4],F[5]=-U[5],F[6]=-U[6],F[7]=U[7],F;}var z=n.length,Q=z,et=n.squaredLength,_=et;function st(F,U){var V=et(U);if(V>0){V=Math.sqrt(V);var J=U[0]/V,N=U[1]/V,$=U[2]/V,S=U[3]/V,P=U[4],w=U[5],j=U[6],H=U[7],Y=J*P+N*w+$*j+S*H;F[0]=J,F[1]=N,F[2]=$,F[3]=S,F[4]=(P-J*Y)/V,F[5]=(w-N*Y)/V,F[6]=(j-$*Y)/V,F[7]=(H-S*Y)/V;}return F;}function q(F){return"quat2("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+", "+F[6]+", "+F[7]+")";}function ht(F,U){return F[0]===U[0]&&F[1]===U[1]&&F[2]===U[2]&&F[3]===U[3]&&F[4]===U[4]&&F[5]===U[5]&&F[6]===U[6]&&F[7]===U[7];}function dt(F,U){var V=F[0],J=F[1],N=F[2],$=F[3],S=F[4],P=F[5],w=F[6],j=F[7],H=U[0],Y=U[1],k=U[2],rt=U[3],it=U[4],lt=U[5],ut=U[6],at=U[7];return Math.abs(V-H)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(H))&&Math.abs(J-Y)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Y))&&Math.abs(N-k)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(k))&&Math.abs($-rt)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(rt))&&Math.abs(S-it)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(it))&&Math.abs(P-lt)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(lt))&&Math.abs(w-ut)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(ut))&&Math.abs(j-at)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(at));}},/* 11 */ /***/function(f,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 c;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return h;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return M;}),t.d(r,"min",function(){return T;}),t.d(r,"max",function(){return m;}),t.d(r,"round",function(){return x;}),t.d(r,"scale",function(){return l;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return O;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return G;}),t.d(r,"transformMat3",function(){return K;}),t.d(r,"transformMat4",function(){return X;}),t.d(r,"rotate",function(){return Z;}),t.d(r,"angle",function(){return B;}),t.d(r,"zero",function(){return z;}),t.d(r,"str",function(){return Q;}),t.d(r,"exactEquals",function(){return et;}),t.d(r,"equals",function(){return _;}),t.d(r,"len",function(){return st;}),t.d(r,"sub",function(){return q;}),t.d(r,"mul",function(){return ht;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return F;}),t.d(r,"sqrDist",function(){return U;}),t.d(r,"sqrLen",function(){return V;}),t.d(r,"forEach",function(){return J;});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 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 h(N,$,S){return N[0]=$[0]*S[0],N[1]=$[1]*S[1],N;}function v(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 M(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 m(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 l(N,$,S){return N[0]=$[0]*S,N[1]=$[1]*S,N;}function d(N,$,S,P){return N[0]=$[0]+S[0]*P,N[1]=$[1]+S[1]*P,N;}function u(N,$){var S=$[0]-N[0],P=$[1]-N[1];return Math.hypot(S,P);}function g(N,$){var S=$[0]-N[0],P=$[1]-N[1];return S*S+P*P;}function O(N){var $=N[0],S=N[1];return Math.hypot($,S);}function A(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 E(N,$){var S=$[0],P=$[1],w=S*S+P*P;return w>0&&(w=1/Math.sqrt(w)),N[0]=$[0]*w,N[1]=$[1]*w,N;}function L(N,$){return N[0]*$[0]+N[1]*$[1];}function D(N,$,S){var P=$[0]*S[1]-$[1]*S[0];return N[0]=N[1]=0,N[2]=P,N;}function I(N,$,S,P){var w=$[0],j=$[1];return N[0]=w+P*(S[0]-w),N[1]=j+P*(S[1]-j),N;}function C(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 P=$[0],w=$[1];return N[0]=S[0]*P+S[2]*w,N[1]=S[1]*P+S[3]*w,N;}function G(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[2]*w+S[4],N[1]=S[1]*P+S[3]*w+S[5],N;}function K(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[3]*w+S[6],N[1]=S[1]*P+S[4]*w+S[7],N;}function X(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[4]*w+S[12],N[1]=S[1]*P+S[5]*w+S[13],N;}function Z(N,$,S,P){var w=$[0]-S[0],j=$[1]-S[1],H=Math.sin(P),Y=Math.cos(P);return N[0]=w*Y-j*H+S[0],N[1]=w*H+j*Y+S[1],N;}function B(N,$){var S=N[0],P=N[1],w=$[0],j=$[1],H=Math.sqrt(S*S+P*P)*Math.sqrt(w*w+j*j),Y=H&&(S*w+P*j)/H;return Math.acos(Math.min(Math.max(Y,-1),1));}function z(N){return N[0]=0,N[1]=0,N;}function Q(N){return"vec2("+N[0]+", "+N[1]+")";}function et(N,$){return N[0]===$[0]&&N[1]===$[1];}function _(N,$){var S=N[0],P=N[1],w=$[0],j=$[1];return Math.abs(S-w)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(w))&&Math.abs(P-j)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(j));}var st=O,q=p,ht=h,dt=v,F=u,U=g,V=A,J=function(){var N=n();return function($,S,P,w,j,H){var Y,k;for(S||(S=2),P||(P=0),w?k=Math.min(w*S+P,$.length):k=$.length,Y=P;Y<k;Y+=S)N[0]=$[Y],N[1]=$[Y+1],j(N,N,H),$[Y]=N[0],$[Y+1]=N[1];return $;};}();},/* 12 */ /***/function(f,r,t){t.r(r);var e=t(13);t.d(r,"Renderer",function(){return e["default"];});var n=t(40);t.d(r,"Figure2D",function(){return n["default"];});var i=t(56);t.d(r,"Mesh2D",function(){return i["default"];});var a=t(29);t.d(r,"MeshCloud",function(){return a["default"];});var o=t(23);t.d(r,"parseFont",function(){return o["default"];});var s=t(31);t.d(r,"parseColor",function(){return s["default"];});var c=t(21);t.d(r,"ENV",function(){return c["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return b;});var e=t(14),n=t(1),i=t(20),a=t(27),o=t(25),s=t(40),c=t(56),p=t(29),h=t(59),v=t(21),y=t(63);t(1).glMatrix.setMatrixArrayType(Array);var M={autoUpdate:!1,// premultipliedAlpha: true,
23
+ preserveDrawingBuffer:!1,// depth: false,
24
+ // antialias: false,
25
+ bufferSize:1500},T="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\nvoid main() {\n gl_PointSize = 1.0;\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0); \n vTextureCoord = a_vertexTextureCoord; \n}\n",m="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",x=Symbol("glRenderer"),l=Symbol("canvasRenderer"),d=Symbol("options"),u=Symbol("globalTransform"),g=Symbol("applyGlobalTransform"),O=Symbol("canvas");function A(E){var L=E.gl,D=E.fbo;D&&L.bindFramebuffer(L.FRAMEBUFFER,D),E._draw(),D&&L.bindFramebuffer(L.FRAMEBUFFER,null);}function R(E,L,D,I){var C=E.createTexture(L.canvas),W=[[[0,0],[D,0],[D,I],[0,I],[0,0]]];W.closed=!0;var G=new c["default"]({contours:W});G.setTexture(C),E.setMeshData([G.meshData]),A(E),C["delete"](),L.clearRect(0,0,D,I),delete L._filter;}var b=/*#__PURE__*/function(){function b(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var I=D.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var C=L;L={getContext:function getContext(){return C;},width:D.width,height:D.height},C.canvas=L,I="2d";}if(this[O]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(D.contextType=I,this[d]=Object.assign({},M,D),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[d].webgl2=!0);var _C=new e["default"](L,this[d]);I==="webgl2"&&!_C.isWebGL2&&(D.contextType="webgl"),Object(y.createShaders)(_C),Object(y.applyShader)(_C),Object(y.createCloudShaders)(_C);var W=_C.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]=_C;}else this[l]=new i["default"](L,this[d]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(b,[{key:"canvas",get:function get(){return this[O];}},{key:"canvasRenderer",get:function get(){return this[l];}},{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[d];}},{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:g,value:function value(){var L=this[x]||this[l];if(this[x]){var _this$canvas=this.canvas,D=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[D,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,D=_this$canvas2.height,I=[// translation
26
+ 1,0,0,0,1,0,-L/2,-D/2,1],C=[// scale
27
+ 2/L,0,0,0,-2/D,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I);this.projectionMatrix=W,this[x]&&this[x].gl.viewport(0,0,L,D);}},{key:"createTexture",value:function createTexture(L,D){return(this[x]||this[l]).createTexture(L,D);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$useImageBitmap=_ref2.useImageBitmap,D=_ref2$useImageBitmap===void 0?!1:_ref2$useImageBitmap;return(this[x]||this[l]).loadTexture(L,{useImageBitmap:D});}},{key:"createText",value:function createText(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$font=_ref3.font,D=_ref3$font===void 0?"16px arial":_ref3$font,_ref3$fillColor=_ref3.fillColor,I=_ref3$fillColor===void 0?null:_ref3$fillColor,_ref3$strokeColor=_ref3.strokeColor,C=_ref3$strokeColor===void 0?null:_ref3$strokeColor,_ref3$strokeWidth=_ref3.strokeWidth,W=_ref3$strokeWidth===void 0?1:_ref3$strokeWidth;if(this[x]){var G=v["default"].createText(L,{font:D,fillColor:I,strokeColor:C,strokeWidth:W});return{image:this.createTexture(G.image),rect:G.rect};}return{_img:{font:D,fillColor:I,strokeColor:C,strokeWidth:W,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref4.vertex,D=_ref4.fragment,I=_ref4.options;if(this[x]){var C=this[x].compileSync(D,L);return C._attribOpts=I,C;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref5$vertex=_ref5.vertex,L=_ref5$vertex===void 0?T:_ref5$vertex,_ref5$fragment=_ref5.fragment,D=_ref5$fragment===void 0?m:_ref5$fragment,I=_ref5.options;return this.createProgram({vertex:L,fragment:D,options:I});}},{key:"useProgram",value:function useProgram(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[x]){var I=Object.assign({},L._attribOpts,D);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[l]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$l;if(this[x]){var D=this[x].gl;D.clear(D.COLOR_BUFFER_BIT);}else(_this$l=this[l]).clear.apply(_this$l,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(L){var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,D=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,I=_ref6$program===void 0?null:_ref6$program;var C=this[x]||this[l],W=I||L.program;if(this[x]){var G=C.gl;if(D&&G.clear(G.COLOR_BUFFER_BIT),W)C.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,X=!!K.uniforms.u_texSampler,Z=!!K.uniforms.u_filterFlag,B=!!K.uniforms.u_radialGradientVector,z=L.hasCloudColor,Q=L.hasCloudFilter,et=!!K.uniforms.u_clipSampler;Object(y.applyCloudShader)(C,{hasTexture:X,hasFilter:Z,hasGradient:B,hasCloudColor:z,hasCloudFilter:Q,hasClipPath:et});}this[g](),C.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(G,L),A(C),L.afterRender&&L.afterRender(G,L);}else C.setTransform(this.globalTransformMatrix),C.drawMeshCloud(L,{clear:D,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(L){var _this14=this;var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,D=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var C=this[x]||this[l];if(this[x]){var W=C.fbo,G=Object(a["default"])(this,L,I==null),K=C.gl;D&&K.clear(K.COLOR_BUFFER_BIT);var X=!Object(h.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator12=_createForOfIteratorHelper(G),_step12;try{var _loop=function _loop(){var Z=_step12.value;_this14._drawCalls++;var B=I||Z.program;if(Z instanceof p["default"])_this14.drawMeshCloud(Z,{clear:D,program:B});else{var _this14$canvas=_this14.canvas,z=_this14$canvas.width,Q=_this14$canvas.height;if(Z.beforeRender&&Z.beforeRender(K,Z),Z.pass.length&&((!_this14.fbo||_this14.fbo.width!==z||_this14.fbo.height!==Q)&&(_this14.fbo={width:z,height:Q,target:C.createFBO(),buffer:C.createFBO(),swap:function swap(){var _ref8=[this.buffer,this.target];this.target=_ref8[0];this.buffer=_ref8[1];}}),C.bindFBO(_this14.fbo.target)),!B&&Z.filterCanvas){Object(y.applyShader)(C,{hasTexture:!0});var et=_this14.filterContext;et||(et=v["default"].createCanvas(z,Q).getContext("2d"),_this14.filterContext=et);var _=L[Z.packIndex],st=_.filter,q=L[Z.packIndex+1],ht=L[Z.packIndex-1];(!ht||!ht.filterCanvas||ht.filter!==st)&&(!q||!q.filterCanvas||q.filter!==st)?(X?(et.save(),Object(o.drawMesh2D)(_,et,!1),et.restore(),Object(o.applyFilter)(et,st)):Object(o.drawMesh2D)(_,et,!0),_this14[g](),R(C,et,z,Q)):(X&&et.save(),Object(o.drawMesh2D)(_,et,!1),X&&et.restore(),(!q||!q.filterCanvas||_.filter!==q.filter)&&(Object(o.applyFilter)(et,st),_this14[g](),R(C,et,z,Q)));}else{if(B)C.program!==B&&_this14.useProgram(B,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _et=!!Z.uniforms.u_texSampler,_2=!!Z.uniforms.u_filterFlag,_st=!!Z.uniforms.u_radialGradientVector,_q=!!Z.uniforms.u_clipSampler;Object(y.applyShader)(C,{hasTexture:_et,hasFilter:_2,hasGradient:_st,hasClipPath:_q});}Z.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[g](),C.setMeshData([Z]),A(C);}if(Z.pass.length){var _et2=Z.pass.length;Z.pass.forEach(function(_,st){_.blend=Z.enableBlend,_.setTexture(C.fbo.texture),st===_et2-1?C.bindFBO(W):(_this14.fbo.swap(),C.bindFBO(_this14.fbo.target)),_.program?C.useProgram(_.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),C.useProgram(_this14.defaultPassProgram)),C.setMeshData([_.meshData]),K.clear(K.COLOR_BUFFER_BIT),A(C);});}Z.afterRender&&Z.afterRender(K,Z);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else C.setTransform(this.globalTransformMatrix),C.drawMeshes(L,{clear:D});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,D=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){D[_key-1]=arguments[_key];}var I=D.length;if(I<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(D.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(D.length+1," arguments provided."));var C=null,W=null;I===2?C=[D[0],D[1],L.width,L.height]:I===4?C=D:I===8&&(W=D.slice(0,4),C=D.slice(4));var G=this.createTexture(L),_this$canvas3=this.canvas,K=_this$canvas3.width,X=_this$canvas3.height,Z=new s["default"]();Z.rect(C[0],C[1],K,X);var B=new c["default"](Z,{width:K,height:X});B.setTexture(G,{rect:C,srcRect:W}),this.drawMeshes([B]),this.deleteTexture(G);}},{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 D=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),D,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,D){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,D]),this.globalTransform.apply(this,_toConsumableArray(I));}},{key:"globalRotate",value:function globalRotate(L){var _ref9=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref10=_slicedToArray(_ref9,2),D=_ref10[0],I=_ref10[1];var C=n.mat3.create();return C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[D,I]),C=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),C,L),C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[-D,-I]),this.globalTransform.apply(this,_toConsumableArray(C));}},{key:"globalScale",value:function globalScale(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref11=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref12=_slicedToArray(_ref11,2),I=_ref12[0],C=_ref12[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,C]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[L,D]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref13=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref14=_slicedToArray(_ref13,2),I=_ref14[0],C=_ref14[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,C]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(D),Math.tan(L),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,D,I){var C=this.globalTransformMatrix;I&&(C=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I));var W=L*C[0]+D*C[2]+C[4],G=L*C[1]+D*C[3]+C[5];return[W,G];}}]);}();},/* 14 */ /***/function(f,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 */ /***/function(f,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(M,T,m){return T in M?Object.defineProperty(M,T,{value:m,enumerable:!0,configurable:!0,writable:!0}):M[T]=m,M;}var s={};function c(M){var T=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var m=[],x=M.length;for(var l=0;l<x;l++)l%T<2&&m.push(0.5*(M[l]+1));return m;}function p(M,T){var m=T._buffers;Object.values(m).forEach(function(x){M.deleteBuffer(x);}),T._buffers={};}function h(M,T,m){return M.activeTexture(M.TEXTURE0+m),Array.isArray(T._img)?M.bindTexture(M.TEXTURE_CUBE_MAP,T):M.bindTexture(M.TEXTURE_2D,T),T;}var v={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var y=/*#__PURE__*/function(){function y(T){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,m),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]()
28
+ // WebGLRenderingContext.uniformMatrix[234]fv()
29
+ },{key:"_declareUniform",value:function _declareUniform(T,m){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var l=this.gl,d=l.getUniformLocation(T,m);var u;var g=this;if(/^sampler/.test(x)){var O=T._samplerMap,A=T._bindTextures;Object.defineProperty(T.uniforms,m,{get:function get(){return u;},set:function set(R){u=R;var b=O[m]!=null?O[m]:A.length;A[b]=R,h(l,R,b),O[m]||(O[m]=b,l.uniform1i(d,b)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _O=x.indexOf("Matrix")===0,_A=!_O&&/v$/.test(x),R=l["uniform".concat(x)].bind(l);Object.defineProperty(T.uniforms,m,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_O?R(d,!1,b):_A?R(d,b):R.apply(void 0,[d].concat(_toConsumableArray(b))),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var T=this.program;T.meshData.forEach(function(m,x){var l=m.positions,d=m.cells,u=m.instanceCount,g=m.cellsCount,O=m.attributes,A=m.uniforms,R=m.textureCoord,b=m.enableBlend,E=_this15.gl;var L=m.mode!=null?m.mode:E.TRIANGLES;typeof L=="string"&&(L=E[L]),b?E.enable(E.BLEND):E.disable(E.BLEND),E.bindBuffer(E.ARRAY_BUFFER,T._buffers.verticesBuffer),E.bufferData(E.ARRAY_BUFFER,l,E.STATIC_DRAW),d&&(E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,T._buffers.cellsBuffer),E.bufferData(E.ELEMENT_ARRAY_BUFFER,d,E.STATIC_DRAW));var D=[];O&&Object.values(O).forEach(function(_ref15){var C=_ref15.name,W=_ref15.data,G=_ref15.divisor;if(E.bindBuffer(E.ARRAY_BUFFER,T._buffers[C]),E.bufferData(E.ARRAY_BUFFER,W,E.STATIC_DRAW),G!=null){var K=E.getAttribLocation(T,C);K>=0&&(E.enableVertexAttribArray(K),D.push(K),E.vertexAttribDivisor?E.vertexAttribDivisor(K,G):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(K,G));}}),A&&Object.entries(A).forEach(function(_ref16){var _ref17=_slicedToArray(_ref16,2),C=_ref17[0],W=_ref17[1];_this15.uniforms[C]=W;});var I;if(!d){var C=T._dimension;I=l.length/C;}if(T._enableTextures&&T._buffers.texCoordBuffer){var _C2=R||c(l,T._dimension);E.bindBuffer(E.ARRAY_BUFFER,T._buffers.texCoordBuffer),E.bufferData(E.ARRAY_BUFFER,y.FLOAT(_C2),E.STATIC_DRAW);}u!=null?(d?E.drawElementsInstanced?E.drawElementsInstanced(L,g,E.UNSIGNED_SHORT,0,u):_this15.aia_ext&&_this15.aia_ext.drawElementsInstancedANGLE(L,g,E.UNSIGNED_SHORT,0,u):E.drawArraysInstanced?E.drawArraysInstanced(L,0,I,u):_this15.aia_ext.drawArraysInstancedANGLE(L,0,I,u),D.forEach(function(C){E.vertexAttribDivisor?E.vertexAttribDivisor(C,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(C,null);})):d?E.drawElements(L,g,E.UNSIGNED_SHORT,0):E.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 m=this.gl;this.program===T&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),m.useProgram(null));var x=this.programs.indexOf(T);x>=0&&this.programs.splice(x,1),p(m,T),m.deleteProgram(T);}/**
30
+ [{
31
+ positions: ...
32
+ cells: ...
33
+ textureCoord: ...
34
+ attributes: {name: {data:..., normalize: true}},
35
+ uniforms: ...
36
+ }]
37
+ */},{key:"setMeshData",value:function setMeshData(T){var _this16=this;Array.isArray(T)||(T=[T]);var m=this.program;m.meshData=T.map(function(_ref18){var x=_ref18.mode,l=_ref18.positions,d=_ref18.instanceCount,u=_ref18.cells,g=_ref18.cellsCount,O=_ref18.attributes,A=_ref18.uniforms,R=_ref18.textureCoord,b=_ref18.enableBlend;var E={positions:y.FLOAT(l),uniforms:A,enableBlend:!!b,textureCoord:y.FLOAT(R)};if(u&&(E.cells=y.USHORT(u),E.cellsCount=g||E.cells.length),x!=null&&(E.mode=x),d!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");E.instanceCount=d;}if(O){var L={};Object.entries(O).forEach(function(_ref19){var _ref20=_slicedToArray(_ref19,2),D=_ref20[0],I=_ref20[1];if(!m._attribute[D])m._attribute[D]="ignored";else if(m._attribute[D]!=="ignored"){var _m$_attribute$D=m._attribute[D],C=_m$_attribute$D.name,W=_m$_attribute$D.type;var G=I.data||I;if(Array.isArray(G)&&(G=y[W](G)),L[D]={name:C,data:G},I.divisor!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[D].divisor=I.divisor;}}}),E.attributes=L;}return E;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(T,m){var _this17=this;var x=/^\s*uniform\s+sampler/mg.test(T);T==null&&(T=i["default"]),m==null&&(m=x?a["default"]:n["default"]);var l=this.gl,d=Object(e.createProgram)(l,m,T);d.shaderText={vertexShader:m,fragmentShader:T},d._buffers={},d._attribute={},d.uniforms={},d._samplerMap={},d._bindTextures=[];var u=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var g=m.match(u);g&&(d._dimension=Number(g[1]));var O=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");g=m.match(O),g&&(d._texCoordSize=Number(g[1]));var A=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(g=m.match(A),g)for(var E=0;E<g.length;E++){var L=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,D=g[E].match(L);if(D&&D[3]!==this.options.vertexPosition&&D[3]!==this.options.vertexTextureCoord){var _D=_slicedToArray(D,4),I=_D[1],C=_D[2],W=_D[3];I==="mat"&&(C=Math.pow(C,2)),d._buffers[W]=l.createBuffer(),d._attribute[W]={name:W,type:I,size:Number(C)||1};}}var R=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=m.match(R)||[],g=g.concat(T.match(R)||[]),g.forEach(function(E){var L=E.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _L$slice=L.slice(1),_L$slice2=_slicedToArray(_L$slice,3),D=_L$slice2[0],I=_L$slice2[1],C=_L$slice2[2];D=v[D],C=!!C,D.indexOf("Matrix")!==0&&C&&(D+="v"),_this17._declareUniform(d,I,D);}),d._buffers.verticesBuffer=l.createBuffer(),d._buffers.cellsBuffer=l.createBuffer();var b=l.getAttribLocation(d,this.options.vertexTextureCoord);return d._enableTextures=b>=0,d._enableTextures&&(d._buffers.texCoordBuffer=l.createBuffer()),this.programs.push(d),d;}},{key:"useProgram",value:function useProgram(T){var m=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 l=T._dimension;x.bindBuffer(x.ARRAY_BUFFER,T._buffers.verticesBuffer);var d=x.getAttribLocation(T,this.options.vertexPosition);if(x.vertexAttribPointer(d,l,x.FLOAT,!1,0,0),x.enableVertexAttribArray(d),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(_ref21){var _ref22=_slicedToArray(_ref21,2),u=_ref22[0],g=_ref22[1];if(g!=="ignored"){var O=g.size,A=m[u]||{},R=!!A.normalize;var b=A.type||"FLOAT";var E=A.key||u;b==="UBYTE"&&(b="UNSIGNED_BYTE"),b==="USHORT"&&(b="UNSIGNED_SHORT"),g.type=b,E&&E!==u&&(T._attribute[E]=g),x.bindBuffer(x.ARRAY_BUFFER,T._buffers[u]);var L=x.getAttribLocation(T,u);L>=0&&(x.vertexAttribPointer(L,O,x[b],R,0,0),x.enableVertexAttribArray(L));}}),!T.meshData){var _u2=[[-1,-1,0,1].slice(0,l),[1,-1,0,1].slice(0,l),[1,1,0,1].slice(0,l),[-1,1,0,1].slice(0,l)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:_u2,cells:g});}return T;}},{key:"compileSync",value:function compileSync(T,m){T=T||i["default"];var x={};function l(O){O=O.replace(/^\s*/mg,"");var A=[],R=O.match(/^#pragma\s+include\s+.*/mg);if(R){for(var b=0;b<R.length;b++){var L=R[b].match(/(?:<|")(.*)(?:>|")/);if(L){var D=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),x[I])A.push("/* included ".concat(I," */"));else if(x[I]=!0,D==="lib"){var C=l(s[I]);A.push(C);}else if(D==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}A.forEach(function(b){O=O.replace(/^#pragma\s+include\s+.*/m,b);});}return O;}var d=l(T),u=m?l(m):null;return this.createProgram(d,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(T,m){var x,l,_l3,d,u;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_l3=function _l5(){_l3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(O){var A,R,b,L,D,I,C,_C3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:O=O.replace(/^\s*/mg,"");A=[],R=O.match(/^#pragma\s+include\s+.*/mg);if(!R){_context11.next=32;break;}b=0;case 4:if(!(b<R.length)){_context11.next=31;break;}L=R[b].match(/(?:<|")(.*)(?:>|")/);if(!L){_context11.next=28;break;}D=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),x[I])){_context11.next=13;break;}A.push("/* included ".concat(I," */"));_context11.next=28;break;case 13:if(!(x[I]=!0,D==="lib")){_context11.next=20;break;}_context11.next=16;return l(s[I]);case 16:C=_context11.sent;A.push(C);_context11.next=28;break;case 20:if(!(D==="link")){_context11.next=28;break;}_context11.next=23;return y.fetchShader(I);case 23:_C3=_context11.sent;_context11.next=26;return l(_C3);case 26:_C3=_context11.sent;A.push(_C3);case 28:b++;_context11.next=4;break;case 31:A.forEach(function(b){O=O.replace(/^#pragma\s+include\s+.*/m,b);});case 32:return _context11.abrupt("return",O);case 33:case"end":return _context11.stop();}},_callee11);}));return _l3.apply(this,arguments);};l=function _l4(_x19){return _l3.apply(this,arguments);};T=T||i["default"];x={};_context12.next=6;return l(T);case 6:d=_context12.sent;if(!m){_context12.next=13;break;}_context12.next=10;return l(m);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(d,u));case 16:case"end":return _context12.stop();}},_callee12,this);}));function compile(_x17,_x18){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(T){var m,_args13=arguments;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:m=_args13.length>1&&_args13[1]!==undefined?_args13[1]:null;_context13.next=3;return y.fetchShader(T);case 3:T=_context13.sent;_context13.t0=m;if(!_context13.t0){_context13.next=9;break;}_context13.next=8;return y.fetchShader(m);case 8:m=_context13.sent;case 9:return _context13.abrupt("return",this.compile(T,m));case 10:case"end":return _context13.stop();}},_callee13,this);}));function load(_x20){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 _ref23=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref23$wrapS=_ref23.wrapS,m=_ref23$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapS,_ref23$wrapT=_ref23.wrapT,x=_ref23$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapT,_ref23$minFilter=_ref23.minFilter,l=_ref23$minFilter===void 0?this.gl.LINEAR:_ref23$minFilter,_ref23$magFilter=_ref23.magFilter,d=_ref23$magFilter===void 0?this.gl.LINEAR:_ref23$magFilter;var u=this.gl,g=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 O=u.createTexture();u.bindTexture(g,O),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,A=_this$canvas4.width,R=_this$canvas4.height;if(T){if(g===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(g,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,T);}else if(g===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,A,R,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(g,0,u.RGBA,A,R,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(g,u.TEXTURE_MIN_FILTER,l),u.texParameteri(g,u.TEXTURE_MAG_FILTER,d),u.texParameteri(g,u.TEXTURE_WRAP_S,m),u.texParameteri(g,u.TEXTURE_WRAP_T,x),g===u.TEXTURE_CUBE_MAP&&(T.width=T[0].width,T.height=T[0].height),u.bindTexture(g,null),O._img=T||{width:A,height:R},O["delete"]=function(){_this18.deleteTexture(O);},O;}},{key:"deleteTexture",value:function deleteTexture(T){var m=T._img;this.gl.deleteTexture(T),typeof m.close=="function"&&m.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(T){var _ref24,_ref24$useImageBitmap,m,x,_args14=arguments;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_ref24=_args14.length>1&&_args14[1]!==undefined?_args14[1]:{},_ref24$useImageBitmap=_ref24.useImageBitmap,m=_ref24$useImageBitmap===void 0?!0:_ref24$useImageBitmap;_context14.next=3;return y.loadImage(T,{useImageBitmap:m});case 3:x=_context14.sent;return _context14.abrupt("return",this.createTexture(x));case 5:case"end":return _context14.stop();}},_callee14,this);}));function loadTexture(_x21){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref25=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref25$color=_ref25.color,T=_ref25$color===void 0?1:_ref25$color,_ref25$blend=_ref25.blend,m=_ref25$blend===void 0?!1:_ref25$blend,_ref25$depth=_ref25.depth,x=_ref25$depth===void 0?this.options.depth!==!1:_ref25$depth,_ref25$stencil=_ref25.stencil,l=_ref25$stencil===void 0?!!this.options.stencil:_ref25$stencil;var d=this.gl,u=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,u);var g=[];for(var R=0;R<T;R++){var b=this.createTexture();d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0+R,d.TEXTURE_2D,b,0/* level */),g.push(b);}u.textures=g,u.texture=g[0],u.blend=m;var _this$canvas5=this.canvas,O=_this$canvas5.width,A=_this$canvas5.height;return x&&!l&&(u.depthBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,O,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,u.depthBuffer)),l&&!x&&(u.stencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.stencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.STENCIL_INDEX8,O,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.STENCIL_ATTACHMENT,d.RENDERBUFFER,u.stencilBuffer)),x&&l&&(u.depthStencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthStencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,O,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,u.depthStencilBuffer)),d.bindFramebuffer(d.FRAMEBUFFER,null),u;}},{key:"bindFBO",value:function bindFBO(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=T;}},{key:"render",value:function render(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$clearBuffer=_ref26.clearBuffer,T=_ref26$clearBuffer===void 0?!0:_ref26$clearBuffer;this.startRender=!0;var m=this.gl;var x=this.program;x||(x=this.createProgram(),this.useProgram(x)),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,this.fbo);var l=this.options.depth;l&&m.enable(m.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(l?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var d=this._renderFrameID;this._draw(),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,null),this._renderFrameID===d&&(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,m){return Object(e.pointsToBuffer)(T,Float32Array,m);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(T,m){return Object(e.pointsToBuffer)(T,Uint8Array,m);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(T,m){return Object(e.pointsToBuffer)(T,Uint16Array,m);}},{key:"BYTE",value:function BYTE(T,m){return Object(e.pointsToBuffer)(T,Int8Array,m);}},{key:"SHORT",value:function SHORT(T,m){return Object(e.pointsToBuffer)(T,Int16Array,m);}}]);}();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(f,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 p;}),t(1).glMatrix.setMatrixArrayType(Array);function e(h,v){var y=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var M=null;for(var T=0;T<y.length;++T){try{M=h.getContext(y[T],v);}catch(_unused6){}if(M)break;}return M;}function n(h,v){var y=e(h,v);if(!y)throw new Error("Sorry, your browser doesn't support WebGL.");return y;}function i(h,v,y){var M=h.createShader(h.VERTEX_SHADER);if(h.shaderSource(M,v),h.compileShader(M),!h.getShaderParameter(M,h.COMPILE_STATUS)){var _x22="Vertex shader failed to compile. The error log is:".concat(h.getShaderInfoLog(M));throw new Error(_x22);}var T=h.createShader(h.FRAGMENT_SHADER);if(h.shaderSource(T,y),h.compileShader(T),!h.getShaderParameter(T,h.COMPILE_STATUS)){var _x23="Fragment shader failed to compile. The error log is:".concat(h.getShaderInfoLog(T));throw new Error(_x23);}var m=h.createProgram();if(h.attachShader(m,M),h.attachShader(m,T),h.linkProgram(m),!h.getProgramParameter(m,h.LINK_STATUS)){var _x24="Shader program failed to link. The error log is:".concat(h.getProgramInfoLog(m));throw new Error(_x24);}return h.deleteShader(M),h.deleteShader(T),m;}function a(h){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(y&&!(y instanceof v))throw new TypeError("Wrong buffer type.");if(h==null||h instanceof v)return h;if(h[0]==null||h[0].length==null)return y?(y.set(h,0),y):new v(h);var M=h[0].length,T=h.length;y||(y=new v(M*T));var m=0;for(var _x25=0;_x25<T;_x25++)for(var _l6=0;_l6<M;_l6++)y[m++]=h[_x25][_l6];return y;}var o={};function s(h){var _ref27=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref27$useImageBitmap=_ref27.useImageBitmap,v=_ref27$useImageBitmap===void 0?!0:_ref27$useImageBitmap,_ref27$alias=_ref27.alias,y=_ref27$alias===void 0?null:_ref27$alias;if(!o[h]){if(typeof Image=="function"){var M=new Image();typeof h=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(h)&&(M.crossOrigin="anonymous"),o[h]=new Promise(function(T){M.onload=function(){v&&typeof createImageBitmap=="function"?createImageBitmap(M,{imageOrientation:"flipY"}).then(function(m){o[h]=m,y&&(o[y]=m),T(m);}):(o[h]=M,y&&(o[y]=M),T(M));},M.src=h;}),y&&(o[y]=o[h]);}else if(typeof fetch=="function")return fetch(h,{method:"GET",mode:"cors",cache:"default"}).then(function(M){return M.blob();}).then(function(M){return createImageBitmap(M,{imageOrientation:"flipY"}).then(function(T){return o[h]=T,y&&(o[y]=T),T;});});}return o[h];}var c={};function p(_x26){return _p2.apply(this,arguments);}function _p2(){_p2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(h){var v,y;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!c[h]){_context15.next=2;break;}return _context15.abrupt("return",c[h]);case 2:_context15.next=4;return fetch(h);case 4:v=_context15.sent;if(!(v.status>=200&&v.status<300)){_context15.next=10;break;}_context15.next=8;return v.text();case 8:y=_context15.sent;return _context15.abrupt("return",(c[h]=y,y));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context15.stop();}},_callee15);}));return _p2.apply(this,arguments);}},/* 17 */ /***/function(f,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(f,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(f,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(f,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,c){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=c,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 c;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:c=_context16.sent;return _context16.abrupt("return",this.createTexture(c));case 4:case"end":return _context16.stop();}},_callee16,this);}));function loadTexture(_x27){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(s){return s;}},{key:"clear",value:function clear(s,c,p,h){var v=this.context;s=s||0,c=c||0,p=p||v.canvas.width-s,h=h||v.canvas.height-c,v.clearRect(s,c,p,h);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$clear=_ref28.clear,c=_ref28$clear===void 0?!1:_ref28$clear;var p=[];for(var h=0;h<s.amount;h++){var v=s.getTransform(h);var y=s.getTextureFrame(h);y&&(y=y._img);var M=s.getFilter(h),_s$getCloudRGBA=s.getCloudRGBA(h),T=_s$getCloudRGBA.fill,m=_s$getCloudRGBA.stroke;p.push({mesh:s.mesh,_cloudOptions:[T,m,y,v,M]});}s.beforeRender&&s.beforeRender(this.context,s),this.drawMeshes(p,{clear:c,hook:!1}),s.afterRender&&s.afterRender(this.context,s);}},{key:"drawMeshes",value:function drawMeshes(s){var _this19=this;var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,c=_ref29$clear===void 0?!1:_ref29$clear,_ref29$hook=_ref29.hook,p=_ref29$hook===void 0?!0:_ref29$hook;var h=this.context;c&&h.clearRect(0,0,h.canvas.width,h.canvas.height);var v=null;var _h$canvas=h.canvas,y=_h$canvas.width,M=_h$canvas.height,T=s.length;s.forEach(function(m,x){var _m$_cloudOptions,_this19$filterBuffer;var l,d,u,g,O;p&&m.beforeRender&&m.beforeRender(h,m),m._cloudOptions&&((_m$_cloudOptions=_slicedToArray(m._cloudOptions,5),l=_m$_cloudOptions[0],d=_m$_cloudOptions[1],u=_m$_cloudOptions[2],g=_m$_cloudOptions[3],O=_m$_cloudOptions[4]),m=m.mesh);var A=m.filter;if(O&&(A=A?"".concat(A," ").concat(O):O),A&&!_this19.filterBuffer&&_this19.filterBuffer!==!1){var R=e["default"].createCanvas(y,M);R?_this19.filterBuffer=R.getContext("2d"):_this19.filterBuffer=!1;}v&&v!==A&&(Object(n.applyFilter)(_this19.filterBuffer,v),h.drawImage(_this19.filterBuffer.canvas,0,0,y,M),_this19.filterBuffer.clearRect(0,0,y,M),v=null),A&&_this19.filterBuffer?(_this19.filterBuffer.save(),(_this19$filterBuffer=_this19.filterBuffer).transform.apply(_this19$filterBuffer,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(m,_this19.filterBuffer,!1,l,d,u,g),_this19.filterBuffer.restore(),x===T-1?(Object(n.applyFilter)(_this19.filterBuffer,A),h.drawImage(_this19.filterBuffer.canvas,0,0,y,M),_this19.filterBuffer.clearRect(0,0,y,M)):v=A):(h.save(),h.transform.apply(h,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(m,h,!1,l,d,u,g),h.restore()),p&&m.afterRender&&m.afterRender(h,m);});}},{key:"setTransform",value:function setTransform(s){this[i]=s;}}]);}();},/* 21 */ /***/function(f,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,M){var T=y.style,m=y.variant,x=y.weight,l=y.stretch,d=y.size,u=y.pxLineHeight,g=y.family;return l==="normal"?"".concat(T," ").concat(m," ").concat(x," ").concat(d*M,"px/").concat(u*M,"px ").concat(g):"".concat(T," ").concat(m," ").concat(x," ").concat(l," ").concat(d*M,"px/").concat(u*M,"px ").concat(g);}function c(y,_ref30){var M=_ref30.font,T=_ref30.fillColor,m=_ref30.strokeColor,x=_ref30.strokeWidth,_ref30$ratio=_ref30.ratio,l=_ref30$ratio===void 0?1:_ref30$ratio,d=_ref30.textCanvas,_ref30$cachable=_ref30.cachable,u=_ref30$cachable===void 0?!1:_ref30$cachable;var g;if(u){g=[y,M,String(T),String(m),String(x)].join("###");var G=o[g];if(G)return G;}d||(d=h(1,1));var O=d.getContext("2d");O.save(),O.font=M;var _O$measureText=O.measureText(y),A=_O$measureText.width;O.restore();var R=Object(i["default"])(M),b=Math.max(R.pxLineHeight,R.pxHeight*1.13);/italic|oblique/.test(M)&&(A+=b*Math.tan(15*Math.PI/180)),!T&&!m&&(T="#000");var E=O.canvas,L=Math.ceil(A),D=Math.ceil(b);E.width=Math.round(L*l),E.height=Math.round(D*l),O.save(),O.font=s(R,l),O.textAlign="center",O.textBaseline="middle";var I=E.height*0.5+R.pxHeight*0.05*l,C=E.width*0.5;if(T){if(Array.isArray(T))T=Object(a["default"])(T);else if(T.vector){var _G;var _T=T,K=_T.vector,X=_T.colors;K.length===6?_G=O.createRadialGradient.apply(O,_toConsumableArray(K)):_G=O.createLinearGradient.apply(O,_toConsumableArray(K)),X.forEach(function(_ref31){var Z=_ref31.offset,B=_ref31.color;_G.addColorStop(Z,B);}),T=_G;}O.fillStyle=T,O.fillText(y,C,I);}if(m){if(O.lineWidth=x*l,Array.isArray(m))m=Object(a["default"])(m);else if(m.vector){var _G2;var _m=m,_K=_m.vector,_X=_m.colors;_K.length===6?_G2=O.createRadialGradient.apply(O,_toConsumableArray(_K)):_G2=O.createLinearGradient.apply(O,_toConsumableArray(_K)),_X.forEach(function(_ref32){var Z=_ref32.offset,B=_ref32.color;_G2.addColorStop(Z,B);}),m=_G2;}O.strokeStyle=m,O.strokeText(y,C,I);}O.restore();var W={image:d,rect:[0,0,L,D]};return u&&(o[g]=W),W;}var p=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var y=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);y&&(p=Number(y[1])<70);}function h(y,M){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var m=T.offscreen||!p&&T.offscreen!==!1;var x;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?x=e.createCanvas(y,M,T):m&&typeof OffscreenCanvas=="function"?x=new OffscreenCanvas(y,M):(x=document.createElement("canvas"),x.width=y,x.height=M),x;}var v={createCanvas:h,createText:c,loadImage:n["default"].loadImage};r["default"]=v;}.call(this,t(22));},/* 22 */ /***/function(f,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused7){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}f.exports=t;},/* 23 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return T;}),t(1).glMatrix.setMatrixArrayType(Array);function e(m,x){if(typeof m=="string"){var u=m.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);u?m={size:parseFloat(u[1]),unit:u[2]}:m={size:parseInt(m,10),unit:"px"};}var _m2=m,l=_m2.size,d=_m2.unit;if(d==="pt")l/=0.75;else if(d==="pc")l*=16;else if(d==="in")l*=96;else if(d==="cm")l*=96/2.54;else if(d==="mm")l*=96/25.4;else if(d==="em"||d==="rem"||d==="ex"){if(!x&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;x=e(_u3,16);}l*=x,d==="ex"&&(l/=2);}else if(d==="q")l*=96/25.4/4;else if(d==="vw"||d==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u4=d==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;l*=_u4/100;}}else if((d==="vmax"||d==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u5=document.documentElement.clientWidth,g=document.documentElement.clientHeight;d==="vmax"?l*=Math.max(_u5,g)/100:l*=Math.min(_u5,g)/100;}return l;}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|%",c="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",p=new RegExp("(".concat(n,") +"),"i"),h=new RegExp("(".concat(i,") +"),"i"),v=new RegExp("(".concat(a,") +"),"i"),y=new RegExp("(".concat(o,") +"),"i"),M=new RegExp("([\\d\\.]+)("+s+")(?:\\/([\\d\\.]+)("+s+"))? *((?:"+c+")( *, *(?:"+c+"))*)");function T(m,x){var l=M.exec(m);if(!l)return;var d=parseFloat(l[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(l[1]),unit:l[2],lineHeight:Number.isFinite(d)?d:void 0,lineHeightUnit:l[4],family:l[5].replace(/ *, */g,",")},g=m.substring(0,l.index),O=p.exec(g),A=h.exec(g),R=v.exec(g),b=y.exec(g);return O&&(u.weight=O[1]),A&&(u.style=A[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(f,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(f,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),t.d(r,"drawMesh2D",function(){return c;});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(p,h){var v=p.canvas;p.save(),p.filter=h,p.drawImage(v,0,0,v.width,v.height),p.restore();}function s(p,h){var v=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;p=p.match(v).slice(1,5).map(Number),h=h.match(v).slice(1,5).map(Number);var y=[],M=h[3];for(var T=0;T<4;T++)y[T]=Object(a.mix)(p[T],h[T],M);return"rgba(".concat(y.join(),")");}function c(p,h){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var y=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var M=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var T=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var m=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;h.save();var x=!1,l=!1;if(h.globalAlpha=p.getOpacity(),p._updateMatrix&&p.transformScale/p.contours.scale>1.5&&p.accurate(p.transformScale),p.lineWidth){var g=p.gradient&&p.gradient.stroke;if(g){var _g2=g,O=_g2.vector,A=_g2.colors;if(O.length===6)g=h.createRadialGradient.apply(h,_toConsumableArray(O));else if(O.length===4)g=h.createLinearGradient.apply(h,_toConsumableArray(O));else if(O.length===3)g=h.createCircularGradient.apply(h,_toConsumableArray(O));else throw new TypeError("Invalid vector dimension.");A.forEach(function(_ref33){var R=_ref33.offset,b=_ref33.color;var E=Object(n["default"])(b);M&&(E=s(E,M)),g.addColorStop(R,E);}),h.strokeStyle=g,x=!0;}else p.strokeStyle&&(M?h.strokeStyle=s(p.strokeStyle,M):h.strokeStyle=p.strokeStyle,x=!0);}x&&(h.lineWidth=p.lineWidth,h.lineJoin=p.lineJoin,h.lineCap=p.lineCap,h.miterLimit=p.miterLimit,p.lineDash&&(h.setLineDash(p.lineDash),p.lineDashOffset&&(h.lineDashOffset=p.lineDashOffset)));var d=p.gradient&&p.gradient.fill;if(d){var _d3=d,_g3=_d3.vector,_O2=_d3.colors;if(_g3.length===6)d=h.createRadialGradient.apply(h,_toConsumableArray(_g3));else if(_g3.length===4)d=h.createLinearGradient.apply(h,_toConsumableArray(_g3));else if(_g3.length===3)d=h.createCircularGradient.apply(h,_toConsumableArray(_g3));else throw new TypeError("Invalid vector dimension.");_O2.forEach(function(_ref34){var A=_ref34.offset,R=_ref34.color;var b=Object(n["default"])(R);M&&(b=s(b,M)),d.addColorStop(A,b);}),h.fillStyle=d,l=!0;}else p.fillStyle&&(y?h.fillStyle=s(p.fillStyle,y):h.fillStyle=p.fillStyle,l=!0);if(m&&h.transform.apply(h,_toConsumableArray(m)),h.transform.apply(h,_toConsumableArray(p.transformMatrix)),p.clipPath){var _g4=p.clipPath,_O3=new Path2D(_g4);h.clip(_O3);}var u=p.contours.length;if(p.contours.forEach(function(g,O){var A=g.length,R=A>1&&e.vec2.equals(g[0],g[A-1]),b=O===u-1&&p.texture;if(g&&A>0){if(l||x||b){h.beginPath(),h.moveTo.apply(h,_toConsumableArray(g[0]));for(var E=1;E<A;E++)E===A-1&&R?h.closePath():h.lineTo.apply(h,_toConsumableArray(g[E]));}if(l&&h.fill(p.fillRule),b){h.save(),h.clip();var _p$texture=p.texture,_E=_p$texture.image,L=_p$texture.options;if(T&&(_E=T),L.repeat&&console.warn("Context 2D not supported image repeat yet."),_E.font){L.scale&&console.warn("Context 2D not supported text scale yet."),L.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _E2=_E,D=_E2.font,I=_E2.fillColor,C=_E2.strokeColor,W=_E2.strokeWidth,G=_E2.text;!I&&!C&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(C)&&(C=Object(n["default"])(C)),h.font=D;var _h$measureText=h.measureText(G),K=_h$measureText.width,X=Object(i["default"])(D),Z=Math.max(X.pxLineHeight,X.pxHeight*1.13);h.textAlign="center",h.textBaseline="middle";var B=L.rect,z=B[0]+Z*0.5+X.pxHeight*0.06,Q=B[1]+K*0.5;B[2]!=null&&h.scale(B[2]/K,B[3]/Z),I&&(h.fillStyle=I,h.fillText(G,Q,z)),C&&(h.lineWidth=W,h.strokeStyle=C,h.strokeText(G,Q,z));}else{var _D2=L.rect;var _I=L.srcRect;L.scale&&(_D2=[0,0,h.canvas.width,h.canvas.height]),L.rotated&&_D2&&(_D2=[-_D2[1],_D2[0],_D2[3],_D2[2]]),_I&&(_D2=_D2||[0,0,_I[2],_I[3]]),L.rotated&&(h.translate(0,_D2?_D2[2]:_E.width),h.rotate(-0.5*Math.PI)),_I?h.drawImage.apply(h,[_E].concat(_toConsumableArray(_I),_toConsumableArray(_D2))):_D2?h.drawImage.apply(h,[_E].concat(_toConsumableArray(_D2))):h.drawImage(_E,0,0);}h.restore();}x&&h.stroke();}}),h.restore(),v){var _g5=p.filter;_g5&&o(h,_g5);}}},/* 26 */ /***/function(f,r,t){t.r(r),t.d(r,"clamp",function(){return e;}),t.d(r,"mix",function(){return n;}),t.d(r,"transformPoint",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);function e(a,o,s){var _ref35;return o>s&&(_ref35=[s,o],o=_ref35[0],s=_ref35[1],_ref35),a<o?o:a>s?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],c=_a2[1];return[s*o[0]+c*o[2]+o[4],s*o[1]+c*o[3]+o[5]];}},/* 27 */ /***/function(f,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(c,p,h){var v=c.uniforms||{},y=p.uniforms||{};if(v.u_texSampler&&y.u_texSampler&&v.u_texSampler!==y.u_texSampler)return!1;var M=Object.keys(v),T=Object.keys(y),m=M.indexOf("u_texSampler"),x=T.indexOf("u_texSampler");if(m>=0&&M.splice(m,1),x>=0&&T.splice(x,1),M.length!==T.length)return!1;var l=M.every(function(d){var u=v[d],g=y[d];if(u===g)return!0;if(u.length&&g.length&&u.length===g.length){for(var O=0;O<u.length;O++)if(u[O]!==g[O])return!1;return!0;}return!1;});if(l){if(v.u_texSampler&&!y.u_texSampler)p.setTexture(v.u_texSampler,{hidden:!0});else if(!v.u_texSampler&&y.u_texSampler)for(var d=0;d<h.length;d++)h[d].setTexture(y.u_texSampler,{hidden:!0});}return l;}var a={};function o(c,p){if(c.length){var h=Object(e["default"])(c,a);return h.enableBlend=p,c[0].filterCanvas&&(h.filterCanvas=!0),h.packIndex=c[0].packIndex,h.packLength=c.length,h.beforeRender=c[0].beforeRender,h.pass=c[0].pass,h.afterRender=c[c.length-1].afterRender,c.length=0,h;}}function s(c,p){var h=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(){var v,y,M,T,m,_x28,_l7,u,d,_u6,g;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:v=[],y=c.options.bufferSize;M=0,T=!1;m=0;case 3:if(!(m<p.length)){_context17.next=47;break;}_x28=p[m];if(!(_x28 instanceof n["default"])){_context17.next=16;break;}_context17.t0=v.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(v,T);case 10:M=0;T=!1;_context17.next=14;return _x28;case 14:_context17.next=44;break;case 16:_l7=_x28.meshData;if(_l7.clipPath&&!_l7.uniforms.u_clipSampler){u=c.createTexture(_l7.clipPath);_l7.uniforms.u_clipSampler=u;}d=0;if(!((!h||!_x28.canIgnore())&&_l7&&_l7.positions.length)){_context17.next=40;break;}_x28.packIndex=m;_u6=_x28.filterCanvas;if(!(d=_l7.positions.length,_u6||M+d>y)){_context17.next=31;break;}_context17.t1=v.length;if(!_context17.t1){_context17.next=27;break;}_context17.next=27;return o(v,T);case 27:M=0;T=!1;_context17.next=39;break;case 31:if(!M){_context17.next=39;break;}g=v[v.length-1];_context17.t2=g&&(g.filterCanvas||g.afterRender||_x28.beforeRender||g.pass.length||_x28.pass.length||g.program!==_x28.program||!i(g,_x28,v));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(v,T);case 37:M=0;T=!1;case 39:v.push(_x28),T=T||_x28.enableBlend,M+=d;case 40:_context17.t3=m===p.length-1&&v.length;if(!_context17.t3){_context17.next=44;break;}_context17.next=44;return o(v,T);case 44:m++;_context17.next=3;break;case 47:case"end":return _context17.stop();}},_callee17);})();}},/* 28 */ /***/function(f,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,c=0,p=0,h=0,v=0,y=0,M=0;var T=a[0].program;for(var m=0;m<a.length;m++){var _x29=a[m].meshData;if(_x29){M+=_x29.positions.length;var _l8=_x29.positions[0].length;s+=_x29.positions.length*_l8,c+=_x29.cells.length*3,y+=_x29.attributes.a_color.length*4;var d=_x29.textureCoord;d&&(p+=d.length*d[0].length);var u=_x29.attributes.a_sourceRect;u&&(h+=u.length*4);var g=_x29.attributes.a_clipUV;g&&(v+=g.length*2);}}if((!o.positions||o.positions.length<s)&&(o.positions=new Float32Array(s)),(!o.cells||o.cells.length<c)&&(o.cells=new Uint16Array(c)),p&&(!o.textureCoord||o.textureCoord.length<p)&&(o.textureCoord=new Float32Array(p)),(!o.a_color||o.a_color.length<y)&&(o.a_color=new Uint8Array(y)),h&&(!o.a_sourceRect||o.a_sourceRect.length<h)&&(o.a_sourceRect=new Float32Array(h)),v&&(!o.a_clipUV||o.a_clipUV.length<v)&&(o.a_clipUV=new Float32Array(v)),T){var _m3=Object.entries(T._attribute),_x30=T._attribOpts||{};for(var _l9=0;_l9<_m3.length;_l9++){var _m3$_l=_slicedToArray(_m3[_l9],2),_d4=_m3$_l[0],_u7=_m3$_l[1];if(_d4!=="a_color"&&_d4!=="a_sourceRect"&&_u7!=="ignored"){var _g6=_x30[_d4]?_x30[_d4].type:"FLOAT",O=e[_g6],A=_u7.size*M;(!o[_d4]||o[_d4].length<A)&&(o[_d4]=new O(A));}}}return o;}function i(a,o){var s=[],c=[],p=[],h=[],v=[],y=[],M=0,T=0;var m=a[0]?a[0].uniforms||{}:{},x=a[0]?a[0].program:null;o&&(n(a,o),c=o.cells,s=o.positions,p=o.textureCoord,h=o.a_color,v=o.a_sourceRect,y=o.a_clipUV);var l=!1,d=!1;var u={};for(var O=0;O<a.length;O++){var A=a[O];if(A){var _s2,_h2,_v,_y,_p3;if(A.meshData&&(A=A.meshData),o){var b=A.positions;for(var E=0;E<b.length;E++){var L=b[E],D=3*(M+E);for(var I=0;I<L.length;I++)s[D+I]=L[I];}}else(_s2=s).push.apply(_s2,_toConsumableArray(A.positions));var R=A.cells;for(var _b2=0;_b2<R.length;_b2++){var _E3=R[_b2];if(o){var _L=3*(T+_b2);c[_L]=_E3[0]+M,c[_L+1]=_E3[1]+M,c[_L+2]=_E3[2]+M;}else c.push([_E3[0]+M,_E3[1]+M,_E3[2]+M]);}if(o){var _b3=A.attributes.a_color;for(var _E4=0;_E4<_b3.length;_E4++){var _L2=_b3[_E4],_D3=4*(M+_E4);h[_D3]=_L2[0],h[_D3+1]=_L2[1],h[_D3+2]=_L2[2],h[_D3+3]=_L2[3];}}else(_h2=h).push.apply(_h2,_toConsumableArray(A.attributes.a_color));if(A.attributes.a_sourceRect)if(l=!0,o){var _b4=A.attributes.a_sourceRect;for(var _E5=0;_E5<_b4.length;_E5++){var _L3=_b4[_E5],_D4=4*(M+_E5);v[_D4]=_L3[0],v[_D4+1]=_L3[1],v[_D4+2]=_L3[2],v[_D4+3]=_L3[3];}}else(_v=v).push.apply(_v,_toConsumableArray(A.attributes.a_sourceRect));if(A.attributes.a_clipUV)if(d=!0,o){var _b5=A.attributes.a_clipUV;for(var _E6=0;_E6<_b5.length;_E6++){var _L4=_b5[_E6],_D5=2*(M+_E6);y[_D5]=_L4[0],y[_D5+1]=_L4[1];}}else(_y=y).push.apply(_y,_toConsumableArray(A.attributes.a_clipUV));if(A.textureCoord)if(o){var _b6=A.textureCoord;for(var _E7=0;_E7<_b6.length;_E7++){var _L5=_b6[_E7],_D6=3*(M+_E7);for(var _I2=0;_I2<_L5.length;_I2++)p[_D6+_I2]=_L5[_I2];}}else(_p3=p).push.apply(_p3,_toConsumableArray(A.textureCoord));if(x){var _b7=Object.entries(x._attribute);for(var _E8=0;_E8<_b7.length;_E8++){var _u$_L;var _b7$_E=_slicedToArray(_b7[_E8],2),_L6=_b7$_E[0],_D7=_b7$_E[1];if(_L6!=="a_color"&&_L6!=="a_sourceRect"&&_D7!=="ignored")if(u[_L6]=[],o){u[_L6]=o[_L6];var _I3=A.attributes[_L6],C=_I3[0].length;for(var W=0;W<_I3.length;W++){var G=_I3[W],K=C*(M+W);for(var X=0;X<G.length;X++)u[_L6][K+X]=G[X];}}else(_u$_L=u[_L6]).push.apply(_u$_L,_toConsumableArray(A.attributes[_L6]));}}M+=A.positions.length,T+=A.cells.length;}}u.a_color=h,l&&v&&v.length>0&&(u.a_sourceRect=v);var g={positions:s,cells:c,attributes:u,uniforms:m,cellsCount:T*3,program:x};return p&&p.length&&(g.textureCoord=p),d&&y.length>0&&(u.a_clipUV=y),g;}},/* 29 */ /***/function(f,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,g){var O=Object.keys(u);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(u);g&&(A=A.filter(function(R){return Object.getOwnPropertyDescriptor(u,R).enumerable;})),O.push.apply(O,A);}return O;}function s(u){for(var g=1;g<arguments.length;g++){var O=arguments[g]!=null?arguments[g]:{};g%2?o(Object(O),!0).forEach(function(A){c(u,A,O[A]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(O)):o(Object(O)).forEach(function(A){Object.defineProperty(u,A,Object.getOwnPropertyDescriptor(O,A));});}return u;}function c(u,g,O){return g in u?Object.defineProperty(u,g,{value:O,enumerable:!0,configurable:!0,writable:!0}):u[g]=O,u;}var p=Symbol("mesh"),h=Symbol("count"),v=Symbol("blend"),y=Symbol("filter"),M=Symbol("textures"),T=Symbol("textureOptions"),m=Symbol("cloudColor"),x=Symbol("cloudFilter"),l=Symbol("buffer");function d(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var O=new Float32Array(3*u),A=new Float32Array(3*u),R=new Float32Array(4*u),b=new Float32Array(4*u),E=new Float32Array(4*u),L=new Float32Array(4*u),D=new Float32Array(4*u),I=new Uint8Array(u),C=new Uint8Array(4*u),W=new Uint8Array(4*u);return g&&(O.set(g.transform0,0),A.set(g.transform1,0),R.set(g.color0,0),b.set(g.color1,0),E.set(g.color2,0),L.set(g.color3,0),D.set(g.color4,0),I.set(g.frameIndex,0),C.set(g.fillColor,0),W.set(g.strokeColor,0)),{bufferSize:u,transform0:O,transform1:A,color0:R,color1:b,color2:E,color3:L,color4:D,frameIndex:I,fillColor:C,strokeColor:W};}r["default"]=/*#__PURE__*/function(){function _class(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref36=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref36$buffer=_ref36.buffer,O=_ref36$buffer===void 0?1e3:_ref36$buffer;_classCallCheck(this,_class);O=Math.max(O,g),this[h]=g,this[p]=u,this[l]=d(O),this[M]=[],this[y]=[],this[m]=!1,this[x]=!1,this[v]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var g=this[h];for(var O=u;O<g;O++)this[l].transform0.set([1,0,0],O*3),this[l].transform1.set([0,1,0],O*3),this[l].frameIndex.set([-1],O),this[l].fillColor.set([0,0,0,0],O*4),this[l].strokeColor.set([0,0,0,0],O*4),this.setColorTransform(O,null);}},{key:"bufferSize",get:function get(){return this[l].bufferSize;}},{key:"mesh",get:function get(){return this[p];},set:function set(u){this[p]=u,this[M]&&this.setTextureFrames(this[M],this[T]);}},{key:"hasCloudColor",get:function get(){return this[m];}},{key:"hasCloudFilter",get:function get(){return this[x];}},{key:"_getFilter",value:function _getFilter(u){return this[y][u]=this[y][u]||[],this[y][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[p].enableBlend||this[v];}},{key:"canIgnore",value:function canIgnore(){return this[p].canIgnore();}},{key:"delete",value:function _delete(u){if(u>=this[h]||u<0)throw new Error("Out of range.");var _this$l2=this[l],g=_this$l2.transform0,O=_this$l2.transform1,A=_this$l2.color0,R=_this$l2.color1,b=_this$l2.color2,E=_this$l2.color3,L=_this$l2.color4,D=_this$l2.frameIndex,I=_this$l2.fillColor,C=_this$l2.strokeColor;g.set(g.subarray(3*(u+1)),3*u),O.set(O.subarray(3*(u+1)),3*u),A.set(A.subarray(4*(u+1)),4*u),R.set(R.subarray(4*(u+1)),4*u),b.set(b.subarray(4*(u+1)),4*u),E.set(E.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),D.set(D.subarray(u+1),u),I.set(I.subarray(4*(u+1)),4*u),C.set(C.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[h]--;}},{key:"setColorTransform",value:function setColorTransform(u,g){if(u>=this[h]||u<0)throw new Error("Out of range.");u*=4;var _this$l3=this[l],O=_this$l3.color0,A=_this$l3.color1,R=_this$l3.color2,b=_this$l3.color3,E=_this$l3.color4;return g!=null?(O.set([g[0],g[5],g[10],g[15]],u),A.set([g[1],g[6],g[11],g[16]],u),R.set([g[2],g[7],g[12],g[17]],u),b.set([g[3],g[8],g[13],g[18]],u),E.set([g[4],g[9],g[14],g[19]],u),this[v]=this[v]||g[18]<1,this[x]=!0):(O.set([1,0,0,0],u),A.set([0,1,0,0],u),R.set([0,0,1,0],u),b.set([0,0,0,1],u),E.set([0,0,0,0],u)),this;}},{key:"getColorTransform",value:function getColorTransform(u){if(u>=this[h]||u<0)throw new Error("Out of range.");u*=4;var _this$l4=this[l],g=_this$l4.color0,O=_this$l4.color1,A=_this$l4.color2,R=_this$l4.color3,b=_this$l4.color4;return[g[u],O[u],A[u],R[u],b[u],g[u+1],O[u+1],A[u+1],R[u+1],b[u+1],g[u+2],O[u+2],A[u+2],R[u+2],b[u+2],g[u+3],O[u+3],A[u+3],R[u+3],b[u+3]];}},{key:"transformColor",value:function transformColor(u,g){var O=this.getColorTransform(u);return O=Object(n.multiply)(O,g),this.setColorTransform(u,O),this;}},{key:"setFillColor",value:function setFillColor(u,g){if(u>=this[h]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].fillColor.set(g.map(function(O){return Math.round(255*O);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,g){if(u>=this[h]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].strokeColor.set(g.map(function(O){return Math.round(255*O);}),4*u);}},{key:"getCloudRGBA",value:function getCloudRGBA(u){if(u>=this[h]||u<0)throw new Error("Out of range.");u*=4;var _this$l5=this[l],g=_this$l5.fillColor,O=_this$l5.strokeColor,A=[g[u],g[u+1],g[u+2],g[u+3]],R=[O[u],O[u+1],O[u+2],O[u+3]];return A[3]/=255,R[3]/=255,{fill:"rgba(".concat(A.join(),")"),stroke:"rgba(".concat(R.join(),")")};}},{key:"grayscale",value:function grayscale(u,g){this.transformColor(u,Object(n.grayscale)(g)),this._getFilter(u).push("grayscale(".concat(100*g,"%)"));}},{key:"brightness",value:function brightness(u,g){this.transformColor(u,Object(n.brightness)(g)),this._getFilter(u).push("brightness(".concat(100*g,"%)"));}},{key:"saturate",value:function saturate(u,g){this.transformColor(u,Object(n.saturate)(g)),this._getFilter(u).push("saturate(".concat(100*g,"%)"));}},{key:"contrast",value:function contrast(u,g){this.transformColor(u,Object(n.contrast)(g)),this._getFilter(u).push("contrast(".concat(100*g,"%)"));}},{key:"invert",value:function invert(u,g){this.transformColor(u,Object(n.invert)(g)),this._getFilter(u).push("invert(".concat(100*g,"%)"));}},{key:"sepia",value:function sepia(u,g){this.transformColor(u,Object(n.sepia)(g)),this._getFilter(u).push("sepia(".concat(100*g,"%)"));}},{key:"opacity",value:function opacity(u,g){this.transformColor(u,Object(n.opacity)(g)),this._getFilter(u).push("opacity(".concat(100*g,"%)"));}},{key:"hueRotate",value:function hueRotate(u,g){this.transformColor(u,Object(n.hueRotate)(g)),this._getFilter(u).push("hue-rotate(".concat(g,"deg)"));}},{key:"setTransform",value:function setTransform(u,g){if(u>=this[h]||u<0)throw new Error("Out of range.");u*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$l6=this[l],O=_this$l6.transform0,A=_this$l6.transform1;return O.set([g[0],g[2],g[4]],u),A.set([g[1],g[3],g[5]],u),this;}},{key:"getTransform",value:function getTransform(u){if(u>=this[h]||u<0)throw new Error("Out of range.");u*=3;var _this$l7=this[l],g=_this$l7.transform0,O=_this$l7.transform1;return[g[u],O[u],g[u+1],O[u+1],g[u+2],O[u+2]];}},{key:"getTextureFrame",value:function getTextureFrame(u){return this[M][this[l].frameIndex[u]];}},{key:"setTextureFrames",value:function setTextureFrames(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[p].setTexture(u[0],g),this[M]=u,this[T]=g;}},{key:"setFrameIndex",value:function setFrameIndex(u,g){if(u>=this[h]||u<0)throw new Error("Out of range.");var O=this[M].length;if(O<=0)throw new Error("No frames");this[l].frameIndex[u]=g%O;}},{key:"amount",get:function get(){return this[h];},set:function set(u){var g=this[h];u!==g&&(u>this[l].bufferSize&&(this[l]=d(Math.max(u,this[l].bufferSize+1e3),this[l])),this[h]=u,u>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$p$meshData=this[p].meshData,u=_this$p$meshData.attributes,g=_this$p$meshData.cells,O=_this$p$meshData.positions,A=_this$p$meshData.textureCoord,R=_this$p$meshData.uniforms,b=this[M],E={attributes:s({},u),cells:g,positions:O,textureCoord:A,uniforms:s({},R),instanceCount:this[h],enableBlend:this.enableBlend};b.length&&b.forEach(function(z,Q){E.uniforms["u_texFrame".concat(Q)]=z;});var _this$l8=this[l],L=_this$l8.transform0,D=_this$l8.transform1,I=_this$l8.color0,C=_this$l8.color1,W=_this$l8.color2,G=_this$l8.color3,K=_this$l8.color4,X=_this$l8.fillColor,Z=_this$l8.strokeColor,B=_this$l8.frameIndex;return this[p].uniforms.u_texSampler&&(E.attributes.a_frameIndex={data:B,divisor:1}),E.attributes.a_transform0={data:L,divisor:1},E.attributes.a_transform1={data:D,divisor:1},E.attributes.a_colorCloud0={data:I,divisor:1},E.attributes.a_colorCloud1={data:C,divisor:1},E.attributes.a_colorCloud2={data:W,divisor:1},E.attributes.a_colorCloud3={data:G,divisor:1},E.attributes.a_colorCloud4={data:K,divisor:1},this.hasCloudColor&&(E.attributes.a_fillCloudColor={data:X,divisor:1},E.attributes.a_strokeCloudColor={data:Z,divisor:1}),E;}},{key:"setProgram",value:function setProgram(u){this[p].setProgram(u);}},{key:"program",get:function get(){return this[p].program;}},{key:"transform",value:function transform(u,g){var O=this.getTransform(u);return g=e.mat2d.multiply(Array.of(0,0,0,0,0,0),O,g),this.setTransform(u,g),this;}},{key:"translate",value:function translate(u,_ref37){var _ref38=_slicedToArray(_ref37,2),g=_ref38[0],O=_ref38[1];var A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[g,O]),this.transform(u,A);}},{key:"rotate",value:function rotate(u,g){var _ref39=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref40=_slicedToArray(_ref39,2),O=_ref40[0],A=_ref40[1];var R=e.mat2d.create();return R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[O,A]),R=e.mat2d.rotate(Array.of(0,0,0,0,0,0),R,g),R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[-O,-A]),this.transform(u,R);}},{key:"scale",value:function scale(u,_ref41){var _ref42=_slicedToArray(_ref41,2),g=_ref42[0],_ref42$=_ref42[1],O=_ref42$===void 0?g:_ref42$;var _ref43=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref44=_slicedToArray(_ref43,2),A=_ref44[0],R=_ref44[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),b=e.mat2d.scale(Array.of(0,0,0,0,0,0),b,[g,O]),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-R]),this.transform(u,b);}},{key:"skew",value:function skew(u,_ref45){var _ref46=_slicedToArray(_ref45,2),g=_ref46[0],_ref46$=_ref46[1],O=_ref46$===void 0?g:_ref46$;var _ref47=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref48=_slicedToArray(_ref47,2),A=_ref48[0],R=_ref48[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),b=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,e.mat2d.fromValues(1,Math.tan(O),Math.tan(g),1,0,0)),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-R]),this.transform(u,b);}},{key:"isPointCollision",value:function isPointCollision(u,_ref49){var _this$p;var _ref50=_slicedToArray(_ref49,2),g=_ref50[0],O=_ref50[1];var A=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var R=this.getTransform(u),b=Object(i.transformPoint)([g,O],e.mat2d.invert(Array.of(0,0,0,0,0,0),R));return(_this$p=this[p]).isPointCollision.apply(_this$p,_toConsumableArray(b).concat([A]));}},{key:"isPointInFill",value:function isPointInFill(u,_ref51){var _ref52=_slicedToArray(_ref51,2),g=_ref52[0],O=_ref52[1];return this.isPointCollision(u,[g,O],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(u,_ref53){var _ref54=_slicedToArray(_ref53,2),g=_ref54[0],O=_ref54[1];return this.isPointCollision(u,[g,O],"stroke");}}]);}();},/* 30 */ /***/function(f,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 c;}),t.d(r,"sepia",function(){return p;}),t.d(r,"opacity",function(){return h;}),t.d(r,"hueRotate",function(){return v;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(y,M){var T=[],m=y[0],x=y[1],l=y[2],d=y[3],u=y[4],g=y[5],O=y[6],A=y[7],R=y[8],b=y[9],E=y[10],L=y[11],D=y[12],I=y[13],C=y[14],W=y[15],G=y[16],K=y[17],X=y[18],Z=y[19];var B=M[0],z=M[1],Q=M[2],et=M[3],_=M[4];return T[0]=B*m+z*g+Q*E+et*W,T[1]=B*x+z*O+Q*L+et*G,T[2]=B*l+z*A+Q*D+et*K,T[3]=B*d+z*R+Q*I+et*X,T[4]=B*u+z*b+Q*C+et*Z+_,B=M[5],z=M[6],Q=M[7],et=M[8],_=M[9],T[5]=B*m+z*g+Q*E+et*W,T[6]=B*x+z*O+Q*L+et*G,T[7]=B*l+z*A+Q*D+et*K,T[8]=B*d+z*R+Q*I+et*X,T[9]=B*u+z*b+Q*C+et*Z+_,B=M[10],z=M[11],Q=M[12],et=M[13],_=M[14],T[10]=B*m+z*g+Q*E+et*W,T[11]=B*x+z*O+Q*L+et*G,T[12]=B*l+z*A+Q*D+et*K,T[13]=B*d+z*R+Q*I+et*X,T[14]=B*u+z*b+Q*C+et*Z+_,B=M[15],z=M[16],Q=M[17],et=M[18],_=M[19],T[15]=B*m+z*g+Q*E+et*W,T[16]=B*x+z*O+Q*L+et*G,T[17]=B*l+z*A+Q*D+et*K,T[18]=B*d+z*R+Q*I+et*X,T[19]=B*u+z*b+Q*C+et*Z+_,T;}function i(y){y=Object(e.clamp)(0,1,y);var M=0.2126*y,T=0.7152*y,m=0.0722*y;return[M+1-y,T,m,0,0,M,T+1-y,m,0,0,M,T,m+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 M=0.2126*(1-y),T=0.7152*(1-y),m=0.0722*(1-y);return[M+y,T,m,0,0,M,T+y,m,0,0,M,T,m+y,0,0,0,0,0,1,0];}function s(y){var M=0.5*(1-y);return[y,0,0,0,M,0,y,0,0,M,0,0,y,0,M,0,0,0,1,0];}function c(y){var M=1-2*y;return[M,0,0,0,y,0,M,0,0,y,0,0,M,0,y,0,0,0,1,0];}function p(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 h(y){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,y,0];}function v(y){var M=y/180*Math.PI,T=Math.cos(M),m=Math.sin(M),x=0.2126,l=0.7152,d=0.0722;return[x+T*(1-x)+m*-x,l+T*-l+m*-l,d+T*-d+m*(1-d),0,0,x+T*-x+m*0.143,l+T*(1-l)+m*0.14,d+T*-d+m*-0.283,0,0,x+T*-x+m*-(1-x),l+T*-l+m*l,d+T*(1-d)+m*d,0,0,0,0,0,1,0];}},/* 31 */ /***/function(f,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(f,r,t){var e=t(33),n=t(37),i=t(39);f.exports=function(o){var s,c=e(o);return c.space?(s=Array(3),s[0]=i(c.values[0],0,255),s[1]=i(c.values[1],0,255),s[2]=i(c.values[2],0,255),c.space[0]==="h"&&(s=n.rgb(s)),s.push(i(c.alpha,0,1)),s):[];};},/* 33 */ /***/function(f,r,t){(function(e){var n=t(34),i=t(35),a=t(36);f.exports=s;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function s(c){var p,h=[],v=1,y;if(typeof c=="string"){if(n[c])h=n[c].slice(),y="rgb";else if(c==="transparent")v=0,y="rgb",h=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(c)){var M=c.slice(1),T=M.length,m=T<=4;v=1,m?(h=[parseInt(M[0]+M[0],16),parseInt(M[1]+M[1],16),parseInt(M[2]+M[2],16)],T===4&&(v=parseInt(M[3]+M[3],16)/255)):(h=[parseInt(M[0]+M[1],16),parseInt(M[2]+M[3],16),parseInt(M[4]+M[5],16)],T===8&&(v=parseInt(M[6]+M[7],16)/255)),h[0]||(h[0]=0),h[1]||(h[1]=0),h[2]||(h[2]=0),y="rgb";}else if(p=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(c)){var x=p[1],l=x==="rgb",M=x.replace(/a$/,"");y=M;var T=M==="cmyk"?4:M==="gray"?1:3;h=p[2].trim().split(/\s*,\s*/).map(function(O,A){if(/%$/.test(O))return A===T?parseFloat(O)/100:M==="rgb"?parseFloat(O)*255/100:parseFloat(O);if(M[A]==="h"){if(/deg$/.test(O))return parseFloat(O);if(o[O]!==void 0)return o[O];}return parseFloat(O);}),x===M&&h.push(1),v=l||h[T]===void 0?1:h[T],h=h.slice(0,T);}else c.length>10&&/[0-9](?:\s|\/)/.test(c)&&(h=c.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),y=c.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(c))y="rgb",h=[c>>>16,(c&65280)>>>8,c&255];else if(i(c)){var d=a(c.r,c.red,c.R,null);d!==null?(y="rgb",h=[d,a(c.g,c.green,c.G),a(c.b,c.blue,c.B)]):(y="hsl",h=[a(c.h,c.hue,c.H),a(c.s,c.saturation,c.S),a(c.l,c.lightness,c.L,c.b,c.brightness)]),v=a(c.a,c.alpha,c.opacity,1),c.opacity!=null&&(v/=100);}else(Array.isArray(c)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(c))&&(h=[c[0],c[1],c[2]],y="rgb",v=c.length===4?c[3]:1);return{space:y,values:h,alpha:v};}}).call(this,t(22));},/* 34 */ /***/function(f,r,t){f.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(f,r,t){var e=Object.prototype.toString;f.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 */ /***/function(f,r){f.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 */ /***/function(f,r,t){var e=t(38);f.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var i=n[0]/360,a=n[1]/100,o=n[2]/100,s,c,p,h,v;if(a===0)return v=o*255,[v,v,v];o<0.5?c=o*(1+a):c=o+a-o*a,s=2*o-c,h=[0,0,0];for(var y=0;y<3;y++)p=i+1/3*-(y-1),p<0?p++:p>1&&p--,6*p<1?v=s+(c-s)*6*p:2*p<1?v=c:3*p<2?v=s+(c-s)*(2/3-p)*6:v=s,h[y]=v*255;return h;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,o=n[2]/255,s=Math.min(i,a,o),c=Math.max(i,a,o),p=c-s,h,v,y;return c===s?h=0:i===c?h=(a-o)/p:a===c?h=2+(o-i)/p:o===c&&(h=4+(i-a)/p),h=Math.min(h*60,360),h<0&&(h+=360),y=(s+c)/2,c===s?v=0:y<=0.5?v=p/(c+s):v=p/(2-c-s),[h,v*100,y*100];};},/* 38 */ /***/function(f,r,t){f.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 */ /***/function(f,r){f.exports=t;function t(e,n,i){return n<i?e<n?n:e>i?i:e:e<i?i:e>n?n:e;}},/* 40 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return d;});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),c=t(44),p=t(46),h=/* @__PURE__ */t.n(p),v=t(53),y=t(55);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("contours"),T=Symbol("path"),m=Symbol("simplify"),x=Symbol("scale"),l=2*Math.PI;var d=/*#__PURE__*/function(){function d(){var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,d);typeof g=="string"&&(g={path:g}),g.path?this[T]=n()(g.path):this[T]=[],this[M]=null,this[m]=g.simplify!=null?g.simplify:0,this[x]=g.scale!=null?g.scale:2;}return _createClass(d,[{key:"contours",get:function get(){var g=null;if(!this[M]&&this[T]){var O=Object(c["default"])(s()(this[T]));this[M]=h()(O,this[x],this[m]),this[M].path=O,this[M].simplify=this[m],this[M].scale=this[x];}return this[M]&&(g=this[M].map(function(O){return _toConsumableArray(O);}),g.path=this[M].path,g.simplify=this[M].simplify,g.scale=this[M].scale),g;}},{key:"path",get:function get(){return this[T];}},{key:"simplify",get:function get(){return this[m];}},{key:"boundingBox",get:function get(){var g=this.contours;if(g&&g.length){var O=g.reduce(function(A,R){return[].concat(_toConsumableArray(A),_toConsumableArray(R));});return a()(O);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var g=this.boundingBox;return g?[0.5*(g[0][0]+g[1][0]),0.5*(g[0][1]+g[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$T;var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var A=Object(c["default"])(s()(this[T])).map(function(_ref55){var _ref56=_toArray(_ref55),R=_ref56[0],b=_ref56.slice(1);var E=[R];for(var L=0;L<b.length;L+=2){var D=b[L]-g,I=b[L+1]-O;E.push(D,I);}return E;});return this.beginPath(),(_this$T=this[T]).push.apply(_this$T,_toConsumableArray(A)),this;}},{key:"getPointAtLength",value:function getPointAtLength(g){return this.contours?Object(v.getPointAtLength)(this[M],g):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(v.getTotalLength)(this[M]):0;}},{key:"addPath",value:function addPath(g){var _this$T2;this[M]=null,typeof g=="string"&&(g=n()(g)),(_this$T2=this[T]).push.apply(_this$T2,_toConsumableArray(g));}},{key:"beginPath",value:function beginPath(){this[T]=[],this[M]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(g,O,A,R,b,E,L){var D=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(E+=b,L+=b,A<=0||R<=0||L===E)return;L<E&&(L=E+l+(L-E)%l),L-E>l&&(L=E+l);var I=L-E;I>=l&&(L-=1e-3);var C=this[T].length>0&&I<l?"L":"M";var W=Object(y.getPoint)(g,O,A,R,E),G=Object(y.getPoint)(g,O,A,R,L),K=+!D;var X=I>Math.PI?1:0;D&&(X=1-X),C+=W.join(" "),C+="A".concat(A," ").concat(R," 0 ").concat(X," ").concat(K," ").concat(G.join(" ")),I>=l&&(C+="Z"),this.addPath(C);}},{key:"arc",value:function arc(g,O,A,R,b){var E=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,O,A,A,0,R,b,E);}},{key:"arcTo",value:function arcTo(g,O,A,R,b,E,L){this[M]=null,this[T].push(["A",g,O,A,R,b,E,L]);}},{key:"moveTo",value:function moveTo(g,O){this[M]=null,this[T].push(["M",g,O]);}},{key:"lineTo",value:function lineTo(g,O){this[M]=null,this[T].push(["L",g,O]);}},{key:"bezierCurveTo",value:function bezierCurveTo(g,O,A,R,b,E){this[M]=null,this[T].push(["C",g,O,A,R,b,E]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,O,A,R){this[M]=null,this[T].push(["Q",g,O,A,R]);}},{key:"rect",value:function rect(g,O,A,R){var b="M".concat(g," ").concat(O,"L").concat(g+A," ").concat(O,"L").concat(g+A," ").concat(O+R,"L").concat(g," ").concat(O+R,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[M]=null;var g=[];var O=this[T].length;O>0&&(g=this[T][O-1]),g[0]!=="Z"&&g[0]!=="z"&&this[T].push(["Z"]);}}]);}();},/* 41 */ /***/function(f,r){f.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(c,p,h){var v=p.toLowerCase();for(h=a(h),v=="m"&&h.length>2&&(s.push([p].concat(h.splice(0,2))),v="l",p=p=="m"?"l":"L");;){if(h.length==t[v])return h.unshift(p),s.push(h);if(h.length<t[v])throw new Error("malformed path data");s.push([p].concat(h.splice(0,t[v])));}}),s;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function a(o){var s=o.match(i);return s?s.map(Number):[];}},/* 42 */ /***/function(f,r,t){f.exports=e;function e(n){var i=n.length;if(i===0)return[[],[]];for(var a=n[0].length,o=n[0].slice(),s=n[0].slice(),c=1;c<i;++c)for(var p=n[c],h=0;h<a;++h){var v=p[h];o[h]=Math.min(o[h],v),s[h]=Math.max(s[h],v);}return[o,s];}},/* 43 */ /***/function(f,r){f.exports=t;function t(e){var n=0,i=0,a=0,o=0;return e.map(function(s){s=s.slice();var c=s[0],p=c.toUpperCase();if(c!=p)switch(s[0]=p,c){case"a":s[6]+=a,s[7]+=o;break;case"v":s[1]+=o;break;case"h":s[1]+=a;break;default:for(var h=1;h<s.length;)s[h++]+=a,s[h++]+=o;}switch(p){case"Z":a=n,o=i;break;case"H":a=s[1];break;case"V":o=s[1];break;case"M":a=n=s[1],o=i=s[2];break;default:a=s[s.length-2],o=s[s.length-1];}return s;});}},/* 44 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(o){for(var s,c=[],p=0,h=0,v=0,y=0,M=null,T=null,m=0,x=0,l=0,d=o.length;l<d;l++){var u=o[l],g=u[0];switch(g){case"M":v=u[1],y=u[2];break;case"A":var O=Object(e["default"])(m,x,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!O.length)continue;O=O.map(function(L){var _L7=_slicedToArray(L,8),D=_L7[0],I=_L7[1],C=_L7[2],W=_L7[3],G=_L7[4],K=_L7[5],X=_L7[6],Z=_L7[7];return{x1:C,y1:W,x2:G,y2:K,x:X,y:Z};});for(var A=0,R;A<O.length;A++)R=O[A],u=["C",R.x1,R.y1,R.x2,R.y2,R.x,R.y],A<O.length-1&&c.push(u);break;case"S":var b=m,E=x;(s=="C"||s=="S")&&(b+=b-p,E+=E-h),u=["C",b,E,u[1],u[2],u[3],u[4]];break;case"T":s=="Q"||s=="T"?(M=m*2-M,T=x*2-T):(M=m,T=x),u=a(m,x,M,T,u[1],u[2]);break;case"Q":M=u[1],T=u[2],u=a(m,x,u[1],u[2],u[3],u[4]);break;case"L":u=i(m,x,u[1],u[2]);break;case"H":u=i(m,x,u[1],x);break;case"V":u=i(m,x,m,u[1]);break;case"Z":u=i(m,x,v,y);break;}s=g,m=u[u.length-2],x=u[u.length-1],u.length>4?(p=u[u.length-4],h=u[u.length-3]):(p=m,h=x),c.push(u);}return c;}function i(o,s,c,p){return["C",o,s,c,p,c,p];}function a(o,s,c,p,h,v){return["C",o/3+2/3*c,s/3+2/3*p,h/3+2/3*c,v/3+2/3*p,h,v];}},/* 45 */ /***/function(f,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,c,p,h){var v=s*h-c*p<0?-1:1;var y=s*p+c*h;return y>1&&(y=1),y<-1&&(y=-1),v*Math.acos(y);}function i(s,c,p,h,v,y,M,T,m,x){var l=x*(s-p)/2+m*(c-h)/2,d=-m*(s-p)/2+x*(c-h)/2,u=M*M,g=T*T,O=l*l,A=d*d;var R=u*g-u*A-g*O;R<0&&(R=0),R/=u*A+g*O,R=Math.sqrt(R)*(v===y?-1:1);var b=R*M/T*d,E=R*-T/M*l,L=x*b-m*E+(s+p)/2,D=m*b+x*E+(c+h)/2,I=(l-b)/M,C=(d-E)/T,W=(-l-b)/M,G=(-d-E)/T,K=n(1,0,I,C);var X=n(I,C,W,G);return y===0&&X>0&&(X-=e),y===1&&X<0&&(X+=e),[L,D,K,X];}function a(s,c){var p=1.3333333333333333*Math.tan(c/4),h=Math.cos(s),v=Math.sin(s),y=Math.cos(s+c),M=Math.sin(s+c);return[h,v,h-v*p,v+h*p,y+M*p,M-y*p,y,M];}function o(s,c,p,h,v,y,M,T,m){var x=Math.sin(m*e/360),l=Math.cos(m*e/360),d=l*(s-p)/2+x*(c-h)/2,u=-x*(s-p)/2+l*(c-h)/2;if(d===0&&u===0)return[];if(M===0||T===0)return[];M=Math.abs(M),T=Math.abs(T);var g=d*d/(M*M)+u*u/(T*T);g>1&&(M*=Math.sqrt(g),T*=Math.sqrt(g));var O=i(s,c,p,h,v,y,M,T,x,l),A=[];var R=O[2],b=O[3];var E=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=E;for(var L=0;L<E;L++)A.push(a(R,b)),R+=b;return A.map(function(L){for(var D=0;D<L.length;D+=2){var I=L[D+0],C=L[D+1];I*=M,C*=T;var W=l*I-x*C,G=x*I+l*C;L[D+0]=W+O[0],L[D+1]=G+O[1];}return L;});}},/* 46 */ /***/function(f,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(47),_t2=t(49),n=_t2.copy,i=t(50);function a(h,v,y){return h[0]=v,h[1]=y,h;}var o=[0,0],s=[0,0],c=[0,0];function p(h,v,y,M){e(y,a(o,M[1],M[2]),a(s,M[3],M[4]),a(c,M[5],M[6]),v,h);}f.exports=function(v,y,M){var T=[],m=[],x=[0,0];return v.forEach(function(l,d,u){if(l[0]==="M")n(x,l.slice(1)),m.length>0&&(T.push(m),m=[]);else if(l[0]==="C")p(m,y,x,l),a(x,l[5],l[6]);else throw new Error("illegal type in SVG: "+l[0]);}),m.length>0&&T.push(m),T.map(function(l){return i(l,M||0);});};},/* 47 */ /***/function(f,r,t){f.exports=t(48)();},/* 48 */ /***/function(f,r){function t(n){return[n[0],n[1]];}function e(n,i){return[n,i];}f.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,c=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,p=i.angleTolerance||0,h=i.cuspLimit||0;return function(T,m,x,l,d,u){u||(u=[]),d=typeof d=="number"?d:1;var g=s/d;return g*=g,v(T,m,x,l,u,g),u;};function v(M,T,m,x,l,d){l.push(t(M));var u=M[0],g=M[1],O=T[0],A=T[1],R=m[0],b=m[1],E=x[0],L=x[1];y(u,g,O,A,R,b,E,L,l,d,0),l.push(t(x));}function y(M,T,m,x,l,d,u,g,O,A,R){if(!(R>a)){var b=Math.PI,E=(M+m)/2,L=(T+x)/2,D=(m+l)/2,I=(x+d)/2,C=(l+u)/2,W=(d+g)/2,G=(E+D)/2,K=(L+I)/2,X=(D+C)/2,Z=(I+W)/2,B=(G+X)/2,z=(K+Z)/2;if(R>0){var Q=u-M,et=g-T,_=Math.abs((m-u)*et-(x-g)*Q),st=Math.abs((l-u)*et-(d-g)*Q),q,ht;if(_>o&&st>o){if((_+st)*(_+st)<=A*(Q*Q+et*et)){if(p<c){O.push(e(B,z));return;}var dt=Math.atan2(d-x,l-m);if(q=Math.abs(dt-Math.atan2(x-T,m-M)),ht=Math.abs(Math.atan2(g-d,u-l)-dt),q>=b&&(q=2*b-q),ht>=b&&(ht=2*b-ht),q+ht<p){O.push(e(B,z));return;}if(h!==0){if(q>h){O.push(e(m,x));return;}if(ht>h){O.push(e(l,d));return;}}}}else if(_>o){if(_*_<=A*(Q*Q+et*et)){if(p<c){O.push(e(B,z));return;}if(q=Math.abs(Math.atan2(d-x,l-m)-Math.atan2(x-T,m-M)),q>=b&&(q=2*b-q),q<p){O.push(e(m,x)),O.push(e(l,d));return;}if(h!==0&&q>h){O.push(e(m,x));return;}}}else if(st>o){if(st*st<=A*(Q*Q+et*et)){if(p<c){O.push(e(B,z));return;}if(q=Math.abs(Math.atan2(g-d,u-l)-Math.atan2(d-x,l-m)),q>=b&&(q=2*b-q),q<p){O.push(e(m,x)),O.push(e(l,d));return;}if(h!==0&&q>h){O.push(e(l,d));return;}}}else if(Q=B-(M+u)/2,et=z-(T+g)/2,Q*Q+et*et<=A){O.push(e(B,z));return;}}y(M,T,E,L,G,K,B,z,O,A,R+1),y(B,z,X,Z,C,W,u,g,O,A,R+1);}}};},/* 49 */ /***/function(f,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 c;}),t.d(r,"cross",function(){return p;}),t.d(r,"sub",function(){return h;}),t.d(r,"add",function(){return v;}),t.d(r,"computeMiter",function(){return m;}),t.d(r,"normal",function(){return x;}),t.d(r,"direction",function(){return l;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(d){return[d[0],d[1]];}function i(){return[0,0];}var a=e.vec2.copy,o=e.vec2.scaleAndAdd,s=e.vec2.dot,c=e.vec2.rotate,p=e.vec2.cross,h=e.vec2.sub,v=e.vec2.add,y=e.vec2.normalize,M=e.vec2.set,T=i();function m(d,u,g,O,A){v(d,g,O),y(d,d),M(u,-d[1],d[0]),M(T,-g[1],g[0]);var R=A/s(u,T);return Math.abs(R);}function x(d,u){return M(d,-u[1],u[0]),d;}function l(d,u,g){return h(d,u,g),y(d,d),d;}},/* 50 */ /***/function(f,r,t){var e=t(51),n=t(52);f.exports=function(a,o){return a=e(a,o),a=n(a,o),a;},f.exports.radialDistance=e,f.exports.douglasPeucker=n;},/* 51 */ /***/function(f,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a;}f.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],c,p=1,h=n.length;p<h;p++)c=n[p],t(c,o)>a&&(s.push(c),o=c);return o!==c&&s.push(c),s;};},/* 52 */ /***/function(f,r){function t(n,i,a){var o=i[0],s=i[1],c=a[0]-o,p=a[1]-s;if(c!==0||p!==0){var h=((n[0]-o)*c+(n[1]-s)*p)/(c*c+p*p);h>1?(o=a[0],s=a[1]):h>0&&(o+=c*h,s+=p*h);}return c=n[0]-o,p=n[1]-s,c*c+p*p;}function e(n,i,a,o,s){for(var c=o,p,h=i+1;h<a;h++){var v=t(n[h],n[i],n[a]);v>c&&(p=h,c=v);}c>o&&(p-i>1&&e(n,i,p,o,s),s.push(n[p]),a-p>1&&e(n,p,a,o,s));}f.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var o=a*a,s=i.length-1,c=[i[0]];return e(i,0,s,o,c),c.push(i[s]),c;};},/* 53 */ /***/function(f,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 c=0;return s.forEach(function(p){var h=p[0];for(var v=1;v<p.length;v++){var y=p[v];c+=Object(e.distance)(h,y),h=y;}}),s.totalLength=c,c;}function i(s,c){var p=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(c<=0)throw new TypeError("Length must > 0");var h=n(s);if(c>=h){var y=s[s.length-1],M=y[y.length-2],T=y[y.length-1],m=Math.atan2(T[1]-M[1],T[0]-M[0]);return{current:s.map(function(x){return _toConsumableArray(x);}),point:{x:T[0],y:T[1],angle:m}};}var v=[];for(var _y2=0;_y2<s.length;_y2++){v[_y2]=[];var _M=s[_y2];var _T2=_M[0];for(var _m4=1;_m4<_M.length;_m4++){var _x31=_M[_m4],_l10=Object(e.distance)(_T2,_x31);if(c<_l10){var d=c/_l10,u=Math.atan2(_x31[1]-_T2[1],_x31[0]-_T2[0]),g={x:_T2[0]*(1-d)+_x31[0]*d,y:_T2[1]*(1-d)+_x31[1]*d,angle:u};if(v[_y2].push(_T2),c>0&&v[_y2].push([g.x,g.y]),!p)return{current:v,point:g};var O=[],A=_y2;for(;_y2<s.length;_y2++){for(O[_y2-A]=[],_y2===A&&O[0].push([g.x,g.y]);_m4<_M.length;_m4++)O[_y2-A].push(_M[_m4]);_m4=0;}return{current:v,point:g,rest:O};}c-=_l10,v[_y2].push(_T2),_T2=_x31;}}}function a(s,c){if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(s.length<=0)return{x:0,y:0,angle:0};if(c<=0){var p=s[0][0],h=s[0][1],v=Math.atan2(h[1]-p[1],h[0]-p[0]);return{x:p[0],y:p[1],angle:v};}return i(s,c,!1).point;}function o(s,c,p){var h=0,v=c[0],y=s;var M=[],T=c.length;if(p>0){do p-=c[h%T],h++;while(p>0);p<0&&(v=-p,h--);}else if(p<0){h=-1;do p+=c[h%T+T-1],h--;while(p<0);p>=0&&(h++,v=c[h%T+T-1]-p);}do{var m=i(y,v);y=m.rest,++h%2&&M.push.apply(M,_toConsumableArray(m.current));var _x32=h%T;_x32<0&&(_x32+=T),v=c[_x32];}while(y);return M;}},/* 54 */ /***/function(f,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(_ref57,s,c,p){var _ref58=_slicedToArray(_ref57,3),i=_ref58[0],a=_ref58[1],o=_ref58[2];return i=i*2/s-1,a=1-a*2/c,Number.isFinite(p)?(o=o*2/p-1,[i,a,o]):[i,a];}function n(_ref59,_ref60){var _ref61=_slicedToArray(_ref59,3),i=_ref61[0],a=_ref61[1],_ref61$=_ref61[2],o=_ref61$===void 0?0:_ref61$;var _ref62=_slicedToArray(_ref60,3),s=_ref62[0],c=_ref62[1],_ref62$=_ref62[2],p=_ref62$===void 0?0:_ref62$;return Math.hypot(s-i,c-a,p-o);}},/* 55 */ /***/function(f,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,c){c%=e,c<0&&(c+=e);var p=Math.tan(c);if(Math.abs(p)<1e5){var h=a-p*i,v=1/Math.pow(o,2)+Math.pow(p,2)/Math.pow(s,2);var y=-1;(c<=Math.PI/2||c>3*Math.PI/2)&&(y=1);var M=y*Math.sqrt(1/v)+i,T=p*M+h;return[M,T];}return c<Math.PI?[i,a+s]:[i,a-s];}},/* 56 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return V;});var e=t(1),n=t(42),i=/* @__PURE__ */t.n(n),a=t(57),o=t(28),s=t(24),c=t(30),p=t(59),h=t(53),v=t(60),y=/* @__PURE__ */t.n(v),M=t(46),T=/* @__PURE__ */t.n(M),m=t(31),x=t(40),l=t(21);t(1).glMatrix.setMatrixArrayType(Array);function d(J,N){if(J==null)return{};var $=u(J,N),S,P;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(J);for(P=0;P<w.length;P++)S=w[P],!(N.indexOf(S)>=0)&&Object.prototype.propertyIsEnumerable.call(J,S)&&($[S]=J[S]);}return $;}function u(J,N){if(J==null)return{};var $={},S=Object.keys(J),P,w;for(w=0;w<S.length;w++)P=S[w],!(N.indexOf(P)>=0)&&($[P]=J[P]);return $;}var g=Symbol("mesh"),O=Symbol("contours"),A=Symbol("stroke"),R=Symbol("fill"),b=Symbol("strokeColor"),E=Symbol("fillColor"),L=Symbol("transform"),D=Symbol("invertTransform"),I=Symbol("uniforms"),C=Symbol("texOptions"),W=Symbol("blend"),G=Symbol("applyTexture"),K=Symbol("applyTransform"),X=Symbol("applyGradientTransform"),Z=Symbol("applyProgram"),B=Symbol("gradient"),z=Symbol("filter"),Q=Symbol("opacity"),et=Symbol("program"),_=Symbol("attributes"),st=Symbol("pass"),q=Symbol("clipContext"),ht=Symbol("applyClipPath");function dt(J,N){var $=J[1][0]-J[0][0],S=J[1][1]-J[0][1],P=[];for(var w=0;w<N.length;w++){var j=N[w],H=[(j[0]-J[0][0])/$,1-(j[1]-J[0][1])/S];P.push(H);}return P;}function F(_ref63,_ref64,_ref65){var _ref66=_slicedToArray(_ref63,2),J=_ref66[0],N=_ref66[1];var _ref67=_slicedToArray(_ref64,4),$=_ref67[0],S=_ref67[1],P=_ref67[2],w=_ref67[3];var j=_ref65.scale;return j||(J/=P,N=1-N/w,J-=$,N+=S),[J,N,0];}function U(J,N,$){var S=T()(J,N,$);return S.path=J,S.simplify=$,S.scale=N,S;}var V=/*#__PURE__*/function(){function V(N){_classCallCheck(this,V);this[A]=null,this[R]=null,this[L]=[1,0,0,1,0,0],this[Q]=1,this[I]={},this[z]=[],this[W]=null,this[C]={},this.contours=N.contours,this[et]=null,this[_]={},this[st]=[];}return _createClass(V,[{key:"contours",get:function get(){return this[O];},set:function set(N){this[g]=null,this[O]=N;var $=N.scale;this.transformScale/$>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[et]=N,this[g]&&this[Z](N);}},{key:"program",get:function get(){return this[et];}},{key:"setAttribute",value:function setAttribute(N,$){$==null?delete this[_][N]:this[_][N]=$;}},{key:"getOpacity",value:function getOpacity(){return this[Q];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach(function($){$[2]=1/$[2]>0?N:-N;}),this[Q]=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[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[ht]();}},{key:ht,value:function value(){if(this.clipPath){this[q]||(this[q]=l["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],P=_this$boundingBox$2[1];S&&P&&(this[q].width=S-N,this[q].height=P-$);var w=this[q].getContext("2d"),j=new Path2D(this.clipPath);w.clearRect(0,0,this[q].width,this[q].height),w.save(),w.translate(-N,-$),w.fillStyle="white",w.fill(j),w.restore(),this[g].clipPath=this[q];var H=dt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=H;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(h.getPointAtLength)(this[O],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(h.getTotalLength)(this[O]);}},{key:"blend",get:function get(){return this[W]==null?"auto":this[W];}},{key:"blend",set:function set(N){this[W]=N,this[g]&&(this[g].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[g]&&this[g].boundingBox)return this[g].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[A]?this[A].lineWidth:0;}},{key:"lineCap",get:function get(){return this[A]?this[A].lineCap:"";}},{key:"lineJoin",get:function get(){return this[A]?this[A].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[A]?this[A].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[A]?this[A].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[A]?this[A].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[E]&&this[E][3]!==0?Object(s["default"])(this[E]):"";}},{key:"gradient",get:function get(){return this[B];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].u_texSampler._img,options:this[C]}:null;}},{key:"enableBlend",get:function get(){return this[W]===!0||this[W]===!1?this[W]:this[Q]<1||this[b]!=null&&this[b][3]<1||this[E]!=null&&this[E][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[z].join(" ");}},{key:"transformMatrix",get:function get(){return this[L];}},{key:"invertMatrix",get:function get(){if(!this[D]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[D]=N;}return this[D];}},{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[st];}},{key:Z,value:function value(N){var $=this[_],S=this[g].position0,P=Object.entries(N._attribute);for(var w=0;w<P.length;w++){var _P$w=_slicedToArray(P[w],2),j=_P$w[0],H=_P$w[1];if(j!=="a_color"&&j!=="a_sourceRect"&&H!=="ignored"){var Y=$[j];if(j==="uv"&&!Y){var k=this[g].boundingBox||i()(S);this[g].attributes[j]=dt(k,S);}else{this[g].attributes[j]=[];for(var _k=0;_k<S.length;_k++){var rt=S[_k];this[g].attributes[j].push(Y?Y(rt,w,S):Array(H.size).fill(0));}}}}}// {stroke, fill}
38
+ },{key:"meshData",get:function get(){var _this20=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[g]){!this[R]&&!this[A]&&this.setFill();var N=this[O],$={};if(N&&N.length){if(this[R])try{var w=y()(N,this[R]);w.positions=w.positions.map(function(j){return j.push(_this20[Q]),j;}),w.attributes={a_color:Array.from({length:w.positions.length}).map(function(){return _this20[E].map(function(j){return Math.round(255*j);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
39
+ },$.fill=w;}catch(_unused8){}if(this[A]){var _w=this[A].lineDash;var j=N;if(_w){var Y=this[A].lineDashOffset;j=Object(h.getDashContours)(N,_w,Y);}var H=j.map(function(Y,k){var rt=Y.length>1&&e.vec2.equals(Y[0],Y[Y.length-1]),it=_this20[A].build(Y,rt);return y()([it]);});H.forEach(function(Y){Y.positions=Y.positions.map(function(k){return k.push(-_this20[Q]),k;}),Y.attributes={a_color:Array.from({length:Y.positions.length}).map(function(){return _this20[b].map(function(k){return Math.round(255*k);});})};}),$.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(_ref68){var _ref69=_slicedToArray(_ref68,3),w=_ref69[0],j=_ref69[1],H=_ref69[2];return[w,j,H];}),S.uniforms=this[I],this[g]=S,this[I].u_texSampler&&this[G](S,this[C]);var P=this[L];Object(p.isUnitTransform)(P)||(this[K](S,P),this[I].u_radialGradientVector&&this[X]()),this.clipPath&&this[ht](),this[et]&&this[Z](this[et]);}return this._updateMatrix&&(this[g].matrix=this[L],this[K](this[g],this[L]),this[I].u_radialGradientVector&&this[X]()),this[g];}},{key:K,value:function value(N,$){var S=N.positions,P=N.position0;for(var w=0;w<S.length;w++){var _P$w2=_slicedToArray(P[w],2),j=_P$w2[0],H=_P$w2[1],Y=S[w];Y[0]=j*$[0]+H*$[2]+$[4],Y[1]=j*$[1]+H*$[3]+$[5];}this._updateMatrix=!1;}},{key:X,value:function value(){var N=this[L],$=_toConsumableArray(this._radialGradientVector);if($){var _$=_slicedToArray($,5),S=_$[0],P=_$[1],w=_$[3],j=_$[4];$[0]=S*N[0]+P*N[2]+N[4],$[1]=S*N[1]+P*N[3]+N[5],$[3]=w*N[0]+j*N[2]+N[4],$[4]=w*N[1]+j*N[3]+N[5],this[I].u_radialGradientVector=$;}}},{key:G,value:function value(N,$){function S(k,rt){return k==null&&rt==null?!0:k==null||rt==null?!1:k[0]===rt[0]&&k[1]===rt[1]&&k[2]===rt[2]&&k[3]===rt[3];}var P=this[I].u_texSampler;if(!P)return;var _P$_img=P._img,w=_P$_img.width,j=_P$_img.height,H=$.srcRect;var Y=$.rect||[0,0];if($.rotated&&(Y=[-Y[1],Y[0],Y[3],Y[2]]),Y[2]==null&&(Y[2]=H?H[2]:w),Y[3]==null&&(Y[3]=H?H[3]:j),$.hidden)N.textureCoord=N.positions.map(function(){return[-1,-1,-1];});else if(!N.textureCoord||!S(this[C].rect,$.rect)||this[C].hidden!==$.hidden||this[C].rotated!==$.rotated){var k=null;$.rotated&&(k=e.mat2d.rotate(Array.of(0,0,0,0,0,0),e.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),k=e.mat2d.translate(Array.of(0,0,0,0,0,0),k,[0,-Y[2]])),N.textureCoord=N.position0.map(function(_ref70){var _ref71=_slicedToArray(_ref70,3),rt=_ref71[0],it=_ref71[1],lt=_ref71[2];if(1/lt>0){if($.rotated){var at=rt*k[0]+it*k[2]+k[4],ot=rt*k[1]+it*k[3]+k[5];rt=at;it=ot;}var ut=F([rt,it],[Y[0]/Y[2],Y[1]/Y[3],Y[2],Y[3]],$);return $.repeat&&(ut[2]=1),ut;}return[-1,-1,-1];});}if(H){var _k2=[H[0]/w,H[1]/j,H[2]/w,H[3]/j];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_k2);});}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,P=U(this.contours.path,2*N,S);this[g]=null,this[O]=P;}}},{key:"canIgnore",value:function canIgnore(){var N=this[A]==null||this[A].lineWidth===0||this[b][3]===0,$=this[R]==null||this[E][3]===0,S=this[I].u_radialGradientVector==null,P=this[I].u_texSampler==null;return this[Q]===0||this[et]==null&&N&&$&&S&&P&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
40
+ // cap: 'butt' or 'square'
41
+ // lineDash: null
42
+ // lineDashOffset: 0
43
+ },{key:"setStroke",value:function setStroke(){var _ref72=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref72$thickness=_ref72.thickness,N=_ref72$thickness===void 0?1:_ref72$thickness,_ref72$cap=_ref72.cap,$=_ref72$cap===void 0?"butt":_ref72$cap,_ref72$join=_ref72.join,S=_ref72$join===void 0?"miter":_ref72$join,_ref72$miterLimit=_ref72.miterLimit,P=_ref72$miterLimit===void 0?10:_ref72$miterLimit,_ref72$color=_ref72.color,w=_ref72$color===void 0?[0,0,0,0]:_ref72$color,_ref72$lineDash=_ref72.lineDash,j=_ref72$lineDash===void 0?null:_ref72$lineDash,_ref72$lineDashOffset=_ref72.lineDashOffset,H=_ref72$lineDashOffset===void 0?0:_ref72$lineDashOffset,_ref72$roundSegments=_ref72.roundSegments,Y=_ref72$roundSegments===void 0?20:_ref72$roundSegments;return this[g]=null,this[A]=new a["default"]({lineWidth:N,lineCap:$,lineJoin:S,miterLimit:P,roundSegments:Y}),typeof w=="string"&&(w=Object(m["default"])(w)),this[b]=w,this[A].lineDash=j,this[A].lineDashOffset=H,this;}},{key:"setFill",value:function setFill(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$rule=_ref73.rule,N=_ref73$rule===void 0?this.fillRule:_ref73$rule,_ref73$color=_ref73.color,$=_ref73$color===void 0?[0,0,0,0]:_ref73$color;return this[g]=null,this[R]={rule:N},typeof $=="string"&&($=Object(m["default"])($)),this[E]=$,this;}/**
44
+ options: {
45
+ scale: false,
46
+ repeat: false,
47
+ rotated: false,
48
+ rect: [10, 10],
49
+ srcRect: [...],
50
+ hidden: false,
51
+ }
52
+ */},{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,P=_N.rect;if(N=S,$.rect)for(var w=0;w<$.rect.length;w++)P[w]=$.rect[w];$.rect=P;}return this[R]||this.setFill(),this.setUniforms({u_texSampler:N}),this[g]&&this[G](this[g],$),this[C]=$,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref74.vector,$=_ref74.colors,_ref74$type=_ref74.type,S=_ref74$type===void 0?"fill":_ref74$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setLinearGradient",value:function setLinearGradient(){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!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setRadialGradient",value:function setRadialGradient(){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!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:$,type:S});}/**
53
+ vector: [x0, y0, r0, x1, y1, r1],
54
+ colors: [{offset:0, color}, {offset:1, color}, ...],
55
+ */},{key:"setGradient",value:function setGradient(){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;$=$.map(function(_ref78){var j=_ref78.offset,H=_ref78.color;return typeof H=="string"&&(H=Object(m["default"])(H)),{offset:j,color:H};}),this[B]=this[B]||{},this[B][S]={vector:N,colors:$},$.sort(function(j,H){return j.offset-H.offset;});var P=[];$.forEach(function(_ref79){var j=_ref79.offset,H=_ref79.color;P.push.apply(P,[j].concat(_toConsumableArray(H)));});var w;if(N.length===4?w=[N[0],N[1],0,N[2],N[3],0]:w=_toConsumableArray(N),P.length<40&&P.push(-1),P.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=w,this[I].u_colorSteps=P,S==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[X](),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[D],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[D],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 _ref80=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref81=_slicedToArray(_ref80,2),$=_ref81[0],S=_ref81[1];var P=e.mat2d.create();return P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[$,S]),P=e.mat2d.rotate(Array.of(0,0,0,0,0,0),P,N),P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[-$,-S]),this.transform.apply(this,_toConsumableArray(P));}},{key:"scale",value:function scale(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref82=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref83=_slicedToArray(_ref82,2),S=_ref83[0],P=_ref83[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,P]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[N,$]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"skew",value:function skew(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref84=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref85=_slicedToArray(_ref84,2),S=_ref85[0],P=_ref85[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,P]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan($),Math.tan(N),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[z].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
56
+ },{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(c.multiply)($,N):$=N,this.setColorTransform.apply(this,_toConsumableArray($)),this;}},{key:"blur",value:function blur(N){return this[z].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(P)&&(P=Object(s["default"])(P)),this[z].push("drop-shadow(".concat(N,"px ").concat($,"px ").concat(S,"px ").concat(P,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
57
+ },{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[z].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(c.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[z].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.sepia)(N)));}},{key:"url",value:function url(N){return this[z].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var P=this.meshData,w=P.positions,j=P.cells,H=this.invertMatrix,Y=H[0]*N+H[2]*$+H[4],k=H[1]*N+H[3]*$+H[5],rt=this.boundingBox;if(Y<rt[0][0]||Y>rt[1][0]||k<rt[0][1]||k>rt[1][1])return!1;function it(_ref86,_ref87,_ref88){var _ref89=_slicedToArray(_ref86,2),lt=_ref89[0],ut=_ref89[1];var _ref90=_slicedToArray(_ref87,2),at=_ref90[0],ot=_ref90[1];var _ref91=_slicedToArray(_ref88,2),ct=_ref91[0],vt=_ref91[1];var mt=ct-at,pt=vt-ot,St=((lt-at)*mt+(ut-ot)*pt)/(Math.pow(mt,2)+Math.pow(pt,2));return St>=0&&St<=1;}for(var lt=0;lt<j.length;lt++){var ut=j[lt];if(S==="fill"&&ut[0]>=P.fillPointCount)break;if(S==="stroke"&&ut[0]<P.fillPointCount)continue;var _ut$map=ut.map(function(Et){return w[Et];}),_ut$map2=_slicedToArray(_ut$map,3),_ut$map2$=_slicedToArray(_ut$map2[0],2),at=_ut$map2$[0],ot=_ut$map2$[1],_ut$map2$2=_slicedToArray(_ut$map2[1],2),ct=_ut$map2$2[0],vt=_ut$map2$2[1],_ut$map2$3=_slicedToArray(_ut$map2[2],2),mt=_ut$map2$3[0],pt=_ut$map2$3[1],St=Math.sign((N-at)*(vt-ot)-(ct-at)*($-ot));if(St===0&&it([N,$],[at,ot],[ct,vt]))return!0;var Rt=Math.sign((N-ct)*(pt-vt)-(mt-ct)*($-vt));if(Rt===0&&it([N,$],[ct,vt],[mt,pt]))return!0;var Pt=Math.sign((N-mt)*(ot-pt)-(at-mt)*($-pt));if(Pt===0&&it([N,$],[mt,pt],[at,ot])||St===1&&Rt===1&&Pt===1||St===-1&&Rt===-1&&Pt===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(N,$){return this.isPointCollision(N,$,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(N,$){return this.isPointCollision(N,$,"stroke");}},{key:"addPass",value:function addPass(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var S=$.width,P=$.height,w=d($,["width","height"]);var j=new x["default"]();j.rect(0,0,S,P);var H=new V(j,{width:S,height:P});H.setUniforms(w),H.setProgram(N),this[st].push(H);}}]);}();},/* 57 */ /***/function(f,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e.Stroke;},/* 58 */ /***/function(f,r,t){t.r(r),t.d(r,"Stroke",function(){return p;});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)(),c=1e20;var p=/*#__PURE__*/function(){function p(){var _ref92=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref92$lineWidth=_ref92.lineWidth,T=_ref92$lineWidth===void 0?1:_ref92$lineWidth,_ref92$lineJoin=_ref92.lineJoin,m=_ref92$lineJoin===void 0?"miter":_ref92$lineJoin,_ref92$miterLimit=_ref92.miterLimit,x=_ref92$miterLimit===void 0?10:_ref92$miterLimit,_ref92$lineCap=_ref92.lineCap,l=_ref92$lineCap===void 0?"butt":_ref92$lineCap,_ref92$roundSegments=_ref92.roundSegments,d=_ref92$roundSegments===void 0?20:_ref92$roundSegments;_classCallCheck(this,p);this.lineWidth=T,this.lineJoin=m,this.miterLimit=x,this.lineCap=l,this.roundSegments=d,this._normal=null;}return _createClass(p,[{key:"build",value:function build(T){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var x=T.length;if(T=_toConsumableArray(T),x<2)return T;m&&((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 l={left:[],right:[]},d=this.lineWidth/2,u=this.lineCap;if(!m&&u==="square"){Object(e.direction)(i,T[0],T[1]),Object(e.scaleAndAdd)(T[0],T[0],i,d);var O=T.length-1;Object(e.direction)(i,T[O],T[O-1]),Object(e.scaleAndAdd)(T[O],T[O],i,d);}for(var _O4=1;_O4<x;_O4++){var A=T[_O4-1],R=T[_O4],b=T[_O4+1];this._seg(l,A,R,b,d,m);}return!m&&u==="round"&&y(l,this.roundSegments),[].concat(_toConsumableArray(l.left),_toConsumableArray(l.right.reverse()));}},{key:"_seg",value:function _seg(T,m,x,l,d,u){var g=this.lineJoin==="bevel",O=this.lineJoin==="round";if(Object(e.direction)(i,x,m),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),T.left.length||v(T,m,this._normal,d),!l)Object(e.normal)(this._normal,i),u?v(T,m,this._normal,d):v(T,x,this._normal,d);else{Object(e.direction)(a,l,x);var A=Object(e.computeMiter)(o,s,i,a,d);A=Math.min(A,c);var R=Object(e.dot)(o,this._normal)<0?-1:1;var b=g||O;if(!b&&this.lineJoin==="miter"&&A/d>this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,x,this._normal,-d*R),h(T,n,R);var E=1/0;m&&(E=Math.min(E,Math.hypot(x[0]-m[0],x[1]-m[1]))),l&&(E=Math.min(E,Math.hypot(l[0]-x[0],l[1]-x[1])));var L=Math.max(d,Math.min(A,E));if(Object(e.scaleAndAdd)(n,x,s,L*R),h(T,n,-R),l)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,x,n,-d*R),O){var D=Object(e.clone)(n),I=R>0?T.left[T.left.length-1]:T.right[T.right.length-1],C=Object(e.clone)(x),W=Object(e.sub)(Object(e.create)(),I,C),G=Object(e.sub)(Object(e.create)(),D,C),K=Math.PI/this.roundSegments;for(var X=0;X<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],R*K),Math.sign(Object(e.cross)(n,W,G)[2])===R);X++)Object(e.add)(n,W,C),h(T,n,R);h(T,D,R);}else h(T,n,R);}else v(T,x,s,A),Object(e.copy)(this._normal,s);}}}]);}();function h(M,T,m){m>0?M.left.push(Object(e.clone)(T)):M.right.push(Object(e.clone)(T));}function v(M,T,m,x){var l=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,T,m,-x),h(M,n,-l),Object(e.scaleAndAdd)(n,T,m,x),h(M,n,l);}function y(_ref93,m){var M=_ref93.left,T=_ref93.right;var x=Object(e.create)(),l=Object(e.create)();var d=M[0],u=T[0],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])];Object(e.sub)(l,d,g);for(var O=1;O<=m;O++){var A=-1*Math.PI*O/m;Object(e.rotate)(x,l,[0,0],A),Object(e.add)(n,g,x),M.unshift(Object(e.clone)(n));}d=T[T.length-1],u=M[M.length-1],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])],Object(e.sub)(l,d,g);for(var _O5=1;_O5<=m;_O5++){var _A2=-1*Math.PI*_O5/m;Object(e.rotate)(x,l,[0,0],_A2),Object(e.add)(n,g,x),T.push(Object(e.clone)(n));}}},/* 59 */ /***/function(f,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(f,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);f.exports=function(i,a){if(a=a||{},i=i.filter(function(m){return m.length>2;}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(m){return m.reduce(function(x,l){return x.concat(l);});});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)),c=[],p=0;p<s.vertices.length;p+=a.vertexSize){var h=s.vertices.slice(p,p+a.vertexSize);c.push(h);}var v=[];for(p=0;p<s.elements.length;p+=3){var y=s.elements[p],M=s.elements[p+1],T=s.elements[p+2];v.push([y,M,T]);}return{positions:c,cells:v};};},/* 61 */ /***/function(f,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e={},n={};f.exports=e,e.WINDING_ODD=0,e.WINDING_NONZERO=1,e.WINDING_POSITIVE=2,e.WINDING_NEGATIVE=3,e.WINDING_ABS_GEQ_TWO=4,e.POLYGONS=0,e.CONNECTED_POLYGONS=1,e.BOUNDARY_CONTOURS=2,e.tesselate=function(l){for(var d=l.debug||!1,u=new x(),g=0;g<l.contours.length;g++)u.addContour(l.vertexSize||2,l.contours[g]);return u.tesselate(l.windingRule||e.WINDING_ODD,l.elementType||e.POLYGONS,l.polySize||3,l.vertexSize||2,l.normal||[0,0,1]),{vertices:u.vertices,vertexIndices:u.vertexIndices,vertexCount:u.vertexCount,elements:u.elements,elementCount:u.elementCount,mesh:d?u.mesh:void 0};};var i=function i(l){if(!l)throw"Assertion Failed!";};function a(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0;}function o(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function s(l){this.next=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Org=null,this.Lface=null,this.activeRegion=null,this.winding=0,this.side=l;}s.prototype={get Rface(){return this.Sym.Lface;},set Rface(l){this.Sym.Lface=l;},get Dst(){return this.Sym.Org;},set Dst(l){this.Sym.Org=l;},get Oprev(){return this.Sym.Lnext;},set Oprev(l){this.Sym.Lnext=l;},get Lprev(){return this.Onext.Sym;},set Lprev(l){this.Onext.Sym=l;},get Dprev(){return this.Lnext.Sym;},set Dprev(l){this.Lnext.Sym=l;},get Rprev(){return this.Sym.Onext;},set Rprev(l){this.Sym.Onext=l;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(l){this.Sym.Onext.Sym=l;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(l){this.Sym.Lnext.Sym=l;}/* 3 pointers */};function c(){var l=new a(),d=new o(),u=new s(0),g=new s(1);l.next=l.prev=l,l.anEdge=null,d.next=d.prev=d,d.anEdge=null,d.trail=null,d.marked=!1,d.inside=!1,u.next=u,u.Sym=g,u.Onext=null,u.Lnext=null,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,g.next=g,g.Sym=u,g.Onext=null,g.Lnext=null,g.Org=null,g.Lface=null,g.winding=0,g.activeRegion=null,this.vHead=l,this.fHead=d,this.eHead=u,this.eHeadSym=g;}c.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
58
+ * No vertex or face structures are allocated, but these must be assigned
59
+ * before the current edge operation is completed.
60
+ */ //static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
61
+ makeEdge_:function makeEdge_(l){var d=new s(0),u=new s(1);l.Sym.side<l.side&&(l=l.Sym);var g=l.Sym.next;return u.next=g,g.Sym.next=d,d.next=l,l.Sym.next=u,d.Sym=u,d.Onext=d,d.Lnext=u,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,u.Sym=d,u.Onext=u,u.Lnext=d,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,d;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
62
+ * CS348a notes (see mesh.h). Basically it modifies the mesh so that
63
+ * a->Onext and b->Onext are exchanged. This can have various effects
64
+ * depending on whether a and b belong to different face or vertex rings.
65
+ * For more explanation see tessMeshSplice() below.
66
+ */ // static void Splice( TESShalfEdge *a, TESShalfEdge *b )
67
+ splice_:function splice_(l,d){var u=l.Onext,g=d.Onext;u.Sym.Lnext=d,g.Sym.Lnext=l,l.Onext=g,d.Onext=u;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
68
+ * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
69
+ * a place to insert the new vertex in the global vertex list. We insert
70
+ * the new vertex *before* vNext so that algorithms which walk the vertex
71
+ * list will not see the newly created vertices.
72
+ */ //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
73
+ makeVertex_:function makeVertex_(l,d,u){var g=l;i(g!==null);var O=u.prev;g.prev=O,O.next=g,g.next=u,u.prev=g,g.anEdge=d;var A=d;do A.Org=g,A=A.Onext;while(A!==d);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
74
+ * face of all edges in the face loop to which eOrig belongs. "fNext" gives
75
+ * a place to insert the new face in the global face list. We insert
76
+ * the new face *before* fNext so that algorithms which walk the face
77
+ * list will not see the newly created faces.
78
+ */ // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
79
+ makeFace_:function makeFace_(l,d,u){var g=l;i(g!==null);var O=u.prev;g.prev=O,O.next=g,g.next=u,u.prev=g,g.anEdge=d,g.trail=null,g.marked=!1,g.inside=u.inside;var A=d;do A.Lface=g,A=A.Lnext;while(A!==d);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
80
+ * and removes from the global edge list.
81
+ */ //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
82
+ killEdge_:function killEdge_(l){l.Sym.side<l.side&&(l=l.Sym);var d=l.next,u=l.Sym.next;d.Sym.next=u,u.Sym.next=d;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
83
+ * vertex list. It updates the vertex loop to point to a given new vertex.
84
+ */ //static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
85
+ killVertex_:function killVertex_(l,d){var u=l.anEdge,g=u;do g.Org=d,g=g.Onext;while(g!==u);var O=l.prev,A=l.next;A.prev=O,O.next=A;},/* KillFace( fDel ) destroys a face and removes it from the global face
86
+ * list. It updates the face loop to point to a given new face.
87
+ */ //static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
88
+ killFace_:function killFace_(l,d){var u=l.anEdge,g=u;do g.Lface=d,g=g.Lnext;while(g!==u);var O=l.prev,A=l.next;A.prev=O,O.next=A;},/****************** Basic Edge Operations **********************/ /* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
89
+ * The loop consists of the two new half-edges.
90
+ */ //TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
91
+ makeEdge:function makeEdge(){var l=new a(),d=new a(),u=new o(),g=this.makeEdge_(this.eHead);return this.makeVertex_(l,g,this.vHead),this.makeVertex_(d,g.Sym,this.vHead),this.makeFace_(u,g,this.fHead),g;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
92
+ * mesh connectivity and topology. It changes the mesh so that
93
+ * eOrg->Onext <- OLD( eDst->Onext )
94
+ * eDst->Onext <- OLD( eOrg->Onext )
95
+ * where OLD(...) means the value before the meshSplice operation.
96
+ *
97
+ * This can have two effects on the vertex structure:
98
+ * - if eOrg->Org != eDst->Org, the two vertices are merged together
99
+ * - if eOrg->Org == eDst->Org, the origin is split into two vertices
100
+ * In both cases, eDst->Org is changed and eOrg->Org is untouched.
101
+ *
102
+ * Similarly (and independently) for the face structure,
103
+ * - if eOrg->Lface == eDst->Lface, one loop is split into two
104
+ * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
105
+ * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
106
+ *
107
+ * Some special cases:
108
+ * If eDst == eOrg, the operation has no effect.
109
+ * If eDst == eOrg->Lnext, the new face will have a single edge.
110
+ * If eDst == eOrg->Lprev, the old face will have a single edge.
111
+ * If eDst == eOrg->Onext, the new vertex will have a single edge.
112
+ * If eDst == eOrg->Oprev, the old vertex will have a single edge.
113
+ */ //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
114
+ splice:function splice(l,d){var u=!1,g=!1;if(l!==d){if(d.Org!==l.Org&&(g=!0,this.killVertex_(d.Org,l.Org)),d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(d,l),!g){var O=new a();this.makeVertex_(O,d,l.Org),l.Org.anEdge=l;}if(!u){var A=new o();this.makeFace_(A,d,l.Lface),l.Lface.anEdge=l;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
115
+ * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
116
+ * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
117
+ * the newly created loop will contain eDel->Dst. If the deletion of eDel
118
+ * would create isolated vertices, those are deleted as well.
119
+ *
120
+ * This function could be implemented as two calls to tessMeshSplice
121
+ * plus a few calls to memFree, but this would allocate and delete
122
+ * unnecessary vertices and faces.
123
+ */ //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
124
+ "delete":function _delete(l){var d=l.Sym,u=!1;if(l.Lface!==l.Rface&&(u=!0,this.killFace_(l.Lface,l.Rface)),l.Onext===l)this.killVertex_(l.Org,null);else if(l.Rface.anEdge=l.Oprev,l.Org.anEdge=l.Onext,this.splice_(l,l.Oprev),!u){var g=new o();this.makeFace_(g,l,l.Lface);}d.Onext===d?(this.killVertex_(d.Org,null),this.killFace_(d.Lface,null)):(l.Lface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),this.killEdge_(l);},/******************** Other Edge Operations **********************/ /* All these routines can be implemented with the basic edge
125
+ * operations above. They are provided for convenience and efficiency.
126
+ */ /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
127
+ * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
128
+ * eOrg and eNew will have the same left face.
129
+ */ // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
130
+ addEdgeVertex:function addEdgeVertex(l){var d=this.makeEdge_(l),u=d.Sym;this.splice_(d,l.Lnext),d.Org=l.Dst;var g=new a();return this.makeVertex_(g,u,d.Org),d.Lface=u.Lface=l.Lface,d;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
131
+ * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
132
+ * eOrg and eNew will have the same left face.
133
+ */ // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
134
+ splitEdge:function splitEdge(l,d){var u=this.addEdgeVertex(l),g=u.Sym;return this.splice_(l.Sym,l.Sym.Oprev),this.splice_(l.Sym,g),l.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=l.Rface,g.winding=l.winding,g.Sym.winding=l.Sym.winding,g;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
135
+ * to eDst->Org, and returns the corresponding half-edge eNew.
136
+ * If eOrg->Lface == eDst->Lface, this splits one loop into two,
137
+ * and the newly created loop is eNew->Lface. Otherwise, two disjoint
138
+ * loops are merged into one, and the loop eDst->Lface is destroyed.
139
+ *
140
+ * If (eOrg == eDst), the new face will have only two edges.
141
+ * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
142
+ * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
143
+ */ // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
144
+ connect:function connect(l,d){var u=!1,g=this.makeEdge_(l),O=g.Sym;if(d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(g,l.Lnext),this.splice_(O,d),g.Org=l.Dst,O.Org=d.Org,g.Lface=O.Lface=l.Lface,l.Lface.anEdge=O,!u){var A=new o();this.makeFace_(A,g,l.Lface);}return g;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
145
+ * global face list. All edges of fZap will have a NULL pointer as their
146
+ * left face. Any edges which also have a NULL pointer as their right face
147
+ * are deleted entirely (along with any isolated vertices this produces).
148
+ * An entire mesh can be deleted by zapping its faces, one at a time,
149
+ * in any order. Zapped faces cannot be used in further mesh operations!
150
+ */zapFace:function zapFace(l){var d=l.anEdge,u,g,O,A,R;g=d.Lnext;do u=g,g=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)),O=u.Sym,O.Onext===O?this.killVertex_(O.Org,null):(O.Org.anEdge=O.Onext,this.splice_(O,O.Oprev)),this.killEdge_(u));while(u!=d);A=l.prev,R=l.next,R.prev=A,A.next=R;},countFaceVerts_:function countFaceVerts_(l){var d=l.anEdge,u=0;do u++,d=d.Lnext;while(d!==l.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
151
+ mergeConvexFaces:function mergeConvexFaces(l){var d,u,g,O,A,R,b;for(d=this.fHead.next;d!==this.fHead;d=d.next)if(d.inside)for(u=d.anEdge,A=u.Org;g=u.Lnext,O=u.Sym,O&&O.Lface&&O.Lface.inside&&(R=this.countFaceVerts_(d),b=this.countFaceVerts_(O.Lface),R+b-2<=l&&n.vertCCW(u.Lprev.Org,u.Org,O.Lnext.Lnext.Org)&&n.vertCCW(O.Lprev.Org,O.Org,u.Lnext.Lnext.Org)&&(g=O.Lnext,this["delete"](O),u=null,O=null)),!(u&&u.Lnext.Org===A);)u=g;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
152
+ */check:function check(){var l=this.fHead,d=this.vHead,u=this.eHead,g,O,A,R,b,E;for(O=l,O=l;(g=O.next)!==l;O=g){i(g.prev===O),b=g.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===g),b=b.Lnext;while(b!==g.anEdge);}for(i(g.prev===O&&g.anEdge===null),R=d,R=d;(A=R.next)!==d;R=A){i(A.prev===R),b=A.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===A),b=b.Onext;while(b!==A.anEdge);}for(i(A.prev===R&&A.anEdge===null),E=u,E=u;(b=E.next)!==u;E=b)i(b.Sym.next===E.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===E.Sym&&b.Sym===this.eHeadSym&&b.Sym.Sym===b&&b.Org===null&&b.Dst===null&&b.Lface===null&&b.Rface===null);}},n.vertEq=function(l,d){return l.s===d.s&&l.t===d.t;},n.vertLeq=function(l,d){return l.s<d.s||l.s===d.s&&l.t<=d.t;},n.transLeq=function(l,d){return l.t<d.t||l.t===d.t&&l.s<=d.s;},n.edgeGoesLeft=function(l){return n.vertLeq(l.Dst,l.Org);},n.edgeGoesRight=function(l){return n.vertLeq(l.Org,l.Dst);},n.vertL1dist=function(l,d){return Math.abs(l.s-d.s)+Math.abs(l.t-d.t);},n.edgeEval=function(l,d,u){i(n.vertLeq(l,d)&&n.vertLeq(d,u));var g=d.s-l.s,O=u.s-d.s;return g+O>0?g<O?d.t-l.t+(l.t-u.t)*(g/(g+O)):d.t-u.t+(u.t-l.t)*(O/(g+O)):0;},n.edgeSign=function(l,d,u){i(n.vertLeq(l,d)&&n.vertLeq(d,u));var g=d.s-l.s,O=u.s-d.s;return g+O>0?(d.t-u.t)*g+(d.t-l.t)*O:0;},n.transEval=function(l,d,u){i(n.transLeq(l,d)&&n.transLeq(d,u));var g=d.t-l.t,O=u.t-d.t;return g+O>0?g<O?d.s-l.s+(l.s-u.s)*(g/(g+O)):d.s-u.s+(u.s-l.s)*(O/(g+O)):0;},n.transSign=function(l,d,u){i(n.transLeq(l,d)&&n.transLeq(d,u));var g=d.t-l.t,O=u.t-d.t;return g+O>0?(d.s-u.s)*g+(d.s-l.s)*O:0;},n.vertCCW=function(l,d,u){return l.s*(d.t-u.t)+d.s*(u.t-l.t)+u.s*(l.t-d.t)>=0;},n.interpolate=function(l,d,u,g){return l=l<0?0:l,u=u<0?0:u,l<=u?u===0?(d+g)/2:d+(g-d)*(l/(l+u)):g+(d-g)*(u/(l+u));},n.intersect=function(l,d,u,g,O){var A,R,b;n.vertLeq(l,d)||(b=l,l=d,d=b),n.vertLeq(u,g)||(b=u,u=g,g=b),n.vertLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.vertLeq(u,d)?n.vertLeq(d,g)?(A=n.edgeEval(l,u,d),R=n.edgeEval(u,d,g),A+R<0&&(A=-A,R=-R),O.s=n.interpolate(A,u.s,R,d.s)):(A=n.edgeSign(l,u,d),R=-n.edgeSign(l,g,d),A+R<0&&(A=-A,R=-R),O.s=n.interpolate(A,u.s,R,g.s)):O.s=(u.s+d.s)/2,n.transLeq(l,d)||(b=l,l=d,d=b),n.transLeq(u,g)||(b=u,u=g,g=b),n.transLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.transLeq(u,d)?n.transLeq(d,g)?(A=n.transEval(l,u,d),R=n.transEval(u,d,g),A+R<0&&(A=-A,R=-R),O.t=n.interpolate(A,u.t,R,d.t)):(A=n.transSign(l,u,d),R=-n.transSign(l,g,d),A+R<0&&(A=-A,R=-R),O.t=n.interpolate(A,u.t,R,g.t)):O.t=(u.t+d.t)/2;};function p(){this.key=null,this.next=null,this.prev=null;}function h(l,d){this.head=new p(),this.head.next=this.head,this.head.prev=this.head,this.frame=l,this.leq=d;}h.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(l){return this.insertBefore(this.head,l);},search:function search(l){var d=this.head;do d=d.next;while(d.key!==null&&!this.leq(this.frame,l,d.key));return d;},insertBefore:function insertBefore(l,d){do l=l.prev;while(l.key!==null&&!this.leq(this.frame,l.key,d));var u=new p();return u.key=d,u.next=l.next,l.next.prev=u,u.prev=l,l.next=u,u;},"delete":function _delete(l){l.next.prev=l.prev,l.prev.next=l.next;}};function v(){this.handle=null;}function y(){this.key=null,this.node=null;}function M(l,d){this.size=0,this.max=l,this.nodes=[],this.nodes.length=l+1;var u;for(u=0;u<this.nodes.length;u++)this.nodes[u]=new v();for(this.handles=[],this.handles.length=l+1,u=0;u<this.handles.length;u++)this.handles[u]=new y();this.initialized=!1,this.freeList=0,this.leq=d,this.nodes[1].handle=1,this.handles[1].key=null;}M.prototype={floatDown_:function floatDown_(l){var d=this.nodes,u=this.handles,g,O,A;for(g=d[l].handle;;){if(A=l<<1,A<this.size&&this.leq(u[d[A+1].handle].key,u[d[A].handle].key)&&++A,i(A<=this.max),O=d[A].handle,A>this.size||this.leq(u[g].key,u[O].key)){d[l].handle=g,u[g].node=l;break;}d[l].handle=O,u[O].node=l,l=A;}},floatUp_:function floatUp_(l){var d=this.nodes,u=this.handles,g,O,A;for(g=d[l].handle;;){if(A=l>>1,O=d[A].handle,A===0||this.leq(u[O].key,u[g].key)){d[l].handle=g,u[g].node=l;break;}d[l].handle=O,u[O].node=l,l=A;}},init:function init(){for(var l=this.size;l>=1;--l)this.floatDown_(l);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 )
153
+ insert:function insert(l){var d,u;if(d=++this.size,d*2>this.max){this.max*=2;var g,O;for(O=this.nodes.length,this.nodes.length=this.max+1,g=O;g<this.nodes.length;g++)this.nodes[g]=new v();for(O=this.handles.length,this.handles.length=this.max+1,g=O;g<this.handles.length;g++)this.handles[g]=new y();}return this.freeList===0?u=d:(u=this.freeList,this.freeList=this.handles[u].node),this.nodes[d].handle=u,this.handles[u].node=d,this.handles[u].key=l,this.initialized&&this.floatUp_(d),u;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
154
+ extractMin:function extractMin(){var l=this.nodes,d=this.handles,u=l[1].handle,g=d[u].key;return this.size>0&&(l[1].handle=l[this.size].handle,d[l[1].handle].node=1,d[u].key=null,d[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),g;},"delete":function _delete(l){var d=this.nodes,u=this.handles,g;i(l>=1&&l<=this.max&&u[l].key!==null),g=u[l].node,d[g].handle=d[this.size].handle,u[d[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(u[d[g>>1].handle].key,u[d[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),u[l].key=null,u[l].node=this.freeList,this.freeList=l;}};function T(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var m={};m.regionBelow=function(l){return l.nodeUp.prev.key;},m.regionAbove=function(l){return l.nodeUp.next.key;},m.debugEvent=function(l){},m.addWinding=function(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},m.edgeLeq=function(l,d,u){var g=l.event,R,b,O=d.eUp,A=u.eUp;if(O.Dst===g)return A.Dst===g?n.vertLeq(O.Org,A.Org)?n.edgeSign(A.Dst,O.Org,A.Org)<=0:n.edgeSign(O.Dst,A.Org,O.Org)>=0:n.edgeSign(A.Dst,g,A.Org)<=0;if(A.Dst===g)return n.edgeSign(O.Dst,g,O.Org)>=0;var R=n.edgeEval(O.Dst,g,O.Org),b=n.edgeEval(A.Dst,g,A.Org);return R>=b;},m.deleteRegion=function(l,d){d.fixUpperEdge&&i(d.eUp.winding===0),d.eUp.activeRegion=null,l.dict["delete"](d.nodeUp);},m.fixUpperEdge=function(l,d,u){i(d.fixUpperEdge),l.mesh["delete"](d.eUp),d.fixUpperEdge=!1,d.eUp=u,u.activeRegion=d;},m.topLeftRegion=function(l,d){var u=d.eUp.Org,g;do d=m.regionAbove(d);while(d.eUp.Org===u);if(d.fixUpperEdge){if(g=l.mesh.connect(m.regionBelow(d).eUp.Sym,d.eUp.Lnext),g===null)return null;m.fixUpperEdge(l,d,g),d=m.regionAbove(d);}return d;},m.topRightRegion=function(l){var d=l.eUp.Dst;do l=m.regionAbove(l);while(l.eUp.Dst===d);return l;},m.addRegionBelow=function(l,d,u){var g=new T();return g.eUp=u,g.nodeUp=l.dict.insertBefore(d.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,u.activeRegion=g,g;},m.isWindingInside=function(l,d){switch(l.windingRule){case e.WINDING_ODD:return(d&1)!==0;case e.WINDING_NONZERO:return d!==0;case e.WINDING_POSITIVE:return d>0;case e.WINDING_NEGATIVE:return d<0;case e.WINDING_ABS_GEQ_TWO:return d>=2||d<=-2;}return i(!1),!1;},m.computeWinding=function(l,d){d.windingNumber=m.regionAbove(d).windingNumber+d.eUp.winding,d.inside=m.isWindingInside(l,d.windingNumber);},m.finishRegion=function(l,d){var u=d.eUp,g=u.Lface;g.inside=d.inside,g.anEdge=u,m.deleteRegion(l,d);},m.finishLeftRegions=function(l,d,u){for(var g,R,O=null,A=d,R=d.eUp;A!==u;){if(A.fixUpperEdge=!1,O=m.regionBelow(A),g=O.eUp,g.Org!=R.Org){if(!O.fixUpperEdge){m.finishRegion(l,A);break;}g=l.mesh.connect(R.Lprev,g.Sym),m.fixUpperEdge(l,O,g);}R.Onext!==g&&(l.mesh.splice(g.Oprev,g),l.mesh.splice(R,g)),m.finishRegion(l,A),R=O.eUp,A=O;}return R;},m.addRightEdges=function(l,d,u,g,O,A){var R,b,E,L,D=!0;E=u;do i(n.vertLeq(E.Org,E.Dst)),m.addRegionBelow(l,d,E.Sym),E=E.Onext;while(E!==g);for(O===null&&(O=m.regionBelow(d).eUp.Rprev),b=d,L=O;R=m.regionBelow(b),E=R.eUp.Sym,E.Org===L.Org;)E.Onext!==L&&(l.mesh.splice(E.Oprev,E),l.mesh.splice(L.Oprev,E)),R.windingNumber=b.windingNumber-E.winding,R.inside=m.isWindingInside(l,R.windingNumber),b.dirty=!0,!D&&m.checkForRightSplice(l,b)&&(m.addWinding(E,L),m.deleteRegion(l,b),l.mesh["delete"](L)),D=!1,b=R,L=E;b.dirty=!0,i(b.windingNumber-E.winding===R.windingNumber),A&&m.walkDirtyRegions(l,b);},m.spliceMergeVertices=function(l,d,u){l.mesh.splice(d,u);},m.vertexWeights=function(l,d,u){var g=n.vertL1dist(d,l),O=n.vertL1dist(u,l),A=0.5*O/(g+O),R=0.5*g/(g+O);l.coords[0]+=A*d.coords[0]+R*u.coords[0],l.coords[1]+=A*d.coords[1]+R*u.coords[1],l.coords[2]+=A*d.coords[2]+R*u.coords[2];},m.getIntersectData=function(l,d,u,g,O,A){d.coords[0]=d.coords[1]=d.coords[2]=0,d.idx=-1,m.vertexWeights(d,u,g),m.vertexWeights(d,O,A);},m.checkForRightSplice=function(l,d){var u=m.regionBelow(d),g=d.eUp,O=u.eUp;if(n.vertLeq(g.Org,O.Org)){if(n.edgeSign(O.Dst,g.Org,O.Org)>0)return!1;n.vertEq(g.Org,O.Org)?g.Org!==O.Org&&(l.pq["delete"](g.Org.pqHandle),m.spliceMergeVertices(l,O.Oprev,g)):(l.mesh.splitEdge(O.Sym),l.mesh.splice(g,O.Oprev),d.dirty=u.dirty=!0);}else{if(n.edgeSign(g.Dst,O.Org,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),l.mesh.splice(O.Oprev,g);}return!0;},m.checkForLeftSplice=function(l,d){var u=m.regionBelow(d),g=d.eUp,O=u.eUp,A;if(i(!n.vertEq(g.Dst,O.Dst)),n.vertLeq(g.Dst,O.Dst)){if(n.edgeSign(g.Dst,O.Dst,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,A=l.mesh.splitEdge(g),l.mesh.splice(O.Sym,A),A.Lface.inside=d.inside;}else{if(n.edgeSign(O.Dst,g.Dst,O.Org)>0)return!1;d.dirty=u.dirty=!0,A=l.mesh.splitEdge(O),l.mesh.splice(g.Lnext,O.Sym),A.Rface.inside=d.inside;}return!0;},m.checkForIntersect=function(l,d){var u=m.regionBelow(d),g=d.eUp,O=u.eUp,A=g.Org,R=O.Org,b=g.Dst,E=O.Dst,L,D,I=new a(),C,W;if(i(!n.vertEq(E,b)),i(n.edgeSign(b,l.event,A)<=0),i(n.edgeSign(E,l.event,R)>=0),i(A!==l.event&&R!==l.event),i(!d.fixUpperEdge&&!u.fixUpperEdge),A===R||(L=Math.min(A.t,b.t),D=Math.max(R.t,E.t),L>D))return!1;if(n.vertLeq(A,R)){if(n.edgeSign(E,A,R)>0)return!1;}else if(n.edgeSign(b,R,A)<0)return!1;return m.debugEvent(l),n.intersect(b,A,E,R,I),i(Math.min(A.t,b.t)<=I.t),i(I.t<=Math.max(R.t,E.t)),i(Math.min(E.s,b.s)<=I.s),i(I.s<=Math.max(R.s,A.s)),n.vertLeq(I,l.event)&&(I.s=l.event.s,I.t=l.event.t),C=n.vertLeq(A,R)?A:R,n.vertLeq(C,I)&&(I.s=C.s,I.t=C.t),n.vertEq(I,A)||n.vertEq(I,R)?(m.checkForRightSplice(l,d),!1):!n.vertEq(b,l.event)&&n.edgeSign(b,l.event,I)>=0||!n.vertEq(E,l.event)&&n.edgeSign(E,l.event,I)<=0?E===l.event?(l.mesh.splitEdge(g.Sym),l.mesh.splice(O.Sym,g),d=m.topLeftRegion(l,d),g=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),u),m.addRightEdges(l,d,g.Oprev,g,g,!0),!0):b===l.event?(l.mesh.splitEdge(O.Sym),l.mesh.splice(g.Lnext,O.Oprev),u=d,d=m.topRightRegion(d),W=m.regionBelow(d).eUp.Rprev,u.eUp=O.Oprev,O=m.finishLeftRegions(l,u,null),m.addRightEdges(l,d,O.Onext,g.Rprev,W,!0),!0):(n.edgeSign(b,l.event,I)>=0&&(m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),g.Org.s=l.event.s,g.Org.t=l.event.t),n.edgeSign(E,l.event,I)<=0&&(d.dirty=u.dirty=!0,l.mesh.splitEdge(O.Sym),O.Org.s=l.event.s,O.Org.t=l.event.t),!1):(l.mesh.splitEdge(g.Sym),l.mesh.splitEdge(O.Sym),l.mesh.splice(O.Oprev,g),g.Org.s=I.s,g.Org.t=I.t,g.Org.pqHandle=l.pq.insert(g.Org),m.getIntersectData(l,g.Org,A,b,R,E),m.regionAbove(d).dirty=d.dirty=u.dirty=!0,!1);},m.walkDirtyRegions=function(l,d){for(var u=m.regionBelow(d),g,O;;){for(;u.dirty;)d=u,u=m.regionBelow(u);if(!d.dirty&&(u=d,d=m.regionAbove(d),d===null||!d.dirty))return;if(d.dirty=!1,g=d.eUp,O=u.eUp,g.Dst!==O.Dst&&m.checkForLeftSplice(l,d)&&(u.fixUpperEdge?(m.deleteRegion(l,u),l.mesh["delete"](O),u=m.regionBelow(d),O=u.eUp):d.fixUpperEdge&&(m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(u),g=d.eUp)),g.Org!==O.Org)if(g.Dst!==O.Dst&&!d.fixUpperEdge&&!u.fixUpperEdge&&(g.Dst===l.event||O.Dst===l.event)){if(m.checkForIntersect(l,d))return;}else m.checkForRightSplice(l,d);g.Org===O.Org&&g.Dst===O.Dst&&(m.addWinding(O,g),m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(u));}},m.connectRightVertex=function(l,d,u){var g,O=u.Onext,A=m.regionBelow(d),R=d.eUp,b=A.eUp,E=!1;if(R.Dst!==b.Dst&&m.checkForIntersect(l,d),n.vertEq(R.Org,l.event)&&(l.mesh.splice(O.Oprev,R),d=m.topLeftRegion(l,d),O=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),A),E=!0),n.vertEq(b.Org,l.event)&&(l.mesh.splice(u,b.Oprev),u=m.finishLeftRegions(l,A,null),E=!0),E){m.addRightEdges(l,d,u.Onext,O,O,!0);return;}n.vertLeq(b.Org,R.Org)?g=b.Oprev:g=R,g=l.mesh.connect(u.Lprev,g),m.addRightEdges(l,d,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,m.walkDirtyRegions(l,d);},m.connectLeftDegenerate=function(l,d,u){var g,O,A,R,b;if(g=d.eUp,n.vertEq(g.Org,u)){i(!1/*TOLERANCE_NONZERO*/),m.spliceMergeVertices(l,g,u.anEdge);return;}if(!n.vertEq(g.Dst,u)){l.mesh.splitEdge(g.Sym),d.fixUpperEdge&&(l.mesh["delete"](g.Onext),d.fixUpperEdge=!1),l.mesh.splice(u.anEdge,g),m.sweepEvent(l,u);return;}i(!1/*TOLERANCE_NONZERO*/),d=m.topRightRegion(d),b=m.regionBelow(d),A=b.eUp.Sym,O=R=A.Onext,b.fixUpperEdge&&(i(O!==A),m.deleteRegion(l,b),l.mesh["delete"](A),A=O.Oprev),l.mesh.splice(u.anEdge,A),n.edgeGoesLeft(O)||(O=null),m.addRightEdges(l,d,A.Onext,R,O,!0);},m.connectLeftVertex=function(l,d){var u,g,O,A,R,b,E=new T();if(E.eUp=d.anEdge.Sym,u=l.dict.search(E).key,g=m.regionBelow(u),!!g){if(A=u.eUp,R=g.eUp,n.edgeSign(A.Dst,d,A.Org)===0){m.connectLeftDegenerate(l,u,d);return;}if(O=n.vertLeq(R.Dst,A.Dst)?u:g,u.inside||O.fixUpperEdge){if(O===u)b=l.mesh.connect(d.anEdge.Sym,A.Lnext);else{var L=l.mesh.connect(R.Dnext,d.anEdge);b=L.Sym;}O.fixUpperEdge?m.fixUpperEdge(l,O,b):m.computeWinding(l,m.addRegionBelow(l,u,b)),m.sweepEvent(l,d);}else m.addRightEdges(l,u,d.anEdge,d.anEdge,null,!0);}},m.sweepEvent=function(l,d){l.event=d,m.debugEvent(l);for(var u=d.anEdge;u.activeRegion===null;)if(u=u.Onext,u===d.anEdge){m.connectLeftVertex(l,d);return;}var g=m.topLeftRegion(l,u.activeRegion);i(g!==null);var O=m.regionBelow(g),A=O.eUp,R=m.finishLeftRegions(l,O,null);R.Onext===A?m.connectRightVertex(l,g,R):m.addRightEdges(l,g,R.Onext,A,A,!0);},m.addSentinel=function(l,d,u,g){var O=new T(),A=l.mesh.makeEdge();A.Org.s=u,A.Org.t=g,A.Dst.s=d,A.Dst.t=g,l.event=A.Dst,O.eUp=A,O.windingNumber=0,O.inside=!1,O.fixUpperEdge=!1,O.sentinel=!0,O.dirty=!1,O.nodeUp=l.dict.insert(O);},m.initEdgeDict=function(l){l.dict=new h(l,m.edgeLeq);var d=l.bmax[0]-l.bmin[0],u=l.bmax[1]-l.bmin[1],g=l.bmin[0]-d,O=l.bmax[0]+d,A=l.bmin[1]-u,R=l.bmax[1]+u;m.addSentinel(l,g,O,A),m.addSentinel(l,g,O,R);},m.doneEdgeDict=function(l){for(var d,u=0;(d=l.dict.min().key)!==null;)d.sentinel||(i(d.fixUpperEdge),i(++u===1)),i(d.windingNumber===0),m.deleteRegion(l,d);},m.removeDegenerateEdges=function(l){var d,u,g,O=l.mesh.eHead;for(d=O.next;d!==O;d=u)u=d.next,g=d.Lnext,n.vertEq(d.Org,d.Dst)&&d.Lnext.Lnext!==d&&(m.spliceMergeVertices(l,g,d),l.mesh["delete"](d),d=g,g=d.Lnext),g.Lnext===d&&(g!==d&&((g===u||g===u.Sym)&&(u=u.next),l.mesh["delete"](g)),(d===u||d===u.Sym)&&(u=u.next),l.mesh["delete"](d));},m.initPriorityQ=function(l){var d,u,g,O=0;for(g=l.mesh.vHead,u=g.next;u!==g;u=u.next)O++;for(O+=8,d=l.pq=new M(O,n.vertLeq),g=l.mesh.vHead,u=g.next;u!==g;u=u.next)u.pqHandle=d.insert(u);return u!==g?!1:(d.init(),!0);},m.donePriorityQ=function(l){l.pq=null;},m.removeDegenerateFaces=function(l,d){var u,g,O;for(u=d.fHead.next;u!==d.fHead;u=g)g=u.next,O=u.anEdge,i(O.Lnext!==O),O.Lnext.Lnext===O&&(m.addWinding(O.Onext,O),l.mesh["delete"](O));return!0;},m.computeInterior=function(l){var d,u;if(m.removeDegenerateEdges(l),!m.initPriorityQ(l))return!1;for(m.initEdgeDict(l);(d=l.pq.extractMin())!==null;){for(;u=l.pq.min(),!(u===null||!n.vertEq(u,d));)u=l.pq.extractMin(),m.spliceMergeVertices(l,d.anEdge,u.anEdge);m.sweepEvent(l,d);}return l.event=l.dict.min().key.eUp.Org,m.debugEvent(l),m.doneEdgeDict(l),m.donePriorityQ(l),m.removeDegenerateFaces(l,l.mesh)?(l.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_(l,d){return l[0]*d[0]+l[1]*d[1]+l[2]*d[2];},normalize_:function normalize_(l){var d=l[0]*l[0]+l[1]*l[1]+l[2]*l[2];i(d>0),d=Math.sqrt(d),l[0]/=d,l[1]/=d,l[2]/=d;},longAxis_:function longAxis_(l){var d=0;return Math.abs(l[1])>Math.abs(l[0])&&(d=1),Math.abs(l[2])>Math.abs(l[d])&&(d=2),d;},computeNormal_:function computeNormal_(l){var d,u,g,O,A,R,b=[0,0,0],E=[0,0,0],L=[0,0,0],D=[0,0,0],I=[0,0,0],C=[null,null,null],W=[null,null,null],G=this.mesh.vHead,K;for(d=G.next,K=0;K<3;++K)O=d.coords[K],E[K]=O,W[K]=d,b[K]=O,C[K]=d;for(d=G.next;d!==G;d=d.next)for(K=0;K<3;++K)O=d.coords[K],O<E[K]&&(E[K]=O,W[K]=d),O>b[K]&&(b[K]=O,C[K]=d);if(K=0,b[1]-E[1]>b[0]-E[0]&&(K=1),b[2]-E[2]>b[K]-E[K]&&(K=2),E[K]>=b[K]){l[0]=0,l[1]=0,l[2]=1;return;}for(R=0,u=W[K],g=C[K],L[0]=u.coords[0]-g.coords[0],L[1]=u.coords[1]-g.coords[1],L[2]=u.coords[2]-g.coords[2],d=G.next;d!==G;d=d.next)D[0]=d.coords[0]-g.coords[0],D[1]=d.coords[1]-g.coords[1],D[2]=d.coords[2]-g.coords[2],I[0]=L[1]*D[2]-L[2]*D[1],I[1]=L[2]*D[0]-L[0]*D[2],I[2]=L[0]*D[1]-L[1]*D[0],A=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],A>R&&(R=A,l[0]=I[0],l[1]=I[1],l[2]=I[2]);R<=0&&(l[0]=l[1]=l[2]=0,l[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var l,d,u=this.mesh.fHead,g,O=this.mesh.vHead,A;for(l=0,d=u.next;d!==u;d=d.next)if(A=d.anEdge,!(A.winding<=0))do l+=(A.Org.s-A.Dst.s)*(A.Org.t+A.Dst.t),A=A.Lnext;while(A!==d.anEdge);if(l<0){for(g=O.next;g!==O;g=g.next)g.t=-g.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
155
+ #include <stdlib.h>
156
+ extern int RandomSweep;
157
+ #define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
158
+ #define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
159
+ #else
160
+ #if defined(SLANTED_SWEEP) */ /* The "feature merging" is not intended to be complete. There are
161
+ * special cases where edges are nearly parallel to the sweep line
162
+ * which are not implemented. The algorithm should still behave
163
+ * robustly (ie. produce a reasonable tesselation) in the presence
164
+ * of such edges, however it may miss features which could have been
165
+ * merged. We could minimize this effect by choosing the sweep line
166
+ * direction to be something unusual (ie. not parallel to one of the
167
+ * coordinate axes).
168
+ */ /* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
169
+ #define S_UNIT_Y (TESSreal)0.86052074622010633
170
+ #else
171
+ #define S_UNIT_X (TESSreal)1.0
172
+ #define S_UNIT_Y (TESSreal)0.0
173
+ #endif
174
+ #endif*/ /* Determine the polygon normal and project vertices onto the plane
175
+ * of the polygon.
176
+ */projectPolygon_:function projectPolygon_(){var l,d=this.mesh.vHead,u=[0,0,0],g,O,A,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),g=this.sUnit,O=this.tUnit,A=this.longAxis_(u),g[A]=0,g[(A+1)%3]=1,g[(A+2)%3]=0,O[A]=0,O[(A+1)%3]=0,O[(A+2)%3]=u[A]>0?1:-1,l=d.next;l!==d;l=l.next)l.s=this.dot_(l.coords,g),l.t=this.dot_(l.coords,O);for(b&&this.checkOrientation_(),R=!0,l=d.next;l!==d;l=l.next)R?(this.bmin[0]=this.bmax[0]=l.s,this.bmin[1]=this.bmax[1]=l.t,R=!1):(l.s<this.bmin[0]&&(this.bmin[0]=l.s),l.s>this.bmax[0]&&(this.bmax[0]=l.s),l.t<this.bmin[1]&&(this.bmin[1]=l.t),l.t>this.bmax[1]&&(this.bmax[1]=l.t));},addWinding_:function addWinding_(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
177
+ * (what else would it do??) The region must consist of a single
178
+ * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
179
+ * case means that any vertical line intersects the interior of the
180
+ * region in a single interval.
181
+ *
182
+ * Tessellation consists of adding interior edges (actually pairs of
183
+ * half-edges), to split the region into non-overlapping triangles.
184
+ *
185
+ * The basic idea is explained in Preparata and Shamos (which I don''t
186
+ * have handy right now), although their implementation is more
187
+ * complicated than this one. The are two edge chains, an upper chain
188
+ * and a lower chain. We process all vertices from both chains in order,
189
+ * from right to left.
190
+ *
191
+ * The algorithm ensures that the following invariant holds after each
192
+ * vertex is processed: the untessellated region consists of two
193
+ * chains, where one chain (say the upper) is a single edge, and
194
+ * the other chain is concave. The left vertex of the single edge
195
+ * is always to the left of all vertices in the concave chain.
196
+ *
197
+ * Each step consists of adding the rightmost unprocessed vertex to one
198
+ * of the two chains, and forming a fan of triangles from the rightmost
199
+ * of two chain endpoints. Determining whether we can add each triangle
200
+ * to the fan is a simple orientation test. By making the fan as large
201
+ * as possible, we restore the invariant (check it yourself).
202
+ */ // int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
203
+ tessellateMonoRegion_:function tessellateMonoRegion_(l,d){var u,g;for(u=d.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(g=u.Lprev;u.Lnext!==g;)if(n.vertLeq(u.Dst,g.Org)){for(;g.Lnext!==u&&(n.edgeGoesLeft(g.Lnext)||n.edgeSign(g.Org,g.Dst,g.Lnext.Dst)<=0);){var O=l.connect(g.Lnext,g);g=O.Sym;}g=g.Lprev;}else{for(;g.Lnext!==u&&(n.edgeGoesRight(u.Lprev)||n.edgeSign(u.Dst,u.Org,u.Lprev.Org)>=0);){var O=l.connect(u,u.Lprev);u=O.Sym;}u=u.Lnext;}for(i(g.Lnext!==u);g.Lnext.Lnext!==u;){var O=l.connect(g.Lnext,g);g=O.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
204
+ * the mesh which is marked "inside" the polygon. Each such region
205
+ * must be monotone.
206
+ */ //int tessMeshTessellateInterior( TESSmesh *mesh )
207
+ tessellateInterior_:function tessellateInterior_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)if(u=d.next,d.inside&&!this.tessellateMonoRegion_(l,d))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
208
+ * which are not marked "inside" the polygon. Since further mesh operations
209
+ * on NULL faces are not allowed, the main purpose is to clean up the
210
+ * mesh so that exterior loops are not represented in the data structure.
211
+ */ //void tessMeshDiscardExterior( TESSmesh *mesh )
212
+ discardExterior_:function discardExterior_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)u=d.next,d.inside||l.zapFace(d);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
213
+ * winding numbers on all edges so that regions marked "inside" the
214
+ * polygon have a winding number of "value", and regions outside
215
+ * have a winding number of 0.
216
+ *
217
+ * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
218
+ * separate an interior region from an exterior one.
219
+ */ // int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
220
+ setWindingNumber_:function setWindingNumber_(l,d,u){var g,O;for(g=l.eHead.next;g!==l.eHead;g=O)O=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?d:-d:u?l["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(l){return!l.Rface||!l.Rface.inside?-1:l.Rface.n;},outputPolymesh_:function outputPolymesh_(l,d,u,g){var O,A,R,b=0,E=0,L,D;for(u>3&&l.mergeConvexFaces(u),O=l.vHead.next;O!==l.vHead;O=O.next)O.n=-1;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.n=-1,!!A.inside){R=A.anEdge,L=0;do O=R.Org,O.n===-1&&(O.n=E,E++),L++,R=R.Lnext;while(R!==A.anEdge);i(L<=u),A.n=b,++b;}for(this.elementCount=b,d===e.CONNECTED_POLYGONS&&(b*=2),this.elements=[],this.elements.length=b*u,this.vertexCount=E,this.vertices=[],this.vertices.length=E*g,this.vertexIndices=[],this.vertexIndices.length=E,O=l.vHead.next;O!==l.vHead;O=O.next)if(O.n!==-1){var I=O.n*g;this.vertices[I+0]=O.coords[0],this.vertices[I+1]=O.coords[1],g>2&&(this.vertices[I+2]=O.coords[2]),this.vertexIndices[O.n]=O.idx;}var C=0;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.inside){R=A.anEdge,L=0;do O=R.Org,this.elements[C++]=O.n,L++,R=R.Lnext;while(R!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;if(d===e.CONNECTED_POLYGONS){R=A.anEdge;do this.elements[C++]=this.getNeighbourFace_(R),R=R.Lnext;while(R!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
221
+ outputContours_:function outputContours_(l,d){var u,g,O,A=0,R=0;for(this.vertexCount=0,this.elementCount=0,u=l.fHead.next;u!==l.fHead;u=u.next)if(u.inside){O=g=u.anEdge;do this.vertexCount++,g=g.Lnext;while(g!==O);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*d,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var b=0,E=0,L=0;for(A=0,u=l.fHead.next;u!==l.fHead;u=u.next)if(u.inside){R=0,O=g=u.anEdge;do this.vertices[b++]=g.Org.coords[0],this.vertices[b++]=g.Org.coords[1],d>2&&(this.vertices[b++]=g.Org.coords[2]),this.vertexIndices[E++]=g.Org.idx,R++,g=g.Lnext;while(g!==O);this.elements[L++]=A,this.elements[L++]=R,A+=R;}},addContour:function addContour(l,d){var u,g;for(this.mesh===null&&(this.mesh=new c()),l<2&&(l=2),l>3&&(l=3),u=null,g=0;g<d.length;g+=l)u===null?(u=this.mesh.makeEdge(),this.mesh.splice(u,u.Sym)):(this.mesh.splitEdge(u),u=u.Lnext),u.Org.coords[0]=d[g+0],u.Org.coords[1]=d[g+1],l>2?u.Org.coords[2]=d[g+2]:u.Org.coords[2]=0,u.Org.idx=this.vertexIndexCounter++,u.winding=1,u.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
222
+ tesselate:function tesselate(l,d,u,g,O){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,O&&(this.normal[0]=O[0],this.normal[1]=O[1],this.normal[2]=O[2]),this.windingRule=l,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),m.computeInterior(this);var A=this.mesh;return d===e.BOUNDARY_CONTOURS?this.setWindingNumber_(A,1,!0):this.tessellateInterior_(A),A.check(),d===e.BOUNDARY_CONTOURS?this.outputContours_(A,g):this.outputPolymesh_(A,d,u,g),!0;}};},/* 62 */ /***/function(f,r){f.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i<arguments.length;i++){var a=arguments[i];for(var o in a)t.call(a,o)&&(n[o]=a[o]);}return n;}},/* 63 */ /***/function(f,r,t){t.r(r),t.d(r,"createShaders",function(){return s;}),t.d(r,"applyShader",function(){return c;}),t.d(r,"createCloudShaders",function(){return h;}),t.d(r,"applyCloudShader",function(){return v;});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function s(y){y[o]=[];for(var M=0;M<16;M++){var T=[],m=!!(M&1),_x33=!!(M&2),_l11=!!(M&4),d=!!(M&8);m&&T.push("#define TEXTURE 1"),_x33&&T.push("#define FILTER 1"),_l11&&T.push("#define GRADIENT 1"),d&&T.push("#define CLIPPATH 1");var u="".concat(T.join("\n"),"\n"),g=[];m&&g.push("uniform sampler2D u_texSampler;"),d&&g.push("uniform sampler2D u_clipSampler;"),y[o][M]=[u+g.join("\n")+n["default"],u+e["default"]];}}function c(y){var _ref94=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref94$hasTexture=_ref94.hasTexture,M=_ref94$hasTexture===void 0?!1:_ref94$hasTexture,_ref94$hasFilter=_ref94.hasFilter,T=_ref94$hasFilter===void 0?!1:_ref94$hasFilter,_ref94$hasGradient=_ref94.hasGradient,m=_ref94$hasGradient===void 0?!1:_ref94$hasGradient,_ref94$hasClipPath=_ref94.hasClipPath,x=_ref94$hasClipPath===void 0?!1:_ref94$hasClipPath;var l=M|T<<1|m<<2|x<<3;var d=y[o][l];Array.isArray(d)&&(d=y.createProgram.apply(y,_toConsumableArray(d)),y[o][l]=d),y.program!==d&&y.useProgram(d,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var p=[];function h(y){for(var M=0;M<64;M++){var T=[],m=!!(M&1),_x34=!!(M&2),_l12=!!(M&4),d=!!(M&8),u=!!(M&16),g=!!(M&32);m&&T.push("#define TEXTURE 1"),_x34&&T.push("#define FILTER 1"),_l12&&T.push("#define GRADIENT 1"),d&&T.push("#define CLOUDCOLOR 1"),u&&T.push("#define CLOUDFILTER 1"),g&&T.push("#define CLIPPATH 1");var O="".concat(T.join("\n"),"\n"),A=[];if(m){A.push("uniform sampler2D u_texSampler;");for(var R=0;R<12;R++)A.push("uniform sampler2D u_texFrame".concat(R,";"));}g&&A.push("uniform sampler2D u_clipSampler;"),p[M]=[O+A.join("\n")+a["default"],O+i["default"]];}}function v(y){var _ref95=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,M=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,T=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,m=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasCloudColor=_ref95.hasCloudColor,x=_ref95$hasCloudColor===void 0?!1:_ref95$hasCloudColor,_ref95$hasCloudFilter=_ref95.hasCloudFilter,l=_ref95$hasCloudFilter===void 0?!1:_ref95$hasCloudFilter,_ref95$hasClipPath=_ref95.hasClipPath,d=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var u=M|T<<1|m<<2|x<<3|l<<4|d<<5;var g=p[u];Array.isArray(g)&&(g=y.createProgram.apply(y,_toConsumableArray(g)),p[u]=g),y.program!==g&&y.useProgram(g,{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(f,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(f,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(f,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(f,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(f,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],c=_e$hrtime2[1];return s*1e3+c*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(f,r){var t=f.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(_unused9){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused10){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(_unused11){try{return e.call(null,x,0);}catch(_unused12){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(_unused13){try{return n.call(null,x);}catch(_unused14){return n.call(this,x);}}}var c=[],p=!1,h,v=-1;function y(){!p||!h||(p=!1,h.length?c=h.concat(c):v=-1,c.length&&M());}function M(){if(!p){var x=o(y);p=!0;for(var l=c.length;l;){for(h=c,c=[];++v<l;)h&&h[v].run();v=-1,l=c.length;}h=null,p=!1,s(x);}}t.nextTick=function(x){var l=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)l[d-1]=arguments[d];c.push(new T(x,l)),c.length===1&&!p&&o(M);};function T(x,l){this.fun=x,this.array=l;}T.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function m(){}t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(x){return[];},t.binding=function(x){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(x){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(71),i=t(73),a=t(213),o=t(214),s=t(215),c=t(216);t(1).glMatrix.setMatrixArrayType(Array);function p(b,E){var L=Object.keys(b);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(b);E&&(D=D.filter(function(I){return Object.getOwnPropertyDescriptor(b,I).enumerable;})),L.push.apply(L,D);}return L;}function h(b){for(var E=1;E<arguments.length;E++){var L=arguments[E]!=null?arguments[E]:{};E%2?p(Object(L),!0).forEach(function(D){v(b,D,L[D]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(L)):p(Object(L)).forEach(function(D){Object.defineProperty(b,D,Object.getOwnPropertyDescriptor(L,D));});}return b;}function v(b,E,L){return E in b?Object.defineProperty(b,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):b[E]=L,b;}var y=Symbol["for"]("spritejs_changedAttrs"),M=Symbol["for"]("spritejs_attributes"),T=Symbol("resolution"),m=Symbol("animations"),x=Symbol("eventListeners"),l=Symbol("captureEventListeners"),d=Symbol("filters"),u=Symbol("display"),g=Symbol("program"),O=Symbol("shaderAttrs"),A=Symbol("uniforms");var R=/*#__PURE__*/function(){function R(){var E=arguments.length>0&&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,E),this[m]=/* @__PURE__ */new Set(),this[x]={},this[l]={};}return _createClass(R,[{key:"ancestors",get:function get(){var E=this.parent;var L=[];for(;E;)L.push(E),E=E.parent;return L;}},{key:"animations",get:function get(){return this[m];}},{key:"filters",get:function get(){return this[d]||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 E=this.transformMatrix,_this$attributes=this.attributes,L=_this$attributes.x,D=_this$attributes.y;return E[4]+=L,E[5]+=D,E;}},{key:"opacity",get:function get(){var E=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(E*=this.parent.opacity),E;}},{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[g];}/* 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 E=this.localMatrix;var L=this.parent;if(L){var D=L.__cacheRenderMatrix||L.renderMatrix;D&&(E=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,E));}return E;}},{key:"worldScaling",get:function get(){var E=this.renderMatrix;return[Math.hypot(E[0],E[1]),Math.hypot(E[2],E[3])];}},{key:"worldRotation",get:function get(){var E=this.renderMatrix;return Math.atan2(E[1],E[3]);}},{key:"worldPosition",get:function get(){var E=this.renderMatrix;return[E[4],E[5]];}},{key:"uniforms",get:function get(){return this[A];}/* get zOrder defined by connect method */ /* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(E){this.attributes.className=E;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(E){this.attributes.id=E;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(E){this.attributes.name=E;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(E){this.attributes.zIndex=E;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[O]||{};}},{key:"activateAnimations",value:function activateAnimations(){var E=this.layer;if(E){var L=this[m];L.forEach(function(I){I.baseTimeline=E.timeline,I.play(),I.finished.then(function(){L["delete"](I);});});var D=this.children;D&&D.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};E==="mousewheel"&&(E="wheel"),typeof D=="boolean"&&(D={capture:D});var _D8=D,I=_D8.capture,C=_D8.once,W=I?l:x;return this[W][E]=this[W][E]||[],this[W][E].push({listener:L,once:C}),this;}},{key:"animate",value:function animate(E,L){var _this21=this;var D=new i["default"](this,E,L);return this.effects&&D.applyEffects(this.effects),this.layer&&(D.baseTimeline=this.layer.timeline,D.play(),D.finished.then(function(){_this21[m]["delete"](D);})),this[m].add(D),D;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,E=new Array(_len7),_key7=0;_key7<_len7;_key7++){E[_key7]=arguments[_key7];}if(E.length===0)return this.attributes[M];if(E.length>1){var L=E[0],D=E[1];return typeof D=="function"&&(D=D(this.attr(L))),this.setAttribute(L,D),this;}return typeof E[0]=="string"?this.getAttribute(E[0]):(Object.assign(this.attributes,E[0]),this);}},{key:"cloneNode",value:function cloneNode(){var E=new this.constructor(),L=this.attributes[y];return E.attr(L),E;}},{key:"connect",value:function connect(E,L){Object.defineProperty(this,"parent",{value:E,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:L,writable:!1,configurable:!0}),E.timeline&&this.activateAnimations(),this.setResolution(E.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:E,zOrder:L}});}},{key:"contains",value:function contains(E){for(;E&&this!==E;)E=E.parent;return!!E;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[m].forEach(function(L){return L.cancel();});var E=this.children;E&&E.forEach(function(L){L.deactivateAnimations&&L.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var E=this.parent,L=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:E,zOrder:L}}),E&&E.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(E){var _this22=this;E instanceof o["default"]||(E=new o["default"](E)),E.target=this;var L=E.type;L==="mousewheel"&&(L="wheel");var D=[this];var I=this.parent;for(;E.bubbles&&I;)D.push(I),I=I.parent;for(var C=D.length-1;C>=0;C--){var W=D[C],G=W[l]&&W[l][L];if(G&&G.length&&(E.currentTarget=W,G.forEach(function(_ref96){var K=_ref96.listener,X=_ref96.once;K.call(_this22,E),X&&D.removeEventListener(K);}),delete E.currentTarget),!E.bubbles&&E.cancelBubble)break;}if(!E.cancelBubble)for(var _C4=0;_C4<D.length;_C4++){var _W=D[_C4],_G3=_W[x]&&_W[x][L];if(_G3&&_G3.length&&(E.currentTarget=_W,_G3.forEach(function(_ref97){var K=_ref97.listener,X=_ref97.once;K.call(_this22,E),X&&D.removeEventListener(K);}),delete E.currentTarget),!E.bubbles||E.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(E){var L=E.layerX,D=E.layerY;return this.isPointCollision(L,D)?(this.dispatchEvent(E),!0):!1;}},{key:"draw",value:function draw(){var _this23=this;var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var L=this.mesh;if(L){if(Object(s.applyFilters)(L,this.filters),E.push(L),this[g]){L.setProgram(this[g]);var D=this[O];D&&Object.entries(D).forEach(function(_ref98){var _ref99=_slicedToArray(_ref98,2),C=_ref99[0],W=_ref99[1];L.setAttribute(C,W);});var I=this[A];if(this[A]){var C={};Object.entries(I).forEach(function(_ref100){var _ref101=_slicedToArray(_ref100,2),W=_ref101[0],G=_ref101[1];typeof G=="function"&&(G=G(_this23,W)),C[W]=G;}),L.setUniforms(C);}}Object(c["default"])(this,L);}return E;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(E){return this.attributes[E];}},{key:"getListeners",value:function getListeners(E){var _ref102=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref102$capture=_ref102.capture,L=_ref102$capture===void 0?!1:_ref102$capture;return _toConsumableArray(this[L?l:x][E]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(E===0)return this;var L=this.parent.children,D=L.indexOf(this);return L[D+E];}},{key:"getWorldPosition",value:function getWorldPosition(E,L){var D=this.renderMatrix,I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getOffsetPosition",value:function getOffsetPosition(E,L){var D=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getResolution",value:function getResolution(){return h({},this[T]);}},{key:"isPointCollision",value:function isPointCollision(E,L){if(!this.mesh)return!1;var D=this.attributes.pointerEvents;if(D==="none"||D!=="all"&&!this.isVisible)return!1;var I="both";return D==="visibleFill"&&(I="fill"),D==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(E,L,I);}},{key:"onPropertyChange",value:function onPropertyChange(E,L,D){E!=="id"&&E!=="name"&&E!=="className"&&E!=="pointerEvents"&&E!=="passEvents"&&this.forceUpdate(),E==="filter"&&(this[d]=Object(s.parseFilterString)(L)),E==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(E,L){E==="attrs"&&this.attr(L),this.attributes[E]=L;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
223
+ },{key:"setProgram",value:function setProgram(E){this[g]=E,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(E,L){this[O]=this[O]||{},this[O][E]=L,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(E){this[A]=this[A]||{},Object.assign(this[A],E),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref103){var E=_ref103.width,L=_ref103.height;var _this$T3=this[T],D=_this$T3.width,I=_this$T3.height;(D!==E||I!==L)&&(this[T]={width:E,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:E,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(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof L=="boolean"&&(L={capture:L});var I=L.capture?l:x;return this[I][E]&&(this[I][E]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(E){this.setAttribute(E,null);}},{key:"removeEventListener",value:function removeEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof D=="boolean"&&(D={capture:D});var C=D.capture?l:x;if(this[C][E]){var W=this[C][E];if(W)for(var G=0;G<W.length;G++){var K=W[G].listener;if(K===L){this[C][E].splice(G,1);break;}}}return this;}},{key:"transition",value:function transition(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var D=this,I=Symbol("animation");L=L||"linear";var C=0;return _typeof(E)=="object"&&(C=E.delay||0,E=E.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var G=this[I];G&&G.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 G=W.timing.direction;W.timing.direction=G==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,G){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,G)),Object.entries(W).forEach(function(_ref104){var _ref105=_slicedToArray(_ref104,2),K=_ref105[0],X=_ref105[1];typeof X=="function"&&(W[K]=X(D.attr(K)));}),this[I]=D.animate([W],{duration:E*1e3,delay:C*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();v(R,"Attr",n["default"]),a["default"].registerNode(R,"node");},/* 71 */ /***/function(f,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"),c=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_attributes"),h=Symbol["for"]("spritejs_changedAttrs"),v=Symbol("subject"),y=Symbol("attr"),M=Symbol("default"),T=Symbol("alias");function m(b,_ref107){var _ref108=_slicedToArray(_ref107,2),E=_ref108[0],L=_ref108[1];var D=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(b).forEach(function(_ref109){var _ref110=_slicedToArray(_ref109,2),I=_ref110[0],C=_ref110[1];if((E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,L])),I==="matrix")D=e.mat2d.multiply(D,D,C);else if(I==="offsetTranslate")D[4]+=C[0],D[5]+=C[1];else if(I==="offsetRotate")D=e.mat2d.rotate(Array.of(0,0,0,0,0,0),D,C);else if(I==="skew"){var _C5=_slicedToArray(C,2),W=_C5[0],G=_C5[1];D=e.mat2d.multiply(D,D,e.mat2d.fromValues(1,Math.tan(G),Math.tan(W),1,0,0));}else e.mat2d[I](D,D,C);(E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-E,-L]));}),D;}var x=Symbol("transformMatrix"),l=Symbol("transforms"),d=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function O(b,E,L){var D=b[y][E];if(b[s](E,L,!1)||b[u]!==E){var C=b[l];C.has(E)&&C["delete"](E),L&&(E==="rotate"&&(L=Math.PI*L/180),E==="scale"&&(L=L.map(function(W){return Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5;})),C.set(E,L)),b[x]=null,b[v].onPropertyChange(E,L,D,b);}}function A(b){var E=b[g],L=b.offsetDistance*E.getTotalLength(),D=E.getPointAtLength(L);if(D){var I=b[l];var C=b.offsetRotate;C==="auto"?C=D.angle:C==="reverse"?C=Math.PI+D.angle:C=Math.PI*C/180,I.set("offsetRotate",C),I.set("offsetTranslate",[D.x,D.y]),b[x]=null;}}var R=/*#__PURE__*/function(){function R(E){var _this24=this;_classCallCheck(this,R);this[v]=E,this[y]={},this[x]=e.mat2d.fromValues(1,0,0,1,0,0),this[l]=/* @__PURE__ */new Map(),this[M]={},this[T]=[],Object.defineProperty(E,"transformMatrix",{get:function get(){return _this24[x]||(_this24[x]=m(_this24[l],_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
224
+ filter:"none",display:""}),this[o]("class","pos"),this[d]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(R,[{key:h,get:function get(){var _this25=this;var E={};return _toConsumableArray(this[d]).forEach(function(L){E[L]=_this25[y][L];}),E;}},{key:p,get:function get(){var E=Object.assign({},this[y]);for(var L=0;L<this[T].length;L++){var D=this[T][L];E[D]=this[D];}return E;}},{key:a,value:function value(E){Object.assign(this[M],E),Object.assign(this[y],E);}},{key:o,value:function value(){var _this$T4;(_this$T4=this[T]).push.apply(_this$T4,arguments);}},{key:s,value:function value(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[y][E],C=this[v];return L==null&&(L=this[M][E]),Object(i.compareValue)(I,L)?!1:(this[y][E]=L,this[d].has(E)&&this[d]["delete"](E),this[d].add(E),this[u]=E,D&&C.onPropertyChange(E,L,I,this),!0);}},{key:c,value:function value(E){return this[y][E];}},{key:"id",set:function set(E){this[s]("id",E);}},{key:"id",get:function get(){return this[c]("id");}},{key:"name",set:function set(E){this[s]("name",E);}},{key:"name",get:function get(){return this[c]("name");}},{key:"className",set:function set(E){this[s]("className",E);}},{key:"className",get:function get(){return this[c]("className");}},{key:"class",set:function set(E){this.className=E;}},{key:"class",get:function get(){return this.className;}},{key:"x",get:function get(){return this[c]("x");}},{key:"x",set:function set(E){this[s]("x",Object(i.toNumber)(E));}},{key:"y",get:function get(){return this[c]("y");}},{key:"y",set:function set(E){this[s]("y",Object(i.toNumber)(E));}},{key:"pos",get:function get(){return[this.x,this.y];}},{key:"pos",set:function set(E){E=Object(i.toArray)(E),Array.isArray(E)||(E=[E,E]),this.x=E[0],this.y=E[1];}},{key:"transform",get:function get(){return this[c]("transform");}},{key:"transform",set:function set(E){var L=null;if(Array.isArray(E)&&(L=E,E="matrix(".concat(E.map(i.toNumber).join(),")")),typeof E=="string")E=E.replace(/\s*,\s*/g,",");else if(E!=null)throw new TypeError("Invalid transform value.");var D=this[y].transform;if(this[s]("transform",E,!1)){var I=this[l];if(I.has("matrix")&&I["delete"]("matrix"),L)I.set("matrix",L);else if(E){var C=E.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(C){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var G=0;G<C.length;G++){var X=C[G].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(X){var _X2=_slicedToArray(X,3),Z=_X2[1],B=_X2[2];Z==="rotate"?B=Math.PI*parseFloat(B)/180:B=B.trim().split(/[\s,]+/).map(function(z){return Object(i.toNumber)(z);}),Z==="matrix"?W=e.mat2d.multiply(W,W,B):Z==="skew"?W=e.mat2d.multiply(W,W,e.mat2d.fromValues(1,Math.tan(B[1]),Math.tan(B[0]),1,0,0)):e.mat2d[Z](W,W,B),I.set("matrix",W);}}}else throw new TypeError("Invalid transform value.");}this[x]=null,this[v].onPropertyChange("transform",E,D,this);}}},{key:"transformOrigin",get:function get(){return this[c]("transformOrigin");}},{key:"transformOrigin",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),this[s]("transformOrigin",E)&&(this[x]=null);}},{key:"rotate",get:function get(){return this[c]("rotate");}},{key:"rotate",set:function set(E){O(this,"rotate",E);}},{key:"translate",get:function get(){return this[c]("translate");}},{key:"translate",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),O(this,"translate",E);}},{key:"scale",get:function get(){return this[c]("scale");}},{key:"scale",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),O(this,"scale",E);}},{key:"skew",get:function get(){return this[c]("skew");}},{key:"skew",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),O(this,"skew",E);}},{key:"opacity",get:function get(){return this[c]("opacity");}},{key:"opacity",set:function set(E){E!=null&&(E=Number(E)),this[s]("opacity",E);}},{key:"zIndex",get:function get(){return this[c]("zIndex");}},{key:"zIndex",set:function set(E){E!=null&&(E=Number(E)),this[s]("zIndex",E);}},{key:"offsetPath",get:function get(){return this[c]("offsetPath");}},{key:"offsetPath",set:function set(E){this[s]("offsetPath",E)&&(this[g].beginPath(),E!=null&&this[g].addPath(E),A(this));}},{key:"offsetDistance",get:function get(){return this[c]("offsetDistance");}},{key:"offsetDistance",set:function set(E){this[s]("offsetDistance",Object(i.toNumber)(E))&&A(this);}},{key:"offsetRotate",get:function get(){return this[c]("offsetRotate");}},{key:"offsetRotate",set:function set(E){this[s]("offsetRotate",E),A(this);}},{key:"pointerEvents",get:function get(){return this[c]("pointerEvents");}},{key:"pointerEvents",set:function set(E){if(E!=null&&E!=="none"&&E!=="visible"&&E!=="visibleFill"&&E!=="visibleStroke"&&E!=="all")throw new TypeError("Invalid pointerEvents type.");this[s]("pointerEvents",E);}},{key:"filter",get:function get(){return this[c]("filter");}},{key:"filter",set:function set(E){this[s]("filter",E);}},{key:"display",get:function get(){return this[c]("display");}},{key:"display",set:function set(E){this[s]("display",E);}/* istanbul ignore next */},{key:"offset",set:function set(E){}}],[{key:"setDefault",value:function setDefault(E){for(var _len8=arguments.length,L=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){L[_key8-1]=arguments[_key8];}return E[a].apply(E,L);}},{key:"declareAlias",value:function declareAlias(E){for(var _len9=arguments.length,L=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){L[_key9-1]=arguments[_key9];}return E[o].apply(E,L);}},{key:"setAttribute",value:function setAttribute(E){for(var _len10=arguments.length,L=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){L[_key10-1]=arguments[_key10];}return E[s].apply(E,L);}},{key:"getAttribute",value:function getAttribute(E){for(var _len11=arguments.length,L=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){L[_key11-1]=arguments[_key11];}return E[c].apply(E,L);}},{key:"getAttributes",value:function getAttributes(E){return E[p];}},{key:"getChangedAttributes",value:function getChangedAttributes(E){return E[h];}}]);}();},/* 72 */ /***/function(f,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,c){var p=s.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);p?s={size:parseFloat(p[1]),unit:p[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,h=_s3.size,v=_s3.unit;if(v==="pt")h/=0.75;else if(v==="pc")h*=16;else if(v==="in")h*=96;else if(v==="cm")h*=96/2.54;else if(v==="mm")h*=96/25.4;else if(v==="em"||v==="rem"||v==="ex"){if(!c&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var y=getComputedStyle(document.documentElement).fontSize;y?c=e(y,16):c=16;}h*=c,v==="ex"&&(h/=2);}else if(v==="q")h*=96/25.4/4;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y3=v==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;h*=_y3/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y4=window.innerWidth||document.documentElement.clientWidth,M=window.innerHeight||document.documentElement.clientHeight;v==="vmax"?h*=Math.max(_y4,M)/100:h*=Math.min(_y4,M)/100;}return h;}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 c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\s,]+/g)),Array.isArray(s)&&(c&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,c){if(Array.isArray(s)&&Array.isArray(c)){if(s.length!==c.length)return!1;for(var p=0;p<s.length;p++)if(s[p]!==c[p])return!1;return!0;}return s==null&&c==null||s===c;}},/* 73 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return v;});var e=t(74),n=t(32),i=/* @__PURE__ */t.n(n),a=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(){return s=Object.assign||function(y){for(var M=1;M<arguments.length;M++){var T=arguments[M];for(var m in T)Object.prototype.hasOwnProperty.call(T,m)&&(y[m]=T[m]);}return y;},s.apply(this,arguments);}function c(y){if(typeof y=="string"){if(y=y.trim(),/^[0-9.]+%$/.test(y))return parseFloat(y)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(y))return Object(o.sizeToPixel)(y);}return y;}function p(y,M,T,m,x){return typeof y=="string"&&(y=i()(y)),typeof M=="string"&&(M=i()(M)),e.Effects["default"](y,M,T,m,x);}function h(y,M,T,m,x){return e.Effects["default"](y,M,T,m,x);}e.Effects["default"]=function(y,M,T,m,x){return Array.isArray(y)&&Array.isArray(M)?y.map(function(l,d){return l+(T-m)/(x-m)*(M[d]-l);}):typeof y=="number"&&typeof M=="number"?y+(T-m)/(x-m)*(M-y):T-m>x-T?M:y;},e.Effects.fillColor=p,e.Effects.strokeColor=p,e.Effects.bgcolor=p,e.Effects.borderColor=p,e.Effects.text=h;var v=/*#__PURE__*/function(_e$Animator){function v(M,T,m){var _this26;_classCallCheck(this,v);var x=M.attr();Object.entries(x).forEach(function(_ref111){var _ref112=_slicedToArray(_ref111,2),l=_ref112[0],d=_ref112[1];x[l]=e.Effects[l]?d:c(d);}),T=T.map(function(l){var d=s({},l);var u={};return Object.entries(d).forEach(function(_ref113){var _ref114=_slicedToArray(_ref113,2),g=_ref114[0],O=_ref114[1];u[g]=e.Effects[g]?O:c(O);}),u;}),_this26=_callSuper(this,v,[x,T,m]),_this26.target=M,_this26.setter=function(l,d){d.attr(l);};return _this26;}_inherits(v,_e$Animator);return _createClass(v,[{key:"playState",get:function get(){return this.target.parent?_get(_getPrototypeOf(v.prototype),"playState",this):"idle";}},{key:"finished",get:function get(){var _this27=this;return _get(_getPrototypeOf(v.prototype),"finished",this).then(function(){var M=_this27;return new Promise(function(T){function m(){M.setter(M.frame,M.target);var x=M.playState;x==="finished"||x==="idle"?(Object(a.cancelAnimationFrame)(M.requestId),T()):Object(a.requestAnimationFrame)(m);}m();});});}},{key:"finish",value:function finish(){_get(_getPrototypeOf(v.prototype),"finish",this).call(this),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_get(_getPrototypeOf(v.prototype),"play",this).call(this),this.setter(this.frame,this.target);var M=this;this.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(a.requestAnimationFrame)(function T(){var m=M.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&m.layer&&m.layer.canvas&&!document.documentElement.contains(m.layer.canvas)){M.cancel();return;}var x=M.playState;M.setter(M.frame,M.target),x!=="idle"&&(x==="running"?M.requestId=Object(a.requestAnimationFrame)(T):(x==="paused"||x==="pending"&&M.timeline.currentTime<0)&&M.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(a.requestAnimationFrame)(T);}));});});}},{key:"cancel",value:function cancel(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),M?(this.setter(this.frame,this.target),_get(_getPrototypeOf(v.prototype),"cancel",this).call(this)):(_get(_getPrototypeOf(v.prototype),"cancel",this).call(this),this.setter(this.frame,this.target));}}]);}(e.Animator);},/* 74 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=p(e),i=t(187),a=p(i),o=t(188),s=t(190),c=p(s);function p(h){return h&&h.__esModule?h:{"default":h};}r.Animator=c["default"],r.Easings=o.Easings,r.Effects=a["default"],r.Timeline=n["default"];},/* 75 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=l(e),i=t(133),a=l(i),o=t(141),s=l(o),c=t(164),p=l(c),h=t(170),v=l(h),y=t(171),M=l(y),T=t(175),m=l(T),x=t(186);function l(D){return D&&D.__esModule?D:{"default":D};}var d=(0,x.createNowTime)(),u={originTime:0,playbackRate:1},g=(0,m["default"])("timeMark"),O=(0,m["default"])("playbackRate"),A=(0,m["default"])("timers"),R=(0,m["default"])("originTime"),b=(0,m["default"])("setTimer"),E=(0,m["default"])("parent"),L=function(){function D(I,C){(0,v["default"])(this,D),I instanceof D&&(C=I,I={}),I=(0,p["default"])({},u,I),C&&(this[E]=C);var W=I.nowtime||d;if(C)Object.defineProperty(this,"globalTime",{get:function get(){return C.currentTime;}});else{var G=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-G;}});}this[g]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[E]&&(this[g][0].globalEntropy=this[E].entropy),this[R]=I.originTime,this[O]=I.playbackRate,this[A]=new s["default"]();}return(0,M["default"])(D,[{key:"markTime",value:function value(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=C.time,G=W===void 0?this.currentTime:W,K=C.entropy,X=K===void 0?this.entropy:K,Z=C.playbackRate,B=Z===void 0?this.playbackRate:Z,z={globalTime:this.globalTime,localTime:G,entropy:X,playbackRate:B,globalEntropy:this.globalEntropy};this[g].push(z);}},{key:"fork",value:function value(C){return new D(C,this);}},{key:"seekGlobalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.entropy,X=G.playbackRate,Z=G.globalTime;return Z+(C-K)/Math.abs(X);}},{key:"seekLocalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.localTime,X=G.entropy,Z=G.playbackRate;return Z>0?K+(C-X):K-(C-X);}},{key:"seekTimeMark",value:function value(C){var W=this[g],G=0,K=W.length-1;if(C<=W[G].entropy)return G;if(C>=W[K].entropy)return K;for(var X=Math.floor((G+K)/2);X>G&&X<K;){if(C===W[X].entropy)return X;C<W[X].entropy?K=X:C>W[X].entropy&&(G=X),X=Math.floor((G+K)/2);}return G;}},{key:"updateTimers",value:function value(){var C=this,W=[].concat((0,a["default"])(this[A]));W.forEach(function(G){var K=(0,n["default"])(G,2),X=K[0],Z=K[1];C[b](Z.handler,Z.time,X);});}},{key:"clearTimeout",value:function(I){function C(W){return I.apply(this,arguments);}return C.toString=function(){return I.toString();},C;}(function(I){var C=this[A].get(I);C&&C.timerID!=null&&(this[E]?this[E].clearTimeout(C.timerID):clearTimeout(C.timerID)),this[A]["delete"](I);})},{key:"clearInterval",value:function value(C){return this.clearTimeout(C);}},{key:"clear",value:function value(){var C=this,W=this[A];[].concat((0,a["default"])(W.keys())).forEach(function(G){C.clearTimeout(G);});}/*
225
+ setTimeout(func, {delay: 100, isEntropy: true})
226
+ setTimeout(func, {entropy: 100})
227
+ setTimeout(func, 100})
228
+ */},{key:"setTimeout",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](C,W);}},{key:"setInterval",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},G=this,K=this[b](function X(){G[b](X,W,K),C();},W);return K;}},{key:b,value:function value(C,W){var G=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,m["default"])("timerID");W=(0,x.formatDelay)(W);var X=this[A].get(K),Z=void 0,B=null,z=void 0,Q=void 0;X?(this.clearTimeout(K),W.isEntropy?Z=(W.delay-(this.entropy-X.startEntropy))/Math.abs(this.playbackRate):Z=(W.delay-(this.currentTime-X.startTime))/this.playbackRate,z=X.startTime,Q=X.startEntropy):(Z=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),z=this.currentTime,Q=this.entropy);var et=this[E],_=et?et.setTimeout.bind(et):setTimeout,st=W.heading;return!et&&st===!1&&Z<0&&(Z=1/0),(isFinite(Z)||et)&&(Z=Math.ceil(Z),_!==setTimeout&&(Z={delay:Z,heading:st}),B=_(function(){G[A]["delete"](K),C();},Z)),this[A].set(K,{timerID:B,handler:C,time:W,startTime:z,startEntropy:Q}),K;}},{key:"parent",get:function get(){return this[E];}},{key:"lastTimeMark",get:function get(){return this[g][this[g].length-1];}},{key:"currentTime",get:function get(){var C=this.lastTimeMark,W=C.localTime,G=C.globalTime;return W+(this.globalTime-G)*this.playbackRate;},set:function set(C){var W=this,G=this.currentTime,K=C,X=this[A];this.markTime({time:C}),[].concat((0,a["default"])(X)).forEach(function(Z){var B=(0,n["default"])(Z,2),z=B[0],Q=B[1];if(X.has(z)){var et=Q.time,_=et.isEntropy,st=et.delay,q=et.heading,ht=Q.handler,dt=Q.startTime;if(_)st===0&&(ht(),W.clearTimeout(z));else{var F=dt+st;(st===0||q!==!1&&(K-G)*st<=0||G<=F&&F<=K||G>=F&&F>=K)&&(ht(),W.clearTimeout(z));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
229
+ // If current playbackRate is negative, the currentTime should go backwards
230
+ // while the entropy remain to go forwards.
231
+ // Both of the initial values is set to -originTime
232
+ },{key:"entropy",get:function get(){var C=this.lastTimeMark,W=C.entropy,G=C.globalEntropy;return W+Math.abs((this.globalEntropy-G)*this.playbackRate);},// get globalTime() {
233
+ // if(this[_parent]) {
234
+ // return this[_parent].currentTime;
235
+ // }
236
+ // return nowtime();
237
+ // }
238
+ // change entropy will NOT cause currentTime changing but may influence the pass
239
+ // and the future of the timeline. (It may change the result of seek***Time)
240
+ // While entropy is set, all the marks behind will be droped
241
+ set:function set(C){if(this.entropy>C){var W=this.seekTimeMark(C);this[g].length=W+1;}this.markTime({entropy:C}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[E]?this[E].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[O];},set:function set(C){C!==this.playbackRate&&(this.markTime({playbackRate:C}),this[O]=C,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var C=this.parent;C;){if(C.playbackRate===0)return!0;C=C.parent;}return!1;}}]),D;}();r["default"]=L;},/* 76 */ /***/function(f,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(c,p){var h=[],v=!0,y=!1,M=void 0;try{for(var T=(0,a["default"])(c),m;!(v=(m=T.next()).done)&&(h.push(m.value),!(p&&h.length===p));v=!0);}catch(x){y=!0,M=x;}finally{try{!v&&T["return"]&&T["return"]();}finally{if(y)throw M;}}return h;}return function(c,p){if(Array.isArray(c))return c;if((0,n["default"])(Object(c)))return s(c,p);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 */ /***/function(f,r,t){f.exports={"default":t(78),__esModule:!0};},/* 78 */ /***/function(f,r,t){t(79),t(125),f.exports=t(127);},/* 79 */ /***/function(f,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;s++){var c=o[s],p=e[c],h=p&&p.prototype;h&&!h[a]&&n(h,a,c),i[c]=i.Array;}},/* 80 */ /***/function(f,r,t){var e=t(81),n=t(82),i=t(83),a=t(84);f.exports=t(88)(Array,"Array",function(o,s){this._t=a(o),this._i=0,this._k=s;},function(){var o=this._t,s=this._k,c=this._i++;return!o||c>=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,c):s=="values"?n(0,o[c]):n(0,[c,o[c]]);},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries");},/* 81 */ /***/function(f,r){f.exports=function(){};},/* 82 */ /***/function(f,r){f.exports=function(t,e){return{value:e,done:!!t};};},/* 83 */ /***/function(f,r){f.exports={};},/* 84 */ /***/function(f,r,t){var e=t(85),n=t(87);f.exports=function(i){return e(n(i));};},/* 85 */ /***/function(f,r,t){var e=t(86);f.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n);};},/* 86 */ /***/function(f,r){var t={}.toString;f.exports=function(e){return t.call(e).slice(8,-1);};},/* 87 */ /***/function(f,r){f.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 */ /***/function(f,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),o=t(83),s=t(107),c=t(121),p=t(123),h=t(122)("iterator"),v=!([].keys&&"next"in[].keys()),y="@@iterator",M="keys",T="values",m=function m(){return this;};f.exports=function(x,l,d,u,g,O,A){s(d,l,u);var R=function R(B){if(!v&&B in D)return D[B];switch(B){case M:return function(){return new d(this,B);};case T:return function(){return new d(this,B);};}return function(){return new d(this,B);};},b=l+" Iterator",E=g==T,L=!1,D=x.prototype,I=D[h]||D[y]||g&&D[g],C=I||R(g),W=g?E?R("entries"):C:void 0,G=l=="Array"&&D.entries||I,K,X,Z;if(G&&(Z=p(G.call(new x())),Z!==Object.prototype&&Z.next&&(c(Z,b,!0),!e&&typeof Z[h]!="function"&&a(Z,h,m))),E&&I&&I.name!==T&&(L=!0,C=function C(){return I.call(this);}),(!e||A)&&(v||L||!D[h])&&a(D,h,C),o[l]=C,o[b]=m,g)if(K={values:E?C:R(T),keys:O?C:R(M),entries:W},A)for(X in K)X in D||i(D,X,K[X]);else n(n.P+n.F*(v||L),l,K);return K;};},/* 89 */ /***/function(f,r){f.exports=!0;},/* 90 */ /***/function(f,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),o=t(105),s="prototype",c=function c(p,h,v){var y=p&c.F,M=p&c.G,T=p&c.S,m=p&c.P,x=p&c.B,l=p&c.W,d=M?n:n[h]||(n[h]={}),u=d[s],g=M?e:T?e[h]:(e[h]||{})[s],O,A,R;M&&(v=h);for(O in v)A=!y&&g&&g[O]!==void 0,!(A&&o(d,O))&&(R=A?g[O]:v[O],d[O]=M&&typeof g[O]!="function"?v[O]:x&&A?i(R,e):l&&g[O]==R?function(b){var E=function E(L,D,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,D);}return new b(L,D,I);}return b.apply(this,arguments);};return E[s]=b[s],E;}(R):m&&typeof R=="function"?i(Function.call,R):R,m&&((d.virtual||(d.virtual={}))[O]=R,p&c.R&&u&&!u[O]&&a(u,O,R)));};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,f.exports=c;},/* 91 */ /***/function(f,r){var t=f.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(f,r){var t=f.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 */ /***/function(f,r,t){var e=t(94);f.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,c){return n.call(i,o,s,c);};}return function(){return n.apply(i,arguments);};};},/* 94 */ /***/function(f,r){f.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 */ /***/function(f,r,t){var e=t(96),n=t(104);f.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(f,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(s,c,p){if(e(s),c=i(c,!0),e(p),n)try{return a(s,c,p);}catch(_unused15){}if("get"in p||"set"in p)throw TypeError("Accessors not supported!");return"value"in p&&(s[c]=p.value),s;};},/* 97 */ /***/function(f,r,t){var e=t(98);f.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n;};},/* 98 */ /***/function(f,r){f.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 */ /***/function(f,r,t){f.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 */ /***/function(f,r,t){f.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 */ /***/function(f,r){f.exports=function(t){try{return!!t();}catch(_unused16){return!0;}};},/* 102 */ /***/function(f,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);f.exports=function(a){return i?n.createElement(a):{};};},/* 103 */ /***/function(f,r,t){var e=t(98);f.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(f,r){f.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e};};},/* 105 */ /***/function(f,r){var t={}.hasOwnProperty;f.exports=function(e,n){return t.call(e,n);};},/* 106 */ /***/function(f,r,t){f.exports=t(95);},/* 107 */ /***/function(f,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this;}),f.exports=function(o,s,c){o.prototype=e(a,{next:n(1,c)}),i(o,s+" Iterator");};},/* 108 */ /***/function(f,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),o=function o(){},s="prototype",_c2=function c(){var p=t(102)("iframe"),h=i.length,v="<",y=">",M;for(p.style.display="none",t(120).appendChild(p),p.src="javascript:",M=p.contentWindow.document,M.open(),M.write(v+"script"+y+"document.F=Object"+v+"/script"+y),M.close(),_c2=M.F;h--;)delete _c2[s][i[h]];return _c2();};f.exports=Object.create||function(h,v){var y;return h!==null?(o[s]=e(h),y=new o(),o[s]=null,y[a]=h):y=_c2(),v===void 0?y:n(y,v);};},/* 109 */ /***/function(f,r,t){var e=t(96),n=t(97),i=t(110);f.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var c=i(s),p=c.length,h=0,v;p>h;)e.f(o,v=c[h++],s[v]);return o;};},/* 110 */ /***/function(f,r,t){var e=t(111),n=t(119);f.exports=Object.keys||function(a){return e(a,n);};},/* 111 */ /***/function(f,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");f.exports=function(o,s){var c=n(o),p=0,h=[],v;for(v in c)v!=a&&e(c,v)&&h.push(v);for(;s.length>p;)e(c,v=s[p++])&&(~i(h,v)||h.push(v));return h;};},/* 112 */ /***/function(f,r,t){var e=t(84),n=t(113),i=t(115);f.exports=function(a){return function(o,s,c){var p=e(o),h=n(p.length),v=i(c,h),y;if(a&&s!=s){for(;h>v;)if(y=p[v++],y!=y)return!0;}else for(;h>v;v++)if((a||v in p)&&p[v]===s)return a||v||0;return!a&&-1;};};},/* 113 */ /***/function(f,r,t){var e=t(114),n=Math.min;f.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 */ /***/function(f,r){var t=Math.ceil,e=Math.floor;f.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 */ /***/function(f,r,t){var e=t(114),n=Math.max,i=Math.min;f.exports=function(a,o){return a=e(a),a<0?n(a+o,0):i(a,o);};},/* 116 */ /***/function(f,r,t){var e=t(117)("keys"),n=t(118);f.exports=function(i){return e[i]||(e[i]=n(i));};},/* 117 */ /***/function(f,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(f.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(f,r){var t=0,e=Math.random();f.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36));};},/* 119 */ /***/function(f,r){f.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 */ /***/function(f,r,t){var e=t(91).document;f.exports=e&&e.documentElement;},/* 121 */ /***/function(f,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");f.exports=function(a,o,s){a&&!n(a=s?a:a.prototype,i)&&e(a,i,{configurable:!0,value:o});};},/* 122 */ /***/function(f,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",o=f.exports=function(s){return e[s]||(e[s]=a&&i[s]||(a?i:n)("Symbol."+s));};o.store=e;},/* 123 */ /***/function(f,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;f.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(f,r,t){var e=t(87);f.exports=function(n){return Object(e(n));};},/* 125 */ /***/function(f,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(f,r,t){var e=t(114),n=t(87);f.exports=function(i){return function(a,o){var s=String(n(a)),c=e(o),p=s.length,h,v;return c<0||c>=p?i?"":void 0:(h=s.charCodeAt(c),h<55296||h>56319||c+1===p||(v=s.charCodeAt(c+1))<56320||v>57343?i?s.charAt(c):h:i?s.slice(c,c+2):(h-55296<<10)+(v-56320)+65536);};};},/* 127 */ /***/function(f,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);f.exports=t(92).isIterable=function(a){var o=Object(a);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(e(o));};},/* 128 */ /***/function(f,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(_unused17){}};f.exports=function(o){var s,c,p;return o===void 0?"Undefined":o===null?"Null":typeof(c=a(s=Object(o),n))=="string"?c:i?e(s):(p=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":p;};},/* 129 */ /***/function(f,r,t){f.exports={"default":t(130),__esModule:!0};},/* 130 */ /***/function(f,r,t){t(79),t(125),f.exports=t(131);},/* 131 */ /***/function(f,r,t){var e=t(97),n=t(132);f.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(f,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);f.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)];};},/* 133 */ /***/function(f,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);o<a.length;o++)s[o]=a[o];return s;}else return(0,n["default"])(a);};},/* 134 */ /***/function(f,r,t){f.exports={"default":t(135),__esModule:!0};},/* 135 */ /***/function(f,r,t){t(125),t(136),f.exports=t(92).Array.from;},/* 136 */ /***/function(f,r,t){var e=t(93),n=t(90),i=t(124),a=t(137),o=t(138),s=t(113),c=t(139),p=t(132);n(n.S+n.F*!t(140)(function(h){Array.from(h);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
242
+ from:function from(v){var y=i(v),M=typeof this=="function"?this:Array,T=arguments.length,m=T>1?arguments[1]:void 0,x=m!==void 0,l=0,d=p(y),u,g,O,A;if(x&&(m=e(m,T>2?arguments[2]:void 0,2)),d!=null&&!(M==Array&&o(d)))for(A=d.call(y),g=new M();!(O=A.next()).done;l++)c(g,l,x?a(A,m,[O.value,l],!0):O.value);else for(u=s(y.length),g=new M(u);u>l;l++)c(g,l,x?m(y[l],l):y[l]);return g.length=l,g;}});},/* 137 */ /***/function(f,r,t){var e=t(97);f.exports=function(n,i,a,o){try{return o?i(e(a)[0],a[1]):i(a);}catch(c){var s=n["return"];throw s!==void 0&&e(s.call(n)),c;}};},/* 138 */ /***/function(f,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;f.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a);};},/* 139 */ /***/function(f,r,t){var e=t(96),n=t(104);f.exports=function(i,a,o){a in i?e.f(i,a,n(0,o)):i[a]=o;};},/* 140 */ /***/function(f,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(_unused18){}f.exports=function(a,o){if(!o&&!n)return!1;var s=!1;try{var c=[7],p=c[e]();p.next=function(){return{done:s=!0};},c[e]=function(){return p;},a(c);}catch(_unused19){}return s;};},/* 141 */ /***/function(f,r,t){f.exports={"default":t(142),__esModule:!0};},/* 142 */ /***/function(f,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),f.exports=t(92).Map;},/* 143 */ /***/function(f,r){},/* 144 */ /***/function(f,r,t){var e=t(145),n=t(151),i="Map";f.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)
243
+ get:function get(o){var s=e.getEntry(n(this,i),o);return s&&s.v;},// 23.1.3.9 Map.prototype.set(key, value)
244
+ set:function set(o,s){return e.def(n(this,i),o===0?0:o,s);}},e,!0);},/* 145 */ /***/function(f,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),o=t(147),s=t(148),c=t(88),p=t(82),h=t(149),v=t(100),y=t(150).fastKey,M=t(151),T=v?"_s":"size",m=function m(x,l){var d=y(l),u;if(d!=="F")return x._i[d];for(u=x._f;u;u=u.n)if(u.k==l)return u;};f.exports={getConstructor:function getConstructor(x,l,d,u){var g=x(function(O,A){o(O,g,l,"_i"),O._t=l,O._i=n(null),O._f=void 0,O._l=void 0,O[T]=0,A!=null&&s(A,d,O[u],O);});return i(g.prototype,{// 23.1.3.1 Map.prototype.clear()
245
+ // 23.2.3.2 Set.prototype.clear()
246
+ clear:function clear(){for(var A=M(this,l),R=A._i,b=A._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete R[b.i];A._f=A._l=void 0,A[T]=0;},// 23.1.3.3 Map.prototype.delete(key)
247
+ // 23.2.3.4 Set.prototype.delete(value)
248
+ "delete":function _delete(O){var A=M(this,l),R=m(A,O);if(R){var b=R.n,E=R.p;delete A._i[R.i],R.r=!0,E&&(E.n=b),b&&(b.p=E),A._f==R&&(A._f=b),A._l==R&&(A._l=E),A[T]--;}return!!R;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
249
+ // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
250
+ forEach:function forEach(A){M(this,l);for(var R=a(A,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)
251
+ // 23.2.3.7 Set.prototype.has(value)
252
+ has:function has(A){return!!m(M(this,l),A);}}),v&&e(g.prototype,"size",{get:function get(){return M(this,l)[T];}}),g;},def:function def(x,l,d){var u=m(x,l),g,O;return u?u.v=d:(x._l=u={i:O=y(l,!0),// <- index
253
+ k:l,// <- key
254
+ v:d,// <- value
255
+ p:g=x._l,// <- previous entry
256
+ n:void 0,// <- next entry
257
+ r:!1// <- removed
258
+ },x._f||(x._f=u),g&&(g.n=u),x[T]++,O!=="F"&&(x._i[O]=u)),x;},getEntry:m,setStrong:function setStrong(x,l,d){c(x,l,function(u,g){this._t=M(u,l),this._k=g,this._l=void 0;},function(){for(var u=this,g=u._k,O=u._l;O&&O.r;)O=O.p;return!u._t||!(u._l=O=O?O.n:u._t._f)?(u._t=void 0,p(1)):g=="keys"?p(0,O.k):g=="values"?p(0,O.v):p(0,[O.k,O.v]);},d?"entries":"values",!d,!0),h(l);}};},/* 146 */ /***/function(f,r,t){var e=t(95);f.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(f,r){f.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(f,h,t){var e=t(93),n=t(137),i=t(138),a=t(97),o=t(113),s=t(132),c={},p={},h=f.exports=function(v,y,M,T,m){var x=m?function(){return v;}:s(v),l=e(M,T,y?2:1),d=0,u,g,O,A;if(typeof x!="function")throw TypeError(v+" is not iterable!");if(i(x)){for(u=o(v.length);u>d;d++)if(A=y?l(a(g=v[d])[0],g[1]):l(v[d]),A===c||A===p)return A;}else for(O=x.call(v);!(g=O.next()).done;)if(A=n(O,l,g.value,y),A===c||A===p)return A;};h.BREAK=c,h.RETURN=p;},/* 149 */ /***/function(f,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),o=t(122)("species");f.exports=function(s){var c=typeof n[s]=="function"?n[s]:e[s];a&&c&&!c[o]&&i.f(c,o,{configurable:!0,get:function get(){return this;}});};},/* 150 */ /***/function(f,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;},c=!t(101)(function(){return s(Object.preventExtensions({}));}),p=function p(T){a(T,e,{value:{i:"O"+ ++o,// object ID
259
+ w:{}// weak collections IDs
260
+ }});},h=function h(T,m){if(!n(T))return _typeof(T)=="symbol"?T:(typeof T=="string"?"S":"P")+T;if(!i(T,e)){if(!s(T))return"F";if(!m)return"E";p(T);}return T[e].i;},v=function v(T,m){if(!i(T,e)){if(!s(T))return!0;if(!m)return!1;p(T);}return T[e].w;},y=function y(T){return c&&M.NEED&&s(T)&&!i(T,e)&&p(T),T;},M=f.exports={KEY:e,NEED:!1,fastKey:h,getWeak:v,onFreeze:y};},/* 151 */ /***/function(f,r,t){var e=t(98);f.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 */ /***/function(f,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),o=t(95),s=t(146),c=t(148),p=t(147),h=t(98),v=t(121),y=t(96).f,M=t(153)(0),T=t(100);f.exports=function(m,x,l,d,u,g){var O=e[m],A=O,R=u?"set":"add",b=A&&A.prototype,E={};return!T||typeof A!="function"||!(g||b.forEach&&!a(function(){new A().entries().next();}))?(A=d.getConstructor(x,m,u,R),s(A.prototype,l),i.NEED=!0):(A=x(function(L,D){p(L,A,m,"_c"),L._c=new O(),D!=null&&c(D,u,L[R],L);}),M("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var D=L=="add"||L=="set";L in b&&!(g&&L=="clear")&&o(A.prototype,L,function(I,C){if(p(this,A,L),!D&&g&&!h(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,C);return D?this:W;});}),g||y(A.prototype,"size",{get:function get(){return this._c.size;}})),v(A,m),E[m]=A,n(n.G+n.W+n.F,E),g||d.setStrong(A,m,u),A;};},/* 153 */ /***/function(f,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),o=t(154);f.exports=function(s,c){var p=s==1,h=s==2,v=s==3,y=s==4,M=s==6,T=s==5||M,m=c||o;return function(x,l,d){for(var u=i(x),g=n(u),O=e(l,d,3),A=a(g.length),R=0,b=p?m(x,A):h?m(x,0):void 0,E,L;A>R;R++)if((T||R in g)&&(E=g[R],L=O(E,R,u),s)){if(p)b[R]=L;else if(L)switch(s){case 3:return!0;case 5:return E;case 6:return R;case 2:b.push(E);}else if(y)return!1;}return M?-1:v||y?y:b;};};},/* 154 */ /***/function(f,r,t){var e=t(155);f.exports=function(n,i){return new(e(n))(i);};},/* 155 */ /***/function(f,r,t){var e=t(98),n=t(156),i=t(122)("species");f.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(f,r,t){var e=t(86);f.exports=Array.isArray||function(i){return e(i)=="Array";};},/* 157 */ /***/function(f,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")});},/* 158 */ /***/function(f,r,t){var e=t(128),n=t(159);f.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this);};};},/* 159 */ /***/function(f,r,t){var e=t(148);f.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a;};},/* 160 */ /***/function(f,r,t){t(161)("Map");},/* 161 */ /***/function(f,r,t){var e=t(90);f.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(f,r,t){t(163)("Map");},/* 163 */ /***/function(f,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);f.exports=function(o){e(e.S,o,{from:function from(c){var p=arguments[1],h,v,y,M;return n(this),h=p!==void 0,h&&n(p),c==null?new this():(v=[],h?(y=0,M=i(p,arguments[2],2),a(c,!1,function(T){v.push(M(T,y++));})):a(c,!1,v.push,v),new this(v));}});};},/* 164 */ /***/function(f,r,t){f.exports={"default":t(165),__esModule:!0};},/* 165 */ /***/function(f,r,t){t(166),f.exports=t(92).Object.assign;},/* 166 */ /***/function(f,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 */ /***/function(f,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),o=t(124),s=t(85),c=Object.assign;f.exports=!c||t(101)(function(){var p={},h={},v=Symbol(),y="abcdefghijklmnopqrst";return p[v]=7,y.split("").forEach(function(M){h[M]=M;}),c({},p)[v]!=7||Object.keys(c({},h)).join("")!=y;})?function(h,v){for(var y=o(h),M=arguments.length,T=1,m=i.f,x=a.f;M>T;)for(var l=s(arguments[T++]),d=m?n(l).concat(m(l)):n(l),u=d.length,g=0,O;u>g;)O=d[g++],(!e||x.call(l,O))&&(y[O]=l[O]);return y;}:c;},/* 168 */ /***/function(f,r){r.f=Object.getOwnPropertySymbols;},/* 169 */ /***/function(f,r){r.f={}.propertyIsEnumerable;},/* 170 */ /***/function(f,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(f,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 c=0;c<s.length;c++){var p=s[c];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),(0,n["default"])(o,p.key,p);}}return function(o,s,c){return s&&a(o.prototype,s),c&&a(o,c),o;};}();},/* 172 */ /***/function(f,r,t){f.exports={"default":t(173),__esModule:!0};},/* 173 */ /***/function(f,r,t){t(174);var e=t(92).Object;f.exports=function(i,a,o){return e.defineProperty(i,a,o);};},/* 174 */ /***/function(f,r,t){var e=t(90);e(e.S+e.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 */ /***/function(f,r,t){f.exports={"default":t(176),__esModule:!0};},/* 176 */ /***/function(f,r,t){t(177),t(143),t(184),t(185),f.exports=t(92).Symbol;},/* 177 */ /***/function(f,r,t){var e=t(91),n=t(105),i=t(100),a=t(90),o=t(106),s=t(150).KEY,c=t(101),p=t(117),h=t(121),v=t(118),y=t(122),M=t(178),T=t(179),m=t(180),x=t(156),l=t(97),d=t(98),u=t(124),g=t(84),O=t(103),A=t(104),R=t(108),b=t(181),E=t(183),L=t(168),D=t(96),I=t(110),C=E.f,W=D.f,G=b.f,_K2=e.Symbol,X=e.JSON,Z=X&&X.stringify,B="prototype",z=y("_hidden"),Q=y("toPrimitive"),et={}.propertyIsEnumerable,_=p("symbol-registry"),st=p("symbols"),q=p("op-symbols"),ht=Object[B],dt=typeof _K2=="function"&&!!L.f,F=e.QObject,U=!F||!F[B]||!F[B].findChild,V=i&&c(function(){return R(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(at,ot,ct){var vt=C(ht,ot);vt&&delete ht[ot],W(at,ot,ct),vt&&at!==ht&&W(ht,ot,vt);}:W,J=function J(at){var ot=st[at]=R(_K2[B]);return ot._k=at,ot;},N=dt&&_typeof(_K2.iterator)=="symbol"?function(at){return _typeof(at)=="symbol";}:function(at){return at instanceof _K2;},$=function $(ot,ct,vt){return ot===ht&&$(q,ct,vt),l(ot),ct=O(ct,!0),l(vt),n(st,ct)?(vt.enumerable?(n(ot,z)&&ot[z][ct]&&(ot[z][ct]=!1),vt=R(vt,{enumerable:A(0,!1)})):(n(ot,z)||W(ot,z,A(1,{})),ot[z][ct]=!0),V(ot,ct,vt)):W(ot,ct,vt);},S=function S(ot,ct){l(ot);for(var vt=m(ct=g(ct)),mt=0,pt=vt.length,St;pt>mt;)$(ot,St=vt[mt++],ct[St]);return ot;},P=function P(ot,ct){return ct===void 0?R(ot):S(R(ot),ct);},w=function w(ot){var ct=et.call(this,ot=O(ot,!0));return this===ht&&n(st,ot)&&!n(q,ot)?!1:ct||!n(this,ot)||!n(st,ot)||n(this,z)&&this[z][ot]?ct:!0;},j=function j(ot,ct){if(ot=g(ot),ct=O(ct,!0),!(ot===ht&&n(st,ct)&&!n(q,ct))){var vt=C(ot,ct);return vt&&n(st,ct)&&!(n(ot,z)&&ot[z][ct])&&(vt.enumerable=!0),vt;}},H=function H(ot){for(var ct=G(g(ot)),vt=[],mt=0,pt;ct.length>mt;)!n(st,pt=ct[mt++])&&pt!=z&&pt!=s&&vt.push(pt);return vt;},Y=function Y(ot){for(var ct=ot===ht,vt=G(ct?q:g(ot)),mt=[],pt=0,St;vt.length>pt;)n(st,St=vt[pt++])&&(!ct||n(ht,St))&&mt.push(st[St]);return mt;};dt||(_K2=function K(){if(this instanceof _K2)throw TypeError("Symbol is not a constructor!");var ot=v(arguments.length>0?arguments[0]:void 0),ct=function ct(vt){this===ht&&ct.call(q,vt),n(this,z)&&n(this[z],ot)&&(this[z][ot]=!1),V(this,ot,A(1,vt));};return i&&U&&V(ht,ot,{configurable:!0,set:ct}),J(ot);},o(_K2[B],"toString",function(){return this._k;}),E.f=j,D.f=$,t(182).f=b.f=H,t(169).f=w,L.f=Y,i&&!t(89)&&o(ht,"propertyIsEnumerable",w,!0),M.f=function(at){return J(y(at));}),a(a.G+a.W+a.F*!dt,{Symbol:_K2});for(var k=// 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
261
+ "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;k.length>rt;)y(k[rt++]);for(var it=I(y.store),lt=0;it.length>lt;)T(it[lt++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)
262
+ "for":function _for(at){return n(_,at+="")?_[at]:_[at]=_K2(at);},// 19.4.2.5 Symbol.keyFor(sym)
263
+ keyFor:function keyFor(ot){if(!N(ot))throw TypeError(ot+" is not a symbol!");for(var ct in _)if(_[ct]===ot)return ct;},useSetter:function useSetter(){U=!0;},useSimple:function useSimple(){U=!1;}}),a(a.S+a.F*!dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
264
+ create:P,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
265
+ defineProperty:$,// 19.1.2.3 Object.defineProperties(O, Properties)
266
+ defineProperties:S,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
267
+ getOwnPropertyDescriptor:j,// 19.1.2.7 Object.getOwnPropertyNames(O)
268
+ getOwnPropertyNames:H,// 19.1.2.8 Object.getOwnPropertySymbols(O)
269
+ getOwnPropertySymbols:Y});var ut=c(function(){L.f(1);});a(a.S+a.F*ut,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(ot){return L.f(u(ot));}}),X&&a(a.S+a.F*(!dt||c(function(){var at=_K2();return Z([at])!="[null]"||Z({a:at})!="{}"||Z(Object(at))!="{}";})),"JSON",{stringify:function stringify(ot){for(var ct=[ot],vt=1,mt,pt;arguments.length>vt;)ct.push(arguments[vt++]);if(pt=mt=ct[1],!(!d(mt)&&ot===void 0||N(ot)))return x(mt)||(mt=function mt(St,Rt){if(typeof pt=="function"&&(Rt=pt.call(this,St,Rt)),!N(Rt))return Rt;}),ct[1]=mt,Z.apply(X,ct);}}),_K2[B][Q]||t(95)(_K2[B],Q,_K2[B].valueOf),h(_K2,"Symbol"),h(Math,"Math",!0),h(e.JSON,"JSON",!0);},/* 178 */ /***/function(f,r,t){r.f=t(122);},/* 179 */ /***/function(f,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),o=t(96).f;f.exports=function(s){var c=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in c)&&o(c,s,{value:a.f(s)});};},/* 180 */ /***/function(f,r,t){var e=t(110),n=t(168),i=t(169);f.exports=function(a){var o=e(a),s=n.f;if(s)for(var c=s(a),p=i.f,h=0,v;c.length>h;)p.call(a,v=c[h++])&&o.push(v);return o;};},/* 181 */ /***/function(f,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(_unused20){return a.slice();}};f.exports.f=function(c){return a&&i.call(c)=="[object Window]"?o(c):n(e(c));};},/* 182 */ /***/function(f,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n);};},/* 183 */ /***/function(f,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),o=t(105),s=t(99),c=Object.getOwnPropertyDescriptor;r.f=t(100)?c:function(h,v){if(h=i(h),v=a(v,!0),s)try{return c(h,v);}catch(_unused21){}if(o(h,v))return n(!e.f.call(h,v),h[v]);};},/* 184 */ /***/function(f,r,t){t(179)("asyncIterator");},/* 185 */ /***/function(f,r,t){t(179)("observable");},/* 186 */ /***/function(f,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(f,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame
270
+ "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(f,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.parseEasing=r.Easings=void 0;var e=t(76),n=c(e),i=t(133),a=c(i),o=t(141),s=c(o);function c(x){return x&&x.__esModule?x:{"default":x};}var p=t(189),h=new s["default"]();function v(){for(var x=arguments.length,l=Array(x),d=0;d<x;d++)l[d]=arguments[d];var u=h.get(l);return u||(u=p.apply(void 0,l),h.set(l,u),u);}function y(x){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(d,u){for(var g=1;g<u.length;g++){var O=u[g].offset;if(d<=O){var A=u[g-1].offset,R=O,b=(d-A)/(R-A),E=1/x,L=b/E;return l==="end"?L=Math.floor(L):L=Math.ceil(L),E*L*(R-A)+A;}}return 0;};}function M(x){var l=/^cubic-bezier\((.*)\)/,d=x.match(l);if(d){var u=d[1].trim();return u=u.split(",").map(function(E){return parseFloat(E.trim());}),v.apply(void 0,(0,a["default"])(u));}if(l=/^steps\((.*)\)/,d=x.match(l),d){var g=d[1].trim();g=g.split(",").map(function(E){return E.trim();});var O=g,A=(0,n["default"])(O,2),R=A[0],b=A[1];return y(parseInt(R,10),b);}return x;}var T={linear:function linear(l){return l;},ease:v(0.25,0.1,0.25,1),"ease-in":v(0.42,0,1,1),"ease-out":v(0,0,0.58,1),"ease-in-out":v(0.42,0,0.58,1),// 'step-start': function(p, frames){
271
+ // let ret = 0
272
+ // for(let i = 0; i < frames.length; i++){
273
+ // const {offset} = frames[i]
274
+ // ret = offset
275
+ // if(p < offset){
276
+ // break
277
+ // }
278
+ // }
279
+ // return ret
280
+ // },
281
+ // 'step-end': function(p, frames){
282
+ // let ret = 0
283
+ // for(let i = 0; i < frames.length; i++){
284
+ // const {offset} = frames[i]
285
+ // if(p < offset){
286
+ // break
287
+ // }
288
+ // ret = offset
289
+ // }
290
+ // return ret
291
+ // }
292
+ "step-start":y(1,"start"),"step-end":y(1,"end")};function m(x){return typeof x=="string"?T[x]?x=T[x]:x=M(x):x.type==="cubic-bezier"?x=v.apply(void 0,(0,a["default"])(x.value)):x.type==="steps"&&(x=y(x.step,x.pos)),x;}r.Easings=T,r.parseEasing=m;},/* 189 */ /***/function(f,r){var t=4,e=1e-3,n=1e-7,i=10,a=11,o=1/(a-1),s=typeof Float32Array=="function";function c(x,l){return 1-3*l+3*x;}function p(x,l){return 3*l-6*x;}function h(x){return 3*x;}function v(x,l,d){return((c(l,d)*x+p(l,d))*x+h(l))*x;}function y(x,l,d){return 3*c(l,d)*x*x+2*p(l,d)*x+h(l);}function M(x,l,d,u,g){var O,A,R=0;do A=l+(d-l)/2,O=v(A,u,g)-x,O>0?d=A:l=A;while(Math.abs(O)>n&&++R<i);return A;}function T(x,l,d,u){for(var g=0;g<t;++g){var O=y(l,d,u);if(O===0)return l;var A=v(l,d,u)-x;l-=A/O;}return l;}function m(x){return x;}f.exports=function(l,d,u,g){if(!(0<=l&&l<=1&&0<=u&&u<=1))throw new Error("bezier x values must be in [0, 1] range");if(l===d&&u===g)return m;for(var O=s?new Float32Array(a):new Array(a),A=0;A<a;++A)O[A]=v(A*o,l,u);function R(b){for(var E=0,L=1,D=a-1;L!==D&&O[L]<=b;++L)E+=o;--L;var I=(b-O[L])/(O[L+1]-O[L]),C=E+I*o,W=y(C,l,u);return W>=e?T(b,C,l,u):W===0?C:M(b,E,E+o,l,u);}return function(E){return E===0?0:E===1?1:v(R(E),d,g);};};},/* 190 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=d(e),i=t(204),a=d(i),o=t(164),s=d(o),c=t(170),p=d(c),h=t(171),v=d(h),y=t(175),M=d(y),T=t(75),m=d(T),x=t(208),l=t(188);function d(W){return W&&W.__esModule?W:{"default":W};}var u=(0,M["default"])("timing"),g=(0,M["default"])("keyframes"),O=(0,M["default"])("initState"),A=(0,M["default"])("readyDefer"),R=(0,M["default"])("finishedDefer"),b=(0,M["default"])("effects"),E=(0,M["default"])("activeReadyTimer"),L=(0,M["default"])("activeFinishTimer"),D=(0,M["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},C=function(){function W(G,K,X){var Z=this;if((0,p["default"])(this,W),Array.isArray(G)){var B=[G[0],G,K];G=B[0],K=B[1],X=B[2];}typeof X=="number"&&(X={duration:X}),this[u]=(0,s["default"])({},I,X),this[u].easing=(0,l.parseEasing)(this[u].easing),this[g]=(0,x.calculateFramesOffset)(K);var z=this[g][this[g].length-1];this[O]={},(0,a["default"])(z).forEach(function(Q){Object.prototype.hasOwnProperty.call(G,Q)&&Q!=="easing"&&Q!=="offset"&&(Z[O][Q]=G[Q]);}),this[g]=this[g].map(function(Q){return(0,s["default"])({},Z[O],Q);}),this[g][0].offset!==0&&this[g].unshift((0,s["default"])({},this[O],{offset:0})),z.offset<1&&this[g].push((0,s["default"])({},z,{offset:1})),this[b]={},this.timeline=null;}return(0,v["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:E,value:function value(){var K=this;this[A]&&!this[A].timerID&&(this.timeline.currentTime<0?this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:-this.timeline.currentTime,heading:!1}):this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var K=this,X=this[u],Z=X.duration,B=X.iterations,z=X.endDelay,Q=Math.ceil(Z*B+z-this.timeline.currentTime)+1;this[R]&&!this[R].timerID&&(this[R].timerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](R);},{delay:Q,heading:!1}),this[R].reverseTimerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](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],X=K.delay,Z=K.playbackRate,B=K.timeline;this.timeline=new m["default"]({originTime:X,playbackRate:Z},B),this[E](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[E]());}},{key:D,value:function value(K){var X=this[K],Z=this.timeline;X&&Z&&(Z.clearTimeout(X.timerID),X.reverseTimerID&&Z.clearTimeout(X.reverseTimerID)),delete this[K];}},{key:"cancel",value:function value(){this[D](A),this[D](R),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[D](A),this[D](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,X=this[u],Z=X.iterations,B=X.duration,z=X.endDelay,Q="running";if(K==null)Q="idle";else if(K.paused)Q="paused";else if(K.currentTime<0)Q="pending";else{var et=K.currentTime-Z*B;et>0&&et<z?Q="pending":et>=z&&(Q="finished");}return Q;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var K=this[u],X=K.duration,Z=K.iterations,B=this.timeline,z=this.playState,Q=void 0;if(z==="idle")Q=0;else if(z==="paused"&&B.currentTime<0)Q=0;else if(z==="pending"){if(B.currentTime<0)Q=0;else{var et=B.seekLocalTime(Z*X);Q=(0,x.periodicity)(et,X)[1]/X;}}else(z==="running"||z==="paused")&&(Q=(0,x.periodicity)(B.currentTime,X)[1]/X);return z==="finished"&&(Q=(0,x.periodicity)(Z,1)[1]),Q;}},{key:"frame",get:function get(){var K=this.playState,X=this[O],Z=this[u].fill;if(K==="idle")return X;var B=this.timeline.currentTime,z=this[g].slice(0),Q=(0,x.getProgress)(this.timeline,this[u],this.progress),et=Q.p,_=Q.inverted,st=X;return B<0&&K==="pending"?(Z==="backwards"||Z==="both")&&(st=_?z[z.length-1]:z[0]):(K!=="pending"&&K!=="finished"||Z==="forwards"||Z==="both")&&(st=(0,x.getCurrentFrame)(this[u],z,this[b],et)),st;}},{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[A]?this[A].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[A]=(0,x.defer)(),this.timeline&&this[E](),this[A]?this[A].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"]=C;},/* 191 */ /***/function(f,r,t){f.exports={"default":t(192),__esModule:!0};},/* 192 */ /***/function(f,r,t){t(143),t(125),t(79),t(193),t(202),t(203),f.exports=t(92).Promise;},/* 193 */ /***/function(f,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),o=t(90),s=t(98),c=t(94),p=t(147),h=t(148),v=t(194),y=t(195).set,M=t(197)(),T=t(198),m=t(199),x=t(200),l=t(201),d="Promise",u=n.TypeError,g=n.process,O=g&&g.versions,A=O&&O.v8||"",_R=n[d],b=a(g)=="process",E=function E(){},L,D,I,C,W=D=T.f,G=!!function(){try{var _=_R.resolve(1),st=(_.constructor={})[t(122)("species")]=function(q){q(E,E);};return(b||typeof PromiseRejectionEvent=="function")&&_.then(E)instanceof st&&A.indexOf("6.6")!==0&&x.indexOf("Chrome/66")===-1;}catch(_unused22){}}(),K=function K(_){var st;return s(_)&&typeof(st=_.then)=="function"?st:!1;},X=function X(_,st){if(!_._n){_._n=!0;var q=_._c;M(function(){for(var ht=_._v,dt=_._s==1,F=0,U=function U(V){var J=dt?V.ok:V.fail,N=V.resolve,$=V.reject,S=V.domain,P,w,j;try{J?(dt||(_._h==2&&z(_),_._h=1),J===!0?P=ht:(S&&S.enter(),P=J(ht),S&&(S.exit(),j=!0)),P===V.promise?$(u("Promise-chain cycle")):(w=K(P))?w.call(P,N,$):N(P)):$(ht);}catch(H){S&&!j&&S.exit(),$(H);}};q.length>F;)U(q[F++]);_._c=[],_._n=!1,st&&!_._h&&Z(_);});}},Z=function Z(_){y.call(n,function(){var st=_._v,q=B(_),ht,dt,F;if(q&&(ht=m(function(){b?g.emit("unhandledRejection",st,_):(dt=n.onunhandledrejection)?dt({promise:_,reason:st}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",st);}),_._h=b||B(_)?2:1),_._a=void 0,q&&ht.e)throw ht.v;});},B=function B(_){return _._h!==1&&(_._a||_._c).length===0;},z=function z(_){y.call(n,function(){var st;b?g.emit("rejectionHandled",_):(st=n.onrejectionhandled)&&st({promise:_,reason:_._v});});},Q=function Q(_){var st=this;st._d||(st._d=!0,st=st._w||st,st._v=_,st._s=2,st._a||(st._a=st._c.slice()),X(st,!0));},et=function et(_){var st=this,q;if(!st._d){st._d=!0,st=st._w||st;try{if(st===_)throw u("Promise can't be resolved itself");(q=K(_))?M(function(){var ht={_w:st,_d:!1};try{q.call(_,i(et,ht,1),i(Q,ht,1));}catch(dt){Q.call(ht,dt);}}):(st._v=_,st._s=1,X(st,!1));}catch(ht){Q.call({_w:st,_d:!1},ht);}}};G||(_R=function R(st){p(this,_R,d,"_h"),c(st),L.call(this);try{st(i(et,this,1),i(Q,this,1));}catch(q){Q.call(this,q);}},L=function L(st){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)
293
+ then:function then(st,q){var ht=W(v(this,_R));return ht.ok=typeof st=="function"?st:!0,ht.fail=typeof q=="function"&&q,ht.domain=b?g.domain:void 0,this._c.push(ht),this._a&&this._a.push(ht),this._s&&X(this,!1),ht.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
294
+ "catch":function _catch(_){return this.then(void 0,_);}}),I=function I(){var _=new L();this.promise=_,this.resolve=i(et,_,1),this.reject=i(Q,_,1);},T.f=W=function W(_){return _===_R||_===C?new I(_):D(_);}),o(o.G+o.W+o.F*!G,{Promise:_R}),t(121)(_R,d),t(149)(d),C=t(92)[d],o(o.S+o.F*!G,d,{// 25.4.4.5 Promise.reject(r)
295
+ reject:function reject(st){var q=W(this),ht=q.reject;return ht(st),q.promise;}}),o(o.S+o.F*(e||!G),d,{// 25.4.4.6 Promise.resolve(x)
296
+ resolve:function resolve(st){return l(e&&this===C?_R:this,st);}}),o(o.S+o.F*!(G&&t(140)(function(_){_R.all(_)["catch"](E);})),d,{// 25.4.4.1 Promise.all(iterable)
297
+ all:function all(st){var q=this,ht=W(q),dt=ht.resolve,F=ht.reject,U=m(function(){var V=[],J=0,N=1;h(st,!1,function($){var S=J++,P=!1;V.push(void 0),N++,q.resolve($).then(function(w){P||(P=!0,V[S]=w,--N||dt(V));},F);}),--N||dt(V);});return U.e&&F(U.v),ht.promise;},// 25.4.4.4 Promise.race(iterable)
298
+ race:function race(st){var q=this,ht=W(q),dt=ht.reject,F=m(function(){h(st,!1,function(U){q.resolve(U).then(ht.resolve,dt);});});return F.e&&dt(F.v),ht.promise;}});},/* 194 */ /***/function(f,r,t){var e=t(97),n=t(94),i=t(122)("species");f.exports=function(a,o){var s=e(a).constructor,c;return s===void 0||(c=e(s)[i])==null?o:n(c);};},/* 195 */ /***/function(f,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,c=o.setImmediate,p=o.clearImmediate,h=o.MessageChannel,v=o.Dispatch,y=0,M={},T="onreadystatechange",m,x,l,d=function d(){var g=+this;if(M.hasOwnProperty(g)){var O=M[g];delete M[g],O();}},u=function u(g){d.call(g.data);};(!c||!p)&&(c=function c(O){for(var A=[],R=1;arguments.length>R;)A.push(arguments[R++]);return M[++y]=function(){n(typeof O=="function"?O:Function(O),A);},m(y),y;},p=function p(O){delete M[O];},t(86)(s)=="process"?m=function m(g){s.nextTick(e(d,g,1));}:v&&v.now?m=function m(g){v.now(e(d,g,1));}:h?(x=new h(),l=x.port2,x.port1.onmessage=u,m=e(l.postMessage,l,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(m=function m(g){o.postMessage(g+"","*");},o.addEventListener("message",u,!1)):T in a("script")?m=function m(g){i.appendChild(a("script"))[T]=function(){i.removeChild(this),d.call(g);};}:m=function m(g){setTimeout(e(d,g,1),0);}),f.exports={set:c,clear:p};},/* 196 */ /***/function(f,r){f.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(f,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";f.exports=function(){var c,p,h,v=function v(){var m,x;for(s&&(m=a.domain)&&m.exit();c;){x=c.fn,c=c.next;try{x();}catch(l){throw c?h():p=void 0,l;}}p=void 0,m&&m.enter();};if(s)h=function h(){a.nextTick(v);};else if(i&&!(e.navigator&&e.navigator.standalone)){var y=!0,M=document.createTextNode("");new i(v).observe(M,{characterData:!0}),h=function h(){M.data=y=!y;};}else if(o&&o.resolve){var T=o.resolve(void 0);h=function h(){T.then(v);};}else h=function h(){n.call(e,v);};return function(m){var x={fn:m,next:void 0};p&&(p.next=x),c||(c=x,h()),p=x;};};},/* 198 */ /***/function(f,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,c){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=c;}),this.resolve=e(a),this.reject=e(o);}f.exports.f=function(i){return new n(i);};},/* 199 */ /***/function(f,r){f.exports=function(t){try{return{e:!1,v:t()};}catch(e){return{e:!0,v:e};}};},/* 200 */ /***/function(f,r,t){var e=t(91),n=e.navigator;f.exports=n&&n.userAgent||"";},/* 201 */ /***/function(f,r,t){var e=t(97),n=t(98),i=t(198);f.exports=function(a,o){if(e(a),n(o)&&o.constructor===a)return o;var s=i.f(a),c=s.resolve;return c(o),s.promise;};},/* 202 */ /***/function(f,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 c=a(this,n.Promise||i.Promise),p=typeof s=="function";return this.then(p?function(h){return o(c,s()).then(function(){return h;});}:s,p?function(h){return o(c,s()).then(function(){throw h;});}:s);}});},/* 203 */ /***/function(f,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(f,r,t){f.exports={"default":t(205),__esModule:!0};},/* 205 */ /***/function(f,r,t){t(206),f.exports=t(92).Object.keys;},/* 206 */ /***/function(f,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a));};});},/* 207 */ /***/function(f,r,t){var e=t(90),n=t(92),i=t(101);f.exports=function(a,o){var s=(n.Object||{})[a]||Object[a],c={};c[a]=o(s),e(e.S+e.F*i(function(){s(1);}),"Object",c);};},/* 208 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=M(e),i=t(209),a=M(i),o=t(164),s=M(o),c=t(191),p=M(c);r.defer=T,r.periodicity=m,r.calculateFramesOffset=x,r.getProgress=l,r.getCurrentFrame=u;var h=t(188),v=t(187),y=M(v);function M(g){return g&&g.__esModule?g:{"default":g};}function T(){var g={};return g.promise=new p["default"](function(O,A){g.resolve=O,g.reject=A;}),g;}function m(g,O){var A=Math.floor(g/O),R=g-A*O;return R===0&&A>0&&(R=O,A--),[A,R];}function x(g){g=g.slice(0);var O=g[0],A=g[g.length-1];A.offset=A.offset||1,O.offset=O.offset||0;for(var R=0,b=-1,E=0;E<g.length;E++){var L=g[E];if(L.offset!=null){var D=E-b;if(D>1)for(var I=(L.offset-R)/D,C=0;C<D-1;C++)g[b+C+1].offset=R+I*(C+1);R=L.offset,b=E;}if(L.easing!=null&&(L.easing=(0,h.parseEasing)(L.easing)),E>0){var W=g[E].easing!=null;g[E]=(0,s["default"])({},g[E-1],g[E]),W||delete g[E].easing;}}return g;}function l(g,O,A){var R=g.currentTime,b=O.direction,E=O.duration,L=!1;if(b==="reverse")A=1-A,L=!0;else if(b==="alternate"||b==="alternate-reverse"){var D=Math.floor(R/E);A===1&&D--,D%2^b==="alternate-reverse"&&(A=1-A,L=!0);}return{p:A,inverted:L};}function d(g,O,A,R){var b={};return(0,a["default"])(O).forEach(function(E){var L=(0,n["default"])(E,2),D=L[0],I=L[1];if(D!=="offset"&&D!=="easing"){var C=A[D]||A["default"],W=C(g[D],I,R,g.offset,O.offset);W!=null&&(b[D]=W);}}),b;}function u(g,O,A,R){var b=g.easing,E=g.effect;E||(A=(0,s["default"])({},y["default"],A));var L={};R=b(R,O);for(var D=1;D<O.length;D++){var I=O[D],C=I.offset;if(C>=R||D===O.length-1){var W=O[D-1],G=W.offset,K=W.easing,X=R;if(K){var Z=C-G;X=K((R-G)/Z)*Z+G;}E?L=E(W,I,X,G,C):L=d(W,I,A,X);break;}}return L;}},/* 209 */ /***/function(f,r,t){f.exports={"default":t(210),__esModule:!0};},/* 210 */ /***/function(f,r,t){t(211),f.exports=t(92).Object.entries;},/* 211 */ /***/function(f,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function entries(a){return n(a);}});},/* 212 */ /***/function(f,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;f.exports=function(o){return function(s){for(var c=i(s),p=n(c),h=p.length,v=0,y=[],M;h>v;)M=p[v++],(!e||a.call(c,M))&&y.push(o?[M,c[M]]:c[M]);return y;};};},/* 213 */ /***/function(f,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 c=e.get(a);if(!c)throw new TypeError("Invalid node: ".concat(a));var p=new c(o);return s.forEach(function(h){p.appendChild(h);}),p;}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(f,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(c){var _ref115=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref115$bubbles=_ref115.bubbles,p=_ref115$bubbles===void 0?null:_ref115$bubbles;_classCallCheck(this,o);if(typeof c=="string"?(this[e]=c,this[n]=!!p):(this[e]=c.type,this[i]=c,this[n]=p!=null?!!p:!!c.bubbles,c.detail&&(this[a]=c.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(c){this[i]=c;}},{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(f,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),c=[];return s&&s.forEach(function(p){var h=p.match(o);if(!h)throw new TypeError("Invalid fitler string.");var _h3=_slicedToArray(h,3),v=_h3[1],y=_h3[2];v=v.toLowerCase(),y=y.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(M,T){var m;return v==="url"||v==="drop-shadow"&&T===3?m=M:m=Object(e.toNumber)(M),/%$/.test(M)&&(m/=100),m;}),c.push({type:v,args:y});}),c;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref116){var s=_ref116.type,c=_ref116.args;var p=s;p==="drop-shadow"?p="dropShadow":p==="hue-rotate"&&(p="hueRotate"),a[p].apply(a,_toConsumableArray(c));});}},/* 216 */ /***/function(f,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(f,r,t){t.r(r),t.d(r,"default",function(){return c;});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 c=/*#__PURE__*/function(_i$default){function c(h){var _this28;var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,c);_this28=_callSuper(this,c),_this28.meshNode=h,h.connect(_assertThisInitialized(_this28)),_this28[o]=v,_this28[s]=null;return _this28;}_inherits(c,_i$default);return _createClass(c,[{key:"meshCloud",get:function get(){var h=this.meshNode,v=this[o];return!this[s]&&h.mesh&&(this[s]=new e.MeshCloud(h.mesh,v)),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(h){this[o]=h,this[s]&&(this[s].amount=h);}},{key:"brightness",value:function brightness(h,v){this.meshCloud&&(this.meshCloud.brightness(h,v),this.forceUpdate());}},{key:"contrast",value:function contrast(h,v){this.meshCloud&&(this.meshCloud.contrast(h,v),this.forceUpdate());}},{key:"delete",value:function _delete(h){this.meshCloud&&(this.meshCloud["delete"](h),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this29=this;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_get(_getPrototypeOf(c.prototype),"draw",this).call(this,h),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var v=this.shaderAttrs;v&&Object.entries(v).forEach(function(_ref117){var _ref118=_slicedToArray(_ref117,2),M=_ref118[0],T=_ref118[1];_this29.meshCloud.mesh.setAttribute(M,T);});var y=this.uniforms;if(this.uniforms){var M={};Object.entries(y).forEach(function(_ref119){var _ref120=_slicedToArray(_ref119,2),T=_ref120[0],m=_ref120[1];typeof m=="function"&&(m=m(_this29,T)),M[T]=m;}),this.meshCloud.mesh.setUniforms(M);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),h.push(this.meshCloud);}return h;}},{key:"getTransform",value:function getTransform(h){if(this.meshCloud)return this.meshCloud.getTransform(h);}},{key:"grayscale",value:function grayscale(h,v){this.meshCloud&&(this.meshCloud.grayscale(h,v),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(h,v){this.meshCloud&&(this.meshCloud.hueRotate(h,v),this.forceUpdate());}},{key:"invert",value:function invert(h,v){this.meshCloud&&(this.meshCloud.invert(h,v),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(h,v){if(!this.meshCloud)return!1;var y=this.attributes.pointerEvents;if(y==="none"||y!=="all"&&!this.isVisible)return!1;var M="both";y==="visibleFill"&&(M="fill"),y==="visibleStroke"&&(M="stroke");for(var T=0;T<this[o];T++)if(!this.meshCloud.isPointCollision(T,[h,v],M))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(h,v){this.meshCloud&&(this.meshCloud.opacity(h,v),this.forceUpdate());}},{key:"rotate",value:function rotate(h,v){var _ref121=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref122=_slicedToArray(_ref121,2),y=_ref122[0],M=_ref122[1];var T=Math.PI*v/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,m=_this$meshNode$attrib.x,_x35=_this$meshNode$attrib.y;this.meshCloud.rotate(h,T,[y+m,M+_x35]),this.forceUpdate();}}},{key:"saturate",value:function saturate(h,v){this.meshCloud&&(this.meshCloud.saturate(h,v),this.forceUpdate());}},{key:"scale",value:function scale(h,_ref123){var _ref124=_slicedToArray(_ref123,2),v=_ref124[0],_ref124$=_ref124[1],y=_ref124$===void 0?v:_ref124$;var _ref125=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref126=_slicedToArray(_ref125,2),M=_ref126[0],T=_ref126[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,m=_this$meshNode$attrib2.x,_x36=_this$meshNode$attrib2.y,_l13=1e-5;Math.abs(v)<_l13&&(v=1/v>0?_l13:-_l13),Math.abs(y)<_l13&&(y=1/y>0?_l13:-_l13),this.meshCloud.scale(h,[v,y],[M+m,T+_x36]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(h,v){this.meshCloud&&(this.meshCloud.setColorTransform(h,v),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(h,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setFillColor(h,v),this.forceUpdate());}},{key:"sepia",value:function sepia(h,v){this.meshCloud&&(this.meshCloud.sepia(h,v),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref127){var h=_ref127.width,v=_ref127.height;_get(_getPrototypeOf(c.prototype),"setResolution",this).call(this,{width:h,height:v}),this.meshNode.setResolution({width:h,height:v});}},{key:"setStrokeColor",value:function setStrokeColor(h,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setStrokeColor(h,v),this.forceUpdate());}},{key:"setTransform",value:function setTransform(h,v){this.meshCloud&&(this.meshCloud.setTransform(h,v),this.forceUpdate());}},{key:"skew",value:function skew(h,_ref128){var _ref129=_slicedToArray(_ref128,2),v=_ref129[0],_ref129$=_ref129[1],y=_ref129$===void 0?v:_ref129$;var _ref130=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref131=_slicedToArray(_ref130,2),M=_ref131[0],T=_ref131[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,m=_this$meshNode$attrib3.x,_x37=_this$meshNode$attrib3.y;this.meshCloud.skew(h,[v,y],[M+m,T+_x37]),this.forceUpdate();}}},{key:"transform",value:function transform(h,v){this.meshCloud&&(this.meshCloud.transform(h,v),this.forceUpdate());}},{key:"transformColor",value:function transformColor(h,v){this.meshCloud&&(this.meshCloud.transformColor(h,v),this.forceUpdate());}},{key:"translate",value:function translate(h,_ref132){var _ref133=_slicedToArray(_ref132,2),v=_ref133[0],y=_ref133[1];this.meshCloud&&(this.meshCloud.translate(h,[v,y]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(c,"cloud");},/* 218 */ /***/function(f,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 c;}),t.d(r,"deleteTexture",function(){return p;}),t.d(r,"drawTexture",function(){return v;}),t.d(r,"loadFrames",function(){return y;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(M,T){if(i[M])return i[M];var m=e.ENV.loadImage(M,{alias:T,useImageBitmap:!1});return m!==null&&m!==void 0?m:M;}function o(_x38,_x39,_x40){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(M,T,m){var x,_M$attributes,_l14,d,u,g;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===M.attributes.texture)){_context18.next=11;break;}x&&x.image&&(x.sourceRect&&(M.attributes.sourceRect=x.sourceRect),M.textureImageRotated=!!x.rotated,x=x.image);_M$attributes=M.attributes,_l14=_M$attributes.width,d=_M$attributes.height,u=_M$attributes.textureRect,g=M.textureImage;M.textureImage=x,m&&g!==x&&!u&&(_l14==null||d==null)&&M.updateContours(),M.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 c(M,T){if(T[s]=T[s]||/* @__PURE__ */new Map(),T[s].has(M))return T[s].get(M);var m=T.createTexture(M);return!/^blob:/.test(M.src)&&typeof M.getContext!="function"&&T[s].set(M,m),m;}function p(M,T){if(T[s]&&T[s].has(M)){var m=T[s].get(M);return T.deleteTexture(m),T[s]["delete"](M),!0;}return!1;}var h=Symbol("textureContext");function v(M,T){var m=M.textureImage instanceof String?String(M.textureImage):M.textureImage,x=M.textureImageRotated,l=T.texture,d=M.renderer;if(m){var u=M.originalContentRect;var g=M.attributes.textureRect;var O=M.attributes.textureRepeat,A=M.attributes.sourceRect;if(!l||M[h]&&M[h]!==d||l.image!==m||l.options.repeat!==O||!Object(n.compareValue)(l.options.rect,g)||!Object(n.compareValue)(l.options.srcRect,A)){var R=c(m,d);g?(g[0]+=u[0],g[1]+=u[1]):g=u;var b=null;l&&!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(b=T.uniforms.u_texSampler),T.setTexture(R,{rect:g,repeat:O,srcRect:A,rotated:x}),b&&b["delete"]&&b["delete"](),M[h]=d;}}else if(l){var _u8=null;!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(_u8=T.uniforms.u_texSampler),T.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function y(_x41,_x42){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(M,T){var m,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(M);case 9:m=_context19.sent;x=T.frames;return _context19.abrupt("return",(Object.entries(x).forEach(function(_ref134){var _ref135=_slicedToArray(_ref134,2),l=_ref135[0],d=_ref135[1];var _d$frame=d.frame,u=_d$frame.x,g=_d$frame.y,O=_d$frame.w,A=_d$frame.h;var R=[u,g,O,A];var b=d.rotated;b&&(R=[R[0],R[1],R[3],R[2]]),i[l]={image:m,sourceRect:R,rotated:b};}),m));case 12:case"end":return _context19.stop();}},_callee19);}));return _y5.apply(this,arguments);}},/* 219 */ /***/function(f,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),c=t(213),p=t(223);t(1).glMatrix.setMatrixArrayType(Array);function h(M,T,m){return T in M?Object.defineProperty(M,T,{value:m,enumerable:!0,configurable:!0,writable:!0}):M[T]=m,M;}var v=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,m=_this$attributes2.paddingRight,x=_this$attributes2.paddingBottom,l=_this$attributes2.paddingLeft,d=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],g=_this$contentSize[1];return[l+u+m+d,T+g+x+d];}// content + padding
299
+ },{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,T=_this$attributes3.paddingTop,m=_this$attributes3.paddingRight,x=_this$attributes3.paddingBottom,l=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),d=_this$contentSize2[0],u=_this$contentSize2[1];return[l+d+m,T+u+x];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,T=_this$attributes4.width,m=_this$attributes4.height,x=_this$attributes4.boxSizing,l=_this$attributes4.paddingTop,d=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,g=_this$attributes4.paddingLeft;if(T=T||0,m=m||0,x==="border-box"){var O=2*this.attributes.borderWidth;T-=O+d+g,m-=O+l+u,T=Math.max(0,T),m=Math.max(0,m);}return[T,m];}},{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],m=_this$borderSize[1];return T>0&&m>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var T=this.clientBox;if(T){var _m5;var m=this[v];if(m)m.box!==T&&(m.contours=T.contours,m.box=T);else{m=new n.Mesh2D(T),m.box=T;var _l15=this.attributes.bgcolor;if(Object(o.setFillColor)(m,{color:_l15}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,O=_this$attributes5.borderDash,A=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(m,{color:u,lineWidth:g,lineDash:O,lineDashOffset:A});}this[v]=m;var d=this.attributes.clipPath;d&&this[v].setClipPath(d);}var _x43=this.opacity;return m.getOpacity()!==_x43&&m.setOpacity(_x43),(_m5=m).setTransform.apply(_m5,_toConsumableArray(this.renderMatrix)),m;}return null;}// content + padding + border
300
+ },{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,T=_this$attributes6.paddingTop,m=_this$attributes6.paddingRight,x=_this$attributes6.paddingBottom,l=_this$attributes6.paddingLeft,d=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),u=_this$contentSize3[0],g=_this$contentSize3[1],O=2*d;return[l+u+m+O,T+g+x+O];}},{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],m=_this$originalClientR[1],x=_this$originalClientR[2],l=_this$originalClientR[3],d=this.attributes.padding;return[T+d[0],m+d[1],x-d[0]-d[2],l-d[1]-d[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 m=null;if(this.mesh){m=_toConsumableArray(this.mesh.boundingBox);var _x44=this.attributes.borderWidth;_x44&&(m[0]=[m[0][0]-_x44,m[0][1]-_x44],m[1]=[m[1][0]+_x44,m[1][1]+_x44]);}return Object(p["default"])(m,T);}// transformPoint(x, y) {
301
+ // const m = mat2d.invert(this.renderMatrix);
302
+ // const newX = x * m[0] + y * m[2] + m[4];
303
+ // const newY = x * m[1] + y * m[3] + m[5];
304
+ // return [newX, newY];
305
+ // }
306
+ /* override */},{key:"onPropertyChange",value:function onPropertyChange(T,m,x){if(_get(_getPrototypeOf(y.prototype),"onPropertyChange",this).call(this,T,m,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[v]&&T==="clipPath"&&this[v].setClipPath(m),this[v]&&T==="bgcolor"&&Object(o.setFillColor)(this[v],{color:m}),this[v]&&(T==="borderColor"||T==="borderWidth"||T==="borderDash"||T==="borderDashOffset")){var _this$attributes7=this.attributes,_l16=_this$attributes7.borderColor,d=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[v],{color:_l16,lineWidth:d,lineDash:d?u:0,lineDashOffset:g});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,T=_this$attributes8.anchorX,m=_this$attributes8.anchorY,x=_this$attributes8.borderWidth,l=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),d=_this$borderSize2[0],u=_this$borderSize2[1],g=this.offsetSize,O=0.5*x,A=-T*g[0]+O,R=-m*g[1]+O;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[A,R,d,u],l);}}]);}(i["default"]);h(y,"Attr",a["default"]),c["default"].registerNode(y,"block");},/* 220 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return p;});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"),c=Symbol["for"]("spritejs_declareAlias");var p=/*#__PURE__*/function(_e$default){function p(v){var _this30;_classCallCheck(this,p);_this30=_callSuper(this,p,[v]),_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[c]("anchor","size","border","borderRadius","padding");return _this30;}_inherits(p,_e$default);return _createClass(p,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(v){this[a]("anchorX",Object(n.toNumber)(v));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(v){this[a]("anchorY",Object(n.toNumber)(v));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.anchorX=v[0],this.anchorY=v[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(v){this[a]("width",Object(n.toNumber)(v));}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){this[a]("height",Object(n.toNumber)(v));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(v){this[a]("borderWidth",Object(n.toNumber)(v));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(v){this[a]("borderColor",Object(i.parseColor)(v));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v]),this.borderWidth=v[0],v[1]!=null&&(this.borderColor=v[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(v){v=Object(n.toArray)(v,!0),v!=null&&!Array.isArray(v)&&(v=[v]),this[a]("borderDash",v?v.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(v){this[a]("borderDashOffset",Object(n.toNumber)(v));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopLeftRadius",v.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopRightRadius",v.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomRightRadius",v.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomLeftRadius",v.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(v){if(v=Object(n.toArray)(v),!Array.isArray(v))v=Array(8).fill(v);else if(v.length===2)v=[v[0],v[1],v[0],v[1],v[0],v[1],v[0],v[1]];else if(v.length===4)v=[v[0],v[1],v[2],v[3],v[0],v[1],v[2],v[3]];else if(v.length===6)v=[v[0],v[1],v[2],v[3],v[4],v[5],v[2],v[3]];else if(v.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[v[0],v[1]],this.borderTopRightRadius=[v[2],v[3]],this.borderBottomRightRadius=[v[4],v[5]],this.borderBottomLeftRadius=[v[6],v[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(v){this[a]("bgcolor",Object(i.parseColor)(v));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(v){this[a]("paddingTop",Object(n.toNumber)(v));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(v){this[a]("paddingRight",Object(n.toNumber)(v));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(v){this[a]("paddingBottom",Object(n.toNumber)(v));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(v){this[a]("paddingLeft",Object(n.toNumber)(v));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)?v.length===2?v=[v[0],v[1],v[0],v[1]]:v.length===3&&(v=[v[0],v[1],v[2],v[1]]):v=[v,v,v,v],this.paddingTop=v[0],this.paddingRight=v[1],this.paddingBottom=v[2],this.paddingLeft=v[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(v){this[a]("clipPath",v);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(v){if(v!=null&&v!=="border-box"&&v!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",v);}}]);}(e["default"]);},/* 221 */ /***/function(f,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 c;}),t.d(r,"setStrokeColor",function(){return p;}),t.d(r,"Color",function(){return h;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref136){var y=_ref136.vector,M=_ref136.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=M.map(function(_ref137){var T=_ref137.offset,m=_ref137.color;return{offset:T,color:o(m)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(v){return v instanceof i?!1:v==null?!0:n()(v)[3]===0;}function o(v){if(v==null||(v||(v="transparent"),v instanceof i))return v;var y=n()(v);if(!y||!y.length)throw new TypeError("Invalid color value.");return"rgba(".concat(y.join(),")");}function s(v,y,M){var T=v.boundingBox[0];if(M.vector){var m=M.vector,_x45=M.colors;m.length===4?(m=[m[0]+T[0],m[1]+T[1],m[2]+T[0],m[3]+T[1]],v.setLinearGradient({vector:m,colors:_x45,type:y})):m.length===3?(m=[m[0]+T[0],m[1]+T[1],m[2]],v.setCircularGradient({vector:m,colors:_x45,type:y})):(m=[m[0]+T[0],m[1]+T[1],m[2],m[3]+T[0],m[4]+T[1],m[5]],v.setRadialGradient({vector:m,colors:_x45,type:y}));}else v.gradient&&v.gradient[y]&&(delete v.gradient[y],delete v.uniforms.u_radialGradientVector);}function c(v,_ref138){var y=_ref138.color,_ref138$rule=_ref138.rule,M=_ref138$rule===void 0?"nonzero":_ref138$rule;return s(v,"fill",y),y.vector||v.setFill({color:y,rule:M}),v;}function p(v,_ref139){var y=_ref139.color,M=_ref139.lineWidth,T=_ref139.lineCap,m=_ref139.lineJoin,x=_ref139.lineDash,l=_ref139.lineDashOffset,d=_ref139.miterLimit,u=_ref139.roundSegments;s(v,"stroke",y),y.vector&&(y=[0,0,0,1]),v.setStroke({color:y,thickness:M,cap:T,join:m,miterLimit:d,lineDash:x,lineDashOffset:l,roundSegments:u});}var h=/*#__PURE__*/function(_Array){function h(){var _y6,_y7,_n2,_n3;var _this31;var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var m=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,h);return _possibleConstructorReturn(_this31,(Array.isArray(y)&&(_y6=y,_y7=_slicedToArray(_y6,4),y=_y7[0],M=_y7[1],T=_y7[2],m=_y7[3],_y6),typeof y=="string"&&((_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],M=_n3[1],T=_n3[2],m=_n3[3]),y/=255,M/=255,T/=255),_this31=_callSuper(this,h,[y,M,T,m]),_assertThisInitialized(_this31)));}_inherits(h,_Array);return _createClass(h,[{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),M="0".concat(this.g.toString(16)).slice(-2),T="0".concat(this.b.toString(16)).slice(-2);var m;return this.a<1&&(m=Math.round(this[3]*255),m="0".concat(m.toString(16)).slice(-2)),"#".concat(y).concat(M).concat(T).concat(m||"");}},{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(f,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,c){var p=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var h=0.5522848,v=s/2*h,y=c/2*h,M=a+s,T=o+c,m=a+s/2,x=o+c/2;p==="leftTop"?(i.moveTo(a,x),i.bezierCurveTo(a,x-y,m-v,o,m,o)):p==="rightTop"?i.bezierCurveTo(m+v,o,M,x-y,M,x):p==="rightBottom"?i.bezierCurveTo(M,x+y,m+v,T,m,T):p==="leftBottom"&&i.bezierCurveTo(m-v,T,a,x+y,a,x);}function n(i,_ref140,p){var _ref141=_slicedToArray(_ref140,4),a=_ref141[0],o=_ref141[1],s=_ref141[2],c=_ref141[3];if(!p||Array.isArray(p)&&p.every(function(h){return h===0;}))i.beginPath(),i.rect(a,o,s,c);else{typeof p=="number"&&(p=Array(8).fill(p));var _p$map=p.map(function(d,u){return u%2?Math.min(d,c/2):Math.min(d,s/2);}),_p$map2=_slicedToArray(_p$map,8),h=_p$map2[0],v=_p$map2[1],y=_p$map2[2],M=_p$map2[3],T=_p$map2[4],m=_p$map2[5],_x46=_p$map2[6],_l17=_p$map2[7];i.beginPath(),i.moveTo(a,o+v),e(i,a,o,h*2,v*2,"leftTop"),i.lineTo(a+s-y,o),e(i,a+s-y*2,o,y*2,M*2,"rightTop"),i.lineTo(a+s,o+c-m),e(i,a+s-T*2,o+c-m*2,T*2,m*2,"rightBottom"),i.lineTo(a+_x46,o+c),e(i,a,o+c-_l17*2,_x46*2,_l17*2,"leftBottom"),i.closePath();}return i;}},/* 223 */ /***/function(f,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],c=i*n[0]+a*n[2]+n[4],p=i*n[1]+a*n[3]+n[5],h=o*n[0]+a*n[2]+n[4],v=o*n[1]+a*n[3]+n[5],y=o*n[0]+s*n[2]+n[4],M=o*n[1]+s*n[3]+n[5],T=i*n[0]+s*n[2]+n[4],m=i*n[1]+s*n[3]+n[5],x=Math.min(c,h,y,T),l=Math.min(p,v,M,m),d=Math.max(c,h,y,T),u=Math.max(p,v,M,m);return{x:x,y:l,width:d-x,height:u-l,left:x,top:l,right:d,bottom:u};};},/* 224 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(p,h,v){return h in p?Object.defineProperty(p,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[h]=v,p;}var s=Symbol("textureTask");var c=/*#__PURE__*/function(_n$default){function c(){var _this32;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,c);typeof h=="string"&&(h={texture:h}),_this32=_callSuper(this,c,[h]);return _this32;}/* override */_inherits(c,_n$default);return _createClass(c,[{key:"contentSize",get:function get(){var _get2=_get(_getPrototypeOf(c.prototype),"contentSize",this),_get3=_slicedToArray(_get2,2),h=_get3[0],v=_get3[1];var _this$attributes9=this.attributes,y=_this$attributes9.width,M=_this$attributes9.height;if(y==null||M==null){var T=this.textureImage,m=this.attributes.textureRect,_x47=this.attributes.sourceRect;if(m)y==null&&(h=m[0]+m[2]),M==null&&(v=m[1]+m[3]);else if(_x47){var _l18=this.layer?this.layer.displayRatio:1;y==null&&(h=_x47[2]/_l18),M==null&&(v=_x47[3]/_l18);}else if(T){var _l19=this.layer?this.layer.displayRatio:1;y==null&&(h=T.width/_l19),M==null&&(v=T.height/_l19);}}return[h,v];}},{key:"textureImageReady",get:function get(){return this[s]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(c.prototype),"draw",this).call(this,h);var v=this.mesh;return v&&Object(e.drawTexture)(this,v),h;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(h,v,y){if(_get(_getPrototypeOf(c.prototype),"onPropertyChange",this).call(this,h,v,y),h==="texture"&&(this[s]=Object(e.applyTexture)(this,v,!0)),h==="textureRect"){var _this$attributes10=this.attributes,M=_this$attributes10.width,T=_this$attributes10.height;(M==null||T==null)&&this.updateContours();}}}]);}(n["default"]);o(c,"Attr",i["default"]),a["default"].registerNode(c,"sprite");},/* 225 */ /***/function(f,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(c){var _this33;_classCallCheck(this,o);_this33=_callSuper(this,o,[c]),_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(c){this[i]("texture",c);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(c){this[i]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(c){this[i]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(c){this[i]("textureRepeat",!!c);}}]);}(e["default"]);},/* 226 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return M;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),o=t(228),s=t(221),c=t(218),p=t(213),h=t(223);t(1).glMatrix.setMatrixArrayType(Array);function v(T,m,x){return m in T?Object.defineProperty(T,m,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[m]=x,T;}var y=Symbol("mesh");var M=/*#__PURE__*/function(_a$default){function M(){var _this34;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof m=="string"&&(m={d:m}),_this34=_callSuper(this,M,[m]),_this34.effects={d:function d(x,l,_d5,u,g){var _i$a;var O=(_d5-u)/(g-u);if(O<=0)return x;if(O>=1)return l;var A=i.a._preprocessing(i.a.path2shapes(x),i.a.path2shapes(l)),R=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(A).concat([O]))[0];return R.reduce(function(E,L){return"".concat(E).concat(L.slice(2).join(" ")," ");},"M".concat(R[0][0]," ").concat(R[0][1],"C")).trim();}};return _this34;}/* override */_inherits(M,_a$default);return _createClass(M,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var m=this.path;if(m){var _x49;var _x48=this[y];if(_x48)_x48.path!==m&&(_x48.contours=m.contours,_x48.path=m);else{_x48=new e.Mesh2D(this.path),_x48.path=m;var d=this.attributes.fillColor,u=this.attributes.fillRule;d&&Object(s.setFillColor)(_x48,{color:d,rule:u});var g=this.attributes.lineWidth,O=this.attributes.strokeColor;if(O&&g>0){var _this$attributes11=this.attributes,R=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,E=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,D=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_x48,{color:O,lineWidth:g,lineCap:R,lineJoin:b,miterLimit:E,lineDash:L,lineDashOffset:D,roundSegments:I});}this[y]=_x48;var A=this.attributes.clipPath;A&&this[y].setClipPath(A);}var _l20=this.opacity;return _x48.getOpacity()!==_l20&&_x48.setOpacity(_l20),(_x49=_x48).setTransform.apply(_x49,_toConsumableArray(this.renderMatrix)),_x48;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var m=this.path.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var m=this.mesh.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[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(m){this.attributes.d=m;}},{key:"draw",value:function draw(){var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(M.prototype),"draw",this).call(this,m);var x=this.mesh;return x&&Object(c.drawTexture)(this,x),m;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var m=null;return this.mesh&&(m=this.mesh.boundingBox),Object(h["default"])(m,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(m){if(this.mesh){var _x50=this.mesh.getPointAtLength(m);if(_x50)return[_x50.x,_x50.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,x,l){if(_get(_getPrototypeOf(M.prototype),"onPropertyChange",this).call(this,m,x,l),(m==="d"||m==="normalize")&&this.updateContours(),this[y]&&(m==="fillColor"||m==="fillRule")){var _this$attributes12=this.attributes,d=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(s.setFillColor)(this[y],{color:d,rule:u});}if(this[y]&&(m==="strokeColor"||m==="lineWidth"||m==="lineCap"||m==="lineJoin"||m==="lineDash"||m==="lineDashOffset"||m==="roundSegments")){var _this$attributes13=this.attributes,_d6=_this$attributes13.strokeColor,_u9=_this$attributes13.lineWidth;if(_d6&&_u9>0){var _this$attributes14=this.attributes,g=_this$attributes14.lineCap,O=_this$attributes14.lineJoin,A=_this$attributes14.lineDash,R=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,E=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[y],{color:_d6,lineCap:g,lineJoin:O,lineWidth:_u9,lineDash:A,lineDashOffset:R,miterLimit:b,roundSegments:E});}}this[y]&&m==="clipPath"&&this[y].setClipPath(x),m==="texture"&&Object(c.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"]);v(M,"Attr",o["default"]),p["default"].registerNode(M,"path");},/* 227 */ /***/function(f,r,t){(function(e,n){f.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(D,I){var C=[],W=!0,G=!1,K=void 0;try{for(var X=D[Symbol.iterator](),Z;!(W=(Z=X.next()).done)&&(C.push(Z.value),!(I&&C.length===I));W=!0);}catch(B){G=!0,K=B;}finally{try{!W&&X["return"]&&X["return"]();}finally{if(G)throw K;}}return C;}return function(D,I){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return L(D,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(D,I,C,W,G,K,X){var Z=D.x,B=D.y;Z*=I,B*=C;var z=W*Z-G*B,Q=G*Z+W*B;return{x:z+K,y:Q+X};},a=function a(D,I){var C=1.3333333333333333*Math.tan(I/4),W=Math.cos(D),G=Math.sin(D),K=Math.cos(D+I),X=Math.sin(D+I);return[{x:W-G*C,y:G+W*C},{x:K+X*C,y:X-K*C},{x:K,y:X}];},o=function o(D,I,C,W){var G=D*W-I*C<0?-1:1,K=Math.sqrt(D*D+I*I),X=Math.sqrt(D*D+I*I),Z=D*C+I*W,B=Z/(K*X);return B>1&&(B=1),B<-1&&(B=-1),G*Math.acos(B);},s=function s(D,I,C,W,G,K,X,Z,B,z,Q,et){var _=Math.pow(G,2),st=Math.pow(K,2),q=Math.pow(Q,2),ht=Math.pow(et,2),dt=_*st-_*ht-st*q;dt<0&&(dt=0),dt/=_*ht+st*q,dt=Math.sqrt(dt)*(X===Z?-1:1);var F=dt*G/K*et,U=dt*-K/G*Q,V=z*F-B*U+(D+C)/2,J=B*F+z*U+(I+W)/2,N=(Q-F)/G,$=(et-U)/K,S=(-Q-F)/G,P=(-et-U)/K,w=o(1,0,N,$),j=o(N,$,S,P);return Z===0&&j>0&&(j-=n),Z===1&&j<0&&(j+=n),[V,J,w,j];},c=function c(D){var I=D.px,C=D.py,W=D.cx,G=D.cy,K=D.rx,X=D.ry,Z=D.xAxisRotation,B=Z===void 0?0:Z,z=D.largeArcFlag,Q=z===void 0?0:z,et=D.sweepFlag,_=et===void 0?0:et,st=[];if(K===0||X===0)return[];var q=Math.sin(B*n/360),ht=Math.cos(B*n/360),dt=ht*(I-W)/2+q*(C-G)/2,F=-q*(I-W)/2+ht*(C-G)/2;if(dt===0&&F===0)return[];K=Math.abs(K),X=Math.abs(X);var U=Math.pow(dt,2)/Math.pow(K,2)+Math.pow(F,2)/Math.pow(X,2);U>1&&(K*=Math.sqrt(U),X*=Math.sqrt(U));var V=s(I,C,W,G,K,X,Q,_,q,ht,dt,F),J=e(V,4),N=J[0],$=J[1],S=J[2],P=J[3],w=Math.max(Math.ceil(Math.abs(P)/(n/4)),1);P/=w;for(var j=0;j<w;j++)st.push(a(S,P)),S+=P;return st.map(function(H){var Y=i(H[0],K,X,ht,q,N,$),k=Y.x,rt=Y.y,it=i(H[1],K,X,ht,q,N,$),lt=it.x,ut=it.y,at=i(H[2],K,X,ht,q,N,$),ot=at.x,ct=at.y;return{x1:k,y1:rt,x2:lt,y2:ut,x:ot,y:ct};});},p={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
307
+ * segment pattern
308
+ * @type {RegExp}
309
+ */},h=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function v(L){var D=[];return L.replace(h,function(I,C,W){var G=C.toLowerCase();for(W=M(W),G=="m"&&W.length>2&&(D.push([C].concat(W.splice(0,2))),G="l",C=C=="m"?"l":"L");;){if(W.length==p[G])return W.unshift(C),D.push(W);if(W.length<p[G])throw new Error("malformed path data");D.push([C].concat(W.splice(0,p[G])));}}),D;}var y=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function M(L){var D=L.match(y);return D?D.map(Number):[];}function T(L){var D=L[0][0],I=L[0][1],C=D,W=I;return L.forEach(function(G){var K=G[0],X=G[2],Z=G[4],B=G[6],z=G[1],Q=G[3],et=G[5],_=G[7];D=Math.min(D,K,X,Z,B),I=Math.min(I,z,Q,et,_),C=Math.max(C,K,X,Z,B),W=Math.max(W,z,Q,et,_);}),[D,I,C,W];}function m(L,D){return Math.sqrt(Math.pow(L[0]-D[0],2)+Math.pow(L[1]-D[1],2))+Math.sqrt(Math.pow(L[2]-D[2],2)+Math.pow(L[3]-D[3],2));}function x(L,D){var I=L[0],C=L[2],W=L[4],G=L[6],K=L[1],X=L[3],Z=L[5],B=L[7],z=D[0],Q=D[2],et=D[4],_=D[6],st=D[1],q=D[3],ht=D[5],dt=D[7];return Math.sqrt(Math.pow(z-I,2)+Math.pow(st-K,2))+Math.sqrt(Math.pow(Q-C,2)+Math.pow(q-X,2))+Math.sqrt(Math.pow(et-W,2)+Math.pow(ht-Z,2))+Math.sqrt(Math.pow(_-G,2)+Math.pow(dt-B,2));}function l(L,D){var I=u(L.length),C=[];I.forEach(function(G){var K=0,X=0;G.forEach(function(Z){K+=x(L[Z],D[X++]);}),C.push({index:G,distance:K});}),C.sort(function(G,K){return G.distance-K.distance;});var W=[];return C[0].index.forEach(function(G){W.push(L[G]);}),W;}function d(L,D){var I=g(L.length),C=[];I.forEach(function(G){var K=0;G.forEach(function(X){K+=m(T(L[X]),T(D[X]));}),C.push({index:G,distance:K});}),C.sort(function(G,K){return G.distance-K.distance;});var W=[];return C[0].index.forEach(function(G){W.push(L[G]);}),W;}function u(L){for(var D=[],I=0;I<L;I++){for(var C=[],W=0;W<L;W++){var G=W+I;G>L-1&&(G-=L),C[G]=W;}D.push(C);}return D;}function g(L){for(var D=[],I=0;I<L;I++)D.push(I);return O(D);}function O(L){var D=[],I=[];function C(W){var G,K;for(G=0;G<W.length;G++)K=W.splice(G,1)[0],I.push(K),W.length==0&&D.push(I.slice()),C(W),W.splice(G,0,K),I.pop();return D;}return C(L);}var A={};A.parser=v,A.lerpCurve=function(L,D,I){return A.lerpPoints(L[0],L[1],D[0],D[1],I).concat(A.lerpPoints(L[2],L[3],D[2],D[3],I)).concat(A.lerpPoints(L[4],L[5],D[4],D[5],I)).concat(A.lerpPoints(L[6],L[7],D[6],D[7],I));},A.lerpPoints=function(L,D,I,C,W){return[L+(I-L)*W,D+(C-D)*W];},A.q2b=function(L,D,I,C,W,G){return[L,D,(L+2*I)/3,(D+2*C)/3,(W+2*I)/3,(G+2*C)/3,W,G];},A.path2shapes=function(L){for(var D=A.parser(L),I=0,C=0,W=0,G=D.length,K=[],X=null,Z=void 0,B=void 0,z=void 0,Q=void 0,et=void 0,_=void 0,st=void 0;W<G;W++){var q=D[W],ht=q[0],dt=D[W-1];switch(ht){case"m":et=K.length,K[et]=[],X=K[et],I=I+q[1],C=C+q[2];break;case"M":et=K.length,K[et]=[],X=K[et],I=q[1],C=q[2];break;case"l":X.push([I,C,I,C,I,C,I+q[1],C+q[2]]),I+=q[1],C+=q[2];break;case"L":X.push([I,C,q[1],q[2],q[1],q[2],q[1],q[2]]),I=q[1],C=q[2];break;case"h":X.push([I,C,I,C,I,C,I+q[1],C]),I+=q[1];break;case"H":X.push([I,C,q[1],C,q[1],C,q[1],C]),I=q[1];break;case"v":X.push([I,C,I,C,I,C,I,C+q[1]]),C+=q[1];break;case"V":X.push([I,C,I,q[1],I,q[1],I,q[1]]),C=q[1];break;case"C":X.push([I,C,q[1],q[2],q[3],q[4],q[5],q[6]]),I=q[5],C=q[6];break;case"S":dt[0]==="C"||dt[0]==="c"?X.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],q[1],q[2],q[3],q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],q[1],q[2],q[3],q[4]]),I=q[3],C=q[4];break;case"c":X.push([I,C,I+q[1],C+q[2],I+q[3],C+q[4],I+q[5],C+q[6]]),I=I+q[5],C=C+q[6];break;case"s":dt[0]==="C"||dt[0]==="c"?X.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],I+q[1],C+q[2],I+q[3],C+q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],I+q[1],C+q[2],I+q[3],C+q[4]]),I=I+q[3],C=C+q[4];break;case"a":_=c({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:I+q[6],cy:C+q[7]}),st=_[_.length-1],_.forEach(function(F,U){U===0?X.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):X.push([_[U-1].x,_[U-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=st.x,C=st.y;break;case"A":_=c({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:q[6],cy:q[7]}),st=_[_.length-1],_.forEach(function(F,U){U===0?X.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):X.push([_[U-1].x,_[U-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=st.x,C=st.y;break;case"Q":X.push(A.q2b(I,C,q[1],q[2],q[3],q[4])),I=q[3],C=q[4];break;case"q":X.push(A.q2b(I,C,I+q[1],C+q[2],q[3]+I,q[4]+C)),I+=q[3],C+=q[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?(z=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(I,C,z,Q,q[1],q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(I,C,I+I-z,C+C-Q,q[1],q[2])),z=I+I-z,Q=C+C-Q),I=q[1],C=q[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?(z=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(I,C,z,Q,I+q[1],C+q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(I,C,I+I-z,C+C-Q,I+q[1],C+q[2])),z=I+I-z,Q=C+C-Q),I+=q[1],C+=q[2];break;case"Z":Z=X[0][0],B=X[0][1],X.push([I,C,Z,B,Z,B,Z,B]);break;case"z":Z=X[0][0],B=X[0][1],X.push([I,C,Z,B,Z,B,Z,B]);break;}}return K;},A._upCurves=function(L,D){for(var I=0,C=0,W=L.length;I<D;I++)L.push(L[C].slice(0)),C++,C>W-1&&(C-=W);};function R(L,D,I,C,W,G,K,X,Z){return{left:b(L,D,I,C,W,G,K,X,Z),right:b(K,X,W,G,I,C,L,D,1-Z,!0)};}function b(L,D,I,C,W,G,K,X,Z,B){var z=(I-L)*Z+L,Q=(C-D)*Z+D,et=(W-I)*Z+I,_=(G-C)*Z+C,st=(K-W)*Z+W,q=(X-G)*Z+G,ht=(et-z)*Z+z,dt=(_-Q)*Z+Q,F=(st-et)*Z+et,U=(q-_)*Z+_,V=(F-ht)*Z+ht,J=(U-dt)*Z+dt;return B?[V,J,ht,dt,z,Q,L,D]:[L,D,z,Q,ht,dt,V,J];}A._splitCurves=function(L,D){for(var I=0,C=0;I<D;I++){var W=L[C],G=R(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],0.5);L.splice(C,1),L.splice(C,0,G.left,G.right),C+=2,C>=L.length-1&&(C=0);}};function E(L,D){for(var I=function I(G){var K=L[L.length-1],X=[];K.forEach(function(Z){X.push(Z.slice(0));}),L.push(X);},C=0;C<D;C++)I();}return A.lerp=function(L,D,I){return A._lerp(A.path2shapes(L),A.path2shapes(D),I);},A.MIM_CURVES_COUNT=100,A._preprocessing=function(L,D){var I=L.length,C=D.length,W=JSON.parse(JSON.stringify(L)),G=JSON.parse(JSON.stringify(D));return I>C?E(G,I-C):I<C&&E(W,C-I),W=d(W,G),W.forEach(function(K,X){var Z=K.length,B=G[X].length;Z>B?Z<A.MIM_CURVES_COUNT?(A._splitCurves(K,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[X],A.MIM_CURVES_COUNT-B)):A._splitCurves(G[X],Z-B):Z<B&&(B<A.MIM_CURVES_COUNT?(A._splitCurves(K,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[X],A.MIM_CURVES_COUNT-B)):A._splitCurves(K,B-Z));}),W.forEach(function(K,X){W[X]=l(K,G[X]);}),[W,G];},A._lerp=function(L,D,I){var C=[];return L.forEach(function(W,G){var K=[];W.forEach(function(X,Z){K.push(A.lerpCurve(X,D[G][Z],I));}),C.push(K);}),C;},A.animate=function(L){var D=A.path2shapes(L.from),I=A.path2shapes(L.to),C=A._preprocessing(D,I),W=/* @__PURE__ */new Date(),G=L.end||function(){},K=L.progress||function(){},X=L.begin||function(){},Z=L.easing||function(_){return _;},B=null,z=null,Q=L.time;X(D);var et=function _(){var st=/* @__PURE__ */new Date()-W;if(st>=Q){z=I,K(z,1),G(z),cancelAnimationFrame(B);return;}var q=Z(st/Q);z=A._lerp(C[0],C[1],q),K(z,q),B=requestAnimationFrame(_);};et();},A;});},/* 228 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return c;});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 c=/*#__PURE__*/function(_e$default3){function c(h){var _this35;_classCallCheck(this,c);_this35=_callSuper(this,c,[h]),_this35[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
310
+ lineCap:"butt",// 'butt' or 'square' or 'round'
311
+ roundSegments:20,// default roundSegment if lineJoin or lineCap is round
312
+ lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this35;}_inherits(c,_e$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(h){this[o]("d",h);}},{key:"normalize",get:function get(){return this[s]("normalize");},set:function set(h){this[o]("normalize",!!h);}},{key:"fillColor",get:function get(){return this[s]("fillColor");},set:function set(h){this[o]("fillColor",Object(n.parseColor)(h));}},{key:"fillRule",get:function get(){return this[s]("fillRule");},set:function set(h){if(h!=null&&h!=="nonzero"&&h!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",h);}},{key:"strokeColor",get:function get(){return this[s]("strokeColor");},set:function set(h){this[o]("strokeColor",Object(n.parseColor)(h));}},{key:"lineWidth",get:function get(){return this[s]("lineWidth");},set:function set(h){this[o]("lineWidth",Object(i.toNumber)(h));}},{key:"lineJoin",get:function get(){return this[s]("lineJoin");},set:function set(h){if(h!=null&&h!=="miter"&&h!=="bevel"&&h!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",h);}},{key:"lineCap",get:function get(){return this[s]("lineCap");},set:function set(h){if(h!=null&&h!=="butt"&&h!=="square"&&h!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",h);}},{key:"lineDash",get:function get(){return this[s]("lineDash");},set:function set(h){h=Object(i.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h]),this[o]("lineDash",h?h.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[s]("lineDashOffset");},set:function set(h){this[o]("lineDashOffset",Object(i.toNumber)(h));}},{key:"miterLimit",get:function get(){return this[s]("miterLimit");},set:function set(h){this[o]("miterLimit",Object(i.toNumber)(h));}},{key:"roundSegments",get:function get(){return this[s]("roundSegments");},set:function set(h){this[o]("roundSegments",h);}},{key:"texture",get:function get(){return this[s]("texture");},set:function set(h){this[o]("texture",h);}},{key:"textureRect",get:function get(){return this[s]("textureRect");},set:function set(h){this[o]("textureRect",h);}},{key:"sourceRect",get:function get(){return this[s]("sourceRect");},set:function set(h){this[o]("sourceRect",h);}},{key:"textureRepeat",get:function get(){return this[s]("textureRepeat");},set:function set(h){this[o]("textureRepeat",!!h);}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(h){this[o]("clipPath",h);}}]);}(e["default"]);},/* 229 */ /***/function(f,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,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,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,c=_this$attributes15.width,p=_this$attributes15.height;return c>0&&p>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return p;});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 c(h){var v=h.width,y=h.height;return"M0 0L".concat(v," 0L").concat(v," ").concat(y,"L0 ").concat(y,"Z");}var p=/*#__PURE__*/function(_e$default5){function p(v){var _this36;_classCallCheck(this,p);_this36=_callSuper(this,p,[v]),_this36[i]({width:0,height:0/* size */}),_this36[s]("size");return _this36;}// readonly
313
+ _inherits(p,_e$default5);return _createClass(p,[{key:"d",get:function get(){return this[o]("d");},set:function set(v){}// eslint-disable-line no-empty-function
314
+ },{key:"width",get:function get(){return this[o]("width");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("width",v)){var y=c(this);this[a]("d",y);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("height",v)){var y=c(this);this[a]("d",y);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}}]);}(e["default"]);},/* 231 */ /***/function(f,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,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,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 c=this.attributes.sides;return c[0]>0&&c[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 */ /***/function(f,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,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,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 c=this.attributes.points;return c.length>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return h;});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"),c=Symbol["for"]("spritejs_declareAlias");function p(v){var y=v.points,M=v.smooth,T=v.smoothRange,m=v.close,x=[];for(var d=0;d<y.length;d+=2)x.push([y[d],y[d+1]]);var l="";return M?l=Object(i.makeSmoothCurveLine)(x,T):x.length&&(l="M".concat(x.map(function(d){return d.join(" ");}).join("L"))),l&&m&&(l+="Z"),l;}var h=/*#__PURE__*/function(_e$default8){function h(y){var _this37;_classCallCheck(this,h);_this37=_callSuper(this,h,[y]),_this37[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
315
+ /* close */}),_this37[c]("close");return _this37;}// readonly
316
+ _inherits(h,_e$default8);return _createClass(h,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
317
+ },{key:"close",get:function get(){return this.closeType!=="none";},set:function set(y){y=y?"normal":"none",this.closeType=y;}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var M=p(this);this[o]("d",M);}}},{key:"smooth",get:function get(){return this[s]("smooth");},set:function set(y){if(this[o]("smooth",y)){var M=p(this);this[o]("d",M);}}},{key:"smoothRange",get:function get(){return this[s]("smoothRange");},set:function set(y){if(y&&!Array.isArray(y)&&(y=[y]),this[o]("smoothRange",y)&&this.smooth){var M=p(this);this[o]("d",M);}}},{key:"points",get:function get(){return this[s]("points");},set:function set(y){if(y=Object(n.toArray)(y),Array.isArray(y)&&(y=y.reduce(function(M,T){return Array.isArray(T)?[].concat(_toConsumableArray(M),_toConsumableArray(T.map(function(m){return Object(n.toNumber)(m);}))):[].concat(_toConsumableArray(M),[Object(n.toNumber)(T)]);},[])),this[o]("points",y)){var M=p(this);this[o]("d",M);}}}]);}(e["default"]);},/* 234 */ /***/function(f,r,t){t.r(r),t.d(r,"makeSmoothCurveLine",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function a(c){var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var h=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var v,y,M,T;if((n[c].x===n[c+1].x||n[c].y===n[c+1].y)&&(p=0,h=0),c<1?(v=n[0].x+(n[1].x-n[0].x)*p,y=n[0].y+(n[1].y-n[0].y)*p):(v=n[c].x+(n[c+1].x-n[c-1].x)*p,y=n[c].y+(n[c+1].y-n[c-1].y)*p),c>n.length-3){var m=n.length-1;M=n[m].x-(n[m].x-n[m-1].x)*h,T=n[m].y-(n[m].y-n[m-1].y)*h;}else M=n[c+1].x-(n[c+2].x-n[c].x)*h,T=n[c+1].y-(n[c+2].y-n[c].y)*h;return[{x:v,y:y},{x:M,y:T}];}n=n.map(function(_ref142){var _ref143=_slicedToArray(_ref142,2),c=_ref143[0],p=_ref143[1];return{x:c,y:p};});var o="",s=0;return n.forEach(function(c,p){if(p===0)o+="M".concat(c.x," ").concat(c.y);else{for(;p>i[s];)s++;if(s%2){var _a3=a(p-1),_a4=_slicedToArray(_a3,2),h=_a4[0],v=_a4[1];o+="C".concat([h.x,h.y,v.x,v.y,c.x,c.y].join(" "));}else o+="L".concat(c.x," ").concat(c.y);}}),o;}},/* 235 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return c;});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(p){var _p$sides=_slicedToArray(p.sides,2),h=_p$sides[0],v=_p$sides[1];var y=p.angle%360;return y<0&&(y+=360),y=Math.PI*y/180,[0,0,h,0,v*Math.cos(y),v*Math.sin(y)];}var c=/*#__PURE__*/function(_e$default9){function c(h){var _this38;_classCallCheck(this,c);_this38=_callSuper(this,c,[h]),_this38[i]({sides:[0,0],angle:60,closeType:"normal"});return _this38;}// readonly
318
+ _inherits(c,_e$default9);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
319
+ },{key:"sides",get:function get(){return this[o]("sides");},set:function set(h){if(h=Object(n.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h,h]),this[a]("sides",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("angle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 236 */ /***/function(f,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,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,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 c=this.attributes.sides;return c[0]>0&&c[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return c;});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(p){var _p$sides2=_slicedToArray(p.sides,2),h=_p$sides2[0],v=_p$sides2[1];var y=p.angle%360;y<0&&(y+=360),y=Math.PI*y/180;var M=v*Math.cos(y),T=v*Math.sin(y);return[0,0,h,0,M+h,T,M,T];}var c=/*#__PURE__*/function(_e$default11){function c(h){var _this39;_classCallCheck(this,c);_this39=_callSuper(this,c,[h]),_this39[i]({sides:[0,0],angle:90,closeType:"normal"});return _this39;}// readonly
320
+ _inherits(c,_e$default11);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
321
+ },{key:"sides",get:function get(){return this[o]("sides");},set:function set(h){if(h=Object(n.toArray)(h,!0),h!=null&&!Array.isArray(h)&&(h=[h,h]),this[a]("sides",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("angle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 238 */ /***/function(f,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,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,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(f,r,t){t.r(r),t.d(r,"default",function(){return c;});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(p){var h=p.edges,v=p.radius,y=p.offsetAngle,M=Math.PI*y/180-0.5*Math.PI;if(h<3||v<=0)return[];var T=[];for(var m=0;m<h;m++){var _x51=m*2*Math.PI/h+M,_l21=v*Math.cos(_x51),d=v*Math.sin(_x51);T.push(_l21,d);}return T;}var c=/*#__PURE__*/function(_e$default13){function c(h){var _this40;_classCallCheck(this,c);_this40=_callSuper(this,c,[h]),_this40[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this40;}// readonly
322
+ _inherits(c,_e$default13);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
323
+ },{key:"edges",get:function get(){return this[o]("edges");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("edges",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("radius",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("offsetAngle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 240 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default14);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"star");},/* 241 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return c;});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(p){var h=p.angles,v=p.innerRadius,y=p.outerRadius,M=p.offsetAngle,T=Math.PI*M/180-0.5*Math.PI;if(h<3||v<=0||y<=0)return[];var m=[];for(var _x52=0;_x52<h*2;_x52++){var _l22=_x52*Math.PI/h+T,d=_x52%2?v:y,u=d*Math.cos(_l22),g=d*Math.sin(_l22);m.push(u,g);}return m;}var c=/*#__PURE__*/function(_e$default15){function c(h){var _this41;_classCallCheck(this,c);_this41=_callSuper(this,c,[h]),_this41[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this41;}// readonly
324
+ _inherits(c,_e$default15);return _createClass(c,[{key:"points",get:function get(){return _get(_getPrototypeOf(c.prototype),"points",this);},set:function set(h){}// eslint-disable-line no-empty-function
325
+ },{key:"angles",get:function get(){return this[o]("angles");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("angles",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("innerRadius",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("outerRadius",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(h){h=Object(n.toArray)(h,!0),Array.isArray(h)||(h=[h,h]),this.innerRadius=h[0],this.outerRadius=h[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(h){if(h=Object(n.toNumber)(h),this[a]("offsetAngle",h)){var v=s(this);_set(_getPrototypeOf(c.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 242 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,s;}var o=/*#__PURE__*/function(_e$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,c=_this$attributes16.radiusX,p=_this$attributes16.radiusY,h=_this$attributes16.startAngle,v=_this$attributes16.endAngle;return c>0&&p>0&&h!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return h;});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"),c=Symbol["for"]("spritejs_declareAlias");function p(v){var y=v.radiusX,M=v.radiusY,T=v.startAngle,m=v.endAngle,x=v.direction,l=v.closeType,d=x==="anitclockwise",u=new e.Figure2D();return l==="sector"&&u.moveTo(0,0),u.ellipse(0,0,y,M,0,Math.PI*T/180,Math.PI*m/180,d),l!=="none"&&u.closePath(),u.path.reduce(function(A,R){return A+R.join(" ");},"");}var h=/*#__PURE__*/function(_n$default2){function h(y){var _this42;_classCallCheck(this,h);_this42=_callSuper(this,h,[y]),_this42[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
326
+ closeType:"none"// none | sector | normal
327
+ }),_this42[c]("radius","angle");return _this42;}// readonly
328
+ _inherits(h,_n$default2);return _createClass(h,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
329
+ },{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusX",y)){var M=p(this);this[o]("d",M);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusY",y)){var M=p(this);this[o]("d",M);}}},{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 M=p(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var M=p(this);this[o]("d",M);}}},{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 M=p(this);this[o]("d",M);}}}]);}(n["default"]);},/* 244 */ /***/function(f,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,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,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(f,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 _get(_getPrototypeOf(i.prototype),"radiusX",this);},set:function set(o){o=Object(n.toNumber)(o),_set(_getPrototypeOf(i.prototype),"radiusX",o,this,true),_set(_getPrototypeOf(i.prototype),"radiusY",o,this,true);}}]);}(e["default"]);},/* 246 */ /***/function(f,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,c,p){return c in s?Object.defineProperty(s,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[c]=p,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,c=_this$attributes17.innerRadius,p=_this$attributes17.outerRadius,h=_this$attributes17.startAngle,v=_this$attributes17.endAngle;return(c>0||p>0)&&h!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return h;});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"),c=Symbol["for"]("spritejs_declareAlias");function p(v){var _ref144;var y=v.innerRadius,M=v.outerRadius,T=v.startAngle,m=v.endAngle;var x=new e.Figure2D();if(T=Math.PI*T/180,m=Math.PI*m/180,y>M&&(_ref144=[M,y],y=_ref144[0],M=_ref144[1],_ref144),y<=0&&x.moveTo(0,0),x.arc(0,0,M,T,m,!1),y>0){var u=Math.PI*2;m<T&&(m=T+u+(m-T)%u),m-T>=u&&(m=T+u-1e-6),x.arc(0,0,y,m,T,!0);}return x.closePath(),x.path.reduce(function(u,g){return u+g.join(" ");},"");}var h=/*#__PURE__*/function(_n$default3){function h(y){var _this43;_classCallCheck(this,h);_this43=_callSuper(this,h,[y]),_this43[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this43[c]("radius","angle");return _this43;}// readonly
330
+ _inherits(h,_n$default3);return _createClass(h,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
331
+ },{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("innerRadius",y)){var M=p(this);this[o]("d",M);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("outerRadius",y)){var M=p(this);this[o]("d",M);}}},{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 M=p(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var M=p(this);this[o]("d",M);}}},{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(f,r,t){t.r(r),t.d(r,"default",function(){return M;});var e=t(12),n=t(218),i=t(219),a=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(T,m,x){return m in T?Object.defineProperty(T,m,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[m]=x,T;}var c=Symbol("textImage"),p=Symbol("textImageTask"),h=Symbol("textureContext"),v=Symbol("updateTextureRect"),y=Symbol("textCanvas");var M=/*#__PURE__*/function(_i$default3){function M(){var _this44;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof m=="string"&&(m={text:m}),_this44=_callSuper(this,M,[m]);return _this44;}/* override */_inherits(M,_i$default3);return _createClass(M,[{key:"contentSize",get:function get(){var _get4=_get(_getPrototypeOf(M.prototype),"contentSize",this),_get5=_slicedToArray(_get4,2),m=_get5[0],x=_get5[1];var _this$attributes18=this.attributes,l=_this$attributes18.width,d=_this$attributes18.height;if(l==null||d==null){var u=this[c];u&&(l==null&&(m=u.rect[2]),d==null&&(x=u.rect[3]));}return[m,x];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textImage",get:function get(){return this[c]||{};}},{key:"textImageReady",get:function get(){return this[p]||Promise.resolve();}/* override */},{key:"draw",value:function draw(m){_get(_getPrototypeOf(M.prototype),"draw",this).call(this,m);var x=this.mesh;if(x){var _l23=this[c];if(_l23){var d=x.texture;if(!d||this[h]&&this[h]!==this.renderer||_l23.needsUpdate?(_l23.needsUpdate=!1,Object(n.deleteTexture)(_l23.image,this.renderer),d=Object(n.createTexture)(_l23.image,this.renderer),this[v]=!0):d=x.uniforms.u_texSampler,this[v]){var _l23$rect$slice=_l23.rect.slice(2),_l23$rect$slice2=_slicedToArray(_l23$rect$slice,2),u=_l23$rect$slice2[0],g=_l23$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),O=_this$contentSize4[0],A=_this$contentSize4[1],R=this.attributes.textAlign,b=this.attributes.verticalAlign;var E=0;R==="center"?E=(O-u)/2:(R==="right"||R==="end")&&(E=O-u);var L=this.attributes.fontSize,D=this.attributes.lineHeight;var I=0;b==="top"?I=(L-D)/2:b==="bottom"&&(I=(D-L)/2);var _this$attributes19=this.attributes,C=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,G=this.attributes.borderWidth;E+=C+G,I+=W+G;var _this$attributes20=this.attributes,K=_this$attributes20.anchorX,X=_this$attributes20.anchorY;E-=this.offsetSize[0]*K,I-=this.offsetSize[1]*X,x.setTexture(d,{rect:[E,I,u,g]}),this[v]=!1,this[h]=this.renderer;}}}return m;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,x,l){m==="text"||m==="fontSize"||m==="fontFamily"||m==="fontStyle"||m==="fontVariant"||m==="fontWeight"||m==="fontStretch"||m==="lineHeight"||m==="strokeColor"||m==="fillColor"||m==="strokeWidth"?this.updateText():((m==="textAlign"||m==="verticalAlign")&&(this[v]=!0),_get(_getPrototypeOf(M.prototype),"onPropertyChange",this).call(this,m,x,l));}/* override */},{key:"updateContours",value:function updateContours(){_get(_getPrototypeOf(M.prototype),"updateContours",this).call(this),this[v]=!0;}},{key:"updateText",value:function updateText(){var _this45=this;this[p]||(this[p]=Promise.resolve().then(function(){_this45[p]=null;var _this45$attributes=_this45.attributes,m=_this45$attributes.text,x=_this45$attributes.font,l=_this45$attributes.fillColor,d=_this45$attributes.strokeColor,u=_this45$attributes.strokeWidth,g=_this45.layer?_this45.layer.displayRatio:1;return _this45[y]=_this45[y]||e.ENV.createCanvas(1,1),_this45[c]=e.ENV.createText(m,{font:x,fillColor:l,strokeColor:d,strokeWidth:u,parseFont:e.parseFont,ratio:g,textCanvas:_this45[y]}),_this45[c].needsUpdate=!0,_this45.updateContours(),_this45.forceUpdate(),_this45[c];}));}}]);}(i["default"]);s(M,"Attr",a["default"]),o["default"].registerNode(M,"label");},/* 249 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return h;});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"),c=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_declareAlias");var h=/*#__PURE__*/function(_a$default2){function h(y){var _this46;_classCallCheck(this,h);_this46=_callSuper(this,h,[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[p]("font");return _this46;}_inherits(h,_a$default2);return _createClass(h,[{key:"text",get:function get(){return this[c]("text")||" ";},set:function set(y){this[s]("text",y);}},{key:"fontSize",get:function get(){return this[c]("fontSize");},set:function set(y){this[s]("fontSize",Object(n.toNumber)(y));}},{key:"fontFamily",get:function get(){return this[c]("fontFamily");},set:function set(y){this[s]("fontFamily",y);}},{key:"fontStyle",get:function get(){return this[c]("fontStyle");},set:function set(y){this[s]("fontStyle",y);}},{key:"fontVariant",get:function get(){return this[c]("fontVariant");},set:function set(y){this[s]("fontVariant",y);}},{key:"fontWeight",get:function get(){return this[c]("fontWeight");},set:function set(y){this[s]("fontWeight",y);}},{key:"fontStretch",get:function get(){return this[c]("fontStretch");},set:function set(y){this[s]("fontStretch",y);}},{key:"lineHeight",get:function get(){return this[c]("lineHeight")||this.fontSize;},set:function set(y){this[s]("lineHeight",Object(n.toNumber)(y));}},{key:"textAlign",get:function get(){return this[c]("textAlign");},set:function set(y){this[s]("textAlign",y);}},{key:"strokeColor",get:function get(){return this[c]("strokeColor");},set:function set(y){this[s]("strokeColor",Object(i.parseColor)(y));}},{key:"strokeWidth",get:function get(){return this[c]("strokeWidth");},set:function set(y){this[s]("strokeWidth",Object(n.toNumber)(y));}},{key:"verticalAlign",get:function get(){return this[c]("verticalAlign");},set:function set(y){this[s]("verticalAlign",y);}},{key:"fillColor",get:function get(){return this[c]("fillColor");},set:function set(y){this[s]("fillColor",Object(i.parseColor)(y));}},{key:"font",get:function get(){var y=this.fontStyle,M=this.fontVariant,T=this.fontWeight,m=this.fontStretch,x=this.fontSize,l=this.lineHeight,d=this.fontFamily;return"".concat(y," ").concat(M," ").concat(T," ").concat(m," ").concat(x,"px/").concat(l,"px ").concat(d);},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 M=Object(e.parseFont)(y);this.fontStyle=M.style,this.fontVariant=M.variant,this.fontWeight=M.weight,this.fontStretch=M.stretch,this.fontSize=Object(n.toNumber)("".concat(M.size).concat(M.unit)),M.lineHeight&&(this.lineHeight=M.pxLineHeight),this.fontFamily=M.family;}}}]);}(a["default"]);},/* 250 */ /***/function(f,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(M,T,m){return T in M?Object.defineProperty(M,T,{value:m,enumerable:!0,configurable:!0,writable:!0}):M[T]=m,M;}var c=Symbol("zOrder"),p=Symbol("ordered"),h=Symbol("children"),v=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[h]=[],_this47[p]=null,_this47[c]=0;return _this47;}_inherits(y,_n$default4);return _createClass(y,[{key:"childNodes",get:function get(){return this[h];}},{key:"children",get:function get(){return this[h];}},{key:"orderedChildren",get:function get(){return this[p]||(this[p]=_toConsumableArray(this[h]),this[p].sort(function(T,m){return T.zIndex-m.zIndex||T.zOrder-m.zOrder;})),this[p];}},{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(m){return _this48.appendChild(m);});}},{key:"appendChild",value:function appendChild(T){return T.remove(),this[h].push(T),T.connect(this,this[c]++),this[p]&&(this[p].length&&T.zIndex<this[p][this[p].length-1].zIndex?this.reorder():this[p].push(T)),T;}/* override */ // get isVisible() {
332
+ // return this.attributes.opacity > 0 && this[_children].length > 0;
333
+ // }
334
+ /* override */},{key:"cloneNode",value:function cloneNode(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var m=_get(_getPrototypeOf(y.prototype),"cloneNode",this).call(this);return T&&this[h].forEach(function(x){var l=x.cloneNode(T);m.appendChild(l);}),m;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(T){var m=this.orderedChildren;for(var _x53=m.length-1;_x53>=0;_x53--)if(m[_x53].dispatchPointerEvent(T))return!0;return _get(_getPrototypeOf(y.prototype),"dispatchPointerEvent",this).call(this,T);}/* override */},{key:"draw",value:function draw(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_get(_getPrototypeOf(y.prototype),"draw",this).call(this,T),!this[v]&&this.attributes.display!=="none"){var m=this.orderedChildren;for(var _x54=0;_x54<m.length;_x54++)m[_x54].draw(T);}return this.__cacheRenderMatrix=null,T;}},{key:"getElementById",value:function getElementById(T){return Object(o.querySelector)("#".concat(T),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(T){return Object(o.querySelectorAll)(".".concat(T),this);}},{key:"getElementsByName",value:function getElementsByName(T){return Object(o.querySelectorAll)("[name=\"".concat(T,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(T){return Object(o.querySelectorAll)(T,this);}},{key:"insertBefore",value:function insertBefore(T,m){if(m==null)return this.appendChild(T);T.remove();var x=this[h].indexOf(m);if(x<0)throw new Error("Invalid reference node.");var l=m.zOrder;for(var d=x;d<this[h].length;d++){var u=this[h][d].zOrder,g=this[h][d];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:u+1,writable:!1,configurable:!0});}if(this[h].splice(x,0,T),T.connect(this,l),this[p])if(T.zIndex!==m.zIndex)this.reorder();else{var _d7=this[p].indexOf(m);this[p].splice(_d7,0,T);}return T;}},{key:"querySelector",value:function querySelector(T){return Object(o.querySelector)(T,this);}},{key:"querySelectorAll",value:function querySelectorAll(T){return Object(o.querySelectorAll)(T,this);}},{key:"replaceChild",value:function replaceChild(T,m){T.remove();var x=this[h].indexOf(m);if(x<0)throw new Error("Invalid reference node.");if(this[h][x]=T,T.connect(this,m.zOrder),this[p])if(T.zIndex!==m.zIndex)this.reorder();else{var _l24=this[p].indexOf(m);this[p][_l24]=T;}return m.disconnect(this),T;}},{key:"removeAllChildren",value:function removeAllChildren(){var T=this[h];for(var m=T.length-1;m>=0;m--)T[m].remove();}},{key:"removeChild",value:function removeChild(T){var m=this[h].indexOf(T);if(m>=0){if(this[h].splice(m,1),this[p]){var _x55=this[p].indexOf(T);this[p].splice(_x55,1);}return T.disconnect(this),T;}return null;}},{key:"reorder",value:function reorder(){this[p]=null;}},{key:"seal",value:function seal(){function T(d,u){var g=[];for(var O=0;O<d.length;O++){var A=_toConsumableArray(d[O]);for(var R=1;R<A.length;R+=2){var b=A[R],E=A[R+1];A[R]=b*u[0]+E*u[2]+u[4],A[R+1]=b*u[1]+E*u[3]+u[5];}g.push(A);}return g;}var m=this.orderedChildren,x=new e.Figure2D(),l=this.localMatrix;for(var d=0;d<m.length;d++){var u=m[d];if(u instanceof y&&(u=u.seal()),u.clientBox){var g=u.clientBox.contours.path;g=T(g,u.localMatrix),x.addPath(g);}if(u.path){var _g7=u.path.contours.path;_g7=T(_g7,u.localMatrix),x.addPath(_g7);}}return this[v]=!0,this.clientBox=x,{clientBox:x,localMatrix:l};}/* override */},{key:"setResolution",value:function setResolution(_ref145){var T=_ref145.width,m=_ref145.height;_get(_getPrototypeOf(y.prototype),"setResolution",this).call(this,{width:T,height:m}),this[h].forEach(function(x){x.setResolution({width:T,height:m});});}/* override */},{key:"updateContours",value:function updateContours(){this[v]||_get(_getPrototypeOf(y.prototype),"updateContours",this).call(this);}}]);}(n["default"]);s(y,"Attr",i["default"]),a["default"].registerNode(y,"group");},/* 251 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_e$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_e$default20);return _createClass(n);}(e["default"]);},/* 252 */ /***/function(f,r,t){t.r(r),t.d(r,"querySelectorAll",function(){return v;}),t.d(r,"querySelector",function(){return y;}),t.d(r,"isMatched",function(){return M;}),t.d(r,"compile",function(){return T;});var e=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var i=t(253);function a(m){return m.nodeType===1||n["default"].isSpriteNode(m.nodeName);}function o(m){return Array.from(m.childNodes||[]);}function s(m){return n["default"].isSpriteNode(m.nodeName)?m.parent||m.canvas||m.container:m.parentElement;}function c(m){var x=m.length,l,d,u;for(;--x>-1;){for(l=d=m[x],m[x]=null,u=!0;d;){if(m.indexOf(d)>-1){u=!1,m.splice(x,1);break;}d=s(d);}u&&(m[x]=l);}return m;}var p={isTag:a,existsOne:function existsOne(m,x){return x.some(function(l){return a(l)?m(l)||p.existsOne(m,o(l)):!1;});},getSiblings:function getSiblings(m){var x=s(m);return x&&o(x);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(m,x){if(m.nodeType===1&&x==="class"||x==="id")return m[x];if(this.hasAttrib(m,x)){var _l25=m.attributes[x];return Array.isArray(_l25)&&(_l25="[".concat(_l25.join(),"]")),String(_l25);}},hasAttrib:function hasAttrib(m,x){return m.attributes[x]!=null;},removeSubsets:c,getName:function getName(m){return m.tagName?m.tagName.toLowerCase():null;},findOne:function m(x,l){var d=null;for(var u=0,g=l.length;u<g&&!d;u++)if(x(l[u]))d=l[u];else{var O=o(l[u]);O&&O.length>0&&(d=m(x,O));}return d;},findAll:function m(x,l){var d=[];for(var u=0,g=l.length;u<g;u++){if(!a(l[u]))continue;x(l[u])&&d.push(l[u]);var O=o(l[u]);O&&(d=d.concat(m(x,O)));}return d;},getText:function m(x){return Array.isArray(x)?x.map(m).join(""):a(x)?m(o(x)):x.nodeType===3?x.nodeValue:n["default"].isSpriteNode(x.nodeName)?x.text:"";}};function h(m){if(typeof m!="string")return m;var x=m.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return x&&(x=x.map(function(l){var d=l.slice(1,-1).split("="),u=Object(e.parseColor)(d[1].replace(/['"]/g,""));return[l,"[".concat(d[0],"=\"").concat(u,"\"]")];}),x.forEach(function(_ref146){var _ref147=_slicedToArray(_ref146,2),l=_ref147[0],d=_ref147[1];m=m.replace(l,d);})),x=m.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),x&&(x=x.map(function(l){var d=l.slice(1,-1).split("="),u=d[1].slice(2,-2).split(/,/g).map(function(g){return g.trim();});return[l,"[".concat(d[0],"=\"[").concat(u,"]\"]")];}),x.forEach(function(_ref148){var _ref149=_slicedToArray(_ref148,2),l=_ref149[0],d=_ref149[1];m=m.replace(l,d);})),m;}function v(m,x){return i.selectAll(h(m),x,{adapter:p});}function y(m,x){return i.selectOne(h(m),x,{adapter:p});}function M(m,x){return i.is(m,h(x),{adapter:p});}function T(m){return i.compile(h(m),{adapter:p});}},/* 253 */ /***/function(f,r,t){f.exports=T;var e=t(254),n=t(273).falseFunc,i=t(274);function a(m){return function(l,d,u){return d=d||{},d.adapter=d.adapter||e,m(l,d,u);};}var o=a(i),s=a(i.compileUnsafe);function c(m){return function(l,d,u){return u=u||{},u.adapter=u.adapter||e,typeof l!="function"&&(l=s(l,u,d)),l.shouldTestNextSiblings&&(d=h(u&&u.context||d,u.adapter)),Array.isArray(d)?d=u.adapter.removeSubsets(d):d=u.adapter.getChildren(d),m(l,d,u);};}function p(m,x){var l=x.getSiblings(m);if(!Array.isArray(l))return[];for(l=l.slice(0);l.shift()!==m;);return l;}function h(m,x){Array.isArray(m)||(m=[m]);for(var l=m.slice(0),d=0,u=m.length;d<u;d++){var g=p(l[d],x);l.push.apply(l,g);}return l;}var v=c(function(x,l,d){return x===n||!l||l.length===0?[]:d.adapter.findAll(x,l);}),y=c(function(x,l,d){return x===n||!l||l.length===0?null:d.adapter.findOne(x,l);});function M(m,x,l){return l=l||{},l.adapter=l.adapter||e,(typeof x=="function"?x:o(x,l))(m);}function T(m,x,l){return v(m,x,l);}T.compile=o,T.filters=i.Pseudos.filters,T.pseudos=i.Pseudos.pseudos,T.selectAll=v,T.selectOne=y,T.is=M,T.parse=o,T.iterate=v,T._compileUnsafe=s,T._compileToken=i.compileToken;},/* 254 */ /***/function(f,r,t){var e=f.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){e[i]=n[i].bind(e);});});},/* 255 */ /***/function(f,r,t){var e=t(256),n=t(257),i=e.isTag;f.exports={getInnerHTML:a,getOuterHTML:n,getText:o};function a(s,c){return s.children?s.children.map(function(p){return n(p,c);}).join(""):"";}function o(s){return Array.isArray(s)?s.map(o).join(""):i(s)?s.name==="br"?"\n":o(s.children):s.type===e.CDATA?o(s.children):s.type===e.Text?s.data:"";}},/* 256 */ /***/function(f,r){f.exports={Text:"text",//Text
335
+ Directive:"directive",//<? ... ?>
336
+ Comment:"comment",//<!-- ... -->
337
+ Script:"script",//<script> tags
338
+ Style:"style",//<style> tags
339
+ Tag:"tag",//Any tag
340
+ CDATA:"cdata",//<![CDATA[ ... ]]>
341
+ Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 */ /***/function(f,r,t){var e=t(258),n=t(259),i=t(267);i.elementNames.__proto__=null,i.attributeNames.__proto__=null;var a={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function o(m,x){if(m){var l="",d;for(var u in m)d=m[u],l&&(l+=" "),x.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),l+=u,(d!==null&&d!==""||x.xmlMode)&&(l+='="'+(x.decodeEntities?n.encodeXML(d):d.replace(/\"/g,"&quot;"))+'"');return l;}}var s={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},c=f.exports=function(m,x){!Array.isArray(m)&&!m.cheerio&&(m=[m]),x=x||{};for(var l="",d=0;d<m.length;d++){var u=m[d];u.type==="root"?l+=c(u.children,x):e.isTag(u)?l+=h(u,x):u.type===e.Directive?l+=v(u):u.type===e.Comment?l+=T(u):u.type===e.CDATA?l+=M(u):l+=y(u,x);}return l;},p=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function h(m,x){x.xmlMode==="foreign"&&(m.name=i.elementNames[m.name]||m.name,m.parent&&p.indexOf(m.parent.name)>=0&&(x=Object.assign({},x,{xmlMode:!1}))),!x.xmlMode&&["svg","math"].indexOf(m.name)>=0&&(x=Object.assign({},x,{xmlMode:"foreign"}));var l="<"+m.name,d=o(m.attribs,x);return d&&(l+=" "+d),x.xmlMode&&(!m.children||m.children.length===0)?l+="/>":(l+=">",m.children&&(l+=c(m.children,x)),(!s[m.name]||x.xmlMode)&&(l+="</"+m.name+">")),l;}function v(m){return"<"+m.data+">";}function y(m,x){var l=m.data||"";return x.decodeEntities&&!(m.parent&&m.parent.name in a)&&(l=n.encodeXML(l)),l;}function M(m){return"<![CDATA["+m.children[0].data+"]]>";}function T(m){return"<!--"+m.data+"-->";}},/* 258 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0});function e(n){return n.type==="tag"||n.type==="script"||n.type==="style";}r.isTag=e,r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype";},/* 259 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decodeStrict=r.decode=void 0;var e=t(260),n=t(266);function i(p,h){return(!h||h<=0?e.decodeXML:e.decodeHTML)(p);}r.decode=i;function a(p,h){return(!h||h<=0?e.decodeXML:e.decodeHTMLStrict)(p);}r.decodeStrict=a;function o(p,h){return(!h||h<=0?n.encodeXML:n.encodeHTML)(p);}r.encode=o;var s=t(266);Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function get(){return s.encodeXML;}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function get(){return s.escape;}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function get(){return s.encodeHTML;}});var c=t(260);Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function get(){return c.decodeXML;}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function get(){return c.decodeXML;}});},/* 260 */ /***/function(f,r,t){var e=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{"default":h};};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeHTML=r.decodeHTMLStrict=r.decodeXML=void 0;var n=e(t(261)),i=e(t(262)),a=e(t(263)),o=e(t(264));r.decodeXML=s(a["default"]),r.decodeHTMLStrict=s(n["default"]);function s(h){var v=Object.keys(h).join("|"),y=p(h);v+="|#[xX][\\da-fA-F]+|#\\d+";var M=new RegExp("&(?:"+v+");","g");return function(T){return String(T).replace(M,y);};}var c=function c(h,v){return h<v?1:-1;};r.decodeHTML=function(){for(var h=Object.keys(i["default"]).sort(c),v=Object.keys(n["default"]).sort(c),y=0,M=0;y<v.length;y++)h[M]===v[y]?(v[y]+=";?",M++):v[y]+=";";var T=new RegExp("&(?:"+v.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),m=p(n["default"]);function x(l){return l.substr(-1)!==";"&&(l+=";"),m(l);}return function(l){return String(l).replace(T,x);};}();function p(h){return function(y){if(y.charAt(1)==="#"){var M=y.charAt(2);return M==="X"||M==="x"?o["default"](parseInt(y.substr(3),16)):o["default"](parseInt(y.substr(2),10));}return h[y.slice(1,-1)];};}},/* 261 */ /***/function(f){f.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}');},/* 262 */ /***/function(f){f.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}');},/* 263 */ /***/function(f){f.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 */ /***/function(f,r,t){var e=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{"default":a};};Object.defineProperty(r,"__esModule",{value:!0});var n=e(t(265));function i(a){if(a>=55296&&a<=57343||a>1114111)return"�";a in n["default"]&&(a=n["default"][a]);var o="";return a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),o;}r["default"]=i;},/* 265 */ /***/function(f){f.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}');},/* 266 */ /***/function(f,r,t){var e=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{"default":x};};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=p(n["default"]),a=h(i);r.encodeXML=M(i,a);var o=e(t(261)),s=p(o["default"]),c=h(s);r.encodeHTML=M(s,c);function p(x){return Object.keys(x).sort().reduce(function(l,d){return l[x[d]]="&"+d+";",l;},{});}function h(x){for(var l=[],d=[],u=0,g=Object.keys(x);u<g.length;u++){var O=g[u];O.length===1?l.push("\\"+O):d.push(O);}l.sort();for(var A=0;A<l.length-1;A++){for(var R=A;R<l.length-1&&l[R].charCodeAt(1)+1===l[R+1].charCodeAt(1);)R+=1;var b=1+R-A;b<3||l.splice(A,b,l[A]+"-"+l[R]);}return d.unshift("["+l.join("")+"]"),new RegExp(d.join("|"),"g");}var v=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function y(x){return"&#x"+x.codePointAt(0).toString(16).toUpperCase()+";";}function M(x,l){return function(d){return d.replace(l,function(u){return x[u];}).replace(v,y);};}var T=h(i);function m(x){return x.replace(T,y).replace(v,y);}r.escape=m;},/* 267 */ /***/function(f){f.exports=JSON.parse('{"elementNames":{"altglyph":"altGlyph","altglyphdef":"altGlyphDef","altglyphitem":"altGlyphItem","animatecolor":"animateColor","animatemotion":"animateMotion","animatetransform":"animateTransform","clippath":"clipPath","feblend":"feBlend","fecolormatrix":"feColorMatrix","fecomponenttransfer":"feComponentTransfer","fecomposite":"feComposite","feconvolvematrix":"feConvolveMatrix","fediffuselighting":"feDiffuseLighting","fedisplacementmap":"feDisplacementMap","fedistantlight":"feDistantLight","fedropshadow":"feDropShadow","feflood":"feFlood","fefunca":"feFuncA","fefuncb":"feFuncB","fefuncg":"feFuncG","fefuncr":"feFuncR","fegaussianblur":"feGaussianBlur","feimage":"feImage","femerge":"feMerge","femergenode":"feMergeNode","femorphology":"feMorphology","feoffset":"feOffset","fepointlight":"fePointLight","fespecularlighting":"feSpecularLighting","fespotlight":"feSpotLight","fetile":"feTile","feturbulence":"feTurbulence","foreignobject":"foreignObject","glyphref":"glyphRef","lineargradient":"linearGradient","radialgradient":"radialGradient","textpath":"textPath"},"attributeNames":{"definitionurl":"definitionURL","attributename":"attributeName","attributetype":"attributeType","basefrequency":"baseFrequency","baseprofile":"baseProfile","calcmode":"calcMode","clippathunits":"clipPathUnits","diffuseconstant":"diffuseConstant","edgemode":"edgeMode","filterunits":"filterUnits","glyphref":"glyphRef","gradienttransform":"gradientTransform","gradientunits":"gradientUnits","kernelmatrix":"kernelMatrix","kernelunitlength":"kernelUnitLength","keypoints":"keyPoints","keysplines":"keySplines","keytimes":"keyTimes","lengthadjust":"lengthAdjust","limitingconeangle":"limitingConeAngle","markerheight":"markerHeight","markerunits":"markerUnits","markerwidth":"markerWidth","maskcontentunits":"maskContentUnits","maskunits":"maskUnits","numoctaves":"numOctaves","pathlength":"pathLength","patterncontentunits":"patternContentUnits","patterntransform":"patternTransform","patternunits":"patternUnits","pointsatx":"pointsAtX","pointsaty":"pointsAtY","pointsatz":"pointsAtZ","preservealpha":"preserveAlpha","preserveaspectratio":"preserveAspectRatio","primitiveunits":"primitiveUnits","refx":"refX","refy":"refY","repeatcount":"repeatCount","repeatdur":"repeatDur","requiredextensions":"requiredExtensions","requiredfeatures":"requiredFeatures","specularconstant":"specularConstant","specularexponent":"specularExponent","spreadmethod":"spreadMethod","startoffset":"startOffset","stddeviation":"stdDeviation","stitchtiles":"stitchTiles","surfacescale":"surfaceScale","systemlanguage":"systemLanguage","tablevalues":"tableValues","targetx":"targetX","targety":"targetY","textlength":"textLength","viewbox":"viewBox","viewtarget":"viewTarget","xchannelselector":"xChannelSelector","ychannelselector":"yChannelSelector","zoomandpan":"zoomAndPan"}}');},/* 268 */ /***/function(f,r){var t=r.getChildren=function(n){return n.children;},e=r.getParent=function(n){return n.parent;};r.getSiblings=function(n){var i=e(n);return i?t(i):[n];},r.getAttributeValue=function(n,i){return n.attribs&&n.attribs[i];},r.hasAttrib=function(n,i){return!!n.attribs&&hasOwnProperty.call(n.attribs,i);},r.getName=function(n){return n.name;};},/* 269 */ /***/function(f,r){r.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var e=t.parent.children;e.splice(e.lastIndexOf(t),1);}},r.replaceElement=function(t,e){var n=e.prev=t.prev;n&&(n.next=e);var i=e.next=t.next;i&&(i.prev=e);var a=e.parent=t.parent;if(a){var o=a.children;o[o.lastIndexOf(t)]=e;}},r.appendChild=function(t,e){if(e.parent=t,t.children.push(e)!==1){var n=t.children[t.children.length-2];n.next=e,e.prev=n,e.next=null;}},r.append=function(t,e){var n=t.parent,i=t.next;if(e.next=i,e.prev=t,t.next=e,e.parent=n,i){if(i.prev=e,n){var a=n.children;a.splice(a.lastIndexOf(i),0,e);}}else n&&n.children.push(e);},r.prepend=function(t,e){var n=t.parent;if(n){var i=n.children;i.splice(i.lastIndexOf(t),0,e);}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e;};},/* 270 */ /***/function(f,r,t){var e=t(256).isTag;f.exports={filter:n,find:i,findOneChild:a,findOne:o,existsOne:s,findAll:c};function n(p,h,v,y){return Array.isArray(h)||(h=[h]),(typeof y!="number"||!isFinite(y))&&(y=1/0),i(p,h,v!==!1,y);}function i(p,h,v,y){for(var M=[],T,m=0,x=h.length;m<x&&!(p(h[m])&&(M.push(h[m]),--y<=0)||(T=h[m].children,v&&T&&T.length>0&&(T=i(p,T,v,y),M=M.concat(T),y-=T.length,y<=0)));m++);return M;}function a(p,h){for(var v=0,y=h.length;v<y;v++)if(p(h[v]))return h[v];return null;}function o(p,h){for(var v=null,y=0,M=h.length;y<M&&!v;y++)if(e(h[y]))p(h[y])?v=h[y]:h[y].children.length>0&&(v=o(p,h[y].children));else continue;return v;}function s(p,h){for(var v=0,y=h.length;v<y;v++)if(e(h[v])&&(p(h[v])||h[v].children.length>0&&s(p,h[v].children)))return!0;return!1;}function c(p,h){for(var v=[],y=h.slice();y.length;){var M=y.shift();e(M)&&(M.children&&M.children.length>0&&y.unshift.apply(y,M.children),p(M)&&v.push(M));}return v;}},/* 271 */ /***/function(f,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(s,c){for(var p in s)if(s.hasOwnProperty(p)){if(p==="tag_name"){if(!n(c)||!s.tag_name(c.name))return!1;}else if(p==="tag_type"){if(!s.tag_type(c.type))return!1;}else if(p==="tag_contains"){if(n(c)||!s.tag_contains(c.data))return!1;}else if(!c.attribs||!s[p](c.attribs[p]))return!1;}return!0;};var i={tag_name:function tag_name(s){return typeof s=="function"?function(c){return n(c)&&s(c.name);}:s==="*"?n:function(c){return n(c)&&c.name===s;};},tag_type:function tag_type(s){return typeof s=="function"?function(c){return s(c.type);}:function(c){return c.type===s;};},tag_contains:function tag_contains(s){return typeof s=="function"?function(c){return!n(c)&&s(c.data);}:function(c){return!n(c)&&c.data===s;};}};function a(s,c){return typeof c=="function"?function(p){return p.attribs&&c(p.attribs[s]);}:function(p){return p.attribs&&p.attribs[s]===c;};}function o(s,c){return function(p){return s(p)||c(p);};}r.getElements=function(s,c,p,h){var v=Object.keys(s).map(function(y){var M=s[y];return y in i?i[y](M):a(y,M);});return v.length===0?[]:this.filter(v.reduce(o),c,p,h);},r.getElementById=function(s,c,p){return Array.isArray(c)||(c=[c]),this.findOne(a("id",s),c,p!==!1);},r.getElementsByTagName=function(s,c,p,h){return this.filter(i.tag_name(s),c,p,h);},r.getElementsByTagType=function(s,c,p,h){return this.filter(i.tag_type(s),c,p,h);};},/* 272 */ /***/function(f,r){r.removeSubsets=function(n){for(var i=n.length,a,o,s;--i>-1;){for(a=o=n[i],n[i]=null,s=!0;o;){if(n.indexOf(o)>-1){s=!1,n.splice(i,1);break;}o=o.parent;}s&&(n[i]=a);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},e=r.compareDocumentPosition=function(n,i){var a=[],o=[],s,c,p,h,v,y;if(n===i)return 0;for(s=n;s;)a.unshift(s),s=s.parent;for(s=i;s;)o.unshift(s),s=s.parent;for(y=0;a[y]===o[y];)y++;return y===0?t.DISCONNECTED:(c=a[y-1],p=c.children,h=a[y],v=o[y],p.indexOf(h)>p.indexOf(v)?c===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:c===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};r.uniqueSort=function(n){var i=n.length,a,o;for(n=n.slice();--i>-1;)a=n[i],o=n.indexOf(a),o>-1&&o<i&&n.splice(i,1);return n.sort(function(s,c){var p=e(s,c);return p&t.PRECEDING?-1:p&t.FOLLOWING?1:0;}),n;};},/* 273 */ /***/function(f,r){f.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 */ /***/function(f,r,t){f.exports=v;var e=t(275).parse,n=t(273),i=t(278),a=t(279),o=t(280),s=t(282),c=n.trueFunc,p=n.falseFunc,h=s.filters;function v(E,L,D){var I=M(E,L,D);return y(I,L);}function y(E,L){var D=L.adapter;return function(C){return D.isTag(C)&&E(C);};}function M(E,L,D){var I=e(E,L);return g(I,L,D);}function T(E){return E.type==="pseudo"&&(E.name==="scope"||Array.isArray(E.data)&&E.data.some(function(L){return L.some(T);}));}var m={type:"descendant"},x={type:"_flexibleDescendant"},l={type:"pseudo",name:"scope"},d={};function u(E,L,D){var I=L.adapter,C=!!D&&!!D.length&&D.every(function(W){return W===d||!!I.getParent(W);});E.forEach(function(W){if(!(W.length>0&&O(W[0])&&W[0].type!=="descendant"))if(C&&!(Array.isArray(W)?W.some(T):T(W)))W.unshift(m);else return;W.unshift(l);});}function g(E,L,D){E=E.filter(function(G){return G.length>0;}),E.forEach(i);var I=Array.isArray(D);D=L&&L.context||D,D&&!I&&(D=[D]),u(E,L,D);var C=!1,W=E.map(function(G){if(G[0]&&G[1]&&G[0].name==="scope"){var K=G[1].type;I&&K==="descendant"?G[1]=x:(K==="adjacent"||K==="sibling")&&(C=!0);}return A(G,L,D);}).reduce(R,p);return W.shouldTestNextSiblings=C,W;}function O(E){return a[E.type]<0;}function A(E,L,D){return E.reduce(function(I,C){if(I===p)return I;if(!(C.type in o))throw new Error("Rule type "+C.type+" is not supported by css-select");return o[C.type](I,C,L,D);},L&&L.rootFunc||c);}function R(E,L){return L===p||E===c?E:E===p||L===c?L:function(I){return E(I)||L(I);};}function b(E){return E.some(O);}h.not=function(E,L,D,I){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:D.adapter};if(C.strict&&(L.length>1||L.some(b)))throw new Error("complex selectors in :not aren't allowed in strict mode");var W=g(L,C,I);return W===p?E:W===c?p:function(K){return!W(K)&&E(K);};},h.has=function(E,L,D){var I=D.adapter,C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:I},W=L.some(b)?[d]:null,G=g(L,C,W);return G===p?p:G===c?function(X){return I.getChildren(X).some(I.isTag)&&E(X);}:(G=y(G,D),W?function(X){return E(X)&&(W[0]=X,I.existsOne(G,I.getChildren(X)));}:function(X){return E(X)&&I.existsOne(G,I.getChildren(X));});},h.matches=function(E,L,D,I){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),rootFunc:E,adapter:D.adapter};return g(L,C,I);},v.compileToken=g,v.compileUnsafe=M,v.Pseudos=s;},/* 275 */ /***/function(f,r,t){var e=this&&this.__createBinding||(Object.create?function(o,s,c,p){p===void 0&&(p=c),Object.defineProperty(o,p,{enumerable:!0,get:function get(){return s[c];}});}:function(o,s,c,p){p===void 0&&(p=c),o[p]=s[c];}),n=this&&this.__exportStar||function(o,s){for(var c in o)c!=="default"&&!s.hasOwnProperty(c)&&e(s,o,c);};Object.defineProperty(r,"__esModule",{value:!0}),n(t(276),r);var i=t(276);Object.defineProperty(r,"parse",{enumerable:!0,get:function get(){return i["default"];}});var a=t(277);Object.defineProperty(r,"stringify",{enumerable:!0,get:function get(){return a["default"];}});},/* 276 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=T;var e=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,a={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},s={"#":["id","equals"],".":["class","element"]},c=/* @__PURE__ */new Set(["has","not","matches"]),p=/* @__PURE__ */new Set(["contains","icontains"]),h=/* @__PURE__ */new Set(['"',"'"]);function v(l,d,u){var g=parseInt(d,16)-65536;return g!==g||u?d:g<0?// BMP codepoint
342
+ String.fromCharCode(g+65536):// Supplemental Plane codepoint (surrogate pair)
343
+ String.fromCharCode(g>>10|55296,g&1023|56320);}function y(l){return l.replace(n,v);}function M(l){return l===" "||l==="\n"||l===" "||l==="\f"||l==="\r";}function T(l,d){var u=[];if(l=m(u,""+l,d),l!=="")throw new Error("Unmatched selector: "+l);return u;}function m(l,d,u){var g=[],O=!1;function A(){var Q=d.match(e);if(!Q)throw new Error("Expected name, found "+d);var et=Q[0];return d=d.substr(et.length),y(et);}function R(Q){for(;M(d.charAt(Q));)Q++;d=d.substr(Q);}function b(Q){for(var et=0;d.charAt(--Q)==="\\";)et++;return(et&1)===1;}for(R(0);d!=="";){var E=d.charAt(0);if(M(E))O=!0,R(1);else if(E in o)g.push({type:o[E]}),O=!1,R(1);else if(E===","){if(g.length===0)throw new Error("Empty sub-selector");l.push(g),g=[],O=!1,R(1);}else if(O&&(g.length>0&&g.push({type:"descendant"}),O=!1),E==="*")d=d.substr(1),g.push({type:"universal"});else if(E in s){var L=s[E],D=L[0],I=L[1];d=d.substr(1),g.push({type:"attribute",name:D,action:I,value:A(),ignoreCase:!1});}else if(E==="["){d=d.substr(1);var C=d.match(i);if(!C)throw new Error("Malformed attribute selector: "+d);d=d.substr(C[0].length);var W=y(C[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),g.push({type:"attribute",name:W,action:a[C[2]],value:y(C[4]||C[5]||""),ignoreCase:!!C[6]});}else if(E===":"){if(d.charAt(1)===":"){d=d.substr(2),g.push({type:"pseudo-element",name:A().toLowerCase()});continue;}d=d.substr(1);var G=A().toLowerCase(),C=null;if(d.charAt(0)==="(")if(c.has(G)){var K=d.charAt(1),X=h.has(K);if(d=d.substr(X?2:1),C=[],d=m(C,d,u),X){if(d.charAt(0)!==K)throw new Error("Unmatched quotes in :"+G);d=d.substr(1);}if(d.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+G+" ("+d+")");d=d.substr(1);}else{for(var Z=1,B=1;B>0&&Z<d.length;Z++)d.charAt(Z)==="("&&!b(Z)?B++:d.charAt(Z)===")"&&!b(Z)&&B--;if(B)throw new Error("Parenthesis not matched");if(C=d.substr(1,Z-2),d=d.substr(Z),p.has(G)){var K=C.charAt(0);K===C.slice(-1)&&h.has(K)&&(C=C.slice(1,-1)),C=y(C);}}g.push({type:"pseudo",name:G,data:C});}else if(e.test(d)){var z=A();(!u||("lowerCaseTags"in u?u.lowerCaseTags:!u.xmlMode))&&(z=z.toLowerCase()),g.push({type:"tag",name:z});}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),x(l,g),d;}return x(l,g),d;}function x(l,d){if(l.length>0&&d.length===0)throw new Error("Empty sub-selector");l.push(d);}},/* 277 */ /***/function(f,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(s){return s.map(i).join(", ");}r["default"]=n;function i(s){return s.map(a).join("");}function a(s){switch(s.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return s.name;case"pseudo-element":return"::"+s.name;case"pseudo":return s.data===null?":"+s.name:typeof s.data=="string"?":"+s.name+"("+s.data+")":":"+s.name+"("+n(s.data)+")";case"attribute":return s.action==="exists"?"["+s.name+"]":s.name==="id"&&s.action==="equals"&&!s.ignoreCase?"#"+s.value:s.name==="class"&&s.action==="element"&&!s.ignoreCase?"."+s.value:"["+s.name+e[s.action]+"='"+s.value+"'"+(s.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(s){return s;}},/* 278 */ /***/function(f,r,t){f.exports=i;var e=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function i(o){for(var s=o.map(a),c=1;c<o.length;c++){var p=s[c];if(!(p<0))for(var h=c-1;h>=0&&p<s[h];h--){var v=o[h+1];o[h+1]=o[h],o[h]=v,s[h+1]=s[h],s[h]=p;}}}function a(o){var s=e[o.type];if(s===e.attribute)s=n[o.action],s===n.equals&&o.name==="id"&&(s=9),o.ignoreCase&&(s>>=1);else if(s===e.pseudo)if(!o.data)s=3;else if(o.name==="has"||o.name==="contains")s=0;else if(o.name==="matches"||o.name==="not"){s=0;for(var c=0;c<o.data.length;c++)if(o.data[c].length===1){var p=a(o.data[c][0]);if(p===0){s=0;break;}p>s&&(s=p);}o.data.length>1&&s>0&&(s-=1);}else s=1;return s;}},/* 279 */ /***/function(f){f.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 */ /***/function(f,r,t){var e=t(281),n=t(282);f.exports={__proto__:null,attribute:e.compile,pseudo:n.compile,//tags
344
+ tag:function tag(i,a,o){var s=a.name,c=o.adapter;return function(h){return c.getName(h)===s&&i(h);};},//traversal
345
+ descendant:function descendant(i,a,o){var s=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,c=o.adapter;return function(h){for(var v=!1;!v&&(h=c.getParent(h));)(!s||!s.has(h))&&(v=i(h),!v&&s&&s.add(h));return v;};},_flexibleDescendant:function _flexibleDescendant(i,a,o){var s=o.adapter;return function(p){for(var h=i(p);!h&&(p=s.getParent(p));)h=i(p);return h;};},parent:function parent(i,a,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var s=o.adapter;return function(h){return s.getChildren(h).some(c);};function c(p){return s.isTag(p)&&i(p);}},child:function child(i,a,o){var s=o.adapter;return function(p){var h=s.getParent(p);return!!h&&i(h);};},sibling:function sibling(i,a,o){var s=o.adapter;return function(p){for(var h=s.getSiblings(p),v=0;v<h.length;v++)if(s.isTag(h[v])){if(h[v]===p)break;if(i(h[v]))return!0;}return!1;};},adjacent:function adjacent(i,a,o){var s=o.adapter;return function(p){for(var h=s.getSiblings(p),v,y=0;y<h.length;y++)if(s.isTag(h[y])){if(h[y]===p)break;v=h[y];}return!!v&&i(v);};},universal:function universal(i){return i;}};},/* 281 */ /***/function(f,r,t){var e=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(a,o,s){var c=o.name,p=o.value,h=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(y){var M=h.getAttributeValue(y,c);return M!=null&&M.toLowerCase()===p&&a(y);}):function(y){return h.getAttributeValue(y,c)===p&&a(y);};},hyphen:function hyphen(a,o,s){var c=o.name,p=o.value,h=p.length,v=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(M){var T=v.getAttributeValue(M,c);return T!=null&&(T.length===h||T.charAt(h)==="-")&&T.substr(0,h).toLowerCase()===p&&a(M);}):function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(0,h)===p&&(T.length===h||T.charAt(h)==="-")&&a(M);};},element:function element(a,o,s){var c=o.name,p=o.value,h=s.adapter;if(/\s/.test(p))return e;p=p.replace(n,"\\$&");var v="(?:^|\\s)"+p+"(?:$|\\s)",y=o.ignoreCase?"i":"",M=new RegExp(v,y);return function(m){var x=h.getAttributeValue(m,c);return x!=null&&M.test(x)&&a(m);};},exists:function exists(a,o,s){var c=o.name,p=s.adapter;return function(v){return p.hasAttrib(v,c)&&a(v);};},start:function start(a,o,s){var c=o.name,p=o.value,h=p.length,v=s.adapter;return h===0?e:o.ignoreCase?(p=p.toLowerCase(),function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(0,h).toLowerCase()===p&&a(M);}):function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(0,h)===p&&a(M);};},end:function end(a,o,s){var c=o.name,p=o.value,h=-p.length,v=s.adapter;return h===0?e:o.ignoreCase?(p=p.toLowerCase(),function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(h).toLowerCase()===p&&a(M);}):function(M){var T=v.getAttributeValue(M,c);return T!=null&&T.substr(h)===p&&a(M);};},any:function any(a,o,s){var c=o.name,p=o.value,h=s.adapter;if(p==="")return e;if(o.ignoreCase){var v=new RegExp(p.replace(n,"\\$&"),"i");return function(M){var T=h.getAttributeValue(M,c);return T!=null&&v.test(T)&&a(M);};}return function(M){var T=h.getAttributeValue(M,c);return T!=null&&T.indexOf(p)>=0&&a(M);};},not:function not(a,o,s){var c=o.name,p=o.value,h=s.adapter;return p===""?function(y){return!!h.getAttributeValue(y,c)&&a(y);}:o.ignoreCase?(p=p.toLowerCase(),function(y){var M=h.getAttributeValue(y,c);return M!=null&&M.toLowerCase()!==p&&a(y);}):function(y){return h.getAttributeValue(y,c)!==p&&a(y);};}};f.exports={compile:function compile(a,o,s){if(s&&s.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return i[o.action](a,o,s);},rules:i};},/* 282 */ /***/function(f,r,t){var e=t(283),n=t(273),i=t(281),a=n.trueFunc,o=n.falseFunc,s=i.rules.equals;function c(x,l){var d={name:x,value:l};return function(g,O,A){return s(g,d,A);};}function p(x,l){return function(d){return!!l.getParent(d)&&x(d);};}var h={contains:function contains(x,l,d){var u=d.adapter;return function(O){return x(O)&&u.getText(O).indexOf(l)>=0;};},icontains:function icontains(x,l,d){var u=l.toLowerCase(),g=d.adapter;return function(A){return x(A)&&g.getText(A).toLowerCase().indexOf(u)>=0;};},//location specific methods
346
+ "nth-child":function nthChild(x,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,E=0;b<R.length;b++)if(g.isTag(R[b])){if(R[b]===A)break;E++;}return u(E)&&x(A);};},"nth-last-child":function nthLastChild(x,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,E=R.length-1;E>=0;E--)if(g.isTag(R[E])){if(R[E]===A)break;b++;}return u(b)&&x(A);};},"nth-of-type":function nthOfType(x,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,E=0;E<R.length;E++)if(g.isTag(R[E])){if(R[E]===A)break;g.getName(R[E])===g.getName(A)&&b++;}return u(b)&&x(A);};},"nth-last-of-type":function nthLastOfType(x,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(x,g):function(A){for(var R=g.getSiblings(A),b=0,E=R.length-1;E>=0;E--)if(g.isTag(R[E])){if(R[E]===A)break;g.getName(R[E])===g.getName(A)&&b++;}return u(b)&&x(A);};},//TODO determine the actual root element
347
+ root:function root(x,l,d){var u=d.adapter;return function(g){return!u.getParent(g)&&x(g);};},scope:function scope(x,l,d,u){var g=d.adapter;if(!u||u.length===0)return h.root(x,l,d);function O(A,R){return typeof g.equals=="function"?g.equals(A,R):A===R;}return u.length===1?function(A){return O(u[0],A)&&x(A);}:function(A){return u.indexOf(A)>=0&&x(A);};},//jQuery extensions (others follow as pseudos)
348
+ checkbox:c("type","checkbox"),file:c("type","file"),password:c("type","password"),radio:c("type","radio"),reset:c("type","reset"),image:c("type","image"),submit:c("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
349
+ hover:function hover(x,l,d){var u=d.adapter;return typeof u.isHovered=="function"?function(O){return x(O)&&u.isHovered(O);}:o;},visited:function visited(x,l,d){var u=d.adapter;return typeof u.isVisited=="function"?function(O){return x(O)&&u.isVisited(O);}:o;},active:function active(x,l,d){var u=d.adapter;return typeof u.isActive=="function"?function(O){return x(O)&&u.isActive(O);}:o;}};function v(x,l){for(var d=0;x&&d<x.length;d++)if(l.isTag(x[d]))return x[d];}var y={empty:function empty(x,l){return!l.getChildren(x).some(function(d){return l.isTag(d)||d.type==="text";});},"first-child":function firstChild(x,l){return v(l.getSiblings(x),l)===x;},"last-child":function lastChild(x,l){for(var d=l.getSiblings(x),u=d.length-1;u>=0;u--){if(d[u]===x)return!0;if(l.isTag(d[u]))break;}return!1;},"first-of-type":function firstOfType(x,l){for(var d=l.getSiblings(x),u=0;u<d.length;u++)if(l.isTag(d[u])){if(d[u]===x)return!0;if(l.getName(d[u])===l.getName(x))break;}return!1;},"last-of-type":function lastOfType(x,l){for(var d=l.getSiblings(x),u=d.length-1;u>=0;u--)if(l.isTag(d[u])){if(d[u]===x)return!0;if(l.getName(d[u])===l.getName(x))break;}return!1;},"only-of-type":function onlyOfType(x,l){for(var d=l.getSiblings(x),u=0,g=d.length;u<g;u++)if(l.isTag(d[u])){if(d[u]===x)continue;if(l.getName(d[u])===l.getName(x))return!1;}return!0;},"only-child":function onlyChild(x,l){for(var d=l.getSiblings(x),u=0;u<d.length;u++)if(l.isTag(d[u])&&d[u]!==x)return!1;return!0;},//:matches(a, area, link)[href]
350
+ link:function link(x,l){return l.hasAttrib(x,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
351
+ //forms
352
+ //to consider: :target
353
+ //:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
354
+ selected:function selected(x,l){if(l.hasAttrib(x,"selected"))return!0;if(l.getName(x)!=="option")return!1;var d=l.getParent(x);if(!d||l.getName(d)!=="select"||l.hasAttrib(d,"multiple"))return!1;for(var u=l.getChildren(d),g=!1,O=0;O<u.length;O++)if(l.isTag(u[O]))if(u[O]===x)g=!0;else if(g){if(l.hasAttrib(u[O],"selected"))return!1;}else return!1;return g;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
355
+ //:matches(
356
+ // :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
357
+ // optgroup[disabled] > option),
358
+ // fieldset[disabled] * //TODO not child of first <legend>
359
+ //)
360
+ disabled:function disabled(x,l){return l.hasAttrib(x,"disabled");},enabled:function enabled(x,l){return!l.hasAttrib(x,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
361
+ checked:function checked(x,l){return l.hasAttrib(x,"checked")||y.selected(x,l);},//:matches(input, select, textarea)[required]
362
+ required:function required(x,l){return l.hasAttrib(x,"required");},//:matches(input, select, textarea):not([required])
363
+ optional:function optional(x,l){return!l.hasAttrib(x,"required");},//jQuery extensions
364
+ //:not(:empty)
365
+ parent:function parent(x,l){return!y.empty(x,l);},//:matches(h1, h2, h3, h4, h5, h6)
366
+ header:M(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
367
+ button:function button(x,l){var d=l.getName(x);return d==="button"||d==="input"&&l.getAttributeValue(x,"type")==="button";},//:matches(input, textarea, select, button)
368
+ input:M(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
369
+ text:function text(x,l){var d;return l.getName(x)==="input"&&(!(d=l.getAttributeValue(x,"type"))||d.toLowerCase()==="text");}};function M(x){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var l=new Set(x);return function(d,u){return l.has(u.getName(d));};}return function(d,u){return x.indexOf(u.getName(d))>=0;};}function T(x,l,d){if(d===null){if(x.length>2&&l!=="scope")throw new Error("pseudo-selector :"+l+" requires an argument");}else if(x.length===2)throw new Error("pseudo-selector :"+l+" doesn't have any arguments");}var m=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;f.exports={compile:function compile(x,l,d,u){var g=l.name,O=l.data,A=d.adapter;if(d&&d.strict&&!m.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof h[g]=="function")return h[g](x,O,d,u);if(typeof y[g]=="function"){var R=y[g];return T(R,g,O),R===o?R:x===a?function(E){return R(E,A,O);}:function(E){return R(E,A,O)&&x(E);};}else throw new Error("unmatched pseudo-class :"+g);},filters:h,pseudos:y};},/* 283 */ /***/function(f,r,t){var e=t(284),n=t(285);f.exports=function(a){return n(e(a));},f.exports.parse=e,f.exports.compile=n;},/* 284 */ /***/function(f,r){f.exports=e;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function e(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var a;return i[1]?(a=parseInt(i[1],10),isNaN(a)&&(i[1].charAt(0)==="-"?a=-1:a=1)):a=0,[a,i[3]?parseInt((i[2]||"")+i[3],10):0];}},/* 285 */ /***/function(f,r,t){f.exports=a;var e=t(273),n=e.trueFunc,i=e.falseFunc;function a(o){var s=o[0],c=o[1]-1;if(c<0&&s<=0)return i;if(s===-1)return function(h){return h<=c;};if(s===0)return function(h){return h===c;};if(s===1)return c<0?n:function(h){return h>=c;};var p=c%s;return p<0&&(p+=s),s>1?function(h){return h>=c&&h%s===p;}:(s*=-1,function(h){return h<=c&&h%s===p;});}},/* 286 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return O;});var e=t(12),n=t(74),i=t(1),a=t(68),o=t(250),s=t(213),c=t(218);t(1).glMatrix.setMatrixArrayType(Array);function p(A,R){if(A==null)return{};var b=h(A,R),E,L;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(A);for(L=0;L<D.length;L++)E=D[L],!(R.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(A,E)&&(b[E]=A[E]);}return b;}function h(A,R){if(A==null)return{};var b={},E=Object.keys(A),L,D;for(D=0;D<E.length;D++)L=E[D],!(R.indexOf(L)>=0)&&(b[L]=A[L]);return b;}var v={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
370
+ },y=Symbol("autoRender"),M=Symbol("renderer"),T=Symbol("timeline"),m=Symbol("prepareRender"),x=Symbol("tickRender"),l=Symbol("pass"),d=Symbol("fbo"),u=Symbol("tickers"),g=Symbol("layerTransformInvert");var O=/*#__PURE__*/function(_o$default){function O(){var _this49;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this49=_callSuper(this,O),!R.canvas){var _this49$getResolution=_this49.getResolution(),D=_this49$getResolution.width,I=_this49$getResolution.height,C=e.ENV.createCanvas(D,I,{offscreen:!!R.offscreen,id:R.id,extra:R.extra});C.style&&(C.style.position="absolute"),C.dataset&&(C.dataset.layerId=R.id),C.contextType&&(R.contextType=C.contextType),R.canvas=C;}var b=R.canvas,E=Object.assign({},v,R);_this49[y]=E.autoRender,delete R.autoRender;var L=E.Renderer||e.Renderer;_this49[M]=new L(b,E),_this49.options=R,_this49.id=R.id,_this49[l]=[],_this49.setResolution(b),_this49.canvas=b,_this49[T]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[g]=null;return _assertThisInitialized(_this49);}_inherits(O,_o$default);return _createClass(O,[{key:"autoRender",get:function get(){return this[y];}},{key:"displayRatio",get:function get(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1;}},{key:"height",get:function get(){var _this$getResolution=this.getResolution(),R=_this$getResolution.height;return R/this.displayRatio;}},{key:"gl",get:function get(){return this.renderer.glRenderer?this.renderer.glRenderer.gl:null;}/* override */},{key:"layer",get:function get(){return this;}},{key:"offscreen",get:function get(){return!!this.options.offscreen||this.canvas._offscreen;}},{key:"pass",get:function get(){return this[l];}},{key:"prepareRender",get:function get(){return this[m]?this[m]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[M];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,R=_this$parent$options.left,b=_this$parent$options.top;return[R,b];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[T];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),R=_this$getResolution2.width;return R/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,R=_this$attributes21.x,b=_this$attributes21.y;return[1,0,0,1,R,b];}},{key:"layerTransformInvert",get:function get(){if(this[g])return this[g];var R=this.transformMatrix;return R[0]===1&&R[1]===0&&R[2]===0&&R[3]===1&&R[4]===0&&R[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),R),this[g]);}},{key:"forceContextLoss",value:function forceContextLoss(){var R=this.renderer.glRenderer;if(R){var b=R.getExtension("WEBGL_lose_context");if(b)return b.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
371
+ // return true;
372
+ // }
373
+ },{key:"addPass",value:function addPass(){var _ref150=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref150.vertex,b=_ref150.fragment,E=_ref150.options,L=_ref150.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),D=_this$getResolution3.width,I=_this$getResolution3.height,C=this.renderer.createPassProgram({vertex:R,fragment:b,options:E}),W=new e.Figure2D();W.rect(0,0,D/this.displayRatio,I/this.displayRatio);var G=new e.Mesh2D(W);return G.setUniforms(L),G.setProgram(C),this[l].push(G),this.forceUpdate(),G;}return null;}// delete unused texture to release memory.
374
+ },{key:"deleteTexture",value:function deleteTexture(R){return Object(c.deleteTexture)(R,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(R){var b=R.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){var C=this.__mouseCapturedTarget;if(C){if(C.layer===this)return C.dispatchEvent(R),!0;this.__mouseCapturedTarget=null;}}var E,L;var D=this.layerTransformInvert;if(D){E=R.x,L=R.y;var _C6=D,W=_C6[0]*E+_C6[2]*L+_C6[4],G=_C6[1]*E+_C6[3]*L+_C6[5];delete R.x,delete R.y,delete R.layerX,delete R.layerY,Object.defineProperties(R,{layerX:{value:W,configurable:!0},layerY:{value:G,configurable:!0},x:{value:W,configurable:!0},y:{value:G,configurable:!0}});}var I=_get(_getPrototypeOf(O.prototype),"dispatchPointerEvent",this).call(this,R);return D&&Object.defineProperties(R,{layerX:{value:E,configurable:!0},layerY:{value:L,configurable:!0},x:{value:E,configurable:!0},y:{value:L,configurable:!0}}),I;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this50=this;if(!this[m])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var R=null;var b=new Promise(function(E){R=E;});b._resolve=R,this[m]=b;}else{var _R2=null,_b8=null;var E=new Promise(function(L){_R2=L,_this50[y]&&(_b8=Object(a.requestAnimationFrame)(function(){delete E._requestID,_this50.render();}));});E._resolve=_R2,E._requestID=_b8,this[m]=E;}}},{key:"getFBO",value:function getFBO(){var R=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),b=_this$getResolution4.width,E=_this$getResolution4.height;return R&&(!this[d]||this[d].width!==b||this[d].height!==E)?(this[d]={width:b,height:E,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref151=[this.buffer,this.target];this.target=_ref151[0];this.buffer=_ref151[1];}},this[d]):this[d]?this[d]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var R=this.renderer,b=R.__globalTransformMatrix||R.globalTransformMatrix;R.__globalTransformMatrix=b;var E=i.mat2d.fromValues(1,0,0,1,0,0);R.setGlobalTransform.apply(R,_toConsumableArray(i.mat2d.multiply(E,b,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(R,b,E){if(_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,R,b,E),R==="zIndex"&&(this.canvas.style.zIndex=b),R==="transform"||R==="translate"||R==="rotate"||R==="scale"||R==="skew"){var L=this[g];if(this[g]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){var D=this.renderer,I=D.__globalTransformMatrix||D.globalTransformMatrix;D.setGlobalTransform.apply(D,_toConsumableArray(I));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[m]&&(this[m]._requestID&&Object(a.cancelAnimationFrame)(this[m]._requestID),this[m]._resolve(),delete this[m]);}},{key:"render",value:function render(){var _this51=this;var _ref152=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref152$clear=_ref152.clear,R=_ref152$clear===void 0?!0:_ref152$clear;var b=this[l].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),R&&this[M].clear();var E=this.draw();if(E&&E.length&&(this.renderer.drawMeshes(E),this.canvas.draw&&this.canvas.draw()),b){var L=this.renderer.glRenderer,D=this[l].length,_this$getResolution5=this.getResolution(),I=_this$getResolution5.width,C=_this$getResolution5.height,W=[0,0,I/this.displayRatio,C/this.displayRatio];this[l].forEach(function(G,K){G.blend=!0,G.setTexture(b.target.texture,{rect:W}),K===D-1?L.bindFBO(null):(b.swap(),L.bindFBO(b.target)),_this51[M].clear(),_this51.renderer.drawMeshes([G]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref153){var _this52=this;var R=_ref153.width,b=_ref153.height;var E=this.renderer,L=E.__globalTransformMatrix||E.globalTransformMatrix,D=L[4],I=L[5],C=L[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,G=_this$getResolution6.height;(W!==R||G!==b)&&(_get(_getPrototypeOf(O.prototype),"setResolution",this).call(this,{width:R,height:b}),this.canvas&&(this.canvas.width=R,this.canvas.height=b,E.updateResolution&&E.updateResolution()),this.attributes.size=[R,b],this[l].length&&this[l].forEach(function(B){var z=new e.Figure2D();z.rect(0,0,R/_this52.displayRatio,b/_this52.displayRatio),B.contours=z.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),K=_this$renderOffset[0],X=_this$renderOffset[1],Z=this.displayRatio;(D!==K||I!==X||C!==Z)&&(E.setGlobalTransform(Z,0,0,Z,K,X),E.__globalTransformMatrix=null,this[g]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
375
+ * tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
376
+ * @param {*} handler
377
+ * @param {*} options
378
+ */},{key:"tick",value:function tick(){var _this53=this;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _b$duration=b.duration,E=_b$duration===void 0?1/0:_b$duration,L=p(b,["duration"]);var D=this.timeline.fork(L),I=this;this[u]=this[u]||[],this[u].push({handler:R,duration:E});var C=function C(){var W=null,G=null;var K=function K(){var X=_this53[u].map(function(_ref154){var Z=_ref154.handler,B=_ref154.duration;var z=Math.min(1,D.currentTime/B);return{value:Z?Z(D.currentTime,z):null,p:z};});I[x]||(I[x]=Promise.resolve().then(function(){I[y]&&I.render(),delete I[x];for(var Z=X.length-1;Z>=0;Z--){var _X$Z=X[Z],B=_X$Z.value,z=_X$Z.p;(B===!1||z>=1)&&_this53[u].splice(Z,1);}_this53[u].length>0&&C();}));};if(_this53[m]&&_this53[m]._type!=="ticker"&&(Object(a.cancelAnimationFrame)(_this53[m]._requestID),delete _this53[m]),!_this53[m]){var X=new Promise(function(Z){W=Z,G=Object(a.requestAnimationFrame)(K);});X._resolve=W,X._requestID=G,X._type="ticker",_this53[m]=X;}};C();}},{key:"toGlobalPos",value:function toGlobalPos(R,b){if(this.layerTransformInvert){var W=this.transformMatrix;R=W[0]*R+W[2]*b+W[4],b=W[1]*R+W[3]*b+W[5];}var _this$getResolution7=this.getResolution(),E=_this$getResolution7.width,L=_this$getResolution7.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*I[0]/E+D[0],b=b*I[1]/L+D[1];var C=this.displayRatio;return R*=C,b*=C,[R,b];}},{key:"toLocalPos",value:function toLocalPos(R,b){var _this$getResolution8=this.getResolution(),E=_this$getResolution8.width,L=_this$getResolution8.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*E/I[0]-D[0],b=b*L/I[1]-D[1];var C=this.displayRatio;R/=C,b/=C;var W=this.layerTransformInvert;return W&&(R=W[0]*R+W[2]*b+W[4],b=W[1]*R+W[3]*b+W[5]),[R,b];}}]);}(o["default"]);s["default"].registerNode(O,"layer");},/* 287 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return m;});var e=t(224),n=t(288),i=t(213),a=t(252),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(x,l){if(x==null)return{};var d=c(x,l),u,g;if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(x);for(g=0;g<O.length;g++)u=O[g],!(l.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(x,u)&&(d[u]=x[u]);}return d;}function c(x,l){if(x==null)return{};var d={},u=Object.keys(x),g,O;for(O=0;O<u.length;O++)g=u[O],!(l.indexOf(g)>=0)&&(d[g]=x[g]);return d;}function p(x,l,d){return l in x?Object.defineProperty(x,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):x[l]=d,x;}var h="http://www.w3.org/2000/svg",v=Symbol["for"]("spritejs_setAttribute"),y=Symbol("root"),M=Symbol("task");function T(x){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var d=x[y];if(d&&d.children[0]){var u=x.svg,g=x.layer?x.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){var R=u.getAttribute("width");R=R?Object(o.sizeToPixel)(R):300;var b=u.getAttribute("height");b=b?Object(o.sizeToPixel)(b):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox","0 0 ".concat(Math.round(R)," ").concat(Math.round(b))),u.setAttribute("data-original-width",R),u.setAttribute("data-original-height",b);}var O=x.attributes.width||Number(u.getAttribute("data-original-width")),A=x.attributes.height||Number(u.getAttribute("data-original-height"));if(O*=g,A*=g,l&&x.attributes.flexible){var _R3=x.attributes.scale[0];if(O*=_R3,A*=_R3,u.setAttribute("width",O),u.setAttribute("height",A),O&&A&&x.textureImage){var _b9=x.textureImage.width,E=x.textureImage.height,L=x.clientSize;x.attributes.textureRect=[0,0,Math.round(L[0]*_b9/O),Math.round(L[1]*E/A)];}}else x[M]||(u.setAttribute("width",O),u.setAttribute("height",A),x[M]=Promise.resolve().then(function(){delete x[M];var R=d.innerHTML,b=new Blob([R],{type:"image/svg+xml"}),E=URL.createObjectURL(b),L=new Image();L.onload=function(){L.width&&L.height?(x.attributes[v]("texture",L),x.attributes.flexible&&(x.attributes.textureRect=null)):x.attributes[v]("texture",null);},L.src=E;}));}}var m=/*#__PURE__*/function(_e$default21){function m(){var _this54;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,m);typeof l=="string"&&(l={svgText:l});var _l26=l,d=_l26.svgText,u=s(l,["svgText"]);if(_this54=_callSuper(this,m,[u]),_this54[y]=document.createElement("div"),d){_this54[y].innerHTML=d;var g=_this54[y].children[0];g?g.setAttribute("xmlns",h):(fetch(d).then(function(O){return O.text();}).then(function(O){_this54[y].innerHTML=O,(!_this54.observer||_this54.attributes.flexible)&&T(_assertThisInitialized(_this54));}),d=null);}if(!d){var _g8=document.createElementNS(h,"svg");_g8.setAttribute("xmlns",h),_this54[y].appendChild(_g8);}if(typeof MutationObserver=="function"){var _g9=new MutationObserver(function(O){T(_assertThisInitialized(_this54),!1);});_g9.observe(_this54[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_g9;}return _assertThisInitialized(_this54);}_inherits(m,_e$default21);return _createClass(m,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[y]?this[y].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref155){var l=_ref155.width,d=_ref155.height;_get(_getPrototypeOf(m.prototype),"setResolution",this).call(this,{width:l,height:d}),T(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(l){var d=_get(_getPrototypeOf(m.prototype),"dispatchPointerEvent",this).call(this,l);if(d&&this.attributes.passEvents&&typeof MouseEvent=="function"){var u=l.x,g=l.y;var _this$getOffsetPositi=this.getOffsetPosition(u,g),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),O=_this$getOffsetPositi2[0],A=_this$getOffsetPositi2[1];var R=l.originalEvent,b=this.attributes.anchor,E=this.clientSize;O=(O+b[0]*E[0])/2,A=(A+b[1]*E[1])/2;var L=l.type;if(L===R.type){var D=null;if(R instanceof MouseEvent)D=new MouseEvent(L,{screenX:O,screenY:A,clientX:O,clientY:A,bubbles:R.bubbles,button:R.button,buttons:R.buttons,cancelBubble:R.cancelBubble,cancelable:R.cancelable,currentTarget:R.currentTarget,fromElement:R.fromElement,relatedTarget:R.relatedTarget,returnValue:R.returnValue,srcElement:R.srcElement,target:R.target,toElement:R.toElement,// view: originalEvent.view,
379
+ which:R.witch});else if(R instanceof TouchEvent){var I=null;var C=R.changedTouches||[R];for(var W=0;W<C.length;W++){var G=C[W];if(l.identifier===G.identifier){I=G;break;}}if(I){var _W3=new Touch({identifier:I.identifier,target:I.target,clientX:O,clientY:A,screenX:O,screenY:A,pageX:O,pageY:A,radiusX:I.radiusX,radiusY:I.radiusY,rotationAngle:I.rotationAngle,force:I.force});D=new TouchEvent(L,{cancelable:R.cancelable,bubbles:R.bubbles,composed:R.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else D=R;D&&this.svg.dispatchEvent(D);}}return d;}},{key:"getElementById",value:function getElementById(l){return Object(a.querySelector)("#".concat(l),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(l){return Object(a.querySelectorAll)(".".concat(l),this);}},{key:"getElementsByName",value:function getElementsByName(l){return Object(a.querySelectorAll)("[name=\"".concat(l,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(l){return Object(a.querySelectorAll)(l,this);}},{key:"querySelector",value:function querySelector(l){return Object(a.querySelector)(l,this);}},{key:"querySelectorAll",value:function querySelectorAll(l){return Object(a.querySelectorAll)(l,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(l,d,u){_get(_getPrototypeOf(m.prototype),"onPropertyChange",this).call(this,l,d,u),l==="flexible"&&T(this),this.attributes.flexible&&(l==="width"||l==="height"||l==="scale"||l==="transform")&&T(this);}}]);}(e["default"]);p(m,"Attr",n["default"]),i["default"].registerNode(m,"spritesvg");},/* 288 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault");var o=/*#__PURE__*/function(_e$default22){function o(c){var _this55;_classCallCheck(this,o);_this55=_callSuper(this,o,[c]),_this55[a]({passEvents:!1,flexible:!1});return _this55;}// readonly
380
+ _inherits(o,_e$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(c){}// eslint-disable-line no-empty-function
381
+ },{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(c){return this[i]("passEvents",c);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(c){return this[i]("flexible",c);}}]);}(e["default"]);},/* 289 */ /***/function(f,r,t){t.r(r);var e=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(c,p){var h=Object.keys(c);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(c);p&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable;})),h.push.apply(h,v);}return h;}function i(c){for(var p=1;p<arguments.length;p++){var h=arguments[p]!=null?arguments[p]:{};p%2?n(Object(h),!0).forEach(function(v){a(c,v,h[v]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(h)):n(Object(h)).forEach(function(v){Object.defineProperty(c,v,Object.getOwnPropertyDescriptor(h,v));});}return c;}function a(c,p,h){return p in c?Object.defineProperty(c,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):c[p]=h,c;}var o=Symbol("inited");var s=null;typeof Worker=="function"&&(s=/*#__PURE__*/function(_Worker){function s(c){var _this56;_classCallCheck(this,s);if(c.worker===!0&&(c.worker="./".concat(c.id,".worker.js")),_this56=_callSuper(this,s,[c.worker]),_this56.options=c,!c.canvas){var _this56$getResolution=_this56.getResolution(),p=_this56$getResolution.width,h=_this56$getResolution.height,v=e.ENV.createCanvas(p,h,{offscreen:!1});v.style&&(v.style.position="absolute"),v.dataset&&(v.dataset.layerId=c.id),c.canvas=v;}_this56.canvas=c.canvas;return _assertThisInitialized(_this56);}_inherits(s,_Worker);return _createClass(s,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref156){var c=_ref156.width,p=_ref156.height;if(this[o])this.postMessage({type:"resolution_change",width:c,height:p});else{this.canvas.width=c,this.canvas.height=p;var h=this.options,v=h.canvas.transferControlToOffscreen(),y=i({},h);delete y.container,y.canvas=v,this.postMessage({type:"create",options:y},[v]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,c=_this$canvas6.width,p=_this$canvas6.height;return{width:c,height:p};}return{width:300,height:150};}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"connect",value:function connect(c,p){Object.defineProperty(this,"parent",{value:c,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:p,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(c){this.postMessage({type:"event",event:{cancelBubble:c.cancelBubble,bubbles:c.bubbles,detail:c.detail,identifier:c.identifier,layerX:c.layerX,layerY:c.layerY,originalX:c.originalX,originalY:c.originalY,type:c.type,x:c.x,y:c.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),r["default"]=s;},/* 290 */ /***/function(f,r,t){t.r(r),function(e){t.d(r,"default",function(){return O;});var n=t(12),i=t(68),a=t(70),o=t(286),s=t(289),c=t(250),p=t(291),h=t(214),v=t(218),y=t(213);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("enteredTargets");function T(A){return A.id=A.id||"_layer".concat(Math.random().toString(36).slice(2,12)),A.dataset||(A.dataset={}),A.dataset.layerId=A.id,A.connect=function(R,b){A.parent=R,Object.defineProperty(A,"zOrder",{value:b,writable:!1,configurable:!0});},A.disconnect=function(R){delete A.zOrder;},A.canvas=A,A.getResolution=function(){return{width:0,height:0};},A.setResolution=function(){return!1;},A.options={handleEvent:!1},A;}function m(A,R){var b=A.children;var E=null;for(var L=0;L<b.length;L++){var D=b[L];if((R===D||E!=null)&&(E=D),E&&E!==R&&!E.offscreen)return E.canvas;}return null;}function x(A,R){var _A$renderOffset=_slicedToArray(A.renderOffset,2),b=_A$renderOffset[0],E=_A$renderOffset[1],_A$getResolution=A.getResolution(),L=_A$getResolution.width,D=_A$getResolution.height,I=A.displayRatio;A.renderer.drawImage(R.canvas,-b/I,-E/I,L/I,D/I);}var l={};function d(A){var R=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],b=A.container;b.addEventListener("mouseleave",function(E){var L=A[M];if(L.size){var D=new h["default"]("mouseleave");D.setOriginalEvent(E),_toConsumableArray(L).forEach(function(I){I.dispatchEvent(D);}),A[M].clear();}},{passive:!0}),R.forEach(function(E){b.addEventListener(E,function(L){var _A$options=A.options,D=_A$options.left,I=_A$options.top,C=_A$options.displayRatio,W=A.orderedChildren;Object(p["default"])(L,{offsetLeft:D,offsetTop:I,displayRatio:C}).forEach(function(K){var X=K.identifier;if(K.type==="touchmove"||K.type==="touchend"){var B=l[X];B&&B.dispatchEvent(K),K.type==="touchend"&&delete l[X];}else{for(var _B=W.length-1;_B>=0;_B--){var z=W[_B];if(z.options.handleEvent!==!1){if(z.dispatchPointerEvent(K)&&K.target!==z)break;K.cancelBubble=!1;}}if(K.target===W[0])for(var _B2=W.length-1;_B2>=0;_B2--){var _z=W[_B2];if(_z.options.handleEvent!==!1){K.target=_z;break;}}}var Z=K.target;if(K.type==="touchstart"&&(l[X]=K.target),K.type==="mousemove"){var _B3=A[M];var _z2;if(Z){var _=Z.ancestors||[];_z2=/* @__PURE__ */new Set([Z].concat(_toConsumableArray(_)));}else _z2=/* @__PURE__ */new Set();var Q=Object.entries(L);if(!_B3.has(Z)&&Z){var _3=new h["default"]("mouseenter");_3.setOriginalEvent(L),Q.forEach(function(_ref157){var _ref158=_slicedToArray(_ref157,2),q=_ref158[0],ht=_ref158[1];_3[q]=ht;}),_B3.add(Z),Z.dispatchEvent(_3);var st=Z.ancestors;st&&st.forEach(function(q){q instanceof a["default"]&&!_B3.has(q)&&(_B3.add(q),q.dispatchEvent(_3));});}var et=new h["default"]("mouseleave");et.setOriginalEvent(L),Q.forEach(function(_ref159){var _ref160=_slicedToArray(_ref159,2),_=_ref160[0],st=_ref160[1];et[_]=st;}),_toConsumableArray(_B3).forEach(function(_){_z2.has(_)||(_B3["delete"](_),_.dispatchEvent(et));});}});},{passive:E!=="contextmenu"});});}function u(A,R){if(R&&R.style){var b=A.width,E=A.height,L=A.mode,D=A.container;var I=D.clientWidth,C=D.clientHeight;b=b||I,E=E||C,L==="static"?(R.style.width="".concat(b,"px"),R.style.height="".concat(E,"px")):(R.style.top="0",R.style.left="0",R.style.width="".concat(I,"px"),R.style.height="".concat(C,"px"),R.style.transform="",R.style.webkitTransform="");}}var g=Symbol("offscreenLayerCount");var O=/*#__PURE__*/function(_c$default){/**
382
+ width
383
+ height
384
+ mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
385
+ */function O(){var _this57;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this57=_callSuper(this,O),!R.container)if(typeof n.ENV.Container=="function")R.container=new n.ENV.Container(R.width||300,R.height||150);else throw new Error("No container specified.");if(_this57.container=R.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.options=R,R.displayRatio=R.displayRatio||1,R.mode=R.mode||"scale",R.left=0,R.top=0,R.autoResize=R.autoResize!==!1,R.autoResize){var b;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?b=globalThis:b=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:e,b.addEventListener){var E=_assertThisInitialized(_this57);b.addEventListener("resize",function L(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(E.container)?E.resize():b.removeEventListener("resize",L);});}}_this57[M]=/* @__PURE__ */new Set(),_this57.setResolution(R),d(_assertThisInitialized(_this57)),_this57[g]=0;return _assertThisInitialized(_this57);}_inherits(O,_c$default);return _createClass(O,[{key:"hasOffscreenCanvas",get:function get(){return this[g]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(R){this.options.displayRatio!==R&&(this.options.displayRatio=R,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(R){this.options.height!==R&&(this.options.height=R,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(R){this.options.mode!==R&&(this.options.mode=R,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(R){this.options.width!==R&&(this.options.width=R,this.resize());}},{key:"appendChild",value:function appendChild(R){!(R instanceof o["default"])&&!(R instanceof s["default"])&&T(R);var b=_get(_getPrototypeOf(O.prototype),"appendChild",this).call(this,R),E=R.canvas;return R.offscreen?this[g]++:this.container.appendChild(E),u(this.options,E),R.setResolution(this.getResolution()),b;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this58=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(function(){delete _this58._requestID,_this58.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(R,b){!(R instanceof o["default"])&&!(R instanceof s["default"])&&T(R);var E=_get(_getPrototypeOf(O.prototype),"insertBefore",this).call(this,R,b),L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return u(this.options,L),R.setResolution(this.getResolution()),E;}},{key:"layer",value:function layer(){var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};b=Object.assign({},this.options,b),b.id=R;var E=this.orderedChildren;for(var I=0;I<E.length;I++)if(E[I].id===R)return E[I];var L=b.worker;var D;return L?D=new s["default"](b):D=new o["default"](b),this.appendChild(D),D;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(){var _this59=this;var _len13,R,_key13,b,E,L,_loop2,D,_args21=arguments;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:for(_len13=_args21.length,R=new Array(_len13),_key13=0;_key13<_len13;_key13++){R[_key13]=_args21[_key13];}b=[],E=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(D){var I,C,W,G;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:I=R[D];if(typeof I=="string")C=Object(v.loadTexture)(I);else if(Array.isArray(I))C=Object(v.loadFrames).apply(void 0,_toConsumableArray(I));else{W=I.id,G=I.src;C=Object(v.loadTexture)(G,W);}C instanceof Promise||(C=Promise.resolve(C)),E.push(C.then(function(W){b.push(W),L[D]=W;var G=new h["default"]({type:"preload",detail:{current:W,loaded:b,resources:R}});_this59.dispatchEvent(G);}));case 3:case"end":return _context20.stop();}},_loop2);});D=0;case 4:if(!(D<R.length)){_context21.next=9;break;}return _context21.delegateYield(_loop2(D),"t0",6);case 6:D++;_context21.next=4;break;case 9:_context21.next=11;return Promise.all(E);case 11:return _context21.abrupt("return",L);case 12:case"end":return _context21.stop();}},_callee20);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(R){var b=_get(_getPrototypeOf(O.prototype),"removeChild",this).call(this,R);if(b){R._prepareRenderFinished&&R._prepareRenderFinished();var E=R.canvas;E&&E.remove&&E.remove(),R.offscreen&&this[g]--;}return b;}// for offscreen mode rendering
386
+ },{key:"render",value:function render(){var R=this.orderedChildren;var b=null;var E=[];for(var L=0;L<R.length;L++){var D=R[L],I=E.length>0;if(D instanceof o["default"]&&!D.offscreen){if(!D.autoRender)I&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);else if(b=D,I){D.renderer.clear();for(var C=0;C<E.length;C++){var W=E[C];W.render(),x(D,W);}E.length=0,D.render({clear:!1});}else D.prepareRender&&D.render();}else D.offscreen?b?(D.prepareRender&&D.render(),x(b,D)):E.push(D):D instanceof s["default"]&&I&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(R,b){var E=_get(_getPrototypeOf(O.prototype),"replaceChild",this).call(this,R,b);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[g]--;var L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return u(this.options,L),R.setResolution(this.getResolution()),E;}},{key:"resize",value:function resize(){var R=this.options;this.children.forEach(function(b){u(R,b.canvas);}),this.setResolution(R),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _R4,_b10;var _ref161=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref161.width,b=_ref161.height;var E=this.container,L=E.clientWidth,D=E.clientHeight;(R==null||b==null)&&(R=(_R4=R)!==null&&_R4!==void 0?_R4:L,b=(_b10=b)!==null&&_b10!==void 0?_b10:D);var _this$options=this.options,I=_this$options.mode,C=_this$options.displayRatio;if(R*=C,b*=C,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var W=R;R=L*b/D,I==="stickyHeight"&&(this.options.left=0.5*(R-W)),I==="stickyRight"&&(this.options.left=R-W);}else if(I==="stickyWidth"||I==="stickyTop"||I==="stickyBottom"){var _W4=b;b=D*R/L,I==="stickyWidth"&&(this.options.top=0.5*(b-_W4)),I==="stickyBottom"&&(this.options.top=b-_W4);}_get(_getPrototypeOf(O.prototype),"setResolution",this).call(this,{width:R,height:b});}},{key:"snapshot",value:function snapshot(){var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref162$offscreen=_ref162.offscreen,R=_ref162$offscreen===void 0?!1:_ref162$offscreen,b=_ref162.layers;var E=R?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,D=_this$getResolution9.height;this[E]=this[E]||n.ENV.createCanvas(L,D,{offscreen:R});var I=this[E].getContext("2d");b=b||this.orderedChildren,this[E].width=L,this[E].height=D;for(var C=0;C<b.length;C++){var W=b[C];if(!W.options.ignoreSnapshot){W.render&&W.render();var G=W.canvas;G&&G!==W&&I.drawImage(G,0,0,L,D);}}return this[E];}}]);}(c["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(O.prototype.layer3d=function(A){var _this60=this;var R=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var b=R.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(E,L){var D=document.createElement("script");D.async=!1,D.src=b,D.onload=function(){try{E(_this60.layer3d(A,R));}catch(I){L(I);}},document.documentElement.appendChild(D);});}),y["default"].registerNode(O,"scene");}.call(this,t(22));},/* 291 */ /***/function(f,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref163=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref163$offsetTop=_ref163.offsetTop,a=_ref163$offsetTop===void 0?0:_ref163$offsetTop,_ref163$offsetLeft=_ref163.offsetLeft,o=_ref163$offsetLeft===void 0?0:_ref163$offsetLeft,_ref163$displayRatio=_ref163.displayRatio,s=_ref163$displayRatio===void 0?1:_ref163$displayRatio;var c,p;var h=[],_i$target$getBounding=i.target.getBoundingClientRect(),v=_i$target$getBounding.left,y=_i$target$getBounding.top,M=_i$target$getBounding.width,T=_i$target$getBounding.height,m=i.target.width,x=i.target.height,l=i.changedTouches||[i];for(var u=0;u<l.length;u++){var g=l[u],O=g.identifier,A=g.clientX,R=g.clientY;A!=null&&R!=null&&h.push({x:Math.round((A|0)-v),y:Math.round((R|0)-y),identifier:O});}h.length<=0&&h.push({x:c,y:p});var d=[];return h.forEach(function(u){u.x!=null&&u.y!=null&&(c=(u.x*m/M-o)/s,p=(u.y*x/T-a)/s);var g=new e["default"](i);Object.defineProperties(g,{layerX:{value:c,configurable:!0},layerY:{value:p,configurable:!0},originalX:{value:u.x},originalY:{value:u.y},x:{value:c,configurable:!0},y:{value:p,configurable:!0},identifier:{value:u.identifier}}),d.push(g);}),d;}}/******/]);Nt.version;Nt.Arc;Nt.Block;Nt.Cloud;Nt.Color;var yd=Nt.Ellipse;Nt.Gradient;var re=Nt.Group,Sd=Nt.Label,xd=Nt.Layer;Nt.LayerWorker;Nt.Node;Nt.Parallel;var ge=Nt.Path,fe=Nt.Polyline,an=Nt.Rect;Nt.Regular;Nt.Ring;var Td=Nt.Scene,Md=Nt.Sprite;Nt.SpriteSvg;Nt.Star;Nt.Triangle;Nt.helpers;Nt.createElement;Nt.isSpriteNode;Nt.registerNode;Nt.requestAnimationFrame;Nt.cancelAnimationFrame;Nt.ENV;var Mt=/*#__PURE__*/function(_tt){function Mt(){var _this61;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,Mt);_this61=_callSuper(this,Mt,[r,t,e]),_this61.x=r,_this61.y=t,_this61.z=e,_this61.v=n,_this61.t=i,_this61.a=a;return _this61;}_inherits(Mt,_tt);return _createClass(Mt,[{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 Mt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return Mt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return Mt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return Mt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new Mt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new Mt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return Mt.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 c=Math.sqrt(n*n+a*a),p=Math.sqrt(i*i+o*o);if(c&&p){var h=n*i+a*o;s=Math.acos(h/(c*p)),s=s/Math.PI*180;var v=n*o-a*i;v=v>0?1:-1,s=180+v*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return Mt.Len(r.clone().sub(t))<e;}},{key:"RotWith",value:function RotWith(r,t,e){var n=arguments.length>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),c=Math.pow(10,n),p=Math.floor((t.x+(i*s-a*o))*c)/c,h=Math.floor((t.y+(i*o+a*s))*c)/c;return new Mt(p,h);}/**
387
+ * 根据圆心和半径,获取圆上的等份点
388
+ * @param o 圆心
389
+ * @param radius 半径
390
+ * @param average 均分数
391
+ * @returns
392
+ */},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new tt(1,1),i=Math.PI+1e-3,a=Mt.Add(r,Mt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,c=s;c<=1;c+=s)o.push(Mt.RotWith(a,r,i*2*c));return o;}/**
393
+ * 根据圆心和圆上的起始点,获取半圆上的等份点
394
+ * @param o 圆心
395
+ * @param p 圆弧起始点
396
+ * @param radian 1,逆时针180度 -1,顺时针
397
+ * @param average 均分数
398
+ * @returns
399
+ */},{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(Mt.RotWith(t,r,i*s));return a;}}]);}(tt);function Te(f){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=f.length;if(t<2)return"";var e=f[0],n=f[1];if(t===2)return"M".concat(pe(e),"L").concat(pe(n));var i="";for(var a=2,o=t-1;a<o;a++)e=f[a],n=f[a+1],i+=ve(e,n);return r?"M".concat(ve(f[0],f[1]),"Q").concat(pe(f[1])).concat(ve(f[1],f[2]),"T").concat(i).concat(ve(f[t-1],f[0])).concat(ve(f[0],f[1]),"Z"):"M".concat(pe(f[0]),"Q").concat(pe(f[1])).concat(ve(f[1],f[2])).concat(f.length>3?"T":"").concat(i,"L").concat(pe(f[t-1]));}var Cr={exports:{}};Cr.exports;(function(f){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(s,c){if(!i[s]){i[s]={};for(var p=0;p<s.length;p++)i[s][s.charAt(p)]=p;}return i[s][c];}var o={compressToBase64:function compressToBase64(s){if(s==null)return"";var c=o._compress(s,6,function(p){return e.charAt(p);});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"=";}},decompressFromBase64:function decompressFromBase64(s){return s==null?"":s==""?null:o._decompress(s.length,32,function(c){return a(e,s.charAt(c));});},compressToUTF16:function compressToUTF16(s){return s==null?"":o._compress(s,15,function(c){return t(c+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(s){return s==null?"":s==""?null:o._decompress(s.length,16384,function(c){return s.charCodeAt(c)-32;});},//compress into uint8array (UCS-2 big endian format)
400
+ compressToUint8Array:function compressToUint8Array(s){for(var c=o.compress(s),p=new Uint8Array(c.length*2),h=0,v=c.length;h<v;h++){var y=c.charCodeAt(h);p[h*2]=y>>>8,p[h*2+1]=y%256;}return p;},//decompress from uint8array (UCS-2 big endian format)
401
+ decompressFromUint8Array:function decompressFromUint8Array(s){if(s==null)return o.decompress(s);for(var c=new Array(s.length/2),p=0,h=c.length;p<h;p++)c[p]=s[p*2]*256+s[p*2+1];var v=[];return c.forEach(function(y){v.push(t(y));}),o.decompress(v.join(""));},//compress into a string that is already URI encoded
402
+ compressToEncodedURIComponent:function compressToEncodedURIComponent(s){return s==null?"":o._compress(s,6,function(c){return n.charAt(c);});},//decompress from an output of compressToEncodedURIComponent
403
+ decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(s){return s==null?"":s==""?null:(s=s.replace(/ /g,"+"),o._decompress(s.length,32,function(c){return a(n,s.charAt(c));}));},compress:function compress(s){return o._compress(s,16,function(c){return t(c);});},_compress:function _compress(s,c,p){if(s==null)return"";var h,v,y={},M={},T="",m="",x="",l=2,d=3,u=2,g=[],O=0,A=0,R;for(R=0;R<s.length;R+=1)if(T=s.charAt(R),Object.prototype.hasOwnProperty.call(y,T)||(y[T]=d++,M[T]=!0),m=x+T,Object.prototype.hasOwnProperty.call(y,m))x=m;else{if(Object.prototype.hasOwnProperty.call(M,x)){if(x.charCodeAt(0)<256){for(h=0;h<u;h++)O=O<<1,A==c-1?(A=0,g.push(p(O)),O=0):A++;for(v=x.charCodeAt(0),h=0;h<8;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}else{for(v=1,h=0;h<u;h++)O=O<<1|v,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=0;for(v=x.charCodeAt(0),h=0;h<16;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,u),u++),delete M[x];}else for(v=y[x],h=0;h<u;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,u),u++),y[m]=d++,x=String(T);}if(x!==""){if(Object.prototype.hasOwnProperty.call(M,x)){if(x.charCodeAt(0)<256){for(h=0;h<u;h++)O=O<<1,A==c-1?(A=0,g.push(p(O)),O=0):A++;for(v=x.charCodeAt(0),h=0;h<8;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}else{for(v=1,h=0;h<u;h++)O=O<<1|v,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=0;for(v=x.charCodeAt(0),h=0;h<16;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,u),u++),delete M[x];}else for(v=y[x],h=0;h<u;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,u),u++);}for(v=2,h=0;h<u;h++)O=O<<1|v&1,A==c-1?(A=0,g.push(p(O)),O=0):A++,v=v>>1;for(;;)if(O=O<<1,A==c-1){g.push(p(O));break;}else A++;return g.join("");},decompress:function decompress(s){return s==null?"":s==""?null:o._decompress(s.length,32768,function(c){return s.charCodeAt(c);});},_decompress:function _decompress(s,c,p){var h=[],v=4,y=4,M=3,T="",m=[],x,l,d,u,g,O,A,R={val:p(0),position:c,index:1};for(x=0;x<3;x+=1)h[x]=x;for(d=0,g=Math.pow(2,2),O=1;O!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(u>0?1:0)*O,O<<=1;switch(d){case 0:for(d=0,g=Math.pow(2,8),O=1;O!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(u>0?1:0)*O,O<<=1;A=t(d);break;case 1:for(d=0,g=Math.pow(2,16),O=1;O!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(u>0?1:0)*O,O<<=1;A=t(d);break;case 2:return"";}for(h[3]=A,l=A,m.push(A);;){if(R.index>s)return"";for(d=0,g=Math.pow(2,M),O=1;O!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(u>0?1:0)*O,O<<=1;switch(A=d){case 0:for(d=0,g=Math.pow(2,8),O=1;O!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(u>0?1:0)*O,O<<=1;h[y++]=t(d),A=y-1,v--;break;case 1:for(d=0,g=Math.pow(2,16),O=1;O!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=c,R.val=p(R.index++)),d|=(u>0?1:0)*O,O<<=1;h[y++]=t(d),A=y-1,v--;break;case 2:return m.join("");}if(v==0&&(v=Math.pow(2,M),M++),h[A])T=h[A];else if(A===y)T=l+l.charAt(0);else return null;m.push(T),h[y++]=l+T.charAt(0),v--,l=T,v==0&&(v=Math.pow(2,M),M++);}}};return o;}();f!=null?f.exports=r:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r;});})(Cr);var ni=Cr.exports;function Me(f){return JSON.parse(ni.decompress(f));}function _t(f){return ni.compress(JSON.stringify(f));}var ii=/*#__PURE__*/function(_yt){function ii(t){var _this62;_classCallCheck(this,ii);_this62=_callSuper(this,ii,[t]);nt(_this62,"canRotate",!0);nt(_this62,"scaleType",zt.all);nt(_this62,"toolsType",gt.Pencil);nt(_this62,"syncTimestamp");nt(_this62,"syncIndex",0);nt(_this62,"tmpPoints",[]);nt(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */nt(_this62,"uniThickness");nt(_this62,"workOptions");nt(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(ii,_yt);return _createClass(ii,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:ft.None};var e=this.transformDataAll(!0),n={name:t};var i;var a=this.drawLayer||this.fullLayer;return e.length&&(i=this.draw({attrs:n,tasks:e,replaceId:t,layer:a})),{rect:i,type:ft.DrawWork,dataType:Tt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(ii.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=t.drawCount,s=t.replaceId,c=e.workId,_this$transformData=this.transformData(e,!1),p=_this$transformData.tasks,h=_this$transformData.effects,v=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,v,Math.max(0,this.tmpPoints.length-2));var y={name:c,id:o==null?void 0:o.toString()};var M,T=!1;var m=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),p.length&&(p[0].taskId-this.syncTimestamp>this.syncUnitTime&&(T=!0,this.syncTimestamp=p[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){var _l27=n?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({attrs:y,tasks:p,effects:h,layer:_l27,replaceId:s});}if(i)return v>10&&this.tmpPoints.splice(0,v-10),{rect:M,type:ft.DrawWork,dataType:Tt.Local};var x=[];return this.tmpPoints.slice(m).forEach(function(l){x.push(l.x,l.y,_this63.computRadius(l.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ft.DrawWork,dataType:Tt.Local,rect:M,op:T?x:void 0,index:T?m*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var _this64=this;var p;var e=this.workId;if(t.data){var _t$data=t.data,h=_t$data.op,v=_t$data.workState;h!=null&&h.length&&v===It.Done&&this.workOptions.strokeType===Vt.Stroke&&this.updateTempPointsWithPressureWhenDone(h);}var n=this.transformDataAll(!0),i={name:e};var a;var o=this.fullLayer;if(n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:o})),this.tmpPoints.length<2)return this.replace(o,e),{type:ft.RemoveNode,removeIds:[e],rect:a};var s=[];this.tmpPoints.map(function(h){s.push(h.x,h.y,_this64.computRadius(h.z,_this64.workOptions.thickness));}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var c=_t(s);return(p=this.vNodes)==null||p.setInfo(e,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,o)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:a,type:ft.FullWork,dataType:Tt.Local,ops:c,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var p,h;var e=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3){var y=new Mt(e[v],e[v+1],e[v+2]);if(this.tmpPoints.length>0){var M=this.tmpPoints[this.tmpPoints.length-1],T=tt.Sub(y,M).uni();y.setv(T);}this.tmpPoints.push(y);}if(this.tmpPoints.length<2)return;var a=this.transformDataAll(!1),o=(p=this.workId)==null?void 0:p.toString(),s={name:o};var c;if(o&&a.length){var _v2=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({attrs:s,tasks:a,replaceId:i,layer:_v2}),(h=this.vNodes)==null||h.setInfo(o,{rect:c,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&yt.getCenterPos(c,_v2)});}return c;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(e,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this65=this;var e=t.attrs,n=t.tasks,i=t.replaceId,a=t.effects,o=t.layer,_this$workOptions=this.workOptions,s=_this$workOptions.strokeColor,c=_this$workOptions.strokeType,p=_this$workOptions.thickness,h=_this$workOptions.zIndex,v=_this$workOptions.scale,y=_this$workOptions.rotate,M=_this$workOptions.translate;a!=null&&a.size&&(a.forEach(function(u){var g;(g=o.getElementById(u+""))==null||g.remove();}),a.clear());var T;var m=[],x=o.worldPosition,l=o.worldScaling;for(var u=0;u<n.length;u++){var _n$u=n[u],g=_n$u.pos,O=_n$u.points,_this$computDrawPoint=this.computDrawPoints(O),A=_this$computDrawPoint.ps,R=_this$computDrawPoint.rect;var b=void 0;var E=O.length===1;c===Vt.Stroke||E?b=Te(A,!0):b=Te(A,!1);var L={pos:g,d:b,fillColor:c===Vt.Stroke||E?s:void 0,lineDash:c===Vt.Dotted&&!E?[1,p*2]:c===Vt.LongDotted&&!E?[p,p*2]:void 0,strokeColor:s,lineCap:c===Vt.Stroke||E?void 0:"round",lineWidth:c===Vt.Stroke||E?0:p};T=Ot(T,{x:Math.floor((R.x+g[0])*l[0]+x[0]-yt.SafeBorderPadding),y:Math.floor((R.y+g[1])*l[1]+x[1]-yt.SafeBorderPadding),w:Math.floor(R.w*l[0]+2*yt.SafeBorderPadding),h:Math.floor(R.h*l[1]+2*yt.SafeBorderPadding)}),m.push(L);}v&&(e.scale=v),y&&(e.rotate=y),M&&(e.translate=M);var d=new re();if(T){this.centerPos=yt.getCenterPos(T,o),d.attr(_objectSpread(_objectSpread({},e),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:c===Vt.Stroke?s:void 0,pos:this.centerPos,size:[(T.w-2*yt.SafeBorderPadding)/l[0],(T.h-2*yt.SafeBorderPadding)/l[1]],zIndex:h}));var _u10=m.map(function(g){return g.pos=[g.pos[0]-_this65.centerPos[0],g.pos[1]-_this65.centerPos[1]],new ge(g);});d.append.apply(d,_toConsumableArray(_u10)),c===Vt.Stroke&&d.seal(),this.replace(o,i||e.workId,d);}if(v||y||M){var _u11=d==null?void 0:d.getBoundingClientRect();if(_u11)return{x:Math.floor(_u11.x-yt.SafeBorderPadding),y:Math.floor(_u11.y-yt.SafeBorderPadding),w:Math.floor(_u11.width+yt.SafeBorderPadding*2),h:Math.floor(_u11.height+yt.SafeBorderPadding*2)};}return T;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Vt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var e=this.workOptions.thickness;var n=t.map(function(i){return e=Math.max(e,i.radius),i.point;});return{ps:n,rect:Ft(n,e)};}},{key:"computStroke",value:function computStroke(t){return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t);}},{key:"computLineStroke",value:function computLineStroke(t){var e=[],n=[];for(var c=0;c<t.length;c++){var _t$c=t[c],p=_t$c.point,h=_t$c.radius;var v=p.v;c===0&&t.length>1&&(v=t[c+1].point.v);var y=tt.Per(v).mul(h);e.push(Mt.Sub(p,y)),n.push(Mt.Add(p,y));}var i=t[t.length-1],a=Mt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),o=Mt.GetSemicircleStroke(t[0].point,n[0],-1,8),s=e.concat(a,n.reverse(),o);return{ps:s,rect:Ft(s)};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:Mt.GetDotStroke(e,n,8),rect:i};}},{key:"transformData",value:function transformData(t,e){var n=t.op,i=t.workState;var a=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,s=_this$workOptions2.strokeType,c=_this$workOptions2.thickness,p=/* @__PURE__ */new Set();a=s===Vt.Stroke?this.updateTempPointsWithPressure(n,c,p):this.updateTempPoints(n,c,p);var h=e?this.tmpPoints:this.tmpPoints.slice(a);return o=this.getTaskPoints(h,c),{tasks:o,effects:p,consumeIndex:a};}return{tasks:o,consumeIndex:a};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,e){return t*0.03*e+e*0.5;}},{key:"getMinZ",value:function getMinZ(t,e){return((e||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,e){var h;var n=[];if(t.length===0)return[];var i=0,a=t[0].x,o=t[0].y,s=[a,o],c=[],p=t[0].t;for(;i<t.length;){var v=t[i],y=v.x-a,M=v.y-o,T=v.z,m=e?this.computRadius(T,e):T;if(c.push({point:new Mt(y,M,T,t[i].v),radius:m}),i>0&&i<t.length-1){var _x56=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_x56<90||_x56>270){var _l28=(h=c.pop())==null?void 0:h.point.clone();_l28&&n.push({taskId:p,pos:s,points:[].concat(_toConsumableArray(c),[{point:_l28,radius:m}])}),a=t[i].x,o=t[i].y,s=[a,o];var d=v.x-a,u=v.y-o;c=[{point:new Mt(d,u,T),radius:m}],p=Date.now();}}i++;}return n.push({taskId:p,pos:s,points:c}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,e,n){var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var c=0;c<t.length;c+=2){o=Math.min(o,a);var p=this.tmpPoints.length,h=new Mt(t[c],t[c+1]);if(p===0){this.tmpPoints.push(h);continue;}var v=p-1,y=this.tmpPoints[v],M=tt.Sub(h,y).uni();if(h.isNear(y,e)){if(y.z<this.MAX_REPEAR){if(y.setz(Math.min(y.z+1,this.MAX_REPEAR)),o=Math.min(o,v),p>1){var _x57=p-1;for(;_x57>0;){var _l29=this.tmpPoints[_x57].distance(this.tmpPoints[_x57-1]),d=Math.max(this.tmpPoints[_x57].z-this.uniThickness*_l29,0);if(this.tmpPoints[_x57-1].z>=d)break;this.tmpPoints[_x57-1].setz(d),o=Math.min(o,_x57-1),_x57--;}}}else o=1/0;continue;}h.setv(M);var T=h.distance(y),m=Math.max(y.z-this.uniThickness*T,0);p>1&&tt.Equals(M,y.v,0.02)&&(m>0||y.z<=0)&&(n&&y.t&&n.add(y.t),this.tmpPoints.pop(),o=Math.min(v,o)),h.setz(m),this.tmpPoints.push(h);}if(o===1/0)return this.tmpPoints.length;var s=a;if(o===a){s=Math.max(s-1,0);var _c3=this.tmpPoints[s].t;_c3&&(n==null||n.add(_c3));}else{var _c4=a-1;for(s=o;_c4>=0;){var _p4=this.tmpPoints[_c4].t;if(_p4&&(n==null||n.add(_p4),_c4<=o)){s=_c4,_c4=-1;break;}_c4--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPoints",value:function updateTempPoints(t,e,n){var c;var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var p=0;p<t.length;p+=2){var h=this.tmpPoints.length,v=new Mt(t[p],t[p+1]);if(h===0){this.tmpPoints.push(v);continue;}var y=h-1,M=this.tmpPoints[y],T=tt.Sub(v,M).uni();if(v.isNear(M,e/2)){o=Math.min(y,o);continue;}tt.Equals(T,M.v,0.02)&&(n&&M.t&&n.add(M.t),this.tmpPoints.pop(),o=Math.min(y,o)),v.setv(T),this.tmpPoints.push(v);}var s=a;if(o===a){s=Math.max(s-1,0);var _p5=this.tmpPoints[s].t;_p5&&(n==null||n.add(_p5));}else{var _p6=Math.min(a-1,o);for(s=o;_p6>=0;){var _h4=(c=this.tmpPoints[_p6])==null?void 0:c.t;if(_h4&&(n==null||n.add(_h4),_p6<=o)){s=_p6,_p6=-1;break;}_p6--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var e=this.workOptions.thickness,n=t.length,i=this.getMinZ(e);for(var a=0;a<n;a+=2){var o=this.tmpPoints.length,s=new Mt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var c=o-1,p=this.tmpPoints[c],h=tt.Sub(s,p).uni(),v=s.distance(p);if(o>1&&p.z===i)break;if(s.isNear(p,e/2)){if(n<3&&p.z<this.MAX_REPEAR&&(p.setz(Math.min(p.z+1,this.MAX_REPEAR)),o>1)){var M=o-1;for(;M>0;){var T=this.tmpPoints[M].distance(this.tmpPoints[M-1]),m=Math.max(this.tmpPoints[M].z-this.uniThickness*T,-e/4);if(this.tmpPoints[M-1].z>=m)break;this.tmpPoints[M-1].setz(m),M--;}}continue;}s.setv(h);var y=Math.max(p.z-this.uniThickness*v,i);o>1&&tt.Equals(h,p.v,0.02)&&p.z<=0&&this.tmpPoints.pop(),s.setz(y),this.tmpPoints.push(s);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.tagName==="GROUP"?j0(e)?e.setAttribute("bgcolor",a):e.children.forEach(function(c){c.setAttribute("strokeColor",a),c.getAttribute("fillColor")&&c.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t);}}]);}(yt);var si=/*#__PURE__*/function(_yt2){function si(t){var _this66;_classCallCheck(this,si);_this66=_callSuper(this,si,[t]);nt(_this66,"toolsType",gt.LaserPen);nt(_this66,"canRotate",!1);nt(_this66,"scaleType",zt.none);nt(_this66,"syncTimestamp");nt(_this66,"syncIndex",0);nt(_this66,"tmpPoints",[]);nt(_this66,"workOptions");nt(_this66,"consumeIndex",0);_this66.workOptions=t.toolsOpt,_this66.syncTimestamp=0;return _this66;}_inherits(si,_yt2);return _createClass(si,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(si.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var e=t.data,n=t.isSubWorker,i=e.workId,a=e.op;if((a==null?void 0:a.length)===0)return{type:ft.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:ft.None};var _this$workOptions3=this.workOptions,o=_this$workOptions3.strokeColor,s=_this$workOptions3.thickness,c=_this$workOptions3.strokeType,p=Ft(this.tmpPoints,s);var h=!1;var v=this.syncIndex,y=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var M={name:i==null?void 0:i.toString(),opacity:1,lineDash:c===Vt.Dotted?[1,s*2]:c===Vt.LongDotted?[s,s*2]:void 0,strokeColor:o,lineCap:"round",lineWidth:s,anchor:[0.5,0.5]},T=this.getTaskPoints(y);if(T.length){var _x58=Date.now();_x58-this.syncTimestamp>this.syncUnitTime&&(h=!0,this.syncTimestamp=_x58,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:M,tasks:T,isDot:!1,layer:this.drawLayer||this.fullLayer});}var m=[];return this.tmpPoints.slice(v).forEach(function(x){m.push(x.x,x.y);}),_objectSpread({rect:{x:p.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:p.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:p.w*this.fullLayer.worldScaling[0],h:p.h*this.fullLayer.worldScaling[1]},type:ft.DrawWork,dataType:Tt.Local,op:h?m:void 0,index:h?v*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var t=(a=this.workId)==null?void 0:a.toString();var e;if(this.tmpPoints.length-1>this.consumeIndex){var o=this.tmpPoints.slice(this.consumeIndex);var s=o.length===1,_this$workOptions4=this.workOptions,c=_this$workOptions4.strokeColor,p=_this$workOptions4.thickness,h=_this$workOptions4.strokeType;if(s){var M=this.computDotStroke({point:o[0],radius:p/2});o=M.ps,e=M.rect;}else e=Ft(this.tmpPoints,p);var v={name:t==null?void 0:t.toString(),fillColor:s?c:void 0,opacity:1,lineDash:h===Vt.Dotted&&!s?[1,p*2]:h===Vt.LongDotted&&!s?[p,p*2]:void 0,strokeColor:c,lineCap:s?void 0:"round",lineWidth:s?0:p,anchor:[0.5,0.5]},y=this.getTaskPoints(o);y.length&&this.draw({attrs:v,tasks:y,isDot:s,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.y);});var i=_t(n);return _objectSpread({rect:e&&{x:e.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:e.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:e.w*this.fullLayer.worldScaling[0],h:e.h*this.fullLayer.worldScaling[1]},type:ft.FullWork,dataType:Tt.Local,ops:i,index:this.syncIndex*2},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var T;var e=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,a=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,s=_this$workOptions5.strokeType;if(!e.length){var m=Ft(this.tmpPoints,o);return{x:m.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:m.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:m.w*this.fullLayer.worldScaling[0],h:m.h*this.fullLayer.worldScaling[1]};}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(e||[]);var p,h=this.tmpPoints.slice(c);var v=h.length===1;if(v){var _m6=this.computDotStroke({point:h[0],radius:o/2});h=_m6.ps,p=_m6.rect;}else p=Ft(this.tmpPoints,o);var y={name:(T=this.workId)==null?void 0:T.toString(),fillColor:v?a:void 0,opacity:1,lineDash:s===Vt.Dotted&&!v?[1,o*2]:s===Vt.LongDotted&&!v?[o,o*2]:void 0,strokeColor:a,lineCap:v?void 0:"round",lineWidth:v?0:o,anchor:[0.5,0.5]},M=this.getTaskPoints(h);if(M.length){var _m7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:y,tasks:M,isDot:v,replaceId:n,layer:_m7});}return{x:p.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:p.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:p.w*this.fullLayer.worldScaling[0],h:p.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:Mt.GetDotStroke(e,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(e){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Mt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this67=this;var e,n,i,a,o,_iterator13,_step13,_loop3;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:e=t.attrs,n=t.tasks,i=t.isDot,a=t.layer,o=this.workOptions.duration;_iterator13=_createForOfIteratorHelper(n);_context23.prev=2;_loop3=/*#__PURE__*/_regeneratorRuntime().mark(function _loop3(){var s,c,p,h,v,_this67$workOptions,y,M,T,_a$getResolution,m,_x60;return _regeneratorRuntime().wrap(function _loop3$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:s=_step13.value;c=new ge(),p=s.pos,h=s.points;i?v=Te(h,!0):v=Te(h,!1),c.attr(_objectSpread(_objectSpread({},e),{},{pos:p,d:v}));_this67$workOptions=_this67.workOptions,y=_this67$workOptions.vertex,M=_this67$workOptions.fragment;if(y&&M){T=a.renderer.createProgram({vertex:y,fragment:M}),_a$getResolution=a.getResolution(),m=_a$getResolution.width,_x60=_a$getResolution.height;c.setUniforms({u_time:0,u_resolution:[m,_x60]}),c.setProgram(T);}a.appendChild(c),c.transition(o).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){c.remove();});case 6:case"end":return _context22.stop();}},_loop3);});_iterator13.s();case 5:if((_step13=_iterator13.n()).done){_context23.next=9;break;}return _context23.delegateYield(_loop3(),"t0",7);case 7:_context23.next=5;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23["catch"](2);_iterator13.e(_context23.t1);case 14:_context23.prev=14;_iterator13.f();return _context23.finish(14);case 17:case"end":return _context23.stop();}},_callee21,this,[[2,11,14,17]]);}));function draw(_x59){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var c;var e=[];if(t.length===0)return[];var n=0,i=t[0].x,a=t[0].y,o=[i,a],s=[];for(;n<t.length;){var p=t[n],h=p.x-i,v=p.y-a;if(s.push(new Mt(h,v)),n>0&&n<t.length-1){var y=t[n].getAngleByPoints(t[n-1],t[n+1]);if(y<90||y>270){var M=(c=s.pop())==null?void 0:c.clone();M&&e.push({pos:o,points:[].concat(_toConsumableArray(s),[M])}),i=t[n].x,a=t[n].y,o=[i,a];var T=p.x-i,m=p.y-a;s=[new Mt(T,m)];}}n++;}return e.push({pos:o,points:s}),e;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var e;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(i){if(i.name===t){var a=i.getBoundingClientRect();e=Ot(e,{x:a.x,y:a.y,w:a.width,h:a.height}),n.push(i);}}),n.length&&n.forEach(function(i){return i.remove();}),e;}}]);}(yt);var Od=Ge;Ge.polyline=Ge;Ge.polygon=Pd;function Ge(f,r,t){var e=f.length,n=ye(f[0],r),i=[],a,o,s,c,p;for(t||(t=[]),a=1;a<e;a++){for(o=f[a-1],s=f[a],c=p=ye(s,r);;)if(n|c){if(n&c)break;n?(o=gr(o,s,n,r),n=ye(o,r)):(s=gr(o,s,c,r),c=ye(s,r));}else{i.push(o),c!==p?(i.push(s),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(s);break;}n=p;}return i.length&&t.push(i),t;}function Pd(f,r){var t,e,n,i,a,o,s;for(e=1;e<=8;e*=2){for(t=[],n=f[f.length-1],i=!(ye(n,r)&e),a=0;a<f.length;a++)o=f[a],s=!(ye(o,r)&e),s!==i&&t.push(gr(n,o,e,r)),s&&t.push(o),n=o,i=s;if(f=t,!f.length)break;}return t;}function gr(f,r,t,e){return t&8?[f[0]+(r[0]-f[0])*(e[3]-f[1])/(r[1]-f[1]),e[3]]:// top
404
+ t&4?[f[0]+(r[0]-f[0])*(e[1]-f[1])/(r[1]-f[1]),e[1]]:// bottom
405
+ t&2?[e[2],f[1]+(r[1]-f[1])*(e[2]-f[0])/(r[0]-f[0])]:// right
406
+ t&1?[e[0],f[1]+(r[1]-f[1])*(e[0]-f[0])/(r[0]-f[0])]:// left
407
+ null;}function ye(f,r){var t=0;return f[0]<r[0]?t|=1:f[0]>r[2]&&(t|=2),f[1]<r[1]?t|=4:f[1]>r[3]&&(t|=8),t;}var Ed=/* @__PURE__ */ue(Od);var Se=/*#__PURE__*/function(_yt3){function Se(t,e){var _this68;_classCallCheck(this,Se);_this68=_callSuper(this,Se,[t]);nt(_this68,"canRotate",!1);nt(_this68,"scaleType",zt.none);nt(_this68,"toolsType",gt.Eraser);nt(_this68,"serviceWork");nt(_this68,"tmpPoints",[]);nt(_this68,"workOptions");nt(_this68,"worldPosition");nt(_this68,"worldScaling");nt(_this68,"eraserRect");nt(_this68,"eraserPolyline");_this68.serviceWork=e,_this68.workOptions=t.toolsOpt,_this68.worldPosition=_this68.fullLayer.worldPosition,_this68.worldScaling=_this68.fullLayer.worldScaling;return _this68;}_inherits(Se,_yt3);return _createClass(Se,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(Se.prototype),"setWorkOptions",this).call(this,t);}},{key:"createEraserRect",value:function createEraserRect(t){var e=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_Se$eraserSizes$this$=Se.eraserSizes[this.workOptions.thickness],i=_Se$eraserSizes$this$.width,a=_Se$eraserSizes$this$.height;this.eraserRect={x:e-i*0.5,y:n-a*0.5,w:i,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 computRectCenterPoints(){var t=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){var _e3=new tt(this.tmpPoints[0],this.tmpPoints[1]),n=new tt(this.tmpPoints[2],this.tmpPoints[3]),i=tt.Sub(n,_e3).uni(),a=tt.Dist(_e3,n),_Se$eraserSizes$this$2=Se.eraserSizes[this.workOptions.thickness],o=_Se$eraserSizes$this$2.width,s=_Se$eraserSizes$this$2.height,c=Math.min(o,s),p=Math.round(a/c);if(p>1){var h=[];for(var v=0;v<p;v++){var y=tt.Mul(i,v*c);h.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.y);}return h.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,e){var n=new tt(t[0],t[1]),i=new tt(e[0],e[1]),_Se$eraserSizes$this$3=Se.eraserSizes[this.workOptions.thickness],a=_Se$eraserSizes$this$3.width,o=_Se$eraserSizes$this$3.height;return tt.Dist(n,i)<Math.hypot(a,o)*0.5;}},{key:"cutPolyline",value:function cutPolyline(t,e){var n=[e],i=0;for(;i<t.length;){var s=t[i];if(s.length<2)break;n=a(n,s),i++;}return n;function a(s,c){var p=s;var _loop4=function _loop4(){var v=s[h],y=v.findIndex(function(M,T){return T<v.length-1?o([M,v[T+1]],[c[0],c[1]]):!1;});if(y!==-1&&y>-1){var M=[],T=v.slice(0,y+1);if(tt.Equals(v[y],c[0])||T.push(c[0].clone().setz(v[y].z)),T.length>1&&M.push(T),y+c.length-1<v.length-1){var m=y+c.length-1,_x61=v.slice(m),_l30=c[c.length-1];tt.Equals(v[m],_l30)||_x61.unshift(_l30.clone().setz(v[m].z)),_x61.length>1&&M.push(_x61);}return{v:(p.splice.apply(p,[h,1].concat(M)),p)};}},_ret;for(var h=0;h<s.length;h++){_ret=_loop4();if(_ret)return _ret.v;}return p;}function o(s,c){var p=tt.Sub(s[1],s[0]),h=tt.Sub(c[1],c[0]),v=tt.Sub(c[0],s[0]);return Math.abs(tt.Cpr(p,h))<0.1&&Math.abs(tt.Cpr(p,v))<0.1;}}},{key:"isSamePoint",value:function isSamePoint(t,e){return t[0]===e[0]&&t[1]===e[1];}},{key:"translateIntersect",value:function translateIntersect(t){var _this69=this;var e=[];for(var n=0;n<t.length;n++){var i=t[n].filter(function(s,c,p){return!(c>0&&_this69.isSamePoint(s,p[c-1]));}),a=[];var o=0;for(;o<i.length;){var s=i[o],c=new tt(s[0],s[1]);a.push(c),o++;}e.push(a);}return e;}},{key:"isLineEraser",value:function isLineEraser(t,e){return!(t===gt.Pencil&&!e);}},{key:"remove",value:function remove(t){var _this70=this;var e=t.curNodeMap,n=t.removeIds,i=t.newWorkDatas,a=this.workOptions.isLine;var o;var _iterator14=_createForOfIteratorHelper(e.entries()),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var _step14$value=_slicedToArray(_step14.value,2),s=_step14$value[0],c=_step14$value[1];if(c.rect&&this.eraserRect&&this.eraserPolyline&&De(this.eraserRect,c.rect)){var p=c.op,h=c.toolsType,v=this.isLineEraser(h,a),y=[],M=[];for(var m=0;m<p.length;m+=3){var _x62=new tt(p[m]*this.worldScaling[0]+this.worldPosition[0],p[m+1]*this.worldScaling[1]+this.worldPosition[1],p[m+2]);M.push(_x62),y.push(new Mt(_x62.x,_x62.y));}var T=y.length&&Ft(y)||c.rect;if(De(T,this.eraserRect)){if(M.length>1){var _m8=Ed.polyline(M.map(function(x){return x.XY;}),this.eraserPolyline);if(_m8.length&&(n.add(c.name),!v)){var _x63=this.translateIntersect(_m8),_l31=this.cutPolyline(_x63,M);var _loop5=function _loop5(){var u="".concat(s,"_s_").concat(d),g=[];_l31[d].forEach(function(O){g.push((O.x-_this70.worldPosition[0])/_this70.worldScaling[0],(O.y-_this70.worldPosition[1])/_this70.worldScaling[1],O.z);}),c.opt&&c.toolsType&&_this70.vNodes&&(_this70.vNodes.setInfo(u,{rect:T,op:g,opt:c.opt,canRotate:c.canRotate,scaleType:c.scaleType,toolsType:c.toolsType}),i.set(u,{workId:u,op:g,opt:c.opt,toolsType:c.toolsType}));};for(var d=0;d<_l31.length;d++){_loop5();}}}else n.add(c.name);o=Ot(o,T);}}}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}return n.forEach(function(s){var c;return(c=_this70.vNodes)==null?void 0:c["delete"](s);}),o&&(o.x-=yt.SafeBorderPadding,o.y-=yt.SafeBorderPadding,o.w+=yt.SafeBorderPadding*2,o.h+=yt.SafeBorderPadding*2),o;}},{key:"consume",value:function consume(t){var e=t.data.op;if(!e||e.length===0)return _objectSpread({type:ft.None},this.baseConsumeResult);var n=this.tmpPoints.length;if(n>1&&this.isNear([e[0],e[1]],[this.tmpPoints[n-2],this.tmpPoints[n-1]]))return _objectSpread({type:ft.None},this.baseConsumeResult);n===4&&(this.tmpPoints.shift(),this.tmpPoints.shift()),this.tmpPoints.push(e[0],e[1]);var i=this.computRectCenterPoints();var a;var o=/* @__PURE__ */new Set(),s=/* @__PURE__ */new Map();if(!this.vNodes)return _objectSpread({type:ft.None},this.baseConsumeResult);this.vNodes.setTarget();var c=this.getUnLockNodeMap(this.vNodes.getLastTarget());for(var p=0;p<i.length-1;p+=2){this.createEraserRect(i.slice(p,p+2));var h=this.remove({curNodeMap:c,removeIds:o,newWorkDatas:s});a=Ot(a,h);}if(this.vNodes.deleteLastTarget(),a&&o.size){var _iterator15=_createForOfIteratorHelper(s.keys()),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _p7=_step15.value;o.has(_p7)&&s["delete"](_p7);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return{type:ft.RemoveNode,rect:a,removeIds:_toConsumableArray(o),newWorkDatas:s};}return _objectSpread({type:ft.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getUnLockNodeMap",value:function getUnLockNodeMap(t){var e;if(this.serviceWork){var n=Xt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator16=_createForOfIteratorHelper(i.values()),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var o=_step16.value;if((e=o.selectIds)!=null&&e.length){var _iterator18=_createForOfIteratorHelper(o.selectIds),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var s=_step18.value;n["delete"](s);}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}}}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var _iterator17=_createForOfIteratorHelper(a.keys()),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _o3=_step17.value;n["delete"](_o3);}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}return n;}return t;}}]);}(yt);// 来源于white-sdk
408
+ nt(Se,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var se=Se;var Ad="__lodash_hash_undefined__";function Cd(f){return this.__data__.set(f,Ad),this;}var Rd=Cd;function Id(f){return this.__data__.has(f);}var Ld=Id,bd=wn,Dd=Rd,wd=Ld;function He(f){var r=-1,t=f==null?0:f.length;for(this.__data__=new bd();++r<t;)this.add(f[r]);}He.prototype.add=He.prototype.push=Dd;He.prototype.has=wd;var Rr=He;function Nd(f,r){for(var t=-1,e=f==null?0:f.length;++t<e;)if(r(f[t],t,f))return!0;return!1;}var Wd=Nd;function Bd(f,r){return f.has(r);}var Ir=Bd,Fd=Rr,Ud=Wd,jd=Ir,$d=1,zd=2;function Gd(f,r,t,e,n,i){var a=t&$d,o=f.length,s=r.length;if(o!=s&&!(a&&s>o))return!1;var c=i.get(f),p=i.get(r);if(c&&p)return c==r&&p==f;var h=-1,v=!0,y=t&zd?new Fd():void 0;for(i.set(f,r),i.set(r,f);++h<o;){var M=f[h],T=r[h];if(e)var m=a?e(T,M,h,r,f,i):e(M,T,h,f,r,i);if(m!==void 0){if(m)continue;v=!1;break;}if(y){if(!Ud(r,function(x,l){if(!jd(y,l)&&(M===x||n(M,x,t,e,i)))return y.push(l);})){v=!1;break;}}else if(!(M===T||n(M,T,t,e,i))){v=!1;break;}}return i["delete"](f),i["delete"](r),v;}var oi=Gd;function Hd(f){var r=-1,t=Array(f.size);return f.forEach(function(e,n){t[++r]=[n,e];}),t;}var Kd=Hd;function Vd(f){var r=-1,t=Array(f.size);return f.forEach(function(e){t[++r]=e;}),t;}var Lr=Vd,ln=Ne,cn=qn,Yd=vr,Xd=oi,Jd=Kd,Qd=Lr,Zd=1,kd=2,qd="[object Boolean]",_d="[object Date]",t0="[object Error]",e0="[object Map]",r0="[object Number]",n0="[object RegExp]",i0="[object Set]",s0="[object String]",o0="[object Symbol]",a0="[object ArrayBuffer]",l0="[object DataView]",fn=ln?ln.prototype:void 0,ir=fn?fn.valueOf:void 0;function c0(f,r,t,e,n,i,a){switch(t){case l0:if(f.byteLength!=r.byteLength||f.byteOffset!=r.byteOffset)return!1;f=f.buffer,r=r.buffer;case a0:return!(f.byteLength!=r.byteLength||!i(new cn(f),new cn(r)));case qd:case _d:case r0:return Yd(+f,+r);case t0:return f.name==r.name&&f.message==r.message;case n0:case s0:return f==r+"";case e0:var o=Jd;case i0:var s=e&Zd;if(o||(o=Qd),f.size!=r.size&&!s)return!1;var c=a.get(f);if(c)return c==r;e|=kd,a.set(f,r);var p=Xd(o(f),o(r),e,n,i,a);return a["delete"](f),p;case o0:if(ir)return ir.call(f)==ir.call(r);}return!1;}var f0=c0,un=Qn,u0=1,h0=Object.prototype,d0=h0.hasOwnProperty;function g0(f,r,t,e,n,i){var a=t&u0,o=un(f),s=o.length,c=un(r),p=c.length;if(s!=p&&!a)return!1;for(var h=s;h--;){var v=o[h];if(!(a?v in r:d0.call(r,v)))return!1;}var y=i.get(f),M=i.get(r);if(y&&M)return y==r&&M==f;var T=!0;i.set(f,r),i.set(r,f);for(var m=a;++h<s;){v=o[h];var x=f[v],l=r[v];if(e)var d=a?e(l,x,v,r,f,i):e(x,l,v,f,r,i);if(!(d===void 0?x===l||n(x,l,t,e,i):d)){T=!1;break;}m||(m=v=="constructor");}if(T&&!m){var u=f.constructor,g=r.constructor;u!=g&&"constructor"in f&&"constructor"in r&&!(typeof u=="function"&&u instanceof u&&typeof g=="function"&&g instanceof g)&&(T=!1);}return i["delete"](f),i["delete"](r),T;}var p0=g0,sr=Nn,v0=oi,m0=f0,y0=p0,hn=rr,dn=We,gn=yr,S0=zn,x0=1,pn="[object Arguments]",vn="[object Array]",Fe="[object Object]",T0=Object.prototype,mn=T0.hasOwnProperty;function M0(f,r,t,e,n,i){var a=dn(f),o=dn(r),s=a?vn:hn(f),c=o?vn:hn(r);s=s==pn?Fe:s,c=c==pn?Fe:c;var p=s==Fe,h=c==Fe,v=s==c;if(v&&gn(f)){if(!gn(r))return!1;a=!0,p=!1;}if(v&&!p)return i||(i=new sr()),a||S0(f)?v0(f,r,t,e,n,i):m0(f,r,s,t,e,n,i);if(!(t&x0)){var y=p&&mn.call(f,"__wrapped__"),M=h&&mn.call(r,"__wrapped__");if(y||M){var T=y?f.value():f,m=M?r.value():r;return i||(i=new sr()),n(T,m,t,e,i);}}return v?(i||(i=new sr()),y0(f,r,t,e,n,i)):!1;}var O0=M0,P0=O0,yn=ne;function ai(f,r,t,e,n){return f===r?!0:f==null||r==null||!yn(f)&&!yn(r)?f!==f&&r!==r:P0(f,r,t,e,ai,n);}var E0=ai,A0=E0;function C0(f,r){return A0(f,r);}var R0=C0,ce=/* @__PURE__ */ue(R0);var Qe=/*#__PURE__*/function(_yt4){function Qe(t){var _this71;_classCallCheck(this,Qe);_this71=_callSuper(this,Qe,[t]);nt(_this71,"toolsType",gt.Selector);nt(_this71,"tmpPoints",[]);nt(_this71,"workOptions");nt(_this71,"vNodes");nt(_this71,"selectIds");nt(_this71,"selectorColor");nt(_this71,"strokeColor");nt(_this71,"fillColor");nt(_this71,"oldSelectRect");nt(_this71,"canRotate",!1);nt(_this71,"canTextEdit",!1);nt(_this71,"canLock",!1);nt(_this71,"scaleType",zt.all);nt(_this71,"toolsTypes");nt(_this71,"shapeOpt");nt(_this71,"textOpt");nt(_this71,"isLocked");_this71.workOptions=t.toolsOpt,_this71.vNodes=t.vNodes;return _this71;}_inherits(Qe,_yt4);return _createClass(Qe,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=Ft(this.tmpPoints);if(e.w===0||e.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(e,t),n=_this$vNodes$getRectI.rectRange,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length,n=t.length;if(n>1){var i=new Mt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);e===2?this.tmpPoints.splice(1,1,i):this.tmpPoints.push(i);}}},{key:"drawSelector",value:function drawSelector(t){var _this72=this;var e=t.drawRect,n=t.subNodeMap,i=t.selectorId,a=t.layer,o=t.isService,s=new re({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:9999}),c=[];if(o){var p=new an({normalize:!0,pos:[e.w/2,e.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:e.w,height:e.h,name:Qe.selectorBorderId});c.push(p);}n.forEach(function(p,h){var v=[p.rect.x+p.rect.w/2-e.x,p.rect.y+p.rect.h/2-e.y],y=new an({normalize:!0,pos:v,lineWidth:1,strokeColor:n.size>1?_this72.selectorColor||_this72.workOptions.strokeColor:void 0,width:p.rect.w,height:p.rect.h,id:"selector-".concat(h),name:"selector-".concat(h)});c.push(y);}),c&&s.append.apply(s,c),(a==null?void 0:a.parent).appendChild(s);}},{key:"draw",value:function draw(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var s,c;var a=n.intersectRect,o=n.subNodeMap;(c=(s=e.parent)==null?void 0:s.getElementById(t))==null||c.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:o,selectorId:t,layer:e,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=zt.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;var e=/* @__PURE__ */new Set();var n;var _iterator19=_createForOfIteratorHelper(t.values()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var i=_step19.value;var a=i.opt,o=i.canRotate,s=i.scaleType,c=i.toolsType;this.selectorColor=this.workOptions.strokeColor,a.strokeColor&&(this.strokeColor=a.strokeColor),a.fillColor&&(this.fillColor=a.fillColor),a.textOpt&&(this.textOpt=a.textOpt),c===gt.SpeechBalloon&&(e.add(c),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=a.placement),c===gt.Polygon&&(e.add(c),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices),c===gt.Star&&(e.add(c),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices,this.shapeOpt.innerRatio=a.innerRatio,this.shapeOpt.innerVerticeStep=a.innerVerticeStep),c===gt.Text&&(this.textOpt=a),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=o,this.scaleType=s),s===zt.none&&(this.scaleType=s),c===gt.Image&&(n=i);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}e.size&&(this.toolsTypes=_toConsumableArray(e)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=zt.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)):t.size>1&&!n.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var t,e;if(this.scaleType===zt.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],i=(e=this.vNodes.get(n))==null?void 0:e.op;if(i){var a=[];for(var o=0;o<i.length;o+=3)a.push([i[o],i[o+1]]);return a;}}}},{key:"consume",value:function consume(t){var _t$data2=t.data,e=_t$data2.op,n=_t$data2.workState;var i=this.oldSelectRect;if(n===It.Start&&(i=this.unSelectedAllIds()),!(e!=null&&e.length)||!this.vNodes.curNodeMap.size)return{type:ft.None};this.updateTempPoints(e);var a=this.computSelector();if(this.selectIds&&ce(this.selectIds,a.selectIds))return{type:ft.None};this.selectIds=a.selectIds;var o=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(wt,this.fullLayer,a),this.oldSelectRect=o;var s=this.getChildrenPoints();return _objectSpread({type:ft.Select,dataType:Tt.Local,rect:Ot(o,i),selectIds:a.selectIds,selectRect:o,selectorColor:this.selectorColor,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:s,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var e,n;var t=this.oldSelectRect;if(!((e=this.selectIds)!=null&&e.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,wt,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return _objectSpread({type:ft.Select,dataType:Tt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt},this.baseConsumeResult);}return{type:ft.None};}},{key:"consumeService",value:function consumeService(){}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0;}},{key:"selectSingleTool",value:function selectSingleTool(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:wt;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var i=t[0],a=t[1];var o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:a,w:0,h:0},!1),s=_this$vNodes$getRectI2.nodeRange,c=_toConsumableArray(s.values()).sort(function(p,h){return(h.opt.zIndex||0)-(p.opt.zIndex||0);});var _iterator20=_createForOfIteratorHelper(c),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var _p8=_step20.value;var _h5=this.fullLayer.getElementsByName(_p8.name);if(vi(_h5).find(function(y){return y.isPointCollision(i,a);})){o=_p8;break;}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}if(o){var p=o.name;if(!ce(this.oldSelectRect,o.rect)){var h=/* @__PURE__ */new Map([[p,o]]);this.getSelecteorInfo(h),this.draw(e,this.fullLayer,{intersectRect:o.rect,subNodeMap:h,selectIds:this.selectIds||[]},n);}this.selectIds=[p],this.oldSelectRect=o.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator21=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _step21$value=_slicedToArray(_step21.value,2),_e4=_step21$value[0],n=_step21$value[1];n.isSelected&&(t=Ot(t,n.rect),this.vNodes.unSelected(_e4));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var e;var _iterator22=_createForOfIteratorHelper(t),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var n=_step22.value;var i=this.vNodes.get(n);i&&i.isSelected&&(e=Ot(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}return e;}},{key:"selectedByIds",value:function selectedByIds(t){var e;var _iterator23=_createForOfIteratorHelper(t),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var n=_step23.value;var i=this.vNodes.get(n);i&&(e=Ot(e,i.rect),this.vNodes.selected(n));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return e;}},{key:"getSelectorRect",value:function getSelectorRect(t,e){var o;var n;var i=(o=t.parent)==null?void 0:o.getElementById(e),a=i==null?void 0:i.getBoundingClientRect();return a&&(n=Ot(n,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+1),h:Math.floor(a.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===gt.Ellipse||t===gt.Triangle||t===gt.Rectangle||t===gt.Polygon||t===gt.Star||t===gt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var e,n,i,a,o,s,c,p,h,v,y,M,T,m,x,l,d,u,_iterator24,_step24,A,R,b,E,L,D,I,C,W,g,_A3,_R5,_b11,O;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:e=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,a=t.willSerializeData,o=t.worker,s=t.scene,c=t.isMainThread,p=t.offset,h=this.fullLayer;if(h){_context24.next=3;break;}return _context24.abrupt("return");case 3:y=/* @__PURE__ */new Map(),M=e.originPoint,T=e.workState,m=e.angle,x=e.translate,l=e.dir,d=e.scale;p&&(x?e.translate=[x[0]+p[0],x[1]+p[1]]:e.translate=p);if(!(M||x||qt(m))){_context24.next=9;break;}if(!(T===It.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:ft.Select,dataType:Tt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:u=i.getLastTarget();case 9:if(!n){_context24.next=59;break;}_iterator24=_createForOfIteratorHelper(n);_context24.prev=11;_iterator24.s();case 13:if((_step24=_iterator24.n()).done){_context24.next=51;break;}A=_step24.value;R=i.get(A);if(!R){_context24.next=49;break;}b=R.toolsType,E=(h==null?void 0:h.getElementsByName(A))[0];if(!E){_context24.next=49;break;}L=_objectSpread({},e);D=void 0;if(!b){_context24.next=49;break;}D=u==null?void 0:u.get(A);I=pi(b);if(!(I==null||I.updateNodeOpt({node:E,opt:L,vNodes:i,willSerializeData:a,targetNode:D}),R&&o&&(a&&(L.angle||L.translate)||L.originPoint&&L.scenePoint&&L.scale||L.pointMap&&L.pointMap.has(A)||b===gt.Text&&(L.fontSize||L.translate||L.textInfos&&L.textInfos.get(A))||b===gt.Image&&(L.angle||L.translate||L.scale)||b===L.toolsType&&L.willRefresh))){_context24.next=48;break;}C=o.createWorkShapeNode({workId:A,toolsType:b,toolsOpt:R.opt});C==null||C.setWorkId(A);W=void 0;if(!(b===gt.Image&&s)){_context24.next=34;break;}_context24.next=31;return C.consumeServiceAsync({isFullWork:!0,replaceId:A,scene:s,isMainThread:c});case 31:W=_context24.sent;_context24.next=47;break;case 34:if(!(b===gt.Text)){_context24.next=40;break;}_context24.next=37;return C.consumeServiceAsync({isFullWork:!0,replaceId:A});case 37:W=_context24.sent;_context24.next=47;break;case 40:_context24.prev=40;W=C==null?void 0:C.consumeService({op:R.op,isFullWork:!0,replaceId:A});_context24.next=47;break;case 44:_context24.prev=44;_context24.t0=_context24["catch"](40);return _context24.abrupt("continue",49);case 47:W&&(R.rect=W);case 48:R&&(y.set(A,R),v=Ot(v,R.rect));case 49:_context24.next=13;break;case 51:_context24.next=56;break;case 53:_context24.prev=53;_context24.t1=_context24["catch"](11);_iterator24.e(_context24.t1);case 56:_context24.prev=56;_iterator24.f();return _context24.finish(56);case 59:u&&T===It.Done&&(i.deleteLastTarget(),u=void 0);g=v;if(!(M&&x&&d&&l&&g&&!p)){_context24.next=79;break;}_A3=[[g.x,g.y],[g.x+g.w,g.y],[g.x+g.w,g.y+g.h],[g.x,g.y+g.h]];_context24.t2=l;_context24.next=_context24.t2==="top"?66:_context24.t2==="topLeft"?66:_context24.t2==="left"?66:_context24.t2==="topRight"?68:_context24.t2==="right"?70:_context24.t2==="bottomRight"?70:_context24.t2==="bottom"?70:_context24.t2==="bottomLeft"?72:74;break;case 66:x[0]>0&&x[1]>0?_R5=_A3[0]:x[0]>0?_R5=_A3[3]:x[1]>0?_R5=_A3[1]:_R5=_A3[2];return _context24.abrupt("break",74);case 68:x[0]<0&&x[1]>0?_R5=_A3[1]:x[0]<0?_R5=_A3[2]:x[1]>0?_R5=_A3[0]:_R5=_A3[3];return _context24.abrupt("break",74);case 70:x[0]<0&&x[1]<0?_R5=_A3[2]:x[0]<0?_R5=_A3[1]:x[1]<0?_R5=_A3[3]:_R5=_A3[0];return _context24.abrupt("break",74);case 72:x[0]>0&&x[1]<0?_R5=_A3[3]:x[0]>0?_R5=_A3[0]:x[1]<0?_R5=_A3[2]:_R5=_A3[1];return _context24.abrupt("break",74);case 74:_b11=_R5&&[M[0]-_R5[0],M[1]-_R5[1]]||[0,0];if(ce(_b11,[0,0])){_context24.next=79;break;}_context24.next=78;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{},offset:_b11}));case 78:return _context24.abrupt("return",_context24.sent);case 79:this.getSelecteorInfo(y),this.draw(wt,h,{selectIds:n||[],subNodeMap:y,intersectRect:g});O=Ot(this.oldSelectRect,g);return _context24.abrupt("return",(this.oldSelectRect=g,{type:ft.Select,dataType:Tt.Local,selectRect:g,renderRect:v,rect:Ot(O,g),selectIds:n}));case 82:case"end":return _context24.stop();}},_callee22,this,[[11,53,56,59],[40,44]]);}));function updateSelector(_x64){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:ft.Select,dataType:Tt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(pr,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,e,n){var _this73=this;var i=e.selectIds,a=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,a);var s;var c=/* @__PURE__ */new Map();return i==null||i.forEach(function(p){var h=_this73.vNodes.get(p);h&&(s=Ot(s,h.rect),c.set(p,h));}),this.getSelecteorInfo(c),this.draw(a,this.fullLayer,{intersectRect:s,selectIds:i||[],subNodeMap:c},n),Ot(s,o);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this74=this;var n;var t;var e=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(i){var a=_this74.vNodes.get(i);a&&(t=Ot(t,a.rect),e.set(i,a));},this),this.getSelecteorInfo(e),this.draw(wt,this.fullLayer,{intersectRect:t,subNodeMap:e,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var a;var e;var n=(a=this.selectIds)==null?void 0:a.filter(function(o){return!t.includes(o);});if(n!=null&&n.length&&(e=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);e=Ot(e,o);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:e,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var a,o;var e=this.oldSelectRect;this.selectIds=[];var n=(a=this.workId)==null?void 0:a.toString(),i=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(i,n,!0),this.oldSelectRect&&!ce(e,this.oldSelectRect))return{type:ft.CursorHover,dataType:Tt.Local,rect:Ot(e,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),e&&!this.oldSelectRect)return this.cursorBlur(),{type:ft.CursorHover,dataType:Tt.Local,rect:e,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var e,n;this.selectIds=[];var t=(e=this.workId)==null?void 0:e.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(i){i.name===t&&i.remove();});}}]);}(yt);nt(Qe,"selectorBorderId","selector-border");var Ke=Qe;var li=/*#__PURE__*/function(_yt5){function li(t){var _this75;_classCallCheck(this,li);_this75=_callSuper(this,li,[t]);nt(_this75,"canRotate",!1);nt(_this75,"scaleType",zt.both);nt(_this75,"toolsType",gt.Arrow);nt(_this75,"tmpPoints",[]);nt(_this75,"workOptions");nt(_this75,"oldRect");nt(_this75,"arrowTipWidth");nt(_this75,"syncTimestamp");_this75.workOptions=t.toolsOpt,_this75.arrowTipWidth=_this75.workOptions.thickness*4,_this75.syncTimestamp=0,_this75.syncUnitTime=50;return _this75;}_inherits(li,_yt5);return _createClass(li,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y});}if(!i){var _y8=Date.now();return _y8-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y8,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread(_objectSpread({rect:v},this.baseConsumeResult),{},{type:ft.DrawWork,dataType:Tt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0});}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions6=this.workOptions,i=_this$workOptions6.strokeColor,a=_this$workOptions6.thickness,o=_this$workOptions6.zIndex,s=_this$workOptions6.scale,c=_this$workOptions6.rotate,p=_this$workOptions6.translate,h=n.worldPosition,v=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(a),y=_this$computDrawPoint2.points,M=_this$computDrawPoint2.rect,m={pos:[M.x+M.w/2,M.y+M.h/2],name:e,id:e,close:!0,points:y,fillColor:i,strokeColor:i,lineWidth:0,normalize:!0,zIndex:o};s&&(m.scale=s),c&&(m.rotate=c),p&&(m.translate=p);var x=new fe(m);if(this.replace(n,e,x),s||c||p){var _l32=x.getBoundingClientRect();return{x:Math.floor(_l32.x-yt.SafeBorderPadding),y:Math.floor(_l32.y-yt.SafeBorderPadding),w:Math.floor(_l32.width+yt.SafeBorderPadding*2),h:Math.floor(_l32.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(M.x*v[0]+h[0]-yt.SafeBorderPadding),y:Math.floor(M.y*v[1]+h[1]-yt.SafeBorderPadding),w:Math.floor(M.w*v[0]+2*yt.SafeBorderPadding),h:Math.floor(M.h*v[1]+2*yt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(t):this.computTrianglePoints();}},{key:"computFullArrowPoints",value:function computFullArrowPoints(t){var _this76=this;var e=tt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=tt.Per(e).mul(t/2),i=Mt.Sub(this.tmpPoints[0],n),a=Mt.Add(this.tmpPoints[0],n),o=tt.Mul(e,this.arrowTipWidth),s=tt.Sub(this.tmpPoints[1],o),c=Mt.Sub(s,n),p=Mt.Add(s,n),h=tt.Per(e).mul(t*1.5),v=Mt.Sub(s,h),y=Mt.Add(s,h),M=[i,c,v,this.tmpPoints[1],y,p,a];return{points:M.map(function(T){return Mt.Sub(T,_this76.tmpPoints[0]).XY;}).flat(1),rect:Ft(M),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this77=this;var t=tt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),e=this.tmpPoints[1].distance(this.tmpPoints[0]),n=tt.Per(t).mul(Math.floor(e*3/8)),i=Mt.Sub(this.tmpPoints[0],n),a=Mt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],a];return{points:o.map(function(s){return Mt.Sub(s,_this77.tmpPoints[0]).XY;}).flat(1),rect:Ft(o),isTriangle:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a),o&&i.setInfo(e.name,o)),yt.updateNodeOpt(t);}}]);}(yt);var ci=/*#__PURE__*/function(_yt6){function ci(t){var _this78;_classCallCheck(this,ci);_this78=_callSuper(this,ci,[t]);nt(_this78,"canRotate",!1);nt(_this78,"scaleType",zt.all);nt(_this78,"toolsType",gt.Ellipse);nt(_this78,"tmpPoints",[]);nt(_this78,"workOptions");nt(_this78,"oldRect");nt(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(ci,_yt6);return _createClass(ci,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y,isDrawing:!0});}if(!i){var _y9=Date.now();return _y9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y9,_objectSpread(_objectSpread({type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local},this.baseConsumeResult),{},{ops:a,isSync:!0});}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions7=this.workOptions,a=_this$workOptions7.strokeColor,o=_this$workOptions7.fillColor,s=_this$workOptions7.thickness,c=_this$workOptions7.zIndex,p=_this$workOptions7.scale,h=_this$workOptions7.rotate,v=_this$workOptions7.translate,y=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(s),M=_this$computDrawPoint3.radius,T=_this$computDrawPoint3.rect,m=_this$computDrawPoint3.pos,x={pos:m,name:e,id:e,radius:M,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0},l={name:e,id:e,zIndex:c,pos:m,anchor:[0.5,0.5],size:[T.w,T.h]};p&&(l.scale=p),h&&(l.rotate=h),v&&(l.translate=v);var d=new re(l);if(i){var O=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/y[0],1/y[1]]});d.append(O);}var u=new yd(_objectSpread(_objectSpread({},x),{},{pos:[0,0]}));d.append(u),this.replace(n,e,d);var g=d.getBoundingClientRect();return{x:Math.floor(g.x-yt.SafeBorderPadding),y:Math.floor(g.y-yt.SafeBorderPadding),w:Math.floor(g.width+yt.SafeBorderPadding*2),h:Math.floor(g.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=Ft(this.tmpPoints),n=Ft(this.tmpPoints,t),i=[Math.floor(e.x+e.w/2),Math.floor(e.y+e.h/2)];return{rect:n,pos:i,radius:[Math.floor(e.w/2),Math.floor(e.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var p,h;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=i.get(e.name);var c=e;return e.tagName==="GROUP"&&(c=e.children[0]),a&&(c.setAttribute("strokeColor",a),(p=s==null?void 0:s.opt)!=null&&p.strokeColor&&(s.opt.strokeColor=a)),o&&(o==="transparent"?c.setAttribute("fillColor","rgba(0,0,0,0)"):c.setAttribute("fillColor",o),(h=s==null?void 0:s.opt)!=null&&h.fillColor&&(s.opt.fillColor=o)),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t);}}]);}(yt);var I0=he,L0=ne,b0="[object Boolean]";function D0(f){return f===!0||f===!1||L0(f)&&I0(f)==b0;}var w0=D0,oe=/* @__PURE__ */ue(w0);var fi=/*#__PURE__*/function(_yt7){function fi(t){var _this79;_classCallCheck(this,fi);_this79=_callSuper(this,fi,[t]);nt(_this79,"canRotate",!0);nt(_this79,"scaleType",zt.all);nt(_this79,"toolsType",gt.Rectangle);nt(_this79,"tmpPoints",[]);nt(_this79,"workOptions");nt(_this79,"oldRect");nt(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(fi,_yt7);return _createClass(fi,[{key:"transformData",value:function transformData(){var t=Ft(this.tmpPoints);return[[t.x,t.y,0],[t.x+t.w,t.y,0],[t.x+t.w,t.y+t.h,0],[t.x,t.y+t.h,0]];}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=this.workOptions.thickness,n=[];var _iterator25=_createForOfIteratorHelper(t),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var o=_step25.value;n.push(_construct(tt,_toConsumableArray(o)));}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}var i=Ft(n,e),a=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:a,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h=this.transformData();var v;if(i||a){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({ps:h,workId:o,layer:M,isDrawing:!0});}if(!i){var _M2=Date.now();return _M2-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M2,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:h.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var y=Ot(v,this.oldRect);return this.oldRect=v,_objectSpread({rect:y,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var s;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.transformData(),n=this.fullLayer,i=this.draw({ps:e,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var a=e.flat(1),o=_t(a);return(s=this.vNodes)==null||s.setInfo(t,{rect:i,op:a,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&yt.getCenterPos(i,n)}),_objectSpread({rect:i,type:ft.FullWork,dataType:Tt.Local,ops:o,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,a=t.ps,o=t.replaceId,_this$workOptions8=this.workOptions,s=_this$workOptions8.strokeColor,c=_this$workOptions8.fillColor,p=_this$workOptions8.thickness,h=_this$workOptions8.zIndex,v=_this$workOptions8.scale,y=_this$workOptions8.rotate,M=_this$workOptions8.translate,T=_this$workOptions8.textOpt,m=n.worldPosition,x=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(a),l=_this$computDrawPoint4.points,d=_this$computDrawPoint4.rect,u=_this$computDrawPoint4.pos,g={close:!0,normalize:!0,points:l,lineWidth:p,fillColor:c!=="transparent"&&c||void 0,strokeColor:s,lineJoin:"round"},O={x:Math.floor(d.x*x[0]+m[0]-yt.SafeBorderPadding),y:Math.floor(d.y*x[1]+m[1]-yt.SafeBorderPadding),w:Math.floor(d.w*x[0]+2*yt.SafeBorderPadding),h:Math.floor(d.h*x[0]+2*yt.SafeBorderPadding)},A=new re({name:e,id:e,zIndex:h,pos:u,anchor:[0.5,0.5],size:[d.w,d.h],scale:v,rotate:y,translate:M}),R=new fe(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));if(A.appendChild(R),i){var b=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/x[0],1/x[1]]});A.appendChild(b);}if(this.replace(n,o||e,A),v||y||M){var _b12=A.getBoundingClientRect();return{x:Math.floor(_b12.x-yt.SafeBorderPadding),y:Math.floor(_b12.y-yt.SafeBorderPadding),w:Math.floor(_b12.width+2*yt.SafeBorderPadding),h:Math.floor(_b12.height+2*yt.SafeBorderPadding)};}return O;}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var p,h;var e=t.op,n=t.isFullWork,i=t.replaceId,a=(p=this.workId)==null?void 0:p.toString();if(!a)return;var o=[];for(var v=0;v<e.length;v+=3)o.push([e[v],e[v+1],e[v+2]]);var s=n?this.fullLayer:this.drawLayer||this.fullLayer,c=this.draw({ps:o,workId:a,layer:s,isDrawing:!1,replaceId:i});return this.oldRect=c,(h=this.vNodes)==null||h.setInfo(a,{rect:c,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&yt.getCenterPos(c,s)}),c;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var x,l;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.fontColor,c=n.fontBgColor,p=n.bold,h=n.italic,v=n.lineThrough,y=n.underline,M=n.fontSize,T=i.get(e.name);var m=e;if(e.tagName==="GROUP"&&(m=e.children[0]),a&&(m.setAttribute("strokeColor",a),(x=T==null?void 0:T.opt)!=null&&x.strokeColor&&(T.opt.strokeColor=a)),o&&(o==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",o),(l=T==null?void 0:T.opt)!=null&&l.fillColor&&(T.opt.fillColor=o)),T!=null&&T.opt.textOpt){var d=T.opt.textOpt;s&&d.fontColor&&(d.fontColor=s),c&&d.fontBgColor&&(d.fontBgColor=c),p&&(d.bold=p),h&&(d.italic=h),oe(v)&&(d.lineThrough=v),oe(y)&&(d.underline=y),M&&(d.fontSize=M);}return T&&i.setInfo(e.name,T),yt.updateNodeOpt(t);}}]);}(yt);var ui=/*#__PURE__*/function(_yt8){function ui(t){var _this80;_classCallCheck(this,ui);_this80=_callSuper(this,ui,[t]);nt(_this80,"canRotate",!1);nt(_this80,"scaleType",zt.all);nt(_this80,"toolsType",gt.Star);nt(_this80,"tmpPoints",[]);nt(_this80,"workOptions");nt(_this80,"oldRect");nt(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(ui,_yt8);return _createClass(ui,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y,isDrawing:!0});}if(!i){var _y10=Date.now();return _y10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y10,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions9=this.workOptions,a=_this$workOptions9.strokeColor,o=_this$workOptions9.fillColor,s=_this$workOptions9.thickness,c=_this$workOptions9.zIndex,p=_this$workOptions9.vertices,h=_this$workOptions9.innerVerticeStep,v=_this$workOptions9.innerRatio,y=_this$workOptions9.scale,M=_this$workOptions9.rotate,T=_this$workOptions9.translate,m=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(s,p,h,v),x=_this$computDrawPoint5.rect,l=_this$computDrawPoint5.pos,d=_this$computDrawPoint5.points,u={close:!0,points:d,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},g={name:e,id:e,zIndex:c,pos:l,anchor:[0.5,0.5],size:[x.w,x.h],className:"".concat(l[0],",").concat(l[1])};y&&(g.scale=y),M&&(g.rotate=M),T&&(g.translate=T);var O=new re(g);if(i){var b=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/m[0],1/m[1]]});O.append(b);}var A=new fe(_objectSpread(_objectSpread({},u),{},{pos:[0,0]}));O.append(A),this.replace(n,e,O);var R=O.getBoundingClientRect();return{x:Math.floor(R.x-yt.SafeBorderPadding),y:Math.floor(R.y-yt.SafeBorderPadding),w:Math.floor(R.width+yt.SafeBorderPadding*2),h:Math.floor(R.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e,n,i){var a=Ft(this.tmpPoints),o=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],s=yi(a.w,a.h),c=Math.floor(Math.min(a.w,a.h)/2),p=i*c,h=[],v=2*Math.PI/e;for(var M=0;M<e;M++){var T=M*v-0.5*Math.PI;var m=void 0,_x65=void 0;M%n===1?(m=p*s[0]*Math.cos(T),_x65=p*s[1]*Math.sin(T)):(m=c*s[0]*Math.cos(T),_x65=c*s[1]*Math.sin(T),h.push(m,_x65)),h.push(m,_x65);}return{rect:Ft(this.tmpPoints,t),pos:o,points:h};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Mt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.vertices,p=n.innerVerticeStep,h=n.innerRatio,v=i.get(e.name),y=v==null?void 0:v.opt;var M=e;return e.tagName==="GROUP"&&(M=e.children[0]),a&&(M.setAttribute("strokeColor",a),y!=null&&y.strokeColor&&(y.strokeColor=a)),o&&(o==="transparent"?M.setAttribute("fillColor","rgba(0,0,0,0)"):M.setAttribute("fillColor",o),y!=null&&y.fillColor&&(y.fillColor=o)),s===gt.Star&&(c&&(y.vertices=c),p&&(y.innerVerticeStep=p),h&&(y.innerRatio=h)),v&&i.setInfo(e.name,_objectSpread(_objectSpread({},v),{},{opt:y})),yt.updateNodeOpt(t);}}]);}(yt);var hi=/*#__PURE__*/function(_yt9){function hi(t){var _this81;_classCallCheck(this,hi);_this81=_callSuper(this,hi,[t]);nt(_this81,"canRotate",!1);nt(_this81,"scaleType",zt.all);nt(_this81,"toolsType",gt.Polygon);nt(_this81,"tmpPoints",[]);nt(_this81,"workOptions");nt(_this81,"oldRect");nt(_this81,"syncTimestamp");_this81.workOptions=t.toolsOpt,_this81.syncTimestamp=0,_this81.syncUnitTime=50;return _this81;}_inherits(hi,_yt9);return _createClass(hi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=e.op,s=this.workId,c=o==null?void 0:o.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(o[0],o[1])],p=!1):p=this.updateTempPoints(o),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:s,layer:y,isDrawing:!0});}if(!i){var _y11=Date.now();return _y11-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y11,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions10=this.workOptions,a=_this$workOptions10.strokeColor,o=_this$workOptions10.fillColor,s=_this$workOptions10.thickness,c=_this$workOptions10.zIndex,p=_this$workOptions10.vertices,h=_this$workOptions10.scale,v=_this$workOptions10.rotate,y=_this$workOptions10.translate,M=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(s,p),T=_this$computDrawPoint6.rect,m=_this$computDrawPoint6.pos,x=_this$computDrawPoint6.points,l={close:!0,points:x,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},d={name:e,id:e,zIndex:c,pos:m,anchor:[0.5,0.5],size:[T.w,T.h]};h&&(d.scale=h),v&&(d.rotate=v),y&&(d.translate=y);var u=new re(d);if(i){var A=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/M[0],1/M[1]]});u.append(A);}var g=new fe(_objectSpread(_objectSpread({},l),{},{pos:[0,0]}));u.append(g),this.replace(n,e,u);var O=u.getBoundingClientRect();return{x:Math.floor(O.x-yt.SafeBorderPadding),y:Math.floor(O.y-yt.SafeBorderPadding),w:Math.floor(O.width+yt.SafeBorderPadding*2),h:Math.floor(O.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Ft(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=yi(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),s=[],c=2*Math.PI/e;for(var h=0;h<e;h++){var v=h*c-0.5*Math.PI,y=o*a[0]*Math.cos(v),M=o*a[1]*Math.sin(v);s.push(y,M);}return{rect:Ft(this.tmpPoints,t),pos:i,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Mt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.vertices,p=i.get(e.name),h=p==null?void 0:p.opt;var v=e;return e.tagName==="GROUP"&&(v=e.children[0]),a&&(v.setAttribute("strokeColor",a),h!=null&&h.strokeColor&&(h.strokeColor=a)),o&&(o==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",o),h!=null&&h.fillColor&&(h.fillColor=o)),s===gt.Polygon&&c&&(h.vertices=c),p&&i.setInfo(e.name,_objectSpread(_objectSpread({},p),{},{opt:h})),yt.updateNodeOpt(t);}}]);}(yt);var kt=/*#__PURE__*/function(){function kt(){_classCallCheck(this,kt);}return _createClass(kt,null,[{key:"bezier",value:function bezier(r,t){var e=[];for(var n=0;n<t.length;n+=4){var i=t[n],a=t[n+1],o=t[n+2],s=t[n+3];i&&a&&o&&s?e.push.apply(e,_toConsumableArray(kt.getBezierPoints(r,i,a,o,s))):i&&a&&o?e.push.apply(e,_toConsumableArray(kt.getBezierPoints(r,i,a,o))):i&&a?e.push.apply(e,_toConsumableArray(kt.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
409
+ * @desc 获取点,这里可以设置点的个数
410
+ * @param {number} num 点个数
411
+ * @param {Vec2d} p1 点坐标
412
+ * @param {Vec2d} p2 点坐标
413
+ * @param {Vec2d} p3 点坐标
414
+ * @param {Vec2d} p4 点坐标
415
+ * 如果参数是 num, p1, p2 为一阶贝塞尔
416
+ * 如果参数是 num, p1, c1, p2 为二阶贝塞尔
417
+ * 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
418
+ */},{key:"getBezierPoints",value:function getBezierPoints(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var e=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var i=arguments.length>4?arguments[4]:undefined;var a=null;var o=[];!n&&!i?a=kt.oneBezier:n&&!i?a=kt.twoBezier:n&&i&&(a=kt.threeBezier);for(var s=0;s<r;s++)a&&o.push(a(s/r,t,e,n,i));return i?o.push(i):n&&o.push(n),o;}/**
419
+ * @desc 一阶贝塞尔
420
+ * @param {number} t 当前百分比
421
+ * @param {Vec2d} p1 起点坐标
422
+ * @param {Vec2d} p2 终点坐标
423
+ */},{key:"oneBezier",value:function oneBezier(r,t,e){var n=t.x+(e.x-t.x)*r,i=t.y+(e.y-t.y)*r;return new tt(n,i);}/**
424
+ * @desc 二阶贝塞尔
425
+ * @param {number} t 当前百分比
426
+ * @param {Array} p1 起点坐标
427
+ * @param {Array} p2 终点坐标
428
+ * @param {Array} cp 控制点
429
+ */},{key:"twoBezier",value:function twoBezier(r,t,e,n){var i=(1-r)*(1-r)*t.x+2*r*(1-r)*e.x+r*r*n.x,a=(1-r)*(1-r)*t.y+2*r*(1-r)*e.y+r*r*n.y;return new tt(i,a);}/**
430
+ * @desc 三阶贝塞尔
431
+ * @param {number} t 当前百分比
432
+ * @param {Array} p1 起点坐标
433
+ * @param {Array} p2 终点坐标
434
+ * @param {Array} cp1 控制点1
435
+ * @param {Array} cp2 控制点2
436
+ */},{key:"threeBezier",value:function threeBezier(r,t,e,n,i){var a=t.x*(1-r)*(1-r)*(1-r)+3*e.x*r*(1-r)*(1-r)+3*n.x*r*r*(1-r)+i.x*r*r*r,o=t.y*(1-r)*(1-r)*(1-r)+3*e.y*r*(1-r)*(1-r)+3*n.y*r*r*(1-r)+i.y*r*r*r;return new tt(a,o);}}]);}();var di=/*#__PURE__*/function(_yt10){function di(t){var _this82;_classCallCheck(this,di);_this82=_callSuper(this,di,[t]);nt(_this82,"canRotate",!1);nt(_this82,"scaleType",zt.all);nt(_this82,"toolsType",gt.SpeechBalloon);nt(_this82,"ratio",0.8);nt(_this82,"tmpPoints",[]);nt(_this82,"workOptions");nt(_this82,"oldRect");nt(_this82,"syncTimestamp");_this82.workOptions=t.toolsOpt,_this82.syncTimestamp=0,_this82.syncUnitTime=50;return _this82;}_inherits(di,_yt10);return _createClass(di,[{key:"consume",value:function consume(t){var y;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(y=e==null?void 0:e.workId)==null?void 0:y.toString();if(!o)return{type:ft.None};var s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:M,isDrawing:!0});}if(!i){var _M3=Date.now();return _M3-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M3,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(T){return[].concat(_toConsumableArray(T.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions11=this.workOptions,i=_this$workOptions11.strokeColor,a=_this$workOptions11.fillColor,o=_this$workOptions11.thickness,s=_this$workOptions11.zIndex,c=_this$workOptions11.placement,p=_this$workOptions11.scale,h=_this$workOptions11.rotate,v=_this$workOptions11.translate,_this$computDrawPoint7=this.computDrawPoints(o,c),y=_this$computDrawPoint7.rect,M=_this$computDrawPoint7.pos,T=_this$computDrawPoint7.points,m={points:T.map(function(g){return g.XY;}),lineWidth:o,fillColor:a!=="transparent"&&a||void 0,strokeColor:i,normalize:!0,className:"".concat(M[0],",").concat(M[1]),lineJoin:"round",close:!0},x={name:e,id:e,zIndex:s,pos:M,anchor:[0.5,0.5],size:[y.w,y.h]};p&&(x.scale=p),h&&(x.rotate=h),v&&(x.translate=v);var l=new re(x),d=new fe(_objectSpread(_objectSpread({},m),{},{pos:[0,0]}));l.append(d),this.replace(n,e,l);var u=l.getBoundingClientRect();return{x:Math.floor(u.x-yt.SafeBorderPadding),y:Math.floor(u.y-yt.SafeBorderPadding),w:Math.floor(u.width+yt.SafeBorderPadding*2),h:Math.floor(u.height+yt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var e=Ft(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=e.y+e.h*this.ratio;return[new tt(e.x,e.y,0),new tt(e.x+e.w,e.y,0),new tt(e.x+e.w,n,0),new tt(e.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=e.y+e.h*(1-this.ratio);return[new tt(e.x,_n4,0),new tt(e.x+e.w,_n4,0),new tt(e.x+e.w,e.y+e.h,0),new tt(e.x,e.y+e.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=e.x+e.w*(1-this.ratio);return[new tt(_n5,e.y,0),new tt(e.x+e.w,e.y,0),new tt(e.x+e.w,e.y+e.h,0),new tt(_n5,e.y+e.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=e.x+e.w*this.ratio;return[new tt(e.x,e.y,0),new tt(_n6,e.y,0),new tt(_n6,e.y+e.h,0),new tt(e.x,e.y+e.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Ft(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),s=[],c=tt.Add(i[0],new tt(0,o,0)),p=tt.Add(i[0],new tt(a,0,0)),h=kt.getBezierPoints(10,c,i[0],p),v=tt.Sub(i[1],new tt(a,0,0)),y=tt.Add(i[1],new tt(0,o,0)),M=kt.getBezierPoints(10,v,i[1],y),T=tt.Sub(i[2],new tt(0,o,0)),m=tt.Sub(i[2],new tt(a,0,0)),x=kt.getBezierPoints(10,T,i[2],m),l=tt.Add(i[3],new tt(a,0,0)),d=tt.Sub(i[3],new tt(0,o,0)),u=kt.getBezierPoints(10,l,i[3],d),g=a*(1-this.ratio)*10,O=o*(1-this.ratio)*10;switch(e){case"bottom":{var b=tt.Sub(i[2],new tt(a*5-g/2,0,0)),E=tt.Sub(i[2],new tt(a*5,-O,0)),L=tt.Sub(i[2],new tt(a*5+g/2,0,0));s.push.apply(s,[E,L].concat(_toConsumableArray(u),_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),[b]));break;}case"bottomRight":{var _b13=tt.Sub(i[2],new tt(a*1.1,0,0)),_E9=tt.Sub(i[2],new tt(a*1.1+g/2,-O,0)),_L8=tt.Sub(i[2],new tt(a*1.1+g,0,0));s.push.apply(s,[_E9,_L8].concat(_toConsumableArray(u),_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),[_b13]));break;}case"bottomLeft":{var _b14=tt.Add(i[3],new tt(a*1.1+g,0,0)),_E10=tt.Add(i[3],new tt(a*1.1+g/2,O,0)),_L9=tt.Add(i[3],new tt(a*1.1,0,0));s.push.apply(s,[_E10,_L9].concat(_toConsumableArray(u),_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),[_b14]));break;}case"top":{var _b15=tt.Sub(i[1],new tt(a*5-g/2,0,0)),_E11=tt.Sub(i[1],new tt(a*5,O,0)),_L10=tt.Sub(i[1],new tt(a*5+g/2,0,0));s.push.apply(s,[_E11,_b15].concat(_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(h),[_L10]));break;}case"topRight":{var _b16=tt.Sub(i[1],new tt(a*1.1,0,0)),_E12=tt.Sub(i[1],new tt(a*1.1+g/2,O,0)),_L11=tt.Sub(i[1],new tt(a*1.1+g,0,0));s.push.apply(s,[_E12,_b16].concat(_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(h),[_L11]));break;}case"topLeft":{var _b17=tt.Add(i[0],new tt(a*1.1+g,0,0)),_E13=tt.Add(i[0],new tt(a*1.1+g/2,-O,0)),_L12=tt.Add(i[0],new tt(a*1.1,0,0));s.push.apply(s,[_E13,_b17].concat(_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(h),[_L12]));break;}case"left":{var _b18=tt.Add(i[0],new tt(0,o*5-O/2,0)),_E14=tt.Add(i[0],new tt(-g,o*5,0)),_L13=tt.Add(i[0],new tt(0,o*5+O/2,0));s.push.apply(s,[_E14,_b18].concat(_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(u),[_L13]));break;}case"leftTop":{var _b19=tt.Add(i[0],new tt(0,o*1.1,0)),_E15=tt.Add(i[0],new tt(-g,o*1.1+O/2,0)),_L14=tt.Add(i[0],new tt(0,o*1.1+O,0));s.push.apply(s,[_E15,_b19].concat(_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(u),[_L14]));break;}case"leftBottom":{var _b20=tt.Sub(i[3],new tt(0,o*1.1+O,0)),_E16=tt.Sub(i[3],new tt(g,o*1.1+O/2,0)),_L15=tt.Sub(i[3],new tt(0,o*1.1,0));s.push.apply(s,[_E16,_b20].concat(_toConsumableArray(h),_toConsumableArray(M),_toConsumableArray(x),_toConsumableArray(u),[_L15]));break;}case"right":{var _b21=tt.Add(i[1],new tt(0,o*5-O/2,0)),_E17=tt.Add(i[1],new tt(g,o*5,0)),_L16=tt.Add(i[1],new tt(0,o*5+O/2,0));s.push.apply(s,[_E17,_L16].concat(_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(h),_toConsumableArray(M),[_b21]));break;}case"rightTop":{var _b22=tt.Add(i[1],new tt(0,o*1.1,0)),_E18=tt.Add(i[1],new tt(g,o*1.1+O/2,0)),_L17=tt.Add(i[1],new tt(0,o*1.1+O,0));s.push.apply(s,[_E18,_L17].concat(_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(h),_toConsumableArray(M),[_b22]));break;}case"rightBottom":{var _b23=tt.Sub(i[2],new tt(0,o*1.1+O,0)),_E19=tt.Sub(i[2],new tt(-g,o*1.1+O/2,0)),_L18=tt.Sub(i[2],new tt(0,o*1.1,0));s.push.apply(s,[_E19,_L18].concat(_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(h),_toConsumableArray(M),[_b23]));break;}}var A=Ft(this.tmpPoints,t),R=[Math.floor(A.x+A.w/2),Math.floor(A.y+A.h/2)];return{rect:A,pos:R,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Mt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.placement,p=i.get(e.name),h=p==null?void 0:p.opt;var v=e;return e.tagName==="GROUP"&&(v=e.children[0]),a&&(v.setAttribute("strokeColor",a),h!=null&&h.strokeColor&&(h.strokeColor=a)),o&&(o==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",o),h!=null&&h.fillColor&&(h.fillColor=o)),s===gt.SpeechBalloon&&c&&(h.placement=c),p&&i.setInfo(e.name,_objectSpread(_objectSpread({},p),{},{opt:h})),yt.updateNodeOpt(t);}}]);}(yt);var we=/*#__PURE__*/function(_yt11){function we(t){var _this83;_classCallCheck(this,we);_this83=_callSuper(this,we,[t]);nt(_this83,"canRotate",!0);nt(_this83,"scaleType",zt.all);nt(_this83,"toolsType",gt.Image);nt(_this83,"tmpPoints",[]);nt(_this83,"workOptions");nt(_this83,"oldRect");_this83.workOptions=t.toolsOpt,_this83.scaleType=we.getScaleType(_this83.workOptions);return _this83;}_inherits(we,_yt11);return _createClass(we,[{key:"consume",value:function consume(){return{type:ft.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ft.None};}},{key:"draw",value:function draw(t){var e=t.layer,n=t.workId,i=t.replaceId,a=t.imageBitmap,o=t.isMainThread,_this$workOptions12=this.workOptions,s=_this$workOptions12.centerX,c=_this$workOptions12.centerY,p=_this$workOptions12.width,h=_this$workOptions12.height,v=_this$workOptions12.rotate,y=_this$workOptions12.zIndex,M=!!e.parent.gl,T={anchor:[0.5,0.5],pos:[s,c],name:n,size:[p,h],zIndex:y,rotate:!o&&!M&&180+(v||0)||v,texture:a},m=new Md(T);this.replace(e,i||n,m);var x=m.getBoundingClientRect();if(x)return{x:Math.floor(x.x-yt.SafeBorderPadding),y:Math.floor(x.y-yt.SafeBorderPadding),w:Math.floor(x.width+yt.SafeBorderPadding*2),h:Math.floor(x.height+yt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var h,v,y,M,e,n,i,a,_this$workOptions13,o,s,c,p,T,m;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:e=t.isFullWork,n=t.replaceId,i=t.scene,a=t.isMainThread,_this$workOptions13=this.workOptions,o=_this$workOptions13.src,s=_this$workOptions13.uuid,c=((h=this.workId)==null?void 0:h.toString())||s,p=e?this.fullLayer:this.drawLayer||this.fullLayer;if(!o){_context25.next=7;break;}_context25.next=4;return i.preload({id:s,src:this.workOptions.src});case 4:T=_context25.sent;m=this.draw({workId:c,layer:p,replaceId:n,imageBitmap:T[0],isMainThread:a});return _context25.abrupt("return",(this.oldRect=c&&((y=(v=this.vNodes)==null?void 0:v.get(c))==null?void 0:y.rect)||void 0,(M=this.vNodes)==null||M.setInfo(c,{rect:m,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&yt.getCenterPos(m,p)}),m));case 7:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x66){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var e=t.uniformScale,n=t.rotate;return e!==!1||n&&Math.abs(n)%90>0?zt.proportional:zt.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.translate,s=n.originPoint,c=n.scenePoint,p=n.scale,h=n.angle,v=n.isLocked,y=n.zIndex,M=a&&Xt(a)||i.get(e.name);if(!M)return;var T=e.parent;if(T){if(qt(y)&&(e.setAttribute("zIndex",y),M.opt.zIndex=y),oe(v)&&(M.opt.locked=v),s&&c&&p){var _M$opt=M.opt,m=_M$opt.centerX,_x67=_M$opt.centerY,_l33=_M$opt.width,d=_M$opt.height,u=_M$opt.uniformScale,g=u!==!1?[p[0],p[0]]:p,O=[m,_x67],A=[m,_x67];Dr(A,c,g,o);var R=[A[0]-O[0],A[1]-O[1]];M.centerPos=[M.centerPos[0]+R[0],M.centerPos[1]+R[1]],M.opt.width=Math.round(_l33*g[0]),M.opt.height=Math.round(d*g[1]),M.opt.centerX=A[0],M.opt.centerY=A[1];}else if(o)M.opt.centerX=M.opt.centerX+o[0],M.opt.centerY=M.opt.centerY+o[1],M.centerPos=[M.centerPos[0]+o[0],M.centerPos[1]+o[1]];else if(qt(h))if(M.opt.rotate=h,M.scaleType=we.getScaleType(M.opt),a){var _m9=mi(M.rect,h);M.rect=_m9;}else{var _m10=yt.getRectFromLayer(T,e.name);M.rect=_m10||M.rect;}return M&&i.setInfo(e.name,M),M==null?void 0:M.rect;}}}]);}(yt);var gi=/*#__PURE__*/function(_yt12){function gi(t){var _this84;_classCallCheck(this,gi);_this84=_callSuper(this,gi,[t]);nt(_this84,"canRotate",!1);nt(_this84,"scaleType",zt.both);nt(_this84,"toolsType",gt.Straight);nt(_this84,"tmpPoints",[]);nt(_this84,"workOptions");nt(_this84,"oldRect");nt(_this84,"straightTipWidth");nt(_this84,"syncTimestamp");_this84.workOptions=t.toolsOpt,_this84.straightTipWidth=_this84.workOptions.thickness/2,_this84.syncTimestamp=0,_this84.syncUnitTime=50;return _this84;}_inherits(gi,_yt12);return _createClass(gi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ft.None};var p;if(this.tmpPoints.length===0?(this.tmpPoints=[new Mt(s[0],s[1])],p=!1):p=this.updateTempPoints(s),!p)return{type:ft.None};var h;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;h=this.draw({workId:o,layer:y});}if(!i){var _y12=Date.now();return _y12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y12,_objectSpread({type:ft.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ft.None};}var v=Ot(h,this.oldRect);return this.oldRect=h,_objectSpread({rect:v,type:ft.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ft.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=_t(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&yt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ft.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions14=this.workOptions,i=_this$workOptions14.strokeColor,a=_this$workOptions14.thickness,o=_this$workOptions14.zIndex,s=_this$workOptions14.scale,c=_this$workOptions14.rotate,p=_this$workOptions14.translate,h=n.worldPosition,v=n.worldScaling,_this$computDrawPoint8=this.computDrawPoints(a),y=_this$computDrawPoint8.d,M=_this$computDrawPoint8.rect,T=[M.x+M.w/2,M.y+M.h/2],m={pos:T,name:e,id:e,d:y,fillColor:i,strokeColor:i,lineWidth:0,className:"".concat(T[0],",").concat(T[1]),normalize:!0,zIndex:o};s&&(m.scale=s),c&&(m.rotate=c),p&&(m.translate=p);var x=new ge(m);if(this.replace(n,e,x),c||s||p){var d=x.getBoundingClientRect();return{x:Math.floor(d.x-yt.SafeBorderPadding),y:Math.floor(d.y-yt.SafeBorderPadding),w:Math.floor(d.width+yt.SafeBorderPadding*2),h:Math.floor(d.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(M.x*v[0]+h[0]-yt.SafeBorderPadding),y:Math.floor(M.y*v[1]+h[1]-yt.SafeBorderPadding),w:Math.floor(M.w*v[0]+2*yt.SafeBorderPadding),h:Math.floor(M.h*v[1]+2*yt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t){var e=tt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=tt.Per(e).mul(t/2),i=Mt.Sub(this.tmpPoints[0],n),a=Mt.Add(this.tmpPoints[0],n),o=Mt.Sub(this.tmpPoints[1],n),s=Mt.Add(this.tmpPoints[1],n),c=Mt.GetSemicircleStroke(this.tmpPoints[1],o,-1,8),p=Mt.GetSemicircleStroke(this.tmpPoints[0],a,-1,8),h=[i,o].concat(_toConsumableArray(c),[s,a],_toConsumableArray(p));return{d:Te(h,!0),rect:Ft(h),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var e=Mt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:Te(e,!0),rect:Ft(e),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Mt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,c;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Mt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(c=this.vNodes)==null||c.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t);}}]);}(yt);var Jt=/*#__PURE__*/function(_yt13){function Jt(t){var _this85;_classCallCheck(this,Jt);_this85=_callSuper(this,Jt,[t]);nt(_this85,"canRotate",!1);nt(_this85,"scaleType",zt.proportional);nt(_this85,"toolsType",gt.Text);nt(_this85,"tmpPoints",[]);nt(_this85,"workOptions");nt(_this85,"oldRect");_this85.workOptions=t.toolsOpt;return _this85;}_inherits(Jt,_yt13);return _createClass(Jt,[{key:"consume",value:function consume(){return{type:ft.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ft.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var e,n,i,_this$workOptions15,a,o,s,c,p,h,v,y,M,T,m,_x69;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:e=t.workId,n=t.layer,i=t.isDrawLabel,_this$workOptions15=this.workOptions,a=_this$workOptions15.boxSize,o=_this$workOptions15.boxPoint,s=_this$workOptions15.zIndex,c=n.worldPosition,p=n.worldScaling;if(!(!o||!a)){_context26.next=3;break;}return _context26.abrupt("return");case 3:h={name:e,id:e,pos:[o[0],o[1]],anchor:[0,0],size:a,zIndex:s},v=new re(h),y={x:o[0],y:o[1],w:a[0],h:a[1]},M={x:Math.floor(y.x*p[0]+c[0]),y:Math.floor(y.y*p[1]+c[1]),w:Math.floor(y.w*p[0])+2,h:Math.floor(y.h*p[1])+2};if(!(this.replace(n,e,v),i&&n&&this.workOptions.text)){_context26.next=11;break;}_context26.next=7;return Jt.createLabels(this.workOptions,n,M);case 7:T=_context26.sent;m=T.labels;_x69=T.maxWidth;v.append.apply(v,_toConsumableArray(m)),M.w=Math.ceil(Math.max(_x69*n.worldScaling[0],M.w));case 11:return _context26.abrupt("return",M);case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x68){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var c,p,h,v,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:e=(c=this.workId)==null?void 0:c.toString();if(e){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,a=t.isDrawLabel;this.oldRect=i&&((h=(p=this.vNodes)==null?void 0:p.get(i))==null?void 0:h.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:e,layer:o,isDrawLabel:_typeof(a)>"u"&&this.workOptions.workState===It.Done||a});case 8:s=_context27.sent;return _context27.abrupt("return",((v=this.vNodes)==null||v.setInfo(e,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,o)}),s));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x70){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t,e){var M,T,n,i,a,o,s,c,p,h,v,y;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:if(this.workId){_context28.next=2;break;}return _context28.abrupt("return");case 2:n=this.workId.toString(),i=t.fontColor,a=t.fontBgColor,o=t.bold,s=t.italic,c=t.lineThrough,p=t.underline,h=t.zIndex,v=(M=this.vNodes)==null?void 0:M.get(n);if(v){_context28.next=5;break;}return _context28.abrupt("return");case 5:i&&(v.opt.fontColor=i),a&&(v.opt.fontBgColor=a),o&&(v.opt.bold=o),s&&(v.opt.italic=s),oe(c)&&(v.opt.lineThrough=c),oe(p)&&(v.opt.underline=p),qt(h)&&(v.opt.zIndex=h),this.oldRect=v.rect;_context28.next=8;return this.draw({workId:n,layer:this.fullLayer,isDrawLabel:_typeof(e)>"u"&&this.workOptions.workState===It.Done||e});case 8:y=_context28.sent;return _context28.abrupt("return",((T=this.vNodes)==null||T.setInfo(n,{rect:y,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:y&&yt.getCenterPos(y,this.fullLayer)}),y));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x71,_x72){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(t){var e=(t==null?void 0:t.parent).displayRatio||1,n=Math.ceil(t.worldScaling[0]*10)/10;var i=n;return n>=0.2&&n<1?i=n*e:n<=2&&n>=1?i=n*e*1.6:n>2&&n<=3?i=n*e*1.4:n>3&&n<=4?i=n*e*0.8:n>4&&(i=n*e*0.6),Math.floor(i*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(Jt.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,e,n){var L,i,a,o,_ref164,s,c,p,h,v,y,M,T,m,x,l,d,u,g,O,A,R,b,E,D,I,C,W,G,K,X,Z,B,z,Q,_,st,q,ht,dt,F,U,V,J,et,_q2,_ht,_dt,_q3,_ht2,_4,_st2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:i=[],a=n.x,o=n.y,_ref164=(L=e.parent)==null?void 0:L.parent,s=_ref164.width,c=_ref164.height,p=Me(t.text),h=p.length,v=t.fontSize,y=t.lineHeight,M=t.bold,T=t.textAlign,m=t.italic,x=t.fontFamily,l=t.verticalAlign,d=t.fontColor,u=t.fontBgColor,g=t.underline,O=t.lineThrough,A=Jt.getSafetySnippetRatio(e)||1,R=Math.floor(v*A),b=Jt.getSafetySnippetFontLength(R);E=0;D=0;case 3:if(!(D<h)){_context29.next=33;break;}I=p[D],C=y||R*1.5;if(!I){_context29.next=30;break;}W=z0(I),G=[0,0],K=[0,v*1.2];l==="middle"&&(G[1]=D*v*1.2+5);X=[0,-v*0.15];G[0]=5;Z=Math.sin(Math.PI/180*20);B=0;z=[];Q=0;case 14:if(!(Q<W)){_context29.next=27;break;}T==="left"&&(X[0]=B),Q===0&&m==="italic"&&(X[0]=X[0]-Z/2*v);_=I.slice(Q,Q+b);st={anchor:[0,0],pos:X,text:_,fontFamily:x,fontSize:R,lineHeight:C,strokeColor:d,fontWeight:M,fillColor:d,textAlign:T,fontStyle:m,scale:[1/A,1/A]};q=new Sd(st);_context29.next=21;return q.textImageReady;case 21:ht=_context29.sent;dt=!0;if(ht){F=ht.rect&&ht.rect[2],U=ht.rect&&ht.rect[3];if(F&&U){V=F/A,J=U/A;B=V+B,m==="italic"&&(M==="bold"?B=B-Z*v*1.2:B=B-Z*v),((X[0]+G[0]+V)*e.worldScaling[0]+a<=0||(X[0]+G[0])*e.worldScaling[0]+a>=s||(X[1]+G[1]+J)*e.worldScaling[1]+o<=0||(X[1]+G[1])*e.worldScaling[1]+o>=c)&&(q.disconnect(),dt=!1),dt&&z.push(q);}}Q+=b;case 25:_context29.next=14;break;case 27:K[0]=B,m==="italic"&&(K[0]=K[0]+Z*v),E=Math.max(E,K[0]);et=!0;if(((G[0]+K[0])*e.worldScaling[0]+a<=0||G[0]*e.worldScaling[0]+a>=s||(G[1]+K[1])*e.worldScaling[0]+o<=0||G[1]*e.worldScaling[1]+o>=c)&&(et=!1),et){if(g){_q2=Math.floor(v/10),_ht={normalize:!1,pos:[0,v*1.1+_q2/2],lineWidth:_q2,points:[0,0,Math.ceil(K[0]),0],strokeColor:d,className:"underline"},_dt=new fe(_ht);z.push(_dt);}if(O){_q3={normalize:!1,pos:[0,v*1.2/2],lineWidth:Math.floor(v/10),points:[0,0,Math.ceil(K[0]),0],strokeColor:d,className:"lineThrough"},_ht2=new fe(_q3);z.push(_ht2);}_4={pos:G,anchor:[0,0],size:K,bgcolor:u},_st2=new re(_4);_st2.append.apply(_st2,z),i.push(_st2);}case 30:D++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:i,maxWidth:E});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x73,_x74,_x75){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.fontBgColor,s=n.fontColor,c=n.translate,p=n.originPoint,h=n.scenePoint,v=n.scale,y=n.bold,M=n.italic,T=n.lineThrough,m=n.underline,x=n.fontSize,l=n.textInfos,d=n.zIndex,u=a&&Xt(a)||i.get(e.name);if(!u||!e.parent)return;var O=u.opt;if(qt(d)&&(e.setAttribute("zIndex",d),u.opt.zIndex=d),s&&O.fontColor&&(O.fontColor=s,e.children.forEach(function(A){A.tagName==="GROUP"&&A.children.forEach(function(R){R.tagName==="LABEL"?(R.setAttribute("fillColor",s),R.setAttribute("strokeColor",s)):R.tagName==="POLYLINE"&&R.setAttribute("strokeColor",s);});})),o&&O.fontBgColor&&(O.fontBgColor=o,e.children.forEach(function(A){A.tagName==="GROUP"&&A.setAttribute("bgcolor",o);})),y&&(O.bold=y),M&&(O.italic=M),oe(T)&&(O.lineThrough=T),oe(m)&&(O.underline=m),x&&(O.fontSize=x),p&&h&&v&&a&&O.boxPoint){var A=l==null?void 0:l.get(e.name);if(A){var L=A.fontSize,D=A.boxSize;O.boxSize=D||O.boxSize,O.fontSize=L||O.fontSize;}var R=[O.boxPoint[0],O.boxPoint[1]];Dr(O.boxPoint,h,v,c);var b=[u.op[0],u.op[1]],E=[b[0]-R[0],b[1]-R[1]];u.centerPos=[u.centerPos[0]+E[0],u.centerPos[1]+E[1]];}else c&&O.boxPoint&&(O.boxPoint=[O.boxPoint[0]+c[0],O.boxPoint[1]+c[1]],u.centerPos=[u.centerPos[0]+c[0],u.centerPos[1]+c[1]]);return u&&i.setInfo(e.name,u),u==null?void 0:u.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,e){var n=t.getElementsByName(e)[0];if(n){var i=n.getBoundingClientRect();var a={x:Math.floor(i.x-Jt.SafeBorderPadding*t.worldScaling[0]),y:Math.floor(i.y-Jt.SafeBorderPadding*t.worldScaling[1]),w:Math.floor(i.width+Jt.SafeBorderPadding*t.worldScaling[0]*2),h:Math.floor(i.height+Jt.SafeBorderPadding*t.worldScaling[1]*2)};return n.children.forEach(function(o){if(o.tagName==="GROUP"){var s=n.getBoundingClientRect();a=Ot(a,{x:Math.floor(s.x-Jt.SafeBorderPadding*t.worldScaling[0]),y:Math.floor(s.y-Jt.SafeBorderPadding*t.worldScaling[1]),w:Math.floor(s.width+Jt.SafeBorderPadding*t.worldScaling[0]*2),h:Math.floor(s.height+Jt.SafeBorderPadding*t.worldScaling[1]*2)});}}),a;}}}]);}(yt);// 4k
437
+ nt(Jt,"textImageSnippetSize",1024*4),nt(Jt,"SafeBorderPadding",30);var Ve=Jt;function pi(f){switch(f){case gt.Arrow:return li;case gt.Pencil:return ii;case gt.Straight:return gi;case gt.Ellipse:return ci;case gt.Polygon:case gt.Triangle:return hi;case gt.Star:case gt.Rhombus:return ui;case gt.Rectangle:return fi;case gt.SpeechBalloon:return di;case gt.Text:return Ve;case gt.LaserPen:return si;case gt.Eraser:return se;case gt.Selector:return Ke;case gt.Image:return we;}}function br(f,r){var t=f.toolsType,e=_objectWithoutProperties(f,_excluded);switch(t){case gt.Arrow:return new li(e);case gt.Pencil:return new ii(e);case gt.Straight:return new gi(e);case gt.Ellipse:return new ci(e);case gt.Polygon:case gt.Triangle:return new hi(e);case gt.Star:case gt.Rhombus:return new ui(e);case gt.Rectangle:return new fi(e);case gt.SpeechBalloon:return new di(e);case gt.Text:return new Ve(e);case gt.LaserPen:return new si(e);case gt.Eraser:return new se(e,r);case gt.Selector:return e.vNodes?new Ke(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case gt.Image:return new we(e);default:return;}}function vi(f){var r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator26=_createForOfIteratorHelper(f),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _e5=_step26.value;if(_e5.tagName==="GROUP"&&_e5.children.length)return vi(_e5.children);_e5.tagName&&t.includes(_e5.tagName)&&r.push(_e5);}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}return r;}function Ot(f,r){if(f&&r){var t=Math.min(f.x,r.x),_e6=Math.min(f.y,r.y),n=Math.max(f.x+f.w,r.x+r.w),i=Math.max(f.y+f.h,r.y+r.h),a=n-t,o=i-_e6;return{x:t,y:_e6,w:a,h:o};}return r||f;}function Ft(f){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var e=1/0,n=1/0,i=-1/0,a=-1/0;return f.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),s=_o$XY[0],c=_o$XY[1];e=Math.min(e,s-r),n=Math.min(n,c-r),i=Math.max(i,s+r),a=Math.max(a,c+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function De(f,r){return!(f.x+f.w<r.x||f.x>r.x+r.w||f.y+f.h<r.y||f.y>r.y+r.h);}function Dt(f){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(f.x-r),y:Math.floor(f.y-r),w:Math.ceil(f.w+r*2),h:Math.ceil(f.h+r*2)};}function N0(f,r){return{x:f.x+r[0],y:f.y+r[1],w:f.w,h:f.h};}function W0(f,r){var t=new tt(f.x,f.y),e=new tt(f.x+f.w,f.y),n=new tt(f.x+f.w,f.y+f.h),i=new tt(f.x,f.y+f.h),a=new tt(f.x+f.w/2,f.y+f.h/2),o=Math.PI*r/180,s=tt.RotWith(t,a,o),c=tt.RotWith(e,a,o),p=tt.RotWith(n,a,o),h=tt.RotWith(i,a,o);return[s,c,p,h];}function mi(f,r){var t=W0(f,r);return Ft(t);}function B0(f,r,t){var e=new tt(r[0],r[1]);for(var n=0;n<f.length;n+=3){var i=new tt(f[n],f[n+1]),a=Math.PI*t/180,o=tt.RotWith(i,e,a);f[n]=o.x,f[n+1]=o.y;}}function Dr(f,r,t){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new tt(r[0],r[1]);for(var i=0;i<f.length;i+=3){var a=new tt(f[i],f[i+1]),o=new tt(t[0],t[1]),s=tt.ScaleWOrigin(a,o,n);f[i]=s.x+e[0],f[i+1]=s.y+e[1];}}function F0(f,r){return f[0]>=r.x&&f[0]<=r.x+r.w&&f[1]>=r.y&&f[1]<=r.y+r.h;}function yi(f,r){var t=f<=r?1:f/r,e=r<=f?1:r/f;return[t,e];}function U0(f){var _iterator27=_createForOfIteratorHelper(f),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var r=_step27.value;if(isNaN(r)||r===1/0||r===-1/0)return!1;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return!0;}var j0=function j0(f){if(f.tagName==="GROUP"){var r=Object.getOwnPropertySymbols(f).find(function(t){return t.toString()==="Symbol(sealed)";});if(r&&f[r])return!0;}return!1;},$0=function $0(f){return!f.isHid;};function pe(f){return"".concat(Ye(f.x),",").concat(Ye(f.y)," ");}function ve(f,r){return"".concat(Ye((f.x+r.x)/2),",").concat(Ye((f.y+r.y)/2)," ");}function Ye(f){return+f.toFixed(4);}var or=function or(f,r){return f.x+f.w<r.x||f.x>r.x+r.w||f.y+f.h<r.y||f.y>r.y+r.h?xe.outside:f.x>=r.x&&f.y>=r.y&&f.x+f.w<=r.x+r.w&&f.y+f.h<=r.y+r.h?xe.inside:xe.intersect;};function z0(f){var r=0;for(var t=0;t<f.length;t++){var _e7=f.charCodeAt(t);_e7>=1&&_e7<=126||65376<=_e7&&_e7<=65439?r++:r+=2;}return r;}var be="cursorhover",Sn=20,Xe="mainView";var G0=/*#__PURE__*/function(){function G0(r,t){_classCallCheck(this,G0);nt(this,"viewId");nt(this,"scene");nt(this,"fullLayer");nt(this,"curNodeMap",/* @__PURE__ */new Map());nt(this,"targetNodeMap",[]);nt(this,"highLevelIds");this.viewId=r,this.scene=t;}return _createClass(G0,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"getNodesByType",value:function getNodesByType(r){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(e,n){e.toolsType===r&&t.set(n,e);}),t;}},{key:"hasRenderNodes",value:function hasRenderNodes(){var r=!1;var _iterator28=_createForOfIteratorHelper(this.curNodeMap.values()),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var t=_step28.value;$0(t)&&(r=!0);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"has",value:function has(r){return this.curNodeMap.has(r);}},{key:"setInfo",value:function setInfo(r,t){var e=this.curNodeMap.get(r)||{name:r,rect:t.rect};t.rect&&(e.rect=Xt(t.rect)),t.op&&U0(t.op)&&(e.op=Xt(t.op)),t.canRotate&&(e.canRotate=t.canRotate),t.scaleType&&(e.scaleType=t.scaleType),t.opt&&(e.opt=Xt(t.opt)),t.toolsType&&(e.toolsType=t.toolsType),t.centerPos&&(e.centerPos=Xt(t.centerPos)),oe(t.isSelected)&&(e.isSelected=t.isSelected),e.rect?this.curNodeMap.set(r,e):this.curNodeMap["delete"](r);}},{key:"selected",value:function selected(r){this.setInfo(r,{isSelected:!0});}},{key:"unSelected",value:function unSelected(r){this.setInfo(r,{isSelected:!1});}},{key:"delete",value:function _delete(r){this.curNodeMap["delete"](r);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"hasRectIntersectRange",value:function hasRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var _iterator29=_createForOfIteratorHelper(this.curNodeMap.values()),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e8=_step29.value;if(De(r,_e8.rect)){if(t&&_e8.toolsType===gt.Image&&_e8.opt.locked||t&&_e8.toolsType===gt.Text&&(_e8.opt.workState===It.Doing||_e8.opt.workState===It.Start))continue;return!0;}}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}return!1;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n;var i=/* @__PURE__ */new Map();var _iterator30=_createForOfIteratorHelper(this.curNodeMap.entries()),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _step30$value=_slicedToArray(_step30.value,2),a=_step30$value[0],o=_step30$value[1];if(De(r,o.rect)){if(t&&o.toolsType===gt.Image&&o.opt.locked||e&&o.toolsType===gt.Text&&(o.opt.workState===It.Doing||o.opt.workState===It.Start))continue;n=Ot(n,o.rect),i.set(a,o);}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var e=pi(t.toolsType);return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r));}},{key:"updateNodeRect",value:function updateNodeRect(r){var t=this.curNodeMap.get(r);if(t){var _e9=this.getNodeRectFormShape(r,t);if(!_e9){this.curNodeMap["delete"](r);return;}t.rect=_e9,this.curNodeMap.set(r,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(r){this.highLevelIds=r;var _iterator31=_createForOfIteratorHelper(this.highLevelIds.keys()),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var t=_step31.value;this.updateNodeRect(t);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var r;var _iterator32=_createForOfIteratorHelper(this.curNodeMap.keys()),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var t=_step32.value;(r=this.highLevelIds)!=null&&r.has(t)||this.updateNodeRect(t);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"combineIntersectRect",value:function combineIntersectRect(r){var t=r;return this.curNodeMap.forEach(function(e){De(t,e.rect)&&(t=Ot(t,e.rect));}),t;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(r){var t=/* @__PURE__ */new Map();var _iterator33=_createForOfIteratorHelper(r),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _e10=_step33.value;var n=this.curNodeMap.get(_e10);n&&t.set(_e10,Xt(n));}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}return this.targetNodeMap.push(Xt(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(Xt(this.curNodeMap)),this.targetNodeMap.length-1;}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1);}},{key:"getTarget",value:function getTarget(r){return this.targetNodeMap[r];}},{key:"deleteTarget",value:function deleteTarget(r){this.targetNodeMap.length=r;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}}]);}();var Si=/*#__PURE__*/function(){function Si(r,t,e){_classCallCheck(this,Si);nt(this,"viewId");nt(this,"fullLayer");nt(this,"vNodes");nt(this,"dpr");nt(this,"contextType");nt(this,"opt");nt(this,"cameraOpt");nt(this,"scene");nt(this,"isSafari",!1);nt(this,"combinePostMsg",/* @__PURE__ */new Set());nt(this,"workerTaskId");nt(this,"protectedTask");nt(this,"delayPostDoneResolve");if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(e),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");this.scene=this.createScene(t.offscreenCanvasOpt);var n=ie.bufferSize.full,i=ie.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId===Xe?n:i})),this.vNodes=new G0(r,this.scene);}return _createClass(Si,[{key:"setIsSafari",value:function setIsSafari(r){this.isSafari=r;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(r){var t,e,n,i;return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:t=r.msgType,e=r.toolsType,n=r.opt;_context30.t0=t;_context30.next=_context30.t0===ft.UpdateCamera?4:_context30.t0===ft.Destroy?7:_context30.t0===ft.Clear?9:_context30.t0===ft.UpdateTools?12:14;break;case 4:_context30.next=6;return this.updateCamera(r);case 6:return _context30.abrupt("break",14);case 7:this.destroy();return _context30.abrupt("break",14);case 9:_context30.next=11;return this.clearAll();case 11:return _context30.abrupt("break",14);case 12:if(e&&n){i={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(i);}return _context30.abrupt("break",14);case 14:case"end":return _context30.stop();}},_callee28,this);}));function on(_x76){return _on.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(r){var t=r.workId,e=r.opt,n=r.toolsType;t&&e&&(!this.localWork.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:e}),this.setWorkOpt({workId:t,toolsOpt:e}));}},{key:"updateScene",value:function updateScene(r){this.scene.attr(_objectSpread({},r));var t=r.width,e=r.height;this.scene.container.width=t,this.scene.container.height=e,this.scene.width=t,this.scene.height=e,this.updateLayer({width:t,height:e});}},{key:"updateLayer",value:function updateLayer(r){var t=r.width,e=r.height;this.fullLayer&&(this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",e),this.fullLayer.setAttribute("size",[t,e]),this.fullLayer.setAttribute("pos",[t*0.5,e*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(r){var t=new OffscreenCanvas(100,100),e=r===Je.Full&&this.viewId===Xe?[me.Webgl2,me.Webgl,me.Canvas2d]:[me.Canvas2d];for(var _i2=0,_e11=e;_i2<_e11.length;_i2++){var n=_e11[_i2];if(t.getContext(n))return n;}}},{key:"createScene",value:function createScene(r){var t=r.width,e=r.height,n=new OffscreenCanvas(t,e);r.contextType&&delete r.contextType;var i=new Td(_objectSpread(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},r),{},{contextType:this.contextType,id:this.viewId}));return i.setAttribute("id",this.viewId),i;}},{key:"createLayer",value:function createLayer(r,t,e){var n=e.width,i=e.height,a="offscreen-".concat(r),o=t.layer(a,e),s=new re({anchor:[0.5,0.5],pos:[n*0.5,i*0.5],size:[n,i],name:"viewport",id:r});return o.append(s),s;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(){var r;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.fullLayer.removeAllChildren()),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();case 1:case"end":return _context31.stop();}},_callee29,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(r){this.localWork.setToolsOpt(r);}},{key:"setWorkOpt",value:function setWorkOpt(r){var t=r.workId,e=r.toolsOpt;t&&e&&this.localWork.setWorkOptions(t.toString(),e);}},{key:"destroy",value:function destroy(){var r;this.vNodes.clear(),this.fullLayer.remove(),this.scene.remove(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(r){return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:this.combinePostMsg.add(r);_context32.next=3;return this.runBatchPostData();case 3:case"end":return _context32.stop();}},_callee30,this);}));function post(_x77){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(){var _this86=this;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:this.workerTaskId||(this.workerTaskId=requestAnimationFrame(this.combinePost.bind(this)));_context33.t0=this.type===Je.Full&&!this.delayPostDoneResolve;if(!_context33.t0){_context33.next=6;break;}_context33.next=5;return new Promise(function(t){_this86.delayPostDoneResolve=t;});case 5:_context33.t0=_context33.sent;case 6:_context33.t1=_context33.t0;if(!_context33.t1){_context33.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context33.stop();}},_callee31,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var i,a;this.workerTaskId=void 0;var r=[],t=[];var e;var n=/* @__PURE__ */new Set();var _iterator34=_createForOfIteratorHelper(this.combinePostMsg.values()),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var o=_step34.value;if((i=o.render)!=null&&i.length){var _iterator35=_createForOfIteratorHelper(o.render),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var s=_step35.value;var c=!1;if(s.workId&&n.add(s.workId),s.isClearAll&&(s.rect=this.getSceneRect(),s.isClear=!0,delete s.isClearAll),s.drawCanvas){var p=this.getLayer(s.drawCanvas);if(!p||!(p.parent instanceof xd))continue;if(p.parent.render(),s.isDrawAll){var h=this.getSceneRect();s.rect=h,delete s.isDrawAll;}}var _iterator36=_createForOfIteratorHelper(r),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _p9=_step36.value;if(s.viewId===_p9.viewId){s.isClear&&_p9.clearCanvas&&_p9.isClear&&_p9.clearCanvas===s.clearCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),c=!0),_p9.drawCanvas&&_p9.drawCanvas===s.drawCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),c=!0);continue;}}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}c||(s.isClear&&!s.drawCanvas?r.unshift(s):r.push(s));}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}if((a=o.sp)!=null&&a.length){var _iterator37=_createForOfIteratorHelper(o.sp),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _s4=_step37.value;var _c5=!1;var _iterator38=_createForOfIteratorHelper(t),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _p10=_step38.value;if(ce(_s4,_p10)){_c5=!0;break;}}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}_c5||t.push(_s4);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}qt(o.drawCount)&&(e=o.drawCount);}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}return this.combinePostMsg.clear(),{render:r,sp:t,drawCount:e,workIds:n};}},{key:"safariFixRect",value:function safariFixRect(r){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var t=this.scene.width,e=this.scene.height,n={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(t,r.w)),h:Math.floor(Math.min(e,r.h))};return n.x+n.w>t&&(n.w=Math.floor(t-n.x)),n.y+n.h>e&&(n.h=Math.floor(e-n.y)),n;}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,r=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(r),h:Math.floor(t)};}}]);}();var xi=/*#__PURE__*/function(){function xi(r){_classCallCheck(this,xi);nt(this,"viewId");nt(this,"vNodes");nt(this,"thread");nt(this,"fullLayer");nt(this,"drawLayer");nt(this,"_post");nt(this,"tmpOpt");nt(this,"workShapes",/* @__PURE__ */new Map());nt(this,"drawCount",0);nt(this,"syncUnitTime",ie.syncOpt.interval);this.thread=r.thread,this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this._post=this.thread.post.bind(r.thread);}return _createClass(xi,[{key:"destroy",value:function destroy(){this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(r){return this.workShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e12={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e12),{},{workId:r}));n&&this.workShapes.set(r,n);}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var e=this.getWorkShape(r);e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t;return br(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(r){var t,e,n;((t=this.tmpOpt)==null?void 0:t.toolsType)!==r.toolsType&&(e=this.tmpOpt)!=null&&e.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=r,(n=r.toolsOpt)!=null&&n.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(r){var t;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes["delete"](r);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(r){return r.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(r){var t=r.workId,e=r.opt,n=r.toolsType;if(t&&e&&n){var i=t.toString();var a;return t&&this.workShapes.has(i)?(a=this.workShapes.get(i),a==null||a.setWorkOptions(e)):a=this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:i}),a?(this.workShapes.set(i,a),a):void 0;}}}]);}();var H0=ee,K0=function K0(){return H0.Date.now();},V0=K0,Y0=/\s/;function X0(f){for(var r=f.length;r--&&Y0.test(f.charAt(r)););return r;}var J0=X0,Q0=J0,Z0=/^\s+/;function k0(f){return f&&f.slice(0,Q0(f)+1).replace(Z0,"");}var q0=k0,_0=he,tg=ne,eg="[object Symbol]";function rg(f){return _typeof(f)=="symbol"||tg(f)&&_0(f)==eg;}var ng=rg,ig=q0,xn=ae,sg=ng,Tn=NaN,og=/^[-+]0x[0-9a-f]+$/i,ag=/^0b[01]+$/i,lg=/^0o[0-7]+$/i,cg=parseInt;function fg(f){if(typeof f=="number")return f;if(sg(f))return Tn;if(xn(f)){var r=typeof f.valueOf=="function"?f.valueOf():f;f=xn(r)?r+"":r;}if(typeof f!="string")return f===0?f:+f;f=ig(f);var t=ag.test(f);return t||lg.test(f)?cg(f.slice(2),t?2:8):og.test(f)?Tn:+f;}var ug=fg,hg=ae,ar=V0,Mn=ug,dg="Expected a function",gg=Math.max,pg=Math.min;function vg(f,r,t){var e,n,i,a,o,s,c=0,p=!1,h=!1,v=!0;if(typeof f!="function")throw new TypeError(dg);r=Mn(r)||0,hg(t)&&(p=!!t.leading,h="maxWait"in t,i=h?gg(Mn(t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function y(O){var A=e,R=n;return e=n=void 0,c=O,a=f.apply(R,A),a;}function M(O){return c=O,o=setTimeout(x,r),p?y(O):a;}function T(O){var A=O-s,R=O-c,b=r-A;return h?pg(b,i-R):b;}function m(O){var A=O-s,R=O-c;return s===void 0||A>=r||A<0||h&&R>=i;}function x(){var O=ar();if(m(O))return l(O);o=setTimeout(x,T(O));}function l(O){return o=void 0,v&&e?y(O):(e=n=void 0,a);}function d(){o!==void 0&&clearTimeout(o),c=0,e=s=n=o=void 0;}function u(){return o===void 0?a:l(ar());}function g(){var O=ar(),A=m(O);if(e=arguments,n=this,s=O,A){if(o===void 0)return M(s);if(h)return clearTimeout(o),o=setTimeout(x,r),y(s);}return o===void 0&&(o=setTimeout(x,r)),a;}return g.cancel=d,g.flush=u,g;}var mg=vg,yg=mg,Sg=ae,xg="Expected a function";function Tg(f,r,t){var e=!0,n=!0;if(typeof f!="function")throw new TypeError(xg);return Sg(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),yg(f,r,{leading:e,maxWait:r,trailing:n});}var Mg=Tg,Og=/* @__PURE__ */ue(Mg);function Pg(f){return f;}var Ti=Pg;function Eg(f,r,t){switch(t.length){case 0:return f.call(r);case 1:return f.call(r,t[0]);case 2:return f.call(r,t[0],t[1]);case 3:return f.call(r,t[0],t[1],t[2]);}return f.apply(r,t);}var Ag=Eg,Cg=Ag,On=Math.max;function Rg(f,r,t){return r=On(r===void 0?f.length-1:r,0),function(){for(var e=arguments,n=-1,i=On(e.length-r,0),a=Array(i);++n<i;)a[n]=e[r+n];n=-1;for(var o=Array(r+1);++n<r;)o[n]=e[n];return o[r]=t(a),Cg(f,this,o);};}var Ig=Rg;function Lg(f){return function(){return f;};}var bg=Lg,Dg=bg,Pn=Wn,wg=Ti,Ng=Pn?function(f,r){return Pn(f,"toString",{configurable:!0,enumerable:!1,value:Dg(r),writable:!0});}:wg,Wg=Ng,Bg=800,Fg=16,Ug=Date.now;function jg(f){var r=0,t=0;return function(){var e=Ug(),n=Fg-(e-t);if(t=e,n>0){if(++r>=Bg)return arguments[0];}else r=0;return f.apply(void 0,arguments);};}var $g=jg,zg=Wg,Gg=$g,Hg=Gg(zg),Kg=Hg,Vg=Ti,Yg=Ig,Xg=Kg;function Jg(f,r){return Xg(Yg(f,r,Vg),f+"");}var Qg=Jg;function Zg(f,r,t,e){for(var n=f.length,i=t+(e?1:-1);e?i--:++i<n;)if(r(f[i],i,f))return i;return-1;}var kg=Zg;function qg(f){return f!==f;}var _g=qg;function tp(f,r,t){for(var e=t-1,n=f.length;++e<n;)if(f[e]===r)return e;return-1;}var ep=tp,rp=kg,np=_g,ip=ep;function sp(f,r,t){return r===r?ip(f,r,t):rp(f,np,t);}var op=sp,ap=op;function lp(f,r){var t=f==null?0:f.length;return!!t&&ap(f,r,0)>-1;}var Mi=lp;function cp(f,r,t){for(var e=-1,n=f==null?0:f.length;++e<n;)if(t(r,f[e]))return!0;return!1;}var Oi=cp;function fp(f,r){for(var t=-1,e=f==null?0:f.length,n=Array(e);++t<e;)n[t]=r(f[t],t,f);return n;}var up=fp,hp=Rr,dp=Mi,gp=Oi,pp=up,vp=er,mp=Ir,yp=200;function Sp(f,r,t,e){var n=-1,i=dp,a=!0,o=f.length,s=[],c=r.length;if(!o)return s;t&&(r=pp(r,vp(t))),e?(i=gp,a=!1):r.length>=yp&&(i=mp,a=!1,r=new hp(r));t:for(;++n<o;){var p=f[n],h=t==null?p:t(p);if(p=e||p!==0?p:0,a&&h===h){for(var v=c;v--;)if(r[v]===h)continue t;s.push(p);}else i(r,h,e)||s.push(p);}return s;}var xp=Sp,En=Ne,Tp=jn,Mp=We,An=En?En.isConcatSpreadable:void 0;function Op(f){return Mp(f)||Tp(f)||!!(An&&f&&f[An]);}var Pp=Op,Ep=Er,Ap=Pp;function Pi(f,r,t,e,n){var i=-1,a=f.length;for(t||(t=Ap),n||(n=[]);++i<a;){var o=f[i];r>0&&t(o)?r>1?Pi(o,r-1,t,e,n):Ep(n,o):e||(n[n.length]=o);}return n;}var Cp=Pi;function Rp(){}var Ip=Rp,lr=Zn,Lp=Ip,bp=Lr,Dp=1/0,wp=lr&&1/bp(new lr([,-0]))[1]==Dp?function(f){return new lr(f);}:Lp,Np=wp,Wp=Rr,Bp=Mi,Fp=Oi,Up=Ir,jp=Np,$p=Lr,zp=200;function Gp(f,r,t){var e=-1,n=Bp,i=f.length,a=!0,o=[],s=o;if(t)a=!1,n=Fp;else if(i>=zp){var c=r?null:jp(f);if(c)return $p(c);a=!1,n=Up,s=new Wp();}else s=r?[]:o;t:for(;++e<i;){var p=f[e],h=r?r(p):p;if(p=t||p!==0?p:0,a&&h===h){for(var v=s.length;v--;)if(s[v]===h)continue t;r&&s.push(h),o.push(p);}else n(s,h,t)||(s!==o&&s.push(h),o.push(p));}return o;}var Hp=Gp,Kp=xp,Vp=Cp,Cn=Hp;function Yp(f,r,t){var e=f.length;if(e<2)return e?Cn(f[0]):[];for(var n=-1,i=Array(e);++n<e;)for(var a=f[n],o=-1;++o<e;)o!=n&&(i[n]=Kp(i[n]||a,f[o],r,t));return Cn(Vp(i,1),r,t);}var Xp=Yp,Jp=Tr,Qp=ne;function Zp(f){return Qp(f)&&Jp(f);}var kp=Zp,qp=Kn,_p=Qg,tv=Xp,ev=kp,rv=_p(function(f){return tv(qp(f,ev));}),nv=rv,iv=/* @__PURE__ */ue(nv);var sv=/*#__PURE__*/function(_xi){function sv(t){var _this87;_classCallCheck(this,sv);_this87=_callSuper(this,sv,[t]);nt(_this87,"combineUnitTime",ie.syncOpt.interval);nt(_this87,"combineTimerId");nt(_this87,"combineDrawResolve");nt(_this87,"combineDrawActiveId");nt(_this87,"drawWorkActiveId");nt(_this87,"effectSelectNodeData",/* @__PURE__ */new Set());nt(_this87,"batchEraserWorks",/* @__PURE__ */new Set());nt(_this87,"batchEraserRemoveNodes",/* @__PURE__ */new Set());nt(_this87,"batchEraserCombine",Og(function(){var t=_this87.updateBatchEraserCombineNode(_this87.batchEraserWorks,_this87.batchEraserRemoveNodes);_this87.batchEraserWorks.clear(),_this87.batchEraserRemoveNodes.clear(),t.length&&_this87._post({render:t});},100,{leading:!1}));return _this87;}_inherits(sv,_xi);return _createClass(sv,[{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(t,e){var _this88=this;var n,i,a,o,s,c,p,h;return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:n=t.op,i=t.workId,a=t.scenePath;if(!(n!=null&&n.length&&i)){_context34.next=47;break;}o=i.toString(),s=this.getWorkShape(o);if(s){_context34.next=5;break;}return _context34.abrupt("return");case 5:c=s.toolsType;if(!(c===gt.LaserPen)){_context34.next=8;break;}return _context34.abrupt("return");case 8:_context34.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==o;if(!_context34.t0){_context34.next=13;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context34.next=13;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:a,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local},e);case 13:_context34.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==o;if(!_context34.t1){_context34.next=18;break;}_context34.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:a,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local},e);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&o!==wt&&(this.drawWorkActiveId=o);p=s.consume({data:t,isFullWork:!0});_context34.t2=c;_context34.next=_context34.t2===gt.Selector?23:_context34.t2===gt.Eraser?29:_context34.t2===gt.Arrow?34:_context34.t2===gt.Straight?34:_context34.t2===gt.Ellipse?34:_context34.t2===gt.Rectangle?34:_context34.t2===gt.Star?34:_context34.t2===gt.Polygon?34:_context34.t2===gt.SpeechBalloon?34:_context34.t2===gt.Pencil?40:47;break;case 23:_context34.t3=p.type===ft.Select;if(!_context34.t3){_context34.next=28;break;}p.selectIds&&e.runReverseSelectWork(p.selectIds);_context34.next=28;return this.drawSelector(p);case 28:return _context34.abrupt("break",47);case 29:_context34.t4=p!=null&&p.rect;if(!_context34.t4){_context34.next=33;break;}_context34.next=33;return this.drawEraser(p);case 33:return _context34.abrupt("break",47);case 34:_context34.t5=p;if(!_context34.t5){_context34.next=39;break;}this.drawCount++;_context34.next=39;return this.drawPencil(p);case 39:return _context34.abrupt("break",47);case 40:if(!this.combineTimerId){h=Math.floor(this.syncUnitTime||this.combineUnitTime);new Promise(function(v){_this88.combineDrawActiveId=o,_this88.combineDrawResolve=v,_this88.combineTimerId=setTimeout(function(){_this88.combineTimerId=void 0,_this88.combineDrawResolve&&_this88.combineDrawResolve(!0);},h);}).then(function(v){v&&_this88.drawPencilCombine(o),_this88.combineDrawResolve=void 0;});}_context34.t6=p;if(!_context34.t6){_context34.next=46;break;}this.drawCount++;_context34.next=46;return this.drawPencil(p);case 46:return _context34.abrupt("break",47);case 47:case"end":return _context34.stop();}},_callee32,this);}));function consumeDraw(_x78,_x79){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(t,e){var o,s,c,n,i,a,p,h,v,y,M,T;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,i=t.scenePath,a=t.isLockSentEventCursor;if(!n){_context35.next=35;break;}p=n.toString();this.drawWorkActiveId===p&&(this.drawWorkActiveId=void 0);h=this.workShapes.get(p);if(h){_context35.next=8;break;}return _context35.abrupt("return");case 8:v=h.toolsType;if(!(v===gt.LaserPen)){_context35.next=11;break;}return _context35.abrupt("return");case 11:y=this.workShapes.get(be),M=(o=y==null?void 0:y.selectIds)==null?void 0:o[0],T=h.consumeAll({data:t});_context35.t0=v;_context35.next=_context35.t0===gt.Selector?15:_context35.t0===gt.Eraser?21:_context35.t0===gt.Arrow?23:_context35.t0===gt.Straight?23:_context35.t0===gt.Ellipse?23:_context35.t0===gt.Rectangle?23:_context35.t0===gt.Star?23:_context35.t0===gt.Polygon?23:_context35.t0===gt.SpeechBalloon?23:_context35.t0===gt.Pencil?28:35;break;case 15:T.selectIds&&M&&(s=T.selectIds)!=null&&s.includes(M)&&y.cursorBlur();T.selectIds&&e.runReverseSelectWork(T.selectIds);_context35.next=19;return this.drawSelector(_objectSpread(_objectSpread({},T),{},{scenePath:i}));case 19:(c=h.selectIds)!=null&&c.length?h.clearTmpPoints():this.clearWorkShapeNodeCache(p);return _context35.abrupt("break",35);case 21:T!=null&&T.rect&&this.drawEraser(_objectSpread(_objectSpread({},T),{},{scenePath:i})),h.clearTmpPoints();return _context35.abrupt("break",35);case 23:_context35.next=25;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i,isLockSentEventCursor:a}));case 25:this.drawCount=0;this.clearWorkShapeNodeCache(p);return _context35.abrupt("break",35);case 28:_context35.t1=T!=null&&T.rect;if(!_context35.t1){_context35.next=33;break;}_context35.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i,isLockSentEventCursor:a}));case 32:this.drawCount=0;case 33:this.clearWorkShapeNodeCache(p);return _context35.abrupt("break",35);case 35:case"end":return _context35.stop();}},_callee33,this);}));function consumeDrawAll(_x80,_x81){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t,e){var _iterator39,_step39,n;return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:_iterator39=_createForOfIteratorHelper(this.workShapes.keys());_context36.prev=1;_iterator39.s();case 3:if((_step39=_iterator39.n()).done){_context36.next=9;break;}n=_step39.value;_context36.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local},e);case 7:_context36.next=3;break;case 9:_context36.next=14;break;case 11:_context36.prev=11;_context36.t0=_context36["catch"](1);_iterator39.e(_context36.t0);case 14:_context36.prev=14;_iterator39.f();return _context36.finish(14);case 17:case"end":return _context36.stop();}},_callee34,this,[[1,11,14,17]]);}));function workShapesDone(_x82,_x83){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,e){var a,o,n,i,s,c,p,h,v,y,M;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=this.setFullWork(t),i=t.ops&&Me(t.ops)||t.op;if(!n){_context37.next=26;break;}s=(a=t.workId)==null?void 0:a.toString();if(s){_context37.next=5;break;}return _context37.abrupt("return");case 5:c=(o=this.vNodes.get(s))==null?void 0:o.rect;if(!(n.toolsType===gt.Image&&e)){_context37.next=13;break;}_context37.next=9;return n.consumeServiceAsync({scene:e,isFullWork:!0,replaceId:s});case 9:p=_context37.sent;h=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);_context37.next=20;break;case 13:if(!(n.toolsType===gt.Text)){_context37.next=19;break;}_context37.next=16;return n.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:p=_context37.sent;_context37.next=20;break;case 19:p=n.consumeService({op:i,isFullWork:!0,replaceId:s}),h=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);case 20:p=Ot(p,h);v=[],y=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),p&&t.willRefresh&&(c&&v.push({rect:Dt(c),isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId}),v.push({rect:Dt(p),drawCanvas:xt.Bg,viewId:this.viewId})),t.willSyncService&&y.push({opt:t.opt,toolsType:t.toolsType,type:ft.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),v.length||y.length)){_context37.next=26;break;}M={render:v,sp:y};_context37.next=26;return this._post(M);case 26:case"end":return _context37.stop();}},_callee35,this);}));function consumeFull(_x84,_x85){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var e=this.vNodes.get(t);if(e&&e.toolsType===gt.Text)return{type:ft.TextUpdate,toolsType:gt.Text,workId:t,dataType:Tt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t){var e,n,i,a,o,s,_iterator40,_step40,c,v,h;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:e=t.willSyncService,n=[],i=[],a=[],o=this.workShapes.get(wt);if(o){_context38.next=3;break;}return _context38.abrupt("return");case 3:s=o.selectIds&&_toConsumableArray(o.selectIds)||[];_iterator40=_createForOfIteratorHelper(s);try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){c=_step40.value;if(this.vNodes.get(c)){v=this.commandDeleteText(c);v&&n.push(v);}h=this._removeWork(c);h.length&&i.push.apply(i,_toConsumableArray(h)),a.push(c);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}a.length&&n.push({type:ft.RemoveNode,removeIds:a});n.push({type:ft.Select,selectIds:[],willSyncService:e});_context38.next=10;return this.blurSelector();case 10:_context38.t0=i.length||n.length;if(!_context38.t0){_context38.next=14;break;}_context38.next=14;return this._post({render:i,sp:n});case 14:case"end":return _context38.stop();}},_callee36,this);}));function removeSelector(_x86){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context39.next=7;break;}i=this._removeWork(n);_context39.t0=i.length;if(!_context39.t0){_context39.next=7;break;}_context39.next=7;return this._post({render:i});case 7:case"end":return _context39.stop();}},_callee37,this);}));function removeWork(_x87){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var i,a,o;var e=this.vNodes.get(t);e&&((i=this.fullLayer)==null||i.getElementsByName(t).forEach(function(s){s.remove();}),this.vNodes["delete"](t));var n=this.drawLayer&&yt.getRectFromLayer(this.drawLayer,t);if(n){var s=(a=this.drawLayer)==null?void 0:a.getElementsByName(t)[0];(o=this.drawLayer)==null||o.removeChild(s);}return this.getWorkShape(t)&&this.clearWorkShapeNodeCache(t),{fullRect:e==null?void 0:e.rect,drawRect:n};}},{key:"_removeWork",value:function _removeWork(t){var _this$removeNode=this.removeNode(t),e=_this$removeNode.fullRect,n=_this$removeNode.drawRect,i=[];return e&&i.push({rect:Dt(e),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(e),drawCanvas:xt.Bg,viewId:this.viewId}),n&&i.push({rect:Dt(n),clearCanvas:xt.Float,isClear:!0,viewId:this.viewId},{rect:Dt(n),drawCanvas:xt.Float,viewId:this.viewId}),i;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var e,n,i,a,o,s,c,_iterator41,_step41,p,h,v,y,M;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context40.next=32;break;}s=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],c=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator41=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context40.prev=4;_iterator41.s();case 6:if((_step41=_iterator41.n()).done){_context40.next=14;break;}p=_step41.value;h=p.rect,v=p.name,y=p.toolsType,M=p.opt;if(!(y===gt.Text&&M.workState===It.Done&&F0([s,c],h))){_context40.next=12;break;}a=v,o=this.setFullWork({workId:v,toolsType:y,opt:M});return _context40.abrupt("break",14);case 12:_context40.next=6;break;case 14:_context40.next=19;break;case 16:_context40.prev=16;_context40.t0=_context40["catch"](4);_iterator41.e(_context40.t0);case 19:_context40.prev=19;_iterator41.f();return _context40.finish(19);case 22:_context40.t1=a;if(!_context40.t1){_context40.next=32;break;}_context40.t2=o;if(!_context40.t2){_context40.next=28;break;}_context40.next=28;return o.consumeServiceAsync({isFullWork:!0,replaceId:o.getWorkId(),isDrawLabel:!1});case 28:_context40.next=30;return this.blurSelector({viewId:n,msgType:ft.Select,dataType:i,isSync:!0});case 30:_context40.next=32;return this._post({sp:[{type:ft.GetTextActive,toolsType:gt.Text,workId:a}]});case 32:case"end":return _context40.stop();}},_callee38,this,[[4,16,19,22]]);}));function checkTextActive(_x88){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t){var _this89=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:e=this.workShapes.get(wt),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context41.next=6;break;}i===ft.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context41.next=5;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this89.effectSelectNodeData)==null||a.clear();});case 5:return _context41.abrupt("return");case 6:return _context41.abrupt("return",t);case 7:case"end":return _context41.stop();}},_callee39,this);}));function colloctEffectSelectWork(_x89){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var _this90=this;var T,e,n,i,a,o,s,c,p,h,v,y,M;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:e=this.workShapes.get(wt);if((T=e==null?void 0:e.selectIds)!=null&&T.length){_context42.next=3;break;}return _context42.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;o=i.willSerializeData;s=i.scene;_context42.next=10;return e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:Xt(e.selectIds),vNodes:this.vNodes,willSerializeData:o,worker:this,scene:s});case 10:c=_context42.sent;p=/* @__PURE__ */new Map();c!=null&&c.selectIds&&(h=iv(e.selectIds,c.selectIds),c.selectIds.forEach(function(m){var x=_this90.vNodes.get(m);if(x){var _l34=x.toolsType,d=x.op,u=x.opt;p.set(m,{opt:u,toolsType:_l34,ops:(d==null?void 0:d.length)&&_t(d)||void 0});}}),e.selectIds=c.selectIds);v=[],y=[];c!=null&&c.rect&&v.push({rect:Dt(c.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(c.rect),drawCanvas:xt.Bg,viewId:this.viewId});M=n&&n({res:c,workShapeNode:e,param:i,postData:{render:v,sp:y},newServiceStore:p})||{render:v,sp:y};h&&M.sp.push({type:ft.RemoveNode,removeIds:h,viewId:this.viewId});_context42.t0=M.render.length||M.sp.length;if(!_context42.t0){_context42.next=21;break;}_context42.next=21;return this._post(M);case 21:case"end":return _context42.stop();}},_callee40,this);}));function updateSelector(_x90){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:e=this.workShapes.get(wt),n=e==null?void 0:e.blurSelector();if(!(this.clearWorkShapeNodeCache(wt),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(a){a.name===wt&&a.remove();}),n)){_context43.next=6;break;}a=[];a.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context43.next=6;return this._post({render:(n==null?void 0:n.rect)&&[{rect:Dt(n.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(n.rect),drawCanvas:xt.Bg,viewId:this.viewId}],sp:a});case 6:case"end":return _context43.stop();}},_callee41,this);}));function blurSelector(_x91){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(wt);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(wt);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(){var t,a,e,n,i,o,_args44=arguments;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:t=_args44.length>0&&_args44[0]!==undefined?_args44[0]:!1;e=this.workShapes.get(wt);if(e){_context44.next=4;break;}return _context44.abrupt("return");case 4:if(!(e&&!((a=e.selectIds)!=null&&a.length))){_context44.next=8;break;}_context44.next=7;return this.blurSelector();case 7:return _context44.abrupt("return");case 8:n=e.oldSelectRect,i=e.reRenderSelector();if(!i){_context44.next=13;break;}o=Ot(n,i)||i;_context44.next=13;return this._post({render:[{rect:Dt(o),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(o),drawCanvas:xt.Bg,viewId:this.viewId}],sp:[{type:ft.Select,selectIds:e.selectIds,selectRect:i,willSyncService:t,viewId:this.viewId,points:e.getChildrenPoints(),textOpt:e.textOpt,selectorColor:e.selectorColor,strokeColor:e.strokeColor,fillColor:e.fillColor,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,opt:e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt}]});case 13:case"end":return _context44.stop();}},_callee42,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var i,a,o,s,c,p,h,e,n,_e$updateSelectIds,v,y,M;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:e=this.workShapes.get(wt),n=t.selectIds;if(n!=null&&n.length){_context45.next=5;break;}_context45.next=4;return this.blurSelector(t);case 4:return _context45.abrupt("return");case 5:if(e){_context45.next=10;break;}!this.setFullWork(t)&&t.workId&&((i=this.tmpOpt)==null?void 0:i.toolsType)===gt.Selector&&this.createWorkShape(t.workId.toString());_context45.next=9;return this.updateFullSelectWork(t);case 9:return _context45.abrupt("return");case 10:if(!(e&&n!=null&&n.length)){_context45.next=16;break;}_e$updateSelectIds=e.updateSelectIds(n),v=_e$updateSelectIds.bgRect,y=_e$updateSelectIds.selectRect,M={render:[],sp:[]};v&&((a=M.render)==null||a.push({rect:Dt(v),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(v),drawCanvas:xt.Bg,viewId:this.viewId}));(h=M.sp)==null||h.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||e.selectorColor,strokeColor:((s=t.opt)==null?void 0:s.strokeColor)||e.strokeColor,fillColor:((c=t.opt)==null?void 0:c.fillColor)||e.fillColor,textOpt:((p=t.opt)==null?void 0:p.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:ft.Select,selectRect:y,points:e.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt}));_context45.next=16;return this._post(M);case 16:case"end":return _context45.stop();}},_callee43,this);}));function updateFullSelectWork(_x92){return _updateFullSelectWork.apply(this,arguments);}return updateFullSelectWork;}()},{key:"destroy",value:function destroy(){this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1)),_get(_getPrototypeOf(sv.prototype),"destroy",this).call(this),this.effectSelectNodeData.clear(),this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear();}},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var n,i,a,e,o,s;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:e=(n=this.workShapes.get(t))==null?void 0:n.combineConsume();if(!e){_context46.next=6;break;}o={render:[],drawCount:this.drawCount};if(e!=null&&e.rect){s=Dt(e.rect);(i=o.render)==null||i.push({rect:s,isClear:!0,clearCanvas:xt.Float,viewId:this.viewId}),(a=o.render)==null||a.push({rect:s,drawCanvas:xt.Float,viewId:this.viewId});}_context46.next=6;return this._post(o);case 6:case"end":return _context46.stop();}},_callee44,this);}));function drawPencilCombine(_x93){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(t){var n,e;return _regeneratorRuntime().wrap(function _callee45$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:Dt(t.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(t.rect),drawCanvas:xt.Bg,viewId:this.viewId}));_context47.next=4;return this._post(e);case 4:case"end":return _context47.stop();}},_callee45,this);}));function drawSelector(_x94){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(t){var _this91=this;var n,i,e,_iterator42,_step42,a,o;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:e=[];if((n=t.newWorkDatas)!=null&&n.size){_iterator42=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){a=_step42.value;o=a.workId.toString();this.batchEraserWorks.add(o),e.push({type:ft.FullWork,workId:o,ops:_t(a.op),opt:a.opt,toolsType:a.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}delete t.newWorkDatas;}(i=t.removeIds)==null||i.forEach(function(a){_this91.batchEraserRemoveNodes.add(a);});e.push(t);_context48.next=6;return this._post({sp:e});case 6:this.batchEraserCombine();case 7:case"end":return _context48.stop();}},_callee46,this);}));function drawEraser(_x95){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:_context49.next=2;return this._post({drawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context49.stop();}},_callee47,this);}));function drawPencil(_x96){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t){var n,e;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:e={drawCount:1/0,render:[],sp:[t]};(n=e.render)==null||n.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:xt.Bg,viewId:this.viewId});_context50.next=4;return this._post(e);case 4:case"end":return _context50.stop();}},_callee48,this);}));function drawPencilFull(_x97){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this92=this;var n=[];var i;var _iterator43=_createForOfIteratorHelper(e.keys()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var a=_step43.value;this.fullLayer.getElementsByName(a).forEach(function(o){var s=o.getBoundingClientRect();i=Ot(i,{x:s.x-se.SafeBorderPadding,y:s.y-se.SafeBorderPadding,w:s.width+se.SafeBorderPadding*2,h:s.height+se.SafeBorderPadding*2}),o.remove();});}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}return t.forEach(function(a){var o=_this92.vNodes.get(a);if(o)if(_this92.fullLayer.getElementsByName(a)[0])i=Ot(i,o.rect);else{var c=_this92.setFullWork(_objectSpread(_objectSpread({},o),{},{workId:a})),p=c&&c.consumeService({op:o.op,isFullWork:!0});p&&(o.rect=p,i=Ot(i,p));}}),i&&n.push({rect:i,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:i,drawCanvas:xt.Bg,viewId:this.viewId}),n;}},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t){var e,n,i,_iterator44,_step44,a,o,s,c;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:_iterator44=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context51.prev=1;_iterator44.s();case 3:if((_step44=_iterator44.n()).done){_context51.next=23;break;}a=_step44.value;o=this.setFullWork(a);if(!o){_context51.next=21;break;}s=(e=o.getWorkId())==null?void 0:e.toString();if(!(o.toolsType===gt.Image)){_context51.next=13;break;}_context51.next=11;return o.consumeServiceAsync({scene:(i=(n=this.drawLayer)==null?void 0:n.parent)==null?void 0:i.parent,isFullWork:!0,replaceId:s});case 11:_context51.next=20;break;case 13:if(!(o.toolsType===gt.Text)){_context51.next=18;break;}_context51.next=16;return o.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:_context51.next=20;break;case 18:c=a.ops&&Me(a.ops);o.consumeService({op:c,isFullWork:!0,replaceId:s}),a!=null&&a.updateNodeOpt&&o.updataOptService(a.updateNodeOpt);case 20:a.workId&&this.workShapes["delete"](a.workId.toString());case 21:_context51.next=3;break;case 23:_context51.next=28;break;case 25:_context51.prev=25;_context51.t0=_context51["catch"](1);_iterator44.e(_context51.t0);case 28:_context51.prev=28;_iterator44.f();return _context51.finish(28);case 31:_context51.next=33;return this.reRenderSelector(t);case 33:case"end":return _context51.stop();}},_callee49,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x98){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t){var o,e,n,i,a,s,c;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:be,toolsType:n,opt:e});if(!(a&&i)){_context52.next=8;break;}s=a.cursorHover(i),c={render:[]};_context52.t0=s&&s.type===ft.CursorHover&&s.rect;if(!_context52.t0){_context52.next=8;break;}(o=c.render)==null||o.push({rect:Dt(s.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(s.rect),drawCanvas:xt.Bg,viewId:this.viewId});_context52.next=8;return this._post(c);case 8:case"end":return _context52.stop();}},_callee50,this);}));function cursorHover(_x99){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(){var n,t,e;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:t=this.getWorkShape(be);_context53.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context53.t0){_context53.next=10;break;}e=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(be);_context53.t1=e;if(!_context53.t1){_context53.next=10;break;}_context53.next=10;return this._post({render:[{rect:Dt(e),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:Dt(e),drawCanvas:xt.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(i){i.name==="Cursor_Hover_Id"&&i.remove();});case 11:case"end":return _context53.stop();}},_callee51,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(xi);var ov=/*#__PURE__*/function(){function ov(r){_classCallCheck(this,ov);nt(this,"viewId");nt(this,"vNodes");nt(this,"fullLayer");nt(this,"drawLayer");nt(this,"workShapes",/* @__PURE__ */new Map());nt(this,"selectorWorkShapes",/* @__PURE__ */new Map());nt(this,"thread");nt(this,"animationId");nt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());nt(this,"runEffectId");nt(this,"noAnimationRect");nt(this,"syncUnitTime",ie.syncOpt.interval);nt(this,"post");this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(ov,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function(){var _consumeDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(r){return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:this.activeWorkShape(r),this.runAnimation();case 1:case"end":return _context54.stop();}},_callee52,this);}));function consumeDraw(_x100){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(r){this.activeWorkShape(r),this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(r){this.activeSelectorShape(r);var t=r.workId,e=t==null?void 0:t.toString();e&&this.willRunEffectSelectorIds.add(e),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(r,t,e,n){return t.toolsType=e,t.node=br({workId:r,toolsType:e,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(r){var _this93=this;r.forEach(function(t){_this93.selectorWorkShapes.forEach(function(e,n){var i;if((i=e.selectIds)!=null&&i.length){var a=e.selectIds.indexOf(t);a>-1&&(e.selectIds.splice(a,1),_this93.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(r){var t,e,n;return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:t=r.workId,e=t==null?void 0:t.toString();if(!e){_context55.next=10;break;}n=this.workShapes.get(e);if(!n){_context55.next=8;break;}this.workShapes["delete"](e);_context55.next=7;return this.removeNode(e,r,n==null?void 0:n.totalRect,!1);case 7:return _context55.abrupt("return");case 8:_context55.next=10;return this.removeNode(e,r);case 10:case"end":return _context55.stop();}},_callee53,this);}));function removeWork(_x101){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(r){var t=r.workId,e=t==null?void 0:t.toString();e&&(this.activeSelectorShape(r),this.willRunEffectSelectorIds.add(e)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(r,t,e){var n,o,i,a,_args56=arguments;return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:n=_args56.length>3&&_args56[3]!==undefined?_args56[3]:!0;r.indexOf(wt)>-1&&this.removeSelectWork(t);i=e;a=(o=this.vNodes.get(r))==null?void 0:o.rect;a&&(i=Ot(a,i));this.fullLayer.getElementsByName(r).forEach(function(s){s.remove();});this.drawLayer.getElementsByName(r).forEach(function(s){s.remove();});this.vNodes["delete"](r);_context56.t0=i;if(!_context56.t0){_context56.next=12;break;}_context56.next=12;return this.post({render:[{rect:Dt(i),isClear:!0,clearCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId},{rect:Dt(i),drawCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId}]});case 12:case"end":return _context56.stop();}},_callee54,this);}));function removeNode(_x102,_x103,_x104){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(r){var y,M,T,m;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op,c=r.useAnimation;if(!t)return;var p=t.toString(),h=(y=this.vNodes.get(p))==null?void 0:y.rect;if(!((M=this.workShapes)!=null&&M.has(p))){var _x105={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,useAnimation:_typeof(c)<"u"?c:_typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:h,isDiff:!1};n&&e&&(_x105=this.setNodeKey(p,_x105,n,e)),(T=this.workShapes)==null||T.set(p,_x105);}var v=(m=this.workShapes)==null?void 0:m.get(p);i&&(v.type=i),o&&(v.animationWorkData=Me(o),v.ops=o),a&&(v.updateNodeOpt=a),s&&(v.isDiff=this.hasDiffData(v.animationWorkData||[],s,v.toolsType),v.animationWorkData=s),v.node&&v.node.getWorkId()!==p&&v.node.setWorkId(p),h&&(v.oldRect=h),n&&e&&(e.syncUnitTime&&(this.syncUnitTime=e.syncUnitTime),v.toolsType!==n&&n&&e&&this.setNodeKey(p,v,n,e),v.node&&v.node.setWorkOptions(e));}},{key:"hasDiffData",value:function hasDiffData(r,t,e){var n=r.length;if(t.length<n)return!0;switch(e){case gt.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break;}case gt.LaserPen:{for(var _i3=0;_i3<n;_i3+=2)if(t[_i3]!==r[_i3]||t[_i3+1]!==r[_i3+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(){var _this94=this;var n,i,a,o,s,c,p,h,v,y,M,T,m,x,l,d,u,g,O,A,R,b,E,L,D,I,C,W,G,K,X,r,t,e,_iterator45,_step45,_loop6;return _regeneratorRuntime().wrap(function _callee55$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator45=_createForOfIteratorHelper(this.workShapes.entries());_context58.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step45$value,Z,B,z,Q,_z3,_Q,_z4,_Q2,et,_,_z5,_Q3,_z6,_Q4,_et3,_5,st,q,ht,_q4;return _regeneratorRuntime().wrap(function _loop6$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_step45$value=_slicedToArray(_step45.value,2),Z=_step45$value[0],B=_step45$value[1];_context57.t0=B.toolsType;_context57.next=_context57.t0===gt.Image?4:_context57.t0===gt.Text?11:_context57.t0===gt.Arrow?19:_context57.t0===gt.Straight?19:_context57.t0===gt.Rectangle?19:_context57.t0===gt.Ellipse?19:_context57.t0===gt.Star?19:_context57.t0===gt.Polygon?19:_context57.t0===gt.SpeechBalloon?19:_context57.t0===gt.Pencil?22:37;break;case 4:z=B.oldRect;z&&((n=t.render)==null||n.push({rect:z,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(i=t.render)==null||i.push({rect:z,drawCanvas:xt.Bg,viewId:_this94.viewId}));_context57.next=8;return(o=B.node)==null?void 0:o.consumeServiceAsync({isFullWork:!0,scene:(a=_this94.fullLayer.parent)==null?void 0:a.parent});case 8:Q=_context57.sent;_this94.selectorWorkShapes.forEach(function(et,_){var st;(st=et.selectIds)!=null&&st.includes(Z)&&(_this94.willRunEffectSelectorIds.add(_),_this94.noAnimationRect=Ot(_this94.noAnimationRect,z),_this94.noAnimationRect=Ot(_this94.noAnimationRect,Q),_this94.runEffect());}),_this94.workShapes["delete"](Z),(s=t.render)==null||s.push({rect:Q,drawCanvas:xt.Bg,viewId:_this94.viewId});return _context57.abrupt("break",37);case 11:if(!B.node){_context57.next=18;break;}_z3=B.oldRect;_z3&&((c=t.render)==null||c.push({rect:_z3,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(p=t.render)==null||p.push({rect:_z3,drawCanvas:xt.Bg,viewId:_this94.viewId}));_context57.next=16;return B.node.consumeServiceAsync({isFullWork:!0,replaceId:Z});case 16:_Q=_context57.sent;_this94.selectorWorkShapes.forEach(function(et,_){var st;(st=et.selectIds)!=null&&st.includes(Z)&&(_this94.willRunEffectSelectorIds.add(_),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_z3),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_Q),_this94.runEffect());}),(h=B.node)==null||h.clearTmpPoints(),_this94.workShapes["delete"](Z),(v=t.render)==null||v.push({rect:_Q,drawCanvas:xt.Bg,viewId:_this94.viewId});case 18:return _context57.abrupt("break",37);case 19:_z4=!!B.ops;if((y=B.animationWorkData)!=null&&y.length){_Q2=B.oldRect,et=B.node.oldRect;_Q2&&((M=t.render)==null||M.push({rect:_Q2,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(T=t.render)==null||T.push({rect:_Q2,drawCanvas:xt.Bg,viewId:_this94.viewId})),et&&((m=t.render)==null||m.push({rect:et,isClear:!0,clearCanvas:xt.ServiceFloat,viewId:_this94.viewId}));_=(x=B.node)==null?void 0:x.consumeService({op:B.animationWorkData,isFullWork:_z4});e.set(Z,{workState:_Q2?B.ops?It.Done:It.Doing:It.Start,op:B.animationWorkData.filter(function(st,q){if(q%3!==2)return!0;}).slice(-2)}),_z4?(_this94.selectorWorkShapes.forEach(function(st,q){var ht;(ht=st.selectIds)!=null&&ht.includes(Z)&&(_this94.willRunEffectSelectorIds.add(q),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_Q2),_this94.noAnimationRect=Ot(_this94.noAnimationRect,et),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_),_this94.runEffect());}),(l=B.node)==null||l.clearTmpPoints(),_this94.workShapes["delete"](Z),(d=t.render)==null||d.push({rect:_,drawCanvas:xt.Bg,viewId:_this94.viewId})):(u=t.render)==null||u.push({rect:_,drawCanvas:xt.ServiceFloat,workerType:_z4?void 0:Tt.Service,viewId:_this94.viewId}),B.animationWorkData.length=0;}return _context57.abrupt("break",37);case 22:if(!(!B.useAnimation&&B.ops)){_context57.next=28;break;}_z5=(g=B.node)==null?void 0:g.consumeService({op:B.animationWorkData||[],isFullWork:!0,replaceId:Z});_Q3=(O=B.node)==null?void 0:O.updataOptService(B.updateNodeOpt);_z5=Ot(_z5,_Q3),(A=t.render)==null||A.push({isClear:!0,rect:Ot(B.oldRect,_z5),clearCanvas:xt.Bg,viewId:_this94.viewId}),(R=t.render)==null||R.push({rect:Ot(B.oldRect,_z5),drawCanvas:xt.Bg,viewId:_this94.viewId}),_this94.selectorWorkShapes.forEach(function(et,_){var st;(st=et.selectIds)!=null&&st.includes(Z)&&(_this94.willRunEffectSelectorIds.add(_),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_z5),_this94.runEffect());}),(b=B.node)==null||b.clearTmpPoints(),_this94.workShapes["delete"](Z);_context57.next=36;break;case 28:if(!B.useAnimation){_context57.next=36;break;}if(!B.isDel){_context57.next=32;break;}(E=B.node)==null||E.clearTmpPoints(),_this94.workShapes["delete"](Z);return _context57.abrupt("break",37);case 32:_z6=3,_Q4=_this94.computNextAnimationIndex(B,_z6),_et3=B.isDiff?0:Math.max(0,(B.animationIndex||0)-_z6),_5=(B.animationWorkData||[]).slice(_et3,_Q4),st=(D=(L=B.node)==null?void 0:L.getWorkId())==null?void 0:D.toString();if((B.animationIndex||0)<_Q4||B.isDiff){q=(I=B.node)==null?void 0:I.consumeService({op:_5,isFullWork:!1});if((C=t.render)==null||C.push({rect:q,drawCanvas:xt.ServiceFloat,viewId:_this94.viewId}),B.animationIndex=_Q4,B.isDiff&&(B.isDiff=!1),_5.length){ht=_5.filter(function(dt,F){if(F%_z6!==_z6-1)return!0;}).slice(-2);e.set(Z,{workState:_et3===0?It.Start:_Q4===((W=B.animationWorkData)==null?void 0:W.length)?It.Done:It.Doing,op:ht});}}else if(B.ops){_q4=(G=B.node)==null?void 0:G.consumeService({op:B.animationWorkData||[],isFullWork:!0,replaceId:st});B.isDel=!0,(K=t.render)==null||K.push({isClear:!0,rect:_q4,clearCanvas:xt.ServiceFloat,viewId:_this94.viewId},{rect:_q4,drawCanvas:xt.ServiceFloat,viewId:_this94.viewId},{isClear:!0,rect:_q4,clearCanvas:xt.Bg,viewId:_this94.viewId},{rect:_q4,drawCanvas:xt.Bg,viewId:_this94.viewId}),e.set(Z,{workState:It.Done,op:_5.filter(function(ht,dt){if(dt%_z6!==_z6-1)return!0;}).slice(-2)});}r=!0;return _context57.abrupt("break",37);case 36:return _context57.abrupt("break",37);case 37:case"end":return _context57.stop();}},_loop6);});_iterator45.s();case 7:if((_step45=_iterator45.n()).done){_context58.next=11;break;}return _context58.delegateYield(_loop6(),"t0",9);case 9:_context58.next=7;break;case 11:_context58.next=16;break;case 13:_context58.prev=13;_context58.t1=_context58["catch"](4);_iterator45.e(_context58.t1);case 16:_context58.prev=16;_iterator45.f();return _context58.finish(16);case 19:r&&this.runAnimation();e.size&&(t.sp=[],e.forEach(function(Z,B){var z;(z=t.sp)==null||z.push({type:ft.Cursor,uid:B.split(pr)[0],op:Z.op,workState:Z.workState,viewId:_this94.viewId});}));_context58.t2=(X=t.render)!=null&&X.length;if(!_context58.t2){_context58.next=25;break;}_context58.next=25;return this.post(t);case 25:case"end":return _context58.stop();}},_callee55,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"runEffect",value:function runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0));}},{key:"effectRunSelector",value:function(){var _effectRunSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(){var _this95=this;var r;return _regeneratorRuntime().wrap(function _callee56$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:this.runEffectId=void 0;r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,a;var e=_this95.selectorWorkShapes.get(t),n=e&&e.selectIds&&((i=e.node)==null?void 0:i.selectServiceNode(t,e,!0));r=Ot(r,n),(a=e==null?void 0:e.selectIds)!=null&&a.length||_this95.selectorWorkShapes["delete"](t);});_context59.t0=r;if(!_context59.t0){_context59.next=7;break;}_context59.next=7;return this.post({render:[{rect:Dt(r),isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:Dt(r),drawCanvas:xt.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context59.stop();}},_callee56,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(r){var c,p,h;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.selectIds;if(!t)return;var o=t.toString();if(!((c=this.selectorWorkShapes)!=null&&c.has(o))){var v={toolsType:n,selectIds:a,type:i,opt:e};n&&e&&(v=this.setNodeKey(o,v,n,e)),(p=this.selectorWorkShapes)==null||p.set(o,v);}var s=(h=this.selectorWorkShapes)==null?void 0:h.get(o);i&&(s.type=i),s.node&&s.node.getWorkId()!==o&&s.node.setWorkId(o),s.selectIds=a||[];}}]);}();var av=/*#__PURE__*/function(_xi2){function av(t){var _this96;_classCallCheck(this,av);_this96=_callSuper(this,av,[t]);nt(_this96,"drawWorkActiveId");return _this96;}_inherits(av,_xi2);return _createClass(av,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(t){var i,a,e,n,o,s,c;return _regeneratorRuntime().wrap(function _callee57$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:e=this.setFullWork(t),n=t.ops&&Me(t.ops);if(!e){_context60.next=18;break;}c=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===gt.Image)){_context60.next=9;break;}_context60.next=6;return e.consumeServiceAsync({isFullWork:!0,scene:(a=this.fullLayer.parent)==null?void 0:a.parent});case 6:o=_context60.sent;_context60.next=16;break;case 9:if(!(e.toolsType===gt.Text)){_context60.next=15;break;}_context60.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:c,isDrawLabel:!0});case 12:o=_context60.sent;_context60.next=16;break;case 15:o=e.consumeService({op:n,isFullWork:!0,replaceId:c}),s=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context60.abrupt("return",Ot(o,s));case 18:case"end":return _context60.stop();}},_callee57,this);}));function runFullWork(_x106){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"runSelectWork",value:function runSelectWork(t){var n;var e=this.setFullWork(t);e&&(n=t.selectIds)!=null&&n.length&&t.workId&&e.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator46=_createForOfIteratorHelper(this.workShapes.keys()),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var t=_step46.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}this.fullLayer.removeAllChildren();}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(t){var e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee58$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:e=t.workId,n=e==null?void 0:e.toString(),i=n&&this.workShapes.get(n);if(i){_context61.next=3;break;}return _context61.abrupt("return");case 3:_context61.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==n;if(!_context61.t0){_context61.next=8;break;}_context61.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:ft.DrawWork,dataType:Tt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&n!==wt&&(this.drawWorkActiveId=n);a=i.toolsType,o=i.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0});_context61.t1=a;_context61.next=_context61.t1===gt.Arrow?13:_context61.t1===gt.Straight?13:_context61.t1===gt.Ellipse?13:_context61.t1===gt.Rectangle?13:_context61.t1===gt.Star?13:_context61.t1===gt.Polygon?13:_context61.t1===gt.SpeechBalloon?13:_context61.t1===gt.Pencil?19:25;break;case 13:_context61.t2=o;if(!_context61.t2){_context61.next=18;break;}this.drawCount++;_context61.next=18;return this.drawArrow(o);case 18:return _context61.abrupt("break",25);case 19:_context61.t3=o;if(!_context61.t3){_context61.next=24;break;}this.drawCount++;_context61.next=24;return this.drawPencil(o,e==null?void 0:e.toString());case 24:return _context61.abrupt("break",25);case 25:case"end":return _context61.stop();}},_callee58,this);}));function consumeDraw(_x107){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee59$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:e=t.workId;if(!e){_context62.next=12;break;}n=e.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);i=this.workShapes.get(n);if(i){_context62.next=7;break;}return _context62.abrupt("return");case 7:_context62.t0=i.toolsType;_context62.next=_context62.t0===gt.Arrow?10:_context62.t0===gt.Straight?10:_context62.t0===gt.Ellipse?10:_context62.t0===gt.Pencil?10:_context62.t0===gt.Rectangle?10:_context62.t0===gt.Star?10:_context62.t0===gt.Polygon?10:_context62.t0===gt.SpeechBalloon?10:12;break;case 10:this.drawCount=0,this.fullLayer.removeAllChildren(),this.clearWorkShapeNodeCache(n);return _context62.abrupt("break",12);case 12:case"end":return _context62.stop();}},_callee59,this);}));function consumeDrawAll(_x108){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee60(t){var e,n,i,a;return _regeneratorRuntime().wrap(function _callee60$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context63.next=8;break;}i=this.removeNode(n);if(!i){_context63.next=8;break;}a=[];a.push({rect:Dt(i),clearCanvas:xt.Float,isClear:!0,viewId:this.viewId},{rect:Dt(i),drawCanvas:xt.Float,viewId:this.viewId});_context63.next=8;return this._post({render:a});case 8:case"end":return _context63.stop();}},_callee60,this);}));function removeWork(_x109){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var e=this.workShapes.has(t);var n;return e&&(this.fullLayer.getElementsByName(t).forEach(function(i){var a=i.getBoundingClientRect();n=Ot(n,{x:a.x-yt.SafeBorderPadding,y:a.y-yt.SafeBorderPadding,w:a.width+yt.SafeBorderPadding*2,h:a.height+yt.SafeBorderPadding*2}),i.remove();}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(t,e){return _regeneratorRuntime().wrap(function _callee61$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:_context64.next=2;return this._post({drawCount:this.drawCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:xt.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context64.stop();}},_callee61,this);}));function drawPencil(_x110,_x111){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawArrow",value:function(){var _drawArrow=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee62(t){return _regeneratorRuntime().wrap(function _callee62$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:_context65.next=2;return this._post({drawCount:this.drawCount,render:[{rect:(t==null?void 0:t.rect)&&Dt(t.rect),isClear:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Dt(t.rect),drawCanvas:xt.Float,viewId:this.viewId}]});case 2:case"end":return _context65.stop();}},_callee62,this);}));function drawArrow(_x112){return _drawArrow.apply(this,arguments);}return drawArrow;}()}]);}(xi);var lv=/*#__PURE__*/function(){function lv(r){_classCallCheck(this,lv);nt(this,"viewId");nt(this,"vNodes");nt(this,"topLayer");nt(this,"thread");nt(this,"post");nt(this,"serviceWorkShapes",/* @__PURE__ */new Map());nt(this,"localWorkShapes",/* @__PURE__ */new Map());nt(this,"tmpOpt");nt(this,"syncUnitTime",ie.syncOpt.interval);nt(this,"animationId");this.viewId=r.viewId,this.vNodes=r.vNodes,this.topLayer=r.topLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(lv,[{key:"canUseTopLayer",value:function canUseTopLayer(r){return r===gt.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(r){return this.localWorkShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e13={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e13),{},{workId:r}));return n&&this.localWorkShapes.set(r,{node:n,toolsType:n.toolsType,workState:It.Start}),n;}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var n;var e=(n=this.localWorkShapes.get(r))==null?void 0:n.node;e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t=r.toolsType;if(t===gt.LaserPen)return br(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(r){var t;return(t=r.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(r){var t;this.tmpOpt=r,(t=r.toolsOpt)!=null&&t.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consume({data:r,isFullWork:!1,isSubWorker:!0});a.rect&&(i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=It.Doing,n&&this.localWorkShapes.set(n,i));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consumeAll({data:r});i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=It.Done,n&&this.localWorkShapes.set(n,i);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(r,t,e,n){return t.toolsType=e,t.node=this.createWorkShapeNode({workId:r,toolsType:e,toolsOpt:n}),t;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(r){var v,y;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op;if(!t)return;var c=t.toString(),p=(v=this.vNodes.get(c))==null?void 0:v.rect;if(!((y=this.serviceWorkShapes)!=null&&y.has(c))){var M={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,oldRect:p};n&&e&&(M=this.setNodeKey(c,M,n,e)),this.serviceWorkShapes.set(c,M);}var h=this.serviceWorkShapes.get(c);i&&(h.type=i),o&&(h.animationWorkData=Me(o),h.ops=o),a&&(h.updateNodeOpt=a),s&&(h.animationWorkData=s),h.node&&h.node.getWorkId()!==c&&h.node.setWorkId(c),p&&(h.oldRect=p),n&&e&&(h.toolsType!==n&&n&&e&&this.setNodeKey(c,h,n,e),h.node&&h.node.setWorkOptions(e));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(){var _this97=this;var a,o,s,c,r,t,e,n,i,_iterator47,_step47,_step47$value,p,h,y,M,T,m,_iterator48,_step48,_step48$value,_p11,_h6,v,_y13,_M4,_T3,_m11;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator47=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context66.prev=4;_iterator47.s();case 6:if((_step47=_iterator47.n()).done){_context66.next=20;break;}_step47$value=_slicedToArray(_step47.value,2),p=_step47$value[0],h=_step47$value[1];_context66.t0=h.toolsType;_context66.next=_context66.t0===gt.LaserPen?11:18;break;case 11:y=this.computNextAnimationIndex(h,8),M=Math.max(0,h.animationIndex||0),T=(h.animationWorkData||[]).slice(M,y);if((h.animationIndex||0)<y){m=(a=h.node)==null?void 0:a.consumeService({op:T,isFullWork:!1});h.totalRect=Ot(h.totalRect,m),h.animationIndex=y,T.length&&t.set(p,{workState:M===0?It.Start:y===((o=h.animationWorkData)==null?void 0:o.length)?It.Done:It.Doing,op:T.slice(-2)});}if(!(n.push({isClear:!0,rect:h.totalRect,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:h.totalRect,drawCanvas:xt.TopFloat,viewId:this.viewId}),h.isDel)){_context66.next=16;break;}(s=h.node)==null||s.clearTmpPoints(),this.serviceWorkShapes["delete"](p);return _context66.abrupt("break",18);case 16:h.ops&&h.animationIndex===((c=h.animationWorkData)==null?void 0:c.length)&&!h.isDel&&(this.topLayer.getElementsByName(p.toString())[0]||(h.isDel=!0,this.serviceWorkShapes.set(p,h))),r=!0;return _context66.abrupt("break",18);case 18:_context66.next=6;break;case 20:_context66.next=25;break;case 22:_context66.prev=22;_context66.t1=_context66["catch"](4);_iterator47.e(_context66.t1);case 25:_context66.prev=25;_iterator47.f();return _context66.finish(25);case 28:_iterator48=_createForOfIteratorHelper(this.localWorkShapes.entries());_context66.prev=29;_iterator48.s();case 31:if((_step48=_iterator48.n()).done){_context66.next=44;break;}_step48$value=_slicedToArray(_step48.value,2),_p11=_step48$value[0],_h6=_step48$value[1];v=_h6.result,_y13=_h6.toolsType,_M4=_h6.totalRect,_T3=_h6.isDel,_m11=_h6.workState;_context66.t2=_y13;_context66.next=_context66.t2===gt.LaserPen?37:42;break;case 37:if(!(_M4&&(n.push({isClear:!0,rect:_M4,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:_M4,drawCanvas:xt.TopFloat,viewId:this.viewId})),_T3)){_context66.next=40;break;}_h6.node.clearTmpPoints(),this.localWorkShapes["delete"](_p11),i.push({removeIds:[_p11.toString()],viewId:this.viewId,type:ft.RemoveNode});return _context66.abrupt("break",42);case 40:v&&((v.op||v.ops)&&i.push(v),_h6.result=void 0),!this.topLayer.getElementsByName(_p11.toString())[0]&&_m11===It.Done&&(_h6.isDel=!0,this.localWorkShapes.set(_p11,_h6)),r=!0;return _context66.abrupt("break",42);case 42:_context66.next=31;break;case 44:_context66.next=49;break;case 46:_context66.prev=46;_context66.t3=_context66["catch"](29);_iterator48.e(_context66.t3);case 49:_context66.prev=49;_iterator48.f();return _context66.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(p,h){i.push({type:ft.Cursor,uid:h.split(pr)[0],op:p.op,workState:p.workState,viewId:_this97.viewId});}),(e.length||n.length||i.length)&&this.post({render:[].concat(n,e),sp:i});case 53:case"end":return _context66.stop();}},_callee63,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}}]);}();var Je=/* @__PURE__ */function(f){return f.Full="full",f.Sub="sub",f;}(Je||{});var cv=/*#__PURE__*/function(){function cv(r,t){_classCallCheck(this,cv);nt(this,"_self");nt(this,"version",ri);nt(this,"type");nt(this,"workThreadMap",/* @__PURE__ */new Map());this._self=r,this.type=t,this.register();}return _createClass(cv,[{key:"init",value:function init(r){var t=r.viewId,e=r.dpr,n=r.offscreenCanvasOpt,i=r.layerOpt,a=r.isSafari;if(!e||!n||!i)return;var o;this.type==="full"&&(o=new fv(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(o=new uv(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),o&&a&&o.setIsSafari(a),o&&r.cameraOpt&&o.setCameraOpt(r.cameraOpt),o&&this.workThreadMap.set(t,o);}},{key:"register",value:function register(){var _this98=this;onmessage=/*#__PURE__*/function(){var _ref165=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(r){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_e14,n,i,a,o,_iterator49,_step49,_step49$value,c,p,h,_iterator50,_step50,_c6,s;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:t=r.data;if(!t){_context67.next=51;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context67.prev=4;_iterator=_asyncIterator(t.values());case 6:_context67.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context67.sent).done)){_context67.next=35;break;}_e14=_step.value;n=_e14.msgType,i=_e14.viewId,a=_e14.tasksqueue,o=_e14.mainTasksqueueCount;if(!(n===ft.Console)){_context67.next=14;break;}console.log(_this98);return _context67.abrupt("continue",32);case 14:if(!(n===ft.Init)){_context67.next=17;break;}_this98.init(_e14);return _context67.abrupt("continue",32);case 17:if(!(n===ft.TasksQueue&&a!=null&&a.size)){_context67.next=22;break;}_iterator49=_createForOfIteratorHelper(_this98.workThreadMap.entries());try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){_step49$value=_slicedToArray(_step49.value,2),c=_step49$value[0],p=_step49$value[1];h=a.get(c);h&&p.on(h);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}_this98.type==="full"&&qt(o)&&_this98.post({workerTasksqueueCount:o});return _context67.abrupt("continue",32);case 22:if(!(i===Ri)){_context67.next=26;break;}_iterator50=_createForOfIteratorHelper(_this98.workThreadMap.values());try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){_c6=_step50.value;_c6.on(_e14),n===ft.Destroy&&_this98.workThreadMap["delete"](i);}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return _context67.abrupt("continue",32);case 26:s=_this98.workThreadMap.get(i);_context67.t0=s;if(!_context67.t0){_context67.next=32;break;}_context67.next=31;return s.on(_e14);case 31:n===ft.Destroy&&_this98.workThreadMap["delete"](i);case 32:_iteratorAbruptCompletion=false;_context67.next=6;break;case 35:_context67.next=41;break;case 37:_context67.prev=37;_context67.t1=_context67["catch"](4);_didIteratorError=true;_iteratorError=_context67.t1;case 41:_context67.prev=41;_context67.prev=42;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context67.next=46;break;}_context67.next=46;return _iterator["return"]();case 46:_context67.prev=46;if(!_didIteratorError){_context67.next=49;break;}throw _iteratorError;case 49:return _context67.finish(46);case 50:return _context67.finish(41);case 51:case"end":return _context67.stop();}},_callee64,null,[[4,37,41,51],[42,,46,50]]);}));return function onmessage(_x113){return _ref165.apply(this,arguments);};}();}},{key:"post",value:function post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r);}}]);}();var fv=/*#__PURE__*/function(_Si){function fv(t,e,n){var _this99;_classCallCheck(this,fv);_this99=_callSuper(this,fv,[t,e,"full"/* Full */]);nt(_this99,"type","full");nt(_this99,"serviceDrawLayer");nt(_this99,"localDrawLayer");nt(_this99,"snapshotFullLayer");nt(_this99,"methodBuilder");nt(_this99,"localWork");nt(_this99,"serviceWork");nt(_this99,"_post");nt(_this99,"taskUpdateCameraId");nt(_this99,"debounceUpdateCameraId");nt(_this99,"debounceUpdateCache",/* @__PURE__ */new Set());_this99._post=n;var i=ie.bufferSize.sub;_this99.serviceDrawLayer=_this99.createLayer("serviceDrawLayer",_this99.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i})),_this99.localDrawLayer=_this99.createLayer("localDrawLayer",_this99.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this99,viewId:_this99.viewId,vNodes:_this99.vNodes,fullLayer:_this99.fullLayer};_this99.localWork=new sv(_objectSpread(_objectSpread({},a),{},{drawLayer:_this99.localDrawLayer})),_this99.serviceWork=new ov(_objectSpread(_objectSpread({},a),{},{drawLayer:_this99.serviceDrawLayer})),_this99.methodBuilder=new ji([Lt.CopyNode,Lt.SetColorNode,Lt.DeleteNode,Lt.RotateNode,Lt.ScaleNode,Lt.TranslateNode,Lt.ZIndexNode,Lt.SetFontStyle,Lt.SetPoint,Lt.SetLock,Lt.SetShapeOpt]).registerForWorker(_this99.localWork,_this99.serviceWork,_this99.scene),_this99.vNodes.init(_this99.fullLayer);return _this99;}_inherits(fv,_Si);return _createClass(fv,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(){var _this100=this;var a,o,_this$combinePostData,t,e,n,s,_iterator51,_step51,c,_this$vNodes$getRectI3,p,_p12,i;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context68.next=29;break;}s=[];_iterator51=_createForOfIteratorHelper(t);_context68.prev=4;_iterator51.s();case 6:if((_step51=_iterator51.n()).done){_context68.next=20;break;}c=_step51.value;if(!c.rect){_context68.next=18;break;}if(c.drawCanvas===xt.Bg||c.clearCanvas===xt.Bg){_this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(c.rect,!1,!0),p=_this$vNodes$getRectI3.rectRange;c.rect=Ot(c.rect,p)||c.rect;}if(!(c.rect=this.safariFixRect(Xt(c.rect)),!c.rect)){_context68.next=12;break;}return _context68.abrupt("continue",18);case 12:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context68.next=17;break;}_context68.next=15;return this.getRectImageBitmap(c);case 15:_p12=_context68.sent;c.imageBitmap=_p12,n||(n=[]),n.push(_p12);case 17:s.push(c);case 18:_context68.next=6;break;case 20:_context68.next=25;break;case 22:_context68.prev=22;_context68.t0=_context68["catch"](4);_iterator51.e(_context68.t0);case 25:_context68.prev=25;_iterator51.f();return _context68.finish(25);case 28:e.render=s;case 29:i=(a=e.sp)==null?void 0:a.filter(function(s){return s.type!==ft.None;});i!=null&&i.length?e.sp=i.map(function(s){return _objectSpread(_objectSpread({},s),{},{viewId:_this100.viewId});}):delete e.sp,e.drawCount===void 0&&delete e.drawCount,(e!=null&&e.drawCount||i!=null&&i.length||(o=e.render)!=null&&o.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 31:case"end":return _context68.stop();}},_callee65,this,[[4,22,25,28]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t){var e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context69.next=2;break;}return _context69.abrupt("return");case 2:e=t.msgType,n=t.dataType,i=t.workId,a=t.toolsType,o=t.workState;_context69.t0=e;_context69.next=_context69.t0===ft.CreateWork?6:_context69.t0===ft.DrawWork?8:_context69.t0===ft.Select?17:_context69.t0===ft.UpdateNode?24:_context69.t0===ft.FullWork?24:_context69.t0===ft.RemoveNode?27:_context69.t0===ft.GetTextActive?30:_context69.t0===ft.CursorHover?33:_context69.t0===ft.CursorBlur?36:39;break;case 6:a!==gt.LaserPen&&this.createLocalWork(t);return _context69.abrupt("break",39);case 8:_context69.t1=a!==gt.LaserPen;if(!_context69.t1){_context69.next=16;break;}if(!(o===It.Done&&n===Tt.Local)){_context69.next=15;break;}_context69.next=13;return this.consumeDrawAll(n,t);case 13:_context69.next=16;break;case 15:this.consumeDraw(n,t);case 16:return _context69.abrupt("break",39);case 17:if(!(i===wt)){_context69.next=22;break;}_context69.next=20;return this.localWork.updateFullSelectWork(t);case 20:_context69.next=23;break;case 22:this.serviceWork.runSelectWork(t);case 23:return _context69.abrupt("return");case 24:_context69.next=26;return this.consumeFull(n,t);case 26:return _context69.abrupt("return");case 27:_context69.next=29;return this.removeNode(t);case 29:return _context69.abrupt("return");case 30:_context69.next=32;return this.checkTextActive(t);case 32:return _context69.abrupt("return");case 33:_context69.next=35;return this.cursorHover(t);case 35:return _context69.abrupt("return");case 36:_context69.next=38;return this.cursorBlur();case 38:return _context69.abrupt("return");case 39:_context69.next=41;return _get(_getPrototypeOf(fv.prototype),"on",this).call(this,t);case 41:case"end":return _context69.stop();}},_callee66,this);}));function on(_x114){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var _this101=this;var e,n,i,a,o,_iterator52,_step52,s;return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:e=t.dataType,n=t.workId,i=t.removeIds,a=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context70.next=6;break;}_iterator52=_createForOfIteratorHelper(o);try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){s=_step52.value;s===wt?a.push(this.localWork.removeSelector(t)):e===Tt.Local?a.push(this.localWork.removeWork(t).then(function(){_this101.localWork.colloctEffectSelectWork(t);})):e===Tt.Service&&a.push(this.serviceWork.removeWork(t).then(function(){_this101.localWork.colloctEffectSelectWork(t);}));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}_context70.next=6;return Promise.all(a);case 6:case"end":return _context70.stop();}},_callee67,this);}));function removeNode(_x115){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){var e;return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:e=t.dataType;_context71.t0=e===Tt.Local;if(!_context71.t0){_context71.next=5;break;}_context71.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context71.stop();}},_callee68,this);}));function checkTextActive(_x116){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(){return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:this.vNodes.clear();_get(_getPrototypeOf(fv.prototype),"clearAll",this).call(this);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.localDrawLayer.removeAllChildren());this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.serviceDrawLayer.removeAllChildren());_context72.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:xt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}],sp:[{type:ft.Clear}]});case 6:case"end":return _context72.stop();}},_callee69,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(fv.prototype),"updateLayer",this).call(this,t),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",e),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[e,n]),this.localDrawLayer.setAttribute("pos",[e*0.5,n*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",e),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[e,n]),this.serviceDrawLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var e=t.scale,n=t.centerX,i=t.centerY,a=t.width,o=t.height;(a!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:a,height:o}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[e,e]),this.fullLayer.setAttribute("translate",[-n,-i])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[e,e]),this.localDrawLayer.setAttribute("translate",[-n,-i])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[e,e]),this.serviceDrawLayer.setAttribute("translate",[-n,-i]));}},{key:"getLayer",value:function getLayer(t){switch(t){case xt.Bg:return this.fullLayer;case xt.ServiceFloat:return this.serviceDrawLayer;case xt.Float:return this.localDrawLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){return this.getLayer(t).parent.canvas;}},{key:"consumeFull",value:function(){var _consumeFull2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t,e){var n;return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:_context73.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context73.sent;_context73.t0=n&&t===Tt.Local;if(!_context73.t0){_context73.next=7;break;}_context73.next=7;return this.localWork.consumeFull(n,this.scene);case 7:n&&t===Tt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context73.stop();}},_callee70,this);}));function consumeFull(_x117,_x118){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(t,e){var n;return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:n=e.workId;_context74.t0=t===Tt.Local&&n;if(!_context74.t0){_context74.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context74.next=6;return this.localWork.consumeDraw(e,this.serviceWork);case 6:t===Tt.Service&&this.serviceWork.consumeDraw(e);case 7:case"end":return _context74.stop();}},_callee71,this);}));function consumeDraw(_x119,_x120){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(t,e){var n;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:n=e.workId;_context75.t0=t===Tt.Local&&n;if(!_context75.t0){_context75.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context75.next=6;return this.localWork.consumeDrawAll(e,this.serviceWork);case 6:case"end":return _context75.stop();}},_callee72,this);}));function consumeDrawAll(_x121,_x122){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(t){var _this102=this;var a,e,n,i,o,v,_iterator53,_step53,_step53$value,y,M,s,_iterator54,_step54,_step54$value,_v7,_y18,_M8,c,p,_v3,_iterator55,_step55,_y14,h,_iterator56,_step56,_v4,_y15,_iterator57,_step57,_M5,_iterator58,_step58,_step58$value,_v6,_y17,_M7,T,m,_x125,_l36,d,u,g,O,_iterator59,_step59,_step59$value,_v5,_y16;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!ce(this.cameraOpt,n))){_context76.next=37;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);o=!!this.serviceDrawLayer.children.length;if(!i){_context76.next=27;break;}v=!1;_iterator53=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context76.prev=7;_iterator53.s();case 9:if((_step53=_iterator53.n()).done){_context76.next=16;break;}_step53$value=_slicedToArray(_step53.value,2),y=_step53$value[0],M=_step53$value[1];if(!(M.toolsType!==gt.Text&&M.toolsType!==gt.Eraser&&M.toolsType!==gt.Selector&&M.toolsType!==gt.LaserPen&&y!==be&&y!==wt)){_context76.next=14;break;}v=!0;return _context76.abrupt("break",16);case 14:_context76.next=9;break;case 16:_context76.next=21;break;case 18:_context76.prev=18;_context76.t0=_context76["catch"](7);_iterator53.e(_context76.t0);case 21:_context76.prev=21;_iterator53.f();return _context76.finish(21);case 24:if(!v){_context76.next=27;break;}this.taskUpdateCameraId=setTimeout(function(){_this102.taskUpdateCameraId=void 0,_this102.updateCamera(t);},Sn);return _context76.abrupt("return");case 27:s=/* @__PURE__ */new Map();_iterator54=_createForOfIteratorHelper(this.vNodes.getNodesByType(gt.Text).entries());try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){_step54$value=_slicedToArray(_step54.value,2),_v7=_step54$value[0],_y18=_step54$value[1];_M8=_y18.rect;s.set(_v7,Xt(_M8));}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}c=new Set(s.keys());p=!1;if(this.localWork.hasSelector()){_v3=(a=this.localWork.getSelector())==null?void 0:a.selectIds;if(_v3){p=!0;_iterator55=_createForOfIteratorHelper(_v3);try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){_y14=_step55.value;c.add(_y14);}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}}}h=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator56=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){_v4=_step56.value;_y15=_v4.selectIds;if(_y15){h=!0;_iterator57=_createForOfIteratorHelper(_y15);try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){_M5=_step57.value;c.add(_M5);}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(c),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator58=_createForOfIteratorHelper(s.entries());try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){_step58$value=_slicedToArray(_step58.value,2),_v6=_step58$value[0],_y17=_step58$value[1];_M7=this.vNodes.get(_v6);if(_M7){T=_y17,m=_M7.rect,_x125=this.getSceneRect(),_l36=or(T,_x125),d=or(m,_x125);u=!1;if((_l36!==d||T.w!==m.w||T.h!==m.h||d===xe.intersect)&&(u=!0),u){g=_M7.toolsType,O=_M7.opt;g===gt.Text&&O.workState===It.Done&&this.debounceUpdateCache.add(_v6);}}}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}if(p&&this.localWork.reRenderSelector(),h){_iterator59=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){_step59$value=_slicedToArray(_step59.value,2),_v5=_step59$value[0],_y16=_step59$value[1];this.serviceWork.runSelectWork({workId:_v5,selectIds:_y16.selectIds,msgType:ft.Select,dataType:Tt.Service,viewId:this.viewId});}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}}this.debounceUpdateCameraId=setTimeout(function(){var y;_this102.debounceUpdateCameraId=void 0;var v=[];var _iterator60=_createForOfIteratorHelper(_this102.debounceUpdateCache.values()),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _M6=_step60.value;if((y=_this102.fullLayer)==null?void 0:y.getElementsByName(_M6)[0]){var m=_this102.vNodes.get(_M6);if(m){var _x124=m.toolsType,_l35=m.opt,d=m.rect,u=_this102.localWork.setFullWork({toolsType:_x124,opt:_l35,workId:_M6});if(u){var g=_this102.getSceneRect(),O=or(d,g);v.push(u.consumeServiceAsync({isFullWork:!0,replaceId:_M6,isDrawLabel:O!==xe.outside}));}}}_this102.debounceUpdateCache["delete"](_M6);}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}v.length?Promise.all(v).then(function(){var M=[];M.push({isClearAll:!0,clearCanvas:xt.Bg,viewId:_this102.viewId},{isDrawAll:!0,drawCanvas:xt.Bg,viewId:_this102.viewId}),M.length&&_this102.post({render:M}),_this102.vNodes.updateLowLevelNodesRect(),_this102.vNodes.clearHighLevelIds();}):(_this102.vNodes.updateLowLevelNodesRect(),_this102.vNodes.clearHighLevelIds());},Sn);}o&&e.push({isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&e.push({isClearAll:!0,clearCanvas:xt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:xt.Bg,viewId:this.viewId}),e.length&&this.post({render:e});case 37:case"end":return _context76.stop();}},_callee73,this,[[7,18,21,24]]);}));function updateCamera(_x123){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=t.rect,n=t.drawCanvas,i=Math.floor(e.x*this.dpr),a=Math.floor(e.y*this.dpr),o=Math.floor(e.w*this.dpr||1),s=Math.floor(e.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),i,a,o,s,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t){return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:_context77.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context77.stop();}},_callee74,this);}));function cursorHover(_x126){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(){return _regeneratorRuntime().wrap(function _callee75$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:_context78.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context78.stop();}},_callee75,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()}]);}(Si);var uv=/*#__PURE__*/function(_Si2){function uv(t,e,n){var _this103;_classCallCheck(this,uv);_this103=_callSuper(this,uv,[t,e,"sub"/* Sub */]);nt(_this103,"type","sub");nt(_this103,"_post");nt(_this103,"topLayer");nt(_this103,"snapshotFullLayer");nt(_this103,"serviceWork");nt(_this103,"localWork");nt(_this103,"topLayerWork");_this103._post=n;var i=ie.bufferSize.sub;_this103.topLayer=_this103.createLayer("topLayer",_this103.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this103,viewId:_this103.viewId,vNodes:_this103.vNodes,fullLayer:_this103.fullLayer,topLayer:_this103.topLayer};_this103.localWork=new av(a),_this103.topLayerWork=new lv(a),_this103.vNodes.init(_this103.fullLayer);return _this103;}_inherits(uv,_Si2);return _createClass(uv,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){var _this104=this;var a,o,s,_this$combinePostData2,t,e,n,c,_iterator61,_step61,p,h,_iterator62,_step62,_c7,i;return _regeneratorRuntime().wrap(function _callee76$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,e=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context79.next=28;break;}c=[];_iterator61=_createForOfIteratorHelper(t);_context79.prev=4;_iterator61.s();case 6:if((_step61=_iterator61.n()).done){_context79.next=19;break;}p=_step61.value;if(!p.rect){_context79.next=17;break;}if(!(p.rect=this.safariFixRect(Xt(p.rect)),!p.rect)){_context79.next=11;break;}return _context79.abrupt("continue",17);case 11:if(!(p.drawCanvas&&p.rect&&p.rect.w>0&&p.rect.h>0)){_context79.next=16;break;}_context79.next=14;return this.getRectImageBitmap(p);case 14:h=_context79.sent;p.imageBitmap=h,n||(n=[]),n.push(h);case 16:c.push(p);case 17:_context79.next=6;break;case 19:_context79.next=24;break;case 21:_context79.prev=21;_context79.t0=_context79["catch"](4);_iterator61.e(_context79.t0);case 24:_context79.prev=24;_iterator61.f();return _context79.finish(24);case 27:e.render=c;case 28:if((a=e.workIds)!=null&&a.size&&e.drawCount){_iterator62=_createForOfIteratorHelper(e.workIds.values());try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){_c7=_step62.value;this.fullLayer.getElementsByName(_c7).forEach(function(p){p.id&&e.drawCount&&Number(p.id)<e.drawCount&&p.remove();});}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}i=(o=e.sp)==null?void 0:o.filter(function(c){return c.type!==ft.None;});i!=null&&i.length?e.sp=i.map(function(c){return _objectSpread(_objectSpread({},c),{},{viewId:_this104.viewId});}):delete e.sp,e.drawCount===void 0&&delete e.drawCount,(i!=null&&i.length||e.drawCount||(s=e==null?void 0:e.render)!=null&&s.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 31:case"end":return _context79.stop();}},_callee76,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"getLayer",value:function getLayer(t,e){if(e&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case xt.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(t){var e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee77$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.dataType,o=t.workState;_context80.t0=e;_context80.next=_context80.t0===ft.UpdateTools?4:_context80.t0===ft.CreateWork?9:_context80.t0===ft.DrawWork?11:_context80.t0===ft.RemoveNode?18:_context80.t0===ft.FullWork?21:_context80.t0===ft.Snapshot?26:_context80.t0===ft.BoundingBox?33:40;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&i)){_context80.next=8;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context80.abrupt("return");case 8:return _context80.abrupt("break",40);case 9:this.createLocalWork(t);return _context80.abrupt("return");case 11:if(!(o===It.Done&&a===Tt.Local)){_context80.next=16;break;}_context80.next=14;return this.consumeDrawAll(a,t);case 14:_context80.next=17;break;case 16:this.consumeDraw(a,t);case 17:return _context80.abrupt("return");case 18:_context80.next=20;return this.removeNode(t);case 20:return _context80.abrupt("return");case 21:_context80.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context80.t1){_context80.next=25;break;}_context80.next=25;return this.consumeDrawAll(a,t);case 25:return _context80.abrupt("return");case 26:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Xe?6e3:3e3}));_context80.t2=this.snapshotFullLayer;if(!_context80.t2){_context80.next=32;break;}_context80.next=31;return this.getSnapshot(t);case 31:this.snapshotFullLayer=void 0;case 32:return _context80.abrupt("return");case 33:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Xe?6e3:3e3}));_context80.t3=this.snapshotFullLayer;if(!_context80.t3){_context80.next=39;break;}_context80.next=38;return this.getBoundingRect(t);case 38:this.snapshotFullLayer=void 0;case 39:return _context80.abrupt("return");case 40:_context80.next=42;return _get(_getPrototypeOf(uv.prototype),"on",this).call(this,t);case 42:case"end":return _context80.stop();}},_callee77,this);}));function on(_x127){return _on3.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var e=t.workId,n=t.toolsType,i=t.opt;if(n&&this.topLayerWork.canUseTopLayer(n)&&e&&i){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(e.toString(),i);return;}_get(_getPrototypeOf(uv.prototype),"createLocalWork",this).call(this,t);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t){var e;return _regeneratorRuntime().wrap(function _callee78$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:e=t.dataType;_context81.t0=e===Tt.Local;if(!_context81.t0){_context81.next=5;break;}_context81.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context81.stop();}},_callee78,this);}));function removeNode(_x128){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"getOffscreen",value:function getOffscreen(t,e){return this.getLayer(t,e).parent.canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee79$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:n=e.workId,i=e.toolsType;if(!n){_context82.next=9;break;}if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context82.next=5;break;}t===Tt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(e)),this.topLayerWork.consumeDraw(e);return _context82.abrupt("return");case 5:this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context82.next=8;return this.localWork.consumeDraw(e);case 8:return _context82.abrupt("return");case 9:case"end":return _context82.stop();}},_callee79,this);}));function consumeDraw(_x129,_x130){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t,e){var n,i,a,o;return _regeneratorRuntime().wrap(function _callee80$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:n=e.workId,i=e.toolsType,a=e.dataType;if(!n){_context83.next=8;break;}o=n.toString();if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context83.next=6;break;}a===Tt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(e)),this.topLayerWork.consumeDrawAll(e);return _context83.abrupt("return");case 6:this.localWork.getWorkShape(o)||_get(_getPrototypeOf(uv.prototype),"createLocalWork",this).call(this,e),this.localWork.consumeDrawAll(e);return _context83.abrupt("return");case 8:case"end":return _context83.stop();}},_callee80,this);}));function consumeDrawAll(_x131,_x132){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(){return _regeneratorRuntime().wrap(function _callee81$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:this.vNodes.clear();_get(_getPrototypeOf(uv.prototype),"clearAll",this).call(this);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.topLayer.removeAllChildren());_context84.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:xt.TopFloat,viewId:this.viewId}],sp:[{type:ft.Clear}]});case 5:case"end":return _context84.stop();}},_callee81,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=arguments.length>2?arguments[2]:undefined;var i=t.rect,a=t.drawCanvas,o=Math.floor(i.x*this.dpr),s=Math.floor(i.y*this.dpr),c=Math.floor(i.w*this.dpr||1),p=Math.floor(i.h*this.dpr||1);return createImageBitmap(this.getOffscreen(a,e),o,s,c,p,n);}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(uv.prototype),"updateLayer",this).call(this,t),this.topLayer&&(this.topLayer.parent.setAttribute("width",e),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[e,n]),this.topLayer.setAttribute("pos",[e*0.5,n*0.5])),this.snapshotFullLayer&&(this.snapshotFullLayer.parent.setAttribute("width",e),this.snapshotFullLayer.parent.setAttribute("height",n),this.snapshotFullLayer.setAttribute("size",[e,n]),this.snapshotFullLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t){var _this105=this;var e,n,i,a,_iterator63,_step63,_loop7;return _regeneratorRuntime().wrap(function _callee82$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!ce(this.cameraOpt,n))){_context86.next=25;break;}i=!!this.topLayerWork.localWorkShapes.size,a=!!this.localWork.getWorkShapes().size;if(!(a&&this.localWork.workShapesDone(),this.setCameraOpt(n),a&&e.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}),i)){_context86.next=21;break;}e.push({isClearAll:!0,clearCanvas:xt.TopFloat,viewId:this.viewId});_iterator63=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context86.prev=6;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step63$value,o,s,c;return _regeneratorRuntime().wrap(function _loop7$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:_step63$value=_slicedToArray(_step63.value,2),o=_step63$value[0],s=_step63$value[1];if(s.totalRect){_this105.topLayer.getElementsByName(o.toString()).forEach(function(p){var h=p.getBoundingClientRect(),v=Dt({x:h.x,y:h.y,w:h.width,h:h.height});c=Ot(c,v);}),s.totalRect=c,_this105.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context85.stop();}},_loop7);});_iterator63.s();case 9:if((_step63=_iterator63.n()).done){_context86.next=13;break;}return _context86.delegateYield(_loop7(),"t0",11);case 11:_context86.next=9;break;case 13:_context86.next=18;break;case 15:_context86.prev=15;_context86.t1=_context86["catch"](6);_iterator63.e(_context86.t1);case 18:_context86.prev=18;_iterator63.f();return _context86.finish(18);case 21:_context86.t2=e.length;if(!_context86.t2){_context86.next=25;break;}_context86.next=25;return this.post({render:e});case 25:case"end":return _context86.stop();}},_callee82,this,[[6,15,18,21]]);}));function updateCamera(_x133){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,e){this.cameraOpt=t;var n=t.scale,i=t.centerX,a=t.centerY,o=t.width,s=t.height;(o!==this.scene.width||s!==this.scene.height)&&this.updateScene({width:o,height:s}),e?(e.setAttribute("scale",[n,n]),e.setAttribute("translate",[-i,-a])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-a]),this.topLayer.setAttribute("scale",[n,n]),this.topLayer.setAttribute("translate",[-i,-a]));}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(t){var e,n,i,a,o,s,c,_i4,_Object$entries,_Object$entries$_i,h,v,y,M,p;return _regeneratorRuntime().wrap(function _callee83$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context87.next=25;break;}s=Xt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i4=0,_Object$entries=Object.entries(n);case 5:if(!(_i4<_Object$entries.length)){_context87.next=20;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),h=_Object$entries$_i[0],v=_Object$entries$_i[1];if(!(v!=null&&v.type)){_context87.next=17;break;}_context87.t0=v==null?void 0:v.type;_context87.next=_context87.t0===ft.UpdateNode?11:_context87.t0===ft.FullWork?11:17;break;case 11:y=v.opt;_context87.next=14;return this.localWork.runFullWork(_objectSpread(_objectSpread({},v),{},{opt:y,workId:h,msgType:ft.FullWork,dataType:Tt.Service,viewId:this.viewId}));case 14:M=_context87.sent;c=Ot(c,M);return _context87.abrupt("break",17);case 17:_i4++;_context87.next=5;break;case 20:a&&o&&(p={resizeWidth:a,resizeHeight:o});_context87.next=23;return this.getSnapshotRender({scenePath:e,curCameraOpt:s,options:p});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 25:case"end":return _context87.stop();}},_callee83,this);}));function getSnapshot(_x134){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(t){var o,s,e,n,i,a;return _regeneratorRuntime().wrap(function _callee84$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context88.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:xt.None},!0,i);case 4:a=_context88.sent;a&&(this._post({sp:[{type:ft.Snapshot,scenePath:e,imageBitmap:a,viewId:this.viewId}]},[a]),a.close(),(s=this.snapshotFullLayer)==null||s.removeAllChildren(),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context88.stop();}},_callee84,this);}));function getSnapshotRender(_x135){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var e,n,i,a,o,_i5,_Object$entries2,_Object$entries2$_i,s,c,p;return _regeneratorRuntime().wrap(function _callee85$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context89.next=27;break;}a=Xt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i5=0,_Object$entries2=Object.entries(n);case 5:if(!(_i5<_Object$entries2.length)){_context89.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),s=_Object$entries2$_i[0],c=_Object$entries2$_i[1];if(!(c!=null&&c.type)){_context89.next=16;break;}_context89.t0=c==null?void 0:c.type;_context89.next=_context89.t0===ft.UpdateNode?11:_context89.t0===ft.FullWork?11:16;break;case 11:_context89.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},c),{},{workId:s,msgType:ft.FullWork,dataType:Tt.Service,viewId:this.viewId}));case 13:p=_context89.sent;o=Ot(o,p);return _context89.abrupt("break",16);case 16:_i5++;_context89.next=5;break;case 19:_context89.t1=o;if(!_context89.t1){_context89.next=23;break;}_context89.next=23;return this.post({sp:[{type:ft.BoundingBox,scenePath:e,rect:o}]});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;this.snapshotFullLayer.removeAllChildren();this.setCameraOpt(a,this.fullLayer);case 27:case"end":return _context89.stop();}},_callee85,this);}));function getBoundingRect(_x136){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Si);var Rn=self;Rn.full=new cv(Rn,Je.Full);