@netless/appliance-plugin 1.1.22-beta.9 → 1.1.23

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,517 @@
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 s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)o=s[r],t.includes(o)||{}.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.includes(n))continue;t[n]=r[n];}return t;}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 _superPropSet(t,e,o,r,p,f){return _set(_getPrototypeOf(f?t.prototype:t),e,o,r,p);}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 _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 _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}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 _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 _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 _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}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 _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 _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 _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 _n8=0,F=function F(){};return{s:F,n:function n(){return _n8>=r.length?{done:!0}:{done:!1,value:r[_n8++]};},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 _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 Jy=Object.defineProperty;var Qy=function Qy(i,e,t){return e in i?Jy(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;};var dt=function dt(i,e,t){return Qy(i,_typeof(e)!="symbol"?e+"":e,t);};var be=/******/function(i){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={/******/i:r,/******/l:!1,/******/exports:{}/******/};return i[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=i,t.c=e,t.d=function(r,n,s){t.o(r,n)||Object.defineProperty(r,n,{enumerable:!0,get:s});},t.r=function(r){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0});},t.t=function(r,n){if(n&1&&(r=t(r)),n&8||n&4&&_typeof(r)=="object"&&r&&r.__esModule)return r;var s=/* @__PURE__ */Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:r}),n&2&&typeof r!="string")for(var c in r)t.d(s,c,function(l){return r[l];}.bind(null,c));return s;},t.n=function(r){var n=r&&r.__esModule?(/******/function(){return r["default"];}):(/******/function(){return r;});return t.d(n,"a",n),n;},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n);},t.p="/js/",t(t.s=0);}([/* 0 *//***/function(i,e,t){t.r(e),t.d(e,"version",function(){return tt;}),t.d(e,"helpers",function(){return G;}),t.d(e,"createElement",function(){return Y;}),t.d(e,"isSpriteNode",function(){return B;}),t.d(e,"registerNode",function(){return N;});var r=t(12);t.d(e,"ENV",function(){return r.ENV;});var n=t(68);t.d(e,"requestAnimationFrame",function(){return n.requestAnimationFrame;}),t.d(e,"cancelAnimationFrame",function(){return n.cancelAnimationFrame;});var s=t(70);t.d(e,"Node",function(){return s["default"];});var c=t(217);t.d(e,"Cloud",function(){return c["default"];});var l=t(219);t.d(e,"Block",function(){return l["default"];});var f=t(224);t.d(e,"Sprite",function(){return f["default"];});var h=t(226);t.d(e,"Path",function(){return h["default"];});var m=t(229);t.d(e,"Rect",function(){return m["default"];});var u=t(231);t.d(e,"Triangle",function(){return u["default"];});var y=t(236);t.d(e,"Parallel",function(){return y["default"];});var T=t(238);t.d(e,"Regular",function(){return T["default"];});var E=t(240);t.d(e,"Star",function(){return E["default"];});var C=t(242);t.d(e,"Ellipse",function(){return C["default"];});var x=t(244);t.d(e,"Arc",function(){return x["default"];});var I=t(246);t.d(e,"Ring",function(){return I["default"];});var d=t(232);t.d(e,"Polyline",function(){return d["default"];});var v=t(248);t.d(e,"Label",function(){return v["default"];});var p=t(250);t.d(e,"Group",function(){return p["default"];});var S=t(286);t.d(e,"Layer",function(){return S["default"];});var A=t(287);t.d(e,"SpriteSvg",function(){return A["default"];});var R=t(289);t.d(e,"LayerWorker",function(){return R["default"];});var D=t(290);t.d(e,"Scene",function(){return D["default"];});var U=t(213),M=t(221);t.d(e,"Color",function(){return M.Color;}),t.d(e,"Gradient",function(){return M.Gradient;});var W=t(72);t(1).glMatrix.setMatrixArrayType(Array);var Y=U["default"].createElement,B=U["default"].isSpriteNode,N=U["default"].registerNode,G={parseColor:M.parseColor,sizeToPixel:W.sizeToPixel,toArray:W.toArray,toString:W.toString,toNumber:W.toNumber};var J;J="3.8.3";var tt=J;},/* 1 *//***/function(i,e,t){t.r(e);var r=t(2);t.d(e,"glMatrix",function(){return r;});var n=t(3);t.d(e,"mat2",function(){return n;});var s=t(4);t.d(e,"mat2d",function(){return s;});var c=t(5);t.d(e,"mat3",function(){return c;});var l=t(6);t.d(e,"mat4",function(){return l;});var f=t(7);t.d(e,"quat",function(){return f;});var h=t(10);t.d(e,"quat2",function(){return h;});var m=t(11);t.d(e,"vec2",function(){return m;});var u=t(8);t.d(e,"vec3",function(){return u;});var y=t(9);t.d(e,"vec4",function(){return y;});},/* 2 *//***/function(i,e,t){t.r(e),t.d(e,"EPSILON",function(){return r;}),t.d(e,"ARRAY_TYPE",function(){return n;}),t.d(e,"RANDOM",function(){return s;}),t.d(e,"setMatrixArrayType",function(){return c;}),t.d(e,"toRadian",function(){return f;}),t.d(e,"equals",function(){return h;});var r=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,s=Math.random;function c(m){n=m;}var l=Math.PI/180;function f(m){return m*l;}function h(m,u){return Math.abs(m-u)<=r*Math.max(1,Math.abs(m),Math.abs(u));}Math.hypot||(Math.hypot=function(){for(var m=0,u=arguments.length;u--;)m+=arguments[u]*arguments[u];return Math.sqrt(m);});},/* 3 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"identity",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"transpose",function(){return m;}),t.d(e,"invert",function(){return u;}),t.d(e,"adjoint",function(){return y;}),t.d(e,"determinant",function(){return T;}),t.d(e,"multiply",function(){return E;}),t.d(e,"rotate",function(){return C;}),t.d(e,"scale",function(){return x;}),t.d(e,"fromRotation",function(){return I;}),t.d(e,"fromScaling",function(){return d;}),t.d(e,"str",function(){return v;}),t.d(e,"frob",function(){return p;}),t.d(e,"LDU",function(){return S;}),t.d(e,"add",function(){return A;}),t.d(e,"subtract",function(){return R;}),t.d(e,"exactEquals",function(){return D;}),t.d(e,"equals",function(){return U;}),t.d(e,"multiplyScalar",function(){return M;}),t.d(e,"multiplyScalarAndAdd",function(){return W;}),t.d(e,"mul",function(){return Y;}),t.d(e,"sub",function(){return B;});var r=t(2);function n(){var N=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(N[1]=0,N[2]=0),N[0]=1,N[3]=1,N;}function s(N){var G=new r.ARRAY_TYPE(4);return G[0]=N[0],G[1]=N[1],G[2]=N[2],G[3]=N[3],G;}function c(N,G){return N[0]=G[0],N[1]=G[1],N[2]=G[2],N[3]=G[3],N;}function l(N){return N[0]=1,N[1]=0,N[2]=0,N[3]=1,N;}function f(N,G,J,tt){var at=new r.ARRAY_TYPE(4);return at[0]=N,at[1]=G,at[2]=J,at[3]=tt,at;}function h(N,G,J,tt,at){return N[0]=G,N[1]=J,N[2]=tt,N[3]=at,N;}function m(N,G){if(N===G){var J=G[1];N[1]=G[2],N[2]=J;}else N[0]=G[0],N[1]=G[2],N[2]=G[1],N[3]=G[3];return N;}function u(N,G){var J=G[0],tt=G[1],at=G[2],ut=G[3],K=J*ut-at*tt;return K?(K=1/K,N[0]=ut*K,N[1]=-tt*K,N[2]=-at*K,N[3]=J*K,N):null;}function y(N,G){var J=G[0];return N[0]=G[3],N[1]=-G[1],N[2]=-G[2],N[3]=J,N;}function T(N){return N[0]*N[3]-N[2]*N[1];}function E(N,G,J){var tt=G[0],at=G[1],ut=G[2],K=G[3],Q=J[0],ft=J[1],gt=J[2],mt=J[3];return N[0]=tt*Q+ut*ft,N[1]=at*Q+K*ft,N[2]=tt*gt+ut*mt,N[3]=at*gt+K*mt,N;}function C(N,G,J){var tt=G[0],at=G[1],ut=G[2],K=G[3],Q=Math.sin(J),ft=Math.cos(J);return N[0]=tt*ft+ut*Q,N[1]=at*ft+K*Q,N[2]=tt*-Q+ut*ft,N[3]=at*-Q+K*ft,N;}function x(N,G,J){var tt=G[0],at=G[1],ut=G[2],K=G[3],Q=J[0],ft=J[1];return N[0]=tt*Q,N[1]=at*Q,N[2]=ut*ft,N[3]=K*ft,N;}function I(N,G){var J=Math.sin(G),tt=Math.cos(G);return N[0]=tt,N[1]=J,N[2]=-J,N[3]=tt,N;}function d(N,G){return N[0]=G[0],N[1]=0,N[2]=0,N[3]=G[1],N;}function v(N){return"mat2("+N[0]+", "+N[1]+", "+N[2]+", "+N[3]+")";}function p(N){return Math.hypot(N[0],N[1],N[2],N[3]);}function S(N,G,J,tt){return N[2]=tt[2]/tt[0],J[0]=tt[0],J[1]=tt[1],J[3]=tt[3]-N[2]*J[1],[N,G,J];}function A(N,G,J){return N[0]=G[0]+J[0],N[1]=G[1]+J[1],N[2]=G[2]+J[2],N[3]=G[3]+J[3],N;}function R(N,G,J){return N[0]=G[0]-J[0],N[1]=G[1]-J[1],N[2]=G[2]-J[2],N[3]=G[3]-J[3],N;}function D(N,G){return N[0]===G[0]&&N[1]===G[1]&&N[2]===G[2]&&N[3]===G[3];}function U(N,G){var J=N[0],tt=N[1],at=N[2],ut=N[3],K=G[0],Q=G[1],ft=G[2],gt=G[3];return Math.abs(J-K)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(K))&&Math.abs(tt-Q)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(Q))&&Math.abs(at-ft)<=r.EPSILON*Math.max(1,Math.abs(at),Math.abs(ft))&&Math.abs(ut-gt)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(gt));}function M(N,G,J){return N[0]=G[0]*J,N[1]=G[1]*J,N[2]=G[2]*J,N[3]=G[3]*J,N;}function W(N,G,J,tt){return N[0]=G[0]+J[0]*tt,N[1]=G[1]+J[1]*tt,N[2]=G[2]+J[2]*tt,N[3]=G[3]+J[3]*tt,N;}var Y=E,B=R;},/* 4 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"identity",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"invert",function(){return m;}),t.d(e,"determinant",function(){return u;}),t.d(e,"multiply",function(){return y;}),t.d(e,"rotate",function(){return T;}),t.d(e,"scale",function(){return E;}),t.d(e,"translate",function(){return C;}),t.d(e,"fromRotation",function(){return x;}),t.d(e,"fromScaling",function(){return I;}),t.d(e,"fromTranslation",function(){return d;}),t.d(e,"str",function(){return v;}),t.d(e,"frob",function(){return p;}),t.d(e,"add",function(){return S;}),t.d(e,"subtract",function(){return A;}),t.d(e,"multiplyScalar",function(){return R;}),t.d(e,"multiplyScalarAndAdd",function(){return D;}),t.d(e,"exactEquals",function(){return U;}),t.d(e,"equals",function(){return M;}),t.d(e,"mul",function(){return W;}),t.d(e,"sub",function(){return Y;});var r=t(2);function n(){var B=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(B[1]=0,B[2]=0,B[4]=0,B[5]=0),B[0]=1,B[3]=1,B;}function s(B){var N=new r.ARRAY_TYPE(6);return N[0]=B[0],N[1]=B[1],N[2]=B[2],N[3]=B[3],N[4]=B[4],N[5]=B[5],N;}function c(B,N){return B[0]=N[0],B[1]=N[1],B[2]=N[2],B[3]=N[3],B[4]=N[4],B[5]=N[5],B;}function l(B){return B[0]=1,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B;}function f(B,N,G,J,tt,at){var ut=new r.ARRAY_TYPE(6);return ut[0]=B,ut[1]=N,ut[2]=G,ut[3]=J,ut[4]=tt,ut[5]=at,ut;}function h(B,N,G,J,tt,at,ut){return B[0]=N,B[1]=G,B[2]=J,B[3]=tt,B[4]=at,B[5]=ut,B;}function m(B,N){var G=N[0],J=N[1],tt=N[2],at=N[3],ut=N[4],K=N[5],Q=G*at-J*tt;return Q?(Q=1/Q,B[0]=at*Q,B[1]=-J*Q,B[2]=-tt*Q,B[3]=G*Q,B[4]=(tt*K-at*ut)*Q,B[5]=(J*ut-G*K)*Q,B):null;}function u(B){return B[0]*B[3]-B[1]*B[2];}function y(B,N,G){var J=N[0],tt=N[1],at=N[2],ut=N[3],K=N[4],Q=N[5],ft=G[0],gt=G[1],mt=G[2],wt=G[3],ht=G[4],Nt=G[5];return B[0]=J*ft+at*gt,B[1]=tt*ft+ut*gt,B[2]=J*mt+at*wt,B[3]=tt*mt+ut*wt,B[4]=J*ht+at*Nt+K,B[5]=tt*ht+ut*Nt+Q,B;}function T(B,N,G){var J=N[0],tt=N[1],at=N[2],ut=N[3],K=N[4],Q=N[5],ft=Math.sin(G),gt=Math.cos(G);return B[0]=J*gt+at*ft,B[1]=tt*gt+ut*ft,B[2]=J*-ft+at*gt,B[3]=tt*-ft+ut*gt,B[4]=K,B[5]=Q,B;}function E(B,N,G){var J=N[0],tt=N[1],at=N[2],ut=N[3],K=N[4],Q=N[5],ft=G[0],gt=G[1];return B[0]=J*ft,B[1]=tt*ft,B[2]=at*gt,B[3]=ut*gt,B[4]=K,B[5]=Q,B;}function C(B,N,G){var J=N[0],tt=N[1],at=N[2],ut=N[3],K=N[4],Q=N[5],ft=G[0],gt=G[1];return B[0]=J,B[1]=tt,B[2]=at,B[3]=ut,B[4]=J*ft+at*gt+K,B[5]=tt*ft+ut*gt+Q,B;}function x(B,N){var G=Math.sin(N),J=Math.cos(N);return B[0]=J,B[1]=G,B[2]=-G,B[3]=J,B[4]=0,B[5]=0,B;}function I(B,N){return B[0]=N[0],B[1]=0,B[2]=0,B[3]=N[1],B[4]=0,B[5]=0,B;}function d(B,N){return B[0]=1,B[1]=0,B[2]=0,B[3]=1,B[4]=N[0],B[5]=N[1],B;}function v(B){return"mat2d("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+")";}function p(B){return Math.hypot(B[0],B[1],B[2],B[3],B[4],B[5],1);}function S(B,N,G){return B[0]=N[0]+G[0],B[1]=N[1]+G[1],B[2]=N[2]+G[2],B[3]=N[3]+G[3],B[4]=N[4]+G[4],B[5]=N[5]+G[5],B;}function A(B,N,G){return B[0]=N[0]-G[0],B[1]=N[1]-G[1],B[2]=N[2]-G[2],B[3]=N[3]-G[3],B[4]=N[4]-G[4],B[5]=N[5]-G[5],B;}function R(B,N,G){return B[0]=N[0]*G,B[1]=N[1]*G,B[2]=N[2]*G,B[3]=N[3]*G,B[4]=N[4]*G,B[5]=N[5]*G,B;}function D(B,N,G,J){return B[0]=N[0]+G[0]*J,B[1]=N[1]+G[1]*J,B[2]=N[2]+G[2]*J,B[3]=N[3]+G[3]*J,B[4]=N[4]+G[4]*J,B[5]=N[5]+G[5]*J,B;}function U(B,N){return B[0]===N[0]&&B[1]===N[1]&&B[2]===N[2]&&B[3]===N[3]&&B[4]===N[4]&&B[5]===N[5];}function M(B,N){var G=B[0],J=B[1],tt=B[2],at=B[3],ut=B[4],K=B[5],Q=N[0],ft=N[1],gt=N[2],mt=N[3],wt=N[4],ht=N[5];return Math.abs(G-Q)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(Q))&&Math.abs(J-ft)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(ft))&&Math.abs(tt-gt)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(gt))&&Math.abs(at-mt)<=r.EPSILON*Math.max(1,Math.abs(at),Math.abs(mt))&&Math.abs(ut-wt)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(wt))&&Math.abs(K-ht)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(ht));}var W=y,Y=A;},/* 5 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"fromMat4",function(){return s;}),t.d(e,"clone",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"identity",function(){return m;}),t.d(e,"transpose",function(){return u;}),t.d(e,"invert",function(){return y;}),t.d(e,"adjoint",function(){return T;}),t.d(e,"determinant",function(){return E;}),t.d(e,"multiply",function(){return C;}),t.d(e,"translate",function(){return x;}),t.d(e,"rotate",function(){return I;}),t.d(e,"scale",function(){return d;}),t.d(e,"fromTranslation",function(){return v;}),t.d(e,"fromRotation",function(){return p;}),t.d(e,"fromScaling",function(){return S;}),t.d(e,"fromMat2d",function(){return A;}),t.d(e,"fromQuat",function(){return R;}),t.d(e,"normalFromMat4",function(){return D;}),t.d(e,"projection",function(){return U;}),t.d(e,"str",function(){return M;}),t.d(e,"frob",function(){return W;}),t.d(e,"add",function(){return Y;}),t.d(e,"subtract",function(){return B;}),t.d(e,"multiplyScalar",function(){return N;}),t.d(e,"multiplyScalarAndAdd",function(){return G;}),t.d(e,"exactEquals",function(){return J;}),t.d(e,"equals",function(){return tt;}),t.d(e,"mul",function(){return at;}),t.d(e,"sub",function(){return ut;});var r=t(2);function n(){var K=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(K[1]=0,K[2]=0,K[3]=0,K[5]=0,K[6]=0,K[7]=0),K[0]=1,K[4]=1,K[8]=1,K;}function s(K,Q){return K[0]=Q[0],K[1]=Q[1],K[2]=Q[2],K[3]=Q[4],K[4]=Q[5],K[5]=Q[6],K[6]=Q[8],K[7]=Q[9],K[8]=Q[10],K;}function c(K){var Q=new r.ARRAY_TYPE(9);return Q[0]=K[0],Q[1]=K[1],Q[2]=K[2],Q[3]=K[3],Q[4]=K[4],Q[5]=K[5],Q[6]=K[6],Q[7]=K[7],Q[8]=K[8],Q;}function l(K,Q){return K[0]=Q[0],K[1]=Q[1],K[2]=Q[2],K[3]=Q[3],K[4]=Q[4],K[5]=Q[5],K[6]=Q[6],K[7]=Q[7],K[8]=Q[8],K;}function f(K,Q,ft,gt,mt,wt,ht,Nt,Rt){var X=new r.ARRAY_TYPE(9);return X[0]=K,X[1]=Q,X[2]=ft,X[3]=gt,X[4]=mt,X[5]=wt,X[6]=ht,X[7]=Nt,X[8]=Rt,X;}function h(K,Q,ft,gt,mt,wt,ht,Nt,Rt,X){return K[0]=Q,K[1]=ft,K[2]=gt,K[3]=mt,K[4]=wt,K[5]=ht,K[6]=Nt,K[7]=Rt,K[8]=X,K;}function m(K){return K[0]=1,K[1]=0,K[2]=0,K[3]=0,K[4]=1,K[5]=0,K[6]=0,K[7]=0,K[8]=1,K;}function u(K,Q){if(K===Q){var ft=Q[1],gt=Q[2],mt=Q[5];K[1]=Q[3],K[2]=Q[6],K[3]=ft,K[5]=Q[7],K[6]=gt,K[7]=mt;}else K[0]=Q[0],K[1]=Q[3],K[2]=Q[6],K[3]=Q[1],K[4]=Q[4],K[5]=Q[7],K[6]=Q[2],K[7]=Q[5],K[8]=Q[8];return K;}function y(K,Q){var ft=Q[0],gt=Q[1],mt=Q[2],wt=Q[3],ht=Q[4],Nt=Q[5],Rt=Q[6],X=Q[7],z=Q[8],q=z*ht-Nt*X,nt=-z*wt+Nt*Rt,j=X*wt-ht*Rt,Z=ft*q+gt*nt+mt*j;return Z?(Z=1/Z,K[0]=q*Z,K[1]=(-z*gt+mt*X)*Z,K[2]=(Nt*gt-mt*ht)*Z,K[3]=nt*Z,K[4]=(z*ft-mt*Rt)*Z,K[5]=(-Nt*ft+mt*wt)*Z,K[6]=j*Z,K[7]=(-X*ft+gt*Rt)*Z,K[8]=(ht*ft-gt*wt)*Z,K):null;}function T(K,Q){var ft=Q[0],gt=Q[1],mt=Q[2],wt=Q[3],ht=Q[4],Nt=Q[5],Rt=Q[6],X=Q[7],z=Q[8];return K[0]=ht*z-Nt*X,K[1]=mt*X-gt*z,K[2]=gt*Nt-mt*ht,K[3]=Nt*Rt-wt*z,K[4]=ft*z-mt*Rt,K[5]=mt*wt-ft*Nt,K[6]=wt*X-ht*Rt,K[7]=gt*Rt-ft*X,K[8]=ft*ht-gt*wt,K;}function E(K){var Q=K[0],ft=K[1],gt=K[2],mt=K[3],wt=K[4],ht=K[5],Nt=K[6],Rt=K[7],X=K[8];return Q*(X*wt-ht*Rt)+ft*(-X*mt+ht*Nt)+gt*(Rt*mt-wt*Nt);}function C(K,Q,ft){var gt=Q[0],mt=Q[1],wt=Q[2],ht=Q[3],Nt=Q[4],Rt=Q[5],X=Q[6],z=Q[7],q=Q[8],nt=ft[0],j=ft[1],Z=ft[2],O=ft[3],L=ft[4],$=ft[5],V=ft[6],rt=ft[7],it=ft[8];return K[0]=nt*gt+j*ht+Z*X,K[1]=nt*mt+j*Nt+Z*z,K[2]=nt*wt+j*Rt+Z*q,K[3]=O*gt+L*ht+$*X,K[4]=O*mt+L*Nt+$*z,K[5]=O*wt+L*Rt+$*q,K[6]=V*gt+rt*ht+it*X,K[7]=V*mt+rt*Nt+it*z,K[8]=V*wt+rt*Rt+it*q,K;}function x(K,Q,ft){var gt=Q[0],mt=Q[1],wt=Q[2],ht=Q[3],Nt=Q[4],Rt=Q[5],X=Q[6],z=Q[7],q=Q[8],nt=ft[0],j=ft[1];return K[0]=gt,K[1]=mt,K[2]=wt,K[3]=ht,K[4]=Nt,K[5]=Rt,K[6]=nt*gt+j*ht+X,K[7]=nt*mt+j*Nt+z,K[8]=nt*wt+j*Rt+q,K;}function I(K,Q,ft){var gt=Q[0],mt=Q[1],wt=Q[2],ht=Q[3],Nt=Q[4],Rt=Q[5],X=Q[6],z=Q[7],q=Q[8],nt=Math.sin(ft),j=Math.cos(ft);return K[0]=j*gt+nt*ht,K[1]=j*mt+nt*Nt,K[2]=j*wt+nt*Rt,K[3]=j*ht-nt*gt,K[4]=j*Nt-nt*mt,K[5]=j*Rt-nt*wt,K[6]=X,K[7]=z,K[8]=q,K;}function d(K,Q,ft){var gt=ft[0],mt=ft[1];return K[0]=gt*Q[0],K[1]=gt*Q[1],K[2]=gt*Q[2],K[3]=mt*Q[3],K[4]=mt*Q[4],K[5]=mt*Q[5],K[6]=Q[6],K[7]=Q[7],K[8]=Q[8],K;}function v(K,Q){return K[0]=1,K[1]=0,K[2]=0,K[3]=0,K[4]=1,K[5]=0,K[6]=Q[0],K[7]=Q[1],K[8]=1,K;}function p(K,Q){var ft=Math.sin(Q),gt=Math.cos(Q);return K[0]=gt,K[1]=ft,K[2]=0,K[3]=-ft,K[4]=gt,K[5]=0,K[6]=0,K[7]=0,K[8]=1,K;}function S(K,Q){return K[0]=Q[0],K[1]=0,K[2]=0,K[3]=0,K[4]=Q[1],K[5]=0,K[6]=0,K[7]=0,K[8]=1,K;}function A(K,Q){return K[0]=Q[0],K[1]=Q[1],K[2]=0,K[3]=Q[2],K[4]=Q[3],K[5]=0,K[6]=Q[4],K[7]=Q[5],K[8]=1,K;}function R(K,Q){var ft=Q[0],gt=Q[1],mt=Q[2],wt=Q[3],ht=ft+ft,Nt=gt+gt,Rt=mt+mt,X=ft*ht,z=gt*ht,q=gt*Nt,nt=mt*ht,j=mt*Nt,Z=mt*Rt,O=wt*ht,L=wt*Nt,$=wt*Rt;return K[0]=1-q-Z,K[3]=z-$,K[6]=nt+L,K[1]=z+$,K[4]=1-X-Z,K[7]=j-O,K[2]=nt-L,K[5]=j+O,K[8]=1-X-q,K;}function D(K,Q){var ft=Q[0],gt=Q[1],mt=Q[2],wt=Q[3],ht=Q[4],Nt=Q[5],Rt=Q[6],X=Q[7],z=Q[8],q=Q[9],nt=Q[10],j=Q[11],Z=Q[12],O=Q[13],L=Q[14],$=Q[15],V=ft*Nt-gt*ht,rt=ft*Rt-mt*ht,it=ft*X-wt*ht,ct=gt*Rt-mt*Nt,St=gt*X-wt*Nt,Ct=mt*X-wt*Rt,Mt=z*O-q*Z,Dt=z*L-nt*Z,At=z*$-j*Z,Ot=q*L-nt*O,Lt=q*$-j*O,Yt=nt*$-j*L,zt=V*Yt-rt*Lt+it*Ot+ct*At-St*Dt+Ct*Mt;return zt?(zt=1/zt,K[0]=(Nt*Yt-Rt*Lt+X*Ot)*zt,K[1]=(Rt*At-ht*Yt-X*Dt)*zt,K[2]=(ht*Lt-Nt*At+X*Mt)*zt,K[3]=(mt*Lt-gt*Yt-wt*Ot)*zt,K[4]=(ft*Yt-mt*At+wt*Dt)*zt,K[5]=(gt*At-ft*Lt-wt*Mt)*zt,K[6]=(O*Ct-L*St+$*ct)*zt,K[7]=(L*it-Z*Ct-$*rt)*zt,K[8]=(Z*St-O*it+$*V)*zt,K):null;}function U(K,Q,ft){return K[0]=2/Q,K[1]=0,K[2]=0,K[3]=0,K[4]=-2/ft,K[5]=0,K[6]=-1,K[7]=1,K[8]=1,K;}function M(K){return"mat3("+K[0]+", "+K[1]+", "+K[2]+", "+K[3]+", "+K[4]+", "+K[5]+", "+K[6]+", "+K[7]+", "+K[8]+")";}function W(K){return Math.hypot(K[0],K[1],K[2],K[3],K[4],K[5],K[6],K[7],K[8]);}function Y(K,Q,ft){return K[0]=Q[0]+ft[0],K[1]=Q[1]+ft[1],K[2]=Q[2]+ft[2],K[3]=Q[3]+ft[3],K[4]=Q[4]+ft[4],K[5]=Q[5]+ft[5],K[6]=Q[6]+ft[6],K[7]=Q[7]+ft[7],K[8]=Q[8]+ft[8],K;}function B(K,Q,ft){return K[0]=Q[0]-ft[0],K[1]=Q[1]-ft[1],K[2]=Q[2]-ft[2],K[3]=Q[3]-ft[3],K[4]=Q[4]-ft[4],K[5]=Q[5]-ft[5],K[6]=Q[6]-ft[6],K[7]=Q[7]-ft[7],K[8]=Q[8]-ft[8],K;}function N(K,Q,ft){return K[0]=Q[0]*ft,K[1]=Q[1]*ft,K[2]=Q[2]*ft,K[3]=Q[3]*ft,K[4]=Q[4]*ft,K[5]=Q[5]*ft,K[6]=Q[6]*ft,K[7]=Q[7]*ft,K[8]=Q[8]*ft,K;}function G(K,Q,ft,gt){return K[0]=Q[0]+ft[0]*gt,K[1]=Q[1]+ft[1]*gt,K[2]=Q[2]+ft[2]*gt,K[3]=Q[3]+ft[3]*gt,K[4]=Q[4]+ft[4]*gt,K[5]=Q[5]+ft[5]*gt,K[6]=Q[6]+ft[6]*gt,K[7]=Q[7]+ft[7]*gt,K[8]=Q[8]+ft[8]*gt,K;}function J(K,Q){return K[0]===Q[0]&&K[1]===Q[1]&&K[2]===Q[2]&&K[3]===Q[3]&&K[4]===Q[4]&&K[5]===Q[5]&&K[6]===Q[6]&&K[7]===Q[7]&&K[8]===Q[8];}function tt(K,Q){var ft=K[0],gt=K[1],mt=K[2],wt=K[3],ht=K[4],Nt=K[5],Rt=K[6],X=K[7],z=K[8],q=Q[0],nt=Q[1],j=Q[2],Z=Q[3],O=Q[4],L=Q[5],$=Q[6],V=Q[7],rt=Q[8];return Math.abs(ft-q)<=r.EPSILON*Math.max(1,Math.abs(ft),Math.abs(q))&&Math.abs(gt-nt)<=r.EPSILON*Math.max(1,Math.abs(gt),Math.abs(nt))&&Math.abs(mt-j)<=r.EPSILON*Math.max(1,Math.abs(mt),Math.abs(j))&&Math.abs(wt-Z)<=r.EPSILON*Math.max(1,Math.abs(wt),Math.abs(Z))&&Math.abs(ht-O)<=r.EPSILON*Math.max(1,Math.abs(ht),Math.abs(O))&&Math.abs(Nt-L)<=r.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(L))&&Math.abs(Rt-$)<=r.EPSILON*Math.max(1,Math.abs(Rt),Math.abs($))&&Math.abs(X-V)<=r.EPSILON*Math.max(1,Math.abs(X),Math.abs(V))&&Math.abs(z-rt)<=r.EPSILON*Math.max(1,Math.abs(z),Math.abs(rt));}var at=C,ut=B;},/* 6 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"identity",function(){return h;}),t.d(e,"transpose",function(){return m;}),t.d(e,"invert",function(){return u;}),t.d(e,"adjoint",function(){return y;}),t.d(e,"determinant",function(){return T;}),t.d(e,"multiply",function(){return E;}),t.d(e,"translate",function(){return C;}),t.d(e,"scale",function(){return x;}),t.d(e,"rotate",function(){return I;}),t.d(e,"rotateX",function(){return d;}),t.d(e,"rotateY",function(){return v;}),t.d(e,"rotateZ",function(){return p;}),t.d(e,"fromTranslation",function(){return S;}),t.d(e,"fromScaling",function(){return A;}),t.d(e,"fromRotation",function(){return R;}),t.d(e,"fromXRotation",function(){return D;}),t.d(e,"fromYRotation",function(){return U;}),t.d(e,"fromZRotation",function(){return M;}),t.d(e,"fromRotationTranslation",function(){return W;}),t.d(e,"fromQuat2",function(){return Y;}),t.d(e,"getTranslation",function(){return B;}),t.d(e,"getScaling",function(){return N;}),t.d(e,"getRotation",function(){return G;}),t.d(e,"fromRotationTranslationScale",function(){return J;}),t.d(e,"fromRotationTranslationScaleOrigin",function(){return tt;}),t.d(e,"fromQuat",function(){return at;}),t.d(e,"frustum",function(){return ut;}),t.d(e,"perspective",function(){return K;}),t.d(e,"perspectiveFromFieldOfView",function(){return Q;}),t.d(e,"ortho",function(){return ft;}),t.d(e,"lookAt",function(){return gt;}),t.d(e,"targetTo",function(){return mt;}),t.d(e,"str",function(){return wt;}),t.d(e,"frob",function(){return ht;}),t.d(e,"add",function(){return Nt;}),t.d(e,"subtract",function(){return Rt;}),t.d(e,"multiplyScalar",function(){return X;}),t.d(e,"multiplyScalarAndAdd",function(){return z;}),t.d(e,"exactEquals",function(){return q;}),t.d(e,"equals",function(){return nt;}),t.d(e,"mul",function(){return j;}),t.d(e,"sub",function(){return Z;});var r=t(2);function n(){var O=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[11]=0,O[12]=0,O[13]=0,O[14]=0),O[0]=1,O[5]=1,O[10]=1,O[15]=1,O;}function s(O){var L=new r.ARRAY_TYPE(16);return L[0]=O[0],L[1]=O[1],L[2]=O[2],L[3]=O[3],L[4]=O[4],L[5]=O[5],L[6]=O[6],L[7]=O[7],L[8]=O[8],L[9]=O[9],L[10]=O[10],L[11]=O[11],L[12]=O[12],L[13]=O[13],L[14]=O[14],L[15]=O[15],L;}function c(O,L){return O[0]=L[0],O[1]=L[1],O[2]=L[2],O[3]=L[3],O[4]=L[4],O[5]=L[5],O[6]=L[6],O[7]=L[7],O[8]=L[8],O[9]=L[9],O[10]=L[10],O[11]=L[11],O[12]=L[12],O[13]=L[13],O[14]=L[14],O[15]=L[15],O;}function l(O,L,$,V,rt,it,ct,St,Ct,Mt,Dt,At,Ot,Lt,Yt,zt){var Wt=new r.ARRAY_TYPE(16);return Wt[0]=O,Wt[1]=L,Wt[2]=$,Wt[3]=V,Wt[4]=rt,Wt[5]=it,Wt[6]=ct,Wt[7]=St,Wt[8]=Ct,Wt[9]=Mt,Wt[10]=Dt,Wt[11]=At,Wt[12]=Ot,Wt[13]=Lt,Wt[14]=Yt,Wt[15]=zt,Wt;}function f(O,L,$,V,rt,it,ct,St,Ct,Mt,Dt,At,Ot,Lt,Yt,zt,Wt){return O[0]=L,O[1]=$,O[2]=V,O[3]=rt,O[4]=it,O[5]=ct,O[6]=St,O[7]=Ct,O[8]=Mt,O[9]=Dt,O[10]=At,O[11]=Ot,O[12]=Lt,O[13]=Yt,O[14]=zt,O[15]=Wt,O;}function h(O){return O[0]=1,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=1,O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[10]=1,O[11]=0,O[12]=0,O[13]=0,O[14]=0,O[15]=1,O;}function m(O,L){if(O===L){var $=L[1],V=L[2],rt=L[3],it=L[6],ct=L[7],St=L[11];O[1]=L[4],O[2]=L[8],O[3]=L[12],O[4]=$,O[6]=L[9],O[7]=L[13],O[8]=V,O[9]=it,O[11]=L[14],O[12]=rt,O[13]=ct,O[14]=St;}else O[0]=L[0],O[1]=L[4],O[2]=L[8],O[3]=L[12],O[4]=L[1],O[5]=L[5],O[6]=L[9],O[7]=L[13],O[8]=L[2],O[9]=L[6],O[10]=L[10],O[11]=L[14],O[12]=L[3],O[13]=L[7],O[14]=L[11],O[15]=L[15];return O;}function u(O,L){var $=L[0],V=L[1],rt=L[2],it=L[3],ct=L[4],St=L[5],Ct=L[6],Mt=L[7],Dt=L[8],At=L[9],Ot=L[10],Lt=L[11],Yt=L[12],zt=L[13],Wt=L[14],Qt=L[15],ue=$*St-V*ct,ie=$*Ct-rt*ct,ne=$*Mt-it*ct,ae=V*Ct-rt*St,se=V*Mt-it*St,je=rt*Mt-it*Ct,We=Dt*zt-At*Yt,Xe=Dt*Wt-Ot*Yt,Fe=Dt*Qt-Lt*Yt,Ge=At*Wt-Ot*zt,Ke=At*Qt-Lt*zt,Je=Ot*Qt-Lt*Wt,Ie=ue*Je-ie*Ke+ne*Ge+ae*Fe-se*Xe+je*We;return Ie?(Ie=1/Ie,O[0]=(St*Je-Ct*Ke+Mt*Ge)*Ie,O[1]=(rt*Ke-V*Je-it*Ge)*Ie,O[2]=(zt*je-Wt*se+Qt*ae)*Ie,O[3]=(Ot*se-At*je-Lt*ae)*Ie,O[4]=(Ct*Fe-ct*Je-Mt*Xe)*Ie,O[5]=($*Je-rt*Fe+it*Xe)*Ie,O[6]=(Wt*ne-Yt*je-Qt*ie)*Ie,O[7]=(Dt*je-Ot*ne+Lt*ie)*Ie,O[8]=(ct*Ke-St*Fe+Mt*We)*Ie,O[9]=(V*Fe-$*Ke-it*We)*Ie,O[10]=(Yt*se-zt*ne+Qt*ue)*Ie,O[11]=(At*ne-Dt*se-Lt*ue)*Ie,O[12]=(St*Xe-ct*Ge-Ct*We)*Ie,O[13]=($*Ge-V*Xe+rt*We)*Ie,O[14]=(zt*ie-Yt*ae-Wt*ue)*Ie,O[15]=(Dt*ae-At*ie+Ot*ue)*Ie,O):null;}function y(O,L){var $=L[0],V=L[1],rt=L[2],it=L[3],ct=L[4],St=L[5],Ct=L[6],Mt=L[7],Dt=L[8],At=L[9],Ot=L[10],Lt=L[11],Yt=L[12],zt=L[13],Wt=L[14],Qt=L[15];return O[0]=St*(Ot*Qt-Lt*Wt)-At*(Ct*Qt-Mt*Wt)+zt*(Ct*Lt-Mt*Ot),O[1]=-(V*(Ot*Qt-Lt*Wt)-At*(rt*Qt-it*Wt)+zt*(rt*Lt-it*Ot)),O[2]=V*(Ct*Qt-Mt*Wt)-St*(rt*Qt-it*Wt)+zt*(rt*Mt-it*Ct),O[3]=-(V*(Ct*Lt-Mt*Ot)-St*(rt*Lt-it*Ot)+At*(rt*Mt-it*Ct)),O[4]=-(ct*(Ot*Qt-Lt*Wt)-Dt*(Ct*Qt-Mt*Wt)+Yt*(Ct*Lt-Mt*Ot)),O[5]=$*(Ot*Qt-Lt*Wt)-Dt*(rt*Qt-it*Wt)+Yt*(rt*Lt-it*Ot),O[6]=-($*(Ct*Qt-Mt*Wt)-ct*(rt*Qt-it*Wt)+Yt*(rt*Mt-it*Ct)),O[7]=$*(Ct*Lt-Mt*Ot)-ct*(rt*Lt-it*Ot)+Dt*(rt*Mt-it*Ct),O[8]=ct*(At*Qt-Lt*zt)-Dt*(St*Qt-Mt*zt)+Yt*(St*Lt-Mt*At),O[9]=-($*(At*Qt-Lt*zt)-Dt*(V*Qt-it*zt)+Yt*(V*Lt-it*At)),O[10]=$*(St*Qt-Mt*zt)-ct*(V*Qt-it*zt)+Yt*(V*Mt-it*St),O[11]=-($*(St*Lt-Mt*At)-ct*(V*Lt-it*At)+Dt*(V*Mt-it*St)),O[12]=-(ct*(At*Wt-Ot*zt)-Dt*(St*Wt-Ct*zt)+Yt*(St*Ot-Ct*At)),O[13]=$*(At*Wt-Ot*zt)-Dt*(V*Wt-rt*zt)+Yt*(V*Ot-rt*At),O[14]=-($*(St*Wt-Ct*zt)-ct*(V*Wt-rt*zt)+Yt*(V*Ct-rt*St)),O[15]=$*(St*Ot-Ct*At)-ct*(V*Ot-rt*At)+Dt*(V*Ct-rt*St),O;}function T(O){var L=O[0],$=O[1],V=O[2],rt=O[3],it=O[4],ct=O[5],St=O[6],Ct=O[7],Mt=O[8],Dt=O[9],At=O[10],Ot=O[11],Lt=O[12],Yt=O[13],zt=O[14],Wt=O[15],Qt=L*ct-$*it,ue=L*St-V*it,ie=L*Ct-rt*it,ne=$*St-V*ct,ae=$*Ct-rt*ct,se=V*Ct-rt*St,je=Mt*Yt-Dt*Lt,We=Mt*zt-At*Lt,Xe=Mt*Wt-Ot*Lt,Fe=Dt*zt-At*Yt,Ge=Dt*Wt-Ot*Yt,Ke=At*Wt-Ot*zt;return Qt*Ke-ue*Ge+ie*Fe+ne*Xe-ae*We+se*je;}function E(O,L,$){var V=L[0],rt=L[1],it=L[2],ct=L[3],St=L[4],Ct=L[5],Mt=L[6],Dt=L[7],At=L[8],Ot=L[9],Lt=L[10],Yt=L[11],zt=L[12],Wt=L[13],Qt=L[14],ue=L[15],ie=$[0],ne=$[1],ae=$[2],se=$[3];return O[0]=ie*V+ne*St+ae*At+se*zt,O[1]=ie*rt+ne*Ct+ae*Ot+se*Wt,O[2]=ie*it+ne*Mt+ae*Lt+se*Qt,O[3]=ie*ct+ne*Dt+ae*Yt+se*ue,ie=$[4],ne=$[5],ae=$[6],se=$[7],O[4]=ie*V+ne*St+ae*At+se*zt,O[5]=ie*rt+ne*Ct+ae*Ot+se*Wt,O[6]=ie*it+ne*Mt+ae*Lt+se*Qt,O[7]=ie*ct+ne*Dt+ae*Yt+se*ue,ie=$[8],ne=$[9],ae=$[10],se=$[11],O[8]=ie*V+ne*St+ae*At+se*zt,O[9]=ie*rt+ne*Ct+ae*Ot+se*Wt,O[10]=ie*it+ne*Mt+ae*Lt+se*Qt,O[11]=ie*ct+ne*Dt+ae*Yt+se*ue,ie=$[12],ne=$[13],ae=$[14],se=$[15],O[12]=ie*V+ne*St+ae*At+se*zt,O[13]=ie*rt+ne*Ct+ae*Ot+se*Wt,O[14]=ie*it+ne*Mt+ae*Lt+se*Qt,O[15]=ie*ct+ne*Dt+ae*Yt+se*ue,O;}function C(O,L,$){var V=$[0],rt=$[1],it=$[2],ct,St,Ct,Mt,Dt,At,Ot,Lt,Yt,zt,Wt,Qt;return L===O?(O[12]=L[0]*V+L[4]*rt+L[8]*it+L[12],O[13]=L[1]*V+L[5]*rt+L[9]*it+L[13],O[14]=L[2]*V+L[6]*rt+L[10]*it+L[14],O[15]=L[3]*V+L[7]*rt+L[11]*it+L[15]):(ct=L[0],St=L[1],Ct=L[2],Mt=L[3],Dt=L[4],At=L[5],Ot=L[6],Lt=L[7],Yt=L[8],zt=L[9],Wt=L[10],Qt=L[11],O[0]=ct,O[1]=St,O[2]=Ct,O[3]=Mt,O[4]=Dt,O[5]=At,O[6]=Ot,O[7]=Lt,O[8]=Yt,O[9]=zt,O[10]=Wt,O[11]=Qt,O[12]=ct*V+Dt*rt+Yt*it+L[12],O[13]=St*V+At*rt+zt*it+L[13],O[14]=Ct*V+Ot*rt+Wt*it+L[14],O[15]=Mt*V+Lt*rt+Qt*it+L[15]),O;}function x(O,L,$){var V=$[0],rt=$[1],it=$[2];return O[0]=L[0]*V,O[1]=L[1]*V,O[2]=L[2]*V,O[3]=L[3]*V,O[4]=L[4]*rt,O[5]=L[5]*rt,O[6]=L[6]*rt,O[7]=L[7]*rt,O[8]=L[8]*it,O[9]=L[9]*it,O[10]=L[10]*it,O[11]=L[11]*it,O[12]=L[12],O[13]=L[13],O[14]=L[14],O[15]=L[15],O;}function I(O,L,$,V){var rt=V[0],it=V[1],ct=V[2],St=Math.hypot(rt,it,ct),Ct,Mt,Dt,At,Ot,Lt,Yt,zt,Wt,Qt,ue,ie,ne,ae,se,je,We,Xe,Fe,Ge,Ke,Je,Ie,cr;return St<r.EPSILON?null:(St=1/St,rt*=St,it*=St,ct*=St,Ct=Math.sin($),Mt=Math.cos($),Dt=1-Mt,At=L[0],Ot=L[1],Lt=L[2],Yt=L[3],zt=L[4],Wt=L[5],Qt=L[6],ue=L[7],ie=L[8],ne=L[9],ae=L[10],se=L[11],je=rt*rt*Dt+Mt,We=it*rt*Dt+ct*Ct,Xe=ct*rt*Dt-it*Ct,Fe=rt*it*Dt-ct*Ct,Ge=it*it*Dt+Mt,Ke=ct*it*Dt+rt*Ct,Je=rt*ct*Dt+it*Ct,Ie=it*ct*Dt-rt*Ct,cr=ct*ct*Dt+Mt,O[0]=At*je+zt*We+ie*Xe,O[1]=Ot*je+Wt*We+ne*Xe,O[2]=Lt*je+Qt*We+ae*Xe,O[3]=Yt*je+ue*We+se*Xe,O[4]=At*Fe+zt*Ge+ie*Ke,O[5]=Ot*Fe+Wt*Ge+ne*Ke,O[6]=Lt*Fe+Qt*Ge+ae*Ke,O[7]=Yt*Fe+ue*Ge+se*Ke,O[8]=At*Je+zt*Ie+ie*cr,O[9]=Ot*Je+Wt*Ie+ne*cr,O[10]=Lt*Je+Qt*Ie+ae*cr,O[11]=Yt*Je+ue*Ie+se*cr,L!==O&&(O[12]=L[12],O[13]=L[13],O[14]=L[14],O[15]=L[15]),O);}function d(O,L,$){var V=Math.sin($),rt=Math.cos($),it=L[4],ct=L[5],St=L[6],Ct=L[7],Mt=L[8],Dt=L[9],At=L[10],Ot=L[11];return L!==O&&(O[0]=L[0],O[1]=L[1],O[2]=L[2],O[3]=L[3],O[12]=L[12],O[13]=L[13],O[14]=L[14],O[15]=L[15]),O[4]=it*rt+Mt*V,O[5]=ct*rt+Dt*V,O[6]=St*rt+At*V,O[7]=Ct*rt+Ot*V,O[8]=Mt*rt-it*V,O[9]=Dt*rt-ct*V,O[10]=At*rt-St*V,O[11]=Ot*rt-Ct*V,O;}function v(O,L,$){var V=Math.sin($),rt=Math.cos($),it=L[0],ct=L[1],St=L[2],Ct=L[3],Mt=L[8],Dt=L[9],At=L[10],Ot=L[11];return L!==O&&(O[4]=L[4],O[5]=L[5],O[6]=L[6],O[7]=L[7],O[12]=L[12],O[13]=L[13],O[14]=L[14],O[15]=L[15]),O[0]=it*rt-Mt*V,O[1]=ct*rt-Dt*V,O[2]=St*rt-At*V,O[3]=Ct*rt-Ot*V,O[8]=it*V+Mt*rt,O[9]=ct*V+Dt*rt,O[10]=St*V+At*rt,O[11]=Ct*V+Ot*rt,O;}function p(O,L,$){var V=Math.sin($),rt=Math.cos($),it=L[0],ct=L[1],St=L[2],Ct=L[3],Mt=L[4],Dt=L[5],At=L[6],Ot=L[7];return L!==O&&(O[8]=L[8],O[9]=L[9],O[10]=L[10],O[11]=L[11],O[12]=L[12],O[13]=L[13],O[14]=L[14],O[15]=L[15]),O[0]=it*rt+Mt*V,O[1]=ct*rt+Dt*V,O[2]=St*rt+At*V,O[3]=Ct*rt+Ot*V,O[4]=Mt*rt-it*V,O[5]=Dt*rt-ct*V,O[6]=At*rt-St*V,O[7]=Ot*rt-Ct*V,O;}function S(O,L){return O[0]=1,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=1,O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[10]=1,O[11]=0,O[12]=L[0],O[13]=L[1],O[14]=L[2],O[15]=1,O;}function A(O,L){return O[0]=L[0],O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=L[1],O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[10]=L[2],O[11]=0,O[12]=0,O[13]=0,O[14]=0,O[15]=1,O;}function R(O,L,$){var V=$[0],rt=$[1],it=$[2],ct=Math.hypot(V,rt,it),St,Ct,Mt;return ct<r.EPSILON?null:(ct=1/ct,V*=ct,rt*=ct,it*=ct,St=Math.sin(L),Ct=Math.cos(L),Mt=1-Ct,O[0]=V*V*Mt+Ct,O[1]=rt*V*Mt+it*St,O[2]=it*V*Mt-rt*St,O[3]=0,O[4]=V*rt*Mt-it*St,O[5]=rt*rt*Mt+Ct,O[6]=it*rt*Mt+V*St,O[7]=0,O[8]=V*it*Mt+rt*St,O[9]=rt*it*Mt-V*St,O[10]=it*it*Mt+Ct,O[11]=0,O[12]=0,O[13]=0,O[14]=0,O[15]=1,O);}function D(O,L){var $=Math.sin(L),V=Math.cos(L);return O[0]=1,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=V,O[6]=$,O[7]=0,O[8]=0,O[9]=-$,O[10]=V,O[11]=0,O[12]=0,O[13]=0,O[14]=0,O[15]=1,O;}function U(O,L){var $=Math.sin(L),V=Math.cos(L);return O[0]=V,O[1]=0,O[2]=-$,O[3]=0,O[4]=0,O[5]=1,O[6]=0,O[7]=0,O[8]=$,O[9]=0,O[10]=V,O[11]=0,O[12]=0,O[13]=0,O[14]=0,O[15]=1,O;}function M(O,L){var $=Math.sin(L),V=Math.cos(L);return O[0]=V,O[1]=$,O[2]=0,O[3]=0,O[4]=-$,O[5]=V,O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[10]=1,O[11]=0,O[12]=0,O[13]=0,O[14]=0,O[15]=1,O;}function W(O,L,$){var V=L[0],rt=L[1],it=L[2],ct=L[3],St=V+V,Ct=rt+rt,Mt=it+it,Dt=V*St,At=V*Ct,Ot=V*Mt,Lt=rt*Ct,Yt=rt*Mt,zt=it*Mt,Wt=ct*St,Qt=ct*Ct,ue=ct*Mt;return O[0]=1-(Lt+zt),O[1]=At+ue,O[2]=Ot-Qt,O[3]=0,O[4]=At-ue,O[5]=1-(Dt+zt),O[6]=Yt+Wt,O[7]=0,O[8]=Ot+Qt,O[9]=Yt-Wt,O[10]=1-(Dt+Lt),O[11]=0,O[12]=$[0],O[13]=$[1],O[14]=$[2],O[15]=1,O;}function Y(O,L){var $=new r.ARRAY_TYPE(3),V=-L[0],rt=-L[1],it=-L[2],ct=L[3],St=L[4],Ct=L[5],Mt=L[6],Dt=L[7],At=V*V+rt*rt+it*it+ct*ct;return At>0?($[0]=(St*ct+Dt*V+Ct*it-Mt*rt)*2/At,$[1]=(Ct*ct+Dt*rt+Mt*V-St*it)*2/At,$[2]=(Mt*ct+Dt*it+St*rt-Ct*V)*2/At):($[0]=(St*ct+Dt*V+Ct*it-Mt*rt)*2,$[1]=(Ct*ct+Dt*rt+Mt*V-St*it)*2,$[2]=(Mt*ct+Dt*it+St*rt-Ct*V)*2),W(O,L,$),O;}function B(O,L){return O[0]=L[12],O[1]=L[13],O[2]=L[14],O;}function N(O,L){var $=L[0],V=L[1],rt=L[2],it=L[4],ct=L[5],St=L[6],Ct=L[8],Mt=L[9],Dt=L[10];return O[0]=Math.hypot($,V,rt),O[1]=Math.hypot(it,ct,St),O[2]=Math.hypot(Ct,Mt,Dt),O;}function G(O,L){var $=new r.ARRAY_TYPE(3);N($,L);var V=1/$[0],rt=1/$[1],it=1/$[2],ct=L[0]*V,St=L[1]*rt,Ct=L[2]*it,Mt=L[4]*V,Dt=L[5]*rt,At=L[6]*it,Ot=L[8]*V,Lt=L[9]*rt,Yt=L[10]*it,zt=ct+Dt+Yt,Wt=0;return zt>0?(Wt=Math.sqrt(zt+1)*2,O[3]=0.25*Wt,O[0]=(At-Lt)/Wt,O[1]=(Ot-Ct)/Wt,O[2]=(St-Mt)/Wt):ct>Dt&&ct>Yt?(Wt=Math.sqrt(1+ct-Dt-Yt)*2,O[3]=(At-Lt)/Wt,O[0]=0.25*Wt,O[1]=(St+Mt)/Wt,O[2]=(Ot+Ct)/Wt):Dt>Yt?(Wt=Math.sqrt(1+Dt-ct-Yt)*2,O[3]=(Ot-Ct)/Wt,O[0]=(St+Mt)/Wt,O[1]=0.25*Wt,O[2]=(At+Lt)/Wt):(Wt=Math.sqrt(1+Yt-ct-Dt)*2,O[3]=(St-Mt)/Wt,O[0]=(Ot+Ct)/Wt,O[1]=(At+Lt)/Wt,O[2]=0.25*Wt),O;}function J(O,L,$,V){var rt=L[0],it=L[1],ct=L[2],St=L[3],Ct=rt+rt,Mt=it+it,Dt=ct+ct,At=rt*Ct,Ot=rt*Mt,Lt=rt*Dt,Yt=it*Mt,zt=it*Dt,Wt=ct*Dt,Qt=St*Ct,ue=St*Mt,ie=St*Dt,ne=V[0],ae=V[1],se=V[2];return O[0]=(1-(Yt+Wt))*ne,O[1]=(Ot+ie)*ne,O[2]=(Lt-ue)*ne,O[3]=0,O[4]=(Ot-ie)*ae,O[5]=(1-(At+Wt))*ae,O[6]=(zt+Qt)*ae,O[7]=0,O[8]=(Lt+ue)*se,O[9]=(zt-Qt)*se,O[10]=(1-(At+Yt))*se,O[11]=0,O[12]=$[0],O[13]=$[1],O[14]=$[2],O[15]=1,O;}function tt(O,L,$,V,rt){var it=L[0],ct=L[1],St=L[2],Ct=L[3],Mt=it+it,Dt=ct+ct,At=St+St,Ot=it*Mt,Lt=it*Dt,Yt=it*At,zt=ct*Dt,Wt=ct*At,Qt=St*At,ue=Ct*Mt,ie=Ct*Dt,ne=Ct*At,ae=V[0],se=V[1],je=V[2],We=rt[0],Xe=rt[1],Fe=rt[2],Ge=(1-(zt+Qt))*ae,Ke=(Lt+ne)*ae,Je=(Yt-ie)*ae,Ie=(Lt-ne)*se,cr=(1-(Ot+Qt))*se,Kr=(Wt+ue)*se,tn=(Yt+ie)*je,Gn=(Wt-ue)*je,Hn=(1-(Ot+zt))*je;return O[0]=Ge,O[1]=Ke,O[2]=Je,O[3]=0,O[4]=Ie,O[5]=cr,O[6]=Kr,O[7]=0,O[8]=tn,O[9]=Gn,O[10]=Hn,O[11]=0,O[12]=$[0]+We-(Ge*We+Ie*Xe+tn*Fe),O[13]=$[1]+Xe-(Ke*We+cr*Xe+Gn*Fe),O[14]=$[2]+Fe-(Je*We+Kr*Xe+Hn*Fe),O[15]=1,O;}function at(O,L){var $=L[0],V=L[1],rt=L[2],it=L[3],ct=$+$,St=V+V,Ct=rt+rt,Mt=$*ct,Dt=V*ct,At=V*St,Ot=rt*ct,Lt=rt*St,Yt=rt*Ct,zt=it*ct,Wt=it*St,Qt=it*Ct;return O[0]=1-At-Yt,O[1]=Dt+Qt,O[2]=Ot-Wt,O[3]=0,O[4]=Dt-Qt,O[5]=1-Mt-Yt,O[6]=Lt+zt,O[7]=0,O[8]=Ot+Wt,O[9]=Lt-zt,O[10]=1-Mt-At,O[11]=0,O[12]=0,O[13]=0,O[14]=0,O[15]=1,O;}function ut(O,L,$,V,rt,it,ct){var St=1/($-L),Ct=1/(rt-V),Mt=1/(it-ct);return O[0]=it*2*St,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=it*2*Ct,O[6]=0,O[7]=0,O[8]=($+L)*St,O[9]=(rt+V)*Ct,O[10]=(ct+it)*Mt,O[11]=-1,O[12]=0,O[13]=0,O[14]=ct*it*2*Mt,O[15]=0,O;}function K(O,L,$,V,rt){var it=1/Math.tan(L/2),ct;return O[0]=it/$,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=it,O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[11]=-1,O[12]=0,O[13]=0,O[15]=0,rt!=null&&rt!==1/0?(ct=1/(V-rt),O[10]=(rt+V)*ct,O[14]=2*rt*V*ct):(O[10]=-1,O[14]=-2*V),O;}function Q(O,L,$,V){var rt=Math.tan(L.upDegrees*Math.PI/180),it=Math.tan(L.downDegrees*Math.PI/180),ct=Math.tan(L.leftDegrees*Math.PI/180),St=Math.tan(L.rightDegrees*Math.PI/180),Ct=2/(ct+St),Mt=2/(rt+it);return O[0]=Ct,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=Mt,O[6]=0,O[7]=0,O[8]=-((ct-St)*Ct*0.5),O[9]=(rt-it)*Mt*0.5,O[10]=V/($-V),O[11]=-1,O[12]=0,O[13]=0,O[14]=V*$/($-V),O[15]=0,O;}function ft(O,L,$,V,rt,it,ct){var St=1/(L-$),Ct=1/(V-rt),Mt=1/(it-ct);return O[0]=-2*St,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=-2*Ct,O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[10]=2*Mt,O[11]=0,O[12]=(L+$)*St,O[13]=(rt+V)*Ct,O[14]=(ct+it)*Mt,O[15]=1,O;}function gt(O,L,$,V){var rt,it,ct,St,Ct,Mt,Dt,At,Ot,Lt,Yt=L[0],zt=L[1],Wt=L[2],Qt=V[0],ue=V[1],ie=V[2],ne=$[0],ae=$[1],se=$[2];return Math.abs(Yt-ne)<r.EPSILON&&Math.abs(zt-ae)<r.EPSILON&&Math.abs(Wt-se)<r.EPSILON?h(O):(Dt=Yt-ne,At=zt-ae,Ot=Wt-se,Lt=1/Math.hypot(Dt,At,Ot),Dt*=Lt,At*=Lt,Ot*=Lt,rt=ue*Ot-ie*At,it=ie*Dt-Qt*Ot,ct=Qt*At-ue*Dt,Lt=Math.hypot(rt,it,ct),Lt?(Lt=1/Lt,rt*=Lt,it*=Lt,ct*=Lt):(rt=0,it=0,ct=0),St=At*ct-Ot*it,Ct=Ot*rt-Dt*ct,Mt=Dt*it-At*rt,Lt=Math.hypot(St,Ct,Mt),Lt?(Lt=1/Lt,St*=Lt,Ct*=Lt,Mt*=Lt):(St=0,Ct=0,Mt=0),O[0]=rt,O[1]=St,O[2]=Dt,O[3]=0,O[4]=it,O[5]=Ct,O[6]=At,O[7]=0,O[8]=ct,O[9]=Mt,O[10]=Ot,O[11]=0,O[12]=-(rt*Yt+it*zt+ct*Wt),O[13]=-(St*Yt+Ct*zt+Mt*Wt),O[14]=-(Dt*Yt+At*zt+Ot*Wt),O[15]=1,O);}function mt(O,L,$,V){var rt=L[0],it=L[1],ct=L[2],St=V[0],Ct=V[1],Mt=V[2],Dt=rt-$[0],At=it-$[1],Ot=ct-$[2],Lt=Dt*Dt+At*At+Ot*Ot;Lt>0&&(Lt=1/Math.sqrt(Lt),Dt*=Lt,At*=Lt,Ot*=Lt);var Yt=Ct*Ot-Mt*At,zt=Mt*Dt-St*Ot,Wt=St*At-Ct*Dt;return Lt=Yt*Yt+zt*zt+Wt*Wt,Lt>0&&(Lt=1/Math.sqrt(Lt),Yt*=Lt,zt*=Lt,Wt*=Lt),O[0]=Yt,O[1]=zt,O[2]=Wt,O[3]=0,O[4]=At*Wt-Ot*zt,O[5]=Ot*Yt-Dt*Wt,O[6]=Dt*zt-At*Yt,O[7]=0,O[8]=Dt,O[9]=At,O[10]=Ot,O[11]=0,O[12]=rt,O[13]=it,O[14]=ct,O[15]=1,O;}function wt(O){return"mat4("+O[0]+", "+O[1]+", "+O[2]+", "+O[3]+", "+O[4]+", "+O[5]+", "+O[6]+", "+O[7]+", "+O[8]+", "+O[9]+", "+O[10]+", "+O[11]+", "+O[12]+", "+O[13]+", "+O[14]+", "+O[15]+")";}function ht(O){return Math.hypot(O[0],O[1],O[2],O[3],O[4],O[5],O[6],O[7],O[8],O[9],O[10],O[11],O[12],O[13],O[14],O[15]);}function Nt(O,L,$){return O[0]=L[0]+$[0],O[1]=L[1]+$[1],O[2]=L[2]+$[2],O[3]=L[3]+$[3],O[4]=L[4]+$[4],O[5]=L[5]+$[5],O[6]=L[6]+$[6],O[7]=L[7]+$[7],O[8]=L[8]+$[8],O[9]=L[9]+$[9],O[10]=L[10]+$[10],O[11]=L[11]+$[11],O[12]=L[12]+$[12],O[13]=L[13]+$[13],O[14]=L[14]+$[14],O[15]=L[15]+$[15],O;}function Rt(O,L,$){return O[0]=L[0]-$[0],O[1]=L[1]-$[1],O[2]=L[2]-$[2],O[3]=L[3]-$[3],O[4]=L[4]-$[4],O[5]=L[5]-$[5],O[6]=L[6]-$[6],O[7]=L[7]-$[7],O[8]=L[8]-$[8],O[9]=L[9]-$[9],O[10]=L[10]-$[10],O[11]=L[11]-$[11],O[12]=L[12]-$[12],O[13]=L[13]-$[13],O[14]=L[14]-$[14],O[15]=L[15]-$[15],O;}function X(O,L,$){return O[0]=L[0]*$,O[1]=L[1]*$,O[2]=L[2]*$,O[3]=L[3]*$,O[4]=L[4]*$,O[5]=L[5]*$,O[6]=L[6]*$,O[7]=L[7]*$,O[8]=L[8]*$,O[9]=L[9]*$,O[10]=L[10]*$,O[11]=L[11]*$,O[12]=L[12]*$,O[13]=L[13]*$,O[14]=L[14]*$,O[15]=L[15]*$,O;}function z(O,L,$,V){return O[0]=L[0]+$[0]*V,O[1]=L[1]+$[1]*V,O[2]=L[2]+$[2]*V,O[3]=L[3]+$[3]*V,O[4]=L[4]+$[4]*V,O[5]=L[5]+$[5]*V,O[6]=L[6]+$[6]*V,O[7]=L[7]+$[7]*V,O[8]=L[8]+$[8]*V,O[9]=L[9]+$[9]*V,O[10]=L[10]+$[10]*V,O[11]=L[11]+$[11]*V,O[12]=L[12]+$[12]*V,O[13]=L[13]+$[13]*V,O[14]=L[14]+$[14]*V,O[15]=L[15]+$[15]*V,O;}function q(O,L){return O[0]===L[0]&&O[1]===L[1]&&O[2]===L[2]&&O[3]===L[3]&&O[4]===L[4]&&O[5]===L[5]&&O[6]===L[6]&&O[7]===L[7]&&O[8]===L[8]&&O[9]===L[9]&&O[10]===L[10]&&O[11]===L[11]&&O[12]===L[12]&&O[13]===L[13]&&O[14]===L[14]&&O[15]===L[15];}function nt(O,L){var $=O[0],V=O[1],rt=O[2],it=O[3],ct=O[4],St=O[5],Ct=O[6],Mt=O[7],Dt=O[8],At=O[9],Ot=O[10],Lt=O[11],Yt=O[12],zt=O[13],Wt=O[14],Qt=O[15],ue=L[0],ie=L[1],ne=L[2],ae=L[3],se=L[4],je=L[5],We=L[6],Xe=L[7],Fe=L[8],Ge=L[9],Ke=L[10],Je=L[11],Ie=L[12],cr=L[13],Kr=L[14],tn=L[15];return Math.abs($-ue)<=r.EPSILON*Math.max(1,Math.abs($),Math.abs(ue))&&Math.abs(V-ie)<=r.EPSILON*Math.max(1,Math.abs(V),Math.abs(ie))&&Math.abs(rt-ne)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(ne))&&Math.abs(it-ae)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(ae))&&Math.abs(ct-se)<=r.EPSILON*Math.max(1,Math.abs(ct),Math.abs(se))&&Math.abs(St-je)<=r.EPSILON*Math.max(1,Math.abs(St),Math.abs(je))&&Math.abs(Ct-We)<=r.EPSILON*Math.max(1,Math.abs(Ct),Math.abs(We))&&Math.abs(Mt-Xe)<=r.EPSILON*Math.max(1,Math.abs(Mt),Math.abs(Xe))&&Math.abs(Dt-Fe)<=r.EPSILON*Math.max(1,Math.abs(Dt),Math.abs(Fe))&&Math.abs(At-Ge)<=r.EPSILON*Math.max(1,Math.abs(At),Math.abs(Ge))&&Math.abs(Ot-Ke)<=r.EPSILON*Math.max(1,Math.abs(Ot),Math.abs(Ke))&&Math.abs(Lt-Je)<=r.EPSILON*Math.max(1,Math.abs(Lt),Math.abs(Je))&&Math.abs(Yt-Ie)<=r.EPSILON*Math.max(1,Math.abs(Yt),Math.abs(Ie))&&Math.abs(zt-cr)<=r.EPSILON*Math.max(1,Math.abs(zt),Math.abs(cr))&&Math.abs(Wt-Kr)<=r.EPSILON*Math.max(1,Math.abs(Wt),Math.abs(Kr))&&Math.abs(Qt-tn)<=r.EPSILON*Math.max(1,Math.abs(Qt),Math.abs(tn));}var j=E,Z=Rt;},/* 7 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return l;}),t.d(e,"identity",function(){return f;}),t.d(e,"setAxisAngle",function(){return h;}),t.d(e,"getAxisAngle",function(){return m;}),t.d(e,"getAngle",function(){return u;}),t.d(e,"multiply",function(){return y;}),t.d(e,"rotateX",function(){return T;}),t.d(e,"rotateY",function(){return E;}),t.d(e,"rotateZ",function(){return C;}),t.d(e,"calculateW",function(){return x;}),t.d(e,"exp",function(){return I;}),t.d(e,"ln",function(){return d;}),t.d(e,"pow",function(){return v;}),t.d(e,"slerp",function(){return p;}),t.d(e,"random",function(){return S;}),t.d(e,"invert",function(){return A;}),t.d(e,"conjugate",function(){return R;}),t.d(e,"fromMat3",function(){return D;}),t.d(e,"fromEuler",function(){return U;}),t.d(e,"str",function(){return M;}),t.d(e,"clone",function(){return W;}),t.d(e,"fromValues",function(){return Y;}),t.d(e,"copy",function(){return B;}),t.d(e,"set",function(){return N;}),t.d(e,"add",function(){return G;}),t.d(e,"mul",function(){return J;}),t.d(e,"scale",function(){return tt;}),t.d(e,"dot",function(){return at;}),t.d(e,"lerp",function(){return ut;}),t.d(e,"length",function(){return K;}),t.d(e,"len",function(){return Q;}),t.d(e,"squaredLength",function(){return ft;}),t.d(e,"sqrLen",function(){return gt;}),t.d(e,"normalize",function(){return mt;}),t.d(e,"exactEquals",function(){return wt;}),t.d(e,"equals",function(){return ht;}),t.d(e,"rotationTo",function(){return Nt;}),t.d(e,"sqlerp",function(){return Rt;}),t.d(e,"setAxes",function(){return X;});var r=t(2),n=t(5),s=t(8),c=t(9);function l(){var z=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(z[0]=0,z[1]=0,z[2]=0),z[3]=1,z;}function f(z){return z[0]=0,z[1]=0,z[2]=0,z[3]=1,z;}function h(z,q,nt){nt=nt*0.5;var j=Math.sin(nt);return z[0]=j*q[0],z[1]=j*q[1],z[2]=j*q[2],z[3]=Math.cos(nt),z;}function m(z,q){var nt=Math.acos(q[3])*2,j=Math.sin(nt/2);return j>r.EPSILON?(z[0]=q[0]/j,z[1]=q[1]/j,z[2]=q[2]/j):(z[0]=1,z[1]=0,z[2]=0),nt;}function u(z,q){var nt=at(z,q);return Math.acos(2*nt*nt-1);}function y(z,q,nt){var j=q[0],Z=q[1],O=q[2],L=q[3],$=nt[0],V=nt[1],rt=nt[2],it=nt[3];return z[0]=j*it+L*$+Z*rt-O*V,z[1]=Z*it+L*V+O*$-j*rt,z[2]=O*it+L*rt+j*V-Z*$,z[3]=L*it-j*$-Z*V-O*rt,z;}function T(z,q,nt){nt*=0.5;var j=q[0],Z=q[1],O=q[2],L=q[3],$=Math.sin(nt),V=Math.cos(nt);return z[0]=j*V+L*$,z[1]=Z*V+O*$,z[2]=O*V-Z*$,z[3]=L*V-j*$,z;}function E(z,q,nt){nt*=0.5;var j=q[0],Z=q[1],O=q[2],L=q[3],$=Math.sin(nt),V=Math.cos(nt);return z[0]=j*V-O*$,z[1]=Z*V+L*$,z[2]=O*V+j*$,z[3]=L*V-Z*$,z;}function C(z,q,nt){nt*=0.5;var j=q[0],Z=q[1],O=q[2],L=q[3],$=Math.sin(nt),V=Math.cos(nt);return z[0]=j*V+Z*$,z[1]=Z*V-j*$,z[2]=O*V+L*$,z[3]=L*V-O*$,z;}function x(z,q){var nt=q[0],j=q[1],Z=q[2];return z[0]=nt,z[1]=j,z[2]=Z,z[3]=Math.sqrt(Math.abs(1-nt*nt-j*j-Z*Z)),z;}function I(z,q){var nt=q[0],j=q[1],Z=q[2],O=q[3],L=Math.sqrt(nt*nt+j*j+Z*Z),$=Math.exp(O),V=L>0?$*Math.sin(L)/L:0;return z[0]=nt*V,z[1]=j*V,z[2]=Z*V,z[3]=$*Math.cos(L),z;}function d(z,q){var nt=q[0],j=q[1],Z=q[2],O=q[3],L=Math.sqrt(nt*nt+j*j+Z*Z),$=L>0?Math.atan2(L,O)/L:0;return z[0]=nt*$,z[1]=j*$,z[2]=Z*$,z[3]=0.5*Math.log(nt*nt+j*j+Z*Z+O*O),z;}function v(z,q,nt){return d(z,q),tt(z,z,nt),I(z,z),z;}function p(z,q,nt,j){var Z=q[0],O=q[1],L=q[2],$=q[3],V=nt[0],rt=nt[1],it=nt[2],ct=nt[3],St,Ct,Mt,Dt,At;return Ct=Z*V+O*rt+L*it+$*ct,Ct<0&&(Ct=-Ct,V=-V,rt=-rt,it=-it,ct=-ct),1-Ct>r.EPSILON?(St=Math.acos(Ct),Mt=Math.sin(St),Dt=Math.sin((1-j)*St)/Mt,At=Math.sin(j*St)/Mt):(Dt=1-j,At=j),z[0]=Dt*Z+At*V,z[1]=Dt*O+At*rt,z[2]=Dt*L+At*it,z[3]=Dt*$+At*ct,z;}function S(z){var q=r.RANDOM(),nt=r.RANDOM(),j=r.RANDOM(),Z=Math.sqrt(1-q),O=Math.sqrt(q);return z[0]=Z*Math.sin(2*Math.PI*nt),z[1]=Z*Math.cos(2*Math.PI*nt),z[2]=O*Math.sin(2*Math.PI*j),z[3]=O*Math.cos(2*Math.PI*j),z;}function A(z,q){var nt=q[0],j=q[1],Z=q[2],O=q[3],L=nt*nt+j*j+Z*Z+O*O,$=L?1/L:0;return z[0]=-nt*$,z[1]=-j*$,z[2]=-Z*$,z[3]=O*$,z;}function R(z,q){return z[0]=-q[0],z[1]=-q[1],z[2]=-q[2],z[3]=q[3],z;}function D(z,q){var nt=q[0]+q[4]+q[8],j;if(nt>0)j=Math.sqrt(nt+1),z[3]=0.5*j,j=0.5/j,z[0]=(q[5]-q[7])*j,z[1]=(q[6]-q[2])*j,z[2]=(q[1]-q[3])*j;else{var Z=0;q[4]>q[0]&&(Z=1),q[8]>q[Z*3+Z]&&(Z=2);var O=(Z+1)%3,L=(Z+2)%3;j=Math.sqrt(q[Z*3+Z]-q[O*3+O]-q[L*3+L]+1),z[Z]=0.5*j,j=0.5/j,z[3]=(q[O*3+L]-q[L*3+O])*j,z[O]=(q[O*3+Z]+q[Z*3+O])*j,z[L]=(q[L*3+Z]+q[Z*3+L])*j;}return z;}function U(z,q,nt,j){var Z=0.5*Math.PI/180;q*=Z,nt*=Z,j*=Z;var O=Math.sin(q),L=Math.cos(q),$=Math.sin(nt),V=Math.cos(nt),rt=Math.sin(j),it=Math.cos(j);return z[0]=O*V*it-L*$*rt,z[1]=L*$*it+O*V*rt,z[2]=L*V*rt-O*$*it,z[3]=L*V*it+O*$*rt,z;}function M(z){return"quat("+z[0]+", "+z[1]+", "+z[2]+", "+z[3]+")";}var W=c.clone,Y=c.fromValues,B=c.copy,N=c.set,G=c.add,J=y,tt=c.scale,at=c.dot,ut=c.lerp,K=c.length,Q=K,ft=c.squaredLength,gt=ft,mt=c.normalize,wt=c.exactEquals,ht=c.equals,Nt=function(){var z=s.create(),q=s.fromValues(1,0,0),nt=s.fromValues(0,1,0);return function(j,Z,O){var L=s.dot(Z,O);return L<-0.999999?(s.cross(z,q,Z),s.len(z)<1e-6&&s.cross(z,nt,Z),s.normalize(z,z),h(j,z,Math.PI),j):L>0.999999?(j[0]=0,j[1]=0,j[2]=0,j[3]=1,j):(s.cross(z,Z,O),j[0]=z[0],j[1]=z[1],j[2]=z[2],j[3]=1+L,mt(j,j));};}(),Rt=function(){var z=l(),q=l();return function(nt,j,Z,O,L,$){return p(z,j,L,$),p(q,Z,O,$),p(nt,z,q,2*$*(1-$)),nt;};}(),X=function(){var z=n.create();return function(q,nt,j,Z){return z[0]=j[0],z[3]=j[1],z[6]=j[2],z[1]=Z[0],z[4]=Z[1],z[7]=Z[2],z[2]=-nt[0],z[5]=-nt[1],z[8]=-nt[2],mt(q,D(q,z));};}();},/* 8 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"length",function(){return c;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"copy",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"add",function(){return m;}),t.d(e,"subtract",function(){return u;}),t.d(e,"multiply",function(){return y;}),t.d(e,"divide",function(){return T;}),t.d(e,"ceil",function(){return E;}),t.d(e,"floor",function(){return C;}),t.d(e,"min",function(){return x;}),t.d(e,"max",function(){return I;}),t.d(e,"round",function(){return d;}),t.d(e,"scale",function(){return v;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return S;}),t.d(e,"squaredDistance",function(){return A;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return Y;}),t.d(e,"lerp",function(){return B;}),t.d(e,"hermite",function(){return N;}),t.d(e,"bezier",function(){return G;}),t.d(e,"random",function(){return J;}),t.d(e,"transformMat4",function(){return tt;}),t.d(e,"transformMat3",function(){return at;}),t.d(e,"transformQuat",function(){return ut;}),t.d(e,"rotateX",function(){return K;}),t.d(e,"rotateY",function(){return Q;}),t.d(e,"rotateZ",function(){return ft;}),t.d(e,"angle",function(){return gt;}),t.d(e,"zero",function(){return mt;}),t.d(e,"str",function(){return wt;}),t.d(e,"exactEquals",function(){return ht;}),t.d(e,"equals",function(){return Nt;}),t.d(e,"sub",function(){return Rt;}),t.d(e,"mul",function(){return X;}),t.d(e,"div",function(){return z;}),t.d(e,"dist",function(){return q;}),t.d(e,"sqrDist",function(){return nt;}),t.d(e,"len",function(){return j;}),t.d(e,"sqrLen",function(){return Z;}),t.d(e,"forEach",function(){return O;});var r=t(2);function n(){var L=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(L[0]=0,L[1]=0,L[2]=0),L;}function s(L){var $=new r.ARRAY_TYPE(3);return $[0]=L[0],$[1]=L[1],$[2]=L[2],$;}function c(L){var $=L[0],V=L[1],rt=L[2];return Math.hypot($,V,rt);}function l(L,$,V){var rt=new r.ARRAY_TYPE(3);return rt[0]=L,rt[1]=$,rt[2]=V,rt;}function f(L,$){return L[0]=$[0],L[1]=$[1],L[2]=$[2],L;}function h(L,$,V,rt){return L[0]=$,L[1]=V,L[2]=rt,L;}function m(L,$,V){return L[0]=$[0]+V[0],L[1]=$[1]+V[1],L[2]=$[2]+V[2],L;}function u(L,$,V){return L[0]=$[0]-V[0],L[1]=$[1]-V[1],L[2]=$[2]-V[2],L;}function y(L,$,V){return L[0]=$[0]*V[0],L[1]=$[1]*V[1],L[2]=$[2]*V[2],L;}function T(L,$,V){return L[0]=$[0]/V[0],L[1]=$[1]/V[1],L[2]=$[2]/V[2],L;}function E(L,$){return L[0]=Math.ceil($[0]),L[1]=Math.ceil($[1]),L[2]=Math.ceil($[2]),L;}function C(L,$){return L[0]=Math.floor($[0]),L[1]=Math.floor($[1]),L[2]=Math.floor($[2]),L;}function x(L,$,V){return L[0]=Math.min($[0],V[0]),L[1]=Math.min($[1],V[1]),L[2]=Math.min($[2],V[2]),L;}function I(L,$,V){return L[0]=Math.max($[0],V[0]),L[1]=Math.max($[1],V[1]),L[2]=Math.max($[2],V[2]),L;}function d(L,$){return L[0]=Math.round($[0]),L[1]=Math.round($[1]),L[2]=Math.round($[2]),L;}function v(L,$,V){return L[0]=$[0]*V,L[1]=$[1]*V,L[2]=$[2]*V,L;}function p(L,$,V,rt){return L[0]=$[0]+V[0]*rt,L[1]=$[1]+V[1]*rt,L[2]=$[2]+V[2]*rt,L;}function S(L,$){var V=$[0]-L[0],rt=$[1]-L[1],it=$[2]-L[2];return Math.hypot(V,rt,it);}function A(L,$){var V=$[0]-L[0],rt=$[1]-L[1],it=$[2]-L[2];return V*V+rt*rt+it*it;}function R(L){var $=L[0],V=L[1],rt=L[2];return $*$+V*V+rt*rt;}function D(L,$){return L[0]=-$[0],L[1]=-$[1],L[2]=-$[2],L;}function U(L,$){return L[0]=1/$[0],L[1]=1/$[1],L[2]=1/$[2],L;}function M(L,$){var V=$[0],rt=$[1],it=$[2],ct=V*V+rt*rt+it*it;return ct>0&&(ct=1/Math.sqrt(ct)),L[0]=$[0]*ct,L[1]=$[1]*ct,L[2]=$[2]*ct,L;}function W(L,$){return L[0]*$[0]+L[1]*$[1]+L[2]*$[2];}function Y(L,$,V){var rt=$[0],it=$[1],ct=$[2],St=V[0],Ct=V[1],Mt=V[2];return L[0]=it*Mt-ct*Ct,L[1]=ct*St-rt*Mt,L[2]=rt*Ct-it*St,L;}function B(L,$,V,rt){var it=$[0],ct=$[1],St=$[2];return L[0]=it+rt*(V[0]-it),L[1]=ct+rt*(V[1]-ct),L[2]=St+rt*(V[2]-St),L;}function N(L,$,V,rt,it,ct){var St=ct*ct,Ct=St*(2*ct-3)+1,Mt=St*(ct-2)+ct,Dt=St*(ct-1),At=St*(3-2*ct);return L[0]=$[0]*Ct+V[0]*Mt+rt[0]*Dt+it[0]*At,L[1]=$[1]*Ct+V[1]*Mt+rt[1]*Dt+it[1]*At,L[2]=$[2]*Ct+V[2]*Mt+rt[2]*Dt+it[2]*At,L;}function G(L,$,V,rt,it,ct){var St=1-ct,Ct=St*St,Mt=ct*ct,Dt=Ct*St,At=3*ct*Ct,Ot=3*Mt*St,Lt=Mt*ct;return L[0]=$[0]*Dt+V[0]*At+rt[0]*Ot+it[0]*Lt,L[1]=$[1]*Dt+V[1]*At+rt[1]*Ot+it[1]*Lt,L[2]=$[2]*Dt+V[2]*At+rt[2]*Ot+it[2]*Lt,L;}function J(L,$){$=$||1;var V=r.RANDOM()*2*Math.PI,rt=r.RANDOM()*2-1,it=Math.sqrt(1-rt*rt)*$;return L[0]=Math.cos(V)*it,L[1]=Math.sin(V)*it,L[2]=rt*$,L;}function tt(L,$,V){var rt=$[0],it=$[1],ct=$[2],St=V[3]*rt+V[7]*it+V[11]*ct+V[15];return St=St||1,L[0]=(V[0]*rt+V[4]*it+V[8]*ct+V[12])/St,L[1]=(V[1]*rt+V[5]*it+V[9]*ct+V[13])/St,L[2]=(V[2]*rt+V[6]*it+V[10]*ct+V[14])/St,L;}function at(L,$,V){var rt=$[0],it=$[1],ct=$[2];return L[0]=rt*V[0]+it*V[3]+ct*V[6],L[1]=rt*V[1]+it*V[4]+ct*V[7],L[2]=rt*V[2]+it*V[5]+ct*V[8],L;}function ut(L,$,V){var rt=V[0],it=V[1],ct=V[2],St=V[3],Ct=$[0],Mt=$[1],Dt=$[2],At=it*Dt-ct*Mt,Ot=ct*Ct-rt*Dt,Lt=rt*Mt-it*Ct,Yt=it*Lt-ct*Ot,zt=ct*At-rt*Lt,Wt=rt*Ot-it*At,Qt=St*2;return At*=Qt,Ot*=Qt,Lt*=Qt,Yt*=2,zt*=2,Wt*=2,L[0]=Ct+At+Yt,L[1]=Mt+Ot+zt,L[2]=Dt+Lt+Wt,L;}function K(L,$,V,rt){var it=[],ct=[];return it[0]=$[0]-V[0],it[1]=$[1]-V[1],it[2]=$[2]-V[2],ct[0]=it[0],ct[1]=it[1]*Math.cos(rt)-it[2]*Math.sin(rt),ct[2]=it[1]*Math.sin(rt)+it[2]*Math.cos(rt),L[0]=ct[0]+V[0],L[1]=ct[1]+V[1],L[2]=ct[2]+V[2],L;}function Q(L,$,V,rt){var it=[],ct=[];return it[0]=$[0]-V[0],it[1]=$[1]-V[1],it[2]=$[2]-V[2],ct[0]=it[2]*Math.sin(rt)+it[0]*Math.cos(rt),ct[1]=it[1],ct[2]=it[2]*Math.cos(rt)-it[0]*Math.sin(rt),L[0]=ct[0]+V[0],L[1]=ct[1]+V[1],L[2]=ct[2]+V[2],L;}function ft(L,$,V,rt){var it=[],ct=[];return it[0]=$[0]-V[0],it[1]=$[1]-V[1],it[2]=$[2]-V[2],ct[0]=it[0]*Math.cos(rt)-it[1]*Math.sin(rt),ct[1]=it[0]*Math.sin(rt)+it[1]*Math.cos(rt),ct[2]=it[2],L[0]=ct[0]+V[0],L[1]=ct[1]+V[1],L[2]=ct[2]+V[2],L;}function gt(L,$){var V=L[0],rt=L[1],it=L[2],ct=$[0],St=$[1],Ct=$[2],Mt=Math.sqrt(V*V+rt*rt+it*it),Dt=Math.sqrt(ct*ct+St*St+Ct*Ct),At=Mt*Dt,Ot=At&&W(L,$)/At;return Math.acos(Math.min(Math.max(Ot,-1),1));}function mt(L){return L[0]=0,L[1]=0,L[2]=0,L;}function wt(L){return"vec3("+L[0]+", "+L[1]+", "+L[2]+")";}function ht(L,$){return L[0]===$[0]&&L[1]===$[1]&&L[2]===$[2];}function Nt(L,$){var V=L[0],rt=L[1],it=L[2],ct=$[0],St=$[1],Ct=$[2];return Math.abs(V-ct)<=r.EPSILON*Math.max(1,Math.abs(V),Math.abs(ct))&&Math.abs(rt-St)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(St))&&Math.abs(it-Ct)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(Ct));}var Rt=u,X=y,z=T,q=S,nt=A,j=c,Z=R,O=function(){var L=n();return function($,V,rt,it,ct,St){var Ct,Mt;for(V||(V=3),rt||(rt=0),it?Mt=Math.min(it*V+rt,$.length):Mt=$.length,Ct=rt;Ct<Mt;Ct+=V)L[0]=$[Ct],L[1]=$[Ct+1],L[2]=$[Ct+2],ct(L,L,St),$[Ct]=L[0],$[Ct+1]=L[1],$[Ct+2]=L[2];return $;};}();},/* 9 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"fromValues",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"add",function(){return h;}),t.d(e,"subtract",function(){return m;}),t.d(e,"multiply",function(){return u;}),t.d(e,"divide",function(){return y;}),t.d(e,"ceil",function(){return T;}),t.d(e,"floor",function(){return E;}),t.d(e,"min",function(){return C;}),t.d(e,"max",function(){return x;}),t.d(e,"round",function(){return I;}),t.d(e,"scale",function(){return d;}),t.d(e,"scaleAndAdd",function(){return v;}),t.d(e,"distance",function(){return p;}),t.d(e,"squaredDistance",function(){return S;}),t.d(e,"length",function(){return A;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return Y;}),t.d(e,"lerp",function(){return B;}),t.d(e,"random",function(){return N;}),t.d(e,"transformMat4",function(){return G;}),t.d(e,"transformQuat",function(){return J;}),t.d(e,"zero",function(){return tt;}),t.d(e,"str",function(){return at;}),t.d(e,"exactEquals",function(){return ut;}),t.d(e,"equals",function(){return K;}),t.d(e,"sub",function(){return Q;}),t.d(e,"mul",function(){return ft;}),t.d(e,"div",function(){return gt;}),t.d(e,"dist",function(){return mt;}),t.d(e,"sqrDist",function(){return wt;}),t.d(e,"len",function(){return ht;}),t.d(e,"sqrLen",function(){return Nt;}),t.d(e,"forEach",function(){return Rt;});var r=t(2);function n(){var X=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(X[0]=0,X[1]=0,X[2]=0,X[3]=0),X;}function s(X){var z=new r.ARRAY_TYPE(4);return z[0]=X[0],z[1]=X[1],z[2]=X[2],z[3]=X[3],z;}function c(X,z,q,nt){var j=new r.ARRAY_TYPE(4);return j[0]=X,j[1]=z,j[2]=q,j[3]=nt,j;}function l(X,z){return X[0]=z[0],X[1]=z[1],X[2]=z[2],X[3]=z[3],X;}function f(X,z,q,nt,j){return X[0]=z,X[1]=q,X[2]=nt,X[3]=j,X;}function h(X,z,q){return X[0]=z[0]+q[0],X[1]=z[1]+q[1],X[2]=z[2]+q[2],X[3]=z[3]+q[3],X;}function m(X,z,q){return X[0]=z[0]-q[0],X[1]=z[1]-q[1],X[2]=z[2]-q[2],X[3]=z[3]-q[3],X;}function u(X,z,q){return X[0]=z[0]*q[0],X[1]=z[1]*q[1],X[2]=z[2]*q[2],X[3]=z[3]*q[3],X;}function y(X,z,q){return X[0]=z[0]/q[0],X[1]=z[1]/q[1],X[2]=z[2]/q[2],X[3]=z[3]/q[3],X;}function T(X,z){return X[0]=Math.ceil(z[0]),X[1]=Math.ceil(z[1]),X[2]=Math.ceil(z[2]),X[3]=Math.ceil(z[3]),X;}function E(X,z){return X[0]=Math.floor(z[0]),X[1]=Math.floor(z[1]),X[2]=Math.floor(z[2]),X[3]=Math.floor(z[3]),X;}function C(X,z,q){return X[0]=Math.min(z[0],q[0]),X[1]=Math.min(z[1],q[1]),X[2]=Math.min(z[2],q[2]),X[3]=Math.min(z[3],q[3]),X;}function x(X,z,q){return X[0]=Math.max(z[0],q[0]),X[1]=Math.max(z[1],q[1]),X[2]=Math.max(z[2],q[2]),X[3]=Math.max(z[3],q[3]),X;}function I(X,z){return X[0]=Math.round(z[0]),X[1]=Math.round(z[1]),X[2]=Math.round(z[2]),X[3]=Math.round(z[3]),X;}function d(X,z,q){return X[0]=z[0]*q,X[1]=z[1]*q,X[2]=z[2]*q,X[3]=z[3]*q,X;}function v(X,z,q,nt){return X[0]=z[0]+q[0]*nt,X[1]=z[1]+q[1]*nt,X[2]=z[2]+q[2]*nt,X[3]=z[3]+q[3]*nt,X;}function p(X,z){var q=z[0]-X[0],nt=z[1]-X[1],j=z[2]-X[2],Z=z[3]-X[3];return Math.hypot(q,nt,j,Z);}function S(X,z){var q=z[0]-X[0],nt=z[1]-X[1],j=z[2]-X[2],Z=z[3]-X[3];return q*q+nt*nt+j*j+Z*Z;}function A(X){var z=X[0],q=X[1],nt=X[2],j=X[3];return Math.hypot(z,q,nt,j);}function R(X){var z=X[0],q=X[1],nt=X[2],j=X[3];return z*z+q*q+nt*nt+j*j;}function D(X,z){return X[0]=-z[0],X[1]=-z[1],X[2]=-z[2],X[3]=-z[3],X;}function U(X,z){return X[0]=1/z[0],X[1]=1/z[1],X[2]=1/z[2],X[3]=1/z[3],X;}function M(X,z){var q=z[0],nt=z[1],j=z[2],Z=z[3],O=q*q+nt*nt+j*j+Z*Z;return O>0&&(O=1/Math.sqrt(O)),X[0]=q*O,X[1]=nt*O,X[2]=j*O,X[3]=Z*O,X;}function W(X,z){return X[0]*z[0]+X[1]*z[1]+X[2]*z[2]+X[3]*z[3];}function Y(X,z,q,nt){var j=q[0]*nt[1]-q[1]*nt[0],Z=q[0]*nt[2]-q[2]*nt[0],O=q[0]*nt[3]-q[3]*nt[0],L=q[1]*nt[2]-q[2]*nt[1],$=q[1]*nt[3]-q[3]*nt[1],V=q[2]*nt[3]-q[3]*nt[2],rt=z[0],it=z[1],ct=z[2],St=z[3];return X[0]=it*V-ct*$+St*L,X[1]=-(rt*V)+ct*O-St*Z,X[2]=rt*$-it*O+St*j,X[3]=-(rt*L)+it*Z-ct*j,X;}function B(X,z,q,nt){var j=z[0],Z=z[1],O=z[2],L=z[3];return X[0]=j+nt*(q[0]-j),X[1]=Z+nt*(q[1]-Z),X[2]=O+nt*(q[2]-O),X[3]=L+nt*(q[3]-L),X;}function N(X,z){z=z||1;var q,nt,j,Z,O,L;do q=r.RANDOM()*2-1,nt=r.RANDOM()*2-1,O=q*q+nt*nt;while(O>=1);do j=r.RANDOM()*2-1,Z=r.RANDOM()*2-1,L=j*j+Z*Z;while(L>=1);var $=Math.sqrt((1-O)/L);return X[0]=z*q,X[1]=z*nt,X[2]=z*j*$,X[3]=z*Z*$,X;}function G(X,z,q){var nt=z[0],j=z[1],Z=z[2],O=z[3];return X[0]=q[0]*nt+q[4]*j+q[8]*Z+q[12]*O,X[1]=q[1]*nt+q[5]*j+q[9]*Z+q[13]*O,X[2]=q[2]*nt+q[6]*j+q[10]*Z+q[14]*O,X[3]=q[3]*nt+q[7]*j+q[11]*Z+q[15]*O,X;}function J(X,z,q){var nt=z[0],j=z[1],Z=z[2],O=q[0],L=q[1],$=q[2],V=q[3],rt=V*nt+L*Z-$*j,it=V*j+$*nt-O*Z,ct=V*Z+O*j-L*nt,St=-O*nt-L*j-$*Z;return X[0]=rt*V+St*-O+it*-$-ct*-L,X[1]=it*V+St*-L+ct*-O-rt*-$,X[2]=ct*V+St*-$+rt*-L-it*-O,X[3]=z[3],X;}function tt(X){return X[0]=0,X[1]=0,X[2]=0,X[3]=0,X;}function at(X){return"vec4("+X[0]+", "+X[1]+", "+X[2]+", "+X[3]+")";}function ut(X,z){return X[0]===z[0]&&X[1]===z[1]&&X[2]===z[2]&&X[3]===z[3];}function K(X,z){var q=X[0],nt=X[1],j=X[2],Z=X[3],O=z[0],L=z[1],$=z[2],V=z[3];return Math.abs(q-O)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(O))&&Math.abs(nt-L)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(L))&&Math.abs(j-$)<=r.EPSILON*Math.max(1,Math.abs(j),Math.abs($))&&Math.abs(Z-V)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(V));}var Q=m,ft=u,gt=y,mt=p,wt=S,ht=A,Nt=R,Rt=function(){var X=n();return function(z,q,nt,j,Z,O){var L,$;for(q||(q=4),nt||(nt=0),j?$=Math.min(j*q+nt,z.length):$=z.length,L=nt;L<$;L+=q)X[0]=z[L],X[1]=z[L+1],X[2]=z[L+2],X[3]=z[L+3],Z(X,X,O),z[L]=X[0],z[L+1]=X[1],z[L+2]=X[2],z[L+3]=X[3];return z;};}();},/* 10 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return c;}),t.d(e,"clone",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"fromRotationTranslationValues",function(){return h;}),t.d(e,"fromRotationTranslation",function(){return m;}),t.d(e,"fromTranslation",function(){return u;}),t.d(e,"fromRotation",function(){return y;}),t.d(e,"fromMat4",function(){return T;}),t.d(e,"copy",function(){return E;}),t.d(e,"identity",function(){return C;}),t.d(e,"set",function(){return x;}),t.d(e,"getReal",function(){return I;}),t.d(e,"getDual",function(){return d;}),t.d(e,"setReal",function(){return v;}),t.d(e,"setDual",function(){return p;}),t.d(e,"getTranslation",function(){return S;}),t.d(e,"translate",function(){return A;}),t.d(e,"rotateX",function(){return R;}),t.d(e,"rotateY",function(){return D;}),t.d(e,"rotateZ",function(){return U;}),t.d(e,"rotateByQuatAppend",function(){return M;}),t.d(e,"rotateByQuatPrepend",function(){return W;}),t.d(e,"rotateAroundAxis",function(){return Y;}),t.d(e,"add",function(){return B;}),t.d(e,"multiply",function(){return N;}),t.d(e,"mul",function(){return G;}),t.d(e,"scale",function(){return J;}),t.d(e,"dot",function(){return tt;}),t.d(e,"lerp",function(){return at;}),t.d(e,"invert",function(){return ut;}),t.d(e,"conjugate",function(){return K;}),t.d(e,"length",function(){return Q;}),t.d(e,"len",function(){return ft;}),t.d(e,"squaredLength",function(){return gt;}),t.d(e,"sqrLen",function(){return mt;}),t.d(e,"normalize",function(){return wt;}),t.d(e,"str",function(){return ht;}),t.d(e,"exactEquals",function(){return Nt;}),t.d(e,"equals",function(){return Rt;});var r=t(2),n=t(7),s=t(6);function c(){var X=new r.ARRAY_TYPE(8);return r.ARRAY_TYPE!=Float32Array&&(X[0]=0,X[1]=0,X[2]=0,X[4]=0,X[5]=0,X[6]=0,X[7]=0),X[3]=1,X;}function l(X){var z=new r.ARRAY_TYPE(8);return z[0]=X[0],z[1]=X[1],z[2]=X[2],z[3]=X[3],z[4]=X[4],z[5]=X[5],z[6]=X[6],z[7]=X[7],z;}function f(X,z,q,nt,j,Z,O,L){var $=new r.ARRAY_TYPE(8);return $[0]=X,$[1]=z,$[2]=q,$[3]=nt,$[4]=j,$[5]=Z,$[6]=O,$[7]=L,$;}function h(X,z,q,nt,j,Z,O){var L=new r.ARRAY_TYPE(8);L[0]=X,L[1]=z,L[2]=q,L[3]=nt;var $=j*0.5,V=Z*0.5,rt=O*0.5;return L[4]=$*nt+V*q-rt*z,L[5]=V*nt+rt*X-$*q,L[6]=rt*nt+$*z-V*X,L[7]=-$*X-V*z-rt*q,L;}function m(X,z,q){var nt=q[0]*0.5,j=q[1]*0.5,Z=q[2]*0.5,O=z[0],L=z[1],$=z[2],V=z[3];return X[0]=O,X[1]=L,X[2]=$,X[3]=V,X[4]=nt*V+j*$-Z*L,X[5]=j*V+Z*O-nt*$,X[6]=Z*V+nt*L-j*O,X[7]=-nt*O-j*L-Z*$,X;}function u(X,z){return X[0]=0,X[1]=0,X[2]=0,X[3]=1,X[4]=z[0]*0.5,X[5]=z[1]*0.5,X[6]=z[2]*0.5,X[7]=0,X;}function y(X,z){return X[0]=z[0],X[1]=z[1],X[2]=z[2],X[3]=z[3],X[4]=0,X[5]=0,X[6]=0,X[7]=0,X;}function T(X,z){var q=n.create();s.getRotation(q,z);var nt=new r.ARRAY_TYPE(3);return s.getTranslation(nt,z),m(X,q,nt),X;}function E(X,z){return X[0]=z[0],X[1]=z[1],X[2]=z[2],X[3]=z[3],X[4]=z[4],X[5]=z[5],X[6]=z[6],X[7]=z[7],X;}function C(X){return X[0]=0,X[1]=0,X[2]=0,X[3]=1,X[4]=0,X[5]=0,X[6]=0,X[7]=0,X;}function x(X,z,q,nt,j,Z,O,L,$){return X[0]=z,X[1]=q,X[2]=nt,X[3]=j,X[4]=Z,X[5]=O,X[6]=L,X[7]=$,X;}var I=n.copy;function d(X,z){return X[0]=z[4],X[1]=z[5],X[2]=z[6],X[3]=z[7],X;}var v=n.copy;function p(X,z){return X[4]=z[0],X[5]=z[1],X[6]=z[2],X[7]=z[3],X;}function S(X,z){var q=z[4],nt=z[5],j=z[6],Z=z[7],O=-z[0],L=-z[1],$=-z[2],V=z[3];return X[0]=(q*V+Z*O+nt*$-j*L)*2,X[1]=(nt*V+Z*L+j*O-q*$)*2,X[2]=(j*V+Z*$+q*L-nt*O)*2,X;}function A(X,z,q){var nt=z[0],j=z[1],Z=z[2],O=z[3],L=q[0]*0.5,$=q[1]*0.5,V=q[2]*0.5,rt=z[4],it=z[5],ct=z[6],St=z[7];return X[0]=nt,X[1]=j,X[2]=Z,X[3]=O,X[4]=O*L+j*V-Z*$+rt,X[5]=O*$+Z*L-nt*V+it,X[6]=O*V+nt*$-j*L+ct,X[7]=-nt*L-j*$-Z*V+St,X;}function R(X,z,q){var nt=-z[0],j=-z[1],Z=-z[2],O=z[3],L=z[4],$=z[5],V=z[6],rt=z[7],it=L*O+rt*nt+$*Z-V*j,ct=$*O+rt*j+V*nt-L*Z,St=V*O+rt*Z+L*j-$*nt,Ct=rt*O-L*nt-$*j-V*Z;return n.rotateX(X,z,q),nt=X[0],j=X[1],Z=X[2],O=X[3],X[4]=it*O+Ct*nt+ct*Z-St*j,X[5]=ct*O+Ct*j+St*nt-it*Z,X[6]=St*O+Ct*Z+it*j-ct*nt,X[7]=Ct*O-it*nt-ct*j-St*Z,X;}function D(X,z,q){var nt=-z[0],j=-z[1],Z=-z[2],O=z[3],L=z[4],$=z[5],V=z[6],rt=z[7],it=L*O+rt*nt+$*Z-V*j,ct=$*O+rt*j+V*nt-L*Z,St=V*O+rt*Z+L*j-$*nt,Ct=rt*O-L*nt-$*j-V*Z;return n.rotateY(X,z,q),nt=X[0],j=X[1],Z=X[2],O=X[3],X[4]=it*O+Ct*nt+ct*Z-St*j,X[5]=ct*O+Ct*j+St*nt-it*Z,X[6]=St*O+Ct*Z+it*j-ct*nt,X[7]=Ct*O-it*nt-ct*j-St*Z,X;}function U(X,z,q){var nt=-z[0],j=-z[1],Z=-z[2],O=z[3],L=z[4],$=z[5],V=z[6],rt=z[7],it=L*O+rt*nt+$*Z-V*j,ct=$*O+rt*j+V*nt-L*Z,St=V*O+rt*Z+L*j-$*nt,Ct=rt*O-L*nt-$*j-V*Z;return n.rotateZ(X,z,q),nt=X[0],j=X[1],Z=X[2],O=X[3],X[4]=it*O+Ct*nt+ct*Z-St*j,X[5]=ct*O+Ct*j+St*nt-it*Z,X[6]=St*O+Ct*Z+it*j-ct*nt,X[7]=Ct*O-it*nt-ct*j-St*Z,X;}function M(X,z,q){var nt=q[0],j=q[1],Z=q[2],O=q[3],L=z[0],$=z[1],V=z[2],rt=z[3];return X[0]=L*O+rt*nt+$*Z-V*j,X[1]=$*O+rt*j+V*nt-L*Z,X[2]=V*O+rt*Z+L*j-$*nt,X[3]=rt*O-L*nt-$*j-V*Z,L=z[4],$=z[5],V=z[6],rt=z[7],X[4]=L*O+rt*nt+$*Z-V*j,X[5]=$*O+rt*j+V*nt-L*Z,X[6]=V*O+rt*Z+L*j-$*nt,X[7]=rt*O-L*nt-$*j-V*Z,X;}function W(X,z,q){var nt=z[0],j=z[1],Z=z[2],O=z[3],L=q[0],$=q[1],V=q[2],rt=q[3];return X[0]=nt*rt+O*L+j*V-Z*$,X[1]=j*rt+O*$+Z*L-nt*V,X[2]=Z*rt+O*V+nt*$-j*L,X[3]=O*rt-nt*L-j*$-Z*V,L=q[4],$=q[5],V=q[6],rt=q[7],X[4]=nt*rt+O*L+j*V-Z*$,X[5]=j*rt+O*$+Z*L-nt*V,X[6]=Z*rt+O*V+nt*$-j*L,X[7]=O*rt-nt*L-j*$-Z*V,X;}function Y(X,z,q,nt){if(Math.abs(nt)<r.EPSILON)return E(X,z);var j=Math.hypot(q[0],q[1],q[2]);nt=nt*0.5;var Z=Math.sin(nt),O=Z*q[0]/j,L=Z*q[1]/j,$=Z*q[2]/j,V=Math.cos(nt),rt=z[0],it=z[1],ct=z[2],St=z[3];X[0]=rt*V+St*O+it*$-ct*L,X[1]=it*V+St*L+ct*O-rt*$,X[2]=ct*V+St*$+rt*L-it*O,X[3]=St*V-rt*O-it*L-ct*$;var Ct=z[4],Mt=z[5],Dt=z[6],At=z[7];return X[4]=Ct*V+At*O+Mt*$-Dt*L,X[5]=Mt*V+At*L+Dt*O-Ct*$,X[6]=Dt*V+At*$+Ct*L-Mt*O,X[7]=At*V-Ct*O-Mt*L-Dt*$,X;}function B(X,z,q){return X[0]=z[0]+q[0],X[1]=z[1]+q[1],X[2]=z[2]+q[2],X[3]=z[3]+q[3],X[4]=z[4]+q[4],X[5]=z[5]+q[5],X[6]=z[6]+q[6],X[7]=z[7]+q[7],X;}function N(X,z,q){var nt=z[0],j=z[1],Z=z[2],O=z[3],L=q[4],$=q[5],V=q[6],rt=q[7],it=z[4],ct=z[5],St=z[6],Ct=z[7],Mt=q[0],Dt=q[1],At=q[2],Ot=q[3];return X[0]=nt*Ot+O*Mt+j*At-Z*Dt,X[1]=j*Ot+O*Dt+Z*Mt-nt*At,X[2]=Z*Ot+O*At+nt*Dt-j*Mt,X[3]=O*Ot-nt*Mt-j*Dt-Z*At,X[4]=nt*rt+O*L+j*V-Z*$+it*Ot+Ct*Mt+ct*At-St*Dt,X[5]=j*rt+O*$+Z*L-nt*V+ct*Ot+Ct*Dt+St*Mt-it*At,X[6]=Z*rt+O*V+nt*$-j*L+St*Ot+Ct*At+it*Dt-ct*Mt,X[7]=O*rt-nt*L-j*$-Z*V+Ct*Ot-it*Mt-ct*Dt-St*At,X;}var G=N;function J(X,z,q){return X[0]=z[0]*q,X[1]=z[1]*q,X[2]=z[2]*q,X[3]=z[3]*q,X[4]=z[4]*q,X[5]=z[5]*q,X[6]=z[6]*q,X[7]=z[7]*q,X;}var tt=n.dot;function at(X,z,q,nt){var j=1-nt;return tt(z,q)<0&&(nt=-nt),X[0]=z[0]*j+q[0]*nt,X[1]=z[1]*j+q[1]*nt,X[2]=z[2]*j+q[2]*nt,X[3]=z[3]*j+q[3]*nt,X[4]=z[4]*j+q[4]*nt,X[5]=z[5]*j+q[5]*nt,X[6]=z[6]*j+q[6]*nt,X[7]=z[7]*j+q[7]*nt,X;}function ut(X,z){var q=gt(z);return X[0]=-z[0]/q,X[1]=-z[1]/q,X[2]=-z[2]/q,X[3]=z[3]/q,X[4]=-z[4]/q,X[5]=-z[5]/q,X[6]=-z[6]/q,X[7]=z[7]/q,X;}function K(X,z){return X[0]=-z[0],X[1]=-z[1],X[2]=-z[2],X[3]=z[3],X[4]=-z[4],X[5]=-z[5],X[6]=-z[6],X[7]=z[7],X;}var Q=n.length,ft=Q,gt=n.squaredLength,mt=gt;function wt(X,z){var q=gt(z);if(q>0){q=Math.sqrt(q);var nt=z[0]/q,j=z[1]/q,Z=z[2]/q,O=z[3]/q,L=z[4],$=z[5],V=z[6],rt=z[7],it=nt*L+j*$+Z*V+O*rt;X[0]=nt,X[1]=j,X[2]=Z,X[3]=O,X[4]=(L-nt*it)/q,X[5]=($-j*it)/q,X[6]=(V-Z*it)/q,X[7]=(rt-O*it)/q;}return X;}function ht(X){return"quat2("+X[0]+", "+X[1]+", "+X[2]+", "+X[3]+", "+X[4]+", "+X[5]+", "+X[6]+", "+X[7]+")";}function Nt(X,z){return X[0]===z[0]&&X[1]===z[1]&&X[2]===z[2]&&X[3]===z[3]&&X[4]===z[4]&&X[5]===z[5]&&X[6]===z[6]&&X[7]===z[7];}function Rt(X,z){var q=X[0],nt=X[1],j=X[2],Z=X[3],O=X[4],L=X[5],$=X[6],V=X[7],rt=z[0],it=z[1],ct=z[2],St=z[3],Ct=z[4],Mt=z[5],Dt=z[6],At=z[7];return Math.abs(q-rt)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(rt))&&Math.abs(nt-it)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(it))&&Math.abs(j-ct)<=r.EPSILON*Math.max(1,Math.abs(j),Math.abs(ct))&&Math.abs(Z-St)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(St))&&Math.abs(O-Ct)<=r.EPSILON*Math.max(1,Math.abs(O),Math.abs(Ct))&&Math.abs(L-Mt)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(Mt))&&Math.abs($-Dt)<=r.EPSILON*Math.max(1,Math.abs($),Math.abs(Dt))&&Math.abs(V-At)<=r.EPSILON*Math.max(1,Math.abs(V),Math.abs(At));}},/* 11 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"fromValues",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"add",function(){return h;}),t.d(e,"subtract",function(){return m;}),t.d(e,"multiply",function(){return u;}),t.d(e,"divide",function(){return y;}),t.d(e,"ceil",function(){return T;}),t.d(e,"floor",function(){return E;}),t.d(e,"min",function(){return C;}),t.d(e,"max",function(){return x;}),t.d(e,"round",function(){return I;}),t.d(e,"scale",function(){return d;}),t.d(e,"scaleAndAdd",function(){return v;}),t.d(e,"distance",function(){return p;}),t.d(e,"squaredDistance",function(){return S;}),t.d(e,"length",function(){return A;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return Y;}),t.d(e,"lerp",function(){return B;}),t.d(e,"random",function(){return N;}),t.d(e,"transformMat2",function(){return G;}),t.d(e,"transformMat2d",function(){return J;}),t.d(e,"transformMat3",function(){return tt;}),t.d(e,"transformMat4",function(){return at;}),t.d(e,"rotate",function(){return ut;}),t.d(e,"angle",function(){return K;}),t.d(e,"zero",function(){return Q;}),t.d(e,"str",function(){return ft;}),t.d(e,"exactEquals",function(){return gt;}),t.d(e,"equals",function(){return mt;}),t.d(e,"len",function(){return wt;}),t.d(e,"sub",function(){return ht;}),t.d(e,"mul",function(){return Nt;}),t.d(e,"div",function(){return Rt;}),t.d(e,"dist",function(){return X;}),t.d(e,"sqrDist",function(){return z;}),t.d(e,"sqrLen",function(){return q;}),t.d(e,"forEach",function(){return nt;});var r=t(2);function n(){var j=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(j[0]=0,j[1]=0),j;}function s(j){var Z=new r.ARRAY_TYPE(2);return Z[0]=j[0],Z[1]=j[1],Z;}function c(j,Z){var O=new r.ARRAY_TYPE(2);return O[0]=j,O[1]=Z,O;}function l(j,Z){return j[0]=Z[0],j[1]=Z[1],j;}function f(j,Z,O){return j[0]=Z,j[1]=O,j;}function h(j,Z,O){return j[0]=Z[0]+O[0],j[1]=Z[1]+O[1],j;}function m(j,Z,O){return j[0]=Z[0]-O[0],j[1]=Z[1]-O[1],j;}function u(j,Z,O){return j[0]=Z[0]*O[0],j[1]=Z[1]*O[1],j;}function y(j,Z,O){return j[0]=Z[0]/O[0],j[1]=Z[1]/O[1],j;}function T(j,Z){return j[0]=Math.ceil(Z[0]),j[1]=Math.ceil(Z[1]),j;}function E(j,Z){return j[0]=Math.floor(Z[0]),j[1]=Math.floor(Z[1]),j;}function C(j,Z,O){return j[0]=Math.min(Z[0],O[0]),j[1]=Math.min(Z[1],O[1]),j;}function x(j,Z,O){return j[0]=Math.max(Z[0],O[0]),j[1]=Math.max(Z[1],O[1]),j;}function I(j,Z){return j[0]=Math.round(Z[0]),j[1]=Math.round(Z[1]),j;}function d(j,Z,O){return j[0]=Z[0]*O,j[1]=Z[1]*O,j;}function v(j,Z,O,L){return j[0]=Z[0]+O[0]*L,j[1]=Z[1]+O[1]*L,j;}function p(j,Z){var O=Z[0]-j[0],L=Z[1]-j[1];return Math.hypot(O,L);}function S(j,Z){var O=Z[0]-j[0],L=Z[1]-j[1];return O*O+L*L;}function A(j){var Z=j[0],O=j[1];return Math.hypot(Z,O);}function R(j){var Z=j[0],O=j[1];return Z*Z+O*O;}function D(j,Z){return j[0]=-Z[0],j[1]=-Z[1],j;}function U(j,Z){return j[0]=1/Z[0],j[1]=1/Z[1],j;}function M(j,Z){var O=Z[0],L=Z[1],$=O*O+L*L;return $>0&&($=1/Math.sqrt($)),j[0]=Z[0]*$,j[1]=Z[1]*$,j;}function W(j,Z){return j[0]*Z[0]+j[1]*Z[1];}function Y(j,Z,O){var L=Z[0]*O[1]-Z[1]*O[0];return j[0]=j[1]=0,j[2]=L,j;}function B(j,Z,O,L){var $=Z[0],V=Z[1];return j[0]=$+L*(O[0]-$),j[1]=V+L*(O[1]-V),j;}function N(j,Z){Z=Z||1;var O=r.RANDOM()*2*Math.PI;return j[0]=Math.cos(O)*Z,j[1]=Math.sin(O)*Z,j;}function G(j,Z,O){var L=Z[0],$=Z[1];return j[0]=O[0]*L+O[2]*$,j[1]=O[1]*L+O[3]*$,j;}function J(j,Z,O){var L=Z[0],$=Z[1];return j[0]=O[0]*L+O[2]*$+O[4],j[1]=O[1]*L+O[3]*$+O[5],j;}function tt(j,Z,O){var L=Z[0],$=Z[1];return j[0]=O[0]*L+O[3]*$+O[6],j[1]=O[1]*L+O[4]*$+O[7],j;}function at(j,Z,O){var L=Z[0],$=Z[1];return j[0]=O[0]*L+O[4]*$+O[12],j[1]=O[1]*L+O[5]*$+O[13],j;}function ut(j,Z,O,L){var $=Z[0]-O[0],V=Z[1]-O[1],rt=Math.sin(L),it=Math.cos(L);return j[0]=$*it-V*rt+O[0],j[1]=$*rt+V*it+O[1],j;}function K(j,Z){var O=j[0],L=j[1],$=Z[0],V=Z[1],rt=Math.sqrt(O*O+L*L)*Math.sqrt($*$+V*V),it=rt&&(O*$+L*V)/rt;return Math.acos(Math.min(Math.max(it,-1),1));}function Q(j){return j[0]=0,j[1]=0,j;}function ft(j){return"vec2("+j[0]+", "+j[1]+")";}function gt(j,Z){return j[0]===Z[0]&&j[1]===Z[1];}function mt(j,Z){var O=j[0],L=j[1],$=Z[0],V=Z[1];return Math.abs(O-$)<=r.EPSILON*Math.max(1,Math.abs(O),Math.abs($))&&Math.abs(L-V)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(V));}var wt=A,ht=m,Nt=u,Rt=y,X=p,z=S,q=R,nt=function(){var j=n();return function(Z,O,L,$,V,rt){var it,ct;for(O||(O=2),L||(L=0),$?ct=Math.min($*O+L,Z.length):ct=Z.length,it=L;it<ct;it+=O)j[0]=Z[it],j[1]=Z[it+1],V(j,j,rt),Z[it]=j[0],Z[it+1]=j[1];return Z;};}();},/* 12 *//***/function(i,e,t){t.r(e);var r=t(13);t.d(e,"Renderer",function(){return r["default"];});var n=t(40);t.d(e,"Figure2D",function(){return n["default"];});var s=t(56);t.d(e,"Mesh2D",function(){return s["default"];});var c=t(29);t.d(e,"MeshCloud",function(){return c["default"];});var l=t(23);t.d(e,"parseFont",function(){return l["default"];});var f=t(31);t.d(e,"parseColor",function(){return f["default"];});var h=t(21);t.d(e,"ENV",function(){return h["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return U;});var r=t(14),n=t(1),s=t(20),c=t(27),l=t(25),f=t(40),h=t(56),m=t(29),u=t(59),y=t(21),T=t(63);t(1).glMatrix.setMatrixArrayType(Array);var E={autoUpdate:!1,// premultipliedAlpha: true,
2
+ preserveDrawingBuffer:!1,// depth: false,
3
+ // antialias: false,
4
+ bufferSize:1500},C="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",x="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",I=Symbol("glRenderer"),d=Symbol("canvasRenderer"),v=Symbol("options"),p=Symbol("globalTransform"),S=Symbol("applyGlobalTransform"),A=Symbol("canvas");function R(M){var W=M.gl,Y=M.fbo;Y&&W.bindFramebuffer(W.FRAMEBUFFER,Y),M._draw(),Y&&W.bindFramebuffer(W.FRAMEBUFFER,null);}function D(M,W,Y,B){var N=M.createTexture(W.canvas),G=[[[0,0],[Y,0],[Y,B],[0,B],[0,0]]];G.closed=!0;var J=new h["default"]({contours:G});J.setTexture(N),M.setMeshData([J.meshData]),R(M),N["delete"](),W.clearRect(0,0,Y,B),delete W._filter;}var U=/*#__PURE__*/function(){function U(W){var Y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,U);var B=Y.contextType;if(B||(typeof WebGL2RenderingContext=="function"?B="webgl2":typeof WebGLRenderingContext=="function"?B="webgl":B="2d"),!W.getContext){var N=W;W={getContext:function getContext(){return N;},width:Y.width,height:Y.height},N.canvas=W,B="2d";}if(this[A]=W,B!=="webgl"&&B!=="webgl2"&&B!=="2d")throw new Error("Unknown context type ".concat(B));if(Y.contextType=B,this[v]=Object.assign({},E,Y),B==="webgl"||B==="webgl2"){B==="webgl2"&&(this[v].webgl2=!0);var _N=new r["default"](W,this[v]);B==="webgl2"&&!_N.isWebGL2&&(Y.contextType="webgl"),Object(T.createShaders)(_N),Object(T.applyShader)(_N),Object(T.createCloudShaders)(_N);var G=_N.gl;G.clearColor(0,0,0,0),G.blendFuncSeparate(G.SRC_ALPHA,G.ONE_MINUS_SRC_ALPHA,G.ONE,G.ONE_MINUS_SRC_ALPHA),this[I]=_N;}else this[d]=new s["default"](W,this[v]);this[p]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(U,[{key:"canvas",get:function get(){return this[A];}},{key:"canvasRenderer",get:function get(){return this[d];}},{key:"glRenderer",get:function get(){return this[I];}},{key:"isWebGL2",get:function get(){return this[I]&&this[I].isWebGL2;}},{key:"options",get:function get(){return this[v];}},{key:"globalTransformMatrix",get:function get(){var W=this[p];return[W[0],W[1],W[3],W[4],W[6],W[7]];}},{key:"viewMatrix",get:function get(){return this[p];}},{key:S,value:function value(){var W=this[I]||this[d];if(this[I]){var _this$canvas=this.canvas,Y=_this$canvas.width,B=_this$canvas.height;W.uniforms.viewMatrix=this.viewMatrix,W.uniforms.projectionMatrix=this.projectionMatrix,W.uniforms.u_resolution=[Y,B];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,W=_this$canvas2.width,Y=_this$canvas2.height,B=[// translation
5
+ 1,0,0,0,1,0,-W/2,-Y/2,1],N=[// scale
6
+ 2/W,0,0,0,-2/Y,0,0,0,1],G=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),N,B);this.projectionMatrix=G,this[I]&&this[I].gl.viewport(0,0,W,Y);}},{key:"createTexture",value:function createTexture(W,Y){return(this[I]||this[d]).createTexture(W,Y);}/* async */},{key:"loadTexture",value:function loadTexture(W){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref$useImageBitmap=_ref.useImageBitmap,Y=_ref$useImageBitmap===void 0?!1:_ref$useImageBitmap;return(this[I]||this[d]).loadTexture(W,{useImageBitmap:Y});}},{key:"createText",value:function createText(W){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$font=_ref2.font,Y=_ref2$font===void 0?"16px arial":_ref2$font,_ref2$fillColor=_ref2.fillColor,B=_ref2$fillColor===void 0?null:_ref2$fillColor,_ref2$strokeColor=_ref2.strokeColor,N=_ref2$strokeColor===void 0?null:_ref2$strokeColor,_ref2$strokeWidth=_ref2.strokeWidth,G=_ref2$strokeWidth===void 0?1:_ref2$strokeWidth;if(this[I]){var J=y["default"].createText(W,{font:Y,fillColor:B,strokeColor:N,strokeWidth:G});return{image:this.createTexture(J.image),rect:J.rect};}return{_img:{font:Y,fillColor:B,strokeColor:N,strokeWidth:G,text:W}};}},{key:"createProgram",value:function createProgram(){var _ref3=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},W=_ref3.vertex,Y=_ref3.fragment,B=_ref3.options;if(this[I]){var N=this[I].compileSync(Y,W);return N._attribOpts=B,N;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref4$vertex=_ref4.vertex,W=_ref4$vertex===void 0?C:_ref4$vertex,_ref4$fragment=_ref4.fragment,Y=_ref4$fragment===void 0?x:_ref4$fragment,B=_ref4.options;return this.createProgram({vertex:W,fragment:Y,options:B});}},{key:"useProgram",value:function useProgram(W){var Y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[I]){var B=Object.assign({},W._attribOpts,Y);return this[I].useProgram(W,B);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(W){return(this[I]||this[d]).deleteTexture(W);}},{key:"clear",value:function clear(){var _this$d;if(this[I]){var Y=this[I].gl;Y.clear(Y.COLOR_BUFFER_BIT);}else(_this$d=this[d]).clear.apply(_this$d,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(W){var _ref5=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref5$clear=_ref5.clear,Y=_ref5$clear===void 0?!1:_ref5$clear,_ref5$program=_ref5.program,B=_ref5$program===void 0?null:_ref5$program;var N=this[I]||this[d],G=B||W.program;if(this[I]){var J=N.gl;if(Y&&J.clear(J.COLOR_BUFFER_BIT),G)N.program!==G&&this.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}});else{var tt=W.mesh.meshData,at=!!tt.uniforms.u_texSampler,ut=!!tt.uniforms.u_filterFlag,K=!!tt.uniforms.u_radialGradientVector,Q=W.hasCloudColor,ft=W.hasCloudFilter,gt=!!tt.uniforms.u_clipSampler;Object(T.applyCloudShader)(N,{hasTexture:at,hasFilter:ut,hasGradient:K,hasCloudColor:Q,hasCloudFilter:ft,hasClipPath:gt});}this[S](),N.setMeshData([W.meshData]),W.beforeRender&&W.beforeRender(J,W),R(N),W.afterRender&&W.afterRender(J,W);}else N.setTransform(this.globalTransformMatrix),N.drawMeshCloud(W,{clear:Y,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(W){var _this=this;var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,Y=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,B=_ref6$program===void 0?null:_ref6$program;var N=this[I]||this[d];if(this[I]){var G=N.fbo,J=Object(c["default"])(this,W,B==null),tt=N.gl;Y&&tt.clear(tt.COLOR_BUFFER_BIT);var at=!Object(u.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator2=_createForOfIteratorHelper(J),_step2;try{var _loop=function _loop(){var ut=_step2.value;_this._drawCalls++;var K=B||ut.program;if(ut instanceof m["default"])_this.drawMeshCloud(ut,{clear:Y,program:K});else{var _this$canvas3=_this.canvas,Q=_this$canvas3.width,ft=_this$canvas3.height;if(ut.beforeRender&&ut.beforeRender(tt,ut),ut.pass.length&&((!_this.fbo||_this.fbo.width!==Q||_this.fbo.height!==ft)&&(_this.fbo={width:Q,height:ft,target:N.createFBO(),buffer:N.createFBO(),swap:function swap(){var _ref7=[this.buffer,this.target];this.target=_ref7[0];this.buffer=_ref7[1];}}),N.bindFBO(_this.fbo.target)),!K&&ut.filterCanvas){Object(T.applyShader)(N,{hasTexture:!0});var gt=_this.filterContext;gt||(gt=y["default"].createCanvas(Q,ft).getContext("2d"),_this.filterContext=gt);var mt=W[ut.packIndex],wt=mt.filter,ht=W[ut.packIndex+1],Nt=W[ut.packIndex-1];(!Nt||!Nt.filterCanvas||Nt.filter!==wt)&&(!ht||!ht.filterCanvas||ht.filter!==wt)?(at?(gt.save(),Object(l.drawMesh2D)(mt,gt,!1),gt.restore(),Object(l.applyFilter)(gt,wt)):Object(l.drawMesh2D)(mt,gt,!0),_this[S](),D(N,gt,Q,ft)):(at&&gt.save(),Object(l.drawMesh2D)(mt,gt,!1),at&&gt.restore(),(!ht||!ht.filterCanvas||mt.filter!==ht.filter)&&(Object(l.applyFilter)(gt,wt),_this[S](),D(N,gt,Q,ft)));}else{if(K)N.program!==K&&_this.useProgram(K,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _gt=!!ut.uniforms.u_texSampler,_mt=!!ut.uniforms.u_filterFlag,_wt=!!ut.uniforms.u_radialGradientVector,_ht=!!ut.uniforms.u_clipSampler;Object(T.applyShader)(N,{hasTexture:_gt,hasFilter:_mt,hasGradient:_wt,hasClipPath:_ht});}ut.filterCanvas&&console.warn("User program ignored some filter effects."),_this[S](),N.setMeshData([ut]),R(N);}if(ut.pass.length){var _gt2=ut.pass.length;ut.pass.forEach(function(mt,wt){mt.blend=ut.enableBlend,mt.setTexture(N.fbo.texture),wt===_gt2-1?N.bindFBO(G):(_this.fbo.swap(),N.bindFBO(_this.fbo.target)),mt.program?N.useProgram(mt.program):(_this.defaultPassProgram=_this.defaultPassProgram||_this.createPassProgram(),N.useProgram(_this.defaultPassProgram)),N.setMeshData([mt.meshData]),tt.clear(tt.COLOR_BUFFER_BIT),R(N);});}ut.afterRender&&ut.afterRender(tt,ut);}};for(_iterator2.s();!(_step2=_iterator2.n()).done;){_loop();}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}else N.setTransform(this.globalTransformMatrix),N.drawMeshes(W,{clear:Y});}},{key:"drawImage",value:function drawImage(W){for(var _len=arguments.length,Y=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){Y[_key-1]=arguments[_key];}var B=Y.length;if(B<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(Y.length+1," present."));if(B!==2&&B!==4&&B!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(Y.length+1," arguments provided."));var N=null,G=null;B===2?N=[Y[0],Y[1],W.width,W.height]:B===4?N=Y:B===8&&(G=Y.slice(0,4),N=Y.slice(4));var J=this.createTexture(W),_this$canvas4=this.canvas,tt=_this$canvas4.width,at=_this$canvas4.height,ut=new f["default"]();ut.rect(N[0],N[1],tt,at);var K=new h["default"](ut,{width:tt,height:at});K.setTexture(J,{rect:N,srcRect:G}),this.drawMeshes([K]),this.deleteTexture(J);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[p]=[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 Y=this[p];for(var _len2=arguments.length,W=new Array(_len2),_key2=0;_key2<_len2;_key2++){W[_key2]=arguments[_key2];}return this[p]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),Y,W),this;}},{key:"globalTranslate",value:function globalTranslate(W,Y){var B=n.mat3.create();return B=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),B,[W,Y]),this.globalTransform.apply(this,_toConsumableArray(B));}},{key:"globalRotate",value:function globalRotate(W){var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref9=_slicedToArray(_ref8,2),Y=_ref9[0],B=_ref9[1];var N=n.mat3.create();return N=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),N,[Y,B]),N=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),N,W),N=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),N,[-Y,-B]),this.globalTransform.apply(this,_toConsumableArray(N));}},{key:"globalScale",value:function globalScale(W){var Y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:W;var _ref10=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref11=_slicedToArray(_ref10,2),B=_ref11[0],N=_ref11[1];var G=n.mat3.create();return G=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),G,[B,N]),G=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),G,[W,Y]),G=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),G,[-B,-N]),this.globalTransform.apply(this,_toConsumableArray(G));}},{key:"globalSkew",value:function globalSkew(W){var Y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:W;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),B=_ref13[0],N=_ref13[1];var G=n.mat3.create();return G=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),G,[B,N]),G=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),G,n.mat3.fromValues(1,Math.tan(Y),Math.tan(W),1,0,0)),G=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),G,[-B,-N]),this.globalTransform.apply(this,_toConsumableArray(G));}},{key:"transformPoint",value:function transformPoint(W,Y,B){var N=this.globalTransformMatrix;B&&(N=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),N,B));var G=W*N[0]+Y*N[2]+N[4],J=W*N[1]+Y*N[3]+N[5];return[G,J];}}]);}();},/* 14 *//***/function(i,e,t){t.r(e);var r=t(15);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r["default"];},/* 15 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(16),n=t(17),s=t(18),c=t(19);t(1).glMatrix.setMatrixArrayType(Array);function l(E,C,x){return C in E?Object.defineProperty(E,C,{value:x,enumerable:!0,configurable:!0,writable:!0}):E[C]=x,E;}var f={};function h(E){var C=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var x=[],I=E.length;for(var d=0;d<I;d++)d%C<2&&x.push(0.5*(E[d]+1));return x;}function m(E,C){var x=C._buffers;Object.values(x).forEach(function(I){E.deleteBuffer(I);}),C._buffers={};}function u(E,C,x){return E.activeTexture(E.TEXTURE0+x),Array.isArray(C._img)?E.bindTexture(E.TEXTURE_CUBE_MAP,C):E.bindTexture(E.TEXTURE_2D,C),C;}var y={"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 T=/*#__PURE__*/function(){function T(C){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,T);this.options=Object.assign({},T.defaultOptions,x),this.canvas=C;var I;this.options.webgl2&&(I=C.getContext("webgl2",this.options)),I==null&&(I=Object(r.setupWebGL)(C,this.options),this.aia_ext=I.getExtension("ANGLE_instanced_arrays")),this.gl=I,I.viewport(0,0,C.width,C.height),I.clearColor(0,0,0,0),I.blendFuncSeparate(I.SRC_ALPHA,I.ONE_MINUS_SRC_ALPHA,I.ONE,I.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(T,[{key:"program",get:function get(){var C=this.gl;return C.getParameter(C.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
7
+ // WebGLRenderingContext.uniformMatrix[234]fv()
8
+ },{key:"_declareUniform",value:function _declareUniform(C,x){var I=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var d=this.gl,v=d.getUniformLocation(C,x);var p;var S=this;if(/^sampler/.test(I)){var A=C._samplerMap,R=C._bindTextures;Object.defineProperty(C.uniforms,x,{get:function get(){return p;},set:function set(D){p=D;var U=A[x]!=null?A[x]:R.length;R[U]=D,u(d,D,U),A[x]||(A[x]=U,d.uniform1i(v,U)),S.options.autoUpdate&&S.update();},configurable:!1,enumerable:!0});}else{var _A2=I.indexOf("Matrix")===0,_R=!_A2&&/v$/.test(I),D=d["uniform".concat(I)].bind(d);Object.defineProperty(C.uniforms,x,{get:function get(){return p;},set:function set(U){p=U,typeof U=="number"&&(U=[U]),_A2?D(v,!1,U):_R?D(v,U):D.apply(void 0,[v].concat(_toConsumableArray(U))),S.options.autoUpdate&&S.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this2=this;var C=this.program;C.meshData.forEach(function(x,I){var d=x.positions,v=x.cells,p=x.instanceCount,S=x.cellsCount,A=x.attributes,R=x.uniforms,D=x.textureCoord,U=x.enableBlend,M=_this2.gl;var W=x.mode!=null?x.mode:M.TRIANGLES;typeof W=="string"&&(W=M[W]),U?M.enable(M.BLEND):M.disable(M.BLEND),M.bindBuffer(M.ARRAY_BUFFER,C._buffers.verticesBuffer),M.bufferData(M.ARRAY_BUFFER,d,M.STATIC_DRAW),v&&(M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,C._buffers.cellsBuffer),M.bufferData(M.ELEMENT_ARRAY_BUFFER,v,M.STATIC_DRAW));var Y=[];A&&Object.values(A).forEach(function(_ref14){var N=_ref14.name,G=_ref14.data,J=_ref14.divisor;if(M.bindBuffer(M.ARRAY_BUFFER,C._buffers[N]),M.bufferData(M.ARRAY_BUFFER,G,M.STATIC_DRAW),J!=null){var tt=M.getAttribLocation(C,N);tt>=0&&(M.enableVertexAttribArray(tt),Y.push(tt),M.vertexAttribDivisor?M.vertexAttribDivisor(tt,J):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(tt,J));}}),R&&Object.entries(R).forEach(function(_ref15){var _ref16=_slicedToArray(_ref15,2),N=_ref16[0],G=_ref16[1];_this2.uniforms[N]=G;});var B;if(!v){var N=C._dimension;B=d.length/N;}if(C._enableTextures&&C._buffers.texCoordBuffer){var _N2=D||h(d,C._dimension);M.bindBuffer(M.ARRAY_BUFFER,C._buffers.texCoordBuffer),M.bufferData(M.ARRAY_BUFFER,T.FLOAT(_N2),M.STATIC_DRAW);}p!=null?(v?M.drawElementsInstanced?M.drawElementsInstanced(W,S,M.UNSIGNED_SHORT,0,p):_this2.aia_ext&&_this2.aia_ext.drawElementsInstancedANGLE(W,S,M.UNSIGNED_SHORT,0,p):M.drawArraysInstanced?M.drawArraysInstanced(W,0,B,p):_this2.aia_ext.drawArraysInstancedANGLE(W,0,B,p),Y.forEach(function(N){M.vertexAttribDivisor?M.vertexAttribDivisor(N,null):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(N,null);})):v?M.drawElements(W,S,M.UNSIGNED_SHORT,0):M.drawArrays(W,0,B);});}},{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 C=this.program;if(!C||!C.uniforms)throw Error("No avaliable program.");return C.uniforms;}},{key:"deleteProgram",value:function deleteProgram(C){var x=this.gl;this.program===C&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),x.useProgram(null));var I=this.programs.indexOf(C);I>=0&&this.programs.splice(I,1),m(x,C),x.deleteProgram(C);}/**
9
+ [{
10
+ positions: ...
11
+ cells: ...
12
+ textureCoord: ...
13
+ attributes: {name: {data:..., normalize: true}},
14
+ uniforms: ...
15
+ }]
16
+ */},{key:"setMeshData",value:function setMeshData(C){var _this3=this;Array.isArray(C)||(C=[C]);var x=this.program;x.meshData=C.map(function(_ref17){var I=_ref17.mode,d=_ref17.positions,v=_ref17.instanceCount,p=_ref17.cells,S=_ref17.cellsCount,A=_ref17.attributes,R=_ref17.uniforms,D=_ref17.textureCoord,U=_ref17.enableBlend;var M={positions:T.FLOAT(d),uniforms:R,enableBlend:!!U,textureCoord:T.FLOAT(D)};if(p&&(M.cells=T.USHORT(p),M.cellsCount=S||M.cells.length),I!=null&&(M.mode=I),v!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");M.instanceCount=v;}if(A){var W={};Object.entries(A).forEach(function(_ref18){var _ref19=_slicedToArray(_ref18,2),Y=_ref19[0],B=_ref19[1];if(!x._attribute[Y])x._attribute[Y]="ignored";else if(x._attribute[Y]!=="ignored"){var _x$_attribute$Y=x._attribute[Y],N=_x$_attribute$Y.name,G=_x$_attribute$Y.type;var J=B.data||B;if(Array.isArray(J)&&(J=T[G](J)),W[Y]={name:N,data:J},B.divisor!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");W[Y].divisor=B.divisor;}}}),M.attributes=W;}return M;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(C,x){var _this4=this;var I=/^\s*uniform\s+sampler/mg.test(C);C==null&&(C=s["default"]),x==null&&(x=I?c["default"]:n["default"]);var d=this.gl,v=Object(r.createProgram)(d,x,C);v.shaderText={vertexShader:x,fragmentShader:C},v._buffers={},v._attribute={},v.uniforms={},v._samplerMap={},v._bindTextures=[];var p=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var S=x.match(p);S&&(v._dimension=Number(S[1]));var A=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");S=x.match(A),S&&(v._texCoordSize=Number(S[1]));var R=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(S=x.match(R),S)for(var M=0;M<S.length;M++){var W=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,Y=S[M].match(W);if(Y&&Y[3]!==this.options.vertexPosition&&Y[3]!==this.options.vertexTextureCoord){var _Y=_slicedToArray(Y,4),B=_Y[1],N=_Y[2],G=_Y[3];B==="mat"&&(N=Math.pow(N,2)),v._buffers[G]=d.createBuffer(),v._attribute[G]={name:G,type:B,size:Number(N)||1};}}var D=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;S=x.match(D)||[],S=S.concat(C.match(D)||[]),S.forEach(function(M){var W=M.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _W$slice=W.slice(1),_W$slice2=_slicedToArray(_W$slice,3),Y=_W$slice2[0],B=_W$slice2[1],N=_W$slice2[2];Y=y[Y],N=!!N,Y.indexOf("Matrix")!==0&&N&&(Y+="v"),_this4._declareUniform(v,B,Y);}),v._buffers.verticesBuffer=d.createBuffer(),v._buffers.cellsBuffer=d.createBuffer();var U=d.getAttribLocation(v,this.options.vertexTextureCoord);return v._enableTextures=U>=0,v._enableTextures&&(v._buffers.texCoordBuffer=d.createBuffer()),this.programs.push(v),v;}},{key:"useProgram",value:function useProgram(C){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var I=this.gl;I.useProgram(C);var d=C._dimension;I.bindBuffer(I.ARRAY_BUFFER,C._buffers.verticesBuffer);var v=I.getAttribLocation(C,this.options.vertexPosition);if(I.vertexAttribPointer(v,d,I.FLOAT,!1,0,0),I.enableVertexAttribArray(v),C._enableTextures){I.bindBuffer(I.ARRAY_BUFFER,C._buffers.texCoordBuffer);var p=I.getAttribLocation(C,this.options.vertexTextureCoord);I.vertexAttribPointer(p,C._texCoordSize||2,I.FLOAT,!1,0,0),I.enableVertexAttribArray(p);}if(Object.entries(C._attribute).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),p=_ref21[0],S=_ref21[1];if(S!=="ignored"){var A=S.size,R=x[p]||{},D=!!R.normalize;var U=R.type||"FLOAT";var M=R.key||p;U==="UBYTE"&&(U="UNSIGNED_BYTE"),U==="USHORT"&&(U="UNSIGNED_SHORT"),S.type=U,M&&M!==p&&(C._attribute[M]=S),I.bindBuffer(I.ARRAY_BUFFER,C._buffers[p]);var W=I.getAttribLocation(C,p);W>=0&&(I.vertexAttribPointer(W,A,I[U],D,0,0),I.enableVertexAttribArray(W));}}),!C.meshData){var _p2=[[-1,-1,0,1].slice(0,d),[1,-1,0,1].slice(0,d),[1,1,0,1].slice(0,d),[-1,1,0,1].slice(0,d)],S=[[0,1,3],[3,1,2]];this.setMeshData({positions:_p2,cells:S});}return C;}},{key:"compileSync",value:function compileSync(C,x){C=C||s["default"];var I={};function d(A){A=A.replace(/^\s*/mg,"");var R=[],D=A.match(/^#pragma\s+include\s+.*/mg);if(D){for(var U=0;U<D.length;U++){var W=D[U].match(/(?:<|")(.*)(?:>|")/);if(W){var Y=W[0].indexOf("<")===0?"lib":"link";var B=W[1];if(B==="graph"&&(B="graphics"),I[B])R.push("/* included ".concat(B," */"));else if(I[B]=!0,Y==="lib"){var N=d(f[B]);R.push(N);}else if(Y==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}R.forEach(function(U){A=A.replace(/^#pragma\s+include\s+.*/m,U);});}return A;}var v=d(C),p=x?d(x):null;return this.createProgram(v,p);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(C,x){var I,d,_d2,v,p;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_d2=function _d4(){_d2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(A){var R,D,U,W,Y,B,N,_N3;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:A=A.replace(/^\s*/mg,"");R=[],D=A.match(/^#pragma\s+include\s+.*/mg);if(!D){_context.next=32;break;}U=0;case 4:if(!(U<D.length)){_context.next=31;break;}W=D[U].match(/(?:<|")(.*)(?:>|")/);if(!W){_context.next=28;break;}Y=W[0].indexOf("<")===0?"lib":"link";B=W[1];if(!(B==="graph"&&(B="graphics"),I[B])){_context.next=13;break;}R.push("/* included ".concat(B," */"));_context.next=28;break;case 13:if(!(I[B]=!0,Y==="lib")){_context.next=20;break;}_context.next=16;return d(f[B]);case 16:N=_context.sent;R.push(N);_context.next=28;break;case 20:if(!(Y==="link")){_context.next=28;break;}_context.next=23;return T.fetchShader(B);case 23:_N3=_context.sent;_context.next=26;return d(_N3);case 26:_N3=_context.sent;R.push(_N3);case 28:U++;_context.next=4;break;case 31:R.forEach(function(U){A=A.replace(/^#pragma\s+include\s+.*/m,U);});case 32:return _context.abrupt("return",A);case 33:case"end":return _context.stop();}},_callee);}));return _d2.apply(this,arguments);};d=function _d3(_x4){return _d2.apply(this,arguments);};C=C||s["default"];I={};_context2.next=6;return d(C);case 6:v=_context2.sent;if(!x){_context2.next=13;break;}_context2.next=10;return d(x);case 10:_context2.t0=_context2.sent;_context2.next=14;break;case 13:_context2.t0=null;case 14:p=_context2.t0;return _context2.abrupt("return",this.createProgram(v,p));case 16:case"end":return _context2.stop();}},_callee2,this);}));function compile(_x2,_x3){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(C){var x,_args3=arguments;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:x=_args3.length>1&&_args3[1]!==undefined?_args3[1]:null;_context3.next=3;return T.fetchShader(C);case 3:C=_context3.sent;_context3.t0=x;if(!_context3.t0){_context3.next=9;break;}_context3.next=8;return T.fetchShader(x);case 8:x=_context3.sent;case 9:return _context3.abrupt("return",this.compile(C,x));case 10:case"end":return _context3.stop();}},_callee3,this);}));function load(_x5){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this5=this;var C=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref22=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref22$wrapS=_ref22.wrapS,x=_ref22$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref22$wrapS,_ref22$wrapT=_ref22.wrapT,I=_ref22$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref22$wrapT,_ref22$minFilter=_ref22.minFilter,d=_ref22$minFilter===void 0?this.gl.LINEAR:_ref22$minFilter,_ref22$magFilter=_ref22.magFilter,v=_ref22$magFilter===void 0?this.gl.LINEAR:_ref22$magFilter;var p=this.gl,S=Array.isArray(C)?p.TEXTURE_CUBE_MAP:p.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||p.getParameter(p.MAX_COMBINED_TEXTURE_IMAGE_UNITS),p.activeTexture(p.TEXTURE0+this._max_texture_image_units-1);var A=p.createTexture();p.bindTexture(S,A),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas5=this.canvas,R=_this$canvas5.width,D=_this$canvas5.height;if(C){if(S===p.TEXTURE_CUBE_MAP)for(var U=0;U<6;U++)p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+U,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,C[U]);else p.texImage2D(S,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,C);}else if(S===p.TEXTURE_CUBE_MAP)for(var _U=0;_U<6;_U++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_U,0,p.RGBA,R,D,0,p.RGBA,p.UNSIGNED_BYTE,null);else p.texImage2D(S,0,p.RGBA,R,D,0,p.RGBA,p.UNSIGNED_BYTE,null);return p.texParameteri(S,p.TEXTURE_MIN_FILTER,d),p.texParameteri(S,p.TEXTURE_MAG_FILTER,v),p.texParameteri(S,p.TEXTURE_WRAP_S,x),p.texParameteri(S,p.TEXTURE_WRAP_T,I),S===p.TEXTURE_CUBE_MAP&&(C.width=C[0].width,C.height=C[0].height),p.bindTexture(S,null),A._img=C||{width:R,height:D},A["delete"]=function(){_this5.deleteTexture(A);},A;}},{key:"deleteTexture",value:function deleteTexture(C){var x=C._img;this.gl.deleteTexture(C),typeof x.close=="function"&&x.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(C){var _ref23,_ref23$useImageBitmap,x,I,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_ref23=_args4.length>1&&_args4[1]!==undefined?_args4[1]:{},_ref23$useImageBitmap=_ref23.useImageBitmap,x=_ref23$useImageBitmap===void 0?!0:_ref23$useImageBitmap;_context4.next=3;return T.loadImage(C,{useImageBitmap:x});case 3:I=_context4.sent;return _context4.abrupt("return",this.createTexture(I));case 5:case"end":return _context4.stop();}},_callee4,this);}));function loadTexture(_x6){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref24=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref24$color=_ref24.color,C=_ref24$color===void 0?1:_ref24$color,_ref24$blend=_ref24.blend,x=_ref24$blend===void 0?!1:_ref24$blend,_ref24$depth=_ref24.depth,I=_ref24$depth===void 0?this.options.depth!==!1:_ref24$depth,_ref24$stencil=_ref24.stencil,d=_ref24$stencil===void 0?!!this.options.stencil:_ref24$stencil;var v=this.gl,p=v.createFramebuffer();v.bindFramebuffer(v.FRAMEBUFFER,p);var S=[];for(var D=0;D<C;D++){var U=this.createTexture();v.framebufferTexture2D(v.FRAMEBUFFER,v.COLOR_ATTACHMENT0+D,v.TEXTURE_2D,U,0/* level */),S.push(U);}p.textures=S,p.texture=S[0],p.blend=x;var _this$canvas6=this.canvas,A=_this$canvas6.width,R=_this$canvas6.height;return I&&!d&&(p.depthBuffer=v.createRenderbuffer(),v.bindRenderbuffer(v.RENDERBUFFER,p.depthBuffer),v.renderbufferStorage(v.RENDERBUFFER,v.DEPTH_COMPONENT16,A,R),v.framebufferRenderbuffer(v.FRAMEBUFFER,v.DEPTH_ATTACHMENT,v.RENDERBUFFER,p.depthBuffer)),d&&!I&&(p.stencilBuffer=v.createRenderbuffer(),v.bindRenderbuffer(v.RENDERBUFFER,p.stencilBuffer),v.renderbufferStorage(v.RENDERBUFFER,v.STENCIL_INDEX8,A,R),v.framebufferRenderbuffer(v.FRAMEBUFFER,v.STENCIL_ATTACHMENT,v.RENDERBUFFER,p.stencilBuffer)),I&&d&&(p.depthStencilBuffer=v.createRenderbuffer(),v.bindRenderbuffer(v.RENDERBUFFER,p.depthStencilBuffer),v.renderbufferStorage(v.RENDERBUFFER,v.DEPTH_STENCIL,A,R),v.framebufferRenderbuffer(v.FRAMEBUFFER,v.DEPTH_STENCIL_ATTACHMENT,v.RENDERBUFFER,p.depthStencilBuffer)),v.bindFramebuffer(v.FRAMEBUFFER,null),p;}},{key:"bindFBO",value:function bindFBO(){var C=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=C;}},{key:"render",value:function render(){var _ref25=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref25$clearBuffer=_ref25.clearBuffer,C=_ref25$clearBuffer===void 0?!0:_ref25$clearBuffer;this.startRender=!0;var x=this.gl;var I=this.program;I||(I=this.createProgram(),this.useProgram(I)),this.fbo&&x.bindFramebuffer(x.FRAMEBUFFER,this.fbo);var d=this.options.depth;d&&x.enable(x.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(d?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var v=this._renderFrameID;this._draw(),this.fbo&&x.bindFramebuffer(x.FRAMEBUFFER,null),this._renderFrameID===v&&(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 C=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(f,C);}},{key:"FLOAT",value:function FLOAT(C,x){return Object(r.pointsToBuffer)(C,Float32Array,x);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(C,x){return Object(r.pointsToBuffer)(C,Uint8Array,x);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(C,x){return Object(r.pointsToBuffer)(C,Uint16Array,x);}},{key:"BYTE",value:function BYTE(C,x){return Object(r.pointsToBuffer)(C,Int8Array,x);}},{key:"SHORT",value:function SHORT(C,x){return Object(r.pointsToBuffer)(C,Int16Array,x);}}]);}();l(T,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),l(T,"UBYTE",T.UNSIGNED_BYTE),l(T,"USHORT",T.UNSIGNED_SHORT),l(T,"fetchShader",r.fetchShader),l(T,"loadImage",r.loadImage);},/* 16 *//***/function(i,e,t){t.r(e),t.d(e,"setupWebGL",function(){return n;}),t.d(e,"createProgram",function(){return s;}),t.d(e,"pointsToBuffer",function(){return c;}),t.d(e,"loadImage",function(){return f;}),t.d(e,"fetchShader",function(){return m;}),t(1).glMatrix.setMatrixArrayType(Array);function r(u,y){var T=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var E=null;for(var C=0;C<T.length;++C){try{E=u.getContext(T[C],y);}catch(_unused){}if(E)break;}return E;}function n(u,y){var T=r(u,y);if(!T)throw new Error("Sorry, your browser doesn't support WebGL.");return T;}function s(u,y,T){var E=u.createShader(u.VERTEX_SHADER);if(u.shaderSource(E,y),u.compileShader(E),!u.getShaderParameter(E,u.COMPILE_STATUS)){var _I2="Vertex shader failed to compile. The error log is:".concat(u.getShaderInfoLog(E));throw new Error(_I2);}var C=u.createShader(u.FRAGMENT_SHADER);if(u.shaderSource(C,T),u.compileShader(C),!u.getShaderParameter(C,u.COMPILE_STATUS)){var _I3="Fragment shader failed to compile. The error log is:".concat(u.getShaderInfoLog(C));throw new Error(_I3);}var x=u.createProgram();if(u.attachShader(x,E),u.attachShader(x,C),u.linkProgram(x),!u.getProgramParameter(x,u.LINK_STATUS)){var _I4="Shader program failed to link. The error log is:".concat(u.getProgramInfoLog(x));throw new Error(_I4);}return u.deleteShader(E),u.deleteShader(C),x;}function c(u){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(T&&!(T instanceof y))throw new TypeError("Wrong buffer type.");if(u==null||u instanceof y)return u;if(u[0]==null||u[0].length==null)return T?(T.set(u,0),T):new y(u);var E=u[0].length,C=u.length;T||(T=new y(E*C));var x=0;for(var _I5=0;_I5<C;_I5++)for(var _d5=0;_d5<E;_d5++)T[x++]=u[_I5][_d5];return T;}var l={};function f(u){var _ref26=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref26$useImageBitmap=_ref26.useImageBitmap,y=_ref26$useImageBitmap===void 0?!0:_ref26$useImageBitmap,_ref26$alias=_ref26.alias,T=_ref26$alias===void 0?null:_ref26$alias;if(!l[u]){if(typeof Image=="function"){var E=new Image();typeof u=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(u)&&(E.crossOrigin="anonymous"),l[u]=new Promise(function(C){E.onload=function(){y&&typeof createImageBitmap=="function"?createImageBitmap(E,{imageOrientation:"flipY"}).then(function(x){l[u]=x,T&&(l[T]=x),C(x);}):(l[u]=E,T&&(l[T]=E),C(E));},E.src=u;}),T&&(l[T]=l[u]);}else if(typeof fetch=="function")return fetch(u,{method:"GET",mode:"cors",cache:"default"}).then(function(E){return E.blob();}).then(function(E){return createImageBitmap(E,{imageOrientation:"flipY"}).then(function(C){return l[u]=C,T&&(l[T]=C),C;});});}return l[u];}var h={};function m(_x7){return _m2.apply(this,arguments);}function _m2(){_m2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(u){var y,T;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!h[u]){_context5.next=2;break;}return _context5.abrupt("return",h[u]);case 2:_context5.next=4;return fetch(u);case 4:y=_context5.sent;if(!(y.status>=200&&y.status<300)){_context5.next=10;break;}_context5.next=8;return y.text();case 8:T=_context5.sent;return _context5.abrupt("return",(h[u]=T,T));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context5.stop();}},_callee5);}));return _m2.apply(this,arguments);}},/* 17 *//***/function(i,e,t){t.r(e),e["default"]="attribute vec3 a_vertexPosition;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = vec4(a_vertexPosition, 1);\n}";},/* 18 *//***/function(i,e,t){t.r(e),e["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(i,e,t){t.r(e),e["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(i,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol("transform");var c=/*#__PURE__*/function(){function c(f,h){_classCallCheck(this,c);this.context=f.getContext("2d"),this.options=h,this[s]=[1,0,0,1,0,0];}return _createClass(c,[{key:"createTexture",value:function createTexture(f){return{_img:f};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(f){var h;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return r["default"].loadImage(f,{useImageBitmap:!1});case 2:h=_context6.sent;return _context6.abrupt("return",this.createTexture(h));case 4:case"end":return _context6.stop();}},_callee6,this);}));function loadTexture(_x8){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(f){return f;}},{key:"clear",value:function clear(f,h,m,u){var y=this.context;f=f||0,h=h||0,m=m||y.canvas.width-f,u=u||y.canvas.height-h,y.clearRect(f,h,m,u);}},{key:"drawMeshCloud",value:function drawMeshCloud(f){var _ref27=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref27$clear=_ref27.clear,h=_ref27$clear===void 0?!1:_ref27$clear;var m=[];for(var u=0;u<f.amount;u++){var y=f.getTransform(u);var T=f.getTextureFrame(u);T&&(T=T._img);var E=f.getFilter(u),_f$getCloudRGBA=f.getCloudRGBA(u),C=_f$getCloudRGBA.fill,x=_f$getCloudRGBA.stroke;m.push({mesh:f.mesh,_cloudOptions:[C,x,T,y,E]});}f.beforeRender&&f.beforeRender(this.context,f),this.drawMeshes(m,{clear:h,hook:!1}),f.afterRender&&f.afterRender(this.context,f);}},{key:"drawMeshes",value:function drawMeshes(f){var _this6=this;var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$clear=_ref28.clear,h=_ref28$clear===void 0?!1:_ref28$clear,_ref28$hook=_ref28.hook,m=_ref28$hook===void 0?!0:_ref28$hook;var u=this.context;h&&u.clearRect(0,0,u.canvas.width,u.canvas.height);var y=null;var _u$canvas=u.canvas,T=_u$canvas.width,E=_u$canvas.height,C=f.length;f.forEach(function(x,I){var _x$_cloudOptions,_this6$filterBuffer;var d,v,p,S,A;m&&x.beforeRender&&x.beforeRender(u,x),x._cloudOptions&&(_x$_cloudOptions=_slicedToArray(x._cloudOptions,5),d=_x$_cloudOptions[0],v=_x$_cloudOptions[1],p=_x$_cloudOptions[2],S=_x$_cloudOptions[3],A=_x$_cloudOptions[4],x=x.mesh);var R=x.filter;if(A&&(R=R?"".concat(R," ").concat(A):A),R&&!_this6.filterBuffer&&_this6.filterBuffer!==!1){var D=r["default"].createCanvas(T,E);D?_this6.filterBuffer=D.getContext("2d"):_this6.filterBuffer=!1;}y&&y!==R&&(Object(n.applyFilter)(_this6.filterBuffer,y),u.drawImage(_this6.filterBuffer.canvas,0,0,T,E),_this6.filterBuffer.clearRect(0,0,T,E),y=null),R&&_this6.filterBuffer?(_this6.filterBuffer.save(),(_this6$filterBuffer=_this6.filterBuffer).transform.apply(_this6$filterBuffer,_toConsumableArray(_this6[s])),Object(n.drawMesh2D)(x,_this6.filterBuffer,!1,d,v,p,S),_this6.filterBuffer.restore(),I===C-1?(Object(n.applyFilter)(_this6.filterBuffer,R),u.drawImage(_this6.filterBuffer.canvas,0,0,T,E),_this6.filterBuffer.clearRect(0,0,T,E)):y=R):(u.save(),u.transform.apply(u,_toConsumableArray(_this6[s])),Object(n.drawMesh2D)(x,u,!1,d,v,p,S),u.restore()),m&&x.afterRender&&x.afterRender(u,x);});}},{key:"setTransform",value:function setTransform(f){this[s]=f;}}]);}();},/* 21 *//***/function(i,e,t){t.r(e),function(r){var n=t(14),s=t(23),c=t(24);t(1).glMatrix.setMatrixArrayType(Array);var l={};function f(T,E){var C=T.style,x=T.variant,I=T.weight,d=T.stretch,v=T.size,p=T.pxLineHeight,S=T.family;return d==="normal"?"".concat(C," ").concat(x," ").concat(I," ").concat(v*E,"px/").concat(p*E,"px ").concat(S):"".concat(C," ").concat(x," ").concat(I," ").concat(d," ").concat(v*E,"px/").concat(p*E,"px ").concat(S);}function h(T,_ref29){var E=_ref29.font,C=_ref29.fillColor,x=_ref29.strokeColor,I=_ref29.strokeWidth,_ref29$ratio=_ref29.ratio,d=_ref29$ratio===void 0?1:_ref29$ratio,v=_ref29.textCanvas,_ref29$cachable=_ref29.cachable,p=_ref29$cachable===void 0?!1:_ref29$cachable;var S;if(p){S=[T,E,String(C),String(x),String(I)].join("###");var J=l[S];if(J)return J;}v||(v=u(1,1));var A=v.getContext("2d");A.save(),A.font=E;var _A$measureText=A.measureText(T),R=_A$measureText.width;A.restore();var D=Object(s["default"])(E),U=Math.max(D.pxLineHeight,D.pxHeight*1.13);/italic|oblique/.test(E)&&(R+=U*Math.tan(15*Math.PI/180)),!C&&!x&&(C="#000");var M=A.canvas,W=Math.ceil(R),Y=Math.ceil(U);M.width=Math.round(W*d),M.height=Math.round(Y*d),A.save(),A.font=f(D,d),A.textAlign="center",A.textBaseline="middle";var B=M.height*0.5+D.pxHeight*0.05*d,N=M.width*0.5;if(C){if(Array.isArray(C))C=Object(c["default"])(C);else if(C.vector){var _J;var _C2=C,tt=_C2.vector,at=_C2.colors;tt.length===6?_J=A.createRadialGradient.apply(A,_toConsumableArray(tt)):_J=A.createLinearGradient.apply(A,_toConsumableArray(tt)),at.forEach(function(_ref30){var ut=_ref30.offset,K=_ref30.color;_J.addColorStop(ut,K);}),C=_J;}A.fillStyle=C,A.fillText(T,N,B);}if(x){if(A.lineWidth=I*d,Array.isArray(x))x=Object(c["default"])(x);else if(x.vector){var _J2;var _x9=x,_tt=_x9.vector,_at=_x9.colors;_tt.length===6?_J2=A.createRadialGradient.apply(A,_toConsumableArray(_tt)):_J2=A.createLinearGradient.apply(A,_toConsumableArray(_tt)),_at.forEach(function(_ref31){var ut=_ref31.offset,K=_ref31.color;_J2.addColorStop(ut,K);}),x=_J2;}A.strokeStyle=x,A.strokeText(T,N,B);}A.restore();var G={image:v,rect:[0,0,W,Y]};return p&&(l[S]=G),G;}var m=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var T=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);T&&(m=Number(T[1])<70);}function u(T,E){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var x=C.offscreen||!m&&C.offscreen!==!1;var I;return _typeof(r)<"u"&&typeof r.createCanvas=="function"?I=r.createCanvas(T,E,C):x&&typeof OffscreenCanvas=="function"?I=new OffscreenCanvas(T,E):(I=document.createElement("canvas"),I.width=T,I.height=E),I;}var y={createCanvas:u,createText:h,loadImage:n["default"].loadImage};e["default"]=y;}.call(this,t(22));},/* 22 *//***/function(i,e){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused2){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}i.exports=t;},/* 23 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return C;}),t(1).glMatrix.setMatrixArrayType(Array);function r(x,I){if(typeof x=="string"){var p=x.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);p?x={size:parseFloat(p[1]),unit:p[2]}:x={size:parseInt(x,10),unit:"px"};}var _x10=x,d=_x10.size,v=_x10.unit;if(v==="pt")d/=0.75;else if(v==="pc")d*=16;else if(v==="in")d*=96;else if(v==="cm")d*=37.79527559055118;else if(v==="mm")d*=3.7795275590551185;else if(v==="em"||v==="rem"||v==="ex"){if(!I&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p3=getComputedStyle(document.documentElement).fontSize;I=r(_p3,16);}d*=I,v==="ex"&&(d/=2);}else if(v==="q")d*=0.9448818897637796;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p4=v==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;d*=_p4/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p5=document.documentElement.clientWidth,S=document.documentElement.clientHeight;v==="vmax"?d*=Math.max(_p5,S)/100:d*=Math.min(_p5,S)/100;}return d;}var n="bold|bolder|lighter|[1-9]00",s="italic|oblique",c="small-caps",l="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",f="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",h="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",m=new RegExp("(".concat(n,") +"),"i"),u=new RegExp("(".concat(s,") +"),"i"),y=new RegExp("(".concat(c,") +"),"i"),T=new RegExp("(".concat(l,") +"),"i"),E=new RegExp("([\\d\\.]+)("+f+")(?:\\/([\\d\\.]+)("+f+"))? *((?:"+h+")( *, *(?:"+h+"))*)");function C(x,I){var d=E.exec(x);if(!d)return;var v=parseFloat(d[3]),p={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(d[1]),unit:d[2],lineHeight:Number.isFinite(v)?v:void 0,lineHeightUnit:d[4],family:d[5].replace(/ *, */g,",")},S=x.substring(0,d.index),A=m.exec(S),R=u.exec(S),D=y.exec(S),U=T.exec(S);return A&&(p.weight=A[1]),R&&(p.style=R[1]),D&&(p.variant=D[1]),U&&(p.stretch=U[1]),p.pxHeight=r({size:p.size,unit:p.unit},I),p.pxLineHeight=r({size:p.lineHeight||p.size,unit:p.lineHeightUnit||p.unit},I),p;}},/* 24 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){return"rgba(".concat(n.map(function(s,c){return c<3?Math.round(s*255):s;}).join(),")");}},/* 25 *//***/function(i,e,t){t.r(e),t.d(e,"applyFilter",function(){return l;}),t.d(e,"drawMesh2D",function(){return h;});var r=t(1),n=t(24),s=t(23),c=t(26);t(1).glMatrix.setMatrixArrayType(Array);function l(m,u){var y=m.canvas;m.save(),m.filter=u,m.drawImage(y,0,0,y.width,y.height),m.restore();}function f(m,u){var y=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;m=m.match(y).slice(1,5).map(Number),u=u.match(y).slice(1,5).map(Number);var T=[],E=u[3];for(var C=0;C<4;C++)T[C]=Object(c.mix)(m[C],u[C],E);return"rgba(".concat(T.join(),")");}function h(m,u){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var T=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var E=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var C=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var x=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;u.save();var I=!1,d=!1;if(u.globalAlpha=m.getOpacity(),m._updateMatrix&&m.transformScale/m.contours.scale>1.5&&m.accurate(m.transformScale),m.lineWidth){var S=m.gradient&&m.gradient.stroke;if(S){var _S2=S,A=_S2.vector,R=_S2.colors;if(A.length===6)S=u.createRadialGradient.apply(u,_toConsumableArray(A));else if(A.length===4)S=u.createLinearGradient.apply(u,_toConsumableArray(A));else if(A.length===3)S=u.createCircularGradient.apply(u,_toConsumableArray(A));else throw new TypeError("Invalid vector dimension.");R.forEach(function(_ref32){var D=_ref32.offset,U=_ref32.color;var M=Object(n["default"])(U);E&&(M=f(M,E)),S.addColorStop(D,M);}),u.strokeStyle=S,I=!0;}else m.strokeStyle&&(E?u.strokeStyle=f(m.strokeStyle,E):u.strokeStyle=m.strokeStyle,I=!0);}I&&(u.lineWidth=m.lineWidth,u.lineJoin=m.lineJoin,u.lineCap=m.lineCap,u.miterLimit=m.miterLimit,m.lineDash&&(u.setLineDash(m.lineDash),m.lineDashOffset&&(u.lineDashOffset=m.lineDashOffset)));var v=m.gradient&&m.gradient.fill;if(v){var _v2=v,_S3=_v2.vector,_A3=_v2.colors;if(_S3.length===6)v=u.createRadialGradient.apply(u,_toConsumableArray(_S3));else if(_S3.length===4)v=u.createLinearGradient.apply(u,_toConsumableArray(_S3));else if(_S3.length===3)v=u.createCircularGradient.apply(u,_toConsumableArray(_S3));else throw new TypeError("Invalid vector dimension.");_A3.forEach(function(_ref33){var R=_ref33.offset,D=_ref33.color;var U=Object(n["default"])(D);E&&(U=f(U,E)),v.addColorStop(R,U);}),u.fillStyle=v,d=!0;}else m.fillStyle&&(T?u.fillStyle=f(m.fillStyle,T):u.fillStyle=m.fillStyle,d=!0);if(x&&u.transform.apply(u,_toConsumableArray(x)),u.transform.apply(u,_toConsumableArray(m.transformMatrix)),m.clipPath){var _S4=m.clipPath,_A4=new Path2D(_S4);u.clip(_A4);}var p=m.contours.length;if(m.contours.forEach(function(S,A){var R=S.length,D=R>1&&r.vec2.equals(S[0],S[R-1]),U=A===p-1&&m.texture;if(S&&R>0){if(d||I||U){u.beginPath(),u.moveTo.apply(u,_toConsumableArray(S[0]));for(var M=1;M<R;M++)M===R-1&&D?u.closePath():u.lineTo.apply(u,_toConsumableArray(S[M]));}if(d&&u.fill(m.fillRule),U){u.save(),u.clip();var _m$texture=m.texture,_M=_m$texture.image,W=_m$texture.options;if(C&&(_M=C),W.repeat&&console.warn("Context 2D not supported image repeat yet."),_M.font){W.scale&&console.warn("Context 2D not supported text scale yet."),W.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _M2=_M,Y=_M2.font,B=_M2.fillColor,N=_M2.strokeColor,G=_M2.strokeWidth,J=_M2.text;!B&&!N&&(B="#000"),Array.isArray(B)&&(B=Object(n["default"])(B)),Array.isArray(N)&&(N=Object(n["default"])(N)),u.font=Y;var _u$measureText=u.measureText(J),tt=_u$measureText.width,at=Object(s["default"])(Y),ut=Math.max(at.pxLineHeight,at.pxHeight*1.13);u.textAlign="center",u.textBaseline="middle";var K=W.rect,Q=K[0]+ut*0.5+at.pxHeight*0.06,ft=K[1]+tt*0.5;K[2]!=null&&u.scale(K[2]/tt,K[3]/ut),B&&(u.fillStyle=B,u.fillText(J,ft,Q)),N&&(u.lineWidth=G,u.strokeStyle=N,u.strokeText(J,ft,Q));}else{var _Y2=W.rect;var _B=W.srcRect;W.scale&&(_Y2=[0,0,u.canvas.width,u.canvas.height]),W.rotated&&_Y2&&(_Y2=[-_Y2[1],_Y2[0],_Y2[3],_Y2[2]]),_B&&(_Y2=_Y2||[0,0,_B[2],_B[3]]),W.rotated&&(u.translate(0,_Y2?_Y2[2]:_M.width),u.rotate(-0.5*Math.PI)),_B?u.drawImage.apply(u,[_M].concat(_toConsumableArray(_B),_toConsumableArray(_Y2))):_Y2?u.drawImage.apply(u,[_M].concat(_toConsumableArray(_Y2))):u.drawImage(_M,0,0);}u.restore();}I&&u.stroke();}}),u.restore(),y){var _S5=m.filter;_S5&&l(u,_S5);}}},/* 26 *//***/function(i,e,t){t.r(e),t.d(e,"clamp",function(){return r;}),t.d(e,"mix",function(){return n;}),t.d(e,"transformPoint",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);function r(c,l,f){var _ref34;return l>f&&(_ref34=[f,l],l=_ref34[0],f=_ref34[1],_ref34),c<l?l:c>f?f:c;}function n(c,l,f){return c*(1-f)+l*f;}function s(c,l){var _c2=_slicedToArray(c,2),f=_c2[0],h=_c2[1];return[f*l[0]+h*l[2]+l[4],f*l[1]+h*l[3]+l[5]];}},/* 27 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function s(h,m,u){var y=h.uniforms||{},T=m.uniforms||{};if(y.u_texSampler&&T.u_texSampler&&y.u_texSampler!==T.u_texSampler)return!1;var E=Object.keys(y),C=Object.keys(T),x=E.indexOf("u_texSampler"),I=C.indexOf("u_texSampler");if(x>=0&&E.splice(x,1),I>=0&&C.splice(I,1),E.length!==C.length)return!1;var d=E.every(function(v){var p=y[v],S=T[v];if(p===S)return!0;if(p.length&&S.length&&p.length===S.length){for(var A=0;A<p.length;A++)if(p[A]!==S[A])return!1;return!0;}return!1;});if(d){if(y.u_texSampler&&!T.u_texSampler)m.setTexture(y.u_texSampler,{hidden:!0});else if(!y.u_texSampler&&T.u_texSampler)for(var v=0;v<u.length;v++)u[v].setTexture(T.u_texSampler,{hidden:!0});}return d;}var c={};function l(h,m){if(h.length){var u=Object(r["default"])(h,c);return u.enableBlend=m,h[0].filterCanvas&&(u.filterCanvas=!0),u.packIndex=h[0].packIndex,u.packLength=h.length,u.beforeRender=h[0].beforeRender,u.pass=h[0].pass,u.afterRender=h[h.length-1].afterRender,h.length=0,u;}}function f(h,m){var u=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var y,T,E,C,x,_I6,_d6,p,v,_p6,S;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:y=[],T=h.options.bufferSize;E=0,C=!1;x=0;case 3:if(!(x<m.length)){_context7.next=47;break;}_I6=m[x];if(!(_I6 instanceof n["default"])){_context7.next=16;break;}_context7.t0=y.length;if(!_context7.t0){_context7.next=10;break;}_context7.next=10;return l(y,C);case 10:E=0;C=!1;_context7.next=14;return _I6;case 14:_context7.next=44;break;case 16:_d6=_I6.meshData;if(_d6.clipPath&&!_d6.uniforms.u_clipSampler){p=h.createTexture(_d6.clipPath);_d6.uniforms.u_clipSampler=p;}v=0;if(!((!u||!_I6.canIgnore())&&_d6&&_d6.positions.length)){_context7.next=40;break;}_I6.packIndex=x;_p6=_I6.filterCanvas;if(!(v=_d6.positions.length,_p6||E+v>T)){_context7.next=31;break;}_context7.t1=y.length;if(!_context7.t1){_context7.next=27;break;}_context7.next=27;return l(y,C);case 27:E=0;C=!1;_context7.next=39;break;case 31:if(!E){_context7.next=39;break;}S=y[y.length-1];_context7.t2=S&&(S.filterCanvas||S.afterRender||_I6.beforeRender||S.pass.length||_I6.pass.length||S.program!==_I6.program||!s(S,_I6,y));if(!_context7.t2){_context7.next=39;break;}_context7.next=37;return l(y,C);case 37:E=0;C=!1;case 39:y.push(_I6),C=C||_I6.enableBlend,E+=v;case 40:_context7.t3=x===m.length-1&&y.length;if(!_context7.t3){_context7.next=44;break;}_context7.next=44;return l(y,C);case 44:x++;_context7.next=3;break;case 47:case"end":return _context7.stop();}},_callee7);})();}},/* 28 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);var r={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(c,l){var f=0,h=0,m=0,u=0,y=0,T=0,E=0;var C=c[0].program;for(var x=0;x<c.length;x++){var _I7=c[x].meshData;if(_I7){E+=_I7.positions.length;var _d7=_I7.positions[0].length;f+=_I7.positions.length*_d7,h+=_I7.cells.length*3,T+=_I7.attributes.a_color.length*4;var v=_I7.textureCoord;v&&(m+=v.length*v[0].length);var p=_I7.attributes.a_sourceRect;p&&(u+=p.length*4);var S=_I7.attributes.a_clipUV;S&&(y+=S.length*2);}}if((!l.positions||l.positions.length<f)&&(l.positions=new Float32Array(f)),(!l.cells||l.cells.length<h)&&(l.cells=new Uint16Array(h)),m&&(!l.textureCoord||l.textureCoord.length<m)&&(l.textureCoord=new Float32Array(m)),(!l.a_color||l.a_color.length<T)&&(l.a_color=new Uint8Array(T)),u&&(!l.a_sourceRect||l.a_sourceRect.length<u)&&(l.a_sourceRect=new Float32Array(u)),y&&(!l.a_clipUV||l.a_clipUV.length<y)&&(l.a_clipUV=new Float32Array(y)),C){var _x11=Object.entries(C._attribute),_I8=C._attribOpts||{};for(var _d8=0;_d8<_x11.length;_d8++){var _x11$_d=_slicedToArray(_x11[_d8],2),_v3=_x11$_d[0],_p7=_x11$_d[1];if(_v3!=="a_color"&&_v3!=="a_sourceRect"&&_p7!=="ignored"){var _S6=_I8[_v3]?_I8[_v3].type:"FLOAT",A=r[_S6],R=_p7.size*E;(!l[_v3]||l[_v3].length<R)&&(l[_v3]=new A(R));}}}return l;}function s(c,l){var f=[],h=[],m=[],u=[],y=[],T=[],E=0,C=0;var x=c[0]?c[0].uniforms||{}:{},I=c[0]?c[0].program:null;l&&(n(c,l),h=l.cells,f=l.positions,m=l.textureCoord,u=l.a_color,y=l.a_sourceRect,T=l.a_clipUV);var d=!1,v=!1;var p={};for(var A=0;A<c.length;A++){var R=c[A];if(R){var _f2,_u2,_y2,_T2,_m3;if(R.meshData&&(R=R.meshData),l){var U=R.positions;for(var M=0;M<U.length;M++){var W=U[M],Y=3*(E+M);for(var B=0;B<W.length;B++)f[Y+B]=W[B];}}else(_f2=f).push.apply(_f2,_toConsumableArray(R.positions));var D=R.cells;for(var _U2=0;_U2<D.length;_U2++){var _M3=D[_U2];if(l){var _W=3*(C+_U2);h[_W]=_M3[0]+E,h[_W+1]=_M3[1]+E,h[_W+2]=_M3[2]+E;}else h.push([_M3[0]+E,_M3[1]+E,_M3[2]+E]);}if(l){var _U3=R.attributes.a_color;for(var _M4=0;_M4<_U3.length;_M4++){var _W2=_U3[_M4],_Y3=4*(E+_M4);u[_Y3]=_W2[0],u[_Y3+1]=_W2[1],u[_Y3+2]=_W2[2],u[_Y3+3]=_W2[3];}}else(_u2=u).push.apply(_u2,_toConsumableArray(R.attributes.a_color));if(R.attributes.a_sourceRect)if(d=!0,l){var _U4=R.attributes.a_sourceRect;for(var _M5=0;_M5<_U4.length;_M5++){var _W3=_U4[_M5],_Y4=4*(E+_M5);y[_Y4]=_W3[0],y[_Y4+1]=_W3[1],y[_Y4+2]=_W3[2],y[_Y4+3]=_W3[3];}}else(_y2=y).push.apply(_y2,_toConsumableArray(R.attributes.a_sourceRect));if(R.attributes.a_clipUV)if(v=!0,l){var _U5=R.attributes.a_clipUV;for(var _M6=0;_M6<_U5.length;_M6++){var _W4=_U5[_M6],_Y5=2*(E+_M6);T[_Y5]=_W4[0],T[_Y5+1]=_W4[1];}}else(_T2=T).push.apply(_T2,_toConsumableArray(R.attributes.a_clipUV));if(R.textureCoord)if(l){var _U6=R.textureCoord;for(var _M7=0;_M7<_U6.length;_M7++){var _W5=_U6[_M7],_Y6=3*(E+_M7);for(var _B2=0;_B2<_W5.length;_B2++)m[_Y6+_B2]=_W5[_B2];}}else(_m3=m).push.apply(_m3,_toConsumableArray(R.textureCoord));if(I){var _U7=Object.entries(I._attribute);for(var _M8=0;_M8<_U7.length;_M8++){var _p$_W;var _U7$_M=_slicedToArray(_U7[_M8],2),_W6=_U7$_M[0],_Y7=_U7$_M[1];if(_W6!=="a_color"&&_W6!=="a_sourceRect"&&_Y7!=="ignored")if(p[_W6]=[],l){p[_W6]=l[_W6];var _B3=R.attributes[_W6],N=_B3[0].length;for(var G=0;G<_B3.length;G++){var J=_B3[G],tt=N*(E+G);for(var at=0;at<J.length;at++)p[_W6][tt+at]=J[at];}}else(_p$_W=p[_W6]).push.apply(_p$_W,_toConsumableArray(R.attributes[_W6]));}}E+=R.positions.length,C+=R.cells.length;}}p.a_color=u,d&&y&&y.length>0&&(p.a_sourceRect=y);var S={positions:f,cells:h,attributes:p,uniforms:x,cellsCount:C*3,program:I};return m&&m.length&&(S.textureCoord=m),v&&T.length>0&&(p.a_clipUV=T),S;}},/* 29 *//***/function(i,e,t){t.r(e);var r=t(1),n=t(30),s=t(26),c=t(31);t(1).glMatrix.setMatrixArrayType(Array);function l(p,S){var A=Object.keys(p);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(p);S&&(R=R.filter(function(D){return Object.getOwnPropertyDescriptor(p,D).enumerable;})),A.push.apply(A,R);}return A;}function f(p){for(var S=1;S<arguments.length;S++){var A=arguments[S]!=null?arguments[S]:{};S%2?l(Object(A),!0).forEach(function(R){h(p,R,A[R]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(A)):l(Object(A)).forEach(function(R){Object.defineProperty(p,R,Object.getOwnPropertyDescriptor(A,R));});}return p;}function h(p,S,A){return S in p?Object.defineProperty(p,S,{value:A,enumerable:!0,configurable:!0,writable:!0}):p[S]=A,p;}var m=Symbol("mesh"),u=Symbol("count"),y=Symbol("blend"),T=Symbol("filter"),E=Symbol("textures"),C=Symbol("textureOptions"),x=Symbol("cloudColor"),I=Symbol("cloudFilter"),d=Symbol("buffer");function v(p){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var A=new Float32Array(3*p),R=new Float32Array(3*p),D=new Float32Array(4*p),U=new Float32Array(4*p),M=new Float32Array(4*p),W=new Float32Array(4*p),Y=new Float32Array(4*p),B=new Uint8Array(p),N=new Uint8Array(4*p),G=new Uint8Array(4*p);return S&&(A.set(S.transform0,0),R.set(S.transform1,0),D.set(S.color0,0),U.set(S.color1,0),M.set(S.color2,0),W.set(S.color3,0),Y.set(S.color4,0),B.set(S.frameIndex,0),N.set(S.fillColor,0),G.set(S.strokeColor,0)),{bufferSize:p,transform0:A,transform1:R,color0:D,color1:U,color2:M,color3:W,color4:Y,frameIndex:B,fillColor:N,strokeColor:G};}e["default"]=/*#__PURE__*/function(){function _class(p){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref35=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref35$buffer=_ref35.buffer,A=_ref35$buffer===void 0?1e3:_ref35$buffer;_classCallCheck(this,_class);A=Math.max(A,S),this[u]=S,this[m]=p,this[d]=v(A),this[E]=[],this[T]=[],this[x]=!1,this[I]=!1,this[y]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var p=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var S=this[u];for(var A=p;A<S;A++)this[d].transform0.set([1,0,0],A*3),this[d].transform1.set([0,1,0],A*3),this[d].frameIndex.set([-1],A),this[d].fillColor.set([0,0,0,0],A*4),this[d].strokeColor.set([0,0,0,0],A*4),this.setColorTransform(A,null);}},{key:"bufferSize",get:function get(){return this[d].bufferSize;}},{key:"mesh",get:function get(){return this[m];},set:function set(p){this[m]=p,this[E]&&this.setTextureFrames(this[E],this[C]);}},{key:"hasCloudColor",get:function get(){return this[x];}},{key:"hasCloudFilter",get:function get(){return this[I];}},{key:"_getFilter",value:function _getFilter(p){return this[T][p]=this[T][p]||[],this[T][p];}},{key:"getFilter",value:function getFilter(p){return this._getFilter(p).join(" ");}},{key:"enableBlend",get:function get(){return this[m].enableBlend||this[y];}},{key:"canIgnore",value:function canIgnore(){return this[m].canIgnore();}},{key:"delete",value:function _delete(p){if(p>=this[u]||p<0)throw new Error("Out of range.");var _this$d2=this[d],S=_this$d2.transform0,A=_this$d2.transform1,R=_this$d2.color0,D=_this$d2.color1,U=_this$d2.color2,M=_this$d2.color3,W=_this$d2.color4,Y=_this$d2.frameIndex,B=_this$d2.fillColor,N=_this$d2.strokeColor;S.set(S.subarray(3*(p+1)),3*p),A.set(A.subarray(3*(p+1)),3*p),R.set(R.subarray(4*(p+1)),4*p),D.set(D.subarray(4*(p+1)),4*p),U.set(U.subarray(4*(p+1)),4*p),M.set(M.subarray(4*(p+1)),4*p),W.set(W.subarray(4*(p+1)),4*p),Y.set(Y.subarray(p+1),p),B.set(B.subarray(4*(p+1)),4*p),N.set(N.subarray(4*(p+1)),4*p);for(var G in this[T])G===p?delete this[T][G]:G>p&&(this[T][G-1]=this[T][G],delete this[T][G]);this[u]--;}},{key:"setColorTransform",value:function setColorTransform(p,S){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=4;var _this$d3=this[d],A=_this$d3.color0,R=_this$d3.color1,D=_this$d3.color2,U=_this$d3.color3,M=_this$d3.color4;return S!=null?(A.set([S[0],S[5],S[10],S[15]],p),R.set([S[1],S[6],S[11],S[16]],p),D.set([S[2],S[7],S[12],S[17]],p),U.set([S[3],S[8],S[13],S[18]],p),M.set([S[4],S[9],S[14],S[19]],p),this[y]=this[y]||S[18]<1,this[I]=!0):(A.set([1,0,0,0],p),R.set([0,1,0,0],p),D.set([0,0,1,0],p),U.set([0,0,0,1],p),M.set([0,0,0,0],p)),this;}},{key:"getColorTransform",value:function getColorTransform(p){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=4;var _this$d4=this[d],S=_this$d4.color0,A=_this$d4.color1,R=_this$d4.color2,D=_this$d4.color3,U=_this$d4.color4;return[S[p],A[p],R[p],D[p],U[p],S[p+1],A[p+1],R[p+1],D[p+1],U[p+1],S[p+2],A[p+2],R[p+2],D[p+2],U[p+2],S[p+3],A[p+3],R[p+3],D[p+3],U[p+3]];}},{key:"transformColor",value:function transformColor(p,S){var A=this.getColorTransform(p);return A=Object(n.multiply)(A,S),this.setColorTransform(p,A),this;}},{key:"setFillColor",value:function setFillColor(p,S){if(p>=this[u]||p<0)throw new Error("Out of range.");typeof S=="string"&&(S=Object(c["default"])(S)),S[3]>0&&(this[x]=!0),this[d].fillColor.set(S.map(function(A){return Math.round(255*A);}),4*p);}},{key:"setStrokeColor",value:function setStrokeColor(p,S){if(p>=this[u]||p<0)throw new Error("Out of range.");typeof S=="string"&&(S=Object(c["default"])(S)),S[3]>0&&(this[x]=!0),this[d].strokeColor.set(S.map(function(A){return Math.round(255*A);}),4*p);}},{key:"getCloudRGBA",value:function getCloudRGBA(p){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=4;var _this$d5=this[d],S=_this$d5.fillColor,A=_this$d5.strokeColor,R=[S[p],S[p+1],S[p+2],S[p+3]],D=[A[p],A[p+1],A[p+2],A[p+3]];return R[3]/=255,D[3]/=255,{fill:"rgba(".concat(R.join(),")"),stroke:"rgba(".concat(D.join(),")")};}},{key:"grayscale",value:function grayscale(p,S){this.transformColor(p,Object(n.grayscale)(S)),this._getFilter(p).push("grayscale(".concat(100*S,"%)"));}},{key:"brightness",value:function brightness(p,S){this.transformColor(p,Object(n.brightness)(S)),this._getFilter(p).push("brightness(".concat(100*S,"%)"));}},{key:"saturate",value:function saturate(p,S){this.transformColor(p,Object(n.saturate)(S)),this._getFilter(p).push("saturate(".concat(100*S,"%)"));}},{key:"contrast",value:function contrast(p,S){this.transformColor(p,Object(n.contrast)(S)),this._getFilter(p).push("contrast(".concat(100*S,"%)"));}},{key:"invert",value:function invert(p,S){this.transformColor(p,Object(n.invert)(S)),this._getFilter(p).push("invert(".concat(100*S,"%)"));}},{key:"sepia",value:function sepia(p,S){this.transformColor(p,Object(n.sepia)(S)),this._getFilter(p).push("sepia(".concat(100*S,"%)"));}},{key:"opacity",value:function opacity(p,S){this.transformColor(p,Object(n.opacity)(S)),this._getFilter(p).push("opacity(".concat(100*S,"%)"));}},{key:"hueRotate",value:function hueRotate(p,S){this.transformColor(p,Object(n.hueRotate)(S)),this._getFilter(p).push("hue-rotate(".concat(S,"deg)"));}},{key:"setTransform",value:function setTransform(p,S){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=3,S==null&&(S=[1,0,0,1,0,0]);var _this$d6=this[d],A=_this$d6.transform0,R=_this$d6.transform1;return A.set([S[0],S[2],S[4]],p),R.set([S[1],S[3],S[5]],p),this;}},{key:"getTransform",value:function getTransform(p){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=3;var _this$d7=this[d],S=_this$d7.transform0,A=_this$d7.transform1;return[S[p],A[p],S[p+1],A[p+1],S[p+2],A[p+2]];}},{key:"getTextureFrame",value:function getTextureFrame(p){return this[E][this[d].frameIndex[p]];}},{key:"setTextureFrames",value:function setTextureFrames(){var p=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(p.length>12)throw new Error("Max frames exceed. Allow 12 frames.");p.length&&this[m].setTexture(p[0],S),this[E]=p,this[C]=S;}},{key:"setFrameIndex",value:function setFrameIndex(p,S){if(p>=this[u]||p<0)throw new Error("Out of range.");var A=this[E].length;if(A<=0)throw new Error("No frames");this[d].frameIndex[p]=S%A;}},{key:"amount",get:function get(){return this[u];},set:function set(p){var S=this[u];p!==S&&(p>this[d].bufferSize&&(this[d]=v(Math.max(p,this[d].bufferSize+1e3),this[d])),this[u]=p,p>S&&this.initBuffer(S));}},{key:"meshData",get:function get(){var _this$m$meshData=this[m].meshData,p=_this$m$meshData.attributes,S=_this$m$meshData.cells,A=_this$m$meshData.positions,R=_this$m$meshData.textureCoord,D=_this$m$meshData.uniforms,U=this[E],M={attributes:f({},p),cells:S,positions:A,textureCoord:R,uniforms:f({},D),instanceCount:this[u],enableBlend:this.enableBlend};U.length&&U.forEach(function(Q,ft){M.uniforms["u_texFrame".concat(ft)]=Q;});var _this$d8=this[d],W=_this$d8.transform0,Y=_this$d8.transform1,B=_this$d8.color0,N=_this$d8.color1,G=_this$d8.color2,J=_this$d8.color3,tt=_this$d8.color4,at=_this$d8.fillColor,ut=_this$d8.strokeColor,K=_this$d8.frameIndex;return this[m].uniforms.u_texSampler&&(M.attributes.a_frameIndex={data:K,divisor:1}),M.attributes.a_transform0={data:W,divisor:1},M.attributes.a_transform1={data:Y,divisor:1},M.attributes.a_colorCloud0={data:B,divisor:1},M.attributes.a_colorCloud1={data:N,divisor:1},M.attributes.a_colorCloud2={data:G,divisor:1},M.attributes.a_colorCloud3={data:J,divisor:1},M.attributes.a_colorCloud4={data:tt,divisor:1},this.hasCloudColor&&(M.attributes.a_fillCloudColor={data:at,divisor:1},M.attributes.a_strokeCloudColor={data:ut,divisor:1}),M;}},{key:"setProgram",value:function setProgram(p){this[m].setProgram(p);}},{key:"program",get:function get(){return this[m].program;}},{key:"transform",value:function transform(p,S){var A=this.getTransform(p);return S=r.mat2d.multiply(Array.of(0,0,0,0,0,0),A,S),this.setTransform(p,S),this;}},{key:"translate",value:function translate(p,_ref36){var _ref37=_slicedToArray(_ref36,2),S=_ref37[0],A=_ref37[1];var R=r.mat2d.create();return R=r.mat2d.translate(Array.of(0,0,0,0,0,0),R,[S,A]),this.transform(p,R);}},{key:"rotate",value:function rotate(p,S){var _ref38=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref39=_slicedToArray(_ref38,2),A=_ref39[0],R=_ref39[1];var D=r.mat2d.create();return D=r.mat2d.translate(Array.of(0,0,0,0,0,0),D,[A,R]),D=r.mat2d.rotate(Array.of(0,0,0,0,0,0),D,S),D=r.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-A,-R]),this.transform(p,D);}},{key:"scale",value:function scale(p,_ref40){var _ref41=_slicedToArray(_ref40,2),S=_ref41[0],_ref41$=_ref41[1],A=_ref41$===void 0?S:_ref41$;var _ref42=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref43=_slicedToArray(_ref42,2),R=_ref43[0],D=_ref43[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[R,D]),U=r.mat2d.scale(Array.of(0,0,0,0,0,0),U,[S,A]),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-R,-D]),this.transform(p,U);}},{key:"skew",value:function skew(p,_ref44){var _ref45=_slicedToArray(_ref44,2),S=_ref45[0],_ref45$=_ref45[1],A=_ref45$===void 0?S:_ref45$;var _ref46=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref47=_slicedToArray(_ref46,2),R=_ref47[0],D=_ref47[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[R,D]),U=r.mat2d.multiply(Array.of(0,0,0,0,0,0),U,r.mat2d.fromValues(1,Math.tan(A),Math.tan(S),1,0,0)),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-R,-D]),this.transform(p,U);}},{key:"isPointCollision",value:function isPointCollision(p,_ref48){var _this$m;var _ref49=_slicedToArray(_ref48,2),S=_ref49[0],A=_ref49[1];var R=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var D=this.getTransform(p),U=Object(s.transformPoint)([S,A],r.mat2d.invert(Array.of(0,0,0,0,0,0),D));return(_this$m=this[m]).isPointCollision.apply(_this$m,_toConsumableArray(U).concat([R]));}},{key:"isPointInFill",value:function isPointInFill(p,_ref50){var _ref51=_slicedToArray(_ref50,2),S=_ref51[0],A=_ref51[1];return this.isPointCollision(p,[S,A],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(p,_ref52){var _ref53=_slicedToArray(_ref52,2),S=_ref53[0],A=_ref53[1];return this.isPointCollision(p,[S,A],"stroke");}}]);}();},/* 30 *//***/function(i,e,t){t.r(e),t.d(e,"multiply",function(){return n;}),t.d(e,"grayscale",function(){return s;}),t.d(e,"brightness",function(){return c;}),t.d(e,"saturate",function(){return l;}),t.d(e,"contrast",function(){return f;}),t.d(e,"invert",function(){return h;}),t.d(e,"sepia",function(){return m;}),t.d(e,"opacity",function(){return u;}),t.d(e,"hueRotate",function(){return y;});var r=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(T,E){var C=[],x=T[0],I=T[1],d=T[2],v=T[3],p=T[4],S=T[5],A=T[6],R=T[7],D=T[8],U=T[9],M=T[10],W=T[11],Y=T[12],B=T[13],N=T[14],G=T[15],J=T[16],tt=T[17],at=T[18],ut=T[19];var K=E[0],Q=E[1],ft=E[2],gt=E[3],mt=E[4];return C[0]=K*x+Q*S+ft*M+gt*G,C[1]=K*I+Q*A+ft*W+gt*J,C[2]=K*d+Q*R+ft*Y+gt*tt,C[3]=K*v+Q*D+ft*B+gt*at,C[4]=K*p+Q*U+ft*N+gt*ut+mt,K=E[5],Q=E[6],ft=E[7],gt=E[8],mt=E[9],C[5]=K*x+Q*S+ft*M+gt*G,C[6]=K*I+Q*A+ft*W+gt*J,C[7]=K*d+Q*R+ft*Y+gt*tt,C[8]=K*v+Q*D+ft*B+gt*at,C[9]=K*p+Q*U+ft*N+gt*ut+mt,K=E[10],Q=E[11],ft=E[12],gt=E[13],mt=E[14],C[10]=K*x+Q*S+ft*M+gt*G,C[11]=K*I+Q*A+ft*W+gt*J,C[12]=K*d+Q*R+ft*Y+gt*tt,C[13]=K*v+Q*D+ft*B+gt*at,C[14]=K*p+Q*U+ft*N+gt*ut+mt,K=E[15],Q=E[16],ft=E[17],gt=E[18],mt=E[19],C[15]=K*x+Q*S+ft*M+gt*G,C[16]=K*I+Q*A+ft*W+gt*J,C[17]=K*d+Q*R+ft*Y+gt*tt,C[18]=K*v+Q*D+ft*B+gt*at,C[19]=K*p+Q*U+ft*N+gt*ut+mt,C;}function s(T){T=Object(r.clamp)(0,1,T);var E=0.2126*T,C=0.7152*T,x=0.0722*T;return[E+1-T,C,x,0,0,E,C+1-T,x,0,0,E,C,x+1-T,0,0,0,0,0,1,0];}function c(T){return[T,0,0,0,0,0,T,0,0,0,0,0,T,0,0,0,0,0,1,0];}function l(T){var E=0.2126*(1-T),C=0.7152*(1-T),x=0.0722*(1-T);return[E+T,C,x,0,0,E,C+T,x,0,0,E,C,x+T,0,0,0,0,0,1,0];}function f(T){var E=0.5*(1-T);return[T,0,0,0,E,0,T,0,0,E,0,0,T,0,E,0,0,0,1,0];}function h(T){var E=1-2*T;return[E,0,0,0,T,0,E,0,0,T,0,0,E,0,T,0,0,0,1,0];}function m(T){return[1-0.607*T,0.769*T,0.189*T,0,0,0.349*T,1-0.314*T,0.168*T,0,0,0.272*T,0.534*T,1-0.869*T,0,0,0,0,0,1,0];}function u(T){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,T,0];}function y(T){var E=T/180*Math.PI,C=Math.cos(E),x=Math.sin(E),I=0.2126,d=0.7152,v=0.0722;return[I+C*(1-I)+x*-I,d+C*-d+x*-d,v+C*-v+x*(1-v),0,0,I+C*-I+x*0.143,d+C*(1-d)+x*0.14,v+C*-v+x*-0.283,0,0,I+C*-I+x*-(1-I),d+C*-d+x*d,v+C*(1-v)+x*v,0,0,0,0,0,1,0];}},/* 31 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);function s(c){var l=n()(c);if(!l||!l.length)throw new TypeError("Invalid color value.");return[l[0]/255,l[1]/255,l[2]/255,l[3]];}},/* 32 *//***/function(i,e,t){var r=t(33),n=t(37),s=t(39);i.exports=function(l){var f,h=r(l);return h.space?(f=Array(3),f[0]=s(h.values[0],0,255),f[1]=s(h.values[1],0,255),f[2]=s(h.values[2],0,255),h.space[0]==="h"&&(f=n.rgb(f)),f.push(s(h.alpha,0,1)),f):[];};},/* 33 *//***/function(i,e,t){(function(r){var n=t(34),s=t(35),c=t(36);i.exports=f;var l={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function f(h){var m,u=[],y=1,T;if(typeof h=="string"){if(n[h])u=n[h].slice(),T="rgb";else if(h==="transparent")y=0,T="rgb",u=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(h)){var E=h.slice(1),C=E.length,x=C<=4;y=1,x?(u=[parseInt(E[0]+E[0],16),parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16)],C===4&&(y=parseInt(E[3]+E[3],16)/255)):(u=[parseInt(E[0]+E[1],16),parseInt(E[2]+E[3],16),parseInt(E[4]+E[5],16)],C===8&&(y=parseInt(E[6]+E[7],16)/255)),u[0]||(u[0]=0),u[1]||(u[1]=0),u[2]||(u[2]=0),T="rgb";}else if(m=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(h)){var I=m[1],d=I==="rgb",E=I.replace(/a$/,"");T=E;var C=E==="cmyk"?4:E==="gray"?1:3;u=m[2].trim().split(/\s*,\s*/).map(function(A,R){if(/%$/.test(A))return R===C?parseFloat(A)/100:E==="rgb"?parseFloat(A)*255/100:parseFloat(A);if(E[R]==="h"){if(/deg$/.test(A))return parseFloat(A);if(l[A]!==void 0)return l[A];}return parseFloat(A);}),I===E&&u.push(1),y=d||u[C]===void 0?1:u[C],u=u.slice(0,C);}else h.length>10&&/[0-9](?:\s|\/)/.test(h)&&(u=h.match(/([0-9]+)/g).map(function(p){return parseFloat(p);}),T=h.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(h))T="rgb",u=[h>>>16,(h&65280)>>>8,h&255];else if(s(h)){var v=c(h.r,h.red,h.R,null);v!==null?(T="rgb",u=[v,c(h.g,h.green,h.G),c(h.b,h.blue,h.B)]):(T="hsl",u=[c(h.h,h.hue,h.H),c(h.s,h.saturation,h.S),c(h.l,h.lightness,h.L,h.b,h.brightness)]),y=c(h.a,h.alpha,h.opacity,1),h.opacity!=null&&(y/=100);}else(Array.isArray(h)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(h))&&(u=[h[0],h[1],h[2]],T="rgb",y=h.length===4?h[3]:1);return{space:T,values:u,alpha:y};}}).call(this,t(22));},/* 34 *//***/function(i,e,t){i.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(i,e,t){var r=Object.prototype.toString;i.exports=function(n){var s;return r.call(n)==="[object Object]"&&(s=Object.getPrototypeOf(n),s===null||s===Object.getPrototypeOf({}));};},/* 36 *//***/function(i,e){i.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 *//***/function(i,e,t){var r=t(38);i.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var s=n[0]/360,c=n[1]/100,l=n[2]/100,f,h,m,u,y;if(c===0)return y=l*255,[y,y,y];l<0.5?h=l*(1+c):h=l+c-l*c,f=2*l-h,u=[0,0,0];for(var T=0;T<3;T++)m=s+0.3333333333333333*-(T-1),m<0?m++:m>1&&m--,6*m<1?y=f+(h-f)*6*m:2*m<1?y=h:3*m<2?y=f+(h-f)*(0.6666666666666666-m)*6:y=f,u[T]=y*255;return u;}},r.hsl=function(n){var s=n[0]/255,c=n[1]/255,l=n[2]/255,f=Math.min(s,c,l),h=Math.max(s,c,l),m=h-f,u,y,T;return h===f?u=0:s===h?u=(c-l)/m:c===h?u=2+(l-s)/m:l===h&&(u=4+(s-c)/m),u=Math.min(u*60,360),u<0&&(u+=360),T=(f+h)/2,h===f?y=0:T<=0.5?y=m/(h+f):y=m/(2-h-f),[u,y*100,T*100];};},/* 38 *//***/function(i,e,t){i.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 *//***/function(i,e){i.exports=t;function t(r,n,s){return n<s?r<n?n:r>s?s:r:r<s?s:r>n?n:r;}},/* 40 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return v;});var r=t(41),n=/* @__PURE__ */t.n(r),s=t(42),c=/* @__PURE__ */t.n(s),l=t(43),f=/* @__PURE__ */t.n(l),h=t(44),m=t(46),u=/* @__PURE__ */t.n(m),y=t(53),T=t(55);t(1).glMatrix.setMatrixArrayType(Array);var E=Symbol("contours"),C=Symbol("path"),x=Symbol("simplify"),I=Symbol("scale"),d=2*Math.PI;var v=/*#__PURE__*/function(){function v(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,v);typeof S=="string"&&(S={path:S}),S.path?this[C]=n()(S.path):this[C]=[],this[E]=null,this[x]=S.simplify!=null?S.simplify:0,this[I]=S.scale!=null?S.scale:2;}return _createClass(v,[{key:"contours",get:function get(){var S=null;if(!this[E]&&this[C]){var A=Object(h["default"])(f()(this[C]));this[E]=u()(A,this[I],this[x]),this[E].path=A,this[E].simplify=this[x],this[E].scale=this[I];}return this[E]&&(S=this[E].map(function(A){return _toConsumableArray(A);}),S.path=this[E].path,S.simplify=this[E].simplify,S.scale=this[E].scale),S;}},{key:"path",get:function get(){return this[C];}},{key:"simplify",get:function get(){return this[x];}},{key:"boundingBox",get:function get(){var S=this.contours;if(S&&S.length){var A=S.reduce(function(R,D){return[].concat(_toConsumableArray(R),_toConsumableArray(D));});return c()(A);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var S=this.boundingBox;return S?[0.5*(S[0][0]+S[1][0]),0.5*(S[0][1]+S[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$C;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var A=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var R=Object(h["default"])(f()(this[C])).map(function(_ref54){var _ref55=_toArray(_ref54),D=_ref55[0],U=_ref55.slice(1);var M=[D];for(var W=0;W<U.length;W+=2){var Y=U[W]-S,B=U[W+1]-A;M.push(Y,B);}return M;});return this.beginPath(),(_this$C=this[C]).push.apply(_this$C,_toConsumableArray(R)),this;}},{key:"getPointAtLength",value:function getPointAtLength(S){return this.contours?Object(y.getPointAtLength)(this[E],S):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(y.getTotalLength)(this[E]):0;}},{key:"addPath",value:function addPath(S){var _this$C2;this[E]=null,typeof S=="string"&&(S=n()(S)),(_this$C2=this[C]).push.apply(_this$C2,_toConsumableArray(S));}},{key:"beginPath",value:function beginPath(){this[C]=[],this[E]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(S,A,R,D,U,M,W){var Y=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(M+=U,W+=U,R<=0||D<=0||W===M)return;W<M&&(W=M+d+(W-M)%d),W-M>d&&(W=M+d);var B=W-M;B>=d&&(W-=1e-3);var N=this[C].length>0&&B<d?"L":"M";var G=Object(T.getPoint)(S,A,R,D,M),J=Object(T.getPoint)(S,A,R,D,W),tt=+!Y;var at=B>Math.PI?1:0;Y&&(at=1-at),N+=G.join(" "),N+="A".concat(R," ").concat(D," 0 ").concat(at," ").concat(tt," ").concat(J.join(" ")),B>=d&&(N+="Z"),this.addPath(N);}},{key:"arc",value:function arc(S,A,R,D,U){var M=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(S,A,R,R,0,D,U,M);}},{key:"arcTo",value:function arcTo(S,A,R,D,U,M,W){this[E]=null,this[C].push(["A",S,A,R,D,U,M,W]);}},{key:"moveTo",value:function moveTo(S,A){this[E]=null,this[C].push(["M",S,A]);}},{key:"lineTo",value:function lineTo(S,A){this[E]=null,this[C].push(["L",S,A]);}},{key:"bezierCurveTo",value:function bezierCurveTo(S,A,R,D,U,M){this[E]=null,this[C].push(["C",S,A,R,D,U,M]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(S,A,R,D){this[E]=null,this[C].push(["Q",S,A,R,D]);}},{key:"rect",value:function rect(S,A,R,D){var U="M".concat(S," ").concat(A,"L").concat(S+R," ").concat(A,"L").concat(S+R," ").concat(A+D,"L").concat(S," ").concat(A+D,"Z");this.addPath(U);}},{key:"closePath",value:function closePath(){this[E]=null;var S=[];var A=this[C].length;A>0&&(S=this[C][A-1]),S[0]!=="Z"&&S[0]!=="z"&&this[C].push(["Z"]);}}]);}();},/* 41 *//***/function(i,e){i.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(l){var f=[];return l.replace(r,function(h,m,u){var y=m.toLowerCase();for(u=c(u),y=="m"&&u.length>2&&(f.push([m].concat(u.splice(0,2))),y="l",m=m=="m"?"l":"L");;){if(u.length==t[y])return u.unshift(m),f.push(u);if(u.length<t[y])throw new Error("malformed path data");f.push([m].concat(u.splice(0,t[y])));}}),f;}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function c(l){var f=l.match(s);return f?f.map(Number):[];}},/* 42 *//***/function(i,e,t){i.exports=r;function r(n){var s=n.length;if(s===0)return[[],[]];for(var c=n[0].length,l=n[0].slice(),f=n[0].slice(),h=1;h<s;++h)for(var m=n[h],u=0;u<c;++u){var y=m[u];l[u]=Math.min(l[u],y),f[u]=Math.max(f[u],y);}return[l,f];}},/* 43 *//***/function(i,e){i.exports=t;function t(r){var n=0,s=0,c=0,l=0;return r.map(function(f){f=f.slice();var h=f[0],m=h.toUpperCase();if(h!=m)switch(f[0]=m,h){case"a":f[6]+=c,f[7]+=l;break;case"v":f[1]+=l;break;case"h":f[1]+=c;break;default:for(var u=1;u<f.length;)f[u++]+=c,f[u++]+=l;}switch(m){case"Z":c=n,l=s;break;case"H":c=f[1];break;case"V":l=f[1];break;case"M":c=n=f[1],l=s=f[2];break;default:c=f[f.length-2],l=f[f.length-1];}return f;});}},/* 44 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(l){for(var f,h=[],m=0,u=0,y=0,T=0,E=null,C=null,x=0,I=0,d=0,v=l.length;d<v;d++){var p=l[d],S=p[0];switch(S){case"M":y=p[1],T=p[2];break;case"A":var A=Object(r["default"])(x,I,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!A.length)continue;A=A.map(function(W){var _W7=_slicedToArray(W,8),Y=_W7[0],B=_W7[1],N=_W7[2],G=_W7[3],J=_W7[4],tt=_W7[5],at=_W7[6],ut=_W7[7];return{x1:N,y1:G,x2:J,y2:tt,x:at,y:ut};});for(var R=0,D;R<A.length;R++)D=A[R],p=["C",D.x1,D.y1,D.x2,D.y2,D.x,D.y],R<A.length-1&&h.push(p);break;case"S":var U=x,M=I;(f=="C"||f=="S")&&(U+=U-m,M+=M-u),p=["C",U,M,p[1],p[2],p[3],p[4]];break;case"T":f=="Q"||f=="T"?(E=x*2-E,C=I*2-C):(E=x,C=I),p=c(x,I,E,C,p[1],p[2]);break;case"Q":E=p[1],C=p[2],p=c(x,I,p[1],p[2],p[3],p[4]);break;case"L":p=s(x,I,p[1],p[2]);break;case"H":p=s(x,I,p[1],I);break;case"V":p=s(x,I,x,p[1]);break;case"Z":p=s(x,I,y,T);break;}f=S,x=p[p.length-2],I=p[p.length-1],p.length>4?(m=p[p.length-4],u=p[p.length-3]):(m=x,u=I),h.push(p);}return h;}function s(l,f,h,m){return["C",l,f,h,m,h,m];}function c(l,f,h,m,u,y){return["C",l/3+0.6666666666666666*h,f/3+0.6666666666666666*m,u/3+0.6666666666666666*h,y/3+0.6666666666666666*m,u,y];}},/* 45 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(f,h,m,u){var y=f*u-h*m<0?-1:1;var T=f*m+h*u;return T>1&&(T=1),T<-1&&(T=-1),y*Math.acos(T);}function s(f,h,m,u,y,T,E,C,x,I){var d=I*(f-m)/2+x*(h-u)/2,v=-x*(f-m)/2+I*(h-u)/2,p=E*E,S=C*C,A=d*d,R=v*v;var D=p*S-p*R-S*A;D<0&&(D=0),D/=p*R+S*A,D=Math.sqrt(D)*(y===T?-1:1);var U=D*E/C*v,M=D*-C/E*d,W=I*U-x*M+(f+m)/2,Y=x*U+I*M+(h+u)/2,B=(d-U)/E,N=(v-M)/C,G=(-d-U)/E,J=(-v-M)/C,tt=n(1,0,B,N);var at=n(B,N,G,J);return T===0&&at>0&&(at-=r),T===1&&at<0&&(at+=r),[W,Y,tt,at];}function c(f,h){var m=1.3333333333333333*Math.tan(h/4),u=Math.cos(f),y=Math.sin(f),T=Math.cos(f+h),E=Math.sin(f+h);return[u,y,u-y*m,y+u*m,T+E*m,E-T*m,T,E];}function l(f,h,m,u,y,T,E,C,x){var I=Math.sin(x*r/360),d=Math.cos(x*r/360),v=d*(f-m)/2+I*(h-u)/2,p=-I*(f-m)/2+d*(h-u)/2;if(v===0&&p===0)return[];if(E===0||C===0)return[];E=Math.abs(E),C=Math.abs(C);var S=v*v/(E*E)+p*p/(C*C);S>1&&(E*=Math.sqrt(S),C*=Math.sqrt(S));var A=s(f,h,m,u,y,T,E,C,I,d),R=[];var D=A[2],U=A[3];var M=Math.max(Math.ceil(Math.abs(U)/(r/4)),1);U/=M;for(var W=0;W<M;W++)R.push(c(D,U)),D+=U;return R.map(function(W){for(var Y=0;Y<W.length;Y+=2){var B=W[Y+0],N=W[Y+1];B*=E,N*=C;var G=d*B-I*N,J=I*B+d*N;W[Y+0]=G+A[0],W[Y+1]=J+A[1];}return W;});}},/* 46 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(47),_t2=t(49),n=_t2.copy,s=t(50);function c(u,y,T){return u[0]=y,u[1]=T,u;}var l=[0,0],f=[0,0],h=[0,0];function m(u,y,T,E){r(T,c(l,E[1],E[2]),c(f,E[3],E[4]),c(h,E[5],E[6]),y,u);}i.exports=function(y,T,E){var C=[],x=[],I=[0,0];return y.forEach(function(d,v,p){if(d[0]==="M")n(I,d.slice(1)),x.length>0&&(C.push(x),x=[]);else if(d[0]==="C")m(x,T,I,d),c(I,d[5],d[6]);else throw new Error("illegal type in SVG: "+d[0]);}),x.length>0&&C.push(x),C.map(function(d){return s(d,E||0);});};},/* 47 *//***/function(i,e,t){i.exports=t(48)();},/* 48 *//***/function(i,e){function t(n){return[n[0],n[1]];}function r(n,s){return[n,s];}i.exports=function(s){s=s||{};var c=typeof s.recursion=="number"?s.recursion:8,l=typeof s.epsilon=="number"?s.epsilon:11920929e-14,f=typeof s.pathEpsilon=="number"?s.pathEpsilon:1,h=typeof s.angleEpsilon=="number"?s.angleEpsilon:0.01,m=s.angleTolerance||0,u=s.cuspLimit||0;return function(C,x,I,d,v,p){p||(p=[]),v=typeof v=="number"?v:1;var S=f/v;return S*=S,y(C,x,I,d,p,S),p;};function y(E,C,x,I,d,v){d.push(t(E));var p=E[0],S=E[1],A=C[0],R=C[1],D=x[0],U=x[1],M=I[0],W=I[1];T(p,S,A,R,D,U,M,W,d,v,0),d.push(t(I));}function T(E,C,x,I,d,v,p,S,A,R,D){if(!(D>c)){var U=Math.PI,M=(E+x)/2,W=(C+I)/2,Y=(x+d)/2,B=(I+v)/2,N=(d+p)/2,G=(v+S)/2,J=(M+Y)/2,tt=(W+B)/2,at=(Y+N)/2,ut=(B+G)/2,K=(J+at)/2,Q=(tt+ut)/2;if(D>0){var ft=p-E,gt=S-C,mt=Math.abs((x-p)*gt-(I-S)*ft),wt=Math.abs((d-p)*gt-(v-S)*ft),ht,Nt;if(mt>l&&wt>l){if((mt+wt)*(mt+wt)<=R*(ft*ft+gt*gt)){if(m<h){A.push(r(K,Q));return;}var Rt=Math.atan2(v-I,d-x);if(ht=Math.abs(Rt-Math.atan2(I-C,x-E)),Nt=Math.abs(Math.atan2(S-v,p-d)-Rt),ht>=U&&(ht=2*U-ht),Nt>=U&&(Nt=2*U-Nt),ht+Nt<m){A.push(r(K,Q));return;}if(u!==0){if(ht>u){A.push(r(x,I));return;}if(Nt>u){A.push(r(d,v));return;}}}}else if(mt>l){if(mt*mt<=R*(ft*ft+gt*gt)){if(m<h){A.push(r(K,Q));return;}if(ht=Math.abs(Math.atan2(v-I,d-x)-Math.atan2(I-C,x-E)),ht>=U&&(ht=2*U-ht),ht<m){A.push(r(x,I)),A.push(r(d,v));return;}if(u!==0&&ht>u){A.push(r(x,I));return;}}}else if(wt>l){if(wt*wt<=R*(ft*ft+gt*gt)){if(m<h){A.push(r(K,Q));return;}if(ht=Math.abs(Math.atan2(S-v,p-d)-Math.atan2(v-I,d-x)),ht>=U&&(ht=2*U-ht),ht<m){A.push(r(x,I)),A.push(r(d,v));return;}if(u!==0&&ht>u){A.push(r(d,v));return;}}}else if(ft=K-(E+p)/2,gt=Q-(C+S)/2,ft*ft+gt*gt<=R){A.push(r(K,Q));return;}}T(E,C,M,W,J,tt,K,Q,A,R,D+1),T(K,Q,at,ut,N,G,p,S,A,R,D+1);}}};},/* 49 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return s;}),t.d(e,"clone",function(){return n;}),t.d(e,"copy",function(){return c;}),t.d(e,"scaleAndAdd",function(){return l;}),t.d(e,"dot",function(){return f;}),t.d(e,"rotate",function(){return h;}),t.d(e,"cross",function(){return m;}),t.d(e,"sub",function(){return u;}),t.d(e,"add",function(){return y;}),t.d(e,"computeMiter",function(){return x;}),t.d(e,"normal",function(){return I;}),t.d(e,"direction",function(){return d;});var r=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(v){return[v[0],v[1]];}function s(){return[0,0];}var c=r.vec2.copy,l=r.vec2.scaleAndAdd,f=r.vec2.dot,h=r.vec2.rotate,m=r.vec2.cross,u=r.vec2.sub,y=r.vec2.add,T=r.vec2.normalize,E=r.vec2.set,C=s();function x(v,p,S,A,R){y(v,S,A),T(v,v),E(p,-v[1],v[0]),E(C,-S[1],S[0]);var D=R/f(p,C);return Math.abs(D);}function I(v,p){return E(v,-p[1],p[0]),v;}function d(v,p,S){return u(v,p,S),T(v,v),v;}},/* 50 *//***/function(i,e,t){var r=t(51),n=t(52);i.exports=function(c,l){return c=r(c,l),c=n(c,l),c;},i.exports.radialDistance=r,i.exports.douglasPeucker=n;},/* 51 *//***/function(i,e){function t(r,n){var s=r[0]-n[0],c=r[1]-n[1];return s*s+c*c;}i.exports=function(n,s){if(n.length<=1)return n;s=typeof s=="number"?s:1;for(var c=s*s,l=n[0],f=[l],h,m=1,u=n.length;m<u;m++)h=n[m],t(h,l)>c&&(f.push(h),l=h);return l!==h&&f.push(h),f;};},/* 52 *//***/function(i,e){function t(n,s,c){var l=s[0],f=s[1],h=c[0]-l,m=c[1]-f;if(h!==0||m!==0){var u=((n[0]-l)*h+(n[1]-f)*m)/(h*h+m*m);u>1?(l=c[0],f=c[1]):u>0&&(l+=h*u,f+=m*u);}return h=n[0]-l,m=n[1]-f,h*h+m*m;}function r(n,s,c,l,f){for(var h=l,m,u=s+1;u<c;u++){var y=t(n[u],n[s],n[c]);y>h&&(m=u,h=y);}h>l&&(m-s>1&&r(n,s,m,l,f),f.push(n[m]),c-m>1&&r(n,m,c,l,f));}i.exports=function(s,c){if(s.length<=1)return s;c=typeof c=="number"?c:1;var l=c*c,f=s.length-1,h=[s[0]];return r(s,0,f,l,h),h.push(s[f]),h;};},/* 53 *//***/function(i,e,t){t.r(e),t.d(e,"getTotalLength",function(){return n;}),t.d(e,"getPointAtLength",function(){return c;}),t.d(e,"getDashContours",function(){return l;});var r=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(f){if(f.totalLength!=null)return f.totalLength;var h=0;return f.forEach(function(m){var u=m[0];for(var y=1;y<m.length;y++){var T=m[y];h+=Object(r.distance)(u,T),u=T;}}),f.totalLength=h,h;}function s(f,h){var m=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(h=Number(h),!Number.isFinite(h))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(h<=0)throw new TypeError("Length must > 0");var u=n(f);if(h>=u){var T=f[f.length-1],E=T[T.length-2],C=T[T.length-1],x=Math.atan2(C[1]-E[1],C[0]-E[0]);return{current:f.map(function(I){return _toConsumableArray(I);}),point:{x:C[0],y:C[1],angle:x}};}var y=[];for(var _T3=0;_T3<f.length;_T3++){y[_T3]=[];var _E2=f[_T3];var _C3=_E2[0];for(var _x12=1;_x12<_E2.length;_x12++){var _I9=_E2[_x12],_d9=Object(r.distance)(_C3,_I9);if(h<_d9){var v=h/_d9,p=Math.atan2(_I9[1]-_C3[1],_I9[0]-_C3[0]),S={x:_C3[0]*(1-v)+_I9[0]*v,y:_C3[1]*(1-v)+_I9[1]*v,angle:p};if(y[_T3].push(_C3),h>0&&y[_T3].push([S.x,S.y]),!m)return{current:y,point:S};var A=[],R=_T3;for(;_T3<f.length;_T3++){for(A[_T3-R]=[],_T3===R&&A[0].push([S.x,S.y]);_x12<_E2.length;_x12++)A[_T3-R].push(_E2[_x12]);_x12=0;}return{current:y,point:S,rest:A};}h-=_d9,y[_T3].push(_C3),_C3=_I9;}}}function c(f,h){if(h=Number(h),!Number.isFinite(h))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(f.length<=0)return{x:0,y:0,angle:0};if(h<=0){var m=f[0][0],u=f[0][1],y=Math.atan2(u[1]-m[1],u[0]-m[0]);return{x:m[0],y:m[1],angle:y};}return s(f,h,!1).point;}function l(f,h,m){var u=0,y=h[0],T=f;var E=[],C=h.length;if(m>0){do m-=h[u%C],u++;while(m>0);m<0&&(y=-m,u--);}else if(m<0){u=-1;do m+=h[u%C+C-1],u--;while(m<0);m>=0&&(u++,y=h[u%C+C-1]-m);}do{var x=s(T,y);T=x.rest,++u%2&&E.push.apply(E,_toConsumableArray(x.current));var _I10=u%C;_I10<0&&(_I10+=C),y=h[_I10];}while(T);return E;}},/* 54 *//***/function(i,e,t){t.r(e),t.d(e,"normalize",function(){return r;}),t.d(e,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(_ref56,f,h,m){var _ref57=_slicedToArray(_ref56,3),s=_ref57[0],c=_ref57[1],l=_ref57[2];return s=s*2/f-1,c=1-c*2/h,Number.isFinite(m)?(l=l*2/m-1,[s,c,l]):[s,c];}function n(_ref58,_ref59){var _ref60=_slicedToArray(_ref58,3),s=_ref60[0],c=_ref60[1],_ref60$=_ref60[2],l=_ref60$===void 0?0:_ref60$;var _ref61=_slicedToArray(_ref59,3),f=_ref61[0],h=_ref61[1],_ref61$=_ref61[2],m=_ref61$===void 0?0:_ref61$;return Math.hypot(f-s,h-c,m-l);}},/* 55 *//***/function(i,e,t){t.r(e),t.d(e,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(s,c,l,f,h){h%=r,h<0&&(h+=r);var m=Math.tan(h);if(Math.abs(m)<1e5){var u=c-m*s,y=1/Math.pow(l,2)+Math.pow(m,2)/Math.pow(f,2);var T=-1;(h<=Math.PI/2||h>3*Math.PI/2)&&(T=1);var E=T*Math.sqrt(1/y)+s,C=m*E+u;return[E,C];}return h<Math.PI?[s,c+f]:[s,c-f];}},/* 56 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return q;});var r=t(1),n=t(42),s=/* @__PURE__ */t.n(n),c=t(57),l=t(28),f=t(24),h=t(30),m=t(59),u=t(53),y=t(60),T=/* @__PURE__ */t.n(y),E=t(46),C=/* @__PURE__ */t.n(E),x=t(31),I=t(40),d=t(21);t(1).glMatrix.setMatrixArrayType(Array);function v(nt,j){if(nt==null)return{};var Z=p(nt,j),O,L;if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(nt);for(L=0;L<$.length;L++)O=$[L],!(j.indexOf(O)>=0)&&Object.prototype.propertyIsEnumerable.call(nt,O)&&(Z[O]=nt[O]);}return Z;}function p(nt,j){if(nt==null)return{};var Z={},O=Object.keys(nt),L,$;for($=0;$<O.length;$++)L=O[$],!(j.indexOf(L)>=0)&&(Z[L]=nt[L]);return Z;}var S=Symbol("mesh"),A=Symbol("contours"),R=Symbol("stroke"),D=Symbol("fill"),U=Symbol("strokeColor"),M=Symbol("fillColor"),W=Symbol("transform"),Y=Symbol("invertTransform"),B=Symbol("uniforms"),N=Symbol("texOptions"),G=Symbol("blend"),J=Symbol("applyTexture"),tt=Symbol("applyTransform"),at=Symbol("applyGradientTransform"),ut=Symbol("applyProgram"),K=Symbol("gradient"),Q=Symbol("filter"),ft=Symbol("opacity"),gt=Symbol("program"),mt=Symbol("attributes"),wt=Symbol("pass"),ht=Symbol("clipContext"),Nt=Symbol("applyClipPath");function Rt(nt,j){var Z=nt[1][0]-nt[0][0],O=nt[1][1]-nt[0][1],L=[];for(var $=0;$<j.length;$++){var V=j[$],rt=[(V[0]-nt[0][0])/Z,1-(V[1]-nt[0][1])/O];L.push(rt);}return L;}function X(_ref62,_ref63,_ref64){var _ref65=_slicedToArray(_ref62,2),nt=_ref65[0],j=_ref65[1];var _ref66=_slicedToArray(_ref63,4),Z=_ref66[0],O=_ref66[1],L=_ref66[2],$=_ref66[3];var V=_ref64.scale;return V||(nt/=L,j=1-j/$,nt-=Z,j+=O),[nt,j,0];}function z(nt,j,Z){var O=C()(nt,j,Z);return O.path=nt,O.simplify=Z,O.scale=j,O;}var q=/*#__PURE__*/function(){function q(j){_classCallCheck(this,q);this[R]=null,this[D]=null,this[W]=[1,0,0,1,0,0],this[ft]=1,this[B]={},this[Q]=[],this[G]=null,this[N]={},this.contours=j.contours,this[gt]=null,this[mt]={},this[wt]=[];}return _createClass(q,[{key:"contours",get:function get(){return this[A];},set:function set(j){this[S]=null,this[A]=j;var Z=j.scale;this.transformScale/Z>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(j){this[gt]=j,this[S]&&this[ut](j);}},{key:"program",get:function get(){return this[gt];}},{key:"setAttribute",value:function setAttribute(j,Z){Z==null?delete this[mt][j]:this[mt][j]=Z;}},{key:"getOpacity",value:function getOpacity(){return this[ft];}},{key:"setOpacity",value:function setOpacity(j){if(j<0||j>1)throw new TypeError("Invalid opacity value.");this[S]&&this[S].positions.forEach(function(Z){Z[2]=1/Z[2]>0?j:-j;}),this[ft]=j;}},{key:"setClipPath",value:function setClipPath(j){this.clipPath=j,this[B].u_clipSampler&&this[B].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[S]&&delete this[S].attributes.a_clipUV,j&&this[S]&&this[Nt]();}},{key:Nt,value:function value(){if(this.clipPath){this[ht]||(this[ht]=d["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),j=_this$boundingBox$[0],Z=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),O=_this$boundingBox$2[0],L=_this$boundingBox$2[1];O&&L&&(this[ht].width=O-j,this[ht].height=L-Z);var $=this[ht].getContext("2d"),V=new Path2D(this.clipPath);$.clearRect(0,0,this[ht].width,this[ht].height),$.save(),$.translate(-j,-Z),$.fillStyle="white",$.fill(V),$.restore(),this[S].clipPath=this[ht];var rt=Rt(this.boundingBox,this[S].position0);this[S].attributes.a_clipUV=rt;}}},{key:"getPointAtLength",value:function getPointAtLength(j){return Object(u.getPointAtLength)(this[A],j);}},{key:"getTotalLength",value:function getTotalLength(){return Object(u.getTotalLength)(this[A]);}},{key:"blend",get:function get(){return this[G]==null?"auto":this[G];},set:function set(j){this[G]=j,this[S]&&(this[S].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[S]&&this[S].boundingBox)return this[S].boundingBox;var j=this.meshData;if(j){var Z=j.position0;if(Z.length)j.boundingBox=s()(Z);else return[[0,0],[0,0]];return j.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var j=this.boundingBox;return j?[0.5*(j[0][0]+j[1][0]),0.5*(j[0][1]+j[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[D]?this[D].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[R]?this[R].lineWidth:0;}},{key:"lineCap",get:function get(){return this[R]?this[R].lineCap:"";}},{key:"lineJoin",get:function get(){return this[R]?this[R].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[R]?this[R].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[U]&&this[U][3]!==0?Object(f["default"])(this[U]):"";}},{key:"lineDash",get:function get(){return this[R]?this[R].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[R]?this[R].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[M]&&this[M][3]!==0?Object(f["default"])(this[M]):"";}},{key:"gradient",get:function get(){return this[K];}},{key:"texture",get:function get(){return this[B].u_texSampler?{image:this[B].u_texSampler._img,options:this[N]}:null;}},{key:"enableBlend",get:function get(){return this[G]===!0||this[G]===!1?this[G]:this[ft]<1||this[U]!=null&&this[U][3]<1||this[M]!=null&&this[M][3]<1||this[B].u_colorMatrix!=null&&this[B].u_colorMatrix[18]<1||this[B].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[Q].join(" ");}},{key:"transformMatrix",get:function get(){return this[W];}},{key:"invertMatrix",get:function get(){if(!this[Y]){var j=r.mat2d.invert(Array.of(0,0,0,0,0,0),this[W]);this[Y]=j;}return this[Y];}},{key:"transformScale",get:function get(){var j=this[W];return Math.max(Math.hypot(j[0],j[1]),Math.hypot(j[2],j[3]));}},{key:"uniforms",get:function get(){return this[B];}},{key:"pass",get:function get(){return this[wt];}},{key:ut,value:function value(j){var Z=this[mt],O=this[S].position0,L=Object.entries(j._attribute);for(var $=0;$<L.length;$++){var _L$$=_slicedToArray(L[$],2),V=_L$$[0],rt=_L$$[1];if(V!=="a_color"&&V!=="a_sourceRect"&&rt!=="ignored"){var it=Z[V];if(V==="uv"&&!it){var ct=this[S].boundingBox||s()(O);this[S].attributes[V]=Rt(ct,O);}else{this[S].attributes[V]=[];for(var _ct=0;_ct<O.length;_ct++){var St=O[_ct];this[S].attributes[V].push(it?it(St,$,O):Array(rt.size).fill(0));}}}}}// {stroke, fill}
17
+ },{key:"meshData",get:function get(){var _this7=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[S]){!this[D]&&!this[R]&&this.setFill();var j=this[A],Z={};if(j&&j.length){if(this[D])try{var $=T()(j,this[D]);$.positions=$.positions.map(function(V){return V.push(_this7[ft]),V;}),$.attributes={a_color:Array.from({length:$.positions.length}).map(function(){return _this7[M].map(function(V){return Math.round(255*V);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
18
+ },Z.fill=$;}catch(_unused3){}if(this[R]){var _$=this[R].lineDash;var V=j;if(_$){var it=this[R].lineDashOffset;V=Object(u.getDashContours)(j,_$,it);}var rt=V.map(function(it,ct){var St=it.length>1&&r.vec2.equals(it[0],it[it.length-1]),Ct=_this7[R].build(it,St);return T()([Ct]);});rt.forEach(function(it){it.positions=it.positions.map(function(ct){return ct.push(-_this7[ft]),ct;}),it.attributes={a_color:Array.from({length:it.positions.length}).map(function(){return _this7[U].map(function(ct){return Math.round(255*ct);});})};}),Z.stroke=Object(l["default"])(rt);}}var O=Object(l["default"])([Z.fill,Z.stroke]);O.fillPointCount=Z.fill?Z.fill.positions.length:0,O.enableBlend=this.enableBlend,O.position0=O.positions.map(function(_ref67){var _ref68=_slicedToArray(_ref67,3),$=_ref68[0],V=_ref68[1],rt=_ref68[2];return[$,V,rt];}),O.uniforms=this[B],this[S]=O,this[B].u_texSampler&&this[J](O,this[N]);var L=this[W];Object(m.isUnitTransform)(L)||(this[tt](O,L),this[B].u_radialGradientVector&&this[at]()),this.clipPath&&this[Nt](),this[gt]&&this[ut](this[gt]);}return this._updateMatrix&&(this[S].matrix=this[W],this[tt](this[S],this[W]),this[B].u_radialGradientVector&&this[at]()),this[S];}},{key:tt,value:function value(j,Z){var O=j.positions,L=j.position0;for(var $=0;$<O.length;$++){var _L$$2=_slicedToArray(L[$],2),V=_L$$2[0],rt=_L$$2[1],it=O[$];it[0]=V*Z[0]+rt*Z[2]+Z[4],it[1]=V*Z[1]+rt*Z[3]+Z[5];}this._updateMatrix=!1;}},{key:at,value:function value(){var j=this[W],Z=_toConsumableArray(this._radialGradientVector);if(Z){var _Z=_slicedToArray(Z,5),O=_Z[0],L=_Z[1],$=_Z[3],V=_Z[4];Z[0]=O*j[0]+L*j[2]+j[4],Z[1]=O*j[1]+L*j[3]+j[5],Z[3]=$*j[0]+V*j[2]+j[4],Z[4]=$*j[1]+V*j[3]+j[5],this[B].u_radialGradientVector=Z;}}},{key:J,value:function value(j,Z){function O(ct,St){return ct==null&&St==null?!0:ct==null||St==null?!1:ct[0]===St[0]&&ct[1]===St[1]&&ct[2]===St[2]&&ct[3]===St[3];}var L=this[B].u_texSampler;if(!L)return;var _L$_img=L._img,$=_L$_img.width,V=_L$_img.height,rt=Z.srcRect;var it=Z.rect||[0,0];if(Z.rotated&&(it=[-it[1],it[0],it[3],it[2]]),it[2]==null&&(it[2]=rt?rt[2]:$),it[3]==null&&(it[3]=rt?rt[3]:V),Z.hidden)j.textureCoord=j.positions.map(function(){return[-1,-1,-1];});else if(!j.textureCoord||!O(this[N].rect,Z.rect)||this[N].hidden!==Z.hidden||this[N].rotated!==Z.rotated){var ct=null;Z.rotated&&(ct=r.mat2d.rotate(Array.of(0,0,0,0,0,0),r.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),ct=r.mat2d.translate(Array.of(0,0,0,0,0,0),ct,[0,-it[2]])),j.textureCoord=j.position0.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),St=_ref70[0],Ct=_ref70[1],Mt=_ref70[2];if(1/Mt>0){if(Z.rotated){var At=St*ct[0]+Ct*ct[2]+ct[4],Ot=St*ct[1]+Ct*ct[3]+ct[5];St=At;Ct=Ot;}var Dt=X([St,Ct],[it[0]/it[2],it[1]/it[3],it[2],it[3]],Z);return Z.repeat&&(Dt[2]=1),Dt;}return[-1,-1,-1];});}if(rt){var _ct2=[rt[0]/$,rt[1]/V,rt[2]/$,rt[3]/V];j.attributes.a_sourceRect=j.positions.map(function(){return[].concat(_ct2);});}else j.attributes.a_sourceRect=j.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(j){if(!this.contours)return;if(this.contours.path){var O=this.contours.simplify,L=z(this.contours.path,2*j,O);this[S]=null,this[A]=L;}}},{key:"canIgnore",value:function canIgnore(){var j=this[R]==null||this[R].lineWidth===0||this[U][3]===0,Z=this[D]==null||this[M][3]===0,O=this[B].u_radialGradientVector==null,L=this[B].u_texSampler==null;return this[ft]===0||this[gt]==null&&j&&Z&&O&&L&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
19
+ // cap: 'butt' or 'square'
20
+ // lineDash: null
21
+ // lineDashOffset: 0
22
+ },{key:"setStroke",value:function setStroke(){var _ref71=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref71$thickness=_ref71.thickness,j=_ref71$thickness===void 0?1:_ref71$thickness,_ref71$cap=_ref71.cap,Z=_ref71$cap===void 0?"butt":_ref71$cap,_ref71$join=_ref71.join,O=_ref71$join===void 0?"miter":_ref71$join,_ref71$miterLimit=_ref71.miterLimit,L=_ref71$miterLimit===void 0?10:_ref71$miterLimit,_ref71$color=_ref71.color,$=_ref71$color===void 0?[0,0,0,0]:_ref71$color,_ref71$lineDash=_ref71.lineDash,V=_ref71$lineDash===void 0?null:_ref71$lineDash,_ref71$lineDashOffset=_ref71.lineDashOffset,rt=_ref71$lineDashOffset===void 0?0:_ref71$lineDashOffset,_ref71$roundSegments=_ref71.roundSegments,it=_ref71$roundSegments===void 0?20:_ref71$roundSegments;return this[S]=null,this[R]=new c["default"]({lineWidth:j,lineCap:Z,lineJoin:O,miterLimit:L,roundSegments:it}),typeof $=="string"&&($=Object(x["default"])($)),this[U]=$,this[R].lineDash=V,this[R].lineDashOffset=rt,this;}},{key:"setFill",value:function setFill(){var _ref72=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref72$rule=_ref72.rule,j=_ref72$rule===void 0?this.fillRule:_ref72$rule,_ref72$color=_ref72.color,Z=_ref72$color===void 0?[0,0,0,0]:_ref72$color;return this[S]=null,this[D]={rule:j},typeof Z=="string"&&(Z=Object(x["default"])(Z)),this[M]=Z,this;}/**
23
+ options: {
24
+ scale: false,
25
+ repeat: false,
26
+ rotated: false,
27
+ rect: [10, 10],
28
+ srcRect: [...],
29
+ hidden: false,
30
+ }
31
+ */},{key:"setTexture",value:function setTexture(j){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(j&&j.image){var _j=j,O=_j.image,L=_j.rect;if(j=O,Z.rect)for(var $=0;$<Z.rect.length;$++)L[$]=Z.rect[$];Z.rect=L;}return this[D]||this.setFill(),this.setUniforms({u_texSampler:j}),this[S]&&this[J](this[S],Z),this[N]=Z,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref73.vector,Z=_ref73.colors,_ref73$type=_ref73.type,O=_ref73$type===void 0?"fill":_ref73$type;if(j.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:j,colors:Z,type:O});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref74.vector,Z=_ref74.colors,_ref74$type=_ref74.type,O=_ref74$type===void 0?"fill":_ref74$type;if(j.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:j,colors:Z,type:O});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref75.vector,Z=_ref75.colors,_ref75$type=_ref75.type,O=_ref75$type===void 0?"fill":_ref75$type;if(j.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:j,colors:Z,type:O});}/**
32
+ vector: [x0, y0, r0, x1, y1, r1],
33
+ colors: [{offset:0, color}, {offset:1, color}, ...],
34
+ */},{key:"setGradient",value:function setGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},j=_ref76.vector,Z=_ref76.colors,_ref76$type=_ref76.type,O=_ref76$type===void 0?"fill":_ref76$type;Z=Z.map(function(_ref77){var V=_ref77.offset,rt=_ref77.color;return typeof rt=="string"&&(rt=Object(x["default"])(rt)),{offset:V,color:rt};}),this[K]=this[K]||{},this[K][O]={vector:j,colors:Z},Z.sort(function(V,rt){return V.offset-rt.offset;});var L=[];Z.forEach(function(_ref78){var V=_ref78.offset,rt=_ref78.color;L.push.apply(L,[V].concat(_toConsumableArray(rt)));});var $;if(j.length===4?$=[j[0],j[1],0,j[2],j[3],0]:$=_toConsumableArray(j),L.length<40&&L.push(-1),L.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=$,this[B].u_colorSteps=L,O==="fill"?this[B].u_gradientType=1:this[B].u_gradientType=0,this[at](),this;}},{key:"setUniforms",value:function setUniforms(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[B],j),this;}},{key:"setTransform",value:function setTransform(){var Z=this[W];for(var _len3=arguments.length,j=new Array(_len3),_key3=0;_key3<_len3;_key3++){j[_key3]=arguments[_key3];}return r.mat2d.equals(j,Z)||(this[W]=j,delete this[Y],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var Z=this[W];for(var _len4=arguments.length,j=new Array(_len4),_key4=0;_key4<_len4;_key4++){j[_key4]=arguments[_key4];}return this[W]=r.mat2d.multiply(Array.of(0,0,0,0,0,0),Z,j),delete this[Y],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(j,Z){var O=r.mat2d.create();return O=r.mat2d.translate(Array.of(0,0,0,0,0,0),O,[j,Z]),this.transform.apply(this,_toConsumableArray(O));}},{key:"rotate",value:function rotate(j){var _ref79=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref80=_slicedToArray(_ref79,2),Z=_ref80[0],O=_ref80[1];var L=r.mat2d.create();return L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[Z,O]),L=r.mat2d.rotate(Array.of(0,0,0,0,0,0),L,j),L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[-Z,-O]),this.transform.apply(this,_toConsumableArray(L));}},{key:"scale",value:function scale(j){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:j;var _ref81=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref82=_slicedToArray(_ref81,2),O=_ref82[0],L=_ref82[1];var $=r.mat2d.create();return $=r.mat2d.translate(Array.of(0,0,0,0,0,0),$,[O,L]),$=r.mat2d.scale(Array.of(0,0,0,0,0,0),$,[j,Z]),$=r.mat2d.translate(Array.of(0,0,0,0,0,0),$,[-O,-L]),this.transform.apply(this,_toConsumableArray($));}},{key:"skew",value:function skew(j){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:j;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),O=_ref84[0],L=_ref84[1];var $=r.mat2d.create();return $=r.mat2d.translate(Array.of(0,0,0,0,0,0),$,[O,L]),$=r.mat2d.multiply(Array.of(0,0,0,0,0,0),$,r.mat2d.fromValues(1,Math.tan(Z),Math.tan(j),1,0,0)),$=r.mat2d.translate(Array.of(0,0,0,0,0,0),$,[-O,-L]),this.transform.apply(this,_toConsumableArray($));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[Q].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,j=new Array(_len5),_key5=0;_key5<_len5;_key5++){j[_key5]=arguments[_key5];}return j[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:j}),this;}// apply linear color transform
35
+ },{key:"transformColor",value:function transformColor(){var Z=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,j=new Array(_len6),_key6=0;_key6<_len6;_key6++){j[_key6]=arguments[_key6];}return Z?Z=Object(h.multiply)(Z,j):Z=j,this.setColorTransform.apply(this,_toConsumableArray(Z)),this;}},{key:"blur",value:function blur(j){return this[Q].push("blur(".concat(j,"px)")),this;}},{key:"brightness",value:function brightness(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("brightness(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.brightness)(j)));}},{key:"contrast",value:function contrast(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("contrast(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.contrast)(j)));}},{key:"dropShadow",value:function dropShadow(j,Z){var O=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var L=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(L)&&(L=Object(f["default"])(L)),this[Q].push("drop-shadow(".concat(j,"px ").concat(Z,"px ").concat(O,"px ").concat(L,")")),this;}},{key:"grayscale",value:function grayscale(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("grayscale(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.grayscale)(j)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
36
+ },{key:"hueRotate",value:function hueRotate(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[Q].push("hue-rotate(".concat(j,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(h.hueRotate)(j)));}},{key:"invert",value:function invert(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("invert(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.invert)(j)));}},{key:"opacity",value:function opacity(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("opacity(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.opacity)(j)));}},{key:"saturate",value:function saturate(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("saturate(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.saturate)(j)));}},{key:"sepia",value:function sepia(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("sepia(".concat(100*j,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.sepia)(j)));}},{key:"url",value:function url(j){return this[Q].push("url(".concat(j,")")),this;}},{key:"isPointCollision",value:function isPointCollision(j,Z){var O=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var L=this.meshData,$=L.positions,V=L.cells,rt=this.invertMatrix,it=rt[0]*j+rt[2]*Z+rt[4],ct=rt[1]*j+rt[3]*Z+rt[5],St=this.boundingBox;if(it<St[0][0]||it>St[1][0]||ct<St[0][1]||ct>St[1][1])return!1;function Ct(_ref85,_ref86,_ref87){var _ref88=_slicedToArray(_ref85,2),Mt=_ref88[0],Dt=_ref88[1];var _ref89=_slicedToArray(_ref86,2),At=_ref89[0],Ot=_ref89[1];var _ref90=_slicedToArray(_ref87,2),Lt=_ref90[0],Yt=_ref90[1];var zt=Lt-At,Wt=Yt-Ot,Qt=((Mt-At)*zt+(Dt-Ot)*Wt)/(Math.pow(zt,2)+Math.pow(Wt,2));return Qt>=0&&Qt<=1;}for(var Mt=0;Mt<V.length;Mt++){var Dt=V[Mt];if(O==="fill"&&Dt[0]>=L.fillPointCount)break;if(O==="stroke"&&Dt[0]<L.fillPointCount)continue;var _Dt$map=Dt.map(function(ne){return $[ne];}),_Dt$map2=_slicedToArray(_Dt$map,3),_Dt$map2$=_slicedToArray(_Dt$map2[0],2),At=_Dt$map2$[0],Ot=_Dt$map2$[1],_Dt$map2$2=_slicedToArray(_Dt$map2[1],2),Lt=_Dt$map2$2[0],Yt=_Dt$map2$2[1],_Dt$map2$3=_slicedToArray(_Dt$map2[2],2),zt=_Dt$map2$3[0],Wt=_Dt$map2$3[1],Qt=Math.sign((j-At)*(Yt-Ot)-(Lt-At)*(Z-Ot));if(Qt===0&&Ct([j,Z],[At,Ot],[Lt,Yt]))return!0;var ue=Math.sign((j-Lt)*(Wt-Yt)-(zt-Lt)*(Z-Yt));if(ue===0&&Ct([j,Z],[Lt,Yt],[zt,Wt]))return!0;var ie=Math.sign((j-zt)*(Ot-Wt)-(At-zt)*(Z-Wt));if(ie===0&&Ct([j,Z],[zt,Wt],[At,Ot])||Qt===1&&ue===1&&ie===1||Qt===-1&&ue===-1&&ie===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(j,Z){return this.isPointCollision(j,Z,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(j,Z){return this.isPointCollision(j,Z,"stroke");}},{key:"addPass",value:function addPass(j){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var O=Z.width,L=Z.height,$=v(Z,["width","height"]);var V=new I["default"]();V.rect(0,0,O,L);var rt=new q(V,{width:O,height:L});rt.setUniforms($),rt.setProgram(j),this[wt].push(rt);}}]);}();},/* 57 *//***/function(i,e,t){t.r(e);var r=t(58);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r.Stroke;},/* 58 *//***/function(i,e,t){t.r(e),t.d(e,"Stroke",function(){return m;});var r=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(r.create)(),s=Object(r.create)(),c=Object(r.create)(),l=Object(r.create)(),f=Object(r.create)(),h=1e20;var m=/*#__PURE__*/function(){function m(){var _ref91=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref91$lineWidth=_ref91.lineWidth,C=_ref91$lineWidth===void 0?1:_ref91$lineWidth,_ref91$lineJoin=_ref91.lineJoin,x=_ref91$lineJoin===void 0?"miter":_ref91$lineJoin,_ref91$miterLimit=_ref91.miterLimit,I=_ref91$miterLimit===void 0?10:_ref91$miterLimit,_ref91$lineCap=_ref91.lineCap,d=_ref91$lineCap===void 0?"butt":_ref91$lineCap,_ref91$roundSegments=_ref91.roundSegments,v=_ref91$roundSegments===void 0?20:_ref91$roundSegments;_classCallCheck(this,m);this.lineWidth=C,this.lineJoin=x,this.miterLimit=I,this.lineCap=d,this.roundSegments=v,this._normal=null;}return _createClass(m,[{key:"build",value:function build(C){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var I=C.length;if(C=_toConsumableArray(C),I<2)return C;x&&((C[0][0]!==C[I-1][0]||C[0][1]!==C[I-1][1])&&C.push(_toConsumableArray(C[0])),C.push(_toConsumableArray(C[1]))),I=C.length,this._normal=null;var d={left:[],right:[]},v=this.lineWidth/2,p=this.lineCap;if(!x&&p==="square"){Object(r.direction)(s,C[0],C[1]),Object(r.scaleAndAdd)(C[0],C[0],s,v);var A=C.length-1;Object(r.direction)(s,C[A],C[A-1]),Object(r.scaleAndAdd)(C[A],C[A],s,v);}for(var _A5=1;_A5<I;_A5++){var R=C[_A5-1],D=C[_A5],U=C[_A5+1];this._seg(d,R,D,U,v,x);}return!x&&p==="round"&&T(d,this.roundSegments),[].concat(_toConsumableArray(d.left),_toConsumableArray(d.right.reverse()));}},{key:"_seg",value:function _seg(C,x,I,d,v,p){var S=this.lineJoin==="bevel",A=this.lineJoin==="round";if(Object(r.direction)(s,I,x),this._normal||(this._normal=Object(r.create)(),Object(r.normal)(this._normal,s)),C.left.length||y(C,x,this._normal,v),!d)Object(r.normal)(this._normal,s),p?y(C,x,this._normal,v):y(C,I,this._normal,v);else{Object(r.direction)(c,d,I);var R=Object(r.computeMiter)(l,f,s,c,v);R=Math.min(R,h);var D=Object(r.dot)(l,this._normal)<0?-1:1;var U=S||A;if(!U&&this.lineJoin==="miter"&&R/v>this.miterLimit&&(U=!0),U){Object(r.scaleAndAdd)(n,I,this._normal,-v*D),u(C,n,D);var M=1/0;x&&(M=Math.min(M,Math.hypot(I[0]-x[0],I[1]-x[1]))),d&&(M=Math.min(M,Math.hypot(d[0]-I[0],d[1]-I[1])));var W=Math.max(v,Math.min(R,M));if(Object(r.scaleAndAdd)(n,I,f,W*D),u(C,n,-D),d)if(Object(r.normal)(n,c),Object(r.copy)(this._normal,n),Object(r.scaleAndAdd)(n,I,n,-v*D),A){var Y=Object(r.clone)(n),B=D>0?C.left[C.left.length-1]:C.right[C.right.length-1],N=Object(r.clone)(I),G=Object(r.sub)(Object(r.create)(),B,N),J=Object(r.sub)(Object(r.create)(),Y,N),tt=Math.PI/this.roundSegments;for(var at=0;at<this.roundSegments&&(Object(r.rotate)(G,G,[0,0],D*tt),Math.sign(Object(r.cross)(n,G,J)[2])===D);at++)Object(r.add)(n,G,N),u(C,n,D);u(C,Y,D);}else u(C,n,D);}else y(C,I,f,R),Object(r.copy)(this._normal,f);}}}]);}();function u(E,C,x){x>0?E.left.push(Object(r.clone)(C)):E.right.push(Object(r.clone)(C));}function y(E,C,x,I){var d=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(r.scaleAndAdd)(n,C,x,-I),u(E,n,-d),Object(r.scaleAndAdd)(n,C,x,I),u(E,n,d);}function T(_ref92,x){var E=_ref92.left,C=_ref92.right;var I=Object(r.create)(),d=Object(r.create)();var v=E[0],p=C[0],S=[0.5*(v[0]+p[0]),0.5*(v[1]+p[1])];Object(r.sub)(d,v,S);for(var A=1;A<=x;A++){var R=-1*Math.PI*A/x;Object(r.rotate)(I,d,[0,0],R),Object(r.add)(n,S,I),E.unshift(Object(r.clone)(n));}v=C[C.length-1],p=E[E.length-1],S=[0.5*(v[0]+p[0]),0.5*(v[1]+p[1])],Object(r.sub)(d,v,S);for(var _A6=1;_A6<=x;_A6++){var _R2=-1*Math.PI*_A6/x;Object(r.rotate)(I,d,[0,0],_R2),Object(r.add)(n,S,I),C.push(Object(r.clone)(n));}}},/* 59 *//***/function(i,e,t){t.r(e),t.d(e,"isUnitTransform",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(61),n=t(62);i.exports=function(s,c){if(c=c||{},s=s.filter(function(x){return x.length>2;}),s.length===0)return{positions:[],cells:[]};typeof c.vertexSize!="number"&&(c.vertexSize=s[0][0].length),s=s.map(function(x){return x.reduce(function(I,d){return I.concat(d);});});var l=c.rule==="evenodd"?r.WINDING_ODD:r.WINDING_NONZERO;for(var f=r.tesselate(n({contours:s,windingRule:l,elementType:r.POLYGONS,polySize:3,vertexSize:2},c)),h=[],m=0;m<f.vertices.length;m+=c.vertexSize){var u=f.vertices.slice(m,m+c.vertexSize);h.push(u);}var y=[];for(m=0;m<f.elements.length;m+=3){var T=f.elements[m],E=f.elements[m+1],C=f.elements[m+2];y.push([T,E,C]);}return{positions:h,cells:y};};},/* 61 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r={},n={};i.exports=r,r.WINDING_ODD=0,r.WINDING_NONZERO=1,r.WINDING_POSITIVE=2,r.WINDING_NEGATIVE=3,r.WINDING_ABS_GEQ_TWO=4,r.POLYGONS=0,r.CONNECTED_POLYGONS=1,r.BOUNDARY_CONTOURS=2,r.tesselate=function(d){for(var v=d.debug||!1,p=new I(),S=0;S<d.contours.length;S++)p.addContour(d.vertexSize||2,d.contours[S]);return p.tesselate(d.windingRule||r.WINDING_ODD,d.elementType||r.POLYGONS,d.polySize||3,d.vertexSize||2,d.normal||[0,0,1]),{vertices:p.vertices,vertexIndices:p.vertexIndices,vertexCount:p.vertexCount,elements:p.elements,elementCount:p.elementCount,mesh:v?p.mesh:void 0};};var s=function s(d){if(!d)throw"Assertion Failed!";};function c(){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 l(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function f(d){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=d;}f.prototype={get Rface(){return this.Sym.Lface;},set Rface(d){this.Sym.Lface=d;},get Dst(){return this.Sym.Org;},set Dst(d){this.Sym.Org=d;},get Oprev(){return this.Sym.Lnext;},set Oprev(d){this.Sym.Lnext=d;},get Lprev(){return this.Onext.Sym;},set Lprev(d){this.Onext.Sym=d;},get Dprev(){return this.Lnext.Sym;},set Dprev(d){this.Lnext.Sym=d;},get Rprev(){return this.Sym.Onext;},set Rprev(d){this.Sym.Onext=d;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(d){this.Sym.Onext.Sym=d;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(d){this.Sym.Lnext.Sym=d;}/* 3 pointers */};function h(){var d=new c(),v=new l(),p=new f(0),S=new f(1);d.next=d.prev=d,d.anEdge=null,v.next=v.prev=v,v.anEdge=null,v.trail=null,v.marked=!1,v.inside=!1,p.next=p,p.Sym=S,p.Onext=null,p.Lnext=null,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,S.next=S,S.Sym=p,S.Onext=null,S.Lnext=null,S.Org=null,S.Lface=null,S.winding=0,S.activeRegion=null,this.vHead=d,this.fHead=v,this.eHead=p,this.eHeadSym=S;}h.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
37
+ * No vertex or face structures are allocated, but these must be assigned
38
+ * before the current edge operation is completed.
39
+ *///static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
40
+ makeEdge_:function makeEdge_(d){var v=new f(0),p=new f(1);d.Sym.side<d.side&&(d=d.Sym);var S=d.Sym.next;return p.next=S,S.Sym.next=v,v.next=d,d.Sym.next=p,v.Sym=p,v.Onext=v,v.Lnext=p,v.Org=null,v.Lface=null,v.winding=0,v.activeRegion=null,p.Sym=v,p.Onext=p,p.Lnext=v,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,v;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
41
+ * CS348a notes (see mesh.h). Basically it modifies the mesh so that
42
+ * a->Onext and b->Onext are exchanged. This can have various effects
43
+ * depending on whether a and b belong to different face or vertex rings.
44
+ * For more explanation see tessMeshSplice() below.
45
+ */// static void Splice( TESShalfEdge *a, TESShalfEdge *b )
46
+ splice_:function splice_(d,v){var p=d.Onext,S=v.Onext;p.Sym.Lnext=v,S.Sym.Lnext=d,d.Onext=S,v.Onext=p;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
47
+ * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
48
+ * a place to insert the new vertex in the global vertex list. We insert
49
+ * the new vertex *before* vNext so that algorithms which walk the vertex
50
+ * list will not see the newly created vertices.
51
+ *///static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
52
+ makeVertex_:function makeVertex_(d,v,p){var S=d;s(S!==null);var A=p.prev;S.prev=A,A.next=S,S.next=p,p.prev=S,S.anEdge=v;var R=v;do R.Org=S,R=R.Onext;while(R!==v);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
53
+ * face of all edges in the face loop to which eOrig belongs. "fNext" gives
54
+ * a place to insert the new face in the global face list. We insert
55
+ * the new face *before* fNext so that algorithms which walk the face
56
+ * list will not see the newly created faces.
57
+ */// static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
58
+ makeFace_:function makeFace_(d,v,p){var S=d;s(S!==null);var A=p.prev;S.prev=A,A.next=S,S.next=p,p.prev=S,S.anEdge=v,S.trail=null,S.marked=!1,S.inside=p.inside;var R=v;do R.Lface=S,R=R.Lnext;while(R!==v);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
59
+ * and removes from the global edge list.
60
+ *///static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
61
+ killEdge_:function killEdge_(d){d.Sym.side<d.side&&(d=d.Sym);var v=d.next,p=d.Sym.next;v.Sym.next=p,p.Sym.next=v;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
62
+ * vertex list. It updates the vertex loop to point to a given new vertex.
63
+ *///static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
64
+ killVertex_:function killVertex_(d,v){var p=d.anEdge,S=p;do S.Org=v,S=S.Onext;while(S!==p);var A=d.prev,R=d.next;R.prev=A,A.next=R;},/* KillFace( fDel ) destroys a face and removes it from the global face
65
+ * list. It updates the face loop to point to a given new face.
66
+ *///static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
67
+ killFace_:function killFace_(d,v){var p=d.anEdge,S=p;do S.Lface=v,S=S.Lnext;while(S!==p);var A=d.prev,R=d.next;R.prev=A,A.next=R;},/****************** Basic Edge Operations **********************//* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
68
+ * The loop consists of the two new half-edges.
69
+ *///TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
70
+ makeEdge:function makeEdge(){var d=new c(),v=new c(),p=new l(),S=this.makeEdge_(this.eHead);return this.makeVertex_(d,S,this.vHead),this.makeVertex_(v,S.Sym,this.vHead),this.makeFace_(p,S,this.fHead),S;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
71
+ * mesh connectivity and topology. It changes the mesh so that
72
+ * eOrg->Onext <- OLD( eDst->Onext )
73
+ * eDst->Onext <- OLD( eOrg->Onext )
74
+ * where OLD(...) means the value before the meshSplice operation.
75
+ *
76
+ * This can have two effects on the vertex structure:
77
+ * - if eOrg->Org != eDst->Org, the two vertices are merged together
78
+ * - if eOrg->Org == eDst->Org, the origin is split into two vertices
79
+ * In both cases, eDst->Org is changed and eOrg->Org is untouched.
80
+ *
81
+ * Similarly (and independently) for the face structure,
82
+ * - if eOrg->Lface == eDst->Lface, one loop is split into two
83
+ * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
84
+ * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
85
+ *
86
+ * Some special cases:
87
+ * If eDst == eOrg, the operation has no effect.
88
+ * If eDst == eOrg->Lnext, the new face will have a single edge.
89
+ * If eDst == eOrg->Lprev, the old face will have a single edge.
90
+ * If eDst == eOrg->Onext, the new vertex will have a single edge.
91
+ * If eDst == eOrg->Oprev, the old vertex will have a single edge.
92
+ *///int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
93
+ splice:function splice(d,v){var p=!1,S=!1;if(d!==v){if(v.Org!==d.Org&&(S=!0,this.killVertex_(v.Org,d.Org)),v.Lface!==d.Lface&&(p=!0,this.killFace_(v.Lface,d.Lface)),this.splice_(v,d),!S){var A=new c();this.makeVertex_(A,v,d.Org),d.Org.anEdge=d;}if(!p){var R=new l();this.makeFace_(R,v,d.Lface),d.Lface.anEdge=d;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
94
+ * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
95
+ * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
96
+ * the newly created loop will contain eDel->Dst. If the deletion of eDel
97
+ * would create isolated vertices, those are deleted as well.
98
+ *
99
+ * This function could be implemented as two calls to tessMeshSplice
100
+ * plus a few calls to memFree, but this would allocate and delete
101
+ * unnecessary vertices and faces.
102
+ *///int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
103
+ "delete":function _delete(d){var v=d.Sym,p=!1;if(d.Lface!==d.Rface&&(p=!0,this.killFace_(d.Lface,d.Rface)),d.Onext===d)this.killVertex_(d.Org,null);else if(d.Rface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev),!p){var S=new l();this.makeFace_(S,d,d.Lface);}v.Onext===v?(this.killVertex_(v.Org,null),this.killFace_(v.Lface,null)):(d.Lface.anEdge=v.Oprev,v.Org.anEdge=v.Onext,this.splice_(v,v.Oprev)),this.killEdge_(d);},/******************** Other Edge Operations **********************//* All these routines can be implemented with the basic edge
104
+ * operations above. They are provided for convenience and efficiency.
105
+ *//* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
106
+ * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
107
+ * eOrg and eNew will have the same left face.
108
+ */// TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
109
+ addEdgeVertex:function addEdgeVertex(d){var v=this.makeEdge_(d),p=v.Sym;this.splice_(v,d.Lnext),v.Org=d.Dst;var S=new c();return this.makeVertex_(S,p,v.Org),v.Lface=p.Lface=d.Lface,v;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
110
+ * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
111
+ * eOrg and eNew will have the same left face.
112
+ */// TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
113
+ splitEdge:function splitEdge(d,v){var p=this.addEdgeVertex(d),S=p.Sym;return this.splice_(d.Sym,d.Sym.Oprev),this.splice_(d.Sym,S),d.Dst=S.Org,S.Dst.anEdge=S.Sym,S.Rface=d.Rface,S.winding=d.winding,S.Sym.winding=d.Sym.winding,S;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
114
+ * to eDst->Org, and returns the corresponding half-edge eNew.
115
+ * If eOrg->Lface == eDst->Lface, this splits one loop into two,
116
+ * and the newly created loop is eNew->Lface. Otherwise, two disjoint
117
+ * loops are merged into one, and the loop eDst->Lface is destroyed.
118
+ *
119
+ * If (eOrg == eDst), the new face will have only two edges.
120
+ * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
121
+ * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
122
+ */// TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
123
+ connect:function connect(d,v){var p=!1,S=this.makeEdge_(d),A=S.Sym;if(v.Lface!==d.Lface&&(p=!0,this.killFace_(v.Lface,d.Lface)),this.splice_(S,d.Lnext),this.splice_(A,v),S.Org=d.Dst,A.Org=v.Org,S.Lface=A.Lface=d.Lface,d.Lface.anEdge=A,!p){var R=new l();this.makeFace_(R,S,d.Lface);}return S;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
124
+ * global face list. All edges of fZap will have a NULL pointer as their
125
+ * left face. Any edges which also have a NULL pointer as their right face
126
+ * are deleted entirely (along with any isolated vertices this produces).
127
+ * An entire mesh can be deleted by zapping its faces, one at a time,
128
+ * in any order. Zapped faces cannot be used in further mesh operations!
129
+ */zapFace:function zapFace(d){var v=d.anEdge,p,S,A,R,D;S=v.Lnext;do p=S,S=p.Lnext,p.Lface=null,p.Rface===null&&(p.Onext===p?this.killVertex_(p.Org,null):(p.Org.anEdge=p.Onext,this.splice_(p,p.Oprev)),A=p.Sym,A.Onext===A?this.killVertex_(A.Org,null):(A.Org.anEdge=A.Onext,this.splice_(A,A.Oprev)),this.killEdge_(p));while(p!=v);R=d.prev,D=d.next,D.prev=R,R.next=D;},countFaceVerts_:function countFaceVerts_(d){var v=d.anEdge,p=0;do p++,v=v.Lnext;while(v!==d.anEdge);return p;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
130
+ mergeConvexFaces:function mergeConvexFaces(d){var v,p,S,A,R,D,U;for(v=this.fHead.next;v!==this.fHead;v=v.next)if(v.inside)for(p=v.anEdge,R=p.Org;S=p.Lnext,A=p.Sym,A&&A.Lface&&A.Lface.inside&&(D=this.countFaceVerts_(v),U=this.countFaceVerts_(A.Lface),D+U-2<=d&&n.vertCCW(p.Lprev.Org,p.Org,A.Lnext.Lnext.Org)&&n.vertCCW(A.Lprev.Org,A.Org,p.Lnext.Lnext.Org)&&(S=A.Lnext,this["delete"](A),p=null,A=null)),!(p&&p.Lnext.Org===R);)p=S;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
131
+ */check:function check(){var d=this.fHead,v=this.vHead,p=this.eHead,S,A,R,D,U,M;for(A=d,A=d;(S=A.next)!==d;A=S){s(S.prev===A),U=S.anEdge;do s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U),s(U.Lface===S),U=U.Lnext;while(U!==S.anEdge);}for(s(S.prev===A&&S.anEdge===null),D=v,D=v;(R=D.next)!==v;D=R){s(R.prev===D),U=R.anEdge;do s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U),s(U.Org===R),U=U.Onext;while(U!==R.anEdge);}for(s(R.prev===D&&R.anEdge===null),M=p,M=p;(U=M.next)!==p;M=U)s(U.Sym.next===M.Sym),s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Org!==null),s(U.Dst!==null),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U);s(U.Sym.next===M.Sym&&U.Sym===this.eHeadSym&&U.Sym.Sym===U&&U.Org===null&&U.Dst===null&&U.Lface===null&&U.Rface===null);}},n.vertEq=function(d,v){return d.s===v.s&&d.t===v.t;},n.vertLeq=function(d,v){return d.s<v.s||d.s===v.s&&d.t<=v.t;},n.transLeq=function(d,v){return d.t<v.t||d.t===v.t&&d.s<=v.s;},n.edgeGoesLeft=function(d){return n.vertLeq(d.Dst,d.Org);},n.edgeGoesRight=function(d){return n.vertLeq(d.Org,d.Dst);},n.vertL1dist=function(d,v){return Math.abs(d.s-v.s)+Math.abs(d.t-v.t);},n.edgeEval=function(d,v,p){s(n.vertLeq(d,v)&&n.vertLeq(v,p));var S=v.s-d.s,A=p.s-v.s;return S+A>0?S<A?v.t-d.t+(d.t-p.t)*(S/(S+A)):v.t-p.t+(p.t-d.t)*(A/(S+A)):0;},n.edgeSign=function(d,v,p){s(n.vertLeq(d,v)&&n.vertLeq(v,p));var S=v.s-d.s,A=p.s-v.s;return S+A>0?(v.t-p.t)*S+(v.t-d.t)*A:0;},n.transEval=function(d,v,p){s(n.transLeq(d,v)&&n.transLeq(v,p));var S=v.t-d.t,A=p.t-v.t;return S+A>0?S<A?v.s-d.s+(d.s-p.s)*(S/(S+A)):v.s-p.s+(p.s-d.s)*(A/(S+A)):0;},n.transSign=function(d,v,p){s(n.transLeq(d,v)&&n.transLeq(v,p));var S=v.t-d.t,A=p.t-v.t;return S+A>0?(v.s-p.s)*S+(v.s-d.s)*A:0;},n.vertCCW=function(d,v,p){return d.s*(v.t-p.t)+v.s*(p.t-d.t)+p.s*(d.t-v.t)>=0;},n.interpolate=function(d,v,p,S){return d=d<0?0:d,p=p<0?0:p,d<=p?p===0?(v+S)/2:v+(S-v)*(d/(d+p)):S+(v-S)*(p/(d+p));},n.intersect=function(d,v,p,S,A){var R,D,U;n.vertLeq(d,v)||(U=d,d=v,v=U),n.vertLeq(p,S)||(U=p,p=S,S=U),n.vertLeq(d,p)||(U=d,d=p,p=U,U=v,v=S,S=U),n.vertLeq(p,v)?n.vertLeq(v,S)?(R=n.edgeEval(d,p,v),D=n.edgeEval(p,v,S),R+D<0&&(R=-R,D=-D),A.s=n.interpolate(R,p.s,D,v.s)):(R=n.edgeSign(d,p,v),D=-n.edgeSign(d,S,v),R+D<0&&(R=-R,D=-D),A.s=n.interpolate(R,p.s,D,S.s)):A.s=(p.s+v.s)/2,n.transLeq(d,v)||(U=d,d=v,v=U),n.transLeq(p,S)||(U=p,p=S,S=U),n.transLeq(d,p)||(U=d,d=p,p=U,U=v,v=S,S=U),n.transLeq(p,v)?n.transLeq(v,S)?(R=n.transEval(d,p,v),D=n.transEval(p,v,S),R+D<0&&(R=-R,D=-D),A.t=n.interpolate(R,p.t,D,v.t)):(R=n.transSign(d,p,v),D=-n.transSign(d,S,v),R+D<0&&(R=-R,D=-D),A.t=n.interpolate(R,p.t,D,S.t)):A.t=(p.t+v.t)/2;};function m(){this.key=null,this.next=null,this.prev=null;}function u(d,v){this.head=new m(),this.head.next=this.head,this.head.prev=this.head,this.frame=d,this.leq=v;}u.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(d){return this.insertBefore(this.head,d);},search:function search(d){var v=this.head;do v=v.next;while(v.key!==null&&!this.leq(this.frame,d,v.key));return v;},insertBefore:function insertBefore(d,v){do d=d.prev;while(d.key!==null&&!this.leq(this.frame,d.key,v));var p=new m();return p.key=v,p.next=d.next,d.next.prev=p,p.prev=d,d.next=p,p;},"delete":function _delete(d){d.next.prev=d.prev,d.prev.next=d.next;}};function y(){this.handle=null;}function T(){this.key=null,this.node=null;}function E(d,v){this.size=0,this.max=d,this.nodes=[],this.nodes.length=d+1;var p;for(p=0;p<this.nodes.length;p++)this.nodes[p]=new y();for(this.handles=[],this.handles.length=d+1,p=0;p<this.handles.length;p++)this.handles[p]=new T();this.initialized=!1,this.freeList=0,this.leq=v,this.nodes[1].handle=1,this.handles[1].key=null;}E.prototype={floatDown_:function floatDown_(d){var v=this.nodes,p=this.handles,S,A,R;for(S=v[d].handle;;){if(R=d<<1,R<this.size&&this.leq(p[v[R+1].handle].key,p[v[R].handle].key)&&++R,s(R<=this.max),A=v[R].handle,R>this.size||this.leq(p[S].key,p[A].key)){v[d].handle=S,p[S].node=d;break;}v[d].handle=A,p[A].node=d,d=R;}},floatUp_:function floatUp_(d){var v=this.nodes,p=this.handles,S,A,R;for(S=v[d].handle;;){if(R=d>>1,A=v[R].handle,R===0||this.leq(p[A].key,p[S].key)){v[d].handle=S,p[S].node=d;break;}v[d].handle=A,p[A].node=d,d=R;}},init:function init(){for(var d=this.size;d>=1;--d)this.floatDown_(d);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 )
132
+ insert:function insert(d){var v,p;if(v=++this.size,v*2>this.max){this.max*=2;var S,A;for(A=this.nodes.length,this.nodes.length=this.max+1,S=A;S<this.nodes.length;S++)this.nodes[S]=new y();for(A=this.handles.length,this.handles.length=this.max+1,S=A;S<this.handles.length;S++)this.handles[S]=new T();}return this.freeList===0?p=v:(p=this.freeList,this.freeList=this.handles[p].node),this.nodes[v].handle=p,this.handles[p].node=v,this.handles[p].key=d,this.initialized&&this.floatUp_(v),p;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
133
+ extractMin:function extractMin(){var d=this.nodes,v=this.handles,p=d[1].handle,S=v[p].key;return this.size>0&&(d[1].handle=d[this.size].handle,v[d[1].handle].node=1,v[p].key=null,v[p].node=this.freeList,this.freeList=p,--this.size,this.size>0&&this.floatDown_(1)),S;},"delete":function _delete(d){var v=this.nodes,p=this.handles,S;s(d>=1&&d<=this.max&&p[d].key!==null),S=p[d].node,v[S].handle=v[this.size].handle,p[v[S].handle].node=S,--this.size,S<=this.size&&(S<=1||this.leq(p[v[S>>1].handle].key,p[v[S].handle].key)?this.floatDown_(S):this.floatUp_(S)),p[d].key=null,p[d].node=this.freeList,this.freeList=d;}};function C(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var x={};x.regionBelow=function(d){return d.nodeUp.prev.key;},x.regionAbove=function(d){return d.nodeUp.next.key;},x.debugEvent=function(d){},x.addWinding=function(d,v){d.winding+=v.winding,d.Sym.winding+=v.Sym.winding;},x.edgeLeq=function(d,v,p){var S=d.event,D,U,A=v.eUp,R=p.eUp;if(A.Dst===S)return R.Dst===S?n.vertLeq(A.Org,R.Org)?n.edgeSign(R.Dst,A.Org,R.Org)<=0:n.edgeSign(A.Dst,R.Org,A.Org)>=0:n.edgeSign(R.Dst,S,R.Org)<=0;if(R.Dst===S)return n.edgeSign(A.Dst,S,A.Org)>=0;var D=n.edgeEval(A.Dst,S,A.Org),U=n.edgeEval(R.Dst,S,R.Org);return D>=U;},x.deleteRegion=function(d,v){v.fixUpperEdge&&s(v.eUp.winding===0),v.eUp.activeRegion=null,d.dict["delete"](v.nodeUp);},x.fixUpperEdge=function(d,v,p){s(v.fixUpperEdge),d.mesh["delete"](v.eUp),v.fixUpperEdge=!1,v.eUp=p,p.activeRegion=v;},x.topLeftRegion=function(d,v){var p=v.eUp.Org,S;do v=x.regionAbove(v);while(v.eUp.Org===p);if(v.fixUpperEdge){if(S=d.mesh.connect(x.regionBelow(v).eUp.Sym,v.eUp.Lnext),S===null)return null;x.fixUpperEdge(d,v,S),v=x.regionAbove(v);}return v;},x.topRightRegion=function(d){var v=d.eUp.Dst;do d=x.regionAbove(d);while(d.eUp.Dst===v);return d;},x.addRegionBelow=function(d,v,p){var S=new C();return S.eUp=p,S.nodeUp=d.dict.insertBefore(v.nodeUp,S),S.fixUpperEdge=!1,S.sentinel=!1,S.dirty=!1,p.activeRegion=S,S;},x.isWindingInside=function(d,v){switch(d.windingRule){case r.WINDING_ODD:return(v&1)!==0;case r.WINDING_NONZERO:return v!==0;case r.WINDING_POSITIVE:return v>0;case r.WINDING_NEGATIVE:return v<0;case r.WINDING_ABS_GEQ_TWO:return v>=2||v<=-2;}return s(!1),!1;},x.computeWinding=function(d,v){v.windingNumber=x.regionAbove(v).windingNumber+v.eUp.winding,v.inside=x.isWindingInside(d,v.windingNumber);},x.finishRegion=function(d,v){var p=v.eUp,S=p.Lface;S.inside=v.inside,S.anEdge=p,x.deleteRegion(d,v);},x.finishLeftRegions=function(d,v,p){for(var S,D,A=null,R=v,D=v.eUp;R!==p;){if(R.fixUpperEdge=!1,A=x.regionBelow(R),S=A.eUp,S.Org!=D.Org){if(!A.fixUpperEdge){x.finishRegion(d,R);break;}S=d.mesh.connect(D.Lprev,S.Sym),x.fixUpperEdge(d,A,S);}D.Onext!==S&&(d.mesh.splice(S.Oprev,S),d.mesh.splice(D,S)),x.finishRegion(d,R),D=A.eUp,R=A;}return D;},x.addRightEdges=function(d,v,p,S,A,R){var D,U,M,W,Y=!0;M=p;do s(n.vertLeq(M.Org,M.Dst)),x.addRegionBelow(d,v,M.Sym),M=M.Onext;while(M!==S);for(A===null&&(A=x.regionBelow(v).eUp.Rprev),U=v,W=A;D=x.regionBelow(U),M=D.eUp.Sym,M.Org===W.Org;)M.Onext!==W&&(d.mesh.splice(M.Oprev,M),d.mesh.splice(W.Oprev,M)),D.windingNumber=U.windingNumber-M.winding,D.inside=x.isWindingInside(d,D.windingNumber),U.dirty=!0,!Y&&x.checkForRightSplice(d,U)&&(x.addWinding(M,W),x.deleteRegion(d,U),d.mesh["delete"](W)),Y=!1,U=D,W=M;U.dirty=!0,s(U.windingNumber-M.winding===D.windingNumber),R&&x.walkDirtyRegions(d,U);},x.spliceMergeVertices=function(d,v,p){d.mesh.splice(v,p);},x.vertexWeights=function(d,v,p){var S=n.vertL1dist(v,d),A=n.vertL1dist(p,d),R=0.5*A/(S+A),D=0.5*S/(S+A);d.coords[0]+=R*v.coords[0]+D*p.coords[0],d.coords[1]+=R*v.coords[1]+D*p.coords[1],d.coords[2]+=R*v.coords[2]+D*p.coords[2];},x.getIntersectData=function(d,v,p,S,A,R){v.coords[0]=v.coords[1]=v.coords[2]=0,v.idx=-1,x.vertexWeights(v,p,S),x.vertexWeights(v,A,R);},x.checkForRightSplice=function(d,v){var p=x.regionBelow(v),S=v.eUp,A=p.eUp;if(n.vertLeq(S.Org,A.Org)){if(n.edgeSign(A.Dst,S.Org,A.Org)>0)return!1;n.vertEq(S.Org,A.Org)?S.Org!==A.Org&&(d.pq["delete"](S.Org.pqHandle),x.spliceMergeVertices(d,A.Oprev,S)):(d.mesh.splitEdge(A.Sym),d.mesh.splice(S,A.Oprev),v.dirty=p.dirty=!0);}else{if(n.edgeSign(S.Dst,A.Org,S.Org)<0)return!1;x.regionAbove(v).dirty=v.dirty=!0,d.mesh.splitEdge(S.Sym),d.mesh.splice(A.Oprev,S);}return!0;},x.checkForLeftSplice=function(d,v){var p=x.regionBelow(v),S=v.eUp,A=p.eUp,R;if(s(!n.vertEq(S.Dst,A.Dst)),n.vertLeq(S.Dst,A.Dst)){if(n.edgeSign(S.Dst,A.Dst,S.Org)<0)return!1;x.regionAbove(v).dirty=v.dirty=!0,R=d.mesh.splitEdge(S),d.mesh.splice(A.Sym,R),R.Lface.inside=v.inside;}else{if(n.edgeSign(A.Dst,S.Dst,A.Org)>0)return!1;v.dirty=p.dirty=!0,R=d.mesh.splitEdge(A),d.mesh.splice(S.Lnext,A.Sym),R.Rface.inside=v.inside;}return!0;},x.checkForIntersect=function(d,v){var p=x.regionBelow(v),S=v.eUp,A=p.eUp,R=S.Org,D=A.Org,U=S.Dst,M=A.Dst,W,Y,B=new c(),N,G;if(s(!n.vertEq(M,U)),s(n.edgeSign(U,d.event,R)<=0),s(n.edgeSign(M,d.event,D)>=0),s(R!==d.event&&D!==d.event),s(!v.fixUpperEdge&&!p.fixUpperEdge),R===D||(W=Math.min(R.t,U.t),Y=Math.max(D.t,M.t),W>Y))return!1;if(n.vertLeq(R,D)){if(n.edgeSign(M,R,D)>0)return!1;}else if(n.edgeSign(U,D,R)<0)return!1;return x.debugEvent(d),n.intersect(U,R,M,D,B),s(Math.min(R.t,U.t)<=B.t),s(B.t<=Math.max(D.t,M.t)),s(Math.min(M.s,U.s)<=B.s),s(B.s<=Math.max(D.s,R.s)),n.vertLeq(B,d.event)&&(B.s=d.event.s,B.t=d.event.t),N=n.vertLeq(R,D)?R:D,n.vertLeq(N,B)&&(B.s=N.s,B.t=N.t),n.vertEq(B,R)||n.vertEq(B,D)?(x.checkForRightSplice(d,v),!1):!n.vertEq(U,d.event)&&n.edgeSign(U,d.event,B)>=0||!n.vertEq(M,d.event)&&n.edgeSign(M,d.event,B)<=0?M===d.event?(d.mesh.splitEdge(S.Sym),d.mesh.splice(A.Sym,S),v=x.topLeftRegion(d,v),S=x.regionBelow(v).eUp,x.finishLeftRegions(d,x.regionBelow(v),p),x.addRightEdges(d,v,S.Oprev,S,S,!0),!0):U===d.event?(d.mesh.splitEdge(A.Sym),d.mesh.splice(S.Lnext,A.Oprev),p=v,v=x.topRightRegion(v),G=x.regionBelow(v).eUp.Rprev,p.eUp=A.Oprev,A=x.finishLeftRegions(d,p,null),x.addRightEdges(d,v,A.Onext,S.Rprev,G,!0),!0):(n.edgeSign(U,d.event,B)>=0&&(x.regionAbove(v).dirty=v.dirty=!0,d.mesh.splitEdge(S.Sym),S.Org.s=d.event.s,S.Org.t=d.event.t),n.edgeSign(M,d.event,B)<=0&&(v.dirty=p.dirty=!0,d.mesh.splitEdge(A.Sym),A.Org.s=d.event.s,A.Org.t=d.event.t),!1):(d.mesh.splitEdge(S.Sym),d.mesh.splitEdge(A.Sym),d.mesh.splice(A.Oprev,S),S.Org.s=B.s,S.Org.t=B.t,S.Org.pqHandle=d.pq.insert(S.Org),x.getIntersectData(d,S.Org,R,U,D,M),x.regionAbove(v).dirty=v.dirty=p.dirty=!0,!1);},x.walkDirtyRegions=function(d,v){for(var p=x.regionBelow(v),S,A;;){for(;p.dirty;)v=p,p=x.regionBelow(p);if(!v.dirty&&(p=v,v=x.regionAbove(v),v===null||!v.dirty))return;if(v.dirty=!1,S=v.eUp,A=p.eUp,S.Dst!==A.Dst&&x.checkForLeftSplice(d,v)&&(p.fixUpperEdge?(x.deleteRegion(d,p),d.mesh["delete"](A),p=x.regionBelow(v),A=p.eUp):v.fixUpperEdge&&(x.deleteRegion(d,v),d.mesh["delete"](S),v=x.regionAbove(p),S=v.eUp)),S.Org!==A.Org)if(S.Dst!==A.Dst&&!v.fixUpperEdge&&!p.fixUpperEdge&&(S.Dst===d.event||A.Dst===d.event)){if(x.checkForIntersect(d,v))return;}else x.checkForRightSplice(d,v);S.Org===A.Org&&S.Dst===A.Dst&&(x.addWinding(A,S),x.deleteRegion(d,v),d.mesh["delete"](S),v=x.regionAbove(p));}},x.connectRightVertex=function(d,v,p){var S,A=p.Onext,R=x.regionBelow(v),D=v.eUp,U=R.eUp,M=!1;if(D.Dst!==U.Dst&&x.checkForIntersect(d,v),n.vertEq(D.Org,d.event)&&(d.mesh.splice(A.Oprev,D),v=x.topLeftRegion(d,v),A=x.regionBelow(v).eUp,x.finishLeftRegions(d,x.regionBelow(v),R),M=!0),n.vertEq(U.Org,d.event)&&(d.mesh.splice(p,U.Oprev),p=x.finishLeftRegions(d,R,null),M=!0),M){x.addRightEdges(d,v,p.Onext,A,A,!0);return;}n.vertLeq(U.Org,D.Org)?S=U.Oprev:S=D,S=d.mesh.connect(p.Lprev,S),x.addRightEdges(d,v,S,S.Onext,S.Onext,!1),S.Sym.activeRegion.fixUpperEdge=!0,x.walkDirtyRegions(d,v);},x.connectLeftDegenerate=function(d,v,p){var S,A,R,D,U;if(S=v.eUp,n.vertEq(S.Org,p)){s(!1/*TOLERANCE_NONZERO*/),x.spliceMergeVertices(d,S,p.anEdge);return;}if(!n.vertEq(S.Dst,p)){d.mesh.splitEdge(S.Sym),v.fixUpperEdge&&(d.mesh["delete"](S.Onext),v.fixUpperEdge=!1),d.mesh.splice(p.anEdge,S),x.sweepEvent(d,p);return;}s(!1/*TOLERANCE_NONZERO*/),v=x.topRightRegion(v),U=x.regionBelow(v),R=U.eUp.Sym,A=D=R.Onext,U.fixUpperEdge&&(s(A!==R),x.deleteRegion(d,U),d.mesh["delete"](R),R=A.Oprev),d.mesh.splice(p.anEdge,R),n.edgeGoesLeft(A)||(A=null),x.addRightEdges(d,v,R.Onext,D,A,!0);},x.connectLeftVertex=function(d,v){var p,S,A,R,D,U,M=new C();if(M.eUp=v.anEdge.Sym,p=d.dict.search(M).key,S=x.regionBelow(p),!!S){if(R=p.eUp,D=S.eUp,n.edgeSign(R.Dst,v,R.Org)===0){x.connectLeftDegenerate(d,p,v);return;}if(A=n.vertLeq(D.Dst,R.Dst)?p:S,p.inside||A.fixUpperEdge){if(A===p)U=d.mesh.connect(v.anEdge.Sym,R.Lnext);else{var W=d.mesh.connect(D.Dnext,v.anEdge);U=W.Sym;}A.fixUpperEdge?x.fixUpperEdge(d,A,U):x.computeWinding(d,x.addRegionBelow(d,p,U)),x.sweepEvent(d,v);}else x.addRightEdges(d,p,v.anEdge,v.anEdge,null,!0);}},x.sweepEvent=function(d,v){d.event=v,x.debugEvent(d);for(var p=v.anEdge;p.activeRegion===null;)if(p=p.Onext,p===v.anEdge){x.connectLeftVertex(d,v);return;}var S=x.topLeftRegion(d,p.activeRegion);s(S!==null);var A=x.regionBelow(S),R=A.eUp,D=x.finishLeftRegions(d,A,null);D.Onext===R?x.connectRightVertex(d,S,D):x.addRightEdges(d,S,D.Onext,R,R,!0);},x.addSentinel=function(d,v,p,S){var A=new C(),R=d.mesh.makeEdge();R.Org.s=p,R.Org.t=S,R.Dst.s=v,R.Dst.t=S,d.event=R.Dst,A.eUp=R,A.windingNumber=0,A.inside=!1,A.fixUpperEdge=!1,A.sentinel=!0,A.dirty=!1,A.nodeUp=d.dict.insert(A);},x.initEdgeDict=function(d){d.dict=new u(d,x.edgeLeq);var v=d.bmax[0]-d.bmin[0],p=d.bmax[1]-d.bmin[1],S=d.bmin[0]-v,A=d.bmax[0]+v,R=d.bmin[1]-p,D=d.bmax[1]+p;x.addSentinel(d,S,A,R),x.addSentinel(d,S,A,D);},x.doneEdgeDict=function(d){for(var v,p=0;(v=d.dict.min().key)!==null;)v.sentinel||(s(v.fixUpperEdge),s(++p===1)),s(v.windingNumber===0),x.deleteRegion(d,v);},x.removeDegenerateEdges=function(d){var v,p,S,A=d.mesh.eHead;for(v=A.next;v!==A;v=p)p=v.next,S=v.Lnext,n.vertEq(v.Org,v.Dst)&&v.Lnext.Lnext!==v&&(x.spliceMergeVertices(d,S,v),d.mesh["delete"](v),v=S,S=v.Lnext),S.Lnext===v&&(S!==v&&((S===p||S===p.Sym)&&(p=p.next),d.mesh["delete"](S)),(v===p||v===p.Sym)&&(p=p.next),d.mesh["delete"](v));},x.initPriorityQ=function(d){var v,p,S,A=0;for(S=d.mesh.vHead,p=S.next;p!==S;p=p.next)A++;for(A+=8,v=d.pq=new E(A,n.vertLeq),S=d.mesh.vHead,p=S.next;p!==S;p=p.next)p.pqHandle=v.insert(p);return p!==S?!1:(v.init(),!0);},x.donePriorityQ=function(d){d.pq=null;},x.removeDegenerateFaces=function(d,v){var p,S,A;for(p=v.fHead.next;p!==v.fHead;p=S)S=p.next,A=p.anEdge,s(A.Lnext!==A),A.Lnext.Lnext===A&&(x.addWinding(A.Onext,A),d.mesh["delete"](A));return!0;},x.computeInterior=function(d){var v,p;if(x.removeDegenerateEdges(d),!x.initPriorityQ(d))return!1;for(x.initEdgeDict(d);(v=d.pq.extractMin())!==null;){for(;p=d.pq.min(),!(p===null||!n.vertEq(p,v));)p=d.pq.extractMin(),x.spliceMergeVertices(d,v.anEdge,p.anEdge);x.sweepEvent(d,v);}return d.event=d.dict.min().key.eUp.Org,x.debugEvent(d),x.doneEdgeDict(d),x.donePriorityQ(d),x.removeDegenerateFaces(d,d.mesh)?(d.mesh.check(),!0):!1;};function I(){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=r.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;}I.prototype={dot_:function dot_(d,v){return d[0]*v[0]+d[1]*v[1]+d[2]*v[2];},normalize_:function normalize_(d){var v=d[0]*d[0]+d[1]*d[1]+d[2]*d[2];s(v>0),v=Math.sqrt(v),d[0]/=v,d[1]/=v,d[2]/=v;},longAxis_:function longAxis_(d){var v=0;return Math.abs(d[1])>Math.abs(d[0])&&(v=1),Math.abs(d[2])>Math.abs(d[v])&&(v=2),v;},computeNormal_:function computeNormal_(d){var v,p,S,A,R,D,U=[0,0,0],M=[0,0,0],W=[0,0,0],Y=[0,0,0],B=[0,0,0],N=[null,null,null],G=[null,null,null],J=this.mesh.vHead,tt;for(v=J.next,tt=0;tt<3;++tt)A=v.coords[tt],M[tt]=A,G[tt]=v,U[tt]=A,N[tt]=v;for(v=J.next;v!==J;v=v.next)for(tt=0;tt<3;++tt)A=v.coords[tt],A<M[tt]&&(M[tt]=A,G[tt]=v),A>U[tt]&&(U[tt]=A,N[tt]=v);if(tt=0,U[1]-M[1]>U[0]-M[0]&&(tt=1),U[2]-M[2]>U[tt]-M[tt]&&(tt=2),M[tt]>=U[tt]){d[0]=0,d[1]=0,d[2]=1;return;}for(D=0,p=G[tt],S=N[tt],W[0]=p.coords[0]-S.coords[0],W[1]=p.coords[1]-S.coords[1],W[2]=p.coords[2]-S.coords[2],v=J.next;v!==J;v=v.next)Y[0]=v.coords[0]-S.coords[0],Y[1]=v.coords[1]-S.coords[1],Y[2]=v.coords[2]-S.coords[2],B[0]=W[1]*Y[2]-W[2]*Y[1],B[1]=W[2]*Y[0]-W[0]*Y[2],B[2]=W[0]*Y[1]-W[1]*Y[0],R=B[0]*B[0]+B[1]*B[1]+B[2]*B[2],R>D&&(D=R,d[0]=B[0],d[1]=B[1],d[2]=B[2]);D<=0&&(d[0]=d[1]=d[2]=0,d[this.longAxis_(W)]=1);},checkOrientation_:function checkOrientation_(){var d,v,p=this.mesh.fHead,S,A=this.mesh.vHead,R;for(d=0,v=p.next;v!==p;v=v.next)if(R=v.anEdge,!(R.winding<=0))do d+=(R.Org.s-R.Dst.s)*(R.Org.t+R.Dst.t),R=R.Lnext;while(R!==v.anEdge);if(d<0){for(S=A.next;S!==A;S=S.next)S.t=-S.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
134
+ #include <stdlib.h>
135
+ extern int RandomSweep;
136
+ #define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
137
+ #define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
138
+ #else
139
+ #if defined(SLANTED_SWEEP) *//* The "feature merging" is not intended to be complete. There are
140
+ * special cases where edges are nearly parallel to the sweep line
141
+ * which are not implemented. The algorithm should still behave
142
+ * robustly (ie. produce a reasonable tesselation) in the presence
143
+ * of such edges, however it may miss features which could have been
144
+ * merged. We could minimize this effect by choosing the sweep line
145
+ * direction to be something unusual (ie. not parallel to one of the
146
+ * coordinate axes).
147
+ *//* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
148
+ #define S_UNIT_Y (TESSreal)0.86052074622010633
149
+ #else
150
+ #define S_UNIT_X (TESSreal)1.0
151
+ #define S_UNIT_Y (TESSreal)0.0
152
+ #endif
153
+ #endif*//* Determine the polygon normal and project vertices onto the plane
154
+ * of the polygon.
155
+ */projectPolygon_:function projectPolygon_(){var d,v=this.mesh.vHead,p=[0,0,0],S,A,R,D,U=!1;for(p[0]=this.normal[0],p[1]=this.normal[1],p[2]=this.normal[2],p[0]===0&&p[1]===0&&p[2]===0&&(this.computeNormal_(p),U=!0),S=this.sUnit,A=this.tUnit,R=this.longAxis_(p),S[R]=0,S[(R+1)%3]=1,S[(R+2)%3]=0,A[R]=0,A[(R+1)%3]=0,A[(R+2)%3]=p[R]>0?1:-1,d=v.next;d!==v;d=d.next)d.s=this.dot_(d.coords,S),d.t=this.dot_(d.coords,A);for(U&&this.checkOrientation_(),D=!0,d=v.next;d!==v;d=d.next)D?(this.bmin[0]=this.bmax[0]=d.s,this.bmin[1]=this.bmax[1]=d.t,D=!1):(d.s<this.bmin[0]&&(this.bmin[0]=d.s),d.s>this.bmax[0]&&(this.bmax[0]=d.s),d.t<this.bmin[1]&&(this.bmin[1]=d.t),d.t>this.bmax[1]&&(this.bmax[1]=d.t));},addWinding_:function addWinding_(d,v){d.winding+=v.winding,d.Sym.winding+=v.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
156
+ * (what else would it do??) The region must consist of a single
157
+ * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
158
+ * case means that any vertical line intersects the interior of the
159
+ * region in a single interval.
160
+ *
161
+ * Tessellation consists of adding interior edges (actually pairs of
162
+ * half-edges), to split the region into non-overlapping triangles.
163
+ *
164
+ * The basic idea is explained in Preparata and Shamos (which I don''t
165
+ * have handy right now), although their implementation is more
166
+ * complicated than this one. The are two edge chains, an upper chain
167
+ * and a lower chain. We process all vertices from both chains in order,
168
+ * from right to left.
169
+ *
170
+ * The algorithm ensures that the following invariant holds after each
171
+ * vertex is processed: the untessellated region consists of two
172
+ * chains, where one chain (say the upper) is a single edge, and
173
+ * the other chain is concave. The left vertex of the single edge
174
+ * is always to the left of all vertices in the concave chain.
175
+ *
176
+ * Each step consists of adding the rightmost unprocessed vertex to one
177
+ * of the two chains, and forming a fan of triangles from the rightmost
178
+ * of two chain endpoints. Determining whether we can add each triangle
179
+ * to the fan is a simple orientation test. By making the fan as large
180
+ * as possible, we restore the invariant (check it yourself).
181
+ */// int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
182
+ tessellateMonoRegion_:function tessellateMonoRegion_(d,v){var p,S;for(p=v.anEdge,s(p.Lnext!==p&&p.Lnext.Lnext!==p);n.vertLeq(p.Dst,p.Org);p=p.Lprev);for(;n.vertLeq(p.Org,p.Dst);p=p.Lnext);for(S=p.Lprev;p.Lnext!==S;)if(n.vertLeq(p.Dst,S.Org)){for(;S.Lnext!==p&&(n.edgeGoesLeft(S.Lnext)||n.edgeSign(S.Org,S.Dst,S.Lnext.Dst)<=0);){var A=d.connect(S.Lnext,S);S=A.Sym;}S=S.Lprev;}else{for(;S.Lnext!==p&&(n.edgeGoesRight(p.Lprev)||n.edgeSign(p.Dst,p.Org,p.Lprev.Org)>=0);){var A=d.connect(p,p.Lprev);p=A.Sym;}p=p.Lnext;}for(s(S.Lnext!==p);S.Lnext.Lnext!==p;){var A=d.connect(S.Lnext,S);S=A.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
183
+ * the mesh which is marked "inside" the polygon. Each such region
184
+ * must be monotone.
185
+ *///int tessMeshTessellateInterior( TESSmesh *mesh )
186
+ tessellateInterior_:function tessellateInterior_(d){var v,p;for(v=d.fHead.next;v!==d.fHead;v=p)if(p=v.next,v.inside&&!this.tessellateMonoRegion_(d,v))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
187
+ * which are not marked "inside" the polygon. Since further mesh operations
188
+ * on NULL faces are not allowed, the main purpose is to clean up the
189
+ * mesh so that exterior loops are not represented in the data structure.
190
+ *///void tessMeshDiscardExterior( TESSmesh *mesh )
191
+ discardExterior_:function discardExterior_(d){var v,p;for(v=d.fHead.next;v!==d.fHead;v=p)p=v.next,v.inside||d.zapFace(v);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
192
+ * winding numbers on all edges so that regions marked "inside" the
193
+ * polygon have a winding number of "value", and regions outside
194
+ * have a winding number of 0.
195
+ *
196
+ * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
197
+ * separate an interior region from an exterior one.
198
+ */// int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
199
+ setWindingNumber_:function setWindingNumber_(d,v,p){var S,A;for(S=d.eHead.next;S!==d.eHead;S=A)A=S.next,S.Rface.inside!==S.Lface.inside?S.winding=S.Lface.inside?v:-v:p?d["delete"](S):S.winding=0;},getNeighbourFace_:function getNeighbourFace_(d){return!d.Rface||!d.Rface.inside?-1:d.Rface.n;},outputPolymesh_:function outputPolymesh_(d,v,p,S){var A,R,D,U=0,M=0,W,Y;for(p>3&&d.mergeConvexFaces(p),A=d.vHead.next;A!==d.vHead;A=A.next)A.n=-1;for(R=d.fHead.next;R!==d.fHead;R=R.next)if(R.n=-1,!!R.inside){D=R.anEdge,W=0;do A=D.Org,A.n===-1&&(A.n=M,M++),W++,D=D.Lnext;while(D!==R.anEdge);s(W<=p),R.n=U,++U;}for(this.elementCount=U,v===r.CONNECTED_POLYGONS&&(U*=2),this.elements=[],this.elements.length=U*p,this.vertexCount=M,this.vertices=[],this.vertices.length=M*S,this.vertexIndices=[],this.vertexIndices.length=M,A=d.vHead.next;A!==d.vHead;A=A.next)if(A.n!==-1){var B=A.n*S;this.vertices[B+0]=A.coords[0],this.vertices[B+1]=A.coords[1],S>2&&(this.vertices[B+2]=A.coords[2]),this.vertexIndices[A.n]=A.idx;}var N=0;for(R=d.fHead.next;R!==d.fHead;R=R.next)if(R.inside){D=R.anEdge,W=0;do A=D.Org,this.elements[N++]=A.n,W++,D=D.Lnext;while(D!==R.anEdge);for(Y=W;Y<p;++Y)this.elements[N++]=-1;if(v===r.CONNECTED_POLYGONS){D=R.anEdge;do this.elements[N++]=this.getNeighbourFace_(D),D=D.Lnext;while(D!==R.anEdge);for(Y=W;Y<p;++Y)this.elements[N++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
200
+ outputContours_:function outputContours_(d,v){var p,S,A,R=0,D=0;for(this.vertexCount=0,this.elementCount=0,p=d.fHead.next;p!==d.fHead;p=p.next)if(p.inside){A=S=p.anEdge;do this.vertexCount++,S=S.Lnext;while(S!==A);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*v,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var U=0,M=0,W=0;for(R=0,p=d.fHead.next;p!==d.fHead;p=p.next)if(p.inside){D=0,A=S=p.anEdge;do this.vertices[U++]=S.Org.coords[0],this.vertices[U++]=S.Org.coords[1],v>2&&(this.vertices[U++]=S.Org.coords[2]),this.vertexIndices[M++]=S.Org.idx,D++,S=S.Lnext;while(S!==A);this.elements[W++]=R,this.elements[W++]=D,R+=D;}},addContour:function addContour(d,v){var p,S;for(this.mesh===null&&(this.mesh=new h()),d<2&&(d=2),d>3&&(d=3),p=null,S=0;S<v.length;S+=d)p===null?(p=this.mesh.makeEdge(),this.mesh.splice(p,p.Sym)):(this.mesh.splitEdge(p),p=p.Lnext),p.Org.coords[0]=v[S+0],p.Org.coords[1]=v[S+1],d>2?p.Org.coords[2]=v[S+2]:p.Org.coords[2]=0,p.Org.idx=this.vertexIndexCounter++,p.winding=1,p.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
201
+ tesselate:function tesselate(d,v,p,S,A){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,A&&(this.normal[0]=A[0],this.normal[1]=A[1],this.normal[2]=A[2]),this.windingRule=d,S<2&&(S=2),S>3&&(S=3),!this.mesh)return!1;this.projectPolygon_(),x.computeInterior(this);var R=this.mesh;return v===r.BOUNDARY_CONTOURS?this.setWindingNumber_(R,1,!0):this.tessellateInterior_(R),R.check(),v===r.BOUNDARY_CONTOURS?this.outputContours_(R,S):this.outputPolymesh_(R,v,p,S),!0;}};},/* 62 *//***/function(i,e){i.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var n={},s=0;s<arguments.length;s++){var c=arguments[s];for(var l in c)t.call(c,l)&&(n[l]=c[l]);}return n;}},/* 63 *//***/function(i,e,t){t.r(e),t.d(e,"createShaders",function(){return f;}),t.d(e,"applyShader",function(){return h;}),t.d(e,"createCloudShaders",function(){return u;}),t.d(e,"applyCloudShader",function(){return y;});var r=t(64),n=t(65),s=t(66),c=t(67);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol("shaders");function f(T){T[l]=[];for(var E=0;E<16;E++){var C=[],x=!!(E&1),_I11=!!(E&2),_d10=!!(E&4),v=!!(E&8);x&&C.push("#define TEXTURE 1"),_I11&&C.push("#define FILTER 1"),_d10&&C.push("#define GRADIENT 1"),v&&C.push("#define CLIPPATH 1");var p="".concat(C.join("\n"),"\n"),S=[];x&&S.push("uniform sampler2D u_texSampler;"),v&&S.push("uniform sampler2D u_clipSampler;"),T[l][E]=[p+S.join("\n")+n["default"],p+r["default"]];}}function h(T){var _ref93=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref93$hasTexture=_ref93.hasTexture,E=_ref93$hasTexture===void 0?!1:_ref93$hasTexture,_ref93$hasFilter=_ref93.hasFilter,C=_ref93$hasFilter===void 0?!1:_ref93$hasFilter,_ref93$hasGradient=_ref93.hasGradient,x=_ref93$hasGradient===void 0?!1:_ref93$hasGradient,_ref93$hasClipPath=_ref93.hasClipPath,I=_ref93$hasClipPath===void 0?!1:_ref93$hasClipPath;var d=E|C<<1|x<<2|I<<3;var v=T[l][d];Array.isArray(v)&&(v=T.createProgram.apply(T,_toConsumableArray(v)),T[l][d]=v),T.program!==v&&T.useProgram(v,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var m=[];function u(T){for(var E=0;E<64;E++){var C=[],x=!!(E&1),_I12=!!(E&2),_d11=!!(E&4),v=!!(E&8),p=!!(E&16),S=!!(E&32);x&&C.push("#define TEXTURE 1"),_I12&&C.push("#define FILTER 1"),_d11&&C.push("#define GRADIENT 1"),v&&C.push("#define CLOUDCOLOR 1"),p&&C.push("#define CLOUDFILTER 1"),S&&C.push("#define CLIPPATH 1");var A="".concat(C.join("\n"),"\n"),R=[];if(x){R.push("uniform sampler2D u_texSampler;");for(var D=0;D<12;D++)R.push("uniform sampler2D u_texFrame".concat(D,";"));}S&&R.push("uniform sampler2D u_clipSampler;"),m[E]=[A+R.join("\n")+c["default"],A+s["default"]];}}function y(T){var _ref94=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref94$hasTexture=_ref94.hasTexture,E=_ref94$hasTexture===void 0?!1:_ref94$hasTexture,_ref94$hasFilter=_ref94.hasFilter,C=_ref94$hasFilter===void 0?!1:_ref94$hasFilter,_ref94$hasGradient=_ref94.hasGradient,x=_ref94$hasGradient===void 0?!1:_ref94$hasGradient,_ref94$hasCloudColor=_ref94.hasCloudColor,I=_ref94$hasCloudColor===void 0?!1:_ref94$hasCloudColor,_ref94$hasCloudFilter=_ref94.hasCloudFilter,d=_ref94$hasCloudFilter===void 0?!1:_ref94$hasCloudFilter,_ref94$hasClipPath=_ref94.hasClipPath,v=_ref94$hasClipPath===void 0?!1:_ref94$hasClipPath;var p=E|C<<1|x<<2|I<<3|d<<4|v<<5;var S=m[p];Array.isArray(S)&&(S=T.createProgram.apply(T,_toConsumableArray(S)),m[p]=S),T.program!==S&&T.useProgram(S,{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(i,e,t){t.r(e),e["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(i,e,t){t.r(e),e["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(i,e,t){t.r(e),e["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(i,e,t){t.r(e),e["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(i,e,t){t.r(e),function(r,n){t.d(e,"requestAnimationFrame",function(){return c;}),t.d(e,"cancelAnimationFrame",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);function s(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(r)<"u"&&r.hrtime){var _r$hrtime=r.hrtime(),_r$hrtime2=_slicedToArray(_r$hrtime,2),f=_r$hrtime2[0],h=_r$hrtime2[1];return f*1e3+h*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var c,l;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(c=n.requestAnimationFrame,l=n.cancelAnimationFrame):(c=function c(f){return setTimeout(function(){f(s());},16);},l=function l(f){return clearTimeout(f);});}.call(this,t(69),t(22));},/* 69 *//***/function(i,e){var t=i.exports={},r,n;function s(){throw new Error("setTimeout has not been defined");}function c(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=s;}catch(_unused4){r=s;}try{typeof clearTimeout=="function"?n=clearTimeout:n=c;}catch(_unused5){n=c;}})();function l(I){if(r===setTimeout)return setTimeout(I,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(I,0);try{return r(I,0);}catch(_unused6){try{return r.call(null,I,0);}catch(_unused7){return r.call(this,I,0);}}}function f(I){if(n===clearTimeout)return clearTimeout(I);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(I);try{return n(I);}catch(_unused8){try{return n.call(null,I);}catch(_unused9){return n.call(this,I);}}}var h=[],m=!1,u,y=-1;function T(){!m||!u||(m=!1,u.length?h=u.concat(h):y=-1,h.length&&E());}function E(){if(!m){var I=l(T);m=!0;for(var d=h.length;d;){for(u=h,h=[];++y<d;)u&&u[y].run();y=-1,d=h.length;}u=null,m=!1,f(I);}}t.nextTick=function(I){var d=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)d[v-1]=arguments[v];h.push(new C(I,d)),h.length===1&&!m&&l(E);};function C(I,d){this.fun=I,this.array=d;}C.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function x(){}t.on=x,t.addListener=x,t.once=x,t.off=x,t.removeListener=x,t.removeAllListeners=x,t.emit=x,t.prependListener=x,t.prependOnceListener=x,t.listeners=function(I){return[];},t.binding=function(I){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(I){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return D;});var r=t(1),n=t(71),s=t(73),c=t(213),l=t(214),f=t(215),h=t(216);t(1).glMatrix.setMatrixArrayType(Array);function m(U,M){var W=Object.keys(U);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(U);M&&(Y=Y.filter(function(B){return Object.getOwnPropertyDescriptor(U,B).enumerable;})),W.push.apply(W,Y);}return W;}function u(U){for(var M=1;M<arguments.length;M++){var W=arguments[M]!=null?arguments[M]:{};M%2?m(Object(W),!0).forEach(function(Y){y(U,Y,W[Y]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(W)):m(Object(W)).forEach(function(Y){Object.defineProperty(U,Y,Object.getOwnPropertyDescriptor(W,Y));});}return U;}function y(U,M,W){return M in U?Object.defineProperty(U,M,{value:W,enumerable:!0,configurable:!0,writable:!0}):U[M]=W,U;}var T=Symbol["for"]("spritejs_changedAttrs"),E=Symbol["for"]("spritejs_attributes"),C=Symbol("resolution"),x=Symbol("animations"),I=Symbol("eventListeners"),d=Symbol("captureEventListeners"),v=Symbol("filters"),p=Symbol("display"),S=Symbol("program"),A=Symbol("shaderAttrs"),R=Symbol("uniforms");var D=/*#__PURE__*/function(){function D(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,D);this.attributes=new this.constructor.Attr(this),this[C]={width:300,height:150},Object.assign(this.attributes,M),this[x]=/* @__PURE__ */new Set(),this[I]={},this[d]={};}return _createClass(D,[{key:"ancestors",get:function get(){var M=this.parent;var W=[];for(;M;)W.push(M),M=M.parent;return W;}},{key:"animations",get:function get(){return this[x];}},{key:"filters",get:function get(){return this[v]||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 M=this.transformMatrix,_this$attributes=this.attributes,W=_this$attributes.x,Y=_this$attributes.y;return M[4]+=W,M[5]+=Y,M;}},{key:"opacity",get:function get(){var M=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(M*=this.parent.opacity),M;}},{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[S];}/* 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 M=this.localMatrix;var W=this.parent;if(W){var Y=W.__cacheRenderMatrix||W.renderMatrix;Y&&(M=r.mat2d.multiply(Array.of(0,0,0,0,0,0),Y,M));}return M;}},{key:"worldScaling",get:function get(){var M=this.renderMatrix;return[Math.hypot(M[0],M[1]),Math.hypot(M[2],M[3])];}},{key:"worldRotation",get:function get(){var M=this.renderMatrix;return Math.atan2(M[1],M[3]);}},{key:"worldPosition",get:function get(){var M=this.renderMatrix;return[M[4],M[5]];}},{key:"uniforms",get:function get(){return this[R];}/* get zOrder defined by connect method *//* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(M){this.attributes.className=M;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(M){this.attributes.id=M;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(M){this.attributes.name=M;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(M){this.attributes.zIndex=M;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[A]||{};}},{key:"activateAnimations",value:function activateAnimations(){var M=this.layer;if(M){var W=this[x];W.forEach(function(B){B.baseTimeline=M.timeline,B.play(),B.finished.then(function(){W["delete"](B);});});var Y=this.children;Y&&Y.forEach(function(B){B.activateAnimations&&B.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(M,W){var Y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};M==="mousewheel"&&(M="wheel"),typeof Y=="boolean"&&(Y={capture:Y});var _Y8=Y,B=_Y8.capture,N=_Y8.once,G=B?d:I;return this[G][M]=this[G][M]||[],this[G][M].push({listener:W,once:N}),this;}},{key:"animate",value:function animate(M,W){var _this8=this;var Y=new s["default"](this,M,W);return this.effects&&Y.applyEffects(this.effects),this.layer&&(Y.baseTimeline=this.layer.timeline,Y.play(),Y.finished.then(function(){_this8[x]["delete"](Y);})),this[x].add(Y),Y;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,M=new Array(_len7),_key7=0;_key7<_len7;_key7++){M[_key7]=arguments[_key7];}if(M.length===0)return this.attributes[E];if(M.length>1){var W=M[0],Y=M[1];return typeof Y=="function"&&(Y=Y(this.attr(W))),this.setAttribute(W,Y),this;}return typeof M[0]=="string"?this.getAttribute(M[0]):(Object.assign(this.attributes,M[0]),this);}},{key:"cloneNode",value:function cloneNode(){var M=new this.constructor(),W=this.attributes[T];return M.attr(W),M;}},{key:"connect",value:function connect(M,W){Object.defineProperty(this,"parent",{value:M,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:W,writable:!1,configurable:!0}),M.timeline&&this.activateAnimations(),this.setResolution(M.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:M,zOrder:W}});}},{key:"contains",value:function contains(M){for(;M&&this!==M;)M=M.parent;return!!M;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[x].forEach(function(W){return W.cancel();});var M=this.children;M&&M.forEach(function(W){W.deactivateAnimations&&W.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var M=this.parent,W=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:M,zOrder:W}}),M&&M.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(M){var _this9=this;M instanceof l["default"]||(M=new l["default"](M)),M.target=this;var W=M.type;W==="mousewheel"&&(W="wheel");var Y=[this];var B=this.parent;for(;M.bubbles&&B;)Y.push(B),B=B.parent;for(var N=Y.length-1;N>=0;N--){var G=Y[N],J=G[d]&&G[d][W];if(J&&J.length&&(M.currentTarget=G,J.forEach(function(_ref95){var tt=_ref95.listener,at=_ref95.once;tt.call(_this9,M),at&&Y.removeEventListener(tt);}),delete M.currentTarget),!M.bubbles&&M.cancelBubble)break;}if(!M.cancelBubble)for(var _N4=0;_N4<Y.length;_N4++){var _G=Y[_N4],_J3=_G[I]&&_G[I][W];if(_J3&&_J3.length&&(M.currentTarget=_G,_J3.forEach(function(_ref96){var tt=_ref96.listener,at=_ref96.once;tt.call(_this9,M),at&&Y.removeEventListener(tt);}),delete M.currentTarget),!M.bubbles||M.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(M){var W=M.layerX,Y=M.layerY;return this.isPointCollision(W,Y)?(this.dispatchEvent(M),!0):!1;}},{key:"draw",value:function draw(){var _this10=this;var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var W=this.mesh;if(W){if(Object(f.applyFilters)(W,this.filters),M.push(W),this[S]){W.setProgram(this[S]);var Y=this[A];Y&&Object.entries(Y).forEach(function(_ref97){var _ref98=_slicedToArray(_ref97,2),N=_ref98[0],G=_ref98[1];W.setAttribute(N,G);});var B=this[R];if(this[R]){var N={};Object.entries(B).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),G=_ref100[0],J=_ref100[1];typeof J=="function"&&(J=J(_this10,G)),N[G]=J;}),W.setUniforms(N);}}Object(h["default"])(this,W);}return M;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(M){return this.attributes[M];}},{key:"getListeners",value:function getListeners(M){var _ref101=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref101$capture=_ref101.capture,W=_ref101$capture===void 0?!1:_ref101$capture;return _toConsumableArray(this[W?d:I][M]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(M===0)return this;var W=this.parent.children,Y=W.indexOf(this);return W[Y+M];}},{key:"getWorldPosition",value:function getWorldPosition(M,W){var Y=this.renderMatrix,B=M*Y[0]+W*Y[2]+Y[4],N=M*Y[1]+W*Y[3]+Y[5];return[B,N];}},{key:"getOffsetPosition",value:function getOffsetPosition(M,W){var Y=r.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),B=M*Y[0]+W*Y[2]+Y[4],N=M*Y[1]+W*Y[3]+Y[5];return[B,N];}},{key:"getResolution",value:function getResolution(){return u({},this[C]);}},{key:"isPointCollision",value:function isPointCollision(M,W){if(!this.mesh)return!1;var Y=this.attributes.pointerEvents;if(Y==="none"||Y!=="all"&&!this.isVisible)return!1;var B="both";return Y==="visibleFill"&&(B="fill"),Y==="visibleStroke"&&(B="stroke"),this.mesh.isPointCollision(M,W,B);}},{key:"onPropertyChange",value:function onPropertyChange(M,W,Y){M!=="id"&&M!=="name"&&M!=="className"&&M!=="pointerEvents"&&M!=="passEvents"&&this.forceUpdate(),M==="filter"&&(this[v]=Object(f.parseFilterString)(W)),M==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(M,W){M==="attrs"&&this.attr(W),this.attributes[M]=W;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
202
+ },{key:"setProgram",value:function setProgram(M){this[S]=M,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(M,W){this[A]=this[A]||{},this[A][M]=W,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(M){this[R]=this[R]||{},Object.assign(this[R],M),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref102){var M=_ref102.width,W=_ref102.height;var _this$C3=this[C],Y=_this$C3.width,B=_this$C3.height;(Y!==M||B!==W)&&(this[C]={width:M,height:W},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:M,height:W}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[p]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[p]=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(M){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof W=="boolean"&&(W={capture:W});var B=W.capture?d:I;return this[B][M]&&(this[B][M]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(M){this.setAttribute(M,null);}},{key:"removeEventListener",value:function removeEventListener(M,W){var Y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof Y=="boolean"&&(Y={capture:Y});var N=Y.capture?d:I;if(this[N][M]){var G=this[N][M];if(G)for(var J=0;J<G.length;J++){var tt=G[J].listener;if(tt===W){this[N][M].splice(J,1);break;}}}return this;}},{key:"transition",value:function transition(M){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var Y=this,B=Symbol("animation");W=W||"linear";var N=0;return _typeof(M)=="object"&&(N=M.delay||0,M=M.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},B,null),"cancel",function cancel(){var G=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var J=this[B];J&&J.cancel(G);}),"end",function end(){var G=this[B];G&&(G.playState==="running"||G.playState==="pending")&&G.finish();}),"reverse",function reverse(){var G=this[B];if(G)if(G.playState==="running"||G.playState==="pending")G.playbackRate=-G.playbackRate;else{var J=G.timing.direction;G.timing.direction=J==="reverse"?"normal":"reverse",G.play();}return G.finished;}),"attr",function attr(G,J){return this.end(),typeof G=="string"&&(G=_defineProperty({},G,J)),Object.entries(G).forEach(function(_ref103){var _ref104=_slicedToArray(_ref103,2),tt=_ref104[0],at=_ref104[1];typeof at=="function"&&(G[tt]=at(Y.attr(tt)));}),this[B]=Y.animate([G],{duration:M*1e3,delay:N*1e3,fill:"forwards",easing:W}),this[B].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();y(D,"Attr",n["default"]),c["default"].registerNode(D,"node");},/* 71 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return D;});var r=t(1),n=t(12),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_declareAlias"),f=Symbol["for"]("spritejs_setAttribute"),h=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_attributes"),u=Symbol["for"]("spritejs_changedAttrs"),y=Symbol("subject"),T=Symbol("attr"),E=Symbol("default"),C=Symbol("alias");function x(U,_ref106){var _ref107=_slicedToArray(_ref106,2),M=_ref107[0],W=_ref107[1];var Y=r.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(U).forEach(function(_ref108){var _ref109=_slicedToArray(_ref108,2),B=_ref109[0],N=_ref109[1];if((M||W)&&(Y=r.mat2d.translate(Array.of(0,0,0,0,0,0),Y,[M,W])),B==="matrix")Y=r.mat2d.multiply(Y,Y,N);else if(B==="offsetTranslate")Y[4]+=N[0],Y[5]+=N[1];else if(B==="offsetRotate")Y=r.mat2d.rotate(Array.of(0,0,0,0,0,0),Y,N);else if(B==="skew"){var _N5=_slicedToArray(N,2),G=_N5[0],J=_N5[1];Y=r.mat2d.multiply(Y,Y,r.mat2d.fromValues(1,Math.tan(J),Math.tan(G),1,0,0));}else r.mat2d[B](Y,Y,N);(M||W)&&(Y=r.mat2d.translate(Array.of(0,0,0,0,0,0),Y,[-M,-W]));}),Y;}var I=Symbol("transformMatrix"),d=Symbol("transforms"),v=Symbol("changedAttrs"),p=Symbol("lastChangedAttr"),S=Symbol("offsetFigure");function A(U,M,W){var Y=U[T][M];if(U[f](M,W,!1)||U[p]!==M){var N=U[d];N.has(M)&&N["delete"](M),W&&(M==="rotate"&&(W=Math.PI*W/180),M==="scale"&&(W=W.map(function(G){return Math.abs(G)>1e-5?G:1/G>0?1e-5:-1e-5;})),N.set(M,W)),U[I]=null,U[y].onPropertyChange(M,W,Y,U);}}function R(U){var M=U[S],W=U.offsetDistance*M.getTotalLength(),Y=M.getPointAtLength(W);if(Y){var B=U[d];var N=U.offsetRotate;N==="auto"?N=Y.angle:N==="reverse"?N=Math.PI+Y.angle:N=Math.PI*N/180,B.set("offsetRotate",N),B.set("offsetTranslate",[Y.x,Y.y]),U[I]=null;}}var D=/*#__PURE__*/function(){function D(M){var _this11=this;_classCallCheck(this,D);this[y]=M,this[T]={},this[I]=r.mat2d.fromValues(1,0,0,1,0,0),this[d]=/* @__PURE__ */new Map(),this[E]={},this[C]=[],Object.defineProperty(M,"transformMatrix",{get:function get(){return _this11[I]||(_this11[I]=x(_this11[d],_this11.transformOrigin)),_toConsumableArray(_this11[I]);}}),this[c]({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
203
+ filter:"none",display:""}),this[l]("class","pos"),this[v]=/* @__PURE__ */new Set(),this[S]=new n.Figure2D({scale:5,simplify:0});}return _createClass(D,[{key:u,get:function get(){var _this12=this;var M={};return _toConsumableArray(this[v]).forEach(function(W){M[W]=_this12[T][W];}),M;}},{key:m,get:function get(){var M=Object.assign({},this[T]);for(var W=0;W<this[C].length;W++){var Y=this[C][W];M[Y]=this[Y];}return M;}},{key:c,value:function value(M){Object.assign(this[E],M),Object.assign(this[T],M);}},{key:l,value:function value(){var _this$C4;(_this$C4=this[C]).push.apply(_this$C4,arguments);}},{key:f,value:function value(M,W){var Y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var B=this[T][M],N=this[y];return W==null&&(W=this[E][M]),Object(s.compareValue)(B,W)?!1:(this[T][M]=W,this[v].has(M)&&this[v]["delete"](M),this[v].add(M),this[p]=M,Y&&N.onPropertyChange(M,W,B,this),!0);}},{key:h,value:function value(M){return this[T][M];}},{key:"id",get:function get(){return this[h]("id");},set:function set(M){this[f]("id",M);}},{key:"name",get:function get(){return this[h]("name");},set:function set(M){this[f]("name",M);}},{key:"className",get:function get(){return this[h]("className");},set:function set(M){this[f]("className",M);}},{key:"class",get:function get(){return this.className;},set:function set(M){this.className=M;}},{key:"x",get:function get(){return this[h]("x");},set:function set(M){this[f]("x",Object(s.toNumber)(M));}},{key:"y",get:function get(){return this[h]("y");},set:function set(M){this[f]("y",Object(s.toNumber)(M));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(M){M=Object(s.toArray)(M),Array.isArray(M)||(M=[M,M]),this.x=M[0],this.y=M[1];}},{key:"transform",get:function get(){return this[h]("transform");},set:function set(M){var W=null;if(Array.isArray(M)&&(W=M,M="matrix(".concat(M.map(s.toNumber).join(),")")),typeof M=="string")M=M.replace(/\s*,\s*/g,",");else if(M!=null)throw new TypeError("Invalid transform value.");var Y=this[T].transform;if(this[f]("transform",M,!1)){var B=this[d];if(B.has("matrix")&&B["delete"]("matrix"),W)B.set("matrix",W);else if(M){var N=M.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(N){var G=r.mat2d.fromValues(1,0,0,1,0,0);for(var J=0;J<N.length;J++){var at=N[J].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(at){var _at2=_slicedToArray(at,3),ut=_at2[1],K=_at2[2];ut==="rotate"?K=Math.PI*parseFloat(K)/180:K=K.trim().split(/[\s,]+/).map(function(Q){return Object(s.toNumber)(Q);}),ut==="matrix"?G=r.mat2d.multiply(G,G,K):ut==="skew"?G=r.mat2d.multiply(G,G,r.mat2d.fromValues(1,Math.tan(K[1]),Math.tan(K[0]),1,0,0)):r.mat2d[ut](G,G,K),B.set("matrix",G);}}}else throw new TypeError("Invalid transform value.");}this[I]=null,this[y].onPropertyChange("transform",M,Y,this);}}},{key:"transformOrigin",get:function get(){return this[h]("transformOrigin");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),this[f]("transformOrigin",M)&&(this[I]=null);}},{key:"rotate",get:function get(){return this[h]("rotate");},set:function set(M){A(this,"rotate",M);}},{key:"translate",get:function get(){return this[h]("translate");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),A(this,"translate",M);}},{key:"scale",get:function get(){return this[h]("scale");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),A(this,"scale",M);}},{key:"skew",get:function get(){return this[h]("skew");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),A(this,"skew",M);}},{key:"opacity",get:function get(){return this[h]("opacity");},set:function set(M){M!=null&&(M=Number(M)),this[f]("opacity",M);}},{key:"zIndex",get:function get(){return this[h]("zIndex");},set:function set(M){M!=null&&(M=Number(M)),this[f]("zIndex",M);}},{key:"offsetPath",get:function get(){return this[h]("offsetPath");},set:function set(M){this[f]("offsetPath",M)&&(this[S].beginPath(),M!=null&&this[S].addPath(M),R(this));}},{key:"offsetDistance",get:function get(){return this[h]("offsetDistance");},set:function set(M){this[f]("offsetDistance",Object(s.toNumber)(M))&&R(this);}},{key:"offsetRotate",get:function get(){return this[h]("offsetRotate");},set:function set(M){this[f]("offsetRotate",M),R(this);}},{key:"pointerEvents",get:function get(){return this[h]("pointerEvents");},set:function set(M){if(M!=null&&M!=="none"&&M!=="visible"&&M!=="visibleFill"&&M!=="visibleStroke"&&M!=="all")throw new TypeError("Invalid pointerEvents type.");this[f]("pointerEvents",M);}},{key:"filter",get:function get(){return this[h]("filter");},set:function set(M){this[f]("filter",M);}},{key:"display",get:function get(){return this[h]("display");},set:function set(M){this[f]("display",M);}/* istanbul ignore next */},{key:"offset",set:function set(M){}}],[{key:"setDefault",value:function setDefault(M){for(var _len8=arguments.length,W=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){W[_key8-1]=arguments[_key8];}return M[c].apply(M,W);}},{key:"declareAlias",value:function declareAlias(M){for(var _len9=arguments.length,W=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){W[_key9-1]=arguments[_key9];}return M[l].apply(M,W);}},{key:"setAttribute",value:function setAttribute(M){for(var _len10=arguments.length,W=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){W[_key10-1]=arguments[_key10];}return M[f].apply(M,W);}},{key:"getAttribute",value:function getAttribute(M){for(var _len11=arguments.length,W=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){W[_key11-1]=arguments[_key11];}return M[h].apply(M,W);}},{key:"getAttributes",value:function getAttributes(M){return M[m];}},{key:"getChangedAttributes",value:function getChangedAttributes(M){return M[u];}}]);}();},/* 72 *//***/function(i,e,t){t.r(e),t.d(e,"sizeToPixel",function(){return r;}),t.d(e,"toString",function(){return n;}),t.d(e,"toNumber",function(){return s;}),t.d(e,"toArray",function(){return c;}),t.d(e,"compareValue",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);function r(f,h){var m=f.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);m?f={size:parseFloat(m[1]),unit:m[2]}:f={size:parseFloat(f),unit:"px"};var _f3=f,u=_f3.size,y=_f3.unit;if(y==="pt")u/=0.75;else if(y==="pc")u*=16;else if(y==="in")u*=96;else if(y==="cm")u*=37.79527559055118;else if(y==="mm")u*=3.7795275590551185;else if(y==="em"||y==="rem"||y==="ex"){if(!h&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var T=getComputedStyle(document.documentElement).fontSize;T?h=r(T,16):h=16;}u*=h,y==="ex"&&(u/=2);}else if(y==="q")u*=0.9448818897637796;else if(y==="vw"||y==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _T4=y==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;u*=_T4/100;}}else if((y==="vmax"||y==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _T5=window.innerWidth||document.documentElement.clientWidth,E=window.innerHeight||document.documentElement.clientHeight;y==="vmax"?u*=Math.max(_T5,E)/100:u*=Math.min(_T5,E)/100;}return u;}function n(f){return f==null?f:String(f);}function s(f){if(f==null)return f;if(typeof f=="string"&&(f=r(f)),!Number.isFinite(f))throw new TypeError("Invalid value");return f;}function c(f){var h=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return f===""?null:(typeof f=="string"&&(f=f.split(/[\s,]+/g)),Array.isArray(f)&&(h&&(f=f.map(s)),f.length===1)?f[0]:f);}function l(f,h){if(Array.isArray(f)&&Array.isArray(h)){if(f.length!==h.length)return!1;for(var m=0;m<f.length;m++)if(f[m]!==h[m])return!1;return!0;}return f==null&&h==null||f===h;}},/* 73 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return y;});var r=t(74),n=t(32),s=/* @__PURE__ */t.n(n),c=t(68),l=t(72);t(1).glMatrix.setMatrixArrayType(Array);function f(){return f=Object.assign||function(T){for(var E=1;E<arguments.length;E++){var C=arguments[E];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(T[x]=C[x]);}return T;},f.apply(this,arguments);}function h(T){if(typeof T=="string"){if(T=T.trim(),/^[0-9.]+%$/.test(T))return parseFloat(T)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(T))return Object(l.sizeToPixel)(T);}return T;}function m(T,E,C,x,I){return typeof T=="string"&&(T=s()(T)),typeof E=="string"&&(E=s()(E)),r.Effects["default"](T,E,C,x,I);}function u(T,E,C,x,I){return r.Effects["default"](T,E,C,x,I);}r.Effects["default"]=function(T,E,C,x,I){return Array.isArray(T)&&Array.isArray(E)?T.map(function(d,v){return d+(C-x)/(I-x)*(E[v]-d);}):typeof T=="number"&&typeof E=="number"?T+(C-x)/(I-x)*(E-T):C-x>I-C?E:T;},r.Effects.fillColor=m,r.Effects.strokeColor=m,r.Effects.bgcolor=m,r.Effects.borderColor=m,r.Effects.text=u;var y=/*#__PURE__*/function(_r$Animator){function y(E,C,x){var _this13;_classCallCheck(this,y);var I=E.attr();Object.entries(I).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),d=_ref111[0],v=_ref111[1];I[d]=r.Effects[d]?v:h(v);}),C=C.map(function(d){var v=f({},d);var p={};return Object.entries(v).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),S=_ref113[0],A=_ref113[1];p[S]=r.Effects[S]?A:h(A);}),p;}),_this13=_callSuper(this,y,[I,C,x]),_this13.target=E,_this13.setter=function(d,v){v.attr(d);};return _this13;}_inherits(y,_r$Animator);return _createClass(y,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(y,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this14=this;return _superPropGet(y,"finished",this,1).then(function(){var E=_this14;return new Promise(function(C){function x(){E.setter(E.frame,E.target);var I=E.playState;I==="finished"||I==="idle"?(Object(c.cancelAnimationFrame)(E.requestId),C()):Object(c.requestAnimationFrame)(x);}x();});});}},{key:"finish",value:function finish(){_superPropGet(y,"finish",this,3)([]),Object(c.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(y,"play",this,3)([]),this.setter(this.frame,this.target);var E=this;this.ready.then(function(){E.setter(E.frame,E.target),E.requestId=Object(c.requestAnimationFrame)(function C(){var x=E.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&x.layer&&x.layer.canvas&&!document.documentElement.contains(x.layer.canvas)){E.cancel();return;}var I=E.playState;E.setter(E.frame,E.target),I!=="idle"&&(I==="running"?E.requestId=Object(c.requestAnimationFrame)(C):(I==="paused"||I==="pending"&&E.timeline.currentTime<0)&&E.ready.then(function(){E.setter(E.frame,E.target),E.requestId=Object(c.requestAnimationFrame)(C);}));});});}},{key:"cancel",value:function cancel(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(c.cancelAnimationFrame)(this.requestId),E?(this.setter(this.frame,this.target),_superPropGet(y,"cancel",this,3)([])):(_superPropGet(y,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(r.Animator);},/* 74 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=e.Effects=e.Easings=e.Animator=void 0;var r=t(75),n=m(r),s=t(187),c=m(s),l=t(188),f=t(190),h=m(f);function m(u){return u&&u.__esModule?u:{"default":u};}e.Animator=h["default"],e.Easings=l.Easings,e.Effects=c["default"],e.Timeline=n["default"];},/* 75 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=d(r),s=t(133),c=d(s),l=t(141),f=d(l),h=t(164),m=d(h),u=t(170),y=d(u),T=t(171),E=d(T),C=t(175),x=d(C),I=t(186);function d(Y){return Y&&Y.__esModule?Y:{"default":Y};}var v=(0,I.createNowTime)(),p={originTime:0,playbackRate:1},S=(0,x["default"])("timeMark"),A=(0,x["default"])("playbackRate"),R=(0,x["default"])("timers"),D=(0,x["default"])("originTime"),U=(0,x["default"])("setTimer"),M=(0,x["default"])("parent"),W=function(){function Y(B,N){(0,y["default"])(this,Y),B instanceof Y&&(N=B,B={}),B=(0,m["default"])({},p,B),N&&(this[M]=N);var G=B.nowtime||v;if(N)Object.defineProperty(this,"globalTime",{get:function get(){return N.currentTime;}});else{var J=G();Object.defineProperty(this,"globalTime",{get:function get(){return G()-J;}});}this[S]=[{globalTime:this.globalTime,localTime:-B.originTime,entropy:-B.originTime,playbackRate:B.playbackRate,globalEntropy:0}],this[M]&&(this[S][0].globalEntropy=this[M].entropy),this[D]=B.originTime,this[A]=B.playbackRate,this[R]=new f["default"]();}return(0,E["default"])(Y,[{key:"markTime",value:function value(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},G=N.time,J=G===void 0?this.currentTime:G,tt=N.entropy,at=tt===void 0?this.entropy:tt,ut=N.playbackRate,K=ut===void 0?this.playbackRate:ut,Q={globalTime:this.globalTime,localTime:J,entropy:at,playbackRate:K,globalEntropy:this.globalEntropy};this[S].push(Q);}},{key:"fork",value:function value(N){return new Y(N,this);}},{key:"seekGlobalTime",value:function value(N){var G=this.seekTimeMark(N),J=this[S][G],tt=J.entropy,at=J.playbackRate,ut=J.globalTime;return ut+(N-tt)/Math.abs(at);}},{key:"seekLocalTime",value:function value(N){var G=this.seekTimeMark(N),J=this[S][G],tt=J.localTime,at=J.entropy,ut=J.playbackRate;return ut>0?tt+(N-at):tt-(N-at);}},{key:"seekTimeMark",value:function value(N){var G=this[S],J=0,tt=G.length-1;if(N<=G[J].entropy)return J;if(N>=G[tt].entropy)return tt;for(var at=Math.floor((J+tt)/2);at>J&&at<tt;){if(N===G[at].entropy)return at;N<G[at].entropy?tt=at:N>G[at].entropy&&(J=at),at=Math.floor((J+tt)/2);}return J;}},{key:"updateTimers",value:function value(){var N=this,G=[].concat((0,c["default"])(this[R]));G.forEach(function(J){var tt=(0,n["default"])(J,2),at=tt[0],ut=tt[1];N[U](ut.handler,ut.time,at);});}},{key:"clearTimeout",value:function(B){function N(G){return B.apply(this,arguments);}return N.toString=function(){return B.toString();},N;}(function(B){var N=this[R].get(B);N&&N.timerID!=null&&(this[M]?this[M].clearTimeout(N.timerID):clearTimeout(N.timerID)),this[R]["delete"](B);})},{key:"clearInterval",value:function value(N){return this.clearTimeout(N);}},{key:"clear",value:function value(){var N=this,G=this[R];[].concat((0,c["default"])(G.keys())).forEach(function(J){N.clearTimeout(J);});}/*
204
+ setTimeout(func, {delay: 100, isEntropy: true})
205
+ setTimeout(func, {entropy: 100})
206
+ setTimeout(func, 100})
207
+ */},{key:"setTimeout",value:function value(N){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[U](N,G);}},{key:"setInterval",value:function value(N){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},J=this,tt=this[U](function at(){J[U](at,G,tt),N();},G);return tt;}},{key:U,value:function value(N,G){var J=this,tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,x["default"])("timerID");G=(0,I.formatDelay)(G);var at=this[R].get(tt),ut=void 0,K=null,Q=void 0,ft=void 0;at?(this.clearTimeout(tt),G.isEntropy?ut=(G.delay-(this.entropy-at.startEntropy))/Math.abs(this.playbackRate):ut=(G.delay-(this.currentTime-at.startTime))/this.playbackRate,Q=at.startTime,ft=at.startEntropy):(ut=G.delay/(G.isEntropy?Math.abs(this.playbackRate):this.playbackRate),Q=this.currentTime,ft=this.entropy);var gt=this[M],mt=gt?gt.setTimeout.bind(gt):setTimeout,wt=G.heading;return!gt&&wt===!1&&ut<0&&(ut=1/0),(isFinite(ut)||gt)&&(ut=Math.ceil(ut),mt!==setTimeout&&(ut={delay:ut,heading:wt}),K=mt(function(){J[R]["delete"](tt),N();},ut)),this[R].set(tt,{timerID:K,handler:N,time:G,startTime:Q,startEntropy:ft}),tt;}},{key:"parent",get:function get(){return this[M];}},{key:"lastTimeMark",get:function get(){return this[S][this[S].length-1];}},{key:"currentTime",get:function get(){var N=this.lastTimeMark,G=N.localTime,J=N.globalTime;return G+(this.globalTime-J)*this.playbackRate;},set:function set(N){var G=this,J=this.currentTime,tt=N,at=this[R];this.markTime({time:N}),[].concat((0,c["default"])(at)).forEach(function(ut){var K=(0,n["default"])(ut,2),Q=K[0],ft=K[1];if(at.has(Q)){var gt=ft.time,mt=gt.isEntropy,wt=gt.delay,ht=gt.heading,Nt=ft.handler,Rt=ft.startTime;if(mt)wt===0&&(Nt(),G.clearTimeout(Q));else{var X=Rt+wt;(wt===0||ht!==!1&&(tt-J)*wt<=0||J<=X&&X<=tt||J>=X&&X>=tt)&&(Nt(),G.clearTimeout(Q));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
208
+ // If current playbackRate is negative, the currentTime should go backwards
209
+ // while the entropy remain to go forwards.
210
+ // Both of the initial values is set to -originTime
211
+ },{key:"entropy",get:function get(){var N=this.lastTimeMark,G=N.entropy,J=N.globalEntropy;return G+Math.abs((this.globalEntropy-J)*this.playbackRate);},// get globalTime() {
212
+ // if(this[_parent]) {
213
+ // return this[_parent].currentTime;
214
+ // }
215
+ // return nowtime();
216
+ // }
217
+ // change entropy will NOT cause currentTime changing but may influence the pass
218
+ // and the future of the timeline. (It may change the result of seek***Time)
219
+ // While entropy is set, all the marks behind will be droped
220
+ set:function set(N){if(this.entropy>N){var G=this.seekTimeMark(N);this[S].length=G+1;}this.markTime({entropy:N}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[M]?this[M].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[A];},set:function set(N){N!==this.playbackRate&&(this.markTime({playbackRate:N}),this[A]=N,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var N=this.parent;N;){if(N.playbackRate===0)return!0;N=N.parent;}return!1;}}]),Y;}();e["default"]=W;},/* 76 *//***/function(i,e,t){e.__esModule=!0;var r=t(77),n=l(r),s=t(129),c=l(s);function l(f){return f&&f.__esModule?f:{"default":f};}e["default"]=/* @__PURE__ */function(){function f(h,m){var u=[],y=!0,T=!1,E=void 0;try{for(var C=(0,c["default"])(h),x;!(y=(x=C.next()).done)&&(u.push(x.value),!(m&&u.length===m));y=!0);}catch(I){T=!0,E=I;}finally{try{!y&&C["return"]&&C["return"]();}finally{if(T)throw E;}}return u;}return function(h,m){if(Array.isArray(h))return h;if((0,n["default"])(Object(h)))return f(h,m);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 *//***/function(i,e,t){i.exports={"default":t(78),__esModule:!0};},/* 78 *//***/function(i,e,t){t(79),t(125),i.exports=t(127);},/* 79 *//***/function(i,e,t){t(80);for(var r=t(91),n=t(95),s=t(83),c=t(122)("toStringTag"),l="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(","),f=0;f<l.length;f++){var h=l[f],m=r[h],u=m&&m.prototype;u&&!u[c]&&n(u,c,h),s[h]=s.Array;}},/* 80 *//***/function(i,e,t){var r=t(81),n=t(82),s=t(83),c=t(84);i.exports=t(88)(Array,"Array",function(l,f){this._t=c(l),this._i=0,this._k=f;},function(){var l=this._t,f=this._k,h=this._i++;return!l||h>=l.length?(this._t=void 0,n(1)):f=="keys"?n(0,h):f=="values"?n(0,l[h]):n(0,[h,l[h]]);},"values"),s.Arguments=s.Array,r("keys"),r("values"),r("entries");},/* 81 *//***/function(i,e){i.exports=function(){};},/* 82 *//***/function(i,e){i.exports=function(t,r){return{value:r,done:!!t};};},/* 83 *//***/function(i,e){i.exports={};},/* 84 *//***/function(i,e,t){var r=t(85),n=t(87);i.exports=function(s){return r(n(s));};},/* 85 *//***/function(i,e,t){var r=t(86);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return r(n)=="String"?n.split(""):Object(n);};},/* 86 *//***/function(i,e){var t={}.toString;i.exports=function(r){return t.call(r).slice(8,-1);};},/* 87 *//***/function(i,e){i.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 *//***/function(i,e,t){var r=t(89),n=t(90),s=t(106),c=t(95),l=t(83),f=t(107),h=t(121),m=t(123),u=t(122)("iterator"),y=!([].keys&&"next"in[].keys()),T="@@iterator",E="keys",C="values",x=function x(){return this;};i.exports=function(I,d,v,p,S,A,R){f(v,d,p);var D=function D(K){if(!y&&K in Y)return Y[K];switch(K){case E:return function(){return new v(this,K);};case C:return function(){return new v(this,K);};}return function(){return new v(this,K);};},U=d+" Iterator",M=S==C,W=!1,Y=I.prototype,B=Y[u]||Y[T]||S&&Y[S],N=B||D(S),G=S?M?D("entries"):N:void 0,J=d=="Array"&&Y.entries||B,tt,at,ut;if(J&&(ut=m(J.call(new I())),ut!==Object.prototype&&ut.next&&(h(ut,U,!0),!r&&typeof ut[u]!="function"&&c(ut,u,x))),M&&B&&B.name!==C&&(W=!0,N=function N(){return B.call(this);}),(!r||R)&&(y||W||!Y[u])&&c(Y,u,N),l[d]=N,l[U]=x,S)if(tt={values:M?N:D(C),keys:A?N:D(E),entries:G},R)for(at in tt)at in Y||s(Y,at,tt[at]);else n(n.P+n.F*(y||W),d,tt);return tt;};},/* 89 *//***/function(i,e){i.exports=!0;},/* 90 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(93),c=t(95),l=t(105),f="prototype",_h2=function h(m,u,y){var T=m&_h2.F,E=m&_h2.G,C=m&_h2.S,x=m&_h2.P,I=m&_h2.B,d=m&_h2.W,v=E?n:n[u]||(n[u]={}),p=v[f],S=E?r:C?r[u]:(r[u]||{})[f],A,R,D;E&&(y=u);for(A in y)R=!T&&S&&S[A]!==void 0,!(R&&l(v,A))&&(D=R?S[A]:y[A],v[A]=E&&typeof S[A]!="function"?y[A]:I&&R?s(D,r):d&&S[A]==D?function(U){var M=function M(W,Y,B){if(this instanceof U){switch(arguments.length){case 0:return new U();case 1:return new U(W);case 2:return new U(W,Y);}return new U(W,Y,B);}return U.apply(this,arguments);};return M[f]=U[f],M;}(D):x&&typeof D=="function"?s(Function.call,D):D,x&&((v.virtual||(v.virtual={}))[A]=D,m&_h2.R&&p&&!p[A]&&c(p,A,D)));};_h2.F=1,_h2.G=2,_h2.S=4,_h2.P=8,_h2.B=16,_h2.W=32,_h2.U=64,_h2.R=128,i.exports=_h2;},/* 91 *//***/function(i,e){var t=i.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(i,e){var t=i.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 *//***/function(i,e,t){var r=t(94);i.exports=function(n,s,c){if(r(n),s===void 0)return n;switch(c){case 1:return function(l){return n.call(s,l);};case 2:return function(l,f){return n.call(s,l,f);};case 3:return function(l,f,h){return n.call(s,l,f,h);};}return function(){return n.apply(s,arguments);};};},/* 94 *//***/function(i,e){i.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 *//***/function(i,e,t){var r=t(96),n=t(104);i.exports=t(100)?function(s,c,l){return r.f(s,c,n(1,l));}:function(s,c,l){return s[c]=l,s;};},/* 96 *//***/function(i,e,t){var r=t(97),n=t(99),s=t(103),c=Object.defineProperty;e.f=t(100)?Object.defineProperty:function(f,h,m){if(r(f),h=s(h,!0),r(m),n)try{return c(f,h,m);}catch(_unused10){}if("get"in m||"set"in m)throw TypeError("Accessors not supported!");return"value"in m&&(f[h]=m.value),f;};},/* 97 *//***/function(i,e,t){var r=t(98);i.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n;};},/* 98 *//***/function(i,e){i.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 *//***/function(i,e,t){i.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 *//***/function(i,e,t){i.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 *//***/function(i,e){i.exports=function(t){try{return!!t();}catch(_unused11){return!0;}};},/* 102 *//***/function(i,e,t){var r=t(98),n=t(91).document,s=r(n)&&r(n.createElement);i.exports=function(c){return s?n.createElement(c):{};};},/* 103 *//***/function(i,e,t){var r=t(98);i.exports=function(n,s){if(!r(n))return n;var c,l;if(s&&typeof(c=n.toString)=="function"&&!r(l=c.call(n))||typeof(c=n.valueOf)=="function"&&!r(l=c.call(n))||!s&&typeof(c=n.toString)=="function"&&!r(l=c.call(n)))return l;throw TypeError("Can't convert object to primitive value");};},/* 104 *//***/function(i,e){i.exports=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r};};},/* 105 *//***/function(i,e){var t={}.hasOwnProperty;i.exports=function(r,n){return t.call(r,n);};},/* 106 *//***/function(i,e,t){i.exports=t(95);},/* 107 *//***/function(i,e,t){var r=t(108),n=t(104),s=t(121),c={};t(95)(c,t(122)("iterator"),function(){return this;}),i.exports=function(l,f,h){l.prototype=r(c,{next:n(1,h)}),s(l,f+" Iterator");};},/* 108 *//***/function(i,e,t){var r=t(97),n=t(109),s=t(119),c=t(116)("IE_PROTO"),l=function l(){},f="prototype",_h3=function h(){var m=t(102)("iframe"),u=s.length,y="<",T=">",E;for(m.style.display="none",t(120).appendChild(m),m.src="javascript:",E=m.contentWindow.document,E.open(),E.write(y+"script"+T+"document.F=Object"+y+"/script"+T),E.close(),_h3=E.F;u--;)delete _h3[f][s[u]];return _h3();};i.exports=Object.create||function(u,y){var T;return u!==null?(l[f]=r(u),T=new l(),l[f]=null,T[c]=u):T=_h3(),y===void 0?T:n(T,y);};},/* 109 *//***/function(i,e,t){var r=t(96),n=t(97),s=t(110);i.exports=t(100)?Object.defineProperties:function(l,f){n(l);for(var h=s(f),m=h.length,u=0,y;m>u;)r.f(l,y=h[u++],f[y]);return l;};},/* 110 *//***/function(i,e,t){var r=t(111),n=t(119);i.exports=Object.keys||function(c){return r(c,n);};},/* 111 *//***/function(i,e,t){var r=t(105),n=t(84),s=t(112)(!1),c=t(116)("IE_PROTO");i.exports=function(l,f){var h=n(l),m=0,u=[],y;for(y in h)y!=c&&r(h,y)&&u.push(y);for(;f.length>m;)r(h,y=f[m++])&&(~s(u,y)||u.push(y));return u;};},/* 112 *//***/function(i,e,t){var r=t(84),n=t(113),s=t(115);i.exports=function(c){return function(l,f,h){var m=r(l),u=n(m.length),y=s(h,u),T;if(c&&f!=f){for(;u>y;)if(T=m[y++],T!=T)return!0;}else for(;u>y;y++)if((c||y in m)&&m[y]===f)return c||y||0;return!c&&-1;};};},/* 113 *//***/function(i,e,t){var r=t(114),n=Math.min;i.exports=function(s){return s>0?n(r(s),9007199254740991):0;};},/* 114 *//***/function(i,e){var t=Math.ceil,r=Math.floor;i.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n);};},/* 115 *//***/function(i,e,t){var r=t(114),n=Math.max,s=Math.min;i.exports=function(c,l){return c=r(c),c<0?n(c+l,0):s(c,l);};},/* 116 *//***/function(i,e,t){var r=t(117)("keys"),n=t(118);i.exports=function(s){return r[s]||(r[s]=n(s));};},/* 117 *//***/function(i,e,t){var r=t(92),n=t(91),s="__core-js_shared__",c=n[s]||(n[s]={});(i.exports=function(l,f){return c[l]||(c[l]=f!==void 0?f:{});})("versions",[]).push({version:r.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 *//***/function(i,e){var t=0,r=Math.random();i.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+r).toString(36));};},/* 119 *//***/function(i,e){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 *//***/function(i,e,t){var r=t(91).document;i.exports=r&&r.documentElement;},/* 121 *//***/function(i,e,t){var r=t(96).f,n=t(105),s=t(122)("toStringTag");i.exports=function(c,l,f){c&&!n(c=f?c:c.prototype,s)&&r(c,s,{configurable:!0,value:l});};},/* 122 *//***/function(i,e,t){var r=t(117)("wks"),n=t(118),s=t(91).Symbol,c=typeof s=="function",l=i.exports=function(f){return r[f]||(r[f]=c&&s[f]||(c?s:n)("Symbol."+f));};l.store=r;},/* 123 *//***/function(i,e,t){var r=t(105),n=t(124),s=t(116)("IE_PROTO"),c=Object.prototype;i.exports=Object.getPrototypeOf||function(l){return l=n(l),r(l,s)?l[s]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null;};},/* 124 *//***/function(i,e,t){var r=t(87);i.exports=function(n){return Object(r(n));};},/* 125 *//***/function(i,e,t){var r=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,s=this._i,c;return s>=n.length?{value:void 0,done:!0}:(c=r(n,s),this._i+=c.length,{value:c,done:!1});});},/* 126 *//***/function(i,e,t){var r=t(114),n=t(87);i.exports=function(s){return function(c,l){var f=String(n(c)),h=r(l),m=f.length,u,y;return h<0||h>=m?s?"":void 0:(u=f.charCodeAt(h),u<55296||u>56319||h+1===m||(y=f.charCodeAt(h+1))<56320||y>57343?s?f.charAt(h):u:s?f.slice(h,h+2):(u-55296<<10)+(y-56320)+65536);};};},/* 127 *//***/function(i,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);i.exports=t(92).isIterable=function(c){var l=Object(c);return l[n]!==void 0||"@@iterator"in l||s.hasOwnProperty(r(l));};},/* 128 *//***/function(i,e,t){var r=t(86),n=t(122)("toStringTag"),s=r(/* @__PURE__ */function(){return arguments;}())=="Arguments",c=function c(l,f){try{return l[f];}catch(_unused12){}};i.exports=function(l){var f,h,m;return l===void 0?"Undefined":l===null?"Null":typeof(h=c(f=Object(l),n))=="string"?h:s?r(f):(m=r(f))=="Object"&&typeof f.callee=="function"?"Arguments":m;};},/* 129 *//***/function(i,e,t){i.exports={"default":t(130),__esModule:!0};},/* 130 *//***/function(i,e,t){t(79),t(125),i.exports=t(131);},/* 131 *//***/function(i,e,t){var r=t(97),n=t(132);i.exports=t(92).getIterator=function(s){var c=n(s);if(typeof c!="function")throw TypeError(s+" is not iterable!");return r(c.call(s));};},/* 132 *//***/function(i,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);i.exports=t(92).getIteratorMethod=function(c){if(c!=null)return c[n]||c["@@iterator"]||s[r(c)];};},/* 133 *//***/function(i,e,t){e.__esModule=!0;var r=t(134),n=s(r);function s(c){return c&&c.__esModule?c:{"default":c};}e["default"]=function(c){if(Array.isArray(c)){for(var l=0,f=Array(c.length);l<c.length;l++)f[l]=c[l];return f;}else return(0,n["default"])(c);};},/* 134 *//***/function(i,e,t){i.exports={"default":t(135),__esModule:!0};},/* 135 *//***/function(i,e,t){t(125),t(136),i.exports=t(92).Array.from;},/* 136 *//***/function(i,e,t){var r=t(93),n=t(90),s=t(124),c=t(137),l=t(138),f=t(113),h=t(139),m=t(132);n(n.S+n.F*!t(140)(function(u){Array.from(u);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
221
+ from:function from(y){var T=s(y),E=typeof this=="function"?this:Array,C=arguments.length,x=C>1?arguments[1]:void 0,I=x!==void 0,d=0,v=m(T),p,S,A,R;if(I&&(x=r(x,C>2?arguments[2]:void 0,2)),v!=null&&!(E==Array&&l(v)))for(R=v.call(T),S=new E();!(A=R.next()).done;d++)h(S,d,I?c(R,x,[A.value,d],!0):A.value);else for(p=f(T.length),S=new E(p);p>d;d++)h(S,d,I?x(T[d],d):T[d]);return S.length=d,S;}});},/* 137 *//***/function(i,e,t){var r=t(97);i.exports=function(n,s,c,l){try{return l?s(r(c)[0],c[1]):s(c);}catch(h){var f=n["return"];throw f!==void 0&&r(f.call(n)),h;}};},/* 138 *//***/function(i,e,t){var r=t(83),n=t(122)("iterator"),s=Array.prototype;i.exports=function(c){return c!==void 0&&(r.Array===c||s[n]===c);};},/* 139 *//***/function(i,e,t){var r=t(96),n=t(104);i.exports=function(s,c,l){c in s?r.f(s,c,n(0,l)):s[c]=l;};},/* 140 *//***/function(i,e,t){var r=t(122)("iterator"),n=!1;try{var s=[7][r]();s["return"]=function(){n=!0;},Array.from(s,function(){throw 2;});}catch(_unused13){}i.exports=function(c,l){if(!l&&!n)return!1;var f=!1;try{var h=[7],m=h[r]();m.next=function(){return{done:f=!0};},h[r]=function(){return m;},c(h);}catch(_unused14){}return f;};},/* 141 *//***/function(i,e,t){i.exports={"default":t(142),__esModule:!0};},/* 142 *//***/function(i,e,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),i.exports=t(92).Map;},/* 143 *//***/function(i,e){},/* 144 *//***/function(i,e,t){var r=t(145),n=t(151),s="Map";i.exports=t(152)(s,function(c){return function(){return c(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
222
+ get:function get(l){var f=r.getEntry(n(this,s),l);return f&&f.v;},// 23.1.3.9 Map.prototype.set(key, value)
223
+ set:function set(l,f){return r.def(n(this,s),l===0?0:l,f);}},r,!0);},/* 145 *//***/function(i,e,t){var r=t(96).f,n=t(108),s=t(146),c=t(93),l=t(147),f=t(148),h=t(88),m=t(82),u=t(149),y=t(100),T=t(150).fastKey,E=t(151),C=y?"_s":"size",x=function x(I,d){var v=T(d),p;if(v!=="F")return I._i[v];for(p=I._f;p;p=p.n)if(p.k==d)return p;};i.exports={getConstructor:function getConstructor(I,d,v,p){var S=I(function(A,R){l(A,S,d,"_i"),A._t=d,A._i=n(null),A._f=void 0,A._l=void 0,A[C]=0,R!=null&&f(R,v,A[p],A);});return s(S.prototype,{// 23.1.3.1 Map.prototype.clear()
224
+ // 23.2.3.2 Set.prototype.clear()
225
+ clear:function clear(){for(var R=E(this,d),D=R._i,U=R._f;U;U=U.n)U.r=!0,U.p&&(U.p=U.p.n=void 0),delete D[U.i];R._f=R._l=void 0,R[C]=0;},// 23.1.3.3 Map.prototype.delete(key)
226
+ // 23.2.3.4 Set.prototype.delete(value)
227
+ "delete":function _delete(A){var R=E(this,d),D=x(R,A);if(D){var U=D.n,M=D.p;delete R._i[D.i],D.r=!0,M&&(M.n=U),U&&(U.p=M),R._f==D&&(R._f=U),R._l==D&&(R._l=M),R[C]--;}return!!D;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
228
+ // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
229
+ forEach:function forEach(R){E(this,d);for(var D=c(R,arguments.length>1?arguments[1]:void 0,3),U;U=U?U.n:this._f;)for(D(U.v,U.k,this);U&&U.r;)U=U.p;},// 23.1.3.7 Map.prototype.has(key)
230
+ // 23.2.3.7 Set.prototype.has(value)
231
+ has:function has(R){return!!x(E(this,d),R);}}),y&&r(S.prototype,"size",{get:function get(){return E(this,d)[C];}}),S;},def:function def(I,d,v){var p=x(I,d),S,A;return p?p.v=v:(I._l=p={i:A=T(d,!0),// <- index
232
+ k:d,// <- key
233
+ v:v,// <- value
234
+ p:S=I._l,// <- previous entry
235
+ n:void 0,// <- next entry
236
+ r:!1// <- removed
237
+ },I._f||(I._f=p),S&&(S.n=p),I[C]++,A!=="F"&&(I._i[A]=p)),I;},getEntry:x,setStrong:function setStrong(I,d,v){h(I,d,function(p,S){this._t=E(p,d),this._k=S,this._l=void 0;},function(){for(var p=this,S=p._k,A=p._l;A&&A.r;)A=A.p;return!p._t||!(p._l=A=A?A.n:p._t._f)?(p._t=void 0,m(1)):S=="keys"?m(0,A.k):S=="values"?m(0,A.v):m(0,[A.k,A.v]);},v?"entries":"values",!v,!0),u(d);}};},/* 146 *//***/function(i,e,t){var r=t(95);i.exports=function(n,s,c){for(var l in s)c&&n[l]?n[l]=s[l]:r(n,l,s[l]);return n;};},/* 147 *//***/function(i,e){i.exports=function(t,r,n,s){if(!(t instanceof r)||s!==void 0&&s in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 *//***/function(i,u,t){var r=t(93),n=t(137),s=t(138),c=t(97),l=t(113),f=t(132),h={},m={},u=i.exports=function(y,T,E,C,x){var I=x?function(){return y;}:f(y),d=r(E,C,T?2:1),v=0,p,S,A,R;if(typeof I!="function")throw TypeError(y+" is not iterable!");if(s(I)){for(p=l(y.length);p>v;v++)if(R=T?d(c(S=y[v])[0],S[1]):d(y[v]),R===h||R===m)return R;}else for(A=I.call(y);!(S=A.next()).done;)if(R=n(A,d,S.value,T),R===h||R===m)return R;};u.BREAK=h,u.RETURN=m;},/* 149 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(96),c=t(100),l=t(122)("species");i.exports=function(f){var h=typeof n[f]=="function"?n[f]:r[f];c&&h&&!h[l]&&s.f(h,l,{configurable:!0,get:function get(){return this;}});};},/* 150 *//***/function(i,e,t){var r=t(118)("meta"),n=t(98),s=t(105),c=t(96).f,l=0,f=Object.isExtensible||function(){return!0;},h=!t(101)(function(){return f(Object.preventExtensions({}));}),m=function m(C){c(C,r,{value:{i:"O"+ ++l,// object ID
238
+ w:{}// weak collections IDs
239
+ }});},u=function u(C,x){if(!n(C))return _typeof(C)=="symbol"?C:(typeof C=="string"?"S":"P")+C;if(!s(C,r)){if(!f(C))return"F";if(!x)return"E";m(C);}return C[r].i;},y=function y(C,x){if(!s(C,r)){if(!f(C))return!0;if(!x)return!1;m(C);}return C[r].w;},T=function T(C){return h&&E.NEED&&f(C)&&!s(C,r)&&m(C),C;},E=i.exports={KEY:r,NEED:!1,fastKey:u,getWeak:y,onFreeze:T};},/* 151 *//***/function(i,e,t){var r=t(98);i.exports=function(n,s){if(!r(n)||n._t!==s)throw TypeError("Incompatible receiver, "+s+" required!");return n;};},/* 152 *//***/function(i,e,t){var r=t(91),n=t(90),s=t(150),c=t(101),l=t(95),f=t(146),h=t(148),m=t(147),u=t(98),y=t(121),T=t(96).f,E=t(153)(0),C=t(100);i.exports=function(x,I,d,v,p,S){var A=r[x],R=A,D=p?"set":"add",U=R&&R.prototype,M={};return!C||typeof R!="function"||!(S||U.forEach&&!c(function(){new R().entries().next();}))?(R=v.getConstructor(I,x,p,D),f(R.prototype,d),s.NEED=!0):(R=I(function(W,Y){m(W,R,x,"_c"),W._c=new A(),Y!=null&&h(Y,p,W[D],W);}),E("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(W){var Y=W=="add"||W=="set";W in U&&!(S&&W=="clear")&&l(R.prototype,W,function(B,N){if(m(this,R,W),!Y&&S&&!u(B))return W=="get"?void 0:!1;var G=this._c[W](B===0?0:B,N);return Y?this:G;});}),S||T(R.prototype,"size",{get:function get(){return this._c.size;}})),y(R,x),M[x]=R,n(n.G+n.W+n.F,M),S||v.setStrong(R,x,p),R;};},/* 153 *//***/function(i,e,t){var r=t(93),n=t(85),s=t(124),c=t(113),l=t(154);i.exports=function(f,h){var m=f==1,u=f==2,y=f==3,T=f==4,E=f==6,C=f==5||E,x=h||l;return function(I,d,v){for(var p=s(I),S=n(p),A=r(d,v,3),R=c(S.length),D=0,U=m?x(I,R):u?x(I,0):void 0,M,W;R>D;D++)if((C||D in S)&&(M=S[D],W=A(M,D,p),f)){if(m)U[D]=W;else if(W)switch(f){case 3:return!0;case 5:return M;case 6:return D;case 2:U.push(M);}else if(T)return!1;}return E?-1:y||T?T:U;};};},/* 154 *//***/function(i,e,t){var r=t(155);i.exports=function(n,s){return new(r(n))(s);};},/* 155 *//***/function(i,e,t){var r=t(98),n=t(156),s=t(122)("species");i.exports=function(c){var l;return n(c)&&(l=c.constructor,typeof l=="function"&&(l===Array||n(l.prototype))&&(l=void 0),r(l)&&(l=l[s],l===null&&(l=void 0))),l===void 0?Array:l;};},/* 156 *//***/function(i,e,t){var r=t(86);i.exports=Array.isArray||function(s){return r(s)=="Array";};},/* 157 *//***/function(i,e,t){var r=t(90);r(r.P+r.R,"Map",{toJSON:t(158)("Map")});},/* 158 *//***/function(i,e,t){var r=t(128),n=t(159);i.exports=function(s){return function(){if(r(this)!=s)throw TypeError(s+"#toJSON isn't generic");return n(this);};};},/* 159 *//***/function(i,e,t){var r=t(148);i.exports=function(n,s){var c=[];return r(n,!1,c.push,c,s),c;};},/* 160 *//***/function(i,e,t){t(161)("Map");},/* 161 *//***/function(i,e,t){var r=t(90);i.exports=function(n){r(r.S,n,{of:function of(){for(var c=arguments.length,l=new Array(c);c--;)l[c]=arguments[c];return new this(l);}});};},/* 162 *//***/function(i,e,t){t(163)("Map");},/* 163 *//***/function(i,e,t){var r=t(90),n=t(94),s=t(93),c=t(148);i.exports=function(l){r(r.S,l,{from:function from(h){var m=arguments[1],u,y,T,E;return n(this),u=m!==void 0,u&&n(m),h==null?new this():(y=[],u?(T=0,E=s(m,arguments[2],2),c(h,!1,function(C){y.push(E(C,T++));})):c(h,!1,y.push,y),new this(y));}});};},/* 164 *//***/function(i,e,t){i.exports={"default":t(165),__esModule:!0};},/* 165 *//***/function(i,e,t){t(166),i.exports=t(92).Object.assign;},/* 166 *//***/function(i,e,t){var r=t(90);r(r.S+r.F,"Object",{assign:t(167)});},/* 167 *//***/function(i,e,t){var r=t(100),n=t(110),s=t(168),c=t(169),l=t(124),f=t(85),h=Object.assign;i.exports=!h||t(101)(function(){var m={},u={},y=Symbol(),T="abcdefghijklmnopqrst";return m[y]=7,T.split("").forEach(function(E){u[E]=E;}),h({},m)[y]!=7||Object.keys(h({},u)).join("")!=T;})?function(u,y){for(var T=l(u),E=arguments.length,C=1,x=s.f,I=c.f;E>C;)for(var d=f(arguments[C++]),v=x?n(d).concat(x(d)):n(d),p=v.length,S=0,A;p>S;)A=v[S++],(!r||I.call(d,A))&&(T[A]=d[A]);return T;}:h;},/* 168 *//***/function(i,e){e.f=Object.getOwnPropertySymbols;},/* 169 *//***/function(i,e){e.f={}.propertyIsEnumerable;},/* 170 *//***/function(i,e,t){e.__esModule=!0,e["default"]=function(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 *//***/function(i,e,t){e.__esModule=!0;var r=t(172),n=s(r);function s(c){return c&&c.__esModule?c:{"default":c};}e["default"]=/* @__PURE__ */function(){function c(l,f){for(var h=0;h<f.length;h++){var m=f[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),(0,n["default"])(l,m.key,m);}}return function(l,f,h){return f&&c(l.prototype,f),h&&c(l,h),l;};}();},/* 172 *//***/function(i,e,t){i.exports={"default":t(173),__esModule:!0};},/* 173 *//***/function(i,e,t){t(174);var r=t(92).Object;i.exports=function(s,c,l){return r.defineProperty(s,c,l);};},/* 174 *//***/function(i,e,t){var r=t(90);r(r.S+r.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 *//***/function(i,e,t){i.exports={"default":t(176),__esModule:!0};},/* 176 *//***/function(i,e,t){t(177),t(143),t(184),t(185),i.exports=t(92).Symbol;},/* 177 *//***/function(i,e,t){var r=t(91),n=t(105),s=t(100),c=t(90),l=t(106),f=t(150).KEY,h=t(101),m=t(117),u=t(121),y=t(118),T=t(122),E=t(178),C=t(179),x=t(180),I=t(156),d=t(97),v=t(98),p=t(124),S=t(84),A=t(103),R=t(104),D=t(108),U=t(181),M=t(183),W=t(168),Y=t(96),B=t(110),N=M.f,G=Y.f,J=U.f,_tt2=r.Symbol,at=r.JSON,ut=at&&at.stringify,K="prototype",Q=T("_hidden"),ft=T("toPrimitive"),gt={}.propertyIsEnumerable,mt=m("symbol-registry"),wt=m("symbols"),ht=m("op-symbols"),Nt=Object[K],Rt=typeof _tt2=="function"&&!!W.f,X=r.QObject,z=!X||!X[K]||!X[K].findChild,q=s&&h(function(){return D(G({},"a",{get:function get(){return G(this,"a",{value:7}).a;}})).a!=7;})?function(At,Ot,Lt){var Yt=N(Nt,Ot);Yt&&delete Nt[Ot],G(At,Ot,Lt),Yt&&At!==Nt&&G(Nt,Ot,Yt);}:G,nt=function nt(At){var Ot=wt[At]=D(_tt2[K]);return Ot._k=At,Ot;},j=Rt&&_typeof(_tt2.iterator)=="symbol"?function(At){return _typeof(At)=="symbol";}:function(At){return At instanceof _tt2;},_Z2=function Z(Ot,Lt,Yt){return Ot===Nt&&_Z2(ht,Lt,Yt),d(Ot),Lt=A(Lt,!0),d(Yt),n(wt,Lt)?(Yt.enumerable?(n(Ot,Q)&&Ot[Q][Lt]&&(Ot[Q][Lt]=!1),Yt=D(Yt,{enumerable:R(0,!1)})):(n(Ot,Q)||G(Ot,Q,R(1,{})),Ot[Q][Lt]=!0),q(Ot,Lt,Yt)):G(Ot,Lt,Yt);},O=function O(Ot,Lt){d(Ot);for(var Yt=x(Lt=S(Lt)),zt=0,Wt=Yt.length,Qt;Wt>zt;)_Z2(Ot,Qt=Yt[zt++],Lt[Qt]);return Ot;},L=function L(Ot,Lt){return Lt===void 0?D(Ot):O(D(Ot),Lt);},$=function $(Ot){var Lt=gt.call(this,Ot=A(Ot,!0));return this===Nt&&n(wt,Ot)&&!n(ht,Ot)?!1:Lt||!n(this,Ot)||!n(wt,Ot)||n(this,Q)&&this[Q][Ot]?Lt:!0;},V=function V(Ot,Lt){if(Ot=S(Ot),Lt=A(Lt,!0),!(Ot===Nt&&n(wt,Lt)&&!n(ht,Lt))){var Yt=N(Ot,Lt);return Yt&&n(wt,Lt)&&!(n(Ot,Q)&&Ot[Q][Lt])&&(Yt.enumerable=!0),Yt;}},rt=function rt(Ot){for(var Lt=J(S(Ot)),Yt=[],zt=0,Wt;Lt.length>zt;)!n(wt,Wt=Lt[zt++])&&Wt!=Q&&Wt!=f&&Yt.push(Wt);return Yt;},it=function it(Ot){for(var Lt=Ot===Nt,Yt=J(Lt?ht:S(Ot)),zt=[],Wt=0,Qt;Yt.length>Wt;)n(wt,Qt=Yt[Wt++])&&(!Lt||n(Nt,Qt))&&zt.push(wt[Qt]);return zt;};Rt||(_tt2=function tt(){if(this instanceof _tt2)throw TypeError("Symbol is not a constructor!");var Ot=y(arguments.length>0?arguments[0]:void 0),_Lt=function Lt(Yt){this===Nt&&_Lt.call(ht,Yt),n(this,Q)&&n(this[Q],Ot)&&(this[Q][Ot]=!1),q(this,Ot,R(1,Yt));};return s&&z&&q(Nt,Ot,{configurable:!0,set:_Lt}),nt(Ot);},l(_tt2[K],"toString",function(){return this._k;}),M.f=V,Y.f=_Z2,t(182).f=U.f=rt,t(169).f=$,W.f=it,s&&!t(89)&&l(Nt,"propertyIsEnumerable",$,!0),E.f=function(At){return nt(T(At));}),c(c.G+c.W+c.F*!Rt,{Symbol:_tt2});for(var ct=// 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
240
+ "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),St=0;ct.length>St;)T(ct[St++]);for(var Ct=B(T.store),Mt=0;Ct.length>Mt;)C(Ct[Mt++]);c(c.S+c.F*!Rt,"Symbol",{// 19.4.2.1 Symbol.for(key)
241
+ "for":function _for(At){return n(mt,At+="")?mt[At]:mt[At]=_tt2(At);},// 19.4.2.5 Symbol.keyFor(sym)
242
+ keyFor:function keyFor(Ot){if(!j(Ot))throw TypeError(Ot+" is not a symbol!");for(var Lt in mt)if(mt[Lt]===Ot)return Lt;},useSetter:function useSetter(){z=!0;},useSimple:function useSimple(){z=!1;}}),c(c.S+c.F*!Rt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
243
+ create:L,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
244
+ defineProperty:_Z2,// 19.1.2.3 Object.defineProperties(O, Properties)
245
+ defineProperties:O,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
246
+ getOwnPropertyDescriptor:V,// 19.1.2.7 Object.getOwnPropertyNames(O)
247
+ getOwnPropertyNames:rt,// 19.1.2.8 Object.getOwnPropertySymbols(O)
248
+ getOwnPropertySymbols:it});var Dt=h(function(){W.f(1);});c(c.S+c.F*Dt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(Ot){return W.f(p(Ot));}}),at&&c(c.S+c.F*(!Rt||h(function(){var At=_tt2();return ut([At])!="[null]"||ut({a:At})!="{}"||ut(Object(At))!="{}";})),"JSON",{stringify:function stringify(Ot){for(var Lt=[Ot],Yt=1,zt,Wt;arguments.length>Yt;)Lt.push(arguments[Yt++]);if(Wt=zt=Lt[1],!(!v(zt)&&Ot===void 0||j(Ot)))return I(zt)||(zt=function zt(Qt,ue){if(typeof Wt=="function"&&(ue=Wt.call(this,Qt,ue)),!j(ue))return ue;}),Lt[1]=zt,ut.apply(at,Lt);}}),_tt2[K][ft]||t(95)(_tt2[K],ft,_tt2[K].valueOf),u(_tt2,"Symbol"),u(Math,"Math",!0),u(r.JSON,"JSON",!0);},/* 178 *//***/function(i,e,t){e.f=t(122);},/* 179 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(89),c=t(178),l=t(96).f;i.exports=function(f){var h=n.Symbol||(n.Symbol=s?{}:r.Symbol||{});f.charAt(0)!="_"&&!(f in h)&&l(h,f,{value:c.f(f)});};},/* 180 *//***/function(i,e,t){var r=t(110),n=t(168),s=t(169);i.exports=function(c){var l=r(c),f=n.f;if(f)for(var h=f(c),m=s.f,u=0,y;h.length>u;)m.call(c,y=h[u++])&&l.push(y);return l;};},/* 181 *//***/function(i,e,t){var r=t(84),n=t(182).f,s={}.toString,c=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],l=function l(f){try{return n(f);}catch(_unused15){return c.slice();}};i.exports.f=function(h){return c&&s.call(h)=="[object Window]"?l(h):n(r(h));};},/* 182 *//***/function(i,e,t){var r=t(111),n=t(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(c){return r(c,n);};},/* 183 *//***/function(i,e,t){var r=t(169),n=t(104),s=t(84),c=t(103),l=t(105),f=t(99),h=Object.getOwnPropertyDescriptor;e.f=t(100)?h:function(u,y){if(u=s(u),y=c(y,!0),f)try{return h(u,y);}catch(_unused16){}if(l(u,y))return n(!r.f.call(u,y),u[y]);};},/* 184 *//***/function(i,e,t){t(179)("asyncIterator");},/* 185 *//***/function(i,e,t){t(179)("observable");},/* 186 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createNowTime=r,e.formatDelay=n;function r(){var s=null;return Date.now?s=Date.now:s=function s(){return(/* @__PURE__ */new Date()).getTime();},s;}function n(s){return typeof s=="number"?s={delay:s}:"entropy"in s&&(s={delay:s.entropy,isEntropy:!0}),s;}},/* 187 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={// s - startFrame, e - endFrame
249
+ "default":function _default(n,s,c,l,f){return typeof n=="number"&&typeof s=="number"?n+(c-l)/(f-l)*(s-n):c-l>f-c?s:n;}};},/* 188 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.parseEasing=e.Easings=void 0;var r=t(76),n=h(r),s=t(133),c=h(s),l=t(141),f=h(l);function h(I){return I&&I.__esModule?I:{"default":I};}var m=t(189),u=new f["default"]();function y(){for(var I=arguments.length,d=Array(I),v=0;v<I;v++)d[v]=arguments[v];var p=u.get(d);return p||(p=m.apply(void 0,d),u.set(d,p),p);}function T(I){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(v,p){for(var S=1;S<p.length;S++){var A=p[S].offset;if(v<=A){var R=p[S-1].offset,D=A,U=(v-R)/(D-R),M=1/I,W=U/M;return d==="end"?W=Math.floor(W):W=Math.ceil(W),M*W*(D-R)+R;}}return 0;};}function E(I){var d=/^cubic-bezier\((.*)\)/,v=I.match(d);if(v){var p=v[1].trim();return p=p.split(",").map(function(M){return parseFloat(M.trim());}),y.apply(void 0,(0,c["default"])(p));}if(d=/^steps\((.*)\)/,v=I.match(d),v){var S=v[1].trim();S=S.split(",").map(function(M){return M.trim();});var A=S,R=(0,n["default"])(A,2),D=R[0],U=R[1];return T(parseInt(D,10),U);}return I;}var C={linear:function linear(d){return d;},ease:y(0.25,0.1,0.25,1),"ease-in":y(0.42,0,1,1),"ease-out":y(0,0,0.58,1),"ease-in-out":y(0.42,0,0.58,1),// 'step-start': function(p, frames){
250
+ // let ret = 0
251
+ // for(let i = 0; i < frames.length; i++){
252
+ // const {offset} = frames[i]
253
+ // ret = offset
254
+ // if(p < offset){
255
+ // break
256
+ // }
257
+ // }
258
+ // return ret
259
+ // },
260
+ // 'step-end': function(p, frames){
261
+ // let ret = 0
262
+ // for(let i = 0; i < frames.length; i++){
263
+ // const {offset} = frames[i]
264
+ // if(p < offset){
265
+ // break
266
+ // }
267
+ // ret = offset
268
+ // }
269
+ // return ret
270
+ // }
271
+ "step-start":T(1,"start"),"step-end":T(1,"end")};function x(I){return typeof I=="string"?C[I]?I=C[I]:I=E(I):I.type==="cubic-bezier"?I=y.apply(void 0,(0,c["default"])(I.value)):I.type==="steps"&&(I=T(I.step,I.pos)),I;}e.Easings=C,e.parseEasing=x;},/* 189 *//***/function(i,e){var t=4,r=1e-3,n=1e-7,s=10,c=11,l=1/(c-1),f=typeof Float32Array=="function";function h(I,d){return 1-3*d+3*I;}function m(I,d){return 3*d-6*I;}function u(I){return 3*I;}function y(I,d,v){return((h(d,v)*I+m(d,v))*I+u(d))*I;}function T(I,d,v){return 3*h(d,v)*I*I+2*m(d,v)*I+u(d);}function E(I,d,v,p,S){var A,R,D=0;do R=d+(v-d)/2,A=y(R,p,S)-I,A>0?v=R:d=R;while(Math.abs(A)>n&&++D<s);return R;}function C(I,d,v,p){for(var S=0;S<t;++S){var A=T(d,v,p);if(A===0)return d;var R=y(d,v,p)-I;d-=R/A;}return d;}function x(I){return I;}i.exports=function(d,v,p,S){if(!(0<=d&&d<=1&&0<=p&&p<=1))throw new Error("bezier x values must be in [0, 1] range");if(d===v&&p===S)return x;for(var A=f?new Float32Array(c):new Array(c),R=0;R<c;++R)A[R]=y(R*l,d,p);function D(U){for(var M=0,W=1,Y=c-1;W!==Y&&A[W]<=U;++W)M+=l;--W;var B=(U-A[W])/(A[W+1]-A[W]),N=M+B*l,G=T(N,d,p);return G>=r?C(U,N,d,p):G===0?N:E(U,M,M+l,d,p);}return function(M){return M===0?0:M===1?1:y(D(M),v,S);};};},/* 190 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(191),n=v(r),s=t(204),c=v(s),l=t(164),f=v(l),h=t(170),m=v(h),u=t(171),y=v(u),T=t(175),E=v(T),C=t(75),x=v(C),I=t(208),d=t(188);function v(G){return G&&G.__esModule?G:{"default":G};}var p=(0,E["default"])("timing"),S=(0,E["default"])("keyframes"),A=(0,E["default"])("initState"),R=(0,E["default"])("readyDefer"),D=(0,E["default"])("finishedDefer"),U=(0,E["default"])("effects"),M=(0,E["default"])("activeReadyTimer"),W=(0,E["default"])("activeFinishTimer"),Y=(0,E["default"])("removeDefer"),B={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},N=function(){function G(J,tt,at){var ut=this;if((0,m["default"])(this,G),Array.isArray(J)){var K=[J[0],J,tt];J=K[0],tt=K[1],at=K[2];}typeof at=="number"&&(at={duration:at}),this[p]=(0,f["default"])({},B,at),this[p].easing=(0,d.parseEasing)(this[p].easing),this[S]=(0,I.calculateFramesOffset)(tt);var Q=this[S][this[S].length-1];this[A]={},(0,c["default"])(Q).forEach(function(ft){Object.prototype.hasOwnProperty.call(J,ft)&&ft!=="easing"&&ft!=="offset"&&(ut[A][ft]=J[ft]);}),this[S]=this[S].map(function(ft){return(0,f["default"])({},ut[A],ft);}),this[S][0].offset!==0&&this[S].unshift((0,f["default"])({},this[A],{offset:0})),Q.offset<1&&this[S].push((0,f["default"])({},Q,{offset:1})),this[U]={},this.timeline=null;}return(0,y["default"])(G,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:M,value:function value(){var tt=this;this[R]&&!this[R].timerID&&(this.timeline.currentTime<0?this[R].timerID=this.timeline.setTimeout(function(){tt[R].resolve(),delete tt[R];},{delay:-this.timeline.currentTime,heading:!1}):this[R].timerID=this.timeline.setTimeout(function(){tt[R].resolve(),delete tt[R];},{delay:0,isEntropy:!0}));}},{key:W,value:function value(){var tt=this,at=this[p],ut=at.duration,K=at.iterations,Q=at.endDelay,ft=Math.ceil(ut*K+Q-this.timeline.currentTime)+1;this[D]&&!this[D].timerID&&(this[D].timerID=this.timeline.setTimeout(function(){tt[D].resolve(),tt[Y](R),tt[Y](D);},{delay:ft,heading:!1}),this[D].reverseTimerID=this.timeline.setTimeout(function(){tt[D].resolve(),tt[Y](R),tt[Y](D),tt.timeline=null;},{delay:-this[p].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var tt=this[p],at=tt.delay,ut=tt.playbackRate,K=tt.timeline;this.timeline=new x["default"]({originTime:at,playbackRate:ut},K),this[M](),this[W]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[M]());}},{key:Y,value:function value(tt){var at=this[tt],ut=this.timeline;at&&ut&&(ut.clearTimeout(at.timerID),at.reverseTimerID&&ut.clearTimeout(at.reverseTimerID)),delete this[tt];}},{key:"cancel",value:function value(){this[Y](R),this[Y](D),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[Y](R),this[Y](D);}},{key:"applyEffects",value:function value(tt){return(0,f["default"])(this[U],tt);}},{key:"playbackRate",get:function get(){return this[p].playbackRate;},set:function set(tt){this.timeline&&(this.timeline.playbackRate=tt),this[p].playbackRate=tt;}},{key:"playState",get:function get(){var tt=this.timeline,at=this[p],ut=at.iterations,K=at.duration,Q=at.endDelay,ft="running";if(tt==null)ft="idle";else if(tt.paused)ft="paused";else if(tt.currentTime<0)ft="pending";else{var gt=tt.currentTime-ut*K;gt>0&&gt<Q?ft="pending":gt>=Q&&(ft="finished");}return ft;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var tt=this[p],at=tt.duration,ut=tt.iterations,K=this.timeline,Q=this.playState,ft=void 0;if(Q==="idle")ft=0;else if(Q==="paused"&&K.currentTime<0)ft=0;else if(Q==="pending"){if(K.currentTime<0)ft=0;else{var gt=K.seekLocalTime(ut*at);ft=(0,I.periodicity)(gt,at)[1]/at;}}else(Q==="running"||Q==="paused")&&(ft=(0,I.periodicity)(K.currentTime,at)[1]/at);return Q==="finished"&&(ft=(0,I.periodicity)(ut,1)[1]),ft;}},{key:"frame",get:function get(){var tt=this.playState,at=this[A],ut=this[p].fill;if(tt==="idle")return at;var K=this.timeline.currentTime,Q=this[S].slice(0),ft=(0,I.getProgress)(this.timeline,this[p],this.progress),gt=ft.p,mt=ft.inverted,wt=at;return K<0&&tt==="pending"?(ut==="backwards"||ut==="both")&&(wt=mt?Q[Q.length-1]:Q[0]):(tt!=="pending"&&tt!=="finished"||ut==="forwards"||ut==="both")&&(wt=(0,I.getCurrentFrame)(this[p],Q,this[U],gt)),wt;}},{key:"timing",get:function get(){return this[p];}},{key:"effects",get:function get(){return this[U];}},{key:"baseTimeline",set:function set(tt){this[p].timeline=tt;},get:function get(){return this[p].timeline;}},{key:"ready",get:function get(){return this[R]?this[R].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[R]=(0,I.defer)(),this.timeline&&this[M](),this[R]?this[R].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[D]||(this[D]=(0,I.defer)(),this.timeline&&this[W]()),this[D].promise);}}]),G;}();e["default"]=N;},/* 191 *//***/function(i,e,t){i.exports={"default":t(192),__esModule:!0};},/* 192 *//***/function(i,e,t){t(143),t(125),t(79),t(193),t(202),t(203),i.exports=t(92).Promise;},/* 193 *//***/function(i,e,t){var r=t(89),n=t(91),s=t(93),c=t(128),l=t(90),f=t(98),h=t(94),m=t(147),u=t(148),y=t(194),T=t(195).set,E=t(197)(),C=t(198),x=t(199),I=t(200),d=t(201),v="Promise",p=n.TypeError,S=n.process,A=S&&S.versions,R=A&&A.v8||"",_D=n[v],U=c(S)=="process",M=function M(){},W,Y,B,N,G=Y=C.f,J=!!function(){try{var mt=_D.resolve(1),wt=(mt.constructor={})[t(122)("species")]=function(ht){ht(M,M);};return(U||typeof PromiseRejectionEvent=="function")&&mt.then(M)instanceof wt&&R.indexOf("6.6")!==0&&I.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),tt=function tt(mt){var wt;return f(mt)&&typeof(wt=mt.then)=="function"?wt:!1;},at=function at(mt,wt){if(!mt._n){mt._n=!0;var ht=mt._c;E(function(){for(var Nt=mt._v,Rt=mt._s==1,X=0,z=function z(q){var nt=Rt?q.ok:q.fail,j=q.resolve,Z=q.reject,O=q.domain,L,$,V;try{nt?(Rt||(mt._h==2&&Q(mt),mt._h=1),nt===!0?L=Nt:(O&&O.enter(),L=nt(Nt),O&&(O.exit(),V=!0)),L===q.promise?Z(p("Promise-chain cycle")):($=tt(L))?$.call(L,j,Z):j(L)):Z(Nt);}catch(rt){O&&!V&&O.exit(),Z(rt);}};ht.length>X;)z(ht[X++]);mt._c=[],mt._n=!1,wt&&!mt._h&&ut(mt);});}},ut=function ut(mt){T.call(n,function(){var wt=mt._v,ht=K(mt),Nt,Rt,X;if(ht&&(Nt=x(function(){U?S.emit("unhandledRejection",wt,mt):(Rt=n.onunhandledrejection)?Rt({promise:mt,reason:wt}):(X=n.console)&&X.error&&X.error("Unhandled promise rejection",wt);}),mt._h=U||K(mt)?2:1),mt._a=void 0,ht&&Nt.e)throw Nt.v;});},K=function K(mt){return mt._h!==1&&(mt._a||mt._c).length===0;},Q=function Q(mt){T.call(n,function(){var wt;U?S.emit("rejectionHandled",mt):(wt=n.onrejectionhandled)&&wt({promise:mt,reason:mt._v});});},ft=function ft(mt){var wt=this;wt._d||(wt._d=!0,wt=wt._w||wt,wt._v=mt,wt._s=2,wt._a||(wt._a=wt._c.slice()),at(wt,!0));},_gt3=function gt(mt){var wt=this,ht;if(!wt._d){wt._d=!0,wt=wt._w||wt;try{if(wt===mt)throw p("Promise can't be resolved itself");(ht=tt(mt))?E(function(){var Nt={_w:wt,_d:!1};try{ht.call(mt,s(_gt3,Nt,1),s(ft,Nt,1));}catch(Rt){ft.call(Nt,Rt);}}):(wt._v=mt,wt._s=1,at(wt,!1));}catch(Nt){ft.call({_w:wt,_d:!1},Nt);}}};J||(_D=function D(wt){m(this,_D,v,"_h"),h(wt),W.call(this);try{wt(s(_gt3,this,1),s(ft,this,1));}catch(ht){ft.call(this,ht);}},W=function W(wt){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},W.prototype=t(146)(_D.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
272
+ then:function then(wt,ht){var Nt=G(y(this,_D));return Nt.ok=typeof wt=="function"?wt:!0,Nt.fail=typeof ht=="function"&&ht,Nt.domain=U?S.domain:void 0,this._c.push(Nt),this._a&&this._a.push(Nt),this._s&&at(this,!1),Nt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
273
+ "catch":function _catch(mt){return this.then(void 0,mt);}}),B=function B(){var mt=new W();this.promise=mt,this.resolve=s(_gt3,mt,1),this.reject=s(ft,mt,1);},C.f=G=function G(mt){return mt===_D||mt===N?new B(mt):Y(mt);}),l(l.G+l.W+l.F*!J,{Promise:_D}),t(121)(_D,v),t(149)(v),N=t(92)[v],l(l.S+l.F*!J,v,{// 25.4.4.5 Promise.reject(r)
274
+ reject:function reject(wt){var ht=G(this),Nt=ht.reject;return Nt(wt),ht.promise;}}),l(l.S+l.F*(r||!J),v,{// 25.4.4.6 Promise.resolve(x)
275
+ resolve:function resolve(wt){return d(r&&this===N?_D:this,wt);}}),l(l.S+l.F*!(J&&t(140)(function(mt){_D.all(mt)["catch"](M);})),v,{// 25.4.4.1 Promise.all(iterable)
276
+ all:function all(wt){var ht=this,Nt=G(ht),Rt=Nt.resolve,X=Nt.reject,z=x(function(){var q=[],nt=0,j=1;u(wt,!1,function(Z){var O=nt++,L=!1;q.push(void 0),j++,ht.resolve(Z).then(function($){L||(L=!0,q[O]=$,--j||Rt(q));},X);}),--j||Rt(q);});return z.e&&X(z.v),Nt.promise;},// 25.4.4.4 Promise.race(iterable)
277
+ race:function race(wt){var ht=this,Nt=G(ht),Rt=Nt.reject,X=x(function(){u(wt,!1,function(z){ht.resolve(z).then(Nt.resolve,Rt);});});return X.e&&Rt(X.v),Nt.promise;}});},/* 194 *//***/function(i,e,t){var r=t(97),n=t(94),s=t(122)("species");i.exports=function(c,l){var f=r(c).constructor,h;return f===void 0||(h=r(f)[s])==null?l:n(h);};},/* 195 *//***/function(i,e,t){var r=t(93),n=t(196),s=t(120),c=t(102),l=t(91),f=l.process,h=l.setImmediate,m=l.clearImmediate,u=l.MessageChannel,y=l.Dispatch,T=0,E={},C="onreadystatechange",x,I,d,v=function v(){var S=+this;if(E.hasOwnProperty(S)){var A=E[S];delete E[S],A();}},p=function p(S){v.call(S.data);};(!h||!m)&&(h=function h(A){for(var R=[],D=1;arguments.length>D;)R.push(arguments[D++]);return E[++T]=function(){n(typeof A=="function"?A:Function(A),R);},x(T),T;},m=function m(A){delete E[A];},t(86)(f)=="process"?x=function x(S){f.nextTick(r(v,S,1));}:y&&y.now?x=function x(S){y.now(r(v,S,1));}:u?(I=new u(),d=I.port2,I.port1.onmessage=p,x=r(d.postMessage,d,1)):l.addEventListener&&typeof postMessage=="function"&&!l.importScripts?(x=function x(S){l.postMessage(S+"","*");},l.addEventListener("message",p,!1)):C in c("script")?x=function x(S){s.appendChild(c("script"))[C]=function(){s.removeChild(this),v.call(S);};}:x=function x(S){setTimeout(r(v,S,1),0);}),i.exports={set:h,clear:m};},/* 196 *//***/function(i,e){i.exports=function(t,r,n){var s=n===void 0;switch(r.length){case 0:return s?t():t.call(n);case 1:return s?t(r[0]):t.call(n,r[0]);case 2:return s?t(r[0],r[1]):t.call(n,r[0],r[1]);case 3:return s?t(r[0],r[1],r[2]):t.call(n,r[0],r[1],r[2]);case 4:return s?t(r[0],r[1],r[2],r[3]):t.call(n,r[0],r[1],r[2],r[3]);}return t.apply(n,r);};},/* 197 *//***/function(i,e,t){var r=t(91),n=t(195).set,s=r.MutationObserver||r.WebKitMutationObserver,c=r.process,l=r.Promise,f=t(86)(c)=="process";i.exports=function(){var h,m,u,y=function y(){var x,I;for(f&&(x=c.domain)&&x.exit();h;){I=h.fn,h=h.next;try{I();}catch(d){throw h?u():m=void 0,d;}}m=void 0,x&&x.enter();};if(f)u=function u(){c.nextTick(y);};else if(s&&!(r.navigator&&r.navigator.standalone)){var T=!0,E=document.createTextNode("");new s(y).observe(E,{characterData:!0}),u=function u(){E.data=T=!T;};}else if(l&&l.resolve){var C=l.resolve(void 0);u=function u(){C.then(y);};}else u=function u(){n.call(r,y);};return function(x){var I={fn:x,next:void 0};m&&(m.next=I),h||(h=I,u()),m=I;};};},/* 198 *//***/function(i,e,t){var r=t(94);function n(s){var c,l;this.promise=new s(function(f,h){if(c!==void 0||l!==void 0)throw TypeError("Bad Promise constructor");c=f,l=h;}),this.resolve=r(c),this.reject=r(l);}i.exports.f=function(s){return new n(s);};},/* 199 *//***/function(i,e){i.exports=function(t){try{return{e:!1,v:t()};}catch(r){return{e:!0,v:r};}};},/* 200 *//***/function(i,e,t){var r=t(91),n=r.navigator;i.exports=n&&n.userAgent||"";},/* 201 *//***/function(i,e,t){var r=t(97),n=t(98),s=t(198);i.exports=function(c,l){if(r(c),n(l)&&l.constructor===c)return l;var f=s.f(c),h=f.resolve;return h(l),f.promise;};},/* 202 *//***/function(i,e,t){var r=t(90),n=t(92),s=t(91),c=t(194),l=t(201);r(r.P+r.R,"Promise",{"finally":function _finally(f){var h=c(this,n.Promise||s.Promise),m=typeof f=="function";return this.then(m?function(u){return l(h,f()).then(function(){return u;});}:f,m?function(u){return l(h,f()).then(function(){throw u;});}:f);}});},/* 203 *//***/function(i,e,t){var r=t(90),n=t(198),s=t(199);r(r.S,"Promise",{"try":function _try(c){var l=n.f(this),f=s(c);return(f.e?l.reject:l.resolve)(f.v),l.promise;}});},/* 204 *//***/function(i,e,t){i.exports={"default":t(205),__esModule:!0};},/* 205 *//***/function(i,e,t){t(206),i.exports=t(92).Object.keys;},/* 206 *//***/function(i,e,t){var r=t(124),n=t(110);t(207)("keys",function(){return function(c){return n(r(c));};});},/* 207 *//***/function(i,e,t){var r=t(90),n=t(92),s=t(101);i.exports=function(c,l){var f=(n.Object||{})[c]||Object[c],h={};h[c]=l(f),r(r.S+r.F*s(function(){f(1);}),"Object",h);};},/* 208 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=E(r),s=t(209),c=E(s),l=t(164),f=E(l),h=t(191),m=E(h);e.defer=C,e.periodicity=x,e.calculateFramesOffset=I,e.getProgress=d,e.getCurrentFrame=p;var u=t(188),y=t(187),T=E(y);function E(S){return S&&S.__esModule?S:{"default":S};}function C(){var S={};return S.promise=new m["default"](function(A,R){S.resolve=A,S.reject=R;}),S;}function x(S,A){var R=Math.floor(S/A),D=S-R*A;return D===0&&R>0&&(D=A,R--),[R,D];}function I(S){S=S.slice(0);var A=S[0],R=S[S.length-1];R.offset=R.offset||1,A.offset=A.offset||0;for(var D=0,U=-1,M=0;M<S.length;M++){var W=S[M];if(W.offset!=null){var Y=M-U;if(Y>1)for(var B=(W.offset-D)/Y,N=0;N<Y-1;N++)S[U+N+1].offset=D+B*(N+1);D=W.offset,U=M;}if(W.easing!=null&&(W.easing=(0,u.parseEasing)(W.easing)),M>0){var G=S[M].easing!=null;S[M]=(0,f["default"])({},S[M-1],S[M]),G||delete S[M].easing;}}return S;}function d(S,A,R){var D=S.currentTime,U=A.direction,M=A.duration,W=!1;if(U==="reverse")R=1-R,W=!0;else if(U==="alternate"||U==="alternate-reverse"){var Y=Math.floor(D/M);R===1&&Y--,Y%2^U==="alternate-reverse"&&(R=1-R,W=!0);}return{p:R,inverted:W};}function v(S,A,R,D){var U={};return(0,c["default"])(A).forEach(function(M){var W=(0,n["default"])(M,2),Y=W[0],B=W[1];if(Y!=="offset"&&Y!=="easing"){var N=R[Y]||R["default"],G=N(S[Y],B,D,S.offset,A.offset);G!=null&&(U[Y]=G);}}),U;}function p(S,A,R,D){var U=S.easing,M=S.effect;M||(R=(0,f["default"])({},T["default"],R));var W={};D=U(D,A);for(var Y=1;Y<A.length;Y++){var B=A[Y],N=B.offset;if(N>=D||Y===A.length-1){var G=A[Y-1],J=G.offset,tt=G.easing,at=D;if(tt){var ut=N-J;at=tt((D-J)/ut)*ut+J;}M?W=M(G,B,at,J,N):W=v(G,B,R,at);break;}}return W;}},/* 209 *//***/function(i,e,t){i.exports={"default":t(210),__esModule:!0};},/* 210 *//***/function(i,e,t){t(211),i.exports=t(92).Object.entries;},/* 211 *//***/function(i,e,t){var r=t(90),n=t(212)(!0);r(r.S,"Object",{entries:function entries(c){return n(c);}});},/* 212 *//***/function(i,e,t){var r=t(100),n=t(110),s=t(84),c=t(169).f;i.exports=function(l){return function(f){for(var h=s(f),m=n(h),u=m.length,y=0,T=[],E;u>y;)E=m[y++],(!r||c.call(h,E))&&T.push(l?[E,h[E]]:h[E]);return T;};};},/* 213 *//***/function(i,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array);var r=/* @__PURE__ */new Map();function n(c){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];c=c.toLowerCase();var h=r.get(c);if(!h)throw new TypeError("Invalid node: ".concat(c));var m=new h(l);return f.forEach(function(u){m.appendChild(u);}),m;}var s={registerNode:function registerNode(c,l){var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(l=l.toLowerCase(),r.has(l))throw new TypeError("Cannot registerNode, ".concat(l," has been taken."));r.set(l,c),Object.defineProperties(c.prototype,{nodeType:{value:f},tagName:{value:l.toUpperCase()},nodeName:{value:l},ownerDocument:{value:s},namespaceURI:{value:"http://spritejs.com/".concat(l)}});},createElement:n,createElementNS:function createElementNS(c,l){return n(l);},isSpriteNode:function isSpriteNode(c){return r.has(c.toLowerCase());}};e["default"]=s;},/* 214 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Symbol("type"),n=Symbol("bubbles"),s=Symbol("originalEvent"),c=Symbol("detail");var l=/*#__PURE__*/function(){function l(h){var _ref114=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref114$bubbles=_ref114.bubbles,m=_ref114$bubbles===void 0?null:_ref114$bubbles;_classCallCheck(this,l);if(typeof h=="string"?(this[r]=h,this[n]=!!m):(this[r]=h.type,this[s]=h,this[n]=m!=null?!!m:!!h.bubbles,h.detail&&(this[c]=h.detail)),!this[r])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(l,[{key:"setOriginalEvent",value:function setOriginalEvent(h){this[s]=h;}},{key:"originalEvent",get:function get(){return this[s];}},{key:"type",get:function get(){return this[r];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[c];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 *//***/function(i,e,t){t.r(e),t.d(e,"parseFilterString",function(){return n;}),t.d(e,"applyFilters",function(){return s;});var r=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(c){if(c=c.trim(),!c||c==="none")return null;var l=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,f=c.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),h=[];return f&&f.forEach(function(m){var u=m.match(l);if(!u)throw new TypeError("Invalid fitler string.");var _u3=_slicedToArray(u,3),y=_u3[1],T=_u3[2];y=y.toLowerCase(),T=T.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(E,C){var x;return y==="url"||y==="drop-shadow"&&C===3?x=E:x=Object(r.toNumber)(E),/%$/.test(E)&&(x/=100),x;}),h.push({type:y,args:T});}),h;}function s(c,l){c.clearFilter(),l&&l.forEach(function(_ref115){var f=_ref115.type,h=_ref115.args;var m=f;m==="drop-shadow"?m="dropShadow":m==="hue-rotate"&&(m="hueRotate"),c[m].apply(c,_toConsumableArray(h));});}},/* 216 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n,s){if(!s)return;var c=n.getListeners("beforerender"),l=n.getListeners("afterrender");c.length&&!s.beforeRender?s.beforeRender=function(f){n.dispatchEvent({type:"beforerender",detail:{context:f}});}:c.length||(s.beforeRender=null),l.length&&!s.afterRender?s.afterRender=function(f){n.dispatchEvent({type:"afterrender",detail:{context:f}});}:l.length||(s.afterRender=null);}},/* 217 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(12),n=t(218),s=t(70),c=t(213);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol("amount"),f=Symbol("meshCloud");var h=/*#__PURE__*/function(_s$default){function h(u){var _this15;var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,h);_this15=_callSuper(this,h),_this15.meshNode=u,u.connect(_assertThisInitialized(_this15)),_this15[l]=y,_this15[f]=null;return _this15;}_inherits(h,_s$default);return _createClass(h,[{key:"meshCloud",get:function get(){var u=this.meshNode,y=this[l];return!this[f]&&u.mesh&&(this[f]=new r.MeshCloud(u.mesh,y)),this[f];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[l];},set:function set(u){this[l]=u,this[f]&&(this[f].amount=u);}},{key:"brightness",value:function brightness(u,y){this.meshCloud&&(this.meshCloud.brightness(u,y),this.forceUpdate());}},{key:"contrast",value:function contrast(u,y){this.meshCloud&&(this.meshCloud.contrast(u,y),this.forceUpdate());}},{key:"delete",value:function _delete(u){this.meshCloud&&(this.meshCloud["delete"](u),this[l]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this16=this;var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(h,"draw",this,3)([u]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var y=this.shaderAttrs;y&&Object.entries(y).forEach(function(_ref116){var _ref117=_slicedToArray(_ref116,2),E=_ref117[0],C=_ref117[1];_this16.meshCloud.mesh.setAttribute(E,C);});var T=this.uniforms;if(this.uniforms){var E={};Object.entries(T).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),C=_ref119[0],x=_ref119[1];typeof x=="function"&&(x=x(_this16,C)),E[C]=x;}),this.meshCloud.mesh.setUniforms(E);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),u.push(this.meshCloud);}return u;}},{key:"getTransform",value:function getTransform(u){if(this.meshCloud)return this.meshCloud.getTransform(u);}},{key:"grayscale",value:function grayscale(u,y){this.meshCloud&&(this.meshCloud.grayscale(u,y),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(u,y){this.meshCloud&&(this.meshCloud.hueRotate(u,y),this.forceUpdate());}},{key:"invert",value:function invert(u,y){this.meshCloud&&(this.meshCloud.invert(u,y),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(u,y){if(!this.meshCloud)return!1;var T=this.attributes.pointerEvents;if(T==="none"||T!=="all"&&!this.isVisible)return!1;var E="both";T==="visibleFill"&&(E="fill"),T==="visibleStroke"&&(E="stroke");for(var C=0;C<this[l];C++)if(!this.meshCloud.isPointCollision(C,[u,y],E))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(u,y){this.meshCloud&&(this.meshCloud.opacity(u,y),this.forceUpdate());}},{key:"rotate",value:function rotate(u,y){var _ref120=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref121=_slicedToArray(_ref120,2),T=_ref121[0],E=_ref121[1];var C=Math.PI*y/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,x=_this$meshNode$attrib.x,_I13=_this$meshNode$attrib.y;this.meshCloud.rotate(u,C,[T+x,E+_I13]),this.forceUpdate();}}},{key:"saturate",value:function saturate(u,y){this.meshCloud&&(this.meshCloud.saturate(u,y),this.forceUpdate());}},{key:"scale",value:function scale(u,_ref122){var _ref123=_slicedToArray(_ref122,2),y=_ref123[0],_ref123$=_ref123[1],T=_ref123$===void 0?y:_ref123$;var _ref124=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref125=_slicedToArray(_ref124,2),E=_ref125[0],C=_ref125[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,x=_this$meshNode$attrib2.x,_I14=_this$meshNode$attrib2.y,_d12=1e-5;Math.abs(y)<_d12&&(y=1/y>0?_d12:-_d12),Math.abs(T)<_d12&&(T=1/T>0?_d12:-_d12),this.meshCloud.scale(u,[y,T],[E+x,C+_I14]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(u,y){this.meshCloud&&(this.meshCloud.setColorTransform(u,y),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(u,y){this.meshCloud&&(Array.isArray(y)&&(y=_toConsumableArray(y),y[0]/=255,y[1]/=255,y[2]/=255),this.meshCloud.setFillColor(u,y),this.forceUpdate());}},{key:"sepia",value:function sepia(u,y){this.meshCloud&&(this.meshCloud.sepia(u,y),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref126){var u=_ref126.width,y=_ref126.height;_superPropGet(h,"setResolution",this,3)([{width:u,height:y}]),this.meshNode.setResolution({width:u,height:y});}},{key:"setStrokeColor",value:function setStrokeColor(u,y){this.meshCloud&&(Array.isArray(y)&&(y=_toConsumableArray(y),y[0]/=255,y[1]/=255,y[2]/=255),this.meshCloud.setStrokeColor(u,y),this.forceUpdate());}},{key:"setTransform",value:function setTransform(u,y){this.meshCloud&&(this.meshCloud.setTransform(u,y),this.forceUpdate());}},{key:"skew",value:function skew(u,_ref127){var _ref128=_slicedToArray(_ref127,2),y=_ref128[0],_ref128$=_ref128[1],T=_ref128$===void 0?y:_ref128$;var _ref129=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref130=_slicedToArray(_ref129,2),E=_ref130[0],C=_ref130[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,x=_this$meshNode$attrib3.x,_I15=_this$meshNode$attrib3.y;this.meshCloud.skew(u,[y,T],[E+x,C+_I15]),this.forceUpdate();}}},{key:"transform",value:function transform(u,y){this.meshCloud&&(this.meshCloud.transform(u,y),this.forceUpdate());}},{key:"transformColor",value:function transformColor(u,y){this.meshCloud&&(this.meshCloud.transformColor(u,y),this.forceUpdate());}},{key:"translate",value:function translate(u,_ref131){var _ref132=_slicedToArray(_ref131,2),y=_ref132[0],T=_ref132[1];this.meshCloud&&(this.meshCloud.translate(u,[y,T]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[f]&&(this[f].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(s["default"]);c["default"].registerNode(h,"cloud");},/* 218 *//***/function(i,e,t){t.r(e),t.d(e,"loadTexture",function(){return c;}),t.d(e,"applyTexture",function(){return l;}),t.d(e,"createTexture",function(){return h;}),t.d(e,"deleteTexture",function(){return m;}),t.d(e,"drawTexture",function(){return y;}),t.d(e,"loadFrames",function(){return T;});var r=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s={};function c(E,C){if(s[E])return s[E];var x=r.ENV.loadImage(E,{alias:C,useImageBitmap:!1});return x!==null&&x!==void 0?x:E;}function l(_x13,_x14,_x15){return _l2.apply(this,arguments);}function _l2(){_l2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(E,C,x){var I,_E$attributes,_d13,v,p,S;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:I=C;typeof C=="string"&&(I=c(C));_context8.t0=I&&typeof I.then=="function";if(!_context8.t0){_context8.next=7;break;}_context8.next=6;return I;case 6:I=_context8.sent;case 7:if(!(C===E.attributes.texture)){_context8.next=11;break;}I&&I.image&&(I.sourceRect&&(E.attributes.sourceRect=I.sourceRect),E.textureImageRotated=!!I.rotated,I=I.image);_E$attributes=E.attributes,_d13=_E$attributes.width,v=_E$attributes.height,p=_E$attributes.textureRect,S=E.textureImage;E.textureImage=I,x&&S!==I&&!p&&(_d13==null||v==null)&&E.updateContours(),E.forceUpdate();case 11:return _context8.abrupt("return",I);case 12:case"end":return _context8.stop();}},_callee8);}));return _l2.apply(this,arguments);}var f=Symbol("textureMap");function h(E,C){if(C[f]=C[f]||/* @__PURE__ */new Map(),C[f].has(E))return C[f].get(E);var x=C.createTexture(E);return!/^blob:/.test(E.src)&&typeof E.getContext!="function"&&C[f].set(E,x),x;}function m(E,C){if(C[f]&&C[f].has(E)){var x=C[f].get(E);return C.deleteTexture(x),C[f]["delete"](E),!0;}return!1;}var u=Symbol("textureContext");function y(E,C){var x=E.textureImage instanceof String?String(E.textureImage):E.textureImage,I=E.textureImageRotated,d=C.texture,v=E.renderer;if(x){var p=E.originalContentRect;var S=E.attributes.textureRect;var A=E.attributes.textureRepeat,R=E.attributes.sourceRect;if(!d||E[u]&&E[u]!==v||d.image!==x||d.options.repeat!==A||!Object(n.compareValue)(d.options.rect,S)||!Object(n.compareValue)(d.options.srcRect,R)){var D=h(x,v);S?(S[0]+=p[0],S[1]+=p[1]):S=p;var U=null;d&&!v[f].has(d.image)&&(!d.options||!d.options.hidden)&&(U=C.uniforms.u_texSampler),C.setTexture(D,{rect:S,repeat:A,srcRect:R,rotated:I}),U&&U["delete"]&&U["delete"](),E[u]=v;}}else if(d){var _p8=null;!v[f].has(d.image)&&(!d.options||!d.options.hidden)&&(_p8=C.uniforms.u_texSampler),C.setTexture(null),_p8&&_p8["delete"]&&_p8["delete"]();}}function T(_x16,_x17){return _T6.apply(this,arguments);}function _T6(){_T6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(E,C){var x,I;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.t0=typeof C=="string";if(!_context9.t0){_context9.next=7;break;}_context9.next=4;return fetch(C,{method:"GET",mode:"cors",cache:"default"});case 4:_context9.next=6;return _context9.sent.json();case 6:C=_context9.sent;case 7:_context9.next=9;return c(E);case 9:x=_context9.sent;I=C.frames;return _context9.abrupt("return",(Object.entries(I).forEach(function(_ref133){var _ref134=_slicedToArray(_ref133,2),d=_ref134[0],v=_ref134[1];var _v$frame=v.frame,p=_v$frame.x,S=_v$frame.y,A=_v$frame.w,R=_v$frame.h;var D=[p,S,A,R];var U=v.rotated;U&&(D=[D[0],D[1],D[3],D[2]]),s[d]={image:x,sourceRect:D,rotated:U};}),x));case 12:case"end":return _context9.stop();}},_callee9);}));return _T6.apply(this,arguments);}},/* 219 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(1),n=t(12),s=t(70),c=t(220),l=t(221),f=t(222),h=t(213),m=t(223);t(1).glMatrix.setMatrixArrayType(Array);function u(E,C,x){return C in E?Object.defineProperty(E,C,{value:x,enumerable:!0,configurable:!0,writable:!0}):E[C]=x,E;}var y=Symbol("mesh");var T=/*#__PURE__*/function(_s$default2){function T(){var C=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,T);return _callSuper(this,T,[C]);}_inherits(T,_s$default2);return _createClass(T,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,C=_this$attributes2.paddingTop,x=_this$attributes2.paddingRight,I=_this$attributes2.paddingBottom,d=_this$attributes2.paddingLeft,v=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),p=_this$contentSize[0],S=_this$contentSize[1];return[d+p+x+v,C+S+I+v];}// content + padding
278
+ },{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,C=_this$attributes3.paddingTop,x=_this$attributes3.paddingRight,I=_this$attributes3.paddingBottom,d=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),v=_this$contentSize2[0],p=_this$contentSize2[1];return[d+v+x,C+p+I];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,C=_this$attributes4.width,x=_this$attributes4.height,I=_this$attributes4.boxSizing,d=_this$attributes4.paddingTop,v=_this$attributes4.paddingRight,p=_this$attributes4.paddingBottom,S=_this$attributes4.paddingLeft;if(C=C||0,x=x||0,I==="border-box"){var A=2*this.attributes.borderWidth;C-=A+v+S,x-=A+d+p,C=Math.max(0,C),x=Math.max(0,x);}return[C,x];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),C=_this$borderSize[0],x=_this$borderSize[1];return C>0&&x>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var C=this.clientBox;if(C){var _x18;var x=this[y];if(x)x.box!==C&&(x.contours=C.contours,x.box=C);else{x=new n.Mesh2D(C),x.box=C;var _d14=this.attributes.bgcolor;if(Object(l.setFillColor)(x,{color:_d14}),this.hasBorder){var _this$attributes5=this.attributes,p=_this$attributes5.borderColor,S=_this$attributes5.borderWidth,A=_this$attributes5.borderDash,R=_this$attributes5.borderDashOffset;Object(l.setStrokeColor)(x,{color:p,lineWidth:S,lineDash:A,lineDashOffset:R});}this[y]=x;var v=this.attributes.clipPath;v&&this[y].setClipPath(v);}var _I16=this.opacity;return x.getOpacity()!==_I16&&x.setOpacity(_I16),(_x18=x).setTransform.apply(_x18,_toConsumableArray(this.renderMatrix)),x;}return null;}// content + padding + border
279
+ },{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,C=_this$attributes6.paddingTop,x=_this$attributes6.paddingRight,I=_this$attributes6.paddingBottom,d=_this$attributes6.paddingLeft,v=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),p=_this$contentSize3[0],S=_this$contentSize3[1],A=2*v;return[d+p+x+A,C+S+I+A];}},{key:"originalClientRect",get:function get(){if(this.mesh){var C=this.mesh.boundingBox;return[C[0][0],C[0][1],C[1][0]-C[0][0],C[1][1]-C[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),C=_this$originalClientR[0],x=_this$originalClientR[1],I=_this$originalClientR[2],d=_this$originalClientR[3],v=this.attributes.padding;return[C+v[0],x+v[1],I-v[0]-v[2],d-v[1]-v[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var C=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(C=r.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,C));var x=null;if(this.mesh){x=_toConsumableArray(this.mesh.boundingBox);var _I17=this.attributes.borderWidth;_I17&&(x[0]=[x[0][0]-_I17,x[0][1]-_I17],x[1]=[x[1][0]+_I17,x[1][1]+_I17]);}return Object(m["default"])(x,C);}// transformPoint(x, y) {
280
+ // const m = mat2d.invert(this.renderMatrix);
281
+ // const newX = x * m[0] + y * m[2] + m[4];
282
+ // const newY = x * m[1] + y * m[3] + m[5];
283
+ // return [newX, newY];
284
+ // }
285
+ /* override */},{key:"onPropertyChange",value:function onPropertyChange(C,x,I){if(_superPropGet(T,"onPropertyChange",this,3)([C,x,I]),(C==="anchorX"||C==="anchorY"||C==="boxSizing"||C==="width"||C==="height"||C==="borderWidth"||C==="paddingLeft"||C==="paddingRight"||C==="paddingTop"||C==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(C))&&this.updateContours(),this[y]&&C==="clipPath"&&this[y].setClipPath(x),this[y]&&C==="bgcolor"&&Object(l.setFillColor)(this[y],{color:x}),this[y]&&(C==="borderColor"||C==="borderWidth"||C==="borderDash"||C==="borderDashOffset")){var _this$attributes7=this.attributes,_d15=_this$attributes7.borderColor,v=_this$attributes7.borderWidth,p=_this$attributes7.borderDash,S=_this$attributes7.borderDashOffset;Object(l.setStrokeColor)(this[y],{color:_d15,lineWidth:v,lineDash:v?p:0,lineDashOffset:S});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,C=_this$attributes8.anchorX,x=_this$attributes8.anchorY,I=_this$attributes8.borderWidth,d=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),v=_this$borderSize2[0],p=_this$borderSize2[1],S=this.offsetSize,A=0.5*I,R=-C*S[0]+A,D=-x*S[1]+A;this.clientBox=new n.Figure2D(),Object(f.createRadiusBox)(this.clientBox,[R,D,v,p],d);}}]);}(s["default"]);u(T,"Attr",c["default"]),h["default"].registerNode(T,"block");},/* 220 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return m;});var r=t(71),n=t(72),s=t(221);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_setAttributeDefault"),h=Symbol["for"]("spritejs_declareAlias");var m=/*#__PURE__*/function(_r$default){function m(y){var _this17;_classCallCheck(this,m);_this17=_callSuper(this,m,[y]),_this17[f]({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}),_this17[h]("anchor","size","border","borderRadius","padding");return _this17;}_inherits(m,_r$default);return _createClass(m,[{key:"anchorX",get:function get(){return this[l]("anchorX");},set:function set(y){this[c]("anchorX",Object(n.toNumber)(y));}},{key:"anchorY",get:function get(){return this[l]("anchorY");},set:function set(y){this[c]("anchorY",Object(n.toNumber)(y));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.anchorX=y[0],this.anchorY=y[1];}},{key:"width",get:function get(){return this[l]("width");},set:function set(y){this[c]("width",Object(n.toNumber)(y));}},{key:"height",get:function get(){return this[l]("height");},set:function set(y){this[c]("height",Object(n.toNumber)(y));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.width=y[0],this.height=y[1];}},{key:"borderWidth",get:function get(){return this[l]("borderWidth");},set:function set(y){this[c]("borderWidth",Object(n.toNumber)(y));}},{key:"borderColor",get:function get(){return this[l]("borderColor");},set:function set(y){this[c]("borderColor",Object(s.parseColor)(y));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y]),this.borderWidth=y[0],y[1]!=null&&(this.borderColor=y[1]);}},{key:"borderDash",get:function get(){return this[l]("borderDash");},set:function set(y){y=Object(n.toArray)(y,!0),y!=null&&!Array.isArray(y)&&(y=[y]),this[c]("borderDash",y?y.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[l]("borderDashOffset");},set:function set(y){this[c]("borderDashOffset",Object(n.toNumber)(y));}},{key:"borderTopLeftRadius",get:function get(){return this[l]("borderTopLeftRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderTopLeftRadius",y.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[l]("borderTopRightRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderTopRightRadius",y.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[l]("borderBottomRightRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderBottomRightRadius",y.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[l]("borderBottomLeftRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderBottomLeftRadius",y.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(y){if(y=Object(n.toArray)(y),!Array.isArray(y))y=Array(8).fill(y);else if(y.length===2)y=[y[0],y[1],y[0],y[1],y[0],y[1],y[0],y[1]];else if(y.length===4)y=[y[0],y[1],y[2],y[3],y[0],y[1],y[2],y[3]];else if(y.length===6)y=[y[0],y[1],y[2],y[3],y[4],y[5],y[2],y[3]];else if(y.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[y[0],y[1]],this.borderTopRightRadius=[y[2],y[3]],this.borderBottomRightRadius=[y[4],y[5]],this.borderBottomLeftRadius=[y[6],y[7]];}},{key:"bgcolor",get:function get(){return this[l]("bgcolor");},set:function set(y){this[c]("bgcolor",Object(s.parseColor)(y));}},{key:"paddingTop",get:function get(){return this[l]("paddingTop");},set:function set(y){this[c]("paddingTop",Object(n.toNumber)(y));}},{key:"paddingRight",get:function get(){return this[l]("paddingRight");},set:function set(y){this[c]("paddingRight",Object(n.toNumber)(y));}},{key:"paddingBottom",get:function get(){return this[l]("paddingBottom");},set:function set(y){this[c]("paddingBottom",Object(n.toNumber)(y));}},{key:"paddingLeft",get:function get(){return this[l]("paddingLeft");},set:function set(y){this[c]("paddingLeft",Object(n.toNumber)(y));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)?y.length===2?y=[y[0],y[1],y[0],y[1]]:y.length===3&&(y=[y[0],y[1],y[2],y[1]]):y=[y,y,y,y],this.paddingTop=y[0],this.paddingRight=y[1],this.paddingBottom=y[2],this.paddingLeft=y[3];}},{key:"clipPath",get:function get(){return this[l]("clipPath");},set:function set(y){this[c]("clipPath",y);}},{key:"boxSizing",get:function get(){return this[l]("boxSizing");},set:function set(y){if(y!=null&&y!=="border-box"&&y!=="content-box")throw new TypeError("Invalid boxSizing type.");this[c]("boxSizing",y);}}]);}(r["default"]);},/* 221 *//***/function(i,e,t){t.r(e),t.d(e,"Gradient",function(){return s;}),t.d(e,"isTransparent",function(){return c;}),t.d(e,"parseColor",function(){return l;}),t.d(e,"setFillColor",function(){return h;}),t.d(e,"setStrokeColor",function(){return m;}),t.d(e,"Color",function(){return u;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);var s=/*#__PURE__*/function(){function s(_ref135){var T=_ref135.vector,E=_ref135.colors;_classCallCheck(this,s);if(!Array.isArray(T)||T.length!==4&&T.length!==6&&T.length!==3)throw new TypeError("Invalid gradient");this.vector=T,this.colors=E.map(function(_ref136){var C=_ref136.offset,x=_ref136.color;return{offset:C,color:l(x)};});}return _createClass(s,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function c(y){return y instanceof s?!1:y==null?!0:n()(y)[3]===0;}function l(y){if(y==null||(y||(y="transparent"),y instanceof s))return y;var T=n()(y);if(!T||!T.length)throw new TypeError("Invalid color value.");return"rgba(".concat(T.join(),")");}function f(y,T,E){var C=y.boundingBox[0];if(E.vector){var x=E.vector,_I18=E.colors;x.length===4?(x=[x[0]+C[0],x[1]+C[1],x[2]+C[0],x[3]+C[1]],y.setLinearGradient({vector:x,colors:_I18,type:T})):x.length===3?(x=[x[0]+C[0],x[1]+C[1],x[2]],y.setCircularGradient({vector:x,colors:_I18,type:T})):(x=[x[0]+C[0],x[1]+C[1],x[2],x[3]+C[0],x[4]+C[1],x[5]],y.setRadialGradient({vector:x,colors:_I18,type:T}));}else y.gradient&&y.gradient[T]&&(delete y.gradient[T],delete y.uniforms.u_radialGradientVector);}function h(y,_ref137){var T=_ref137.color,_ref137$rule=_ref137.rule,E=_ref137$rule===void 0?"nonzero":_ref137$rule;return f(y,"fill",T),T.vector||y.setFill({color:T,rule:E}),y;}function m(y,_ref138){var T=_ref138.color,E=_ref138.lineWidth,C=_ref138.lineCap,x=_ref138.lineJoin,I=_ref138.lineDash,d=_ref138.lineDashOffset,v=_ref138.miterLimit,p=_ref138.roundSegments;f(y,"stroke",T),T.vector&&(T=[0,0,0,1]),y.setStroke({color:T,thickness:E,cap:C,join:x,miterLimit:v,lineDash:I,lineDashOffset:d,roundSegments:p});}var u=/*#__PURE__*/function(_Array){function u(){var _T7,_T8,_n2,_n3;var _this18;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var E=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var x=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,u);return _possibleConstructorReturn(_this18,(Array.isArray(T)&&(_T7=T,_T8=_slicedToArray(_T7,4),T=_T8[0],E=_T8[1],C=_T8[2],x=_T8[3],_T7),typeof T=="string"&&(_n2=n()(T),_n3=_slicedToArray(_n2,4),T=_n3[0],E=_n3[1],C=_n3[2],x=_n3[3],T/=255,E/=255,C/=255),_this18=_callSuper(this,u,[T,E,C,x]),_assertThisInitialized(_this18)));}_inherits(u,_Array);return _createClass(u,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(T){this[0]=T/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(T){this[1]=T/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(T){this[2]=T/255;}},{key:"a",get:function get(){return this[3];},set:function set(T){this[3]=T;}},{key:"hex",get:function get(){var T="0".concat(this.r.toString(16)).slice(-2),E="0".concat(this.g.toString(16)).slice(-2),C="0".concat(this.b.toString(16)).slice(-2);var x;return this.a<1&&(x=Math.round(this[3]*255),x="0".concat(x.toString(16)).slice(-2)),"#".concat(T).concat(E).concat(C).concat(x||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(T){return typeof T=="string"&&(T=n()(T),T[0]/=255,T[1]/=255,T[2]/=255),this[0]=T[0],this[1]=T[1],this[2]=T[2],this[3]=T[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 *//***/function(i,e,t){t.r(e),t.d(e,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(s,c,l,f,h){var m=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var u=0.5522848,y=f/2*u,T=h/2*u,E=c+f,C=l+h,x=c+f/2,I=l+h/2;m==="leftTop"?(s.moveTo(c,I),s.bezierCurveTo(c,I-T,x-y,l,x,l)):m==="rightTop"?s.bezierCurveTo(x+y,l,E,I-T,E,I):m==="rightBottom"?s.bezierCurveTo(E,I+T,x+y,C,x,C):m==="leftBottom"&&s.bezierCurveTo(x-y,C,c,I+T,c,I);}function n(s,_ref139,m){var _ref140=_slicedToArray(_ref139,4),c=_ref140[0],l=_ref140[1],f=_ref140[2],h=_ref140[3];if(!m||Array.isArray(m)&&m.every(function(u){return u===0;}))s.beginPath(),s.rect(c,l,f,h);else{typeof m=="number"&&(m=Array(8).fill(m));var _m$map=m.map(function(v,p){return p%2?Math.min(v,h/2):Math.min(v,f/2);}),_m$map2=_slicedToArray(_m$map,8),u=_m$map2[0],y=_m$map2[1],T=_m$map2[2],E=_m$map2[3],C=_m$map2[4],x=_m$map2[5],_I19=_m$map2[6],_d16=_m$map2[7];s.beginPath(),s.moveTo(c,l+y),r(s,c,l,u*2,y*2,"leftTop"),s.lineTo(c+f-T,l),r(s,c+f-T*2,l,T*2,E*2,"rightTop"),s.lineTo(c+f,l+h-x),r(s,c+f-C*2,l+h-x*2,C*2,x*2,"rightBottom"),s.lineTo(c+_I19,l+h),r(s,c,l+h-_d16*2,_I19*2,_d16*2,"leftBottom"),s.closePath();}return s;}},/* 223 *//***/function(i,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array),e["default"]=function(r,n){if(!r)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _r2=_slicedToArray(r,2),_r2$=_slicedToArray(_r2[0],2),s=_r2$[0],c=_r2$[1],_r2$2=_slicedToArray(_r2[1],2),l=_r2$2[0],f=_r2$2[1],h=s*n[0]+c*n[2]+n[4],m=s*n[1]+c*n[3]+n[5],u=l*n[0]+c*n[2]+n[4],y=l*n[1]+c*n[3]+n[5],T=l*n[0]+f*n[2]+n[4],E=l*n[1]+f*n[3]+n[5],C=s*n[0]+f*n[2]+n[4],x=s*n[1]+f*n[3]+n[5],I=Math.min(h,u,T,C),d=Math.min(m,y,E,x),v=Math.max(h,u,T,C),p=Math.max(m,y,E,x);return{x:I,y:d,width:v-I,height:p-d,left:I,top:d,right:v,bottom:p};};},/* 224 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(218),n=t(219),s=t(225),c=t(213);t(1).glMatrix.setMatrixArrayType(Array);function l(m,u,y){return u in m?Object.defineProperty(m,u,{value:y,enumerable:!0,configurable:!0,writable:!0}):m[u]=y,m;}var f=Symbol("textureTask");var h=/*#__PURE__*/function(_n$default){function h(){var _this19;var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,h);typeof u=="string"&&(u={texture:u}),_this19=_callSuper(this,h,[u]);return _this19;}/* override */_inherits(h,_n$default);return _createClass(h,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(h,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),u=_superPropGet3[0],y=_superPropGet3[1];var _this$attributes9=this.attributes,T=_this$attributes9.width,E=_this$attributes9.height;if(T==null||E==null){var C=this.textureImage,x=this.attributes.textureRect,_I20=this.attributes.sourceRect;if(x)T==null&&(u=x[0]+x[2]),E==null&&(y=x[1]+x[3]);else if(_I20){var _d17=this.layer?this.layer.displayRatio:1;T==null&&(u=_I20[2]/_d17),E==null&&(y=_I20[3]/_d17);}else if(C){var _d18=this.layer?this.layer.displayRatio:1;T==null&&(u=C.width/_d18),E==null&&(y=C.height/_d18);}}return[u,y];}},{key:"textureImageReady",get:function get(){return this[f]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(h,"draw",this,3)([u]);var y=this.mesh;return y&&Object(r.drawTexture)(this,y),u;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(u,y,T){if(_superPropGet(h,"onPropertyChange",this,3)([u,y,T]),u==="texture"&&(this[f]=Object(r.applyTexture)(this,y,!0)),u==="textureRect"){var _this$attributes10=this.attributes,E=_this$attributes10.width,C=_this$attributes10.height;(E==null||C==null)&&this.updateContours();}}}]);}(n["default"]);l(h,"Attr",s["default"]),c["default"].registerNode(h,"sprite");},/* 225 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute");var l=/*#__PURE__*/function(_r$default2){function l(h){var _this20;_classCallCheck(this,l);_this20=_callSuper(this,l,[h]),_this20[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this20;}_inherits(l,_r$default2);return _createClass(l,[{key:"texture",get:function get(){return this[c]("texture");},set:function set(h){this[s]("texture",h);}},{key:"textureRect",get:function get(){return this[c]("textureRect");},set:function set(h){this[s]("textureRect",h);}},{key:"sourceRect",get:function get(){return this[c]("sourceRect");},set:function set(h){this[s]("sourceRect",h);}},{key:"textureRepeat",get:function get(){return this[c]("textureRepeat");},set:function set(h){this[s]("textureRepeat",!!h);}}]);}(r["default"]);},/* 226 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return E;});var r=t(12),n=t(227),s=/* @__PURE__ */t.n(n),c=t(70),l=t(228),f=t(221),h=t(218),m=t(213),u=t(223);t(1).glMatrix.setMatrixArrayType(Array);function y(C,x,I){return x in C?Object.defineProperty(C,x,{value:I,enumerable:!0,configurable:!0,writable:!0}):C[x]=I,C;}var T=Symbol("mesh");var E=/*#__PURE__*/function(_c$default){function E(){var _this21;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);typeof x=="string"&&(x={d:x}),_this21=_callSuper(this,E,[x]),_this21.effects={d:function(_d19){function d(_x19,_x20,_x21,_x22,_x23){return _d19.apply(this,arguments);}d.toString=function(){return _d19.toString();};return d;}(function(I,d,v,p,S){var _s$a;var A=(v-p)/(S-p);if(A<=0)return I;if(A>=1)return d;var R=s.a._preprocessing(s.a.path2shapes(I),s.a.path2shapes(d)),D=(_s$a=s.a)._lerp.apply(_s$a,_toConsumableArray(R).concat([A]))[0];return D.reduce(function(M,W){return"".concat(M).concat(W.slice(2).join(" ")," ");},"M".concat(D[0][0]," ").concat(D[0][1],"C")).trim();})};return _this21;}/* override */_inherits(E,_c$default);return _createClass(E,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var x=this.path;if(x){var _I22;var _I21=this[T];if(_I21)_I21.path!==x&&(_I21.contours=x.contours,_I21.path=x);else{_I21=new r.Mesh2D(this.path),_I21.path=x;var v=this.attributes.fillColor,p=this.attributes.fillRule;v&&Object(f.setFillColor)(_I21,{color:v,rule:p});var S=this.attributes.lineWidth,A=this.attributes.strokeColor;if(A&&S>0){var _this$attributes11=this.attributes,D=_this$attributes11.lineCap,U=_this$attributes11.lineJoin,M=_this$attributes11.miterLimit,W=_this$attributes11.lineDash,Y=_this$attributes11.lineDashOffset,B=_this$attributes11.roundSegments;Object(f.setStrokeColor)(_I21,{color:A,lineWidth:S,lineCap:D,lineJoin:U,miterLimit:M,lineDash:W,lineDashOffset:Y,roundSegments:B});}this[T]=_I21;var R=this.attributes.clipPath;R&&this[T].setClipPath(R);}var _d20=this.opacity;return _I21.getOpacity()!==_d20&&_I21.setOpacity(_d20),(_I22=_I21).setTransform.apply(_I22,_toConsumableArray(this.renderMatrix)),_I21;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var x=this.path.boundingBox;return[x[0][0],x[0][1],x[1][0]-x[0][0],x[1][1]-x[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var x=this.mesh.boundingBox;return[x[0][0],x[0][1],x[1][0]-x[0][0],x[1][1]-x[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(x){this.attributes.d=x;}},{key:"draw",value:function draw(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(E,"draw",this,3)([x]);var I=this.mesh;return I&&Object(h.drawTexture)(this,I),x;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var x=null;return this.mesh&&(x=this.mesh.boundingBox),Object(u["default"])(x,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(x){if(this.mesh){var _I23=this.mesh.getPointAtLength(x);if(_I23)return[_I23.x,_I23.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(x,I,d){if(_superPropGet(E,"onPropertyChange",this,3)([x,I,d]),(x==="d"||x==="normalize")&&this.updateContours(),this[T]&&(x==="fillColor"||x==="fillRule")){var _this$attributes12=this.attributes,v=_this$attributes12.fillColor,p=_this$attributes12.fillRule;Object(f.setFillColor)(this[T],{color:v,rule:p});}if(this[T]&&(x==="strokeColor"||x==="lineWidth"||x==="lineCap"||x==="lineJoin"||x==="lineDash"||x==="lineDashOffset"||x==="roundSegments")){var _this$attributes13=this.attributes,_v4=_this$attributes13.strokeColor,_p9=_this$attributes13.lineWidth;if(_v4&&_p9>0){var _this$attributes14=this.attributes,S=_this$attributes14.lineCap,A=_this$attributes14.lineJoin,R=_this$attributes14.lineDash,D=_this$attributes14.lineDashOffset,U=_this$attributes14.miterLimit,M=_this$attributes14.roundSegments;Object(f.setStrokeColor)(this[T],{color:_v4,lineCap:S,lineJoin:A,lineWidth:_p9,lineDash:R,lineDashOffset:D,miterLimit:U,roundSegments:M});}}this[T]&&x==="clipPath"&&this[T].setClipPath(I),x==="texture"&&Object(h.applyTexture)(this,I);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new r.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(c["default"]);y(E,"Attr",l["default"]),m["default"].registerNode(E,"path");},/* 227 *//***/function(i,e,t){(function(r,n){i.exports=n();})(this,function(){var r=/* @__PURE__ */function(){function W(Y,B){var N=[],G=!0,J=!1,tt=void 0;try{for(var at=Y[Symbol.iterator](),ut;!(G=(ut=at.next()).done)&&(N.push(ut.value),!(B&&N.length===B));G=!0);}catch(K){J=!0,tt=K;}finally{try{!G&&at["return"]&&at["return"]();}finally{if(J)throw tt;}}return N;}return function(Y,B){if(Array.isArray(Y))return Y;if(Symbol.iterator in Object(Y))return W(Y,B);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,s=function s(Y,B,N,G,J,tt,at){var ut=Y.x,K=Y.y;ut*=B,K*=N;var Q=G*ut-J*K,ft=J*ut+G*K;return{x:Q+tt,y:ft+at};},c=function c(Y,B){var N=1.3333333333333333*Math.tan(B/4),G=Math.cos(Y),J=Math.sin(Y),tt=Math.cos(Y+B),at=Math.sin(Y+B);return[{x:G-J*N,y:J+G*N},{x:tt+at*N,y:at-tt*N},{x:tt,y:at}];},l=function l(Y,B,N,G){var J=Y*G-B*N<0?-1:1,tt=Math.sqrt(Y*Y+B*B),at=Math.sqrt(Y*Y+B*B),ut=Y*N+B*G,K=ut/(tt*at);return K>1&&(K=1),K<-1&&(K=-1),J*Math.acos(K);},f=function f(Y,B,N,G,J,tt,at,ut,K,Q,ft,gt){var mt=Math.pow(J,2),wt=Math.pow(tt,2),ht=Math.pow(ft,2),Nt=Math.pow(gt,2),Rt=mt*wt-mt*Nt-wt*ht;Rt<0&&(Rt=0),Rt/=mt*Nt+wt*ht,Rt=Math.sqrt(Rt)*(at===ut?-1:1);var X=Rt*J/tt*gt,z=Rt*-tt/J*ft,q=Q*X-K*z+(Y+N)/2,nt=K*X+Q*z+(B+G)/2,j=(ft-X)/J,Z=(gt-z)/tt,O=(-ft-X)/J,L=(-gt-z)/tt,$=l(1,0,j,Z),V=l(j,Z,O,L);return ut===0&&V>0&&(V-=n),ut===1&&V<0&&(V+=n),[q,nt,$,V];},h=function h(Y){var B=Y.px,N=Y.py,G=Y.cx,J=Y.cy,tt=Y.rx,at=Y.ry,ut=Y.xAxisRotation,K=ut===void 0?0:ut,Q=Y.largeArcFlag,ft=Q===void 0?0:Q,gt=Y.sweepFlag,mt=gt===void 0?0:gt,wt=[];if(tt===0||at===0)return[];var ht=Math.sin(K*n/360),Nt=Math.cos(K*n/360),Rt=Nt*(B-G)/2+ht*(N-J)/2,X=-ht*(B-G)/2+Nt*(N-J)/2;if(Rt===0&&X===0)return[];tt=Math.abs(tt),at=Math.abs(at);var z=Math.pow(Rt,2)/Math.pow(tt,2)+Math.pow(X,2)/Math.pow(at,2);z>1&&(tt*=Math.sqrt(z),at*=Math.sqrt(z));var q=f(B,N,G,J,tt,at,ft,mt,ht,Nt,Rt,X),nt=r(q,4),j=nt[0],Z=nt[1],O=nt[2],L=nt[3],$=Math.max(Math.ceil(Math.abs(L)/(n/4)),1);L/=$;for(var V=0;V<$;V++)wt.push(c(O,L)),O+=L;return wt.map(function(rt){var it=s(rt[0],tt,at,Nt,ht,j,Z),ct=it.x,St=it.y,Ct=s(rt[1],tt,at,Nt,ht,j,Z),Mt=Ct.x,Dt=Ct.y,At=s(rt[2],tt,at,Nt,ht,j,Z),Ot=At.x,Lt=At.y;return{x1:ct,y1:St,x2:Mt,y2:Dt,x:Ot,y:Lt};});},m={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
286
+ * segment pattern
287
+ * @type {RegExp}
288
+ */},u=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function y(W){var Y=[];return W.replace(u,function(B,N,G){var J=N.toLowerCase();for(G=E(G),J=="m"&&G.length>2&&(Y.push([N].concat(G.splice(0,2))),J="l",N=N=="m"?"l":"L");;){if(G.length==m[J])return G.unshift(N),Y.push(G);if(G.length<m[J])throw new Error("malformed path data");Y.push([N].concat(G.splice(0,m[J])));}}),Y;}var T=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function E(W){var Y=W.match(T);return Y?Y.map(Number):[];}function C(W){var Y=W[0][0],B=W[0][1],N=Y,G=B;return W.forEach(function(J){var tt=J[0],at=J[2],ut=J[4],K=J[6],Q=J[1],ft=J[3],gt=J[5],mt=J[7];Y=Math.min(Y,tt,at,ut,K),B=Math.min(B,Q,ft,gt,mt),N=Math.max(N,tt,at,ut,K),G=Math.max(G,Q,ft,gt,mt);}),[Y,B,N,G];}function x(W,Y){return Math.sqrt(Math.pow(W[0]-Y[0],2)+Math.pow(W[1]-Y[1],2))+Math.sqrt(Math.pow(W[2]-Y[2],2)+Math.pow(W[3]-Y[3],2));}function I(W,Y){var B=W[0],N=W[2],G=W[4],J=W[6],tt=W[1],at=W[3],ut=W[5],K=W[7],Q=Y[0],ft=Y[2],gt=Y[4],mt=Y[6],wt=Y[1],ht=Y[3],Nt=Y[5],Rt=Y[7];return Math.sqrt(Math.pow(Q-B,2)+Math.pow(wt-tt,2))+Math.sqrt(Math.pow(ft-N,2)+Math.pow(ht-at,2))+Math.sqrt(Math.pow(gt-G,2)+Math.pow(Nt-ut,2))+Math.sqrt(Math.pow(mt-J,2)+Math.pow(Rt-K,2));}function d(W,Y){var B=p(W.length),N=[];B.forEach(function(J){var tt=0,at=0;J.forEach(function(ut){tt+=I(W[ut],Y[at++]);}),N.push({index:J,distance:tt});}),N.sort(function(J,tt){return J.distance-tt.distance;});var G=[];return N[0].index.forEach(function(J){G.push(W[J]);}),G;}function v(W,Y){var B=S(W.length),N=[];B.forEach(function(J){var tt=0;J.forEach(function(at){tt+=x(C(W[at]),C(Y[at]));}),N.push({index:J,distance:tt});}),N.sort(function(J,tt){return J.distance-tt.distance;});var G=[];return N[0].index.forEach(function(J){G.push(W[J]);}),G;}function p(W){for(var Y=[],B=0;B<W;B++){for(var N=[],G=0;G<W;G++){var J=G+B;J>W-1&&(J-=W),N[J]=G;}Y.push(N);}return Y;}function S(W){for(var Y=[],B=0;B<W;B++)Y.push(B);return A(Y);}function A(W){var Y=[],B=[];function N(G){var J,tt;for(J=0;J<G.length;J++)tt=G.splice(J,1)[0],B.push(tt),G.length==0&&Y.push(B.slice()),N(G),G.splice(J,0,tt),B.pop();return Y;}return N(W);}var R={};R.parser=y,R.lerpCurve=function(W,Y,B){return R.lerpPoints(W[0],W[1],Y[0],Y[1],B).concat(R.lerpPoints(W[2],W[3],Y[2],Y[3],B)).concat(R.lerpPoints(W[4],W[5],Y[4],Y[5],B)).concat(R.lerpPoints(W[6],W[7],Y[6],Y[7],B));},R.lerpPoints=function(W,Y,B,N,G){return[W+(B-W)*G,Y+(N-Y)*G];},R.q2b=function(W,Y,B,N,G,J){return[W,Y,(W+2*B)/3,(Y+2*N)/3,(G+2*B)/3,(J+2*N)/3,G,J];},R.path2shapes=function(W){for(var Y=R.parser(W),B=0,N=0,G=0,J=Y.length,tt=[],at=null,ut=void 0,K=void 0,Q=void 0,ft=void 0,gt=void 0,mt=void 0,wt=void 0;G<J;G++){var ht=Y[G],Nt=ht[0],Rt=Y[G-1];switch(Nt){case"m":gt=tt.length,tt[gt]=[],at=tt[gt],B=B+ht[1],N=N+ht[2];break;case"M":gt=tt.length,tt[gt]=[],at=tt[gt],B=ht[1],N=ht[2];break;case"l":at.push([B,N,B,N,B,N,B+ht[1],N+ht[2]]),B+=ht[1],N+=ht[2];break;case"L":at.push([B,N,ht[1],ht[2],ht[1],ht[2],ht[1],ht[2]]),B=ht[1],N=ht[2];break;case"h":at.push([B,N,B,N,B,N,B+ht[1],N]),B+=ht[1];break;case"H":at.push([B,N,ht[1],N,ht[1],N,ht[1],N]),B=ht[1];break;case"v":at.push([B,N,B,N,B,N,B,N+ht[1]]),N+=ht[1];break;case"V":at.push([B,N,B,ht[1],B,ht[1],B,ht[1]]),N=ht[1];break;case"C":at.push([B,N,ht[1],ht[2],ht[3],ht[4],ht[5],ht[6]]),B=ht[5],N=ht[6];break;case"S":Rt[0]==="C"||Rt[0]==="c"?at.push([B,N,B+Rt[5]-Rt[3],N+Rt[6]-Rt[4],ht[1],ht[2],ht[3],ht[4]]):(Rt[0]==="S"||Rt[0]==="s")&&at.push([B,N,B+Rt[3]-Rt[1],N+Rt[4]-Rt[2],ht[1],ht[2],ht[3],ht[4]]),B=ht[3],N=ht[4];break;case"c":at.push([B,N,B+ht[1],N+ht[2],B+ht[3],N+ht[4],B+ht[5],N+ht[6]]),B=B+ht[5],N=N+ht[6];break;case"s":Rt[0]==="C"||Rt[0]==="c"?at.push([B,N,B+Rt[5]-Rt[3],N+Rt[6]-Rt[4],B+ht[1],N+ht[2],B+ht[3],N+ht[4]]):(Rt[0]==="S"||Rt[0]==="s")&&at.push([B,N,B+Rt[3]-Rt[1],N+Rt[4]-Rt[2],B+ht[1],N+ht[2],B+ht[3],N+ht[4]]),B=B+ht[3],N=N+ht[4];break;case"a":mt=h({rx:ht[1],ry:ht[2],px:B,py:N,xAxisRotation:ht[3],largeArcFlag:ht[4],sweepFlag:ht[5],cx:B+ht[6],cy:N+ht[7]}),wt=mt[mt.length-1],mt.forEach(function(X,z){z===0?at.push([B,N,X.x1,X.y1,X.x2,X.y2,X.x,X.y]):at.push([mt[z-1].x,mt[z-1].y,X.x1,X.y1,X.x2,X.y2,X.x,X.y]);}),B=wt.x,N=wt.y;break;case"A":mt=h({rx:ht[1],ry:ht[2],px:B,py:N,xAxisRotation:ht[3],largeArcFlag:ht[4],sweepFlag:ht[5],cx:ht[6],cy:ht[7]}),wt=mt[mt.length-1],mt.forEach(function(X,z){z===0?at.push([B,N,X.x1,X.y1,X.x2,X.y2,X.x,X.y]):at.push([mt[z-1].x,mt[z-1].y,X.x1,X.y1,X.x2,X.y2,X.x,X.y]);}),B=wt.x,N=wt.y;break;case"Q":at.push(R.q2b(B,N,ht[1],ht[2],ht[3],ht[4])),B=ht[3],N=ht[4];break;case"q":at.push(R.q2b(B,N,B+ht[1],N+ht[2],ht[3]+B,ht[4]+N)),B+=ht[3],N+=ht[4];break;case"T":Rt[0]==="Q"||Rt[0]==="q"?(Q=B+Rt[3]-Rt[1],ft=N+Rt[4]-Rt[2],at.push(R.q2b(B,N,Q,ft,ht[1],ht[2]))):(Rt[0]==="T"||Rt[0]==="t")&&(at.push(R.q2b(B,N,B+B-Q,N+N-ft,ht[1],ht[2])),Q=B+B-Q,ft=N+N-ft),B=ht[1],N=ht[2];break;case"t":Rt[0]==="Q"||Rt[0]==="q"?(Q=B+Rt[3]-Rt[1],ft=N+Rt[4]-Rt[2],at.push(R.q2b(B,N,Q,ft,B+ht[1],N+ht[2]))):(Rt[0]==="T"||Rt[0]==="t")&&(at.push(R.q2b(B,N,B+B-Q,N+N-ft,B+ht[1],N+ht[2])),Q=B+B-Q,ft=N+N-ft),B+=ht[1],N+=ht[2];break;case"Z":ut=at[0][0],K=at[0][1],at.push([B,N,ut,K,ut,K,ut,K]);break;case"z":ut=at[0][0],K=at[0][1],at.push([B,N,ut,K,ut,K,ut,K]);break;}}return tt;},R._upCurves=function(W,Y){for(var B=0,N=0,G=W.length;B<Y;B++)W.push(W[N].slice(0)),N++,N>G-1&&(N-=G);};function D(W,Y,B,N,G,J,tt,at,ut){return{left:U(W,Y,B,N,G,J,tt,at,ut),right:U(tt,at,G,J,B,N,W,Y,1-ut,!0)};}function U(W,Y,B,N,G,J,tt,at,ut,K){var Q=(B-W)*ut+W,ft=(N-Y)*ut+Y,gt=(G-B)*ut+B,mt=(J-N)*ut+N,wt=(tt-G)*ut+G,ht=(at-J)*ut+J,Nt=(gt-Q)*ut+Q,Rt=(mt-ft)*ut+ft,X=(wt-gt)*ut+gt,z=(ht-mt)*ut+mt,q=(X-Nt)*ut+Nt,nt=(z-Rt)*ut+Rt;return K?[q,nt,Nt,Rt,Q,ft,W,Y]:[W,Y,Q,ft,Nt,Rt,q,nt];}R._splitCurves=function(W,Y){for(var B=0,N=0;B<Y;B++){var G=W[N],J=D(G[0],G[1],G[2],G[3],G[4],G[5],G[6],G[7],0.5);W.splice(N,1),W.splice(N,0,J.left,J.right),N+=2,N>=W.length-1&&(N=0);}};function M(W,Y){for(var B=function B(J){var tt=W[W.length-1],at=[];tt.forEach(function(ut){at.push(ut.slice(0));}),W.push(at);},N=0;N<Y;N++)B();}return R.lerp=function(W,Y,B){return R._lerp(R.path2shapes(W),R.path2shapes(Y),B);},R.MIM_CURVES_COUNT=100,R._preprocessing=function(W,Y){var B=W.length,N=Y.length,G=JSON.parse(JSON.stringify(W)),J=JSON.parse(JSON.stringify(Y));return B>N?M(J,B-N):B<N&&M(G,N-B),G=v(G,J),G.forEach(function(tt,at){var ut=tt.length,K=J[at].length;ut>K?ut<R.MIM_CURVES_COUNT?(R._splitCurves(tt,R.MIM_CURVES_COUNT-ut),R._splitCurves(J[at],R.MIM_CURVES_COUNT-K)):R._splitCurves(J[at],ut-K):ut<K&&(K<R.MIM_CURVES_COUNT?(R._splitCurves(tt,R.MIM_CURVES_COUNT-ut),R._splitCurves(J[at],R.MIM_CURVES_COUNT-K)):R._splitCurves(tt,K-ut));}),G.forEach(function(tt,at){G[at]=d(tt,J[at]);}),[G,J];},R._lerp=function(W,Y,B){var N=[];return W.forEach(function(G,J){var tt=[];G.forEach(function(at,ut){tt.push(R.lerpCurve(at,Y[J][ut],B));}),N.push(tt);}),N;},R.animate=function(W){var Y=R.path2shapes(W.from),B=R.path2shapes(W.to),N=R._preprocessing(Y,B),G=/* @__PURE__ */new Date(),J=W.end||function(){},tt=W.progress||function(){},at=W.begin||function(){},ut=W.easing||function(mt){return mt;},K=null,Q=null,ft=W.time;at(Y);var gt=function mt(){var wt=/* @__PURE__ */new Date()-G;if(wt>=ft){Q=B,tt(Q,1),J(Q),cancelAnimationFrame(K);return;}var ht=ut(wt/ft);Q=R._lerp(N[0],N[1],ht),tt(Q,ht),K=requestAnimationFrame(mt);};gt();},R;});},/* 228 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(71),n=t(221),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute");var h=/*#__PURE__*/function(_r$default3){function h(u){var _this22;_classCallCheck(this,h);_this22=_callSuper(this,h,[u]),_this22[c]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
289
+ lineCap:"butt",// 'butt' or 'square' or 'round'
290
+ roundSegments:20,// default roundSegment if lineJoin or lineCap is round
291
+ lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this22;}_inherits(h,_r$default3);return _createClass(h,[{key:"d",get:function get(){return this[f]("d");},set:function set(u){this[l]("d",u);}},{key:"normalize",get:function get(){return this[f]("normalize");},set:function set(u){this[l]("normalize",!!u);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(u){this[l]("fillColor",Object(n.parseColor)(u));}},{key:"fillRule",get:function get(){return this[f]("fillRule");},set:function set(u){if(u!=null&&u!=="nonzero"&&u!=="evenodd")throw new TypeError("Invalid fill rule.");this[l]("fillRule",u);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(u){this[l]("strokeColor",Object(n.parseColor)(u));}},{key:"lineWidth",get:function get(){return this[f]("lineWidth");},set:function set(u){this[l]("lineWidth",Object(s.toNumber)(u));}},{key:"lineJoin",get:function get(){return this[f]("lineJoin");},set:function set(u){if(u!=null&&u!=="miter"&&u!=="bevel"&&u!=="round")throw new TypeError("Invalid lineJoin type.");this[l]("lineJoin",u);}},{key:"lineCap",get:function get(){return this[f]("lineCap");},set:function set(u){if(u!=null&&u!=="butt"&&u!=="square"&&u!=="round")throw new TypeError("Invalid lineCap type.");this[l]("lineCap",u);}},{key:"lineDash",get:function get(){return this[f]("lineDash");},set:function set(u){u=Object(s.toArray)(u,!0),u!=null&&!Array.isArray(u)&&(u=[u]),this[l]("lineDash",u?u.map(s.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[f]("lineDashOffset");},set:function set(u){this[l]("lineDashOffset",Object(s.toNumber)(u));}},{key:"miterLimit",get:function get(){return this[f]("miterLimit");},set:function set(u){this[l]("miterLimit",Object(s.toNumber)(u));}},{key:"roundSegments",get:function get(){return this[f]("roundSegments");},set:function set(u){this[l]("roundSegments",u);}},{key:"texture",get:function get(){return this[f]("texture");},set:function set(u){this[l]("texture",u);}},{key:"textureRect",get:function get(){return this[f]("textureRect");},set:function set(u){this[l]("textureRect",u);}},{key:"sourceRect",get:function get(){return this[f]("sourceRect");},set:function set(u){this[l]("sourceRect",u);}},{key:"textureRepeat",get:function get(){return this[f]("textureRepeat");},set:function set(u){this[l]("textureRepeat",!!u);}},{key:"clipPath",get:function get(){return this[f]("clipPath");},set:function set(u){this[l]("clipPath",u);}}]);}(r["default"]);},/* 229 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(230);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default4){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default4);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,h=_this$attributes15.width,m=_this$attributes15.height;return h>0&&m>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"rect");},/* 230 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return m;});var r=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function h(u){var y=u.width,T=u.height;return"M0 0L".concat(y," 0L").concat(y," ").concat(T,"L0 ").concat(T,"Z");}var m=/*#__PURE__*/function(_r$default5){function m(y){var _this23;_classCallCheck(this,m);_this23=_callSuper(this,m,[y]),_this23[s]({width:0,height:0/* size */}),_this23[f]("size");return _this23;}// readonly
292
+ _inherits(m,_r$default5);return _createClass(m,[{key:"d",get:function get(){return this[l]("d");},set:function set(y){}// eslint-disable-line no-empty-function
293
+ },{key:"width",get:function get(){return this[l]("width");},set:function set(y){if(y=Object(n.toNumber)(y),this[c]("width",y)){var T=h(this);this[c]("d",T);}}},{key:"height",get:function get(){return this[l]("height");},set:function set(y){if(y=Object(n.toNumber)(y),this[c]("height",y)){var T=h(this);this[c]("d",T);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.width=y[0],this.height=y[1];}}]);}(r["default"]);},/* 231 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(235);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default6){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default6);return _createClass(l,[{key:"isVisible",get:function get(){var h=this.attributes.sides;return h[0]>0&&h[1]>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"triangle");},/* 232 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(233);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default7){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default7);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var h=this.attributes.points;return h.length>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"polyline");},/* 233 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(228),n=t(72),s=t(234);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),h=Symbol["for"]("spritejs_declareAlias");function m(y){var T=y.points,E=y.smooth,C=y.smoothRange,x=y.close,I=[];for(var v=0;v<T.length;v+=2)I.push([T[v],T[v+1]]);var d="";return E?d=Object(s.makeSmoothCurveLine)(I,C):I.length&&(d="M".concat(I.map(function(v){return v.join(" ");}).join("L"))),d&&x&&(d+="Z"),d;}var u=/*#__PURE__*/function(_r$default8){function u(T){var _this24;_classCallCheck(this,u);_this24=_callSuper(this,u,[T]),_this24[c]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
294
+ /* close */}),_this24[h]("close");return _this24;}// readonly
295
+ _inherits(u,_r$default8);return _createClass(u,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
296
+ },{key:"close",get:function get(){return this.closeType!=="none";},set:function set(T){T=T?"normal":"none",this.closeType=T;}},{key:"closeType",get:function get(){return this[f]("closeType");},set:function set(T){if(T!=null&&T!=="none"&&T!=="normal")throw new TypeError("Invalid closeType type.");if(this[l]("closeType",T)){var E=m(this);this[l]("d",E);}}},{key:"smooth",get:function get(){return this[f]("smooth");},set:function set(T){if(this[l]("smooth",T)){var E=m(this);this[l]("d",E);}}},{key:"smoothRange",get:function get(){return this[f]("smoothRange");},set:function set(T){if(T&&!Array.isArray(T)&&(T=[T]),this[l]("smoothRange",T)&&this.smooth){var E=m(this);this[l]("d",E);}}},{key:"points",get:function get(){return this[f]("points");},set:function set(T){if(T=Object(n.toArray)(T),Array.isArray(T)&&(T=T.reduce(function(E,C){return Array.isArray(C)?[].concat(_toConsumableArray(E),_toConsumableArray(C.map(function(x){return Object(n.toNumber)(x);}))):[].concat(_toConsumableArray(E),[Object(n.toNumber)(C)]);},[])),this[l]("points",T)){var E=m(this);this[l]("d",E);}}}]);}(r["default"]);},/* 234 *//***/function(i,e,t){t.r(e),t.d(e,"makeSmoothCurveLine",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function c(h){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var u=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var y,T,E,C;if((n[h].x===n[h+1].x||n[h].y===n[h+1].y)&&(m=0,u=0),h<1?(y=n[0].x+(n[1].x-n[0].x)*m,T=n[0].y+(n[1].y-n[0].y)*m):(y=n[h].x+(n[h+1].x-n[h-1].x)*m,T=n[h].y+(n[h+1].y-n[h-1].y)*m),h>n.length-3){var x=n.length-1;E=n[x].x-(n[x].x-n[x-1].x)*u,C=n[x].y-(n[x].y-n[x-1].y)*u;}else E=n[h+1].x-(n[h+2].x-n[h].x)*u,C=n[h+1].y-(n[h+2].y-n[h].y)*u;return[{x:y,y:T},{x:E,y:C}];}n=n.map(function(_ref141){var _ref142=_slicedToArray(_ref141,2),h=_ref142[0],m=_ref142[1];return{x:h,y:m};});var l="",f=0;return n.forEach(function(h,m){if(m===0)l+="M".concat(h.x," ").concat(h.y);else{for(;m>s[f];)f++;if(f%2){var _c3=c(m-1),_c4=_slicedToArray(_c3,2),u=_c4[0],y=_c4[1];l+="C".concat([u.x,u.y,y.x,y.y,h.x,h.y].join(" "));}else l+="L".concat(h.x," ").concat(h.y);}}),l;}},/* 235 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var _m$sides=_slicedToArray(m.sides,2),u=_m$sides[0],y=_m$sides[1];var T=m.angle%360;return T<0&&(T+=360),T=Math.PI*T/180,[0,0,u,0,y*Math.cos(T),y*Math.sin(T)];}var h=/*#__PURE__*/function(_r$default9){function h(u){var _this25;_classCallCheck(this,h);_this25=_callSuper(this,h,[u]),_this25[s]({sides:[0,0],angle:60,closeType:"normal"});return _this25;}// readonly
297
+ _inherits(h,_r$default9);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
298
+ },{key:"sides",get:function get(){return this[l]("sides");},set:function set(u){if(u=Object(n.toArray)(u,!0),u!=null&&!Array.isArray(u)&&(u=[u,u]),this[c]("sides",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"angle",get:function get(){return this[l]("angle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("angle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 236 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(237);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default10){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default10);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var h=this.attributes.sides;return h[0]>0&&h[1]>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"parallel");},/* 237 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var _m$sides2=_slicedToArray(m.sides,2),u=_m$sides2[0],y=_m$sides2[1];var T=m.angle%360;T<0&&(T+=360),T=Math.PI*T/180;var E=y*Math.cos(T),C=y*Math.sin(T);return[0,0,u,0,E+u,C,E,C];}var h=/*#__PURE__*/function(_r$default11){function h(u){var _this26;_classCallCheck(this,h);_this26=_callSuper(this,h,[u]),_this26[s]({sides:[0,0],angle:90,closeType:"normal"});return _this26;}// readonly
299
+ _inherits(h,_r$default11);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
300
+ },{key:"sides",get:function get(){return this[l]("sides");},set:function set(u){if(u=Object(n.toArray)(u,!0),u!=null&&!Array.isArray(u)&&(u=[u,u]),this[c]("sides",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"angle",get:function get(){return this[l]("angle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("angle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 238 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(239);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default12){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default12);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"regular");},/* 239 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var u=m.edges,y=m.radius,T=m.offsetAngle,E=Math.PI*T/180-0.5*Math.PI;if(u<3||y<=0)return[];var C=[];for(var x=0;x<u;x++){var _I24=x*2*Math.PI/u+E,_d21=y*Math.cos(_I24),v=y*Math.sin(_I24);C.push(_d21,v);}return C;}var h=/*#__PURE__*/function(_r$default13){function h(u){var _this27;_classCallCheck(this,h);_this27=_callSuper(this,h,[u]),_this27[s]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this27;}// readonly
301
+ _inherits(h,_r$default13);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
302
+ },{key:"edges",get:function get(){return this[l]("edges");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("edges",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"radius",get:function get(){return this[l]("radius");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("radius",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"offsetAngle",get:function get(){return this[l]("offsetAngle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("offsetAngle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 240 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(241);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default14){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default14);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"star");},/* 241 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var u=m.angles,y=m.innerRadius,T=m.outerRadius,E=m.offsetAngle,C=Math.PI*E/180-0.5*Math.PI;if(u<3||y<=0||T<=0)return[];var x=[];for(var _I25=0;_I25<u*2;_I25++){var _d22=_I25*Math.PI/u+C,v=_I25%2?y:T,p=v*Math.cos(_d22),S=v*Math.sin(_d22);x.push(p,S);}return x;}var h=/*#__PURE__*/function(_r$default15){function h(u){var _this28;_classCallCheck(this,h);_this28=_callSuper(this,h,[u]),_this28[s]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this28;}// readonly
303
+ _inherits(h,_r$default15);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
304
+ },{key:"angles",get:function get(){return this[l]("angles");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("angles",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"innerRadius",get:function get(){return this[l]("innerRadius");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("innerRadius",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"outerRadius",get:function get(){return this[l]("outerRadius");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("outerRadius",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(u){u=Object(n.toArray)(u,!0),Array.isArray(u)||(u=[u,u]),this.innerRadius=u[0],this.outerRadius=u[1];}},{key:"offsetAngle",get:function get(){return this[l]("offsetAngle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("offsetAngle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 242 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(243);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default16){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default16);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,h=_this$attributes16.radiusX,m=_this$attributes16.radiusY,u=_this$attributes16.startAngle,y=_this$attributes16.endAngle;return h>0&&m>0&&u!==y&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"ellipse");},/* 243 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),h=Symbol["for"]("spritejs_declareAlias");function m(y){var T=y.radiusX,E=y.radiusY,C=y.startAngle,x=y.endAngle,I=y.direction,d=y.closeType,v=I==="anitclockwise",p=new r.Figure2D();return d==="sector"&&p.moveTo(0,0),p.ellipse(0,0,T,E,0,Math.PI*C/180,Math.PI*x/180,v),d!=="none"&&p.closePath(),p.path.reduce(function(R,D){return R+D.join(" ");},"");}var u=/*#__PURE__*/function(_n$default2){function u(T){var _this29;_classCallCheck(this,u);_this29=_callSuper(this,u,[T]),_this29[c]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
305
+ closeType:"none"// none | sector | normal
306
+ }),_this29[h]("radius","angle");return _this29;}// readonly
307
+ _inherits(u,_n$default2);return _createClass(u,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
308
+ },{key:"radiusX",get:function get(){return this[f]("radiusX");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("radiusX",T)){var E=m(this);this[l]("d",E);}}},{key:"radiusY",get:function get(){return this[f]("radiusY");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("radiusY",T)){var E=m(this);this[l]("d",E);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(T){T=Object(s.toArray)(T,!0),Array.isArray(T)||(T=[T,T]),this.radiusX=T[0],this.radiusY=T[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(T){T=Object(s.toArray)(T),Array.isArray(T)||(T=[T,T]),this.startAngle=T[0],this.endAngle=T[1];}},{key:"direction",get:function get(){return this[f]("direction");},set:function set(T){if(T!=null&&T!=="clockwise"&&T!=="anticlockwise")throw new TypeError("Invalid direction type.");this[l]("direction",T);}},{key:"startAngle",get:function get(){return this[f]("startAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("startAngle",T)){var E=m(this);this[l]("d",E);}}},{key:"endAngle",get:function get(){return this[f]("endAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("endAngle",T)){var E=m(this);this[l]("d",E);}}},{key:"closeType",get:function get(){return this[f]("closeType");},set:function set(T){if(T!=null&&T!=="none"&&T!=="sector"&&T!=="normal")throw new TypeError("Invalid closeType type.");if(this[l]("closeType",T)){var E=m(this);this[l]("d",E);}}}]);}(n["default"]);},/* 244 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(242),n=t(213),s=t(245);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default17){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default17);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"arc");},/* 245 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;});var r=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=/*#__PURE__*/function(_r$default18){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_r$default18);return _createClass(s,[{key:"radius",get:function get(){return _superPropGet(s,"radiusX",this,1);},set:function set(l){l=Object(n.toNumber)(l),_superPropSet(s,"radiusX",l,this,1,1),_superPropSet(s,"radiusY",l,this,1,1);}}]);}(r["default"]);},/* 246 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(247);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default19){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default19);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,h=_this$attributes17.innerRadius,m=_this$attributes17.outerRadius,u=_this$attributes17.startAngle,y=_this$attributes17.endAngle;return(h>0||m>0)&&u!==y&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"ring");},/* 247 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),h=Symbol["for"]("spritejs_declareAlias");function m(y){var _ref143;var T=y.innerRadius,E=y.outerRadius,C=y.startAngle,x=y.endAngle;var I=new r.Figure2D();if(C=Math.PI*C/180,x=Math.PI*x/180,T>E&&(_ref143=[E,T],T=_ref143[0],E=_ref143[1],_ref143),T<=0&&I.moveTo(0,0),I.arc(0,0,E,C,x,!1),T>0){var p=Math.PI*2;x<C&&(x=C+p+(x-C)%p),x-C>=p&&(x=C+p-1e-6),I.arc(0,0,T,x,C,!0);}return I.closePath(),I.path.reduce(function(p,S){return p+S.join(" ");},"");}var u=/*#__PURE__*/function(_n$default3){function u(T){var _this30;_classCallCheck(this,u);_this30=_callSuper(this,u,[T]),_this30[c]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this30[h]("radius","angle");return _this30;}// readonly
309
+ _inherits(u,_n$default3);return _createClass(u,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
310
+ },{key:"innerRadius",get:function get(){return this[f]("innerRadius");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("innerRadius",T)){var E=m(this);this[l]("d",E);}}},{key:"outerRadius",get:function get(){return this[f]("outerRadius");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("outerRadius",T)){var E=m(this);this[l]("d",E);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(T){T=Object(s.toArray)(T,!0),Array.isArray(T)||(T=[T,T]),this.innerRadius=T[0],this.outerRadius=T[1];}},{key:"startAngle",get:function get(){return this[f]("startAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("startAngle",T)){var E=m(this);this[l]("d",E);}}},{key:"endAngle",get:function get(){return this[f]("endAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("endAngle",T)){var E=m(this);this[l]("d",E);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(T){T=Object(s.toArray)(T),Array.isArray(T)||(T=[T,T]),this.startAngle=T[0],this.endAngle=T[1];}}]);}(n["default"]);},/* 248 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return E;});var r=t(12),n=t(218),s=t(219),c=t(249),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);function f(C,x,I){return x in C?Object.defineProperty(C,x,{value:I,enumerable:!0,configurable:!0,writable:!0}):C[x]=I,C;}var h=Symbol("textImage"),m=Symbol("textImageTask"),u=Symbol("textureContext"),y=Symbol("updateTextureRect"),T=Symbol("textCanvas");var E=/*#__PURE__*/function(_s$default3){function E(){var _this31;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);typeof x=="string"&&(x={text:x}),_this31=_callSuper(this,E,[x]);return _this31;}/* override */_inherits(E,_s$default3);return _createClass(E,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(E,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),x=_superPropGet5[0],I=_superPropGet5[1];var _this$attributes18=this.attributes,d=_this$attributes18.width,v=_this$attributes18.height;if(d==null||v==null){var p=this[h];p&&(d==null&&(x=p.rect[2]),v==null&&(I=p.rect[3]));}return[x,I];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(x){this.attributes.text=x;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(x){this.attributes.text=x;}},{key:"textImage",get:function get(){return this[h]||{};}},{key:"textImageReady",get:function get(){return this[m]||Promise.resolve();}/* override */},{key:"draw",value:function draw(x){_superPropGet(E,"draw",this,3)([x]);var I=this.mesh;if(I){var _d23=this[h];if(_d23){var v=I.texture;if(!v||this[u]&&this[u]!==this.renderer||_d23.needsUpdate?(_d23.needsUpdate=!1,Object(n.deleteTexture)(_d23.image,this.renderer),v=Object(n.createTexture)(_d23.image,this.renderer),this[y]=!0):v=I.uniforms.u_texSampler,this[y]){var _d23$rect$slice=_d23.rect.slice(2),_d23$rect$slice2=_slicedToArray(_d23$rect$slice,2),p=_d23$rect$slice2[0],S=_d23$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),A=_this$contentSize4[0],R=_this$contentSize4[1],D=this.attributes.textAlign,U=this.attributes.verticalAlign;var M=0;D==="center"?M=(A-p)/2:(D==="right"||D==="end")&&(M=A-p);var W=this.attributes.fontSize,Y=this.attributes.lineHeight;var B=0;U==="top"?B=(W-Y)/2:U==="bottom"&&(B=(Y-W)/2);var _this$attributes19=this.attributes,N=_this$attributes19.paddingLeft,G=_this$attributes19.paddingTop,J=this.attributes.borderWidth;M+=N+J,B+=G+J;var _this$attributes20=this.attributes,tt=_this$attributes20.anchorX,at=_this$attributes20.anchorY;M-=this.offsetSize[0]*tt,B-=this.offsetSize[1]*at,I.setTexture(v,{rect:[M,B,p,S]}),this[y]=!1,this[u]=this.renderer;}}}return x;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(x,I,d){x==="text"||x==="fontSize"||x==="fontFamily"||x==="fontStyle"||x==="fontVariant"||x==="fontWeight"||x==="fontStretch"||x==="lineHeight"||x==="strokeColor"||x==="fillColor"||x==="strokeWidth"?this.updateText():((x==="textAlign"||x==="verticalAlign")&&(this[y]=!0),_superPropGet(E,"onPropertyChange",this,3)([x,I,d]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(E,"updateContours",this,3)([]),this[y]=!0;}},{key:"updateText",value:function updateText(){var _this32=this;this[m]||(this[m]=Promise.resolve().then(function(){_this32[m]=null;var _this32$attributes=_this32.attributes,x=_this32$attributes.text,I=_this32$attributes.font,d=_this32$attributes.fillColor,v=_this32$attributes.strokeColor,p=_this32$attributes.strokeWidth,S=_this32.layer?_this32.layer.displayRatio:1;return _this32[T]=_this32[T]||r.ENV.createCanvas(1,1),_this32[h]=r.ENV.createText(x,{font:I,fillColor:d,strokeColor:v,strokeWidth:p,parseFont:r.parseFont,ratio:S,textCanvas:_this32[T]}),_this32[h].needsUpdate=!0,_this32.updateContours(),_this32.forceUpdate(),_this32[h];}));}}]);}(s["default"]);f(E,"Attr",c["default"]),l["default"].registerNode(E,"label");},/* 249 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(12),n=t(72),s=t(221),c=t(220);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_setAttribute"),h=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_declareAlias");var u=/*#__PURE__*/function(_c$default2){function u(T){var _this33;_classCallCheck(this,u);_this33=_callSuper(this,u,[T]),_this33[l]({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"}),_this33[m]("font");return _this33;}_inherits(u,_c$default2);return _createClass(u,[{key:"text",get:function get(){return this[h]("text")||" ";},set:function set(T){this[f]("text",T);}},{key:"fontSize",get:function get(){return this[h]("fontSize");},set:function set(T){this[f]("fontSize",Object(n.toNumber)(T));}},{key:"fontFamily",get:function get(){return this[h]("fontFamily");},set:function set(T){this[f]("fontFamily",T);}},{key:"fontStyle",get:function get(){return this[h]("fontStyle");},set:function set(T){this[f]("fontStyle",T);}},{key:"fontVariant",get:function get(){return this[h]("fontVariant");},set:function set(T){this[f]("fontVariant",T);}},{key:"fontWeight",get:function get(){return this[h]("fontWeight");},set:function set(T){this[f]("fontWeight",T);}},{key:"fontStretch",get:function get(){return this[h]("fontStretch");},set:function set(T){this[f]("fontStretch",T);}},{key:"lineHeight",get:function get(){return this[h]("lineHeight")||this.fontSize;},set:function set(T){this[f]("lineHeight",Object(n.toNumber)(T));}},{key:"textAlign",get:function get(){return this[h]("textAlign");},set:function set(T){this[f]("textAlign",T);}},{key:"strokeColor",get:function get(){return this[h]("strokeColor");},set:function set(T){this[f]("strokeColor",Object(s.parseColor)(T));}},{key:"strokeWidth",get:function get(){return this[h]("strokeWidth");},set:function set(T){this[f]("strokeWidth",Object(n.toNumber)(T));}},{key:"verticalAlign",get:function get(){return this[h]("verticalAlign");},set:function set(T){this[f]("verticalAlign",T);}},{key:"fillColor",get:function get(){return this[h]("fillColor");},set:function set(T){this[f]("fillColor",Object(s.parseColor)(T));}},{key:"font",get:function get(){var T=this.fontStyle,E=this.fontVariant,C=this.fontWeight,x=this.fontStretch,I=this.fontSize,d=this.lineHeight,v=this.fontFamily;return"".concat(T," ").concat(E," ").concat(C," ").concat(x," ").concat(I,"px/").concat(d,"px ").concat(v);},set:function set(T){if(T==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var E=Object(r.parseFont)(T);this.fontStyle=E.style,this.fontVariant=E.variant,this.fontWeight=E.weight,this.fontStretch=E.stretch,this.fontSize=Object(n.toNumber)("".concat(E.size).concat(E.unit)),E.lineHeight&&(this.lineHeight=E.pxLineHeight),this.fontFamily=E.family;}}}]);}(c["default"]);},/* 250 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(12),n=t(219),s=t(251),c=t(213),l=t(252);t(1).glMatrix.setMatrixArrayType(Array);function f(E,C,x){return C in E?Object.defineProperty(E,C,{value:x,enumerable:!0,configurable:!0,writable:!0}):E[C]=x,E;}var h=Symbol("zOrder"),m=Symbol("ordered"),u=Symbol("children"),y=Symbol("sealed");var T=/*#__PURE__*/function(_n$default4){function T(){var _this34;var C=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,T);_this34=_callSuper(this,T,[C]),_this34[u]=[],_this34[m]=null,_this34[h]=0;return _this34;}_inherits(T,_n$default4);return _createClass(T,[{key:"childNodes",get:function get(){return this[u];}},{key:"children",get:function get(){return this[u];}},{key:"orderedChildren",get:function get(){return this[m]||(this[m]=_toConsumableArray(this[u]),this[m].sort(function(C,x){return C.zIndex-x.zIndex||C.zOrder-x.zOrder;})),this[m];}},{key:"append",value:function append(){var _this35=this;for(var _len12=arguments.length,C=new Array(_len12),_key12=0;_key12<_len12;_key12++){C[_key12]=arguments[_key12];}return C.map(function(x){return _this35.appendChild(x);});}},{key:"appendChild",value:function appendChild(C){return C.remove(),this[u].push(C),C.connect(this,this[h]++),this[m]&&(this[m].length&&C.zIndex<this[m][this[m].length-1].zIndex?this.reorder():this[m].push(C)),C;}/* override */// get isVisible() {
311
+ // return this.attributes.opacity > 0 && this[_children].length > 0;
312
+ // }
313
+ /* override */},{key:"cloneNode",value:function cloneNode(){var C=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var x=_superPropGet(T,"cloneNode",this,3)([]);return C&&this[u].forEach(function(I){var d=I.cloneNode(C);x.appendChild(d);}),x;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(C){var x=this.orderedChildren;for(var _I26=x.length-1;_I26>=0;_I26--)if(x[_I26].dispatchPointerEvent(C))return!0;return _superPropGet(T,"dispatchPointerEvent",this,3)([C]);}/* override */},{key:"draw",value:function draw(){var C=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(T,"draw",this,3)([C]),!this[y]&&this.attributes.display!=="none"){var x=this.orderedChildren;for(var _I27=0;_I27<x.length;_I27++)x[_I27].draw(C);}return this.__cacheRenderMatrix=null,C;}},{key:"getElementById",value:function getElementById(C){return Object(l.querySelector)("#".concat(C),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(C){return Object(l.querySelectorAll)(".".concat(C),this);}},{key:"getElementsByName",value:function getElementsByName(C){return Object(l.querySelectorAll)("[name=\"".concat(C,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(C){return Object(l.querySelectorAll)(C,this);}},{key:"insertBefore",value:function insertBefore(C,x){if(x==null)return this.appendChild(C);C.remove();var I=this[u].indexOf(x);if(I<0)throw new Error("Invalid reference node.");var d=x.zOrder;for(var v=I;v<this[u].length;v++){var p=this[u][v].zOrder,S=this[u][v];delete S.zOrder,Object.defineProperty(S,"zOrder",{value:p+1,writable:!1,configurable:!0});}if(this[u].splice(I,0,C),C.connect(this,d),this[m])if(C.zIndex!==x.zIndex)this.reorder();else{var _v5=this[m].indexOf(x);this[m].splice(_v5,0,C);}return C;}},{key:"querySelector",value:function querySelector(C){return Object(l.querySelector)(C,this);}},{key:"querySelectorAll",value:function querySelectorAll(C){return Object(l.querySelectorAll)(C,this);}},{key:"replaceChild",value:function replaceChild(C,x){C.remove();var I=this[u].indexOf(x);if(I<0)throw new Error("Invalid reference node.");if(this[u][I]=C,C.connect(this,x.zOrder),this[m])if(C.zIndex!==x.zIndex)this.reorder();else{var _d24=this[m].indexOf(x);this[m][_d24]=C;}return x.disconnect(this),C;}},{key:"removeAllChildren",value:function removeAllChildren(){var C=this[u];for(var x=C.length-1;x>=0;x--)C[x].remove();}},{key:"removeChild",value:function removeChild(C){var x=this[u].indexOf(C);if(x>=0){if(this[u].splice(x,1),this[m]){var _I28=this[m].indexOf(C);this[m].splice(_I28,1);}return C.disconnect(this),C;}return null;}},{key:"reorder",value:function reorder(){this[m]=null;}},{key:"seal",value:function seal(){function C(v,p){var S=[];for(var A=0;A<v.length;A++){var R=_toConsumableArray(v[A]);for(var D=1;D<R.length;D+=2){var U=R[D],M=R[D+1];R[D]=U*p[0]+M*p[2]+p[4],R[D+1]=U*p[1]+M*p[3]+p[5];}S.push(R);}return S;}var x=this.orderedChildren,I=new r.Figure2D(),d=this.localMatrix;for(var v=0;v<x.length;v++){var p=x[v];if(p instanceof T&&(p=p.seal()),p.clientBox){var S=p.clientBox.contours.path;S=C(S,p.localMatrix),I.addPath(S);}if(p.path){var _S7=p.path.contours.path;_S7=C(_S7,p.localMatrix),I.addPath(_S7);}}return this[y]=!0,this.clientBox=I,{clientBox:I,localMatrix:d};}/* override */},{key:"setResolution",value:function setResolution(_ref144){var C=_ref144.width,x=_ref144.height;_superPropGet(T,"setResolution",this,3)([{width:C,height:x}]),this[u].forEach(function(I){I.setResolution({width:C,height:x});});}/* override */},{key:"updateContours",value:function updateContours(){this[y]||_superPropGet(T,"updateContours",this,3)([]);}}]);}(n["default"]);f(T,"Attr",s["default"]),c["default"].registerNode(T,"group");},/* 251 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_r$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_r$default20);return _createClass(n);}(r["default"]);},/* 252 *//***/function(i,e,t){t.r(e),t.d(e,"querySelectorAll",function(){return y;}),t.d(e,"querySelector",function(){return T;}),t.d(e,"isMatched",function(){return E;}),t.d(e,"compile",function(){return C;});var r=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var s=t(253);function c(x){return x.nodeType===1||n["default"].isSpriteNode(x.nodeName);}function l(x){return Array.from(x.childNodes||[]);}function f(x){return n["default"].isSpriteNode(x.nodeName)?x.parent||x.canvas||x.container:x.parentElement;}function h(x){var I=x.length,d,v,p;for(;--I>-1;){for(d=v=x[I],x[I]=null,p=!0;v;){if(x.indexOf(v)>-1){p=!1,x.splice(I,1);break;}v=f(v);}p&&(x[I]=d);}return x;}var m={isTag:c,existsOne:function existsOne(x,I){return I.some(function(d){return c(d)?x(d)||m.existsOne(x,l(d)):!1;});},getSiblings:function getSiblings(x){var I=f(x);return I&&l(I);},getChildren:l,getParent:f,getAttributeValue:function getAttributeValue(x,I){if(x.nodeType===1&&I==="class"||I==="id")return x[I];if(this.hasAttrib(x,I)){var _d25=x.attributes[I];return Array.isArray(_d25)&&(_d25="[".concat(_d25.join(),"]")),String(_d25);}},hasAttrib:function hasAttrib(x,I){return x.attributes[I]!=null;},removeSubsets:h,getName:function getName(x){return x.tagName?x.tagName.toLowerCase():null;},findOne:function x(I,d){var v=null;for(var p=0,S=d.length;p<S&&!v;p++)if(I(d[p]))v=d[p];else{var A=l(d[p]);A&&A.length>0&&(v=x(I,A));}return v;},findAll:function x(I,d){var v=[];for(var p=0,S=d.length;p<S;p++){if(!c(d[p]))continue;I(d[p])&&v.push(d[p]);var A=l(d[p]);A&&(v=v.concat(x(I,A)));}return v;},getText:function x(I){return Array.isArray(I)?I.map(x).join(""):c(I)?x(l(I)):I.nodeType===3?I.nodeValue:n["default"].isSpriteNode(I.nodeName)?I.text:"";}};function u(x){if(typeof x!="string")return x;var I=x.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return I&&(I=I.map(function(d){var v=d.slice(1,-1).split("="),p=Object(r.parseColor)(v[1].replace(/['"]/g,""));return[d,"[".concat(v[0],"=\"").concat(p,"\"]")];}),I.forEach(function(_ref145){var _ref146=_slicedToArray(_ref145,2),d=_ref146[0],v=_ref146[1];x=x.replace(d,v);})),I=x.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),I&&(I=I.map(function(d){var v=d.slice(1,-1).split("="),p=v[1].slice(2,-2).split(/,/g).map(function(S){return S.trim();});return[d,"[".concat(v[0],"=\"[").concat(p,"]\"]")];}),I.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),d=_ref148[0],v=_ref148[1];x=x.replace(d,v);})),x;}function y(x,I){return s.selectAll(u(x),I,{adapter:m});}function T(x,I){return s.selectOne(u(x),I,{adapter:m});}function E(x,I){return s.is(x,u(I),{adapter:m});}function C(x){return s.compile(u(x),{adapter:m});}},/* 253 *//***/function(i,e,t){i.exports=C;var r=t(254),n=t(273).falseFunc,s=t(274);function c(x){return function(d,v,p){return v=v||{},v.adapter=v.adapter||r,x(d,v,p);};}var l=c(s),f=c(s.compileUnsafe);function h(x){return function(d,v,p){return p=p||{},p.adapter=p.adapter||r,typeof d!="function"&&(d=f(d,p,v)),d.shouldTestNextSiblings&&(v=u(p&&p.context||v,p.adapter)),Array.isArray(v)?v=p.adapter.removeSubsets(v):v=p.adapter.getChildren(v),x(d,v,p);};}function m(x,I){var d=I.getSiblings(x);if(!Array.isArray(d))return[];for(d=d.slice(0);d.shift()!==x;);return d;}function u(x,I){Array.isArray(x)||(x=[x]);for(var d=x.slice(0),v=0,p=x.length;v<p;v++){var S=m(d[v],I);d.push.apply(d,S);}return d;}var y=h(function(I,d,v){return I===n||!d||d.length===0?[]:v.adapter.findAll(I,d);}),T=h(function(I,d,v){return I===n||!d||d.length===0?null:v.adapter.findOne(I,d);});function E(x,I,d){return d=d||{},d.adapter=d.adapter||r,(typeof I=="function"?I:l(I,d))(x);}function C(x,I,d){return y(x,I,d);}C.compile=l,C.filters=s.Pseudos.filters,C.pseudos=s.Pseudos.pseudos,C.selectAll=y,C.selectOne=T,C.is=E,C.parse=l,C.iterate=y,C._compileUnsafe=f,C._compileToken=s.compileToken;},/* 254 *//***/function(i,e,t){var r=i.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(s){r[s]=n[s].bind(r);});});},/* 255 *//***/function(i,e,t){var r=t(256),n=t(257),s=r.isTag;i.exports={getInnerHTML:c,getOuterHTML:n,getText:l};function c(f,h){return f.children?f.children.map(function(m){return n(m,h);}).join(""):"";}function l(f){return Array.isArray(f)?f.map(l).join(""):s(f)?f.name==="br"?"\n":l(f.children):f.type===r.CDATA?l(f.children):f.type===r.Text?f.data:"";}},/* 256 *//***/function(i,e){i.exports={Text:"text",//Text
314
+ Directive:"directive",//<? ... ?>
315
+ Comment:"comment",//<!-- ... -->
316
+ Script:"script",//<script> tags
317
+ Style:"style",//<style> tags
318
+ Tag:"tag",//Any tag
319
+ CDATA:"cdata",//<![CDATA[ ... ]]>
320
+ Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 *//***/function(i,e,t){var r=t(258),n=t(259),s=t(267);s.elementNames.__proto__=null,s.attributeNames.__proto__=null;var c={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function l(x,I){if(x){var d="",v;for(var p in x)v=x[p],d&&(d+=" "),I.xmlMode==="foreign"&&(p=s.attributeNames[p]||p),d+=p,(v!==null&&v!==""||I.xmlMode)&&(d+='="'+(I.decodeEntities?n.encodeXML(v):v.replace(/\"/g,"&quot;"))+'"');return d;}}var f={__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},h=i.exports=function(x,I){!Array.isArray(x)&&!x.cheerio&&(x=[x]),I=I||{};for(var d="",v=0;v<x.length;v++){var p=x[v];p.type==="root"?d+=h(p.children,I):r.isTag(p)?d+=u(p,I):p.type===r.Directive?d+=y(p):p.type===r.Comment?d+=C(p):p.type===r.CDATA?d+=E(p):d+=T(p,I);}return d;},m=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function u(x,I){I.xmlMode==="foreign"&&(x.name=s.elementNames[x.name]||x.name,x.parent&&m.indexOf(x.parent.name)>=0&&(I=Object.assign({},I,{xmlMode:!1}))),!I.xmlMode&&["svg","math"].indexOf(x.name)>=0&&(I=Object.assign({},I,{xmlMode:"foreign"}));var d="<"+x.name,v=l(x.attribs,I);return v&&(d+=" "+v),I.xmlMode&&(!x.children||x.children.length===0)?d+="/>":(d+=">",x.children&&(d+=h(x.children,I)),(!f[x.name]||I.xmlMode)&&(d+="</"+x.name+">")),d;}function y(x){return"<"+x.data+">";}function T(x,I){var d=x.data||"";return I.decodeEntities&&!(x.parent&&x.parent.name in c)&&(d=n.encodeXML(d)),d;}function E(x){return"<![CDATA["+x.children[0].data+"]]>";}function C(x){return"<!--"+x.data+"-->";}},/* 258 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});function r(n){return n.type==="tag"||n.type==="script"||n.type==="style";}e.isTag=r,e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype";},/* 259 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.encode=e.decodeStrict=e.decode=void 0;var r=t(260),n=t(266);function s(m,u){return(!u||u<=0?r.decodeXML:r.decodeHTML)(m);}e.decode=s;function c(m,u){return(!u||u<=0?r.decodeXML:r.decodeHTMLStrict)(m);}e.decodeStrict=c;function l(m,u){return(!u||u<=0?n.encodeXML:n.encodeHTML)(m);}e.encode=l;var f=t(266);Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function get(){return f.encodeXML;}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function get(){return f.encodeHTML;}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function get(){return f.escape;}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function get(){return f.encodeHTML;}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function get(){return f.encodeHTML;}});var h=t(260);Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function get(){return h.decodeXML;}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function get(){return h.decodeHTML;}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function get(){return h.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function get(){return h.decodeHTML;}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function get(){return h.decodeHTML;}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function get(){return h.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function get(){return h.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function get(){return h.decodeXML;}});},/* 260 *//***/function(i,e,t){var r=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{"default":u};};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=r(t(261)),s=r(t(262)),c=r(t(263)),l=r(t(264));e.decodeXML=f(c["default"]),e.decodeHTMLStrict=f(n["default"]);function f(u){var y=Object.keys(u).join("|"),T=m(u);y+="|#[xX][\\da-fA-F]+|#\\d+";var E=new RegExp("&(?:"+y+");","g");return function(C){return String(C).replace(E,T);};}var h=function h(u,y){return u<y?1:-1;};e.decodeHTML=function(){for(var u=Object.keys(s["default"]).sort(h),y=Object.keys(n["default"]).sort(h),T=0,E=0;T<y.length;T++)u[E]===y[T]?(y[T]+=";?",E++):y[T]+=";";var C=new RegExp("&(?:"+y.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),x=m(n["default"]);function I(d){return d.substr(-1)!==";"&&(d+=";"),x(d);}return function(d){return String(d).replace(C,I);};}();function m(u){return function(T){if(T.charAt(1)==="#"){var E=T.charAt(2);return E==="X"||E==="x"?l["default"](parseInt(T.substr(3),16)):l["default"](parseInt(T.substr(2),10));}return u[T.slice(1,-1)];};}},/* 261 *//***/function(i){i.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(i){i.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(i){i.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 *//***/function(i,e,t){var r=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{"default":c};};Object.defineProperty(e,"__esModule",{value:!0});var n=r(t(265));function s(c){if(c>=55296&&c<=57343||c>1114111)return"�";c in n["default"]&&(c=n["default"][c]);var l="";return c>65535&&(c-=65536,l+=String.fromCharCode(c>>>10&1023|55296),c=56320|c&1023),l+=String.fromCharCode(c),l;}e["default"]=s;},/* 265 *//***/function(i){i.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(i,e,t){var r=this&&this.__importDefault||function(I){return I&&I.__esModule?I:{"default":I};};Object.defineProperty(e,"__esModule",{value:!0}),e.escape=e.encodeHTML=e.encodeXML=void 0;var n=r(t(263)),s=m(n["default"]),c=u(s);e.encodeXML=E(s,c);var l=r(t(261)),f=m(l["default"]),h=u(f);e.encodeHTML=E(f,h);function m(I){return Object.keys(I).sort().reduce(function(d,v){return d[I[v]]="&"+v+";",d;},{});}function u(I){for(var d=[],v=[],p=0,S=Object.keys(I);p<S.length;p++){var A=S[p];A.length===1?d.push("\\"+A):v.push(A);}d.sort();for(var R=0;R<d.length-1;R++){for(var D=R;D<d.length-1&&d[D].charCodeAt(1)+1===d[D+1].charCodeAt(1);)D+=1;var U=1+D-R;U<3||d.splice(R,U,d[R]+"-"+d[D]);}return v.unshift("["+d.join("")+"]"),new RegExp(v.join("|"),"g");}var y=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function T(I){return"&#x"+I.codePointAt(0).toString(16).toUpperCase()+";";}function E(I,d){return function(v){return v.replace(d,function(p){return I[p];}).replace(y,T);};}var C=u(s);function x(I){return I.replace(C,T).replace(y,T);}e.escape=x;},/* 267 *//***/function(i){i.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(i,e){var t=e.getChildren=function(n){return n.children;},r=e.getParent=function(n){return n.parent;};e.getSiblings=function(n){var s=r(n);return s?t(s):[n];},e.getAttributeValue=function(n,s){return n.attribs&&n.attribs[s];},e.hasAttrib=function(n,s){return!!n.attribs&&hasOwnProperty.call(n.attribs,s);},e.getName=function(n){return n.name;};},/* 269 *//***/function(i,e){e.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var r=t.parent.children;r.splice(r.lastIndexOf(t),1);}},e.replaceElement=function(t,r){var n=r.prev=t.prev;n&&(n.next=r);var s=r.next=t.next;s&&(s.prev=r);var c=r.parent=t.parent;if(c){var l=c.children;l[l.lastIndexOf(t)]=r;}},e.appendChild=function(t,r){if(r.parent=t,t.children.push(r)!==1){var n=t.children[t.children.length-2];n.next=r,r.prev=n,r.next=null;}},e.append=function(t,r){var n=t.parent,s=t.next;if(r.next=s,r.prev=t,t.next=r,r.parent=n,s){if(s.prev=r,n){var c=n.children;c.splice(c.lastIndexOf(s),0,r);}}else n&&n.children.push(r);},e.prepend=function(t,r){var n=t.parent;if(n){var s=n.children;s.splice(s.lastIndexOf(t),0,r);}t.prev&&(t.prev.next=r),r.parent=n,r.prev=t.prev,r.next=t,t.prev=r;};},/* 270 *//***/function(i,e,t){var r=t(256).isTag;i.exports={filter:n,find:s,findOneChild:c,findOne:l,existsOne:f,findAll:h};function n(m,u,y,T){return Array.isArray(u)||(u=[u]),(typeof T!="number"||!isFinite(T))&&(T=1/0),s(m,u,y!==!1,T);}function s(m,u,y,T){for(var E=[],C,x=0,I=u.length;x<I&&!(m(u[x])&&(E.push(u[x]),--T<=0)||(C=u[x].children,y&&C&&C.length>0&&(C=s(m,C,y,T),E=E.concat(C),T-=C.length,T<=0)));x++);return E;}function c(m,u){for(var y=0,T=u.length;y<T;y++)if(m(u[y]))return u[y];return null;}function l(m,u){for(var y=null,T=0,E=u.length;T<E&&!y;T++)if(r(u[T]))m(u[T])?y=u[T]:u[T].children.length>0&&(y=l(m,u[T].children));else continue;return y;}function f(m,u){for(var y=0,T=u.length;y<T;y++)if(r(u[y])&&(m(u[y])||u[y].children.length>0&&f(m,u[y].children)))return!0;return!1;}function h(m,u){for(var y=[],T=u.slice();T.length;){var E=T.shift();r(E)&&(E.children&&E.children.length>0&&T.unshift.apply(T,E.children),m(E)&&y.push(E));}return y;}},/* 271 *//***/function(i,e,t){var r=t(256),n=e.isTag=r.isTag;e.testElement=function(f,h){for(var m in f)if(f.hasOwnProperty(m)){if(m==="tag_name"){if(!n(h)||!f.tag_name(h.name))return!1;}else if(m==="tag_type"){if(!f.tag_type(h.type))return!1;}else if(m==="tag_contains"){if(n(h)||!f.tag_contains(h.data))return!1;}else if(!h.attribs||!f[m](h.attribs[m]))return!1;}return!0;};var s={tag_name:function tag_name(f){return typeof f=="function"?function(h){return n(h)&&f(h.name);}:f==="*"?n:function(h){return n(h)&&h.name===f;};},tag_type:function tag_type(f){return typeof f=="function"?function(h){return f(h.type);}:function(h){return h.type===f;};},tag_contains:function tag_contains(f){return typeof f=="function"?function(h){return!n(h)&&f(h.data);}:function(h){return!n(h)&&h.data===f;};}};function c(f,h){return typeof h=="function"?function(m){return m.attribs&&h(m.attribs[f]);}:function(m){return m.attribs&&m.attribs[f]===h;};}function l(f,h){return function(m){return f(m)||h(m);};}e.getElements=function(f,h,m,u){var y=Object.keys(f).map(function(T){var E=f[T];return T in s?s[T](E):c(T,E);});return y.length===0?[]:this.filter(y.reduce(l),h,m,u);},e.getElementById=function(f,h,m){return Array.isArray(h)||(h=[h]),this.findOne(c("id",f),h,m!==!1);},e.getElementsByTagName=function(f,h,m,u){return this.filter(s.tag_name(f),h,m,u);},e.getElementsByTagType=function(f,h,m,u){return this.filter(s.tag_type(f),h,m,u);};},/* 272 *//***/function(i,e){e.removeSubsets=function(n){for(var s=n.length,c,l,f;--s>-1;){for(c=l=n[s],n[s]=null,f=!0;l;){if(n.indexOf(l)>-1){f=!1,n.splice(s,1);break;}l=l.parent;}f&&(n[s]=c);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=e.compareDocumentPosition=function(n,s){var c=[],l=[],f,h,m,u,y,T;if(n===s)return 0;for(f=n;f;)c.unshift(f),f=f.parent;for(f=s;f;)l.unshift(f),f=f.parent;for(T=0;c[T]===l[T];)T++;return T===0?t.DISCONNECTED:(h=c[T-1],m=h.children,u=c[T],y=l[T],m.indexOf(u)>m.indexOf(y)?h===s?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:h===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};e.uniqueSort=function(n){var s=n.length,c,l;for(n=n.slice();--s>-1;)c=n[s],l=n.indexOf(c),l>-1&&l<s&&n.splice(s,1);return n.sort(function(f,h){var m=r(f,h);return m&t.PRECEDING?-1:m&t.FOLLOWING?1:0;}),n;};},/* 273 *//***/function(i,e){i.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 *//***/function(i,e,t){i.exports=y;var r=t(275).parse,n=t(273),s=t(278),c=t(279),l=t(280),f=t(282),h=n.trueFunc,m=n.falseFunc,u=f.filters;function y(M,W,Y){var B=E(M,W,Y);return T(B,W);}function T(M,W){var Y=W.adapter;return function(N){return Y.isTag(N)&&M(N);};}function E(M,W,Y){var B=r(M,W);return S(B,W,Y);}function C(M){return M.type==="pseudo"&&(M.name==="scope"||Array.isArray(M.data)&&M.data.some(function(W){return W.some(C);}));}var x={type:"descendant"},I={type:"_flexibleDescendant"},d={type:"pseudo",name:"scope"},v={};function p(M,W,Y){var B=W.adapter,N=!!Y&&!!Y.length&&Y.every(function(G){return G===v||!!B.getParent(G);});M.forEach(function(G){if(!(G.length>0&&A(G[0])&&G[0].type!=="descendant"))if(N&&!(Array.isArray(G)?G.some(C):C(G)))G.unshift(x);else return;G.unshift(d);});}function S(M,W,Y){M=M.filter(function(J){return J.length>0;}),M.forEach(s);var B=Array.isArray(Y);Y=W&&W.context||Y,Y&&!B&&(Y=[Y]),p(M,W,Y);var N=!1,G=M.map(function(J){if(J[0]&&J[1]&&J[0].name==="scope"){var tt=J[1].type;B&&tt==="descendant"?J[1]=I:(tt==="adjacent"||tt==="sibling")&&(N=!0);}return R(J,W,Y);}).reduce(D,m);return G.shouldTestNextSiblings=N,G;}function A(M){return c[M.type]<0;}function R(M,W,Y){return M.reduce(function(B,N){if(B===m)return B;if(!(N.type in l))throw new Error("Rule type "+N.type+" is not supported by css-select");return l[N.type](B,N,W,Y);},W&&W.rootFunc||h);}function D(M,W){return W===m||M===h?M:M===m||W===h?W:function(B){return M(B)||W(B);};}function U(M){return M.some(A);}u.not=function(M,W,Y,B){var N={xmlMode:!!(Y&&Y.xmlMode),strict:!!(Y&&Y.strict),adapter:Y.adapter};if(N.strict&&(W.length>1||W.some(U)))throw new Error("complex selectors in :not aren't allowed in strict mode");var G=S(W,N,B);return G===m?M:G===h?m:function(tt){return!G(tt)&&M(tt);};},u.has=function(M,W,Y){var B=Y.adapter,N={xmlMode:!!(Y&&Y.xmlMode),strict:!!(Y&&Y.strict),adapter:B},G=W.some(U)?[v]:null,J=S(W,N,G);return J===m?m:J===h?function(at){return B.getChildren(at).some(B.isTag)&&M(at);}:(J=T(J,Y),G?function(at){return M(at)&&(G[0]=at,B.existsOne(J,B.getChildren(at)));}:function(at){return M(at)&&B.existsOne(J,B.getChildren(at));});},u.matches=function(M,W,Y,B){var N={xmlMode:!!(Y&&Y.xmlMode),strict:!!(Y&&Y.strict),rootFunc:M,adapter:Y.adapter};return S(W,N,B);},y.compileToken=S,y.compileUnsafe=E,y.Pseudos=f;},/* 275 *//***/function(i,e,t){var r=this&&this.__createBinding||(Object.create?function(l,f,h,m){m===void 0&&(m=h),Object.defineProperty(l,m,{enumerable:!0,get:function get(){return f[h];}});}:function(l,f,h,m){m===void 0&&(m=h),l[m]=f[h];}),n=this&&this.__exportStar||function(l,f){for(var h in l)h!=="default"&&!f.hasOwnProperty(h)&&r(f,l,h);};Object.defineProperty(e,"__esModule",{value:!0}),n(t(276),e);var s=t(276);Object.defineProperty(e,"parse",{enumerable:!0,get:function get(){return s["default"];}});var c=t(277);Object.defineProperty(e,"stringify",{enumerable:!0,get:function get(){return c["default"];}});},/* 276 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=C;var r=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,s=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,c={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},l={">":"child","<":"parent","~":"sibling","+":"adjacent"},f={"#":["id","equals"],".":["class","element"]},h=/* @__PURE__ */new Set(["has","not","matches"]),m=/* @__PURE__ */new Set(["contains","icontains"]),u=/* @__PURE__ */new Set(['"',"'"]);function y(d,v,p){var S=parseInt(v,16)-65536;return S!==S||p?v:S<0?// BMP codepoint
321
+ String.fromCharCode(S+65536):// Supplemental Plane codepoint (surrogate pair)
322
+ String.fromCharCode(S>>10|55296,S&1023|56320);}function T(d){return d.replace(n,y);}function E(d){return d===" "||d==="\n"||d===" "||d==="\f"||d==="\r";}function C(d,v){var p=[];if(d=x(p,""+d,v),d!=="")throw new Error("Unmatched selector: "+d);return p;}function x(d,v,p){var S=[],A=!1;function R(){var ft=v.match(r);if(!ft)throw new Error("Expected name, found "+v);var gt=ft[0];return v=v.substr(gt.length),T(gt);}function D(ft){for(;E(v.charAt(ft));)ft++;v=v.substr(ft);}function U(ft){for(var gt=0;v.charAt(--ft)==="\\";)gt++;return(gt&1)===1;}for(D(0);v!=="";){var M=v.charAt(0);if(E(M))A=!0,D(1);else if(M in l)S.push({type:l[M]}),A=!1,D(1);else if(M===","){if(S.length===0)throw new Error("Empty sub-selector");d.push(S),S=[],A=!1,D(1);}else if(A&&(S.length>0&&S.push({type:"descendant"}),A=!1),M==="*")v=v.substr(1),S.push({type:"universal"});else if(M in f){var W=f[M],Y=W[0],B=W[1];v=v.substr(1),S.push({type:"attribute",name:Y,action:B,value:R(),ignoreCase:!1});}else if(M==="["){v=v.substr(1);var N=v.match(s);if(!N)throw new Error("Malformed attribute selector: "+v);v=v.substr(N[0].length);var G=T(N[1]);(!p||("lowerCaseAttributeNames"in p?p.lowerCaseAttributeNames:!p.xmlMode))&&(G=G.toLowerCase()),S.push({type:"attribute",name:G,action:c[N[2]],value:T(N[4]||N[5]||""),ignoreCase:!!N[6]});}else if(M===":"){if(v.charAt(1)===":"){v=v.substr(2),S.push({type:"pseudo-element",name:R().toLowerCase()});continue;}v=v.substr(1);var J=R().toLowerCase(),N=null;if(v.charAt(0)==="(")if(h.has(J)){var tt=v.charAt(1),at=u.has(tt);if(v=v.substr(at?2:1),N=[],v=x(N,v,p),at){if(v.charAt(0)!==tt)throw new Error("Unmatched quotes in :"+J);v=v.substr(1);}if(v.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+J+" ("+v+")");v=v.substr(1);}else{for(var ut=1,K=1;K>0&&ut<v.length;ut++)v.charAt(ut)==="("&&!U(ut)?K++:v.charAt(ut)===")"&&!U(ut)&&K--;if(K)throw new Error("Parenthesis not matched");if(N=v.substr(1,ut-2),v=v.substr(ut),m.has(J)){var tt=N.charAt(0);tt===N.slice(-1)&&u.has(tt)&&(N=N.slice(1,-1)),N=T(N);}}S.push({type:"pseudo",name:J,data:N});}else if(r.test(v)){var Q=R();(!p||("lowerCaseTags"in p?p.lowerCaseTags:!p.xmlMode))&&(Q=Q.toLowerCase()),S.push({type:"tag",name:Q});}else return S.length&&S[S.length-1].type==="descendant"&&S.pop(),I(d,S),v;}return I(d,S),v;}function I(d,v){if(d.length>0&&v.length===0)throw new Error("Empty sub-selector");d.push(v);}},/* 277 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(f){return f.map(s).join(", ");}e["default"]=n;function s(f){return f.map(c).join("");}function c(f){switch(f.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return f.name;case"pseudo-element":return"::"+f.name;case"pseudo":return f.data===null?":"+f.name:typeof f.data=="string"?":"+f.name+"("+f.data+")":":"+f.name+"("+n(f.data)+")";case"attribute":return f.action==="exists"?"["+f.name+"]":f.name==="id"&&f.action==="equals"&&!f.ignoreCase?"#"+f.value:f.name==="class"&&f.action==="element"&&!f.ignoreCase?"."+f.value:"["+f.name+r[f.action]+"='"+f.value+"'"+(f.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function l(f){return f;}},/* 278 *//***/function(i,e,t){i.exports=s;var r=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function s(l){for(var f=l.map(c),h=1;h<l.length;h++){var m=f[h];if(!(m<0))for(var u=h-1;u>=0&&m<f[u];u--){var y=l[u+1];l[u+1]=l[u],l[u]=y,f[u+1]=f[u],f[u]=m;}}}function c(l){var f=r[l.type];if(f===r.attribute)f=n[l.action],f===n.equals&&l.name==="id"&&(f=9),l.ignoreCase&&(f>>=1);else if(f===r.pseudo)if(!l.data)f=3;else if(l.name==="has"||l.name==="contains")f=0;else if(l.name==="matches"||l.name==="not"){f=0;for(var h=0;h<l.data.length;h++)if(l.data[h].length===1){var m=c(l.data[h][0]);if(m===0){f=0;break;}m>f&&(f=m);}l.data.length>1&&f>0&&(f-=1);}else f=1;return f;}},/* 279 *//***/function(i){i.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 *//***/function(i,e,t){var r=t(281),n=t(282);i.exports={__proto__:null,attribute:r.compile,pseudo:n.compile,//tags
323
+ tag:function tag(s,c,l){var f=c.name,h=l.adapter;return function(u){return h.getName(u)===f&&s(u);};},//traversal
324
+ descendant:function descendant(s,c,l){var f=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,h=l.adapter;return function(u){for(var y=!1;!y&&(u=h.getParent(u));)(!f||!f.has(u))&&(y=s(u),!y&&f&&f.add(u));return y;};},_flexibleDescendant:function _flexibleDescendant(s,c,l){var f=l.adapter;return function(m){for(var u=s(m);!u&&(m=f.getParent(m));)u=s(m);return u;};},parent:function parent(s,c,l){if(l&&l.strict)throw new Error("Parent selector isn't part of CSS3");var f=l.adapter;return function(u){return f.getChildren(u).some(h);};function h(m){return f.isTag(m)&&s(m);}},child:function child(s,c,l){var f=l.adapter;return function(m){var u=f.getParent(m);return!!u&&s(u);};},sibling:function sibling(s,c,l){var f=l.adapter;return function(m){for(var u=f.getSiblings(m),y=0;y<u.length;y++)if(f.isTag(u[y])){if(u[y]===m)break;if(s(u[y]))return!0;}return!1;};},adjacent:function adjacent(s,c,l){var f=l.adapter;return function(m){for(var u=f.getSiblings(m),y,T=0;T<u.length;T++)if(f.isTag(u[T])){if(u[T]===m)break;y=u[T];}return!!y&&s(y);};},universal:function universal(s){return s;}};},/* 281 *//***/function(i,e,t){var r=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,s={__proto__:null,equals:function equals(c,l,f){var h=l.name,m=l.value,u=f.adapter;return l.ignoreCase?(m=m.toLowerCase(),function(T){var E=u.getAttributeValue(T,h);return E!=null&&E.toLowerCase()===m&&c(T);}):function(T){return u.getAttributeValue(T,h)===m&&c(T);};},hyphen:function hyphen(c,l,f){var h=l.name,m=l.value,u=m.length,y=f.adapter;return l.ignoreCase?(m=m.toLowerCase(),function(E){var C=y.getAttributeValue(E,h);return C!=null&&(C.length===u||C.charAt(u)==="-")&&C.substr(0,u).toLowerCase()===m&&c(E);}):function(E){var C=y.getAttributeValue(E,h);return C!=null&&C.substr(0,u)===m&&(C.length===u||C.charAt(u)==="-")&&c(E);};},element:function element(c,l,f){var h=l.name,m=l.value,u=f.adapter;if(/\s/.test(m))return r;m=m.replace(n,"\\$&");var y="(?:^|\\s)"+m+"(?:$|\\s)",T=l.ignoreCase?"i":"",E=new RegExp(y,T);return function(x){var I=u.getAttributeValue(x,h);return I!=null&&E.test(I)&&c(x);};},exists:function exists(c,l,f){var h=l.name,m=f.adapter;return function(y){return m.hasAttrib(y,h)&&c(y);};},start:function start(c,l,f){var h=l.name,m=l.value,u=m.length,y=f.adapter;return u===0?r:l.ignoreCase?(m=m.toLowerCase(),function(E){var C=y.getAttributeValue(E,h);return C!=null&&C.substr(0,u).toLowerCase()===m&&c(E);}):function(E){var C=y.getAttributeValue(E,h);return C!=null&&C.substr(0,u)===m&&c(E);};},end:function end(c,l,f){var h=l.name,m=l.value,u=-m.length,y=f.adapter;return u===0?r:l.ignoreCase?(m=m.toLowerCase(),function(E){var C=y.getAttributeValue(E,h);return C!=null&&C.substr(u).toLowerCase()===m&&c(E);}):function(E){var C=y.getAttributeValue(E,h);return C!=null&&C.substr(u)===m&&c(E);};},any:function any(c,l,f){var h=l.name,m=l.value,u=f.adapter;if(m==="")return r;if(l.ignoreCase){var y=new RegExp(m.replace(n,"\\$&"),"i");return function(E){var C=u.getAttributeValue(E,h);return C!=null&&y.test(C)&&c(E);};}return function(E){var C=u.getAttributeValue(E,h);return C!=null&&C.indexOf(m)>=0&&c(E);};},not:function not(c,l,f){var h=l.name,m=l.value,u=f.adapter;return m===""?function(T){return!!u.getAttributeValue(T,h)&&c(T);}:l.ignoreCase?(m=m.toLowerCase(),function(T){var E=u.getAttributeValue(T,h);return E!=null&&E.toLowerCase()!==m&&c(T);}):function(T){return u.getAttributeValue(T,h)!==m&&c(T);};}};i.exports={compile:function compile(c,l,f){if(f&&f.strict&&(l.ignoreCase||l.action==="not"))throw new Error("Unsupported attribute selector");return s[l.action](c,l,f);},rules:s};},/* 282 *//***/function(i,e,t){var r=t(283),n=t(273),s=t(281),c=n.trueFunc,l=n.falseFunc,f=s.rules.equals;function h(I,d){var v={name:I,value:d};return function(S,A,R){return f(S,v,R);};}function m(I,d){return function(v){return!!d.getParent(v)&&I(v);};}var u={contains:function contains(I,d,v){var p=v.adapter;return function(A){return I(A)&&p.getText(A).indexOf(d)>=0;};},icontains:function icontains(I,d,v){var p=d.toLowerCase(),S=v.adapter;return function(R){return I(R)&&S.getText(R).toLowerCase().indexOf(p)>=0;};},//location specific methods
325
+ "nth-child":function nthChild(I,d,v){var p=r(d),S=v.adapter;return p===l?p:p===c?m(I,S):function(R){for(var D=S.getSiblings(R),U=0,M=0;U<D.length;U++)if(S.isTag(D[U])){if(D[U]===R)break;M++;}return p(M)&&I(R);};},"nth-last-child":function nthLastChild(I,d,v){var p=r(d),S=v.adapter;return p===l?p:p===c?m(I,S):function(R){for(var D=S.getSiblings(R),U=0,M=D.length-1;M>=0;M--)if(S.isTag(D[M])){if(D[M]===R)break;U++;}return p(U)&&I(R);};},"nth-of-type":function nthOfType(I,d,v){var p=r(d),S=v.adapter;return p===l?p:p===c?m(I,S):function(R){for(var D=S.getSiblings(R),U=0,M=0;M<D.length;M++)if(S.isTag(D[M])){if(D[M]===R)break;S.getName(D[M])===S.getName(R)&&U++;}return p(U)&&I(R);};},"nth-last-of-type":function nthLastOfType(I,d,v){var p=r(d),S=v.adapter;return p===l?p:p===c?m(I,S):function(R){for(var D=S.getSiblings(R),U=0,M=D.length-1;M>=0;M--)if(S.isTag(D[M])){if(D[M]===R)break;S.getName(D[M])===S.getName(R)&&U++;}return p(U)&&I(R);};},//TODO determine the actual root element
326
+ root:function root(I,d,v){var p=v.adapter;return function(S){return!p.getParent(S)&&I(S);};},scope:function scope(I,d,v,p){var S=v.adapter;if(!p||p.length===0)return u.root(I,d,v);function A(R,D){return typeof S.equals=="function"?S.equals(R,D):R===D;}return p.length===1?function(R){return A(p[0],R)&&I(R);}:function(R){return p.indexOf(R)>=0&&I(R);};},//jQuery extensions (others follow as pseudos)
327
+ checkbox:h("type","checkbox"),file:h("type","file"),password:h("type","password"),radio:h("type","radio"),reset:h("type","reset"),image:h("type","image"),submit:h("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
328
+ hover:function hover(I,d,v){var p=v.adapter;return typeof p.isHovered=="function"?function(A){return I(A)&&p.isHovered(A);}:l;},visited:function visited(I,d,v){var p=v.adapter;return typeof p.isVisited=="function"?function(A){return I(A)&&p.isVisited(A);}:l;},active:function active(I,d,v){var p=v.adapter;return typeof p.isActive=="function"?function(A){return I(A)&&p.isActive(A);}:l;}};function y(I,d){for(var v=0;I&&v<I.length;v++)if(d.isTag(I[v]))return I[v];}var T={empty:function empty(I,d){return!d.getChildren(I).some(function(v){return d.isTag(v)||v.type==="text";});},"first-child":function firstChild(I,d){return y(d.getSiblings(I),d)===I;},"last-child":function lastChild(I,d){for(var v=d.getSiblings(I),p=v.length-1;p>=0;p--){if(v[p]===I)return!0;if(d.isTag(v[p]))break;}return!1;},"first-of-type":function firstOfType(I,d){for(var v=d.getSiblings(I),p=0;p<v.length;p++)if(d.isTag(v[p])){if(v[p]===I)return!0;if(d.getName(v[p])===d.getName(I))break;}return!1;},"last-of-type":function lastOfType(I,d){for(var v=d.getSiblings(I),p=v.length-1;p>=0;p--)if(d.isTag(v[p])){if(v[p]===I)return!0;if(d.getName(v[p])===d.getName(I))break;}return!1;},"only-of-type":function onlyOfType(I,d){for(var v=d.getSiblings(I),p=0,S=v.length;p<S;p++)if(d.isTag(v[p])){if(v[p]===I)continue;if(d.getName(v[p])===d.getName(I))return!1;}return!0;},"only-child":function onlyChild(I,d){for(var v=d.getSiblings(I),p=0;p<v.length;p++)if(d.isTag(v[p])&&v[p]!==I)return!1;return!0;},//:matches(a, area, link)[href]
329
+ link:function link(I,d){return d.hasAttrib(I,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
330
+ //forms
331
+ //to consider: :target
332
+ //:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
333
+ selected:function selected(I,d){if(d.hasAttrib(I,"selected"))return!0;if(d.getName(I)!=="option")return!1;var v=d.getParent(I);if(!v||d.getName(v)!=="select"||d.hasAttrib(v,"multiple"))return!1;for(var p=d.getChildren(v),S=!1,A=0;A<p.length;A++)if(d.isTag(p[A]))if(p[A]===I)S=!0;else if(S){if(d.hasAttrib(p[A],"selected"))return!1;}else return!1;return S;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
334
+ //:matches(
335
+ // :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
336
+ // optgroup[disabled] > option),
337
+ // fieldset[disabled] * //TODO not child of first <legend>
338
+ //)
339
+ disabled:function disabled(I,d){return d.hasAttrib(I,"disabled");},enabled:function enabled(I,d){return!d.hasAttrib(I,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
340
+ checked:function checked(I,d){return d.hasAttrib(I,"checked")||T.selected(I,d);},//:matches(input, select, textarea)[required]
341
+ required:function required(I,d){return d.hasAttrib(I,"required");},//:matches(input, select, textarea):not([required])
342
+ optional:function optional(I,d){return!d.hasAttrib(I,"required");},//jQuery extensions
343
+ //:not(:empty)
344
+ parent:function parent(I,d){return!T.empty(I,d);},//:matches(h1, h2, h3, h4, h5, h6)
345
+ header:E(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
346
+ button:function button(I,d){var v=d.getName(I);return v==="button"||v==="input"&&d.getAttributeValue(I,"type")==="button";},//:matches(input, textarea, select, button)
347
+ input:E(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
348
+ text:function text(I,d){var v;return d.getName(I)==="input"&&(!(v=d.getAttributeValue(I,"type"))||v.toLowerCase()==="text");}};function E(I){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var d=new Set(I);return function(v,p){return d.has(p.getName(v));};}return function(v,p){return I.indexOf(p.getName(v))>=0;};}function C(I,d,v){if(v===null){if(I.length>2&&d!=="scope")throw new Error("pseudo-selector :"+d+" requires an argument");}else if(I.length===2)throw new Error("pseudo-selector :"+d+" doesn't have any arguments");}var x=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;i.exports={compile:function compile(I,d,v,p){var S=d.name,A=d.data,R=v.adapter;if(v&&v.strict&&!x.test(S))throw new Error(":"+S+" isn't part of CSS3");if(typeof u[S]=="function")return u[S](I,A,v,p);if(typeof T[S]=="function"){var D=T[S];return C(D,S,A),D===l?D:I===c?function(M){return D(M,R,A);}:function(M){return D(M,R,A)&&I(M);};}else throw new Error("unmatched pseudo-class :"+S);},filters:u,pseudos:T};},/* 283 *//***/function(i,e,t){var r=t(284),n=t(285);i.exports=function(c){return n(r(c));},i.exports.parse=r,i.exports.compile=n;},/* 284 *//***/function(i,e){i.exports=r;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function r(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var s=n.match(t);if(!s)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var c;return s[1]?(c=parseInt(s[1],10),isNaN(c)&&(s[1].charAt(0)==="-"?c=-1:c=1)):c=0,[c,s[3]?parseInt((s[2]||"")+s[3],10):0];}},/* 285 *//***/function(i,e,t){i.exports=c;var r=t(273),n=r.trueFunc,s=r.falseFunc;function c(l){var f=l[0],h=l[1]-1;if(h<0&&f<=0)return s;if(f===-1)return function(u){return u<=h;};if(f===0)return function(u){return u===h;};if(f===1)return h<0?n:function(u){return u>=h;};var m=h%f;return m<0&&(m+=f),f>1?function(u){return u>=h&&u%f===m;}:(f*=-1,function(u){return u<=h&&u%f===m;});}},/* 286 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return A;});var r=t(12),n=t(74),s=t(1),c=t(68),l=t(250),f=t(213),h=t(218);t(1).glMatrix.setMatrixArrayType(Array);function m(R,D){if(R==null)return{};var U=u(R,D),M,W;if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(R);for(W=0;W<Y.length;W++)M=Y[W],!(D.indexOf(M)>=0)&&Object.prototype.propertyIsEnumerable.call(R,M)&&(U[M]=R[M]);}return U;}function u(R,D){if(R==null)return{};var U={},M=Object.keys(R),W,Y;for(Y=0;Y<M.length;Y++)W=M[Y],!(D.indexOf(W)>=0)&&(U[W]=R[W]);return U;}var y={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
349
+ },T=Symbol("autoRender"),E=Symbol("renderer"),C=Symbol("timeline"),x=Symbol("prepareRender"),I=Symbol("tickRender"),d=Symbol("pass"),v=Symbol("fbo"),p=Symbol("tickers"),S=Symbol("layerTransformInvert");var A=/*#__PURE__*/function(_l$default){function A(){var _this36;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,A);if(_this36=_callSuper(this,A),!D.canvas){var _this36$getResolution=_this36.getResolution(),Y=_this36$getResolution.width,B=_this36$getResolution.height,N=r.ENV.createCanvas(Y,B,{offscreen:!!D.offscreen,id:D.id,extra:D.extra});N.style&&(N.style.position="absolute"),N.dataset&&(N.dataset.layerId=D.id),N.contextType&&(D.contextType=N.contextType),D.canvas=N;}var U=D.canvas,M=Object.assign({},y,D);_this36[T]=M.autoRender,delete D.autoRender;var W=M.Renderer||r.Renderer;_this36[E]=new W(U,M),_this36.options=D,_this36.id=D.id,_this36[d]=[],_this36.setResolution(U),_this36.canvas=U,_this36[C]=new n.Timeline(),_this36.__mouseCapturedTarget=null,_this36[S]=null;return _this36;}_inherits(A,_l$default);return _createClass(A,[{key:"autoRender",get:function get(){return this[T];}},{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(),D=_this$getResolution.height;return D/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[d];}},{key:"prepareRender",get:function get(){return this[x]?this[x]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[E];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,D=_this$parent$options.left,U=_this$parent$options.top;return[D,U];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[C];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),D=_this$getResolution2.width;return D/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,D=_this$attributes21.x,U=_this$attributes21.y;return[1,0,0,1,D,U];}},{key:"layerTransformInvert",get:function get(){if(this[S])return this[S];var D=this.transformMatrix;return D[0]===1&&D[1]===0&&D[2]===0&&D[3]===1&&D[4]===0&&D[5]===0?null:(this[S]=s.mat2d.invert(Array.of(0,0,0,0,0,0),D),this[S]);}},{key:"forceContextLoss",value:function forceContextLoss(){var D=this.renderer.glRenderer;if(D){var U=D.getExtension("WEBGL_lose_context");if(U)return U.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
350
+ // return true;
351
+ // }
352
+ },{key:"addPass",value:function addPass(){var _ref149=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},D=_ref149.vertex,U=_ref149.fragment,M=_ref149.options,W=_ref149.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),Y=_this$getResolution3.width,B=_this$getResolution3.height,N=this.renderer.createPassProgram({vertex:D,fragment:U,options:M}),G=new r.Figure2D();G.rect(0,0,Y/this.displayRatio,B/this.displayRatio);var J=new r.Mesh2D(G);return J.setUniforms(W),J.setProgram(N),this[d].push(J),this.forceUpdate(),J;}return null;}// delete unused texture to release memory.
353
+ },{key:"deleteTexture",value:function deleteTexture(D){return Object(h.deleteTexture)(D,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(D){var U=D.type;if(U==="mousedown"||U==="mouseup"||U==="mousemove"){var N=this.__mouseCapturedTarget;if(N){if(N.layer===this)return N.dispatchEvent(D),!0;this.__mouseCapturedTarget=null;}}var M,W;var Y=this.layerTransformInvert;if(Y){M=D.x,W=D.y;var _N6=Y,G=_N6[0]*M+_N6[2]*W+_N6[4],J=_N6[1]*M+_N6[3]*W+_N6[5];delete D.x,delete D.y,delete D.layerX,delete D.layerY,Object.defineProperties(D,{layerX:{value:G,configurable:!0},layerY:{value:J,configurable:!0},x:{value:G,configurable:!0},y:{value:J,configurable:!0}});}var B=_superPropGet(A,"dispatchPointerEvent",this,3)([D]);return Y&&Object.defineProperties(D,{layerX:{value:M,configurable:!0},layerY:{value:W,configurable:!0},x:{value:M,configurable:!0},y:{value:W,configurable:!0}}),B;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this37=this;if(!this[x])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var D=null;var U=new Promise(function(M){D=M;});U._resolve=D,this[x]=U;}else{var _D2=null,_U8=null;var M=new Promise(function(W){_D2=W,_this37[T]&&(_U8=Object(c.requestAnimationFrame)(function(){delete M._requestID,_this37.render();}));});M._resolve=_D2,M._requestID=_U8,this[x]=M;}}},{key:"getFBO",value:function getFBO(){var D=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),U=_this$getResolution4.width,M=_this$getResolution4.height;return D&&(!this[v]||this[v].width!==U||this[v].height!==M)?(this[v]={width:U,height:M,target:D.createFBO(),buffer:D.createFBO(),swap:function swap(){var _ref150=[this.buffer,this.target];this.target=_ref150[0];this.buffer=_ref150[1];}},this[v]):this[v]?this[v]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var D=this.renderer,U=D.__globalTransformMatrix||D.globalTransformMatrix;D.__globalTransformMatrix=U;var M=s.mat2d.fromValues(1,0,0,1,0,0);D.setGlobalTransform.apply(D,_toConsumableArray(s.mat2d.multiply(M,U,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(D,U,M){if(_superPropGet(A,"onPropertyChange",this,3)([D,U,M]),D==="zIndex"&&(this.canvas.style.zIndex=U),D==="transform"||D==="translate"||D==="rotate"||D==="scale"||D==="skew"){var W=this[S];if(this[S]=null,this.updateGlobalTransform(),W&&!this.layerTransformInvert){var Y=this.renderer,B=Y.__globalTransformMatrix||Y.globalTransformMatrix;Y.setGlobalTransform.apply(Y,_toConsumableArray(B));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[x]&&(this[x]._requestID&&Object(c.cancelAnimationFrame)(this[x]._requestID),this[x]._resolve(),delete this[x]);}},{key:"render",value:function render(){var _this38=this;var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref151$clear=_ref151.clear,D=_ref151$clear===void 0?!0:_ref151$clear;var U=this[d].length?this.getFBO():null;U&&this.renderer.glRenderer.bindFBO(U.target),D&&this[E].clear();var M=this.draw();if(M&&M.length&&(this.renderer.drawMeshes(M),this.canvas.draw&&this.canvas.draw()),U){var W=this.renderer.glRenderer,Y=this[d].length,_this$getResolution5=this.getResolution(),B=_this$getResolution5.width,N=_this$getResolution5.height,G=[0,0,B/this.displayRatio,N/this.displayRatio];this[d].forEach(function(J,tt){J.blend=!0,J.setTexture(U.target.texture,{rect:G}),tt===Y-1?W.bindFBO(null):(U.swap(),W.bindFBO(U.target)),_this38[E].clear(),_this38.renderer.drawMeshes([J]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref152){var _this39=this;var D=_ref152.width,U=_ref152.height;var M=this.renderer,W=M.__globalTransformMatrix||M.globalTransformMatrix,Y=W[4],B=W[5],N=W[0],_this$getResolution6=this.getResolution(),G=_this$getResolution6.width,J=_this$getResolution6.height;(G!==D||J!==U)&&(_superPropGet(A,"setResolution",this,3)([{width:D,height:U}]),this.canvas&&(this.canvas.width=D,this.canvas.height=U,M.updateResolution&&M.updateResolution()),this.attributes.size=[D,U],this[d].length&&this[d].forEach(function(K){var Q=new r.Figure2D();Q.rect(0,0,D/_this39.displayRatio,U/_this39.displayRatio),K.contours=Q.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),tt=_this$renderOffset[0],at=_this$renderOffset[1],ut=this.displayRatio;(Y!==tt||B!==at||N!==ut)&&(M.setGlobalTransform(ut,0,0,ut,tt,at),M.__globalTransformMatrix=null,this[S]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
354
+ * tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
355
+ * @param {*} handler
356
+ * @param {*} options
357
+ */},{key:"tick",value:function tick(){var _this40=this;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var U=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _U$duration=U.duration,M=_U$duration===void 0?1/0:_U$duration,W=m(U,["duration"]);var Y=this.timeline.fork(W),B=this;this[p]=this[p]||[],this[p].push({handler:D,duration:M});var _N7=function N(){var G=null,J=null;var tt=function tt(){var at=_this40[p].map(function(_ref153){var ut=_ref153.handler,K=_ref153.duration;var Q=Math.min(1,Y.currentTime/K);return{value:ut?ut(Y.currentTime,Q):null,p:Q};});B[I]||(B[I]=Promise.resolve().then(function(){B[T]&&B.render(),delete B[I];for(var ut=at.length-1;ut>=0;ut--){var _at$ut=at[ut],K=_at$ut.value,Q=_at$ut.p;(K===!1||Q>=1)&&_this40[p].splice(ut,1);}_this40[p].length>0&&_N7();}));};if(_this40[x]&&_this40[x]._type!=="ticker"&&(Object(c.cancelAnimationFrame)(_this40[x]._requestID),delete _this40[x]),!_this40[x]){var at=new Promise(function(ut){G=ut,J=Object(c.requestAnimationFrame)(tt);});at._resolve=G,at._requestID=J,at._type="ticker",_this40[x]=at;}};_N7();}},{key:"toGlobalPos",value:function toGlobalPos(D,U){if(this.layerTransformInvert){var G=this.transformMatrix;D=G[0]*D+G[2]*U+G[4],U=G[1]*D+G[3]*U+G[5];}var _this$getResolution7=this.getResolution(),M=_this$getResolution7.width,W=_this$getResolution7.height,Y=this.renderOffset,B=[this.canvas.clientWidth,this.canvas.clientHeight];D=D*B[0]/M+Y[0],U=U*B[1]/W+Y[1];var N=this.displayRatio;return D*=N,U*=N,[D,U];}},{key:"toLocalPos",value:function toLocalPos(D,U){var _this$getResolution8=this.getResolution(),M=_this$getResolution8.width,W=_this$getResolution8.height,Y=this.renderOffset,B=[this.canvas.clientWidth,this.canvas.clientHeight];D=D*M/B[0]-Y[0],U=U*W/B[1]-Y[1];var N=this.displayRatio;D/=N,U/=N;var G=this.layerTransformInvert;return G&&(D=G[0]*D+G[2]*U+G[4],U=G[1]*D+G[3]*U+G[5]),[D,U];}}]);}(l["default"]);f["default"].registerNode(A,"layer");},/* 287 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return x;});var r=t(224),n=t(288),s=t(213),c=t(252),l=t(72);t(1).glMatrix.setMatrixArrayType(Array);function f(I,d){if(I==null)return{};var v=h(I,d),p,S;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(I);for(S=0;S<A.length;S++)p=A[S],!(d.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(I,p)&&(v[p]=I[p]);}return v;}function h(I,d){if(I==null)return{};var v={},p=Object.keys(I),S,A;for(A=0;A<p.length;A++)S=p[A],!(d.indexOf(S)>=0)&&(v[S]=I[S]);return v;}function m(I,d,v){return d in I?Object.defineProperty(I,d,{value:v,enumerable:!0,configurable:!0,writable:!0}):I[d]=v,I;}var u="http://www.w3.org/2000/svg",y=Symbol["for"]("spritejs_setAttribute"),T=Symbol("root"),E=Symbol("task");function C(I){var d=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var v=I[T];if(v&&v.children[0]){var p=I.svg,S=I.layer?I.layer.displayRatio:1;if(!p.hasAttribute("data-original-width")){var D=p.getAttribute("width");D=D?Object(l.sizeToPixel)(D):300;var U=p.getAttribute("height");U=U?Object(l.sizeToPixel)(U):150,p.hasAttribute("viewBox")||p.setAttribute("viewBox","0 0 ".concat(Math.round(D)," ").concat(Math.round(U))),p.setAttribute("data-original-width",D),p.setAttribute("data-original-height",U);}var A=I.attributes.width||Number(p.getAttribute("data-original-width")),R=I.attributes.height||Number(p.getAttribute("data-original-height"));if(A*=S,R*=S,d&&I.attributes.flexible){var _D3=I.attributes.scale[0];if(A*=_D3,R*=_D3,p.setAttribute("width",A),p.setAttribute("height",R),A&&R&&I.textureImage){var _U9=I.textureImage.width,M=I.textureImage.height,W=I.clientSize;I.attributes.textureRect=[0,0,Math.round(W[0]*_U9/A),Math.round(W[1]*M/R)];}}else I[E]||(p.setAttribute("width",A),p.setAttribute("height",R),I[E]=Promise.resolve().then(function(){delete I[E];var D=v.innerHTML,U=new Blob([D],{type:"image/svg+xml"}),M=URL.createObjectURL(U),W=new Image();W.onload=function(){W.width&&W.height?(I.attributes[y]("texture",W),I.attributes.flexible&&(I.attributes.textureRect=null)):I.attributes[y]("texture",null);},W.src=M;}));}}var x=/*#__PURE__*/function(_r$default21){function x(){var _this41;var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,x);typeof d=="string"&&(d={svgText:d});var _d26=d,v=_d26.svgText,p=f(d,["svgText"]);if(_this41=_callSuper(this,x,[p]),_this41[T]=document.createElement("div"),v){_this41[T].innerHTML=v;var S=_this41[T].children[0];S?S.setAttribute("xmlns",u):(fetch(v).then(function(A){return A.text();}).then(function(A){_this41[T].innerHTML=A,(!_this41.observer||_this41.attributes.flexible)&&C(_assertThisInitialized(_this41));}),v=null);}if(!v){var _S8=document.createElementNS(u,"svg");_S8.setAttribute("xmlns",u),_this41[T].appendChild(_S8);}if(typeof MutationObserver=="function"){var _S9=new MutationObserver(function(A){C(_this41,!1);});_S9.observe(_this41[T],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this41.observer=_S9;}return _this41;}_inherits(x,_r$default21);return _createClass(x,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[T]?this[T].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref154){var d=_ref154.width,v=_ref154.height;_superPropGet(x,"setResolution",this,3)([{width:d,height:v}]),C(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(d){var v=_superPropGet(x,"dispatchPointerEvent",this,3)([d]);if(v&&this.attributes.passEvents&&typeof MouseEvent=="function"){var p=d.x,S=d.y;var _this$getOffsetPositi=this.getOffsetPosition(p,S),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),A=_this$getOffsetPositi2[0],R=_this$getOffsetPositi2[1];var D=d.originalEvent,U=this.attributes.anchor,M=this.clientSize;A=(A+U[0]*M[0])/2,R=(R+U[1]*M[1])/2;var W=d.type;if(W===D.type){var Y=null;if(D instanceof MouseEvent)Y=new MouseEvent(W,{screenX:A,screenY:R,clientX:A,clientY:R,bubbles:D.bubbles,button:D.button,buttons:D.buttons,cancelBubble:D.cancelBubble,cancelable:D.cancelable,currentTarget:D.currentTarget,fromElement:D.fromElement,relatedTarget:D.relatedTarget,returnValue:D.returnValue,srcElement:D.srcElement,target:D.target,toElement:D.toElement,// view: originalEvent.view,
358
+ which:D.witch});else if(D instanceof TouchEvent){var B=null;var N=D.changedTouches||[D];for(var G=0;G<N.length;G++){var J=N[G];if(d.identifier===J.identifier){B=J;break;}}if(B){var _G3=new Touch({identifier:B.identifier,target:B.target,clientX:A,clientY:R,screenX:A,screenY:R,pageX:A,pageY:R,radiusX:B.radiusX,radiusY:B.radiusY,rotationAngle:B.rotationAngle,force:B.force});Y=new TouchEvent(W,{cancelable:D.cancelable,bubbles:D.bubbles,composed:D.composed,touches:[_G3],targetTouches:[_G3],changedTouches:[_G3]});}}else Y=D;Y&&this.svg.dispatchEvent(Y);}}return v;}},{key:"getElementById",value:function getElementById(d){return Object(c.querySelector)("#".concat(d),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(d){return Object(c.querySelectorAll)(".".concat(d),this);}},{key:"getElementsByName",value:function getElementsByName(d){return Object(c.querySelectorAll)("[name=\"".concat(d,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(d){return Object(c.querySelectorAll)(d,this);}},{key:"querySelector",value:function querySelector(d){return Object(c.querySelector)(d,this);}},{key:"querySelectorAll",value:function querySelectorAll(d){return Object(c.querySelectorAll)(d,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(d,v,p){_superPropGet(x,"onPropertyChange",this,3)([d,v,p]),d==="flexible"&&C(this),this.attributes.flexible&&(d==="width"||d==="height"||d==="scale"||d==="transform")&&C(this);}}]);}(r["default"]);m(x,"Attr",n["default"]),s["default"].registerNode(x,"spritesvg");},/* 288 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_setAttributeDefault");var l=/*#__PURE__*/function(_r$default22){function l(h){var _this42;_classCallCheck(this,l);_this42=_callSuper(this,l,[h]),_this42[c]({passEvents:!1,flexible:!1});return _this42;}// readonly
359
+ _inherits(l,_r$default22);return _createClass(l,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(h){}// eslint-disable-line no-empty-function
360
+ },{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(h){return this[s]("passEvents",h);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(h){return this[s]("flexible",h);}}]);}(r["default"]);},/* 289 *//***/function(i,e,t){t.r(e);var r=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(h,m){var u=Object.keys(h);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(h);m&&(y=y.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable;})),u.push.apply(u,y);}return u;}function s(h){for(var m=1;m<arguments.length;m++){var u=arguments[m]!=null?arguments[m]:{};m%2?n(Object(u),!0).forEach(function(y){c(h,y,u[y]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(y){Object.defineProperty(h,y,Object.getOwnPropertyDescriptor(u,y));});}return h;}function c(h,m,u){return m in h?Object.defineProperty(h,m,{value:u,enumerable:!0,configurable:!0,writable:!0}):h[m]=u,h;}var l=Symbol("inited");var f=null;typeof Worker=="function"&&(f=/*#__PURE__*/function(_Worker){function f(h){var _this43;_classCallCheck(this,f);if(h.worker===!0&&(h.worker="./".concat(h.id,".worker.js")),_this43=_callSuper(this,f,[h.worker]),_this43.options=h,!h.canvas){var _this43$getResolution=_this43.getResolution(),m=_this43$getResolution.width,u=_this43$getResolution.height,y=r.ENV.createCanvas(m,u,{offscreen:!1});y.style&&(y.style.position="absolute"),y.dataset&&(y.dataset.layerId=h.id),h.canvas=y;}_this43.canvas=h.canvas;return _this43;}_inherits(f,_Worker);return _createClass(f,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref155){var h=_ref155.width,m=_ref155.height;if(this[l])this.postMessage({type:"resolution_change",width:h,height:m});else{this.canvas.width=h,this.canvas.height=m;var u=this.options,y=u.canvas.transferControlToOffscreen(),T=s({},u);delete T.container,T.canvas=y,this.postMessage({type:"create",options:T},[y]),this[l]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas7=this.canvas,h=_this$canvas7.width,m=_this$canvas7.height;return{width:h,height:m};}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(h,m){Object.defineProperty(this,"parent",{value:h,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:m,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(h){this.postMessage({type:"event",event:{cancelBubble:h.cancelBubble,bubbles:h.bubbles,detail:h.detail,identifier:h.identifier,layerX:h.layerX,layerY:h.layerY,originalX:h.originalX,originalY:h.originalY,type:h.type,x:h.x,y:h.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),e["default"]=f;},/* 290 *//***/function(i,e,t){t.r(e),function(r){t.d(e,"default",function(){return A;});var n=t(12),s=t(68),c=t(70),l=t(286),f=t(289),h=t(250),m=t(291),u=t(214),y=t(218),T=t(213);t(1).glMatrix.setMatrixArrayType(Array);var E=Symbol("enteredTargets");function C(R){return R.id=R.id||"_layer".concat(Math.random().toString(36).slice(2,12)),R.dataset||(R.dataset={}),R.dataset.layerId=R.id,R.connect=function(D,U){R.parent=D,Object.defineProperty(R,"zOrder",{value:U,writable:!1,configurable:!0});},R.disconnect=function(D){delete R.zOrder;},R.canvas=R,R.getResolution=function(){return{width:0,height:0};},R.setResolution=function(){return!1;},R.options={handleEvent:!1},R;}function x(R,D){var U=R.children;var M=null;for(var W=0;W<U.length;W++){var Y=U[W];if((D===Y||M!=null)&&(M=Y),M&&M!==D&&!M.offscreen)return M.canvas;}return null;}function I(R,D){var _R$renderOffset=_slicedToArray(R.renderOffset,2),U=_R$renderOffset[0],M=_R$renderOffset[1],_R$getResolution=R.getResolution(),W=_R$getResolution.width,Y=_R$getResolution.height,B=R.displayRatio;R.renderer.drawImage(D.canvas,-U/B,-M/B,W/B,Y/B);}var d={};function v(R){var D=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],U=R.container;U.addEventListener("mouseleave",function(M){var W=R[E];if(W.size){var Y=new u["default"]("mouseleave");Y.setOriginalEvent(M),_toConsumableArray(W).forEach(function(B){B.dispatchEvent(Y);}),R[E].clear();}},{passive:!0}),D.forEach(function(M){U.addEventListener(M,function(W){var _R$options=R.options,Y=_R$options.left,B=_R$options.top,N=_R$options.displayRatio,G=R.orderedChildren;Object(m["default"])(W,{offsetLeft:Y,offsetTop:B,displayRatio:N}).forEach(function(tt){var at=tt.identifier;if(tt.type==="touchmove"||tt.type==="touchend"){var K=d[at];K&&K.dispatchEvent(tt),tt.type==="touchend"&&delete d[at];}else{for(var _K=G.length-1;_K>=0;_K--){var Q=G[_K];if(Q.options.handleEvent!==!1){if(Q.dispatchPointerEvent(tt)&&tt.target!==Q)break;tt.cancelBubble=!1;}}if(tt.target===G[0])for(var _K2=G.length-1;_K2>=0;_K2--){var _Q=G[_K2];if(_Q.options.handleEvent!==!1){tt.target=_Q;break;}}}var ut=tt.target;if(tt.type==="touchstart"&&(d[at]=tt.target),tt.type==="mousemove"){var _K3=R[E];var _Q2;if(ut){var mt=ut.ancestors||[];_Q2=/* @__PURE__ */new Set([ut].concat(_toConsumableArray(mt)));}else _Q2=/* @__PURE__ */new Set();var ft=Object.entries(W);if(!_K3.has(ut)&&ut){var _mt2=new u["default"]("mouseenter");_mt2.setOriginalEvent(W),ft.forEach(function(_ref156){var _ref157=_slicedToArray(_ref156,2),ht=_ref157[0],Nt=_ref157[1];_mt2[ht]=Nt;}),_K3.add(ut),ut.dispatchEvent(_mt2);var wt=ut.ancestors;wt&&wt.forEach(function(ht){ht instanceof c["default"]&&!_K3.has(ht)&&(_K3.add(ht),ht.dispatchEvent(_mt2));});}var gt=new u["default"]("mouseleave");gt.setOriginalEvent(W),ft.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),mt=_ref159[0],wt=_ref159[1];gt[mt]=wt;}),_toConsumableArray(_K3).forEach(function(mt){_Q2.has(mt)||(_K3["delete"](mt),mt.dispatchEvent(gt));});}});},{passive:M!=="contextmenu"});});}function p(R,D){if(D&&D.style){var U=R.width,M=R.height,W=R.mode,Y=R.container;var B=Y.clientWidth,N=Y.clientHeight;U=U||B,M=M||N,W==="static"?(D.style.width="".concat(U,"px"),D.style.height="".concat(M,"px")):(D.style.top="0",D.style.left="0",D.style.width="".concat(B,"px"),D.style.height="".concat(N,"px"),D.style.transform="",D.style.webkitTransform="");}}var S=Symbol("offscreenLayerCount");var A=/*#__PURE__*/function(_h$default){/**
361
+ width
362
+ height
363
+ mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
364
+ */function A(){var _this44;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,A);if(_this44=_callSuper(this,A),!D.container)if(typeof n.ENV.Container=="function")D.container=new n.ENV.Container(D.width||300,D.height||150);else throw new Error("No container specified.");if(_this44.container=D.container,_this44.container.style&&(_this44.container.style.overflow||(_this44.container.style.overflow="hidden"),_this44.container.style.position||(_this44.container.style.position="relative")),_this44.options=D,D.displayRatio=D.displayRatio||1,D.mode=D.mode||"scale",D.left=0,D.top=0,D.autoResize=D.autoResize!==!1,D.autoResize){var U;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?U=globalThis:U=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:r,U.addEventListener){var M=_this44;U.addEventListener("resize",function W(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(M.container)?M.resize():U.removeEventListener("resize",W);});}}_this44[E]=/* @__PURE__ */new Set(),_this44.setResolution(D),v(_this44),_this44[S]=0;return _this44;}_inherits(A,_h$default);return _createClass(A,[{key:"hasOffscreenCanvas",get:function get(){return this[S]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(D){this.options.displayRatio!==D&&(this.options.displayRatio=D,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(D){this.options.height!==D&&(this.options.height=D,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(D){this.options.mode!==D&&(this.options.mode=D,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(D){this.options.width!==D&&(this.options.width=D,this.resize());}},{key:"appendChild",value:function appendChild(D){!(D instanceof l["default"])&&!(D instanceof f["default"])&&C(D);var U=_superPropGet(A,"appendChild",this,3)([D]),M=D.canvas;return D.offscreen?this[S]++:this.container.appendChild(M),p(this.options,M),D.setResolution(this.getResolution()),U;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this45=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(s.requestAnimationFrame)(function(){delete _this45._requestID,_this45.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(D,U){!(D instanceof l["default"])&&!(D instanceof f["default"])&&C(D);var M=_superPropGet(A,"insertBefore",this,3)([D,U]),W=D.canvas;if(!D.offscreen){var Y=x(this,D);this.container.insertBefore(W,Y);}return p(this.options,W),D.setResolution(this.getResolution()),M;}},{key:"layer",value:function layer(){var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var U=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};U=Object.assign({},this.options,U),U.id=D;var M=this.orderedChildren;for(var B=0;B<M.length;B++)if(M[B].id===D)return M[B];var W=U.worker;var Y;return W?Y=new f["default"](U):Y=new l["default"](U),this.appendChild(Y),Y;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _this46=this;var _len13,D,_key13,U,M,W,_loop2,Y,_args11=arguments;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:for(_len13=_args11.length,D=new Array(_len13),_key13=0;_key13<_len13;_key13++){D[_key13]=_args11[_key13];}U=[],M=[],W=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(Y){var B,N,G,J;return _regeneratorRuntime().wrap(function _loop2$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:B=D[Y];if(typeof B=="string")N=Object(y.loadTexture)(B);else if(Array.isArray(B))N=Object(y.loadFrames).apply(void 0,_toConsumableArray(B));else{G=B.id,J=B.src;N=Object(y.loadTexture)(J,G);}N instanceof Promise||(N=Promise.resolve(N)),M.push(N.then(function(G){U.push(G),W[Y]=G;var J=new u["default"]({type:"preload",detail:{current:G,loaded:U,resources:D}});_this46.dispatchEvent(J);}));case 3:case"end":return _context10.stop();}},_loop2);});Y=0;case 4:if(!(Y<D.length)){_context11.next=9;break;}return _context11.delegateYield(_loop2(Y),"t0",6);case 6:Y++;_context11.next=4;break;case 9:_context11.next=11;return Promise.all(M);case 11:return _context11.abrupt("return",W);case 12:case"end":return _context11.stop();}},_callee10);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(D){var U=_superPropGet(A,"removeChild",this,3)([D]);if(U){D._prepareRenderFinished&&D._prepareRenderFinished();var M=D.canvas;M&&M.remove&&M.remove(),D.offscreen&&this[S]--;}return U;}// for offscreen mode rendering
365
+ },{key:"render",value:function render(){var D=this.orderedChildren;var U=null;var M=[];for(var W=0;W<D.length;W++){var Y=D[W],B=M.length>0;if(Y instanceof l["default"]&&!Y.offscreen){if(!Y.autoRender)B&&(console.warn("Some offscreen canvas will not be rendered."),M.length=0);else if(U=Y,B){Y.renderer.clear();for(var N=0;N<M.length;N++){var G=M[N];G.render(),I(Y,G);}M.length=0,Y.render({clear:!1});}else Y.prepareRender&&Y.render();}else Y.offscreen?U?(Y.prepareRender&&Y.render(),I(U,Y)):M.push(Y):Y instanceof f["default"]&&B&&(console.warn("Some offscreen canvas will not be rendered."),M.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(D,U){var M=_superPropGet(A,"replaceChild",this,3)([D,U]);U.canvas.remove&&U.canvas.remove(),U.offscreen&&this[S]--;var W=D.canvas;if(!D.offscreen){var Y=x(this,D);this.container.insertBefore(W,Y);}return p(this.options,W),D.setResolution(this.getResolution()),M;}},{key:"resize",value:function resize(){var D=this.options;this.children.forEach(function(U){p(D,U.canvas);}),this.setResolution(D),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _D4,_U10;var _ref160=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},D=_ref160.width,U=_ref160.height;var M=this.container,W=M.clientWidth,Y=M.clientHeight;(D==null||U==null)&&(D=(_D4=D)!==null&&_D4!==void 0?_D4:W,U=(_U10=U)!==null&&_U10!==void 0?_U10:Y);var _this$options=this.options,B=_this$options.mode,N=_this$options.displayRatio;if(D*=N,U*=N,this.options.left=0,this.options.top=0,B==="stickyHeight"||B==="stickyLeft"||B==="stickyRight"){var G=D;D=W*U/Y,B==="stickyHeight"&&(this.options.left=0.5*(D-G)),B==="stickyRight"&&(this.options.left=D-G);}else if(B==="stickyWidth"||B==="stickyTop"||B==="stickyBottom"){var _G4=U;U=Y*D/W,B==="stickyWidth"&&(this.options.top=0.5*(U-_G4)),B==="stickyBottom"&&(this.options.top=U-_G4);}_superPropGet(A,"setResolution",this,3)([{width:D,height:U}]);}},{key:"snapshot",value:function snapshot(){var _ref161=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref161$offscreen=_ref161.offscreen,D=_ref161$offscreen===void 0?!1:_ref161$offscreen,U=_ref161.layers;var M=D?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),W=_this$getResolution9.width,Y=_this$getResolution9.height;this[M]=this[M]||n.ENV.createCanvas(W,Y,{offscreen:D});var B=this[M].getContext("2d");U=U||this.orderedChildren,this[M].width=W,this[M].height=Y;for(var N=0;N<U.length;N++){var G=U[N];if(!G.options.ignoreSnapshot){G.render&&G.render();var J=G.canvas;J&&J!==G&&B.drawImage(J,0,0,W,Y);}}return this[M];}}]);}(h["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(A.prototype.layer3d=function(R){var _this47=this;var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var U=D.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(M,W){var Y=document.createElement("script");Y.async=!1,Y.src=U,Y.onload=function(){try{M(_this47.layer3d(R,D));}catch(B){W(B);}},document.documentElement.appendChild(Y);});}),T["default"].registerNode(A,"scene");}.call(this,t(22));},/* 291 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(s){var _ref162=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref162$offsetTop=_ref162.offsetTop,c=_ref162$offsetTop===void 0?0:_ref162$offsetTop,_ref162$offsetLeft=_ref162.offsetLeft,l=_ref162$offsetLeft===void 0?0:_ref162$offsetLeft,_ref162$displayRatio=_ref162.displayRatio,f=_ref162$displayRatio===void 0?1:_ref162$displayRatio;var h,m;var u=[],_s$target$getBounding=s.target.getBoundingClientRect(),y=_s$target$getBounding.left,T=_s$target$getBounding.top,E=_s$target$getBounding.width,C=_s$target$getBounding.height,x=s.target.width,I=s.target.height,d=s.changedTouches||[s];for(var p=0;p<d.length;p++){var S=d[p],A=S.identifier,R=S.clientX,D=S.clientY;R!=null&&D!=null&&u.push({x:Math.round((R|0)-y),y:Math.round((D|0)-T),identifier:A});}u.length<=0&&u.push({x:h,y:m});var v=[];return u.forEach(function(p){p.x!=null&&p.y!=null&&(h=(p.x*x/E-l)/f,m=(p.y*I/C-c)/f);var S=new r["default"](s);Object.defineProperties(S,{layerX:{value:h,configurable:!0},layerY:{value:m,configurable:!0},originalX:{value:p.x},originalY:{value:p.y},x:{value:h,configurable:!0},y:{value:m,configurable:!0},identifier:{value:p.identifier}}),v.push(S);}),v;}}/******/]);be.version;be.Arc;be.Block;be.Cloud;be.Color;var qy=be.Ellipse;be.Gradient;var mr=be.Group,_y=be.Label,el=be.Layer;be.LayerWorker;be.Node;be.Parallel;var Mn=be.Path,dn=be.Polyline,zc=be.Rect;be.Regular;be.Ring;var Uu=be.Scene,Yu=be.Sprite;be.SpriteSvg;be.Star;be.Triangle;be.helpers;be.createElement;be.isSpriteNode;be.registerNode;be.requestAnimationFrame;be.cancelAnimationFrame;be.ENV;var we=/* @__PURE__ */function(i){return i.Normal="Normal",i.Stroke="Stroke",i.Dotted="Dotted",i.LongDotted="LongDotted",i;}(we||{}),he=/* @__PURE__ */function(i){return i.None="None",i.ShowFloatBar="ShowFloatBar",i.ZIndexFloatBar="ZIndexFloatBar",i.DeleteNode="DeleteNode",i.CopyNode="CopyNode",i.ZIndexActive="ZIndexActive",i.ZIndexNode="ZIndexNode",i.RotateNode="RotateNode",i.SetColorNode="SetColorNode",i.TranslateNode="TranslateNode",i.ScaleNode="ScaleNode",i.OriginalEvent="OriginalEvent",i.CreateScene="CreateScene",i.ActiveCursor="ActiveCursor",i.MoveCursor="MoveCursor",i.CommandEditor="CommandEditor",i.SetEditorData="SetEditorData",i.SetFontStyle="SetFontStyle",i.SetPoint="SetPoint",i.SetLock="SetLock",i.SetShapeOpt="SetShapeOpt",i.CameraChange="CameraChange",i.ActiveMethod="ActiveMethod",i.HidFloatBarBtn="HidFloatBarBtn",i;}(he||{}),Tt=/* @__PURE__ */function(i){return i[i.Pencil=1]="Pencil",i[i.Eraser=2]="Eraser",i[i.PencilEraser=3]="PencilEraser",i[i.BitMapEraser=4]="BitMapEraser",i[i.Selector=5]="Selector",i[i.Clicker=6]="Clicker",i[i.Arrow=7]="Arrow",i[i.Hand=8]="Hand",i[i.LaserPen=9]="LaserPen",i[i.Text=10]="Text",i[i.Straight=11]="Straight",i[i.Rectangle=12]="Rectangle",i[i.Ellipse=13]="Ellipse",i[i.Star=14]="Star",i[i.Triangle=15]="Triangle",i[i.Rhombus=16]="Rhombus",i[i.Polygon=17]="Polygon",i[i.SpeechBalloon=18]="SpeechBalloon",i[i.Image=19]="Image",i;}(Tt||{}),Vt=/* @__PURE__ */function(i){return i[i.Local=1]="Local",i[i.Service=2]="Service",i[i.Worker=3]="Worker",i;}(Vt||{}),te=/* @__PURE__ */function(i){return i[i.Pending=0]="Pending",i[i.Start=1]="Start",i[i.Doing=2]="Doing",i[i.Done=3]="Done",i[i.Unwritable=4]="Unwritable",i;}(te||{}),xt=/* @__PURE__ */function(i){return i[i.None=0]="None",i[i.Init=1]="Init",i[i.UpdateCamera=2]="UpdateCamera",i[i.UpdateTools=3]="UpdateTools",i[i.CreateWork=4]="CreateWork",i[i.DrawWork=5]="DrawWork",i[i.FullWork=6]="FullWork",i[i.UpdateNode=7]="UpdateNode",i[i.RemoveNode=8]="RemoveNode",i[i.Clear=9]="Clear",i[i.Select=10]="Select",i[i.Destroy=11]="Destroy",i[i.Snapshot=12]="Snapshot",i[i.BoundingBox=13]="BoundingBox",i[i.Cursor=14]="Cursor",i[i.TextUpdate=15]="TextUpdate",i[i.GetTextActive=16]="GetTextActive",i[i.TasksQueue=17]="TasksQueue",i[i.CursorHover=18]="CursorHover",i[i.CursorBlur=19]="CursorBlur",i[i.Console=20]="Console",i[i.GetImageBitMap=23]="GetImageBitMap",i[i.AuthWriter=24]="AuthWriter",i[i.AuthReader=25]="AuthReader",i[i.AuthClear=26]="AuthClear",i[i.AuthPage=27]="AuthPage",i[i.GetVNodeInfo=28]="GetVNodeInfo",i[i.UpdateDpr=29]="UpdateDpr",i[i.SetFontFace=30]="SetFontFace",i;}(xt||{}),Ut=/* @__PURE__ */function(i){return i[i.None=0]="None",i[i.Bg=1]="Bg",i[i.ServiceFloat=2]="ServiceFloat",i[i.Float=3]="Float",i[i.TopFloat=4]="TopFloat",i;}(Ut||{}),Ae=/* @__PURE__ */function(i){return i[i.none=1]="none",i[i.all=2]="all",i[i.both=3]="both",i[i.proportional=4]="proportional",i;}(Ae||{}),Tr=/* @__PURE__ */function(i){return i[i.inside=0]="inside",i[i.outside=1]="outside",i[i.intersect=2]="intersect",i;}(Tr||{}),cl=/* @__PURE__ */function(i){return i.Image="image",i.Iconify="iconify",i;}(cl||{});var kr=/*#__PURE__*/function(){function kr(){_classCallCheck(this,kr);dt(this,"localWork");dt(this,"serviceWork");dt(this,"threadEngine");}return _createClass(kr,[{key:"registerForWorker",value:function registerForWorker(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this;}}]);}();var t1=/*#__PURE__*/function(_kr){function t1(){var _this48;_classCallCheck(this,t1);_this48=_callSuper(this,t1,arguments);dt(_this48,"emitEventType",he.CopyNode);return _this48;}_inherits(t1,_kr);return _createClass(t1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.FullWork&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(t){var n,r;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:r=t.workId;_context12.t0=r;if(!_context12.t0){_context12.next=5;break;}_context12.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 5:case"end":return _context12.stop();}},_callee11,this);}));function consumeForLocalWorker(_x24){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(kr);var mi="++",Me="selector",e1="all";var r1=/*#__PURE__*/function(_kr2){function r1(){var _this49;_classCallCheck(this,r1);_this49=_callSuper(this,r1,arguments);dt(_this49,"emitEventType",he.SetColorNode);return _this49;}_inherits(r1,_kr2);return _createClass(r1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(t){var h,r,n,s,c,l,f;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker;_context13.t0=r===Me&&n;if(!_context13.t0){_context13.next=5;break;}_context13.next=5;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,textUpdateForWoker:f,callback:this.updateSelectorCallback});case 5:case"end":return _context13.stop();}},_callee12,this);}));function consumeForLocalWorker(_x25){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=r.textUpdateForWoker,h=n.render||[],m=n.sp||[];if(c){var _iterator3=_createForOfIteratorHelper(s.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),u=_step3$value[0],y=_step3$value[1];f&&y.toolsType===Tt.Text?m.push(_objectSpread(_objectSpread({},y),{},{workId:u,type:xt.TextUpdate,dataType:Vt.Local,willSyncService:!0})):m.push(_objectSpread(_objectSpread({},y),{},{workId:u,type:xt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:h,sp:m};}}]);}(kr);var n1=/*#__PURE__*/function(_kr3){function n1(){var _this50;_classCallCheck(this,n1);_this50=_callSuper(this,n1,arguments);dt(_this50,"emitEventType",he.ZIndexNode);return _this50;}_inherits(n1,_kr3);return _createClass(n1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(t){var f,r,n,s,c,l;return _regeneratorRuntime().wrap(function _callee13$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData;_context14.t0=r===Me&&n;if(!_context14.t0){_context14.next=5;break;}_context14.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback});case 5:case"end":return _context14.stop();}},_callee13,this);}));function consumeForLocalWorker(_x26){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=n.render||[],h=n.sp||[];if(c&&h){var _iterator4=_createForOfIteratorHelper(s.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),m=_step4$value[0],u=_step4$value[1];h.push(_objectSpread(_objectSpread({},u),{},{workId:m,type:xt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:f,sp:h};}}]);}(kr);var i1=/*#__PURE__*/function(_kr4){function i1(){var _this51;_classCallCheck(this,i1);_this51=_callSuper(this,i1,arguments);dt(_this51,"emitEventType",he.TranslateNode);return _this51;}_inherits(i1,_kr4);return _createClass(i1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(t){var u,y,r,n,s,c,l,f,h,m;return _regeneratorRuntime().wrap(function _callee14$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker,h=t.emitEventType,m=t.smoothSync;_context15.t0=r===Me&&n;if(!_context15.t0){_context15.next=9;break;}if(!(n.workState===te.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==te.Done)){_context15.next=8;break;}_context15.next=6;return(u=this.localWork)==null?void 0:u.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,isSync:!0,textUpdateForWoker:f,emitEventType:h,callback:this.updateSelectorCallback,smoothSync:m});case 6:_context15.next=9;break;case 8:n.workState===te.Done&&((y=this.localWork)==null||y.vNodes.deleteLastTarget());case 9:case"end":return _context15.stop();}},_callee14,this);}));function consumeForLocalWorker(_x27){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=t.smoothSync,h=r.willSyncService,m=r.isSync,u=r.updateSelectorOpt,y=r.textUpdateForWoker,T=u.workState,E=n.render||[],C=n.sp||[];if(T===te.Start)return{sp:[],render:[]};var x=l==null?void 0:l.selectRect;if(h){C.push({type:xt.Select,selectIds:c.selectIds,selectRect:x,willSyncService:T===te.Done?!0:f,isSync:!0,points:T===te.Done&&c.getChildrenPoints()||void 0,textOpt:c.textOpt});var _I29={useAnimation:u.useAnimation||!1};u.uid&&(_I29.uid=u.uid);var _iterator5=_createForOfIteratorHelper(s.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),_d27=_step5$value[0],v=_step5$value[1];y&&v.toolsType===Tt.Text?C.push(_objectSpread(_objectSpread({},v),{},{workId:_d27,type:xt.TextUpdate,dataType:Vt.Local,willSyncService:T===te.Done?!0:f,updateNodeOpt:_I29})):(f||T===te.Done)&&C.push(_objectSpread(_objectSpread({},v),{},{workId:_d27,type:xt.UpdateNode,updateNodeOpt:_I29,isSync:m}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:E,sp:C};}}]);}(kr);var s1=/*#__PURE__*/function(_kr5){function s1(){var _this52;_classCallCheck(this,s1);_this52=_callSuper(this,s1,arguments);dt(_this52,"emitEventType",he.DeleteNode);return _this52;}_inherits(s1,_kr5);return _createClass(s1,[{key:"consume",value:function consume(){return!1;}}]);}(kr);var o1=/*#__PURE__*/function(_kr6){function o1(){var _this53;_classCallCheck(this,o1);_this53=_callSuper(this,o1,arguments);dt(_this53,"emitEventType",he.ScaleNode);return _this53;}_inherits(o1,_kr6);return _createClass(o1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(t){var f,r,n,s,c,l;return _regeneratorRuntime().wrap(function _callee15$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willSyncService,c=t.willSerializeData,l=t.smoothSync;_context16.t0=r===Me&&n;if(!_context16.t0){_context16.next=5;break;}_context16.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willSyncService:s,willSerializeData:c,isSync:!0,callback:this.updateSelectorCallback.bind(this),smoothSync:l});case 5:case"end":return _context16.stop();}},_callee15,this);}));function consumeForLocalWorker(_x28){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,c=t.res,l=t.newServiceStore,f=t.smoothSync,h=r.updateSelectorOpt,m=r.willSyncService,u=h.workState,y=n.render||[],T=n.sp||[],E=c==null?void 0:c.selectRect;if(u===te.Start)return{sp:[],render:[]};if(m){T.push({type:xt.Select,selectIds:s.selectIds,selectRect:E,willSyncService:u===te.Done?!0:f,isSync:!0,points:u===te.Done&&s.getChildrenPoints()||void 0,textOpt:s.textOpt});var C={useAnimation:h.useAnimation||!1};h.uid&&(C.uid=h.uid);var _iterator6=_createForOfIteratorHelper(l.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),x=_step6$value[0],_I30=_step6$value[1];_I30.toolsType===Tt.Text?T.push(_objectSpread(_objectSpread({},_I30),{},{workId:x,type:xt.TextUpdate,dataType:Vt.Local,willSyncService:u===te.Done?!0:f,updateNodeOpt:C})):(f||u===te.Done)&&T.push(_objectSpread(_objectSpread({},_I30),{},{workId:x,type:xt.UpdateNode,updateNodeOpt:C,isSync:!0}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:T};}}]);}(kr);var a1=/*#__PURE__*/function(_kr7){function a1(){var _this54;_classCallCheck(this,a1);_this54=_callSuper(this,a1,arguments);dt(_this54,"emitEventType",he.RotateNode);return _this54;}_inherits(a1,_kr7);return _createClass(a1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(t){var m,r,n,s,c,l,f,h;return _regeneratorRuntime().wrap(function _callee16$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.emitEventType,h=t.smoothSync;_context17.t0=r===Me&&n;if(!_context17.t0){_context17.next=5;break;}_context17.next=5;return(m=this.localWork)==null?void 0:m.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,emitEventType:f,isSync:!0,callback:this.updateSelectorCallback,smoothSync:h});case 5:case"end":return _context17.stop();}},_callee16,this);}));function consumeForLocalWorker(_x29){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,c=t.res,l=t.newServiceStore,f=t.smoothSync,h=r.updateSelectorOpt,m=r.willSyncService,u=r.willSerializeData,y=r.isSync,T=h.workState,E=n.render||[],C=n.sp||[],x=c==null?void 0:c.selectRect;if(m){u&&T===te.Done&&C.push({type:xt.Select,selectIds:s.selectIds,selectRect:x,willSyncService:!0,isSync:y,points:s.getChildrenPoints(),textOpt:s.textOpt,selectorColor:s.selectorColor,strokeColor:s.strokeColor,fillColor:s.fillColor,canTextEdit:s.canTextEdit,canRotate:s.canRotate,scaleType:s.scaleType,opt:s.getWorkOptions()||void 0,canLock:s.canLock,isLocked:s.isLocked,toolsTypes:s.toolsTypes,shapeOpt:s.shapeOpt,thickness:s.thickness,useStroke:s.useStroke,strokeType:s.strokeType});var _I31={useAnimation:h.useAnimation||!1};if(h.uid&&(_I31.uid=h.uid),f||T===te.Done){var _iterator7=_createForOfIteratorHelper(l.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),_d28=_step7$value[0],v=_step7$value[1];C.push(_objectSpread(_objectSpread({},v),{},{workId:_d28,type:xt.UpdateNode,updateNodeOpt:_I31,isSync:y}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}}return{render:E,sp:C};}}]);}(kr);var l1=/*#__PURE__*/function(_kr8){function l1(){var _this55;_classCallCheck(this,l1);_this55=_callSuper(this,l1,arguments);dt(_this55,"emitEventType",he.SetFontStyle);return _this55;}_inherits(l1,_kr8);return _createClass(l1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(t){var h,r,n,s,c,l,f;return _regeneratorRuntime().wrap(function _callee17$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker;_context18.t0=r===Me&&n;if(!_context18.t0){_context18.next=5;break;}_context18.next=5;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,textUpdateForWoker:f,callback:this.updateSelectorCallback});case 5:case"end":return _context18.stop();}},_callee17,this);}));function consumeForLocalWorker(_x30){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,h=r.isSync,m=r.updateSelectorOpt,u=r.textUpdateForWoker,y=n.render||[],T=n.sp||[],E=l==null?void 0:l.selectRect;if(f&&T){m.fontSize&&T.push({type:xt.Select,selectIds:c.selectIds,selectRect:E,willSyncService:f,isSync:h,points:c.getChildrenPoints()});var _iterator8=_createForOfIteratorHelper(s.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),C=_step8$value[0],x=_step8$value[1];u&&x.toolsType===Tt.Text?T.push(_objectSpread(_objectSpread({},x),{},{workId:C,type:xt.TextUpdate,dataType:Vt.Local,willSyncService:!0})):T.push(_objectSpread(_objectSpread({},x),{},{workId:C,type:xt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}return{render:y,sp:T};}}]);}(kr);var f1=/*#__PURE__*/function(_kr9){function f1(){var _this56;_classCallCheck(this,f1);_this56=_callSuper(this,f1,arguments);dt(_this56,"emitEventType",he.SetPoint);return _this56;}_inherits(f1,_kr9);return _createClass(f1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(t){var h,r,n,s,c,l,f;return _regeneratorRuntime().wrap(function _callee18$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker;_context19.t0=r===Me&&n;if(!_context19.t0){_context19.next=5;break;}_context19.next=5;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,emitEventType:this.emitEventType,willSerializeData:l,isSync:!0,textUpdateForWoker:f,callback:this.updateSelectorCallback});case 5:case"end":return _context19.stop();}},_callee18,this);}));function consumeForLocalWorker(_x31){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,h=r.isSync,m=n.render||[],u=n.sp||[],y=l==null?void 0:l.selectRect;if(f&&u){var _iterator9=_createForOfIteratorHelper(s.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),T=_step9$value[0],E=_step9$value[1];u.push(_objectSpread(_objectSpread({},E),{},{workId:T,type:xt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}u.push({type:xt.Select,selectIds:c.selectIds,selectRect:y,willSyncService:f,isSync:h,points:c.getChildrenPoints()});}return{render:m,sp:u};}}]);}(kr);var c1=/*#__PURE__*/function(_kr10){function c1(){var _this57;_classCallCheck(this,c1);_this57=_callSuper(this,c1,arguments);dt(_this57,"emitEventType",he.SetLock);return _this57;}_inherits(c1,_kr10);return _createClass(c1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(t){var f,r,n,s,c,l;return _regeneratorRuntime().wrap(function _callee19$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData;_context20.t0=r===Me&&n;if(!_context20.t0){_context20.next=5;break;}_context20.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback});case 5:case"end":return _context20.stop();}},_callee19,this);}));function consumeForLocalWorker(_x32){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,h=r.isSync,m=r.updateSelectorOpt,u=n.render||[],y=n.sp||[],T=l==null?void 0:l.selectRect;if(f&&y){var _iterator10=_createForOfIteratorHelper(s.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),E=_step10$value[0],C=_step10$value[1];y.push(_objectSpread(_objectSpread({},C),{},{workId:E,type:xt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}y.push({isLocked:m.isLocked,selectorColor:c.selectorColor,scaleType:c.scaleType,canRotate:c.canRotate,type:xt.Select,selectIds:c.selectIds,selectRect:T,willSyncService:f,isSync:h});}return{render:u,sp:y};}}]);}(kr);var u1=/*#__PURE__*/function(_kr11){function u1(){var _this58;_classCallCheck(this,u1);_this58=_callSuper(this,u1,arguments);dt(_this58,"emitEventType",he.SetShapeOpt);return _this58;}_inherits(u1,_kr11);return _createClass(u1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===xt.UpdateNode&&n===Vt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(t){var f,r,n,s,c,l;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData;_context21.t0=r===Me&&n;if(!_context21.t0){_context21.next=5;break;}_context21.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback});case 5:case"end":return _context21.stop();}},_callee20,this);}));function consumeForLocalWorker(_x33){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=n.render||[],h=n.sp||[];if(c&&h){var _iterator11=_createForOfIteratorHelper(s.entries()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var _step11$value=_slicedToArray(_step11.value,2),m=_step11$value[0],u=_step11$value[1];h.push(_objectSpread(_objectSpread({},u),{},{workId:m,type:xt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}return{render:f,sp:h};}}]);}(kr);var Xu=/*#__PURE__*/function(){function Xu(e){var _this59=this;_classCallCheck(this,Xu);dt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(e.map(function(t){return[t,_this59.build(t)];}));}return _createClass(Xu,[{key:"build",value:function build(e){switch(e){case he.TranslateNode:return new i1();case he.ZIndexNode:return new n1();case he.CopyNode:return new t1();case he.SetColorNode:return new r1();case he.DeleteNode:return new s1();case he.ScaleNode:return new o1();case he.RotateNode:return new a1();case he.SetFontStyle:return new l1();case he.SetPoint:return new f1();case he.SetLock:return new c1();case he.SetShapeOpt:return new u1();}}},{key:"registerForWorker",value:function registerForWorker(e){return this.builders.forEach(function(t){t&&t.registerForWorker(e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(e){var _iterator12=_createForOfIteratorHelper(this.builders.values()),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var t=_step12.value;if(t!=null&&t.consume(e))return!0;}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return!1;}}]);}();var h1={linear:function linear(i){return i;},easeInQuad:function easeInQuad(i){return i*i;},easeOutQuad:function easeOutQuad(i){return i*(2-i);},easeInOutQuad:function easeInOutQuad(i){return i<0.5?2*i*i:-1+(4-2*i)*i;},easeInCubic:function easeInCubic(i){return i*i*i;},easeOutCubic:function easeOutCubic(i){return--i*i*i+1;},easeInOutCubic:function easeInOutCubic(i){return i<0.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1;},easeInQuart:function easeInQuart(i){return i*i*i*i;},easeOutQuart:function easeOutQuart(i){return 1- --i*i*i*i;},easeInOutQuart:function easeInOutQuart(i){return i<0.5?8*i*i*i*i:1-8*--i*i*i*i;},easeInQuint:function easeInQuint(i){return i*i*i*i*i;},easeOutQuint:function easeOutQuint(i){return 1+--i*i*i*i*i;},easeInOutQuint:function easeInOutQuint(i){return i<0.5?16*i*i*i*i*i:1+16*--i*i*i*i*i;},easeInSine:function easeInSine(i){return 1-Math.cos(i*Math.PI/2);},easeOutSine:function easeOutSine(i){return Math.sin(i*Math.PI/2);},easeInOutSine:function easeInOutSine(i){return-(Math.cos(Math.PI*i)-1)/2;},easeInExpo:function easeInExpo(i){return i<=0?0:Math.pow(2,10*i-10);},easeOutExpo:function easeOutExpo(i){return i>=1?1:1-Math.pow(2,-10*i);},easeInOutExpo:function easeInOutExpo(i){return i<=0?0:i>=1?1:i<0.5?Math.pow(2,20*i-10)/2:(2-Math.pow(2,-20*i+10))/2;}};var pt=/*#__PURE__*/function(){function pt(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,pt);this.x=e,this.y=t,this.z=r;}return _createClass(pt,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(e){return this.z=e,this;}},{key:"setXY",value:function setXY(){var e=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=e,this.y=t,this;}},{key:"set",value:function set(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=e,this.y=t,this.z=r,this;}},{key:"setTo",value:function setTo(_ref163){var _ref163$x=_ref163.x,e=_ref163$x===void 0?0:_ref163$x,_ref163$y=_ref163.y,t=_ref163$y===void 0?0:_ref163$y,_ref163$z=_ref163.z,r=_ref163$z===void 0?1:_ref163$z;return this.x=e,this.y=t,this.z=r,this;}},{key:"rot",value:function rot(e){if(e===0)return this;var t=this.x,r=this.y,n=Math.sin(e),s=Math.cos(e);return this.x=t*s-r*n,this.y=t*n+r*s,this;}},{key:"rotWith",value:function rotWith(e,t){if(t===0)return this;var r=this.x-e.x,n=this.y-e.y,s=Math.sin(t),c=Math.cos(t);return this.x=e.x+(r*c-n*s),this.y=e.y+(r*s+n*c),this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z;return new pt(e,t,r);}},{key:"sub",value:function sub(e){return this.x-=e.x,this.y-=e.y,this;}},{key:"subXY",value:function subXY(e,t){return this.x-=e,this.y-=t,this;}},{key:"subScalar",value:function subScalar(e){return this.x-=e,this.y-=e,this;}},{key:"add",value:function add(e){return this.x+=e.x,this.y+=e.y,this;}},{key:"addXY",value:function addXY(e,t){return this.x+=e,this.y+=t,this;}},{key:"addScalar",value:function addScalar(e){return this.x+=e,this.y+=e,this;}},{key:"clamp",value:function clamp(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,e),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(e){return this.x/=e,this.y/=e,this;}},{key:"divV",value:function divV(e){return this.x/=e.x,this.y/=e.y,this;}},{key:"mul",value:function mul(e){return this.x*=e,this.y*=e,this;}},{key:"mulV",value:function mulV(e){return this.x*=e.x,this.y*=e.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(e,t){var r=pt.Tan(e,this);return this.add(r.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(e){return this.x=this.y*e.z-this.z*e.y,this.y=this.z*e.x-this.x*e.z,this;}},{key:"dpr",value:function dpr(e){return pt.Dpr(this,e);}},{key:"cpr",value:function cpr(e){return pt.Cpr(this,e);}},{key:"len2",value:function len2(){return pt.Len2(this);}},{key:"len",value:function len(){return pt.Len(this);}},{key:"pry",value:function pry(e){return pt.Pry(this,e);}},{key:"per",value:function per(){var e=this.x,t=this.y;return this.x=t,this.y=-e,this;}},{key:"uni",value:function uni(){return pt.Uni(this);}},{key:"tan",value:function tan(e){return pt.Tan(this,e);}},{key:"dist",value:function dist(e){return pt.Dist(this,e);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(e,t){return pt.DistanceToLineSegment(e,t,this);}},{key:"slope",value:function slope(e){return pt.Slope(this,e);}},{key:"snapToGrid",value:function snapToGrid(e){return this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this;}},{key:"angle",value:function angle(e){return pt.Angle(this,e);}},{key:"toAngle",value:function toAngle(){return pt.ToAngle(this);}},{key:"lrp",value:function lrp(e,t){return this.x=this.x+(e.x-this.x)*t,this.y=this.y+(e.y-this.y)*t,this;}},{key:"equals",value:function equals(e,t){return pt.Equals(this,e,t);}},{key:"equalsXY",value:function equalsXY(e,t){return pt.EqualsXY(this,e,t);}},{key:"norm",value:function norm(){var e=this.len();return this.x=e===0?0:this.x/e,this.y=e===0?0:this.y/e,this;}},{key:"toFixed",value:function toFixed(){return pt.ToFixed(this);}},{key:"toString",value:function toString(){return pt.ToString(pt.ToFixed(this));}},{key:"toJson",value:function toJson(){return pt.ToJson(this);}},{key:"toArray",value:function toArray(){return pt.ToArray(this);}}],[{key:"Add",value:function Add(e,t){return new pt(e.x+t.x,e.y+t.y);}},{key:"AddXY",value:function AddXY(e,t,r){return new pt(e.x+t,e.y+r);}},{key:"Sub",value:function Sub(e,t){return new pt(e.x-t.x,e.y-t.y);}},{key:"SubXY",value:function SubXY(e,t,r){return new pt(e.x-t,e.y-r);}},{key:"AddScalar",value:function AddScalar(e,t){return new pt(e.x+t,e.y+t);}},{key:"SubScalar",value:function SubScalar(e,t){return new pt(e.x-t,e.y-t);}},{key:"Div",value:function Div(e,t){return new pt(e.x/t,e.y/t);}},{key:"Mul",value:function Mul(e,t){return new pt(e.x*t,e.y*t);}},{key:"DivV",value:function DivV(e,t){return new pt(e.x/t.x,e.y/t.y);}},{key:"MulV",value:function MulV(e,t){return new pt(e.x*t.x,e.y*t.y);}},{key:"Neg",value:function Neg(e){return new pt(-e.x,-e.y);}},{key:"Per",value:function Per(e){return new pt(e.y,-e.x);}},{key:"Dist2",value:function Dist2(e,t){return pt.Sub(e,t).len2();}},{key:"Abs",value:function Abs(e){return new pt(Math.abs(e.x),Math.abs(e.y));}},{key:"Dist",value:function Dist(e,t){return Math.hypot(e.y-t.y,e.x-t.x);}},{key:"Dpr",value:function Dpr(e,t){return e.x*t.x+e.y*t.y;}},{key:"Cross",value:function Cross(e,t){return new pt(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z// A.z = A.x * V.y - A.y * V.x
366
+ );}},{key:"Cpr",value:function Cpr(e,t){return e.x*t.y-t.x*e.y;}},{key:"Len2",value:function Len2(e){return e.x*e.x+e.y*e.y;}},{key:"Len",value:function Len(e){return Math.hypot(e.x,e.y);}},{key:"Pry",value:function Pry(e,t){return pt.Dpr(e,t)/pt.Len(t);}},{key:"Uni",value:function Uni(e){return pt.Div(e,pt.Len(e));}},{key:"Tan",value:function Tan(e,t){return pt.Uni(pt.Sub(e,t));}},{key:"Min",value:function Min(e,t){return new pt(Math.min(e.x,t.x),Math.min(e.y,t.y));}},{key:"Max",value:function Max(e,t){return new pt(Math.max(e.x,t.x),Math.max(e.y,t.y));}},{key:"From",value:function From(e){return new pt().add(e);}},{key:"FromArray",value:function FromArray(e){return new pt(e[0],e[1]);}},{key:"Rot",value:function Rot(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=Math.sin(t),n=Math.cos(t);return new pt(e.x*n-e.y*r,e.x*r+e.y*n);}},{key:"RotWith",value:function RotWith(e,t,r){var n=e.x-t.x,s=e.y-t.y,c=Math.sin(r),l=Math.cos(r);return new pt(t.x+(n*l-s*c),t.y+(n*c+s*l));}/**
367
+ * Get the nearest point on a line with a known unit vector that passes through point A
368
+ *
369
+ * ```ts
370
+ * Vec.nearestPointOnLineThroughPoint(A, u, Point)
371
+ * ```
372
+ *
373
+ * @param A - Any point on the line
374
+ * @param u - The unit vector for the line.
375
+ * @param P - A point not on the line to test.
376
+ */},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(e,t,r){return pt.Mul(t,pt.Sub(r,e).pry(t)).add(e);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var s=pt.Tan(t,e),c=pt.Add(e,pt.Mul(s,pt.Sub(r,e).pry(s)));if(n){if(c.x<Math.min(e.x,t.x))return pt.Cast(e.x<t.x?e:t);if(c.x>Math.max(e.x,t.x))return pt.Cast(e.x>t.x?e:t);if(c.y<Math.min(e.y,t.y))return pt.Cast(e.y<t.y?e:t);if(c.y>Math.max(e.y,t.y))return pt.Cast(e.y>t.y?e:t);}return c;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(e,t,r){return pt.Dist(r,pt.NearestPointOnLineThroughPoint(e,t,r));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return pt.Dist(r,pt.NearestPointOnLineSegment(e,t,r,n));}},{key:"Snap",value:function Snap(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new pt(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}},{key:"Cast",value:function Cast(e){return e instanceof pt?e:pt.From(e);}},{key:"Slope",value:function Slope(e,t){return e.x===t.y?NaN:(e.y-t.y)/(e.x-t.x);}},{key:"Angle",value:function Angle(e,t){return Math.atan2(t.y-e.y,t.x-e.x);}},{key:"Lrp",value:function Lrp(e,t,r){return pt.Sub(t,e).mul(r).add(e);}},{key:"Med",value:function Med(e,t){return new pt((e.x+t.x)/2,(e.y+t.y)/2);}},{key:"Equals",value:function Equals(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(e.x-t.x)<r&&Math.abs(e.y-t.y)<r;}},{key:"EqualsXY",value:function EqualsXY(e,t,r){return e.x===t&&e.y===r;}},{key:"EqualsXYZ",value:function EqualsXYZ(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return pt.Equals(e,t,r)&&Math.abs((e.z||0)-(t.z||0))<r;}},{key:"Clockwise",value:function Clockwise(e,t,r){return(r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y)<0;}},{key:"Rescale",value:function Rescale(e,t){var r=pt.Len(e);return new pt(t*e.x/r,t*e.y/r);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(e,t,r){return pt.Sub(e,r).mul(t).add(r);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(e,t,r){return pt.Sub(e,r).mulV(t).add(r);}},{key:"ToFixed",value:function ToFixed(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new pt(+e.x.toFixed(t),+e.y.toFixed(t),+e.z.toFixed(t));}},{key:"Nudge",value:function Nudge(e,t,r){return pt.Add(e,pt.Tan(t,e).mul(r));}},{key:"ToString",value:function ToString(e){return"".concat(e.x,", ").concat(e.y);}},{key:"ToAngle",value:function ToAngle(e){var t=Math.atan2(e.y,e.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new pt(Math.cos(e)*t,Math.sin(e)*t);}},{key:"ToArray",value:function ToArray(e){return[e.x,e.y,e.z];}},{key:"ToJson",value:function ToJson(e){var t=e.x,r=e.y,n=e.z;return{x:t,y:r,z:n};}},{key:"Average",value:function Average(e){var t=e.length,r=new pt(0,0);for(var n=0;n<t;n++)r.add(e[n]);return r.div(t);}},{key:"Clamp",value:function Clamp(e,t,r){return r===void 0?new pt(Math.min(Math.max(e.x,t)),Math.min(Math.max(e.y,t))):new pt(Math.min(Math.max(e.x,t),r),Math.min(Math.max(e.y,t),r));}/**
377
+ * Get an array of points (with simulated pressure) between two points.
378
+ *
379
+ * @param A - The first point.
380
+ * @param B - The second point.
381
+ * @param steps - The number of points to return.
382
+ */},{key:"PointsBetween",value:function PointsBetween(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var s=0;s<r;s++){var c=h1.easeInQuad(s/(r-1)),l=pt.Lrp(e,t,c);l.z=Math.min(1,0.5+Math.abs(0.5-d1(c))*0.65),n.push(l);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new pt(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}}]);}();var d1=function d1(i){return i<0.5?2*i*i:-1+(4-2*i)*i;};var Jt=/*#__PURE__*/function(_pt){function Jt(){var _this60;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var s=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var c=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Jt);_this60=_callSuper(this,Jt,[e,t,r]),_this60.x=e,_this60.y=t,_this60.z=r,_this60.v=n,_this60.t=s,_this60.a=c;return _this60;}_inherits(Jt,_pt);return _createClass(Jt,[{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(e){this.a=e;}},{key:"setT",value:function setT(e){this.t=e;}},{key:"setv",value:function setv(e){return this.v={x:e.x,y:e.y},this;}},{key:"set",value:function set(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var s=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var c=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=e,this.y=t,this.z=r,this.v=n,this.t=s,this.a=c,this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z,n=this.v,s=this.t,c=this.a,l={x:n.x,y:n.y};return new Jt(e,t,r,l,s,c);}},{key:"distance",value:function distance(e){return Jt.GetDistance(this,e);}},{key:"isNear",value:function isNear(e,t){return Jt.IsNear(this,e,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(e,t){return Jt.GetAngleByPoints(e,this,t);}}],[{key:"Sub",value:function Sub(e,t){return new Jt(e.x-t.x,e.y-t.y);}},{key:"Add",value:function Add(e,t){return new Jt(e.x+t.x,e.y+t.y);}},{key:"GetDistance",value:function GetDistance(e,t){return Jt.Len(e.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(e,t,r){var n=t.x-e.x,s=r.x-t.x,c=t.y-e.y,l=r.y-t.y;var f=0;var h=Math.sqrt(n*n+c*c),m=Math.sqrt(s*s+l*l);if(h&&m){var u=n*s+c*l;f=Math.acos(u/(h*m)),f=f/Math.PI*180;var y=n*l-c*s;y=y>0?1:-1,f=180+y*f;}return f;}},{key:"IsNear",value:function IsNear(e,t,r){return Jt.Len(e.clone().sub(t))<r;}},{key:"RotWith",value:function RotWith(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var s=e.x-t.x,c=e.y-t.y,l=Math.sin(r),f=Math.cos(r),h=Math.pow(10,n),m=Math.floor((t.x+(s*f-c*l))*h)/h,u=Math.floor((t.y+(s*l+c*f))*h)/h;return new Jt(m,u);}/**
383
+ * 根据圆心和半径,获取圆上的等份点
384
+ * @param o 圆心
385
+ * @param radius 半径
386
+ * @param average 均分数
387
+ * @returns
388
+ */},{key:"GetDotStroke",value:function GetDotStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new pt(1,1),s=Math.PI+1e-3,c=Jt.Add(e,Jt.Sub(e,n).uni().per().mul(-t)),l=[];for(var f=1/r,h=f;h<=1;h+=f)l.push(Jt.RotWith(c,e,s*2*h));return l;}/**
389
+ * 根据圆心和圆上的起始点,获取半圆上的等份点
390
+ * @param o 圆心
391
+ * @param p 圆弧起始点
392
+ * @param radian 1,逆时针180度 -1,顺时针
393
+ * @param average 均分数
394
+ * @returns
395
+ */},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var s=r*(Math.PI+1e-3),c=[];for(var l=1/n,f=l;f<=1;f+=l)c.push(Jt.RotWith(t,e,s*f));return c;}}]);}(pt);var hn=(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 Ln(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i["default"]:i;}var p1=_typeof(hn)=="object"&&hn&&hn.Object===Object&&hn,zu=p1,v1=zu,g1=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,m1=v1||g1||Function("return this")(),_r=m1,y1=_r,P1=y1.Symbol,Ji=P1,$c=Ji,$u=Object.prototype,S1=$u.hasOwnProperty,x1=$u.toString,$i=$c?$c.toStringTag:void 0;function T1(i){var e=S1.call(i,$i),t=i[$i];try{i[$i]=void 0;var r=!0;}catch(_unused18){}var n=x1.call(i);return r&&(e?i[$i]=t:delete i[$i]),n;}var C1=T1,I1=Object.prototype,O1=I1.toString;function w1(i){return O1.call(i);}var A1=w1,jc=Ji,E1=C1,M1=A1,L1="[object Null]",R1="[object Undefined]",Gc=jc?jc.toStringTag:void 0;function b1(i){return i==null?i===void 0?R1:L1:Gc&&Gc in Object(i)?E1(i):M1(i);}var Pi=b1;function D1(i){return i!=null&&_typeof(i)=="object";}var pn=D1,N1=Pi,B1=pn,W1="[object Number]";function F1(i){return typeof i=="number"||B1(i)&&N1(i)==W1;}var U1=F1,er=/* @__PURE__ */Ln(U1);function Y1(){this.__data__=[],this.size=0;}var X1=Y1;function z1(i,e){return i===e||i!==i&&e!==e;}var ul=z1,$1=ul;function j1(i,e){for(var t=i.length;t--;)if($1(i[t][0],e))return t;return-1;}var po=j1,G1=po,H1=Array.prototype,k1=H1.splice;function K1(i){var e=this.__data__,t=G1(e,i);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():k1.call(e,t,1),--this.size,!0;}var V1=K1,Z1=po;function J1(i){var e=this.__data__,t=Z1(e,i);return t<0?void 0:e[t][1];}var Q1=J1,q1=po;function _1(i){return q1(this.__data__,i)>-1;}var tP=_1,eP=po;function rP(i,e){var t=this.__data__,r=eP(t,i);return r<0?(++this.size,t.push([i,e])):t[r][1]=e,this;}var nP=rP,iP=X1,sP=V1,oP=Q1,aP=tP,lP=nP;function Si(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}Si.prototype.clear=iP;Si.prototype["delete"]=sP;Si.prototype.get=oP;Si.prototype.has=aP;Si.prototype.set=lP;var vo=Si,fP=vo;function cP(){this.__data__=new fP(),this.size=0;}var uP=cP;function hP(i){var e=this.__data__,t=e["delete"](i);return this.size=e.size,t;}var dP=hP;function pP(i){return this.__data__.get(i);}var vP=pP;function gP(i){return this.__data__.has(i);}var mP=gP;function yP(i){var e=_typeof(i);return i!=null&&(e=="object"||e=="function");}var Qi=yP,PP=Pi,SP=Qi,xP="[object AsyncFunction]",TP="[object Function]",CP="[object GeneratorFunction]",IP="[object Proxy]";function OP(i){if(!SP(i))return!1;var e=PP(i);return e==TP||e==CP||e==xP||e==IP;}var ju=OP,wP=_r,AP=wP["__core-js_shared__"],EP=AP,Qa=EP,Hc=function(){var i=/[^.]+$/.exec(Qa&&Qa.keys&&Qa.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:"";}();function MP(i){return!!Hc&&Hc in i;}var LP=MP,RP=Function.prototype,bP=RP.toString;function DP(i){if(i!=null){try{return bP.call(i);}catch(_unused19){}try{return i+"";}catch(_unused20){}}return"";}var Gu=DP,NP=ju,BP=LP,WP=Qi,FP=Gu,UP=/[\\^$.*+?()[\]{}|]/g,YP=/^\[object .+?Constructor\]$/,XP=Function.prototype,zP=Object.prototype,$P=XP.toString,jP=zP.hasOwnProperty,GP=RegExp("^"+$P.call(jP).replace(UP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function HP(i){if(!WP(i)||BP(i))return!1;var e=NP(i)?GP:YP;return e.test(FP(i));}var kP=HP;function KP(i,e){return i==null?void 0:i[e];}var VP=KP,ZP=kP,JP=VP;function QP(i,e){var t=JP(i,e);return ZP(t)?t:void 0;}var $n=QP,qP=$n,_P=_r,tS=qP(_P,"Map"),hl=tS,eS=$n,rS=eS(Object,"create"),go=rS,kc=go;function nS(){this.__data__=kc?kc(null):{},this.size=0;}var iS=nS;function sS(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e;}var oS=sS,aS=go,lS="__lodash_hash_undefined__",fS=Object.prototype,cS=fS.hasOwnProperty;function uS(i){var e=this.__data__;if(aS){var t=e[i];return t===lS?void 0:t;}return cS.call(e,i)?e[i]:void 0;}var hS=uS,dS=go,pS=Object.prototype,vS=pS.hasOwnProperty;function gS(i){var e=this.__data__;return dS?e[i]!==void 0:vS.call(e,i);}var mS=gS,yS=go,PS="__lodash_hash_undefined__";function SS(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=yS&&e===void 0?PS:e,this;}var xS=SS,TS=iS,CS=oS,IS=hS,OS=mS,wS=xS;function xi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}xi.prototype.clear=TS;xi.prototype["delete"]=CS;xi.prototype.get=IS;xi.prototype.has=OS;xi.prototype.set=wS;var AS=xi,Kc=AS,ES=vo,MS=hl;function LS(){this.size=0,this.__data__={hash:new Kc(),map:new(MS||ES)(),string:new Kc()};}var RS=LS;function bS(i){var e=_typeof(i);return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null;}var DS=bS,NS=DS;function BS(i,e){var t=i.__data__;return NS(e)?t[typeof e=="string"?"string":"hash"]:t.map;}var mo=BS,WS=mo;function FS(i){var e=WS(this,i)["delete"](i);return this.size-=e?1:0,e;}var US=FS,YS=mo;function XS(i){return YS(this,i).get(i);}var zS=XS,$S=mo;function jS(i){return $S(this,i).has(i);}var GS=jS,HS=mo;function kS(i,e){var t=HS(this,i),r=t.size;return t.set(i,e),this.size+=t.size==r?0:1,this;}var KS=kS,VS=RS,ZS=US,JS=zS,QS=GS,qS=KS;function Ti(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}Ti.prototype.clear=VS;Ti.prototype["delete"]=ZS;Ti.prototype.get=JS;Ti.prototype.has=QS;Ti.prototype.set=qS;var Hu=Ti,_S=vo,tx=hl,ex=Hu,rx=200;function nx(i,e){var t=this.__data__;if(t instanceof _S){var r=t.__data__;if(!tx||r.length<rx-1)return r.push([i,e]),this.size=++t.size,this;t=this.__data__=new ex(r);}return t.set(i,e),this.size=t.size,this;}var ix=nx,sx=vo,ox=uP,ax=dP,lx=vP,fx=mP,cx=ix;function Ci(i){var e=this.__data__=new sx(i);this.size=e.size;}Ci.prototype.clear=ox;Ci.prototype["delete"]=ax;Ci.prototype.get=lx;Ci.prototype.has=fx;Ci.prototype.set=cx;var ku=Ci;function ux(i,e){for(var t=-1,r=i==null?0:i.length;++t<r&&e(i[t],t,i)!==!1;);return i;}var hx=ux,dx=$n,px=function(){try{var i=dx(Object,"defineProperty");return i({},"",{}),i;}catch(_unused21){}}(),Ku=px,Vc=Ku;function vx(i,e,t){e=="__proto__"&&Vc?Vc(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t;}var Vu=vx,gx=Vu,mx=ul,yx=Object.prototype,Px=yx.hasOwnProperty;function Sx(i,e,t){var r=i[e];(!(Px.call(i,e)&&mx(r,t))||t===void 0&&!(e in i))&&gx(i,e,t);}var Zu=Sx,xx=Zu,Tx=Vu;function Cx(i,e,t,r){var n=!t;t||(t={});for(var s=-1,c=e.length;++s<c;){var l=e[s],f=r?r(t[l],i[l],l,t,i):void 0;f===void 0&&(f=i[l]),n?Tx(t,l,f):xx(t,l,f);}return t;}var yo=Cx;function Ix(i,e){for(var t=-1,r=Array(i);++t<i;)r[t]=e(t);return r;}var Ox=Ix,wx=Pi,Ax=pn,Ex="[object Arguments]";function Mx(i){return Ax(i)&&wx(i)==Ex;}var Lx=Mx,Zc=Lx,Rx=pn,Ju=Object.prototype,bx=Ju.hasOwnProperty,Dx=Ju.propertyIsEnumerable,Nx=Zc(/* @__PURE__ */function(){return arguments;}())?Zc:function(i){return Rx(i)&&bx.call(i,"callee")&&!Dx.call(i,"callee");},Qu=Nx,Bx=Array.isArray,qi=Bx,to={exports:{}};function Wx(){return!1;}var Fx=Wx;to.exports;(function(i,e){var t=_r,r=Fx,n=e&&!e.nodeType&&e,s=n&&!0&&i&&!i.nodeType&&i,c=s&&s.exports===n,l=c?t.Buffer:void 0,f=l?l.isBuffer:void 0,h=f||r;i.exports=h;})(to,to.exports);var dl=to.exports,Ux=9007199254740991,Yx=/^(?:0|[1-9]\d*)$/;function Xx(i,e){var _e2;var t=_typeof(i);return e=(_e2=e)!==null&&_e2!==void 0?_e2:Ux,!!e&&(t=="number"||t!="symbol"&&Yx.test(i))&&i>-1&&i%1==0&&i<e;}var zx=Xx,$x=9007199254740991;function jx(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=$x;}var qu=jx,Gx=Pi,Hx=qu,kx=pn,Kx="[object Arguments]",Vx="[object Array]",Zx="[object Boolean]",Jx="[object Date]",Qx="[object Error]",qx="[object Function]",_x="[object Map]",tT="[object Number]",eT="[object Object]",rT="[object RegExp]",nT="[object Set]",iT="[object String]",sT="[object WeakMap]",oT="[object ArrayBuffer]",aT="[object DataView]",lT="[object Float32Array]",fT="[object Float64Array]",cT="[object Int8Array]",uT="[object Int16Array]",hT="[object Int32Array]",dT="[object Uint8Array]",pT="[object Uint8ClampedArray]",vT="[object Uint16Array]",gT="[object Uint32Array]",$e={};$e[lT]=$e[fT]=$e[cT]=$e[uT]=$e[hT]=$e[dT]=$e[pT]=$e[vT]=$e[gT]=!0;$e[Kx]=$e[Vx]=$e[oT]=$e[Zx]=$e[aT]=$e[Jx]=$e[Qx]=$e[qx]=$e[_x]=$e[tT]=$e[eT]=$e[rT]=$e[nT]=$e[iT]=$e[sT]=!1;function mT(i){return kx(i)&&Hx(i.length)&&!!$e[Gx(i)];}var yT=mT;function PT(i){return function(e){return i(e);};}var Po=PT,eo={exports:{}};eo.exports;(function(i,e){var t=zu,r=e&&!e.nodeType&&e,n=r&&!0&&i&&!i.nodeType&&i,s=n&&n.exports===r,c=s&&t.process,l=function(){try{var f=n&&n.require&&n.require("util").types;return f||c&&c.binding&&c.binding("util");}catch(_unused22){}}();i.exports=l;})(eo,eo.exports);var pl=eo.exports,ST=yT,xT=Po,Jc=pl,Qc=Jc&&Jc.isTypedArray,TT=Qc?xT(Qc):ST,_u=TT,CT=Ox,IT=Qu,OT=qi,wT=dl,AT=zx,ET=_u,MT=Object.prototype,LT=MT.hasOwnProperty;function RT(i,e){var t=OT(i),r=!t&&IT(i),n=!t&&!r&&wT(i),s=!t&&!r&&!n&&ET(i),c=t||r||n||s,l=c?CT(i.length,String):[],f=l.length;for(var h in i)(e||LT.call(i,h))&&!(c&&(// Safari 9 has enumerable `arguments.length` in strict mode.
396
+ h=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
397
+ n&&(h=="offset"||h=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
398
+ s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||// Skip index properties.
399
+ AT(h,f)))&&l.push(h);return l;}var th=RT,bT=Object.prototype;function DT(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||bT;return i===t;}var vl=DT;function NT(i,e){return function(t){return i(e(t));};}var eh=NT,BT=eh,WT=BT(Object.keys,Object),FT=WT,UT=vl,YT=FT,XT=Object.prototype,zT=XT.hasOwnProperty;function $T(i){if(!UT(i))return YT(i);var e=[];for(var t in Object(i))zT.call(i,t)&&t!="constructor"&&e.push(t);return e;}var jT=$T,GT=ju,HT=qu;function kT(i){return i!=null&&HT(i.length)&&!GT(i);}var gl=kT,KT=th,VT=jT,ZT=gl;function JT(i){return ZT(i)?KT(i):VT(i);}var ml=JT,QT=yo,qT=ml;function _T(i,e){return i&&QT(e,qT(e),i);}var tC=_T;function eC(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e;}var rC=eC,nC=Qi,iC=vl,sC=rC,oC=Object.prototype,aC=oC.hasOwnProperty;function lC(i){if(!nC(i))return sC(i);var e=iC(i),t=[];for(var r in i)r=="constructor"&&(e||!aC.call(i,r))||t.push(r);return t;}var fC=lC,cC=th,uC=fC,hC=gl;function dC(i){return hC(i)?cC(i,!0):uC(i);}var yl=dC,pC=yo,vC=yl;function gC(i,e){return i&&pC(e,vC(e),i);}var mC=gC,ro={exports:{}};ro.exports;(function(i,e){var t=_r,r=e&&!e.nodeType&&e,n=r&&!0&&i&&!i.nodeType&&i,s=n&&n.exports===r,c=s?t.Buffer:void 0,l=c?c.allocUnsafe:void 0;function f(h,m){if(m)return h.slice();var u=h.length,y=l?l(u):new h.constructor(u);return h.copy(y),y;}i.exports=f;})(ro,ro.exports);var yC=ro.exports;function PC(i,e){var t=-1,r=i.length;for(e||(e=Array(r));++t<r;)e[t]=i[t];return e;}var SC=PC;function xC(i,e){for(var t=-1,r=i==null?0:i.length,n=0,s=[];++t<r;){var c=i[t];e(c,t,i)&&(s[n++]=c);}return s;}var rh=xC;function TC(){return[];}var nh=TC,CC=rh,IC=nh,OC=Object.prototype,wC=OC.propertyIsEnumerable,qc=Object.getOwnPropertySymbols,AC=qc?function(i){return i==null?[]:(i=Object(i),CC(qc(i),function(e){return wC.call(i,e);}));}:IC,Pl=AC,EC=yo,MC=Pl;function LC(i,e){return EC(i,MC(i),e);}var RC=LC;function bC(i,e){for(var t=-1,r=e.length,n=i.length;++t<r;)i[n+t]=e[t];return i;}var Sl=bC,DC=eh,NC=DC(Object.getPrototypeOf,Object),ih=NC,BC=Sl,WC=ih,FC=Pl,UC=nh,YC=Object.getOwnPropertySymbols,XC=YC?function(i){for(var e=[];i;)BC(e,FC(i)),i=WC(i);return e;}:UC,sh=XC,zC=yo,$C=sh;function jC(i,e){return zC(i,$C(i),e);}var GC=jC,HC=Sl,kC=qi;function KC(i,e,t){var r=e(i);return kC(i)?r:HC(r,t(i));}var oh=KC,VC=oh,ZC=Pl,JC=ml;function QC(i){return VC(i,JC,ZC);}var ah=QC,qC=oh,_C=sh,tI=yl;function eI(i){return qC(i,tI,_C);}var rI=eI,nI=$n,iI=_r,sI=nI(iI,"DataView"),oI=sI,aI=$n,lI=_r,fI=aI(lI,"Promise"),cI=fI,uI=$n,hI=_r,dI=uI(hI,"Set"),lh=dI,pI=$n,vI=_r,gI=pI(vI,"WeakMap"),mI=gI,rl=oI,nl=hl,il=cI,sl=lh,ol=mI,fh=Pi,Ii=Gu,_c="[object Map]",yI="[object Object]",tu="[object Promise]",eu="[object Set]",ru="[object WeakMap]",nu="[object DataView]",PI=Ii(rl),SI=Ii(nl),xI=Ii(il),TI=Ii(sl),CI=Ii(ol),zn=fh;(rl&&zn(new rl(new ArrayBuffer(1)))!=nu||nl&&zn(new nl())!=_c||il&&zn(il.resolve())!=tu||sl&&zn(new sl())!=eu||ol&&zn(new ol())!=ru)&&(zn=function zn(i){var e=fh(i),t=e==yI?i.constructor:void 0,r=t?Ii(t):"";if(r)switch(r){case PI:return nu;case SI:return _c;case xI:return tu;case TI:return eu;case CI:return ru;}return e;});var So=zn,II=Object.prototype,OI=II.hasOwnProperty;function wI(i){var e=i.length,t=new i.constructor(e);return e&&typeof i[0]=="string"&&OI.call(i,"index")&&(t.index=i.index,t.input=i.input),t;}var AI=wI,EI=_r,MI=EI.Uint8Array,ch=MI,iu=ch;function LI(i){var e=new i.constructor(i.byteLength);return new iu(e).set(new iu(i)),e;}var xl=LI,RI=xl;function bI(i,e){var t=e?RI(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength);}var DI=bI,NI=/\w*$/;function BI(i){var e=new i.constructor(i.source,NI.exec(i));return e.lastIndex=i.lastIndex,e;}var WI=BI,su=Ji,ou=su?su.prototype:void 0,au=ou?ou.valueOf:void 0;function FI(i){return au?Object(au.call(i)):{};}var UI=FI,YI=xl;function XI(i,e){var t=e?YI(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length);}var zI=XI,$I=xl,jI=DI,GI=WI,HI=UI,kI=zI,KI="[object Boolean]",VI="[object Date]",ZI="[object Map]",JI="[object Number]",QI="[object RegExp]",qI="[object Set]",_I="[object String]",tO="[object Symbol]",eO="[object ArrayBuffer]",rO="[object DataView]",nO="[object Float32Array]",iO="[object Float64Array]",sO="[object Int8Array]",oO="[object Int16Array]",aO="[object Int32Array]",lO="[object Uint8Array]",fO="[object Uint8ClampedArray]",cO="[object Uint16Array]",uO="[object Uint32Array]";function hO(i,e,t){var r=i.constructor;switch(e){case eO:return $I(i);case KI:case VI:return new r(+i);case rO:return jI(i,t);case nO:case iO:case sO:case oO:case aO:case lO:case fO:case cO:case uO:return kI(i,t);case ZI:return new r();case JI:case _I:return new r(i);case QI:return GI(i);case qI:return new r();case tO:return HI(i);}}var dO=hO,pO=Qi,lu=Object.create,vO=/* @__PURE__ */function(){function i(){}return function(e){if(!pO(e))return{};if(lu)return lu(e);i.prototype=e;var t=new i();return i.prototype=void 0,t;};}(),gO=vO,mO=gO,yO=ih,PO=vl;function SO(i){return typeof i.constructor=="function"&&!PO(i)?mO(yO(i)):{};}var xO=SO,TO=So,CO=pn,IO="[object Map]";function OO(i){return CO(i)&&TO(i)==IO;}var wO=OO,AO=wO,EO=Po,fu=pl,cu=fu&&fu.isMap,MO=cu?EO(cu):AO,LO=MO,RO=So,bO=pn,DO="[object Set]";function NO(i){return bO(i)&&RO(i)==DO;}var BO=NO,WO=BO,FO=Po,uu=pl,hu=uu&&uu.isSet,UO=hu?FO(hu):WO,uh=UO,YO=/* @__PURE__ */Ln(uh),XO=ku,zO=hx,$O=Zu,jO=tC,GO=mC,HO=yC,kO=SC,KO=RC,VO=GC,ZO=ah,JO=rI,QO=So,qO=AI,_O=dO,t2=xO,e2=qi,r2=dl,n2=LO,i2=Qi,s2=uh,o2=ml,a2=yl,l2=1,f2=2,c2=4,hh="[object Arguments]",u2="[object Array]",h2="[object Boolean]",d2="[object Date]",p2="[object Error]",dh="[object Function]",v2="[object GeneratorFunction]",g2="[object Map]",m2="[object Number]",ph="[object Object]",y2="[object RegExp]",P2="[object Set]",S2="[object String]",x2="[object Symbol]",T2="[object WeakMap]",C2="[object ArrayBuffer]",I2="[object DataView]",O2="[object Float32Array]",w2="[object Float64Array]",A2="[object Int8Array]",E2="[object Int16Array]",M2="[object Int32Array]",L2="[object Uint8Array]",R2="[object Uint8ClampedArray]",b2="[object Uint16Array]",D2="[object Uint32Array]",Ye={};Ye[hh]=Ye[u2]=Ye[C2]=Ye[I2]=Ye[h2]=Ye[d2]=Ye[O2]=Ye[w2]=Ye[A2]=Ye[E2]=Ye[M2]=Ye[g2]=Ye[m2]=Ye[ph]=Ye[y2]=Ye[P2]=Ye[S2]=Ye[x2]=Ye[L2]=Ye[R2]=Ye[b2]=Ye[D2]=!0;Ye[p2]=Ye[dh]=Ye[T2]=!1;function qs(i,e,t,r,n,s){var c,l=e&l2,f=e&f2,h=e&c2;if(t&&(c=n?t(i,r,n,s):t(i)),c!==void 0)return c;if(!i2(i))return i;var m=e2(i);if(m){if(c=qO(i),!l)return kO(i,c);}else{var u=QO(i),y=u==dh||u==v2;if(r2(i))return HO(i,l);if(u==ph||u==hh||y&&!n){if(c=f||y?{}:t2(i),!l)return f?VO(i,GO(c,i)):KO(i,jO(c,i));}else{if(!Ye[u])return n?i:{};c=_O(i,u,l);}}s||(s=new XO());var T=s.get(i);if(T)return T;s.set(i,c),s2(i)?i.forEach(function(x){c.add(qs(x,e,t,x,i,s));}):n2(i)&&i.forEach(function(x,I){c.set(I,qs(x,e,t,I,i,s));});var E=h?f?JO:ZO:f?a2:o2,C=m?void 0:E(i);return zO(C||i,function(x,I){C&&(I=x,x=i[I]),$O(c,I,qs(x,e,t,I,i,s));}),c;}var N2=qs,B2=N2,W2=1,F2=4;function U2(i){return B2(i,W2|F2);}var Y2=U2,fr=/* @__PURE__ */Ln(Y2);var vh="1.1.23",X2="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var i=window.__netlessUA||"";i+=" ".concat(X2,"@").concat(vh),window.__netlessUA=i;}var vr={useWorker:"auto",useSimple:!1,syncOpt:{interval:300,smoothSync:!0},cursor:{enable:!0,expirationTime:5e3,moveDelayTime:100},bufferSize:{full:2e4,sub:600},bezier:{enable:!0,maxDrawCount:1/0,combineUnitTime:300},pencilEraser:{useBitMap:!0,maxImageWidth:1920,maxImageHeight:1920,maxCombineTime:500},strokeWidth:{min:1,max:10},textEditor:{showFloatBar:!0,canSelectorSwitch:!0,rightBoundBreak:!1,extendFontFaces:[],loadFontFacesTimeout:1e4},longDottedStroke:{lineCap:"round",segment:1,gap:2},dottedStroke:{lineCap:"round",segment:1,gap:2},normalStroke:{lineCap:"round"}};function En(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=i.length;if(t<2)return"";var r=i[0],n=i[1];if(t===2)return"M".concat(fi(r),"L").concat(fi(n));var s="";for(var c=2,l=t-1;c<l;c++)r=i[c],n=i[c+1],s+=ci(r,n);return e?"M".concat(ci(i[0],i[1]),"Q").concat(fi(i[1])).concat(ci(i[1],i[2]),"T").concat(s).concat(ci(i[t-1],i[0])).concat(ci(i[0],i[1]),"Z"):"M".concat(fi(i[0]),"Q").concat(fi(i[1])).concat(ci(i[1],i[2])).concat(i.length>3?"T":"").concat(s,"L").concat(fi(i[t-1]));}var Mr=/*#__PURE__*/function(){function Mr(e){_classCallCheck(this,Mr);dt(this,"maxImageWidth",vr.pencilEraser.maxImageWidth);dt(this,"maxImageHeight",vr.pencilEraser.maxImageHeight);dt(this,"syncUnitTime",vr.syncOpt.interval);dt(this,"vNodes");dt(this,"drawLayer");dt(this,"fullLayer");dt(this,"workId");dt(this,"isDelete",!1);var t=e.vNodes,r=e.fullLayer,n=e.drawLayer,s=e.workId,c=e.toolsOpt;this.vNodes=t,this.fullLayer=r,this.drawLayer=n,this.workId=s,this.syncUnitTime=c.syncUnitTime||this.syncUnitTime;}return _createClass(Mr,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return e.reduce(function(r,n){var s=r[r.length-1];return(n&&!s||n&&s&&!n.isNear(s,t))&&r.push(n),r;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(e){this.workId=e;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(e){var n,s,c;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),r=t&&((s=this.vNodes)==null?void 0:s.get(t))||void 0;t&&r&&(r.opt=e,(c=this.vNodes)==null||c.setInfo(t,r));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(e){var n,s;var t;var r=(n=this.workId)==null?void 0:n.toString();if(r&&e){var c=this.fullLayer.getElementsByName(r)||this.drawLayer&&this.drawLayer.getElementsByName(r)||[];if(c.length!==1)return;var l=c[0],f=e.pos,h=e.zIndex,m=e.scale,u=e.angle,y=e.translate,T={};er(h)&&(T.zIndex=h),f&&(T.pos=[f[0],f[1]]),m&&(T.scale=m),u&&(T.rotate=u),y&&(T.translate=y),l.attr(T);var E=l==null?void 0:l.getBoundingClientRect();return E&&(t=Zt(t,{x:Math.floor(E.x-Mr.SafeBorderPadding),y:Math.floor(E.y-Mr.SafeBorderPadding),w:Math.floor(E.width+Mr.SafeBorderPadding*2),h:Math.floor(E.height+Mr.SafeBorderPadding*2)})),(s=this.vNodes)==null||s.setInfo(r,{rect:t,centerPos:f}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(e,t){var r=e.group,n=e.eraserlines,s=e.pos,c=e.layer,l=c.parent;if(t)try{var h=(c.renderer.glRenderer||c.renderer.canvasRenderer).options.displayRatio,m=r.getBoundingClientRect(),u=m.width*h*c.worldScaling[0],y=m.height*h*c.worldScaling[1];var T=1;(u>this.maxImageWidth||y>this.maxImageHeight)&&(T=Math.min(this.maxImageWidth/u,this.maxImageHeight/y));var E=c.getAttribute("scale");E=[E[0]*T,E[1]*T];var C=c.parent.parent,x=c.getAttribute("translate"),_I32=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),C,{offscreen:l.offscreen,width:l.width,height:l.height,contextType:"2d",autoRender:!1,bufferSize:500},E,x),_d29=r.cloneNode(!0);if(!n||!n.length)return;this.addEraserlines(_d29,n,s,!1),_I32.appendChild(_d29);var v=_I32.parent;v.render();var p=_I32.renderer.canvasRenderer,S=p.context;if(!S)return;var A=p.options.displayRatio,R=_d29.getBoundingClientRect(),D={x:R.x,y:R.y,w:R.width,h:R.height},U={x:0,y:0,w:C.width,h:C.height};if(Zi(D,U)===Tr.outside){Lr(_d29,v),C.removeChild(v),this.isDelete=!0;return;}var W=fr(D);W.x=Math.floor(Math.max(D.x,0)),W.y=Math.floor(Math.max(D.y,0)),W.w=Math.min(D.x+D.w,C.width)-W.x,W.h=Math.min(D.y+D.h,C.height)-W.y;var Y=this.getGroupRect(W,A),B=Y.x,N=Y.y,G=Y.w,J=Y.h;var tt=S.getImageData(B,N,G,J);if(this.isTransparentRectByCanvas(tt)){Lr(_d29,v),C.removeChild(v),this.isDelete=!0,tt=null;return;}Lr(r,l);var ut=this.createSpriteNode({imageData:tt,safariRect:W,originRect:D,worldScaling:_I32.worldScaling});ut&&r.append(ut),Lr(_d29,v),C.removeChild(v),l.deleteTexture(tt),tt=null;}catch(f){console.error("[BaseShapeTool] drawEraserlines error:",f);return;}}},{key:"createVmRenderNode",value:function createVmRenderNode(e,t,r,n,s){var c=r.width,l=r.height,f="bitMap-".concat(e),h=t.layer(f,r),m=new mr({anchor:[0.5,0.5],pos:[c*0.5,l*0.5],size:[c,l],name:"viewport",id:e});return m.setAttribute("scale",n),m.setAttribute("translate",s),h.append(m),m;}},{key:"getGroupRect",value:function getGroupRect(e,t){var r=Math.floor(e.x*t),n=Math.floor(e.y*t),s=Math.floor(e.w*t),c=Math.floor(e.h*t);return{x:r,y:n,w:s,h:c};}},{key:"addEraserlines",value:function addEraserlines(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var _iterator13=_createForOfIteratorHelper(t),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var s=_step13.value;var c=s.thickness,l=s.op;var _iterator14=_createForOfIteratorHelper(l),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var f=_step14.value;var h=f.map(function(E,C){return C%2?E-r[1]:E-r[0];}),m=this.computEraserPoints(h,c),u=En(m,!0),y={pos:[0,0],d:u,fillColor:"rgba(0,0,0,1)"},T=new Mn(y);T.addEventListener("beforerender",function(_ref164){var E=_ref164.detail;var C=E.context;n?C.blendFuncSeparate(C.ZERO,C.ZERO,C.ZERO,C.ZERO):C.globalCompositeOperation="destination-out";}),T.addEventListener("afterrender",function(_ref165){var E=_ref165.detail;var C=E.context;n?C.blendFuncSeparate(C.SRC_ALPHA,C.ONE_MINUS_SRC_ALPHA,C.ONE,C.ONE_MINUS_SRC_ALPHA):C.globalCompositeOperation="source-over";}),e.append(T);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(e){var t=!0;for(var r=0;r<e.data.length;r+=4)if(e.data[r+3]!==0){t=!1;break;}return t;}},{key:"createSpriteNode",value:function createSpriteNode(e){var t=e.imageData,r=e.worldScaling,n=e.safariRect,s=e.originRect;var c;if(typeof OffscreenCanvas=="function"){c=new OffscreenCanvas(t.width,t.height);var m=c.getContext("2d");m&&m.putImageData(t,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){c=document.createElement("canvas"),c.width=t.width,c.height=t.height;var _m4=c.getContext("2d");_m4&&_m4.putImageData(t,0,0);}if(!c)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var l=[Math.floor(s.w/r[0]),Math.floor(s.h/r[1])],f=[Math.floor((n.x-s.x)/r[0]),Math.floor((n.y-s.y)/r[1]),Math.floor(n.w/r[0]),Math.floor(n.h/r[1])],h={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:l,texture:c,textureRect:f};return new Yu(h);}},{key:"computEraserPoints",value:function computEraserPoints(e,t){var r=Math.ceil(t/2);return e.length===2?this.computDot(e,r):this.computLine(e,r);}},{key:"computDot",value:function computDot(e,t){var r=new Jt(e[0],e[1]);return Jt.GetDotStroke(r,t,8);}},{key:"computLine",value:function computLine(e,t){var r=[],n=[];var s,c;for(var l=0;l<e.length;l+=2){var f=new Jt(e[l],e[l+1]);var h=void 0;if(l==e.length-2){var m=new Jt(e[l-2],e[l-1]);h=pt.Sub(f,m).uni(),s=f;}else{l===0&&(c=f);var _m5=new Jt(e[l+2],e[l+3]);h=pt.Sub(_m5,f).uni();}if(h){var _m6=pt.Per(h).mul(t);r.push(Jt.Sub(f,_m6)),n.push(Jt.Add(f,_m6));}}if(s&&c){var _l3=Jt.GetSemicircleStroke(s,r[r.length-1],-1,8),_f4=Jt.GetSemicircleStroke(c,n[0],-1,8);return r.concat(_l3,n.reverse(),_f4);}return[];}},{key:"replace",value:function replace(e,t,r){var _this61=this;var s;if(!t){r&&e.append(r);return;}var n=e.getElementsByName(t);if(n.length){var _iterator15=_createForOfIteratorHelper(n),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var c=_step15.value;r?iE(r,c,e):(c.remove(),_pr(c,e.parent));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}else r&&e.append(r);this.fullLayer!==this.drawLayer&&(this.fullLayer===e?(s=this.drawLayer)==null||s.getElementsByName(t).forEach(function(l){var f;l.remove(),_pr(l,(f=_this61.drawLayer)==null?void 0:f.parent);}):this.fullLayer.getElementsByName(t).forEach(function(l){l.remove(),_pr(l,_this61.fullLayer.parent);}));}},{key:"removeDrawCountNodes",value:function removeDrawCountNodes(e,t){var r=[];e.getElementsByName(this.workId).forEach(function(n){n.id&&t&&Number(n.id)<t&&r.push(n);});for(var _i2=0,_r3=r;_i2<_r3.length;_i2++){var n=_r3[_i2];n.remove(),_pr(n,e.parent);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(e){var d;var t=e.node,r=e.opt,n=e.vNodes,s=e.willSerializeData,c=e.targetNode,l=r.zIndex,f=r.translate,h=r.angle,m=r.originPoint,u=r.scenePoint,y=r.scale,T=r.pointMap,E=r.thickness;var C;var x=c&&fr(c)||n.get(t.name);if(!x)return;er(l)&&(t.setAttribute("zIndex",l),x.opt.zIndex=l);var I=t.parent;if(I){if(m&&y&&c){var v=[x.op[0],x.op[1]];Ll(x.op,u,y,f);var p=[x.op[0],x.op[1]],S=[p[0]-v[0],p[1]-v[1]];if(x.centerPos=[x.centerPos[0]+S[0],x.centerPos[1]+S[1]],x.opt.translate=void 0,x.opt.scale=void 0,x.opt.eraserlines)for(var A=0;A<x.opt.eraserlines.length;A++){var _x$opt$eraserlines$A=x.opt.eraserlines[A],R=_x$opt$eraserlines$A.op,D=_x$opt$eraserlines$A.thickness;x.opt.eraserlines[A].thickness=Math.round(D*Math.max(y[0],y[1]));for(var U=0;U<R.length;U++)Rl(R[U],u,y,f);}}else if(f){if(t.setAttribute("translate",f),x.opt.translate=f,c){var _v6=[f[0]*I.worldScaling[0],f[1]*I.worldScaling[1]];C=Vi(x.rect,_v6),x.rect=C;}else{var _v7=Mr.getRectFromLayer(I,t.name);x.rect=_v7||x.rect;}}else if(er(h))if(t.setAttribute("rotate",h),x.opt.rotate=h,c)C=kh(x.rect,h),x.rect=C;else{var _v8=Mr.getRectFromLayer(I,t.name);x.rect=_v8||x.rect;}if(T){var _v9=T.get(t.name);if(_v9)for(var _p10=0,_S10=0;_p10<x.op.length;_p10+=3,_S10++)x.op[_p10]=_v9[_S10][0],x.op[_p10+1]=_v9[_S10][1];}if(E&&(d=x==null?void 0:x.opt)!=null&&d.thickness&&(x.opt.thickness=E),s&&!(m&&y&&c)){if(f){var _v10=x.op.map(function(p,S){var A=S%3;return A===0?p+f[0]:A===1?p+f[1]:p;});if(x.op=_v10,x.centerPos=[x.centerPos[0]+f[0],x.centerPos[1]+f[1]],x!=null&&x.opt&&(x.opt.translate=void 0),x.opt.eraserlines)for(var _p11=0;_p11<x.opt.eraserlines.length;_p11++){var _S11=x.opt.eraserlines[_p11].op;for(var _A7=0;_A7<_S11.length;_A7++){var _R3=_S11[_A7].map(function(D,U){return U%2?D+f[1]:D+f[0];});x.opt.eraserlines[_p11].op[_A7]=_R3;}}}else if(er(h)){var _v11=x.op;if(JA(_v11,x.centerPos,h),x.op=_v11,x!=null&&x.opt&&(x.opt.rotate=void 0),x.opt.eraserlines)for(var _p12=0;_p12<x.opt.eraserlines.length;_p12++){var _S12=x.opt.eraserlines[_p12].op;for(var _A8=0;_A8<_S12.length;_A8++)QA(_S12[_A8],x.centerPos,h);}}}x&&n.setInfo(t.name,x);}}},{key:"getCenterPos",value:function getCenterPos(e,t){var r=t.worldPosition,n=t.worldScaling;return[(e.x+e.w/2-r[0])/n[0],(e.y+e.h/2-r[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(e,t){var r=e.getElementsByName(t)[0];if(r){var n=r.getBoundingClientRect();return{x:Math.floor(n.x-Mr.SafeBorderPadding),y:Math.floor(n.y-Mr.SafeBorderPadding),w:Math.floor(n.width+Mr.SafeBorderPadding*2),h:Math.floor(n.height+Mr.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(e){var t=e.toolsType,r=e.opt,n=e.node,s=e.updateOpt,c=e.willSerializeData;return!!(c&&(s.angle||s.translate)||s.thickness&&r.thickness&&r.thickness!==s.thickness||s.strokeType&&r.strokeType&&r.strokeType!==s.strokeType||s.originPoint&&s.scenePoint&&s.scale||s.pointMap&&s.pointMap.has(n.name)||t===Tt.Text&&(s.fontSize||s.translate||s.textInfos&&s.textInfos.get(n.name))||t===Tt.Image&&(s.angle||s.translate||s.scale||s.strokeColor&&s.type===cl.Iconify)||t===s.toolsType&&s.willRefresh||r.eraserlines&&r.eraserlines.length&&(s.strokeColor||s.fillColor));}}]);}();dt(Mr,"SafeBorderPadding",10);var $t=Mr;var Tl=Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50}),Object.freeze({width:48,height:74})]);var Cl={exports:{}};Cl.exports;(function(i){var e=function(){var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function c(f,h){if(!s[f]){s[f]={};for(var m=0;m<f.length;m++)s[f][f.charAt(m)]=m;}return s[f][h];}var l={compressToBase64:function compressToBase64(f){if(f==null)return"";var h=l._compress(f,6,function(m){return r.charAt(m);});switch(h.length%4){default:case 0:return h;case 1:return h+"===";case 2:return h+"==";case 3:return h+"=";}},decompressFromBase64:function decompressFromBase64(f){return f==null?"":f==""?null:l._decompress(f.length,32,function(h){return c(r,f.charAt(h));});},compressToUTF16:function compressToUTF16(f){return f==null?"":l._compress(f,15,function(h){return t(h+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(f){return f==null?"":f==""?null:l._decompress(f.length,16384,function(h){return f.charCodeAt(h)-32;});},//compress into uint8array (UCS-2 big endian format)
400
+ compressToUint8Array:function compressToUint8Array(f){for(var h=l.compress(f),m=new Uint8Array(h.length*2),u=0,y=h.length;u<y;u++){var T=h.charCodeAt(u);m[u*2]=T>>>8,m[u*2+1]=T%256;}return m;},//decompress from uint8array (UCS-2 big endian format)
401
+ decompressFromUint8Array:function decompressFromUint8Array(f){if(f==null)return l.decompress(f);for(var h=new Array(f.length/2),m=0,u=h.length;m<u;m++)h[m]=f[m*2]*256+f[m*2+1];var y=[];return h.forEach(function(T){y.push(t(T));}),l.decompress(y.join(""));},//compress into a string that is already URI encoded
402
+ compressToEncodedURIComponent:function compressToEncodedURIComponent(f){return f==null?"":l._compress(f,6,function(h){return n.charAt(h);});},//decompress from an output of compressToEncodedURIComponent
403
+ decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(f){return f==null?"":f==""?null:(f=f.replace(/ /g,"+"),l._decompress(f.length,32,function(h){return c(n,f.charAt(h));}));},compress:function compress(f){return l._compress(f,16,function(h){return t(h);});},_compress:function _compress(f,h,m){if(f==null)return"";var u,y,T={},E={},C="",x="",I="",d=2,v=3,p=2,S=[],A=0,R=0,D;for(D=0;D<f.length;D+=1)if(C=f.charAt(D),Object.prototype.hasOwnProperty.call(T,C)||(T[C]=v++,E[C]=!0),x=I+C,Object.prototype.hasOwnProperty.call(T,x))I=x;else{if(Object.prototype.hasOwnProperty.call(E,I)){if(I.charCodeAt(0)<256){for(u=0;u<p;u++)A=A<<1,R==h-1?(R=0,S.push(m(A)),A=0):R++;for(y=I.charCodeAt(0),u=0;u<8;u++)A=A<<1|y&1,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=y>>1;}else{for(y=1,u=0;u<p;u++)A=A<<1|y,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=0;for(y=I.charCodeAt(0),u=0;u<16;u++)A=A<<1|y&1,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=y>>1;}d--,d==0&&(d=Math.pow(2,p),p++),delete E[I];}else for(y=T[I],u=0;u<p;u++)A=A<<1|y&1,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=y>>1;d--,d==0&&(d=Math.pow(2,p),p++),T[x]=v++,I=String(C);}if(I!==""){if(Object.prototype.hasOwnProperty.call(E,I)){if(I.charCodeAt(0)<256){for(u=0;u<p;u++)A=A<<1,R==h-1?(R=0,S.push(m(A)),A=0):R++;for(y=I.charCodeAt(0),u=0;u<8;u++)A=A<<1|y&1,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=y>>1;}else{for(y=1,u=0;u<p;u++)A=A<<1|y,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=0;for(y=I.charCodeAt(0),u=0;u<16;u++)A=A<<1|y&1,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=y>>1;}d--,d==0&&(d=Math.pow(2,p),p++),delete E[I];}else for(y=T[I],u=0;u<p;u++)A=A<<1|y&1,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=y>>1;d--,d==0&&(d=Math.pow(2,p),p++);}for(y=2,u=0;u<p;u++)A=A<<1|y&1,R==h-1?(R=0,S.push(m(A)),A=0):R++,y=y>>1;for(;;)if(A=A<<1,R==h-1){S.push(m(A));break;}else R++;return S.join("");},decompress:function decompress(f){return f==null?"":f==""?null:l._decompress(f.length,32768,function(h){return f.charCodeAt(h);});},_decompress:function _decompress(f,h,m){var u=[],y=4,T=4,E=3,C="",x=[],I,d,v,p,S,A,R,D={val:m(0),position:h,index:1};for(I=0;I<3;I+=1)u[I]=I;for(v=0,S=Math.pow(2,2),A=1;A!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*A,A<<=1;switch(v){case 0:for(v=0,S=Math.pow(2,8),A=1;A!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*A,A<<=1;R=t(v);break;case 1:for(v=0,S=Math.pow(2,16),A=1;A!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*A,A<<=1;R=t(v);break;case 2:return"";}for(u[3]=R,d=R,x.push(R);;){if(D.index>f)return"";for(v=0,S=Math.pow(2,E),A=1;A!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*A,A<<=1;switch(R=v){case 0:for(v=0,S=Math.pow(2,8),A=1;A!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*A,A<<=1;u[T++]=t(v),R=T-1,y--;break;case 1:for(v=0,S=Math.pow(2,16),A=1;A!=S;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*A,A<<=1;u[T++]=t(v),R=T-1,y--;break;case 2:return x.join("");}if(y==0&&(y=Math.pow(2,E),E++),u[R])C=u[R];else if(R===T)C=d+d.charAt(0);else return null;x.push(C),u[T++]=d+C.charAt(0),y--,d=C,y==0&&(y=Math.pow(2,E),E++);}}};return l;}();i!=null?i.exports=e:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e;});})(Cl);var gh=Cl.exports;function yi(i){return JSON.parse(gh.decompress(i));}function gr(i){return gh.compress(JSON.stringify(i));}var mh={exports:{}};(function(i){(function(){var e={};e.version="6.4.2.2",e.use_lines=!0,e.use_xyz=!1;var t=!1;i.exports?(i.exports=e,t=!0):(typeof document==="undefined"?"undefined":_typeof(document))<"u"?window.ClipperLib=e:self.ClipperLib=e;var r;if(t){var n="chrome";r="Netscape";}else{var n=navigator.userAgent.toString().toLowerCase();r=navigator.appName;}var s={};n.indexOf("chrome")!=-1&&n.indexOf("chromium")==-1?s.chrome=1:s.chrome=0,n.indexOf("chromium")!=-1?s.chromium=1:s.chromium=0,n.indexOf("safari")!=-1&&n.indexOf("chrome")==-1&&n.indexOf("chromium")==-1?s.safari=1:s.safari=0,n.indexOf("firefox")!=-1?s.firefox=1:s.firefox=0,n.indexOf("firefox/17")!=-1?s.firefox17=1:s.firefox17=0,n.indexOf("firefox/15")!=-1?s.firefox15=1:s.firefox15=0,n.indexOf("firefox/3")!=-1?s.firefox3=1:s.firefox3=0,n.indexOf("opera")!=-1?s.opera=1:s.opera=0,n.indexOf("msie 10")!=-1?s.msie10=1:s.msie10=0,n.indexOf("msie 9")!=-1?s.msie9=1:s.msie9=0,n.indexOf("msie 8")!=-1?s.msie8=1:s.msie8=0,n.indexOf("msie 7")!=-1?s.msie7=1:s.msie7=0,n.indexOf("msie ")!=-1?s.msie=1:s.msie=0,e.biginteger_used=null;var c;function l(a,P,w){e.biginteger_used=1,a!=null&&(typeof a=="number"&&_typeof(P)>"u"?this.fromInt(a):typeof a=="number"?this.fromNumber(a,P,w):P==null&&typeof a!="string"?this.fromString(a,256):this.fromString(a,P));}function f(){return new l(null,void 0,void 0);}function h(a,P,w,F,H,_){for(;--_>=0;){var st=P*this[a++]+w[F]+H;H=Math.floor(st/67108864),w[F++]=st&67108863;}return H;}function m(a,P,w,F,H,_){for(var st=P&32767,yt=P>>15;--_>=0;){var Pt=this[a]&32767,Bt=this[a++]>>15,kt=yt*Pt+Bt*st;Pt=st*Pt+((kt&32767)<<15)+w[F]+(H&1073741823),H=(Pt>>>30)+(kt>>>15)+yt*Bt+(H>>>30),w[F++]=Pt&1073741823;}return H;}function u(a,P,w,F,H,_){for(var st=P&16383,yt=P>>14;--_>=0;){var Pt=this[a]&16383,Bt=this[a++]>>14,kt=yt*Pt+Bt*st;Pt=st*Pt+((kt&16383)<<14)+w[F]+H,H=(Pt>>28)+(kt>>14)+yt*Bt,w[F++]=Pt&268435455;}return H;}r=="Microsoft Internet Explorer"?(l.prototype.am=m,c=30):r!="Netscape"?(l.prototype.am=h,c=26):(l.prototype.am=u,c=28),l.prototype.DB=c,l.prototype.DM=(1<<c)-1,l.prototype.DV=1<<c;var y=52;l.prototype.FV=Math.pow(2,y),l.prototype.F1=y-c,l.prototype.F2=2*c-y;var T="0123456789abcdefghijklmnopqrstuvwxyz",E=new Array(),C,x;for(C=48,x=0;x<=9;++x)E[C++]=x;for(C=97,x=10;x<36;++x)E[C++]=x;for(C=65,x=10;x<36;++x)E[C++]=x;function I(a){return T.charAt(a);}function d(a,P){var w=E[a.charCodeAt(P)];return w!==null&&w!==void 0?w:-1;}function v(a){for(var P=this.t-1;P>=0;--P)a[P]=this[P];a.t=this.t,a.s=this.s;}function p(a){this.t=1,this.s=a<0?-1:0,a>0?this[0]=a:a<-1?this[0]=a+this.DV:this.t=0;}function S(a){var P=f();return P.fromInt(a),P;}function A(a,P){var w;if(P==16)w=4;else if(P==8)w=3;else if(P==256)w=8;else if(P==2)w=1;else if(P==32)w=5;else if(P==4)w=2;else{this.fromRadix(a,P);return;}this.t=0,this.s=0;for(var F=a.length,H=!1,_=0;--F>=0;){var st=w==8?a[F]&255:d(a,F);if(st<0){a.charAt(F)=="-"&&(H=!0);continue;}H=!1,_==0?this[this.t++]=st:_+w>this.DB?(this[this.t-1]|=(st&(1<<this.DB-_)-1)<<_,this[this.t++]=st>>this.DB-_):this[this.t-1]|=st<<_,_+=w,_>=this.DB&&(_-=this.DB);}w==8&&a[0]&128&&(this.s=-1,_>0&&(this[this.t-1]|=(1<<this.DB-_)-1<<_)),this.clamp(),H&&l.ZERO.subTo(this,this);}function R(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t;}function D(a){if(this.s<0)return"-"+this.negate().toString(a);var P;if(a==16)P=4;else if(a==8)P=3;else if(a==2)P=1;else if(a==32)P=5;else if(a==4)P=2;else return this.toRadix(a);var w=(1<<P)-1,F,H=!1,_="",st=this.t,yt=this.DB-st*this.DB%P;if(st-->0)for(yt<this.DB&&(F=this[st]>>yt)>0&&(H=!0,_=I(F));st>=0;)yt<P?(F=(this[st]&(1<<yt)-1)<<P-yt,F|=this[--st]>>(yt+=this.DB-P)):(F=this[st]>>(yt-=P)&w,yt<=0&&(yt+=this.DB,--st)),F>0&&(H=!0),H&&(_+=I(F));return H?_:"0";}function U(){var a=f();return l.ZERO.subTo(this,a),a;}function M(){return this.s<0?this.negate():this;}function W(a){var P=this.s-a.s;if(P!=0)return P;var w=this.t;if(P=w-a.t,P!=0)return this.s<0?-P:P;for(;--w>=0;)if((P=this[w]-a[w])!=0)return P;return 0;}function Y(a){var P=1,w;return(w=a>>>16)!=0&&(a=w,P+=16),(w=a>>8)!=0&&(a=w,P+=8),(w=a>>4)!=0&&(a=w,P+=4),(w=a>>2)!=0&&(a=w,P+=2),(w=a>>1)!=0&&(a=w,P+=1),P;}function B(){return this.t<=0?0:this.DB*(this.t-1)+Y(this[this.t-1]^this.s&this.DM);}function N(a,P){var w;for(w=this.t-1;w>=0;--w)P[w+a]=this[w];for(w=a-1;w>=0;--w)P[w]=0;P.t=this.t+a,P.s=this.s;}function G(a,P){for(var w=a;w<this.t;++w)P[w-a]=this[w];P.t=Math.max(this.t-a,0),P.s=this.s;}function J(a,P){var w=a%this.DB,F=this.DB-w,H=(1<<F)-1,_=Math.floor(a/this.DB),st=this.s<<w&this.DM,yt;for(yt=this.t-1;yt>=0;--yt)P[yt+_+1]=this[yt]>>F|st,st=(this[yt]&H)<<w;for(yt=_-1;yt>=0;--yt)P[yt]=0;P[_]=st,P.t=this.t+_+1,P.s=this.s,P.clamp();}function tt(a,P){P.s=this.s;var w=Math.floor(a/this.DB);if(w>=this.t){P.t=0;return;}var F=a%this.DB,H=this.DB-F,_=(1<<F)-1;P[0]=this[w]>>F;for(var st=w+1;st<this.t;++st)P[st-w-1]|=(this[st]&_)<<H,P[st-w]=this[st]>>F;F>0&&(P[this.t-w-1]|=(this.s&_)<<H),P.t=this.t-w,P.clamp();}function at(a,P){for(var w=0,F=0,H=Math.min(a.t,this.t);w<H;)F+=this[w]-a[w],P[w++]=F&this.DM,F>>=this.DB;if(a.t<this.t){for(F-=a.s;w<this.t;)F+=this[w],P[w++]=F&this.DM,F>>=this.DB;F+=this.s;}else{for(F+=this.s;w<a.t;)F-=a[w],P[w++]=F&this.DM,F>>=this.DB;F-=a.s;}P.s=F<0?-1:0,F<-1?P[w++]=this.DV+F:F>0&&(P[w++]=F),P.t=w,P.clamp();}function ut(a,P){var w=this.abs(),F=a.abs(),H=w.t;for(P.t=H+F.t;--H>=0;)P[H]=0;for(H=0;H<F.t;++H)P[H+w.t]=w.am(0,F[H],P,H,0,w.t);P.s=0,P.clamp(),this.s!=a.s&&l.ZERO.subTo(P,P);}function K(a){for(var P=this.abs(),w=a.t=2*P.t;--w>=0;)a[w]=0;for(w=0;w<P.t-1;++w){var F=P.am(w,P[w],a,2*w,0,1);(a[w+P.t]+=P.am(w+1,2*P[w],a,2*w+1,F,P.t-w-1))>=P.DV&&(a[w+P.t]-=P.DV,a[w+P.t+1]=1);}a.t>0&&(a[a.t-1]+=P.am(w,P[w],a,2*w,0,1)),a.s=0,a.clamp();}function Q(a,P,w){var F=a.abs();if(!(F.t<=0)){var H=this.abs();if(H.t<F.t){P!=null&&P.fromInt(0),w!=null&&this.copyTo(w);return;}w==null&&(w=f());var _=f(),st=this.s,yt=a.s,Pt=this.DB-Y(F[F.t-1]);Pt>0?(F.lShiftTo(Pt,_),H.lShiftTo(Pt,w)):(F.copyTo(_),H.copyTo(w));var Bt=_.t,kt=_[Bt-1];if(kt!=0){var jt=kt*(1<<this.F1)+(Bt>1?_[Bt-2]>>this.F2:0),qt=this.FV/jt,oe=(1<<this.F1)/jt,me=1<<this.F2,Pe=w.t,De=Pe-Bt,or=P!==null&&P!==void 0?P:f();for(_.dlShiftTo(De,or),w.compareTo(or)>=0&&(w[w.t++]=1,w.subTo(or,w)),l.ONE.dlShiftTo(Bt,or),or.subTo(_,_);_.t<Bt;)_[_.t++]=0;for(;--De>=0;){var Rr=w[--Pe]==kt?this.DM:Math.floor(w[Pe]*qt+(w[Pe-1]+me)*oe);if((w[Pe]+=_.am(0,Rr,w,De,0,Bt))<Rr)for(_.dlShiftTo(De,or),w.subTo(or,w);w[Pe]<--Rr;)w.subTo(or,w);}P!=null&&(w.drShiftTo(Bt,P),st!=yt&&l.ZERO.subTo(P,P)),w.t=Bt,w.clamp(),Pt>0&&w.rShiftTo(Pt,w),st<0&&l.ZERO.subTo(w,w);}}}function ft(a){var P=f();return this.abs().divRemTo(a,null,P),this.s<0&&P.compareTo(l.ZERO)>0&&a.subTo(P,P),P;}function gt(a){this.m=a;}function mt(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a;}function wt(a){return a;}function ht(a){a.divRemTo(this.m,null,a);}function Nt(a,P,w){a.multiplyTo(P,w),this.reduce(w);}function Rt(a,P){a.squareTo(P),this.reduce(P);}gt.prototype.convert=mt,gt.prototype.revert=wt,gt.prototype.reduce=ht,gt.prototype.mulTo=Nt,gt.prototype.sqrTo=Rt;function X(){if(this.t<1)return 0;var a=this[0];if(!(a&1))return 0;var P=a&3;return P=P*(2-(a&15)*P)&15,P=P*(2-(a&255)*P)&255,P=P*(2-((a&65535)*P&65535))&65535,P=P*(2-a*P%this.DV)%this.DV,P>0?this.DV-P:-P;}function z(a){this.m=a,this.mp=a.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<a.DB-15)-1,this.mt2=2*a.t;}function q(a){var P=f();return a.abs().dlShiftTo(this.m.t,P),P.divRemTo(this.m,null,P),a.s<0&&P.compareTo(l.ZERO)>0&&this.m.subTo(P,P),P;}function nt(a){var P=f();return a.copyTo(P),this.reduce(P),P;}function j(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var P=0;P<this.m.t;++P){var w=a[P]&32767,F=w*this.mpl+((w*this.mph+(a[P]>>15)*this.mpl&this.um)<<15)&a.DM;for(w=P+this.m.t,a[w]+=this.m.am(0,F,a,P,0,this.m.t);a[w]>=a.DV;)a[w]-=a.DV,a[++w]++;}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a);}function Z(a,P){a.squareTo(P),this.reduce(P);}function O(a,P,w){a.multiplyTo(P,w),this.reduce(w);}z.prototype.convert=q,z.prototype.revert=nt,z.prototype.reduce=j,z.prototype.mulTo=O,z.prototype.sqrTo=Z;function L(){return(this.t>0?this[0]&1:this.s)==0;}function $(a,P){if(a>4294967295||a<1)return l.ONE;var w=f(),F=f(),H=P.convert(this),_=Y(a)-1;for(H.copyTo(w);--_>=0;)if(P.sqrTo(w,F),(a&1<<_)>0)P.mulTo(F,H,w);else{var st=w;w=F,F=st;}return P.revert(w);}function V(a,P){var w;return a<256||P.isEven()?w=new gt(P):w=new z(P),this.exp(a,w);}l.prototype.copyTo=v,l.prototype.fromInt=p,l.prototype.fromString=A,l.prototype.clamp=R,l.prototype.dlShiftTo=N,l.prototype.drShiftTo=G,l.prototype.lShiftTo=J,l.prototype.rShiftTo=tt,l.prototype.subTo=at,l.prototype.multiplyTo=ut,l.prototype.squareTo=K,l.prototype.divRemTo=Q,l.prototype.invDigit=X,l.prototype.isEven=L,l.prototype.exp=$,l.prototype.toString=D,l.prototype.negate=U,l.prototype.abs=M,l.prototype.compareTo=W,l.prototype.bitLength=B,l.prototype.mod=ft,l.prototype.modPowInt=V,l.ZERO=S(0),l.ONE=S(1);function rt(){var a=f();return this.copyTo(a),a;}function it(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1;}else{if(this.t==1)return this[0];if(this.t==0)return 0;}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0];}function ct(){return this.t==0?this.s:this[0]<<24>>24;}function St(){return this.t==0?this.s:this[0]<<16>>16;}function Ct(a){return Math.floor(Math.LN2*this.DB/Math.log(a));}function Mt(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1;}function Dt(a){if(a==null&&(a=10),this.signum()==0||a<2||a>36)return"0";var P=this.chunkSize(a),w=Math.pow(a,P),F=S(w),H=f(),_=f(),st="";for(this.divRemTo(F,H,_);H.signum()>0;)st=(w+_.intValue()).toString(a).substr(1)+st,H.divRemTo(F,H,_);return _.intValue().toString(a)+st;}function At(a,P){this.fromInt(0),P==null&&(P=10);for(var w=this.chunkSize(P),F=Math.pow(P,w),H=!1,_=0,st=0,yt=0;yt<a.length;++yt){var Pt=d(a,yt);if(Pt<0){a.charAt(yt)=="-"&&this.signum()==0&&(H=!0);continue;}st=P*st+Pt,++_>=w&&(this.dMultiply(F),this.dAddOffset(st,0),_=0,st=0);}_>0&&(this.dMultiply(Math.pow(P,_)),this.dAddOffset(st,0)),H&&l.ZERO.subTo(this,this);}function Ot(a,P,w){if(typeof P=="number"){if(a<2)this.fromInt(1);else for(this.fromNumber(a,w),this.testBit(a-1)||this.bitwiseTo(l.ONE.shiftLeft(a-1),ne,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(P);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(l.ONE.shiftLeft(a-1),this);}else{var F=new Array(),H=a&7;F.length=(a>>3)+1,P.nextBytes(F),H>0?F[0]&=(1<<H)-1:F[0]=0,this.fromString(F,256);}}function Lt(){var a=this.t,P=new Array();P[0]=this.s;var w=this.DB-a*this.DB%8,F,H=0;if(a-->0)for(w<this.DB&&(F=this[a]>>w)!=(this.s&this.DM)>>w&&(P[H++]=F|this.s<<this.DB-w);a>=0;)w<8?(F=(this[a]&(1<<w)-1)<<8-w,F|=this[--a]>>(w+=this.DB-8)):(F=this[a]>>(w-=8)&255,w<=0&&(w+=this.DB,--a)),F&128&&(F|=-256),H==0&&(this.s&128)!=(F&128)&&++H,(H>0||F!=this.s)&&(P[H++]=F);return P;}function Yt(a){return this.compareTo(a)==0;}function zt(a){return this.compareTo(a)<0?this:a;}function Wt(a){return this.compareTo(a)>0?this:a;}function Qt(a,P,w){var F,H,_=Math.min(a.t,this.t);for(F=0;F<_;++F)w[F]=P(this[F],a[F]);if(a.t<this.t){for(H=a.s&this.DM,F=_;F<this.t;++F)w[F]=P(this[F],H);w.t=this.t;}else{for(H=this.s&this.DM,F=_;F<a.t;++F)w[F]=P(H,a[F]);w.t=a.t;}w.s=P(this.s,a.s),w.clamp();}function ue(a,P){return a&P;}function ie(a){var P=f();return this.bitwiseTo(a,ue,P),P;}function ne(a,P){return a|P;}function ae(a){var P=f();return this.bitwiseTo(a,ne,P),P;}function se(a,P){return a^P;}function je(a){var P=f();return this.bitwiseTo(a,se,P),P;}function We(a,P){return a&~P;}function Xe(a){var P=f();return this.bitwiseTo(a,We,P),P;}function Fe(){for(var a=f(),P=0;P<this.t;++P)a[P]=this.DM&~this[P];return a.t=this.t,a.s=~this.s,a;}function Ge(a){var P=f();return a<0?this.rShiftTo(-a,P):this.lShiftTo(a,P),P;}function Ke(a){var P=f();return a<0?this.lShiftTo(-a,P):this.rShiftTo(a,P),P;}function Je(a){if(a==0)return-1;var P=0;return a&65535||(a>>=16,P+=16),a&255||(a>>=8,P+=8),a&15||(a>>=4,P+=4),a&3||(a>>=2,P+=2),a&1||++P,P;}function Ie(){for(var a=0;a<this.t;++a)if(this[a]!=0)return a*this.DB+Je(this[a]);return this.s<0?this.t*this.DB:-1;}function cr(a){for(var P=0;a!=0;)a&=a-1,++P;return P;}function Kr(){for(var a=0,P=this.s&this.DM,w=0;w<this.t;++w)a+=cr(this[w]^P);return a;}function tn(a){var P=Math.floor(a/this.DB);return P>=this.t?this.s!=0:(this[P]&1<<a%this.DB)!=0;}function Gn(a,P){var w=l.ONE.shiftLeft(a);return this.bitwiseTo(w,P,w),w;}function Hn(a){return this.changeBit(a,ne);}function Oi(a){return this.changeBit(a,We);}function Co(a){return this.changeBit(a,se);}function wi(a,P){for(var w=0,F=0,H=Math.min(a.t,this.t);w<H;)F+=this[w]+a[w],P[w++]=F&this.DM,F>>=this.DB;if(a.t<this.t){for(F+=a.s;w<this.t;)F+=this[w],P[w++]=F&this.DM,F>>=this.DB;F+=this.s;}else{for(F+=this.s;w<a.t;)F+=a[w],P[w++]=F&this.DM,F>>=this.DB;F+=a.s;}P.s=F<0?-1:0,F>0?P[w++]=F:F<-1&&(P[w++]=this.DV+F),P.t=w,P.clamp();}function Io(a){var P=f();return this.addTo(a,P),P;}function Oo(a){var P=f();return this.subTo(a,P),P;}function wo(a){var P=f();return this.multiplyTo(a,P),P;}function Ao(){var a=f();return this.squareTo(a),a;}function Eo(a){var P=f();return this.divRemTo(a,P,null),P;}function Mo(a){var P=f();return this.divRemTo(a,null,P),P;}function Lo(a){var P=f(),w=f();return this.divRemTo(a,P,w),new Array(P,w);}function Ro(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp();}function _i(a,P){if(a!=0){for(;this.t<=P;)this[this.t++]=0;for(this[P]+=a;this[P]>=this.DV;)this[P]-=this.DV,++P>=this.t&&(this[this.t++]=0),++this[P];}}function Rn(){}function ts(a){return a;}function bo(a,P,w){a.multiplyTo(P,w);}function Do(a,P){a.squareTo(P);}Rn.prototype.convert=ts,Rn.prototype.revert=ts,Rn.prototype.mulTo=bo,Rn.prototype.sqrTo=Do;function No(a){return this.exp(a,new Rn());}function Bo(a,P,w){var F=Math.min(this.t+a.t,P);for(w.s=0,w.t=F;F>0;)w[--F]=0;var H;for(H=w.t-this.t;F<H;++F)w[F+this.t]=this.am(0,a[F],w,F,0,this.t);for(H=Math.min(a.t,P);F<H;++F)this.am(0,a[F],w,F,0,P-F);w.clamp();}function kn(a,P,w){--P;var F=w.t=this.t+a.t-P;for(w.s=0;--F>=0;)w[F]=0;for(F=Math.max(P-this.t,0);F<a.t;++F)w[this.t+F-P]=this.am(P-F,a[F],w,0,0,this.t+F-P);w.clamp(),w.drShiftTo(1,w);}function vn(a){this.r2=f(),this.q3=f(),l.ONE.dlShiftTo(2*a.t,this.r2),this.mu=this.r2.divide(a),this.m=a;}function Kn(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var P=f();return a.copyTo(P),this.reduce(P),P;}function Wo(a){return a;}function Fo(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a);}function Uo(a,P){a.squareTo(P),this.reduce(P);}function es(a,P,w){a.multiplyTo(P,w),this.reduce(w);}vn.prototype.convert=Kn,vn.prototype.revert=Wo,vn.prototype.reduce=Fo,vn.prototype.mulTo=es,vn.prototype.sqrTo=Uo;function rs(a,P){var w=a.bitLength(),F,H=S(1),_;if(w<=0)return H;w<18?F=1:w<48?F=3:w<144?F=4:w<768?F=5:F=6,w<8?_=new gt(P):P.isEven()?_=new vn(P):_=new z(P);var st=new Array(),yt=3,Pt=F-1,Bt=(1<<F)-1;if(st[1]=_.convert(this),F>1){var kt=f();for(_.sqrTo(st[1],kt);yt<=Bt;)st[yt]=f(),_.mulTo(kt,st[yt-2],st[yt]),yt+=2;}var jt=a.t-1,qt,oe=!0,me=f(),Pe;for(w=Y(a[jt])-1;jt>=0;){for(w>=Pt?qt=a[jt]>>w-Pt&Bt:(qt=(a[jt]&(1<<w+1)-1)<<Pt-w,jt>0&&(qt|=a[jt-1]>>this.DB+w-Pt)),yt=F;!(qt&1);)qt>>=1,--yt;if((w-=yt)<0&&(w+=this.DB,--jt),oe)st[qt].copyTo(H),oe=!1;else{for(;yt>1;)_.sqrTo(H,me),_.sqrTo(me,H),yt-=2;yt>0?_.sqrTo(H,me):(Pe=H,H=me,me=Pe),_.mulTo(me,st[qt],H);}for(;jt>=0&&!(a[jt]&1<<w);)_.sqrTo(H,me),Pe=H,H=me,me=Pe,--w<0&&(w=this.DB-1,--jt);}return _.revert(H);}function ns(a){var P=this.s<0?this.negate():this.clone(),w=a.s<0?a.negate():a.clone();if(P.compareTo(w)<0){var F=P;P=w,w=F;}var H=P.getLowestSetBit(),_=w.getLowestSetBit();if(_<0)return P;for(H<_&&(_=H),_>0&&(P.rShiftTo(_,P),w.rShiftTo(_,w));P.signum()>0;)(H=P.getLowestSetBit())>0&&P.rShiftTo(H,P),(H=w.getLowestSetBit())>0&&w.rShiftTo(H,w),P.compareTo(w)>=0?(P.subTo(w,P),P.rShiftTo(1,P)):(w.subTo(P,w),w.rShiftTo(1,w));return _>0&&w.lShiftTo(_,w),w;}function Yo(a){if(a<=0)return 0;var P=this.DV%a,w=this.s<0?a-1:0;if(this.t>0)if(P==0)w=this[0]%a;else for(var F=this.t-1;F>=0;--F)w=(P*w+this[F])%a;return w;}function Xo(a){var P=a.isEven();if(this.isEven()&&P||a.signum()==0)return l.ZERO;for(var w=a.clone(),F=this.clone(),H=S(1),_=S(0),st=S(0),yt=S(1);w.signum()!=0;){for(;w.isEven();)w.rShiftTo(1,w),P?((!H.isEven()||!_.isEven())&&(H.addTo(this,H),_.subTo(a,_)),H.rShiftTo(1,H)):_.isEven()||_.subTo(a,_),_.rShiftTo(1,_);for(;F.isEven();)F.rShiftTo(1,F),P?((!st.isEven()||!yt.isEven())&&(st.addTo(this,st),yt.subTo(a,yt)),st.rShiftTo(1,st)):yt.isEven()||yt.subTo(a,yt),yt.rShiftTo(1,yt);w.compareTo(F)>=0?(w.subTo(F,w),P&&H.subTo(st,H),_.subTo(yt,_)):(F.subTo(w,F),P&&st.subTo(H,st),yt.subTo(_,yt));}if(F.compareTo(l.ONE)!=0)return l.ZERO;if(yt.compareTo(a)>=0)return yt.subtract(a);if(yt.signum()<0)yt.addTo(a,yt);else return yt;return yt.signum()<0?yt.add(a):yt;}var nr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],zo=(1<<26)/nr[nr.length-1];function is(a){var P,w=this.abs();if(w.t==1&&w[0]<=nr[nr.length-1]){for(P=0;P<nr.length;++P)if(w[0]==nr[P])return!0;return!1;}if(w.isEven())return!1;for(P=1;P<nr.length;){for(var F=nr[P],H=P+1;H<nr.length&&F<zo;)F*=nr[H++];for(F=w.modInt(F);P<H;)if(F%nr[P++]==0)return!1;}return w.millerRabin(a);}function ss(a){var P=this.subtract(l.ONE),w=P.getLowestSetBit();if(w<=0)return!1;var F=P.shiftRight(w);a=a+1>>1,a>nr.length&&(a=nr.length);for(var H=f(),_=0;_<a;++_){H.fromInt(nr[Math.floor(Math.random()*nr.length)]);var st=H.modPow(F,this);if(st.compareTo(l.ONE)!=0&&st.compareTo(P)!=0){for(var yt=1;yt++<w&&st.compareTo(P)!=0;)if(st=st.modPowInt(2,this),st.compareTo(l.ONE)==0)return!1;if(st.compareTo(P)!=0)return!1;}}return!0;}l.prototype.chunkSize=Ct,l.prototype.toRadix=Dt,l.prototype.fromRadix=At,l.prototype.fromNumber=Ot,l.prototype.bitwiseTo=Qt,l.prototype.changeBit=Gn,l.prototype.addTo=wi,l.prototype.dMultiply=Ro,l.prototype.dAddOffset=_i,l.prototype.multiplyLowerTo=Bo,l.prototype.multiplyUpperTo=kn,l.prototype.modInt=Yo,l.prototype.millerRabin=ss,l.prototype.clone=rt,l.prototype.intValue=it,l.prototype.byteValue=ct,l.prototype.shortValue=St,l.prototype.signum=Mt,l.prototype.toByteArray=Lt,l.prototype.equals=Yt,l.prototype.min=zt,l.prototype.max=Wt,l.prototype.and=ie,l.prototype.or=ae,l.prototype.xor=je,l.prototype.andNot=Xe,l.prototype.not=Fe,l.prototype.shiftLeft=Ge,l.prototype.shiftRight=Ke,l.prototype.getLowestSetBit=Ie,l.prototype.bitCount=Kr,l.prototype.testBit=tn,l.prototype.setBit=Hn,l.prototype.clearBit=Oi,l.prototype.flipBit=Co,l.prototype.add=Io,l.prototype.subtract=Oo,l.prototype.multiply=wo,l.prototype.divide=Eo,l.prototype.remainder=Mo,l.prototype.divideAndRemainder=Lo,l.prototype.modPow=rs,l.prototype.modInverse=Xo,l.prototype.pow=No,l.prototype.gcd=ns,l.prototype.isProbablePrime=is,l.prototype.square=Ao;var ge=l;ge.prototype.IsNegative=function(){return this.compareTo(ge.ZERO)==-1;},ge.op_Equality=function(a,P){return a.compareTo(P)==0;},ge.op_Inequality=function(a,P){return a.compareTo(P)!=0;},ge.op_GreaterThan=function(a,P){return a.compareTo(P)>0;},ge.op_LessThan=function(a,P){return a.compareTo(P)<0;},ge.op_Addition=function(a,P){return new ge(a,void 0,void 0).add(new ge(P,void 0,void 0));},ge.op_Subtraction=function(a,P){return new ge(a,void 0,void 0).subtract(new ge(P,void 0,void 0));},ge.Int128Mul=function(a,P){return new ge(a,void 0,void 0).multiply(new ge(P,void 0,void 0));},ge.op_Division=function(a,P){return a.divide(P);},ge.prototype.ToDouble=function(){return parseFloat(this.toString());};var Vn=function Vn(a,P){var w;if(_typeof(Object.getOwnPropertyNames)>"u"){for(w in P.prototype)(_typeof(a.prototype[w])>"u"||a.prototype[w]===Object.prototype[w])&&(a.prototype[w]=P.prototype[w]);for(w in P)_typeof(a[w])>"u"&&(a[w]=P[w]);a.$baseCtor=P;}else{for(var F=Object.getOwnPropertyNames(P.prototype),H=0;H<F.length;H++)_typeof(Object.getOwnPropertyDescriptor(a.prototype,F[H]))>"u"&&Object.defineProperty(a.prototype,F[H],Object.getOwnPropertyDescriptor(P.prototype,F[H]));for(w in P)_typeof(a[w])>"u"&&(a[w]=P[w]);a.$baseCtor=P;}};e.Path=function(){return[];},e.Path.prototype.push=Array.prototype.push,e.Paths=function(){return[];},e.Paths.prototype.push=Array.prototype.push,e.DoublePoint=function(){var a=arguments;this.X=0,this.Y=0,a.length===1?(this.X=a[0].X,this.Y=a[0].Y):a.length===2&&(this.X=a[0],this.Y=a[1]);},e.DoublePoint0=function(){this.X=0,this.Y=0;},e.DoublePoint0.prototype=e.DoublePoint.prototype,e.DoublePoint1=function(a){this.X=a.X,this.Y=a.Y;},e.DoublePoint1.prototype=e.DoublePoint.prototype,e.DoublePoint2=function(a,P){this.X=a,this.Y=P;},e.DoublePoint2.prototype=e.DoublePoint.prototype,e.PolyNode=function(){this.m_Parent=null,this.m_polygon=new e.Path(),this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1;},e.PolyNode.prototype.IsHoleNode=function(){for(var a=!0,P=this.m_Parent;P!==null;)a=!a,P=P.m_Parent;return a;},e.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length;},e.PolyNode.prototype.Contour=function(){return this.m_polygon;},e.PolyNode.prototype.AddChild=function(a){var P=this.m_Childs.length;this.m_Childs.push(a),a.m_Parent=this,a.m_Index=P;},e.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp();},e.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index===this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1];},e.PolyNode.prototype.Childs=function(){return this.m_Childs;},e.PolyNode.prototype.Parent=function(){return this.m_Parent;},e.PolyNode.prototype.IsHole=function(){return this.IsHoleNode();},e.PolyTree=function(){this.m_AllPolys=[],e.PolyNode.call(this);},e.PolyTree.prototype.Clear=function(){for(var a=0,P=this.m_AllPolys.length;a<P;a++)this.m_AllPolys[a]=null;this.m_AllPolys.length=0,this.m_Childs.length=0;},e.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null;},e.PolyTree.prototype.Total=function(){var a=this.m_AllPolys.length;return a>0&&this.m_Childs[0]!==this.m_AllPolys[0]&&a--,a;},Vn(e.PolyTree,e.PolyNode),e.Math_Abs_Int64=e.Math_Abs_Int32=e.Math_Abs_Double=function(a){return Math.abs(a);},e.Math_Max_Int32_Int32=function(a,P){return Math.max(a,P);},s.msie||s.opera||s.safari?e.Cast_Int32=function(a){return a|0;}:e.Cast_Int32=function(a){return~~a;},_typeof(Number.toInteger)>"u"&&(Number.toInteger=null),s.chrome?e.Cast_Int64=function(a){return a<-2147483648||a>2147483647?a<0?Math.ceil(a):Math.floor(a):~~a;}:s.firefox&&typeof Number.toInteger=="function"?e.Cast_Int64=function(a){return Number.toInteger(a);}:s.msie7||s.msie8?e.Cast_Int64=function(a){return parseInt(a,10);}:s.msie?e.Cast_Int64=function(a){return a<-2147483648||a>2147483647?a<0?Math.ceil(a):Math.floor(a):a|0;}:e.Cast_Int64=function(a){return a<0?Math.ceil(a):Math.floor(a);},e.Clear=function(a){a.length=0;},e.PI=3.141592653589793,e.PI2=2*3.141592653589793,e.IntPoint=function(){var a=arguments,P=a.length;if(this.X=0,this.Y=0,e.use_xyz){if(this.Z=0,P===3)this.X=a[0],this.Y=a[1],this.Z=a[2];else if(P===2)this.X=a[0],this.Y=a[1],this.Z=0;else if(P===1){if(a[0]instanceof e.DoublePoint){var w=a[0];this.X=e.Clipper.Round(w.X),this.Y=e.Clipper.Round(w.Y),this.Z=0;}else{var F=a[0];_typeof(F.Z)>"u"&&(F.Z=0),this.X=F.X,this.Y=F.Y,this.Z=F.Z;}}else this.X=0,this.Y=0,this.Z=0;}else if(P===2)this.X=a[0],this.Y=a[1];else if(P===1){if(a[0]instanceof e.DoublePoint){var w=a[0];this.X=e.Clipper.Round(w.X),this.Y=e.Clipper.Round(w.Y);}else{var F=a[0];this.X=F.X,this.Y=F.Y;}}else this.X=0,this.Y=0;},e.IntPoint.op_Equality=function(a,P){return a.X===P.X&&a.Y===P.Y;},e.IntPoint.op_Inequality=function(a,P){return a.X!==P.X||a.Y!==P.Y;},e.IntPoint0=function(){this.X=0,this.Y=0,e.use_xyz&&(this.Z=0);},e.IntPoint0.prototype=e.IntPoint.prototype,e.IntPoint1=function(a){this.X=a.X,this.Y=a.Y,e.use_xyz&&(_typeof(a.Z)>"u"?this.Z=0:this.Z=a.Z);},e.IntPoint1.prototype=e.IntPoint.prototype,e.IntPoint1dp=function(a){this.X=e.Clipper.Round(a.X),this.Y=e.Clipper.Round(a.Y),e.use_xyz&&(this.Z=0);},e.IntPoint1dp.prototype=e.IntPoint.prototype,e.IntPoint2=function(a,P,w){this.X=a,this.Y=P,e.use_xyz&&(_typeof(w)>"u"?this.Z=0:this.Z=w);},e.IntPoint2.prototype=e.IntPoint.prototype,e.IntRect=function(){var a=arguments,P=a.length;if(P===4)this.left=a[0],this.top=a[1],this.right=a[2],this.bottom=a[3];else if(P===1){var w=a[0];this.left=w.left,this.top=w.top,this.right=w.right,this.bottom=w.bottom;}else this.left=0,this.top=0,this.right=0,this.bottom=0;},e.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0;},e.IntRect0.prototype=e.IntRect.prototype,e.IntRect1=function(a){this.left=a.left,this.top=a.top,this.right=a.right,this.bottom=a.bottom;},e.IntRect1.prototype=e.IntRect.prototype,e.IntRect4=function(a,P,w,F){this.left=a,this.top=P,this.right=w,this.bottom=F;},e.IntRect4.prototype=e.IntRect.prototype,e.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3},e.PolyType={ptSubject:0,ptClip:1},e.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3},e.JoinType={jtSquare:0,jtRound:1,jtMiter:2},e.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4},e.EdgeSide={esLeft:0,esRight:1},e.Direction={dRightToLeft:0,dLeftToRight:1},e.TEdge=function(){this.Bot=new e.IntPoint0(),this.Curr=new e.IntPoint0(),this.Top=new e.IntPoint0(),this.Delta=new e.IntPoint0(),this.Dx=0,this.PolyTyp=e.PolyType.ptSubject,this.Side=e.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null;},e.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new e.IntPoint0();},e.MyIntersectNodeSort=function(){},e.MyIntersectNodeSort.Compare=function(a,P){var w=P.Pt.Y-a.Pt.Y;return w>0?1:w<0?-1:0;},e.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null;},e.Scanbeam=function(){this.Y=0,this.Next=null;},e.Maxima=function(){this.X=0,this.Next=null,this.Prev=null;},e.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null;},e.OutPt=function(){this.Idx=0,this.Pt=new e.IntPoint0(),this.Next=null,this.Prev=null;},e.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new e.IntPoint0();},e.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array(),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_Scanbeam=null,this.m_PolyOuts=null,this.m_ActiveEdges=null;},e.ClipperBase.horizontal=-9007199254740992,e.ClipperBase.Skip=-2,e.ClipperBase.Unassigned=-1,e.ClipperBase.tolerance=1e-20,e.ClipperBase.loRange=47453132,e.ClipperBase.hiRange=4503599627370495,e.ClipperBase.near_zero=function(a){return a>-e.ClipperBase.tolerance&&a<e.ClipperBase.tolerance;},e.ClipperBase.IsHorizontal=function(a){return a.Delta.Y===0;},e.ClipperBase.prototype.PointIsVertex=function(a,P){var w=P;do{if(e.IntPoint.op_Equality(w.Pt,a))return!0;w=w.Next;}while(w!==P);return!1;},e.ClipperBase.prototype.PointOnLineSegment=function(a,P,w,F){return F?a.X===P.X&&a.Y===P.Y||a.X===w.X&&a.Y===w.Y||a.X>P.X==a.X<w.X&&a.Y>P.Y==a.Y<w.Y&&ge.op_Equality(ge.Int128Mul(a.X-P.X,w.Y-P.Y),ge.Int128Mul(w.X-P.X,a.Y-P.Y)):a.X===P.X&&a.Y===P.Y||a.X===w.X&&a.Y===w.Y||a.X>P.X==a.X<w.X&&a.Y>P.Y==a.Y<w.Y&&(a.X-P.X)*(w.Y-P.Y)===(w.X-P.X)*(a.Y-P.Y);},e.ClipperBase.prototype.PointOnPolygon=function(a,P,w){for(var F=P;;){if(this.PointOnLineSegment(a,F.Pt,F.Next.Pt,w))return!0;if(F=F.Next,F===P)break;}return!1;},e.ClipperBase.prototype.SlopesEqual=e.ClipperBase.SlopesEqual=function(){var a=arguments,P=a.length,w,F,H,_,st,yt,Pt;return P===3?(w=a[0],F=a[1],Pt=a[2],Pt?ge.op_Equality(ge.Int128Mul(w.Delta.Y,F.Delta.X),ge.Int128Mul(w.Delta.X,F.Delta.Y)):e.Cast_Int64(w.Delta.Y*F.Delta.X)===e.Cast_Int64(w.Delta.X*F.Delta.Y)):P===4?(H=a[0],_=a[1],st=a[2],Pt=a[3],Pt?ge.op_Equality(ge.Int128Mul(H.Y-_.Y,_.X-st.X),ge.Int128Mul(H.X-_.X,_.Y-st.Y)):e.Cast_Int64((H.Y-_.Y)*(_.X-st.X))-e.Cast_Int64((H.X-_.X)*(_.Y-st.Y))===0):(H=a[0],_=a[1],st=a[2],yt=a[3],Pt=a[4],Pt?ge.op_Equality(ge.Int128Mul(H.Y-_.Y,st.X-yt.X),ge.Int128Mul(H.X-_.X,st.Y-yt.Y)):e.Cast_Int64((H.Y-_.Y)*(st.X-yt.X))-e.Cast_Int64((H.X-_.X)*(st.Y-yt.Y))===0);},e.ClipperBase.SlopesEqual3=function(a,P,w){return w?ge.op_Equality(ge.Int128Mul(a.Delta.Y,P.Delta.X),ge.Int128Mul(a.Delta.X,P.Delta.Y)):e.Cast_Int64(a.Delta.Y*P.Delta.X)===e.Cast_Int64(a.Delta.X*P.Delta.Y);},e.ClipperBase.SlopesEqual4=function(a,P,w,F){return F?ge.op_Equality(ge.Int128Mul(a.Y-P.Y,P.X-w.X),ge.Int128Mul(a.X-P.X,P.Y-w.Y)):e.Cast_Int64((a.Y-P.Y)*(P.X-w.X))-e.Cast_Int64((a.X-P.X)*(P.Y-w.Y))===0;},e.ClipperBase.SlopesEqual5=function(a,P,w,F,H){return H?ge.op_Equality(ge.Int128Mul(a.Y-P.Y,w.X-F.X),ge.Int128Mul(a.X-P.X,w.Y-F.Y)):e.Cast_Int64((a.Y-P.Y)*(w.X-F.X))-e.Cast_Int64((a.X-P.X)*(w.Y-F.Y))===0;},e.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var a=0,P=this.m_edges.length;a<P;++a){for(var w=0,F=this.m_edges[a].length;w<F;++w)this.m_edges[a][w]=null;e.Clear(this.m_edges[a]);}e.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1;},e.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var a=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=a;}this.m_CurrentLM=null;},e.ClipperBase.prototype.RangeTest=function(a,P){P.Value?(a.X>e.ClipperBase.hiRange||a.Y>e.ClipperBase.hiRange||-a.X>e.ClipperBase.hiRange||-a.Y>e.ClipperBase.hiRange)&&e.Error("Coordinate outside allowed range in RangeTest()."):(a.X>e.ClipperBase.loRange||a.Y>e.ClipperBase.loRange||-a.X>e.ClipperBase.loRange||-a.Y>e.ClipperBase.loRange)&&(P.Value=!0,this.RangeTest(a,P));},e.ClipperBase.prototype.InitEdge=function(a,P,w,F){a.Next=P,a.Prev=w,a.Curr.X=F.X,a.Curr.Y=F.Y,e.use_xyz&&(a.Curr.Z=F.Z),a.OutIdx=-1;},e.ClipperBase.prototype.InitEdge2=function(a,P){a.Curr.Y>=a.Next.Curr.Y?(a.Bot.X=a.Curr.X,a.Bot.Y=a.Curr.Y,e.use_xyz&&(a.Bot.Z=a.Curr.Z),a.Top.X=a.Next.Curr.X,a.Top.Y=a.Next.Curr.Y,e.use_xyz&&(a.Top.Z=a.Next.Curr.Z)):(a.Top.X=a.Curr.X,a.Top.Y=a.Curr.Y,e.use_xyz&&(a.Top.Z=a.Curr.Z),a.Bot.X=a.Next.Curr.X,a.Bot.Y=a.Next.Curr.Y,e.use_xyz&&(a.Bot.Z=a.Next.Curr.Z)),this.SetDx(a),a.PolyTyp=P;},e.ClipperBase.prototype.FindNextLocMin=function(a){for(var P;;){for(;e.IntPoint.op_Inequality(a.Bot,a.Prev.Bot)||e.IntPoint.op_Equality(a.Curr,a.Top);)a=a.Next;if(a.Dx!==e.ClipperBase.horizontal&&a.Prev.Dx!==e.ClipperBase.horizontal)break;for(;a.Prev.Dx===e.ClipperBase.horizontal;)a=a.Prev;for(P=a;a.Dx===e.ClipperBase.horizontal;)a=a.Next;if(a.Top.Y!==a.Prev.Bot.Y){P.Prev.Bot.X<a.Bot.X&&(a=P);break;}}return a;},e.ClipperBase.prototype.ProcessBound=function(a,P){var w,F=a,H;if(F.OutIdx===e.ClipperBase.Skip){if(a=F,P){for(;a.Top.Y===a.Next.Bot.Y;)a=a.Next;for(;a!==F&&a.Dx===e.ClipperBase.horizontal;)a=a.Prev;}else{for(;a.Top.Y===a.Prev.Bot.Y;)a=a.Prev;for(;a!==F&&a.Dx===e.ClipperBase.horizontal;)a=a.Next;}if(a===F)P?F=a.Next:F=a.Prev;else{P?a=F.Next:a=F.Prev;var _=new e.LocalMinima();_.Next=null,_.Y=a.Bot.Y,_.LeftBound=null,_.RightBound=a,a.WindDelta=0,F=this.ProcessBound(a,P),this.InsertLocalMinima(_);}return F;}if(a.Dx===e.ClipperBase.horizontal&&(P?w=a.Prev:w=a.Next,w.Dx===e.ClipperBase.horizontal?w.Bot.X!==a.Bot.X&&w.Top.X!==a.Bot.X&&this.ReverseHorizontal(a):w.Bot.X!==a.Bot.X&&this.ReverseHorizontal(a)),w=a,P){for(;F.Top.Y===F.Next.Bot.Y&&F.Next.OutIdx!==e.ClipperBase.Skip;)F=F.Next;if(F.Dx===e.ClipperBase.horizontal&&F.Next.OutIdx!==e.ClipperBase.Skip){for(H=F;H.Prev.Dx===e.ClipperBase.horizontal;)H=H.Prev;H.Prev.Top.X>F.Next.Top.X&&(F=H.Prev);}for(;a!==F;)a.NextInLML=a.Next,a.Dx===e.ClipperBase.horizontal&&a!==w&&a.Bot.X!==a.Prev.Top.X&&this.ReverseHorizontal(a),a=a.Next;a.Dx===e.ClipperBase.horizontal&&a!==w&&a.Bot.X!==a.Prev.Top.X&&this.ReverseHorizontal(a),F=F.Next;}else{for(;F.Top.Y===F.Prev.Bot.Y&&F.Prev.OutIdx!==e.ClipperBase.Skip;)F=F.Prev;if(F.Dx===e.ClipperBase.horizontal&&F.Prev.OutIdx!==e.ClipperBase.Skip){for(H=F;H.Next.Dx===e.ClipperBase.horizontal;)H=H.Next;(H.Next.Top.X===F.Prev.Top.X||H.Next.Top.X>F.Prev.Top.X)&&(F=H.Next);}for(;a!==F;)a.NextInLML=a.Prev,a.Dx===e.ClipperBase.horizontal&&a!==w&&a.Bot.X!==a.Next.Top.X&&this.ReverseHorizontal(a),a=a.Prev;a.Dx===e.ClipperBase.horizontal&&a!==w&&a.Bot.X!==a.Next.Top.X&&this.ReverseHorizontal(a),F=F.Prev;}return F;},e.ClipperBase.prototype.AddPath=function(a,P,w){e.use_lines?!w&&P===e.PolyType.ptClip&&e.Error("AddPath: Open paths must be subject."):w||e.Error("AddPath: Open paths have been disabled.");var F=a.length-1;if(w)for(;F>0&&e.IntPoint.op_Equality(a[F],a[0]);)--F;for(;F>0&&e.IntPoint.op_Equality(a[F],a[F-1]);)--F;if(w&&F<2||!w&&F<1)return!1;for(var H=new Array(),_=0;_<=F;_++)H.push(new e.TEdge());var st=!0;H[1].Curr.X=a[1].X,H[1].Curr.Y=a[1].Y,e.use_xyz&&(H[1].Curr.Z=a[1].Z);var yt={Value:this.m_UseFullRange};this.RangeTest(a[0],yt),this.m_UseFullRange=yt.Value,yt.Value=this.m_UseFullRange,this.RangeTest(a[F],yt),this.m_UseFullRange=yt.Value,this.InitEdge(H[0],H[1],H[F],a[0]),this.InitEdge(H[F],H[0],H[F-1],a[F]);for(var _=F-1;_>=1;--_)yt.Value=this.m_UseFullRange,this.RangeTest(a[_],yt),this.m_UseFullRange=yt.Value,this.InitEdge(H[_],H[_+1],H[_-1],a[_]);for(var Pt=H[0],Bt=Pt,kt=Pt;;){if(Bt.Curr===Bt.Next.Curr&&(w||Bt.Next!==Pt)){if(Bt===Bt.Next)break;Bt===Pt&&(Pt=Bt.Next),Bt=this.RemoveEdge(Bt),kt=Bt;continue;}if(Bt.Prev===Bt.Next)break;if(w&&e.ClipperBase.SlopesEqual4(Bt.Prev.Curr,Bt.Curr,Bt.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(Bt.Prev.Curr,Bt.Curr,Bt.Next.Curr))){Bt===Pt&&(Pt=Bt.Next),Bt=this.RemoveEdge(Bt),Bt=Bt.Prev,kt=Bt;continue;}if(Bt=Bt.Next,Bt===kt||!w&&Bt.Next===Pt)break;}if(!w&&Bt===Bt.Next||w&&Bt.Prev===Bt.Next)return!1;w||(this.m_HasOpenPaths=!0,Pt.Prev.OutIdx=e.ClipperBase.Skip),Bt=Pt;do this.InitEdge2(Bt,P),Bt=Bt.Next,st&&Bt.Curr.Y!==Pt.Curr.Y&&(st=!1);while(Bt!==Pt);if(st){if(w)return!1;Bt.Prev.OutIdx=e.ClipperBase.Skip;var jt=new e.LocalMinima();for(jt.Next=null,jt.Y=Bt.Bot.Y,jt.LeftBound=null,jt.RightBound=Bt,jt.RightBound.Side=e.EdgeSide.esRight,jt.RightBound.WindDelta=0;Bt.Bot.X!==Bt.Prev.Top.X&&this.ReverseHorizontal(Bt),Bt.Next.OutIdx!==e.ClipperBase.Skip;)Bt.NextInLML=Bt.Next,Bt=Bt.Next;return this.InsertLocalMinima(jt),this.m_edges.push(H),!0;}this.m_edges.push(H);var qt,oe=null;for(e.IntPoint.op_Equality(Bt.Prev.Bot,Bt.Prev.Top)&&(Bt=Bt.Next);Bt=this.FindNextLocMin(Bt),Bt!==oe;){oe===null&&(oe=Bt);var jt=new e.LocalMinima();jt.Next=null,jt.Y=Bt.Bot.Y,Bt.Dx<Bt.Prev.Dx?(jt.LeftBound=Bt.Prev,jt.RightBound=Bt,qt=!1):(jt.LeftBound=Bt,jt.RightBound=Bt.Prev,qt=!0),jt.LeftBound.Side=e.EdgeSide.esLeft,jt.RightBound.Side=e.EdgeSide.esRight,w?jt.LeftBound.Next===jt.RightBound?jt.LeftBound.WindDelta=-1:jt.LeftBound.WindDelta=1:jt.LeftBound.WindDelta=0,jt.RightBound.WindDelta=-jt.LeftBound.WindDelta,Bt=this.ProcessBound(jt.LeftBound,qt),Bt.OutIdx===e.ClipperBase.Skip&&(Bt=this.ProcessBound(Bt,qt));var me=this.ProcessBound(jt.RightBound,!qt);me.OutIdx===e.ClipperBase.Skip&&(me=this.ProcessBound(me,!qt)),jt.LeftBound.OutIdx===e.ClipperBase.Skip?jt.LeftBound=null:jt.RightBound.OutIdx===e.ClipperBase.Skip&&(jt.RightBound=null),this.InsertLocalMinima(jt),qt||(Bt=me);}return!0;},e.ClipperBase.prototype.AddPaths=function(a,P,w){for(var F=!1,H=0,_=a.length;H<_;++H)this.AddPath(a[H],P,w)&&(F=!0);return F;},e.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(a,P,w){return e.IntPoint.op_Equality(a,w)||e.IntPoint.op_Equality(a,P)||e.IntPoint.op_Equality(w,P)?!1:a.X!==w.X?P.X>a.X==P.X<w.X:P.Y>a.Y==P.Y<w.Y;},e.ClipperBase.prototype.RemoveEdge=function(a){a.Prev.Next=a.Next,a.Next.Prev=a.Prev;var P=a.Next;return a.Prev=null,P;},e.ClipperBase.prototype.SetDx=function(a){a.Delta.X=a.Top.X-a.Bot.X,a.Delta.Y=a.Top.Y-a.Bot.Y,a.Delta.Y===0?a.Dx=e.ClipperBase.horizontal:a.Dx=a.Delta.X/a.Delta.Y;},e.ClipperBase.prototype.InsertLocalMinima=function(a){if(this.m_MinimaList===null)this.m_MinimaList=a;else if(a.Y>=this.m_MinimaList.Y)a.Next=this.m_MinimaList,this.m_MinimaList=a;else{for(var P=this.m_MinimaList;P.Next!==null&&a.Y<P.Next.Y;)P=P.Next;a.Next=P.Next,P.Next=a;}},e.ClipperBase.prototype.PopLocalMinima=function(a,P){return P.v=this.m_CurrentLM,this.m_CurrentLM!==null&&this.m_CurrentLM.Y===a?(this.m_CurrentLM=this.m_CurrentLM.Next,!0):!1;},e.ClipperBase.prototype.ReverseHorizontal=function(a){var P=a.Top.X;a.Top.X=a.Bot.X,a.Bot.X=P,e.use_xyz&&(P=a.Top.Z,a.Top.Z=a.Bot.Z,a.Bot.Z=P);},e.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!==null){this.m_Scanbeam=null;for(var a=this.m_MinimaList;a!==null;){this.InsertScanbeam(a.Y);var P=a.LeftBound;P!==null&&(P.Curr.X=P.Bot.X,P.Curr.Y=P.Bot.Y,e.use_xyz&&(P.Curr.Z=P.Bot.Z),P.OutIdx=e.ClipperBase.Unassigned),P=a.RightBound,P!==null&&(P.Curr.X=P.Bot.X,P.Curr.Y=P.Bot.Y,e.use_xyz&&(P.Curr.Z=P.Bot.Z),P.OutIdx=e.ClipperBase.Unassigned),a=a.Next;}this.m_ActiveEdges=null;}},e.ClipperBase.prototype.InsertScanbeam=function(a){if(this.m_Scanbeam===null)this.m_Scanbeam=new e.Scanbeam(),this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=a;else if(a>this.m_Scanbeam.Y){var P=new e.Scanbeam();P.Y=a,P.Next=this.m_Scanbeam,this.m_Scanbeam=P;}else{for(var w=this.m_Scanbeam;w.Next!==null&&a<=w.Next.Y;)w=w.Next;if(a===w.Y)return;var F=new e.Scanbeam();F.Y=a,F.Next=w.Next,w.Next=F;}},e.ClipperBase.prototype.PopScanbeam=function(a){return this.m_Scanbeam===null?(a.v=0,!1):(a.v=this.m_Scanbeam.Y,this.m_Scanbeam=this.m_Scanbeam.Next,!0);},e.ClipperBase.prototype.LocalMinimaPending=function(){return this.m_CurrentLM!==null;},e.ClipperBase.prototype.CreateOutRec=function(){var a=new e.OutRec();return a.Idx=e.ClipperBase.Unassigned,a.IsHole=!1,a.IsOpen=!1,a.FirstLeft=null,a.Pts=null,a.BottomPt=null,a.PolyNode=null,this.m_PolyOuts.push(a),a.Idx=this.m_PolyOuts.length-1,a;},e.ClipperBase.prototype.DisposeOutRec=function(a){var P=this.m_PolyOuts[a];P.Pts=null,P=null,this.m_PolyOuts[a]=null;},e.ClipperBase.prototype.UpdateEdgeIntoAEL=function(a){a.NextInLML===null&&e.Error("UpdateEdgeIntoAEL: invalid call");var P=a.PrevInAEL,w=a.NextInAEL;return a.NextInLML.OutIdx=a.OutIdx,P!==null?P.NextInAEL=a.NextInLML:this.m_ActiveEdges=a.NextInLML,w!==null&&(w.PrevInAEL=a.NextInLML),a.NextInLML.Side=a.Side,a.NextInLML.WindDelta=a.WindDelta,a.NextInLML.WindCnt=a.WindCnt,a.NextInLML.WindCnt2=a.WindCnt2,a=a.NextInLML,a.Curr.X=a.Bot.X,a.Curr.Y=a.Bot.Y,a.PrevInAEL=P,a.NextInAEL=w,e.ClipperBase.IsHorizontal(a)||this.InsertScanbeam(a.Top.Y),a;},e.ClipperBase.prototype.SwapPositionsInAEL=function(a,P){if(!(a.NextInAEL===a.PrevInAEL||P.NextInAEL===P.PrevInAEL)){if(a.NextInAEL===P){var w=P.NextInAEL;w!==null&&(w.PrevInAEL=a);var F=a.PrevInAEL;F!==null&&(F.NextInAEL=P),P.PrevInAEL=F,P.NextInAEL=a,a.PrevInAEL=P,a.NextInAEL=w;}else if(P.NextInAEL===a){var H=a.NextInAEL;H!==null&&(H.PrevInAEL=P);var _=P.PrevInAEL;_!==null&&(_.NextInAEL=a),a.PrevInAEL=_,a.NextInAEL=P,P.PrevInAEL=a,P.NextInAEL=H;}else{var st=a.NextInAEL,yt=a.PrevInAEL;a.NextInAEL=P.NextInAEL,a.NextInAEL!==null&&(a.NextInAEL.PrevInAEL=a),a.PrevInAEL=P.PrevInAEL,a.PrevInAEL!==null&&(a.PrevInAEL.NextInAEL=a),P.NextInAEL=st,P.NextInAEL!==null&&(P.NextInAEL.PrevInAEL=P),P.PrevInAEL=yt,P.PrevInAEL!==null&&(P.PrevInAEL.NextInAEL=P);}a.PrevInAEL===null?this.m_ActiveEdges=a:P.PrevInAEL===null&&(this.m_ActiveEdges=P);}},e.ClipperBase.prototype.DeleteFromAEL=function(a){var P=a.PrevInAEL,w=a.NextInAEL;P===null&&w===null&&a!==this.m_ActiveEdges||(P!==null?P.NextInAEL=w:this.m_ActiveEdges=w,w!==null&&(w.PrevInAEL=P),a.NextInAEL=null,a.PrevInAEL=null);},e.Clipper=function(a){_typeof(a)>"u"&&(a=0),this.m_PolyOuts=null,this.m_ClipType=e.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=e.PolyFillType.pftEvenOdd,this.m_SubjFillType=e.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,e.ClipperBase.call(this),this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array(),this.m_IntersectNodeComparer=e.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array(),this.m_Joins=new Array(),this.m_GhostJoins=new Array(),this.ReverseSolution=(1&a)!==0,this.StrictlySimple=(2&a)!==0,this.PreserveCollinear=(4&a)!==0,e.use_xyz&&(this.ZFillFunction=null);},e.Clipper.ioReverseSolution=1,e.Clipper.ioStrictlySimple=2,e.Clipper.ioPreserveCollinear=4,e.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),e.ClipperBase.prototype.Clear.call(this));},e.Clipper.prototype.InsertMaxima=function(a){var P=new e.Maxima();if(P.X=a,this.m_Maxima===null)this.m_Maxima=P,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(a<this.m_Maxima.X)P.Next=this.m_Maxima,P.Prev=null,this.m_Maxima=P;else{for(var w=this.m_Maxima;w.Next!==null&&a>=w.Next.X;)w=w.Next;if(a===w.X)return;P.Next=w.Next,P.Prev=w,w.Next!==null&&(w.Next.Prev=P),w.Next=P;}},e.Clipper.prototype.Execute=function(){var a=arguments,P=a.length,w=a[1]instanceof e.PolyTree;if(P===4&&!w){var F=a[0],H=a[1],_=a[2],st=a[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&e.Error("Error: PolyTree struct is needed for open path clipping."),this.m_ExecuteLocked=!0,e.Clear(H),this.m_SubjFillType=_,this.m_ClipFillType=st,this.m_ClipType=F,this.m_UsingPolyTree=!1;try{var yt=this.ExecuteInternal();yt&&this.BuildResult(H);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return yt;}else if(P===4&&w){var F=a[0],Pt=a[1],_=a[2],st=a[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=_,this.m_ClipFillType=st,this.m_ClipType=F,this.m_UsingPolyTree=!0;try{var yt=this.ExecuteInternal();yt&&this.BuildResult2(Pt);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return yt;}else if(P===2&&!w){var F=a[0],H=a[1];return this.Execute(F,H,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}else if(P===2&&w){var F=a[0],Pt=a[1];return this.Execute(F,Pt,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}},e.Clipper.prototype.FixHoleLinkage=function(a){if(!(a.FirstLeft===null||a.IsHole!==a.FirstLeft.IsHole&&a.FirstLeft.Pts!==null)){for(var P=a.FirstLeft;P!==null&&(P.IsHole===a.IsHole||P.Pts===null);)P=P.FirstLeft;a.FirstLeft=P;}},e.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_SortedEdges=null,this.m_Maxima=null;var a={},P={};if(!this.PopScanbeam(a))return!1;for(this.InsertLocalMinimaIntoAEL(a.v);this.PopScanbeam(P)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(P.v))return!1;this.ProcessEdgesAtTopOfScanbeam(P.v),a.v=P.v,this.InsertLocalMinimaIntoAEL(a.v);}var w,F,H;for(F=0,H=this.m_PolyOuts.length;F<H;F++)w=this.m_PolyOuts[F],!(w.Pts===null||w.IsOpen)&&(w.IsHole^this.ReverseSolution)==this.Area$1(w)>0&&this.ReversePolyPtLinks(w.Pts);for(this.JoinCommonEdges(),F=0,H=this.m_PolyOuts.length;F<H;F++)w=this.m_PolyOuts[F],w.Pts!==null&&(w.IsOpen?this.FixupOutPolyline(w):this.FixupOutPolygon(w));return this.StrictlySimple&&this.DoSimplePolygons(),!0;}finally{this.m_Joins.length=0,this.m_GhostJoins.length=0;}},e.Clipper.prototype.DisposeAllPolyPts=function(){for(var a=0,P=this.m_PolyOuts.length;a<P;++a)this.DisposeOutRec(a);e.Clear(this.m_PolyOuts);},e.Clipper.prototype.AddJoin=function(a,P,w){var F=new e.Join();F.OutPt1=a,F.OutPt2=P,F.OffPt.X=w.X,F.OffPt.Y=w.Y,e.use_xyz&&(F.OffPt.Z=w.Z),this.m_Joins.push(F);},e.Clipper.prototype.AddGhostJoin=function(a,P){var w=new e.Join();w.OutPt1=a,w.OffPt.X=P.X,w.OffPt.Y=P.Y,e.use_xyz&&(w.OffPt.Z=P.Z),this.m_GhostJoins.push(w);},e.Clipper.prototype.SetZ=function(a,P,w){if(this.ZFillFunction!==null){if(a.Z!==0||this.ZFillFunction===null)return;e.IntPoint.op_Equality(a,P.Bot)?a.Z=P.Bot.Z:e.IntPoint.op_Equality(a,P.Top)?a.Z=P.Top.Z:e.IntPoint.op_Equality(a,w.Bot)?a.Z=w.Bot.Z:e.IntPoint.op_Equality(a,w.Top)?a.Z=w.Top.Z:this.ZFillFunction(P.Bot,P.Top,w.Bot,w.Top,a);}},e.Clipper.prototype.InsertLocalMinimaIntoAEL=function(a){for(var P={},w,F;this.PopLocalMinima(a,P);){w=P.v.LeftBound,F=P.v.RightBound;var H=null;if(w===null?(this.InsertEdgeIntoAEL(F,null),this.SetWindingCount(F),this.IsContributing(F)&&(H=this.AddOutPt(F,F.Bot))):F===null?(this.InsertEdgeIntoAEL(w,null),this.SetWindingCount(w),this.IsContributing(w)&&(H=this.AddOutPt(w,w.Bot)),this.InsertScanbeam(w.Top.Y)):(this.InsertEdgeIntoAEL(w,null),this.InsertEdgeIntoAEL(F,w),this.SetWindingCount(w),F.WindCnt=w.WindCnt,F.WindCnt2=w.WindCnt2,this.IsContributing(w)&&(H=this.AddLocalMinPoly(w,F,w.Bot)),this.InsertScanbeam(w.Top.Y)),F!==null&&(e.ClipperBase.IsHorizontal(F)?(F.NextInLML!==null&&this.InsertScanbeam(F.NextInLML.Top.Y),this.AddEdgeToSEL(F)):this.InsertScanbeam(F.Top.Y)),!(w===null||F===null)){if(H!==null&&e.ClipperBase.IsHorizontal(F)&&this.m_GhostJoins.length>0&&F.WindDelta!==0)for(var _=0,st=this.m_GhostJoins.length;_<st;_++){var yt=this.m_GhostJoins[_];this.HorzSegmentsOverlap(yt.OutPt1.Pt.X,yt.OffPt.X,F.Bot.X,F.Top.X)&&this.AddJoin(yt.OutPt1,H,yt.OffPt);}if(w.OutIdx>=0&&w.PrevInAEL!==null&&w.PrevInAEL.Curr.X===w.Bot.X&&w.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(w.PrevInAEL.Curr,w.PrevInAEL.Top,w.Curr,w.Top,this.m_UseFullRange)&&w.WindDelta!==0&&w.PrevInAEL.WindDelta!==0){var Pt=this.AddOutPt(w.PrevInAEL,w.Bot);this.AddJoin(H,Pt,w.Top);}if(w.NextInAEL!==F){if(F.OutIdx>=0&&F.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(F.PrevInAEL.Curr,F.PrevInAEL.Top,F.Curr,F.Top,this.m_UseFullRange)&&F.WindDelta!==0&&F.PrevInAEL.WindDelta!==0){var Pt=this.AddOutPt(F.PrevInAEL,F.Bot);this.AddJoin(H,Pt,F.Top);}var Bt=w.NextInAEL;if(Bt!==null)for(;Bt!==F;)this.IntersectEdges(F,Bt,w.Curr),Bt=Bt.NextInAEL;}}}},e.Clipper.prototype.InsertEdgeIntoAEL=function(a,P){if(this.m_ActiveEdges===null)a.PrevInAEL=null,a.NextInAEL=null,this.m_ActiveEdges=a;else if(P===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,a))a.PrevInAEL=null,a.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=a,this.m_ActiveEdges=a;else{for(P===null&&(P=this.m_ActiveEdges);P.NextInAEL!==null&&!this.E2InsertsBeforeE1(P.NextInAEL,a);)P=P.NextInAEL;a.NextInAEL=P.NextInAEL,P.NextInAEL!==null&&(P.NextInAEL.PrevInAEL=a),a.PrevInAEL=P,P.NextInAEL=a;}},e.Clipper.prototype.E2InsertsBeforeE1=function(a,P){return P.Curr.X===a.Curr.X?P.Top.Y>a.Top.Y?P.Top.X<e.Clipper.TopX(a,P.Top.Y):a.Top.X>e.Clipper.TopX(P,a.Top.Y):P.Curr.X<a.Curr.X;},e.Clipper.prototype.IsEvenOddFillType=function(a){return a.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType===e.PolyFillType.pftEvenOdd:this.m_ClipFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsEvenOddAltFillType=function(a){return a.PolyTyp===e.PolyType.ptSubject?this.m_ClipFillType===e.PolyFillType.pftEvenOdd:this.m_SubjFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsContributing=function(a){var P,w;switch(a.PolyTyp===e.PolyType.ptSubject?(P=this.m_SubjFillType,w=this.m_ClipFillType):(P=this.m_ClipFillType,w=this.m_SubjFillType),P){case e.PolyFillType.pftEvenOdd:if(a.WindDelta===0&&a.WindCnt!==1)return!1;break;case e.PolyFillType.pftNonZero:if(Math.abs(a.WindCnt)!==1)return!1;break;case e.PolyFillType.pftPositive:if(a.WindCnt!==1)return!1;break;default:if(a.WindCnt!==-1)return!1;break;}switch(this.m_ClipType){case e.ClipType.ctIntersection:switch(w){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2!==0;case e.PolyFillType.pftPositive:return a.WindCnt2>0;default:return a.WindCnt2<0;}case e.ClipType.ctUnion:switch(w){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}case e.ClipType.ctDifference:if(a.PolyTyp===e.PolyType.ptSubject)switch(w){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}else switch(w){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2!==0;case e.PolyFillType.pftPositive:return a.WindCnt2>0;default:return a.WindCnt2<0;}case e.ClipType.ctXor:if(a.WindDelta===0)switch(w){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}else return!0;}return!0;},e.Clipper.prototype.SetWindingCount=function(a){for(var P=a.PrevInAEL;P!==null&&(P.PolyTyp!==a.PolyTyp||P.WindDelta===0);)P=P.PrevInAEL;if(P===null){var w=a.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType;a.WindDelta===0?a.WindCnt=w===e.PolyFillType.pftNegative?-1:1:a.WindCnt=a.WindDelta,a.WindCnt2=0,P=this.m_ActiveEdges;}else if(a.WindDelta===0&&this.m_ClipType!==e.ClipType.ctUnion)a.WindCnt=1,a.WindCnt2=P.WindCnt2,P=P.NextInAEL;else if(this.IsEvenOddFillType(a)){if(a.WindDelta===0){for(var F=!0,H=P.PrevInAEL;H!==null;)H.PolyTyp===P.PolyTyp&&H.WindDelta!==0&&(F=!F),H=H.PrevInAEL;a.WindCnt=F?0:1;}else a.WindCnt=a.WindDelta;a.WindCnt2=P.WindCnt2,P=P.NextInAEL;}else P.WindCnt*P.WindDelta<0?Math.abs(P.WindCnt)>1?P.WindDelta*a.WindDelta<0?a.WindCnt=P.WindCnt:a.WindCnt=P.WindCnt+a.WindDelta:a.WindCnt=a.WindDelta===0?1:a.WindDelta:a.WindDelta===0?a.WindCnt=P.WindCnt<0?P.WindCnt-1:P.WindCnt+1:P.WindDelta*a.WindDelta<0?a.WindCnt=P.WindCnt:a.WindCnt=P.WindCnt+a.WindDelta,a.WindCnt2=P.WindCnt2,P=P.NextInAEL;if(this.IsEvenOddAltFillType(a))for(;P!==a;)P.WindDelta!==0&&(a.WindCnt2=a.WindCnt2===0?1:0),P=P.NextInAEL;else for(;P!==a;)a.WindCnt2+=P.WindDelta,P=P.NextInAEL;},e.Clipper.prototype.AddEdgeToSEL=function(a){this.m_SortedEdges===null?(this.m_SortedEdges=a,a.PrevInSEL=null,a.NextInSEL=null):(a.NextInSEL=this.m_SortedEdges,a.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=a,this.m_SortedEdges=a);},e.Clipper.prototype.PopEdgeFromSEL=function(a){if(a.v=this.m_SortedEdges,a.v===null)return!1;var P=a.v;return this.m_SortedEdges=a.v.NextInSEL,this.m_SortedEdges!==null&&(this.m_SortedEdges.PrevInSEL=null),P.NextInSEL=null,P.PrevInSEL=null,!0;},e.Clipper.prototype.CopyAELToSEL=function(){var a=this.m_ActiveEdges;for(this.m_SortedEdges=a;a!==null;)a.PrevInSEL=a.PrevInAEL,a.NextInSEL=a.NextInAEL,a=a.NextInAEL;},e.Clipper.prototype.SwapPositionsInSEL=function(a,P){if(!(a.NextInSEL===null&&a.PrevInSEL===null)&&!(P.NextInSEL===null&&P.PrevInSEL===null)){if(a.NextInSEL===P){var w=P.NextInSEL;w!==null&&(w.PrevInSEL=a);var F=a.PrevInSEL;F!==null&&(F.NextInSEL=P),P.PrevInSEL=F,P.NextInSEL=a,a.PrevInSEL=P,a.NextInSEL=w;}else if(P.NextInSEL===a){var w=a.NextInSEL;w!==null&&(w.PrevInSEL=P);var F=P.PrevInSEL;F!==null&&(F.NextInSEL=a),a.PrevInSEL=F,a.NextInSEL=P,P.PrevInSEL=a,P.NextInSEL=w;}else{var w=a.NextInSEL,F=a.PrevInSEL;a.NextInSEL=P.NextInSEL,a.NextInSEL!==null&&(a.NextInSEL.PrevInSEL=a),a.PrevInSEL=P.PrevInSEL,a.PrevInSEL!==null&&(a.PrevInSEL.NextInSEL=a),P.NextInSEL=w,P.NextInSEL!==null&&(P.NextInSEL.PrevInSEL=P),P.PrevInSEL=F,P.PrevInSEL!==null&&(P.PrevInSEL.NextInSEL=P);}a.PrevInSEL===null?this.m_SortedEdges=a:P.PrevInSEL===null&&(this.m_SortedEdges=P);}},e.Clipper.prototype.AddLocalMaxPoly=function(a,P,w){this.AddOutPt(a,w),P.WindDelta===0&&this.AddOutPt(P,w),a.OutIdx===P.OutIdx?(a.OutIdx=-1,P.OutIdx=-1):a.OutIdx<P.OutIdx?this.AppendPolygon(a,P):this.AppendPolygon(P,a);},e.Clipper.prototype.AddLocalMinPoly=function(a,P,w){var F,H,_;if(e.ClipperBase.IsHorizontal(P)||a.Dx>P.Dx?(F=this.AddOutPt(a,w),P.OutIdx=a.OutIdx,a.Side=e.EdgeSide.esLeft,P.Side=e.EdgeSide.esRight,H=a,H.PrevInAEL===P?_=P.PrevInAEL:_=H.PrevInAEL):(F=this.AddOutPt(P,w),a.OutIdx=P.OutIdx,a.Side=e.EdgeSide.esRight,P.Side=e.EdgeSide.esLeft,H=P,H.PrevInAEL===a?_=a.PrevInAEL:_=H.PrevInAEL),_!==null&&_.OutIdx>=0&&_.Top.Y<w.Y&&H.Top.Y<w.Y){var st=e.Clipper.TopX(_,w.Y),yt=e.Clipper.TopX(H,w.Y);if(st===yt&&H.WindDelta!==0&&_.WindDelta!==0&&e.ClipperBase.SlopesEqual5(new e.IntPoint2(st,w.Y),_.Top,new e.IntPoint2(yt,w.Y),H.Top,this.m_UseFullRange)){var Pt=this.AddOutPt(_,w);this.AddJoin(F,Pt,H.Top);}}return F;},e.Clipper.prototype.AddOutPt=function(a,P){if(a.OutIdx<0){var w=this.CreateOutRec();w.IsOpen=a.WindDelta===0;var F=new e.OutPt();return w.Pts=F,F.Idx=w.Idx,F.Pt.X=P.X,F.Pt.Y=P.Y,e.use_xyz&&(F.Pt.Z=P.Z),F.Next=F,F.Prev=F,w.IsOpen||this.SetHoleState(a,w),a.OutIdx=w.Idx,F;}else{var w=this.m_PolyOuts[a.OutIdx],H=w.Pts,_=a.Side===e.EdgeSide.esLeft;if(_&&e.IntPoint.op_Equality(P,H.Pt))return H;if(!_&&e.IntPoint.op_Equality(P,H.Prev.Pt))return H.Prev;var F=new e.OutPt();return F.Idx=w.Idx,F.Pt.X=P.X,F.Pt.Y=P.Y,e.use_xyz&&(F.Pt.Z=P.Z),F.Next=H,F.Prev=H.Prev,F.Prev.Next=F,H.Prev=F,_&&(w.Pts=F),F;}},e.Clipper.prototype.GetLastOutPt=function(a){var P=this.m_PolyOuts[a.OutIdx];return a.Side===e.EdgeSide.esLeft?P.Pts:P.Pts.Prev;},e.Clipper.prototype.SwapPoints=function(a,P){var w=new e.IntPoint1(a.Value);a.Value.X=P.Value.X,a.Value.Y=P.Value.Y,e.use_xyz&&(a.Value.Z=P.Value.Z),P.Value.X=w.X,P.Value.Y=w.Y,e.use_xyz&&(P.Value.Z=w.Z);},e.Clipper.prototype.HorzSegmentsOverlap=function(a,P,w,F){var H;return a>P&&(H=a,a=P,P=H),w>F&&(H=w,w=F,F=H),a<F&&w<P;},e.Clipper.prototype.SetHoleState=function(a,P){for(var w=a.PrevInAEL,F=null;w!==null;)w.OutIdx>=0&&w.WindDelta!==0&&(F===null?F=w:F.OutIdx===w.OutIdx&&(F=null)),w=w.PrevInAEL;F===null?(P.FirstLeft=null,P.IsHole=!1):(P.FirstLeft=this.m_PolyOuts[F.OutIdx],P.IsHole=!P.FirstLeft.IsHole);},e.Clipper.prototype.GetDx=function(a,P){return a.Y===P.Y?e.ClipperBase.horizontal:(P.X-a.X)/(P.Y-a.Y);},e.Clipper.prototype.FirstIsBottomPt=function(a,P){for(var w=a.Prev;e.IntPoint.op_Equality(w.Pt,a.Pt)&&w!==a;)w=w.Prev;var F=Math.abs(this.GetDx(a.Pt,w.Pt));for(w=a.Next;e.IntPoint.op_Equality(w.Pt,a.Pt)&&w!==a;)w=w.Next;var H=Math.abs(this.GetDx(a.Pt,w.Pt));for(w=P.Prev;e.IntPoint.op_Equality(w.Pt,P.Pt)&&w!==P;)w=w.Prev;var _=Math.abs(this.GetDx(P.Pt,w.Pt));for(w=P.Next;e.IntPoint.op_Equality(w.Pt,P.Pt)&&w!==P;)w=w.Next;var st=Math.abs(this.GetDx(P.Pt,w.Pt));return Math.max(F,H)===Math.max(_,st)&&Math.min(F,H)===Math.min(_,st)?this.Area(a)>0:F>=_&&F>=st||H>=_&&H>=st;},e.Clipper.prototype.GetBottomPt=function(a){for(var P=null,w=a.Next;w!==a;)w.Pt.Y>a.Pt.Y?(a=w,P=null):w.Pt.Y===a.Pt.Y&&w.Pt.X<=a.Pt.X&&(w.Pt.X<a.Pt.X?(P=null,a=w):w.Next!==a&&w.Prev!==a&&(P=w)),w=w.Next;if(P!==null)for(;P!==w;)for(this.FirstIsBottomPt(w,P)||(a=P),P=P.Next;e.IntPoint.op_Inequality(P.Pt,a.Pt);)P=P.Next;return a;},e.Clipper.prototype.GetLowermostRec=function(a,P){a.BottomPt===null&&(a.BottomPt=this.GetBottomPt(a.Pts)),P.BottomPt===null&&(P.BottomPt=this.GetBottomPt(P.Pts));var w=a.BottomPt,F=P.BottomPt;return w.Pt.Y>F.Pt.Y?a:w.Pt.Y<F.Pt.Y?P:w.Pt.X<F.Pt.X?a:w.Pt.X>F.Pt.X||w.Next===w?P:F.Next===F||this.FirstIsBottomPt(w,F)?a:P;},e.Clipper.prototype.OutRec1RightOfOutRec2=function(a,P){do if(a=a.FirstLeft,a===P)return!0;while(a!==null);return!1;},e.Clipper.prototype.GetOutRec=function(a){for(var P=this.m_PolyOuts[a];P!==this.m_PolyOuts[P.Idx];)P=this.m_PolyOuts[P.Idx];return P;},e.Clipper.prototype.AppendPolygon=function(a,P){var w=this.m_PolyOuts[a.OutIdx],F=this.m_PolyOuts[P.OutIdx],H;this.OutRec1RightOfOutRec2(w,F)?H=F:this.OutRec1RightOfOutRec2(F,w)?H=w:H=this.GetLowermostRec(w,F);var _=w.Pts,st=_.Prev,yt=F.Pts,Pt=yt.Prev;a.Side===e.EdgeSide.esLeft?P.Side===e.EdgeSide.esLeft?(this.ReversePolyPtLinks(yt),yt.Next=_,_.Prev=yt,st.Next=Pt,Pt.Prev=st,w.Pts=Pt):(Pt.Next=_,_.Prev=Pt,yt.Prev=st,st.Next=yt,w.Pts=yt):P.Side===e.EdgeSide.esRight?(this.ReversePolyPtLinks(yt),st.Next=Pt,Pt.Prev=st,yt.Next=_,_.Prev=yt):(st.Next=yt,yt.Prev=st,_.Prev=Pt,Pt.Next=_),w.BottomPt=null,H===F&&(F.FirstLeft!==w&&(w.FirstLeft=F.FirstLeft),w.IsHole=F.IsHole),F.Pts=null,F.BottomPt=null,F.FirstLeft=w;var Bt=a.OutIdx,kt=P.OutIdx;a.OutIdx=-1,P.OutIdx=-1;for(var jt=this.m_ActiveEdges;jt!==null;){if(jt.OutIdx===kt){jt.OutIdx=Bt,jt.Side=a.Side;break;}jt=jt.NextInAEL;}F.Idx=w.Idx;},e.Clipper.prototype.ReversePolyPtLinks=function(a){if(a!==null){var P,w;P=a;do w=P.Next,P.Next=P.Prev,P.Prev=w,P=w;while(P!==a);}},e.Clipper.SwapSides=function(a,P){var w=a.Side;a.Side=P.Side,P.Side=w;},e.Clipper.SwapPolyIndexes=function(a,P){var w=a.OutIdx;a.OutIdx=P.OutIdx,P.OutIdx=w;},e.Clipper.prototype.IntersectEdges=function(a,P,w){var F=a.OutIdx>=0,H=P.OutIdx>=0;if(e.use_xyz&&this.SetZ(w,a,P),e.use_lines&&(a.WindDelta===0||P.WindDelta===0)){if(a.WindDelta===0&&P.WindDelta===0)return;a.PolyTyp===P.PolyTyp&&a.WindDelta!==P.WindDelta&&this.m_ClipType===e.ClipType.ctUnion?a.WindDelta===0?H&&(this.AddOutPt(a,w),F&&(a.OutIdx=-1)):F&&(this.AddOutPt(P,w),H&&(P.OutIdx=-1)):a.PolyTyp!==P.PolyTyp&&(a.WindDelta===0&&Math.abs(P.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||P.WindCnt2===0)?(this.AddOutPt(a,w),F&&(a.OutIdx=-1)):P.WindDelta===0&&Math.abs(a.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||a.WindCnt2===0)&&(this.AddOutPt(P,w),H&&(P.OutIdx=-1)));return;}if(a.PolyTyp===P.PolyTyp){if(this.IsEvenOddFillType(a)){var _=a.WindCnt;a.WindCnt=P.WindCnt,P.WindCnt=_;}else a.WindCnt+P.WindDelta===0?a.WindCnt=-a.WindCnt:a.WindCnt+=P.WindDelta,P.WindCnt-a.WindDelta===0?P.WindCnt=-P.WindCnt:P.WindCnt-=a.WindDelta;}else this.IsEvenOddFillType(P)?a.WindCnt2=a.WindCnt2===0?1:0:a.WindCnt2+=P.WindDelta,this.IsEvenOddFillType(a)?P.WindCnt2=P.WindCnt2===0?1:0:P.WindCnt2-=a.WindDelta;var st,yt,Pt,Bt;a.PolyTyp===e.PolyType.ptSubject?(st=this.m_SubjFillType,Pt=this.m_ClipFillType):(st=this.m_ClipFillType,Pt=this.m_SubjFillType),P.PolyTyp===e.PolyType.ptSubject?(yt=this.m_SubjFillType,Bt=this.m_ClipFillType):(yt=this.m_ClipFillType,Bt=this.m_SubjFillType);var kt,jt;switch(st){case e.PolyFillType.pftPositive:kt=a.WindCnt;break;case e.PolyFillType.pftNegative:kt=-a.WindCnt;break;default:kt=Math.abs(a.WindCnt);break;}switch(yt){case e.PolyFillType.pftPositive:jt=P.WindCnt;break;case e.PolyFillType.pftNegative:jt=-P.WindCnt;break;default:jt=Math.abs(P.WindCnt);break;}if(F&&H)kt!==0&&kt!==1||jt!==0&&jt!==1||a.PolyTyp!==P.PolyTyp&&this.m_ClipType!==e.ClipType.ctXor?this.AddLocalMaxPoly(a,P,w):(this.AddOutPt(a,w),this.AddOutPt(P,w),e.Clipper.SwapSides(a,P),e.Clipper.SwapPolyIndexes(a,P));else if(F)(jt===0||jt===1)&&(this.AddOutPt(a,w),e.Clipper.SwapSides(a,P),e.Clipper.SwapPolyIndexes(a,P));else if(H)(kt===0||kt===1)&&(this.AddOutPt(P,w),e.Clipper.SwapSides(a,P),e.Clipper.SwapPolyIndexes(a,P));else if((kt===0||kt===1)&&(jt===0||jt===1)){var qt,oe;switch(Pt){case e.PolyFillType.pftPositive:qt=a.WindCnt2;break;case e.PolyFillType.pftNegative:qt=-a.WindCnt2;break;default:qt=Math.abs(a.WindCnt2);break;}switch(Bt){case e.PolyFillType.pftPositive:oe=P.WindCnt2;break;case e.PolyFillType.pftNegative:oe=-P.WindCnt2;break;default:oe=Math.abs(P.WindCnt2);break;}if(a.PolyTyp!==P.PolyTyp)this.AddLocalMinPoly(a,P,w);else if(kt===1&&jt===1)switch(this.m_ClipType){case e.ClipType.ctIntersection:qt>0&&oe>0&&this.AddLocalMinPoly(a,P,w);break;case e.ClipType.ctUnion:qt<=0&&oe<=0&&this.AddLocalMinPoly(a,P,w);break;case e.ClipType.ctDifference:(a.PolyTyp===e.PolyType.ptClip&&qt>0&&oe>0||a.PolyTyp===e.PolyType.ptSubject&&qt<=0&&oe<=0)&&this.AddLocalMinPoly(a,P,w);break;case e.ClipType.ctXor:this.AddLocalMinPoly(a,P,w);break;}else e.Clipper.SwapSides(a,P);}},e.Clipper.prototype.DeleteFromSEL=function(a){var P=a.PrevInSEL,w=a.NextInSEL;P===null&&w===null&&a!==this.m_SortedEdges||(P!==null?P.NextInSEL=w:this.m_SortedEdges=w,w!==null&&(w.PrevInSEL=P),a.NextInSEL=null,a.PrevInSEL=null);},e.Clipper.prototype.ProcessHorizontals=function(){for(var a={};this.PopEdgeFromSEL(a);)this.ProcessHorizontal(a.v);},e.Clipper.prototype.GetHorzDirection=function(a,P){a.Bot.X<a.Top.X?(P.Left=a.Bot.X,P.Right=a.Top.X,P.Dir=e.Direction.dLeftToRight):(P.Left=a.Top.X,P.Right=a.Bot.X,P.Dir=e.Direction.dRightToLeft);},e.Clipper.prototype.ProcessHorizontal=function(a){var P={Dir:null,Left:null,Right:null};this.GetHorzDirection(a,P);for(var w=P.Dir,F=P.Left,H=P.Right,_=a.WindDelta===0,st=a,yt=null;st.NextInLML!==null&&e.ClipperBase.IsHorizontal(st.NextInLML);)st=st.NextInLML;st.NextInLML===null&&(yt=this.GetMaximaPair(st));var Pt=this.m_Maxima;if(Pt!==null)if(w===e.Direction.dLeftToRight){for(;Pt!==null&&Pt.X<=a.Bot.X;)Pt=Pt.Next;Pt!==null&&Pt.X>=st.Top.X&&(Pt=null);}else{for(;Pt.Next!==null&&Pt.Next.X<a.Bot.X;)Pt=Pt.Next;Pt.X<=st.Top.X&&(Pt=null);}for(var Bt=null;;){for(var kt=a===st,jt=this.GetNextInAEL(a,w);jt!==null;){if(Pt!==null)if(w===e.Direction.dLeftToRight)for(;Pt!==null&&Pt.X<jt.Curr.X;)a.OutIdx>=0&&!_&&this.AddOutPt(a,new e.IntPoint2(Pt.X,a.Bot.Y)),Pt=Pt.Next;else for(;Pt!==null&&Pt.X>jt.Curr.X;)a.OutIdx>=0&&!_&&this.AddOutPt(a,new e.IntPoint2(Pt.X,a.Bot.Y)),Pt=Pt.Prev;if(w===e.Direction.dLeftToRight&&jt.Curr.X>H||w===e.Direction.dRightToLeft&&jt.Curr.X<F||jt.Curr.X===a.Top.X&&a.NextInLML!==null&&jt.Dx<a.NextInLML.Dx)break;if(a.OutIdx>=0&&!_){e.use_xyz&&(w===e.Direction.dLeftToRight?this.SetZ(jt.Curr,a,jt):this.SetZ(jt.Curr,jt,a)),Bt=this.AddOutPt(a,jt.Curr);for(var qt=this.m_SortedEdges;qt!==null;){if(qt.OutIdx>=0&&this.HorzSegmentsOverlap(a.Bot.X,a.Top.X,qt.Bot.X,qt.Top.X)){var oe=this.GetLastOutPt(qt);this.AddJoin(oe,Bt,qt.Top);}qt=qt.NextInSEL;}this.AddGhostJoin(Bt,a.Bot);}if(jt===yt&&kt){a.OutIdx>=0&&this.AddLocalMaxPoly(a,yt,a.Top),this.DeleteFromAEL(a),this.DeleteFromAEL(yt);return;}if(w===e.Direction.dLeftToRight){var me=new e.IntPoint2(jt.Curr.X,a.Curr.Y);this.IntersectEdges(a,jt,me);}else{var me=new e.IntPoint2(jt.Curr.X,a.Curr.Y);this.IntersectEdges(jt,a,me);}var Pe=this.GetNextInAEL(jt,w);this.SwapPositionsInAEL(a,jt),jt=Pe;}if(a.NextInLML===null||!e.ClipperBase.IsHorizontal(a.NextInLML))break;a=this.UpdateEdgeIntoAEL(a),a.OutIdx>=0&&this.AddOutPt(a,a.Bot),P={Dir:w,Left:F,Right:H},this.GetHorzDirection(a,P),w=P.Dir,F=P.Left,H=P.Right;}if(a.OutIdx>=0&&Bt===null){Bt=this.GetLastOutPt(a);for(var qt=this.m_SortedEdges;qt!==null;){if(qt.OutIdx>=0&&this.HorzSegmentsOverlap(a.Bot.X,a.Top.X,qt.Bot.X,qt.Top.X)){var oe=this.GetLastOutPt(qt);this.AddJoin(oe,Bt,qt.Top);}qt=qt.NextInSEL;}this.AddGhostJoin(Bt,a.Top);}if(a.NextInLML!==null){if(a.OutIdx>=0){if(Bt=this.AddOutPt(a,a.Top),a=this.UpdateEdgeIntoAEL(a),a.WindDelta===0)return;var De=a.PrevInAEL,Pe=a.NextInAEL;if(De!==null&&De.Curr.X===a.Bot.X&&De.Curr.Y===a.Bot.Y&&De.WindDelta===0&&De.OutIdx>=0&&De.Curr.Y>De.Top.Y&&e.ClipperBase.SlopesEqual3(a,De,this.m_UseFullRange)){var oe=this.AddOutPt(De,a.Bot);this.AddJoin(Bt,oe,a.Top);}else if(Pe!==null&&Pe.Curr.X===a.Bot.X&&Pe.Curr.Y===a.Bot.Y&&Pe.WindDelta!==0&&Pe.OutIdx>=0&&Pe.Curr.Y>Pe.Top.Y&&e.ClipperBase.SlopesEqual3(a,Pe,this.m_UseFullRange)){var oe=this.AddOutPt(Pe,a.Bot);this.AddJoin(Bt,oe,a.Top);}}else a=this.UpdateEdgeIntoAEL(a);}else a.OutIdx>=0&&this.AddOutPt(a,a.Top),this.DeleteFromAEL(a);},e.Clipper.prototype.GetNextInAEL=function(a,P){return P===e.Direction.dLeftToRight?a.NextInAEL:a.PrevInAEL;},e.Clipper.prototype.IsMinima=function(a){return a!==null&&a.Prev.NextInLML!==a&&a.Next.NextInLML!==a;},e.Clipper.prototype.IsMaxima=function(a,P){return a!==null&&a.Top.Y===P&&a.NextInLML===null;},e.Clipper.prototype.IsIntermediate=function(a,P){return a.Top.Y===P&&a.NextInLML!==null;},e.Clipper.prototype.GetMaximaPair=function(a){return e.IntPoint.op_Equality(a.Next.Top,a.Top)&&a.Next.NextInLML===null?a.Next:e.IntPoint.op_Equality(a.Prev.Top,a.Top)&&a.Prev.NextInLML===null?a.Prev:null;},e.Clipper.prototype.GetMaximaPairEx=function(a){var P=this.GetMaximaPair(a);return P===null||P.OutIdx===e.ClipperBase.Skip||P.NextInAEL===P.PrevInAEL&&!e.ClipperBase.IsHorizontal(P)?null:P;},e.Clipper.prototype.ProcessIntersections=function(a){if(this.m_ActiveEdges===null)return!0;try{if(this.BuildIntersectList(a),this.m_IntersectList.length===0)return!0;if(this.m_IntersectList.length===1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1;}catch(_unused23){this.m_SortedEdges=null,this.m_IntersectList.length=0,e.Error("ProcessIntersections error");}return this.m_SortedEdges=null,!0;},e.Clipper.prototype.BuildIntersectList=function(a){if(this.m_ActiveEdges!==null){var P=this.m_ActiveEdges;for(this.m_SortedEdges=P;P!==null;)P.PrevInSEL=P.PrevInAEL,P.NextInSEL=P.NextInAEL,P.Curr.X=e.Clipper.TopX(P,a),P=P.NextInAEL;for(var w=!0;w&&this.m_SortedEdges!==null;){for(w=!1,P=this.m_SortedEdges;P.NextInSEL!==null;){var F=P.NextInSEL,H=new e.IntPoint0();if(P.Curr.X>F.Curr.X){this.IntersectPoint(P,F,H),H.Y<a&&(H=new e.IntPoint2(e.Clipper.TopX(P,a),a));var _=new e.IntersectNode();_.Edge1=P,_.Edge2=F,_.Pt.X=H.X,_.Pt.Y=H.Y,e.use_xyz&&(_.Pt.Z=H.Z),this.m_IntersectList.push(_),this.SwapPositionsInSEL(P,F),w=!0;}else P=F;}if(P.PrevInSEL!==null)P.PrevInSEL.NextInSEL=null;else break;}this.m_SortedEdges=null;}},e.Clipper.prototype.EdgesAdjacent=function(a){return a.Edge1.NextInSEL===a.Edge2||a.Edge1.PrevInSEL===a.Edge2;},e.Clipper.IntersectNodeSort=function(a,P){return P.Pt.Y-a.Pt.Y;},e.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var a=this.m_IntersectList.length,P=0;P<a;P++){if(!this.EdgesAdjacent(this.m_IntersectList[P])){for(var w=P+1;w<a&&!this.EdgesAdjacent(this.m_IntersectList[w]);)w++;if(w===a)return!1;var F=this.m_IntersectList[P];this.m_IntersectList[P]=this.m_IntersectList[w],this.m_IntersectList[w]=F;}this.SwapPositionsInSEL(this.m_IntersectList[P].Edge1,this.m_IntersectList[P].Edge2);}return!0;},e.Clipper.prototype.ProcessIntersectList=function(){for(var a=0,P=this.m_IntersectList.length;a<P;a++){var w=this.m_IntersectList[a];this.IntersectEdges(w.Edge1,w.Edge2,w.Pt),this.SwapPositionsInAEL(w.Edge1,w.Edge2);}this.m_IntersectList.length=0;};var $o=function $o(a){return a<0?Math.ceil(a-0.5):Math.round(a);},os=function os(a){return a<0?Math.ceil(a-0.5):Math.floor(a+0.5);},Zn=function Zn(a){return a<0?-Math.round(Math.abs(a)):Math.round(a);},as=function as(a){return a<0?(a-=0.5,a<-2147483648?Math.ceil(a):a|0):(a+=0.5,a>2147483647?Math.floor(a):a|0);};s.msie?e.Clipper.Round=$o:s.chromium?e.Clipper.Round=Zn:s.safari?e.Clipper.Round=as:e.Clipper.Round=os,e.Clipper.TopX=function(a,P){return P===a.Top.Y?a.Top.X:a.Bot.X+e.Clipper.Round(a.Dx*(P-a.Bot.Y));},e.Clipper.prototype.IntersectPoint=function(a,P,w){w.X=0,w.Y=0;var F,H;if(a.Dx===P.Dx){w.Y=a.Curr.Y,w.X=e.Clipper.TopX(a,w.Y);return;}if(a.Delta.X===0)w.X=a.Bot.X,e.ClipperBase.IsHorizontal(P)?w.Y=P.Bot.Y:(H=P.Bot.Y-P.Bot.X/P.Dx,w.Y=e.Clipper.Round(w.X/P.Dx+H));else if(P.Delta.X===0)w.X=P.Bot.X,e.ClipperBase.IsHorizontal(a)?w.Y=a.Bot.Y:(F=a.Bot.Y-a.Bot.X/a.Dx,w.Y=e.Clipper.Round(w.X/a.Dx+F));else{F=a.Bot.X-a.Bot.Y*a.Dx,H=P.Bot.X-P.Bot.Y*P.Dx;var _=(H-F)/(a.Dx-P.Dx);w.Y=e.Clipper.Round(_),Math.abs(a.Dx)<Math.abs(P.Dx)?w.X=e.Clipper.Round(a.Dx*_+F):w.X=e.Clipper.Round(P.Dx*_+H);}if(w.Y<a.Top.Y||w.Y<P.Top.Y){if(a.Top.Y>P.Top.Y)return w.Y=a.Top.Y,w.X=e.Clipper.TopX(P,a.Top.Y),w.X<a.Top.X;w.Y=P.Top.Y,Math.abs(a.Dx)<Math.abs(P.Dx)?w.X=e.Clipper.TopX(a,w.Y):w.X=e.Clipper.TopX(P,w.Y);}w.Y>a.Curr.Y&&(w.Y=a.Curr.Y,Math.abs(a.Dx)>Math.abs(P.Dx)?w.X=e.Clipper.TopX(P,w.Y):w.X=e.Clipper.TopX(a,w.Y));},e.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(a){for(var P=this.m_ActiveEdges;P!==null;){var w=this.IsMaxima(P,a);if(w){var F=this.GetMaximaPairEx(P);w=F===null||!e.ClipperBase.IsHorizontal(F);}if(w){this.StrictlySimple&&this.InsertMaxima(P.Top.X);var H=P.PrevInAEL;this.DoMaxima(P),H===null?P=this.m_ActiveEdges:P=H.NextInAEL;}else{if(this.IsIntermediate(P,a)&&e.ClipperBase.IsHorizontal(P.NextInLML)?(P=this.UpdateEdgeIntoAEL(P),P.OutIdx>=0&&this.AddOutPt(P,P.Bot),this.AddEdgeToSEL(P)):(P.Curr.X=e.Clipper.TopX(P,a),P.Curr.Y=a),e.use_xyz&&(P.Top.Y===a?P.Curr.Z=P.Top.Z:P.Bot.Y===a?P.Curr.Z=P.Bot.Z:P.Curr.Z=0),this.StrictlySimple){var H=P.PrevInAEL;if(P.OutIdx>=0&&P.WindDelta!==0&&H!==null&&H.OutIdx>=0&&H.Curr.X===P.Curr.X&&H.WindDelta!==0){var _=new e.IntPoint1(P.Curr);e.use_xyz&&this.SetZ(_,H,P);var st=this.AddOutPt(H,_),yt=this.AddOutPt(P,_);this.AddJoin(st,yt,_);}}P=P.NextInAEL;}}for(this.ProcessHorizontals(),this.m_Maxima=null,P=this.m_ActiveEdges;P!==null;){if(this.IsIntermediate(P,a)){var st=null;P.OutIdx>=0&&(st=this.AddOutPt(P,P.Top)),P=this.UpdateEdgeIntoAEL(P);var H=P.PrevInAEL,Pt=P.NextInAEL;if(H!==null&&H.Curr.X===P.Bot.X&&H.Curr.Y===P.Bot.Y&&st!==null&&H.OutIdx>=0&&H.Curr.Y===H.Top.Y&&e.ClipperBase.SlopesEqual5(P.Curr,P.Top,H.Curr,H.Top,this.m_UseFullRange)&&P.WindDelta!==0&&H.WindDelta!==0){var yt=this.AddOutPt(ePrev2,P.Bot);this.AddJoin(st,yt,P.Top);}else if(Pt!==null&&Pt.Curr.X===P.Bot.X&&Pt.Curr.Y===P.Bot.Y&&st!==null&&Pt.OutIdx>=0&&Pt.Curr.Y===Pt.Top.Y&&e.ClipperBase.SlopesEqual5(P.Curr,P.Top,Pt.Curr,Pt.Top,this.m_UseFullRange)&&P.WindDelta!==0&&Pt.WindDelta!==0){var yt=this.AddOutPt(Pt,P.Bot);this.AddJoin(st,yt,P.Top);}}P=P.NextInAEL;}},e.Clipper.prototype.DoMaxima=function(a){var P=this.GetMaximaPairEx(a);if(P===null){a.OutIdx>=0&&this.AddOutPt(a,a.Top),this.DeleteFromAEL(a);return;}for(var w=a.NextInAEL;w!==null&&w!==P;)this.IntersectEdges(a,w,a.Top),this.SwapPositionsInAEL(a,w),w=a.NextInAEL;a.OutIdx===-1&&P.OutIdx===-1?(this.DeleteFromAEL(a),this.DeleteFromAEL(P)):a.OutIdx>=0&&P.OutIdx>=0?(a.OutIdx>=0&&this.AddLocalMaxPoly(a,P,a.Top),this.DeleteFromAEL(a),this.DeleteFromAEL(P)):e.use_lines&&a.WindDelta===0?(a.OutIdx>=0&&(this.AddOutPt(a,a.Top),a.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(a),P.OutIdx>=0&&(this.AddOutPt(P,a.Top),P.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(P)):e.Error("DoMaxima error");},e.Clipper.ReversePaths=function(a){for(var P=0,w=a.length;P<w;P++)a[P].reverse();},e.Clipper.Orientation=function(a){return e.Clipper.Area(a)>=0;},e.Clipper.prototype.PointCount=function(a){if(a===null)return 0;var P=0,w=a;do P++,w=w.Next;while(w!==a);return P;},e.Clipper.prototype.BuildResult=function(a){e.Clear(a);for(var P=0,w=this.m_PolyOuts.length;P<w;P++){var F=this.m_PolyOuts[P];if(F.Pts!==null){var H=F.Pts.Prev,_=this.PointCount(H);if(!(_<2)){for(var st=new Array(_),yt=0;yt<_;yt++)st[yt]=H.Pt,H=H.Prev;a.push(st);}}}},e.Clipper.prototype.BuildResult2=function(a){a.Clear();for(var P=0,w=this.m_PolyOuts.length;P<w;P++){var F=this.m_PolyOuts[P],H=this.PointCount(F.Pts);if(!(F.IsOpen&&H<2||!F.IsOpen&&H<3)){this.FixHoleLinkage(F);var _=new e.PolyNode();a.m_AllPolys.push(_),F.PolyNode=_,_.m_polygon.length=H;for(var st=F.Pts.Prev,yt=0;yt<H;yt++)_.m_polygon[yt]=st.Pt,st=st.Prev;}}for(var P=0,w=this.m_PolyOuts.length;P<w;P++){var F=this.m_PolyOuts[P];F.PolyNode!==null&&(F.IsOpen?(F.PolyNode.IsOpen=!0,a.AddChild(F.PolyNode)):F.FirstLeft!==null&&F.FirstLeft.PolyNode!==null?F.FirstLeft.PolyNode.AddChild(F.PolyNode):a.AddChild(F.PolyNode));}},e.Clipper.prototype.FixupOutPolyline=function(a){for(var P=a.Pts,w=P.Prev;P!==w;)if(P=P.Next,e.IntPoint.op_Equality(P.Pt,P.Prev.Pt)){P===w&&(w=P.Prev);var F=P.Prev;F.Next=P.Next,P.Next.Prev=F,P=F;}P===P.Prev&&(a.Pts=null);},e.Clipper.prototype.FixupOutPolygon=function(a){var P=null;a.BottomPt=null;for(var w=a.Pts,F=this.PreserveCollinear||this.StrictlySimple;;){if(w.Prev===w||w.Prev===w.Next){a.Pts=null;return;}if(e.IntPoint.op_Equality(w.Pt,w.Next.Pt)||e.IntPoint.op_Equality(w.Pt,w.Prev.Pt)||e.ClipperBase.SlopesEqual4(w.Prev.Pt,w.Pt,w.Next.Pt,this.m_UseFullRange)&&(!F||!this.Pt2IsBetweenPt1AndPt3(w.Prev.Pt,w.Pt,w.Next.Pt)))P=null,w.Prev.Next=w.Next,w.Next.Prev=w.Prev,w=w.Prev;else{if(w===P)break;P===null&&(P=w),w=w.Next;}}a.Pts=w;},e.Clipper.prototype.DupOutPt=function(a,P){var w=new e.OutPt();return w.Pt.X=a.Pt.X,w.Pt.Y=a.Pt.Y,e.use_xyz&&(w.Pt.Z=a.Pt.Z),w.Idx=a.Idx,P?(w.Next=a.Next,w.Prev=a,a.Next.Prev=w,a.Next=w):(w.Prev=a.Prev,w.Next=a,a.Prev.Next=w,a.Prev=w),w;},e.Clipper.prototype.GetOverlap=function(a,P,w,F,H){return a<P?w<F?(H.Left=Math.max(a,w),H.Right=Math.min(P,F)):(H.Left=Math.max(a,F),H.Right=Math.min(P,w)):w<F?(H.Left=Math.max(P,w),H.Right=Math.min(a,F)):(H.Left=Math.max(P,F),H.Right=Math.min(a,w)),H.Left<H.Right;},e.Clipper.prototype.JoinHorz=function(a,P,w,F,H,_){var st=a.Pt.X>P.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight,yt=w.Pt.X>F.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight;if(st===yt)return!1;if(st===e.Direction.dLeftToRight){for(;a.Next.Pt.X<=H.X&&a.Next.Pt.X>=a.Pt.X&&a.Next.Pt.Y===H.Y;)a=a.Next;_&&a.Pt.X!==H.X&&(a=a.Next),P=this.DupOutPt(a,!_),e.IntPoint.op_Inequality(P.Pt,H)&&(a=P,a.Pt.X=H.X,a.Pt.Y=H.Y,e.use_xyz&&(a.Pt.Z=H.Z),P=this.DupOutPt(a,!_));}else{for(;a.Next.Pt.X>=H.X&&a.Next.Pt.X<=a.Pt.X&&a.Next.Pt.Y===H.Y;)a=a.Next;!_&&a.Pt.X!==H.X&&(a=a.Next),P=this.DupOutPt(a,_),e.IntPoint.op_Inequality(P.Pt,H)&&(a=P,a.Pt.X=H.X,a.Pt.Y=H.Y,e.use_xyz&&(a.Pt.Z=H.Z),P=this.DupOutPt(a,_));}if(yt===e.Direction.dLeftToRight){for(;w.Next.Pt.X<=H.X&&w.Next.Pt.X>=w.Pt.X&&w.Next.Pt.Y===H.Y;)w=w.Next;_&&w.Pt.X!==H.X&&(w=w.Next),F=this.DupOutPt(w,!_),e.IntPoint.op_Inequality(F.Pt,H)&&(w=F,w.Pt.X=H.X,w.Pt.Y=H.Y,e.use_xyz&&(w.Pt.Z=H.Z),F=this.DupOutPt(w,!_));}else{for(;w.Next.Pt.X>=H.X&&w.Next.Pt.X<=w.Pt.X&&w.Next.Pt.Y===H.Y;)w=w.Next;!_&&w.Pt.X!==H.X&&(w=w.Next),F=this.DupOutPt(w,_),e.IntPoint.op_Inequality(F.Pt,H)&&(w=F,w.Pt.X=H.X,w.Pt.Y=H.Y,e.use_xyz&&(w.Pt.Z=H.Z),F=this.DupOutPt(w,_));}return st===e.Direction.dLeftToRight===_?(a.Prev=w,w.Next=a,P.Next=F,F.Prev=P):(a.Next=w,w.Prev=a,P.Prev=F,F.Next=P),!0;},e.Clipper.prototype.JoinPoints=function(a,P,w){var F=a.OutPt1,H=new e.OutPt(),_=a.OutPt2,st=new e.OutPt(),yt=a.OutPt1.Pt.Y===a.OffPt.Y;if(yt&&e.IntPoint.op_Equality(a.OffPt,a.OutPt1.Pt)&&e.IntPoint.op_Equality(a.OffPt,a.OutPt2.Pt)){if(P!==w)return!1;for(H=a.OutPt1.Next;H!==F&&e.IntPoint.op_Equality(H.Pt,a.OffPt);)H=H.Next;var Pt=H.Pt.Y>a.OffPt.Y;for(st=a.OutPt2.Next;st!==_&&e.IntPoint.op_Equality(st.Pt,a.OffPt);)st=st.Next;var Bt=st.Pt.Y>a.OffPt.Y;return Pt===Bt?!1:Pt?(H=this.DupOutPt(F,!1),st=this.DupOutPt(_,!0),F.Prev=_,_.Next=F,H.Next=st,st.Prev=H,a.OutPt1=F,a.OutPt2=H,!0):(H=this.DupOutPt(F,!0),st=this.DupOutPt(_,!1),F.Next=_,_.Prev=F,H.Prev=st,st.Next=H,a.OutPt1=F,a.OutPt2=H,!0);}else if(yt){for(H=F;F.Prev.Pt.Y===F.Pt.Y&&F.Prev!==H&&F.Prev!==_;)F=F.Prev;for(;H.Next.Pt.Y===H.Pt.Y&&H.Next!==F&&H.Next!==_;)H=H.Next;if(H.Next===F||H.Next===_)return!1;for(st=_;_.Prev.Pt.Y===_.Pt.Y&&_.Prev!==st&&_.Prev!==H;)_=_.Prev;for(;st.Next.Pt.Y===st.Pt.Y&&st.Next!==_&&st.Next!==F;)st=st.Next;if(st.Next===_||st.Next===F)return!1;var kt={Left:null,Right:null};if(!this.GetOverlap(F.Pt.X,H.Pt.X,_.Pt.X,st.Pt.X,kt))return!1;var jt=kt.Left,qt=kt.Right,oe=new e.IntPoint0(),me;return F.Pt.X>=jt&&F.Pt.X<=qt?(oe.X=F.Pt.X,oe.Y=F.Pt.Y,e.use_xyz&&(oe.Z=F.Pt.Z),me=F.Pt.X>H.Pt.X):_.Pt.X>=jt&&_.Pt.X<=qt?(oe.X=_.Pt.X,oe.Y=_.Pt.Y,e.use_xyz&&(oe.Z=_.Pt.Z),me=_.Pt.X>st.Pt.X):H.Pt.X>=jt&&H.Pt.X<=qt?(oe.X=H.Pt.X,oe.Y=H.Pt.Y,e.use_xyz&&(oe.Z=H.Pt.Z),me=H.Pt.X>F.Pt.X):(oe.X=st.Pt.X,oe.Y=st.Pt.Y,e.use_xyz&&(oe.Z=st.Pt.Z),me=st.Pt.X>_.Pt.X),a.OutPt1=F,a.OutPt2=_,this.JoinHorz(F,H,_,st,oe,me);}else{for(H=F.Next;e.IntPoint.op_Equality(H.Pt,F.Pt)&&H!==F;)H=H.Next;var Pe=H.Pt.Y>F.Pt.Y||!e.ClipperBase.SlopesEqual4(F.Pt,H.Pt,a.OffPt,this.m_UseFullRange);if(Pe){for(H=F.Prev;e.IntPoint.op_Equality(H.Pt,F.Pt)&&H!==F;)H=H.Prev;if(H.Pt.Y>F.Pt.Y||!e.ClipperBase.SlopesEqual4(F.Pt,H.Pt,a.OffPt,this.m_UseFullRange))return!1;}for(st=_.Next;e.IntPoint.op_Equality(st.Pt,_.Pt)&&st!==_;)st=st.Next;var De=st.Pt.Y>_.Pt.Y||!e.ClipperBase.SlopesEqual4(_.Pt,st.Pt,a.OffPt,this.m_UseFullRange);if(De){for(st=_.Prev;e.IntPoint.op_Equality(st.Pt,_.Pt)&&st!==_;)st=st.Prev;if(st.Pt.Y>_.Pt.Y||!e.ClipperBase.SlopesEqual4(_.Pt,st.Pt,a.OffPt,this.m_UseFullRange))return!1;}return H===F||st===_||H===st||P===w&&Pe===De?!1:Pe?(H=this.DupOutPt(F,!1),st=this.DupOutPt(_,!0),F.Prev=_,_.Next=F,H.Next=st,st.Prev=H,a.OutPt1=F,a.OutPt2=H,!0):(H=this.DupOutPt(F,!0),st=this.DupOutPt(_,!1),F.Next=_,_.Prev=F,H.Prev=st,st.Next=H,a.OutPt1=F,a.OutPt2=H,!0);}},e.Clipper.GetBounds=function(a){for(var P=0,w=a.length;P<w&&a[P].length===0;)P++;if(P===w)return new e.IntRect(0,0,0,0);var F=new e.IntRect();for(F.left=a[P][0].X,F.right=F.left,F.top=a[P][0].Y,F.bottom=F.top;P<w;P++)for(var H=0,_=a[P].length;H<_;H++)a[P][H].X<F.left?F.left=a[P][H].X:a[P][H].X>F.right&&(F.right=a[P][H].X),a[P][H].Y<F.top?F.top=a[P][H].Y:a[P][H].Y>F.bottom&&(F.bottom=a[P][H].Y);return F;},e.Clipper.prototype.GetBounds2=function(a){var P=a,w=new e.IntRect();for(w.left=a.Pt.X,w.right=a.Pt.X,w.top=a.Pt.Y,w.bottom=a.Pt.Y,a=a.Next;a!==P;)a.Pt.X<w.left&&(w.left=a.Pt.X),a.Pt.X>w.right&&(w.right=a.Pt.X),a.Pt.Y<w.top&&(w.top=a.Pt.Y),a.Pt.Y>w.bottom&&(w.bottom=a.Pt.Y),a=a.Next;return w;},e.Clipper.PointInPolygon=function(a,P){var w=0,F=P.length;if(F<3)return 0;for(var H=P[0],_=1;_<=F;++_){var st=_===F?P[0]:P[_];if(st.Y===a.Y&&(st.X===a.X||H.Y===a.Y&&st.X>a.X==H.X<a.X))return-1;if(H.Y<a.Y!=st.Y<a.Y){if(H.X>=a.X){if(st.X>a.X)w=1-w;else{var yt=(H.X-a.X)*(st.Y-a.Y)-(st.X-a.X)*(H.Y-a.Y);if(yt===0)return-1;yt>0==st.Y>H.Y&&(w=1-w);}}else if(st.X>a.X){var yt=(H.X-a.X)*(st.Y-a.Y)-(st.X-a.X)*(H.Y-a.Y);if(yt===0)return-1;yt>0==st.Y>H.Y&&(w=1-w);}}H=st;}return w;},e.Clipper.prototype.PointInPolygon=function(a,P){var w=0,F=P,H=a.X,_=a.Y,st=P.Pt.X,yt=P.Pt.Y;do{P=P.Next;var Pt=P.Pt.X,Bt=P.Pt.Y;if(Bt===_&&(Pt===H||yt===_&&Pt>H==st<H))return-1;if(yt<_!=Bt<_){if(st>=H){if(Pt>H)w=1-w;else{var kt=(st-H)*(Bt-_)-(Pt-H)*(yt-_);if(kt===0)return-1;kt>0==Bt>yt&&(w=1-w);}}else if(Pt>H){var kt=(st-H)*(Bt-_)-(Pt-H)*(yt-_);if(kt===0)return-1;kt>0==Bt>yt&&(w=1-w);}}st=Pt,yt=Bt;}while(F!==P);return w;},e.Clipper.prototype.Poly2ContainsPoly1=function(a,P){var w=a;do{var F=this.PointInPolygon(w.Pt,P);if(F>=0)return F>0;w=w.Next;}while(w!==a);return!0;},e.Clipper.prototype.FixupFirstLefts1=function(a,P){for(var w,F,H=0,_=this.m_PolyOuts.length;H<_;H++)w=this.m_PolyOuts[H],F=e.Clipper.ParseFirstLeft(w.FirstLeft),w.Pts!==null&&F===a&&this.Poly2ContainsPoly1(w.Pts,P.Pts)&&(w.FirstLeft=P);},e.Clipper.prototype.FixupFirstLefts2=function(a,P){for(var w=P.FirstLeft,F,H,_=0,st=this.m_PolyOuts.length;_<st;_++)F=this.m_PolyOuts[_],!(F.Pts===null||F===P||F===a)&&(H=e.Clipper.ParseFirstLeft(F.FirstLeft),!(H!==w&&H!==a&&H!==P)&&(this.Poly2ContainsPoly1(F.Pts,a.Pts)?F.FirstLeft=a:this.Poly2ContainsPoly1(F.Pts,P.Pts)?F.FirstLeft=P:(F.FirstLeft===a||F.FirstLeft===P)&&(F.FirstLeft=w)));},e.Clipper.prototype.FixupFirstLefts3=function(a,P){for(var w,F,H=0,_=this.m_PolyOuts.length;H<_;H++)w=this.m_PolyOuts[H],F=e.Clipper.ParseFirstLeft(w.FirstLeft),w.Pts!==null&&F===a&&(w.FirstLeft=P);},e.Clipper.ParseFirstLeft=function(a){for(;a!==null&&a.Pts===null;)a=a.FirstLeft;return a;},e.Clipper.prototype.JoinCommonEdges=function(){for(var a=0,P=this.m_Joins.length;a<P;a++){var w=this.m_Joins[a],F=this.GetOutRec(w.OutPt1.Idx),H=this.GetOutRec(w.OutPt2.Idx);if(!(F.Pts===null||H.Pts===null)&&!(F.IsOpen||H.IsOpen)){var _;F===H?_=F:this.OutRec1RightOfOutRec2(F,H)?_=H:this.OutRec1RightOfOutRec2(H,F)?_=F:_=this.GetLowermostRec(F,H),this.JoinPoints(w,F,H)&&(F===H?(F.Pts=w.OutPt1,F.BottomPt=null,H=this.CreateOutRec(),H.Pts=w.OutPt2,this.UpdateOutPtIdxs(H),this.Poly2ContainsPoly1(H.Pts,F.Pts)?(H.IsHole=!F.IsHole,H.FirstLeft=F,this.m_UsingPolyTree&&this.FixupFirstLefts2(H,F),(H.IsHole^this.ReverseSolution)==this.Area$1(H)>0&&this.ReversePolyPtLinks(H.Pts)):this.Poly2ContainsPoly1(F.Pts,H.Pts)?(H.IsHole=F.IsHole,F.IsHole=!H.IsHole,H.FirstLeft=F.FirstLeft,F.FirstLeft=H,this.m_UsingPolyTree&&this.FixupFirstLefts2(F,H),(F.IsHole^this.ReverseSolution)==this.Area$1(F)>0&&this.ReversePolyPtLinks(F.Pts)):(H.IsHole=F.IsHole,H.FirstLeft=F.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(F,H))):(H.Pts=null,H.BottomPt=null,H.Idx=F.Idx,F.IsHole=_.IsHole,_===H&&(F.FirstLeft=H.FirstLeft),H.FirstLeft=F,this.m_UsingPolyTree&&this.FixupFirstLefts3(H,F)));}}},e.Clipper.prototype.UpdateOutPtIdxs=function(a){var P=a.Pts;do P.Idx=a.Idx,P=P.Prev;while(P!==a.Pts);},e.Clipper.prototype.DoSimplePolygons=function(){for(var a=0;a<this.m_PolyOuts.length;){var P=this.m_PolyOuts[a++],w=P.Pts;if(!(w===null||P.IsOpen))do{for(var F=w.Next;F!==P.Pts;){if(e.IntPoint.op_Equality(w.Pt,F.Pt)&&F.Next!==w&&F.Prev!==w){var H=w.Prev,_=F.Prev;w.Prev=_,_.Next=w,F.Prev=H,H.Next=F,P.Pts=w;var st=this.CreateOutRec();st.Pts=F,this.UpdateOutPtIdxs(st),this.Poly2ContainsPoly1(st.Pts,P.Pts)?(st.IsHole=!P.IsHole,st.FirstLeft=P,this.m_UsingPolyTree&&this.FixupFirstLefts2(st,P)):this.Poly2ContainsPoly1(P.Pts,st.Pts)?(st.IsHole=P.IsHole,P.IsHole=!st.IsHole,st.FirstLeft=P.FirstLeft,P.FirstLeft=st,this.m_UsingPolyTree&&this.FixupFirstLefts2(P,st)):(st.IsHole=P.IsHole,st.FirstLeft=P.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(P,st)),F=w;}F=F.Next;}w=w.Next;}while(w!==P.Pts);}},e.Clipper.Area=function(a){if(!Array.isArray(a))return 0;var P=a.length;if(P<3)return 0;for(var w=0,F=0,H=P-1;F<P;++F)w+=(a[H].X+a[F].X)*(a[H].Y-a[F].Y),H=F;return-w*0.5;},e.Clipper.prototype.Area=function(a){var P=a;if(a===null)return 0;var w=0;do w=w+(a.Prev.Pt.X+a.Pt.X)*(a.Prev.Pt.Y-a.Pt.Y),a=a.Next;while(a!==P);return w*0.5;},e.Clipper.prototype.Area$1=function(a){return this.Area(a.Pts);},e.Clipper.SimplifyPolygon=function(a,P){var w=new Array(),F=new e.Clipper(0);return F.StrictlySimple=!0,F.AddPath(a,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,w,P,P),w;},e.Clipper.SimplifyPolygons=function(a,P){_typeof(P)>"u"&&(P=e.PolyFillType.pftEvenOdd);var w=new Array(),F=new e.Clipper(0);return F.StrictlySimple=!0,F.AddPaths(a,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,w,P,P),w;},e.Clipper.DistanceSqrd=function(a,P){var w=a.X-P.X,F=a.Y-P.Y;return w*w+F*F;},e.Clipper.DistanceFromLineSqrd=function(a,P,w){var F=P.Y-w.Y,H=w.X-P.X,_=F*P.X+H*P.Y;return _=F*a.X+H*a.Y-_,_*_/(F*F+H*H);},e.Clipper.SlopesNearCollinear=function(a,P,w,F){return Math.abs(a.X-P.X)>Math.abs(a.Y-P.Y)?a.X>P.X==a.X<w.X?e.Clipper.DistanceFromLineSqrd(a,P,w)<F:P.X>a.X==P.X<w.X?e.Clipper.DistanceFromLineSqrd(P,a,w)<F:e.Clipper.DistanceFromLineSqrd(w,a,P)<F:a.Y>P.Y==a.Y<w.Y?e.Clipper.DistanceFromLineSqrd(a,P,w)<F:P.Y>a.Y==P.Y<w.Y?e.Clipper.DistanceFromLineSqrd(P,a,w)<F:e.Clipper.DistanceFromLineSqrd(w,a,P)<F;},e.Clipper.PointsAreClose=function(a,P,w){var F=a.X-P.X,H=a.Y-P.Y;return F*F+H*H<=w;},e.Clipper.ExcludeOp=function(a){var P=a.Prev;return P.Next=a.Next,a.Next.Prev=P,P.Idx=0,P;},e.Clipper.CleanPolygon=function(a,P){_typeof(P)>"u"&&(P=1.415);var w=a.length;if(w===0)return new Array();for(var F=new Array(w),H=0;H<w;++H)F[H]=new e.OutPt();for(var H=0;H<w;++H)F[H].Pt=a[H],F[H].Next=F[(H+1)%w],F[H].Next.Prev=F[H],F[H].Idx=0;for(var _=P*P,st=F[0];st.Idx===0&&st.Next!==st.Prev;)e.Clipper.PointsAreClose(st.Pt,st.Prev.Pt,_)?(st=e.Clipper.ExcludeOp(st),w--):e.Clipper.PointsAreClose(st.Prev.Pt,st.Next.Pt,_)?(e.Clipper.ExcludeOp(st.Next),st=e.Clipper.ExcludeOp(st),w-=2):e.Clipper.SlopesNearCollinear(st.Prev.Pt,st.Pt,st.Next.Pt,_)?(st=e.Clipper.ExcludeOp(st),w--):(st.Idx=1,st=st.Next);w<3&&(w=0);for(var yt=new Array(w),H=0;H<w;++H)yt[H]=new e.IntPoint1(st.Pt),st=st.Next;return F=null,yt;},e.Clipper.CleanPolygons=function(a,P){for(var w=new Array(a.length),F=0,H=a.length;F<H;F++)w[F]=e.Clipper.CleanPolygon(a[F],P);return w;},e.Clipper.Minkowski=function(a,P,w,F){var H=F?1:0,_=a.length,st=P.length,yt=new Array();if(w)for(var Pt=0;Pt<st;Pt++){for(var Bt=new Array(_),kt=0,jt=a.length,qt=a[kt];kt<jt;kt++,qt=a[kt])Bt[kt]=new e.IntPoint2(P[Pt].X+qt.X,P[Pt].Y+qt.Y);yt.push(Bt);}else for(var Pt=0;Pt<st;Pt++){for(var Bt=new Array(_),kt=0,jt=a.length,qt=a[kt];kt<jt;kt++,qt=a[kt])Bt[kt]=new e.IntPoint2(P[Pt].X-qt.X,P[Pt].Y-qt.Y);yt.push(Bt);}for(var oe=new Array(),Pt=0;Pt<st-1+H;Pt++)for(var kt=0;kt<_;kt++){var me=new Array();me.push(yt[Pt%st][kt%_]),me.push(yt[(Pt+1)%st][kt%_]),me.push(yt[(Pt+1)%st][(kt+1)%_]),me.push(yt[Pt%st][(kt+1)%_]),e.Clipper.Orientation(me)||me.reverse(),oe.push(me);}return oe;},e.Clipper.MinkowskiSum=function(a,P,w){if(P[0]instanceof Array){for(var H=P,st=new e.Paths(),_=new e.Clipper(),yt=0;yt<H.length;++yt){var Pt=e.Clipper.Minkowski(a,H[yt],!0,w);if(_.AddPaths(Pt,e.PolyType.ptSubject,!0),w){var F=e.Clipper.TranslatePath(H[yt],a[0]);_.AddPath(F,e.PolyType.ptClip,!0);}}return _.Execute(e.ClipType.ctUnion,st,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),st;}else{var F=P,H=e.Clipper.Minkowski(a,F,!0,w),_=new e.Clipper();return _.AddPaths(H,e.PolyType.ptSubject,!0),_.Execute(e.ClipType.ctUnion,H,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),H;}},e.Clipper.TranslatePath=function(a,P){for(var w=new e.Path(),F=0;F<a.length;F++)w.push(new e.IntPoint2(a[F].X+P.X,a[F].Y+P.Y));return w;},e.Clipper.MinkowskiDiff=function(a,P){var w=e.Clipper.Minkowski(a,P,!1,!0),F=new e.Clipper();return F.AddPaths(w,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,w,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),w;},e.Clipper.PolyTreeToPaths=function(a){var P=new Array();return e.Clipper.AddPolyNodeToPaths(a,e.Clipper.NodeType.ntAny,P),P;},e.Clipper.AddPolyNodeToPaths=function(a,P,w){var F=!0;switch(P){case e.Clipper.NodeType.ntOpen:return;case e.Clipper.NodeType.ntClosed:F=!a.IsOpen;break;}a.m_polygon.length>0&&F&&w.push(a.m_polygon);for(var H=0,_=a.Childs(),st=_.length,yt=_[H];H<st;H++,yt=_[H])e.Clipper.AddPolyNodeToPaths(yt,P,w);},e.Clipper.OpenPathsFromPolyTree=function(a){for(var P=new e.Paths(),w=0,F=a.ChildCount();w<F;w++)a.Childs()[w].IsOpen&&P.push(a.Childs()[w].m_polygon);return P;},e.Clipper.ClosedPathsFromPolyTree=function(a){var P=new e.Paths();return e.Clipper.AddPolyNodeToPaths(a,e.Clipper.NodeType.ntClosed,P),P;},Vn(e.Clipper,e.ClipperBase),e.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},e.ClipperOffset=function(a,P){_typeof(a)>"u"&&(a=2),_typeof(P)>"u"&&(P=e.ClipperOffset.def_arc_tolerance),this.m_destPolys=new e.Paths(),this.m_srcPoly=new e.Path(),this.m_destPoly=new e.Path(),this.m_normals=new Array(),this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new e.IntPoint0(),this.m_polyNodes=new e.PolyNode(),this.MiterLimit=a,this.ArcTolerance=P,this.m_lowest.X=-1;},e.ClipperOffset.two_pi=6.28318530717959,e.ClipperOffset.def_arc_tolerance=0.25,e.ClipperOffset.prototype.Clear=function(){e.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1;},e.ClipperOffset.Round=e.Clipper.Round,e.ClipperOffset.prototype.AddPath=function(a,P,w){var F=a.length-1;if(!(F<0)){var H=new e.PolyNode();if(H.m_jointype=P,H.m_endtype=w,w===e.EndType.etClosedLine||w===e.EndType.etClosedPolygon)for(;F>0&&e.IntPoint.op_Equality(a[0],a[F]);)F--;H.m_polygon.push(a[0]);for(var _=0,st=0,yt=1;yt<=F;yt++)e.IntPoint.op_Inequality(H.m_polygon[_],a[yt])&&(_++,H.m_polygon.push(a[yt]),(a[yt].Y>H.m_polygon[st].Y||a[yt].Y===H.m_polygon[st].Y&&a[yt].X<H.m_polygon[st].X)&&(st=_));if(!(w===e.EndType.etClosedPolygon&&_<2)&&(this.m_polyNodes.AddChild(H),w===e.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,st);else{var Pt=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(H.m_polygon[st].Y>Pt.Y||H.m_polygon[st].Y===Pt.Y&&H.m_polygon[st].X<Pt.X)&&(this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,st));}}},e.ClipperOffset.prototype.AddPaths=function(a,P,w){for(var F=0,H=a.length;F<H;F++)this.AddPath(a[F],P,w);},e.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!e.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var a=0;a<this.m_polyNodes.ChildCount();a++){var P=this.m_polyNodes.Childs()[a];(P.m_endtype===e.EndType.etClosedPolygon||P.m_endtype===e.EndType.etClosedLine&&e.Clipper.Orientation(P.m_polygon))&&P.m_polygon.reverse();}else for(var a=0;a<this.m_polyNodes.ChildCount();a++){var P=this.m_polyNodes.Childs()[a];P.m_endtype===e.EndType.etClosedLine&&!e.Clipper.Orientation(P.m_polygon)&&P.m_polygon.reverse();}},e.ClipperOffset.GetUnitNormal=function(a,P){var w=P.X-a.X,F=P.Y-a.Y;if(w===0&&F===0)return new e.DoublePoint2(0,0);var H=1/Math.sqrt(w*w+F*F);return w*=H,F*=H,new e.DoublePoint2(F,-w);},e.ClipperOffset.prototype.DoOffset=function(a){if(this.m_destPolys=new Array(),this.m_delta=a,e.ClipperBase.near_zero(a)){for(var P=0;P<this.m_polyNodes.ChildCount();P++){var w=this.m_polyNodes.Childs()[P];w.m_endtype===e.EndType.etClosedPolygon&&this.m_destPolys.push(w.m_polygon);}return;}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=0.5;var F;this.ArcTolerance<=0?F=e.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(a)*e.ClipperOffset.def_arc_tolerance?F=Math.abs(a)*e.ClipperOffset.def_arc_tolerance:F=this.ArcTolerance;var H=3.14159265358979/Math.acos(1-F/Math.abs(a));this.m_sin=Math.sin(e.ClipperOffset.two_pi/H),this.m_cos=Math.cos(e.ClipperOffset.two_pi/H),this.m_StepsPerRad=H/e.ClipperOffset.two_pi,a<0&&(this.m_sin=-this.m_sin);for(var P=0;P<this.m_polyNodes.ChildCount();P++){var w=this.m_polyNodes.Childs()[P];this.m_srcPoly=w.m_polygon;var _=this.m_srcPoly.length;if(!(_===0||a<=0&&(_<3||w.m_endtype!==e.EndType.etClosedPolygon))){if(this.m_destPoly=new Array(),_===1){if(w.m_jointype===e.JoinType.jtRound)for(var st=1,yt=0,Pt=1;Pt<=H;Pt++){this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+st*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+yt*a)));var Bt=st;st=st*this.m_cos-this.m_sin*yt,yt=Bt*this.m_sin+yt*this.m_cos;}else for(var st=-1,yt=-1,Pt=0;Pt<4;++Pt)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+st*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+yt*a))),st<0?st=1:yt<0?yt=1:st=-1;this.m_destPolys.push(this.m_destPoly);continue;}this.m_normals.length=0;for(var Pt=0;Pt<_-1;Pt++)this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[Pt],this.m_srcPoly[Pt+1]));if(w.m_endtype===e.EndType.etClosedLine||w.m_endtype===e.EndType.etClosedPolygon?this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[_-1],this.m_srcPoly[0])):this.m_normals.push(new e.DoublePoint1(this.m_normals[_-2])),w.m_endtype===e.EndType.etClosedPolygon){for(var kt=_-1,Pt=0;Pt<_;Pt++)kt=this.OffsetPoint(Pt,kt,w.m_jointype);this.m_destPolys.push(this.m_destPoly);}else if(w.m_endtype===e.EndType.etClosedLine){for(var kt=_-1,Pt=0;Pt<_;Pt++)kt=this.OffsetPoint(Pt,kt,w.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array();for(var jt=this.m_normals[_-1],Pt=_-1;Pt>0;Pt--)this.m_normals[Pt]=new e.DoublePoint2(-this.m_normals[Pt-1].X,-this.m_normals[Pt-1].Y);this.m_normals[0]=new e.DoublePoint2(-jt.X,-jt.Y),kt=0;for(var Pt=_-1;Pt>=0;Pt--)kt=this.OffsetPoint(Pt,kt,w.m_jointype);this.m_destPolys.push(this.m_destPoly);}else{for(var kt=0,Pt=1;Pt<_-1;++Pt)kt=this.OffsetPoint(Pt,kt,w.m_jointype);var qt;if(w.m_endtype===e.EndType.etOpenButt){var Pt=_-1;qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[Pt].X+this.m_normals[Pt].X*a),e.ClipperOffset.Round(this.m_srcPoly[Pt].Y+this.m_normals[Pt].Y*a)),this.m_destPoly.push(qt),qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[Pt].X-this.m_normals[Pt].X*a),e.ClipperOffset.Round(this.m_srcPoly[Pt].Y-this.m_normals[Pt].Y*a)),this.m_destPoly.push(qt);}else{var Pt=_-1;kt=_-2,this.m_sinA=0,this.m_normals[Pt]=new e.DoublePoint2(-this.m_normals[Pt].X,-this.m_normals[Pt].Y),w.m_endtype===e.EndType.etOpenSquare?this.DoSquare(Pt,kt):this.DoRound(Pt,kt);}for(var Pt=_-1;Pt>0;Pt--)this.m_normals[Pt]=new e.DoublePoint2(-this.m_normals[Pt-1].X,-this.m_normals[Pt-1].Y);this.m_normals[0]=new e.DoublePoint2(-this.m_normals[1].X,-this.m_normals[1].Y),kt=_-1;for(var Pt=kt-1;Pt>0;--Pt)kt=this.OffsetPoint(Pt,kt,w.m_jointype);w.m_endtype===e.EndType.etOpenButt?(qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*a)),this.m_destPoly.push(qt),qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*a)),this.m_destPoly.push(qt)):(kt=1,this.m_sinA=0,w.m_endtype===e.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly);}}}},e.ClipperOffset.prototype.Execute=function(){var a=arguments,P=a[0]instanceof e.PolyTree;if(P){var w=a[0],F=a[1];w.Clear(),this.FixOrientations(),this.DoOffset(F);var H=new e.Clipper(0);if(H.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),F>0)H.Execute(e.ClipType.ctUnion,w,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var _=e.Clipper.GetBounds(this.m_destPolys),st=new e.Path();if(st.push(new e.IntPoint2(_.left-10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.top-10)),st.push(new e.IntPoint2(_.left-10,_.top-10)),H.AddPath(st,e.PolyType.ptSubject,!0),H.ReverseSolution=!0,H.Execute(e.ClipType.ctUnion,w,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),w.ChildCount()===1&&w.Childs()[0].ChildCount()>0){var yt=w.Childs()[0];w.Childs()[0]=yt.Childs()[0],w.Childs()[0].m_Parent=w;for(var Pt=1;Pt<yt.ChildCount();Pt++)w.AddChild(yt.Childs()[Pt]);}else w.Clear();}}else{var w=a[0],F=a[1];e.Clear(w),this.FixOrientations(),this.DoOffset(F);var H=new e.Clipper(0);if(H.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),F>0)H.Execute(e.ClipType.ctUnion,w,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var _=e.Clipper.GetBounds(this.m_destPolys),st=new e.Path();st.push(new e.IntPoint2(_.left-10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.top-10)),st.push(new e.IntPoint2(_.left-10,_.top-10)),H.AddPath(st,e.PolyType.ptSubject,!0),H.ReverseSolution=!0,H.Execute(e.ClipType.ctUnion,w,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),w.length>0&&w.splice(0,1);}}},e.ClipperOffset.prototype.OffsetPoint=function(a,P,w){if(this.m_sinA=this.m_normals[P].X*this.m_normals[a].Y-this.m_normals[a].X*this.m_normals[P].Y,Math.abs(this.m_sinA*this.m_delta)<1){var F=this.m_normals[P].X*this.m_normals[a].X+this.m_normals[a].Y*this.m_normals[P].Y;if(F>0)return this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[P].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[P].Y*this.m_delta))),P;}else this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1);if(this.m_sinA*this.m_delta<0)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[P].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[P].Y*this.m_delta))),this.m_destPoly.push(new e.IntPoint1(this.m_srcPoly[a])),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[a].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[a].Y*this.m_delta)));else switch(w){case e.JoinType.jtMiter:{var H=1+(this.m_normals[a].X*this.m_normals[P].X+this.m_normals[a].Y*this.m_normals[P].Y);H>=this.m_miterLim?this.DoMiter(a,P,H):this.DoSquare(a,P);break;}case e.JoinType.jtSquare:this.DoSquare(a,P);break;case e.JoinType.jtRound:this.DoRound(a,P);break;}return P=a,P;},e.ClipperOffset.prototype.DoSquare=function(a,P){var w=Math.tan(Math.atan2(this.m_sinA,this.m_normals[P].X*this.m_normals[a].X+this.m_normals[P].Y*this.m_normals[a].Y)/4);this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_delta*(this.m_normals[P].X-this.m_normals[P].Y*w)),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_delta*(this.m_normals[P].Y+this.m_normals[P].X*w)))),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_delta*(this.m_normals[a].X+this.m_normals[a].Y*w)),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_delta*(this.m_normals[a].Y-this.m_normals[a].X*w))));},e.ClipperOffset.prototype.DoMiter=function(a,P,w){var F=this.m_delta/w;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+(this.m_normals[P].X+this.m_normals[a].X)*F),e.ClipperOffset.Round(this.m_srcPoly[a].Y+(this.m_normals[P].Y+this.m_normals[a].Y)*F)));},e.ClipperOffset.prototype.DoRound=function(a,P){for(var w=Math.atan2(this.m_sinA,this.m_normals[P].X*this.m_normals[a].X+this.m_normals[P].Y*this.m_normals[a].Y),F=Math.max(e.Cast_Int32(e.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(w))),1),H=this.m_normals[P].X,_=this.m_normals[P].Y,st,yt=0;yt<F;++yt)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+H*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+_*this.m_delta))),st=H,H=H*this.m_cos-this.m_sin*_,_=st*this.m_sin+_*this.m_cos;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[a].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[a].Y*this.m_delta)));},e.Error=function(a){try{throw new Error(a);}catch(P){alert(P.message);}},e.JS={},e.JS.AreaOfPolygon=function(a,P){return P||(P=1),e.Clipper.Area(a)/(P*P);},e.JS.AreaOfPolygons=function(a,P){P||(P=1);for(var w=0,F=0;F<a.length;F++)w+=e.Clipper.Area(a[F]);return w/(P*P);},e.JS.BoundsOfPath=function(a,P){return e.JS.BoundsOfPaths([a],P);},e.JS.BoundsOfPaths=function(a,P){P||(P=1);var w=e.Clipper.GetBounds(a);return w.left/=P,w.bottom/=P,w.right/=P,w.top/=P,w;},e.JS.Clean=function(F,P){if(!(F instanceof Array))return[];var w=F[0]instanceof Array,F=e.JS.Clone(F);if(typeof P!="number"||P===null)return e.Error("Delta is not a number in Clean()."),F;if(F.length===0||F.length===1&&F[0].length===0||P<0)return F;w||(F=[F]);for(var H=F.length,_,st,yt,Pt,Bt,kt,jt,qt=[],oe=0;oe<H;oe++)if(st=F[oe],_=st.length,_!==0){if(_<3){yt=st,qt.push(yt);continue;}for(yt=st,Pt=P*P,Bt=st[0],kt=1,jt=1;jt<_;jt++)(st[jt].X-Bt.X)*(st[jt].X-Bt.X)+(st[jt].Y-Bt.Y)*(st[jt].Y-Bt.Y)<=Pt||(yt[kt]=st[jt],Bt=st[jt],kt++);Bt=st[kt-1],(st[0].X-Bt.X)*(st[0].X-Bt.X)+(st[0].Y-Bt.Y)*(st[0].Y-Bt.Y)<=Pt&&kt--,kt<_&&yt.splice(kt,_-kt),yt.length&&qt.push(yt);}return!w&&qt.length?qt=qt[0]:!w&&qt.length===0?qt=[]:w&&qt.length===0&&(qt=[[]]),qt;},e.JS.Clone=function(a){if(!(a instanceof Array))return[];if(a.length===0)return[];if(a.length===1&&a[0].length===0)return[[]];var P=a[0]instanceof Array;P||(a=[a]);var w=a.length,F,H,_,st,yt=new Array(w);for(H=0;H<w;H++){for(F=a[H].length,st=new Array(F),_=0;_<F;_++)st[_]={X:a[H][_].X,Y:a[H][_].Y};yt[H]=st;}return P||(yt=yt[0]),yt;},e.JS.Lighten=function(a,P){if(!(a instanceof Array))return[];if(typeof P!="number"||P===null)return e.Error("Tolerance is not a number in Lighten()."),e.JS.Clone(a);if(a.length===0||a.length===1&&a[0].length===0||P<0)return e.JS.Clone(a);var w=a[0]instanceof Array;w||(a=[a]);var F,H,_,st,yt,Pt,Bt,kt,jt,qt,oe,me,Pe,De,or,Rr,en,jo=a.length,Go=P*P,gn=[];for(F=0;F<jo;F++)if(_=a[F],Pt=_.length,Pt!==0){for(st=0;st<1e6;st++){for(yt=[],Pt=_.length,_[Pt-1].X!==_[0].X||_[Pt-1].Y!==_[0].Y?(me=1,_.push({X:_[0].X,Y:_[0].Y}),Pt=_.length):me=0,oe=[],H=0;H<Pt-2;H++)Bt=_[H],jt=_[H+1],kt=_[H+2],Rr=Bt.X,en=Bt.Y,Pe=kt.X-Rr,De=kt.Y-en,(Pe!==0||De!==0)&&(or=((jt.X-Rr)*Pe+(jt.Y-en)*De)/(Pe*Pe+De*De),or>1?(Rr=kt.X,en=kt.Y):or>0&&(Rr+=Pe*or,en+=De*or)),Pe=jt.X-Rr,De=jt.Y-en,qt=Pe*Pe+De*De,qt<=Go&&(oe[H+1]=1,H++);for(yt.push({X:_[0].X,Y:_[0].Y}),H=1;H<Pt-1;H++)oe[H]||yt.push({X:_[H].X,Y:_[H].Y});if(yt.push({X:_[Pt-1].X,Y:_[Pt-1].Y}),me&&_.pop(),oe.length)_=yt;else break;}Pt=yt.length,yt[Pt-1].X===yt[0].X&&yt[Pt-1].Y===yt[0].Y&&yt.pop(),yt.length>2&&gn.push(yt);}return w||(gn=gn[0]),_typeof(gn)>"u"&&(gn=[]),gn;},e.JS.PerimeterOfPath=function(a,P,w){if(_typeof(a)>"u")return 0;var F=Math.sqrt,H=0,_,st,yt=0,Pt=0,Bt=0,kt=0,jt=a.length;if(jt<2)return 0;for(P&&(a[jt]=a[0],jt++);--jt;)_=a[jt],yt=_.X,Pt=_.Y,st=a[jt-1],Bt=st.X,kt=st.Y,H+=F((yt-Bt)*(yt-Bt)+(Pt-kt)*(Pt-kt));return P&&a.pop(),H/w;},e.JS.PerimeterOfPaths=function(a,P,w){w||(w=1);for(var F=0,H=0;H<a.length;H++)F+=e.JS.PerimeterOfPath(a[H],P,w);return F;},e.JS.ScaleDownPath=function(a,P){var w,F;for(P||(P=1),w=a.length;w--;)F=a[w],F.X=F.X/P,F.Y=F.Y/P;},e.JS.ScaleDownPaths=function(a,P){var w,F,H;for(P||(P=1),w=a.length;w--;)for(F=a[w].length;F--;)H=a[w][F],H.X=H.X/P,H.Y=H.Y/P;},e.JS.ScaleUpPath=function(a,P){var w,F,H=Math.round;for(P||(P=1),w=a.length;w--;)F=a[w],F.X=H(F.X*P),F.Y=H(F.Y*P);},e.JS.ScaleUpPaths=function(a,P){var w,F,H,_=Math.round;for(P||(P=1),w=a.length;w--;)for(F=a[w].length;F--;)H=a[w][F],H.X=_(H.X*P),H.Y=_(H.Y*P);},e.ExPolygons=function(){return[];},e.ExPolygon=function(){this.outer=null,this.holes=null;},e.JS.AddOuterPolyNodeToExPolygons=function(a,P){var w=new e.ExPolygon();w.outer=a.Contour();var F=a.Childs(),H=F.length;w.holes=new Array(H);var _,st,yt,Pt,Bt,kt;for(yt=0;yt<H;yt++)for(_=F[yt],w.holes[yt]=_.Contour(),Pt=0,Bt=_.Childs(),kt=Bt.length;Pt<kt;Pt++)st=Bt[Pt],e.JS.AddOuterPolyNodeToExPolygons(st,P);P.push(w);},e.JS.ExPolygonsToPaths=function(a){var P,w,F,H,_=new e.Paths();for(P=0,F=a.length;P<F;P++)for(_.push(a[P].outer),w=0,H=a[P].holes.length;w<H;w++)_.push(a[P].holes[w]);return _;},e.JS.PolyTreeToExPolygons=function(a){var P=new e.ExPolygons(),w,F,H,_;for(F=0,H=a.Childs(),_=H.length;F<_;F++)w=H[F],e.JS.AddOuterPolyNodeToExPolygons(w,P);return P;};})();})(mh);var z2=mh.exports,Qr=/* @__PURE__ */Ln(z2);function yh(i,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(i[0]-e[0])<t&&Math.abs(i[1]-e[1])<t;}function $2(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length===0)return[];var t=[[i[0][0],i[0][1]]];for(var r=1;r<i.length;r++)yh([i[r][0],i[r][1]],t[t.length-1],e)||t.push([i[r][0],i[r][1]]);return t;}function j2(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length<=2)return i;var t=i[0],r=i[i.length-1];return yh(t,r,e)?i.slice(0,-1):i;}function G2(i){var e=i.reduce(function(r,n){return r+n[0];},0)/i.length,t=i.reduce(function(r,n){return r+n[1];},0)/i.length;return[e,t];}function du(i,e){return Math.atan2(e[1]-i[1],e[0]-i[0]);}function H2(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length<=2)return i;var t=[];var _iterator16=_createForOfIteratorHelper(i),_step16;try{var _loop3=function _loop3(){var n=_step16.value;t.some(function(c){return Math.abs(c[0]-n[0])<e&&Math.abs(c[1]-n[1])<e;})||t.push([n[0],n[1]]);};for(_iterator16.s();!(_step16=_iterator16.n()).done;){_loop3();}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var r=G2(t);return t.sort(function(n,s){var c=du(r,n),l=du(r,s);return c-l;});}function k2(i,e){var t=e[0].x<e[e.length-1].x;return i.map(function(n){var c=n.map(function(l){var f=-1,h=1/0,m=0;for(var u=0;u<e.length;u++){var y=e[u],T=Math.sqrt(Math.pow(y.x-l[0],2)+Math.pow(y.y-l[1],2));T<h&&(h=T,f=u,m=y.z);}return{point:l,index:f,bestZ:m};}).sort(function(l,f){return l.index-f.index;}).map(function(l){return[].concat(_toConsumableArray(l.point),[l.bestZ]);});return t&&c[0][0]>c[c.length-1][0]||!t&&c[0][0]<c[c.length-1][0]?c.reverse():c;}).sort(function(n,s){var c=n[0][0],l=s[0][0];return t?c-l:l-c;});}function K2(i,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var n=i.map(function(u){return[u.x,u.y];}),s=function s(u,y){return u.map(function(_ref166){var _ref167=_slicedToArray(_ref166,2),T=_ref167[0],E=_ref167[1];return{X:Math.round(T*y),Y:Math.round(E*y)};});},c=new Qr.ClipperOffset();c.AddPath(s(n,1e3),Qr.JoinType.jtRound,Qr.EndType.etOpenButt);var l=[];c.Execute(l,1);var f=new Qr.Clipper();f.AddPaths(l,Qr.PolyType.ptSubject,!0),e.forEach(function(u){f.AddPath(s(u,1e3),Qr.PolyType.ptClip,!0);});var h=new Qr.Paths();f.Execute(Qr.ClipType.ctDifference,h,Qr.PolyFillType.pftNonZero,Qr.PolyFillType.pftNonZero);var m=h.map(function(u){return j2(H2($2(u.map(function(y){return[y.X/1e3,y.Y/1e3];}),t),t),t);}).filter(function(u){return u.length>=2;});return k2(m,i);}var Ph=/*#__PURE__*/function(_$t){function Ph(t){var _this62;_classCallCheck(this,Ph);_this62=_callSuper(this,Ph,[t]);dt(_this62,"canRotate",!0);dt(_this62,"scaleType",Ae.all);dt(_this62,"toolsType",Tt.Pencil);dt(_this62,"syncTimestamp");dt(_this62,"syncIndex",0);dt(_this62,"tmpPoints",[]);dt(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */dt(_this62,"uniThickness");dt(_this62,"workOptions");dt(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ph,_$t);return _createClass(Ph,[{key:"combineConsume",value:function combineConsume(){var l;var t=(l=this.workId)==null?void 0:l.toString();if(this.tmpPoints.length<2)return{type:xt.None};var r=this.transformDataAll(!0),n={name:t};var s;var c=this.drawLayer||this.fullLayer;return r.length&&(s=this.draw({attrs:n,tasks:r,replaceId:t,layer:c})),{rect:s,type:xt.DrawWork,dataType:Vt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Ph,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.drawCount,f=t.removeDrawCount,h=t.isSimpleWorker,m=r.workId,u=r.syncUnitTime;u&&(this.syncUnitTime=u);var _this$transformData=this.transformData(r,!1),y=_this$transformData.tasks,T=_this$transformData.effects,E=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,E,Math.max(0,this.tmpPoints.length-2));var C={name:m,id:er(l)&&l.toString()||void 0};var x,I=!1;var d=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),y.length&&(y[0].taskId-this.syncTimestamp>this.syncUnitTime&&(I=!0,this.syncTimestamp=y[0].taskId,this.syncIndex=this.tmpPoints.length),s||c||h)){var p=n?this.fullLayer:this.drawLayer||this.fullLayer;x=this.draw({attrs:C,tasks:y,effects:T,layer:p,removeDrawCount:f});}if(h){var _p13=[];return this.tmpPoints.slice(d).forEach(function(S){_p13.push(S.x,S.y,_this63.computRadius(S.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Vt.Local,op:I?_p13:void 0,index:I?d*3:void 0,rect:x,updateNodeOpt:{useAnimation:!0}});}if(s)return E>10&&this.tmpPoints.splice(0,E-10),{rect:x,type:xt.DrawWork,dataType:Vt.Local};var v=[];return this.tmpPoints.slice(d).forEach(function(p){v.push(p.x,p.y,_this63.computRadius(p.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Vt.Local,rect:x,op:I?v:void 0,index:I?d*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var m;var r=this.workId;if(t.data){var _t$data=t.data,u=_t$data.op,y=_t$data.workState;u!=null&&u.length&&y===te.Done&&this.workOptions.strokeType===we.Stroke&&this.updateTempPointsWithPressureWhenDone(u);}var n=this.transformDataAll(!0),s={name:r};var c;var l=this.fullLayer;if(n.length&&(c=this.draw({attrs:s,tasks:n,replaceId:r,layer:l})),this.tmpPoints.length<2)return this.replace(l,r),{type:xt.RemoveNode,removeIds:[r],rect:c};var f=[];this.tmpPoints.map(function(u){f.push(u.x,u.y,u.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var h=gr(f);return(m=this.vNodes)==null||m.setInfo(r,{rect:c,op:f,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&$t.getCenterPos(c,l)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:c,type:xt.FullWork,dataType:Vt.Local,ops:h,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 u,y;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState=t.workState,c=_t$workState===void 0?te.Done:_t$workState;this.tmpPoints.length=0;for(var T=0;T<r.length;T+=3){var E=new Jt(r[T],r[T+1],r[T+2]);if(this.tmpPoints.length>0){var C=this.tmpPoints[this.tmpPoints.length-1],x=pt.Sub(E,C).uni();E.setv(x);}this.tmpPoints.push(E);}if(this.tmpPoints.length<2)return;var l=this.transformDataAll(!0),f=(u=this.workId)==null?void 0:u.toString(),h={name:f};var m;if(f&&l.length){var _T9=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({attrs:h,tasks:l,replaceId:s,layer:_T9,isDrawEraserlines:c===te.Done}),(y=this.vNodes)==null||y.setInfo(f,{rect:m,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&$t.getCenterPos(m,_T9)});}return m;}},{key:"computPencilPoints",value:function computPencilPoints(t){var _this64=this;var r=[],n=t.op,s=t.eraserPolylines,c=t.eraserThickness;this.tmpPoints.length=0;for(var f=0;f<n.length;f+=3){var h=new Jt(n[f],n[f+1],n[f+2]);if(this.tmpPoints.length>0){var m=this.tmpPoints[this.tmpPoints.length-1],u=pt.Sub(h,m).uni();h.setv(u);}this.tmpPoints.push(h);}if(this.tmpPoints.length<2)return;var l=this.transformDataAll(!0);if(l.length){var _loop4=function _loop4(){var _l$_f=l[_f5],h=_l$_f.pos,m=_l$_f.points,u=m.map(function(E){return E.point.addXY(h[0],h[1]);}),y=[];var _iterator17=_createForOfIteratorHelper(s),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var E=_step17.value;var C=[];for(var _I33=0;_I33<E.length;_I33+=2){var _d30=new Jt(E[_I33],E[_I33+1]);if(C.length>0){var v=C[C.length-1].point,p=pt.Sub(_d30,v).uni();_d30.setv(p);}C.push({point:_d30,radius:c});}var _this64$computStroke=_this64.computStroke(C,!1),x=_this64$computStroke.ps;y.push(x.map(function(I){return I.XY;}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}K2(u,y,0.01).forEach(function(E){r.push(E.map(function(C){return[C[0],C[1],C[2]];}).flat(1));});};for(var _f5=0;_f5<l.length;_f5++){_loop4();}}return r;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.getTaskPoints(this.tmpPoints,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this65=this;var r=t.attrs,n=t.tasks,s=t.replaceId,c=t.effects,l=t.layer,f=t.removeDrawCount,_t$isDrawEraserlines=t.isDrawEraserlines,h=_t$isDrawEraserlines===void 0?!0:_t$isDrawEraserlines,_this$workOptions=this.workOptions,m=_this$workOptions.strokeColor,u=_this$workOptions.strokeType,y=_this$workOptions.thickness,T=_this$workOptions.zIndex,E=_this$workOptions.scale,C=_this$workOptions.rotate,x=_this$workOptions.translate,I=_this$workOptions.eraserlines,d=_this$workOptions.lineCap,v=_this$workOptions.lineDash;c!=null&&c.size&&(c.forEach(function(U){var M;(M=l.getElementById(U+""))==null||M.remove();}),c.clear()),f&&this.removeDrawCountNodes(l,f);var p;var S=[],A=l.worldPosition,R=l.worldScaling;for(var U=0;U<n.length;U++){var _n$U=n[U],M=_n$U.pos,W=_n$U.points,_this$computDrawPoint=this.computDrawPoints(W),Y=_this$computDrawPoint.ps,B=_this$computDrawPoint.rect;var N=void 0;var G=W.length===1;u===we.Stroke||G?N=En(Y,!0):N=En(Y,!1);var J={pos:M,d:N,fillColor:u===we.Stroke||G?m:void 0,lineDash:G?void 0:u===we.Dotted?[v&&v[0]||1,(v&&v[1]||2)*y]:u===we.LongDotted?[(v&&v[0]||1)*y,(v&&v[1]||2)*y]:void 0,strokeColor:m,lineCap:G?void 0:d,lineWidth:u===we.Stroke||G?0:y};p=Zt(p,{x:Math.floor((B.x+M[0])*R[0]+A[0]-$t.SafeBorderPadding),y:Math.floor((B.y+M[1])*R[1]+A[1]-$t.SafeBorderPadding),w:Math.floor(B.w*R[0]+2*$t.SafeBorderPadding),h:Math.floor(B.h*R[1]+2*$t.SafeBorderPadding)}),S.push(J);}E&&(r.scale=E),C&&(r.rotate=C),x&&(r.translate=x);var D=new mr();if(p){this.centerPos=$t.getCenterPos(p,l);var _U11=u===we.Stroke&&!I;D.attr(_objectSpread(_objectSpread({},r),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_U11?m:void 0,pos:this.centerPos,size:[(p.w-2*$t.SafeBorderPadding)/R[0],(p.h-2*$t.SafeBorderPadding)/R[1]],zIndex:T}));var _M9=S.map(function(W){return W.pos=[W.pos[0]-_this65.centerPos[0],W.pos[1]-_this65.centerPos[1]],new Mn(W);});D.append.apply(D,_toConsumableArray(_M9)),_U11&&D.seal(),I&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:D,eraserlines:I,pos:this.centerPos,layer:l},h)),this.replace(l,s,D);}if(E||C||x){var _U12=D==null?void 0:D.getBoundingClientRect();_U12&&(p={x:Math.floor(_U12.x-$t.SafeBorderPadding),y:Math.floor(_U12.y-$t.SafeBorderPadding),w:Math.floor(_U12.width+$t.SafeBorderPadding*2),h:Math.floor(_U12.height+$t.SafeBorderPadding*2)});}return this.isDelete&&D.setAttribute("opacity",0),p;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===we.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var r=this.workOptions.thickness;var n=t.map(function(s){return r=Math.max(r,s.radius),s.point;});return{ps:n,rect:Re(n,r)};}},{key:"computStroke",value:function computStroke(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t,r);}},{key:"computLineStroke",value:function computLineStroke(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=[],s=[];for(var f=0;f<t.length;f++){var _t$f=t[f],h=_t$f.point,m=_t$f.radius;var u=h.v;f===0&&t.length>1&&(u=t[f+1].point.v);var y=pt.Per(u).mul(m);n.push(Jt.Sub(h,y)),s.push(Jt.Add(h,y));}var c=t[t.length-1];if(r){var _f6=Jt.GetSemicircleStroke(c.point,n[n.length-1],-1,8),_h4=Jt.GetSemicircleStroke(t[0].point,s[0],-1,8),_m7=n.concat(_f6,s.reverse(),_h4);return{ps:_m7,rect:Re(_m7)};}var l=n.concat(s.reverse());return{ps:l,rect:Re(l)};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,s={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Jt.GetDotStroke(r,n,8),rect:s};}},{key:"transformData",value:function transformData(t,r){var n=t.op,s=t.workState;var c=this.tmpPoints.length-1,l=[];if(n!=null&&n.length&&s){var _this$workOptions2=this.workOptions,f=_this$workOptions2.strokeType,h=_this$workOptions2.thickness,m=/* @__PURE__ */new Set();c=f===we.Stroke?this.updateTempPointsWithPressure(n,h,m):this.updateTempPoints(n,h,m);var u=r?this.tmpPoints:this.tmpPoints.slice(c);return l=this.getTaskPoints(u,h),{tasks:l,effects:m,consumeIndex:c};}return{tasks:l,consumeIndex:c};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,r){return t*0.03*r+r*0.5;}},{key:"getMinZ",value:function getMinZ(t,r){return((r||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,r){var u;var n=[];if(t.length===0)return[];var s=0,c=t[0].x,l=t[0].y,f=[c,l],h=[],m=t[0].t;for(;s<t.length;){var y=t[s],T=y.x-c,E=y.y-l,C=y.z,x=r?this.computRadius(C,r):C;if(h.push({point:new Jt(T,E,C,t[s].v),radius:x}),s>0&&s<t.length-1){var _I34=t[s].getAngleByPoints(t[s-1],t[s+1]);if(_I34<60||_I34>300){var _d31=(u=h.pop())==null?void 0:u.point.clone();_d31&&n.push({taskId:m,pos:f,points:[].concat(_toConsumableArray(h),[{point:_d31,radius:x}])}),c=t[s].x,l=t[s].y,f=[c,l];var v=y.x-c,p=y.y-l;h=[{point:new Jt(v,p,C),radius:x}],m=Date.now();}}s++;}return n.push({taskId:m,pos:f,points:h}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,r,n){var s=Date.now(),c=this.tmpPoints.length;var l=c;for(var h=0;h<t.length;h+=2){l=Math.min(l,c);var m=this.tmpPoints.length,u=new Jt(t[h],t[h+1]);if(m===0){this.tmpPoints.push(u);continue;}var y=m-1,T=this.tmpPoints[y],E=pt.Sub(u,T).uni();if(u.isNear(T,r)){if(T.z<this.MAX_REPEAR){if(T.setz(Math.min(T.z+1,this.MAX_REPEAR)),l=Math.min(l,y),m>1){var _I35=m-1;for(;_I35>0;){var _d32=this.tmpPoints[_I35].distance(this.tmpPoints[_I35-1]),v=Math.max(this.tmpPoints[_I35].z-this.uniThickness*_d32,0);if(this.tmpPoints[_I35-1].z>=v)break;this.tmpPoints[_I35-1].setz(v),l=Math.min(l,_I35-1),_I35--;}}}else l=1/0;continue;}u.setv(E);var C=u.distance(T),x=Math.max(T.z-this.uniThickness*C,0);m>1&&pt.Equals(E,T.v,0.02)&&(x>0||T.z<=0)&&(n&&T.t&&n.add(T.t),this.tmpPoints.pop(),l=Math.min(y,l)),u.setz(x),this.tmpPoints.push(u);}if(l===1/0)return this.tmpPoints.length;var f=c;if(l===c){f=Math.max(f-1,0);var _h5=this.tmpPoints[f].t;_h5&&(n==null||n.add(_h5));}else{var _h6=c-1;for(f=l;_h6>=0;){var _m8=this.tmpPoints[_h6].t;if(_m8&&(n==null||n.add(_m8),_h6<=l)){f=_h6,_h6=-1;break;}_h6--;}}return this.tmpPoints[f].setT(s),f;}},{key:"updateTempPoints",value:function updateTempPoints(t,r,n){var h;var s=Date.now(),c=this.tmpPoints.length;var l=c;for(var m=0;m<t.length;m+=2){var u=this.tmpPoints.length,y=new Jt(t[m],t[m+1]);if(u===0){this.tmpPoints.push(y);continue;}var T=u-1,E=this.tmpPoints[T],C=pt.Sub(y,E).uni();if(y.isNear(E,r/2)){l=Math.min(T,l);continue;}pt.Equals(C,E.v,0.02)&&(n&&E.t&&n.add(E.t),this.tmpPoints.pop(),l=Math.min(T,l)),y.setv(C),this.tmpPoints.push(y);}var f=c;if(l===c){f=Math.max(f-1,0);var _m9=this.tmpPoints[f].t;_m9&&(n==null||n.add(_m9));}else{var _m10=Math.min(c-1,l);for(f=l;_m10>=0;){var _u4=(h=this.tmpPoints[_m10])==null?void 0:h.t;if(_u4&&(n==null||n.add(_u4),_m10<=l)){f=_m10,_m10=-1;break;}_m10--;}}return this.tmpPoints[f].setT(s),f;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var r=this.workOptions.thickness,n=t.length,s=this.getMinZ(r);for(var c=0;c<n;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var h=l-1,m=this.tmpPoints[h],u=pt.Sub(f,m).uni(),y=f.distance(m);if(l>1&&m.z===s)break;if(f.isNear(m,r/2)){if(n<3&&m.z<this.MAX_REPEAR&&(m.setz(Math.min(m.z+1,this.MAX_REPEAR)),l>1)){var E=l-1;for(;E>0;){var C=this.tmpPoints[E].distance(this.tmpPoints[E-1]),x=Math.max(this.tmpPoints[E].z-this.uniThickness*C,-r/4);if(this.tmpPoints[E-1].z>=x)break;this.tmpPoints[E-1].setz(x),E--;}}continue;}f.setv(u);var T=Math.max(m.z-this.uniThickness*y,s);l>1&&pt.Equals(u,m.v,0.02)&&m.z<=0&&this.tmpPoints.pop(),f.setz(T),this.tmpPoints.push(f);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,m;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?nE(r)?r.setAttribute("bgcolor",c):r.children.forEach(function(u){u.setAttribute("strokeColor",c),u.getAttribute("fillColor")&&u.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(h=f==null?void 0:f.opt)!=null&&h.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(m=f.opt)!=null&&m.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),$t.updateNodeOpt(t);}}]);}($t);var Sh=/*#__PURE__*/function(_$t2){function Sh(t){var _this66;_classCallCheck(this,Sh);_this66=_callSuper(this,Sh,[t]);dt(_this66,"toolsType",Tt.LaserPen);dt(_this66,"canRotate",!1);dt(_this66,"scaleType",Ae.none);dt(_this66,"syncTimestamp");dt(_this66,"syncIndex",0);dt(_this66,"tmpPoints",[]);dt(_this66,"workOptions");dt(_this66,"consumeIndex",0);_this66.workOptions=t.toolsOpt,_this66.syncTimestamp=0;return _this66;}_inherits(Sh,_$t2);return _createClass(Sh,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Sh,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var r=t.data,n=t.isSubWorker,s=r.workId,c=r.op,l=r.syncUnitTime;if((c==null?void 0:c.length)===0)return{type:xt.None};if(l&&(this.syncUnitTime=l),this.updateTempPoints(c||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:xt.None};var _this$workOptions3=this.workOptions,f=_this$workOptions3.strokeColor,h=_this$workOptions3.thickness,m=_this$workOptions3.strokeType,u=_this$workOptions3.lineDash,y=_this$workOptions3.lineCap,T=Re(this.tmpPoints,h);var E=!1;var C=this.syncIndex,x=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var I={name:s==null?void 0:s.toString(),opacity:1,lineDash:m===we.Dotted?[u&&u[0]||1,(u&&u[1]||2)*h]:m===we.LongDotted?[(u&&u[0]||1)*h,(u&&u[1]||2)*h]:void 0,strokeColor:f,lineCap:y,lineWidth:h,anchor:[0.5,0.5]},d=this.getTaskPoints(x);if(d.length){var p=Date.now();p-this.syncTimestamp>this.syncUnitTime&&(E=!0,this.syncTimestamp=p,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:I,tasks:d,isDot:!1,layer:this.drawLayer||this.fullLayer});}var v=[];return this.tmpPoints.slice(C).forEach(function(p){v.push(p.x,p.y);}),_objectSpread({rect:{x:T.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:T.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:T.w*this.fullLayer.worldScaling[0],h:T.h*this.fullLayer.worldScaling[1]},type:xt.DrawWork,dataType:Vt.Local,op:E?v:void 0,index:E?C*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var c;var t=(c=this.workId)==null?void 0:c.toString();var r;if(this.tmpPoints.length-1>this.consumeIndex){var l=this.tmpPoints.slice(this.consumeIndex);var f=l.length===1,_this$workOptions4=this.workOptions,h=_this$workOptions4.strokeColor,m=_this$workOptions4.thickness,u=_this$workOptions4.strokeType;if(f){var E=this.computDotStroke({point:l[0],radius:m/2});l=E.ps,r=E.rect;}else r=Re(this.tmpPoints,m);var y={name:t==null?void 0:t.toString(),fillColor:f?h:void 0,opacity:1,lineDash:u===we.Dotted&&!f?[1,m*2]:u===we.LongDotted&&!f?[m,m*2]:void 0,strokeColor:h,lineCap:f?void 0:"round",lineWidth:f?0:m,anchor:[0.5,0.5]},T=this.getTaskPoints(l);T.length&&this.draw({attrs:y,tasks:T,isDot:f,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(l){n.push(l.x,l.y);});var s=gr(n);return _objectSpread({rect:r&&{x:r.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:r.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:r.w*this.fullLayer.worldScaling[0],h:r.h*this.fullLayer.worldScaling[1]},type:xt.FullWork,dataType:Vt.Local,ops:s,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 C;var r=t.op,n=t.replaceId,s=t.isFullWork,_this$workOptions5=this.workOptions,c=_this$workOptions5.strokeColor,l=_this$workOptions5.thickness,f=_this$workOptions5.strokeType;if(!r.length){var x=Re(this.tmpPoints,l);return{x:x.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:x.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:x.w*this.fullLayer.worldScaling[0],h:x.h*this.fullLayer.worldScaling[1]};}var h=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var m,u=this.tmpPoints.slice(h);var y=u.length===1;if(y){var _x34=this.computDotStroke({point:u[0],radius:l/2});u=_x34.ps,m=_x34.rect;}else m=Re(this.tmpPoints,l);var T={name:(C=this.workId)==null?void 0:C.toString(),fillColor:y?c:void 0,opacity:1,lineDash:f===we.Dotted&&!y?[1,l*2]:f===we.LongDotted&&!y?[l,l*2]:void 0,strokeColor:c,lineCap:y?void 0:"round",lineWidth:y?0:l,anchor:[0.5,0.5]},E=this.getTaskPoints(u);if(E.length){var _x35=s?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:T,tasks:E,isDot:y,replaceId:n,layer:_x35});}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]};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,s={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Jt.GetDotStroke(r,n,8),rect:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(r){var s=this.tmpPoints.slice(-1)[0];s&&s.x===t[n]&&s.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Jt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this67=this;var r,n,s,c,l,_iterator18,_step18,_loop5;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:r=t.attrs,n=t.tasks,s=t.isDot,c=t.layer,l=this.workOptions.duration;_iterator18=_createForOfIteratorHelper(n);_context23.prev=2;_loop5=/*#__PURE__*/_regeneratorRuntime().mark(function _loop5(){var f,h,m,u,y,_this67$workOptions,T,E,C,_c$getResolution,x,_I36;return _regeneratorRuntime().wrap(function _loop5$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:f=_step18.value;h=new Mn(),m=f.pos,u=f.points;s?y=En(u,!0):y=En(u,!1),h.attr(_objectSpread(_objectSpread({},r),{},{pos:m,d:y}));_this67$workOptions=_this67.workOptions,T=_this67$workOptions.vertex,E=_this67$workOptions.fragment;if(T&&E){C=c.renderer.createProgram({vertex:T,fragment:E}),_c$getResolution=c.getResolution(),x=_c$getResolution.width,_I36=_c$getResolution.height;h.setUniforms({u_time:0,u_resolution:[x,_I36]}),h.setProgram(C);}c.appendChild(h),h.transition(l).attr({scale:s?[0.1,0.1]:[1,1],lineWidth:s?0:1}).then(function(){h.remove();});case 6:case"end":return _context22.stop();}},_loop5);});_iterator18.s();case 5:if((_step18=_iterator18.n()).done){_context23.next=9;break;}return _context23.delegateYield(_loop5(),"t0",7);case 7:_context23.next=5;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23["catch"](2);_iterator18.e(_context23.t1);case 14:_context23.prev=14;_iterator18.f();return _context23.finish(14);case 17:case"end":return _context23.stop();}},_callee21,this,[[2,11,14,17]]);}));function draw(_x36){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var h;var r=[];if(t.length===0)return[];var n=0,s=t[0].x,c=t[0].y,l=[s,c],f=[];for(;n<t.length;){var m=t[n],u=m.x-s,y=m.y-c;if(f.push(new Jt(u,y)),n>0&&n<t.length-1){var T=t[n].getAngleByPoints(t[n-1],t[n+1]);if(T<60||T>300){var E=(h=f.pop())==null?void 0:h.clone();E&&r.push({pos:l,points:[].concat(_toConsumableArray(f),[E])}),s=t[n].x,c=t[n].y,l=[s,c];var C=m.x-s,x=m.y-c;f=[new Jt(C,x)];}}n++;}return r.push({pos:l,points:f}),r;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var r;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(s){if(s.name===t){var c=s.getBoundingClientRect();r=Zt(r,{x:c.x,y:c.y,w:c.width,h:c.height}),n.push(s);}}),n.length&&n.forEach(function(s){return s.remove();}),r;}}]);}($t);var V2=no;no.polyline=no;no.polygon=Z2;function no(i,e,t){var r=i.length,n=ui(i[0],e),s=[],c,l,f,h,m;for(t||(t=[]),c=1;c<r;c++){for(l=i[c-1],f=i[c],h=m=ui(f,e);;)if(n|h){if(n&h)break;n?(l=al(l,f,n,e),n=ui(l,e)):(f=al(l,f,h,e),h=ui(f,e));}else{s.push(l),h!==m?(s.push(f),c<r-1&&(t.push(s),s=[])):c===r-1&&s.push(f);break;}n=m;}return s.length&&t.push(s),t;}function Z2(i,e){var t,r,n,s,c,l,f;for(r=1;r<=8;r*=2){for(t=[],n=i[i.length-1],s=!(ui(n,e)&r),c=0;c<i.length;c++)l=i[c],f=!(ui(l,e)&r),f!==s&&t.push(al(n,l,r,e)),f&&t.push(l),n=l,s=f;if(i=t,!i.length)break;}return t;}function al(i,e,t,r){return t&8?[i[0]+(e[0]-i[0])*(r[3]-i[1])/(e[1]-i[1]),r[3]]:// top
404
+ t&4?[i[0]+(e[0]-i[0])*(r[1]-i[1])/(e[1]-i[1]),r[1]]:// bottom
405
+ t&2?[r[2],i[1]+(e[1]-i[1])*(r[2]-i[0])/(e[0]-i[0])]:// right
406
+ t&1?[r[0],i[1]+(e[1]-i[1])*(r[0]-i[0])/(e[0]-i[0])]:// left
407
+ null;}function ui(i,e){var t=0;return i[0]<e[0]?t|=1:i[0]>e[2]&&(t|=2),i[1]<e[1]?t|=4:i[1]>e[3]&&(t|=8),t;}var Il=/* @__PURE__ */Ln(V2);var pi=/*#__PURE__*/function(_$t3){function pi(t,r){var _this68;_classCallCheck(this,pi);_this68=_callSuper(this,pi,[t]);dt(_this68,"canRotate",!1);dt(_this68,"scaleType",Ae.none);dt(_this68,"toolsType",Tt.Eraser);dt(_this68,"serviceWork");dt(_this68,"tmpPoints",[]);dt(_this68,"workOptions");dt(_this68,"worldPosition");dt(_this68,"worldScaling");dt(_this68,"eraserRect");dt(_this68,"eraserPolyline");_this68.serviceWork=r,_this68.workOptions=t.toolsOpt,_this68.worldPosition=_this68.fullLayer.worldPosition,_this68.worldScaling=_this68.fullLayer.worldScaling;return _this68;}_inherits(pi,_$t3);return _createClass(pi,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(pi,"setWorkOptions",this,3)([t]);}},{key:"createEraserRect",value:function createEraserRect(t){var r=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_pi$eraserSizes$this$=pi.eraserSizes[this.workOptions.thickness],s=_pi$eraserSizes$this$.width,c=_pi$eraserSizes$this$.height;this.eraserRect={x:r-s*0.5,y:n-c*0.5,w:s,h:c},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 r=new pt(this.tmpPoints[0],this.tmpPoints[1]),n=new pt(this.tmpPoints[2],this.tmpPoints[3]),s=pt.Sub(n,r).uni(),c=pt.Dist(r,n),_pi$eraserSizes$this$2=pi.eraserSizes[this.workOptions.thickness],l=_pi$eraserSizes$this$2.width,f=_pi$eraserSizes$this$2.height,h=Math.min(l,f),m=Math.round(c/h);if(m>1){var u=[];for(var y=0;y<m;y++){var T=pt.Mul(s,y*h);u.push(this.tmpPoints[0]+T.x,this.tmpPoints[1]+T.y);}return u.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,r){var n=new pt(t[0],t[1]),s=new pt(r[0],r[1]),_pi$eraserSizes$this$3=pi.eraserSizes[this.workOptions.thickness],c=_pi$eraserSizes$this$3.width,l=_pi$eraserSizes$this$3.height;return pt.Dist(n,s)<Math.hypot(c,l)*0.5;}},{key:"remove",value:function remove(t){var _this69=this;var r=t.curNodeMap,n=t.removeIds;var s;var _iterator19=_createForOfIteratorHelper(r.values()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var c=_step19.value;if(c.rect&&this.eraserRect&&this.eraserPolyline&&fl(this.eraserRect,c.rect)){var l=c.op,f=[],h=[];for(var u=0;u<l.length;u+=3){var y=new pt(l[u]*this.worldScaling[0]+this.worldPosition[0],l[u+1]*this.worldScaling[1]+this.worldPosition[1],l[u+2]);h.push(y),f.push(new Jt(y.x,y.y));}var m=f.length&&Re(f)||c.rect;fl(m,this.eraserRect)&&(h.length>1?Il.polyline(h.map(function(y){return y.XY;}),this.eraserPolyline).length&&n.add(c.name):n.add(c.name),s=Zt(s,c.rect||m));}}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return n.forEach(function(c){var f;var l=_this69.fullLayer.getElementsByName(c);l[0]&&(l[0].remove(),_pr(l[0],_this69.fullLayer.parent),(f=_this69.vNodes)==null||f["delete"](c));}),s&&(s.x-=$t.SafeBorderPadding,s.y-=$t.SafeBorderPadding,s.w+=$t.SafeBorderPadding*2,s.h+=$t.SafeBorderPadding*2),s;}},{key:"consume",value:function consume(t){var _t$data2=t.data,r=_t$data2.op,n=_t$data2.disableEraseImage,s=_t$data2.disableEraseText;if(!r||r.length===0)return _objectSpread({type:xt.None},this.baseConsumeResult);var c=this.tmpPoints.length;if(c>1&&this.isNear([r[0],r[1]],[this.tmpPoints[c-2],this.tmpPoints[c-1]]))return _objectSpread({type:xt.None},this.baseConsumeResult);c<3?this.tmpPoints.push(r[0],r[1]):this.tmpPoints.splice(2,2,r[0],r[1]);var l=this.computRectCenterPoints();var f;var h=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:xt.None},this.baseConsumeResult);var m=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:n,disableEraseText:s}));for(var u=0;u<l.length-1;u+=2){this.createEraserRect(l.slice(u,u+2));var y=this.remove({curNodeMap:m,removeIds:h});f=Zt(f,y);}return f&&h.size?{type:xt.RemoveNode,rect:f,removeIds:_toConsumableArray(h)}:_objectSpread({type:xt.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(t){var r;if(this.serviceWork){var n=new Map(t),s=this.serviceWork.selectorWorkShapes,c=this.serviceWork.workShapes;var _iterator20=_createForOfIteratorHelper(s.values()),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var l=_step20.value;if((r=l.selectIds)!=null&&r.length){var _iterator22=_createForOfIteratorHelper(l.selectIds),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var f=_step22.value;n["delete"](f);}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var _iterator21=_createForOfIteratorHelper(c.keys()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _l4=_step21.value;n["delete"](_l4);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return n;}return t;}}]);}($t);// 来源于white-sdk
408
+ dt(pi,"eraserSizes",Tl);var io=pi;var J2="__lodash_hash_undefined__";function Q2(i){return this.__data__.set(i,J2),this;}var q2=Q2;function _2(i){return this.__data__.has(i);}var tw=_2,ew=Hu,rw=q2,nw=tw;function so(i){var e=-1,t=i==null?0:i.length;for(this.__data__=new ew();++e<t;)this.add(i[e]);}so.prototype.add=so.prototype.push=rw;so.prototype.has=nw;var Ol=so;function iw(i,e){for(var t=-1,r=i==null?0:i.length;++t<r;)if(e(i[t],t,i))return!0;return!1;}var sw=iw;function ow(i,e){return i.has(e);}var wl=ow,aw=Ol,lw=sw,fw=wl,cw=1,uw=2;function hw(i,e,t,r,n,s){var c=t&cw,l=i.length,f=e.length;if(l!=f&&!(c&&f>l))return!1;var h=s.get(i),m=s.get(e);if(h&&m)return h==e&&m==i;var u=-1,y=!0,T=t&uw?new aw():void 0;for(s.set(i,e),s.set(e,i);++u<l;){var E=i[u],C=e[u];if(r)var x=c?r(C,E,u,e,i,s):r(E,C,u,i,e,s);if(x!==void 0){if(x)continue;y=!1;break;}if(T){if(!lw(e,function(I,d){if(!fw(T,d)&&(E===I||n(E,I,t,r,s)))return T.push(d);})){y=!1;break;}}else if(!(E===C||n(E,C,t,r,s))){y=!1;break;}}return s["delete"](i),s["delete"](e),y;}var xh=hw;function dw(i){var e=-1,t=Array(i.size);return i.forEach(function(r,n){t[++e]=[n,r];}),t;}var pw=dw;function vw(i){var e=-1,t=Array(i.size);return i.forEach(function(r){t[++e]=r;}),t;}var Al=vw,pu=Ji,vu=ch,gw=ul,mw=xh,yw=pw,Pw=Al,Sw=1,xw=2,Tw="[object Boolean]",Cw="[object Date]",Iw="[object Error]",Ow="[object Map]",ww="[object Number]",Aw="[object RegExp]",Ew="[object Set]",Mw="[object String]",Lw="[object Symbol]",Rw="[object ArrayBuffer]",bw="[object DataView]",gu=pu?pu.prototype:void 0,qa=gu?gu.valueOf:void 0;function Dw(i,e,t,r,n,s,c){switch(t){case bw:if(i.byteLength!=e.byteLength||i.byteOffset!=e.byteOffset)return!1;i=i.buffer,e=e.buffer;case Rw:return!(i.byteLength!=e.byteLength||!s(new vu(i),new vu(e)));case Tw:case Cw:case ww:return gw(+i,+e);case Iw:return i.name==e.name&&i.message==e.message;case Aw:case Mw:return i==e+"";case Ow:var l=yw;case Ew:var f=r&Sw;if(l||(l=Pw),i.size!=e.size&&!f)return!1;var h=c.get(i);if(h)return h==e;r|=xw,c.set(i,e);var m=mw(l(i),l(e),r,n,s,c);return c["delete"](i),m;case Lw:if(qa)return qa.call(i)==qa.call(e);}return!1;}var Nw=Dw,mu=ah,Bw=1,Ww=Object.prototype,Fw=Ww.hasOwnProperty;function Uw(i,e,t,r,n,s){var c=t&Bw,l=mu(i),f=l.length,h=mu(e),m=h.length;if(f!=m&&!c)return!1;for(var u=f;u--;){var y=l[u];if(!(c?y in e:Fw.call(e,y)))return!1;}var T=s.get(i),E=s.get(e);if(T&&E)return T==e&&E==i;var C=!0;s.set(i,e),s.set(e,i);for(var x=c;++u<f;){y=l[u];var I=i[y],d=e[y];if(r)var v=c?r(d,I,y,e,i,s):r(I,d,y,i,e,s);if(!(v===void 0?I===d||n(I,d,t,r,s):v)){C=!1;break;}x||(x=y=="constructor");}if(C&&!x){var p=i.constructor,S=e.constructor;p!=S&&"constructor"in i&&"constructor"in e&&!(typeof p=="function"&&p instanceof p&&typeof S=="function"&&S instanceof S)&&(C=!1);}return s["delete"](i),s["delete"](e),C;}var Yw=Uw,_a=ku,Xw=xh,zw=Nw,$w=Yw,yu=So,Pu=qi,Su=dl,jw=_u,Gw=1,xu="[object Arguments]",Tu="[object Array]",Ks="[object Object]",Hw=Object.prototype,Cu=Hw.hasOwnProperty;function kw(i,e,t,r,n,s){var c=Pu(i),l=Pu(e),f=c?Tu:yu(i),h=l?Tu:yu(e);f=f==xu?Ks:f,h=h==xu?Ks:h;var m=f==Ks,u=h==Ks,y=f==h;if(y&&Su(i)){if(!Su(e))return!1;c=!0,m=!1;}if(y&&!m)return s||(s=new _a()),c||jw(i)?Xw(i,e,t,r,n,s):zw(i,e,f,t,r,n,s);if(!(t&Gw)){var T=m&&Cu.call(i,"__wrapped__"),E=u&&Cu.call(e,"__wrapped__");if(T||E){var C=T?i.value():i,x=E?e.value():e;return s||(s=new _a()),n(C,x,t,r,s);}}return y?(s||(s=new _a()),$w(i,e,t,r,n,s)):!1;}var Kw=kw,Vw=Kw,Iu=pn;function Th(i,e,t,r,n){return i===e?!0:i==null||e==null||!Iu(i)&&!Iu(e)?i!==i&&e!==e:Vw(i,e,t,r,Th,n);}var Zw=Th,Jw=Zw;function Qw(i,e){return Jw(i,e);}var qw=Qw,qr=/* @__PURE__ */Ln(qw);function Ou(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(i,",").concat(e,",").concat(t,",").concat(r,")");}function _w(i){var e=i.split(","),t=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),n=parseInt(e[2]),s=Number(e[3].split(")")[0]);return[t,r,n,s];}var ho=/*#__PURE__*/function(_$t4){function ho(t){var _this70;_classCallCheck(this,ho);_this70=_callSuper(this,ho,[t]);dt(_this70,"toolsType",Tt.Selector);dt(_this70,"tmpPoints",[]);dt(_this70,"subTmpPoints",[]);dt(_this70,"workOptions");dt(_this70,"vNodes");dt(_this70,"selectIds");dt(_this70,"selectorColor");dt(_this70,"strokeColor");dt(_this70,"fillColor");dt(_this70,"oldSelectRect");dt(_this70,"oldSubSelectRect");dt(_this70,"canRotate",!1);dt(_this70,"canTextEdit",!1);dt(_this70,"canLock",!1);dt(_this70,"scaleType",Ae.all);dt(_this70,"toolsTypes");dt(_this70,"shapeOpt");dt(_this70,"textOpt");dt(_this70,"isLocked");dt(_this70,"thickness");dt(_this70,"strokeType");dt(_this70,"useStroke");_this70.workOptions=t.toolsOpt,_this70.vNodes=t.vNodes;return _this70;}_inherits(ho,_$t4);return _createClass(ho,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=Re(this.tmpPoints);if(r.w===0||r.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(r,t),n=_this$vNodes$getRectI.rectRange,s=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(s.keys()),intersectRect:n,subNodeMap:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length,n=t.length;if(n>1){var s=new Jt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);r===2?this.tmpPoints.splice(1,1,s):this.tmpPoints.push(s);}}},{key:"drawSelector",value:function drawSelector(t){var _this71=this;var r=t.drawRect,n=t.subNodeMap,s=t.selectorId,c=t.layer,l=t.isService,f=new mr({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:s,name:s,zIndex:9999}),h=[];if(l){var m=new zc({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:ho.selectorBorderId});h.push(m);}n.forEach(function(m,u){var y=[m.rect.x+m.rect.w/2-r.x,m.rect.y+m.rect.h/2-r.y],T=new zc({normalize:!0,pos:y,lineWidth:1,strokeColor:n.size>1?_this71.selectorColor||_this71.workOptions.strokeColor:void 0,width:m.rect.w,height:m.rect.h,id:"selector-".concat(u),name:"selector-".concat(u)});h.push(T);}),h&&f.append.apply(f,h),(c==null?void 0:c.parent).appendChild(f);}},{key:"draw",value:function draw(t,r,n){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var f,h;var c=n.intersectRect,l=n.subNodeMap;(h=(f=r.parent)==null?void 0:f.getElementById(t))==null||h.remove(),c&&this.drawSelector({drawRect:c,subNodeMap:l,selectorId:t,layer:r,isService:s});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=Ae.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0,this.thickness=void 0,this.strokeType=void 0,this.useStroke=!1;var r=/* @__PURE__ */new Set();var n,s=!0;var _iterator23=_createForOfIteratorHelper(t.values()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var c=_step23.value;var l=c.opt,f=c.canRotate,h=c.scaleType,m=c.toolsType;this.selectorColor=this.workOptions.strokeColor,l.strokeColor&&(this.strokeColor=l.strokeColor),l.fillColor&&(this.fillColor=l.fillColor),l.textOpt&&(this.textOpt=l.textOpt),l.thickness&&(this.thickness=l.thickness),m!==Tt.Pencil&&(s=!1),l.strokeType&&(this.strokeType=l.strokeType),m===Tt.SpeechBalloon&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=l.placement),m===Tt.Polygon&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=l.vertices),m===Tt.Star&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=l.vertices,this.shapeOpt.innerRatio=l.innerRatio,this.shapeOpt.innerVerticeStep=l.innerVerticeStep),m===Tt.Text&&(this.textOpt=l),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=f,this.scaleType=h),m===Tt.Image&&(n=c),(h===Ae.proportional&&this.scaleType!==Ae.none||h===Ae.none)&&(this.scaleType=h);}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}s&&(this.useStroke=!0),r.size&&(this.toolsTypes=_toConsumableArray(r)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=Ae.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1,this.thickness=void 0,this.strokeType=void 0,this.useStroke=void 0)):t.size>1&&!n.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var t,r;if(this.scaleType===Ae.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],s=(r=this.vNodes.get(n))==null?void 0:r.op;if(s){var c=[];for(var l=0;l<s.length;l+=3)c.push([s[l],s[l+1]]);return c;}}}},{key:"consume",value:function consume(t){if(t.isSubWorker)return this.subWorkerConsume(t);var r=_objectSpread({type:xt.Select,dataType:Vt.Local},this.baseConsumeResult);if(t.isSimpleWorker){var m=this.subWorkerConsume(t);r.subRect=m.rect;}var _t$data3=t.data,n=_t$data3.op,s=_t$data3.workState;var c=this.oldSelectRect;if(s===te.Start&&(c=this.unSelectedAllIds()),!(n!=null&&n.length)||!this.vNodes.curNodeMap.size)return t.isSimpleWorker?r:{type:xt.None};this.updateTempPoints(n);var l=this.computSelector();if(this.selectIds&&qr(this.selectIds,l.selectIds))return t.isSimpleWorker?r:{type:xt.None};this.selectIds=l.selectIds;var f=l.intersectRect;this.getSelecteorInfo(l.subNodeMap),this.draw(Me,this.fullLayer,l),this.oldSelectRect=f;var h=this.getChildrenPoints();return r=_objectSpread(_objectSpread({},r),{},{rect:Zt(f,c),selectIds:l.selectIds,selectRect:f,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:h,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType}),r;}},{key:"consumeAll",value:function consumeAll(){var r,n;var t=this.oldSelectRect;if(!((r=this.selectIds)!=null&&r.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,Me,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var s=this.getChildrenPoints();return _objectSpread({type:xt.Select,dataType:Vt.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:s,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return{type:xt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(t){var r=t.slice(-2),n=new Jt(r[0],r[1]);if(this.subTmpPoints[0].isNear(n,1))return!1;if(this.subTmpPoints.length===2){if(n.isNear(this.subTmpPoints[1],1))return!1;this.subTmpPoints[1]=n;}else this.subTmpPoints.push(n);return!0;}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=this.workOptions.thickness,n=[];var _iterator24=_createForOfIteratorHelper(t),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var l=_step24.value;n.push(_construct(pt,_toConsumableArray(l)));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}var s=Re(n,r),c=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:c,points:n.map(function(l){return l.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(t){var r=t.workId,n=t.layer,s=t.ps,_this$workOptions6=this.workOptions,c=_this$workOptions6.strokeColor,l=_this$workOptions6.scale,f=_this$workOptions6.rotate,h=_this$workOptions6.translate,m=n.worldPosition,u=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(s),y=_this$computDrawPoint2.points,T=_this$computDrawPoint2.rect,E=_this$computDrawPoint2.pos,C=1/n.worldScaling[0],x=c&&_w(c)||[0,0,0,0],I={close:!0,normalize:!0,points:y,lineWidth:C,fillColor:Ou(x[0],x[1],x[2],0.1),strokeColor:Ou(x[0],x[1],x[2],1),lineJoin:"round",lineCap:"round"};var d={x:Math.floor(T.x*u[0]+m[0]-$t.SafeBorderPadding),y:Math.floor(T.y*u[1]+m[1]-$t.SafeBorderPadding),w:Math.floor(T.w*u[0]+2*$t.SafeBorderPadding),h:Math.floor(T.h*u[0]+2*$t.SafeBorderPadding)};var v=new mr({name:r,id:r,pos:E,anchor:[0.5,0.5],size:[T.w,T.h],scale:l,rotate:f,translate:h}),p=new dn(_objectSpread(_objectSpread({},I),{},{pos:[0,0]}));if(v.appendChild(p),this.replace(n,r,v),l||f||h){var S=v.getBoundingClientRect();d={x:Math.floor(S.x-$t.SafeBorderPadding),y:Math.floor(S.y-$t.SafeBorderPadding),w:Math.floor(S.width+2*$t.SafeBorderPadding),h:Math.floor(S.height+2*$t.SafeBorderPadding)};}return d;}},{key:"transformData",value:function transformData(t){var r=Re(t);return[[r.x,r.y,0],[r.x+r.w,r.y,0],[r.x+r.w,r.y+r.h,0],[r.x,r.y+r.h,0]];}},{key:"subWorkerConsume",value:function subWorkerConsume(t){var r=t.data,n=t.isFullWork,s=r.op,c=r.syncUnitTime;c&&(this.syncUnitTime=c);var l=s==null?void 0:s.length;if(!l||l<2)return{type:xt.None,rect:void 0};var f;if(this.subTmpPoints.length===0?(this.subTmpPoints=[new Jt(s[0],s[1])],f=!1):f=this.updateTempPointsForSubWorker(s),!f)return{type:xt.None,rect:void 0};var h=this.transformData(this.subTmpPoints),m=n?this.fullLayer:this.drawLayer||this.fullLayer,u=this.drawForSubWorker({ps:h,workId:this.workId,layer:m}),y=Zt(u,this.oldSubSelectRect);return this.oldSubSelectRect=u,_objectSpread({rect:y,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);}},{key:"subWorkerConsumeAll",value:function subWorkerConsumeAll(t){var r=t.isFullWork,n=r?this.fullLayer:this.drawLayer||this.fullLayer;return this.replace(n,this.workId),_objectSpread({rect:this.oldSelectRect,type:xt.FullWork,dataType:Vt.Local},this.baseConsumeResult);}},{key:"clearSubTmpPoints",value:function clearSubTmpPoints(){this.subTmpPoints.length=0;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.clearSubTmpPoints();}},{key:"clearSubSelectData",value:function clearSubSelectData(){this.oldSubSelectRect=void 0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0,this.clearSubSelectData();}},{key:"selectSingleTool",value:function selectSingleTool(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Me;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var s=t[0],c=t[1];var l;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:s,y:c,w:0,h:0},!1),f=_this$vNodes$getRectI2.nodeRange,h=_toConsumableArray(f.values()).sort(function(m,u){return(u.opt.zIndex||0)-(m.opt.zIndex||0);});var _iterator25=_createForOfIteratorHelper(h),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _m11=_step25.value;var _u5=this.fullLayer.getElementsByName(_m11.name);if(Hh(_u5).find(function(T){return T.isPointCollision(s,c);})){l=_m11;break;}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}if(l){var m=l.name;if(!qr(this.oldSelectRect,l.rect)){var u=/* @__PURE__ */new Map([[m,l]]);this.getSelecteorInfo(u),this.draw(r,this.fullLayer,{intersectRect:l.rect,subNodeMap:u,selectIds:this.selectIds||[]},n);}this.selectIds=[m],this.oldSelectRect=l.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator26=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _step26$value=_slicedToArray(_step26.value,2),r=_step26$value[0],n=_step26$value[1];n.isSelected&&(t=Zt(t,n.rect),this.vNodes.unSelected(r));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var r;var _iterator27=_createForOfIteratorHelper(t),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var n=_step27.value;var s=this.vNodes.get(n);s&&s.isSelected&&(r=Zt(r,s.rect),this.vNodes.unSelected(n));}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return r;}},{key:"selectedByIds",value:function selectedByIds(t){var r;var _iterator28=_createForOfIteratorHelper(t),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var n=_step28.value;var s=this.vNodes.get(n);s&&(r=Zt(r,s.rect),this.vNodes.selected(n));}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"getSelectorRect",value:function getSelectorRect(t,r){var l;var n;var s=(l=t.parent)==null?void 0:l.getElementById(r),c=s==null?void 0:s.getBoundingClientRect();return c&&(n=Zt(n,{x:Math.floor(c.x),y:Math.floor(c.y),w:Math.floor(c.width+1),h:Math.floor(c.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===Tt.Ellipse||t===Tt.Triangle||t===Tt.Rectangle||t===Tt.Polygon||t===Tt.Star||t===Tt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var r,n,s,c,l,f,h,m,u,y,T,E,C,x,I,d,_iterator29,_step29,S,A,R,D,U,M,W,Y,B,N,G,v,_S13,_A9,_R4,p;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:r=t.updateSelectorOpt,n=t.selectIds,s=t.vNodes,c=t.willSerializeData,l=t.worker,f=t.offset,h=this.fullLayer;if(h){_context24.next=3;break;}return _context24.abrupt("return");case 3:u=/* @__PURE__ */new Map(),y=r.originPoint,T=r.workState,E=r.angle,C=r.translate,x=r.dir,I=r.scale;f&&(C?r.translate=[C[0]+f[0],C[1]+f[1]]:r.translate=f);if(!(y||C||er(E))){_context24.next=10;break;}if(!(T===te.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(s.setTargetAssignKeys(n),{type:xt.Select,dataType:Vt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(!(d=s.getLastTarget(),!d)){_context24.next=10;break;}return _context24.abrupt("return");case 10:if(!n){_context24.next=62;break;}_iterator29=_createForOfIteratorHelper(n);_context24.prev=12;_iterator29.s();case 14:if((_step29=_iterator29.n()).done){_context24.next=54;break;}S=_step29.value;A=s.get(S);if(!A){_context24.next=52;break;}R=A.toolsType,D=A.opt,U=(h==null?void 0:h.getElementsByName(S))[0];if(!U){_context24.next=52;break;}M=_objectSpread({},r);W=void 0;Y=$t.isWillRefresh({toolsType:R,opt:D,updateOpt:M,vNodes:s,node:U,willSerializeData:c});if(!R){_context24.next=52;break;}W=d==null?void 0:d.get(S);B=Gh(R);if(!(B==null||B.updateNodeOpt({node:U,opt:M,vNodes:s,willSerializeData:c,targetNode:W}),A&&l&&Y)){_context24.next=51;break;}N=l.createWorkShapeNode({workId:S,toolsType:R,toolsOpt:A.opt});N==null||N.setWorkId(S);G=void 0;if(!(R===Tt.Image)){_context24.next=36;break;}_context24.next=33;return N.consumeServiceAsync({isFullWork:!0,replaceId:S,worker:l});case 33:G=_context24.sent;_context24.next=50;break;case 36:if(!(R===Tt.Text)){_context24.next=42;break;}_context24.next=39;return N.consumeServiceAsync({isFullWork:!0,replaceId:S,isDrawLabel:!0});case 39:G=_context24.sent;_context24.next=50;break;case 42:_context24.prev=42;G=N==null?void 0:N.consumeService({op:A.op,isFullWork:!0,replaceId:S,workState:T});_context24.next=50;break;case 46:_context24.prev=46;_context24.t0=_context24["catch"](42);console.error("consumeService error",_context24.t0);return _context24.abrupt("continue",52);case 50:G&&(A.rect=G);case 51:A&&(u.set(S,A),m=Zt(m,A.rect));case 52:_context24.next=14;break;case 54:_context24.next=59;break;case 56:_context24.prev=56;_context24.t1=_context24["catch"](12);_iterator29.e(_context24.t1);case 59:_context24.prev=59;_iterator29.f();return _context24.finish(59);case 62:d&&T===te.Done&&(s.deleteLastTarget(),d=void 0);v=m;if(!(y&&C&&I&&x&&v&&!f)){_context24.next=82;break;}_S13=[[v.x,v.y],[v.x+v.w,v.y],[v.x+v.w,v.y+v.h],[v.x,v.y+v.h]];_context24.t2=x;_context24.next=_context24.t2==="top"?69:_context24.t2==="topLeft"?69:_context24.t2==="left"?69:_context24.t2==="topRight"?71:_context24.t2==="right"?73:_context24.t2==="bottomRight"?73:_context24.t2==="bottom"?73:_context24.t2==="bottomLeft"?75:77;break;case 69:C[0]>0&&C[1]>0?_A9=_S13[0]:C[0]>0?_A9=_S13[3]:C[1]>0?_A9=_S13[1]:_A9=_S13[2];return _context24.abrupt("break",77);case 71:C[0]<0&&C[1]>0?_A9=_S13[1]:C[0]<0?_A9=_S13[2]:C[1]>0?_A9=_S13[0]:_A9=_S13[3];return _context24.abrupt("break",77);case 73:C[0]<0&&C[1]<0?_A9=_S13[2]:C[0]<0?_A9=_S13[1]:C[1]<0?_A9=_S13[3]:_A9=_S13[0];return _context24.abrupt("break",77);case 75:C[0]>0&&C[1]<0?_A9=_S13[3]:C[0]>0?_A9=_S13[0]:C[1]<0?_A9=_S13[2]:_A9=_S13[1];return _context24.abrupt("break",77);case 77:_R4=_A9&&[y[0]-_A9[0],y[1]-_A9[1]]||[0,0];if(qr(_R4,[0,0])){_context24.next=82;break;}_context24.next=81;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{workState:T},offset:_R4}));case 81:return _context24.abrupt("return",_context24.sent);case 82:this.getSelecteorInfo(u),this.draw(Me,h,{selectIds:n||[],subNodeMap:u,intersectRect:v});p=Zt(this.oldSelectRect,v);return _context24.abrupt("return",(this.oldSelectRect=v,{type:xt.Select,dataType:Vt.Local,selectRect:v,renderRect:m,rect:Zt(p,v),selectIds:n}));case 85:case"end":return _context24.stop();}},_callee22,this,[[12,56,59,62],[42,46]]);}));function updateSelector(_x37){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:xt.Select,dataType:Vt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(mi,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,r,n){var _this72=this;var s=r.selectIds,c=this.getRightServiceId(t),l=this.getSelectorRect(this.fullLayer,c);var f;var h=/* @__PURE__ */new Map();return s==null||s.forEach(function(m){var u=_this72.vNodes.get(m);u&&(f=Zt(f,u.rect),h.set(m,u));}),this.getSelecteorInfo(h),this.draw(c,this.fullLayer,{intersectRect:f,selectIds:s||[],subNodeMap:h},n),Zt(f,l);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this73=this;var n;var t;var r=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(s){var c=_this73.vNodes.get(s);c&&(t=Zt(t,c.rect),r.set(s,c));},this),this.getSelecteorInfo(r),this.draw(Me,this.fullLayer,{intersectRect:t,subNodeMap:r,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var c;var r;var n=(c=this.selectIds)==null?void 0:c.filter(function(l){return!t.includes(l);});if(n!=null&&n.length&&(r=this.unSelectedByIds(n)),t.length){var l=this.selectedByIds(t);r=Zt(r,l);}this.selectIds=t;var s=this.reRenderSelector();return{bgRect:r,selectRect:s};}},{key:"cursorHover",value:function cursorHover(t){var c,l;var r=this.oldSelectRect;this.selectIds=[];var n=(c=this.workId)==null?void 0:c.toString(),s=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(s,n,!0),this.oldSelectRect&&!qr(r,this.oldSelectRect))return{type:xt.CursorHover,dataType:Vt.Local,rect:Zt(r,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((l=this.selectIds)!=null&&l.length||(this.oldSelectRect=void 0),r&&!this.oldSelectRect)return this.cursorBlur(),{type:xt.CursorHover,dataType:Vt.Local,rect:r,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var r,n;this.selectIds=[];var t=(r=this.workId)==null?void 0:r.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(s){s.name===t&&s.remove();});}}]);}($t);dt(ho,"selectorBorderId","selector-border");var Gi=ho;var Ch=/*#__PURE__*/function(_$t5){function Ch(t){var _this74;_classCallCheck(this,Ch);_this74=_callSuper(this,Ch,[t]);dt(_this74,"canRotate",!1);dt(_this74,"scaleType",Ae.both);dt(_this74,"toolsType",Tt.Arrow);dt(_this74,"tmpPoints",[]);dt(_this74,"workOptions");dt(_this74,"oldRect");dt(_this74,"arrowTipWidth");dt(_this74,"syncTimestamp");_this74.workOptions=t.toolsOpt,_this74.arrowTipWidth=_this74.workOptions.thickness*4,_this74.syncTimestamp=0,_this74.syncUnitTime=50;return _this74;}_inherits(Ch,_$t5);return _createClass(Ch,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime;u&&(this.syncUnitTime=u);var y=m==null?void 0:m.length;if(!y||y<2)return{type:xt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:xt.None};var E;if(s||c||f){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:h,layer:x});}if(f){var _x38=Zt(E,this.oldRect);this.oldRect=E;var _I37=_objectSpread({rect:_x38,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);if(l){var _d33=Date.now();_d33-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d33,_I37.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_I37.index=0,_I37.isSync=!0);}return _I37;}if(!s&&l){var _x39=Date.now();return _x39-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x39,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Vt.Local,op:this.tmpPoints.map(function(I){return[].concat(_toConsumableArray(I.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:xt.None};}var C=Zt(E,this.oldRect);return this.oldRect=E,_objectSpread(_objectSpread({rect:C},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Vt.Local});}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=gr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Vt.Local,ops:c,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawEraserlines,_this$workOptions7=this.workOptions,c=_this$workOptions7.strokeColor,l=_this$workOptions7.thickness,f=_this$workOptions7.zIndex,h=_this$workOptions7.scale,m=_this$workOptions7.rotate,u=_this$workOptions7.translate,y=_this$workOptions7.strokeType,T=_this$workOptions7.eraserlines,E=_this$workOptions7.lineDash,C=_this$workOptions7.lineCap,x=n.worldPosition,I=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(l),d=_this$computDrawPoint3.points,v=_this$computDrawPoint3.pos,p=_this$computDrawPoint3.rect,S=_this$computDrawPoint3.isTriangle,A=_this$computDrawPoint3.trianglePoints,R=_this$computDrawPoint3.trianglePos,D=[p.x+p.w/2,p.y+p.h/2],U={pos:D,name:r,id:r,zIndex:f,anchor:[0.5,0.5],size:[p.w,p.h]};h&&(U.scale=h),m&&(U.rotate=m),u&&(U.translate=u);var M=new mr(U),W={points:A,pos:[R[0]-D[0],R[1]-D[1]],fillColor:c,strokeColor:c,lineWidth:0,normalize:!1},Y=new dn(W);if(M.append(Y),!S&&d&&v){var N={points:d,pos:[v[0]-D[0],v[1]-D[1]],fillColor:c,strokeColor:c,lineDash:y===we.Dotted?[E&&E[0]||1,(E&&E[1]||2)*l]:y===we.LongDotted?[(E&&E[0]||1)*l,(E&&E[1]||2)*l]:void 0,lineCap:y===we.Normal?void 0:C,lineWidth:l,normalize:!1},G=new dn(N);M.append(G);}T&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:M,eraserlines:T,pos:D,layer:n},s)),this.replace(n,r,M);var B={x:Math.floor(p.x*I[0]+x[0]-$t.SafeBorderPadding),y:Math.floor(p.y*I[1]+x[1]-$t.SafeBorderPadding),w:Math.floor(p.w*I[0]+2*$t.SafeBorderPadding),h:Math.floor(p.h*I[1]+2*$t.SafeBorderPadding)};if(h||m||u){var _N8=M.getBoundingClientRect();B={x:Math.floor(_N8.x-$t.SafeBorderPadding),y:Math.floor(_N8.y-$t.SafeBorderPadding),w:Math.floor(_N8.width+$t.SafeBorderPadding*2),h:Math.floor(_N8.height+$t.SafeBorderPadding*2)};}return this.isDelete&&M.setAttribute("opacity",0),B;}},{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 _this75=this;var r=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=pt.Per(r).mul(t/2),s=Jt.Sub(this.tmpPoints[0],n),c=Jt.Add(this.tmpPoints[0],n),l=pt.Mul(r,this.arrowTipWidth),f=pt.Sub(this.tmpPoints[1],l),h=Jt.Sub(f,n),m=Jt.Add(f,n),u=pt.Per(r).mul(t*1.5),y=Jt.Sub(f,u),T=Jt.Add(f,u),E=[this.tmpPoints[0],f],C=[y,this.tmpPoints[1],T],x=[s,c].concat(C,[h,m]);return{trianglePoints:C.map(function(I){return Jt.Sub(I,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:E.map(function(I){return Jt.Sub(I,_this75.tmpPoints[0]).XY;}).flat(1),rect:Re(x),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this76=this;var t=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=pt.Per(t).mul(Math.floor(r*3/8)),s=Jt.Sub(this.tmpPoints[0],n),c=Jt.Add(this.tmpPoints[0],n),l=[s,this.tmpPoints[1],c];return{trianglePoints:l.map(function(f){return Jt.Sub(f,_this76.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:Re(l),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 h,m;var r=t.op,n=t.isFullWork,_t$workState2=t.workState,s=_t$workState2===void 0?te.Done:_t$workState2,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,m;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?r.children.forEach(function(u){u.setAttribute("strokeColor",c),u.getAttribute("fillColor")&&u.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(h=f==null?void 0:f.opt)!=null&&h.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(m=f.opt)!=null&&m.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),$t.updateNodeOpt(t);}}]);}($t);var Ih=/*#__PURE__*/function(_$t6){function Ih(t){var _this77;_classCallCheck(this,Ih);_this77=_callSuper(this,Ih,[t]);dt(_this77,"canRotate",!1);dt(_this77,"scaleType",Ae.all);dt(_this77,"toolsType",Tt.Ellipse);dt(_this77,"tmpPoints",[]);dt(_this77,"workOptions");dt(_this77,"oldRect");dt(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(Ih,_$t6);return _createClass(Ih,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime;u&&(this.syncUnitTime=u);var y=m==null?void 0:m.length;if(!y||y<2)return{type:xt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:xt.None};var E;if(s||c||f){var C=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:h,layer:C,isDrawing:!0});var x=C.parent.parent,_I38={x:0,y:0,w:Math.floor(x.width),h:Math.floor(x.height)},_d34=_objectSpread({type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);if(Zi(E,_I38)!==Tr.outside){var p=Zt(E,this.oldRect);if(this.oldRect=E,_d34.rect=p,!f)return _d34;}if(f){var _p14=Date.now();return _p14-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_p14,_d34.op=this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),_d34.index=0,_d34.isSync=!0),_d34;}return{type:xt.None};}if(!s&&!c&&!f&&l){var _C4=Date.now();return _C4-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_C4,_objectSpread(_objectSpread({type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:xt.None};}return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=gr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:xt.FullWork,dataType:Vt.Local},this.baseConsumeResult),{},{ops:c,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,c=t.isDrawEraserlines,_this$workOptions8=this.workOptions,l=_this$workOptions8.strokeColor,f=_this$workOptions8.fillColor,h=_this$workOptions8.thickness,m=_this$workOptions8.zIndex,u=_this$workOptions8.scale,y=_this$workOptions8.rotate,T=_this$workOptions8.translate,E=_this$workOptions8.strokeType,C=_this$workOptions8.eraserlines,x=_this$workOptions8.lineDash,I=_this$workOptions8.lineCap,d=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(h),v=_this$computDrawPoint4.radius,p=_this$computDrawPoint4.rect,S=_this$computDrawPoint4.pos,A={closeType:"normal",radius:v,lineWidth:h,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:I,lineDash:E===we.Dotted?[x&&x[0]||1,(x&&x[1]||2)*h]:E===we.LongDotted?[(x&&x[0]||1)*h,(x&&x[1]||2)*h]:void 0},R={name:r,id:r,zIndex:m,pos:S,anchor:[0.5,0.5],size:[p.w,p.h]};u&&(R.scale=u),y&&(R.rotate=y),T&&(R.translate=T);var D=new mr(R);if(s){var W=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/d[0],1/d[1]]});D.append(W);}var U=new qy(_objectSpread(_objectSpread({},A),{},{pos:[0,0]}));D.append(U),C&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:D,eraserlines:C,pos:S,layer:n},c)),this.replace(n,r,D);var M=D.getBoundingClientRect();return this.isDelete&&D.setAttribute("opacity",0),{x:Math.floor(M.x-$t.SafeBorderPadding),y:Math.floor(M.y-$t.SafeBorderPadding),w:Math.floor(M.width+$t.SafeBorderPadding*2),h:Math.floor(M.height+$t.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=Re(this.tmpPoints),n=Re(this.tmpPoints,t),s=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)];return{rect:n,pos:s,radius:[Math.floor(r.w/2),Math.floor(r.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 h,m;var r=t.op,n=t.isFullWork,_t$workState3=t.workState,s=_t$workState3===void 0?te.Done:_t$workState3,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var u,y,T;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.strokeType,h=s.get(r.name);var m=r;return r.tagName==="GROUP"&&(m=r.children[0]),c&&(m.setAttribute("strokeColor",c),(u=h==null?void 0:h.opt)!=null&&u.strokeColor&&(h.opt.strokeColor=c)),l&&(l==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",l),(y=h==null?void 0:h.opt)!=null&&y.fillColor&&(h.opt.fillColor=l)),f&&h!=null&&h.opt&&(T=h.opt)!=null&&T.strokeType&&(h.opt.strokeType=f),h&&s.setInfo(r.name,h),$t.updateNodeOpt(t);}}]);}($t);var Oh=/*#__PURE__*/function(_$t7){function Oh(t){var _this78;_classCallCheck(this,Oh);_this78=_callSuper(this,Oh,[t]);dt(_this78,"canRotate",!0);dt(_this78,"scaleType",Ae.all);dt(_this78,"toolsType",Tt.Rectangle);dt(_this78,"tmpPoints",[]);dt(_this78,"workOptions");dt(_this78,"oldRect");dt(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(Oh,_$t7);return _createClass(Oh,[{key:"transformData",value:function transformData(){var t=Re(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 r=this.workOptions.thickness,n=[];var _iterator30=_createForOfIteratorHelper(t),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var l=_step30.value;n.push(_construct(pt,_toConsumableArray(l)));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}var s=Re(n,r),c=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:c,points:n.map(function(l){return l.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=m==null?void 0:m.length;if(!u||u<2)return{type:xt.None};var y;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],y=!1):y=this.updateTempPoints(m),!y)return{type:xt.None};var T=this.transformData();var E;if(s||c||f){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({ps:T,workId:h,layer:x,isDrawing:!0});}if(f){var _x40=Zt(E,this.oldRect);this.oldRect=E;var _I39=_objectSpread({rect:_x40,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);if(l){var _d35=Date.now();_d35-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d35,_I39.op=T.flat(1),_I39.index=0,_I39.isSync=!0);}return _I39;}if(!s&&l){var _x41=Date.now();return _x41-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x41,_objectSpread({type:xt.DrawWork,dataType:Vt.Local,op:T.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var C=Zt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:C,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var f;var t=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,s=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=s;var c=r.flat(1),l=gr(c);return(f=this.vNodes)==null||f.setInfo(t,{rect:s,op:c,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&$t.getCenterPos(s,n)}),_objectSpread(_objectSpread({rect:s,type:xt.FullWork,dataType:Vt.Local,ops:l,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,c=t.ps,l=t.replaceId,_t$isDrawEraserlines2=t.isDrawEraserlines,f=_t$isDrawEraserlines2===void 0?!0:_t$isDrawEraserlines2,_this$workOptions9=this.workOptions,h=_this$workOptions9.strokeColor,m=_this$workOptions9.fillColor,u=_this$workOptions9.thickness,y=_this$workOptions9.zIndex,T=_this$workOptions9.scale,E=_this$workOptions9.rotate,C=_this$workOptions9.translate,x=_this$workOptions9.strokeType,I=_this$workOptions9.eraserlines,d=_this$workOptions9.lineCap,v=_this$workOptions9.lineDash,p=n.worldPosition,S=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(c),A=_this$computDrawPoint5.points,R=_this$computDrawPoint5.rect,D=_this$computDrawPoint5.pos,U={close:!0,normalize:!0,points:A,lineWidth:u,fillColor:m!=="transparent"&&m||void 0,strokeColor:h,lineCap:d,lineDash:x===we.Dotted?[v&&v[0]||1,(v&&v[1]||2)*u]:x===we.LongDotted?[(v&&v[0]||1)*u,(v&&v[1]||2)*u]:void 0};var M={x:Math.floor(R.x*S[0]+p[0]-$t.SafeBorderPadding),y:Math.floor(R.y*S[1]+p[1]-$t.SafeBorderPadding),w:Math.floor(R.w*S[0]+2*$t.SafeBorderPadding),h:Math.floor(R.h*S[0]+2*$t.SafeBorderPadding)};var W=new mr({name:r,id:r,zIndex:y,pos:D,anchor:[0.5,0.5],size:[R.w,R.h],scale:T,rotate:E,translate:C}),Y=new dn(_objectSpread(_objectSpread({},U),{},{pos:[0,0]}));if(W.appendChild(Y),s){var B=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:h,lineWidth:1,scale:[1/S[0],1/S[1]]});W.appendChild(B);}if(I&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:W,eraserlines:I,pos:D,layer:n},f)),this.replace(n,l||r,W),T||E||C){var _B4=W.getBoundingClientRect();M={x:Math.floor(_B4.x-$t.SafeBorderPadding),y:Math.floor(_B4.y-$t.SafeBorderPadding),w:Math.floor(_B4.width+2*$t.SafeBorderPadding),h:Math.floor(_B4.height+2*$t.SafeBorderPadding)};}return this.isDelete&&W.setAttribute("opacity",0),M;}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 u,y;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState4=t.workState,c=_t$workState4===void 0?te.Done:_t$workState4,l=(u=this.workId)==null?void 0:u.toString();if(!l)return;var f=[];for(var T=0;T<r.length;T+=3)f.push([r[T],r[T+1],r[T+2]]);var h=n?this.fullLayer:this.drawLayer||this.fullLayer,m=this.draw({ps:f,workId:l,layer:h,isDrawing:!1,replaceId:s,isDrawEraserlines:c===te.Done});return this.oldRect=m,(y=this.vNodes)==null||y.setInfo(l,{rect:m,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&$t.getCenterPos(m,h)}),m;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var u,y,T;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.strokeType,h=s.get(r.name);var m=r;return r.tagName==="GROUP"&&(m=r.children[0]),c&&(m.setAttribute("strokeColor",c),(u=h==null?void 0:h.opt)!=null&&u.strokeColor&&(h.opt.strokeColor=c)),l&&(l==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",l),(y=h==null?void 0:h.opt)!=null&&y.fillColor&&(h.opt.fillColor=l)),f&&h!=null&&h.opt&&(T=h.opt)!=null&&T.strokeType&&(h.opt.strokeType=f),h&&s.setInfo(r.name,h),$t.updateNodeOpt(t);}}]);}($t);var wh=/*#__PURE__*/function(_$t8){function wh(t){var _this79;_classCallCheck(this,wh);_this79=_callSuper(this,wh,[t]);dt(_this79,"canRotate",!1);dt(_this79,"scaleType",Ae.all);dt(_this79,"toolsType",Tt.Star);dt(_this79,"tmpPoints",[]);dt(_this79,"workOptions");dt(_this79,"oldRect");dt(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(wh,_$t8);return _createClass(wh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime,y=m==null?void 0:m.length;if(!y||y<2)return{type:xt.None};u&&(this.syncUnitTime=u);var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:xt.None};var E;if(s||c||f){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:h,layer:x,isDrawing:!0});}if(f){var _x42=Zt(E,this.oldRect);this.oldRect=E;var _I40=_objectSpread({rect:_x42,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);if(l){var _d36=Date.now();_d36-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d36,_I40.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_I40.index=0,_I40.isSync=!0);}return _I40;}if(!s&&l){var _x43=Date.now();return _x43-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x43,_objectSpread({type:xt.DrawWork,dataType:Vt.Local,op:this.tmpPoints.map(function(I){return[].concat(_toConsumableArray(I.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var C=Zt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:C,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=gr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:xt.FullWork,dataType:Vt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,_t$isDrawEraserlines3=t.isDrawEraserlines,c=_t$isDrawEraserlines3===void 0?!0:_t$isDrawEraserlines3,_this$workOptions10=this.workOptions,l=_this$workOptions10.strokeColor,f=_this$workOptions10.fillColor,h=_this$workOptions10.thickness,m=_this$workOptions10.zIndex,u=_this$workOptions10.vertices,y=_this$workOptions10.innerVerticeStep,T=_this$workOptions10.innerRatio,E=_this$workOptions10.scale,C=_this$workOptions10.rotate,x=_this$workOptions10.translate,I=_this$workOptions10.strokeType,d=_this$workOptions10.eraserlines,v=_this$workOptions10.lineDash,p=_this$workOptions10.lineCap,S=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(h,u,y,T),A=_this$computDrawPoint6.rect,R=_this$computDrawPoint6.pos,D=_this$computDrawPoint6.points,U={close:!0,points:D,lineWidth:h,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:p,lineDash:I===we.Dotted?[v&&v[0]||1,(v&&v[1]||2)*h]:I===we.LongDotted?[(v&&v[0]||1)*h,(v&&v[1]||2)*h]:void 0},M={name:r,id:r,zIndex:m,pos:R,anchor:[0.5,0.5],size:[A.w,A.h]};E&&(M.scale=E),C&&(M.rotate=C),x&&(M.translate=x);var W=new mr(M);if(s){var N=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/S[0],1/S[1]]});W.append(N);}var Y=new dn(_objectSpread(_objectSpread({},U),{},{pos:[0,0]}));W.append(Y),d&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:W,eraserlines:d,pos:R,layer:n},c)),this.replace(n,r,W);var B=W.getBoundingClientRect();return this.isDelete&&W.setAttribute("opacity",0),{x:Math.floor(B.x-$t.SafeBorderPadding),y:Math.floor(B.y-$t.SafeBorderPadding),w:Math.floor(B.width+$t.SafeBorderPadding*2),h:Math.floor(B.height+$t.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r,n,s){var c=Re(this.tmpPoints),l=[Math.floor(c.x+c.w/2),Math.floor(c.y+c.h/2)],f=Vh(c.w,c.h),h=Math.floor(Math.min(c.w,c.h)/2),m=s*h,u=[],y=2*Math.PI/r;for(var E=0;E<r;E++){var C=E*y-0.5*Math.PI;var x=void 0,_I41=void 0;E%n===1?(x=m*f[0]*Math.cos(C),_I41=m*f[1]*Math.sin(C)):(x=h*f[0]*Math.cos(C),_I41=h*f[1]*Math.sin(C),u.push(x,_I41)),u.push(x,_I41);}return{rect:Re(this.tmpPoints,t),pos:l,points:u};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,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 h,m;var r=t.op,n=t.isFullWork,_t$workState5=t.workState,s=_t$workState5===void 0?te.Done:_t$workState5,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var x;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,h=n.vertices,m=n.innerVerticeStep,u=n.innerRatio,y=n.strokeType,T=s.get(r.name),E=T==null?void 0:T.opt;var C=r;return r.tagName==="GROUP"&&(C=r.children[0]),c&&(C.setAttribute("strokeColor",c),E!=null&&E.strokeColor&&(E.strokeColor=c)),l&&(l==="transparent"?C.setAttribute("fillColor","rgba(0,0,0,0)"):C.setAttribute("fillColor",l),E!=null&&E.fillColor&&(E.fillColor=l)),f===Tt.Star&&(h&&(E.vertices=h),m&&(E.innerVerticeStep=m),u&&(E.innerRatio=u)),y&&T!=null&&T.opt&&(x=T.opt)!=null&&x.strokeType&&(T.opt.strokeType=y),T&&s.setInfo(r.name,_objectSpread(_objectSpread({},T),{},{opt:E})),$t.updateNodeOpt(t);}}]);}($t);var Ah=/*#__PURE__*/function(_$t9){function Ah(t){var _this80;_classCallCheck(this,Ah);_this80=_callSuper(this,Ah,[t]);dt(_this80,"canRotate",!1);dt(_this80,"scaleType",Ae.all);dt(_this80,"toolsType",Tt.Polygon);dt(_this80,"tmpPoints",[]);dt(_this80,"workOptions");dt(_this80,"oldRect");dt(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(Ah,_$t9);return _createClass(Ah,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=r.op,m=r.syncUnitTime;m&&(this.syncUnitTime=m);var u=this.workId,y=h==null?void 0:h.length;if(!y||y<2)return{type:xt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(h[0],h[1])],T=!1):T=this.updateTempPoints(h),!T)return{type:xt.None};var E;if(s||c||f){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:u,layer:x,isDrawing:!0});}if(f){var _x44=Zt(E,this.oldRect);this.oldRect=E;var _I42=_objectSpread({type:xt.DrawWork,rect:_x44,dataType:Vt.Local},this.baseConsumeResult);if(l){var _d37=Date.now();_d37-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d37,_I42.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_I42.index=0,_I42.isSync=!0);}return _I42;}if(!s&&l){var _x45=Date.now();return _x45-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x45,_objectSpread({type:xt.DrawWork,dataType:Vt.Local,op:this.tmpPoints.map(function(I){return[].concat(_toConsumableArray(I.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var C=Zt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:C,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=gr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:xt.FullWork,dataType:Vt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,_t$isDrawEraserlines4=t.isDrawEraserlines,c=_t$isDrawEraserlines4===void 0?!0:_t$isDrawEraserlines4,_this$workOptions11=this.workOptions,l=_this$workOptions11.strokeColor,f=_this$workOptions11.fillColor,h=_this$workOptions11.thickness,m=_this$workOptions11.zIndex,u=_this$workOptions11.vertices,y=_this$workOptions11.scale,T=_this$workOptions11.rotate,E=_this$workOptions11.translate,C=_this$workOptions11.strokeType,x=_this$workOptions11.eraserlines,I=_this$workOptions11.lineCap,d=_this$workOptions11.lineDash,v=n.worldScaling,_this$computDrawPoint7=this.computDrawPoints(h,u),p=_this$computDrawPoint7.rect,S=_this$computDrawPoint7.pos,A=_this$computDrawPoint7.points,R={close:!0,points:A,lineWidth:h,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:I,lineDash:C===we.Dotted?[d&&d[0]||1,(d&&d[1]||2)*h]:C===we.LongDotted?[(d&&d[0]||1)*h,(d&&d[1]||2)*h]:void 0},D={name:r,id:r,zIndex:m,pos:S,anchor:[0.5,0.5],size:[p.w,p.h]};y&&(D.scale=y),T&&(D.rotate=T),E&&(D.translate=E);var U=new mr(D);if(s){var Y=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/v[0],1/v[1]]});U.append(Y);}var M=new dn(_objectSpread(_objectSpread({},R),{},{pos:[0,0]}));U.append(M),x&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:U,eraserlines:x,pos:S,layer:n},c)),this.replace(n,r,U);var W=U.getBoundingClientRect();return this.isDelete&&U.setAttribute("opacity",0),{x:Math.floor(W.x-$t.SafeBorderPadding),y:Math.floor(W.y-$t.SafeBorderPadding),w:Math.floor(W.width+$t.SafeBorderPadding*2),h:Math.floor(W.height+$t.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=Re(this.tmpPoints),s=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],c=Vh(n.w,n.h),l=Math.floor(Math.min(n.w,n.h)/2),f=[],h=2*Math.PI/r;for(var u=0;u<r;u++){var y=u*h-0.5*Math.PI,T=l*c[0]*Math.cos(y),E=l*c[1]*Math.sin(y);f.push(T,E);}return{rect:Re(this.tmpPoints,t),pos:s,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,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 h,m;var r=t.op,n=t.isFullWork,_t$workState6=t.workState,s=_t$workState6===void 0?te.Done:_t$workState6,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var E;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,h=n.vertices,m=n.strokeType,u=s.get(r.name),y=u==null?void 0:u.opt;var T=r;return r.tagName==="GROUP"&&(T=r.children[0]),c&&(T.setAttribute("strokeColor",c),y!=null&&y.strokeColor&&(y.strokeColor=c)),l&&(l==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",l),y!=null&&y.fillColor&&(y.fillColor=l)),f===Tt.Polygon&&h&&(y.vertices=h),m&&u!=null&&u.opt&&(E=u.opt)!=null&&E.strokeType&&(u.opt.strokeType=m),u&&s.setInfo(r.name,_objectSpread(_objectSpread({},u),{},{opt:y})),$t.updateNodeOpt(t);}}]);}($t);var Hr=/*#__PURE__*/function(){function Hr(){_classCallCheck(this,Hr);}return _createClass(Hr,null,[{key:"bezier",value:function bezier(e,t){var r=[];for(var n=0;n<t.length;n+=4){var s=t[n],c=t[n+1],l=t[n+2],f=t[n+3];s&&c&&l&&f?r.push.apply(r,_toConsumableArray(Hr.getBezierPoints(e,s,c,l,f))):s&&c&&l?r.push.apply(r,_toConsumableArray(Hr.getBezierPoints(e,s,c,l))):s&&c?r.push.apply(r,_toConsumableArray(Hr.getBezierPoints(e,s,c))):s&&r.push(s);}return r;}/**
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 e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var r=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var s=arguments.length>4?arguments[4]:undefined;var c=null;var l=[];!n&&!s?c=Hr.oneBezier:n&&!s?c=Hr.twoBezier:n&&s&&(c=Hr.threeBezier);for(var f=0;f<e;f++)c&&l.push(c(f/e,t,r,n,s));return s?l.push(s):n&&l.push(n),l;}/**
419
+ * @desc 一阶贝塞尔
420
+ * @param {number} t 当前百分比
421
+ * @param {Vec2d} p1 起点坐标
422
+ * @param {Vec2d} p2 终点坐标
423
+ */},{key:"oneBezier",value:function oneBezier(e,t,r){var n=t.x+(r.x-t.x)*e,s=t.y+(r.y-t.y)*e;return new pt(n,s);}/**
424
+ * @desc 二阶贝塞尔
425
+ * @param {number} t 当前百分比
426
+ * @param {Array} p1 起点坐标
427
+ * @param {Array} p2 终点坐标
428
+ * @param {Array} cp 控制点
429
+ */},{key:"twoBezier",value:function twoBezier(e,t,r,n){var s=(1-e)*(1-e)*t.x+2*e*(1-e)*r.x+e*e*n.x,c=(1-e)*(1-e)*t.y+2*e*(1-e)*r.y+e*e*n.y;return new pt(s,c);}/**
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(e,t,r,n,s){var c=t.x*(1-e)*(1-e)*(1-e)+3*r.x*e*(1-e)*(1-e)+3*n.x*e*e*(1-e)+s.x*e*e*e,l=t.y*(1-e)*(1-e)*(1-e)+3*r.y*e*(1-e)*(1-e)+3*n.y*e*e*(1-e)+s.y*e*e*e;return new pt(c,l);}}]);}();var Eh=/*#__PURE__*/function(_$t10){function Eh(t){var _this81;_classCallCheck(this,Eh);_this81=_callSuper(this,Eh,[t]);dt(_this81,"canRotate",!1);dt(_this81,"scaleType",Ae.all);dt(_this81,"toolsType",Tt.SpeechBalloon);dt(_this81,"ratio",0.8);dt(_this81,"tmpPoints",[]);dt(_this81,"workOptions");dt(_this81,"oldRect");dt(_this81,"syncTimestamp");_this81.workOptions=t.toolsOpt,_this81.syncTimestamp=0,_this81.syncUnitTime=50;return _this81;}_inherits(Eh,_$t10);return _createClass(Eh,[{key:"consume",value:function consume(t){var C;var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=(C=r==null?void 0:r.workId)==null?void 0:C.toString();if(!h)return{type:xt.None};var m=r.op,u=m==null?void 0:m.length;if(!u||u<2)return{type:xt.None};var y;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],y=!1):y=this.updateTempPoints(m),!y)return{type:xt.None};var T;if(s||c||f){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;T=this.draw({workId:h,layer:x,isDrawing:!0});}if(f){var _x46=Zt(T,this.oldRect);this.oldRect=T;var _I43=_objectSpread({rect:_x46,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);if(l){var _d38=Date.now();_d38-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d38,_I43.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_I43.index=0,_I43.isSync=!0);}return _I43;}if(!s&&l){var _x47=Date.now();return _x47-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x47,_objectSpread({type:xt.DrawWork,dataType:Vt.Local,op:this.tmpPoints.map(function(I){return[].concat(_toConsumableArray(I.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Zt(T,this.oldRect);return this.oldRect=T,_objectSpread({rect:E,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=gr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:xt.FullWork,dataType:Vt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines5=t.isDrawEraserlines,s=_t$isDrawEraserlines5===void 0?!0:_t$isDrawEraserlines5,_this$workOptions12=this.workOptions,c=_this$workOptions12.strokeColor,l=_this$workOptions12.fillColor,f=_this$workOptions12.thickness,h=_this$workOptions12.zIndex,m=_this$workOptions12.placement,u=_this$workOptions12.scale,y=_this$workOptions12.rotate,T=_this$workOptions12.translate,E=_this$workOptions12.strokeType,C=_this$workOptions12.eraserlines,x=_this$workOptions12.lineDash,I=_this$workOptions12.lineCap,_this$computDrawPoint8=this.computDrawPoints(f,m),d=_this$computDrawPoint8.rect,v=_this$computDrawPoint8.pos,p=_this$computDrawPoint8.points,S={points:p.map(function(M){return M.XY;}),lineWidth:f,fillColor:l!=="transparent"&&l||void 0,strokeColor:c,normalize:!0,className:"".concat(v[0],",").concat(v[1]),close:!0,lineCap:I,lineDash:E===we.Dotted?[x&&x[0]||1,(x&&x[1]||2)*f]:E===we.LongDotted?[(x&&x[0]||1)*f,(x&&x[1]||2)*f]:void 0},A={name:r,id:r,zIndex:h,pos:v,anchor:[0.5,0.5],size:[d.w,d.h]};u&&(A.scale=u),y&&(A.rotate=y),T&&(A.translate=T);var R=new mr(A),D=new dn(_objectSpread(_objectSpread({},S),{},{pos:[0,0]}));R.append(D),C&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:R,eraserlines:C,pos:v,layer:n},s)),this.replace(n,r,R);var U=R.getBoundingClientRect();return this.isDelete&&R.setAttribute("opacity",0),{x:Math.floor(U.x-$t.SafeBorderPadding),y:Math.floor(U.y-$t.SafeBorderPadding),w:Math.floor(U.width+$t.SafeBorderPadding*2),h:Math.floor(U.height+$t.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var r=Re(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=r.y+r.h*this.ratio;return[new pt(r.x,r.y,0),new pt(r.x+r.w,r.y,0),new pt(r.x+r.w,n,0),new pt(r.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=r.y+r.h*(1-this.ratio);return[new pt(r.x,_n4,0),new pt(r.x+r.w,_n4,0),new pt(r.x+r.w,r.y+r.h,0),new pt(r.x,r.y+r.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=r.x+r.w*(1-this.ratio);return[new pt(_n5,r.y,0),new pt(r.x+r.w,r.y,0),new pt(r.x+r.w,r.y+r.h,0),new pt(_n5,r.y+r.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=r.x+r.w*this.ratio;return[new pt(r.x,r.y,0),new pt(_n6,r.y,0),new pt(_n6,r.y+r.h,0),new pt(r.x,r.y+r.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=Re(this.tmpPoints),s=this.transformControlPoints(r),c=Math.floor(n.w*0.1),l=Math.floor(n.h*0.1),f=[],h=pt.Add(s[0],new pt(0,l,0)),m=pt.Add(s[0],new pt(c,0,0)),u=Hr.getBezierPoints(10,h,s[0],m),y=pt.Sub(s[1],new pt(c,0,0)),T=pt.Add(s[1],new pt(0,l,0)),E=Hr.getBezierPoints(10,y,s[1],T),C=pt.Sub(s[2],new pt(0,l,0)),x=pt.Sub(s[2],new pt(c,0,0)),I=Hr.getBezierPoints(10,C,s[2],x),d=pt.Add(s[3],new pt(c,0,0)),v=pt.Sub(s[3],new pt(0,l,0)),p=Hr.getBezierPoints(10,d,s[3],v),S=c*(1-this.ratio)*10,A=l*(1-this.ratio)*10;switch(r){case"bottom":{var U=pt.Sub(s[2],new pt(c*5-S/2,0,0)),M=pt.Sub(s[2],new pt(c*5,-A,0)),W=pt.Sub(s[2],new pt(c*5+S/2,0,0));f.push.apply(f,[M,W].concat(_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(E),_toConsumableArray(I),[U]));break;}case"bottomRight":{var _U13=pt.Sub(s[2],new pt(c*1.1,0,0)),_M10=pt.Sub(s[2],new pt(c*1.1+S/2,-A,0)),_W8=pt.Sub(s[2],new pt(c*1.1+S,0,0));f.push.apply(f,[_M10,_W8].concat(_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(E),_toConsumableArray(I),[_U13]));break;}case"bottomLeft":{var _U14=pt.Add(s[3],new pt(c*1.1+S,0,0)),_M11=pt.Add(s[3],new pt(c*1.1+S/2,A,0)),_W9=pt.Add(s[3],new pt(c*1.1,0,0));f.push.apply(f,[_M11,_W9].concat(_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(E),_toConsumableArray(I),[_U14]));break;}case"top":{var _U15=pt.Sub(s[1],new pt(c*5-S/2,0,0)),_M12=pt.Sub(s[1],new pt(c*5,A,0)),_W10=pt.Sub(s[1],new pt(c*5+S/2,0,0));f.push.apply(f,[_M12,_U15].concat(_toConsumableArray(E),_toConsumableArray(I),_toConsumableArray(p),_toConsumableArray(u),[_W10]));break;}case"topRight":{var _U16=pt.Sub(s[1],new pt(c*1.1,0,0)),_M13=pt.Sub(s[1],new pt(c*1.1+S/2,A,0)),_W11=pt.Sub(s[1],new pt(c*1.1+S,0,0));f.push.apply(f,[_M13,_U16].concat(_toConsumableArray(E),_toConsumableArray(I),_toConsumableArray(p),_toConsumableArray(u),[_W11]));break;}case"topLeft":{var _U17=pt.Add(s[0],new pt(c*1.1+S,0,0)),_M14=pt.Add(s[0],new pt(c*1.1+S/2,-A,0)),_W12=pt.Add(s[0],new pt(c*1.1,0,0));f.push.apply(f,[_M14,_U17].concat(_toConsumableArray(E),_toConsumableArray(I),_toConsumableArray(p),_toConsumableArray(u),[_W12]));break;}case"left":{var _U18=pt.Add(s[0],new pt(0,l*5-A/2,0)),_M15=pt.Add(s[0],new pt(-S,l*5,0)),_W13=pt.Add(s[0],new pt(0,l*5+A/2,0));f.push.apply(f,[_M15,_U18].concat(_toConsumableArray(u),_toConsumableArray(E),_toConsumableArray(I),_toConsumableArray(p),[_W13]));break;}case"leftTop":{var _U19=pt.Add(s[0],new pt(0,l*1.1,0)),_M16=pt.Add(s[0],new pt(-S,l*1.1+A/2,0)),_W14=pt.Add(s[0],new pt(0,l*1.1+A,0));f.push.apply(f,[_M16,_U19].concat(_toConsumableArray(u),_toConsumableArray(E),_toConsumableArray(I),_toConsumableArray(p),[_W14]));break;}case"leftBottom":{var _U20=pt.Sub(s[3],new pt(0,l*1.1+A,0)),_M17=pt.Sub(s[3],new pt(S,l*1.1+A/2,0)),_W15=pt.Sub(s[3],new pt(0,l*1.1,0));f.push.apply(f,[_M17,_U20].concat(_toConsumableArray(u),_toConsumableArray(E),_toConsumableArray(I),_toConsumableArray(p),[_W15]));break;}case"right":{var _U21=pt.Add(s[1],new pt(0,l*5-A/2,0)),_M18=pt.Add(s[1],new pt(S,l*5,0)),_W16=pt.Add(s[1],new pt(0,l*5+A/2,0));f.push.apply(f,[_M18,_W16].concat(_toConsumableArray(I),_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(E),[_U21]));break;}case"rightTop":{var _U22=pt.Add(s[1],new pt(0,l*1.1,0)),_M19=pt.Add(s[1],new pt(S,l*1.1+A/2,0)),_W17=pt.Add(s[1],new pt(0,l*1.1+A,0));f.push.apply(f,[_M19,_W17].concat(_toConsumableArray(I),_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(E),[_U22]));break;}case"rightBottom":{var _U23=pt.Sub(s[2],new pt(0,l*1.1+A,0)),_M20=pt.Sub(s[2],new pt(-S,l*1.1+A/2,0)),_W18=pt.Sub(s[2],new pt(0,l*1.1,0));f.push.apply(f,[_M20,_W18].concat(_toConsumableArray(I),_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(E),[_U23]));break;}}var R=Re(this.tmpPoints,t),D=[Math.floor(R.x+R.w/2),Math.floor(R.y+R.h/2)];return{rect:R,pos:D,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,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 h,m;var r=t.op,n=t.isFullWork,_t$workState7=t.workState,s=_t$workState7===void 0?te.Done:_t$workState7,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var E;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,h=n.placement,m=n.strokeType,u=s.get(r.name),y=u==null?void 0:u.opt;var T=r;return r.tagName==="GROUP"&&(T=r.children[0]),c&&(T.setAttribute("strokeColor",c),y!=null&&y.strokeColor&&(y.strokeColor=c)),l&&(l==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",l),y!=null&&y.fillColor&&(y.fillColor=l)),f===Tt.SpeechBalloon&&h&&(y.placement=h),m&&u!=null&&u.opt&&(E=u.opt)!=null&&E.strokeType&&(u.opt.strokeType=m),u&&s.setInfo(r.name,_objectSpread(_objectSpread({},u),{},{opt:y})),$t.updateNodeOpt(t);}}]);}($t);var tA=Pi,eA=pn,rA="[object Boolean]";function nA(i){return i===!0||i===!1||eA(i)&&tA(i)==rA;}var iA=nA,hi=/* @__PURE__ */Ln(iA);var Hi=/*#__PURE__*/function(_$t11){function Hi(t){var _this82;_classCallCheck(this,Hi);_this82=_callSuper(this,Hi,[t]);dt(_this82,"canRotate",!0);dt(_this82,"scaleType",Ae.all);dt(_this82,"toolsType",Tt.Image);dt(_this82,"tmpPoints",[]);dt(_this82,"workOptions");dt(_this82,"oldRect");_this82.workOptions=t.toolsOpt,_this82.scaleType=Hi.getScaleType(_this82.workOptions);return _this82;}_inherits(Hi,_$t11);return _createClass(Hi,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,s=t.replaceId,c=t.imageBitmap,_this$workOptions13=this.workOptions,l=_this$workOptions13.centerX,f=_this$workOptions13.centerY,h=_this$workOptions13.width,m=_this$workOptions13.height,u=_this$workOptions13.rotate,y=_this$workOptions13.zIndex,T=_this$workOptions13.eraserlines,E=new mr({anchor:[0.5,0.5],pos:[l,f],name:n,size:[h,m],zIndex:y,rotate:u}),C={anchor:[0.5,0.5],pos:[0,0],size:[h,m],texture:c};c||(C.bgcolor="rgba(0,0,0,0.3)");var x=new Yu(C);E.append(x),T&&this.drawEraserlines({group:E,eraserlines:T,pos:[l,f],layer:r}),this.replace(r,s||n,E);var I=E.getBoundingClientRect();if(I)return{x:Math.floor(I.x-$t.SafeBorderPadding),y:Math.floor(I.y-$t.SafeBorderPadding),w:Math.floor(I.width+$t.SafeBorderPadding*2),h:Math.floor(I.height+$t.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var m,u,y,T,r,n,s,_this$workOptions14,c,l,f,h,E,C;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:r=t.isFullWork,n=t.replaceId,s=t.worker,_this$workOptions14=this.workOptions,c=_this$workOptions14.src,l=_this$workOptions14.uuid,f=((m=this.workId)==null?void 0:m.toString())||l,h=r?this.fullLayer:this.drawLayer||this.fullLayer;if(!c){_context25.next=8;break;}_context25.next=4;return s.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:f,isSubWorker:s instanceof id});case 4:E=_context25.sent;if(!E){_context25.next=8;break;}C=this.draw({workId:f,layer:h,replaceId:n,imageBitmap:E});return _context25.abrupt("return",(this.oldRect=f&&((y=(u=this.vNodes)==null?void 0:u.get(f))==null?void 0:y.rect)||void 0,(T=this.vNodes)==null||T.setInfo(f,{rect:C,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:C&&$t.getCenterPos(C,h)}),C));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x48){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var r=t.uniformScale,n=t.rotate;return r!==!1||n&&Math.abs(n)%90>0?Ae.proportional:Ae.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.translate,f=n.originPoint,h=n.scenePoint,m=n.scale,u=n.angle,y=n.isLocked,T=n.zIndex,E=n.strokeColor,C=c&&fr(c)||s.get(r.name);if(!C)return;var x=r.parent;if(x){if(E&&(C.opt.strokeColor=E),er(T)&&(r.setAttribute("zIndex",T),C.opt.zIndex=T),hi(y)&&(C.opt.locked=y),f&&h&&m&&l){var _C$opt=C.opt,_I44=_C$opt.centerX,_d39=_C$opt.centerY,v=_C$opt.width,p=_C$opt.height,S=_C$opt.uniformScale,A=S!==!1?[m[0],m[0]]:m,R=[_I44,_d39],D=[_I44,_d39];Ll(D,h,A,l);var U=[D[0]-R[0],D[1]-R[1]];if(C.centerPos=[C.centerPos[0]+U[0],C.centerPos[1]+U[1]],C.opt.width=Math.round(v*A[0]),C.opt.height=Math.round(p*A[1]),C.opt.centerX=D[0],C.opt.centerY=D[1],C.opt.eraserlines){var _iterator31=_createForOfIteratorHelper(C.opt.eraserlines),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var M=_step31.value;var W=M.op,Y=M.thickness;M.thickness=Math.round(Y*Math.max(m[0],m[1]));for(var B=0;B<W.length;B++)Rl(W[B],h,m,l);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}}else if(l){if(C.opt.centerX=C.opt.centerX+l[0],C.opt.centerY=C.opt.centerY+l[1],C.centerPos=[C.centerPos[0]+l[0],C.centerPos[1]+l[1]],C.opt.eraserlines){var _iterator32=_createForOfIteratorHelper(C.opt.eraserlines),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _I45=_step32.value;var _d40=_I45.op;for(var _v12=0;_v12<_d40.length;_v12++){var _p15=_d40[_v12].map(function(S,A){return A%2?S+l[1]:S+l[0];});_I45.op[_v12]=_p15;}}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}}else if(er(u))if(C.opt.rotate=u,C.scaleType=Hi.getScaleType(C.opt),c){var _I46=kh(C.rect,u);C.rect=_I46;}else{var _I47=$t.getRectFromLayer(x,r.name);C.rect=_I47||C.rect;}return C&&s.setInfo(r.name,C),C==null?void 0:C.rect;}}}]);}($t);var Mh=/*#__PURE__*/function(_$t12){function Mh(t){var _this83;_classCallCheck(this,Mh);_this83=_callSuper(this,Mh,[t]);dt(_this83,"canRotate",!1);dt(_this83,"scaleType",Ae.both);dt(_this83,"toolsType",Tt.Straight);dt(_this83,"tmpPoints",[]);dt(_this83,"workOptions");dt(_this83,"oldRect");dt(_this83,"straightTipWidth");dt(_this83,"syncTimestamp");_this83.workOptions=t.toolsOpt,_this83.straightTipWidth=_this83.workOptions.thickness/2,_this83.syncTimestamp=0,_this83.syncUnitTime=50;return _this83;}_inherits(Mh,_$t12);return _createClass(Mh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime,y=m==null?void 0:m.length;if(!y||y<2)return{type:xt.None};u&&(this.syncUnitTime=u);var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:xt.None};var E;if(s||c||f){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:h,layer:x});}if(f){var _x49=Zt(E,this.oldRect);this.oldRect=E;var _I48=_objectSpread({rect:_x49,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);if(l){var _d41=Date.now();_d41-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d41,_I48.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_I48.index=0,_I48.isSync=!0);}return _I48;}if(!s&&l){var _x50=Date.now();return _x50-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x50,_objectSpread({type:xt.DrawWork,dataType:Vt.Local,op:this.tmpPoints.map(function(I){return[].concat(_toConsumableArray(I.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var C=Zt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:C,type:xt.DrawWork,dataType:Vt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=gr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&$t.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:xt.FullWork,dataType:Vt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines6=t.isDrawEraserlines,s=_t$isDrawEraserlines6===void 0?!0:_t$isDrawEraserlines6,_this$workOptions15=this.workOptions,c=_this$workOptions15.strokeColor,l=_this$workOptions15.thickness,f=_this$workOptions15.zIndex,h=_this$workOptions15.scale,m=_this$workOptions15.rotate,u=_this$workOptions15.translate,y=_this$workOptions15.strokeType,T=_this$workOptions15.eraserlines,E=_this$workOptions15.lineCap,C=_this$workOptions15.lineDash,x=n.worldPosition,I=n.worldScaling,_this$computDrawPoint9=this.computDrawPoints(l,y),d=_this$computDrawPoint9.d,v=_this$computDrawPoint9.rect,p=_this$computDrawPoint9.isDot,S=[v.x+v.w/2,v.y+v.h/2],A=new mr({pos:S,anchor:[0.5,0.5],size:[v.w,v.h],name:r,id:r,normalize:!0,zIndex:f}),R={pos:[0,0],normalize:!0,d:d,fillColor:c,strokeColor:c,lineDash:p?void 0:y===we.Dotted?[C&&C[0]||1,(C&&C[1]||2)*l]:y===we.LongDotted?[(C&&C[0]||1)*l,(C&&C[1]||2)*l]:void 0,lineCap:p?void 0:E,lineWidth:y===we.Normal||p?0:l};h&&(R.scale=h),m&&(R.rotate=m),u&&(R.translate=u);var D=new Mn(R);A.append(D),T&&(this.scaleType=Ae.proportional,this.drawEraserlines({group:A,eraserlines:T,pos:S,layer:n},s)),this.replace(n,r,A);var U={x:Math.floor(v.x*I[0]+x[0]-$t.SafeBorderPadding),y:Math.floor(v.y*I[1]+x[1]-$t.SafeBorderPadding),w:Math.floor(v.w*I[0]+2*$t.SafeBorderPadding),h:Math.floor(v.h*I[1]+2*$t.SafeBorderPadding)};if(m||h||u){var M=D.getBoundingClientRect();U={x:Math.floor(M.x-$t.SafeBorderPadding),y:Math.floor(M.y-$t.SafeBorderPadding),w:Math.floor(M.width+$t.SafeBorderPadding*2),h:Math.floor(M.height+$t.SafeBorderPadding*2)};}return this.isDelete&&A.setAttribute("opacity",0),U;}},{key:"computDrawPoints",value:function computDrawPoints(t,r){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t,r):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t,r){var n=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),s=pt.Per(n).mul(t/2),c=Jt.Sub(this.tmpPoints[0],s),l=Jt.Add(this.tmpPoints[0],s),f=Jt.Sub(this.tmpPoints[1],s),h=Jt.Add(this.tmpPoints[1],s),m=Jt.GetSemicircleStroke(this.tmpPoints[1],f,-1,8),u=Jt.GetSemicircleStroke(this.tmpPoints[0],l,-1,8),y=[c,f].concat(_toConsumableArray(m),[h,l],_toConsumableArray(u));var T;return r!==we.Normal?T=En(this.tmpPoints,!1):T=En(y,!0),{d:T,rect:Re(y),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var r=Jt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:En(r,!0),rect:Re(r),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 h,m;var r=t.op,n=t.isFullWork,_t$workState8=t.workState,s=_t$workState8===void 0?te.Done:_t$workState8,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&$t.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,m;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?r.children.forEach(function(u){u.setAttribute("strokeColor",c),u.getAttribute("fillColor")&&u.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(h=f==null?void 0:f.opt)!=null&&h.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(m=f.opt)!=null&&m.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),$t.updateNodeOpt(t);}}]);}($t);var di="cursorhover",wu=20,ki="mainView";var Au={exports:{}},ke={},ll={exports:{}},jn={};function Lh(){var i={};return i["align-content"]=!1,i["align-items"]=!1,i["align-self"]=!1,i["alignment-adjust"]=!1,i["alignment-baseline"]=!1,i.all=!1,i["anchor-point"]=!1,i.animation=!1,i["animation-delay"]=!1,i["animation-direction"]=!1,i["animation-duration"]=!1,i["animation-fill-mode"]=!1,i["animation-iteration-count"]=!1,i["animation-name"]=!1,i["animation-play-state"]=!1,i["animation-timing-function"]=!1,i.azimuth=!1,i["backface-visibility"]=!1,i.background=!0,i["background-attachment"]=!0,i["background-clip"]=!0,i["background-color"]=!0,i["background-image"]=!0,i["background-origin"]=!0,i["background-position"]=!0,i["background-repeat"]=!0,i["background-size"]=!0,i["baseline-shift"]=!1,i.binding=!1,i.bleed=!1,i["bookmark-label"]=!1,i["bookmark-level"]=!1,i["bookmark-state"]=!1,i.border=!0,i["border-bottom"]=!0,i["border-bottom-color"]=!0,i["border-bottom-left-radius"]=!0,i["border-bottom-right-radius"]=!0,i["border-bottom-style"]=!0,i["border-bottom-width"]=!0,i["border-collapse"]=!0,i["border-color"]=!0,i["border-image"]=!0,i["border-image-outset"]=!0,i["border-image-repeat"]=!0,i["border-image-slice"]=!0,i["border-image-source"]=!0,i["border-image-width"]=!0,i["border-left"]=!0,i["border-left-color"]=!0,i["border-left-style"]=!0,i["border-left-width"]=!0,i["border-radius"]=!0,i["border-right"]=!0,i["border-right-color"]=!0,i["border-right-style"]=!0,i["border-right-width"]=!0,i["border-spacing"]=!0,i["border-style"]=!0,i["border-top"]=!0,i["border-top-color"]=!0,i["border-top-left-radius"]=!0,i["border-top-right-radius"]=!0,i["border-top-style"]=!0,i["border-top-width"]=!0,i["border-width"]=!0,i.bottom=!1,i["box-decoration-break"]=!0,i["box-shadow"]=!0,i["box-sizing"]=!0,i["box-snap"]=!0,i["box-suppress"]=!0,i["break-after"]=!0,i["break-before"]=!0,i["break-inside"]=!0,i["caption-side"]=!1,i.chains=!1,i.clear=!0,i.clip=!1,i["clip-path"]=!1,i["clip-rule"]=!1,i.color=!0,i["color-interpolation-filters"]=!0,i["column-count"]=!1,i["column-fill"]=!1,i["column-gap"]=!1,i["column-rule"]=!1,i["column-rule-color"]=!1,i["column-rule-style"]=!1,i["column-rule-width"]=!1,i["column-span"]=!1,i["column-width"]=!1,i.columns=!1,i.contain=!1,i.content=!1,i["counter-increment"]=!1,i["counter-reset"]=!1,i["counter-set"]=!1,i.crop=!1,i.cue=!1,i["cue-after"]=!1,i["cue-before"]=!1,i.cursor=!1,i.direction=!1,i.display=!0,i["display-inside"]=!0,i["display-list"]=!0,i["display-outside"]=!0,i["dominant-baseline"]=!1,i.elevation=!1,i["empty-cells"]=!1,i.filter=!1,i.flex=!1,i["flex-basis"]=!1,i["flex-direction"]=!1,i["flex-flow"]=!1,i["flex-grow"]=!1,i["flex-shrink"]=!1,i["flex-wrap"]=!1,i["float"]=!1,i["float-offset"]=!1,i["flood-color"]=!1,i["flood-opacity"]=!1,i["flow-from"]=!1,i["flow-into"]=!1,i.font=!0,i["font-family"]=!0,i["font-feature-settings"]=!0,i["font-kerning"]=!0,i["font-language-override"]=!0,i["font-size"]=!0,i["font-size-adjust"]=!0,i["font-stretch"]=!0,i["font-style"]=!0,i["font-synthesis"]=!0,i["font-variant"]=!0,i["font-variant-alternates"]=!0,i["font-variant-caps"]=!0,i["font-variant-east-asian"]=!0,i["font-variant-ligatures"]=!0,i["font-variant-numeric"]=!0,i["font-variant-position"]=!0,i["font-weight"]=!0,i.grid=!1,i["grid-area"]=!1,i["grid-auto-columns"]=!1,i["grid-auto-flow"]=!1,i["grid-auto-rows"]=!1,i["grid-column"]=!1,i["grid-column-end"]=!1,i["grid-column-start"]=!1,i["grid-row"]=!1,i["grid-row-end"]=!1,i["grid-row-start"]=!1,i["grid-template"]=!1,i["grid-template-areas"]=!1,i["grid-template-columns"]=!1,i["grid-template-rows"]=!1,i["hanging-punctuation"]=!1,i.height=!0,i.hyphens=!1,i.icon=!1,i["image-orientation"]=!1,i["image-resolution"]=!1,i["ime-mode"]=!1,i["initial-letters"]=!1,i["inline-box-align"]=!1,i["justify-content"]=!1,i["justify-items"]=!1,i["justify-self"]=!1,i.left=!1,i["letter-spacing"]=!0,i["lighting-color"]=!0,i["line-box-contain"]=!1,i["line-break"]=!1,i["line-grid"]=!1,i["line-height"]=!1,i["line-snap"]=!1,i["line-stacking"]=!1,i["line-stacking-ruby"]=!1,i["line-stacking-shift"]=!1,i["line-stacking-strategy"]=!1,i["list-style"]=!0,i["list-style-image"]=!0,i["list-style-position"]=!0,i["list-style-type"]=!0,i.margin=!0,i["margin-bottom"]=!0,i["margin-left"]=!0,i["margin-right"]=!0,i["margin-top"]=!0,i["marker-offset"]=!1,i["marker-side"]=!1,i.marks=!1,i.mask=!1,i["mask-box"]=!1,i["mask-box-outset"]=!1,i["mask-box-repeat"]=!1,i["mask-box-slice"]=!1,i["mask-box-source"]=!1,i["mask-box-width"]=!1,i["mask-clip"]=!1,i["mask-image"]=!1,i["mask-origin"]=!1,i["mask-position"]=!1,i["mask-repeat"]=!1,i["mask-size"]=!1,i["mask-source-type"]=!1,i["mask-type"]=!1,i["max-height"]=!0,i["max-lines"]=!1,i["max-width"]=!0,i["min-height"]=!0,i["min-width"]=!0,i["move-to"]=!1,i["nav-down"]=!1,i["nav-index"]=!1,i["nav-left"]=!1,i["nav-right"]=!1,i["nav-up"]=!1,i["object-fit"]=!1,i["object-position"]=!1,i.opacity=!1,i.order=!1,i.orphans=!1,i.outline=!1,i["outline-color"]=!1,i["outline-offset"]=!1,i["outline-style"]=!1,i["outline-width"]=!1,i.overflow=!1,i["overflow-wrap"]=!1,i["overflow-x"]=!1,i["overflow-y"]=!1,i.padding=!0,i["padding-bottom"]=!0,i["padding-left"]=!0,i["padding-right"]=!0,i["padding-top"]=!0,i.page=!1,i["page-break-after"]=!1,i["page-break-before"]=!1,i["page-break-inside"]=!1,i["page-policy"]=!1,i.pause=!1,i["pause-after"]=!1,i["pause-before"]=!1,i.perspective=!1,i["perspective-origin"]=!1,i.pitch=!1,i["pitch-range"]=!1,i["play-during"]=!1,i.position=!1,i["presentation-level"]=!1,i.quotes=!1,i["region-fragment"]=!1,i.resize=!1,i.rest=!1,i["rest-after"]=!1,i["rest-before"]=!1,i.richness=!1,i.right=!1,i.rotation=!1,i["rotation-point"]=!1,i["ruby-align"]=!1,i["ruby-merge"]=!1,i["ruby-position"]=!1,i["shape-image-threshold"]=!1,i["shape-outside"]=!1,i["shape-margin"]=!1,i.size=!1,i.speak=!1,i["speak-as"]=!1,i["speak-header"]=!1,i["speak-numeral"]=!1,i["speak-punctuation"]=!1,i["speech-rate"]=!1,i.stress=!1,i["string-set"]=!1,i["tab-size"]=!1,i["table-layout"]=!1,i["text-align"]=!0,i["text-align-last"]=!0,i["text-combine-upright"]=!0,i["text-decoration"]=!0,i["text-decoration-color"]=!0,i["text-decoration-line"]=!0,i["text-decoration-skip"]=!0,i["text-decoration-style"]=!0,i["text-emphasis"]=!0,i["text-emphasis-color"]=!0,i["text-emphasis-position"]=!0,i["text-emphasis-style"]=!0,i["text-height"]=!0,i["text-indent"]=!0,i["text-justify"]=!0,i["text-orientation"]=!0,i["text-overflow"]=!0,i["text-shadow"]=!0,i["text-space-collapse"]=!0,i["text-transform"]=!0,i["text-underline-position"]=!0,i["text-wrap"]=!0,i.top=!1,i.transform=!1,i["transform-origin"]=!1,i["transform-style"]=!1,i.transition=!1,i["transition-delay"]=!1,i["transition-duration"]=!1,i["transition-property"]=!1,i["transition-timing-function"]=!1,i["unicode-bidi"]=!1,i["vertical-align"]=!1,i.visibility=!1,i["voice-balance"]=!1,i["voice-duration"]=!1,i["voice-family"]=!1,i["voice-pitch"]=!1,i["voice-range"]=!1,i["voice-rate"]=!1,i["voice-stress"]=!1,i["voice-volume"]=!1,i.volume=!1,i["white-space"]=!1,i.widows=!1,i.width=!0,i["will-change"]=!1,i["word-break"]=!0,i["word-spacing"]=!0,i["word-wrap"]=!0,i["wrap-flow"]=!1,i["wrap-through"]=!1,i["writing-mode"]=!1,i["z-index"]=!1,i;}function sA(i,e,t){}function oA(i,e,t){}var aA=/javascript\s*\:/img;function lA(i,e){return aA.test(e)?"":e;}jn.whiteList=Lh();jn.getDefaultWhiteList=Lh;jn.onAttr=sA;jn.onIgnoreAttr=oA;jn.safeAttrValue=lA;var fA={indexOf:function indexOf(i,e){var t,r;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,r=i.length;t<r;t++)if(i[t]===e)return t;return-1;},forEach:function forEach(i,e,t){var r,n;if(Array.prototype.forEach)return i.forEach(e,t);for(r=0,n=i.length;r<n;r++)e.call(t,i[r],r,i);},trim:function trim(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"");},trimRight:function trimRight(i){return String.prototype.trimRight?i.trimRight():i.replace(/(\s*$)/g,"");}},ji=fA;function cA(i,e){i=ji.trimRight(i),i[i.length-1]!==";"&&(i+=";");var t=i.length,r=!1,n=0,s=0,c="";function l(){if(!r){var m=ji.trim(i.slice(n,s)),u=m.indexOf(":");if(u!==-1){var y=ji.trim(m.slice(0,u)),T=ji.trim(m.slice(u+1));if(y){var E=e(n,c.length,y,T,m);E&&(c+=E+"; ");}}}n=s+1;}for(;s<t;s++){var f=i[s];if(f==="/"&&i[s+1]==="*"){var h=i.indexOf("*/",s+2);if(h===-1)break;s=h+1,n=s+1,r=!1;}else f==="("?r=!0:f===")"?r=!1:f===";"?r||l():f==="\n"&&l();}return ji.trim(c);}var uA=cA,Vs=jn,hA=uA;function Eu(i){return i==null;}function dA(i){var e={};for(var t in i)e[t]=i[t];return e;}function Rh(i){i=dA(i||{}),i.whiteList=i.whiteList||Vs.whiteList,i.onAttr=i.onAttr||Vs.onAttr,i.onIgnoreAttr=i.onIgnoreAttr||Vs.onIgnoreAttr,i.safeAttrValue=i.safeAttrValue||Vs.safeAttrValue,this.options=i;}Rh.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onAttr,s=t.onIgnoreAttr,c=t.safeAttrValue,l=hA(i,function(f,h,m,u,y){var T=r[m],E=!1;if(T===!0?E=T:typeof T=="function"?E=T(u):T instanceof RegExp&&(E=T.test(u)),E!==!0&&(E=!1),u=c(m,u),!!u){var C={position:h,sourcePosition:f,source:y,isWhite:E};if(E){var x=n(m,u,C);return Eu(x)?m+":"+u:x;}else{var x=s(m,u,C);if(!Eu(x))return x;}}});return l;};var pA=Rh;(function(i,e){var t=jn,r=pA;function n(c,l){var f=new r(l);return f.process(c);}e=i.exports=n,e.FilterCSS=r;for(var s in t)e[s]=t[s];(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterCSS=i.exports);})(ll,ll.exports);var El=ll.exports,Ml={indexOf:function indexOf(i,e){var t,r;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,r=i.length;t<r;t++)if(i[t]===e)return t;return-1;},forEach:function forEach(i,e,t){var r,n;if(Array.prototype.forEach)return i.forEach(e,t);for(r=0,n=i.length;r<n;r++)e.call(t,i[r],r,i);},trim:function trim(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"");},spaceIndex:function spaceIndex(i){var e=/\s|\n|\t/,t=e.exec(i);return t?t.index:-1;}},vA=El.FilterCSS,gA=El.getDefaultWhiteList,oo=Ml;function bh(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]};}var Dh=new vA();function mA(i,e,t){}function yA(i,e,t){}function PA(i,e,t){}function SA(i,e,t){}function Nh(i){return i.replace(TA,"&lt;").replace(CA,"&gt;");}function xA(i,e,t,r){if(t=Xh(t),e==="href"||e==="src"){if(t=oo.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return"";}else if(e==="background"){if(Zs.lastIndex=0,Zs.test(t))return"";}else if(e==="style"){if(Mu.lastIndex=0,Mu.test(t)||(Lu.lastIndex=0,Lu.test(t)&&(Zs.lastIndex=0,Zs.test(t))))return"";r!==!1&&(r=r||Dh,t=r.process(t));}return t=zh(t),t;}var TA=/</g,CA=/>/g,IA=/"/g,OA=/&quot;/g,wA=/&#([a-zA-Z0-9]*);?/gim,AA=/&colon;?/gim,EA=/&newline;?/gim,Zs=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Mu=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Lu=/u\s*r\s*l\s*\(.*/gi;function Bh(i){return i.replace(IA,"&quot;");}function Wh(i){return i.replace(OA,'"');}function Fh(i){return i.replace(wA,function(t,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10));});}function Uh(i){return i.replace(AA,":").replace(EA," ");}function Yh(i){for(var e="",t=0,r=i.length;t<r;t++)e+=i.charCodeAt(t)<32?" ":i.charAt(t);return oo.trim(e);}function Xh(i){return i=Wh(i),i=Fh(i),i=Uh(i),i=Yh(i),i;}function zh(i){return i=Bh(i),i=Nh(i),i;}function MA(){return"";}function LA(i,e){typeof e!="function"&&(e=function e(){});var t=!Array.isArray(i);function r(c){return t?!0:oo.indexOf(i,c)!==-1;}var n=[],s=!1;return{onIgnoreTag:function onIgnoreTag(c,l,f){if(r(c)){if(f.isClosing){var h="[/removed]",m=f.position+h.length;return n.push([s!==!1?s:f.position,m]),s=!1,h;}else return s||(s=f.position),"[removed]";}else return e(c,l,f);},remove:function remove(c){var l="",f=0;return oo.forEach(n,function(h){l+=c.slice(f,h[0]),f=h[1];}),l+=c.slice(f),l;}};}function RA(i){for(var e="",t=0;t<i.length;){var r=i.indexOf("<!--",t);if(r===-1){e+=i.slice(t);break;}e+=i.slice(t,r);var n=i.indexOf("-->",r);if(n===-1)break;t=n+3;}return e;}function bA(i){var e=i.split("");return e=e.filter(function(t){var r=t.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0;}),e.join("");}ke.whiteList=bh();ke.getDefaultWhiteList=bh;ke.onTag=mA;ke.onIgnoreTag=yA;ke.onTagAttr=PA;ke.onIgnoreTagAttr=SA;ke.safeAttrValue=xA;ke.escapeHtml=Nh;ke.escapeQuote=Bh;ke.unescapeQuote=Wh;ke.escapeHtmlEntities=Fh;ke.escapeDangerHtml5Entities=Uh;ke.clearNonPrintableCharacter=Yh;ke.friendlyAttrValue=Xh;ke.escapeAttrValue=zh;ke.onIgnoreTagStripAll=MA;ke.StripTagBody=LA;ke.stripCommentTag=RA;ke.stripBlankChar=bA;ke.attributeWrapSign='"';ke.cssFilter=Dh;ke.getDefaultCSSWhiteList=gA;var xo={},wn=Ml;function DA(i){var e=wn.spaceIndex(i),t;return e===-1?t=i.slice(1,-1):t=i.slice(1,e+1),t=wn.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t;}function NA(i){return i.slice(0,2)==="</";}function BA(i,e,t){var r="",n=0,s=!1,c=!1,l=0,f=i.length,h="",m="";t:for(l=0;l<f;l++){var u=i.charAt(l);if(s===!1){if(u==="<"){s=l;continue;}}else if(c===!1){if(u==="<"){r+=t(i.slice(n,l)),s=l,n=l;continue;}if(u===">"||l===f-1){r+=t(i.slice(n,s)),m=i.slice(s,l+1),h=DA(m),r+=e(s,r.length,h,m,NA(m)),n=l+1,s=!1;continue;}if(u==='"'||u==="'")for(var y=1,T=i.charAt(l-y);T.trim()===""||T==="=";){if(T==="="){c=u;continue t;}T=i.charAt(l-++y);}}else if(u===c){c=!1;continue;}}return n<f&&(r+=t(i.substr(n))),r;}var WA=/[^a-zA-Z0-9\\_:.-]/gim;function FA(i,e){var t=0,r=0,n=[],s=!1,c=i.length;function l(y,T){if(y=wn.trim(y),y=y.replace(WA,"").toLowerCase(),!(y.length<1)){var E=e(y,T||"");E&&n.push(E);}}for(var f=0;f<c;f++){var h=i.charAt(f),m,u;if(s===!1&&h==="="){s=i.slice(t,f),t=f+1,r=i.charAt(t)==='"'||i.charAt(t)==="'"?t:YA(i,f+1);continue;}if(s!==!1&&f===r){if(u=i.indexOf(h,f+1),u===-1)break;m=wn.trim(i.slice(r+1,u)),l(s,m),s=!1,f=u,t=f+1;continue;}if(/\s|\n|\t/.test(h))if(i=i.replace(/\s|\n|\t/g," "),s===!1){if(u=UA(i,f),u===-1){m=wn.trim(i.slice(t,f)),l(m),s=!1,t=f+1;continue;}else{f=u-1;continue;}}else if(u=XA(i,f-1),u===-1){m=wn.trim(i.slice(t,f)),m=Ru(m),l(s,m),s=!1,t=f+1;continue;}else continue;}return t<i.length&&(s===!1?l(i.slice(t)):l(s,Ru(wn.trim(i.slice(t))))),wn.trim(n.join(" "));}function UA(i,e){for(;e<i.length;e++){var t=i[e];if(t!==" ")return t==="="?e:-1;}}function YA(i,e){for(;e<i.length;e++){var t=i[e];if(t!==" ")return t==="'"||t==='"'?e:-1;}}function XA(i,e){for(;e>0;e--){var t=i[e];if(t!==" ")return t==="="?e:-1;}}function zA(i){return i[0]==='"'&&i[i.length-1]==='"'||i[0]==="'"&&i[i.length-1]==="'";}function Ru(i){return zA(i)?i.substr(1,i.length-2):i;}xo.parseTag=BA;xo.parseAttr=FA;var $A=El.FilterCSS,Xr=ke,$h=xo,jA=$h.parseTag,GA=$h.parseAttr,_s=Ml;function Js(i){return i==null;}function HA(i){var e=_s.spaceIndex(i);if(e===-1)return{html:"",closing:i[i.length-2]==="/"};i=_s.trim(i.slice(e+1,-1));var t=i[i.length-1]==="/";return t&&(i=_s.trim(i.slice(0,-1))),{html:i,closing:t};}function kA(i){var e={};for(var t in i)e[t]=i[t];return e;}function KA(i){var e={};for(var t in i)Array.isArray(i[t])?e[t.toLowerCase()]=i[t].map(function(r){return r.toLowerCase();}):e[t.toLowerCase()]=i[t];return e;}function jh(i){i=kA(i||{}),i.stripIgnoreTag&&(i.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),i.onIgnoreTag=Xr.onIgnoreTagStripAll),i.whiteList||i.allowList?i.whiteList=KA(i.whiteList||i.allowList):i.whiteList=Xr.whiteList,this.attributeWrapSign=i.singleQuotedAttributeValue===!0?"'":Xr.attributeWrapSign,i.onTag=i.onTag||Xr.onTag,i.onTagAttr=i.onTagAttr||Xr.onTagAttr,i.onIgnoreTag=i.onIgnoreTag||Xr.onIgnoreTag,i.onIgnoreTagAttr=i.onIgnoreTagAttr||Xr.onIgnoreTagAttr,i.safeAttrValue=i.safeAttrValue||Xr.safeAttrValue,i.escapeHtml=i.escapeHtml||Xr.escapeHtml,this.options=i,i.css===!1?this.cssFilter=!1:(i.css=i.css||{},this.cssFilter=new $A(i.css));}jh.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onTag,s=t.onIgnoreTag,c=t.onTagAttr,l=t.onIgnoreTagAttr,f=t.safeAttrValue,h=t.escapeHtml,m=e.attributeWrapSign,u=e.cssFilter;t.stripBlankChar&&(i=Xr.stripBlankChar(i)),t.allowCommentTag||(i=Xr.stripCommentTag(i));var y=!1;t.stripIgnoreTagBody&&(y=Xr.StripTagBody(t.stripIgnoreTagBody,s),s=y.onIgnoreTag);var T=jA(i,function(E,C,x,I,d){var v={sourcePosition:E,position:C,isClosing:d,isWhite:Object.prototype.hasOwnProperty.call(r,x)},p=n(x,I,v);if(!Js(p))return p;if(v.isWhite){if(v.isClosing)return"</"+x+">";var S=HA(I),A=r[x],R=GA(S.html,function(D,U){var M=_s.indexOf(A,D)!==-1,W=c(x,D,U,M);return Js(W)?M?(U=f(x,D,U,u),U?D+"="+m+U+m:D):(W=l(x,D,U,M),Js(W)?void 0:W):W;});return I="<"+x,R&&(I+=" "+R),S.closing&&(I+=" /"),I+=">",I;}else return p=s(x,I,v),Js(p)?h(I):p;},h);return y&&(T=y.remove(T)),T;};var VA=jh;(function(i,e){var t=ke,r=xo,n=VA;function s(l,f){var h=new n(f);return h.process(l);}e=i.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var l in t)e[l]=t[l];for(var f in r)e[f]=r[f];}(),(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterXSS=i.exports);function c(){return(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&(typeof DedicatedWorkerGlobalScope==="undefined"?"undefined":_typeof(DedicatedWorkerGlobalScope))<"u"&&self instanceof DedicatedWorkerGlobalScope;}c()&&(self.filterXSS=i.exports);})(Au,Au.exports);var ao={exports:{}};/**
437
+ * @license
438
+ * Lodash <https://lodash.com/>
439
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
440
+ * Released under MIT license <https://lodash.com/license>
441
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
442
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
443
+ */ao.exports;(function(i,e){(function(){var t,r="4.17.21",n=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",u=1,y=2,T=4,E=1,C=2,x=1,I=2,d=4,v=8,p=16,S=32,A=64,R=128,D=256,U=512,M=30,W="...",Y=800,B=16,N=1,G=2,J=3,tt=1/0,at=9007199254740991,ut=17976931348623157e292,K=NaN,Q=4294967295,ft=Q-1,gt=Q>>>1,mt=[["ary",R],["bind",x],["bindKey",I],["curry",v],["curryRight",p],["flip",U],["partial",S],["partialRight",A],["rearg",D]],wt="[object Arguments]",ht="[object Array]",Nt="[object AsyncFunction]",Rt="[object Boolean]",X="[object Date]",z="[object DOMException]",q="[object Error]",nt="[object Function]",j="[object GeneratorFunction]",Z="[object Map]",O="[object Number]",L="[object Null]",$="[object Object]",V="[object Promise]",rt="[object Proxy]",it="[object RegExp]",ct="[object Set]",St="[object String]",Ct="[object Symbol]",Mt="[object Undefined]",Dt="[object WeakMap]",At="[object WeakSet]",Ot="[object ArrayBuffer]",Lt="[object DataView]",Yt="[object Float32Array]",zt="[object Float64Array]",Wt="[object Int8Array]",Qt="[object Int16Array]",ue="[object Int32Array]",ie="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",se="[object Uint32Array]",je=/\b__p \+= '';/g,We=/\b(__p \+=) '' \+/g,Xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fe=/&(?:amp|lt|gt|quot|#39);/g,Ge=/[&<>"']/g,Ke=RegExp(Fe.source),Je=RegExp(Ge.source),Ie=/<%-([\s\S]+?)%>/g,cr=/<%([\s\S]+?)%>/g,Kr=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gn=/^\w*$/,Hn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oi=/[\\^$.*+?()[\]{}|]/g,Co=RegExp(Oi.source),wi=/^\s+/,Io=/\s/,Oo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,wo=/\{\n\/\* \[wrapped with (.+)\] \*/,Ao=/,? & /,Eo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mo=/[()=,{}\[\]\/\s]/,Lo=/\\(\\)?/g,Ro=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_i=/\w*$/,Rn=/^[-+]0x[0-9a-f]+$/i,ts=/^0b[01]+$/i,bo=/^\[object .+?Constructor\]$/,Do=/^0o[0-7]+$/i,No=/^(?:0|[1-9]\d*)$/,Bo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kn=/($^)/,vn=/['\n\r\u2028\u2029\\]/g,Kn="\\ud800-\\udfff",Wo="\\u0300-\\u036f",Fo="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",es=Wo+Fo+Uo,rs="\\u2700-\\u27bf",ns="a-z\\xdf-\\xf6\\xf8-\\xff",Yo="\\xac\\xb1\\xd7\\xf7",Xo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nr="\\u2000-\\u206f",zo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",is="A-Z\\xc0-\\xd6\\xd8-\\xde",ss="\\ufe0e\\ufe0f",ge=Yo+Xo+nr+zo,Vn="['’]",$o="["+Kn+"]",os="["+ge+"]",Zn="["+es+"]",as="\\d+",a="["+rs+"]",P="["+ns+"]",w="[^"+Kn+ge+as+rs+ns+is+"]",F="\\ud83c[\\udffb-\\udfff]",H="(?:"+Zn+"|"+F+")",_="[^"+Kn+"]",st="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+is+"]",Bt="\\u200d",kt="(?:"+P+"|"+w+")",jt="(?:"+Pt+"|"+w+")",qt="(?:"+Vn+"(?:d|ll|m|re|s|t|ve))?",oe="(?:"+Vn+"(?:D|LL|M|RE|S|T|VE))?",me=H+"?",Pe="["+ss+"]?",De="(?:"+Bt+"(?:"+[_,st,yt].join("|")+")"+Pe+me+")*",or="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",en=Pe+me+De,jo="(?:"+[a,st,yt].join("|")+")"+en,Go="(?:"+[_+Zn+"?",Zn,st,yt,$o].join("|")+")",gn=RegExp(Vn,"g"),od=RegExp(Zn,"g"),Ho=RegExp(F+"(?="+F+")|"+Go+en,"g"),ad=RegExp([Pt+"?"+P+"+"+qt+"(?="+[os,Pt,"$"].join("|")+")",jt+"+"+oe+"(?="+[os,Pt+kt,"$"].join("|")+")",Pt+"?"+kt+"+"+qt,Pt+"+"+oe,Rr,or,as,jo].join("|"),"g"),ld=RegExp("["+Bt+Kn+es+ss+"]"),fd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ud=-1,ze={};ze[Yt]=ze[zt]=ze[Wt]=ze[Qt]=ze[ue]=ze[ie]=ze[ne]=ze[ae]=ze[se]=!0,ze[wt]=ze[ht]=ze[Ot]=ze[Rt]=ze[Lt]=ze[X]=ze[q]=ze[nt]=ze[Z]=ze[O]=ze[$]=ze[it]=ze[ct]=ze[St]=ze[Dt]=!1;var Ue={};Ue[wt]=Ue[ht]=Ue[Ot]=Ue[Lt]=Ue[Rt]=Ue[X]=Ue[Yt]=Ue[zt]=Ue[Wt]=Ue[Qt]=Ue[ue]=Ue[Z]=Ue[O]=Ue[$]=Ue[it]=Ue[ct]=Ue[St]=Ue[Ct]=Ue[ie]=Ue[ne]=Ue[ae]=Ue[se]=!0,Ue[q]=Ue[nt]=Ue[Dt]=!1;var hd={// Latin-1 Supplement block.
444
+ À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",// Latin Extended-A block.
445
+ Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},dd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pd={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},vd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},gd=parseFloat,md=parseInt,Dl=_typeof(hn)=="object"&&hn&&hn.Object===Object&&hn,yd=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ir=Dl||yd||Function("return this")(),ko=e&&!e.nodeType&&e,bn=ko&&!0&&i&&!i.nodeType&&i,Nl=bn&&bn.exports===ko,Ko=Nl&&Dl.process,br=function(){try{var Et=bn&&bn.require&&bn.require("util").types;return Et||Ko&&Ko.binding&&Ko.binding("util");}catch(_unused24){}}(),Bl=br&&br.isArrayBuffer,Wl=br&&br.isDate,Fl=br&&br.isMap,Ul=br&&br.isRegExp,Yl=br&&br.isSet,Xl=br&&br.isTypedArray;function Cr(Et,Xt,Ft){switch(Ft.length){case 0:return Et.call(Xt);case 1:return Et.call(Xt,Ft[0]);case 2:return Et.call(Xt,Ft[0],Ft[1]);case 3:return Et.call(Xt,Ft[0],Ft[1],Ft[2]);}return Et.apply(Xt,Ft);}function Pd(Et,Xt,Ft,ee){for(var de=-1,Ee=Et==null?0:Et.length;++de<Ee;){var _e=Et[de];Xt(ee,_e,Ft(_e),Et);}return ee;}function Dr(Et,Xt){for(var Ft=-1,ee=Et==null?0:Et.length;++Ft<ee&&Xt(Et[Ft],Ft,Et)!==!1;);return Et;}function Sd(Et,Xt){for(var Ft=Et==null?0:Et.length;Ft--&&Xt(Et[Ft],Ft,Et)!==!1;);return Et;}function zl(Et,Xt){for(var Ft=-1,ee=Et==null?0:Et.length;++Ft<ee;)if(!Xt(Et[Ft],Ft,Et))return!1;return!0;}function mn(Et,Xt){for(var Ft=-1,ee=Et==null?0:Et.length,de=0,Ee=[];++Ft<ee;){var _e=Et[Ft];Xt(_e,Ft,Et)&&(Ee[de++]=_e);}return Ee;}function ls(Et,Xt){var Ft=Et==null?0:Et.length;return!!Ft&&Jn(Et,Xt,0)>-1;}function Vo(Et,Xt,Ft){for(var ee=-1,de=Et==null?0:Et.length;++ee<de;)if(Ft(Xt,Et[ee]))return!0;return!1;}function He(Et,Xt){for(var Ft=-1,ee=Et==null?0:Et.length,de=Array(ee);++Ft<ee;)de[Ft]=Xt(Et[Ft],Ft,Et);return de;}function yn(Et,Xt){for(var Ft=-1,ee=Xt.length,de=Et.length;++Ft<ee;)Et[de+Ft]=Xt[Ft];return Et;}function Zo(Et,Xt,Ft,ee){var de=-1,Ee=Et==null?0:Et.length;for(ee&&Ee&&(Ft=Et[++de]);++de<Ee;)Ft=Xt(Ft,Et[de],de,Et);return Ft;}function xd(Et,Xt,Ft,ee){var de=Et==null?0:Et.length;for(ee&&de&&(Ft=Et[--de]);de--;)Ft=Xt(Ft,Et[de],de,Et);return Ft;}function Jo(Et,Xt){for(var Ft=-1,ee=Et==null?0:Et.length;++Ft<ee;)if(Xt(Et[Ft],Ft,Et))return!0;return!1;}var Td=Qo("length");function Cd(Et){return Et.split("");}function Id(Et){return Et.match(Eo)||[];}function $l(Et,Xt,Ft){var ee;return Ft(Et,function(de,Ee,_e){if(Xt(de,Ee,_e))return ee=Ee,!1;}),ee;}function fs(Et,Xt,Ft,ee){for(var de=Et.length,Ee=Ft+(ee?1:-1);ee?Ee--:++Ee<de;)if(Xt(Et[Ee],Ee,Et))return Ee;return-1;}function Jn(Et,Xt,Ft){return Xt===Xt?Wd(Et,Xt,Ft):fs(Et,jl,Ft);}function Od(Et,Xt,Ft,ee){for(var de=Ft-1,Ee=Et.length;++de<Ee;)if(ee(Et[de],Xt))return de;return-1;}function jl(Et){return Et!==Et;}function Gl(Et,Xt){var Ft=Et==null?0:Et.length;return Ft?_o(Et,Xt)/Ft:K;}function Qo(Et){return function(Xt){return Xt==null?t:Xt[Et];};}function qo(Et){return function(Xt){return Et==null?t:Et[Xt];};}function Hl(Et,Xt,Ft,ee,de){return de(Et,function(Ee,_e,Be){Ft=ee?(ee=!1,Ee):Xt(Ft,Ee,_e,Be);}),Ft;}function wd(Et,Xt){var Ft=Et.length;for(Et.sort(Xt);Ft--;)Et[Ft]=Et[Ft].value;return Et;}function _o(Et,Xt){for(var Ft,ee=-1,de=Et.length;++ee<de;){var Ee=Xt(Et[ee]);Ee!==t&&(Ft=Ft===t?Ee:Ft+Ee);}return Ft;}function ta(Et,Xt){for(var Ft=-1,ee=Array(Et);++Ft<Et;)ee[Ft]=Xt(Ft);return ee;}function Ad(Et,Xt){return He(Xt,function(Ft){return[Ft,Et[Ft]];});}function kl(Et){return Et&&Et.slice(0,Jl(Et)+1).replace(wi,"");}function Ir(Et){return function(Xt){return Et(Xt);};}function ea(Et,Xt){return He(Xt,function(Ft){return Et[Ft];});}function Ai(Et,Xt){return Et.has(Xt);}function Kl(Et,Xt){for(var Ft=-1,ee=Et.length;++Ft<ee&&Jn(Xt,Et[Ft],0)>-1;);return Ft;}function Vl(Et,Xt){for(var Ft=Et.length;Ft--&&Jn(Xt,Et[Ft],0)>-1;);return Ft;}function Ed(Et,Xt){for(var Ft=Et.length,ee=0;Ft--;)Et[Ft]===Xt&&++ee;return ee;}var Md=qo(hd),Ld=qo(dd);function Rd(Et){return"\\"+vd[Et];}function bd(Et,Xt){return Et==null?t:Et[Xt];}function Qn(Et){return ld.test(Et);}function Dd(Et){return fd.test(Et);}function Nd(Et){for(var Xt,Ft=[];!(Xt=Et.next()).done;)Ft.push(Xt.value);return Ft;}function ra(Et){var Xt=-1,Ft=Array(Et.size);return Et.forEach(function(ee,de){Ft[++Xt]=[de,ee];}),Ft;}function Zl(Et,Xt){return function(Ft){return Et(Xt(Ft));};}function Pn(Et,Xt){for(var Ft=-1,ee=Et.length,de=0,Ee=[];++Ft<ee;){var _e=Et[Ft];(_e===Xt||_e===m)&&(Et[Ft]=m,Ee[de++]=Ft);}return Ee;}function cs(Et){var Xt=-1,Ft=Array(Et.size);return Et.forEach(function(ee){Ft[++Xt]=ee;}),Ft;}function Bd(Et){var Xt=-1,Ft=Array(Et.size);return Et.forEach(function(ee){Ft[++Xt]=[ee,ee];}),Ft;}function Wd(Et,Xt,Ft){for(var ee=Ft-1,de=Et.length;++ee<de;)if(Et[ee]===Xt)return ee;return-1;}function Fd(Et,Xt,Ft){for(var ee=Ft+1;ee--;)if(Et[ee]===Xt)return ee;return ee;}function qn(Et){return Qn(Et)?Yd(Et):Td(Et);}function zr(Et){return Qn(Et)?Xd(Et):Cd(Et);}function Jl(Et){for(var Xt=Et.length;Xt--&&Io.test(Et.charAt(Xt)););return Xt;}var Ud=qo(pd);function Yd(Et){for(var Xt=Ho.lastIndex=0;Ho.test(Et);)++Xt;return Xt;}function Xd(Et){return Et.match(Ho)||[];}function zd(Et){return Et.match(ad)||[];}var $d=function Et(Xt){Xt=Xt==null?ir:_n.defaults(ir.Object(),Xt,_n.pick(ir,cd));var Ft=Xt.Array,ee=Xt.Date,de=Xt.Error,Ee=Xt.Function,_e=Xt.Math,Be=Xt.Object,na=Xt.RegExp,jd=Xt.String,Nr=Xt.TypeError,us=Ft.prototype,Gd=Ee.prototype,ti=Be.prototype,hs=Xt["__core-js_shared__"],ds=Gd.toString,Ne=ti.hasOwnProperty,Hd=0,Ql=function(){var o=/[^.]+$/.exec(hs&&hs.keys&&hs.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:"";}(),ps=ti.toString,kd=ds.call(Be),Kd=ir._,Vd=na("^"+ds.call(Ne).replace(Oi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vs=Nl?Xt.Buffer:t,Sn=Xt.Symbol,gs=Xt.Uint8Array,ql=vs?vs.allocUnsafe:t,ms=Zl(Be.getPrototypeOf,Be),_l=Be.create,tf=ti.propertyIsEnumerable,ys=us.splice,ef=Sn?Sn.isConcatSpreadable:t,Ei=Sn?Sn.iterator:t,Dn=Sn?Sn.toStringTag:t,Ps=function(){try{var o=Un(Be,"defineProperty");return o({},"",{}),o;}catch(_unused25){}}(),Zd=Xt.clearTimeout!==ir.clearTimeout&&Xt.clearTimeout,Jd=ee&&ee.now!==ir.Date.now&&ee.now,Qd=Xt.setTimeout!==ir.setTimeout&&Xt.setTimeout,Ss=_e.ceil,xs=_e.floor,ia=Be.getOwnPropertySymbols,qd=vs?vs.isBuffer:t,rf=Xt.isFinite,_d=us.join,tp=Zl(Be.keys,Be),tr=_e.max,ar=_e.min,ep=ee.now,rp=Xt.parseInt,nf=_e.random,np=us.reverse,sa=Un(Xt,"DataView"),Mi=Un(Xt,"Map"),oa=Un(Xt,"Promise"),ei=Un(Xt,"Set"),Li=Un(Xt,"WeakMap"),Ri=Un(Be,"create"),Ts=Li&&new Li(),ri={},ip=Yn(sa),sp=Yn(Mi),op=Yn(oa),ap=Yn(ei),lp=Yn(Li),Cs=Sn?Sn.prototype:t,bi=Cs?Cs.valueOf:t,sf=Cs?Cs.toString:t;function ot(o){if(Ze(o)&&!pe(o)&&!(o instanceof Ce)){if(o instanceof Br)return o;if(Ne.call(o,"__wrapped__"))return oc(o);}return new Br(o);}var ni=/* @__PURE__ */function(){function o(){}return function(g){if(!Ve(g))return{};if(_l)return _l(g);o.prototype=g;var b=new o();return o.prototype=t,b;};}();function Is(){}function Br(o,g){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=t;}ot.templateSettings={/**
446
+ * Used to detect `data` property values to be HTML-escaped.
447
+ *
448
+ * @memberOf _.templateSettings
449
+ * @type {RegExp}
450
+ */escape:Ie,/**
451
+ * Used to detect code to be evaluated.
452
+ *
453
+ * @memberOf _.templateSettings
454
+ * @type {RegExp}
455
+ */evaluate:cr,/**
456
+ * Used to detect `data` property values to inject.
457
+ *
458
+ * @memberOf _.templateSettings
459
+ * @type {RegExp}
460
+ */interpolate:Kr,/**
461
+ * Used to reference the data object in the template text.
462
+ *
463
+ * @memberOf _.templateSettings
464
+ * @type {string}
465
+ */variable:"",/**
466
+ * Used to import variables into the compiled template.
467
+ *
468
+ * @memberOf _.templateSettings
469
+ * @type {Object}
470
+ */imports:{/**
471
+ * A reference to the `lodash` function.
472
+ *
473
+ * @memberOf _.templateSettings.imports
474
+ * @type {Function}
475
+ */_:ot}},ot.prototype=Is.prototype,ot.prototype.constructor=ot,Br.prototype=ni(Is.prototype),Br.prototype.constructor=Br;function Ce(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Q,this.__views__=[];}function fp(){var o=new Ce(this.__wrapped__);return o.__actions__=yr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=yr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=yr(this.__views__),o;}function cp(){if(this.__filtered__){var o=new Ce(this);o.__dir__=-1,o.__filtered__=!0;}else o=this.clone(),o.__dir__*=-1;return o;}function up(){var o=this.__wrapped__.value(),g=this.__dir__,b=pe(o),k=g<0,et=b?o.length:0,lt=C0(0,et,this.__views__),vt=lt.start,It=lt.end,bt=It-vt,Gt=k?It:vt-1,Ht=this.__iteratees__,Kt=Ht.length,_t=0,re=ar(bt,this.__takeCount__);if(!b||!k&&et==bt&&re==bt)return Mf(o,this.__actions__);var fe=[];t:for(;bt--&&_t<re;){Gt+=g;for(var Se=-1,ce=o[Gt];++Se<Kt;){var Te=Ht[Se],Oe=Te.iteratee,Ar=Te.type,dr=Oe(ce);if(Ar==G)ce=dr;else if(!dr){if(Ar==N)continue t;break t;}}fe[_t++]=ce;}return fe;}Ce.prototype=ni(Is.prototype),Ce.prototype.constructor=Ce;function Nn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var k=o[g];this.set(k[0],k[1]);}}function hp(){this.__data__=Ri?Ri(null):{},this.size=0;}function dp(o){var g=this.has(o)&&delete this.__data__[o];return this.size-=g?1:0,g;}function pp(o){var g=this.__data__;if(Ri){var b=g[o];return b===f?t:b;}return Ne.call(g,o)?g[o]:t;}function vp(o){var g=this.__data__;return Ri?g[o]!==t:Ne.call(g,o);}function gp(o,g){var b=this.__data__;return this.size+=this.has(o)?0:1,b[o]=Ri&&g===t?f:g,this;}Nn.prototype.clear=hp,Nn.prototype["delete"]=dp,Nn.prototype.get=pp,Nn.prototype.has=vp,Nn.prototype.set=gp;function rn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var k=o[g];this.set(k[0],k[1]);}}function mp(){this.__data__=[],this.size=0;}function yp(o){var g=this.__data__,b=Os(g,o);if(b<0)return!1;var k=g.length-1;return b==k?g.pop():ys.call(g,b,1),--this.size,!0;}function Pp(o){var g=this.__data__,b=Os(g,o);return b<0?t:g[b][1];}function Sp(o){return Os(this.__data__,o)>-1;}function xp(o,g){var b=this.__data__,k=Os(b,o);return k<0?(++this.size,b.push([o,g])):b[k][1]=g,this;}rn.prototype.clear=mp,rn.prototype["delete"]=yp,rn.prototype.get=Pp,rn.prototype.has=Sp,rn.prototype.set=xp;function nn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var k=o[g];this.set(k[0],k[1]);}}function Tp(){this.size=0,this.__data__={hash:new Nn(),map:new(Mi||rn)(),string:new Nn()};}function Cp(o){var g=Fs(this,o)["delete"](o);return this.size-=g?1:0,g;}function Ip(o){return Fs(this,o).get(o);}function Op(o){return Fs(this,o).has(o);}function wp(o,g){var b=Fs(this,o),k=b.size;return b.set(o,g),this.size+=b.size==k?0:1,this;}nn.prototype.clear=Tp,nn.prototype["delete"]=Cp,nn.prototype.get=Ip,nn.prototype.has=Op,nn.prototype.set=wp;function Bn(o){var g=-1,b=o==null?0:o.length;for(this.__data__=new nn();++g<b;)this.add(o[g]);}function Ap(o){return this.__data__.set(o,f),this;}function Ep(o){return this.__data__.has(o);}Bn.prototype.add=Bn.prototype.push=Ap,Bn.prototype.has=Ep;function $r(o){var g=this.__data__=new rn(o);this.size=g.size;}function Mp(){this.__data__=new rn(),this.size=0;}function Lp(o){var g=this.__data__,b=g["delete"](o);return this.size=g.size,b;}function Rp(o){return this.__data__.get(o);}function bp(o){return this.__data__.has(o);}function Dp(o,g){var b=this.__data__;if(b instanceof rn){var k=b.__data__;if(!Mi||k.length<n-1)return k.push([o,g]),this.size=++b.size,this;b=this.__data__=new nn(k);}return b.set(o,g),this.size=b.size,this;}$r.prototype.clear=Mp,$r.prototype["delete"]=Lp,$r.prototype.get=Rp,$r.prototype.has=bp,$r.prototype.set=Dp;function of(o,g){var b=pe(o),k=!b&&Xn(o),et=!b&&!k&&On(o),lt=!b&&!k&&!et&&ai(o),vt=b||k||et||lt,It=vt?ta(o.length,jd):[],bt=It.length;for(var Gt in o)(g||Ne.call(o,Gt))&&!(vt&&(// Safari 9 has enumerable `arguments.length` in strict mode.
476
+ Gt=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
477
+ et&&(Gt=="offset"||Gt=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
478
+ lt&&(Gt=="buffer"||Gt=="byteLength"||Gt=="byteOffset")||// Skip index properties.
479
+ ln(Gt,bt)))&&It.push(Gt);return It;}function af(o){var g=o.length;return g?o[ma(0,g-1)]:t;}function Np(o,g){return Us(yr(o),Wn(g,0,o.length));}function Bp(o){return Us(yr(o));}function aa(o,g,b){(b!==t&&!jr(o[g],b)||b===t&&!(g in o))&&sn(o,g,b);}function Di(o,g,b){var k=o[g];(!(Ne.call(o,g)&&jr(k,b))||b===t&&!(g in o))&&sn(o,g,b);}function Os(o,g){for(var b=o.length;b--;)if(jr(o[b][0],g))return b;return-1;}function Wp(o,g,b,k){return xn(o,function(et,lt,vt){g(k,et,b(et),vt);}),k;}function lf(o,g){return o&&Zr(g,rr(g),o);}function Fp(o,g){return o&&Zr(g,Sr(g),o);}function sn(o,g,b){g=="__proto__"&&Ps?Ps(o,g,{configurable:!0,enumerable:!0,value:b,writable:!0}):o[g]=b;}function la(o,g){for(var b=-1,k=g.length,et=Ft(k),lt=o==null;++b<k;)et[b]=lt?t:$a(o,g[b]);return et;}function Wn(o,g,b){return o===o&&(b!==t&&(o=o<=b?o:b),g!==t&&(o=o>=g?o:g)),o;}function Wr(o,g,b,k,et,lt){var vt,It=g&u,bt=g&y,Gt=g&T;if(b&&(vt=et?b(o,k,et,lt):b(o)),vt!==t)return vt;if(!Ve(o))return o;var Ht=pe(o);if(Ht){if(vt=O0(o),!It)return yr(o,vt);}else{var Kt=lr(o),_t=Kt==nt||Kt==j;if(On(o))return bf(o,It);if(Kt==$||Kt==wt||_t&&!et){if(vt=bt||_t?{}:Qf(o),!It)return bt?p0(o,Fp(vt,o)):d0(o,lf(vt,o));}else{if(!Ue[Kt])return et?o:{};vt=w0(o,Kt,It);}}lt||(lt=new $r());var re=lt.get(o);if(re)return re;lt.set(o,vt),wc(o)?o.forEach(function(ce){vt.add(Wr(ce,g,b,ce,o,lt));}):Ic(o)&&o.forEach(function(ce,Te){vt.set(Te,Wr(ce,g,b,Te,o,lt));});var fe=Gt?bt?Ea:Aa:bt?Sr:rr,Se=Ht?t:fe(o);return Dr(Se||o,function(ce,Te){Se&&(Te=ce,ce=o[Te]),Di(vt,Te,Wr(ce,g,b,Te,o,lt));}),vt;}function Up(o){var g=rr(o);return function(b){return ff(b,o,g);};}function ff(o,g,b){var k=b.length;if(o==null)return!k;for(o=Be(o);k--;){var et=b[k],lt=g[et],vt=o[et];if(vt===t&&!(et in o)||!lt(vt))return!1;}return!0;}function cf(o,g,b){if(typeof o!="function")throw new Nr(c);return Xi(function(){o.apply(t,b);},g);}function Ni(o,g,b,k){var et=-1,lt=ls,vt=!0,It=o.length,bt=[],Gt=g.length;if(!It)return bt;b&&(g=He(g,Ir(b))),k?(lt=Vo,vt=!1):g.length>=n&&(lt=Ai,vt=!1,g=new Bn(g));t:for(;++et<It;){var Ht=o[et],Kt=b==null?Ht:b(Ht);if(Ht=k||Ht!==0?Ht:0,vt&&Kt===Kt){for(var _t=Gt;_t--;)if(g[_t]===Kt)continue t;bt.push(Ht);}else lt(g,Kt,k)||bt.push(Ht);}return bt;}var xn=Ff(Vr),uf=Ff(ca,!0);function Yp(o,g){var b=!0;return xn(o,function(k,et,lt){return b=!!g(k,et,lt),b;}),b;}function ws(o,g,b){for(var k=-1,et=o.length;++k<et;){var lt=o[k],vt=g(lt);if(vt!=null&&(It===t?vt===vt&&!wr(vt):b(vt,It)))var It=vt,bt=lt;}return bt;}function Xp(o,g,b,k){var et=o.length;for(b=ye(b),b<0&&(b=-b>et?0:et+b),k=k===t||k>et?et:ye(k),k<0&&(k+=et),k=b>k?0:Ec(k);b<k;)o[b++]=g;return o;}function hf(o,g){var b=[];return xn(o,function(k,et,lt){g(k,et,lt)&&b.push(k);}),b;}function sr(o,g,b,k,et){var lt=-1,vt=o.length;for(b||(b=E0),et||(et=[]);++lt<vt;){var It=o[lt];g>0&&b(It)?g>1?sr(It,g-1,b,k,et):yn(et,It):k||(et[et.length]=It);}return et;}var fa=Uf(),df=Uf(!0);function Vr(o,g){return o&&fa(o,g,rr);}function ca(o,g){return o&&df(o,g,rr);}function As(o,g){return mn(g,function(b){return fn(o[b]);});}function Fn(o,g){g=Cn(g,o);for(var b=0,k=g.length;o!=null&&b<k;)o=o[Jr(g[b++])];return b&&b==k?o:t;}function pf(o,g,b){var k=g(o);return pe(o)?k:yn(k,b(o));}function ur(o){return o==null?o===t?Mt:L:Dn&&Dn in Be(o)?T0(o):B0(o);}function ua(o,g){return o>g;}function zp(o,g){return o!=null&&Ne.call(o,g);}function $p(o,g){return o!=null&&g in Be(o);}function jp(o,g,b){return o>=ar(g,b)&&o<tr(g,b);}function ha(o,g,b){for(var k=b?Vo:ls,et=o[0].length,lt=o.length,vt=lt,It=Ft(lt),bt=1/0,Gt=[];vt--;){var Ht=o[vt];vt&&g&&(Ht=He(Ht,Ir(g))),bt=ar(Ht.length,bt),It[vt]=!b&&(g||et>=120&&Ht.length>=120)?new Bn(vt&&Ht):t;}Ht=o[0];var Kt=-1,_t=It[0];t:for(;++Kt<et&&Gt.length<bt;){var re=Ht[Kt],fe=g?g(re):re;if(re=b||re!==0?re:0,!(_t?Ai(_t,fe):k(Gt,fe,b))){for(vt=lt;--vt;){var Se=It[vt];if(!(Se?Ai(Se,fe):k(o[vt],fe,b)))continue t;}_t&&_t.push(fe),Gt.push(re);}}return Gt;}function Gp(o,g,b,k){return Vr(o,function(et,lt,vt){g(k,b(et),lt,vt);}),k;}function Bi(o,g,b){g=Cn(g,o),o=ec(o,g);var k=o==null?o:o[Jr(Ur(g))];return k==null?t:Cr(k,o,b);}function vf(o){return Ze(o)&&ur(o)==wt;}function Hp(o){return Ze(o)&&ur(o)==Ot;}function kp(o){return Ze(o)&&ur(o)==X;}function Wi(o,g,b,k,et){return o===g?!0:o==null||g==null||!Ze(o)&&!Ze(g)?o!==o&&g!==g:Kp(o,g,b,k,Wi,et);}function Kp(o,g,b,k,et,lt){var vt=pe(o),It=pe(g),bt=vt?ht:lr(o),Gt=It?ht:lr(g);bt=bt==wt?$:bt,Gt=Gt==wt?$:Gt;var Ht=bt==$,Kt=Gt==$,_t=bt==Gt;if(_t&&On(o)){if(!On(g))return!1;vt=!0,Ht=!1;}if(_t&&!Ht)return lt||(lt=new $r()),vt||ai(o)?Vf(o,g,b,k,et,lt):S0(o,g,bt,b,k,et,lt);if(!(b&E)){var re=Ht&&Ne.call(o,"__wrapped__"),fe=Kt&&Ne.call(g,"__wrapped__");if(re||fe){var Se=re?o.value():o,ce=fe?g.value():g;return lt||(lt=new $r()),et(Se,ce,b,k,lt);}}return _t?(lt||(lt=new $r()),x0(o,g,b,k,et,lt)):!1;}function Vp(o){return Ze(o)&&lr(o)==Z;}function da(o,g,b,k){var et=b.length,lt=et,vt=!k;if(o==null)return!lt;for(o=Be(o);et--;){var It=b[et];if(vt&&It[2]?It[1]!==o[It[0]]:!(It[0]in o))return!1;}for(;++et<lt;){It=b[et];var bt=It[0],Gt=o[bt],Ht=It[1];if(vt&&It[2]){if(Gt===t&&!(bt in o))return!1;}else{var Kt=new $r();if(k)var _t=k(Gt,Ht,bt,o,g,Kt);if(!(_t===t?Wi(Ht,Gt,E|C,k,Kt):_t))return!1;}}return!0;}function gf(o){if(!Ve(o)||L0(o))return!1;var g=fn(o)?Vd:bo;return g.test(Yn(o));}function Zp(o){return Ze(o)&&ur(o)==it;}function Jp(o){return Ze(o)&&lr(o)==ct;}function Qp(o){return Ze(o)&&Gs(o.length)&&!!ze[ur(o)];}function mf(o){return typeof o=="function"?o:o==null?xr:_typeof(o)=="object"?pe(o)?Sf(o[0],o[1]):Pf(o):Yc(o);}function pa(o){if(!Yi(o))return tp(o);var g=[];for(var b in Be(o))Ne.call(o,b)&&b!="constructor"&&g.push(b);return g;}function qp(o){if(!Ve(o))return N0(o);var g=Yi(o),b=[];for(var k in o)k=="constructor"&&(g||!Ne.call(o,k))||b.push(k);return b;}function va(o,g){return o<g;}function yf(o,g){var b=-1,k=Pr(o)?Ft(o.length):[];return xn(o,function(et,lt,vt){k[++b]=g(et,lt,vt);}),k;}function Pf(o){var g=La(o);return g.length==1&&g[0][2]?_f(g[0][0],g[0][1]):function(b){return b===o||da(b,o,g);};}function Sf(o,g){return ba(o)&&qf(g)?_f(Jr(o),g):function(b){var k=$a(b,o);return k===t&&k===g?ja(b,o):Wi(g,k,E|C);};}function Es(o,g,b,k,et){o!==g&&fa(g,function(lt,vt){if(et||(et=new $r()),Ve(lt))_p(o,g,vt,b,Es,k,et);else{var It=k?k(Na(o,vt),lt,vt+"",o,g,et):t;It===t&&(It=lt),aa(o,vt,It);}},Sr);}function _p(o,g,b,k,et,lt,vt){var It=Na(o,b),bt=Na(g,b),Gt=vt.get(bt);if(Gt){aa(o,b,Gt);return;}var Ht=lt?lt(It,bt,b+"",o,g,vt):t,Kt=Ht===t;if(Kt){var _t=pe(bt),re=!_t&&On(bt),fe=!_t&&!re&&ai(bt);Ht=bt,_t||re||fe?pe(It)?Ht=It:Qe(It)?Ht=yr(It):re?(Kt=!1,Ht=bf(bt,!0)):fe?(Kt=!1,Ht=Df(bt,!0)):Ht=[]:zi(bt)||Xn(bt)?(Ht=It,Xn(It)?Ht=Mc(It):(!Ve(It)||fn(It))&&(Ht=Qf(bt))):Kt=!1;}Kt&&(vt.set(bt,Ht),et(Ht,bt,k,lt,vt),vt["delete"](bt)),aa(o,b,Ht);}function xf(o,g){var b=o.length;if(b)return g+=g<0?b:0,ln(g,b)?o[g]:t;}function Tf(o,g,b){g.length?g=He(g,function(lt){return pe(lt)?function(vt){return Fn(vt,lt.length===1?lt[0]:lt);}:lt;}):g=[xr];var k=-1;g=He(g,Ir(le()));var et=yf(o,function(lt,vt,It){var bt=He(g,function(Gt){return Gt(lt);});return{criteria:bt,index:++k,value:lt};});return wd(et,function(lt,vt){return h0(lt,vt,b);});}function t0(o,g){return Cf(o,g,function(b,k){return ja(o,k);});}function Cf(o,g,b){for(var k=-1,et=g.length,lt={};++k<et;){var vt=g[k],It=Fn(o,vt);b(It,vt)&&Fi(lt,Cn(vt,o),It);}return lt;}function e0(o){return function(g){return Fn(g,o);};}function ga(o,g,b,k){var et=k?Od:Jn,lt=-1,vt=g.length,It=o;for(o===g&&(g=yr(g)),b&&(It=He(o,Ir(b)));++lt<vt;)for(var bt=0,Gt=g[lt],Ht=b?b(Gt):Gt;(bt=et(It,Ht,bt,k))>-1;)It!==o&&ys.call(It,bt,1),ys.call(o,bt,1);return o;}function If(o,g){for(var b=o?g.length:0,k=b-1;b--;){var et=g[b];if(b==k||et!==lt){var lt=et;ln(et)?ys.call(o,et,1):Sa(o,et);}}return o;}function ma(o,g){return o+xs(nf()*(g-o+1));}function r0(o,g,b,k){for(var et=-1,lt=tr(Ss((g-o)/(b||1)),0),vt=Ft(lt);lt--;)vt[k?lt:++et]=o,o+=b;return vt;}function ya(o,g){var b="";if(!o||g<1||g>at)return b;do g%2&&(b+=o),g=xs(g/2),g&&(o+=o);while(g);return b;}function xe(o,g){return Ba(tc(o,g,xr),o+"");}function n0(o){return af(li(o));}function i0(o,g){var b=li(o);return Us(b,Wn(g,0,b.length));}function Fi(o,g,b,k){if(!Ve(o))return o;g=Cn(g,o);for(var et=-1,lt=g.length,vt=lt-1,It=o;It!=null&&++et<lt;){var bt=Jr(g[et]),Gt=b;if(bt==="__proto__"||bt==="constructor"||bt==="prototype")return o;if(et!=vt){var Ht=It[bt];Gt=k?k(Ht,bt,It):t,Gt===t&&(Gt=Ve(Ht)?Ht:ln(g[et+1])?[]:{});}Di(It,bt,Gt),It=It[bt];}return o;}var Of=Ts?function(o,g){return Ts.set(o,g),o;}:xr,s0=Ps?function(o,g){return Ps(o,"toString",{configurable:!0,enumerable:!1,value:Ha(g),writable:!0});}:xr;function o0(o){return Us(li(o));}function Fr(o,g,b){var k=-1,et=o.length;g<0&&(g=-g>et?0:et+g),b=b>et?et:b,b<0&&(b+=et),et=g>b?0:b-g>>>0,g>>>=0;for(var lt=Ft(et);++k<et;)lt[k]=o[k+g];return lt;}function a0(o,g){var b;return xn(o,function(k,et,lt){return b=g(k,et,lt),!b;}),!!b;}function Ms(o,g,b){var k=0,et=o==null?k:o.length;if(typeof g=="number"&&g===g&&et<=gt){for(;k<et;){var lt=k+et>>>1,vt=o[lt];vt!==null&&!wr(vt)&&(b?vt<=g:vt<g)?k=lt+1:et=lt;}return et;}return Pa(o,g,xr,b);}function Pa(o,g,b,k){var et=0,lt=o==null?0:o.length;if(lt===0)return 0;g=b(g);for(var vt=g!==g,It=g===null,bt=wr(g),Gt=g===t;et<lt;){var Ht=xs((et+lt)/2),Kt=b(o[Ht]),_t=Kt!==t,re=Kt===null,fe=Kt===Kt,Se=wr(Kt);if(vt)var ce=k||fe;else Gt?ce=fe&&(k||_t):It?ce=fe&&_t&&(k||!re):bt?ce=fe&&_t&&!re&&(k||!Se):re||Se?ce=!1:ce=k?Kt<=g:Kt<g;ce?et=Ht+1:lt=Ht;}return ar(lt,ft);}function wf(o,g){for(var b=-1,k=o.length,et=0,lt=[];++b<k;){var vt=o[b],It=g?g(vt):vt;if(!b||!jr(It,bt)){var bt=It;lt[et++]=vt===0?0:vt;}}return lt;}function Af(o){return typeof o=="number"?o:wr(o)?K:+o;}function Or(o){if(typeof o=="string")return o;if(pe(o))return He(o,Or)+"";if(wr(o))return sf?sf.call(o):"";var g=o+"";return g=="0"&&1/o==-tt?"-0":g;}function Tn(o,g,b){var k=-1,et=ls,lt=o.length,vt=!0,It=[],bt=It;if(b)vt=!1,et=Vo;else if(lt>=n){var Gt=g?null:y0(o);if(Gt)return cs(Gt);vt=!1,et=Ai,bt=new Bn();}else bt=g?[]:It;t:for(;++k<lt;){var Ht=o[k],Kt=g?g(Ht):Ht;if(Ht=b||Ht!==0?Ht:0,vt&&Kt===Kt){for(var _t=bt.length;_t--;)if(bt[_t]===Kt)continue t;g&&bt.push(Kt),It.push(Ht);}else et(bt,Kt,b)||(bt!==It&&bt.push(Kt),It.push(Ht));}return It;}function Sa(o,g){return g=Cn(g,o),o=ec(o,g),o==null||delete o[Jr(Ur(g))];}function Ef(o,g,b,k){return Fi(o,g,b(Fn(o,g)),k);}function Ls(o,g,b,k){for(var et=o.length,lt=k?et:-1;(k?lt--:++lt<et)&&g(o[lt],lt,o););return b?Fr(o,k?0:lt,k?lt+1:et):Fr(o,k?lt+1:0,k?et:lt);}function Mf(o,g){var b=o;return b instanceof Ce&&(b=b.value()),Zo(g,function(k,et){return et.func.apply(et.thisArg,yn([k],et.args));},b);}function xa(o,g,b){var k=o.length;if(k<2)return k?Tn(o[0]):[];for(var et=-1,lt=Ft(k);++et<k;)for(var vt=o[et],It=-1;++It<k;)It!=et&&(lt[et]=Ni(lt[et]||vt,o[It],g,b));return Tn(sr(lt,1),g,b);}function Lf(o,g,b){for(var k=-1,et=o.length,lt=g.length,vt={};++k<et;){var It=k<lt?g[k]:t;b(vt,o[k],It);}return vt;}function Ta(o){return Qe(o)?o:[];}function Ca(o){return typeof o=="function"?o:xr;}function Cn(o,g){return pe(o)?o:ba(o,g)?[o]:sc(Le(o));}var l0=xe;function In(o,g,b){var k=o.length;return b=b===t?k:b,!g&&b>=k?o:Fr(o,g,b);}var Rf=Zd||function(o){return ir.clearTimeout(o);};function bf(o,g){if(g)return o.slice();var b=o.length,k=ql?ql(b):new o.constructor(b);return o.copy(k),k;}function Ia(o){var g=new o.constructor(o.byteLength);return new gs(g).set(new gs(o)),g;}function f0(o,g){var b=g?Ia(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.byteLength);}function c0(o){var g=new o.constructor(o.source,_i.exec(o));return g.lastIndex=o.lastIndex,g;}function u0(o){return bi?Be(bi.call(o)):{};}function Df(o,g){var b=g?Ia(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.length);}function Nf(o,g){if(o!==g){var b=o!==t,k=o===null,et=o===o,lt=wr(o),vt=g!==t,It=g===null,bt=g===g,Gt=wr(g);if(!It&&!Gt&&!lt&&o>g||lt&&vt&&bt&&!It&&!Gt||k&&vt&&bt||!b&&bt||!et)return 1;if(!k&&!lt&&!Gt&&o<g||Gt&&b&&et&&!k&&!lt||It&&b&&et||!vt&&et||!bt)return-1;}return 0;}function h0(o,g,b){for(var k=-1,et=o.criteria,lt=g.criteria,vt=et.length,It=b.length;++k<vt;){var bt=Nf(et[k],lt[k]);if(bt){if(k>=It)return bt;var Gt=b[k];return bt*(Gt=="desc"?-1:1);}}return o.index-g.index;}function Bf(o,g,b,k){for(var et=-1,lt=o.length,vt=b.length,It=-1,bt=g.length,Gt=tr(lt-vt,0),Ht=Ft(bt+Gt),Kt=!k;++It<bt;)Ht[It]=g[It];for(;++et<vt;)(Kt||et<lt)&&(Ht[b[et]]=o[et]);for(;Gt--;)Ht[It++]=o[et++];return Ht;}function Wf(o,g,b,k){for(var et=-1,lt=o.length,vt=-1,It=b.length,bt=-1,Gt=g.length,Ht=tr(lt-It,0),Kt=Ft(Ht+Gt),_t=!k;++et<Ht;)Kt[et]=o[et];for(var re=et;++bt<Gt;)Kt[re+bt]=g[bt];for(;++vt<It;)(_t||et<lt)&&(Kt[re+b[vt]]=o[et++]);return Kt;}function yr(o,g){var b=-1,k=o.length;for(g||(g=Ft(k));++b<k;)g[b]=o[b];return g;}function Zr(o,g,b,k){var et=!b;b||(b={});for(var lt=-1,vt=g.length;++lt<vt;){var It=g[lt],bt=k?k(b[It],o[It],It,b,o):t;bt===t&&(bt=o[It]),et?sn(b,It,bt):Di(b,It,bt);}return b;}function d0(o,g){return Zr(o,Ra(o),g);}function p0(o,g){return Zr(o,Zf(o),g);}function Rs(o,g){return function(b,k){var et=pe(b)?Pd:Wp,lt=g?g():{};return et(b,o,le(k,2),lt);};}function ii(o){return xe(function(g,b){var k=-1,et=b.length,lt=et>1?b[et-1]:t,vt=et>2?b[2]:t;for(lt=o.length>3&&typeof lt=="function"?(et--,lt):t,vt&&hr(b[0],b[1],vt)&&(lt=et<3?t:lt,et=1),g=Be(g);++k<et;){var It=b[k];It&&o(g,It,k,lt);}return g;});}function Ff(o,g){return function(b,k){if(b==null)return b;if(!Pr(b))return o(b,k);for(var et=b.length,lt=g?et:-1,vt=Be(b);(g?lt--:++lt<et)&&k(vt[lt],lt,vt)!==!1;);return b;};}function Uf(o){return function(g,b,k){for(var et=-1,lt=Be(g),vt=k(g),It=vt.length;It--;){var bt=vt[o?It:++et];if(b(lt[bt],bt,lt)===!1)break;}return g;};}function v0(o,g,b){var k=g&x,et=Ui(o);function lt(){var vt=this&&this!==ir&&this instanceof lt?et:o;return vt.apply(k?b:this,arguments);}return lt;}function Yf(o){return function(g){g=Le(g);var b=Qn(g)?zr(g):t,k=b?b[0]:g.charAt(0),et=b?In(b,1).join(""):g.slice(1);return k[o]()+et;};}function si(o){return function(g){return Zo(Fc(Wc(g).replace(gn,"")),o,"");};}function Ui(o){return function(){var g=arguments;switch(g.length){case 0:return new o();case 1:return new o(g[0]);case 2:return new o(g[0],g[1]);case 3:return new o(g[0],g[1],g[2]);case 4:return new o(g[0],g[1],g[2],g[3]);case 5:return new o(g[0],g[1],g[2],g[3],g[4]);case 6:return new o(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new o(g[0],g[1],g[2],g[3],g[4],g[5],g[6]);}var b=ni(o.prototype),k=o.apply(b,g);return Ve(k)?k:b;};}function g0(o,g,b){var k=Ui(o);function et(){for(var lt=arguments.length,vt=Ft(lt),It=lt,bt=oi(et);It--;)vt[It]=arguments[It];var Gt=lt<3&&vt[0]!==bt&&vt[lt-1]!==bt?[]:Pn(vt,bt);if(lt-=Gt.length,lt<b)return Gf(o,g,bs,et.placeholder,t,vt,Gt,t,t,b-lt);var Ht=this&&this!==ir&&this instanceof et?k:o;return Cr(Ht,this,vt);}return et;}function Xf(o){return function(g,b,k){var et=Be(g);if(!Pr(g)){var lt=le(b,3);g=rr(g),b=function b(It){return lt(et[It],It,et);};}var vt=o(g,b,k);return vt>-1?et[lt?g[vt]:vt]:t;};}function zf(o){return an(function(g){var b=g.length,k=b,et=Br.prototype.thru;for(o&&g.reverse();k--;){var lt=g[k];if(typeof lt!="function")throw new Nr(c);if(et&&!vt&&Ws(lt)=="wrapper")var vt=new Br([],!0);}for(k=vt?k:b;++k<b;){lt=g[k];var It=Ws(lt),bt=It=="wrapper"?Ma(lt):t;bt&&Da(bt[0])&&bt[1]==(R|v|S|D)&&!bt[4].length&&bt[9]==1?vt=vt[Ws(bt[0])].apply(vt,bt[3]):vt=lt.length==1&&Da(lt)?vt[It]():vt.thru(lt);}return function(){var Gt=arguments,Ht=Gt[0];if(vt&&Gt.length==1&&pe(Ht))return vt.plant(Ht).value();for(var Kt=0,_t=b?g[Kt].apply(this,Gt):Ht;++Kt<b;)_t=g[Kt].call(this,_t);return _t;};});}function bs(o,g,b,k,et,lt,vt,It,bt,Gt){var Ht=g&R,Kt=g&x,_t=g&I,re=g&(v|p),fe=g&U,Se=_t?t:Ui(o);function ce(){for(var Te=arguments.length,Oe=Ft(Te),Ar=Te;Ar--;)Oe[Ar]=arguments[Ar];if(re)var dr=oi(ce),Er=Ed(Oe,dr);if(k&&(Oe=Bf(Oe,k,et,re)),lt&&(Oe=Wf(Oe,lt,vt,re)),Te-=Er,re&&Te<Gt){var qe=Pn(Oe,dr);return Gf(o,g,bs,ce.placeholder,b,Oe,qe,It,bt,Gt-Te);}var Gr=Kt?b:this,un=_t?Gr[o]:o;return Te=Oe.length,It?Oe=W0(Oe,It):fe&&Te>1&&Oe.reverse(),Ht&&bt<Te&&(Oe.length=bt),this&&this!==ir&&this instanceof ce&&(un=Se||Ui(un)),un.apply(Gr,Oe);}return ce;}function $f(o,g){return function(b,k){return Gp(b,o,g(k),{});};}function Ds(o,g){return function(b,k){var et;if(b===t&&k===t)return g;if(b!==t&&(et=b),k!==t){if(et===t)return k;typeof b=="string"||typeof k=="string"?(b=Or(b),k=Or(k)):(b=Af(b),k=Af(k)),et=o(b,k);}return et;};}function Oa(o){return an(function(g){return g=He(g,Ir(le())),xe(function(b){var k=this;return o(g,function(et){return Cr(et,k,b);});});});}function Ns(o,g){g=g===t?" ":Or(g);var b=g.length;if(b<2)return b?ya(g,o):g;var k=ya(g,Ss(o/qn(g)));return Qn(g)?In(zr(k),0,o).join(""):k.slice(0,o);}function m0(o,g,b,k){var et=g&x,lt=Ui(o);function vt(){for(var It=-1,bt=arguments.length,Gt=-1,Ht=k.length,Kt=Ft(Ht+bt),_t=this&&this!==ir&&this instanceof vt?lt:o;++Gt<Ht;)Kt[Gt]=k[Gt];for(;bt--;)Kt[Gt++]=arguments[++It];return Cr(_t,et?b:this,Kt);}return vt;}function jf(o){return function(g,b,k){return k&&typeof k!="number"&&hr(g,b,k)&&(b=k=t),g=cn(g),b===t?(b=g,g=0):b=cn(b),k=k===t?g<b?1:-1:cn(k),r0(g,b,k,o);};}function Bs(o){return function(g,b){return typeof g=="string"&&typeof b=="string"||(g=Yr(g),b=Yr(b)),o(g,b);};}function Gf(o,g,b,k,et,lt,vt,It,bt,Gt){var Ht=g&v,Kt=Ht?vt:t,_t=Ht?t:vt,re=Ht?lt:t,fe=Ht?t:lt;g|=Ht?S:A,g&=~(Ht?A:S),g&d||(g&=~(x|I));var Se=[o,g,et,re,Kt,fe,_t,It,bt,Gt],ce=b.apply(t,Se);return Da(o)&&rc(ce,Se),ce.placeholder=k,nc(ce,o,g);}function wa(o){var g=_e[o];return function(b,k){if(b=Yr(b),k=k==null?0:ar(ye(k),292),k&&rf(b)){var et=(Le(b)+"e").split("e"),lt=g(et[0]+"e"+(+et[1]+k));return et=(Le(lt)+"e").split("e"),+(et[0]+"e"+(+et[1]-k));}return g(b);};}var y0=ei&&1/cs(new ei([,-0]))[1]==tt?function(o){return new ei(o);}:Va;function Hf(o){return function(g){var b=lr(g);return b==Z?ra(g):b==ct?Bd(g):Ad(g,o(g));};}function on(o,g,b,k,et,lt,vt,It){var bt=g&I;if(!bt&&typeof o!="function")throw new Nr(c);var Gt=k?k.length:0;if(Gt||(g&=~(S|A),k=et=t),vt=vt===t?vt:tr(ye(vt),0),It=It===t?It:ye(It),Gt-=et?et.length:0,g&A){var Ht=k,Kt=et;k=et=t;}var _t=bt?t:Ma(o),re=[o,g,b,k,et,Ht,Kt,lt,vt,It];if(_t&&D0(re,_t),o=re[0],g=re[1],b=re[2],k=re[3],et=re[4],It=re[9]=re[9]===t?bt?0:o.length:tr(re[9]-Gt,0),!It&&g&(v|p)&&(g&=~(v|p)),!g||g==x)var fe=v0(o,g,b);else g==v||g==p?fe=g0(o,g,It):(g==S||g==(x|S))&&!et.length?fe=m0(o,g,b,k):fe=bs.apply(t,re);var Se=_t?Of:rc;return nc(Se(fe,re),o,g);}function kf(o,g,b,k){return o===t||jr(o,ti[b])&&!Ne.call(k,b)?g:o;}function Kf(o,g,b,k,et,lt){return Ve(o)&&Ve(g)&&(lt.set(g,o),Es(o,g,t,Kf,lt),lt["delete"](g)),o;}function P0(o){return zi(o)?t:o;}function Vf(o,g,b,k,et,lt){var vt=b&E,It=o.length,bt=g.length;if(It!=bt&&!(vt&&bt>It))return!1;var Gt=lt.get(o),Ht=lt.get(g);if(Gt&&Ht)return Gt==g&&Ht==o;var Kt=-1,_t=!0,re=b&C?new Bn():t;for(lt.set(o,g),lt.set(g,o);++Kt<It;){var fe=o[Kt],Se=g[Kt];if(k)var ce=vt?k(Se,fe,Kt,g,o,lt):k(fe,Se,Kt,o,g,lt);if(ce!==t){if(ce)continue;_t=!1;break;}if(re){if(!Jo(g,function(Te,Oe){if(!Ai(re,Oe)&&(fe===Te||et(fe,Te,b,k,lt)))return re.push(Oe);})){_t=!1;break;}}else if(!(fe===Se||et(fe,Se,b,k,lt))){_t=!1;break;}}return lt["delete"](o),lt["delete"](g),_t;}function S0(o,g,b,k,et,lt,vt){switch(b){case Lt:if(o.byteLength!=g.byteLength||o.byteOffset!=g.byteOffset)return!1;o=o.buffer,g=g.buffer;case Ot:return!(o.byteLength!=g.byteLength||!lt(new gs(o),new gs(g)));case Rt:case X:case O:return jr(+o,+g);case q:return o.name==g.name&&o.message==g.message;case it:case St:return o==g+"";case Z:var It=ra;case ct:var bt=k&E;if(It||(It=cs),o.size!=g.size&&!bt)return!1;var Gt=vt.get(o);if(Gt)return Gt==g;k|=C,vt.set(o,g);var Ht=Vf(It(o),It(g),k,et,lt,vt);return vt["delete"](o),Ht;case Ct:if(bi)return bi.call(o)==bi.call(g);}return!1;}function x0(o,g,b,k,et,lt){var vt=b&E,It=Aa(o),bt=It.length,Gt=Aa(g),Ht=Gt.length;if(bt!=Ht&&!vt)return!1;for(var Kt=bt;Kt--;){var _t=It[Kt];if(!(vt?_t in g:Ne.call(g,_t)))return!1;}var re=lt.get(o),fe=lt.get(g);if(re&&fe)return re==g&&fe==o;var Se=!0;lt.set(o,g),lt.set(g,o);for(var ce=vt;++Kt<bt;){_t=It[Kt];var Te=o[_t],Oe=g[_t];if(k)var Ar=vt?k(Oe,Te,_t,g,o,lt):k(Te,Oe,_t,o,g,lt);if(!(Ar===t?Te===Oe||et(Te,Oe,b,k,lt):Ar)){Se=!1;break;}ce||(ce=_t=="constructor");}if(Se&&!ce){var dr=o.constructor,Er=g.constructor;dr!=Er&&"constructor"in o&&"constructor"in g&&!(typeof dr=="function"&&dr instanceof dr&&typeof Er=="function"&&Er instanceof Er)&&(Se=!1);}return lt["delete"](o),lt["delete"](g),Se;}function an(o){return Ba(tc(o,t,fc),o+"");}function Aa(o){return pf(o,rr,Ra);}function Ea(o){return pf(o,Sr,Zf);}var Ma=Ts?function(o){return Ts.get(o);}:Va;function Ws(o){for(var g=o.name+"",b=ri[g],k=Ne.call(ri,g)?b.length:0;k--;){var et=b[k],lt=et.func;if(lt==null||lt==o)return et.name;}return g;}function oi(o){var g=Ne.call(ot,"placeholder")?ot:o;return g.placeholder;}function le(){var o=ot.iteratee||ka;return o=o===ka?mf:o,arguments.length?o(arguments[0],arguments[1]):o;}function Fs(o,g){var b=o.__data__;return M0(g)?b[typeof g=="string"?"string":"hash"]:b.map;}function La(o){for(var g=rr(o),b=g.length;b--;){var k=g[b],et=o[k];g[b]=[k,et,qf(et)];}return g;}function Un(o,g){var b=bd(o,g);return gf(b)?b:t;}function T0(o){var g=Ne.call(o,Dn),b=o[Dn];try{o[Dn]=t;var k=!0;}catch(_unused26){}var et=ps.call(o);return k&&(g?o[Dn]=b:delete o[Dn]),et;}var Ra=ia?function(o){return o==null?[]:(o=Be(o),mn(ia(o),function(g){return tf.call(o,g);}));}:Za,Zf=ia?function(o){for(var g=[];o;)yn(g,Ra(o)),o=ms(o);return g;}:Za,lr=ur;(sa&&lr(new sa(new ArrayBuffer(1)))!=Lt||Mi&&lr(new Mi())!=Z||oa&&lr(oa.resolve())!=V||ei&&lr(new ei())!=ct||Li&&lr(new Li())!=Dt)&&(lr=function lr(o){var g=ur(o),b=g==$?o.constructor:t,k=b?Yn(b):"";if(k)switch(k){case ip:return Lt;case sp:return Z;case op:return V;case ap:return ct;case lp:return Dt;}return g;});function C0(o,g,b){for(var k=-1,et=b.length;++k<et;){var lt=b[k],vt=lt.size;switch(lt.type){case"drop":o+=vt;break;case"dropRight":g-=vt;break;case"take":g=ar(g,o+vt);break;case"takeRight":o=tr(o,g-vt);break;}}return{start:o,end:g};}function I0(o){var g=o.match(wo);return g?g[1].split(Ao):[];}function Jf(o,g,b){g=Cn(g,o);for(var k=-1,et=g.length,lt=!1;++k<et;){var vt=Jr(g[k]);if(!(lt=o!=null&&b(o,vt)))break;o=o[vt];}return lt||++k!=et?lt:(et=o==null?0:o.length,!!et&&Gs(et)&&ln(vt,et)&&(pe(o)||Xn(o)));}function O0(o){var g=o.length,b=new o.constructor(g);return g&&typeof o[0]=="string"&&Ne.call(o,"index")&&(b.index=o.index,b.input=o.input),b;}function Qf(o){return typeof o.constructor=="function"&&!Yi(o)?ni(ms(o)):{};}function w0(o,g,b){var k=o.constructor;switch(g){case Ot:return Ia(o);case Rt:case X:return new k(+o);case Lt:return f0(o,b);case Yt:case zt:case Wt:case Qt:case ue:case ie:case ne:case ae:case se:return Df(o,b);case Z:return new k();case O:case St:return new k(o);case it:return c0(o);case ct:return new k();case Ct:return u0(o);}}function A0(o,g){var b=g.length;if(!b)return o;var k=b-1;return g[k]=(b>1?"& ":"")+g[k],g=g.join(b>2?", ":" "),o.replace(Oo,"{\n/* [wrapped with "+g+"] */\n");}function E0(o){return pe(o)||Xn(o)||!!(ef&&o&&o[ef]);}function ln(o,g){var _g2;var b=_typeof(o);return g=(_g2=g)!==null&&_g2!==void 0?_g2:at,!!g&&(b=="number"||b!="symbol"&&No.test(o))&&o>-1&&o%1==0&&o<g;}function hr(o,g,b){if(!Ve(b))return!1;var k=_typeof(g);return(k=="number"?Pr(b)&&ln(g,b.length):k=="string"&&g in b)?jr(b[g],o):!1;}function ba(o,g){if(pe(o))return!1;var b=_typeof(o);return b=="number"||b=="symbol"||b=="boolean"||o==null||wr(o)?!0:Gn.test(o)||!tn.test(o)||g!=null&&o in Be(g);}function M0(o){var g=_typeof(o);return g=="string"||g=="number"||g=="symbol"||g=="boolean"?o!=="__proto__":o===null;}function Da(o){var g=Ws(o),b=ot[g];if(typeof b!="function"||!(g in Ce.prototype))return!1;if(o===b)return!0;var k=Ma(b);return!!k&&o===k[0];}function L0(o){return!!Ql&&Ql in o;}var R0=hs?fn:Ja;function Yi(o){var g=o&&o.constructor,b=typeof g=="function"&&g.prototype||ti;return o===b;}function qf(o){return o===o&&!Ve(o);}function _f(o,g){return function(b){return b==null?!1:b[o]===g&&(g!==t||o in Be(b));};}function b0(o){var g=$s(o,function(k){return b.size===h&&b.clear(),k;}),b=g.cache;return g;}function D0(o,g){var b=o[1],k=g[1],et=b|k,lt=et<(x|I|R),vt=k==R&&b==v||k==R&&b==D&&o[7].length<=g[8]||k==(R|D)&&g[7].length<=g[8]&&b==v;if(!(lt||vt))return o;k&x&&(o[2]=g[2],et|=b&x?0:d);var It=g[3];if(It){var bt=o[3];o[3]=bt?Bf(bt,It,g[4]):It,o[4]=bt?Pn(o[3],m):g[4];}return It=g[5],It&&(bt=o[5],o[5]=bt?Wf(bt,It,g[6]):It,o[6]=bt?Pn(o[5],m):g[6]),It=g[7],It&&(o[7]=It),k&R&&(o[8]=o[8]==null?g[8]:ar(o[8],g[8])),o[9]==null&&(o[9]=g[9]),o[0]=g[0],o[1]=et,o;}function N0(o){var g=[];if(o!=null)for(var b in Be(o))g.push(b);return g;}function B0(o){return ps.call(o);}function tc(o,g,b){return g=tr(g===t?o.length-1:g,0),function(){for(var k=arguments,et=-1,lt=tr(k.length-g,0),vt=Ft(lt);++et<lt;)vt[et]=k[g+et];et=-1;for(var It=Ft(g+1);++et<g;)It[et]=k[et];return It[g]=b(vt),Cr(o,this,It);};}function ec(o,g){return g.length<2?o:Fn(o,Fr(g,0,-1));}function W0(o,g){for(var b=o.length,k=ar(g.length,b),et=yr(o);k--;){var lt=g[k];o[k]=ln(lt,b)?et[lt]:t;}return o;}function Na(o,g){if(!(g==="constructor"&&typeof o[g]=="function")&&g!="__proto__")return o[g];}var rc=ic(Of),Xi=Qd||function(o,g){return ir.setTimeout(o,g);},Ba=ic(s0);function nc(o,g,b){var k=g+"";return Ba(o,A0(k,F0(I0(k),b)));}function ic(o){var g=0,b=0;return function(){var k=ep(),et=B-(k-b);if(b=k,et>0){if(++g>=Y)return arguments[0];}else g=0;return o.apply(t,arguments);};}function Us(o,g){var b=-1,k=o.length,et=k-1;for(g=g===t?k:g;++b<g;){var lt=ma(b,et),vt=o[lt];o[lt]=o[b],o[b]=vt;}return o.length=g,o;}var sc=b0(function(o){var g=[];return o.charCodeAt(0)===46&&g.push(""),o.replace(Hn,function(b,k,et,lt){g.push(et?lt.replace(Lo,"$1"):k||b);}),g;});function Jr(o){if(typeof o=="string"||wr(o))return o;var g=o+"";return g=="0"&&1/o==-tt?"-0":g;}function Yn(o){if(o!=null){try{return ds.call(o);}catch(_unused27){}try{return o+"";}catch(_unused28){}}return"";}function F0(o,g){return Dr(mt,function(b){var k="_."+b[0];g&b[1]&&!ls(o,k)&&o.push(k);}),o.sort();}function oc(o){if(o instanceof Ce)return o.clone();var g=new Br(o.__wrapped__,o.__chain__);return g.__actions__=yr(o.__actions__),g.__index__=o.__index__,g.__values__=o.__values__,g;}function U0(o,g,b){(b?hr(o,g,b):g===t)?g=1:g=tr(ye(g),0);var k=o==null?0:o.length;if(!k||g<1)return[];for(var et=0,lt=0,vt=Ft(Ss(k/g));et<k;)vt[lt++]=Fr(o,et,et+=g);return vt;}function Y0(o){for(var g=-1,b=o==null?0:o.length,k=0,et=[];++g<b;){var lt=o[g];lt&&(et[k++]=lt);}return et;}function X0(){var o=arguments.length;if(!o)return[];for(var g=Ft(o-1),b=arguments[0],k=o;k--;)g[k-1]=arguments[k];return yn(pe(b)?yr(b):[b],sr(g,1));}var z0=xe(function(o,g){return Qe(o)?Ni(o,sr(g,1,Qe,!0)):[];}),$0=xe(function(o,g){var b=Ur(g);return Qe(b)&&(b=t),Qe(o)?Ni(o,sr(g,1,Qe,!0),le(b,2)):[];}),j0=xe(function(o,g){var b=Ur(g);return Qe(b)&&(b=t),Qe(o)?Ni(o,sr(g,1,Qe,!0),t,b):[];});function G0(o,g,b){var k=o==null?0:o.length;return k?(g=b||g===t?1:ye(g),Fr(o,g<0?0:g,k)):[];}function H0(o,g,b){var k=o==null?0:o.length;return k?(g=b||g===t?1:ye(g),g=k-g,Fr(o,0,g<0?0:g)):[];}function k0(o,g){return o&&o.length?Ls(o,le(g,3),!0,!0):[];}function K0(o,g){return o&&o.length?Ls(o,le(g,3),!0):[];}function V0(o,g,b,k){var et=o==null?0:o.length;return et?(b&&typeof b!="number"&&hr(o,g,b)&&(b=0,k=et),Xp(o,g,b,k)):[];}function ac(o,g,b){var k=o==null?0:o.length;if(!k)return-1;var et=b==null?0:ye(b);return et<0&&(et=tr(k+et,0)),fs(o,le(g,3),et);}function lc(o,g,b){var k=o==null?0:o.length;if(!k)return-1;var et=k-1;return b!==t&&(et=ye(b),et=b<0?tr(k+et,0):ar(et,k-1)),fs(o,le(g,3),et,!0);}function fc(o){var g=o==null?0:o.length;return g?sr(o,1):[];}function Z0(o){var g=o==null?0:o.length;return g?sr(o,tt):[];}function J0(o,g){var b=o==null?0:o.length;return b?(g=g===t?1:ye(g),sr(o,g)):[];}function Q0(o){for(var g=-1,b=o==null?0:o.length,k={};++g<b;){var et=o[g];k[et[0]]=et[1];}return k;}function cc(o){return o&&o.length?o[0]:t;}function q0(o,g,b){var k=o==null?0:o.length;if(!k)return-1;var et=b==null?0:ye(b);return et<0&&(et=tr(k+et,0)),Jn(o,g,et);}function _0(o){var g=o==null?0:o.length;return g?Fr(o,0,-1):[];}var tv=xe(function(o){var g=He(o,Ta);return g.length&&g[0]===o[0]?ha(g):[];}),ev=xe(function(o){var g=Ur(o),b=He(o,Ta);return g===Ur(b)?g=t:b.pop(),b.length&&b[0]===o[0]?ha(b,le(g,2)):[];}),rv=xe(function(o){var g=Ur(o),b=He(o,Ta);return g=typeof g=="function"?g:t,g&&b.pop(),b.length&&b[0]===o[0]?ha(b,t,g):[];});function nv(o,g){return o==null?"":_d.call(o,g);}function Ur(o){var g=o==null?0:o.length;return g?o[g-1]:t;}function iv(o,g,b){var k=o==null?0:o.length;if(!k)return-1;var et=k;return b!==t&&(et=ye(b),et=et<0?tr(k+et,0):ar(et,k-1)),g===g?Fd(o,g,et):fs(o,jl,et,!0);}function sv(o,g){return o&&o.length?xf(o,ye(g)):t;}var ov=xe(uc);function uc(o,g){return o&&o.length&&g&&g.length?ga(o,g):o;}function av(o,g,b){return o&&o.length&&g&&g.length?ga(o,g,le(b,2)):o;}function lv(o,g,b){return o&&o.length&&g&&g.length?ga(o,g,t,b):o;}var fv=an(function(o,g){var b=o==null?0:o.length,k=la(o,g);return If(o,He(g,function(et){return ln(et,b)?+et:et;}).sort(Nf)),k;});function cv(o,g){var b=[];if(!(o&&o.length))return b;var k=-1,et=[],lt=o.length;for(g=le(g,3);++k<lt;){var vt=o[k];g(vt,k,o)&&(b.push(vt),et.push(k));}return If(o,et),b;}function Wa(o){return o==null?o:np.call(o);}function uv(o,g,b){var k=o==null?0:o.length;return k?(b&&typeof b!="number"&&hr(o,g,b)?(g=0,b=k):(g=g==null?0:ye(g),b=b===t?k:ye(b)),Fr(o,g,b)):[];}function hv(o,g){return Ms(o,g);}function dv(o,g,b){return Pa(o,g,le(b,2));}function pv(o,g){var b=o==null?0:o.length;if(b){var k=Ms(o,g);if(k<b&&jr(o[k],g))return k;}return-1;}function vv(o,g){return Ms(o,g,!0);}function gv(o,g,b){return Pa(o,g,le(b,2),!0);}function mv(o,g){var b=o==null?0:o.length;if(b){var k=Ms(o,g,!0)-1;if(jr(o[k],g))return k;}return-1;}function yv(o){return o&&o.length?wf(o):[];}function Pv(o,g){return o&&o.length?wf(o,le(g,2)):[];}function Sv(o){var g=o==null?0:o.length;return g?Fr(o,1,g):[];}function xv(o,g,b){return o&&o.length?(g=b||g===t?1:ye(g),Fr(o,0,g<0?0:g)):[];}function Tv(o,g,b){var k=o==null?0:o.length;return k?(g=b||g===t?1:ye(g),g=k-g,Fr(o,g<0?0:g,k)):[];}function Cv(o,g){return o&&o.length?Ls(o,le(g,3),!1,!0):[];}function Iv(o,g){return o&&o.length?Ls(o,le(g,3)):[];}var Ov=xe(function(o){return Tn(sr(o,1,Qe,!0));}),wv=xe(function(o){var g=Ur(o);return Qe(g)&&(g=t),Tn(sr(o,1,Qe,!0),le(g,2));}),Av=xe(function(o){var g=Ur(o);return g=typeof g=="function"?g:t,Tn(sr(o,1,Qe,!0),t,g);});function Ev(o){return o&&o.length?Tn(o):[];}function Mv(o,g){return o&&o.length?Tn(o,le(g,2)):[];}function Lv(o,g){return g=typeof g=="function"?g:t,o&&o.length?Tn(o,t,g):[];}function Fa(o){if(!(o&&o.length))return[];var g=0;return o=mn(o,function(b){if(Qe(b))return g=tr(b.length,g),!0;}),ta(g,function(b){return He(o,Qo(b));});}function hc(o,g){if(!(o&&o.length))return[];var b=Fa(o);return g==null?b:He(b,function(k){return Cr(g,t,k);});}var Rv=xe(function(o,g){return Qe(o)?Ni(o,g):[];}),bv=xe(function(o){return xa(mn(o,Qe));}),Dv=xe(function(o){var g=Ur(o);return Qe(g)&&(g=t),xa(mn(o,Qe),le(g,2));}),Nv=xe(function(o){var g=Ur(o);return g=typeof g=="function"?g:t,xa(mn(o,Qe),t,g);}),Bv=xe(Fa);function Wv(o,g){return Lf(o||[],g||[],Di);}function Fv(o,g){return Lf(o||[],g||[],Fi);}var Uv=xe(function(o){var g=o.length,b=g>1?o[g-1]:t;return b=typeof b=="function"?(o.pop(),b):t,hc(o,b);});function dc(o){var g=ot(o);return g.__chain__=!0,g;}function Yv(o,g){return g(o),o;}function Ys(o,g){return g(o);}var Xv=an(function(o){var g=o.length,b=g?o[0]:0,k=this.__wrapped__,et=function et(lt){return la(lt,o);};return g>1||this.__actions__.length||!(k instanceof Ce)||!ln(b)?this.thru(et):(k=k.slice(b,+b+(g?1:0)),k.__actions__.push({func:Ys,args:[et],thisArg:t}),new Br(k,this.__chain__).thru(function(lt){return g&&!lt.length&&lt.push(t),lt;}));});function zv(){return dc(this);}function $v(){return new Br(this.value(),this.__chain__);}function jv(){this.__values__===t&&(this.__values__=Ac(this.value()));var o=this.__index__>=this.__values__.length,g=o?t:this.__values__[this.__index__++];return{done:o,value:g};}function Gv(){return this;}function Hv(o){for(var g,b=this;b instanceof Is;){var k=oc(b);k.__index__=0,k.__values__=t,g?et.__wrapped__=k:g=k;var et=k;b=b.__wrapped__;}return et.__wrapped__=o,g;}function kv(){var o=this.__wrapped__;if(o instanceof Ce){var g=o;return this.__actions__.length&&(g=new Ce(this)),g=g.reverse(),g.__actions__.push({func:Ys,args:[Wa],thisArg:t}),new Br(g,this.__chain__);}return this.thru(Wa);}function Kv(){return Mf(this.__wrapped__,this.__actions__);}var Vv=Rs(function(o,g,b){Ne.call(o,b)?++o[b]:sn(o,b,1);});function Zv(o,g,b){var k=pe(o)?zl:Yp;return b&&hr(o,g,b)&&(g=t),k(o,le(g,3));}function Jv(o,g){var b=pe(o)?mn:hf;return b(o,le(g,3));}var Qv=Xf(ac),qv=Xf(lc);function _v(o,g){return sr(Xs(o,g),1);}function tg(o,g){return sr(Xs(o,g),tt);}function eg(o,g,b){return b=b===t?1:ye(b),sr(Xs(o,g),b);}function pc(o,g){var b=pe(o)?Dr:xn;return b(o,le(g,3));}function vc(o,g){var b=pe(o)?Sd:uf;return b(o,le(g,3));}var rg=Rs(function(o,g,b){Ne.call(o,b)?o[b].push(g):sn(o,b,[g]);});function ng(o,g,b,k){o=Pr(o)?o:li(o),b=b&&!k?ye(b):0;var et=o.length;return b<0&&(b=tr(et+b,0)),Hs(o)?b<=et&&o.indexOf(g,b)>-1:!!et&&Jn(o,g,b)>-1;}var ig=xe(function(o,g,b){var k=-1,et=typeof g=="function",lt=Pr(o)?Ft(o.length):[];return xn(o,function(vt){lt[++k]=et?Cr(g,vt,b):Bi(vt,g,b);}),lt;}),sg=Rs(function(o,g,b){sn(o,b,g);});function Xs(o,g){var b=pe(o)?He:yf;return b(o,le(g,3));}function og(o,g,b,k){return o==null?[]:(pe(g)||(g=g==null?[]:[g]),b=k?t:b,pe(b)||(b=b==null?[]:[b]),Tf(o,g,b));}var ag=Rs(function(o,g,b){o[b?0:1].push(g);},function(){return[[],[]];});function lg(o,g,b){var k=pe(o)?Zo:Hl,et=arguments.length<3;return k(o,le(g,4),b,et,xn);}function fg(o,g,b){var k=pe(o)?xd:Hl,et=arguments.length<3;return k(o,le(g,4),b,et,uf);}function cg(o,g){var b=pe(o)?mn:hf;return b(o,js(le(g,3)));}function ug(o){var g=pe(o)?af:n0;return g(o);}function hg(o,g,b){(b?hr(o,g,b):g===t)?g=1:g=ye(g);var k=pe(o)?Np:i0;return k(o,g);}function dg(o){var g=pe(o)?Bp:o0;return g(o);}function pg(o){if(o==null)return 0;if(Pr(o))return Hs(o)?qn(o):o.length;var g=lr(o);return g==Z||g==ct?o.size:pa(o).length;}function vg(o,g,b){var k=pe(o)?Jo:a0;return b&&hr(o,g,b)&&(g=t),k(o,le(g,3));}var gg=xe(function(o,g){if(o==null)return[];var b=g.length;return b>1&&hr(o,g[0],g[1])?g=[]:b>2&&hr(g[0],g[1],g[2])&&(g=[g[0]]),Tf(o,sr(g,1),[]);}),zs=Jd||function(){return ir.Date.now();};function mg(o,g){if(typeof g!="function")throw new Nr(c);return o=ye(o),function(){if(--o<1)return g.apply(this,arguments);};}function gc(o,g,b){return g=b?t:g,g=o&&g==null?o.length:g,on(o,R,t,t,t,t,g);}function mc(o,g){var b;if(typeof g!="function")throw new Nr(c);return o=ye(o),function(){return--o>0&&(b=g.apply(this,arguments)),o<=1&&(g=t),b;};}var Ua=xe(function(o,g,b){var k=x;if(b.length){var et=Pn(b,oi(Ua));k|=S;}return on(o,k,g,b,et);}),yc=xe(function(o,g,b){var k=x|I;if(b.length){var et=Pn(b,oi(yc));k|=S;}return on(g,k,o,b,et);});function Pc(o,g,b){g=b?t:g;var k=on(o,v,t,t,t,t,t,g);return k.placeholder=Pc.placeholder,k;}function Sc(o,g,b){g=b?t:g;var k=on(o,p,t,t,t,t,t,g);return k.placeholder=Sc.placeholder,k;}function xc(o,g,b){var k,et,lt,vt,It,bt,Gt=0,Ht=!1,Kt=!1,_t=!0;if(typeof o!="function")throw new Nr(c);g=Yr(g)||0,Ve(b)&&(Ht=!!b.leading,Kt="maxWait"in b,lt=Kt?tr(Yr(b.maxWait)||0,g):lt,_t="trailing"in b?!!b.trailing:_t);function re(qe){var Gr=k,un=et;return k=et=t,Gt=qe,vt=o.apply(un,Gr),vt;}function fe(qe){return Gt=qe,It=Xi(Te,g),Ht?re(qe):vt;}function Se(qe){var Gr=qe-bt,un=qe-Gt,Xc=g-Gr;return Kt?ar(Xc,lt-un):Xc;}function ce(qe){var Gr=qe-bt,un=qe-Gt;return bt===t||Gr>=g||Gr<0||Kt&&un>=lt;}function Te(){var qe=zs();if(ce(qe))return Oe(qe);It=Xi(Te,Se(qe));}function Oe(qe){return It=t,_t&&k?re(qe):(k=et=t,vt);}function Ar(){It!==t&&Rf(It),Gt=0,k=bt=et=It=t;}function dr(){return It===t?vt:Oe(zs());}function Er(){var qe=zs(),Gr=ce(qe);if(k=arguments,et=this,bt=qe,Gr){if(It===t)return fe(bt);if(Kt)return Rf(It),It=Xi(Te,g),re(bt);}return It===t&&(It=Xi(Te,g)),vt;}return Er.cancel=Ar,Er.flush=dr,Er;}var yg=xe(function(o,g){return cf(o,1,g);}),Pg=xe(function(o,g,b){return cf(o,Yr(g)||0,b);});function Sg(o){return on(o,U);}function $s(o,g){if(typeof o!="function"||g!=null&&typeof g!="function")throw new Nr(c);var _b=function b(){var k=arguments,et=g?g.apply(this,k):k[0],lt=_b.cache;if(lt.has(et))return lt.get(et);var vt=o.apply(this,k);return _b.cache=lt.set(et,vt)||lt,vt;};return _b.cache=new($s.Cache||nn)(),_b;}$s.Cache=nn;function js(o){if(typeof o!="function")throw new Nr(c);return function(){var g=arguments;switch(g.length){case 0:return!o.call(this);case 1:return!o.call(this,g[0]);case 2:return!o.call(this,g[0],g[1]);case 3:return!o.call(this,g[0],g[1],g[2]);}return!o.apply(this,g);};}function xg(o){return mc(2,o);}var Tg=l0(function(o,g){g=g.length==1&&pe(g[0])?He(g[0],Ir(le())):He(sr(g,1),Ir(le()));var b=g.length;return xe(function(k){for(var et=-1,lt=ar(k.length,b);++et<lt;)k[et]=g[et].call(this,k[et]);return Cr(o,this,k);});}),Ya=xe(function(o,g){var b=Pn(g,oi(Ya));return on(o,S,t,g,b);}),Tc=xe(function(o,g){var b=Pn(g,oi(Tc));return on(o,A,t,g,b);}),Cg=an(function(o,g){return on(o,D,t,t,t,g);});function Ig(o,g){if(typeof o!="function")throw new Nr(c);return g=g===t?g:ye(g),xe(o,g);}function Og(o,g){if(typeof o!="function")throw new Nr(c);return g=g==null?0:tr(ye(g),0),xe(function(b){var k=b[g],et=In(b,0,g);return k&&yn(et,k),Cr(o,this,et);});}function wg(o,g,b){var k=!0,et=!0;if(typeof o!="function")throw new Nr(c);return Ve(b)&&(k="leading"in b?!!b.leading:k,et="trailing"in b?!!b.trailing:et),xc(o,g,{leading:k,maxWait:g,trailing:et});}function Ag(o){return gc(o,1);}function Eg(o,g){return Ya(Ca(g),o);}function Mg(){if(!arguments.length)return[];var o=arguments[0];return pe(o)?o:[o];}function Lg(o){return Wr(o,T);}function Rg(o,g){return g=typeof g=="function"?g:t,Wr(o,T,g);}function bg(o){return Wr(o,u|T);}function Dg(o,g){return g=typeof g=="function"?g:t,Wr(o,u|T,g);}function Ng(o,g){return g==null||ff(o,g,rr(g));}function jr(o,g){return o===g||o!==o&&g!==g;}var Bg=Bs(ua),Wg=Bs(function(o,g){return o>=g;}),Xn=vf(/* @__PURE__ */function(){return arguments;}())?vf:function(o){return Ze(o)&&Ne.call(o,"callee")&&!tf.call(o,"callee");},pe=Ft.isArray,Fg=Bl?Ir(Bl):Hp;function Pr(o){return o!=null&&Gs(o.length)&&!fn(o);}function Qe(o){return Ze(o)&&Pr(o);}function Ug(o){return o===!0||o===!1||Ze(o)&&ur(o)==Rt;}var On=qd||Ja,Yg=Wl?Ir(Wl):kp;function Xg(o){return Ze(o)&&o.nodeType===1&&!zi(o);}function zg(o){if(o==null)return!0;if(Pr(o)&&(pe(o)||typeof o=="string"||typeof o.splice=="function"||On(o)||ai(o)||Xn(o)))return!o.length;var g=lr(o);if(g==Z||g==ct)return!o.size;if(Yi(o))return!pa(o).length;for(var b in o)if(Ne.call(o,b))return!1;return!0;}function $g(o,g){return Wi(o,g);}function jg(o,g,b){b=typeof b=="function"?b:t;var k=b?b(o,g):t;return k===t?Wi(o,g,t,b):!!k;}function Xa(o){if(!Ze(o))return!1;var g=ur(o);return g==q||g==z||typeof o.message=="string"&&typeof o.name=="string"&&!zi(o);}function Gg(o){return typeof o=="number"&&rf(o);}function fn(o){if(!Ve(o))return!1;var g=ur(o);return g==nt||g==j||g==Nt||g==rt;}function Cc(o){return typeof o=="number"&&o==ye(o);}function Gs(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=at;}function Ve(o){var g=_typeof(o);return o!=null&&(g=="object"||g=="function");}function Ze(o){return o!=null&&_typeof(o)=="object";}var Ic=Fl?Ir(Fl):Vp;function Hg(o,g){return o===g||da(o,g,La(g));}function kg(o,g,b){return b=typeof b=="function"?b:t,da(o,g,La(g),b);}function Kg(o){return Oc(o)&&o!=+o;}function Vg(o){if(R0(o))throw new de(s);return gf(o);}function Zg(o){return o===null;}function Jg(o){return o==null;}function Oc(o){return typeof o=="number"||Ze(o)&&ur(o)==O;}function zi(o){if(!Ze(o)||ur(o)!=$)return!1;var g=ms(o);if(g===null)return!0;var b=Ne.call(g,"constructor")&&g.constructor;return typeof b=="function"&&b instanceof b&&ds.call(b)==kd;}var za=Ul?Ir(Ul):Zp;function Qg(o){return Cc(o)&&o>=-at&&o<=at;}var wc=Yl?Ir(Yl):Jp;function Hs(o){return typeof o=="string"||!pe(o)&&Ze(o)&&ur(o)==St;}function wr(o){return _typeof(o)=="symbol"||Ze(o)&&ur(o)==Ct;}var ai=Xl?Ir(Xl):Qp;function qg(o){return o===t;}function _g(o){return Ze(o)&&lr(o)==Dt;}function tm(o){return Ze(o)&&ur(o)==At;}var em=Bs(va),rm=Bs(function(o,g){return o<=g;});function Ac(o){if(!o)return[];if(Pr(o))return Hs(o)?zr(o):yr(o);if(Ei&&o[Ei])return Nd(o[Ei]());var g=lr(o),b=g==Z?ra:g==ct?cs:li;return b(o);}function cn(o){if(!o)return o===0?o:0;if(o=Yr(o),o===tt||o===-tt){var g=o<0?-1:1;return g*ut;}return o===o?o:0;}function ye(o){var g=cn(o),b=g%1;return g===g?b?g-b:g:0;}function Ec(o){return o?Wn(ye(o),0,Q):0;}function Yr(o){if(typeof o=="number")return o;if(wr(o))return K;if(Ve(o)){var g=typeof o.valueOf=="function"?o.valueOf():o;o=Ve(g)?g+"":g;}if(typeof o!="string")return o===0?o:+o;o=kl(o);var b=ts.test(o);return b||Do.test(o)?md(o.slice(2),b?2:8):Rn.test(o)?K:+o;}function Mc(o){return Zr(o,Sr(o));}function nm(o){return o?Wn(ye(o),-at,at):o===0?o:0;}function Le(o){return o==null?"":Or(o);}var im=ii(function(o,g){if(Yi(g)||Pr(g)){Zr(g,rr(g),o);return;}for(var b in g)Ne.call(g,b)&&Di(o,b,g[b]);}),Lc=ii(function(o,g){Zr(g,Sr(g),o);}),ks=ii(function(o,g,b,k){Zr(g,Sr(g),o,k);}),sm=ii(function(o,g,b,k){Zr(g,rr(g),o,k);}),om=an(la);function am(o,g){var b=ni(o);return g==null?b:lf(b,g);}var lm=xe(function(o,g){o=Be(o);var b=-1,k=g.length,et=k>2?g[2]:t;for(et&&hr(g[0],g[1],et)&&(k=1);++b<k;)for(var lt=g[b],vt=Sr(lt),It=-1,bt=vt.length;++It<bt;){var Gt=vt[It],Ht=o[Gt];(Ht===t||jr(Ht,ti[Gt])&&!Ne.call(o,Gt))&&(o[Gt]=lt[Gt]);}return o;}),fm=xe(function(o){return o.push(t,Kf),Cr(Rc,t,o);});function cm(o,g){return $l(o,le(g,3),Vr);}function um(o,g){return $l(o,le(g,3),ca);}function hm(o,g){return o==null?o:fa(o,le(g,3),Sr);}function dm(o,g){return o==null?o:df(o,le(g,3),Sr);}function pm(o,g){return o&&Vr(o,le(g,3));}function vm(o,g){return o&&ca(o,le(g,3));}function gm(o){return o==null?[]:As(o,rr(o));}function mm(o){return o==null?[]:As(o,Sr(o));}function $a(o,g,b){var k=o==null?t:Fn(o,g);return k===t?b:k;}function ym(o,g){return o!=null&&Jf(o,g,zp);}function ja(o,g){return o!=null&&Jf(o,g,$p);}var Pm=$f(function(o,g,b){g!=null&&typeof g.toString!="function"&&(g=ps.call(g)),o[g]=b;},Ha(xr)),Sm=$f(function(o,g,b){g!=null&&typeof g.toString!="function"&&(g=ps.call(g)),Ne.call(o,g)?o[g].push(b):o[g]=[b];},le),xm=xe(Bi);function rr(o){return Pr(o)?of(o):pa(o);}function Sr(o){return Pr(o)?of(o,!0):qp(o);}function Tm(o,g){var b={};return g=le(g,3),Vr(o,function(k,et,lt){sn(b,g(k,et,lt),k);}),b;}function Cm(o,g){var b={};return g=le(g,3),Vr(o,function(k,et,lt){sn(b,et,g(k,et,lt));}),b;}var Im=ii(function(o,g,b){Es(o,g,b);}),Rc=ii(function(o,g,b,k){Es(o,g,b,k);}),Om=an(function(o,g){var b={};if(o==null)return b;var k=!1;g=He(g,function(lt){return lt=Cn(lt,o),k||(k=lt.length>1),lt;}),Zr(o,Ea(o),b),k&&(b=Wr(b,u|y|T,P0));for(var et=g.length;et--;)Sa(b,g[et]);return b;});function wm(o,g){return bc(o,js(le(g)));}var Am=an(function(o,g){return o==null?{}:t0(o,g);});function bc(o,g){if(o==null)return{};var b=He(Ea(o),function(k){return[k];});return g=le(g),Cf(o,b,function(k,et){return g(k,et[0]);});}function Em(o,g,b){g=Cn(g,o);var k=-1,et=g.length;for(et||(et=1,o=t);++k<et;){var lt=o==null?t:o[Jr(g[k])];lt===t&&(k=et,lt=b),o=fn(lt)?lt.call(o):lt;}return o;}function Mm(o,g,b){return o==null?o:Fi(o,g,b);}function Lm(o,g,b,k){return k=typeof k=="function"?k:t,o==null?o:Fi(o,g,b,k);}var Dc=Hf(rr),Nc=Hf(Sr);function Rm(o,g,b){var k=pe(o),et=k||On(o)||ai(o);if(g=le(g,4),b==null){var lt=o&&o.constructor;et?b=k?new lt():[]:Ve(o)?b=fn(lt)?ni(ms(o)):{}:b={};}return(et?Dr:Vr)(o,function(vt,It,bt){return g(b,vt,It,bt);}),b;}function bm(o,g){return o==null?!0:Sa(o,g);}function Dm(o,g,b){return o==null?o:Ef(o,g,Ca(b));}function Nm(o,g,b,k){return k=typeof k=="function"?k:t,o==null?o:Ef(o,g,Ca(b),k);}function li(o){return o==null?[]:ea(o,rr(o));}function Bm(o){return o==null?[]:ea(o,Sr(o));}function Wm(o,g,b){return b===t&&(b=g,g=t),b!==t&&(b=Yr(b),b=b===b?b:0),g!==t&&(g=Yr(g),g=g===g?g:0),Wn(Yr(o),g,b);}function Fm(o,g,b){return g=cn(g),b===t?(b=g,g=0):b=cn(b),o=Yr(o),jp(o,g,b);}function Um(o,g,b){if(b&&typeof b!="boolean"&&hr(o,g,b)&&(g=b=t),b===t&&(typeof g=="boolean"?(b=g,g=t):typeof o=="boolean"&&(b=o,o=t)),o===t&&g===t?(o=0,g=1):(o=cn(o),g===t?(g=o,o=0):g=cn(g)),o>g){var k=o;o=g,g=k;}if(b||o%1||g%1){var et=nf();return ar(o+et*(g-o+gd("1e-"+((et+"").length-1))),g);}return ma(o,g);}var Ym=si(function(o,g,b){return g=g.toLowerCase(),o+(b?Bc(g):g);});function Bc(o){return Ga(Le(o).toLowerCase());}function Wc(o){return o=Le(o),o&&o.replace(Bo,Md).replace(od,"");}function Xm(o,g,b){o=Le(o),g=Or(g);var k=o.length;b=b===t?k:Wn(ye(b),0,k);var et=b;return b-=g.length,b>=0&&o.slice(b,et)==g;}function zm(o){return o=Le(o),o&&Je.test(o)?o.replace(Ge,Ld):o;}function $m(o){return o=Le(o),o&&Co.test(o)?o.replace(Oi,"\\$&"):o;}var jm=si(function(o,g,b){return o+(b?"-":"")+g.toLowerCase();}),Gm=si(function(o,g,b){return o+(b?" ":"")+g.toLowerCase();}),Hm=Yf("toLowerCase");function km(o,g,b){o=Le(o),g=ye(g);var k=g?qn(o):0;if(!g||k>=g)return o;var et=(g-k)/2;return Ns(xs(et),b)+o+Ns(Ss(et),b);}function Km(o,g,b){o=Le(o),g=ye(g);var k=g?qn(o):0;return g&&k<g?o+Ns(g-k,b):o;}function Vm(o,g,b){o=Le(o),g=ye(g);var k=g?qn(o):0;return g&&k<g?Ns(g-k,b)+o:o;}function Zm(o,g,b){return b||g==null?g=0:g&&(g=+g),rp(Le(o).replace(wi,""),g||0);}function Jm(o,g,b){return(b?hr(o,g,b):g===t)?g=1:g=ye(g),ya(Le(o),g);}function Qm(){var o=arguments,g=Le(o[0]);return o.length<3?g:g.replace(o[1],o[2]);}var qm=si(function(o,g,b){return o+(b?"_":"")+g.toLowerCase();});function _m(o,g,b){return b&&typeof b!="number"&&hr(o,g,b)&&(g=b=t),b=b===t?Q:b>>>0,b?(o=Le(o),o&&(typeof g=="string"||g!=null&&!za(g))&&(g=Or(g),!g&&Qn(o))?In(zr(o),0,b):o.split(g,b)):[];}var ty=si(function(o,g,b){return o+(b?" ":"")+Ga(g);});function ey(o,g,b){return o=Le(o),b=b==null?0:Wn(ye(b),0,o.length),g=Or(g),o.slice(b,b+g.length)==g;}function ry(o,g,b){var k=ot.templateSettings;b&&hr(o,g,b)&&(g=t),o=Le(o),g=ks({},g,k,kf);var et=ks({},g.imports,k.imports,kf),lt=rr(et),vt=ea(et,lt),It,bt,Gt=0,Ht=g.interpolate||kn,Kt="__p += '",_t=na((g.escape||kn).source+"|"+Ht.source+"|"+(Ht===Kr?Ro:kn).source+"|"+(g.evaluate||kn).source+"|$","g"),re="//# sourceURL="+(Ne.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ud+"]")+"\n";o.replace(_t,function(ce,Te,Oe,Ar,dr,Er){return Oe||(Oe=Ar),Kt+=o.slice(Gt,Er).replace(vn,Rd),Te&&(It=!0,Kt+="' +\n__e("+Te+") +\n'"),dr&&(bt=!0,Kt+="';\n"+dr+";\n__p += '"),Oe&&(Kt+="' +\n((__t = ("+Oe+")) == null ? '' : __t) +\n'"),Gt=Er+ce.length,ce;}),Kt+="';\n";var fe=Ne.call(g,"variable")&&g.variable;if(!fe)Kt="with (obj) {\n"+Kt+"\n}\n";else if(Mo.test(fe))throw new de(l);Kt=(bt?Kt.replace(je,""):Kt).replace(We,"$1").replace(Xe,"$1;"),Kt="function("+(fe||"obj")+") {\n"+(fe?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(It?", __e = _.escape":"")+(bt?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+Kt+"return __p\n}";var Se=Uc(function(){return Ee(lt,re+"return "+Kt).apply(t,vt);});if(Se.source=Kt,Xa(Se))throw Se;return Se;}function ny(o){return Le(o).toLowerCase();}function iy(o){return Le(o).toUpperCase();}function sy(o,g,b){if(o=Le(o),o&&(b||g===t))return kl(o);if(!o||!(g=Or(g)))return o;var k=zr(o),et=zr(g),lt=Kl(k,et),vt=Vl(k,et)+1;return In(k,lt,vt).join("");}function oy(o,g,b){if(o=Le(o),o&&(b||g===t))return o.slice(0,Jl(o)+1);if(!o||!(g=Or(g)))return o;var k=zr(o),et=Vl(k,zr(g))+1;return In(k,0,et).join("");}function ay(o,g,b){if(o=Le(o),o&&(b||g===t))return o.replace(wi,"");if(!o||!(g=Or(g)))return o;var k=zr(o),et=Kl(k,zr(g));return In(k,et).join("");}function ly(o,g){var b=M,k=W;if(Ve(g)){var et="separator"in g?g.separator:et;b="length"in g?ye(g.length):b,k="omission"in g?Or(g.omission):k;}o=Le(o);var lt=o.length;if(Qn(o)){var vt=zr(o);lt=vt.length;}if(b>=lt)return o;var It=b-qn(k);if(It<1)return k;var bt=vt?In(vt,0,It).join(""):o.slice(0,It);if(et===t)return bt+k;if(vt&&(It+=bt.length-It),za(et)){if(o.slice(It).search(et)){var Gt,Ht=bt;for(et.global||(et=na(et.source,Le(_i.exec(et))+"g")),et.lastIndex=0;Gt=et.exec(Ht);)var Kt=Gt.index;bt=bt.slice(0,Kt===t?It:Kt);}}else if(o.indexOf(Or(et),It)!=It){var _t=bt.lastIndexOf(et);_t>-1&&(bt=bt.slice(0,_t));}return bt+k;}function fy(o){return o=Le(o),o&&Ke.test(o)?o.replace(Fe,Ud):o;}var cy=si(function(o,g,b){return o+(b?" ":"")+g.toUpperCase();}),Ga=Yf("toUpperCase");function Fc(o,g,b){return o=Le(o),g=b?t:g,g===t?Dd(o)?zd(o):Id(o):o.match(g)||[];}var Uc=xe(function(o,g){try{return Cr(o,t,g);}catch(b){return Xa(b)?b:new de(b);}}),uy=an(function(o,g){return Dr(g,function(b){b=Jr(b),sn(o,b,Ua(o[b],o));}),o;});function hy(o){var g=o==null?0:o.length,b=le();return o=g?He(o,function(k){if(typeof k[1]!="function")throw new Nr(c);return[b(k[0]),k[1]];}):[],xe(function(k){for(var et=-1;++et<g;){var lt=o[et];if(Cr(lt[0],this,k))return Cr(lt[1],this,k);}});}function dy(o){return Up(Wr(o,u));}function Ha(o){return function(){return o;};}function py(o,g){return o==null||o!==o?g:o;}var vy=zf(),gy=zf(!0);function xr(o){return o;}function ka(o){return mf(typeof o=="function"?o:Wr(o,u));}function my(o){return Pf(Wr(o,u));}function yy(o,g){return Sf(o,Wr(g,u));}var Py=xe(function(o,g){return function(b){return Bi(b,o,g);};}),Sy=xe(function(o,g){return function(b){return Bi(o,b,g);};});function Ka(o,g,b){var k=rr(g),et=As(g,k);b==null&&!(Ve(g)&&(et.length||!k.length))&&(b=g,g=o,o=this,et=As(g,rr(g)));var lt=!(Ve(b)&&"chain"in b)||!!b.chain,vt=fn(o);return Dr(et,function(It){var bt=g[It];o[It]=bt,vt&&(o.prototype[It]=function(){var Gt=this.__chain__;if(lt||Gt){var Ht=o(this.__wrapped__),Kt=Ht.__actions__=yr(this.__actions__);return Kt.push({func:bt,args:arguments,thisArg:o}),Ht.__chain__=Gt,Ht;}return bt.apply(o,yn([this.value()],arguments));});}),o;}function xy(){return ir._===this&&(ir._=Kd),this;}function Va(){}function Ty(o){return o=ye(o),xe(function(g){return xf(g,o);});}var Cy=Oa(He),Iy=Oa(zl),Oy=Oa(Jo);function Yc(o){return ba(o)?Qo(Jr(o)):e0(o);}function wy(o){return function(g){return o==null?t:Fn(o,g);};}var Ay=jf(),Ey=jf(!0);function Za(){return[];}function Ja(){return!1;}function My(){return{};}function Ly(){return"";}function Ry(){return!0;}function by(o,g){if(o=ye(o),o<1||o>at)return[];var b=Q,k=ar(o,Q);g=le(g),o-=Q;for(var et=ta(k,g);++b<o;)g(b);return et;}function Dy(o){return pe(o)?He(o,Jr):wr(o)?[o]:yr(sc(Le(o)));}function Ny(o){var g=++Hd;return Le(o)+g;}var By=Ds(function(o,g){return o+g;},0),Wy=wa("ceil"),Fy=Ds(function(o,g){return o/g;},1),Uy=wa("floor");function Yy(o){return o&&o.length?ws(o,xr,ua):t;}function Xy(o,g){return o&&o.length?ws(o,le(g,2),ua):t;}function zy(o){return Gl(o,xr);}function $y(o,g){return Gl(o,le(g,2));}function jy(o){return o&&o.length?ws(o,xr,va):t;}function Gy(o,g){return o&&o.length?ws(o,le(g,2),va):t;}var Hy=Ds(function(o,g){return o*g;},1),ky=wa("round"),Ky=Ds(function(o,g){return o-g;},0);function Vy(o){return o&&o.length?_o(o,xr):0;}function Zy(o,g){return o&&o.length?_o(o,le(g,2)):0;}return ot.after=mg,ot.ary=gc,ot.assign=im,ot.assignIn=Lc,ot.assignInWith=ks,ot.assignWith=sm,ot.at=om,ot.before=mc,ot.bind=Ua,ot.bindAll=uy,ot.bindKey=yc,ot.castArray=Mg,ot.chain=dc,ot.chunk=U0,ot.compact=Y0,ot.concat=X0,ot.cond=hy,ot.conforms=dy,ot.constant=Ha,ot.countBy=Vv,ot.create=am,ot.curry=Pc,ot.curryRight=Sc,ot.debounce=xc,ot.defaults=lm,ot.defaultsDeep=fm,ot.defer=yg,ot.delay=Pg,ot.difference=z0,ot.differenceBy=$0,ot.differenceWith=j0,ot.drop=G0,ot.dropRight=H0,ot.dropRightWhile=k0,ot.dropWhile=K0,ot.fill=V0,ot.filter=Jv,ot.flatMap=_v,ot.flatMapDeep=tg,ot.flatMapDepth=eg,ot.flatten=fc,ot.flattenDeep=Z0,ot.flattenDepth=J0,ot.flip=Sg,ot.flow=vy,ot.flowRight=gy,ot.fromPairs=Q0,ot.functions=gm,ot.functionsIn=mm,ot.groupBy=rg,ot.initial=_0,ot.intersection=tv,ot.intersectionBy=ev,ot.intersectionWith=rv,ot.invert=Pm,ot.invertBy=Sm,ot.invokeMap=ig,ot.iteratee=ka,ot.keyBy=sg,ot.keys=rr,ot.keysIn=Sr,ot.map=Xs,ot.mapKeys=Tm,ot.mapValues=Cm,ot.matches=my,ot.matchesProperty=yy,ot.memoize=$s,ot.merge=Im,ot.mergeWith=Rc,ot.method=Py,ot.methodOf=Sy,ot.mixin=Ka,ot.negate=js,ot.nthArg=Ty,ot.omit=Om,ot.omitBy=wm,ot.once=xg,ot.orderBy=og,ot.over=Cy,ot.overArgs=Tg,ot.overEvery=Iy,ot.overSome=Oy,ot.partial=Ya,ot.partialRight=Tc,ot.partition=ag,ot.pick=Am,ot.pickBy=bc,ot.property=Yc,ot.propertyOf=wy,ot.pull=ov,ot.pullAll=uc,ot.pullAllBy=av,ot.pullAllWith=lv,ot.pullAt=fv,ot.range=Ay,ot.rangeRight=Ey,ot.rearg=Cg,ot.reject=cg,ot.remove=cv,ot.rest=Ig,ot.reverse=Wa,ot.sampleSize=hg,ot.set=Mm,ot.setWith=Lm,ot.shuffle=dg,ot.slice=uv,ot.sortBy=gg,ot.sortedUniq=yv,ot.sortedUniqBy=Pv,ot.split=_m,ot.spread=Og,ot.tail=Sv,ot.take=xv,ot.takeRight=Tv,ot.takeRightWhile=Cv,ot.takeWhile=Iv,ot.tap=Yv,ot.throttle=wg,ot.thru=Ys,ot.toArray=Ac,ot.toPairs=Dc,ot.toPairsIn=Nc,ot.toPath=Dy,ot.toPlainObject=Mc,ot.transform=Rm,ot.unary=Ag,ot.union=Ov,ot.unionBy=wv,ot.unionWith=Av,ot.uniq=Ev,ot.uniqBy=Mv,ot.uniqWith=Lv,ot.unset=bm,ot.unzip=Fa,ot.unzipWith=hc,ot.update=Dm,ot.updateWith=Nm,ot.values=li,ot.valuesIn=Bm,ot.without=Rv,ot.words=Fc,ot.wrap=Eg,ot.xor=bv,ot.xorBy=Dv,ot.xorWith=Nv,ot.zip=Bv,ot.zipObject=Wv,ot.zipObjectDeep=Fv,ot.zipWith=Uv,ot.entries=Dc,ot.entriesIn=Nc,ot.extend=Lc,ot.extendWith=ks,Ka(ot,ot),ot.add=By,ot.attempt=Uc,ot.camelCase=Ym,ot.capitalize=Bc,ot.ceil=Wy,ot.clamp=Wm,ot.clone=Lg,ot.cloneDeep=bg,ot.cloneDeepWith=Dg,ot.cloneWith=Rg,ot.conformsTo=Ng,ot.deburr=Wc,ot.defaultTo=py,ot.divide=Fy,ot.endsWith=Xm,ot.eq=jr,ot.escape=zm,ot.escapeRegExp=$m,ot.every=Zv,ot.find=Qv,ot.findIndex=ac,ot.findKey=cm,ot.findLast=qv,ot.findLastIndex=lc,ot.findLastKey=um,ot.floor=Uy,ot.forEach=pc,ot.forEachRight=vc,ot.forIn=hm,ot.forInRight=dm,ot.forOwn=pm,ot.forOwnRight=vm,ot.get=$a,ot.gt=Bg,ot.gte=Wg,ot.has=ym,ot.hasIn=ja,ot.head=cc,ot.identity=xr,ot.includes=ng,ot.indexOf=q0,ot.inRange=Fm,ot.invoke=xm,ot.isArguments=Xn,ot.isArray=pe,ot.isArrayBuffer=Fg,ot.isArrayLike=Pr,ot.isArrayLikeObject=Qe,ot.isBoolean=Ug,ot.isBuffer=On,ot.isDate=Yg,ot.isElement=Xg,ot.isEmpty=zg,ot.isEqual=$g,ot.isEqualWith=jg,ot.isError=Xa,ot.isFinite=Gg,ot.isFunction=fn,ot.isInteger=Cc,ot.isLength=Gs,ot.isMap=Ic,ot.isMatch=Hg,ot.isMatchWith=kg,ot.isNaN=Kg,ot.isNative=Vg,ot.isNil=Jg,ot.isNull=Zg,ot.isNumber=Oc,ot.isObject=Ve,ot.isObjectLike=Ze,ot.isPlainObject=zi,ot.isRegExp=za,ot.isSafeInteger=Qg,ot.isSet=wc,ot.isString=Hs,ot.isSymbol=wr,ot.isTypedArray=ai,ot.isUndefined=qg,ot.isWeakMap=_g,ot.isWeakSet=tm,ot.join=nv,ot.kebabCase=jm,ot.last=Ur,ot.lastIndexOf=iv,ot.lowerCase=Gm,ot.lowerFirst=Hm,ot.lt=em,ot.lte=rm,ot.max=Yy,ot.maxBy=Xy,ot.mean=zy,ot.meanBy=$y,ot.min=jy,ot.minBy=Gy,ot.stubArray=Za,ot.stubFalse=Ja,ot.stubObject=My,ot.stubString=Ly,ot.stubTrue=Ry,ot.multiply=Hy,ot.nth=sv,ot.noConflict=xy,ot.noop=Va,ot.now=zs,ot.pad=km,ot.padEnd=Km,ot.padStart=Vm,ot.parseInt=Zm,ot.random=Um,ot.reduce=lg,ot.reduceRight=fg,ot.repeat=Jm,ot.replace=Qm,ot.result=Em,ot.round=ky,ot.runInContext=Et,ot.sample=ug,ot.size=pg,ot.snakeCase=qm,ot.some=vg,ot.sortedIndex=hv,ot.sortedIndexBy=dv,ot.sortedIndexOf=pv,ot.sortedLastIndex=vv,ot.sortedLastIndexBy=gv,ot.sortedLastIndexOf=mv,ot.startCase=ty,ot.startsWith=ey,ot.subtract=Ky,ot.sum=Vy,ot.sumBy=Zy,ot.template=ry,ot.times=by,ot.toFinite=cn,ot.toInteger=ye,ot.toLength=Ec,ot.toLower=ny,ot.toNumber=Yr,ot.toSafeInteger=nm,ot.toString=Le,ot.toUpper=iy,ot.trim=sy,ot.trimEnd=oy,ot.trimStart=ay,ot.truncate=ly,ot.unescape=fy,ot.uniqueId=Ny,ot.upperCase=cy,ot.upperFirst=Ga,ot.each=pc,ot.eachRight=vc,ot.first=cc,Ka(ot,function(){var o={};return Vr(ot,function(g,b){Ne.call(ot.prototype,b)||(o[b]=g);}),o;}(),{chain:!1}),ot.VERSION=r,Dr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){ot[o].placeholder=ot;}),Dr(["drop","take"],function(o,g){Ce.prototype[o]=function(b){b=b===t?1:tr(ye(b),0);var k=this.__filtered__&&!g?new Ce(this):this.clone();return k.__filtered__?k.__takeCount__=ar(b,k.__takeCount__):k.__views__.push({size:ar(b,Q),type:o+(k.__dir__<0?"Right":"")}),k;},Ce.prototype[o+"Right"]=function(b){return this.reverse()[o](b).reverse();};}),Dr(["filter","map","takeWhile"],function(o,g){var b=g+1,k=b==N||b==J;Ce.prototype[o]=function(et){var lt=this.clone();return lt.__iteratees__.push({iteratee:le(et,3),type:b}),lt.__filtered__=lt.__filtered__||k,lt;};}),Dr(["head","last"],function(o,g){var b="take"+(g?"Right":"");Ce.prototype[o]=function(){return this[b](1).value()[0];};}),Dr(["initial","tail"],function(o,g){var b="drop"+(g?"":"Right");Ce.prototype[o]=function(){return this.__filtered__?new Ce(this):this[b](1);};}),Ce.prototype.compact=function(){return this.filter(xr);},Ce.prototype.find=function(o){return this.filter(o).head();},Ce.prototype.findLast=function(o){return this.reverse().find(o);},Ce.prototype.invokeMap=xe(function(o,g){return typeof o=="function"?new Ce(this):this.map(function(b){return Bi(b,o,g);});}),Ce.prototype.reject=function(o){return this.filter(js(le(o)));},Ce.prototype.slice=function(o,g){o=ye(o);var b=this;return b.__filtered__&&(o>0||g<0)?new Ce(b):(o<0?b=b.takeRight(-o):o&&(b=b.drop(o)),g!==t&&(g=ye(g),b=g<0?b.dropRight(-g):b.take(g-o)),b);},Ce.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse();},Ce.prototype.toArray=function(){return this.take(Q);},Vr(Ce.prototype,function(o,g){var b=/^(?:filter|find|map|reject)|While$/.test(g),k=/^(?:head|last)$/.test(g),et=ot[k?"take"+(g=="last"?"Right":""):g],lt=k||/^find/.test(g);et&&(ot.prototype[g]=function(){var vt=this.__wrapped__,It=k?[1]:arguments,bt=vt instanceof Ce,Gt=It[0],Ht=bt||pe(vt),Kt=function Kt(Te){var Oe=et.apply(ot,yn([Te],It));return k&&_t?Oe[0]:Oe;};Ht&&b&&typeof Gt=="function"&&Gt.length!=1&&(bt=Ht=!1);var _t=this.__chain__,re=!!this.__actions__.length,fe=lt&&!_t,Se=bt&&!re;if(!lt&&Ht){vt=Se?vt:new Ce(this);var ce=o.apply(vt,It);return ce.__actions__.push({func:Ys,args:[Kt],thisArg:t}),new Br(ce,_t);}return fe&&Se?o.apply(this,It):(ce=this.thru(Kt),fe?k?ce.value()[0]:ce.value():ce);});}),Dr(["pop","push","shift","sort","splice","unshift"],function(o){var g=us[o],b=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",k=/^(?:pop|shift)$/.test(o);ot.prototype[o]=function(){var et=arguments;if(k&&!this.__chain__){var lt=this.value();return g.apply(pe(lt)?lt:[],et);}return this[b](function(vt){return g.apply(pe(vt)?vt:[],et);});};}),Vr(Ce.prototype,function(o,g){var b=ot[g];if(b){var k=b.name+"";Ne.call(ri,k)||(ri[k]=[]),ri[k].push({name:g,func:b});}}),ri[bs(t,I).name]=[{name:"wrapper",func:t}],Ce.prototype.clone=fp,Ce.prototype.reverse=cp,Ce.prototype.value=up,ot.prototype.at=Xv,ot.prototype.chain=zv,ot.prototype.commit=$v,ot.prototype.next=jv,ot.prototype.plant=Hv,ot.prototype.reverse=kv,ot.prototype.toJSON=ot.prototype.valueOf=ot.prototype.value=Kv,ot.prototype.first=ot.prototype.head,Ei&&(ot.prototype[Ei]=Gv),ot;},_n=$d();bn?((bn.exports=_n)._=_n,ko._=_n):ir._=_n;}).call(hn);})(ao,ao.exports);ao.exports;var Qs=5,An=/*#__PURE__*/function(_$t13){function An(t){var _this84;_classCallCheck(this,An);_this84=_callSuper(this,An,[t]);dt(_this84,"canRotate",!1);dt(_this84,"scaleType",Ae.proportional);dt(_this84,"toolsType",Tt.Text);dt(_this84,"tmpPoints",[]);dt(_this84,"workOptions");dt(_this84,"oldRect");_this84.workOptions=t.toolsOpt;return _this84;}_inherits(An,_$t13);return _createClass(An,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var r,n,s,c,_this$workOptions16,l,f,h,m,u,y,T,E,C,x,_I49,_d42,v;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:r=t.workId,n=t.layer,s=t.isDrawLabel,c=t.boxRect,_this$workOptions16=this.workOptions,l=_this$workOptions16.boxSize,f=_this$workOptions16.boxPoint,h=_this$workOptions16.zIndex,m=n.worldPosition,u=n.worldScaling;if(!(!f||!l)){_context26.next=3;break;}return _context26.abrupt("return");case 3:y={name:r,id:r,pos:[f[0]-Qs,f[1]-Qs],anchor:[0,0],size:l,zIndex:h},T=new mr(y),E={x:f[0]-Qs,y:f[1]-Qs,w:l[0],h:l[1]},C={x:Math.floor(E.x*u[0]+m[0]),y:Math.floor(E.y*u[1]+m[1]),w:Math.floor(E.w*u[0])+2,h:Math.floor(E.h*u[1])+2};this.replace(n,r,T);if(!(c&&(x=Zi(C,c)),(s||c&&x!==Tr.outside)&&n&&this.workOptions.text)){_context26.next=12;break;}_context26.next=8;return An.createLabels(this.workOptions,n,C);case 8:_I49=_context26.sent;_d42=_I49.labels;v=_I49.maxWidth;T.append.apply(T,_toConsumableArray(_d42)),C.w=Math.ceil(Math.max(v*n.worldScaling[0],C.w));case 12:return _context26.abrupt("return",C);case 13:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x51){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var m,u,y,T,r,n,s,c,l,f,h;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:r=(m=this.workId)==null?void 0:m.toString();if(r){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,s=t.replaceId,c=t.isDrawLabel,l=t.boxRect;this.oldRect=s&&((y=(u=this.vNodes)==null?void 0:u.get(s))==null?void 0:y.rect)||void 0;f=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:r,layer:f,isDrawLabel:_typeof(c)>"u"&&this.workOptions.workState===te.Done||c,boxRect:l});case 8:h=_context27.sent;return _context27.abrupt("return",((T=this.vNodes)==null||T.setInfo(r,{rect:h,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:h&&$t.getCenterPos(h,f)}),h));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x52){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,r,n){var C,x,s,c,l,f,h,m,u,y,T,E;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:s=this.workId.toString(),c=t.fontColor,l=t.fontBgColor,f=t.bold,h=t.italic,m=t.lineThrough,u=t.underline,y=t.zIndex,T=(C=this.vNodes)==null?void 0:C.get(s);if(T){_context28.next=5;break;}return _context28.abrupt("return");case 5:c&&(T.opt.fontColor=c),l&&(T.opt.fontBgColor=l),f&&(T.opt.bold=f),h&&(T.opt.italic=h),hi(m)&&(T.opt.lineThrough=m),hi(u)&&(T.opt.underline=u),er(y)&&(T.opt.zIndex=y),this.oldRect=T.rect;_context28.next=8;return this.draw({workId:s,layer:this.fullLayer,isDrawLabel:_typeof(r)>"u"&&this.workOptions.workState===te.Done||r,boxRect:n});case 8:E=_context28.sent;return _context28.abrupt("return",((x=this.vNodes)==null||x.setInfo(s,{rect:E,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:E&&$t.getCenterPos(E,this.fullLayer)}),E));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x53,_x54,_x55){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(t){var r=(t==null?void 0:t.parent).displayRatio||1,n=Math.ceil(t.worldScaling[0]*10)/10;var s=n;return n<=2?s=n*r*2:n>2&&n<=3?s=n*r*1.6:n>3&&n<=4?s=n*r*1.2:n>4&&(s=n*r),Math.floor(s*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(An.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,r,n){var W,s,c,l,_ref168,f,h,m,u,y,T,E,C,x,I,d,v,p,S,A,R,D,U,M,Y,B,N,G,J,tt,at,ut,K,Q,ft,mt,wt,ht,Nt,Rt,X,z,q,nt,gt,_ht2,_Nt,_Rt,_ht3,_Nt2,_mt3,_wt2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:s=[],c=n.x,l=n.y,_ref168=(W=r.parent)==null?void 0:W.parent,f=_ref168.width,h=_ref168.height,m=yi(t.text),u=m.length,y=t.fontSize,T=t.lineHeight,E=t.bold,C=t.textAlign,x=t.italic,I=t.fontFamily,d=t.verticalAlign,v=t.fontColor,p=t.fontBgColor,S=t.underline,A=t.lineThrough,R=An.getSafetySnippetRatio(r)||1,D=Math.floor(y*R),U=An.getSafetySnippetFontLength(D);M=0;Y=0;case 3:if(!(Y<u)){_context29.next=33;break;}B=m[Y],N=T||D*1.5;if(!B){_context29.next=30;break;}G=sE(B),J=[0,0],tt=[0,y*1.2];d==="middle"&&(J[1]=Math.floor(Y*y*1.2+6+y*(1.1-1)));at=[0,Math.floor(-y*0.15)];J[0]=6;ut=Math.sin(Math.PI/180*20);K=0;Q=[];ft=0;case 14:if(!(ft<G)){_context29.next=27;break;}C==="left"&&(at[0]=K),ft===0&&x==="italic"&&(at[0]=at[0]-ut/2*y);mt=B.slice(ft,ft+U);wt={anchor:[0,0],pos:at,text:mt,fontFamily:I,fontSize:D,lineHeight:N,strokeColor:v,fontWeight:E,fillColor:v,textAlign:C,fontStyle:x,scale:[1/R,1/R]};ht=new _y(wt);_context29.next=21;return ht.textImageReady;case 21:Nt=_context29.sent;Rt=!0;if(Nt){X=Nt.rect&&Nt.rect[2],z=Nt.rect&&Nt.rect[3];if(X&&z){q=X/R,nt=z/R;K=q+K,x==="italic"&&(E==="bold"?K=K-ut*y*1.2:K=K-ut*y),((at[0]+J[0]+q)*r.worldScaling[0]+c<=0||(at[0]+J[0])*r.worldScaling[0]+c>=f||(at[1]+J[1]+nt)*r.worldScaling[1]+l<=0||(at[1]+J[1])*r.worldScaling[1]+l>=h)&&(ht.disconnect(),Rt=!1),Rt&&Q.push(ht);}}ft+=U;case 25:_context29.next=14;break;case 27:tt[0]=K,x==="italic"&&(tt[0]=tt[0]+ut*y),M=Math.max(M,tt[0]);gt=!0;if(((J[0]+tt[0])*r.worldScaling[0]+c<=0||J[0]*r.worldScaling[0]+c>=f||(J[1]+tt[1])*r.worldScaling[0]+l<=0||J[1]*r.worldScaling[1]+l>=h)&&(gt=!1),gt){if(S){_ht2=Math.floor(y/10),_Nt={normalize:!1,pos:[0,y*1.1+_ht2/2],lineWidth:_ht2,points:[0,0,Math.ceil(tt[0]),0],strokeColor:v,className:"underline"},_Rt=new dn(_Nt);Q.push(_Rt);}if(A){_ht3={normalize:!1,pos:[0,y*1.2/2],lineWidth:Math.floor(y/10),points:[0,0,Math.ceil(tt[0]),0],strokeColor:v,className:"lineThrough"},_Nt2=new dn(_ht3);Q.push(_Nt2);}_mt3={pos:J,anchor:[0,0],size:tt,bgcolor:p},_wt2=new mr(_mt3);_wt2.append.apply(_wt2,Q),s.push(_wt2);}case 30:Y++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:s,maxWidth:M});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x56,_x57,_x58){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.fontBgColor,f=n.fontColor,h=n.translate,m=n.originPoint,u=n.scenePoint,y=n.scale,T=n.bold,E=n.italic,C=n.lineThrough,x=n.underline,I=n.fontSize,d=n.textInfos,v=n.zIndex,p=c&&fr(c)||s.get(r.name);if(!p||!r.parent)return;var A=p.opt;if(er(v)&&(r.setAttribute("zIndex",v),p.opt.zIndex=v),f&&A.fontColor&&(A.fontColor=f,r.children.forEach(function(R){R.tagName==="GROUP"&&R.children.forEach(function(D){D.tagName==="LABEL"?(D.setAttribute("fillColor",f),D.setAttribute("strokeColor",f)):D.tagName==="POLYLINE"&&D.setAttribute("strokeColor",f);});})),l&&A.fontBgColor&&(A.fontBgColor=l,r.children.forEach(function(R){R.tagName==="GROUP"&&R.setAttribute("bgcolor",l);})),T&&(A.bold=T),E&&(A.italic=E),hi(C)&&(A.lineThrough=C),hi(x)&&(A.underline=x),I&&(A.fontSize=I),m&&u&&y&&c&&A.boxPoint){var R=d==null?void 0:d.get(r.name);if(R){var W=R.fontSize,Y=R.boxSize;A.boxSize=Y||A.boxSize,A.fontSize=W||A.fontSize;}var D=[A.boxPoint[0],A.boxPoint[1]];Ll(A.boxPoint,u,y,h);var U=[p.op[0],p.op[1]],M=[U[0]-D[0],U[1]-D[1]];if(p.centerPos=[p.centerPos[0]+M[0],p.centerPos[1]+M[1]],p.opt.eraserlines){var _iterator33=_createForOfIteratorHelper(p.opt.eraserlines),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _W19=_step33.value;var _Y9=_W19.op,B=_W19.thickness;_W19.thickness=Math.round(B*Math.max(y[0],y[1]));for(var N=0;N<_Y9.length;N++)Rl(_Y9[N],u,y,h);}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}}else if(h&&A.boxPoint&&(A.boxPoint=[Math.round(A.boxPoint[0]+h[0]),Math.round(A.boxPoint[1]+h[1])],p.centerPos=[p.centerPos[0]+h[0],p.centerPos[1]+h[1]],p.opt.eraserlines)){var _iterator34=_createForOfIteratorHelper(p.opt.eraserlines),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _R5=_step34.value;var _D5=_R5.op;for(var _U24=0;_U24<_D5.length;_U24++){var _M21=_D5[_U24].map(function(W,Y){return Y%2?W+h[1]:W+h[0];});_R5.op[_U24]=_M21;}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}return p&&s.setInfo(r.name,p),p==null?void 0:p.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,r){var n=t.getElementsByName(r)[0];if(n){var s=n.getBoundingClientRect();var c={x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)};return n.children.forEach(function(l){if(l.tagName==="GROUP"){var f=n.getBoundingClientRect();c=Zt(c,{x:Math.floor(f.x),y:Math.floor(f.y),w:Math.floor(f.width+2),h:Math.floor(f.height+2)});}}),c;}}}]);}($t);// 4k
480
+ dt(An,"textImageSnippetSize",1024*4),dt(An,"SafeBorderPadding",30);var Ki=An;var vi=/*#__PURE__*/function(_$t14){function vi(t){var _this85;_classCallCheck(this,vi);_this85=_callSuper(this,vi,[t]);dt(_this85,"canRotate",!1);dt(_this85,"scaleType",Ae.none);dt(_this85,"toolsType",Tt.PencilEraser);dt(_this85,"tmpPoints",[]);dt(_this85,"workOptions");dt(_this85,"worldPosition");dt(_this85,"worldScaling");dt(_this85,"eraserRect");dt(_this85,"eraserPolyline");_this85.workOptions=t.toolsOpt,_this85.worldPosition=_this85.fullLayer.worldPosition,_this85.worldScaling=_this85.fullLayer.worldScaling;return _this85;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(vi,_$t14);return _createClass(vi,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:xt.None};var n=this.workOptions.thickness,_vi$eraserSizes$n=vi.eraserSizes[n],s=_vi$eraserSizes$n.width,c=_vi$eraserSizes$n.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes=this.getChangeNodes(l,r),f=_this$getChangeNodes.rect,h=_this$getChangeNodes.willNewNodes,m=_this$getChangeNodes.willDeleteNodes;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,rect:f,willNewNodes:h,willDeleteNodes:m});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var c=0;c<t.length;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var h=l-1,m=this.tmpPoints[h],u=pt.Sub(f,m).uni();f.isNear(m,r/2)||(pt.Equals(u,m.v,0.02)&&(this.tmpPoints.pop(),n--),f.setv(u),f.setT(s),this.tmpPoints.push(f));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var c;if(!this.vNodes)return{willDeleteNodes:s,willNewNodes:n,rect:c};var l=this.worldPosition;var f=Re(this.tmpPoints,t);f=Vi(f,l),f=Kh(f,this.worldScaling,l);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(f),h=_this$vNodes$getRectI3.nodeRange;if(!h.size)return{willDeleteNodes:s,willNewNodes:n,rect:c};var m=this.computEraserPointLines(this.tmpPoints,90);var _iterator35=_createForOfIteratorHelper(h.entries()),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _step35$value=_slicedToArray(_step35.value,2),u=_step35$value[0],y=_step35$value[1];if(y.toolsType!==Tt.Pencil)continue;var T=Vi(y.rect,[-l[0],-l[1]]);T={x:T.x/this.worldScaling[0],y:T.y/this.worldScaling[1],w:T.w/this.worldScaling[0],h:T.h/this.worldScaling[1]};var E=[T.x,T.y,T.x+T.w,T.y+T.h],C=[],x=[];var _iterator36=_createForOfIteratorHelper(m),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _I52=_step36.value;Il.polyline(_I52,E,C);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}if(C.length&&y.opt){var _iterator37=_createForOfIteratorHelper(C),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _I50=_step37.value;var _d43=[];for(var v=0;v<_I50.length;v++)v!==0&&qr(_I50[v],_I50[v-1])||_d43.push.apply(_d43,_toConsumableArray(_I50[v]));x.push(_d43);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}if(x.length&&r){var _I51=r.createWorkShapeNode({workId:u,toolsType:Tt.Pencil,toolsOpt:y.opt});_I51.setWorkId(u);var _d44=_I51==null?void 0:_I51.computPencilPoints({op:y.op,eraserPolylines:x,eraserThickness:t});if(c=Zt(c,y.rect),s.add(u),r.removeNode(u),_d44.length)for(var _v13=0;_v13<_d44.length;_v13++){var p="".concat(u,"_").concat(Date.now(),"_").concat(_v13),S=p,R=r.setFullWork({workId:S,opt:y.opt,toolsType:Tt.Pencil}).consumeService({op:_d44[_v13],isFullWork:!0,replaceId:S});r.clearWorkShapeNodeCache(S),c=Zt(c,R),n.set(p,_objectSpread(_objectSpread({},y),{},{toolsType:Tt.Pencil,rect:R!==null&&R!==void 0?R:y.rect,name:p,op:_d44[_v13]}));}}}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}return{willNewNodes:n,willDeleteNodes:s,rect:c};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:xt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_vi$eraserSizes$s=vi.eraserSizes[s],c=_vi$eraserSizes$s.width,l=_vi$eraserSizes$s.height,f=Math.max(c,l)/this.worldScaling[0];return this.updateTempPoints(n,f),_objectSpread({type:xt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var s=0;var c=360-r;for(var l=1;l<t.length;l++){var f=t[l-1],h=t[l];if(l===1&&s===0&&(n[s]=[f.XY]),n[s].push(h.XY),l<t.length-1){var m=h.getAngleByPoints(f,t[l+1]);(m<r||m>c)&&(s++,n[s]=[h.XY]);}}return t.length===1&&n.length===0&&n.push([t[0].XY,t[0].XY]),n;}},{key:"consumeAll",value:function consumeAll(t){var r=t.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:xt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_vi$eraserSizes$n2=vi.eraserSizes[n],s=_vi$eraserSizes$n2.width,c=_vi$eraserSizes$n2.height,l=Math.max(s,c)/this.worldScaling[0],_this$getChangeNodes2=this.getChangeNodes(l,r),f=_this$getChangeNodes2.willDeleteNodes,h=_this$getChangeNodes2.willNewNodes,m=_this$getChangeNodes2.rect;if(f.size===0&&h.size===0)return _objectSpread(_objectSpread({type:xt.FullWork},this.baseConsumeResult),{},{rect:m});var u=[];this.tmpPoints.map(function(T){u.push(T.x,T.y,l/2);});var y=gr(u);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Vt.Local,rect:m,ops:y,willNewNodes:h,willDeleteNodes:f});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}($t);// 来源于white-sdk
481
+ dt(vi,"eraserSizes",Tl);var lo=vi;var gi=/*#__PURE__*/function(_$t15){function gi(t){var _this86;_classCallCheck(this,gi);_this86=_callSuper(this,gi,[t]);dt(_this86,"canRotate",!1);dt(_this86,"scaleType",Ae.none);dt(_this86,"toolsType",Tt.BitMapEraser);dt(_this86,"tmpPoints",[]);dt(_this86,"workOptions");dt(_this86,"worldPosition");dt(_this86,"worldScaling");dt(_this86,"eraserRect");dt(_this86,"eraserPolyline");dt(_this86,"oldRect");_this86.workOptions=t.toolsOpt,_this86.worldPosition=_this86.fullLayer.worldPosition,_this86.worldScaling=_this86.fullLayer.worldScaling;return _this86;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(gi,_$t15);return _createClass(gi,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:xt.None};var n=this.workOptions.thickness,_gi$eraserSizes$n=gi.eraserSizes[n],s=_gi$eraserSizes$n.width,c=_gi$eraserSizes$n.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes3=this.getChangeNodes(l,r),f=_this$getChangeNodes3.willDeleteNodes,h=_this$getChangeNodes3.rect;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,rect:h,willDeleteNodes:f});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var c=0;c<t.length;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var h=l-1,m=this.tmpPoints[h],u=pt.Sub(f,m).uni();f.isNear(m,r/2)||(pt.Equals(u,m.v,0.02)&&(this.tmpPoints.pop(),n--),f.setv(u),f.setT(s),this.tmpPoints.push(f));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var _this87=this;var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var c;if(!this.vNodes)return{willDeleteNodes:s,willUpdateNodes:n,rect:c};var l=this.worldPosition;var f=Re(this.tmpPoints,t);f=Vi(f,l),f=Kh(f,this.worldScaling,l);var _this$vNodes$getRectI4=this.vNodes.getRectIntersectRange(f),h=_this$vNodes$getRectI4.nodeRange;if(!h.size)return{willDeleteNodes:s,willUpdateNodes:n,rect:c};var m=this.computEraserPointLines(this.tmpPoints,120);var _iterator38=_createForOfIteratorHelper(h.entries()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _step38$value=_slicedToArray(_step38.value,2),u=_step38$value[0],y=_step38$value[1];if(y.toolsType===Tt.Text||y.toolsType===Tt.Image)continue;var T=Vi(y.rect,[-l[0],-l[1]]);T={x:T.x/this.worldScaling[0],y:T.y/this.worldScaling[1],w:T.w/this.worldScaling[0],h:T.h/this.worldScaling[1]};var E=[T.x,T.y,T.x+T.w,T.y+T.h],C=[],x=[];var _iterator39=_createForOfIteratorHelper(m),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _v15=_step39.value;Il.polyline(_v15,E,C);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}if(C.length&&y.opt){var _iterator40=_createForOfIteratorHelper(C),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var v=_step40.value;var p=[];for(var S=0;S<v.length&&!(isNaN(v[S][0])||isNaN(v[S][1]));S++){var A=v[S].map(function(R){return Math.round(R*100)/100;});if(S!==0){var R=v[S-1].map(function(D){return Math.round(D*100)/100;});if(qr(A,R))continue;}p.push.apply(p,_toConsumableArray(A));}p.length!==0&&x.push(p);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}if(!x.length)continue;var _I53=y.opt.eraserlines?y.opt.eraserlines:[],_d45=_I53.find(function(v){return v.workId===_this87.workId;});if(_d45?_d45.op=x:_I53.push({workId:this.workId,op:x,thickness:t}),y.opt.eraserlines=_I53,r){var _v14=y.toolsType,_p16=r.createWorkShapeNode({workId:u,toolsType:_v14,toolsOpt:y.opt});_p16==null||_p16.setWorkId(u);var _S14=_p16==null?void 0:_p16.consumeService({op:y.op,isFullWork:!0,replaceId:u});if(c=Zt(c,_S14),_p16!=null&&_p16.isDelete){r.removeNode(u),s.add(u);continue;}}n.set(u,y);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return{willUpdateNodes:n,willDeleteNodes:s,rect:c};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:xt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_gi$eraserSizes$s=gi.eraserSizes[s],c=_gi$eraserSizes$s.width,l=_gi$eraserSizes$s.height,f=Math.round(Math.max(c,l)/this.worldScaling[0]);return this.updateTempPoints(n,f),_objectSpread({type:xt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var s=0;var c=360-r;for(var l=1;l<t.length;l++){var f=t[l-1],h=t[l];if(l===1&&s===0&&(n[s]=[f.XY]),n[s].push(h.XY),l<t.length-1){var m=h.getAngleByPoints(f,t[l+1]);(m<r||m>c)&&(s++,n[s]=[h.XY]);}}return t.length===1&&n.length===0&&n.push([t[0].XY,t[0].XY]),n;}},{key:"consumeAll",value:function consumeAll(t){var r=t.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:xt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_gi$eraserSizes$n2=gi.eraserSizes[n],s=_gi$eraserSizes$n2.width,c=_gi$eraserSizes$n2.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes4=this.getChangeNodes(l,r),f=_this$getChangeNodes4.willDeleteNodes,h=_this$getChangeNodes4.willUpdateNodes,m=_this$getChangeNodes4.rect;if(f.size===0&&h.size===0)return _objectSpread(_objectSpread({type:xt.FullWork},this.baseConsumeResult),{},{rect:m});var u=[];this.tmpPoints.map(function(T){u.push(T.x,T.y,l/2);});var y=gr(u);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Vt.Local,rect:m,ops:y,willUpdateNodes:h,willDeleteNodes:f});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}($t);// 来源于white-sdk
482
+ dt(gi,"eraserSizes",Tl);var fo=gi;function Gh(i){switch(i){case Tt.Arrow:return Ch;case Tt.Pencil:return Ph;case Tt.Straight:return Mh;case Tt.Ellipse:return Ih;case Tt.Polygon:case Tt.Triangle:return Ah;case Tt.Star:case Tt.Rhombus:return wh;case Tt.Rectangle:return Oh;case Tt.SpeechBalloon:return Eh;case Tt.Text:return Ki;case Tt.LaserPen:return Sh;case Tt.Eraser:return io;case Tt.PencilEraser:return lo;case Tt.BitMapEraser:return fo;case Tt.Selector:return Gi;case Tt.Image:return Hi;}}function To(i,e){var t=i.toolsType,r=_objectWithoutProperties(i,_excluded);switch(t){case Tt.Arrow:return new Ch(r);case Tt.Pencil:return new Ph(r);case Tt.Straight:return new Mh(r);case Tt.Ellipse:return new Ih(r);case Tt.Polygon:case Tt.Triangle:return new Ah(r);case Tt.Star:case Tt.Rhombus:return new wh(r);case Tt.Rectangle:return new Oh(r);case Tt.SpeechBalloon:return new Eh(r);case Tt.Text:return new Ki(r);case Tt.LaserPen:return new Sh(r);case Tt.Eraser:return new io(r,e);case Tt.BitMapEraser:return new fo(r);case Tt.PencilEraser:return new lo(r);case Tt.Selector:return r.vNodes?new Gi(_objectSpread(_objectSpread({},r),{},{vNodes:r.vNodes,drawLayer:r.fullLayer})):void 0;case Tt.Image:return new Hi(r);default:return;}}function Hh(i){var e=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator41=_createForOfIteratorHelper(i),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var r=_step41.value;if(r.tagName==="GROUP"&&r.children.length){var n=Hh(r.children);e.push.apply(e,_toConsumableArray(n));}r.tagName&&t.includes(r.tagName)&&e.push(r);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return e;}function Zt(i,e){if(i&&e){var t=Math.min(i.x,e.x),r=Math.min(i.y,e.y),n=Math.max(i.x+i.w,e.x+e.w),s=Math.max(i.y+i.h,e.y+e.h),c=n-t,l=s-r;return{x:t,y:r,w:c,h:l};}return e||i;}function Re(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var r=1/0,n=1/0,s=-1/0,c=-1/0;return i.forEach(function(l){var _l$XY=_slicedToArray(l.XY,2),f=_l$XY[0],h=_l$XY[1];r=Math.min(r,f-e),n=Math.min(n,h-e),s=Math.max(s,f+e),c=Math.max(c,h+e);}),t.x=r,t.y=n,t.w=s-r,t.h=c-n,t;}function fl(i,e){return!(i.x+i.w<e.x||i.x>e.x+e.w||i.y+i.h<e.y||i.y>e.y+e.h);}function ve(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(i.x-e),y:Math.floor(i.y-e),w:Math.ceil(i.w+e*2),h:Math.ceil(i.h+e*2)};}function Vi(i,e){return{x:i.x+e[0],y:i.y+e[1],w:i.w,h:i.h};}function ZA(i,e){var t=new pt(i.x,i.y),r=new pt(i.x+i.w,i.y),n=new pt(i.x+i.w,i.y+i.h),s=new pt(i.x,i.y+i.h),c=new pt(i.x+i.w/2,i.y+i.h/2),l=Math.PI*e/180,f=pt.RotWith(t,c,l),h=pt.RotWith(r,c,l),m=pt.RotWith(n,c,l),u=pt.RotWith(s,c,l);return[f,h,m,u];}function kh(i,e){var t=ZA(i,e);return Re(t);}function Kh(i,e,t){var r=new pt(i.x,i.y),n=new pt(i.x+i.w,i.y),s=new pt(i.x+i.w,i.y+i.h),c=new pt(i.x,i.y+i.h),l=new pt(t[0],t[1]),f=new pt(e[0],e[1]),h=pt.ScaleWOrigin(r,f,l),m=pt.ScaleWOrigin(n,f,l),u=pt.ScaleWOrigin(s,f,l),y=pt.ScaleWOrigin(c,f,l);return Re([h,m,u,y]);}function JA(i,e,t){var r=new pt(e[0],e[1]);for(var n=0;n<i.length;n+=3){var s=new pt(i[n],i[n+1]),c=Math.PI*t/180,l=pt.RotWith(s,r,c);i[n]=l.x,i[n+1]=l.y;}}function QA(i,e,t){var r=new pt(e[0],e[1]);for(var n=0;n<i.length;n+=2){var s=new pt(i[n],i[n+1]),c=Math.PI*t/180,l=pt.RotWith(s,r,c);i[n]=l.x,i[n+1]=l.y;}}function Ll(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new pt(e[0],e[1]);for(var s=0;s<i.length;s+=3){var c=new pt(i[s],i[s+1]),l=new pt(t[0],t[1]),f=pt.ScaleWOrigin(c,l,n);i[s]=f.x+r[0],i[s+1]=f.y+r[1];}}function Rl(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new pt(e[0],e[1]);for(var s=0;s<i.length;s+=2){var c=new pt(i[s],i[s+1]),l=new pt(t[0],t[1]),f=pt.ScaleWOrigin(c,l,n);i[s]=f.x+r[0],i[s+1]=f.y+r[1];}}function qA(i,e){return i[0]>=e.x&&i[0]<=e.x+e.w&&i[1]>=e.y&&i[1]<=e.y+e.h;}function Vh(i,e){var t=i<=e?1:i/e,r=e<=i?1:e/i;return[t,r];}function _A(i){var _iterator42=_createForOfIteratorHelper(i),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _e3=_step42.value;if(isNaN(_e3)||_e3===1/0||_e3===-1/0)return!1;}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return!0;}function tE(i){return i!==Math.floor(i);}function eE(i){var e=i.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0;}function rE(i,e){for(;e!==0;){var _ref169=[e,i%e];i=_ref169[0];e=_ref169[1];}return i;}var nE=function nE(i){if(i.tagName==="GROUP"){var _e4=Object.getOwnPropertySymbols(i).find(function(t){return t.toString()==="Symbol(sealed)";});if(_e4&&i[_e4])return!0;}return!1;},_pr=function pr(i,e){if(i.mesh&&i.mesh.texture&&i.name==="eraserTexture"){var t=i.mesh.texture.image;e.deleteTexture(t);}else if(i.tagName==="GROUP"&&i&&i.children){var _iterator43=_createForOfIteratorHelper(i.children),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _t3=_step43.value;_pr(_t3,e);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}},Lr=function Lr(i,e){_pr(i,e),i.removeAllChildren();},iE=function iE(i,e,t){var r=t.parent;if(e){var n=e.children;if(n){var _iterator44=_createForOfIteratorHelper(n),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var s=_step44.value;if(_pr(s,r),s.tagName==="GROUP"){var _iterator45=_createForOfIteratorHelper(s.children),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var c=_step45.value;_pr(c,r);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}}e.parent.replaceChild(i,e);},Zh=function Zh(i,e,t){if(i.w+i.x<=0||i.h+i.y<=0||i.w<=0||i.h<=0)return;var r=e.width,n=e.height,s={x:Math.floor(Math.max(0,i.x)),y:Math.floor(Math.max(0,i.y)),w:Math.floor(Math.min(r,i.w)),h:Math.floor(Math.min(n,i.h))};if(s.x+s.w>r&&(s.w=Math.floor(r-s.x)),s.y+s.h>n&&(s.h=Math.floor(n-s.y)),tE(t)){var c=eE(t),l=Math.pow(10,c),f=rE(l,t*l),h=s.x%f,m=s.x-h;m>=0?(s.x=m,s.w=s.w+h):(s.x=0,s.w=s.w+h-m);var u=s.y%f,y=s.y-u;y>=0?(s.y=y,s.h=s.h+u):(s.y=0,s.h=s.h+u-y);}return s;};function fi(i){return"".concat(co(i.x),",").concat(co(i.y)," ");}function ci(i,e){return"".concat(co((i.x+e.x)/2),",").concat(co((i.y+e.y)/2)," ");}function co(i){return+i.toFixed(4);}var Zi=function Zi(i,e){return i.x+i.w<e.x||i.x>e.x+e.w||i.y+i.h<e.y||i.y>e.y+e.h?Tr.outside:i.x>=e.x&&i.y>=e.y&&i.x+i.w<=e.x+e.w&&i.y+i.h<=e.y+e.h?Tr.inside:Tr.intersect;};function sE(i){var e=0;for(var t=0;t<i.length;t++){var r=i.charCodeAt(t);r>=1&&r<=126||65376<=r&&r<=65439?e++:e+=2;}return e;}var oE=/*#__PURE__*/function(){function oE(e,t){_classCallCheck(this,oE);dt(this,"viewId");dt(this,"scene");dt(this,"fullLayer");dt(this,"curNodeMap",/* @__PURE__ */new Map());dt(this,"targetNodeMap",[]);dt(this,"highLevelIds");dt(this,"canClearUids");dt(this,"localUid");this.viewId=e,this.scene=t;}return _createClass(oE,[{key:"init",value:function init(e){this.fullLayer=e;}},{key:"get",value:function get(e){return this.curNodeMap.get(e);}},{key:"setLocalUid",value:function setLocalUid(e){this.localUid=e;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setCanClearUids",value:function setCanClearUids(e){this.canClearUids=e;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(e,t){var r=/* @__PURE__ */new Map();var _iterator46=_createForOfIteratorHelper(e.entries()),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var _step46$value=_slicedToArray(_step46.value,2),n=_step46$value[0],s=_step46$value[1];s.toolsType===Tt.Image&&(s.opt.locked||t&&t.disableEraseImage)||s.toolsType===Tt.Text&&(s.opt.workState===te.Doing||s.opt.workState===te.Start||t&&t.disableEraseText)||this.isCanClearWorkId(n)&&r.set(n,s);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}return r;}},{key:"getNodesByType",value:function getNodesByType(e){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(r,n){r.toolsType===e&&t.set(n,r);}),t;}},{key:"gethasEraserNodes",value:function gethasEraserNodes(){var e=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(t,r){var n;(n=t.opt.eraserlines)!=null&&n.length&&e.set(r,t);}),e;}},{key:"hasRenderNodes",value:function hasRenderNodes(){return!0;}},{key:"has",value:function has(e){return this.curNodeMap.has(e);}},{key:"setInfo",value:function setInfo(e,t){var r=this.curNodeMap.get(e)||{name:e,rect:t.rect};t.rect&&(r.rect=fr(t.rect)),t.op&&_A(t.op)&&(r.op=fr(t.op)),t.canRotate&&(r.canRotate=t.canRotate),t.scaleType&&(r.scaleType=t.scaleType),t.opt&&(r.opt=fr(t.opt)),t.toolsType&&(r.toolsType=t.toolsType),t.centerPos&&(r.centerPos=fr(t.centerPos)),hi(t.isSelected)&&(r.isSelected=t.isSelected),r.rect?this.curNodeMap.set(e,r):this.curNodeMap["delete"](e);}},{key:"selected",value:function selected(e){this.setInfo(e,{isSelected:!0});}},{key:"unSelected",value:function unSelected(e){this.setInfo(e,{isSelected:!1});}},{key:"delete",value:function _delete(e){this.curNodeMap["delete"](e);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n;var s=/* @__PURE__ */new Map();var _iterator47=_createForOfIteratorHelper(this.curNodeMap.entries()),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _step47$value=_slicedToArray(_step47.value,2),c=_step47$value[0],l=_step47$value[1];if(fl(e,l.rect)){if(t&&l.toolsType===Tt.Image&&l.opt.locked||r&&l.toolsType===Tt.Text&&(l.opt.workState===te.Doing||l.opt.workState===te.Start))continue;n=Zt(n,l.rect),s.set(c,l);}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}return{rectRange:n,nodeRange:s};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(e,t){var r=Gh(t.toolsType);return this.fullLayer&&(r==null?void 0:r.getRectFromLayer(this.fullLayer,e));}},{key:"updateNodeRect",value:function updateNodeRect(e){var t=this.curNodeMap.get(e);if(t){var r=this.getNodeRectFormShape(e,t);if(!r){this.curNodeMap["delete"](e);return;}t.rect=r,this.curNodeMap.set(e,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(e){this.highLevelIds=e;var _iterator48=_createForOfIteratorHelper(this.highLevelIds.keys()),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var t=_step48.value;this.updateNodeRect(t);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var e;var _iterator49=_createForOfIteratorHelper(this.curNodeMap.keys()),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var t=_step49.value;(e=this.highLevelIds)!=null&&e.has(t)||this.updateNodeRect(t);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(e){var t=/* @__PURE__ */new Map();var _iterator50=_createForOfIteratorHelper(e),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var r=_step50.value;var n=this.curNodeMap.get(r);n&&t.set(r,fr(n));}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return this.targetNodeMap.push(fr(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(fr(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(e){return this.targetNodeMap[e];}},{key:"deleteTarget",value:function deleteTarget(e){this.targetNodeMap.length=e;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}},{key:"isLocalWorkId",value:function isLocalWorkId(e){return e.split(mi).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(e){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(YO(this.canClearUids)){var t=e.split(mi);if(t.length===1)return this.canClearUids.has("localSelf")||this.localUid&&this.canClearUids.has(this.localUid);if(t.length===2)return this.canClearUids.has(t[0]);}return!1;}}]);}();var Jh=/*#__PURE__*/function(){function Jh(e,t,r){_classCallCheck(this,Jh);dt(this,"viewId");dt(this,"type");dt(this,"scene");dt(this,"fullLayer");dt(this,"vNodes");dt(this,"dpr");dt(this,"contextType");dt(this,"opt");dt(this,"cameraOpt");dt(this,"isSafari",!1);dt(this,"combinePostMsg",/* @__PURE__ */new Set());dt(this,"workerTaskId");dt(this,"protectedTask");// protected hasPriorityDraw: boolean = true;
483
+ dt(this,"delayPostDoneResolve");dt(this,"cacheImages",/* @__PURE__ */new Map());dt(this,"imageResolveMap",/* @__PURE__ */new Map());dt(this,"taskUpdateCameraId");dt(this,"debounceUpdateCameraId");var n,s;if(this.viewId=e,this.type=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(r,(n=t==null?void 0:t.offscreenCanvasOpt)==null?void 0:n.contextType),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");try{this.scene=this.createScene(t),this.createRenderLayer(this.scene,t);}catch(c){if(this.contextType!=="2d")this.contextType="2d",(s=this.scene)==null||s.disconnect(),this.scene=this.createScene(t),this.createRenderLayer(this.scene,t);else throw c;}this.vNodes=new oE(e,this.scene);}return _createClass(Jh,[{key:"createRenderLayer",value:function createRenderLayer(e,t){var r=vr.bufferSize.full,n=vr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",e,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId===ki?r:n*2}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e){return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:this.dpr=e,this.scene.displayRatio=e;case 1:case"end":return _context30.stop();}},_callee28,this);}));function updateDpr(_x59){return _updateDpr.apply(this,arguments);}return updateDpr;}()},{key:"getCachedImages",value:function getCachedImages(e){var t;return(t=this.cacheImages.get(e))==null?void 0:t.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(e){var _iterator51=_createForOfIteratorHelper(this.cacheImages.entries()),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _step51$value=_slicedToArray(_step51.value,2),t=_step51$value[0],r=_step51$value[1];if(t===e&&r.imageBitmap)return r.imageBitmap;}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(e,t){var _iterator52=_createForOfIteratorHelper(this.cacheImages.entries()),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _step52$value=_slicedToArray(_step52.value,2),r=_step52$value[0],n=_step52$value[1];t&&r===t||n.workId===e&&(n.imageBitmap.close(),this.cacheImages["delete"](r));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(e){return e.imageBitmap.close();}),this.cacheImages.clear();}},{key:"clearImageResolveMap",value:function clearImageResolveMap(){this.imageResolveMap.forEach(function(_ref170){var e=_ref170.timer;e&&clearTimeout(e);}),this.imageResolveMap.clear();}},{key:"setIsSafari",value:function setIsSafari(e){this.isSafari=e;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e){var t,r,n,s,c,l,f,h,_h7,m,u,y;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=e.msgType,r=e.toolsType,n=e.opt,s=e.imageSrc,c=e.imageBitmap,l=e.workId,f=e.dpr;_context31.t0=t;_context31.next=_context31.t0===xt.UpdateDpr?4:_context31.t0===xt.UpdateCamera?9:_context31.t0===xt.Destroy?12:_context31.t0===xt.Clear?14:_context31.t0===xt.UpdateTools?17:_context31.t0===xt.GetImageBitMap?19:21;break;case 4:_context31.t1=er(f);if(!_context31.t1){_context31.next=8;break;}_context31.next=8;return this.updateDpr(f);case 8:return _context31.abrupt("break",21);case 9:_context31.next=11;return this.updateCamera(e);case 11:return _context31.abrupt("break",21);case 12:this.destroy();return _context31.abrupt("break",21);case 14:_context31.next=16;return this.clearAll();case 16:return _context31.abrupt("break",21);case 17:if(r&&n){h={toolsType:r,toolsOpt:n,combineUnitTime:e.combineUnitTime,maxCombineEraserTime:e.maxCombineEraserTime};this.localWork.setToolsOpt(h);}return _context31.abrupt("break",21);case 19:if(s&&c&&l){_h7=l.toString();this.cacheImages.set(s,{imageBitmap:c,workId:_h7});m=this.imageResolveMap.get(s);if(m){u=m.resolve,y=m.timer;y&&clearTimeout(y),u&&u(s);}this.deleteCachedImagesByWorkId(_h7,s);}return _context31.abrupt("break",21);case 21:case"end":return _context31.stop();}},_callee29,this);}));function on(_x60){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(e,t,r){var n=e*r,s=t*r;return n<=50||s<=50?[50,50]:n<=100||s<=100?[100,100]:n<=200||s<=200?[200,200]:n<=400||s<=400?[400,400]:n<=800||s<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e){var _this88=this;var t,r,n,s,c,l,f,h,m,u,y,_this$getIconSize,_this$getIconSize2,x,_I54,_x62,_x63,C;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=e.toolsType,r=e.opt,n=e.workId,s=e.isSubWorker;if(!(t===Tt.Image&&r&&n)){_context32.next=19;break;}c=n.toString(),l=r.src,f=r.type,h=r.width,m=r.height,u=r.strokeColor;if(!(!l||!f||!h||!m)){_context32.next=5;break;}return _context32.abrupt("return");case 5:y=l;if(f===cl.Iconify){_this$getIconSize=this.getIconSize(h,m,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),x=_this$getIconSize2[0],_I54=_this$getIconSize2[1];y="".concat(l,"?width=").concat(x,"&height=").concat(_I54,"&color=").concat(u);}if(!this.cacheImages.has(y)){_context32.next=11;break;}_x62=this.getCachedImages(y);if(!_x62){_context32.next=11;break;}return _context32.abrupt("return",_x62);case 11:if(!this.imageResolveMap.has(y)){_context32.next=15;break;}_x63=this.getCachedImagesByWorkId(c);if(!_x63){_context32.next=15;break;}return _context32.abrupt("return",_x63);case 15:_context32.next=17;return new Promise(function(x){var I=_this88.imageResolveMap.get(y)||{resolve:void 0,timer:void 0};I.timer&&clearTimeout(I.timer),I.resolve=x,I.timer=setTimeout(function(){var d=_this88.imageResolveMap.get(y);d!=null&&d.resolve&&d.resolve(y);},5e3),_this88.imageResolveMap.set(y,I),_this88._post({sp:[{imageSrc:y,workId:c,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:s,type:xt.GetImageBitMap}]});});case 17:C=_context32.sent;return _context32.abrupt("return",(this.imageResolveMap["delete"](C),this.getCachedImages(y)));case 19:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x61){return _loadImageBitMap.apply(this,arguments);}return loadImageBitMap;}()},{key:"createLocalWork",value:function createLocalWork(e){var t=e.workId,r=e.opt,n=e.toolsType;t&&r&&(!this.localWork.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:r}),this.setWorkOpt({workId:t,toolsOpt:r}));}},{key:"updateScene",value:function updateScene(e,t,r){e.attr(_objectSpread({},t));var n=t.width,s=t.height;e.container.width=n,e.container.height=s,e.width=n,e.height=s,this.updateLayer({width:n,height:s},r);}},{key:"updateLayer",value:function updateLayer(e,t){var r=e.width,n=e.height,s=t||this.fullLayer;s&&(s.parent.setAttribute("width",r),s.parent.setAttribute("height",n),s.setAttribute("size",[r,n]),s.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(e,t){var r=new OffscreenCanvas(100,100);var n=["2d"];e===uo.Full&&this.viewId===ki&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i3=0,_n7=n;_i3<_n7.length;_i3++){var s=_n7[_i3];try{if(r.getContext(s))return s;}catch(c){throw c;}}}},{key:"createScene",value:function createScene(e){var t=e.offscreenCanvasOpt,r=t.width,n=t.height,s=new OffscreenCanvas(r,n);t.contextType&&delete t.contextType;var c=new Uu(_objectSpread(_objectSpread({container:s,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},t),{},{contextType:this.contextType,id:this.viewId}));return c.setAttribute("id",this.viewId),c;}},{key:"createLayer",value:function createLayer(e,t,r,n){var s="offscreen-".concat(e),c=r.width,l=r.height;n&&(r.offscreen=!0,r.canvas=n);var f=t.layer(s,r),h=new mr({anchor:[0.5,0.5],pos:[c*0.5,l*0.5],size:[c,l],name:"viewport",id:e});return f.append(h),h;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(){var e;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Lr(this.fullLayer,this.fullLayer.parent)),this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0),this.debounceUpdateCameraId&&(clearTimeout(this.debounceUpdateCameraId),this.debounceUpdateCameraId=void 0),this.clearCacheImages(),this.clearImageResolveMap(),this.localWork.destroy(),(e=this.serviceWork)==null||e.destroy();case 1:case"end":return _context33.stop();}},_callee31,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(e){this.localWork.setToolsOpt(e);}},{key:"setWorkOpt",value:function setWorkOpt(e){var t=e.workId,r=e.toolsOpt;t&&r&&this.localWork.setWorkOptions(t.toString(),r);}},{key:"destroy",value:function destroy(){var e;this.vNodes.clear(),this.fullLayer.remove(),_pr(this.fullLayer,this.fullLayer.parent),this.clearCacheImages(),this.clearImageResolveMap(),this.scene.remove(),this.localWork.destroy(),(e=this.serviceWork)==null||e.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e){return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:this.combinePostMsg.add(e);_context34.next=3;return this.runBatchPostData();case 3:case"end":return _context34.stop();}},_callee32,this);}));function post(_x64){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(){var _this89=this;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this89.workerTaskId=void 0,_this89.combinePost();},16));_context35.t0=this.type===uo.Full&&!this.delayPostDoneResolve;if(!_context35.t0){_context35.next=6;break;}_context35.next=5;return new Promise(function(t){_this89.delayPostDoneResolve=t;});case 5:_context35.t0=_context35.sent;case 6:_context35.t1=_context35.t0;if(!_context35.t1){_context35.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context35.stop();}},_callee33,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var l,f;this.workerTaskId=void 0;var e=[],t=[];var r,n,s;var c=/* @__PURE__ */new Set();var _iterator53=_createForOfIteratorHelper(this.combinePostMsg.values()),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var h=_step53.value;if((l=h.render)!=null&&l.length){var _iterator54=_createForOfIteratorHelper(h.render),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var m=_step54.value;var u=!1;if(m.workId&&c.add(m.workId),m.isClearAll&&(m.rect=this.getSceneRect(),m.isClear=!0,delete m.isClearAll),m.drawCanvas){var y=this.getLayer(m.drawCanvas);if(!y||!(y.parent instanceof el))continue;if(y.parent.render(),m.isDrawAll){var T=this.getSceneRect();m.rect=T,delete m.isDrawAll;}}var _iterator55=_createForOfIteratorHelper(e),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _y3=_step55.value;if(m.viewId===_y3.viewId){m.isClear&&_y3.clearCanvas&&_y3.isClear&&_y3.clearCanvas===m.clearCanvas&&(_y3.rect=Zt(_y3.rect,m.rect),u=!0),_y3.drawCanvas&&_y3.drawCanvas===m.drawCanvas&&(_y3.rect=Zt(_y3.rect,m.rect),u=!0);continue;}}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}u||(m.isClear&&!m.drawCanvas?e.unshift(m):e.push(m));}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}if((f=h.sp)!=null&&f.length){var _iterator56=_createForOfIteratorHelper(h.sp),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _m12=_step56.value;var _u6=!1;var _iterator57=_createForOfIteratorHelper(t),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _y4=_step57.value;if(qr(_m12,_y4)){_u6=!0;break;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}_u6||t.push(_m12);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}er(h.fullWorkerDrawCount)&&(r=h.fullWorkerDrawCount),er(h.subWorkerDrawCount)&&(n=h.subWorkerDrawCount),er(h.consumeCount)&&(s=h.consumeCount);}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}return this.combinePostMsg.clear(),{render:e,sp:t,fullWorkerDrawCount:r,subWorkerDrawCount:n,consumeCount:s,workIds:c,viewId:this.viewId};}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,e=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(e),h:Math.floor(t)};}}]);}();var bl=/*#__PURE__*/function(){function bl(e){_classCallCheck(this,bl);dt(this,"viewId");dt(this,"vNodes");dt(this,"thread");dt(this,"fullLayer");dt(this,"drawLayer");dt(this,"_post");dt(this,"tmpOpt");dt(this,"workShapes",/* @__PURE__ */new Map());dt(this,"drawCount",0);dt(this,"consumeCount",0);dt(this,"syncUnitTime",vr.syncOpt.interval);dt(this,"combineUnitTime",vr.bezier.combineUnitTime);dt(this,"maxCombineEraserTime",vr.pencilEraser.maxCombineTime);this.thread=e.thread,this.viewId=e.viewId,this.vNodes=e.vNodes,this.fullLayer=e.fullLayer,this.drawLayer=e.drawLayer,this._post=this.thread.post.bind(e.thread);}return _createClass(bl,[{key:"setmaxCombineEraserTime",value:function setmaxCombineEraserTime(e){this.maxCombineEraserTime=e;}},{key:"setCombineUnitTime",value:function setCombineUnitTime(e){this.combineUnitTime=e;}},{key:"setSyncUnitTime",value:function setSyncUnitTime(e){this.syncUnitTime=e;}},{key:"destroy",value:function destroy(){this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(e){return this.workShapes.get(e);}},{key:"createWorkShape",value:function createWorkShape(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},r),{},{workId:e}));n&&this.workShapes.set(e,n);}}},{key:"setWorkOptions",value:function setWorkOptions(e,t){var r=this.getWorkShape(e);r||this.createWorkShape(e,t),r==null||r.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var t;return To(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(e){var t,r,n;((t=this.tmpOpt)==null?void 0:t.toolsType)!==e.toolsType&&(r=this.tmpOpt)!=null&&r.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=e,(n=e.toolsOpt)!=null&&n.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime),e.combineUnitTime&&(this.combineUnitTime=e.combineUnitTime),e.maxCombineEraserTime&&(this.maxCombineEraserTime=e.maxCombineEraserTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(e){var t;(t=this.getWorkShape(e))==null||t.clearTmpPoints(),this.workShapes["delete"](e);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(e){return e.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r&&n){var s=t.toString();var c;return t&&this.workShapes.has(s)?(c=this.workShapes.get(s),c==null||c.setWorkOptions(r)):c=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:s}),c?(this.workShapes.set(s,c),c):void 0;}}}]);}();function aE(i){return i;}var Qh=aE;function lE(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2]);}return i.apply(e,t);}var fE=lE,cE=fE,bu=Math.max;function uE(i,e,t){return e=bu(e===void 0?i.length-1:e,0),function(){for(var r=arguments,n=-1,s=bu(r.length-e,0),c=Array(s);++n<s;)c[n]=r[e+n];n=-1;for(var l=Array(e+1);++n<e;)l[n]=r[n];return l[e]=t(c),cE(i,this,l);};}var hE=uE;function dE(i){return function(){return i;};}var pE=dE,vE=pE,Du=Ku,gE=Qh,mE=Du?function(i,e){return Du(i,"toString",{configurable:!0,enumerable:!1,value:vE(e),writable:!0});}:gE,yE=mE,PE=800,SE=16,xE=Date.now;function TE(i){var e=0,t=0;return function(){var r=xE(),n=SE-(r-t);if(t=r,n>0){if(++e>=PE)return arguments[0];}else e=0;return i.apply(void 0,arguments);};}var CE=TE,IE=yE,OE=CE,wE=OE(IE),AE=wE,EE=Qh,ME=hE,LE=AE;function RE(i,e){return LE(ME(i,e,EE),i+"");}var bE=RE;function DE(i,e,t,r){for(var n=i.length,s=t+(r?1:-1);r?s--:++s<n;)if(e(i[s],s,i))return s;return-1;}var NE=DE;function BE(i){return i!==i;}var WE=BE;function FE(i,e,t){for(var r=t-1,n=i.length;++r<n;)if(i[r]===e)return r;return-1;}var UE=FE,YE=NE,XE=WE,zE=UE;function $E(i,e,t){return e===e?zE(i,e,t):YE(i,XE,t);}var jE=$E,GE=jE;function HE(i,e){var t=i==null?0:i.length;return!!t&&GE(i,e,0)>-1;}var qh=HE;function kE(i,e,t){for(var r=-1,n=i==null?0:i.length;++r<n;)if(t(e,i[r]))return!0;return!1;}var _h=kE;function KE(i,e){for(var t=-1,r=i==null?0:i.length,n=Array(r);++t<r;)n[t]=e(i[t],t,i);return n;}var VE=KE,ZE=Ol,JE=qh,QE=_h,qE=VE,_E=Po,tM=wl,eM=200;function rM(i,e,t,r){var n=-1,s=JE,c=!0,l=i.length,f=[],h=e.length;if(!l)return f;t&&(e=qE(e,_E(t))),r?(s=QE,c=!1):e.length>=eM&&(s=tM,c=!1,e=new ZE(e));t:for(;++n<l;){var m=i[n],u=t==null?m:t(m);if(m=r||m!==0?m:0,c&&u===u){for(var y=h;y--;)if(e[y]===u)continue t;f.push(m);}else s(e,u,r)||f.push(m);}return f;}var nM=rM,Nu=Ji,iM=Qu,sM=qi,Bu=Nu?Nu.isConcatSpreadable:void 0;function oM(i){return sM(i)||iM(i)||!!(Bu&&i&&i[Bu]);}var aM=oM,lM=Sl,fM=aM;function td(i,e,t,r,n){var s=-1,c=i.length;for(t||(t=fM),n||(n=[]);++s<c;){var l=i[s];e>0&&t(l)?e>1?td(l,e-1,t,r,n):lM(n,l):r||(n[n.length]=l);}return n;}var cM=td;function uM(){}var hM=uM,tl=lh,dM=hM,pM=Al,vM=1/0,gM=tl&&1/pM(new tl([,-0]))[1]==vM?function(i){return new tl(i);}:dM,mM=gM,yM=Ol,PM=qh,SM=_h,xM=wl,TM=mM,CM=Al,IM=200;function OM(i,e,t){var r=-1,n=PM,s=i.length,c=!0,l=[],f=l;if(t)c=!1,n=SM;else if(s>=IM){var h=e?null:TM(i);if(h)return CM(h);c=!1,n=xM,f=new yM();}else f=e?[]:l;t:for(;++r<s;){var m=i[r],u=e?e(m):m;if(m=t||m!==0?m:0,c&&u===u){for(var y=f.length;y--;)if(f[y]===u)continue t;e&&f.push(u),l.push(m);}else n(f,u,t)||(f!==l&&f.push(u),l.push(m));}return l;}var wM=OM,AM=nM,EM=cM,Wu=wM;function MM(i,e,t){var r=i.length;if(r<2)return r?Wu(i[0]):[];for(var n=-1,s=Array(r);++n<r;)for(var c=i[n],l=-1;++l<r;)l!=n&&(s[n]=AM(s[n]||c,i[l],e,t));return Wu(EM(s,1),e,t);}var LM=MM,RM=gl,bM=pn;function DM(i){return bM(i)&&RM(i);}var NM=DM,BM=rh,WM=bE,FM=LM,UM=NM,YM=WM(function(i){return FM(BM(i,UM));}),XM=YM,zM=/* @__PURE__ */Ln(XM);var ed=/*#__PURE__*/function(_bl){function ed(t){var _this90;_classCallCheck(this,ed);_this90=_callSuper(this,ed,[t]);dt(_this90,"_type","full");dt(_this90,"combineTimerId");dt(_this90,"combineDrawResolve");dt(_this90,"combineDrawActiveId");dt(_this90,"drawWorkActiveId");dt(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());return _this90;}_inherits(ed,_bl);return _createClass(ed,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t){return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:_context36.next=2;return this.thread.loadImageBitMap(t);case 2:return _context36.abrupt("return",_context36.sent);case 3:case"end":return _context36.stop();}},_callee34,this);}));function loadImageBitMap(_x65){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,r){var _this91=this;var n,s,c,l,f,h,m,u,y;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=t.op,s=t.workId,c=t.scenePath,l=t.postCount,f=t.smoothSync;if(!(n!=null&&n.length&&s)){_context37.next=48;break;}h=s.toString(),m=this.getWorkShape(h);if(m){_context37.next=5;break;}return _context37.abrupt("return");case 5:u=m.toolsType;if(!(u===Tt.LaserPen)){_context37.next=8;break;}return _context37.abrupt("return");case 8:_context37.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==h;if(!_context37.t0){_context37.next=13;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context37.next=13;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:c,viewId:this.viewId,msgType:xt.DrawWork,dataType:Vt.Local},r);case 13:_context37.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==h;if(!_context37.t1){_context37.next=18;break;}_context37.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:c,viewId:this.viewId,msgType:xt.DrawWork,dataType:Vt.Local},r);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&h!==Me&&(this.drawWorkActiveId=h);er(l)&&(this.consumeCount=l);y=m.consume({data:t,isFullWork:!0,smoothSync:f});_context37.t2=u;_context37.next=_context37.t2===Tt.Selector?24:_context37.t2===Tt.PencilEraser?30:_context37.t2===Tt.BitMapEraser?30:_context37.t2===Tt.Eraser?32:_context37.t2===Tt.Arrow?35:_context37.t2===Tt.Straight?35:_context37.t2===Tt.Ellipse?35:_context37.t2===Tt.Rectangle?35:_context37.t2===Tt.Star?35:_context37.t2===Tt.Polygon?35:_context37.t2===Tt.SpeechBalloon?35:_context37.t2===Tt.Pencil?41:48;break;case 24:_context37.t3=y.type===xt.Select;if(!_context37.t3){_context37.next=29;break;}y.selectIds&&r.runReverseSelectWork(y.selectIds);_context37.next=29;return this.drawSelector(y);case 29:return _context37.abrupt("break",48);case 30:this.drawCount++,this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=h,this.drawEraserCombine(h,this.drawCount).then(function(){_this91.combineTimerId=void 0;}));return _context37.abrupt("break",48);case 32:_context37.next=34;return this.drawEraser(y);case 34:return _context37.abrupt("break",48);case 35:_context37.t4=y;if(!_context37.t4){_context37.next=40;break;}this.drawCount++;_context37.next=40;return this.drawShape(y);case 40:return _context37.abrupt("break",48);case 41:this.drawCount++;!this.combineTimerId&&this.combineUnitTime!==1/0&&new Promise(function(T){_this91.combineDrawActiveId=h,_this91.combineDrawResolve=T,_this91.combineTimerId=setTimeout(function(){_this91.combineTimerId=void 0,_this91.combineDrawResolve&&_this91.combineDrawResolve(!0);},_this91.combineUnitTime);}).then(function(T){T&&_this91.drawPencilCombine(h,_this91.drawCount),_this91.combineDrawResolve=void 0;});_context37.t5=y;if(!_context37.t5){_context37.next=47;break;}_context37.next=47;return this.drawPencil(y);case 47:return _context37.abrupt("break",48);case 48:case"end":return _context37.stop();}},_callee35,this);}));function consumeDraw(_x66,_x67){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,r){var l,f,h,n,s,c,m,u,y,T,E,C;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,s=t.scenePath,c=t.isLockSentEventCursor;if(!n){_context38.next=38;break;}m=n.toString();this.drawWorkActiveId===m&&(this.drawWorkActiveId=void 0);u=this.workShapes.get(m);if(u){_context38.next=8;break;}return _context38.abrupt("return");case 8:y=u.toolsType;if(!(y===Tt.LaserPen)){_context38.next=11;break;}return _context38.abrupt("return");case 11:T=this.workShapes.get(di),E=(l=T==null?void 0:T.selectIds)==null?void 0:l[0],C=u.consumeAll({data:t,workerEngine:this});_context38.t0=y;_context38.next=_context38.t0===Tt.Selector?15:_context38.t0===Tt.PencilEraser?21:_context38.t0===Tt.BitMapEraser?21:_context38.t0===Tt.Eraser?26:_context38.t0===Tt.Arrow?28:_context38.t0===Tt.Straight?28:_context38.t0===Tt.Ellipse?28:_context38.t0===Tt.Rectangle?28:_context38.t0===Tt.Star?28:_context38.t0===Tt.Polygon?28:_context38.t0===Tt.SpeechBalloon?28:_context38.t0===Tt.Pencil?33:38;break;case 15:C.selectIds&&E&&(f=C.selectIds)!=null&&f.includes(E)&&T.cursorBlur();C.selectIds&&r.runReverseSelectWork(C.selectIds);_context38.next=19;return this.drawSelector(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c);case 19:(h=u.selectIds)!=null&&h.length?u.clearTmpPoints():this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 21:_context38.next=23;return this.drawEraserFull(u,_objectSpread(_objectSpread({},C),{},{scenePath:s}),c);case 23:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 26:this.drawEraser(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c),u.clearTmpPoints();return _context38.abrupt("break",38);case 28:_context38.next=30;return this.drawPencilFull(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c);case 30:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 33:_context38.next=35;return this.drawPencilFull(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c);case 35:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 38:case"end":return _context38.stop();}},_callee36,this);}));function consumeDrawAll(_x68,_x69){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,r){var _iterator58,_step58,n;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_iterator58=_createForOfIteratorHelper(this.workShapes.keys());_context39.prev=1;_iterator58.s();case 3:if((_step58=_iterator58.n()).done){_context39.next=9;break;}n=_step58.value;_context39.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:xt.DrawWork,dataType:Vt.Local},r);case 7:_context39.next=3;break;case 9:_context39.next=14;break;case 11:_context39.prev=11;_context39.t0=_context39["catch"](1);_iterator58.e(_context39.t0);case 14:_context39.prev=14;_iterator58.f();return _context39.finish(14);case 17:case"end":return _context39.stop();}},_callee37,this,[[1,11,14,17]]);}));function workShapesDone(_x70,_x71){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var s,c,r,n,l,f,h,m,u,y,T;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:r=this.setFullWork(t),n=t.ops&&yi(t.ops)||t.op;if(!r){_context40.next=26;break;}l=(s=t.workId)==null?void 0:s.toString();if(l){_context40.next=5;break;}return _context40.abrupt("return");case 5:f=(c=this.vNodes.get(l))==null?void 0:c.rect;if(!(r.toolsType===Tt.Image)){_context40.next=13;break;}_context40.next=9;return r.consumeServiceAsync({isFullWork:!0,replaceId:l,worker:this});case 9:h=_context40.sent;m=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);_context40.next=20;break;case 13:if(!(r.toolsType===Tt.Text)){_context40.next=19;break;}_context40.next=16;return r.consumeServiceAsync({isFullWork:!0,replaceId:l,boxRect:this.thread.getSceneRect()});case 16:h=_context40.sent;_context40.next=20;break;case 19:h=r.consumeService({op:n,isFullWork:!0,replaceId:l}),m=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 20:h=Zt(h,m);u=[],y=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),h&&t.willRefresh&&(f&&(u.push({rect:ve(f),isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId}),h=Zt(h,f)),u.push({rect:ve(h),drawCanvas:Ut.Bg,viewId:this.viewId})),t.willSyncService&&y.push({opt:t.opt,toolsType:t.toolsType,type:xt.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),u.length||y.length)){_context40.next=26;break;}T={render:u,sp:y};_context40.next=26;return this._post(T);case 26:case"end":return _context40.stop();}},_callee38,this);}));function consumeFull(_x72){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var r=this.vNodes.get(t);if(r&&r.toolsType===Tt.Text)return{type:xt.TextUpdate,toolsType:Tt.Text,workId:t,dataType:Vt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t,r){var n,s,c,l,f,h,_iterator59,_step59,m,T,y;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:n=t.willSyncService,s=[],c=[],l=[],f=this.workShapes.get(Me);if(f){_context41.next=3;break;}return _context41.abrupt("return");case 3:h=f.selectIds&&_toConsumableArray(f.selectIds)||[];_iterator59=_createForOfIteratorHelper(h);try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){m=_step59.value;if(this.vNodes.get(m)){T=this.commandDeleteText(m);T&&s.push(T);}y=this._removeWork(m);y.length&&c.push.apply(c,_toConsumableArray(y)),r==null||r.deleteCachedImagesByWorkId(m),l.push(m);}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}l.length&&s.push({type:xt.RemoveNode,removeIds:l});s.push({type:xt.Select,selectIds:[],willSyncService:n});_context41.next=10;return this.blurSelector();case 10:_context41.t0=c.length||s.length;if(!_context41.t0){_context41.next=14;break;}_context41.next=14;return this._post({render:c,sp:s});case 14:case"end":return _context41.stop();}},_callee39,this);}));function removeSelector(_x73,_x74){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var r,n,s;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context42.next=7;break;}s=this._removeWork(n);_context42.t0=s.length;if(!_context42.t0){_context42.next=7;break;}_context42.next=7;return this._post({render:s});case 7:case"end":return _context42.stop();}},_callee40,this);}));function removeWork(_x75){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this92=this;var s,c,l;var r=this.vNodes.get(t);r&&((s=this.fullLayer)==null||s.getElementsByName(t).forEach(function(f){f.remove(),_pr(f,_this92.fullLayer.parent);}),this.vNodes["delete"](t));var n=this.drawLayer&&$t.getRectFromLayer(this.drawLayer,t);if(n){var f=(c=this.drawLayer)==null?void 0:c.getElementsByName(t)[0];f&&(f.remove(),_pr(f,(l=this.drawLayer)==null?void 0:l.parent));}return this.getWorkShape(t)&&this.clearWorkShapeNodeCache(t),{fullRect:r==null?void 0:r.rect,drawRect:n};}},{key:"_removeWork",value:function _removeWork(t){var _this$removeNode=this.removeNode(t),r=_this$removeNode.fullRect,n=_this$removeNode.drawRect,s=[];return r&&s.push({rect:ve(r),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(r),drawCanvas:Ut.Bg,viewId:this.viewId}),n&&s.push({rect:ve(n),clearCanvas:Ut.Float,isClear:!0,viewId:this.viewId},{rect:ve(n),drawCanvas:Ut.Float,viewId:this.viewId}),s;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var r,n,s,c,l,f,h,_iterator60,_step60,_m13,u,y,T,E,m;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:r=t.op,n=t.viewId,s=t.dataType;if(!(r!=null&&r.length)){_context43.next=32;break;}f=r[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],h=r[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator60=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context43.prev=4;_iterator60.s();case 6:if((_step60=_iterator60.n()).done){_context43.next=14;break;}_m13=_step60.value;u=_m13.rect,y=_m13.name,T=_m13.toolsType,E=_m13.opt;if(!(T===Tt.Text&&E.workState===te.Done&&qA([f,h],u))){_context43.next=12;break;}c=y,l=this.setFullWork({workId:y,toolsType:T,opt:E});return _context43.abrupt("break",14);case 12:_context43.next=6;break;case 14:_context43.next=19;break;case 16:_context43.prev=16;_context43.t0=_context43["catch"](4);_iterator60.e(_context43.t0);case 19:_context43.prev=19;_iterator60.f();return _context43.finish(19);case 22:if(!c){_context43.next=32;break;}_context43.t1=l;if(!_context43.t1){_context43.next=28;break;}_context43.next=27;return l.consumeServiceAsync({isFullWork:!0,replaceId:l.getWorkId(),boxRect:this.thread.getSceneRect()});case 27:m=_context43.sent;case 28:_context43.next=30;return this.blurSelector({viewId:n,msgType:xt.Select,dataType:s,isSync:!0});case 30:_context43.next=32;return this._post({render:m&&[{rect:ve(m),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(m),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:[{type:xt.GetTextActive,toolsType:Tt.Text,workId:c}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x76){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var _this93=this;var r,n,s;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:r=this.workShapes.get(Me),n=t.workId,s=t.msgType;if(!(r&&n&&r.selectIds&&r.selectIds.includes(n.toString()))){_context44.next=6;break;}s===xt.RemoveNode?r.selectIds=r.selectIds.filter(function(c){return c!==n.toString();}):this.effectSelectNodeData.add(t);_context44.next=5;return this.runEffectSelectWork(!0).then(function(){var c;(c=_this93.effectSelectNodeData)==null||c.clear();});case 5:return _context44.abrupt("return");case 6:return _context44.abrupt("return",t);case 7:case"end":return _context44.stop();}},_callee42,this);}));function colloctEffectSelectWork(_x77){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this94=this;var C,r,n,s,c,l,f,h,m,u,y,T,E;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:r=this.workShapes.get(Me);if((C=r==null?void 0:r.selectIds)!=null&&C.length){_context45.next=3;break;}return _context45.abrupt("return");case 3:n=t.callback;s=_objectWithoutProperties(t,_excluded2);c=s.updateSelectorOpt;l=s.willSerializeData;f=s.smoothSync;_context45.next=10;return r==null?void 0:r.updateSelector({updateSelectorOpt:c,selectIds:fr(r.selectIds),vNodes:this.vNodes,willSerializeData:l,worker:this});case 10:h=_context45.sent;m=/* @__PURE__ */new Map();h!=null&&h.selectIds&&(u=zM(r.selectIds,h.selectIds),h.selectIds.forEach(function(x){var I=_this94.vNodes.get(x);if(I){var _d46=I.toolsType,v=I.op,p=I.opt;m.set(x,{opt:p,toolsType:_d46,ops:(v==null?void 0:v.length)&&gr(v)||void 0});}}),r.selectIds=h.selectIds);y=[],T=[];h!=null&&h.rect&&y.push({rect:ve(h.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(h.rect),drawCanvas:Ut.Bg,viewId:this.viewId});E=n&&n({res:h,workShapeNode:r,param:s,postData:{render:y,sp:T},newServiceStore:m,smoothSync:f})||{render:y,sp:T};u&&E.sp.push({type:xt.RemoveNode,removeIds:u,viewId:this.viewId});_context45.t0=E.render.length||E.sp.length;if(!_context45.t0){_context45.next=21;break;}_context45.next=21;return this._post(E);case 21:case"end":return _context45.stop();}},_callee43,this);}));function updateSelector(_x78){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var s,r,n,c;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:r=this.workShapes.get(Me),n=r==null?void 0:r.blurSelector();if(!(this.clearWorkShapeNodeCache(Me),((s=this.fullLayer)==null?void 0:s.parent).children.forEach(function(c){c.name===Me&&c.remove();}),n)){_context46.next=6;break;}c=[];c.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context46.next=6;return this._post({render:(n==null?void 0:n.rect)&&[{rect:ve(n.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(n.rect),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:c});case 6:case"end":return _context46.stop();}},_callee44,this);}));function blurSelector(_x79){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Me);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Me);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(){var t,c,r,n,s,l,_args47=arguments;return _regeneratorRuntime().wrap(function _callee45$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:t=_args47.length>0&&_args47[0]!==undefined?_args47[0]:!1;r=this.workShapes.get(Me);if(r){_context47.next=4;break;}return _context47.abrupt("return");case 4:if(!(r&&!((c=r.selectIds)!=null&&c.length))){_context47.next=8;break;}_context47.next=7;return this.blurSelector();case 7:return _context47.abrupt("return");case 8:n=r.oldSelectRect,s=r.reRenderSelector();if(!s){_context47.next=13;break;}l=Zt(n,s)||s;_context47.next=13;return this._post({render:[{rect:ve(l),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(l),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:[{type:xt.Select,selectIds:r.selectIds,selectRect:s,willSyncService:t,viewId:this.viewId,points:r.getChildrenPoints(),textOpt:r.textOpt,selectorColor:r.selectorColor,strokeColor:r.strokeColor,fillColor:r.fillColor,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,opt:r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}]});case 13:case"end":return _context47.stop();}},_callee45,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(t){var s,c,l,f,h,m,u,r,n,_r$updateSelectIds,y,T,E;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:r=this.workShapes.get(Me),n=t.selectIds;if(n!=null&&n.length){_context48.next=5;break;}_context48.next=4;return this.blurSelector(t);case 4:return _context48.abrupt("return");case 5:if(r){_context48.next=10;break;}!this.setFullWork(t)&&t.workId&&((s=this.tmpOpt)==null?void 0:s.toolsType)===Tt.Selector&&this.createWorkShape(t.workId.toString());_context48.next=9;return this.updateFullSelectWork(t);case 9:return _context48.abrupt("return");case 10:if(!(r&&n!=null&&n.length)){_context48.next=16;break;}_r$updateSelectIds=r.updateSelectIds(n),y=_r$updateSelectIds.bgRect,T=_r$updateSelectIds.selectRect,E={render:[],sp:[]};y&&((c=E.render)==null||c.push({rect:ve(y),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(y),drawCanvas:Ut.Bg,viewId:this.viewId}));(u=E.sp)==null||u.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((l=t.opt)==null?void 0:l.strokeColor)||r.selectorColor,strokeColor:((f=t.opt)==null?void 0:f.strokeColor)||r.strokeColor,fillColor:((h=t.opt)==null?void 0:h.fillColor)||r.fillColor,textOpt:((m=t.opt)==null?void 0:m.textOpt)||r.textOpt,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,type:xt.Select,selectRect:T,points:r.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}));_context48.next=16;return this._post(E);case 16:case"end":return _context48.stop();}},_callee46,this);}));function updateFullSelectWork(_x80){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)),_superPropGet(ed,"destroy",this,3)([]),this.effectSelectNodeData.clear();}},{key:"drawEraserCombine",value:function(){var _drawEraserCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t,r){var s,c,l,f,n,h,m,u,y,_iterator61,_step61,_step61$value,_y5,T;return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume({workerEngine:this});if(!n){_context49.next=7;break;}h=n.willDeleteNodes,m=n.willNewNodes,u={render:[],fullWorkerDrawCount:r,sp:[]};if(n!=null&&n.rect){y=ve(n.rect);(c=u.render)==null||c.push({rect:y,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:y,drawCanvas:Ut.Bg,viewId:this.viewId});}if(h!=null&&h.size&&((l=u.sp)==null||l.push({type:xt.RemoveNode,removeIds:_toConsumableArray(h),viewId:this.thread.viewId})),m!=null&&m.size){_iterator61=_createForOfIteratorHelper(m);try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){_step61$value=_slicedToArray(_step61.value,2),_y5=_step61$value[0],T=_step61$value[1];(f=u.sp)==null||f.push({type:xt.FullWork,dataType:Vt.Local,toolsType:Tt.Pencil,ops:gr(T.op),opt:T.opt,workId:_y5,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}}_context49.next=7;return this._post(u);case 7:case"end":return _context49.stop();}},_callee47,this);}));function drawEraserCombine(_x81,_x82){return _drawEraserCombine.apply(this,arguments);}return drawEraserCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,r){var s,c,l,n,f,h;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume();if(!n){_context50.next=6;break;}f={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){h=ve(n.rect);(c=f.render)==null||c.push({rect:h,isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId}),(l=f.render)==null||l.push({rect:h,drawCanvas:Ut.Float,viewId:this.viewId});}_context50.next=6;return this._post(f);case 6:case"end":return _context50.stop();}},_callee48,this);}));function drawPencilCombine(_x83,_x84){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,r){var s,c,n;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:n={render:[],sp:[t]};r&&((s=n.sp)==null||s.push({type:xt.None,isLockSentEventCursor:r}));t.rect&&((c=n.render)==null||c.push({rect:ve(t.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(t.rect),drawCanvas:Ut.Bg,viewId:this.viewId}));_context51.next=5;return this._post(n);case 5:case"end":return _context51.stop();}},_callee49,this);}));function drawSelector(_x85,_x86){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t,r){var s,c,n;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:n={fullWorkerDrawCount:1/0,render:[],sp:[t]};r&&((s=n.sp)==null||s.push({type:xt.None,isLockSentEventCursor:r}));t!=null&&t.rect&&((c=n.render)==null||c.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Ut.Bg,viewId:this.viewId}));_context52.next=5;return this._post(n);case 5:case"end":return _context52.stop();}},_callee50,this);}));function drawPencilFull(_x87,_x88){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"drawEraserFull",value:function(){var _drawEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t,r,n){var s,c,l,f,h,m,_iterator62,_step62,_step62$value,y,T,_iterator63,_step63,_step63$value,_y6,_T10,u;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:s=r.rect,c=r.willUpdateNodes,l=r.willDeleteNodes,f=r.willNewNodes,h=t.getWorkId(),m=[{type:xt.RemoveNode,removeIds:[h],viewId:this.viewId}];if(n&&m.push({type:xt.None,isLockSentEventCursor:n}),c!=null&&c.size||l!=null&&l.size||f!=null&&f.size){if(c!=null&&c.size){_iterator62=_createForOfIteratorHelper(c);try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){_step62$value=_slicedToArray(_step62.value,2),y=_step62$value[0],T=_step62$value[1];m.push({type:xt.UpdateNode,dataType:Vt.Local,opt:T.opt,workId:y,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}if(l!=null&&l.size&&m.push({type:xt.RemoveNode,removeIds:_toConsumableArray(l),viewId:this.thread.viewId}),f!=null&&f.size){_iterator63=_createForOfIteratorHelper(f);try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_step63$value=_slicedToArray(_step63.value,2),_y6=_step63$value[0],_T10=_step63$value[1];m.push({type:xt.FullWork,dataType:Vt.Local,toolsType:_T10.toolsType,ops:gr(_T10.op),opt:_T10.opt,workId:_y6,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}}u=[{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}];s&&u.push({rect:s,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:s,drawCanvas:Ut.Bg,viewId:this.viewId});_context53.next=6;return this._post({sp:m,render:u,fullWorkerDrawCount:1/0});case 6:case"end":return _context53.stop();}},_callee51,this);}));function drawEraserFull(_x89,_x90,_x91){return _drawEraserFull.apply(this,arguments);}return drawEraserFull;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,r){var n,s;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:n=[],s=[];r&&n.push({type:xt.None,isLockSentEventCursor:r});t.removeIds&&n.push(t);t.rect&&s.push({rect:t.rect,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Ut.Bg,viewId:this.viewId});_context54.next=6;return this._post({sp:n,render:s,consumeCount:this.consumeCount});case 6:case"end":return _context54.stop();}},_callee52,this);}));function drawEraser(_x92,_x93){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(t){return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:_context55.next=2;return this._post({fullWorkerDrawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context55.stop();}},_callee53,this);}));function drawShape(_x94){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(t){return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:_context56.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context56.stop();}},_callee54,this);}));function drawPencil(_x95){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t){var r,_iterator64,_step64,n,s,c,l;return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_iterator64=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context57.prev=1;_iterator64.s();case 3:if((_step64=_iterator64.n()).done){_context57.next=23;break;}n=_step64.value;s=this.setFullWork(n);if(!s){_context57.next=21;break;}c=(r=s.getWorkId())==null?void 0:r.toString();if(!(s.toolsType===Tt.Image)){_context57.next=13;break;}_context57.next=11;return s.consumeServiceAsync({isFullWork:!0,replaceId:c,worker:this});case 11:_context57.next=20;break;case 13:if(!(s.toolsType===Tt.Text)){_context57.next=18;break;}_context57.next=16;return s.consumeServiceAsync({isFullWork:!0,replaceId:c,boxRect:this.thread.getSceneRect()});case 16:_context57.next=20;break;case 18:l=n.ops&&yi(n.ops);s.consumeService({op:l,isFullWork:!0,replaceId:c}),n!=null&&n.updateNodeOpt&&s.updataOptService(n.updateNodeOpt);case 20:n.workId&&this.workShapes["delete"](n.workId.toString());case 21:_context57.next=3;break;case 23:_context57.next=28;break;case 25:_context57.prev=25;_context57.t0=_context57["catch"](1);_iterator64.e(_context57.t0);case 28:_context57.prev=28;_iterator64.f();return _context57.finish(28);case 31:_context57.next=33;return this.reRenderSelector(t);case 33:case"end":return _context57.stop();}},_callee55,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x96){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t){var l,r,n,s,c,f,h;return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:r=t.opt,n=t.toolsType,s=t.point,c=this.setFullWork({workId:di,toolsType:n,opt:r});if(!(c&&s)){_context58.next=8;break;}f=c.cursorHover(s),h={render:[]};_context58.t0=f&&f.type===xt.CursorHover&&f.rect;if(!_context58.t0){_context58.next=8;break;}(l=h.render)==null||l.push({rect:ve(f.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(f.rect),drawCanvas:Ut.Bg,viewId:this.viewId});_context58.next=8;return this._post(h);case 8:case"end":return _context58.stop();}},_callee56,this);}));function cursorHover(_x97){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(){var n,t,r;return _regeneratorRuntime().wrap(function _callee57$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:t=this.getWorkShape(di);_context59.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context59.t0){_context59.next=10;break;}r=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(di);_context59.t1=r;if(!_context59.t1){_context59.next=10;break;}_context59.next=10;return this._post({render:[{rect:ve(r),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(r),drawCanvas:Ut.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(s){s.name==="Cursor_Hover_Id"&&s.remove();});case 11:case"end":return _context59.stop();}},_callee57,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(bl);var rd=/*#__PURE__*/function(){function rd(e){_classCallCheck(this,rd);dt(this,"viewId");dt(this,"vNodes");dt(this,"fullLayer");dt(this,"drawLayer");dt(this,"workShapes",/* @__PURE__ */new Map());dt(this,"selectorWorkShapes",/* @__PURE__ */new Map());dt(this,"thread");dt(this,"animationId");dt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());dt(this,"runEffectId");dt(this,"noAnimationRect");dt(this,"syncUnitTime",vr.syncOpt.interval);dt(this,"post");this.viewId=e.viewId,this.vNodes=e.vNodes,this.fullLayer=e.fullLayer,this.drawLayer=e.drawLayer,this.thread=e.thread,this.post=e.thread.post.bind(e.thread);}return _createClass(rd,[{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 _callee58(e){return _regeneratorRuntime().wrap(function _callee58$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:this.activeWorkShape(e),this.runAnimation();case 1:case"end":return _context60.stop();}},_callee58,this);}));function consumeDraw(_x98){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(e){this.activeWorkShape(e),this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(e){this.activeSelectorShape(e);var t=e.workId,r=t==null?void 0:t.toString();r&&this.willRunEffectSelectorIds.add(r),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(e,t,r,n){return t.toolsType=r,t.node=To({workId:e,toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(e){var _this95=this;e.forEach(function(t){_this95.selectorWorkShapes.forEach(function(r,n){var s;if((s=r.selectIds)!=null&&s.length){var c=r.selectIds.indexOf(t);c>-1&&(r.selectIds.splice(c,1),_this95.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e){var t,r,n;return _regeneratorRuntime().wrap(function _callee59$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:t=e.workId,r=t==null?void 0:t.toString();if(!r){_context61.next=10;break;}n=this.workShapes.get(r);if(!n){_context61.next=8;break;}this.workShapes["delete"](r);_context61.next=7;return this.removeNode(r,e,n==null?void 0:n.totalRect,!1);case 7:return _context61.abrupt("return");case 8:_context61.next=10;return this.removeNode(r,e);case 10:case"end":return _context61.stop();}},_callee59,this);}));function removeWork(_x99){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(e){var t=e.workId,r=t==null?void 0:t.toString();r&&(this.activeSelectorShape(e),this.willRunEffectSelectorIds.add(r)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e,t,r){var _this96=this;var n,h,s,c,l,f,_args62=arguments;return _regeneratorRuntime().wrap(function _callee60$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:n=_args62.length>3&&_args62[3]!==undefined?_args62[3]:!0;e.indexOf(Me)>-1&&this.removeSelectWork(t);s=r;c=(h=this.vNodes.get(e))==null?void 0:h.rect;c&&(s=Zt(c,s));l=this.fullLayer&&$t.getRectFromLayer(this.fullLayer,e);s=Zt(s,l);f=this.drawLayer&&$t.getRectFromLayer(this.drawLayer,e);s=Zt(s,f);this.fullLayer.getElementsByName(e).forEach(function(m){m.remove(),_pr(m,_this96.fullLayer.parent);});this.drawLayer.getElementsByName(e).forEach(function(m){m.remove(),_pr(m,_this96.drawLayer.parent);});this.vNodes["delete"](e);_context62.t0=s;if(!_context62.t0){_context62.next=16;break;}_context62.next=16;return this.post({render:[{rect:ve(s),isClear:!0,clearCanvas:n?Ut.Bg:Ut.ServiceFloat,workerType:n?void 0:Vt.Service,viewId:this.viewId},{rect:ve(s),drawCanvas:n?Ut.Bg:Ut.ServiceFloat,workerType:n?void 0:Vt.Service,viewId:this.viewId}]});case 16:case"end":return _context62.stop();}},_callee60,this);}));function removeNode(_x100,_x101,_x102){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(e){var E,C,x,I;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.updateNodeOpt,l=e.ops,f=e.op,h=e.useAnimation,m=e.isEnableCursor;if(!t)return;var u=t.toString(),y=(E=this.vNodes.get(u))==null?void 0:E.rect;if(!((C=this.workShapes)!=null&&C.has(u))){var _d47={toolsType:n,animationWorkData:f||[],animationIndex:0,type:s,updateNodeOpt:c,ops:l,useAnimation:_typeof(h)<"u"?h:_typeof(c==null?void 0:c.useAnimation)<"u"?c==null?void 0:c.useAnimation:!0,oldRect:y,isDiff:!1,isEnableCursor:m};n&&r&&(_d47=this.setNodeKey(u,_d47,n,r)),(x=this.workShapes)==null||x.set(u,_d47);}var T=(I=this.workShapes)==null?void 0:I.get(u);T.isEnableCursor=m,s&&(T.type=s),l&&(T.animationWorkData=yi(l),T.ops=l),c&&(T.updateNodeOpt=c),f&&(T.isDiff=this.hasDiffData(T.animationWorkData||[],f,T.toolsType),T.animationWorkData=f),T.node&&T.node.getWorkId()!==u&&T.node.setWorkId(u),y&&(T.oldRect=y),n&&r&&(r.syncUnitTime&&(this.syncUnitTime=r.syncUnitTime),T.toolsType!==n&&n&&r&&this.setNodeKey(u,T,n,r),T.node&&T.node.setWorkOptions(r));}},{key:"hasDiffData",value:function hasDiffData(e,t,r){var n=e.length;if(t.length<n)return!0;switch(r){case Tt.Pencil:{for(var s=0;s<n;s+=3)if(t[s]!==e[s]||t[s+1]!==e[s+1])return!0;break;}case Tt.LaserPen:{for(var _s2=0;_s2<n;_s2+=2)if(t[_s2]!==e[_s2]||t[_s2+1]!==e[_s2+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(){var _this97=this;var n,s,c,l,f,h,m,u,y,T,E,C,x,I,d,v,p,S,A,R,D,U,M,W,Y,B,N,G,J,tt,at,ut,K,Q,ft,gt,mt,wt,ht,Nt,e,t,r,_iterator65,_step65,_loop6;return _regeneratorRuntime().wrap(function _callee61$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:this.animationId=void 0;e=!1;t={render:[]},r=/* @__PURE__ */new Map();_iterator65=_createForOfIteratorHelper(this.workShapes.entries());_context64.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step65$value,Rt,X,z,q,_z,_q,_z2,_q2,nt,j,_z3,_q3,_nt,_j2,Z,O,L,_O2,_z4,_q4,_nt2,_j3;return _regeneratorRuntime().wrap(function _loop6$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:_step65$value=_slicedToArray(_step65.value,2),Rt=_step65$value[0],X=_step65$value[1];_context63.t0=X.toolsType;_context63.next=_context63.t0===Tt.Image?4:_context63.t0===Tt.Text?11:_context63.t0===Tt.Arrow?19:_context63.t0===Tt.Straight?19:_context63.t0===Tt.Rectangle?19:_context63.t0===Tt.Ellipse?19:_context63.t0===Tt.Star?19:_context63.t0===Tt.Polygon?19:_context63.t0===Tt.SpeechBalloon?19:_context63.t0===Tt.Pencil?22:38;break;case 4:z=X.oldRect;z&&((n=t.render)==null||n.push({rect:z,isClear:!0,clearCanvas:Ut.Bg,viewId:_this97.viewId}),(s=t.render)==null||s.push({rect:z,drawCanvas:Ut.Bg,viewId:_this97.viewId}));_context63.next=8;return(c=X.node)==null?void 0:c.consumeServiceAsync({isFullWork:!0,worker:_this97.thread});case 8:q=_context63.sent;_this97.selectorWorkShapes.forEach(function(nt,j){var Z;(Z=nt.selectIds)!=null&&Z.includes(Rt)&&(_this97.willRunEffectSelectorIds.add(j),_this97.noAnimationRect=Zt(_this97.noAnimationRect,z),_this97.noAnimationRect=Zt(_this97.noAnimationRect,q),_this97.runEffect());}),_this97.workShapes["delete"](Rt),(l=t.render)==null||l.push({rect:q,drawCanvas:Ut.Bg,viewId:_this97.viewId});return _context63.abrupt("break",38);case 11:if(!X.node){_context63.next=18;break;}_z=X.oldRect;_z&&((f=t.render)==null||f.push({rect:_z,isClear:!0,clearCanvas:Ut.Bg,viewId:_this97.viewId}),(h=t.render)==null||h.push({rect:_z,drawCanvas:Ut.Bg,viewId:_this97.viewId}));_context63.next=16;return X.node.consumeServiceAsync({isFullWork:!0,replaceId:Rt,boxRect:_this97.thread.getSceneRect()});case 16:_q=_context63.sent;_this97.selectorWorkShapes.forEach(function(nt,j){var Z;(Z=nt.selectIds)!=null&&Z.includes(Rt)&&(_this97.willRunEffectSelectorIds.add(j),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_z),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_q),_this97.runEffect());}),(m=X.node)==null||m.clearTmpPoints(),_this97.workShapes["delete"](Rt),(u=t.render)==null||u.push({rect:_q,drawCanvas:Ut.Bg,viewId:_this97.viewId});case 18:return _context63.abrupt("break",38);case 19:_z2=!!X.ops;if((y=X.animationWorkData)!=null&&y.length){_q2=X.oldRect,nt=X.node.oldRect;_q2&&((T=t.render)==null||T.push({rect:_q2,isClear:!0,clearCanvas:Ut.Bg,viewId:_this97.viewId}),(E=t.render)==null||E.push({rect:_q2,drawCanvas:Ut.Bg,viewId:_this97.viewId})),nt&&((C=t.render)==null||C.push({rect:nt,isClear:!0,clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}));j=(x=X.node)==null?void 0:x.consumeService({op:X.animationWorkData,isFullWork:_z2});X.isEnableCursor?r.set(Rt,{workState:_q2?X.ops?te.Done:te.Doing:te.Start,op:X.animationWorkData.slice(-3,-1)}):_z2&&!X.useAnimation&&(I=X.updateNodeOpt)!=null&&I.useAnimation&&r.set(Rt,{workState:te.Done,op:X.animationWorkData.slice(-3,-1),uid:(d=X.updateNodeOpt)==null?void 0:d.uid}),_z2?(_this97.selectorWorkShapes.forEach(function(Z,O){var L;(L=Z.selectIds)!=null&&L.includes(Rt)&&(_this97.willRunEffectSelectorIds.add(O),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_q2),_this97.noAnimationRect=Zt(_this97.noAnimationRect,nt),_this97.noAnimationRect=Zt(_this97.noAnimationRect,j),_this97.runEffect());}),(v=X.node)==null||v.clearTmpPoints(),_this97.workShapes["delete"](Rt),(p=t.render)==null||p.push({rect:j,drawCanvas:Ut.Bg,viewId:_this97.viewId})):(S=t.render)==null||S.push({rect:j,drawCanvas:Ut.ServiceFloat,workerType:_z2?void 0:Vt.Service,viewId:_this97.viewId}),X.animationWorkData.length=0;}return _context63.abrupt("break",38);case 22:if(!X.useAnimation){_context63.next=33;break;}if(!X.useAnimation){_context63.next=31;break;}if(!X.isDel){_context63.next=27;break;}(at=X.node)==null||at.clearTmpPoints(),_this97.workShapes["delete"](Rt);return _context63.abrupt("break",38);case 27:_z3=3,_q3=_this97.computNextAnimationIndex(X,_z3),_nt=X.isDiff?0:Math.max(0,(X.animationIndex||0)-_z3),_j2=(X.animationWorkData||[]).slice(0,_q3),Z=(K=(ut=X.node)==null?void 0:ut.getWorkId())==null?void 0:K.toString();if((X.animationIndex||0)<_q3||X.isDiff){O=(Q=X.node)==null?void 0:Q.consumeService({op:_j2,isFullWork:!1,replaceId:Z});if((ft=t.render)==null||ft.push({isClear:!0,rect:O,clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),(gt=t.render)==null||gt.push({rect:O,drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),X.animationIndex=_q3,X.isDiff&&(X.isDiff=!1),_j2.length&&X.isEnableCursor){L=_j2.slice(-3,-1);r.set(Rt,{workState:_nt===0?te.Start:_q3===((mt=X.animationWorkData)==null?void 0:mt.length)?te.Done:te.Doing,op:L});}}else if(X.ops){_O2=(wt=X.node)==null?void 0:wt.consumeService({op:X.animationWorkData||[],isFullWork:!0,replaceId:Z});X.isDel=!0,(ht=t.render)==null||ht.push({isClear:!0,rect:_O2,clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId},{rect:_O2,drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId},{isClear:!0,rect:_O2,clearCanvas:Ut.Bg,viewId:_this97.viewId},{rect:_O2,drawCanvas:Ut.Bg,viewId:_this97.viewId}),X.isEnableCursor&&r.set(Rt,{workState:te.Done,op:_j2.slice(-3,-1)});}e=!0;return _context63.abrupt("break",38);case 31:_context63.next=37;break;case 33:_z4=!!X.ops;_q4=(A=X.node)==null?void 0:A.consumeService({op:X.animationWorkData||[],isFullWork:_z4,replaceId:Rt});_nt2=(R=X.node)==null?void 0:R.updataOptService(X.updateNodeOpt);if(_z4){if(_q4=Zt(_q4,_nt2),(D=t.render)==null||D.push({isClear:!0,rect:Zt(X.oldRect,_q4),clearCanvas:Ut.Bg,viewId:_this97.viewId}),(U=t.render)==null||U.push({rect:Zt(X.oldRect,_q4),drawCanvas:Ut.Bg,viewId:_this97.viewId}),(M=X.updateNodeOpt)!=null&&M.useAnimation&&((W=t.render)==null||W.push({isClear:!0,rect:Zt(X.oldRect,_q4),clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),(Y=t.render)==null||Y.push({rect:Zt(X.oldRect,_q4),drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),!X.isEnableCursor&&(B=X.animationWorkData)!=null&&B.length)){_j3=X.animationWorkData.slice(-3,-1);r.set(Rt,{workState:te.Done,op:_j3,uid:(N=X.updateNodeOpt)==null?void 0:N.uid});}_this97.selectorWorkShapes.forEach(function(j,Z){var O;(O=j.selectIds)!=null&&O.includes(Rt)&&(_this97.willRunEffectSelectorIds.add(Z),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_q4),_this97.runEffect());}),(G=X.node)==null||G.clearTmpPoints(),_this97.workShapes["delete"](Rt);}else _q4=Zt(_q4,_nt2),(J=t.render)==null||J.push({isClear:!0,rect:Zt(X.oldRect,_q4),clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),(tt=t.render)==null||tt.push({rect:Zt(X.oldRect,_q4),drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId});case 37:return _context63.abrupt("break",38);case 38:case"end":return _context63.stop();}},_loop6);});_iterator65.s();case 7:if((_step65=_iterator65.n()).done){_context64.next=11;break;}return _context64.delegateYield(_loop6(),"t0",9);case 9:_context64.next=7;break;case 11:_context64.next=16;break;case 13:_context64.prev=13;_context64.t1=_context64["catch"](4);_iterator65.e(_context64.t1);case 16:_context64.prev=16;_iterator65.f();return _context64.finish(16);case 19:e&&this.runAnimation();r.size&&(t.sp=[],r.forEach(function(Rt,X){var z;(z=t.sp)==null||z.push({type:xt.Cursor,uid:Rt.uid||X.split(mi)[0],op:Rt.op,workState:Rt.workState,viewId:_this97.viewId});}));_context64.t2=(Nt=t.render)!=null&&Nt.length;if(!_context64.t2){_context64.next=25;break;}_context64.next=25;return this.post(t);case 25:case"end":return _context64.stop();}},_callee61,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this98=this;this.animationId||(this.animationId=setTimeout(function(){_this98.animationId=void 0,_this98.animationDraw();},16));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(e,t){var r=Math.floor((e.animationWorkData||[]).slice(e.animationIndex).length*48/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.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 _callee62(){var _this99=this;var e;return _regeneratorRuntime().wrap(function _callee62$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:this.runEffectId=void 0;e=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var s,c;var r=_this99.selectorWorkShapes.get(t),n=r&&r.selectIds&&((s=r.node)==null?void 0:s.selectServiceNode(t,r,!0));e=Zt(e,n),(c=r==null?void 0:r.selectIds)!=null&&c.length||_this99.selectorWorkShapes["delete"](t);});_context65.t0=e;if(!_context65.t0){_context65.next=7;break;}_context65.next=7;return this.post({render:[{rect:ve(e),isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:ve(e),drawCanvas:Ut.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context65.stop();}},_callee62,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(e){var m,u,y;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.selectIds,l=e.imageBitmap;if(!t)return;var f=t.toString();if(!((m=this.selectorWorkShapes)!=null&&m.has(f))){var T={toolsType:n,selectIds:c,type:s,opt:r,imageBitmap:l};n&&r&&(T=this.setNodeKey(f,T,n,r)),(u=this.selectorWorkShapes)==null||u.set(f,T);}var h=(y=this.selectorWorkShapes)==null?void 0:y.get(f);s&&(h.type=s),h.node&&h.node.getWorkId()!==f&&h.node.setWorkId(f),l&&(h.imageBitmap=l),h.selectIds=c||[];}}]);}();var $M=/*#__PURE__*/function(_bl2){function $M(t){var _this100;_classCallCheck(this,$M);_this100=_callSuper(this,$M,[t]);dt(_this100,"drawWorkActiveId");return _this100;}// async runFullWork(data: IWorkerMessage): Promise<IRectType | undefined> {
484
+ // const workShape = this.setFullWork(data);
485
+ // const op = data.ops && transformToNormalData(data.ops);
486
+ // if (workShape) {
487
+ // let rect: IRectType | undefined;
488
+ // let updataOptRect: IRectType | undefined;
489
+ // const replaceId = workShape.getWorkId()?.toString();
490
+ // if (workShape.toolsType === EToolsKey.Image) {
491
+ // rect = await (workShape as ImageShape).consumeServiceAsync({
492
+ // isFullWork: true,
493
+ // worker: this.thread,
494
+ // });
495
+ // } else if (workShape.toolsType === EToolsKey.Text) {
496
+ // rect = await (workShape as TextShape).consumeServiceAsync({
497
+ // isFullWork: true,
498
+ // replaceId,
499
+ // isDrawLabel: true,
500
+ // });
501
+ // } else {
502
+ // rect = workShape.consumeService({
503
+ // op,
504
+ // isFullWork: true,
505
+ // replaceId,
506
+ // });
507
+ // updataOptRect =
508
+ // data?.updateNodeOpt && workShape.updataOptService(data.updateNodeOpt);
509
+ // }
510
+ // data.workId && this.workShapes.delete(data.workId.toString());
511
+ // return computRect(rect, updataOptRect);
512
+ // }
513
+ // }
514
+ _inherits($M,_bl2);return _createClass($M,[{key:"runSelectWork",value:function runSelectWork(t){var n;var r=this.setFullWork(t);r&&(n=t.selectIds)!=null&&n.length&&t.workId&&r.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator66=_createForOfIteratorHelper(this.workShapes.keys()),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var t=_step66.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}Lr(this.fullLayer,this.fullLayer.parent);}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(t){var r,n,s,c,l,f,h;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:r=t.workId,n=t.fullWorkerDrawCount,s=t.postCount,c=r==null?void 0:r.toString(),l=c&&this.workShapes.get(c);if(l){_context66.next=3;break;}return _context66.abrupt("return");case 3:_context66.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==c;if(!_context66.t0){_context66.next=8;break;}_context66.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:xt.DrawWork,dataType:Vt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&c!==Me&&(this.drawWorkActiveId=c);f=l.toolsType;er(s)&&(this.consumeCount=s);h=l.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:n});_context66.t1=f;_context66.next=_context66.t1===Tt.Selector?15:_context66.t1===Tt.Ellipse?21:_context66.t1===Tt.Arrow?21:_context66.t1===Tt.Straight?21:_context66.t1===Tt.Rectangle?21:_context66.t1===Tt.Star?21:_context66.t1===Tt.Polygon?21:_context66.t1===Tt.SpeechBalloon?21:_context66.t1===Tt.Pencil?27:_context66.t1===Tt.BitMapEraser?33:_context66.t1===Tt.PencilEraser?33:39;break;case 15:_context66.t2=h;if(!_context66.t2){_context66.next=20;break;}this.drawCount++;_context66.next=20;return this.drawSelector(h);case 20:return _context66.abrupt("break",39);case 21:_context66.t3=h;if(!_context66.t3){_context66.next=26;break;}this.drawCount++;_context66.next=26;return this.drawShape(h);case 26:return _context66.abrupt("break",39);case 27:_context66.t4=h;if(!_context66.t4){_context66.next=32;break;}this.drawCount++;_context66.next=32;return this.drawPencil(h,r==null?void 0:r.toString());case 32:return _context66.abrupt("break",39);case 33:_context66.t5=h;if(!_context66.t5){_context66.next=38;break;}this.drawCount++;_context66.next=38;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount});case 38:return _context66.abrupt("break",39);case 39:case"end":return _context66.stop();}},_callee63,this);}));function consumeDraw(_x103){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(t){var r,n,s;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:r=t.workId;if(!r){_context67.next=14;break;}n=r.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);s=this.workShapes.get(n);if(s){_context67.next=7;break;}return _context67.abrupt("return");case 7:_context67.t0=s.toolsType;_context67.next=_context67.t0===Tt.Selector?10:_context67.t0===Tt.Arrow?12:_context67.t0===Tt.Straight?12:_context67.t0===Tt.Ellipse?12:_context67.t0===Tt.Pencil?12:_context67.t0===Tt.Rectangle?12:_context67.t0===Tt.Star?12:_context67.t0===Tt.Polygon?12:_context67.t0===Tt.SpeechBalloon?12:_context67.t0===Tt.BitMapEraser?12:_context67.t0===Tt.PencilEraser?12:14;break;case 10:this.drawCount=0,Lr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n),this._post({render:[{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}]});return _context67.abrupt("break",14);case 12:this.drawCount=0,Lr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n);return _context67.abrupt("break",14);case 14:case"end":return _context67.stop();}},_callee64,this);}));function consumeDrawAll(_x104){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t){var r,n,s,c;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context68.next=8;break;}s=this.removeNode(n);if(!s){_context68.next=8;break;}c=[];c.push({rect:ve(s),clearCanvas:Ut.Float,isClear:!0,viewId:this.viewId},{rect:ve(s),drawCanvas:Ut.Float,viewId:this.viewId});_context68.next=8;return this._post({render:c});case 8:case"end":return _context68.stop();}},_callee65,this);}));function removeWork(_x105){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this101=this;var r=this.workShapes.has(t);var n;return r&&(this.fullLayer.getElementsByName(t).forEach(function(s){var c=s.getBoundingClientRect();n=Zt(n,{x:c.x-$t.SafeBorderPadding,y:c.y-$t.SafeBorderPadding,w:c.width+$t.SafeBorderPadding*2,h:c.height+$t.SafeBorderPadding*2}),s.remove(),_pr(s,_this101.fullLayer.parent);}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t,r){return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:_context69.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Ut.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context69.stop();}},_callee66,this);}));function drawPencil(_x106,_x107){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:_context70.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 2:case"end":return _context70.stop();}},_callee67,this);}));function drawShape(_x108){return _drawShape2.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:_context71.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 2:case"end":return _context71.stop();}},_callee68,this);}));function drawSelector(_x109){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(bl);var jM=/*#__PURE__*/function(){function jM(e){_classCallCheck(this,jM);dt(this,"viewId");dt(this,"vNodes");dt(this,"topLayer");dt(this,"thread");dt(this,"post");dt(this,"serviceWorkShapes",/* @__PURE__ */new Map());dt(this,"localWorkShapes",/* @__PURE__ */new Map());dt(this,"tmpOpt");dt(this,"syncUnitTime",vr.syncOpt.interval);dt(this,"animationId");this.viewId=e.viewId,this.vNodes=e.vNodes,this.topLayer=e.topLayer,this.thread=e.thread,this.post=e.thread.post.bind(e.thread);}return _createClass(jM,[{key:"canUseTopLayer",value:function canUseTopLayer(e){return e===Tt.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(e){return this.localWorkShapes.get(e);}},{key:"createWorkShape",value:function createWorkShape(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},r),{},{workId:e}));return n&&this.localWorkShapes.set(e,{node:n,toolsType:n.toolsType,workState:te.Start}),n;}}},{key:"setWorkOptions",value:function setWorkOptions(e,t){var n;var r=(n=this.localWorkShapes.get(e))==null?void 0:n.node;r||this.createWorkShape(e,t),r==null||r.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var t=e.toolsType;if(t===Tt.LaserPen)return To(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(e){var t;return(t=e.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(e){var t;this.tmpOpt=e,(t=e.toolsOpt)!=null&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(e){var t=e.workId,r=e.dataType;if(r===Vt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var c=s.node.consume({data:e,isFullWork:!1,isSubWorker:!0});c.rect&&(s.totalRect=Zt(c.rect,s.totalRect),s.result=c,s.workState=te.Doing,n&&this.localWorkShapes.set(n,s));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(e){var t=e.workId,r=e.dataType;if(r===Vt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var c=s.node.consumeAll({data:e});s.totalRect=Zt(c.rect,s.totalRect),s.result=c,s.workState=te.Done,n&&this.localWorkShapes.set(n,s);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(e,t,r,n){return t.toolsType=r,t.node=this.createWorkShapeNode({workId:e,toolsType:r,toolsOpt:n}),t;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(e){var y,T;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.updateNodeOpt,l=e.ops,f=e.op;if(!t)return;var h=t.toString(),m=(y=this.vNodes.get(h))==null?void 0:y.rect;if(!((T=this.serviceWorkShapes)!=null&&T.has(h))){var E={toolsType:n,animationWorkData:f||[],animationIndex:0,type:s,updateNodeOpt:c,ops:l,oldRect:m};n&&r&&(E=this.setNodeKey(h,E,n,r)),this.serviceWorkShapes.set(h,E);}var u=this.serviceWorkShapes.get(h);s&&(u.type=s),l&&(u.animationWorkData=yi(l),u.ops=l),c&&(u.updateNodeOpt=c),f&&(u.animationWorkData=f),u.node&&u.node.getWorkId()!==h&&u.node.setWorkId(h),m&&(u.oldRect=m),n&&r&&(u.toolsType!==n&&n&&r&&this.setNodeKey(h,u,n,r),u.node&&u.node.setWorkOptions(r));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(e,t){var r=Math.floor((e.animationWorkData||[]).slice(e.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(){var _this102=this;var c,l,f,h,e,t,r,n,s,_iterator67,_step67,_step67$value,m,u,T,E,C,x,_iterator68,_step68,_step68$value,_m14,_u7,y,_T11,_E3,_C5,_x110;return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:this.animationId=void 0;e=!1;t=/* @__PURE__ */new Map(),r=[],n=[],s=[];_iterator67=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context72.prev=4;_iterator67.s();case 6:if((_step67=_iterator67.n()).done){_context72.next=20;break;}_step67$value=_slicedToArray(_step67.value,2),m=_step67$value[0],u=_step67$value[1];_context72.t0=u.toolsType;_context72.next=_context72.t0===Tt.LaserPen?11:18;break;case 11:T=this.computNextAnimationIndex(u,8),E=Math.max(0,u.animationIndex||0),C=(u.animationWorkData||[]).slice(E,T);if((u.animationIndex||0)<T){x=(c=u.node)==null?void 0:c.consumeService({op:C,isFullWork:!1});u.totalRect=Zt(u.totalRect,x),u.animationIndex=T,C.length&&t.set(m,{workState:E===0?te.Start:T===((l=u.animationWorkData)==null?void 0:l.length)?te.Done:te.Doing,op:C.slice(-2)});}if(!(n.push({isClear:!0,rect:u.totalRect,clearCanvas:Ut.TopFloat,viewId:this.viewId}),r.push({rect:u.totalRect,drawCanvas:Ut.TopFloat,viewId:this.viewId}),u.isDel)){_context72.next=16;break;}(f=u.node)==null||f.clearTmpPoints(),this.serviceWorkShapes["delete"](m);return _context72.abrupt("break",18);case 16:u.ops&&u.animationIndex===((h=u.animationWorkData)==null?void 0:h.length)&&!u.isDel&&(this.topLayer.getElementsByName(m.toString())[0]||(u.isDel=!0,this.serviceWorkShapes.set(m,u))),e=!0;return _context72.abrupt("break",18);case 18:_context72.next=6;break;case 20:_context72.next=25;break;case 22:_context72.prev=22;_context72.t1=_context72["catch"](4);_iterator67.e(_context72.t1);case 25:_context72.prev=25;_iterator67.f();return _context72.finish(25);case 28:_iterator68=_createForOfIteratorHelper(this.localWorkShapes.entries());_context72.prev=29;_iterator68.s();case 31:if((_step68=_iterator68.n()).done){_context72.next=44;break;}_step68$value=_slicedToArray(_step68.value,2),_m14=_step68$value[0],_u7=_step68$value[1];y=_u7.result,_T11=_u7.toolsType,_E3=_u7.totalRect,_C5=_u7.isDel,_x110=_u7.workState;_context72.t2=_T11;_context72.next=_context72.t2===Tt.LaserPen?37:42;break;case 37:if(!(_E3&&(n.push({isClear:!0,rect:_E3,clearCanvas:Ut.TopFloat,viewId:this.viewId}),r.push({rect:_E3,drawCanvas:Ut.TopFloat,viewId:this.viewId})),_C5)){_context72.next=40;break;}_u7.node.clearTmpPoints(),this.localWorkShapes["delete"](_m14),s.push({removeIds:[_m14.toString()],viewId:this.viewId,type:xt.RemoveNode});return _context72.abrupt("break",42);case 40:y&&((y.op||y.ops)&&s.push(y),_u7.result=void 0),!this.topLayer.getElementsByName(_m14.toString())[0]&&_x110===te.Done&&(_u7.isDel=!0,this.localWorkShapes.set(_m14,_u7)),e=!0;return _context72.abrupt("break",42);case 42:_context72.next=31;break;case 44:_context72.next=49;break;case 46:_context72.prev=46;_context72.t3=_context72["catch"](29);_iterator68.e(_context72.t3);case 49:_context72.prev=49;_iterator68.f();return _context72.finish(49);case 52:e&&this.runAnimation(),t.size&&t.forEach(function(m,u){s.push({type:xt.Cursor,uid:u.split(mi)[0],op:m.op,workState:m.workState,viewId:_this102.viewId});}),(r.length||n.length||s.length)&&this.post({render:[].concat(n,r),sp:s});case 53:case"end":return _context72.stop();}},_callee69,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this103=this;this.animationId||(this.animationId=setTimeout(function(){_this103.animationId=void 0,_this103.animationDraw();},16));}}]);}();var GM=/*#__PURE__*/function(_ed){function GM(t){var _this104;_classCallCheck(this,GM);_this104=_callSuper(this,GM,[t]);dt(_this104,"_type","simple");return _this104;}_inherits(GM,_ed);return _createClass(GM,[{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var n;var r=t.toolsType;return r===Tt.Selector?this.vNodes?new Gi(_objectSpread(_objectSpread({},t),{},{fullLayer:this.fullLayer,vNodes:this.vNodes,drawLayer:this.drawLayer})):void 0:To(_objectSpread(_objectSpread({},t),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(n=this.thread)==null?void 0:n.serviceWork);}},{key:"drawPencil",value:function(){var _drawPencil3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t,r){return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:_context73.next=2;return this._post({consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Ut.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context73.stop();}},_callee70,this);}));function drawPencil(_x111,_x112){return _drawPencil3.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(t){return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:_context74.next=2;return this._post({consumeCount:this.consumeCount,sp:(t==null?void 0:t.op)&&[t],render:[{rect:(t==null?void 0:t.rect)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 2:case"end":return _context74.stop();}},_callee71,this);}));function drawShape(_x113){return _drawShape3.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(t,r){var n,c,l,f,s,_args75=arguments;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:n=_args75.length>2&&_args75[2]!==undefined?_args75[2]:[];s={render:n,sp:[t],consumeCount:this.consumeCount};r&&((c=s.sp)==null||c.push({type:xt.None,isLockSentEventCursor:r}));t.subRect&&((l=s.render)==null||l.push({rect:ve(t.subRect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:ve(t.subRect),drawCanvas:Ut.Float,viewId:this.viewId}));t.rect&&((f=s.render)==null||f.push({rect:ve(t.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(t.rect),drawCanvas:Ut.Bg,viewId:this.viewId}));_context75.next=7;return this._post(s);case 7:case"end":return _context75.stop();}},_callee72,this);}));function drawSelector(_x114,_x115){return _drawSelector3.apply(this,arguments);}return drawSelector;}()},{key:"drawEraserCombine",value:function(){var _drawEraserCombine2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(t){var n,s,c,l,r,f,h,m,u,_iterator69,_step69,_step69$value,_u8,y;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:r=(n=this.workShapes.get(t))==null?void 0:n.combineConsume({workerEngine:this});if(!r){_context76.next=7;break;}f=r.willDeleteNodes,h=r.willNewNodes,m={render:[],sp:[]};if(r!=null&&r.rect){u=ve(r.rect);(s=m.render)==null||s.push({rect:u,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:u,drawCanvas:Ut.Bg,viewId:this.viewId});}if(f!=null&&f.size&&((c=m.sp)==null||c.push({type:xt.RemoveNode,removeIds:_toConsumableArray(f),viewId:this.thread.viewId})),h!=null&&h.size){_iterator69=_createForOfIteratorHelper(h);try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){_step69$value=_slicedToArray(_step69.value,2),_u8=_step69$value[0],y=_step69$value[1];(l=m.sp)==null||l.push({type:xt.FullWork,dataType:Vt.Local,toolsType:Tt.Pencil,ops:gr(y.op),opt:y.opt,workId:_u8,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}_context76.next=7;return this._post(m);case 7:case"end":return _context76.stop();}},_callee73,this);}));function drawEraserCombine(_x116){return _drawEraserCombine2.apply(this,arguments);}return drawEraserCombine;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t,r){var _this105=this;var n,s,c,l,f,h,m,u,y;return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:n=t.op,s=t.workId,c=t.scenePath,l=t.postCount,f=t.smoothSync;if(!(n!=null&&n.length&&s)){_context77.next=42;break;}h=s.toString(),m=this.getWorkShape(h);if(m){_context77.next=5;break;}return _context77.abrupt("return");case 5:u=m.toolsType;if(!(u===Tt.LaserPen)){_context77.next=8;break;}return _context77.abrupt("return");case 8:_context77.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==h;if(!_context77.t0){_context77.next=13;break;}_context77.next=12;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:c,viewId:this.viewId,msgType:xt.DrawWork,dataType:Vt.Local},r);case 12:this.drawWorkActiveId=void 0;case 13:!this.drawWorkActiveId&&h!==Me&&(this.drawWorkActiveId=h);er(l)&&(this.consumeCount=l);y=m.consume({data:t,isSimpleWorker:!0,smoothSync:f});_context77.t1=u;_context77.next=_context77.t1===Tt.Selector?19:_context77.t1===Tt.PencilEraser?24:_context77.t1===Tt.BitMapEraser?24:_context77.t1===Tt.Eraser?29:_context77.t1===Tt.Arrow?32:_context77.t1===Tt.Straight?32:_context77.t1===Tt.Ellipse?32:_context77.t1===Tt.Rectangle?32:_context77.t1===Tt.Star?32:_context77.t1===Tt.Polygon?32:_context77.t1===Tt.SpeechBalloon?32:_context77.t1===Tt.Pencil?38:42;break;case 19:this.drawCount++;y.type===xt.Select&&y.selectIds&&r.runReverseSelectWork(y.selectIds);_context77.next=23;return this.drawSelector(y);case 23:return _context77.abrupt("break",42);case 24:this.drawCount++;this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=h,this.drawEraserCombine(h).then(function(){_this105.combineTimerId=void 0;}));_context77.next=28;return this._post({consumeCount:this.consumeCount});case 28:return _context77.abrupt("break",42);case 29:_context77.next=31;return this.drawEraser(y);case 31:return _context77.abrupt("break",42);case 32:_context77.t2=y;if(!_context77.t2){_context77.next=37;break;}this.drawCount++;_context77.next=37;return this.drawShape(y);case 37:return _context77.abrupt("break",42);case 38:this.drawCount++;_context77.next=41;return this.drawPencil(y,h);case 41:return _context77.abrupt("break",42);case 42:case"end":return _context77.stop();}},_callee74,this);}));function consumeDraw(_x117,_x118){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t,r){var l,f,h,n,s,c,m,u,y,T,E,C,x;return _regeneratorRuntime().wrap(function _callee75$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,s=t.scenePath,c=t.isLockSentEventCursor;if(!n){_context78.next=40;break;}m=n.toString();this.drawWorkActiveId===m&&(this.drawWorkActiveId=void 0);u=this.workShapes.get(m);if(u){_context78.next=8;break;}return _context78.abrupt("return");case 8:y=u.toolsType;if(!(y===Tt.LaserPen)){_context78.next=11;break;}return _context78.abrupt("return");case 11:T=this.workShapes.get(di),E=(l=T==null?void 0:T.selectIds)==null?void 0:l[0],C=u.consumeAll({data:t,workerEngine:this});_context78.t0=y;_context78.next=_context78.t0===Tt.Selector?15:_context78.t0===Tt.PencilEraser?23:_context78.t0===Tt.BitMapEraser?23:_context78.t0===Tt.Eraser?28:_context78.t0===Tt.Arrow?30:_context78.t0===Tt.Straight?30:_context78.t0===Tt.Ellipse?30:_context78.t0===Tt.Rectangle?30:_context78.t0===Tt.Star?30:_context78.t0===Tt.Polygon?30:_context78.t0===Tt.SpeechBalloon?30:_context78.t0===Tt.Pencil?35:40;break;case 15:x=[];this.drawLayer&&(this.drawCount=0,Lr(this.drawLayer,this.drawLayer.parent),this.getWorkShape(m).clearSubTmpPoints(),x.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}));C.selectIds&&E&&(f=C.selectIds)!=null&&f.includes(E)&&T.cursorBlur();C.selectIds&&r.runReverseSelectWork(C.selectIds);_context78.next=21;return this.drawSelector(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c,x);case 21:(h=u.selectIds)!=null&&h.length?u.clearTmpPoints():this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 23:_context78.next=25;return this.drawEraserFull(u,_objectSpread(_objectSpread({},C),{},{scenePath:s}),c);case 25:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 28:this.drawEraser(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c),u.clearTmpPoints();return _context78.abrupt("break",40);case 30:_context78.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c);case 32:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 35:_context78.next=37;return this.drawPencilFull(_objectSpread(_objectSpread({},C),{},{scenePath:s}),c);case 37:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 40:case"end":return _context78.stop();}},_callee75,this);}));function consumeDrawAll(_x119,_x120){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()}]);}(ed);var HM=/*#__PURE__*/function(_rd){function HM(t){var _this106;_classCallCheck(this,HM);_this106=_callSuper(this,HM,[t]);dt(_this106,"_type","simple");return _this106;}_inherits(HM,_rd);return _createClass(HM,[{key:"animationDraw",value:function(){var _animationDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){var _this107=this;var s,c,l,f,h,m,u,y,T,E,C,x,I,d,v,p,S,A,R,D,U,M,W,Y,B,N,G,J,tt,at,ut,K,Q,ft,gt,mt,wt,ht,Nt,Rt,t,r,n,_iterator70,_step70,_loop7;return _regeneratorRuntime().wrap(function _callee76$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:this.animationId=void 0;t=!1;r={render:[]},n=/* @__PURE__ */new Map();_iterator70=_createForOfIteratorHelper(this.workShapes.entries());_context80.prev=4;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step70$value,X,z,q,nt,_q5,_nt3,_q6,_nt4,j,Z,_q7,_nt5,_j4,_Z3,O,L,$,_L,_q8,_nt6,_j5,_Z4;return _regeneratorRuntime().wrap(function _loop7$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_step70$value=_slicedToArray(_step70.value,2),X=_step70$value[0],z=_step70$value[1];_context79.t0=z.toolsType;_context79.next=_context79.t0===Tt.Image?4:_context79.t0===Tt.Text?11:_context79.t0===Tt.Arrow?19:_context79.t0===Tt.Straight?19:_context79.t0===Tt.Rectangle?19:_context79.t0===Tt.Ellipse?19:_context79.t0===Tt.Star?19:_context79.t0===Tt.Polygon?19:_context79.t0===Tt.SpeechBalloon?19:_context79.t0===Tt.Pencil?22:38;break;case 4:q=z.oldRect;q&&((s=r.render)==null||s.push({rect:q,isClear:!0,clearCanvas:Ut.Bg,viewId:_this107.viewId}),(c=r.render)==null||c.push({rect:q,drawCanvas:Ut.Bg,viewId:_this107.viewId}));_context79.next=8;return(l=z.node)==null?void 0:l.consumeServiceAsync({isFullWork:!0,worker:_this107.thread});case 8:nt=_context79.sent;_this107.selectorWorkShapes.forEach(function(j,Z){var O;(O=j.selectIds)!=null&&O.includes(X)&&(_this107.willRunEffectSelectorIds.add(Z),_this107.noAnimationRect=Zt(_this107.noAnimationRect,q),_this107.noAnimationRect=Zt(_this107.noAnimationRect,nt),_this107.runEffect());}),_this107.workShapes["delete"](X),(f=r.render)==null||f.push({rect:nt,drawCanvas:Ut.Bg,viewId:_this107.viewId});return _context79.abrupt("break",38);case 11:if(!z.node){_context79.next=18;break;}_q5=z.oldRect;_q5&&((h=r.render)==null||h.push({rect:_q5,isClear:!0,clearCanvas:Ut.Bg,viewId:_this107.viewId}),(m=r.render)==null||m.push({rect:_q5,drawCanvas:Ut.Bg,viewId:_this107.viewId}));_context79.next=16;return z.node.consumeServiceAsync({isFullWork:!0,replaceId:X,boxRect:_this107.thread.getSceneRect()});case 16:_nt3=_context79.sent;_this107.selectorWorkShapes.forEach(function(j,Z){var O;(O=j.selectIds)!=null&&O.includes(X)&&(_this107.willRunEffectSelectorIds.add(Z),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_q5),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_nt3),_this107.runEffect());}),(u=z.node)==null||u.clearTmpPoints(),_this107.workShapes["delete"](X),(y=r.render)==null||y.push({rect:_nt3,drawCanvas:Ut.Bg,viewId:_this107.viewId});case 18:return _context79.abrupt("break",38);case 19:_q6=!!z.ops;if((T=z.animationWorkData)!=null&&T.length){_nt4=z.oldRect,j=z.node.oldRect;_nt4&&((E=r.render)==null||E.push({rect:_nt4,isClear:!0,clearCanvas:Ut.Bg,viewId:_this107.viewId}),(C=r.render)==null||C.push({rect:_nt4,drawCanvas:Ut.Bg,viewId:_this107.viewId})),j&&((x=r.render)==null||x.push({rect:j,isClear:!0,clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}));Z=(I=z.node)==null?void 0:I.consumeService({op:z.animationWorkData,isFullWork:_q6});z.isEnableCursor?n.set(X,{workState:_nt4?z.ops?te.Done:te.Doing:te.Start,op:z.animationWorkData.slice(-3,-1)}):_q6&&!z.useAnimation&&(d=z.updateNodeOpt)!=null&&d.useAnimation&&n.set(X,{workState:te.Done,op:z.animationWorkData.slice(-3,-1),uid:(v=z.updateNodeOpt)==null?void 0:v.uid}),_q6?(_this107.selectorWorkShapes.forEach(function(O,L){var $;($=O.selectIds)!=null&&$.includes(X)&&(_this107.willRunEffectSelectorIds.add(L),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_nt4),_this107.noAnimationRect=Zt(_this107.noAnimationRect,j),_this107.noAnimationRect=Zt(_this107.noAnimationRect,Z),_this107.runEffect());}),(p=z.node)==null||p.clearTmpPoints(),_this107.workShapes["delete"](X),(S=r.render)==null||S.push({rect:Z,drawCanvas:Ut.Bg,viewId:_this107.viewId})):(A=r.render)==null||A.push({rect:Z,drawCanvas:Ut.ServiceFloat,workerType:_q6?void 0:Vt.Service,viewId:_this107.viewId}),z.animationWorkData.length=0;}return _context79.abrupt("break",38);case 22:if(!z.useAnimation){_context79.next=33;break;}if(!z.useAnimation){_context79.next=31;break;}if(!z.isDel){_context79.next=27;break;}(ut=z.node)==null||ut.clearTmpPoints(),_this107.workShapes["delete"](X);return _context79.abrupt("break",38);case 27:_q7=3,_nt5=_this107.computNextAnimationIndex(z,_q7),_j4=z.isDiff?0:Math.max(0,(z.animationIndex||0)-_q7),_Z3=(z.animationWorkData||[]).slice(0,_nt5),O=(Q=(K=z.node)==null?void 0:K.getWorkId())==null?void 0:Q.toString();if((z.animationIndex||0)<_nt5||z.isDiff){L=(ft=z.node)==null?void 0:ft.consumeService({op:_Z3,isFullWork:!1,replaceId:O});if((gt=r.render)==null||gt.push({isClear:!0,rect:L,clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),(mt=r.render)==null||mt.push({rect:L,drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),z.animationIndex=_nt5,z.isDiff&&(z.isDiff=!1),_Z3.length&&z.isEnableCursor){$=_Z3.slice(-3,-1);n.set(X,{workState:_j4===0?te.Start:_nt5===((wt=z.animationWorkData)==null?void 0:wt.length)?te.Done:te.Doing,op:$});}}else if(z.ops){_L=(ht=z.node)==null?void 0:ht.consumeService({op:z.animationWorkData||[],isFullWork:!0,replaceId:O});z.isDel=!0,(Nt=r.render)==null||Nt.push({isClear:!0,rect:_L,clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId},{rect:_L,drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId},{isClear:!0,rect:_L,clearCanvas:Ut.Bg,viewId:_this107.viewId},{rect:_L,drawCanvas:Ut.Bg,viewId:_this107.viewId}),z.isEnableCursor&&n.set(X,{workState:te.Done,op:_Z3.slice(-3,-1)});}t=!0;return _context79.abrupt("break",38);case 31:_context79.next=37;break;case 33:_q8=!!z.ops;_nt6=(R=z.node)==null?void 0:R.consumeService({op:z.animationWorkData||[],isFullWork:_q8,replaceId:X});_j5=(D=z.node)==null?void 0:D.updataOptService(z.updateNodeOpt);if(_q8){if(_nt6=Zt(_nt6,_j5),(U=r.render)==null||U.push({isClear:!0,rect:Zt(z.oldRect,_nt6),clearCanvas:Ut.Bg,viewId:_this107.viewId}),(M=r.render)==null||M.push({rect:Zt(z.oldRect,_nt6),drawCanvas:Ut.Bg,viewId:_this107.viewId}),(W=z.updateNodeOpt)!=null&&W.useAnimation&&((Y=r.render)==null||Y.push({isClear:!0,rect:Zt(z.oldRect,_nt6),clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),(B=r.render)==null||B.push({rect:Zt(z.oldRect,_nt6),drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),!z.isEnableCursor&&(N=z.animationWorkData)!=null&&N.length)){_Z4=z.animationWorkData.slice(-3,-1);n.set(X,{workState:te.Done,op:_Z4,uid:(G=z.updateNodeOpt)==null?void 0:G.uid});}_this107.selectorWorkShapes.forEach(function(Z,O){var L;(L=Z.selectIds)!=null&&L.includes(X)&&(_this107.willRunEffectSelectorIds.add(O),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_nt6),_this107.runEffect());}),(J=z.node)==null||J.clearTmpPoints(),_this107.workShapes["delete"](X);}else _nt6=Zt(_nt6,_j5),(tt=r.render)==null||tt.push({isClear:!0,rect:Zt(z.oldRect,_nt6),clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),(at=r.render)==null||at.push({rect:Zt(z.oldRect,_nt6),drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId});case 37:return _context79.abrupt("break",38);case 38:case"end":return _context79.stop();}},_loop7);});_iterator70.s();case 7:if((_step70=_iterator70.n()).done){_context80.next=11;break;}return _context80.delegateYield(_loop7(),"t0",9);case 9:_context80.next=7;break;case 11:_context80.next=16;break;case 13:_context80.prev=13;_context80.t1=_context80["catch"](4);_iterator70.e(_context80.t1);case 16:_context80.prev=16;_iterator70.f();return _context80.finish(16);case 19:t&&this.runAnimation();n.size&&(r.sp=[],n.forEach(function(X,z){var q;(q=r.sp)==null||q.push({type:xt.Cursor,uid:X.uid||z.split(mi)[0],op:X.op,workState:X.workState,viewId:_this107.viewId});}));_context80.t2=(Rt=r.render)!=null&&Rt.length;if(!_context80.t2){_context80.next=25;break;}_context80.next=25;return this.post(r);case 25:case"end":return _context80.stop();}},_callee76,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw3.apply(this,arguments);}return animationDraw;}()}]);}(rd);var nd=/*#__PURE__*/function(_bl3){function nd(t){var _this108;_classCallCheck(this,nd);_this108=_callSuper(this,nd,[t]);dt(_this108,"opt");dt(_this108,"scene");dt(_this108,"cameraOpt");dt(_this108,"vNodes");_this108.opt=t,_this108.vNodes=void 0;return _this108;}_inherits(nd,_bl3);return _createClass(nd,[{key:"createSnapshotFullLayer",value:function createSnapshotFullLayer(t,r){this.scene=this.opt.createScene(t),this.fullLayer=this.opt.createLayer("snapshotFullLayer",this.scene,r);}},{key:"destroySnapshotFullLayer",value:function destroySnapshotFullLayer(){var t,r,n;Lr(this.fullLayer,this.fullLayer.parent),(t=this.fullLayer)==null||t.disconnect(),(r=this.fullLayer)==null||r.remove(),(n=this.scene)==null||n.remove(),this.scene=void 0;}},{key:"updateScene",value:function updateScene(t){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");this.scene.attr(_objectSpread({},t));var r=t.width,n=t.height;this.scene.width=r,this.scene.height=n,this.updateLayer({width:r,height:n});}},{key:"updateLayer",value:function updateLayer(t){if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");var r=t.width,n=t.height;this.fullLayer.parent.setAttribute("width",r),this.fullLayer.parent.setAttribute("height",n),this.fullLayer.setAttribute("size",[r,n]),this.fullLayer.setAttribute("pos",[r*0.5,n*0.5]);}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var r=t.scale,n=t.centerX,s=t.centerY,c=t.width,l=t.height;if(!this.scene)throw new Error("SnapshotWork scene is not initialized");if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");(c!==this.scene.width||l!==this.scene.height)&&this.updateScene({width:c,height:l}),this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-s]);}},{key:"getOffscreen",value:function getOffscreen(){var r;return((r=this.fullLayer)==null?void 0:r.parent).canvas;}},{key:"getRectImageBitmap",value:function getRectImageBitmap(t,r){var n=t.rect,s=this.thread.dpr,c=Math.floor(n.x*s),l=Math.floor(n.y*s),f=Math.floor(n.w*s),h=Math.floor(n.h*s);return createImageBitmap(this.getOffscreen(),c,l,f,h,r);}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(t){var r,n,s,c,l,f,_i4,_Object$entries,_Object$entries$_i,m,u,y,T,E,h;return _regeneratorRuntime().wrap(function _callee77$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt,c=t.w,l=t.h;if(!(r&&n&&s&&this.fullLayer)){_context81.next=23;break;}this.setCameraOpt(s);_i4=0,_Object$entries=Object.entries(n);case 4:if(!(_i4<_Object$entries.length)){_context81.next=20;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),m=_Object$entries$_i[0],u=_Object$entries$_i[1];if(!(u!=null&&u.type)){_context81.next=17;break;}_context81.t0=u==null?void 0:u.type;_context81.next=_context81.t0===xt.UpdateNode?10:_context81.t0===xt.FullWork?10:17;break;case 10:y=u.opt;T=_objectSpread(_objectSpread({},u),{},{opt:y,workId:m,msgType:xt.FullWork,dataType:Vt.Service,viewId:this.viewId});_context81.next=14;return this.runFullWork(T);case 14:E=_context81.sent;f=Zt(f,E);return _context81.abrupt("break",17);case 17:_i4++;_context81.next=4;break;case 20:c&&l&&(h={resizeWidth:c,resizeHeight:l});_context81.next=23;return this.getSnapshotRender({scenePath:r,options:h});case 23:case"end":return _context81.stop();}},_callee77,this);}));function getSnapshot(_x121){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t){var s,r,n,c,l,f;return _regeneratorRuntime().wrap(function _callee78$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:r=this.setFullWork(t),n=t.ops&&yi(t.ops);if(!r){_context82.next=18;break;}f=(s=r.getWorkId())==null?void 0:s.toString();if(!(r.toolsType===Tt.Image)){_context82.next=9;break;}_context82.next=6;return r.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 6:c=_context82.sent;_context82.next=16;break;case 9:if(!(r.toolsType===Tt.Text)){_context82.next=15;break;}_context82.next=12;return r.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:!0});case 12:c=_context82.sent;_context82.next=16;break;case 15:c=r.consumeService({op:n,isFullWork:!0,replaceId:f}),l=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context82.abrupt("return",Zt(c,l));case 18:case"end":return _context82.stop();}},_callee78,this);}));function runFullWork(_x122){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"getSceneRect",value:function getSceneRect(){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");var _this$scene2=this.scene,t=_this$scene2.width,r=_this$scene2.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(r)};}},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t){var c,r,n,s;return _regeneratorRuntime().wrap(function _callee79$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:r=t.scenePath,n=t.options;((c=this.fullLayer)==null?void 0:c.parent).render();_context83.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Ut.None},n);case 4:s=_context83.sent;s&&(this.thread._post({sp:[{type:xt.Snapshot,scenePath:r,imageBitmap:s,viewId:this.viewId}]},[s]),s.close());case 6:case"end":return _context83.stop();}},_callee79,this);}));function getSnapshotRender(_x123){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){var r,n,s,c,_i5,_Object$entries2,_Object$entries2$_i,l,f,h;return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt;if(!(r&&n&&s&&this.fullLayer)){_context84.next=19;break;}this.setCameraOpt(s);_i5=0,_Object$entries2=Object.entries(n);case 4:if(!(_i5<_Object$entries2.length)){_context84.next=18;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),l=_Object$entries2$_i[0],f=_Object$entries2$_i[1];if(!(f!=null&&f.type)){_context84.next=15;break;}_context84.t0=f==null?void 0:f.type;_context84.next=_context84.t0===xt.UpdateNode?10:_context84.t0===xt.FullWork?10:15;break;case 10:_context84.next=12;return this.runFullWork(_objectSpread(_objectSpread({},f),{},{workId:l,msgType:xt.FullWork,dataType:Vt.Service,viewId:this.viewId}));case 12:h=_context84.sent;c=Zt(c,h);return _context84.abrupt("break",15);case 15:_i5++;_context84.next=4;break;case 18:c&&this.thread._post({sp:[{type:xt.BoundingBox,scenePath:r,rect:c,viewId:this.viewId}]});case 19:case"end":return _context84.stop();}},_callee80,this);}));function getBoundingRect(_x124){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(bl);var uo=/* @__PURE__ */function(i){return i.Full="full",i.Sub="sub",i;}(uo||{});var kM=/*#__PURE__*/function(){function kM(e,t){var _this109=this;_classCallCheck(this,kM);dt(this,"_self");dt(this,"version",vh);dt(this,"type");// protected hasPriorityDraw: boolean = true;
515
+ dt(this,"workThreadMap",/* @__PURE__ */new Map());dt(this,"post",function(e,t){t?_this109._self.postMessage(e,t):_this109._self.postMessage(e);});this._self=e,this.type=t,this.register();}return _createClass(kM,[{key:"init",value:function init(e){var t=e.viewId,r=e.dpr,n=e.offscreenCanvasOpt,s=e.layerOpt,c=e.isSafari,l=e.combineUnitTime,f=e.syncUnitTime,h=e.maxCombineEraserTime,m=e.offscreenCanvas,u=e.isUseSimple;if(!r||!n||!s)return;var y;this.type==="full"&&(u?y=new KM(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,combineUnitTime:l,syncUnitTime:f,maxCombineEraserTime:h,offscreenCanvas:m},this.post):y=new sd(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,combineUnitTime:l,syncUnitTime:f,maxCombineEraserTime:h},this.post)),this.type==="sub"&&!u&&(y=new id(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,isUseSimple:u},this.post)),y&&c&&y.setIsSafari(c),y&&e.cameraOpt&&y.setCameraOpt(e.cameraOpt),y&&this.workThreadMap.set(t,y);}},{key:"setFontFaces",value:function(){var _setFontFaces=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(e){var _this110=this;var t,r,_iterator71,_step71,_loop8;return _regeneratorRuntime().wrap(function _callee81$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:t=[],r=[];_iterator71=_createForOfIteratorHelper(e);_context86.prev=2;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var n,s,c,l,f,h,m,u,y;return _regeneratorRuntime().wrap(function _loop8$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:n=_step71.value;s=n.fontFamily,c=n.buffer;_context85.prev=2;if(!(!c||c.byteLength===0)){_context85.next=5;break;}throw new Error("Invalid font data for ".concat(s,": empty buffer"));case 5:try{l=new FontFace(s,c);}catch(_unused29){f=new Uint8Array(c);l=new FontFace(s,f);}_context85.next=8;return _this110._self.fonts.add(l);case 8:_context85.prev=8;_context85.next=11;return l.loaded;case 11:t.push(s);_context85.next=49;break;case 14:_context85.prev=14;_context85.t0=_context85["catch"](8);h=_this110._self.fonts;if(!(h&&typeof h.load=="function")){_context85.next=42;break;}_context85.prev=18;m=h.load(s);u=new Promise(function(T,E){return setTimeout(function(){return E(new Error("Font load timeout for ".concat(s)));},5e3);});_context85.next=23;return Promise.race([m,u]);case 23:y=_context85.sent;if(!(y&&y.length>0)){_context85.next=28;break;}t.push(s);_context85.next=29;break;case 28:throw new Error("Font ".concat(s," load returned empty result"));case 29:_context85.next=40;break;case 31:_context85.prev=31;_context85.t1=_context85["catch"](18);_context85.next=35;return _this110.isFontAvailable(s);case 35:if(!_context85.sent){_context85.next=39;break;}t.push(s);_context85.next=40;break;case 39:throw _context85.t1;case 40:_context85.next=49;break;case 42:_context85.next=44;return _this110.isFontAvailable(s);case 44:if(!_context85.sent){_context85.next=48;break;}t.push(s);_context85.next=49;break;case 48:throw _context85.t0;case 49:_context85.next=54;break;case 51:_context85.prev=51;_context85.t2=_context85["catch"](2);console.error("Font ".concat(s," load error: ").concat(_context85.t2)),r.push(s);case 54:case"end":return _context85.stop();}},_loop8,null,[[2,51],[8,14],[18,31]]);});_iterator71.s();case 5:if((_step71=_iterator71.n()).done){_context86.next=9;break;}return _context86.delegateYield(_loop8(),"t0",7);case 7:_context86.next=5;break;case 9:_context86.next=14;break;case 11:_context86.prev=11;_context86.t1=_context86["catch"](2);_iterator71.e(_context86.t1);case 14:_context86.prev=14;_iterator71.f();return _context86.finish(14);case 17:this.post({sp:[{type:xt.SetFontFace,setFontFaceResult:!0,failedFonts:r.length>0?r:void 0}]});case 18:case"end":return _context86.stop();}},_callee81,this,[[2,11,14,17]]);}));function setFontFaces(_x125){return _setFontFaces.apply(this,arguments);}return setFontFaces;}()// 检查字体是否可用
516
+ },{key:"isFontAvailable",value:function(){var _isFontAvailable=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e){var t,r,n,_iterator72,_step72,_s3,s;return _regeneratorRuntime().wrap(function _callee82$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:_context87.prev=0;t=this._self.fonts;if(t){_context87.next=4;break;}return _context87.abrupt("return",!1);case 4:r=!1,n=null;_iterator72=_createForOfIteratorHelper(t);_context87.prev=6;_iterator72.s();case 8:if((_step72=_iterator72.n()).done){_context87.next=15;break;}_s3=_step72.value;if(!(_s3.family===e)){_context87.next=13;break;}r=!0,n=_s3;return _context87.abrupt("break",15);case 13:_context87.next=8;break;case 15:_context87.next=20;break;case 17:_context87.prev=17;_context87.t0=_context87["catch"](6);_iterator72.e(_context87.t0);case 20:_context87.prev=20;_iterator72.f();return _context87.finish(20);case 23:if(!(!r||!n)){_context87.next=25;break;}return _context87.abrupt("return",!1);case 25:if(!(n.status==="loaded")){_context87.next=27;break;}return _context87.abrupt("return",!0);case 27:_context87.prev=27;_context87.next=30;return n.loaded;case 30:return _context87.abrupt("return",!0);case 33:_context87.prev=33;_context87.t1=_context87["catch"](27);if(!(t&&typeof t.load=="function")){_context87.next=48;break;}_context87.prev=36;_context87.next=39;return t.load(e);case 39:s=_context87.sent;return _context87.abrupt("return",s&&s.length>0);case 43:_context87.prev=43;_context87.t2=_context87["catch"](36);return _context87.abrupt("return",!1);case 46:_context87.next=49;break;case 48:return _context87.abrupt("return",!0);case 49:_context87.next=54;break;case 51:_context87.prev=51;_context87.t3=_context87["catch"](0);return _context87.abrupt("return",!1);case 54:case"end":return _context87.stop();}},_callee82,this,[[0,51],[6,17,20,23],[27,33],[36,43]]);}));function isFontAvailable(_x126){return _isFontAvailable.apply(this,arguments);}return isFontAvailable;}()},{key:"register",value:function register(){var _this111=this;onmessage=/*#__PURE__*/function(){var _ref171=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(e){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,n,s,c,l,f,_iterator73,_step73,_step73$value,m,u,y,_iterator74,_step74,_m15,h;return _regeneratorRuntime().wrap(function _callee83$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:t=e.data;if(!t){_context88.next=54;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context88.prev=4;_iterator=_asyncIterator(t.values());case 6:_context88.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context88.sent).done)){_context88.next=38;break;}r=_step.value;n=r.msgType,s=r.viewId,c=r.tasksqueue,l=r.mainTasksqueueCount,f=r.fontBuffers;if(!f){_context88.next=14;break;}_this111.setFontFaces(f);return _context88.abrupt("continue",35);case 14:if(!(n===xt.Console)){_context88.next=17;break;}console.log(_this111);return _context88.abrupt("continue",35);case 17:if(!(n===xt.Init)){_context88.next=20;break;}_this111.init(r);return _context88.abrupt("continue",35);case 20:if(!(n===xt.TasksQueue&&c!=null&&c.size)){_context88.next=25;break;}_iterator73=_createForOfIteratorHelper(_this111.workThreadMap.entries());try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){_step73$value=_slicedToArray(_step73.value,2),m=_step73$value[0],u=_step73$value[1];y=c.get(m);y&&u.on(y);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}_this111.type==="full"&&er(l)&&_this111.post({workerTasksqueueCount:l});return _context88.abrupt("continue",35);case 25:if(!(s===e1)){_context88.next=29;break;}_iterator74=_createForOfIteratorHelper(_this111.workThreadMap.values());try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){_m15=_step74.value;_m15.on(r),n===xt.Destroy&&_this111.workThreadMap["delete"](s);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}return _context88.abrupt("continue",35);case 29:h=_this111.workThreadMap.get(s);_context88.t0=h;if(!_context88.t0){_context88.next=35;break;}_context88.next=34;return h.on(r);case 34:n===xt.Destroy&&_this111.workThreadMap["delete"](s);case 35:_iteratorAbruptCompletion=false;_context88.next=6;break;case 38:_context88.next=44;break;case 40:_context88.prev=40;_context88.t1=_context88["catch"](4);_didIteratorError=true;_iteratorError=_context88.t1;case 44:_context88.prev=44;_context88.prev=45;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context88.next=49;break;}_context88.next=49;return _iterator["return"]();case 49:_context88.prev=49;if(!_didIteratorError){_context88.next=52;break;}throw _iteratorError;case 52:return _context88.finish(49);case 53:return _context88.finish(44);case 54:case"end":return _context88.stop();}},_callee83,null,[[4,40,44,54],[45,,49,53]]);}));return function onmessage(_x127){return _ref171.apply(this,arguments);};}();}}]);}();var id=/*#__PURE__*/function(_Jh){function id(t,r,n){var _this112;_classCallCheck(this,id);_this112=_callSuper(this,id,[t,r,"sub"/* Sub */]);dt(_this112,"type","sub");dt(_this112,"_post");dt(_this112,"topLayer");dt(_this112,"serviceWork");dt(_this112,"localWork");dt(_this112,"topLayerWork");dt(_this112,"snapshotWork");_this112._post=n;var s=vr.bufferSize.sub;_this112.topLayer=r.isUseSimple?void 0:_this112.createLayer("topLayer",_this112.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var c={thread:_this112,viewId:_this112.viewId,vNodes:_this112.vNodes,fullLayer:_this112.fullLayer,topLayer:_this112.topLayer,isUseSimple:r.isUseSimple};_this112.localWork=new $M(c),r.isUseSimple||(_this112.topLayerWork=new jM(c)),_this112.snapshotWork=new nd(_objectSpread(_objectSpread({},c),{},{createScene:_this112.createScene.bind(_this112),createLayer:_this112.createLayer.bind(_this112)})),_this112.vNodes.init(_this112.fullLayer);return _this112;}_inherits(id,_Jh);return _createClass(id,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(){var _this113=this;var c,l,_this$combinePostData,t,r,n,f,_iterator75,_step75,h,m,s;return _regeneratorRuntime().wrap(function _callee84$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,r=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context89.next=28;break;}f=[];_iterator75=_createForOfIteratorHelper(t);_context89.prev=4;_iterator75.s();case 6:if((_step75=_iterator75.n()).done){_context89.next=19;break;}h=_step75.value;if(!h.rect){_context89.next=17;break;}if(!(h.rect=Zh(fr(h.rect),this.scene,this.dpr),!h.rect)){_context89.next=11;break;}return _context89.abrupt("continue",17);case 11:if(!(h.drawCanvas&&h.rect&&h.rect.w>0&&h.rect.h>0)){_context89.next=16;break;}_context89.next=14;return this.getRectImageBitmap(h);case 14:m=_context89.sent;h.imageBitmap=m,n||(n=[]),n.push(m);case 16:f.push(h);case 17:_context89.next=6;break;case 19:_context89.next=24;break;case 21:_context89.prev=21;_context89.t0=_context89["catch"](4);_iterator75.e(_context89.t0);case 24:_context89.prev=24;_iterator75.f();return _context89.finish(24);case 27:r.render=f;case 28:s=(c=r.sp)==null?void 0:c.filter(function(f){return f.type!==xt.None||f.isLockSentEventCursor;});s!=null&&s.length?r.sp=s.map(function(f){return _objectSpread(_objectSpread({},f),{},{viewId:_this113.viewId});}):delete r.sp,r.consumeCount===void 0&&delete r.consumeCount,r.subWorkerDrawCount===void 0&&delete r.subWorkerDrawCount,(s!=null&&s.length||r.consumeCount||r.subWorkerDrawCount||(l=r==null?void 0:r.render)!=null&&l.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context89.stop();}},_callee84,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var h,m,r,n,s,c,l,f,u;return _regeneratorRuntime().wrap(function _callee85$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:r=t.msgType,n=t.toolsType,s=t.opt,c=t.dataType,l=t.workState,f=t.isLockSentEventCursor;_context90.t0=r;_context90.next=_context90.t0===xt.UpdateTools?4:_context90.t0===xt.CreateWork?9:_context90.t0===xt.DrawWork?11:_context90.t0===xt.RemoveNode?19:_context90.t0===xt.FullWork?22:_context90.t0===xt.Snapshot?27:_context90.t0===xt.BoundingBox?32:37;break;case 4:if(!(n&&(h=this.topLayerWork)!=null&&h.canUseTopLayer(n)&&s)){_context90.next=8;break;}u={toolsType:n,toolsOpt:s};this.topLayerWork.setToolsOpt(u);return _context90.abrupt("return");case 8:return _context90.abrupt("break",37);case 9:this.createLocalWork(t);return _context90.abrupt("return");case 11:if(!(l===te.Done&&c===Vt.Local)){_context90.next=17;break;}_context90.next=14;return this.consumeDrawAll(c,t);case 14:n===Tt.LaserPen&&f&&this.post({sp:[{type:xt.None,isLockSentEventCursor:f}]});_context90.next=18;break;case 17:this.consumeDraw(c,t);case 18:return _context90.abrupt("return");case 19:_context90.next=21;return this.removeNode(t);case 21:return _context90.abrupt("return");case 22:_context90.t1=n&&(m=this.topLayerWork)!=null&&m.canUseTopLayer(n);if(!_context90.t1){_context90.next=26;break;}_context90.next=26;return this.consumeDrawAll(c,t);case 26:return _context90.abrupt("return");case 27:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===ki?6e3:3e3,contextType:"2d"}));_context90.next=30;return this.snapshotWork.getSnapshot(t);case 30:this.snapshotWork.destroySnapshotFullLayer();return _context90.abrupt("return");case 32:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===ki?6e3:3e3,contextType:"2d"}));_context90.next=35;return this.snapshotWork.getBoundingRect(t);case 35:this.snapshotWork.destroySnapshotFullLayer();return _context90.abrupt("return");case 37:_context90.next=39;return _superPropGet(id,"on",this,3)([t]);case 39:case"end":return _context90.stop();}},_callee85,this);}));function on(_x128){return _on2.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var c;var r=t.workId,n=t.toolsType,s=t.opt;if(n&&(c=this.topLayerWork)!=null&&c.canUseTopLayer(n)&&r&&s){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:s}),this.topLayerWork.setWorkOptions(r.toString(),s);return;}n&&_superPropGet(id,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t){var r;return _regeneratorRuntime().wrap(function _callee86$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:r=t.dataType;_context91.t0=r===Vt.Local;if(!_context91.t0){_context91.next=5;break;}_context91.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context91.stop();}},_callee86,this);}));function removeNode(_x129){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"getLayer",value:function getLayer(t){switch(t){case Ut.TopFloat:return this.topLayer||this.fullLayer;default:return this.fullLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){var n;return((n=this.getLayer(t))==null?void 0:n.parent).canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t,r){var c,n,s;return _regeneratorRuntime().wrap(function _callee87$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:n=r.workId,s=r.toolsType;if(!n){_context92.next=11;break;}if(!(s&&(c=this.topLayerWork)!=null&&c.canUseTopLayer(s))){_context92.next=5;break;}t===Vt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(r)),this.topLayerWork.consumeDraw(r);return _context92.abrupt("return");case 5:_context92.t0=s;if(!_context92.t0){_context92.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context92.next=10;return this.localWork.consumeDraw(r);case 10:return _context92.abrupt("return");case 11:case"end":return _context92.stop();}},_callee87,this);}));function consumeDraw(_x130,_x131){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(t,r){var l,n,s,c,f;return _regeneratorRuntime().wrap(function _callee88$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:n=r.workId,s=r.toolsType,c=r.dataType;if(!n){_context93.next=8;break;}f=n.toString();if(!(s&&(l=this.topLayerWork)!=null&&l.canUseTopLayer(s))){_context93.next=6;break;}c===Vt.Local&&(this.topLayerWork.getWorkShape(f)||this.createLocalWork(r)),this.topLayerWork.consumeDrawAll(r);return _context93.abrupt("return");case 6:s&&(this.localWork.getWorkShape(f)||_superPropGet(id,"createLocalWork",this,3)([r]),this.localWork.consumeDrawAll(r));return _context93.abrupt("return");case 8:case"end":return _context93.stop();}},_callee88,this);}));function consumeDrawAll(_x132,_x133){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(){return _regeneratorRuntime().wrap(function _callee89$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:this.vNodes.clear();_superPropGet(id,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Lr(this.topLayer,this.topLayer.parent));_context94.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId}],sp:[{type:xt.Clear}]});case 5:case"end":return _context94.stop();}},_callee89,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t,r){var n=t.rect,s=t.drawCanvas,c=Math.floor(n.x*this.dpr),l=Math.floor(n.y*this.dpr),f=Math.floor(n.w*this.dpr||1),h=Math.floor(n.h*this.dpr||1);return createImageBitmap(this.getOffscreen(s),c,l,f,h,r);}},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(id,"updateLayer",this,3)([t]),this.topLayer&&(this.topLayer.parent.setAttribute("width",r),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[r,n]),this.topLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(t){var r,n,s;return _regeneratorRuntime().wrap(function _callee90$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:_superPropGet(id,"updateDpr",this,3)([t]);r=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,n=!!this.localWork.getWorkShapes().size,s=[];n&&s.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId});r&&s.push({isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId});_context95.t0=s.length;if(!_context95.t0){_context95.next=8;break;}_context95.next=8;return this.post({render:s});case 8:case"end":return _context95.stop();}},_callee90,this);}));function updateDpr(_x134){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t){var _this114=this;var s,r,n,c,l,_iterator76,_step76,_loop9;return _regeneratorRuntime().wrap(function _callee91$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:r=[],n=t.cameraOpt;if(!(n&&!qr(this.cameraOpt,n))){_context97.next=25;break;}c=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,l=!!this.localWork.getWorkShapes().size;if(!(l&&this.localWork.workShapesDone(),this.setCameraOpt(n),l&&r.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}),c&&this.topLayerWork)){_context97.next=21;break;}r.push({isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId});_iterator76=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries()||[]);_context97.prev=6;_loop9=/*#__PURE__*/_regeneratorRuntime().mark(function _loop9(){var _step76$value,f,h,m;return _regeneratorRuntime().wrap(function _loop9$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:_step76$value=_slicedToArray(_step76.value,2),f=_step76$value[0],h=_step76$value[1];if(h.totalRect){(s=_this114.topLayer)==null||s.getElementsByName(f.toString()).forEach(function(u){var y=u.getBoundingClientRect(),T=ve({x:y.x,y:y.y,w:y.width,h:y.height});m=Zt(m,T);}),h.totalRect=m,_this114.topLayerWork.localWorkShapes.set(f,h);}case 2:case"end":return _context96.stop();}},_loop9);});_iterator76.s();case 9:if((_step76=_iterator76.n()).done){_context97.next=13;break;}return _context97.delegateYield(_loop9(),"t0",11);case 11:_context97.next=9;break;case 13:_context97.next=18;break;case 15:_context97.prev=15;_context97.t1=_context97["catch"](6);_iterator76.e(_context97.t1);case 18:_context97.prev=18;_iterator76.f();return _context97.finish(18);case 21:_context97.t2=r.length;if(!_context97.t2){_context97.next=25;break;}_context97.next=25;return this.post({render:r});case 25:case"end":return _context97.stop();}},_callee91,this,[[6,15,18,21]]);}));function updateCamera(_x135){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,r){var h,m;this.cameraOpt=t;var n=t.scale,s=t.centerX,c=t.centerY,l=t.width,f=t.height;(l!==this.scene.width||f!==this.scene.height)&&this.updateScene(this.scene,{width:l,height:f}),r?(r.setAttribute("scale",[n,n]),r.setAttribute("translate",[-s,-c])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-s,-c]),(h=this.topLayer)==null||h.setAttribute("scale",[n,n]),(m=this.topLayer)==null||m.setAttribute("translate",[-s,-c]));}}]);}(Jh);var sd=/*#__PURE__*/function(_Jh2){function sd(t,r,n){var _this115;_classCallCheck(this,sd);_this115=_callSuper(this,sd,[t,r,"full"/* Full */]);dt(_this115,"serviceDrawLayer");dt(_this115,"localDrawLayer");dt(_this115,"snapshotFullLayer");dt(_this115,"methodBuilder");dt(_this115,"localWork");dt(_this115,"serviceWork");dt(_this115,"_post");dt(_this115,"debounceUpdateCache",/* @__PURE__ */new Set());_this115._post=n;var s=vr.bufferSize.sub;_this115.serviceDrawLayer=_this115.createLayer("serviceDrawLayer",_this115.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"})),_this115.localDrawLayer=_this115.createLayer("localDrawLayer",_this115.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var c={thread:_this115,viewId:_this115.viewId,vNodes:_this115.vNodes,fullLayer:_this115.fullLayer};_this115.localWork=new ed(_objectSpread(_objectSpread({},c),{},{drawLayer:_this115.localDrawLayer})),r.combineUnitTime&&_this115.localWork.setCombineUnitTime(r.combineUnitTime),r.maxCombineEraserTime&&_this115.localWork.setmaxCombineEraserTime(r.maxCombineEraserTime),r.syncUnitTime&&_this115.localWork.setSyncUnitTime(r.syncUnitTime),_this115.serviceWork=new rd(_objectSpread(_objectSpread({},c),{},{drawLayer:_this115.serviceDrawLayer})),_this115.methodBuilder=new Xu([he.CopyNode,he.SetColorNode,he.DeleteNode,he.RotateNode,he.ScaleNode,he.TranslateNode,he.ZIndexNode,he.SetFontStyle,he.SetPoint,he.SetLock,he.SetShapeOpt]).registerForWorker(_this115),_this115.vNodes.init(_this115.fullLayer);return _this115;}_inherits(sd,_Jh2);return _createClass(sd,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(){var _this116=this;var c,l,_this$combinePostData2,t,r,n,f,_iterator77,_step77,h,m,s;return _regeneratorRuntime().wrap(function _callee92$(_context98){while(1)switch(_context98.prev=_context98.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,r=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context98.next=28;break;}f=[];_iterator77=_createForOfIteratorHelper(t);_context98.prev=4;_iterator77.s();case 6:if((_step77=_iterator77.n()).done){_context98.next=19;break;}h=_step77.value;if(!h.rect){_context98.next=17;break;}if(!(h.rect=Zh(fr(h.rect),this.scene,this.dpr),!h.rect)){_context98.next=11;break;}return _context98.abrupt("continue",17);case 11:if(!(h.drawCanvas&&h.rect&&h.rect.w>0&&h.rect.h>0)){_context98.next=16;break;}_context98.next=14;return this.getRectImageBitmap(h);case 14:m=_context98.sent;h.imageBitmap=m,n||(n=[]),n.push(m);case 16:f.push(h);case 17:_context98.next=6;break;case 19:_context98.next=24;break;case 21:_context98.prev=21;_context98.t0=_context98["catch"](4);_iterator77.e(_context98.t0);case 24:_context98.prev=24;_iterator77.f();return _context98.finish(24);case 27:r.render=f;case 28:s=(c=r.sp)==null?void 0:c.filter(function(f){return f.type!==xt.None||f.isLockSentEventCursor;});s!=null&&s.length?r.sp=s.map(function(f){return _objectSpread(_objectSpread({},f),{},{viewId:_this116.viewId});}):delete r.sp,r.fullWorkerDrawCount===void 0&&delete r.fullWorkerDrawCount,r.consumeCount===void 0&&delete r.consumeCount,(r!=null&&r.fullWorkerDrawCount||r.consumeCount||s!=null&&s.length||(l=r.render)!=null&&l.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context98.stop();}},_callee92,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93(t){var _this117=this;var r,n,s,c,l,f,h,m,_h8;return _regeneratorRuntime().wrap(function _callee93$(_context99){while(1)switch(_context99.prev=_context99.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context99.next=2;break;}return _context99.abrupt("return");case 2:r=t.msgType,n=t.dataType,s=t.workId,c=t.toolsType,l=t.workState,f=t.workIds;_context99.t0=r;_context99.next=_context99.t0===xt.AuthClear?6:_context99.t0===xt.CreateWork?9:_context99.t0===xt.DrawWork?11:_context99.t0===xt.Select?20:_context99.t0===xt.UpdateNode?27:_context99.t0===xt.FullWork?27:_context99.t0===xt.RemoveNode?29:_context99.t0===xt.GetTextActive?32:_context99.t0===xt.CursorHover?35:_context99.t0===xt.CursorBlur?38:_context99.t0===xt.GetVNodeInfo?41:43;break;case 6:h=t.clearUids,m=t.localUid;this.vNodes.setCanClearUids(h),this.vNodes.setLocalUid(m);return _context99.abrupt("break",43);case 9:c!==Tt.LaserPen&&this.createLocalWork(t);return _context99.abrupt("break",43);case 11:_context99.t1=c!==Tt.LaserPen;if(!_context99.t1){_context99.next=19;break;}if(!(l===te.Done&&n===Vt.Local)){_context99.next=18;break;}_context99.next=16;return this.consumeDrawAll(n,t);case 16:_context99.next=19;break;case 18:this.consumeDraw(n,t);case 19:return _context99.abrupt("break",43);case 20:if(!(s===Me)){_context99.next=25;break;}_context99.next=23;return this.localWork.updateFullSelectWork(t);case 23:_context99.next=26;break;case 25:this.serviceWork.runSelectWork(t);case 26:return _context99.abrupt("return");case 27:this.consumeFull(n,t);return _context99.abrupt("return");case 29:_context99.next=31;return this.removeNode(t);case 31:return _context99.abrupt("return");case 32:_context99.next=34;return this.checkTextActive(t);case 34:return _context99.abrupt("return");case 35:_context99.next=37;return this.cursorHover(t);case 37:return _context99.abrupt("return");case 38:_context99.next=40;return this.cursorBlur();case 40:return _context99.abrupt("return");case 41:if(s&&f){_h8=f.map(function(m){return _this117.vNodes.get(m);});this.post({sp:[{type:xt.GetVNodeInfo,dataType:Vt.Worker,workId:s,vInfo:_h8}]});}return _context99.abrupt("break",43);case 43:_context99.next=45;return _superPropGet(sd,"on",this,3)([t]);case 45:case"end":return _context99.stop();}},_callee93,this);}));function on(_x136){return _on3.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(t){var _this118=this;var r,n,s,c,l,_iterator78,_step78,_loop10;return _regeneratorRuntime().wrap(function _callee94$(_context101){while(1)switch(_context101.prev=_context101.next){case 0:r=t.dataType,n=t.workId,s=t.removeIds,c=[],l=s||[];if(!(n&&l.push(n.toString()),l.length)){_context101.next=20;break;}_iterator78=_createForOfIteratorHelper(l);_context101.prev=3;_loop10=/*#__PURE__*/_regeneratorRuntime().mark(function _loop10(){var f;return _regeneratorRuntime().wrap(function _loop10$(_context100){while(1)switch(_context100.prev=_context100.next){case 0:f=_step78.value;f===Me?c.push(_this118.localWork.removeSelector(t,_this118)):r===Vt.Local?c.push(_this118.localWork.removeWork(t).then(function(){_this118.localWork.colloctEffectSelectWork(t),_this118.deleteCachedImagesByWorkId(f);})):r===Vt.Service&&c.push(_this118.serviceWork.removeWork(t).then(function(){_this118.localWork.colloctEffectSelectWork(t),_this118.deleteCachedImagesByWorkId(f);}));case 2:case"end":return _context100.stop();}},_loop10);});_iterator78.s();case 6:if((_step78=_iterator78.n()).done){_context101.next=10;break;}return _context101.delegateYield(_loop10(),"t0",8);case 8:_context101.next=6;break;case 10:_context101.next=15;break;case 12:_context101.prev=12;_context101.t1=_context101["catch"](3);_iterator78.e(_context101.t1);case 15:_context101.prev=15;_iterator78.f();return _context101.finish(15);case 18:_context101.next=20;return Promise.all(c);case 20:case"end":return _context101.stop();}},_callee94,null,[[3,12,15,18]]);}));function removeNode(_x137){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee95(t){var r;return _regeneratorRuntime().wrap(function _callee95$(_context102){while(1)switch(_context102.prev=_context102.next){case 0:r=t.dataType;_context102.t0=r===Vt.Local;if(!_context102.t0){_context102.next=5;break;}_context102.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context102.stop();}},_callee95,this);}));function checkTextActive(_x138){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee96(){return _regeneratorRuntime().wrap(function _callee96$(_context103){while(1)switch(_context103.prev=_context103.next){case 0:this.vNodes.clear();_superPropGet(sd,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Lr(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Lr(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context103.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Ut.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}],sp:[{type:xt.Clear}]});case 6:case"end":return _context103.stop();}},_callee96,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(sd,"updateLayer",this,3)([t]),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",r),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[r,n]),this.localDrawLayer.setAttribute("pos",[r*0.5,n*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",r),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[r,n]),this.serviceDrawLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var r=t.scale,n=t.centerX,s=t.centerY,c=t.width,l=t.height;(c!==this.scene.width||l!==this.scene.height)&&this.updateScene(this.scene,{width:c,height:l}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-s])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[r,r]),this.localDrawLayer.setAttribute("translate",[-n,-s])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[r,r]),this.serviceDrawLayer.setAttribute("translate",[-n,-s]));}},{key:"getLayer",value:function getLayer(t){switch(t){case Ut.Bg:return this.fullLayer;case Ut.ServiceFloat:return this.serviceDrawLayer;case Ut.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 _callee97(t,r){var n;return _regeneratorRuntime().wrap(function _callee97$(_context104){while(1)switch(_context104.prev=_context104.next){case 0:_context104.next=2;return this.localWork.colloctEffectSelectWork(r);case 2:n=_context104.sent;_context104.t0=n&&t===Vt.Local;if(!_context104.t0){_context104.next=7;break;}_context104.next=7;return this.localWork.consumeFull(n);case 7:n&&t===Vt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context104.stop();}},_callee97,this);}));function consumeFull(_x139,_x140){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee98(t,r){var n;return _regeneratorRuntime().wrap(function _callee98$(_context105){while(1)switch(_context105.prev=_context105.next){case 0:n=r.workId;_context105.t0=t===Vt.Local&&n;if(!_context105.t0){_context105.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context105.next=6;return this.localWork.consumeDraw(r,this.serviceWork);case 6:t===Vt.Service&&this.serviceWork.consumeDraw(r);case 7:case"end":return _context105.stop();}},_callee98,this);}));function consumeDraw(_x141,_x142){return _consumeDraw6.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee99(t,r){var n;return _regeneratorRuntime().wrap(function _callee99$(_context106){while(1)switch(_context106.prev=_context106.next){case 0:n=r.workId;_context106.t0=t===Vt.Local&&n;if(!_context106.t0){_context106.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context106.next=6;return this.localWork.consumeDrawAll(r,this.serviceWork);case 6:case"end":return _context106.stop();}},_callee99,this);}));function consumeDrawAll(_x143,_x144){return _consumeDrawAll5.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee100(t){return _regeneratorRuntime().wrap(function _callee100$(_context107){while(1)switch(_context107.prev=_context107.next){case 0:_superPropGet(sd,"updateDpr",this,3)([t]);_context107.next=3;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:this.viewId}]});case 3:case"end":return _context107.stop();}},_callee100,this);}));function updateDpr(_x145){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee101(t){var _this119=this;var c,l,f,h,m,r,n,s,u,x,_iterator79,_step79,_step79$value,_I55,_d48,y,_iterator80,_step80,_step80$value,_x151,_I60,_d51,_iterator81,_step81,_step81$value,_x152,_I61,_d52,T,E,_x147,_iterator82,_step82,_I56,C,_iterator83,_step83,_x148,_I57,_iterator84,_step84,_d49,_iterator85,_step85,_step85$value,_x150,_step85$value$,_I59,_d50,v,p,S,A,R,D,U,M,W,Y,_iterator86,_step86,_step86$value,_x149,_I58;return _regeneratorRuntime().wrap(function _callee101$(_context108){while(1)switch(_context108.prev=_context108.next){case 0:r=[],n=t.cameraOpt,s=t.scenePath;if(!(n&&!qr(this.cameraOpt,n))){_context108.next=42;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);u=!!this.serviceDrawLayer.children.length;if(!s){_context108.next=30;break;}x=!1;_iterator79=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context108.prev=7;_iterator79.s();case 9:if((_step79=_iterator79.n()).done){_context108.next=19;break;}_step79$value=_slicedToArray(_step79.value,2),_I55=_step79$value[0],_d48=_step79$value[1];_context108.t0=_d48.toolsType;_context108.next=_context108.t0===Tt.Text?14:_context108.t0===Tt.PencilEraser?14:_context108.t0===Tt.Eraser?14:_context108.t0===Tt.Selector?14:_context108.t0===Tt.LaserPen?14:15;break;case 14:return _context108.abrupt("break",17);case 15:_I55!==di&&_I55!==Me&&(x=!0);return _context108.abrupt("break",17);case 17:_context108.next=9;break;case 19:_context108.next=24;break;case 21:_context108.prev=21;_context108.t1=_context108["catch"](7);_iterator79.e(_context108.t1);case 24:_context108.prev=24;_iterator79.f();return _context108.finish(24);case 27:if(!x){_context108.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this119.taskUpdateCameraId=void 0,_this119.updateCamera(t);},wu);return _context108.abrupt("return");case 30:y=/* @__PURE__ */new Map();_iterator80=_createForOfIteratorHelper(this.vNodes.getNodesByType(Tt.Text).entries());try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){_step80$value=_slicedToArray(_step80.value,2),_x151=_step80$value[0],_I60=_step80$value[1];_d51=_I60.rect;y.set(_x151,{rect:fr(_d51),scale:(c=this.cameraOpt)==null?void 0:c.scale});}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}_iterator81=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){_step81$value=_slicedToArray(_step81.value,2),_x152=_step81$value[0],_I61=_step81$value[1];_d52=_I61.rect;y.set(_x152,{rect:fr(_d52),scale:(l=this.cameraOpt)==null?void 0:l.scale});}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}T=new Set(y.keys());E=!1;if(this.localWork.hasSelector()){_x147=(f=this.localWork.getSelector())==null?void 0:f.selectIds;if(_x147){E=!0;_iterator82=_createForOfIteratorHelper(_x147);try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){_I56=_step82.value;T.add(_I56);}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}}}C=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator83=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){_x148=_step83.value;_I57=_x148.selectIds;if(_I57){C=!0;_iterator84=_createForOfIteratorHelper(_I57);try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){_d49=_step84.value;T.add(_d49);}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(T),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator85=_createForOfIteratorHelper(y.entries());try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){_step85$value=_slicedToArray(_step85.value,2),_x150=_step85$value[0],_step85$value$=_step85$value[1],_I59=_step85$value$.rect,_d50=_step85$value$.scale;v=this.vNodes.get(_x150);if(v){p=_I59,S=v.rect,A=this.getSceneRect(),R=Zi(p,A),D=Zi(S,A),U=v.toolsType,M=v.opt;W=!1;(R!==D||p.w!==S.w||p.h!==S.h||D===Tr.intersect)&&(W=!0),U===Tt.Text&&// (opt as TextOptions).workState === EvevtWorkState.Done &&
517
+ W&&this.debounceUpdateCache.add(_x150);Y=!1;_d50&&(h=this.cameraOpt)!=null&&h.scale&&_d50>this.cameraOpt.scale?D!==Tr.outside&&R!==Tr.inside&&(Y=!0):_d50&&(m=this.cameraOpt)!=null&&m.scale&&_d50===this.cameraOpt.scale&&(p.x!==S.x||p.y!==S.y)&&(D===Tr.inside&&R!==Tr.inside||D===Tr.intersect&&R===Tr.intersect)&&(Y=!0),M.eraserlines&&M.eraserlines.length&&Y&&!this.debounceUpdateCache.has(_x150)&&this.debounceUpdateCache.add(_x150);}}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}if(E&&this.localWork.reRenderSelector(),C){_iterator86=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){_step86$value=_slicedToArray(_step86.value,2),_x149=_step86$value[0],_I58=_step86$value[1];this.serviceWork.runSelectWork({workId:_x149,selectIds:_I58.selectIds,msgType:xt.Select,dataType:Vt.Service,viewId:this.viewId});}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}}this.debounceUpdateCameraId=setTimeout(function(){var I;_this119.debounceUpdateCameraId=void 0;var x=[];var _iterator87=_createForOfIteratorHelper(_this119.debounceUpdateCache.values()),_step87;try{var _loop11=function _loop11(){var d=_step87.value;var v=_this119.vNodes.get(d);if(v){var p=v.toolsType,S=v.opt,A=v.op,R=_this119.localWork.setFullWork({toolsType:p,opt:S,workId:d});R&&(p===Tt.Text?(I=_this119.fullLayer)!=null&&I.getElementsByName(d)[0]&&R instanceof Ki&&x.push(R.consumeServiceAsync({isFullWork:!0,replaceId:d,boxRect:_this119.getSceneRect()})):S.eraserlines&&S.eraserlines.length&&x.push(new Promise(function(D){var U=R.consumeService({op:A,isFullWork:!0,replaceId:d,workState:te.Done});_this119.localWork.clearWorkShapeNodeCache(d),D(U);})));}_this119.debounceUpdateCache["delete"](d);};for(_iterator87.s();!(_step87=_iterator87.n()).done;){_loop11();}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}x.length?Promise.all(x).then(function(){var d=[];d.push({isClearAll:!0,clearCanvas:Ut.Bg,viewId:_this119.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:_this119.viewId}),d.length&&_this119.post({render:d}),_this119.vNodes.updateLowLevelNodesRect(),_this119.vNodes.clearHighLevelIds();}):(_this119.vNodes.updateLowLevelNodesRect(),_this119.vNodes.clearHighLevelIds());},wu*5);}u&&r.push({isClearAll:!0,clearCanvas:Ut.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&r.push({isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:this.viewId}),r.length&&this.post({render:r});case 42:case"end":return _context108.stop();}},_callee101,this,[[7,21,24,27]]);}));function updateCamera(_x146){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var r=t.rect,n=t.drawCanvas,s=Math.floor(r.x*this.dpr),c=Math.floor(r.y*this.dpr),l=Math.floor(r.w*this.dpr||1),f=Math.floor(r.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),s,c,l,f,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee102(t){return _regeneratorRuntime().wrap(function _callee102$(_context109){while(1)switch(_context109.prev=_context109.next){case 0:_context109.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context109.stop();}},_callee102,this);}));function cursorHover(_x153){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee103(){return _regeneratorRuntime().wrap(function _callee103$(_context110){while(1)switch(_context110.prev=_context110.next){case 0:_context110.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context110.stop();}},_callee103,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(sd,"destroy",this,3)([]);}}]);}(Jh);var KM=/*#__PURE__*/function(_sd){function KM(t,r,n){var _this120;_classCallCheck(this,KM);var c,l,f,h;_this120=_callSuper(this,KM,[t,r,n]);dt(_this120,"snapshotWork");dt(_this120,"localDrawScene");dt(_this120,"serviceDrawScene");dt(_this120,"offscreenCanvas");dt(_this120,"localWork");dt(_this120,"serviceWork");if(_this120._post=n,r.offscreenCanvas){_this120.offscreenCanvas=r.offscreenCanvas,_this120.localDrawScene=_this120.createScene(r,(c=_this120.offscreenCanvas)==null?void 0:c.localCanvas),_this120.serviceDrawScene=_this120.createScene(r,(l=_this120.offscreenCanvas)==null?void 0:l.serviceCanvas);var m=vr.bufferSize.sub;_this120.serviceDrawLayer=_this120.createLayer("serviceDrawLayer",_this120.serviceDrawScene||_this120.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:m,contextType:"2d"}),(f=_this120.offscreenCanvas)==null?void 0:f.serviceCanvas),_this120.localDrawLayer=_this120.createLayer("localDrawLayer",_this120.localDrawScene||_this120.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:m,contextType:"2d"}),(h=_this120.offscreenCanvas)==null?void 0:h.localCanvas);}var s={thread:_this120,viewId:_this120.viewId,vNodes:_this120.vNodes,fullLayer:_this120.fullLayer};_this120.localWork=new GM(_objectSpread(_objectSpread({},s),{},{drawLayer:_this120.localDrawLayer})),r.combineUnitTime&&_this120.localWork.setCombineUnitTime(r.combineUnitTime),r.maxCombineEraserTime&&_this120.localWork.setmaxCombineEraserTime(r.maxCombineEraserTime),r.syncUnitTime&&_this120.localWork.setSyncUnitTime(r.syncUnitTime),_this120.serviceWork=new HM(_objectSpread(_objectSpread({},s),{},{drawLayer:_this120.serviceDrawLayer})),_this120.snapshotWork=new nd(_objectSpread(_objectSpread({},s),{},{createScene:_this120.createScene.bind(_this120),createLayer:_this120.createLayer.bind(_this120)})),_this120.methodBuilder=new Xu([he.CopyNode,he.SetColorNode,he.DeleteNode,he.RotateNode,he.ScaleNode,he.TranslateNode,he.ZIndexNode,he.SetFontStyle,he.SetPoint,he.SetLock,he.SetShapeOpt]).registerForWorker(_this120);return _this120;}_inherits(KM,_sd);return _createClass(KM,[{key:"createRenderLayer",value:function createRenderLayer(t,r,n){var l;var s=vr.bufferSize.full,c=vr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",t,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:this.viewId===ki?s:c*2}),n||((l=r.offscreenCanvas)==null?void 0:l.bgCanvas));}},{key:"createScene",value:function createScene(t,r){var n=t.offscreenCanvas,s=t.offscreenCanvasOpt,c=s.width,l=s.height,f=r||(n==null?void 0:n.bgCanvas)||new OffscreenCanvas(c,l);s.contextType&&delete s.contextType;var h=new Uu(_objectSpread(_objectSpread({container:f,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},s),{},{contextType:this.contextType,id:this.viewId}));return h.setAttribute("id",this.viewId),h;}},{key:"combinePostData",value:function combinePostData(){var c,l;this.workerTaskId=void 0;var t=[],r=[];var n;var s=/* @__PURE__ */new Set();var _iterator88=_createForOfIteratorHelper(this.combinePostMsg.values()),_step88;try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){var f=_step88.value;if((c=f.render)!=null&&c.length)if(this.offscreenCanvas){var _iterator89=_createForOfIteratorHelper(f.render),_step89;try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){var h=_step89.value;h.workId&&s.add(h.workId);var m=h.drawCanvas||h.clearCanvas;if(m){var u=this.getLayer(m);if(!u||!(u.parent instanceof el))continue;u.parent.render();}}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}}else{var _iterator90=_createForOfIteratorHelper(f.render),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _h9=_step90.value;var _m16=!1;if(_h9.workId&&s.add(_h9.workId),_h9.isClearAll&&(_h9.rect=this.getSceneRect(),_h9.isClear=!0,delete _h9.isClearAll),_h9.drawCanvas){var _u9=this.getLayer(_h9.drawCanvas);if(!_u9||!(_u9.parent instanceof el))continue;if(_u9.parent.render(),_h9.isDrawAll){var y=this.getSceneRect();_h9.rect=y,delete _h9.isDrawAll;}}var _iterator91=_createForOfIteratorHelper(t),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var _u10=_step91.value;if(_h9.viewId===_u10.viewId){_h9.isClear&&_u10.clearCanvas&&_u10.isClear&&_u10.clearCanvas===_h9.clearCanvas&&(_u10.rect=Zt(_u10.rect,_h9.rect),_m16=!0),_u10.drawCanvas&&_u10.drawCanvas===_h9.drawCanvas&&(_u10.rect=Zt(_u10.rect,_h9.rect),_m16=!0);continue;}}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}_m16||(_h9.isClear&&!_h9.drawCanvas?t.unshift(_h9):t.push(_h9));}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}}if((l=f.sp)!=null&&l.length){var _iterator92=_createForOfIteratorHelper(f.sp),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _h10=_step92.value;var _m17=!1;var _iterator93=_createForOfIteratorHelper(r),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _u11=_step93.value;if(qr(_h10,_u11)){_m17=!0;break;}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}_m17||r.push(_h10);}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}er(f.consumeCount)&&(n=f.consumeCount);}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}return this.combinePostMsg.clear(),{render:t,sp:r,consumeCount:n,workIds:s,viewId:this.viewId};}},{key:"on",value:function(){var _on4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee104(t){var r;return _regeneratorRuntime().wrap(function _callee104$(_context111){while(1)switch(_context111.prev=_context111.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context111.next=2;break;}return _context111.abrupt("return");case 2:r=t.msgType;_context111.t0=r;_context111.next=_context111.t0===xt.Snapshot?6:_context111.t0===xt.BoundingBox?11:16;break;case 6:this.snapshotWork.createSnapshotFullLayer(this.opt,this.opt.layerOpt);_context111.next=9;return this.snapshotWork.getSnapshot(t);case 9:this.snapshotWork.destroySnapshotFullLayer();return _context111.abrupt("return");case 11:this.snapshotWork.createSnapshotFullLayer(this.opt,this.opt.layerOpt);_context111.next=14;return this.snapshotWork.getBoundingRect(t);case 14:this.snapshotWork.destroySnapshotFullLayer();return _context111.abrupt("return");case 16:_context111.next=18;return _superPropGet(KM,"on",this,3)([t]);case 18:case"end":return _context111.stop();}},_callee104,this);}));function on(_x154){return _on4.apply(this,arguments);}return on;}()},{key:"setCameraOpt",value:function setCameraOpt(t){if(this.localDrawScene&&this.serviceDrawScene){var r=t.width,n=t.height;(r!==this.localDrawScene.width||n!==this.localDrawScene.height)&&this.updateScene(this.localDrawScene,{width:r,height:n},this.localDrawLayer),(r!==this.serviceDrawScene.width||n!==this.serviceDrawScene.height)&&this.updateScene(this.serviceDrawScene,{width:r,height:n},this.serviceDrawLayer);}_superPropGet(KM,"setCameraOpt",this,3)([t]);}},{key:"updateDpr",value:function(){var _updateDpr4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee105(t){return _regeneratorRuntime().wrap(function _callee105$(_context112){while(1)switch(_context112.prev=_context112.next){case 0:this.localDrawScene&&this.serviceDrawScene&&(this.localDrawScene.displayRatio=t,this.serviceDrawScene.displayRatio=t),_superPropGet(KM,"updateDpr",this,3)([t]);case 1:case"end":return _context112.stop();}},_callee105,this);}));function updateDpr(_x155){return _updateDpr4.apply(this,arguments);}return updateDpr;}()}]);}(sd);var Fu=self;Fu.sub=new kM(Fu,uo.Sub);