@netless/appliance-plugin 1.1.17-beta.9 → 1.1.17

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.
Files changed (38) hide show
  1. package/cdn/cdn.js +1 -1
  2. package/cdn/fullWorker-CTwuMS.js +500 -0
  3. package/cdn/subWorker-D7gqd9.js +500 -0
  4. package/dist/appliance-plugin.js +1 -1
  5. package/dist/appliance-plugin.mjs +1 -1
  6. package/dist/collector/collector.d.ts +1 -0
  7. package/dist/component/textEditor/manager.d.ts +1 -0
  8. package/dist/component/textEditor/view.d.ts +27 -47
  9. package/dist/core/mainEngine.d.ts +3 -1
  10. package/dist/core/tools/selector.d.ts +29 -0
  11. package/dist/core/types.d.ts +1 -0
  12. package/dist/core/worker/base.d.ts +5 -0
  13. package/dist/core/worker/fullWorkerLocal.d.ts +0 -1
  14. package/dist/core/worker/subWorkerLocal.d.ts +1 -0
  15. package/dist/cursors/index.d.ts +0 -4
  16. package/dist/displayer/const.d.ts +1 -0
  17. package/dist/displayer/floatBar/dragBox/index.d.ts +7 -1
  18. package/dist/displayer/floatBar/index.d.ts +1 -1
  19. package/dist/displayer/utils.d.ts +1 -0
  20. package/dist/fullWorker.js +120 -122
  21. package/dist/index-BqLItWo1.js +1 -0
  22. package/dist/{index-BianYC4r.mjs → index-D5p9NBLd.mjs} +10 -3
  23. package/dist/{index-CZ7SSEYU.mjs → index-DGks_HwI.mjs} +7355 -7106
  24. package/dist/index-DI0wKkQa.js +1 -0
  25. package/dist/plugin/baseApplianceManager.d.ts +7 -4
  26. package/dist/plugin/baseViewContainerManager.d.ts +6 -2
  27. package/dist/plugin/const.d.ts +5 -0
  28. package/dist/plugin/displayerView.d.ts +9 -2
  29. package/dist/plugin/types.d.ts +25 -6
  30. package/dist/style.css +1 -1
  31. package/dist/subWorker.js +120 -122
  32. package/package.json +5 -4
  33. package/cdn/fullWorker-p8Ghqw.js +0 -502
  34. package/cdn/subWorker-C1Gs0N.js +0 -502
  35. package/dist/collector/eventCollector.d.ts +0 -31
  36. package/dist/collector/magixEventCollector.d.ts +0 -31
  37. package/dist/index-BSGcWUci.js +0 -1
  38. package/dist/index-DDtbIS6S.js +0 -1
@@ -0,0 +1,500 @@
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 _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 _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 _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _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 _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}var Zs=Object.defineProperty;var Js=function Js(u,e,t){return e in u?Zs(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;};var at=function at(u,e,t){return Js(u,_typeof(e)!="symbol"?e+"":e,t);};var Vt=/* @__PURE__ */function(u){return u.Normal="Normal",u.Stroke="Stroke",u.Dotted="Dotted",u.LongDotted="LongDotted",u;}(Vt||{}),Zt=/* @__PURE__ */function(u){return u.None="None",u.ShowFloatBar="ShowFloatBar",u.ZIndexFloatBar="ZIndexFloatBar",u.DeleteNode="DeleteNode",u.CopyNode="CopyNode",u.ZIndexActive="ZIndexActive",u.ZIndexNode="ZIndexNode",u.RotateNode="RotateNode",u.SetColorNode="SetColorNode",u.TranslateNode="TranslateNode",u.ScaleNode="ScaleNode",u.OriginalEvent="OriginalEvent",u.CreateScene="CreateScene",u.ActiveCursor="ActiveCursor",u.MoveCursor="MoveCursor",u.CommandEditor="CommandEditor",u.SetEditorData="SetEditorData",u.SetFontStyle="SetFontStyle",u.SetPoint="SetPoint",u.SetLock="SetLock",u.SetShapeOpt="SetShapeOpt",u.CameraChange="CameraChange",u.ActiveMethod="ActiveMethod",u.HidFloatBarBtn="HidFloatBarBtn",u;}(Zt||{}),St=/* @__PURE__ */function(u){return u[u.Pencil=1]="Pencil",u[u.Eraser=2]="Eraser",u[u.PencilEraser=3]="PencilEraser",u[u.BitMapEraser=4]="BitMapEraser",u[u.Selector=5]="Selector",u[u.Clicker=6]="Clicker",u[u.Arrow=7]="Arrow",u[u.Hand=8]="Hand",u[u.LaserPen=9]="LaserPen",u[u.Text=10]="Text",u[u.Straight=11]="Straight",u[u.Rectangle=12]="Rectangle",u[u.Ellipse=13]="Ellipse",u[u.Star=14]="Star",u[u.Triangle=15]="Triangle",u[u.Rhombus=16]="Rhombus",u[u.Polygon=17]="Polygon",u[u.SpeechBalloon=18]="SpeechBalloon",u[u.Image=19]="Image",u;}(St||{}),bt=/* @__PURE__ */function(u){return u[u.Local=1]="Local",u[u.Service=2]="Service",u[u.Worker=3]="Worker",u;}(bt||{}),Ft=/* @__PURE__ */function(u){return u[u.Pending=0]="Pending",u[u.Start=1]="Start",u[u.Doing=2]="Doing",u[u.Done=3]="Done",u[u.Unwritable=4]="Unwritable",u;}(Ft||{}),dt=/* @__PURE__ */function(u){return u[u.None=0]="None",u[u.Init=1]="Init",u[u.UpdateCamera=2]="UpdateCamera",u[u.UpdateTools=3]="UpdateTools",u[u.CreateWork=4]="CreateWork",u[u.DrawWork=5]="DrawWork",u[u.FullWork=6]="FullWork",u[u.UpdateNode=7]="UpdateNode",u[u.RemoveNode=8]="RemoveNode",u[u.Clear=9]="Clear",u[u.Select=10]="Select",u[u.Destroy=11]="Destroy",u[u.Snapshot=12]="Snapshot",u[u.BoundingBox=13]="BoundingBox",u[u.Cursor=14]="Cursor",u[u.TextUpdate=15]="TextUpdate",u[u.GetTextActive=16]="GetTextActive",u[u.TasksQueue=17]="TasksQueue",u[u.CursorHover=18]="CursorHover",u[u.CursorBlur=19]="CursorBlur",u[u.Console=20]="Console",u[u.PriorityWorker=21]="PriorityWorker",u[u.PriorityMainThreadWorker=22]="PriorityMainThreadWorker",u[u.GetImageBitMap=23]="GetImageBitMap",u[u.AuthWriter=24]="AuthWriter",u[u.AuthReader=25]="AuthReader",u[u.AuthClear=26]="AuthClear",u[u.AuthPage=27]="AuthPage",u[u.GetVNodeInfo=28]="GetVNodeInfo",u[u.UpdateDpr=29]="UpdateDpr",u;}(dt||{}),Rt=/* @__PURE__ */function(u){return u[u.None=0]="None",u[u.Bg=1]="Bg",u[u.ServiceFloat=2]="ServiceFloat",u[u.Float=3]="Float",u[u.TopFloat=4]="TopFloat",u;}(Rt||{}),Qt=/* @__PURE__ */function(u){return u[u.none=1]="none",u[u.all=2]="all",u[u.both=3]="both",u[u.proportional=4]="proportional",u;}(Qt||{}),ye=/* @__PURE__ */function(u){return u[u.inside=0]="inside",u[u.outside=1]="outside",u[u.intersect=2]="intersect",u;}(ye||{}),Zr=/* @__PURE__ */function(u){return u.Image="image",u.Iconify="iconify",u;}(Zr||{});var Ie=/*#__PURE__*/function(){function Ie(){_classCallCheck(this,Ie);at(this,"localWork");at(this,"serviceWork");at(this,"threadEngine");}return _createClass(Ie,[{key:"registerForWorker",value:function registerForWorker(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this;}}]);}();var Qs=/*#__PURE__*/function(_Ie){function Qs(){var _this;_classCallCheck(this,Qs);_this=_callSuper(this,Qs,arguments);at(_this,"emitEventType",Zt.CopyNode);return _this;}_inherits(Qs,_Ie);return _createClass(Qs,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.FullWork&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,r;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:r=t.workId;_context.t0=r;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(Ie);var or="++",_t="selector",qs="all";var _s=/*#__PURE__*/function(_Ie2){function _s(){var _this2;_classCallCheck(this,_s);_this2=_callSuper(this,_s,arguments);at(_this2,"emitEventType",Zt.SetColorNode);return _this2;}_inherits(_s,_Ie2);return _createClass(_s,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var f,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context2.t0=r===_t&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context2.stop();}},_callee2,this);}));function consumeForLocalWorker(_x2){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=r.textUpdateForWoker,f=n.render||[],g=n.sp||[];if(l){var _iterator2=_createForOfIteratorHelper(i.entries()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=_slicedToArray(_step2.value,2),c=_step2$value[0],m=_step2$value[1];a&&m.toolsType===St.Text?g.push(_objectSpread(_objectSpread({},m),{},{workId:c,type:dt.TextUpdate,dataType:bt.Local,willSyncService:!0})):g.push(_objectSpread(_objectSpread({},m),{},{workId:c,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:f,sp:g};}}]);}(Ie);var to=/*#__PURE__*/function(_Ie3){function to(){var _this3;_classCallCheck(this,to);_this3=_callSuper(this,to,arguments);at(_this3,"emitEventType",Zt.ZIndexNode);return _this3;}_inherits(to,_Ie3);return _createClass(to,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t){var a,r,n,i,l,o;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context3.t0=r===_t&&n;if(!_context3.t0){_context3.next=5;break;}_context3.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context3.stop();}},_callee3,this);}));function consumeForLocalWorker(_x3){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=n.render||[],f=n.sp||[];if(l&&f){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),g=_step3$value[0],c=_step3$value[1];f.push(_objectSpread(_objectSpread({},c),{},{workId:g,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:a,sp:f};}}]);}(Ie);var eo=/*#__PURE__*/function(_Ie4){function eo(){var _this4;_classCallCheck(this,eo);_this4=_callSuper(this,eo,arguments);at(_this4,"emitEventType",Zt.TranslateNode);return _this4;}_inherits(eo,_Ie4);return _createClass(eo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var g,c,r,n,i,l,o,a,f;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker,f=t.emitEventType;_context4.t0=r===_t&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===Ft.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Ft.Done)){_context4.next=8;break;}_context4.next=6;return(g=this.localWork)==null?void 0:g.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,isSync:!0,textUpdateForWoker:a,emitEventType:f,callback:this.updateSelectorCallback});case 6:_context4.next=9;break;case 8:n.workState===Ft.Done&&((c=this.localWork)==null||c.vNodes.deleteLastTarget());case 9:case"end":return _context4.stop();}},_callee4,this);}));function consumeForLocalWorker(_x4){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,f=r.isSync,g=r.updateSelectorOpt,c=r.textUpdateForWoker,m=g.workState,x=n.render||[],M=n.sp||[];if(m===Ft.Start)return{sp:[],render:[]};var S=o==null?void 0:o.selectRect;if(a){M.push({type:dt.Select,selectIds:l.selectIds,selectRect:S,willSyncService:!0,isSync:!0,points:m===Ft.Done&&l.getChildrenPoints()||void 0,textOpt:l.textOpt});var _iterator4=_createForOfIteratorHelper(i.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),P=_step4$value[0],T=_step4$value[1];c&&T.toolsType===St.Text?M.push(_objectSpread(_objectSpread({},T),{},{workId:P,type:dt.TextUpdate,dataType:bt.Local,willSyncService:!0})):M.push(_objectSpread(_objectSpread({},T),{},{workId:P,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:x,sp:M};}}]);}(Ie);var ro=/*#__PURE__*/function(_Ie5){function ro(){var _this5;_classCallCheck(this,ro);_this5=_callSuper(this,ro,arguments);at(_this5,"emitEventType",Zt.DeleteNode);return _this5;}_inherits(ro,_Ie5);return _createClass(ro,[{key:"consume",value:function consume(){return!1;}}]);}(Ie);var no=/*#__PURE__*/function(_Ie6){function no(){var _this6;_classCallCheck(this,no);_this6=_callSuper(this,no,arguments);at(_this6,"emitEventType",Zt.ScaleNode);return _this6;}_inherits(no,_Ie6);return _createClass(no,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t){var o,r,n,i,l;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willSyncService,l=t.willSerializeData;_context5.t0=r===_t&&n;if(!_context5.t0){_context5.next=5;break;}_context5.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:l,isSync:!0,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return _context5.stop();}},_callee5,this);}));function consumeForLocalWorker(_x5){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.workShapeNode,l=t.res,o=t.newServiceStore,a=r.updateSelectorOpt,f=r.willSyncService,g=a.workState,c=n.render||[],m=n.sp||[],x=l==null?void 0:l.selectRect;if(g===Ft.Start)return{sp:[],render:[]};if(f){m.push({type:dt.Select,selectIds:i.selectIds,selectRect:x,willSyncService:!0,isSync:!0,points:g===Ft.Done&&i.getChildrenPoints()||void 0,textOpt:i.textOpt});var _iterator5=_createForOfIteratorHelper(o.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),M=_step5$value[0],S=_step5$value[1];S.toolsType===St.Text?m.push(_objectSpread(_objectSpread({},S),{},{workId:M,type:dt.TextUpdate,dataType:bt.Local,willSyncService:!0})):m.push(_objectSpread(_objectSpread({},S),{},{workId:M,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:c,sp:m};}}]);}(Ie);var io=/*#__PURE__*/function(_Ie7){function io(){var _this7;_classCallCheck(this,io);_this7=_callSuper(this,io,arguments);at(_this7,"emitEventType",Zt.RotateNode);return _this7;}_inherits(io,_Ie7);return _createClass(io,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var f,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.emitEventType;_context6.t0=r===_t&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,emitEventType:a,isSync:!0,callback:this.updateSelectorCallback});case 5:case"end":return _context6.stop();}},_callee6,this);}));function consumeForLocalWorker(_x6){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.workShapeNode,l=t.res,o=t.newServiceStore,a=r.updateSelectorOpt,f=r.willSyncService,g=r.willSerializeData,c=r.isSync,m=a.workState,x=n.render||[],M=n.sp||[],S=l==null?void 0:l.selectRect;if(f){g&&m===Ft.Done&&M.push({type:dt.Select,selectIds:i.selectIds,selectRect:S,willSyncService:!0,isSync:c,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt,thickness:i.thickness,useStroke:i.useStroke,strokeType:i.strokeType});var _iterator6=_createForOfIteratorHelper(o.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),P=_step6$value[0],T=_step6$value[1];M.push(_objectSpread(_objectSpread({},T),{},{workId:P,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:x,sp:M};}}]);}(Ie);var so=/*#__PURE__*/function(_Ie8){function so(){var _this8;_classCallCheck(this,so);_this8=_callSuper(this,so,arguments);at(_this8,"emitEventType",Zt.SetFontStyle);return _this8;}_inherits(so,_Ie8);return _createClass(so,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var f,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context7.t0=r===_t&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context7.stop();}},_callee7,this);}));function consumeForLocalWorker(_x7){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,f=r.isSync,g=r.updateSelectorOpt,c=r.textUpdateForWoker,m=n.render||[],x=n.sp||[],M=o==null?void 0:o.selectRect;if(a&&x){g.fontSize&&x.push({type:dt.Select,selectIds:l.selectIds,selectRect:M,willSyncService:a,isSync:f,points:l.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(i.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),S=_step7$value[0],P=_step7$value[1];c&&P.toolsType===St.Text?x.push(_objectSpread(_objectSpread({},P),{},{workId:S,type:dt.TextUpdate,dataType:bt.Local,willSyncService:!0})):x.push(_objectSpread(_objectSpread({},P),{},{workId:S,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:m,sp:x};}}]);}(Ie);var oo=/*#__PURE__*/function(_Ie9){function oo(){var _this9;_classCallCheck(this,oo);_this9=_callSuper(this,oo,arguments);at(_this9,"emitEventType",Zt.SetPoint);return _this9;}_inherits(oo,_Ie9);return _createClass(oo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var f,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context8.t0=r===_t&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context8.stop();}},_callee8,this);}));function consumeForLocalWorker(_x8){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,f=r.isSync,g=n.render||[],c=n.sp||[],m=o==null?void 0:o.selectRect;if(a&&c){var _iterator8=_createForOfIteratorHelper(i.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),x=_step8$value[0],M=_step8$value[1];c.push(_objectSpread(_objectSpread({},M),{},{workId:x,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}c.push({type:dt.Select,selectIds:l.selectIds,selectRect:m,willSyncService:a,isSync:f,points:l.getChildrenPoints()});}return{render:g,sp:c};}}]);}(Ie);var ao=/*#__PURE__*/function(_Ie10){function ao(){var _this10;_classCallCheck(this,ao);_this10=_callSuper(this,ao,arguments);at(_this10,"emitEventType",Zt.SetLock);return _this10;}_inherits(ao,_Ie10);return _createClass(ao,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(t){var a,r,n,i,l,o;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context9.t0=r===_t&&n;if(!_context9.t0){_context9.next=5;break;}_context9.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context9.stop();}},_callee9,this);}));function consumeForLocalWorker(_x9){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,f=r.isSync,g=r.updateSelectorOpt,c=n.render||[],m=n.sp||[],x=o==null?void 0:o.selectRect;if(a&&m){var _iterator9=_createForOfIteratorHelper(i.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),M=_step9$value[0],S=_step9$value[1];m.push(_objectSpread(_objectSpread({},S),{},{workId:M,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}m.push({isLocked:g.isLocked,selectorColor:l.selectorColor,scaleType:l.scaleType,canRotate:l.canRotate,type:dt.Select,selectIds:l.selectIds,selectRect:x,willSyncService:a,isSync:f});}return{render:c,sp:m};}}]);}(Ie);var lo=/*#__PURE__*/function(_Ie11){function lo(){var _this11;_classCallCheck(this,lo);_this11=_callSuper(this,lo,arguments);at(_this11,"emitEventType",Zt.SetShapeOpt);return _this11;}_inherits(lo,_Ie11);return _createClass(lo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===bt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(t){var a,r,n,i,l,o;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context10.t0=r===_t&&n;if(!_context10.t0){_context10.next=5;break;}_context10.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context10.stop();}},_callee10,this);}));function consumeForLocalWorker(_x10){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=n.render||[],f=n.sp||[];if(l&&f){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),g=_step10$value[0],c=_step10$value[1];f.push(_objectSpread(_objectSpread({},c),{},{workId:g,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:a,sp:f};}}]);}(Ie);var co=/*#__PURE__*/function(){function co(e){var _this12=this;_classCallCheck(this,co);at(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(e.map(function(t){return[t,_this12.build(t)];}));}return _createClass(co,[{key:"build",value:function build(e){switch(e){case Zt.TranslateNode:return new eo();case Zt.ZIndexNode:return new to();case Zt.CopyNode:return new Qs();case Zt.SetColorNode:return new _s();case Zt.DeleteNode:return new ro();case Zt.ScaleNode:return new no();case Zt.RotateNode:return new io();case Zt.SetFontStyle:return new so();case Zt.SetPoint:return new oo();case Zt.SetLock:return new ao();case Zt.SetShapeOpt:return new lo();}}},{key:"registerForWorker",value:function registerForWorker(e){return this.builders.forEach(function(t){t&&t.registerForWorker(e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(e){var _iterator11=_createForOfIteratorHelper(this.builders.values()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var t=_step11.value;if(t!=null&&t.consume(e))return!0;}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return!1;}}]);}();var fo={linear:function linear(u){return u;},easeInQuad:function easeInQuad(u){return u*u;},easeOutQuad:function easeOutQuad(u){return u*(2-u);},easeInOutQuad:function easeInOutQuad(u){return u<0.5?2*u*u:-1+(4-2*u)*u;},easeInCubic:function easeInCubic(u){return u*u*u;},easeOutCubic:function easeOutCubic(u){return--u*u*u+1;},easeInOutCubic:function easeInOutCubic(u){return u<0.5?4*u*u*u:(u-1)*(2*u-2)*(2*u-2)+1;},easeInQuart:function easeInQuart(u){return u*u*u*u;},easeOutQuart:function easeOutQuart(u){return 1- --u*u*u*u;},easeInOutQuart:function easeInOutQuart(u){return u<0.5?8*u*u*u*u:1-8*--u*u*u*u;},easeInQuint:function easeInQuint(u){return u*u*u*u*u;},easeOutQuint:function easeOutQuint(u){return 1+--u*u*u*u*u;},easeInOutQuint:function easeInOutQuint(u){return u<0.5?16*u*u*u*u*u:1+16*--u*u*u*u*u;},easeInSine:function easeInSine(u){return 1-Math.cos(u*Math.PI/2);},easeOutSine:function easeOutSine(u){return Math.sin(u*Math.PI/2);},easeInOutSine:function easeInOutSine(u){return-(Math.cos(Math.PI*u)-1)/2;},easeInExpo:function easeInExpo(u){return u<=0?0:Math.pow(2,10*u-10);},easeOutExpo:function easeOutExpo(u){return u>=1?1:1-Math.pow(2,-10*u);},easeInOutExpo:function easeInOutExpo(u){return u<=0?0:u>=1?1:u<0.5?Math.pow(2,20*u-10)/2:(2-Math.pow(2,-20*u+10))/2;}};var ot=/*#__PURE__*/function(){function ot(){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,ot);this.x=e,this.y=t,this.z=r;}return _createClass(ot,[{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(_ref){var _ref$x=_ref.x,e=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,r=_ref$z===void 0?1:_ref$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),i=Math.cos(e);return this.x=t*i-r*n,this.y=t*n+r*i,this;}},{key:"rotWith",value:function rotWith(e,t){if(t===0)return this;var r=this.x-e.x,n=this.y-e.y,i=Math.sin(t),l=Math.cos(t);return this.x=e.x+(r*l-n*i),this.y=e.y+(r*i+n*l),this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z;return new ot(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=ot.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 ot.Dpr(this,e);}},{key:"cpr",value:function cpr(e){return ot.Cpr(this,e);}},{key:"len2",value:function len2(){return ot.Len2(this);}},{key:"len",value:function len(){return ot.Len(this);}},{key:"pry",value:function pry(e){return ot.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 ot.Uni(this);}},{key:"tan",value:function tan(e){return ot.Tan(this,e);}},{key:"dist",value:function dist(e){return ot.Dist(this,e);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(e,t){return ot.DistanceToLineSegment(e,t,this);}},{key:"slope",value:function slope(e){return ot.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 ot.Angle(this,e);}},{key:"toAngle",value:function toAngle(){return ot.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 ot.Equals(this,e,t);}},{key:"equalsXY",value:function equalsXY(e,t){return ot.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 ot.ToFixed(this);}},{key:"toString",value:function toString(){return ot.ToString(ot.ToFixed(this));}},{key:"toJson",value:function toJson(){return ot.ToJson(this);}},{key:"toArray",value:function toArray(){return ot.ToArray(this);}}],[{key:"Add",value:function Add(e,t){return new ot(e.x+t.x,e.y+t.y);}},{key:"AddXY",value:function AddXY(e,t,r){return new ot(e.x+t,e.y+r);}},{key:"Sub",value:function Sub(e,t){return new ot(e.x-t.x,e.y-t.y);}},{key:"SubXY",value:function SubXY(e,t,r){return new ot(e.x-t,e.y-r);}},{key:"AddScalar",value:function AddScalar(e,t){return new ot(e.x+t,e.y+t);}},{key:"SubScalar",value:function SubScalar(e,t){return new ot(e.x-t,e.y-t);}},{key:"Div",value:function Div(e,t){return new ot(e.x/t,e.y/t);}},{key:"Mul",value:function Mul(e,t){return new ot(e.x*t,e.y*t);}},{key:"DivV",value:function DivV(e,t){return new ot(e.x/t.x,e.y/t.y);}},{key:"MulV",value:function MulV(e,t){return new ot(e.x*t.x,e.y*t.y);}},{key:"Neg",value:function Neg(e){return new ot(-e.x,-e.y);}},{key:"Per",value:function Per(e){return new ot(e.y,-e.x);}},{key:"Dist2",value:function Dist2(e,t){return ot.Sub(e,t).len2();}},{key:"Abs",value:function Abs(e){return new ot(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 ot(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
2
+ );}},{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 ot.Dpr(e,t)/ot.Len(t);}},{key:"Uni",value:function Uni(e){return ot.Div(e,ot.Len(e));}},{key:"Tan",value:function Tan(e,t){return ot.Uni(ot.Sub(e,t));}},{key:"Min",value:function Min(e,t){return new ot(Math.min(e.x,t.x),Math.min(e.y,t.y));}},{key:"Max",value:function Max(e,t){return new ot(Math.max(e.x,t.x),Math.max(e.y,t.y));}},{key:"From",value:function From(e){return new ot().add(e);}},{key:"FromArray",value:function FromArray(e){return new ot(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 ot(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,i=e.y-t.y,l=Math.sin(r),o=Math.cos(r);return new ot(t.x+(n*o-i*l),t.y+(n*l+i*o));}/**
3
+ * Get the nearest point on a line with a known unit vector that passes through point A
4
+ *
5
+ * ```ts
6
+ * Vec.nearestPointOnLineThroughPoint(A, u, Point)
7
+ * ```
8
+ *
9
+ * @param A - Any point on the line
10
+ * @param u - The unit vector for the line.
11
+ * @param P - A point not on the line to test.
12
+ */},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(e,t,r){return ot.Mul(t,ot.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 i=ot.Tan(t,e),l=ot.Add(e,ot.Mul(i,ot.Sub(r,e).pry(i)));if(n){if(l.x<Math.min(e.x,t.x))return ot.Cast(e.x<t.x?e:t);if(l.x>Math.max(e.x,t.x))return ot.Cast(e.x>t.x?e:t);if(l.y<Math.min(e.y,t.y))return ot.Cast(e.y<t.y?e:t);if(l.y>Math.max(e.y,t.y))return ot.Cast(e.y>t.y?e:t);}return l;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(e,t,r){return ot.Dist(r,ot.NearestPointOnLineThroughPoint(e,t,r));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return ot.Dist(r,ot.NearestPointOnLineSegment(e,t,r,n));}},{key:"Snap",value:function Snap(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new ot(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}},{key:"Cast",value:function Cast(e){return e instanceof ot?e:ot.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 ot.Sub(t,e).mul(r).add(e);}},{key:"Med",value:function Med(e,t){return new ot((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 ot.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=ot.Len(e);return new ot(t*e.x/r,t*e.y/r);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(e,t,r){return ot.Sub(e,r).mul(t).add(r);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(e,t,r){return ot.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 ot(+e.x.toFixed(t),+e.y.toFixed(t),+e.z.toFixed(t));}},{key:"Nudge",value:function Nudge(e,t,r){return ot.Add(e,ot.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 ot(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 ot(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 ot(Math.min(Math.max(e.x,t)),Math.min(Math.max(e.y,t))):new ot(Math.min(Math.max(e.x,t),r),Math.min(Math.max(e.y,t),r));}/**
13
+ * Get an array of points (with simulated pressure) between two points.
14
+ *
15
+ * @param A - The first point.
16
+ * @param B - The second point.
17
+ * @param steps - The number of points to return.
18
+ */},{key:"PointsBetween",value:function PointsBetween(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i<r;i++){var l=fo.easeInQuad(i/(r-1)),o=ot.Lrp(e,t,l);o.z=Math.min(1,0.5+Math.abs(0.5-ho(l))*0.65),n.push(o);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new ot(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}}]);}();var ho=function ho(u){return u<0.5?2*u*u:-1+(4-2*u)*u;};var Dt=/*#__PURE__*/function(_ot){function Dt(){var _this13;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 i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var l=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Dt);_this13=_callSuper(this,Dt,[e,t,r]),_this13.x=e,_this13.y=t,_this13.z=r,_this13.v=n,_this13.t=i,_this13.a=l;return _this13;}_inherits(Dt,_ot);return _createClass(Dt,[{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 i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var l=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=i,this.a=l,this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z,n=this.v,i=this.t,l=this.a,o={x:n.x,y:n.y};return new Dt(e,t,r,o,i,l);}},{key:"distance",value:function distance(e){return Dt.GetDistance(this,e);}},{key:"isNear",value:function isNear(e,t){return Dt.IsNear(this,e,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(e,t){return Dt.GetAngleByPoints(e,this,t);}}],[{key:"Sub",value:function Sub(e,t){return new Dt(e.x-t.x,e.y-t.y);}},{key:"Add",value:function Add(e,t){return new Dt(e.x+t.x,e.y+t.y);}},{key:"GetDistance",value:function GetDistance(e,t){return Dt.Len(e.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(e,t,r){var n=t.x-e.x,i=r.x-t.x,l=t.y-e.y,o=r.y-t.y;var a=0;var f=Math.sqrt(n*n+l*l),g=Math.sqrt(i*i+o*o);if(f&&g){var c=n*i+l*o;a=Math.acos(c/(f*g)),a=a/Math.PI*180;var m=n*o-l*i;m=m>0?1:-1,a=180+m*a;}return a;}},{key:"IsNear",value:function IsNear(e,t,r){return Dt.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 i=e.x-t.x,l=e.y-t.y,o=Math.sin(r),a=Math.cos(r),f=Math.pow(10,n),g=Math.floor((t.x+(i*a-l*o))*f)/f,c=Math.floor((t.y+(i*o+l*a))*f)/f;return new Dt(g,c);}/**
19
+ * 根据圆心和半径,获取圆上的等份点
20
+ * @param o 圆心
21
+ * @param radius 半径
22
+ * @param average 均分数
23
+ * @returns
24
+ */},{key:"GetDotStroke",value:function GetDotStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new ot(1,1),i=Math.PI+1e-3,l=Dt.Add(e,Dt.Sub(e,n).uni().per().mul(-t)),o=[];for(var a=1/r,f=a;f<=1;f+=a)o.push(Dt.RotWith(l,e,i*2*f));return o;}/**
25
+ * 根据圆心和圆上的起始点,获取半圆上的等份点
26
+ * @param o 圆心
27
+ * @param p 圆弧起始点
28
+ * @param radian 1,逆时针180度 -1,顺时针
29
+ * @param average 均分数
30
+ * @returns
31
+ */},{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 i=r*(Math.PI+1e-3),l=[];for(var o=1/n,a=o;a<=1;a+=o)l.push(Dt.RotWith(t,e,i*a));return l;}}]);}(ot);var te=/******/function(u){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={/******/i:r,/******/l:!1,/******/exports:{}/******/};return u[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=u,t.c=e,t.d=function(r,n,i){t.o(r,n)||Object.defineProperty(r,n,{enumerable:!0,get:i});},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 i=/* @__PURE__ */Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),n&2&&typeof r!="string")for(var l in r)t.d(i,l,function(o){return r[o];}.bind(null,l));return i;},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(u,e,t){t.r(e),t.d(e,"version",function(){return J;}),t.d(e,"helpers",function(){return j;}),t.d(e,"createElement",function(){return W;}),t.d(e,"isSpriteNode",function(){return D;}),t.d(e,"registerNode",function(){return R;});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 i=t(70);t.d(e,"Node",function(){return i["default"];});var l=t(217);t.d(e,"Cloud",function(){return l["default"];});var o=t(219);t.d(e,"Block",function(){return o["default"];});var a=t(224);t.d(e,"Sprite",function(){return a["default"];});var f=t(226);t.d(e,"Path",function(){return f["default"];});var g=t(229);t.d(e,"Rect",function(){return g["default"];});var c=t(231);t.d(e,"Triangle",function(){return c["default"];});var m=t(236);t.d(e,"Parallel",function(){return m["default"];});var x=t(238);t.d(e,"Regular",function(){return x["default"];});var M=t(240);t.d(e,"Star",function(){return M["default"];});var S=t(242);t.d(e,"Ellipse",function(){return S["default"];});var P=t(244);t.d(e,"Arc",function(){return P["default"];});var T=t(246);t.d(e,"Ring",function(){return T["default"];});var h=t(232);t.d(e,"Polyline",function(){return h["default"];});var p=t(248);t.d(e,"Label",function(){return p["default"];});var d=t(250);t.d(e,"Group",function(){return d["default"];});var y=t(286);t.d(e,"Layer",function(){return y["default"];});var O=t(287);t.d(e,"SpriteSvg",function(){return O["default"];});var E=t(289);t.d(e,"LayerWorker",function(){return E["default"];});var w=t(290);t.d(e,"Scene",function(){return w["default"];});var B=t(213),A=t(221);t.d(e,"Color",function(){return A.Color;}),t.d(e,"Gradient",function(){return A.Gradient;});var b=t(72);t(1).glMatrix.setMatrixArrayType(Array);var W=B["default"].createElement,D=B["default"].isSpriteNode,R=B["default"].registerNode,j={parseColor:A.parseColor,sizeToPixel:b.sizeToPixel,toArray:b.toArray,toString:b.toString,toNumber:b.toNumber};var k;k="3.8.3";var J=k;},/* 1 *//***/function(u,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 i=t(4);t.d(e,"mat2d",function(){return i;});var l=t(5);t.d(e,"mat3",function(){return l;});var o=t(6);t.d(e,"mat4",function(){return o;});var a=t(7);t.d(e,"quat",function(){return a;});var f=t(10);t.d(e,"quat2",function(){return f;});var g=t(11);t.d(e,"vec2",function(){return g;});var c=t(8);t.d(e,"vec3",function(){return c;});var m=t(9);t.d(e,"vec4",function(){return m;});},/* 2 *//***/function(u,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 i;}),t.d(e,"setMatrixArrayType",function(){return l;}),t.d(e,"toRadian",function(){return a;}),t.d(e,"equals",function(){return f;});var r=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function l(g){n=g;}var o=Math.PI/180;function a(g){return g*o;}function f(g,c){return Math.abs(g-c)<=r*Math.max(1,Math.abs(g),Math.abs(c));}Math.hypot||(Math.hypot=function(){for(var g=0,c=arguments.length;c--;)g+=arguments[c]*arguments[c];return Math.sqrt(g);});},/* 3 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"copy",function(){return l;}),t.d(e,"identity",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return f;}),t.d(e,"transpose",function(){return g;}),t.d(e,"invert",function(){return c;}),t.d(e,"adjoint",function(){return m;}),t.d(e,"determinant",function(){return x;}),t.d(e,"multiply",function(){return M;}),t.d(e,"rotate",function(){return S;}),t.d(e,"scale",function(){return P;}),t.d(e,"fromRotation",function(){return T;}),t.d(e,"fromScaling",function(){return h;}),t.d(e,"str",function(){return p;}),t.d(e,"frob",function(){return d;}),t.d(e,"LDU",function(){return y;}),t.d(e,"add",function(){return O;}),t.d(e,"subtract",function(){return E;}),t.d(e,"exactEquals",function(){return w;}),t.d(e,"equals",function(){return B;}),t.d(e,"multiplyScalar",function(){return A;}),t.d(e,"multiplyScalarAndAdd",function(){return b;}),t.d(e,"mul",function(){return W;}),t.d(e,"sub",function(){return D;});var r=t(2);function n(){var R=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function i(R){var j=new r.ARRAY_TYPE(4);return j[0]=R[0],j[1]=R[1],j[2]=R[2],j[3]=R[3],j;}function l(R,j){return R[0]=j[0],R[1]=j[1],R[2]=j[2],R[3]=j[3],R;}function o(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function a(R,j,k,J){var rt=new r.ARRAY_TYPE(4);return rt[0]=R,rt[1]=j,rt[2]=k,rt[3]=J,rt;}function f(R,j,k,J,rt){return R[0]=j,R[1]=k,R[2]=J,R[3]=rt,R;}function g(R,j){if(R===j){var k=j[1];R[1]=j[2],R[2]=k;}else R[0]=j[0],R[1]=j[2],R[2]=j[1],R[3]=j[3];return R;}function c(R,j){var k=j[0],J=j[1],rt=j[2],st=j[3],$=k*st-rt*J;return $?($=1/$,R[0]=st*$,R[1]=-J*$,R[2]=-rt*$,R[3]=k*$,R):null;}function m(R,j){var k=j[0];return R[0]=j[3],R[1]=-j[1],R[2]=-j[2],R[3]=k,R;}function x(R){return R[0]*R[3]-R[2]*R[1];}function M(R,j,k){var J=j[0],rt=j[1],st=j[2],$=j[3],V=k[0],nt=k[1],lt=k[2],ct=k[3];return R[0]=J*V+st*nt,R[1]=rt*V+$*nt,R[2]=J*lt+st*ct,R[3]=rt*lt+$*ct,R;}function S(R,j,k){var J=j[0],rt=j[1],st=j[2],$=j[3],V=Math.sin(k),nt=Math.cos(k);return R[0]=J*nt+st*V,R[1]=rt*nt+$*V,R[2]=J*-V+st*nt,R[3]=rt*-V+$*nt,R;}function P(R,j,k){var J=j[0],rt=j[1],st=j[2],$=j[3],V=k[0],nt=k[1];return R[0]=J*V,R[1]=rt*V,R[2]=st*nt,R[3]=$*nt,R;}function T(R,j){var k=Math.sin(j),J=Math.cos(j);return R[0]=J,R[1]=k,R[2]=-k,R[3]=J,R;}function h(R,j){return R[0]=j[0],R[1]=0,R[2]=0,R[3]=j[1],R;}function p(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function d(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function y(R,j,k,J){return R[2]=J[2]/J[0],k[0]=J[0],k[1]=J[1],k[3]=J[3]-R[2]*k[1],[R,j,k];}function O(R,j,k){return R[0]=j[0]+k[0],R[1]=j[1]+k[1],R[2]=j[2]+k[2],R[3]=j[3]+k[3],R;}function E(R,j,k){return R[0]=j[0]-k[0],R[1]=j[1]-k[1],R[2]=j[2]-k[2],R[3]=j[3]-k[3],R;}function w(R,j){return R[0]===j[0]&&R[1]===j[1]&&R[2]===j[2]&&R[3]===j[3];}function B(R,j){var k=R[0],J=R[1],rt=R[2],st=R[3],$=j[0],V=j[1],nt=j[2],lt=j[3];return Math.abs(k-$)<=r.EPSILON*Math.max(1,Math.abs(k),Math.abs($))&&Math.abs(J-V)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(V))&&Math.abs(rt-nt)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(nt))&&Math.abs(st-lt)<=r.EPSILON*Math.max(1,Math.abs(st),Math.abs(lt));}function A(R,j,k){return R[0]=j[0]*k,R[1]=j[1]*k,R[2]=j[2]*k,R[3]=j[3]*k,R;}function b(R,j,k,J){return R[0]=j[0]+k[0]*J,R[1]=j[1]+k[1]*J,R[2]=j[2]+k[2]*J,R[3]=j[3]+k[3]*J,R;}var W=M,D=E;},/* 4 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"copy",function(){return l;}),t.d(e,"identity",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return f;}),t.d(e,"invert",function(){return g;}),t.d(e,"determinant",function(){return c;}),t.d(e,"multiply",function(){return m;}),t.d(e,"rotate",function(){return x;}),t.d(e,"scale",function(){return M;}),t.d(e,"translate",function(){return S;}),t.d(e,"fromRotation",function(){return P;}),t.d(e,"fromScaling",function(){return T;}),t.d(e,"fromTranslation",function(){return h;}),t.d(e,"str",function(){return p;}),t.d(e,"frob",function(){return d;}),t.d(e,"add",function(){return y;}),t.d(e,"subtract",function(){return O;}),t.d(e,"multiplyScalar",function(){return E;}),t.d(e,"multiplyScalarAndAdd",function(){return w;}),t.d(e,"exactEquals",function(){return B;}),t.d(e,"equals",function(){return A;}),t.d(e,"mul",function(){return b;}),t.d(e,"sub",function(){return W;});var r=t(2);function n(){var D=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(D[1]=0,D[2]=0,D[4]=0,D[5]=0),D[0]=1,D[3]=1,D;}function i(D){var R=new r.ARRAY_TYPE(6);return R[0]=D[0],R[1]=D[1],R[2]=D[2],R[3]=D[3],R[4]=D[4],R[5]=D[5],R;}function l(D,R){return D[0]=R[0],D[1]=R[1],D[2]=R[2],D[3]=R[3],D[4]=R[4],D[5]=R[5],D;}function o(D){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=0,D[5]=0,D;}function a(D,R,j,k,J,rt){var st=new r.ARRAY_TYPE(6);return st[0]=D,st[1]=R,st[2]=j,st[3]=k,st[4]=J,st[5]=rt,st;}function f(D,R,j,k,J,rt,st){return D[0]=R,D[1]=j,D[2]=k,D[3]=J,D[4]=rt,D[5]=st,D;}function g(D,R){var j=R[0],k=R[1],J=R[2],rt=R[3],st=R[4],$=R[5],V=j*rt-k*J;return V?(V=1/V,D[0]=rt*V,D[1]=-k*V,D[2]=-J*V,D[3]=j*V,D[4]=(J*$-rt*st)*V,D[5]=(k*st-j*$)*V,D):null;}function c(D){return D[0]*D[3]-D[1]*D[2];}function m(D,R,j){var k=R[0],J=R[1],rt=R[2],st=R[3],$=R[4],V=R[5],nt=j[0],lt=j[1],ct=j[2],pt=j[3],et=j[4],gt=j[5];return D[0]=k*nt+rt*lt,D[1]=J*nt+st*lt,D[2]=k*ct+rt*pt,D[3]=J*ct+st*pt,D[4]=k*et+rt*gt+$,D[5]=J*et+st*gt+V,D;}function x(D,R,j){var k=R[0],J=R[1],rt=R[2],st=R[3],$=R[4],V=R[5],nt=Math.sin(j),lt=Math.cos(j);return D[0]=k*lt+rt*nt,D[1]=J*lt+st*nt,D[2]=k*-nt+rt*lt,D[3]=J*-nt+st*lt,D[4]=$,D[5]=V,D;}function M(D,R,j){var k=R[0],J=R[1],rt=R[2],st=R[3],$=R[4],V=R[5],nt=j[0],lt=j[1];return D[0]=k*nt,D[1]=J*nt,D[2]=rt*lt,D[3]=st*lt,D[4]=$,D[5]=V,D;}function S(D,R,j){var k=R[0],J=R[1],rt=R[2],st=R[3],$=R[4],V=R[5],nt=j[0],lt=j[1];return D[0]=k,D[1]=J,D[2]=rt,D[3]=st,D[4]=k*nt+rt*lt+$,D[5]=J*nt+st*lt+V,D;}function P(D,R){var j=Math.sin(R),k=Math.cos(R);return D[0]=k,D[1]=j,D[2]=-j,D[3]=k,D[4]=0,D[5]=0,D;}function T(D,R){return D[0]=R[0],D[1]=0,D[2]=0,D[3]=R[1],D[4]=0,D[5]=0,D;}function h(D,R){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=R[0],D[5]=R[1],D;}function p(D){return"mat2d("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+", "+D[4]+", "+D[5]+")";}function d(D){return Math.hypot(D[0],D[1],D[2],D[3],D[4],D[5],1);}function y(D,R,j){return D[0]=R[0]+j[0],D[1]=R[1]+j[1],D[2]=R[2]+j[2],D[3]=R[3]+j[3],D[4]=R[4]+j[4],D[5]=R[5]+j[5],D;}function O(D,R,j){return D[0]=R[0]-j[0],D[1]=R[1]-j[1],D[2]=R[2]-j[2],D[3]=R[3]-j[3],D[4]=R[4]-j[4],D[5]=R[5]-j[5],D;}function E(D,R,j){return D[0]=R[0]*j,D[1]=R[1]*j,D[2]=R[2]*j,D[3]=R[3]*j,D[4]=R[4]*j,D[5]=R[5]*j,D;}function w(D,R,j,k){return D[0]=R[0]+j[0]*k,D[1]=R[1]+j[1]*k,D[2]=R[2]+j[2]*k,D[3]=R[3]+j[3]*k,D[4]=R[4]+j[4]*k,D[5]=R[5]+j[5]*k,D;}function B(D,R){return D[0]===R[0]&&D[1]===R[1]&&D[2]===R[2]&&D[3]===R[3]&&D[4]===R[4]&&D[5]===R[5];}function A(D,R){var j=D[0],k=D[1],J=D[2],rt=D[3],st=D[4],$=D[5],V=R[0],nt=R[1],lt=R[2],ct=R[3],pt=R[4],et=R[5];return Math.abs(j-V)<=r.EPSILON*Math.max(1,Math.abs(j),Math.abs(V))&&Math.abs(k-nt)<=r.EPSILON*Math.max(1,Math.abs(k),Math.abs(nt))&&Math.abs(J-lt)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(lt))&&Math.abs(rt-ct)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(ct))&&Math.abs(st-pt)<=r.EPSILON*Math.max(1,Math.abs(st),Math.abs(pt))&&Math.abs($-et)<=r.EPSILON*Math.max(1,Math.abs($),Math.abs(et));}var b=m,W=O;},/* 5 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"fromMat4",function(){return i;}),t.d(e,"clone",function(){return l;}),t.d(e,"copy",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return f;}),t.d(e,"identity",function(){return g;}),t.d(e,"transpose",function(){return c;}),t.d(e,"invert",function(){return m;}),t.d(e,"adjoint",function(){return x;}),t.d(e,"determinant",function(){return M;}),t.d(e,"multiply",function(){return S;}),t.d(e,"translate",function(){return P;}),t.d(e,"rotate",function(){return T;}),t.d(e,"scale",function(){return h;}),t.d(e,"fromTranslation",function(){return p;}),t.d(e,"fromRotation",function(){return d;}),t.d(e,"fromScaling",function(){return y;}),t.d(e,"fromMat2d",function(){return O;}),t.d(e,"fromQuat",function(){return E;}),t.d(e,"normalFromMat4",function(){return w;}),t.d(e,"projection",function(){return B;}),t.d(e,"str",function(){return A;}),t.d(e,"frob",function(){return b;}),t.d(e,"add",function(){return W;}),t.d(e,"subtract",function(){return D;}),t.d(e,"multiplyScalar",function(){return R;}),t.d(e,"multiplyScalarAndAdd",function(){return j;}),t.d(e,"exactEquals",function(){return k;}),t.d(e,"equals",function(){return J;}),t.d(e,"mul",function(){return rt;}),t.d(e,"sub",function(){return st;});var r=t(2);function n(){var $=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&($[1]=0,$[2]=0,$[3]=0,$[5]=0,$[6]=0,$[7]=0),$[0]=1,$[4]=1,$[8]=1,$;}function i($,V){return $[0]=V[0],$[1]=V[1],$[2]=V[2],$[3]=V[4],$[4]=V[5],$[5]=V[6],$[6]=V[8],$[7]=V[9],$[8]=V[10],$;}function l($){var V=new r.ARRAY_TYPE(9);return V[0]=$[0],V[1]=$[1],V[2]=$[2],V[3]=$[3],V[4]=$[4],V[5]=$[5],V[6]=$[6],V[7]=$[7],V[8]=$[8],V;}function o($,V){return $[0]=V[0],$[1]=V[1],$[2]=V[2],$[3]=V[3],$[4]=V[4],$[5]=V[5],$[6]=V[6],$[7]=V[7],$[8]=V[8],$;}function a($,V,nt,lt,ct,pt,et,gt,Tt){var X=new r.ARRAY_TYPE(9);return X[0]=$,X[1]=V,X[2]=nt,X[3]=lt,X[4]=ct,X[5]=pt,X[6]=et,X[7]=gt,X[8]=Tt,X;}function f($,V,nt,lt,ct,pt,et,gt,Tt,X){return $[0]=V,$[1]=nt,$[2]=lt,$[3]=ct,$[4]=pt,$[5]=et,$[6]=gt,$[7]=Tt,$[8]=X,$;}function g($){return $[0]=1,$[1]=0,$[2]=0,$[3]=0,$[4]=1,$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function c($,V){if($===V){var nt=V[1],lt=V[2],ct=V[5];$[1]=V[3],$[2]=V[6],$[3]=nt,$[5]=V[7],$[6]=lt,$[7]=ct;}else $[0]=V[0],$[1]=V[3],$[2]=V[6],$[3]=V[1],$[4]=V[4],$[5]=V[7],$[6]=V[2],$[7]=V[5],$[8]=V[8];return $;}function m($,V){var nt=V[0],lt=V[1],ct=V[2],pt=V[3],et=V[4],gt=V[5],Tt=V[6],X=V[7],z=V[8],Q=z*et-gt*X,tt=-z*pt+gt*Tt,U=X*pt-et*Tt,H=nt*Q+lt*tt+ct*U;return H?(H=1/H,$[0]=Q*H,$[1]=(-z*lt+ct*X)*H,$[2]=(gt*lt-ct*et)*H,$[3]=tt*H,$[4]=(z*nt-ct*Tt)*H,$[5]=(-gt*nt+ct*pt)*H,$[6]=U*H,$[7]=(-X*nt+lt*Tt)*H,$[8]=(et*nt-lt*pt)*H,$):null;}function x($,V){var nt=V[0],lt=V[1],ct=V[2],pt=V[3],et=V[4],gt=V[5],Tt=V[6],X=V[7],z=V[8];return $[0]=et*z-gt*X,$[1]=ct*X-lt*z,$[2]=lt*gt-ct*et,$[3]=gt*Tt-pt*z,$[4]=nt*z-ct*Tt,$[5]=ct*pt-nt*gt,$[6]=pt*X-et*Tt,$[7]=lt*Tt-nt*X,$[8]=nt*et-lt*pt,$;}function M($){var V=$[0],nt=$[1],lt=$[2],ct=$[3],pt=$[4],et=$[5],gt=$[6],Tt=$[7],X=$[8];return V*(X*pt-et*Tt)+nt*(-X*ct+et*gt)+lt*(Tt*ct-pt*gt);}function S($,V,nt){var lt=V[0],ct=V[1],pt=V[2],et=V[3],gt=V[4],Tt=V[5],X=V[6],z=V[7],Q=V[8],tt=nt[0],U=nt[1],H=nt[2],C=nt[3],L=nt[4],F=nt[5],G=nt[6],Z=nt[7],q=nt[8];return $[0]=tt*lt+U*et+H*X,$[1]=tt*ct+U*gt+H*z,$[2]=tt*pt+U*Tt+H*Q,$[3]=C*lt+L*et+F*X,$[4]=C*ct+L*gt+F*z,$[5]=C*pt+L*Tt+F*Q,$[6]=G*lt+Z*et+q*X,$[7]=G*ct+Z*gt+q*z,$[8]=G*pt+Z*Tt+q*Q,$;}function P($,V,nt){var lt=V[0],ct=V[1],pt=V[2],et=V[3],gt=V[4],Tt=V[5],X=V[6],z=V[7],Q=V[8],tt=nt[0],U=nt[1];return $[0]=lt,$[1]=ct,$[2]=pt,$[3]=et,$[4]=gt,$[5]=Tt,$[6]=tt*lt+U*et+X,$[7]=tt*ct+U*gt+z,$[8]=tt*pt+U*Tt+Q,$;}function T($,V,nt){var lt=V[0],ct=V[1],pt=V[2],et=V[3],gt=V[4],Tt=V[5],X=V[6],z=V[7],Q=V[8],tt=Math.sin(nt),U=Math.cos(nt);return $[0]=U*lt+tt*et,$[1]=U*ct+tt*gt,$[2]=U*pt+tt*Tt,$[3]=U*et-tt*lt,$[4]=U*gt-tt*ct,$[5]=U*Tt-tt*pt,$[6]=X,$[7]=z,$[8]=Q,$;}function h($,V,nt){var lt=nt[0],ct=nt[1];return $[0]=lt*V[0],$[1]=lt*V[1],$[2]=lt*V[2],$[3]=ct*V[3],$[4]=ct*V[4],$[5]=ct*V[5],$[6]=V[6],$[7]=V[7],$[8]=V[8],$;}function p($,V){return $[0]=1,$[1]=0,$[2]=0,$[3]=0,$[4]=1,$[5]=0,$[6]=V[0],$[7]=V[1],$[8]=1,$;}function d($,V){var nt=Math.sin(V),lt=Math.cos(V);return $[0]=lt,$[1]=nt,$[2]=0,$[3]=-nt,$[4]=lt,$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function y($,V){return $[0]=V[0],$[1]=0,$[2]=0,$[3]=0,$[4]=V[1],$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function O($,V){return $[0]=V[0],$[1]=V[1],$[2]=0,$[3]=V[2],$[4]=V[3],$[5]=0,$[6]=V[4],$[7]=V[5],$[8]=1,$;}function E($,V){var nt=V[0],lt=V[1],ct=V[2],pt=V[3],et=nt+nt,gt=lt+lt,Tt=ct+ct,X=nt*et,z=lt*et,Q=lt*gt,tt=ct*et,U=ct*gt,H=ct*Tt,C=pt*et,L=pt*gt,F=pt*Tt;return $[0]=1-Q-H,$[3]=z-F,$[6]=tt+L,$[1]=z+F,$[4]=1-X-H,$[7]=U-C,$[2]=tt-L,$[5]=U+C,$[8]=1-X-Q,$;}function w($,V){var nt=V[0],lt=V[1],ct=V[2],pt=V[3],et=V[4],gt=V[5],Tt=V[6],X=V[7],z=V[8],Q=V[9],tt=V[10],U=V[11],H=V[12],C=V[13],L=V[14],F=V[15],G=nt*gt-lt*et,Z=nt*Tt-ct*et,q=nt*X-pt*et,it=lt*Tt-ct*gt,ut=lt*X-pt*gt,mt=ct*X-pt*Tt,Pt=z*C-Q*H,Ct=z*L-tt*H,yt=z*F-U*H,vt=Q*L-tt*C,xt=Q*F-U*C,Et=tt*F-U*L,At=G*Et-Z*xt+q*vt+it*yt-ut*Ct+mt*Pt;return At?(At=1/At,$[0]=(gt*Et-Tt*xt+X*vt)*At,$[1]=(Tt*yt-et*Et-X*Ct)*At,$[2]=(et*xt-gt*yt+X*Pt)*At,$[3]=(ct*xt-lt*Et-pt*vt)*At,$[4]=(nt*Et-ct*yt+pt*Ct)*At,$[5]=(lt*yt-nt*xt-pt*Pt)*At,$[6]=(C*mt-L*ut+F*it)*At,$[7]=(L*q-H*mt-F*Z)*At,$[8]=(H*ut-C*q+F*G)*At,$):null;}function B($,V,nt){return $[0]=2/V,$[1]=0,$[2]=0,$[3]=0,$[4]=-2/nt,$[5]=0,$[6]=-1,$[7]=1,$[8]=1,$;}function A($){return"mat3("+$[0]+", "+$[1]+", "+$[2]+", "+$[3]+", "+$[4]+", "+$[5]+", "+$[6]+", "+$[7]+", "+$[8]+")";}function b($){return Math.hypot($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8]);}function W($,V,nt){return $[0]=V[0]+nt[0],$[1]=V[1]+nt[1],$[2]=V[2]+nt[2],$[3]=V[3]+nt[3],$[4]=V[4]+nt[4],$[5]=V[5]+nt[5],$[6]=V[6]+nt[6],$[7]=V[7]+nt[7],$[8]=V[8]+nt[8],$;}function D($,V,nt){return $[0]=V[0]-nt[0],$[1]=V[1]-nt[1],$[2]=V[2]-nt[2],$[3]=V[3]-nt[3],$[4]=V[4]-nt[4],$[5]=V[5]-nt[5],$[6]=V[6]-nt[6],$[7]=V[7]-nt[7],$[8]=V[8]-nt[8],$;}function R($,V,nt){return $[0]=V[0]*nt,$[1]=V[1]*nt,$[2]=V[2]*nt,$[3]=V[3]*nt,$[4]=V[4]*nt,$[5]=V[5]*nt,$[6]=V[6]*nt,$[7]=V[7]*nt,$[8]=V[8]*nt,$;}function j($,V,nt,lt){return $[0]=V[0]+nt[0]*lt,$[1]=V[1]+nt[1]*lt,$[2]=V[2]+nt[2]*lt,$[3]=V[3]+nt[3]*lt,$[4]=V[4]+nt[4]*lt,$[5]=V[5]+nt[5]*lt,$[6]=V[6]+nt[6]*lt,$[7]=V[7]+nt[7]*lt,$[8]=V[8]+nt[8]*lt,$;}function k($,V){return $[0]===V[0]&&$[1]===V[1]&&$[2]===V[2]&&$[3]===V[3]&&$[4]===V[4]&&$[5]===V[5]&&$[6]===V[6]&&$[7]===V[7]&&$[8]===V[8];}function J($,V){var nt=$[0],lt=$[1],ct=$[2],pt=$[3],et=$[4],gt=$[5],Tt=$[6],X=$[7],z=$[8],Q=V[0],tt=V[1],U=V[2],H=V[3],C=V[4],L=V[5],F=V[6],G=V[7],Z=V[8];return Math.abs(nt-Q)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(Q))&&Math.abs(lt-tt)<=r.EPSILON*Math.max(1,Math.abs(lt),Math.abs(tt))&&Math.abs(ct-U)<=r.EPSILON*Math.max(1,Math.abs(ct),Math.abs(U))&&Math.abs(pt-H)<=r.EPSILON*Math.max(1,Math.abs(pt),Math.abs(H))&&Math.abs(et-C)<=r.EPSILON*Math.max(1,Math.abs(et),Math.abs(C))&&Math.abs(gt-L)<=r.EPSILON*Math.max(1,Math.abs(gt),Math.abs(L))&&Math.abs(Tt-F)<=r.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(F))&&Math.abs(X-G)<=r.EPSILON*Math.max(1,Math.abs(X),Math.abs(G))&&Math.abs(z-Z)<=r.EPSILON*Math.max(1,Math.abs(z),Math.abs(Z));}var rt=S,st=D;},/* 6 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"copy",function(){return l;}),t.d(e,"fromValues",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"identity",function(){return f;}),t.d(e,"transpose",function(){return g;}),t.d(e,"invert",function(){return c;}),t.d(e,"adjoint",function(){return m;}),t.d(e,"determinant",function(){return x;}),t.d(e,"multiply",function(){return M;}),t.d(e,"translate",function(){return S;}),t.d(e,"scale",function(){return P;}),t.d(e,"rotate",function(){return T;}),t.d(e,"rotateX",function(){return h;}),t.d(e,"rotateY",function(){return p;}),t.d(e,"rotateZ",function(){return d;}),t.d(e,"fromTranslation",function(){return y;}),t.d(e,"fromScaling",function(){return O;}),t.d(e,"fromRotation",function(){return E;}),t.d(e,"fromXRotation",function(){return w;}),t.d(e,"fromYRotation",function(){return B;}),t.d(e,"fromZRotation",function(){return A;}),t.d(e,"fromRotationTranslation",function(){return b;}),t.d(e,"fromQuat2",function(){return W;}),t.d(e,"getTranslation",function(){return D;}),t.d(e,"getScaling",function(){return R;}),t.d(e,"getRotation",function(){return j;}),t.d(e,"fromRotationTranslationScale",function(){return k;}),t.d(e,"fromRotationTranslationScaleOrigin",function(){return J;}),t.d(e,"fromQuat",function(){return rt;}),t.d(e,"frustum",function(){return st;}),t.d(e,"perspective",function(){return $;}),t.d(e,"perspectiveFromFieldOfView",function(){return V;}),t.d(e,"ortho",function(){return nt;}),t.d(e,"lookAt",function(){return lt;}),t.d(e,"targetTo",function(){return ct;}),t.d(e,"str",function(){return pt;}),t.d(e,"frob",function(){return et;}),t.d(e,"add",function(){return gt;}),t.d(e,"subtract",function(){return Tt;}),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 tt;}),t.d(e,"mul",function(){return U;}),t.d(e,"sub",function(){return H;});var r=t(2);function n(){var C=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=0,C[12]=0,C[13]=0,C[14]=0),C[0]=1,C[5]=1,C[10]=1,C[15]=1,C;}function i(C){var L=new r.ARRAY_TYPE(16);return L[0]=C[0],L[1]=C[1],L[2]=C[2],L[3]=C[3],L[4]=C[4],L[5]=C[5],L[6]=C[6],L[7]=C[7],L[8]=C[8],L[9]=C[9],L[10]=C[10],L[11]=C[11],L[12]=C[12],L[13]=C[13],L[14]=C[14],L[15]=C[15],L;}function l(C,L){return C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3],C[4]=L[4],C[5]=L[5],C[6]=L[6],C[7]=L[7],C[8]=L[8],C[9]=L[9],C[10]=L[10],C[11]=L[11],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15],C;}function o(C,L,F,G,Z,q,it,ut,mt,Pt,Ct,yt,vt,xt,Et,At){var Ot=new r.ARRAY_TYPE(16);return Ot[0]=C,Ot[1]=L,Ot[2]=F,Ot[3]=G,Ot[4]=Z,Ot[5]=q,Ot[6]=it,Ot[7]=ut,Ot[8]=mt,Ot[9]=Pt,Ot[10]=Ct,Ot[11]=yt,Ot[12]=vt,Ot[13]=xt,Ot[14]=Et,Ot[15]=At,Ot;}function a(C,L,F,G,Z,q,it,ut,mt,Pt,Ct,yt,vt,xt,Et,At,Ot){return C[0]=L,C[1]=F,C[2]=G,C[3]=Z,C[4]=q,C[5]=it,C[6]=ut,C[7]=mt,C[8]=Pt,C[9]=Ct,C[10]=yt,C[11]=vt,C[12]=xt,C[13]=Et,C[14]=At,C[15]=Ot,C;}function f(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function g(C,L){if(C===L){var F=L[1],G=L[2],Z=L[3],q=L[6],it=L[7],ut=L[11];C[1]=L[4],C[2]=L[8],C[3]=L[12],C[4]=F,C[6]=L[9],C[7]=L[13],C[8]=G,C[9]=q,C[11]=L[14],C[12]=Z,C[13]=it,C[14]=ut;}else C[0]=L[0],C[1]=L[4],C[2]=L[8],C[3]=L[12],C[4]=L[1],C[5]=L[5],C[6]=L[9],C[7]=L[13],C[8]=L[2],C[9]=L[6],C[10]=L[10],C[11]=L[14],C[12]=L[3],C[13]=L[7],C[14]=L[11],C[15]=L[15];return C;}function c(C,L){var F=L[0],G=L[1],Z=L[2],q=L[3],it=L[4],ut=L[5],mt=L[6],Pt=L[7],Ct=L[8],yt=L[9],vt=L[10],xt=L[11],Et=L[12],At=L[13],Ot=L[14],Nt=L[15],$t=F*ut-G*it,jt=F*mt-Z*it,Ut=F*Pt-q*it,zt=G*mt-Z*ut,Xt=G*Pt-q*ut,ae=Z*Pt-q*mt,ie=Ct*At-yt*Et,se=Ct*Ot-vt*Et,oe=Ct*Nt-xt*Et,le=yt*Ot-vt*At,ce=yt*Nt-xt*At,fe=vt*Nt-xt*Ot,Jt=$t*fe-jt*ce+Ut*le+zt*oe-Xt*se+ae*ie;return Jt?(Jt=1/Jt,C[0]=(ut*fe-mt*ce+Pt*le)*Jt,C[1]=(Z*ce-G*fe-q*le)*Jt,C[2]=(At*ae-Ot*Xt+Nt*zt)*Jt,C[3]=(vt*Xt-yt*ae-xt*zt)*Jt,C[4]=(mt*oe-it*fe-Pt*se)*Jt,C[5]=(F*fe-Z*oe+q*se)*Jt,C[6]=(Ot*Ut-Et*ae-Nt*jt)*Jt,C[7]=(Ct*ae-vt*Ut+xt*jt)*Jt,C[8]=(it*ce-ut*oe+Pt*ie)*Jt,C[9]=(G*oe-F*ce-q*ie)*Jt,C[10]=(Et*Xt-At*Ut+Nt*$t)*Jt,C[11]=(yt*Ut-Ct*Xt-xt*$t)*Jt,C[12]=(ut*se-it*le-mt*ie)*Jt,C[13]=(F*le-G*se+Z*ie)*Jt,C[14]=(At*jt-Et*zt-Ot*$t)*Jt,C[15]=(Ct*zt-yt*jt+vt*$t)*Jt,C):null;}function m(C,L){var F=L[0],G=L[1],Z=L[2],q=L[3],it=L[4],ut=L[5],mt=L[6],Pt=L[7],Ct=L[8],yt=L[9],vt=L[10],xt=L[11],Et=L[12],At=L[13],Ot=L[14],Nt=L[15];return C[0]=ut*(vt*Nt-xt*Ot)-yt*(mt*Nt-Pt*Ot)+At*(mt*xt-Pt*vt),C[1]=-(G*(vt*Nt-xt*Ot)-yt*(Z*Nt-q*Ot)+At*(Z*xt-q*vt)),C[2]=G*(mt*Nt-Pt*Ot)-ut*(Z*Nt-q*Ot)+At*(Z*Pt-q*mt),C[3]=-(G*(mt*xt-Pt*vt)-ut*(Z*xt-q*vt)+yt*(Z*Pt-q*mt)),C[4]=-(it*(vt*Nt-xt*Ot)-Ct*(mt*Nt-Pt*Ot)+Et*(mt*xt-Pt*vt)),C[5]=F*(vt*Nt-xt*Ot)-Ct*(Z*Nt-q*Ot)+Et*(Z*xt-q*vt),C[6]=-(F*(mt*Nt-Pt*Ot)-it*(Z*Nt-q*Ot)+Et*(Z*Pt-q*mt)),C[7]=F*(mt*xt-Pt*vt)-it*(Z*xt-q*vt)+Ct*(Z*Pt-q*mt),C[8]=it*(yt*Nt-xt*At)-Ct*(ut*Nt-Pt*At)+Et*(ut*xt-Pt*yt),C[9]=-(F*(yt*Nt-xt*At)-Ct*(G*Nt-q*At)+Et*(G*xt-q*yt)),C[10]=F*(ut*Nt-Pt*At)-it*(G*Nt-q*At)+Et*(G*Pt-q*ut),C[11]=-(F*(ut*xt-Pt*yt)-it*(G*xt-q*yt)+Ct*(G*Pt-q*ut)),C[12]=-(it*(yt*Ot-vt*At)-Ct*(ut*Ot-mt*At)+Et*(ut*vt-mt*yt)),C[13]=F*(yt*Ot-vt*At)-Ct*(G*Ot-Z*At)+Et*(G*vt-Z*yt),C[14]=-(F*(ut*Ot-mt*At)-it*(G*Ot-Z*At)+Et*(G*mt-Z*ut)),C[15]=F*(ut*vt-mt*yt)-it*(G*vt-Z*yt)+Ct*(G*mt-Z*ut),C;}function x(C){var L=C[0],F=C[1],G=C[2],Z=C[3],q=C[4],it=C[5],ut=C[6],mt=C[7],Pt=C[8],Ct=C[9],yt=C[10],vt=C[11],xt=C[12],Et=C[13],At=C[14],Ot=C[15],Nt=L*it-F*q,$t=L*ut-G*q,jt=L*mt-Z*q,Ut=F*ut-G*it,zt=F*mt-Z*it,Xt=G*mt-Z*ut,ae=Pt*Et-Ct*xt,ie=Pt*At-yt*xt,se=Pt*Ot-vt*xt,oe=Ct*At-yt*Et,le=Ct*Ot-vt*Et,ce=yt*Ot-vt*At;return Nt*ce-$t*le+jt*oe+Ut*se-zt*ie+Xt*ae;}function M(C,L,F){var G=L[0],Z=L[1],q=L[2],it=L[3],ut=L[4],mt=L[5],Pt=L[6],Ct=L[7],yt=L[8],vt=L[9],xt=L[10],Et=L[11],At=L[12],Ot=L[13],Nt=L[14],$t=L[15],jt=F[0],Ut=F[1],zt=F[2],Xt=F[3];return C[0]=jt*G+Ut*ut+zt*yt+Xt*At,C[1]=jt*Z+Ut*mt+zt*vt+Xt*Ot,C[2]=jt*q+Ut*Pt+zt*xt+Xt*Nt,C[3]=jt*it+Ut*Ct+zt*Et+Xt*$t,jt=F[4],Ut=F[5],zt=F[6],Xt=F[7],C[4]=jt*G+Ut*ut+zt*yt+Xt*At,C[5]=jt*Z+Ut*mt+zt*vt+Xt*Ot,C[6]=jt*q+Ut*Pt+zt*xt+Xt*Nt,C[7]=jt*it+Ut*Ct+zt*Et+Xt*$t,jt=F[8],Ut=F[9],zt=F[10],Xt=F[11],C[8]=jt*G+Ut*ut+zt*yt+Xt*At,C[9]=jt*Z+Ut*mt+zt*vt+Xt*Ot,C[10]=jt*q+Ut*Pt+zt*xt+Xt*Nt,C[11]=jt*it+Ut*Ct+zt*Et+Xt*$t,jt=F[12],Ut=F[13],zt=F[14],Xt=F[15],C[12]=jt*G+Ut*ut+zt*yt+Xt*At,C[13]=jt*Z+Ut*mt+zt*vt+Xt*Ot,C[14]=jt*q+Ut*Pt+zt*xt+Xt*Nt,C[15]=jt*it+Ut*Ct+zt*Et+Xt*$t,C;}function S(C,L,F){var G=F[0],Z=F[1],q=F[2],it,ut,mt,Pt,Ct,yt,vt,xt,Et,At,Ot,Nt;return L===C?(C[12]=L[0]*G+L[4]*Z+L[8]*q+L[12],C[13]=L[1]*G+L[5]*Z+L[9]*q+L[13],C[14]=L[2]*G+L[6]*Z+L[10]*q+L[14],C[15]=L[3]*G+L[7]*Z+L[11]*q+L[15]):(it=L[0],ut=L[1],mt=L[2],Pt=L[3],Ct=L[4],yt=L[5],vt=L[6],xt=L[7],Et=L[8],At=L[9],Ot=L[10],Nt=L[11],C[0]=it,C[1]=ut,C[2]=mt,C[3]=Pt,C[4]=Ct,C[5]=yt,C[6]=vt,C[7]=xt,C[8]=Et,C[9]=At,C[10]=Ot,C[11]=Nt,C[12]=it*G+Ct*Z+Et*q+L[12],C[13]=ut*G+yt*Z+At*q+L[13],C[14]=mt*G+vt*Z+Ot*q+L[14],C[15]=Pt*G+xt*Z+Nt*q+L[15]),C;}function P(C,L,F){var G=F[0],Z=F[1],q=F[2];return C[0]=L[0]*G,C[1]=L[1]*G,C[2]=L[2]*G,C[3]=L[3]*G,C[4]=L[4]*Z,C[5]=L[5]*Z,C[6]=L[6]*Z,C[7]=L[7]*Z,C[8]=L[8]*q,C[9]=L[9]*q,C[10]=L[10]*q,C[11]=L[11]*q,C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15],C;}function T(C,L,F,G){var Z=G[0],q=G[1],it=G[2],ut=Math.hypot(Z,q,it),mt,Pt,Ct,yt,vt,xt,Et,At,Ot,Nt,$t,jt,Ut,zt,Xt,ae,ie,se,oe,le,ce,fe,Jt,ge;return ut<r.EPSILON?null:(ut=1/ut,Z*=ut,q*=ut,it*=ut,mt=Math.sin(F),Pt=Math.cos(F),Ct=1-Pt,yt=L[0],vt=L[1],xt=L[2],Et=L[3],At=L[4],Ot=L[5],Nt=L[6],$t=L[7],jt=L[8],Ut=L[9],zt=L[10],Xt=L[11],ae=Z*Z*Ct+Pt,ie=q*Z*Ct+it*mt,se=it*Z*Ct-q*mt,oe=Z*q*Ct-it*mt,le=q*q*Ct+Pt,ce=it*q*Ct+Z*mt,fe=Z*it*Ct+q*mt,Jt=q*it*Ct-Z*mt,ge=it*it*Ct+Pt,C[0]=yt*ae+At*ie+jt*se,C[1]=vt*ae+Ot*ie+Ut*se,C[2]=xt*ae+Nt*ie+zt*se,C[3]=Et*ae+$t*ie+Xt*se,C[4]=yt*oe+At*le+jt*ce,C[5]=vt*oe+Ot*le+Ut*ce,C[6]=xt*oe+Nt*le+zt*ce,C[7]=Et*oe+$t*le+Xt*ce,C[8]=yt*fe+At*Jt+jt*ge,C[9]=vt*fe+Ot*Jt+Ut*ge,C[10]=xt*fe+Nt*Jt+zt*ge,C[11]=Et*fe+$t*Jt+Xt*ge,L!==C&&(C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C);}function h(C,L,F){var G=Math.sin(F),Z=Math.cos(F),q=L[4],it=L[5],ut=L[6],mt=L[7],Pt=L[8],Ct=L[9],yt=L[10],vt=L[11];return L!==C&&(C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[4]=q*Z+Pt*G,C[5]=it*Z+Ct*G,C[6]=ut*Z+yt*G,C[7]=mt*Z+vt*G,C[8]=Pt*Z-q*G,C[9]=Ct*Z-it*G,C[10]=yt*Z-ut*G,C[11]=vt*Z-mt*G,C;}function p(C,L,F){var G=Math.sin(F),Z=Math.cos(F),q=L[0],it=L[1],ut=L[2],mt=L[3],Pt=L[8],Ct=L[9],yt=L[10],vt=L[11];return L!==C&&(C[4]=L[4],C[5]=L[5],C[6]=L[6],C[7]=L[7],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[0]=q*Z-Pt*G,C[1]=it*Z-Ct*G,C[2]=ut*Z-yt*G,C[3]=mt*Z-vt*G,C[8]=q*G+Pt*Z,C[9]=it*G+Ct*Z,C[10]=ut*G+yt*Z,C[11]=mt*G+vt*Z,C;}function d(C,L,F){var G=Math.sin(F),Z=Math.cos(F),q=L[0],it=L[1],ut=L[2],mt=L[3],Pt=L[4],Ct=L[5],yt=L[6],vt=L[7];return L!==C&&(C[8]=L[8],C[9]=L[9],C[10]=L[10],C[11]=L[11],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[0]=q*Z+Pt*G,C[1]=it*Z+Ct*G,C[2]=ut*Z+yt*G,C[3]=mt*Z+vt*G,C[4]=Pt*Z-q*G,C[5]=Ct*Z-it*G,C[6]=yt*Z-ut*G,C[7]=vt*Z-mt*G,C;}function y(C,L){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=L[0],C[13]=L[1],C[14]=L[2],C[15]=1,C;}function O(C,L){return C[0]=L[0],C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=L[1],C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=L[2],C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function E(C,L,F){var G=F[0],Z=F[1],q=F[2],it=Math.hypot(G,Z,q),ut,mt,Pt;return it<r.EPSILON?null:(it=1/it,G*=it,Z*=it,q*=it,ut=Math.sin(L),mt=Math.cos(L),Pt=1-mt,C[0]=G*G*Pt+mt,C[1]=Z*G*Pt+q*ut,C[2]=q*G*Pt-Z*ut,C[3]=0,C[4]=G*Z*Pt-q*ut,C[5]=Z*Z*Pt+mt,C[6]=q*Z*Pt+G*ut,C[7]=0,C[8]=G*q*Pt+Z*ut,C[9]=Z*q*Pt-G*ut,C[10]=q*q*Pt+mt,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C);}function w(C,L){var F=Math.sin(L),G=Math.cos(L);return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=G,C[6]=F,C[7]=0,C[8]=0,C[9]=-F,C[10]=G,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function B(C,L){var F=Math.sin(L),G=Math.cos(L);return C[0]=G,C[1]=0,C[2]=-F,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=F,C[9]=0,C[10]=G,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function A(C,L){var F=Math.sin(L),G=Math.cos(L);return C[0]=G,C[1]=F,C[2]=0,C[3]=0,C[4]=-F,C[5]=G,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function b(C,L,F){var G=L[0],Z=L[1],q=L[2],it=L[3],ut=G+G,mt=Z+Z,Pt=q+q,Ct=G*ut,yt=G*mt,vt=G*Pt,xt=Z*mt,Et=Z*Pt,At=q*Pt,Ot=it*ut,Nt=it*mt,$t=it*Pt;return C[0]=1-(xt+At),C[1]=yt+$t,C[2]=vt-Nt,C[3]=0,C[4]=yt-$t,C[5]=1-(Ct+At),C[6]=Et+Ot,C[7]=0,C[8]=vt+Nt,C[9]=Et-Ot,C[10]=1-(Ct+xt),C[11]=0,C[12]=F[0],C[13]=F[1],C[14]=F[2],C[15]=1,C;}function W(C,L){var F=new r.ARRAY_TYPE(3),G=-L[0],Z=-L[1],q=-L[2],it=L[3],ut=L[4],mt=L[5],Pt=L[6],Ct=L[7],yt=G*G+Z*Z+q*q+it*it;return yt>0?(F[0]=(ut*it+Ct*G+mt*q-Pt*Z)*2/yt,F[1]=(mt*it+Ct*Z+Pt*G-ut*q)*2/yt,F[2]=(Pt*it+Ct*q+ut*Z-mt*G)*2/yt):(F[0]=(ut*it+Ct*G+mt*q-Pt*Z)*2,F[1]=(mt*it+Ct*Z+Pt*G-ut*q)*2,F[2]=(Pt*it+Ct*q+ut*Z-mt*G)*2),b(C,L,F),C;}function D(C,L){return C[0]=L[12],C[1]=L[13],C[2]=L[14],C;}function R(C,L){var F=L[0],G=L[1],Z=L[2],q=L[4],it=L[5],ut=L[6],mt=L[8],Pt=L[9],Ct=L[10];return C[0]=Math.hypot(F,G,Z),C[1]=Math.hypot(q,it,ut),C[2]=Math.hypot(mt,Pt,Ct),C;}function j(C,L){var F=new r.ARRAY_TYPE(3);R(F,L);var G=1/F[0],Z=1/F[1],q=1/F[2],it=L[0]*G,ut=L[1]*Z,mt=L[2]*q,Pt=L[4]*G,Ct=L[5]*Z,yt=L[6]*q,vt=L[8]*G,xt=L[9]*Z,Et=L[10]*q,At=it+Ct+Et,Ot=0;return At>0?(Ot=Math.sqrt(At+1)*2,C[3]=0.25*Ot,C[0]=(yt-xt)/Ot,C[1]=(vt-mt)/Ot,C[2]=(ut-Pt)/Ot):it>Ct&&it>Et?(Ot=Math.sqrt(1+it-Ct-Et)*2,C[3]=(yt-xt)/Ot,C[0]=0.25*Ot,C[1]=(ut+Pt)/Ot,C[2]=(vt+mt)/Ot):Ct>Et?(Ot=Math.sqrt(1+Ct-it-Et)*2,C[3]=(vt-mt)/Ot,C[0]=(ut+Pt)/Ot,C[1]=0.25*Ot,C[2]=(yt+xt)/Ot):(Ot=Math.sqrt(1+Et-it-Ct)*2,C[3]=(ut-Pt)/Ot,C[0]=(vt+mt)/Ot,C[1]=(yt+xt)/Ot,C[2]=0.25*Ot),C;}function k(C,L,F,G){var Z=L[0],q=L[1],it=L[2],ut=L[3],mt=Z+Z,Pt=q+q,Ct=it+it,yt=Z*mt,vt=Z*Pt,xt=Z*Ct,Et=q*Pt,At=q*Ct,Ot=it*Ct,Nt=ut*mt,$t=ut*Pt,jt=ut*Ct,Ut=G[0],zt=G[1],Xt=G[2];return C[0]=(1-(Et+Ot))*Ut,C[1]=(vt+jt)*Ut,C[2]=(xt-$t)*Ut,C[3]=0,C[4]=(vt-jt)*zt,C[5]=(1-(yt+Ot))*zt,C[6]=(At+Nt)*zt,C[7]=0,C[8]=(xt+$t)*Xt,C[9]=(At-Nt)*Xt,C[10]=(1-(yt+Et))*Xt,C[11]=0,C[12]=F[0],C[13]=F[1],C[14]=F[2],C[15]=1,C;}function J(C,L,F,G,Z){var q=L[0],it=L[1],ut=L[2],mt=L[3],Pt=q+q,Ct=it+it,yt=ut+ut,vt=q*Pt,xt=q*Ct,Et=q*yt,At=it*Ct,Ot=it*yt,Nt=ut*yt,$t=mt*Pt,jt=mt*Ct,Ut=mt*yt,zt=G[0],Xt=G[1],ae=G[2],ie=Z[0],se=Z[1],oe=Z[2],le=(1-(At+Nt))*zt,ce=(xt+Ut)*zt,fe=(Et-jt)*zt,Jt=(xt-Ut)*Xt,ge=(1-(vt+Nt))*Xt,Be=(Ot+$t)*Xt,We=(Et+jt)*ae,dr=(Ot-$t)*ae,pr=(1-(vt+At))*ae;return C[0]=le,C[1]=ce,C[2]=fe,C[3]=0,C[4]=Jt,C[5]=ge,C[6]=Be,C[7]=0,C[8]=We,C[9]=dr,C[10]=pr,C[11]=0,C[12]=F[0]+ie-(le*ie+Jt*se+We*oe),C[13]=F[1]+se-(ce*ie+ge*se+dr*oe),C[14]=F[2]+oe-(fe*ie+Be*se+pr*oe),C[15]=1,C;}function rt(C,L){var F=L[0],G=L[1],Z=L[2],q=L[3],it=F+F,ut=G+G,mt=Z+Z,Pt=F*it,Ct=G*it,yt=G*ut,vt=Z*it,xt=Z*ut,Et=Z*mt,At=q*it,Ot=q*ut,Nt=q*mt;return C[0]=1-yt-Et,C[1]=Ct+Nt,C[2]=vt-Ot,C[3]=0,C[4]=Ct-Nt,C[5]=1-Pt-Et,C[6]=xt+At,C[7]=0,C[8]=vt+Ot,C[9]=xt-At,C[10]=1-Pt-yt,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function st(C,L,F,G,Z,q,it){var ut=1/(F-L),mt=1/(Z-G),Pt=1/(q-it);return C[0]=q*2*ut,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=q*2*mt,C[6]=0,C[7]=0,C[8]=(F+L)*ut,C[9]=(Z+G)*mt,C[10]=(it+q)*Pt,C[11]=-1,C[12]=0,C[13]=0,C[14]=it*q*2*Pt,C[15]=0,C;}function $(C,L,F,G,Z){var q=1/Math.tan(L/2),it;return C[0]=q/F,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=q,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=-1,C[12]=0,C[13]=0,C[15]=0,Z!=null&&Z!==1/0?(it=1/(G-Z),C[10]=(Z+G)*it,C[14]=2*Z*G*it):(C[10]=-1,C[14]=-2*G),C;}function V(C,L,F,G){var Z=Math.tan(L.upDegrees*Math.PI/180),q=Math.tan(L.downDegrees*Math.PI/180),it=Math.tan(L.leftDegrees*Math.PI/180),ut=Math.tan(L.rightDegrees*Math.PI/180),mt=2/(it+ut),Pt=2/(Z+q);return C[0]=mt,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=Pt,C[6]=0,C[7]=0,C[8]=-((it-ut)*mt*0.5),C[9]=(Z-q)*Pt*0.5,C[10]=G/(F-G),C[11]=-1,C[12]=0,C[13]=0,C[14]=G*F/(F-G),C[15]=0,C;}function nt(C,L,F,G,Z,q,it){var ut=1/(L-F),mt=1/(G-Z),Pt=1/(q-it);return C[0]=-2*ut,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*mt,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=2*Pt,C[11]=0,C[12]=(L+F)*ut,C[13]=(Z+G)*mt,C[14]=(it+q)*Pt,C[15]=1,C;}function lt(C,L,F,G){var Z,q,it,ut,mt,Pt,Ct,yt,vt,xt,Et=L[0],At=L[1],Ot=L[2],Nt=G[0],$t=G[1],jt=G[2],Ut=F[0],zt=F[1],Xt=F[2];return Math.abs(Et-Ut)<r.EPSILON&&Math.abs(At-zt)<r.EPSILON&&Math.abs(Ot-Xt)<r.EPSILON?f(C):(Ct=Et-Ut,yt=At-zt,vt=Ot-Xt,xt=1/Math.hypot(Ct,yt,vt),Ct*=xt,yt*=xt,vt*=xt,Z=$t*vt-jt*yt,q=jt*Ct-Nt*vt,it=Nt*yt-$t*Ct,xt=Math.hypot(Z,q,it),xt?(xt=1/xt,Z*=xt,q*=xt,it*=xt):(Z=0,q=0,it=0),ut=yt*it-vt*q,mt=vt*Z-Ct*it,Pt=Ct*q-yt*Z,xt=Math.hypot(ut,mt,Pt),xt?(xt=1/xt,ut*=xt,mt*=xt,Pt*=xt):(ut=0,mt=0,Pt=0),C[0]=Z,C[1]=ut,C[2]=Ct,C[3]=0,C[4]=q,C[5]=mt,C[6]=yt,C[7]=0,C[8]=it,C[9]=Pt,C[10]=vt,C[11]=0,C[12]=-(Z*Et+q*At+it*Ot),C[13]=-(ut*Et+mt*At+Pt*Ot),C[14]=-(Ct*Et+yt*At+vt*Ot),C[15]=1,C);}function ct(C,L,F,G){var Z=L[0],q=L[1],it=L[2],ut=G[0],mt=G[1],Pt=G[2],Ct=Z-F[0],yt=q-F[1],vt=it-F[2],xt=Ct*Ct+yt*yt+vt*vt;xt>0&&(xt=1/Math.sqrt(xt),Ct*=xt,yt*=xt,vt*=xt);var Et=mt*vt-Pt*yt,At=Pt*Ct-ut*vt,Ot=ut*yt-mt*Ct;return xt=Et*Et+At*At+Ot*Ot,xt>0&&(xt=1/Math.sqrt(xt),Et*=xt,At*=xt,Ot*=xt),C[0]=Et,C[1]=At,C[2]=Ot,C[3]=0,C[4]=yt*Ot-vt*At,C[5]=vt*Et-Ct*Ot,C[6]=Ct*At-yt*Et,C[7]=0,C[8]=Ct,C[9]=yt,C[10]=vt,C[11]=0,C[12]=Z,C[13]=q,C[14]=it,C[15]=1,C;}function pt(C){return"mat4("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+", "+C[4]+", "+C[5]+", "+C[6]+", "+C[7]+", "+C[8]+", "+C[9]+", "+C[10]+", "+C[11]+", "+C[12]+", "+C[13]+", "+C[14]+", "+C[15]+")";}function et(C){return Math.hypot(C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],C[8],C[9],C[10],C[11],C[12],C[13],C[14],C[15]);}function gt(C,L,F){return C[0]=L[0]+F[0],C[1]=L[1]+F[1],C[2]=L[2]+F[2],C[3]=L[3]+F[3],C[4]=L[4]+F[4],C[5]=L[5]+F[5],C[6]=L[6]+F[6],C[7]=L[7]+F[7],C[8]=L[8]+F[8],C[9]=L[9]+F[9],C[10]=L[10]+F[10],C[11]=L[11]+F[11],C[12]=L[12]+F[12],C[13]=L[13]+F[13],C[14]=L[14]+F[14],C[15]=L[15]+F[15],C;}function Tt(C,L,F){return C[0]=L[0]-F[0],C[1]=L[1]-F[1],C[2]=L[2]-F[2],C[3]=L[3]-F[3],C[4]=L[4]-F[4],C[5]=L[5]-F[5],C[6]=L[6]-F[6],C[7]=L[7]-F[7],C[8]=L[8]-F[8],C[9]=L[9]-F[9],C[10]=L[10]-F[10],C[11]=L[11]-F[11],C[12]=L[12]-F[12],C[13]=L[13]-F[13],C[14]=L[14]-F[14],C[15]=L[15]-F[15],C;}function X(C,L,F){return C[0]=L[0]*F,C[1]=L[1]*F,C[2]=L[2]*F,C[3]=L[3]*F,C[4]=L[4]*F,C[5]=L[5]*F,C[6]=L[6]*F,C[7]=L[7]*F,C[8]=L[8]*F,C[9]=L[9]*F,C[10]=L[10]*F,C[11]=L[11]*F,C[12]=L[12]*F,C[13]=L[13]*F,C[14]=L[14]*F,C[15]=L[15]*F,C;}function z(C,L,F,G){return C[0]=L[0]+F[0]*G,C[1]=L[1]+F[1]*G,C[2]=L[2]+F[2]*G,C[3]=L[3]+F[3]*G,C[4]=L[4]+F[4]*G,C[5]=L[5]+F[5]*G,C[6]=L[6]+F[6]*G,C[7]=L[7]+F[7]*G,C[8]=L[8]+F[8]*G,C[9]=L[9]+F[9]*G,C[10]=L[10]+F[10]*G,C[11]=L[11]+F[11]*G,C[12]=L[12]+F[12]*G,C[13]=L[13]+F[13]*G,C[14]=L[14]+F[14]*G,C[15]=L[15]+F[15]*G,C;}function Q(C,L){return C[0]===L[0]&&C[1]===L[1]&&C[2]===L[2]&&C[3]===L[3]&&C[4]===L[4]&&C[5]===L[5]&&C[6]===L[6]&&C[7]===L[7]&&C[8]===L[8]&&C[9]===L[9]&&C[10]===L[10]&&C[11]===L[11]&&C[12]===L[12]&&C[13]===L[13]&&C[14]===L[14]&&C[15]===L[15];}function tt(C,L){var F=C[0],G=C[1],Z=C[2],q=C[3],it=C[4],ut=C[5],mt=C[6],Pt=C[7],Ct=C[8],yt=C[9],vt=C[10],xt=C[11],Et=C[12],At=C[13],Ot=C[14],Nt=C[15],$t=L[0],jt=L[1],Ut=L[2],zt=L[3],Xt=L[4],ae=L[5],ie=L[6],se=L[7],oe=L[8],le=L[9],ce=L[10],fe=L[11],Jt=L[12],ge=L[13],Be=L[14],We=L[15];return Math.abs(F-$t)<=r.EPSILON*Math.max(1,Math.abs(F),Math.abs($t))&&Math.abs(G-jt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(jt))&&Math.abs(Z-Ut)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(Ut))&&Math.abs(q-zt)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(zt))&&Math.abs(it-Xt)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(Xt))&&Math.abs(ut-ae)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(ae))&&Math.abs(mt-ie)<=r.EPSILON*Math.max(1,Math.abs(mt),Math.abs(ie))&&Math.abs(Pt-se)<=r.EPSILON*Math.max(1,Math.abs(Pt),Math.abs(se))&&Math.abs(Ct-oe)<=r.EPSILON*Math.max(1,Math.abs(Ct),Math.abs(oe))&&Math.abs(yt-le)<=r.EPSILON*Math.max(1,Math.abs(yt),Math.abs(le))&&Math.abs(vt-ce)<=r.EPSILON*Math.max(1,Math.abs(vt),Math.abs(ce))&&Math.abs(xt-fe)<=r.EPSILON*Math.max(1,Math.abs(xt),Math.abs(fe))&&Math.abs(Et-Jt)<=r.EPSILON*Math.max(1,Math.abs(Et),Math.abs(Jt))&&Math.abs(At-ge)<=r.EPSILON*Math.max(1,Math.abs(At),Math.abs(ge))&&Math.abs(Ot-Be)<=r.EPSILON*Math.max(1,Math.abs(Ot),Math.abs(Be))&&Math.abs(Nt-We)<=r.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(We));}var U=M,H=Tt;},/* 7 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return o;}),t.d(e,"identity",function(){return a;}),t.d(e,"setAxisAngle",function(){return f;}),t.d(e,"getAxisAngle",function(){return g;}),t.d(e,"getAngle",function(){return c;}),t.d(e,"multiply",function(){return m;}),t.d(e,"rotateX",function(){return x;}),t.d(e,"rotateY",function(){return M;}),t.d(e,"rotateZ",function(){return S;}),t.d(e,"calculateW",function(){return P;}),t.d(e,"exp",function(){return T;}),t.d(e,"ln",function(){return h;}),t.d(e,"pow",function(){return p;}),t.d(e,"slerp",function(){return d;}),t.d(e,"random",function(){return y;}),t.d(e,"invert",function(){return O;}),t.d(e,"conjugate",function(){return E;}),t.d(e,"fromMat3",function(){return w;}),t.d(e,"fromEuler",function(){return B;}),t.d(e,"str",function(){return A;}),t.d(e,"clone",function(){return b;}),t.d(e,"fromValues",function(){return W;}),t.d(e,"copy",function(){return D;}),t.d(e,"set",function(){return R;}),t.d(e,"add",function(){return j;}),t.d(e,"mul",function(){return k;}),t.d(e,"scale",function(){return J;}),t.d(e,"dot",function(){return rt;}),t.d(e,"lerp",function(){return st;}),t.d(e,"length",function(){return $;}),t.d(e,"len",function(){return V;}),t.d(e,"squaredLength",function(){return nt;}),t.d(e,"sqrLen",function(){return lt;}),t.d(e,"normalize",function(){return ct;}),t.d(e,"exactEquals",function(){return pt;}),t.d(e,"equals",function(){return et;}),t.d(e,"rotationTo",function(){return gt;}),t.d(e,"sqlerp",function(){return Tt;}),t.d(e,"setAxes",function(){return X;});var r=t(2),n=t(5),i=t(8),l=t(9);function o(){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 a(z){return z[0]=0,z[1]=0,z[2]=0,z[3]=1,z;}function f(z,Q,tt){tt=tt*0.5;var U=Math.sin(tt);return z[0]=U*Q[0],z[1]=U*Q[1],z[2]=U*Q[2],z[3]=Math.cos(tt),z;}function g(z,Q){var tt=Math.acos(Q[3])*2,U=Math.sin(tt/2);return U>r.EPSILON?(z[0]=Q[0]/U,z[1]=Q[1]/U,z[2]=Q[2]/U):(z[0]=1,z[1]=0,z[2]=0),tt;}function c(z,Q){var tt=rt(z,Q);return Math.acos(2*tt*tt-1);}function m(z,Q,tt){var U=Q[0],H=Q[1],C=Q[2],L=Q[3],F=tt[0],G=tt[1],Z=tt[2],q=tt[3];return z[0]=U*q+L*F+H*Z-C*G,z[1]=H*q+L*G+C*F-U*Z,z[2]=C*q+L*Z+U*G-H*F,z[3]=L*q-U*F-H*G-C*Z,z;}function x(z,Q,tt){tt*=0.5;var U=Q[0],H=Q[1],C=Q[2],L=Q[3],F=Math.sin(tt),G=Math.cos(tt);return z[0]=U*G+L*F,z[1]=H*G+C*F,z[2]=C*G-H*F,z[3]=L*G-U*F,z;}function M(z,Q,tt){tt*=0.5;var U=Q[0],H=Q[1],C=Q[2],L=Q[3],F=Math.sin(tt),G=Math.cos(tt);return z[0]=U*G-C*F,z[1]=H*G+L*F,z[2]=C*G+U*F,z[3]=L*G-H*F,z;}function S(z,Q,tt){tt*=0.5;var U=Q[0],H=Q[1],C=Q[2],L=Q[3],F=Math.sin(tt),G=Math.cos(tt);return z[0]=U*G+H*F,z[1]=H*G-U*F,z[2]=C*G+L*F,z[3]=L*G-C*F,z;}function P(z,Q){var tt=Q[0],U=Q[1],H=Q[2];return z[0]=tt,z[1]=U,z[2]=H,z[3]=Math.sqrt(Math.abs(1-tt*tt-U*U-H*H)),z;}function T(z,Q){var tt=Q[0],U=Q[1],H=Q[2],C=Q[3],L=Math.sqrt(tt*tt+U*U+H*H),F=Math.exp(C),G=L>0?F*Math.sin(L)/L:0;return z[0]=tt*G,z[1]=U*G,z[2]=H*G,z[3]=F*Math.cos(L),z;}function h(z,Q){var tt=Q[0],U=Q[1],H=Q[2],C=Q[3],L=Math.sqrt(tt*tt+U*U+H*H),F=L>0?Math.atan2(L,C)/L:0;return z[0]=tt*F,z[1]=U*F,z[2]=H*F,z[3]=0.5*Math.log(tt*tt+U*U+H*H+C*C),z;}function p(z,Q,tt){return h(z,Q),J(z,z,tt),T(z,z),z;}function d(z,Q,tt,U){var H=Q[0],C=Q[1],L=Q[2],F=Q[3],G=tt[0],Z=tt[1],q=tt[2],it=tt[3],ut,mt,Pt,Ct,yt;return mt=H*G+C*Z+L*q+F*it,mt<0&&(mt=-mt,G=-G,Z=-Z,q=-q,it=-it),1-mt>r.EPSILON?(ut=Math.acos(mt),Pt=Math.sin(ut),Ct=Math.sin((1-U)*ut)/Pt,yt=Math.sin(U*ut)/Pt):(Ct=1-U,yt=U),z[0]=Ct*H+yt*G,z[1]=Ct*C+yt*Z,z[2]=Ct*L+yt*q,z[3]=Ct*F+yt*it,z;}function y(z){var Q=r.RANDOM(),tt=r.RANDOM(),U=r.RANDOM(),H=Math.sqrt(1-Q),C=Math.sqrt(Q);return z[0]=H*Math.sin(2*Math.PI*tt),z[1]=H*Math.cos(2*Math.PI*tt),z[2]=C*Math.sin(2*Math.PI*U),z[3]=C*Math.cos(2*Math.PI*U),z;}function O(z,Q){var tt=Q[0],U=Q[1],H=Q[2],C=Q[3],L=tt*tt+U*U+H*H+C*C,F=L?1/L:0;return z[0]=-tt*F,z[1]=-U*F,z[2]=-H*F,z[3]=C*F,z;}function E(z,Q){return z[0]=-Q[0],z[1]=-Q[1],z[2]=-Q[2],z[3]=Q[3],z;}function w(z,Q){var tt=Q[0]+Q[4]+Q[8],U;if(tt>0)U=Math.sqrt(tt+1),z[3]=0.5*U,U=0.5/U,z[0]=(Q[5]-Q[7])*U,z[1]=(Q[6]-Q[2])*U,z[2]=(Q[1]-Q[3])*U;else{var H=0;Q[4]>Q[0]&&(H=1),Q[8]>Q[H*3+H]&&(H=2);var C=(H+1)%3,L=(H+2)%3;U=Math.sqrt(Q[H*3+H]-Q[C*3+C]-Q[L*3+L]+1),z[H]=0.5*U,U=0.5/U,z[3]=(Q[C*3+L]-Q[L*3+C])*U,z[C]=(Q[C*3+H]+Q[H*3+C])*U,z[L]=(Q[L*3+H]+Q[H*3+L])*U;}return z;}function B(z,Q,tt,U){var H=0.5*Math.PI/180;Q*=H,tt*=H,U*=H;var C=Math.sin(Q),L=Math.cos(Q),F=Math.sin(tt),G=Math.cos(tt),Z=Math.sin(U),q=Math.cos(U);return z[0]=C*G*q-L*F*Z,z[1]=L*F*q+C*G*Z,z[2]=L*G*Z-C*F*q,z[3]=L*G*q+C*F*Z,z;}function A(z){return"quat("+z[0]+", "+z[1]+", "+z[2]+", "+z[3]+")";}var b=l.clone,W=l.fromValues,D=l.copy,R=l.set,j=l.add,k=m,J=l.scale,rt=l.dot,st=l.lerp,$=l.length,V=$,nt=l.squaredLength,lt=nt,ct=l.normalize,pt=l.exactEquals,et=l.equals,gt=function(){var z=i.create(),Q=i.fromValues(1,0,0),tt=i.fromValues(0,1,0);return function(U,H,C){var L=i.dot(H,C);return L<-0.999999?(i.cross(z,Q,H),i.len(z)<1e-6&&i.cross(z,tt,H),i.normalize(z,z),f(U,z,Math.PI),U):L>0.999999?(U[0]=0,U[1]=0,U[2]=0,U[3]=1,U):(i.cross(z,H,C),U[0]=z[0],U[1]=z[1],U[2]=z[2],U[3]=1+L,ct(U,U));};}(),Tt=function(){var z=o(),Q=o();return function(tt,U,H,C,L,F){return d(z,U,L,F),d(Q,H,C,F),d(tt,z,Q,2*F*(1-F)),tt;};}(),X=function(){var z=n.create();return function(Q,tt,U,H){return z[0]=U[0],z[3]=U[1],z[6]=U[2],z[1]=H[0],z[4]=H[1],z[7]=H[2],z[2]=-tt[0],z[5]=-tt[1],z[8]=-tt[2],ct(Q,w(Q,z));};}();},/* 8 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"length",function(){return l;}),t.d(e,"fromValues",function(){return o;}),t.d(e,"copy",function(){return a;}),t.d(e,"set",function(){return f;}),t.d(e,"add",function(){return g;}),t.d(e,"subtract",function(){return c;}),t.d(e,"multiply",function(){return m;}),t.d(e,"divide",function(){return x;}),t.d(e,"ceil",function(){return M;}),t.d(e,"floor",function(){return S;}),t.d(e,"min",function(){return P;}),t.d(e,"max",function(){return T;}),t.d(e,"round",function(){return h;}),t.d(e,"scale",function(){return p;}),t.d(e,"scaleAndAdd",function(){return d;}),t.d(e,"distance",function(){return y;}),t.d(e,"squaredDistance",function(){return O;}),t.d(e,"squaredLength",function(){return E;}),t.d(e,"negate",function(){return w;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return A;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"hermite",function(){return R;}),t.d(e,"bezier",function(){return j;}),t.d(e,"random",function(){return k;}),t.d(e,"transformMat4",function(){return J;}),t.d(e,"transformMat3",function(){return rt;}),t.d(e,"transformQuat",function(){return st;}),t.d(e,"rotateX",function(){return $;}),t.d(e,"rotateY",function(){return V;}),t.d(e,"rotateZ",function(){return nt;}),t.d(e,"angle",function(){return lt;}),t.d(e,"zero",function(){return ct;}),t.d(e,"str",function(){return pt;}),t.d(e,"exactEquals",function(){return et;}),t.d(e,"equals",function(){return gt;}),t.d(e,"sub",function(){return Tt;}),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 tt;}),t.d(e,"len",function(){return U;}),t.d(e,"sqrLen",function(){return H;}),t.d(e,"forEach",function(){return C;});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 i(L){var F=new r.ARRAY_TYPE(3);return F[0]=L[0],F[1]=L[1],F[2]=L[2],F;}function l(L){var F=L[0],G=L[1],Z=L[2];return Math.hypot(F,G,Z);}function o(L,F,G){var Z=new r.ARRAY_TYPE(3);return Z[0]=L,Z[1]=F,Z[2]=G,Z;}function a(L,F){return L[0]=F[0],L[1]=F[1],L[2]=F[2],L;}function f(L,F,G,Z){return L[0]=F,L[1]=G,L[2]=Z,L;}function g(L,F,G){return L[0]=F[0]+G[0],L[1]=F[1]+G[1],L[2]=F[2]+G[2],L;}function c(L,F,G){return L[0]=F[0]-G[0],L[1]=F[1]-G[1],L[2]=F[2]-G[2],L;}function m(L,F,G){return L[0]=F[0]*G[0],L[1]=F[1]*G[1],L[2]=F[2]*G[2],L;}function x(L,F,G){return L[0]=F[0]/G[0],L[1]=F[1]/G[1],L[2]=F[2]/G[2],L;}function M(L,F){return L[0]=Math.ceil(F[0]),L[1]=Math.ceil(F[1]),L[2]=Math.ceil(F[2]),L;}function S(L,F){return L[0]=Math.floor(F[0]),L[1]=Math.floor(F[1]),L[2]=Math.floor(F[2]),L;}function P(L,F,G){return L[0]=Math.min(F[0],G[0]),L[1]=Math.min(F[1],G[1]),L[2]=Math.min(F[2],G[2]),L;}function T(L,F,G){return L[0]=Math.max(F[0],G[0]),L[1]=Math.max(F[1],G[1]),L[2]=Math.max(F[2],G[2]),L;}function h(L,F){return L[0]=Math.round(F[0]),L[1]=Math.round(F[1]),L[2]=Math.round(F[2]),L;}function p(L,F,G){return L[0]=F[0]*G,L[1]=F[1]*G,L[2]=F[2]*G,L;}function d(L,F,G,Z){return L[0]=F[0]+G[0]*Z,L[1]=F[1]+G[1]*Z,L[2]=F[2]+G[2]*Z,L;}function y(L,F){var G=F[0]-L[0],Z=F[1]-L[1],q=F[2]-L[2];return Math.hypot(G,Z,q);}function O(L,F){var G=F[0]-L[0],Z=F[1]-L[1],q=F[2]-L[2];return G*G+Z*Z+q*q;}function E(L){var F=L[0],G=L[1],Z=L[2];return F*F+G*G+Z*Z;}function w(L,F){return L[0]=-F[0],L[1]=-F[1],L[2]=-F[2],L;}function B(L,F){return L[0]=1/F[0],L[1]=1/F[1],L[2]=1/F[2],L;}function A(L,F){var G=F[0],Z=F[1],q=F[2],it=G*G+Z*Z+q*q;return it>0&&(it=1/Math.sqrt(it)),L[0]=F[0]*it,L[1]=F[1]*it,L[2]=F[2]*it,L;}function b(L,F){return L[0]*F[0]+L[1]*F[1]+L[2]*F[2];}function W(L,F,G){var Z=F[0],q=F[1],it=F[2],ut=G[0],mt=G[1],Pt=G[2];return L[0]=q*Pt-it*mt,L[1]=it*ut-Z*Pt,L[2]=Z*mt-q*ut,L;}function D(L,F,G,Z){var q=F[0],it=F[1],ut=F[2];return L[0]=q+Z*(G[0]-q),L[1]=it+Z*(G[1]-it),L[2]=ut+Z*(G[2]-ut),L;}function R(L,F,G,Z,q,it){var ut=it*it,mt=ut*(2*it-3)+1,Pt=ut*(it-2)+it,Ct=ut*(it-1),yt=ut*(3-2*it);return L[0]=F[0]*mt+G[0]*Pt+Z[0]*Ct+q[0]*yt,L[1]=F[1]*mt+G[1]*Pt+Z[1]*Ct+q[1]*yt,L[2]=F[2]*mt+G[2]*Pt+Z[2]*Ct+q[2]*yt,L;}function j(L,F,G,Z,q,it){var ut=1-it,mt=ut*ut,Pt=it*it,Ct=mt*ut,yt=3*it*mt,vt=3*Pt*ut,xt=Pt*it;return L[0]=F[0]*Ct+G[0]*yt+Z[0]*vt+q[0]*xt,L[1]=F[1]*Ct+G[1]*yt+Z[1]*vt+q[1]*xt,L[2]=F[2]*Ct+G[2]*yt+Z[2]*vt+q[2]*xt,L;}function k(L,F){F=F||1;var G=r.RANDOM()*2*Math.PI,Z=r.RANDOM()*2-1,q=Math.sqrt(1-Z*Z)*F;return L[0]=Math.cos(G)*q,L[1]=Math.sin(G)*q,L[2]=Z*F,L;}function J(L,F,G){var Z=F[0],q=F[1],it=F[2],ut=G[3]*Z+G[7]*q+G[11]*it+G[15];return ut=ut||1,L[0]=(G[0]*Z+G[4]*q+G[8]*it+G[12])/ut,L[1]=(G[1]*Z+G[5]*q+G[9]*it+G[13])/ut,L[2]=(G[2]*Z+G[6]*q+G[10]*it+G[14])/ut,L;}function rt(L,F,G){var Z=F[0],q=F[1],it=F[2];return L[0]=Z*G[0]+q*G[3]+it*G[6],L[1]=Z*G[1]+q*G[4]+it*G[7],L[2]=Z*G[2]+q*G[5]+it*G[8],L;}function st(L,F,G){var Z=G[0],q=G[1],it=G[2],ut=G[3],mt=F[0],Pt=F[1],Ct=F[2],yt=q*Ct-it*Pt,vt=it*mt-Z*Ct,xt=Z*Pt-q*mt,Et=q*xt-it*vt,At=it*yt-Z*xt,Ot=Z*vt-q*yt,Nt=ut*2;return yt*=Nt,vt*=Nt,xt*=Nt,Et*=2,At*=2,Ot*=2,L[0]=mt+yt+Et,L[1]=Pt+vt+At,L[2]=Ct+xt+Ot,L;}function $(L,F,G,Z){var q=[],it=[];return q[0]=F[0]-G[0],q[1]=F[1]-G[1],q[2]=F[2]-G[2],it[0]=q[0],it[1]=q[1]*Math.cos(Z)-q[2]*Math.sin(Z),it[2]=q[1]*Math.sin(Z)+q[2]*Math.cos(Z),L[0]=it[0]+G[0],L[1]=it[1]+G[1],L[2]=it[2]+G[2],L;}function V(L,F,G,Z){var q=[],it=[];return q[0]=F[0]-G[0],q[1]=F[1]-G[1],q[2]=F[2]-G[2],it[0]=q[2]*Math.sin(Z)+q[0]*Math.cos(Z),it[1]=q[1],it[2]=q[2]*Math.cos(Z)-q[0]*Math.sin(Z),L[0]=it[0]+G[0],L[1]=it[1]+G[1],L[2]=it[2]+G[2],L;}function nt(L,F,G,Z){var q=[],it=[];return q[0]=F[0]-G[0],q[1]=F[1]-G[1],q[2]=F[2]-G[2],it[0]=q[0]*Math.cos(Z)-q[1]*Math.sin(Z),it[1]=q[0]*Math.sin(Z)+q[1]*Math.cos(Z),it[2]=q[2],L[0]=it[0]+G[0],L[1]=it[1]+G[1],L[2]=it[2]+G[2],L;}function lt(L,F){var G=L[0],Z=L[1],q=L[2],it=F[0],ut=F[1],mt=F[2],Pt=Math.sqrt(G*G+Z*Z+q*q),Ct=Math.sqrt(it*it+ut*ut+mt*mt),yt=Pt*Ct,vt=yt&&b(L,F)/yt;return Math.acos(Math.min(Math.max(vt,-1),1));}function ct(L){return L[0]=0,L[1]=0,L[2]=0,L;}function pt(L){return"vec3("+L[0]+", "+L[1]+", "+L[2]+")";}function et(L,F){return L[0]===F[0]&&L[1]===F[1]&&L[2]===F[2];}function gt(L,F){var G=L[0],Z=L[1],q=L[2],it=F[0],ut=F[1],mt=F[2];return Math.abs(G-it)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(it))&&Math.abs(Z-ut)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(ut))&&Math.abs(q-mt)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(mt));}var Tt=c,X=m,z=x,Q=y,tt=O,U=l,H=E,C=function(){var L=n();return function(F,G,Z,q,it,ut){var mt,Pt;for(G||(G=3),Z||(Z=0),q?Pt=Math.min(q*G+Z,F.length):Pt=F.length,mt=Z;mt<Pt;mt+=G)L[0]=F[mt],L[1]=F[mt+1],L[2]=F[mt+2],it(L,L,ut),F[mt]=L[0],F[mt+1]=L[1],F[mt+2]=L[2];return F;};}();},/* 9 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"copy",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"add",function(){return f;}),t.d(e,"subtract",function(){return g;}),t.d(e,"multiply",function(){return c;}),t.d(e,"divide",function(){return m;}),t.d(e,"ceil",function(){return x;}),t.d(e,"floor",function(){return M;}),t.d(e,"min",function(){return S;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return T;}),t.d(e,"scale",function(){return h;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return d;}),t.d(e,"squaredDistance",function(){return y;}),t.d(e,"length",function(){return O;}),t.d(e,"squaredLength",function(){return E;}),t.d(e,"negate",function(){return w;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return A;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"random",function(){return R;}),t.d(e,"transformMat4",function(){return j;}),t.d(e,"transformQuat",function(){return k;}),t.d(e,"zero",function(){return J;}),t.d(e,"str",function(){return rt;}),t.d(e,"exactEquals",function(){return st;}),t.d(e,"equals",function(){return $;}),t.d(e,"sub",function(){return V;}),t.d(e,"mul",function(){return nt;}),t.d(e,"div",function(){return lt;}),t.d(e,"dist",function(){return ct;}),t.d(e,"sqrDist",function(){return pt;}),t.d(e,"len",function(){return et;}),t.d(e,"sqrLen",function(){return gt;}),t.d(e,"forEach",function(){return Tt;});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 i(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 l(X,z,Q,tt){var U=new r.ARRAY_TYPE(4);return U[0]=X,U[1]=z,U[2]=Q,U[3]=tt,U;}function o(X,z){return X[0]=z[0],X[1]=z[1],X[2]=z[2],X[3]=z[3],X;}function a(X,z,Q,tt,U){return X[0]=z,X[1]=Q,X[2]=tt,X[3]=U,X;}function f(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 g(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 c(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 x(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 M(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 S(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 P(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 T(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 h(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 p(X,z,Q,tt){return X[0]=z[0]+Q[0]*tt,X[1]=z[1]+Q[1]*tt,X[2]=z[2]+Q[2]*tt,X[3]=z[3]+Q[3]*tt,X;}function d(X,z){var Q=z[0]-X[0],tt=z[1]-X[1],U=z[2]-X[2],H=z[3]-X[3];return Math.hypot(Q,tt,U,H);}function y(X,z){var Q=z[0]-X[0],tt=z[1]-X[1],U=z[2]-X[2],H=z[3]-X[3];return Q*Q+tt*tt+U*U+H*H;}function O(X){var z=X[0],Q=X[1],tt=X[2],U=X[3];return Math.hypot(z,Q,tt,U);}function E(X){var z=X[0],Q=X[1],tt=X[2],U=X[3];return z*z+Q*Q+tt*tt+U*U;}function w(X,z){return X[0]=-z[0],X[1]=-z[1],X[2]=-z[2],X[3]=-z[3],X;}function B(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 A(X,z){var Q=z[0],tt=z[1],U=z[2],H=z[3],C=Q*Q+tt*tt+U*U+H*H;return C>0&&(C=1/Math.sqrt(C)),X[0]=Q*C,X[1]=tt*C,X[2]=U*C,X[3]=H*C,X;}function b(X,z){return X[0]*z[0]+X[1]*z[1]+X[2]*z[2]+X[3]*z[3];}function W(X,z,Q,tt){var U=Q[0]*tt[1]-Q[1]*tt[0],H=Q[0]*tt[2]-Q[2]*tt[0],C=Q[0]*tt[3]-Q[3]*tt[0],L=Q[1]*tt[2]-Q[2]*tt[1],F=Q[1]*tt[3]-Q[3]*tt[1],G=Q[2]*tt[3]-Q[3]*tt[2],Z=z[0],q=z[1],it=z[2],ut=z[3];return X[0]=q*G-it*F+ut*L,X[1]=-(Z*G)+it*C-ut*H,X[2]=Z*F-q*C+ut*U,X[3]=-(Z*L)+q*H-it*U,X;}function D(X,z,Q,tt){var U=z[0],H=z[1],C=z[2],L=z[3];return X[0]=U+tt*(Q[0]-U),X[1]=H+tt*(Q[1]-H),X[2]=C+tt*(Q[2]-C),X[3]=L+tt*(Q[3]-L),X;}function R(X,z){z=z||1;var Q,tt,U,H,C,L;do Q=r.RANDOM()*2-1,tt=r.RANDOM()*2-1,C=Q*Q+tt*tt;while(C>=1);do U=r.RANDOM()*2-1,H=r.RANDOM()*2-1,L=U*U+H*H;while(L>=1);var F=Math.sqrt((1-C)/L);return X[0]=z*Q,X[1]=z*tt,X[2]=z*U*F,X[3]=z*H*F,X;}function j(X,z,Q){var tt=z[0],U=z[1],H=z[2],C=z[3];return X[0]=Q[0]*tt+Q[4]*U+Q[8]*H+Q[12]*C,X[1]=Q[1]*tt+Q[5]*U+Q[9]*H+Q[13]*C,X[2]=Q[2]*tt+Q[6]*U+Q[10]*H+Q[14]*C,X[3]=Q[3]*tt+Q[7]*U+Q[11]*H+Q[15]*C,X;}function k(X,z,Q){var tt=z[0],U=z[1],H=z[2],C=Q[0],L=Q[1],F=Q[2],G=Q[3],Z=G*tt+L*H-F*U,q=G*U+F*tt-C*H,it=G*H+C*U-L*tt,ut=-C*tt-L*U-F*H;return X[0]=Z*G+ut*-C+q*-F-it*-L,X[1]=q*G+ut*-L+it*-C-Z*-F,X[2]=it*G+ut*-F+Z*-L-q*-C,X[3]=z[3],X;}function J(X){return X[0]=0,X[1]=0,X[2]=0,X[3]=0,X;}function rt(X){return"vec4("+X[0]+", "+X[1]+", "+X[2]+", "+X[3]+")";}function st(X,z){return X[0]===z[0]&&X[1]===z[1]&&X[2]===z[2]&&X[3]===z[3];}function $(X,z){var Q=X[0],tt=X[1],U=X[2],H=X[3],C=z[0],L=z[1],F=z[2],G=z[3];return Math.abs(Q-C)<=r.EPSILON*Math.max(1,Math.abs(Q),Math.abs(C))&&Math.abs(tt-L)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(L))&&Math.abs(U-F)<=r.EPSILON*Math.max(1,Math.abs(U),Math.abs(F))&&Math.abs(H-G)<=r.EPSILON*Math.max(1,Math.abs(H),Math.abs(G));}var V=g,nt=c,lt=m,ct=d,pt=y,et=O,gt=E,Tt=function(){var X=n();return function(z,Q,tt,U,H,C){var L,F;for(Q||(Q=4),tt||(tt=0),U?F=Math.min(U*Q+tt,z.length):F=z.length,L=tt;L<F;L+=Q)X[0]=z[L],X[1]=z[L+1],X[2]=z[L+2],X[3]=z[L+3],H(X,X,C),z[L]=X[0],z[L+1]=X[1],z[L+2]=X[2],z[L+3]=X[3];return z;};}();},/* 10 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return l;}),t.d(e,"clone",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"fromRotationTranslationValues",function(){return f;}),t.d(e,"fromRotationTranslation",function(){return g;}),t.d(e,"fromTranslation",function(){return c;}),t.d(e,"fromRotation",function(){return m;}),t.d(e,"fromMat4",function(){return x;}),t.d(e,"copy",function(){return M;}),t.d(e,"identity",function(){return S;}),t.d(e,"set",function(){return P;}),t.d(e,"getReal",function(){return T;}),t.d(e,"getDual",function(){return h;}),t.d(e,"setReal",function(){return p;}),t.d(e,"setDual",function(){return d;}),t.d(e,"getTranslation",function(){return y;}),t.d(e,"translate",function(){return O;}),t.d(e,"rotateX",function(){return E;}),t.d(e,"rotateY",function(){return w;}),t.d(e,"rotateZ",function(){return B;}),t.d(e,"rotateByQuatAppend",function(){return A;}),t.d(e,"rotateByQuatPrepend",function(){return b;}),t.d(e,"rotateAroundAxis",function(){return W;}),t.d(e,"add",function(){return D;}),t.d(e,"multiply",function(){return R;}),t.d(e,"mul",function(){return j;}),t.d(e,"scale",function(){return k;}),t.d(e,"dot",function(){return J;}),t.d(e,"lerp",function(){return rt;}),t.d(e,"invert",function(){return st;}),t.d(e,"conjugate",function(){return $;}),t.d(e,"length",function(){return V;}),t.d(e,"len",function(){return nt;}),t.d(e,"squaredLength",function(){return lt;}),t.d(e,"sqrLen",function(){return ct;}),t.d(e,"normalize",function(){return pt;}),t.d(e,"str",function(){return et;}),t.d(e,"exactEquals",function(){return gt;}),t.d(e,"equals",function(){return Tt;});var r=t(2),n=t(7),i=t(6);function l(){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 o(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 a(X,z,Q,tt,U,H,C,L){var F=new r.ARRAY_TYPE(8);return F[0]=X,F[1]=z,F[2]=Q,F[3]=tt,F[4]=U,F[5]=H,F[6]=C,F[7]=L,F;}function f(X,z,Q,tt,U,H,C){var L=new r.ARRAY_TYPE(8);L[0]=X,L[1]=z,L[2]=Q,L[3]=tt;var F=U*0.5,G=H*0.5,Z=C*0.5;return L[4]=F*tt+G*Q-Z*z,L[5]=G*tt+Z*X-F*Q,L[6]=Z*tt+F*z-G*X,L[7]=-F*X-G*z-Z*Q,L;}function g(X,z,Q){var tt=Q[0]*0.5,U=Q[1]*0.5,H=Q[2]*0.5,C=z[0],L=z[1],F=z[2],G=z[3];return X[0]=C,X[1]=L,X[2]=F,X[3]=G,X[4]=tt*G+U*F-H*L,X[5]=U*G+H*C-tt*F,X[6]=H*G+tt*L-U*C,X[7]=-tt*C-U*L-H*F,X;}function c(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 m(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 x(X,z){var Q=n.create();i.getRotation(Q,z);var tt=new r.ARRAY_TYPE(3);return i.getTranslation(tt,z),g(X,Q,tt),X;}function M(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 S(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 P(X,z,Q,tt,U,H,C,L,F){return X[0]=z,X[1]=Q,X[2]=tt,X[3]=U,X[4]=H,X[5]=C,X[6]=L,X[7]=F,X;}var T=n.copy;function h(X,z){return X[0]=z[4],X[1]=z[5],X[2]=z[6],X[3]=z[7],X;}var p=n.copy;function d(X,z){return X[4]=z[0],X[5]=z[1],X[6]=z[2],X[7]=z[3],X;}function y(X,z){var Q=z[4],tt=z[5],U=z[6],H=z[7],C=-z[0],L=-z[1],F=-z[2],G=z[3];return X[0]=(Q*G+H*C+tt*F-U*L)*2,X[1]=(tt*G+H*L+U*C-Q*F)*2,X[2]=(U*G+H*F+Q*L-tt*C)*2,X;}function O(X,z,Q){var tt=z[0],U=z[1],H=z[2],C=z[3],L=Q[0]*0.5,F=Q[1]*0.5,G=Q[2]*0.5,Z=z[4],q=z[5],it=z[6],ut=z[7];return X[0]=tt,X[1]=U,X[2]=H,X[3]=C,X[4]=C*L+U*G-H*F+Z,X[5]=C*F+H*L-tt*G+q,X[6]=C*G+tt*F-U*L+it,X[7]=-tt*L-U*F-H*G+ut,X;}function E(X,z,Q){var tt=-z[0],U=-z[1],H=-z[2],C=z[3],L=z[4],F=z[5],G=z[6],Z=z[7],q=L*C+Z*tt+F*H-G*U,it=F*C+Z*U+G*tt-L*H,ut=G*C+Z*H+L*U-F*tt,mt=Z*C-L*tt-F*U-G*H;return n.rotateX(X,z,Q),tt=X[0],U=X[1],H=X[2],C=X[3],X[4]=q*C+mt*tt+it*H-ut*U,X[5]=it*C+mt*U+ut*tt-q*H,X[6]=ut*C+mt*H+q*U-it*tt,X[7]=mt*C-q*tt-it*U-ut*H,X;}function w(X,z,Q){var tt=-z[0],U=-z[1],H=-z[2],C=z[3],L=z[4],F=z[5],G=z[6],Z=z[7],q=L*C+Z*tt+F*H-G*U,it=F*C+Z*U+G*tt-L*H,ut=G*C+Z*H+L*U-F*tt,mt=Z*C-L*tt-F*U-G*H;return n.rotateY(X,z,Q),tt=X[0],U=X[1],H=X[2],C=X[3],X[4]=q*C+mt*tt+it*H-ut*U,X[5]=it*C+mt*U+ut*tt-q*H,X[6]=ut*C+mt*H+q*U-it*tt,X[7]=mt*C-q*tt-it*U-ut*H,X;}function B(X,z,Q){var tt=-z[0],U=-z[1],H=-z[2],C=z[3],L=z[4],F=z[5],G=z[6],Z=z[7],q=L*C+Z*tt+F*H-G*U,it=F*C+Z*U+G*tt-L*H,ut=G*C+Z*H+L*U-F*tt,mt=Z*C-L*tt-F*U-G*H;return n.rotateZ(X,z,Q),tt=X[0],U=X[1],H=X[2],C=X[3],X[4]=q*C+mt*tt+it*H-ut*U,X[5]=it*C+mt*U+ut*tt-q*H,X[6]=ut*C+mt*H+q*U-it*tt,X[7]=mt*C-q*tt-it*U-ut*H,X;}function A(X,z,Q){var tt=Q[0],U=Q[1],H=Q[2],C=Q[3],L=z[0],F=z[1],G=z[2],Z=z[3];return X[0]=L*C+Z*tt+F*H-G*U,X[1]=F*C+Z*U+G*tt-L*H,X[2]=G*C+Z*H+L*U-F*tt,X[3]=Z*C-L*tt-F*U-G*H,L=z[4],F=z[5],G=z[6],Z=z[7],X[4]=L*C+Z*tt+F*H-G*U,X[5]=F*C+Z*U+G*tt-L*H,X[6]=G*C+Z*H+L*U-F*tt,X[7]=Z*C-L*tt-F*U-G*H,X;}function b(X,z,Q){var tt=z[0],U=z[1],H=z[2],C=z[3],L=Q[0],F=Q[1],G=Q[2],Z=Q[3];return X[0]=tt*Z+C*L+U*G-H*F,X[1]=U*Z+C*F+H*L-tt*G,X[2]=H*Z+C*G+tt*F-U*L,X[3]=C*Z-tt*L-U*F-H*G,L=Q[4],F=Q[5],G=Q[6],Z=Q[7],X[4]=tt*Z+C*L+U*G-H*F,X[5]=U*Z+C*F+H*L-tt*G,X[6]=H*Z+C*G+tt*F-U*L,X[7]=C*Z-tt*L-U*F-H*G,X;}function W(X,z,Q,tt){if(Math.abs(tt)<r.EPSILON)return M(X,z);var U=Math.hypot(Q[0],Q[1],Q[2]);tt=tt*0.5;var H=Math.sin(tt),C=H*Q[0]/U,L=H*Q[1]/U,F=H*Q[2]/U,G=Math.cos(tt),Z=z[0],q=z[1],it=z[2],ut=z[3];X[0]=Z*G+ut*C+q*F-it*L,X[1]=q*G+ut*L+it*C-Z*F,X[2]=it*G+ut*F+Z*L-q*C,X[3]=ut*G-Z*C-q*L-it*F;var mt=z[4],Pt=z[5],Ct=z[6],yt=z[7];return X[4]=mt*G+yt*C+Pt*F-Ct*L,X[5]=Pt*G+yt*L+Ct*C-mt*F,X[6]=Ct*G+yt*F+mt*L-Pt*C,X[7]=yt*G-mt*C-Pt*L-Ct*F,X;}function D(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 R(X,z,Q){var tt=z[0],U=z[1],H=z[2],C=z[3],L=Q[4],F=Q[5],G=Q[6],Z=Q[7],q=z[4],it=z[5],ut=z[6],mt=z[7],Pt=Q[0],Ct=Q[1],yt=Q[2],vt=Q[3];return X[0]=tt*vt+C*Pt+U*yt-H*Ct,X[1]=U*vt+C*Ct+H*Pt-tt*yt,X[2]=H*vt+C*yt+tt*Ct-U*Pt,X[3]=C*vt-tt*Pt-U*Ct-H*yt,X[4]=tt*Z+C*L+U*G-H*F+q*vt+mt*Pt+it*yt-ut*Ct,X[5]=U*Z+C*F+H*L-tt*G+it*vt+mt*Ct+ut*Pt-q*yt,X[6]=H*Z+C*G+tt*F-U*L+ut*vt+mt*yt+q*Ct-it*Pt,X[7]=C*Z-tt*L-U*F-H*G+mt*vt-q*Pt-it*Ct-ut*yt,X;}var j=R;function k(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 J=n.dot;function rt(X,z,Q,tt){var U=1-tt;return J(z,Q)<0&&(tt=-tt),X[0]=z[0]*U+Q[0]*tt,X[1]=z[1]*U+Q[1]*tt,X[2]=z[2]*U+Q[2]*tt,X[3]=z[3]*U+Q[3]*tt,X[4]=z[4]*U+Q[4]*tt,X[5]=z[5]*U+Q[5]*tt,X[6]=z[6]*U+Q[6]*tt,X[7]=z[7]*U+Q[7]*tt,X;}function st(X,z){var Q=lt(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 $(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 V=n.length,nt=V,lt=n.squaredLength,ct=lt;function pt(X,z){var Q=lt(z);if(Q>0){Q=Math.sqrt(Q);var tt=z[0]/Q,U=z[1]/Q,H=z[2]/Q,C=z[3]/Q,L=z[4],F=z[5],G=z[6],Z=z[7],q=tt*L+U*F+H*G+C*Z;X[0]=tt,X[1]=U,X[2]=H,X[3]=C,X[4]=(L-tt*q)/Q,X[5]=(F-U*q)/Q,X[6]=(G-H*q)/Q,X[7]=(Z-C*q)/Q;}return X;}function et(X){return"quat2("+X[0]+", "+X[1]+", "+X[2]+", "+X[3]+", "+X[4]+", "+X[5]+", "+X[6]+", "+X[7]+")";}function gt(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 Tt(X,z){var Q=X[0],tt=X[1],U=X[2],H=X[3],C=X[4],L=X[5],F=X[6],G=X[7],Z=z[0],q=z[1],it=z[2],ut=z[3],mt=z[4],Pt=z[5],Ct=z[6],yt=z[7];return Math.abs(Q-Z)<=r.EPSILON*Math.max(1,Math.abs(Q),Math.abs(Z))&&Math.abs(tt-q)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(q))&&Math.abs(U-it)<=r.EPSILON*Math.max(1,Math.abs(U),Math.abs(it))&&Math.abs(H-ut)<=r.EPSILON*Math.max(1,Math.abs(H),Math.abs(ut))&&Math.abs(C-mt)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(mt))&&Math.abs(L-Pt)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(Pt))&&Math.abs(F-Ct)<=r.EPSILON*Math.max(1,Math.abs(F),Math.abs(Ct))&&Math.abs(G-yt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(yt));}},/* 11 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"copy",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"add",function(){return f;}),t.d(e,"subtract",function(){return g;}),t.d(e,"multiply",function(){return c;}),t.d(e,"divide",function(){return m;}),t.d(e,"ceil",function(){return x;}),t.d(e,"floor",function(){return M;}),t.d(e,"min",function(){return S;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return T;}),t.d(e,"scale",function(){return h;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return d;}),t.d(e,"squaredDistance",function(){return y;}),t.d(e,"length",function(){return O;}),t.d(e,"squaredLength",function(){return E;}),t.d(e,"negate",function(){return w;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return A;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"random",function(){return R;}),t.d(e,"transformMat2",function(){return j;}),t.d(e,"transformMat2d",function(){return k;}),t.d(e,"transformMat3",function(){return J;}),t.d(e,"transformMat4",function(){return rt;}),t.d(e,"rotate",function(){return st;}),t.d(e,"angle",function(){return $;}),t.d(e,"zero",function(){return V;}),t.d(e,"str",function(){return nt;}),t.d(e,"exactEquals",function(){return lt;}),t.d(e,"equals",function(){return ct;}),t.d(e,"len",function(){return pt;}),t.d(e,"sub",function(){return et;}),t.d(e,"mul",function(){return gt;}),t.d(e,"div",function(){return Tt;}),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 tt;});var r=t(2);function n(){var U=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(U[0]=0,U[1]=0),U;}function i(U){var H=new r.ARRAY_TYPE(2);return H[0]=U[0],H[1]=U[1],H;}function l(U,H){var C=new r.ARRAY_TYPE(2);return C[0]=U,C[1]=H,C;}function o(U,H){return U[0]=H[0],U[1]=H[1],U;}function a(U,H,C){return U[0]=H,U[1]=C,U;}function f(U,H,C){return U[0]=H[0]+C[0],U[1]=H[1]+C[1],U;}function g(U,H,C){return U[0]=H[0]-C[0],U[1]=H[1]-C[1],U;}function c(U,H,C){return U[0]=H[0]*C[0],U[1]=H[1]*C[1],U;}function m(U,H,C){return U[0]=H[0]/C[0],U[1]=H[1]/C[1],U;}function x(U,H){return U[0]=Math.ceil(H[0]),U[1]=Math.ceil(H[1]),U;}function M(U,H){return U[0]=Math.floor(H[0]),U[1]=Math.floor(H[1]),U;}function S(U,H,C){return U[0]=Math.min(H[0],C[0]),U[1]=Math.min(H[1],C[1]),U;}function P(U,H,C){return U[0]=Math.max(H[0],C[0]),U[1]=Math.max(H[1],C[1]),U;}function T(U,H){return U[0]=Math.round(H[0]),U[1]=Math.round(H[1]),U;}function h(U,H,C){return U[0]=H[0]*C,U[1]=H[1]*C,U;}function p(U,H,C,L){return U[0]=H[0]+C[0]*L,U[1]=H[1]+C[1]*L,U;}function d(U,H){var C=H[0]-U[0],L=H[1]-U[1];return Math.hypot(C,L);}function y(U,H){var C=H[0]-U[0],L=H[1]-U[1];return C*C+L*L;}function O(U){var H=U[0],C=U[1];return Math.hypot(H,C);}function E(U){var H=U[0],C=U[1];return H*H+C*C;}function w(U,H){return U[0]=-H[0],U[1]=-H[1],U;}function B(U,H){return U[0]=1/H[0],U[1]=1/H[1],U;}function A(U,H){var C=H[0],L=H[1],F=C*C+L*L;return F>0&&(F=1/Math.sqrt(F)),U[0]=H[0]*F,U[1]=H[1]*F,U;}function b(U,H){return U[0]*H[0]+U[1]*H[1];}function W(U,H,C){var L=H[0]*C[1]-H[1]*C[0];return U[0]=U[1]=0,U[2]=L,U;}function D(U,H,C,L){var F=H[0],G=H[1];return U[0]=F+L*(C[0]-F),U[1]=G+L*(C[1]-G),U;}function R(U,H){H=H||1;var C=r.RANDOM()*2*Math.PI;return U[0]=Math.cos(C)*H,U[1]=Math.sin(C)*H,U;}function j(U,H,C){var L=H[0],F=H[1];return U[0]=C[0]*L+C[2]*F,U[1]=C[1]*L+C[3]*F,U;}function k(U,H,C){var L=H[0],F=H[1];return U[0]=C[0]*L+C[2]*F+C[4],U[1]=C[1]*L+C[3]*F+C[5],U;}function J(U,H,C){var L=H[0],F=H[1];return U[0]=C[0]*L+C[3]*F+C[6],U[1]=C[1]*L+C[4]*F+C[7],U;}function rt(U,H,C){var L=H[0],F=H[1];return U[0]=C[0]*L+C[4]*F+C[12],U[1]=C[1]*L+C[5]*F+C[13],U;}function st(U,H,C,L){var F=H[0]-C[0],G=H[1]-C[1],Z=Math.sin(L),q=Math.cos(L);return U[0]=F*q-G*Z+C[0],U[1]=F*Z+G*q+C[1],U;}function $(U,H){var C=U[0],L=U[1],F=H[0],G=H[1],Z=Math.sqrt(C*C+L*L)*Math.sqrt(F*F+G*G),q=Z&&(C*F+L*G)/Z;return Math.acos(Math.min(Math.max(q,-1),1));}function V(U){return U[0]=0,U[1]=0,U;}function nt(U){return"vec2("+U[0]+", "+U[1]+")";}function lt(U,H){return U[0]===H[0]&&U[1]===H[1];}function ct(U,H){var C=U[0],L=U[1],F=H[0],G=H[1];return Math.abs(C-F)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(F))&&Math.abs(L-G)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(G));}var pt=O,et=g,gt=c,Tt=m,X=d,z=y,Q=E,tt=function(){var U=n();return function(H,C,L,F,G,Z){var q,it;for(C||(C=2),L||(L=0),F?it=Math.min(F*C+L,H.length):it=H.length,q=L;q<it;q+=C)U[0]=H[q],U[1]=H[q+1],G(U,U,Z),H[q]=U[0],H[q+1]=U[1];return H;};}();},/* 12 *//***/function(u,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 i=t(56);t.d(e,"Mesh2D",function(){return i["default"];});var l=t(29);t.d(e,"MeshCloud",function(){return l["default"];});var o=t(23);t.d(e,"parseFont",function(){return o["default"];});var a=t(31);t.d(e,"parseColor",function(){return a["default"];});var f=t(21);t.d(e,"ENV",function(){return f["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return B;});var r=t(14),n=t(1),i=t(20),l=t(27),o=t(25),a=t(40),f=t(56),g=t(29),c=t(59),m=t(21),x=t(63);t(1).glMatrix.setMatrixArrayType(Array);var M={autoUpdate:!1,// premultipliedAlpha: true,
32
+ preserveDrawingBuffer:!1,// depth: false,
33
+ // antialias: false,
34
+ bufferSize:1500},S="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",P="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",T=Symbol("glRenderer"),h=Symbol("canvasRenderer"),p=Symbol("options"),d=Symbol("globalTransform"),y=Symbol("applyGlobalTransform"),O=Symbol("canvas");function E(A){var b=A.gl,W=A.fbo;W&&b.bindFramebuffer(b.FRAMEBUFFER,W),A._draw(),W&&b.bindFramebuffer(b.FRAMEBUFFER,null);}function w(A,b,W,D){var R=A.createTexture(b.canvas),j=[[[0,0],[W,0],[W,D],[0,D],[0,0]]];j.closed=!0;var k=new f["default"]({contours:j});k.setTexture(R),A.setMeshData([k.meshData]),E(A),R["delete"](),b.clearRect(0,0,W,D),delete b._filter;}var B=/*#__PURE__*/function(){function B(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,B);var D=W.contextType;if(D||(typeof WebGL2RenderingContext=="function"?D="webgl2":typeof WebGLRenderingContext=="function"?D="webgl":D="2d"),!b.getContext){var R=b;b={getContext:function getContext(){return R;},width:W.width,height:W.height},R.canvas=b,D="2d";}if(this[O]=b,D!=="webgl"&&D!=="webgl2"&&D!=="2d")throw new Error("Unknown context type ".concat(D));if(W.contextType=D,this[p]=Object.assign({},M,W),D==="webgl"||D==="webgl2"){D==="webgl2"&&(this[p].webgl2=!0);var _R=new r["default"](b,this[p]);D==="webgl2"&&!_R.isWebGL2&&(W.contextType="webgl"),Object(x.createShaders)(_R),Object(x.applyShader)(_R),Object(x.createCloudShaders)(_R);var j=_R.gl;j.clearColor(0,0,0,0),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA),this[T]=_R;}else this[h]=new i["default"](b,this[p]);this[d]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(B,[{key:"canvas",get:function get(){return this[O];}},{key:"canvasRenderer",get:function get(){return this[h];}},{key:"glRenderer",get:function get(){return this[T];}},{key:"isWebGL2",get:function get(){return this[T]&&this[T].isWebGL2;}},{key:"options",get:function get(){return this[p];}},{key:"globalTransformMatrix",get:function get(){var b=this[d];return[b[0],b[1],b[3],b[4],b[6],b[7]];}},{key:"viewMatrix",get:function get(){return this[d];}},{key:y,value:function value(){var b=this[T]||this[h];if(this[T]){var _this$canvas=this.canvas,W=_this$canvas.width,D=_this$canvas.height;b.uniforms.viewMatrix=this.viewMatrix,b.uniforms.projectionMatrix=this.projectionMatrix,b.uniforms.u_resolution=[W,D];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,b=_this$canvas2.width,W=_this$canvas2.height,D=[// translation
35
+ 1,0,0,0,1,0,-b/2,-W/2,1],R=[// scale
36
+ 2/b,0,0,0,-2/W,0,0,0,1],j=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,D);this.projectionMatrix=j,this[T]&&this[T].gl.viewport(0,0,b,W);}},{key:"createTexture",value:function createTexture(b,W){return(this[T]||this[h]).createTexture(b,W);}/* async */},{key:"loadTexture",value:function loadTexture(b){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$useImageBitmap=_ref2.useImageBitmap,W=_ref2$useImageBitmap===void 0?!1:_ref2$useImageBitmap;return(this[T]||this[h]).loadTexture(b,{useImageBitmap:W});}},{key:"createText",value:function createText(b){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$font=_ref3.font,W=_ref3$font===void 0?"16px arial":_ref3$font,_ref3$fillColor=_ref3.fillColor,D=_ref3$fillColor===void 0?null:_ref3$fillColor,_ref3$strokeColor=_ref3.strokeColor,R=_ref3$strokeColor===void 0?null:_ref3$strokeColor,_ref3$strokeWidth=_ref3.strokeWidth,j=_ref3$strokeWidth===void 0?1:_ref3$strokeWidth;if(this[T]){var k=m["default"].createText(b,{font:W,fillColor:D,strokeColor:R,strokeWidth:j});return{image:this.createTexture(k.image),rect:k.rect};}return{_img:{font:W,fillColor:D,strokeColor:R,strokeWidth:j,text:b}};}},{key:"createProgram",value:function createProgram(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},b=_ref4.vertex,W=_ref4.fragment,D=_ref4.options;if(this[T]){var R=this[T].compileSync(W,b);return R._attribOpts=D,R;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref5$vertex=_ref5.vertex,b=_ref5$vertex===void 0?S:_ref5$vertex,_ref5$fragment=_ref5.fragment,W=_ref5$fragment===void 0?P:_ref5$fragment,D=_ref5.options;return this.createProgram({vertex:b,fragment:W,options:D});}},{key:"useProgram",value:function useProgram(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[T]){var D=Object.assign({},b._attribOpts,W);return this[T].useProgram(b,D);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(b){return(this[T]||this[h]).deleteTexture(b);}},{key:"clear",value:function clear(){var _this$h;if(this[T]){var W=this[T].gl;W.clear(W.COLOR_BUFFER_BIT);}else(_this$h=this[h]).clear.apply(_this$h,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(b){var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,W=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,D=_ref6$program===void 0?null:_ref6$program;var R=this[T]||this[h],j=D||b.program;if(this[T]){var k=R.gl;if(W&&k.clear(k.COLOR_BUFFER_BIT),j)R.program!==j&&this.useProgram(j,{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 J=b.mesh.meshData,rt=!!J.uniforms.u_texSampler,st=!!J.uniforms.u_filterFlag,$=!!J.uniforms.u_radialGradientVector,V=b.hasCloudColor,nt=b.hasCloudFilter,lt=!!J.uniforms.u_clipSampler;Object(x.applyCloudShader)(R,{hasTexture:rt,hasFilter:st,hasGradient:$,hasCloudColor:V,hasCloudFilter:nt,hasClipPath:lt});}this[y](),R.setMeshData([b.meshData]),b.beforeRender&&b.beforeRender(k,b),E(R),b.afterRender&&b.afterRender(k,b);}else R.setTransform(this.globalTransformMatrix),R.drawMeshCloud(b,{clear:W,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(b){var _this14=this;var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,W=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,D=_ref7$program===void 0?null:_ref7$program;var R=this[T]||this[h];if(this[T]){var j=R.fbo,k=Object(l["default"])(this,b,D==null),J=R.gl;W&&J.clear(J.COLOR_BUFFER_BIT);var rt=!Object(c.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator12=_createForOfIteratorHelper(k),_step12;try{var _loop=function _loop(){var st=_step12.value;_this14._drawCalls++;var $=D||st.program;if(st instanceof g["default"])_this14.drawMeshCloud(st,{clear:W,program:$});else{var _this14$canvas=_this14.canvas,V=_this14$canvas.width,nt=_this14$canvas.height;if(st.beforeRender&&st.beforeRender(J,st),st.pass.length&&((!_this14.fbo||_this14.fbo.width!==V||_this14.fbo.height!==nt)&&(_this14.fbo={width:V,height:nt,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref8=[this.buffer,this.target];this.target=_ref8[0];this.buffer=_ref8[1];}}),R.bindFBO(_this14.fbo.target)),!$&&st.filterCanvas){Object(x.applyShader)(R,{hasTexture:!0});var lt=_this14.filterContext;lt||(lt=m["default"].createCanvas(V,nt).getContext("2d"),_this14.filterContext=lt);var ct=b[st.packIndex],pt=ct.filter,et=b[st.packIndex+1],gt=b[st.packIndex-1];(!gt||!gt.filterCanvas||gt.filter!==pt)&&(!et||!et.filterCanvas||et.filter!==pt)?(rt?(lt.save(),Object(o.drawMesh2D)(ct,lt,!1),lt.restore(),Object(o.applyFilter)(lt,pt)):Object(o.drawMesh2D)(ct,lt,!0),_this14[y](),w(R,lt,V,nt)):(rt&&lt.save(),Object(o.drawMesh2D)(ct,lt,!1),rt&&lt.restore(),(!et||!et.filterCanvas||ct.filter!==et.filter)&&(Object(o.applyFilter)(lt,pt),_this14[y](),w(R,lt,V,nt)));}else{if($)R.program!==$&&_this14.useProgram($,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _lt=!!st.uniforms.u_texSampler,_ct=!!st.uniforms.u_filterFlag,_pt=!!st.uniforms.u_radialGradientVector,_et=!!st.uniforms.u_clipSampler;Object(x.applyShader)(R,{hasTexture:_lt,hasFilter:_ct,hasGradient:_pt,hasClipPath:_et});}st.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[y](),R.setMeshData([st]),E(R);}if(st.pass.length){var _lt2=st.pass.length;st.pass.forEach(function(ct,pt){ct.blend=st.enableBlend,ct.setTexture(R.fbo.texture),pt===_lt2-1?R.bindFBO(j):(_this14.fbo.swap(),R.bindFBO(_this14.fbo.target)),ct.program?R.useProgram(ct.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),R.useProgram(_this14.defaultPassProgram)),R.setMeshData([ct.meshData]),J.clear(J.COLOR_BUFFER_BIT),E(R);});}st.afterRender&&st.afterRender(J,st);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else R.setTransform(this.globalTransformMatrix),R.drawMeshes(b,{clear:W});}},{key:"drawImage",value:function drawImage(b){for(var _len=arguments.length,W=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){W[_key-1]=arguments[_key];}var D=W.length;if(D<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(W.length+1," present."));if(D!==2&&D!==4&&D!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(W.length+1," arguments provided."));var R=null,j=null;D===2?R=[W[0],W[1],b.width,b.height]:D===4?R=W:D===8&&(j=W.slice(0,4),R=W.slice(4));var k=this.createTexture(b),_this$canvas3=this.canvas,J=_this$canvas3.width,rt=_this$canvas3.height,st=new a["default"]();st.rect(R[0],R[1],J,rt);var $=new f["default"](st,{width:J,height:rt});$.setTexture(k,{rect:R,srcRect:j}),this.drawMeshes([$]),this.deleteTexture(k);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[d]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var W=this[d];for(var _len2=arguments.length,b=new Array(_len2),_key2=0;_key2<_len2;_key2++){b[_key2]=arguments[_key2];}return this[d]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,b),this;}},{key:"globalTranslate",value:function globalTranslate(b,W){var D=n.mat3.create();return D=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),D,[b,W]),this.globalTransform.apply(this,_toConsumableArray(D));}},{key:"globalRotate",value:function globalRotate(b){var _ref9=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref10=_slicedToArray(_ref9,2),W=_ref10[0],D=_ref10[1];var R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[W,D]),R=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),R,b),R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[-W,-D]),this.globalTransform.apply(this,_toConsumableArray(R));}},{key:"globalScale",value:function globalScale(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:b;var _ref11=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref12=_slicedToArray(_ref11,2),D=_ref12[0],R=_ref12[1];var j=n.mat3.create();return j=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),j,[D,R]),j=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),j,[b,W]),j=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),j,[-D,-R]),this.globalTransform.apply(this,_toConsumableArray(j));}},{key:"globalSkew",value:function globalSkew(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:b;var _ref13=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref14=_slicedToArray(_ref13,2),D=_ref14[0],R=_ref14[1];var j=n.mat3.create();return j=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),j,[D,R]),j=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),j,n.mat3.fromValues(1,Math.tan(W),Math.tan(b),1,0,0)),j=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),j,[-D,-R]),this.globalTransform.apply(this,_toConsumableArray(j));}},{key:"transformPoint",value:function transformPoint(b,W,D){var R=this.globalTransformMatrix;D&&(R=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,D));var j=b*R[0]+W*R[2]+R[4],k=b*R[1]+W*R[3]+R[5];return[j,k];}}]);}();},/* 14 *//***/function(u,e,t){t.r(e);var r=t(15);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r["default"];},/* 15 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return x;});var r=t(16),n=t(17),i=t(18),l=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(M,S,P){return S in M?Object.defineProperty(M,S,{value:P,enumerable:!0,configurable:!0,writable:!0}):M[S]=P,M;}var a={};function f(M){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var P=[],T=M.length;for(var h=0;h<T;h++)h%S<2&&P.push(0.5*(M[h]+1));return P;}function g(M,S){var P=S._buffers;Object.values(P).forEach(function(T){M.deleteBuffer(T);}),S._buffers={};}function c(M,S,P){return M.activeTexture(M.TEXTURE0+P),Array.isArray(S._img)?M.bindTexture(M.TEXTURE_CUBE_MAP,S):M.bindTexture(M.TEXTURE_2D,S),S;}var m={"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 x=/*#__PURE__*/function(){function x(S){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,x);this.options=Object.assign({},x.defaultOptions,P),this.canvas=S;var T;this.options.webgl2&&(T=S.getContext("webgl2",this.options)),T==null&&(T=Object(r.setupWebGL)(S,this.options),this.aia_ext=T.getExtension("ANGLE_instanced_arrays")),this.gl=T,T.viewport(0,0,S.width,S.height),T.clearColor(0,0,0,0),T.blendFuncSeparate(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA,T.ONE,T.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(x,[{key:"program",get:function get(){var S=this.gl;return S.getParameter(S.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
37
+ // WebGLRenderingContext.uniformMatrix[234]fv()
38
+ },{key:"_declareUniform",value:function _declareUniform(S,P){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var h=this.gl,p=h.getUniformLocation(S,P);var d;var y=this;if(/^sampler/.test(T)){var O=S._samplerMap,E=S._bindTextures;Object.defineProperty(S.uniforms,P,{get:function get(){return d;},set:function set(w){d=w;var B=O[P]!=null?O[P]:E.length;E[B]=w,c(h,w,B),O[P]||(O[P]=B,h.uniform1i(p,B)),y.options.autoUpdate&&y.update();},configurable:!1,enumerable:!0});}else{var _O=T.indexOf("Matrix")===0,_E=!_O&&/v$/.test(T),w=h["uniform".concat(T)].bind(h);Object.defineProperty(S.uniforms,P,{get:function get(){return d;},set:function set(B){d=B,typeof B=="number"&&(B=[B]),_O?w(p,!1,B):_E?w(p,B):w.apply(void 0,[p].concat(_toConsumableArray(B))),y.options.autoUpdate&&y.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var S=this.program;S.meshData.forEach(function(P,T){var h=P.positions,p=P.cells,d=P.instanceCount,y=P.cellsCount,O=P.attributes,E=P.uniforms,w=P.textureCoord,B=P.enableBlend,A=_this15.gl;var b=P.mode!=null?P.mode:A.TRIANGLES;typeof b=="string"&&(b=A[b]),B?A.enable(A.BLEND):A.disable(A.BLEND),A.bindBuffer(A.ARRAY_BUFFER,S._buffers.verticesBuffer),A.bufferData(A.ARRAY_BUFFER,h,A.STATIC_DRAW),p&&(A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,S._buffers.cellsBuffer),A.bufferData(A.ELEMENT_ARRAY_BUFFER,p,A.STATIC_DRAW));var W=[];O&&Object.values(O).forEach(function(_ref15){var R=_ref15.name,j=_ref15.data,k=_ref15.divisor;if(A.bindBuffer(A.ARRAY_BUFFER,S._buffers[R]),A.bufferData(A.ARRAY_BUFFER,j,A.STATIC_DRAW),k!=null){var J=A.getAttribLocation(S,R);J>=0&&(A.enableVertexAttribArray(J),W.push(J),A.vertexAttribDivisor?A.vertexAttribDivisor(J,k):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(J,k));}}),E&&Object.entries(E).forEach(function(_ref16){var _ref17=_slicedToArray(_ref16,2),R=_ref17[0],j=_ref17[1];_this15.uniforms[R]=j;});var D;if(!p){var R=S._dimension;D=h.length/R;}if(S._enableTextures&&S._buffers.texCoordBuffer){var _R2=w||f(h,S._dimension);A.bindBuffer(A.ARRAY_BUFFER,S._buffers.texCoordBuffer),A.bufferData(A.ARRAY_BUFFER,x.FLOAT(_R2),A.STATIC_DRAW);}d!=null?(p?A.drawElementsInstanced?A.drawElementsInstanced(b,y,A.UNSIGNED_SHORT,0,d):_this15.aia_ext&&_this15.aia_ext.drawElementsInstancedANGLE(b,y,A.UNSIGNED_SHORT,0,d):A.drawArraysInstanced?A.drawArraysInstanced(b,0,D,d):_this15.aia_ext.drawArraysInstancedANGLE(b,0,D,d),W.forEach(function(R){A.vertexAttribDivisor?A.vertexAttribDivisor(R,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(R,null);})):p?A.drawElements(b,y,A.UNSIGNED_SHORT,0):A.drawArrays(b,0,D);});}},{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 S=this.program;if(!S||!S.uniforms)throw Error("No avaliable program.");return S.uniforms;}},{key:"deleteProgram",value:function deleteProgram(S){var P=this.gl;this.program===S&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),P.useProgram(null));var T=this.programs.indexOf(S);T>=0&&this.programs.splice(T,1),g(P,S),P.deleteProgram(S);}/**
39
+ [{
40
+ positions: ...
41
+ cells: ...
42
+ textureCoord: ...
43
+ attributes: {name: {data:..., normalize: true}},
44
+ uniforms: ...
45
+ }]
46
+ */},{key:"setMeshData",value:function setMeshData(S){var _this16=this;Array.isArray(S)||(S=[S]);var P=this.program;P.meshData=S.map(function(_ref18){var T=_ref18.mode,h=_ref18.positions,p=_ref18.instanceCount,d=_ref18.cells,y=_ref18.cellsCount,O=_ref18.attributes,E=_ref18.uniforms,w=_ref18.textureCoord,B=_ref18.enableBlend;var A={positions:x.FLOAT(h),uniforms:E,enableBlend:!!B,textureCoord:x.FLOAT(w)};if(d&&(A.cells=x.USHORT(d),A.cellsCount=y||A.cells.length),T!=null&&(A.mode=T),p!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");A.instanceCount=p;}if(O){var b={};Object.entries(O).forEach(function(_ref19){var _ref20=_slicedToArray(_ref19,2),W=_ref20[0],D=_ref20[1];if(!P._attribute[W])P._attribute[W]="ignored";else if(P._attribute[W]!=="ignored"){var _P$_attribute$W=P._attribute[W],R=_P$_attribute$W.name,j=_P$_attribute$W.type;var k=D.data||D;if(Array.isArray(k)&&(k=x[j](k)),b[W]={name:R,data:k},D.divisor!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");b[W].divisor=D.divisor;}}}),A.attributes=b;}return A;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(S,P){var _this17=this;var T=/^\s*uniform\s+sampler/mg.test(S);S==null&&(S=i["default"]),P==null&&(P=T?l["default"]:n["default"]);var h=this.gl,p=Object(r.createProgram)(h,P,S);p.shaderText={vertexShader:P,fragmentShader:S},p._buffers={},p._attribute={},p.uniforms={},p._samplerMap={},p._bindTextures=[];var d=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var y=P.match(d);y&&(p._dimension=Number(y[1]));var O=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");y=P.match(O),y&&(p._texCoordSize=Number(y[1]));var E=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(y=P.match(E),y)for(var A=0;A<y.length;A++){var b=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,W=y[A].match(b);if(W&&W[3]!==this.options.vertexPosition&&W[3]!==this.options.vertexTextureCoord){var _W=_slicedToArray(W,4),D=_W[1],R=_W[2],j=_W[3];D==="mat"&&(R=Math.pow(R,2)),p._buffers[j]=h.createBuffer(),p._attribute[j]={name:j,type:D,size:Number(R)||1};}}var w=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;y=P.match(w)||[],y=y.concat(S.match(w)||[]),y.forEach(function(A){var b=A.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _b$slice=b.slice(1),_b$slice2=_slicedToArray(_b$slice,3),W=_b$slice2[0],D=_b$slice2[1],R=_b$slice2[2];W=m[W],R=!!R,W.indexOf("Matrix")!==0&&R&&(W+="v"),_this17._declareUniform(p,D,W);}),p._buffers.verticesBuffer=h.createBuffer(),p._buffers.cellsBuffer=h.createBuffer();var B=h.getAttribLocation(p,this.options.vertexTextureCoord);return p._enableTextures=B>=0,p._enableTextures&&(p._buffers.texCoordBuffer=h.createBuffer()),this.programs.push(p),p;}},{key:"useProgram",value:function useProgram(S){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var T=this.gl;T.useProgram(S);var h=S._dimension;T.bindBuffer(T.ARRAY_BUFFER,S._buffers.verticesBuffer);var p=T.getAttribLocation(S,this.options.vertexPosition);if(T.vertexAttribPointer(p,h,T.FLOAT,!1,0,0),T.enableVertexAttribArray(p),S._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,S._buffers.texCoordBuffer);var d=T.getAttribLocation(S,this.options.vertexTextureCoord);T.vertexAttribPointer(d,S._texCoordSize||2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(d);}if(Object.entries(S._attribute).forEach(function(_ref21){var _ref22=_slicedToArray(_ref21,2),d=_ref22[0],y=_ref22[1];if(y!=="ignored"){var O=y.size,E=P[d]||{},w=!!E.normalize;var B=E.type||"FLOAT";var A=E.key||d;B==="UBYTE"&&(B="UNSIGNED_BYTE"),B==="USHORT"&&(B="UNSIGNED_SHORT"),y.type=B,A&&A!==d&&(S._attribute[A]=y),T.bindBuffer(T.ARRAY_BUFFER,S._buffers[d]);var b=T.getAttribLocation(S,d);b>=0&&(T.vertexAttribPointer(b,O,T[B],w,0,0),T.enableVertexAttribArray(b));}}),!S.meshData){var _d2=[[-1,-1,0,1].slice(0,h),[1,-1,0,1].slice(0,h),[1,1,0,1].slice(0,h),[-1,1,0,1].slice(0,h)],y=[[0,1,3],[3,1,2]];this.setMeshData({positions:_d2,cells:y});}return S;}},{key:"compileSync",value:function compileSync(S,P){S=S||i["default"];var T={};function h(O){O=O.replace(/^\s*/mg,"");var E=[],w=O.match(/^#pragma\s+include\s+.*/mg);if(w){for(var B=0;B<w.length;B++){var b=w[B].match(/(?:<|")(.*)(?:>|")/);if(b){var W=b[0].indexOf("<")===0?"lib":"link";var D=b[1];if(D==="graph"&&(D="graphics"),T[D])E.push("/* included ".concat(D," */"));else if(T[D]=!0,W==="lib"){var R=h(a[D]);E.push(R);}else if(W==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}E.forEach(function(B){O=O.replace(/^#pragma\s+include\s+.*/m,B);});}return O;}var p=h(S),d=P?h(P):null;return this.createProgram(p,d);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(S,P){var T,h,_h2,p,d;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_h2=function _h4(){_h2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(O){var E,w,B,b,W,D,R,_R3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:O=O.replace(/^\s*/mg,"");E=[],w=O.match(/^#pragma\s+include\s+.*/mg);if(!w){_context11.next=32;break;}B=0;case 4:if(!(B<w.length)){_context11.next=31;break;}b=w[B].match(/(?:<|")(.*)(?:>|")/);if(!b){_context11.next=28;break;}W=b[0].indexOf("<")===0?"lib":"link";D=b[1];if(!(D==="graph"&&(D="graphics"),T[D])){_context11.next=13;break;}E.push("/* included ".concat(D," */"));_context11.next=28;break;case 13:if(!(T[D]=!0,W==="lib")){_context11.next=20;break;}_context11.next=16;return h(a[D]);case 16:R=_context11.sent;E.push(R);_context11.next=28;break;case 20:if(!(W==="link")){_context11.next=28;break;}_context11.next=23;return x.fetchShader(D);case 23:_R3=_context11.sent;_context11.next=26;return h(_R3);case 26:_R3=_context11.sent;E.push(_R3);case 28:B++;_context11.next=4;break;case 31:E.forEach(function(B){O=O.replace(/^#pragma\s+include\s+.*/m,B);});case 32:return _context11.abrupt("return",O);case 33:case"end":return _context11.stop();}},_callee11);}));return _h2.apply(this,arguments);};h=function _h3(_x13){return _h2.apply(this,arguments);};S=S||i["default"];T={};_context12.next=6;return h(S);case 6:p=_context12.sent;if(!P){_context12.next=13;break;}_context12.next=10;return h(P);case 10:_context12.t0=_context12.sent;_context12.next=14;break;case 13:_context12.t0=null;case 14:d=_context12.t0;return _context12.abrupt("return",this.createProgram(p,d));case 16:case"end":return _context12.stop();}},_callee12,this);}));function compile(_x11,_x12){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(S){var P,_args13=arguments;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:P=_args13.length>1&&_args13[1]!==undefined?_args13[1]:null;_context13.next=3;return x.fetchShader(S);case 3:S=_context13.sent;_context13.t0=P;if(!_context13.t0){_context13.next=9;break;}_context13.next=8;return x.fetchShader(P);case 8:P=_context13.sent;case 9:return _context13.abrupt("return",this.compile(S,P));case 10:case"end":return _context13.stop();}},_callee13,this);}));function load(_x14){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this18=this;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref23=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref23$wrapS=_ref23.wrapS,P=_ref23$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapS,_ref23$wrapT=_ref23.wrapT,T=_ref23$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref23$wrapT,_ref23$minFilter=_ref23.minFilter,h=_ref23$minFilter===void 0?this.gl.LINEAR:_ref23$minFilter,_ref23$magFilter=_ref23.magFilter,p=_ref23$magFilter===void 0?this.gl.LINEAR:_ref23$magFilter;var d=this.gl,y=Array.isArray(S)?d.TEXTURE_CUBE_MAP:d.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),d.activeTexture(d.TEXTURE0+this._max_texture_image_units-1);var O=d.createTexture();d.bindTexture(y,O),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,E=_this$canvas4.width,w=_this$canvas4.height;if(S){if(y===d.TEXTURE_CUBE_MAP)for(var B=0;B<6;B++)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+B,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,S[B]);else d.texImage2D(y,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,S);}else if(y===d.TEXTURE_CUBE_MAP)for(var _B=0;_B<6;_B++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_B,0,d.RGBA,E,w,0,d.RGBA,d.UNSIGNED_BYTE,null);else d.texImage2D(y,0,d.RGBA,E,w,0,d.RGBA,d.UNSIGNED_BYTE,null);return d.texParameteri(y,d.TEXTURE_MIN_FILTER,h),d.texParameteri(y,d.TEXTURE_MAG_FILTER,p),d.texParameteri(y,d.TEXTURE_WRAP_S,P),d.texParameteri(y,d.TEXTURE_WRAP_T,T),y===d.TEXTURE_CUBE_MAP&&(S.width=S[0].width,S.height=S[0].height),d.bindTexture(y,null),O._img=S||{width:E,height:w},O["delete"]=function(){_this18.deleteTexture(O);},O;}},{key:"deleteTexture",value:function deleteTexture(S){var P=S._img;this.gl.deleteTexture(S),typeof P.close=="function"&&P.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(S){var _ref24,_ref24$useImageBitmap,P,T,_args14=arguments;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_ref24=_args14.length>1&&_args14[1]!==undefined?_args14[1]:{},_ref24$useImageBitmap=_ref24.useImageBitmap,P=_ref24$useImageBitmap===void 0?!0:_ref24$useImageBitmap;_context14.next=3;return x.loadImage(S,{useImageBitmap:P});case 3:T=_context14.sent;return _context14.abrupt("return",this.createTexture(T));case 5:case"end":return _context14.stop();}},_callee14,this);}));function loadTexture(_x15){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref25=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref25$color=_ref25.color,S=_ref25$color===void 0?1:_ref25$color,_ref25$blend=_ref25.blend,P=_ref25$blend===void 0?!1:_ref25$blend,_ref25$depth=_ref25.depth,T=_ref25$depth===void 0?this.options.depth!==!1:_ref25$depth,_ref25$stencil=_ref25.stencil,h=_ref25$stencil===void 0?!!this.options.stencil:_ref25$stencil;var p=this.gl,d=p.createFramebuffer();p.bindFramebuffer(p.FRAMEBUFFER,d);var y=[];for(var w=0;w<S;w++){var B=this.createTexture();p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0+w,p.TEXTURE_2D,B,0/* level */),y.push(B);}d.textures=y,d.texture=y[0],d.blend=P;var _this$canvas5=this.canvas,O=_this$canvas5.width,E=_this$canvas5.height;return T&&!h&&(d.depthBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.depthBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,O,E),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,d.depthBuffer)),h&&!T&&(d.stencilBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.stencilBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.STENCIL_INDEX8,O,E),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.STENCIL_ATTACHMENT,p.RENDERBUFFER,d.stencilBuffer)),T&&h&&(d.depthStencilBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.depthStencilBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,O,E),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,d.depthStencilBuffer)),p.bindFramebuffer(p.FRAMEBUFFER,null),d;}},{key:"bindFBO",value:function bindFBO(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=S;}},{key:"render",value:function render(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$clearBuffer=_ref26.clearBuffer,S=_ref26$clearBuffer===void 0?!0:_ref26$clearBuffer;this.startRender=!0;var P=this.gl;var T=this.program;T||(T=this.createProgram(),this.useProgram(T)),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,this.fbo);var h=this.options.depth;h&&P.enable(P.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(h?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var p=this._renderFrameID;this._draw(),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,null),this._renderFrameID===p&&(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 S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(a,S);}},{key:"FLOAT",value:function FLOAT(S,P){return Object(r.pointsToBuffer)(S,Float32Array,P);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(S,P){return Object(r.pointsToBuffer)(S,Uint8Array,P);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(S,P){return Object(r.pointsToBuffer)(S,Uint16Array,P);}},{key:"BYTE",value:function BYTE(S,P){return Object(r.pointsToBuffer)(S,Int8Array,P);}},{key:"SHORT",value:function SHORT(S,P){return Object(r.pointsToBuffer)(S,Int16Array,P);}}]);}();o(x,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(x,"UBYTE",x.UNSIGNED_BYTE),o(x,"USHORT",x.UNSIGNED_SHORT),o(x,"fetchShader",r.fetchShader),o(x,"loadImage",r.loadImage);},/* 16 *//***/function(u,e,t){t.r(e),t.d(e,"setupWebGL",function(){return n;}),t.d(e,"createProgram",function(){return i;}),t.d(e,"pointsToBuffer",function(){return l;}),t.d(e,"loadImage",function(){return a;}),t.d(e,"fetchShader",function(){return g;}),t(1).glMatrix.setMatrixArrayType(Array);function r(c,m){var x=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var M=null;for(var S=0;S<x.length;++S){try{M=c.getContext(x[S],m);}catch(_unused){}if(M)break;}return M;}function n(c,m){var x=r(c,m);if(!x)throw new Error("Sorry, your browser doesn't support WebGL.");return x;}function i(c,m,x){var M=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(M,m),c.compileShader(M),!c.getShaderParameter(M,c.COMPILE_STATUS)){var _T="Vertex shader failed to compile. The error log is:".concat(c.getShaderInfoLog(M));throw new Error(_T);}var S=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(S,x),c.compileShader(S),!c.getShaderParameter(S,c.COMPILE_STATUS)){var _T2="Fragment shader failed to compile. The error log is:".concat(c.getShaderInfoLog(S));throw new Error(_T2);}var P=c.createProgram();if(c.attachShader(P,M),c.attachShader(P,S),c.linkProgram(P),!c.getProgramParameter(P,c.LINK_STATUS)){var _T3="Shader program failed to link. The error log is:".concat(c.getProgramInfoLog(P));throw new Error(_T3);}return c.deleteShader(M),c.deleteShader(S),P;}function l(c){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(x&&!(x instanceof m))throw new TypeError("Wrong buffer type.");if(c==null||c instanceof m)return c;if(c[0]==null||c[0].length==null)return x?(x.set(c,0),x):new m(c);var M=c[0].length,S=c.length;x||(x=new m(M*S));var P=0;for(var _T4=0;_T4<S;_T4++)for(var _h5=0;_h5<M;_h5++)x[P++]=c[_T4][_h5];return x;}var o={};function a(c){var _ref27=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref27$useImageBitmap=_ref27.useImageBitmap,m=_ref27$useImageBitmap===void 0?!0:_ref27$useImageBitmap,_ref27$alias=_ref27.alias,x=_ref27$alias===void 0?null:_ref27$alias;if(!o[c]){if(typeof Image=="function"){var M=new Image();typeof c=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(c)&&(M.crossOrigin="anonymous"),o[c]=new Promise(function(S){M.onload=function(){m&&typeof createImageBitmap=="function"?createImageBitmap(M,{imageOrientation:"flipY"}).then(function(P){o[c]=P,x&&(o[x]=P),S(P);}):(o[c]=M,x&&(o[x]=M),S(M));},M.src=c;}),x&&(o[x]=o[c]);}else if(typeof fetch=="function")return fetch(c,{method:"GET",mode:"cors",cache:"default"}).then(function(M){return M.blob();}).then(function(M){return createImageBitmap(M,{imageOrientation:"flipY"}).then(function(S){return o[c]=S,x&&(o[x]=S),S;});});}return o[c];}var f={};function g(_x16){return _g.apply(this,arguments);}function _g(){_g=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(c){var m,x;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!f[c]){_context15.next=2;break;}return _context15.abrupt("return",f[c]);case 2:_context15.next=4;return fetch(c);case 4:m=_context15.sent;if(!(m.status>=200&&m.status<300)){_context15.next=10;break;}_context15.next=8;return m.text();case 8:x=_context15.sent;return _context15.abrupt("return",(f[c]=x,x));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context15.stop();}},_callee15);}));return _g.apply(this,arguments);}},/* 17 *//***/function(u,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(u,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(u,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(u,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var l=/*#__PURE__*/function(){function l(a,f){_classCallCheck(this,l);this.context=a.getContext("2d"),this.options=f,this[i]=[1,0,0,1,0,0];}return _createClass(l,[{key:"createTexture",value:function createTexture(a){return{_img:a};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(a){var f;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return r["default"].loadImage(a,{useImageBitmap:!1});case 2:f=_context16.sent;return _context16.abrupt("return",this.createTexture(f));case 4:case"end":return _context16.stop();}},_callee16,this);}));function loadTexture(_x17){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(a){return a;}},{key:"clear",value:function clear(a,f,g,c){var m=this.context;a=a||0,f=f||0,g=g||m.canvas.width-a,c=c||m.canvas.height-f,m.clearRect(a,f,g,c);}},{key:"drawMeshCloud",value:function drawMeshCloud(a){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$clear=_ref28.clear,f=_ref28$clear===void 0?!1:_ref28$clear;var g=[];for(var c=0;c<a.amount;c++){var m=a.getTransform(c);var x=a.getTextureFrame(c);x&&(x=x._img);var M=a.getFilter(c),_a$getCloudRGBA=a.getCloudRGBA(c),S=_a$getCloudRGBA.fill,P=_a$getCloudRGBA.stroke;g.push({mesh:a.mesh,_cloudOptions:[S,P,x,m,M]});}a.beforeRender&&a.beforeRender(this.context,a),this.drawMeshes(g,{clear:f,hook:!1}),a.afterRender&&a.afterRender(this.context,a);}},{key:"drawMeshes",value:function drawMeshes(a){var _this19=this;var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,f=_ref29$clear===void 0?!1:_ref29$clear,_ref29$hook=_ref29.hook,g=_ref29$hook===void 0?!0:_ref29$hook;var c=this.context;f&&c.clearRect(0,0,c.canvas.width,c.canvas.height);var m=null;var _c$canvas=c.canvas,x=_c$canvas.width,M=_c$canvas.height,S=a.length;a.forEach(function(P,T){var _P$_cloudOptions,_this19$filterBuffer;var h,p,d,y,O;g&&P.beforeRender&&P.beforeRender(c,P),P._cloudOptions&&(_P$_cloudOptions=_slicedToArray(P._cloudOptions,5),h=_P$_cloudOptions[0],p=_P$_cloudOptions[1],d=_P$_cloudOptions[2],y=_P$_cloudOptions[3],O=_P$_cloudOptions[4],P=P.mesh);var E=P.filter;if(O&&(E=E?"".concat(E," ").concat(O):O),E&&!_this19.filterBuffer&&_this19.filterBuffer!==!1){var w=r["default"].createCanvas(x,M);w?_this19.filterBuffer=w.getContext("2d"):_this19.filterBuffer=!1;}m&&m!==E&&(Object(n.applyFilter)(_this19.filterBuffer,m),c.drawImage(_this19.filterBuffer.canvas,0,0,x,M),_this19.filterBuffer.clearRect(0,0,x,M),m=null),E&&_this19.filterBuffer?(_this19.filterBuffer.save(),(_this19$filterBuffer=_this19.filterBuffer).transform.apply(_this19$filterBuffer,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(P,_this19.filterBuffer,!1,h,p,d,y),_this19.filterBuffer.restore(),T===S-1?(Object(n.applyFilter)(_this19.filterBuffer,E),c.drawImage(_this19.filterBuffer.canvas,0,0,x,M),_this19.filterBuffer.clearRect(0,0,x,M)):m=E):(c.save(),c.transform.apply(c,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(P,c,!1,h,p,d,y),c.restore()),g&&P.afterRender&&P.afterRender(c,P);});}},{key:"setTransform",value:function setTransform(a){this[i]=a;}}]);}();},/* 21 *//***/function(u,e,t){t.r(e),function(r){var n=t(14),i=t(23),l=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function a(x,M){var S=x.style,P=x.variant,T=x.weight,h=x.stretch,p=x.size,d=x.pxLineHeight,y=x.family;return h==="normal"?"".concat(S," ").concat(P," ").concat(T," ").concat(p*M,"px/").concat(d*M,"px ").concat(y):"".concat(S," ").concat(P," ").concat(T," ").concat(h," ").concat(p*M,"px/").concat(d*M,"px ").concat(y);}function f(x,_ref30){var M=_ref30.font,S=_ref30.fillColor,P=_ref30.strokeColor,T=_ref30.strokeWidth,_ref30$ratio=_ref30.ratio,h=_ref30$ratio===void 0?1:_ref30$ratio,p=_ref30.textCanvas,_ref30$cachable=_ref30.cachable,d=_ref30$cachable===void 0?!1:_ref30$cachable;var y;if(d){y=[x,M,String(S),String(P),String(T)].join("###");var k=o[y];if(k)return k;}p||(p=c(1,1));var O=p.getContext("2d");O.save(),O.font=M;var _O$measureText=O.measureText(x),E=_O$measureText.width;O.restore();var w=Object(i["default"])(M),B=Math.max(w.pxLineHeight,w.pxHeight*1.13);/italic|oblique/.test(M)&&(E+=B*Math.tan(15*Math.PI/180)),!S&&!P&&(S="#000");var A=O.canvas,b=Math.ceil(E),W=Math.ceil(B);A.width=Math.round(b*h),A.height=Math.round(W*h),O.save(),O.font=a(w,h),O.textAlign="center",O.textBaseline="middle";var D=A.height*0.5+w.pxHeight*0.05*h,R=A.width*0.5;if(S){if(Array.isArray(S))S=Object(l["default"])(S);else if(S.vector){var _k;var _S=S,J=_S.vector,rt=_S.colors;J.length===6?_k=O.createRadialGradient.apply(O,_toConsumableArray(J)):_k=O.createLinearGradient.apply(O,_toConsumableArray(J)),rt.forEach(function(_ref31){var st=_ref31.offset,$=_ref31.color;_k.addColorStop(st,$);}),S=_k;}O.fillStyle=S,O.fillText(x,R,D);}if(P){if(O.lineWidth=T*h,Array.isArray(P))P=Object(l["default"])(P);else if(P.vector){var _k2;var _P=P,_J=_P.vector,_rt=_P.colors;_J.length===6?_k2=O.createRadialGradient.apply(O,_toConsumableArray(_J)):_k2=O.createLinearGradient.apply(O,_toConsumableArray(_J)),_rt.forEach(function(_ref32){var st=_ref32.offset,$=_ref32.color;_k2.addColorStop(st,$);}),P=_k2;}O.strokeStyle=P,O.strokeText(x,R,D);}O.restore();var j={image:p,rect:[0,0,b,W]};return d&&(o[y]=j),j;}var g=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var x=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);x&&(g=Number(x[1])<70);}function c(x,M){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var P=S.offscreen||!g&&S.offscreen!==!1;var T;return _typeof(r)<"u"&&typeof r.createCanvas=="function"?T=r.createCanvas(x,M,S):P&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(x,M):(T=document.createElement("canvas"),T.width=x,T.height=M),T;}var m={createCanvas:c,createText:f,loadImage:n["default"].loadImage};e["default"]=m;}.call(this,t(22));},/* 22 *//***/function(u,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);}u.exports=t;},/* 23 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return S;}),t(1).glMatrix.setMatrixArrayType(Array);function r(P,T){if(typeof P=="string"){var d=P.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);d?P={size:parseFloat(d[1]),unit:d[2]}:P={size:parseInt(P,10),unit:"px"};}var _P2=P,h=_P2.size,p=_P2.unit;if(p==="pt")h/=0.75;else if(p==="pc")h*=16;else if(p==="in")h*=96;else if(p==="cm")h*=96/2.54;else if(p==="mm")h*=96/25.4;else if(p==="em"||p==="rem"||p==="ex"){if(!T&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d3=getComputedStyle(document.documentElement).fontSize;T=r(_d3,16);}h*=T,p==="ex"&&(h/=2);}else if(p==="q")h*=96/25.4/4;else if(p==="vw"||p==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d4=p==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;h*=_d4/100;}}else if((p==="vmax"||p==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d5=document.documentElement.clientWidth,y=document.documentElement.clientHeight;p==="vmax"?h*=Math.max(_d5,y)/100:h*=Math.min(_d5,y)/100;}return h;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",l="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",a="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",f="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",g=new RegExp("(".concat(n,") +"),"i"),c=new RegExp("(".concat(i,") +"),"i"),m=new RegExp("(".concat(l,") +"),"i"),x=new RegExp("(".concat(o,") +"),"i"),M=new RegExp("([\\d\\.]+)("+a+")(?:\\/([\\d\\.]+)("+a+"))? *((?:"+f+")( *, *(?:"+f+"))*)");function S(P,T){var h=M.exec(P);if(!h)return;var p=parseFloat(h[3]),d={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(h[1]),unit:h[2],lineHeight:Number.isFinite(p)?p:void 0,lineHeightUnit:h[4],family:h[5].replace(/ *, */g,",")},y=P.substring(0,h.index),O=g.exec(y),E=c.exec(y),w=m.exec(y),B=x.exec(y);return O&&(d.weight=O[1]),E&&(d.style=E[1]),w&&(d.variant=w[1]),B&&(d.stretch=B[1]),d.pxHeight=r({size:d.size,unit:d.unit},T),d.pxLineHeight=r({size:d.lineHeight||d.size,unit:d.lineHeightUnit||d.unit},T),d;}},/* 24 *//***/function(u,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(i,l){return l<3?Math.round(i*255):i;}).join(),")");}},/* 25 *//***/function(u,e,t){t.r(e),t.d(e,"applyFilter",function(){return o;}),t.d(e,"drawMesh2D",function(){return f;});var r=t(1),n=t(24),i=t(23),l=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(g,c){var m=g.canvas;g.save(),g.filter=c,g.drawImage(m,0,0,m.width,m.height),g.restore();}function a(g,c){var m=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;g=g.match(m).slice(1,5).map(Number),c=c.match(m).slice(1,5).map(Number);var x=[],M=c[3];for(var S=0;S<4;S++)x[S]=Object(l.mix)(g[S],c[S],M);return"rgba(".concat(x.join(),")");}function f(g,c){var m=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var x=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var M=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var S=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var P=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;c.save();var T=!1,h=!1;if(c.globalAlpha=g.getOpacity(),g._updateMatrix&&g.transformScale/g.contours.scale>1.5&&g.accurate(g.transformScale),g.lineWidth){var y=g.gradient&&g.gradient.stroke;if(y){var _y=y,O=_y.vector,E=_y.colors;if(O.length===6)y=c.createRadialGradient.apply(c,_toConsumableArray(O));else if(O.length===4)y=c.createLinearGradient.apply(c,_toConsumableArray(O));else if(O.length===3)y=c.createCircularGradient.apply(c,_toConsumableArray(O));else throw new TypeError("Invalid vector dimension.");E.forEach(function(_ref33){var w=_ref33.offset,B=_ref33.color;var A=Object(n["default"])(B);M&&(A=a(A,M)),y.addColorStop(w,A);}),c.strokeStyle=y,T=!0;}else g.strokeStyle&&(M?c.strokeStyle=a(g.strokeStyle,M):c.strokeStyle=g.strokeStyle,T=!0);}T&&(c.lineWidth=g.lineWidth,c.lineJoin=g.lineJoin,c.lineCap=g.lineCap,c.miterLimit=g.miterLimit,g.lineDash&&(c.setLineDash(g.lineDash),g.lineDashOffset&&(c.lineDashOffset=g.lineDashOffset)));var p=g.gradient&&g.gradient.fill;if(p){var _p2=p,_y2=_p2.vector,_O2=_p2.colors;if(_y2.length===6)p=c.createRadialGradient.apply(c,_toConsumableArray(_y2));else if(_y2.length===4)p=c.createLinearGradient.apply(c,_toConsumableArray(_y2));else if(_y2.length===3)p=c.createCircularGradient.apply(c,_toConsumableArray(_y2));else throw new TypeError("Invalid vector dimension.");_O2.forEach(function(_ref34){var E=_ref34.offset,w=_ref34.color;var B=Object(n["default"])(w);M&&(B=a(B,M)),p.addColorStop(E,B);}),c.fillStyle=p,h=!0;}else g.fillStyle&&(x?c.fillStyle=a(g.fillStyle,x):c.fillStyle=g.fillStyle,h=!0);if(P&&c.transform.apply(c,_toConsumableArray(P)),c.transform.apply(c,_toConsumableArray(g.transformMatrix)),g.clipPath){var _y3=g.clipPath,_O3=new Path2D(_y3);c.clip(_O3);}var d=g.contours.length;if(g.contours.forEach(function(y,O){var E=y.length,w=E>1&&r.vec2.equals(y[0],y[E-1]),B=O===d-1&&g.texture;if(y&&E>0){if(h||T||B){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(y[0]));for(var A=1;A<E;A++)A===E-1&&w?c.closePath():c.lineTo.apply(c,_toConsumableArray(y[A]));}if(h&&c.fill(g.fillRule),B){c.save(),c.clip();var _g$texture=g.texture,_A=_g$texture.image,b=_g$texture.options;if(S&&(_A=S),b.repeat&&console.warn("Context 2D not supported image repeat yet."),_A.font){b.scale&&console.warn("Context 2D not supported text scale yet."),b.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _A2=_A,W=_A2.font,D=_A2.fillColor,R=_A2.strokeColor,j=_A2.strokeWidth,k=_A2.text;!D&&!R&&(D="#000"),Array.isArray(D)&&(D=Object(n["default"])(D)),Array.isArray(R)&&(R=Object(n["default"])(R)),c.font=W;var _c$measureText=c.measureText(k),J=_c$measureText.width,rt=Object(i["default"])(W),st=Math.max(rt.pxLineHeight,rt.pxHeight*1.13);c.textAlign="center",c.textBaseline="middle";var $=b.rect,V=$[0]+st*0.5+rt.pxHeight*0.06,nt=$[1]+J*0.5;$[2]!=null&&c.scale($[2]/J,$[3]/st),D&&(c.fillStyle=D,c.fillText(k,nt,V)),R&&(c.lineWidth=j,c.strokeStyle=R,c.strokeText(k,nt,V));}else{var _W2=b.rect;var _D=b.srcRect;b.scale&&(_W2=[0,0,c.canvas.width,c.canvas.height]),b.rotated&&_W2&&(_W2=[-_W2[1],_W2[0],_W2[3],_W2[2]]),_D&&(_W2=_W2||[0,0,_D[2],_D[3]]),b.rotated&&(c.translate(0,_W2?_W2[2]:_A.width),c.rotate(-0.5*Math.PI)),_D?c.drawImage.apply(c,[_A].concat(_toConsumableArray(_D),_toConsumableArray(_W2))):_W2?c.drawImage.apply(c,[_A].concat(_toConsumableArray(_W2))):c.drawImage(_A,0,0);}c.restore();}T&&c.stroke();}}),c.restore(),m){var _y4=g.filter;_y4&&o(c,_y4);}}},/* 26 *//***/function(u,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 i;}),t(1).glMatrix.setMatrixArrayType(Array);function r(l,o,a){var _ref35;return o>a&&(_ref35=[a,o],o=_ref35[0],a=_ref35[1],_ref35),l<o?o:l>a?a:l;}function n(l,o,a){return l*(1-a)+o*a;}function i(l,o){var _l2=_slicedToArray(l,2),a=_l2[0],f=_l2[1];return[a*o[0]+f*o[2]+o[4],a*o[1]+f*o[3]+o[5]];}},/* 27 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return a;});var r=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(f,g,c){var m=f.uniforms||{},x=g.uniforms||{};if(m.u_texSampler&&x.u_texSampler&&m.u_texSampler!==x.u_texSampler)return!1;var M=Object.keys(m),S=Object.keys(x),P=M.indexOf("u_texSampler"),T=S.indexOf("u_texSampler");if(P>=0&&M.splice(P,1),T>=0&&S.splice(T,1),M.length!==S.length)return!1;var h=M.every(function(p){var d=m[p],y=x[p];if(d===y)return!0;if(d.length&&y.length&&d.length===y.length){for(var O=0;O<d.length;O++)if(d[O]!==y[O])return!1;return!0;}return!1;});if(h){if(m.u_texSampler&&!x.u_texSampler)g.setTexture(m.u_texSampler,{hidden:!0});else if(!m.u_texSampler&&x.u_texSampler)for(var p=0;p<c.length;p++)c[p].setTexture(x.u_texSampler,{hidden:!0});}return h;}var l={};function o(f,g){if(f.length){var c=Object(r["default"])(f,l);return c.enableBlend=g,f[0].filterCanvas&&(c.filterCanvas=!0),c.packIndex=f[0].packIndex,c.packLength=f.length,c.beforeRender=f[0].beforeRender,c.pass=f[0].pass,c.afterRender=f[f.length-1].afterRender,f.length=0,c;}}function a(f,g){var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(){var m,x,M,S,P,_T5,_h6,d,p,_d6,y;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:m=[],x=f.options.bufferSize;M=0,S=!1;P=0;case 3:if(!(P<g.length)){_context17.next=47;break;}_T5=g[P];if(!(_T5 instanceof n["default"])){_context17.next=16;break;}_context17.t0=m.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(m,S);case 10:M=0;S=!1;_context17.next=14;return _T5;case 14:_context17.next=44;break;case 16:_h6=_T5.meshData;if(_h6.clipPath&&!_h6.uniforms.u_clipSampler){d=f.createTexture(_h6.clipPath);_h6.uniforms.u_clipSampler=d;}p=0;if(!((!c||!_T5.canIgnore())&&_h6&&_h6.positions.length)){_context17.next=40;break;}_T5.packIndex=P;_d6=_T5.filterCanvas;if(!(p=_h6.positions.length,_d6||M+p>x)){_context17.next=31;break;}_context17.t1=m.length;if(!_context17.t1){_context17.next=27;break;}_context17.next=27;return o(m,S);case 27:M=0;S=!1;_context17.next=39;break;case 31:if(!M){_context17.next=39;break;}y=m[m.length-1];_context17.t2=y&&(y.filterCanvas||y.afterRender||_T5.beforeRender||y.pass.length||_T5.pass.length||y.program!==_T5.program||!i(y,_T5,m));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(m,S);case 37:M=0;S=!1;case 39:m.push(_T5),S=S||_T5.enableBlend,M+=p;case 40:_context17.t3=P===g.length-1&&m.length;if(!_context17.t3){_context17.next=44;break;}_context17.next=44;return o(m,S);case 44:P++;_context17.next=3;break;case 47:case"end":return _context17.stop();}},_callee17);})();}},/* 28 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var r={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(l,o){var a=0,f=0,g=0,c=0,m=0,x=0,M=0;var S=l[0].program;for(var P=0;P<l.length;P++){var _T6=l[P].meshData;if(_T6){M+=_T6.positions.length;var _h7=_T6.positions[0].length;a+=_T6.positions.length*_h7,f+=_T6.cells.length*3,x+=_T6.attributes.a_color.length*4;var p=_T6.textureCoord;p&&(g+=p.length*p[0].length);var d=_T6.attributes.a_sourceRect;d&&(c+=d.length*4);var y=_T6.attributes.a_clipUV;y&&(m+=y.length*2);}}if((!o.positions||o.positions.length<a)&&(o.positions=new Float32Array(a)),(!o.cells||o.cells.length<f)&&(o.cells=new Uint16Array(f)),g&&(!o.textureCoord||o.textureCoord.length<g)&&(o.textureCoord=new Float32Array(g)),(!o.a_color||o.a_color.length<x)&&(o.a_color=new Uint8Array(x)),c&&(!o.a_sourceRect||o.a_sourceRect.length<c)&&(o.a_sourceRect=new Float32Array(c)),m&&(!o.a_clipUV||o.a_clipUV.length<m)&&(o.a_clipUV=new Float32Array(m)),S){var _P3=Object.entries(S._attribute),_T7=S._attribOpts||{};for(var _h8=0;_h8<_P3.length;_h8++){var _P3$_h=_slicedToArray(_P3[_h8],2),_p3=_P3$_h[0],_d7=_P3$_h[1];if(_p3!=="a_color"&&_p3!=="a_sourceRect"&&_d7!=="ignored"){var _y5=_T7[_p3]?_T7[_p3].type:"FLOAT",O=r[_y5],E=_d7.size*M;(!o[_p3]||o[_p3].length<E)&&(o[_p3]=new O(E));}}}return o;}function i(l,o){var a=[],f=[],g=[],c=[],m=[],x=[],M=0,S=0;var P=l[0]?l[0].uniforms||{}:{},T=l[0]?l[0].program:null;o&&(n(l,o),f=o.cells,a=o.positions,g=o.textureCoord,c=o.a_color,m=o.a_sourceRect,x=o.a_clipUV);var h=!1,p=!1;var d={};for(var O=0;O<l.length;O++){var E=l[O];if(E){var _a2,_c2,_m2,_x18,_g2;if(E.meshData&&(E=E.meshData),o){var B=E.positions;for(var A=0;A<B.length;A++){var b=B[A],W=3*(M+A);for(var D=0;D<b.length;D++)a[W+D]=b[D];}}else(_a2=a).push.apply(_a2,_toConsumableArray(E.positions));var w=E.cells;for(var _B2=0;_B2<w.length;_B2++){var _A3=w[_B2];if(o){var _b=3*(S+_B2);f[_b]=_A3[0]+M,f[_b+1]=_A3[1]+M,f[_b+2]=_A3[2]+M;}else f.push([_A3[0]+M,_A3[1]+M,_A3[2]+M]);}if(o){var _B3=E.attributes.a_color;for(var _A4=0;_A4<_B3.length;_A4++){var _b2=_B3[_A4],_W3=4*(M+_A4);c[_W3]=_b2[0],c[_W3+1]=_b2[1],c[_W3+2]=_b2[2],c[_W3+3]=_b2[3];}}else(_c2=c).push.apply(_c2,_toConsumableArray(E.attributes.a_color));if(E.attributes.a_sourceRect)if(h=!0,o){var _B4=E.attributes.a_sourceRect;for(var _A5=0;_A5<_B4.length;_A5++){var _b3=_B4[_A5],_W4=4*(M+_A5);m[_W4]=_b3[0],m[_W4+1]=_b3[1],m[_W4+2]=_b3[2],m[_W4+3]=_b3[3];}}else(_m2=m).push.apply(_m2,_toConsumableArray(E.attributes.a_sourceRect));if(E.attributes.a_clipUV)if(p=!0,o){var _B5=E.attributes.a_clipUV;for(var _A6=0;_A6<_B5.length;_A6++){var _b4=_B5[_A6],_W5=2*(M+_A6);x[_W5]=_b4[0],x[_W5+1]=_b4[1];}}else(_x18=x).push.apply(_x18,_toConsumableArray(E.attributes.a_clipUV));if(E.textureCoord)if(o){var _B6=E.textureCoord;for(var _A7=0;_A7<_B6.length;_A7++){var _b5=_B6[_A7],_W6=3*(M+_A7);for(var _D2=0;_D2<_b5.length;_D2++)g[_W6+_D2]=_b5[_D2];}}else(_g2=g).push.apply(_g2,_toConsumableArray(E.textureCoord));if(T){var _B7=Object.entries(T._attribute);for(var _A8=0;_A8<_B7.length;_A8++){var _d$_b;var _B7$_A=_slicedToArray(_B7[_A8],2),_b6=_B7$_A[0],_W7=_B7$_A[1];if(_b6!=="a_color"&&_b6!=="a_sourceRect"&&_W7!=="ignored")if(d[_b6]=[],o){d[_b6]=o[_b6];var _D3=E.attributes[_b6],R=_D3[0].length;for(var j=0;j<_D3.length;j++){var k=_D3[j],J=R*(M+j);for(var rt=0;rt<k.length;rt++)d[_b6][J+rt]=k[rt];}}else(_d$_b=d[_b6]).push.apply(_d$_b,_toConsumableArray(E.attributes[_b6]));}}M+=E.positions.length,S+=E.cells.length;}}d.a_color=c,h&&m&&m.length>0&&(d.a_sourceRect=m);var y={positions:a,cells:f,attributes:d,uniforms:P,cellsCount:S*3,program:T};return g&&g.length&&(y.textureCoord=g),p&&x.length>0&&(d.a_clipUV=x),y;}},/* 29 *//***/function(u,e,t){t.r(e);var r=t(1),n=t(30),i=t(26),l=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(d,y){var O=Object.keys(d);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(d);y&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable;})),O.push.apply(O,E);}return O;}function a(d){for(var y=1;y<arguments.length;y++){var O=arguments[y]!=null?arguments[y]:{};y%2?o(Object(O),!0).forEach(function(E){f(d,E,O[E]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(O)):o(Object(O)).forEach(function(E){Object.defineProperty(d,E,Object.getOwnPropertyDescriptor(O,E));});}return d;}function f(d,y,O){return y in d?Object.defineProperty(d,y,{value:O,enumerable:!0,configurable:!0,writable:!0}):d[y]=O,d;}var g=Symbol("mesh"),c=Symbol("count"),m=Symbol("blend"),x=Symbol("filter"),M=Symbol("textures"),S=Symbol("textureOptions"),P=Symbol("cloudColor"),T=Symbol("cloudFilter"),h=Symbol("buffer");function p(d){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var O=new Float32Array(3*d),E=new Float32Array(3*d),w=new Float32Array(4*d),B=new Float32Array(4*d),A=new Float32Array(4*d),b=new Float32Array(4*d),W=new Float32Array(4*d),D=new Uint8Array(d),R=new Uint8Array(4*d),j=new Uint8Array(4*d);return y&&(O.set(y.transform0,0),E.set(y.transform1,0),w.set(y.color0,0),B.set(y.color1,0),A.set(y.color2,0),b.set(y.color3,0),W.set(y.color4,0),D.set(y.frameIndex,0),R.set(y.fillColor,0),j.set(y.strokeColor,0)),{bufferSize:d,transform0:O,transform1:E,color0:w,color1:B,color2:A,color3:b,color4:W,frameIndex:D,fillColor:R,strokeColor:j};}e["default"]=/*#__PURE__*/function(){function _class(d){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref36=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref36$buffer=_ref36.buffer,O=_ref36$buffer===void 0?1e3:_ref36$buffer;_classCallCheck(this,_class);O=Math.max(O,y),this[c]=y,this[g]=d,this[h]=p(O),this[M]=[],this[x]=[],this[P]=!1,this[T]=!1,this[m]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var y=this[c];for(var O=d;O<y;O++)this[h].transform0.set([1,0,0],O*3),this[h].transform1.set([0,1,0],O*3),this[h].frameIndex.set([-1],O),this[h].fillColor.set([0,0,0,0],O*4),this[h].strokeColor.set([0,0,0,0],O*4),this.setColorTransform(O,null);}},{key:"bufferSize",get:function get(){return this[h].bufferSize;}},{key:"mesh",get:function get(){return this[g];},set:function set(d){this[g]=d,this[M]&&this.setTextureFrames(this[M],this[S]);}},{key:"hasCloudColor",get:function get(){return this[P];}},{key:"hasCloudFilter",get:function get(){return this[T];}},{key:"_getFilter",value:function _getFilter(d){return this[x][d]=this[x][d]||[],this[x][d];}},{key:"getFilter",value:function getFilter(d){return this._getFilter(d).join(" ");}},{key:"enableBlend",get:function get(){return this[g].enableBlend||this[m];}},{key:"canIgnore",value:function canIgnore(){return this[g].canIgnore();}},{key:"delete",value:function _delete(d){if(d>=this[c]||d<0)throw new Error("Out of range.");var _this$h2=this[h],y=_this$h2.transform0,O=_this$h2.transform1,E=_this$h2.color0,w=_this$h2.color1,B=_this$h2.color2,A=_this$h2.color3,b=_this$h2.color4,W=_this$h2.frameIndex,D=_this$h2.fillColor,R=_this$h2.strokeColor;y.set(y.subarray(3*(d+1)),3*d),O.set(O.subarray(3*(d+1)),3*d),E.set(E.subarray(4*(d+1)),4*d),w.set(w.subarray(4*(d+1)),4*d),B.set(B.subarray(4*(d+1)),4*d),A.set(A.subarray(4*(d+1)),4*d),b.set(b.subarray(4*(d+1)),4*d),W.set(W.subarray(d+1),d),D.set(D.subarray(4*(d+1)),4*d),R.set(R.subarray(4*(d+1)),4*d);for(var j in this[x])j===d?delete this[x][j]:j>d&&(this[x][j-1]=this[x][j],delete this[x][j]);this[c]--;}},{key:"setColorTransform",value:function setColorTransform(d,y){if(d>=this[c]||d<0)throw new Error("Out of range.");d*=4;var _this$h3=this[h],O=_this$h3.color0,E=_this$h3.color1,w=_this$h3.color2,B=_this$h3.color3,A=_this$h3.color4;return y!=null?(O.set([y[0],y[5],y[10],y[15]],d),E.set([y[1],y[6],y[11],y[16]],d),w.set([y[2],y[7],y[12],y[17]],d),B.set([y[3],y[8],y[13],y[18]],d),A.set([y[4],y[9],y[14],y[19]],d),this[m]=this[m]||y[18]<1,this[T]=!0):(O.set([1,0,0,0],d),E.set([0,1,0,0],d),w.set([0,0,1,0],d),B.set([0,0,0,1],d),A.set([0,0,0,0],d)),this;}},{key:"getColorTransform",value:function getColorTransform(d){if(d>=this[c]||d<0)throw new Error("Out of range.");d*=4;var _this$h4=this[h],y=_this$h4.color0,O=_this$h4.color1,E=_this$h4.color2,w=_this$h4.color3,B=_this$h4.color4;return[y[d],O[d],E[d],w[d],B[d],y[d+1],O[d+1],E[d+1],w[d+1],B[d+1],y[d+2],O[d+2],E[d+2],w[d+2],B[d+2],y[d+3],O[d+3],E[d+3],w[d+3],B[d+3]];}},{key:"transformColor",value:function transformColor(d,y){var O=this.getColorTransform(d);return O=Object(n.multiply)(O,y),this.setColorTransform(d,O),this;}},{key:"setFillColor",value:function setFillColor(d,y){if(d>=this[c]||d<0)throw new Error("Out of range.");typeof y=="string"&&(y=Object(l["default"])(y)),y[3]>0&&(this[P]=!0),this[h].fillColor.set(y.map(function(O){return Math.round(255*O);}),4*d);}},{key:"setStrokeColor",value:function setStrokeColor(d,y){if(d>=this[c]||d<0)throw new Error("Out of range.");typeof y=="string"&&(y=Object(l["default"])(y)),y[3]>0&&(this[P]=!0),this[h].strokeColor.set(y.map(function(O){return Math.round(255*O);}),4*d);}},{key:"getCloudRGBA",value:function getCloudRGBA(d){if(d>=this[c]||d<0)throw new Error("Out of range.");d*=4;var _this$h5=this[h],y=_this$h5.fillColor,O=_this$h5.strokeColor,E=[y[d],y[d+1],y[d+2],y[d+3]],w=[O[d],O[d+1],O[d+2],O[d+3]];return E[3]/=255,w[3]/=255,{fill:"rgba(".concat(E.join(),")"),stroke:"rgba(".concat(w.join(),")")};}},{key:"grayscale",value:function grayscale(d,y){this.transformColor(d,Object(n.grayscale)(y)),this._getFilter(d).push("grayscale(".concat(100*y,"%)"));}},{key:"brightness",value:function brightness(d,y){this.transformColor(d,Object(n.brightness)(y)),this._getFilter(d).push("brightness(".concat(100*y,"%)"));}},{key:"saturate",value:function saturate(d,y){this.transformColor(d,Object(n.saturate)(y)),this._getFilter(d).push("saturate(".concat(100*y,"%)"));}},{key:"contrast",value:function contrast(d,y){this.transformColor(d,Object(n.contrast)(y)),this._getFilter(d).push("contrast(".concat(100*y,"%)"));}},{key:"invert",value:function invert(d,y){this.transformColor(d,Object(n.invert)(y)),this._getFilter(d).push("invert(".concat(100*y,"%)"));}},{key:"sepia",value:function sepia(d,y){this.transformColor(d,Object(n.sepia)(y)),this._getFilter(d).push("sepia(".concat(100*y,"%)"));}},{key:"opacity",value:function opacity(d,y){this.transformColor(d,Object(n.opacity)(y)),this._getFilter(d).push("opacity(".concat(100*y,"%)"));}},{key:"hueRotate",value:function hueRotate(d,y){this.transformColor(d,Object(n.hueRotate)(y)),this._getFilter(d).push("hue-rotate(".concat(y,"deg)"));}},{key:"setTransform",value:function setTransform(d,y){if(d>=this[c]||d<0)throw new Error("Out of range.");d*=3,y==null&&(y=[1,0,0,1,0,0]);var _this$h6=this[h],O=_this$h6.transform0,E=_this$h6.transform1;return O.set([y[0],y[2],y[4]],d),E.set([y[1],y[3],y[5]],d),this;}},{key:"getTransform",value:function getTransform(d){if(d>=this[c]||d<0)throw new Error("Out of range.");d*=3;var _this$h7=this[h],y=_this$h7.transform0,O=_this$h7.transform1;return[y[d],O[d],y[d+1],O[d+1],y[d+2],O[d+2]];}},{key:"getTextureFrame",value:function getTextureFrame(d){return this[M][this[h].frameIndex[d]];}},{key:"setTextureFrames",value:function setTextureFrames(){var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(d.length>12)throw new Error("Max frames exceed. Allow 12 frames.");d.length&&this[g].setTexture(d[0],y),this[M]=d,this[S]=y;}},{key:"setFrameIndex",value:function setFrameIndex(d,y){if(d>=this[c]||d<0)throw new Error("Out of range.");var O=this[M].length;if(O<=0)throw new Error("No frames");this[h].frameIndex[d]=y%O;}},{key:"amount",get:function get(){return this[c];},set:function set(d){var y=this[c];d!==y&&(d>this[h].bufferSize&&(this[h]=p(Math.max(d,this[h].bufferSize+1e3),this[h])),this[c]=d,d>y&&this.initBuffer(y));}},{key:"meshData",get:function get(){var _this$g$meshData=this[g].meshData,d=_this$g$meshData.attributes,y=_this$g$meshData.cells,O=_this$g$meshData.positions,E=_this$g$meshData.textureCoord,w=_this$g$meshData.uniforms,B=this[M],A={attributes:a({},d),cells:y,positions:O,textureCoord:E,uniforms:a({},w),instanceCount:this[c],enableBlend:this.enableBlend};B.length&&B.forEach(function(V,nt){A.uniforms["u_texFrame".concat(nt)]=V;});var _this$h8=this[h],b=_this$h8.transform0,W=_this$h8.transform1,D=_this$h8.color0,R=_this$h8.color1,j=_this$h8.color2,k=_this$h8.color3,J=_this$h8.color4,rt=_this$h8.fillColor,st=_this$h8.strokeColor,$=_this$h8.frameIndex;return this[g].uniforms.u_texSampler&&(A.attributes.a_frameIndex={data:$,divisor:1}),A.attributes.a_transform0={data:b,divisor:1},A.attributes.a_transform1={data:W,divisor:1},A.attributes.a_colorCloud0={data:D,divisor:1},A.attributes.a_colorCloud1={data:R,divisor:1},A.attributes.a_colorCloud2={data:j,divisor:1},A.attributes.a_colorCloud3={data:k,divisor:1},A.attributes.a_colorCloud4={data:J,divisor:1},this.hasCloudColor&&(A.attributes.a_fillCloudColor={data:rt,divisor:1},A.attributes.a_strokeCloudColor={data:st,divisor:1}),A;}},{key:"setProgram",value:function setProgram(d){this[g].setProgram(d);}},{key:"program",get:function get(){return this[g].program;}},{key:"transform",value:function transform(d,y){var O=this.getTransform(d);return y=r.mat2d.multiply(Array.of(0,0,0,0,0,0),O,y),this.setTransform(d,y),this;}},{key:"translate",value:function translate(d,_ref37){var _ref38=_slicedToArray(_ref37,2),y=_ref38[0],O=_ref38[1];var E=r.mat2d.create();return E=r.mat2d.translate(Array.of(0,0,0,0,0,0),E,[y,O]),this.transform(d,E);}},{key:"rotate",value:function rotate(d,y){var _ref39=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref40=_slicedToArray(_ref39,2),O=_ref40[0],E=_ref40[1];var w=r.mat2d.create();return w=r.mat2d.translate(Array.of(0,0,0,0,0,0),w,[O,E]),w=r.mat2d.rotate(Array.of(0,0,0,0,0,0),w,y),w=r.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-O,-E]),this.transform(d,w);}},{key:"scale",value:function scale(d,_ref41){var _ref42=_slicedToArray(_ref41,2),y=_ref42[0],_ref42$=_ref42[1],O=_ref42$===void 0?y:_ref42$;var _ref43=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref44=_slicedToArray(_ref43,2),E=_ref44[0],w=_ref44[1];var B=r.mat2d.create();return B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[E,w]),B=r.mat2d.scale(Array.of(0,0,0,0,0,0),B,[y,O]),B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[-E,-w]),this.transform(d,B);}},{key:"skew",value:function skew(d,_ref45){var _ref46=_slicedToArray(_ref45,2),y=_ref46[0],_ref46$=_ref46[1],O=_ref46$===void 0?y:_ref46$;var _ref47=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref48=_slicedToArray(_ref47,2),E=_ref48[0],w=_ref48[1];var B=r.mat2d.create();return B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[E,w]),B=r.mat2d.multiply(Array.of(0,0,0,0,0,0),B,r.mat2d.fromValues(1,Math.tan(O),Math.tan(y),1,0,0)),B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[-E,-w]),this.transform(d,B);}},{key:"isPointCollision",value:function isPointCollision(d,_ref49){var _this$g;var _ref50=_slicedToArray(_ref49,2),y=_ref50[0],O=_ref50[1];var E=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var w=this.getTransform(d),B=Object(i.transformPoint)([y,O],r.mat2d.invert(Array.of(0,0,0,0,0,0),w));return(_this$g=this[g]).isPointCollision.apply(_this$g,_toConsumableArray(B).concat([E]));}},{key:"isPointInFill",value:function isPointInFill(d,_ref51){var _ref52=_slicedToArray(_ref51,2),y=_ref52[0],O=_ref52[1];return this.isPointCollision(d,[y,O],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(d,_ref53){var _ref54=_slicedToArray(_ref53,2),y=_ref54[0],O=_ref54[1];return this.isPointCollision(d,[y,O],"stroke");}}]);}();},/* 30 *//***/function(u,e,t){t.r(e),t.d(e,"multiply",function(){return n;}),t.d(e,"grayscale",function(){return i;}),t.d(e,"brightness",function(){return l;}),t.d(e,"saturate",function(){return o;}),t.d(e,"contrast",function(){return a;}),t.d(e,"invert",function(){return f;}),t.d(e,"sepia",function(){return g;}),t.d(e,"opacity",function(){return c;}),t.d(e,"hueRotate",function(){return m;});var r=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(x,M){var S=[],P=x[0],T=x[1],h=x[2],p=x[3],d=x[4],y=x[5],O=x[6],E=x[7],w=x[8],B=x[9],A=x[10],b=x[11],W=x[12],D=x[13],R=x[14],j=x[15],k=x[16],J=x[17],rt=x[18],st=x[19];var $=M[0],V=M[1],nt=M[2],lt=M[3],ct=M[4];return S[0]=$*P+V*y+nt*A+lt*j,S[1]=$*T+V*O+nt*b+lt*k,S[2]=$*h+V*E+nt*W+lt*J,S[3]=$*p+V*w+nt*D+lt*rt,S[4]=$*d+V*B+nt*R+lt*st+ct,$=M[5],V=M[6],nt=M[7],lt=M[8],ct=M[9],S[5]=$*P+V*y+nt*A+lt*j,S[6]=$*T+V*O+nt*b+lt*k,S[7]=$*h+V*E+nt*W+lt*J,S[8]=$*p+V*w+nt*D+lt*rt,S[9]=$*d+V*B+nt*R+lt*st+ct,$=M[10],V=M[11],nt=M[12],lt=M[13],ct=M[14],S[10]=$*P+V*y+nt*A+lt*j,S[11]=$*T+V*O+nt*b+lt*k,S[12]=$*h+V*E+nt*W+lt*J,S[13]=$*p+V*w+nt*D+lt*rt,S[14]=$*d+V*B+nt*R+lt*st+ct,$=M[15],V=M[16],nt=M[17],lt=M[18],ct=M[19],S[15]=$*P+V*y+nt*A+lt*j,S[16]=$*T+V*O+nt*b+lt*k,S[17]=$*h+V*E+nt*W+lt*J,S[18]=$*p+V*w+nt*D+lt*rt,S[19]=$*d+V*B+nt*R+lt*st+ct,S;}function i(x){x=Object(r.clamp)(0,1,x);var M=0.2126*x,S=0.7152*x,P=0.0722*x;return[M+1-x,S,P,0,0,M,S+1-x,P,0,0,M,S,P+1-x,0,0,0,0,0,1,0];}function l(x){return[x,0,0,0,0,0,x,0,0,0,0,0,x,0,0,0,0,0,1,0];}function o(x){var M=0.2126*(1-x),S=0.7152*(1-x),P=0.0722*(1-x);return[M+x,S,P,0,0,M,S+x,P,0,0,M,S,P+x,0,0,0,0,0,1,0];}function a(x){var M=0.5*(1-x);return[x,0,0,0,M,0,x,0,0,M,0,0,x,0,M,0,0,0,1,0];}function f(x){var M=1-2*x;return[M,0,0,0,x,0,M,0,0,x,0,0,M,0,x,0,0,0,1,0];}function g(x){return[1-0.607*x,0.769*x,0.189*x,0,0,0.349*x,1-0.314*x,0.168*x,0,0,0.272*x,0.534*x,1-0.869*x,0,0,0,0,0,1,0];}function c(x){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,x,0];}function m(x){var M=x/180*Math.PI,S=Math.cos(M),P=Math.sin(M),T=0.2126,h=0.7152,p=0.0722;return[T+S*(1-T)+P*-T,h+S*-h+P*-h,p+S*-p+P*(1-p),0,0,T+S*-T+P*0.143,h+S*(1-h)+P*0.14,p+S*-p+P*-0.283,0,0,T+S*-T+P*-(1-T),h+S*-h+P*h,p+S*(1-p)+P*p,0,0,0,0,0,1,0];}},/* 31 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return i;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);function i(l){var o=n()(l);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 *//***/function(u,e,t){var r=t(33),n=t(37),i=t(39);u.exports=function(o){var a,f=r(o);return f.space?(a=Array(3),a[0]=i(f.values[0],0,255),a[1]=i(f.values[1],0,255),a[2]=i(f.values[2],0,255),f.space[0]==="h"&&(a=n.rgb(a)),a.push(i(f.alpha,0,1)),a):[];};},/* 33 *//***/function(u,e,t){(function(r){var n=t(34),i=t(35),l=t(36);u.exports=a;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function a(f){var g,c=[],m=1,x;if(typeof f=="string"){if(n[f])c=n[f].slice(),x="rgb";else if(f==="transparent")m=0,x="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(f)){var M=f.slice(1),S=M.length,P=S<=4;m=1,P?(c=[parseInt(M[0]+M[0],16),parseInt(M[1]+M[1],16),parseInt(M[2]+M[2],16)],S===4&&(m=parseInt(M[3]+M[3],16)/255)):(c=[parseInt(M[0]+M[1],16),parseInt(M[2]+M[3],16),parseInt(M[4]+M[5],16)],S===8&&(m=parseInt(M[6]+M[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),x="rgb";}else if(g=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(f)){var T=g[1],h=T==="rgb",M=T.replace(/a$/,"");x=M;var S=M==="cmyk"?4:M==="gray"?1:3;c=g[2].trim().split(/\s*,\s*/).map(function(O,E){if(/%$/.test(O))return E===S?parseFloat(O)/100:M==="rgb"?parseFloat(O)*255/100:parseFloat(O);if(M[E]==="h"){if(/deg$/.test(O))return parseFloat(O);if(o[O]!==void 0)return o[O];}return parseFloat(O);}),T===M&&c.push(1),m=h||c[S]===void 0?1:c[S],c=c.slice(0,S);}else f.length>10&&/[0-9](?:\s|\/)/.test(f)&&(c=f.match(/([0-9]+)/g).map(function(d){return parseFloat(d);}),x=f.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(f))x="rgb",c=[f>>>16,(f&65280)>>>8,f&255];else if(i(f)){var p=l(f.r,f.red,f.R,null);p!==null?(x="rgb",c=[p,l(f.g,f.green,f.G),l(f.b,f.blue,f.B)]):(x="hsl",c=[l(f.h,f.hue,f.H),l(f.s,f.saturation,f.S),l(f.l,f.lightness,f.L,f.b,f.brightness)]),m=l(f.a,f.alpha,f.opacity,1),f.opacity!=null&&(m/=100);}else(Array.isArray(f)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(f))&&(c=[f[0],f[1],f[2]],x="rgb",m=f.length===4?f[3]:1);return{space:x,values:c,alpha:m};}}).call(this,t(22));},/* 34 *//***/function(u,e,t){u.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(u,e,t){var r=Object.prototype.toString;u.exports=function(n){var i;return r.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 *//***/function(u,e){u.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 *//***/function(u,e,t){var r=t(38);u.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var i=n[0]/360,l=n[1]/100,o=n[2]/100,a,f,g,c,m;if(l===0)return m=o*255,[m,m,m];o<0.5?f=o*(1+l):f=o+l-o*l,a=2*o-f,c=[0,0,0];for(var x=0;x<3;x++)g=i+1/3*-(x-1),g<0?g++:g>1&&g--,6*g<1?m=a+(f-a)*6*g:2*g<1?m=f:3*g<2?m=a+(f-a)*(2/3-g)*6:m=a,c[x]=m*255;return c;}},r.hsl=function(n){var i=n[0]/255,l=n[1]/255,o=n[2]/255,a=Math.min(i,l,o),f=Math.max(i,l,o),g=f-a,c,m,x;return f===a?c=0:i===f?c=(l-o)/g:l===f?c=2+(o-i)/g:o===f&&(c=4+(i-l)/g),c=Math.min(c*60,360),c<0&&(c+=360),x=(a+f)/2,f===a?m=0:x<=0.5?m=g/(f+a):m=g/(2-f-a),[c,m*100,x*100];};},/* 38 *//***/function(u,e,t){u.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 *//***/function(u,e){u.exports=t;function t(r,n,i){return n<i?r<n?n:r>i?i:r:r<i?i:r>n?n:r;}},/* 40 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return p;});var r=t(41),n=/* @__PURE__ */t.n(r),i=t(42),l=/* @__PURE__ */t.n(i),o=t(43),a=/* @__PURE__ */t.n(o),f=t(44),g=t(46),c=/* @__PURE__ */t.n(g),m=t(53),x=t(55);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("contours"),S=Symbol("path"),P=Symbol("simplify"),T=Symbol("scale"),h=2*Math.PI;var p=/*#__PURE__*/function(){function p(){var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,p);typeof y=="string"&&(y={path:y}),y.path?this[S]=n()(y.path):this[S]=[],this[M]=null,this[P]=y.simplify!=null?y.simplify:0,this[T]=y.scale!=null?y.scale:2;}return _createClass(p,[{key:"contours",get:function get(){var y=null;if(!this[M]&&this[S]){var O=Object(f["default"])(a()(this[S]));this[M]=c()(O,this[T],this[P]),this[M].path=O,this[M].simplify=this[P],this[M].scale=this[T];}return this[M]&&(y=this[M].map(function(O){return _toConsumableArray(O);}),y.path=this[M].path,y.simplify=this[M].simplify,y.scale=this[M].scale),y;}},{key:"path",get:function get(){return this[S];}},{key:"simplify",get:function get(){return this[P];}},{key:"boundingBox",get:function get(){var y=this.contours;if(y&&y.length){var O=y.reduce(function(E,w){return[].concat(_toConsumableArray(E),_toConsumableArray(w));});return l()(O);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var y=this.boundingBox;return y?[0.5*(y[0][0]+y[1][0]),0.5*(y[0][1]+y[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$S;var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var E=Object(f["default"])(a()(this[S])).map(function(_ref55){var _ref56=_toArray(_ref55),w=_ref56[0],B=_ref56.slice(1);var A=[w];for(var b=0;b<B.length;b+=2){var W=B[b]-y,D=B[b+1]-O;A.push(W,D);}return A;});return this.beginPath(),(_this$S=this[S]).push.apply(_this$S,_toConsumableArray(E)),this;}},{key:"getPointAtLength",value:function getPointAtLength(y){return this.contours?Object(m.getPointAtLength)(this[M],y):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(m.getTotalLength)(this[M]):0;}},{key:"addPath",value:function addPath(y){var _this$S2;this[M]=null,typeof y=="string"&&(y=n()(y)),(_this$S2=this[S]).push.apply(_this$S2,_toConsumableArray(y));}},{key:"beginPath",value:function beginPath(){this[S]=[],this[M]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(y,O,E,w,B,A,b){var W=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(A+=B,b+=B,E<=0||w<=0||b===A)return;b<A&&(b=A+h+(b-A)%h),b-A>h&&(b=A+h);var D=b-A;D>=h&&(b-=1e-3);var R=this[S].length>0&&D<h?"L":"M";var j=Object(x.getPoint)(y,O,E,w,A),k=Object(x.getPoint)(y,O,E,w,b),J=+!W;var rt=D>Math.PI?1:0;W&&(rt=1-rt),R+=j.join(" "),R+="A".concat(E," ").concat(w," 0 ").concat(rt," ").concat(J," ").concat(k.join(" ")),D>=h&&(R+="Z"),this.addPath(R);}},{key:"arc",value:function arc(y,O,E,w,B){var A=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(y,O,E,E,0,w,B,A);}},{key:"arcTo",value:function arcTo(y,O,E,w,B,A,b){this[M]=null,this[S].push(["A",y,O,E,w,B,A,b]);}},{key:"moveTo",value:function moveTo(y,O){this[M]=null,this[S].push(["M",y,O]);}},{key:"lineTo",value:function lineTo(y,O){this[M]=null,this[S].push(["L",y,O]);}},{key:"bezierCurveTo",value:function bezierCurveTo(y,O,E,w,B,A){this[M]=null,this[S].push(["C",y,O,E,w,B,A]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(y,O,E,w){this[M]=null,this[S].push(["Q",y,O,E,w]);}},{key:"rect",value:function rect(y,O,E,w){var B="M".concat(y," ").concat(O,"L").concat(y+E," ").concat(O,"L").concat(y+E," ").concat(O+w,"L").concat(y," ").concat(O+w,"Z");this.addPath(B);}},{key:"closePath",value:function closePath(){this[M]=null;var y=[];var O=this[S].length;O>0&&(y=this[S][O-1]),y[0]!=="Z"&&y[0]!=="z"&&this[S].push(["Z"]);}}]);}();},/* 41 *//***/function(u,e){u.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(o){var a=[];return o.replace(r,function(f,g,c){var m=g.toLowerCase();for(c=l(c),m=="m"&&c.length>2&&(a.push([g].concat(c.splice(0,2))),m="l",g=g=="m"?"l":"L");;){if(c.length==t[m])return c.unshift(g),a.push(c);if(c.length<t[m])throw new Error("malformed path data");a.push([g].concat(c.splice(0,t[m])));}}),a;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function l(o){var a=o.match(i);return a?a.map(Number):[];}},/* 42 *//***/function(u,e,t){u.exports=r;function r(n){var i=n.length;if(i===0)return[[],[]];for(var l=n[0].length,o=n[0].slice(),a=n[0].slice(),f=1;f<i;++f)for(var g=n[f],c=0;c<l;++c){var m=g[c];o[c]=Math.min(o[c],m),a[c]=Math.max(a[c],m);}return[o,a];}},/* 43 *//***/function(u,e){u.exports=t;function t(r){var n=0,i=0,l=0,o=0;return r.map(function(a){a=a.slice();var f=a[0],g=f.toUpperCase();if(f!=g)switch(a[0]=g,f){case"a":a[6]+=l,a[7]+=o;break;case"v":a[1]+=o;break;case"h":a[1]+=l;break;default:for(var c=1;c<a.length;)a[c++]+=l,a[c++]+=o;}switch(g){case"Z":l=n,o=i;break;case"H":l=a[1];break;case"V":o=a[1];break;case"M":l=n=a[1],o=i=a[2];break;default:l=a[a.length-2],o=a[a.length-1];}return a;});}},/* 44 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(o){for(var a,f=[],g=0,c=0,m=0,x=0,M=null,S=null,P=0,T=0,h=0,p=o.length;h<p;h++){var d=o[h],y=d[0];switch(y){case"M":m=d[1],x=d[2];break;case"A":var O=Object(r["default"])(P,T,d[6],d[7],d[4],d[5],d[1],d[2],d[3]);if(!O.length)continue;O=O.map(function(b){var _b7=_slicedToArray(b,8),W=_b7[0],D=_b7[1],R=_b7[2],j=_b7[3],k=_b7[4],J=_b7[5],rt=_b7[6],st=_b7[7];return{x1:R,y1:j,x2:k,y2:J,x:rt,y:st};});for(var E=0,w;E<O.length;E++)w=O[E],d=["C",w.x1,w.y1,w.x2,w.y2,w.x,w.y],E<O.length-1&&f.push(d);break;case"S":var B=P,A=T;(a=="C"||a=="S")&&(B+=B-g,A+=A-c),d=["C",B,A,d[1],d[2],d[3],d[4]];break;case"T":a=="Q"||a=="T"?(M=P*2-M,S=T*2-S):(M=P,S=T),d=l(P,T,M,S,d[1],d[2]);break;case"Q":M=d[1],S=d[2],d=l(P,T,d[1],d[2],d[3],d[4]);break;case"L":d=i(P,T,d[1],d[2]);break;case"H":d=i(P,T,d[1],T);break;case"V":d=i(P,T,P,d[1]);break;case"Z":d=i(P,T,m,x);break;}a=y,P=d[d.length-2],T=d[d.length-1],d.length>4?(g=d[d.length-4],c=d[d.length-3]):(g=P,c=T),f.push(d);}return f;}function i(o,a,f,g){return["C",o,a,f,g,f,g];}function l(o,a,f,g,c,m){return["C",o/3+2/3*f,a/3+2/3*g,c/3+2/3*f,m/3+2/3*g,c,m];}},/* 45 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(a,f,g,c){var m=a*c-f*g<0?-1:1;var x=a*g+f*c;return x>1&&(x=1),x<-1&&(x=-1),m*Math.acos(x);}function i(a,f,g,c,m,x,M,S,P,T){var h=T*(a-g)/2+P*(f-c)/2,p=-P*(a-g)/2+T*(f-c)/2,d=M*M,y=S*S,O=h*h,E=p*p;var w=d*y-d*E-y*O;w<0&&(w=0),w/=d*E+y*O,w=Math.sqrt(w)*(m===x?-1:1);var B=w*M/S*p,A=w*-S/M*h,b=T*B-P*A+(a+g)/2,W=P*B+T*A+(f+c)/2,D=(h-B)/M,R=(p-A)/S,j=(-h-B)/M,k=(-p-A)/S,J=n(1,0,D,R);var rt=n(D,R,j,k);return x===0&&rt>0&&(rt-=r),x===1&&rt<0&&(rt+=r),[b,W,J,rt];}function l(a,f){var g=1.3333333333333333*Math.tan(f/4),c=Math.cos(a),m=Math.sin(a),x=Math.cos(a+f),M=Math.sin(a+f);return[c,m,c-m*g,m+c*g,x+M*g,M-x*g,x,M];}function o(a,f,g,c,m,x,M,S,P){var T=Math.sin(P*r/360),h=Math.cos(P*r/360),p=h*(a-g)/2+T*(f-c)/2,d=-T*(a-g)/2+h*(f-c)/2;if(p===0&&d===0)return[];if(M===0||S===0)return[];M=Math.abs(M),S=Math.abs(S);var y=p*p/(M*M)+d*d/(S*S);y>1&&(M*=Math.sqrt(y),S*=Math.sqrt(y));var O=i(a,f,g,c,m,x,M,S,T,h),E=[];var w=O[2],B=O[3];var A=Math.max(Math.ceil(Math.abs(B)/(r/4)),1);B/=A;for(var b=0;b<A;b++)E.push(l(w,B)),w+=B;return E.map(function(b){for(var W=0;W<b.length;W+=2){var D=b[W+0],R=b[W+1];D*=M,R*=S;var j=h*D-T*R,k=T*D+h*R;b[W+0]=j+O[0],b[W+1]=k+O[1];}return b;});}},/* 46 *//***/function(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(47),_t2=t(49),n=_t2.copy,i=t(50);function l(c,m,x){return c[0]=m,c[1]=x,c;}var o=[0,0],a=[0,0],f=[0,0];function g(c,m,x,M){r(x,l(o,M[1],M[2]),l(a,M[3],M[4]),l(f,M[5],M[6]),m,c);}u.exports=function(m,x,M){var S=[],P=[],T=[0,0];return m.forEach(function(h,p,d){if(h[0]==="M")n(T,h.slice(1)),P.length>0&&(S.push(P),P=[]);else if(h[0]==="C")g(P,x,T,h),l(T,h[5],h[6]);else throw new Error("illegal type in SVG: "+h[0]);}),P.length>0&&S.push(P),S.map(function(h){return i(h,M||0);});};},/* 47 *//***/function(u,e,t){u.exports=t(48)();},/* 48 *//***/function(u,e){function t(n){return[n[0],n[1]];}function r(n,i){return[n,i];}u.exports=function(i){i=i||{};var l=typeof i.recursion=="number"?i.recursion:8,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,a=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,f=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,g=i.angleTolerance||0,c=i.cuspLimit||0;return function(S,P,T,h,p,d){d||(d=[]),p=typeof p=="number"?p:1;var y=a/p;return y*=y,m(S,P,T,h,d,y),d;};function m(M,S,P,T,h,p){h.push(t(M));var d=M[0],y=M[1],O=S[0],E=S[1],w=P[0],B=P[1],A=T[0],b=T[1];x(d,y,O,E,w,B,A,b,h,p,0),h.push(t(T));}function x(M,S,P,T,h,p,d,y,O,E,w){if(!(w>l)){var B=Math.PI,A=(M+P)/2,b=(S+T)/2,W=(P+h)/2,D=(T+p)/2,R=(h+d)/2,j=(p+y)/2,k=(A+W)/2,J=(b+D)/2,rt=(W+R)/2,st=(D+j)/2,$=(k+rt)/2,V=(J+st)/2;if(w>0){var nt=d-M,lt=y-S,ct=Math.abs((P-d)*lt-(T-y)*nt),pt=Math.abs((h-d)*lt-(p-y)*nt),et,gt;if(ct>o&&pt>o){if((ct+pt)*(ct+pt)<=E*(nt*nt+lt*lt)){if(g<f){O.push(r($,V));return;}var Tt=Math.atan2(p-T,h-P);if(et=Math.abs(Tt-Math.atan2(T-S,P-M)),gt=Math.abs(Math.atan2(y-p,d-h)-Tt),et>=B&&(et=2*B-et),gt>=B&&(gt=2*B-gt),et+gt<g){O.push(r($,V));return;}if(c!==0){if(et>c){O.push(r(P,T));return;}if(gt>c){O.push(r(h,p));return;}}}}else if(ct>o){if(ct*ct<=E*(nt*nt+lt*lt)){if(g<f){O.push(r($,V));return;}if(et=Math.abs(Math.atan2(p-T,h-P)-Math.atan2(T-S,P-M)),et>=B&&(et=2*B-et),et<g){O.push(r(P,T)),O.push(r(h,p));return;}if(c!==0&&et>c){O.push(r(P,T));return;}}}else if(pt>o){if(pt*pt<=E*(nt*nt+lt*lt)){if(g<f){O.push(r($,V));return;}if(et=Math.abs(Math.atan2(y-p,d-h)-Math.atan2(p-T,h-P)),et>=B&&(et=2*B-et),et<g){O.push(r(P,T)),O.push(r(h,p));return;}if(c!==0&&et>c){O.push(r(h,p));return;}}}else if(nt=$-(M+d)/2,lt=V-(S+y)/2,nt*nt+lt*lt<=E){O.push(r($,V));return;}}x(M,S,A,b,k,J,$,V,O,E,w+1),x($,V,rt,st,R,j,d,y,O,E,w+1);}}};},/* 49 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return i;}),t.d(e,"clone",function(){return n;}),t.d(e,"copy",function(){return l;}),t.d(e,"scaleAndAdd",function(){return o;}),t.d(e,"dot",function(){return a;}),t.d(e,"rotate",function(){return f;}),t.d(e,"cross",function(){return g;}),t.d(e,"sub",function(){return c;}),t.d(e,"add",function(){return m;}),t.d(e,"computeMiter",function(){return P;}),t.d(e,"normal",function(){return T;}),t.d(e,"direction",function(){return h;});var r=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(p){return[p[0],p[1]];}function i(){return[0,0];}var l=r.vec2.copy,o=r.vec2.scaleAndAdd,a=r.vec2.dot,f=r.vec2.rotate,g=r.vec2.cross,c=r.vec2.sub,m=r.vec2.add,x=r.vec2.normalize,M=r.vec2.set,S=i();function P(p,d,y,O,E){m(p,y,O),x(p,p),M(d,-p[1],p[0]),M(S,-y[1],y[0]);var w=E/a(d,S);return Math.abs(w);}function T(p,d){return M(p,-d[1],d[0]),p;}function h(p,d,y){return c(p,d,y),x(p,p),p;}},/* 50 *//***/function(u,e,t){var r=t(51),n=t(52);u.exports=function(l,o){return l=r(l,o),l=n(l,o),l;},u.exports.radialDistance=r,u.exports.douglasPeucker=n;},/* 51 *//***/function(u,e){function t(r,n){var i=r[0]-n[0],l=r[1]-n[1];return i*i+l*l;}u.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var l=i*i,o=n[0],a=[o],f,g=1,c=n.length;g<c;g++)f=n[g],t(f,o)>l&&(a.push(f),o=f);return o!==f&&a.push(f),a;};},/* 52 *//***/function(u,e){function t(n,i,l){var o=i[0],a=i[1],f=l[0]-o,g=l[1]-a;if(f!==0||g!==0){var c=((n[0]-o)*f+(n[1]-a)*g)/(f*f+g*g);c>1?(o=l[0],a=l[1]):c>0&&(o+=f*c,a+=g*c);}return f=n[0]-o,g=n[1]-a,f*f+g*g;}function r(n,i,l,o,a){for(var f=o,g,c=i+1;c<l;c++){var m=t(n[c],n[i],n[l]);m>f&&(g=c,f=m);}f>o&&(g-i>1&&r(n,i,g,o,a),a.push(n[g]),l-g>1&&r(n,g,l,o,a));}u.exports=function(i,l){if(i.length<=1)return i;l=typeof l=="number"?l:1;var o=l*l,a=i.length-1,f=[i[0]];return r(i,0,a,o,f),f.push(i[a]),f;};},/* 53 *//***/function(u,e,t){t.r(e),t.d(e,"getTotalLength",function(){return n;}),t.d(e,"getPointAtLength",function(){return l;}),t.d(e,"getDashContours",function(){return o;});var r=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a.totalLength!=null)return a.totalLength;var f=0;return a.forEach(function(g){var c=g[0];for(var m=1;m<g.length;m++){var x=g[m];f+=Object(r.distance)(c,x),c=x;}}),a.totalLength=f,f;}function i(a,f){var g=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(f=Number(f),!Number.isFinite(f))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(f<=0)throw new TypeError("Length must > 0");var c=n(a);if(f>=c){var x=a[a.length-1],M=x[x.length-2],S=x[x.length-1],P=Math.atan2(S[1]-M[1],S[0]-M[0]);return{current:a.map(function(T){return _toConsumableArray(T);}),point:{x:S[0],y:S[1],angle:P}};}var m=[];for(var _x19=0;_x19<a.length;_x19++){m[_x19]=[];var _M=a[_x19];var _S2=_M[0];for(var _P4=1;_P4<_M.length;_P4++){var _T8=_M[_P4],_h9=Object(r.distance)(_S2,_T8);if(f<_h9){var p=f/_h9,d=Math.atan2(_T8[1]-_S2[1],_T8[0]-_S2[0]),y={x:_S2[0]*(1-p)+_T8[0]*p,y:_S2[1]*(1-p)+_T8[1]*p,angle:d};if(m[_x19].push(_S2),f>0&&m[_x19].push([y.x,y.y]),!g)return{current:m,point:y};var O=[],E=_x19;for(;_x19<a.length;_x19++){for(O[_x19-E]=[],_x19===E&&O[0].push([y.x,y.y]);_P4<_M.length;_P4++)O[_x19-E].push(_M[_P4]);_P4=0;}return{current:m,point:y,rest:O};}f-=_h9,m[_x19].push(_S2),_S2=_T8;}}}function l(a,f){if(f=Number(f),!Number.isFinite(f))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(a.length<=0)return{x:0,y:0,angle:0};if(f<=0){var g=a[0][0],c=a[0][1],m=Math.atan2(c[1]-g[1],c[0]-g[0]);return{x:g[0],y:g[1],angle:m};}return i(a,f,!1).point;}function o(a,f,g){var c=0,m=f[0],x=a;var M=[],S=f.length;if(g>0){do g-=f[c%S],c++;while(g>0);g<0&&(m=-g,c--);}else if(g<0){c=-1;do g+=f[c%S+S-1],c--;while(g<0);g>=0&&(c++,m=f[c%S+S-1]-g);}do{var P=i(x,m);x=P.rest,++c%2&&M.push.apply(M,_toConsumableArray(P.current));var _T9=c%S;_T9<0&&(_T9+=S),m=f[_T9];}while(x);return M;}},/* 54 *//***/function(u,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(_ref57,a,f,g){var _ref58=_slicedToArray(_ref57,3),i=_ref58[0],l=_ref58[1],o=_ref58[2];return i=i*2/a-1,l=1-l*2/f,Number.isFinite(g)?(o=o*2/g-1,[i,l,o]):[i,l];}function n(_ref59,_ref60){var _ref61=_slicedToArray(_ref59,3),i=_ref61[0],l=_ref61[1],_ref61$=_ref61[2],o=_ref61$===void 0?0:_ref61$;var _ref62=_slicedToArray(_ref60,3),a=_ref62[0],f=_ref62[1],_ref62$=_ref62[2],g=_ref62$===void 0?0:_ref62$;return Math.hypot(a-i,f-l,g-o);}},/* 55 *//***/function(u,e,t){t.r(e),t.d(e,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(i,l,o,a,f){f%=r,f<0&&(f+=r);var g=Math.tan(f);if(Math.abs(g)<1e5){var c=l-g*i,m=1/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);var x=-1;(f<=Math.PI/2||f>3*Math.PI/2)&&(x=1);var M=x*Math.sqrt(1/m)+i,S=g*M+c;return[M,S];}return f<Math.PI?[i,l+a]:[i,l-a];}},/* 56 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return Q;});var r=t(1),n=t(42),i=/* @__PURE__ */t.n(n),l=t(57),o=t(28),a=t(24),f=t(30),g=t(59),c=t(53),m=t(60),x=/* @__PURE__ */t.n(m),M=t(46),S=/* @__PURE__ */t.n(M),P=t(31),T=t(40),h=t(21);t(1).glMatrix.setMatrixArrayType(Array);function p(tt,U){if(tt==null)return{};var H=d(tt,U),C,L;if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(tt);for(L=0;L<F.length;L++)C=F[L],!(U.indexOf(C)>=0)&&Object.prototype.propertyIsEnumerable.call(tt,C)&&(H[C]=tt[C]);}return H;}function d(tt,U){if(tt==null)return{};var H={},C=Object.keys(tt),L,F;for(F=0;F<C.length;F++)L=C[F],!(U.indexOf(L)>=0)&&(H[L]=tt[L]);return H;}var y=Symbol("mesh"),O=Symbol("contours"),E=Symbol("stroke"),w=Symbol("fill"),B=Symbol("strokeColor"),A=Symbol("fillColor"),b=Symbol("transform"),W=Symbol("invertTransform"),D=Symbol("uniforms"),R=Symbol("texOptions"),j=Symbol("blend"),k=Symbol("applyTexture"),J=Symbol("applyTransform"),rt=Symbol("applyGradientTransform"),st=Symbol("applyProgram"),$=Symbol("gradient"),V=Symbol("filter"),nt=Symbol("opacity"),lt=Symbol("program"),ct=Symbol("attributes"),pt=Symbol("pass"),et=Symbol("clipContext"),gt=Symbol("applyClipPath");function Tt(tt,U){var H=tt[1][0]-tt[0][0],C=tt[1][1]-tt[0][1],L=[];for(var F=0;F<U.length;F++){var G=U[F],Z=[(G[0]-tt[0][0])/H,1-(G[1]-tt[0][1])/C];L.push(Z);}return L;}function X(_ref63,_ref64,_ref65){var _ref66=_slicedToArray(_ref63,2),tt=_ref66[0],U=_ref66[1];var _ref67=_slicedToArray(_ref64,4),H=_ref67[0],C=_ref67[1],L=_ref67[2],F=_ref67[3];var G=_ref65.scale;return G||(tt/=L,U=1-U/F,tt-=H,U+=C),[tt,U,0];}function z(tt,U,H){var C=S()(tt,U,H);return C.path=tt,C.simplify=H,C.scale=U,C;}var Q=/*#__PURE__*/function(){function Q(U){_classCallCheck(this,Q);this[E]=null,this[w]=null,this[b]=[1,0,0,1,0,0],this[nt]=1,this[D]={},this[V]=[],this[j]=null,this[R]={},this.contours=U.contours,this[lt]=null,this[ct]={},this[pt]=[];}return _createClass(Q,[{key:"contours",get:function get(){return this[O];},set:function set(U){this[y]=null,this[O]=U;var H=U.scale;this.transformScale/H>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(U){this[lt]=U,this[y]&&this[st](U);}},{key:"program",get:function get(){return this[lt];}},{key:"setAttribute",value:function setAttribute(U,H){H==null?delete this[ct][U]:this[ct][U]=H;}},{key:"getOpacity",value:function getOpacity(){return this[nt];}},{key:"setOpacity",value:function setOpacity(U){if(U<0||U>1)throw new TypeError("Invalid opacity value.");this[y]&&this[y].positions.forEach(function(H){H[2]=1/H[2]>0?U:-U;}),this[nt]=U;}},{key:"setClipPath",value:function setClipPath(U){this.clipPath=U,this[D].u_clipSampler&&this[D].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[y]&&delete this[y].attributes.a_clipUV,U&&this[y]&&this[gt]();}},{key:gt,value:function value(){if(this.clipPath){this[et]||(this[et]=h["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),U=_this$boundingBox$[0],H=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),C=_this$boundingBox$2[0],L=_this$boundingBox$2[1];C&&L&&(this[et].width=C-U,this[et].height=L-H);var F=this[et].getContext("2d"),G=new Path2D(this.clipPath);F.clearRect(0,0,this[et].width,this[et].height),F.save(),F.translate(-U,-H),F.fillStyle="white",F.fill(G),F.restore(),this[y].clipPath=this[et];var Z=Tt(this.boundingBox,this[y].position0);this[y].attributes.a_clipUV=Z;}}},{key:"getPointAtLength",value:function getPointAtLength(U){return Object(c.getPointAtLength)(this[O],U);}},{key:"getTotalLength",value:function getTotalLength(){return Object(c.getTotalLength)(this[O]);}},{key:"blend",get:function get(){return this[j]==null?"auto":this[j];},set:function set(U){this[j]=U,this[y]&&(this[y].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[y]&&this[y].boundingBox)return this[y].boundingBox;var U=this.meshData;if(U){var H=U.position0;if(H.length)U.boundingBox=i()(H);else return[[0,0],[0,0]];return U.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var U=this.boundingBox;return U?[0.5*(U[0][0]+U[1][0]),0.5*(U[0][1]+U[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[w]?this[w].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[E]?this[E].lineWidth:0;}},{key:"lineCap",get:function get(){return this[E]?this[E].lineCap:"";}},{key:"lineJoin",get:function get(){return this[E]?this[E].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[E]?this[E].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[B]&&this[B][3]!==0?Object(a["default"])(this[B]):"";}},{key:"lineDash",get:function get(){return this[E]?this[E].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[E]?this[E].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[A]&&this[A][3]!==0?Object(a["default"])(this[A]):"";}},{key:"gradient",get:function get(){return this[$];}},{key:"texture",get:function get(){return this[D].u_texSampler?{image:this[D].u_texSampler._img,options:this[R]}:null;}},{key:"enableBlend",get:function get(){return this[j]===!0||this[j]===!1?this[j]:this[nt]<1||this[B]!=null&&this[B][3]<1||this[A]!=null&&this[A][3]<1||this[D].u_colorMatrix!=null&&this[D].u_colorMatrix[18]<1||this[D].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[V].join(" ");}},{key:"transformMatrix",get:function get(){return this[b];}},{key:"invertMatrix",get:function get(){if(!this[W]){var U=r.mat2d.invert(Array.of(0,0,0,0,0,0),this[b]);this[W]=U;}return this[W];}},{key:"transformScale",get:function get(){var U=this[b];return Math.max(Math.hypot(U[0],U[1]),Math.hypot(U[2],U[3]));}},{key:"uniforms",get:function get(){return this[D];}},{key:"pass",get:function get(){return this[pt];}},{key:st,value:function value(U){var H=this[ct],C=this[y].position0,L=Object.entries(U._attribute);for(var F=0;F<L.length;F++){var _L$F=_slicedToArray(L[F],2),G=_L$F[0],Z=_L$F[1];if(G!=="a_color"&&G!=="a_sourceRect"&&Z!=="ignored"){var q=H[G];if(G==="uv"&&!q){var it=this[y].boundingBox||i()(C);this[y].attributes[G]=Tt(it,C);}else{this[y].attributes[G]=[];for(var _it=0;_it<C.length;_it++){var ut=C[_it];this[y].attributes[G].push(q?q(ut,F,C):Array(Z.size).fill(0));}}}}}// {stroke, fill}
47
+ },{key:"meshData",get:function get(){var _this20=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[y]){!this[w]&&!this[E]&&this.setFill();var U=this[O],H={};if(U&&U.length){if(this[w])try{var F=x()(U,this[w]);F.positions=F.positions.map(function(G){return G.push(_this20[nt]),G;}),F.attributes={a_color:Array.from({length:F.positions.length}).map(function(){return _this20[A].map(function(G){return Math.round(255*G);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
48
+ },H.fill=F;}catch(_unused3){}if(this[E]){var _F=this[E].lineDash;var G=U;if(_F){var q=this[E].lineDashOffset;G=Object(c.getDashContours)(U,_F,q);}var Z=G.map(function(q,it){var ut=q.length>1&&r.vec2.equals(q[0],q[q.length-1]),mt=_this20[E].build(q,ut);return x()([mt]);});Z.forEach(function(q){q.positions=q.positions.map(function(it){return it.push(-_this20[nt]),it;}),q.attributes={a_color:Array.from({length:q.positions.length}).map(function(){return _this20[B].map(function(it){return Math.round(255*it);});})};}),H.stroke=Object(o["default"])(Z);}}var C=Object(o["default"])([H.fill,H.stroke]);C.fillPointCount=H.fill?H.fill.positions.length:0,C.enableBlend=this.enableBlend,C.position0=C.positions.map(function(_ref68){var _ref69=_slicedToArray(_ref68,3),F=_ref69[0],G=_ref69[1],Z=_ref69[2];return[F,G,Z];}),C.uniforms=this[D],this[y]=C,this[D].u_texSampler&&this[k](C,this[R]);var L=this[b];Object(g.isUnitTransform)(L)||(this[J](C,L),this[D].u_radialGradientVector&&this[rt]()),this.clipPath&&this[gt](),this[lt]&&this[st](this[lt]);}return this._updateMatrix&&(this[y].matrix=this[b],this[J](this[y],this[b]),this[D].u_radialGradientVector&&this[rt]()),this[y];}},{key:J,value:function value(U,H){var C=U.positions,L=U.position0;for(var F=0;F<C.length;F++){var _L$F2=_slicedToArray(L[F],2),G=_L$F2[0],Z=_L$F2[1],q=C[F];q[0]=G*H[0]+Z*H[2]+H[4],q[1]=G*H[1]+Z*H[3]+H[5];}this._updateMatrix=!1;}},{key:rt,value:function value(){var U=this[b],H=_toConsumableArray(this._radialGradientVector);if(H){var _H=_slicedToArray(H,5),C=_H[0],L=_H[1],F=_H[3],G=_H[4];H[0]=C*U[0]+L*U[2]+U[4],H[1]=C*U[1]+L*U[3]+U[5],H[3]=F*U[0]+G*U[2]+U[4],H[4]=F*U[1]+G*U[3]+U[5],this[D].u_radialGradientVector=H;}}},{key:k,value:function value(U,H){function C(it,ut){return it==null&&ut==null?!0:it==null||ut==null?!1:it[0]===ut[0]&&it[1]===ut[1]&&it[2]===ut[2]&&it[3]===ut[3];}var L=this[D].u_texSampler;if(!L)return;var _L$_img=L._img,F=_L$_img.width,G=_L$_img.height,Z=H.srcRect;var q=H.rect||[0,0];if(H.rotated&&(q=[-q[1],q[0],q[3],q[2]]),q[2]==null&&(q[2]=Z?Z[2]:F),q[3]==null&&(q[3]=Z?Z[3]:G),H.hidden)U.textureCoord=U.positions.map(function(){return[-1,-1,-1];});else if(!U.textureCoord||!C(this[R].rect,H.rect)||this[R].hidden!==H.hidden||this[R].rotated!==H.rotated){var it=null;H.rotated&&(it=r.mat2d.rotate(Array.of(0,0,0,0,0,0),r.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),it=r.mat2d.translate(Array.of(0,0,0,0,0,0),it,[0,-q[2]])),U.textureCoord=U.position0.map(function(_ref70){var _ref71=_slicedToArray(_ref70,3),ut=_ref71[0],mt=_ref71[1],Pt=_ref71[2];if(1/Pt>0){if(H.rotated){var yt=ut*it[0]+mt*it[2]+it[4],vt=ut*it[1]+mt*it[3]+it[5];ut=yt;mt=vt;}var Ct=X([ut,mt],[q[0]/q[2],q[1]/q[3],q[2],q[3]],H);return H.repeat&&(Ct[2]=1),Ct;}return[-1,-1,-1];});}if(Z){var _it2=[Z[0]/F,Z[1]/G,Z[2]/F,Z[3]/G];U.attributes.a_sourceRect=U.positions.map(function(){return[].concat(_it2);});}else U.attributes.a_sourceRect=U.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(U){if(!this.contours)return;if(this.contours.path){var C=this.contours.simplify,L=z(this.contours.path,2*U,C);this[y]=null,this[O]=L;}}},{key:"canIgnore",value:function canIgnore(){var U=this[E]==null||this[E].lineWidth===0||this[B][3]===0,H=this[w]==null||this[A][3]===0,C=this[D].u_radialGradientVector==null,L=this[D].u_texSampler==null;return this[nt]===0||this[lt]==null&&U&&H&&C&&L&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
49
+ // cap: 'butt' or 'square'
50
+ // lineDash: null
51
+ // lineDashOffset: 0
52
+ },{key:"setStroke",value:function setStroke(){var _ref72=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref72$thickness=_ref72.thickness,U=_ref72$thickness===void 0?1:_ref72$thickness,_ref72$cap=_ref72.cap,H=_ref72$cap===void 0?"butt":_ref72$cap,_ref72$join=_ref72.join,C=_ref72$join===void 0?"miter":_ref72$join,_ref72$miterLimit=_ref72.miterLimit,L=_ref72$miterLimit===void 0?10:_ref72$miterLimit,_ref72$color=_ref72.color,F=_ref72$color===void 0?[0,0,0,0]:_ref72$color,_ref72$lineDash=_ref72.lineDash,G=_ref72$lineDash===void 0?null:_ref72$lineDash,_ref72$lineDashOffset=_ref72.lineDashOffset,Z=_ref72$lineDashOffset===void 0?0:_ref72$lineDashOffset,_ref72$roundSegments=_ref72.roundSegments,q=_ref72$roundSegments===void 0?20:_ref72$roundSegments;return this[y]=null,this[E]=new l["default"]({lineWidth:U,lineCap:H,lineJoin:C,miterLimit:L,roundSegments:q}),typeof F=="string"&&(F=Object(P["default"])(F)),this[B]=F,this[E].lineDash=G,this[E].lineDashOffset=Z,this;}},{key:"setFill",value:function setFill(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$rule=_ref73.rule,U=_ref73$rule===void 0?this.fillRule:_ref73$rule,_ref73$color=_ref73.color,H=_ref73$color===void 0?[0,0,0,0]:_ref73$color;return this[y]=null,this[w]={rule:U},typeof H=="string"&&(H=Object(P["default"])(H)),this[A]=H,this;}/**
53
+ options: {
54
+ scale: false,
55
+ repeat: false,
56
+ rotated: false,
57
+ rect: [10, 10],
58
+ srcRect: [...],
59
+ hidden: false,
60
+ }
61
+ */},{key:"setTexture",value:function setTexture(U){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(U&&U.image){var _U=U,C=_U.image,L=_U.rect;if(U=C,H.rect)for(var F=0;F<H.rect.length;F++)L[F]=H.rect[F];H.rect=L;}return this[w]||this.setFill(),this.setUniforms({u_texSampler:U}),this[y]&&this[k](this[y],H),this[R]=H,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},U=_ref74.vector,H=_ref74.colors,_ref74$type=_ref74.type,C=_ref74$type===void 0?"fill":_ref74$type;if(U.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:U,colors:H,type:C});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},U=_ref75.vector,H=_ref75.colors,_ref75$type=_ref75.type,C=_ref75$type===void 0?"fill":_ref75$type;if(U.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:U,colors:H,type:C});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},U=_ref76.vector,H=_ref76.colors,_ref76$type=_ref76.type,C=_ref76$type===void 0?"fill":_ref76$type;if(U.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:U,colors:H,type:C});}/**
62
+ vector: [x0, y0, r0, x1, y1, r1],
63
+ colors: [{offset:0, color}, {offset:1, color}, ...],
64
+ */},{key:"setGradient",value:function setGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},U=_ref77.vector,H=_ref77.colors,_ref77$type=_ref77.type,C=_ref77$type===void 0?"fill":_ref77$type;H=H.map(function(_ref78){var G=_ref78.offset,Z=_ref78.color;return typeof Z=="string"&&(Z=Object(P["default"])(Z)),{offset:G,color:Z};}),this[$]=this[$]||{},this[$][C]={vector:U,colors:H},H.sort(function(G,Z){return G.offset-Z.offset;});var L=[];H.forEach(function(_ref79){var G=_ref79.offset,Z=_ref79.color;L.push.apply(L,[G].concat(_toConsumableArray(Z)));});var F;if(U.length===4?F=[U[0],U[1],0,U[2],U[3],0]:F=_toConsumableArray(U),L.length<40&&L.push(-1),L.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=F,this[D].u_colorSteps=L,C==="fill"?this[D].u_gradientType=1:this[D].u_gradientType=0,this[rt](),this;}},{key:"setUniforms",value:function setUniforms(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[D],U),this;}},{key:"setTransform",value:function setTransform(){var H=this[b];for(var _len3=arguments.length,U=new Array(_len3),_key3=0;_key3<_len3;_key3++){U[_key3]=arguments[_key3];}return r.mat2d.equals(U,H)||(this[b]=U,delete this[W],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var H=this[b];for(var _len4=arguments.length,U=new Array(_len4),_key4=0;_key4<_len4;_key4++){U[_key4]=arguments[_key4];}return this[b]=r.mat2d.multiply(Array.of(0,0,0,0,0,0),H,U),delete this[W],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(U,H){var C=r.mat2d.create();return C=r.mat2d.translate(Array.of(0,0,0,0,0,0),C,[U,H]),this.transform.apply(this,_toConsumableArray(C));}},{key:"rotate",value:function rotate(U){var _ref80=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref81=_slicedToArray(_ref80,2),H=_ref81[0],C=_ref81[1];var L=r.mat2d.create();return L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[H,C]),L=r.mat2d.rotate(Array.of(0,0,0,0,0,0),L,U),L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[-H,-C]),this.transform.apply(this,_toConsumableArray(L));}},{key:"scale",value:function scale(U){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:U;var _ref82=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref83=_slicedToArray(_ref82,2),C=_ref83[0],L=_ref83[1];var F=r.mat2d.create();return F=r.mat2d.translate(Array.of(0,0,0,0,0,0),F,[C,L]),F=r.mat2d.scale(Array.of(0,0,0,0,0,0),F,[U,H]),F=r.mat2d.translate(Array.of(0,0,0,0,0,0),F,[-C,-L]),this.transform.apply(this,_toConsumableArray(F));}},{key:"skew",value:function skew(U){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:U;var _ref84=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref85=_slicedToArray(_ref84,2),C=_ref85[0],L=_ref85[1];var F=r.mat2d.create();return F=r.mat2d.translate(Array.of(0,0,0,0,0,0),F,[C,L]),F=r.mat2d.multiply(Array.of(0,0,0,0,0,0),F,r.mat2d.fromValues(1,Math.tan(H),Math.tan(U),1,0,0)),F=r.mat2d.translate(Array.of(0,0,0,0,0,0),F,[-C,-L]),this.transform.apply(this,_toConsumableArray(F));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[V].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,U=new Array(_len5),_key5=0;_key5<_len5;_key5++){U[_key5]=arguments[_key5];}return U[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:U}),this;}// apply linear color transform
65
+ },{key:"transformColor",value:function transformColor(){var H=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,U=new Array(_len6),_key6=0;_key6<_len6;_key6++){U[_key6]=arguments[_key6];}return H?H=Object(f.multiply)(H,U):H=U,this.setColorTransform.apply(this,_toConsumableArray(H)),this;}},{key:"blur",value:function blur(U){return this[V].push("blur(".concat(U,"px)")),this;}},{key:"brightness",value:function brightness(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("brightness(".concat(100*U,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.brightness)(U)));}},{key:"contrast",value:function contrast(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("contrast(".concat(100*U,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.contrast)(U)));}},{key:"dropShadow",value:function dropShadow(U,H){var C=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(a["default"])(L)),this[V].push("drop-shadow(".concat(U,"px ").concat(H,"px ").concat(C,"px ").concat(L,")")),this;}},{key:"grayscale",value:function grayscale(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("grayscale(".concat(100*U,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.grayscale)(U)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
66
+ },{key:"hueRotate",value:function hueRotate(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[V].push("hue-rotate(".concat(U,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(f.hueRotate)(U)));}},{key:"invert",value:function invert(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("invert(".concat(100*U,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.invert)(U)));}},{key:"opacity",value:function opacity(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("opacity(".concat(100*U,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.opacity)(U)));}},{key:"saturate",value:function saturate(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("saturate(".concat(100*U,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.saturate)(U)));}},{key:"sepia",value:function sepia(){var U=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("sepia(".concat(100*U,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.sepia)(U)));}},{key:"url",value:function url(U){return this[V].push("url(".concat(U,")")),this;}},{key:"isPointCollision",value:function isPointCollision(U,H){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var L=this.meshData,F=L.positions,G=L.cells,Z=this.invertMatrix,q=Z[0]*U+Z[2]*H+Z[4],it=Z[1]*U+Z[3]*H+Z[5],ut=this.boundingBox;if(q<ut[0][0]||q>ut[1][0]||it<ut[0][1]||it>ut[1][1])return!1;function mt(_ref86,_ref87,_ref88){var _ref89=_slicedToArray(_ref86,2),Pt=_ref89[0],Ct=_ref89[1];var _ref90=_slicedToArray(_ref87,2),yt=_ref90[0],vt=_ref90[1];var _ref91=_slicedToArray(_ref88,2),xt=_ref91[0],Et=_ref91[1];var At=xt-yt,Ot=Et-vt,Nt=((Pt-yt)*At+(Ct-vt)*Ot)/(Math.pow(At,2)+Math.pow(Ot,2));return Nt>=0&&Nt<=1;}for(var Pt=0;Pt<G.length;Pt++){var Ct=G[Pt];if(C==="fill"&&Ct[0]>=L.fillPointCount)break;if(C==="stroke"&&Ct[0]<L.fillPointCount)continue;var _Ct$map=Ct.map(function(Ut){return F[Ut];}),_Ct$map2=_slicedToArray(_Ct$map,3),_Ct$map2$=_slicedToArray(_Ct$map2[0],2),yt=_Ct$map2$[0],vt=_Ct$map2$[1],_Ct$map2$2=_slicedToArray(_Ct$map2[1],2),xt=_Ct$map2$2[0],Et=_Ct$map2$2[1],_Ct$map2$3=_slicedToArray(_Ct$map2[2],2),At=_Ct$map2$3[0],Ot=_Ct$map2$3[1],Nt=Math.sign((U-yt)*(Et-vt)-(xt-yt)*(H-vt));if(Nt===0&&mt([U,H],[yt,vt],[xt,Et]))return!0;var $t=Math.sign((U-xt)*(Ot-Et)-(At-xt)*(H-Et));if($t===0&&mt([U,H],[xt,Et],[At,Ot]))return!0;var jt=Math.sign((U-At)*(vt-Ot)-(yt-At)*(H-Ot));if(jt===0&&mt([U,H],[At,Ot],[yt,vt])||Nt===1&&$t===1&&jt===1||Nt===-1&&$t===-1&&jt===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(U,H){return this.isPointCollision(U,H,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(U,H){return this.isPointCollision(U,H,"stroke");}},{key:"addPass",value:function addPass(U){var H=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var C=H.width,L=H.height,F=p(H,["width","height"]);var G=new T["default"]();G.rect(0,0,C,L);var Z=new Q(G,{width:C,height:L});Z.setUniforms(F),Z.setProgram(U),this[pt].push(Z);}}]);}();},/* 57 *//***/function(u,e,t){t.r(e);var r=t(58);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r.Stroke;},/* 58 *//***/function(u,e,t){t.r(e),t.d(e,"Stroke",function(){return g;});var r=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(r.create)(),i=Object(r.create)(),l=Object(r.create)(),o=Object(r.create)(),a=Object(r.create)(),f=1e20;var g=/*#__PURE__*/function(){function g(){var _ref92=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref92$lineWidth=_ref92.lineWidth,S=_ref92$lineWidth===void 0?1:_ref92$lineWidth,_ref92$lineJoin=_ref92.lineJoin,P=_ref92$lineJoin===void 0?"miter":_ref92$lineJoin,_ref92$miterLimit=_ref92.miterLimit,T=_ref92$miterLimit===void 0?10:_ref92$miterLimit,_ref92$lineCap=_ref92.lineCap,h=_ref92$lineCap===void 0?"butt":_ref92$lineCap,_ref92$roundSegments=_ref92.roundSegments,p=_ref92$roundSegments===void 0?20:_ref92$roundSegments;_classCallCheck(this,g);this.lineWidth=S,this.lineJoin=P,this.miterLimit=T,this.lineCap=h,this.roundSegments=p,this._normal=null;}return _createClass(g,[{key:"build",value:function build(S){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var T=S.length;if(S=_toConsumableArray(S),T<2)return S;P&&((S[0][0]!==S[T-1][0]||S[0][1]!==S[T-1][1])&&S.push(_toConsumableArray(S[0])),S.push(_toConsumableArray(S[1]))),T=S.length,this._normal=null;var h={left:[],right:[]},p=this.lineWidth/2,d=this.lineCap;if(!P&&d==="square"){Object(r.direction)(i,S[0],S[1]),Object(r.scaleAndAdd)(S[0],S[0],i,p);var O=S.length-1;Object(r.direction)(i,S[O],S[O-1]),Object(r.scaleAndAdd)(S[O],S[O],i,p);}for(var _O4=1;_O4<T;_O4++){var E=S[_O4-1],w=S[_O4],B=S[_O4+1];this._seg(h,E,w,B,p,P);}return!P&&d==="round"&&x(h,this.roundSegments),[].concat(_toConsumableArray(h.left),_toConsumableArray(h.right.reverse()));}},{key:"_seg",value:function _seg(S,P,T,h,p,d){var y=this.lineJoin==="bevel",O=this.lineJoin==="round";if(Object(r.direction)(i,T,P),this._normal||(this._normal=Object(r.create)(),Object(r.normal)(this._normal,i)),S.left.length||m(S,P,this._normal,p),!h)Object(r.normal)(this._normal,i),d?m(S,P,this._normal,p):m(S,T,this._normal,p);else{Object(r.direction)(l,h,T);var E=Object(r.computeMiter)(o,a,i,l,p);E=Math.min(E,f);var w=Object(r.dot)(o,this._normal)<0?-1:1;var B=y||O;if(!B&&this.lineJoin==="miter"&&E/p>this.miterLimit&&(B=!0),B){Object(r.scaleAndAdd)(n,T,this._normal,-p*w),c(S,n,w);var A=1/0;P&&(A=Math.min(A,Math.hypot(T[0]-P[0],T[1]-P[1]))),h&&(A=Math.min(A,Math.hypot(h[0]-T[0],h[1]-T[1])));var b=Math.max(p,Math.min(E,A));if(Object(r.scaleAndAdd)(n,T,a,b*w),c(S,n,-w),h)if(Object(r.normal)(n,l),Object(r.copy)(this._normal,n),Object(r.scaleAndAdd)(n,T,n,-p*w),O){var W=Object(r.clone)(n),D=w>0?S.left[S.left.length-1]:S.right[S.right.length-1],R=Object(r.clone)(T),j=Object(r.sub)(Object(r.create)(),D,R),k=Object(r.sub)(Object(r.create)(),W,R),J=Math.PI/this.roundSegments;for(var rt=0;rt<this.roundSegments&&(Object(r.rotate)(j,j,[0,0],w*J),Math.sign(Object(r.cross)(n,j,k)[2])===w);rt++)Object(r.add)(n,j,R),c(S,n,w);c(S,W,w);}else c(S,n,w);}else m(S,T,a,E),Object(r.copy)(this._normal,a);}}}]);}();function c(M,S,P){P>0?M.left.push(Object(r.clone)(S)):M.right.push(Object(r.clone)(S));}function m(M,S,P,T){var h=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(r.scaleAndAdd)(n,S,P,-T),c(M,n,-h),Object(r.scaleAndAdd)(n,S,P,T),c(M,n,h);}function x(_ref93,P){var M=_ref93.left,S=_ref93.right;var T=Object(r.create)(),h=Object(r.create)();var p=M[0],d=S[0],y=[0.5*(p[0]+d[0]),0.5*(p[1]+d[1])];Object(r.sub)(h,p,y);for(var O=1;O<=P;O++){var E=-1*Math.PI*O/P;Object(r.rotate)(T,h,[0,0],E),Object(r.add)(n,y,T),M.unshift(Object(r.clone)(n));}p=S[S.length-1],d=M[M.length-1],y=[0.5*(p[0]+d[0]),0.5*(p[1]+d[1])],Object(r.sub)(h,p,y);for(var _O5=1;_O5<=P;_O5++){var _E2=-1*Math.PI*_O5/P;Object(r.rotate)(T,h,[0,0],_E2),Object(r.add)(n,y,T),S.push(Object(r.clone)(n));}}},/* 59 *//***/function(u,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(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(61),n=t(62);u.exports=function(i,l){if(l=l||{},i=i.filter(function(P){return P.length>2;}),i.length===0)return{positions:[],cells:[]};typeof l.vertexSize!="number"&&(l.vertexSize=i[0][0].length),i=i.map(function(P){return P.reduce(function(T,h){return T.concat(h);});});var o=l.rule==="evenodd"?r.WINDING_ODD:r.WINDING_NONZERO;for(var a=r.tesselate(n({contours:i,windingRule:o,elementType:r.POLYGONS,polySize:3,vertexSize:2},l)),f=[],g=0;g<a.vertices.length;g+=l.vertexSize){var c=a.vertices.slice(g,g+l.vertexSize);f.push(c);}var m=[];for(g=0;g<a.elements.length;g+=3){var x=a.elements[g],M=a.elements[g+1],S=a.elements[g+2];m.push([x,M,S]);}return{positions:f,cells:m};};},/* 61 *//***/function(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r={},n={};u.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(h){for(var p=h.debug||!1,d=new T(),y=0;y<h.contours.length;y++)d.addContour(h.vertexSize||2,h.contours[y]);return d.tesselate(h.windingRule||r.WINDING_ODD,h.elementType||r.POLYGONS,h.polySize||3,h.vertexSize||2,h.normal||[0,0,1]),{vertices:d.vertices,vertexIndices:d.vertexIndices,vertexCount:d.vertexCount,elements:d.elements,elementCount:d.elementCount,mesh:p?d.mesh:void 0};};var i=function i(h){if(!h)throw"Assertion Failed!";};function l(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0;}function o(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function a(h){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=h;}a.prototype={get Rface(){return this.Sym.Lface;},set Rface(h){this.Sym.Lface=h;},get Dst(){return this.Sym.Org;},set Dst(h){this.Sym.Org=h;},get Oprev(){return this.Sym.Lnext;},set Oprev(h){this.Sym.Lnext=h;},get Lprev(){return this.Onext.Sym;},set Lprev(h){this.Onext.Sym=h;},get Dprev(){return this.Lnext.Sym;},set Dprev(h){this.Lnext.Sym=h;},get Rprev(){return this.Sym.Onext;},set Rprev(h){this.Sym.Onext=h;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(h){this.Sym.Onext.Sym=h;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(h){this.Sym.Lnext.Sym=h;}/* 3 pointers */};function f(){var h=new l(),p=new o(),d=new a(0),y=new a(1);h.next=h.prev=h,h.anEdge=null,p.next=p.prev=p,p.anEdge=null,p.trail=null,p.marked=!1,p.inside=!1,d.next=d,d.Sym=y,d.Onext=null,d.Lnext=null,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,y.next=y,y.Sym=d,y.Onext=null,y.Lnext=null,y.Org=null,y.Lface=null,y.winding=0,y.activeRegion=null,this.vHead=h,this.fHead=p,this.eHead=d,this.eHeadSym=y;}f.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
67
+ * No vertex or face structures are allocated, but these must be assigned
68
+ * before the current edge operation is completed.
69
+ *///static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
70
+ makeEdge_:function makeEdge_(h){var p=new a(0),d=new a(1);h.Sym.side<h.side&&(h=h.Sym);var y=h.Sym.next;return d.next=y,y.Sym.next=p,p.next=h,h.Sym.next=d,p.Sym=d,p.Onext=p,p.Lnext=d,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,d.Sym=p,d.Onext=d,d.Lnext=p,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,p;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
71
+ * CS348a notes (see mesh.h). Basically it modifies the mesh so that
72
+ * a->Onext and b->Onext are exchanged. This can have various effects
73
+ * depending on whether a and b belong to different face or vertex rings.
74
+ * For more explanation see tessMeshSplice() below.
75
+ */// static void Splice( TESShalfEdge *a, TESShalfEdge *b )
76
+ splice_:function splice_(h,p){var d=h.Onext,y=p.Onext;d.Sym.Lnext=p,y.Sym.Lnext=h,h.Onext=y,p.Onext=d;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
77
+ * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
78
+ * a place to insert the new vertex in the global vertex list. We insert
79
+ * the new vertex *before* vNext so that algorithms which walk the vertex
80
+ * list will not see the newly created vertices.
81
+ *///static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
82
+ makeVertex_:function makeVertex_(h,p,d){var y=h;i(y!==null);var O=d.prev;y.prev=O,O.next=y,y.next=d,d.prev=y,y.anEdge=p;var E=p;do E.Org=y,E=E.Onext;while(E!==p);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
83
+ * face of all edges in the face loop to which eOrig belongs. "fNext" gives
84
+ * a place to insert the new face in the global face list. We insert
85
+ * the new face *before* fNext so that algorithms which walk the face
86
+ * list will not see the newly created faces.
87
+ */// static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
88
+ makeFace_:function makeFace_(h,p,d){var y=h;i(y!==null);var O=d.prev;y.prev=O,O.next=y,y.next=d,d.prev=y,y.anEdge=p,y.trail=null,y.marked=!1,y.inside=d.inside;var E=p;do E.Lface=y,E=E.Lnext;while(E!==p);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
89
+ * and removes from the global edge list.
90
+ *///static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
91
+ killEdge_:function killEdge_(h){h.Sym.side<h.side&&(h=h.Sym);var p=h.next,d=h.Sym.next;p.Sym.next=d,d.Sym.next=p;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
92
+ * vertex list. It updates the vertex loop to point to a given new vertex.
93
+ *///static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
94
+ killVertex_:function killVertex_(h,p){var d=h.anEdge,y=d;do y.Org=p,y=y.Onext;while(y!==d);var O=h.prev,E=h.next;E.prev=O,O.next=E;},/* KillFace( fDel ) destroys a face and removes it from the global face
95
+ * list. It updates the face loop to point to a given new face.
96
+ *///static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
97
+ killFace_:function killFace_(h,p){var d=h.anEdge,y=d;do y.Lface=p,y=y.Lnext;while(y!==d);var O=h.prev,E=h.next;E.prev=O,O.next=E;},/****************** Basic Edge Operations **********************//* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
98
+ * The loop consists of the two new half-edges.
99
+ *///TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
100
+ makeEdge:function makeEdge(){var h=new l(),p=new l(),d=new o(),y=this.makeEdge_(this.eHead);return this.makeVertex_(h,y,this.vHead),this.makeVertex_(p,y.Sym,this.vHead),this.makeFace_(d,y,this.fHead),y;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
101
+ * mesh connectivity and topology. It changes the mesh so that
102
+ * eOrg->Onext <- OLD( eDst->Onext )
103
+ * eDst->Onext <- OLD( eOrg->Onext )
104
+ * where OLD(...) means the value before the meshSplice operation.
105
+ *
106
+ * This can have two effects on the vertex structure:
107
+ * - if eOrg->Org != eDst->Org, the two vertices are merged together
108
+ * - if eOrg->Org == eDst->Org, the origin is split into two vertices
109
+ * In both cases, eDst->Org is changed and eOrg->Org is untouched.
110
+ *
111
+ * Similarly (and independently) for the face structure,
112
+ * - if eOrg->Lface == eDst->Lface, one loop is split into two
113
+ * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
114
+ * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
115
+ *
116
+ * Some special cases:
117
+ * If eDst == eOrg, the operation has no effect.
118
+ * If eDst == eOrg->Lnext, the new face will have a single edge.
119
+ * If eDst == eOrg->Lprev, the old face will have a single edge.
120
+ * If eDst == eOrg->Onext, the new vertex will have a single edge.
121
+ * If eDst == eOrg->Oprev, the old vertex will have a single edge.
122
+ *///int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
123
+ splice:function splice(h,p){var d=!1,y=!1;if(h!==p){if(p.Org!==h.Org&&(y=!0,this.killVertex_(p.Org,h.Org)),p.Lface!==h.Lface&&(d=!0,this.killFace_(p.Lface,h.Lface)),this.splice_(p,h),!y){var O=new l();this.makeVertex_(O,p,h.Org),h.Org.anEdge=h;}if(!d){var E=new o();this.makeFace_(E,p,h.Lface),h.Lface.anEdge=h;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
124
+ * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
125
+ * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
126
+ * the newly created loop will contain eDel->Dst. If the deletion of eDel
127
+ * would create isolated vertices, those are deleted as well.
128
+ *
129
+ * This function could be implemented as two calls to tessMeshSplice
130
+ * plus a few calls to memFree, but this would allocate and delete
131
+ * unnecessary vertices and faces.
132
+ *///int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
133
+ "delete":function _delete(h){var p=h.Sym,d=!1;if(h.Lface!==h.Rface&&(d=!0,this.killFace_(h.Lface,h.Rface)),h.Onext===h)this.killVertex_(h.Org,null);else if(h.Rface.anEdge=h.Oprev,h.Org.anEdge=h.Onext,this.splice_(h,h.Oprev),!d){var y=new o();this.makeFace_(y,h,h.Lface);}p.Onext===p?(this.killVertex_(p.Org,null),this.killFace_(p.Lface,null)):(h.Lface.anEdge=p.Oprev,p.Org.anEdge=p.Onext,this.splice_(p,p.Oprev)),this.killEdge_(h);},/******************** Other Edge Operations **********************//* All these routines can be implemented with the basic edge
134
+ * operations above. They are provided for convenience and efficiency.
135
+ *//* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
136
+ * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
137
+ * eOrg and eNew will have the same left face.
138
+ */// TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
139
+ addEdgeVertex:function addEdgeVertex(h){var p=this.makeEdge_(h),d=p.Sym;this.splice_(p,h.Lnext),p.Org=h.Dst;var y=new l();return this.makeVertex_(y,d,p.Org),p.Lface=d.Lface=h.Lface,p;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
140
+ * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
141
+ * eOrg and eNew will have the same left face.
142
+ */// TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
143
+ splitEdge:function splitEdge(h,p){var d=this.addEdgeVertex(h),y=d.Sym;return this.splice_(h.Sym,h.Sym.Oprev),this.splice_(h.Sym,y),h.Dst=y.Org,y.Dst.anEdge=y.Sym,y.Rface=h.Rface,y.winding=h.winding,y.Sym.winding=h.Sym.winding,y;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
144
+ * to eDst->Org, and returns the corresponding half-edge eNew.
145
+ * If eOrg->Lface == eDst->Lface, this splits one loop into two,
146
+ * and the newly created loop is eNew->Lface. Otherwise, two disjoint
147
+ * loops are merged into one, and the loop eDst->Lface is destroyed.
148
+ *
149
+ * If (eOrg == eDst), the new face will have only two edges.
150
+ * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
151
+ * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
152
+ */// TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
153
+ connect:function connect(h,p){var d=!1,y=this.makeEdge_(h),O=y.Sym;if(p.Lface!==h.Lface&&(d=!0,this.killFace_(p.Lface,h.Lface)),this.splice_(y,h.Lnext),this.splice_(O,p),y.Org=h.Dst,O.Org=p.Org,y.Lface=O.Lface=h.Lface,h.Lface.anEdge=O,!d){var E=new o();this.makeFace_(E,y,h.Lface);}return y;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
154
+ * global face list. All edges of fZap will have a NULL pointer as their
155
+ * left face. Any edges which also have a NULL pointer as their right face
156
+ * are deleted entirely (along with any isolated vertices this produces).
157
+ * An entire mesh can be deleted by zapping its faces, one at a time,
158
+ * in any order. Zapped faces cannot be used in further mesh operations!
159
+ */zapFace:function zapFace(h){var p=h.anEdge,d,y,O,E,w;y=p.Lnext;do d=y,y=d.Lnext,d.Lface=null,d.Rface===null&&(d.Onext===d?this.killVertex_(d.Org,null):(d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),O=d.Sym,O.Onext===O?this.killVertex_(O.Org,null):(O.Org.anEdge=O.Onext,this.splice_(O,O.Oprev)),this.killEdge_(d));while(d!=p);E=h.prev,w=h.next,w.prev=E,E.next=w;},countFaceVerts_:function countFaceVerts_(h){var p=h.anEdge,d=0;do d++,p=p.Lnext;while(p!==h.anEdge);return d;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
160
+ mergeConvexFaces:function mergeConvexFaces(h){var p,d,y,O,E,w,B;for(p=this.fHead.next;p!==this.fHead;p=p.next)if(p.inside)for(d=p.anEdge,E=d.Org;y=d.Lnext,O=d.Sym,O&&O.Lface&&O.Lface.inside&&(w=this.countFaceVerts_(p),B=this.countFaceVerts_(O.Lface),w+B-2<=h&&n.vertCCW(d.Lprev.Org,d.Org,O.Lnext.Lnext.Org)&&n.vertCCW(O.Lprev.Org,O.Org,d.Lnext.Lnext.Org)&&(y=O.Lnext,this["delete"](O),d=null,O=null)),!(d&&d.Lnext.Org===E);)d=y;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
161
+ */check:function check(){var h=this.fHead,p=this.vHead,d=this.eHead,y,O,E,w,B,A;for(O=h,O=h;(y=O.next)!==h;O=y){i(y.prev===O),B=y.anEdge;do i(B.Sym!==B),i(B.Sym.Sym===B),i(B.Lnext.Onext.Sym===B),i(B.Onext.Sym.Lnext===B),i(B.Lface===y),B=B.Lnext;while(B!==y.anEdge);}for(i(y.prev===O&&y.anEdge===null),w=p,w=p;(E=w.next)!==p;w=E){i(E.prev===w),B=E.anEdge;do i(B.Sym!==B),i(B.Sym.Sym===B),i(B.Lnext.Onext.Sym===B),i(B.Onext.Sym.Lnext===B),i(B.Org===E),B=B.Onext;while(B!==E.anEdge);}for(i(E.prev===w&&E.anEdge===null),A=d,A=d;(B=A.next)!==d;A=B)i(B.Sym.next===A.Sym),i(B.Sym!==B),i(B.Sym.Sym===B),i(B.Org!==null),i(B.Dst!==null),i(B.Lnext.Onext.Sym===B),i(B.Onext.Sym.Lnext===B);i(B.Sym.next===A.Sym&&B.Sym===this.eHeadSym&&B.Sym.Sym===B&&B.Org===null&&B.Dst===null&&B.Lface===null&&B.Rface===null);}},n.vertEq=function(h,p){return h.s===p.s&&h.t===p.t;},n.vertLeq=function(h,p){return h.s<p.s||h.s===p.s&&h.t<=p.t;},n.transLeq=function(h,p){return h.t<p.t||h.t===p.t&&h.s<=p.s;},n.edgeGoesLeft=function(h){return n.vertLeq(h.Dst,h.Org);},n.edgeGoesRight=function(h){return n.vertLeq(h.Org,h.Dst);},n.vertL1dist=function(h,p){return Math.abs(h.s-p.s)+Math.abs(h.t-p.t);},n.edgeEval=function(h,p,d){i(n.vertLeq(h,p)&&n.vertLeq(p,d));var y=p.s-h.s,O=d.s-p.s;return y+O>0?y<O?p.t-h.t+(h.t-d.t)*(y/(y+O)):p.t-d.t+(d.t-h.t)*(O/(y+O)):0;},n.edgeSign=function(h,p,d){i(n.vertLeq(h,p)&&n.vertLeq(p,d));var y=p.s-h.s,O=d.s-p.s;return y+O>0?(p.t-d.t)*y+(p.t-h.t)*O:0;},n.transEval=function(h,p,d){i(n.transLeq(h,p)&&n.transLeq(p,d));var y=p.t-h.t,O=d.t-p.t;return y+O>0?y<O?p.s-h.s+(h.s-d.s)*(y/(y+O)):p.s-d.s+(d.s-h.s)*(O/(y+O)):0;},n.transSign=function(h,p,d){i(n.transLeq(h,p)&&n.transLeq(p,d));var y=p.t-h.t,O=d.t-p.t;return y+O>0?(p.s-d.s)*y+(p.s-h.s)*O:0;},n.vertCCW=function(h,p,d){return h.s*(p.t-d.t)+p.s*(d.t-h.t)+d.s*(h.t-p.t)>=0;},n.interpolate=function(h,p,d,y){return h=h<0?0:h,d=d<0?0:d,h<=d?d===0?(p+y)/2:p+(y-p)*(h/(h+d)):y+(p-y)*(d/(h+d));},n.intersect=function(h,p,d,y,O){var E,w,B;n.vertLeq(h,p)||(B=h,h=p,p=B),n.vertLeq(d,y)||(B=d,d=y,y=B),n.vertLeq(h,d)||(B=h,h=d,d=B,B=p,p=y,y=B),n.vertLeq(d,p)?n.vertLeq(p,y)?(E=n.edgeEval(h,d,p),w=n.edgeEval(d,p,y),E+w<0&&(E=-E,w=-w),O.s=n.interpolate(E,d.s,w,p.s)):(E=n.edgeSign(h,d,p),w=-n.edgeSign(h,y,p),E+w<0&&(E=-E,w=-w),O.s=n.interpolate(E,d.s,w,y.s)):O.s=(d.s+p.s)/2,n.transLeq(h,p)||(B=h,h=p,p=B),n.transLeq(d,y)||(B=d,d=y,y=B),n.transLeq(h,d)||(B=h,h=d,d=B,B=p,p=y,y=B),n.transLeq(d,p)?n.transLeq(p,y)?(E=n.transEval(h,d,p),w=n.transEval(d,p,y),E+w<0&&(E=-E,w=-w),O.t=n.interpolate(E,d.t,w,p.t)):(E=n.transSign(h,d,p),w=-n.transSign(h,y,p),E+w<0&&(E=-E,w=-w),O.t=n.interpolate(E,d.t,w,y.t)):O.t=(d.t+p.t)/2;};function g(){this.key=null,this.next=null,this.prev=null;}function c(h,p){this.head=new g(),this.head.next=this.head,this.head.prev=this.head,this.frame=h,this.leq=p;}c.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(h){return this.insertBefore(this.head,h);},search:function search(h){var p=this.head;do p=p.next;while(p.key!==null&&!this.leq(this.frame,h,p.key));return p;},insertBefore:function insertBefore(h,p){do h=h.prev;while(h.key!==null&&!this.leq(this.frame,h.key,p));var d=new g();return d.key=p,d.next=h.next,h.next.prev=d,d.prev=h,h.next=d,d;},"delete":function _delete(h){h.next.prev=h.prev,h.prev.next=h.next;}};function m(){this.handle=null;}function x(){this.key=null,this.node=null;}function M(h,p){this.size=0,this.max=h,this.nodes=[],this.nodes.length=h+1;var d;for(d=0;d<this.nodes.length;d++)this.nodes[d]=new m();for(this.handles=[],this.handles.length=h+1,d=0;d<this.handles.length;d++)this.handles[d]=new x();this.initialized=!1,this.freeList=0,this.leq=p,this.nodes[1].handle=1,this.handles[1].key=null;}M.prototype={floatDown_:function floatDown_(h){var p=this.nodes,d=this.handles,y,O,E;for(y=p[h].handle;;){if(E=h<<1,E<this.size&&this.leq(d[p[E+1].handle].key,d[p[E].handle].key)&&++E,i(E<=this.max),O=p[E].handle,E>this.size||this.leq(d[y].key,d[O].key)){p[h].handle=y,d[y].node=h;break;}p[h].handle=O,d[O].node=h,h=E;}},floatUp_:function floatUp_(h){var p=this.nodes,d=this.handles,y,O,E;for(y=p[h].handle;;){if(E=h>>1,O=p[E].handle,E===0||this.leq(d[O].key,d[y].key)){p[h].handle=y,d[y].node=h;break;}p[h].handle=O,d[O].node=h,h=E;}},init:function init(){for(var h=this.size;h>=1;--h)this.floatDown_(h);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 )
162
+ insert:function insert(h){var p,d;if(p=++this.size,p*2>this.max){this.max*=2;var y,O;for(O=this.nodes.length,this.nodes.length=this.max+1,y=O;y<this.nodes.length;y++)this.nodes[y]=new m();for(O=this.handles.length,this.handles.length=this.max+1,y=O;y<this.handles.length;y++)this.handles[y]=new x();}return this.freeList===0?d=p:(d=this.freeList,this.freeList=this.handles[d].node),this.nodes[p].handle=d,this.handles[d].node=p,this.handles[d].key=h,this.initialized&&this.floatUp_(p),d;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
163
+ extractMin:function extractMin(){var h=this.nodes,p=this.handles,d=h[1].handle,y=p[d].key;return this.size>0&&(h[1].handle=h[this.size].handle,p[h[1].handle].node=1,p[d].key=null,p[d].node=this.freeList,this.freeList=d,--this.size,this.size>0&&this.floatDown_(1)),y;},"delete":function _delete(h){var p=this.nodes,d=this.handles,y;i(h>=1&&h<=this.max&&d[h].key!==null),y=d[h].node,p[y].handle=p[this.size].handle,d[p[y].handle].node=y,--this.size,y<=this.size&&(y<=1||this.leq(d[p[y>>1].handle].key,d[p[y].handle].key)?this.floatDown_(y):this.floatUp_(y)),d[h].key=null,d[h].node=this.freeList,this.freeList=h;}};function S(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var P={};P.regionBelow=function(h){return h.nodeUp.prev.key;},P.regionAbove=function(h){return h.nodeUp.next.key;},P.debugEvent=function(h){},P.addWinding=function(h,p){h.winding+=p.winding,h.Sym.winding+=p.Sym.winding;},P.edgeLeq=function(h,p,d){var y=h.event,w,B,O=p.eUp,E=d.eUp;if(O.Dst===y)return E.Dst===y?n.vertLeq(O.Org,E.Org)?n.edgeSign(E.Dst,O.Org,E.Org)<=0:n.edgeSign(O.Dst,E.Org,O.Org)>=0:n.edgeSign(E.Dst,y,E.Org)<=0;if(E.Dst===y)return n.edgeSign(O.Dst,y,O.Org)>=0;var w=n.edgeEval(O.Dst,y,O.Org),B=n.edgeEval(E.Dst,y,E.Org);return w>=B;},P.deleteRegion=function(h,p){p.fixUpperEdge&&i(p.eUp.winding===0),p.eUp.activeRegion=null,h.dict["delete"](p.nodeUp);},P.fixUpperEdge=function(h,p,d){i(p.fixUpperEdge),h.mesh["delete"](p.eUp),p.fixUpperEdge=!1,p.eUp=d,d.activeRegion=p;},P.topLeftRegion=function(h,p){var d=p.eUp.Org,y;do p=P.regionAbove(p);while(p.eUp.Org===d);if(p.fixUpperEdge){if(y=h.mesh.connect(P.regionBelow(p).eUp.Sym,p.eUp.Lnext),y===null)return null;P.fixUpperEdge(h,p,y),p=P.regionAbove(p);}return p;},P.topRightRegion=function(h){var p=h.eUp.Dst;do h=P.regionAbove(h);while(h.eUp.Dst===p);return h;},P.addRegionBelow=function(h,p,d){var y=new S();return y.eUp=d,y.nodeUp=h.dict.insertBefore(p.nodeUp,y),y.fixUpperEdge=!1,y.sentinel=!1,y.dirty=!1,d.activeRegion=y,y;},P.isWindingInside=function(h,p){switch(h.windingRule){case r.WINDING_ODD:return(p&1)!==0;case r.WINDING_NONZERO:return p!==0;case r.WINDING_POSITIVE:return p>0;case r.WINDING_NEGATIVE:return p<0;case r.WINDING_ABS_GEQ_TWO:return p>=2||p<=-2;}return i(!1),!1;},P.computeWinding=function(h,p){p.windingNumber=P.regionAbove(p).windingNumber+p.eUp.winding,p.inside=P.isWindingInside(h,p.windingNumber);},P.finishRegion=function(h,p){var d=p.eUp,y=d.Lface;y.inside=p.inside,y.anEdge=d,P.deleteRegion(h,p);},P.finishLeftRegions=function(h,p,d){for(var y,w,O=null,E=p,w=p.eUp;E!==d;){if(E.fixUpperEdge=!1,O=P.regionBelow(E),y=O.eUp,y.Org!=w.Org){if(!O.fixUpperEdge){P.finishRegion(h,E);break;}y=h.mesh.connect(w.Lprev,y.Sym),P.fixUpperEdge(h,O,y);}w.Onext!==y&&(h.mesh.splice(y.Oprev,y),h.mesh.splice(w,y)),P.finishRegion(h,E),w=O.eUp,E=O;}return w;},P.addRightEdges=function(h,p,d,y,O,E){var w,B,A,b,W=!0;A=d;do i(n.vertLeq(A.Org,A.Dst)),P.addRegionBelow(h,p,A.Sym),A=A.Onext;while(A!==y);for(O===null&&(O=P.regionBelow(p).eUp.Rprev),B=p,b=O;w=P.regionBelow(B),A=w.eUp.Sym,A.Org===b.Org;)A.Onext!==b&&(h.mesh.splice(A.Oprev,A),h.mesh.splice(b.Oprev,A)),w.windingNumber=B.windingNumber-A.winding,w.inside=P.isWindingInside(h,w.windingNumber),B.dirty=!0,!W&&P.checkForRightSplice(h,B)&&(P.addWinding(A,b),P.deleteRegion(h,B),h.mesh["delete"](b)),W=!1,B=w,b=A;B.dirty=!0,i(B.windingNumber-A.winding===w.windingNumber),E&&P.walkDirtyRegions(h,B);},P.spliceMergeVertices=function(h,p,d){h.mesh.splice(p,d);},P.vertexWeights=function(h,p,d){var y=n.vertL1dist(p,h),O=n.vertL1dist(d,h),E=0.5*O/(y+O),w=0.5*y/(y+O);h.coords[0]+=E*p.coords[0]+w*d.coords[0],h.coords[1]+=E*p.coords[1]+w*d.coords[1],h.coords[2]+=E*p.coords[2]+w*d.coords[2];},P.getIntersectData=function(h,p,d,y,O,E){p.coords[0]=p.coords[1]=p.coords[2]=0,p.idx=-1,P.vertexWeights(p,d,y),P.vertexWeights(p,O,E);},P.checkForRightSplice=function(h,p){var d=P.regionBelow(p),y=p.eUp,O=d.eUp;if(n.vertLeq(y.Org,O.Org)){if(n.edgeSign(O.Dst,y.Org,O.Org)>0)return!1;n.vertEq(y.Org,O.Org)?y.Org!==O.Org&&(h.pq["delete"](y.Org.pqHandle),P.spliceMergeVertices(h,O.Oprev,y)):(h.mesh.splitEdge(O.Sym),h.mesh.splice(y,O.Oprev),p.dirty=d.dirty=!0);}else{if(n.edgeSign(y.Dst,O.Org,y.Org)<0)return!1;P.regionAbove(p).dirty=p.dirty=!0,h.mesh.splitEdge(y.Sym),h.mesh.splice(O.Oprev,y);}return!0;},P.checkForLeftSplice=function(h,p){var d=P.regionBelow(p),y=p.eUp,O=d.eUp,E;if(i(!n.vertEq(y.Dst,O.Dst)),n.vertLeq(y.Dst,O.Dst)){if(n.edgeSign(y.Dst,O.Dst,y.Org)<0)return!1;P.regionAbove(p).dirty=p.dirty=!0,E=h.mesh.splitEdge(y),h.mesh.splice(O.Sym,E),E.Lface.inside=p.inside;}else{if(n.edgeSign(O.Dst,y.Dst,O.Org)>0)return!1;p.dirty=d.dirty=!0,E=h.mesh.splitEdge(O),h.mesh.splice(y.Lnext,O.Sym),E.Rface.inside=p.inside;}return!0;},P.checkForIntersect=function(h,p){var d=P.regionBelow(p),y=p.eUp,O=d.eUp,E=y.Org,w=O.Org,B=y.Dst,A=O.Dst,b,W,D=new l(),R,j;if(i(!n.vertEq(A,B)),i(n.edgeSign(B,h.event,E)<=0),i(n.edgeSign(A,h.event,w)>=0),i(E!==h.event&&w!==h.event),i(!p.fixUpperEdge&&!d.fixUpperEdge),E===w||(b=Math.min(E.t,B.t),W=Math.max(w.t,A.t),b>W))return!1;if(n.vertLeq(E,w)){if(n.edgeSign(A,E,w)>0)return!1;}else if(n.edgeSign(B,w,E)<0)return!1;return P.debugEvent(h),n.intersect(B,E,A,w,D),i(Math.min(E.t,B.t)<=D.t),i(D.t<=Math.max(w.t,A.t)),i(Math.min(A.s,B.s)<=D.s),i(D.s<=Math.max(w.s,E.s)),n.vertLeq(D,h.event)&&(D.s=h.event.s,D.t=h.event.t),R=n.vertLeq(E,w)?E:w,n.vertLeq(R,D)&&(D.s=R.s,D.t=R.t),n.vertEq(D,E)||n.vertEq(D,w)?(P.checkForRightSplice(h,p),!1):!n.vertEq(B,h.event)&&n.edgeSign(B,h.event,D)>=0||!n.vertEq(A,h.event)&&n.edgeSign(A,h.event,D)<=0?A===h.event?(h.mesh.splitEdge(y.Sym),h.mesh.splice(O.Sym,y),p=P.topLeftRegion(h,p),y=P.regionBelow(p).eUp,P.finishLeftRegions(h,P.regionBelow(p),d),P.addRightEdges(h,p,y.Oprev,y,y,!0),!0):B===h.event?(h.mesh.splitEdge(O.Sym),h.mesh.splice(y.Lnext,O.Oprev),d=p,p=P.topRightRegion(p),j=P.regionBelow(p).eUp.Rprev,d.eUp=O.Oprev,O=P.finishLeftRegions(h,d,null),P.addRightEdges(h,p,O.Onext,y.Rprev,j,!0),!0):(n.edgeSign(B,h.event,D)>=0&&(P.regionAbove(p).dirty=p.dirty=!0,h.mesh.splitEdge(y.Sym),y.Org.s=h.event.s,y.Org.t=h.event.t),n.edgeSign(A,h.event,D)<=0&&(p.dirty=d.dirty=!0,h.mesh.splitEdge(O.Sym),O.Org.s=h.event.s,O.Org.t=h.event.t),!1):(h.mesh.splitEdge(y.Sym),h.mesh.splitEdge(O.Sym),h.mesh.splice(O.Oprev,y),y.Org.s=D.s,y.Org.t=D.t,y.Org.pqHandle=h.pq.insert(y.Org),P.getIntersectData(h,y.Org,E,B,w,A),P.regionAbove(p).dirty=p.dirty=d.dirty=!0,!1);},P.walkDirtyRegions=function(h,p){for(var d=P.regionBelow(p),y,O;;){for(;d.dirty;)p=d,d=P.regionBelow(d);if(!p.dirty&&(d=p,p=P.regionAbove(p),p===null||!p.dirty))return;if(p.dirty=!1,y=p.eUp,O=d.eUp,y.Dst!==O.Dst&&P.checkForLeftSplice(h,p)&&(d.fixUpperEdge?(P.deleteRegion(h,d),h.mesh["delete"](O),d=P.regionBelow(p),O=d.eUp):p.fixUpperEdge&&(P.deleteRegion(h,p),h.mesh["delete"](y),p=P.regionAbove(d),y=p.eUp)),y.Org!==O.Org)if(y.Dst!==O.Dst&&!p.fixUpperEdge&&!d.fixUpperEdge&&(y.Dst===h.event||O.Dst===h.event)){if(P.checkForIntersect(h,p))return;}else P.checkForRightSplice(h,p);y.Org===O.Org&&y.Dst===O.Dst&&(P.addWinding(O,y),P.deleteRegion(h,p),h.mesh["delete"](y),p=P.regionAbove(d));}},P.connectRightVertex=function(h,p,d){var y,O=d.Onext,E=P.regionBelow(p),w=p.eUp,B=E.eUp,A=!1;if(w.Dst!==B.Dst&&P.checkForIntersect(h,p),n.vertEq(w.Org,h.event)&&(h.mesh.splice(O.Oprev,w),p=P.topLeftRegion(h,p),O=P.regionBelow(p).eUp,P.finishLeftRegions(h,P.regionBelow(p),E),A=!0),n.vertEq(B.Org,h.event)&&(h.mesh.splice(d,B.Oprev),d=P.finishLeftRegions(h,E,null),A=!0),A){P.addRightEdges(h,p,d.Onext,O,O,!0);return;}n.vertLeq(B.Org,w.Org)?y=B.Oprev:y=w,y=h.mesh.connect(d.Lprev,y),P.addRightEdges(h,p,y,y.Onext,y.Onext,!1),y.Sym.activeRegion.fixUpperEdge=!0,P.walkDirtyRegions(h,p);},P.connectLeftDegenerate=function(h,p,d){var y,O,E,w,B;if(y=p.eUp,n.vertEq(y.Org,d)){i(!1/*TOLERANCE_NONZERO*/),P.spliceMergeVertices(h,y,d.anEdge);return;}if(!n.vertEq(y.Dst,d)){h.mesh.splitEdge(y.Sym),p.fixUpperEdge&&(h.mesh["delete"](y.Onext),p.fixUpperEdge=!1),h.mesh.splice(d.anEdge,y),P.sweepEvent(h,d);return;}i(!1/*TOLERANCE_NONZERO*/),p=P.topRightRegion(p),B=P.regionBelow(p),E=B.eUp.Sym,O=w=E.Onext,B.fixUpperEdge&&(i(O!==E),P.deleteRegion(h,B),h.mesh["delete"](E),E=O.Oprev),h.mesh.splice(d.anEdge,E),n.edgeGoesLeft(O)||(O=null),P.addRightEdges(h,p,E.Onext,w,O,!0);},P.connectLeftVertex=function(h,p){var d,y,O,E,w,B,A=new S();if(A.eUp=p.anEdge.Sym,d=h.dict.search(A).key,y=P.regionBelow(d),!!y){if(E=d.eUp,w=y.eUp,n.edgeSign(E.Dst,p,E.Org)===0){P.connectLeftDegenerate(h,d,p);return;}if(O=n.vertLeq(w.Dst,E.Dst)?d:y,d.inside||O.fixUpperEdge){if(O===d)B=h.mesh.connect(p.anEdge.Sym,E.Lnext);else{var b=h.mesh.connect(w.Dnext,p.anEdge);B=b.Sym;}O.fixUpperEdge?P.fixUpperEdge(h,O,B):P.computeWinding(h,P.addRegionBelow(h,d,B)),P.sweepEvent(h,p);}else P.addRightEdges(h,d,p.anEdge,p.anEdge,null,!0);}},P.sweepEvent=function(h,p){h.event=p,P.debugEvent(h);for(var d=p.anEdge;d.activeRegion===null;)if(d=d.Onext,d===p.anEdge){P.connectLeftVertex(h,p);return;}var y=P.topLeftRegion(h,d.activeRegion);i(y!==null);var O=P.regionBelow(y),E=O.eUp,w=P.finishLeftRegions(h,O,null);w.Onext===E?P.connectRightVertex(h,y,w):P.addRightEdges(h,y,w.Onext,E,E,!0);},P.addSentinel=function(h,p,d,y){var O=new S(),E=h.mesh.makeEdge();E.Org.s=d,E.Org.t=y,E.Dst.s=p,E.Dst.t=y,h.event=E.Dst,O.eUp=E,O.windingNumber=0,O.inside=!1,O.fixUpperEdge=!1,O.sentinel=!0,O.dirty=!1,O.nodeUp=h.dict.insert(O);},P.initEdgeDict=function(h){h.dict=new c(h,P.edgeLeq);var p=h.bmax[0]-h.bmin[0],d=h.bmax[1]-h.bmin[1],y=h.bmin[0]-p,O=h.bmax[0]+p,E=h.bmin[1]-d,w=h.bmax[1]+d;P.addSentinel(h,y,O,E),P.addSentinel(h,y,O,w);},P.doneEdgeDict=function(h){for(var p,d=0;(p=h.dict.min().key)!==null;)p.sentinel||(i(p.fixUpperEdge),i(++d===1)),i(p.windingNumber===0),P.deleteRegion(h,p);},P.removeDegenerateEdges=function(h){var p,d,y,O=h.mesh.eHead;for(p=O.next;p!==O;p=d)d=p.next,y=p.Lnext,n.vertEq(p.Org,p.Dst)&&p.Lnext.Lnext!==p&&(P.spliceMergeVertices(h,y,p),h.mesh["delete"](p),p=y,y=p.Lnext),y.Lnext===p&&(y!==p&&((y===d||y===d.Sym)&&(d=d.next),h.mesh["delete"](y)),(p===d||p===d.Sym)&&(d=d.next),h.mesh["delete"](p));},P.initPriorityQ=function(h){var p,d,y,O=0;for(y=h.mesh.vHead,d=y.next;d!==y;d=d.next)O++;for(O+=8,p=h.pq=new M(O,n.vertLeq),y=h.mesh.vHead,d=y.next;d!==y;d=d.next)d.pqHandle=p.insert(d);return d!==y?!1:(p.init(),!0);},P.donePriorityQ=function(h){h.pq=null;},P.removeDegenerateFaces=function(h,p){var d,y,O;for(d=p.fHead.next;d!==p.fHead;d=y)y=d.next,O=d.anEdge,i(O.Lnext!==O),O.Lnext.Lnext===O&&(P.addWinding(O.Onext,O),h.mesh["delete"](O));return!0;},P.computeInterior=function(h){var p,d;if(P.removeDegenerateEdges(h),!P.initPriorityQ(h))return!1;for(P.initEdgeDict(h);(p=h.pq.extractMin())!==null;){for(;d=h.pq.min(),!(d===null||!n.vertEq(d,p));)d=h.pq.extractMin(),P.spliceMergeVertices(h,p.anEdge,d.anEdge);P.sweepEvent(h,p);}return h.event=h.dict.min().key.eUp.Org,P.debugEvent(h),P.doneEdgeDict(h),P.donePriorityQ(h),P.removeDegenerateFaces(h,h.mesh)?(h.mesh.check(),!0):!1;};function T(){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;}T.prototype={dot_:function dot_(h,p){return h[0]*p[0]+h[1]*p[1]+h[2]*p[2];},normalize_:function normalize_(h){var p=h[0]*h[0]+h[1]*h[1]+h[2]*h[2];i(p>0),p=Math.sqrt(p),h[0]/=p,h[1]/=p,h[2]/=p;},longAxis_:function longAxis_(h){var p=0;return Math.abs(h[1])>Math.abs(h[0])&&(p=1),Math.abs(h[2])>Math.abs(h[p])&&(p=2),p;},computeNormal_:function computeNormal_(h){var p,d,y,O,E,w,B=[0,0,0],A=[0,0,0],b=[0,0,0],W=[0,0,0],D=[0,0,0],R=[null,null,null],j=[null,null,null],k=this.mesh.vHead,J;for(p=k.next,J=0;J<3;++J)O=p.coords[J],A[J]=O,j[J]=p,B[J]=O,R[J]=p;for(p=k.next;p!==k;p=p.next)for(J=0;J<3;++J)O=p.coords[J],O<A[J]&&(A[J]=O,j[J]=p),O>B[J]&&(B[J]=O,R[J]=p);if(J=0,B[1]-A[1]>B[0]-A[0]&&(J=1),B[2]-A[2]>B[J]-A[J]&&(J=2),A[J]>=B[J]){h[0]=0,h[1]=0,h[2]=1;return;}for(w=0,d=j[J],y=R[J],b[0]=d.coords[0]-y.coords[0],b[1]=d.coords[1]-y.coords[1],b[2]=d.coords[2]-y.coords[2],p=k.next;p!==k;p=p.next)W[0]=p.coords[0]-y.coords[0],W[1]=p.coords[1]-y.coords[1],W[2]=p.coords[2]-y.coords[2],D[0]=b[1]*W[2]-b[2]*W[1],D[1]=b[2]*W[0]-b[0]*W[2],D[2]=b[0]*W[1]-b[1]*W[0],E=D[0]*D[0]+D[1]*D[1]+D[2]*D[2],E>w&&(w=E,h[0]=D[0],h[1]=D[1],h[2]=D[2]);w<=0&&(h[0]=h[1]=h[2]=0,h[this.longAxis_(b)]=1);},checkOrientation_:function checkOrientation_(){var h,p,d=this.mesh.fHead,y,O=this.mesh.vHead,E;for(h=0,p=d.next;p!==d;p=p.next)if(E=p.anEdge,!(E.winding<=0))do h+=(E.Org.s-E.Dst.s)*(E.Org.t+E.Dst.t),E=E.Lnext;while(E!==p.anEdge);if(h<0){for(y=O.next;y!==O;y=y.next)y.t=-y.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
164
+ #include <stdlib.h>
165
+ extern int RandomSweep;
166
+ #define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
167
+ #define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
168
+ #else
169
+ #if defined(SLANTED_SWEEP) *//* The "feature merging" is not intended to be complete. There are
170
+ * special cases where edges are nearly parallel to the sweep line
171
+ * which are not implemented. The algorithm should still behave
172
+ * robustly (ie. produce a reasonable tesselation) in the presence
173
+ * of such edges, however it may miss features which could have been
174
+ * merged. We could minimize this effect by choosing the sweep line
175
+ * direction to be something unusual (ie. not parallel to one of the
176
+ * coordinate axes).
177
+ *//* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
178
+ #define S_UNIT_Y (TESSreal)0.86052074622010633
179
+ #else
180
+ #define S_UNIT_X (TESSreal)1.0
181
+ #define S_UNIT_Y (TESSreal)0.0
182
+ #endif
183
+ #endif*//* Determine the polygon normal and project vertices onto the plane
184
+ * of the polygon.
185
+ */projectPolygon_:function projectPolygon_(){var h,p=this.mesh.vHead,d=[0,0,0],y,O,E,w,B=!1;for(d[0]=this.normal[0],d[1]=this.normal[1],d[2]=this.normal[2],d[0]===0&&d[1]===0&&d[2]===0&&(this.computeNormal_(d),B=!0),y=this.sUnit,O=this.tUnit,E=this.longAxis_(d),y[E]=0,y[(E+1)%3]=1,y[(E+2)%3]=0,O[E]=0,O[(E+1)%3]=0,O[(E+2)%3]=d[E]>0?1:-1,h=p.next;h!==p;h=h.next)h.s=this.dot_(h.coords,y),h.t=this.dot_(h.coords,O);for(B&&this.checkOrientation_(),w=!0,h=p.next;h!==p;h=h.next)w?(this.bmin[0]=this.bmax[0]=h.s,this.bmin[1]=this.bmax[1]=h.t,w=!1):(h.s<this.bmin[0]&&(this.bmin[0]=h.s),h.s>this.bmax[0]&&(this.bmax[0]=h.s),h.t<this.bmin[1]&&(this.bmin[1]=h.t),h.t>this.bmax[1]&&(this.bmax[1]=h.t));},addWinding_:function addWinding_(h,p){h.winding+=p.winding,h.Sym.winding+=p.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
186
+ * (what else would it do??) The region must consist of a single
187
+ * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
188
+ * case means that any vertical line intersects the interior of the
189
+ * region in a single interval.
190
+ *
191
+ * Tessellation consists of adding interior edges (actually pairs of
192
+ * half-edges), to split the region into non-overlapping triangles.
193
+ *
194
+ * The basic idea is explained in Preparata and Shamos (which I don''t
195
+ * have handy right now), although their implementation is more
196
+ * complicated than this one. The are two edge chains, an upper chain
197
+ * and a lower chain. We process all vertices from both chains in order,
198
+ * from right to left.
199
+ *
200
+ * The algorithm ensures that the following invariant holds after each
201
+ * vertex is processed: the untessellated region consists of two
202
+ * chains, where one chain (say the upper) is a single edge, and
203
+ * the other chain is concave. The left vertex of the single edge
204
+ * is always to the left of all vertices in the concave chain.
205
+ *
206
+ * Each step consists of adding the rightmost unprocessed vertex to one
207
+ * of the two chains, and forming a fan of triangles from the rightmost
208
+ * of two chain endpoints. Determining whether we can add each triangle
209
+ * to the fan is a simple orientation test. By making the fan as large
210
+ * as possible, we restore the invariant (check it yourself).
211
+ */// int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
212
+ tessellateMonoRegion_:function tessellateMonoRegion_(h,p){var d,y;for(d=p.anEdge,i(d.Lnext!==d&&d.Lnext.Lnext!==d);n.vertLeq(d.Dst,d.Org);d=d.Lprev);for(;n.vertLeq(d.Org,d.Dst);d=d.Lnext);for(y=d.Lprev;d.Lnext!==y;)if(n.vertLeq(d.Dst,y.Org)){for(;y.Lnext!==d&&(n.edgeGoesLeft(y.Lnext)||n.edgeSign(y.Org,y.Dst,y.Lnext.Dst)<=0);){var O=h.connect(y.Lnext,y);y=O.Sym;}y=y.Lprev;}else{for(;y.Lnext!==d&&(n.edgeGoesRight(d.Lprev)||n.edgeSign(d.Dst,d.Org,d.Lprev.Org)>=0);){var O=h.connect(d,d.Lprev);d=O.Sym;}d=d.Lnext;}for(i(y.Lnext!==d);y.Lnext.Lnext!==d;){var O=h.connect(y.Lnext,y);y=O.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
213
+ * the mesh which is marked "inside" the polygon. Each such region
214
+ * must be monotone.
215
+ *///int tessMeshTessellateInterior( TESSmesh *mesh )
216
+ tessellateInterior_:function tessellateInterior_(h){var p,d;for(p=h.fHead.next;p!==h.fHead;p=d)if(d=p.next,p.inside&&!this.tessellateMonoRegion_(h,p))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
217
+ * which are not marked "inside" the polygon. Since further mesh operations
218
+ * on NULL faces are not allowed, the main purpose is to clean up the
219
+ * mesh so that exterior loops are not represented in the data structure.
220
+ *///void tessMeshDiscardExterior( TESSmesh *mesh )
221
+ discardExterior_:function discardExterior_(h){var p,d;for(p=h.fHead.next;p!==h.fHead;p=d)d=p.next,p.inside||h.zapFace(p);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
222
+ * winding numbers on all edges so that regions marked "inside" the
223
+ * polygon have a winding number of "value", and regions outside
224
+ * have a winding number of 0.
225
+ *
226
+ * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
227
+ * separate an interior region from an exterior one.
228
+ */// int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
229
+ setWindingNumber_:function setWindingNumber_(h,p,d){var y,O;for(y=h.eHead.next;y!==h.eHead;y=O)O=y.next,y.Rface.inside!==y.Lface.inside?y.winding=y.Lface.inside?p:-p:d?h["delete"](y):y.winding=0;},getNeighbourFace_:function getNeighbourFace_(h){return!h.Rface||!h.Rface.inside?-1:h.Rface.n;},outputPolymesh_:function outputPolymesh_(h,p,d,y){var O,E,w,B=0,A=0,b,W;for(d>3&&h.mergeConvexFaces(d),O=h.vHead.next;O!==h.vHead;O=O.next)O.n=-1;for(E=h.fHead.next;E!==h.fHead;E=E.next)if(E.n=-1,!!E.inside){w=E.anEdge,b=0;do O=w.Org,O.n===-1&&(O.n=A,A++),b++,w=w.Lnext;while(w!==E.anEdge);i(b<=d),E.n=B,++B;}for(this.elementCount=B,p===r.CONNECTED_POLYGONS&&(B*=2),this.elements=[],this.elements.length=B*d,this.vertexCount=A,this.vertices=[],this.vertices.length=A*y,this.vertexIndices=[],this.vertexIndices.length=A,O=h.vHead.next;O!==h.vHead;O=O.next)if(O.n!==-1){var D=O.n*y;this.vertices[D+0]=O.coords[0],this.vertices[D+1]=O.coords[1],y>2&&(this.vertices[D+2]=O.coords[2]),this.vertexIndices[O.n]=O.idx;}var R=0;for(E=h.fHead.next;E!==h.fHead;E=E.next)if(E.inside){w=E.anEdge,b=0;do O=w.Org,this.elements[R++]=O.n,b++,w=w.Lnext;while(w!==E.anEdge);for(W=b;W<d;++W)this.elements[R++]=-1;if(p===r.CONNECTED_POLYGONS){w=E.anEdge;do this.elements[R++]=this.getNeighbourFace_(w),w=w.Lnext;while(w!==E.anEdge);for(W=b;W<d;++W)this.elements[R++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
230
+ outputContours_:function outputContours_(h,p){var d,y,O,E=0,w=0;for(this.vertexCount=0,this.elementCount=0,d=h.fHead.next;d!==h.fHead;d=d.next)if(d.inside){O=y=d.anEdge;do this.vertexCount++,y=y.Lnext;while(y!==O);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*p,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var B=0,A=0,b=0;for(E=0,d=h.fHead.next;d!==h.fHead;d=d.next)if(d.inside){w=0,O=y=d.anEdge;do this.vertices[B++]=y.Org.coords[0],this.vertices[B++]=y.Org.coords[1],p>2&&(this.vertices[B++]=y.Org.coords[2]),this.vertexIndices[A++]=y.Org.idx,w++,y=y.Lnext;while(y!==O);this.elements[b++]=E,this.elements[b++]=w,E+=w;}},addContour:function addContour(h,p){var d,y;for(this.mesh===null&&(this.mesh=new f()),h<2&&(h=2),h>3&&(h=3),d=null,y=0;y<p.length;y+=h)d===null?(d=this.mesh.makeEdge(),this.mesh.splice(d,d.Sym)):(this.mesh.splitEdge(d),d=d.Lnext),d.Org.coords[0]=p[y+0],d.Org.coords[1]=p[y+1],h>2?d.Org.coords[2]=p[y+2]:d.Org.coords[2]=0,d.Org.idx=this.vertexIndexCounter++,d.winding=1,d.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
231
+ tesselate:function tesselate(h,p,d,y,O){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,O&&(this.normal[0]=O[0],this.normal[1]=O[1],this.normal[2]=O[2]),this.windingRule=h,y<2&&(y=2),y>3&&(y=3),!this.mesh)return!1;this.projectPolygon_(),P.computeInterior(this);var E=this.mesh;return p===r.BOUNDARY_CONTOURS?this.setWindingNumber_(E,1,!0):this.tessellateInterior_(E),E.check(),p===r.BOUNDARY_CONTOURS?this.outputContours_(E,y):this.outputPolymesh_(E,p,d,y),!0;}};},/* 62 *//***/function(u,e){u.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var n={},i=0;i<arguments.length;i++){var l=arguments[i];for(var o in l)t.call(l,o)&&(n[o]=l[o]);}return n;}},/* 63 *//***/function(u,e,t){t.r(e),t.d(e,"createShaders",function(){return a;}),t.d(e,"applyShader",function(){return f;}),t.d(e,"createCloudShaders",function(){return c;}),t.d(e,"applyCloudShader",function(){return m;});var r=t(64),n=t(65),i=t(66),l=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function a(x){x[o]=[];for(var M=0;M<16;M++){var S=[],P=!!(M&1),_T10=!!(M&2),_h10=!!(M&4),p=!!(M&8);P&&S.push("#define TEXTURE 1"),_T10&&S.push("#define FILTER 1"),_h10&&S.push("#define GRADIENT 1"),p&&S.push("#define CLIPPATH 1");var d="".concat(S.join("\n"),"\n"),y=[];P&&y.push("uniform sampler2D u_texSampler;"),p&&y.push("uniform sampler2D u_clipSampler;"),x[o][M]=[d+y.join("\n")+n["default"],d+r["default"]];}}function f(x){var _ref94=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref94$hasTexture=_ref94.hasTexture,M=_ref94$hasTexture===void 0?!1:_ref94$hasTexture,_ref94$hasFilter=_ref94.hasFilter,S=_ref94$hasFilter===void 0?!1:_ref94$hasFilter,_ref94$hasGradient=_ref94.hasGradient,P=_ref94$hasGradient===void 0?!1:_ref94$hasGradient,_ref94$hasClipPath=_ref94.hasClipPath,T=_ref94$hasClipPath===void 0?!1:_ref94$hasClipPath;var h=M|S<<1|P<<2|T<<3;var p=x[o][h];Array.isArray(p)&&(p=x.createProgram.apply(x,_toConsumableArray(p)),x[o][h]=p),x.program!==p&&x.useProgram(p,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var g=[];function c(x){for(var M=0;M<64;M++){var S=[],P=!!(M&1),_T11=!!(M&2),_h11=!!(M&4),p=!!(M&8),d=!!(M&16),y=!!(M&32);P&&S.push("#define TEXTURE 1"),_T11&&S.push("#define FILTER 1"),_h11&&S.push("#define GRADIENT 1"),p&&S.push("#define CLOUDCOLOR 1"),d&&S.push("#define CLOUDFILTER 1"),y&&S.push("#define CLIPPATH 1");var O="".concat(S.join("\n"),"\n"),E=[];if(P){E.push("uniform sampler2D u_texSampler;");for(var w=0;w<12;w++)E.push("uniform sampler2D u_texFrame".concat(w,";"));}y&&E.push("uniform sampler2D u_clipSampler;"),g[M]=[O+E.join("\n")+l["default"],O+i["default"]];}}function m(x){var _ref95=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,M=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,S=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,P=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasCloudColor=_ref95.hasCloudColor,T=_ref95$hasCloudColor===void 0?!1:_ref95$hasCloudColor,_ref95$hasCloudFilter=_ref95.hasCloudFilter,h=_ref95$hasCloudFilter===void 0?!1:_ref95$hasCloudFilter,_ref95$hasClipPath=_ref95.hasClipPath,p=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var d=M|S<<1|P<<2|T<<3|h<<4|p<<5;var y=g[d];Array.isArray(y)&&(y=x.createProgram.apply(x,_toConsumableArray(y)),g[d]=y),x.program!==y&&x.useProgram(y,{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(u,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(u,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(u,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(u,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(u,e,t){t.r(e),function(r,n){t.d(e,"requestAnimationFrame",function(){return l;}),t.d(e,"cancelAnimationFrame",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(r)<"u"&&r.hrtime){var _r$hrtime=r.hrtime(),_r$hrtime2=_slicedToArray(_r$hrtime,2),a=_r$hrtime2[0],f=_r$hrtime2[1];return a*1e3+f*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var l,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(l=n.requestAnimationFrame,o=n.cancelAnimationFrame):(l=function l(a){return setTimeout(function(){a(i());},16);},o=function o(a){return clearTimeout(a);});}.call(this,t(69),t(22));},/* 69 *//***/function(u,e){var t=u.exports={},r,n;function i(){throw new Error("setTimeout has not been defined");}function l(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=i;}catch(_unused4){r=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=l;}catch(_unused5){n=l;}})();function o(T){if(r===setTimeout)return setTimeout(T,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(T,0);try{return r(T,0);}catch(_unused6){try{return r.call(null,T,0);}catch(_unused7){return r.call(this,T,0);}}}function a(T){if(n===clearTimeout)return clearTimeout(T);if((n===l||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{return n(T);}catch(_unused8){try{return n.call(null,T);}catch(_unused9){return n.call(this,T);}}}var f=[],g=!1,c,m=-1;function x(){!g||!c||(g=!1,c.length?f=c.concat(f):m=-1,f.length&&M());}function M(){if(!g){var T=o(x);g=!0;for(var h=f.length;h;){for(c=f,f=[];++m<h;)c&&c[m].run();m=-1,h=f.length;}c=null,g=!1,a(T);}}t.nextTick=function(T){var h=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)h[p-1]=arguments[p];f.push(new S(T,h)),f.length===1&&!g&&o(M);};function S(T,h){this.fun=T,this.array=h;}S.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function P(){}t.on=P,t.addListener=P,t.once=P,t.off=P,t.removeListener=P,t.removeAllListeners=P,t.emit=P,t.prependListener=P,t.prependOnceListener=P,t.listeners=function(T){return[];},t.binding=function(T){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(T){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return w;});var r=t(1),n=t(71),i=t(73),l=t(213),o=t(214),a=t(215),f=t(216);t(1).glMatrix.setMatrixArrayType(Array);function g(B,A){var b=Object.keys(B);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(B);A&&(W=W.filter(function(D){return Object.getOwnPropertyDescriptor(B,D).enumerable;})),b.push.apply(b,W);}return b;}function c(B){for(var A=1;A<arguments.length;A++){var b=arguments[A]!=null?arguments[A]:{};A%2?g(Object(b),!0).forEach(function(W){m(B,W,b[W]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(B,Object.getOwnPropertyDescriptors(b)):g(Object(b)).forEach(function(W){Object.defineProperty(B,W,Object.getOwnPropertyDescriptor(b,W));});}return B;}function m(B,A,b){return A in B?Object.defineProperty(B,A,{value:b,enumerable:!0,configurable:!0,writable:!0}):B[A]=b,B;}var x=Symbol["for"]("spritejs_changedAttrs"),M=Symbol["for"]("spritejs_attributes"),S=Symbol("resolution"),P=Symbol("animations"),T=Symbol("eventListeners"),h=Symbol("captureEventListeners"),p=Symbol("filters"),d=Symbol("display"),y=Symbol("program"),O=Symbol("shaderAttrs"),E=Symbol("uniforms");var w=/*#__PURE__*/function(){function w(){var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,w);this.attributes=new this.constructor.Attr(this),this[S]={width:300,height:150},Object.assign(this.attributes,A),this[P]=/* @__PURE__ */new Set(),this[T]={},this[h]={};}return _createClass(w,[{key:"ancestors",get:function get(){var A=this.parent;var b=[];for(;A;)b.push(A),A=A.parent;return b;}},{key:"animations",get:function get(){return this[P];}},{key:"filters",get:function get(){return this[p]||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 A=this.transformMatrix,_this$attributes=this.attributes,b=_this$attributes.x,W=_this$attributes.y;return A[4]+=b,A[5]+=W,A;}},{key:"opacity",get:function get(){var A=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(A*=this.parent.opacity),A;}},{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[y];}/* 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 A=this.localMatrix;var b=this.parent;if(b){var W=b.__cacheRenderMatrix||b.renderMatrix;W&&(A=r.mat2d.multiply(Array.of(0,0,0,0,0,0),W,A));}return A;}},{key:"worldScaling",get:function get(){var A=this.renderMatrix;return[Math.hypot(A[0],A[1]),Math.hypot(A[2],A[3])];}},{key:"worldRotation",get:function get(){var A=this.renderMatrix;return Math.atan2(A[1],A[3]);}},{key:"worldPosition",get:function get(){var A=this.renderMatrix;return[A[4],A[5]];}},{key:"uniforms",get:function get(){return this[E];}/* get zOrder defined by connect method *//* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(A){this.attributes.className=A;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(A){this.attributes.id=A;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(A){this.attributes.name=A;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(A){this.attributes.zIndex=A;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[O]||{};}},{key:"activateAnimations",value:function activateAnimations(){var A=this.layer;if(A){var b=this[P];b.forEach(function(D){D.baseTimeline=A.timeline,D.play(),D.finished.then(function(){b["delete"](D);});});var W=this.children;W&&W.forEach(function(D){D.activateAnimations&&D.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(A,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};A==="mousewheel"&&(A="wheel"),typeof W=="boolean"&&(W={capture:W});var _W8=W,D=_W8.capture,R=_W8.once,j=D?h:T;return this[j][A]=this[j][A]||[],this[j][A].push({listener:b,once:R}),this;}},{key:"animate",value:function animate(A,b){var _this21=this;var W=new i["default"](this,A,b);return this.effects&&W.applyEffects(this.effects),this.layer&&(W.baseTimeline=this.layer.timeline,W.play(),W.finished.then(function(){_this21[P]["delete"](W);})),this[P].add(W),W;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,A=new Array(_len7),_key7=0;_key7<_len7;_key7++){A[_key7]=arguments[_key7];}if(A.length===0)return this.attributes[M];if(A.length>1){var b=A[0],W=A[1];return typeof W=="function"&&(W=W(this.attr(b))),this.setAttribute(b,W),this;}return typeof A[0]=="string"?this.getAttribute(A[0]):(Object.assign(this.attributes,A[0]),this);}},{key:"cloneNode",value:function cloneNode(){var A=new this.constructor(),b=this.attributes[x];return A.attr(b),A;}},{key:"connect",value:function connect(A,b){Object.defineProperty(this,"parent",{value:A,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:b,writable:!1,configurable:!0}),A.timeline&&this.activateAnimations(),this.setResolution(A.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:A,zOrder:b}});}},{key:"contains",value:function contains(A){for(;A&&this!==A;)A=A.parent;return!!A;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[P].forEach(function(b){return b.cancel();});var A=this.children;A&&A.forEach(function(b){b.deactivateAnimations&&b.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var A=this.parent,b=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:A,zOrder:b}}),A&&A.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(A){var _this22=this;A instanceof o["default"]||(A=new o["default"](A)),A.target=this;var b=A.type;b==="mousewheel"&&(b="wheel");var W=[this];var D=this.parent;for(;A.bubbles&&D;)W.push(D),D=D.parent;for(var R=W.length-1;R>=0;R--){var j=W[R],k=j[h]&&j[h][b];if(k&&k.length&&(A.currentTarget=j,k.forEach(function(_ref96){var J=_ref96.listener,rt=_ref96.once;J.call(_this22,A),rt&&W.removeEventListener(J);}),delete A.currentTarget),!A.bubbles&&A.cancelBubble)break;}if(!A.cancelBubble)for(var _R4=0;_R4<W.length;_R4++){var _j=W[_R4],_k3=_j[T]&&_j[T][b];if(_k3&&_k3.length&&(A.currentTarget=_j,_k3.forEach(function(_ref97){var J=_ref97.listener,rt=_ref97.once;J.call(_this22,A),rt&&W.removeEventListener(J);}),delete A.currentTarget),!A.bubbles||A.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(A){var b=A.layerX,W=A.layerY;return this.isPointCollision(b,W)?(this.dispatchEvent(A),!0):!1;}},{key:"draw",value:function draw(){var _this23=this;var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var b=this.mesh;if(b){if(Object(a.applyFilters)(b,this.filters),A.push(b),this[y]){b.setProgram(this[y]);var W=this[O];W&&Object.entries(W).forEach(function(_ref98){var _ref99=_slicedToArray(_ref98,2),R=_ref99[0],j=_ref99[1];b.setAttribute(R,j);});var D=this[E];if(this[E]){var R={};Object.entries(D).forEach(function(_ref100){var _ref101=_slicedToArray(_ref100,2),j=_ref101[0],k=_ref101[1];typeof k=="function"&&(k=k(_this23,j)),R[j]=k;}),b.setUniforms(R);}}Object(f["default"])(this,b);}return A;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(A){return this.attributes[A];}},{key:"getListeners",value:function getListeners(A){var _ref102=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref102$capture=_ref102.capture,b=_ref102$capture===void 0?!1:_ref102$capture;return _toConsumableArray(this[b?h:T][A]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(A===0)return this;var b=this.parent.children,W=b.indexOf(this);return b[W+A];}},{key:"getWorldPosition",value:function getWorldPosition(A,b){var W=this.renderMatrix,D=A*W[0]+b*W[2]+W[4],R=A*W[1]+b*W[3]+W[5];return[D,R];}},{key:"getOffsetPosition",value:function getOffsetPosition(A,b){var W=r.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),D=A*W[0]+b*W[2]+W[4],R=A*W[1]+b*W[3]+W[5];return[D,R];}},{key:"getResolution",value:function getResolution(){return c({},this[S]);}},{key:"isPointCollision",value:function isPointCollision(A,b){if(!this.mesh)return!1;var W=this.attributes.pointerEvents;if(W==="none"||W!=="all"&&!this.isVisible)return!1;var D="both";return W==="visibleFill"&&(D="fill"),W==="visibleStroke"&&(D="stroke"),this.mesh.isPointCollision(A,b,D);}},{key:"onPropertyChange",value:function onPropertyChange(A,b,W){A!=="id"&&A!=="name"&&A!=="className"&&A!=="pointerEvents"&&A!=="passEvents"&&this.forceUpdate(),A==="filter"&&(this[p]=Object(a.parseFilterString)(b)),A==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(A,b){A==="attrs"&&this.attr(b),this.attributes[A]=b;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
232
+ },{key:"setProgram",value:function setProgram(A){this[y]=A,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(A,b){this[O]=this[O]||{},this[O][A]=b,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(A){this[E]=this[E]||{},Object.assign(this[E],A),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref103){var A=_ref103.width,b=_ref103.height;var _this$S3=this[S],W=_this$S3.width,D=_this$S3.height;(W!==A||D!==b)&&(this[S]={width:A,height:b},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:A,height:b}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[d]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[d]=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(A){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof b=="boolean"&&(b={capture:b});var D=b.capture?h:T;return this[D][A]&&(this[D][A]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(A){this.setAttribute(A,null);}},{key:"removeEventListener",value:function removeEventListener(A,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof W=="boolean"&&(W={capture:W});var R=W.capture?h:T;if(this[R][A]){var j=this[R][A];if(j)for(var k=0;k<j.length;k++){var J=j[k].listener;if(J===b){this[R][A].splice(k,1);break;}}}return this;}},{key:"transition",value:function transition(A){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var W=this,D=Symbol("animation");b=b||"linear";var R=0;return _typeof(A)=="object"&&(R=A.delay||0,A=A.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},D,null),"cancel",function cancel(){var j=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var k=this[D];k&&k.cancel(j);}),"end",function end(){var j=this[D];j&&(j.playState==="running"||j.playState==="pending")&&j.finish();}),"reverse",function reverse(){var j=this[D];if(j)if(j.playState==="running"||j.playState==="pending")j.playbackRate=-j.playbackRate;else{var k=j.timing.direction;j.timing.direction=k==="reverse"?"normal":"reverse",j.play();}return j.finished;}),"attr",function attr(j,k){return this.end(),typeof j=="string"&&(j=_defineProperty({},j,k)),Object.entries(j).forEach(function(_ref104){var _ref105=_slicedToArray(_ref104,2),J=_ref105[0],rt=_ref105[1];typeof rt=="function"&&(j[J]=rt(W.attr(J)));}),this[D]=W.animate([j],{duration:A*1e3,delay:R*1e3,fill:"forwards",easing:b}),this[D].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();m(w,"Attr",n["default"]),l["default"].registerNode(w,"node");},/* 71 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return w;});var r=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),a=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),g=Symbol["for"]("spritejs_attributes"),c=Symbol["for"]("spritejs_changedAttrs"),m=Symbol("subject"),x=Symbol("attr"),M=Symbol("default"),S=Symbol("alias");function P(B,_ref107){var _ref108=_slicedToArray(_ref107,2),A=_ref108[0],b=_ref108[1];var W=r.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(B).forEach(function(_ref109){var _ref110=_slicedToArray(_ref109,2),D=_ref110[0],R=_ref110[1];if((A||b)&&(W=r.mat2d.translate(Array.of(0,0,0,0,0,0),W,[A,b])),D==="matrix")W=r.mat2d.multiply(W,W,R);else if(D==="offsetTranslate")W[4]+=R[0],W[5]+=R[1];else if(D==="offsetRotate")W=r.mat2d.rotate(Array.of(0,0,0,0,0,0),W,R);else if(D==="skew"){var _R5=_slicedToArray(R,2),j=_R5[0],k=_R5[1];W=r.mat2d.multiply(W,W,r.mat2d.fromValues(1,Math.tan(k),Math.tan(j),1,0,0));}else r.mat2d[D](W,W,R);(A||b)&&(W=r.mat2d.translate(Array.of(0,0,0,0,0,0),W,[-A,-b]));}),W;}var T=Symbol("transformMatrix"),h=Symbol("transforms"),p=Symbol("changedAttrs"),d=Symbol("lastChangedAttr"),y=Symbol("offsetFigure");function O(B,A,b){var W=B[x][A];if(B[a](A,b,!1)||B[d]!==A){var R=B[h];R.has(A)&&R["delete"](A),b&&(A==="rotate"&&(b=Math.PI*b/180),A==="scale"&&(b=b.map(function(j){return Math.abs(j)>1e-5?j:1/j>0?1e-5:-1e-5;})),R.set(A,b)),B[T]=null,B[m].onPropertyChange(A,b,W,B);}}function E(B){var A=B[y],b=B.offsetDistance*A.getTotalLength(),W=A.getPointAtLength(b);if(W){var D=B[h];var R=B.offsetRotate;R==="auto"?R=W.angle:R==="reverse"?R=Math.PI+W.angle:R=Math.PI*R/180,D.set("offsetRotate",R),D.set("offsetTranslate",[W.x,W.y]),B[T]=null;}}var w=/*#__PURE__*/function(){function w(A){var _this24=this;_classCallCheck(this,w);this[m]=A,this[x]={},this[T]=r.mat2d.fromValues(1,0,0,1,0,0),this[h]=/* @__PURE__ */new Map(),this[M]={},this[S]=[],Object.defineProperty(A,"transformMatrix",{get:function get(){return _this24[T]||(_this24[T]=P(_this24[h],_this24.transformOrigin)),_toConsumableArray(_this24[T]);}}),this[l]({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
233
+ filter:"none",display:""}),this[o]("class","pos"),this[p]=/* @__PURE__ */new Set(),this[y]=new n.Figure2D({scale:5,simplify:0});}return _createClass(w,[{key:c,get:function get(){var _this25=this;var A={};return _toConsumableArray(this[p]).forEach(function(b){A[b]=_this25[x][b];}),A;}},{key:g,get:function get(){var A=Object.assign({},this[x]);for(var b=0;b<this[S].length;b++){var W=this[S][b];A[W]=this[W];}return A;}},{key:l,value:function value(A){Object.assign(this[M],A),Object.assign(this[x],A);}},{key:o,value:function value(){var _this$S4;(_this$S4=this[S]).push.apply(_this$S4,arguments);}},{key:a,value:function value(A,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var D=this[x][A],R=this[m];return b==null&&(b=this[M][A]),Object(i.compareValue)(D,b)?!1:(this[x][A]=b,this[p].has(A)&&this[p]["delete"](A),this[p].add(A),this[d]=A,W&&R.onPropertyChange(A,b,D,this),!0);}},{key:f,value:function value(A){return this[x][A];}},{key:"id",get:function get(){return this[f]("id");},set:function set(A){this[a]("id",A);}},{key:"name",get:function get(){return this[f]("name");},set:function set(A){this[a]("name",A);}},{key:"className",get:function get(){return this[f]("className");},set:function set(A){this[a]("className",A);}},{key:"class",get:function get(){return this.className;},set:function set(A){this.className=A;}},{key:"x",get:function get(){return this[f]("x");},set:function set(A){this[a]("x",Object(i.toNumber)(A));}},{key:"y",get:function get(){return this[f]("y");},set:function set(A){this[a]("y",Object(i.toNumber)(A));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(A){A=Object(i.toArray)(A),Array.isArray(A)||(A=[A,A]),this.x=A[0],this.y=A[1];}},{key:"transform",get:function get(){return this[f]("transform");},set:function set(A){var b=null;if(Array.isArray(A)&&(b=A,A="matrix(".concat(A.map(i.toNumber).join(),")")),typeof A=="string")A=A.replace(/\s*,\s*/g,",");else if(A!=null)throw new TypeError("Invalid transform value.");var W=this[x].transform;if(this[a]("transform",A,!1)){var D=this[h];if(D.has("matrix")&&D["delete"]("matrix"),b)D.set("matrix",b);else if(A){var R=A.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(R){var j=r.mat2d.fromValues(1,0,0,1,0,0);for(var k=0;k<R.length;k++){var rt=R[k].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(rt){var _rt2=_slicedToArray(rt,3),st=_rt2[1],$=_rt2[2];st==="rotate"?$=Math.PI*parseFloat($)/180:$=$.trim().split(/[\s,]+/).map(function(V){return Object(i.toNumber)(V);}),st==="matrix"?j=r.mat2d.multiply(j,j,$):st==="skew"?j=r.mat2d.multiply(j,j,r.mat2d.fromValues(1,Math.tan($[1]),Math.tan($[0]),1,0,0)):r.mat2d[st](j,j,$),D.set("matrix",j);}}}else throw new TypeError("Invalid transform value.");}this[T]=null,this[m].onPropertyChange("transform",A,W,this);}}},{key:"transformOrigin",get:function get(){return this[f]("transformOrigin");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),this[a]("transformOrigin",A)&&(this[T]=null);}},{key:"rotate",get:function get(){return this[f]("rotate");},set:function set(A){O(this,"rotate",A);}},{key:"translate",get:function get(){return this[f]("translate");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),O(this,"translate",A);}},{key:"scale",get:function get(){return this[f]("scale");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),O(this,"scale",A);}},{key:"skew",get:function get(){return this[f]("skew");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),O(this,"skew",A);}},{key:"opacity",get:function get(){return this[f]("opacity");},set:function set(A){A!=null&&(A=Number(A)),this[a]("opacity",A);}},{key:"zIndex",get:function get(){return this[f]("zIndex");},set:function set(A){A!=null&&(A=Number(A)),this[a]("zIndex",A);}},{key:"offsetPath",get:function get(){return this[f]("offsetPath");},set:function set(A){this[a]("offsetPath",A)&&(this[y].beginPath(),A!=null&&this[y].addPath(A),E(this));}},{key:"offsetDistance",get:function get(){return this[f]("offsetDistance");},set:function set(A){this[a]("offsetDistance",Object(i.toNumber)(A))&&E(this);}},{key:"offsetRotate",get:function get(){return this[f]("offsetRotate");},set:function set(A){this[a]("offsetRotate",A),E(this);}},{key:"pointerEvents",get:function get(){return this[f]("pointerEvents");},set:function set(A){if(A!=null&&A!=="none"&&A!=="visible"&&A!=="visibleFill"&&A!=="visibleStroke"&&A!=="all")throw new TypeError("Invalid pointerEvents type.");this[a]("pointerEvents",A);}},{key:"filter",get:function get(){return this[f]("filter");},set:function set(A){this[a]("filter",A);}},{key:"display",get:function get(){return this[f]("display");},set:function set(A){this[a]("display",A);}/* istanbul ignore next */},{key:"offset",set:function set(A){}}],[{key:"setDefault",value:function setDefault(A){for(var _len8=arguments.length,b=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){b[_key8-1]=arguments[_key8];}return A[l].apply(A,b);}},{key:"declareAlias",value:function declareAlias(A){for(var _len9=arguments.length,b=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){b[_key9-1]=arguments[_key9];}return A[o].apply(A,b);}},{key:"setAttribute",value:function setAttribute(A){for(var _len10=arguments.length,b=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){b[_key10-1]=arguments[_key10];}return A[a].apply(A,b);}},{key:"getAttribute",value:function getAttribute(A){for(var _len11=arguments.length,b=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){b[_key11-1]=arguments[_key11];}return A[f].apply(A,b);}},{key:"getAttributes",value:function getAttributes(A){return A[g];}},{key:"getChangedAttributes",value:function getChangedAttributes(A){return A[c];}}]);}();},/* 72 *//***/function(u,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 i;}),t.d(e,"toArray",function(){return l;}),t.d(e,"compareValue",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function r(a,f){var g=a.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);g?a={size:parseFloat(g[1]),unit:g[2]}:a={size:parseFloat(a),unit:"px"};var _a3=a,c=_a3.size,m=_a3.unit;if(m==="pt")c/=0.75;else if(m==="pc")c*=16;else if(m==="in")c*=96;else if(m==="cm")c*=96/2.54;else if(m==="mm")c*=96/25.4;else if(m==="em"||m==="rem"||m==="ex"){if(!f&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var x=getComputedStyle(document.documentElement).fontSize;x?f=r(x,16):f=16;}c*=f,m==="ex"&&(c/=2);}else if(m==="q")c*=96/25.4/4;else if(m==="vw"||m==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _x20=m==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;c*=_x20/100;}}else if((m==="vmax"||m==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _x21=window.innerWidth||document.documentElement.clientWidth,M=window.innerHeight||document.documentElement.clientHeight;m==="vmax"?c*=Math.max(_x21,M)/100:c*=Math.min(_x21,M)/100;}return c;}function n(a){return a==null?a:String(a);}function i(a){if(a==null)return a;if(typeof a=="string"&&(a=r(a)),!Number.isFinite(a))throw new TypeError("Invalid value");return a;}function l(a){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return a===""?null:(typeof a=="string"&&(a=a.split(/[\s,]+/g)),Array.isArray(a)&&(f&&(a=a.map(i)),a.length===1)?a[0]:a);}function o(a,f){if(Array.isArray(a)&&Array.isArray(f)){if(a.length!==f.length)return!1;for(var g=0;g<a.length;g++)if(a[g]!==f[g])return!1;return!0;}return a==null&&f==null||a===f;}},/* 73 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return m;});var r=t(74),n=t(32),i=/* @__PURE__ */t.n(n),l=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function a(){return a=Object.assign||function(x){for(var M=1;M<arguments.length;M++){var S=arguments[M];for(var P in S)Object.prototype.hasOwnProperty.call(S,P)&&(x[P]=S[P]);}return x;},a.apply(this,arguments);}function f(x){if(typeof x=="string"){if(x=x.trim(),/^[0-9.]+%$/.test(x))return parseFloat(x)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(x))return Object(o.sizeToPixel)(x);}return x;}function g(x,M,S,P,T){return typeof x=="string"&&(x=i()(x)),typeof M=="string"&&(M=i()(M)),r.Effects["default"](x,M,S,P,T);}function c(x,M,S,P,T){return r.Effects["default"](x,M,S,P,T);}r.Effects["default"]=function(x,M,S,P,T){return Array.isArray(x)&&Array.isArray(M)?x.map(function(h,p){return h+(S-P)/(T-P)*(M[p]-h);}):typeof x=="number"&&typeof M=="number"?x+(S-P)/(T-P)*(M-x):S-P>T-S?M:x;},r.Effects.fillColor=g,r.Effects.strokeColor=g,r.Effects.bgcolor=g,r.Effects.borderColor=g,r.Effects.text=c;var m=/*#__PURE__*/function(_r$Animator){function m(M,S,P){var _this26;_classCallCheck(this,m);var T=M.attr();Object.entries(T).forEach(function(_ref111){var _ref112=_slicedToArray(_ref111,2),h=_ref112[0],p=_ref112[1];T[h]=r.Effects[h]?p:f(p);}),S=S.map(function(h){var p=a({},h);var d={};return Object.entries(p).forEach(function(_ref113){var _ref114=_slicedToArray(_ref113,2),y=_ref114[0],O=_ref114[1];d[y]=r.Effects[y]?O:f(O);}),d;}),_this26=_callSuper(this,m,[T,S,P]),_this26.target=M,_this26.setter=function(h,p){p.attr(h);};return _this26;}_inherits(m,_r$Animator);return _createClass(m,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(m,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this27=this;return _superPropGet(m,"finished",this,1).then(function(){var M=_this27;return new Promise(function(S){function P(){M.setter(M.frame,M.target);var T=M.playState;T==="finished"||T==="idle"?(Object(l.cancelAnimationFrame)(M.requestId),S()):Object(l.requestAnimationFrame)(P);}P();});});}},{key:"finish",value:function finish(){_superPropGet(m,"finish",this,3)([]),Object(l.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(m,"play",this,3)([]),this.setter(this.frame,this.target);var M=this;this.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(l.requestAnimationFrame)(function S(){var P=M.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&P.layer&&P.layer.canvas&&!document.documentElement.contains(P.layer.canvas)){M.cancel();return;}var T=M.playState;M.setter(M.frame,M.target),T!=="idle"&&(T==="running"?M.requestId=Object(l.requestAnimationFrame)(S):(T==="paused"||T==="pending"&&M.timeline.currentTime<0)&&M.ready.then(function(){M.setter(M.frame,M.target),M.requestId=Object(l.requestAnimationFrame)(S);}));});});}},{key:"cancel",value:function cancel(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(l.cancelAnimationFrame)(this.requestId),M?(this.setter(this.frame,this.target),_superPropGet(m,"cancel",this,3)([])):(_superPropGet(m,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(r.Animator);},/* 74 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=e.Effects=e.Easings=e.Animator=void 0;var r=t(75),n=g(r),i=t(187),l=g(i),o=t(188),a=t(190),f=g(a);function g(c){return c&&c.__esModule?c:{"default":c};}e.Animator=f["default"],e.Easings=o.Easings,e.Effects=l["default"],e.Timeline=n["default"];},/* 75 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=h(r),i=t(133),l=h(i),o=t(141),a=h(o),f=t(164),g=h(f),c=t(170),m=h(c),x=t(171),M=h(x),S=t(175),P=h(S),T=t(186);function h(W){return W&&W.__esModule?W:{"default":W};}var p=(0,T.createNowTime)(),d={originTime:0,playbackRate:1},y=(0,P["default"])("timeMark"),O=(0,P["default"])("playbackRate"),E=(0,P["default"])("timers"),w=(0,P["default"])("originTime"),B=(0,P["default"])("setTimer"),A=(0,P["default"])("parent"),b=function(){function W(D,R){(0,m["default"])(this,W),D instanceof W&&(R=D,D={}),D=(0,g["default"])({},d,D),R&&(this[A]=R);var j=D.nowtime||p;if(R)Object.defineProperty(this,"globalTime",{get:function get(){return R.currentTime;}});else{var k=j();Object.defineProperty(this,"globalTime",{get:function get(){return j()-k;}});}this[y]=[{globalTime:this.globalTime,localTime:-D.originTime,entropy:-D.originTime,playbackRate:D.playbackRate,globalEntropy:0}],this[A]&&(this[y][0].globalEntropy=this[A].entropy),this[w]=D.originTime,this[O]=D.playbackRate,this[E]=new a["default"]();}return(0,M["default"])(W,[{key:"markTime",value:function value(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},j=R.time,k=j===void 0?this.currentTime:j,J=R.entropy,rt=J===void 0?this.entropy:J,st=R.playbackRate,$=st===void 0?this.playbackRate:st,V={globalTime:this.globalTime,localTime:k,entropy:rt,playbackRate:$,globalEntropy:this.globalEntropy};this[y].push(V);}},{key:"fork",value:function value(R){return new W(R,this);}},{key:"seekGlobalTime",value:function value(R){var j=this.seekTimeMark(R),k=this[y][j],J=k.entropy,rt=k.playbackRate,st=k.globalTime;return st+(R-J)/Math.abs(rt);}},{key:"seekLocalTime",value:function value(R){var j=this.seekTimeMark(R),k=this[y][j],J=k.localTime,rt=k.entropy,st=k.playbackRate;return st>0?J+(R-rt):J-(R-rt);}},{key:"seekTimeMark",value:function value(R){var j=this[y],k=0,J=j.length-1;if(R<=j[k].entropy)return k;if(R>=j[J].entropy)return J;for(var rt=Math.floor((k+J)/2);rt>k&&rt<J;){if(R===j[rt].entropy)return rt;R<j[rt].entropy?J=rt:R>j[rt].entropy&&(k=rt),rt=Math.floor((k+J)/2);}return k;}},{key:"updateTimers",value:function value(){var R=this,j=[].concat((0,l["default"])(this[E]));j.forEach(function(k){var J=(0,n["default"])(k,2),rt=J[0],st=J[1];R[B](st.handler,st.time,rt);});}},{key:"clearTimeout",value:function(D){function R(j){return D.apply(this,arguments);}return R.toString=function(){return D.toString();},R;}(function(D){var R=this[E].get(D);R&&R.timerID!=null&&(this[A]?this[A].clearTimeout(R.timerID):clearTimeout(R.timerID)),this[E]["delete"](D);})},{key:"clearInterval",value:function value(R){return this.clearTimeout(R);}},{key:"clear",value:function value(){var R=this,j=this[E];[].concat((0,l["default"])(j.keys())).forEach(function(k){R.clearTimeout(k);});}/*
234
+ setTimeout(func, {delay: 100, isEntropy: true})
235
+ setTimeout(func, {entropy: 100})
236
+ setTimeout(func, 100})
237
+ */},{key:"setTimeout",value:function value(R){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[B](R,j);}},{key:"setInterval",value:function value(R){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},k=this,J=this[B](function rt(){k[B](rt,j,J),R();},j);return J;}},{key:B,value:function value(R,j){var k=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,P["default"])("timerID");j=(0,T.formatDelay)(j);var rt=this[E].get(J),st=void 0,$=null,V=void 0,nt=void 0;rt?(this.clearTimeout(J),j.isEntropy?st=(j.delay-(this.entropy-rt.startEntropy))/Math.abs(this.playbackRate):st=(j.delay-(this.currentTime-rt.startTime))/this.playbackRate,V=rt.startTime,nt=rt.startEntropy):(st=j.delay/(j.isEntropy?Math.abs(this.playbackRate):this.playbackRate),V=this.currentTime,nt=this.entropy);var lt=this[A],ct=lt?lt.setTimeout.bind(lt):setTimeout,pt=j.heading;return!lt&&pt===!1&&st<0&&(st=1/0),(isFinite(st)||lt)&&(st=Math.ceil(st),ct!==setTimeout&&(st={delay:st,heading:pt}),$=ct(function(){k[E]["delete"](J),R();},st)),this[E].set(J,{timerID:$,handler:R,time:j,startTime:V,startEntropy:nt}),J;}},{key:"parent",get:function get(){return this[A];}},{key:"lastTimeMark",get:function get(){return this[y][this[y].length-1];}},{key:"currentTime",get:function get(){var R=this.lastTimeMark,j=R.localTime,k=R.globalTime;return j+(this.globalTime-k)*this.playbackRate;},set:function set(R){var j=this,k=this.currentTime,J=R,rt=this[E];this.markTime({time:R}),[].concat((0,l["default"])(rt)).forEach(function(st){var $=(0,n["default"])(st,2),V=$[0],nt=$[1];if(rt.has(V)){var lt=nt.time,ct=lt.isEntropy,pt=lt.delay,et=lt.heading,gt=nt.handler,Tt=nt.startTime;if(ct)pt===0&&(gt(),j.clearTimeout(V));else{var X=Tt+pt;(pt===0||et!==!1&&(J-k)*pt<=0||k<=X&&X<=J||k>=X&&X>=J)&&(gt(),j.clearTimeout(V));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
238
+ // If current playbackRate is negative, the currentTime should go backwards
239
+ // while the entropy remain to go forwards.
240
+ // Both of the initial values is set to -originTime
241
+ },{key:"entropy",get:function get(){var R=this.lastTimeMark,j=R.entropy,k=R.globalEntropy;return j+Math.abs((this.globalEntropy-k)*this.playbackRate);},// get globalTime() {
242
+ // if(this[_parent]) {
243
+ // return this[_parent].currentTime;
244
+ // }
245
+ // return nowtime();
246
+ // }
247
+ // change entropy will NOT cause currentTime changing but may influence the pass
248
+ // and the future of the timeline. (It may change the result of seek***Time)
249
+ // While entropy is set, all the marks behind will be droped
250
+ set:function set(R){if(this.entropy>R){var j=this.seekTimeMark(R);this[y].length=j+1;}this.markTime({entropy:R}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[A]?this[A].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[O];},set:function set(R){R!==this.playbackRate&&(this.markTime({playbackRate:R}),this[O]=R,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var R=this.parent;R;){if(R.playbackRate===0)return!0;R=R.parent;}return!1;}}]),W;}();e["default"]=b;},/* 76 *//***/function(u,e,t){e.__esModule=!0;var r=t(77),n=o(r),i=t(129),l=o(i);function o(a){return a&&a.__esModule?a:{"default":a};}e["default"]=/* @__PURE__ */function(){function a(f,g){var c=[],m=!0,x=!1,M=void 0;try{for(var S=(0,l["default"])(f),P;!(m=(P=S.next()).done)&&(c.push(P.value),!(g&&c.length===g));m=!0);}catch(T){x=!0,M=T;}finally{try{!m&&S["return"]&&S["return"]();}finally{if(x)throw M;}}return c;}return function(f,g){if(Array.isArray(f))return f;if((0,n["default"])(Object(f)))return a(f,g);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 *//***/function(u,e,t){u.exports={"default":t(78),__esModule:!0};},/* 78 *//***/function(u,e,t){t(79),t(125),u.exports=t(127);},/* 79 *//***/function(u,e,t){t(80);for(var r=t(91),n=t(95),i=t(83),l=t(122)("toStringTag"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<o.length;a++){var f=o[a],g=r[f],c=g&&g.prototype;c&&!c[l]&&n(c,l,f),i[f]=i.Array;}},/* 80 *//***/function(u,e,t){var r=t(81),n=t(82),i=t(83),l=t(84);u.exports=t(88)(Array,"Array",function(o,a){this._t=l(o),this._i=0,this._k=a;},function(){var o=this._t,a=this._k,f=this._i++;return!o||f>=o.length?(this._t=void 0,n(1)):a=="keys"?n(0,f):a=="values"?n(0,o[f]):n(0,[f,o[f]]);},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries");},/* 81 *//***/function(u,e){u.exports=function(){};},/* 82 *//***/function(u,e){u.exports=function(t,r){return{value:r,done:!!t};};},/* 83 *//***/function(u,e){u.exports={};},/* 84 *//***/function(u,e,t){var r=t(85),n=t(87);u.exports=function(i){return r(n(i));};},/* 85 *//***/function(u,e,t){var r=t(86);u.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return r(n)=="String"?n.split(""):Object(n);};},/* 86 *//***/function(u,e){var t={}.toString;u.exports=function(r){return t.call(r).slice(8,-1);};},/* 87 *//***/function(u,e){u.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 *//***/function(u,e,t){var r=t(89),n=t(90),i=t(106),l=t(95),o=t(83),a=t(107),f=t(121),g=t(123),c=t(122)("iterator"),m=!([].keys&&"next"in[].keys()),x="@@iterator",M="keys",S="values",P=function P(){return this;};u.exports=function(T,h,p,d,y,O,E){a(p,h,d);var w=function w($){if(!m&&$ in W)return W[$];switch($){case M:return function(){return new p(this,$);};case S:return function(){return new p(this,$);};}return function(){return new p(this,$);};},B=h+" Iterator",A=y==S,b=!1,W=T.prototype,D=W[c]||W[x]||y&&W[y],R=D||w(y),j=y?A?w("entries"):R:void 0,k=h=="Array"&&W.entries||D,J,rt,st;if(k&&(st=g(k.call(new T())),st!==Object.prototype&&st.next&&(f(st,B,!0),!r&&typeof st[c]!="function"&&l(st,c,P))),A&&D&&D.name!==S&&(b=!0,R=function R(){return D.call(this);}),(!r||E)&&(m||b||!W[c])&&l(W,c,R),o[h]=R,o[B]=P,y)if(J={values:A?R:w(S),keys:O?R:w(M),entries:j},E)for(rt in J)rt in W||i(W,rt,J[rt]);else n(n.P+n.F*(m||b),h,J);return J;};},/* 89 *//***/function(u,e){u.exports=!0;},/* 90 *//***/function(u,e,t){var r=t(91),n=t(92),i=t(93),l=t(95),o=t(105),a="prototype",_f2=function f(g,c,m){var x=g&_f2.F,M=g&_f2.G,S=g&_f2.S,P=g&_f2.P,T=g&_f2.B,h=g&_f2.W,p=M?n:n[c]||(n[c]={}),d=p[a],y=M?r:S?r[c]:(r[c]||{})[a],O,E,w;M&&(m=c);for(O in m)E=!x&&y&&y[O]!==void 0,!(E&&o(p,O))&&(w=E?y[O]:m[O],p[O]=M&&typeof y[O]!="function"?m[O]:T&&E?i(w,r):h&&y[O]==w?function(B){var A=function A(b,W,D){if(this instanceof B){switch(arguments.length){case 0:return new B();case 1:return new B(b);case 2:return new B(b,W);}return new B(b,W,D);}return B.apply(this,arguments);};return A[a]=B[a],A;}(w):P&&typeof w=="function"?i(Function.call,w):w,P&&((p.virtual||(p.virtual={}))[O]=w,g&_f2.R&&d&&!d[O]&&l(d,O,w)));};_f2.F=1,_f2.G=2,_f2.S=4,_f2.P=8,_f2.B=16,_f2.W=32,_f2.U=64,_f2.R=128,u.exports=_f2;},/* 91 *//***/function(u,e){var t=u.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(u,e){var t=u.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 *//***/function(u,e,t){var r=t(94);u.exports=function(n,i,l){if(r(n),i===void 0)return n;switch(l){case 1:return function(o){return n.call(i,o);};case 2:return function(o,a){return n.call(i,o,a);};case 3:return function(o,a,f){return n.call(i,o,a,f);};}return function(){return n.apply(i,arguments);};};},/* 94 *//***/function(u,e){u.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 *//***/function(u,e,t){var r=t(96),n=t(104);u.exports=t(100)?function(i,l,o){return r.f(i,l,n(1,o));}:function(i,l,o){return i[l]=o,i;};},/* 96 *//***/function(u,e,t){var r=t(97),n=t(99),i=t(103),l=Object.defineProperty;e.f=t(100)?Object.defineProperty:function(a,f,g){if(r(a),f=i(f,!0),r(g),n)try{return l(a,f,g);}catch(_unused10){}if("get"in g||"set"in g)throw TypeError("Accessors not supported!");return"value"in g&&(a[f]=g.value),a;};},/* 97 *//***/function(u,e,t){var r=t(98);u.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n;};},/* 98 *//***/function(u,e){u.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 *//***/function(u,e,t){u.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 *//***/function(u,e,t){u.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 *//***/function(u,e){u.exports=function(t){try{return!!t();}catch(_unused11){return!0;}};},/* 102 *//***/function(u,e,t){var r=t(98),n=t(91).document,i=r(n)&&r(n.createElement);u.exports=function(l){return i?n.createElement(l):{};};},/* 103 *//***/function(u,e,t){var r=t(98);u.exports=function(n,i){if(!r(n))return n;var l,o;if(i&&typeof(l=n.toString)=="function"&&!r(o=l.call(n))||typeof(l=n.valueOf)=="function"&&!r(o=l.call(n))||!i&&typeof(l=n.toString)=="function"&&!r(o=l.call(n)))return o;throw TypeError("Can't convert object to primitive value");};},/* 104 *//***/function(u,e){u.exports=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r};};},/* 105 *//***/function(u,e){var t={}.hasOwnProperty;u.exports=function(r,n){return t.call(r,n);};},/* 106 *//***/function(u,e,t){u.exports=t(95);},/* 107 *//***/function(u,e,t){var r=t(108),n=t(104),i=t(121),l={};t(95)(l,t(122)("iterator"),function(){return this;}),u.exports=function(o,a,f){o.prototype=r(l,{next:n(1,f)}),i(o,a+" Iterator");};},/* 108 *//***/function(u,e,t){var r=t(97),n=t(109),i=t(119),l=t(116)("IE_PROTO"),o=function o(){},a="prototype",_f3=function f(){var g=t(102)("iframe"),c=i.length,m="<",x=">",M;for(g.style.display="none",t(120).appendChild(g),g.src="javascript:",M=g.contentWindow.document,M.open(),M.write(m+"script"+x+"document.F=Object"+m+"/script"+x),M.close(),_f3=M.F;c--;)delete _f3[a][i[c]];return _f3();};u.exports=Object.create||function(c,m){var x;return c!==null?(o[a]=r(c),x=new o(),o[a]=null,x[l]=c):x=_f3(),m===void 0?x:n(x,m);};},/* 109 *//***/function(u,e,t){var r=t(96),n=t(97),i=t(110);u.exports=t(100)?Object.defineProperties:function(o,a){n(o);for(var f=i(a),g=f.length,c=0,m;g>c;)r.f(o,m=f[c++],a[m]);return o;};},/* 110 *//***/function(u,e,t){var r=t(111),n=t(119);u.exports=Object.keys||function(l){return r(l,n);};},/* 111 *//***/function(u,e,t){var r=t(105),n=t(84),i=t(112)(!1),l=t(116)("IE_PROTO");u.exports=function(o,a){var f=n(o),g=0,c=[],m;for(m in f)m!=l&&r(f,m)&&c.push(m);for(;a.length>g;)r(f,m=a[g++])&&(~i(c,m)||c.push(m));return c;};},/* 112 *//***/function(u,e,t){var r=t(84),n=t(113),i=t(115);u.exports=function(l){return function(o,a,f){var g=r(o),c=n(g.length),m=i(f,c),x;if(l&&a!=a){for(;c>m;)if(x=g[m++],x!=x)return!0;}else for(;c>m;m++)if((l||m in g)&&g[m]===a)return l||m||0;return!l&&-1;};};},/* 113 *//***/function(u,e,t){var r=t(114),n=Math.min;u.exports=function(i){return i>0?n(r(i),9007199254740991):0;};},/* 114 *//***/function(u,e){var t=Math.ceil,r=Math.floor;u.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n);};},/* 115 *//***/function(u,e,t){var r=t(114),n=Math.max,i=Math.min;u.exports=function(l,o){return l=r(l),l<0?n(l+o,0):i(l,o);};},/* 116 *//***/function(u,e,t){var r=t(117)("keys"),n=t(118);u.exports=function(i){return r[i]||(r[i]=n(i));};},/* 117 *//***/function(u,e,t){var r=t(92),n=t(91),i="__core-js_shared__",l=n[i]||(n[i]={});(u.exports=function(o,a){return l[o]||(l[o]=a!==void 0?a:{});})("versions",[]).push({version:r.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 *//***/function(u,e){var t=0,r=Math.random();u.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+r).toString(36));};},/* 119 *//***/function(u,e){u.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 *//***/function(u,e,t){var r=t(91).document;u.exports=r&&r.documentElement;},/* 121 *//***/function(u,e,t){var r=t(96).f,n=t(105),i=t(122)("toStringTag");u.exports=function(l,o,a){l&&!n(l=a?l:l.prototype,i)&&r(l,i,{configurable:!0,value:o});};},/* 122 *//***/function(u,e,t){var r=t(117)("wks"),n=t(118),i=t(91).Symbol,l=typeof i=="function",o=u.exports=function(a){return r[a]||(r[a]=l&&i[a]||(l?i:n)("Symbol."+a));};o.store=r;},/* 123 *//***/function(u,e,t){var r=t(105),n=t(124),i=t(116)("IE_PROTO"),l=Object.prototype;u.exports=Object.getPrototypeOf||function(o){return o=n(o),r(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?l:null;};},/* 124 *//***/function(u,e,t){var r=t(87);u.exports=function(n){return Object(r(n));};},/* 125 *//***/function(u,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,i=this._i,l;return i>=n.length?{value:void 0,done:!0}:(l=r(n,i),this._i+=l.length,{value:l,done:!1});});},/* 126 *//***/function(u,e,t){var r=t(114),n=t(87);u.exports=function(i){return function(l,o){var a=String(n(l)),f=r(o),g=a.length,c,m;return f<0||f>=g?i?"":void 0:(c=a.charCodeAt(f),c<55296||c>56319||f+1===g||(m=a.charCodeAt(f+1))<56320||m>57343?i?a.charAt(f):c:i?a.slice(f,f+2):(c-55296<<10)+(m-56320)+65536);};};},/* 127 *//***/function(u,e,t){var r=t(128),n=t(122)("iterator"),i=t(83);u.exports=t(92).isIterable=function(l){var o=Object(l);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(r(o));};},/* 128 *//***/function(u,e,t){var r=t(86),n=t(122)("toStringTag"),i=r(/* @__PURE__ */function(){return arguments;}())=="Arguments",l=function l(o,a){try{return o[a];}catch(_unused12){}};u.exports=function(o){var a,f,g;return o===void 0?"Undefined":o===null?"Null":typeof(f=l(a=Object(o),n))=="string"?f:i?r(a):(g=r(a))=="Object"&&typeof a.callee=="function"?"Arguments":g;};},/* 129 *//***/function(u,e,t){u.exports={"default":t(130),__esModule:!0};},/* 130 *//***/function(u,e,t){t(79),t(125),u.exports=t(131);},/* 131 *//***/function(u,e,t){var r=t(97),n=t(132);u.exports=t(92).getIterator=function(i){var l=n(i);if(typeof l!="function")throw TypeError(i+" is not iterable!");return r(l.call(i));};},/* 132 *//***/function(u,e,t){var r=t(128),n=t(122)("iterator"),i=t(83);u.exports=t(92).getIteratorMethod=function(l){if(l!=null)return l[n]||l["@@iterator"]||i[r(l)];};},/* 133 *//***/function(u,e,t){e.__esModule=!0;var r=t(134),n=i(r);function i(l){return l&&l.__esModule?l:{"default":l};}e["default"]=function(l){if(Array.isArray(l)){for(var o=0,a=Array(l.length);o<l.length;o++)a[o]=l[o];return a;}else return(0,n["default"])(l);};},/* 134 *//***/function(u,e,t){u.exports={"default":t(135),__esModule:!0};},/* 135 *//***/function(u,e,t){t(125),t(136),u.exports=t(92).Array.from;},/* 136 *//***/function(u,e,t){var r=t(93),n=t(90),i=t(124),l=t(137),o=t(138),a=t(113),f=t(139),g=t(132);n(n.S+n.F*!t(140)(function(c){Array.from(c);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
251
+ from:function from(m){var x=i(m),M=typeof this=="function"?this:Array,S=arguments.length,P=S>1?arguments[1]:void 0,T=P!==void 0,h=0,p=g(x),d,y,O,E;if(T&&(P=r(P,S>2?arguments[2]:void 0,2)),p!=null&&!(M==Array&&o(p)))for(E=p.call(x),y=new M();!(O=E.next()).done;h++)f(y,h,T?l(E,P,[O.value,h],!0):O.value);else for(d=a(x.length),y=new M(d);d>h;h++)f(y,h,T?P(x[h],h):x[h]);return y.length=h,y;}});},/* 137 *//***/function(u,e,t){var r=t(97);u.exports=function(n,i,l,o){try{return o?i(r(l)[0],l[1]):i(l);}catch(f){var a=n["return"];throw a!==void 0&&r(a.call(n)),f;}};},/* 138 *//***/function(u,e,t){var r=t(83),n=t(122)("iterator"),i=Array.prototype;u.exports=function(l){return l!==void 0&&(r.Array===l||i[n]===l);};},/* 139 *//***/function(u,e,t){var r=t(96),n=t(104);u.exports=function(i,l,o){l in i?r.f(i,l,n(0,o)):i[l]=o;};},/* 140 *//***/function(u,e,t){var r=t(122)("iterator"),n=!1;try{var i=[7][r]();i["return"]=function(){n=!0;},Array.from(i,function(){throw 2;});}catch(_unused13){}u.exports=function(l,o){if(!o&&!n)return!1;var a=!1;try{var f=[7],g=f[r]();g.next=function(){return{done:a=!0};},f[r]=function(){return g;},l(f);}catch(_unused14){}return a;};},/* 141 *//***/function(u,e,t){u.exports={"default":t(142),__esModule:!0};},/* 142 *//***/function(u,e,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),u.exports=t(92).Map;},/* 143 *//***/function(u,e){},/* 144 *//***/function(u,e,t){var r=t(145),n=t(151),i="Map";u.exports=t(152)(i,function(l){return function(){return l(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
252
+ get:function get(o){var a=r.getEntry(n(this,i),o);return a&&a.v;},// 23.1.3.9 Map.prototype.set(key, value)
253
+ set:function set(o,a){return r.def(n(this,i),o===0?0:o,a);}},r,!0);},/* 145 *//***/function(u,e,t){var r=t(96).f,n=t(108),i=t(146),l=t(93),o=t(147),a=t(148),f=t(88),g=t(82),c=t(149),m=t(100),x=t(150).fastKey,M=t(151),S=m?"_s":"size",P=function P(T,h){var p=x(h),d;if(p!=="F")return T._i[p];for(d=T._f;d;d=d.n)if(d.k==h)return d;};u.exports={getConstructor:function getConstructor(T,h,p,d){var y=T(function(O,E){o(O,y,h,"_i"),O._t=h,O._i=n(null),O._f=void 0,O._l=void 0,O[S]=0,E!=null&&a(E,p,O[d],O);});return i(y.prototype,{// 23.1.3.1 Map.prototype.clear()
254
+ // 23.2.3.2 Set.prototype.clear()
255
+ clear:function clear(){for(var E=M(this,h),w=E._i,B=E._f;B;B=B.n)B.r=!0,B.p&&(B.p=B.p.n=void 0),delete w[B.i];E._f=E._l=void 0,E[S]=0;},// 23.1.3.3 Map.prototype.delete(key)
256
+ // 23.2.3.4 Set.prototype.delete(value)
257
+ "delete":function _delete(O){var E=M(this,h),w=P(E,O);if(w){var B=w.n,A=w.p;delete E._i[w.i],w.r=!0,A&&(A.n=B),B&&(B.p=A),E._f==w&&(E._f=B),E._l==w&&(E._l=A),E[S]--;}return!!w;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
258
+ // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
259
+ forEach:function forEach(E){M(this,h);for(var w=l(E,arguments.length>1?arguments[1]:void 0,3),B;B=B?B.n:this._f;)for(w(B.v,B.k,this);B&&B.r;)B=B.p;},// 23.1.3.7 Map.prototype.has(key)
260
+ // 23.2.3.7 Set.prototype.has(value)
261
+ has:function has(E){return!!P(M(this,h),E);}}),m&&r(y.prototype,"size",{get:function get(){return M(this,h)[S];}}),y;},def:function def(T,h,p){var d=P(T,h),y,O;return d?d.v=p:(T._l=d={i:O=x(h,!0),// <- index
262
+ k:h,// <- key
263
+ v:p,// <- value
264
+ p:y=T._l,// <- previous entry
265
+ n:void 0,// <- next entry
266
+ r:!1// <- removed
267
+ },T._f||(T._f=d),y&&(y.n=d),T[S]++,O!=="F"&&(T._i[O]=d)),T;},getEntry:P,setStrong:function setStrong(T,h,p){f(T,h,function(d,y){this._t=M(d,h),this._k=y,this._l=void 0;},function(){for(var d=this,y=d._k,O=d._l;O&&O.r;)O=O.p;return!d._t||!(d._l=O=O?O.n:d._t._f)?(d._t=void 0,g(1)):y=="keys"?g(0,O.k):y=="values"?g(0,O.v):g(0,[O.k,O.v]);},p?"entries":"values",!p,!0),c(h);}};},/* 146 *//***/function(u,e,t){var r=t(95);u.exports=function(n,i,l){for(var o in i)l&&n[o]?n[o]=i[o]:r(n,o,i[o]);return n;};},/* 147 *//***/function(u,e){u.exports=function(t,r,n,i){if(!(t instanceof r)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 *//***/function(u,c,t){var r=t(93),n=t(137),i=t(138),l=t(97),o=t(113),a=t(132),f={},g={},c=u.exports=function(m,x,M,S,P){var T=P?function(){return m;}:a(m),h=r(M,S,x?2:1),p=0,d,y,O,E;if(typeof T!="function")throw TypeError(m+" is not iterable!");if(i(T)){for(d=o(m.length);d>p;p++)if(E=x?h(l(y=m[p])[0],y[1]):h(m[p]),E===f||E===g)return E;}else for(O=T.call(m);!(y=O.next()).done;)if(E=n(O,h,y.value,x),E===f||E===g)return E;};c.BREAK=f,c.RETURN=g;},/* 149 *//***/function(u,e,t){var r=t(91),n=t(92),i=t(96),l=t(100),o=t(122)("species");u.exports=function(a){var f=typeof n[a]=="function"?n[a]:r[a];l&&f&&!f[o]&&i.f(f,o,{configurable:!0,get:function get(){return this;}});};},/* 150 *//***/function(u,e,t){var r=t(118)("meta"),n=t(98),i=t(105),l=t(96).f,o=0,a=Object.isExtensible||function(){return!0;},f=!t(101)(function(){return a(Object.preventExtensions({}));}),g=function g(S){l(S,r,{value:{i:"O"+ ++o,// object ID
268
+ w:{}// weak collections IDs
269
+ }});},c=function c(S,P){if(!n(S))return _typeof(S)=="symbol"?S:(typeof S=="string"?"S":"P")+S;if(!i(S,r)){if(!a(S))return"F";if(!P)return"E";g(S);}return S[r].i;},m=function m(S,P){if(!i(S,r)){if(!a(S))return!0;if(!P)return!1;g(S);}return S[r].w;},x=function x(S){return f&&M.NEED&&a(S)&&!i(S,r)&&g(S),S;},M=u.exports={KEY:r,NEED:!1,fastKey:c,getWeak:m,onFreeze:x};},/* 151 *//***/function(u,e,t){var r=t(98);u.exports=function(n,i){if(!r(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 *//***/function(u,e,t){var r=t(91),n=t(90),i=t(150),l=t(101),o=t(95),a=t(146),f=t(148),g=t(147),c=t(98),m=t(121),x=t(96).f,M=t(153)(0),S=t(100);u.exports=function(P,T,h,p,d,y){var O=r[P],E=O,w=d?"set":"add",B=E&&E.prototype,A={};return!S||typeof E!="function"||!(y||B.forEach&&!l(function(){new E().entries().next();}))?(E=p.getConstructor(T,P,d,w),a(E.prototype,h),i.NEED=!0):(E=T(function(b,W){g(b,E,P,"_c"),b._c=new O(),W!=null&&f(W,d,b[w],b);}),M("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(b){var W=b=="add"||b=="set";b in B&&!(y&&b=="clear")&&o(E.prototype,b,function(D,R){if(g(this,E,b),!W&&y&&!c(D))return b=="get"?void 0:!1;var j=this._c[b](D===0?0:D,R);return W?this:j;});}),y||x(E.prototype,"size",{get:function get(){return this._c.size;}})),m(E,P),A[P]=E,n(n.G+n.W+n.F,A),y||p.setStrong(E,P,d),E;};},/* 153 *//***/function(u,e,t){var r=t(93),n=t(85),i=t(124),l=t(113),o=t(154);u.exports=function(a,f){var g=a==1,c=a==2,m=a==3,x=a==4,M=a==6,S=a==5||M,P=f||o;return function(T,h,p){for(var d=i(T),y=n(d),O=r(h,p,3),E=l(y.length),w=0,B=g?P(T,E):c?P(T,0):void 0,A,b;E>w;w++)if((S||w in y)&&(A=y[w],b=O(A,w,d),a)){if(g)B[w]=b;else if(b)switch(a){case 3:return!0;case 5:return A;case 6:return w;case 2:B.push(A);}else if(x)return!1;}return M?-1:m||x?x:B;};};},/* 154 *//***/function(u,e,t){var r=t(155);u.exports=function(n,i){return new(r(n))(i);};},/* 155 *//***/function(u,e,t){var r=t(98),n=t(156),i=t(122)("species");u.exports=function(l){var o;return n(l)&&(o=l.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),r(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 *//***/function(u,e,t){var r=t(86);u.exports=Array.isArray||function(i){return r(i)=="Array";};},/* 157 *//***/function(u,e,t){var r=t(90);r(r.P+r.R,"Map",{toJSON:t(158)("Map")});},/* 158 *//***/function(u,e,t){var r=t(128),n=t(159);u.exports=function(i){return function(){if(r(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this);};};},/* 159 *//***/function(u,e,t){var r=t(148);u.exports=function(n,i){var l=[];return r(n,!1,l.push,l,i),l;};},/* 160 *//***/function(u,e,t){t(161)("Map");},/* 161 *//***/function(u,e,t){var r=t(90);u.exports=function(n){r(r.S,n,{of:function of(){for(var l=arguments.length,o=new Array(l);l--;)o[l]=arguments[l];return new this(o);}});};},/* 162 *//***/function(u,e,t){t(163)("Map");},/* 163 *//***/function(u,e,t){var r=t(90),n=t(94),i=t(93),l=t(148);u.exports=function(o){r(r.S,o,{from:function from(f){var g=arguments[1],c,m,x,M;return n(this),c=g!==void 0,c&&n(g),f==null?new this():(m=[],c?(x=0,M=i(g,arguments[2],2),l(f,!1,function(S){m.push(M(S,x++));})):l(f,!1,m.push,m),new this(m));}});};},/* 164 *//***/function(u,e,t){u.exports={"default":t(165),__esModule:!0};},/* 165 *//***/function(u,e,t){t(166),u.exports=t(92).Object.assign;},/* 166 *//***/function(u,e,t){var r=t(90);r(r.S+r.F,"Object",{assign:t(167)});},/* 167 *//***/function(u,e,t){var r=t(100),n=t(110),i=t(168),l=t(169),o=t(124),a=t(85),f=Object.assign;u.exports=!f||t(101)(function(){var g={},c={},m=Symbol(),x="abcdefghijklmnopqrst";return g[m]=7,x.split("").forEach(function(M){c[M]=M;}),f({},g)[m]!=7||Object.keys(f({},c)).join("")!=x;})?function(c,m){for(var x=o(c),M=arguments.length,S=1,P=i.f,T=l.f;M>S;)for(var h=a(arguments[S++]),p=P?n(h).concat(P(h)):n(h),d=p.length,y=0,O;d>y;)O=p[y++],(!r||T.call(h,O))&&(x[O]=h[O]);return x;}:f;},/* 168 *//***/function(u,e){e.f=Object.getOwnPropertySymbols;},/* 169 *//***/function(u,e){e.f={}.propertyIsEnumerable;},/* 170 *//***/function(u,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(u,e,t){e.__esModule=!0;var r=t(172),n=i(r);function i(l){return l&&l.__esModule?l:{"default":l};}e["default"]=/* @__PURE__ */function(){function l(o,a){for(var f=0;f<a.length;f++){var g=a[f];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),(0,n["default"])(o,g.key,g);}}return function(o,a,f){return a&&l(o.prototype,a),f&&l(o,f),o;};}();},/* 172 *//***/function(u,e,t){u.exports={"default":t(173),__esModule:!0};},/* 173 *//***/function(u,e,t){t(174);var r=t(92).Object;u.exports=function(i,l,o){return r.defineProperty(i,l,o);};},/* 174 *//***/function(u,e,t){var r=t(90);r(r.S+r.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 *//***/function(u,e,t){u.exports={"default":t(176),__esModule:!0};},/* 176 *//***/function(u,e,t){t(177),t(143),t(184),t(185),u.exports=t(92).Symbol;},/* 177 *//***/function(u,e,t){var r=t(91),n=t(105),i=t(100),l=t(90),o=t(106),a=t(150).KEY,f=t(101),g=t(117),c=t(121),m=t(118),x=t(122),M=t(178),S=t(179),P=t(180),T=t(156),h=t(97),p=t(98),d=t(124),y=t(84),O=t(103),E=t(104),w=t(108),B=t(181),A=t(183),b=t(168),W=t(96),D=t(110),R=A.f,j=W.f,k=B.f,_J2=r.Symbol,rt=r.JSON,st=rt&&rt.stringify,$="prototype",V=x("_hidden"),nt=x("toPrimitive"),lt={}.propertyIsEnumerable,ct=g("symbol-registry"),pt=g("symbols"),et=g("op-symbols"),gt=Object[$],Tt=typeof _J2=="function"&&!!b.f,X=r.QObject,z=!X||!X[$]||!X[$].findChild,Q=i&&f(function(){return w(j({},"a",{get:function get(){return j(this,"a",{value:7}).a;}})).a!=7;})?function(yt,vt,xt){var Et=R(gt,vt);Et&&delete gt[vt],j(yt,vt,xt),Et&&yt!==gt&&j(gt,vt,Et);}:j,tt=function tt(yt){var vt=pt[yt]=w(_J2[$]);return vt._k=yt,vt;},U=Tt&&_typeof(_J2.iterator)=="symbol"?function(yt){return _typeof(yt)=="symbol";}:function(yt){return yt instanceof _J2;},_H2=function H(vt,xt,Et){return vt===gt&&_H2(et,xt,Et),h(vt),xt=O(xt,!0),h(Et),n(pt,xt)?(Et.enumerable?(n(vt,V)&&vt[V][xt]&&(vt[V][xt]=!1),Et=w(Et,{enumerable:E(0,!1)})):(n(vt,V)||j(vt,V,E(1,{})),vt[V][xt]=!0),Q(vt,xt,Et)):j(vt,xt,Et);},C=function C(vt,xt){h(vt);for(var Et=P(xt=y(xt)),At=0,Ot=Et.length,Nt;Ot>At;)_H2(vt,Nt=Et[At++],xt[Nt]);return vt;},L=function L(vt,xt){return xt===void 0?w(vt):C(w(vt),xt);},F=function F(vt){var xt=lt.call(this,vt=O(vt,!0));return this===gt&&n(pt,vt)&&!n(et,vt)?!1:xt||!n(this,vt)||!n(pt,vt)||n(this,V)&&this[V][vt]?xt:!0;},G=function G(vt,xt){if(vt=y(vt),xt=O(xt,!0),!(vt===gt&&n(pt,xt)&&!n(et,xt))){var Et=R(vt,xt);return Et&&n(pt,xt)&&!(n(vt,V)&&vt[V][xt])&&(Et.enumerable=!0),Et;}},Z=function Z(vt){for(var xt=k(y(vt)),Et=[],At=0,Ot;xt.length>At;)!n(pt,Ot=xt[At++])&&Ot!=V&&Ot!=a&&Et.push(Ot);return Et;},q=function q(vt){for(var xt=vt===gt,Et=k(xt?et:y(vt)),At=[],Ot=0,Nt;Et.length>Ot;)n(pt,Nt=Et[Ot++])&&(!xt||n(gt,Nt))&&At.push(pt[Nt]);return At;};Tt||(_J2=function J(){if(this instanceof _J2)throw TypeError("Symbol is not a constructor!");var vt=m(arguments.length>0?arguments[0]:void 0),_xt=function xt(Et){this===gt&&_xt.call(et,Et),n(this,V)&&n(this[V],vt)&&(this[V][vt]=!1),Q(this,vt,E(1,Et));};return i&&z&&Q(gt,vt,{configurable:!0,set:_xt}),tt(vt);},o(_J2[$],"toString",function(){return this._k;}),A.f=G,W.f=_H2,t(182).f=B.f=Z,t(169).f=F,b.f=q,i&&!t(89)&&o(gt,"propertyIsEnumerable",F,!0),M.f=function(yt){return tt(x(yt));}),l(l.G+l.W+l.F*!Tt,{Symbol:_J2});for(var it=// 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
270
+ "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ut=0;it.length>ut;)x(it[ut++]);for(var mt=D(x.store),Pt=0;mt.length>Pt;)S(mt[Pt++]);l(l.S+l.F*!Tt,"Symbol",{// 19.4.2.1 Symbol.for(key)
271
+ "for":function _for(yt){return n(ct,yt+="")?ct[yt]:ct[yt]=_J2(yt);},// 19.4.2.5 Symbol.keyFor(sym)
272
+ keyFor:function keyFor(vt){if(!U(vt))throw TypeError(vt+" is not a symbol!");for(var xt in ct)if(ct[xt]===vt)return xt;},useSetter:function useSetter(){z=!0;},useSimple:function useSimple(){z=!1;}}),l(l.S+l.F*!Tt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
273
+ create:L,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
274
+ defineProperty:_H2,// 19.1.2.3 Object.defineProperties(O, Properties)
275
+ defineProperties:C,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
276
+ getOwnPropertyDescriptor:G,// 19.1.2.7 Object.getOwnPropertyNames(O)
277
+ getOwnPropertyNames:Z,// 19.1.2.8 Object.getOwnPropertySymbols(O)
278
+ getOwnPropertySymbols:q});var Ct=f(function(){b.f(1);});l(l.S+l.F*Ct,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(vt){return b.f(d(vt));}}),rt&&l(l.S+l.F*(!Tt||f(function(){var yt=_J2();return st([yt])!="[null]"||st({a:yt})!="{}"||st(Object(yt))!="{}";})),"JSON",{stringify:function stringify(vt){for(var xt=[vt],Et=1,At,Ot;arguments.length>Et;)xt.push(arguments[Et++]);if(Ot=At=xt[1],!(!p(At)&&vt===void 0||U(vt)))return T(At)||(At=function At(Nt,$t){if(typeof Ot=="function"&&($t=Ot.call(this,Nt,$t)),!U($t))return $t;}),xt[1]=At,st.apply(rt,xt);}}),_J2[$][nt]||t(95)(_J2[$],nt,_J2[$].valueOf),c(_J2,"Symbol"),c(Math,"Math",!0),c(r.JSON,"JSON",!0);},/* 178 *//***/function(u,e,t){e.f=t(122);},/* 179 *//***/function(u,e,t){var r=t(91),n=t(92),i=t(89),l=t(178),o=t(96).f;u.exports=function(a){var f=n.Symbol||(n.Symbol=i?{}:r.Symbol||{});a.charAt(0)!="_"&&!(a in f)&&o(f,a,{value:l.f(a)});};},/* 180 *//***/function(u,e,t){var r=t(110),n=t(168),i=t(169);u.exports=function(l){var o=r(l),a=n.f;if(a)for(var f=a(l),g=i.f,c=0,m;f.length>c;)g.call(l,m=f[c++])&&o.push(m);return o;};},/* 181 *//***/function(u,e,t){var r=t(84),n=t(182).f,i={}.toString,l=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(a){try{return n(a);}catch(_unused15){return l.slice();}};u.exports.f=function(f){return l&&i.call(f)=="[object Window]"?o(f):n(r(f));};},/* 182 *//***/function(u,e,t){var r=t(111),n=t(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(l){return r(l,n);};},/* 183 *//***/function(u,e,t){var r=t(169),n=t(104),i=t(84),l=t(103),o=t(105),a=t(99),f=Object.getOwnPropertyDescriptor;e.f=t(100)?f:function(c,m){if(c=i(c),m=l(m,!0),a)try{return f(c,m);}catch(_unused16){}if(o(c,m))return n(!r.f.call(c,m),c[m]);};},/* 184 *//***/function(u,e,t){t(179)("asyncIterator");},/* 185 *//***/function(u,e,t){t(179)("observable");},/* 186 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createNowTime=r,e.formatDelay=n;function r(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={// s - startFrame, e - endFrame
279
+ "default":function _default(n,i,l,o,a){return typeof n=="number"&&typeof i=="number"?n+(l-o)/(a-o)*(i-n):l-o>a-l?i:n;}};},/* 188 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.parseEasing=e.Easings=void 0;var r=t(76),n=f(r),i=t(133),l=f(i),o=t(141),a=f(o);function f(T){return T&&T.__esModule?T:{"default":T};}var g=t(189),c=new a["default"]();function m(){for(var T=arguments.length,h=Array(T),p=0;p<T;p++)h[p]=arguments[p];var d=c.get(h);return d||(d=g.apply(void 0,h),c.set(h,d),d);}function x(T){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(p,d){for(var y=1;y<d.length;y++){var O=d[y].offset;if(p<=O){var E=d[y-1].offset,w=O,B=(p-E)/(w-E),A=1/T,b=B/A;return h==="end"?b=Math.floor(b):b=Math.ceil(b),A*b*(w-E)+E;}}return 0;};}function M(T){var h=/^cubic-bezier\((.*)\)/,p=T.match(h);if(p){var d=p[1].trim();return d=d.split(",").map(function(A){return parseFloat(A.trim());}),m.apply(void 0,(0,l["default"])(d));}if(h=/^steps\((.*)\)/,p=T.match(h),p){var y=p[1].trim();y=y.split(",").map(function(A){return A.trim();});var O=y,E=(0,n["default"])(O,2),w=E[0],B=E[1];return x(parseInt(w,10),B);}return T;}var S={linear:function linear(h){return h;},ease:m(0.25,0.1,0.25,1),"ease-in":m(0.42,0,1,1),"ease-out":m(0,0,0.58,1),"ease-in-out":m(0.42,0,0.58,1),// 'step-start': function(p, frames){
280
+ // let ret = 0
281
+ // for(let i = 0; i < frames.length; i++){
282
+ // const {offset} = frames[i]
283
+ // ret = offset
284
+ // if(p < offset){
285
+ // break
286
+ // }
287
+ // }
288
+ // return ret
289
+ // },
290
+ // 'step-end': function(p, frames){
291
+ // let ret = 0
292
+ // for(let i = 0; i < frames.length; i++){
293
+ // const {offset} = frames[i]
294
+ // if(p < offset){
295
+ // break
296
+ // }
297
+ // ret = offset
298
+ // }
299
+ // return ret
300
+ // }
301
+ "step-start":x(1,"start"),"step-end":x(1,"end")};function P(T){return typeof T=="string"?S[T]?T=S[T]:T=M(T):T.type==="cubic-bezier"?T=m.apply(void 0,(0,l["default"])(T.value)):T.type==="steps"&&(T=x(T.step,T.pos)),T;}e.Easings=S,e.parseEasing=P;},/* 189 *//***/function(u,e){var t=4,r=1e-3,n=1e-7,i=10,l=11,o=1/(l-1),a=typeof Float32Array=="function";function f(T,h){return 1-3*h+3*T;}function g(T,h){return 3*h-6*T;}function c(T){return 3*T;}function m(T,h,p){return((f(h,p)*T+g(h,p))*T+c(h))*T;}function x(T,h,p){return 3*f(h,p)*T*T+2*g(h,p)*T+c(h);}function M(T,h,p,d,y){var O,E,w=0;do E=h+(p-h)/2,O=m(E,d,y)-T,O>0?p=E:h=E;while(Math.abs(O)>n&&++w<i);return E;}function S(T,h,p,d){for(var y=0;y<t;++y){var O=x(h,p,d);if(O===0)return h;var E=m(h,p,d)-T;h-=E/O;}return h;}function P(T){return T;}u.exports=function(h,p,d,y){if(!(0<=h&&h<=1&&0<=d&&d<=1))throw new Error("bezier x values must be in [0, 1] range");if(h===p&&d===y)return P;for(var O=a?new Float32Array(l):new Array(l),E=0;E<l;++E)O[E]=m(E*o,h,d);function w(B){for(var A=0,b=1,W=l-1;b!==W&&O[b]<=B;++b)A+=o;--b;var D=(B-O[b])/(O[b+1]-O[b]),R=A+D*o,j=x(R,h,d);return j>=r?S(B,R,h,d):j===0?R:M(B,A,A+o,h,d);}return function(A){return A===0?0:A===1?1:m(w(A),p,y);};};},/* 190 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(191),n=p(r),i=t(204),l=p(i),o=t(164),a=p(o),f=t(170),g=p(f),c=t(171),m=p(c),x=t(175),M=p(x),S=t(75),P=p(S),T=t(208),h=t(188);function p(j){return j&&j.__esModule?j:{"default":j};}var d=(0,M["default"])("timing"),y=(0,M["default"])("keyframes"),O=(0,M["default"])("initState"),E=(0,M["default"])("readyDefer"),w=(0,M["default"])("finishedDefer"),B=(0,M["default"])("effects"),A=(0,M["default"])("activeReadyTimer"),b=(0,M["default"])("activeFinishTimer"),W=(0,M["default"])("removeDefer"),D={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},R=function(){function j(k,J,rt){var st=this;if((0,g["default"])(this,j),Array.isArray(k)){var $=[k[0],k,J];k=$[0],J=$[1],rt=$[2];}typeof rt=="number"&&(rt={duration:rt}),this[d]=(0,a["default"])({},D,rt),this[d].easing=(0,h.parseEasing)(this[d].easing),this[y]=(0,T.calculateFramesOffset)(J);var V=this[y][this[y].length-1];this[O]={},(0,l["default"])(V).forEach(function(nt){Object.prototype.hasOwnProperty.call(k,nt)&&nt!=="easing"&&nt!=="offset"&&(st[O][nt]=k[nt]);}),this[y]=this[y].map(function(nt){return(0,a["default"])({},st[O],nt);}),this[y][0].offset!==0&&this[y].unshift((0,a["default"])({},this[O],{offset:0})),V.offset<1&&this[y].push((0,a["default"])({},V,{offset:1})),this[B]={},this.timeline=null;}return(0,m["default"])(j,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:A,value:function value(){var J=this;this[E]&&!this[E].timerID&&(this.timeline.currentTime<0?this[E].timerID=this.timeline.setTimeout(function(){J[E].resolve(),delete J[E];},{delay:-this.timeline.currentTime,heading:!1}):this[E].timerID=this.timeline.setTimeout(function(){J[E].resolve(),delete J[E];},{delay:0,isEntropy:!0}));}},{key:b,value:function value(){var J=this,rt=this[d],st=rt.duration,$=rt.iterations,V=rt.endDelay,nt=Math.ceil(st*$+V-this.timeline.currentTime)+1;this[w]&&!this[w].timerID&&(this[w].timerID=this.timeline.setTimeout(function(){J[w].resolve(),J[W](E),J[W](w);},{delay:nt,heading:!1}),this[w].reverseTimerID=this.timeline.setTimeout(function(){J[w].resolve(),J[W](E),J[W](w),J.timeline=null;},{delay:-this[d].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var J=this[d],rt=J.delay,st=J.playbackRate,$=J.timeline;this.timeline=new P["default"]({originTime:rt,playbackRate:st},$),this[A](),this[b]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[A]());}},{key:W,value:function value(J){var rt=this[J],st=this.timeline;rt&&st&&(st.clearTimeout(rt.timerID),rt.reverseTimerID&&st.clearTimeout(rt.reverseTimerID)),delete this[J];}},{key:"cancel",value:function value(){this[W](E),this[W](w),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[W](E),this[W](w);}},{key:"applyEffects",value:function value(J){return(0,a["default"])(this[B],J);}},{key:"playbackRate",get:function get(){return this[d].playbackRate;},set:function set(J){this.timeline&&(this.timeline.playbackRate=J),this[d].playbackRate=J;}},{key:"playState",get:function get(){var J=this.timeline,rt=this[d],st=rt.iterations,$=rt.duration,V=rt.endDelay,nt="running";if(J==null)nt="idle";else if(J.paused)nt="paused";else if(J.currentTime<0)nt="pending";else{var lt=J.currentTime-st*$;lt>0&&lt<V?nt="pending":lt>=V&&(nt="finished");}return nt;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var J=this[d],rt=J.duration,st=J.iterations,$=this.timeline,V=this.playState,nt=void 0;if(V==="idle")nt=0;else if(V==="paused"&&$.currentTime<0)nt=0;else if(V==="pending"){if($.currentTime<0)nt=0;else{var lt=$.seekLocalTime(st*rt);nt=(0,T.periodicity)(lt,rt)[1]/rt;}}else(V==="running"||V==="paused")&&(nt=(0,T.periodicity)($.currentTime,rt)[1]/rt);return V==="finished"&&(nt=(0,T.periodicity)(st,1)[1]),nt;}},{key:"frame",get:function get(){var J=this.playState,rt=this[O],st=this[d].fill;if(J==="idle")return rt;var $=this.timeline.currentTime,V=this[y].slice(0),nt=(0,T.getProgress)(this.timeline,this[d],this.progress),lt=nt.p,ct=nt.inverted,pt=rt;return $<0&&J==="pending"?(st==="backwards"||st==="both")&&(pt=ct?V[V.length-1]:V[0]):(J!=="pending"&&J!=="finished"||st==="forwards"||st==="both")&&(pt=(0,T.getCurrentFrame)(this[d],V,this[B],lt)),pt;}},{key:"timing",get:function get(){return this[d];}},{key:"effects",get:function get(){return this[B];}},{key:"baseTimeline",set:function set(J){this[d].timeline=J;},get:function get(){return this[d].timeline;}},{key:"ready",get:function get(){return this[E]?this[E].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[E]=(0,T.defer)(),this.timeline&&this[A](),this[E]?this[E].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[w]||(this[w]=(0,T.defer)(),this.timeline&&this[b]()),this[w].promise);}}]),j;}();e["default"]=R;},/* 191 *//***/function(u,e,t){u.exports={"default":t(192),__esModule:!0};},/* 192 *//***/function(u,e,t){t(143),t(125),t(79),t(193),t(202),t(203),u.exports=t(92).Promise;},/* 193 *//***/function(u,e,t){var r=t(89),n=t(91),i=t(93),l=t(128),o=t(90),a=t(98),f=t(94),g=t(147),c=t(148),m=t(194),x=t(195).set,M=t(197)(),S=t(198),P=t(199),T=t(200),h=t(201),p="Promise",d=n.TypeError,y=n.process,O=y&&y.versions,E=O&&O.v8||"",_w=n[p],B=l(y)=="process",A=function A(){},b,W,D,R,j=W=S.f,k=!!function(){try{var ct=_w.resolve(1),pt=(ct.constructor={})[t(122)("species")]=function(et){et(A,A);};return(B||typeof PromiseRejectionEvent=="function")&&ct.then(A)instanceof pt&&E.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),J=function J(ct){var pt;return a(ct)&&typeof(pt=ct.then)=="function"?pt:!1;},rt=function rt(ct,pt){if(!ct._n){ct._n=!0;var et=ct._c;M(function(){for(var gt=ct._v,Tt=ct._s==1,X=0,z=function z(Q){var tt=Tt?Q.ok:Q.fail,U=Q.resolve,H=Q.reject,C=Q.domain,L,F,G;try{tt?(Tt||(ct._h==2&&V(ct),ct._h=1),tt===!0?L=gt:(C&&C.enter(),L=tt(gt),C&&(C.exit(),G=!0)),L===Q.promise?H(d("Promise-chain cycle")):(F=J(L))?F.call(L,U,H):U(L)):H(gt);}catch(Z){C&&!G&&C.exit(),H(Z);}};et.length>X;)z(et[X++]);ct._c=[],ct._n=!1,pt&&!ct._h&&st(ct);});}},st=function st(ct){x.call(n,function(){var pt=ct._v,et=$(ct),gt,Tt,X;if(et&&(gt=P(function(){B?y.emit("unhandledRejection",pt,ct):(Tt=n.onunhandledrejection)?Tt({promise:ct,reason:pt}):(X=n.console)&&X.error&&X.error("Unhandled promise rejection",pt);}),ct._h=B||$(ct)?2:1),ct._a=void 0,et&&gt.e)throw gt.v;});},$=function $(ct){return ct._h!==1&&(ct._a||ct._c).length===0;},V=function V(ct){x.call(n,function(){var pt;B?y.emit("rejectionHandled",ct):(pt=n.onrejectionhandled)&&pt({promise:ct,reason:ct._v});});},nt=function nt(ct){var pt=this;pt._d||(pt._d=!0,pt=pt._w||pt,pt._v=ct,pt._s=2,pt._a||(pt._a=pt._c.slice()),rt(pt,!0));},_lt3=function lt(ct){var pt=this,et;if(!pt._d){pt._d=!0,pt=pt._w||pt;try{if(pt===ct)throw d("Promise can't be resolved itself");(et=J(ct))?M(function(){var gt={_w:pt,_d:!1};try{et.call(ct,i(_lt3,gt,1),i(nt,gt,1));}catch(Tt){nt.call(gt,Tt);}}):(pt._v=ct,pt._s=1,rt(pt,!1));}catch(gt){nt.call({_w:pt,_d:!1},gt);}}};k||(_w=function w(pt){g(this,_w,p,"_h"),f(pt),b.call(this);try{pt(i(_lt3,this,1),i(nt,this,1));}catch(et){nt.call(this,et);}},b=function b(pt){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},b.prototype=t(146)(_w.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
302
+ then:function then(pt,et){var gt=j(m(this,_w));return gt.ok=typeof pt=="function"?pt:!0,gt.fail=typeof et=="function"&&et,gt.domain=B?y.domain:void 0,this._c.push(gt),this._a&&this._a.push(gt),this._s&&rt(this,!1),gt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
303
+ "catch":function _catch(ct){return this.then(void 0,ct);}}),D=function D(){var ct=new b();this.promise=ct,this.resolve=i(_lt3,ct,1),this.reject=i(nt,ct,1);},S.f=j=function j(ct){return ct===_w||ct===R?new D(ct):W(ct);}),o(o.G+o.W+o.F*!k,{Promise:_w}),t(121)(_w,p),t(149)(p),R=t(92)[p],o(o.S+o.F*!k,p,{// 25.4.4.5 Promise.reject(r)
304
+ reject:function reject(pt){var et=j(this),gt=et.reject;return gt(pt),et.promise;}}),o(o.S+o.F*(r||!k),p,{// 25.4.4.6 Promise.resolve(x)
305
+ resolve:function resolve(pt){return h(r&&this===R?_w:this,pt);}}),o(o.S+o.F*!(k&&t(140)(function(ct){_w.all(ct)["catch"](A);})),p,{// 25.4.4.1 Promise.all(iterable)
306
+ all:function all(pt){var et=this,gt=j(et),Tt=gt.resolve,X=gt.reject,z=P(function(){var Q=[],tt=0,U=1;c(pt,!1,function(H){var C=tt++,L=!1;Q.push(void 0),U++,et.resolve(H).then(function(F){L||(L=!0,Q[C]=F,--U||Tt(Q));},X);}),--U||Tt(Q);});return z.e&&X(z.v),gt.promise;},// 25.4.4.4 Promise.race(iterable)
307
+ race:function race(pt){var et=this,gt=j(et),Tt=gt.reject,X=P(function(){c(pt,!1,function(z){et.resolve(z).then(gt.resolve,Tt);});});return X.e&&Tt(X.v),gt.promise;}});},/* 194 *//***/function(u,e,t){var r=t(97),n=t(94),i=t(122)("species");u.exports=function(l,o){var a=r(l).constructor,f;return a===void 0||(f=r(a)[i])==null?o:n(f);};},/* 195 *//***/function(u,e,t){var r=t(93),n=t(196),i=t(120),l=t(102),o=t(91),a=o.process,f=o.setImmediate,g=o.clearImmediate,c=o.MessageChannel,m=o.Dispatch,x=0,M={},S="onreadystatechange",P,T,h,p=function p(){var y=+this;if(M.hasOwnProperty(y)){var O=M[y];delete M[y],O();}},d=function d(y){p.call(y.data);};(!f||!g)&&(f=function f(O){for(var E=[],w=1;arguments.length>w;)E.push(arguments[w++]);return M[++x]=function(){n(typeof O=="function"?O:Function(O),E);},P(x),x;},g=function g(O){delete M[O];},t(86)(a)=="process"?P=function P(y){a.nextTick(r(p,y,1));}:m&&m.now?P=function P(y){m.now(r(p,y,1));}:c?(T=new c(),h=T.port2,T.port1.onmessage=d,P=r(h.postMessage,h,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(P=function P(y){o.postMessage(y+"","*");},o.addEventListener("message",d,!1)):S in l("script")?P=function P(y){i.appendChild(l("script"))[S]=function(){i.removeChild(this),p.call(y);};}:P=function P(y){setTimeout(r(p,y,1),0);}),u.exports={set:f,clear:g};},/* 196 *//***/function(u,e){u.exports=function(t,r,n){var i=n===void 0;switch(r.length){case 0:return i?t():t.call(n);case 1:return i?t(r[0]):t.call(n,r[0]);case 2:return i?t(r[0],r[1]):t.call(n,r[0],r[1]);case 3:return i?t(r[0],r[1],r[2]):t.call(n,r[0],r[1],r[2]);case 4:return i?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(u,e,t){var r=t(91),n=t(195).set,i=r.MutationObserver||r.WebKitMutationObserver,l=r.process,o=r.Promise,a=t(86)(l)=="process";u.exports=function(){var f,g,c,m=function m(){var P,T;for(a&&(P=l.domain)&&P.exit();f;){T=f.fn,f=f.next;try{T();}catch(h){throw f?c():g=void 0,h;}}g=void 0,P&&P.enter();};if(a)c=function c(){l.nextTick(m);};else if(i&&!(r.navigator&&r.navigator.standalone)){var x=!0,M=document.createTextNode("");new i(m).observe(M,{characterData:!0}),c=function c(){M.data=x=!x;};}else if(o&&o.resolve){var S=o.resolve(void 0);c=function c(){S.then(m);};}else c=function c(){n.call(r,m);};return function(P){var T={fn:P,next:void 0};g&&(g.next=T),f||(f=T,c()),g=T;};};},/* 198 *//***/function(u,e,t){var r=t(94);function n(i){var l,o;this.promise=new i(function(a,f){if(l!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");l=a,o=f;}),this.resolve=r(l),this.reject=r(o);}u.exports.f=function(i){return new n(i);};},/* 199 *//***/function(u,e){u.exports=function(t){try{return{e:!1,v:t()};}catch(r){return{e:!0,v:r};}};},/* 200 *//***/function(u,e,t){var r=t(91),n=r.navigator;u.exports=n&&n.userAgent||"";},/* 201 *//***/function(u,e,t){var r=t(97),n=t(98),i=t(198);u.exports=function(l,o){if(r(l),n(o)&&o.constructor===l)return o;var a=i.f(l),f=a.resolve;return f(o),a.promise;};},/* 202 *//***/function(u,e,t){var r=t(90),n=t(92),i=t(91),l=t(194),o=t(201);r(r.P+r.R,"Promise",{"finally":function _finally(a){var f=l(this,n.Promise||i.Promise),g=typeof a=="function";return this.then(g?function(c){return o(f,a()).then(function(){return c;});}:a,g?function(c){return o(f,a()).then(function(){throw c;});}:a);}});},/* 203 *//***/function(u,e,t){var r=t(90),n=t(198),i=t(199);r(r.S,"Promise",{"try":function _try(l){var o=n.f(this),a=i(l);return(a.e?o.reject:o.resolve)(a.v),o.promise;}});},/* 204 *//***/function(u,e,t){u.exports={"default":t(205),__esModule:!0};},/* 205 *//***/function(u,e,t){t(206),u.exports=t(92).Object.keys;},/* 206 *//***/function(u,e,t){var r=t(124),n=t(110);t(207)("keys",function(){return function(l){return n(r(l));};});},/* 207 *//***/function(u,e,t){var r=t(90),n=t(92),i=t(101);u.exports=function(l,o){var a=(n.Object||{})[l]||Object[l],f={};f[l]=o(a),r(r.S+r.F*i(function(){a(1);}),"Object",f);};},/* 208 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=M(r),i=t(209),l=M(i),o=t(164),a=M(o),f=t(191),g=M(f);e.defer=S,e.periodicity=P,e.calculateFramesOffset=T,e.getProgress=h,e.getCurrentFrame=d;var c=t(188),m=t(187),x=M(m);function M(y){return y&&y.__esModule?y:{"default":y};}function S(){var y={};return y.promise=new g["default"](function(O,E){y.resolve=O,y.reject=E;}),y;}function P(y,O){var E=Math.floor(y/O),w=y-E*O;return w===0&&E>0&&(w=O,E--),[E,w];}function T(y){y=y.slice(0);var O=y[0],E=y[y.length-1];E.offset=E.offset||1,O.offset=O.offset||0;for(var w=0,B=-1,A=0;A<y.length;A++){var b=y[A];if(b.offset!=null){var W=A-B;if(W>1)for(var D=(b.offset-w)/W,R=0;R<W-1;R++)y[B+R+1].offset=w+D*(R+1);w=b.offset,B=A;}if(b.easing!=null&&(b.easing=(0,c.parseEasing)(b.easing)),A>0){var j=y[A].easing!=null;y[A]=(0,a["default"])({},y[A-1],y[A]),j||delete y[A].easing;}}return y;}function h(y,O,E){var w=y.currentTime,B=O.direction,A=O.duration,b=!1;if(B==="reverse")E=1-E,b=!0;else if(B==="alternate"||B==="alternate-reverse"){var W=Math.floor(w/A);E===1&&W--,W%2^B==="alternate-reverse"&&(E=1-E,b=!0);}return{p:E,inverted:b};}function p(y,O,E,w){var B={};return(0,l["default"])(O).forEach(function(A){var b=(0,n["default"])(A,2),W=b[0],D=b[1];if(W!=="offset"&&W!=="easing"){var R=E[W]||E["default"],j=R(y[W],D,w,y.offset,O.offset);j!=null&&(B[W]=j);}}),B;}function d(y,O,E,w){var B=y.easing,A=y.effect;A||(E=(0,a["default"])({},x["default"],E));var b={};w=B(w,O);for(var W=1;W<O.length;W++){var D=O[W],R=D.offset;if(R>=w||W===O.length-1){var j=O[W-1],k=j.offset,J=j.easing,rt=w;if(J){var st=R-k;rt=J((w-k)/st)*st+k;}A?b=A(j,D,rt,k,R):b=p(j,D,E,rt);break;}}return b;}},/* 209 *//***/function(u,e,t){u.exports={"default":t(210),__esModule:!0};},/* 210 *//***/function(u,e,t){t(211),u.exports=t(92).Object.entries;},/* 211 *//***/function(u,e,t){var r=t(90),n=t(212)(!0);r(r.S,"Object",{entries:function entries(l){return n(l);}});},/* 212 *//***/function(u,e,t){var r=t(100),n=t(110),i=t(84),l=t(169).f;u.exports=function(o){return function(a){for(var f=i(a),g=n(f),c=g.length,m=0,x=[],M;c>m;)M=g[m++],(!r||l.call(f,M))&&x.push(o?[M,f[M]]:f[M]);return x;};};},/* 213 *//***/function(u,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array);var r=/* @__PURE__ */new Map();function n(l){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];l=l.toLowerCase();var f=r.get(l);if(!f)throw new TypeError("Invalid node: ".concat(l));var g=new f(o);return a.forEach(function(c){g.appendChild(c);}),g;}var i={registerNode:function registerNode(l,o){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),r.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));r.set(o,l),Object.defineProperties(l.prototype,{nodeType:{value:a},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(l,o){return n(o);},isSpriteNode:function isSpriteNode(l){return r.has(l.toLowerCase());}};e["default"]=i;},/* 214 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),l=Symbol("detail");var o=/*#__PURE__*/function(){function o(f){var _ref115=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref115$bubbles=_ref115.bubbles,g=_ref115$bubbles===void 0?null:_ref115$bubbles;_classCallCheck(this,o);if(typeof f=="string"?(this[r]=f,this[n]=!!g):(this[r]=f.type,this[i]=f,this[n]=g!=null?!!g:!!f.bubbles,f.detail&&(this[l]=f.detail)),!this[r])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(f){this[i]=f;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[r];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[l];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 *//***/function(u,e,t){t.r(e),t.d(e,"parseFilterString",function(){return n;}),t.d(e,"applyFilters",function(){return i;});var r=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(l){if(l=l.trim(),!l||l==="none")return null;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,a=l.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),f=[];return a&&a.forEach(function(g){var c=g.match(o);if(!c)throw new TypeError("Invalid fitler string.");var _c3=_slicedToArray(c,3),m=_c3[1],x=_c3[2];m=m.toLowerCase(),x=x.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(M,S){var P;return m==="url"||m==="drop-shadow"&&S===3?P=M:P=Object(r.toNumber)(M),/%$/.test(M)&&(P/=100),P;}),f.push({type:m,args:x});}),f;}function i(l,o){l.clearFilter(),o&&o.forEach(function(_ref116){var a=_ref116.type,f=_ref116.args;var g=a;g==="drop-shadow"?g="dropShadow":g==="hue-rotate"&&(g="hueRotate"),l[g].apply(l,_toConsumableArray(f));});}},/* 216 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n,i){if(!i)return;var l=n.getListeners("beforerender"),o=n.getListeners("afterrender");l.length&&!i.beforeRender?i.beforeRender=function(a){n.dispatchEvent({type:"beforerender",detail:{context:a}});}:l.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(a){n.dispatchEvent({type:"afterrender",detail:{context:a}});}:o.length||(i.afterRender=null);}},/* 217 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(12),n=t(218),i=t(70),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("amount"),a=Symbol("meshCloud");var f=/*#__PURE__*/function(_i$default){function f(c){var _this28;var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,f);_this28=_callSuper(this,f),_this28.meshNode=c,c.connect(_assertThisInitialized(_this28)),_this28[o]=m,_this28[a]=null;return _this28;}_inherits(f,_i$default);return _createClass(f,[{key:"meshCloud",get:function get(){var c=this.meshNode,m=this[o];return!this[a]&&c.mesh&&(this[a]=new r.MeshCloud(c.mesh,m)),this[a];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(c){this[o]=c,this[a]&&(this[a].amount=c);}},{key:"brightness",value:function brightness(c,m){this.meshCloud&&(this.meshCloud.brightness(c,m),this.forceUpdate());}},{key:"contrast",value:function contrast(c,m){this.meshCloud&&(this.meshCloud.contrast(c,m),this.forceUpdate());}},{key:"delete",value:function _delete(c){this.meshCloud&&(this.meshCloud["delete"](c),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this29=this;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(f,"draw",this,3)([c]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var m=this.shaderAttrs;m&&Object.entries(m).forEach(function(_ref117){var _ref118=_slicedToArray(_ref117,2),M=_ref118[0],S=_ref118[1];_this29.meshCloud.mesh.setAttribute(M,S);});var x=this.uniforms;if(this.uniforms){var M={};Object.entries(x).forEach(function(_ref119){var _ref120=_slicedToArray(_ref119,2),S=_ref120[0],P=_ref120[1];typeof P=="function"&&(P=P(_this29,S)),M[S]=P;}),this.meshCloud.mesh.setUniforms(M);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),c.push(this.meshCloud);}return c;}},{key:"getTransform",value:function getTransform(c){if(this.meshCloud)return this.meshCloud.getTransform(c);}},{key:"grayscale",value:function grayscale(c,m){this.meshCloud&&(this.meshCloud.grayscale(c,m),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(c,m){this.meshCloud&&(this.meshCloud.hueRotate(c,m),this.forceUpdate());}},{key:"invert",value:function invert(c,m){this.meshCloud&&(this.meshCloud.invert(c,m),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(c,m){if(!this.meshCloud)return!1;var x=this.attributes.pointerEvents;if(x==="none"||x!=="all"&&!this.isVisible)return!1;var M="both";x==="visibleFill"&&(M="fill"),x==="visibleStroke"&&(M="stroke");for(var S=0;S<this[o];S++)if(!this.meshCloud.isPointCollision(S,[c,m],M))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(c,m){this.meshCloud&&(this.meshCloud.opacity(c,m),this.forceUpdate());}},{key:"rotate",value:function rotate(c,m){var _ref121=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref122=_slicedToArray(_ref121,2),x=_ref122[0],M=_ref122[1];var S=Math.PI*m/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,P=_this$meshNode$attrib.x,_T12=_this$meshNode$attrib.y;this.meshCloud.rotate(c,S,[x+P,M+_T12]),this.forceUpdate();}}},{key:"saturate",value:function saturate(c,m){this.meshCloud&&(this.meshCloud.saturate(c,m),this.forceUpdate());}},{key:"scale",value:function scale(c,_ref123){var _ref124=_slicedToArray(_ref123,2),m=_ref124[0],_ref124$=_ref124[1],x=_ref124$===void 0?m:_ref124$;var _ref125=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref126=_slicedToArray(_ref125,2),M=_ref126[0],S=_ref126[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,P=_this$meshNode$attrib2.x,_T13=_this$meshNode$attrib2.y,_h12=1e-5;Math.abs(m)<_h12&&(m=1/m>0?_h12:-_h12),Math.abs(x)<_h12&&(x=1/x>0?_h12:-_h12),this.meshCloud.scale(c,[m,x],[M+P,S+_T13]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(c,m){this.meshCloud&&(this.meshCloud.setColorTransform(c,m),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(c,m){this.meshCloud&&(Array.isArray(m)&&(m=_toConsumableArray(m),m[0]/=255,m[1]/=255,m[2]/=255),this.meshCloud.setFillColor(c,m),this.forceUpdate());}},{key:"sepia",value:function sepia(c,m){this.meshCloud&&(this.meshCloud.sepia(c,m),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref127){var c=_ref127.width,m=_ref127.height;_superPropGet(f,"setResolution",this,3)([{width:c,height:m}]),this.meshNode.setResolution({width:c,height:m});}},{key:"setStrokeColor",value:function setStrokeColor(c,m){this.meshCloud&&(Array.isArray(m)&&(m=_toConsumableArray(m),m[0]/=255,m[1]/=255,m[2]/=255),this.meshCloud.setStrokeColor(c,m),this.forceUpdate());}},{key:"setTransform",value:function setTransform(c,m){this.meshCloud&&(this.meshCloud.setTransform(c,m),this.forceUpdate());}},{key:"skew",value:function skew(c,_ref128){var _ref129=_slicedToArray(_ref128,2),m=_ref129[0],_ref129$=_ref129[1],x=_ref129$===void 0?m:_ref129$;var _ref130=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref131=_slicedToArray(_ref130,2),M=_ref131[0],S=_ref131[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,P=_this$meshNode$attrib3.x,_T14=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[m,x],[M+P,S+_T14]),this.forceUpdate();}}},{key:"transform",value:function transform(c,m){this.meshCloud&&(this.meshCloud.transform(c,m),this.forceUpdate());}},{key:"transformColor",value:function transformColor(c,m){this.meshCloud&&(this.meshCloud.transformColor(c,m),this.forceUpdate());}},{key:"translate",value:function translate(c,_ref132){var _ref133=_slicedToArray(_ref132,2),m=_ref133[0],x=_ref133[1];this.meshCloud&&(this.meshCloud.translate(c,[m,x]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[a]&&(this[a].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);l["default"].registerNode(f,"cloud");},/* 218 *//***/function(u,e,t){t.r(e),t.d(e,"loadTexture",function(){return l;}),t.d(e,"applyTexture",function(){return o;}),t.d(e,"createTexture",function(){return f;}),t.d(e,"deleteTexture",function(){return g;}),t.d(e,"drawTexture",function(){return m;}),t.d(e,"loadFrames",function(){return x;});var r=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function l(M,S){if(i[M])return i[M];var P=r.ENV.loadImage(M,{alias:S,useImageBitmap:!1});return P!==null&&P!==void 0?P:M;}function o(_x22,_x23,_x24){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(M,S,P){var T,_M$attributes,_h13,p,d,y;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:T=S;typeof S=="string"&&(T=l(S));_context18.t0=T&&typeof T.then=="function";if(!_context18.t0){_context18.next=7;break;}_context18.next=6;return T;case 6:T=_context18.sent;case 7:if(!(S===M.attributes.texture)){_context18.next=11;break;}T&&T.image&&(T.sourceRect&&(M.attributes.sourceRect=T.sourceRect),M.textureImageRotated=!!T.rotated,T=T.image);_M$attributes=M.attributes,_h13=_M$attributes.width,p=_M$attributes.height,d=_M$attributes.textureRect,y=M.textureImage;M.textureImage=T,P&&y!==T&&!d&&(_h13==null||p==null)&&M.updateContours(),M.forceUpdate();case 11:return _context18.abrupt("return",T);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var a=Symbol("textureMap");function f(M,S){if(S[a]=S[a]||/* @__PURE__ */new Map(),S[a].has(M))return S[a].get(M);var P=S.createTexture(M);return!/^blob:/.test(M.src)&&typeof M.getContext!="function"&&S[a].set(M,P),P;}function g(M,S){if(S[a]&&S[a].has(M)){var P=S[a].get(M);return S.deleteTexture(P),S[a]["delete"](M),!0;}return!1;}var c=Symbol("textureContext");function m(M,S){var P=M.textureImage instanceof String?String(M.textureImage):M.textureImage,T=M.textureImageRotated,h=S.texture,p=M.renderer;if(P){var d=M.originalContentRect;var y=M.attributes.textureRect;var O=M.attributes.textureRepeat,E=M.attributes.sourceRect;if(!h||M[c]&&M[c]!==p||h.image!==P||h.options.repeat!==O||!Object(n.compareValue)(h.options.rect,y)||!Object(n.compareValue)(h.options.srcRect,E)){var w=f(P,p);y?(y[0]+=d[0],y[1]+=d[1]):y=d;var B=null;h&&!p[a].has(h.image)&&(!h.options||!h.options.hidden)&&(B=S.uniforms.u_texSampler),S.setTexture(w,{rect:y,repeat:O,srcRect:E,rotated:T}),B&&B["delete"]&&B["delete"](),M[c]=p;}}else if(h){var _d8=null;!p[a].has(h.image)&&(!h.options||!h.options.hidden)&&(_d8=S.uniforms.u_texSampler),S.setTexture(null),_d8&&_d8["delete"]&&_d8["delete"]();}}function x(_x25,_x26){return _x27.apply(this,arguments);}function _x27(){_x27=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(M,S){var P,T;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.t0=typeof S=="string";if(!_context19.t0){_context19.next=7;break;}_context19.next=4;return fetch(S,{method:"GET",mode:"cors",cache:"default"});case 4:_context19.next=6;return _context19.sent.json();case 6:S=_context19.sent;case 7:_context19.next=9;return l(M);case 9:P=_context19.sent;T=S.frames;return _context19.abrupt("return",(Object.entries(T).forEach(function(_ref134){var _ref135=_slicedToArray(_ref134,2),h=_ref135[0],p=_ref135[1];var _p$frame=p.frame,d=_p$frame.x,y=_p$frame.y,O=_p$frame.w,E=_p$frame.h;var w=[d,y,O,E];var B=p.rotated;B&&(w=[w[0],w[1],w[3],w[2]]),i[h]={image:P,sourceRect:w,rotated:B};}),P));case 12:case"end":return _context19.stop();}},_callee19);}));return _x27.apply(this,arguments);}},/* 219 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return x;});var r=t(1),n=t(12),i=t(70),l=t(220),o=t(221),a=t(222),f=t(213),g=t(223);t(1).glMatrix.setMatrixArrayType(Array);function c(M,S,P){return S in M?Object.defineProperty(M,S,{value:P,enumerable:!0,configurable:!0,writable:!0}):M[S]=P,M;}var m=Symbol("mesh");var x=/*#__PURE__*/function(_i$default2){function x(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,x);return _callSuper(this,x,[S]);}_inherits(x,_i$default2);return _createClass(x,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,S=_this$attributes2.paddingTop,P=_this$attributes2.paddingRight,T=_this$attributes2.paddingBottom,h=_this$attributes2.paddingLeft,p=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),d=_this$contentSize[0],y=_this$contentSize[1];return[h+d+P+p,S+y+T+p];}// content + padding
308
+ },{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,S=_this$attributes3.paddingTop,P=_this$attributes3.paddingRight,T=_this$attributes3.paddingBottom,h=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),p=_this$contentSize2[0],d=_this$contentSize2[1];return[h+p+P,S+d+T];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,S=_this$attributes4.width,P=_this$attributes4.height,T=_this$attributes4.boxSizing,h=_this$attributes4.paddingTop,p=_this$attributes4.paddingRight,d=_this$attributes4.paddingBottom,y=_this$attributes4.paddingLeft;if(S=S||0,P=P||0,T==="border-box"){var O=2*this.attributes.borderWidth;S-=O+p+y,P-=O+h+d,S=Math.max(0,S),P=Math.max(0,P);}return[S,P];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),S=_this$borderSize[0],P=_this$borderSize[1];return S>0&&P>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var S=this.clientBox;if(S){var _P5;var P=this[m];if(P)P.box!==S&&(P.contours=S.contours,P.box=S);else{P=new n.Mesh2D(S),P.box=S;var _h14=this.attributes.bgcolor;if(Object(o.setFillColor)(P,{color:_h14}),this.hasBorder){var _this$attributes5=this.attributes,d=_this$attributes5.borderColor,y=_this$attributes5.borderWidth,O=_this$attributes5.borderDash,E=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(P,{color:d,lineWidth:y,lineDash:O,lineDashOffset:E});}this[m]=P;var p=this.attributes.clipPath;p&&this[m].setClipPath(p);}var _T15=this.opacity;return P.getOpacity()!==_T15&&P.setOpacity(_T15),(_P5=P).setTransform.apply(_P5,_toConsumableArray(this.renderMatrix)),P;}return null;}// content + padding + border
309
+ },{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,S=_this$attributes6.paddingTop,P=_this$attributes6.paddingRight,T=_this$attributes6.paddingBottom,h=_this$attributes6.paddingLeft,p=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),d=_this$contentSize3[0],y=_this$contentSize3[1],O=2*p;return[h+d+P+O,S+y+T+O];}},{key:"originalClientRect",get:function get(){if(this.mesh){var S=this.mesh.boundingBox;return[S[0][0],S[0][1],S[1][0]-S[0][0],S[1][1]-S[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),S=_this$originalClientR[0],P=_this$originalClientR[1],T=_this$originalClientR[2],h=_this$originalClientR[3],p=this.attributes.padding;return[S+p[0],P+p[1],T-p[0]-p[2],h-p[1]-p[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var S=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(S=r.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,S));var P=null;if(this.mesh){P=_toConsumableArray(this.mesh.boundingBox);var _T16=this.attributes.borderWidth;_T16&&(P[0]=[P[0][0]-_T16,P[0][1]-_T16],P[1]=[P[1][0]+_T16,P[1][1]+_T16]);}return Object(g["default"])(P,S);}// transformPoint(x, y) {
310
+ // const m = mat2d.invert(this.renderMatrix);
311
+ // const newX = x * m[0] + y * m[2] + m[4];
312
+ // const newY = x * m[1] + y * m[3] + m[5];
313
+ // return [newX, newY];
314
+ // }
315
+ /* override */},{key:"onPropertyChange",value:function onPropertyChange(S,P,T){if(_superPropGet(x,"onPropertyChange",this,3)([S,P,T]),(S==="anchorX"||S==="anchorY"||S==="boxSizing"||S==="width"||S==="height"||S==="borderWidth"||S==="paddingLeft"||S==="paddingRight"||S==="paddingTop"||S==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(S))&&this.updateContours(),this[m]&&S==="clipPath"&&this[m].setClipPath(P),this[m]&&S==="bgcolor"&&Object(o.setFillColor)(this[m],{color:P}),this[m]&&(S==="borderColor"||S==="borderWidth"||S==="borderDash"||S==="borderDashOffset")){var _this$attributes7=this.attributes,_h15=_this$attributes7.borderColor,p=_this$attributes7.borderWidth,d=_this$attributes7.borderDash,y=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[m],{color:_h15,lineWidth:p,lineDash:p?d:0,lineDashOffset:y});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,S=_this$attributes8.anchorX,P=_this$attributes8.anchorY,T=_this$attributes8.borderWidth,h=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),p=_this$borderSize2[0],d=_this$borderSize2[1],y=this.offsetSize,O=0.5*T,E=-S*y[0]+O,w=-P*y[1]+O;this.clientBox=new n.Figure2D(),Object(a.createRadiusBox)(this.clientBox,[E,w,p,d],h);}}]);}(i["default"]);c(x,"Attr",l["default"]),f["default"].registerNode(x,"block");},/* 220 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return g;});var r=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_declareAlias");var g=/*#__PURE__*/function(_r$default){function g(m){var _this30;_classCallCheck(this,g);_this30=_callSuper(this,g,[m]),_this30[a]({anchorX:0,anchorY:0,/* anchor */width:void 0,height:void 0,/* size */borderWidth:0,borderColor:"rgba(0,0,0,1)",/* border */borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],/* borderRadius */bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,/* padding */boxSizing:"content-box",clipPath:void 0}),_this30[f]("anchor","size","border","borderRadius","padding");return _this30;}_inherits(g,_r$default);return _createClass(g,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(m){this[l]("anchorX",Object(n.toNumber)(m));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(m){this[l]("anchorY",Object(n.toNumber)(m));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(m){m=Object(n.toArray)(m),Array.isArray(m)||(m=[m,m]),this.anchorX=m[0],this.anchorY=m[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(m){this[l]("width",Object(n.toNumber)(m));}},{key:"height",get:function get(){return this[o]("height");},set:function set(m){this[l]("height",Object(n.toNumber)(m));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(m){m=Object(n.toArray)(m),Array.isArray(m)||(m=[m,m]),this.width=m[0],this.height=m[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(m){this[l]("borderWidth",Object(n.toNumber)(m));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(m){this[l]("borderColor",Object(i.parseColor)(m));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(m){m=Object(n.toArray)(m),Array.isArray(m)||(m=[m]),this.borderWidth=m[0],m[1]!=null&&(this.borderColor=m[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(m){m=Object(n.toArray)(m,!0),m!=null&&!Array.isArray(m)&&(m=[m]),this[l]("borderDash",m?m.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(m){this[l]("borderDashOffset",Object(n.toNumber)(m));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(m){m=Object(n.toArray)(m,!0),Array.isArray(m)||(m=[m,m]),this[l]("borderTopLeftRadius",m.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(m){m=Object(n.toArray)(m,!0),Array.isArray(m)||(m=[m,m]),this[l]("borderTopRightRadius",m.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(m){m=Object(n.toArray)(m,!0),Array.isArray(m)||(m=[m,m]),this[l]("borderBottomRightRadius",m.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(m){m=Object(n.toArray)(m,!0),Array.isArray(m)||(m=[m,m]),this[l]("borderBottomLeftRadius",m.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(m){if(m=Object(n.toArray)(m),!Array.isArray(m))m=Array(8).fill(m);else if(m.length===2)m=[m[0],m[1],m[0],m[1],m[0],m[1],m[0],m[1]];else if(m.length===4)m=[m[0],m[1],m[2],m[3],m[0],m[1],m[2],m[3]];else if(m.length===6)m=[m[0],m[1],m[2],m[3],m[4],m[5],m[2],m[3]];else if(m.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[m[0],m[1]],this.borderTopRightRadius=[m[2],m[3]],this.borderBottomRightRadius=[m[4],m[5]],this.borderBottomLeftRadius=[m[6],m[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(m){this[l]("bgcolor",Object(i.parseColor)(m));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(m){this[l]("paddingTop",Object(n.toNumber)(m));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(m){this[l]("paddingRight",Object(n.toNumber)(m));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(m){this[l]("paddingBottom",Object(n.toNumber)(m));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(m){this[l]("paddingLeft",Object(n.toNumber)(m));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(m){m=Object(n.toArray)(m),Array.isArray(m)?m.length===2?m=[m[0],m[1],m[0],m[1]]:m.length===3&&(m=[m[0],m[1],m[2],m[1]]):m=[m,m,m,m],this.paddingTop=m[0],this.paddingRight=m[1],this.paddingBottom=m[2],this.paddingLeft=m[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(m){this[l]("clipPath",m);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(m){if(m!=null&&m!=="border-box"&&m!=="content-box")throw new TypeError("Invalid boxSizing type.");this[l]("boxSizing",m);}}]);}(r["default"]);},/* 221 *//***/function(u,e,t){t.r(e),t.d(e,"Gradient",function(){return i;}),t.d(e,"isTransparent",function(){return l;}),t.d(e,"parseColor",function(){return o;}),t.d(e,"setFillColor",function(){return f;}),t.d(e,"setStrokeColor",function(){return g;}),t.d(e,"Color",function(){return c;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref136){var x=_ref136.vector,M=_ref136.colors;_classCallCheck(this,i);if(!Array.isArray(x)||x.length!==4&&x.length!==6&&x.length!==3)throw new TypeError("Invalid gradient");this.vector=x,this.colors=M.map(function(_ref137){var S=_ref137.offset,P=_ref137.color;return{offset:S,color:o(P)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function l(m){return m instanceof i?!1:m==null?!0:n()(m)[3]===0;}function o(m){if(m==null||(m||(m="transparent"),m instanceof i))return m;var x=n()(m);if(!x||!x.length)throw new TypeError("Invalid color value.");return"rgba(".concat(x.join(),")");}function a(m,x,M){var S=m.boundingBox[0];if(M.vector){var P=M.vector,_T17=M.colors;P.length===4?(P=[P[0]+S[0],P[1]+S[1],P[2]+S[0],P[3]+S[1]],m.setLinearGradient({vector:P,colors:_T17,type:x})):P.length===3?(P=[P[0]+S[0],P[1]+S[1],P[2]],m.setCircularGradient({vector:P,colors:_T17,type:x})):(P=[P[0]+S[0],P[1]+S[1],P[2],P[3]+S[0],P[4]+S[1],P[5]],m.setRadialGradient({vector:P,colors:_T17,type:x}));}else m.gradient&&m.gradient[x]&&(delete m.gradient[x],delete m.uniforms.u_radialGradientVector);}function f(m,_ref138){var x=_ref138.color,_ref138$rule=_ref138.rule,M=_ref138$rule===void 0?"nonzero":_ref138$rule;return a(m,"fill",x),x.vector||m.setFill({color:x,rule:M}),m;}function g(m,_ref139){var x=_ref139.color,M=_ref139.lineWidth,S=_ref139.lineCap,P=_ref139.lineJoin,T=_ref139.lineDash,h=_ref139.lineDashOffset,p=_ref139.miterLimit,d=_ref139.roundSegments;a(m,"stroke",x),x.vector&&(x=[0,0,0,1]),m.setStroke({color:x,thickness:M,cap:S,join:P,miterLimit:p,lineDash:T,lineDashOffset:h,roundSegments:d});}var c=/*#__PURE__*/function(_Array){function c(){var _x28,_x29,_n2,_n3;var _this31;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,c);return _possibleConstructorReturn(_this31,(Array.isArray(x)&&(_x28=x,_x29=_slicedToArray(_x28,4),x=_x29[0],M=_x29[1],S=_x29[2],P=_x29[3],_x28),typeof x=="string"&&(_n2=n()(x),_n3=_slicedToArray(_n2,4),x=_n3[0],M=_n3[1],S=_n3[2],P=_n3[3],x/=255,M/=255,S/=255),_this31=_callSuper(this,c,[x,M,S,P]),_assertThisInitialized(_this31)));}_inherits(c,_Array);return _createClass(c,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(x){this[0]=x/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(x){this[1]=x/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(x){this[2]=x/255;}},{key:"a",get:function get(){return this[3];},set:function set(x){this[3]=x;}},{key:"hex",get:function get(){var x="0".concat(this.r.toString(16)).slice(-2),M="0".concat(this.g.toString(16)).slice(-2),S="0".concat(this.b.toString(16)).slice(-2);var P;return this.a<1&&(P=Math.round(this[3]*255),P="0".concat(P.toString(16)).slice(-2)),"#".concat(x).concat(M).concat(S).concat(P||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(x){return typeof x=="string"&&(x=n()(x),x[0]/=255,x[1]/=255,x[2]/=255),this[0]=x[0],this[1]=x[1],this[2]=x[2],this[3]=x[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 *//***/function(u,e,t){t.r(e),t.d(e,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(i,l,o,a,f){var g=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var c=0.5522848,m=a/2*c,x=f/2*c,M=l+a,S=o+f,P=l+a/2,T=o+f/2;g==="leftTop"?(i.moveTo(l,T),i.bezierCurveTo(l,T-x,P-m,o,P,o)):g==="rightTop"?i.bezierCurveTo(P+m,o,M,T-x,M,T):g==="rightBottom"?i.bezierCurveTo(M,T+x,P+m,S,P,S):g==="leftBottom"&&i.bezierCurveTo(P-m,S,l,T+x,l,T);}function n(i,_ref140,g){var _ref141=_slicedToArray(_ref140,4),l=_ref141[0],o=_ref141[1],a=_ref141[2],f=_ref141[3];if(!g||Array.isArray(g)&&g.every(function(c){return c===0;}))i.beginPath(),i.rect(l,o,a,f);else{typeof g=="number"&&(g=Array(8).fill(g));var _g$map=g.map(function(p,d){return d%2?Math.min(p,f/2):Math.min(p,a/2);}),_g$map2=_slicedToArray(_g$map,8),c=_g$map2[0],m=_g$map2[1],x=_g$map2[2],M=_g$map2[3],S=_g$map2[4],P=_g$map2[5],_T18=_g$map2[6],_h16=_g$map2[7];i.beginPath(),i.moveTo(l,o+m),r(i,l,o,c*2,m*2,"leftTop"),i.lineTo(l+a-x,o),r(i,l+a-x*2,o,x*2,M*2,"rightTop"),i.lineTo(l+a,o+f-P),r(i,l+a-S*2,o+f-P*2,S*2,P*2,"rightBottom"),i.lineTo(l+_T18,o+f),r(i,l,o+f-_h16*2,_T18*2,_h16*2,"leftBottom"),i.closePath();}return i;}},/* 223 *//***/function(u,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),i=_r2$[0],l=_r2$[1],_r2$2=_slicedToArray(_r2[1],2),o=_r2$2[0],a=_r2$2[1],f=i*n[0]+l*n[2]+n[4],g=i*n[1]+l*n[3]+n[5],c=o*n[0]+l*n[2]+n[4],m=o*n[1]+l*n[3]+n[5],x=o*n[0]+a*n[2]+n[4],M=o*n[1]+a*n[3]+n[5],S=i*n[0]+a*n[2]+n[4],P=i*n[1]+a*n[3]+n[5],T=Math.min(f,c,x,S),h=Math.min(g,m,M,P),p=Math.max(f,c,x,S),d=Math.max(g,m,M,P);return{x:T,y:h,width:p-T,height:d-h,left:T,top:h,right:p,bottom:d};};},/* 224 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(218),n=t(219),i=t(225),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(g,c,m){return c in g?Object.defineProperty(g,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):g[c]=m,g;}var a=Symbol("textureTask");var f=/*#__PURE__*/function(_n$default){function f(){var _this32;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,f);typeof c=="string"&&(c={texture:c}),_this32=_callSuper(this,f,[c]);return _this32;}/* override */_inherits(f,_n$default);return _createClass(f,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(f,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),c=_superPropGet3[0],m=_superPropGet3[1];var _this$attributes9=this.attributes,x=_this$attributes9.width,M=_this$attributes9.height;if(x==null||M==null){var S=this.textureImage,P=this.attributes.textureRect,_T19=this.attributes.sourceRect;if(P)x==null&&(c=P[0]+P[2]),M==null&&(m=P[1]+P[3]);else if(_T19){var _h17=this.layer?this.layer.displayRatio:1;x==null&&(c=_T19[2]/_h17),M==null&&(m=_T19[3]/_h17);}else if(S){var _h18=this.layer?this.layer.displayRatio:1;x==null&&(c=S.width/_h18),M==null&&(m=S.height/_h18);}}return[c,m];}},{key:"textureImageReady",get:function get(){return this[a]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(f,"draw",this,3)([c]);var m=this.mesh;return m&&Object(r.drawTexture)(this,m),c;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(c,m,x){if(_superPropGet(f,"onPropertyChange",this,3)([c,m,x]),c==="texture"&&(this[a]=Object(r.applyTexture)(this,m,!0)),c==="textureRect"){var _this$attributes10=this.attributes,M=_this$attributes10.width,S=_this$attributes10.height;(M==null||S==null)&&this.updateContours();}}}]);}(n["default"]);o(f,"Attr",i["default"]),l["default"].registerNode(f,"sprite");},/* 225 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_r$default2){function o(f){var _this33;_classCallCheck(this,o);_this33=_callSuper(this,o,[f]),_this33[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this33;}_inherits(o,_r$default2);return _createClass(o,[{key:"texture",get:function get(){return this[l]("texture");},set:function set(f){this[i]("texture",f);}},{key:"textureRect",get:function get(){return this[l]("textureRect");},set:function set(f){this[i]("textureRect",f);}},{key:"sourceRect",get:function get(){return this[l]("sourceRect");},set:function set(f){this[i]("sourceRect",f);}},{key:"textureRepeat",get:function get(){return this[l]("textureRepeat");},set:function set(f){this[i]("textureRepeat",!!f);}}]);}(r["default"]);},/* 226 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return M;});var r=t(12),n=t(227),i=/* @__PURE__ */t.n(n),l=t(70),o=t(228),a=t(221),f=t(218),g=t(213),c=t(223);t(1).glMatrix.setMatrixArrayType(Array);function m(S,P,T){return P in S?Object.defineProperty(S,P,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[P]=T,S;}var x=Symbol("mesh");var M=/*#__PURE__*/function(_l$default){function M(){var _this34;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof P=="string"&&(P={d:P}),_this34=_callSuper(this,M,[P]),_this34.effects={d:function d(T,h,p,_d9,y){var _i$a;var O=(p-_d9)/(y-_d9);if(O<=0)return T;if(O>=1)return h;var E=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(h)),w=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(E).concat([O]))[0];return w.reduce(function(A,b){return"".concat(A).concat(b.slice(2).join(" ")," ");},"M".concat(w[0][0]," ").concat(w[0][1],"C")).trim();}};return _this34;}/* override */_inherits(M,_l$default);return _createClass(M,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var P=this.path;if(P){var _T21;var _T20=this[x];if(_T20)_T20.path!==P&&(_T20.contours=P.contours,_T20.path=P);else{_T20=new r.Mesh2D(this.path),_T20.path=P;var p=this.attributes.fillColor,d=this.attributes.fillRule;p&&Object(a.setFillColor)(_T20,{color:p,rule:d});var y=this.attributes.lineWidth,O=this.attributes.strokeColor;if(O&&y>0){var _this$attributes11=this.attributes,w=_this$attributes11.lineCap,B=_this$attributes11.lineJoin,A=_this$attributes11.miterLimit,b=_this$attributes11.lineDash,W=_this$attributes11.lineDashOffset,D=_this$attributes11.roundSegments;Object(a.setStrokeColor)(_T20,{color:O,lineWidth:y,lineCap:w,lineJoin:B,miterLimit:A,lineDash:b,lineDashOffset:W,roundSegments:D});}this[x]=_T20;var E=this.attributes.clipPath;E&&this[x].setClipPath(E);}var _h19=this.opacity;return _T20.getOpacity()!==_h19&&_T20.setOpacity(_h19),(_T21=_T20).setTransform.apply(_T21,_toConsumableArray(this.renderMatrix)),_T20;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var P=this.path.boundingBox;return[P[0][0],P[0][1],P[1][0]-P[0][0],P[1][1]-P[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var P=this.mesh.boundingBox;return[P[0][0],P[0][1],P[1][0]-P[0][0],P[1][1]-P[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(P){this.attributes.d=P;}},{key:"draw",value:function draw(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(M,"draw",this,3)([P]);var T=this.mesh;return T&&Object(f.drawTexture)(this,T),P;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var P=null;return this.mesh&&(P=this.mesh.boundingBox),Object(c["default"])(P,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(P){if(this.mesh){var _T22=this.mesh.getPointAtLength(P);if(_T22)return[_T22.x,_T22.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,T,h){if(_superPropGet(M,"onPropertyChange",this,3)([P,T,h]),(P==="d"||P==="normalize")&&this.updateContours(),this[x]&&(P==="fillColor"||P==="fillRule")){var _this$attributes12=this.attributes,p=_this$attributes12.fillColor,d=_this$attributes12.fillRule;Object(a.setFillColor)(this[x],{color:p,rule:d});}if(this[x]&&(P==="strokeColor"||P==="lineWidth"||P==="lineCap"||P==="lineJoin"||P==="lineDash"||P==="lineDashOffset"||P==="roundSegments")){var _this$attributes13=this.attributes,_p4=_this$attributes13.strokeColor,_d10=_this$attributes13.lineWidth;if(_p4&&_d10>0){var _this$attributes14=this.attributes,y=_this$attributes14.lineCap,O=_this$attributes14.lineJoin,E=_this$attributes14.lineDash,w=_this$attributes14.lineDashOffset,B=_this$attributes14.miterLimit,A=_this$attributes14.roundSegments;Object(a.setStrokeColor)(this[x],{color:_p4,lineCap:y,lineJoin:O,lineWidth:_d10,lineDash:E,lineDashOffset:w,miterLimit:B,roundSegments:A});}}this[x]&&P==="clipPath"&&this[x].setClipPath(T),P==="texture"&&Object(f.applyTexture)(this,T);}/* 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));}}]);}(l["default"]);m(M,"Attr",o["default"]),g["default"].registerNode(M,"path");},/* 227 *//***/function(u,e,t){(function(r,n){u.exports=n();})(this,function(){var r=/* @__PURE__ */function(){function b(W,D){var R=[],j=!0,k=!1,J=void 0;try{for(var rt=W[Symbol.iterator](),st;!(j=(st=rt.next()).done)&&(R.push(st.value),!(D&&R.length===D));j=!0);}catch($){k=!0,J=$;}finally{try{!j&&rt["return"]&&rt["return"]();}finally{if(k)throw J;}}return R;}return function(W,D){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return b(W,D);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(W,D,R,j,k,J,rt){var st=W.x,$=W.y;st*=D,$*=R;var V=j*st-k*$,nt=k*st+j*$;return{x:V+J,y:nt+rt};},l=function l(W,D){var R=1.3333333333333333*Math.tan(D/4),j=Math.cos(W),k=Math.sin(W),J=Math.cos(W+D),rt=Math.sin(W+D);return[{x:j-k*R,y:k+j*R},{x:J+rt*R,y:rt-J*R},{x:J,y:rt}];},o=function o(W,D,R,j){var k=W*j-D*R<0?-1:1,J=Math.sqrt(W*W+D*D),rt=Math.sqrt(W*W+D*D),st=W*R+D*j,$=st/(J*rt);return $>1&&($=1),$<-1&&($=-1),k*Math.acos($);},a=function a(W,D,R,j,k,J,rt,st,$,V,nt,lt){var ct=Math.pow(k,2),pt=Math.pow(J,2),et=Math.pow(nt,2),gt=Math.pow(lt,2),Tt=ct*pt-ct*gt-pt*et;Tt<0&&(Tt=0),Tt/=ct*gt+pt*et,Tt=Math.sqrt(Tt)*(rt===st?-1:1);var X=Tt*k/J*lt,z=Tt*-J/k*nt,Q=V*X-$*z+(W+R)/2,tt=$*X+V*z+(D+j)/2,U=(nt-X)/k,H=(lt-z)/J,C=(-nt-X)/k,L=(-lt-z)/J,F=o(1,0,U,H),G=o(U,H,C,L);return st===0&&G>0&&(G-=n),st===1&&G<0&&(G+=n),[Q,tt,F,G];},f=function f(W){var D=W.px,R=W.py,j=W.cx,k=W.cy,J=W.rx,rt=W.ry,st=W.xAxisRotation,$=st===void 0?0:st,V=W.largeArcFlag,nt=V===void 0?0:V,lt=W.sweepFlag,ct=lt===void 0?0:lt,pt=[];if(J===0||rt===0)return[];var et=Math.sin($*n/360),gt=Math.cos($*n/360),Tt=gt*(D-j)/2+et*(R-k)/2,X=-et*(D-j)/2+gt*(R-k)/2;if(Tt===0&&X===0)return[];J=Math.abs(J),rt=Math.abs(rt);var z=Math.pow(Tt,2)/Math.pow(J,2)+Math.pow(X,2)/Math.pow(rt,2);z>1&&(J*=Math.sqrt(z),rt*=Math.sqrt(z));var Q=a(D,R,j,k,J,rt,nt,ct,et,gt,Tt,X),tt=r(Q,4),U=tt[0],H=tt[1],C=tt[2],L=tt[3],F=Math.max(Math.ceil(Math.abs(L)/(n/4)),1);L/=F;for(var G=0;G<F;G++)pt.push(l(C,L)),C+=L;return pt.map(function(Z){var q=i(Z[0],J,rt,gt,et,U,H),it=q.x,ut=q.y,mt=i(Z[1],J,rt,gt,et,U,H),Pt=mt.x,Ct=mt.y,yt=i(Z[2],J,rt,gt,et,U,H),vt=yt.x,xt=yt.y;return{x1:it,y1:ut,x2:Pt,y2:Ct,x:vt,y:xt};});},g={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
316
+ * segment pattern
317
+ * @type {RegExp}
318
+ */},c=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function m(b){var W=[];return b.replace(c,function(D,R,j){var k=R.toLowerCase();for(j=M(j),k=="m"&&j.length>2&&(W.push([R].concat(j.splice(0,2))),k="l",R=R=="m"?"l":"L");;){if(j.length==g[k])return j.unshift(R),W.push(j);if(j.length<g[k])throw new Error("malformed path data");W.push([R].concat(j.splice(0,g[k])));}}),W;}var x=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function M(b){var W=b.match(x);return W?W.map(Number):[];}function S(b){var W=b[0][0],D=b[0][1],R=W,j=D;return b.forEach(function(k){var J=k[0],rt=k[2],st=k[4],$=k[6],V=k[1],nt=k[3],lt=k[5],ct=k[7];W=Math.min(W,J,rt,st,$),D=Math.min(D,V,nt,lt,ct),R=Math.max(R,J,rt,st,$),j=Math.max(j,V,nt,lt,ct);}),[W,D,R,j];}function P(b,W){return Math.sqrt(Math.pow(b[0]-W[0],2)+Math.pow(b[1]-W[1],2))+Math.sqrt(Math.pow(b[2]-W[2],2)+Math.pow(b[3]-W[3],2));}function T(b,W){var D=b[0],R=b[2],j=b[4],k=b[6],J=b[1],rt=b[3],st=b[5],$=b[7],V=W[0],nt=W[2],lt=W[4],ct=W[6],pt=W[1],et=W[3],gt=W[5],Tt=W[7];return Math.sqrt(Math.pow(V-D,2)+Math.pow(pt-J,2))+Math.sqrt(Math.pow(nt-R,2)+Math.pow(et-rt,2))+Math.sqrt(Math.pow(lt-j,2)+Math.pow(gt-st,2))+Math.sqrt(Math.pow(ct-k,2)+Math.pow(Tt-$,2));}function h(b,W){var D=d(b.length),R=[];D.forEach(function(k){var J=0,rt=0;k.forEach(function(st){J+=T(b[st],W[rt++]);}),R.push({index:k,distance:J});}),R.sort(function(k,J){return k.distance-J.distance;});var j=[];return R[0].index.forEach(function(k){j.push(b[k]);}),j;}function p(b,W){var D=y(b.length),R=[];D.forEach(function(k){var J=0;k.forEach(function(rt){J+=P(S(b[rt]),S(W[rt]));}),R.push({index:k,distance:J});}),R.sort(function(k,J){return k.distance-J.distance;});var j=[];return R[0].index.forEach(function(k){j.push(b[k]);}),j;}function d(b){for(var W=[],D=0;D<b;D++){for(var R=[],j=0;j<b;j++){var k=j+D;k>b-1&&(k-=b),R[k]=j;}W.push(R);}return W;}function y(b){for(var W=[],D=0;D<b;D++)W.push(D);return O(W);}function O(b){var W=[],D=[];function R(j){var k,J;for(k=0;k<j.length;k++)J=j.splice(k,1)[0],D.push(J),j.length==0&&W.push(D.slice()),R(j),j.splice(k,0,J),D.pop();return W;}return R(b);}var E={};E.parser=m,E.lerpCurve=function(b,W,D){return E.lerpPoints(b[0],b[1],W[0],W[1],D).concat(E.lerpPoints(b[2],b[3],W[2],W[3],D)).concat(E.lerpPoints(b[4],b[5],W[4],W[5],D)).concat(E.lerpPoints(b[6],b[7],W[6],W[7],D));},E.lerpPoints=function(b,W,D,R,j){return[b+(D-b)*j,W+(R-W)*j];},E.q2b=function(b,W,D,R,j,k){return[b,W,(b+2*D)/3,(W+2*R)/3,(j+2*D)/3,(k+2*R)/3,j,k];},E.path2shapes=function(b){for(var W=E.parser(b),D=0,R=0,j=0,k=W.length,J=[],rt=null,st=void 0,$=void 0,V=void 0,nt=void 0,lt=void 0,ct=void 0,pt=void 0;j<k;j++){var et=W[j],gt=et[0],Tt=W[j-1];switch(gt){case"m":lt=J.length,J[lt]=[],rt=J[lt],D=D+et[1],R=R+et[2];break;case"M":lt=J.length,J[lt]=[],rt=J[lt],D=et[1],R=et[2];break;case"l":rt.push([D,R,D,R,D,R,D+et[1],R+et[2]]),D+=et[1],R+=et[2];break;case"L":rt.push([D,R,et[1],et[2],et[1],et[2],et[1],et[2]]),D=et[1],R=et[2];break;case"h":rt.push([D,R,D,R,D,R,D+et[1],R]),D+=et[1];break;case"H":rt.push([D,R,et[1],R,et[1],R,et[1],R]),D=et[1];break;case"v":rt.push([D,R,D,R,D,R,D,R+et[1]]),R+=et[1];break;case"V":rt.push([D,R,D,et[1],D,et[1],D,et[1]]),R=et[1];break;case"C":rt.push([D,R,et[1],et[2],et[3],et[4],et[5],et[6]]),D=et[5],R=et[6];break;case"S":Tt[0]==="C"||Tt[0]==="c"?rt.push([D,R,D+Tt[5]-Tt[3],R+Tt[6]-Tt[4],et[1],et[2],et[3],et[4]]):(Tt[0]==="S"||Tt[0]==="s")&&rt.push([D,R,D+Tt[3]-Tt[1],R+Tt[4]-Tt[2],et[1],et[2],et[3],et[4]]),D=et[3],R=et[4];break;case"c":rt.push([D,R,D+et[1],R+et[2],D+et[3],R+et[4],D+et[5],R+et[6]]),D=D+et[5],R=R+et[6];break;case"s":Tt[0]==="C"||Tt[0]==="c"?rt.push([D,R,D+Tt[5]-Tt[3],R+Tt[6]-Tt[4],D+et[1],R+et[2],D+et[3],R+et[4]]):(Tt[0]==="S"||Tt[0]==="s")&&rt.push([D,R,D+Tt[3]-Tt[1],R+Tt[4]-Tt[2],D+et[1],R+et[2],D+et[3],R+et[4]]),D=D+et[3],R=R+et[4];break;case"a":ct=f({rx:et[1],ry:et[2],px:D,py:R,xAxisRotation:et[3],largeArcFlag:et[4],sweepFlag:et[5],cx:D+et[6],cy:R+et[7]}),pt=ct[ct.length-1],ct.forEach(function(X,z){z===0?rt.push([D,R,X.x1,X.y1,X.x2,X.y2,X.x,X.y]):rt.push([ct[z-1].x,ct[z-1].y,X.x1,X.y1,X.x2,X.y2,X.x,X.y]);}),D=pt.x,R=pt.y;break;case"A":ct=f({rx:et[1],ry:et[2],px:D,py:R,xAxisRotation:et[3],largeArcFlag:et[4],sweepFlag:et[5],cx:et[6],cy:et[7]}),pt=ct[ct.length-1],ct.forEach(function(X,z){z===0?rt.push([D,R,X.x1,X.y1,X.x2,X.y2,X.x,X.y]):rt.push([ct[z-1].x,ct[z-1].y,X.x1,X.y1,X.x2,X.y2,X.x,X.y]);}),D=pt.x,R=pt.y;break;case"Q":rt.push(E.q2b(D,R,et[1],et[2],et[3],et[4])),D=et[3],R=et[4];break;case"q":rt.push(E.q2b(D,R,D+et[1],R+et[2],et[3]+D,et[4]+R)),D+=et[3],R+=et[4];break;case"T":Tt[0]==="Q"||Tt[0]==="q"?(V=D+Tt[3]-Tt[1],nt=R+Tt[4]-Tt[2],rt.push(E.q2b(D,R,V,nt,et[1],et[2]))):(Tt[0]==="T"||Tt[0]==="t")&&(rt.push(E.q2b(D,R,D+D-V,R+R-nt,et[1],et[2])),V=D+D-V,nt=R+R-nt),D=et[1],R=et[2];break;case"t":Tt[0]==="Q"||Tt[0]==="q"?(V=D+Tt[3]-Tt[1],nt=R+Tt[4]-Tt[2],rt.push(E.q2b(D,R,V,nt,D+et[1],R+et[2]))):(Tt[0]==="T"||Tt[0]==="t")&&(rt.push(E.q2b(D,R,D+D-V,R+R-nt,D+et[1],R+et[2])),V=D+D-V,nt=R+R-nt),D+=et[1],R+=et[2];break;case"Z":st=rt[0][0],$=rt[0][1],rt.push([D,R,st,$,st,$,st,$]);break;case"z":st=rt[0][0],$=rt[0][1],rt.push([D,R,st,$,st,$,st,$]);break;}}return J;},E._upCurves=function(b,W){for(var D=0,R=0,j=b.length;D<W;D++)b.push(b[R].slice(0)),R++,R>j-1&&(R-=j);};function w(b,W,D,R,j,k,J,rt,st){return{left:B(b,W,D,R,j,k,J,rt,st),right:B(J,rt,j,k,D,R,b,W,1-st,!0)};}function B(b,W,D,R,j,k,J,rt,st,$){var V=(D-b)*st+b,nt=(R-W)*st+W,lt=(j-D)*st+D,ct=(k-R)*st+R,pt=(J-j)*st+j,et=(rt-k)*st+k,gt=(lt-V)*st+V,Tt=(ct-nt)*st+nt,X=(pt-lt)*st+lt,z=(et-ct)*st+ct,Q=(X-gt)*st+gt,tt=(z-Tt)*st+Tt;return $?[Q,tt,gt,Tt,V,nt,b,W]:[b,W,V,nt,gt,Tt,Q,tt];}E._splitCurves=function(b,W){for(var D=0,R=0;D<W;D++){var j=b[R],k=w(j[0],j[1],j[2],j[3],j[4],j[5],j[6],j[7],0.5);b.splice(R,1),b.splice(R,0,k.left,k.right),R+=2,R>=b.length-1&&(R=0);}};function A(b,W){for(var D=function D(k){var J=b[b.length-1],rt=[];J.forEach(function(st){rt.push(st.slice(0));}),b.push(rt);},R=0;R<W;R++)D();}return E.lerp=function(b,W,D){return E._lerp(E.path2shapes(b),E.path2shapes(W),D);},E.MIM_CURVES_COUNT=100,E._preprocessing=function(b,W){var D=b.length,R=W.length,j=JSON.parse(JSON.stringify(b)),k=JSON.parse(JSON.stringify(W));return D>R?A(k,D-R):D<R&&A(j,R-D),j=p(j,k),j.forEach(function(J,rt){var st=J.length,$=k[rt].length;st>$?st<E.MIM_CURVES_COUNT?(E._splitCurves(J,E.MIM_CURVES_COUNT-st),E._splitCurves(k[rt],E.MIM_CURVES_COUNT-$)):E._splitCurves(k[rt],st-$):st<$&&($<E.MIM_CURVES_COUNT?(E._splitCurves(J,E.MIM_CURVES_COUNT-st),E._splitCurves(k[rt],E.MIM_CURVES_COUNT-$)):E._splitCurves(J,$-st));}),j.forEach(function(J,rt){j[rt]=h(J,k[rt]);}),[j,k];},E._lerp=function(b,W,D){var R=[];return b.forEach(function(j,k){var J=[];j.forEach(function(rt,st){J.push(E.lerpCurve(rt,W[k][st],D));}),R.push(J);}),R;},E.animate=function(b){var W=E.path2shapes(b.from),D=E.path2shapes(b.to),R=E._preprocessing(W,D),j=/* @__PURE__ */new Date(),k=b.end||function(){},J=b.progress||function(){},rt=b.begin||function(){},st=b.easing||function(ct){return ct;},$=null,V=null,nt=b.time;rt(W);var lt=function ct(){var pt=/* @__PURE__ */new Date()-j;if(pt>=nt){V=D,J(V,1),k(V),cancelAnimationFrame($);return;}var et=st(pt/nt);V=E._lerp(R[0],R[1],et),J(V,et),$=requestAnimationFrame(ct);};lt();},E;});},/* 228 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var f=/*#__PURE__*/function(_r$default3){function f(c){var _this35;_classCallCheck(this,f);_this35=_callSuper(this,f,[c]),_this35[l]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
319
+ lineCap:"butt",// 'butt' or 'square' or 'round'
320
+ roundSegments:20,// default roundSegment if lineJoin or lineCap is round
321
+ lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this35;}_inherits(f,_r$default3);return _createClass(f,[{key:"d",get:function get(){return this[a]("d");},set:function set(c){this[o]("d",c);}},{key:"normalize",get:function get(){return this[a]("normalize");},set:function set(c){this[o]("normalize",!!c);}},{key:"fillColor",get:function get(){return this[a]("fillColor");},set:function set(c){this[o]("fillColor",Object(n.parseColor)(c));}},{key:"fillRule",get:function get(){return this[a]("fillRule");},set:function set(c){if(c!=null&&c!=="nonzero"&&c!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",c);}},{key:"strokeColor",get:function get(){return this[a]("strokeColor");},set:function set(c){this[o]("strokeColor",Object(n.parseColor)(c));}},{key:"lineWidth",get:function get(){return this[a]("lineWidth");},set:function set(c){this[o]("lineWidth",Object(i.toNumber)(c));}},{key:"lineJoin",get:function get(){return this[a]("lineJoin");},set:function set(c){if(c!=null&&c!=="miter"&&c!=="bevel"&&c!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",c);}},{key:"lineCap",get:function get(){return this[a]("lineCap");},set:function set(c){if(c!=null&&c!=="butt"&&c!=="square"&&c!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",c);}},{key:"lineDash",get:function get(){return this[a]("lineDash");},set:function set(c){c=Object(i.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c]),this[o]("lineDash",c?c.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[a]("lineDashOffset");},set:function set(c){this[o]("lineDashOffset",Object(i.toNumber)(c));}},{key:"miterLimit",get:function get(){return this[a]("miterLimit");},set:function set(c){this[o]("miterLimit",Object(i.toNumber)(c));}},{key:"roundSegments",get:function get(){return this[a]("roundSegments");},set:function set(c){this[o]("roundSegments",c);}},{key:"texture",get:function get(){return this[a]("texture");},set:function set(c){this[o]("texture",c);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(c){this[o]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(c){this[o]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(c){this[o]("textureRepeat",!!c);}},{key:"clipPath",get:function get(){return this[a]("clipPath");},set:function set(c){this[o]("clipPath",c);}}]);}(r["default"]);},/* 229 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,f=_this$attributes15.width,g=_this$attributes15.height;return f>0&&g>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return g;});var r=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),a=Symbol["for"]("spritejs_declareAlias");function f(c){var m=c.width,x=c.height;return"M0 0L".concat(m," 0L").concat(m," ").concat(x,"L0 ").concat(x,"Z");}var g=/*#__PURE__*/function(_r$default5){function g(m){var _this36;_classCallCheck(this,g);_this36=_callSuper(this,g,[m]),_this36[i]({width:0,height:0/* size */}),_this36[a]("size");return _this36;}// readonly
322
+ _inherits(g,_r$default5);return _createClass(g,[{key:"d",get:function get(){return this[o]("d");},set:function set(m){}// eslint-disable-line no-empty-function
323
+ },{key:"width",get:function get(){return this[o]("width");},set:function set(m){if(m=Object(n.toNumber)(m),this[l]("width",m)){var x=f(this);this[l]("d",x);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(m){if(m=Object(n.toNumber)(m),this[l]("height",m)){var x=f(this);this[l]("d",x);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(m){m=Object(n.toArray)(m),Array.isArray(m)||(m=[m,m]),this.width=m[0],this.height=m[1];}}]);}(r["default"]);},/* 231 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default6);return _createClass(o,[{key:"isVisible",get:function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.points;return f.length>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function g(m){var x=m.points,M=m.smooth,S=m.smoothRange,P=m.close,T=[];for(var p=0;p<x.length;p+=2)T.push([x[p],x[p+1]]);var h="";return M?h=Object(i.makeSmoothCurveLine)(T,S):T.length&&(h="M".concat(T.map(function(p){return p.join(" ");}).join("L"))),h&&P&&(h+="Z"),h;}var c=/*#__PURE__*/function(_r$default8){function c(x){var _this37;_classCallCheck(this,c);_this37=_callSuper(this,c,[x]),_this37[l]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
324
+ /* close */}),_this37[f]("close");return _this37;}// readonly
325
+ _inherits(c,_r$default8);return _createClass(c,[{key:"d",get:function get(){return this[a]("d");},set:function set(x){}// eslint-disable-line no-empty-function
326
+ },{key:"close",get:function get(){return this.closeType!=="none";},set:function set(x){x=x?"normal":"none",this.closeType=x;}},{key:"closeType",get:function get(){return this[a]("closeType");},set:function set(x){if(x!=null&&x!=="none"&&x!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",x)){var M=g(this);this[o]("d",M);}}},{key:"smooth",get:function get(){return this[a]("smooth");},set:function set(x){if(this[o]("smooth",x)){var M=g(this);this[o]("d",M);}}},{key:"smoothRange",get:function get(){return this[a]("smoothRange");},set:function set(x){if(x&&!Array.isArray(x)&&(x=[x]),this[o]("smoothRange",x)&&this.smooth){var M=g(this);this[o]("d",M);}}},{key:"points",get:function get(){return this[a]("points");},set:function set(x){if(x=Object(n.toArray)(x),Array.isArray(x)&&(x=x.reduce(function(M,S){return Array.isArray(S)?[].concat(_toConsumableArray(M),_toConsumableArray(S.map(function(P){return Object(n.toNumber)(P);}))):[].concat(_toConsumableArray(M),[Object(n.toNumber)(S)]);},[])),this[o]("points",x)){var M=g(this);this[o]("d",M);}}}]);}(r["default"]);},/* 234 *//***/function(u,e,t){t.r(e),t.d(e,"makeSmoothCurveLine",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function l(f){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var m,x,M,S;if((n[f].x===n[f+1].x||n[f].y===n[f+1].y)&&(g=0,c=0),f<1?(m=n[0].x+(n[1].x-n[0].x)*g,x=n[0].y+(n[1].y-n[0].y)*g):(m=n[f].x+(n[f+1].x-n[f-1].x)*g,x=n[f].y+(n[f+1].y-n[f-1].y)*g),f>n.length-3){var P=n.length-1;M=n[P].x-(n[P].x-n[P-1].x)*c,S=n[P].y-(n[P].y-n[P-1].y)*c;}else M=n[f+1].x-(n[f+2].x-n[f].x)*c,S=n[f+1].y-(n[f+2].y-n[f].y)*c;return[{x:m,y:x},{x:M,y:S}];}n=n.map(function(_ref142){var _ref143=_slicedToArray(_ref142,2),f=_ref143[0],g=_ref143[1];return{x:f,y:g};});var o="",a=0;return n.forEach(function(f,g){if(g===0)o+="M".concat(f.x," ").concat(f.y);else{for(;g>i[a];)a++;if(a%2){var _l3=l(g-1),_l4=_slicedToArray(_l3,2),c=_l4[0],m=_l4[1];o+="C".concat([c.x,c.y,m.x,m.y,f.x,f.y].join(" "));}else o+="L".concat(f.x," ").concat(f.y);}}),o;}},/* 235 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(g){var _g$sides=_slicedToArray(g.sides,2),c=_g$sides[0],m=_g$sides[1];var x=g.angle%360;return x<0&&(x+=360),x=Math.PI*x/180,[0,0,c,0,m*Math.cos(x),m*Math.sin(x)];}var f=/*#__PURE__*/function(_r$default9){function f(c){var _this38;_classCallCheck(this,f);_this38=_callSuper(this,f,[c]),_this38[i]({sides:[0,0],angle:60,closeType:"normal"});return _this38;}// readonly
327
+ _inherits(f,_r$default9);return _createClass(f,[{key:"points",get:function get(){return _superPropGet(f,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
328
+ },{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[l]("sides",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("angle",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}}]);}(r["default"]);},/* 236 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(g){var _g$sides2=_slicedToArray(g.sides,2),c=_g$sides2[0],m=_g$sides2[1];var x=g.angle%360;x<0&&(x+=360),x=Math.PI*x/180;var M=m*Math.cos(x),S=m*Math.sin(x);return[0,0,c,0,M+c,S,M,S];}var f=/*#__PURE__*/function(_r$default11){function f(c){var _this39;_classCallCheck(this,f);_this39=_callSuper(this,f,[c]),_this39[i]({sides:[0,0],angle:90,closeType:"normal"});return _this39;}// readonly
329
+ _inherits(f,_r$default11);return _createClass(f,[{key:"points",get:function get(){return _superPropGet(f,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
330
+ },{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[l]("sides",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("angle",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}}]);}(r["default"]);},/* 238 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default12);return _createClass(o);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"regular");},/* 239 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(g){var c=g.edges,m=g.radius,x=g.offsetAngle,M=Math.PI*x/180-0.5*Math.PI;if(c<3||m<=0)return[];var S=[];for(var P=0;P<c;P++){var _T23=P*2*Math.PI/c+M,_h20=m*Math.cos(_T23),p=m*Math.sin(_T23);S.push(_h20,p);}return S;}var f=/*#__PURE__*/function(_r$default13){function f(c){var _this40;_classCallCheck(this,f);_this40=_callSuper(this,f,[c]),_this40[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this40;}// readonly
331
+ _inherits(f,_r$default13);return _createClass(f,[{key:"points",get:function get(){return _superPropGet(f,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
332
+ },{key:"edges",get:function get(){return this[o]("edges");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("edges",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("radius",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("offsetAngle",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}}]);}(r["default"]);},/* 240 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default14);return _createClass(o);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"star");},/* 241 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(g){var c=g.angles,m=g.innerRadius,x=g.outerRadius,M=g.offsetAngle,S=Math.PI*M/180-0.5*Math.PI;if(c<3||m<=0||x<=0)return[];var P=[];for(var _T24=0;_T24<c*2;_T24++){var _h21=_T24*Math.PI/c+S,p=_T24%2?m:x,d=p*Math.cos(_h21),y=p*Math.sin(_h21);P.push(d,y);}return P;}var f=/*#__PURE__*/function(_r$default15){function f(c){var _this41;_classCallCheck(this,f);_this41=_callSuper(this,f,[c]),_this41[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this41;}// readonly
333
+ _inherits(f,_r$default15);return _createClass(f,[{key:"points",get:function get(){return _superPropGet(f,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
334
+ },{key:"angles",get:function get(){return this[o]("angles");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("angles",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("innerRadius",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("outerRadius",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(c){c=Object(n.toArray)(c,!0),Array.isArray(c)||(c=[c,c]),this.innerRadius=c[0],this.outerRadius=c[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(c){if(c=Object(n.toNumber)(c),this[l]("offsetAngle",c)){var m=a(this);_superPropSet(f,"points",m,this,1,1);}}}]);}(r["default"]);},/* 242 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,f=_this$attributes16.radiusX,g=_this$attributes16.radiusY,c=_this$attributes16.startAngle,m=_this$attributes16.endAngle;return f>0&&g>0&&c!==m&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function g(m){var x=m.radiusX,M=m.radiusY,S=m.startAngle,P=m.endAngle,T=m.direction,h=m.closeType,p=T==="anitclockwise",d=new r.Figure2D();return h==="sector"&&d.moveTo(0,0),d.ellipse(0,0,x,M,0,Math.PI*S/180,Math.PI*P/180,p),h!=="none"&&d.closePath(),d.path.reduce(function(E,w){return E+w.join(" ");},"");}var c=/*#__PURE__*/function(_n$default2){function c(x){var _this42;_classCallCheck(this,c);_this42=_callSuper(this,c,[x]),_this42[l]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
335
+ closeType:"none"// none | sector | normal
336
+ }),_this42[f]("radius","angle");return _this42;}// readonly
337
+ _inherits(c,_n$default2);return _createClass(c,[{key:"d",get:function get(){return this[a]("d");},set:function set(x){}// eslint-disable-line no-empty-function
338
+ },{key:"radiusX",get:function get(){return this[a]("radiusX");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("radiusX",x)){var M=g(this);this[o]("d",M);}}},{key:"radiusY",get:function get(){return this[a]("radiusY");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("radiusY",x)){var M=g(this);this[o]("d",M);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(x){x=Object(i.toArray)(x,!0),Array.isArray(x)||(x=[x,x]),this.radiusX=x[0],this.radiusY=x[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(x){x=Object(i.toArray)(x),Array.isArray(x)||(x=[x,x]),this.startAngle=x[0],this.endAngle=x[1];}},{key:"direction",get:function get(){return this[a]("direction");},set:function set(x){if(x!=null&&x!=="clockwise"&&x!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",x);}},{key:"startAngle",get:function get(){return this[a]("startAngle");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("startAngle",x)){var M=g(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[a]("endAngle");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("endAngle",x)){var M=g(this);this[o]("d",M);}}},{key:"closeType",get:function get(){return this[a]("closeType");},set:function set(x){if(x!=null&&x!=="none"&&x!=="sector"&&x!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",x)){var M=g(this);this[o]("d",M);}}}]);}(n["default"]);},/* 244 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default17);return _createClass(o);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"arc");},/* 245 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return i;});var r=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_r$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_r$default18);return _createClass(i,[{key:"radius",get:function get(){return _superPropGet(i,"radiusX",this,1);},set:function set(o){o=Object(n.toNumber)(o),_superPropSet(i,"radiusX",o,this,1,1),_superPropSet(i,"radiusY",o,this,1,1);}}]);}(r["default"]);},/* 246 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function l(a,f,g){return f in a?Object.defineProperty(a,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[f]=g,a;}var o=/*#__PURE__*/function(_r$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,f=_this$attributes17.innerRadius,g=_this$attributes17.outerRadius,c=_this$attributes17.startAngle,m=_this$attributes17.endAngle;return(f>0||g>0)&&c!==m&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function g(m){var _ref144;var x=m.innerRadius,M=m.outerRadius,S=m.startAngle,P=m.endAngle;var T=new r.Figure2D();if(S=Math.PI*S/180,P=Math.PI*P/180,x>M&&(_ref144=[M,x],x=_ref144[0],M=_ref144[1],_ref144),x<=0&&T.moveTo(0,0),T.arc(0,0,M,S,P,!1),x>0){var d=Math.PI*2;P<S&&(P=S+d+(P-S)%d),P-S>=d&&(P=S+d-1e-6),T.arc(0,0,x,P,S,!0);}return T.closePath(),T.path.reduce(function(d,y){return d+y.join(" ");},"");}var c=/*#__PURE__*/function(_n$default3){function c(x){var _this43;_classCallCheck(this,c);_this43=_callSuper(this,c,[x]),_this43[l]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this43[f]("radius","angle");return _this43;}// readonly
339
+ _inherits(c,_n$default3);return _createClass(c,[{key:"d",get:function get(){return this[a]("d");},set:function set(x){}// eslint-disable-line no-empty-function
340
+ },{key:"innerRadius",get:function get(){return this[a]("innerRadius");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("innerRadius",x)){var M=g(this);this[o]("d",M);}}},{key:"outerRadius",get:function get(){return this[a]("outerRadius");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("outerRadius",x)){var M=g(this);this[o]("d",M);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(x){x=Object(i.toArray)(x,!0),Array.isArray(x)||(x=[x,x]),this.innerRadius=x[0],this.outerRadius=x[1];}},{key:"startAngle",get:function get(){return this[a]("startAngle");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("startAngle",x)){var M=g(this);this[o]("d",M);}}},{key:"endAngle",get:function get(){return this[a]("endAngle");},set:function set(x){if(x=Object(i.toNumber)(x),this[o]("endAngle",x)){var M=g(this);this[o]("d",M);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(x){x=Object(i.toArray)(x),Array.isArray(x)||(x=[x,x]),this.startAngle=x[0],this.endAngle=x[1];}}]);}(n["default"]);},/* 248 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return M;});var r=t(12),n=t(218),i=t(219),l=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function a(S,P,T){return P in S?Object.defineProperty(S,P,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[P]=T,S;}var f=Symbol("textImage"),g=Symbol("textImageTask"),c=Symbol("textureContext"),m=Symbol("updateTextureRect"),x=Symbol("textCanvas");var M=/*#__PURE__*/function(_i$default3){function M(){var _this44;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);typeof P=="string"&&(P={text:P}),_this44=_callSuper(this,M,[P]);return _this44;}/* override */_inherits(M,_i$default3);return _createClass(M,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(M,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),P=_superPropGet5[0],T=_superPropGet5[1];var _this$attributes18=this.attributes,h=_this$attributes18.width,p=_this$attributes18.height;if(h==null||p==null){var d=this[f];d&&(h==null&&(P=d.rect[2]),p==null&&(T=d.rect[3]));}return[P,T];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(P){this.attributes.text=P;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(P){this.attributes.text=P;}},{key:"textImage",get:function get(){return this[f]||{};}},{key:"textImageReady",get:function get(){return this[g]||Promise.resolve();}/* override */},{key:"draw",value:function draw(P){_superPropGet(M,"draw",this,3)([P]);var T=this.mesh;if(T){var _h22=this[f];if(_h22){var p=T.texture;if(!p||this[c]&&this[c]!==this.renderer||_h22.needsUpdate?(_h22.needsUpdate=!1,Object(n.deleteTexture)(_h22.image,this.renderer),p=Object(n.createTexture)(_h22.image,this.renderer),this[m]=!0):p=T.uniforms.u_texSampler,this[m]){var _h22$rect$slice=_h22.rect.slice(2),_h22$rect$slice2=_slicedToArray(_h22$rect$slice,2),d=_h22$rect$slice2[0],y=_h22$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),O=_this$contentSize4[0],E=_this$contentSize4[1],w=this.attributes.textAlign,B=this.attributes.verticalAlign;var A=0;w==="center"?A=(O-d)/2:(w==="right"||w==="end")&&(A=O-d);var b=this.attributes.fontSize,W=this.attributes.lineHeight;var D=0;B==="top"?D=(b-W)/2:B==="bottom"&&(D=(W-b)/2);var _this$attributes19=this.attributes,R=_this$attributes19.paddingLeft,j=_this$attributes19.paddingTop,k=this.attributes.borderWidth;A+=R+k,D+=j+k;var _this$attributes20=this.attributes,J=_this$attributes20.anchorX,rt=_this$attributes20.anchorY;A-=this.offsetSize[0]*J,D-=this.offsetSize[1]*rt,T.setTexture(p,{rect:[A,D,d,y]}),this[m]=!1,this[c]=this.renderer;}}}return P;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,T,h){P==="text"||P==="fontSize"||P==="fontFamily"||P==="fontStyle"||P==="fontVariant"||P==="fontWeight"||P==="fontStretch"||P==="lineHeight"||P==="strokeColor"||P==="fillColor"||P==="strokeWidth"?this.updateText():((P==="textAlign"||P==="verticalAlign")&&(this[m]=!0),_superPropGet(M,"onPropertyChange",this,3)([P,T,h]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(M,"updateContours",this,3)([]),this[m]=!0;}},{key:"updateText",value:function updateText(){var _this45=this;this[g]||(this[g]=Promise.resolve().then(function(){_this45[g]=null;var _this45$attributes=_this45.attributes,P=_this45$attributes.text,T=_this45$attributes.font,h=_this45$attributes.fillColor,p=_this45$attributes.strokeColor,d=_this45$attributes.strokeWidth,y=_this45.layer?_this45.layer.displayRatio:1;return _this45[x]=_this45[x]||r.ENV.createCanvas(1,1),_this45[f]=r.ENV.createText(P,{font:T,fillColor:h,strokeColor:p,strokeWidth:d,parseFont:r.parseFont,ratio:y,textCanvas:_this45[x]}),_this45[f].needsUpdate=!0,_this45.updateContours(),_this45.forceUpdate(),_this45[f];}));}}]);}(i["default"]);a(M,"Attr",l["default"]),o["default"].registerNode(M,"label");},/* 249 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(12),n=t(72),i=t(221),l=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),g=Symbol["for"]("spritejs_declareAlias");var c=/*#__PURE__*/function(_l$default2){function c(x){var _this46;_classCallCheck(this,c);_this46=_callSuper(this,c,[x]),_this46[o]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this46[g]("font");return _this46;}_inherits(c,_l$default2);return _createClass(c,[{key:"text",get:function get(){return this[f]("text")||" ";},set:function set(x){this[a]("text",x);}},{key:"fontSize",get:function get(){return this[f]("fontSize");},set:function set(x){this[a]("fontSize",Object(n.toNumber)(x));}},{key:"fontFamily",get:function get(){return this[f]("fontFamily");},set:function set(x){this[a]("fontFamily",x);}},{key:"fontStyle",get:function get(){return this[f]("fontStyle");},set:function set(x){this[a]("fontStyle",x);}},{key:"fontVariant",get:function get(){return this[f]("fontVariant");},set:function set(x){this[a]("fontVariant",x);}},{key:"fontWeight",get:function get(){return this[f]("fontWeight");},set:function set(x){this[a]("fontWeight",x);}},{key:"fontStretch",get:function get(){return this[f]("fontStretch");},set:function set(x){this[a]("fontStretch",x);}},{key:"lineHeight",get:function get(){return this[f]("lineHeight")||this.fontSize;},set:function set(x){this[a]("lineHeight",Object(n.toNumber)(x));}},{key:"textAlign",get:function get(){return this[f]("textAlign");},set:function set(x){this[a]("textAlign",x);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(x){this[a]("strokeColor",Object(i.parseColor)(x));}},{key:"strokeWidth",get:function get(){return this[f]("strokeWidth");},set:function set(x){this[a]("strokeWidth",Object(n.toNumber)(x));}},{key:"verticalAlign",get:function get(){return this[f]("verticalAlign");},set:function set(x){this[a]("verticalAlign",x);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(x){this[a]("fillColor",Object(i.parseColor)(x));}},{key:"font",get:function get(){var x=this.fontStyle,M=this.fontVariant,S=this.fontWeight,P=this.fontStretch,T=this.fontSize,h=this.lineHeight,p=this.fontFamily;return"".concat(x," ").concat(M," ").concat(S," ").concat(P," ").concat(T,"px/").concat(h,"px ").concat(p);},set:function set(x){if(x==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var M=Object(r.parseFont)(x);this.fontStyle=M.style,this.fontVariant=M.variant,this.fontWeight=M.weight,this.fontStretch=M.stretch,this.fontSize=Object(n.toNumber)("".concat(M.size).concat(M.unit)),M.lineHeight&&(this.lineHeight=M.pxLineHeight),this.fontFamily=M.family;}}}]);}(l["default"]);},/* 250 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return x;});var r=t(12),n=t(219),i=t(251),l=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function a(M,S,P){return S in M?Object.defineProperty(M,S,{value:P,enumerable:!0,configurable:!0,writable:!0}):M[S]=P,M;}var f=Symbol("zOrder"),g=Symbol("ordered"),c=Symbol("children"),m=Symbol("sealed");var x=/*#__PURE__*/function(_n$default4){function x(){var _this47;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,x);_this47=_callSuper(this,x,[S]),_this47[c]=[],_this47[g]=null,_this47[f]=0;return _this47;}_inherits(x,_n$default4);return _createClass(x,[{key:"childNodes",get:function get(){return this[c];}},{key:"children",get:function get(){return this[c];}},{key:"orderedChildren",get:function get(){return this[g]||(this[g]=_toConsumableArray(this[c]),this[g].sort(function(S,P){return S.zIndex-P.zIndex||S.zOrder-P.zOrder;})),this[g];}},{key:"append",value:function append(){var _this48=this;for(var _len12=arguments.length,S=new Array(_len12),_key12=0;_key12<_len12;_key12++){S[_key12]=arguments[_key12];}return S.map(function(P){return _this48.appendChild(P);});}},{key:"appendChild",value:function appendChild(S){return S.remove(),this[c].push(S),S.connect(this,this[f]++),this[g]&&(this[g].length&&S.zIndex<this[g][this[g].length-1].zIndex?this.reorder():this[g].push(S)),S;}/* override */// get isVisible() {
341
+ // return this.attributes.opacity > 0 && this[_children].length > 0;
342
+ // }
343
+ /* override */},{key:"cloneNode",value:function cloneNode(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var P=_superPropGet(x,"cloneNode",this,3)([]);return S&&this[c].forEach(function(T){var h=T.cloneNode(S);P.appendChild(h);}),P;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(S){var P=this.orderedChildren;for(var _T25=P.length-1;_T25>=0;_T25--)if(P[_T25].dispatchPointerEvent(S))return!0;return _superPropGet(x,"dispatchPointerEvent",this,3)([S]);}/* override */},{key:"draw",value:function draw(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(x,"draw",this,3)([S]),!this[m]&&this.attributes.display!=="none"){var P=this.orderedChildren;for(var _T26=0;_T26<P.length;_T26++)P[_T26].draw(S);}return this.__cacheRenderMatrix=null,S;}},{key:"getElementById",value:function getElementById(S){return Object(o.querySelector)("#".concat(S),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(S){return Object(o.querySelectorAll)(".".concat(S),this);}},{key:"getElementsByName",value:function getElementsByName(S){return Object(o.querySelectorAll)("[name=\"".concat(S,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(S){return Object(o.querySelectorAll)(S,this);}},{key:"insertBefore",value:function insertBefore(S,P){if(P==null)return this.appendChild(S);S.remove();var T=this[c].indexOf(P);if(T<0)throw new Error("Invalid reference node.");var h=P.zOrder;for(var p=T;p<this[c].length;p++){var d=this[c][p].zOrder,y=this[c][p];delete y.zOrder,Object.defineProperty(y,"zOrder",{value:d+1,writable:!1,configurable:!0});}if(this[c].splice(T,0,S),S.connect(this,h),this[g])if(S.zIndex!==P.zIndex)this.reorder();else{var _p5=this[g].indexOf(P);this[g].splice(_p5,0,S);}return S;}},{key:"querySelector",value:function querySelector(S){return Object(o.querySelector)(S,this);}},{key:"querySelectorAll",value:function querySelectorAll(S){return Object(o.querySelectorAll)(S,this);}},{key:"replaceChild",value:function replaceChild(S,P){S.remove();var T=this[c].indexOf(P);if(T<0)throw new Error("Invalid reference node.");if(this[c][T]=S,S.connect(this,P.zOrder),this[g])if(S.zIndex!==P.zIndex)this.reorder();else{var _h23=this[g].indexOf(P);this[g][_h23]=S;}return P.disconnect(this),S;}},{key:"removeAllChildren",value:function removeAllChildren(){var S=this[c];for(var P=S.length-1;P>=0;P--)S[P].remove();}},{key:"removeChild",value:function removeChild(S){var P=this[c].indexOf(S);if(P>=0){if(this[c].splice(P,1),this[g]){var _T27=this[g].indexOf(S);this[g].splice(_T27,1);}return S.disconnect(this),S;}return null;}},{key:"reorder",value:function reorder(){this[g]=null;}},{key:"seal",value:function seal(){function S(p,d){var y=[];for(var O=0;O<p.length;O++){var E=_toConsumableArray(p[O]);for(var w=1;w<E.length;w+=2){var B=E[w],A=E[w+1];E[w]=B*d[0]+A*d[2]+d[4],E[w+1]=B*d[1]+A*d[3]+d[5];}y.push(E);}return y;}var P=this.orderedChildren,T=new r.Figure2D(),h=this.localMatrix;for(var p=0;p<P.length;p++){var d=P[p];if(d instanceof x&&(d=d.seal()),d.clientBox){var y=d.clientBox.contours.path;y=S(y,d.localMatrix),T.addPath(y);}if(d.path){var _y6=d.path.contours.path;_y6=S(_y6,d.localMatrix),T.addPath(_y6);}}return this[m]=!0,this.clientBox=T,{clientBox:T,localMatrix:h};}/* override */},{key:"setResolution",value:function setResolution(_ref145){var S=_ref145.width,P=_ref145.height;_superPropGet(x,"setResolution",this,3)([{width:S,height:P}]),this[c].forEach(function(T){T.setResolution({width:S,height:P});});}/* override */},{key:"updateContours",value:function updateContours(){this[m]||_superPropGet(x,"updateContours",this,3)([]);}}]);}(n["default"]);a(x,"Attr",i["default"]),l["default"].registerNode(x,"group");},/* 251 *//***/function(u,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(u,e,t){t.r(e),t.d(e,"querySelectorAll",function(){return m;}),t.d(e,"querySelector",function(){return x;}),t.d(e,"isMatched",function(){return M;}),t.d(e,"compile",function(){return S;});var r=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var i=t(253);function l(P){return P.nodeType===1||n["default"].isSpriteNode(P.nodeName);}function o(P){return Array.from(P.childNodes||[]);}function a(P){return n["default"].isSpriteNode(P.nodeName)?P.parent||P.canvas||P.container:P.parentElement;}function f(P){var T=P.length,h,p,d;for(;--T>-1;){for(h=p=P[T],P[T]=null,d=!0;p;){if(P.indexOf(p)>-1){d=!1,P.splice(T,1);break;}p=a(p);}d&&(P[T]=h);}return P;}var g={isTag:l,existsOne:function existsOne(P,T){return T.some(function(h){return l(h)?P(h)||g.existsOne(P,o(h)):!1;});},getSiblings:function getSiblings(P){var T=a(P);return T&&o(T);},getChildren:o,getParent:a,getAttributeValue:function getAttributeValue(P,T){if(P.nodeType===1&&T==="class"||T==="id")return P[T];if(this.hasAttrib(P,T)){var _h24=P.attributes[T];return Array.isArray(_h24)&&(_h24="[".concat(_h24.join(),"]")),String(_h24);}},hasAttrib:function hasAttrib(P,T){return P.attributes[T]!=null;},removeSubsets:f,getName:function getName(P){return P.tagName?P.tagName.toLowerCase():null;},findOne:function P(T,h){var p=null;for(var d=0,y=h.length;d<y&&!p;d++)if(T(h[d]))p=h[d];else{var O=o(h[d]);O&&O.length>0&&(p=P(T,O));}return p;},findAll:function P(T,h){var p=[];for(var d=0,y=h.length;d<y;d++){if(!l(h[d]))continue;T(h[d])&&p.push(h[d]);var O=o(h[d]);O&&(p=p.concat(P(T,O)));}return p;},getText:function P(T){return Array.isArray(T)?T.map(P).join(""):l(T)?P(o(T)):T.nodeType===3?T.nodeValue:n["default"].isSpriteNode(T.nodeName)?T.text:"";}};function c(P){if(typeof P!="string")return P;var T=P.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return T&&(T=T.map(function(h){var p=h.slice(1,-1).split("="),d=Object(r.parseColor)(p[1].replace(/['"]/g,""));return[h,"[".concat(p[0],"=\"").concat(d,"\"]")];}),T.forEach(function(_ref146){var _ref147=_slicedToArray(_ref146,2),h=_ref147[0],p=_ref147[1];P=P.replace(h,p);})),T=P.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.map(function(h){var p=h.slice(1,-1).split("="),d=p[1].slice(2,-2).split(/,/g).map(function(y){return y.trim();});return[h,"[".concat(p[0],"=\"[").concat(d,"]\"]")];}),T.forEach(function(_ref148){var _ref149=_slicedToArray(_ref148,2),h=_ref149[0],p=_ref149[1];P=P.replace(h,p);})),P;}function m(P,T){return i.selectAll(c(P),T,{adapter:g});}function x(P,T){return i.selectOne(c(P),T,{adapter:g});}function M(P,T){return i.is(P,c(T),{adapter:g});}function S(P){return i.compile(c(P),{adapter:g});}},/* 253 *//***/function(u,e,t){u.exports=S;var r=t(254),n=t(273).falseFunc,i=t(274);function l(P){return function(h,p,d){return p=p||{},p.adapter=p.adapter||r,P(h,p,d);};}var o=l(i),a=l(i.compileUnsafe);function f(P){return function(h,p,d){return d=d||{},d.adapter=d.adapter||r,typeof h!="function"&&(h=a(h,d,p)),h.shouldTestNextSiblings&&(p=c(d&&d.context||p,d.adapter)),Array.isArray(p)?p=d.adapter.removeSubsets(p):p=d.adapter.getChildren(p),P(h,p,d);};}function g(P,T){var h=T.getSiblings(P);if(!Array.isArray(h))return[];for(h=h.slice(0);h.shift()!==P;);return h;}function c(P,T){Array.isArray(P)||(P=[P]);for(var h=P.slice(0),p=0,d=P.length;p<d;p++){var y=g(h[p],T);h.push.apply(h,y);}return h;}var m=f(function(T,h,p){return T===n||!h||h.length===0?[]:p.adapter.findAll(T,h);}),x=f(function(T,h,p){return T===n||!h||h.length===0?null:p.adapter.findOne(T,h);});function M(P,T,h){return h=h||{},h.adapter=h.adapter||r,(typeof T=="function"?T:o(T,h))(P);}function S(P,T,h){return m(P,T,h);}S.compile=o,S.filters=i.Pseudos.filters,S.pseudos=i.Pseudos.pseudos,S.selectAll=m,S.selectOne=x,S.is=M,S.parse=o,S.iterate=m,S._compileUnsafe=a,S._compileToken=i.compileToken;},/* 254 *//***/function(u,e,t){var r=u.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){r[i]=n[i].bind(r);});});},/* 255 *//***/function(u,e,t){var r=t(256),n=t(257),i=r.isTag;u.exports={getInnerHTML:l,getOuterHTML:n,getText:o};function l(a,f){return a.children?a.children.map(function(g){return n(g,f);}).join(""):"";}function o(a){return Array.isArray(a)?a.map(o).join(""):i(a)?a.name==="br"?"\n":o(a.children):a.type===r.CDATA?o(a.children):a.type===r.Text?a.data:"";}},/* 256 *//***/function(u,e){u.exports={Text:"text",//Text
344
+ Directive:"directive",//<? ... ?>
345
+ Comment:"comment",//<!-- ... -->
346
+ Script:"script",//<script> tags
347
+ Style:"style",//<style> tags
348
+ Tag:"tag",//Any tag
349
+ CDATA:"cdata",//<![CDATA[ ... ]]>
350
+ Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 *//***/function(u,e,t){var r=t(258),n=t(259),i=t(267);i.elementNames.__proto__=null,i.attributeNames.__proto__=null;var l={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function o(P,T){if(P){var h="",p;for(var d in P)p=P[d],h&&(h+=" "),T.xmlMode==="foreign"&&(d=i.attributeNames[d]||d),h+=d,(p!==null&&p!==""||T.xmlMode)&&(h+='="'+(T.decodeEntities?n.encodeXML(p):p.replace(/\"/g,"&quot;"))+'"');return h;}}var a={__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},f=u.exports=function(P,T){!Array.isArray(P)&&!P.cheerio&&(P=[P]),T=T||{};for(var h="",p=0;p<P.length;p++){var d=P[p];d.type==="root"?h+=f(d.children,T):r.isTag(d)?h+=c(d,T):d.type===r.Directive?h+=m(d):d.type===r.Comment?h+=S(d):d.type===r.CDATA?h+=M(d):h+=x(d,T);}return h;},g=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function c(P,T){T.xmlMode==="foreign"&&(P.name=i.elementNames[P.name]||P.name,P.parent&&g.indexOf(P.parent.name)>=0&&(T=Object.assign({},T,{xmlMode:!1}))),!T.xmlMode&&["svg","math"].indexOf(P.name)>=0&&(T=Object.assign({},T,{xmlMode:"foreign"}));var h="<"+P.name,p=o(P.attribs,T);return p&&(h+=" "+p),T.xmlMode&&(!P.children||P.children.length===0)?h+="/>":(h+=">",P.children&&(h+=f(P.children,T)),(!a[P.name]||T.xmlMode)&&(h+="</"+P.name+">")),h;}function m(P){return"<"+P.data+">";}function x(P,T){var h=P.data||"";return T.decodeEntities&&!(P.parent&&P.parent.name in l)&&(h=n.encodeXML(h)),h;}function M(P){return"<![CDATA["+P.children[0].data+"]]>";}function S(P){return"<!--"+P.data+"-->";}},/* 258 *//***/function(u,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(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.encode=e.decodeStrict=e.decode=void 0;var r=t(260),n=t(266);function i(g,c){return(!c||c<=0?r.decodeXML:r.decodeHTML)(g);}e.decode=i;function l(g,c){return(!c||c<=0?r.decodeXML:r.decodeHTMLStrict)(g);}e.decodeStrict=l;function o(g,c){return(!c||c<=0?n.encodeXML:n.encodeHTML)(g);}e.encode=o;var a=t(266);Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function get(){return a.encodeXML;}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function get(){return a.encodeHTML;}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function get(){return a.escape;}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function get(){return a.encodeHTML;}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function get(){return a.encodeHTML;}});var f=t(260);Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function get(){return f.decodeXML;}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function get(){return f.decodeXML;}});},/* 260 *//***/function(u,e,t){var r=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{"default":c};};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=r(t(261)),i=r(t(262)),l=r(t(263)),o=r(t(264));e.decodeXML=a(l["default"]),e.decodeHTMLStrict=a(n["default"]);function a(c){var m=Object.keys(c).join("|"),x=g(c);m+="|#[xX][\\da-fA-F]+|#\\d+";var M=new RegExp("&(?:"+m+");","g");return function(S){return String(S).replace(M,x);};}var f=function f(c,m){return c<m?1:-1;};e.decodeHTML=function(){for(var c=Object.keys(i["default"]).sort(f),m=Object.keys(n["default"]).sort(f),x=0,M=0;x<m.length;x++)c[M]===m[x]?(m[x]+=";?",M++):m[x]+=";";var S=new RegExp("&(?:"+m.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),P=g(n["default"]);function T(h){return h.substr(-1)!==";"&&(h+=";"),P(h);}return function(h){return String(h).replace(S,T);};}();function g(c){return function(x){if(x.charAt(1)==="#"){var M=x.charAt(2);return M==="X"||M==="x"?o["default"](parseInt(x.substr(3),16)):o["default"](parseInt(x.substr(2),10));}return c[x.slice(1,-1)];};}},/* 261 *//***/function(u){u.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(u){u.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(u){u.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 *//***/function(u,e,t){var r=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{"default":l};};Object.defineProperty(e,"__esModule",{value:!0});var n=r(t(265));function i(l){if(l>=55296&&l<=57343||l>1114111)return"�";l in n["default"]&&(l=n["default"][l]);var o="";return l>65535&&(l-=65536,o+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),o+=String.fromCharCode(l),o;}e["default"]=i;},/* 265 *//***/function(u){u.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(u,e,t){var r=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{"default":T};};Object.defineProperty(e,"__esModule",{value:!0}),e.escape=e.encodeHTML=e.encodeXML=void 0;var n=r(t(263)),i=g(n["default"]),l=c(i);e.encodeXML=M(i,l);var o=r(t(261)),a=g(o["default"]),f=c(a);e.encodeHTML=M(a,f);function g(T){return Object.keys(T).sort().reduce(function(h,p){return h[T[p]]="&"+p+";",h;},{});}function c(T){for(var h=[],p=[],d=0,y=Object.keys(T);d<y.length;d++){var O=y[d];O.length===1?h.push("\\"+O):p.push(O);}h.sort();for(var E=0;E<h.length-1;E++){for(var w=E;w<h.length-1&&h[w].charCodeAt(1)+1===h[w+1].charCodeAt(1);)w+=1;var B=1+w-E;B<3||h.splice(E,B,h[E]+"-"+h[w]);}return p.unshift("["+h.join("")+"]"),new RegExp(p.join("|"),"g");}var m=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function x(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";";}function M(T,h){return function(p){return p.replace(h,function(d){return T[d];}).replace(m,x);};}var S=c(i);function P(T){return T.replace(S,x).replace(m,x);}e.escape=P;},/* 267 *//***/function(u){u.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(u,e){var t=e.getChildren=function(n){return n.children;},r=e.getParent=function(n){return n.parent;};e.getSiblings=function(n){var i=r(n);return i?t(i):[n];},e.getAttributeValue=function(n,i){return n.attribs&&n.attribs[i];},e.hasAttrib=function(n,i){return!!n.attribs&&hasOwnProperty.call(n.attribs,i);},e.getName=function(n){return n.name;};},/* 269 *//***/function(u,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 i=r.next=t.next;i&&(i.prev=r);var l=r.parent=t.parent;if(l){var o=l.children;o[o.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,i=t.next;if(r.next=i,r.prev=t,t.next=r,r.parent=n,i){if(i.prev=r,n){var l=n.children;l.splice(l.lastIndexOf(i),0,r);}}else n&&n.children.push(r);},e.prepend=function(t,r){var n=t.parent;if(n){var i=n.children;i.splice(i.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(u,e,t){var r=t(256).isTag;u.exports={filter:n,find:i,findOneChild:l,findOne:o,existsOne:a,findAll:f};function n(g,c,m,x){return Array.isArray(c)||(c=[c]),(typeof x!="number"||!isFinite(x))&&(x=1/0),i(g,c,m!==!1,x);}function i(g,c,m,x){for(var M=[],S,P=0,T=c.length;P<T&&!(g(c[P])&&(M.push(c[P]),--x<=0)||(S=c[P].children,m&&S&&S.length>0&&(S=i(g,S,m,x),M=M.concat(S),x-=S.length,x<=0)));P++);return M;}function l(g,c){for(var m=0,x=c.length;m<x;m++)if(g(c[m]))return c[m];return null;}function o(g,c){for(var m=null,x=0,M=c.length;x<M&&!m;x++)if(r(c[x]))g(c[x])?m=c[x]:c[x].children.length>0&&(m=o(g,c[x].children));else continue;return m;}function a(g,c){for(var m=0,x=c.length;m<x;m++)if(r(c[m])&&(g(c[m])||c[m].children.length>0&&a(g,c[m].children)))return!0;return!1;}function f(g,c){for(var m=[],x=c.slice();x.length;){var M=x.shift();r(M)&&(M.children&&M.children.length>0&&x.unshift.apply(x,M.children),g(M)&&m.push(M));}return m;}},/* 271 *//***/function(u,e,t){var r=t(256),n=e.isTag=r.isTag;e.testElement=function(a,f){for(var g in a)if(a.hasOwnProperty(g)){if(g==="tag_name"){if(!n(f)||!a.tag_name(f.name))return!1;}else if(g==="tag_type"){if(!a.tag_type(f.type))return!1;}else if(g==="tag_contains"){if(n(f)||!a.tag_contains(f.data))return!1;}else if(!f.attribs||!a[g](f.attribs[g]))return!1;}return!0;};var i={tag_name:function tag_name(a){return typeof a=="function"?function(f){return n(f)&&a(f.name);}:a==="*"?n:function(f){return n(f)&&f.name===a;};},tag_type:function tag_type(a){return typeof a=="function"?function(f){return a(f.type);}:function(f){return f.type===a;};},tag_contains:function tag_contains(a){return typeof a=="function"?function(f){return!n(f)&&a(f.data);}:function(f){return!n(f)&&f.data===a;};}};function l(a,f){return typeof f=="function"?function(g){return g.attribs&&f(g.attribs[a]);}:function(g){return g.attribs&&g.attribs[a]===f;};}function o(a,f){return function(g){return a(g)||f(g);};}e.getElements=function(a,f,g,c){var m=Object.keys(a).map(function(x){var M=a[x];return x in i?i[x](M):l(x,M);});return m.length===0?[]:this.filter(m.reduce(o),f,g,c);},e.getElementById=function(a,f,g){return Array.isArray(f)||(f=[f]),this.findOne(l("id",a),f,g!==!1);},e.getElementsByTagName=function(a,f,g,c){return this.filter(i.tag_name(a),f,g,c);},e.getElementsByTagType=function(a,f,g,c){return this.filter(i.tag_type(a),f,g,c);};},/* 272 *//***/function(u,e){e.removeSubsets=function(n){for(var i=n.length,l,o,a;--i>-1;){for(l=o=n[i],n[i]=null,a=!0;o;){if(n.indexOf(o)>-1){a=!1,n.splice(i,1);break;}o=o.parent;}a&&(n[i]=l);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=e.compareDocumentPosition=function(n,i){var l=[],o=[],a,f,g,c,m,x;if(n===i)return 0;for(a=n;a;)l.unshift(a),a=a.parent;for(a=i;a;)o.unshift(a),a=a.parent;for(x=0;l[x]===o[x];)x++;return x===0?t.DISCONNECTED:(f=l[x-1],g=f.children,c=l[x],m=o[x],g.indexOf(c)>g.indexOf(m)?f===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:f===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};e.uniqueSort=function(n){var i=n.length,l,o;for(n=n.slice();--i>-1;)l=n[i],o=n.indexOf(l),o>-1&&o<i&&n.splice(i,1);return n.sort(function(a,f){var g=r(a,f);return g&t.PRECEDING?-1:g&t.FOLLOWING?1:0;}),n;};},/* 273 *//***/function(u,e){u.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 *//***/function(u,e,t){u.exports=m;var r=t(275).parse,n=t(273),i=t(278),l=t(279),o=t(280),a=t(282),f=n.trueFunc,g=n.falseFunc,c=a.filters;function m(A,b,W){var D=M(A,b,W);return x(D,b);}function x(A,b){var W=b.adapter;return function(R){return W.isTag(R)&&A(R);};}function M(A,b,W){var D=r(A,b);return y(D,b,W);}function S(A){return A.type==="pseudo"&&(A.name==="scope"||Array.isArray(A.data)&&A.data.some(function(b){return b.some(S);}));}var P={type:"descendant"},T={type:"_flexibleDescendant"},h={type:"pseudo",name:"scope"},p={};function d(A,b,W){var D=b.adapter,R=!!W&&!!W.length&&W.every(function(j){return j===p||!!D.getParent(j);});A.forEach(function(j){if(!(j.length>0&&O(j[0])&&j[0].type!=="descendant"))if(R&&!(Array.isArray(j)?j.some(S):S(j)))j.unshift(P);else return;j.unshift(h);});}function y(A,b,W){A=A.filter(function(k){return k.length>0;}),A.forEach(i);var D=Array.isArray(W);W=b&&b.context||W,W&&!D&&(W=[W]),d(A,b,W);var R=!1,j=A.map(function(k){if(k[0]&&k[1]&&k[0].name==="scope"){var J=k[1].type;D&&J==="descendant"?k[1]=T:(J==="adjacent"||J==="sibling")&&(R=!0);}return E(k,b,W);}).reduce(w,g);return j.shouldTestNextSiblings=R,j;}function O(A){return l[A.type]<0;}function E(A,b,W){return A.reduce(function(D,R){if(D===g)return D;if(!(R.type in o))throw new Error("Rule type "+R.type+" is not supported by css-select");return o[R.type](D,R,b,W);},b&&b.rootFunc||f);}function w(A,b){return b===g||A===f?A:A===g||b===f?b:function(D){return A(D)||b(D);};}function B(A){return A.some(O);}c.not=function(A,b,W,D){var R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),adapter:W.adapter};if(R.strict&&(b.length>1||b.some(B)))throw new Error("complex selectors in :not aren't allowed in strict mode");var j=y(b,R,D);return j===g?A:j===f?g:function(J){return!j(J)&&A(J);};},c.has=function(A,b,W){var D=W.adapter,R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),adapter:D},j=b.some(B)?[p]:null,k=y(b,R,j);return k===g?g:k===f?function(rt){return D.getChildren(rt).some(D.isTag)&&A(rt);}:(k=x(k,W),j?function(rt){return A(rt)&&(j[0]=rt,D.existsOne(k,D.getChildren(rt)));}:function(rt){return A(rt)&&D.existsOne(k,D.getChildren(rt));});},c.matches=function(A,b,W,D){var R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),rootFunc:A,adapter:W.adapter};return y(b,R,D);},m.compileToken=y,m.compileUnsafe=M,m.Pseudos=a;},/* 275 *//***/function(u,e,t){var r=this&&this.__createBinding||(Object.create?function(o,a,f,g){g===void 0&&(g=f),Object.defineProperty(o,g,{enumerable:!0,get:function get(){return a[f];}});}:function(o,a,f,g){g===void 0&&(g=f),o[g]=a[f];}),n=this&&this.__exportStar||function(o,a){for(var f in o)f!=="default"&&!a.hasOwnProperty(f)&&r(a,o,f);};Object.defineProperty(e,"__esModule",{value:!0}),n(t(276),e);var i=t(276);Object.defineProperty(e,"parse",{enumerable:!0,get:function get(){return i["default"];}});var l=t(277);Object.defineProperty(e,"stringify",{enumerable:!0,get:function get(){return l["default"];}});},/* 276 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=S;var r=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,l={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},a={"#":["id","equals"],".":["class","element"]},f=/* @__PURE__ */new Set(["has","not","matches"]),g=/* @__PURE__ */new Set(["contains","icontains"]),c=/* @__PURE__ */new Set(['"',"'"]);function m(h,p,d){var y=parseInt(p,16)-65536;return y!==y||d?p:y<0?// BMP codepoint
351
+ String.fromCharCode(y+65536):// Supplemental Plane codepoint (surrogate pair)
352
+ String.fromCharCode(y>>10|55296,y&1023|56320);}function x(h){return h.replace(n,m);}function M(h){return h===" "||h==="\n"||h===" "||h==="\f"||h==="\r";}function S(h,p){var d=[];if(h=P(d,""+h,p),h!=="")throw new Error("Unmatched selector: "+h);return d;}function P(h,p,d){var y=[],O=!1;function E(){var nt=p.match(r);if(!nt)throw new Error("Expected name, found "+p);var lt=nt[0];return p=p.substr(lt.length),x(lt);}function w(nt){for(;M(p.charAt(nt));)nt++;p=p.substr(nt);}function B(nt){for(var lt=0;p.charAt(--nt)==="\\";)lt++;return(lt&1)===1;}for(w(0);p!=="";){var A=p.charAt(0);if(M(A))O=!0,w(1);else if(A in o)y.push({type:o[A]}),O=!1,w(1);else if(A===","){if(y.length===0)throw new Error("Empty sub-selector");h.push(y),y=[],O=!1,w(1);}else if(O&&(y.length>0&&y.push({type:"descendant"}),O=!1),A==="*")p=p.substr(1),y.push({type:"universal"});else if(A in a){var b=a[A],W=b[0],D=b[1];p=p.substr(1),y.push({type:"attribute",name:W,action:D,value:E(),ignoreCase:!1});}else if(A==="["){p=p.substr(1);var R=p.match(i);if(!R)throw new Error("Malformed attribute selector: "+p);p=p.substr(R[0].length);var j=x(R[1]);(!d||("lowerCaseAttributeNames"in d?d.lowerCaseAttributeNames:!d.xmlMode))&&(j=j.toLowerCase()),y.push({type:"attribute",name:j,action:l[R[2]],value:x(R[4]||R[5]||""),ignoreCase:!!R[6]});}else if(A===":"){if(p.charAt(1)===":"){p=p.substr(2),y.push({type:"pseudo-element",name:E().toLowerCase()});continue;}p=p.substr(1);var k=E().toLowerCase(),R=null;if(p.charAt(0)==="(")if(f.has(k)){var J=p.charAt(1),rt=c.has(J);if(p=p.substr(rt?2:1),R=[],p=P(R,p,d),rt){if(p.charAt(0)!==J)throw new Error("Unmatched quotes in :"+k);p=p.substr(1);}if(p.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+k+" ("+p+")");p=p.substr(1);}else{for(var st=1,$=1;$>0&&st<p.length;st++)p.charAt(st)==="("&&!B(st)?$++:p.charAt(st)===")"&&!B(st)&&$--;if($)throw new Error("Parenthesis not matched");if(R=p.substr(1,st-2),p=p.substr(st),g.has(k)){var J=R.charAt(0);J===R.slice(-1)&&c.has(J)&&(R=R.slice(1,-1)),R=x(R);}}y.push({type:"pseudo",name:k,data:R});}else if(r.test(p)){var V=E();(!d||("lowerCaseTags"in d?d.lowerCaseTags:!d.xmlMode))&&(V=V.toLowerCase()),y.push({type:"tag",name:V});}else return y.length&&y[y.length-1].type==="descendant"&&y.pop(),T(h,y),p;}return T(h,y),p;}function T(h,p){if(h.length>0&&p.length===0)throw new Error("Empty sub-selector");h.push(p);}},/* 277 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(a){return a.map(i).join(", ");}e["default"]=n;function i(a){return a.map(l).join("");}function l(a){switch(a.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return a.name;case"pseudo-element":return"::"+a.name;case"pseudo":return a.data===null?":"+a.name:typeof a.data=="string"?":"+a.name+"("+a.data+")":":"+a.name+"("+n(a.data)+")";case"attribute":return a.action==="exists"?"["+a.name+"]":a.name==="id"&&a.action==="equals"&&!a.ignoreCase?"#"+a.value:a.name==="class"&&a.action==="element"&&!a.ignoreCase?"."+a.value:"["+a.name+r[a.action]+"='"+a.value+"'"+(a.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(a){return a;}},/* 278 *//***/function(u,e,t){u.exports=i;var r=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function i(o){for(var a=o.map(l),f=1;f<o.length;f++){var g=a[f];if(!(g<0))for(var c=f-1;c>=0&&g<a[c];c--){var m=o[c+1];o[c+1]=o[c],o[c]=m,a[c+1]=a[c],a[c]=g;}}}function l(o){var a=r[o.type];if(a===r.attribute)a=n[o.action],a===n.equals&&o.name==="id"&&(a=9),o.ignoreCase&&(a>>=1);else if(a===r.pseudo)if(!o.data)a=3;else if(o.name==="has"||o.name==="contains")a=0;else if(o.name==="matches"||o.name==="not"){a=0;for(var f=0;f<o.data.length;f++)if(o.data[f].length===1){var g=l(o.data[f][0]);if(g===0){a=0;break;}g>a&&(a=g);}o.data.length>1&&a>0&&(a-=1);}else a=1;return a;}},/* 279 *//***/function(u){u.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 *//***/function(u,e,t){var r=t(281),n=t(282);u.exports={__proto__:null,attribute:r.compile,pseudo:n.compile,//tags
353
+ tag:function tag(i,l,o){var a=l.name,f=o.adapter;return function(c){return f.getName(c)===a&&i(c);};},//traversal
354
+ descendant:function descendant(i,l,o){var a=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,f=o.adapter;return function(c){for(var m=!1;!m&&(c=f.getParent(c));)(!a||!a.has(c))&&(m=i(c),!m&&a&&a.add(c));return m;};},_flexibleDescendant:function _flexibleDescendant(i,l,o){var a=o.adapter;return function(g){for(var c=i(g);!c&&(g=a.getParent(g));)c=i(g);return c;};},parent:function parent(i,l,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var a=o.adapter;return function(c){return a.getChildren(c).some(f);};function f(g){return a.isTag(g)&&i(g);}},child:function child(i,l,o){var a=o.adapter;return function(g){var c=a.getParent(g);return!!c&&i(c);};},sibling:function sibling(i,l,o){var a=o.adapter;return function(g){for(var c=a.getSiblings(g),m=0;m<c.length;m++)if(a.isTag(c[m])){if(c[m]===g)break;if(i(c[m]))return!0;}return!1;};},adjacent:function adjacent(i,l,o){var a=o.adapter;return function(g){for(var c=a.getSiblings(g),m,x=0;x<c.length;x++)if(a.isTag(c[x])){if(c[x]===g)break;m=c[x];}return!!m&&i(m);};},universal:function universal(i){return i;}};},/* 281 *//***/function(u,e,t){var r=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(l,o,a){var f=o.name,g=o.value,c=a.adapter;return o.ignoreCase?(g=g.toLowerCase(),function(x){var M=c.getAttributeValue(x,f);return M!=null&&M.toLowerCase()===g&&l(x);}):function(x){return c.getAttributeValue(x,f)===g&&l(x);};},hyphen:function hyphen(l,o,a){var f=o.name,g=o.value,c=g.length,m=a.adapter;return o.ignoreCase?(g=g.toLowerCase(),function(M){var S=m.getAttributeValue(M,f);return S!=null&&(S.length===c||S.charAt(c)==="-")&&S.substr(0,c).toLowerCase()===g&&l(M);}):function(M){var S=m.getAttributeValue(M,f);return S!=null&&S.substr(0,c)===g&&(S.length===c||S.charAt(c)==="-")&&l(M);};},element:function element(l,o,a){var f=o.name,g=o.value,c=a.adapter;if(/\s/.test(g))return r;g=g.replace(n,"\\$&");var m="(?:^|\\s)"+g+"(?:$|\\s)",x=o.ignoreCase?"i":"",M=new RegExp(m,x);return function(P){var T=c.getAttributeValue(P,f);return T!=null&&M.test(T)&&l(P);};},exists:function exists(l,o,a){var f=o.name,g=a.adapter;return function(m){return g.hasAttrib(m,f)&&l(m);};},start:function start(l,o,a){var f=o.name,g=o.value,c=g.length,m=a.adapter;return c===0?r:o.ignoreCase?(g=g.toLowerCase(),function(M){var S=m.getAttributeValue(M,f);return S!=null&&S.substr(0,c).toLowerCase()===g&&l(M);}):function(M){var S=m.getAttributeValue(M,f);return S!=null&&S.substr(0,c)===g&&l(M);};},end:function end(l,o,a){var f=o.name,g=o.value,c=-g.length,m=a.adapter;return c===0?r:o.ignoreCase?(g=g.toLowerCase(),function(M){var S=m.getAttributeValue(M,f);return S!=null&&S.substr(c).toLowerCase()===g&&l(M);}):function(M){var S=m.getAttributeValue(M,f);return S!=null&&S.substr(c)===g&&l(M);};},any:function any(l,o,a){var f=o.name,g=o.value,c=a.adapter;if(g==="")return r;if(o.ignoreCase){var m=new RegExp(g.replace(n,"\\$&"),"i");return function(M){var S=c.getAttributeValue(M,f);return S!=null&&m.test(S)&&l(M);};}return function(M){var S=c.getAttributeValue(M,f);return S!=null&&S.indexOf(g)>=0&&l(M);};},not:function not(l,o,a){var f=o.name,g=o.value,c=a.adapter;return g===""?function(x){return!!c.getAttributeValue(x,f)&&l(x);}:o.ignoreCase?(g=g.toLowerCase(),function(x){var M=c.getAttributeValue(x,f);return M!=null&&M.toLowerCase()!==g&&l(x);}):function(x){return c.getAttributeValue(x,f)!==g&&l(x);};}};u.exports={compile:function compile(l,o,a){if(a&&a.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return i[o.action](l,o,a);},rules:i};},/* 282 *//***/function(u,e,t){var r=t(283),n=t(273),i=t(281),l=n.trueFunc,o=n.falseFunc,a=i.rules.equals;function f(T,h){var p={name:T,value:h};return function(y,O,E){return a(y,p,E);};}function g(T,h){return function(p){return!!h.getParent(p)&&T(p);};}var c={contains:function contains(T,h,p){var d=p.adapter;return function(O){return T(O)&&d.getText(O).indexOf(h)>=0;};},icontains:function icontains(T,h,p){var d=h.toLowerCase(),y=p.adapter;return function(E){return T(E)&&y.getText(E).toLowerCase().indexOf(d)>=0;};},//location specific methods
355
+ "nth-child":function nthChild(T,h,p){var d=r(h),y=p.adapter;return d===o?d:d===l?g(T,y):function(E){for(var w=y.getSiblings(E),B=0,A=0;B<w.length;B++)if(y.isTag(w[B])){if(w[B]===E)break;A++;}return d(A)&&T(E);};},"nth-last-child":function nthLastChild(T,h,p){var d=r(h),y=p.adapter;return d===o?d:d===l?g(T,y):function(E){for(var w=y.getSiblings(E),B=0,A=w.length-1;A>=0;A--)if(y.isTag(w[A])){if(w[A]===E)break;B++;}return d(B)&&T(E);};},"nth-of-type":function nthOfType(T,h,p){var d=r(h),y=p.adapter;return d===o?d:d===l?g(T,y):function(E){for(var w=y.getSiblings(E),B=0,A=0;A<w.length;A++)if(y.isTag(w[A])){if(w[A]===E)break;y.getName(w[A])===y.getName(E)&&B++;}return d(B)&&T(E);};},"nth-last-of-type":function nthLastOfType(T,h,p){var d=r(h),y=p.adapter;return d===o?d:d===l?g(T,y):function(E){for(var w=y.getSiblings(E),B=0,A=w.length-1;A>=0;A--)if(y.isTag(w[A])){if(w[A]===E)break;y.getName(w[A])===y.getName(E)&&B++;}return d(B)&&T(E);};},//TODO determine the actual root element
356
+ root:function root(T,h,p){var d=p.adapter;return function(y){return!d.getParent(y)&&T(y);};},scope:function scope(T,h,p,d){var y=p.adapter;if(!d||d.length===0)return c.root(T,h,p);function O(E,w){return typeof y.equals=="function"?y.equals(E,w):E===w;}return d.length===1?function(E){return O(d[0],E)&&T(E);}:function(E){return d.indexOf(E)>=0&&T(E);};},//jQuery extensions (others follow as pseudos)
357
+ checkbox:f("type","checkbox"),file:f("type","file"),password:f("type","password"),radio:f("type","radio"),reset:f("type","reset"),image:f("type","image"),submit:f("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
358
+ hover:function hover(T,h,p){var d=p.adapter;return typeof d.isHovered=="function"?function(O){return T(O)&&d.isHovered(O);}:o;},visited:function visited(T,h,p){var d=p.adapter;return typeof d.isVisited=="function"?function(O){return T(O)&&d.isVisited(O);}:o;},active:function active(T,h,p){var d=p.adapter;return typeof d.isActive=="function"?function(O){return T(O)&&d.isActive(O);}:o;}};function m(T,h){for(var p=0;T&&p<T.length;p++)if(h.isTag(T[p]))return T[p];}var x={empty:function empty(T,h){return!h.getChildren(T).some(function(p){return h.isTag(p)||p.type==="text";});},"first-child":function firstChild(T,h){return m(h.getSiblings(T),h)===T;},"last-child":function lastChild(T,h){for(var p=h.getSiblings(T),d=p.length-1;d>=0;d--){if(p[d]===T)return!0;if(h.isTag(p[d]))break;}return!1;},"first-of-type":function firstOfType(T,h){for(var p=h.getSiblings(T),d=0;d<p.length;d++)if(h.isTag(p[d])){if(p[d]===T)return!0;if(h.getName(p[d])===h.getName(T))break;}return!1;},"last-of-type":function lastOfType(T,h){for(var p=h.getSiblings(T),d=p.length-1;d>=0;d--)if(h.isTag(p[d])){if(p[d]===T)return!0;if(h.getName(p[d])===h.getName(T))break;}return!1;},"only-of-type":function onlyOfType(T,h){for(var p=h.getSiblings(T),d=0,y=p.length;d<y;d++)if(h.isTag(p[d])){if(p[d]===T)continue;if(h.getName(p[d])===h.getName(T))return!1;}return!0;},"only-child":function onlyChild(T,h){for(var p=h.getSiblings(T),d=0;d<p.length;d++)if(h.isTag(p[d])&&p[d]!==T)return!1;return!0;},//:matches(a, area, link)[href]
359
+ link:function link(T,h){return h.hasAttrib(T,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
360
+ //forms
361
+ //to consider: :target
362
+ //:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
363
+ selected:function selected(T,h){if(h.hasAttrib(T,"selected"))return!0;if(h.getName(T)!=="option")return!1;var p=h.getParent(T);if(!p||h.getName(p)!=="select"||h.hasAttrib(p,"multiple"))return!1;for(var d=h.getChildren(p),y=!1,O=0;O<d.length;O++)if(h.isTag(d[O]))if(d[O]===T)y=!0;else if(y){if(h.hasAttrib(d[O],"selected"))return!1;}else return!1;return y;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
364
+ //:matches(
365
+ // :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
366
+ // optgroup[disabled] > option),
367
+ // fieldset[disabled] * //TODO not child of first <legend>
368
+ //)
369
+ disabled:function disabled(T,h){return h.hasAttrib(T,"disabled");},enabled:function enabled(T,h){return!h.hasAttrib(T,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
370
+ checked:function checked(T,h){return h.hasAttrib(T,"checked")||x.selected(T,h);},//:matches(input, select, textarea)[required]
371
+ required:function required(T,h){return h.hasAttrib(T,"required");},//:matches(input, select, textarea):not([required])
372
+ optional:function optional(T,h){return!h.hasAttrib(T,"required");},//jQuery extensions
373
+ //:not(:empty)
374
+ parent:function parent(T,h){return!x.empty(T,h);},//:matches(h1, h2, h3, h4, h5, h6)
375
+ header:M(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
376
+ button:function button(T,h){var p=h.getName(T);return p==="button"||p==="input"&&h.getAttributeValue(T,"type")==="button";},//:matches(input, textarea, select, button)
377
+ input:M(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
378
+ text:function text(T,h){var p;return h.getName(T)==="input"&&(!(p=h.getAttributeValue(T,"type"))||p.toLowerCase()==="text");}};function M(T){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var h=new Set(T);return function(p,d){return h.has(d.getName(p));};}return function(p,d){return T.indexOf(d.getName(p))>=0;};}function S(T,h,p){if(p===null){if(T.length>2&&h!=="scope")throw new Error("pseudo-selector :"+h+" requires an argument");}else if(T.length===2)throw new Error("pseudo-selector :"+h+" doesn't have any arguments");}var P=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;u.exports={compile:function compile(T,h,p,d){var y=h.name,O=h.data,E=p.adapter;if(p&&p.strict&&!P.test(y))throw new Error(":"+y+" isn't part of CSS3");if(typeof c[y]=="function")return c[y](T,O,p,d);if(typeof x[y]=="function"){var w=x[y];return S(w,y,O),w===o?w:T===l?function(A){return w(A,E,O);}:function(A){return w(A,E,O)&&T(A);};}else throw new Error("unmatched pseudo-class :"+y);},filters:c,pseudos:x};},/* 283 *//***/function(u,e,t){var r=t(284),n=t(285);u.exports=function(l){return n(r(l));},u.exports.parse=r,u.exports.compile=n;},/* 284 *//***/function(u,e){u.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 i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var l;return i[1]?(l=parseInt(i[1],10),isNaN(l)&&(i[1].charAt(0)==="-"?l=-1:l=1)):l=0,[l,i[3]?parseInt((i[2]||"")+i[3],10):0];}},/* 285 *//***/function(u,e,t){u.exports=l;var r=t(273),n=r.trueFunc,i=r.falseFunc;function l(o){var a=o[0],f=o[1]-1;if(f<0&&a<=0)return i;if(a===-1)return function(c){return c<=f;};if(a===0)return function(c){return c===f;};if(a===1)return f<0?n:function(c){return c>=f;};var g=f%a;return g<0&&(g+=a),a>1?function(c){return c>=f&&c%a===g;}:(a*=-1,function(c){return c<=f&&c%a===g;});}},/* 286 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return O;});var r=t(12),n=t(74),i=t(1),l=t(68),o=t(250),a=t(213),f=t(218);t(1).glMatrix.setMatrixArrayType(Array);function g(E,w){if(E==null)return{};var B=c(E,w),A,b;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(E);for(b=0;b<W.length;b++)A=W[b],!(w.indexOf(A)>=0)&&Object.prototype.propertyIsEnumerable.call(E,A)&&(B[A]=E[A]);}return B;}function c(E,w){if(E==null)return{};var B={},A=Object.keys(E),b,W;for(W=0;W<A.length;W++)b=A[W],!(w.indexOf(b)>=0)&&(B[b]=E[b]);return B;}var m={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
379
+ },x=Symbol("autoRender"),M=Symbol("renderer"),S=Symbol("timeline"),P=Symbol("prepareRender"),T=Symbol("tickRender"),h=Symbol("pass"),p=Symbol("fbo"),d=Symbol("tickers"),y=Symbol("layerTransformInvert");var O=/*#__PURE__*/function(_o$default){function O(){var _this49;var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this49=_callSuper(this,O),!w.canvas){var _this49$getResolution=_this49.getResolution(),W=_this49$getResolution.width,D=_this49$getResolution.height,R=r.ENV.createCanvas(W,D,{offscreen:!!w.offscreen,id:w.id,extra:w.extra});R.style&&(R.style.position="absolute"),R.dataset&&(R.dataset.layerId=w.id),R.contextType&&(w.contextType=R.contextType),w.canvas=R;}var B=w.canvas,A=Object.assign({},m,w);_this49[x]=A.autoRender,delete w.autoRender;var b=A.Renderer||r.Renderer;_this49[M]=new b(B,A),_this49.options=w,_this49.id=w.id,_this49[h]=[],_this49.setResolution(B),_this49.canvas=B,_this49[S]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[y]=null;return _this49;}_inherits(O,_o$default);return _createClass(O,[{key:"autoRender",get:function get(){return this[x];}},{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(),w=_this$getResolution.height;return w/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[h];}},{key:"prepareRender",get:function get(){return this[P]?this[P]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[M];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,w=_this$parent$options.left,B=_this$parent$options.top;return[w,B];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[S];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),w=_this$getResolution2.width;return w/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,w=_this$attributes21.x,B=_this$attributes21.y;return[1,0,0,1,w,B];}},{key:"layerTransformInvert",get:function get(){if(this[y])return this[y];var w=this.transformMatrix;return w[0]===1&&w[1]===0&&w[2]===0&&w[3]===1&&w[4]===0&&w[5]===0?null:(this[y]=i.mat2d.invert(Array.of(0,0,0,0,0,0),w),this[y]);}},{key:"forceContextLoss",value:function forceContextLoss(){var w=this.renderer.glRenderer;if(w){var B=w.getExtension("WEBGL_lose_context");if(B)return B.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
380
+ // return true;
381
+ // }
382
+ },{key:"addPass",value:function addPass(){var _ref150=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},w=_ref150.vertex,B=_ref150.fragment,A=_ref150.options,b=_ref150.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),W=_this$getResolution3.width,D=_this$getResolution3.height,R=this.renderer.createPassProgram({vertex:w,fragment:B,options:A}),j=new r.Figure2D();j.rect(0,0,W/this.displayRatio,D/this.displayRatio);var k=new r.Mesh2D(j);return k.setUniforms(b),k.setProgram(R),this[h].push(k),this.forceUpdate(),k;}return null;}// delete unused texture to release memory.
383
+ },{key:"deleteTexture",value:function deleteTexture(w){return Object(f.deleteTexture)(w,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(w){var B=w.type;if(B==="mousedown"||B==="mouseup"||B==="mousemove"){var R=this.__mouseCapturedTarget;if(R){if(R.layer===this)return R.dispatchEvent(w),!0;this.__mouseCapturedTarget=null;}}var A,b;var W=this.layerTransformInvert;if(W){A=w.x,b=w.y;var _R6=W,j=_R6[0]*A+_R6[2]*b+_R6[4],k=_R6[1]*A+_R6[3]*b+_R6[5];delete w.x,delete w.y,delete w.layerX,delete w.layerY,Object.defineProperties(w,{layerX:{value:j,configurable:!0},layerY:{value:k,configurable:!0},x:{value:j,configurable:!0},y:{value:k,configurable:!0}});}var D=_superPropGet(O,"dispatchPointerEvent",this,3)([w]);return W&&Object.defineProperties(w,{layerX:{value:A,configurable:!0},layerY:{value:b,configurable:!0},x:{value:A,configurable:!0},y:{value:b,configurable:!0}}),D;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this50=this;if(!this[P])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var w=null;var B=new Promise(function(A){w=A;});B._resolve=w,this[P]=B;}else{var _w2=null,_B8=null;var A=new Promise(function(b){_w2=b,_this50[x]&&(_B8=Object(l.requestAnimationFrame)(function(){delete A._requestID,_this50.render();}));});A._resolve=_w2,A._requestID=_B8,this[P]=A;}}},{key:"getFBO",value:function getFBO(){var w=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),B=_this$getResolution4.width,A=_this$getResolution4.height;return w&&(!this[p]||this[p].width!==B||this[p].height!==A)?(this[p]={width:B,height:A,target:w.createFBO(),buffer:w.createFBO(),swap:function swap(){var _ref151=[this.buffer,this.target];this.target=_ref151[0];this.buffer=_ref151[1];}},this[p]):this[p]?this[p]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var w=this.renderer,B=w.__globalTransformMatrix||w.globalTransformMatrix;w.__globalTransformMatrix=B;var A=i.mat2d.fromValues(1,0,0,1,0,0);w.setGlobalTransform.apply(w,_toConsumableArray(i.mat2d.multiply(A,B,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(w,B,A){if(_superPropGet(O,"onPropertyChange",this,3)([w,B,A]),w==="zIndex"&&(this.canvas.style.zIndex=B),w==="transform"||w==="translate"||w==="rotate"||w==="scale"||w==="skew"){var b=this[y];if(this[y]=null,this.updateGlobalTransform(),b&&!this.layerTransformInvert){var W=this.renderer,D=W.__globalTransformMatrix||W.globalTransformMatrix;W.setGlobalTransform.apply(W,_toConsumableArray(D));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[P]&&(this[P]._requestID&&Object(l.cancelAnimationFrame)(this[P]._requestID),this[P]._resolve(),delete this[P]);}},{key:"render",value:function render(){var _this51=this;var _ref152=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref152$clear=_ref152.clear,w=_ref152$clear===void 0?!0:_ref152$clear;var B=this[h].length?this.getFBO():null;B&&this.renderer.glRenderer.bindFBO(B.target),w&&this[M].clear();var A=this.draw();if(A&&A.length&&(this.renderer.drawMeshes(A),this.canvas.draw&&this.canvas.draw()),B){var b=this.renderer.glRenderer,W=this[h].length,_this$getResolution5=this.getResolution(),D=_this$getResolution5.width,R=_this$getResolution5.height,j=[0,0,D/this.displayRatio,R/this.displayRatio];this[h].forEach(function(k,J){k.blend=!0,k.setTexture(B.target.texture,{rect:j}),J===W-1?b.bindFBO(null):(B.swap(),b.bindFBO(B.target)),_this51[M].clear(),_this51.renderer.drawMeshes([k]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref153){var _this52=this;var w=_ref153.width,B=_ref153.height;var A=this.renderer,b=A.__globalTransformMatrix||A.globalTransformMatrix,W=b[4],D=b[5],R=b[0],_this$getResolution6=this.getResolution(),j=_this$getResolution6.width,k=_this$getResolution6.height;(j!==w||k!==B)&&(_superPropGet(O,"setResolution",this,3)([{width:w,height:B}]),this.canvas&&(this.canvas.width=w,this.canvas.height=B,A.updateResolution&&A.updateResolution()),this.attributes.size=[w,B],this[h].length&&this[h].forEach(function($){var V=new r.Figure2D();V.rect(0,0,w/_this52.displayRatio,B/_this52.displayRatio),$.contours=V.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),J=_this$renderOffset[0],rt=_this$renderOffset[1],st=this.displayRatio;(W!==J||D!==rt||R!==st)&&(A.setGlobalTransform(st,0,0,st,J,rt),A.__globalTransformMatrix=null,this[y]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
384
+ * tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
385
+ * @param {*} handler
386
+ * @param {*} options
387
+ */},{key:"tick",value:function tick(){var _this53=this;var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var B=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _B$duration=B.duration,A=_B$duration===void 0?1/0:_B$duration,b=g(B,["duration"]);var W=this.timeline.fork(b),D=this;this[d]=this[d]||[],this[d].push({handler:w,duration:A});var _R7=function R(){var j=null,k=null;var J=function J(){var rt=_this53[d].map(function(_ref154){var st=_ref154.handler,$=_ref154.duration;var V=Math.min(1,W.currentTime/$);return{value:st?st(W.currentTime,V):null,p:V};});D[T]||(D[T]=Promise.resolve().then(function(){D[x]&&D.render(),delete D[T];for(var st=rt.length-1;st>=0;st--){var _rt$st=rt[st],$=_rt$st.value,V=_rt$st.p;($===!1||V>=1)&&_this53[d].splice(st,1);}_this53[d].length>0&&_R7();}));};if(_this53[P]&&_this53[P]._type!=="ticker"&&(Object(l.cancelAnimationFrame)(_this53[P]._requestID),delete _this53[P]),!_this53[P]){var rt=new Promise(function(st){j=st,k=Object(l.requestAnimationFrame)(J);});rt._resolve=j,rt._requestID=k,rt._type="ticker",_this53[P]=rt;}};_R7();}},{key:"toGlobalPos",value:function toGlobalPos(w,B){if(this.layerTransformInvert){var j=this.transformMatrix;w=j[0]*w+j[2]*B+j[4],B=j[1]*w+j[3]*B+j[5];}var _this$getResolution7=this.getResolution(),A=_this$getResolution7.width,b=_this$getResolution7.height,W=this.renderOffset,D=[this.canvas.clientWidth,this.canvas.clientHeight];w=w*D[0]/A+W[0],B=B*D[1]/b+W[1];var R=this.displayRatio;return w*=R,B*=R,[w,B];}},{key:"toLocalPos",value:function toLocalPos(w,B){var _this$getResolution8=this.getResolution(),A=_this$getResolution8.width,b=_this$getResolution8.height,W=this.renderOffset,D=[this.canvas.clientWidth,this.canvas.clientHeight];w=w*A/D[0]-W[0],B=B*b/D[1]-W[1];var R=this.displayRatio;w/=R,B/=R;var j=this.layerTransformInvert;return j&&(w=j[0]*w+j[2]*B+j[4],B=j[1]*w+j[3]*B+j[5]),[w,B];}}]);}(o["default"]);a["default"].registerNode(O,"layer");},/* 287 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return P;});var r=t(224),n=t(288),i=t(213),l=t(252),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function a(T,h){if(T==null)return{};var p=f(T,h),d,y;if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(T);for(y=0;y<O.length;y++)d=O[y],!(h.indexOf(d)>=0)&&Object.prototype.propertyIsEnumerable.call(T,d)&&(p[d]=T[d]);}return p;}function f(T,h){if(T==null)return{};var p={},d=Object.keys(T),y,O;for(O=0;O<d.length;O++)y=d[O],!(h.indexOf(y)>=0)&&(p[y]=T[y]);return p;}function g(T,h,p){return h in T?Object.defineProperty(T,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):T[h]=p,T;}var c="http://www.w3.org/2000/svg",m=Symbol["for"]("spritejs_setAttribute"),x=Symbol("root"),M=Symbol("task");function S(T){var h=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var p=T[x];if(p&&p.children[0]){var d=T.svg,y=T.layer?T.layer.displayRatio:1;if(!d.hasAttribute("data-original-width")){var w=d.getAttribute("width");w=w?Object(o.sizeToPixel)(w):300;var B=d.getAttribute("height");B=B?Object(o.sizeToPixel)(B):150,d.hasAttribute("viewBox")||d.setAttribute("viewBox","0 0 ".concat(Math.round(w)," ").concat(Math.round(B))),d.setAttribute("data-original-width",w),d.setAttribute("data-original-height",B);}var O=T.attributes.width||Number(d.getAttribute("data-original-width")),E=T.attributes.height||Number(d.getAttribute("data-original-height"));if(O*=y,E*=y,h&&T.attributes.flexible){var _w3=T.attributes.scale[0];if(O*=_w3,E*=_w3,d.setAttribute("width",O),d.setAttribute("height",E),O&&E&&T.textureImage){var _B9=T.textureImage.width,A=T.textureImage.height,b=T.clientSize;T.attributes.textureRect=[0,0,Math.round(b[0]*_B9/O),Math.round(b[1]*A/E)];}}else T[M]||(d.setAttribute("width",O),d.setAttribute("height",E),T[M]=Promise.resolve().then(function(){delete T[M];var w=p.innerHTML,B=new Blob([w],{type:"image/svg+xml"}),A=URL.createObjectURL(B),b=new Image();b.onload=function(){b.width&&b.height?(T.attributes[m]("texture",b),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[m]("texture",null);},b.src=A;}));}}var P=/*#__PURE__*/function(_r$default21){function P(){var _this54;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof h=="string"&&(h={svgText:h});var _h25=h,p=_h25.svgText,d=a(h,["svgText"]);if(_this54=_callSuper(this,P,[d]),_this54[x]=document.createElement("div"),p){_this54[x].innerHTML=p;var y=_this54[x].children[0];y?y.setAttribute("xmlns",c):(fetch(p).then(function(O){return O.text();}).then(function(O){_this54[x].innerHTML=O,(!_this54.observer||_this54.attributes.flexible)&&S(_assertThisInitialized(_this54));}),p=null);}if(!p){var _y7=document.createElementNS(c,"svg");_y7.setAttribute("xmlns",c),_this54[x].appendChild(_y7);}if(typeof MutationObserver=="function"){var _y8=new MutationObserver(function(O){S(_this54,!1);});_y8.observe(_this54[x],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_y8;}return _this54;}_inherits(P,_r$default21);return _createClass(P,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[x]?this[x].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref155){var h=_ref155.width,p=_ref155.height;_superPropGet(P,"setResolution",this,3)([{width:h,height:p}]),S(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(h){var p=_superPropGet(P,"dispatchPointerEvent",this,3)([h]);if(p&&this.attributes.passEvents&&typeof MouseEvent=="function"){var d=h.x,y=h.y;var _this$getOffsetPositi=this.getOffsetPosition(d,y),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),O=_this$getOffsetPositi2[0],E=_this$getOffsetPositi2[1];var w=h.originalEvent,B=this.attributes.anchor,A=this.clientSize;O=(O+B[0]*A[0])/2,E=(E+B[1]*A[1])/2;var b=h.type;if(b===w.type){var W=null;if(w instanceof MouseEvent)W=new MouseEvent(b,{screenX:O,screenY:E,clientX:O,clientY:E,bubbles:w.bubbles,button:w.button,buttons:w.buttons,cancelBubble:w.cancelBubble,cancelable:w.cancelable,currentTarget:w.currentTarget,fromElement:w.fromElement,relatedTarget:w.relatedTarget,returnValue:w.returnValue,srcElement:w.srcElement,target:w.target,toElement:w.toElement,// view: originalEvent.view,
388
+ which:w.witch});else if(w instanceof TouchEvent){var D=null;var R=w.changedTouches||[w];for(var j=0;j<R.length;j++){var k=R[j];if(h.identifier===k.identifier){D=k;break;}}if(D){var _j3=new Touch({identifier:D.identifier,target:D.target,clientX:O,clientY:E,screenX:O,screenY:E,pageX:O,pageY:E,radiusX:D.radiusX,radiusY:D.radiusY,rotationAngle:D.rotationAngle,force:D.force});W=new TouchEvent(b,{cancelable:w.cancelable,bubbles:w.bubbles,composed:w.composed,touches:[_j3],targetTouches:[_j3],changedTouches:[_j3]});}}else W=w;W&&this.svg.dispatchEvent(W);}}return p;}},{key:"getElementById",value:function getElementById(h){return Object(l.querySelector)("#".concat(h),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(h){return Object(l.querySelectorAll)(".".concat(h),this);}},{key:"getElementsByName",value:function getElementsByName(h){return Object(l.querySelectorAll)("[name=\"".concat(h,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(h){return Object(l.querySelectorAll)(h,this);}},{key:"querySelector",value:function querySelector(h){return Object(l.querySelector)(h,this);}},{key:"querySelectorAll",value:function querySelectorAll(h){return Object(l.querySelectorAll)(h,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(h,p,d){_superPropGet(P,"onPropertyChange",this,3)([h,p,d]),h==="flexible"&&S(this),this.attributes.flexible&&(h==="width"||h==="height"||h==="scale"||h==="transform")&&S(this);}}]);}(r["default"]);g(P,"Attr",n["default"]),i["default"].registerNode(P,"spritesvg");},/* 288 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),i=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_setAttributeDefault");var o=/*#__PURE__*/function(_r$default22){function o(f){var _this55;_classCallCheck(this,o);_this55=_callSuper(this,o,[f]),_this55[l]({passEvents:!1,flexible:!1});return _this55;}// readonly
389
+ _inherits(o,_r$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(f){}// eslint-disable-line no-empty-function
390
+ },{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(f){return this[i]("passEvents",f);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(f){return this[i]("flexible",f);}}]);}(r["default"]);},/* 289 *//***/function(u,e,t){t.r(e);var r=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(f,g){var c=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);g&&(m=m.filter(function(x){return Object.getOwnPropertyDescriptor(f,x).enumerable;})),c.push.apply(c,m);}return c;}function i(f){for(var g=1;g<arguments.length;g++){var c=arguments[g]!=null?arguments[g]:{};g%2?n(Object(c),!0).forEach(function(m){l(f,m,c[m]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(c)):n(Object(c)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(c,m));});}return f;}function l(f,g,c){return g in f?Object.defineProperty(f,g,{value:c,enumerable:!0,configurable:!0,writable:!0}):f[g]=c,f;}var o=Symbol("inited");var a=null;typeof Worker=="function"&&(a=/*#__PURE__*/function(_Worker){function a(f){var _this56;_classCallCheck(this,a);if(f.worker===!0&&(f.worker="./".concat(f.id,".worker.js")),_this56=_callSuper(this,a,[f.worker]),_this56.options=f,!f.canvas){var _this56$getResolution=_this56.getResolution(),g=_this56$getResolution.width,c=_this56$getResolution.height,m=r.ENV.createCanvas(g,c,{offscreen:!1});m.style&&(m.style.position="absolute"),m.dataset&&(m.dataset.layerId=f.id),f.canvas=m;}_this56.canvas=f.canvas;return _this56;}_inherits(a,_Worker);return _createClass(a,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref156){var f=_ref156.width,g=_ref156.height;if(this[o])this.postMessage({type:"resolution_change",width:f,height:g});else{this.canvas.width=f,this.canvas.height=g;var c=this.options,m=c.canvas.transferControlToOffscreen(),x=i({},c);delete x.container,x.canvas=m,this.postMessage({type:"create",options:x},[m]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,f=_this$canvas6.width,g=_this$canvas6.height;return{width:f,height:g};}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(f,g){Object.defineProperty(this,"parent",{value:f,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:g,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(f){this.postMessage({type:"event",event:{cancelBubble:f.cancelBubble,bubbles:f.bubbles,detail:f.detail,identifier:f.identifier,layerX:f.layerX,layerY:f.layerY,originalX:f.originalX,originalY:f.originalY,type:f.type,x:f.x,y:f.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),e["default"]=a;},/* 290 *//***/function(u,e,t){t.r(e),function(r){t.d(e,"default",function(){return O;});var n=t(12),i=t(68),l=t(70),o=t(286),a=t(289),f=t(250),g=t(291),c=t(214),m=t(218),x=t(213);t(1).glMatrix.setMatrixArrayType(Array);var M=Symbol("enteredTargets");function S(E){return E.id=E.id||"_layer".concat(Math.random().toString(36).slice(2,12)),E.dataset||(E.dataset={}),E.dataset.layerId=E.id,E.connect=function(w,B){E.parent=w,Object.defineProperty(E,"zOrder",{value:B,writable:!1,configurable:!0});},E.disconnect=function(w){delete E.zOrder;},E.canvas=E,E.getResolution=function(){return{width:0,height:0};},E.setResolution=function(){return!1;},E.options={handleEvent:!1},E;}function P(E,w){var B=E.children;var A=null;for(var b=0;b<B.length;b++){var W=B[b];if((w===W||A!=null)&&(A=W),A&&A!==w&&!A.offscreen)return A.canvas;}return null;}function T(E,w){var _E$renderOffset=_slicedToArray(E.renderOffset,2),B=_E$renderOffset[0],A=_E$renderOffset[1],_E$getResolution=E.getResolution(),b=_E$getResolution.width,W=_E$getResolution.height,D=E.displayRatio;E.renderer.drawImage(w.canvas,-B/D,-A/D,b/D,W/D);}var h={};function p(E){var w=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],B=E.container;B.addEventListener("mouseleave",function(A){var b=E[M];if(b.size){var W=new c["default"]("mouseleave");W.setOriginalEvent(A),_toConsumableArray(b).forEach(function(D){D.dispatchEvent(W);}),E[M].clear();}},{passive:!0}),w.forEach(function(A){B.addEventListener(A,function(b){var _E$options=E.options,W=_E$options.left,D=_E$options.top,R=_E$options.displayRatio,j=E.orderedChildren;Object(g["default"])(b,{offsetLeft:W,offsetTop:D,displayRatio:R}).forEach(function(J){var rt=J.identifier;if(J.type==="touchmove"||J.type==="touchend"){var $=h[rt];$&&$.dispatchEvent(J),J.type==="touchend"&&delete h[rt];}else{for(var _$=j.length-1;_$>=0;_$--){var V=j[_$];if(V.options.handleEvent!==!1){if(V.dispatchPointerEvent(J)&&J.target!==V)break;J.cancelBubble=!1;}}if(J.target===j[0])for(var _$2=j.length-1;_$2>=0;_$2--){var _V=j[_$2];if(_V.options.handleEvent!==!1){J.target=_V;break;}}}var st=J.target;if(J.type==="touchstart"&&(h[rt]=J.target),J.type==="mousemove"){var _$3=E[M];var _V2;if(st){var ct=st.ancestors||[];_V2=/* @__PURE__ */new Set([st].concat(_toConsumableArray(ct)));}else _V2=/* @__PURE__ */new Set();var nt=Object.entries(b);if(!_$3.has(st)&&st){var _ct2=new c["default"]("mouseenter");_ct2.setOriginalEvent(b),nt.forEach(function(_ref157){var _ref158=_slicedToArray(_ref157,2),et=_ref158[0],gt=_ref158[1];_ct2[et]=gt;}),_$3.add(st),st.dispatchEvent(_ct2);var pt=st.ancestors;pt&&pt.forEach(function(et){et instanceof l["default"]&&!_$3.has(et)&&(_$3.add(et),et.dispatchEvent(_ct2));});}var lt=new c["default"]("mouseleave");lt.setOriginalEvent(b),nt.forEach(function(_ref159){var _ref160=_slicedToArray(_ref159,2),ct=_ref160[0],pt=_ref160[1];lt[ct]=pt;}),_toConsumableArray(_$3).forEach(function(ct){_V2.has(ct)||(_$3["delete"](ct),ct.dispatchEvent(lt));});}});},{passive:A!=="contextmenu"});});}function d(E,w){if(w&&w.style){var B=E.width,A=E.height,b=E.mode,W=E.container;var D=W.clientWidth,R=W.clientHeight;B=B||D,A=A||R,b==="static"?(w.style.width="".concat(B,"px"),w.style.height="".concat(A,"px")):(w.style.top="0",w.style.left="0",w.style.width="".concat(D,"px"),w.style.height="".concat(R,"px"),w.style.transform="",w.style.webkitTransform="");}}var y=Symbol("offscreenLayerCount");var O=/*#__PURE__*/function(_f$default){/**
391
+ width
392
+ height
393
+ mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
394
+ */function O(){var _this57;var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this57=_callSuper(this,O),!w.container)if(typeof n.ENV.Container=="function")w.container=new n.ENV.Container(w.width||300,w.height||150);else throw new Error("No container specified.");if(_this57.container=w.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.options=w,w.displayRatio=w.displayRatio||1,w.mode=w.mode||"scale",w.left=0,w.top=0,w.autoResize=w.autoResize!==!1,w.autoResize){var B;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?B=globalThis:B=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:r,B.addEventListener){var A=_this57;B.addEventListener("resize",function b(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(A.container)?A.resize():B.removeEventListener("resize",b);});}}_this57[M]=/* @__PURE__ */new Set(),_this57.setResolution(w),p(_this57),_this57[y]=0;return _this57;}_inherits(O,_f$default);return _createClass(O,[{key:"hasOffscreenCanvas",get:function get(){return this[y]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(w){this.options.displayRatio!==w&&(this.options.displayRatio=w,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(w){this.options.height!==w&&(this.options.height=w,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(w){this.options.mode!==w&&(this.options.mode=w,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(w){this.options.width!==w&&(this.options.width=w,this.resize());}},{key:"appendChild",value:function appendChild(w){!(w instanceof o["default"])&&!(w instanceof a["default"])&&S(w);var B=_superPropGet(O,"appendChild",this,3)([w]),A=w.canvas;return w.offscreen?this[y]++:this.container.appendChild(A),d(this.options,A),w.setResolution(this.getResolution()),B;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this58=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(function(){delete _this58._requestID,_this58.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(w,B){!(w instanceof o["default"])&&!(w instanceof a["default"])&&S(w);var A=_superPropGet(O,"insertBefore",this,3)([w,B]),b=w.canvas;if(!w.offscreen){var W=P(this,w);this.container.insertBefore(b,W);}return d(this.options,b),w.setResolution(this.getResolution()),A;}},{key:"layer",value:function layer(){var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var B=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};B=Object.assign({},this.options,B),B.id=w;var A=this.orderedChildren;for(var D=0;D<A.length;D++)if(A[D].id===w)return A[D];var b=B.worker;var W;return b?W=new a["default"](B):W=new o["default"](B),this.appendChild(W),W;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(){var _this59=this;var _len13,w,_key13,B,A,b,_loop2,W,_args21=arguments;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:for(_len13=_args21.length,w=new Array(_len13),_key13=0;_key13<_len13;_key13++){w[_key13]=_args21[_key13];}B=[],A=[],b=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(W){var D,R,j,k;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:D=w[W];if(typeof D=="string")R=Object(m.loadTexture)(D);else if(Array.isArray(D))R=Object(m.loadFrames).apply(void 0,_toConsumableArray(D));else{j=D.id,k=D.src;R=Object(m.loadTexture)(k,j);}R instanceof Promise||(R=Promise.resolve(R)),A.push(R.then(function(j){B.push(j),b[W]=j;var k=new c["default"]({type:"preload",detail:{current:j,loaded:B,resources:w}});_this59.dispatchEvent(k);}));case 3:case"end":return _context20.stop();}},_loop2);});W=0;case 4:if(!(W<w.length)){_context21.next=9;break;}return _context21.delegateYield(_loop2(W),"t0",6);case 6:W++;_context21.next=4;break;case 9:_context21.next=11;return Promise.all(A);case 11:return _context21.abrupt("return",b);case 12:case"end":return _context21.stop();}},_callee20);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(w){var B=_superPropGet(O,"removeChild",this,3)([w]);if(B){w._prepareRenderFinished&&w._prepareRenderFinished();var A=w.canvas;A&&A.remove&&A.remove(),w.offscreen&&this[y]--;}return B;}// for offscreen mode rendering
395
+ },{key:"render",value:function render(){var w=this.orderedChildren;var B=null;var A=[];for(var b=0;b<w.length;b++){var W=w[b],D=A.length>0;if(W instanceof o["default"]&&!W.offscreen){if(!W.autoRender)D&&(console.warn("Some offscreen canvas will not be rendered."),A.length=0);else if(B=W,D){W.renderer.clear();for(var R=0;R<A.length;R++){var j=A[R];j.render(),T(W,j);}A.length=0,W.render({clear:!1});}else W.prepareRender&&W.render();}else W.offscreen?B?(W.prepareRender&&W.render(),T(B,W)):A.push(W):W instanceof a["default"]&&D&&(console.warn("Some offscreen canvas will not be rendered."),A.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(w,B){var A=_superPropGet(O,"replaceChild",this,3)([w,B]);B.canvas.remove&&B.canvas.remove(),B.offscreen&&this[y]--;var b=w.canvas;if(!w.offscreen){var W=P(this,w);this.container.insertBefore(b,W);}return d(this.options,b),w.setResolution(this.getResolution()),A;}},{key:"resize",value:function resize(){var w=this.options;this.children.forEach(function(B){d(w,B.canvas);}),this.setResolution(w),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _w4,_B10;var _ref161=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},w=_ref161.width,B=_ref161.height;var A=this.container,b=A.clientWidth,W=A.clientHeight;(w==null||B==null)&&(w=(_w4=w)!==null&&_w4!==void 0?_w4:b,B=(_B10=B)!==null&&_B10!==void 0?_B10:W);var _this$options=this.options,D=_this$options.mode,R=_this$options.displayRatio;if(w*=R,B*=R,this.options.left=0,this.options.top=0,D==="stickyHeight"||D==="stickyLeft"||D==="stickyRight"){var j=w;w=b*B/W,D==="stickyHeight"&&(this.options.left=0.5*(w-j)),D==="stickyRight"&&(this.options.left=w-j);}else if(D==="stickyWidth"||D==="stickyTop"||D==="stickyBottom"){var _j4=B;B=W*w/b,D==="stickyWidth"&&(this.options.top=0.5*(B-_j4)),D==="stickyBottom"&&(this.options.top=B-_j4);}_superPropGet(O,"setResolution",this,3)([{width:w,height:B}]);}},{key:"snapshot",value:function snapshot(){var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref162$offscreen=_ref162.offscreen,w=_ref162$offscreen===void 0?!1:_ref162$offscreen,B=_ref162.layers;var A=w?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),b=_this$getResolution9.width,W=_this$getResolution9.height;this[A]=this[A]||n.ENV.createCanvas(b,W,{offscreen:w});var D=this[A].getContext("2d");B=B||this.orderedChildren,this[A].width=b,this[A].height=W;for(var R=0;R<B.length;R++){var j=B[R];if(!j.options.ignoreSnapshot){j.render&&j.render();var k=j.canvas;k&&k!==j&&D.drawImage(k,0,0,b,W);}}return this[A];}}]);}(f["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(O.prototype.layer3d=function(E){var _this60=this;var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var B=w.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(A,b){var W=document.createElement("script");W.async=!1,W.src=B,W.onload=function(){try{A(_this60.layer3d(E,w));}catch(D){b(D);}},document.documentElement.appendChild(W);});}),x["default"].registerNode(O,"scene");}.call(this,t(22));},/* 291 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref163=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref163$offsetTop=_ref163.offsetTop,l=_ref163$offsetTop===void 0?0:_ref163$offsetTop,_ref163$offsetLeft=_ref163.offsetLeft,o=_ref163$offsetLeft===void 0?0:_ref163$offsetLeft,_ref163$displayRatio=_ref163.displayRatio,a=_ref163$displayRatio===void 0?1:_ref163$displayRatio;var f,g;var c=[],_i$target$getBounding=i.target.getBoundingClientRect(),m=_i$target$getBounding.left,x=_i$target$getBounding.top,M=_i$target$getBounding.width,S=_i$target$getBounding.height,P=i.target.width,T=i.target.height,h=i.changedTouches||[i];for(var d=0;d<h.length;d++){var y=h[d],O=y.identifier,E=y.clientX,w=y.clientY;E!=null&&w!=null&&c.push({x:Math.round((E|0)-m),y:Math.round((w|0)-x),identifier:O});}c.length<=0&&c.push({x:f,y:g});var p=[];return c.forEach(function(d){d.x!=null&&d.y!=null&&(f=(d.x*P/M-o)/a,g=(d.y*T/S-l)/a);var y=new r["default"](i);Object.defineProperties(y,{layerX:{value:f,configurable:!0},layerY:{value:g,configurable:!0},originalX:{value:d.x},originalY:{value:d.y},x:{value:f,configurable:!0},y:{value:g,configurable:!0},identifier:{value:d.identifier}}),p.push(y);}),p;}}/******/]);te.version;te.Arc;te.Block;te.Cloud;te.Color;var uo=te.Ellipse;te.Gradient;var de=te.Group,po=te.Label,mo=te.Layer;te.LayerWorker;te.Node;te.Parallel;var Ae=te.Path,Re=te.Polyline,Pn=te.Rect;te.Regular;te.Ring;var vo=te.Scene,hi=te.Sprite;te.SpriteSvg;te.Star;te.Triangle;te.helpers;te.createElement;te.isSpriteNode;te.registerNode;te.requestAnimationFrame;te.cancelAnimationFrame;te.ENV;var mr=(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 Ne(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u["default"]:u;}var yo=_typeof(mr)=="object"&&mr&&mr.Object===Object&&mr,ui=yo,go=ui,Po=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,xo=go||Po||Function("return this")(),Le=xo,So=Le,To=So.Symbol,fr=To,xn=fr,di=Object.prototype,Co=di.hasOwnProperty,Io=di.toString,nr=xn?xn.toStringTag:void 0;function Oo(u){var e=Co.call(u,nr),t=u[nr];try{u[nr]=void 0;var r=!0;}catch(_unused18){}var n=Io.call(u);return r&&(e?u[nr]=t:delete u[nr]),n;}var Mo=Oo,Eo=Object.prototype,Ao=Eo.toString;function Lo(u){return Ao.call(u);}var wo=Lo,Sn=fr,Ro=Mo,Do=wo,bo="[object Null]",No="[object Undefined]",Tn=Sn?Sn.toStringTag:void 0;function Bo(u){return u==null?u===void 0?No:bo:Tn&&Tn in Object(u)?Ro(u):Do(u);}var Je=Bo;function Wo(u){return u!=null&&_typeof(u)=="object";}var De=Wo,Fo=Je,Uo=De,jo="[object Number]";function Yo(u){return typeof u=="number"||Uo(u)&&Fo(u)==jo;}var Xo=Yo,he=/* @__PURE__ */Ne(Xo);function zo(){this.__data__=[],this.size=0;}var $o=zo;function Go(u,e){return u===e||u!==u&&e!==e;}var Jr=Go,Ho=Jr;function ko(u,e){for(var t=u.length;t--;)if(Ho(u[t][0],e))return t;return-1;}var Rr=ko,Vo=Rr,Ko=Array.prototype,Zo=Ko.splice;function Jo(u){var e=this.__data__,t=Vo(e,u);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Zo.call(e,t,1),--this.size,!0;}var Qo=Jo,qo=Rr;function _o(u){var e=this.__data__,t=qo(e,u);return t<0?void 0:e[t][1];}var ta=_o,ea=Rr;function ra(u){return ea(this.__data__,u)>-1;}var na=ra,ia=Rr;function sa(u,e){var t=this.__data__,r=ia(t,u);return r<0?(++this.size,t.push([u,e])):t[r][1]=e,this;}var oa=sa,aa=$o,la=Qo,ca=ta,fa=na,ha=oa;function Qe(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}Qe.prototype.clear=aa;Qe.prototype["delete"]=la;Qe.prototype.get=ca;Qe.prototype.has=fa;Qe.prototype.set=ha;var Dr=Qe,ua=Dr;function da(){this.__data__=new ua(),this.size=0;}var pa=da;function ma(u){var e=this.__data__,t=e["delete"](u);return this.size=e.size,t;}var va=ma;function ya(u){return this.__data__.get(u);}var ga=ya;function Pa(u){return this.__data__.has(u);}var xa=Pa;function Sa(u){var e=_typeof(u);return u!=null&&(e=="object"||e=="function");}var hr=Sa,Ta=Je,Ca=hr,Ia="[object AsyncFunction]",Oa="[object Function]",Ma="[object GeneratorFunction]",Ea="[object Proxy]";function Aa(u){if(!Ca(u))return!1;var e=Ta(u);return e==Oa||e==Ma||e==Ia||e==Ea;}var pi=Aa,La=Le,wa=La["__core-js_shared__"],Ra=wa,Ur=Ra,Cn=function(){var u=/[^.]+$/.exec(Ur&&Ur.keys&&Ur.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:"";}();function Da(u){return!!Cn&&Cn in u;}var ba=Da,Na=Function.prototype,Ba=Na.toString;function Wa(u){if(u!=null){try{return Ba.call(u);}catch(_unused19){}try{return u+"";}catch(_unused20){}}return"";}var mi=Wa,Fa=pi,Ua=ba,ja=hr,Ya=mi,Xa=/[\\^$.*+?()[\]{}|]/g,za=/^\[object .+?Constructor\]$/,$a=Function.prototype,Ga=Object.prototype,Ha=$a.toString,ka=Ga.hasOwnProperty,Va=RegExp("^"+Ha.call(ka).replace(Xa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ka(u){if(!ja(u)||Ua(u))return!1;var e=Fa(u)?Va:za;return e.test(Ya(u));}var Za=Ka;function Ja(u,e){return u==null?void 0:u[e];}var Qa=Ja,qa=Za,_a=Qa;function tl(u,e){var t=_a(u,e);return qa(t)?t:void 0;}var Ue=tl,el=Ue,rl=Le,nl=el(rl,"Map"),Qr=nl,il=Ue,sl=il(Object,"create"),br=sl,In=br;function ol(){this.__data__=In?In(null):{},this.size=0;}var al=ol;function ll(u){var e=this.has(u)&&delete this.__data__[u];return this.size-=e?1:0,e;}var cl=ll,fl=br,hl="__lodash_hash_undefined__",ul=Object.prototype,dl=ul.hasOwnProperty;function pl(u){var e=this.__data__;if(fl){var t=e[u];return t===hl?void 0:t;}return dl.call(e,u)?e[u]:void 0;}var ml=pl,vl=br,yl=Object.prototype,gl=yl.hasOwnProperty;function Pl(u){var e=this.__data__;return vl?e[u]!==void 0:gl.call(e,u);}var xl=Pl,Sl=br,Tl="__lodash_hash_undefined__";function Cl(u,e){var t=this.__data__;return this.size+=this.has(u)?0:1,t[u]=Sl&&e===void 0?Tl:e,this;}var Il=Cl,Ol=al,Ml=cl,El=ml,Al=xl,Ll=Il;function qe(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}qe.prototype.clear=Ol;qe.prototype["delete"]=Ml;qe.prototype.get=El;qe.prototype.has=Al;qe.prototype.set=Ll;var wl=qe,On=wl,Rl=Dr,Dl=Qr;function bl(){this.size=0,this.__data__={hash:new On(),map:new(Dl||Rl)(),string:new On()};}var Nl=bl;function Bl(u){var e=_typeof(u);return e=="string"||e=="number"||e=="symbol"||e=="boolean"?u!=="__proto__":u===null;}var Wl=Bl,Fl=Wl;function Ul(u,e){var t=u.__data__;return Fl(e)?t[typeof e=="string"?"string":"hash"]:t.map;}var Nr=Ul,jl=Nr;function Yl(u){var e=jl(this,u)["delete"](u);return this.size-=e?1:0,e;}var Xl=Yl,zl=Nr;function $l(u){return zl(this,u).get(u);}var Gl=$l,Hl=Nr;function kl(u){return Hl(this,u).has(u);}var Vl=kl,Kl=Nr;function Zl(u,e){var t=Kl(this,u),r=t.size;return t.set(u,e),this.size+=t.size==r?0:1,this;}var Jl=Zl,Ql=Nl,ql=Xl,_l=Gl,tc=Vl,ec=Jl;function _e(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}_e.prototype.clear=Ql;_e.prototype["delete"]=ql;_e.prototype.get=_l;_e.prototype.has=tc;_e.prototype.set=ec;var vi=_e,rc=Dr,nc=Qr,ic=vi,sc=200;function oc(u,e){var t=this.__data__;if(t instanceof rc){var r=t.__data__;if(!nc||r.length<sc-1)return r.push([u,e]),this.size=++t.size,this;t=this.__data__=new ic(r);}return t.set(u,e),this.size=t.size,this;}var ac=oc,lc=Dr,cc=pa,fc=va,hc=ga,uc=xa,dc=ac;function tr(u){var e=this.__data__=new lc(u);this.size=e.size;}tr.prototype.clear=cc;tr.prototype["delete"]=fc;tr.prototype.get=hc;tr.prototype.has=uc;tr.prototype.set=dc;var yi=tr;function pc(u,e){for(var t=-1,r=u==null?0:u.length;++t<r&&e(u[t],t,u)!==!1;);return u;}var mc=pc,vc=Ue,yc=function(){try{var u=vc(Object,"defineProperty");return u({},"",{}),u;}catch(_unused21){}}(),gi=yc,Mn=gi;function gc(u,e,t){e=="__proto__"&&Mn?Mn(u,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):u[e]=t;}var Pi=gc,Pc=Pi,xc=Jr,Sc=Object.prototype,Tc=Sc.hasOwnProperty;function Cc(u,e,t){var r=u[e];(!(Tc.call(u,e)&&xc(r,t))||t===void 0&&!(e in u))&&Pc(u,e,t);}var xi=Cc,Ic=xi,Oc=Pi;function Mc(u,e,t,r){var n=!t;t||(t={});for(var i=-1,l=e.length;++i<l;){var o=e[i],a=r?r(t[o],u[o],o,t,u):void 0;a===void 0&&(a=u[o]),n?Oc(t,o,a):Ic(t,o,a);}return t;}var Br=Mc;function Ec(u,e){for(var t=-1,r=Array(u);++t<u;)r[t]=e(t);return r;}var Ac=Ec,Lc=Je,wc=De,Rc="[object Arguments]";function Dc(u){return wc(u)&&Lc(u)==Rc;}var bc=Dc,En=bc,Nc=De,Si=Object.prototype,Bc=Si.hasOwnProperty,Wc=Si.propertyIsEnumerable,Fc=En(/* @__PURE__ */function(){return arguments;}())?En:function(u){return Nc(u)&&Bc.call(u,"callee")&&!Wc.call(u,"callee");},Ti=Fc,Uc=Array.isArray,ur=Uc,gr={exports:{}};function jc(){return!1;}var Yc=jc;gr.exports;(function(u,e){var t=Le,r=Yc,n=e&&!e.nodeType&&e,i=n&&!0&&u&&!u.nodeType&&u,l=i&&i.exports===n,o=l?t.Buffer:void 0,a=o?o.isBuffer:void 0,f=a||r;u.exports=f;})(gr,gr.exports);var qr=gr.exports,Xc=9007199254740991,zc=/^(?:0|[1-9]\d*)$/;function $c(u,e){var _e2;var t=_typeof(u);return e=(_e2=e)!==null&&_e2!==void 0?_e2:Xc,!!e&&(t=="number"||t!="symbol"&&zc.test(u))&&u>-1&&u%1==0&&u<e;}var Gc=$c,Hc=9007199254740991;function kc(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=Hc;}var Ci=kc,Vc=Je,Kc=Ci,Zc=De,Jc="[object Arguments]",Qc="[object Array]",qc="[object Boolean]",_c="[object Date]",tf="[object Error]",ef="[object Function]",rf="[object Map]",nf="[object Number]",sf="[object Object]",of="[object RegExp]",af="[object Set]",lf="[object String]",cf="[object WeakMap]",ff="[object ArrayBuffer]",hf="[object DataView]",uf="[object Float32Array]",df="[object Float64Array]",pf="[object Int8Array]",mf="[object Int16Array]",vf="[object Int32Array]",yf="[object Uint8Array]",gf="[object Uint8ClampedArray]",Pf="[object Uint16Array]",xf="[object Uint32Array]",ne={};ne[uf]=ne[df]=ne[pf]=ne[mf]=ne[vf]=ne[yf]=ne[gf]=ne[Pf]=ne[xf]=!0;ne[Jc]=ne[Qc]=ne[ff]=ne[qc]=ne[hf]=ne[_c]=ne[tf]=ne[ef]=ne[rf]=ne[nf]=ne[sf]=ne[of]=ne[af]=ne[lf]=ne[cf]=!1;function Sf(u){return Zc(u)&&Kc(u.length)&&!!ne[Vc(u)];}var Tf=Sf;function Cf(u){return function(e){return u(e);};}var Wr=Cf,Pr={exports:{}};Pr.exports;(function(u,e){var t=ui,r=e&&!e.nodeType&&e,n=r&&!0&&u&&!u.nodeType&&u,i=n&&n.exports===r,l=i&&t.process,o=function(){try{var a=n&&n.require&&n.require("util").types;return a||l&&l.binding&&l.binding("util");}catch(_unused22){}}();u.exports=o;})(Pr,Pr.exports);var _r=Pr.exports,If=Tf,Of=Wr,An=_r,Ln=An&&An.isTypedArray,Mf=Ln?Of(Ln):If,Ii=Mf,Ef=Ac,Af=Ti,Lf=ur,wf=qr,Rf=Gc,Df=Ii,bf=Object.prototype,Nf=bf.hasOwnProperty;function Bf(u,e){var t=Lf(u),r=!t&&Af(u),n=!t&&!r&&wf(u),i=!t&&!r&&!n&&Df(u),l=t||r||n||i,o=l?Ef(u.length,String):[],a=o.length;for(var f in u)(e||Nf.call(u,f))&&!(l&&(// Safari 9 has enumerable `arguments.length` in strict mode.
396
+ f=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
397
+ n&&(f=="offset"||f=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
398
+ i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||// Skip index properties.
399
+ Rf(f,a)))&&o.push(f);return o;}var Oi=Bf,Wf=Object.prototype;function Ff(u){var e=u&&u.constructor,t=typeof e=="function"&&e.prototype||Wf;return u===t;}var tn=Ff;function Uf(u,e){return function(t){return u(e(t));};}var Mi=Uf,jf=Mi,Yf=jf(Object.keys,Object),Xf=Yf,zf=tn,$f=Xf,Gf=Object.prototype,Hf=Gf.hasOwnProperty;function kf(u){if(!zf(u))return $f(u);var e=[];for(var t in Object(u))Hf.call(u,t)&&t!="constructor"&&e.push(t);return e;}var Vf=kf,Kf=pi,Zf=Ci;function Jf(u){return u!=null&&Zf(u.length)&&!Kf(u);}var en=Jf,Qf=Oi,qf=Vf,_f=en;function th(u){return _f(u)?Qf(u):qf(u);}var rn=th,eh=Br,rh=rn;function nh(u,e){return u&&eh(e,rh(e),u);}var ih=nh;function sh(u){var e=[];if(u!=null)for(var t in Object(u))e.push(t);return e;}var oh=sh,ah=hr,lh=tn,ch=oh,fh=Object.prototype,hh=fh.hasOwnProperty;function uh(u){if(!ah(u))return ch(u);var e=lh(u),t=[];for(var r in u)r=="constructor"&&(e||!hh.call(u,r))||t.push(r);return t;}var dh=uh,ph=Oi,mh=dh,vh=en;function yh(u){return vh(u)?ph(u,!0):mh(u);}var nn=yh,gh=Br,Ph=nn;function xh(u,e){return u&&gh(e,Ph(e),u);}var Sh=xh,xr={exports:{}};xr.exports;(function(u,e){var t=Le,r=e&&!e.nodeType&&e,n=r&&!0&&u&&!u.nodeType&&u,i=n&&n.exports===r,l=i?t.Buffer:void 0,o=l?l.allocUnsafe:void 0;function a(f,g){if(g)return f.slice();var c=f.length,m=o?o(c):new f.constructor(c);return f.copy(m),m;}u.exports=a;})(xr,xr.exports);var Th=xr.exports;function Ch(u,e){var t=-1,r=u.length;for(e||(e=Array(r));++t<r;)e[t]=u[t];return e;}var Ih=Ch;function Oh(u,e){for(var t=-1,r=u==null?0:u.length,n=0,i=[];++t<r;){var l=u[t];e(l,t,u)&&(i[n++]=l);}return i;}var Ei=Oh;function Mh(){return[];}var Ai=Mh,Eh=Ei,Ah=Ai,Lh=Object.prototype,wh=Lh.propertyIsEnumerable,wn=Object.getOwnPropertySymbols,Rh=wn?function(u){return u==null?[]:(u=Object(u),Eh(wn(u),function(e){return wh.call(u,e);}));}:Ah,sn=Rh,Dh=Br,bh=sn;function Nh(u,e){return Dh(u,bh(u),e);}var Bh=Nh;function Wh(u,e){for(var t=-1,r=e.length,n=u.length;++t<r;)u[n+t]=e[t];return u;}var on=Wh,Fh=Mi,Uh=Fh(Object.getPrototypeOf,Object),Li=Uh,jh=on,Yh=Li,Xh=sn,zh=Ai,$h=Object.getOwnPropertySymbols,Gh=$h?function(u){for(var e=[];u;)jh(e,Xh(u)),u=Yh(u);return e;}:zh,wi=Gh,Hh=Br,kh=wi;function Vh(u,e){return Hh(u,kh(u),e);}var Kh=Vh,Zh=on,Jh=ur;function Qh(u,e,t){var r=e(u);return Jh(u)?r:Zh(r,t(u));}var Ri=Qh,qh=Ri,_h=sn,tu=rn;function eu(u){return qh(u,tu,_h);}var Di=eu,ru=Ri,nu=wi,iu=nn;function su(u){return ru(u,iu,nu);}var ou=su,au=Ue,lu=Le,cu=au(lu,"DataView"),fu=cu,hu=Ue,uu=Le,du=hu(uu,"Promise"),pu=du,mu=Ue,vu=Le,yu=mu(vu,"Set"),bi=yu,gu=Ue,Pu=Le,xu=gu(Pu,"WeakMap"),Su=xu,zr=fu,$r=Qr,Gr=pu,Hr=bi,kr=Su,Ni=Je,er=mi,Rn="[object Map]",Tu="[object Object]",Dn="[object Promise]",bn="[object Set]",Nn="[object WeakMap]",Bn="[object DataView]",Cu=er(zr),Iu=er($r),Ou=er(Gr),Mu=er(Hr),Eu=er(kr),Fe=Ni;(zr&&Fe(new zr(new ArrayBuffer(1)))!=Bn||$r&&Fe(new $r())!=Rn||Gr&&Fe(Gr.resolve())!=Dn||Hr&&Fe(new Hr())!=bn||kr&&Fe(new kr())!=Nn)&&(Fe=function Fe(u){var e=Ni(u),t=e==Tu?u.constructor:void 0,r=t?er(t):"";if(r)switch(r){case Cu:return Bn;case Iu:return Rn;case Ou:return Dn;case Mu:return bn;case Eu:return Nn;}return e;});var Fr=Fe,Au=Object.prototype,Lu=Au.hasOwnProperty;function wu(u){var e=u.length,t=new u.constructor(e);return e&&typeof u[0]=="string"&&Lu.call(u,"index")&&(t.index=u.index,t.input=u.input),t;}var Ru=wu,Du=Le,bu=Du.Uint8Array,Bi=bu,Wn=Bi;function Nu(u){var e=new u.constructor(u.byteLength);return new Wn(e).set(new Wn(u)),e;}var an=Nu,Bu=an;function Wu(u,e){var t=e?Bu(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.byteLength);}var Fu=Wu,Uu=/\w*$/;function ju(u){var e=new u.constructor(u.source,Uu.exec(u));return e.lastIndex=u.lastIndex,e;}var Yu=ju,Fn=fr,Un=Fn?Fn.prototype:void 0,jn=Un?Un.valueOf:void 0;function Xu(u){return jn?Object(jn.call(u)):{};}var zu=Xu,$u=an;function Gu(u,e){var t=e?$u(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.length);}var Hu=Gu,ku=an,Vu=Fu,Ku=Yu,Zu=zu,Ju=Hu,Qu="[object Boolean]",qu="[object Date]",_u="[object Map]",td="[object Number]",ed="[object RegExp]",rd="[object Set]",nd="[object String]",id="[object Symbol]",sd="[object ArrayBuffer]",od="[object DataView]",ad="[object Float32Array]",ld="[object Float64Array]",cd="[object Int8Array]",fd="[object Int16Array]",hd="[object Int32Array]",ud="[object Uint8Array]",dd="[object Uint8ClampedArray]",pd="[object Uint16Array]",md="[object Uint32Array]";function vd(u,e,t){var r=u.constructor;switch(e){case sd:return ku(u);case Qu:case qu:return new r(+u);case od:return Vu(u,t);case ad:case ld:case cd:case fd:case hd:case ud:case dd:case pd:case md:return Ju(u,t);case _u:return new r();case td:case nd:return new r(u);case ed:return Ku(u);case rd:return new r();case id:return Zu(u);}}var yd=vd,gd=hr,Yn=Object.create,Pd=/* @__PURE__ */function(){function u(){}return function(e){if(!gd(e))return{};if(Yn)return Yn(e);u.prototype=e;var t=new u();return u.prototype=void 0,t;};}(),xd=Pd,Sd=xd,Td=Li,Cd=tn;function Id(u){return typeof u.constructor=="function"&&!Cd(u)?Sd(Td(u)):{};}var Od=Id,Md=Fr,Ed=De,Ad="[object Map]";function Ld(u){return Ed(u)&&Md(u)==Ad;}var wd=Ld,Rd=wd,Dd=Wr,Xn=_r,zn=Xn&&Xn.isMap,bd=zn?Dd(zn):Rd,Nd=bd,Bd=Fr,Wd=De,Fd="[object Set]";function Ud(u){return Wd(u)&&Bd(u)==Fd;}var jd=Ud,Yd=jd,Xd=Wr,$n=_r,Gn=$n&&$n.isSet,zd=Gn?Xd(Gn):Yd,Wi=zd,$d=/* @__PURE__ */Ne(Wi),Gd=yi,Hd=mc,kd=xi,Vd=ih,Kd=Sh,Zd=Th,Jd=Ih,Qd=Bh,qd=Kh,_d=Di,tp=ou,ep=Fr,rp=Ru,np=yd,ip=Od,sp=ur,op=qr,ap=Nd,lp=hr,cp=Wi,fp=rn,hp=nn,up=1,dp=2,pp=4,Fi="[object Arguments]",mp="[object Array]",vp="[object Boolean]",yp="[object Date]",gp="[object Error]",Ui="[object Function]",Pp="[object GeneratorFunction]",xp="[object Map]",Sp="[object Number]",ji="[object Object]",Tp="[object RegExp]",Cp="[object Set]",Ip="[object String]",Op="[object Symbol]",Mp="[object WeakMap]",Ep="[object ArrayBuffer]",Ap="[object DataView]",Lp="[object Float32Array]",wp="[object Float64Array]",Rp="[object Int8Array]",Dp="[object Int16Array]",bp="[object Int32Array]",Np="[object Uint8Array]",Bp="[object Uint8ClampedArray]",Wp="[object Uint16Array]",Fp="[object Uint32Array]",re={};re[Fi]=re[mp]=re[Ep]=re[Ap]=re[vp]=re[yp]=re[Lp]=re[wp]=re[Rp]=re[Dp]=re[bp]=re[xp]=re[Sp]=re[ji]=re[Tp]=re[Cp]=re[Ip]=re[Op]=re[Np]=re[Bp]=re[Wp]=re[Fp]=!0;re[gp]=re[Ui]=re[Mp]=!1;function yr(u,e,t,r,n,i){var l,o=e&up,a=e&dp,f=e&pp;if(t&&(l=n?t(u,r,n,i):t(u)),l!==void 0)return l;if(!lp(u))return u;var g=sp(u);if(g){if(l=rp(u),!o)return Jd(u,l);}else{var c=ep(u),m=c==Ui||c==Pp;if(op(u))return Zd(u,o);if(c==ji||c==Fi||m&&!n){if(l=a||m?{}:ip(u),!o)return a?qd(u,Kd(l,u)):Qd(u,Vd(l,u));}else{if(!re[c])return n?u:{};l=np(u,c,o);}}i||(i=new Gd());var x=i.get(u);if(x)return x;i.set(u,l),cp(u)?u.forEach(function(P){l.add(yr(P,e,t,P,u,i));}):ap(u)&&u.forEach(function(P,T){l.set(T,yr(P,e,t,T,u,i));});var M=f?a?tp:_d:a?hp:fp,S=g?void 0:M(u);return Hd(S||u,function(P,T){S&&(T=P,P=u[T]),kd(l,T,yr(P,e,t,T,u,i));}),l;}var Up=yr,jp=Up,Yp=1,Xp=4;function zp(u){return jp(u,Yp|Xp);}var $p=zp,ue=/* @__PURE__ */Ne($p);var Yi="1.1.17",Gp="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var u=window.__netlessUA||"";u+=" ".concat(Gp,"@").concat(Yi),window.__netlessUA=u;}var Se={syncOpt:{interval:500},cdn:{subWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/subWorker.js",fullWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/fullWorker.js"},cursor:{expirationTime:5e3},bufferSize:{full:2e4,sub:600},bezier:{maxDrawCount:1/0,combineUnitTime:500},pencilEraser:{useBitMap:!0,maxImageWidth:1920,maxImageHeight:1920},strokeWidth:{min:1,max:10},textEditor:{showFloatBar:!0,canSelectorSwitch:!0,rightBoundBreak:!1}};function Ee(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=u.length;if(t<2)return"";var r=u[0],n=u[1];if(t===2)return"M".concat(ze(r),"L").concat(ze(n));var i="";for(var l=2,o=t-1;l<o;l++)r=u[l],n=u[l+1],i+=$e(r,n);return e?"M".concat($e(u[0],u[1]),"Q").concat(ze(u[1])).concat($e(u[1],u[2]),"T").concat(i).concat($e(u[t-1],u[0])).concat($e(u[0],u[1]),"Z"):"M".concat(ze(u[0]),"Q").concat(ze(u[1])).concat($e(u[1],u[2])).concat(u.length>3?"T":"").concat(i,"L").concat(ze(u[t-1]));}var Pe=/*#__PURE__*/function(){function Pe(e){_classCallCheck(this,Pe);at(this,"maxImageWidth",Se.pencilEraser.maxImageWidth);at(this,"maxImageHeight",Se.pencilEraser.maxImageHeight);at(this,"syncUnitTime",Se.syncOpt.interval);at(this,"vNodes");at(this,"drawLayer");at(this,"fullLayer");at(this,"workId");at(this,"isDelete",!1);var t=e.vNodes,r=e.fullLayer,n=e.drawLayer,i=e.workId,l=e.toolsOpt;this.vNodes=t,this.fullLayer=r,this.drawLayer=n,this.workId=i,this.syncUnitTime=l.syncUnitTime||this.syncUnitTime;}return _createClass(Pe,[{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 i=r[r.length-1];return(n&&!i||n&&i&&!n.isNear(i,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,i,l;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),r=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&r&&(r.opt=e,(l=this.vNodes)==null||l.setInfo(t,r));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(e){var n,i;var t;var r=(n=this.workId)==null?void 0:n.toString();if(r&&e){var l=this.fullLayer.getElementsByName(r)||this.drawLayer&&this.drawLayer.getElementsByName(r)||[];if(l.length!==1)return;var o=l[0],a=e.pos,f=e.zIndex,g=e.scale,c=e.angle,m=e.translate,x={};he(f)&&(x.zIndex=f),a&&(x.pos=[a[0],a[1]]),g&&(x.scale=g),c&&(x.rotate=c),m&&(x.translate=m),o.attr(x);var M=o==null?void 0:o.getBoundingClientRect();return M&&(t=Wt(t,{x:Math.floor(M.x-Pe.SafeBorderPadding),y:Math.floor(M.y-Pe.SafeBorderPadding),w:Math.floor(M.width+Pe.SafeBorderPadding*2),h:Math.floor(M.height+Pe.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(r,{rect:t,centerPos:a}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(e,t){var r=e.group,n=e.eraserlines,i=e.pos,l=e.layer,o=l.parent;if(t)try{var f=(l.renderer.glRenderer||l.renderer.canvasRenderer).options.displayRatio,g=r.getBoundingClientRect(),c=g.width*f*l.worldScaling[0],m=g.height*f*l.worldScaling[1];var x=1;(c>this.maxImageWidth||m>this.maxImageHeight)&&(x=Math.min(this.maxImageWidth/c,this.maxImageHeight/m));var M=l.getAttribute("scale");M=[M[0]*x,M[1]*x];var S=l.parent.parent,P=l.getAttribute("translate"),_T28=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),S,{offscreen:o.offscreen,width:o.width,height:o.height,contextType:"2d",autoRender:!1,bufferSize:500},M,P),_h26=r.cloneNode(!0);this.addEraserlines(_h26,n,i,!1),_T28.appendChild(_h26);var p=_T28.parent;p.render();var d=_T28.renderer.canvasRenderer,y=d.context;if(!y)return;var O=d.options.displayRatio,E=_h26.getBoundingClientRect(),w={x:E.x,y:E.y,w:E.width,h:E.height},B={x:0,y:0,w:S.width,h:S.height};if(sr(w,B)===ye.outside){xe(_h26,p),S.removeChild(p),this.isDelete=!0;return;}var b=ue(w);b.x=Math.floor(Math.max(w.x,0)),b.y=Math.floor(Math.max(w.y,0)),b.w=Math.min(w.x+w.w,S.width)-b.x,b.h=Math.min(w.y+w.h,S.height)-b.y;var W=this.getGroupRect(b,O),D=W.x,R=W.y,j=W.w,k=W.h;var J=y.getImageData(D,R,j,k);if(this.isTransparentRectByCanvas(J)){xe(_h26,p),S.removeChild(p),this.isDelete=!0,J=null;return;}xe(r,o);var st=this.createSpriteNode({imageData:J,safariRect:b,originRect:w,worldScaling:_T28.worldScaling});st&&r.append(st),xe(_h26,p),S.removeChild(p),o.deleteTexture(J),J=null;}catch(a){console.error(a);return;}}},{key:"createVmRenderNode",value:function createVmRenderNode(e,t,r,n,i){var l=r.width,o=r.height,a="bitMap-".concat(e),f=t.layer(a,r),g=new de({anchor:[0.5,0.5],pos:[l*0.5,o*0.5],size:[l,o],name:"viewport",id:e});return g.setAttribute("scale",n),g.setAttribute("translate",i),f.append(g),g;}},{key:"getGroupRect",value:function getGroupRect(e,t){var r=Math.floor(e.x*t),n=Math.floor(e.y*t),i=Math.floor(e.w*t),l=Math.floor(e.h*t);return{x:r,y:n,w:i,h:l};}},{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 i=_step13.value;var l=i.thickness,o=i.op;var _iterator14=_createForOfIteratorHelper(o),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var a=_step14.value;var f=a.map(function(M,S){return S%2?M-r[1]:M-r[0];}),g=this.computEraserPoints(f,l),c=Ee(g,!0),m={pos:[0,0],d:c,fillColor:"rgba(0,0,0,1)"},x=new Ae(m);x.addEventListener("beforerender",function(_ref164){var M=_ref164.detail;var S=M.context;n?S.blendFuncSeparate(S.ZERO,S.ZERO,S.ZERO,S.ZERO):S.globalCompositeOperation="destination-out";}),x.addEventListener("afterrender",function(_ref165){var M=_ref165.detail;var S=M.context;n?S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA):S.globalCompositeOperation="source-over";}),e.append(x);}}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,i=e.originRect;var l;if(typeof OffscreenCanvas=="function"){l=new OffscreenCanvas(t.width,t.height);var g=l.getContext("2d");g&&g.putImageData(t,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){l=document.createElement("canvas"),l.width=t.width,l.height=t.height;var _g3=l.getContext("2d");_g3&&_g3.putImageData(t,0,0);}if(!l)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var o=[Math.floor(i.w/r[0]),Math.floor(i.h/r[1])],a=[Math.floor((n.x-i.x)/r[0]),Math.floor((n.y-i.y)/r[1]),Math.floor(n.w/r[0]),Math.floor(n.h/r[1])],f={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:o,texture:l,textureRect:a};return new hi(f);}},{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 Dt(e[0],e[1]);return Dt.GetDotStroke(r,t,8);}},{key:"computLine",value:function computLine(e,t){var r=[],n=[];var i,l;for(var o=0;o<e.length;o+=2){var a=new Dt(e[o],e[o+1]);var f=void 0;if(o==e.length-2){var g=new Dt(e[o-2],e[o-1]);f=ot.Sub(a,g).uni(),i=a;}else{o===0&&(l=a);var _g4=new Dt(e[o+2],e[o+3]);f=ot.Sub(_g4,a).uni();}if(f){var _g5=ot.Per(f).mul(t);r.push(Dt.Sub(a,_g5)),n.push(Dt.Add(a,_g5));}}if(i&&l){var _o3=Dt.GetSemicircleStroke(i,r[r.length-1],-1,8),_a4=Dt.GetSemicircleStroke(l,n[0],-1,8);return r.concat(_o3,n.reverse(),_a4);}return[];}},{key:"replace",value:function replace(e,t,r){var _this61=this;var i;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 l=_step15.value;r?gm(r,l,e):(l.remove(),_me(l,e.parent));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}else r&&e.append(r);this.fullLayer!==this.drawLayer&&(this.fullLayer===e?(i=this.drawLayer)==null||i.getElementsByName(t).forEach(function(o){var a;o.remove(),_me(o,(a=_this61.drawLayer)==null?void 0:a.parent);}):this.fullLayer.getElementsByName(t).forEach(function(o){o.remove(),_me(o,_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(),_me(n,e.parent);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(e){var h;var t=e.node,r=e.opt,n=e.vNodes,i=e.willSerializeData,l=e.targetNode,o=r.zIndex,a=r.translate,f=r.angle,g=r.originPoint,c=r.scenePoint,m=r.scale,x=r.pointMap,M=r.thickness;var S;var P=l&&ue(l)||n.get(t.name);if(!P)return;he(o)&&(t.setAttribute("zIndex",o),P.opt.zIndex=o);var T=t.parent;if(T){if(g&&m&&l){var p=[P.op[0],P.op[1]];mn(P.op,c,m,a);var d=[P.op[0],P.op[1]],y=[d[0]-p[0],d[1]-p[1]];if(P.centerPos=[P.centerPos[0]+y[0],P.centerPos[1]+y[1]],P.opt.translate=void 0,P.opt.scale=void 0,P.opt.eraserlines)for(var _i3=0,_Object$values=Object.values(P.opt.eraserlines);_i3<_Object$values.length;_i3++){var O=_Object$values[_i3];var E=O.op,w=O.thickness;O.thickness=w*Math.max(m[0],m[1]);for(var B=0;B<E.length;B++)vn(E[B],c,m,a);}}else if(a){if(t.setAttribute("translate",a),P.opt.translate=a,l){var _p6=[a[0]*T.worldScaling[0],a[1]*T.worldScaling[1]];S=cr(P.rect,_p6),P.rect=S;}else{var _p7=Pe.getRectFromLayer(T,t.name);P.rect=_p7||P.rect;}}else if(he(f))if(t.setAttribute("rotate",f),P.opt.rotate=f,l)S=ns(P.rect,f),P.rect=S;else{var _p8=Pe.getRectFromLayer(T,t.name);P.rect=_p8||P.rect;}if(x){var _p9=x.get(t.name);if(_p9)for(var _d11=0,_y9=0;_d11<P.op.length;_d11+=3,_y9++)P.op[_d11]=_p9[_y9][0],P.op[_d11+1]=_p9[_y9][1];}if(M&&(h=P==null?void 0:P.opt)!=null&&h.thickness&&(P.opt.thickness=M),i&&!(g&&m&&l)){if(a){var _p10=P.op.map(function(d,y){var O=y%3;return O===0?d+a[0]:O===1?d+a[1]:d;});if(P.op=_p10,P.centerPos=[P.centerPos[0]+a[0],P.centerPos[1]+a[1]],P!=null&&P.opt&&(P.opt.translate=void 0),P.opt.eraserlines)for(var _i4=0,_Object$values2=Object.values(P.opt.eraserlines);_i4<_Object$values2.length;_i4++){var _d12=_Object$values2[_i4];var _y10=_d12.op;for(var _O6=0;_O6<_y10.length;_O6++){var _E3=_y10[_O6].map(function(w,B){return B%2?w+a[1]:w+a[0];});_d12.op[_O6]=_E3;}}}else if(he(f)){var _p11=P.op;if(fm(_p11,P.centerPos,f),P.op=_p11,P!=null&&P.opt&&(P.opt.rotate=void 0),P.opt.eraserlines)for(var _i5=0,_Object$values3=Object.values(P.opt.eraserlines);_i5<_Object$values3.length;_i5++){var _d13=_Object$values3[_i5];var _y11=_d13.op;for(var _O7=0;_O7<_y11.length;_O7++)hm(_y11[_O7],P.centerPos,f);}}}P&&n.setInfo(t.name,P);}}},{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-Pe.SafeBorderPadding),y:Math.floor(n.y-Pe.SafeBorderPadding),w:Math.floor(n.width+Pe.SafeBorderPadding*2),h:Math.floor(n.height+Pe.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(e){var t=e.toolsType,r=e.opt,n=e.node,i=e.updateOpt,l=e.willSerializeData;return!!(l&&(i.angle||i.translate)||i.thickness&&r.thickness&&r.thickness!==i.thickness||i.strokeType&&r.strokeType&&r.strokeType!==i.strokeType||i.originPoint&&i.scenePoint&&i.scale||i.pointMap&&i.pointMap.has(n.name)||t===St.Text&&(i.fontSize||i.translate||i.textInfos&&i.textInfos.get(n.name))||t===St.Image&&(i.angle||i.translate||i.scale||i.strokeColor&&i.type===Zr.Iconify)||t===i.toolsType&&i.willRefresh||r.eraserlines&&r.eraserlines.length&&(i.strokeColor||i.fillColor));}}]);}();at(Pe,"SafeBorderPadding",10);var Mt=Pe;var ln=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 cn={exports:{}};cn.exports;(function(u){var e=function(){var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function l(a,f){if(!i[a]){i[a]={};for(var g=0;g<a.length;g++)i[a][a.charAt(g)]=g;}return i[a][f];}var o={compressToBase64:function compressToBase64(a){if(a==null)return"";var f=o._compress(a,6,function(g){return r.charAt(g);});switch(f.length%4){default:case 0:return f;case 1:return f+"===";case 2:return f+"==";case 3:return f+"=";}},decompressFromBase64:function decompressFromBase64(a){return a==null?"":a==""?null:o._decompress(a.length,32,function(f){return l(r,a.charAt(f));});},compressToUTF16:function compressToUTF16(a){return a==null?"":o._compress(a,15,function(f){return t(f+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(a){return a==null?"":a==""?null:o._decompress(a.length,16384,function(f){return a.charCodeAt(f)-32;});},//compress into uint8array (UCS-2 big endian format)
400
+ compressToUint8Array:function compressToUint8Array(a){for(var f=o.compress(a),g=new Uint8Array(f.length*2),c=0,m=f.length;c<m;c++){var x=f.charCodeAt(c);g[c*2]=x>>>8,g[c*2+1]=x%256;}return g;},//decompress from uint8array (UCS-2 big endian format)
401
+ decompressFromUint8Array:function decompressFromUint8Array(a){if(a==null)return o.decompress(a);for(var f=new Array(a.length/2),g=0,c=f.length;g<c;g++)f[g]=a[g*2]*256+a[g*2+1];var m=[];return f.forEach(function(x){m.push(t(x));}),o.decompress(m.join(""));},//compress into a string that is already URI encoded
402
+ compressToEncodedURIComponent:function compressToEncodedURIComponent(a){return a==null?"":o._compress(a,6,function(f){return n.charAt(f);});},//decompress from an output of compressToEncodedURIComponent
403
+ decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(a){return a==null?"":a==""?null:(a=a.replace(/ /g,"+"),o._decompress(a.length,32,function(f){return l(n,a.charAt(f));}));},compress:function compress(a){return o._compress(a,16,function(f){return t(f);});},_compress:function _compress(a,f,g){if(a==null)return"";var c,m,x={},M={},S="",P="",T="",h=2,p=3,d=2,y=[],O=0,E=0,w;for(w=0;w<a.length;w+=1)if(S=a.charAt(w),Object.prototype.hasOwnProperty.call(x,S)||(x[S]=p++,M[S]=!0),P=T+S,Object.prototype.hasOwnProperty.call(x,P))T=P;else{if(Object.prototype.hasOwnProperty.call(M,T)){if(T.charCodeAt(0)<256){for(c=0;c<d;c++)O=O<<1,E==f-1?(E=0,y.push(g(O)),O=0):E++;for(m=T.charCodeAt(0),c=0;c<8;c++)O=O<<1|m&1,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=m>>1;}else{for(m=1,c=0;c<d;c++)O=O<<1|m,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=0;for(m=T.charCodeAt(0),c=0;c<16;c++)O=O<<1|m&1,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=m>>1;}h--,h==0&&(h=Math.pow(2,d),d++),delete M[T];}else for(m=x[T],c=0;c<d;c++)O=O<<1|m&1,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=m>>1;h--,h==0&&(h=Math.pow(2,d),d++),x[P]=p++,T=String(S);}if(T!==""){if(Object.prototype.hasOwnProperty.call(M,T)){if(T.charCodeAt(0)<256){for(c=0;c<d;c++)O=O<<1,E==f-1?(E=0,y.push(g(O)),O=0):E++;for(m=T.charCodeAt(0),c=0;c<8;c++)O=O<<1|m&1,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=m>>1;}else{for(m=1,c=0;c<d;c++)O=O<<1|m,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=0;for(m=T.charCodeAt(0),c=0;c<16;c++)O=O<<1|m&1,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=m>>1;}h--,h==0&&(h=Math.pow(2,d),d++),delete M[T];}else for(m=x[T],c=0;c<d;c++)O=O<<1|m&1,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=m>>1;h--,h==0&&(h=Math.pow(2,d),d++);}for(m=2,c=0;c<d;c++)O=O<<1|m&1,E==f-1?(E=0,y.push(g(O)),O=0):E++,m=m>>1;for(;;)if(O=O<<1,E==f-1){y.push(g(O));break;}else E++;return y.join("");},decompress:function decompress(a){return a==null?"":a==""?null:o._decompress(a.length,32768,function(f){return a.charCodeAt(f);});},_decompress:function _decompress(a,f,g){var c=[],m=4,x=4,M=3,S="",P=[],T,h,p,d,y,O,E,w={val:g(0),position:f,index:1};for(T=0;T<3;T+=1)c[T]=T;for(p=0,y=Math.pow(2,2),O=1;O!=y;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=f,w.val=g(w.index++)),p|=(d>0?1:0)*O,O<<=1;switch(p){case 0:for(p=0,y=Math.pow(2,8),O=1;O!=y;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=f,w.val=g(w.index++)),p|=(d>0?1:0)*O,O<<=1;E=t(p);break;case 1:for(p=0,y=Math.pow(2,16),O=1;O!=y;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=f,w.val=g(w.index++)),p|=(d>0?1:0)*O,O<<=1;E=t(p);break;case 2:return"";}for(c[3]=E,h=E,P.push(E);;){if(w.index>a)return"";for(p=0,y=Math.pow(2,M),O=1;O!=y;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=f,w.val=g(w.index++)),p|=(d>0?1:0)*O,O<<=1;switch(E=p){case 0:for(p=0,y=Math.pow(2,8),O=1;O!=y;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=f,w.val=g(w.index++)),p|=(d>0?1:0)*O,O<<=1;c[x++]=t(p),E=x-1,m--;break;case 1:for(p=0,y=Math.pow(2,16),O=1;O!=y;)d=w.val&w.position,w.position>>=1,w.position==0&&(w.position=f,w.val=g(w.index++)),p|=(d>0?1:0)*O,O<<=1;c[x++]=t(p),E=x-1,m--;break;case 2:return P.join("");}if(m==0&&(m=Math.pow(2,M),M++),c[E])S=c[E];else if(E===x)S=h+h.charAt(0);else return null;P.push(S),c[x++]=h+S.charAt(0),m--,h=S,m==0&&(m=Math.pow(2,M),M++);}}};return o;}();u!=null?u.exports=e:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e;});})(cn);var Xi=cn.exports;function Ze(u){return JSON.parse(Xi.decompress(u));}function Te(u){return Xi.compress(JSON.stringify(u));}var zi={exports:{}};(function(u){(function(){var e={};e.version="6.4.2.2",e.use_lines=!0,e.use_xyz=!1;var t=!1;u.exports?(u.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 i={};n.indexOf("chrome")!=-1&&n.indexOf("chromium")==-1?i.chrome=1:i.chrome=0,n.indexOf("chromium")!=-1?i.chromium=1:i.chromium=0,n.indexOf("safari")!=-1&&n.indexOf("chrome")==-1&&n.indexOf("chromium")==-1?i.safari=1:i.safari=0,n.indexOf("firefox")!=-1?i.firefox=1:i.firefox=0,n.indexOf("firefox/17")!=-1?i.firefox17=1:i.firefox17=0,n.indexOf("firefox/15")!=-1?i.firefox15=1:i.firefox15=0,n.indexOf("firefox/3")!=-1?i.firefox3=1:i.firefox3=0,n.indexOf("opera")!=-1?i.opera=1:i.opera=0,n.indexOf("msie 10")!=-1?i.msie10=1:i.msie10=0,n.indexOf("msie 9")!=-1?i.msie9=1:i.msie9=0,n.indexOf("msie 8")!=-1?i.msie8=1:i.msie8=0,n.indexOf("msie 7")!=-1?i.msie7=1:i.msie7=0,n.indexOf("msie ")!=-1?i.msie=1:i.msie=0,e.biginteger_used=null;var l;function o(s,v,I){e.biginteger_used=1,s!=null&&(typeof s=="number"&&_typeof(v)>"u"?this.fromInt(s):typeof s=="number"?this.fromNumber(s,v,I):v==null&&typeof s!="string"?this.fromString(s,256):this.fromString(s,v));}function a(){return new o(null,void 0,void 0);}function f(s,v,I,N,Y,K){for(;--K>=0;){var _=v*this[s++]+I[N]+Y;Y=Math.floor(_/67108864),I[N++]=_&67108863;}return Y;}function g(s,v,I,N,Y,K){for(var _=v&32767,ft=v>>15;--K>=0;){var ht=this[s]&32767,It=this[s++]>>15,wt=ft*ht+It*_;ht=_*ht+((wt&32767)<<15)+I[N]+(Y&1073741823),Y=(ht>>>30)+(wt>>>15)+ft*It+(Y>>>30),I[N++]=ht&1073741823;}return Y;}function c(s,v,I,N,Y,K){for(var _=v&16383,ft=v>>14;--K>=0;){var ht=this[s]&16383,It=this[s++]>>14,wt=ft*ht+It*_;ht=_*ht+((wt&16383)<<14)+I[N]+Y,Y=(ht>>28)+(wt>>14)+ft*It,I[N++]=ht&268435455;}return Y;}r=="Microsoft Internet Explorer"?(o.prototype.am=g,l=30):r!="Netscape"?(o.prototype.am=f,l=26):(o.prototype.am=c,l=28),o.prototype.DB=l,o.prototype.DM=(1<<l)-1,o.prototype.DV=1<<l;var m=52;o.prototype.FV=Math.pow(2,m),o.prototype.F1=m-l,o.prototype.F2=2*l-m;var x="0123456789abcdefghijklmnopqrstuvwxyz",M=new Array(),S,P;for(S=48,P=0;P<=9;++P)M[S++]=P;for(S=97,P=10;P<36;++P)M[S++]=P;for(S=65,P=10;P<36;++P)M[S++]=P;function T(s){return x.charAt(s);}function h(s,v){var I=M[s.charCodeAt(v)];return I!==null&&I!==void 0?I:-1;}function p(s){for(var v=this.t-1;v>=0;--v)s[v]=this[v];s.t=this.t,s.s=this.s;}function d(s){this.t=1,this.s=s<0?-1:0,s>0?this[0]=s:s<-1?this[0]=s+this.DV:this.t=0;}function y(s){var v=a();return v.fromInt(s),v;}function O(s,v){var I;if(v==16)I=4;else if(v==8)I=3;else if(v==256)I=8;else if(v==2)I=1;else if(v==32)I=5;else if(v==4)I=2;else{this.fromRadix(s,v);return;}this.t=0,this.s=0;for(var N=s.length,Y=!1,K=0;--N>=0;){var _=I==8?s[N]&255:h(s,N);if(_<0){s.charAt(N)=="-"&&(Y=!0);continue;}Y=!1,K==0?this[this.t++]=_:K+I>this.DB?(this[this.t-1]|=(_&(1<<this.DB-K)-1)<<K,this[this.t++]=_>>this.DB-K):this[this.t-1]|=_<<K,K+=I,K>=this.DB&&(K-=this.DB);}I==8&&s[0]&128&&(this.s=-1,K>0&&(this[this.t-1]|=(1<<this.DB-K)-1<<K)),this.clamp(),Y&&o.ZERO.subTo(this,this);}function E(){for(var s=this.s&this.DM;this.t>0&&this[this.t-1]==s;)--this.t;}function w(s){if(this.s<0)return"-"+this.negate().toString(s);var v;if(s==16)v=4;else if(s==8)v=3;else if(s==2)v=1;else if(s==32)v=5;else if(s==4)v=2;else return this.toRadix(s);var I=(1<<v)-1,N,Y=!1,K="",_=this.t,ft=this.DB-_*this.DB%v;if(_-->0)for(ft<this.DB&&(N=this[_]>>ft)>0&&(Y=!0,K=T(N));_>=0;)ft<v?(N=(this[_]&(1<<ft)-1)<<v-ft,N|=this[--_]>>(ft+=this.DB-v)):(N=this[_]>>(ft-=v)&I,ft<=0&&(ft+=this.DB,--_)),N>0&&(Y=!0),Y&&(K+=T(N));return Y?K:"0";}function B(){var s=a();return o.ZERO.subTo(this,s),s;}function A(){return this.s<0?this.negate():this;}function b(s){var v=this.s-s.s;if(v!=0)return v;var I=this.t;if(v=I-s.t,v!=0)return this.s<0?-v:v;for(;--I>=0;)if((v=this[I]-s[I])!=0)return v;return 0;}function W(s){var v=1,I;return(I=s>>>16)!=0&&(s=I,v+=16),(I=s>>8)!=0&&(s=I,v+=8),(I=s>>4)!=0&&(s=I,v+=4),(I=s>>2)!=0&&(s=I,v+=2),(I=s>>1)!=0&&(s=I,v+=1),v;}function D(){return this.t<=0?0:this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM);}function R(s,v){var I;for(I=this.t-1;I>=0;--I)v[I+s]=this[I];for(I=s-1;I>=0;--I)v[I]=0;v.t=this.t+s,v.s=this.s;}function j(s,v){for(var I=s;I<this.t;++I)v[I-s]=this[I];v.t=Math.max(this.t-s,0),v.s=this.s;}function k(s,v){var I=s%this.DB,N=this.DB-I,Y=(1<<N)-1,K=Math.floor(s/this.DB),_=this.s<<I&this.DM,ft;for(ft=this.t-1;ft>=0;--ft)v[ft+K+1]=this[ft]>>N|_,_=(this[ft]&Y)<<I;for(ft=K-1;ft>=0;--ft)v[ft]=0;v[K]=_,v.t=this.t+K+1,v.s=this.s,v.clamp();}function J(s,v){v.s=this.s;var I=Math.floor(s/this.DB);if(I>=this.t){v.t=0;return;}var N=s%this.DB,Y=this.DB-N,K=(1<<N)-1;v[0]=this[I]>>N;for(var _=I+1;_<this.t;++_)v[_-I-1]|=(this[_]&K)<<Y,v[_-I]=this[_]>>N;N>0&&(v[this.t-I-1]|=(this.s&K)<<Y),v.t=this.t-I,v.clamp();}function rt(s,v){for(var I=0,N=0,Y=Math.min(s.t,this.t);I<Y;)N+=this[I]-s[I],v[I++]=N&this.DM,N>>=this.DB;if(s.t<this.t){for(N-=s.s;I<this.t;)N+=this[I],v[I++]=N&this.DM,N>>=this.DB;N+=this.s;}else{for(N+=this.s;I<s.t;)N-=s[I],v[I++]=N&this.DM,N>>=this.DB;N-=s.s;}v.s=N<0?-1:0,N<-1?v[I++]=this.DV+N:N>0&&(v[I++]=N),v.t=I,v.clamp();}function st(s,v){var I=this.abs(),N=s.abs(),Y=I.t;for(v.t=Y+N.t;--Y>=0;)v[Y]=0;for(Y=0;Y<N.t;++Y)v[Y+I.t]=I.am(0,N[Y],v,Y,0,I.t);v.s=0,v.clamp(),this.s!=s.s&&o.ZERO.subTo(v,v);}function $(s){for(var v=this.abs(),I=s.t=2*v.t;--I>=0;)s[I]=0;for(I=0;I<v.t-1;++I){var N=v.am(I,v[I],s,2*I,0,1);(s[I+v.t]+=v.am(I+1,2*v[I],s,2*I+1,N,v.t-I-1))>=v.DV&&(s[I+v.t]-=v.DV,s[I+v.t+1]=1);}s.t>0&&(s[s.t-1]+=v.am(I,v[I],s,2*I,0,1)),s.s=0,s.clamp();}function V(s,v,I){var N=s.abs();if(!(N.t<=0)){var Y=this.abs();if(Y.t<N.t){v!=null&&v.fromInt(0),I!=null&&this.copyTo(I);return;}I==null&&(I=a());var K=a(),_=this.s,ft=s.s,ht=this.DB-W(N[N.t-1]);ht>0?(N.lShiftTo(ht,K),Y.lShiftTo(ht,I)):(N.copyTo(K),Y.copyTo(I));var It=K.t,wt=K[It-1];if(wt!=0){var Lt=wt*(1<<this.F1)+(It>1?K[It-2]>>this.F2:0),Bt=this.FV/Lt,Yt=(1<<this.F1)/Lt,Ht=1<<this.F2,kt=I.t,ee=kt-It,ve=v!==null&&v!==void 0?v:a();for(K.dlShiftTo(ee,ve),I.compareTo(ve)>=0&&(I[I.t++]=1,I.subTo(ve,I)),o.ONE.dlShiftTo(It,ve),ve.subTo(K,K);K.t<It;)K[K.t++]=0;for(;--ee>=0;){var Oe=I[--kt]==wt?this.DM:Math.floor(I[kt]*Bt+(I[kt-1]+Ht)*Yt);if((I[kt]+=K.am(0,Oe,I,ee,0,It))<Oe)for(K.dlShiftTo(ee,ve),I.subTo(ve,I);I[kt]<--Oe;)I.subTo(ve,I);}v!=null&&(I.drShiftTo(It,v),_!=ft&&o.ZERO.subTo(v,v)),I.t=It,I.clamp(),ht>0&&I.rShiftTo(ht,I),_<0&&o.ZERO.subTo(I,I);}}}function nt(s){var v=a();return this.abs().divRemTo(s,null,v),this.s<0&&v.compareTo(o.ZERO)>0&&s.subTo(v,v),v;}function lt(s){this.m=s;}function ct(s){return s.s<0||s.compareTo(this.m)>=0?s.mod(this.m):s;}function pt(s){return s;}function et(s){s.divRemTo(this.m,null,s);}function gt(s,v,I){s.multiplyTo(v,I),this.reduce(I);}function Tt(s,v){s.squareTo(v),this.reduce(v);}lt.prototype.convert=ct,lt.prototype.revert=pt,lt.prototype.reduce=et,lt.prototype.mulTo=gt,lt.prototype.sqrTo=Tt;function X(){if(this.t<1)return 0;var s=this[0];if(!(s&1))return 0;var v=s&3;return v=v*(2-(s&15)*v)&15,v=v*(2-(s&255)*v)&255,v=v*(2-((s&65535)*v&65535))&65535,v=v*(2-s*v%this.DV)%this.DV,v>0?this.DV-v:-v;}function z(s){this.m=s,this.mp=s.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<s.DB-15)-1,this.mt2=2*s.t;}function Q(s){var v=a();return s.abs().dlShiftTo(this.m.t,v),v.divRemTo(this.m,null,v),s.s<0&&v.compareTo(o.ZERO)>0&&this.m.subTo(v,v),v;}function tt(s){var v=a();return s.copyTo(v),this.reduce(v),v;}function U(s){for(;s.t<=this.mt2;)s[s.t++]=0;for(var v=0;v<this.m.t;++v){var I=s[v]&32767,N=I*this.mpl+((I*this.mph+(s[v]>>15)*this.mpl&this.um)<<15)&s.DM;for(I=v+this.m.t,s[I]+=this.m.am(0,N,s,v,0,this.m.t);s[I]>=s.DV;)s[I]-=s.DV,s[++I]++;}s.clamp(),s.drShiftTo(this.m.t,s),s.compareTo(this.m)>=0&&s.subTo(this.m,s);}function H(s,v){s.squareTo(v),this.reduce(v);}function C(s,v,I){s.multiplyTo(v,I),this.reduce(I);}z.prototype.convert=Q,z.prototype.revert=tt,z.prototype.reduce=U,z.prototype.mulTo=C,z.prototype.sqrTo=H;function L(){return(this.t>0?this[0]&1:this.s)==0;}function F(s,v){if(s>4294967295||s<1)return o.ONE;var I=a(),N=a(),Y=v.convert(this),K=W(s)-1;for(Y.copyTo(I);--K>=0;)if(v.sqrTo(I,N),(s&1<<K)>0)v.mulTo(N,Y,I);else{var _=I;I=N,N=_;}return v.revert(I);}function G(s,v){var I;return s<256||v.isEven()?I=new lt(v):I=new z(v),this.exp(s,I);}o.prototype.copyTo=p,o.prototype.fromInt=d,o.prototype.fromString=O,o.prototype.clamp=E,o.prototype.dlShiftTo=R,o.prototype.drShiftTo=j,o.prototype.lShiftTo=k,o.prototype.rShiftTo=J,o.prototype.subTo=rt,o.prototype.multiplyTo=st,o.prototype.squareTo=$,o.prototype.divRemTo=V,o.prototype.invDigit=X,o.prototype.isEven=L,o.prototype.exp=F,o.prototype.toString=w,o.prototype.negate=B,o.prototype.abs=A,o.prototype.compareTo=b,o.prototype.bitLength=D,o.prototype.mod=nt,o.prototype.modPowInt=G,o.ZERO=y(0),o.ONE=y(1);function Z(){var s=a();return this.copyTo(s),s;}function q(){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 it(){return this.t==0?this.s:this[0]<<24>>24;}function ut(){return this.t==0?this.s:this[0]<<16>>16;}function mt(s){return Math.floor(Math.LN2*this.DB/Math.log(s));}function Pt(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1;}function Ct(s){if(s==null&&(s=10),this.signum()==0||s<2||s>36)return"0";var v=this.chunkSize(s),I=Math.pow(s,v),N=y(I),Y=a(),K=a(),_="";for(this.divRemTo(N,Y,K);Y.signum()>0;)_=(I+K.intValue()).toString(s).substr(1)+_,Y.divRemTo(N,Y,K);return K.intValue().toString(s)+_;}function yt(s,v){this.fromInt(0),v==null&&(v=10);for(var I=this.chunkSize(v),N=Math.pow(v,I),Y=!1,K=0,_=0,ft=0;ft<s.length;++ft){var ht=h(s,ft);if(ht<0){s.charAt(ft)=="-"&&this.signum()==0&&(Y=!0);continue;}_=v*_+ht,++K>=I&&(this.dMultiply(N),this.dAddOffset(_,0),K=0,_=0);}K>0&&(this.dMultiply(Math.pow(v,K)),this.dAddOffset(_,0)),Y&&o.ZERO.subTo(this,this);}function vt(s,v,I){if(typeof v=="number"){if(s<2)this.fromInt(1);else for(this.fromNumber(s,I),this.testBit(s-1)||this.bitwiseTo(o.ONE.shiftLeft(s-1),Ut,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(v);)this.dAddOffset(2,0),this.bitLength()>s&&this.subTo(o.ONE.shiftLeft(s-1),this);}else{var N=new Array(),Y=s&7;N.length=(s>>3)+1,v.nextBytes(N),Y>0?N[0]&=(1<<Y)-1:N[0]=0,this.fromString(N,256);}}function xt(){var s=this.t,v=new Array();v[0]=this.s;var I=this.DB-s*this.DB%8,N,Y=0;if(s-->0)for(I<this.DB&&(N=this[s]>>I)!=(this.s&this.DM)>>I&&(v[Y++]=N|this.s<<this.DB-I);s>=0;)I<8?(N=(this[s]&(1<<I)-1)<<8-I,N|=this[--s]>>(I+=this.DB-8)):(N=this[s]>>(I-=8)&255,I<=0&&(I+=this.DB,--s)),N&128&&(N|=-256),Y==0&&(this.s&128)!=(N&128)&&++Y,(Y>0||N!=this.s)&&(v[Y++]=N);return v;}function Et(s){return this.compareTo(s)==0;}function At(s){return this.compareTo(s)<0?this:s;}function Ot(s){return this.compareTo(s)>0?this:s;}function Nt(s,v,I){var N,Y,K=Math.min(s.t,this.t);for(N=0;N<K;++N)I[N]=v(this[N],s[N]);if(s.t<this.t){for(Y=s.s&this.DM,N=K;N<this.t;++N)I[N]=v(this[N],Y);I.t=this.t;}else{for(Y=this.s&this.DM,N=K;N<s.t;++N)I[N]=v(Y,s[N]);I.t=s.t;}I.s=v(this.s,s.s),I.clamp();}function $t(s,v){return s&v;}function jt(s){var v=a();return this.bitwiseTo(s,$t,v),v;}function Ut(s,v){return s|v;}function zt(s){var v=a();return this.bitwiseTo(s,Ut,v),v;}function Xt(s,v){return s^v;}function ae(s){var v=a();return this.bitwiseTo(s,Xt,v),v;}function ie(s,v){return s&~v;}function se(s){var v=a();return this.bitwiseTo(s,ie,v),v;}function oe(){for(var s=a(),v=0;v<this.t;++v)s[v]=this.DM&~this[v];return s.t=this.t,s.s=~this.s,s;}function le(s){var v=a();return s<0?this.rShiftTo(-s,v):this.lShiftTo(s,v),v;}function ce(s){var v=a();return s<0?this.lShiftTo(-s,v):this.rShiftTo(s,v),v;}function fe(s){if(s==0)return-1;var v=0;return s&65535||(s>>=16,v+=16),s&255||(s>>=8,v+=8),s&15||(s>>=4,v+=4),s&3||(s>>=2,v+=2),s&1||++v,v;}function Jt(){for(var s=0;s<this.t;++s)if(this[s]!=0)return s*this.DB+fe(this[s]);return this.s<0?this.t*this.DB:-1;}function ge(s){for(var v=0;s!=0;)s&=s-1,++v;return v;}function Be(){for(var s=0,v=this.s&this.DM,I=0;I<this.t;++I)s+=ge(this[I]^v);return s;}function We(s){var v=Math.floor(s/this.DB);return v>=this.t?this.s!=0:(this[v]&1<<s%this.DB)!=0;}function dr(s,v){var I=o.ONE.shiftLeft(s);return this.bitwiseTo(I,v,I),I;}function pr(s){return this.changeBit(s,Ut);}function ps(s){return this.changeBit(s,ie);}function ms(s){return this.changeBit(s,Xt);}function vs(s,v){for(var I=0,N=0,Y=Math.min(s.t,this.t);I<Y;)N+=this[I]+s[I],v[I++]=N&this.DM,N>>=this.DB;if(s.t<this.t){for(N+=s.s;I<this.t;)N+=this[I],v[I++]=N&this.DM,N>>=this.DB;N+=this.s;}else{for(N+=this.s;I<s.t;)N+=s[I],v[I++]=N&this.DM,N>>=this.DB;N+=s.s;}v.s=N<0?-1:0,N>0?v[I++]=N:N<-1&&(v[I++]=this.DV+N),v.t=I,v.clamp();}function ys(s){var v=a();return this.addTo(s,v),v;}function gs(s){var v=a();return this.subTo(s,v),v;}function Ps(s){var v=a();return this.multiplyTo(s,v),v;}function xs(){var s=a();return this.squareTo(s),s;}function Ss(s){var v=a();return this.divRemTo(s,v,null),v;}function Ts(s){var v=a();return this.divRemTo(s,null,v),v;}function Cs(s){var v=a(),I=a();return this.divRemTo(s,v,I),new Array(v,I);}function Is(s){this[this.t]=this.am(0,s-1,this,0,0,this.t),++this.t,this.clamp();}function Os(s,v){if(s!=0){for(;this.t<=v;)this[this.t++]=0;for(this[v]+=s;this[v]>=this.DV;)this[v]-=this.DV,++v>=this.t&&(this[this.t++]=0),++this[v];}}function rr(){}function yn(s){return s;}function Ms(s,v,I){s.multiplyTo(v,I);}function Es(s,v){s.squareTo(v);}rr.prototype.convert=yn,rr.prototype.revert=yn,rr.prototype.mulTo=Ms,rr.prototype.sqrTo=Es;function As(s){return this.exp(s,new rr());}function Ls(s,v,I){var N=Math.min(this.t+s.t,v);for(I.s=0,I.t=N;N>0;)I[--N]=0;var Y;for(Y=I.t-this.t;N<Y;++N)I[N+this.t]=this.am(0,s[N],I,N,0,this.t);for(Y=Math.min(s.t,v);N<Y;++N)this.am(0,s[N],I,N,0,v-N);I.clamp();}function ws(s,v,I){--v;var N=I.t=this.t+s.t-v;for(I.s=0;--N>=0;)I[N]=0;for(N=Math.max(v-this.t,0);N<s.t;++N)I[this.t+N-v]=this.am(v-N,s[N],I,0,0,this.t+N-v);I.clamp(),I.drShiftTo(1,I);}function je(s){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*s.t,this.r2),this.mu=this.r2.divide(s),this.m=s;}function Rs(s){if(s.s<0||s.t>2*this.m.t)return s.mod(this.m);if(s.compareTo(this.m)<0)return s;var v=a();return s.copyTo(v),this.reduce(v),v;}function Ds(s){return s;}function bs(s){for(s.drShiftTo(this.m.t-1,this.r2),s.t>this.m.t+1&&(s.t=this.m.t+1,s.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);s.compareTo(this.r2)<0;)s.dAddOffset(1,this.m.t+1);for(s.subTo(this.r2,s);s.compareTo(this.m)>=0;)s.subTo(this.m,s);}function Ns(s,v){s.squareTo(v),this.reduce(v);}function Bs(s,v,I){s.multiplyTo(v,I),this.reduce(I);}je.prototype.convert=Rs,je.prototype.revert=Ds,je.prototype.reduce=bs,je.prototype.mulTo=Bs,je.prototype.sqrTo=Ns;function Ws(s,v){var I=s.bitLength(),N,Y=y(1),K;if(I<=0)return Y;I<18?N=1:I<48?N=3:I<144?N=4:I<768?N=5:N=6,I<8?K=new lt(v):v.isEven()?K=new je(v):K=new z(v);var _=new Array(),ft=3,ht=N-1,It=(1<<N)-1;if(_[1]=K.convert(this),N>1){var wt=a();for(K.sqrTo(_[1],wt);ft<=It;)_[ft]=a(),K.mulTo(wt,_[ft-2],_[ft]),ft+=2;}var Lt=s.t-1,Bt,Yt=!0,Ht=a(),kt;for(I=W(s[Lt])-1;Lt>=0;){for(I>=ht?Bt=s[Lt]>>I-ht&It:(Bt=(s[Lt]&(1<<I+1)-1)<<ht-I,Lt>0&&(Bt|=s[Lt-1]>>this.DB+I-ht)),ft=N;!(Bt&1);)Bt>>=1,--ft;if((I-=ft)<0&&(I+=this.DB,--Lt),Yt)_[Bt].copyTo(Y),Yt=!1;else{for(;ft>1;)K.sqrTo(Y,Ht),K.sqrTo(Ht,Y),ft-=2;ft>0?K.sqrTo(Y,Ht):(kt=Y,Y=Ht,Ht=kt),K.mulTo(Ht,_[Bt],Y);}for(;Lt>=0&&!(s[Lt]&1<<I);)K.sqrTo(Y,Ht),kt=Y,Y=Ht,Ht=kt,--I<0&&(I=this.DB-1,--Lt);}return K.revert(Y);}function Fs(s){var v=this.s<0?this.negate():this.clone(),I=s.s<0?s.negate():s.clone();if(v.compareTo(I)<0){var N=v;v=I,I=N;}var Y=v.getLowestSetBit(),K=I.getLowestSetBit();if(K<0)return v;for(Y<K&&(K=Y),K>0&&(v.rShiftTo(K,v),I.rShiftTo(K,I));v.signum()>0;)(Y=v.getLowestSetBit())>0&&v.rShiftTo(Y,v),(Y=I.getLowestSetBit())>0&&I.rShiftTo(Y,I),v.compareTo(I)>=0?(v.subTo(I,v),v.rShiftTo(1,v)):(I.subTo(v,I),I.rShiftTo(1,I));return K>0&&I.lShiftTo(K,I),I;}function Us(s){if(s<=0)return 0;var v=this.DV%s,I=this.s<0?s-1:0;if(this.t>0)if(v==0)I=this[0]%s;else for(var N=this.t-1;N>=0;--N)I=(v*I+this[N])%s;return I;}function js(s){var v=s.isEven();if(this.isEven()&&v||s.signum()==0)return o.ZERO;for(var I=s.clone(),N=this.clone(),Y=y(1),K=y(0),_=y(0),ft=y(1);I.signum()!=0;){for(;I.isEven();)I.rShiftTo(1,I),v?((!Y.isEven()||!K.isEven())&&(Y.addTo(this,Y),K.subTo(s,K)),Y.rShiftTo(1,Y)):K.isEven()||K.subTo(s,K),K.rShiftTo(1,K);for(;N.isEven();)N.rShiftTo(1,N),v?((!_.isEven()||!ft.isEven())&&(_.addTo(this,_),ft.subTo(s,ft)),_.rShiftTo(1,_)):ft.isEven()||ft.subTo(s,ft),ft.rShiftTo(1,ft);I.compareTo(N)>=0?(I.subTo(N,I),v&&Y.subTo(_,Y),K.subTo(ft,K)):(N.subTo(I,N),v&&_.subTo(Y,_),ft.subTo(K,ft));}if(N.compareTo(o.ONE)!=0)return o.ZERO;if(ft.compareTo(s)>=0)return ft.subtract(s);if(ft.signum()<0)ft.addTo(s,ft);else return ft;return ft.signum()<0?ft.add(s):ft;}var pe=[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],Ys=(1<<26)/pe[pe.length-1];function Xs(s){var v,I=this.abs();if(I.t==1&&I[0]<=pe[pe.length-1]){for(v=0;v<pe.length;++v)if(I[0]==pe[v])return!0;return!1;}if(I.isEven())return!1;for(v=1;v<pe.length;){for(var N=pe[v],Y=v+1;Y<pe.length&&N<Ys;)N*=pe[Y++];for(N=I.modInt(N);v<Y;)if(N%pe[v++]==0)return!1;}return I.millerRabin(s);}function zs(s){var v=this.subtract(o.ONE),I=v.getLowestSetBit();if(I<=0)return!1;var N=v.shiftRight(I);s=s+1>>1,s>pe.length&&(s=pe.length);for(var Y=a(),K=0;K<s;++K){Y.fromInt(pe[Math.floor(Math.random()*pe.length)]);var _=Y.modPow(N,this);if(_.compareTo(o.ONE)!=0&&_.compareTo(v)!=0){for(var ft=1;ft++<I&&_.compareTo(v)!=0;)if(_=_.modPowInt(2,this),_.compareTo(o.ONE)==0)return!1;if(_.compareTo(v)!=0)return!1;}}return!0;}o.prototype.chunkSize=mt,o.prototype.toRadix=Ct,o.prototype.fromRadix=yt,o.prototype.fromNumber=vt,o.prototype.bitwiseTo=Nt,o.prototype.changeBit=dr,o.prototype.addTo=vs,o.prototype.dMultiply=Is,o.prototype.dAddOffset=Os,o.prototype.multiplyLowerTo=Ls,o.prototype.multiplyUpperTo=ws,o.prototype.modInt=Us,o.prototype.millerRabin=zs,o.prototype.clone=Z,o.prototype.intValue=q,o.prototype.byteValue=it,o.prototype.shortValue=ut,o.prototype.signum=Pt,o.prototype.toByteArray=xt,o.prototype.equals=Et,o.prototype.min=At,o.prototype.max=Ot,o.prototype.and=jt,o.prototype.or=zt,o.prototype.xor=ae,o.prototype.andNot=se,o.prototype.not=oe,o.prototype.shiftLeft=le,o.prototype.shiftRight=ce,o.prototype.getLowestSetBit=Jt,o.prototype.bitCount=Be,o.prototype.testBit=We,o.prototype.setBit=pr,o.prototype.clearBit=ps,o.prototype.flipBit=ms,o.prototype.add=ys,o.prototype.subtract=gs,o.prototype.multiply=Ps,o.prototype.divide=Ss,o.prototype.remainder=Ts,o.prototype.divideAndRemainder=Cs,o.prototype.modPow=Ws,o.prototype.modInverse=js,o.prototype.pow=As,o.prototype.gcd=Fs,o.prototype.isProbablePrime=Xs,o.prototype.square=xs;var Gt=o;Gt.prototype.IsNegative=function(){return this.compareTo(Gt.ZERO)==-1;},Gt.op_Equality=function(s,v){return s.compareTo(v)==0;},Gt.op_Inequality=function(s,v){return s.compareTo(v)!=0;},Gt.op_GreaterThan=function(s,v){return s.compareTo(v)>0;},Gt.op_LessThan=function(s,v){return s.compareTo(v)<0;},Gt.op_Addition=function(s,v){return new Gt(s,void 0,void 0).add(new Gt(v,void 0,void 0));},Gt.op_Subtraction=function(s,v){return new Gt(s,void 0,void 0).subtract(new Gt(v,void 0,void 0));},Gt.Int128Mul=function(s,v){return new Gt(s,void 0,void 0).multiply(new Gt(v,void 0,void 0));},Gt.op_Division=function(s,v){return s.divide(v);},Gt.prototype.ToDouble=function(){return parseFloat(this.toString());};var gn=function gn(s,v){var I;if(_typeof(Object.getOwnPropertyNames)>"u"){for(I in v.prototype)(_typeof(s.prototype[I])>"u"||s.prototype[I]===Object.prototype[I])&&(s.prototype[I]=v.prototype[I]);for(I in v)_typeof(s[I])>"u"&&(s[I]=v[I]);s.$baseCtor=v;}else{for(var N=Object.getOwnPropertyNames(v.prototype),Y=0;Y<N.length;Y++)_typeof(Object.getOwnPropertyDescriptor(s.prototype,N[Y]))>"u"&&Object.defineProperty(s.prototype,N[Y],Object.getOwnPropertyDescriptor(v.prototype,N[Y]));for(I in v)_typeof(s[I])>"u"&&(s[I]=v[I]);s.$baseCtor=v;}};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 s=arguments;this.X=0,this.Y=0,s.length===1?(this.X=s[0].X,this.Y=s[0].Y):s.length===2&&(this.X=s[0],this.Y=s[1]);},e.DoublePoint0=function(){this.X=0,this.Y=0;},e.DoublePoint0.prototype=e.DoublePoint.prototype,e.DoublePoint1=function(s){this.X=s.X,this.Y=s.Y;},e.DoublePoint1.prototype=e.DoublePoint.prototype,e.DoublePoint2=function(s,v){this.X=s,this.Y=v;},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 s=!0,v=this.m_Parent;v!==null;)s=!s,v=v.m_Parent;return s;},e.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length;},e.PolyNode.prototype.Contour=function(){return this.m_polygon;},e.PolyNode.prototype.AddChild=function(s){var v=this.m_Childs.length;this.m_Childs.push(s),s.m_Parent=this,s.m_Index=v;},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 s=0,v=this.m_AllPolys.length;s<v;s++)this.m_AllPolys[s]=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 s=this.m_AllPolys.length;return s>0&&this.m_Childs[0]!==this.m_AllPolys[0]&&s--,s;},gn(e.PolyTree,e.PolyNode),e.Math_Abs_Int64=e.Math_Abs_Int32=e.Math_Abs_Double=function(s){return Math.abs(s);},e.Math_Max_Int32_Int32=function(s,v){return Math.max(s,v);},i.msie||i.opera||i.safari?e.Cast_Int32=function(s){return s|0;}:e.Cast_Int32=function(s){return~~s;},_typeof(Number.toInteger)>"u"&&(Number.toInteger=null),i.chrome?e.Cast_Int64=function(s){return s<-2147483648||s>2147483647?s<0?Math.ceil(s):Math.floor(s):~~s;}:i.firefox&&typeof Number.toInteger=="function"?e.Cast_Int64=function(s){return Number.toInteger(s);}:i.msie7||i.msie8?e.Cast_Int64=function(s){return parseInt(s,10);}:i.msie?e.Cast_Int64=function(s){return s<-2147483648||s>2147483647?s<0?Math.ceil(s):Math.floor(s):s|0;}:e.Cast_Int64=function(s){return s<0?Math.ceil(s):Math.floor(s);},e.Clear=function(s){s.length=0;},e.PI=3.141592653589793,e.PI2=2*3.141592653589793,e.IntPoint=function(){var s=arguments,v=s.length;if(this.X=0,this.Y=0,e.use_xyz){if(this.Z=0,v===3)this.X=s[0],this.Y=s[1],this.Z=s[2];else if(v===2)this.X=s[0],this.Y=s[1],this.Z=0;else if(v===1){if(s[0]instanceof e.DoublePoint){var I=s[0];this.X=e.Clipper.Round(I.X),this.Y=e.Clipper.Round(I.Y),this.Z=0;}else{var N=s[0];_typeof(N.Z)>"u"&&(N.Z=0),this.X=N.X,this.Y=N.Y,this.Z=N.Z;}}else this.X=0,this.Y=0,this.Z=0;}else if(v===2)this.X=s[0],this.Y=s[1];else if(v===1){if(s[0]instanceof e.DoublePoint){var I=s[0];this.X=e.Clipper.Round(I.X),this.Y=e.Clipper.Round(I.Y);}else{var N=s[0];this.X=N.X,this.Y=N.Y;}}else this.X=0,this.Y=0;},e.IntPoint.op_Equality=function(s,v){return s.X===v.X&&s.Y===v.Y;},e.IntPoint.op_Inequality=function(s,v){return s.X!==v.X||s.Y!==v.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(s){this.X=s.X,this.Y=s.Y,e.use_xyz&&(_typeof(s.Z)>"u"?this.Z=0:this.Z=s.Z);},e.IntPoint1.prototype=e.IntPoint.prototype,e.IntPoint1dp=function(s){this.X=e.Clipper.Round(s.X),this.Y=e.Clipper.Round(s.Y),e.use_xyz&&(this.Z=0);},e.IntPoint1dp.prototype=e.IntPoint.prototype,e.IntPoint2=function(s,v,I){this.X=s,this.Y=v,e.use_xyz&&(_typeof(I)>"u"?this.Z=0:this.Z=I);},e.IntPoint2.prototype=e.IntPoint.prototype,e.IntRect=function(){var s=arguments,v=s.length;if(v===4)this.left=s[0],this.top=s[1],this.right=s[2],this.bottom=s[3];else if(v===1){var I=s[0];this.left=I.left,this.top=I.top,this.right=I.right,this.bottom=I.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(s){this.left=s.left,this.top=s.top,this.right=s.right,this.bottom=s.bottom;},e.IntRect1.prototype=e.IntRect.prototype,e.IntRect4=function(s,v,I,N){this.left=s,this.top=v,this.right=I,this.bottom=N;},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(s,v){var I=v.Pt.Y-s.Pt.Y;return I>0?1:I<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(s){return s>-e.ClipperBase.tolerance&&s<e.ClipperBase.tolerance;},e.ClipperBase.IsHorizontal=function(s){return s.Delta.Y===0;},e.ClipperBase.prototype.PointIsVertex=function(s,v){var I=v;do{if(e.IntPoint.op_Equality(I.Pt,s))return!0;I=I.Next;}while(I!==v);return!1;},e.ClipperBase.prototype.PointOnLineSegment=function(s,v,I,N){return N?s.X===v.X&&s.Y===v.Y||s.X===I.X&&s.Y===I.Y||s.X>v.X==s.X<I.X&&s.Y>v.Y==s.Y<I.Y&&Gt.op_Equality(Gt.Int128Mul(s.X-v.X,I.Y-v.Y),Gt.Int128Mul(I.X-v.X,s.Y-v.Y)):s.X===v.X&&s.Y===v.Y||s.X===I.X&&s.Y===I.Y||s.X>v.X==s.X<I.X&&s.Y>v.Y==s.Y<I.Y&&(s.X-v.X)*(I.Y-v.Y)===(I.X-v.X)*(s.Y-v.Y);},e.ClipperBase.prototype.PointOnPolygon=function(s,v,I){for(var N=v;;){if(this.PointOnLineSegment(s,N.Pt,N.Next.Pt,I))return!0;if(N=N.Next,N===v)break;}return!1;},e.ClipperBase.prototype.SlopesEqual=e.ClipperBase.SlopesEqual=function(){var s=arguments,v=s.length,I,N,Y,K,_,ft,ht;return v===3?(I=s[0],N=s[1],ht=s[2],ht?Gt.op_Equality(Gt.Int128Mul(I.Delta.Y,N.Delta.X),Gt.Int128Mul(I.Delta.X,N.Delta.Y)):e.Cast_Int64(I.Delta.Y*N.Delta.X)===e.Cast_Int64(I.Delta.X*N.Delta.Y)):v===4?(Y=s[0],K=s[1],_=s[2],ht=s[3],ht?Gt.op_Equality(Gt.Int128Mul(Y.Y-K.Y,K.X-_.X),Gt.Int128Mul(Y.X-K.X,K.Y-_.Y)):e.Cast_Int64((Y.Y-K.Y)*(K.X-_.X))-e.Cast_Int64((Y.X-K.X)*(K.Y-_.Y))===0):(Y=s[0],K=s[1],_=s[2],ft=s[3],ht=s[4],ht?Gt.op_Equality(Gt.Int128Mul(Y.Y-K.Y,_.X-ft.X),Gt.Int128Mul(Y.X-K.X,_.Y-ft.Y)):e.Cast_Int64((Y.Y-K.Y)*(_.X-ft.X))-e.Cast_Int64((Y.X-K.X)*(_.Y-ft.Y))===0);},e.ClipperBase.SlopesEqual3=function(s,v,I){return I?Gt.op_Equality(Gt.Int128Mul(s.Delta.Y,v.Delta.X),Gt.Int128Mul(s.Delta.X,v.Delta.Y)):e.Cast_Int64(s.Delta.Y*v.Delta.X)===e.Cast_Int64(s.Delta.X*v.Delta.Y);},e.ClipperBase.SlopesEqual4=function(s,v,I,N){return N?Gt.op_Equality(Gt.Int128Mul(s.Y-v.Y,v.X-I.X),Gt.Int128Mul(s.X-v.X,v.Y-I.Y)):e.Cast_Int64((s.Y-v.Y)*(v.X-I.X))-e.Cast_Int64((s.X-v.X)*(v.Y-I.Y))===0;},e.ClipperBase.SlopesEqual5=function(s,v,I,N,Y){return Y?Gt.op_Equality(Gt.Int128Mul(s.Y-v.Y,I.X-N.X),Gt.Int128Mul(s.X-v.X,I.Y-N.Y)):e.Cast_Int64((s.Y-v.Y)*(I.X-N.X))-e.Cast_Int64((s.X-v.X)*(I.Y-N.Y))===0;},e.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var s=0,v=this.m_edges.length;s<v;++s){for(var I=0,N=this.m_edges[s].length;I<N;++I)this.m_edges[s][I]=null;e.Clear(this.m_edges[s]);}e.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1;},e.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var s=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=s;}this.m_CurrentLM=null;},e.ClipperBase.prototype.RangeTest=function(s,v){v.Value?(s.X>e.ClipperBase.hiRange||s.Y>e.ClipperBase.hiRange||-s.X>e.ClipperBase.hiRange||-s.Y>e.ClipperBase.hiRange)&&e.Error("Coordinate outside allowed range in RangeTest()."):(s.X>e.ClipperBase.loRange||s.Y>e.ClipperBase.loRange||-s.X>e.ClipperBase.loRange||-s.Y>e.ClipperBase.loRange)&&(v.Value=!0,this.RangeTest(s,v));},e.ClipperBase.prototype.InitEdge=function(s,v,I,N){s.Next=v,s.Prev=I,s.Curr.X=N.X,s.Curr.Y=N.Y,e.use_xyz&&(s.Curr.Z=N.Z),s.OutIdx=-1;},e.ClipperBase.prototype.InitEdge2=function(s,v){s.Curr.Y>=s.Next.Curr.Y?(s.Bot.X=s.Curr.X,s.Bot.Y=s.Curr.Y,e.use_xyz&&(s.Bot.Z=s.Curr.Z),s.Top.X=s.Next.Curr.X,s.Top.Y=s.Next.Curr.Y,e.use_xyz&&(s.Top.Z=s.Next.Curr.Z)):(s.Top.X=s.Curr.X,s.Top.Y=s.Curr.Y,e.use_xyz&&(s.Top.Z=s.Curr.Z),s.Bot.X=s.Next.Curr.X,s.Bot.Y=s.Next.Curr.Y,e.use_xyz&&(s.Bot.Z=s.Next.Curr.Z)),this.SetDx(s),s.PolyTyp=v;},e.ClipperBase.prototype.FindNextLocMin=function(s){for(var v;;){for(;e.IntPoint.op_Inequality(s.Bot,s.Prev.Bot)||e.IntPoint.op_Equality(s.Curr,s.Top);)s=s.Next;if(s.Dx!==e.ClipperBase.horizontal&&s.Prev.Dx!==e.ClipperBase.horizontal)break;for(;s.Prev.Dx===e.ClipperBase.horizontal;)s=s.Prev;for(v=s;s.Dx===e.ClipperBase.horizontal;)s=s.Next;if(s.Top.Y!==s.Prev.Bot.Y){v.Prev.Bot.X<s.Bot.X&&(s=v);break;}}return s;},e.ClipperBase.prototype.ProcessBound=function(s,v){var I,N=s,Y;if(N.OutIdx===e.ClipperBase.Skip){if(s=N,v){for(;s.Top.Y===s.Next.Bot.Y;)s=s.Next;for(;s!==N&&s.Dx===e.ClipperBase.horizontal;)s=s.Prev;}else{for(;s.Top.Y===s.Prev.Bot.Y;)s=s.Prev;for(;s!==N&&s.Dx===e.ClipperBase.horizontal;)s=s.Next;}if(s===N)v?N=s.Next:N=s.Prev;else{v?s=N.Next:s=N.Prev;var K=new e.LocalMinima();K.Next=null,K.Y=s.Bot.Y,K.LeftBound=null,K.RightBound=s,s.WindDelta=0,N=this.ProcessBound(s,v),this.InsertLocalMinima(K);}return N;}if(s.Dx===e.ClipperBase.horizontal&&(v?I=s.Prev:I=s.Next,I.Dx===e.ClipperBase.horizontal?I.Bot.X!==s.Bot.X&&I.Top.X!==s.Bot.X&&this.ReverseHorizontal(s):I.Bot.X!==s.Bot.X&&this.ReverseHorizontal(s)),I=s,v){for(;N.Top.Y===N.Next.Bot.Y&&N.Next.OutIdx!==e.ClipperBase.Skip;)N=N.Next;if(N.Dx===e.ClipperBase.horizontal&&N.Next.OutIdx!==e.ClipperBase.Skip){for(Y=N;Y.Prev.Dx===e.ClipperBase.horizontal;)Y=Y.Prev;Y.Prev.Top.X>N.Next.Top.X&&(N=Y.Prev);}for(;s!==N;)s.NextInLML=s.Next,s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Prev.Top.X&&this.ReverseHorizontal(s),s=s.Next;s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Prev.Top.X&&this.ReverseHorizontal(s),N=N.Next;}else{for(;N.Top.Y===N.Prev.Bot.Y&&N.Prev.OutIdx!==e.ClipperBase.Skip;)N=N.Prev;if(N.Dx===e.ClipperBase.horizontal&&N.Prev.OutIdx!==e.ClipperBase.Skip){for(Y=N;Y.Next.Dx===e.ClipperBase.horizontal;)Y=Y.Next;(Y.Next.Top.X===N.Prev.Top.X||Y.Next.Top.X>N.Prev.Top.X)&&(N=Y.Next);}for(;s!==N;)s.NextInLML=s.Prev,s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Next.Top.X&&this.ReverseHorizontal(s),s=s.Prev;s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Next.Top.X&&this.ReverseHorizontal(s),N=N.Prev;}return N;},e.ClipperBase.prototype.AddPath=function(s,v,I){e.use_lines?!I&&v===e.PolyType.ptClip&&e.Error("AddPath: Open paths must be subject."):I||e.Error("AddPath: Open paths have been disabled.");var N=s.length-1;if(I)for(;N>0&&e.IntPoint.op_Equality(s[N],s[0]);)--N;for(;N>0&&e.IntPoint.op_Equality(s[N],s[N-1]);)--N;if(I&&N<2||!I&&N<1)return!1;for(var Y=new Array(),K=0;K<=N;K++)Y.push(new e.TEdge());var _=!0;Y[1].Curr.X=s[1].X,Y[1].Curr.Y=s[1].Y,e.use_xyz&&(Y[1].Curr.Z=s[1].Z);var ft={Value:this.m_UseFullRange};this.RangeTest(s[0],ft),this.m_UseFullRange=ft.Value,ft.Value=this.m_UseFullRange,this.RangeTest(s[N],ft),this.m_UseFullRange=ft.Value,this.InitEdge(Y[0],Y[1],Y[N],s[0]),this.InitEdge(Y[N],Y[0],Y[N-1],s[N]);for(var K=N-1;K>=1;--K)ft.Value=this.m_UseFullRange,this.RangeTest(s[K],ft),this.m_UseFullRange=ft.Value,this.InitEdge(Y[K],Y[K+1],Y[K-1],s[K]);for(var ht=Y[0],It=ht,wt=ht;;){if(It.Curr===It.Next.Curr&&(I||It.Next!==ht)){if(It===It.Next)break;It===ht&&(ht=It.Next),It=this.RemoveEdge(It),wt=It;continue;}if(It.Prev===It.Next)break;if(I&&e.ClipperBase.SlopesEqual4(It.Prev.Curr,It.Curr,It.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(It.Prev.Curr,It.Curr,It.Next.Curr))){It===ht&&(ht=It.Next),It=this.RemoveEdge(It),It=It.Prev,wt=It;continue;}if(It=It.Next,It===wt||!I&&It.Next===ht)break;}if(!I&&It===It.Next||I&&It.Prev===It.Next)return!1;I||(this.m_HasOpenPaths=!0,ht.Prev.OutIdx=e.ClipperBase.Skip),It=ht;do this.InitEdge2(It,v),It=It.Next,_&&It.Curr.Y!==ht.Curr.Y&&(_=!1);while(It!==ht);if(_){if(I)return!1;It.Prev.OutIdx=e.ClipperBase.Skip;var Lt=new e.LocalMinima();for(Lt.Next=null,Lt.Y=It.Bot.Y,Lt.LeftBound=null,Lt.RightBound=It,Lt.RightBound.Side=e.EdgeSide.esRight,Lt.RightBound.WindDelta=0;It.Bot.X!==It.Prev.Top.X&&this.ReverseHorizontal(It),It.Next.OutIdx!==e.ClipperBase.Skip;)It.NextInLML=It.Next,It=It.Next;return this.InsertLocalMinima(Lt),this.m_edges.push(Y),!0;}this.m_edges.push(Y);var Bt,Yt=null;for(e.IntPoint.op_Equality(It.Prev.Bot,It.Prev.Top)&&(It=It.Next);It=this.FindNextLocMin(It),It!==Yt;){Yt===null&&(Yt=It);var Lt=new e.LocalMinima();Lt.Next=null,Lt.Y=It.Bot.Y,It.Dx<It.Prev.Dx?(Lt.LeftBound=It.Prev,Lt.RightBound=It,Bt=!1):(Lt.LeftBound=It,Lt.RightBound=It.Prev,Bt=!0),Lt.LeftBound.Side=e.EdgeSide.esLeft,Lt.RightBound.Side=e.EdgeSide.esRight,I?Lt.LeftBound.Next===Lt.RightBound?Lt.LeftBound.WindDelta=-1:Lt.LeftBound.WindDelta=1:Lt.LeftBound.WindDelta=0,Lt.RightBound.WindDelta=-Lt.LeftBound.WindDelta,It=this.ProcessBound(Lt.LeftBound,Bt),It.OutIdx===e.ClipperBase.Skip&&(It=this.ProcessBound(It,Bt));var Ht=this.ProcessBound(Lt.RightBound,!Bt);Ht.OutIdx===e.ClipperBase.Skip&&(Ht=this.ProcessBound(Ht,!Bt)),Lt.LeftBound.OutIdx===e.ClipperBase.Skip?Lt.LeftBound=null:Lt.RightBound.OutIdx===e.ClipperBase.Skip&&(Lt.RightBound=null),this.InsertLocalMinima(Lt),Bt||(It=Ht);}return!0;},e.ClipperBase.prototype.AddPaths=function(s,v,I){for(var N=!1,Y=0,K=s.length;Y<K;++Y)this.AddPath(s[Y],v,I)&&(N=!0);return N;},e.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(s,v,I){return e.IntPoint.op_Equality(s,I)||e.IntPoint.op_Equality(s,v)||e.IntPoint.op_Equality(I,v)?!1:s.X!==I.X?v.X>s.X==v.X<I.X:v.Y>s.Y==v.Y<I.Y;},e.ClipperBase.prototype.RemoveEdge=function(s){s.Prev.Next=s.Next,s.Next.Prev=s.Prev;var v=s.Next;return s.Prev=null,v;},e.ClipperBase.prototype.SetDx=function(s){s.Delta.X=s.Top.X-s.Bot.X,s.Delta.Y=s.Top.Y-s.Bot.Y,s.Delta.Y===0?s.Dx=e.ClipperBase.horizontal:s.Dx=s.Delta.X/s.Delta.Y;},e.ClipperBase.prototype.InsertLocalMinima=function(s){if(this.m_MinimaList===null)this.m_MinimaList=s;else if(s.Y>=this.m_MinimaList.Y)s.Next=this.m_MinimaList,this.m_MinimaList=s;else{for(var v=this.m_MinimaList;v.Next!==null&&s.Y<v.Next.Y;)v=v.Next;s.Next=v.Next,v.Next=s;}},e.ClipperBase.prototype.PopLocalMinima=function(s,v){return v.v=this.m_CurrentLM,this.m_CurrentLM!==null&&this.m_CurrentLM.Y===s?(this.m_CurrentLM=this.m_CurrentLM.Next,!0):!1;},e.ClipperBase.prototype.ReverseHorizontal=function(s){var v=s.Top.X;s.Top.X=s.Bot.X,s.Bot.X=v,e.use_xyz&&(v=s.Top.Z,s.Top.Z=s.Bot.Z,s.Bot.Z=v);},e.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!==null){this.m_Scanbeam=null;for(var s=this.m_MinimaList;s!==null;){this.InsertScanbeam(s.Y);var v=s.LeftBound;v!==null&&(v.Curr.X=v.Bot.X,v.Curr.Y=v.Bot.Y,e.use_xyz&&(v.Curr.Z=v.Bot.Z),v.OutIdx=e.ClipperBase.Unassigned),v=s.RightBound,v!==null&&(v.Curr.X=v.Bot.X,v.Curr.Y=v.Bot.Y,e.use_xyz&&(v.Curr.Z=v.Bot.Z),v.OutIdx=e.ClipperBase.Unassigned),s=s.Next;}this.m_ActiveEdges=null;}},e.ClipperBase.prototype.InsertScanbeam=function(s){if(this.m_Scanbeam===null)this.m_Scanbeam=new e.Scanbeam(),this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=s;else if(s>this.m_Scanbeam.Y){var v=new e.Scanbeam();v.Y=s,v.Next=this.m_Scanbeam,this.m_Scanbeam=v;}else{for(var I=this.m_Scanbeam;I.Next!==null&&s<=I.Next.Y;)I=I.Next;if(s===I.Y)return;var N=new e.Scanbeam();N.Y=s,N.Next=I.Next,I.Next=N;}},e.ClipperBase.prototype.PopScanbeam=function(s){return this.m_Scanbeam===null?(s.v=0,!1):(s.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 s=new e.OutRec();return s.Idx=e.ClipperBase.Unassigned,s.IsHole=!1,s.IsOpen=!1,s.FirstLeft=null,s.Pts=null,s.BottomPt=null,s.PolyNode=null,this.m_PolyOuts.push(s),s.Idx=this.m_PolyOuts.length-1,s;},e.ClipperBase.prototype.DisposeOutRec=function(s){var v=this.m_PolyOuts[s];v.Pts=null,v=null,this.m_PolyOuts[s]=null;},e.ClipperBase.prototype.UpdateEdgeIntoAEL=function(s){s.NextInLML===null&&e.Error("UpdateEdgeIntoAEL: invalid call");var v=s.PrevInAEL,I=s.NextInAEL;return s.NextInLML.OutIdx=s.OutIdx,v!==null?v.NextInAEL=s.NextInLML:this.m_ActiveEdges=s.NextInLML,I!==null&&(I.PrevInAEL=s.NextInLML),s.NextInLML.Side=s.Side,s.NextInLML.WindDelta=s.WindDelta,s.NextInLML.WindCnt=s.WindCnt,s.NextInLML.WindCnt2=s.WindCnt2,s=s.NextInLML,s.Curr.X=s.Bot.X,s.Curr.Y=s.Bot.Y,s.PrevInAEL=v,s.NextInAEL=I,e.ClipperBase.IsHorizontal(s)||this.InsertScanbeam(s.Top.Y),s;},e.ClipperBase.prototype.SwapPositionsInAEL=function(s,v){if(!(s.NextInAEL===s.PrevInAEL||v.NextInAEL===v.PrevInAEL)){if(s.NextInAEL===v){var I=v.NextInAEL;I!==null&&(I.PrevInAEL=s);var N=s.PrevInAEL;N!==null&&(N.NextInAEL=v),v.PrevInAEL=N,v.NextInAEL=s,s.PrevInAEL=v,s.NextInAEL=I;}else if(v.NextInAEL===s){var Y=s.NextInAEL;Y!==null&&(Y.PrevInAEL=v);var K=v.PrevInAEL;K!==null&&(K.NextInAEL=s),s.PrevInAEL=K,s.NextInAEL=v,v.PrevInAEL=s,v.NextInAEL=Y;}else{var _=s.NextInAEL,ft=s.PrevInAEL;s.NextInAEL=v.NextInAEL,s.NextInAEL!==null&&(s.NextInAEL.PrevInAEL=s),s.PrevInAEL=v.PrevInAEL,s.PrevInAEL!==null&&(s.PrevInAEL.NextInAEL=s),v.NextInAEL=_,v.NextInAEL!==null&&(v.NextInAEL.PrevInAEL=v),v.PrevInAEL=ft,v.PrevInAEL!==null&&(v.PrevInAEL.NextInAEL=v);}s.PrevInAEL===null?this.m_ActiveEdges=s:v.PrevInAEL===null&&(this.m_ActiveEdges=v);}},e.ClipperBase.prototype.DeleteFromAEL=function(s){var v=s.PrevInAEL,I=s.NextInAEL;v===null&&I===null&&s!==this.m_ActiveEdges||(v!==null?v.NextInAEL=I:this.m_ActiveEdges=I,I!==null&&(I.PrevInAEL=v),s.NextInAEL=null,s.PrevInAEL=null);},e.Clipper=function(s){_typeof(s)>"u"&&(s=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&s)!==0,this.StrictlySimple=(2&s)!==0,this.PreserveCollinear=(4&s)!==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(s){var v=new e.Maxima();if(v.X=s,this.m_Maxima===null)this.m_Maxima=v,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(s<this.m_Maxima.X)v.Next=this.m_Maxima,v.Prev=null,this.m_Maxima=v;else{for(var I=this.m_Maxima;I.Next!==null&&s>=I.Next.X;)I=I.Next;if(s===I.X)return;v.Next=I.Next,v.Prev=I,I.Next!==null&&(I.Next.Prev=v),I.Next=v;}},e.Clipper.prototype.Execute=function(){var s=arguments,v=s.length,I=s[1]instanceof e.PolyTree;if(v===4&&!I){var N=s[0],Y=s[1],K=s[2],_=s[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(Y),this.m_SubjFillType=K,this.m_ClipFillType=_,this.m_ClipType=N,this.m_UsingPolyTree=!1;try{var ft=this.ExecuteInternal();ft&&this.BuildResult(Y);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return ft;}else if(v===4&&I){var N=s[0],ht=s[1],K=s[2],_=s[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=K,this.m_ClipFillType=_,this.m_ClipType=N,this.m_UsingPolyTree=!0;try{var ft=this.ExecuteInternal();ft&&this.BuildResult2(ht);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return ft;}else if(v===2&&!I){var N=s[0],Y=s[1];return this.Execute(N,Y,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}else if(v===2&&I){var N=s[0],ht=s[1];return this.Execute(N,ht,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}},e.Clipper.prototype.FixHoleLinkage=function(s){if(!(s.FirstLeft===null||s.IsHole!==s.FirstLeft.IsHole&&s.FirstLeft.Pts!==null)){for(var v=s.FirstLeft;v!==null&&(v.IsHole===s.IsHole||v.Pts===null);)v=v.FirstLeft;s.FirstLeft=v;}},e.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_SortedEdges=null,this.m_Maxima=null;var s={},v={};if(!this.PopScanbeam(s))return!1;for(this.InsertLocalMinimaIntoAEL(s.v);this.PopScanbeam(v)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(v.v))return!1;this.ProcessEdgesAtTopOfScanbeam(v.v),s.v=v.v,this.InsertLocalMinimaIntoAEL(s.v);}var I,N,Y;for(N=0,Y=this.m_PolyOuts.length;N<Y;N++)I=this.m_PolyOuts[N],!(I.Pts===null||I.IsOpen)&&(I.IsHole^this.ReverseSolution)==this.Area$1(I)>0&&this.ReversePolyPtLinks(I.Pts);for(this.JoinCommonEdges(),N=0,Y=this.m_PolyOuts.length;N<Y;N++)I=this.m_PolyOuts[N],I.Pts!==null&&(I.IsOpen?this.FixupOutPolyline(I):this.FixupOutPolygon(I));return this.StrictlySimple&&this.DoSimplePolygons(),!0;}finally{this.m_Joins.length=0,this.m_GhostJoins.length=0;}},e.Clipper.prototype.DisposeAllPolyPts=function(){for(var s=0,v=this.m_PolyOuts.length;s<v;++s)this.DisposeOutRec(s);e.Clear(this.m_PolyOuts);},e.Clipper.prototype.AddJoin=function(s,v,I){var N=new e.Join();N.OutPt1=s,N.OutPt2=v,N.OffPt.X=I.X,N.OffPt.Y=I.Y,e.use_xyz&&(N.OffPt.Z=I.Z),this.m_Joins.push(N);},e.Clipper.prototype.AddGhostJoin=function(s,v){var I=new e.Join();I.OutPt1=s,I.OffPt.X=v.X,I.OffPt.Y=v.Y,e.use_xyz&&(I.OffPt.Z=v.Z),this.m_GhostJoins.push(I);},e.Clipper.prototype.SetZ=function(s,v,I){if(this.ZFillFunction!==null){if(s.Z!==0||this.ZFillFunction===null)return;e.IntPoint.op_Equality(s,v.Bot)?s.Z=v.Bot.Z:e.IntPoint.op_Equality(s,v.Top)?s.Z=v.Top.Z:e.IntPoint.op_Equality(s,I.Bot)?s.Z=I.Bot.Z:e.IntPoint.op_Equality(s,I.Top)?s.Z=I.Top.Z:this.ZFillFunction(v.Bot,v.Top,I.Bot,I.Top,s);}},e.Clipper.prototype.InsertLocalMinimaIntoAEL=function(s){for(var v={},I,N;this.PopLocalMinima(s,v);){I=v.v.LeftBound,N=v.v.RightBound;var Y=null;if(I===null?(this.InsertEdgeIntoAEL(N,null),this.SetWindingCount(N),this.IsContributing(N)&&(Y=this.AddOutPt(N,N.Bot))):N===null?(this.InsertEdgeIntoAEL(I,null),this.SetWindingCount(I),this.IsContributing(I)&&(Y=this.AddOutPt(I,I.Bot)),this.InsertScanbeam(I.Top.Y)):(this.InsertEdgeIntoAEL(I,null),this.InsertEdgeIntoAEL(N,I),this.SetWindingCount(I),N.WindCnt=I.WindCnt,N.WindCnt2=I.WindCnt2,this.IsContributing(I)&&(Y=this.AddLocalMinPoly(I,N,I.Bot)),this.InsertScanbeam(I.Top.Y)),N!==null&&(e.ClipperBase.IsHorizontal(N)?(N.NextInLML!==null&&this.InsertScanbeam(N.NextInLML.Top.Y),this.AddEdgeToSEL(N)):this.InsertScanbeam(N.Top.Y)),!(I===null||N===null)){if(Y!==null&&e.ClipperBase.IsHorizontal(N)&&this.m_GhostJoins.length>0&&N.WindDelta!==0)for(var K=0,_=this.m_GhostJoins.length;K<_;K++){var ft=this.m_GhostJoins[K];this.HorzSegmentsOverlap(ft.OutPt1.Pt.X,ft.OffPt.X,N.Bot.X,N.Top.X)&&this.AddJoin(ft.OutPt1,Y,ft.OffPt);}if(I.OutIdx>=0&&I.PrevInAEL!==null&&I.PrevInAEL.Curr.X===I.Bot.X&&I.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(I.PrevInAEL.Curr,I.PrevInAEL.Top,I.Curr,I.Top,this.m_UseFullRange)&&I.WindDelta!==0&&I.PrevInAEL.WindDelta!==0){var ht=this.AddOutPt(I.PrevInAEL,I.Bot);this.AddJoin(Y,ht,I.Top);}if(I.NextInAEL!==N){if(N.OutIdx>=0&&N.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(N.PrevInAEL.Curr,N.PrevInAEL.Top,N.Curr,N.Top,this.m_UseFullRange)&&N.WindDelta!==0&&N.PrevInAEL.WindDelta!==0){var ht=this.AddOutPt(N.PrevInAEL,N.Bot);this.AddJoin(Y,ht,N.Top);}var It=I.NextInAEL;if(It!==null)for(;It!==N;)this.IntersectEdges(N,It,I.Curr),It=It.NextInAEL;}}}},e.Clipper.prototype.InsertEdgeIntoAEL=function(s,v){if(this.m_ActiveEdges===null)s.PrevInAEL=null,s.NextInAEL=null,this.m_ActiveEdges=s;else if(v===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,s))s.PrevInAEL=null,s.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=s,this.m_ActiveEdges=s;else{for(v===null&&(v=this.m_ActiveEdges);v.NextInAEL!==null&&!this.E2InsertsBeforeE1(v.NextInAEL,s);)v=v.NextInAEL;s.NextInAEL=v.NextInAEL,v.NextInAEL!==null&&(v.NextInAEL.PrevInAEL=s),s.PrevInAEL=v,v.NextInAEL=s;}},e.Clipper.prototype.E2InsertsBeforeE1=function(s,v){return v.Curr.X===s.Curr.X?v.Top.Y>s.Top.Y?v.Top.X<e.Clipper.TopX(s,v.Top.Y):s.Top.X>e.Clipper.TopX(v,s.Top.Y):v.Curr.X<s.Curr.X;},e.Clipper.prototype.IsEvenOddFillType=function(s){return s.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType===e.PolyFillType.pftEvenOdd:this.m_ClipFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsEvenOddAltFillType=function(s){return s.PolyTyp===e.PolyType.ptSubject?this.m_ClipFillType===e.PolyFillType.pftEvenOdd:this.m_SubjFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsContributing=function(s){var v,I;switch(s.PolyTyp===e.PolyType.ptSubject?(v=this.m_SubjFillType,I=this.m_ClipFillType):(v=this.m_ClipFillType,I=this.m_SubjFillType),v){case e.PolyFillType.pftEvenOdd:if(s.WindDelta===0&&s.WindCnt!==1)return!1;break;case e.PolyFillType.pftNonZero:if(Math.abs(s.WindCnt)!==1)return!1;break;case e.PolyFillType.pftPositive:if(s.WindCnt!==1)return!1;break;default:if(s.WindCnt!==-1)return!1;break;}switch(this.m_ClipType){case e.ClipType.ctIntersection:switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2!==0;case e.PolyFillType.pftPositive:return s.WindCnt2>0;default:return s.WindCnt2<0;}case e.ClipType.ctUnion:switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2===0;case e.PolyFillType.pftPositive:return s.WindCnt2<=0;default:return s.WindCnt2>=0;}case e.ClipType.ctDifference:if(s.PolyTyp===e.PolyType.ptSubject)switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2===0;case e.PolyFillType.pftPositive:return s.WindCnt2<=0;default:return s.WindCnt2>=0;}else switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2!==0;case e.PolyFillType.pftPositive:return s.WindCnt2>0;default:return s.WindCnt2<0;}case e.ClipType.ctXor:if(s.WindDelta===0)switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2===0;case e.PolyFillType.pftPositive:return s.WindCnt2<=0;default:return s.WindCnt2>=0;}else return!0;}return!0;},e.Clipper.prototype.SetWindingCount=function(s){for(var v=s.PrevInAEL;v!==null&&(v.PolyTyp!==s.PolyTyp||v.WindDelta===0);)v=v.PrevInAEL;if(v===null){var I=s.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType;s.WindDelta===0?s.WindCnt=I===e.PolyFillType.pftNegative?-1:1:s.WindCnt=s.WindDelta,s.WindCnt2=0,v=this.m_ActiveEdges;}else if(s.WindDelta===0&&this.m_ClipType!==e.ClipType.ctUnion)s.WindCnt=1,s.WindCnt2=v.WindCnt2,v=v.NextInAEL;else if(this.IsEvenOddFillType(s)){if(s.WindDelta===0){for(var N=!0,Y=v.PrevInAEL;Y!==null;)Y.PolyTyp===v.PolyTyp&&Y.WindDelta!==0&&(N=!N),Y=Y.PrevInAEL;s.WindCnt=N?0:1;}else s.WindCnt=s.WindDelta;s.WindCnt2=v.WindCnt2,v=v.NextInAEL;}else v.WindCnt*v.WindDelta<0?Math.abs(v.WindCnt)>1?v.WindDelta*s.WindDelta<0?s.WindCnt=v.WindCnt:s.WindCnt=v.WindCnt+s.WindDelta:s.WindCnt=s.WindDelta===0?1:s.WindDelta:s.WindDelta===0?s.WindCnt=v.WindCnt<0?v.WindCnt-1:v.WindCnt+1:v.WindDelta*s.WindDelta<0?s.WindCnt=v.WindCnt:s.WindCnt=v.WindCnt+s.WindDelta,s.WindCnt2=v.WindCnt2,v=v.NextInAEL;if(this.IsEvenOddAltFillType(s))for(;v!==s;)v.WindDelta!==0&&(s.WindCnt2=s.WindCnt2===0?1:0),v=v.NextInAEL;else for(;v!==s;)s.WindCnt2+=v.WindDelta,v=v.NextInAEL;},e.Clipper.prototype.AddEdgeToSEL=function(s){this.m_SortedEdges===null?(this.m_SortedEdges=s,s.PrevInSEL=null,s.NextInSEL=null):(s.NextInSEL=this.m_SortedEdges,s.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=s,this.m_SortedEdges=s);},e.Clipper.prototype.PopEdgeFromSEL=function(s){if(s.v=this.m_SortedEdges,s.v===null)return!1;var v=s.v;return this.m_SortedEdges=s.v.NextInSEL,this.m_SortedEdges!==null&&(this.m_SortedEdges.PrevInSEL=null),v.NextInSEL=null,v.PrevInSEL=null,!0;},e.Clipper.prototype.CopyAELToSEL=function(){var s=this.m_ActiveEdges;for(this.m_SortedEdges=s;s!==null;)s.PrevInSEL=s.PrevInAEL,s.NextInSEL=s.NextInAEL,s=s.NextInAEL;},e.Clipper.prototype.SwapPositionsInSEL=function(s,v){if(!(s.NextInSEL===null&&s.PrevInSEL===null)&&!(v.NextInSEL===null&&v.PrevInSEL===null)){if(s.NextInSEL===v){var I=v.NextInSEL;I!==null&&(I.PrevInSEL=s);var N=s.PrevInSEL;N!==null&&(N.NextInSEL=v),v.PrevInSEL=N,v.NextInSEL=s,s.PrevInSEL=v,s.NextInSEL=I;}else if(v.NextInSEL===s){var I=s.NextInSEL;I!==null&&(I.PrevInSEL=v);var N=v.PrevInSEL;N!==null&&(N.NextInSEL=s),s.PrevInSEL=N,s.NextInSEL=v,v.PrevInSEL=s,v.NextInSEL=I;}else{var I=s.NextInSEL,N=s.PrevInSEL;s.NextInSEL=v.NextInSEL,s.NextInSEL!==null&&(s.NextInSEL.PrevInSEL=s),s.PrevInSEL=v.PrevInSEL,s.PrevInSEL!==null&&(s.PrevInSEL.NextInSEL=s),v.NextInSEL=I,v.NextInSEL!==null&&(v.NextInSEL.PrevInSEL=v),v.PrevInSEL=N,v.PrevInSEL!==null&&(v.PrevInSEL.NextInSEL=v);}s.PrevInSEL===null?this.m_SortedEdges=s:v.PrevInSEL===null&&(this.m_SortedEdges=v);}},e.Clipper.prototype.AddLocalMaxPoly=function(s,v,I){this.AddOutPt(s,I),v.WindDelta===0&&this.AddOutPt(v,I),s.OutIdx===v.OutIdx?(s.OutIdx=-1,v.OutIdx=-1):s.OutIdx<v.OutIdx?this.AppendPolygon(s,v):this.AppendPolygon(v,s);},e.Clipper.prototype.AddLocalMinPoly=function(s,v,I){var N,Y,K;if(e.ClipperBase.IsHorizontal(v)||s.Dx>v.Dx?(N=this.AddOutPt(s,I),v.OutIdx=s.OutIdx,s.Side=e.EdgeSide.esLeft,v.Side=e.EdgeSide.esRight,Y=s,Y.PrevInAEL===v?K=v.PrevInAEL:K=Y.PrevInAEL):(N=this.AddOutPt(v,I),s.OutIdx=v.OutIdx,s.Side=e.EdgeSide.esRight,v.Side=e.EdgeSide.esLeft,Y=v,Y.PrevInAEL===s?K=s.PrevInAEL:K=Y.PrevInAEL),K!==null&&K.OutIdx>=0&&K.Top.Y<I.Y&&Y.Top.Y<I.Y){var _=e.Clipper.TopX(K,I.Y),ft=e.Clipper.TopX(Y,I.Y);if(_===ft&&Y.WindDelta!==0&&K.WindDelta!==0&&e.ClipperBase.SlopesEqual5(new e.IntPoint2(_,I.Y),K.Top,new e.IntPoint2(ft,I.Y),Y.Top,this.m_UseFullRange)){var ht=this.AddOutPt(K,I);this.AddJoin(N,ht,Y.Top);}}return N;},e.Clipper.prototype.AddOutPt=function(s,v){if(s.OutIdx<0){var I=this.CreateOutRec();I.IsOpen=s.WindDelta===0;var N=new e.OutPt();return I.Pts=N,N.Idx=I.Idx,N.Pt.X=v.X,N.Pt.Y=v.Y,e.use_xyz&&(N.Pt.Z=v.Z),N.Next=N,N.Prev=N,I.IsOpen||this.SetHoleState(s,I),s.OutIdx=I.Idx,N;}else{var I=this.m_PolyOuts[s.OutIdx],Y=I.Pts,K=s.Side===e.EdgeSide.esLeft;if(K&&e.IntPoint.op_Equality(v,Y.Pt))return Y;if(!K&&e.IntPoint.op_Equality(v,Y.Prev.Pt))return Y.Prev;var N=new e.OutPt();return N.Idx=I.Idx,N.Pt.X=v.X,N.Pt.Y=v.Y,e.use_xyz&&(N.Pt.Z=v.Z),N.Next=Y,N.Prev=Y.Prev,N.Prev.Next=N,Y.Prev=N,K&&(I.Pts=N),N;}},e.Clipper.prototype.GetLastOutPt=function(s){var v=this.m_PolyOuts[s.OutIdx];return s.Side===e.EdgeSide.esLeft?v.Pts:v.Pts.Prev;},e.Clipper.prototype.SwapPoints=function(s,v){var I=new e.IntPoint1(s.Value);s.Value.X=v.Value.X,s.Value.Y=v.Value.Y,e.use_xyz&&(s.Value.Z=v.Value.Z),v.Value.X=I.X,v.Value.Y=I.Y,e.use_xyz&&(v.Value.Z=I.Z);},e.Clipper.prototype.HorzSegmentsOverlap=function(s,v,I,N){var Y;return s>v&&(Y=s,s=v,v=Y),I>N&&(Y=I,I=N,N=Y),s<N&&I<v;},e.Clipper.prototype.SetHoleState=function(s,v){for(var I=s.PrevInAEL,N=null;I!==null;)I.OutIdx>=0&&I.WindDelta!==0&&(N===null?N=I:N.OutIdx===I.OutIdx&&(N=null)),I=I.PrevInAEL;N===null?(v.FirstLeft=null,v.IsHole=!1):(v.FirstLeft=this.m_PolyOuts[N.OutIdx],v.IsHole=!v.FirstLeft.IsHole);},e.Clipper.prototype.GetDx=function(s,v){return s.Y===v.Y?e.ClipperBase.horizontal:(v.X-s.X)/(v.Y-s.Y);},e.Clipper.prototype.FirstIsBottomPt=function(s,v){for(var I=s.Prev;e.IntPoint.op_Equality(I.Pt,s.Pt)&&I!==s;)I=I.Prev;var N=Math.abs(this.GetDx(s.Pt,I.Pt));for(I=s.Next;e.IntPoint.op_Equality(I.Pt,s.Pt)&&I!==s;)I=I.Next;var Y=Math.abs(this.GetDx(s.Pt,I.Pt));for(I=v.Prev;e.IntPoint.op_Equality(I.Pt,v.Pt)&&I!==v;)I=I.Prev;var K=Math.abs(this.GetDx(v.Pt,I.Pt));for(I=v.Next;e.IntPoint.op_Equality(I.Pt,v.Pt)&&I!==v;)I=I.Next;var _=Math.abs(this.GetDx(v.Pt,I.Pt));return Math.max(N,Y)===Math.max(K,_)&&Math.min(N,Y)===Math.min(K,_)?this.Area(s)>0:N>=K&&N>=_||Y>=K&&Y>=_;},e.Clipper.prototype.GetBottomPt=function(s){for(var v=null,I=s.Next;I!==s;)I.Pt.Y>s.Pt.Y?(s=I,v=null):I.Pt.Y===s.Pt.Y&&I.Pt.X<=s.Pt.X&&(I.Pt.X<s.Pt.X?(v=null,s=I):I.Next!==s&&I.Prev!==s&&(v=I)),I=I.Next;if(v!==null)for(;v!==I;)for(this.FirstIsBottomPt(I,v)||(s=v),v=v.Next;e.IntPoint.op_Inequality(v.Pt,s.Pt);)v=v.Next;return s;},e.Clipper.prototype.GetLowermostRec=function(s,v){s.BottomPt===null&&(s.BottomPt=this.GetBottomPt(s.Pts)),v.BottomPt===null&&(v.BottomPt=this.GetBottomPt(v.Pts));var I=s.BottomPt,N=v.BottomPt;return I.Pt.Y>N.Pt.Y?s:I.Pt.Y<N.Pt.Y?v:I.Pt.X<N.Pt.X?s:I.Pt.X>N.Pt.X||I.Next===I?v:N.Next===N||this.FirstIsBottomPt(I,N)?s:v;},e.Clipper.prototype.OutRec1RightOfOutRec2=function(s,v){do if(s=s.FirstLeft,s===v)return!0;while(s!==null);return!1;},e.Clipper.prototype.GetOutRec=function(s){for(var v=this.m_PolyOuts[s];v!==this.m_PolyOuts[v.Idx];)v=this.m_PolyOuts[v.Idx];return v;},e.Clipper.prototype.AppendPolygon=function(s,v){var I=this.m_PolyOuts[s.OutIdx],N=this.m_PolyOuts[v.OutIdx],Y;this.OutRec1RightOfOutRec2(I,N)?Y=N:this.OutRec1RightOfOutRec2(N,I)?Y=I:Y=this.GetLowermostRec(I,N);var K=I.Pts,_=K.Prev,ft=N.Pts,ht=ft.Prev;s.Side===e.EdgeSide.esLeft?v.Side===e.EdgeSide.esLeft?(this.ReversePolyPtLinks(ft),ft.Next=K,K.Prev=ft,_.Next=ht,ht.Prev=_,I.Pts=ht):(ht.Next=K,K.Prev=ht,ft.Prev=_,_.Next=ft,I.Pts=ft):v.Side===e.EdgeSide.esRight?(this.ReversePolyPtLinks(ft),_.Next=ht,ht.Prev=_,ft.Next=K,K.Prev=ft):(_.Next=ft,ft.Prev=_,K.Prev=ht,ht.Next=K),I.BottomPt=null,Y===N&&(N.FirstLeft!==I&&(I.FirstLeft=N.FirstLeft),I.IsHole=N.IsHole),N.Pts=null,N.BottomPt=null,N.FirstLeft=I;var It=s.OutIdx,wt=v.OutIdx;s.OutIdx=-1,v.OutIdx=-1;for(var Lt=this.m_ActiveEdges;Lt!==null;){if(Lt.OutIdx===wt){Lt.OutIdx=It,Lt.Side=s.Side;break;}Lt=Lt.NextInAEL;}N.Idx=I.Idx;},e.Clipper.prototype.ReversePolyPtLinks=function(s){if(s!==null){var v,I;v=s;do I=v.Next,v.Next=v.Prev,v.Prev=I,v=I;while(v!==s);}},e.Clipper.SwapSides=function(s,v){var I=s.Side;s.Side=v.Side,v.Side=I;},e.Clipper.SwapPolyIndexes=function(s,v){var I=s.OutIdx;s.OutIdx=v.OutIdx,v.OutIdx=I;},e.Clipper.prototype.IntersectEdges=function(s,v,I){var N=s.OutIdx>=0,Y=v.OutIdx>=0;if(e.use_xyz&&this.SetZ(I,s,v),e.use_lines&&(s.WindDelta===0||v.WindDelta===0)){if(s.WindDelta===0&&v.WindDelta===0)return;s.PolyTyp===v.PolyTyp&&s.WindDelta!==v.WindDelta&&this.m_ClipType===e.ClipType.ctUnion?s.WindDelta===0?Y&&(this.AddOutPt(s,I),N&&(s.OutIdx=-1)):N&&(this.AddOutPt(v,I),Y&&(v.OutIdx=-1)):s.PolyTyp!==v.PolyTyp&&(s.WindDelta===0&&Math.abs(v.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||v.WindCnt2===0)?(this.AddOutPt(s,I),N&&(s.OutIdx=-1)):v.WindDelta===0&&Math.abs(s.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||s.WindCnt2===0)&&(this.AddOutPt(v,I),Y&&(v.OutIdx=-1)));return;}if(s.PolyTyp===v.PolyTyp){if(this.IsEvenOddFillType(s)){var K=s.WindCnt;s.WindCnt=v.WindCnt,v.WindCnt=K;}else s.WindCnt+v.WindDelta===0?s.WindCnt=-s.WindCnt:s.WindCnt+=v.WindDelta,v.WindCnt-s.WindDelta===0?v.WindCnt=-v.WindCnt:v.WindCnt-=s.WindDelta;}else this.IsEvenOddFillType(v)?s.WindCnt2=s.WindCnt2===0?1:0:s.WindCnt2+=v.WindDelta,this.IsEvenOddFillType(s)?v.WindCnt2=v.WindCnt2===0?1:0:v.WindCnt2-=s.WindDelta;var _,ft,ht,It;s.PolyTyp===e.PolyType.ptSubject?(_=this.m_SubjFillType,ht=this.m_ClipFillType):(_=this.m_ClipFillType,ht=this.m_SubjFillType),v.PolyTyp===e.PolyType.ptSubject?(ft=this.m_SubjFillType,It=this.m_ClipFillType):(ft=this.m_ClipFillType,It=this.m_SubjFillType);var wt,Lt;switch(_){case e.PolyFillType.pftPositive:wt=s.WindCnt;break;case e.PolyFillType.pftNegative:wt=-s.WindCnt;break;default:wt=Math.abs(s.WindCnt);break;}switch(ft){case e.PolyFillType.pftPositive:Lt=v.WindCnt;break;case e.PolyFillType.pftNegative:Lt=-v.WindCnt;break;default:Lt=Math.abs(v.WindCnt);break;}if(N&&Y)wt!==0&&wt!==1||Lt!==0&&Lt!==1||s.PolyTyp!==v.PolyTyp&&this.m_ClipType!==e.ClipType.ctXor?this.AddLocalMaxPoly(s,v,I):(this.AddOutPt(s,I),this.AddOutPt(v,I),e.Clipper.SwapSides(s,v),e.Clipper.SwapPolyIndexes(s,v));else if(N)(Lt===0||Lt===1)&&(this.AddOutPt(s,I),e.Clipper.SwapSides(s,v),e.Clipper.SwapPolyIndexes(s,v));else if(Y)(wt===0||wt===1)&&(this.AddOutPt(v,I),e.Clipper.SwapSides(s,v),e.Clipper.SwapPolyIndexes(s,v));else if((wt===0||wt===1)&&(Lt===0||Lt===1)){var Bt,Yt;switch(ht){case e.PolyFillType.pftPositive:Bt=s.WindCnt2;break;case e.PolyFillType.pftNegative:Bt=-s.WindCnt2;break;default:Bt=Math.abs(s.WindCnt2);break;}switch(It){case e.PolyFillType.pftPositive:Yt=v.WindCnt2;break;case e.PolyFillType.pftNegative:Yt=-v.WindCnt2;break;default:Yt=Math.abs(v.WindCnt2);break;}if(s.PolyTyp!==v.PolyTyp)this.AddLocalMinPoly(s,v,I);else if(wt===1&&Lt===1)switch(this.m_ClipType){case e.ClipType.ctIntersection:Bt>0&&Yt>0&&this.AddLocalMinPoly(s,v,I);break;case e.ClipType.ctUnion:Bt<=0&&Yt<=0&&this.AddLocalMinPoly(s,v,I);break;case e.ClipType.ctDifference:(s.PolyTyp===e.PolyType.ptClip&&Bt>0&&Yt>0||s.PolyTyp===e.PolyType.ptSubject&&Bt<=0&&Yt<=0)&&this.AddLocalMinPoly(s,v,I);break;case e.ClipType.ctXor:this.AddLocalMinPoly(s,v,I);break;}else e.Clipper.SwapSides(s,v);}},e.Clipper.prototype.DeleteFromSEL=function(s){var v=s.PrevInSEL,I=s.NextInSEL;v===null&&I===null&&s!==this.m_SortedEdges||(v!==null?v.NextInSEL=I:this.m_SortedEdges=I,I!==null&&(I.PrevInSEL=v),s.NextInSEL=null,s.PrevInSEL=null);},e.Clipper.prototype.ProcessHorizontals=function(){for(var s={};this.PopEdgeFromSEL(s);)this.ProcessHorizontal(s.v);},e.Clipper.prototype.GetHorzDirection=function(s,v){s.Bot.X<s.Top.X?(v.Left=s.Bot.X,v.Right=s.Top.X,v.Dir=e.Direction.dLeftToRight):(v.Left=s.Top.X,v.Right=s.Bot.X,v.Dir=e.Direction.dRightToLeft);},e.Clipper.prototype.ProcessHorizontal=function(s){var v={Dir:null,Left:null,Right:null};this.GetHorzDirection(s,v);for(var I=v.Dir,N=v.Left,Y=v.Right,K=s.WindDelta===0,_=s,ft=null;_.NextInLML!==null&&e.ClipperBase.IsHorizontal(_.NextInLML);)_=_.NextInLML;_.NextInLML===null&&(ft=this.GetMaximaPair(_));var ht=this.m_Maxima;if(ht!==null)if(I===e.Direction.dLeftToRight){for(;ht!==null&&ht.X<=s.Bot.X;)ht=ht.Next;ht!==null&&ht.X>=_.Top.X&&(ht=null);}else{for(;ht.Next!==null&&ht.Next.X<s.Bot.X;)ht=ht.Next;ht.X<=_.Top.X&&(ht=null);}for(var It=null;;){for(var wt=s===_,Lt=this.GetNextInAEL(s,I);Lt!==null;){if(ht!==null)if(I===e.Direction.dLeftToRight)for(;ht!==null&&ht.X<Lt.Curr.X;)s.OutIdx>=0&&!K&&this.AddOutPt(s,new e.IntPoint2(ht.X,s.Bot.Y)),ht=ht.Next;else for(;ht!==null&&ht.X>Lt.Curr.X;)s.OutIdx>=0&&!K&&this.AddOutPt(s,new e.IntPoint2(ht.X,s.Bot.Y)),ht=ht.Prev;if(I===e.Direction.dLeftToRight&&Lt.Curr.X>Y||I===e.Direction.dRightToLeft&&Lt.Curr.X<N||Lt.Curr.X===s.Top.X&&s.NextInLML!==null&&Lt.Dx<s.NextInLML.Dx)break;if(s.OutIdx>=0&&!K){e.use_xyz&&(I===e.Direction.dLeftToRight?this.SetZ(Lt.Curr,s,Lt):this.SetZ(Lt.Curr,Lt,s)),It=this.AddOutPt(s,Lt.Curr);for(var Bt=this.m_SortedEdges;Bt!==null;){if(Bt.OutIdx>=0&&this.HorzSegmentsOverlap(s.Bot.X,s.Top.X,Bt.Bot.X,Bt.Top.X)){var Yt=this.GetLastOutPt(Bt);this.AddJoin(Yt,It,Bt.Top);}Bt=Bt.NextInSEL;}this.AddGhostJoin(It,s.Bot);}if(Lt===ft&&wt){s.OutIdx>=0&&this.AddLocalMaxPoly(s,ft,s.Top),this.DeleteFromAEL(s),this.DeleteFromAEL(ft);return;}if(I===e.Direction.dLeftToRight){var Ht=new e.IntPoint2(Lt.Curr.X,s.Curr.Y);this.IntersectEdges(s,Lt,Ht);}else{var Ht=new e.IntPoint2(Lt.Curr.X,s.Curr.Y);this.IntersectEdges(Lt,s,Ht);}var kt=this.GetNextInAEL(Lt,I);this.SwapPositionsInAEL(s,Lt),Lt=kt;}if(s.NextInLML===null||!e.ClipperBase.IsHorizontal(s.NextInLML))break;s=this.UpdateEdgeIntoAEL(s),s.OutIdx>=0&&this.AddOutPt(s,s.Bot),v={Dir:I,Left:N,Right:Y},this.GetHorzDirection(s,v),I=v.Dir,N=v.Left,Y=v.Right;}if(s.OutIdx>=0&&It===null){It=this.GetLastOutPt(s);for(var Bt=this.m_SortedEdges;Bt!==null;){if(Bt.OutIdx>=0&&this.HorzSegmentsOverlap(s.Bot.X,s.Top.X,Bt.Bot.X,Bt.Top.X)){var Yt=this.GetLastOutPt(Bt);this.AddJoin(Yt,It,Bt.Top);}Bt=Bt.NextInSEL;}this.AddGhostJoin(It,s.Top);}if(s.NextInLML!==null){if(s.OutIdx>=0){if(It=this.AddOutPt(s,s.Top),s=this.UpdateEdgeIntoAEL(s),s.WindDelta===0)return;var ee=s.PrevInAEL,kt=s.NextInAEL;if(ee!==null&&ee.Curr.X===s.Bot.X&&ee.Curr.Y===s.Bot.Y&&ee.WindDelta===0&&ee.OutIdx>=0&&ee.Curr.Y>ee.Top.Y&&e.ClipperBase.SlopesEqual3(s,ee,this.m_UseFullRange)){var Yt=this.AddOutPt(ee,s.Bot);this.AddJoin(It,Yt,s.Top);}else if(kt!==null&&kt.Curr.X===s.Bot.X&&kt.Curr.Y===s.Bot.Y&&kt.WindDelta!==0&&kt.OutIdx>=0&&kt.Curr.Y>kt.Top.Y&&e.ClipperBase.SlopesEqual3(s,kt,this.m_UseFullRange)){var Yt=this.AddOutPt(kt,s.Bot);this.AddJoin(It,Yt,s.Top);}}else s=this.UpdateEdgeIntoAEL(s);}else s.OutIdx>=0&&this.AddOutPt(s,s.Top),this.DeleteFromAEL(s);},e.Clipper.prototype.GetNextInAEL=function(s,v){return v===e.Direction.dLeftToRight?s.NextInAEL:s.PrevInAEL;},e.Clipper.prototype.IsMinima=function(s){return s!==null&&s.Prev.NextInLML!==s&&s.Next.NextInLML!==s;},e.Clipper.prototype.IsMaxima=function(s,v){return s!==null&&s.Top.Y===v&&s.NextInLML===null;},e.Clipper.prototype.IsIntermediate=function(s,v){return s.Top.Y===v&&s.NextInLML!==null;},e.Clipper.prototype.GetMaximaPair=function(s){return e.IntPoint.op_Equality(s.Next.Top,s.Top)&&s.Next.NextInLML===null?s.Next:e.IntPoint.op_Equality(s.Prev.Top,s.Top)&&s.Prev.NextInLML===null?s.Prev:null;},e.Clipper.prototype.GetMaximaPairEx=function(s){var v=this.GetMaximaPair(s);return v===null||v.OutIdx===e.ClipperBase.Skip||v.NextInAEL===v.PrevInAEL&&!e.ClipperBase.IsHorizontal(v)?null:v;},e.Clipper.prototype.ProcessIntersections=function(s){if(this.m_ActiveEdges===null)return!0;try{if(this.BuildIntersectList(s),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(s){if(this.m_ActiveEdges!==null){var v=this.m_ActiveEdges;for(this.m_SortedEdges=v;v!==null;)v.PrevInSEL=v.PrevInAEL,v.NextInSEL=v.NextInAEL,v.Curr.X=e.Clipper.TopX(v,s),v=v.NextInAEL;for(var I=!0;I&&this.m_SortedEdges!==null;){for(I=!1,v=this.m_SortedEdges;v.NextInSEL!==null;){var N=v.NextInSEL,Y=new e.IntPoint0();if(v.Curr.X>N.Curr.X){this.IntersectPoint(v,N,Y),Y.Y<s&&(Y=new e.IntPoint2(e.Clipper.TopX(v,s),s));var K=new e.IntersectNode();K.Edge1=v,K.Edge2=N,K.Pt.X=Y.X,K.Pt.Y=Y.Y,e.use_xyz&&(K.Pt.Z=Y.Z),this.m_IntersectList.push(K),this.SwapPositionsInSEL(v,N),I=!0;}else v=N;}if(v.PrevInSEL!==null)v.PrevInSEL.NextInSEL=null;else break;}this.m_SortedEdges=null;}},e.Clipper.prototype.EdgesAdjacent=function(s){return s.Edge1.NextInSEL===s.Edge2||s.Edge1.PrevInSEL===s.Edge2;},e.Clipper.IntersectNodeSort=function(s,v){return v.Pt.Y-s.Pt.Y;},e.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var s=this.m_IntersectList.length,v=0;v<s;v++){if(!this.EdgesAdjacent(this.m_IntersectList[v])){for(var I=v+1;I<s&&!this.EdgesAdjacent(this.m_IntersectList[I]);)I++;if(I===s)return!1;var N=this.m_IntersectList[v];this.m_IntersectList[v]=this.m_IntersectList[I],this.m_IntersectList[I]=N;}this.SwapPositionsInSEL(this.m_IntersectList[v].Edge1,this.m_IntersectList[v].Edge2);}return!0;},e.Clipper.prototype.ProcessIntersectList=function(){for(var s=0,v=this.m_IntersectList.length;s<v;s++){var I=this.m_IntersectList[s];this.IntersectEdges(I.Edge1,I.Edge2,I.Pt),this.SwapPositionsInAEL(I.Edge1,I.Edge2);}this.m_IntersectList.length=0;};var $s=function $s(s){return s<0?Math.ceil(s-0.5):Math.round(s);},Gs=function Gs(s){return s<0?Math.ceil(s-0.5):Math.floor(s+0.5);},Hs=function Hs(s){return s<0?-Math.round(Math.abs(s)):Math.round(s);},ks=function ks(s){return s<0?(s-=0.5,s<-2147483648?Math.ceil(s):s|0):(s+=0.5,s>2147483647?Math.floor(s):s|0);};i.msie?e.Clipper.Round=$s:i.chromium?e.Clipper.Round=Hs:i.safari?e.Clipper.Round=ks:e.Clipper.Round=Gs,e.Clipper.TopX=function(s,v){return v===s.Top.Y?s.Top.X:s.Bot.X+e.Clipper.Round(s.Dx*(v-s.Bot.Y));},e.Clipper.prototype.IntersectPoint=function(s,v,I){I.X=0,I.Y=0;var N,Y;if(s.Dx===v.Dx){I.Y=s.Curr.Y,I.X=e.Clipper.TopX(s,I.Y);return;}if(s.Delta.X===0)I.X=s.Bot.X,e.ClipperBase.IsHorizontal(v)?I.Y=v.Bot.Y:(Y=v.Bot.Y-v.Bot.X/v.Dx,I.Y=e.Clipper.Round(I.X/v.Dx+Y));else if(v.Delta.X===0)I.X=v.Bot.X,e.ClipperBase.IsHorizontal(s)?I.Y=s.Bot.Y:(N=s.Bot.Y-s.Bot.X/s.Dx,I.Y=e.Clipper.Round(I.X/s.Dx+N));else{N=s.Bot.X-s.Bot.Y*s.Dx,Y=v.Bot.X-v.Bot.Y*v.Dx;var K=(Y-N)/(s.Dx-v.Dx);I.Y=e.Clipper.Round(K),Math.abs(s.Dx)<Math.abs(v.Dx)?I.X=e.Clipper.Round(s.Dx*K+N):I.X=e.Clipper.Round(v.Dx*K+Y);}if(I.Y<s.Top.Y||I.Y<v.Top.Y){if(s.Top.Y>v.Top.Y)return I.Y=s.Top.Y,I.X=e.Clipper.TopX(v,s.Top.Y),I.X<s.Top.X;I.Y=v.Top.Y,Math.abs(s.Dx)<Math.abs(v.Dx)?I.X=e.Clipper.TopX(s,I.Y):I.X=e.Clipper.TopX(v,I.Y);}I.Y>s.Curr.Y&&(I.Y=s.Curr.Y,Math.abs(s.Dx)>Math.abs(v.Dx)?I.X=e.Clipper.TopX(v,I.Y):I.X=e.Clipper.TopX(s,I.Y));},e.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(s){for(var v=this.m_ActiveEdges;v!==null;){var I=this.IsMaxima(v,s);if(I){var N=this.GetMaximaPairEx(v);I=N===null||!e.ClipperBase.IsHorizontal(N);}if(I){this.StrictlySimple&&this.InsertMaxima(v.Top.X);var Y=v.PrevInAEL;this.DoMaxima(v),Y===null?v=this.m_ActiveEdges:v=Y.NextInAEL;}else{if(this.IsIntermediate(v,s)&&e.ClipperBase.IsHorizontal(v.NextInLML)?(v=this.UpdateEdgeIntoAEL(v),v.OutIdx>=0&&this.AddOutPt(v,v.Bot),this.AddEdgeToSEL(v)):(v.Curr.X=e.Clipper.TopX(v,s),v.Curr.Y=s),e.use_xyz&&(v.Top.Y===s?v.Curr.Z=v.Top.Z:v.Bot.Y===s?v.Curr.Z=v.Bot.Z:v.Curr.Z=0),this.StrictlySimple){var Y=v.PrevInAEL;if(v.OutIdx>=0&&v.WindDelta!==0&&Y!==null&&Y.OutIdx>=0&&Y.Curr.X===v.Curr.X&&Y.WindDelta!==0){var K=new e.IntPoint1(v.Curr);e.use_xyz&&this.SetZ(K,Y,v);var _=this.AddOutPt(Y,K),ft=this.AddOutPt(v,K);this.AddJoin(_,ft,K);}}v=v.NextInAEL;}}for(this.ProcessHorizontals(),this.m_Maxima=null,v=this.m_ActiveEdges;v!==null;){if(this.IsIntermediate(v,s)){var _=null;v.OutIdx>=0&&(_=this.AddOutPt(v,v.Top)),v=this.UpdateEdgeIntoAEL(v);var Y=v.PrevInAEL,ht=v.NextInAEL;if(Y!==null&&Y.Curr.X===v.Bot.X&&Y.Curr.Y===v.Bot.Y&&_!==null&&Y.OutIdx>=0&&Y.Curr.Y===Y.Top.Y&&e.ClipperBase.SlopesEqual5(v.Curr,v.Top,Y.Curr,Y.Top,this.m_UseFullRange)&&v.WindDelta!==0&&Y.WindDelta!==0){var ft=this.AddOutPt(ePrev2,v.Bot);this.AddJoin(_,ft,v.Top);}else if(ht!==null&&ht.Curr.X===v.Bot.X&&ht.Curr.Y===v.Bot.Y&&_!==null&&ht.OutIdx>=0&&ht.Curr.Y===ht.Top.Y&&e.ClipperBase.SlopesEqual5(v.Curr,v.Top,ht.Curr,ht.Top,this.m_UseFullRange)&&v.WindDelta!==0&&ht.WindDelta!==0){var ft=this.AddOutPt(ht,v.Bot);this.AddJoin(_,ft,v.Top);}}v=v.NextInAEL;}},e.Clipper.prototype.DoMaxima=function(s){var v=this.GetMaximaPairEx(s);if(v===null){s.OutIdx>=0&&this.AddOutPt(s,s.Top),this.DeleteFromAEL(s);return;}for(var I=s.NextInAEL;I!==null&&I!==v;)this.IntersectEdges(s,I,s.Top),this.SwapPositionsInAEL(s,I),I=s.NextInAEL;s.OutIdx===-1&&v.OutIdx===-1?(this.DeleteFromAEL(s),this.DeleteFromAEL(v)):s.OutIdx>=0&&v.OutIdx>=0?(s.OutIdx>=0&&this.AddLocalMaxPoly(s,v,s.Top),this.DeleteFromAEL(s),this.DeleteFromAEL(v)):e.use_lines&&s.WindDelta===0?(s.OutIdx>=0&&(this.AddOutPt(s,s.Top),s.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(s),v.OutIdx>=0&&(this.AddOutPt(v,s.Top),v.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(v)):e.Error("DoMaxima error");},e.Clipper.ReversePaths=function(s){for(var v=0,I=s.length;v<I;v++)s[v].reverse();},e.Clipper.Orientation=function(s){return e.Clipper.Area(s)>=0;},e.Clipper.prototype.PointCount=function(s){if(s===null)return 0;var v=0,I=s;do v++,I=I.Next;while(I!==s);return v;},e.Clipper.prototype.BuildResult=function(s){e.Clear(s);for(var v=0,I=this.m_PolyOuts.length;v<I;v++){var N=this.m_PolyOuts[v];if(N.Pts!==null){var Y=N.Pts.Prev,K=this.PointCount(Y);if(!(K<2)){for(var _=new Array(K),ft=0;ft<K;ft++)_[ft]=Y.Pt,Y=Y.Prev;s.push(_);}}}},e.Clipper.prototype.BuildResult2=function(s){s.Clear();for(var v=0,I=this.m_PolyOuts.length;v<I;v++){var N=this.m_PolyOuts[v],Y=this.PointCount(N.Pts);if(!(N.IsOpen&&Y<2||!N.IsOpen&&Y<3)){this.FixHoleLinkage(N);var K=new e.PolyNode();s.m_AllPolys.push(K),N.PolyNode=K,K.m_polygon.length=Y;for(var _=N.Pts.Prev,ft=0;ft<Y;ft++)K.m_polygon[ft]=_.Pt,_=_.Prev;}}for(var v=0,I=this.m_PolyOuts.length;v<I;v++){var N=this.m_PolyOuts[v];N.PolyNode!==null&&(N.IsOpen?(N.PolyNode.IsOpen=!0,s.AddChild(N.PolyNode)):N.FirstLeft!==null&&N.FirstLeft.PolyNode!==null?N.FirstLeft.PolyNode.AddChild(N.PolyNode):s.AddChild(N.PolyNode));}},e.Clipper.prototype.FixupOutPolyline=function(s){for(var v=s.Pts,I=v.Prev;v!==I;)if(v=v.Next,e.IntPoint.op_Equality(v.Pt,v.Prev.Pt)){v===I&&(I=v.Prev);var N=v.Prev;N.Next=v.Next,v.Next.Prev=N,v=N;}v===v.Prev&&(s.Pts=null);},e.Clipper.prototype.FixupOutPolygon=function(s){var v=null;s.BottomPt=null;for(var I=s.Pts,N=this.PreserveCollinear||this.StrictlySimple;;){if(I.Prev===I||I.Prev===I.Next){s.Pts=null;return;}if(e.IntPoint.op_Equality(I.Pt,I.Next.Pt)||e.IntPoint.op_Equality(I.Pt,I.Prev.Pt)||e.ClipperBase.SlopesEqual4(I.Prev.Pt,I.Pt,I.Next.Pt,this.m_UseFullRange)&&(!N||!this.Pt2IsBetweenPt1AndPt3(I.Prev.Pt,I.Pt,I.Next.Pt)))v=null,I.Prev.Next=I.Next,I.Next.Prev=I.Prev,I=I.Prev;else{if(I===v)break;v===null&&(v=I),I=I.Next;}}s.Pts=I;},e.Clipper.prototype.DupOutPt=function(s,v){var I=new e.OutPt();return I.Pt.X=s.Pt.X,I.Pt.Y=s.Pt.Y,e.use_xyz&&(I.Pt.Z=s.Pt.Z),I.Idx=s.Idx,v?(I.Next=s.Next,I.Prev=s,s.Next.Prev=I,s.Next=I):(I.Prev=s.Prev,I.Next=s,s.Prev.Next=I,s.Prev=I),I;},e.Clipper.prototype.GetOverlap=function(s,v,I,N,Y){return s<v?I<N?(Y.Left=Math.max(s,I),Y.Right=Math.min(v,N)):(Y.Left=Math.max(s,N),Y.Right=Math.min(v,I)):I<N?(Y.Left=Math.max(v,I),Y.Right=Math.min(s,N)):(Y.Left=Math.max(v,N),Y.Right=Math.min(s,I)),Y.Left<Y.Right;},e.Clipper.prototype.JoinHorz=function(s,v,I,N,Y,K){var _=s.Pt.X>v.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight,ft=I.Pt.X>N.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight;if(_===ft)return!1;if(_===e.Direction.dLeftToRight){for(;s.Next.Pt.X<=Y.X&&s.Next.Pt.X>=s.Pt.X&&s.Next.Pt.Y===Y.Y;)s=s.Next;K&&s.Pt.X!==Y.X&&(s=s.Next),v=this.DupOutPt(s,!K),e.IntPoint.op_Inequality(v.Pt,Y)&&(s=v,s.Pt.X=Y.X,s.Pt.Y=Y.Y,e.use_xyz&&(s.Pt.Z=Y.Z),v=this.DupOutPt(s,!K));}else{for(;s.Next.Pt.X>=Y.X&&s.Next.Pt.X<=s.Pt.X&&s.Next.Pt.Y===Y.Y;)s=s.Next;!K&&s.Pt.X!==Y.X&&(s=s.Next),v=this.DupOutPt(s,K),e.IntPoint.op_Inequality(v.Pt,Y)&&(s=v,s.Pt.X=Y.X,s.Pt.Y=Y.Y,e.use_xyz&&(s.Pt.Z=Y.Z),v=this.DupOutPt(s,K));}if(ft===e.Direction.dLeftToRight){for(;I.Next.Pt.X<=Y.X&&I.Next.Pt.X>=I.Pt.X&&I.Next.Pt.Y===Y.Y;)I=I.Next;K&&I.Pt.X!==Y.X&&(I=I.Next),N=this.DupOutPt(I,!K),e.IntPoint.op_Inequality(N.Pt,Y)&&(I=N,I.Pt.X=Y.X,I.Pt.Y=Y.Y,e.use_xyz&&(I.Pt.Z=Y.Z),N=this.DupOutPt(I,!K));}else{for(;I.Next.Pt.X>=Y.X&&I.Next.Pt.X<=I.Pt.X&&I.Next.Pt.Y===Y.Y;)I=I.Next;!K&&I.Pt.X!==Y.X&&(I=I.Next),N=this.DupOutPt(I,K),e.IntPoint.op_Inequality(N.Pt,Y)&&(I=N,I.Pt.X=Y.X,I.Pt.Y=Y.Y,e.use_xyz&&(I.Pt.Z=Y.Z),N=this.DupOutPt(I,K));}return _===e.Direction.dLeftToRight===K?(s.Prev=I,I.Next=s,v.Next=N,N.Prev=v):(s.Next=I,I.Prev=s,v.Prev=N,N.Next=v),!0;},e.Clipper.prototype.JoinPoints=function(s,v,I){var N=s.OutPt1,Y=new e.OutPt(),K=s.OutPt2,_=new e.OutPt(),ft=s.OutPt1.Pt.Y===s.OffPt.Y;if(ft&&e.IntPoint.op_Equality(s.OffPt,s.OutPt1.Pt)&&e.IntPoint.op_Equality(s.OffPt,s.OutPt2.Pt)){if(v!==I)return!1;for(Y=s.OutPt1.Next;Y!==N&&e.IntPoint.op_Equality(Y.Pt,s.OffPt);)Y=Y.Next;var ht=Y.Pt.Y>s.OffPt.Y;for(_=s.OutPt2.Next;_!==K&&e.IntPoint.op_Equality(_.Pt,s.OffPt);)_=_.Next;var It=_.Pt.Y>s.OffPt.Y;return ht===It?!1:ht?(Y=this.DupOutPt(N,!1),_=this.DupOutPt(K,!0),N.Prev=K,K.Next=N,Y.Next=_,_.Prev=Y,s.OutPt1=N,s.OutPt2=Y,!0):(Y=this.DupOutPt(N,!0),_=this.DupOutPt(K,!1),N.Next=K,K.Prev=N,Y.Prev=_,_.Next=Y,s.OutPt1=N,s.OutPt2=Y,!0);}else if(ft){for(Y=N;N.Prev.Pt.Y===N.Pt.Y&&N.Prev!==Y&&N.Prev!==K;)N=N.Prev;for(;Y.Next.Pt.Y===Y.Pt.Y&&Y.Next!==N&&Y.Next!==K;)Y=Y.Next;if(Y.Next===N||Y.Next===K)return!1;for(_=K;K.Prev.Pt.Y===K.Pt.Y&&K.Prev!==_&&K.Prev!==Y;)K=K.Prev;for(;_.Next.Pt.Y===_.Pt.Y&&_.Next!==K&&_.Next!==N;)_=_.Next;if(_.Next===K||_.Next===N)return!1;var wt={Left:null,Right:null};if(!this.GetOverlap(N.Pt.X,Y.Pt.X,K.Pt.X,_.Pt.X,wt))return!1;var Lt=wt.Left,Bt=wt.Right,Yt=new e.IntPoint0(),Ht;return N.Pt.X>=Lt&&N.Pt.X<=Bt?(Yt.X=N.Pt.X,Yt.Y=N.Pt.Y,e.use_xyz&&(Yt.Z=N.Pt.Z),Ht=N.Pt.X>Y.Pt.X):K.Pt.X>=Lt&&K.Pt.X<=Bt?(Yt.X=K.Pt.X,Yt.Y=K.Pt.Y,e.use_xyz&&(Yt.Z=K.Pt.Z),Ht=K.Pt.X>_.Pt.X):Y.Pt.X>=Lt&&Y.Pt.X<=Bt?(Yt.X=Y.Pt.X,Yt.Y=Y.Pt.Y,e.use_xyz&&(Yt.Z=Y.Pt.Z),Ht=Y.Pt.X>N.Pt.X):(Yt.X=_.Pt.X,Yt.Y=_.Pt.Y,e.use_xyz&&(Yt.Z=_.Pt.Z),Ht=_.Pt.X>K.Pt.X),s.OutPt1=N,s.OutPt2=K,this.JoinHorz(N,Y,K,_,Yt,Ht);}else{for(Y=N.Next;e.IntPoint.op_Equality(Y.Pt,N.Pt)&&Y!==N;)Y=Y.Next;var kt=Y.Pt.Y>N.Pt.Y||!e.ClipperBase.SlopesEqual4(N.Pt,Y.Pt,s.OffPt,this.m_UseFullRange);if(kt){for(Y=N.Prev;e.IntPoint.op_Equality(Y.Pt,N.Pt)&&Y!==N;)Y=Y.Prev;if(Y.Pt.Y>N.Pt.Y||!e.ClipperBase.SlopesEqual4(N.Pt,Y.Pt,s.OffPt,this.m_UseFullRange))return!1;}for(_=K.Next;e.IntPoint.op_Equality(_.Pt,K.Pt)&&_!==K;)_=_.Next;var ee=_.Pt.Y>K.Pt.Y||!e.ClipperBase.SlopesEqual4(K.Pt,_.Pt,s.OffPt,this.m_UseFullRange);if(ee){for(_=K.Prev;e.IntPoint.op_Equality(_.Pt,K.Pt)&&_!==K;)_=_.Prev;if(_.Pt.Y>K.Pt.Y||!e.ClipperBase.SlopesEqual4(K.Pt,_.Pt,s.OffPt,this.m_UseFullRange))return!1;}return Y===N||_===K||Y===_||v===I&&kt===ee?!1:kt?(Y=this.DupOutPt(N,!1),_=this.DupOutPt(K,!0),N.Prev=K,K.Next=N,Y.Next=_,_.Prev=Y,s.OutPt1=N,s.OutPt2=Y,!0):(Y=this.DupOutPt(N,!0),_=this.DupOutPt(K,!1),N.Next=K,K.Prev=N,Y.Prev=_,_.Next=Y,s.OutPt1=N,s.OutPt2=Y,!0);}},e.Clipper.GetBounds=function(s){for(var v=0,I=s.length;v<I&&s[v].length===0;)v++;if(v===I)return new e.IntRect(0,0,0,0);var N=new e.IntRect();for(N.left=s[v][0].X,N.right=N.left,N.top=s[v][0].Y,N.bottom=N.top;v<I;v++)for(var Y=0,K=s[v].length;Y<K;Y++)s[v][Y].X<N.left?N.left=s[v][Y].X:s[v][Y].X>N.right&&(N.right=s[v][Y].X),s[v][Y].Y<N.top?N.top=s[v][Y].Y:s[v][Y].Y>N.bottom&&(N.bottom=s[v][Y].Y);return N;},e.Clipper.prototype.GetBounds2=function(s){var v=s,I=new e.IntRect();for(I.left=s.Pt.X,I.right=s.Pt.X,I.top=s.Pt.Y,I.bottom=s.Pt.Y,s=s.Next;s!==v;)s.Pt.X<I.left&&(I.left=s.Pt.X),s.Pt.X>I.right&&(I.right=s.Pt.X),s.Pt.Y<I.top&&(I.top=s.Pt.Y),s.Pt.Y>I.bottom&&(I.bottom=s.Pt.Y),s=s.Next;return I;},e.Clipper.PointInPolygon=function(s,v){var I=0,N=v.length;if(N<3)return 0;for(var Y=v[0],K=1;K<=N;++K){var _=K===N?v[0]:v[K];if(_.Y===s.Y&&(_.X===s.X||Y.Y===s.Y&&_.X>s.X==Y.X<s.X))return-1;if(Y.Y<s.Y!=_.Y<s.Y){if(Y.X>=s.X){if(_.X>s.X)I=1-I;else{var ft=(Y.X-s.X)*(_.Y-s.Y)-(_.X-s.X)*(Y.Y-s.Y);if(ft===0)return-1;ft>0==_.Y>Y.Y&&(I=1-I);}}else if(_.X>s.X){var ft=(Y.X-s.X)*(_.Y-s.Y)-(_.X-s.X)*(Y.Y-s.Y);if(ft===0)return-1;ft>0==_.Y>Y.Y&&(I=1-I);}}Y=_;}return I;},e.Clipper.prototype.PointInPolygon=function(s,v){var I=0,N=v,Y=s.X,K=s.Y,_=v.Pt.X,ft=v.Pt.Y;do{v=v.Next;var ht=v.Pt.X,It=v.Pt.Y;if(It===K&&(ht===Y||ft===K&&ht>Y==_<Y))return-1;if(ft<K!=It<K){if(_>=Y){if(ht>Y)I=1-I;else{var wt=(_-Y)*(It-K)-(ht-Y)*(ft-K);if(wt===0)return-1;wt>0==It>ft&&(I=1-I);}}else if(ht>Y){var wt=(_-Y)*(It-K)-(ht-Y)*(ft-K);if(wt===0)return-1;wt>0==It>ft&&(I=1-I);}}_=ht,ft=It;}while(N!==v);return I;},e.Clipper.prototype.Poly2ContainsPoly1=function(s,v){var I=s;do{var N=this.PointInPolygon(I.Pt,v);if(N>=0)return N>0;I=I.Next;}while(I!==s);return!0;},e.Clipper.prototype.FixupFirstLefts1=function(s,v){for(var I,N,Y=0,K=this.m_PolyOuts.length;Y<K;Y++)I=this.m_PolyOuts[Y],N=e.Clipper.ParseFirstLeft(I.FirstLeft),I.Pts!==null&&N===s&&this.Poly2ContainsPoly1(I.Pts,v.Pts)&&(I.FirstLeft=v);},e.Clipper.prototype.FixupFirstLefts2=function(s,v){for(var I=v.FirstLeft,N,Y,K=0,_=this.m_PolyOuts.length;K<_;K++)N=this.m_PolyOuts[K],!(N.Pts===null||N===v||N===s)&&(Y=e.Clipper.ParseFirstLeft(N.FirstLeft),!(Y!==I&&Y!==s&&Y!==v)&&(this.Poly2ContainsPoly1(N.Pts,s.Pts)?N.FirstLeft=s:this.Poly2ContainsPoly1(N.Pts,v.Pts)?N.FirstLeft=v:(N.FirstLeft===s||N.FirstLeft===v)&&(N.FirstLeft=I)));},e.Clipper.prototype.FixupFirstLefts3=function(s,v){for(var I,N,Y=0,K=this.m_PolyOuts.length;Y<K;Y++)I=this.m_PolyOuts[Y],N=e.Clipper.ParseFirstLeft(I.FirstLeft),I.Pts!==null&&N===s&&(I.FirstLeft=v);},e.Clipper.ParseFirstLeft=function(s){for(;s!==null&&s.Pts===null;)s=s.FirstLeft;return s;},e.Clipper.prototype.JoinCommonEdges=function(){for(var s=0,v=this.m_Joins.length;s<v;s++){var I=this.m_Joins[s],N=this.GetOutRec(I.OutPt1.Idx),Y=this.GetOutRec(I.OutPt2.Idx);if(!(N.Pts===null||Y.Pts===null)&&!(N.IsOpen||Y.IsOpen)){var K;N===Y?K=N:this.OutRec1RightOfOutRec2(N,Y)?K=Y:this.OutRec1RightOfOutRec2(Y,N)?K=N:K=this.GetLowermostRec(N,Y),this.JoinPoints(I,N,Y)&&(N===Y?(N.Pts=I.OutPt1,N.BottomPt=null,Y=this.CreateOutRec(),Y.Pts=I.OutPt2,this.UpdateOutPtIdxs(Y),this.Poly2ContainsPoly1(Y.Pts,N.Pts)?(Y.IsHole=!N.IsHole,Y.FirstLeft=N,this.m_UsingPolyTree&&this.FixupFirstLefts2(Y,N),(Y.IsHole^this.ReverseSolution)==this.Area$1(Y)>0&&this.ReversePolyPtLinks(Y.Pts)):this.Poly2ContainsPoly1(N.Pts,Y.Pts)?(Y.IsHole=N.IsHole,N.IsHole=!Y.IsHole,Y.FirstLeft=N.FirstLeft,N.FirstLeft=Y,this.m_UsingPolyTree&&this.FixupFirstLefts2(N,Y),(N.IsHole^this.ReverseSolution)==this.Area$1(N)>0&&this.ReversePolyPtLinks(N.Pts)):(Y.IsHole=N.IsHole,Y.FirstLeft=N.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(N,Y))):(Y.Pts=null,Y.BottomPt=null,Y.Idx=N.Idx,N.IsHole=K.IsHole,K===Y&&(N.FirstLeft=Y.FirstLeft),Y.FirstLeft=N,this.m_UsingPolyTree&&this.FixupFirstLefts3(Y,N)));}}},e.Clipper.prototype.UpdateOutPtIdxs=function(s){var v=s.Pts;do v.Idx=s.Idx,v=v.Prev;while(v!==s.Pts);},e.Clipper.prototype.DoSimplePolygons=function(){for(var s=0;s<this.m_PolyOuts.length;){var v=this.m_PolyOuts[s++],I=v.Pts;if(!(I===null||v.IsOpen))do{for(var N=I.Next;N!==v.Pts;){if(e.IntPoint.op_Equality(I.Pt,N.Pt)&&N.Next!==I&&N.Prev!==I){var Y=I.Prev,K=N.Prev;I.Prev=K,K.Next=I,N.Prev=Y,Y.Next=N,v.Pts=I;var _=this.CreateOutRec();_.Pts=N,this.UpdateOutPtIdxs(_),this.Poly2ContainsPoly1(_.Pts,v.Pts)?(_.IsHole=!v.IsHole,_.FirstLeft=v,this.m_UsingPolyTree&&this.FixupFirstLefts2(_,v)):this.Poly2ContainsPoly1(v.Pts,_.Pts)?(_.IsHole=v.IsHole,v.IsHole=!_.IsHole,_.FirstLeft=v.FirstLeft,v.FirstLeft=_,this.m_UsingPolyTree&&this.FixupFirstLefts2(v,_)):(_.IsHole=v.IsHole,_.FirstLeft=v.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(v,_)),N=I;}N=N.Next;}I=I.Next;}while(I!==v.Pts);}},e.Clipper.Area=function(s){if(!Array.isArray(s))return 0;var v=s.length;if(v<3)return 0;for(var I=0,N=0,Y=v-1;N<v;++N)I+=(s[Y].X+s[N].X)*(s[Y].Y-s[N].Y),Y=N;return-I*0.5;},e.Clipper.prototype.Area=function(s){var v=s;if(s===null)return 0;var I=0;do I=I+(s.Prev.Pt.X+s.Pt.X)*(s.Prev.Pt.Y-s.Pt.Y),s=s.Next;while(s!==v);return I*0.5;},e.Clipper.prototype.Area$1=function(s){return this.Area(s.Pts);},e.Clipper.SimplifyPolygon=function(s,v){var I=new Array(),N=new e.Clipper(0);return N.StrictlySimple=!0,N.AddPath(s,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,I,v,v),I;},e.Clipper.SimplifyPolygons=function(s,v){_typeof(v)>"u"&&(v=e.PolyFillType.pftEvenOdd);var I=new Array(),N=new e.Clipper(0);return N.StrictlySimple=!0,N.AddPaths(s,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,I,v,v),I;},e.Clipper.DistanceSqrd=function(s,v){var I=s.X-v.X,N=s.Y-v.Y;return I*I+N*N;},e.Clipper.DistanceFromLineSqrd=function(s,v,I){var N=v.Y-I.Y,Y=I.X-v.X,K=N*v.X+Y*v.Y;return K=N*s.X+Y*s.Y-K,K*K/(N*N+Y*Y);},e.Clipper.SlopesNearCollinear=function(s,v,I,N){return Math.abs(s.X-v.X)>Math.abs(s.Y-v.Y)?s.X>v.X==s.X<I.X?e.Clipper.DistanceFromLineSqrd(s,v,I)<N:v.X>s.X==v.X<I.X?e.Clipper.DistanceFromLineSqrd(v,s,I)<N:e.Clipper.DistanceFromLineSqrd(I,s,v)<N:s.Y>v.Y==s.Y<I.Y?e.Clipper.DistanceFromLineSqrd(s,v,I)<N:v.Y>s.Y==v.Y<I.Y?e.Clipper.DistanceFromLineSqrd(v,s,I)<N:e.Clipper.DistanceFromLineSqrd(I,s,v)<N;},e.Clipper.PointsAreClose=function(s,v,I){var N=s.X-v.X,Y=s.Y-v.Y;return N*N+Y*Y<=I;},e.Clipper.ExcludeOp=function(s){var v=s.Prev;return v.Next=s.Next,s.Next.Prev=v,v.Idx=0,v;},e.Clipper.CleanPolygon=function(s,v){_typeof(v)>"u"&&(v=1.415);var I=s.length;if(I===0)return new Array();for(var N=new Array(I),Y=0;Y<I;++Y)N[Y]=new e.OutPt();for(var Y=0;Y<I;++Y)N[Y].Pt=s[Y],N[Y].Next=N[(Y+1)%I],N[Y].Next.Prev=N[Y],N[Y].Idx=0;for(var K=v*v,_=N[0];_.Idx===0&&_.Next!==_.Prev;)e.Clipper.PointsAreClose(_.Pt,_.Prev.Pt,K)?(_=e.Clipper.ExcludeOp(_),I--):e.Clipper.PointsAreClose(_.Prev.Pt,_.Next.Pt,K)?(e.Clipper.ExcludeOp(_.Next),_=e.Clipper.ExcludeOp(_),I-=2):e.Clipper.SlopesNearCollinear(_.Prev.Pt,_.Pt,_.Next.Pt,K)?(_=e.Clipper.ExcludeOp(_),I--):(_.Idx=1,_=_.Next);I<3&&(I=0);for(var ft=new Array(I),Y=0;Y<I;++Y)ft[Y]=new e.IntPoint1(_.Pt),_=_.Next;return N=null,ft;},e.Clipper.CleanPolygons=function(s,v){for(var I=new Array(s.length),N=0,Y=s.length;N<Y;N++)I[N]=e.Clipper.CleanPolygon(s[N],v);return I;},e.Clipper.Minkowski=function(s,v,I,N){var Y=N?1:0,K=s.length,_=v.length,ft=new Array();if(I)for(var ht=0;ht<_;ht++){for(var It=new Array(K),wt=0,Lt=s.length,Bt=s[wt];wt<Lt;wt++,Bt=s[wt])It[wt]=new e.IntPoint2(v[ht].X+Bt.X,v[ht].Y+Bt.Y);ft.push(It);}else for(var ht=0;ht<_;ht++){for(var It=new Array(K),wt=0,Lt=s.length,Bt=s[wt];wt<Lt;wt++,Bt=s[wt])It[wt]=new e.IntPoint2(v[ht].X-Bt.X,v[ht].Y-Bt.Y);ft.push(It);}for(var Yt=new Array(),ht=0;ht<_-1+Y;ht++)for(var wt=0;wt<K;wt++){var Ht=new Array();Ht.push(ft[ht%_][wt%K]),Ht.push(ft[(ht+1)%_][wt%K]),Ht.push(ft[(ht+1)%_][(wt+1)%K]),Ht.push(ft[ht%_][(wt+1)%K]),e.Clipper.Orientation(Ht)||Ht.reverse(),Yt.push(Ht);}return Yt;},e.Clipper.MinkowskiSum=function(s,v,I){if(v[0]instanceof Array){for(var Y=v,_=new e.Paths(),K=new e.Clipper(),ft=0;ft<Y.length;++ft){var ht=e.Clipper.Minkowski(s,Y[ft],!0,I);if(K.AddPaths(ht,e.PolyType.ptSubject,!0),I){var N=e.Clipper.TranslatePath(Y[ft],s[0]);K.AddPath(N,e.PolyType.ptClip,!0);}}return K.Execute(e.ClipType.ctUnion,_,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),_;}else{var N=v,Y=e.Clipper.Minkowski(s,N,!0,I),K=new e.Clipper();return K.AddPaths(Y,e.PolyType.ptSubject,!0),K.Execute(e.ClipType.ctUnion,Y,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),Y;}},e.Clipper.TranslatePath=function(s,v){for(var I=new e.Path(),N=0;N<s.length;N++)I.push(new e.IntPoint2(s[N].X+v.X,s[N].Y+v.Y));return I;},e.Clipper.MinkowskiDiff=function(s,v){var I=e.Clipper.Minkowski(s,v,!1,!0),N=new e.Clipper();return N.AddPaths(I,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),I;},e.Clipper.PolyTreeToPaths=function(s){var v=new Array();return e.Clipper.AddPolyNodeToPaths(s,e.Clipper.NodeType.ntAny,v),v;},e.Clipper.AddPolyNodeToPaths=function(s,v,I){var N=!0;switch(v){case e.Clipper.NodeType.ntOpen:return;case e.Clipper.NodeType.ntClosed:N=!s.IsOpen;break;}s.m_polygon.length>0&&N&&I.push(s.m_polygon);for(var Y=0,K=s.Childs(),_=K.length,ft=K[Y];Y<_;Y++,ft=K[Y])e.Clipper.AddPolyNodeToPaths(ft,v,I);},e.Clipper.OpenPathsFromPolyTree=function(s){for(var v=new e.Paths(),I=0,N=s.ChildCount();I<N;I++)s.Childs()[I].IsOpen&&v.push(s.Childs()[I].m_polygon);return v;},e.Clipper.ClosedPathsFromPolyTree=function(s){var v=new e.Paths();return e.Clipper.AddPolyNodeToPaths(s,e.Clipper.NodeType.ntClosed,v),v;},gn(e.Clipper,e.ClipperBase),e.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},e.ClipperOffset=function(s,v){_typeof(s)>"u"&&(s=2),_typeof(v)>"u"&&(v=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=s,this.ArcTolerance=v,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(s,v,I){var N=s.length-1;if(!(N<0)){var Y=new e.PolyNode();if(Y.m_jointype=v,Y.m_endtype=I,I===e.EndType.etClosedLine||I===e.EndType.etClosedPolygon)for(;N>0&&e.IntPoint.op_Equality(s[0],s[N]);)N--;Y.m_polygon.push(s[0]);for(var K=0,_=0,ft=1;ft<=N;ft++)e.IntPoint.op_Inequality(Y.m_polygon[K],s[ft])&&(K++,Y.m_polygon.push(s[ft]),(s[ft].Y>Y.m_polygon[_].Y||s[ft].Y===Y.m_polygon[_].Y&&s[ft].X<Y.m_polygon[_].X)&&(_=K));if(!(I===e.EndType.etClosedPolygon&&K<2)&&(this.m_polyNodes.AddChild(Y),I===e.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,_);else{var ht=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(Y.m_polygon[_].Y>ht.Y||Y.m_polygon[_].Y===ht.Y&&Y.m_polygon[_].X<ht.X)&&(this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,_));}}},e.ClipperOffset.prototype.AddPaths=function(s,v,I){for(var N=0,Y=s.length;N<Y;N++)this.AddPath(s[N],v,I);},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 s=0;s<this.m_polyNodes.ChildCount();s++){var v=this.m_polyNodes.Childs()[s];(v.m_endtype===e.EndType.etClosedPolygon||v.m_endtype===e.EndType.etClosedLine&&e.Clipper.Orientation(v.m_polygon))&&v.m_polygon.reverse();}else for(var s=0;s<this.m_polyNodes.ChildCount();s++){var v=this.m_polyNodes.Childs()[s];v.m_endtype===e.EndType.etClosedLine&&!e.Clipper.Orientation(v.m_polygon)&&v.m_polygon.reverse();}},e.ClipperOffset.GetUnitNormal=function(s,v){var I=v.X-s.X,N=v.Y-s.Y;if(I===0&&N===0)return new e.DoublePoint2(0,0);var Y=1/Math.sqrt(I*I+N*N);return I*=Y,N*=Y,new e.DoublePoint2(N,-I);},e.ClipperOffset.prototype.DoOffset=function(s){if(this.m_destPolys=new Array(),this.m_delta=s,e.ClipperBase.near_zero(s)){for(var v=0;v<this.m_polyNodes.ChildCount();v++){var I=this.m_polyNodes.Childs()[v];I.m_endtype===e.EndType.etClosedPolygon&&this.m_destPolys.push(I.m_polygon);}return;}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=0.5;var N;this.ArcTolerance<=0?N=e.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(s)*e.ClipperOffset.def_arc_tolerance?N=Math.abs(s)*e.ClipperOffset.def_arc_tolerance:N=this.ArcTolerance;var Y=3.14159265358979/Math.acos(1-N/Math.abs(s));this.m_sin=Math.sin(e.ClipperOffset.two_pi/Y),this.m_cos=Math.cos(e.ClipperOffset.two_pi/Y),this.m_StepsPerRad=Y/e.ClipperOffset.two_pi,s<0&&(this.m_sin=-this.m_sin);for(var v=0;v<this.m_polyNodes.ChildCount();v++){var I=this.m_polyNodes.Childs()[v];this.m_srcPoly=I.m_polygon;var K=this.m_srcPoly.length;if(!(K===0||s<=0&&(K<3||I.m_endtype!==e.EndType.etClosedPolygon))){if(this.m_destPoly=new Array(),K===1){if(I.m_jointype===e.JoinType.jtRound)for(var _=1,ft=0,ht=1;ht<=Y;ht++){this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+_*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y+ft*s)));var It=_;_=_*this.m_cos-this.m_sin*ft,ft=It*this.m_sin+ft*this.m_cos;}else for(var _=-1,ft=-1,ht=0;ht<4;++ht)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+_*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y+ft*s))),_<0?_=1:ft<0?ft=1:_=-1;this.m_destPolys.push(this.m_destPoly);continue;}this.m_normals.length=0;for(var ht=0;ht<K-1;ht++)this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[ht],this.m_srcPoly[ht+1]));if(I.m_endtype===e.EndType.etClosedLine||I.m_endtype===e.EndType.etClosedPolygon?this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[K-1],this.m_srcPoly[0])):this.m_normals.push(new e.DoublePoint1(this.m_normals[K-2])),I.m_endtype===e.EndType.etClosedPolygon){for(var wt=K-1,ht=0;ht<K;ht++)wt=this.OffsetPoint(ht,wt,I.m_jointype);this.m_destPolys.push(this.m_destPoly);}else if(I.m_endtype===e.EndType.etClosedLine){for(var wt=K-1,ht=0;ht<K;ht++)wt=this.OffsetPoint(ht,wt,I.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array();for(var Lt=this.m_normals[K-1],ht=K-1;ht>0;ht--)this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht-1].X,-this.m_normals[ht-1].Y);this.m_normals[0]=new e.DoublePoint2(-Lt.X,-Lt.Y),wt=0;for(var ht=K-1;ht>=0;ht--)wt=this.OffsetPoint(ht,wt,I.m_jointype);this.m_destPolys.push(this.m_destPoly);}else{for(var wt=0,ht=1;ht<K-1;++ht)wt=this.OffsetPoint(ht,wt,I.m_jointype);var Bt;if(I.m_endtype===e.EndType.etOpenButt){var ht=K-1;Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[ht].X+this.m_normals[ht].X*s),e.ClipperOffset.Round(this.m_srcPoly[ht].Y+this.m_normals[ht].Y*s)),this.m_destPoly.push(Bt),Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[ht].X-this.m_normals[ht].X*s),e.ClipperOffset.Round(this.m_srcPoly[ht].Y-this.m_normals[ht].Y*s)),this.m_destPoly.push(Bt);}else{var ht=K-1;wt=K-2,this.m_sinA=0,this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht].X,-this.m_normals[ht].Y),I.m_endtype===e.EndType.etOpenSquare?this.DoSquare(ht,wt):this.DoRound(ht,wt);}for(var ht=K-1;ht>0;ht--)this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht-1].X,-this.m_normals[ht-1].Y);this.m_normals[0]=new e.DoublePoint2(-this.m_normals[1].X,-this.m_normals[1].Y),wt=K-1;for(var ht=wt-1;ht>0;--ht)wt=this.OffsetPoint(ht,wt,I.m_jointype);I.m_endtype===e.EndType.etOpenButt?(Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*s)),this.m_destPoly.push(Bt),Bt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*s)),this.m_destPoly.push(Bt)):(wt=1,this.m_sinA=0,I.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 s=arguments,v=s[0]instanceof e.PolyTree;if(v){var I=s[0],N=s[1];I.Clear(),this.FixOrientations(),this.DoOffset(N);var Y=new e.Clipper(0);if(Y.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),N>0)Y.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var K=e.Clipper.GetBounds(this.m_destPolys),_=new e.Path();if(_.push(new e.IntPoint2(K.left-10,K.bottom+10)),_.push(new e.IntPoint2(K.right+10,K.bottom+10)),_.push(new e.IntPoint2(K.right+10,K.top-10)),_.push(new e.IntPoint2(K.left-10,K.top-10)),Y.AddPath(_,e.PolyType.ptSubject,!0),Y.ReverseSolution=!0,Y.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),I.ChildCount()===1&&I.Childs()[0].ChildCount()>0){var ft=I.Childs()[0];I.Childs()[0]=ft.Childs()[0],I.Childs()[0].m_Parent=I;for(var ht=1;ht<ft.ChildCount();ht++)I.AddChild(ft.Childs()[ht]);}else I.Clear();}}else{var I=s[0],N=s[1];e.Clear(I),this.FixOrientations(),this.DoOffset(N);var Y=new e.Clipper(0);if(Y.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),N>0)Y.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var K=e.Clipper.GetBounds(this.m_destPolys),_=new e.Path();_.push(new e.IntPoint2(K.left-10,K.bottom+10)),_.push(new e.IntPoint2(K.right+10,K.bottom+10)),_.push(new e.IntPoint2(K.right+10,K.top-10)),_.push(new e.IntPoint2(K.left-10,K.top-10)),Y.AddPath(_,e.PolyType.ptSubject,!0),Y.ReverseSolution=!0,Y.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),I.length>0&&I.splice(0,1);}}},e.ClipperOffset.prototype.OffsetPoint=function(s,v,I){if(this.m_sinA=this.m_normals[v].X*this.m_normals[s].Y-this.m_normals[s].X*this.m_normals[v].Y,Math.abs(this.m_sinA*this.m_delta)<1){var N=this.m_normals[v].X*this.m_normals[s].X+this.m_normals[s].Y*this.m_normals[v].Y;if(N>0)return this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_normals[v].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[v].Y*this.m_delta))),v;}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[s].X+this.m_normals[v].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[v].Y*this.m_delta))),this.m_destPoly.push(new e.IntPoint1(this.m_srcPoly[s])),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_normals[s].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[s].Y*this.m_delta)));else switch(I){case e.JoinType.jtMiter:{var Y=1+(this.m_normals[s].X*this.m_normals[v].X+this.m_normals[s].Y*this.m_normals[v].Y);Y>=this.m_miterLim?this.DoMiter(s,v,Y):this.DoSquare(s,v);break;}case e.JoinType.jtSquare:this.DoSquare(s,v);break;case e.JoinType.jtRound:this.DoRound(s,v);break;}return v=s,v;},e.ClipperOffset.prototype.DoSquare=function(s,v){var I=Math.tan(Math.atan2(this.m_sinA,this.m_normals[v].X*this.m_normals[s].X+this.m_normals[v].Y*this.m_normals[s].Y)/4);this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_delta*(this.m_normals[v].X-this.m_normals[v].Y*I)),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_delta*(this.m_normals[v].Y+this.m_normals[v].X*I)))),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_delta*(this.m_normals[s].X+this.m_normals[s].Y*I)),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_delta*(this.m_normals[s].Y-this.m_normals[s].X*I))));},e.ClipperOffset.prototype.DoMiter=function(s,v,I){var N=this.m_delta/I;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+(this.m_normals[v].X+this.m_normals[s].X)*N),e.ClipperOffset.Round(this.m_srcPoly[s].Y+(this.m_normals[v].Y+this.m_normals[s].Y)*N)));},e.ClipperOffset.prototype.DoRound=function(s,v){for(var I=Math.atan2(this.m_sinA,this.m_normals[v].X*this.m_normals[s].X+this.m_normals[v].Y*this.m_normals[s].Y),N=Math.max(e.Cast_Int32(e.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(I))),1),Y=this.m_normals[v].X,K=this.m_normals[v].Y,_,ft=0;ft<N;++ft)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+Y*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+K*this.m_delta))),_=Y,Y=Y*this.m_cos-this.m_sin*K,K=_*this.m_sin+K*this.m_cos;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_normals[s].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[s].Y*this.m_delta)));},e.Error=function(s){try{throw new Error(s);}catch(v){alert(v.message);}},e.JS={},e.JS.AreaOfPolygon=function(s,v){return v||(v=1),e.Clipper.Area(s)/(v*v);},e.JS.AreaOfPolygons=function(s,v){v||(v=1);for(var I=0,N=0;N<s.length;N++)I+=e.Clipper.Area(s[N]);return I/(v*v);},e.JS.BoundsOfPath=function(s,v){return e.JS.BoundsOfPaths([s],v);},e.JS.BoundsOfPaths=function(s,v){v||(v=1);var I=e.Clipper.GetBounds(s);return I.left/=v,I.bottom/=v,I.right/=v,I.top/=v,I;},e.JS.Clean=function(N,v){if(!(N instanceof Array))return[];var I=N[0]instanceof Array,N=e.JS.Clone(N);if(typeof v!="number"||v===null)return e.Error("Delta is not a number in Clean()."),N;if(N.length===0||N.length===1&&N[0].length===0||v<0)return N;I||(N=[N]);for(var Y=N.length,K,_,ft,ht,It,wt,Lt,Bt=[],Yt=0;Yt<Y;Yt++)if(_=N[Yt],K=_.length,K!==0){if(K<3){ft=_,Bt.push(ft);continue;}for(ft=_,ht=v*v,It=_[0],wt=1,Lt=1;Lt<K;Lt++)(_[Lt].X-It.X)*(_[Lt].X-It.X)+(_[Lt].Y-It.Y)*(_[Lt].Y-It.Y)<=ht||(ft[wt]=_[Lt],It=_[Lt],wt++);It=_[wt-1],(_[0].X-It.X)*(_[0].X-It.X)+(_[0].Y-It.Y)*(_[0].Y-It.Y)<=ht&&wt--,wt<K&&ft.splice(wt,K-wt),ft.length&&Bt.push(ft);}return!I&&Bt.length?Bt=Bt[0]:!I&&Bt.length===0?Bt=[]:I&&Bt.length===0&&(Bt=[[]]),Bt;},e.JS.Clone=function(s){if(!(s instanceof Array))return[];if(s.length===0)return[];if(s.length===1&&s[0].length===0)return[[]];var v=s[0]instanceof Array;v||(s=[s]);var I=s.length,N,Y,K,_,ft=new Array(I);for(Y=0;Y<I;Y++){for(N=s[Y].length,_=new Array(N),K=0;K<N;K++)_[K]={X:s[Y][K].X,Y:s[Y][K].Y};ft[Y]=_;}return v||(ft=ft[0]),ft;},e.JS.Lighten=function(s,v){if(!(s instanceof Array))return[];if(typeof v!="number"||v===null)return e.Error("Tolerance is not a number in Lighten()."),e.JS.Clone(s);if(s.length===0||s.length===1&&s[0].length===0||v<0)return e.JS.Clone(s);var I=s[0]instanceof Array;I||(s=[s]);var N,Y,K,_,ft,ht,It,wt,Lt,Bt,Yt,Ht,kt,ee,ve,Oe,Ye,Vs=s.length,Ks=v*v,Xe=[];for(N=0;N<Vs;N++)if(K=s[N],ht=K.length,ht!==0){for(_=0;_<1e6;_++){for(ft=[],ht=K.length,K[ht-1].X!==K[0].X||K[ht-1].Y!==K[0].Y?(Ht=1,K.push({X:K[0].X,Y:K[0].Y}),ht=K.length):Ht=0,Yt=[],Y=0;Y<ht-2;Y++)It=K[Y],Lt=K[Y+1],wt=K[Y+2],Oe=It.X,Ye=It.Y,kt=wt.X-Oe,ee=wt.Y-Ye,(kt!==0||ee!==0)&&(ve=((Lt.X-Oe)*kt+(Lt.Y-Ye)*ee)/(kt*kt+ee*ee),ve>1?(Oe=wt.X,Ye=wt.Y):ve>0&&(Oe+=kt*ve,Ye+=ee*ve)),kt=Lt.X-Oe,ee=Lt.Y-Ye,Bt=kt*kt+ee*ee,Bt<=Ks&&(Yt[Y+1]=1,Y++);for(ft.push({X:K[0].X,Y:K[0].Y}),Y=1;Y<ht-1;Y++)Yt[Y]||ft.push({X:K[Y].X,Y:K[Y].Y});if(ft.push({X:K[ht-1].X,Y:K[ht-1].Y}),Ht&&K.pop(),Yt.length)K=ft;else break;}ht=ft.length,ft[ht-1].X===ft[0].X&&ft[ht-1].Y===ft[0].Y&&ft.pop(),ft.length>2&&Xe.push(ft);}return I||(Xe=Xe[0]),_typeof(Xe)>"u"&&(Xe=[]),Xe;},e.JS.PerimeterOfPath=function(s,v,I){if(_typeof(s)>"u")return 0;var N=Math.sqrt,Y=0,K,_,ft=0,ht=0,It=0,wt=0,Lt=s.length;if(Lt<2)return 0;for(v&&(s[Lt]=s[0],Lt++);--Lt;)K=s[Lt],ft=K.X,ht=K.Y,_=s[Lt-1],It=_.X,wt=_.Y,Y+=N((ft-It)*(ft-It)+(ht-wt)*(ht-wt));return v&&s.pop(),Y/I;},e.JS.PerimeterOfPaths=function(s,v,I){I||(I=1);for(var N=0,Y=0;Y<s.length;Y++)N+=e.JS.PerimeterOfPath(s[Y],v,I);return N;},e.JS.ScaleDownPath=function(s,v){var I,N;for(v||(v=1),I=s.length;I--;)N=s[I],N.X=N.X/v,N.Y=N.Y/v;},e.JS.ScaleDownPaths=function(s,v){var I,N,Y;for(v||(v=1),I=s.length;I--;)for(N=s[I].length;N--;)Y=s[I][N],Y.X=Y.X/v,Y.Y=Y.Y/v;},e.JS.ScaleUpPath=function(s,v){var I,N,Y=Math.round;for(v||(v=1),I=s.length;I--;)N=s[I],N.X=Y(N.X*v),N.Y=Y(N.Y*v);},e.JS.ScaleUpPaths=function(s,v){var I,N,Y,K=Math.round;for(v||(v=1),I=s.length;I--;)for(N=s[I].length;N--;)Y=s[I][N],Y.X=K(Y.X*v),Y.Y=K(Y.Y*v);},e.ExPolygons=function(){return[];},e.ExPolygon=function(){this.outer=null,this.holes=null;},e.JS.AddOuterPolyNodeToExPolygons=function(s,v){var I=new e.ExPolygon();I.outer=s.Contour();var N=s.Childs(),Y=N.length;I.holes=new Array(Y);var K,_,ft,ht,It,wt;for(ft=0;ft<Y;ft++)for(K=N[ft],I.holes[ft]=K.Contour(),ht=0,It=K.Childs(),wt=It.length;ht<wt;ht++)_=It[ht],e.JS.AddOuterPolyNodeToExPolygons(_,v);v.push(I);},e.JS.ExPolygonsToPaths=function(s){var v,I,N,Y,K=new e.Paths();for(v=0,N=s.length;v<N;v++)for(K.push(s[v].outer),I=0,Y=s[v].holes.length;I<Y;I++)K.push(s[v].holes[I]);return K;},e.JS.PolyTreeToExPolygons=function(s){var v=new e.ExPolygons(),I,N,Y,K;for(N=0,Y=s.Childs(),K=Y.length;N<K;N++)I=Y[N],e.JS.AddOuterPolyNodeToExPolygons(I,v);return v;};})();})(zi);var Hp=zi.exports,Me=/* @__PURE__ */Ne(Hp);function $i(u,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(u[0]-e[0])<t&&Math.abs(u[1]-e[1])<t;}function kp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length===0)return[];var t=[[u[0][0],u[0][1]]];for(var r=1;r<u.length;r++)$i([u[r][0],u[r][1]],t[t.length-1],e)||t.push([u[r][0],u[r][1]]);return t;}function Vp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length<=2)return u;var t=u[0],r=u[u.length-1];return $i(t,r,e)?u.slice(0,-1):u;}function Kp(u){var e=u.reduce(function(r,n){return r+n[0];},0)/u.length,t=u.reduce(function(r,n){return r+n[1];},0)/u.length;return[e,t];}function Hn(u,e){return Math.atan2(e[1]-u[1],e[0]-u[0]);}function Zp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length<=2)return u;var t=[];var _iterator16=_createForOfIteratorHelper(u),_step16;try{var _loop3=function _loop3(){var n=_step16.value;t.some(function(l){return Math.abs(l[0]-n[0])<e&&Math.abs(l[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=Kp(t);return t.sort(function(n,i){var l=Hn(r,n),o=Hn(r,i);return l-o;});}function Jp(u,e){var t=e[0].x<e[e.length-1].x;return u.map(function(n){var l=n.map(function(o){var a=-1,f=1/0,g=0;for(var c=0;c<e.length;c++){var m=e[c],x=Math.sqrt(Math.pow(m.x-o[0],2)+Math.pow(m.y-o[1],2));x<f&&(f=x,a=c,g=m.z);}return{point:o,index:a,bestZ:g};}).sort(function(o,a){return o.index-a.index;}).map(function(o){return[].concat(_toConsumableArray(o.point),[o.bestZ]);});return t&&l[0][0]>l[l.length-1][0]||!t&&l[0][0]<l[l.length-1][0]?l.reverse():l;}).sort(function(n,i){var l=n[0][0],o=i[0][0];return t?l-o:o-l;});}function Qp(u,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var n=u.map(function(c){return[c.x,c.y];}),i=function i(c,m){return c.map(function(_ref166){var _ref167=_slicedToArray(_ref166,2),x=_ref167[0],M=_ref167[1];return{X:Math.round(x*m),Y:Math.round(M*m)};});},l=new Me.ClipperOffset();l.AddPath(i(n,1e3),Me.JoinType.jtRound,Me.EndType.etOpenButt);var o=[];l.Execute(o,1);var a=new Me.Clipper();a.AddPaths(o,Me.PolyType.ptSubject,!0),e.forEach(function(c){a.AddPath(i(c,1e3),Me.PolyType.ptClip,!0);});var f=new Me.Paths();a.Execute(Me.ClipType.ctDifference,f,Me.PolyFillType.pftNonZero,Me.PolyFillType.pftNonZero);var g=f.map(function(c){return Vp(Zp(kp(c.map(function(m){return[m.X/1e3,m.Y/1e3];}),t),t),t);}).filter(function(c){return c.length>=2;});return Jp(g,u);}var Gi=/*#__PURE__*/function(_Mt){function Gi(t){var _this62;_classCallCheck(this,Gi);_this62=_callSuper(this,Gi,[t]);at(_this62,"canRotate",!0);at(_this62,"scaleType",Qt.all);at(_this62,"toolsType",St.Pencil);at(_this62,"syncTimestamp");at(_this62,"syncIndex",0);at(_this62,"tmpPoints",[]);at(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */at(_this62,"uniThickness");at(_this62,"workOptions");at(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Gi,_Mt);return _createClass(Gi,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:dt.None};var r=this.transformDataAll(!0),n={name:t};var i;var l=this.drawLayer||this.fullLayer;return r.length&&(i=this.draw({attrs:n,tasks:r,replaceId:t,layer:l})),{rect:i,type:dt.DrawWork,dataType:bt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Gi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.drawCount,a=t.removeDrawCount,f=r.workId,g=r.syncUnitTime;g&&(this.syncUnitTime=g);var _this$transformData=this.transformData(r,!1),c=_this$transformData.tasks,m=_this$transformData.effects,x=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,x,Math.max(0,this.tmpPoints.length-2));var M={name:f,id:he(o)&&o.toString()||void 0};var S,P=!1;var T=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),c.length&&(c[0].taskId-this.syncTimestamp>this.syncUnitTime&&(P=!0,this.syncTimestamp=c[0].taskId,this.syncIndex=this.tmpPoints.length),i||l)){var p=n?this.fullLayer:this.drawLayer||this.fullLayer;S=this.draw({attrs:M,tasks:c,effects:m,layer:p,removeDrawCount:a});}if(i)return x>10&&this.tmpPoints.splice(0,x-10),{rect:S,type:dt.DrawWork,dataType:bt.Local};var h=[];return this.tmpPoints.slice(T).forEach(function(p){h.push(p.x,p.y,_this63.computRadius(p.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local,rect:S,op:P?h:void 0,index:P?T*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var g;var r=this.workId;if(t.data){var _t$data=t.data,c=_t$data.op,m=_t$data.workState;c!=null&&c.length&&m===Ft.Done&&this.workOptions.strokeType===Vt.Stroke&&this.updateTempPointsWithPressureWhenDone(c);}var n=this.transformDataAll(!0),i={name:r};var l;var o=this.fullLayer;if(n.length&&(l=this.draw({attrs:i,tasks:n,replaceId:r,layer:o})),this.tmpPoints.length<2)return this.replace(o,r),{type:dt.RemoveNode,removeIds:[r],rect:l};var a=[];this.tmpPoints.map(function(c){a.push(c.x,c.y,c.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var f=Te(a);return(g=this.vNodes)==null||g.setInfo(r,{rect:l,op:a,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:l&&Mt.getCenterPos(l,o)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:l,type:dt.FullWork,dataType:bt.Local,ops:f,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 c,m;var r=t.op,n=t.isFullWork,i=t.replaceId,_t$workState=t.workState,l=_t$workState===void 0?Ft.Done:_t$workState;this.tmpPoints.length=0;for(var x=0;x<r.length;x+=3){var M=new Dt(r[x],r[x+1],r[x+2]);if(this.tmpPoints.length>0){var S=this.tmpPoints[this.tmpPoints.length-1],P=ot.Sub(M,S).uni();M.setv(P);}this.tmpPoints.push(M);}if(this.tmpPoints.length<2)return;var o=this.transformDataAll(!0),a=(c=this.workId)==null?void 0:c.toString(),f={name:a};var g;if(a&&o.length){var _x30=n?this.fullLayer:this.drawLayer||this.fullLayer;g=this.draw({attrs:f,tasks:o,replaceId:i,layer:_x30,isDrawEraserlines:l===Ft.Done}),(m=this.vNodes)==null||m.setInfo(a,{rect:g,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:g&&Mt.getCenterPos(g,_x30)});}return g;}},{key:"computPencilPoints",value:function computPencilPoints(t){var _this64=this;var r=[],n=t.op,i=t.eraserPolylines,l=t.eraserThickness;this.tmpPoints.length=0;for(var a=0;a<n.length;a+=3){var f=new Dt(n[a],n[a+1],n[a+2]);if(this.tmpPoints.length>0){var g=this.tmpPoints[this.tmpPoints.length-1],c=ot.Sub(f,g).uni();f.setv(c);}this.tmpPoints.push(f);}if(this.tmpPoints.length<2)return;var o=this.transformDataAll(!0);if(o.length){var _loop4=function _loop4(){var _o$_a=o[_a5],f=_o$_a.pos,g=_o$_a.points,c=g.map(function(M){return M.point.addXY(f[0],f[1]);}),m=[];var _iterator17=_createForOfIteratorHelper(i),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var M=_step17.value;var S=[];for(var _T29=0;_T29<M.length;_T29+=2){var _h27=new Dt(M[_T29],M[_T29+1]);if(S.length>0){var p=S[S.length-1].point,d=ot.Sub(_h27,p).uni();_h27.setv(d);}S.push({point:_h27,radius:l});}var _this64$computStroke=_this64.computStroke(S,!1),P=_this64$computStroke.ps;m.push(P.map(function(T){return T.XY;}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}Qp(c,m,0.01).forEach(function(M){r.push(M.map(function(S){return[S[0],S[1],S[2]];}).flat(1));});};for(var _a5=0;_a5<o.length;_a5++){_loop4();}}return r;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(r,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this65=this;var r=t.attrs,n=t.tasks,i=t.replaceId,l=t.effects,o=t.layer,a=t.removeDrawCount,_t$isDrawEraserlines=t.isDrawEraserlines,f=_t$isDrawEraserlines===void 0?!0:_t$isDrawEraserlines,_this$workOptions=this.workOptions,g=_this$workOptions.strokeColor,c=_this$workOptions.strokeType,m=_this$workOptions.thickness,x=_this$workOptions.zIndex,M=_this$workOptions.scale,S=_this$workOptions.rotate,P=_this$workOptions.translate,T=_this$workOptions.eraserlines;l!=null&&l.size&&(l.forEach(function(E){var w;(w=o.getElementById(E+""))==null||w.remove();}),l.clear()),a&&this.removeDrawCountNodes(o,a);var h;var p=[],d=o.worldPosition,y=o.worldScaling;for(var E=0;E<n.length;E++){var _n$E=n[E],w=_n$E.pos,B=_n$E.points,_this$computDrawPoint=this.computDrawPoints(B),A=_this$computDrawPoint.ps,b=_this$computDrawPoint.rect;var W=void 0;var D=B.length===1;c===Vt.Stroke||D?W=Ee(A,!0):W=Ee(A,!1);var R={pos:w,d:W,fillColor:c===Vt.Stroke||D?g:void 0,lineDash:c===Vt.Dotted&&!D?[1,m*2]:c===Vt.LongDotted&&!D?[m,m*2]:void 0,strokeColor:g,lineCap:c===Vt.Stroke||D?void 0:"round",lineWidth:c===Vt.Stroke||D?0:m};h=Wt(h,{x:Math.floor((b.x+w[0])*y[0]+d[0]-Mt.SafeBorderPadding),y:Math.floor((b.y+w[1])*y[1]+d[1]-Mt.SafeBorderPadding),w:Math.floor(b.w*y[0]+2*Mt.SafeBorderPadding),h:Math.floor(b.h*y[1]+2*Mt.SafeBorderPadding)}),p.push(R);}M&&(r.scale=M),S&&(r.rotate=S),P&&(r.translate=P);var O=new de();if(h){this.centerPos=Mt.getCenterPos(h,o);var _E4=c===Vt.Stroke&&!T;O.attr(_objectSpread(_objectSpread({},r),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_E4?g:void 0,pos:this.centerPos,size:[(h.w-2*Mt.SafeBorderPadding)/y[0],(h.h-2*Mt.SafeBorderPadding)/y[1]],zIndex:x}));var _w5=p.map(function(B){return B.pos=[B.pos[0]-_this65.centerPos[0],B.pos[1]-_this65.centerPos[1]],new Ae(B);});O.append.apply(O,_toConsumableArray(_w5)),_E4&&O.seal(),T&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:O,eraserlines:T,pos:this.centerPos,layer:o},f)),this.replace(o,i,O);}if(M||S||P){var _E5=O==null?void 0:O.getBoundingClientRect();_E5&&(h={x:Math.floor(_E5.x-Mt.SafeBorderPadding),y:Math.floor(_E5.y-Mt.SafeBorderPadding),w:Math.floor(_E5.width+Mt.SafeBorderPadding*2),h:Math.floor(_E5.height+Mt.SafeBorderPadding*2)});}return this.isDelete&&O.setAttribute("opacity",0),h;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Vt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var r=this.workOptions.thickness;var n=t.map(function(i){return r=Math.max(r,i.radius),i.point;});return{ps:n,rect:qt(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=[],i=[];for(var a=0;a<t.length;a++){var _t$a=t[a],f=_t$a.point,g=_t$a.radius;var c=f.v;a===0&&t.length>1&&(c=t[a+1].point.v);var m=ot.Per(c).mul(g);n.push(Dt.Sub(f,m)),i.push(Dt.Add(f,m));}var l=t[t.length-1];if(r){var _a6=Dt.GetSemicircleStroke(l.point,n[n.length-1],-1,8),_f4=Dt.GetSemicircleStroke(t[0].point,i[0],-1,8),_g6=n.concat(_a6,i.reverse(),_f4);return{ps:_g6,rect:qt(_g6)};}var o=n.concat(i.reverse());return{ps:o,rect:qt(o)};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,i={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Dt.GetDotStroke(r,n,8),rect:i};}},{key:"transformData",value:function transformData(t,r){var n=t.op,i=t.workState;var l=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,a=_this$workOptions2.strokeType,f=_this$workOptions2.thickness,g=/* @__PURE__ */new Set();l=a===Vt.Stroke?this.updateTempPointsWithPressure(n,f,g):this.updateTempPoints(n,f,g);var c=r?this.tmpPoints:this.tmpPoints.slice(l);return o=this.getTaskPoints(c,f),{tasks:o,effects:g,consumeIndex:l};}return{tasks:o,consumeIndex:l};}/** 压力渐变公式 */},{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 c;var n=[];if(t.length===0)return[];var i=0,l=t[0].x,o=t[0].y,a=[l,o],f=[],g=t[0].t;for(;i<t.length;){var m=t[i],x=m.x-l,M=m.y-o,S=m.z,P=r?this.computRadius(S,r):S;if(f.push({point:new Dt(x,M,S,t[i].v),radius:P}),i>0&&i<t.length-1){var _T30=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_T30<60||_T30>300){var _h28=(c=f.pop())==null?void 0:c.point.clone();_h28&&n.push({taskId:g,pos:a,points:[].concat(_toConsumableArray(f),[{point:_h28,radius:P}])}),l=t[i].x,o=t[i].y,a=[l,o];var p=m.x-l,d=m.y-o;f=[{point:new Dt(p,d,S),radius:P}],g=Date.now();}}i++;}return n.push({taskId:g,pos:a,points:f}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,r,n){var i=Date.now(),l=this.tmpPoints.length;var o=l;for(var f=0;f<t.length;f+=2){o=Math.min(o,l);var g=this.tmpPoints.length,c=new Dt(t[f],t[f+1]);if(g===0){this.tmpPoints.push(c);continue;}var m=g-1,x=this.tmpPoints[m],M=ot.Sub(c,x).uni();if(c.isNear(x,r)){if(x.z<this.MAX_REPEAR){if(x.setz(Math.min(x.z+1,this.MAX_REPEAR)),o=Math.min(o,m),g>1){var _T31=g-1;for(;_T31>0;){var _h29=this.tmpPoints[_T31].distance(this.tmpPoints[_T31-1]),p=Math.max(this.tmpPoints[_T31].z-this.uniThickness*_h29,0);if(this.tmpPoints[_T31-1].z>=p)break;this.tmpPoints[_T31-1].setz(p),o=Math.min(o,_T31-1),_T31--;}}}else o=1/0;continue;}c.setv(M);var S=c.distance(x),P=Math.max(x.z-this.uniThickness*S,0);g>1&&ot.Equals(M,x.v,0.02)&&(P>0||x.z<=0)&&(n&&x.t&&n.add(x.t),this.tmpPoints.pop(),o=Math.min(m,o)),c.setz(P),this.tmpPoints.push(c);}if(o===1/0)return this.tmpPoints.length;var a=l;if(o===l){a=Math.max(a-1,0);var _f5=this.tmpPoints[a].t;_f5&&(n==null||n.add(_f5));}else{var _f6=l-1;for(a=o;_f6>=0;){var _g7=this.tmpPoints[_f6].t;if(_g7&&(n==null||n.add(_g7),_f6<=o)){a=_f6,_f6=-1;break;}_f6--;}}return this.tmpPoints[a].setT(i),a;}},{key:"updateTempPoints",value:function updateTempPoints(t,r,n){var f;var i=Date.now(),l=this.tmpPoints.length;var o=l;for(var g=0;g<t.length;g+=2){var c=this.tmpPoints.length,m=new Dt(t[g],t[g+1]);if(c===0){this.tmpPoints.push(m);continue;}var x=c-1,M=this.tmpPoints[x],S=ot.Sub(m,M).uni();if(m.isNear(M,r/2)){o=Math.min(x,o);continue;}ot.Equals(S,M.v,0.02)&&(n&&M.t&&n.add(M.t),this.tmpPoints.pop(),o=Math.min(x,o)),m.setv(S),this.tmpPoints.push(m);}var a=l;if(o===l){a=Math.max(a-1,0);var _g8=this.tmpPoints[a].t;_g8&&(n==null||n.add(_g8));}else{var _g9=Math.min(l-1,o);for(a=o;_g9>=0;){var _c4=(f=this.tmpPoints[_g9])==null?void 0:f.t;if(_c4&&(n==null||n.add(_c4),_g9<=o)){a=_g9,_g9=-1;break;}_g9--;}}return this.tmpPoints[a].setT(i),a;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var r=this.workOptions.thickness,n=t.length,i=this.getMinZ(r);for(var l=0;l<n;l+=2){var o=this.tmpPoints.length,a=new Dt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var f=o-1,g=this.tmpPoints[f],c=ot.Sub(a,g).uni(),m=a.distance(g);if(o>1&&g.z===i)break;if(a.isNear(g,r/2)){if(n<3&&g.z<this.MAX_REPEAR&&(g.setz(Math.min(g.z+1,this.MAX_REPEAR)),o>1)){var M=o-1;for(;M>0;){var S=this.tmpPoints[M].distance(this.tmpPoints[M-1]),P=Math.max(this.tmpPoints[M].z-this.uniThickness*S,-r/4);if(this.tmpPoints[M-1].z>=P)break;this.tmpPoints[M-1].setz(P),M--;}}continue;}a.setv(c);var x=Math.max(g.z-this.uniThickness*m,i);o>1&&ot.Equals(c,g.v,0.02)&&g.z<=0&&this.tmpPoints.pop(),a.setz(x),this.tmpPoints.push(a);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var f,g;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.strokeType,a=i.get(r.name);return l&&(r.tagName==="GROUP"?ym(r)?r.setAttribute("bgcolor",l):r.children.forEach(function(c){c.setAttribute("strokeColor",l),c.getAttribute("fillColor")&&c.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(f=a==null?void 0:a.opt)!=null&&f.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(g=a.opt)!=null&&g.strokeType&&(a.opt.strokeType=o),a&&i.setInfo(r.name,a),Mt.updateNodeOpt(t);}}]);}(Mt);var Hi=/*#__PURE__*/function(_Mt2){function Hi(t){var _this66;_classCallCheck(this,Hi);_this66=_callSuper(this,Hi,[t]);at(_this66,"toolsType",St.LaserPen);at(_this66,"canRotate",!1);at(_this66,"scaleType",Qt.none);at(_this66,"syncTimestamp");at(_this66,"syncIndex",0);at(_this66,"tmpPoints",[]);at(_this66,"workOptions");at(_this66,"consumeIndex",0);_this66.workOptions=t.toolsOpt,_this66.syncTimestamp=0;return _this66;}_inherits(Hi,_Mt2);return _createClass(Hi,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Hi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var r=t.data,n=t.isSubWorker,i=r.workId,l=r.op,o=r.syncUnitTime;if((l==null?void 0:l.length)===0)return{type:dt.None};if(o&&(this.syncUnitTime=o),this.updateTempPoints(l||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:dt.None};var _this$workOptions3=this.workOptions,a=_this$workOptions3.strokeColor,f=_this$workOptions3.thickness,g=_this$workOptions3.strokeType,c=qt(this.tmpPoints,f);var m=!1;var x=this.syncIndex,M=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var S={name:i==null?void 0:i.toString(),opacity:1,lineDash:g===Vt.Dotted?[1,f*2]:g===Vt.LongDotted?[f,f*2]:void 0,strokeColor:a,lineCap:"round",lineWidth:f,anchor:[0.5,0.5]},P=this.getTaskPoints(M);if(P.length){var _h30=Date.now();_h30-this.syncTimestamp>this.syncUnitTime&&(m=!0,this.syncTimestamp=_h30,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:S,tasks:P,isDot:!1,layer:this.drawLayer||this.fullLayer});}var T=[];return this.tmpPoints.slice(x).forEach(function(h){T.push(h.x,h.y);}),_objectSpread({rect:{x:c.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:c.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:c.w*this.fullLayer.worldScaling[0],h:c.h*this.fullLayer.worldScaling[1]},type:dt.DrawWork,dataType:bt.Local,op:m?T:void 0,index:m?x*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=(l=this.workId)==null?void 0:l.toString();var r;if(this.tmpPoints.length-1>this.consumeIndex){var o=this.tmpPoints.slice(this.consumeIndex);var a=o.length===1,_this$workOptions4=this.workOptions,f=_this$workOptions4.strokeColor,g=_this$workOptions4.thickness,c=_this$workOptions4.strokeType;if(a){var M=this.computDotStroke({point:o[0],radius:g/2});o=M.ps,r=M.rect;}else r=qt(this.tmpPoints,g);var m={name:t==null?void 0:t.toString(),fillColor:a?f:void 0,opacity:1,lineDash:c===Vt.Dotted&&!a?[1,g*2]:c===Vt.LongDotted&&!a?[g,g*2]:void 0,strokeColor:f,lineCap:a?void 0:"round",lineWidth:a?0:g,anchor:[0.5,0.5]},x=this.getTaskPoints(o);x.length&&this.draw({attrs:m,tasks:x,isDot:a,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.y);});var i=Te(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:dt.FullWork,dataType:bt.Local,ops:i,index:this.syncIndex*2},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var S;var r=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,l=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,a=_this$workOptions5.strokeType;if(!r.length){var P=qt(this.tmpPoints,o);return{x:P.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:P.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:P.w*this.fullLayer.worldScaling[0],h:P.h*this.fullLayer.worldScaling[1]};}var f=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var g,c=this.tmpPoints.slice(f);var m=c.length===1;if(m){var _P6=this.computDotStroke({point:c[0],radius:o/2});c=_P6.ps,g=_P6.rect;}else g=qt(this.tmpPoints,o);var x={name:(S=this.workId)==null?void 0:S.toString(),fillColor:m?l:void 0,opacity:1,lineDash:a===Vt.Dotted&&!m?[1,o*2]:a===Vt.LongDotted&&!m?[o,o*2]:void 0,strokeColor:l,lineCap:m?void 0:"round",lineWidth:m?0:o,anchor:[0.5,0.5]},M=this.getTaskPoints(c);if(M.length){var _P7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:x,tasks:M,isDot:m,replaceId:n,layer:_P7});}return{x:g.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:g.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:g.w*this.fullLayer.worldScaling[0],h:g.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,i={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Dt.GetDotStroke(r,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(r){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Dt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this67=this;var r,n,i,l,o,_iterator18,_step18,_loop5;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:r=t.attrs,n=t.tasks,i=t.isDot,l=t.layer,o=this.workOptions.duration;_iterator18=_createForOfIteratorHelper(n);_context23.prev=2;_loop5=/*#__PURE__*/_regeneratorRuntime().mark(function _loop5(){var a,f,g,c,m,_this67$workOptions,x,M,S,_l$getResolution,P,_T32;return _regeneratorRuntime().wrap(function _loop5$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:a=_step18.value;f=new Ae(),g=a.pos,c=a.points;i?m=Ee(c,!0):m=Ee(c,!1),f.attr(_objectSpread(_objectSpread({},r),{},{pos:g,d:m}));_this67$workOptions=_this67.workOptions,x=_this67$workOptions.vertex,M=_this67$workOptions.fragment;if(x&&M){S=l.renderer.createProgram({vertex:x,fragment:M}),_l$getResolution=l.getResolution(),P=_l$getResolution.width,_T32=_l$getResolution.height;f.setUniforms({u_time:0,u_resolution:[P,_T32]}),f.setProgram(S);}l.appendChild(f),f.transition(o).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){f.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(_x31){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var f;var r=[];if(t.length===0)return[];var n=0,i=t[0].x,l=t[0].y,o=[i,l],a=[];for(;n<t.length;){var g=t[n],c=g.x-i,m=g.y-l;if(a.push(new Dt(c,m)),n>0&&n<t.length-1){var x=t[n].getAngleByPoints(t[n-1],t[n+1]);if(x<60||x>300){var M=(f=a.pop())==null?void 0:f.clone();M&&r.push({pos:o,points:[].concat(_toConsumableArray(a),[M])}),i=t[n].x,l=t[n].y,o=[i,l];var S=g.x-i,P=g.y-l;a=[new Dt(S,P)];}}n++;}return r.push({pos:o,points:a}),r;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var r;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(i){if(i.name===t){var l=i.getBoundingClientRect();r=Wt(r,{x:l.x,y:l.y,w:l.width,h:l.height}),n.push(i);}}),n.length&&n.forEach(function(i){return i.remove();}),r;}}]);}(Mt);var qp=Sr;Sr.polyline=Sr;Sr.polygon=_p;function Sr(u,e,t){var r=u.length,n=Ge(u[0],e),i=[],l,o,a,f,g;for(t||(t=[]),l=1;l<r;l++){for(o=u[l-1],a=u[l],f=g=Ge(a,e);;)if(n|f){if(n&f)break;n?(o=Vr(o,a,n,e),n=Ge(o,e)):(a=Vr(o,a,f,e),f=Ge(a,e));}else{i.push(o),f!==g?(i.push(a),l<r-1&&(t.push(i),i=[])):l===r-1&&i.push(a);break;}n=g;}return i.length&&t.push(i),t;}function _p(u,e){var t,r,n,i,l,o,a;for(r=1;r<=8;r*=2){for(t=[],n=u[u.length-1],i=!(Ge(n,e)&r),l=0;l<u.length;l++)o=u[l],a=!(Ge(o,e)&r),a!==i&&t.push(Vr(n,o,r,e)),a&&t.push(o),n=o,i=a;if(u=t,!u.length)break;}return t;}function Vr(u,e,t,r){return t&8?[u[0]+(e[0]-u[0])*(r[3]-u[1])/(e[1]-u[1]),r[3]]:// top
404
+ t&4?[u[0]+(e[0]-u[0])*(r[1]-u[1])/(e[1]-u[1]),r[1]]:// bottom
405
+ t&2?[r[2],u[1]+(e[1]-u[1])*(r[2]-u[0])/(e[0]-u[0])]:// right
406
+ t&1?[r[0],u[1]+(e[1]-u[1])*(r[0]-u[0])/(e[0]-u[0])]:// left
407
+ null;}function Ge(u,e){var t=0;return u[0]<e[0]?t|=1:u[0]>e[2]&&(t|=2),u[1]<e[1]?t|=4:u[1]>e[3]&&(t|=8),t;}var fn=/* @__PURE__ */Ne(qp);var ke=/*#__PURE__*/function(_Mt3){function ke(t,r){var _this68;_classCallCheck(this,ke);_this68=_callSuper(this,ke,[t]);at(_this68,"canRotate",!1);at(_this68,"scaleType",Qt.none);at(_this68,"toolsType",St.Eraser);at(_this68,"serviceWork");at(_this68,"tmpPoints",[]);at(_this68,"workOptions");at(_this68,"worldPosition");at(_this68,"worldScaling");at(_this68,"eraserRect");at(_this68,"eraserPolyline");_this68.serviceWork=r,_this68.workOptions=t.toolsOpt,_this68.worldPosition=_this68.fullLayer.worldPosition,_this68.worldScaling=_this68.fullLayer.worldScaling;return _this68;}_inherits(ke,_Mt3);return _createClass(ke,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(ke,"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],_ke$eraserSizes$this$=ke.eraserSizes[this.workOptions.thickness],i=_ke$eraserSizes$this$.width,l=_ke$eraserSizes$this$.height;this.eraserRect={x:r-i*0.5,y:n-l*0.5,w:i,h:l},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 ot(this.tmpPoints[0],this.tmpPoints[1]),n=new ot(this.tmpPoints[2],this.tmpPoints[3]),i=ot.Sub(n,r).uni(),l=ot.Dist(r,n),_ke$eraserSizes$this$2=ke.eraserSizes[this.workOptions.thickness],o=_ke$eraserSizes$this$2.width,a=_ke$eraserSizes$this$2.height,f=Math.min(o,a),g=Math.round(l/f);if(g>1){var c=[];for(var m=0;m<g;m++){var x=ot.Mul(i,m*f);c.push(this.tmpPoints[0]+x.x,this.tmpPoints[1]+x.y);}return c.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,r){var n=new ot(t[0],t[1]),i=new ot(r[0],r[1]),_ke$eraserSizes$this$3=ke.eraserSizes[this.workOptions.thickness],l=_ke$eraserSizes$this$3.width,o=_ke$eraserSizes$this$3.height;return ot.Dist(n,i)<Math.hypot(l,o)*0.5;}},{key:"remove",value:function remove(t){var _this69=this;var r=t.curNodeMap,n=t.removeIds;var i;var _iterator19=_createForOfIteratorHelper(r.values()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var l=_step19.value;if(l.rect&&this.eraserRect&&this.eraserPolyline&&Kr(this.eraserRect,l.rect)){var o=l.op,a=[],f=[];for(var c=0;c<o.length;c+=3){var m=new ot(o[c]*this.worldScaling[0]+this.worldPosition[0],o[c+1]*this.worldScaling[1]+this.worldPosition[1],o[c+2]);f.push(m),a.push(new Dt(m.x,m.y));}var g=a.length&&qt(a)||l.rect;Kr(g,this.eraserRect)&&(f.length>1?fn.polyline(f.map(function(m){return m.XY;}),this.eraserPolyline).length&&n.add(l.name):n.add(l.name),i=Wt(i,l.rect||g));}}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return n.forEach(function(l){var a;var o=_this69.fullLayer.getElementsByName(l);o[0]&&(o[0].remove(),_me(o[0],_this69.fullLayer.parent),(a=_this69.vNodes)==null||a["delete"](l));}),i&&(i.x-=Mt.SafeBorderPadding,i.y-=Mt.SafeBorderPadding,i.w+=Mt.SafeBorderPadding*2,i.h+=Mt.SafeBorderPadding*2),i;}},{key:"consume",value:function consume(t){var _t$data2=t.data,r=_t$data2.op,n=_t$data2.disableEraseImage,i=_t$data2.disableEraseText;if(!r||r.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);var l=this.tmpPoints.length;if(l>1&&this.isNear([r[0],r[1]],[this.tmpPoints[l-2],this.tmpPoints[l-1]]))return _objectSpread({type:dt.None},this.baseConsumeResult);l<3?this.tmpPoints.push(r[0],r[1]):this.tmpPoints.splice(2,2,r[0],r[1]);var o=this.computRectCenterPoints();var a;var f=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:dt.None},this.baseConsumeResult);var g=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:n,disableEraseText:i}));for(var c=0;c<o.length-1;c+=2){this.createEraserRect(o.slice(c,c+2));var m=this.remove({curNodeMap:g,removeIds:f});a=Wt(a,m);}return a&&f.size?{type:dt.RemoveNode,rect:a,removeIds:_toConsumableArray(f)}:_objectSpread({type:dt.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),i=this.serviceWork.selectorWorkShapes,l=this.serviceWork.workShapes;var _iterator20=_createForOfIteratorHelper(i.values()),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var o=_step20.value;if((r=o.selectIds)!=null&&r.length){var _iterator22=_createForOfIteratorHelper(o.selectIds),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var a=_step22.value;n["delete"](a);}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var _iterator21=_createForOfIteratorHelper(l.keys()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _o4=_step21.value;n["delete"](_o4);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return n;}return t;}}]);}(Mt);// 来源于white-sdk
408
+ at(ke,"eraserSizes",ln);var Tr=ke;var t0="__lodash_hash_undefined__";function e0(u){return this.__data__.set(u,t0),this;}var r0=e0;function n0(u){return this.__data__.has(u);}var i0=n0,s0=vi,o0=r0,a0=i0;function Cr(u){var e=-1,t=u==null?0:u.length;for(this.__data__=new s0();++e<t;)this.add(u[e]);}Cr.prototype.add=Cr.prototype.push=o0;Cr.prototype.has=a0;var hn=Cr;function l0(u,e){for(var t=-1,r=u==null?0:u.length;++t<r;)if(e(u[t],t,u))return!0;return!1;}var c0=l0;function f0(u,e){return u.has(e);}var un=f0,h0=hn,u0=c0,d0=un,p0=1,m0=2;function v0(u,e,t,r,n,i){var l=t&p0,o=u.length,a=e.length;if(o!=a&&!(l&&a>o))return!1;var f=i.get(u),g=i.get(e);if(f&&g)return f==e&&g==u;var c=-1,m=!0,x=t&m0?new h0():void 0;for(i.set(u,e),i.set(e,u);++c<o;){var M=u[c],S=e[c];if(r)var P=l?r(S,M,c,e,u,i):r(M,S,c,u,e,i);if(P!==void 0){if(P)continue;m=!1;break;}if(x){if(!u0(e,function(T,h){if(!d0(x,h)&&(M===T||n(M,T,t,r,i)))return x.push(h);})){m=!1;break;}}else if(!(M===S||n(M,S,t,r,i))){m=!1;break;}}return i["delete"](u),i["delete"](e),m;}var ki=v0;function y0(u){var e=-1,t=Array(u.size);return u.forEach(function(r,n){t[++e]=[n,r];}),t;}var g0=y0;function P0(u){var e=-1,t=Array(u.size);return u.forEach(function(r){t[++e]=r;}),t;}var dn=P0,kn=fr,Vn=Bi,x0=Jr,S0=ki,T0=g0,C0=dn,I0=1,O0=2,M0="[object Boolean]",E0="[object Date]",A0="[object Error]",L0="[object Map]",w0="[object Number]",R0="[object RegExp]",D0="[object Set]",b0="[object String]",N0="[object Symbol]",B0="[object ArrayBuffer]",W0="[object DataView]",Kn=kn?kn.prototype:void 0,jr=Kn?Kn.valueOf:void 0;function F0(u,e,t,r,n,i,l){switch(t){case W0:if(u.byteLength!=e.byteLength||u.byteOffset!=e.byteOffset)return!1;u=u.buffer,e=e.buffer;case B0:return!(u.byteLength!=e.byteLength||!i(new Vn(u),new Vn(e)));case M0:case E0:case w0:return x0(+u,+e);case A0:return u.name==e.name&&u.message==e.message;case R0:case b0:return u==e+"";case L0:var o=T0;case D0:var a=r&I0;if(o||(o=C0),u.size!=e.size&&!a)return!1;var f=l.get(u);if(f)return f==e;r|=O0,l.set(u,e);var g=S0(o(u),o(e),r,n,i,l);return l["delete"](u),g;case N0:if(jr)return jr.call(u)==jr.call(e);}return!1;}var U0=F0,Zn=Di,j0=1,Y0=Object.prototype,X0=Y0.hasOwnProperty;function z0(u,e,t,r,n,i){var l=t&j0,o=Zn(u),a=o.length,f=Zn(e),g=f.length;if(a!=g&&!l)return!1;for(var c=a;c--;){var m=o[c];if(!(l?m in e:X0.call(e,m)))return!1;}var x=i.get(u),M=i.get(e);if(x&&M)return x==e&&M==u;var S=!0;i.set(u,e),i.set(e,u);for(var P=l;++c<a;){m=o[c];var T=u[m],h=e[m];if(r)var p=l?r(h,T,m,e,u,i):r(T,h,m,u,e,i);if(!(p===void 0?T===h||n(T,h,t,r,i):p)){S=!1;break;}P||(P=m=="constructor");}if(S&&!P){var d=u.constructor,y=e.constructor;d!=y&&"constructor"in u&&"constructor"in e&&!(typeof d=="function"&&d instanceof d&&typeof y=="function"&&y instanceof y)&&(S=!1);}return i["delete"](u),i["delete"](e),S;}var $0=z0,Yr=yi,G0=ki,H0=U0,k0=$0,Jn=Fr,Qn=ur,qn=qr,V0=Ii,K0=1,_n="[object Arguments]",ti="[object Array]",vr="[object Object]",Z0=Object.prototype,ei=Z0.hasOwnProperty;function J0(u,e,t,r,n,i){var l=Qn(u),o=Qn(e),a=l?ti:Jn(u),f=o?ti:Jn(e);a=a==_n?vr:a,f=f==_n?vr:f;var g=a==vr,c=f==vr,m=a==f;if(m&&qn(u)){if(!qn(e))return!1;l=!0,g=!1;}if(m&&!g)return i||(i=new Yr()),l||V0(u)?G0(u,e,t,r,n,i):H0(u,e,a,t,r,n,i);if(!(t&K0)){var x=g&&ei.call(u,"__wrapped__"),M=c&&ei.call(e,"__wrapped__");if(x||M){var S=x?u.value():u,P=M?e.value():e;return i||(i=new Yr()),n(S,P,t,r,i);}}return m?(i||(i=new Yr()),k0(u,e,t,r,n,i)):!1;}var Q0=J0,q0=Q0,ri=De;function Vi(u,e,t,r,n){return u===e?!0:u==null||e==null||!ri(u)&&!ri(e)?u!==u&&e!==e:q0(u,e,t,r,Vi,n);}var _0=Vi,tm=_0;function em(u,e){return tm(u,e);}var rm=em,we=/* @__PURE__ */Ne(rm);function ni(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(u,",").concat(e,",").concat(t,",").concat(r,")");}function nm(u){var e=u.split(","),t=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),n=parseInt(e[2]),i=Number(e[3].split(")")[0]);return[t,r,n,i];}var wr=/*#__PURE__*/function(_Mt4){function wr(t){var _this70;_classCallCheck(this,wr);_this70=_callSuper(this,wr,[t]);at(_this70,"toolsType",St.Selector);at(_this70,"tmpPoints",[]);at(_this70,"workOptions");at(_this70,"vNodes");at(_this70,"selectIds");at(_this70,"selectorColor");at(_this70,"strokeColor");at(_this70,"fillColor");at(_this70,"oldSelectRect");at(_this70,"canRotate",!1);at(_this70,"canTextEdit",!1);at(_this70,"canLock",!1);at(_this70,"scaleType",Qt.all);at(_this70,"toolsTypes");at(_this70,"shapeOpt");at(_this70,"textOpt");at(_this70,"isLocked");at(_this70,"thickness");at(_this70,"strokeType");at(_this70,"useStroke");_this70.workOptions=t.toolsOpt,_this70.vNodes=t.vNodes;return _this70;}_inherits(wr,_Mt4);return _createClass(wr,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=qt(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,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length,n=t.length;if(n>1){var i=new Dt(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,i):this.tmpPoints.push(i);}}},{key:"drawSelector",value:function drawSelector(t){var _this71=this;var r=t.drawRect,n=t.subNodeMap,i=t.selectorId,l=t.layer,o=t.isService,a=new de({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:i,name:i,zIndex:9999}),f=[];if(o){var g=new Pn({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:wr.selectorBorderId});f.push(g);}n.forEach(function(g,c){var m=[g.rect.x+g.rect.w/2-r.x,g.rect.y+g.rect.h/2-r.y],x=new Pn({normalize:!0,pos:m,lineWidth:1,strokeColor:n.size>1?_this71.selectorColor||_this71.workOptions.strokeColor:void 0,width:g.rect.w,height:g.rect.h,id:"selector-".concat(c),name:"selector-".concat(c)});f.push(x);}),f&&a.append.apply(a,f),(l==null?void 0:l.parent).appendChild(a);}},{key:"draw",value:function draw(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var a,f;var l=n.intersectRect,o=n.subNodeMap;(f=(a=r.parent)==null?void 0:a.getElementById(t))==null||f.remove(),l&&this.drawSelector({drawRect:l,subNodeMap:o,selectorId:t,layer:r,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=Qt.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,i=!0;var _iterator23=_createForOfIteratorHelper(t.values()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var l=_step23.value;var o=l.opt,a=l.canRotate,f=l.scaleType,g=l.toolsType;this.selectorColor=this.workOptions.strokeColor,o.strokeColor&&(this.strokeColor=o.strokeColor),o.fillColor&&(this.fillColor=o.fillColor),o.textOpt&&(this.textOpt=o.textOpt),o.thickness&&(this.thickness=o.thickness),g!==St.Pencil&&(i=!1),o.strokeType&&(this.strokeType=o.strokeType),g===St.SpeechBalloon&&(r.add(g),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=o.placement),g===St.Polygon&&(r.add(g),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices),g===St.Star&&(r.add(g),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices,this.shapeOpt.innerRatio=o.innerRatio,this.shapeOpt.innerVerticeStep=o.innerVerticeStep),g===St.Text&&(this.textOpt=o),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=a,this.scaleType=f),g===St.Image&&(n=l),(f===Qt.proportional&&this.scaleType!==Qt.none||f===Qt.none)&&(this.scaleType=f);}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}i&&(this.useStroke=!0),r.size&&(this.toolsTypes=_toConsumableArray(r)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=Qt.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===Qt.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],i=(r=this.vNodes.get(n))==null?void 0:r.op;if(i){var l=[];for(var o=0;o<i.length;o+=3)l.push([i[o],i[o+1]]);return l;}}}},{key:"consume",value:function consume(t){if(t.isSubWorker)return this.subWorkerConsume(t);var _t$data3=t.data,r=_t$data3.op,n=_t$data3.workState;var i=this.oldSelectRect;if(n===Ft.Start&&(i=this.unSelectedAllIds()),!(r!=null&&r.length)||!this.vNodes.curNodeMap.size)return{type:dt.None};this.updateTempPoints(r);var l=this.computSelector();if(this.selectIds&&we(this.selectIds,l.selectIds))return{type:dt.None};this.selectIds=l.selectIds;var o=l.intersectRect;this.getSelecteorInfo(l.subNodeMap),this.draw(_t,this.fullLayer,l),this.oldSelectRect=o;var a=this.getChildrenPoints();return _objectSpread({type:dt.Select,dataType:bt.Local,rect:Wt(o,i),selectIds:l.selectIds,selectRect:o,selectorColor:this.selectorColor,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:a,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}},{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,_t,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return _objectSpread({type:dt.Select,dataType:bt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return{type:dt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(t){var r=t.slice(-2),n=new Dt(r[0],r[1]);if(this.tmpPoints[0].isNear(n,1))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:"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 o=_step24.value;n.push(_construct(ot,_toConsumableArray(o)));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}var i=qt(n,r),l=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:l,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(t){var r=t.workId,n=t.layer,i=t.ps,_this$workOptions6=this.workOptions,l=_this$workOptions6.strokeColor,o=_this$workOptions6.scale,a=_this$workOptions6.rotate,f=_this$workOptions6.translate,g=n.worldPosition,c=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(i),m=_this$computDrawPoint2.points,x=_this$computDrawPoint2.rect,M=_this$computDrawPoint2.pos,S=1/n.worldScaling[0],P=l&&nm(l)||[0,0,0,0],T={close:!0,normalize:!0,points:m,lineWidth:S,fillColor:ni(P[0],P[1],P[2],0.1),strokeColor:ni(P[0],P[1],P[2],1),lineJoin:"round",lineCap:"round"};var h={x:Math.floor(x.x*c[0]+g[0]-Mt.SafeBorderPadding),y:Math.floor(x.y*c[1]+g[1]-Mt.SafeBorderPadding),w:Math.floor(x.w*c[0]+2*Mt.SafeBorderPadding),h:Math.floor(x.h*c[0]+2*Mt.SafeBorderPadding)};var p=new de({name:r,id:r,pos:M,anchor:[0.5,0.5],size:[x.w,x.h],scale:o,rotate:a,translate:f}),d=new Re(_objectSpread(_objectSpread({},T),{},{pos:[0,0]}));if(p.appendChild(d),this.replace(n,r,p),o||a||f){var y=p.getBoundingClientRect();h={x:Math.floor(y.x-Mt.SafeBorderPadding),y:Math.floor(y.y-Mt.SafeBorderPadding),w:Math.floor(y.width+2*Mt.SafeBorderPadding),h:Math.floor(y.height+2*Mt.SafeBorderPadding)};}return h;}},{key:"transformData",value:function transformData(){var t=qt(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:"subWorkerConsume",value:function subWorkerConsume(t){var r=t.data,n=t.isFullWork,i=r.op,l=r.syncUnitTime;l&&(this.syncUnitTime=l);var o=i==null?void 0:i.length;if(!o||o<2)return{type:dt.None};var a;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(i[0],i[1])],a=!1):a=this.updateTempPointsForSubWorker(i),!a)return{type:dt.None};var f=this.transformData(),g=n?this.fullLayer:this.drawLayer||this.fullLayer,c=this.drawForSubWorker({ps:f,workId:this.workId,layer:g}),m=Wt(c,this.oldSelectRect);return this.oldSelectRect=c,_objectSpread({rect:m,type:dt.DrawWork,dataType:bt.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:dt.FullWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0;}},{key:"selectSingleTool",value:function selectSingleTool(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_t;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var i=t[0],l=t[1];var o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:l,w:0,h:0},!1),a=_this$vNodes$getRectI2.nodeRange,f=_toConsumableArray(a.values()).sort(function(g,c){return(c.opt.zIndex||0)-(g.opt.zIndex||0);});var _iterator25=_createForOfIteratorHelper(f),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _g10=_step25.value;var _c5=this.fullLayer.getElementsByName(_g10.name);if(rs(_c5).find(function(x){return x.isPointCollision(i,l);})){o=_g10;break;}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}if(o){var g=o.name;if(!we(this.oldSelectRect,o.rect)){var c=/* @__PURE__ */new Map([[g,o]]);this.getSelecteorInfo(c),this.draw(r,this.fullLayer,{intersectRect:o.rect,subNodeMap:c,selectIds:this.selectIds||[]},n);}this.selectIds=[g],this.oldSelectRect=o.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=Wt(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 i=this.vNodes.get(n);i&&i.isSelected&&(r=Wt(r,i.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 i=this.vNodes.get(n);i&&(r=Wt(r,i.rect),this.vNodes.selected(n));}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"getSelectorRect",value:function getSelectorRect(t,r){var o;var n;var i=(o=t.parent)==null?void 0:o.getElementById(r),l=i==null?void 0:i.getBoundingClientRect();return l&&(n=Wt(n,{x:Math.floor(l.x),y:Math.floor(l.y),w:Math.floor(l.width+1),h:Math.floor(l.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===St.Ellipse||t===St.Triangle||t===St.Rectangle||t===St.Polygon||t===St.Star||t===St.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var r,n,i,l,o,a,f,g,c,m,x,M,S,P,T,h,_iterator29,_step29,y,O,E,w,B,A,b,W,D,R,j,p,_y12,_O8,_E6,d;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:r=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,l=t.willSerializeData,o=t.worker,a=t.offset,f=this.fullLayer;if(f){_context24.next=3;break;}return _context24.abrupt("return");case 3:c=/* @__PURE__ */new Map(),m=r.originPoint,x=r.workState,M=r.angle,S=r.translate,P=r.dir,T=r.scale;a&&(S?r.translate=[S[0]+a[0],S[1]+a[1]]:r.translate=a);if(!(m||S||he(M))){_context24.next=10;break;}if(!(x===Ft.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:dt.Select,dataType:bt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(!(h=i.getLastTarget(),!h)){_context24.next=10;break;}return _context24.abrupt("return");case 10:if(!n){_context24.next=61;break;}_iterator29=_createForOfIteratorHelper(n);_context24.prev=12;_iterator29.s();case 14:if((_step29=_iterator29.n()).done){_context24.next=53;break;}y=_step29.value;O=i.get(y);if(!O){_context24.next=51;break;}E=O.toolsType,w=O.opt,B=(f==null?void 0:f.getElementsByName(y))[0];if(!B){_context24.next=51;break;}A=_objectSpread({},r);b=void 0;W=Mt.isWillRefresh({toolsType:E,opt:w,updateOpt:A,vNodes:i,node:B,willSerializeData:l});if(!E){_context24.next=51;break;}b=h==null?void 0:h.get(y);D=es(E);if(!(D==null||D.updateNodeOpt({node:B,opt:A,vNodes:i,willSerializeData:l,targetNode:b}),O&&o&&W)){_context24.next=50;break;}R=o.createWorkShapeNode({workId:y,toolsType:E,toolsOpt:O.opt});R==null||R.setWorkId(y);j=void 0;if(!(E===St.Image)){_context24.next=36;break;}_context24.next=33;return R.consumeServiceAsync({isFullWork:!0,replaceId:y,worker:o});case 33:j=_context24.sent;_context24.next=49;break;case 36:if(!(E===St.Text)){_context24.next=42;break;}_context24.next=39;return R.consumeServiceAsync({isFullWork:!0,replaceId:y});case 39:j=_context24.sent;_context24.next=49;break;case 42:_context24.prev=42;j=R==null?void 0:R.consumeService({op:O.op,isFullWork:!0,replaceId:y,workState:x});_context24.next=49;break;case 46:_context24.prev=46;_context24.t0=_context24["catch"](42);return _context24.abrupt("continue",51);case 49:j&&(O.rect=j);case 50:O&&(c.set(y,O),g=Wt(g,O.rect));case 51:_context24.next=14;break;case 53:_context24.next=58;break;case 55:_context24.prev=55;_context24.t1=_context24["catch"](12);_iterator29.e(_context24.t1);case 58:_context24.prev=58;_iterator29.f();return _context24.finish(58);case 61:h&&x===Ft.Done&&(i.deleteLastTarget(),h=void 0);p=g;if(!(m&&S&&T&&P&&p&&!a)){_context24.next=81;break;}_y12=[[p.x,p.y],[p.x+p.w,p.y],[p.x+p.w,p.y+p.h],[p.x,p.y+p.h]];_context24.t2=P;_context24.next=_context24.t2==="top"?68:_context24.t2==="topLeft"?68:_context24.t2==="left"?68:_context24.t2==="topRight"?70:_context24.t2==="right"?72:_context24.t2==="bottomRight"?72:_context24.t2==="bottom"?72:_context24.t2==="bottomLeft"?74:76;break;case 68:S[0]>0&&S[1]>0?_O8=_y12[0]:S[0]>0?_O8=_y12[3]:S[1]>0?_O8=_y12[1]:_O8=_y12[2];return _context24.abrupt("break",76);case 70:S[0]<0&&S[1]>0?_O8=_y12[1]:S[0]<0?_O8=_y12[2]:S[1]>0?_O8=_y12[0]:_O8=_y12[3];return _context24.abrupt("break",76);case 72:S[0]<0&&S[1]<0?_O8=_y12[2]:S[0]<0?_O8=_y12[1]:S[1]<0?_O8=_y12[3]:_O8=_y12[0];return _context24.abrupt("break",76);case 74:S[0]>0&&S[1]<0?_O8=_y12[3]:S[0]>0?_O8=_y12[0]:S[1]<0?_O8=_y12[2]:_O8=_y12[1];return _context24.abrupt("break",76);case 76:_E6=_O8&&[m[0]-_O8[0],m[1]-_O8[1]]||[0,0];if(we(_E6,[0,0])){_context24.next=81;break;}_context24.next=80;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{workState:x},offset:_E6}));case 80:return _context24.abrupt("return",_context24.sent);case 81:this.getSelecteorInfo(c),this.draw(_t,f,{selectIds:n||[],subNodeMap:c,intersectRect:p});d=Wt(this.oldSelectRect,p);return _context24.abrupt("return",(this.oldSelectRect=p,{type:dt.Select,dataType:bt.Local,selectRect:p,renderRect:g,rect:Wt(d,p),selectIds:n}));case 84:case"end":return _context24.stop();}},_callee22,this,[[12,55,58,61],[42,46]]);}));function updateSelector(_x32){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:dt.Select,dataType:bt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(or,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,r,n){var _this72=this;var i=r.selectIds,l=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,l);var a;var f=/* @__PURE__ */new Map();return i==null||i.forEach(function(g){var c=_this72.vNodes.get(g);c&&(a=Wt(a,c.rect),f.set(g,c));}),this.getSelecteorInfo(f),this.draw(l,this.fullLayer,{intersectRect:a,selectIds:i||[],subNodeMap:f},n),Wt(a,o);}},{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(i){var l=_this73.vNodes.get(i);l&&(t=Wt(t,l.rect),r.set(i,l));},this),this.getSelecteorInfo(r),this.draw(_t,this.fullLayer,{intersectRect:t,subNodeMap:r,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var l;var r;var n=(l=this.selectIds)==null?void 0:l.filter(function(o){return!t.includes(o);});if(n!=null&&n.length&&(r=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);r=Wt(r,o);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:r,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var l,o;var r=this.oldSelectRect;this.selectIds=[];var n=(l=this.workId)==null?void 0:l.toString(),i=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(i,n,!0),this.oldSelectRect&&!we(r,this.oldSelectRect))return{type:dt.CursorHover,dataType:bt.Local,rect:Wt(r,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),r&&!this.oldSelectRect)return this.cursorBlur(),{type:dt.CursorHover,dataType:bt.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(i){i.name===t&&i.remove();});}}]);}(Mt);at(wr,"selectorBorderId","selector-border");var Ir=wr;var Ki=/*#__PURE__*/function(_Mt5){function Ki(t){var _this74;_classCallCheck(this,Ki);_this74=_callSuper(this,Ki,[t]);at(_this74,"canRotate",!1);at(_this74,"scaleType",Qt.both);at(_this74,"toolsType",St.Arrow);at(_this74,"tmpPoints",[]);at(_this74,"workOptions");at(_this74,"oldRect");at(_this74,"arrowTipWidth");at(_this74,"syncTimestamp");_this74.workOptions=t.toolsOpt,_this74.arrowTipWidth=_this74.workOptions.thickness*4,_this74.syncTimestamp=0,_this74.syncUnitTime=50;return _this74;}_inherits(Ki,_Mt5);return _createClass(Ki,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=this.workId,a=r.op,f=r.syncUnitTime;f&&(this.syncUnitTime=f);var g=a==null?void 0:a.length;if(!g||g<2)return{type:dt.None};var c;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(a[0],a[1])],c=!1):c=this.updateTempPoints(a),!c)return{type:dt.None};var m;if(i||l){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({workId:o,layer:M});}if(!i){var _M2=Date.now();return _M2-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M2,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:dt.None};}var x=Wt(m,this.oldRect);return this.oldRect=m,_objectSpread(_objectSpread({rect:x},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=Te(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Mt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:dt.FullWork,dataType:bt.Local,ops:l,isSync:!0});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawEraserlines,_this$workOptions7=this.workOptions,l=_this$workOptions7.strokeColor,o=_this$workOptions7.thickness,a=_this$workOptions7.zIndex,f=_this$workOptions7.scale,g=_this$workOptions7.rotate,c=_this$workOptions7.translate,m=_this$workOptions7.strokeType,x=_this$workOptions7.eraserlines,M=n.worldPosition,S=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(o),P=_this$computDrawPoint3.points,T=_this$computDrawPoint3.pos,h=_this$computDrawPoint3.rect,p=_this$computDrawPoint3.isTriangle,d=_this$computDrawPoint3.trianglePoints,y=_this$computDrawPoint3.trianglePos,O=[h.x+h.w/2,h.y+h.h/2],E={pos:O,name:r,id:r,zIndex:a,anchor:[0.5,0.5],size:[h.w,h.h]};f&&(E.scale=f),g&&(E.rotate=g),c&&(E.translate=c);var w=new de(E),B={points:d,pos:[y[0]-O[0],y[1]-O[1]],fillColor:l,strokeColor:l,lineWidth:0,normalize:!1},A=new Re(B);if(w.append(A),!p&&P&&T){var W={points:P,pos:[T[0]-O[0],T[1]-O[1]],fillColor:l,strokeColor:l,lineDash:m===Vt.Dotted&&!p?[1,o*2]:m===Vt.LongDotted&&!p?[o,o*2]:void 0,lineCap:m===Vt.Normal?void 0:"round",lineWidth:o,normalize:!1},D=new Re(W);w.append(D);}x&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:w,eraserlines:x,pos:O,layer:n},i)),this.replace(n,r,w);var b={x:Math.floor(h.x*S[0]+M[0]-Mt.SafeBorderPadding),y:Math.floor(h.y*S[1]+M[1]-Mt.SafeBorderPadding),w:Math.floor(h.w*S[0]+2*Mt.SafeBorderPadding),h:Math.floor(h.h*S[1]+2*Mt.SafeBorderPadding)};if(f||g||c){var _W9=w.getBoundingClientRect();b={x:Math.floor(_W9.x-Mt.SafeBorderPadding),y:Math.floor(_W9.y-Mt.SafeBorderPadding),w:Math.floor(_W9.width+Mt.SafeBorderPadding*2),h:Math.floor(_W9.height+Mt.SafeBorderPadding*2)};}return this.isDelete&&w.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=ot.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=ot.Per(r).mul(t/2),i=Dt.Sub(this.tmpPoints[0],n),l=Dt.Add(this.tmpPoints[0],n),o=ot.Mul(r,this.arrowTipWidth),a=ot.Sub(this.tmpPoints[1],o),f=Dt.Sub(a,n),g=Dt.Add(a,n),c=ot.Per(r).mul(t*1.5),m=Dt.Sub(a,c),x=Dt.Add(a,c),M=[this.tmpPoints[0],a],S=[m,this.tmpPoints[1],x],P=[i,l].concat(S,[f,g]);return{trianglePoints:S.map(function(T){return Dt.Sub(T,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:M.map(function(T){return Dt.Sub(T,_this75.tmpPoints[0]).XY;}).flat(1),rect:qt(P),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this76=this;var t=ot.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=ot.Per(t).mul(Math.floor(r*3/8)),i=Dt.Sub(this.tmpPoints[0],n),l=Dt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],l];return{trianglePoints:o.map(function(a){return Dt.Sub(a,_this76.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:qt(o),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))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 f,g;var r=t.op,n=t.isFullWork,_t$workState2=t.workState,i=_t$workState2===void 0?Ft.Done:_t$workState2,l=(f=this.workId)==null?void 0:f.toString();if(!l)return;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3)this.tmpPoints.push(new Dt(r[c],r[c+1],r[c+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(g=this.vNodes)==null||g.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Mt.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var f,g;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.strokeType,a=i.get(r.name);return l&&(r.tagName==="GROUP"?r.children.forEach(function(c){c.setAttribute("strokeColor",l),c.getAttribute("fillColor")&&c.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(f=a==null?void 0:a.opt)!=null&&f.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(g=a.opt)!=null&&g.strokeType&&(a.opt.strokeType=o),a&&i.setInfo(r.name,a),Mt.updateNodeOpt(t);}}]);}(Mt);var Zi=/*#__PURE__*/function(_Mt6){function Zi(t){var _this77;_classCallCheck(this,Zi);_this77=_callSuper(this,Zi,[t]);at(_this77,"canRotate",!1);at(_this77,"scaleType",Qt.all);at(_this77,"toolsType",St.Ellipse);at(_this77,"tmpPoints",[]);at(_this77,"workOptions");at(_this77,"oldRect");at(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(Zi,_Mt6);return _createClass(Zi,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=this.workId,a=r.op,f=r.syncUnitTime;f&&(this.syncUnitTime=f);var g=a==null?void 0:a.length;if(!g||g<2)return{type:dt.None};var c;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(a[0],a[1])],c=!1):c=this.updateTempPoints(a),!c)return{type:dt.None};if(!i){var x=Date.now();return x-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=x,_objectSpread(_objectSpread({type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(M){return[].concat(_toConsumableArray(M.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:dt.None};}var m;if(i||l){var _x33=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({workId:o,layer:_x33,isDrawing:!0});var M=_x33.parent.parent,S={x:0,y:0,w:Math.floor(M.width),h:Math.floor(M.height)};if(sr(m,S)!==ye.outside){var _T33=Wt(m,this.oldRect);return this.oldRect=m,_objectSpread({rect:_T33,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}return{type:dt.None};}return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=Te(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&Mt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local},this.baseConsumeResult),{},{ops:l,isSync:!0});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,l=t.isDrawEraserlines,_this$workOptions8=this.workOptions,o=_this$workOptions8.strokeColor,a=_this$workOptions8.fillColor,f=_this$workOptions8.thickness,g=_this$workOptions8.zIndex,c=_this$workOptions8.scale,m=_this$workOptions8.rotate,x=_this$workOptions8.translate,M=_this$workOptions8.strokeType,S=_this$workOptions8.eraserlines,P=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(f),T=_this$computDrawPoint4.radius,h=_this$computDrawPoint4.rect,p=_this$computDrawPoint4.pos,d={closeType:"normal",radius:T,lineWidth:f,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:M===Vt.Dotted?[1,f*2]:M===Vt.LongDotted?[f,f*2]:void 0},y={name:r,id:r,zIndex:g,pos:p,anchor:[0.5,0.5],size:[h.w,h.h]};c&&(y.scale=c),m&&(y.rotate=m),x&&(y.translate=x);var O=new de(y);if(i){var B=new Ae({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/P[0],1/P[1]]});O.append(B);}var E=new uo(_objectSpread(_objectSpread({},d),{},{pos:[0,0]}));O.append(E),S&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:O,eraserlines:S,pos:p,layer:n},l)),this.replace(n,r,O);var w=O.getBoundingClientRect();return this.isDelete&&O.setAttribute("opacity",0),{x:Math.floor(w.x-Mt.SafeBorderPadding),y:Math.floor(w.y-Mt.SafeBorderPadding),w:Math.floor(w.width+Mt.SafeBorderPadding*2),h:Math.floor(w.height+Mt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=qt(this.tmpPoints),n=qt(this.tmpPoints,t),i=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)];return{rect:n,pos:i,radius:[Math.floor(r.w/2),Math.floor(r.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))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 f,g;var r=t.op,n=t.isFullWork,_t$workState3=t.workState,i=_t$workState3===void 0?Ft.Done:_t$workState3,l=(f=this.workId)==null?void 0:f.toString();if(!l)return;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3)this.tmpPoints.push(new Dt(r[c],r[c+1],r[c+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(g=this.vNodes)==null||g.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Mt.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m,x;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.strokeType,f=i.get(r.name);var g=r;return r.tagName==="GROUP"&&(g=r.children[0]),l&&(g.setAttribute("strokeColor",l),(c=f==null?void 0:f.opt)!=null&&c.strokeColor&&(f.opt.strokeColor=l)),o&&(o==="transparent"?g.setAttribute("fillColor","rgba(0,0,0,0)"):g.setAttribute("fillColor",o),(m=f==null?void 0:f.opt)!=null&&m.fillColor&&(f.opt.fillColor=o)),a&&f!=null&&f.opt&&(x=f.opt)!=null&&x.strokeType&&(f.opt.strokeType=a),f&&i.setInfo(r.name,f),Mt.updateNodeOpt(t);}}]);}(Mt);var Ji=/*#__PURE__*/function(_Mt7){function Ji(t){var _this78;_classCallCheck(this,Ji);_this78=_callSuper(this,Ji,[t]);at(_this78,"canRotate",!0);at(_this78,"scaleType",Qt.all);at(_this78,"toolsType",St.Rectangle);at(_this78,"tmpPoints",[]);at(_this78,"workOptions");at(_this78,"oldRect");at(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(Ji,_Mt7);return _createClass(Ji,[{key:"transformData",value:function transformData(){var t=qt(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 o=_step30.value;n.push(_construct(ot,_toConsumableArray(o)));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}var i=qt(n,r),l=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:l,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=this.workId,a=r.op,f=a==null?void 0:a.length;if(!f||f<2)return{type:dt.None};var g;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(a[0],a[1])],g=!1):g=this.updateTempPoints(a),!g)return{type:dt.None};var c=this.transformData();var m;if(i||l){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({ps:c,workId:o,layer:M,isDrawing:!0});}if(!i){var _M3=Date.now();return _M3-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M3,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:c.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var x=Wt(m,this.oldRect);return this.oldRect=m,_objectSpread({rect:x,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,i=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var l=r.flat(1),o=Te(l);return(a=this.vNodes)==null||a.setInfo(t,{rect:i,op:l,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&Mt.getCenterPos(i,n)}),_objectSpread({rect:i,type:dt.FullWork,dataType:bt.Local,ops:o,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,l=t.ps,o=t.replaceId,_t$isDrawEraserlines2=t.isDrawEraserlines,a=_t$isDrawEraserlines2===void 0?!0:_t$isDrawEraserlines2,_this$workOptions9=this.workOptions,f=_this$workOptions9.strokeColor,g=_this$workOptions9.fillColor,c=_this$workOptions9.thickness,m=_this$workOptions9.zIndex,x=_this$workOptions9.scale,M=_this$workOptions9.rotate,S=_this$workOptions9.translate,P=_this$workOptions9.strokeType,T=_this$workOptions9.eraserlines,h=n.worldPosition,p=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(l),d=_this$computDrawPoint5.points,y=_this$computDrawPoint5.rect,O=_this$computDrawPoint5.pos,E={close:!0,normalize:!0,points:d,lineWidth:c,fillColor:g!=="transparent"&&g||void 0,strokeColor:f,lineJoin:"round",lineCap:"round",lineDash:P===Vt.Dotted?[1,c*2]:P===Vt.LongDotted?[c,c*2]:void 0};var w={x:Math.floor(y.x*p[0]+h[0]-Mt.SafeBorderPadding),y:Math.floor(y.y*p[1]+h[1]-Mt.SafeBorderPadding),w:Math.floor(y.w*p[0]+2*Mt.SafeBorderPadding),h:Math.floor(y.h*p[0]+2*Mt.SafeBorderPadding)};var B=new de({name:r,id:r,zIndex:m,pos:O,anchor:[0.5,0.5],size:[y.w,y.h],scale:x,rotate:M,translate:S}),A=new Re(_objectSpread(_objectSpread({},E),{},{pos:[0,0]}));if(B.appendChild(A),i){var b=new Ae({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:f,lineWidth:1,scale:[1/p[0],1/p[1]]});B.appendChild(b);}if(T&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:B,eraserlines:T,pos:O,layer:n},a)),this.replace(n,o||r,B),x||M||S){var _b8=B.getBoundingClientRect();w={x:Math.floor(_b8.x-Mt.SafeBorderPadding),y:Math.floor(_b8.y-Mt.SafeBorderPadding),w:Math.floor(_b8.width+2*Mt.SafeBorderPadding),h:Math.floor(_b8.height+2*Mt.SafeBorderPadding)};}return this.isDelete&&B.setAttribute("opacity",0),w;}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))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 c,m;var r=t.op,n=t.isFullWork,i=t.replaceId,_t$workState4=t.workState,l=_t$workState4===void 0?Ft.Done:_t$workState4,o=(c=this.workId)==null?void 0:c.toString();if(!o)return;var a=[];for(var x=0;x<r.length;x+=3)a.push([r[x],r[x+1],r[x+2]]);var f=n?this.fullLayer:this.drawLayer||this.fullLayer,g=this.draw({ps:a,workId:o,layer:f,isDrawing:!1,replaceId:i,isDrawEraserlines:l===Ft.Done});return this.oldRect=g,(m=this.vNodes)==null||m.setInfo(o,{rect:g,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:g&&Mt.getCenterPos(g,f)}),g;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m,x;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.strokeType,f=i.get(r.name);var g=r;return r.tagName==="GROUP"&&(g=r.children[0]),l&&(g.setAttribute("strokeColor",l),(c=f==null?void 0:f.opt)!=null&&c.strokeColor&&(f.opt.strokeColor=l)),o&&(o==="transparent"?g.setAttribute("fillColor","rgba(0,0,0,0)"):g.setAttribute("fillColor",o),(m=f==null?void 0:f.opt)!=null&&m.fillColor&&(f.opt.fillColor=o)),a&&f!=null&&f.opt&&(x=f.opt)!=null&&x.strokeType&&(f.opt.strokeType=a),f&&i.setInfo(r.name,f),Mt.updateNodeOpt(t);}}]);}(Mt);var Qi=/*#__PURE__*/function(_Mt8){function Qi(t){var _this79;_classCallCheck(this,Qi);_this79=_callSuper(this,Qi,[t]);at(_this79,"canRotate",!1);at(_this79,"scaleType",Qt.all);at(_this79,"toolsType",St.Star);at(_this79,"tmpPoints",[]);at(_this79,"workOptions");at(_this79,"oldRect");at(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(Qi,_Mt8);return _createClass(Qi,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=this.workId,a=r.op,f=r.syncUnitTime,g=a==null?void 0:a.length;if(!g||g<2)return{type:dt.None};f&&(this.syncUnitTime=f);var c;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(a[0],a[1])],c=!1):c=this.updateTempPoints(a),!c)return{type:dt.None};var m;if(i||l){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({workId:o,layer:M,isDrawing:!0});}if(!i){var _M4=Date.now();return _M4-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M4,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var x=Wt(m,this.oldRect);return this.oldRect=m,_objectSpread({rect:x,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=Te(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Mt.getCenterPos(n,r)}),_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local,ops:l,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,_t$isDrawEraserlines3=t.isDrawEraserlines,l=_t$isDrawEraserlines3===void 0?!0:_t$isDrawEraserlines3,_this$workOptions10=this.workOptions,o=_this$workOptions10.strokeColor,a=_this$workOptions10.fillColor,f=_this$workOptions10.thickness,g=_this$workOptions10.zIndex,c=_this$workOptions10.vertices,m=_this$workOptions10.innerVerticeStep,x=_this$workOptions10.innerRatio,M=_this$workOptions10.scale,S=_this$workOptions10.rotate,P=_this$workOptions10.translate,T=_this$workOptions10.strokeType,h=_this$workOptions10.eraserlines,p=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(f,c,m,x),d=_this$computDrawPoint6.rect,y=_this$computDrawPoint6.pos,O=_this$computDrawPoint6.points,E={close:!0,points:O,lineWidth:f,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:T===Vt.Dotted?[1,f*2]:T===Vt.LongDotted?[f,f*2]:void 0},w={name:r,id:r,zIndex:g,pos:y,anchor:[0.5,0.5],size:[d.w,d.h]};M&&(w.scale=M),S&&(w.rotate=S),P&&(w.translate=P);var B=new de(w);if(i){var W=new Ae({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/p[0],1/p[1]]});B.append(W);}var A=new Re(_objectSpread(_objectSpread({},E),{},{pos:[0,0]}));B.append(A),h&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:B,eraserlines:h,pos:y,layer:n},l)),this.replace(n,r,B);var b=B.getBoundingClientRect();return this.isDelete&&B.setAttribute("opacity",0),{x:Math.floor(b.x-Mt.SafeBorderPadding),y:Math.floor(b.y-Mt.SafeBorderPadding),w:Math.floor(b.width+Mt.SafeBorderPadding*2),h:Math.floor(b.height+Mt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r,n,i){var l=qt(this.tmpPoints),o=[Math.floor(l.x+l.w/2),Math.floor(l.y+l.h/2)],a=ss(l.w,l.h),f=Math.floor(Math.min(l.w,l.h)/2),g=i*f,c=[],m=2*Math.PI/r;for(var M=0;M<r;M++){var S=M*m-0.5*Math.PI;var P=void 0,_T34=void 0;M%n===1?(P=g*a[0]*Math.cos(S),_T34=g*a[1]*Math.sin(S)):(P=f*a[0]*Math.cos(S),_T34=f*a[1]*Math.sin(S),c.push(P,_T34)),c.push(P,_T34);}return{rect:qt(this.tmpPoints,t),pos:o,points:c};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l)||Dt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var f,g;var r=t.op,n=t.isFullWork,_t$workState5=t.workState,i=_t$workState5===void 0?Ft.Done:_t$workState5,l=(f=this.workId)==null?void 0:f.toString();if(!l)return;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3)this.tmpPoints.push(new Dt(r[c],r[c+1],r[c+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(g=this.vNodes)==null||g.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Mt.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var P;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,f=n.vertices,g=n.innerVerticeStep,c=n.innerRatio,m=n.strokeType,x=i.get(r.name),M=x==null?void 0:x.opt;var S=r;return r.tagName==="GROUP"&&(S=r.children[0]),l&&(S.setAttribute("strokeColor",l),M!=null&&M.strokeColor&&(M.strokeColor=l)),o&&(o==="transparent"?S.setAttribute("fillColor","rgba(0,0,0,0)"):S.setAttribute("fillColor",o),M!=null&&M.fillColor&&(M.fillColor=o)),a===St.Star&&(f&&(M.vertices=f),g&&(M.innerVerticeStep=g),c&&(M.innerRatio=c)),m&&x!=null&&x.opt&&(P=x.opt)!=null&&P.strokeType&&(x.opt.strokeType=m),x&&i.setInfo(r.name,_objectSpread(_objectSpread({},x),{},{opt:M})),Mt.updateNodeOpt(t);}}]);}(Mt);var qi=/*#__PURE__*/function(_Mt9){function qi(t){var _this80;_classCallCheck(this,qi);_this80=_callSuper(this,qi,[t]);at(_this80,"canRotate",!1);at(_this80,"scaleType",Qt.all);at(_this80,"toolsType",St.Polygon);at(_this80,"tmpPoints",[]);at(_this80,"workOptions");at(_this80,"oldRect");at(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(qi,_Mt9);return _createClass(qi,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=r.op,a=r.syncUnitTime;a&&(this.syncUnitTime=a);var f=this.workId,g=o==null?void 0:o.length;if(!g||g<2)return{type:dt.None};var c;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(o[0],o[1])],c=!1):c=this.updateTempPoints(o),!c)return{type:dt.None};var m;if(i||l){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({workId:f,layer:M,isDrawing:!0});}if(!i){var _M5=Date.now();return _M5-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M5,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var x=Wt(m,this.oldRect);return this.oldRect=m,_objectSpread({rect:x,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=Te(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Mt.getCenterPos(n,r)}),_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local,ops:l,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,_t$isDrawEraserlines4=t.isDrawEraserlines,l=_t$isDrawEraserlines4===void 0?!0:_t$isDrawEraserlines4,_this$workOptions11=this.workOptions,o=_this$workOptions11.strokeColor,a=_this$workOptions11.fillColor,f=_this$workOptions11.thickness,g=_this$workOptions11.zIndex,c=_this$workOptions11.vertices,m=_this$workOptions11.scale,x=_this$workOptions11.rotate,M=_this$workOptions11.translate,S=_this$workOptions11.strokeType,P=_this$workOptions11.eraserlines,T=n.worldScaling,_this$computDrawPoint7=this.computDrawPoints(f,c),h=_this$computDrawPoint7.rect,p=_this$computDrawPoint7.pos,d=_this$computDrawPoint7.points,y={close:!0,points:d,lineWidth:f,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:S===Vt.Dotted?[1,f*2]:S===Vt.LongDotted?[f,f*2]:void 0},O={name:r,id:r,zIndex:g,pos:p,anchor:[0.5,0.5],size:[h.w,h.h]};m&&(O.scale=m),x&&(O.rotate=x),M&&(O.translate=M);var E=new de(O);if(i){var A=new Ae({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/T[0],1/T[1]]});E.append(A);}var w=new Re(_objectSpread(_objectSpread({},y),{},{pos:[0,0]}));E.append(w),P&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:E,eraserlines:P,pos:p,layer:n},l)),this.replace(n,r,E);var B=E.getBoundingClientRect();return this.isDelete&&E.setAttribute("opacity",0),{x:Math.floor(B.x-Mt.SafeBorderPadding),y:Math.floor(B.y-Mt.SafeBorderPadding),w:Math.floor(B.width+Mt.SafeBorderPadding*2),h:Math.floor(B.height+Mt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=qt(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],l=ss(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),a=[],f=2*Math.PI/r;for(var c=0;c<r;c++){var m=c*f-0.5*Math.PI,x=o*l[0]*Math.cos(m),M=o*l[1]*Math.sin(m);a.push(x,M);}return{rect:qt(this.tmpPoints,t),pos:i,points:a};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l)||Dt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var f,g;var r=t.op,n=t.isFullWork,_t$workState6=t.workState,i=_t$workState6===void 0?Ft.Done:_t$workState6,l=(f=this.workId)==null?void 0:f.toString();if(!l)return;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3)this.tmpPoints.push(new Dt(r[c],r[c+1],r[c+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(g=this.vNodes)==null||g.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Mt.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var M;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,f=n.vertices,g=n.strokeType,c=i.get(r.name),m=c==null?void 0:c.opt;var x=r;return r.tagName==="GROUP"&&(x=r.children[0]),l&&(x.setAttribute("strokeColor",l),m!=null&&m.strokeColor&&(m.strokeColor=l)),o&&(o==="transparent"?x.setAttribute("fillColor","rgba(0,0,0,0)"):x.setAttribute("fillColor",o),m!=null&&m.fillColor&&(m.fillColor=o)),a===St.Polygon&&f&&(m.vertices=f),g&&c!=null&&c.opt&&(M=c.opt)!=null&&M.strokeType&&(c.opt.strokeType=g),c&&i.setInfo(r.name,_objectSpread(_objectSpread({},c),{},{opt:m})),Mt.updateNodeOpt(t);}}]);}(Mt);var Ce=/*#__PURE__*/function(){function Ce(){_classCallCheck(this,Ce);}return _createClass(Ce,null,[{key:"bezier",value:function bezier(e,t){var r=[];for(var n=0;n<t.length;n+=4){var i=t[n],l=t[n+1],o=t[n+2],a=t[n+3];i&&l&&o&&a?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,i,l,o,a))):i&&l&&o?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,i,l,o))):i&&l?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,i,l))):i&&r.push(i);}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 i=arguments.length>4?arguments[4]:undefined;var l=null;var o=[];!n&&!i?l=Ce.oneBezier:n&&!i?l=Ce.twoBezier:n&&i&&(l=Ce.threeBezier);for(var a=0;a<e;a++)l&&o.push(l(a/e,t,r,n,i));return i?o.push(i):n&&o.push(n),o;}/**
419
+ * @desc 一阶贝塞尔
420
+ * @param {number} t 当前百分比
421
+ * @param {Vec2d} p1 起点坐标
422
+ * @param {Vec2d} p2 终点坐标
423
+ */},{key:"oneBezier",value:function oneBezier(e,t,r){var n=t.x+(r.x-t.x)*e,i=t.y+(r.y-t.y)*e;return new ot(n,i);}/**
424
+ * @desc 二阶贝塞尔
425
+ * @param {number} t 当前百分比
426
+ * @param {Array} p1 起点坐标
427
+ * @param {Array} p2 终点坐标
428
+ * @param {Array} cp 控制点
429
+ */},{key:"twoBezier",value:function twoBezier(e,t,r,n){var i=(1-e)*(1-e)*t.x+2*e*(1-e)*r.x+e*e*n.x,l=(1-e)*(1-e)*t.y+2*e*(1-e)*r.y+e*e*n.y;return new ot(i,l);}/**
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,i){var l=t.x*(1-e)*(1-e)*(1-e)+3*r.x*e*(1-e)*(1-e)+3*n.x*e*e*(1-e)+i.x*e*e*e,o=t.y*(1-e)*(1-e)*(1-e)+3*r.y*e*(1-e)*(1-e)+3*n.y*e*e*(1-e)+i.y*e*e*e;return new ot(l,o);}}]);}();var _i=/*#__PURE__*/function(_Mt10){function _i(t){var _this81;_classCallCheck(this,_i);_this81=_callSuper(this,_i,[t]);at(_this81,"canRotate",!1);at(_this81,"scaleType",Qt.all);at(_this81,"toolsType",St.SpeechBalloon);at(_this81,"ratio",0.8);at(_this81,"tmpPoints",[]);at(_this81,"workOptions");at(_this81,"oldRect");at(_this81,"syncTimestamp");_this81.workOptions=t.toolsOpt,_this81.syncTimestamp=0,_this81.syncUnitTime=50;return _this81;}_inherits(_i,_Mt10);return _createClass(_i,[{key:"consume",value:function consume(t){var x;var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=(x=r==null?void 0:r.workId)==null?void 0:x.toString();if(!o)return{type:dt.None};var a=r.op,f=a==null?void 0:a.length;if(!f||f<2)return{type:dt.None};var g;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(a[0],a[1])],g=!1):g=this.updateTempPoints(a),!g)return{type:dt.None};var c;if(i||l){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({workId:o,layer:M,isDrawing:!0});}if(!i){var _M6=Date.now();return _M6-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M6,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var m=Wt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:m,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=Te(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Mt.getCenterPos(n,r)}),_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local,ops:l,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines5=t.isDrawEraserlines,i=_t$isDrawEraserlines5===void 0?!0:_t$isDrawEraserlines5,_this$workOptions12=this.workOptions,l=_this$workOptions12.strokeColor,o=_this$workOptions12.fillColor,a=_this$workOptions12.thickness,f=_this$workOptions12.zIndex,g=_this$workOptions12.placement,c=_this$workOptions12.scale,m=_this$workOptions12.rotate,x=_this$workOptions12.translate,M=_this$workOptions12.strokeType,S=_this$workOptions12.eraserlines,_this$computDrawPoint8=this.computDrawPoints(a,g),P=_this$computDrawPoint8.rect,T=_this$computDrawPoint8.pos,h=_this$computDrawPoint8.points,p={points:h.map(function(w){return w.XY;}),lineWidth:a,fillColor:o!=="transparent"&&o||void 0,strokeColor:l,normalize:!0,className:"".concat(T[0],",").concat(T[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:M===Vt.Dotted?[1,a*2]:M===Vt.LongDotted?[a,a*2]:void 0},d={name:r,id:r,zIndex:f,pos:T,anchor:[0.5,0.5],size:[P.w,P.h]};c&&(d.scale=c),m&&(d.rotate=m),x&&(d.translate=x);var y=new de(d),O=new Re(_objectSpread(_objectSpread({},p),{},{pos:[0,0]}));y.append(O),S&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:y,eraserlines:S,pos:T,layer:n},i)),this.replace(n,r,y);var E=y.getBoundingClientRect();return this.isDelete&&y.setAttribute("opacity",0),{x:Math.floor(E.x-Mt.SafeBorderPadding),y:Math.floor(E.y-Mt.SafeBorderPadding),w:Math.floor(E.width+Mt.SafeBorderPadding*2),h:Math.floor(E.height+Mt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var r=qt(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=r.y+r.h*this.ratio;return[new ot(r.x,r.y,0),new ot(r.x+r.w,r.y,0),new ot(r.x+r.w,n,0),new ot(r.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=r.y+r.h*(1-this.ratio);return[new ot(r.x,_n4,0),new ot(r.x+r.w,_n4,0),new ot(r.x+r.w,r.y+r.h,0),new ot(r.x,r.y+r.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=r.x+r.w*(1-this.ratio);return[new ot(_n5,r.y,0),new ot(r.x+r.w,r.y,0),new ot(r.x+r.w,r.y+r.h,0),new ot(_n5,r.y+r.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=r.x+r.w*this.ratio;return[new ot(r.x,r.y,0),new ot(_n6,r.y,0),new ot(_n6,r.y+r.h,0),new ot(r.x,r.y+r.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=qt(this.tmpPoints),i=this.transformControlPoints(r),l=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),a=[],f=ot.Add(i[0],new ot(0,o,0)),g=ot.Add(i[0],new ot(l,0,0)),c=Ce.getBezierPoints(10,f,i[0],g),m=ot.Sub(i[1],new ot(l,0,0)),x=ot.Add(i[1],new ot(0,o,0)),M=Ce.getBezierPoints(10,m,i[1],x),S=ot.Sub(i[2],new ot(0,o,0)),P=ot.Sub(i[2],new ot(l,0,0)),T=Ce.getBezierPoints(10,S,i[2],P),h=ot.Add(i[3],new ot(l,0,0)),p=ot.Sub(i[3],new ot(0,o,0)),d=Ce.getBezierPoints(10,h,i[3],p),y=l*(1-this.ratio)*10,O=o*(1-this.ratio)*10;switch(r){case"bottom":{var B=ot.Sub(i[2],new ot(l*5-y/2,0,0)),A=ot.Sub(i[2],new ot(l*5,-O,0)),b=ot.Sub(i[2],new ot(l*5+y/2,0,0));a.push.apply(a,[A,b].concat(_toConsumableArray(d),_toConsumableArray(c),_toConsumableArray(M),_toConsumableArray(T),[B]));break;}case"bottomRight":{var _B11=ot.Sub(i[2],new ot(l*1.1,0,0)),_A9=ot.Sub(i[2],new ot(l*1.1+y/2,-O,0)),_b9=ot.Sub(i[2],new ot(l*1.1+y,0,0));a.push.apply(a,[_A9,_b9].concat(_toConsumableArray(d),_toConsumableArray(c),_toConsumableArray(M),_toConsumableArray(T),[_B11]));break;}case"bottomLeft":{var _B12=ot.Add(i[3],new ot(l*1.1+y,0,0)),_A10=ot.Add(i[3],new ot(l*1.1+y/2,O,0)),_b10=ot.Add(i[3],new ot(l*1.1,0,0));a.push.apply(a,[_A10,_b10].concat(_toConsumableArray(d),_toConsumableArray(c),_toConsumableArray(M),_toConsumableArray(T),[_B12]));break;}case"top":{var _B13=ot.Sub(i[1],new ot(l*5-y/2,0,0)),_A11=ot.Sub(i[1],new ot(l*5,O,0)),_b11=ot.Sub(i[1],new ot(l*5+y/2,0,0));a.push.apply(a,[_A11,_B13].concat(_toConsumableArray(M),_toConsumableArray(T),_toConsumableArray(d),_toConsumableArray(c),[_b11]));break;}case"topRight":{var _B14=ot.Sub(i[1],new ot(l*1.1,0,0)),_A12=ot.Sub(i[1],new ot(l*1.1+y/2,O,0)),_b12=ot.Sub(i[1],new ot(l*1.1+y,0,0));a.push.apply(a,[_A12,_B14].concat(_toConsumableArray(M),_toConsumableArray(T),_toConsumableArray(d),_toConsumableArray(c),[_b12]));break;}case"topLeft":{var _B15=ot.Add(i[0],new ot(l*1.1+y,0,0)),_A13=ot.Add(i[0],new ot(l*1.1+y/2,-O,0)),_b13=ot.Add(i[0],new ot(l*1.1,0,0));a.push.apply(a,[_A13,_B15].concat(_toConsumableArray(M),_toConsumableArray(T),_toConsumableArray(d),_toConsumableArray(c),[_b13]));break;}case"left":{var _B16=ot.Add(i[0],new ot(0,o*5-O/2,0)),_A14=ot.Add(i[0],new ot(-y,o*5,0)),_b14=ot.Add(i[0],new ot(0,o*5+O/2,0));a.push.apply(a,[_A14,_B16].concat(_toConsumableArray(c),_toConsumableArray(M),_toConsumableArray(T),_toConsumableArray(d),[_b14]));break;}case"leftTop":{var _B17=ot.Add(i[0],new ot(0,o*1.1,0)),_A15=ot.Add(i[0],new ot(-y,o*1.1+O/2,0)),_b15=ot.Add(i[0],new ot(0,o*1.1+O,0));a.push.apply(a,[_A15,_B17].concat(_toConsumableArray(c),_toConsumableArray(M),_toConsumableArray(T),_toConsumableArray(d),[_b15]));break;}case"leftBottom":{var _B18=ot.Sub(i[3],new ot(0,o*1.1+O,0)),_A16=ot.Sub(i[3],new ot(y,o*1.1+O/2,0)),_b16=ot.Sub(i[3],new ot(0,o*1.1,0));a.push.apply(a,[_A16,_B18].concat(_toConsumableArray(c),_toConsumableArray(M),_toConsumableArray(T),_toConsumableArray(d),[_b16]));break;}case"right":{var _B19=ot.Add(i[1],new ot(0,o*5-O/2,0)),_A17=ot.Add(i[1],new ot(y,o*5,0)),_b17=ot.Add(i[1],new ot(0,o*5+O/2,0));a.push.apply(a,[_A17,_b17].concat(_toConsumableArray(T),_toConsumableArray(d),_toConsumableArray(c),_toConsumableArray(M),[_B19]));break;}case"rightTop":{var _B20=ot.Add(i[1],new ot(0,o*1.1,0)),_A18=ot.Add(i[1],new ot(y,o*1.1+O/2,0)),_b18=ot.Add(i[1],new ot(0,o*1.1+O,0));a.push.apply(a,[_A18,_b18].concat(_toConsumableArray(T),_toConsumableArray(d),_toConsumableArray(c),_toConsumableArray(M),[_B20]));break;}case"rightBottom":{var _B21=ot.Sub(i[2],new ot(0,o*1.1+O,0)),_A19=ot.Sub(i[2],new ot(-y,o*1.1+O/2,0)),_b19=ot.Sub(i[2],new ot(0,o*1.1,0));a.push.apply(a,[_A19,_b19].concat(_toConsumableArray(T),_toConsumableArray(d),_toConsumableArray(c),_toConsumableArray(M),[_B21]));break;}}var E=qt(this.tmpPoints,t),w=[Math.floor(E.x+E.w/2),Math.floor(E.y+E.h/2)];return{rect:E,pos:w,points:a};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l)||Dt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var f,g;var r=t.op,n=t.isFullWork,_t$workState7=t.workState,i=_t$workState7===void 0?Ft.Done:_t$workState7,l=(f=this.workId)==null?void 0:f.toString();if(!l)return;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3)this.tmpPoints.push(new Dt(r[c],r[c+1],r[c+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(g=this.vNodes)==null||g.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Mt.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var M;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,f=n.placement,g=n.strokeType,c=i.get(r.name),m=c==null?void 0:c.opt;var x=r;return r.tagName==="GROUP"&&(x=r.children[0]),l&&(x.setAttribute("strokeColor",l),m!=null&&m.strokeColor&&(m.strokeColor=l)),o&&(o==="transparent"?x.setAttribute("fillColor","rgba(0,0,0,0)"):x.setAttribute("fillColor",o),m!=null&&m.fillColor&&(m.fillColor=o)),a===St.SpeechBalloon&&f&&(m.placement=f),g&&c!=null&&c.opt&&(M=c.opt)!=null&&M.strokeType&&(c.opt.strokeType=g),c&&i.setInfo(r.name,_objectSpread(_objectSpread({},c),{},{opt:m})),Mt.updateNodeOpt(t);}}]);}(Mt);var im=Je,sm=De,om="[object Boolean]";function am(u){return u===!0||u===!1||sm(u)&&im(u)==om;}var lm=am,He=/* @__PURE__ */Ne(lm);var ar=/*#__PURE__*/function(_Mt11){function ar(t){var _this82;_classCallCheck(this,ar);_this82=_callSuper(this,ar,[t]);at(_this82,"canRotate",!0);at(_this82,"scaleType",Qt.all);at(_this82,"toolsType",St.Image);at(_this82,"tmpPoints",[]);at(_this82,"workOptions");at(_this82,"oldRect");_this82.workOptions=t.toolsOpt,_this82.scaleType=ar.getScaleType(_this82.workOptions);return _this82;}_inherits(ar,_Mt11);return _createClass(ar,[{key:"consume",value:function consume(){return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:dt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,i=t.replaceId,l=t.imageBitmap,_this$workOptions13=this.workOptions,o=_this$workOptions13.centerX,a=_this$workOptions13.centerY,f=_this$workOptions13.width,g=_this$workOptions13.height,c=_this$workOptions13.rotate,m=_this$workOptions13.zIndex,x=_this$workOptions13.eraserlines,M=new de({anchor:[0.5,0.5],pos:[o,a],name:n,size:[f,g],zIndex:m,rotate:c}),S={anchor:[0.5,0.5],pos:[0,0],size:[f,g],texture:l};l||(S.bgcolor="rgba(0,0,0,0.3)");var P=new hi(S);M.append(P),x&&this.drawEraserlines({group:M,eraserlines:x,pos:[o,a],layer:r}),this.replace(r,i||n,M);var T=M.getBoundingClientRect();if(T)return{x:Math.floor(T.x-Mt.SafeBorderPadding),y:Math.floor(T.y-Mt.SafeBorderPadding),w:Math.floor(T.width+Mt.SafeBorderPadding*2),h:Math.floor(T.height+Mt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var g,c,m,x,r,n,i,_this$workOptions14,l,o,a,f,M,S;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:r=t.isFullWork,n=t.replaceId,i=t.worker,_this$workOptions14=this.workOptions,l=_this$workOptions14.src,o=_this$workOptions14.uuid,a=((g=this.workId)==null?void 0:g.toString())||o,f=r?this.fullLayer:this.drawLayer||this.fullLayer;if(!l){_context25.next=8;break;}_context25.next=4;return i.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:a,isSubWorker:i instanceof ds});case 4:M=_context25.sent;if(!M){_context25.next=8;break;}S=this.draw({workId:a,layer:f,replaceId:n,imageBitmap:M});return _context25.abrupt("return",(this.oldRect=a&&((m=(c=this.vNodes)==null?void 0:c.get(a))==null?void 0:m.rect)||void 0,(x=this.vNodes)==null||x.setInfo(a,{rect:S,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:S&&Mt.getCenterPos(S,f)}),S));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x34){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?Qt.proportional:Qt.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,i=t.vNodes,l=t.targetNode,o=n.translate,a=n.originPoint,f=n.scenePoint,g=n.scale,c=n.angle,m=n.isLocked,x=n.zIndex,M=n.strokeColor,S=l&&ue(l)||i.get(r.name);if(!S)return;var P=r.parent;if(P){if(M&&(S.opt.strokeColor=M),he(x)&&(r.setAttribute("zIndex",x),S.opt.zIndex=x),He(m)&&(S.opt.locked=m),a&&f&&g&&o){var _S$opt=S.opt,_T35=_S$opt.centerX,_h31=_S$opt.centerY,p=_S$opt.width,d=_S$opt.height,y=_S$opt.uniformScale,O=y!==!1?[g[0],g[0]]:g,E=[_T35,_h31],w=[_T35,_h31];mn(w,f,O,o);var B=[w[0]-E[0],w[1]-E[1]];if(S.centerPos=[S.centerPos[0]+B[0],S.centerPos[1]+B[1]],S.opt.width=Math.round(p*O[0]),S.opt.height=Math.round(d*O[1]),S.opt.centerX=w[0],S.opt.centerY=w[1],S.opt.eraserlines)for(var _i6=0,_Object$values4=Object.values(S.opt.eraserlines);_i6<_Object$values4.length;_i6++){var A=_Object$values4[_i6];var b=A.op,W=A.thickness;A.thickness=W*Math.max(g[0],g[1]);for(var D=0;D<b.length;D++)vn(b[D],f,g,o);}}else if(o){if(S.opt.centerX=S.opt.centerX+o[0],S.opt.centerY=S.opt.centerY+o[1],S.centerPos=[S.centerPos[0]+o[0],S.centerPos[1]+o[1]],S.opt.eraserlines)for(var _i7=0,_Object$values5=Object.values(S.opt.eraserlines);_i7<_Object$values5.length;_i7++){var _T36=_Object$values5[_i7];var _h32=_T36.op;for(var _p12=0;_p12<_h32.length;_p12++){var _d14=_h32[_p12].map(function(y,O){return O%2?y+o[1]:y+o[0];});_T36.op[_p12]=_d14;}}}else if(he(c))if(S.opt.rotate=c,S.scaleType=ar.getScaleType(S.opt),l){var _T37=ns(S.rect,c);S.rect=_T37;}else{var _T38=Mt.getRectFromLayer(P,r.name);S.rect=_T38||S.rect;}return S&&i.setInfo(r.name,S),S==null?void 0:S.rect;}}}]);}(Mt);var ts=/*#__PURE__*/function(_Mt12){function ts(t){var _this83;_classCallCheck(this,ts);_this83=_callSuper(this,ts,[t]);at(_this83,"canRotate",!1);at(_this83,"scaleType",Qt.both);at(_this83,"toolsType",St.Straight);at(_this83,"tmpPoints",[]);at(_this83,"workOptions");at(_this83,"oldRect");at(_this83,"straightTipWidth");at(_this83,"syncTimestamp");_this83.workOptions=t.toolsOpt,_this83.straightTipWidth=_this83.workOptions.thickness/2,_this83.syncTimestamp=0,_this83.syncUnitTime=50;return _this83;}_inherits(ts,_Mt12);return _createClass(ts,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=this.workId,a=r.op,f=r.syncUnitTime,g=a==null?void 0:a.length;if(!g||g<2)return{type:dt.None};f&&(this.syncUnitTime=f);var c;if(this.tmpPoints.length===0?(this.tmpPoints=[new Dt(a[0],a[1])],c=!1):c=this.updateTempPoints(a),!c)return{type:dt.None};var m;if(i||l){var M=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({workId:o,layer:M});}if(!i){var _M7=Date.now();return _M7-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_M7,_objectSpread({type:dt.DrawWork,dataType:bt.Local,op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var x=Wt(m,this.oldRect);return this.oldRect=m,_objectSpread({rect:x,type:dt.DrawWork,dataType:bt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=Te(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Mt.getCenterPos(n,r)}),_objectSpread({rect:n,type:dt.FullWork,dataType:bt.Local,ops:l,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines6=t.isDrawEraserlines,i=_t$isDrawEraserlines6===void 0?!0:_t$isDrawEraserlines6,_this$workOptions15=this.workOptions,l=_this$workOptions15.strokeColor,o=_this$workOptions15.thickness,a=_this$workOptions15.zIndex,f=_this$workOptions15.scale,g=_this$workOptions15.rotate,c=_this$workOptions15.translate,m=_this$workOptions15.strokeType,x=_this$workOptions15.eraserlines,M=n.worldPosition,S=n.worldScaling,_this$computDrawPoint9=this.computDrawPoints(o,m),P=_this$computDrawPoint9.d,T=_this$computDrawPoint9.rect,h=_this$computDrawPoint9.isDot,p=[T.x+T.w/2,T.y+T.h/2],d=new de({pos:p,anchor:[0.5,0.5],size:[T.w,T.h],name:r,id:r,normalize:!0,zIndex:a}),y={pos:[0,0],normalize:!0,d:P,fillColor:l,strokeColor:l,lineDash:m===Vt.Dotted&&!h?[1,o*2]:m===Vt.LongDotted&&!h?[o,o*2]:void 0,lineCap:m===Vt.Normal||h?void 0:"round",lineWidth:m===Vt.Normal||h?0:o};f&&(y.scale=f),g&&(y.rotate=g),c&&(y.translate=c);var O=new Ae(y);d.append(O),x&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:d,eraserlines:x,pos:p,layer:n},i)),this.replace(n,r,d);var E={x:Math.floor(T.x*S[0]+M[0]-Mt.SafeBorderPadding),y:Math.floor(T.y*S[1]+M[1]-Mt.SafeBorderPadding),w:Math.floor(T.w*S[0]+2*Mt.SafeBorderPadding),h:Math.floor(T.h*S[1]+2*Mt.SafeBorderPadding)};if(g||f||c){var w=O.getBoundingClientRect();E={x:Math.floor(w.x-Mt.SafeBorderPadding),y:Math.floor(w.y-Mt.SafeBorderPadding),w:Math.floor(w.width+Mt.SafeBorderPadding*2),h:Math.floor(w.height+Mt.SafeBorderPadding*2)};}return this.isDelete&&d.setAttribute("opacity",0),E;}},{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=ot.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),i=ot.Per(n).mul(t/2),l=Dt.Sub(this.tmpPoints[0],i),o=Dt.Add(this.tmpPoints[0],i),a=Dt.Sub(this.tmpPoints[1],i),f=Dt.Add(this.tmpPoints[1],i),g=Dt.GetSemicircleStroke(this.tmpPoints[1],a,-1,8),c=Dt.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),m=[l,a].concat(_toConsumableArray(g),[f,o],_toConsumableArray(c));var x;return r!==Vt.Normal?x=Ee(this.tmpPoints,!1):x=Ee(m,!0),{d:x,rect:qt(m),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var r=Dt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:Ee(r,!0),rect:qt(r),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Dt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))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 f,g;var r=t.op,n=t.isFullWork,_t$workState8=t.workState,i=_t$workState8===void 0?Ft.Done:_t$workState8,l=(f=this.workId)==null?void 0:f.toString();if(!l)return;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3)this.tmpPoints.push(new Dt(r[c],r[c+1],r[c+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(g=this.vNodes)==null||g.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Mt.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var f,g;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.strokeType,a=i.get(r.name);return l&&(r.tagName==="GROUP"?r.children.forEach(function(c){c.setAttribute("strokeColor",l),c.getAttribute("fillColor")&&c.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(f=a==null?void 0:a.opt)!=null&&f.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(g=a.opt)!=null&&g.strokeType&&(a.opt.strokeType=o),a&&i.setInfo(r.name,a),Mt.updateNodeOpt(t);}}]);}(Mt);var be=/*#__PURE__*/function(_Mt13){function be(t){var _this84;_classCallCheck(this,be);_this84=_callSuper(this,be,[t]);at(_this84,"canRotate",!1);at(_this84,"scaleType",Qt.proportional);at(_this84,"toolsType",St.Text);at(_this84,"tmpPoints",[]);at(_this84,"workOptions");at(_this84,"oldRect");_this84.workOptions=t.toolsOpt;return _this84;}_inherits(be,_Mt13);return _createClass(be,[{key:"consume",value:function consume(){return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:dt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var r,n,i,_this$workOptions16,l,o,a,f,g,c,m,x,M,S,P,_T39;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:r=t.workId,n=t.layer,i=t.isDrawLabel,_this$workOptions16=this.workOptions,l=_this$workOptions16.boxSize,o=_this$workOptions16.boxPoint,a=_this$workOptions16.zIndex,f=n.worldPosition,g=n.worldScaling;if(!(!o||!l)){_context26.next=3;break;}return _context26.abrupt("return");case 3:c={name:r,id:r,pos:[o[0],o[1]],anchor:[0,0],size:l,zIndex:a},m=new de(c),x={x:o[0],y:o[1],w:l[0],h:l[1]},M={x:Math.floor(x.x*g[0]+f[0]),y:Math.floor(x.y*g[1]+f[1]),w:Math.floor(x.w*g[0])+2,h:Math.floor(x.h*g[1])+2};if(!(this.replace(n,r,m),i&&n&&this.workOptions.text)){_context26.next=11;break;}_context26.next=7;return be.createLabels(this.workOptions,n,M);case 7:S=_context26.sent;P=S.labels;_T39=S.maxWidth;m.append.apply(m,_toConsumableArray(P)),M.w=Math.ceil(Math.max(_T39*n.worldScaling[0],M.w));case 11:return _context26.abrupt("return",M);case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x35){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var f,g,c,m,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:r=(f=this.workId)==null?void 0:f.toString();if(r){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,l=t.isDrawLabel;this.oldRect=i&&((c=(g=this.vNodes)==null?void 0:g.get(i))==null?void 0:c.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:r,layer:o,isDrawLabel:_typeof(l)>"u"&&this.workOptions.workState===Ft.Done||l});case 8:a=_context27.sent;return _context27.abrupt("return",((m=this.vNodes)==null||m.setInfo(r,{rect:a,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&Mt.getCenterPos(a,o)}),a));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x36){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){var M,S,n,i,l,o,a,f,g,c,m,x;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:if(this.workId){_context28.next=2;break;}return _context28.abrupt("return");case 2:n=this.workId.toString(),i=t.fontColor,l=t.fontBgColor,o=t.bold,a=t.italic,f=t.lineThrough,g=t.underline,c=t.zIndex,m=(M=this.vNodes)==null?void 0:M.get(n);if(m){_context28.next=5;break;}return _context28.abrupt("return");case 5:i&&(m.opt.fontColor=i),l&&(m.opt.fontBgColor=l),o&&(m.opt.bold=o),a&&(m.opt.italic=a),He(f)&&(m.opt.lineThrough=f),He(g)&&(m.opt.underline=g),he(c)&&(m.opt.zIndex=c),this.oldRect=m.rect;_context28.next=8;return this.draw({workId:n,layer:this.fullLayer,isDrawLabel:_typeof(r)>"u"&&this.workOptions.workState===Ft.Done||r});case 8:x=_context28.sent;return _context28.abrupt("return",((S=this.vNodes)==null||S.setInfo(n,{rect:x,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:x&&Mt.getCenterPos(x,this.fullLayer)}),x));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x37,_x38){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 i=n;return n>=0.2&&n<1?i=n*r:n<=2&&n>=1?i=n*r*1.6:n>2&&n<=3?i=n*r*1.4:n>3&&n<=4?i=n*r*0.8:n>4&&(i=n*r*0.6),Math.floor(i*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(be.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,r,n){var b,i,l,o,_ref168,a,f,g,c,m,x,M,S,P,T,h,p,d,y,O,E,w,B,A,W,D,R,j,k,J,rt,st,$,V,nt,ct,pt,et,gt,Tt,X,z,Q,tt,lt,_et2,_gt,_Tt,_et3,_gt2,_ct3,_pt2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:i=[],l=n.x,o=n.y,_ref168=(b=r.parent)==null?void 0:b.parent,a=_ref168.width,f=_ref168.height,g=Ze(t.text),c=g.length,m=t.fontSize,x=t.lineHeight,M=t.bold,S=t.textAlign,P=t.italic,T=t.fontFamily,h=t.verticalAlign,p=t.fontColor,d=t.fontBgColor,y=t.underline,O=t.lineThrough,E=be.getSafetySnippetRatio(r)||1,w=Math.floor(m*E),B=be.getSafetySnippetFontLength(w);A=0;W=0;case 3:if(!(W<c)){_context29.next=33;break;}D=g[W],R=x||w*1.5;if(!D){_context29.next=30;break;}j=Pm(D),k=[0,0],J=[0,m*1.2];h==="middle"&&(k[1]=W*m*1.2+5);rt=[0,-m*0.15];k[0]=5;st=Math.sin(Math.PI/180*20);$=0;V=[];nt=0;case 14:if(!(nt<j)){_context29.next=27;break;}S==="left"&&(rt[0]=$),nt===0&&P==="italic"&&(rt[0]=rt[0]-st/2*m);ct=D.slice(nt,nt+B);pt={anchor:[0,0],pos:rt,text:ct,fontFamily:T,fontSize:w,lineHeight:R,strokeColor:p,fontWeight:M,fillColor:p,textAlign:S,fontStyle:P,scale:[1/E,1/E]};et=new po(pt);_context29.next=21;return et.textImageReady;case 21:gt=_context29.sent;Tt=!0;if(gt){X=gt.rect&&gt.rect[2],z=gt.rect&&gt.rect[3];if(X&&z){Q=X/E,tt=z/E;$=Q+$,P==="italic"&&(M==="bold"?$=$-st*m*1.2:$=$-st*m),((rt[0]+k[0]+Q)*r.worldScaling[0]+l<=0||(rt[0]+k[0])*r.worldScaling[0]+l>=a||(rt[1]+k[1]+tt)*r.worldScaling[1]+o<=0||(rt[1]+k[1])*r.worldScaling[1]+o>=f)&&(et.disconnect(),Tt=!1),Tt&&V.push(et);}}nt+=B;case 25:_context29.next=14;break;case 27:J[0]=$,P==="italic"&&(J[0]=J[0]+st*m),A=Math.max(A,J[0]);lt=!0;if(((k[0]+J[0])*r.worldScaling[0]+l<=0||k[0]*r.worldScaling[0]+l>=a||(k[1]+J[1])*r.worldScaling[0]+o<=0||k[1]*r.worldScaling[1]+o>=f)&&(lt=!1),lt){if(y){_et2=Math.floor(m/10),_gt={normalize:!1,pos:[0,m*1.1+_et2/2],lineWidth:_et2,points:[0,0,Math.ceil(J[0]),0],strokeColor:p,className:"underline"},_Tt=new Re(_gt);V.push(_Tt);}if(O){_et3={normalize:!1,pos:[0,m*1.2/2],lineWidth:Math.floor(m/10),points:[0,0,Math.ceil(J[0]),0],strokeColor:p,className:"lineThrough"},_gt2=new Re(_et3);V.push(_gt2);}_ct3={pos:k,anchor:[0,0],size:J,bgcolor:d},_pt2=new de(_ct3);_pt2.append.apply(_pt2,V),i.push(_pt2);}case 30:W++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:i,maxWidth:A});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x39,_x40,_x41){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,i=t.vNodes,l=t.targetNode,o=n.fontBgColor,a=n.fontColor,f=n.translate,g=n.originPoint,c=n.scenePoint,m=n.scale,x=n.bold,M=n.italic,S=n.lineThrough,P=n.underline,T=n.fontSize,h=n.textInfos,p=n.zIndex,d=l&&ue(l)||i.get(r.name);if(!d||!r.parent)return;var O=d.opt;if(he(p)&&(r.setAttribute("zIndex",p),d.opt.zIndex=p),a&&O.fontColor&&(O.fontColor=a,r.children.forEach(function(E){E.tagName==="GROUP"&&E.children.forEach(function(w){w.tagName==="LABEL"?(w.setAttribute("fillColor",a),w.setAttribute("strokeColor",a)):w.tagName==="POLYLINE"&&w.setAttribute("strokeColor",a);});})),o&&O.fontBgColor&&(O.fontBgColor=o,r.children.forEach(function(E){E.tagName==="GROUP"&&E.setAttribute("bgcolor",o);})),x&&(O.bold=x),M&&(O.italic=M),He(S)&&(O.lineThrough=S),He(P)&&(O.underline=P),T&&(O.fontSize=T),g&&c&&m&&l&&O.boxPoint){var E=h==null?void 0:h.get(r.name);if(E){var b=E.fontSize,W=E.boxSize;O.boxSize=W||O.boxSize,O.fontSize=b||O.fontSize;}var w=[O.boxPoint[0],O.boxPoint[1]];mn(O.boxPoint,c,m,f);var B=[d.op[0],d.op[1]],A=[B[0]-w[0],B[1]-w[1]];if(d.centerPos=[d.centerPos[0]+A[0],d.centerPos[1]+A[1]],d.opt.eraserlines)for(var _i8=0,_Object$values6=Object.values(d.opt.eraserlines);_i8<_Object$values6.length;_i8++){var _b20=_Object$values6[_i8];var _W10=_b20.op,D=_b20.thickness;_b20.thickness=D*Math.max(m[0],m[1]);for(var R=0;R<_W10.length;R++)vn(_W10[R],c,m,f);}}else if(f&&O.boxPoint&&(O.boxPoint=[O.boxPoint[0]+f[0],O.boxPoint[1]+f[1]],d.centerPos=[d.centerPos[0]+f[0],d.centerPos[1]+f[1]],d.opt.eraserlines))for(var _i9=0,_Object$values7=Object.values(d.opt.eraserlines);_i9<_Object$values7.length;_i9++){var _E7=_Object$values7[_i9];var _w6=_E7.op;for(var _B22=0;_B22<_w6.length;_B22++){var _A20=_w6[_B22].map(function(b,W){return W%2?b+f[1]:b+f[0];});_E7.op[_B22]=_A20;}}return d&&i.setInfo(r.name,d),d==null?void 0:d.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,r){var n=t.getElementsByName(r)[0];if(n){var i=n.getBoundingClientRect();var l={x:Math.floor(i.x),y:Math.floor(i.y),w:Math.floor(i.width+2),h:Math.floor(i.height+2)};return n.children.forEach(function(o){if(o.tagName==="GROUP"){var a=n.getBoundingClientRect();l=Wt(l,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+2),h:Math.floor(a.height+2)});}}),l;}}}]);}(Mt);// 4k
437
+ at(be,"textImageSnippetSize",1024*4),at(be,"SafeBorderPadding",30);var lr=be;var Ve=/*#__PURE__*/function(_Mt14){function Ve(t){var _this85;_classCallCheck(this,Ve);_this85=_callSuper(this,Ve,[t]);at(_this85,"canRotate",!1);at(_this85,"scaleType",Qt.none);at(_this85,"toolsType",St.PencilEraser);at(_this85,"tmpPoints",[]);at(_this85,"workOptions");at(_this85,"worldPosition");at(_this85,"worldScaling");at(_this85,"eraserRect");at(_this85,"eraserPolyline");at(_this85,"syncUnitTime",Se.syncOpt.interval);at(_this85,"syncIndex",0);at(_this85,"syncTimestamp");_this85.workOptions=t.toolsOpt,_this85.worldPosition=_this85.fullLayer.worldPosition,_this85.worldScaling=_this85.fullLayer.worldScaling,_this85.syncTimestamp=0;return _this85;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ve,_Mt14);return _createClass(Ve,[{key:"combineConsume",value:function combineConsume(){if(this.tmpPoints.length<2)return{type:dt.None};var t=this.workOptions.thickness,_Ve$eraserSizes$t=Ve.eraserSizes[t],r=_Ve$eraserSizes$t.width,n=_Ve$eraserSizes$t.height,i=Math.max(r,n)/this.worldScaling[0],l=this.drawLayer||this.fullLayer,o=this.workId,a={name:o};return{rect:this.draw({attrs:a,consumePoints:this.tmpPoints,replaceId:o,layer:l,thickness:i}),type:dt.DrawWork,dataType:bt.Local};}},{key:"consumeService",value:function consumeService(t){var r=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3){var m=new Dt(r[c],r[c+1],r[c+2]);if(this.tmpPoints.length>0){var x=this.tmpPoints[this.tmpPoints.length-1],M=ot.Sub(m,x).uni();m.setv(M);}this.tmpPoints.push(m);}if(this.tmpPoints.length<2)return;var l=this.tmpPoints[0].z*2,o=n?this.fullLayer:this.drawLayer||this.fullLayer,f={name:this.workId};return this.draw({attrs:f,consumePoints:this.tmpPoints,layer:o,thickness:l,replaceId:i});}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var i=Date.now();for(var l=0;l<t.length;l+=2){var o=this.tmpPoints.length,a=new Dt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var f=o-1,g=this.tmpPoints[f],c=ot.Sub(a,g).uni();a.isNear(g,r/2)||(ot.Equals(c,g.v,0.02)&&(this.tmpPoints.pop(),n--),a.setv(c),a.setT(i),this.tmpPoints.push(a));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var n=/* @__PURE__ */new Map(),i=/* @__PURE__ */new Set();var l;if(!this.vNodes)return{willDeleteNodes:i,willNewNodes:n,rect:l};var o=this.worldPosition;var a=qt(this.tmpPoints,t);a=cr(a,o),a=is(a,this.worldScaling,o);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(a),f=_this$vNodes$getRectI3.nodeRange;if(!f.size)return{willDeleteNodes:i,willNewNodes:n,rect:l};var g=this.computEraserPointLines(this.tmpPoints,90);var _iterator31=_createForOfIteratorHelper(f.entries()),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _step31$value=_slicedToArray(_step31.value,2),c=_step31$value[0],m=_step31$value[1];if(m.toolsType!==St.Pencil)continue;var x=cr(m.rect,[-o[0],-o[1]]);x={x:x.x/this.worldScaling[0],y:x.y/this.worldScaling[1],w:x.w/this.worldScaling[0],h:x.h/this.worldScaling[1]};var M=[x.x,x.y,x.x+x.w,x.y+x.h],S=[],P=[];var _iterator32=_createForOfIteratorHelper(g),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _T42=_step32.value;fn.polyline(_T42,M,S);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}if(S.length&&m.opt){var _iterator33=_createForOfIteratorHelper(S),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _T40=_step33.value;var _h33=[];for(var p=0;p<_T40.length;p++)p!==0&&we(_T40[p],_T40[p-1])||_h33.push.apply(_h33,_toConsumableArray(_T40[p]));P.push(_h33);}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}if(P.length&&r){var _T41=r.createWorkShapeNode({workId:c,toolsType:St.Pencil,toolsOpt:m.opt});_T41.setWorkId(c);var _h34=_T41==null?void 0:_T41.computPencilPoints({op:m.op,eraserPolylines:P,eraserThickness:t});if(l=Wt(l,m.rect),i.add(c),r.removeNode(c),_h34.length)for(var _p13=0;_p13<_h34.length;_p13++){var d="".concat(c,"_").concat(Date.now(),"_").concat(_p13),y=d,E=r.setFullWork({workId:y,opt:m.opt,toolsType:St.Pencil}).consumeService({op:_h34[_p13],isFullWork:!0,replaceId:y});r.clearWorkShapeNodeCache(y),l=Wt(l,E),n.set(d,_objectSpread(_objectSpread({},m),{},{rect:E!==null&&E!==void 0?E:m.rect,name:d,op:_h34[_p13]}));}}}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}return{willNewNodes:n,willDeleteNodes:i,rect:l};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.removeDrawCount,a=t.drawCount,f=r.op,g=r.syncUnitTime;if(!f||f.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);g&&(this.syncUnitTime=g);var c=this.workOptions.thickness,_Ve$eraserSizes$c=Ve.eraserSizes[c],m=_Ve$eraserSizes$c.width,x=_Ve$eraserSizes$c.height,M=Math.max(m,x)/this.worldScaling[0],S=this.tmpPoints.length,P=this.tmpPoints[this.tmpPoints.length-1],T=this.updateTempPoints(f,M),h=this.tmpPoints[this.tmpPoints.length-1];if(S===this.tmpPoints.length&&h.equalsXY(P.x,P.y))return _objectSpread({type:dt.None},this.baseConsumeResult);this.syncIndex=Math.min(this.syncIndex,T,Math.max(0,this.tmpPoints.length-2));var p={name:this.workId,id:he(a)&&a.toString()||void 0},d=this.syncIndex;this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var y=!1,O;var E=this.tmpPoints.slice(T);if(i||l){var B=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({attrs:p,consumePoints:E,layer:B,removeDrawCount:o,thickness:M});}if(i)return T>10&&this.tmpPoints.splice(0,T-10),{rect:O,type:dt.DrawWork,dataType:bt.Local};E[0].t-this.syncTimestamp>this.syncUnitTime&&(y=!0,this.syncTimestamp=E[0].t,this.syncIndex=this.tmpPoints.length);var w=[];return this.tmpPoints.slice(d).forEach(function(B){w.push(B.x,B.y,M/2);}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local,rect:O,op:y?w:void 0,index:y?d*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.attrs,n=t.consumePoints,i=t.layer,l=t.thickness,o=t.replaceId,a=t.removeDrawCount;a&&this.removeDrawCountNodes(i,a);var f=qt(n,l);f={x:Math.floor(f.x*this.worldScaling[0]+this.worldPosition[0]-Mt.SafeBorderPadding),y:Math.floor(f.y*this.worldScaling[1]+this.worldPosition[1]-Mt.SafeBorderPadding),w:Math.floor(f.w*this.worldScaling[0]+2*Mt.SafeBorderPadding),h:Math.floor(f.h*this.worldScaling[1]+2*Mt.SafeBorderPadding)};var g=new de(_objectSpread(_objectSpread({},r),{},{normalize:!0,pos:[0,0],anchor:[0.5,0.5],zIndex:9999,bgcolor:this.workOptions.eraserColor})),c=this.computEraserPointLines(n,90),m=[];var _iterator34=_createForOfIteratorHelper(c),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _x42=_step34.value;m.push({op:_x42,thickness:l});}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}for(var _i10=0,_m3=m;_i10<_m3.length;_i10++){var x=_m3[_i10];var M=x.thickness,S=x.op,P=S.reduce(function(y,O,E,w){return E>0&&w[E-1][0]===O[0]&&w[E-1][1]===O[1]?y:y.concat(O[0],O[1]);},[]),_T43=this.computEraserPoints(P,M),_h35=Ee(_T43,!0),p={pos:[0,0],d:_h35,fillColor:this.workOptions.eraserColor},d=new Ae(p);g.append(d),g.seal();}return this.replace(i,o,g),f;}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var i=0;var l=360-r;for(var o=1;o<t.length;o++){var a=t[o-1],f=t[o];if(o===1&&i===0&&(n[i]=[a.XY]),n[i].push(f.XY),o<t.length-1){var g=f.getAngleByPoints(a,t[o+1]);(g<r||g>l)&&(i++,n[i]=[f.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:dt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_Ve$eraserSizes$n=Ve.eraserSizes[n],i=_Ve$eraserSizes$n.width,l=_Ve$eraserSizes$n.height,o=Math.max(i,l)/this.worldScaling[0],_this$getChangeNodes=this.getChangeNodes(o,r),a=_this$getChangeNodes.willDeleteNodes,f=_this$getChangeNodes.willNewNodes,g=_this$getChangeNodes.rect;if(a.size===0&&f.size===0)return _objectSpread(_objectSpread({type:dt.FullWork},this.baseConsumeResult),{},{rect:g});var c=[];this.tmpPoints.map(function(x){c.push(x.x,x.y,o/2);});var m=Te(c);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.FullWork,dataType:bt.Local,rect:g,ops:m,willNewNodes:f,willDeleteNodes:a});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(Mt);// 来源于white-sdk
438
+ at(Ve,"eraserSizes",ln);var Or=Ve;var Ke=/*#__PURE__*/function(_Mt15){function Ke(t){var _this86;_classCallCheck(this,Ke);_this86=_callSuper(this,Ke,[t]);at(_this86,"canRotate",!1);at(_this86,"scaleType",Qt.none);at(_this86,"toolsType",St.BitMapEraser);at(_this86,"tmpPoints",[]);at(_this86,"workOptions");at(_this86,"worldPosition");at(_this86,"worldScaling");at(_this86,"eraserRect");at(_this86,"eraserPolyline");at(_this86,"syncUnitTime",Se.syncOpt.interval);at(_this86,"syncIndex",0);at(_this86,"syncTimestamp");_this86.workOptions=t.toolsOpt,_this86.worldPosition=_this86.fullLayer.worldPosition,_this86.worldScaling=_this86.fullLayer.worldScaling,_this86.syncTimestamp=0;return _this86;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ke,_Mt15);return _createClass(Ke,[{key:"combineConsume",value:function combineConsume(){if(this.tmpPoints.length<2)return{type:dt.None};var t=this.workOptions.thickness,_Ke$eraserSizes$t=Ke.eraserSizes[t],r=_Ke$eraserSizes$t.width,n=_Ke$eraserSizes$t.height,i=Math.max(r,n)/this.worldScaling[0],l=this.drawLayer||this.fullLayer,o=this.workId,a={name:o};return{rect:this.draw({attrs:a,consumePoints:this.tmpPoints,replaceId:o,layer:l,thickness:i}),type:dt.DrawWork,dataType:bt.Local};}},{key:"consumeService",value:function consumeService(t){var r=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var c=0;c<r.length;c+=3){var m=new Dt(r[c],r[c+1],r[c+2]);if(this.tmpPoints.length>0){var x=this.tmpPoints[this.tmpPoints.length-1],M=ot.Sub(m,x).uni();m.setv(M);}this.tmpPoints.push(m);}if(this.tmpPoints.length<2)return;var l=this.tmpPoints[0].z*2,o=n?this.fullLayer:this.drawLayer||this.fullLayer,f={name:this.workId};return this.draw({attrs:f,consumePoints:this.tmpPoints,layer:o,thickness:l,replaceId:i});}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var i=Date.now();for(var l=0;l<t.length;l+=2){var o=this.tmpPoints.length,a=new Dt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var f=o-1,g=this.tmpPoints[f],c=ot.Sub(a,g).uni();a.isNear(g,r/2)||(ot.Equals(c,g.v,0.02)&&(this.tmpPoints.pop(),n--),a.setv(c),a.setT(i),this.tmpPoints.push(a));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var n=/* @__PURE__ */new Map(),i=/* @__PURE__ */new Set();var l;if(!this.vNodes)return{willDeleteNodes:i,willUpdateNodes:n,rect:l};var o=this.worldPosition;var a=qt(this.tmpPoints,t);a=cr(a,o),a=is(a,this.worldScaling,o);var _this$vNodes$getRectI4=this.vNodes.getRectIntersectRange(a),f=_this$vNodes$getRectI4.nodeRange;if(!f.size)return{willDeleteNodes:i,willUpdateNodes:n,rect:l};var g=this.computEraserPointLines(this.tmpPoints);var _iterator35=_createForOfIteratorHelper(f.entries()),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _step35$value=_slicedToArray(_step35.value,2),c=_step35$value[0],m=_step35$value[1];if(m.toolsType===St.Text||m.toolsType===St.Image)continue;var x=cr(m.rect,[-o[0],-o[1]]);x={x:x.x/this.worldScaling[0],y:x.y/this.worldScaling[1],w:x.w/this.worldScaling[0],h:x.h/this.worldScaling[1]};var M=[x.x,x.y,x.x+x.w,x.y+x.h],S=[],P=[];var _iterator36=_createForOfIteratorHelper(g),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _h38=_step36.value;fn.polyline(_h38,M,S);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}if(S.length&&m.opt){var _iterator37=_createForOfIteratorHelper(S),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _h36=_step37.value;var p=[];for(var d=0;d<_h36.length&&!(isNaN(_h36[d][0])||isNaN(_h36[d][1]));d++)d!==0&&we(_h36[d],_h36[d-1])||p.push.apply(p,_toConsumableArray(_h36[d]));p.length!==0&&P.push(p);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}if(m.opt.eraserlines||(m.opt.eraserlines=[]),m.opt.eraserlines){if(m.opt.eraserlines.push({op:P,thickness:t}),r){var _h37=m.toolsType,_p14=r.createWorkShapeNode({workId:c,toolsType:_h37,toolsOpt:m.opt});_p14==null||_p14.setWorkId(c);var _d15=_p14==null?void 0:_p14.consumeService({op:m.op,isFullWork:!0,replaceId:c});if(l=Wt(l,_d15),_p14!=null&&_p14.isDelete){r.removeNode(c),i.add(c);continue;}}n.set(c,m);}}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}return{willUpdateNodes:n,willDeleteNodes:i,rect:l};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.removeDrawCount,a=t.drawCount,f=r.op,g=r.syncUnitTime;if(!f||f.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);g&&(this.syncUnitTime=g);var c=this.workOptions.thickness,_Ke$eraserSizes$c=Ke.eraserSizes[c],m=_Ke$eraserSizes$c.width,x=_Ke$eraserSizes$c.height,M=Math.max(m,x)/this.worldScaling[0],S=this.tmpPoints.length,P=this.tmpPoints[this.tmpPoints.length-1],T=this.updateTempPoints(f,M),h=this.tmpPoints[this.tmpPoints.length-1];if(S===this.tmpPoints.length&&h.equalsXY(P.x,P.y))return _objectSpread({type:dt.None},this.baseConsumeResult);this.syncIndex=Math.min(this.syncIndex,T,Math.max(0,this.tmpPoints.length-2));var p={name:this.workId,id:he(a)&&a.toString()||void 0},d=this.syncIndex;this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var y=!1,O;var E=this.tmpPoints.slice(T);if(i||l){var B=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({attrs:p,consumePoints:E,layer:B,removeDrawCount:o,thickness:M});}if(i)return T>10&&this.tmpPoints.splice(0,T-10),{rect:O,type:dt.DrawWork,dataType:bt.Local};E[0].t-this.syncTimestamp>this.syncUnitTime&&(y=!0,this.syncTimestamp=E[0].t,this.syncIndex=this.tmpPoints.length);var w=[];return this.tmpPoints.slice(d).forEach(function(B){w.push(B.x,B.y,M/2);}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:bt.Local,rect:O,op:y?w:void 0,index:y?d*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.attrs,n=t.consumePoints,i=t.layer,l=t.thickness,o=t.replaceId,a=t.removeDrawCount;a&&this.removeDrawCountNodes(i,a);var f=qt(n,l);f={x:Math.floor(f.x*this.worldScaling[0]+this.worldPosition[0]-Mt.SafeBorderPadding),y:Math.floor(f.y*this.worldScaling[1]+this.worldPosition[1]-Mt.SafeBorderPadding),w:Math.floor(f.w*this.worldScaling[0]+2*Mt.SafeBorderPadding),h:Math.floor(f.h*this.worldScaling[1]+2*Mt.SafeBorderPadding)};var g=new de(_objectSpread(_objectSpread({},r),{},{normalize:!0,pos:[0,0],anchor:[0.5,0.5],zIndex:9999,bgcolor:this.workOptions.eraserColor})),c=this.computEraserPointLines(n),m=[];var _iterator38=_createForOfIteratorHelper(c),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _x43=_step38.value;m.push({op:_x43,thickness:l});}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}for(var _i11=0,_m4=m;_i11<_m4.length;_i11++){var x=_m4[_i11];var M=x.thickness,S=x.op,P=S.reduce(function(y,O,E,w){return E>0&&w[E-1][0]===O[0]&&w[E-1][1]===O[1]?y:y.concat(O[0],O[1]);},[]),_T44=this.computEraserPoints(P,M),_h39=Ee(_T44,!0),p={pos:[0,0],d:_h39,fillColor:this.workOptions.eraserColor},d=new Ae(p);g.append(d),g.seal();}return this.replace(i,o,g),f;}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var i=0;var l=360-r;for(var o=1;o<t.length;o++){var a=t[o-1],f=t[o];if(o===1&&i===0&&(n[i]=[a.XY]),n[i].push(f.XY),o<t.length-1){var g=f.getAngleByPoints(a,t[o+1]);(g<r||g>l)&&(i++,n[i]=[f.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:dt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_Ke$eraserSizes$n=Ke.eraserSizes[n],i=_Ke$eraserSizes$n.width,l=_Ke$eraserSizes$n.height,o=Math.max(i,l)/this.worldScaling[0],_this$getChangeNodes2=this.getChangeNodes(o,r),a=_this$getChangeNodes2.willDeleteNodes,f=_this$getChangeNodes2.willUpdateNodes,g=_this$getChangeNodes2.rect;if(a.size===0&&f.size===0)return _objectSpread(_objectSpread({type:dt.FullWork},this.baseConsumeResult),{},{rect:g});var c=[];this.tmpPoints.map(function(x){c.push(x.x,x.y,o/2);});var m=Te(c);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.FullWork,dataType:bt.Local,rect:g,ops:m,willUpdateNodes:f,willDeleteNodes:a});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(Mt);// 来源于white-sdk
439
+ at(Ke,"eraserSizes",ln);var Mr=Ke;function es(u){switch(u){case St.Arrow:return Ki;case St.Pencil:return Gi;case St.Straight:return ts;case St.Ellipse:return Zi;case St.Polygon:case St.Triangle:return qi;case St.Star:case St.Rhombus:return Qi;case St.Rectangle:return Ji;case St.SpeechBalloon:return _i;case St.Text:return lr;case St.LaserPen:return Hi;case St.Eraser:return Tr;case St.PencilEraser:return Or;case St.BitMapEraser:return Mr;case St.Selector:return Ir;case St.Image:return ar;}}function pn(u,e){var t=u.toolsType,r=_objectWithoutProperties(u,_excluded);switch(t){case St.Arrow:return new Ki(r);case St.Pencil:return new Gi(r);case St.Straight:return new ts(r);case St.Ellipse:return new Zi(r);case St.Polygon:case St.Triangle:return new qi(r);case St.Star:case St.Rhombus:return new Qi(r);case St.Rectangle:return new Ji(r);case St.SpeechBalloon:return new _i(r);case St.Text:return new lr(r);case St.LaserPen:return new Hi(r);case St.Eraser:return new Tr(r,e);case St.BitMapEraser:return new Mr(r);case St.PencilEraser:return new Or(r);case St.Selector:return r.vNodes?new Ir(_objectSpread(_objectSpread({},r),{},{vNodes:r.vNodes,drawLayer:r.fullLayer})):void 0;case St.Image:return new ar(r);default:return;}}function rs(u){var e=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator39=_createForOfIteratorHelper(u),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var r=_step39.value;if(r.tagName==="GROUP"&&r.children.length){var n=rs(r.children);e.push.apply(e,_toConsumableArray(n));}r.tagName&&t.includes(r.tagName)&&e.push(r);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}return e;}function Wt(u,e){if(u&&e){var t=Math.min(u.x,e.x),r=Math.min(u.y,e.y),n=Math.max(u.x+u.w,e.x+e.w),i=Math.max(u.y+u.h,e.y+e.h),l=n-t,o=i-r;return{x:t,y:r,w:l,h:o};}return e||u;}function qt(u){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,i=-1/0,l=-1/0;return u.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),a=_o$XY[0],f=_o$XY[1];r=Math.min(r,a-e),n=Math.min(n,f-e),i=Math.max(i,a+e),l=Math.max(l,f+e);}),t.x=r,t.y=n,t.w=i-r,t.h=l-n,t;}function Kr(u,e){return!(u.x+u.w<e.x||u.x>e.x+e.w||u.y+u.h<e.y||u.y>e.y+e.h);}function Kt(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(u.x-e),y:Math.floor(u.y-e),w:Math.ceil(u.w+e*2),h:Math.ceil(u.h+e*2)};}function cr(u,e){return{x:u.x+e[0],y:u.y+e[1],w:u.w,h:u.h};}function cm(u,e){var t=new ot(u.x,u.y),r=new ot(u.x+u.w,u.y),n=new ot(u.x+u.w,u.y+u.h),i=new ot(u.x,u.y+u.h),l=new ot(u.x+u.w/2,u.y+u.h/2),o=Math.PI*e/180,a=ot.RotWith(t,l,o),f=ot.RotWith(r,l,o),g=ot.RotWith(n,l,o),c=ot.RotWith(i,l,o);return[a,f,g,c];}function ns(u,e){var t=cm(u,e);return qt(t);}function is(u,e,t){var r=new ot(u.x,u.y),n=new ot(u.x+u.w,u.y),i=new ot(u.x+u.w,u.y+u.h),l=new ot(u.x,u.y+u.h),o=new ot(t[0],t[1]),a=new ot(e[0],e[1]),f=ot.ScaleWOrigin(r,a,o),g=ot.ScaleWOrigin(n,a,o),c=ot.ScaleWOrigin(i,a,o),m=ot.ScaleWOrigin(l,a,o);return qt([f,g,c,m]);}function fm(u,e,t){var r=new ot(e[0],e[1]);for(var n=0;n<u.length;n+=3){var i=new ot(u[n],u[n+1]),l=Math.PI*t/180,o=ot.RotWith(i,r,l);u[n]=o.x,u[n+1]=o.y;}}function hm(u,e,t){var r=new ot(e[0],e[1]);for(var n=0;n<u.length;n+=2){var i=new ot(u[n],u[n+1]),l=Math.PI*t/180,o=ot.RotWith(i,r,l);u[n]=o.x,u[n+1]=o.y;}}function mn(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new ot(e[0],e[1]);for(var i=0;i<u.length;i+=3){var l=new ot(u[i],u[i+1]),o=new ot(t[0],t[1]),a=ot.ScaleWOrigin(l,o,n);u[i]=a.x+r[0],u[i+1]=a.y+r[1];}}function vn(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new ot(e[0],e[1]);for(var i=0;i<u.length;i+=2){var l=new ot(u[i],u[i+1]),o=new ot(t[0],t[1]),a=ot.ScaleWOrigin(l,o,n);u[i]=a.x+r[0],u[i+1]=a.y+r[1];}}function um(u,e){return u[0]>=e.x&&u[0]<=e.x+e.w&&u[1]>=e.y&&u[1]<=e.y+e.h;}function ss(u,e){var t=u<=e?1:u/e,r=e<=u?1:e/u;return[t,r];}function dm(u){var _iterator40=_createForOfIteratorHelper(u),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _e3=_step40.value;if(isNaN(_e3)||_e3===1/0||_e3===-1/0)return!1;}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return!0;}function pm(u){return u!==Math.floor(u);}function mm(u){var e=u.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0;}function vm(u,e){for(;e!==0;){var _ref169=[e,u%e];u=_ref169[0];e=_ref169[1];}return u;}var ym=function ym(u){if(u.tagName==="GROUP"){var _e4=Object.getOwnPropertySymbols(u).find(function(t){return t.toString()==="Symbol(sealed)";});if(_e4&&u[_e4])return!0;}return!1;},_me=function me(u,e){if(u.mesh&&u.mesh.texture&&u.name==="eraserTexture"){var t=u.mesh.texture.image;e.deleteTexture(t);}else if(u.tagName==="GROUP"&&u&&u.children){var _iterator41=_createForOfIteratorHelper(u.children),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _t3=_step41.value;_me(_t3,e);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}}},xe=function xe(u,e){_me(u,e),u.removeAllChildren();},gm=function gm(u,e,t){var r=t.parent;if(e){var n=e.children;if(n){var _iterator42=_createForOfIteratorHelper(n),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var i=_step42.value;if(_me(i,r),i.tagName==="GROUP"){var _iterator43=_createForOfIteratorHelper(i.children),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var l=_step43.value;_me(l,r);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}}}e.parent.replaceChild(u,e);},os=function os(u,e,t){if(u.w+u.x<=0||u.h+u.y<=0||u.w<=0||u.h<=0)return;var r=e.width,n=e.height,i={x:Math.floor(Math.max(0,u.x)),y:Math.floor(Math.max(0,u.y)),w:Math.floor(Math.min(r,u.w)),h:Math.floor(Math.min(n,u.h))};if(i.x+i.w>r&&(i.w=Math.floor(r-i.x)),i.y+i.h>n&&(i.h=Math.floor(n-i.y)),pm(t)){var l=mm(t),o=Math.pow(10,l),a=vm(o,t*o),f=i.x%a,g=i.x-f;g>=0?(i.x=g,i.w=i.w+f):(i.x=0,i.w=i.w+f-g);var c=i.y%a,m=i.y-c;m>=0?(i.y=m,i.h=i.h+c):(i.y=0,i.h=i.h+c-m);}return i;};function ze(u){return"".concat(Er(u.x),",").concat(Er(u.y)," ");}function $e(u,e){return"".concat(Er((u.x+e.x)/2),",").concat(Er((u.y+e.y)/2)," ");}function Er(u){return+u.toFixed(4);}var sr=function sr(u,e){return u.x+u.w<e.x||u.x>e.x+e.w||u.y+u.h<e.y||u.y>e.y+e.h?ye.outside:u.x>=e.x&&u.y>=e.y&&u.x+u.w<=e.x+e.w&&u.y+u.h<=e.y+e.h?ye.inside:ye.intersect;};function Pm(u){var e=0;for(var t=0;t<u.length;t++){var r=u.charCodeAt(t);r>=1&&r<=126||65376<=r&&r<=65439?e++:e+=2;}return e;}var ir="cursorhover",ii=20,Ar="mainView";var xm=/*#__PURE__*/function(){function xm(e,t){_classCallCheck(this,xm);at(this,"viewId");at(this,"scene");at(this,"fullLayer");at(this,"curNodeMap",/* @__PURE__ */new Map());at(this,"targetNodeMap",[]);at(this,"highLevelIds");at(this,"canClearUids");at(this,"localUid");this.viewId=e,this.scene=t;}return _createClass(xm,[{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 _iterator44=_createForOfIteratorHelper(e.entries()),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _step44$value=_slicedToArray(_step44.value,2),n=_step44$value[0],i=_step44$value[1];i.toolsType===St.Image&&(i.opt.locked||t&&t.disableEraseImage)||i.toolsType===St.Text&&(i.opt.workState===Ft.Doing||i.opt.workState===Ft.Start||t&&t.disableEraseText)||this.isCanClearWorkId(n)&&r.set(n,i);}}catch(err){_iterator44.e(err);}finally{_iterator44.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=ue(t.rect)),t.op&&dm(t.op)&&(r.op=ue(t.op)),t.canRotate&&(r.canRotate=t.canRotate),t.scaleType&&(r.scaleType=t.scaleType),t.opt&&(r.opt=ue(t.opt)),t.toolsType&&(r.toolsType=t.toolsType),t.centerPos&&(r.centerPos=ue(t.centerPos)),He(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 i=/* @__PURE__ */new Map();var _iterator45=_createForOfIteratorHelper(this.curNodeMap.entries()),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var _step45$value=_slicedToArray(_step45.value,2),l=_step45$value[0],o=_step45$value[1];if(Kr(e,o.rect)){if(t&&o.toolsType===St.Image&&o.opt.locked||r&&o.toolsType===St.Text&&(o.opt.workState===Ft.Doing||o.opt.workState===Ft.Start))continue;n=Wt(n,o.rect),i.set(l,o);}}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(e,t){var r=es(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 _iterator46=_createForOfIteratorHelper(this.highLevelIds.keys()),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var t=_step46.value;this.updateNodeRect(t);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var e;var _iterator47=_createForOfIteratorHelper(this.curNodeMap.keys()),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var t=_step47.value;(e=this.highLevelIds)!=null&&e.has(t)||this.updateNodeRect(t);}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(e){var t=/* @__PURE__ */new Map();var _iterator48=_createForOfIteratorHelper(e),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var r=_step48.value;var n=this.curNodeMap.get(r);n&&t.set(r,ue(n));}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}return this.targetNodeMap.push(ue(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(ue(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(or).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(e){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if($d(this.canClearUids)){var t=e.split(or);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 as=/*#__PURE__*/function(){function as(e,t,r){_classCallCheck(this,as);at(this,"viewId");at(this,"scene");at(this,"fullLayer");at(this,"vNodes");at(this,"dpr");at(this,"contextType");at(this,"opt");at(this,"cameraOpt");at(this,"isSafari",!1);at(this,"combinePostMsg",/* @__PURE__ */new Set());at(this,"workerTaskId");at(this,"protectedTask");at(this,"hasPriorityDraw",!0);at(this,"delayPostDoneResolve");at(this,"cacheImages",/* @__PURE__ */new Map());at(this,"imageResolveMap",/* @__PURE__ */new Map());at(this,"taskUpdateCameraId");at(this,"debounceUpdateCameraId");var n,i;if(this.viewId=e,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.createRenderLayer(t);}catch(_unused25){if(this.contextType!=="2d")this.contextType="2d",(i=this.scene)==null||i.disconnect(),this.createRenderLayer(t);else throw new Error("Sorry, your browser doesn't support canvas context type ".concat(this.contextType));}this.vNodes=new xm(e,this.scene);}return _createClass(as,[{key:"createRenderLayer",value:function createRenderLayer(e){this.scene=this.createScene(e.offscreenCanvasOpt);var t=Se.bufferSize.full,r=Se.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:this.viewId===Ar?t:r*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(_x44){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 _iterator49=_createForOfIteratorHelper(this.cacheImages.entries()),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _step49$value=_slicedToArray(_step49.value,2),t=_step49$value[0],r=_step49$value[1];if(t===e&&r.imageBitmap)return r.imageBitmap;}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(e,t){var _iterator50=_createForOfIteratorHelper(this.cacheImages.entries()),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var _step50$value=_slicedToArray(_step50.value,2),r=_step50$value[0],n=_step50$value[1];t&&r===t||n.workId===e&&(n.imageBitmap.close(),this.cacheImages["delete"](r));}}catch(err){_iterator50.e(err);}finally{_iterator50.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:"setHasPriorityDraw",value:function setHasPriorityDraw(e){this.hasPriorityDraw=e;}},{key:"getPriorityDraw",value:function getPriorityDraw(){return this.hasPriorityDraw;}},{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,i,l,o,a,f,_f7,g,c,m;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=e.msgType,r=e.toolsType,n=e.opt,i=e.imageSrc,l=e.imageBitmap,o=e.workId,a=e.dpr;_context31.t0=t;_context31.next=_context31.t0===dt.UpdateDpr?4:_context31.t0===dt.UpdateCamera?9:_context31.t0===dt.Destroy?12:_context31.t0===dt.Clear?14:_context31.t0===dt.UpdateTools?17:_context31.t0===dt.GetImageBitMap?19:21;break;case 4:_context31.t1=he(a);if(!_context31.t1){_context31.next=8;break;}_context31.next=8;return this.updateDpr(a);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){f={toolsType:r,toolsOpt:n,combineUnitTime:e.combineUnitTime};this.localWork.setToolsOpt(f);}return _context31.abrupt("break",21);case 19:if(i&&l&&o){_f7=o.toString();this.cacheImages.set(i,{imageBitmap:l,workId:_f7});g=this.imageResolveMap.get(i);if(g){c=g.resolve,m=g.timer;m&&clearTimeout(m),c&&c(i);}this.deleteCachedImagesByWorkId(_f7,i);}return _context31.abrupt("break",21);case 21:case"end":return _context31.stop();}},_callee29,this);}));function on(_x45){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(e,t,r){var n=e*r,i=t*r;return n<=50||i<=50?[50,50]:n<=100||i<=100?[100,100]:n<=200||i<=200?[200,200]:n<=400||i<=400?[400,400]:n<=800||i<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e){var _this87=this;var t,r,n,i,l,o,a,f,g,c,m,_this$getIconSize,_this$getIconSize2,P,_T45,_P8,_P9,S;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=e.toolsType,r=e.opt,n=e.workId,i=e.isSubWorker;if(!(t===St.Image&&r&&n)){_context32.next=19;break;}l=n.toString(),o=r.src,a=r.type,f=r.width,g=r.height,c=r.strokeColor;if(!(!o||!a||!f||!g)){_context32.next=5;break;}return _context32.abrupt("return");case 5:m=o;if(a===Zr.Iconify){_this$getIconSize=this.getIconSize(f,g,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),P=_this$getIconSize2[0],_T45=_this$getIconSize2[1];m="".concat(o,"?width=").concat(P,"&height=").concat(_T45,"&color=").concat(c);}if(!this.cacheImages.has(m)){_context32.next=11;break;}_P8=this.getCachedImages(m);if(!_P8){_context32.next=11;break;}return _context32.abrupt("return",_P8);case 11:if(!this.imageResolveMap.has(m)){_context32.next=15;break;}_P9=this.getCachedImagesByWorkId(l);if(!_P9){_context32.next=15;break;}return _context32.abrupt("return",_P9);case 15:_context32.next=17;return new Promise(function(P){var T=_this87.imageResolveMap.get(m)||{resolve:void 0,timer:void 0};T.timer&&clearTimeout(T.timer),T.resolve=P,T.timer=setTimeout(function(){var h=_this87.imageResolveMap.get(m);h!=null&&h.resolve&&h.resolve(m);},5e3),_this87.imageResolveMap.set(m,T),_this87._post({sp:[{imageSrc:m,workId:l,viewId:_this87.viewId,isgl:!!_this87.fullLayer.parent.gl,isSubWorker:i,type:dt.GetImageBitMap}]});});case 17:S=_context32.sent;return _context32.abrupt("return",(this.imageResolveMap["delete"](S),this.getCachedImages(m)));case 19:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x46){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){this.scene.attr(_objectSpread({},e));var t=e.width,r=e.height;this.scene.container.width=t,this.scene.container.height=r,this.scene.width=t,this.scene.height=r,this.updateLayer({width:t,height:r});}},{key:"updateLayer",value:function updateLayer(e){var t=e.width,r=e.height;this.fullLayer&&(this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",r),this.fullLayer.setAttribute("size",[t,r]),this.fullLayer.setAttribute("pos",[t*0.5,r*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(e,t){var r=new OffscreenCanvas(100,100);var n=["2d"];e===Lr.Full&&this.viewId===Ar&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i12=0,_n7=n;_i12<_n7.length;_i12++){var i=_n7[_i12];try{if(r.getContext(i))return i;}catch(_unused26){continue;}}}},{key:"createScene",value:function createScene(e){var t=e.width,r=e.height,n=new OffscreenCanvas(t,r);e.contextType&&delete e.contextType;var i=new vo(_objectSpread(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},e),{},{contextType:this.contextType,id:this.viewId}));return i.setAttribute("id",this.viewId),i;}},{key:"createLayer",value:function createLayer(e,t,r){var n=r.width,i=r.height,l="offscreen-".concat(e),o=t.layer(l,r),a=new de({anchor:[0.5,0.5],pos:[n*0.5,i*0.5],size:[n,i],name:"viewport",id:e});return o.append(a),a;}},{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();}),xe(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(),_me(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(_x47){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(){var _this88=this;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this88.workerTaskId=void 0,_this88.combinePost();},16));_context35.t0=this.type===Lr.Full&&!this.delayPostDoneResolve;if(!_context35.t0){_context35.next=6;break;}_context35.next=5;return new Promise(function(t){_this88.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 o,a;this.workerTaskId=void 0;var e=[],t=[];var r,n,i;var l=/* @__PURE__ */new Set();var _iterator51=_createForOfIteratorHelper(this.combinePostMsg.values()),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var f=_step51.value;if((o=f.render)!=null&&o.length){var _iterator52=_createForOfIteratorHelper(f.render),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var g=_step52.value;var c=!1;if(g.workId&&l.add(g.workId),g.isClearAll&&(g.rect=this.getSceneRect(),g.isClear=!0,delete g.isClearAll),g.drawCanvas){var m=this.getLayer(g.drawCanvas);if(!m||!(m.parent instanceof mo))continue;if(m.parent.render(),g.isDrawAll){var x=this.getSceneRect();g.rect=x,delete g.isDrawAll;}}var _iterator53=_createForOfIteratorHelper(e),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var _m5=_step53.value;if(g.viewId===_m5.viewId){g.isClear&&_m5.clearCanvas&&_m5.isClear&&_m5.clearCanvas===g.clearCanvas&&(_m5.rect=Wt(_m5.rect,g.rect),c=!0),_m5.drawCanvas&&_m5.drawCanvas===g.drawCanvas&&(_m5.rect=Wt(_m5.rect,g.rect),c=!0);continue;}}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}c||(g.isClear&&!g.drawCanvas?e.unshift(g):e.push(g));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}if((a=f.sp)!=null&&a.length){var _iterator54=_createForOfIteratorHelper(f.sp),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var _g11=_step54.value;var _c6=!1;var _iterator55=_createForOfIteratorHelper(t),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _m6=_step55.value;if(we(_g11,_m6)){_c6=!0;break;}}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}_c6||t.push(_g11);}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}he(f.fullWorkerDrawCount)&&(r=f.fullWorkerDrawCount),he(f.subWorkerDrawCount)&&(n=f.subWorkerDrawCount),he(f.consumeCount)&&(i=f.consumeCount);}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}return this.combinePostMsg.clear(),{render:e,sp:t,fullWorkerDrawCount:r,subWorkerDrawCount:n,consumeCount:i,workIds:l,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 ls=/*#__PURE__*/function(){function ls(e){_classCallCheck(this,ls);at(this,"viewId");at(this,"vNodes");at(this,"thread");at(this,"fullLayer");at(this,"drawLayer");at(this,"_post");at(this,"tmpOpt");at(this,"workShapes",/* @__PURE__ */new Map());at(this,"drawCount",0);at(this,"consumeCount",0);at(this,"syncUnitTime",Se.syncOpt.interval);at(this,"combineUnitTime",Se.bezier.combineUnitTime);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(ls,[{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 pn(_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);}},{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 i=t.toString();var l;return t&&this.workShapes.has(i)?(l=this.workShapes.get(i),l==null||l.setWorkOptions(r)):l=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:i}),l?(this.workShapes.set(i,l),l):void 0;}}}]);}();function Sm(u){return u;}var cs=Sm;function Tm(u,e,t){switch(t.length){case 0:return u.call(e);case 1:return u.call(e,t[0]);case 2:return u.call(e,t[0],t[1]);case 3:return u.call(e,t[0],t[1],t[2]);}return u.apply(e,t);}var Cm=Tm,Im=Cm,si=Math.max;function Om(u,e,t){return e=si(e===void 0?u.length-1:e,0),function(){for(var r=arguments,n=-1,i=si(r.length-e,0),l=Array(i);++n<i;)l[n]=r[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=r[n];return o[e]=t(l),Im(u,this,o);};}var Mm=Om;function Em(u){return function(){return u;};}var Am=Em,Lm=Am,oi=gi,wm=cs,Rm=oi?function(u,e){return oi(u,"toString",{configurable:!0,enumerable:!1,value:Lm(e),writable:!0});}:wm,Dm=Rm,bm=800,Nm=16,Bm=Date.now;function Wm(u){var e=0,t=0;return function(){var r=Bm(),n=Nm-(r-t);if(t=r,n>0){if(++e>=bm)return arguments[0];}else e=0;return u.apply(void 0,arguments);};}var Fm=Wm,Um=Dm,jm=Fm,Ym=jm(Um),Xm=Ym,zm=cs,$m=Mm,Gm=Xm;function Hm(u,e){return Gm($m(u,e,zm),u+"");}var km=Hm;function Vm(u,e,t,r){for(var n=u.length,i=t+(r?1:-1);r?i--:++i<n;)if(e(u[i],i,u))return i;return-1;}var Km=Vm;function Zm(u){return u!==u;}var Jm=Zm;function Qm(u,e,t){for(var r=t-1,n=u.length;++r<n;)if(u[r]===e)return r;return-1;}var qm=Qm,_m=Km,tv=Jm,ev=qm;function rv(u,e,t){return e===e?ev(u,e,t):_m(u,tv,t);}var nv=rv,iv=nv;function sv(u,e){var t=u==null?0:u.length;return!!t&&iv(u,e,0)>-1;}var fs=sv;function ov(u,e,t){for(var r=-1,n=u==null?0:u.length;++r<n;)if(t(e,u[r]))return!0;return!1;}var hs=ov;function av(u,e){for(var t=-1,r=u==null?0:u.length,n=Array(r);++t<r;)n[t]=e(u[t],t,u);return n;}var lv=av,cv=hn,fv=fs,hv=hs,uv=lv,dv=Wr,pv=un,mv=200;function vv(u,e,t,r){var n=-1,i=fv,l=!0,o=u.length,a=[],f=e.length;if(!o)return a;t&&(e=uv(e,dv(t))),r?(i=hv,l=!1):e.length>=mv&&(i=pv,l=!1,e=new cv(e));t:for(;++n<o;){var g=u[n],c=t==null?g:t(g);if(g=r||g!==0?g:0,l&&c===c){for(var m=f;m--;)if(e[m]===c)continue t;a.push(g);}else i(e,c,r)||a.push(g);}return a;}var yv=vv,ai=fr,gv=Ti,Pv=ur,li=ai?ai.isConcatSpreadable:void 0;function xv(u){return Pv(u)||gv(u)||!!(li&&u&&u[li]);}var Sv=xv,Tv=on,Cv=Sv;function us(u,e,t,r,n){var i=-1,l=u.length;for(t||(t=Cv),n||(n=[]);++i<l;){var o=u[i];e>0&&t(o)?e>1?us(o,e-1,t,r,n):Tv(n,o):r||(n[n.length]=o);}return n;}var Iv=us;function Ov(){}var Mv=Ov,Xr=bi,Ev=Mv,Av=dn,Lv=1/0,wv=Xr&&1/Av(new Xr([,-0]))[1]==Lv?function(u){return new Xr(u);}:Ev,Rv=wv,Dv=hn,bv=fs,Nv=hs,Bv=un,Wv=Rv,Fv=dn,Uv=200;function jv(u,e,t){var r=-1,n=bv,i=u.length,l=!0,o=[],a=o;if(t)l=!1,n=Nv;else if(i>=Uv){var f=e?null:Wv(u);if(f)return Fv(f);l=!1,n=Bv,a=new Dv();}else a=e?[]:o;t:for(;++r<i;){var g=u[r],c=e?e(g):g;if(g=t||g!==0?g:0,l&&c===c){for(var m=a.length;m--;)if(a[m]===c)continue t;e&&a.push(c),o.push(g);}else n(a,c,t)||(a!==o&&a.push(c),o.push(g));}return o;}var Yv=jv,Xv=yv,zv=Iv,ci=Yv;function $v(u,e,t){var r=u.length;if(r<2)return r?ci(u[0]):[];for(var n=-1,i=Array(r);++n<r;)for(var l=u[n],o=-1;++o<r;)o!=n&&(i[n]=Xv(i[n]||l,u[o],e,t));return ci(zv(i,1),e,t);}var Gv=$v,Hv=en,kv=De;function Vv(u){return kv(u)&&Hv(u);}var Kv=Vv,Zv=Ei,Jv=km,Qv=Gv,qv=Kv,_v=Jv(function(u){return Qv(Zv(u,qv));}),ty=_v,ey=/* @__PURE__ */Ne(ty);var ry=/*#__PURE__*/function(_ls){function ry(t){var _this89;_classCallCheck(this,ry);_this89=_callSuper(this,ry,[t]);at(_this89,"combineTimerId");at(_this89,"combineDrawResolve");at(_this89,"combineDrawActiveId");at(_this89,"drawWorkActiveId");at(_this89,"effectSelectNodeData",/* @__PURE__ */new Set());at(_this89,"batchEraserWorks",/* @__PURE__ */new Set());at(_this89,"batchEraserRemoveNodes",/* @__PURE__ */new Set());return _this89;}_inherits(ry,_ls);return _createClass(ry,[{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(_x48){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,r){var _this90=this;var n,i,l,o,a,f,g,c;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=t.op,i=t.workId,l=t.scenePath,o=t.postCount;if(!(n!=null&&n.length&&i)){_context37.next=60;break;}a=i.toString(),f=this.getWorkShape(a);if(f){_context37.next=5;break;}return _context37.abrupt("return");case 5:g=f.toolsType;if(!(g===St.LaserPen)){_context37.next=8;break;}return _context37.abrupt("return");case 8:_context37.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==a;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:l,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local},r);case 13:_context37.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==a;if(!_context37.t1){_context37.next=18;break;}_context37.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:l,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local},r);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&a!==_t&&(this.drawWorkActiveId=a);he(o)&&(this.consumeCount=o);c=f.consume({data:t,isFullWork:!0});_context37.t2=g;_context37.next=_context37.t2===St.Selector?24:_context37.t2===St.PencilEraser?30:_context37.t2===St.BitMapEraser?37:_context37.t2===St.Eraser?44:_context37.t2===St.Arrow?47:_context37.t2===St.Straight?47:_context37.t2===St.Ellipse?47:_context37.t2===St.Rectangle?47:_context37.t2===St.Star?47:_context37.t2===St.Polygon?47:_context37.t2===St.SpeechBalloon?47:_context37.t2===St.Pencil?53:60;break;case 24:_context37.t3=c.type===dt.Select;if(!_context37.t3){_context37.next=29;break;}c.selectIds&&r.runReverseSelectWork(c.selectIds);_context37.next=29;return this.drawSelector(c);case 29:return _context37.abrupt("break",60);case 30:this.drawCount++;this.combineTimerId||new Promise(function(m){_this90.combineDrawActiveId=a,_this90.combineDrawResolve=m,_this90.combineTimerId=setTimeout(function(){_this90.combineTimerId=void 0,_this90.combineDrawResolve&&_this90.combineDrawResolve(!0);},_this90.combineUnitTime);}).then(function(m){m&&_this90.drawPencilEraserCombine(a,_this90.drawCount),_this90.combineDrawResolve=void 0;});_context37.t4=c;if(!_context37.t4){_context37.next=36;break;}_context37.next=36;return this.drawPencilEraser(c);case 36:return _context37.abrupt("break",60);case 37:this.drawCount++;this.combineTimerId||new Promise(function(m){_this90.combineDrawActiveId=a,_this90.combineDrawResolve=m,_this90.combineTimerId=setTimeout(function(){_this90.combineTimerId=void 0,_this90.combineDrawResolve&&_this90.combineDrawResolve(!0);},_this90.combineUnitTime);}).then(function(m){m&&_this90.drawBitMapCombine(a,_this90.drawCount),_this90.combineDrawResolve=void 0;});_context37.t5=c;if(!_context37.t5){_context37.next=43;break;}_context37.next=43;return this.drawBitMapEraser(c);case 43:return _context37.abrupt("break",60);case 44:_context37.next=46;return this.drawEraser(c);case 46:return _context37.abrupt("break",60);case 47:_context37.t6=c;if(!_context37.t6){_context37.next=52;break;}this.drawCount++;_context37.next=52;return this.drawShape(c);case 52:return _context37.abrupt("break",60);case 53:this.drawCount++;this.combineTimerId||new Promise(function(m){_this90.combineDrawActiveId=a,_this90.combineDrawResolve=m,_this90.combineTimerId=setTimeout(function(){_this90.combineTimerId=void 0,_this90.combineDrawResolve&&_this90.combineDrawResolve(!0);},_this90.combineUnitTime);}).then(function(m){m&&_this90.drawPencilCombine(a,_this90.drawCount),_this90.combineDrawResolve=void 0;});_context37.t7=c;if(!_context37.t7){_context37.next=59;break;}_context37.next=59;return this.drawPencil(c);case 59:return _context37.abrupt("break",60);case 60:case"end":return _context37.stop();}},_callee35,this);}));function consumeDraw(_x49,_x50){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,r){var o,a,f,n,i,l,g,c,m,x,M,S;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,i=t.scenePath,l=t.isLockSentEventCursor;if(!n){_context38.next=43;break;}g=n.toString();this.drawWorkActiveId===g&&(this.drawWorkActiveId=void 0);c=this.workShapes.get(g);if(c){_context38.next=8;break;}return _context38.abrupt("return");case 8:m=c.toolsType;if(!(m===St.LaserPen)){_context38.next=11;break;}return _context38.abrupt("return");case 11:x=this.workShapes.get(ir),M=(o=x==null?void 0:x.selectIds)==null?void 0:o[0],S=c.consumeAll({data:t,workerEngine:this});_context38.t0=m;_context38.next=_context38.t0===St.Selector?15:_context38.t0===St.PencilEraser?21:_context38.t0===St.BitMapEraser?26:_context38.t0===St.Eraser?31:_context38.t0===St.Arrow?33:_context38.t0===St.Straight?33:_context38.t0===St.Ellipse?33:_context38.t0===St.Rectangle?33:_context38.t0===St.Star?33:_context38.t0===St.Polygon?33:_context38.t0===St.SpeechBalloon?33:_context38.t0===St.Pencil?38:43;break;case 15:S.selectIds&&M&&(a=S.selectIds)!=null&&a.includes(M)&&x.cursorBlur();S.selectIds&&r.runReverseSelectWork(S.selectIds);_context38.next=19;return this.drawSelector(_objectSpread(_objectSpread({},S),{},{scenePath:i}),l);case 19:(f=c.selectIds)!=null&&f.length?c.clearTmpPoints():this.clearWorkShapeNodeCache(g);return _context38.abrupt("break",43);case 21:_context38.next=23;return this.drawPencilEraserFull(c,_objectSpread(_objectSpread({},S),{},{scenePath:i}),l);case 23:this.drawCount=0;this.clearWorkShapeNodeCache(g);return _context38.abrupt("break",43);case 26:_context38.next=28;return this.drawBitMapEraserFull(c,_objectSpread(_objectSpread({},S),{},{scenePath:i}),l);case 28:this.drawCount=0;this.clearWorkShapeNodeCache(g);return _context38.abrupt("break",43);case 31:this.drawEraser(_objectSpread(_objectSpread({},S),{},{scenePath:i}),l),c.clearTmpPoints();return _context38.abrupt("break",43);case 33:_context38.next=35;return this.drawPencilFull(_objectSpread(_objectSpread({},S),{},{scenePath:i}),l);case 35:this.drawCount=0;this.clearWorkShapeNodeCache(g);return _context38.abrupt("break",43);case 38:_context38.next=40;return this.drawPencilFull(_objectSpread(_objectSpread({},S),{},{scenePath:i}),l);case 40:this.drawCount=0;this.clearWorkShapeNodeCache(g);return _context38.abrupt("break",43);case 43:case"end":return _context38.stop();}},_callee36,this);}));function consumeDrawAll(_x51,_x52){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,r){var _iterator56,_step56,n;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_iterator56=_createForOfIteratorHelper(this.workShapes.keys());_context39.prev=1;_iterator56.s();case 3:if((_step56=_iterator56.n()).done){_context39.next=9;break;}n=_step56.value;_context39.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local},r);case 7:_context39.next=3;break;case 9:_context39.next=14;break;case 11:_context39.prev=11;_context39.t0=_context39["catch"](1);_iterator56.e(_context39.t0);case 14:_context39.prev=14;_iterator56.f();return _context39.finish(14);case 17:case"end":return _context39.stop();}},_callee37,this,[[1,11,14,17]]);}));function workShapesDone(_x53,_x54){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var i,l,r,n,o,a,f,g,c,m,x;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:r=this.setFullWork(t),n=t.ops&&Ze(t.ops)||t.op;if(!r){_context40.next=26;break;}o=(i=t.workId)==null?void 0:i.toString();if(o){_context40.next=5;break;}return _context40.abrupt("return");case 5:a=(l=this.vNodes.get(o))==null?void 0:l.rect;if(!(r.toolsType===St.Image)){_context40.next=13;break;}_context40.next=9;return r.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 9:f=_context40.sent;g=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);_context40.next=20;break;case 13:if(!(r.toolsType===St.Text)){_context40.next=19;break;}_context40.next=16;return r.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:f=_context40.sent;_context40.next=20;break;case 19:f=r.consumeService({op:n,isFullWork:!0,replaceId:o}),g=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 20:f=Wt(f,g);c=[],m=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),f&&t.willRefresh&&(a&&(c.push({rect:Kt(a),isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId}),f=Wt(f,a)),c.push({rect:Kt(f),drawCanvas:Rt.Bg,viewId:this.viewId})),t.willSyncService&&m.push({opt:t.opt,toolsType:t.toolsType,type:dt.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),c.length||m.length)){_context40.next=26;break;}x={render:c,sp:m};_context40.next=26;return this._post(x);case 26:case"end":return _context40.stop();}},_callee38,this);}));function consumeFull(_x55){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var r=this.vNodes.get(t);if(r&&r.toolsType===St.Text)return{type:dt.TextUpdate,toolsType:St.Text,workId:t,dataType:bt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t,r){var n,i,l,o,a,f,_iterator57,_step57,g,x,m;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:n=t.willSyncService,i=[],l=[],o=[],a=this.workShapes.get(_t);if(a){_context41.next=3;break;}return _context41.abrupt("return");case 3:f=a.selectIds&&_toConsumableArray(a.selectIds)||[];_iterator57=_createForOfIteratorHelper(f);try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){g=_step57.value;if(this.vNodes.get(g)){x=this.commandDeleteText(g);x&&i.push(x);}m=this._removeWork(g);m.length&&l.push.apply(l,_toConsumableArray(m)),r==null||r.deleteCachedImagesByWorkId(g),o.push(g);}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}o.length&&i.push({type:dt.RemoveNode,removeIds:o});i.push({type:dt.Select,selectIds:[],willSyncService:n});_context41.next=10;return this.blurSelector();case 10:_context41.t0=l.length||i.length;if(!_context41.t0){_context41.next=14;break;}_context41.next=14;return this._post({render:l,sp:i});case 14:case"end":return _context41.stop();}},_callee39,this);}));function removeSelector(_x56,_x57){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var r,n,i;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;}i=this._removeWork(n);_context42.t0=i.length;if(!_context42.t0){_context42.next=7;break;}_context42.next=7;return this._post({render:i});case 7:case"end":return _context42.stop();}},_callee40,this);}));function removeWork(_x58){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this91=this;var i,l,o;var r=this.vNodes.get(t);r&&((i=this.fullLayer)==null||i.getElementsByName(t).forEach(function(a){a.remove(),_me(a,_this91.fullLayer.parent);}),this.vNodes["delete"](t));var n=this.drawLayer&&Mt.getRectFromLayer(this.drawLayer,t);if(n){var a=(l=this.drawLayer)==null?void 0:l.getElementsByName(t)[0];a&&(a.remove(),_me(a,(o=this.drawLayer)==null?void 0:o.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,i=[];return r&&i.push({rect:Kt(r),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(r),drawCanvas:Rt.Bg,viewId:this.viewId}),n&&i.push({rect:Kt(n),clearCanvas:Rt.Float,isClear:!0,viewId:this.viewId},{rect:Kt(n),drawCanvas:Rt.Float,viewId:this.viewId}),i;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var r,n,i,l,o,a,f,_iterator58,_step58,g,c,m,x,M;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:r=t.op,n=t.viewId,i=t.dataType;if(!(r!=null&&r.length)){_context43.next=32;break;}a=r[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],f=r[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator58=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context43.prev=4;_iterator58.s();case 6:if((_step58=_iterator58.n()).done){_context43.next=14;break;}g=_step58.value;c=g.rect,m=g.name,x=g.toolsType,M=g.opt;if(!(x===St.Text&&M.workState===Ft.Done&&um([a,f],c))){_context43.next=12;break;}l=m,o=this.setFullWork({workId:m,toolsType:x,opt:M});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);_iterator58.e(_context43.t0);case 19:_context43.prev=19;_iterator58.f();return _context43.finish(19);case 22:_context43.t1=l;if(!_context43.t1){_context43.next=32;break;}_context43.t2=o;if(!_context43.t2){_context43.next=28;break;}_context43.next=28;return o.consumeServiceAsync({isFullWork:!0,replaceId:o.getWorkId(),isDrawLabel:!1});case 28:_context43.next=30;return this.blurSelector({viewId:n,msgType:dt.Select,dataType:i,isSync:!0});case 30:_context43.next=32;return this._post({sp:[{type:dt.GetTextActive,toolsType:St.Text,workId:l}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x59){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var _this92=this;var r,n,i;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:r=this.workShapes.get(_t),n=t.workId,i=t.msgType;if(!(r&&n&&r.selectIds&&r.selectIds.includes(n.toString()))){_context44.next=6;break;}i===dt.RemoveNode?r.selectIds=r.selectIds.filter(function(l){return l!==n.toString();}):this.effectSelectNodeData.add(t);_context44.next=5;return this.runEffectSelectWork(!0).then(function(){var l;(l=_this92.effectSelectNodeData)==null||l.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(_x60){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this93=this;var M,r,n,i,l,o,a,f,g,c,m,x;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:r=this.workShapes.get(_t);if((M=r==null?void 0:r.selectIds)!=null&&M.length){_context45.next=3;break;}return _context45.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);l=i.updateSelectorOpt;o=i.willSerializeData;_context45.next=9;return r==null?void 0:r.updateSelector({updateSelectorOpt:l,selectIds:ue(r.selectIds),vNodes:this.vNodes,willSerializeData:o,worker:this});case 9:a=_context45.sent;f=/* @__PURE__ */new Map();a!=null&&a.selectIds&&(g=ey(r.selectIds,a.selectIds),a.selectIds.forEach(function(S){var P=_this93.vNodes.get(S);if(P){var _T46=P.toolsType,_h40=P.op,p=P.opt;f.set(S,{opt:p,toolsType:_T46,ops:(_h40==null?void 0:_h40.length)&&Te(_h40)||void 0});}}),r.selectIds=a.selectIds);c=[],m=[];a!=null&&a.rect&&c.push({rect:Kt(a.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(a.rect),drawCanvas:Rt.Bg,viewId:this.viewId});x=n&&n({res:a,workShapeNode:r,param:i,postData:{render:c,sp:m},newServiceStore:f})||{render:c,sp:m};g&&x.sp.push({type:dt.RemoveNode,removeIds:g,viewId:this.viewId});_context45.t0=x.render.length||x.sp.length;if(!_context45.t0){_context45.next=20;break;}_context45.next=20;return this._post(x);case 20:case"end":return _context45.stop();}},_callee43,this);}));function updateSelector(_x61){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var i,r,n,l;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:r=this.workShapes.get(_t),n=r==null?void 0:r.blurSelector();if(!(this.clearWorkShapeNodeCache(_t),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(l){l.name===_t&&l.remove();}),n)){_context46.next=6;break;}l=[];l.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:Kt(n.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(n.rect),drawCanvas:Rt.Bg,viewId:this.viewId}],sp:l});case 6:case"end":return _context46.stop();}},_callee44,this);}));function blurSelector(_x62){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(_t);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(_t);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(){var t,l,r,n,i,o,_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(_t);if(r){_context47.next=4;break;}return _context47.abrupt("return");case 4:if(!(r&&!((l=r.selectIds)!=null&&l.length))){_context47.next=8;break;}_context47.next=7;return this.blurSelector();case 7:return _context47.abrupt("return");case 8:n=r.oldSelectRect,i=r.reRenderSelector();if(!i){_context47.next=13;break;}o=Wt(n,i)||i;_context47.next=13;return this._post({render:[{rect:Kt(o),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(o),drawCanvas:Rt.Bg,viewId:this.viewId}],sp:[{type:dt.Select,selectIds:r.selectIds,selectRect:i,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 i,l,o,a,f,g,c,r,n,_r$updateSelectIds,m,x,M;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:r=this.workShapes.get(_t),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&&((i=this.tmpOpt)==null?void 0:i.toolsType)===St.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),m=_r$updateSelectIds.bgRect,x=_r$updateSelectIds.selectRect,M={render:[],sp:[]};m&&((l=M.render)==null||l.push({rect:Kt(m),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(m),drawCanvas:Rt.Bg,viewId:this.viewId}));(c=M.sp)==null||c.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||r.selectorColor,strokeColor:((a=t.opt)==null?void 0:a.strokeColor)||r.strokeColor,fillColor:((f=t.opt)==null?void 0:f.fillColor)||r.fillColor,textOpt:((g=t.opt)==null?void 0:g.textOpt)||r.textOpt,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,type:dt.Select,selectRect:x,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(M);case 16:case"end":return _context48.stop();}},_callee46,this);}));function updateFullSelectWork(_x63){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(ry,"destroy",this,3)([]),this.effectSelectNodeData.clear(),this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear();}},{key:"drawBitMapEraser",value:function(){var _drawBitMapEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:_context49.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context49.stop();}},_callee47,this);}));function drawBitMapEraser(_x64){return _drawBitMapEraser.apply(this,arguments);}return drawBitMapEraser;}()},{key:"drawBitMapEraserFull",value:function(){var _drawBitMapEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,r,n){var i,l,o,a,f,_iterator59,_step59,_step59$value,c,m,g;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:i=r.rect,l=r.willUpdateNodes,o=r.willDeleteNodes,a=t.getWorkId(),f=[{type:dt.RemoveNode,removeIds:[a],viewId:this.viewId}];if(n&&f.push({type:dt.None,isLockSentEventCursor:n}),l!=null&&l.size||o!=null&&o.size){if(l!=null&&l.size){_iterator59=_createForOfIteratorHelper(l);try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){_step59$value=_slicedToArray(_step59.value,2),c=_step59$value[0],m=_step59$value[1];f.push({type:dt.UpdateNode,dataType:bt.Local,opt:m.opt,workId:c,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}}o!=null&&o.size&&f.push({type:dt.RemoveNode,removeIds:_toConsumableArray(o),viewId:this.thread.viewId});}g=[{isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}];i&&g.push({rect:i,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:i,drawCanvas:Rt.Bg,viewId:this.viewId});_context50.next=6;return this._post({sp:f,render:g,fullWorkerDrawCount:1/0});case 6:case"end":return _context50.stop();}},_callee48,this);}));function drawBitMapEraserFull(_x65,_x66,_x67){return _drawBitMapEraserFull.apply(this,arguments);}return drawBitMapEraserFull;}()},{key:"drawBitMapCombine",value:function(){var _drawBitMapCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,r){var i,l,o,n,a,f;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:n=(i=this.workShapes.get(t))==null?void 0:i.combineConsume();if(!n){_context51.next=6;break;}a={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){f=Kt(n.rect);(l=a.render)==null||l.push({rect:f,isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId}),(o=a.render)==null||o.push({rect:f,drawCanvas:Rt.Float,viewId:this.viewId});}_context51.next=6;return this._post(a);case 6:case"end":return _context51.stop();}},_callee49,this);}));function drawBitMapCombine(_x68,_x69){return _drawBitMapCombine.apply(this,arguments);}return drawBitMapCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t,r){var i,l,o,n,a,f;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:n=(i=this.workShapes.get(t))==null?void 0:i.combineConsume();if(!n){_context52.next=6;break;}a={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){f=Kt(n.rect);(l=a.render)==null||l.push({rect:f,isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId}),(o=a.render)==null||o.push({rect:f,drawCanvas:Rt.Float,viewId:this.viewId});}_context52.next=6;return this._post(a);case 6:case"end":return _context52.stop();}},_callee50,this);}));function drawPencilCombine(_x70,_x71){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t,r){var i,l,n;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:n={render:[],sp:[t]};r&&((i=n.sp)==null||i.push({type:dt.None,isLockSentEventCursor:r}));t.rect&&((l=n.render)==null||l.push({rect:Kt(t.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(t.rect),drawCanvas:Rt.Bg,viewId:this.viewId}));_context53.next=5;return this._post(n);case 5:case"end":return _context53.stop();}},_callee51,this);}));function drawSelector(_x72,_x73){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilEraserCombine",value:function(){var _drawPencilEraserCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,r){var i,l,o,n,a,f;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:n=(i=this.workShapes.get(t))==null?void 0:i.combineConsume();if(!n){_context54.next=6;break;}a={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){f=Kt(n.rect);(l=a.render)==null||l.push({rect:f,isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId}),(o=a.render)==null||o.push({rect:f,drawCanvas:Rt.Float,viewId:this.viewId});}_context54.next=6;return this._post(a);case 6:case"end":return _context54.stop();}},_callee52,this);}));function drawPencilEraserCombine(_x74,_x75){return _drawPencilEraserCombine.apply(this,arguments);}return drawPencilEraserCombine;}()},{key:"drawPencilEraser",value:function(){var _drawPencilEraser=_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({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context55.stop();}},_callee53,this);}));function drawPencilEraser(_x76){return _drawPencilEraser.apply(this,arguments);}return drawPencilEraser;}()},{key:"drawPencilEraserFull",value:function(){var _drawPencilEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(t,r,n){var i,l,o,a,f,_iterator60,_step60,_step60$value,c,m,g;return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:i=r.rect,l=r.willNewNodes,o=r.willDeleteNodes,a=t.getWorkId(),f=[{type:dt.RemoveNode,removeIds:[a],viewId:this.viewId}];if(n&&f.push({type:dt.None,isLockSentEventCursor:n}),l!=null&&l.size||o!=null&&o.size){if(l!=null&&l.size){_iterator60=_createForOfIteratorHelper(l);try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){_step60$value=_slicedToArray(_step60.value,2),c=_step60$value[0],m=_step60$value[1];f.push({type:dt.FullWork,dataType:bt.Local,toolsType:St.Pencil,ops:Te(m.op),opt:m.opt,workId:c,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}}o!=null&&o.size&&f.push({type:dt.RemoveNode,removeIds:_toConsumableArray(o),viewId:this.thread.viewId});}g=[{isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}];i&&g.push({rect:i,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:i,drawCanvas:Rt.Bg,viewId:this.viewId});_context56.next=6;return this._post({sp:f,render:g,fullWorkerDrawCount:1/0});case 6:case"end":return _context56.stop();}},_callee54,this);}));function drawPencilEraserFull(_x77,_x78,_x79){return _drawPencilEraserFull.apply(this,arguments);}return drawPencilEraserFull;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t,r){var n,i;return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:n=[],i=[];r&&n.push({type:dt.None,isLockSentEventCursor:r});t.removeIds&&n.push(t);t.rect&&i.push({rect:t.rect,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Rt.Bg,viewId:this.viewId});_context57.next=6;return this._post({sp:n,render:i,consumeCount:this.consumeCount});case 6:case"end":return _context57.stop();}},_callee55,this);}));function drawEraser(_x80,_x81){return _drawEraser.apply(this,arguments);}return drawEraser;}()// private batchEraserCombine = throttle(() => {
440
+ // const render = this.updateBatchEraserCombineNode(this.batchEraserWorks, this.batchEraserRemoveNodes);
441
+ // this.batchEraserWorks.clear();
442
+ // this.batchEraserRemoveNodes.clear();
443
+ // if (render.length) {
444
+ // this._post({
445
+ // render
446
+ // })
447
+ // }
448
+ // }, 200, {'leading':false})
449
+ },{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t){return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:_context58.next=2;return this._post({fullWorkerDrawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context58.stop();}},_callee56,this);}));function drawShape(_x82){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(t){return _regeneratorRuntime().wrap(function _callee57$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:_context59.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context59.stop();}},_callee57,this);}));function drawPencil(_x83){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(t,r){var i,l,n;return _regeneratorRuntime().wrap(function _callee58$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:n={fullWorkerDrawCount:1/0,render:[],sp:[t]};r&&((i=n.sp)==null||i.push({type:dt.None,isLockSentEventCursor:r}));t!=null&&t.rect&&((l=n.render)==null||l.push({isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Rt.Bg,viewId:this.viewId}));_context60.next=5;return this._post(n);case 5:case"end":return _context60.stop();}},_callee58,this);}));function drawPencilFull(_x84,_x85){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()// private updateBatchEraserCombineNode(inFullLayerIds:Set<string>,removeIds:Set<string>) {
450
+ // const render: IMainMessageRenderData[] = [];
451
+ // let fullLayerRect:IRectType|undefined;
452
+ // for (const key of removeIds.keys()) {
453
+ // this.fullLayer.getElementsByName(key).forEach(node => {
454
+ // const r = (node as Path).getBoundingClientRect()
455
+ // fullLayerRect = computRect(fullLayerRect, {
456
+ // x: r.x - EraserShape.SafeBorderPadding,
457
+ // y: r.y - EraserShape.SafeBorderPadding,
458
+ // w: r.width + EraserShape.SafeBorderPadding * 2,
459
+ // h: r.height + EraserShape.SafeBorderPadding * 2,
460
+ // });
461
+ // node.remove();
462
+ // removeTexture(this.fullLayer, this.fullLayer.parent as Layer);
463
+ // });
464
+ // }
465
+ // inFullLayerIds.forEach(key=>{
466
+ // const info = this.vNodes.get(key);
467
+ // if (info) {
468
+ // const node = this.fullLayer.getElementsByName(key)[0];
469
+ // if (!node) {
470
+ // const workShape = this.setFullWork({...info, workId: key});
471
+ // // todo check image consumeService
472
+ // const r = workShape && workShape.consumeService({
473
+ // op: info.op,
474
+ // isFullWork: true,
475
+ // });
476
+ // if (r) {
477
+ // info.rect = r;
478
+ // fullLayerRect = computRect(fullLayerRect,r);
479
+ // }
480
+ // } else {
481
+ // fullLayerRect = computRect(fullLayerRect, info.rect);
482
+ // }
483
+ // }
484
+ // })
485
+ // if(fullLayerRect){
486
+ // render.push({
487
+ // rect:fullLayerRect,
488
+ // isClear: true,
489
+ // clearCanvas:ECanvasShowType.Bg,
490
+ // viewId:this.viewId
491
+ // },
492
+ // {
493
+ // rect:fullLayerRect,
494
+ // drawCanvas:ECanvasShowType.Bg,
495
+ // viewId:this.viewId
496
+ // })
497
+ // }
498
+ // return render;
499
+ // }
500
+ },{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(t){var r,_iterator61,_step61,n,i,l,o;return _regeneratorRuntime().wrap(function _callee59$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:_iterator61=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context61.prev=1;_iterator61.s();case 3:if((_step61=_iterator61.n()).done){_context61.next=23;break;}n=_step61.value;i=this.setFullWork(n);if(!i){_context61.next=21;break;}l=(r=i.getWorkId())==null?void 0:r.toString();if(!(i.toolsType===St.Image)){_context61.next=13;break;}_context61.next=11;return i.consumeServiceAsync({isFullWork:!0,replaceId:l,worker:this});case 11:_context61.next=20;break;case 13:if(!(i.toolsType===St.Text)){_context61.next=18;break;}_context61.next=16;return i.consumeServiceAsync({isFullWork:!0,replaceId:l});case 16:_context61.next=20;break;case 18:o=n.ops&&Ze(n.ops);i.consumeService({op:o,isFullWork:!0,replaceId:l}),n!=null&&n.updateNodeOpt&&i.updataOptService(n.updateNodeOpt);case 20:n.workId&&this.workShapes["delete"](n.workId.toString());case 21:_context61.next=3;break;case 23:_context61.next=28;break;case 25:_context61.prev=25;_context61.t0=_context61["catch"](1);_iterator61.e(_context61.t0);case 28:_context61.prev=28;_iterator61.f();return _context61.finish(28);case 31:_context61.next=33;return this.reRenderSelector(t);case 33:case"end":return _context61.stop();}},_callee59,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x86){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee60(t){var o,r,n,i,l,a,f;return _regeneratorRuntime().wrap(function _callee60$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:r=t.opt,n=t.toolsType,i=t.point,l=this.setFullWork({workId:ir,toolsType:n,opt:r});if(!(l&&i)){_context62.next=8;break;}a=l.cursorHover(i),f={render:[]};_context62.t0=a&&a.type===dt.CursorHover&&a.rect;if(!_context62.t0){_context62.next=8;break;}(o=f.render)==null||o.push({rect:Kt(a.rect),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(a.rect),drawCanvas:Rt.Bg,viewId:this.viewId});_context62.next=8;return this._post(f);case 8:case"end":return _context62.stop();}},_callee60,this);}));function cursorHover(_x87){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(){var n,t,r;return _regeneratorRuntime().wrap(function _callee61$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:t=this.getWorkShape(ir);_context63.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context63.t0){_context63.next=10;break;}r=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(ir);_context63.t1=r;if(!_context63.t1){_context63.next=10;break;}_context63.next=10;return this._post({render:[{rect:Kt(r),clearCanvas:Rt.Bg,isClear:!0,viewId:this.viewId},{rect:Kt(r),drawCanvas:Rt.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(i){i.name==="Cursor_Hover_Id"&&i.remove();});case 11:case"end":return _context63.stop();}},_callee61,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(ls);var ny=/*#__PURE__*/function(){function ny(e){_classCallCheck(this,ny);at(this,"viewId");at(this,"vNodes");at(this,"fullLayer");at(this,"drawLayer");at(this,"workShapes",/* @__PURE__ */new Map());at(this,"selectorWorkShapes",/* @__PURE__ */new Map());at(this,"thread");at(this,"animationId");at(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());at(this,"runEffectId");at(this,"noAnimationRect");at(this,"syncUnitTime",Se.syncOpt.interval);at(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(ny,[{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 _callee62(e){return _regeneratorRuntime().wrap(function _callee62$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:this.activeWorkShape(e),this.runAnimation();case 1:case"end":return _context64.stop();}},_callee62,this);}));function consumeDraw(_x88){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=pn({workId:e,toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(e){var _this94=this;e.forEach(function(t){_this94.selectorWorkShapes.forEach(function(r,n){var i;if((i=r.selectIds)!=null&&i.length){var l=r.selectIds.indexOf(t);l>-1&&(r.selectIds.splice(l,1),_this94.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e){var t,r,n;return _regeneratorRuntime().wrap(function _callee63$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:t=e.workId,r=t==null?void 0:t.toString();if(!r){_context65.next=10;break;}n=this.workShapes.get(r);if(!n){_context65.next=8;break;}this.workShapes["delete"](r);_context65.next=7;return this.removeNode(r,e,n==null?void 0:n.totalRect,!1);case 7:return _context65.abrupt("return");case 8:_context65.next=10;return this.removeNode(r,e);case 10:case"end":return _context65.stop();}},_callee63,this);}));function removeWork(_x89){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 _callee64(e,t,r){var _this95=this;var n,f,i,l,o,a,_args66=arguments;return _regeneratorRuntime().wrap(function _callee64$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:n=_args66.length>3&&_args66[3]!==undefined?_args66[3]:!0;e.indexOf(_t)>-1&&this.removeSelectWork(t);i=r;l=(f=this.vNodes.get(e))==null?void 0:f.rect;l&&(i=Wt(l,i));o=this.fullLayer&&Mt.getRectFromLayer(this.fullLayer,e);i=Wt(i,o);a=this.drawLayer&&Mt.getRectFromLayer(this.drawLayer,e);i=Wt(i,a);this.fullLayer.getElementsByName(e).forEach(function(g){g.remove(),_me(g,_this95.fullLayer.parent);});this.drawLayer.getElementsByName(e).forEach(function(g){g.remove(),_me(g,_this95.drawLayer.parent);});this.vNodes["delete"](e);_context66.t0=i;if(!_context66.t0){_context66.next=16;break;}_context66.next=16;return this.post({render:[{rect:Kt(i),isClear:!0,clearCanvas:n?Rt.Bg:Rt.ServiceFloat,workerType:n?void 0:bt.Service,viewId:this.viewId},{rect:Kt(i),drawCanvas:n?Rt.Bg:Rt.ServiceFloat,workerType:n?void 0:bt.Service,viewId:this.viewId}]});case 16:case"end":return _context66.stop();}},_callee64,this);}));function removeNode(_x90,_x91,_x92){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(e){var x,M,S,P;var t=e.workId,r=e.opt,n=e.toolsType,i=e.type,l=e.updateNodeOpt,o=e.ops,a=e.op,f=e.useAnimation;if(!t)return;var g=t.toString(),c=(x=this.vNodes.get(g))==null?void 0:x.rect;if(!((M=this.workShapes)!=null&&M.has(g))){var _T47={toolsType:n,animationWorkData:a||[],animationIndex:0,type:i,updateNodeOpt:l,ops:o,useAnimation:_typeof(f)<"u"?f:_typeof(l==null?void 0:l.useAnimation)<"u"?l==null?void 0:l.useAnimation:!0,oldRect:c,isDiff:!1};n&&r&&(_T47=this.setNodeKey(g,_T47,n,r)),(S=this.workShapes)==null||S.set(g,_T47);}var m=(P=this.workShapes)==null?void 0:P.get(g);i&&(m.type=i),o&&(m.animationWorkData=Ze(o),m.ops=o),l&&(m.updateNodeOpt=l),a&&(m.isDiff=this.hasDiffData(m.animationWorkData||[],a,m.toolsType),m.animationWorkData=a),m.node&&m.node.getWorkId()!==g&&m.node.setWorkId(g),c&&(m.oldRect=c),n&&r&&(r.syncUnitTime&&(this.syncUnitTime=r.syncUnitTime),m.toolsType!==n&&n&&r&&this.setNodeKey(g,m,n,r),m.node&&m.node.setWorkOptions(r));}},{key:"hasDiffData",value:function hasDiffData(e,t,r){var n=e.length;if(t.length<n)return!0;switch(r){case St.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==e[i]||t[i+1]!==e[i+1])return!0;break;}case St.LaserPen:{for(var _i13=0;_i13<n;_i13+=2)if(t[_i13]!==e[_i13]||t[_i13+1]!==e[_i13+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(){var _this96=this;var n,i,l,o,a,f,g,c,m,x,M,S,P,T,h,p,d,y,O,E,w,B,A,b,W,D,R,j,k,J,rt,st,$,V,nt,lt,ct,e,t,r,_iterator62,_step62,_loop6;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:this.animationId=void 0;e=!1;t={render:[]},r=/* @__PURE__ */new Map();_iterator62=_createForOfIteratorHelper(this.workShapes.entries());_context68.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step62$value,pt,et,gt,Tt,_gt3,_Tt2,_gt4,_Tt3,X,z,_gt5,_Tt4,_gt6,_Tt5,_X,_z,Q,tt,U,_tt,_gt7,_Tt6,_X2,_z2,_Q,_tt2;return _regeneratorRuntime().wrap(function _loop6$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:_step62$value=_slicedToArray(_step62.value,2),pt=_step62$value[0],et=_step62$value[1];_context67.t0=et.toolsType;_context67.next=_context67.t0===St.Image?4:_context67.t0===St.Text?11:_context67.t0===St.Arrow?19:_context67.t0===St.Straight?19:_context67.t0===St.Rectangle?19:_context67.t0===St.Ellipse?19:_context67.t0===St.Star?19:_context67.t0===St.Polygon?19:_context67.t0===St.SpeechBalloon?19:_context67.t0===St.Pencil?22:_context67.t0===St.PencilEraser?37:_context67.t0===St.BitMapEraser?37:50;break;case 4:gt=et.oldRect;gt&&((n=t.render)==null||n.push({rect:gt,isClear:!0,clearCanvas:Rt.Bg,viewId:_this96.viewId}),(i=t.render)==null||i.push({rect:gt,drawCanvas:Rt.Bg,viewId:_this96.viewId}));_context67.next=8;return(l=et.node)==null?void 0:l.consumeServiceAsync({isFullWork:!0,worker:_this96.thread});case 8:Tt=_context67.sent;_this96.selectorWorkShapes.forEach(function(X,z){var Q;(Q=X.selectIds)!=null&&Q.includes(pt)&&(_this96.willRunEffectSelectorIds.add(z),_this96.noAnimationRect=Wt(_this96.noAnimationRect,gt),_this96.noAnimationRect=Wt(_this96.noAnimationRect,Tt),_this96.runEffect());}),_this96.workShapes["delete"](pt),(o=t.render)==null||o.push({rect:Tt,drawCanvas:Rt.Bg,viewId:_this96.viewId});return _context67.abrupt("break",50);case 11:if(!et.node){_context67.next=18;break;}_gt3=et.oldRect;_gt3&&((a=t.render)==null||a.push({rect:_gt3,isClear:!0,clearCanvas:Rt.Bg,viewId:_this96.viewId}),(f=t.render)==null||f.push({rect:_gt3,drawCanvas:Rt.Bg,viewId:_this96.viewId}));_context67.next=16;return et.node.consumeServiceAsync({isFullWork:!0,replaceId:pt});case 16:_Tt2=_context67.sent;_this96.selectorWorkShapes.forEach(function(X,z){var Q;(Q=X.selectIds)!=null&&Q.includes(pt)&&(_this96.willRunEffectSelectorIds.add(z),_this96.noAnimationRect=Wt(_this96.noAnimationRect,_gt3),_this96.noAnimationRect=Wt(_this96.noAnimationRect,_Tt2),_this96.runEffect());}),(g=et.node)==null||g.clearTmpPoints(),_this96.workShapes["delete"](pt),(c=t.render)==null||c.push({rect:_Tt2,drawCanvas:Rt.Bg,viewId:_this96.viewId});case 18:return _context67.abrupt("break",50);case 19:_gt4=!!et.ops;if((m=et.animationWorkData)!=null&&m.length){_Tt3=et.oldRect,X=et.node.oldRect;_Tt3&&((x=t.render)==null||x.push({rect:_Tt3,isClear:!0,clearCanvas:Rt.Bg,viewId:_this96.viewId}),(M=t.render)==null||M.push({rect:_Tt3,drawCanvas:Rt.Bg,viewId:_this96.viewId})),X&&((S=t.render)==null||S.push({rect:X,isClear:!0,clearCanvas:Rt.ServiceFloat,viewId:_this96.viewId}));z=(P=et.node)==null?void 0:P.consumeService({op:et.animationWorkData,isFullWork:_gt4});r.set(pt,{workState:_Tt3?et.ops?Ft.Done:Ft.Doing:Ft.Start,op:et.animationWorkData.filter(function(Q,tt){if(tt%3!==2)return!0;}).slice(-2)}),_gt4?(_this96.selectorWorkShapes.forEach(function(Q,tt){var U;(U=Q.selectIds)!=null&&U.includes(pt)&&(_this96.willRunEffectSelectorIds.add(tt),_this96.noAnimationRect=Wt(_this96.noAnimationRect,_Tt3),_this96.noAnimationRect=Wt(_this96.noAnimationRect,X),_this96.noAnimationRect=Wt(_this96.noAnimationRect,z),_this96.runEffect());}),(T=et.node)==null||T.clearTmpPoints(),_this96.workShapes["delete"](pt),(h=t.render)==null||h.push({rect:z,drawCanvas:Rt.Bg,viewId:_this96.viewId})):(p=t.render)==null||p.push({rect:z,drawCanvas:Rt.ServiceFloat,workerType:_gt4?void 0:bt.Service,viewId:_this96.viewId}),et.animationWorkData.length=0;}return _context67.abrupt("break",50);case 22:if(!(!et.useAnimation&&et.ops)){_context67.next=28;break;}_gt5=(d=et.node)==null?void 0:d.consumeService({op:et.animationWorkData||[],isFullWork:!0,replaceId:pt});_Tt4=(y=et.node)==null?void 0:y.updataOptService(et.updateNodeOpt);_gt5=Wt(_gt5,_Tt4),(O=t.render)==null||O.push({isClear:!0,rect:Wt(et.oldRect,_gt5),clearCanvas:Rt.Bg,viewId:_this96.viewId}),(E=t.render)==null||E.push({rect:Wt(et.oldRect,_gt5),drawCanvas:Rt.Bg,viewId:_this96.viewId}),_this96.selectorWorkShapes.forEach(function(X,z){var Q;(Q=X.selectIds)!=null&&Q.includes(pt)&&(_this96.willRunEffectSelectorIds.add(z),_this96.noAnimationRect=Wt(_this96.noAnimationRect,_gt5),_this96.runEffect());}),(w=et.node)==null||w.clearTmpPoints(),_this96.workShapes["delete"](pt);_context67.next=36;break;case 28:if(!et.useAnimation){_context67.next=36;break;}if(!et.isDel){_context67.next=32;break;}(B=et.node)==null||B.clearTmpPoints(),_this96.workShapes["delete"](pt);return _context67.abrupt("break",50);case 32:_gt6=3,_Tt5=_this96.computNextAnimationIndex(et,_gt6),_X=et.isDiff?0:Math.max(0,(et.animationIndex||0)-_gt6),_z=(et.animationWorkData||[]).slice(0,_Tt5),Q=(b=(A=et.node)==null?void 0:A.getWorkId())==null?void 0:b.toString();if((et.animationIndex||0)<_Tt5||et.isDiff){tt=(W=et.node)==null?void 0:W.consumeService({op:_z,isFullWork:!1,replaceId:Q});if((D=t.render)==null||D.push({isClear:!0,rect:tt,clearCanvas:Rt.ServiceFloat,viewId:_this96.viewId}),(R=t.render)==null||R.push({rect:tt,drawCanvas:Rt.ServiceFloat,viewId:_this96.viewId}),et.animationIndex=_Tt5,et.isDiff&&(et.isDiff=!1),_z.length){U=_z.filter(function(H,C){if(C%_gt6!==_gt6-1)return!0;}).slice(-2);r.set(pt,{workState:_X===0?Ft.Start:_Tt5===((j=et.animationWorkData)==null?void 0:j.length)?Ft.Done:Ft.Doing,op:U});}}else if(et.ops){_tt=(k=et.node)==null?void 0:k.consumeService({op:et.animationWorkData||[],isFullWork:!0,replaceId:Q});et.isDel=!0,(J=t.render)==null||J.push({isClear:!0,rect:_tt,clearCanvas:Rt.ServiceFloat,viewId:_this96.viewId},{rect:_tt,drawCanvas:Rt.ServiceFloat,viewId:_this96.viewId},{isClear:!0,rect:_tt,clearCanvas:Rt.Bg,viewId:_this96.viewId},{rect:_tt,drawCanvas:Rt.Bg,viewId:_this96.viewId}),r.set(pt,{workState:Ft.Done,op:_z.filter(function(U,H){if(H%_gt6!==_gt6-1)return!0;}).slice(-2)});}e=!0;return _context67.abrupt("break",50);case 36:return _context67.abrupt("break",50);case 37:if(!et.isDel){_context67.next=40;break;}(rt=et.node)==null||rt.clearTmpPoints(),_this96.workShapes["delete"](pt);return _context67.abrupt("break",50);case 40:if(!(et.ops&&(st=et.animationWorkData)!=null&&st.length)){_context67.next=44;break;}_gt7=et.animationWorkData.slice(-3,-1);r.set(pt,{workState:Ft.Done,op:_gt7}),et.isDel=!0;return _context67.abrupt("break",50);case 44:if(!et.useAnimation){_context67.next=49;break;}_Tt6=_this96.computNextAnimationIndex(et,3),_X2=et.isDiff?0:Math.max(0,(et.animationIndex||0)-3),_z2=(et.animationWorkData||[]).slice(0,_Tt6);if((et.animationIndex||0)<_Tt6||et.isDiff){_Q=($=et.node)==null?void 0:$.consumeService({op:_z2,isFullWork:!1,replaceId:pt});if((V=t.render)==null||V.push({isClear:!0,rect:Wt(et.oldRect,_Q),clearCanvas:Rt.ServiceFloat,viewId:_this96.viewId}),(nt=t.render)==null||nt.push({rect:Wt(et.oldRect,_Q),drawCanvas:Rt.ServiceFloat,viewId:_this96.viewId}),et.animationIndex=_Tt6,et.isDiff&&(et.isDiff=!1),_z2.length){_tt2=_z2.filter(function(U,H){if(H%3!==2)return!0;}).slice(-2);r.set(pt,{workState:_X2===0?Ft.Start:_Tt6===((lt=et.animationWorkData)==null?void 0:lt.length)?Ft.Done:Ft.Doing,op:_tt2});}}e=!0;return _context67.abrupt("break",50);case 49:return _context67.abrupt("break",50);case 50:case"end":return _context67.stop();}},_loop6);});_iterator62.s();case 7:if((_step62=_iterator62.n()).done){_context68.next=11;break;}return _context68.delegateYield(_loop6(),"t0",9);case 9:_context68.next=7;break;case 11:_context68.next=16;break;case 13:_context68.prev=13;_context68.t1=_context68["catch"](4);_iterator62.e(_context68.t1);case 16:_context68.prev=16;_iterator62.f();return _context68.finish(16);case 19:e&&this.runAnimation();r.size&&(t.sp=[],r.forEach(function(pt,et){var gt;(gt=t.sp)==null||gt.push({type:dt.Cursor,uid:et.split(or)[0],op:pt.op,workState:pt.workState,viewId:_this96.viewId});}));_context68.t2=(ct=t.render)!=null&&ct.length;if(!_context68.t2){_context68.next=25;break;}_context68.next=25;return this.post(t);case 25:case"end":return _context68.stop();}},_callee65,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this97=this;this.animationId||(this.animationId=setTimeout(function(){_this97.animationId=void 0,_this97.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 _callee66(){var _this98=this;var e;return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:this.runEffectId=void 0;e=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,l;var r=_this98.selectorWorkShapes.get(t),n=r&&r.selectIds&&((i=r.node)==null?void 0:i.selectServiceNode(t,r,!0));e=Wt(e,n),(l=r==null?void 0:r.selectIds)!=null&&l.length||_this98.selectorWorkShapes["delete"](t);});_context69.t0=e;if(!_context69.t0){_context69.next=7;break;}_context69.next=7;return this.post({render:[{rect:Kt(e),isClear:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{rect:Kt(e),drawCanvas:Rt.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context69.stop();}},_callee66,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(e){var g,c,m;var t=e.workId,r=e.opt,n=e.toolsType,i=e.type,l=e.selectIds,o=e.imageBitmap;if(!t)return;var a=t.toString();if(!((g=this.selectorWorkShapes)!=null&&g.has(a))){var x={toolsType:n,selectIds:l,type:i,opt:r,imageBitmap:o};n&&r&&(x=this.setNodeKey(a,x,n,r)),(c=this.selectorWorkShapes)==null||c.set(a,x);}var f=(m=this.selectorWorkShapes)==null?void 0:m.get(a);i&&(f.type=i),f.node&&f.node.getWorkId()!==a&&f.node.setWorkId(a),o&&(f.imageBitmap=o),f.selectIds=l||[];}}]);}();var iy=/*#__PURE__*/function(_ls2){function iy(t){var _this99;_classCallCheck(this,iy);_this99=_callSuper(this,iy,[t]);at(_this99,"drawWorkActiveId");return _this99;}_inherits(iy,_ls2);return _createClass(iy,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var i,r,n,l,o,a;return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:r=this.setFullWork(t),n=t.ops&&Ze(t.ops);if(!r){_context70.next=18;break;}a=(i=r.getWorkId())==null?void 0:i.toString();if(!(r.toolsType===St.Image)){_context70.next=9;break;}_context70.next=6;return r.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 6:l=_context70.sent;_context70.next=16;break;case 9:if(!(r.toolsType===St.Text)){_context70.next=15;break;}_context70.next=12;return r.consumeServiceAsync({isFullWork:!0,replaceId:a,isDrawLabel:!0});case 12:l=_context70.sent;_context70.next=16;break;case 15:l=r.consumeService({op:n,isFullWork:!0,replaceId:a}),o=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context70.abrupt("return",Wt(l,o));case 18:case"end":return _context70.stop();}},_callee67,this);}));function runFullWork(_x93){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{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 _iterator63=_createForOfIteratorHelper(this.workShapes.keys()),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var t=_step63.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}xe(this.fullLayer,this.fullLayer.parent);}},{key:"canUseSubWorker",value:function canUseSubWorker(t){var r=this.thread.getPriorityDraw();return r||!r&&t!==St.Pencil;}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){var r,n,i,l,o,a,f;return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:r=t.workId,n=t.fullWorkerDrawCount,i=t.postCount,l=r==null?void 0:r.toString(),o=l&&this.workShapes.get(l);if(o){_context71.next=3;break;}return _context71.abrupt("return");case 3:_context71.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==l;if(!_context71.t0){_context71.next=8;break;}_context71.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:dt.DrawWork,dataType:bt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&l!==_t&&(this.drawWorkActiveId=l);a=o.toolsType;he(i)&&(this.consumeCount=i);f=o.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:n});_context71.t1=a;_context71.next=_context71.t1===St.Selector?15:_context71.t1===St.Ellipse?21:_context71.t1===St.Arrow?21:_context71.t1===St.Straight?21:_context71.t1===St.Rectangle?21:_context71.t1===St.Star?21:_context71.t1===St.Polygon?21:_context71.t1===St.SpeechBalloon?21:_context71.t1===St.Pencil?27:_context71.t1===St.PencilEraser?27:_context71.t1===St.BitMapEraser?27:33;break;case 15:_context71.t2=f;if(!_context71.t2){_context71.next=20;break;}this.drawCount++;_context71.next=20;return this.drawSelector(f);case 20:return _context71.abrupt("break",33);case 21:_context71.t3=f;if(!_context71.t3){_context71.next=26;break;}this.drawCount++;_context71.next=26;return this.drawShape(f);case 26:return _context71.abrupt("break",33);case 27:_context71.t4=f;if(!_context71.t4){_context71.next=32;break;}this.drawCount++;_context71.next=32;return this.drawPencil(f,r==null?void 0:r.toString());case 32:return _context71.abrupt("break",33);case 33:case"end":return _context71.stop();}},_callee68,this);}));function consumeDraw(_x94){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(t){var r,n,i;return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:r=t.workId;if(!r){_context72.next=14;break;}n=r.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);i=this.workShapes.get(n);if(i){_context72.next=7;break;}return _context72.abrupt("return");case 7:_context72.t0=i.toolsType;_context72.next=_context72.t0===St.Selector?10:_context72.t0===St.Arrow?12:_context72.t0===St.Straight?12:_context72.t0===St.Ellipse?12:_context72.t0===St.Pencil?12:_context72.t0===St.Rectangle?12:_context72.t0===St.Star?12:_context72.t0===St.Polygon?12:_context72.t0===St.SpeechBalloon?12:_context72.t0===St.BitMapEraser?12:_context72.t0===St.PencilEraser?12:14;break;case 10:this.drawCount=0,xe(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n),this._post({render:[{isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}]});return _context72.abrupt("break",14);case 12:this.drawCount=0,xe(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n);return _context72.abrupt("break",14);case 14:case"end":return _context72.stop();}},_callee69,this);}));function consumeDrawAll(_x95){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t){var r,n,i,l;return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context73.next=8;break;}i=this.removeNode(n);if(!i){_context73.next=8;break;}l=[];l.push({rect:Kt(i),clearCanvas:Rt.Float,isClear:!0,viewId:this.viewId},{rect:Kt(i),drawCanvas:Rt.Float,viewId:this.viewId});_context73.next=8;return this._post({render:l});case 8:case"end":return _context73.stop();}},_callee70,this);}));function removeWork(_x96){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this100=this;var r=this.workShapes.has(t);var n;return r&&(this.fullLayer.getElementsByName(t).forEach(function(i){var l=i.getBoundingClientRect();n=Wt(n,{x:l.x-Mt.SafeBorderPadding,y:l.y-Mt.SafeBorderPadding,w:l.width+Mt.SafeBorderPadding*2,h:l.height+Mt.SafeBorderPadding*2}),i.remove(),_me(i,_this100.fullLayer.parent);}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(t,r){return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:_context74.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Rt.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context74.stop();}},_callee71,this);}));function drawPencil(_x97,_x98){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(t){return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:_context75.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&Kt(t.rect),isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Kt(t.rect),drawCanvas:Rt.Float,viewId:this.viewId}]});case 2:case"end":return _context75.stop();}},_callee72,this);}));function drawShape(_x99){return _drawShape2.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(t){return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:_context76.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&Kt(t.rect),isClear:!0,clearCanvas:Rt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Kt(t.rect),drawCanvas:Rt.Float,viewId:this.viewId}]});case 2:case"end":return _context76.stop();}},_callee73,this);}));function drawSelector(_x100){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(ls);var sy=/*#__PURE__*/function(){function sy(e){_classCallCheck(this,sy);at(this,"viewId");at(this,"vNodes");at(this,"topLayer");at(this,"thread");at(this,"post");at(this,"serviceWorkShapes",/* @__PURE__ */new Map());at(this,"localWorkShapes",/* @__PURE__ */new Map());at(this,"tmpOpt");at(this,"syncUnitTime",Se.syncOpt.interval);at(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(sy,[{key:"canUseTopLayer",value:function canUseTopLayer(e){return e===St.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:Ft.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===St.LaserPen)return pn(_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===bt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var l=i.node.consume({data:e,isFullWork:!1,isSubWorker:!0});l.rect&&(i.totalRect=Wt(l.rect,i.totalRect),i.result=l,i.workState=Ft.Doing,n&&this.localWorkShapes.set(n,i));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(e){var t=e.workId,r=e.dataType;if(r===bt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var l=i.node.consumeAll({data:e});i.totalRect=Wt(l.rect,i.totalRect),i.result=l,i.workState=Ft.Done,n&&this.localWorkShapes.set(n,i);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(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 m,x;var t=e.workId,r=e.opt,n=e.toolsType,i=e.type,l=e.updateNodeOpt,o=e.ops,a=e.op;if(!t)return;var f=t.toString(),g=(m=this.vNodes.get(f))==null?void 0:m.rect;if(!((x=this.serviceWorkShapes)!=null&&x.has(f))){var M={toolsType:n,animationWorkData:a||[],animationIndex:0,type:i,updateNodeOpt:l,ops:o,oldRect:g};n&&r&&(M=this.setNodeKey(f,M,n,r)),this.serviceWorkShapes.set(f,M);}var c=this.serviceWorkShapes.get(f);i&&(c.type=i),o&&(c.animationWorkData=Ze(o),c.ops=o),l&&(c.updateNodeOpt=l),a&&(c.animationWorkData=a),c.node&&c.node.getWorkId()!==f&&c.node.setWorkId(f),g&&(c.oldRect=g),n&&r&&(c.toolsType!==n&&n&&r&&this.setNodeKey(f,c,n,r),c.node&&c.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 _callee74(){var _this101=this;var l,o,a,f,e,t,r,n,i,_iterator64,_step64,_step64$value,g,c,x,M,S,P,_iterator65,_step65,_step65$value,_g12,_c7,m,_x101,_M8,_S3,_P10;return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:this.animationId=void 0;e=!1;t=/* @__PURE__ */new Map(),r=[],n=[],i=[];_iterator64=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context77.prev=4;_iterator64.s();case 6:if((_step64=_iterator64.n()).done){_context77.next=20;break;}_step64$value=_slicedToArray(_step64.value,2),g=_step64$value[0],c=_step64$value[1];_context77.t0=c.toolsType;_context77.next=_context77.t0===St.LaserPen?11:18;break;case 11:x=this.computNextAnimationIndex(c,8),M=Math.max(0,c.animationIndex||0),S=(c.animationWorkData||[]).slice(M,x);if((c.animationIndex||0)<x){P=(l=c.node)==null?void 0:l.consumeService({op:S,isFullWork:!1});c.totalRect=Wt(c.totalRect,P),c.animationIndex=x,S.length&&t.set(g,{workState:M===0?Ft.Start:x===((o=c.animationWorkData)==null?void 0:o.length)?Ft.Done:Ft.Doing,op:S.slice(-2)});}if(!(n.push({isClear:!0,rect:c.totalRect,clearCanvas:Rt.TopFloat,viewId:this.viewId}),r.push({rect:c.totalRect,drawCanvas:Rt.TopFloat,viewId:this.viewId}),c.isDel)){_context77.next=16;break;}(a=c.node)==null||a.clearTmpPoints(),this.serviceWorkShapes["delete"](g);return _context77.abrupt("break",18);case 16:c.ops&&c.animationIndex===((f=c.animationWorkData)==null?void 0:f.length)&&!c.isDel&&(this.topLayer.getElementsByName(g.toString())[0]||(c.isDel=!0,this.serviceWorkShapes.set(g,c))),e=!0;return _context77.abrupt("break",18);case 18:_context77.next=6;break;case 20:_context77.next=25;break;case 22:_context77.prev=22;_context77.t1=_context77["catch"](4);_iterator64.e(_context77.t1);case 25:_context77.prev=25;_iterator64.f();return _context77.finish(25);case 28:_iterator65=_createForOfIteratorHelper(this.localWorkShapes.entries());_context77.prev=29;_iterator65.s();case 31:if((_step65=_iterator65.n()).done){_context77.next=44;break;}_step65$value=_slicedToArray(_step65.value,2),_g12=_step65$value[0],_c7=_step65$value[1];m=_c7.result,_x101=_c7.toolsType,_M8=_c7.totalRect,_S3=_c7.isDel,_P10=_c7.workState;_context77.t2=_x101;_context77.next=_context77.t2===St.LaserPen?37:42;break;case 37:if(!(_M8&&(n.push({isClear:!0,rect:_M8,clearCanvas:Rt.TopFloat,viewId:this.viewId}),r.push({rect:_M8,drawCanvas:Rt.TopFloat,viewId:this.viewId})),_S3)){_context77.next=40;break;}_c7.node.clearTmpPoints(),this.localWorkShapes["delete"](_g12),i.push({removeIds:[_g12.toString()],viewId:this.viewId,type:dt.RemoveNode});return _context77.abrupt("break",42);case 40:m&&((m.op||m.ops)&&i.push(m),_c7.result=void 0),!this.topLayer.getElementsByName(_g12.toString())[0]&&_P10===Ft.Done&&(_c7.isDel=!0,this.localWorkShapes.set(_g12,_c7)),e=!0;return _context77.abrupt("break",42);case 42:_context77.next=31;break;case 44:_context77.next=49;break;case 46:_context77.prev=46;_context77.t3=_context77["catch"](29);_iterator65.e(_context77.t3);case 49:_context77.prev=49;_iterator65.f();return _context77.finish(49);case 52:e&&this.runAnimation(),t.size&&t.forEach(function(g,c){i.push({type:dt.Cursor,uid:c.split(or)[0],op:g.op,workState:g.workState,viewId:_this101.viewId});}),(r.length||n.length||i.length)&&this.post({render:[].concat(n,r),sp:i});case 53:case"end":return _context77.stop();}},_callee74,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this102=this;this.animationId||(this.animationId=setTimeout(function(){_this102.animationId=void 0,_this102.animationDraw();},16));}}]);}();var Lr=/* @__PURE__ */function(u){return u.Full="full",u.Sub="sub",u;}(Lr||{});var oy=/*#__PURE__*/function(){function oy(e,t){_classCallCheck(this,oy);at(this,"_self");at(this,"version",Yi);at(this,"type");at(this,"hasPriorityDraw",!0);at(this,"workThreadMap",/* @__PURE__ */new Map());this._self=e,this.type=t,this.register();}return _createClass(oy,[{key:"init",value:function init(e){var t=e.viewId,r=e.dpr,n=e.offscreenCanvasOpt,i=e.layerOpt,l=e.isSafari,o=e.combineUnitTime,a=e.syncUnitTime;if(!r||!n||!i)return;var f;this.type==="full"&&(f=new ay(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:i,combineUnitTime:o,syncUnitTime:a},this.post.bind(this))),this.type==="sub"&&(f=new ds(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this)),f.setHasPriorityDraw(this.hasPriorityDraw)),f&&l&&f.setIsSafari(l),f&&e.cameraOpt&&f.setCameraOpt(e.cameraOpt),f&&this.workThreadMap.set(t,f);}},{key:"register",value:function register(){var _this103=this;onmessage=/*#__PURE__*/function(){var _ref171=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(e){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,n,i,l,o,_iterator66,_step66,f,_iterator67,_step67,_step67$value,_f8,g,c,_iterator68,_step68,_f9,a;return _regeneratorRuntime().wrap(function _callee75$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:t=e.data;if(!t){_context78.next=56;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context78.prev=4;_iterator=_asyncIterator(t.values());case 6:_context78.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context78.sent).done)){_context78.next=40;break;}r=_step.value;n=r.msgType,i=r.viewId,l=r.tasksqueue,o=r.mainTasksqueueCount;if(!(n===dt.Console)){_context78.next=14;break;}console.log(_this103);return _context78.abrupt("continue",37);case 14:if(!(n===dt.Init)){_context78.next=17;break;}_this103.init(r);return _context78.abrupt("continue",37);case 17:if(!(_this103.type==="sub"&&(n===dt.PriorityWorker||n===dt.PriorityMainThreadWorker))){_context78.next=22;break;}n===dt.PriorityWorker?_this103.hasPriorityDraw=!0:n===dt.PriorityMainThreadWorker&&(_this103.hasPriorityDraw=!1);_iterator66=_createForOfIteratorHelper(_this103.workThreadMap.values());try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){f=_step66.value;f.setHasPriorityDraw(_this103.hasPriorityDraw);}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}return _context78.abrupt("continue",37);case 22:if(!(n===dt.TasksQueue&&l!=null&&l.size)){_context78.next=27;break;}_iterator67=_createForOfIteratorHelper(_this103.workThreadMap.entries());try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){_step67$value=_slicedToArray(_step67.value,2),_f8=_step67$value[0],g=_step67$value[1];c=l.get(_f8);c&&g.on(c);}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}_this103.type==="full"&&he(o)&&_this103.post({workerTasksqueueCount:o});return _context78.abrupt("continue",37);case 27:if(!(i===qs)){_context78.next=31;break;}_iterator68=_createForOfIteratorHelper(_this103.workThreadMap.values());try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){_f9=_step68.value;_f9.on(r),n===dt.Destroy&&_this103.workThreadMap["delete"](i);}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}return _context78.abrupt("continue",37);case 31:a=_this103.workThreadMap.get(i);_context78.t0=a;if(!_context78.t0){_context78.next=37;break;}_context78.next=36;return a.on(r);case 36:n===dt.Destroy&&_this103.workThreadMap["delete"](i);case 37:_iteratorAbruptCompletion=false;_context78.next=6;break;case 40:_context78.next=46;break;case 42:_context78.prev=42;_context78.t1=_context78["catch"](4);_didIteratorError=true;_iteratorError=_context78.t1;case 46:_context78.prev=46;_context78.prev=47;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context78.next=51;break;}_context78.next=51;return _iterator["return"]();case 51:_context78.prev=51;if(!_didIteratorError){_context78.next=54;break;}throw _iteratorError;case 54:return _context78.finish(51);case 55:return _context78.finish(46);case 56:case"end":return _context78.stop();}},_callee75,null,[[4,42,46,56],[47,,51,55]]);}));return function onmessage(_x102){return _ref171.apply(this,arguments);};}();}},{key:"post",value:function post(e,t){t?this._self.postMessage(e,t):this._self.postMessage(e);}}]);}();var ay=/*#__PURE__*/function(_as){function ay(t,r,n){var _this104;_classCallCheck(this,ay);_this104=_callSuper(this,ay,[t,r,"full"/* Full */]);at(_this104,"type","full");at(_this104,"serviceDrawLayer");at(_this104,"localDrawLayer");at(_this104,"snapshotFullLayer");at(_this104,"methodBuilder");at(_this104,"localWork");at(_this104,"serviceWork");at(_this104,"_post");at(_this104,"debounceUpdateCache",/* @__PURE__ */new Set());_this104._post=n;var i=Se.bufferSize.sub;_this104.serviceDrawLayer=_this104.createLayer("serviceDrawLayer",_this104.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:i,contextType:"2d"})),_this104.localDrawLayer=_this104.createLayer("localDrawLayer",_this104.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:i,contextType:"2d"}));var l={thread:_this104,viewId:_this104.viewId,vNodes:_this104.vNodes,fullLayer:_this104.fullLayer};_this104.localWork=new ry(_objectSpread(_objectSpread({},l),{},{drawLayer:_this104.localDrawLayer})),r.combineUnitTime&&_this104.localWork.setCombineUnitTime(r.combineUnitTime),r.syncUnitTime&&_this104.localWork.setSyncUnitTime(r.syncUnitTime),_this104.serviceWork=new ny(_objectSpread(_objectSpread({},l),{},{drawLayer:_this104.serviceDrawLayer})),_this104.methodBuilder=new co([Zt.CopyNode,Zt.SetColorNode,Zt.DeleteNode,Zt.RotateNode,Zt.ScaleNode,Zt.TranslateNode,Zt.ZIndexNode,Zt.SetFontStyle,Zt.SetPoint,Zt.SetLock,Zt.SetShapeOpt]).registerForWorker(_this104),_this104.vNodes.init(_this104.fullLayer);return _this104;}_inherits(ay,_as);return _createClass(ay,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){var _this105=this;var l,o,_this$combinePostData,t,r,n,a,_iterator69,_step69,f,g,i;return _regeneratorRuntime().wrap(function _callee76$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,r=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context79.next=28;break;}a=[];_iterator69=_createForOfIteratorHelper(t);_context79.prev=4;_iterator69.s();case 6:if((_step69=_iterator69.n()).done){_context79.next=19;break;}f=_step69.value;if(!f.rect){_context79.next=17;break;}if(!(f.rect=os(ue(f.rect),this.scene,this.dpr),!f.rect)){_context79.next=11;break;}return _context79.abrupt("continue",17);case 11:if(!(f.drawCanvas&&f.rect&&f.rect.w>0&&f.rect.h>0)){_context79.next=16;break;}_context79.next=14;return this.getRectImageBitmap(f);case 14:g=_context79.sent;f.imageBitmap=g,n||(n=[]),n.push(g);case 16:a.push(f);case 17:_context79.next=6;break;case 19:_context79.next=24;break;case 21:_context79.prev=21;_context79.t0=_context79["catch"](4);_iterator69.e(_context79.t0);case 24:_context79.prev=24;_iterator69.f();return _context79.finish(24);case 27:r.render=a;case 28:i=(l=r.sp)==null?void 0:l.filter(function(a){return a.type!==dt.None||a.isLockSentEventCursor;});i!=null&&i.length?r.sp=i.map(function(a){return _objectSpread(_objectSpread({},a),{},{viewId:_this105.viewId});}):delete r.sp,r.fullWorkerDrawCount===void 0&&delete r.fullWorkerDrawCount,r.consumeCount===void 0&&delete r.consumeCount,(r!=null&&r.fullWorkerDrawCount||r.consumeCount||i!=null&&i.length||(o=r.render)!=null&&o.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context79.stop();}},_callee76,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 _callee77(t){var _this106=this;var r,n,i,l,o,a,f,g,_f10;return _regeneratorRuntime().wrap(function _callee77$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context80.next=2;break;}return _context80.abrupt("return");case 2:r=t.msgType,n=t.dataType,i=t.workId,l=t.toolsType,o=t.workState,a=t.workIds;_context80.t0=r;_context80.next=_context80.t0===dt.AuthClear?6:_context80.t0===dt.CreateWork?9:_context80.t0===dt.DrawWork?11:_context80.t0===dt.Select?20:_context80.t0===dt.UpdateNode?27:_context80.t0===dt.FullWork?27:_context80.t0===dt.RemoveNode?29:_context80.t0===dt.GetTextActive?32:_context80.t0===dt.CursorHover?35:_context80.t0===dt.CursorBlur?38:_context80.t0===dt.GetVNodeInfo?41:43;break;case 6:f=t.clearUids,g=t.localUid;this.vNodes.setCanClearUids(f),this.vNodes.setLocalUid(g);return _context80.abrupt("break",43);case 9:l!==St.LaserPen&&this.createLocalWork(t);return _context80.abrupt("break",43);case 11:_context80.t1=l!==St.LaserPen;if(!_context80.t1){_context80.next=19;break;}if(!(o===Ft.Done&&n===bt.Local)){_context80.next=18;break;}_context80.next=16;return this.consumeDrawAll(n,t);case 16:_context80.next=19;break;case 18:this.consumeDraw(n,t);case 19:return _context80.abrupt("break",43);case 20:if(!(i===_t)){_context80.next=25;break;}_context80.next=23;return this.localWork.updateFullSelectWork(t);case 23:_context80.next=26;break;case 25:this.serviceWork.runSelectWork(t);case 26:return _context80.abrupt("return");case 27:this.consumeFull(n,t);return _context80.abrupt("return");case 29:_context80.next=31;return this.removeNode(t);case 31:return _context80.abrupt("return");case 32:_context80.next=34;return this.checkTextActive(t);case 34:return _context80.abrupt("return");case 35:_context80.next=37;return this.cursorHover(t);case 37:return _context80.abrupt("return");case 38:_context80.next=40;return this.cursorBlur();case 40:return _context80.abrupt("return");case 41:if(i&&a){_f10=a.map(function(g){return _this106.vNodes.get(g);});this.post({sp:[{type:dt.GetVNodeInfo,dataType:bt.Worker,workId:i,vInfo:_f10}]});}return _context80.abrupt("break",43);case 43:_context80.next=45;return _superPropGet(ay,"on",this,3)([t]);case 45:case"end":return _context80.stop();}},_callee77,this);}));function on(_x103){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t){var _this107=this;var r,n,i,l,o,_iterator70,_step70,_loop7;return _regeneratorRuntime().wrap(function _callee78$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:r=t.dataType,n=t.workId,i=t.removeIds,l=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context82.next=20;break;}_iterator70=_createForOfIteratorHelper(o);_context82.prev=3;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var a;return _regeneratorRuntime().wrap(function _loop7$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:a=_step70.value;a===_t?l.push(_this107.localWork.removeSelector(t,_this107)):r===bt.Local?l.push(_this107.localWork.removeWork(t).then(function(){_this107.localWork.colloctEffectSelectWork(t),_this107.deleteCachedImagesByWorkId(a);})):r===bt.Service&&l.push(_this107.serviceWork.removeWork(t).then(function(){_this107.localWork.colloctEffectSelectWork(t),_this107.deleteCachedImagesByWorkId(a);}));case 2:case"end":return _context81.stop();}},_loop7);});_iterator70.s();case 6:if((_step70=_iterator70.n()).done){_context82.next=10;break;}return _context82.delegateYield(_loop7(),"t0",8);case 8:_context82.next=6;break;case 10:_context82.next=15;break;case 12:_context82.prev=12;_context82.t1=_context82["catch"](3);_iterator70.e(_context82.t1);case 15:_context82.prev=15;_iterator70.f();return _context82.finish(15);case 18:_context82.next=20;return Promise.all(l);case 20:case"end":return _context82.stop();}},_callee78,null,[[3,12,15,18]]);}));function removeNode(_x104){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t){var r;return _regeneratorRuntime().wrap(function _callee79$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:r=t.dataType;_context83.t0=r===bt.Local;if(!_context83.t0){_context83.next=5;break;}_context83.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context83.stop();}},_callee79,this);}));function checkTextActive(_x105){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(){return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:this.vNodes.clear();_superPropGet(ay,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),xe(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),xe(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context84.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Rt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}],sp:[{type:dt.Clear}]});case 6:case"end":return _context84.stop();}},_callee80,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(ay,"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,i=t.centerY,l=t.width,o=t.height;(l!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:l,height:o}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-i])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[r,r]),this.localDrawLayer.setAttribute("translate",[-n,-i])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[r,r]),this.serviceDrawLayer.setAttribute("translate",[-n,-i]));}},{key:"getLayer",value:function getLayer(t){switch(t){case Rt.Bg:return this.fullLayer;case Rt.ServiceFloat:return this.serviceDrawLayer;case Rt.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 _callee81(t,r){var n;return _regeneratorRuntime().wrap(function _callee81$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:_context85.next=2;return this.localWork.colloctEffectSelectWork(r);case 2:n=_context85.sent;_context85.t0=n&&t===bt.Local;if(!_context85.t0){_context85.next=7;break;}_context85.next=7;return this.localWork.consumeFull(n);case 7:n&&t===bt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context85.stop();}},_callee81,this);}));function consumeFull(_x106,_x107){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t,r){var n;return _regeneratorRuntime().wrap(function _callee82$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:n=r.workId;_context86.t0=t===bt.Local&&n;if(!_context86.t0){_context86.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context86.next=6;return this.localWork.consumeDraw(r,this.serviceWork);case 6:t===bt.Service&&this.serviceWork.consumeDraw(r);case 7:case"end":return _context86.stop();}},_callee82,this);}));function consumeDraw(_x108,_x109){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(t,r){var n;return _regeneratorRuntime().wrap(function _callee83$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:n=r.workId;_context87.t0=t===bt.Local&&n;if(!_context87.t0){_context87.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context87.next=6;return this.localWork.consumeDrawAll(r,this.serviceWork);case 6:case"end":return _context87.stop();}},_callee83,this);}));function consumeDrawAll(_x110,_x111){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(t){return _regeneratorRuntime().wrap(function _callee84$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:_superPropGet(ay,"updateDpr",this,3)([t]);_context88.next=3;return this.post({render:[{isClearAll:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Rt.Bg,viewId:this.viewId}]});case 3:case"end":return _context88.stop();}},_callee84,this);}));function updateDpr(_x112){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var _this108=this;var l,o,a,f,g,r,n,i,c,P,_iterator71,_step71,_step71$value,_T48,_h41,m,_iterator72,_step72,_step72$value,_P15,_T53,_h44,_iterator73,_step73,_step73$value,_P16,_T54,_h45,x,M,_P11,_iterator74,_step74,_T49,S,_iterator75,_step75,_P12,_T50,_iterator76,_step76,_h42,_iterator77,_step77,_step77$value,_P14,_step77$value$,_T52,_h43,p,d,y,O,E,w,B,A,b,W,_iterator78,_step78,_step78$value,_P13,_T51;return _regeneratorRuntime().wrap(function _callee85$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:r=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!we(this.cameraOpt,n))){_context89.next=42;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);c=!!this.serviceDrawLayer.children.length;if(!i){_context89.next=30;break;}P=!1;_iterator71=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context89.prev=7;_iterator71.s();case 9:if((_step71=_iterator71.n()).done){_context89.next=19;break;}_step71$value=_slicedToArray(_step71.value,2),_T48=_step71$value[0],_h41=_step71$value[1];_context89.t0=_h41.toolsType;_context89.next=_context89.t0===St.Text?14:_context89.t0===St.PencilEraser?14:_context89.t0===St.Eraser?14:_context89.t0===St.Selector?14:_context89.t0===St.LaserPen?14:15;break;case 14:return _context89.abrupt("break",17);case 15:_T48!==ir&&_T48!==_t&&(P=!0);return _context89.abrupt("break",17);case 17:_context89.next=9;break;case 19:_context89.next=24;break;case 21:_context89.prev=21;_context89.t1=_context89["catch"](7);_iterator71.e(_context89.t1);case 24:_context89.prev=24;_iterator71.f();return _context89.finish(24);case 27:if(!P){_context89.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this108.taskUpdateCameraId=void 0,_this108.updateCamera(t);},ii);return _context89.abrupt("return");case 30:m=/* @__PURE__ */new Map();_iterator72=_createForOfIteratorHelper(this.vNodes.getNodesByType(St.Text).entries());try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){_step72$value=_slicedToArray(_step72.value,2),_P15=_step72$value[0],_T53=_step72$value[1];_h44=_T53.rect;m.set(_P15,{rect:ue(_h44),scale:(l=this.cameraOpt)==null?void 0:l.scale});}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}_iterator73=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){_step73$value=_slicedToArray(_step73.value,2),_P16=_step73$value[0],_T54=_step73$value[1];_h45=_T54.rect;m.set(_P16,{rect:ue(_h45),scale:(o=this.cameraOpt)==null?void 0:o.scale});}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}x=new Set(m.keys());M=!1;if(this.localWork.hasSelector()){_P11=(a=this.localWork.getSelector())==null?void 0:a.selectIds;if(_P11){M=!0;_iterator74=_createForOfIteratorHelper(_P11);try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){_T49=_step74.value;x.add(_T49);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}}}S=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator75=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){_P12=_step75.value;_T50=_P12.selectIds;if(_T50){S=!0;_iterator76=_createForOfIteratorHelper(_T50);try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){_h42=_step76.value;x.add(_h42);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}}}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(x),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator77=_createForOfIteratorHelper(m.entries());try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){_step77$value=_slicedToArray(_step77.value,2),_P14=_step77$value[0],_step77$value$=_step77$value[1],_T52=_step77$value$.rect,_h43=_step77$value$.scale;p=this.vNodes.get(_P14);if(p){d=_T52,y=p.rect,O=this.getSceneRect(),E=sr(d,O),w=sr(y,O),B=p.toolsType,A=p.opt;b=!1;(E!==w||d.w!==y.w||d.h!==y.h||w===ye.intersect)&&(b=!0),B===St.Text&&A.workState===Ft.Done&&b&&this.debounceUpdateCache.add(_P14);W=!1;_h43&&(f=this.cameraOpt)!=null&&f.scale&&_h43>this.cameraOpt.scale?w!==ye.outside&&E!==ye.inside&&(W=!0):_h43&&(g=this.cameraOpt)!=null&&g.scale&&_h43===this.cameraOpt.scale&&(d.x!==y.x||d.y!==y.y)&&(w===ye.inside&&E!==ye.inside||w===ye.intersect&&E===ye.intersect)&&(W=!0),A.eraserlines&&A.eraserlines.length&&W&&!this.debounceUpdateCache.has(_P14)&&this.debounceUpdateCache.add(_P14);}}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}if(M&&this.localWork.reRenderSelector(),S){_iterator78=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator78.s();!(_step78=_iterator78.n()).done;){_step78$value=_slicedToArray(_step78.value,2),_P13=_step78$value[0],_T51=_step78$value[1];this.serviceWork.runSelectWork({workId:_P13,selectIds:_T51.selectIds,msgType:dt.Select,dataType:bt.Service,viewId:this.viewId});}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}}this.debounceUpdateCameraId=setTimeout(function(){var T;_this108.debounceUpdateCameraId=void 0;var P=[];var _iterator79=_createForOfIteratorHelper(_this108.debounceUpdateCache.values()),_step79;try{var _loop8=function _loop8(){var h=_step79.value;var p=_this108.vNodes.get(h);if(p){var d=p.toolsType,y=p.opt,O=p.rect,E=p.op,w=_this108.localWork.setFullWork({toolsType:d,opt:y,workId:h});if(w){var B=_this108.getSceneRect(),A=sr(O,B);d===St.Text?(T=_this108.fullLayer)!=null&&T.getElementsByName(h)[0]&&w instanceof lr&&P.push(w.consumeServiceAsync({isFullWork:!0,replaceId:h,isDrawLabel:A!==ye.outside})):y.eraserlines&&y.eraserlines.length&&P.push(new Promise(function(b){var W=w.consumeService({op:E,isFullWork:!0,replaceId:h,workState:Ft.Done});_this108.localWork.clearWorkShapeNodeCache(h),b(W);}));}}_this108.debounceUpdateCache["delete"](h);};for(_iterator79.s();!(_step79=_iterator79.n()).done;){_loop8();}}catch(err){_iterator79.e(err);}finally{_iterator79.f();}P.length?Promise.all(P).then(function(){var h=[];h.push({isClearAll:!0,clearCanvas:Rt.Bg,viewId:_this108.viewId},{isDrawAll:!0,drawCanvas:Rt.Bg,viewId:_this108.viewId}),h.length&&_this108.post({render:h}),_this108.vNodes.updateLowLevelNodesRect(),_this108.vNodes.clearHighLevelIds();}):(_this108.vNodes.updateLowLevelNodesRect(),_this108.vNodes.clearHighLevelIds());},ii*10);}c&&r.push({isClearAll:!0,clearCanvas:Rt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&r.push({isClearAll:!0,clearCanvas:Rt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Rt.Bg,viewId:this.viewId}),r.length&&this.post({render:r});case 42:case"end":return _context89.stop();}},_callee85,this,[[7,21,24,27]]);}));function updateCamera(_x113){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var r=t.rect,n=t.drawCanvas,i=Math.floor(r.x*this.dpr),l=Math.floor(r.y*this.dpr),o=Math.floor(r.w*this.dpr||1),a=Math.floor(r.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),i,l,o,a,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t){return _regeneratorRuntime().wrap(function _callee86$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:_context90.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context90.stop();}},_callee86,this);}));function cursorHover(_x114){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(){return _regeneratorRuntime().wrap(function _callee87$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:_context91.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context91.stop();}},_callee87,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(ay,"destroy",this,3)([]);}}]);}(as);var ds=/*#__PURE__*/function(_as2){function ds(t,r,n){var _this109;_classCallCheck(this,ds);_this109=_callSuper(this,ds,[t,r,"sub"/* Sub */]);at(_this109,"type","sub");at(_this109,"_post");at(_this109,"topLayer");at(_this109,"snapshotFullLayer");at(_this109,"serviceWork");at(_this109,"localWork");at(_this109,"topLayerWork");_this109._post=n;var i=Se.bufferSize.sub;_this109.topLayer=_this109.createLayer("topLayer",_this109.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:i,contextType:"2d"}));var l={thread:_this109,viewId:_this109.viewId,vNodes:_this109.vNodes,fullLayer:_this109.fullLayer,topLayer:_this109.topLayer};_this109.localWork=new iy(l),_this109.topLayerWork=new sy(l),_this109.vNodes.init(_this109.fullLayer);return _this109;}_inherits(ds,_as2);return _createClass(ds,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(){var _this110=this;var l,o,_this$combinePostData2,t,r,n,a,_iterator80,_step80,f,g,i;return _regeneratorRuntime().wrap(function _callee88$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,r=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context92.next=28;break;}a=[];_iterator80=_createForOfIteratorHelper(t);_context92.prev=4;_iterator80.s();case 6:if((_step80=_iterator80.n()).done){_context92.next=19;break;}f=_step80.value;if(!f.rect){_context92.next=17;break;}if(!(f.rect=os(ue(f.rect),this.scene,this.dpr),!f.rect)){_context92.next=11;break;}return _context92.abrupt("continue",17);case 11:if(!(f.drawCanvas&&f.rect&&f.rect.w>0&&f.rect.h>0)){_context92.next=16;break;}_context92.next=14;return this.getRectImageBitmap(f);case 14:g=_context92.sent;f.imageBitmap=g,n||(n=[]),n.push(g);case 16:a.push(f);case 17:_context92.next=6;break;case 19:_context92.next=24;break;case 21:_context92.prev=21;_context92.t0=_context92["catch"](4);_iterator80.e(_context92.t0);case 24:_context92.prev=24;_iterator80.f();return _context92.finish(24);case 27:r.render=a;case 28:i=(l=r.sp)==null?void 0:l.filter(function(a){return a.type!==dt.None||a.isLockSentEventCursor;});i!=null&&i.length?r.sp=i.map(function(a){return _objectSpread(_objectSpread({},a),{},{viewId:_this110.viewId});}):delete r.sp,r.consumeCount===void 0&&delete r.consumeCount,r.subWorkerDrawCount===void 0&&delete r.subWorkerDrawCount,(i!=null&&i.length||r.consumeCount||r.subWorkerDrawCount||(o=r==null?void 0:r.render)!=null&&o.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context92.stop();}},_callee88,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"getLayer",value:function getLayer(t,r){if(r&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case Rt.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(t){var r,n,i,l,o,a,f;return _regeneratorRuntime().wrap(function _callee89$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:r=t.msgType,n=t.toolsType,i=t.opt,l=t.dataType,o=t.workState,a=t.isLockSentEventCursor;_context93.t0=r;_context93.next=_context93.t0===dt.UpdateTools?4:_context93.t0===dt.CreateWork?9:_context93.t0===dt.DrawWork?11:_context93.t0===dt.RemoveNode?19:_context93.t0===dt.FullWork?22:_context93.t0===dt.Snapshot?27:_context93.t0===dt.BoundingBox?34:41;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&i)){_context93.next=8;break;}f={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(f);return _context93.abrupt("return");case 8:return _context93.abrupt("break",41);case 9:this.createLocalWork(t);return _context93.abrupt("return");case 11:if(!(o===Ft.Done&&l===bt.Local)){_context93.next=17;break;}_context93.next=14;return this.consumeDrawAll(l,t);case 14:n===St.LaserPen&&a&&this.post({sp:[{type:dt.None,isLockSentEventCursor:a}]});_context93.next=18;break;case 17:this.consumeDraw(l,t);case 18:return _context93.abrupt("return");case 19:_context93.next=21;return this.removeNode(t);case 21:return _context93.abrupt("return");case 22:_context93.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context93.t1){_context93.next=26;break;}_context93.next=26;return this.consumeDrawAll(l,t);case 26:return _context93.abrupt("return");case 27:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ar?6e3:3e3,contextType:"2d"}));_context93.t2=this.snapshotFullLayer;if(!_context93.t2){_context93.next=33;break;}_context93.next=32;return this.getSnapshot(t);case 32:this.snapshotFullLayer=void 0;case 33:return _context93.abrupt("return");case 34:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ar?6e3:3e3,contextType:"2d"}));_context93.t3=this.snapshotFullLayer;if(!_context93.t3){_context93.next=40;break;}_context93.next=39;return this.getBoundingRect(t);case 39:this.snapshotFullLayer=void 0;case 40:return _context93.abrupt("return");case 41:_context93.next=43;return _superPropGet(ds,"on",this,3)([t]);case 43:case"end":return _context93.stop();}},_callee89,this);}));function on(_x115){return _on3.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var r=t.workId,n=t.toolsType,i=t.opt;if(n&&this.topLayerWork.canUseTopLayer(n)&&r&&i){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(r.toString(),i);return;}n&&this.localWork.canUseSubWorker(n)&&_superPropGet(ds,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(t){var r;return _regeneratorRuntime().wrap(function _callee90$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:r=t.dataType;_context94.t0=r===bt.Local;if(!_context94.t0){_context94.next=5;break;}_context94.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context94.stop();}},_callee90,this);}));function removeNode(_x116){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"getOffscreen",value:function getOffscreen(t,r){return this.getLayer(t,r).parent.canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t,r){var n,i;return _regeneratorRuntime().wrap(function _callee91$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:n=r.workId,i=r.toolsType;if(!n){_context95.next=11;break;}if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context95.next=5;break;}t===bt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(r)),this.topLayerWork.consumeDraw(r);return _context95.abrupt("return");case 5:_context95.t0=i&&this.localWork.canUseSubWorker(i);if(!_context95.t0){_context95.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context95.next=10;return this.localWork.consumeDraw(r);case 10:return _context95.abrupt("return");case 11:case"end":return _context95.stop();}},_callee91,this);}));function consumeDraw(_x117,_x118){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(t,r){var n,i,l,o;return _regeneratorRuntime().wrap(function _callee92$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:n=r.workId,i=r.toolsType,l=r.dataType;if(!n){_context96.next=8;break;}o=n.toString();if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context96.next=6;break;}l===bt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(r)),this.topLayerWork.consumeDrawAll(r);return _context96.abrupt("return");case 6:i&&this.localWork.canUseSubWorker(i)&&(this.localWork.getWorkShape(o)||_superPropGet(ds,"createLocalWork",this,3)([r]),this.localWork.consumeDrawAll(r));return _context96.abrupt("return");case 8:case"end":return _context96.stop();}},_callee92,this);}));function consumeDrawAll(_x119,_x120){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93(){return _regeneratorRuntime().wrap(function _callee93$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:this.vNodes.clear();_superPropGet(ds,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),xe(this.topLayer,this.topLayer.parent));_context97.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:Rt.TopFloat,viewId:this.viewId}],sp:[{type:dt.Clear}]});case 5:case"end":return _context97.stop();}},_callee93,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=arguments.length>2?arguments[2]:undefined;var i=t.rect,l=t.drawCanvas,o=Math.floor(i.x*this.dpr),a=Math.floor(i.y*this.dpr),f=Math.floor(i.w*this.dpr||1),g=Math.floor(i.h*this.dpr||1);return createImageBitmap(this.getOffscreen(l,r),o,a,f,g,n);}},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(ds,"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])),this.snapshotFullLayer&&(this.snapshotFullLayer.parent.setAttribute("width",r),this.snapshotFullLayer.parent.setAttribute("height",n),this.snapshotFullLayer.setAttribute("size",[r,n]),this.snapshotFullLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(t){var r,n,i;return _regeneratorRuntime().wrap(function _callee94$(_context98){while(1)switch(_context98.prev=_context98.next){case 0:_superPropGet(ds,"updateDpr",this,3)([t]);r=!!this.topLayerWork.localWorkShapes.size,n=!!this.localWork.getWorkShapes().size,i=[];n&&i.push({isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId});r&&i.push({isClearAll:!0,clearCanvas:Rt.TopFloat,viewId:this.viewId});_context98.t0=i.length;if(!_context98.t0){_context98.next=8;break;}_context98.next=8;return this.post({render:i});case 8:case"end":return _context98.stop();}},_callee94,this);}));function updateDpr(_x121){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee95(t){var _this111=this;var r,n,i,l,_iterator81,_step81,_loop9;return _regeneratorRuntime().wrap(function _callee95$(_context100){while(1)switch(_context100.prev=_context100.next){case 0:r=[],n=t.cameraOpt;if(!(n&&!we(this.cameraOpt,n))){_context100.next=25;break;}i=!!this.topLayerWork.localWorkShapes.size,l=!!this.localWork.getWorkShapes().size;if(!(l&&this.localWork.workShapesDone(),this.setCameraOpt(n),l&&r.push({isClearAll:!0,clearCanvas:Rt.Float,viewId:this.viewId}),i)){_context100.next=21;break;}r.push({isClearAll:!0,clearCanvas:Rt.TopFloat,viewId:this.viewId});_iterator81=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context100.prev=6;_loop9=/*#__PURE__*/_regeneratorRuntime().mark(function _loop9(){var _step81$value,o,a,f;return _regeneratorRuntime().wrap(function _loop9$(_context99){while(1)switch(_context99.prev=_context99.next){case 0:_step81$value=_slicedToArray(_step81.value,2),o=_step81$value[0],a=_step81$value[1];if(a.totalRect){_this111.topLayer.getElementsByName(o.toString()).forEach(function(g){var c=g.getBoundingClientRect(),m=Kt({x:c.x,y:c.y,w:c.width,h:c.height});f=Wt(f,m);}),a.totalRect=f,_this111.topLayerWork.localWorkShapes.set(o,a);}case 2:case"end":return _context99.stop();}},_loop9);});_iterator81.s();case 9:if((_step81=_iterator81.n()).done){_context100.next=13;break;}return _context100.delegateYield(_loop9(),"t0",11);case 11:_context100.next=9;break;case 13:_context100.next=18;break;case 15:_context100.prev=15;_context100.t1=_context100["catch"](6);_iterator81.e(_context100.t1);case 18:_context100.prev=18;_iterator81.f();return _context100.finish(18);case 21:_context100.t2=r.length;if(!_context100.t2){_context100.next=25;break;}_context100.next=25;return this.post({render:r});case 25:case"end":return _context100.stop();}},_callee95,this,[[6,15,18,21]]);}));function updateCamera(_x122){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,r){this.cameraOpt=t;var n=t.scale,i=t.centerX,l=t.centerY,o=t.width,a=t.height;(o!==this.scene.width||a!==this.scene.height)&&this.updateScene({width:o,height:a}),r?(r.setAttribute("scale",[n,n]),r.setAttribute("translate",[-i,-l])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-l]),this.topLayer.setAttribute("scale",[n,n]),this.topLayer.setAttribute("translate",[-i,-l]));}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee96(t){var r,n,i,l,o,a,f,_i14,_Object$entries,_Object$entries$_i,c,m,x,M,S,g;return _regeneratorRuntime().wrap(function _callee96$(_context101){while(1)switch(_context101.prev=_context101.next){case 0:r=t.scenePath,n=t.scenes,i=t.cameraOpt,l=t.w,o=t.h;if(!(r&&n&&i&&this.snapshotFullLayer)){_context101.next=26;break;}a=ue(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i14=0,_Object$entries=Object.entries(n);case 5:if(!(_i14<_Object$entries.length)){_context101.next=21;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i14],2),c=_Object$entries$_i[0],m=_Object$entries$_i[1];if(!(m!=null&&m.type)){_context101.next=18;break;}_context101.t0=m==null?void 0:m.type;_context101.next=_context101.t0===dt.UpdateNode?11:_context101.t0===dt.FullWork?11:18;break;case 11:x=m.opt;M=_objectSpread(_objectSpread({},m),{},{opt:x,workId:c,msgType:dt.FullWork,dataType:bt.Service,viewId:this.viewId});_context101.next=15;return this.localWork.runFullWork(M);case 15:S=_context101.sent;f=Wt(f,S);return _context101.abrupt("break",18);case 18:_i14++;_context101.next=5;break;case 21:l&&o&&(g={resizeWidth:l,resizeHeight:o});_context101.next=24;return this.getSnapshotRender({scenePath:r,curCameraOpt:a,options:g});case 24:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 26:case"end":return _context101.stop();}},_callee96,this);}));function getSnapshot(_x123){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee97(t){var o,r,n,i,l;return _regeneratorRuntime().wrap(function _callee97$(_context102){while(1)switch(_context102.prev=_context102.next){case 0:r=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context102.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Rt.None},!0,i);case 4:l=_context102.sent;l&&(this._post({sp:[{type:dt.Snapshot,scenePath:r,imageBitmap:l,viewId:this.viewId}]},[l]),l.close(),this.snapshotFullLayer&&xe(this.snapshotFullLayer,this.snapshotFullLayer.parent),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context102.stop();}},_callee97,this);}));function getSnapshotRender(_x124){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee98(t){var r,n,i,l,o,_i15,_Object$entries2,_Object$entries2$_i,a,f,g;return _regeneratorRuntime().wrap(function _callee98$(_context103){while(1)switch(_context103.prev=_context103.next){case 0:r=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(r&&n&&i&&this.snapshotFullLayer)){_context103.next=27;break;}l=ue(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i15=0,_Object$entries2=Object.entries(n);case 5:if(!(_i15<_Object$entries2.length)){_context103.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i15],2),a=_Object$entries2$_i[0],f=_Object$entries2$_i[1];if(!(f!=null&&f.type)){_context103.next=16;break;}_context103.t0=f==null?void 0:f.type;_context103.next=_context103.t0===dt.UpdateNode?11:_context103.t0===dt.FullWork?11:16;break;case 11:_context103.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},f),{},{workId:a,msgType:dt.FullWork,dataType:bt.Service,viewId:this.viewId}));case 13:g=_context103.sent;o=Wt(o,g);return _context103.abrupt("break",16);case 16:_i15++;_context103.next=5;break;case 19:_context103.t1=o;if(!_context103.t1){_context103.next=23;break;}_context103.next=23;return this.post({sp:[{type:dt.BoundingBox,scenePath:r,rect:o}]});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;xe(this.snapshotFullLayer,this.snapshotFullLayer.parent);this.setCameraOpt(l,this.fullLayer);case 27:case"end":return _context103.stop();}},_callee98,this);}));function getBoundingRect(_x125){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(as);var fi=self;fi.full=new oy(fi,Lr.Full);