@netless/appliance-plugin 1.1.14 → 1.1.15-beta.2
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.
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-BLBicx.js +459 -0
- package/cdn/subWorker-BWE2Rk.js +459 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +10 -10
- package/dist/core/enum.d.ts +3 -0
- package/dist/core/mainThread/snapshotThread.d.ts +1 -1
- package/dist/core/mainThread/subLocalThread.d.ts +1 -1
- package/dist/core/mainThread/subTopThread.d.ts +2 -2
- package/dist/core/mainThread/workerMainThread.d.ts +1 -1
- package/dist/core/tools/arrow.d.ts +2 -1
- package/dist/core/tools/base.d.ts +29 -3
- package/dist/core/tools/ellipse.d.ts +2 -1
- package/dist/core/tools/pencil.d.ts +2 -1
- package/dist/core/tools/polygon.d.ts +2 -1
- package/dist/core/tools/rectangle.d.ts +2 -1
- package/dist/core/tools/speechBalloon.d.ts +2 -1
- package/dist/core/tools/star.d.ts +2 -1
- package/dist/core/tools/straight.d.ts +2 -1
- package/dist/core/tools/utils.d.ts +4 -3
- package/dist/core/types.d.ts +0 -1
- package/dist/core/utils/spriteNode.d.ts +7 -1
- package/dist/core/worker/base.d.ts +3 -1
- package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
- package/dist/core/worker/workerManager.d.ts +0 -2
- package/dist/fullWorker.js +143 -129
- package/dist/{index-BTyDaJHQ.mjs → index-7Ny1Gedj.mjs} +6705 -6758
- package/dist/index-CtT1W9YT.js +1 -0
- package/dist/index-DZB9amqH.js +1 -0
- package/dist/{index-DvgCEmKb.mjs → index-D_0O2awx.mjs} +143 -143
- package/dist/plugin/const.d.ts +2 -0
- package/dist/subWorker.js +143 -129
- package/package.json +1 -1
- package/cdn/fullWorker-COcCxi.js +0 -445
- package/cdn/subWorker-C_hPTy.js +0 -445
- package/dist/index-BVS4TpQx.js +0 -1
- package/dist/index-BjwlxmcZ.js +0 -1
|
@@ -0,0 +1,459 @@
|
|
|
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 Ui=Object.defineProperty;var ji=function ji(h,r,t){return r in h?Ui(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var tt=function tt(h,r,t){return ji(h,_typeof(r)!="symbol"?r+"":r,t);};var wt=/* @__PURE__ */function(h){return h.Normal="Normal",h.Stroke="Stroke",h.Dotted="Dotted",h.LongDotted="LongDotted",h;}(wt||{}),Lt=/* @__PURE__ */function(h){return h.None="None",h.ShowFloatBar="ShowFloatBar",h.ZIndexFloatBar="ZIndexFloatBar",h.DeleteNode="DeleteNode",h.CopyNode="CopyNode",h.ZIndexActive="ZIndexActive",h.ZIndexNode="ZIndexNode",h.RotateNode="RotateNode",h.SetColorNode="SetColorNode",h.TranslateNode="TranslateNode",h.ScaleNode="ScaleNode",h.OriginalEvent="OriginalEvent",h.CreateScene="CreateScene",h.ActiveCursor="ActiveCursor",h.MoveCursor="MoveCursor",h.CommandEditor="CommandEditor",h.SetEditorData="SetEditorData",h.SetFontStyle="SetFontStyle",h.SetPoint="SetPoint",h.SetLock="SetLock",h.SetShapeOpt="SetShapeOpt",h.CameraChange="CameraChange",h.ActiveMethod="ActiveMethod",h;}(Lt||{}),dt=/* @__PURE__ */function(h){return h[h.Pencil=1]="Pencil",h[h.Eraser=2]="Eraser",h[h.PencilEraser=3]="PencilEraser",h[h.BitMapEraser=4]="BitMapEraser",h[h.Selector=5]="Selector",h[h.Clicker=6]="Clicker",h[h.Arrow=7]="Arrow",h[h.Hand=8]="Hand",h[h.LaserPen=9]="LaserPen",h[h.Text=10]="Text",h[h.Straight=11]="Straight",h[h.Rectangle=12]="Rectangle",h[h.Ellipse=13]="Ellipse",h[h.Star=14]="Star",h[h.Triangle=15]="Triangle",h[h.Rhombus=16]="Rhombus",h[h.Polygon=17]="Polygon",h[h.SpeechBalloon=18]="SpeechBalloon",h[h.Image=19]="Image",h;}(dt||{}),Tt=/* @__PURE__ */function(h){return h[h.Local=1]="Local",h[h.Service=2]="Service",h[h.Worker=3]="Worker",h;}(Tt||{}),Ot=/* @__PURE__ */function(h){return h[h.Pending=0]="Pending",h[h.Start=1]="Start",h[h.Doing=2]="Doing",h[h.Done=3]="Done",h[h.Unwritable=4]="Unwritable",h;}(Ot||{}),ot=/* @__PURE__ */function(h){return h[h.None=0]="None",h[h.Init=1]="Init",h[h.UpdateCamera=2]="UpdateCamera",h[h.UpdateTools=3]="UpdateTools",h[h.CreateWork=4]="CreateWork",h[h.DrawWork=5]="DrawWork",h[h.FullWork=6]="FullWork",h[h.UpdateNode=7]="UpdateNode",h[h.RemoveNode=8]="RemoveNode",h[h.Clear=9]="Clear",h[h.Select=10]="Select",h[h.Destroy=11]="Destroy",h[h.Snapshot=12]="Snapshot",h[h.BoundingBox=13]="BoundingBox",h[h.Cursor=14]="Cursor",h[h.TextUpdate=15]="TextUpdate",h[h.GetTextActive=16]="GetTextActive",h[h.TasksQueue=17]="TasksQueue",h[h.CursorHover=18]="CursorHover",h[h.CursorBlur=19]="CursorBlur",h[h.Console=20]="Console",h[h.PriorityWorker=21]="PriorityWorker",h[h.PriorityMainThreadWorker=22]="PriorityMainThreadWorker",h[h.GetImageBitMap=23]="GetImageBitMap",h[h.AuthWriter=24]="AuthWriter",h[h.AuthReader=25]="AuthReader",h[h.AuthClear=26]="AuthClear",h[h.AuthPage=27]="AuthPage",h[h.GetVNodeInfo=28]="GetVNodeInfo",h[h.UpdateDpr=29]="UpdateDpr",h;}(ot||{}),St=/* @__PURE__ */function(h){return h[h.None=0]="None",h[h.Bg=1]="Bg",h[h.ServiceFloat=2]="ServiceFloat",h[h.Float=3]="Float",h[h.TopFloat=4]="TopFloat",h;}(St||{}),bt=/* @__PURE__ */function(h){return h[h.none=1]="none",h[h.all=2]="all",h[h.both=3]="both",h[h.proportional=4]="proportional",h;}(bt||{}),qt=/* @__PURE__ */function(h){return h[h.inside=0]="inside",h[h.outside=1]="outside",h[h.intersect=2]="intersect",h;}(qt||{}),Mr=/* @__PURE__ */function(h){return h.Image="image",h.Iconify="iconify",h;}(Mr||{});var ne=/*#__PURE__*/function(){function ne(){_classCallCheck(this,ne);tt(this,"localWork");tt(this,"serviceWork");tt(this,"threadEngine");}return _createClass(ne,[{key:"registerForWorker",value:function registerForWorker(r){return this.threadEngine=r,this.localWork=r.localWork,this.serviceWork=r.serviceWork,this;}}]);}();var $i=/*#__PURE__*/function(_ne){function $i(){var _this;_classCallCheck(this,$i);_this=_callSuper(this,$i,arguments);tt(_this,"emitEventType",Lt.CopyNode);return _this;}_inherits($i,_ne);return _createClass($i,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.FullWork&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,e;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:e=t.workId;_context.t0=e;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(ne);var We="++",Wt="selector",zi="all";var Gi=/*#__PURE__*/function(_ne2){function Gi(){var _this2;_classCallCheck(this,Gi);_this2=_callSuper(this,Gi,arguments);tt(_this2,"emitEventType",Lt.SetColorNode);return _this2;}_inherits(Gi,_ne2);return _createClass(Gi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context2.t0=e===Wt&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context2.stop();}},_callee2,this);}));function consumeForLocalWorker(_x2){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=e.textUpdateForWoker,c=n.render||[],m=n.sp||[];if(a){var _iterator2=_createForOfIteratorHelper(i.entries()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=_slicedToArray(_step2.value,2),l=_step2$value[0],p=_step2$value[1];s&&p.toolsType===dt.Text?m.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:ot.TextUpdate,dataType:Tt.Local,willSyncService:!0})):m.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:c,sp:m};}}]);}(ne);var Hi=/*#__PURE__*/function(_ne3){function Hi(){var _this3;_classCallCheck(this,Hi);_this3=_callSuper(this,Hi,arguments);tt(_this3,"emitEventType",Lt.ZIndexNode);return _this3;}_inherits(Hi,_ne3);return _createClass(Hi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context3.t0=e===Wt&&n;if(!_context3.t0){_context3.next=5;break;}_context3.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context3.stop();}},_callee3,this);}));function consumeForLocalWorker(_x3){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],c=n.sp||[];if(a&&c){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),m=_step3$value[0],l=_step3$value[1];c.push(_objectSpread(_objectSpread({},l),{},{workId:m,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:c};}}]);}(ne);var Ki=/*#__PURE__*/function(_ne4){function Ki(){var _this4;_classCallCheck(this,Ki);_this4=_callSuper(this,Ki,arguments);tt(_this4,"emitEventType",Lt.TranslateNode);return _this4;}_inherits(Ki,_ne4);return _createClass(Ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var m,l,e,n,i,a,o,s,c;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker,c=t.emitEventType;_context4.t0=e===Wt&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===Ot.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Ot.Done)){_context4.next=8;break;}_context4.next=6;return(m=this.localWork)==null?void 0:m.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:c,callback:this.updateSelectorCallback});case 6:_context4.next=9;break;case 8:n.workState===Ot.Done&&((l=this.localWork)==null||l.vNodes.deleteLastTarget());case 9:case"end":return _context4.stop();}},_callee4,this);}));function consumeForLocalWorker(_x4){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,m=e.updateSelectorOpt,l=e.textUpdateForWoker,p=m.workState,y=n.render||[],P=n.sp||[];if(p===Ot.Start)return{sp:[],render:[]};var S=o==null?void 0:o.selectRect;if(s){P.push({type:ot.Select,selectIds:a.selectIds,selectRect:S,willSyncService:!0,isSync:!0,points:p===Ot.Done&&a.getChildrenPoints()||void 0,textOpt:a.textOpt});var _iterator4=_createForOfIteratorHelper(i.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),v=_step4$value[0],T=_step4$value[1];l&&T.toolsType===dt.Text?P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:ot.TextUpdate,dataType:Tt.Local,willSyncService:!0})):P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:P};}}]);}(ne);var Yi=/*#__PURE__*/function(_ne5){function Yi(){var _this5;_classCallCheck(this,Yi);_this5=_callSuper(this,Yi,arguments);tt(_this5,"emitEventType",Lt.DeleteNode);return _this5;}_inherits(Yi,_ne5);return _createClass(Yi,[{key:"consume",value:function consume(){return!1;}}]);}(ne);var Vi=/*#__PURE__*/function(_ne6){function Vi(){var _this6;_classCallCheck(this,Vi);_this6=_callSuper(this,Vi,arguments);tt(_this6,"emitEventType",Lt.ScaleNode);return _this6;}_inherits(Vi,_ne6);return _createClass(Vi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t){var o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willSyncService,a=t.willSerializeData;_context5.t0=e===Wt&&n;if(!_context5.t0){_context5.next=5;break;}_context5.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return _context5.stop();}},_callee5,this);}));function consumeForLocalWorker(_x5){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,c=e.willSyncService,m=s.workState,l=n.render||[],p=n.sp||[],y=a==null?void 0:a.selectRect;if(m===Ot.Start)return{sp:[],render:[]};if(c){p.push({type:ot.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:m===Ot.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),P=_step5$value[0],S=_step5$value[1];S.toolsType===dt.Text?p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:ot.TextUpdate,dataType:Tt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:l,sp:p};}}]);}(ne);var ki=/*#__PURE__*/function(_ne7){function ki(){var _this7;_classCallCheck(this,ki);_this7=_callSuper(this,ki,arguments);tt(_this7,"emitEventType",Lt.RotateNode);return _this7;}_inherits(ki,_ne7);return _createClass(ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.emitEventType;_context6.t0=e===Wt&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,emitEventType:s,isSync:!0,callback:this.updateSelectorCallback});case 5:case"end":return _context6.stop();}},_callee6,this);}));function consumeForLocalWorker(_x6){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,c=e.willSyncService,m=e.willSerializeData,l=e.isSync,p=s.workState,y=n.render||[],P=n.sp||[],S=a==null?void 0:a.selectRect;if(c){m&&p===Ot.Done&&P.push({type:ot.Select,selectIds:i.selectIds,selectRect:S,willSyncService:!0,isSync:l,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),v=_step6$value[0],T=_step6$value[1];P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:P};}}]);}(ne);var Xi=/*#__PURE__*/function(_ne8){function Xi(){var _this8;_classCallCheck(this,Xi);_this8=_callSuper(this,Xi,arguments);tt(_this8,"emitEventType",Lt.SetFontStyle);return _this8;}_inherits(Xi,_ne8);return _createClass(Xi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context7.t0=e===Wt&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context7.stop();}},_callee7,this);}));function consumeForLocalWorker(_x7){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,m=e.updateSelectorOpt,l=e.textUpdateForWoker,p=n.render||[],y=n.sp||[],P=o==null?void 0:o.selectRect;if(s&&y){m.fontSize&&y.push({type:ot.Select,selectIds:a.selectIds,selectRect:P,willSyncService:s,isSync:c,points:a.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(i.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),S=_step7$value[0],v=_step7$value[1];l&&v.toolsType===dt.Text?y.push(_objectSpread(_objectSpread({},v),{},{workId:S,type:ot.TextUpdate,dataType:Tt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},v),{},{workId:S,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:p,sp:y};}}]);}(ne);var Ji=/*#__PURE__*/function(_ne9){function Ji(){var _this9;_classCallCheck(this,Ji);_this9=_callSuper(this,Ji,arguments);tt(_this9,"emitEventType",Lt.SetPoint);return _this9;}_inherits(Ji,_ne9);return _createClass(Ji,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var c,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context8.t0=e===Wt&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context8.stop();}},_callee8,this);}));function consumeForLocalWorker(_x8){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,m=n.render||[],l=n.sp||[],p=o==null?void 0:o.selectRect;if(s&&l){var _iterator8=_createForOfIteratorHelper(i.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),y=_step8$value[0],P=_step8$value[1];l.push(_objectSpread(_objectSpread({},P),{},{workId:y,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}l.push({type:ot.Select,selectIds:a.selectIds,selectRect:p,willSyncService:s,isSync:c,points:a.getChildrenPoints()});}return{render:m,sp:l};}}]);}(ne);var Zi=/*#__PURE__*/function(_ne10){function Zi(){var _this10;_classCallCheck(this,Zi);_this10=_callSuper(this,Zi,arguments);tt(_this10,"emitEventType",Lt.SetLock);return _this10;}_inherits(Zi,_ne10);return _createClass(Zi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context9.t0=e===Wt&&n;if(!_context9.t0){_context9.next=5;break;}_context9.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context9.stop();}},_callee9,this);}));function consumeForLocalWorker(_x9){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,c=e.isSync,m=e.updateSelectorOpt,l=n.render||[],p=n.sp||[],y=o==null?void 0:o.selectRect;if(s&&p){var _iterator9=_createForOfIteratorHelper(i.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),P=_step9$value[0],S=_step9$value[1];p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}p.push({isLocked:m.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:ot.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:c});}return{render:l,sp:p};}}]);}(ne);var Qi=/*#__PURE__*/function(_ne11){function Qi(){var _this11;_classCallCheck(this,Qi);_this11=_callSuper(this,Qi,arguments);tt(_this11,"emitEventType",Lt.SetShapeOpt);return _this11;}_inherits(Qi,_ne11);return _createClass(Qi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context10.t0=e===Wt&&n;if(!_context10.t0){_context10.next=5;break;}_context10.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context10.stop();}},_callee10,this);}));function consumeForLocalWorker(_x10){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],c=n.sp||[];if(a&&c){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),m=_step10$value[0],l=_step10$value[1];c.push(_objectSpread(_objectSpread({},l),{},{workId:m,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:c};}}]);}(ne);var qi=/*#__PURE__*/function(){function qi(r){var _this12=this;_classCallCheck(this,qi);tt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(qi,[{key:"build",value:function build(r){switch(r){case Lt.TranslateNode:return new Ki();case Lt.ZIndexNode:return new Hi();case Lt.CopyNode:return new $i();case Lt.SetColorNode:return new Gi();case Lt.DeleteNode:return new Yi();case Lt.ScaleNode:return new Vi();case Lt.RotateNode:return new ki();case Lt.SetFontStyle:return new Xi();case Lt.SetPoint:return new Ji();case Lt.SetLock:return new Zi();case Lt.SetShapeOpt:return new Qi();}}},{key:"registerForWorker",value:function registerForWorker(r){return this.builders.forEach(function(t){t&&t.registerForWorker(r);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(r){var _iterator11=_createForOfIteratorHelper(this.builders.values()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var t=_step11.value;if(t!=null&&t.consume(r))return!0;}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return!1;}}]);}();var _i={linear:function linear(h){return h;},easeInQuad:function easeInQuad(h){return h*h;},easeOutQuad:function easeOutQuad(h){return h*(2-h);},easeInOutQuad:function easeInOutQuad(h){return h<0.5?2*h*h:-1+(4-2*h)*h;},easeInCubic:function easeInCubic(h){return h*h*h;},easeOutCubic:function easeOutCubic(h){return--h*h*h+1;},easeInOutCubic:function easeInOutCubic(h){return h<0.5?4*h*h*h:(h-1)*(2*h-2)*(2*h-2)+1;},easeInQuart:function easeInQuart(h){return h*h*h*h;},easeOutQuart:function easeOutQuart(h){return 1- --h*h*h*h;},easeInOutQuart:function easeInOutQuart(h){return h<0.5?8*h*h*h*h:1-8*--h*h*h*h;},easeInQuint:function easeInQuint(h){return h*h*h*h*h;},easeOutQuint:function easeOutQuint(h){return 1+--h*h*h*h*h;},easeInOutQuint:function easeInOutQuint(h){return h<0.5?16*h*h*h*h*h:1+16*--h*h*h*h*h;},easeInSine:function easeInSine(h){return 1-Math.cos(h*Math.PI/2);},easeOutSine:function easeOutSine(h){return Math.sin(h*Math.PI/2);},easeInOutSine:function easeInOutSine(h){return-(Math.cos(Math.PI*h)-1)/2;},easeInExpo:function easeInExpo(h){return h<=0?0:Math.pow(2,10*h-10);},easeOutExpo:function easeOutExpo(h){return h>=1?1:1-Math.pow(2,-10*h);},easeInOutExpo:function easeInOutExpo(h){return h<=0?0:h>=1?1:h<0.5?Math.pow(2,20*h-10)/2:(2-Math.pow(2,-20*h+10))/2;}};var _=/*#__PURE__*/function(){function _(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,_);this.x=r,this.y=t,this.z=e;}return _createClass(_,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(r){return this.z=r,this;}},{key:"setXY",value:function setXY(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;return this.x=r,this.y=t,this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=r,this.y=t,this.z=e,this;}},{key:"setTo",value:function setTo(_ref){var _ref$x=_ref.x,r=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,e=_ref$z===void 0?1:_ref$z;return this.x=r,this.y=t,this.z=e,this;}},{key:"rot",value:function rot(r){if(r===0)return this;var t=this.x,e=this.y,n=Math.sin(r),i=Math.cos(r);return this.x=t*i-e*n,this.y=t*n+e*i,this;}},{key:"rotWith",value:function rotWith(r,t){if(t===0)return this;var e=this.x-r.x,n=this.y-r.y,i=Math.sin(t),a=Math.cos(t);return this.x=r.x+(e*a-n*i),this.y=r.y+(e*i+n*a),this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z;return new _(r,t,e);}},{key:"sub",value:function sub(r){return this.x-=r.x,this.y-=r.y,this;}},{key:"subXY",value:function subXY(r,t){return this.x-=r,this.y-=t,this;}},{key:"subScalar",value:function subScalar(r){return this.x-=r,this.y-=r,this;}},{key:"add",value:function add(r){return this.x+=r.x,this.y+=r.y,this;}},{key:"addXY",value:function addXY(r,t){return this.x+=r,this.y+=t,this;}},{key:"addScalar",value:function addScalar(r){return this.x+=r,this.y+=r,this;}},{key:"clamp",value:function clamp(r,t){return this.x=Math.max(this.x,r),this.y=Math.max(this.y,r),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(r){return this.x/=r,this.y/=r,this;}},{key:"divV",value:function divV(r){return this.x/=r.x,this.y/=r.y,this;}},{key:"mul",value:function mul(r){return this.x*=r,this.y*=r,this;}},{key:"mulV",value:function mulV(r){return this.x*=r.x,this.y*=r.y,this;}},{key:"abs",value:function abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this;}},{key:"nudge",value:function nudge(r,t){var e=_.Tan(r,this);return this.add(e.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(r){return this.x=this.y*r.z-this.z*r.y,this.y=this.z*r.x-this.x*r.z,this;}},{key:"dpr",value:function dpr(r){return _.Dpr(this,r);}},{key:"cpr",value:function cpr(r){return _.Cpr(this,r);}},{key:"len2",value:function len2(){return _.Len2(this);}},{key:"len",value:function len(){return _.Len(this);}},{key:"pry",value:function pry(r){return _.Pry(this,r);}},{key:"per",value:function per(){var r=this.x,t=this.y;return this.x=t,this.y=-r,this;}},{key:"uni",value:function uni(){return _.Uni(this);}},{key:"tan",value:function tan(r){return _.Tan(this,r);}},{key:"dist",value:function dist(r){return _.Dist(this,r);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(r,t){return _.DistanceToLineSegment(r,t,this);}},{key:"slope",value:function slope(r){return _.Slope(this,r);}},{key:"snapToGrid",value:function snapToGrid(r){return this.x=Math.round(this.x/r)*r,this.y=Math.round(this.y/r)*r,this;}},{key:"angle",value:function angle(r){return _.Angle(this,r);}},{key:"toAngle",value:function toAngle(){return _.ToAngle(this);}},{key:"lrp",value:function lrp(r,t){return this.x=this.x+(r.x-this.x)*t,this.y=this.y+(r.y-this.y)*t,this;}},{key:"equals",value:function equals(r,t){return _.Equals(this,r,t);}},{key:"equalsXY",value:function equalsXY(r,t){return _.EqualsXY(this,r,t);}},{key:"norm",value:function norm(){var r=this.len();return this.x=r===0?0:this.x/r,this.y=r===0?0:this.y/r,this;}},{key:"toFixed",value:function toFixed(){return _.ToFixed(this);}},{key:"toString",value:function toString(){return _.ToString(_.ToFixed(this));}},{key:"toJson",value:function toJson(){return _.ToJson(this);}},{key:"toArray",value:function toArray(){return _.ToArray(this);}}],[{key:"Add",value:function Add(r,t){return new _(r.x+t.x,r.y+t.y);}},{key:"AddXY",value:function AddXY(r,t,e){return new _(r.x+t,r.y+e);}},{key:"Sub",value:function Sub(r,t){return new _(r.x-t.x,r.y-t.y);}},{key:"SubXY",value:function SubXY(r,t,e){return new _(r.x-t,r.y-e);}},{key:"AddScalar",value:function AddScalar(r,t){return new _(r.x+t,r.y+t);}},{key:"SubScalar",value:function SubScalar(r,t){return new _(r.x-t,r.y-t);}},{key:"Div",value:function Div(r,t){return new _(r.x/t,r.y/t);}},{key:"Mul",value:function Mul(r,t){return new _(r.x*t,r.y*t);}},{key:"DivV",value:function DivV(r,t){return new _(r.x/t.x,r.y/t.y);}},{key:"MulV",value:function MulV(r,t){return new _(r.x*t.x,r.y*t.y);}},{key:"Neg",value:function Neg(r){return new _(-r.x,-r.y);}},{key:"Per",value:function Per(r){return new _(r.y,-r.x);}},{key:"Dist2",value:function Dist2(r,t){return _.Sub(r,t).len2();}},{key:"Abs",value:function Abs(r){return new _(Math.abs(r.x),Math.abs(r.y));}},{key:"Dist",value:function Dist(r,t){return Math.hypot(r.y-t.y,r.x-t.x);}},{key:"Dpr",value:function Dpr(r,t){return r.x*t.x+r.y*t.y;}},{key:"Cross",value:function Cross(r,t){return new _(r.y*t.z-r.z*t.y,r.z*t.x-r.x*t.z// A.z = A.x * V.y - A.y * V.x
|
|
2
|
+
);}},{key:"Cpr",value:function Cpr(r,t){return r.x*t.y-t.x*r.y;}},{key:"Len2",value:function Len2(r){return r.x*r.x+r.y*r.y;}},{key:"Len",value:function Len(r){return Math.hypot(r.x,r.y);}},{key:"Pry",value:function Pry(r,t){return _.Dpr(r,t)/_.Len(t);}},{key:"Uni",value:function Uni(r){return _.Div(r,_.Len(r));}},{key:"Tan",value:function Tan(r,t){return _.Uni(_.Sub(r,t));}},{key:"Min",value:function Min(r,t){return new _(Math.min(r.x,t.x),Math.min(r.y,t.y));}},{key:"Max",value:function Max(r,t){return new _(Math.max(r.x,t.x),Math.max(r.y,t.y));}},{key:"From",value:function From(r){return new _().add(r);}},{key:"FromArray",value:function FromArray(r){return new _(r[0],r[1]);}},{key:"Rot",value:function Rot(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=Math.sin(t),n=Math.cos(t);return new _(r.x*n-r.y*e,r.x*e+r.y*n);}},{key:"RotWith",value:function RotWith(r,t,e){var n=r.x-t.x,i=r.y-t.y,a=Math.sin(e),o=Math.cos(e);return new _(t.x+(n*o-i*a),t.y+(n*a+i*o));}/**
|
|
3
|
+
* Get the nearest point on a line with a known unit vector that passes through point A
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* Vec.nearestPointOnLineThroughPoint(A, u, Point)
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* @param A - Any point on the line
|
|
10
|
+
* @param u - The unit vector for the line.
|
|
11
|
+
* @param P - A point not on the line to test.
|
|
12
|
+
*/},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(r,t,e){return _.Mul(t,_.Sub(e,r).pry(t)).add(r);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var i=_.Tan(t,r),a=_.Add(r,_.Mul(i,_.Sub(e,r).pry(i)));if(n){if(a.x<Math.min(r.x,t.x))return _.Cast(r.x<t.x?r:t);if(a.x>Math.max(r.x,t.x))return _.Cast(r.x>t.x?r:t);if(a.y<Math.min(r.y,t.y))return _.Cast(r.y<t.y?r:t);if(a.y>Math.max(r.y,t.y))return _.Cast(r.y>t.y?r:t);}return a;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(r,t,e){return _.Dist(e,_.NearestPointOnLineThroughPoint(r,t,e));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return _.Dist(e,_.NearestPointOnLineSegment(r,t,e,n));}},{key:"Snap",value:function Snap(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}},{key:"Cast",value:function Cast(r){return r instanceof _?r:_.From(r);}},{key:"Slope",value:function Slope(r,t){return r.x===t.y?NaN:(r.y-t.y)/(r.x-t.x);}},{key:"Angle",value:function Angle(r,t){return Math.atan2(t.y-r.y,t.x-r.x);}},{key:"Lrp",value:function Lrp(r,t,e){return _.Sub(t,r).mul(e).add(r);}},{key:"Med",value:function Med(r,t){return new _((r.x+t.x)/2,(r.y+t.y)/2);}},{key:"Equals",value:function Equals(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(r.x-t.x)<e&&Math.abs(r.y-t.y)<e;}},{key:"EqualsXY",value:function EqualsXY(r,t,e){return r.x===t&&r.y===e;}},{key:"EqualsXYZ",value:function EqualsXYZ(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return _.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))<e;}},{key:"Clockwise",value:function Clockwise(r,t,e){return(e.x-r.x)*(t.y-r.y)-(t.x-r.x)*(e.y-r.y)<0;}},{key:"Rescale",value:function Rescale(r,t){var e=_.Len(r);return new _(t*r.x/e,t*r.y/e);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(r,t,e){return _.Sub(r,e).mul(t).add(e);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(r,t,e){return _.Sub(r,e).mulV(t).add(e);}},{key:"ToFixed",value:function ToFixed(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new _(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t));}},{key:"Nudge",value:function Nudge(r,t,e){return _.Add(r,_.Tan(t,r).mul(e));}},{key:"ToString",value:function ToString(r){return"".concat(r.x,", ").concat(r.y);}},{key:"ToAngle",value:function ToAngle(r){var t=Math.atan2(r.y,r.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.cos(r)*t,Math.sin(r)*t);}},{key:"ToArray",value:function ToArray(r){return[r.x,r.y,r.z];}},{key:"ToJson",value:function ToJson(r){var t=r.x,e=r.y,n=r.z;return{x:t,y:e,z:n};}},{key:"Average",value:function Average(r){var t=r.length,e=new _(0,0);for(var n=0;n<t;n++)e.add(r[n]);return e.div(t);}},{key:"Clamp",value:function Clamp(r,t,e){return e===void 0?new _(Math.min(Math.max(r.x,t)),Math.min(Math.max(r.y,t))):new _(Math.min(Math.max(r.x,t),e),Math.min(Math.max(r.y,t),e));}/**
|
|
13
|
+
* Get an array of points (with simulated pressure) between two points.
|
|
14
|
+
*
|
|
15
|
+
* @param A - The first point.
|
|
16
|
+
* @param B - The second point.
|
|
17
|
+
* @param steps - The number of points to return.
|
|
18
|
+
*/},{key:"PointsBetween",value:function PointsBetween(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i<e;i++){var a=_i.easeInQuad(i/(e-1)),o=_.Lrp(r,t,a);o.z=Math.min(1,0.5+Math.abs(0.5-ts(a))*0.65),n.push(o);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}}]);}();var ts=function ts(h){return h<0.5?2*h*h:-1+(4-2*h)*h;};var xt=/*#__PURE__*/function(_ref2){function xt(){var _this13;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,xt);_this13=_callSuper(this,xt,[r,t,e]),_this13.x=r,_this13.y=t,_this13.z=e,_this13.v=n,_this13.t=i,_this13.a=a;return _this13;}_inherits(xt,_ref2);return _createClass(xt,[{key:"timestamp",get:function get(){return this.t;}},{key:"pressure",get:function get(){return this.z;}},{key:"angleNum",get:function get(){return this.a;}},{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setA",value:function setA(r){this.a=r;}},{key:"setT",value:function setT(r){this.t=r;}},{key:"setv",value:function setv(r){return this.v={x:r.x,y:r.y},this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a,o={x:n.x,y:n.y};return new xt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return xt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return xt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return xt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new xt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new xt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return xt.Len(r.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(r,t,e){var n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,o=e.y-t.y;var s=0;var c=Math.sqrt(n*n+a*a),m=Math.sqrt(i*i+o*o);if(c&&m){var l=n*i+a*o;s=Math.acos(l/(c*m)),s=s/Math.PI*180;var p=n*o-a*i;p=p>0?1:-1,s=180+p*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return xt.Len(r.clone().sub(t))<e;}},{key:"RotWith",value:function RotWith(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var i=r.x-t.x,a=r.y-t.y,o=Math.sin(e),s=Math.cos(e),c=Math.pow(10,n),m=Math.floor((t.x+(i*s-a*o))*c)/c,l=Math.floor((t.y+(i*o+a*s))*c)/c;return new xt(m,l);}/**
|
|
19
|
+
* 根据圆心和半径,获取圆上的等份点
|
|
20
|
+
* @param o 圆心
|
|
21
|
+
* @param radius 半径
|
|
22
|
+
* @param average 均分数
|
|
23
|
+
* @returns
|
|
24
|
+
*/},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new _(1,1),i=Math.PI+1e-3,a=xt.Add(r,xt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,c=s;c<=1;c+=s)o.push(xt.RotWith(a,r,i*2*c));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(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var i=e*(Math.PI+1e-3),a=[];for(var o=1/n,s=o;s<=1;s+=o)a.push(xt.RotWith(t,r,i*s));return a;}}]);}(_);var Bt=/******/function(h){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={/******/i:e,/******/l:!1,/******/exports:{}/******/};return h[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=h,t.c=r,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i});},t.r=function(e){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,n){if(n&1&&(e=t(e)),n&8||n&4&&_typeof(e)=="object"&&e&&e.__esModule)return e;var i=/* @__PURE__ */Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),n&2&&typeof e!="string")for(var a in e)t.d(i,a,function(o){return e[o];}.bind(null,a));return i;},t.n=function(e){var n=e&&e.__esModule?(/******/function(){return e["default"];}):(/******/function(){return e;});return t.d(n,"a",n),n;},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n);},t.p="/js/",t(t.s=0);}([/* 0 *//***/function(h,r,t){t.r(r),t.d(r,"version",function(){return K;}),t.d(r,"helpers",function(){return W;}),t.d(r,"createElement",function(){return b;}),t.d(r,"isSpriteNode",function(){return I;}),t.d(r,"registerNode",function(){return R;});var e=t(12);t.d(r,"ENV",function(){return e.ENV;});var n=t(68);t.d(r,"requestAnimationFrame",function(){return n.requestAnimationFrame;}),t.d(r,"cancelAnimationFrame",function(){return n.cancelAnimationFrame;});var i=t(70);t.d(r,"Node",function(){return i["default"];});var a=t(217);t.d(r,"Cloud",function(){return a["default"];});var o=t(219);t.d(r,"Block",function(){return o["default"];});var s=t(224);t.d(r,"Sprite",function(){return s["default"];});var c=t(226);t.d(r,"Path",function(){return c["default"];});var m=t(229);t.d(r,"Rect",function(){return m["default"];});var l=t(231);t.d(r,"Triangle",function(){return l["default"];});var p=t(236);t.d(r,"Parallel",function(){return p["default"];});var y=t(238);t.d(r,"Regular",function(){return y["default"];});var P=t(240);t.d(r,"Star",function(){return P["default"];});var S=t(242);t.d(r,"Ellipse",function(){return S["default"];});var v=t(244);t.d(r,"Arc",function(){return v["default"];});var T=t(246);t.d(r,"Ring",function(){return T["default"];});var f=t(232);t.d(r,"Polyline",function(){return f["default"];});var d=t(248);t.d(r,"Label",function(){return d["default"];});var u=t(250);t.d(r,"Group",function(){return u["default"];});var g=t(286);t.d(r,"Layer",function(){return g["default"];});var M=t(287);t.d(r,"SpriteSvg",function(){return M["default"];});var C=t(289);t.d(r,"LayerWorker",function(){return C["default"];});var A=t(290);t.d(r,"Scene",function(){return A["default"];});var L=t(213),O=t(221);t.d(r,"Color",function(){return O.Color;}),t.d(r,"Gradient",function(){return O.Gradient;});var w=t(72);t(1).glMatrix.setMatrixArrayType(Array);var b=L["default"].createElement,I=L["default"].isSpriteNode,R=L["default"].registerNode,W={parseColor:O.parseColor,sizeToPixel:w.sizeToPixel,toArray:w.toArray,toString:w.toString,toNumber:w.toNumber};var z;z="3.8.3";var K=z;},/* 1 *//***/function(h,r,t){t.r(r);var e=t(2);t.d(r,"glMatrix",function(){return e;});var n=t(3);t.d(r,"mat2",function(){return n;});var i=t(4);t.d(r,"mat2d",function(){return i;});var a=t(5);t.d(r,"mat3",function(){return a;});var o=t(6);t.d(r,"mat4",function(){return o;});var s=t(7);t.d(r,"quat",function(){return s;});var c=t(10);t.d(r,"quat2",function(){return c;});var m=t(11);t.d(r,"vec2",function(){return m;});var l=t(8);t.d(r,"vec3",function(){return l;});var p=t(9);t.d(r,"vec4",function(){return p;});},/* 2 *//***/function(h,r,t){t.r(r),t.d(r,"EPSILON",function(){return e;}),t.d(r,"ARRAY_TYPE",function(){return n;}),t.d(r,"RANDOM",function(){return i;}),t.d(r,"setMatrixArrayType",function(){return a;}),t.d(r,"toRadian",function(){return s;}),t.d(r,"equals",function(){return c;});var e=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function a(m){n=m;}var o=Math.PI/180;function s(m){return m*o;}function c(m,l){return Math.abs(m-l)<=e*Math.max(1,Math.abs(m),Math.abs(l));}Math.hypot||(Math.hypot=function(){for(var m=0,l=arguments.length;l--;)m+=arguments[l]*arguments[l];return Math.sqrt(m);});},/* 3 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"transpose",function(){return m;}),t.d(r,"invert",function(){return l;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return P;}),t.d(r,"rotate",function(){return S;}),t.d(r,"scale",function(){return v;}),t.d(r,"fromRotation",function(){return T;}),t.d(r,"fromScaling",function(){return f;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return u;}),t.d(r,"LDU",function(){return g;}),t.d(r,"add",function(){return M;}),t.d(r,"subtract",function(){return C;}),t.d(r,"exactEquals",function(){return A;}),t.d(r,"equals",function(){return L;}),t.d(r,"multiplyScalar",function(){return O;}),t.d(r,"multiplyScalarAndAdd",function(){return w;}),t.d(r,"mul",function(){return b;}),t.d(r,"sub",function(){return I;});var e=t(2);function n(){var R=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function i(R){var W=new e.ARRAY_TYPE(4);return W[0]=R[0],W[1]=R[1],W[2]=R[2],W[3]=R[3],W;}function a(R,W){return R[0]=W[0],R[1]=W[1],R[2]=W[2],R[3]=W[3],R;}function o(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function s(R,W,z,K){var J=new e.ARRAY_TYPE(4);return J[0]=R,J[1]=W,J[2]=z,J[3]=K,J;}function c(R,W,z,K,J){return R[0]=W,R[1]=z,R[2]=K,R[3]=J,R;}function m(R,W){if(R===W){var z=W[1];R[1]=W[2],R[2]=z;}else R[0]=W[0],R[1]=W[2],R[2]=W[1],R[3]=W[3];return R;}function l(R,W){var z=W[0],K=W[1],J=W[2],q=W[3],U=z*q-J*K;return U?(U=1/U,R[0]=q*U,R[1]=-K*U,R[2]=-J*U,R[3]=z*U,R):null;}function p(R,W){var z=W[0];return R[0]=W[3],R[1]=-W[1],R[2]=-W[2],R[3]=z,R;}function y(R){return R[0]*R[3]-R[2]*R[1];}function P(R,W,z){var K=W[0],J=W[1],q=W[2],U=W[3],G=z[0],Z=z[1],rt=z[2],et=z[3];return R[0]=K*G+q*Z,R[1]=J*G+U*Z,R[2]=K*rt+q*et,R[3]=J*rt+U*et,R;}function S(R,W,z){var K=W[0],J=W[1],q=W[2],U=W[3],G=Math.sin(z),Z=Math.cos(z);return R[0]=K*Z+q*G,R[1]=J*Z+U*G,R[2]=K*-G+q*Z,R[3]=J*-G+U*Z,R;}function v(R,W,z){var K=W[0],J=W[1],q=W[2],U=W[3],G=z[0],Z=z[1];return R[0]=K*G,R[1]=J*G,R[2]=q*Z,R[3]=U*Z,R;}function T(R,W){var z=Math.sin(W),K=Math.cos(W);return R[0]=K,R[1]=z,R[2]=-z,R[3]=K,R;}function f(R,W){return R[0]=W[0],R[1]=0,R[2]=0,R[3]=W[1],R;}function d(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function u(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function g(R,W,z,K){return R[2]=K[2]/K[0],z[0]=K[0],z[1]=K[1],z[3]=K[3]-R[2]*z[1],[R,W,z];}function M(R,W,z){return R[0]=W[0]+z[0],R[1]=W[1]+z[1],R[2]=W[2]+z[2],R[3]=W[3]+z[3],R;}function C(R,W,z){return R[0]=W[0]-z[0],R[1]=W[1]-z[1],R[2]=W[2]-z[2],R[3]=W[3]-z[3],R;}function A(R,W){return R[0]===W[0]&&R[1]===W[1]&&R[2]===W[2]&&R[3]===W[3];}function L(R,W){var z=R[0],K=R[1],J=R[2],q=R[3],U=W[0],G=W[1],Z=W[2],rt=W[3];return Math.abs(z-U)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(U))&&Math.abs(K-G)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(G))&&Math.abs(J-Z)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Z))&&Math.abs(q-rt)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(rt));}function O(R,W,z){return R[0]=W[0]*z,R[1]=W[1]*z,R[2]=W[2]*z,R[3]=W[3]*z,R;}function w(R,W,z,K){return R[0]=W[0]+z[0]*K,R[1]=W[1]+z[1]*K,R[2]=W[2]+z[2]*K,R[3]=W[3]+z[3]*K,R;}var b=P,I=C;},/* 4 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"invert",function(){return m;}),t.d(r,"determinant",function(){return l;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotate",function(){return y;}),t.d(r,"scale",function(){return P;}),t.d(r,"translate",function(){return S;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromScaling",function(){return T;}),t.d(r,"fromTranslation",function(){return f;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return u;}),t.d(r,"add",function(){return g;}),t.d(r,"subtract",function(){return M;}),t.d(r,"multiplyScalar",function(){return C;}),t.d(r,"multiplyScalarAndAdd",function(){return A;}),t.d(r,"exactEquals",function(){return L;}),t.d(r,"equals",function(){return O;}),t.d(r,"mul",function(){return w;}),t.d(r,"sub",function(){return b;});var e=t(2);function n(){var I=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(I[1]=0,I[2]=0,I[4]=0,I[5]=0),I[0]=1,I[3]=1,I;}function i(I){var R=new e.ARRAY_TYPE(6);return R[0]=I[0],R[1]=I[1],R[2]=I[2],R[3]=I[3],R[4]=I[4],R[5]=I[5],R;}function a(I,R){return I[0]=R[0],I[1]=R[1],I[2]=R[2],I[3]=R[3],I[4]=R[4],I[5]=R[5],I;}function o(I){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=0,I[5]=0,I;}function s(I,R,W,z,K,J){var q=new e.ARRAY_TYPE(6);return q[0]=I,q[1]=R,q[2]=W,q[3]=z,q[4]=K,q[5]=J,q;}function c(I,R,W,z,K,J,q){return I[0]=R,I[1]=W,I[2]=z,I[3]=K,I[4]=J,I[5]=q,I;}function m(I,R){var W=R[0],z=R[1],K=R[2],J=R[3],q=R[4],U=R[5],G=W*J-z*K;return G?(G=1/G,I[0]=J*G,I[1]=-z*G,I[2]=-K*G,I[3]=W*G,I[4]=(K*U-J*q)*G,I[5]=(z*q-W*U)*G,I):null;}function l(I){return I[0]*I[3]-I[1]*I[2];}function p(I,R,W){var z=R[0],K=R[1],J=R[2],q=R[3],U=R[4],G=R[5],Z=W[0],rt=W[1],et=W[2],it=W[3],X=W[4],ct=W[5];return I[0]=z*Z+J*rt,I[1]=K*Z+q*rt,I[2]=z*et+J*it,I[3]=K*et+q*it,I[4]=z*X+J*ct+U,I[5]=K*X+q*ct+G,I;}function y(I,R,W){var z=R[0],K=R[1],J=R[2],q=R[3],U=R[4],G=R[5],Z=Math.sin(W),rt=Math.cos(W);return I[0]=z*rt+J*Z,I[1]=K*rt+q*Z,I[2]=z*-Z+J*rt,I[3]=K*-Z+q*rt,I[4]=U,I[5]=G,I;}function P(I,R,W){var z=R[0],K=R[1],J=R[2],q=R[3],U=R[4],G=R[5],Z=W[0],rt=W[1];return I[0]=z*Z,I[1]=K*Z,I[2]=J*rt,I[3]=q*rt,I[4]=U,I[5]=G,I;}function S(I,R,W){var z=R[0],K=R[1],J=R[2],q=R[3],U=R[4],G=R[5],Z=W[0],rt=W[1];return I[0]=z,I[1]=K,I[2]=J,I[3]=q,I[4]=z*Z+J*rt+U,I[5]=K*Z+q*rt+G,I;}function v(I,R){var W=Math.sin(R),z=Math.cos(R);return I[0]=z,I[1]=W,I[2]=-W,I[3]=z,I[4]=0,I[5]=0,I;}function T(I,R){return I[0]=R[0],I[1]=0,I[2]=0,I[3]=R[1],I[4]=0,I[5]=0,I;}function f(I,R){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=R[0],I[5]=R[1],I;}function d(I){return"mat2d("+I[0]+", "+I[1]+", "+I[2]+", "+I[3]+", "+I[4]+", "+I[5]+")";}function u(I){return Math.hypot(I[0],I[1],I[2],I[3],I[4],I[5],1);}function g(I,R,W){return I[0]=R[0]+W[0],I[1]=R[1]+W[1],I[2]=R[2]+W[2],I[3]=R[3]+W[3],I[4]=R[4]+W[4],I[5]=R[5]+W[5],I;}function M(I,R,W){return I[0]=R[0]-W[0],I[1]=R[1]-W[1],I[2]=R[2]-W[2],I[3]=R[3]-W[3],I[4]=R[4]-W[4],I[5]=R[5]-W[5],I;}function C(I,R,W){return I[0]=R[0]*W,I[1]=R[1]*W,I[2]=R[2]*W,I[3]=R[3]*W,I[4]=R[4]*W,I[5]=R[5]*W,I;}function A(I,R,W,z){return I[0]=R[0]+W[0]*z,I[1]=R[1]+W[1]*z,I[2]=R[2]+W[2]*z,I[3]=R[3]+W[3]*z,I[4]=R[4]+W[4]*z,I[5]=R[5]+W[5]*z,I;}function L(I,R){return I[0]===R[0]&&I[1]===R[1]&&I[2]===R[2]&&I[3]===R[3]&&I[4]===R[4]&&I[5]===R[5];}function O(I,R){var W=I[0],z=I[1],K=I[2],J=I[3],q=I[4],U=I[5],G=R[0],Z=R[1],rt=R[2],et=R[3],it=R[4],X=R[5];return Math.abs(W-G)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(G))&&Math.abs(z-Z)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(Z))&&Math.abs(K-rt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(rt))&&Math.abs(J-et)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(et))&&Math.abs(q-it)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(it))&&Math.abs(U-X)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(X));}var w=p,b=M;},/* 5 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"fromMat4",function(){return i;}),t.d(r,"clone",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"identity",function(){return m;}),t.d(r,"transpose",function(){return l;}),t.d(r,"invert",function(){return p;}),t.d(r,"adjoint",function(){return y;}),t.d(r,"determinant",function(){return P;}),t.d(r,"multiply",function(){return S;}),t.d(r,"translate",function(){return v;}),t.d(r,"rotate",function(){return T;}),t.d(r,"scale",function(){return f;}),t.d(r,"fromTranslation",function(){return d;}),t.d(r,"fromRotation",function(){return u;}),t.d(r,"fromScaling",function(){return g;}),t.d(r,"fromMat2d",function(){return M;}),t.d(r,"fromQuat",function(){return C;}),t.d(r,"normalFromMat4",function(){return A;}),t.d(r,"projection",function(){return L;}),t.d(r,"str",function(){return O;}),t.d(r,"frob",function(){return w;}),t.d(r,"add",function(){return b;}),t.d(r,"subtract",function(){return I;}),t.d(r,"multiplyScalar",function(){return R;}),t.d(r,"multiplyScalarAndAdd",function(){return W;}),t.d(r,"exactEquals",function(){return z;}),t.d(r,"equals",function(){return K;}),t.d(r,"mul",function(){return J;}),t.d(r,"sub",function(){return q;});var e=t(2);function n(){var U=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(U[1]=0,U[2]=0,U[3]=0,U[5]=0,U[6]=0,U[7]=0),U[0]=1,U[4]=1,U[8]=1,U;}function i(U,G){return U[0]=G[0],U[1]=G[1],U[2]=G[2],U[3]=G[4],U[4]=G[5],U[5]=G[6],U[6]=G[8],U[7]=G[9],U[8]=G[10],U;}function a(U){var G=new e.ARRAY_TYPE(9);return G[0]=U[0],G[1]=U[1],G[2]=U[2],G[3]=U[3],G[4]=U[4],G[5]=U[5],G[6]=U[6],G[7]=U[7],G[8]=U[8],G;}function o(U,G){return U[0]=G[0],U[1]=G[1],U[2]=G[2],U[3]=G[3],U[4]=G[4],U[5]=G[5],U[6]=G[6],U[7]=G[7],U[8]=G[8],U;}function s(U,G,Z,rt,et,it,X,ct,ut){var B=new e.ARRAY_TYPE(9);return B[0]=U,B[1]=G,B[2]=Z,B[3]=rt,B[4]=et,B[5]=it,B[6]=X,B[7]=ct,B[8]=ut,B;}function c(U,G,Z,rt,et,it,X,ct,ut,B){return U[0]=G,U[1]=Z,U[2]=rt,U[3]=et,U[4]=it,U[5]=X,U[6]=ct,U[7]=ut,U[8]=B,U;}function m(U){return U[0]=1,U[1]=0,U[2]=0,U[3]=0,U[4]=1,U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function l(U,G){if(U===G){var Z=G[1],rt=G[2],et=G[5];U[1]=G[3],U[2]=G[6],U[3]=Z,U[5]=G[7],U[6]=rt,U[7]=et;}else U[0]=G[0],U[1]=G[3],U[2]=G[6],U[3]=G[1],U[4]=G[4],U[5]=G[7],U[6]=G[2],U[7]=G[5],U[8]=G[8];return U;}function p(U,G){var Z=G[0],rt=G[1],et=G[2],it=G[3],X=G[4],ct=G[5],ut=G[6],B=G[7],F=G[8],Y=F*X-ct*B,k=-F*it+ct*ut,N=B*it-X*ut,$=Z*Y+rt*k+et*N;return $?($=1/$,U[0]=Y*$,U[1]=(-F*rt+et*B)*$,U[2]=(ct*rt-et*X)*$,U[3]=k*$,U[4]=(F*Z-et*ut)*$,U[5]=(-ct*Z+et*it)*$,U[6]=N*$,U[7]=(-B*Z+rt*ut)*$,U[8]=(X*Z-rt*it)*$,U):null;}function y(U,G){var Z=G[0],rt=G[1],et=G[2],it=G[3],X=G[4],ct=G[5],ut=G[6],B=G[7],F=G[8];return U[0]=X*F-ct*B,U[1]=et*B-rt*F,U[2]=rt*ct-et*X,U[3]=ct*ut-it*F,U[4]=Z*F-et*ut,U[5]=et*it-Z*ct,U[6]=it*B-X*ut,U[7]=rt*ut-Z*B,U[8]=Z*X-rt*it,U;}function P(U){var G=U[0],Z=U[1],rt=U[2],et=U[3],it=U[4],X=U[5],ct=U[6],ut=U[7],B=U[8];return G*(B*it-X*ut)+Z*(-B*et+X*ct)+rt*(ut*et-it*ct);}function S(U,G,Z){var rt=G[0],et=G[1],it=G[2],X=G[3],ct=G[4],ut=G[5],B=G[6],F=G[7],Y=G[8],k=Z[0],N=Z[1],$=Z[2],x=Z[3],E=Z[4],D=Z[5],j=Z[6],H=Z[7],V=Z[8];return U[0]=k*rt+N*X+$*B,U[1]=k*et+N*ct+$*F,U[2]=k*it+N*ut+$*Y,U[3]=x*rt+E*X+D*B,U[4]=x*et+E*ct+D*F,U[5]=x*it+E*ut+D*Y,U[6]=j*rt+H*X+V*B,U[7]=j*et+H*ct+V*F,U[8]=j*it+H*ut+V*Y,U;}function v(U,G,Z){var rt=G[0],et=G[1],it=G[2],X=G[3],ct=G[4],ut=G[5],B=G[6],F=G[7],Y=G[8],k=Z[0],N=Z[1];return U[0]=rt,U[1]=et,U[2]=it,U[3]=X,U[4]=ct,U[5]=ut,U[6]=k*rt+N*X+B,U[7]=k*et+N*ct+F,U[8]=k*it+N*ut+Y,U;}function T(U,G,Z){var rt=G[0],et=G[1],it=G[2],X=G[3],ct=G[4],ut=G[5],B=G[6],F=G[7],Y=G[8],k=Math.sin(Z),N=Math.cos(Z);return U[0]=N*rt+k*X,U[1]=N*et+k*ct,U[2]=N*it+k*ut,U[3]=N*X-k*rt,U[4]=N*ct-k*et,U[5]=N*ut-k*it,U[6]=B,U[7]=F,U[8]=Y,U;}function f(U,G,Z){var rt=Z[0],et=Z[1];return U[0]=rt*G[0],U[1]=rt*G[1],U[2]=rt*G[2],U[3]=et*G[3],U[4]=et*G[4],U[5]=et*G[5],U[6]=G[6],U[7]=G[7],U[8]=G[8],U;}function d(U,G){return U[0]=1,U[1]=0,U[2]=0,U[3]=0,U[4]=1,U[5]=0,U[6]=G[0],U[7]=G[1],U[8]=1,U;}function u(U,G){var Z=Math.sin(G),rt=Math.cos(G);return U[0]=rt,U[1]=Z,U[2]=0,U[3]=-Z,U[4]=rt,U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function g(U,G){return U[0]=G[0],U[1]=0,U[2]=0,U[3]=0,U[4]=G[1],U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function M(U,G){return U[0]=G[0],U[1]=G[1],U[2]=0,U[3]=G[2],U[4]=G[3],U[5]=0,U[6]=G[4],U[7]=G[5],U[8]=1,U;}function C(U,G){var Z=G[0],rt=G[1],et=G[2],it=G[3],X=Z+Z,ct=rt+rt,ut=et+et,B=Z*X,F=rt*X,Y=rt*ct,k=et*X,N=et*ct,$=et*ut,x=it*X,E=it*ct,D=it*ut;return U[0]=1-Y-$,U[3]=F-D,U[6]=k+E,U[1]=F+D,U[4]=1-B-$,U[7]=N-x,U[2]=k-E,U[5]=N+x,U[8]=1-B-Y,U;}function A(U,G){var Z=G[0],rt=G[1],et=G[2],it=G[3],X=G[4],ct=G[5],ut=G[6],B=G[7],F=G[8],Y=G[9],k=G[10],N=G[11],$=G[12],x=G[13],E=G[14],D=G[15],j=Z*ct-rt*X,H=Z*ut-et*X,V=Z*B-it*X,Q=rt*ut-et*ct,nt=rt*B-it*ct,st=et*B-it*ut,ft=F*x-Y*$,pt=F*E-k*$,lt=F*D-N*$,at=Y*E-k*x,ht=Y*D-N*x,mt=k*D-N*E,yt=j*mt-H*ht+V*at+Q*lt-nt*pt+st*ft;return yt?(yt=1/yt,U[0]=(ct*mt-ut*ht+B*at)*yt,U[1]=(ut*lt-X*mt-B*pt)*yt,U[2]=(X*ht-ct*lt+B*ft)*yt,U[3]=(et*ht-rt*mt-it*at)*yt,U[4]=(Z*mt-et*lt+it*pt)*yt,U[5]=(rt*lt-Z*ht-it*ft)*yt,U[6]=(x*st-E*nt+D*Q)*yt,U[7]=(E*V-$*st-D*H)*yt,U[8]=($*nt-x*V+D*j)*yt,U):null;}function L(U,G,Z){return U[0]=2/G,U[1]=0,U[2]=0,U[3]=0,U[4]=-2/Z,U[5]=0,U[6]=-1,U[7]=1,U[8]=1,U;}function O(U){return"mat3("+U[0]+", "+U[1]+", "+U[2]+", "+U[3]+", "+U[4]+", "+U[5]+", "+U[6]+", "+U[7]+", "+U[8]+")";}function w(U){return Math.hypot(U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8]);}function b(U,G,Z){return U[0]=G[0]+Z[0],U[1]=G[1]+Z[1],U[2]=G[2]+Z[2],U[3]=G[3]+Z[3],U[4]=G[4]+Z[4],U[5]=G[5]+Z[5],U[6]=G[6]+Z[6],U[7]=G[7]+Z[7],U[8]=G[8]+Z[8],U;}function I(U,G,Z){return U[0]=G[0]-Z[0],U[1]=G[1]-Z[1],U[2]=G[2]-Z[2],U[3]=G[3]-Z[3],U[4]=G[4]-Z[4],U[5]=G[5]-Z[5],U[6]=G[6]-Z[6],U[7]=G[7]-Z[7],U[8]=G[8]-Z[8],U;}function R(U,G,Z){return U[0]=G[0]*Z,U[1]=G[1]*Z,U[2]=G[2]*Z,U[3]=G[3]*Z,U[4]=G[4]*Z,U[5]=G[5]*Z,U[6]=G[6]*Z,U[7]=G[7]*Z,U[8]=G[8]*Z,U;}function W(U,G,Z,rt){return U[0]=G[0]+Z[0]*rt,U[1]=G[1]+Z[1]*rt,U[2]=G[2]+Z[2]*rt,U[3]=G[3]+Z[3]*rt,U[4]=G[4]+Z[4]*rt,U[5]=G[5]+Z[5]*rt,U[6]=G[6]+Z[6]*rt,U[7]=G[7]+Z[7]*rt,U[8]=G[8]+Z[8]*rt,U;}function z(U,G){return U[0]===G[0]&&U[1]===G[1]&&U[2]===G[2]&&U[3]===G[3]&&U[4]===G[4]&&U[5]===G[5]&&U[6]===G[6]&&U[7]===G[7]&&U[8]===G[8];}function K(U,G){var Z=U[0],rt=U[1],et=U[2],it=U[3],X=U[4],ct=U[5],ut=U[6],B=U[7],F=U[8],Y=G[0],k=G[1],N=G[2],$=G[3],x=G[4],E=G[5],D=G[6],j=G[7],H=G[8];return Math.abs(Z-Y)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(Y))&&Math.abs(rt-k)<=e.EPSILON*Math.max(1,Math.abs(rt),Math.abs(k))&&Math.abs(et-N)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(N))&&Math.abs(it-$)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs($))&&Math.abs(X-x)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(x))&&Math.abs(ct-E)<=e.EPSILON*Math.max(1,Math.abs(ct),Math.abs(E))&&Math.abs(ut-D)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs(D))&&Math.abs(B-j)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(j))&&Math.abs(F-H)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(H));}var J=S,q=I;},/* 6 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"identity",function(){return c;}),t.d(r,"transpose",function(){return m;}),t.d(r,"invert",function(){return l;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return P;}),t.d(r,"translate",function(){return S;}),t.d(r,"scale",function(){return v;}),t.d(r,"rotate",function(){return T;}),t.d(r,"rotateX",function(){return f;}),t.d(r,"rotateY",function(){return d;}),t.d(r,"rotateZ",function(){return u;}),t.d(r,"fromTranslation",function(){return g;}),t.d(r,"fromScaling",function(){return M;}),t.d(r,"fromRotation",function(){return C;}),t.d(r,"fromXRotation",function(){return A;}),t.d(r,"fromYRotation",function(){return L;}),t.d(r,"fromZRotation",function(){return O;}),t.d(r,"fromRotationTranslation",function(){return w;}),t.d(r,"fromQuat2",function(){return b;}),t.d(r,"getTranslation",function(){return I;}),t.d(r,"getScaling",function(){return R;}),t.d(r,"getRotation",function(){return W;}),t.d(r,"fromRotationTranslationScale",function(){return z;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return K;}),t.d(r,"fromQuat",function(){return J;}),t.d(r,"frustum",function(){return q;}),t.d(r,"perspective",function(){return U;}),t.d(r,"perspectiveFromFieldOfView",function(){return G;}),t.d(r,"ortho",function(){return Z;}),t.d(r,"lookAt",function(){return rt;}),t.d(r,"targetTo",function(){return et;}),t.d(r,"str",function(){return it;}),t.d(r,"frob",function(){return X;}),t.d(r,"add",function(){return ct;}),t.d(r,"subtract",function(){return ut;}),t.d(r,"multiplyScalar",function(){return B;}),t.d(r,"multiplyScalarAndAdd",function(){return F;}),t.d(r,"exactEquals",function(){return Y;}),t.d(r,"equals",function(){return k;}),t.d(r,"mul",function(){return N;}),t.d(r,"sub",function(){return $;});var e=t(2);function n(){var x=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[11]=0,x[12]=0,x[13]=0,x[14]=0),x[0]=1,x[5]=1,x[10]=1,x[15]=1,x;}function i(x){var E=new e.ARRAY_TYPE(16);return E[0]=x[0],E[1]=x[1],E[2]=x[2],E[3]=x[3],E[4]=x[4],E[5]=x[5],E[6]=x[6],E[7]=x[7],E[8]=x[8],E[9]=x[9],E[10]=x[10],E[11]=x[11],E[12]=x[12],E[13]=x[13],E[14]=x[14],E[15]=x[15],E;}function a(x,E){return x[0]=E[0],x[1]=E[1],x[2]=E[2],x[3]=E[3],x[4]=E[4],x[5]=E[5],x[6]=E[6],x[7]=E[7],x[8]=E[8],x[9]=E[9],x[10]=E[10],x[11]=E[11],x[12]=E[12],x[13]=E[13],x[14]=E[14],x[15]=E[15],x;}function o(x,E,D,j,H,V,Q,nt,st,ft,pt,lt,at,ht,mt,yt){var gt=new e.ARRAY_TYPE(16);return gt[0]=x,gt[1]=E,gt[2]=D,gt[3]=j,gt[4]=H,gt[5]=V,gt[6]=Q,gt[7]=nt,gt[8]=st,gt[9]=ft,gt[10]=pt,gt[11]=lt,gt[12]=at,gt[13]=ht,gt[14]=mt,gt[15]=yt,gt;}function s(x,E,D,j,H,V,Q,nt,st,ft,pt,lt,at,ht,mt,yt,gt){return x[0]=E,x[1]=D,x[2]=j,x[3]=H,x[4]=V,x[5]=Q,x[6]=nt,x[7]=st,x[8]=ft,x[9]=pt,x[10]=lt,x[11]=at,x[12]=ht,x[13]=mt,x[14]=yt,x[15]=gt,x;}function c(x){return x[0]=1,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=1,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x;}function m(x,E){if(x===E){var D=E[1],j=E[2],H=E[3],V=E[6],Q=E[7],nt=E[11];x[1]=E[4],x[2]=E[8],x[3]=E[12],x[4]=D,x[6]=E[9],x[7]=E[13],x[8]=j,x[9]=V,x[11]=E[14],x[12]=H,x[13]=Q,x[14]=nt;}else x[0]=E[0],x[1]=E[4],x[2]=E[8],x[3]=E[12],x[4]=E[1],x[5]=E[5],x[6]=E[9],x[7]=E[13],x[8]=E[2],x[9]=E[6],x[10]=E[10],x[11]=E[14],x[12]=E[3],x[13]=E[7],x[14]=E[11],x[15]=E[15];return x;}function l(x,E){var D=E[0],j=E[1],H=E[2],V=E[3],Q=E[4],nt=E[5],st=E[6],ft=E[7],pt=E[8],lt=E[9],at=E[10],ht=E[11],mt=E[12],yt=E[13],gt=E[14],Mt=E[15],It=D*nt-j*Q,Et=D*st-H*Q,Ct=D*ft-V*Q,At=j*st-H*nt,Rt=j*ft-V*nt,Ht=H*ft-V*st,$t=pt*yt-lt*mt,zt=pt*gt-at*mt,Gt=pt*Mt-ht*mt,Kt=lt*gt-at*yt,Yt=lt*Mt-ht*yt,Xt=at*Mt-ht*gt,Dt=It*Xt-Et*Yt+Ct*Kt+At*Gt-Rt*zt+Ht*$t;return Dt?(Dt=1/Dt,x[0]=(nt*Xt-st*Yt+ft*Kt)*Dt,x[1]=(H*Yt-j*Xt-V*Kt)*Dt,x[2]=(yt*Ht-gt*Rt+Mt*At)*Dt,x[3]=(at*Rt-lt*Ht-ht*At)*Dt,x[4]=(st*Gt-Q*Xt-ft*zt)*Dt,x[5]=(D*Xt-H*Gt+V*zt)*Dt,x[6]=(gt*Ct-mt*Ht-Mt*Et)*Dt,x[7]=(pt*Ht-at*Ct+ht*Et)*Dt,x[8]=(Q*Yt-nt*Gt+ft*$t)*Dt,x[9]=(j*Gt-D*Yt-V*$t)*Dt,x[10]=(mt*Rt-yt*Ct+Mt*It)*Dt,x[11]=(lt*Ct-pt*Rt-ht*It)*Dt,x[12]=(nt*zt-Q*Kt-st*$t)*Dt,x[13]=(D*Kt-j*zt+H*$t)*Dt,x[14]=(yt*Et-mt*At-gt*It)*Dt,x[15]=(pt*At-lt*Et+at*It)*Dt,x):null;}function p(x,E){var D=E[0],j=E[1],H=E[2],V=E[3],Q=E[4],nt=E[5],st=E[6],ft=E[7],pt=E[8],lt=E[9],at=E[10],ht=E[11],mt=E[12],yt=E[13],gt=E[14],Mt=E[15];return x[0]=nt*(at*Mt-ht*gt)-lt*(st*Mt-ft*gt)+yt*(st*ht-ft*at),x[1]=-(j*(at*Mt-ht*gt)-lt*(H*Mt-V*gt)+yt*(H*ht-V*at)),x[2]=j*(st*Mt-ft*gt)-nt*(H*Mt-V*gt)+yt*(H*ft-V*st),x[3]=-(j*(st*ht-ft*at)-nt*(H*ht-V*at)+lt*(H*ft-V*st)),x[4]=-(Q*(at*Mt-ht*gt)-pt*(st*Mt-ft*gt)+mt*(st*ht-ft*at)),x[5]=D*(at*Mt-ht*gt)-pt*(H*Mt-V*gt)+mt*(H*ht-V*at),x[6]=-(D*(st*Mt-ft*gt)-Q*(H*Mt-V*gt)+mt*(H*ft-V*st)),x[7]=D*(st*ht-ft*at)-Q*(H*ht-V*at)+pt*(H*ft-V*st),x[8]=Q*(lt*Mt-ht*yt)-pt*(nt*Mt-ft*yt)+mt*(nt*ht-ft*lt),x[9]=-(D*(lt*Mt-ht*yt)-pt*(j*Mt-V*yt)+mt*(j*ht-V*lt)),x[10]=D*(nt*Mt-ft*yt)-Q*(j*Mt-V*yt)+mt*(j*ft-V*nt),x[11]=-(D*(nt*ht-ft*lt)-Q*(j*ht-V*lt)+pt*(j*ft-V*nt)),x[12]=-(Q*(lt*gt-at*yt)-pt*(nt*gt-st*yt)+mt*(nt*at-st*lt)),x[13]=D*(lt*gt-at*yt)-pt*(j*gt-H*yt)+mt*(j*at-H*lt),x[14]=-(D*(nt*gt-st*yt)-Q*(j*gt-H*yt)+mt*(j*st-H*nt)),x[15]=D*(nt*at-st*lt)-Q*(j*at-H*lt)+pt*(j*st-H*nt),x;}function y(x){var E=x[0],D=x[1],j=x[2],H=x[3],V=x[4],Q=x[5],nt=x[6],st=x[7],ft=x[8],pt=x[9],lt=x[10],at=x[11],ht=x[12],mt=x[13],yt=x[14],gt=x[15],Mt=E*Q-D*V,It=E*nt-j*V,Et=E*st-H*V,Ct=D*nt-j*Q,At=D*st-H*Q,Rt=j*st-H*nt,Ht=ft*mt-pt*ht,$t=ft*yt-lt*ht,zt=ft*gt-at*ht,Gt=pt*yt-lt*mt,Kt=pt*gt-at*mt,Yt=lt*gt-at*yt;return Mt*Yt-It*Kt+Et*Gt+Ct*zt-At*$t+Rt*Ht;}function P(x,E,D){var j=E[0],H=E[1],V=E[2],Q=E[3],nt=E[4],st=E[5],ft=E[6],pt=E[7],lt=E[8],at=E[9],ht=E[10],mt=E[11],yt=E[12],gt=E[13],Mt=E[14],It=E[15],Et=D[0],Ct=D[1],At=D[2],Rt=D[3];return x[0]=Et*j+Ct*nt+At*lt+Rt*yt,x[1]=Et*H+Ct*st+At*at+Rt*gt,x[2]=Et*V+Ct*ft+At*ht+Rt*Mt,x[3]=Et*Q+Ct*pt+At*mt+Rt*It,Et=D[4],Ct=D[5],At=D[6],Rt=D[7],x[4]=Et*j+Ct*nt+At*lt+Rt*yt,x[5]=Et*H+Ct*st+At*at+Rt*gt,x[6]=Et*V+Ct*ft+At*ht+Rt*Mt,x[7]=Et*Q+Ct*pt+At*mt+Rt*It,Et=D[8],Ct=D[9],At=D[10],Rt=D[11],x[8]=Et*j+Ct*nt+At*lt+Rt*yt,x[9]=Et*H+Ct*st+At*at+Rt*gt,x[10]=Et*V+Ct*ft+At*ht+Rt*Mt,x[11]=Et*Q+Ct*pt+At*mt+Rt*It,Et=D[12],Ct=D[13],At=D[14],Rt=D[15],x[12]=Et*j+Ct*nt+At*lt+Rt*yt,x[13]=Et*H+Ct*st+At*at+Rt*gt,x[14]=Et*V+Ct*ft+At*ht+Rt*Mt,x[15]=Et*Q+Ct*pt+At*mt+Rt*It,x;}function S(x,E,D){var j=D[0],H=D[1],V=D[2],Q,nt,st,ft,pt,lt,at,ht,mt,yt,gt,Mt;return E===x?(x[12]=E[0]*j+E[4]*H+E[8]*V+E[12],x[13]=E[1]*j+E[5]*H+E[9]*V+E[13],x[14]=E[2]*j+E[6]*H+E[10]*V+E[14],x[15]=E[3]*j+E[7]*H+E[11]*V+E[15]):(Q=E[0],nt=E[1],st=E[2],ft=E[3],pt=E[4],lt=E[5],at=E[6],ht=E[7],mt=E[8],yt=E[9],gt=E[10],Mt=E[11],x[0]=Q,x[1]=nt,x[2]=st,x[3]=ft,x[4]=pt,x[5]=lt,x[6]=at,x[7]=ht,x[8]=mt,x[9]=yt,x[10]=gt,x[11]=Mt,x[12]=Q*j+pt*H+mt*V+E[12],x[13]=nt*j+lt*H+yt*V+E[13],x[14]=st*j+at*H+gt*V+E[14],x[15]=ft*j+ht*H+Mt*V+E[15]),x;}function v(x,E,D){var j=D[0],H=D[1],V=D[2];return x[0]=E[0]*j,x[1]=E[1]*j,x[2]=E[2]*j,x[3]=E[3]*j,x[4]=E[4]*H,x[5]=E[5]*H,x[6]=E[6]*H,x[7]=E[7]*H,x[8]=E[8]*V,x[9]=E[9]*V,x[10]=E[10]*V,x[11]=E[11]*V,x[12]=E[12],x[13]=E[13],x[14]=E[14],x[15]=E[15],x;}function T(x,E,D,j){var H=j[0],V=j[1],Q=j[2],nt=Math.hypot(H,V,Q),st,ft,pt,lt,at,ht,mt,yt,gt,Mt,It,Et,Ct,At,Rt,Ht,$t,zt,Gt,Kt,Yt,Xt,Dt,ee;return nt<e.EPSILON?null:(nt=1/nt,H*=nt,V*=nt,Q*=nt,st=Math.sin(D),ft=Math.cos(D),pt=1-ft,lt=E[0],at=E[1],ht=E[2],mt=E[3],yt=E[4],gt=E[5],Mt=E[6],It=E[7],Et=E[8],Ct=E[9],At=E[10],Rt=E[11],Ht=H*H*pt+ft,$t=V*H*pt+Q*st,zt=Q*H*pt-V*st,Gt=H*V*pt-Q*st,Kt=V*V*pt+ft,Yt=Q*V*pt+H*st,Xt=H*Q*pt+V*st,Dt=V*Q*pt-H*st,ee=Q*Q*pt+ft,x[0]=lt*Ht+yt*$t+Et*zt,x[1]=at*Ht+gt*$t+Ct*zt,x[2]=ht*Ht+Mt*$t+At*zt,x[3]=mt*Ht+It*$t+Rt*zt,x[4]=lt*Gt+yt*Kt+Et*Yt,x[5]=at*Gt+gt*Kt+Ct*Yt,x[6]=ht*Gt+Mt*Kt+At*Yt,x[7]=mt*Gt+It*Kt+Rt*Yt,x[8]=lt*Xt+yt*Dt+Et*ee,x[9]=at*Xt+gt*Dt+Ct*ee,x[10]=ht*Xt+Mt*Dt+At*ee,x[11]=mt*Xt+It*Dt+Rt*ee,E!==x&&(x[12]=E[12],x[13]=E[13],x[14]=E[14],x[15]=E[15]),x);}function f(x,E,D){var j=Math.sin(D),H=Math.cos(D),V=E[4],Q=E[5],nt=E[6],st=E[7],ft=E[8],pt=E[9],lt=E[10],at=E[11];return E!==x&&(x[0]=E[0],x[1]=E[1],x[2]=E[2],x[3]=E[3],x[12]=E[12],x[13]=E[13],x[14]=E[14],x[15]=E[15]),x[4]=V*H+ft*j,x[5]=Q*H+pt*j,x[6]=nt*H+lt*j,x[7]=st*H+at*j,x[8]=ft*H-V*j,x[9]=pt*H-Q*j,x[10]=lt*H-nt*j,x[11]=at*H-st*j,x;}function d(x,E,D){var j=Math.sin(D),H=Math.cos(D),V=E[0],Q=E[1],nt=E[2],st=E[3],ft=E[8],pt=E[9],lt=E[10],at=E[11];return E!==x&&(x[4]=E[4],x[5]=E[5],x[6]=E[6],x[7]=E[7],x[12]=E[12],x[13]=E[13],x[14]=E[14],x[15]=E[15]),x[0]=V*H-ft*j,x[1]=Q*H-pt*j,x[2]=nt*H-lt*j,x[3]=st*H-at*j,x[8]=V*j+ft*H,x[9]=Q*j+pt*H,x[10]=nt*j+lt*H,x[11]=st*j+at*H,x;}function u(x,E,D){var j=Math.sin(D),H=Math.cos(D),V=E[0],Q=E[1],nt=E[2],st=E[3],ft=E[4],pt=E[5],lt=E[6],at=E[7];return E!==x&&(x[8]=E[8],x[9]=E[9],x[10]=E[10],x[11]=E[11],x[12]=E[12],x[13]=E[13],x[14]=E[14],x[15]=E[15]),x[0]=V*H+ft*j,x[1]=Q*H+pt*j,x[2]=nt*H+lt*j,x[3]=st*H+at*j,x[4]=ft*H-V*j,x[5]=pt*H-Q*j,x[6]=lt*H-nt*j,x[7]=at*H-st*j,x;}function g(x,E){return x[0]=1,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=1,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1,x[11]=0,x[12]=E[0],x[13]=E[1],x[14]=E[2],x[15]=1,x;}function M(x,E){return x[0]=E[0],x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=E[1],x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=E[2],x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x;}function C(x,E,D){var j=D[0],H=D[1],V=D[2],Q=Math.hypot(j,H,V),nt,st,ft;return Q<e.EPSILON?null:(Q=1/Q,j*=Q,H*=Q,V*=Q,nt=Math.sin(E),st=Math.cos(E),ft=1-st,x[0]=j*j*ft+st,x[1]=H*j*ft+V*nt,x[2]=V*j*ft-H*nt,x[3]=0,x[4]=j*H*ft-V*nt,x[5]=H*H*ft+st,x[6]=V*H*ft+j*nt,x[7]=0,x[8]=j*V*ft+H*nt,x[9]=H*V*ft-j*nt,x[10]=V*V*ft+st,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x);}function A(x,E){var D=Math.sin(E),j=Math.cos(E);return x[0]=1,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=j,x[6]=D,x[7]=0,x[8]=0,x[9]=-D,x[10]=j,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x;}function L(x,E){var D=Math.sin(E),j=Math.cos(E);return x[0]=j,x[1]=0,x[2]=-D,x[3]=0,x[4]=0,x[5]=1,x[6]=0,x[7]=0,x[8]=D,x[9]=0,x[10]=j,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x;}function O(x,E){var D=Math.sin(E),j=Math.cos(E);return x[0]=j,x[1]=D,x[2]=0,x[3]=0,x[4]=-D,x[5]=j,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x;}function w(x,E,D){var j=E[0],H=E[1],V=E[2],Q=E[3],nt=j+j,st=H+H,ft=V+V,pt=j*nt,lt=j*st,at=j*ft,ht=H*st,mt=H*ft,yt=V*ft,gt=Q*nt,Mt=Q*st,It=Q*ft;return x[0]=1-(ht+yt),x[1]=lt+It,x[2]=at-Mt,x[3]=0,x[4]=lt-It,x[5]=1-(pt+yt),x[6]=mt+gt,x[7]=0,x[8]=at+Mt,x[9]=mt-gt,x[10]=1-(pt+ht),x[11]=0,x[12]=D[0],x[13]=D[1],x[14]=D[2],x[15]=1,x;}function b(x,E){var D=new e.ARRAY_TYPE(3),j=-E[0],H=-E[1],V=-E[2],Q=E[3],nt=E[4],st=E[5],ft=E[6],pt=E[7],lt=j*j+H*H+V*V+Q*Q;return lt>0?(D[0]=(nt*Q+pt*j+st*V-ft*H)*2/lt,D[1]=(st*Q+pt*H+ft*j-nt*V)*2/lt,D[2]=(ft*Q+pt*V+nt*H-st*j)*2/lt):(D[0]=(nt*Q+pt*j+st*V-ft*H)*2,D[1]=(st*Q+pt*H+ft*j-nt*V)*2,D[2]=(ft*Q+pt*V+nt*H-st*j)*2),w(x,E,D),x;}function I(x,E){return x[0]=E[12],x[1]=E[13],x[2]=E[14],x;}function R(x,E){var D=E[0],j=E[1],H=E[2],V=E[4],Q=E[5],nt=E[6],st=E[8],ft=E[9],pt=E[10];return x[0]=Math.hypot(D,j,H),x[1]=Math.hypot(V,Q,nt),x[2]=Math.hypot(st,ft,pt),x;}function W(x,E){var D=new e.ARRAY_TYPE(3);R(D,E);var j=1/D[0],H=1/D[1],V=1/D[2],Q=E[0]*j,nt=E[1]*H,st=E[2]*V,ft=E[4]*j,pt=E[5]*H,lt=E[6]*V,at=E[8]*j,ht=E[9]*H,mt=E[10]*V,yt=Q+pt+mt,gt=0;return yt>0?(gt=Math.sqrt(yt+1)*2,x[3]=0.25*gt,x[0]=(lt-ht)/gt,x[1]=(at-st)/gt,x[2]=(nt-ft)/gt):Q>pt&&Q>mt?(gt=Math.sqrt(1+Q-pt-mt)*2,x[3]=(lt-ht)/gt,x[0]=0.25*gt,x[1]=(nt+ft)/gt,x[2]=(at+st)/gt):pt>mt?(gt=Math.sqrt(1+pt-Q-mt)*2,x[3]=(at-st)/gt,x[0]=(nt+ft)/gt,x[1]=0.25*gt,x[2]=(lt+ht)/gt):(gt=Math.sqrt(1+mt-Q-pt)*2,x[3]=(nt-ft)/gt,x[0]=(at+st)/gt,x[1]=(lt+ht)/gt,x[2]=0.25*gt),x;}function z(x,E,D,j){var H=E[0],V=E[1],Q=E[2],nt=E[3],st=H+H,ft=V+V,pt=Q+Q,lt=H*st,at=H*ft,ht=H*pt,mt=V*ft,yt=V*pt,gt=Q*pt,Mt=nt*st,It=nt*ft,Et=nt*pt,Ct=j[0],At=j[1],Rt=j[2];return x[0]=(1-(mt+gt))*Ct,x[1]=(at+Et)*Ct,x[2]=(ht-It)*Ct,x[3]=0,x[4]=(at-Et)*At,x[5]=(1-(lt+gt))*At,x[6]=(yt+Mt)*At,x[7]=0,x[8]=(ht+It)*Rt,x[9]=(yt-Mt)*Rt,x[10]=(1-(lt+mt))*Rt,x[11]=0,x[12]=D[0],x[13]=D[1],x[14]=D[2],x[15]=1,x;}function K(x,E,D,j,H){var V=E[0],Q=E[1],nt=E[2],st=E[3],ft=V+V,pt=Q+Q,lt=nt+nt,at=V*ft,ht=V*pt,mt=V*lt,yt=Q*pt,gt=Q*lt,Mt=nt*lt,It=st*ft,Et=st*pt,Ct=st*lt,At=j[0],Rt=j[1],Ht=j[2],$t=H[0],zt=H[1],Gt=H[2],Kt=(1-(yt+Mt))*At,Yt=(ht+Ct)*At,Xt=(mt-Et)*At,Dt=(ht-Ct)*Rt,ee=(1-(at+Mt))*Rt,Le=(gt+It)*Rt,be=(mt+Et)*Ht,Hr=(gt-It)*Ht,Kr=(1-(at+yt))*Ht;return x[0]=Kt,x[1]=Yt,x[2]=Xt,x[3]=0,x[4]=Dt,x[5]=ee,x[6]=Le,x[7]=0,x[8]=be,x[9]=Hr,x[10]=Kr,x[11]=0,x[12]=D[0]+$t-(Kt*$t+Dt*zt+be*Gt),x[13]=D[1]+zt-(Yt*$t+ee*zt+Hr*Gt),x[14]=D[2]+Gt-(Xt*$t+Le*zt+Kr*Gt),x[15]=1,x;}function J(x,E){var D=E[0],j=E[1],H=E[2],V=E[3],Q=D+D,nt=j+j,st=H+H,ft=D*Q,pt=j*Q,lt=j*nt,at=H*Q,ht=H*nt,mt=H*st,yt=V*Q,gt=V*nt,Mt=V*st;return x[0]=1-lt-mt,x[1]=pt+Mt,x[2]=at-gt,x[3]=0,x[4]=pt-Mt,x[5]=1-ft-mt,x[6]=ht+yt,x[7]=0,x[8]=at+gt,x[9]=ht-yt,x[10]=1-ft-lt,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x;}function q(x,E,D,j,H,V,Q){var nt=1/(D-E),st=1/(H-j),ft=1/(V-Q);return x[0]=V*2*nt,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=V*2*st,x[6]=0,x[7]=0,x[8]=(D+E)*nt,x[9]=(H+j)*st,x[10]=(Q+V)*ft,x[11]=-1,x[12]=0,x[13]=0,x[14]=Q*V*2*ft,x[15]=0,x;}function U(x,E,D,j,H){var V=1/Math.tan(E/2),Q;return x[0]=V/D,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=V,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[11]=-1,x[12]=0,x[13]=0,x[15]=0,H!=null&&H!==1/0?(Q=1/(j-H),x[10]=(H+j)*Q,x[14]=2*H*j*Q):(x[10]=-1,x[14]=-2*j),x;}function G(x,E,D,j){var H=Math.tan(E.upDegrees*Math.PI/180),V=Math.tan(E.downDegrees*Math.PI/180),Q=Math.tan(E.leftDegrees*Math.PI/180),nt=Math.tan(E.rightDegrees*Math.PI/180),st=2/(Q+nt),ft=2/(H+V);return x[0]=st,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=ft,x[6]=0,x[7]=0,x[8]=-((Q-nt)*st*0.5),x[9]=(H-V)*ft*0.5,x[10]=j/(D-j),x[11]=-1,x[12]=0,x[13]=0,x[14]=j*D/(D-j),x[15]=0,x;}function Z(x,E,D,j,H,V,Q){var nt=1/(E-D),st=1/(j-H),ft=1/(V-Q);return x[0]=-2*nt,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=-2*st,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=2*ft,x[11]=0,x[12]=(E+D)*nt,x[13]=(H+j)*st,x[14]=(Q+V)*ft,x[15]=1,x;}function rt(x,E,D,j){var H,V,Q,nt,st,ft,pt,lt,at,ht,mt=E[0],yt=E[1],gt=E[2],Mt=j[0],It=j[1],Et=j[2],Ct=D[0],At=D[1],Rt=D[2];return Math.abs(mt-Ct)<e.EPSILON&&Math.abs(yt-At)<e.EPSILON&&Math.abs(gt-Rt)<e.EPSILON?c(x):(pt=mt-Ct,lt=yt-At,at=gt-Rt,ht=1/Math.hypot(pt,lt,at),pt*=ht,lt*=ht,at*=ht,H=It*at-Et*lt,V=Et*pt-Mt*at,Q=Mt*lt-It*pt,ht=Math.hypot(H,V,Q),ht?(ht=1/ht,H*=ht,V*=ht,Q*=ht):(H=0,V=0,Q=0),nt=lt*Q-at*V,st=at*H-pt*Q,ft=pt*V-lt*H,ht=Math.hypot(nt,st,ft),ht?(ht=1/ht,nt*=ht,st*=ht,ft*=ht):(nt=0,st=0,ft=0),x[0]=H,x[1]=nt,x[2]=pt,x[3]=0,x[4]=V,x[5]=st,x[6]=lt,x[7]=0,x[8]=Q,x[9]=ft,x[10]=at,x[11]=0,x[12]=-(H*mt+V*yt+Q*gt),x[13]=-(nt*mt+st*yt+ft*gt),x[14]=-(pt*mt+lt*yt+at*gt),x[15]=1,x);}function et(x,E,D,j){var H=E[0],V=E[1],Q=E[2],nt=j[0],st=j[1],ft=j[2],pt=H-D[0],lt=V-D[1],at=Q-D[2],ht=pt*pt+lt*lt+at*at;ht>0&&(ht=1/Math.sqrt(ht),pt*=ht,lt*=ht,at*=ht);var mt=st*at-ft*lt,yt=ft*pt-nt*at,gt=nt*lt-st*pt;return ht=mt*mt+yt*yt+gt*gt,ht>0&&(ht=1/Math.sqrt(ht),mt*=ht,yt*=ht,gt*=ht),x[0]=mt,x[1]=yt,x[2]=gt,x[3]=0,x[4]=lt*gt-at*yt,x[5]=at*mt-pt*gt,x[6]=pt*yt-lt*mt,x[7]=0,x[8]=pt,x[9]=lt,x[10]=at,x[11]=0,x[12]=H,x[13]=V,x[14]=Q,x[15]=1,x;}function it(x){return"mat4("+x[0]+", "+x[1]+", "+x[2]+", "+x[3]+", "+x[4]+", "+x[5]+", "+x[6]+", "+x[7]+", "+x[8]+", "+x[9]+", "+x[10]+", "+x[11]+", "+x[12]+", "+x[13]+", "+x[14]+", "+x[15]+")";}function X(x){return Math.hypot(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15]);}function ct(x,E,D){return x[0]=E[0]+D[0],x[1]=E[1]+D[1],x[2]=E[2]+D[2],x[3]=E[3]+D[3],x[4]=E[4]+D[4],x[5]=E[5]+D[5],x[6]=E[6]+D[6],x[7]=E[7]+D[7],x[8]=E[8]+D[8],x[9]=E[9]+D[9],x[10]=E[10]+D[10],x[11]=E[11]+D[11],x[12]=E[12]+D[12],x[13]=E[13]+D[13],x[14]=E[14]+D[14],x[15]=E[15]+D[15],x;}function ut(x,E,D){return x[0]=E[0]-D[0],x[1]=E[1]-D[1],x[2]=E[2]-D[2],x[3]=E[3]-D[3],x[4]=E[4]-D[4],x[5]=E[5]-D[5],x[6]=E[6]-D[6],x[7]=E[7]-D[7],x[8]=E[8]-D[8],x[9]=E[9]-D[9],x[10]=E[10]-D[10],x[11]=E[11]-D[11],x[12]=E[12]-D[12],x[13]=E[13]-D[13],x[14]=E[14]-D[14],x[15]=E[15]-D[15],x;}function B(x,E,D){return x[0]=E[0]*D,x[1]=E[1]*D,x[2]=E[2]*D,x[3]=E[3]*D,x[4]=E[4]*D,x[5]=E[5]*D,x[6]=E[6]*D,x[7]=E[7]*D,x[8]=E[8]*D,x[9]=E[9]*D,x[10]=E[10]*D,x[11]=E[11]*D,x[12]=E[12]*D,x[13]=E[13]*D,x[14]=E[14]*D,x[15]=E[15]*D,x;}function F(x,E,D,j){return x[0]=E[0]+D[0]*j,x[1]=E[1]+D[1]*j,x[2]=E[2]+D[2]*j,x[3]=E[3]+D[3]*j,x[4]=E[4]+D[4]*j,x[5]=E[5]+D[5]*j,x[6]=E[6]+D[6]*j,x[7]=E[7]+D[7]*j,x[8]=E[8]+D[8]*j,x[9]=E[9]+D[9]*j,x[10]=E[10]+D[10]*j,x[11]=E[11]+D[11]*j,x[12]=E[12]+D[12]*j,x[13]=E[13]+D[13]*j,x[14]=E[14]+D[14]*j,x[15]=E[15]+D[15]*j,x;}function Y(x,E){return x[0]===E[0]&&x[1]===E[1]&&x[2]===E[2]&&x[3]===E[3]&&x[4]===E[4]&&x[5]===E[5]&&x[6]===E[6]&&x[7]===E[7]&&x[8]===E[8]&&x[9]===E[9]&&x[10]===E[10]&&x[11]===E[11]&&x[12]===E[12]&&x[13]===E[13]&&x[14]===E[14]&&x[15]===E[15];}function k(x,E){var D=x[0],j=x[1],H=x[2],V=x[3],Q=x[4],nt=x[5],st=x[6],ft=x[7],pt=x[8],lt=x[9],at=x[10],ht=x[11],mt=x[12],yt=x[13],gt=x[14],Mt=x[15],It=E[0],Et=E[1],Ct=E[2],At=E[3],Rt=E[4],Ht=E[5],$t=E[6],zt=E[7],Gt=E[8],Kt=E[9],Yt=E[10],Xt=E[11],Dt=E[12],ee=E[13],Le=E[14],be=E[15];return Math.abs(D-It)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(It))&&Math.abs(j-Et)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Et))&&Math.abs(H-Ct)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(Ct))&&Math.abs(V-At)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(At))&&Math.abs(Q-Rt)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(Rt))&&Math.abs(nt-Ht)<=e.EPSILON*Math.max(1,Math.abs(nt),Math.abs(Ht))&&Math.abs(st-$t)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs($t))&&Math.abs(ft-zt)<=e.EPSILON*Math.max(1,Math.abs(ft),Math.abs(zt))&&Math.abs(pt-Gt)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Gt))&&Math.abs(lt-Kt)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs(Kt))&&Math.abs(at-Yt)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs(Yt))&&Math.abs(ht-Xt)<=e.EPSILON*Math.max(1,Math.abs(ht),Math.abs(Xt))&&Math.abs(mt-Dt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Dt))&&Math.abs(yt-ee)<=e.EPSILON*Math.max(1,Math.abs(yt),Math.abs(ee))&&Math.abs(gt-Le)<=e.EPSILON*Math.max(1,Math.abs(gt),Math.abs(Le))&&Math.abs(Mt-be)<=e.EPSILON*Math.max(1,Math.abs(Mt),Math.abs(be));}var N=P,$=ut;},/* 7 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return o;}),t.d(r,"identity",function(){return s;}),t.d(r,"setAxisAngle",function(){return c;}),t.d(r,"getAxisAngle",function(){return m;}),t.d(r,"getAngle",function(){return l;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotateX",function(){return y;}),t.d(r,"rotateY",function(){return P;}),t.d(r,"rotateZ",function(){return S;}),t.d(r,"calculateW",function(){return v;}),t.d(r,"exp",function(){return T;}),t.d(r,"ln",function(){return f;}),t.d(r,"pow",function(){return d;}),t.d(r,"slerp",function(){return u;}),t.d(r,"random",function(){return g;}),t.d(r,"invert",function(){return M;}),t.d(r,"conjugate",function(){return C;}),t.d(r,"fromMat3",function(){return A;}),t.d(r,"fromEuler",function(){return L;}),t.d(r,"str",function(){return O;}),t.d(r,"clone",function(){return w;}),t.d(r,"fromValues",function(){return b;}),t.d(r,"copy",function(){return I;}),t.d(r,"set",function(){return R;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return z;}),t.d(r,"scale",function(){return K;}),t.d(r,"dot",function(){return J;}),t.d(r,"lerp",function(){return q;}),t.d(r,"length",function(){return U;}),t.d(r,"len",function(){return G;}),t.d(r,"squaredLength",function(){return Z;}),t.d(r,"sqrLen",function(){return rt;}),t.d(r,"normalize",function(){return et;}),t.d(r,"exactEquals",function(){return it;}),t.d(r,"equals",function(){return X;}),t.d(r,"rotationTo",function(){return ct;}),t.d(r,"sqlerp",function(){return ut;}),t.d(r,"setAxes",function(){return B;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0),F[3]=1,F;}function s(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F;}function c(F,Y,k){k=k*0.5;var N=Math.sin(k);return F[0]=N*Y[0],F[1]=N*Y[1],F[2]=N*Y[2],F[3]=Math.cos(k),F;}function m(F,Y){var k=Math.acos(Y[3])*2,N=Math.sin(k/2);return N>e.EPSILON?(F[0]=Y[0]/N,F[1]=Y[1]/N,F[2]=Y[2]/N):(F[0]=1,F[1]=0,F[2]=0),k;}function l(F,Y){var k=J(F,Y);return Math.acos(2*k*k-1);}function p(F,Y,k){var N=Y[0],$=Y[1],x=Y[2],E=Y[3],D=k[0],j=k[1],H=k[2],V=k[3];return F[0]=N*V+E*D+$*H-x*j,F[1]=$*V+E*j+x*D-N*H,F[2]=x*V+E*H+N*j-$*D,F[3]=E*V-N*D-$*j-x*H,F;}function y(F,Y,k){k*=0.5;var N=Y[0],$=Y[1],x=Y[2],E=Y[3],D=Math.sin(k),j=Math.cos(k);return F[0]=N*j+E*D,F[1]=$*j+x*D,F[2]=x*j-$*D,F[3]=E*j-N*D,F;}function P(F,Y,k){k*=0.5;var N=Y[0],$=Y[1],x=Y[2],E=Y[3],D=Math.sin(k),j=Math.cos(k);return F[0]=N*j-x*D,F[1]=$*j+E*D,F[2]=x*j+N*D,F[3]=E*j-$*D,F;}function S(F,Y,k){k*=0.5;var N=Y[0],$=Y[1],x=Y[2],E=Y[3],D=Math.sin(k),j=Math.cos(k);return F[0]=N*j+$*D,F[1]=$*j-N*D,F[2]=x*j+E*D,F[3]=E*j-x*D,F;}function v(F,Y){var k=Y[0],N=Y[1],$=Y[2];return F[0]=k,F[1]=N,F[2]=$,F[3]=Math.sqrt(Math.abs(1-k*k-N*N-$*$)),F;}function T(F,Y){var k=Y[0],N=Y[1],$=Y[2],x=Y[3],E=Math.sqrt(k*k+N*N+$*$),D=Math.exp(x),j=E>0?D*Math.sin(E)/E:0;return F[0]=k*j,F[1]=N*j,F[2]=$*j,F[3]=D*Math.cos(E),F;}function f(F,Y){var k=Y[0],N=Y[1],$=Y[2],x=Y[3],E=Math.sqrt(k*k+N*N+$*$),D=E>0?Math.atan2(E,x)/E:0;return F[0]=k*D,F[1]=N*D,F[2]=$*D,F[3]=0.5*Math.log(k*k+N*N+$*$+x*x),F;}function d(F,Y,k){return f(F,Y),K(F,F,k),T(F,F),F;}function u(F,Y,k,N){var $=Y[0],x=Y[1],E=Y[2],D=Y[3],j=k[0],H=k[1],V=k[2],Q=k[3],nt,st,ft,pt,lt;return st=$*j+x*H+E*V+D*Q,st<0&&(st=-st,j=-j,H=-H,V=-V,Q=-Q),1-st>e.EPSILON?(nt=Math.acos(st),ft=Math.sin(nt),pt=Math.sin((1-N)*nt)/ft,lt=Math.sin(N*nt)/ft):(pt=1-N,lt=N),F[0]=pt*$+lt*j,F[1]=pt*x+lt*H,F[2]=pt*E+lt*V,F[3]=pt*D+lt*Q,F;}function g(F){var Y=e.RANDOM(),k=e.RANDOM(),N=e.RANDOM(),$=Math.sqrt(1-Y),x=Math.sqrt(Y);return F[0]=$*Math.sin(2*Math.PI*k),F[1]=$*Math.cos(2*Math.PI*k),F[2]=x*Math.sin(2*Math.PI*N),F[3]=x*Math.cos(2*Math.PI*N),F;}function M(F,Y){var k=Y[0],N=Y[1],$=Y[2],x=Y[3],E=k*k+N*N+$*$+x*x,D=E?1/E:0;return F[0]=-k*D,F[1]=-N*D,F[2]=-$*D,F[3]=x*D,F;}function C(F,Y){return F[0]=-Y[0],F[1]=-Y[1],F[2]=-Y[2],F[3]=Y[3],F;}function A(F,Y){var k=Y[0]+Y[4]+Y[8],N;if(k>0)N=Math.sqrt(k+1),F[3]=0.5*N,N=0.5/N,F[0]=(Y[5]-Y[7])*N,F[1]=(Y[6]-Y[2])*N,F[2]=(Y[1]-Y[3])*N;else{var $=0;Y[4]>Y[0]&&($=1),Y[8]>Y[$*3+$]&&($=2);var x=($+1)%3,E=($+2)%3;N=Math.sqrt(Y[$*3+$]-Y[x*3+x]-Y[E*3+E]+1),F[$]=0.5*N,N=0.5/N,F[3]=(Y[x*3+E]-Y[E*3+x])*N,F[x]=(Y[x*3+$]+Y[$*3+x])*N,F[E]=(Y[E*3+$]+Y[$*3+E])*N;}return F;}function L(F,Y,k,N){var $=0.5*Math.PI/180;Y*=$,k*=$,N*=$;var x=Math.sin(Y),E=Math.cos(Y),D=Math.sin(k),j=Math.cos(k),H=Math.sin(N),V=Math.cos(N);return F[0]=x*j*V-E*D*H,F[1]=E*D*V+x*j*H,F[2]=E*j*H-x*D*V,F[3]=E*j*V+x*D*H,F;}function O(F){return"quat("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}var w=a.clone,b=a.fromValues,I=a.copy,R=a.set,W=a.add,z=p,K=a.scale,J=a.dot,q=a.lerp,U=a.length,G=U,Z=a.squaredLength,rt=Z,et=a.normalize,it=a.exactEquals,X=a.equals,ct=function(){var F=i.create(),Y=i.fromValues(1,0,0),k=i.fromValues(0,1,0);return function(N,$,x){var E=i.dot($,x);return E<-0.999999?(i.cross(F,Y,$),i.len(F)<1e-6&&i.cross(F,k,$),i.normalize(F,F),c(N,F,Math.PI),N):E>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(F,$,x),N[0]=F[0],N[1]=F[1],N[2]=F[2],N[3]=1+E,et(N,N));};}(),ut=function(){var F=o(),Y=o();return function(k,N,$,x,E,D){return u(F,N,E,D),u(Y,$,x,D),u(k,F,Y,2*D*(1-D)),k;};}(),B=function(){var F=n.create();return function(Y,k,N,$){return F[0]=N[0],F[3]=N[1],F[6]=N[2],F[1]=$[0],F[4]=$[1],F[7]=$[2],F[2]=-k[0],F[5]=-k[1],F[8]=-k[2],et(Y,A(Y,F));};}();},/* 8 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"length",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return c;}),t.d(r,"add",function(){return m;}),t.d(r,"subtract",function(){return l;}),t.d(r,"multiply",function(){return p;}),t.d(r,"divide",function(){return y;}),t.d(r,"ceil",function(){return P;}),t.d(r,"floor",function(){return S;}),t.d(r,"min",function(){return v;}),t.d(r,"max",function(){return T;}),t.d(r,"round",function(){return f;}),t.d(r,"scale",function(){return d;}),t.d(r,"scaleAndAdd",function(){return u;}),t.d(r,"distance",function(){return g;}),t.d(r,"squaredDistance",function(){return M;}),t.d(r,"squaredLength",function(){return C;}),t.d(r,"negate",function(){return A;}),t.d(r,"inverse",function(){return L;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return w;}),t.d(r,"cross",function(){return b;}),t.d(r,"lerp",function(){return I;}),t.d(r,"hermite",function(){return R;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return z;}),t.d(r,"transformMat4",function(){return K;}),t.d(r,"transformMat3",function(){return J;}),t.d(r,"transformQuat",function(){return q;}),t.d(r,"rotateX",function(){return U;}),t.d(r,"rotateY",function(){return G;}),t.d(r,"rotateZ",function(){return Z;}),t.d(r,"angle",function(){return rt;}),t.d(r,"zero",function(){return et;}),t.d(r,"str",function(){return it;}),t.d(r,"exactEquals",function(){return X;}),t.d(r,"equals",function(){return ct;}),t.d(r,"sub",function(){return ut;}),t.d(r,"mul",function(){return B;}),t.d(r,"div",function(){return F;}),t.d(r,"dist",function(){return Y;}),t.d(r,"sqrDist",function(){return k;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return $;}),t.d(r,"forEach",function(){return x;});var e=t(2);function n(){var E=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(E[0]=0,E[1]=0,E[2]=0),E;}function i(E){var D=new e.ARRAY_TYPE(3);return D[0]=E[0],D[1]=E[1],D[2]=E[2],D;}function a(E){var D=E[0],j=E[1],H=E[2];return Math.hypot(D,j,H);}function o(E,D,j){var H=new e.ARRAY_TYPE(3);return H[0]=E,H[1]=D,H[2]=j,H;}function s(E,D){return E[0]=D[0],E[1]=D[1],E[2]=D[2],E;}function c(E,D,j,H){return E[0]=D,E[1]=j,E[2]=H,E;}function m(E,D,j){return E[0]=D[0]+j[0],E[1]=D[1]+j[1],E[2]=D[2]+j[2],E;}function l(E,D,j){return E[0]=D[0]-j[0],E[1]=D[1]-j[1],E[2]=D[2]-j[2],E;}function p(E,D,j){return E[0]=D[0]*j[0],E[1]=D[1]*j[1],E[2]=D[2]*j[2],E;}function y(E,D,j){return E[0]=D[0]/j[0],E[1]=D[1]/j[1],E[2]=D[2]/j[2],E;}function P(E,D){return E[0]=Math.ceil(D[0]),E[1]=Math.ceil(D[1]),E[2]=Math.ceil(D[2]),E;}function S(E,D){return E[0]=Math.floor(D[0]),E[1]=Math.floor(D[1]),E[2]=Math.floor(D[2]),E;}function v(E,D,j){return E[0]=Math.min(D[0],j[0]),E[1]=Math.min(D[1],j[1]),E[2]=Math.min(D[2],j[2]),E;}function T(E,D,j){return E[0]=Math.max(D[0],j[0]),E[1]=Math.max(D[1],j[1]),E[2]=Math.max(D[2],j[2]),E;}function f(E,D){return E[0]=Math.round(D[0]),E[1]=Math.round(D[1]),E[2]=Math.round(D[2]),E;}function d(E,D,j){return E[0]=D[0]*j,E[1]=D[1]*j,E[2]=D[2]*j,E;}function u(E,D,j,H){return E[0]=D[0]+j[0]*H,E[1]=D[1]+j[1]*H,E[2]=D[2]+j[2]*H,E;}function g(E,D){var j=D[0]-E[0],H=D[1]-E[1],V=D[2]-E[2];return Math.hypot(j,H,V);}function M(E,D){var j=D[0]-E[0],H=D[1]-E[1],V=D[2]-E[2];return j*j+H*H+V*V;}function C(E){var D=E[0],j=E[1],H=E[2];return D*D+j*j+H*H;}function A(E,D){return E[0]=-D[0],E[1]=-D[1],E[2]=-D[2],E;}function L(E,D){return E[0]=1/D[0],E[1]=1/D[1],E[2]=1/D[2],E;}function O(E,D){var j=D[0],H=D[1],V=D[2],Q=j*j+H*H+V*V;return Q>0&&(Q=1/Math.sqrt(Q)),E[0]=D[0]*Q,E[1]=D[1]*Q,E[2]=D[2]*Q,E;}function w(E,D){return E[0]*D[0]+E[1]*D[1]+E[2]*D[2];}function b(E,D,j){var H=D[0],V=D[1],Q=D[2],nt=j[0],st=j[1],ft=j[2];return E[0]=V*ft-Q*st,E[1]=Q*nt-H*ft,E[2]=H*st-V*nt,E;}function I(E,D,j,H){var V=D[0],Q=D[1],nt=D[2];return E[0]=V+H*(j[0]-V),E[1]=Q+H*(j[1]-Q),E[2]=nt+H*(j[2]-nt),E;}function R(E,D,j,H,V,Q){var nt=Q*Q,st=nt*(2*Q-3)+1,ft=nt*(Q-2)+Q,pt=nt*(Q-1),lt=nt*(3-2*Q);return E[0]=D[0]*st+j[0]*ft+H[0]*pt+V[0]*lt,E[1]=D[1]*st+j[1]*ft+H[1]*pt+V[1]*lt,E[2]=D[2]*st+j[2]*ft+H[2]*pt+V[2]*lt,E;}function W(E,D,j,H,V,Q){var nt=1-Q,st=nt*nt,ft=Q*Q,pt=st*nt,lt=3*Q*st,at=3*ft*nt,ht=ft*Q;return E[0]=D[0]*pt+j[0]*lt+H[0]*at+V[0]*ht,E[1]=D[1]*pt+j[1]*lt+H[1]*at+V[1]*ht,E[2]=D[2]*pt+j[2]*lt+H[2]*at+V[2]*ht,E;}function z(E,D){D=D||1;var j=e.RANDOM()*2*Math.PI,H=e.RANDOM()*2-1,V=Math.sqrt(1-H*H)*D;return E[0]=Math.cos(j)*V,E[1]=Math.sin(j)*V,E[2]=H*D,E;}function K(E,D,j){var H=D[0],V=D[1],Q=D[2],nt=j[3]*H+j[7]*V+j[11]*Q+j[15];return nt=nt||1,E[0]=(j[0]*H+j[4]*V+j[8]*Q+j[12])/nt,E[1]=(j[1]*H+j[5]*V+j[9]*Q+j[13])/nt,E[2]=(j[2]*H+j[6]*V+j[10]*Q+j[14])/nt,E;}function J(E,D,j){var H=D[0],V=D[1],Q=D[2];return E[0]=H*j[0]+V*j[3]+Q*j[6],E[1]=H*j[1]+V*j[4]+Q*j[7],E[2]=H*j[2]+V*j[5]+Q*j[8],E;}function q(E,D,j){var H=j[0],V=j[1],Q=j[2],nt=j[3],st=D[0],ft=D[1],pt=D[2],lt=V*pt-Q*ft,at=Q*st-H*pt,ht=H*ft-V*st,mt=V*ht-Q*at,yt=Q*lt-H*ht,gt=H*at-V*lt,Mt=nt*2;return lt*=Mt,at*=Mt,ht*=Mt,mt*=2,yt*=2,gt*=2,E[0]=st+lt+mt,E[1]=ft+at+yt,E[2]=pt+ht+gt,E;}function U(E,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[0],Q[1]=V[1]*Math.cos(H)-V[2]*Math.sin(H),Q[2]=V[1]*Math.sin(H)+V[2]*Math.cos(H),E[0]=Q[0]+j[0],E[1]=Q[1]+j[1],E[2]=Q[2]+j[2],E;}function G(E,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[2]*Math.sin(H)+V[0]*Math.cos(H),Q[1]=V[1],Q[2]=V[2]*Math.cos(H)-V[0]*Math.sin(H),E[0]=Q[0]+j[0],E[1]=Q[1]+j[1],E[2]=Q[2]+j[2],E;}function Z(E,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[0]*Math.cos(H)-V[1]*Math.sin(H),Q[1]=V[0]*Math.sin(H)+V[1]*Math.cos(H),Q[2]=V[2],E[0]=Q[0]+j[0],E[1]=Q[1]+j[1],E[2]=Q[2]+j[2],E;}function rt(E,D){var j=E[0],H=E[1],V=E[2],Q=D[0],nt=D[1],st=D[2],ft=Math.sqrt(j*j+H*H+V*V),pt=Math.sqrt(Q*Q+nt*nt+st*st),lt=ft*pt,at=lt&&w(E,D)/lt;return Math.acos(Math.min(Math.max(at,-1),1));}function et(E){return E[0]=0,E[1]=0,E[2]=0,E;}function it(E){return"vec3("+E[0]+", "+E[1]+", "+E[2]+")";}function X(E,D){return E[0]===D[0]&&E[1]===D[1]&&E[2]===D[2];}function ct(E,D){var j=E[0],H=E[1],V=E[2],Q=D[0],nt=D[1],st=D[2];return Math.abs(j-Q)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Q))&&Math.abs(H-nt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(nt))&&Math.abs(V-st)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(st));}var ut=l,B=p,F=y,Y=g,k=M,N=a,$=C,x=function(){var E=n();return function(D,j,H,V,Q,nt){var st,ft;for(j||(j=3),H||(H=0),V?ft=Math.min(V*j+H,D.length):ft=D.length,st=H;st<ft;st+=j)E[0]=D[st],E[1]=D[st+1],E[2]=D[st+2],Q(E,E,nt),D[st]=E[0],D[st+1]=E[1],D[st+2]=E[2];return D;};}();},/* 9 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return c;}),t.d(r,"subtract",function(){return m;}),t.d(r,"multiply",function(){return l;}),t.d(r,"divide",function(){return p;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return P;}),t.d(r,"min",function(){return S;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return T;}),t.d(r,"scale",function(){return f;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return C;}),t.d(r,"negate",function(){return A;}),t.d(r,"inverse",function(){return L;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return w;}),t.d(r,"cross",function(){return b;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return R;}),t.d(r,"transformMat4",function(){return W;}),t.d(r,"transformQuat",function(){return z;}),t.d(r,"zero",function(){return K;}),t.d(r,"str",function(){return J;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return U;}),t.d(r,"sub",function(){return G;}),t.d(r,"mul",function(){return Z;}),t.d(r,"div",function(){return rt;}),t.d(r,"dist",function(){return et;}),t.d(r,"sqrDist",function(){return it;}),t.d(r,"len",function(){return X;}),t.d(r,"sqrLen",function(){return ct;}),t.d(r,"forEach",function(){return ut;});var e=t(2);function n(){var B=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[3]=0),B;}function i(B){var F=new e.ARRAY_TYPE(4);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F;}function a(B,F,Y,k){var N=new e.ARRAY_TYPE(4);return N[0]=B,N[1]=F,N[2]=Y,N[3]=k,N;}function o(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B;}function s(B,F,Y,k,N){return B[0]=F,B[1]=Y,B[2]=k,B[3]=N,B;}function c(B,F,Y){return B[0]=F[0]+Y[0],B[1]=F[1]+Y[1],B[2]=F[2]+Y[2],B[3]=F[3]+Y[3],B;}function m(B,F,Y){return B[0]=F[0]-Y[0],B[1]=F[1]-Y[1],B[2]=F[2]-Y[2],B[3]=F[3]-Y[3],B;}function l(B,F,Y){return B[0]=F[0]*Y[0],B[1]=F[1]*Y[1],B[2]=F[2]*Y[2],B[3]=F[3]*Y[3],B;}function p(B,F,Y){return B[0]=F[0]/Y[0],B[1]=F[1]/Y[1],B[2]=F[2]/Y[2],B[3]=F[3]/Y[3],B;}function y(B,F){return B[0]=Math.ceil(F[0]),B[1]=Math.ceil(F[1]),B[2]=Math.ceil(F[2]),B[3]=Math.ceil(F[3]),B;}function P(B,F){return B[0]=Math.floor(F[0]),B[1]=Math.floor(F[1]),B[2]=Math.floor(F[2]),B[3]=Math.floor(F[3]),B;}function S(B,F,Y){return B[0]=Math.min(F[0],Y[0]),B[1]=Math.min(F[1],Y[1]),B[2]=Math.min(F[2],Y[2]),B[3]=Math.min(F[3],Y[3]),B;}function v(B,F,Y){return B[0]=Math.max(F[0],Y[0]),B[1]=Math.max(F[1],Y[1]),B[2]=Math.max(F[2],Y[2]),B[3]=Math.max(F[3],Y[3]),B;}function T(B,F){return B[0]=Math.round(F[0]),B[1]=Math.round(F[1]),B[2]=Math.round(F[2]),B[3]=Math.round(F[3]),B;}function f(B,F,Y){return B[0]=F[0]*Y,B[1]=F[1]*Y,B[2]=F[2]*Y,B[3]=F[3]*Y,B;}function d(B,F,Y,k){return B[0]=F[0]+Y[0]*k,B[1]=F[1]+Y[1]*k,B[2]=F[2]+Y[2]*k,B[3]=F[3]+Y[3]*k,B;}function u(B,F){var Y=F[0]-B[0],k=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return Math.hypot(Y,k,N,$);}function g(B,F){var Y=F[0]-B[0],k=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return Y*Y+k*k+N*N+$*$;}function M(B){var F=B[0],Y=B[1],k=B[2],N=B[3];return Math.hypot(F,Y,k,N);}function C(B){var F=B[0],Y=B[1],k=B[2],N=B[3];return F*F+Y*Y+k*k+N*N;}function A(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=-F[3],B;}function L(B,F){return B[0]=1/F[0],B[1]=1/F[1],B[2]=1/F[2],B[3]=1/F[3],B;}function O(B,F){var Y=F[0],k=F[1],N=F[2],$=F[3],x=Y*Y+k*k+N*N+$*$;return x>0&&(x=1/Math.sqrt(x)),B[0]=Y*x,B[1]=k*x,B[2]=N*x,B[3]=$*x,B;}function w(B,F){return B[0]*F[0]+B[1]*F[1]+B[2]*F[2]+B[3]*F[3];}function b(B,F,Y,k){var N=Y[0]*k[1]-Y[1]*k[0],$=Y[0]*k[2]-Y[2]*k[0],x=Y[0]*k[3]-Y[3]*k[0],E=Y[1]*k[2]-Y[2]*k[1],D=Y[1]*k[3]-Y[3]*k[1],j=Y[2]*k[3]-Y[3]*k[2],H=F[0],V=F[1],Q=F[2],nt=F[3];return B[0]=V*j-Q*D+nt*E,B[1]=-(H*j)+Q*x-nt*$,B[2]=H*D-V*x+nt*N,B[3]=-(H*E)+V*$-Q*N,B;}function I(B,F,Y,k){var N=F[0],$=F[1],x=F[2],E=F[3];return B[0]=N+k*(Y[0]-N),B[1]=$+k*(Y[1]-$),B[2]=x+k*(Y[2]-x),B[3]=E+k*(Y[3]-E),B;}function R(B,F){F=F||1;var Y,k,N,$,x,E;do Y=e.RANDOM()*2-1,k=e.RANDOM()*2-1,x=Y*Y+k*k;while(x>=1);do N=e.RANDOM()*2-1,$=e.RANDOM()*2-1,E=N*N+$*$;while(E>=1);var D=Math.sqrt((1-x)/E);return B[0]=F*Y,B[1]=F*k,B[2]=F*N*D,B[3]=F*$*D,B;}function W(B,F,Y){var k=F[0],N=F[1],$=F[2],x=F[3];return B[0]=Y[0]*k+Y[4]*N+Y[8]*$+Y[12]*x,B[1]=Y[1]*k+Y[5]*N+Y[9]*$+Y[13]*x,B[2]=Y[2]*k+Y[6]*N+Y[10]*$+Y[14]*x,B[3]=Y[3]*k+Y[7]*N+Y[11]*$+Y[15]*x,B;}function z(B,F,Y){var k=F[0],N=F[1],$=F[2],x=Y[0],E=Y[1],D=Y[2],j=Y[3],H=j*k+E*$-D*N,V=j*N+D*k-x*$,Q=j*$+x*N-E*k,nt=-x*k-E*N-D*$;return B[0]=H*j+nt*-x+V*-D-Q*-E,B[1]=V*j+nt*-E+Q*-x-H*-D,B[2]=Q*j+nt*-D+H*-E-V*-x,B[3]=F[3],B;}function K(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=0,B;}function J(B){return"vec4("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+")";}function q(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3];}function U(B,F){var Y=B[0],k=B[1],N=B[2],$=B[3],x=F[0],E=F[1],D=F[2],j=F[3];return Math.abs(Y-x)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(x))&&Math.abs(k-E)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(E))&&Math.abs(N-D)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(D))&&Math.abs($-j)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(j));}var G=m,Z=l,rt=p,et=u,it=g,X=M,ct=C,ut=function(){var B=n();return function(F,Y,k,N,$,x){var E,D;for(Y||(Y=4),k||(k=0),N?D=Math.min(N*Y+k,F.length):D=F.length,E=k;E<D;E+=Y)B[0]=F[E],B[1]=F[E+1],B[2]=F[E+2],B[3]=F[E+3],$(B,B,x),F[E]=B[0],F[E+1]=B[1],F[E+2]=B[2],F[E+3]=B[3];return F;};}();},/* 10 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return a;}),t.d(r,"clone",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"fromRotationTranslationValues",function(){return c;}),t.d(r,"fromRotationTranslation",function(){return m;}),t.d(r,"fromTranslation",function(){return l;}),t.d(r,"fromRotation",function(){return p;}),t.d(r,"fromMat4",function(){return y;}),t.d(r,"copy",function(){return P;}),t.d(r,"identity",function(){return S;}),t.d(r,"set",function(){return v;}),t.d(r,"getReal",function(){return T;}),t.d(r,"getDual",function(){return f;}),t.d(r,"setReal",function(){return d;}),t.d(r,"setDual",function(){return u;}),t.d(r,"getTranslation",function(){return g;}),t.d(r,"translate",function(){return M;}),t.d(r,"rotateX",function(){return C;}),t.d(r,"rotateY",function(){return A;}),t.d(r,"rotateZ",function(){return L;}),t.d(r,"rotateByQuatAppend",function(){return O;}),t.d(r,"rotateByQuatPrepend",function(){return w;}),t.d(r,"rotateAroundAxis",function(){return b;}),t.d(r,"add",function(){return I;}),t.d(r,"multiply",function(){return R;}),t.d(r,"mul",function(){return W;}),t.d(r,"scale",function(){return z;}),t.d(r,"dot",function(){return K;}),t.d(r,"lerp",function(){return J;}),t.d(r,"invert",function(){return q;}),t.d(r,"conjugate",function(){return U;}),t.d(r,"length",function(){return G;}),t.d(r,"len",function(){return Z;}),t.d(r,"squaredLength",function(){return rt;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return it;}),t.d(r,"str",function(){return X;}),t.d(r,"exactEquals",function(){return ct;}),t.d(r,"equals",function(){return ut;});var e=t(2),n=t(7),i=t(6);function a(){var B=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[4]=0,B[5]=0,B[6]=0,B[7]=0),B[3]=1,B;}function o(B){var F=new e.ARRAY_TYPE(8);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F[4]=B[4],F[5]=B[5],F[6]=B[6],F[7]=B[7],F;}function s(B,F,Y,k,N,$,x,E){var D=new e.ARRAY_TYPE(8);return D[0]=B,D[1]=F,D[2]=Y,D[3]=k,D[4]=N,D[5]=$,D[6]=x,D[7]=E,D;}function c(B,F,Y,k,N,$,x){var E=new e.ARRAY_TYPE(8);E[0]=B,E[1]=F,E[2]=Y,E[3]=k;var D=N*0.5,j=$*0.5,H=x*0.5;return E[4]=D*k+j*Y-H*F,E[5]=j*k+H*B-D*Y,E[6]=H*k+D*F-j*B,E[7]=-D*B-j*F-H*Y,E;}function m(B,F,Y){var k=Y[0]*0.5,N=Y[1]*0.5,$=Y[2]*0.5,x=F[0],E=F[1],D=F[2],j=F[3];return B[0]=x,B[1]=E,B[2]=D,B[3]=j,B[4]=k*j+N*D-$*E,B[5]=N*j+$*x-k*D,B[6]=$*j+k*E-N*x,B[7]=-k*x-N*E-$*D,B;}function l(B,F){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=F[0]*0.5,B[5]=F[1]*0.5,B[6]=F[2]*0.5,B[7]=0,B;}function p(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function y(B,F){var Y=n.create();i.getRotation(Y,F);var k=new e.ARRAY_TYPE(3);return i.getTranslation(k,F),m(B,Y,k),B;}function P(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=F[4],B[5]=F[5],B[6]=F[6],B[7]=F[7],B;}function S(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function v(B,F,Y,k,N,$,x,E,D){return B[0]=F,B[1]=Y,B[2]=k,B[3]=N,B[4]=$,B[5]=x,B[6]=E,B[7]=D,B;}var T=n.copy;function f(B,F){return B[0]=F[4],B[1]=F[5],B[2]=F[6],B[3]=F[7],B;}var d=n.copy;function u(B,F){return B[4]=F[0],B[5]=F[1],B[6]=F[2],B[7]=F[3],B;}function g(B,F){var Y=F[4],k=F[5],N=F[6],$=F[7],x=-F[0],E=-F[1],D=-F[2],j=F[3];return B[0]=(Y*j+$*x+k*D-N*E)*2,B[1]=(k*j+$*E+N*x-Y*D)*2,B[2]=(N*j+$*D+Y*E-k*x)*2,B;}function M(B,F,Y){var k=F[0],N=F[1],$=F[2],x=F[3],E=Y[0]*0.5,D=Y[1]*0.5,j=Y[2]*0.5,H=F[4],V=F[5],Q=F[6],nt=F[7];return B[0]=k,B[1]=N,B[2]=$,B[3]=x,B[4]=x*E+N*j-$*D+H,B[5]=x*D+$*E-k*j+V,B[6]=x*j+k*D-N*E+Q,B[7]=-k*E-N*D-$*j+nt,B;}function C(B,F,Y){var k=-F[0],N=-F[1],$=-F[2],x=F[3],E=F[4],D=F[5],j=F[6],H=F[7],V=E*x+H*k+D*$-j*N,Q=D*x+H*N+j*k-E*$,nt=j*x+H*$+E*N-D*k,st=H*x-E*k-D*N-j*$;return n.rotateX(B,F,Y),k=B[0],N=B[1],$=B[2],x=B[3],B[4]=V*x+st*k+Q*$-nt*N,B[5]=Q*x+st*N+nt*k-V*$,B[6]=nt*x+st*$+V*N-Q*k,B[7]=st*x-V*k-Q*N-nt*$,B;}function A(B,F,Y){var k=-F[0],N=-F[1],$=-F[2],x=F[3],E=F[4],D=F[5],j=F[6],H=F[7],V=E*x+H*k+D*$-j*N,Q=D*x+H*N+j*k-E*$,nt=j*x+H*$+E*N-D*k,st=H*x-E*k-D*N-j*$;return n.rotateY(B,F,Y),k=B[0],N=B[1],$=B[2],x=B[3],B[4]=V*x+st*k+Q*$-nt*N,B[5]=Q*x+st*N+nt*k-V*$,B[6]=nt*x+st*$+V*N-Q*k,B[7]=st*x-V*k-Q*N-nt*$,B;}function L(B,F,Y){var k=-F[0],N=-F[1],$=-F[2],x=F[3],E=F[4],D=F[5],j=F[6],H=F[7],V=E*x+H*k+D*$-j*N,Q=D*x+H*N+j*k-E*$,nt=j*x+H*$+E*N-D*k,st=H*x-E*k-D*N-j*$;return n.rotateZ(B,F,Y),k=B[0],N=B[1],$=B[2],x=B[3],B[4]=V*x+st*k+Q*$-nt*N,B[5]=Q*x+st*N+nt*k-V*$,B[6]=nt*x+st*$+V*N-Q*k,B[7]=st*x-V*k-Q*N-nt*$,B;}function O(B,F,Y){var k=Y[0],N=Y[1],$=Y[2],x=Y[3],E=F[0],D=F[1],j=F[2],H=F[3];return B[0]=E*x+H*k+D*$-j*N,B[1]=D*x+H*N+j*k-E*$,B[2]=j*x+H*$+E*N-D*k,B[3]=H*x-E*k-D*N-j*$,E=F[4],D=F[5],j=F[6],H=F[7],B[4]=E*x+H*k+D*$-j*N,B[5]=D*x+H*N+j*k-E*$,B[6]=j*x+H*$+E*N-D*k,B[7]=H*x-E*k-D*N-j*$,B;}function w(B,F,Y){var k=F[0],N=F[1],$=F[2],x=F[3],E=Y[0],D=Y[1],j=Y[2],H=Y[3];return B[0]=k*H+x*E+N*j-$*D,B[1]=N*H+x*D+$*E-k*j,B[2]=$*H+x*j+k*D-N*E,B[3]=x*H-k*E-N*D-$*j,E=Y[4],D=Y[5],j=Y[6],H=Y[7],B[4]=k*H+x*E+N*j-$*D,B[5]=N*H+x*D+$*E-k*j,B[6]=$*H+x*j+k*D-N*E,B[7]=x*H-k*E-N*D-$*j,B;}function b(B,F,Y,k){if(Math.abs(k)<e.EPSILON)return P(B,F);var N=Math.hypot(Y[0],Y[1],Y[2]);k=k*0.5;var $=Math.sin(k),x=$*Y[0]/N,E=$*Y[1]/N,D=$*Y[2]/N,j=Math.cos(k),H=F[0],V=F[1],Q=F[2],nt=F[3];B[0]=H*j+nt*x+V*D-Q*E,B[1]=V*j+nt*E+Q*x-H*D,B[2]=Q*j+nt*D+H*E-V*x,B[3]=nt*j-H*x-V*E-Q*D;var st=F[4],ft=F[5],pt=F[6],lt=F[7];return B[4]=st*j+lt*x+ft*D-pt*E,B[5]=ft*j+lt*E+pt*x-st*D,B[6]=pt*j+lt*D+st*E-ft*x,B[7]=lt*j-st*x-ft*E-pt*D,B;}function I(B,F,Y){return B[0]=F[0]+Y[0],B[1]=F[1]+Y[1],B[2]=F[2]+Y[2],B[3]=F[3]+Y[3],B[4]=F[4]+Y[4],B[5]=F[5]+Y[5],B[6]=F[6]+Y[6],B[7]=F[7]+Y[7],B;}function R(B,F,Y){var k=F[0],N=F[1],$=F[2],x=F[3],E=Y[4],D=Y[5],j=Y[6],H=Y[7],V=F[4],Q=F[5],nt=F[6],st=F[7],ft=Y[0],pt=Y[1],lt=Y[2],at=Y[3];return B[0]=k*at+x*ft+N*lt-$*pt,B[1]=N*at+x*pt+$*ft-k*lt,B[2]=$*at+x*lt+k*pt-N*ft,B[3]=x*at-k*ft-N*pt-$*lt,B[4]=k*H+x*E+N*j-$*D+V*at+st*ft+Q*lt-nt*pt,B[5]=N*H+x*D+$*E-k*j+Q*at+st*pt+nt*ft-V*lt,B[6]=$*H+x*j+k*D-N*E+nt*at+st*lt+V*pt-Q*ft,B[7]=x*H-k*E-N*D-$*j+st*at-V*ft-Q*pt-nt*lt,B;}var W=R;function z(B,F,Y){return B[0]=F[0]*Y,B[1]=F[1]*Y,B[2]=F[2]*Y,B[3]=F[3]*Y,B[4]=F[4]*Y,B[5]=F[5]*Y,B[6]=F[6]*Y,B[7]=F[7]*Y,B;}var K=n.dot;function J(B,F,Y,k){var N=1-k;return K(F,Y)<0&&(k=-k),B[0]=F[0]*N+Y[0]*k,B[1]=F[1]*N+Y[1]*k,B[2]=F[2]*N+Y[2]*k,B[3]=F[3]*N+Y[3]*k,B[4]=F[4]*N+Y[4]*k,B[5]=F[5]*N+Y[5]*k,B[6]=F[6]*N+Y[6]*k,B[7]=F[7]*N+Y[7]*k,B;}function q(B,F){var Y=rt(F);return B[0]=-F[0]/Y,B[1]=-F[1]/Y,B[2]=-F[2]/Y,B[3]=F[3]/Y,B[4]=-F[4]/Y,B[5]=-F[5]/Y,B[6]=-F[6]/Y,B[7]=F[7]/Y,B;}function U(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=F[3],B[4]=-F[4],B[5]=-F[5],B[6]=-F[6],B[7]=F[7],B;}var G=n.length,Z=G,rt=n.squaredLength,et=rt;function it(B,F){var Y=rt(F);if(Y>0){Y=Math.sqrt(Y);var k=F[0]/Y,N=F[1]/Y,$=F[2]/Y,x=F[3]/Y,E=F[4],D=F[5],j=F[6],H=F[7],V=k*E+N*D+$*j+x*H;B[0]=k,B[1]=N,B[2]=$,B[3]=x,B[4]=(E-k*V)/Y,B[5]=(D-N*V)/Y,B[6]=(j-$*V)/Y,B[7]=(H-x*V)/Y;}return B;}function X(B){return"quat2("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+")";}function ct(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3]&&B[4]===F[4]&&B[5]===F[5]&&B[6]===F[6]&&B[7]===F[7];}function ut(B,F){var Y=B[0],k=B[1],N=B[2],$=B[3],x=B[4],E=B[5],D=B[6],j=B[7],H=F[0],V=F[1],Q=F[2],nt=F[3],st=F[4],ft=F[5],pt=F[6],lt=F[7];return Math.abs(Y-H)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(H))&&Math.abs(k-V)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(V))&&Math.abs(N-Q)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(Q))&&Math.abs($-nt)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(nt))&&Math.abs(x-st)<=e.EPSILON*Math.max(1,Math.abs(x),Math.abs(st))&&Math.abs(E-ft)<=e.EPSILON*Math.max(1,Math.abs(E),Math.abs(ft))&&Math.abs(D-pt)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(pt))&&Math.abs(j-lt)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(lt));}},/* 11 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return c;}),t.d(r,"subtract",function(){return m;}),t.d(r,"multiply",function(){return l;}),t.d(r,"divide",function(){return p;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return P;}),t.d(r,"min",function(){return S;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return T;}),t.d(r,"scale",function(){return f;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return C;}),t.d(r,"negate",function(){return A;}),t.d(r,"inverse",function(){return L;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return w;}),t.d(r,"cross",function(){return b;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return R;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return z;}),t.d(r,"transformMat3",function(){return K;}),t.d(r,"transformMat4",function(){return J;}),t.d(r,"rotate",function(){return q;}),t.d(r,"angle",function(){return U;}),t.d(r,"zero",function(){return G;}),t.d(r,"str",function(){return Z;}),t.d(r,"exactEquals",function(){return rt;}),t.d(r,"equals",function(){return et;}),t.d(r,"len",function(){return it;}),t.d(r,"sub",function(){return X;}),t.d(r,"mul",function(){return ct;}),t.d(r,"div",function(){return ut;}),t.d(r,"dist",function(){return B;}),t.d(r,"sqrDist",function(){return F;}),t.d(r,"sqrLen",function(){return Y;}),t.d(r,"forEach",function(){return k;});var e=t(2);function n(){var N=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0),N;}function i(N){var $=new e.ARRAY_TYPE(2);return $[0]=N[0],$[1]=N[1],$;}function a(N,$){var x=new e.ARRAY_TYPE(2);return x[0]=N,x[1]=$,x;}function o(N,$){return N[0]=$[0],N[1]=$[1],N;}function s(N,$,x){return N[0]=$,N[1]=x,N;}function c(N,$,x){return N[0]=$[0]+x[0],N[1]=$[1]+x[1],N;}function m(N,$,x){return N[0]=$[0]-x[0],N[1]=$[1]-x[1],N;}function l(N,$,x){return N[0]=$[0]*x[0],N[1]=$[1]*x[1],N;}function p(N,$,x){return N[0]=$[0]/x[0],N[1]=$[1]/x[1],N;}function y(N,$){return N[0]=Math.ceil($[0]),N[1]=Math.ceil($[1]),N;}function P(N,$){return N[0]=Math.floor($[0]),N[1]=Math.floor($[1]),N;}function S(N,$,x){return N[0]=Math.min($[0],x[0]),N[1]=Math.min($[1],x[1]),N;}function v(N,$,x){return N[0]=Math.max($[0],x[0]),N[1]=Math.max($[1],x[1]),N;}function T(N,$){return N[0]=Math.round($[0]),N[1]=Math.round($[1]),N;}function f(N,$,x){return N[0]=$[0]*x,N[1]=$[1]*x,N;}function d(N,$,x,E){return N[0]=$[0]+x[0]*E,N[1]=$[1]+x[1]*E,N;}function u(N,$){var x=$[0]-N[0],E=$[1]-N[1];return Math.hypot(x,E);}function g(N,$){var x=$[0]-N[0],E=$[1]-N[1];return x*x+E*E;}function M(N){var $=N[0],x=N[1];return Math.hypot($,x);}function C(N){var $=N[0],x=N[1];return $*$+x*x;}function A(N,$){return N[0]=-$[0],N[1]=-$[1],N;}function L(N,$){return N[0]=1/$[0],N[1]=1/$[1],N;}function O(N,$){var x=$[0],E=$[1],D=x*x+E*E;return D>0&&(D=1/Math.sqrt(D)),N[0]=$[0]*D,N[1]=$[1]*D,N;}function w(N,$){return N[0]*$[0]+N[1]*$[1];}function b(N,$,x){var E=$[0]*x[1]-$[1]*x[0];return N[0]=N[1]=0,N[2]=E,N;}function I(N,$,x,E){var D=$[0],j=$[1];return N[0]=D+E*(x[0]-D),N[1]=j+E*(x[1]-j),N;}function R(N,$){$=$||1;var x=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(x)*$,N[1]=Math.sin(x)*$,N;}function W(N,$,x){var E=$[0],D=$[1];return N[0]=x[0]*E+x[2]*D,N[1]=x[1]*E+x[3]*D,N;}function z(N,$,x){var E=$[0],D=$[1];return N[0]=x[0]*E+x[2]*D+x[4],N[1]=x[1]*E+x[3]*D+x[5],N;}function K(N,$,x){var E=$[0],D=$[1];return N[0]=x[0]*E+x[3]*D+x[6],N[1]=x[1]*E+x[4]*D+x[7],N;}function J(N,$,x){var E=$[0],D=$[1];return N[0]=x[0]*E+x[4]*D+x[12],N[1]=x[1]*E+x[5]*D+x[13],N;}function q(N,$,x,E){var D=$[0]-x[0],j=$[1]-x[1],H=Math.sin(E),V=Math.cos(E);return N[0]=D*V-j*H+x[0],N[1]=D*H+j*V+x[1],N;}function U(N,$){var x=N[0],E=N[1],D=$[0],j=$[1],H=Math.sqrt(x*x+E*E)*Math.sqrt(D*D+j*j),V=H&&(x*D+E*j)/H;return Math.acos(Math.min(Math.max(V,-1),1));}function G(N){return N[0]=0,N[1]=0,N;}function Z(N){return"vec2("+N[0]+", "+N[1]+")";}function rt(N,$){return N[0]===$[0]&&N[1]===$[1];}function et(N,$){var x=N[0],E=N[1],D=$[0],j=$[1];return Math.abs(x-D)<=e.EPSILON*Math.max(1,Math.abs(x),Math.abs(D))&&Math.abs(E-j)<=e.EPSILON*Math.max(1,Math.abs(E),Math.abs(j));}var it=M,X=m,ct=l,ut=p,B=u,F=g,Y=C,k=function(){var N=n();return function($,x,E,D,j,H){var V,Q;for(x||(x=2),E||(E=0),D?Q=Math.min(D*x+E,$.length):Q=$.length,V=E;V<Q;V+=x)N[0]=$[V],N[1]=$[V+1],j(N,N,H),$[V]=N[0],$[V+1]=N[1];return $;};}();},/* 12 *//***/function(h,r,t){t.r(r);var e=t(13);t.d(r,"Renderer",function(){return e["default"];});var n=t(40);t.d(r,"Figure2D",function(){return n["default"];});var i=t(56);t.d(r,"Mesh2D",function(){return i["default"];});var a=t(29);t.d(r,"MeshCloud",function(){return a["default"];});var o=t(23);t.d(r,"parseFont",function(){return o["default"];});var s=t(31);t.d(r,"parseColor",function(){return s["default"];});var c=t(21);t.d(r,"ENV",function(){return c["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return L;});var e=t(14),n=t(1),i=t(20),a=t(27),o=t(25),s=t(40),c=t(56),m=t(29),l=t(59),p=t(21),y=t(63);t(1).glMatrix.setMatrixArrayType(Array);var P={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",v="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"),f=Symbol("canvasRenderer"),d=Symbol("options"),u=Symbol("globalTransform"),g=Symbol("applyGlobalTransform"),M=Symbol("canvas");function C(O){var w=O.gl,b=O.fbo;b&&w.bindFramebuffer(w.FRAMEBUFFER,b),O._draw(),b&&w.bindFramebuffer(w.FRAMEBUFFER,null);}function A(O,w,b,I){var R=O.createTexture(w.canvas),W=[[[0,0],[b,0],[b,I],[0,I],[0,0]]];W.closed=!0;var z=new c["default"]({contours:W});z.setTexture(R),O.setMeshData([z.meshData]),C(O),R["delete"](),w.clearRect(0,0,b,I),delete w._filter;}var L=/*#__PURE__*/function(){function L(w){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,L);var I=b.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!w.getContext){var R=w;w={getContext:function getContext(){return R;},width:b.width,height:b.height},R.canvas=w,I="2d";}if(this[M]=w,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(b.contextType=I,this[d]=Object.assign({},P,b),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[d].webgl2=!0);var _R=new e["default"](w,this[d]);I==="webgl2"&&!_R.isWebGL2&&(b.contextType="webgl"),Object(y.createShaders)(_R),Object(y.applyShader)(_R),Object(y.createCloudShaders)(_R);var W=_R.gl;W.clearColor(0,0,0,0),W.blendFuncSeparate(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA,W.ONE,W.ONE_MINUS_SRC_ALPHA),this[T]=_R;}else this[f]=new i["default"](w,this[d]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(L,[{key:"canvas",get:function get(){return this[M];}},{key:"canvasRenderer",get:function get(){return this[f];}},{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[d];}},{key:"globalTransformMatrix",get:function get(){var w=this[u];return[w[0],w[1],w[3],w[4],w[6],w[7]];}},{key:"viewMatrix",get:function get(){return this[u];}},{key:g,value:function value(){var w=this[T]||this[f];if(this[T]){var _this$canvas=this.canvas,b=_this$canvas.width,I=_this$canvas.height;w.uniforms.viewMatrix=this.viewMatrix,w.uniforms.projectionMatrix=this.projectionMatrix,w.uniforms.u_resolution=[b,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,w=_this$canvas2.width,b=_this$canvas2.height,I=[// translation
|
|
35
|
+
1,0,0,0,1,0,-w/2,-b/2,1],R=[// scale
|
|
36
|
+
2/w,0,0,0,-2/b,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,I);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,w,b);}},{key:"createTexture",value:function createTexture(w,b){return(this[T]||this[f]).createTexture(w,b);}/* async */},{key:"loadTexture",value:function loadTexture(w){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$useImageBitmap=_ref3.useImageBitmap,b=_ref3$useImageBitmap===void 0?!1:_ref3$useImageBitmap;return(this[T]||this[f]).loadTexture(w,{useImageBitmap:b});}},{key:"createText",value:function createText(w){var _ref4=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref4$font=_ref4.font,b=_ref4$font===void 0?"16px arial":_ref4$font,_ref4$fillColor=_ref4.fillColor,I=_ref4$fillColor===void 0?null:_ref4$fillColor,_ref4$strokeColor=_ref4.strokeColor,R=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[T]){var z=p["default"].createText(w,{font:b,fillColor:I,strokeColor:R,strokeWidth:W});return{image:this.createTexture(z.image),rect:z.rect};}return{_img:{font:b,fillColor:I,strokeColor:R,strokeWidth:W,text:w}};}},{key:"createProgram",value:function createProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},w=_ref5.vertex,b=_ref5.fragment,I=_ref5.options;if(this[T]){var R=this[T].compileSync(b,w);return R._attribOpts=I,R;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref6$vertex=_ref6.vertex,w=_ref6$vertex===void 0?S:_ref6$vertex,_ref6$fragment=_ref6.fragment,b=_ref6$fragment===void 0?v:_ref6$fragment,I=_ref6.options;return this.createProgram({vertex:w,fragment:b,options:I});}},{key:"useProgram",value:function useProgram(w){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[T]){var I=Object.assign({},w._attribOpts,b);return this[T].useProgram(w,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(w){return(this[T]||this[f]).deleteTexture(w);}},{key:"clear",value:function clear(){var _this$f;if(this[T]){var b=this[T].gl;b.clear(b.COLOR_BUFFER_BIT);}else(_this$f=this[f]).clear.apply(_this$f,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(w){var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,b=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var R=this[T]||this[f],W=I||w.program;if(this[T]){var z=R.gl;if(b&&z.clear(z.COLOR_BUFFER_BIT),W)R.program!==W&&this.useProgram(W,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});else{var K=w.mesh.meshData,J=!!K.uniforms.u_texSampler,q=!!K.uniforms.u_filterFlag,U=!!K.uniforms.u_radialGradientVector,G=w.hasCloudColor,Z=w.hasCloudFilter,rt=!!K.uniforms.u_clipSampler;Object(y.applyCloudShader)(R,{hasTexture:J,hasFilter:q,hasGradient:U,hasCloudColor:G,hasCloudFilter:Z,hasClipPath:rt});}this[g](),R.setMeshData([w.meshData]),w.beforeRender&&w.beforeRender(z,w),C(R),w.afterRender&&w.afterRender(z,w);}else R.setTransform(this.globalTransformMatrix),R.drawMeshCloud(w,{clear:b,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(w){var _this14=this;var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$clear=_ref8.clear,b=_ref8$clear===void 0?!1:_ref8$clear,_ref8$program=_ref8.program,I=_ref8$program===void 0?null:_ref8$program;var R=this[T]||this[f];if(this[T]){var W=R.fbo,z=Object(a["default"])(this,w,I==null),K=R.gl;b&&K.clear(K.COLOR_BUFFER_BIT);var J=!Object(l.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator12=_createForOfIteratorHelper(z),_step12;try{var _loop=function _loop(){var q=_step12.value;_this14._drawCalls++;var U=I||q.program;if(q instanceof m["default"])_this14.drawMeshCloud(q,{clear:b,program:U});else{var _this14$canvas=_this14.canvas,G=_this14$canvas.width,Z=_this14$canvas.height;if(q.beforeRender&&q.beforeRender(K,q),q.pass.length&&((!_this14.fbo||_this14.fbo.width!==G||_this14.fbo.height!==Z)&&(_this14.fbo={width:G,height:Z,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),R.bindFBO(_this14.fbo.target)),!U&&q.filterCanvas){Object(y.applyShader)(R,{hasTexture:!0});var rt=_this14.filterContext;rt||(rt=p["default"].createCanvas(G,Z).getContext("2d"),_this14.filterContext=rt);var et=w[q.packIndex],it=et.filter,X=w[q.packIndex+1],ct=w[q.packIndex-1];(!ct||!ct.filterCanvas||ct.filter!==it)&&(!X||!X.filterCanvas||X.filter!==it)?(J?(rt.save(),Object(o.drawMesh2D)(et,rt,!1),rt.restore(),Object(o.applyFilter)(rt,it)):Object(o.drawMesh2D)(et,rt,!0),_this14[g](),A(R,rt,G,Z)):(J&&rt.save(),Object(o.drawMesh2D)(et,rt,!1),J&&rt.restore(),(!X||!X.filterCanvas||et.filter!==X.filter)&&(Object(o.applyFilter)(rt,it),_this14[g](),A(R,rt,G,Z)));}else{if(U)R.program!==U&&_this14.useProgram(U,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _rt=!!q.uniforms.u_texSampler,_et=!!q.uniforms.u_filterFlag,_it=!!q.uniforms.u_radialGradientVector,_X=!!q.uniforms.u_clipSampler;Object(y.applyShader)(R,{hasTexture:_rt,hasFilter:_et,hasGradient:_it,hasClipPath:_X});}q.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[g](),R.setMeshData([q]),C(R);}if(q.pass.length){var _rt2=q.pass.length;q.pass.forEach(function(et,it){et.blend=q.enableBlend,et.setTexture(R.fbo.texture),it===_rt2-1?R.bindFBO(W):(_this14.fbo.swap(),R.bindFBO(_this14.fbo.target)),et.program?R.useProgram(et.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),R.useProgram(_this14.defaultPassProgram)),R.setMeshData([et.meshData]),K.clear(K.COLOR_BUFFER_BIT),C(R);});}q.afterRender&&q.afterRender(K,q);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else R.setTransform(this.globalTransformMatrix),R.drawMeshes(w,{clear:b});}},{key:"drawImage",value:function drawImage(w){for(var _len=arguments.length,b=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){b[_key-1]=arguments[_key];}var I=b.length;if(I<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(b.length+1," present."));if(I!==2&&I!==4&&I!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(b.length+1," arguments provided."));var R=null,W=null;I===2?R=[b[0],b[1],w.width,w.height]:I===4?R=b:I===8&&(W=b.slice(0,4),R=b.slice(4));var z=this.createTexture(w),_this$canvas3=this.canvas,K=_this$canvas3.width,J=_this$canvas3.height,q=new s["default"]();q.rect(R[0],R[1],K,J);var U=new c["default"](q,{width:K,height:J});U.setTexture(z,{rect:R,srcRect:W}),this.drawMeshes([U]),this.deleteTexture(z);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[u]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var b=this[u];for(var _len2=arguments.length,w=new Array(_len2),_key2=0;_key2<_len2;_key2++){w[_key2]=arguments[_key2];}return this[u]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),b,w),this;}},{key:"globalTranslate",value:function globalTranslate(w,b){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[w,b]),this.globalTransform.apply(this,_toConsumableArray(I));}},{key:"globalRotate",value:function globalRotate(w){var _ref10=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref11=_slicedToArray(_ref10,2),b=_ref11[0],I=_ref11[1];var R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[b,I]),R=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),R,w),R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[-b,-I]),this.globalTransform.apply(this,_toConsumableArray(R));}},{key:"globalScale",value:function globalScale(w){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:w;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),I=_ref13[0],R=_ref13[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,R]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[w,b]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-R]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(w){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:w;var _ref14=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref15=_slicedToArray(_ref14,2),I=_ref15[0],R=_ref15[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,R]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(b),Math.tan(w),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-R]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(w,b,I){var R=this.globalTransformMatrix;I&&(R=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,I));var W=w*R[0]+b*R[2]+R[4],z=w*R[1]+b*R[3]+R[5];return[W,z];}}]);}();},/* 14 *//***/function(h,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(16),n=t(17),i=t(18),a=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(P,S,v){return S in P?Object.defineProperty(P,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[S]=v,P;}var s={};function c(P){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var v=[],T=P.length;for(var f=0;f<T;f++)f%S<2&&v.push(0.5*(P[f]+1));return v;}function m(P,S){var v=S._buffers;Object.values(v).forEach(function(T){P.deleteBuffer(T);}),S._buffers={};}function l(P,S,v){return P.activeTexture(P.TEXTURE0+v),Array.isArray(S._img)?P.bindTexture(P.TEXTURE_CUBE_MAP,S):P.bindTexture(P.TEXTURE_2D,S),S;}var p={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var y=/*#__PURE__*/function(){function y(S){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,v),this.canvas=S;var T;this.options.webgl2&&(T=S.getContext("webgl2",this.options)),T==null&&(T=Object(e.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(y,[{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,v){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var f=this.gl,d=f.getUniformLocation(S,v);var u;var g=this;if(/^sampler/.test(T)){var M=S._samplerMap,C=S._bindTextures;Object.defineProperty(S.uniforms,v,{get:function get(){return u;},set:function set(A){u=A;var L=M[v]!=null?M[v]:C.length;C[L]=A,l(f,A,L),M[v]||(M[v]=L,f.uniform1i(d,L)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _M=T.indexOf("Matrix")===0,_C=!_M&&/v$/.test(T),A=f["uniform".concat(T)].bind(f);Object.defineProperty(S.uniforms,v,{get:function get(){return u;},set:function set(L){u=L,typeof L=="number"&&(L=[L]),_M?A(d,!1,L):_C?A(d,L):A.apply(void 0,[d].concat(_toConsumableArray(L))),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var S=this.program;S.meshData.forEach(function(v,T){var f=v.positions,d=v.cells,u=v.instanceCount,g=v.cellsCount,M=v.attributes,C=v.uniforms,A=v.textureCoord,L=v.enableBlend,O=_this15.gl;var w=v.mode!=null?v.mode:O.TRIANGLES;typeof w=="string"&&(w=O[w]),L?O.enable(O.BLEND):O.disable(O.BLEND),O.bindBuffer(O.ARRAY_BUFFER,S._buffers.verticesBuffer),O.bufferData(O.ARRAY_BUFFER,f,O.STATIC_DRAW),d&&(O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,S._buffers.cellsBuffer),O.bufferData(O.ELEMENT_ARRAY_BUFFER,d,O.STATIC_DRAW));var b=[];M&&Object.values(M).forEach(function(_ref16){var R=_ref16.name,W=_ref16.data,z=_ref16.divisor;if(O.bindBuffer(O.ARRAY_BUFFER,S._buffers[R]),O.bufferData(O.ARRAY_BUFFER,W,O.STATIC_DRAW),z!=null){var K=O.getAttribLocation(S,R);K>=0&&(O.enableVertexAttribArray(K),b.push(K),O.vertexAttribDivisor?O.vertexAttribDivisor(K,z):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(K,z));}}),C&&Object.entries(C).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),R=_ref18[0],W=_ref18[1];_this15.uniforms[R]=W;});var I;if(!d){var R=S._dimension;I=f.length/R;}if(S._enableTextures&&S._buffers.texCoordBuffer){var _R2=A||c(f,S._dimension);O.bindBuffer(O.ARRAY_BUFFER,S._buffers.texCoordBuffer),O.bufferData(O.ARRAY_BUFFER,y.FLOAT(_R2),O.STATIC_DRAW);}u!=null?(d?O.drawElementsInstanced?O.drawElementsInstanced(w,g,O.UNSIGNED_SHORT,0,u):_this15.aia_ext&&_this15.aia_ext.drawElementsInstancedANGLE(w,g,O.UNSIGNED_SHORT,0,u):O.drawArraysInstanced?O.drawArraysInstanced(w,0,I,u):_this15.aia_ext.drawArraysInstancedANGLE(w,0,I,u),b.forEach(function(R){O.vertexAttribDivisor?O.vertexAttribDivisor(R,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(R,null);})):d?O.drawElements(w,g,O.UNSIGNED_SHORT,0):O.drawArrays(w,0,I);});}},{key:"isWebGL2",get:function get(){return(typeof WebGL2RenderingContext==="undefined"?"undefined":_typeof(WebGL2RenderingContext))<"u"&&this.gl instanceof WebGL2RenderingContext;}},{key:"enableTextures",get:function get(){return this.program&&this.program._enableTextures;}},{key:"uniforms",get:function get(){var S=this.program;if(!S||!S.uniforms)throw Error("No avaliable program.");return S.uniforms;}},{key:"deleteProgram",value:function deleteProgram(S){var v=this.gl;this.program===S&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),v.useProgram(null));var T=this.programs.indexOf(S);T>=0&&this.programs.splice(T,1),m(v,S),v.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 v=this.program;v.meshData=S.map(function(_ref19){var T=_ref19.mode,f=_ref19.positions,d=_ref19.instanceCount,u=_ref19.cells,g=_ref19.cellsCount,M=_ref19.attributes,C=_ref19.uniforms,A=_ref19.textureCoord,L=_ref19.enableBlend;var O={positions:y.FLOAT(f),uniforms:C,enableBlend:!!L,textureCoord:y.FLOAT(A)};if(u&&(O.cells=y.USHORT(u),O.cellsCount=g||O.cells.length),T!=null&&(O.mode=T),d!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");O.instanceCount=d;}if(M){var w={};Object.entries(M).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),b=_ref21[0],I=_ref21[1];if(!v._attribute[b])v._attribute[b]="ignored";else if(v._attribute[b]!=="ignored"){var _v$_attribute$b=v._attribute[b],R=_v$_attribute$b.name,W=_v$_attribute$b.type;var z=I.data||I;if(Array.isArray(z)&&(z=y[W](z)),w[b]={name:R,data:z},I.divisor!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");w[b].divisor=I.divisor;}}}),O.attributes=w;}return O;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(S,v){var _this17=this;var T=/^\s*uniform\s+sampler/mg.test(S);S==null&&(S=i["default"]),v==null&&(v=T?a["default"]:n["default"]);var f=this.gl,d=Object(e.createProgram)(f,v,S);d.shaderText={vertexShader:v,fragmentShader:S},d._buffers={},d._attribute={},d.uniforms={},d._samplerMap={},d._bindTextures=[];var u=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var g=v.match(u);g&&(d._dimension=Number(g[1]));var M=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");g=v.match(M),g&&(d._texCoordSize=Number(g[1]));var C=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(g=v.match(C),g)for(var O=0;O<g.length;O++){var w=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,b=g[O].match(w);if(b&&b[3]!==this.options.vertexPosition&&b[3]!==this.options.vertexTextureCoord){var _b=_slicedToArray(b,4),I=_b[1],R=_b[2],W=_b[3];I==="mat"&&(R=Math.pow(R,2)),d._buffers[W]=f.createBuffer(),d._attribute[W]={name:W,type:I,size:Number(R)||1};}}var A=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=v.match(A)||[],g=g.concat(S.match(A)||[]),g.forEach(function(O){var w=O.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _w$slice=w.slice(1),_w$slice2=_slicedToArray(_w$slice,3),b=_w$slice2[0],I=_w$slice2[1],R=_w$slice2[2];b=p[b],R=!!R,b.indexOf("Matrix")!==0&&R&&(b+="v"),_this17._declareUniform(d,I,b);}),d._buffers.verticesBuffer=f.createBuffer(),d._buffers.cellsBuffer=f.createBuffer();var L=f.getAttribLocation(d,this.options.vertexTextureCoord);return d._enableTextures=L>=0,d._enableTextures&&(d._buffers.texCoordBuffer=f.createBuffer()),this.programs.push(d),d;}},{key:"useProgram",value:function useProgram(S){var v=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 f=S._dimension;T.bindBuffer(T.ARRAY_BUFFER,S._buffers.verticesBuffer);var d=T.getAttribLocation(S,this.options.vertexPosition);if(T.vertexAttribPointer(d,f,T.FLOAT,!1,0,0),T.enableVertexAttribArray(d),S._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,S._buffers.texCoordBuffer);var u=T.getAttribLocation(S,this.options.vertexTextureCoord);T.vertexAttribPointer(u,S._texCoordSize||2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(u);}if(Object.entries(S._attribute).forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],g=_ref23[1];if(g!=="ignored"){var M=g.size,C=v[u]||{},A=!!C.normalize;var L=C.type||"FLOAT";var O=C.key||u;L==="UBYTE"&&(L="UNSIGNED_BYTE"),L==="USHORT"&&(L="UNSIGNED_SHORT"),g.type=L,O&&O!==u&&(S._attribute[O]=g),T.bindBuffer(T.ARRAY_BUFFER,S._buffers[u]);var w=T.getAttribLocation(S,u);w>=0&&(T.vertexAttribPointer(w,M,T[L],A,0,0),T.enableVertexAttribArray(w));}}),!S.meshData){var _u2=[[-1,-1,0,1].slice(0,f),[1,-1,0,1].slice(0,f),[1,1,0,1].slice(0,f),[-1,1,0,1].slice(0,f)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:_u2,cells:g});}return S;}},{key:"compileSync",value:function compileSync(S,v){S=S||i["default"];var T={};function f(M){M=M.replace(/^\s*/mg,"");var C=[],A=M.match(/^#pragma\s+include\s+.*/mg);if(A){for(var L=0;L<A.length;L++){var w=A[L].match(/(?:<|")(.*)(?:>|")/);if(w){var b=w[0].indexOf("<")===0?"lib":"link";var I=w[1];if(I==="graph"&&(I="graphics"),T[I])C.push("/* included ".concat(I," */"));else if(T[I]=!0,b==="lib"){var R=f(s[I]);C.push(R);}else if(b==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}C.forEach(function(L){M=M.replace(/^#pragma\s+include\s+.*/m,L);});}return M;}var d=f(S),u=v?f(v):null;return this.createProgram(d,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(S,v){var T,f,_f2,d,u;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_f2=function _f4(){_f2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(M){var C,A,L,w,b,I,R,_R3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:M=M.replace(/^\s*/mg,"");C=[],A=M.match(/^#pragma\s+include\s+.*/mg);if(!A){_context11.next=32;break;}L=0;case 4:if(!(L<A.length)){_context11.next=31;break;}w=A[L].match(/(?:<|")(.*)(?:>|")/);if(!w){_context11.next=28;break;}b=w[0].indexOf("<")===0?"lib":"link";I=w[1];if(!(I==="graph"&&(I="graphics"),T[I])){_context11.next=13;break;}C.push("/* included ".concat(I," */"));_context11.next=28;break;case 13:if(!(T[I]=!0,b==="lib")){_context11.next=20;break;}_context11.next=16;return f(s[I]);case 16:R=_context11.sent;C.push(R);_context11.next=28;break;case 20:if(!(b==="link")){_context11.next=28;break;}_context11.next=23;return y.fetchShader(I);case 23:_R3=_context11.sent;_context11.next=26;return f(_R3);case 26:_R3=_context11.sent;C.push(_R3);case 28:L++;_context11.next=4;break;case 31:C.forEach(function(L){M=M.replace(/^#pragma\s+include\s+.*/m,L);});case 32:return _context11.abrupt("return",M);case 33:case"end":return _context11.stop();}},_callee11);}));return _f2.apply(this,arguments);};f=function _f3(_x13){return _f2.apply(this,arguments);};S=S||i["default"];T={};_context12.next=6;return f(S);case 6:d=_context12.sent;if(!v){_context12.next=13;break;}_context12.next=10;return f(v);case 10:_context12.t0=_context12.sent;_context12.next=14;break;case 13:_context12.t0=null;case 14:u=_context12.t0;return _context12.abrupt("return",this.createProgram(d,u));case 16:case"end":return _context12.stop();}},_callee12,this);}));function compile(_x11,_x12){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(S){var v,_args13=arguments;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:v=_args13.length>1&&_args13[1]!==undefined?_args13[1]:null;_context13.next=3;return y.fetchShader(S);case 3:S=_context13.sent;_context13.t0=v;if(!_context13.t0){_context13.next=9;break;}_context13.next=8;return y.fetchShader(v);case 8:v=_context13.sent;case 9:return _context13.abrupt("return",this.compile(S,v));case 10:case"end":return _context13.stop();}},_callee13,this);}));function load(_x14){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this18=this;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref24=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref24$wrapS=_ref24.wrapS,v=_ref24$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapS,_ref24$wrapT=_ref24.wrapT,T=_ref24$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapT,_ref24$minFilter=_ref24.minFilter,f=_ref24$minFilter===void 0?this.gl.LINEAR:_ref24$minFilter,_ref24$magFilter=_ref24.magFilter,d=_ref24$magFilter===void 0?this.gl.LINEAR:_ref24$magFilter;var u=this.gl,g=Array.isArray(S)?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),u.activeTexture(u.TEXTURE0+this._max_texture_image_units-1);var M=u.createTexture();u.bindTexture(g,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,C=_this$canvas4.width,A=_this$canvas4.height;if(S){if(g===u.TEXTURE_CUBE_MAP)for(var L=0;L<6;L++)u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+L,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,S[L]);else u.texImage2D(g,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,S);}else if(g===u.TEXTURE_CUBE_MAP)for(var _L=0;_L<6;_L++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_L,0,u.RGBA,C,A,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(g,0,u.RGBA,C,A,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(g,u.TEXTURE_MIN_FILTER,f),u.texParameteri(g,u.TEXTURE_MAG_FILTER,d),u.texParameteri(g,u.TEXTURE_WRAP_S,v),u.texParameteri(g,u.TEXTURE_WRAP_T,T),g===u.TEXTURE_CUBE_MAP&&(S.width=S[0].width,S.height=S[0].height),u.bindTexture(g,null),M._img=S||{width:C,height:A},M["delete"]=function(){_this18.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(S){var v=S._img;this.gl.deleteTexture(S),typeof v.close=="function"&&v.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(S){var _ref25,_ref25$useImageBitmap,v,T,_args14=arguments;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_ref25=_args14.length>1&&_args14[1]!==undefined?_args14[1]:{},_ref25$useImageBitmap=_ref25.useImageBitmap,v=_ref25$useImageBitmap===void 0?!0:_ref25$useImageBitmap;_context14.next=3;return y.loadImage(S,{useImageBitmap:v});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 _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$color=_ref26.color,S=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,v=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,T=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,f=_ref26$stencil===void 0?!!this.options.stencil:_ref26$stencil;var d=this.gl,u=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,u);var g=[];for(var A=0;A<S;A++){var L=this.createTexture();d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0+A,d.TEXTURE_2D,L,0/* level */),g.push(L);}u.textures=g,u.texture=g[0],u.blend=v;var _this$canvas5=this.canvas,M=_this$canvas5.width,C=_this$canvas5.height;return T&&!f&&(u.depthBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,M,C),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,u.depthBuffer)),f&&!T&&(u.stencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.stencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.STENCIL_INDEX8,M,C),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.STENCIL_ATTACHMENT,d.RENDERBUFFER,u.stencilBuffer)),T&&f&&(u.depthStencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthStencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,M,C),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,u.depthStencilBuffer)),d.bindFramebuffer(d.FRAMEBUFFER,null),u;}},{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 _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,S=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var v=this.gl;var T=this.program;T||(T=this.createProgram(),this.useProgram(T)),this.fbo&&v.bindFramebuffer(v.FRAMEBUFFER,this.fbo);var f=this.options.depth;f&&v.enable(v.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(f?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var d=this._renderFrameID;this._draw(),this.fbo&&v.bindFramebuffer(v.FRAMEBUFFER,null),this._renderFrameID===d&&(this._renderFrameID=null);}},{key:"update",value:function update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)));}}],[{key:"addLibs",value:function addLibs(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,S);}},{key:"FLOAT",value:function FLOAT(S,v){return Object(e.pointsToBuffer)(S,Float32Array,v);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(S,v){return Object(e.pointsToBuffer)(S,Uint8Array,v);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(S,v){return Object(e.pointsToBuffer)(S,Uint16Array,v);}},{key:"BYTE",value:function BYTE(S,v){return Object(e.pointsToBuffer)(S,Int8Array,v);}},{key:"SHORT",value:function SHORT(S,v){return Object(e.pointsToBuffer)(S,Int16Array,v);}}]);}();o(y,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(y,"UBYTE",y.UNSIGNED_BYTE),o(y,"USHORT",y.UNSIGNED_SHORT),o(y,"fetchShader",e.fetchShader),o(y,"loadImage",e.loadImage);},/* 16 *//***/function(h,r,t){t.r(r),t.d(r,"setupWebGL",function(){return n;}),t.d(r,"createProgram",function(){return i;}),t.d(r,"pointsToBuffer",function(){return a;}),t.d(r,"loadImage",function(){return s;}),t.d(r,"fetchShader",function(){return m;}),t(1).glMatrix.setMatrixArrayType(Array);function e(l,p){var y=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var P=null;for(var S=0;S<y.length;++S){try{P=l.getContext(y[S],p);}catch(_unused){}if(P)break;}return P;}function n(l,p){var y=e(l,p);if(!y)throw new Error("Sorry, your browser doesn't support WebGL.");return y;}function i(l,p,y){var P=l.createShader(l.VERTEX_SHADER);if(l.shaderSource(P,p),l.compileShader(P),!l.getShaderParameter(P,l.COMPILE_STATUS)){var _T="Vertex shader failed to compile. The error log is:".concat(l.getShaderInfoLog(P));throw new Error(_T);}var S=l.createShader(l.FRAGMENT_SHADER);if(l.shaderSource(S,y),l.compileShader(S),!l.getShaderParameter(S,l.COMPILE_STATUS)){var _T2="Fragment shader failed to compile. The error log is:".concat(l.getShaderInfoLog(S));throw new Error(_T2);}var v=l.createProgram();if(l.attachShader(v,P),l.attachShader(v,S),l.linkProgram(v),!l.getProgramParameter(v,l.LINK_STATUS)){var _T3="Shader program failed to link. The error log is:".concat(l.getProgramInfoLog(v));throw new Error(_T3);}return l.deleteShader(P),l.deleteShader(S),v;}function a(l){var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(y&&!(y instanceof p))throw new TypeError("Wrong buffer type.");if(l==null||l instanceof p)return l;if(l[0]==null||l[0].length==null)return y?(y.set(l,0),y):new p(l);var P=l[0].length,S=l.length;y||(y=new p(P*S));var v=0;for(var _T4=0;_T4<S;_T4++)for(var _f5=0;_f5<P;_f5++)y[v++]=l[_T4][_f5];return y;}var o={};function s(l){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$useImageBitmap=_ref28.useImageBitmap,p=_ref28$useImageBitmap===void 0?!0:_ref28$useImageBitmap,_ref28$alias=_ref28.alias,y=_ref28$alias===void 0?null:_ref28$alias;if(!o[l]){if(typeof Image=="function"){var P=new Image();typeof l=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(l)&&(P.crossOrigin="anonymous"),o[l]=new Promise(function(S){P.onload=function(){p&&typeof createImageBitmap=="function"?createImageBitmap(P,{imageOrientation:"flipY"}).then(function(v){o[l]=v,y&&(o[y]=v),S(v);}):(o[l]=P,y&&(o[y]=P),S(P));},P.src=l;}),y&&(o[y]=o[l]);}else if(typeof fetch=="function")return fetch(l,{method:"GET",mode:"cors",cache:"default"}).then(function(P){return P.blob();}).then(function(P){return createImageBitmap(P,{imageOrientation:"flipY"}).then(function(S){return o[l]=S,y&&(o[y]=S),S;});});}return o[l];}var c={};function m(_x16){return _m.apply(this,arguments);}function _m(){_m=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(l){var p,y;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!c[l]){_context15.next=2;break;}return _context15.abrupt("return",c[l]);case 2:_context15.next=4;return fetch(l);case 4:p=_context15.sent;if(!(p.status>=200&&p.status<300)){_context15.next=10;break;}_context15.next=8;return p.text();case 8:y=_context15.sent;return _context15.abrupt("return",(c[l]=y,y));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context15.stop();}},_callee15);}));return _m.apply(this,arguments);}},/* 17 *//***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = vec4(a_vertexPosition, 1);\n}";},/* 18 *//***/function(h,r,t){t.r(r),r["default"]="#ifdef GL_ES\nprecision mediump float;\n#endif\n\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);\n}";},/* 19 *//***/function(h,r,t){t.r(r),r["default"]="attribute vec4 a_vertexPosition;\nattribute vec2 a_vertexTextureCoord;\nvarying vec2 vTextureCoord;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = a_vertexPosition;\n vTextureCoord = a_vertexTextureCoord;\n}";},/* 20 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return a;});var e=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var a=/*#__PURE__*/function(){function a(s,c){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=c,this[i]=[1,0,0,1,0,0];}return _createClass(a,[{key:"createTexture",value:function createTexture(s){return{_img:s};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s){var c;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return e["default"].loadImage(s,{useImageBitmap:!1});case 2:c=_context16.sent;return _context16.abrupt("return",this.createTexture(c));case 4:case"end":return _context16.stop();}},_callee16,this);}));function loadTexture(_x17){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(s){return s;}},{key:"clear",value:function clear(s,c,m,l){var p=this.context;s=s||0,c=c||0,m=m||p.canvas.width-s,l=l||p.canvas.height-c,p.clearRect(s,c,m,l);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,c=_ref29$clear===void 0?!1:_ref29$clear;var m=[];for(var l=0;l<s.amount;l++){var p=s.getTransform(l);var y=s.getTextureFrame(l);y&&(y=y._img);var P=s.getFilter(l),_s$getCloudRGBA=s.getCloudRGBA(l),S=_s$getCloudRGBA.fill,v=_s$getCloudRGBA.stroke;m.push({mesh:s.mesh,_cloudOptions:[S,v,y,p,P]});}s.beforeRender&&s.beforeRender(this.context,s),this.drawMeshes(m,{clear:c,hook:!1}),s.afterRender&&s.afterRender(this.context,s);}},{key:"drawMeshes",value:function drawMeshes(s){var _this19=this;var _ref30=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref30$clear=_ref30.clear,c=_ref30$clear===void 0?!1:_ref30$clear,_ref30$hook=_ref30.hook,m=_ref30$hook===void 0?!0:_ref30$hook;var l=this.context;c&&l.clearRect(0,0,l.canvas.width,l.canvas.height);var p=null;var _l$canvas=l.canvas,y=_l$canvas.width,P=_l$canvas.height,S=s.length;s.forEach(function(v,T){var _v$_cloudOptions,_this19$filterBuffer;var f,d,u,g,M;m&&v.beforeRender&&v.beforeRender(l,v),v._cloudOptions&&(_v$_cloudOptions=_slicedToArray(v._cloudOptions,5),f=_v$_cloudOptions[0],d=_v$_cloudOptions[1],u=_v$_cloudOptions[2],g=_v$_cloudOptions[3],M=_v$_cloudOptions[4],v=v.mesh);var C=v.filter;if(M&&(C=C?"".concat(C," ").concat(M):M),C&&!_this19.filterBuffer&&_this19.filterBuffer!==!1){var A=e["default"].createCanvas(y,P);A?_this19.filterBuffer=A.getContext("2d"):_this19.filterBuffer=!1;}p&&p!==C&&(Object(n.applyFilter)(_this19.filterBuffer,p),l.drawImage(_this19.filterBuffer.canvas,0,0,y,P),_this19.filterBuffer.clearRect(0,0,y,P),p=null),C&&_this19.filterBuffer?(_this19.filterBuffer.save(),(_this19$filterBuffer=_this19.filterBuffer).transform.apply(_this19$filterBuffer,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(v,_this19.filterBuffer,!1,f,d,u,g),_this19.filterBuffer.restore(),T===S-1?(Object(n.applyFilter)(_this19.filterBuffer,C),l.drawImage(_this19.filterBuffer.canvas,0,0,y,P),_this19.filterBuffer.clearRect(0,0,y,P)):p=C):(l.save(),l.transform.apply(l,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(v,l,!1,f,d,u,g),l.restore()),m&&v.afterRender&&v.afterRender(l,v);});}},{key:"setTransform",value:function setTransform(s){this[i]=s;}}]);}();},/* 21 *//***/function(h,r,t){t.r(r),function(e){var n=t(14),i=t(23),a=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function s(y,P){var S=y.style,v=y.variant,T=y.weight,f=y.stretch,d=y.size,u=y.pxLineHeight,g=y.family;return f==="normal"?"".concat(S," ").concat(v," ").concat(T," ").concat(d*P,"px/").concat(u*P,"px ").concat(g):"".concat(S," ").concat(v," ").concat(T," ").concat(f," ").concat(d*P,"px/").concat(u*P,"px ").concat(g);}function c(y,_ref31){var P=_ref31.font,S=_ref31.fillColor,v=_ref31.strokeColor,T=_ref31.strokeWidth,_ref31$ratio=_ref31.ratio,f=_ref31$ratio===void 0?1:_ref31$ratio,d=_ref31.textCanvas,_ref31$cachable=_ref31.cachable,u=_ref31$cachable===void 0?!1:_ref31$cachable;var g;if(u){g=[y,P,String(S),String(v),String(T)].join("###");var z=o[g];if(z)return z;}d||(d=l(1,1));var M=d.getContext("2d");M.save(),M.font=P;var _M$measureText=M.measureText(y),C=_M$measureText.width;M.restore();var A=Object(i["default"])(P),L=Math.max(A.pxLineHeight,A.pxHeight*1.13);/italic|oblique/.test(P)&&(C+=L*Math.tan(15*Math.PI/180)),!S&&!v&&(S="#000");var O=M.canvas,w=Math.ceil(C),b=Math.ceil(L);O.width=Math.round(w*f),O.height=Math.round(b*f),M.save(),M.font=s(A,f),M.textAlign="center",M.textBaseline="middle";var I=O.height*0.5+A.pxHeight*0.05*f,R=O.width*0.5;if(S){if(Array.isArray(S))S=Object(a["default"])(S);else if(S.vector){var _z;var _S=S,K=_S.vector,J=_S.colors;K.length===6?_z=M.createRadialGradient.apply(M,_toConsumableArray(K)):_z=M.createLinearGradient.apply(M,_toConsumableArray(K)),J.forEach(function(_ref32){var q=_ref32.offset,U=_ref32.color;_z.addColorStop(q,U);}),S=_z;}M.fillStyle=S,M.fillText(y,R,I);}if(v){if(M.lineWidth=T*f,Array.isArray(v))v=Object(a["default"])(v);else if(v.vector){var _z2;var _v=v,_K=_v.vector,_J=_v.colors;_K.length===6?_z2=M.createRadialGradient.apply(M,_toConsumableArray(_K)):_z2=M.createLinearGradient.apply(M,_toConsumableArray(_K)),_J.forEach(function(_ref33){var q=_ref33.offset,U=_ref33.color;_z2.addColorStop(q,U);}),v=_z2;}M.strokeStyle=v,M.strokeText(y,R,I);}M.restore();var W={image:d,rect:[0,0,w,b]};return u&&(o[g]=W),W;}var m=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var y=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);y&&(m=Number(y[1])<70);}function l(y,P){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var v=S.offscreen||!m&&S.offscreen!==!1;var T;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(y,P,S):v&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(y,P):(T=document.createElement("canvas"),T.width=y,T.height=P),T;}var p={createCanvas:l,createText:c,loadImage:n["default"].loadImage};r["default"]=p;}.call(this,t(22));},/* 22 *//***/function(h,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused2){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}h.exports=t;},/* 23 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;}),t(1).glMatrix.setMatrixArrayType(Array);function e(v,T){if(typeof v=="string"){var u=v.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);u?v={size:parseFloat(u[1]),unit:u[2]}:v={size:parseInt(v,10),unit:"px"};}var _v2=v,f=_v2.size,d=_v2.unit;if(d==="pt")f/=0.75;else if(d==="pc")f*=16;else if(d==="in")f*=96;else if(d==="cm")f*=96/2.54;else if(d==="mm")f*=96/25.4;else if(d==="em"||d==="rem"||d==="ex"){if(!T&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;T=e(_u3,16);}f*=T,d==="ex"&&(f/=2);}else if(d==="q")f*=96/25.4/4;else if(d==="vw"||d==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u4=d==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;f*=_u4/100;}}else if((d==="vmax"||d==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u5=document.documentElement.clientWidth,g=document.documentElement.clientHeight;d==="vmax"?f*=Math.max(_u5,g)/100:f*=Math.min(_u5,g)/100;}return f;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",s="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",c="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",m=new RegExp("(".concat(n,") +"),"i"),l=new RegExp("(".concat(i,") +"),"i"),p=new RegExp("(".concat(a,") +"),"i"),y=new RegExp("(".concat(o,") +"),"i"),P=new RegExp("([\\d\\.]+)("+s+")(?:\\/([\\d\\.]+)("+s+"))? *((?:"+c+")( *, *(?:"+c+"))*)");function S(v,T){var f=P.exec(v);if(!f)return;var d=parseFloat(f[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(f[1]),unit:f[2],lineHeight:Number.isFinite(d)?d:void 0,lineHeightUnit:f[4],family:f[5].replace(/ *, */g,",")},g=v.substring(0,f.index),M=m.exec(g),C=l.exec(g),A=p.exec(g),L=y.exec(g);return M&&(u.weight=M[1]),C&&(u.style=C[1]),A&&(u.variant=A[1]),L&&(u.stretch=L[1]),u.pxHeight=e({size:u.size,unit:u.unit},T),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},T),u;}},/* 24 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 *//***/function(h,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),t.d(r,"drawMesh2D",function(){return c;});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(m,l){var p=m.canvas;m.save(),m.filter=l,m.drawImage(p,0,0,p.width,p.height),m.restore();}function s(m,l){var p=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;m=m.match(p).slice(1,5).map(Number),l=l.match(p).slice(1,5).map(Number);var y=[],P=l[3];for(var S=0;S<4;S++)y[S]=Object(a.mix)(m[S],l[S],P);return"rgba(".concat(y.join(),")");}function c(m,l){var p=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var y=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var P=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var S=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var v=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;l.save();var T=!1,f=!1;if(l.globalAlpha=m.getOpacity(),m._updateMatrix&&m.transformScale/m.contours.scale>1.5&&m.accurate(m.transformScale),m.lineWidth){var g=m.gradient&&m.gradient.stroke;if(g){var _g2=g,M=_g2.vector,C=_g2.colors;if(M.length===6)g=l.createRadialGradient.apply(l,_toConsumableArray(M));else if(M.length===4)g=l.createLinearGradient.apply(l,_toConsumableArray(M));else if(M.length===3)g=l.createCircularGradient.apply(l,_toConsumableArray(M));else throw new TypeError("Invalid vector dimension.");C.forEach(function(_ref34){var A=_ref34.offset,L=_ref34.color;var O=Object(n["default"])(L);P&&(O=s(O,P)),g.addColorStop(A,O);}),l.strokeStyle=g,T=!0;}else m.strokeStyle&&(P?l.strokeStyle=s(m.strokeStyle,P):l.strokeStyle=m.strokeStyle,T=!0);}T&&(l.lineWidth=m.lineWidth,l.lineJoin=m.lineJoin,l.lineCap=m.lineCap,l.miterLimit=m.miterLimit,m.lineDash&&(l.setLineDash(m.lineDash),m.lineDashOffset&&(l.lineDashOffset=m.lineDashOffset)));var d=m.gradient&&m.gradient.fill;if(d){var _d2=d,_g3=_d2.vector,_M2=_d2.colors;if(_g3.length===6)d=l.createRadialGradient.apply(l,_toConsumableArray(_g3));else if(_g3.length===4)d=l.createLinearGradient.apply(l,_toConsumableArray(_g3));else if(_g3.length===3)d=l.createCircularGradient.apply(l,_toConsumableArray(_g3));else throw new TypeError("Invalid vector dimension.");_M2.forEach(function(_ref35){var C=_ref35.offset,A=_ref35.color;var L=Object(n["default"])(A);P&&(L=s(L,P)),d.addColorStop(C,L);}),l.fillStyle=d,f=!0;}else m.fillStyle&&(y?l.fillStyle=s(m.fillStyle,y):l.fillStyle=m.fillStyle,f=!0);if(v&&l.transform.apply(l,_toConsumableArray(v)),l.transform.apply(l,_toConsumableArray(m.transformMatrix)),m.clipPath){var _g4=m.clipPath,_M3=new Path2D(_g4);l.clip(_M3);}var u=m.contours.length;if(m.contours.forEach(function(g,M){var C=g.length,A=C>1&&e.vec2.equals(g[0],g[C-1]),L=M===u-1&&m.texture;if(g&&C>0){if(f||T||L){l.beginPath(),l.moveTo.apply(l,_toConsumableArray(g[0]));for(var O=1;O<C;O++)O===C-1&&A?l.closePath():l.lineTo.apply(l,_toConsumableArray(g[O]));}if(f&&l.fill(m.fillRule),L){l.save(),l.clip();var _m$texture=m.texture,_O=_m$texture.image,w=_m$texture.options;if(S&&(_O=S),w.repeat&&console.warn("Context 2D not supported image repeat yet."),_O.font){w.scale&&console.warn("Context 2D not supported text scale yet."),w.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _O2=_O,b=_O2.font,I=_O2.fillColor,R=_O2.strokeColor,W=_O2.strokeWidth,z=_O2.text;!I&&!R&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(R)&&(R=Object(n["default"])(R)),l.font=b;var _l$measureText=l.measureText(z),K=_l$measureText.width,J=Object(i["default"])(b),q=Math.max(J.pxLineHeight,J.pxHeight*1.13);l.textAlign="center",l.textBaseline="middle";var U=w.rect,G=U[0]+q*0.5+J.pxHeight*0.06,Z=U[1]+K*0.5;U[2]!=null&&l.scale(U[2]/K,U[3]/q),I&&(l.fillStyle=I,l.fillText(z,Z,G)),R&&(l.lineWidth=W,l.strokeStyle=R,l.strokeText(z,Z,G));}else{var _b2=w.rect;var _I=w.srcRect;w.scale&&(_b2=[0,0,l.canvas.width,l.canvas.height]),w.rotated&&_b2&&(_b2=[-_b2[1],_b2[0],_b2[3],_b2[2]]),_I&&(_b2=_b2||[0,0,_I[2],_I[3]]),w.rotated&&(l.translate(0,_b2?_b2[2]:_O.width),l.rotate(-0.5*Math.PI)),_I?l.drawImage.apply(l,[_O].concat(_toConsumableArray(_I),_toConsumableArray(_b2))):_b2?l.drawImage.apply(l,[_O].concat(_toConsumableArray(_b2))):l.drawImage(_O,0,0);}l.restore();}T&&l.stroke();}}),l.restore(),p){var _g5=m.filter;_g5&&o(l,_g5);}}},/* 26 *//***/function(h,r,t){t.r(r),t.d(r,"clamp",function(){return e;}),t.d(r,"mix",function(){return n;}),t.d(r,"transformPoint",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);function e(a,o,s){var _ref36;return o>s&&(_ref36=[s,o],o=_ref36[0],s=_ref36[1],_ref36),a<o?o:a>s?s:a;}function n(a,o,s){return a*(1-s)+o*s;}function i(a,o){var _a2=_slicedToArray(a,2),s=_a2[0],c=_a2[1];return[s*o[0]+c*o[2]+o[4],s*o[1]+c*o[3]+o[5]];}},/* 27 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(c,m,l){var p=c.uniforms||{},y=m.uniforms||{};if(p.u_texSampler&&y.u_texSampler&&p.u_texSampler!==y.u_texSampler)return!1;var P=Object.keys(p),S=Object.keys(y),v=P.indexOf("u_texSampler"),T=S.indexOf("u_texSampler");if(v>=0&&P.splice(v,1),T>=0&&S.splice(T,1),P.length!==S.length)return!1;var f=P.every(function(d){var u=p[d],g=y[d];if(u===g)return!0;if(u.length&&g.length&&u.length===g.length){for(var M=0;M<u.length;M++)if(u[M]!==g[M])return!1;return!0;}return!1;});if(f){if(p.u_texSampler&&!y.u_texSampler)m.setTexture(p.u_texSampler,{hidden:!0});else if(!p.u_texSampler&&y.u_texSampler)for(var d=0;d<l.length;d++)l[d].setTexture(y.u_texSampler,{hidden:!0});}return f;}var a={};function o(c,m){if(c.length){var l=Object(e["default"])(c,a);return l.enableBlend=m,c[0].filterCanvas&&(l.filterCanvas=!0),l.packIndex=c[0].packIndex,l.packLength=c.length,l.beforeRender=c[0].beforeRender,l.pass=c[0].pass,l.afterRender=c[c.length-1].afterRender,c.length=0,l;}}function s(c,m){var l=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(){var p,y,P,S,v,_T5,_f6,u,d,_u6,g;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:p=[],y=c.options.bufferSize;P=0,S=!1;v=0;case 3:if(!(v<m.length)){_context17.next=47;break;}_T5=m[v];if(!(_T5 instanceof n["default"])){_context17.next=16;break;}_context17.t0=p.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(p,S);case 10:P=0;S=!1;_context17.next=14;return _T5;case 14:_context17.next=44;break;case 16:_f6=_T5.meshData;if(_f6.clipPath&&!_f6.uniforms.u_clipSampler){u=c.createTexture(_f6.clipPath);_f6.uniforms.u_clipSampler=u;}d=0;if(!((!l||!_T5.canIgnore())&&_f6&&_f6.positions.length)){_context17.next=40;break;}_T5.packIndex=v;_u6=_T5.filterCanvas;if(!(d=_f6.positions.length,_u6||P+d>y)){_context17.next=31;break;}_context17.t1=p.length;if(!_context17.t1){_context17.next=27;break;}_context17.next=27;return o(p,S);case 27:P=0;S=!1;_context17.next=39;break;case 31:if(!P){_context17.next=39;break;}g=p[p.length-1];_context17.t2=g&&(g.filterCanvas||g.afterRender||_T5.beforeRender||g.pass.length||_T5.pass.length||g.program!==_T5.program||!i(g,_T5,p));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(p,S);case 37:P=0;S=!1;case 39:p.push(_T5),S=S||_T5.enableBlend,P+=d;case 40:_context17.t3=v===m.length-1&&p.length;if(!_context17.t3){_context17.next=44;break;}_context17.next=44;return o(p,S);case 44:v++;_context17.next=3;break;case 47:case"end":return _context17.stop();}},_callee17);})();}},/* 28 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var e={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(a,o){var s=0,c=0,m=0,l=0,p=0,y=0,P=0;var S=a[0].program;for(var v=0;v<a.length;v++){var _T6=a[v].meshData;if(_T6){P+=_T6.positions.length;var _f7=_T6.positions[0].length;s+=_T6.positions.length*_f7,c+=_T6.cells.length*3,y+=_T6.attributes.a_color.length*4;var d=_T6.textureCoord;d&&(m+=d.length*d[0].length);var u=_T6.attributes.a_sourceRect;u&&(l+=u.length*4);var g=_T6.attributes.a_clipUV;g&&(p+=g.length*2);}}if((!o.positions||o.positions.length<s)&&(o.positions=new Float32Array(s)),(!o.cells||o.cells.length<c)&&(o.cells=new Uint16Array(c)),m&&(!o.textureCoord||o.textureCoord.length<m)&&(o.textureCoord=new Float32Array(m)),(!o.a_color||o.a_color.length<y)&&(o.a_color=new Uint8Array(y)),l&&(!o.a_sourceRect||o.a_sourceRect.length<l)&&(o.a_sourceRect=new Float32Array(l)),p&&(!o.a_clipUV||o.a_clipUV.length<p)&&(o.a_clipUV=new Float32Array(p)),S){var _v3=Object.entries(S._attribute),_T7=S._attribOpts||{};for(var _f8=0;_f8<_v3.length;_f8++){var _v3$_f=_slicedToArray(_v3[_f8],2),_d3=_v3$_f[0],_u7=_v3$_f[1];if(_d3!=="a_color"&&_d3!=="a_sourceRect"&&_u7!=="ignored"){var _g6=_T7[_d3]?_T7[_d3].type:"FLOAT",M=e[_g6],C=_u7.size*P;(!o[_d3]||o[_d3].length<C)&&(o[_d3]=new M(C));}}}return o;}function i(a,o){var s=[],c=[],m=[],l=[],p=[],y=[],P=0,S=0;var v=a[0]?a[0].uniforms||{}:{},T=a[0]?a[0].program:null;o&&(n(a,o),c=o.cells,s=o.positions,m=o.textureCoord,l=o.a_color,p=o.a_sourceRect,y=o.a_clipUV);var f=!1,d=!1;var u={};for(var M=0;M<a.length;M++){var C=a[M];if(C){var _s2,_l2,_p2,_y,_m2;if(C.meshData&&(C=C.meshData),o){var L=C.positions;for(var O=0;O<L.length;O++){var w=L[O],b=3*(P+O);for(var I=0;I<w.length;I++)s[b+I]=w[I];}}else(_s2=s).push.apply(_s2,_toConsumableArray(C.positions));var A=C.cells;for(var _L2=0;_L2<A.length;_L2++){var _O3=A[_L2];if(o){var _w=3*(S+_L2);c[_w]=_O3[0]+P,c[_w+1]=_O3[1]+P,c[_w+2]=_O3[2]+P;}else c.push([_O3[0]+P,_O3[1]+P,_O3[2]+P]);}if(o){var _L3=C.attributes.a_color;for(var _O4=0;_O4<_L3.length;_O4++){var _w2=_L3[_O4],_b3=4*(P+_O4);l[_b3]=_w2[0],l[_b3+1]=_w2[1],l[_b3+2]=_w2[2],l[_b3+3]=_w2[3];}}else(_l2=l).push.apply(_l2,_toConsumableArray(C.attributes.a_color));if(C.attributes.a_sourceRect)if(f=!0,o){var _L4=C.attributes.a_sourceRect;for(var _O5=0;_O5<_L4.length;_O5++){var _w3=_L4[_O5],_b4=4*(P+_O5);p[_b4]=_w3[0],p[_b4+1]=_w3[1],p[_b4+2]=_w3[2],p[_b4+3]=_w3[3];}}else(_p2=p).push.apply(_p2,_toConsumableArray(C.attributes.a_sourceRect));if(C.attributes.a_clipUV)if(d=!0,o){var _L5=C.attributes.a_clipUV;for(var _O6=0;_O6<_L5.length;_O6++){var _w4=_L5[_O6],_b5=2*(P+_O6);y[_b5]=_w4[0],y[_b5+1]=_w4[1];}}else(_y=y).push.apply(_y,_toConsumableArray(C.attributes.a_clipUV));if(C.textureCoord)if(o){var _L6=C.textureCoord;for(var _O7=0;_O7<_L6.length;_O7++){var _w5=_L6[_O7],_b6=3*(P+_O7);for(var _I2=0;_I2<_w5.length;_I2++)m[_b6+_I2]=_w5[_I2];}}else(_m2=m).push.apply(_m2,_toConsumableArray(C.textureCoord));if(T){var _L7=Object.entries(T._attribute);for(var _O8=0;_O8<_L7.length;_O8++){var _u$_w;var _L7$_O=_slicedToArray(_L7[_O8],2),_w6=_L7$_O[0],_b7=_L7$_O[1];if(_w6!=="a_color"&&_w6!=="a_sourceRect"&&_b7!=="ignored")if(u[_w6]=[],o){u[_w6]=o[_w6];var _I3=C.attributes[_w6],R=_I3[0].length;for(var W=0;W<_I3.length;W++){var z=_I3[W],K=R*(P+W);for(var J=0;J<z.length;J++)u[_w6][K+J]=z[J];}}else(_u$_w=u[_w6]).push.apply(_u$_w,_toConsumableArray(C.attributes[_w6]));}}P+=C.positions.length,S+=C.cells.length;}}u.a_color=l,f&&p&&p.length>0&&(u.a_sourceRect=p);var g={positions:s,cells:c,attributes:u,uniforms:v,cellsCount:S*3,program:T};return m&&m.length&&(g.textureCoord=m),d&&y.length>0&&(u.a_clipUV=y),g;}},/* 29 *//***/function(h,r,t){t.r(r);var e=t(1),n=t(30),i=t(26),a=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(u,g){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(u);g&&(C=C.filter(function(A){return Object.getOwnPropertyDescriptor(u,A).enumerable;})),M.push.apply(M,C);}return M;}function s(u){for(var g=1;g<arguments.length;g++){var M=arguments[g]!=null?arguments[g]:{};g%2?o(Object(M),!0).forEach(function(C){c(u,C,M[C]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(M)):o(Object(M)).forEach(function(C){Object.defineProperty(u,C,Object.getOwnPropertyDescriptor(M,C));});}return u;}function c(u,g,M){return g in u?Object.defineProperty(u,g,{value:M,enumerable:!0,configurable:!0,writable:!0}):u[g]=M,u;}var m=Symbol("mesh"),l=Symbol("count"),p=Symbol("blend"),y=Symbol("filter"),P=Symbol("textures"),S=Symbol("textureOptions"),v=Symbol("cloudColor"),T=Symbol("cloudFilter"),f=Symbol("buffer");function d(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var M=new Float32Array(3*u),C=new Float32Array(3*u),A=new Float32Array(4*u),L=new Float32Array(4*u),O=new Float32Array(4*u),w=new Float32Array(4*u),b=new Float32Array(4*u),I=new Uint8Array(u),R=new Uint8Array(4*u),W=new Uint8Array(4*u);return g&&(M.set(g.transform0,0),C.set(g.transform1,0),A.set(g.color0,0),L.set(g.color1,0),O.set(g.color2,0),w.set(g.color3,0),b.set(g.color4,0),I.set(g.frameIndex,0),R.set(g.fillColor,0),W.set(g.strokeColor,0)),{bufferSize:u,transform0:M,transform1:C,color0:A,color1:L,color2:O,color3:w,color4:b,frameIndex:I,fillColor:R,strokeColor:W};}r["default"]=/*#__PURE__*/function(){function _class(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref37=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref37$buffer=_ref37.buffer,M=_ref37$buffer===void 0?1e3:_ref37$buffer;_classCallCheck(this,_class);M=Math.max(M,g),this[l]=g,this[m]=u,this[f]=d(M),this[P]=[],this[y]=[],this[v]=!1,this[T]=!1,this[p]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var g=this[l];for(var M=u;M<g;M++)this[f].transform0.set([1,0,0],M*3),this[f].transform1.set([0,1,0],M*3),this[f].frameIndex.set([-1],M),this[f].fillColor.set([0,0,0,0],M*4),this[f].strokeColor.set([0,0,0,0],M*4),this.setColorTransform(M,null);}},{key:"bufferSize",get:function get(){return this[f].bufferSize;}},{key:"mesh",get:function get(){return this[m];},set:function set(u){this[m]=u,this[P]&&this.setTextureFrames(this[P],this[S]);}},{key:"hasCloudColor",get:function get(){return this[v];}},{key:"hasCloudFilter",get:function get(){return this[T];}},{key:"_getFilter",value:function _getFilter(u){return this[y][u]=this[y][u]||[],this[y][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[m].enableBlend||this[p];}},{key:"canIgnore",value:function canIgnore(){return this[m].canIgnore();}},{key:"delete",value:function _delete(u){if(u>=this[l]||u<0)throw new Error("Out of range.");var _this$f2=this[f],g=_this$f2.transform0,M=_this$f2.transform1,C=_this$f2.color0,A=_this$f2.color1,L=_this$f2.color2,O=_this$f2.color3,w=_this$f2.color4,b=_this$f2.frameIndex,I=_this$f2.fillColor,R=_this$f2.strokeColor;g.set(g.subarray(3*(u+1)),3*u),M.set(M.subarray(3*(u+1)),3*u),C.set(C.subarray(4*(u+1)),4*u),A.set(A.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),O.set(O.subarray(4*(u+1)),4*u),w.set(w.subarray(4*(u+1)),4*u),b.set(b.subarray(u+1),u),I.set(I.subarray(4*(u+1)),4*u),R.set(R.subarray(4*(u+1)),4*u);for(var W in this[y])W===u?delete this[y][W]:W>u&&(this[y][W-1]=this[y][W],delete this[y][W]);this[l]--;}},{key:"setColorTransform",value:function setColorTransform(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;var _this$f3=this[f],M=_this$f3.color0,C=_this$f3.color1,A=_this$f3.color2,L=_this$f3.color3,O=_this$f3.color4;return g!=null?(M.set([g[0],g[5],g[10],g[15]],u),C.set([g[1],g[6],g[11],g[16]],u),A.set([g[2],g[7],g[12],g[17]],u),L.set([g[3],g[8],g[13],g[18]],u),O.set([g[4],g[9],g[14],g[19]],u),this[p]=this[p]||g[18]<1,this[T]=!0):(M.set([1,0,0,0],u),C.set([0,1,0,0],u),A.set([0,0,1,0],u),L.set([0,0,0,1],u),O.set([0,0,0,0],u)),this;}},{key:"getColorTransform",value:function getColorTransform(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;var _this$f4=this[f],g=_this$f4.color0,M=_this$f4.color1,C=_this$f4.color2,A=_this$f4.color3,L=_this$f4.color4;return[g[u],M[u],C[u],A[u],L[u],g[u+1],M[u+1],C[u+1],A[u+1],L[u+1],g[u+2],M[u+2],C[u+2],A[u+2],L[u+2],g[u+3],M[u+3],C[u+3],A[u+3],L[u+3]];}},{key:"transformColor",value:function transformColor(u,g){var M=this.getColorTransform(u);return M=Object(n.multiply)(M,g),this.setColorTransform(u,M),this;}},{key:"setFillColor",value:function setFillColor(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[v]=!0),this[f].fillColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[v]=!0),this[f].strokeColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"getCloudRGBA",value:function getCloudRGBA(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;var _this$f5=this[f],g=_this$f5.fillColor,M=_this$f5.strokeColor,C=[g[u],g[u+1],g[u+2],g[u+3]],A=[M[u],M[u+1],M[u+2],M[u+3]];return C[3]/=255,A[3]/=255,{fill:"rgba(".concat(C.join(),")"),stroke:"rgba(".concat(A.join(),")")};}},{key:"grayscale",value:function grayscale(u,g){this.transformColor(u,Object(n.grayscale)(g)),this._getFilter(u).push("grayscale(".concat(100*g,"%)"));}},{key:"brightness",value:function brightness(u,g){this.transformColor(u,Object(n.brightness)(g)),this._getFilter(u).push("brightness(".concat(100*g,"%)"));}},{key:"saturate",value:function saturate(u,g){this.transformColor(u,Object(n.saturate)(g)),this._getFilter(u).push("saturate(".concat(100*g,"%)"));}},{key:"contrast",value:function contrast(u,g){this.transformColor(u,Object(n.contrast)(g)),this._getFilter(u).push("contrast(".concat(100*g,"%)"));}},{key:"invert",value:function invert(u,g){this.transformColor(u,Object(n.invert)(g)),this._getFilter(u).push("invert(".concat(100*g,"%)"));}},{key:"sepia",value:function sepia(u,g){this.transformColor(u,Object(n.sepia)(g)),this._getFilter(u).push("sepia(".concat(100*g,"%)"));}},{key:"opacity",value:function opacity(u,g){this.transformColor(u,Object(n.opacity)(g)),this._getFilter(u).push("opacity(".concat(100*g,"%)"));}},{key:"hueRotate",value:function hueRotate(u,g){this.transformColor(u,Object(n.hueRotate)(g)),this._getFilter(u).push("hue-rotate(".concat(g,"deg)"));}},{key:"setTransform",value:function setTransform(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$f6=this[f],M=_this$f6.transform0,C=_this$f6.transform1;return M.set([g[0],g[2],g[4]],u),C.set([g[1],g[3],g[5]],u),this;}},{key:"getTransform",value:function getTransform(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=3;var _this$f7=this[f],g=_this$f7.transform0,M=_this$f7.transform1;return[g[u],M[u],g[u+1],M[u+1],g[u+2],M[u+2]];}},{key:"getTextureFrame",value:function getTextureFrame(u){return this[P][this[f].frameIndex[u]];}},{key:"setTextureFrames",value:function setTextureFrames(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[m].setTexture(u[0],g),this[P]=u,this[S]=g;}},{key:"setFrameIndex",value:function setFrameIndex(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");var M=this[P].length;if(M<=0)throw new Error("No frames");this[f].frameIndex[u]=g%M;}},{key:"amount",get:function get(){return this[l];},set:function set(u){var g=this[l];u!==g&&(u>this[f].bufferSize&&(this[f]=d(Math.max(u,this[f].bufferSize+1e3),this[f])),this[l]=u,u>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$m$meshData=this[m].meshData,u=_this$m$meshData.attributes,g=_this$m$meshData.cells,M=_this$m$meshData.positions,C=_this$m$meshData.textureCoord,A=_this$m$meshData.uniforms,L=this[P],O={attributes:s({},u),cells:g,positions:M,textureCoord:C,uniforms:s({},A),instanceCount:this[l],enableBlend:this.enableBlend};L.length&&L.forEach(function(G,Z){O.uniforms["u_texFrame".concat(Z)]=G;});var _this$f8=this[f],w=_this$f8.transform0,b=_this$f8.transform1,I=_this$f8.color0,R=_this$f8.color1,W=_this$f8.color2,z=_this$f8.color3,K=_this$f8.color4,J=_this$f8.fillColor,q=_this$f8.strokeColor,U=_this$f8.frameIndex;return this[m].uniforms.u_texSampler&&(O.attributes.a_frameIndex={data:U,divisor:1}),O.attributes.a_transform0={data:w,divisor:1},O.attributes.a_transform1={data:b,divisor:1},O.attributes.a_colorCloud0={data:I,divisor:1},O.attributes.a_colorCloud1={data:R,divisor:1},O.attributes.a_colorCloud2={data:W,divisor:1},O.attributes.a_colorCloud3={data:z,divisor:1},O.attributes.a_colorCloud4={data:K,divisor:1},this.hasCloudColor&&(O.attributes.a_fillCloudColor={data:J,divisor:1},O.attributes.a_strokeCloudColor={data:q,divisor:1}),O;}},{key:"setProgram",value:function setProgram(u){this[m].setProgram(u);}},{key:"program",get:function get(){return this[m].program;}},{key:"transform",value:function transform(u,g){var M=this.getTransform(u);return g=e.mat2d.multiply(Array.of(0,0,0,0,0,0),M,g),this.setTransform(u,g),this;}},{key:"translate",value:function translate(u,_ref38){var _ref39=_slicedToArray(_ref38,2),g=_ref39[0],M=_ref39[1];var C=e.mat2d.create();return C=e.mat2d.translate(Array.of(0,0,0,0,0,0),C,[g,M]),this.transform(u,C);}},{key:"rotate",value:function rotate(u,g){var _ref40=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref41=_slicedToArray(_ref40,2),M=_ref41[0],C=_ref41[1];var A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[M,C]),A=e.mat2d.rotate(Array.of(0,0,0,0,0,0),A,g),A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[-M,-C]),this.transform(u,A);}},{key:"scale",value:function scale(u,_ref42){var _ref43=_slicedToArray(_ref42,2),g=_ref43[0],_ref43$=_ref43[1],M=_ref43$===void 0?g:_ref43$;var _ref44=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref45=_slicedToArray(_ref44,2),C=_ref45[0],A=_ref45[1];var L=e.mat2d.create();return L=e.mat2d.translate(Array.of(0,0,0,0,0,0),L,[C,A]),L=e.mat2d.scale(Array.of(0,0,0,0,0,0),L,[g,M]),L=e.mat2d.translate(Array.of(0,0,0,0,0,0),L,[-C,-A]),this.transform(u,L);}},{key:"skew",value:function skew(u,_ref46){var _ref47=_slicedToArray(_ref46,2),g=_ref47[0],_ref47$=_ref47[1],M=_ref47$===void 0?g:_ref47$;var _ref48=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref49=_slicedToArray(_ref48,2),C=_ref49[0],A=_ref49[1];var L=e.mat2d.create();return L=e.mat2d.translate(Array.of(0,0,0,0,0,0),L,[C,A]),L=e.mat2d.multiply(Array.of(0,0,0,0,0,0),L,e.mat2d.fromValues(1,Math.tan(M),Math.tan(g),1,0,0)),L=e.mat2d.translate(Array.of(0,0,0,0,0,0),L,[-C,-A]),this.transform(u,L);}},{key:"isPointCollision",value:function isPointCollision(u,_ref50){var _this$m;var _ref51=_slicedToArray(_ref50,2),g=_ref51[0],M=_ref51[1];var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var A=this.getTransform(u),L=Object(i.transformPoint)([g,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),A));return(_this$m=this[m]).isPointCollision.apply(_this$m,_toConsumableArray(L).concat([C]));}},{key:"isPointInFill",value:function isPointInFill(u,_ref52){var _ref53=_slicedToArray(_ref52,2),g=_ref53[0],M=_ref53[1];return this.isPointCollision(u,[g,M],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(u,_ref54){var _ref55=_slicedToArray(_ref54,2),g=_ref55[0],M=_ref55[1];return this.isPointCollision(u,[g,M],"stroke");}}]);}();},/* 30 *//***/function(h,r,t){t.r(r),t.d(r,"multiply",function(){return n;}),t.d(r,"grayscale",function(){return i;}),t.d(r,"brightness",function(){return a;}),t.d(r,"saturate",function(){return o;}),t.d(r,"contrast",function(){return s;}),t.d(r,"invert",function(){return c;}),t.d(r,"sepia",function(){return m;}),t.d(r,"opacity",function(){return l;}),t.d(r,"hueRotate",function(){return p;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(y,P){var S=[],v=y[0],T=y[1],f=y[2],d=y[3],u=y[4],g=y[5],M=y[6],C=y[7],A=y[8],L=y[9],O=y[10],w=y[11],b=y[12],I=y[13],R=y[14],W=y[15],z=y[16],K=y[17],J=y[18],q=y[19];var U=P[0],G=P[1],Z=P[2],rt=P[3],et=P[4];return S[0]=U*v+G*g+Z*O+rt*W,S[1]=U*T+G*M+Z*w+rt*z,S[2]=U*f+G*C+Z*b+rt*K,S[3]=U*d+G*A+Z*I+rt*J,S[4]=U*u+G*L+Z*R+rt*q+et,U=P[5],G=P[6],Z=P[7],rt=P[8],et=P[9],S[5]=U*v+G*g+Z*O+rt*W,S[6]=U*T+G*M+Z*w+rt*z,S[7]=U*f+G*C+Z*b+rt*K,S[8]=U*d+G*A+Z*I+rt*J,S[9]=U*u+G*L+Z*R+rt*q+et,U=P[10],G=P[11],Z=P[12],rt=P[13],et=P[14],S[10]=U*v+G*g+Z*O+rt*W,S[11]=U*T+G*M+Z*w+rt*z,S[12]=U*f+G*C+Z*b+rt*K,S[13]=U*d+G*A+Z*I+rt*J,S[14]=U*u+G*L+Z*R+rt*q+et,U=P[15],G=P[16],Z=P[17],rt=P[18],et=P[19],S[15]=U*v+G*g+Z*O+rt*W,S[16]=U*T+G*M+Z*w+rt*z,S[17]=U*f+G*C+Z*b+rt*K,S[18]=U*d+G*A+Z*I+rt*J,S[19]=U*u+G*L+Z*R+rt*q+et,S;}function i(y){y=Object(e.clamp)(0,1,y);var P=0.2126*y,S=0.7152*y,v=0.0722*y;return[P+1-y,S,v,0,0,P,S+1-y,v,0,0,P,S,v+1-y,0,0,0,0,0,1,0];}function a(y){return[y,0,0,0,0,0,y,0,0,0,0,0,y,0,0,0,0,0,1,0];}function o(y){var P=0.2126*(1-y),S=0.7152*(1-y),v=0.0722*(1-y);return[P+y,S,v,0,0,P,S+y,v,0,0,P,S,v+y,0,0,0,0,0,1,0];}function s(y){var P=0.5*(1-y);return[y,0,0,0,P,0,y,0,0,P,0,0,y,0,P,0,0,0,1,0];}function c(y){var P=1-2*y;return[P,0,0,0,y,0,P,0,0,y,0,0,P,0,y,0,0,0,1,0];}function m(y){return[1-0.607*y,0.769*y,0.189*y,0,0,0.349*y,1-0.314*y,0.168*y,0,0,0.272*y,0.534*y,1-0.869*y,0,0,0,0,0,1,0];}function l(y){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,y,0];}function p(y){var P=y/180*Math.PI,S=Math.cos(P),v=Math.sin(P),T=0.2126,f=0.7152,d=0.0722;return[T+S*(1-T)+v*-T,f+S*-f+v*-f,d+S*-d+v*(1-d),0,0,T+S*-T+v*0.143,f+S*(1-f)+v*0.14,d+S*-d+v*-0.283,0,0,T+S*-T+v*-(1-T),f+S*-f+v*f,d+S*(1-d)+v*d,0,0,0,0,0,1,0];}},/* 31 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);function i(a){var o=n()(a);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 *//***/function(h,r,t){var e=t(33),n=t(37),i=t(39);h.exports=function(o){var s,c=e(o);return c.space?(s=Array(3),s[0]=i(c.values[0],0,255),s[1]=i(c.values[1],0,255),s[2]=i(c.values[2],0,255),c.space[0]==="h"&&(s=n.rgb(s)),s.push(i(c.alpha,0,1)),s):[];};},/* 33 *//***/function(h,r,t){(function(e){var n=t(34),i=t(35),a=t(36);h.exports=s;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function s(c){var m,l=[],p=1,y;if(typeof c=="string"){if(n[c])l=n[c].slice(),y="rgb";else if(c==="transparent")p=0,y="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(c)){var P=c.slice(1),S=P.length,v=S<=4;p=1,v?(l=[parseInt(P[0]+P[0],16),parseInt(P[1]+P[1],16),parseInt(P[2]+P[2],16)],S===4&&(p=parseInt(P[3]+P[3],16)/255)):(l=[parseInt(P[0]+P[1],16),parseInt(P[2]+P[3],16),parseInt(P[4]+P[5],16)],S===8&&(p=parseInt(P[6]+P[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),y="rgb";}else if(m=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(c)){var T=m[1],f=T==="rgb",P=T.replace(/a$/,"");y=P;var S=P==="cmyk"?4:P==="gray"?1:3;l=m[2].trim().split(/\s*,\s*/).map(function(M,C){if(/%$/.test(M))return C===S?parseFloat(M)/100:P==="rgb"?parseFloat(M)*255/100:parseFloat(M);if(P[C]==="h"){if(/deg$/.test(M))return parseFloat(M);if(o[M]!==void 0)return o[M];}return parseFloat(M);}),T===P&&l.push(1),p=f||l[S]===void 0?1:l[S],l=l.slice(0,S);}else c.length>10&&/[0-9](?:\s|\/)/.test(c)&&(l=c.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),y=c.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(c))y="rgb",l=[c>>>16,(c&65280)>>>8,c&255];else if(i(c)){var d=a(c.r,c.red,c.R,null);d!==null?(y="rgb",l=[d,a(c.g,c.green,c.G),a(c.b,c.blue,c.B)]):(y="hsl",l=[a(c.h,c.hue,c.H),a(c.s,c.saturation,c.S),a(c.l,c.lightness,c.L,c.b,c.brightness)]),p=a(c.a,c.alpha,c.opacity,1),c.opacity!=null&&(p/=100);}else(Array.isArray(c)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(c))&&(l=[c[0],c[1],c[2]],y="rgb",p=c.length===4?c[3]:1);return{space:y,values:l,alpha:p};}}).call(this,t(22));},/* 34 *//***/function(h,r,t){h.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};},/* 35 *//***/function(h,r,t){var e=Object.prototype.toString;h.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 *//***/function(h,r){h.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 *//***/function(h,r,t){var e=t(38);h.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var i=n[0]/360,a=n[1]/100,o=n[2]/100,s,c,m,l,p;if(a===0)return p=o*255,[p,p,p];o<0.5?c=o*(1+a):c=o+a-o*a,s=2*o-c,l=[0,0,0];for(var y=0;y<3;y++)m=i+1/3*-(y-1),m<0?m++:m>1&&m--,6*m<1?p=s+(c-s)*6*m:2*m<1?p=c:3*m<2?p=s+(c-s)*(2/3-m)*6:p=s,l[y]=p*255;return l;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,o=n[2]/255,s=Math.min(i,a,o),c=Math.max(i,a,o),m=c-s,l,p,y;return c===s?l=0:i===c?l=(a-o)/m:a===c?l=2+(o-i)/m:o===c&&(l=4+(i-a)/m),l=Math.min(l*60,360),l<0&&(l+=360),y=(s+c)/2,c===s?p=0:y<=0.5?p=m/(c+s):p=m/(2-c-s),[l,p*100,y*100];};},/* 38 *//***/function(h,r,t){h.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 *//***/function(h,r){h.exports=t;function t(e,n,i){return n<i?e<n?n:e>i?i:e:e<i?i:e>n?n:e;}},/* 40 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return d;});var e=t(41),n=/* @__PURE__ */t.n(e),i=t(42),a=/* @__PURE__ */t.n(i),o=t(43),s=/* @__PURE__ */t.n(o),c=t(44),m=t(46),l=/* @__PURE__ */t.n(m),p=t(53),y=t(55);t(1).glMatrix.setMatrixArrayType(Array);var P=Symbol("contours"),S=Symbol("path"),v=Symbol("simplify"),T=Symbol("scale"),f=2*Math.PI;var d=/*#__PURE__*/function(){function d(){var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,d);typeof g=="string"&&(g={path:g}),g.path?this[S]=n()(g.path):this[S]=[],this[P]=null,this[v]=g.simplify!=null?g.simplify:0,this[T]=g.scale!=null?g.scale:2;}return _createClass(d,[{key:"contours",get:function get(){var g=null;if(!this[P]&&this[S]){var M=Object(c["default"])(s()(this[S]));this[P]=l()(M,this[T],this[v]),this[P].path=M,this[P].simplify=this[v],this[P].scale=this[T];}return this[P]&&(g=this[P].map(function(M){return _toConsumableArray(M);}),g.path=this[P].path,g.simplify=this[P].simplify,g.scale=this[P].scale),g;}},{key:"path",get:function get(){return this[S];}},{key:"simplify",get:function get(){return this[v];}},{key:"boundingBox",get:function get(){var g=this.contours;if(g&&g.length){var M=g.reduce(function(C,A){return[].concat(_toConsumableArray(C),_toConsumableArray(A));});return a()(M);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var g=this.boundingBox;return g?[0.5*(g[0][0]+g[1][0]),0.5*(g[0][1]+g[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$S;var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var C=Object(c["default"])(s()(this[S])).map(function(_ref56){var _ref57=_toArray(_ref56),A=_ref57[0],L=_ref57.slice(1);var O=[A];for(var w=0;w<L.length;w+=2){var b=L[w]-g,I=L[w+1]-M;O.push(b,I);}return O;});return this.beginPath(),(_this$S=this[S]).push.apply(_this$S,_toConsumableArray(C)),this;}},{key:"getPointAtLength",value:function getPointAtLength(g){return this.contours?Object(p.getPointAtLength)(this[P],g):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(p.getTotalLength)(this[P]):0;}},{key:"addPath",value:function addPath(g){var _this$S2;this[P]=null,typeof g=="string"&&(g=n()(g)),(_this$S2=this[S]).push.apply(_this$S2,_toConsumableArray(g));}},{key:"beginPath",value:function beginPath(){this[S]=[],this[P]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(g,M,C,A,L,O,w){var b=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(O+=L,w+=L,C<=0||A<=0||w===O)return;w<O&&(w=O+f+(w-O)%f),w-O>f&&(w=O+f);var I=w-O;I>=f&&(w-=1e-3);var R=this[S].length>0&&I<f?"L":"M";var W=Object(y.getPoint)(g,M,C,A,O),z=Object(y.getPoint)(g,M,C,A,w),K=+!b;var J=I>Math.PI?1:0;b&&(J=1-J),R+=W.join(" "),R+="A".concat(C," ").concat(A," 0 ").concat(J," ").concat(K," ").concat(z.join(" ")),I>=f&&(R+="Z"),this.addPath(R);}},{key:"arc",value:function arc(g,M,C,A,L){var O=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,M,C,C,0,A,L,O);}},{key:"arcTo",value:function arcTo(g,M,C,A,L,O,w){this[P]=null,this[S].push(["A",g,M,C,A,L,O,w]);}},{key:"moveTo",value:function moveTo(g,M){this[P]=null,this[S].push(["M",g,M]);}},{key:"lineTo",value:function lineTo(g,M){this[P]=null,this[S].push(["L",g,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(g,M,C,A,L,O){this[P]=null,this[S].push(["C",g,M,C,A,L,O]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,M,C,A){this[P]=null,this[S].push(["Q",g,M,C,A]);}},{key:"rect",value:function rect(g,M,C,A){var L="M".concat(g," ").concat(M,"L").concat(g+C," ").concat(M,"L").concat(g+C," ").concat(M+A,"L").concat(g," ").concat(M+A,"Z");this.addPath(L);}},{key:"closePath",value:function closePath(){this[P]=null;var g=[];var M=this[S].length;M>0&&(g=this[S][M-1]),g[0]!=="Z"&&g[0]!=="z"&&this[S].push(["Z"]);}}]);}();},/* 41 *//***/function(h,r){h.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(o){var s=[];return o.replace(e,function(c,m,l){var p=m.toLowerCase();for(l=a(l),p=="m"&&l.length>2&&(s.push([m].concat(l.splice(0,2))),p="l",m=m=="m"?"l":"L");;){if(l.length==t[p])return l.unshift(m),s.push(l);if(l.length<t[p])throw new Error("malformed path data");s.push([m].concat(l.splice(0,t[p])));}}),s;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function a(o){var s=o.match(i);return s?s.map(Number):[];}},/* 42 *//***/function(h,r,t){h.exports=e;function e(n){var i=n.length;if(i===0)return[[],[]];for(var a=n[0].length,o=n[0].slice(),s=n[0].slice(),c=1;c<i;++c)for(var m=n[c],l=0;l<a;++l){var p=m[l];o[l]=Math.min(o[l],p),s[l]=Math.max(s[l],p);}return[o,s];}},/* 43 *//***/function(h,r){h.exports=t;function t(e){var n=0,i=0,a=0,o=0;return e.map(function(s){s=s.slice();var c=s[0],m=c.toUpperCase();if(c!=m)switch(s[0]=m,c){case"a":s[6]+=a,s[7]+=o;break;case"v":s[1]+=o;break;case"h":s[1]+=a;break;default:for(var l=1;l<s.length;)s[l++]+=a,s[l++]+=o;}switch(m){case"Z":a=n,o=i;break;case"H":a=s[1];break;case"V":o=s[1];break;case"M":a=n=s[1],o=i=s[2];break;default:a=s[s.length-2],o=s[s.length-1];}return s;});}},/* 44 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(o){for(var s,c=[],m=0,l=0,p=0,y=0,P=null,S=null,v=0,T=0,f=0,d=o.length;f<d;f++){var u=o[f],g=u[0];switch(g){case"M":p=u[1],y=u[2];break;case"A":var M=Object(e["default"])(v,T,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!M.length)continue;M=M.map(function(w){var _w7=_slicedToArray(w,8),b=_w7[0],I=_w7[1],R=_w7[2],W=_w7[3],z=_w7[4],K=_w7[5],J=_w7[6],q=_w7[7];return{x1:R,y1:W,x2:z,y2:K,x:J,y:q};});for(var C=0,A;C<M.length;C++)A=M[C],u=["C",A.x1,A.y1,A.x2,A.y2,A.x,A.y],C<M.length-1&&c.push(u);break;case"S":var L=v,O=T;(s=="C"||s=="S")&&(L+=L-m,O+=O-l),u=["C",L,O,u[1],u[2],u[3],u[4]];break;case"T":s=="Q"||s=="T"?(P=v*2-P,S=T*2-S):(P=v,S=T),u=a(v,T,P,S,u[1],u[2]);break;case"Q":P=u[1],S=u[2],u=a(v,T,u[1],u[2],u[3],u[4]);break;case"L":u=i(v,T,u[1],u[2]);break;case"H":u=i(v,T,u[1],T);break;case"V":u=i(v,T,v,u[1]);break;case"Z":u=i(v,T,p,y);break;}s=g,v=u[u.length-2],T=u[u.length-1],u.length>4?(m=u[u.length-4],l=u[u.length-3]):(m=v,l=T),c.push(u);}return c;}function i(o,s,c,m){return["C",o,s,c,m,c,m];}function a(o,s,c,m,l,p){return["C",o/3+2/3*c,s/3+2/3*m,l/3+2/3*c,p/3+2/3*m,l,p];}},/* 45 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(s,c,m,l){var p=s*l-c*m<0?-1:1;var y=s*m+c*l;return y>1&&(y=1),y<-1&&(y=-1),p*Math.acos(y);}function i(s,c,m,l,p,y,P,S,v,T){var f=T*(s-m)/2+v*(c-l)/2,d=-v*(s-m)/2+T*(c-l)/2,u=P*P,g=S*S,M=f*f,C=d*d;var A=u*g-u*C-g*M;A<0&&(A=0),A/=u*C+g*M,A=Math.sqrt(A)*(p===y?-1:1);var L=A*P/S*d,O=A*-S/P*f,w=T*L-v*O+(s+m)/2,b=v*L+T*O+(c+l)/2,I=(f-L)/P,R=(d-O)/S,W=(-f-L)/P,z=(-d-O)/S,K=n(1,0,I,R);var J=n(I,R,W,z);return y===0&&J>0&&(J-=e),y===1&&J<0&&(J+=e),[w,b,K,J];}function a(s,c){var m=1.3333333333333333*Math.tan(c/4),l=Math.cos(s),p=Math.sin(s),y=Math.cos(s+c),P=Math.sin(s+c);return[l,p,l-p*m,p+l*m,y+P*m,P-y*m,y,P];}function o(s,c,m,l,p,y,P,S,v){var T=Math.sin(v*e/360),f=Math.cos(v*e/360),d=f*(s-m)/2+T*(c-l)/2,u=-T*(s-m)/2+f*(c-l)/2;if(d===0&&u===0)return[];if(P===0||S===0)return[];P=Math.abs(P),S=Math.abs(S);var g=d*d/(P*P)+u*u/(S*S);g>1&&(P*=Math.sqrt(g),S*=Math.sqrt(g));var M=i(s,c,m,l,p,y,P,S,T,f),C=[];var A=M[2],L=M[3];var O=Math.max(Math.ceil(Math.abs(L)/(e/4)),1);L/=O;for(var w=0;w<O;w++)C.push(a(A,L)),A+=L;return C.map(function(w){for(var b=0;b<w.length;b+=2){var I=w[b+0],R=w[b+1];I*=P,R*=S;var W=f*I-T*R,z=T*I+f*R;w[b+0]=W+M[0],w[b+1]=z+M[1];}return w;});}},/* 46 *//***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(47),_t2=t(49),n=_t2.copy,i=t(50);function a(l,p,y){return l[0]=p,l[1]=y,l;}var o=[0,0],s=[0,0],c=[0,0];function m(l,p,y,P){e(y,a(o,P[1],P[2]),a(s,P[3],P[4]),a(c,P[5],P[6]),p,l);}h.exports=function(p,y,P){var S=[],v=[],T=[0,0];return p.forEach(function(f,d,u){if(f[0]==="M")n(T,f.slice(1)),v.length>0&&(S.push(v),v=[]);else if(f[0]==="C")m(v,y,T,f),a(T,f[5],f[6]);else throw new Error("illegal type in SVG: "+f[0]);}),v.length>0&&S.push(v),S.map(function(f){return i(f,P||0);});};},/* 47 *//***/function(h,r,t){h.exports=t(48)();},/* 48 *//***/function(h,r){function t(n){return[n[0],n[1]];}function e(n,i){return[n,i];}h.exports=function(i){i=i||{};var a=typeof i.recursion=="number"?i.recursion:8,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,s=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,c=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,m=i.angleTolerance||0,l=i.cuspLimit||0;return function(S,v,T,f,d,u){u||(u=[]),d=typeof d=="number"?d:1;var g=s/d;return g*=g,p(S,v,T,f,u,g),u;};function p(P,S,v,T,f,d){f.push(t(P));var u=P[0],g=P[1],M=S[0],C=S[1],A=v[0],L=v[1],O=T[0],w=T[1];y(u,g,M,C,A,L,O,w,f,d,0),f.push(t(T));}function y(P,S,v,T,f,d,u,g,M,C,A){if(!(A>a)){var L=Math.PI,O=(P+v)/2,w=(S+T)/2,b=(v+f)/2,I=(T+d)/2,R=(f+u)/2,W=(d+g)/2,z=(O+b)/2,K=(w+I)/2,J=(b+R)/2,q=(I+W)/2,U=(z+J)/2,G=(K+q)/2;if(A>0){var Z=u-P,rt=g-S,et=Math.abs((v-u)*rt-(T-g)*Z),it=Math.abs((f-u)*rt-(d-g)*Z),X,ct;if(et>o&&it>o){if((et+it)*(et+it)<=C*(Z*Z+rt*rt)){if(m<c){M.push(e(U,G));return;}var ut=Math.atan2(d-T,f-v);if(X=Math.abs(ut-Math.atan2(T-S,v-P)),ct=Math.abs(Math.atan2(g-d,u-f)-ut),X>=L&&(X=2*L-X),ct>=L&&(ct=2*L-ct),X+ct<m){M.push(e(U,G));return;}if(l!==0){if(X>l){M.push(e(v,T));return;}if(ct>l){M.push(e(f,d));return;}}}}else if(et>o){if(et*et<=C*(Z*Z+rt*rt)){if(m<c){M.push(e(U,G));return;}if(X=Math.abs(Math.atan2(d-T,f-v)-Math.atan2(T-S,v-P)),X>=L&&(X=2*L-X),X<m){M.push(e(v,T)),M.push(e(f,d));return;}if(l!==0&&X>l){M.push(e(v,T));return;}}}else if(it>o){if(it*it<=C*(Z*Z+rt*rt)){if(m<c){M.push(e(U,G));return;}if(X=Math.abs(Math.atan2(g-d,u-f)-Math.atan2(d-T,f-v)),X>=L&&(X=2*L-X),X<m){M.push(e(v,T)),M.push(e(f,d));return;}if(l!==0&&X>l){M.push(e(f,d));return;}}}else if(Z=U-(P+u)/2,rt=G-(S+g)/2,Z*Z+rt*rt<=C){M.push(e(U,G));return;}}y(P,S,O,w,z,K,U,G,M,C,A+1),y(U,G,J,q,R,W,u,g,M,C,A+1);}}};},/* 49 *//***/function(h,r,t){t.r(r),t.d(r,"create",function(){return i;}),t.d(r,"clone",function(){return n;}),t.d(r,"copy",function(){return a;}),t.d(r,"scaleAndAdd",function(){return o;}),t.d(r,"dot",function(){return s;}),t.d(r,"rotate",function(){return c;}),t.d(r,"cross",function(){return m;}),t.d(r,"sub",function(){return l;}),t.d(r,"add",function(){return p;}),t.d(r,"computeMiter",function(){return v;}),t.d(r,"normal",function(){return T;}),t.d(r,"direction",function(){return f;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(d){return[d[0],d[1]];}function i(){return[0,0];}var a=e.vec2.copy,o=e.vec2.scaleAndAdd,s=e.vec2.dot,c=e.vec2.rotate,m=e.vec2.cross,l=e.vec2.sub,p=e.vec2.add,y=e.vec2.normalize,P=e.vec2.set,S=i();function v(d,u,g,M,C){p(d,g,M),y(d,d),P(u,-d[1],d[0]),P(S,-g[1],g[0]);var A=C/s(u,S);return Math.abs(A);}function T(d,u){return P(d,-u[1],u[0]),d;}function f(d,u,g){return l(d,u,g),y(d,d),d;}},/* 50 *//***/function(h,r,t){var e=t(51),n=t(52);h.exports=function(a,o){return a=e(a,o),a=n(a,o),a;},h.exports.radialDistance=e,h.exports.douglasPeucker=n;},/* 51 *//***/function(h,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a;}h.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var a=i*i,o=n[0],s=[o],c,m=1,l=n.length;m<l;m++)c=n[m],t(c,o)>a&&(s.push(c),o=c);return o!==c&&s.push(c),s;};},/* 52 *//***/function(h,r){function t(n,i,a){var o=i[0],s=i[1],c=a[0]-o,m=a[1]-s;if(c!==0||m!==0){var l=((n[0]-o)*c+(n[1]-s)*m)/(c*c+m*m);l>1?(o=a[0],s=a[1]):l>0&&(o+=c*l,s+=m*l);}return c=n[0]-o,m=n[1]-s,c*c+m*m;}function e(n,i,a,o,s){for(var c=o,m,l=i+1;l<a;l++){var p=t(n[l],n[i],n[a]);p>c&&(m=l,c=p);}c>o&&(m-i>1&&e(n,i,m,o,s),s.push(n[m]),a-m>1&&e(n,m,a,o,s));}h.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var o=a*a,s=i.length-1,c=[i[0]];return e(i,0,s,o,c),c.push(i[s]),c;};},/* 53 *//***/function(h,r,t){t.r(r),t.d(r,"getTotalLength",function(){return n;}),t.d(r,"getPointAtLength",function(){return a;}),t.d(r,"getDashContours",function(){return o;});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(s){if(s.totalLength!=null)return s.totalLength;var c=0;return s.forEach(function(m){var l=m[0];for(var p=1;p<m.length;p++){var y=m[p];c+=Object(e.distance)(l,y),l=y;}}),s.totalLength=c,c;}function i(s,c){var m=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(c<=0)throw new TypeError("Length must > 0");var l=n(s);if(c>=l){var y=s[s.length-1],P=y[y.length-2],S=y[y.length-1],v=Math.atan2(S[1]-P[1],S[0]-P[0]);return{current:s.map(function(T){return _toConsumableArray(T);}),point:{x:S[0],y:S[1],angle:v}};}var p=[];for(var _y2=0;_y2<s.length;_y2++){p[_y2]=[];var _P=s[_y2];var _S2=_P[0];for(var _v4=1;_v4<_P.length;_v4++){var _T8=_P[_v4],_f9=Object(e.distance)(_S2,_T8);if(c<_f9){var d=c/_f9,u=Math.atan2(_T8[1]-_S2[1],_T8[0]-_S2[0]),g={x:_S2[0]*(1-d)+_T8[0]*d,y:_S2[1]*(1-d)+_T8[1]*d,angle:u};if(p[_y2].push(_S2),c>0&&p[_y2].push([g.x,g.y]),!m)return{current:p,point:g};var M=[],C=_y2;for(;_y2<s.length;_y2++){for(M[_y2-C]=[],_y2===C&&M[0].push([g.x,g.y]);_v4<_P.length;_v4++)M[_y2-C].push(_P[_v4]);_v4=0;}return{current:p,point:g,rest:M};}c-=_f9,p[_y2].push(_S2),_S2=_T8;}}}function a(s,c){if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(s.length<=0)return{x:0,y:0,angle:0};if(c<=0){var m=s[0][0],l=s[0][1],p=Math.atan2(l[1]-m[1],l[0]-m[0]);return{x:m[0],y:m[1],angle:p};}return i(s,c,!1).point;}function o(s,c,m){var l=0,p=c[0],y=s;var P=[],S=c.length;if(m>0){do m-=c[l%S],l++;while(m>0);m<0&&(p=-m,l--);}else if(m<0){l=-1;do m+=c[l%S+S-1],l--;while(m<0);m>=0&&(l++,p=c[l%S+S-1]-m);}do{var v=i(y,p);y=v.rest,++l%2&&P.push.apply(P,_toConsumableArray(v.current));var _T9=l%S;_T9<0&&(_T9+=S),p=c[_T9];}while(y);return P;}},/* 54 *//***/function(h,r,t){t.r(r),t.d(r,"normalize",function(){return e;}),t.d(r,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(_ref58,s,c,m){var _ref59=_slicedToArray(_ref58,3),i=_ref59[0],a=_ref59[1],o=_ref59[2];return i=i*2/s-1,a=1-a*2/c,Number.isFinite(m)?(o=o*2/m-1,[i,a,o]):[i,a];}function n(_ref60,_ref61){var _ref62=_slicedToArray(_ref60,3),i=_ref62[0],a=_ref62[1],_ref62$=_ref62[2],o=_ref62$===void 0?0:_ref62$;var _ref63=_slicedToArray(_ref61,3),s=_ref63[0],c=_ref63[1],_ref63$=_ref63[2],m=_ref63$===void 0?0:_ref63$;return Math.hypot(s-i,c-a,m-o);}},/* 55 *//***/function(h,r,t){t.r(r),t.d(r,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(i,a,o,s,c){c%=e,c<0&&(c+=e);var m=Math.tan(c);if(Math.abs(m)<1e5){var l=a-m*i,p=1/Math.pow(o,2)+Math.pow(m,2)/Math.pow(s,2);var y=-1;(c<=Math.PI/2||c>3*Math.PI/2)&&(y=1);var P=y*Math.sqrt(1/p)+i,S=m*P+l;return[P,S];}return c<Math.PI?[i,a+s]:[i,a-s];}},/* 56 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return Y;});var e=t(1),n=t(42),i=/* @__PURE__ */t.n(n),a=t(57),o=t(28),s=t(24),c=t(30),m=t(59),l=t(53),p=t(60),y=/* @__PURE__ */t.n(p),P=t(46),S=/* @__PURE__ */t.n(P),v=t(31),T=t(40),f=t(21);t(1).glMatrix.setMatrixArrayType(Array);function d(k,N){if(k==null)return{};var $=u(k,N),x,E;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(k);for(E=0;E<D.length;E++)x=D[E],!(N.indexOf(x)>=0)&&Object.prototype.propertyIsEnumerable.call(k,x)&&($[x]=k[x]);}return $;}function u(k,N){if(k==null)return{};var $={},x=Object.keys(k),E,D;for(D=0;D<x.length;D++)E=x[D],!(N.indexOf(E)>=0)&&($[E]=k[E]);return $;}var g=Symbol("mesh"),M=Symbol("contours"),C=Symbol("stroke"),A=Symbol("fill"),L=Symbol("strokeColor"),O=Symbol("fillColor"),w=Symbol("transform"),b=Symbol("invertTransform"),I=Symbol("uniforms"),R=Symbol("texOptions"),W=Symbol("blend"),z=Symbol("applyTexture"),K=Symbol("applyTransform"),J=Symbol("applyGradientTransform"),q=Symbol("applyProgram"),U=Symbol("gradient"),G=Symbol("filter"),Z=Symbol("opacity"),rt=Symbol("program"),et=Symbol("attributes"),it=Symbol("pass"),X=Symbol("clipContext"),ct=Symbol("applyClipPath");function ut(k,N){var $=k[1][0]-k[0][0],x=k[1][1]-k[0][1],E=[];for(var D=0;D<N.length;D++){var j=N[D],H=[(j[0]-k[0][0])/$,1-(j[1]-k[0][1])/x];E.push(H);}return E;}function B(_ref64,_ref65,_ref66){var _ref67=_slicedToArray(_ref64,2),k=_ref67[0],N=_ref67[1];var _ref68=_slicedToArray(_ref65,4),$=_ref68[0],x=_ref68[1],E=_ref68[2],D=_ref68[3];var j=_ref66.scale;return j||(k/=E,N=1-N/D,k-=$,N+=x),[k,N,0];}function F(k,N,$){var x=S()(k,N,$);return x.path=k,x.simplify=$,x.scale=N,x;}var Y=/*#__PURE__*/function(){function Y(N){_classCallCheck(this,Y);this[C]=null,this[A]=null,this[w]=[1,0,0,1,0,0],this[Z]=1,this[I]={},this[G]=[],this[W]=null,this[R]={},this.contours=N.contours,this[rt]=null,this[et]={},this[it]=[];}return _createClass(Y,[{key:"contours",get:function get(){return this[M];},set:function set(N){this[g]=null,this[M]=N;var $=N.scale;this.transformScale/$>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[rt]=N,this[g]&&this[q](N);}},{key:"program",get:function get(){return this[rt];}},{key:"setAttribute",value:function setAttribute(N,$){$==null?delete this[et][N]:this[et][N]=$;}},{key:"getOpacity",value:function getOpacity(){return this[Z];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach(function($){$[2]=1/$[2]>0?N:-N;}),this[Z]=N;}},{key:"setClipPath",value:function setClipPath(N){this.clipPath=N,this[I].u_clipSampler&&this[I].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[ct]();}},{key:ct,value:function value(){if(this.clipPath){this[X]||(this[X]=f["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],$=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),x=_this$boundingBox$2[0],E=_this$boundingBox$2[1];x&&E&&(this[X].width=x-N,this[X].height=E-$);var D=this[X].getContext("2d"),j=new Path2D(this.clipPath);D.clearRect(0,0,this[X].width,this[X].height),D.save(),D.translate(-N,-$),D.fillStyle="white",D.fill(j),D.restore(),this[g].clipPath=this[X];var H=ut(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=H;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(l.getPointAtLength)(this[M],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(l.getTotalLength)(this[M]);}},{key:"blend",get:function get(){return this[W]==null?"auto":this[W];},set:function set(N){this[W]=N,this[g]&&(this[g].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[g]&&this[g].boundingBox)return this[g].boundingBox;var N=this.meshData;if(N){var $=N.position0;if($.length)N.boundingBox=i()($);else return[[0,0],[0,0]];return N.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var N=this.boundingBox;return N?[0.5*(N[0][0]+N[1][0]),0.5*(N[0][1]+N[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[A]?this[A].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[C]?this[C].lineWidth:0;}},{key:"lineCap",get:function get(){return this[C]?this[C].lineCap:"";}},{key:"lineJoin",get:function get(){return this[C]?this[C].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[C]?this[C].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[L]&&this[L][3]!==0?Object(s["default"])(this[L]):"";}},{key:"lineDash",get:function get(){return this[C]?this[C].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[C]?this[C].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[O]&&this[O][3]!==0?Object(s["default"])(this[O]):"";}},{key:"gradient",get:function get(){return this[U];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].u_texSampler._img,options:this[R]}:null;}},{key:"enableBlend",get:function get(){return this[W]===!0||this[W]===!1?this[W]:this[Z]<1||this[L]!=null&&this[L][3]<1||this[O]!=null&&this[O][3]<1||this[I].u_colorMatrix!=null&&this[I].u_colorMatrix[18]<1||this[I].u_radialGradientVector!=null||this.beforeRender||this.afterRender;}},{key:"filterCanvas",get:function get(){return /blur|drop-shadow|url/.test(this.filter);}},{key:"filter",get:function get(){return this[G].join(" ");}},{key:"transformMatrix",get:function get(){return this[w];}},{key:"invertMatrix",get:function get(){if(!this[b]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[w]);this[b]=N;}return this[b];}},{key:"transformScale",get:function get(){var N=this[w];return Math.max(Math.hypot(N[0],N[1]),Math.hypot(N[2],N[3]));}},{key:"uniforms",get:function get(){return this[I];}},{key:"pass",get:function get(){return this[it];}},{key:q,value:function value(N){var $=this[et],x=this[g].position0,E=Object.entries(N._attribute);for(var D=0;D<E.length;D++){var _E$D=_slicedToArray(E[D],2),j=_E$D[0],H=_E$D[1];if(j!=="a_color"&&j!=="a_sourceRect"&&H!=="ignored"){var V=$[j];if(j==="uv"&&!V){var Q=this[g].boundingBox||i()(x);this[g].attributes[j]=ut(Q,x);}else{this[g].attributes[j]=[];for(var _Q=0;_Q<x.length;_Q++){var nt=x[_Q];this[g].attributes[j].push(V?V(nt,D,x):Array(H.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[g]){!this[A]&&!this[C]&&this.setFill();var N=this[M],$={};if(N&&N.length){if(this[A])try{var D=y()(N,this[A]);D.positions=D.positions.map(function(j){return j.push(_this20[Z]),j;}),D.attributes={a_color:Array.from({length:D.positions.length}).map(function(){return _this20[O].map(function(j){return Math.round(255*j);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
|
|
48
|
+
},$.fill=D;}catch(_unused3){}if(this[C]){var _D=this[C].lineDash;var j=N;if(_D){var V=this[C].lineDashOffset;j=Object(l.getDashContours)(N,_D,V);}var H=j.map(function(V,Q){var nt=V.length>1&&e.vec2.equals(V[0],V[V.length-1]),st=_this20[C].build(V,nt);return y()([st]);});H.forEach(function(V){V.positions=V.positions.map(function(Q){return Q.push(-_this20[Z]),Q;}),V.attributes={a_color:Array.from({length:V.positions.length}).map(function(){return _this20[L].map(function(Q){return Math.round(255*Q);});})};}),$.stroke=Object(o["default"])(H);}}var x=Object(o["default"])([$.fill,$.stroke]);x.fillPointCount=$.fill?$.fill.positions.length:0,x.enableBlend=this.enableBlend,x.position0=x.positions.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),D=_ref70[0],j=_ref70[1],H=_ref70[2];return[D,j,H];}),x.uniforms=this[I],this[g]=x,this[I].u_texSampler&&this[z](x,this[R]);var E=this[w];Object(m.isUnitTransform)(E)||(this[K](x,E),this[I].u_radialGradientVector&&this[J]()),this.clipPath&&this[ct](),this[rt]&&this[q](this[rt]);}return this._updateMatrix&&(this[g].matrix=this[w],this[K](this[g],this[w]),this[I].u_radialGradientVector&&this[J]()),this[g];}},{key:K,value:function value(N,$){var x=N.positions,E=N.position0;for(var D=0;D<x.length;D++){var _E$D2=_slicedToArray(E[D],2),j=_E$D2[0],H=_E$D2[1],V=x[D];V[0]=j*$[0]+H*$[2]+$[4],V[1]=j*$[1]+H*$[3]+$[5];}this._updateMatrix=!1;}},{key:J,value:function value(){var N=this[w],$=_toConsumableArray(this._radialGradientVector);if($){var _$=_slicedToArray($,5),x=_$[0],E=_$[1],D=_$[3],j=_$[4];$[0]=x*N[0]+E*N[2]+N[4],$[1]=x*N[1]+E*N[3]+N[5],$[3]=D*N[0]+j*N[2]+N[4],$[4]=D*N[1]+j*N[3]+N[5],this[I].u_radialGradientVector=$;}}},{key:z,value:function value(N,$){function x(Q,nt){return Q==null&&nt==null?!0:Q==null||nt==null?!1:Q[0]===nt[0]&&Q[1]===nt[1]&&Q[2]===nt[2]&&Q[3]===nt[3];}var E=this[I].u_texSampler;if(!E)return;var _E$_img=E._img,D=_E$_img.width,j=_E$_img.height,H=$.srcRect;var V=$.rect||[0,0];if($.rotated&&(V=[-V[1],V[0],V[3],V[2]]),V[2]==null&&(V[2]=H?H[2]:D),V[3]==null&&(V[3]=H?H[3]:j),$.hidden)N.textureCoord=N.positions.map(function(){return[-1,-1,-1];});else if(!N.textureCoord||!x(this[R].rect,$.rect)||this[R].hidden!==$.hidden||this[R].rotated!==$.rotated){var Q=null;$.rotated&&(Q=e.mat2d.rotate(Array.of(0,0,0,0,0,0),e.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),Q=e.mat2d.translate(Array.of(0,0,0,0,0,0),Q,[0,-V[2]])),N.textureCoord=N.position0.map(function(_ref71){var _ref72=_slicedToArray(_ref71,3),nt=_ref72[0],st=_ref72[1],ft=_ref72[2];if(1/ft>0){if($.rotated){var lt=nt*Q[0]+st*Q[2]+Q[4],at=nt*Q[1]+st*Q[3]+Q[5];nt=lt;st=at;}var pt=B([nt,st],[V[0]/V[2],V[1]/V[3],V[2],V[3]],$);return $.repeat&&(pt[2]=1),pt;}return[-1,-1,-1];});}if(H){var _Q2=[H[0]/D,H[1]/j,H[2]/D,H[3]/j];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_Q2);});}else N.attributes.a_sourceRect=N.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(N){if(!this.contours)return;if(this.contours.path){var x=this.contours.simplify,E=F(this.contours.path,2*N,x);this[g]=null,this[M]=E;}}},{key:"canIgnore",value:function canIgnore(){var N=this[C]==null||this[C].lineWidth===0||this[L][3]===0,$=this[A]==null||this[O][3]===0,x=this[I].u_radialGradientVector==null,E=this[I].u_texSampler==null;return this[Z]===0||this[rt]==null&&N&&$&&x&&E&&!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 _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$thickness=_ref73.thickness,N=_ref73$thickness===void 0?1:_ref73$thickness,_ref73$cap=_ref73.cap,$=_ref73$cap===void 0?"butt":_ref73$cap,_ref73$join=_ref73.join,x=_ref73$join===void 0?"miter":_ref73$join,_ref73$miterLimit=_ref73.miterLimit,E=_ref73$miterLimit===void 0?10:_ref73$miterLimit,_ref73$color=_ref73.color,D=_ref73$color===void 0?[0,0,0,0]:_ref73$color,_ref73$lineDash=_ref73.lineDash,j=_ref73$lineDash===void 0?null:_ref73$lineDash,_ref73$lineDashOffset=_ref73.lineDashOffset,H=_ref73$lineDashOffset===void 0?0:_ref73$lineDashOffset,_ref73$roundSegments=_ref73.roundSegments,V=_ref73$roundSegments===void 0?20:_ref73$roundSegments;return this[g]=null,this[C]=new a["default"]({lineWidth:N,lineCap:$,lineJoin:x,miterLimit:E,roundSegments:V}),typeof D=="string"&&(D=Object(v["default"])(D)),this[L]=D,this[C].lineDash=j,this[C].lineDashOffset=H,this;}},{key:"setFill",value:function setFill(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref74$rule=_ref74.rule,N=_ref74$rule===void 0?this.fillRule:_ref74$rule,_ref74$color=_ref74.color,$=_ref74$color===void 0?[0,0,0,0]:_ref74$color;return this[g]=null,this[A]={rule:N},typeof $=="string"&&($=Object(v["default"])($)),this[O]=$,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(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,x=_N.image,E=_N.rect;if(N=x,$.rect)for(var D=0;D<$.rect.length;D++)E[D]=$.rect[D];$.rect=E;}return this[A]||this.setFill(),this.setUniforms({u_texSampler:N}),this[g]&&this[z](this[g],$),this[R]=$,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,$=_ref75.colors,_ref75$type=_ref75.type,x=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:x});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,$=_ref76.colors,_ref76$type=_ref76.type,x=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:x});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,$=_ref77.colors,_ref77$type=_ref77.type,x=_ref77$type===void 0?"fill":_ref77$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:$,type:x});}/**
|
|
62
|
+
vector: [x0, y0, r0, x1, y1, r1],
|
|
63
|
+
colors: [{offset:0, color}, {offset:1, color}, ...],
|
|
64
|
+
*/},{key:"setGradient",value:function setGradient(){var _ref78=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref78.vector,$=_ref78.colors,_ref78$type=_ref78.type,x=_ref78$type===void 0?"fill":_ref78$type;$=$.map(function(_ref79){var j=_ref79.offset,H=_ref79.color;return typeof H=="string"&&(H=Object(v["default"])(H)),{offset:j,color:H};}),this[U]=this[U]||{},this[U][x]={vector:N,colors:$},$.sort(function(j,H){return j.offset-H.offset;});var E=[];$.forEach(function(_ref80){var j=_ref80.offset,H=_ref80.color;E.push.apply(E,[j].concat(_toConsumableArray(H)));});var D;if(N.length===4?D=[N[0],N[1],0,N[2],N[3],0]:D=_toConsumableArray(N),E.length<40&&E.push(-1),E.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=D,this[I].u_colorSteps=E,x==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[J](),this;}},{key:"setUniforms",value:function setUniforms(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[I],N),this;}},{key:"setTransform",value:function setTransform(){var $=this[w];for(var _len3=arguments.length,N=new Array(_len3),_key3=0;_key3<_len3;_key3++){N[_key3]=arguments[_key3];}return e.mat2d.equals(N,$)||(this[w]=N,delete this[b],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var $=this[w];for(var _len4=arguments.length,N=new Array(_len4),_key4=0;_key4<_len4;_key4++){N[_key4]=arguments[_key4];}return this[w]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),$,N),delete this[b],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,$){var x=e.mat2d.create();return x=e.mat2d.translate(Array.of(0,0,0,0,0,0),x,[N,$]),this.transform.apply(this,_toConsumableArray(x));}},{key:"rotate",value:function rotate(N){var _ref81=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref82=_slicedToArray(_ref81,2),$=_ref82[0],x=_ref82[1];var E=e.mat2d.create();return E=e.mat2d.translate(Array.of(0,0,0,0,0,0),E,[$,x]),E=e.mat2d.rotate(Array.of(0,0,0,0,0,0),E,N),E=e.mat2d.translate(Array.of(0,0,0,0,0,0),E,[-$,-x]),this.transform.apply(this,_toConsumableArray(E));}},{key:"scale",value:function scale(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),x=_ref84[0],E=_ref84[1];var D=e.mat2d.create();return D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[x,E]),D=e.mat2d.scale(Array.of(0,0,0,0,0,0),D,[N,$]),D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-x,-E]),this.transform.apply(this,_toConsumableArray(D));}},{key:"skew",value:function skew(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref85=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref86=_slicedToArray(_ref85,2),x=_ref86[0],E=_ref86[1];var D=e.mat2d.create();return D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[x,E]),D=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,e.mat2d.fromValues(1,Math.tan($),Math.tan(N),1,0,0)),D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-x,-E]),this.transform.apply(this,_toConsumableArray(D));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[G].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,N=new Array(_len5),_key5=0;_key5<_len5;_key5++){N[_key5]=arguments[_key5];}return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this;}// apply linear color transform
|
|
65
|
+
},{key:"transformColor",value:function transformColor(){var $=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return $?$=Object(c.multiply)($,N):$=N,this.setColorTransform.apply(this,_toConsumableArray($)),this;}},{key:"blur",value:function blur(N){return this[G].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,$){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var E=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(E)&&(E=Object(s["default"])(E)),this[G].push("drop-shadow(".concat(N,"px ").concat($,"px ").concat(x,"px ").concat(E,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
|
|
66
|
+
},{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[G].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(c.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.sepia)(N)));}},{key:"url",value:function url(N){return this[G].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,$){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var E=this.meshData,D=E.positions,j=E.cells,H=this.invertMatrix,V=H[0]*N+H[2]*$+H[4],Q=H[1]*N+H[3]*$+H[5],nt=this.boundingBox;if(V<nt[0][0]||V>nt[1][0]||Q<nt[0][1]||Q>nt[1][1])return!1;function st(_ref87,_ref88,_ref89){var _ref90=_slicedToArray(_ref87,2),ft=_ref90[0],pt=_ref90[1];var _ref91=_slicedToArray(_ref88,2),lt=_ref91[0],at=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ht=_ref92[0],mt=_ref92[1];var yt=ht-lt,gt=mt-at,Mt=((ft-lt)*yt+(pt-at)*gt)/(Math.pow(yt,2)+Math.pow(gt,2));return Mt>=0&&Mt<=1;}for(var ft=0;ft<j.length;ft++){var pt=j[ft];if(x==="fill"&&pt[0]>=E.fillPointCount)break;if(x==="stroke"&&pt[0]<E.fillPointCount)continue;var _pt$map=pt.map(function(Ct){return D[Ct];}),_pt$map2=_slicedToArray(_pt$map,3),_pt$map2$=_slicedToArray(_pt$map2[0],2),lt=_pt$map2$[0],at=_pt$map2$[1],_pt$map2$2=_slicedToArray(_pt$map2[1],2),ht=_pt$map2$2[0],mt=_pt$map2$2[1],_pt$map2$3=_slicedToArray(_pt$map2[2],2),yt=_pt$map2$3[0],gt=_pt$map2$3[1],Mt=Math.sign((N-lt)*(mt-at)-(ht-lt)*($-at));if(Mt===0&&st([N,$],[lt,at],[ht,mt]))return!0;var It=Math.sign((N-ht)*(gt-mt)-(yt-ht)*($-mt));if(It===0&&st([N,$],[ht,mt],[yt,gt]))return!0;var Et=Math.sign((N-yt)*(at-gt)-(lt-yt)*($-gt));if(Et===0&&st([N,$],[yt,gt],[lt,at])||Mt===1&&It===1&&Et===1||Mt===-1&&It===-1&&Et===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(N,$){return this.isPointCollision(N,$,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(N,$){return this.isPointCollision(N,$,"stroke");}},{key:"addPass",value:function addPass(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var x=$.width,E=$.height,D=d($,["width","height"]);var j=new T["default"]();j.rect(0,0,x,E);var H=new Y(j,{width:x,height:E});H.setUniforms(D),H.setProgram(N),this[it].push(H);}}]);}();},/* 57 *//***/function(h,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e.Stroke;},/* 58 *//***/function(h,r,t){t.r(r),t.d(r,"Stroke",function(){return m;});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),o=Object(e.create)(),s=Object(e.create)(),c=1e20;var m=/*#__PURE__*/function(){function m(){var _ref93=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref93$lineWidth=_ref93.lineWidth,S=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,v=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,T=_ref93$miterLimit===void 0?10:_ref93$miterLimit,_ref93$lineCap=_ref93.lineCap,f=_ref93$lineCap===void 0?"butt":_ref93$lineCap,_ref93$roundSegments=_ref93.roundSegments,d=_ref93$roundSegments===void 0?20:_ref93$roundSegments;_classCallCheck(this,m);this.lineWidth=S,this.lineJoin=v,this.miterLimit=T,this.lineCap=f,this.roundSegments=d,this._normal=null;}return _createClass(m,[{key:"build",value:function build(S){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var T=S.length;if(S=_toConsumableArray(S),T<2)return S;v&&((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 f={left:[],right:[]},d=this.lineWidth/2,u=this.lineCap;if(!v&&u==="square"){Object(e.direction)(i,S[0],S[1]),Object(e.scaleAndAdd)(S[0],S[0],i,d);var M=S.length-1;Object(e.direction)(i,S[M],S[M-1]),Object(e.scaleAndAdd)(S[M],S[M],i,d);}for(var _M4=1;_M4<T;_M4++){var C=S[_M4-1],A=S[_M4],L=S[_M4+1];this._seg(f,C,A,L,d,v);}return!v&&u==="round"&&y(f,this.roundSegments),[].concat(_toConsumableArray(f.left),_toConsumableArray(f.right.reverse()));}},{key:"_seg",value:function _seg(S,v,T,f,d,u){var g=this.lineJoin==="bevel",M=this.lineJoin==="round";if(Object(e.direction)(i,T,v),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),S.left.length||p(S,v,this._normal,d),!f)Object(e.normal)(this._normal,i),u?p(S,v,this._normal,d):p(S,T,this._normal,d);else{Object(e.direction)(a,f,T);var C=Object(e.computeMiter)(o,s,i,a,d);C=Math.min(C,c);var A=Object(e.dot)(o,this._normal)<0?-1:1;var L=g||M;if(!L&&this.lineJoin==="miter"&&C/d>this.miterLimit&&(L=!0),L){Object(e.scaleAndAdd)(n,T,this._normal,-d*A),l(S,n,A);var O=1/0;v&&(O=Math.min(O,Math.hypot(T[0]-v[0],T[1]-v[1]))),f&&(O=Math.min(O,Math.hypot(f[0]-T[0],f[1]-T[1])));var w=Math.max(d,Math.min(C,O));if(Object(e.scaleAndAdd)(n,T,s,w*A),l(S,n,-A),f)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-d*A),M){var b=Object(e.clone)(n),I=A>0?S.left[S.left.length-1]:S.right[S.right.length-1],R=Object(e.clone)(T),W=Object(e.sub)(Object(e.create)(),I,R),z=Object(e.sub)(Object(e.create)(),b,R),K=Math.PI/this.roundSegments;for(var J=0;J<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],A*K),Math.sign(Object(e.cross)(n,W,z)[2])===A);J++)Object(e.add)(n,W,R),l(S,n,A);l(S,b,A);}else l(S,n,A);}else p(S,T,s,C),Object(e.copy)(this._normal,s);}}}]);}();function l(P,S,v){v>0?P.left.push(Object(e.clone)(S)):P.right.push(Object(e.clone)(S));}function p(P,S,v,T){var f=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,S,v,-T),l(P,n,-f),Object(e.scaleAndAdd)(n,S,v,T),l(P,n,f);}function y(_ref94,v){var P=_ref94.left,S=_ref94.right;var T=Object(e.create)(),f=Object(e.create)();var d=P[0],u=S[0],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])];Object(e.sub)(f,d,g);for(var M=1;M<=v;M++){var C=-1*Math.PI*M/v;Object(e.rotate)(T,f,[0,0],C),Object(e.add)(n,g,T),P.unshift(Object(e.clone)(n));}d=S[S.length-1],u=P[P.length-1],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])],Object(e.sub)(f,d,g);for(var _M5=1;_M5<=v;_M5++){var _C2=-1*Math.PI*_M5/v;Object(e.rotate)(T,f,[0,0],_C2),Object(e.add)(n,g,T),S.push(Object(e.clone)(n));}}},/* 59 *//***/function(h,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 *//***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);h.exports=function(i,a){if(a=a||{},i=i.filter(function(v){return v.length>2;}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(v){return v.reduce(function(T,f){return T.concat(f);});});var o=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var s=e.tesselate(n({contours:i,windingRule:o,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),c=[],m=0;m<s.vertices.length;m+=a.vertexSize){var l=s.vertices.slice(m,m+a.vertexSize);c.push(l);}var p=[];for(m=0;m<s.elements.length;m+=3){var y=s.elements[m],P=s.elements[m+1],S=s.elements[m+2];p.push([y,P,S]);}return{positions:c,cells:p};};},/* 61 *//***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e={},n={};h.exports=e,e.WINDING_ODD=0,e.WINDING_NONZERO=1,e.WINDING_POSITIVE=2,e.WINDING_NEGATIVE=3,e.WINDING_ABS_GEQ_TWO=4,e.POLYGONS=0,e.CONNECTED_POLYGONS=1,e.BOUNDARY_CONTOURS=2,e.tesselate=function(f){for(var d=f.debug||!1,u=new T(),g=0;g<f.contours.length;g++)u.addContour(f.vertexSize||2,f.contours[g]);return u.tesselate(f.windingRule||e.WINDING_ODD,f.elementType||e.POLYGONS,f.polySize||3,f.vertexSize||2,f.normal||[0,0,1]),{vertices:u.vertices,vertexIndices:u.vertexIndices,vertexCount:u.vertexCount,elements:u.elements,elementCount:u.elementCount,mesh:d?u.mesh:void 0};};var i=function i(f){if(!f)throw"Assertion Failed!";};function a(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0;}function o(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function s(f){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=f;}s.prototype={get Rface(){return this.Sym.Lface;},set Rface(f){this.Sym.Lface=f;},get Dst(){return this.Sym.Org;},set Dst(f){this.Sym.Org=f;},get Oprev(){return this.Sym.Lnext;},set Oprev(f){this.Sym.Lnext=f;},get Lprev(){return this.Onext.Sym;},set Lprev(f){this.Onext.Sym=f;},get Dprev(){return this.Lnext.Sym;},set Dprev(f){this.Lnext.Sym=f;},get Rprev(){return this.Sym.Onext;},set Rprev(f){this.Sym.Onext=f;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(f){this.Sym.Onext.Sym=f;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(f){this.Sym.Lnext.Sym=f;}/* 3 pointers */};function c(){var f=new a(),d=new o(),u=new s(0),g=new s(1);f.next=f.prev=f,f.anEdge=null,d.next=d.prev=d,d.anEdge=null,d.trail=null,d.marked=!1,d.inside=!1,u.next=u,u.Sym=g,u.Onext=null,u.Lnext=null,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,g.next=g,g.Sym=u,g.Onext=null,g.Lnext=null,g.Org=null,g.Lface=null,g.winding=0,g.activeRegion=null,this.vHead=f,this.fHead=d,this.eHead=u,this.eHeadSym=g;}c.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_(f){var d=new s(0),u=new s(1);f.Sym.side<f.side&&(f=f.Sym);var g=f.Sym.next;return u.next=g,g.Sym.next=d,d.next=f,f.Sym.next=u,d.Sym=u,d.Onext=d,d.Lnext=u,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,u.Sym=d,u.Onext=u,u.Lnext=d,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,d;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
|
|
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_(f,d){var u=f.Onext,g=d.Onext;u.Sym.Lnext=d,g.Sym.Lnext=f,f.Onext=g,d.Onext=u;},/* 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_(f,d,u){var g=f;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d;var C=d;do C.Org=g,C=C.Onext;while(C!==d);},/* 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_(f,d,u){var g=f;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d,g.trail=null,g.marked=!1,g.inside=u.inside;var C=d;do C.Lface=g,C=C.Lnext;while(C!==d);},/* 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_(f){f.Sym.side<f.side&&(f=f.Sym);var d=f.next,u=f.Sym.next;d.Sym.next=u,u.Sym.next=d;},/* 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_(f,d){var u=f.anEdge,g=u;do g.Org=d,g=g.Onext;while(g!==u);var M=f.prev,C=f.next;C.prev=M,M.next=C;},/* 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_(f,d){var u=f.anEdge,g=u;do g.Lface=d,g=g.Lnext;while(g!==u);var M=f.prev,C=f.next;C.prev=M,M.next=C;},/****************** 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 f=new a(),d=new a(),u=new o(),g=this.makeEdge_(this.eHead);return this.makeVertex_(f,g,this.vHead),this.makeVertex_(d,g.Sym,this.vHead),this.makeFace_(u,g,this.fHead),g;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
|
|
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(f,d){var u=!1,g=!1;if(f!==d){if(d.Org!==f.Org&&(g=!0,this.killVertex_(d.Org,f.Org)),d.Lface!==f.Lface&&(u=!0,this.killFace_(d.Lface,f.Lface)),this.splice_(d,f),!g){var M=new a();this.makeVertex_(M,d,f.Org),f.Org.anEdge=f;}if(!u){var C=new o();this.makeFace_(C,d,f.Lface),f.Lface.anEdge=f;}}},/* 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(f){var d=f.Sym,u=!1;if(f.Lface!==f.Rface&&(u=!0,this.killFace_(f.Lface,f.Rface)),f.Onext===f)this.killVertex_(f.Org,null);else if(f.Rface.anEdge=f.Oprev,f.Org.anEdge=f.Onext,this.splice_(f,f.Oprev),!u){var g=new o();this.makeFace_(g,f,f.Lface);}d.Onext===d?(this.killVertex_(d.Org,null),this.killFace_(d.Lface,null)):(f.Lface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),this.killEdge_(f);},/******************** 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(f){var d=this.makeEdge_(f),u=d.Sym;this.splice_(d,f.Lnext),d.Org=f.Dst;var g=new a();return this.makeVertex_(g,u,d.Org),d.Lface=u.Lface=f.Lface,d;},/* 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(f,d){var u=this.addEdgeVertex(f),g=u.Sym;return this.splice_(f.Sym,f.Sym.Oprev),this.splice_(f.Sym,g),f.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=f.Rface,g.winding=f.winding,g.Sym.winding=f.Sym.winding,g;},/* 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(f,d){var u=!1,g=this.makeEdge_(f),M=g.Sym;if(d.Lface!==f.Lface&&(u=!0,this.killFace_(d.Lface,f.Lface)),this.splice_(g,f.Lnext),this.splice_(M,d),g.Org=f.Dst,M.Org=d.Org,g.Lface=M.Lface=f.Lface,f.Lface.anEdge=M,!u){var C=new o();this.makeFace_(C,g,f.Lface);}return g;},/* 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(f){var d=f.anEdge,u,g,M,C,A;g=d.Lnext;do u=g,g=u.Lnext,u.Lface=null,u.Rface===null&&(u.Onext===u?this.killVertex_(u.Org,null):(u.Org.anEdge=u.Onext,this.splice_(u,u.Oprev)),M=u.Sym,M.Onext===M?this.killVertex_(M.Org,null):(M.Org.anEdge=M.Onext,this.splice_(M,M.Oprev)),this.killEdge_(u));while(u!=d);C=f.prev,A=f.next,A.prev=C,C.next=A;},countFaceVerts_:function countFaceVerts_(f){var d=f.anEdge,u=0;do u++,d=d.Lnext;while(d!==f.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
160
|
+
mergeConvexFaces:function mergeConvexFaces(f){var d,u,g,M,C,A,L;for(d=this.fHead.next;d!==this.fHead;d=d.next)if(d.inside)for(u=d.anEdge,C=u.Org;g=u.Lnext,M=u.Sym,M&&M.Lface&&M.Lface.inside&&(A=this.countFaceVerts_(d),L=this.countFaceVerts_(M.Lface),A+L-2<=f&&n.vertCCW(u.Lprev.Org,u.Org,M.Lnext.Lnext.Org)&&n.vertCCW(M.Lprev.Org,M.Org,u.Lnext.Lnext.Org)&&(g=M.Lnext,this["delete"](M),u=null,M=null)),!(u&&u.Lnext.Org===C);)u=g;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
|
|
161
|
+
*/check:function check(){var f=this.fHead,d=this.vHead,u=this.eHead,g,M,C,A,L,O;for(M=f,M=f;(g=M.next)!==f;M=g){i(g.prev===M),L=g.anEdge;do i(L.Sym!==L),i(L.Sym.Sym===L),i(L.Lnext.Onext.Sym===L),i(L.Onext.Sym.Lnext===L),i(L.Lface===g),L=L.Lnext;while(L!==g.anEdge);}for(i(g.prev===M&&g.anEdge===null),A=d,A=d;(C=A.next)!==d;A=C){i(C.prev===A),L=C.anEdge;do i(L.Sym!==L),i(L.Sym.Sym===L),i(L.Lnext.Onext.Sym===L),i(L.Onext.Sym.Lnext===L),i(L.Org===C),L=L.Onext;while(L!==C.anEdge);}for(i(C.prev===A&&C.anEdge===null),O=u,O=u;(L=O.next)!==u;O=L)i(L.Sym.next===O.Sym),i(L.Sym!==L),i(L.Sym.Sym===L),i(L.Org!==null),i(L.Dst!==null),i(L.Lnext.Onext.Sym===L),i(L.Onext.Sym.Lnext===L);i(L.Sym.next===O.Sym&&L.Sym===this.eHeadSym&&L.Sym.Sym===L&&L.Org===null&&L.Dst===null&&L.Lface===null&&L.Rface===null);}},n.vertEq=function(f,d){return f.s===d.s&&f.t===d.t;},n.vertLeq=function(f,d){return f.s<d.s||f.s===d.s&&f.t<=d.t;},n.transLeq=function(f,d){return f.t<d.t||f.t===d.t&&f.s<=d.s;},n.edgeGoesLeft=function(f){return n.vertLeq(f.Dst,f.Org);},n.edgeGoesRight=function(f){return n.vertLeq(f.Org,f.Dst);},n.vertL1dist=function(f,d){return Math.abs(f.s-d.s)+Math.abs(f.t-d.t);},n.edgeEval=function(f,d,u){i(n.vertLeq(f,d)&&n.vertLeq(d,u));var g=d.s-f.s,M=u.s-d.s;return g+M>0?g<M?d.t-f.t+(f.t-u.t)*(g/(g+M)):d.t-u.t+(u.t-f.t)*(M/(g+M)):0;},n.edgeSign=function(f,d,u){i(n.vertLeq(f,d)&&n.vertLeq(d,u));var g=d.s-f.s,M=u.s-d.s;return g+M>0?(d.t-u.t)*g+(d.t-f.t)*M:0;},n.transEval=function(f,d,u){i(n.transLeq(f,d)&&n.transLeq(d,u));var g=d.t-f.t,M=u.t-d.t;return g+M>0?g<M?d.s-f.s+(f.s-u.s)*(g/(g+M)):d.s-u.s+(u.s-f.s)*(M/(g+M)):0;},n.transSign=function(f,d,u){i(n.transLeq(f,d)&&n.transLeq(d,u));var g=d.t-f.t,M=u.t-d.t;return g+M>0?(d.s-u.s)*g+(d.s-f.s)*M:0;},n.vertCCW=function(f,d,u){return f.s*(d.t-u.t)+d.s*(u.t-f.t)+u.s*(f.t-d.t)>=0;},n.interpolate=function(f,d,u,g){return f=f<0?0:f,u=u<0?0:u,f<=u?u===0?(d+g)/2:d+(g-d)*(f/(f+u)):g+(d-g)*(u/(f+u));},n.intersect=function(f,d,u,g,M){var C,A,L;n.vertLeq(f,d)||(L=f,f=d,d=L),n.vertLeq(u,g)||(L=u,u=g,g=L),n.vertLeq(f,u)||(L=f,f=u,u=L,L=d,d=g,g=L),n.vertLeq(u,d)?n.vertLeq(d,g)?(C=n.edgeEval(f,u,d),A=n.edgeEval(u,d,g),C+A<0&&(C=-C,A=-A),M.s=n.interpolate(C,u.s,A,d.s)):(C=n.edgeSign(f,u,d),A=-n.edgeSign(f,g,d),C+A<0&&(C=-C,A=-A),M.s=n.interpolate(C,u.s,A,g.s)):M.s=(u.s+d.s)/2,n.transLeq(f,d)||(L=f,f=d,d=L),n.transLeq(u,g)||(L=u,u=g,g=L),n.transLeq(f,u)||(L=f,f=u,u=L,L=d,d=g,g=L),n.transLeq(u,d)?n.transLeq(d,g)?(C=n.transEval(f,u,d),A=n.transEval(u,d,g),C+A<0&&(C=-C,A=-A),M.t=n.interpolate(C,u.t,A,d.t)):(C=n.transSign(f,u,d),A=-n.transSign(f,g,d),C+A<0&&(C=-C,A=-A),M.t=n.interpolate(C,u.t,A,g.t)):M.t=(u.t+d.t)/2;};function m(){this.key=null,this.next=null,this.prev=null;}function l(f,d){this.head=new m(),this.head.next=this.head,this.head.prev=this.head,this.frame=f,this.leq=d;}l.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(f){return this.insertBefore(this.head,f);},search:function search(f){var d=this.head;do d=d.next;while(d.key!==null&&!this.leq(this.frame,f,d.key));return d;},insertBefore:function insertBefore(f,d){do f=f.prev;while(f.key!==null&&!this.leq(this.frame,f.key,d));var u=new m();return u.key=d,u.next=f.next,f.next.prev=u,u.prev=f,f.next=u,u;},"delete":function _delete(f){f.next.prev=f.prev,f.prev.next=f.next;}};function p(){this.handle=null;}function y(){this.key=null,this.node=null;}function P(f,d){this.size=0,this.max=f,this.nodes=[],this.nodes.length=f+1;var u;for(u=0;u<this.nodes.length;u++)this.nodes[u]=new p();for(this.handles=[],this.handles.length=f+1,u=0;u<this.handles.length;u++)this.handles[u]=new y();this.initialized=!1,this.freeList=0,this.leq=d,this.nodes[1].handle=1,this.handles[1].key=null;}P.prototype={floatDown_:function floatDown_(f){var d=this.nodes,u=this.handles,g,M,C;for(g=d[f].handle;;){if(C=f<<1,C<this.size&&this.leq(u[d[C+1].handle].key,u[d[C].handle].key)&&++C,i(C<=this.max),M=d[C].handle,C>this.size||this.leq(u[g].key,u[M].key)){d[f].handle=g,u[g].node=f;break;}d[f].handle=M,u[M].node=f,f=C;}},floatUp_:function floatUp_(f){var d=this.nodes,u=this.handles,g,M,C;for(g=d[f].handle;;){if(C=f>>1,M=d[C].handle,C===0||this.leq(u[M].key,u[g].key)){d[f].handle=g,u[g].node=f;break;}d[f].handle=M,u[M].node=f,f=C;}},init:function init(){for(var f=this.size;f>=1;--f)this.floatDown_(f);this.initialized=!0;},min:function min(){return this.handles[this.nodes[1].handle].key;},/* really pqHeapInsert *//* returns INV_HANDLE iff out of memory *///PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )
|
|
162
|
+
insert:function insert(f){var d,u;if(d=++this.size,d*2>this.max){this.max*=2;var g,M;for(M=this.nodes.length,this.nodes.length=this.max+1,g=M;g<this.nodes.length;g++)this.nodes[g]=new p();for(M=this.handles.length,this.handles.length=this.max+1,g=M;g<this.handles.length;g++)this.handles[g]=new y();}return this.freeList===0?u=d:(u=this.freeList,this.freeList=this.handles[u].node),this.nodes[d].handle=u,this.handles[u].node=d,this.handles[u].key=f,this.initialized&&this.floatUp_(d),u;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
163
|
+
extractMin:function extractMin(){var f=this.nodes,d=this.handles,u=f[1].handle,g=d[u].key;return this.size>0&&(f[1].handle=f[this.size].handle,d[f[1].handle].node=1,d[u].key=null,d[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),g;},"delete":function _delete(f){var d=this.nodes,u=this.handles,g;i(f>=1&&f<=this.max&&u[f].key!==null),g=u[f].node,d[g].handle=d[this.size].handle,u[d[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(u[d[g>>1].handle].key,u[d[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),u[f].key=null,u[f].node=this.freeList,this.freeList=f;}};function S(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var v={};v.regionBelow=function(f){return f.nodeUp.prev.key;},v.regionAbove=function(f){return f.nodeUp.next.key;},v.debugEvent=function(f){},v.addWinding=function(f,d){f.winding+=d.winding,f.Sym.winding+=d.Sym.winding;},v.edgeLeq=function(f,d,u){var g=f.event,A,L,M=d.eUp,C=u.eUp;if(M.Dst===g)return C.Dst===g?n.vertLeq(M.Org,C.Org)?n.edgeSign(C.Dst,M.Org,C.Org)<=0:n.edgeSign(M.Dst,C.Org,M.Org)>=0:n.edgeSign(C.Dst,g,C.Org)<=0;if(C.Dst===g)return n.edgeSign(M.Dst,g,M.Org)>=0;var A=n.edgeEval(M.Dst,g,M.Org),L=n.edgeEval(C.Dst,g,C.Org);return A>=L;},v.deleteRegion=function(f,d){d.fixUpperEdge&&i(d.eUp.winding===0),d.eUp.activeRegion=null,f.dict["delete"](d.nodeUp);},v.fixUpperEdge=function(f,d,u){i(d.fixUpperEdge),f.mesh["delete"](d.eUp),d.fixUpperEdge=!1,d.eUp=u,u.activeRegion=d;},v.topLeftRegion=function(f,d){var u=d.eUp.Org,g;do d=v.regionAbove(d);while(d.eUp.Org===u);if(d.fixUpperEdge){if(g=f.mesh.connect(v.regionBelow(d).eUp.Sym,d.eUp.Lnext),g===null)return null;v.fixUpperEdge(f,d,g),d=v.regionAbove(d);}return d;},v.topRightRegion=function(f){var d=f.eUp.Dst;do f=v.regionAbove(f);while(f.eUp.Dst===d);return f;},v.addRegionBelow=function(f,d,u){var g=new S();return g.eUp=u,g.nodeUp=f.dict.insertBefore(d.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,u.activeRegion=g,g;},v.isWindingInside=function(f,d){switch(f.windingRule){case e.WINDING_ODD:return(d&1)!==0;case e.WINDING_NONZERO:return d!==0;case e.WINDING_POSITIVE:return d>0;case e.WINDING_NEGATIVE:return d<0;case e.WINDING_ABS_GEQ_TWO:return d>=2||d<=-2;}return i(!1),!1;},v.computeWinding=function(f,d){d.windingNumber=v.regionAbove(d).windingNumber+d.eUp.winding,d.inside=v.isWindingInside(f,d.windingNumber);},v.finishRegion=function(f,d){var u=d.eUp,g=u.Lface;g.inside=d.inside,g.anEdge=u,v.deleteRegion(f,d);},v.finishLeftRegions=function(f,d,u){for(var g,A,M=null,C=d,A=d.eUp;C!==u;){if(C.fixUpperEdge=!1,M=v.regionBelow(C),g=M.eUp,g.Org!=A.Org){if(!M.fixUpperEdge){v.finishRegion(f,C);break;}g=f.mesh.connect(A.Lprev,g.Sym),v.fixUpperEdge(f,M,g);}A.Onext!==g&&(f.mesh.splice(g.Oprev,g),f.mesh.splice(A,g)),v.finishRegion(f,C),A=M.eUp,C=M;}return A;},v.addRightEdges=function(f,d,u,g,M,C){var A,L,O,w,b=!0;O=u;do i(n.vertLeq(O.Org,O.Dst)),v.addRegionBelow(f,d,O.Sym),O=O.Onext;while(O!==g);for(M===null&&(M=v.regionBelow(d).eUp.Rprev),L=d,w=M;A=v.regionBelow(L),O=A.eUp.Sym,O.Org===w.Org;)O.Onext!==w&&(f.mesh.splice(O.Oprev,O),f.mesh.splice(w.Oprev,O)),A.windingNumber=L.windingNumber-O.winding,A.inside=v.isWindingInside(f,A.windingNumber),L.dirty=!0,!b&&v.checkForRightSplice(f,L)&&(v.addWinding(O,w),v.deleteRegion(f,L),f.mesh["delete"](w)),b=!1,L=A,w=O;L.dirty=!0,i(L.windingNumber-O.winding===A.windingNumber),C&&v.walkDirtyRegions(f,L);},v.spliceMergeVertices=function(f,d,u){f.mesh.splice(d,u);},v.vertexWeights=function(f,d,u){var g=n.vertL1dist(d,f),M=n.vertL1dist(u,f),C=0.5*M/(g+M),A=0.5*g/(g+M);f.coords[0]+=C*d.coords[0]+A*u.coords[0],f.coords[1]+=C*d.coords[1]+A*u.coords[1],f.coords[2]+=C*d.coords[2]+A*u.coords[2];},v.getIntersectData=function(f,d,u,g,M,C){d.coords[0]=d.coords[1]=d.coords[2]=0,d.idx=-1,v.vertexWeights(d,u,g),v.vertexWeights(d,M,C);},v.checkForRightSplice=function(f,d){var u=v.regionBelow(d),g=d.eUp,M=u.eUp;if(n.vertLeq(g.Org,M.Org)){if(n.edgeSign(M.Dst,g.Org,M.Org)>0)return!1;n.vertEq(g.Org,M.Org)?g.Org!==M.Org&&(f.pq["delete"](g.Org.pqHandle),v.spliceMergeVertices(f,M.Oprev,g)):(f.mesh.splitEdge(M.Sym),f.mesh.splice(g,M.Oprev),d.dirty=u.dirty=!0);}else{if(n.edgeSign(g.Dst,M.Org,g.Org)<0)return!1;v.regionAbove(d).dirty=d.dirty=!0,f.mesh.splitEdge(g.Sym),f.mesh.splice(M.Oprev,g);}return!0;},v.checkForLeftSplice=function(f,d){var u=v.regionBelow(d),g=d.eUp,M=u.eUp,C;if(i(!n.vertEq(g.Dst,M.Dst)),n.vertLeq(g.Dst,M.Dst)){if(n.edgeSign(g.Dst,M.Dst,g.Org)<0)return!1;v.regionAbove(d).dirty=d.dirty=!0,C=f.mesh.splitEdge(g),f.mesh.splice(M.Sym,C),C.Lface.inside=d.inside;}else{if(n.edgeSign(M.Dst,g.Dst,M.Org)>0)return!1;d.dirty=u.dirty=!0,C=f.mesh.splitEdge(M),f.mesh.splice(g.Lnext,M.Sym),C.Rface.inside=d.inside;}return!0;},v.checkForIntersect=function(f,d){var u=v.regionBelow(d),g=d.eUp,M=u.eUp,C=g.Org,A=M.Org,L=g.Dst,O=M.Dst,w,b,I=new a(),R,W;if(i(!n.vertEq(O,L)),i(n.edgeSign(L,f.event,C)<=0),i(n.edgeSign(O,f.event,A)>=0),i(C!==f.event&&A!==f.event),i(!d.fixUpperEdge&&!u.fixUpperEdge),C===A||(w=Math.min(C.t,L.t),b=Math.max(A.t,O.t),w>b))return!1;if(n.vertLeq(C,A)){if(n.edgeSign(O,C,A)>0)return!1;}else if(n.edgeSign(L,A,C)<0)return!1;return v.debugEvent(f),n.intersect(L,C,O,A,I),i(Math.min(C.t,L.t)<=I.t),i(I.t<=Math.max(A.t,O.t)),i(Math.min(O.s,L.s)<=I.s),i(I.s<=Math.max(A.s,C.s)),n.vertLeq(I,f.event)&&(I.s=f.event.s,I.t=f.event.t),R=n.vertLeq(C,A)?C:A,n.vertLeq(R,I)&&(I.s=R.s,I.t=R.t),n.vertEq(I,C)||n.vertEq(I,A)?(v.checkForRightSplice(f,d),!1):!n.vertEq(L,f.event)&&n.edgeSign(L,f.event,I)>=0||!n.vertEq(O,f.event)&&n.edgeSign(O,f.event,I)<=0?O===f.event?(f.mesh.splitEdge(g.Sym),f.mesh.splice(M.Sym,g),d=v.topLeftRegion(f,d),g=v.regionBelow(d).eUp,v.finishLeftRegions(f,v.regionBelow(d),u),v.addRightEdges(f,d,g.Oprev,g,g,!0),!0):L===f.event?(f.mesh.splitEdge(M.Sym),f.mesh.splice(g.Lnext,M.Oprev),u=d,d=v.topRightRegion(d),W=v.regionBelow(d).eUp.Rprev,u.eUp=M.Oprev,M=v.finishLeftRegions(f,u,null),v.addRightEdges(f,d,M.Onext,g.Rprev,W,!0),!0):(n.edgeSign(L,f.event,I)>=0&&(v.regionAbove(d).dirty=d.dirty=!0,f.mesh.splitEdge(g.Sym),g.Org.s=f.event.s,g.Org.t=f.event.t),n.edgeSign(O,f.event,I)<=0&&(d.dirty=u.dirty=!0,f.mesh.splitEdge(M.Sym),M.Org.s=f.event.s,M.Org.t=f.event.t),!1):(f.mesh.splitEdge(g.Sym),f.mesh.splitEdge(M.Sym),f.mesh.splice(M.Oprev,g),g.Org.s=I.s,g.Org.t=I.t,g.Org.pqHandle=f.pq.insert(g.Org),v.getIntersectData(f,g.Org,C,L,A,O),v.regionAbove(d).dirty=d.dirty=u.dirty=!0,!1);},v.walkDirtyRegions=function(f,d){for(var u=v.regionBelow(d),g,M;;){for(;u.dirty;)d=u,u=v.regionBelow(u);if(!d.dirty&&(u=d,d=v.regionAbove(d),d===null||!d.dirty))return;if(d.dirty=!1,g=d.eUp,M=u.eUp,g.Dst!==M.Dst&&v.checkForLeftSplice(f,d)&&(u.fixUpperEdge?(v.deleteRegion(f,u),f.mesh["delete"](M),u=v.regionBelow(d),M=u.eUp):d.fixUpperEdge&&(v.deleteRegion(f,d),f.mesh["delete"](g),d=v.regionAbove(u),g=d.eUp)),g.Org!==M.Org)if(g.Dst!==M.Dst&&!d.fixUpperEdge&&!u.fixUpperEdge&&(g.Dst===f.event||M.Dst===f.event)){if(v.checkForIntersect(f,d))return;}else v.checkForRightSplice(f,d);g.Org===M.Org&&g.Dst===M.Dst&&(v.addWinding(M,g),v.deleteRegion(f,d),f.mesh["delete"](g),d=v.regionAbove(u));}},v.connectRightVertex=function(f,d,u){var g,M=u.Onext,C=v.regionBelow(d),A=d.eUp,L=C.eUp,O=!1;if(A.Dst!==L.Dst&&v.checkForIntersect(f,d),n.vertEq(A.Org,f.event)&&(f.mesh.splice(M.Oprev,A),d=v.topLeftRegion(f,d),M=v.regionBelow(d).eUp,v.finishLeftRegions(f,v.regionBelow(d),C),O=!0),n.vertEq(L.Org,f.event)&&(f.mesh.splice(u,L.Oprev),u=v.finishLeftRegions(f,C,null),O=!0),O){v.addRightEdges(f,d,u.Onext,M,M,!0);return;}n.vertLeq(L.Org,A.Org)?g=L.Oprev:g=A,g=f.mesh.connect(u.Lprev,g),v.addRightEdges(f,d,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,v.walkDirtyRegions(f,d);},v.connectLeftDegenerate=function(f,d,u){var g,M,C,A,L;if(g=d.eUp,n.vertEq(g.Org,u)){i(!1/*TOLERANCE_NONZERO*/),v.spliceMergeVertices(f,g,u.anEdge);return;}if(!n.vertEq(g.Dst,u)){f.mesh.splitEdge(g.Sym),d.fixUpperEdge&&(f.mesh["delete"](g.Onext),d.fixUpperEdge=!1),f.mesh.splice(u.anEdge,g),v.sweepEvent(f,u);return;}i(!1/*TOLERANCE_NONZERO*/),d=v.topRightRegion(d),L=v.regionBelow(d),C=L.eUp.Sym,M=A=C.Onext,L.fixUpperEdge&&(i(M!==C),v.deleteRegion(f,L),f.mesh["delete"](C),C=M.Oprev),f.mesh.splice(u.anEdge,C),n.edgeGoesLeft(M)||(M=null),v.addRightEdges(f,d,C.Onext,A,M,!0);},v.connectLeftVertex=function(f,d){var u,g,M,C,A,L,O=new S();if(O.eUp=d.anEdge.Sym,u=f.dict.search(O).key,g=v.regionBelow(u),!!g){if(C=u.eUp,A=g.eUp,n.edgeSign(C.Dst,d,C.Org)===0){v.connectLeftDegenerate(f,u,d);return;}if(M=n.vertLeq(A.Dst,C.Dst)?u:g,u.inside||M.fixUpperEdge){if(M===u)L=f.mesh.connect(d.anEdge.Sym,C.Lnext);else{var w=f.mesh.connect(A.Dnext,d.anEdge);L=w.Sym;}M.fixUpperEdge?v.fixUpperEdge(f,M,L):v.computeWinding(f,v.addRegionBelow(f,u,L)),v.sweepEvent(f,d);}else v.addRightEdges(f,u,d.anEdge,d.anEdge,null,!0);}},v.sweepEvent=function(f,d){f.event=d,v.debugEvent(f);for(var u=d.anEdge;u.activeRegion===null;)if(u=u.Onext,u===d.anEdge){v.connectLeftVertex(f,d);return;}var g=v.topLeftRegion(f,u.activeRegion);i(g!==null);var M=v.regionBelow(g),C=M.eUp,A=v.finishLeftRegions(f,M,null);A.Onext===C?v.connectRightVertex(f,g,A):v.addRightEdges(f,g,A.Onext,C,C,!0);},v.addSentinel=function(f,d,u,g){var M=new S(),C=f.mesh.makeEdge();C.Org.s=u,C.Org.t=g,C.Dst.s=d,C.Dst.t=g,f.event=C.Dst,M.eUp=C,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=f.dict.insert(M);},v.initEdgeDict=function(f){f.dict=new l(f,v.edgeLeq);var d=f.bmax[0]-f.bmin[0],u=f.bmax[1]-f.bmin[1],g=f.bmin[0]-d,M=f.bmax[0]+d,C=f.bmin[1]-u,A=f.bmax[1]+u;v.addSentinel(f,g,M,C),v.addSentinel(f,g,M,A);},v.doneEdgeDict=function(f){for(var d,u=0;(d=f.dict.min().key)!==null;)d.sentinel||(i(d.fixUpperEdge),i(++u===1)),i(d.windingNumber===0),v.deleteRegion(f,d);},v.removeDegenerateEdges=function(f){var d,u,g,M=f.mesh.eHead;for(d=M.next;d!==M;d=u)u=d.next,g=d.Lnext,n.vertEq(d.Org,d.Dst)&&d.Lnext.Lnext!==d&&(v.spliceMergeVertices(f,g,d),f.mesh["delete"](d),d=g,g=d.Lnext),g.Lnext===d&&(g!==d&&((g===u||g===u.Sym)&&(u=u.next),f.mesh["delete"](g)),(d===u||d===u.Sym)&&(u=u.next),f.mesh["delete"](d));},v.initPriorityQ=function(f){var d,u,g,M=0;for(g=f.mesh.vHead,u=g.next;u!==g;u=u.next)M++;for(M+=8,d=f.pq=new P(M,n.vertLeq),g=f.mesh.vHead,u=g.next;u!==g;u=u.next)u.pqHandle=d.insert(u);return u!==g?!1:(d.init(),!0);},v.donePriorityQ=function(f){f.pq=null;},v.removeDegenerateFaces=function(f,d){var u,g,M;for(u=d.fHead.next;u!==d.fHead;u=g)g=u.next,M=u.anEdge,i(M.Lnext!==M),M.Lnext.Lnext===M&&(v.addWinding(M.Onext,M),f.mesh["delete"](M));return!0;},v.computeInterior=function(f){var d,u;if(v.removeDegenerateEdges(f),!v.initPriorityQ(f))return!1;for(v.initEdgeDict(f);(d=f.pq.extractMin())!==null;){for(;u=f.pq.min(),!(u===null||!n.vertEq(u,d));)u=f.pq.extractMin(),v.spliceMergeVertices(f,d.anEdge,u.anEdge);v.sweepEvent(f,d);}return f.event=f.dict.min().key.eUp.Org,v.debugEvent(f),v.doneEdgeDict(f),v.donePriorityQ(f),v.removeDegenerateFaces(f,f.mesh)?(f.mesh.check(),!0):!1;};function 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=e.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0;}T.prototype={dot_:function dot_(f,d){return f[0]*d[0]+f[1]*d[1]+f[2]*d[2];},normalize_:function normalize_(f){var d=f[0]*f[0]+f[1]*f[1]+f[2]*f[2];i(d>0),d=Math.sqrt(d),f[0]/=d,f[1]/=d,f[2]/=d;},longAxis_:function longAxis_(f){var d=0;return Math.abs(f[1])>Math.abs(f[0])&&(d=1),Math.abs(f[2])>Math.abs(f[d])&&(d=2),d;},computeNormal_:function computeNormal_(f){var d,u,g,M,C,A,L=[0,0,0],O=[0,0,0],w=[0,0,0],b=[0,0,0],I=[0,0,0],R=[null,null,null],W=[null,null,null],z=this.mesh.vHead,K;for(d=z.next,K=0;K<3;++K)M=d.coords[K],O[K]=M,W[K]=d,L[K]=M,R[K]=d;for(d=z.next;d!==z;d=d.next)for(K=0;K<3;++K)M=d.coords[K],M<O[K]&&(O[K]=M,W[K]=d),M>L[K]&&(L[K]=M,R[K]=d);if(K=0,L[1]-O[1]>L[0]-O[0]&&(K=1),L[2]-O[2]>L[K]-O[K]&&(K=2),O[K]>=L[K]){f[0]=0,f[1]=0,f[2]=1;return;}for(A=0,u=W[K],g=R[K],w[0]=u.coords[0]-g.coords[0],w[1]=u.coords[1]-g.coords[1],w[2]=u.coords[2]-g.coords[2],d=z.next;d!==z;d=d.next)b[0]=d.coords[0]-g.coords[0],b[1]=d.coords[1]-g.coords[1],b[2]=d.coords[2]-g.coords[2],I[0]=w[1]*b[2]-w[2]*b[1],I[1]=w[2]*b[0]-w[0]*b[2],I[2]=w[0]*b[1]-w[1]*b[0],C=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],C>A&&(A=C,f[0]=I[0],f[1]=I[1],f[2]=I[2]);A<=0&&(f[0]=f[1]=f[2]=0,f[this.longAxis_(w)]=1);},checkOrientation_:function checkOrientation_(){var f,d,u=this.mesh.fHead,g,M=this.mesh.vHead,C;for(f=0,d=u.next;d!==u;d=d.next)if(C=d.anEdge,!(C.winding<=0))do f+=(C.Org.s-C.Dst.s)*(C.Org.t+C.Dst.t),C=C.Lnext;while(C!==d.anEdge);if(f<0){for(g=M.next;g!==M;g=g.next)g.t=-g.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
|
|
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 f,d=this.mesh.vHead,u=[0,0,0],g,M,C,A,L=!1;for(u[0]=this.normal[0],u[1]=this.normal[1],u[2]=this.normal[2],u[0]===0&&u[1]===0&&u[2]===0&&(this.computeNormal_(u),L=!0),g=this.sUnit,M=this.tUnit,C=this.longAxis_(u),g[C]=0,g[(C+1)%3]=1,g[(C+2)%3]=0,M[C]=0,M[(C+1)%3]=0,M[(C+2)%3]=u[C]>0?1:-1,f=d.next;f!==d;f=f.next)f.s=this.dot_(f.coords,g),f.t=this.dot_(f.coords,M);for(L&&this.checkOrientation_(),A=!0,f=d.next;f!==d;f=f.next)A?(this.bmin[0]=this.bmax[0]=f.s,this.bmin[1]=this.bmax[1]=f.t,A=!1):(f.s<this.bmin[0]&&(this.bmin[0]=f.s),f.s>this.bmax[0]&&(this.bmax[0]=f.s),f.t<this.bmin[1]&&(this.bmin[1]=f.t),f.t>this.bmax[1]&&(this.bmax[1]=f.t));},addWinding_:function addWinding_(f,d){f.winding+=d.winding,f.Sym.winding+=d.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_(f,d){var u,g;for(u=d.anEdge,i(u.Lnext!==u&&u.Lnext.Lnext!==u);n.vertLeq(u.Dst,u.Org);u=u.Lprev);for(;n.vertLeq(u.Org,u.Dst);u=u.Lnext);for(g=u.Lprev;u.Lnext!==g;)if(n.vertLeq(u.Dst,g.Org)){for(;g.Lnext!==u&&(n.edgeGoesLeft(g.Lnext)||n.edgeSign(g.Org,g.Dst,g.Lnext.Dst)<=0);){var M=f.connect(g.Lnext,g);g=M.Sym;}g=g.Lprev;}else{for(;g.Lnext!==u&&(n.edgeGoesRight(u.Lprev)||n.edgeSign(u.Dst,u.Org,u.Lprev.Org)>=0);){var M=f.connect(u,u.Lprev);u=M.Sym;}u=u.Lnext;}for(i(g.Lnext!==u);g.Lnext.Lnext!==u;){var M=f.connect(g.Lnext,g);g=M.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_(f){var d,u;for(d=f.fHead.next;d!==f.fHead;d=u)if(u=d.next,d.inside&&!this.tessellateMonoRegion_(f,d))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_(f){var d,u;for(d=f.fHead.next;d!==f.fHead;d=u)u=d.next,d.inside||f.zapFace(d);},/* 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_(f,d,u){var g,M;for(g=f.eHead.next;g!==f.eHead;g=M)M=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?d:-d:u?f["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(f){return!f.Rface||!f.Rface.inside?-1:f.Rface.n;},outputPolymesh_:function outputPolymesh_(f,d,u,g){var M,C,A,L=0,O=0,w,b;for(u>3&&f.mergeConvexFaces(u),M=f.vHead.next;M!==f.vHead;M=M.next)M.n=-1;for(C=f.fHead.next;C!==f.fHead;C=C.next)if(C.n=-1,!!C.inside){A=C.anEdge,w=0;do M=A.Org,M.n===-1&&(M.n=O,O++),w++,A=A.Lnext;while(A!==C.anEdge);i(w<=u),C.n=L,++L;}for(this.elementCount=L,d===e.CONNECTED_POLYGONS&&(L*=2),this.elements=[],this.elements.length=L*u,this.vertexCount=O,this.vertices=[],this.vertices.length=O*g,this.vertexIndices=[],this.vertexIndices.length=O,M=f.vHead.next;M!==f.vHead;M=M.next)if(M.n!==-1){var I=M.n*g;this.vertices[I+0]=M.coords[0],this.vertices[I+1]=M.coords[1],g>2&&(this.vertices[I+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx;}var R=0;for(C=f.fHead.next;C!==f.fHead;C=C.next)if(C.inside){A=C.anEdge,w=0;do M=A.Org,this.elements[R++]=M.n,w++,A=A.Lnext;while(A!==C.anEdge);for(b=w;b<u;++b)this.elements[R++]=-1;if(d===e.CONNECTED_POLYGONS){A=C.anEdge;do this.elements[R++]=this.getNeighbourFace_(A),A=A.Lnext;while(A!==C.anEdge);for(b=w;b<u;++b)this.elements[R++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
230
|
+
outputContours_:function outputContours_(f,d){var u,g,M,C=0,A=0;for(this.vertexCount=0,this.elementCount=0,u=f.fHead.next;u!==f.fHead;u=u.next)if(u.inside){M=g=u.anEdge;do this.vertexCount++,g=g.Lnext;while(g!==M);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*d,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var L=0,O=0,w=0;for(C=0,u=f.fHead.next;u!==f.fHead;u=u.next)if(u.inside){A=0,M=g=u.anEdge;do this.vertices[L++]=g.Org.coords[0],this.vertices[L++]=g.Org.coords[1],d>2&&(this.vertices[L++]=g.Org.coords[2]),this.vertexIndices[O++]=g.Org.idx,A++,g=g.Lnext;while(g!==M);this.elements[w++]=C,this.elements[w++]=A,C+=A;}},addContour:function addContour(f,d){var u,g;for(this.mesh===null&&(this.mesh=new c()),f<2&&(f=2),f>3&&(f=3),u=null,g=0;g<d.length;g+=f)u===null?(u=this.mesh.makeEdge(),this.mesh.splice(u,u.Sym)):(this.mesh.splitEdge(u),u=u.Lnext),u.Org.coords[0]=d[g+0],u.Org.coords[1]=d[g+1],f>2?u.Org.coords[2]=d[g+2]:u.Org.coords[2]=0,u.Org.idx=this.vertexIndexCounter++,u.winding=1,u.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
|
|
231
|
+
tesselate:function tesselate(f,d,u,g,M){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,M&&(this.normal[0]=M[0],this.normal[1]=M[1],this.normal[2]=M[2]),this.windingRule=f,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),v.computeInterior(this);var C=this.mesh;return d===e.BOUNDARY_CONTOURS?this.setWindingNumber_(C,1,!0):this.tessellateInterior_(C),C.check(),d===e.BOUNDARY_CONTOURS?this.outputContours_(C,g):this.outputPolymesh_(C,d,u,g),!0;}};},/* 62 *//***/function(h,r){h.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i<arguments.length;i++){var a=arguments[i];for(var o in a)t.call(a,o)&&(n[o]=a[o]);}return n;}},/* 63 *//***/function(h,r,t){t.r(r),t.d(r,"createShaders",function(){return s;}),t.d(r,"applyShader",function(){return c;}),t.d(r,"createCloudShaders",function(){return l;}),t.d(r,"applyCloudShader",function(){return p;});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function s(y){y[o]=[];for(var P=0;P<16;P++){var S=[],v=!!(P&1),_T10=!!(P&2),_f10=!!(P&4),d=!!(P&8);v&&S.push("#define TEXTURE 1"),_T10&&S.push("#define FILTER 1"),_f10&&S.push("#define GRADIENT 1"),d&&S.push("#define CLIPPATH 1");var u="".concat(S.join("\n"),"\n"),g=[];v&&g.push("uniform sampler2D u_texSampler;"),d&&g.push("uniform sampler2D u_clipSampler;"),y[o][P]=[u+g.join("\n")+n["default"],u+e["default"]];}}function c(y){var _ref95=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,P=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,S=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,v=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,T=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var f=P|S<<1|v<<2|T<<3;var d=y[o][f];Array.isArray(d)&&(d=y.createProgram.apply(y,_toConsumableArray(d)),y[o][f]=d),y.program!==d&&y.useProgram(d,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var m=[];function l(y){for(var P=0;P<64;P++){var S=[],v=!!(P&1),_T11=!!(P&2),_f11=!!(P&4),d=!!(P&8),u=!!(P&16),g=!!(P&32);v&&S.push("#define TEXTURE 1"),_T11&&S.push("#define FILTER 1"),_f11&&S.push("#define GRADIENT 1"),d&&S.push("#define CLOUDCOLOR 1"),u&&S.push("#define CLOUDFILTER 1"),g&&S.push("#define CLIPPATH 1");var M="".concat(S.join("\n"),"\n"),C=[];if(v){C.push("uniform sampler2D u_texSampler;");for(var A=0;A<12;A++)C.push("uniform sampler2D u_texFrame".concat(A,";"));}g&&C.push("uniform sampler2D u_clipSampler;"),m[P]=[M+C.join("\n")+a["default"],M+i["default"]];}}function p(y){var _ref96=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref96$hasTexture=_ref96.hasTexture,P=_ref96$hasTexture===void 0?!1:_ref96$hasTexture,_ref96$hasFilter=_ref96.hasFilter,S=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,v=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,T=_ref96$hasCloudColor===void 0?!1:_ref96$hasCloudColor,_ref96$hasCloudFilter=_ref96.hasCloudFilter,f=_ref96$hasCloudFilter===void 0?!1:_ref96$hasCloudFilter,_ref96$hasClipPath=_ref96.hasClipPath,d=_ref96$hasClipPath===void 0?!1:_ref96$hasClipPath;var u=P|S<<1|v<<2|T<<3|f<<4|d<<5;var g=m[u];Array.isArray(g)&&(g=y.createProgram.apply(y,_toConsumableArray(g)),m[u]=g),y.program!==g&&y.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});}},/* 64 *//***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n vColor = a_color;\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n}";},/* 65 *//***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n// uniform float u_radialGradientVector[6];\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\n#ifdef FILTER\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 66 *//***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nattribute vec3 a_transform0;\nattribute vec3 a_transform1;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute float a_frameIndex;\nvarying float frameIndex;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef CLOUDFILTER\nattribute vec4 a_colorCloud0;\nattribute vec4 a_colorCloud1;\nattribute vec4 a_colorCloud2;\nattribute vec4 a_colorCloud3;\nattribute vec4 a_colorCloud4;\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef CLOUDCOLOR\nattribute vec4 a_fillCloudColor;\nattribute vec4 a_strokeCloudColor;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n mat3 modelMatrix = mat3(\n a_transform0.x, a_transform1.x, 0, \n a_transform0.y, a_transform1.y, 0,\n a_transform0.z, a_transform1.z, 1\n );\n\n vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n\n#ifdef CLOUDCOLOR\n if(flagBackground > 0.0) {\n vColor = mix(a_color, a_fillCloudColor, a_fillCloudColor.a);\n } else {\n vColor = mix(a_color, a_strokeCloudColor, a_strokeCloudColor.a);\n }\n#else\n vColor = a_color;\n#endif\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n frameIndex = a_frameIndex;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n\n#ifdef CLOUDFILTER\n colorCloud0 = a_colorCloud0;\n colorCloud1 = a_colorCloud1;\n colorCloud2 = a_colorCloud2;\n colorCloud3 = a_colorCloud3;\n colorCloud4 = a_colorCloud4;\n#endif\n}";},/* 67 *//***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying float frameIndex;\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef CLOUDFILTER\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n\n#ifdef CLOUDFILTER\nvoid buildCloudColor(inout float colorCloudMatrix[20]) {\n colorCloudMatrix[0] = colorCloud0[0];\n colorCloudMatrix[1] = colorCloud1[0];\n colorCloudMatrix[2] = colorCloud2[0];\n colorCloudMatrix[3] = colorCloud3[0];\n colorCloudMatrix[4] = colorCloud4[0];\n\n colorCloudMatrix[5] = colorCloud0[1];\n colorCloudMatrix[6] = colorCloud1[1];\n colorCloudMatrix[7] = colorCloud2[1];\n colorCloudMatrix[8] = colorCloud3[1];\n colorCloudMatrix[9] = colorCloud4[1];\n\n colorCloudMatrix[10] = colorCloud0[2];\n colorCloudMatrix[11] = colorCloud1[2];\n colorCloudMatrix[12] = colorCloud2[2];\n colorCloudMatrix[13] = colorCloud3[2];\n colorCloudMatrix[14] = colorCloud4[2];\n\n colorCloudMatrix[15] = colorCloud0[3];\n colorCloudMatrix[16] = colorCloud1[3];\n colorCloudMatrix[17] = colorCloud2[3];\n colorCloudMatrix[18] = colorCloud3[3];\n colorCloudMatrix[19] = colorCloud4[3];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n if(frameIndex < 0.0) {\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n color = mix(color, texColor, texColor.a);\n } else {\n int index = int(floor(clamp(0.0, 11.0, frameIndex)));\n vec4 texColor;\n if(index == 0) texColor = texture2D(u_texFrame0, texCoord.xy);\n else if(index == 1) texColor = texture2D(u_texFrame1, texCoord.xy);\n else if(index == 2) texColor = texture2D(u_texFrame2, texCoord.xy);\n else if(index == 3) texColor = texture2D(u_texFrame3, texCoord.xy);\n else if(index == 4) texColor = texture2D(u_texFrame4, texCoord.xy);\n else if(index == 5) texColor = texture2D(u_texFrame5, texCoord.xy);\n else if(index == 6) texColor = texture2D(u_texFrame6, texCoord.xy);\n else if(index == 7) texColor = texture2D(u_texFrame7, texCoord.xy);\n else if(index == 8) texColor = texture2D(u_texFrame8, texCoord.xy);\n else if(index == 9) texColor = texture2D(u_texFrame9, texCoord.xy);\n else if(index == 10) texColor = texture2D(u_texFrame10, texCoord.xy);\n else texColor = texture2D(u_texFrame11, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLOUDFILTER\n float colorCloudMatrix[20];\n buildCloudColor(colorCloudMatrix);\n transformColor(color, colorCloudMatrix);\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 68 *//***/function(h,r,t){t.r(r),function(e,n){t.d(r,"requestAnimationFrame",function(){return a;}),t.d(r,"cancelAnimationFrame",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(e)<"u"&&e.hrtime){var _e$hrtime=e.hrtime(),_e$hrtime2=_slicedToArray(_e$hrtime,2),s=_e$hrtime2[0],c=_e$hrtime2[1];return s*1e3+c*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var a,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,o=n.cancelAnimationFrame):(a=function a(s){return setTimeout(function(){s(i());},16);},o=function o(s){return clearTimeout(s);});}.call(this,t(69),t(22));},/* 69 *//***/function(h,r){var t=h.exports={},e,n;function i(){throw new Error("setTimeout has not been defined");}function a(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i;}catch(_unused4){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused5){n=a;}})();function o(T){if(e===setTimeout)return setTimeout(T,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(T,0);try{return e(T,0);}catch(_unused6){try{return e.call(null,T,0);}catch(_unused7){return e.call(this,T,0);}}}function s(T){if(n===clearTimeout)return clearTimeout(T);if((n===a||!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 c=[],m=!1,l,p=-1;function y(){!m||!l||(m=!1,l.length?c=l.concat(c):p=-1,c.length&&P());}function P(){if(!m){var T=o(y);m=!0;for(var f=c.length;f;){for(l=c,c=[];++p<f;)l&&l[p].run();p=-1,f=c.length;}l=null,m=!1,s(T);}}t.nextTick=function(T){var f=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)f[d-1]=arguments[d];c.push(new S(T,f)),c.length===1&&!m&&o(P);};function S(T,f){this.fun=T,this.array=f;}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 v(){}t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,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(h,r,t){t.r(r),t.d(r,"default",function(){return A;});var e=t(1),n=t(71),i=t(73),a=t(213),o=t(214),s=t(215),c=t(216);t(1).glMatrix.setMatrixArrayType(Array);function m(L,O){var w=Object.keys(L);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(L);O&&(b=b.filter(function(I){return Object.getOwnPropertyDescriptor(L,I).enumerable;})),w.push.apply(w,b);}return w;}function l(L){for(var O=1;O<arguments.length;O++){var w=arguments[O]!=null?arguments[O]:{};O%2?m(Object(w),!0).forEach(function(b){p(L,b,w[b]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(w)):m(Object(w)).forEach(function(b){Object.defineProperty(L,b,Object.getOwnPropertyDescriptor(w,b));});}return L;}function p(L,O,w){return O in L?Object.defineProperty(L,O,{value:w,enumerable:!0,configurable:!0,writable:!0}):L[O]=w,L;}var y=Symbol["for"]("spritejs_changedAttrs"),P=Symbol["for"]("spritejs_attributes"),S=Symbol("resolution"),v=Symbol("animations"),T=Symbol("eventListeners"),f=Symbol("captureEventListeners"),d=Symbol("filters"),u=Symbol("display"),g=Symbol("program"),M=Symbol("shaderAttrs"),C=Symbol("uniforms");var A=/*#__PURE__*/function(){function A(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,A);this.attributes=new this.constructor.Attr(this),this[S]={width:300,height:150},Object.assign(this.attributes,O),this[v]=/* @__PURE__ */new Set(),this[T]={},this[f]={};}return _createClass(A,[{key:"ancestors",get:function get(){var O=this.parent;var w=[];for(;O;)w.push(O),O=O.parent;return w;}},{key:"animations",get:function get(){return this[v];}},{key:"filters",get:function get(){return this[d]||this.parent&&this.parent.filters;}},{key:"isVisible",get:function get(){return!1;}},{key:"layer",get:function get(){return this.parent?this.parent.layer:null;}},{key:"localMatrix",get:function get(){var O=this.transformMatrix,_this$attributes=this.attributes,w=_this$attributes.x,b=_this$attributes.y;return O[4]+=w,O[5]+=b,O;}},{key:"opacity",get:function get(){var O=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(O*=this.parent.opacity),O;}},{key:"parentNode",get:function get(){return this.parent;}},{key:"nextSibling",get:function get(){return this.getNodeNearBy(1);}},{key:"previousSibling",get:function get(){return this.getNodeNearBy(-1);}},{key:"program",get:function get(){return this[g];}/* get parent defined by connect method */},{key:"renderer",get:function get(){return this.parent?this.parent.renderer:null;}},{key:"renderMatrix",get:function get(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;var O=this.localMatrix;var w=this.parent;if(w){var b=w.__cacheRenderMatrix||w.renderMatrix;b&&(O=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,O));}return O;}},{key:"worldScaling",get:function get(){var O=this.renderMatrix;return[Math.hypot(O[0],O[1]),Math.hypot(O[2],O[3])];}},{key:"worldRotation",get:function get(){var O=this.renderMatrix;return Math.atan2(O[1],O[3]);}},{key:"worldPosition",get:function get(){var O=this.renderMatrix;return[O[4],O[5]];}},{key:"uniforms",get:function get(){return this[C];}/* get zOrder defined by connect method *//* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(O){this.attributes.className=O;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(O){this.attributes.id=O;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(O){this.attributes.name=O;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(O){this.attributes.zIndex=O;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[M]||{};}},{key:"activateAnimations",value:function activateAnimations(){var O=this.layer;if(O){var w=this[v];w.forEach(function(I){I.baseTimeline=O.timeline,I.play(),I.finished.then(function(){w["delete"](I);});});var b=this.children;b&&b.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(O,w){var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};O==="mousewheel"&&(O="wheel"),typeof b=="boolean"&&(b={capture:b});var _b8=b,I=_b8.capture,R=_b8.once,W=I?f:T;return this[W][O]=this[W][O]||[],this[W][O].push({listener:w,once:R}),this;}},{key:"animate",value:function animate(O,w){var _this21=this;var b=new i["default"](this,O,w);return this.effects&&b.applyEffects(this.effects),this.layer&&(b.baseTimeline=this.layer.timeline,b.play(),b.finished.then(function(){_this21[v]["delete"](b);})),this[v].add(b),b;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,O=new Array(_len7),_key7=0;_key7<_len7;_key7++){O[_key7]=arguments[_key7];}if(O.length===0)return this.attributes[P];if(O.length>1){var w=O[0],b=O[1];return typeof b=="function"&&(b=b(this.attr(w))),this.setAttribute(w,b),this;}return typeof O[0]=="string"?this.getAttribute(O[0]):(Object.assign(this.attributes,O[0]),this);}},{key:"cloneNode",value:function cloneNode(){var O=new this.constructor(),w=this.attributes[y];return O.attr(w),O;}},{key:"connect",value:function connect(O,w){Object.defineProperty(this,"parent",{value:O,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:w,writable:!1,configurable:!0}),O.timeline&&this.activateAnimations(),this.setResolution(O.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:O,zOrder:w}});}},{key:"contains",value:function contains(O){for(;O&&this!==O;)O=O.parent;return!!O;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[v].forEach(function(w){return w.cancel();});var O=this.children;O&&O.forEach(function(w){w.deactivateAnimations&&w.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var O=this.parent,w=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:O,zOrder:w}}),O&&O.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(O){var _this22=this;O instanceof o["default"]||(O=new o["default"](O)),O.target=this;var w=O.type;w==="mousewheel"&&(w="wheel");var b=[this];var I=this.parent;for(;O.bubbles&&I;)b.push(I),I=I.parent;for(var R=b.length-1;R>=0;R--){var W=b[R],z=W[f]&&W[f][w];if(z&&z.length&&(O.currentTarget=W,z.forEach(function(_ref97){var K=_ref97.listener,J=_ref97.once;K.call(_this22,O),J&&b.removeEventListener(K);}),delete O.currentTarget),!O.bubbles&&O.cancelBubble)break;}if(!O.cancelBubble)for(var _R4=0;_R4<b.length;_R4++){var _W=b[_R4],_z3=_W[T]&&_W[T][w];if(_z3&&_z3.length&&(O.currentTarget=_W,_z3.forEach(function(_ref98){var K=_ref98.listener,J=_ref98.once;K.call(_this22,O),J&&b.removeEventListener(K);}),delete O.currentTarget),!O.bubbles||O.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(O){var w=O.layerX,b=O.layerY;return this.isPointCollision(w,b)?(this.dispatchEvent(O),!0):!1;}},{key:"draw",value:function draw(){var _this23=this;var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var w=this.mesh;if(w){if(Object(s.applyFilters)(w,this.filters),O.push(w),this[g]){w.setProgram(this[g]);var b=this[M];b&&Object.entries(b).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),R=_ref100[0],W=_ref100[1];w.setAttribute(R,W);});var I=this[C];if(this[C]){var R={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],z=_ref102[1];typeof z=="function"&&(z=z(_this23,W)),R[W]=z;}),w.setUniforms(R);}}Object(c["default"])(this,w);}return O;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(O){return this.attributes[O];}},{key:"getListeners",value:function getListeners(O){var _ref103=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref103$capture=_ref103.capture,w=_ref103$capture===void 0?!1:_ref103$capture;return _toConsumableArray(this[w?f:T][O]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(O===0)return this;var w=this.parent.children,b=w.indexOf(this);return w[b+O];}},{key:"getWorldPosition",value:function getWorldPosition(O,w){var b=this.renderMatrix,I=O*b[0]+w*b[2]+b[4],R=O*b[1]+w*b[3]+b[5];return[I,R];}},{key:"getOffsetPosition",value:function getOffsetPosition(O,w){var b=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=O*b[0]+w*b[2]+b[4],R=O*b[1]+w*b[3]+b[5];return[I,R];}},{key:"getResolution",value:function getResolution(){return l({},this[S]);}},{key:"isPointCollision",value:function isPointCollision(O,w){if(!this.mesh)return!1;var b=this.attributes.pointerEvents;if(b==="none"||b!=="all"&&!this.isVisible)return!1;var I="both";return b==="visibleFill"&&(I="fill"),b==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(O,w,I);}},{key:"onPropertyChange",value:function onPropertyChange(O,w,b){O!=="id"&&O!=="name"&&O!=="className"&&O!=="pointerEvents"&&O!=="passEvents"&&this.forceUpdate(),O==="filter"&&(this[d]=Object(s.parseFilterString)(w)),O==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(O,w){O==="attrs"&&this.attr(w),this.attributes[O]=w;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
|
|
232
|
+
},{key:"setProgram",value:function setProgram(O){this[g]=O,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(O,w){this[M]=this[M]||{},this[M][O]=w,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(O){this[C]=this[C]||{},Object.assign(this[C],O),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref104){var O=_ref104.width,w=_ref104.height;var _this$S3=this[S],b=_this$S3.width,I=_this$S3.height;(b!==O||I!==w)&&(this[S]={width:O,height:w},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:O,height:w}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[u]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[u]=this.attributes.display,this.attributes.display="none");}},{key:"releaseMouseCapture",value:function releaseMouseCapture(){this.layer&&this.layer.__mouseCapturedTarget===this&&(this.layer.__mouseCapturedTarget=null);}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"removeAllListeners",value:function removeAllListeners(O){var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof w=="boolean"&&(w={capture:w});var I=w.capture?f:T;return this[I][O]&&(this[I][O]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(O){this.setAttribute(O,null);}},{key:"removeEventListener",value:function removeEventListener(O,w){var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof b=="boolean"&&(b={capture:b});var R=b.capture?f:T;if(this[R][O]){var W=this[R][O];if(W)for(var z=0;z<W.length;z++){var K=W[z].listener;if(K===w){this[R][O].splice(z,1);break;}}}return this;}},{key:"transition",value:function transition(O){var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var b=this,I=Symbol("animation");w=w||"linear";var R=0;return _typeof(O)=="object"&&(R=O.delay||0,O=O.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var z=this[I];z&&z.cancel(W);}),"end",function end(){var W=this[I];W&&(W.playState==="running"||W.playState==="pending")&&W.finish();}),"reverse",function reverse(){var W=this[I];if(W)if(W.playState==="running"||W.playState==="pending")W.playbackRate=-W.playbackRate;else{var z=W.timing.direction;W.timing.direction=z==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,z){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,z)),Object.entries(W).forEach(function(_ref105){var _ref106=_slicedToArray(_ref105,2),K=_ref106[0],J=_ref106[1];typeof J=="function"&&(W[K]=J(b.attr(K)));}),this[I]=b.animate([W],{duration:O*1e3,delay:R*1e3,fill:"forwards",easing:w}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();p(A,"Attr",n["default"]),a["default"].registerNode(A,"node");},/* 71 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return A;});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_attributes"),l=Symbol["for"]("spritejs_changedAttrs"),p=Symbol("subject"),y=Symbol("attr"),P=Symbol("default"),S=Symbol("alias");function v(L,_ref108){var _ref109=_slicedToArray(_ref108,2),O=_ref109[0],w=_ref109[1];var b=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(L).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),I=_ref111[0],R=_ref111[1];if((O||w)&&(b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[O,w])),I==="matrix")b=e.mat2d.multiply(b,b,R);else if(I==="offsetTranslate")b[4]+=R[0],b[5]+=R[1];else if(I==="offsetRotate")b=e.mat2d.rotate(Array.of(0,0,0,0,0,0),b,R);else if(I==="skew"){var _R5=_slicedToArray(R,2),W=_R5[0],z=_R5[1];b=e.mat2d.multiply(b,b,e.mat2d.fromValues(1,Math.tan(z),Math.tan(W),1,0,0));}else e.mat2d[I](b,b,R);(O||w)&&(b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-O,-w]));}),b;}var T=Symbol("transformMatrix"),f=Symbol("transforms"),d=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function M(L,O,w){var b=L[y][O];if(L[s](O,w,!1)||L[u]!==O){var R=L[f];R.has(O)&&R["delete"](O),w&&(O==="rotate"&&(w=Math.PI*w/180),O==="scale"&&(w=w.map(function(W){return Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5;})),R.set(O,w)),L[T]=null,L[p].onPropertyChange(O,w,b,L);}}function C(L){var O=L[g],w=L.offsetDistance*O.getTotalLength(),b=O.getPointAtLength(w);if(b){var I=L[f];var R=L.offsetRotate;R==="auto"?R=b.angle:R==="reverse"?R=Math.PI+b.angle:R=Math.PI*R/180,I.set("offsetRotate",R),I.set("offsetTranslate",[b.x,b.y]),L[T]=null;}}var A=/*#__PURE__*/function(){function A(O){var _this24=this;_classCallCheck(this,A);this[p]=O,this[y]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[f]=/* @__PURE__ */new Map(),this[P]={},this[S]=[],Object.defineProperty(O,"transformMatrix",{get:function get(){return _this24[T]||(_this24[T]=v(_this24[f],_this24.transformOrigin)),_toConsumableArray(_this24[T]);}}),this[a]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",// none | visible | visibleFill | visibleStroke | all
|
|
233
|
+
filter:"none",display:""}),this[o]("class","pos"),this[d]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(A,[{key:l,get:function get(){var _this25=this;var O={};return _toConsumableArray(this[d]).forEach(function(w){O[w]=_this25[y][w];}),O;}},{key:m,get:function get(){var O=Object.assign({},this[y]);for(var w=0;w<this[S].length;w++){var b=this[S][w];O[b]=this[b];}return O;}},{key:a,value:function value(O){Object.assign(this[P],O),Object.assign(this[y],O);}},{key:o,value:function value(){var _this$S4;(_this$S4=this[S]).push.apply(_this$S4,arguments);}},{key:s,value:function value(O,w){var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[y][O],R=this[p];return w==null&&(w=this[P][O]),Object(i.compareValue)(I,w)?!1:(this[y][O]=w,this[d].has(O)&&this[d]["delete"](O),this[d].add(O),this[u]=O,b&&R.onPropertyChange(O,w,I,this),!0);}},{key:c,value:function value(O){return this[y][O];}},{key:"id",get:function get(){return this[c]("id");},set:function set(O){this[s]("id",O);}},{key:"name",get:function get(){return this[c]("name");},set:function set(O){this[s]("name",O);}},{key:"className",get:function get(){return this[c]("className");},set:function set(O){this[s]("className",O);}},{key:"class",get:function get(){return this.className;},set:function set(O){this.className=O;}},{key:"x",get:function get(){return this[c]("x");},set:function set(O){this[s]("x",Object(i.toNumber)(O));}},{key:"y",get:function get(){return this[c]("y");},set:function set(O){this[s]("y",Object(i.toNumber)(O));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(O){O=Object(i.toArray)(O),Array.isArray(O)||(O=[O,O]),this.x=O[0],this.y=O[1];}},{key:"transform",get:function get(){return this[c]("transform");},set:function set(O){var w=null;if(Array.isArray(O)&&(w=O,O="matrix(".concat(O.map(i.toNumber).join(),")")),typeof O=="string")O=O.replace(/\s*,\s*/g,",");else if(O!=null)throw new TypeError("Invalid transform value.");var b=this[y].transform;if(this[s]("transform",O,!1)){var I=this[f];if(I.has("matrix")&&I["delete"]("matrix"),w)I.set("matrix",w);else if(O){var R=O.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(R){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var z=0;z<R.length;z++){var J=R[z].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(J){var _J2=_slicedToArray(J,3),q=_J2[1],U=_J2[2];q==="rotate"?U=Math.PI*parseFloat(U)/180:U=U.trim().split(/[\s,]+/).map(function(G){return Object(i.toNumber)(G);}),q==="matrix"?W=e.mat2d.multiply(W,W,U):q==="skew"?W=e.mat2d.multiply(W,W,e.mat2d.fromValues(1,Math.tan(U[1]),Math.tan(U[0]),1,0,0)):e.mat2d[q](W,W,U),I.set("matrix",W);}}}else throw new TypeError("Invalid transform value.");}this[T]=null,this[p].onPropertyChange("transform",O,b,this);}}},{key:"transformOrigin",get:function get(){return this[c]("transformOrigin");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),this[s]("transformOrigin",O)&&(this[T]=null);}},{key:"rotate",get:function get(){return this[c]("rotate");},set:function set(O){M(this,"rotate",O);}},{key:"translate",get:function get(){return this[c]("translate");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),M(this,"translate",O);}},{key:"scale",get:function get(){return this[c]("scale");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),M(this,"scale",O);}},{key:"skew",get:function get(){return this[c]("skew");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),M(this,"skew",O);}},{key:"opacity",get:function get(){return this[c]("opacity");},set:function set(O){O!=null&&(O=Number(O)),this[s]("opacity",O);}},{key:"zIndex",get:function get(){return this[c]("zIndex");},set:function set(O){O!=null&&(O=Number(O)),this[s]("zIndex",O);}},{key:"offsetPath",get:function get(){return this[c]("offsetPath");},set:function set(O){this[s]("offsetPath",O)&&(this[g].beginPath(),O!=null&&this[g].addPath(O),C(this));}},{key:"offsetDistance",get:function get(){return this[c]("offsetDistance");},set:function set(O){this[s]("offsetDistance",Object(i.toNumber)(O))&&C(this);}},{key:"offsetRotate",get:function get(){return this[c]("offsetRotate");},set:function set(O){this[s]("offsetRotate",O),C(this);}},{key:"pointerEvents",get:function get(){return this[c]("pointerEvents");},set:function set(O){if(O!=null&&O!=="none"&&O!=="visible"&&O!=="visibleFill"&&O!=="visibleStroke"&&O!=="all")throw new TypeError("Invalid pointerEvents type.");this[s]("pointerEvents",O);}},{key:"filter",get:function get(){return this[c]("filter");},set:function set(O){this[s]("filter",O);}},{key:"display",get:function get(){return this[c]("display");},set:function set(O){this[s]("display",O);}/* istanbul ignore next */},{key:"offset",set:function set(O){}}],[{key:"setDefault",value:function setDefault(O){for(var _len8=arguments.length,w=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){w[_key8-1]=arguments[_key8];}return O[a].apply(O,w);}},{key:"declareAlias",value:function declareAlias(O){for(var _len9=arguments.length,w=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){w[_key9-1]=arguments[_key9];}return O[o].apply(O,w);}},{key:"setAttribute",value:function setAttribute(O){for(var _len10=arguments.length,w=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){w[_key10-1]=arguments[_key10];}return O[s].apply(O,w);}},{key:"getAttribute",value:function getAttribute(O){for(var _len11=arguments.length,w=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){w[_key11-1]=arguments[_key11];}return O[c].apply(O,w);}},{key:"getAttributes",value:function getAttributes(O){return O[m];}},{key:"getChangedAttributes",value:function getChangedAttributes(O){return O[l];}}]);}();},/* 72 *//***/function(h,r,t){t.r(r),t.d(r,"sizeToPixel",function(){return e;}),t.d(r,"toString",function(){return n;}),t.d(r,"toNumber",function(){return i;}),t.d(r,"toArray",function(){return a;}),t.d(r,"compareValue",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function e(s,c){var m=s.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);m?s={size:parseFloat(m[1]),unit:m[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,l=_s3.size,p=_s3.unit;if(p==="pt")l/=0.75;else if(p==="pc")l*=16;else if(p==="in")l*=96;else if(p==="cm")l*=96/2.54;else if(p==="mm")l*=96/25.4;else if(p==="em"||p==="rem"||p==="ex"){if(!c&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var y=getComputedStyle(document.documentElement).fontSize;y?c=e(y,16):c=16;}l*=c,p==="ex"&&(l/=2);}else if(p==="q")l*=96/25.4/4;else if(p==="vw"||p==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y3=p==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;l*=_y3/100;}}else if((p==="vmax"||p==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y4=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;p==="vmax"?l*=Math.max(_y4,P)/100:l*=Math.min(_y4,P)/100;}return l;}function n(s){return s==null?s:String(s);}function i(s){if(s==null)return s;if(typeof s=="string"&&(s=e(s)),!Number.isFinite(s))throw new TypeError("Invalid value");return s;}function a(s){var c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\s,]+/g)),Array.isArray(s)&&(c&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,c){if(Array.isArray(s)&&Array.isArray(c)){if(s.length!==c.length)return!1;for(var m=0;m<s.length;m++)if(s[m]!==c[m])return!1;return!0;}return s==null&&c==null||s===c;}},/* 73 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(74),n=t(32),i=/* @__PURE__ */t.n(n),a=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(){return s=Object.assign||function(y){for(var P=1;P<arguments.length;P++){var S=arguments[P];for(var v in S)Object.prototype.hasOwnProperty.call(S,v)&&(y[v]=S[v]);}return y;},s.apply(this,arguments);}function c(y){if(typeof y=="string"){if(y=y.trim(),/^[0-9.]+%$/.test(y))return parseFloat(y)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(y))return Object(o.sizeToPixel)(y);}return y;}function m(y,P,S,v,T){return typeof y=="string"&&(y=i()(y)),typeof P=="string"&&(P=i()(P)),e.Effects["default"](y,P,S,v,T);}function l(y,P,S,v,T){return e.Effects["default"](y,P,S,v,T);}e.Effects["default"]=function(y,P,S,v,T){return Array.isArray(y)&&Array.isArray(P)?y.map(function(f,d){return f+(S-v)/(T-v)*(P[d]-f);}):typeof y=="number"&&typeof P=="number"?y+(S-v)/(T-v)*(P-y):S-v>T-S?P:y;},e.Effects.fillColor=m,e.Effects.strokeColor=m,e.Effects.bgcolor=m,e.Effects.borderColor=m,e.Effects.text=l;var p=/*#__PURE__*/function(_e$Animator){function p(P,S,v){var _this26;_classCallCheck(this,p);var T=P.attr();Object.entries(T).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),f=_ref113[0],d=_ref113[1];T[f]=e.Effects[f]?d:c(d);}),S=S.map(function(f){var d=s({},f);var u={};return Object.entries(d).forEach(function(_ref114){var _ref115=_slicedToArray(_ref114,2),g=_ref115[0],M=_ref115[1];u[g]=e.Effects[g]?M:c(M);}),u;}),_this26=_callSuper(this,p,[T,S,v]),_this26.target=P,_this26.setter=function(f,d){d.attr(f);};return _this26;}_inherits(p,_e$Animator);return _createClass(p,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(p,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this27=this;return _superPropGet(p,"finished",this,1).then(function(){var P=_this27;return new Promise(function(S){function v(){P.setter(P.frame,P.target);var T=P.playState;T==="finished"||T==="idle"?(Object(a.cancelAnimationFrame)(P.requestId),S()):Object(a.requestAnimationFrame)(v);}v();});});}},{key:"finish",value:function finish(){_superPropGet(p,"finish",this,3)([]),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(p,"play",this,3)([]),this.setter(this.frame,this.target);var P=this;this.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(function S(){var v=P.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&v.layer&&v.layer.canvas&&!document.documentElement.contains(v.layer.canvas)){P.cancel();return;}var T=P.playState;P.setter(P.frame,P.target),T!=="idle"&&(T==="running"?P.requestId=Object(a.requestAnimationFrame)(S):(T==="paused"||T==="pending"&&P.timeline.currentTime<0)&&P.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(S);}));});});}},{key:"cancel",value:function cancel(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),P?(this.setter(this.frame,this.target),_superPropGet(p,"cancel",this,3)([])):(_superPropGet(p,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(e.Animator);},/* 74 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=m(e),i=t(187),a=m(i),o=t(188),s=t(190),c=m(s);function m(l){return l&&l.__esModule?l:{"default":l};}r.Animator=c["default"],r.Easings=o.Easings,r.Effects=a["default"],r.Timeline=n["default"];},/* 75 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=f(e),i=t(133),a=f(i),o=t(141),s=f(o),c=t(164),m=f(c),l=t(170),p=f(l),y=t(171),P=f(y),S=t(175),v=f(S),T=t(186);function f(b){return b&&b.__esModule?b:{"default":b};}var d=(0,T.createNowTime)(),u={originTime:0,playbackRate:1},g=(0,v["default"])("timeMark"),M=(0,v["default"])("playbackRate"),C=(0,v["default"])("timers"),A=(0,v["default"])("originTime"),L=(0,v["default"])("setTimer"),O=(0,v["default"])("parent"),w=function(){function b(I,R){(0,p["default"])(this,b),I instanceof b&&(R=I,I={}),I=(0,m["default"])({},u,I),R&&(this[O]=R);var W=I.nowtime||d;if(R)Object.defineProperty(this,"globalTime",{get:function get(){return R.currentTime;}});else{var z=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-z;}});}this[g]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[O]&&(this[g][0].globalEntropy=this[O].entropy),this[A]=I.originTime,this[M]=I.playbackRate,this[C]=new s["default"]();}return(0,P["default"])(b,[{key:"markTime",value:function value(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=R.time,z=W===void 0?this.currentTime:W,K=R.entropy,J=K===void 0?this.entropy:K,q=R.playbackRate,U=q===void 0?this.playbackRate:q,G={globalTime:this.globalTime,localTime:z,entropy:J,playbackRate:U,globalEntropy:this.globalEntropy};this[g].push(G);}},{key:"fork",value:function value(R){return new b(R,this);}},{key:"seekGlobalTime",value:function value(R){var W=this.seekTimeMark(R),z=this[g][W],K=z.entropy,J=z.playbackRate,q=z.globalTime;return q+(R-K)/Math.abs(J);}},{key:"seekLocalTime",value:function value(R){var W=this.seekTimeMark(R),z=this[g][W],K=z.localTime,J=z.entropy,q=z.playbackRate;return q>0?K+(R-J):K-(R-J);}},{key:"seekTimeMark",value:function value(R){var W=this[g],z=0,K=W.length-1;if(R<=W[z].entropy)return z;if(R>=W[K].entropy)return K;for(var J=Math.floor((z+K)/2);J>z&&J<K;){if(R===W[J].entropy)return J;R<W[J].entropy?K=J:R>W[J].entropy&&(z=J),J=Math.floor((z+K)/2);}return z;}},{key:"updateTimers",value:function value(){var R=this,W=[].concat((0,a["default"])(this[C]));W.forEach(function(z){var K=(0,n["default"])(z,2),J=K[0],q=K[1];R[L](q.handler,q.time,J);});}},{key:"clearTimeout",value:function(I){function R(W){return I.apply(this,arguments);}return R.toString=function(){return I.toString();},R;}(function(I){var R=this[C].get(I);R&&R.timerID!=null&&(this[O]?this[O].clearTimeout(R.timerID):clearTimeout(R.timerID)),this[C]["delete"](I);})},{key:"clearInterval",value:function value(R){return this.clearTimeout(R);}},{key:"clear",value:function value(){var R=this,W=this[C];[].concat((0,a["default"])(W.keys())).forEach(function(z){R.clearTimeout(z);});}/*
|
|
234
|
+
setTimeout(func, {delay: 100, isEntropy: true})
|
|
235
|
+
setTimeout(func, {entropy: 100})
|
|
236
|
+
setTimeout(func, 100})
|
|
237
|
+
*/},{key:"setTimeout",value:function value(R){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[L](R,W);}},{key:"setInterval",value:function value(R){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},z=this,K=this[L](function J(){z[L](J,W,K),R();},W);return K;}},{key:L,value:function value(R,W){var z=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,v["default"])("timerID");W=(0,T.formatDelay)(W);var J=this[C].get(K),q=void 0,U=null,G=void 0,Z=void 0;J?(this.clearTimeout(K),W.isEntropy?q=(W.delay-(this.entropy-J.startEntropy))/Math.abs(this.playbackRate):q=(W.delay-(this.currentTime-J.startTime))/this.playbackRate,G=J.startTime,Z=J.startEntropy):(q=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),G=this.currentTime,Z=this.entropy);var rt=this[O],et=rt?rt.setTimeout.bind(rt):setTimeout,it=W.heading;return!rt&&it===!1&&q<0&&(q=1/0),(isFinite(q)||rt)&&(q=Math.ceil(q),et!==setTimeout&&(q={delay:q,heading:it}),U=et(function(){z[C]["delete"](K),R();},q)),this[C].set(K,{timerID:U,handler:R,time:W,startTime:G,startEntropy:Z}),K;}},{key:"parent",get:function get(){return this[O];}},{key:"lastTimeMark",get:function get(){return this[g][this[g].length-1];}},{key:"currentTime",get:function get(){var R=this.lastTimeMark,W=R.localTime,z=R.globalTime;return W+(this.globalTime-z)*this.playbackRate;},set:function set(R){var W=this,z=this.currentTime,K=R,J=this[C];this.markTime({time:R}),[].concat((0,a["default"])(J)).forEach(function(q){var U=(0,n["default"])(q,2),G=U[0],Z=U[1];if(J.has(G)){var rt=Z.time,et=rt.isEntropy,it=rt.delay,X=rt.heading,ct=Z.handler,ut=Z.startTime;if(et)it===0&&(ct(),W.clearTimeout(G));else{var B=ut+it;(it===0||X!==!1&&(K-z)*it<=0||z<=B&&B<=K||z>=B&&B>=K)&&(ct(),W.clearTimeout(G));}}}),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,W=R.entropy,z=R.globalEntropy;return W+Math.abs((this.globalEntropy-z)*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 W=this.seekTimeMark(R);this[g].length=W+1;}this.markTime({entropy:R}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[O]?this[O].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[M];},set:function set(R){R!==this.playbackRate&&(this.markTime({playbackRate:R}),this[M]=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;}}]),b;}();r["default"]=w;},/* 76 *//***/function(h,r,t){r.__esModule=!0;var e=t(77),n=o(e),i=t(129),a=o(i);function o(s){return s&&s.__esModule?s:{"default":s};}r["default"]=/* @__PURE__ */function(){function s(c,m){var l=[],p=!0,y=!1,P=void 0;try{for(var S=(0,a["default"])(c),v;!(p=(v=S.next()).done)&&(l.push(v.value),!(m&&l.length===m));p=!0);}catch(T){y=!0,P=T;}finally{try{!p&&S["return"]&&S["return"]();}finally{if(y)throw P;}}return l;}return function(c,m){if(Array.isArray(c))return c;if((0,n["default"])(Object(c)))return s(c,m);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 *//***/function(h,r,t){h.exports={"default":t(78),__esModule:!0};},/* 78 *//***/function(h,r,t){t(79),t(125),h.exports=t(127);},/* 79 *//***/function(h,r,t){t(80);for(var e=t(91),n=t(95),i=t(83),a=t(122)("toStringTag"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s<o.length;s++){var c=o[s],m=e[c],l=m&&m.prototype;l&&!l[a]&&n(l,a,c),i[c]=i.Array;}},/* 80 *//***/function(h,r,t){var e=t(81),n=t(82),i=t(83),a=t(84);h.exports=t(88)(Array,"Array",function(o,s){this._t=a(o),this._i=0,this._k=s;},function(){var o=this._t,s=this._k,c=this._i++;return!o||c>=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,c):s=="values"?n(0,o[c]):n(0,[c,o[c]]);},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries");},/* 81 *//***/function(h,r){h.exports=function(){};},/* 82 *//***/function(h,r){h.exports=function(t,e){return{value:e,done:!!t};};},/* 83 *//***/function(h,r){h.exports={};},/* 84 *//***/function(h,r,t){var e=t(85),n=t(87);h.exports=function(i){return e(n(i));};},/* 85 *//***/function(h,r,t){var e=t(86);h.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n);};},/* 86 *//***/function(h,r){var t={}.toString;h.exports=function(e){return t.call(e).slice(8,-1);};},/* 87 *//***/function(h,r){h.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 *//***/function(h,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),o=t(83),s=t(107),c=t(121),m=t(123),l=t(122)("iterator"),p=!([].keys&&"next"in[].keys()),y="@@iterator",P="keys",S="values",v=function v(){return this;};h.exports=function(T,f,d,u,g,M,C){s(d,f,u);var A=function A(U){if(!p&&U in b)return b[U];switch(U){case P:return function(){return new d(this,U);};case S:return function(){return new d(this,U);};}return function(){return new d(this,U);};},L=f+" Iterator",O=g==S,w=!1,b=T.prototype,I=b[l]||b[y]||g&&b[g],R=I||A(g),W=g?O?A("entries"):R:void 0,z=f=="Array"&&b.entries||I,K,J,q;if(z&&(q=m(z.call(new T())),q!==Object.prototype&&q.next&&(c(q,L,!0),!e&&typeof q[l]!="function"&&a(q,l,v))),O&&I&&I.name!==S&&(w=!0,R=function R(){return I.call(this);}),(!e||C)&&(p||w||!b[l])&&a(b,l,R),o[f]=R,o[L]=v,g)if(K={values:O?R:A(S),keys:M?R:A(P),entries:W},C)for(J in K)J in b||i(b,J,K[J]);else n(n.P+n.F*(p||w),f,K);return K;};},/* 89 *//***/function(h,r){h.exports=!0;},/* 90 *//***/function(h,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),o=t(105),s="prototype",_c2=function c(m,l,p){var y=m&_c2.F,P=m&_c2.G,S=m&_c2.S,v=m&_c2.P,T=m&_c2.B,f=m&_c2.W,d=P?n:n[l]||(n[l]={}),u=d[s],g=P?e:S?e[l]:(e[l]||{})[s],M,C,A;P&&(p=l);for(M in p)C=!y&&g&&g[M]!==void 0,!(C&&o(d,M))&&(A=C?g[M]:p[M],d[M]=P&&typeof g[M]!="function"?p[M]:T&&C?i(A,e):f&&g[M]==A?function(L){var O=function O(w,b,I){if(this instanceof L){switch(arguments.length){case 0:return new L();case 1:return new L(w);case 2:return new L(w,b);}return new L(w,b,I);}return L.apply(this,arguments);};return O[s]=L[s],O;}(A):v&&typeof A=="function"?i(Function.call,A):A,v&&((d.virtual||(d.virtual={}))[M]=A,m&_c2.R&&u&&!u[M]&&a(u,M,A)));};_c2.F=1,_c2.G=2,_c2.S=4,_c2.P=8,_c2.B=16,_c2.W=32,_c2.U=64,_c2.R=128,h.exports=_c2;},/* 91 *//***/function(h,r){var t=h.exports=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window.Math==Math?window:(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t);},/* 92 *//***/function(h,r){var t=h.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 *//***/function(h,r,t){var e=t(94);h.exports=function(n,i,a){if(e(n),i===void 0)return n;switch(a){case 1:return function(o){return n.call(i,o);};case 2:return function(o,s){return n.call(i,o,s);};case 3:return function(o,s,c){return n.call(i,o,s,c);};}return function(){return n.apply(i,arguments);};};},/* 94 *//***/function(h,r){h.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 *//***/function(h,r,t){var e=t(96),n=t(104);h.exports=t(100)?function(i,a,o){return e.f(i,a,n(1,o));}:function(i,a,o){return i[a]=o,i;};},/* 96 *//***/function(h,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(s,c,m){if(e(s),c=i(c,!0),e(m),n)try{return a(s,c,m);}catch(_unused10){}if("get"in m||"set"in m)throw TypeError("Accessors not supported!");return"value"in m&&(s[c]=m.value),s;};},/* 97 *//***/function(h,r,t){var e=t(98);h.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n;};},/* 98 *//***/function(h,r){h.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 *//***/function(h,r,t){h.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 *//***/function(h,r,t){h.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 *//***/function(h,r){h.exports=function(t){try{return!!t();}catch(_unused11){return!0;}};},/* 102 *//***/function(h,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);h.exports=function(a){return i?n.createElement(a):{};};},/* 103 *//***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n))return n;var a,o;if(i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(o=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n)))return o;throw TypeError("Can't convert object to primitive value");};},/* 104 *//***/function(h,r){h.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e};};},/* 105 *//***/function(h,r){var t={}.hasOwnProperty;h.exports=function(e,n){return t.call(e,n);};},/* 106 *//***/function(h,r,t){h.exports=t(95);},/* 107 *//***/function(h,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this;}),h.exports=function(o,s,c){o.prototype=e(a,{next:n(1,c)}),i(o,s+" Iterator");};},/* 108 *//***/function(h,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),o=function o(){},s="prototype",_c3=function c(){var m=t(102)("iframe"),l=i.length,p="<",y=">",P;for(m.style.display="none",t(120).appendChild(m),m.src="javascript:",P=m.contentWindow.document,P.open(),P.write(p+"script"+y+"document.F=Object"+p+"/script"+y),P.close(),_c3=P.F;l--;)delete _c3[s][i[l]];return _c3();};h.exports=Object.create||function(l,p){var y;return l!==null?(o[s]=e(l),y=new o(),o[s]=null,y[a]=l):y=_c3(),p===void 0?y:n(y,p);};},/* 109 *//***/function(h,r,t){var e=t(96),n=t(97),i=t(110);h.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var c=i(s),m=c.length,l=0,p;m>l;)e.f(o,p=c[l++],s[p]);return o;};},/* 110 *//***/function(h,r,t){var e=t(111),n=t(119);h.exports=Object.keys||function(a){return e(a,n);};},/* 111 *//***/function(h,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");h.exports=function(o,s){var c=n(o),m=0,l=[],p;for(p in c)p!=a&&e(c,p)&&l.push(p);for(;s.length>m;)e(c,p=s[m++])&&(~i(l,p)||l.push(p));return l;};},/* 112 *//***/function(h,r,t){var e=t(84),n=t(113),i=t(115);h.exports=function(a){return function(o,s,c){var m=e(o),l=n(m.length),p=i(c,l),y;if(a&&s!=s){for(;l>p;)if(y=m[p++],y!=y)return!0;}else for(;l>p;p++)if((a||p in m)&&m[p]===s)return a||p||0;return!a&&-1;};};},/* 113 *//***/function(h,r,t){var e=t(114),n=Math.min;h.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 *//***/function(h,r){var t=Math.ceil,e=Math.floor;h.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 *//***/function(h,r,t){var e=t(114),n=Math.max,i=Math.min;h.exports=function(a,o){return a=e(a),a<0?n(a+o,0):i(a,o);};},/* 116 *//***/function(h,r,t){var e=t(117)("keys"),n=t(118);h.exports=function(i){return e[i]||(e[i]=n(i));};},/* 117 *//***/function(h,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(h.exports=function(o,s){return a[o]||(a[o]=s!==void 0?s:{});})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 *//***/function(h,r){var t=0,e=Math.random();h.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36));};},/* 119 *//***/function(h,r){h.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 *//***/function(h,r,t){var e=t(91).document;h.exports=e&&e.documentElement;},/* 121 *//***/function(h,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");h.exports=function(a,o,s){a&&!n(a=s?a:a.prototype,i)&&e(a,i,{configurable:!0,value:o});};},/* 122 *//***/function(h,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",o=h.exports=function(s){return e[s]||(e[s]=a&&i[s]||(a?i:n)("Symbol."+s));};o.store=e;},/* 123 *//***/function(h,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;h.exports=Object.getPrototypeOf||function(o){return o=n(o),e(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?a:null;};},/* 124 *//***/function(h,r,t){var e=t(87);h.exports=function(n){return Object(e(n));};},/* 125 *//***/function(h,r,t){var e=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,i=this._i,a;return i>=n.length?{value:void 0,done:!0}:(a=e(n,i),this._i+=a.length,{value:a,done:!1});});},/* 126 *//***/function(h,r,t){var e=t(114),n=t(87);h.exports=function(i){return function(a,o){var s=String(n(a)),c=e(o),m=s.length,l,p;return c<0||c>=m?i?"":void 0:(l=s.charCodeAt(c),l<55296||l>56319||c+1===m||(p=s.charCodeAt(c+1))<56320||p>57343?i?s.charAt(c):l:i?s.slice(c,c+2):(l-55296<<10)+(p-56320)+65536);};};},/* 127 *//***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).isIterable=function(a){var o=Object(a);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(e(o));};},/* 128 *//***/function(h,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(/* @__PURE__ */function(){return arguments;}())=="Arguments",a=function a(o,s){try{return o[s];}catch(_unused12){}};h.exports=function(o){var s,c,m;return o===void 0?"Undefined":o===null?"Null":typeof(c=a(s=Object(o),n))=="string"?c:i?e(s):(m=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":m;};},/* 129 *//***/function(h,r,t){h.exports={"default":t(130),__esModule:!0};},/* 130 *//***/function(h,r,t){t(79),t(125),h.exports=t(131);},/* 131 *//***/function(h,r,t){var e=t(97),n=t(132);h.exports=t(92).getIterator=function(i){var a=n(i);if(typeof a!="function")throw TypeError(i+" is not iterable!");return e(a.call(i));};},/* 132 *//***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)];};},/* 133 *//***/function(h,r,t){r.__esModule=!0;var e=t(134),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=function(a){if(Array.isArray(a)){for(var o=0,s=Array(a.length);o<a.length;o++)s[o]=a[o];return s;}else return(0,n["default"])(a);};},/* 134 *//***/function(h,r,t){h.exports={"default":t(135),__esModule:!0};},/* 135 *//***/function(h,r,t){t(125),t(136),h.exports=t(92).Array.from;},/* 136 *//***/function(h,r,t){var e=t(93),n=t(90),i=t(124),a=t(137),o=t(138),s=t(113),c=t(139),m=t(132);n(n.S+n.F*!t(140)(function(l){Array.from(l);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
|
|
251
|
+
from:function from(p){var y=i(p),P=typeof this=="function"?this:Array,S=arguments.length,v=S>1?arguments[1]:void 0,T=v!==void 0,f=0,d=m(y),u,g,M,C;if(T&&(v=e(v,S>2?arguments[2]:void 0,2)),d!=null&&!(P==Array&&o(d)))for(C=d.call(y),g=new P();!(M=C.next()).done;f++)c(g,f,T?a(C,v,[M.value,f],!0):M.value);else for(u=s(y.length),g=new P(u);u>f;f++)c(g,f,T?v(y[f],f):y[f]);return g.length=f,g;}});},/* 137 *//***/function(h,r,t){var e=t(97);h.exports=function(n,i,a,o){try{return o?i(e(a)[0],a[1]):i(a);}catch(c){var s=n["return"];throw s!==void 0&&e(s.call(n)),c;}};},/* 138 *//***/function(h,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;h.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a);};},/* 139 *//***/function(h,r,t){var e=t(96),n=t(104);h.exports=function(i,a,o){a in i?e.f(i,a,n(0,o)):i[a]=o;};},/* 140 *//***/function(h,r,t){var e=t(122)("iterator"),n=!1;try{var i=[7][e]();i["return"]=function(){n=!0;},Array.from(i,function(){throw 2;});}catch(_unused13){}h.exports=function(a,o){if(!o&&!n)return!1;var s=!1;try{var c=[7],m=c[e]();m.next=function(){return{done:s=!0};},c[e]=function(){return m;},a(c);}catch(_unused14){}return s;};},/* 141 *//***/function(h,r,t){h.exports={"default":t(142),__esModule:!0};},/* 142 *//***/function(h,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),h.exports=t(92).Map;},/* 143 *//***/function(h,r){},/* 144 *//***/function(h,r,t){var e=t(145),n=t(151),i="Map";h.exports=t(152)(i,function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
|
|
252
|
+
get:function get(o){var s=e.getEntry(n(this,i),o);return s&&s.v;},// 23.1.3.9 Map.prototype.set(key, value)
|
|
253
|
+
set:function set(o,s){return e.def(n(this,i),o===0?0:o,s);}},e,!0);},/* 145 *//***/function(h,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),o=t(147),s=t(148),c=t(88),m=t(82),l=t(149),p=t(100),y=t(150).fastKey,P=t(151),S=p?"_s":"size",v=function v(T,f){var d=y(f),u;if(d!=="F")return T._i[d];for(u=T._f;u;u=u.n)if(u.k==f)return u;};h.exports={getConstructor:function getConstructor(T,f,d,u){var g=T(function(M,C){o(M,g,f,"_i"),M._t=f,M._i=n(null),M._f=void 0,M._l=void 0,M[S]=0,C!=null&&s(C,d,M[u],M);});return i(g.prototype,{// 23.1.3.1 Map.prototype.clear()
|
|
254
|
+
// 23.2.3.2 Set.prototype.clear()
|
|
255
|
+
clear:function clear(){for(var C=P(this,f),A=C._i,L=C._f;L;L=L.n)L.r=!0,L.p&&(L.p=L.p.n=void 0),delete A[L.i];C._f=C._l=void 0,C[S]=0;},// 23.1.3.3 Map.prototype.delete(key)
|
|
256
|
+
// 23.2.3.4 Set.prototype.delete(value)
|
|
257
|
+
"delete":function _delete(M){var C=P(this,f),A=v(C,M);if(A){var L=A.n,O=A.p;delete C._i[A.i],A.r=!0,O&&(O.n=L),L&&(L.p=O),C._f==A&&(C._f=L),C._l==A&&(C._l=O),C[S]--;}return!!A;},// 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(C){P(this,f);for(var A=a(C,arguments.length>1?arguments[1]:void 0,3),L;L=L?L.n:this._f;)for(A(L.v,L.k,this);L&&L.r;)L=L.p;},// 23.1.3.7 Map.prototype.has(key)
|
|
260
|
+
// 23.2.3.7 Set.prototype.has(value)
|
|
261
|
+
has:function has(C){return!!v(P(this,f),C);}}),p&&e(g.prototype,"size",{get:function get(){return P(this,f)[S];}}),g;},def:function def(T,f,d){var u=v(T,f),g,M;return u?u.v=d:(T._l=u={i:M=y(f,!0),// <- index
|
|
262
|
+
k:f,// <- key
|
|
263
|
+
v:d,// <- value
|
|
264
|
+
p:g=T._l,// <- previous entry
|
|
265
|
+
n:void 0,// <- next entry
|
|
266
|
+
r:!1// <- removed
|
|
267
|
+
},T._f||(T._f=u),g&&(g.n=u),T[S]++,M!=="F"&&(T._i[M]=u)),T;},getEntry:v,setStrong:function setStrong(T,f,d){c(T,f,function(u,g){this._t=P(u,f),this._k=g,this._l=void 0;},function(){for(var u=this,g=u._k,M=u._l;M&&M.r;)M=M.p;return!u._t||!(u._l=M=M?M.n:u._t._f)?(u._t=void 0,m(1)):g=="keys"?m(0,M.k):g=="values"?m(0,M.v):m(0,[M.k,M.v]);},d?"entries":"values",!d,!0),l(f);}};},/* 146 *//***/function(h,r,t){var e=t(95);h.exports=function(n,i,a){for(var o in i)a&&n[o]?n[o]=i[o]:e(n,o,i[o]);return n;};},/* 147 *//***/function(h,r){h.exports=function(t,e,n,i){if(!(t instanceof e)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 *//***/function(h,l,t){var e=t(93),n=t(137),i=t(138),a=t(97),o=t(113),s=t(132),c={},m={},l=h.exports=function(p,y,P,S,v){var T=v?function(){return p;}:s(p),f=e(P,S,y?2:1),d=0,u,g,M,C;if(typeof T!="function")throw TypeError(p+" is not iterable!");if(i(T)){for(u=o(p.length);u>d;d++)if(C=y?f(a(g=p[d])[0],g[1]):f(p[d]),C===c||C===m)return C;}else for(M=T.call(p);!(g=M.next()).done;)if(C=n(M,f,g.value,y),C===c||C===m)return C;};l.BREAK=c,l.RETURN=m;},/* 149 *//***/function(h,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),o=t(122)("species");h.exports=function(s){var c=typeof n[s]=="function"?n[s]:e[s];a&&c&&!c[o]&&i.f(c,o,{configurable:!0,get:function get(){return this;}});};},/* 150 *//***/function(h,r,t){var e=t(118)("meta"),n=t(98),i=t(105),a=t(96).f,o=0,s=Object.isExtensible||function(){return!0;},c=!t(101)(function(){return s(Object.preventExtensions({}));}),m=function m(S){a(S,e,{value:{i:"O"+ ++o,// object ID
|
|
268
|
+
w:{}// weak collections IDs
|
|
269
|
+
}});},l=function l(S,v){if(!n(S))return _typeof(S)=="symbol"?S:(typeof S=="string"?"S":"P")+S;if(!i(S,e)){if(!s(S))return"F";if(!v)return"E";m(S);}return S[e].i;},p=function p(S,v){if(!i(S,e)){if(!s(S))return!0;if(!v)return!1;m(S);}return S[e].w;},y=function y(S){return c&&P.NEED&&s(S)&&!i(S,e)&&m(S),S;},P=h.exports={KEY:e,NEED:!1,fastKey:l,getWeak:p,onFreeze:y};},/* 151 *//***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 *//***/function(h,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),o=t(95),s=t(146),c=t(148),m=t(147),l=t(98),p=t(121),y=t(96).f,P=t(153)(0),S=t(100);h.exports=function(v,T,f,d,u,g){var M=e[v],C=M,A=u?"set":"add",L=C&&C.prototype,O={};return!S||typeof C!="function"||!(g||L.forEach&&!a(function(){new C().entries().next();}))?(C=d.getConstructor(T,v,u,A),s(C.prototype,f),i.NEED=!0):(C=T(function(w,b){m(w,C,v,"_c"),w._c=new M(),b!=null&&c(b,u,w[A],w);}),P("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(w){var b=w=="add"||w=="set";w in L&&!(g&&w=="clear")&&o(C.prototype,w,function(I,R){if(m(this,C,w),!b&&g&&!l(I))return w=="get"?void 0:!1;var W=this._c[w](I===0?0:I,R);return b?this:W;});}),g||y(C.prototype,"size",{get:function get(){return this._c.size;}})),p(C,v),O[v]=C,n(n.G+n.W+n.F,O),g||d.setStrong(C,v,u),C;};},/* 153 *//***/function(h,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),o=t(154);h.exports=function(s,c){var m=s==1,l=s==2,p=s==3,y=s==4,P=s==6,S=s==5||P,v=c||o;return function(T,f,d){for(var u=i(T),g=n(u),M=e(f,d,3),C=a(g.length),A=0,L=m?v(T,C):l?v(T,0):void 0,O,w;C>A;A++)if((S||A in g)&&(O=g[A],w=M(O,A,u),s)){if(m)L[A]=w;else if(w)switch(s){case 3:return!0;case 5:return O;case 6:return A;case 2:L.push(O);}else if(y)return!1;}return P?-1:p||y?y:L;};};},/* 154 *//***/function(h,r,t){var e=t(155);h.exports=function(n,i){return new(e(n))(i);};},/* 155 *//***/function(h,r,t){var e=t(98),n=t(156),i=t(122)("species");h.exports=function(a){var o;return n(a)&&(o=a.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),e(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 *//***/function(h,r,t){var e=t(86);h.exports=Array.isArray||function(i){return e(i)=="Array";};},/* 157 *//***/function(h,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")});},/* 158 *//***/function(h,r,t){var e=t(128),n=t(159);h.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this);};};},/* 159 *//***/function(h,r,t){var e=t(148);h.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a;};},/* 160 *//***/function(h,r,t){t(161)("Map");},/* 161 *//***/function(h,r,t){var e=t(90);h.exports=function(n){e(e.S,n,{of:function of(){for(var a=arguments.length,o=new Array(a);a--;)o[a]=arguments[a];return new this(o);}});};},/* 162 *//***/function(h,r,t){t(163)("Map");},/* 163 *//***/function(h,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);h.exports=function(o){e(e.S,o,{from:function from(c){var m=arguments[1],l,p,y,P;return n(this),l=m!==void 0,l&&n(m),c==null?new this():(p=[],l?(y=0,P=i(m,arguments[2],2),a(c,!1,function(S){p.push(P(S,y++));})):a(c,!1,p.push,p),new this(p));}});};},/* 164 *//***/function(h,r,t){h.exports={"default":t(165),__esModule:!0};},/* 165 *//***/function(h,r,t){t(166),h.exports=t(92).Object.assign;},/* 166 *//***/function(h,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 *//***/function(h,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),o=t(124),s=t(85),c=Object.assign;h.exports=!c||t(101)(function(){var m={},l={},p=Symbol(),y="abcdefghijklmnopqrst";return m[p]=7,y.split("").forEach(function(P){l[P]=P;}),c({},m)[p]!=7||Object.keys(c({},l)).join("")!=y;})?function(l,p){for(var y=o(l),P=arguments.length,S=1,v=i.f,T=a.f;P>S;)for(var f=s(arguments[S++]),d=v?n(f).concat(v(f)):n(f),u=d.length,g=0,M;u>g;)M=d[g++],(!e||T.call(f,M))&&(y[M]=f[M]);return y;}:c;},/* 168 *//***/function(h,r){r.f=Object.getOwnPropertySymbols;},/* 169 *//***/function(h,r){r.f={}.propertyIsEnumerable;},/* 170 *//***/function(h,r,t){r.__esModule=!0,r["default"]=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 *//***/function(h,r,t){r.__esModule=!0;var e=t(172),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=/* @__PURE__ */function(){function a(o,s){for(var c=0;c<s.length;c++){var m=s[c];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),(0,n["default"])(o,m.key,m);}}return function(o,s,c){return s&&a(o.prototype,s),c&&a(o,c),o;};}();},/* 172 *//***/function(h,r,t){h.exports={"default":t(173),__esModule:!0};},/* 173 *//***/function(h,r,t){t(174);var e=t(92).Object;h.exports=function(i,a,o){return e.defineProperty(i,a,o);};},/* 174 *//***/function(h,r,t){var e=t(90);e(e.S+e.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 *//***/function(h,r,t){h.exports={"default":t(176),__esModule:!0};},/* 176 *//***/function(h,r,t){t(177),t(143),t(184),t(185),h.exports=t(92).Symbol;},/* 177 *//***/function(h,r,t){var e=t(91),n=t(105),i=t(100),a=t(90),o=t(106),s=t(150).KEY,c=t(101),m=t(117),l=t(121),p=t(118),y=t(122),P=t(178),S=t(179),v=t(180),T=t(156),f=t(97),d=t(98),u=t(124),g=t(84),M=t(103),C=t(104),A=t(108),L=t(181),O=t(183),w=t(168),b=t(96),I=t(110),R=O.f,W=b.f,z=L.f,_K2=e.Symbol,J=e.JSON,q=J&&J.stringify,U="prototype",G=y("_hidden"),Z=y("toPrimitive"),rt={}.propertyIsEnumerable,et=m("symbol-registry"),it=m("symbols"),X=m("op-symbols"),ct=Object[U],ut=typeof _K2=="function"&&!!w.f,B=e.QObject,F=!B||!B[U]||!B[U].findChild,Y=i&&c(function(){return A(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(lt,at,ht){var mt=R(ct,at);mt&&delete ct[at],W(lt,at,ht),mt&<!==ct&&W(ct,at,mt);}:W,k=function k(lt){var at=it[lt]=A(_K2[U]);return at._k=lt,at;},N=ut&&_typeof(_K2.iterator)=="symbol"?function(lt){return _typeof(lt)=="symbol";}:function(lt){return lt instanceof _K2;},_$2=function $(at,ht,mt){return at===ct&&_$2(X,ht,mt),f(at),ht=M(ht,!0),f(mt),n(it,ht)?(mt.enumerable?(n(at,G)&&at[G][ht]&&(at[G][ht]=!1),mt=A(mt,{enumerable:C(0,!1)})):(n(at,G)||W(at,G,C(1,{})),at[G][ht]=!0),Y(at,ht,mt)):W(at,ht,mt);},x=function x(at,ht){f(at);for(var mt=v(ht=g(ht)),yt=0,gt=mt.length,Mt;gt>yt;)_$2(at,Mt=mt[yt++],ht[Mt]);return at;},E=function E(at,ht){return ht===void 0?A(at):x(A(at),ht);},D=function D(at){var ht=rt.call(this,at=M(at,!0));return this===ct&&n(it,at)&&!n(X,at)?!1:ht||!n(this,at)||!n(it,at)||n(this,G)&&this[G][at]?ht:!0;},j=function j(at,ht){if(at=g(at),ht=M(ht,!0),!(at===ct&&n(it,ht)&&!n(X,ht))){var mt=R(at,ht);return mt&&n(it,ht)&&!(n(at,G)&&at[G][ht])&&(mt.enumerable=!0),mt;}},H=function H(at){for(var ht=z(g(at)),mt=[],yt=0,gt;ht.length>yt;)!n(it,gt=ht[yt++])&>!=G&>!=s&&mt.push(gt);return mt;},V=function V(at){for(var ht=at===ct,mt=z(ht?X:g(at)),yt=[],gt=0,Mt;mt.length>gt;)n(it,Mt=mt[gt++])&&(!ht||n(ct,Mt))&&yt.push(it[Mt]);return yt;};ut||(_K2=function K(){if(this instanceof _K2)throw TypeError("Symbol is not a constructor!");var at=p(arguments.length>0?arguments[0]:void 0),_ht=function ht(mt){this===ct&&_ht.call(X,mt),n(this,G)&&n(this[G],at)&&(this[G][at]=!1),Y(this,at,C(1,mt));};return i&&F&&Y(ct,at,{configurable:!0,set:_ht}),k(at);},o(_K2[U],"toString",function(){return this._k;}),O.f=j,b.f=_$2,t(182).f=L.f=H,t(169).f=D,w.f=V,i&&!t(89)&&o(ct,"propertyIsEnumerable",D,!0),P.f=function(lt){return k(y(lt));}),a(a.G+a.W+a.F*!ut,{Symbol:_K2});for(var Q=// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
|
|
270
|
+
"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;Q.length>nt;)y(Q[nt++]);for(var st=I(y.store),ft=0;st.length>ft;)S(st[ft++]);a(a.S+a.F*!ut,"Symbol",{// 19.4.2.1 Symbol.for(key)
|
|
271
|
+
"for":function _for(lt){return n(et,lt+="")?et[lt]:et[lt]=_K2(lt);},// 19.4.2.5 Symbol.keyFor(sym)
|
|
272
|
+
keyFor:function keyFor(at){if(!N(at))throw TypeError(at+" is not a symbol!");for(var ht in et)if(et[ht]===at)return ht;},useSetter:function useSetter(){F=!0;},useSimple:function useSimple(){F=!1;}}),a(a.S+a.F*!ut,"Object",{// 19.1.2.2 Object.create(O [, Properties])
|
|
273
|
+
create:E,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
|
274
|
+
defineProperty:_$2,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
275
|
+
defineProperties:x,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
276
|
+
getOwnPropertyDescriptor:j,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
277
|
+
getOwnPropertyNames:H,// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
|
278
|
+
getOwnPropertySymbols:V});var pt=c(function(){w.f(1);});a(a.S+a.F*pt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(at){return w.f(u(at));}}),J&&a(a.S+a.F*(!ut||c(function(){var lt=_K2();return q([lt])!="[null]"||q({a:lt})!="{}"||q(Object(lt))!="{}";})),"JSON",{stringify:function stringify(at){for(var ht=[at],mt=1,yt,gt;arguments.length>mt;)ht.push(arguments[mt++]);if(gt=yt=ht[1],!(!d(yt)&&at===void 0||N(at)))return T(yt)||(yt=function yt(Mt,It){if(typeof gt=="function"&&(It=gt.call(this,Mt,It)),!N(It))return It;}),ht[1]=yt,q.apply(J,ht);}}),_K2[U][Z]||t(95)(_K2[U],Z,_K2[U].valueOf),l(_K2,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0);},/* 178 *//***/function(h,r,t){r.f=t(122);},/* 179 *//***/function(h,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),o=t(96).f;h.exports=function(s){var c=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in c)&&o(c,s,{value:a.f(s)});};},/* 180 *//***/function(h,r,t){var e=t(110),n=t(168),i=t(169);h.exports=function(a){var o=e(a),s=n.f;if(s)for(var c=s(a),m=i.f,l=0,p;c.length>l;)m.call(a,p=c[l++])&&o.push(p);return o;};},/* 181 *//***/function(h,r,t){var e=t(84),n=t(182).f,i={}.toString,a=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(s){try{return n(s);}catch(_unused15){return a.slice();}};h.exports.f=function(c){return a&&i.call(c)=="[object Window]"?o(c):n(e(c));};},/* 182 *//***/function(h,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n);};},/* 183 *//***/function(h,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),o=t(105),s=t(99),c=Object.getOwnPropertyDescriptor;r.f=t(100)?c:function(l,p){if(l=i(l),p=a(p,!0),s)try{return c(l,p);}catch(_unused16){}if(o(l,p))return n(!e.f.call(l,p),l[p]);};},/* 184 *//***/function(h,r,t){t(179)("asyncIterator");},/* 185 *//***/function(h,r,t){t(179)("observable");},/* 186 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.createNowTime=e,r.formatDelay=n;function e(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame
|
|
279
|
+
"default":function _default(n,i,a,o,s){return typeof n=="number"&&typeof i=="number"?n+(a-o)/(s-o)*(i-n):a-o>s-a?i:n;}};},/* 188 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.parseEasing=r.Easings=void 0;var e=t(76),n=c(e),i=t(133),a=c(i),o=t(141),s=c(o);function c(T){return T&&T.__esModule?T:{"default":T};}var m=t(189),l=new s["default"]();function p(){for(var T=arguments.length,f=Array(T),d=0;d<T;d++)f[d]=arguments[d];var u=l.get(f);return u||(u=m.apply(void 0,f),l.set(f,u),u);}function y(T){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(d,u){for(var g=1;g<u.length;g++){var M=u[g].offset;if(d<=M){var C=u[g-1].offset,A=M,L=(d-C)/(A-C),O=1/T,w=L/O;return f==="end"?w=Math.floor(w):w=Math.ceil(w),O*w*(A-C)+C;}}return 0;};}function P(T){var f=/^cubic-bezier\((.*)\)/,d=T.match(f);if(d){var u=d[1].trim();return u=u.split(",").map(function(O){return parseFloat(O.trim());}),p.apply(void 0,(0,a["default"])(u));}if(f=/^steps\((.*)\)/,d=T.match(f),d){var g=d[1].trim();g=g.split(",").map(function(O){return O.trim();});var M=g,C=(0,n["default"])(M,2),A=C[0],L=C[1];return y(parseInt(A,10),L);}return T;}var S={linear:function linear(f){return f;},ease:p(0.25,0.1,0.25,1),"ease-in":p(0.42,0,1,1),"ease-out":p(0,0,0.58,1),"ease-in-out":p(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":y(1,"start"),"step-end":y(1,"end")};function v(T){return typeof T=="string"?S[T]?T=S[T]:T=P(T):T.type==="cubic-bezier"?T=p.apply(void 0,(0,a["default"])(T.value)):T.type==="steps"&&(T=y(T.step,T.pos)),T;}r.Easings=S,r.parseEasing=v;},/* 189 *//***/function(h,r){var t=4,e=1e-3,n=1e-7,i=10,a=11,o=1/(a-1),s=typeof Float32Array=="function";function c(T,f){return 1-3*f+3*T;}function m(T,f){return 3*f-6*T;}function l(T){return 3*T;}function p(T,f,d){return((c(f,d)*T+m(f,d))*T+l(f))*T;}function y(T,f,d){return 3*c(f,d)*T*T+2*m(f,d)*T+l(f);}function P(T,f,d,u,g){var M,C,A=0;do C=f+(d-f)/2,M=p(C,u,g)-T,M>0?d=C:f=C;while(Math.abs(M)>n&&++A<i);return C;}function S(T,f,d,u){for(var g=0;g<t;++g){var M=y(f,d,u);if(M===0)return f;var C=p(f,d,u)-T;f-=C/M;}return f;}function v(T){return T;}h.exports=function(f,d,u,g){if(!(0<=f&&f<=1&&0<=u&&u<=1))throw new Error("bezier x values must be in [0, 1] range");if(f===d&&u===g)return v;for(var M=s?new Float32Array(a):new Array(a),C=0;C<a;++C)M[C]=p(C*o,f,u);function A(L){for(var O=0,w=1,b=a-1;w!==b&&M[w]<=L;++w)O+=o;--w;var I=(L-M[w])/(M[w+1]-M[w]),R=O+I*o,W=y(R,f,u);return W>=e?S(L,R,f,u):W===0?R:P(L,O,O+o,f,u);}return function(O){return O===0?0:O===1?1:p(A(O),d,g);};};},/* 190 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=d(e),i=t(204),a=d(i),o=t(164),s=d(o),c=t(170),m=d(c),l=t(171),p=d(l),y=t(175),P=d(y),S=t(75),v=d(S),T=t(208),f=t(188);function d(W){return W&&W.__esModule?W:{"default":W};}var u=(0,P["default"])("timing"),g=(0,P["default"])("keyframes"),M=(0,P["default"])("initState"),C=(0,P["default"])("readyDefer"),A=(0,P["default"])("finishedDefer"),L=(0,P["default"])("effects"),O=(0,P["default"])("activeReadyTimer"),w=(0,P["default"])("activeFinishTimer"),b=(0,P["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},R=function(){function W(z,K,J){var q=this;if((0,m["default"])(this,W),Array.isArray(z)){var U=[z[0],z,K];z=U[0],K=U[1],J=U[2];}typeof J=="number"&&(J={duration:J}),this[u]=(0,s["default"])({},I,J),this[u].easing=(0,f.parseEasing)(this[u].easing),this[g]=(0,T.calculateFramesOffset)(K);var G=this[g][this[g].length-1];this[M]={},(0,a["default"])(G).forEach(function(Z){Object.prototype.hasOwnProperty.call(z,Z)&&Z!=="easing"&&Z!=="offset"&&(q[M][Z]=z[Z]);}),this[g]=this[g].map(function(Z){return(0,s["default"])({},q[M],Z);}),this[g][0].offset!==0&&this[g].unshift((0,s["default"])({},this[M],{offset:0})),G.offset<1&&this[g].push((0,s["default"])({},G,{offset:1})),this[L]={},this.timeline=null;}return(0,p["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:O,value:function value(){var K=this;this[C]&&!this[C].timerID&&(this.timeline.currentTime<0?this[C].timerID=this.timeline.setTimeout(function(){K[C].resolve(),delete K[C];},{delay:-this.timeline.currentTime,heading:!1}):this[C].timerID=this.timeline.setTimeout(function(){K[C].resolve(),delete K[C];},{delay:0,isEntropy:!0}));}},{key:w,value:function value(){var K=this,J=this[u],q=J.duration,U=J.iterations,G=J.endDelay,Z=Math.ceil(q*U+G-this.timeline.currentTime)+1;this[A]&&!this[A].timerID&&(this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),K[b](C),K[b](A);},{delay:Z,heading:!1}),this[A].reverseTimerID=this.timeline.setTimeout(function(){K[A].resolve(),K[b](C),K[b](A),K.timeline=null;},{delay:-this[u].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var K=this[u],J=K.delay,q=K.playbackRate,U=K.timeline;this.timeline=new v["default"]({originTime:J,playbackRate:q},U),this[O](),this[w]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[O]());}},{key:b,value:function value(K){var J=this[K],q=this.timeline;J&&q&&(q.clearTimeout(J.timerID),J.reverseTimerID&&q.clearTimeout(J.reverseTimerID)),delete this[K];}},{key:"cancel",value:function value(){this[b](C),this[b](A),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[b](C),this[b](A);}},{key:"applyEffects",value:function value(K){return(0,s["default"])(this[L],K);}},{key:"playbackRate",get:function get(){return this[u].playbackRate;},set:function set(K){this.timeline&&(this.timeline.playbackRate=K),this[u].playbackRate=K;}},{key:"playState",get:function get(){var K=this.timeline,J=this[u],q=J.iterations,U=J.duration,G=J.endDelay,Z="running";if(K==null)Z="idle";else if(K.paused)Z="paused";else if(K.currentTime<0)Z="pending";else{var rt=K.currentTime-q*U;rt>0&&rt<G?Z="pending":rt>=G&&(Z="finished");}return Z;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var K=this[u],J=K.duration,q=K.iterations,U=this.timeline,G=this.playState,Z=void 0;if(G==="idle")Z=0;else if(G==="paused"&&U.currentTime<0)Z=0;else if(G==="pending"){if(U.currentTime<0)Z=0;else{var rt=U.seekLocalTime(q*J);Z=(0,T.periodicity)(rt,J)[1]/J;}}else(G==="running"||G==="paused")&&(Z=(0,T.periodicity)(U.currentTime,J)[1]/J);return G==="finished"&&(Z=(0,T.periodicity)(q,1)[1]),Z;}},{key:"frame",get:function get(){var K=this.playState,J=this[M],q=this[u].fill;if(K==="idle")return J;var U=this.timeline.currentTime,G=this[g].slice(0),Z=(0,T.getProgress)(this.timeline,this[u],this.progress),rt=Z.p,et=Z.inverted,it=J;return U<0&&K==="pending"?(q==="backwards"||q==="both")&&(it=et?G[G.length-1]:G[0]):(K!=="pending"&&K!=="finished"||q==="forwards"||q==="both")&&(it=(0,T.getCurrentFrame)(this[u],G,this[L],rt)),it;}},{key:"timing",get:function get(){return this[u];}},{key:"effects",get:function get(){return this[L];}},{key:"baseTimeline",set:function set(K){this[u].timeline=K;},get:function get(){return this[u].timeline;}},{key:"ready",get:function get(){return this[C]?this[C].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[C]=(0,T.defer)(),this.timeline&&this[O](),this[C]?this[C].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[A]||(this[A]=(0,T.defer)(),this.timeline&&this[w]()),this[A].promise);}}]),W;}();r["default"]=R;},/* 191 *//***/function(h,r,t){h.exports={"default":t(192),__esModule:!0};},/* 192 *//***/function(h,r,t){t(143),t(125),t(79),t(193),t(202),t(203),h.exports=t(92).Promise;},/* 193 *//***/function(h,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),o=t(90),s=t(98),c=t(94),m=t(147),l=t(148),p=t(194),y=t(195).set,P=t(197)(),S=t(198),v=t(199),T=t(200),f=t(201),d="Promise",u=n.TypeError,g=n.process,M=g&&g.versions,C=M&&M.v8||"",_A=n[d],L=a(g)=="process",O=function O(){},w,b,I,R,W=b=S.f,z=!!function(){try{var et=_A.resolve(1),it=(et.constructor={})[t(122)("species")]=function(X){X(O,O);};return(L||typeof PromiseRejectionEvent=="function")&&et.then(O)instanceof it&&C.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),K=function K(et){var it;return s(et)&&typeof(it=et.then)=="function"?it:!1;},J=function J(et,it){if(!et._n){et._n=!0;var X=et._c;P(function(){for(var ct=et._v,ut=et._s==1,B=0,F=function F(Y){var k=ut?Y.ok:Y.fail,N=Y.resolve,$=Y.reject,x=Y.domain,E,D,j;try{k?(ut||(et._h==2&&G(et),et._h=1),k===!0?E=ct:(x&&x.enter(),E=k(ct),x&&(x.exit(),j=!0)),E===Y.promise?$(u("Promise-chain cycle")):(D=K(E))?D.call(E,N,$):N(E)):$(ct);}catch(H){x&&!j&&x.exit(),$(H);}};X.length>B;)F(X[B++]);et._c=[],et._n=!1,it&&!et._h&&q(et);});}},q=function q(et){y.call(n,function(){var it=et._v,X=U(et),ct,ut,B;if(X&&(ct=v(function(){L?g.emit("unhandledRejection",it,et):(ut=n.onunhandledrejection)?ut({promise:et,reason:it}):(B=n.console)&&B.error&&B.error("Unhandled promise rejection",it);}),et._h=L||U(et)?2:1),et._a=void 0,X&&ct.e)throw ct.v;});},U=function U(et){return et._h!==1&&(et._a||et._c).length===0;},G=function G(et){y.call(n,function(){var it;L?g.emit("rejectionHandled",et):(it=n.onrejectionhandled)&&it({promise:et,reason:et._v});});},Z=function Z(et){var it=this;it._d||(it._d=!0,it=it._w||it,it._v=et,it._s=2,it._a||(it._a=it._c.slice()),J(it,!0));},_rt3=function rt(et){var it=this,X;if(!it._d){it._d=!0,it=it._w||it;try{if(it===et)throw u("Promise can't be resolved itself");(X=K(et))?P(function(){var ct={_w:it,_d:!1};try{X.call(et,i(_rt3,ct,1),i(Z,ct,1));}catch(ut){Z.call(ct,ut);}}):(it._v=et,it._s=1,J(it,!1));}catch(ct){Z.call({_w:it,_d:!1},ct);}}};z||(_A=function A(it){m(this,_A,d,"_h"),c(it),w.call(this);try{it(i(_rt3,this,1),i(Z,this,1));}catch(X){Z.call(this,X);}},w=function w(it){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},w.prototype=t(146)(_A.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
|
302
|
+
then:function then(it,X){var ct=W(p(this,_A));return ct.ok=typeof it=="function"?it:!0,ct.fail=typeof X=="function"&&X,ct.domain=L?g.domain:void 0,this._c.push(ct),this._a&&this._a.push(ct),this._s&&J(this,!1),ct.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
303
|
+
"catch":function _catch(et){return this.then(void 0,et);}}),I=function I(){var et=new w();this.promise=et,this.resolve=i(_rt3,et,1),this.reject=i(Z,et,1);},S.f=W=function W(et){return et===_A||et===R?new I(et):b(et);}),o(o.G+o.W+o.F*!z,{Promise:_A}),t(121)(_A,d),t(149)(d),R=t(92)[d],o(o.S+o.F*!z,d,{// 25.4.4.5 Promise.reject(r)
|
|
304
|
+
reject:function reject(it){var X=W(this),ct=X.reject;return ct(it),X.promise;}}),o(o.S+o.F*(e||!z),d,{// 25.4.4.6 Promise.resolve(x)
|
|
305
|
+
resolve:function resolve(it){return f(e&&this===R?_A:this,it);}}),o(o.S+o.F*!(z&&t(140)(function(et){_A.all(et)["catch"](O);})),d,{// 25.4.4.1 Promise.all(iterable)
|
|
306
|
+
all:function all(it){var X=this,ct=W(X),ut=ct.resolve,B=ct.reject,F=v(function(){var Y=[],k=0,N=1;l(it,!1,function($){var x=k++,E=!1;Y.push(void 0),N++,X.resolve($).then(function(D){E||(E=!0,Y[x]=D,--N||ut(Y));},B);}),--N||ut(Y);});return F.e&&B(F.v),ct.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
307
|
+
race:function race(it){var X=this,ct=W(X),ut=ct.reject,B=v(function(){l(it,!1,function(F){X.resolve(F).then(ct.resolve,ut);});});return B.e&&ut(B.v),ct.promise;}});},/* 194 *//***/function(h,r,t){var e=t(97),n=t(94),i=t(122)("species");h.exports=function(a,o){var s=e(a).constructor,c;return s===void 0||(c=e(s)[i])==null?o:n(c);};},/* 195 *//***/function(h,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,c=o.setImmediate,m=o.clearImmediate,l=o.MessageChannel,p=o.Dispatch,y=0,P={},S="onreadystatechange",v,T,f,d=function d(){var g=+this;if(P.hasOwnProperty(g)){var M=P[g];delete P[g],M();}},u=function u(g){d.call(g.data);};(!c||!m)&&(c=function c(M){for(var C=[],A=1;arguments.length>A;)C.push(arguments[A++]);return P[++y]=function(){n(typeof M=="function"?M:Function(M),C);},v(y),y;},m=function m(M){delete P[M];},t(86)(s)=="process"?v=function v(g){s.nextTick(e(d,g,1));}:p&&p.now?v=function v(g){p.now(e(d,g,1));}:l?(T=new l(),f=T.port2,T.port1.onmessage=u,v=e(f.postMessage,f,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(v=function v(g){o.postMessage(g+"","*");},o.addEventListener("message",u,!1)):S in a("script")?v=function v(g){i.appendChild(a("script"))[S]=function(){i.removeChild(this),d.call(g);};}:v=function v(g){setTimeout(e(d,g,1),0);}),h.exports={set:c,clear:m};},/* 196 *//***/function(h,r){h.exports=function(t,e,n){var i=n===void 0;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3]);}return t.apply(n,e);};},/* 197 *//***/function(h,r,t){var e=t(91),n=t(195).set,i=e.MutationObserver||e.WebKitMutationObserver,a=e.process,o=e.Promise,s=t(86)(a)=="process";h.exports=function(){var c,m,l,p=function p(){var v,T;for(s&&(v=a.domain)&&v.exit();c;){T=c.fn,c=c.next;try{T();}catch(f){throw c?l():m=void 0,f;}}m=void 0,v&&v.enter();};if(s)l=function l(){a.nextTick(p);};else if(i&&!(e.navigator&&e.navigator.standalone)){var y=!0,P=document.createTextNode("");new i(p).observe(P,{characterData:!0}),l=function l(){P.data=y=!y;};}else if(o&&o.resolve){var S=o.resolve(void 0);l=function l(){S.then(p);};}else l=function l(){n.call(e,p);};return function(v){var T={fn:v,next:void 0};m&&(m.next=T),c||(c=T,l()),m=T;};};},/* 198 *//***/function(h,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,c){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=c;}),this.resolve=e(a),this.reject=e(o);}h.exports.f=function(i){return new n(i);};},/* 199 *//***/function(h,r){h.exports=function(t){try{return{e:!1,v:t()};}catch(e){return{e:!0,v:e};}};},/* 200 *//***/function(h,r,t){var e=t(91),n=e.navigator;h.exports=n&&n.userAgent||"";},/* 201 *//***/function(h,r,t){var e=t(97),n=t(98),i=t(198);h.exports=function(a,o){if(e(a),n(o)&&o.constructor===a)return o;var s=i.f(a),c=s.resolve;return c(o),s.promise;};},/* 202 *//***/function(h,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),o=t(201);e(e.P+e.R,"Promise",{"finally":function _finally(s){var c=a(this,n.Promise||i.Promise),m=typeof s=="function";return this.then(m?function(l){return o(c,s()).then(function(){return l;});}:s,m?function(l){return o(c,s()).then(function(){throw l;});}:s);}});},/* 203 *//***/function(h,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{"try":function _try(a){var o=n.f(this),s=i(a);return(s.e?o.reject:o.resolve)(s.v),o.promise;}});},/* 204 *//***/function(h,r,t){h.exports={"default":t(205),__esModule:!0};},/* 205 *//***/function(h,r,t){t(206),h.exports=t(92).Object.keys;},/* 206 *//***/function(h,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a));};});},/* 207 *//***/function(h,r,t){var e=t(90),n=t(92),i=t(101);h.exports=function(a,o){var s=(n.Object||{})[a]||Object[a],c={};c[a]=o(s),e(e.S+e.F*i(function(){s(1);}),"Object",c);};},/* 208 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=P(e),i=t(209),a=P(i),o=t(164),s=P(o),c=t(191),m=P(c);r.defer=S,r.periodicity=v,r.calculateFramesOffset=T,r.getProgress=f,r.getCurrentFrame=u;var l=t(188),p=t(187),y=P(p);function P(g){return g&&g.__esModule?g:{"default":g};}function S(){var g={};return g.promise=new m["default"](function(M,C){g.resolve=M,g.reject=C;}),g;}function v(g,M){var C=Math.floor(g/M),A=g-C*M;return A===0&&C>0&&(A=M,C--),[C,A];}function T(g){g=g.slice(0);var M=g[0],C=g[g.length-1];C.offset=C.offset||1,M.offset=M.offset||0;for(var A=0,L=-1,O=0;O<g.length;O++){var w=g[O];if(w.offset!=null){var b=O-L;if(b>1)for(var I=(w.offset-A)/b,R=0;R<b-1;R++)g[L+R+1].offset=A+I*(R+1);A=w.offset,L=O;}if(w.easing!=null&&(w.easing=(0,l.parseEasing)(w.easing)),O>0){var W=g[O].easing!=null;g[O]=(0,s["default"])({},g[O-1],g[O]),W||delete g[O].easing;}}return g;}function f(g,M,C){var A=g.currentTime,L=M.direction,O=M.duration,w=!1;if(L==="reverse")C=1-C,w=!0;else if(L==="alternate"||L==="alternate-reverse"){var b=Math.floor(A/O);C===1&&b--,b%2^L==="alternate-reverse"&&(C=1-C,w=!0);}return{p:C,inverted:w};}function d(g,M,C,A){var L={};return(0,a["default"])(M).forEach(function(O){var w=(0,n["default"])(O,2),b=w[0],I=w[1];if(b!=="offset"&&b!=="easing"){var R=C[b]||C["default"],W=R(g[b],I,A,g.offset,M.offset);W!=null&&(L[b]=W);}}),L;}function u(g,M,C,A){var L=g.easing,O=g.effect;O||(C=(0,s["default"])({},y["default"],C));var w={};A=L(A,M);for(var b=1;b<M.length;b++){var I=M[b],R=I.offset;if(R>=A||b===M.length-1){var W=M[b-1],z=W.offset,K=W.easing,J=A;if(K){var q=R-z;J=K((A-z)/q)*q+z;}O?w=O(W,I,J,z,R):w=d(W,I,C,J);break;}}return w;}},/* 209 *//***/function(h,r,t){h.exports={"default":t(210),__esModule:!0};},/* 210 *//***/function(h,r,t){t(211),h.exports=t(92).Object.entries;},/* 211 *//***/function(h,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function entries(a){return n(a);}});},/* 212 *//***/function(h,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;h.exports=function(o){return function(s){for(var c=i(s),m=n(c),l=m.length,p=0,y=[],P;l>p;)P=m[p++],(!e||a.call(c,P))&&y.push(o?[P,c[P]]:c[P]);return y;};};},/* 213 *//***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);var e=/* @__PURE__ */new Map();function n(a){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];a=a.toLowerCase();var c=e.get(a);if(!c)throw new TypeError("Invalid node: ".concat(a));var m=new c(o);return s.forEach(function(l){m.appendChild(l);}),m;}var i={registerNode:function registerNode(a,o){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),e.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));e.set(o,a),Object.defineProperties(a.prototype,{nodeType:{value:s},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(a,o){return n(o);},isSpriteNode:function isSpriteNode(a){return e.has(a.toLowerCase());}};r["default"]=i;},/* 214 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");var o=/*#__PURE__*/function(){function o(c){var _ref116=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref116$bubbles=_ref116.bubbles,m=_ref116$bubbles===void 0?null:_ref116$bubbles;_classCallCheck(this,o);if(typeof c=="string"?(this[e]=c,this[n]=!!m):(this[e]=c.type,this[i]=c,this[n]=m!=null?!!m:!!c.bubbles,c.detail&&(this[a]=c.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(c){this[i]=c;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[e];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[a];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 *//***/function(h,r,t){t.r(r),t.d(r,"parseFilterString",function(){return n;}),t.d(r,"applyFilters",function(){return i;});var e=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a=a.trim(),!a||a==="none")return null;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,s=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),c=[];return s&&s.forEach(function(m){var l=m.match(o);if(!l)throw new TypeError("Invalid fitler string.");var _l3=_slicedToArray(l,3),p=_l3[1],y=_l3[2];p=p.toLowerCase(),y=y.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(P,S){var v;return p==="url"||p==="drop-shadow"&&S===3?v=P:v=Object(e.toNumber)(P),/%$/.test(P)&&(v/=100),v;}),c.push({type:p,args:y});}),c;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref117){var s=_ref117.type,c=_ref117.args;var m=s;m==="drop-shadow"?m="dropShadow":m==="hue-rotate"&&(m="hueRotate"),a[m].apply(a,_toConsumableArray(c));});}},/* 216 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i){if(!i)return;var a=n.getListeners("beforerender"),o=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=function(s){n.dispatchEvent({type:"beforerender",detail:{context:s}});}:a.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(s){n.dispatchEvent({type:"afterrender",detail:{context:s}});}:o.length||(i.afterRender=null);}},/* 217 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(218),i=t(70),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("amount"),s=Symbol("meshCloud");var c=/*#__PURE__*/function(_i$default){function c(l){var _this28;var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,c);_this28=_callSuper(this,c),_this28.meshNode=l,l.connect(_assertThisInitialized(_this28)),_this28[o]=p,_this28[s]=null;return _this28;}_inherits(c,_i$default);return _createClass(c,[{key:"meshCloud",get:function get(){var l=this.meshNode,p=this[o];return!this[s]&&l.mesh&&(this[s]=new e.MeshCloud(l.mesh,p)),this[s];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(l){this[o]=l,this[s]&&(this[s].amount=l);}},{key:"brightness",value:function brightness(l,p){this.meshCloud&&(this.meshCloud.brightness(l,p),this.forceUpdate());}},{key:"contrast",value:function contrast(l,p){this.meshCloud&&(this.meshCloud.contrast(l,p),this.forceUpdate());}},{key:"delete",value:function _delete(l){this.meshCloud&&(this.meshCloud["delete"](l),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this29=this;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(c,"draw",this,3)([l]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var p=this.shaderAttrs;p&&Object.entries(p).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),P=_ref119[0],S=_ref119[1];_this29.meshCloud.mesh.setAttribute(P,S);});var y=this.uniforms;if(this.uniforms){var P={};Object.entries(y).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),S=_ref121[0],v=_ref121[1];typeof v=="function"&&(v=v(_this29,S)),P[S]=v;}),this.meshCloud.mesh.setUniforms(P);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),l.push(this.meshCloud);}return l;}},{key:"getTransform",value:function getTransform(l){if(this.meshCloud)return this.meshCloud.getTransform(l);}},{key:"grayscale",value:function grayscale(l,p){this.meshCloud&&(this.meshCloud.grayscale(l,p),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(l,p){this.meshCloud&&(this.meshCloud.hueRotate(l,p),this.forceUpdate());}},{key:"invert",value:function invert(l,p){this.meshCloud&&(this.meshCloud.invert(l,p),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(l,p){if(!this.meshCloud)return!1;var y=this.attributes.pointerEvents;if(y==="none"||y!=="all"&&!this.isVisible)return!1;var P="both";y==="visibleFill"&&(P="fill"),y==="visibleStroke"&&(P="stroke");for(var S=0;S<this[o];S++)if(!this.meshCloud.isPointCollision(S,[l,p],P))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(l,p){this.meshCloud&&(this.meshCloud.opacity(l,p),this.forceUpdate());}},{key:"rotate",value:function rotate(l,p){var _ref122=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),y=_ref123[0],P=_ref123[1];var S=Math.PI*p/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,v=_this$meshNode$attrib.x,_T12=_this$meshNode$attrib.y;this.meshCloud.rotate(l,S,[y+v,P+_T12]),this.forceUpdate();}}},{key:"saturate",value:function saturate(l,p){this.meshCloud&&(this.meshCloud.saturate(l,p),this.forceUpdate());}},{key:"scale",value:function scale(l,_ref124){var _ref125=_slicedToArray(_ref124,2),p=_ref125[0],_ref125$=_ref125[1],y=_ref125$===void 0?p:_ref125$;var _ref126=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref127=_slicedToArray(_ref126,2),P=_ref127[0],S=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,v=_this$meshNode$attrib2.x,_T13=_this$meshNode$attrib2.y,_f12=1e-5;Math.abs(p)<_f12&&(p=1/p>0?_f12:-_f12),Math.abs(y)<_f12&&(y=1/y>0?_f12:-_f12),this.meshCloud.scale(l,[p,y],[P+v,S+_T13]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(l,p){this.meshCloud&&(this.meshCloud.setColorTransform(l,p),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(l,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setFillColor(l,p),this.forceUpdate());}},{key:"sepia",value:function sepia(l,p){this.meshCloud&&(this.meshCloud.sepia(l,p),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref128){var l=_ref128.width,p=_ref128.height;_superPropGet(c,"setResolution",this,3)([{width:l,height:p}]),this.meshNode.setResolution({width:l,height:p});}},{key:"setStrokeColor",value:function setStrokeColor(l,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setStrokeColor(l,p),this.forceUpdate());}},{key:"setTransform",value:function setTransform(l,p){this.meshCloud&&(this.meshCloud.setTransform(l,p),this.forceUpdate());}},{key:"skew",value:function skew(l,_ref129){var _ref130=_slicedToArray(_ref129,2),p=_ref130[0],_ref130$=_ref130[1],y=_ref130$===void 0?p:_ref130$;var _ref131=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref132=_slicedToArray(_ref131,2),P=_ref132[0],S=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,v=_this$meshNode$attrib3.x,_T14=_this$meshNode$attrib3.y;this.meshCloud.skew(l,[p,y],[P+v,S+_T14]),this.forceUpdate();}}},{key:"transform",value:function transform(l,p){this.meshCloud&&(this.meshCloud.transform(l,p),this.forceUpdate());}},{key:"transformColor",value:function transformColor(l,p){this.meshCloud&&(this.meshCloud.transformColor(l,p),this.forceUpdate());}},{key:"translate",value:function translate(l,_ref133){var _ref134=_slicedToArray(_ref133,2),p=_ref134[0],y=_ref134[1];this.meshCloud&&(this.meshCloud.translate(l,[p,y]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(c,"cloud");},/* 218 *//***/function(h,r,t){t.r(r),t.d(r,"loadTexture",function(){return a;}),t.d(r,"applyTexture",function(){return o;}),t.d(r,"createTexture",function(){return c;}),t.d(r,"deleteTexture",function(){return m;}),t.d(r,"drawTexture",function(){return p;}),t.d(r,"loadFrames",function(){return y;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(P,S){if(i[P])return i[P];var v=e.ENV.loadImage(P,{alias:S,useImageBitmap:!1});return v!==null&&v!==void 0?v:P;}function o(_x18,_x19,_x20){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(P,S,v){var T,_P$attributes,_f13,d,u,g;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:T=S;typeof S=="string"&&(T=a(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===P.attributes.texture)){_context18.next=11;break;}T&&T.image&&(T.sourceRect&&(P.attributes.sourceRect=T.sourceRect),P.textureImageRotated=!!T.rotated,T=T.image);_P$attributes=P.attributes,_f13=_P$attributes.width,d=_P$attributes.height,u=_P$attributes.textureRect,g=P.textureImage;P.textureImage=T,v&&g!==T&&!u&&(_f13==null||d==null)&&P.updateContours(),P.forceUpdate();case 11:return _context18.abrupt("return",T);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function c(P,S){if(S[s]=S[s]||/* @__PURE__ */new Map(),S[s].has(P))return S[s].get(P);var v=S.createTexture(P);return!/^blob:/.test(P.src)&&typeof P.getContext!="function"&&S[s].set(P,v),v;}function m(P,S){if(S[s]&&S[s].has(P)){var v=S[s].get(P);return S.deleteTexture(v),S[s]["delete"](P),!0;}return!1;}var l=Symbol("textureContext");function p(P,S){var v=P.textureImage instanceof String?String(P.textureImage):P.textureImage,T=P.textureImageRotated,f=S.texture,d=P.renderer;if(v){var u=P.originalContentRect;var g=P.attributes.textureRect;var M=P.attributes.textureRepeat,C=P.attributes.sourceRect;if(!f||P[l]&&P[l]!==d||f.image!==v||f.options.repeat!==M||!Object(n.compareValue)(f.options.rect,g)||!Object(n.compareValue)(f.options.srcRect,C)){var A=c(v,d);g?(g[0]+=u[0],g[1]+=u[1]):g=u;var L=null;f&&!d[s].has(f.image)&&(!f.options||!f.options.hidden)&&(L=S.uniforms.u_texSampler),S.setTexture(A,{rect:g,repeat:M,srcRect:C,rotated:T}),L&&L["delete"]&&L["delete"](),P[l]=d;}}else if(f){var _u8=null;!d[s].has(f.image)&&(!f.options||!f.options.hidden)&&(_u8=S.uniforms.u_texSampler),S.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function y(_x21,_x22){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(P,S){var v,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 a(P);case 9:v=_context19.sent;T=S.frames;return _context19.abrupt("return",(Object.entries(T).forEach(function(_ref135){var _ref136=_slicedToArray(_ref135,2),f=_ref136[0],d=_ref136[1];var _d$frame=d.frame,u=_d$frame.x,g=_d$frame.y,M=_d$frame.w,C=_d$frame.h;var A=[u,g,M,C];var L=d.rotated;L&&(A=[A[0],A[1],A[3],A[2]]),i[f]={image:v,sourceRect:A,rotated:L};}),v));case 12:case"end":return _context19.stop();}},_callee19);}));return _y5.apply(this,arguments);}},/* 219 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(1),n=t(12),i=t(70),a=t(220),o=t(221),s=t(222),c=t(213),m=t(223);t(1).glMatrix.setMatrixArrayType(Array);function l(P,S,v){return S in P?Object.defineProperty(P,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[S]=v,P;}var p=Symbol("mesh");var y=/*#__PURE__*/function(_i$default2){function y(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);return _callSuper(this,y,[S]);}_inherits(y,_i$default2);return _createClass(y,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,S=_this$attributes2.paddingTop,v=_this$attributes2.paddingRight,T=_this$attributes2.paddingBottom,f=_this$attributes2.paddingLeft,d=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],g=_this$contentSize[1];return[f+u+v+d,S+g+T+d];}// content + padding
|
|
308
|
+
},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,S=_this$attributes3.paddingTop,v=_this$attributes3.paddingRight,T=_this$attributes3.paddingBottom,f=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),d=_this$contentSize2[0],u=_this$contentSize2[1];return[f+d+v,S+u+T];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,S=_this$attributes4.width,v=_this$attributes4.height,T=_this$attributes4.boxSizing,f=_this$attributes4.paddingTop,d=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,g=_this$attributes4.paddingLeft;if(S=S||0,v=v||0,T==="border-box"){var M=2*this.attributes.borderWidth;S-=M+d+g,v-=M+f+u,S=Math.max(0,S),v=Math.max(0,v);}return[S,v];}},{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],v=_this$borderSize[1];return S>0&&v>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var S=this.clientBox;if(S){var _v5;var v=this[p];if(v)v.box!==S&&(v.contours=S.contours,v.box=S);else{v=new n.Mesh2D(S),v.box=S;var _f14=this.attributes.bgcolor;if(Object(o.setFillColor)(v,{color:_f14}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,M=_this$attributes5.borderDash,C=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(v,{color:u,lineWidth:g,lineDash:M,lineDashOffset:C});}this[p]=v;var d=this.attributes.clipPath;d&&this[p].setClipPath(d);}var _T15=this.opacity;return v.getOpacity()!==_T15&&v.setOpacity(_T15),(_v5=v).setTransform.apply(_v5,_toConsumableArray(this.renderMatrix)),v;}return null;}// content + padding + border
|
|
309
|
+
},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,S=_this$attributes6.paddingTop,v=_this$attributes6.paddingRight,T=_this$attributes6.paddingBottom,f=_this$attributes6.paddingLeft,d=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),u=_this$contentSize3[0],g=_this$contentSize3[1],M=2*d;return[f+u+v+M,S+g+T+M];}},{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],v=_this$originalClientR[1],T=_this$originalClientR[2],f=_this$originalClientR[3],d=this.attributes.padding;return[S+d[0],v+d[1],T-d[0]-d[2],f-d[1]-d[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var S=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(S=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,S));var v=null;if(this.mesh){v=_toConsumableArray(this.mesh.boundingBox);var _T16=this.attributes.borderWidth;_T16&&(v[0]=[v[0][0]-_T16,v[0][1]-_T16],v[1]=[v[1][0]+_T16,v[1][1]+_T16]);}return Object(m["default"])(v,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,v,T){if(_superPropGet(y,"onPropertyChange",this,3)([S,v,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[p]&&S==="clipPath"&&this[p].setClipPath(v),this[p]&&S==="bgcolor"&&Object(o.setFillColor)(this[p],{color:v}),this[p]&&(S==="borderColor"||S==="borderWidth"||S==="borderDash"||S==="borderDashOffset")){var _this$attributes7=this.attributes,_f15=_this$attributes7.borderColor,d=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[p],{color:_f15,lineWidth:d,lineDash:d?u:0,lineDashOffset:g});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,S=_this$attributes8.anchorX,v=_this$attributes8.anchorY,T=_this$attributes8.borderWidth,f=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),d=_this$borderSize2[0],u=_this$borderSize2[1],g=this.offsetSize,M=0.5*T,C=-S*g[0]+M,A=-v*g[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[C,A,d,u],f);}}]);}(i["default"]);l(y,"Attr",a["default"]),c["default"].registerNode(y,"block");},/* 220 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return m;});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_declareAlias");var m=/*#__PURE__*/function(_e$default){function m(p){var _this30;_classCallCheck(this,m);_this30=_callSuper(this,m,[p]),_this30[s]({anchorX:0,anchorY:0,/* anchor */width:void 0,height:void 0,/* size */borderWidth:0,borderColor:"rgba(0,0,0,1)",/* border */borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],/* borderRadius */bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,/* padding */boxSizing:"content-box",clipPath:void 0}),_this30[c]("anchor","size","border","borderRadius","padding");return _this30;}_inherits(m,_e$default);return _createClass(m,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(p){this[a]("anchorX",Object(n.toNumber)(p));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(p){this[a]("anchorY",Object(n.toNumber)(p));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.anchorX=p[0],this.anchorY=p[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(p){this[a]("width",Object(n.toNumber)(p));}},{key:"height",get:function get(){return this[o]("height");},set:function set(p){this[a]("height",Object(n.toNumber)(p));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(p){this[a]("borderWidth",Object(n.toNumber)(p));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(p){this[a]("borderColor",Object(i.parseColor)(p));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p]),this.borderWidth=p[0],p[1]!=null&&(this.borderColor=p[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(p){p=Object(n.toArray)(p,!0),p!=null&&!Array.isArray(p)&&(p=[p]),this[a]("borderDash",p?p.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(p){this[a]("borderDashOffset",Object(n.toNumber)(p));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopLeftRadius",p.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopRightRadius",p.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomRightRadius",p.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomLeftRadius",p.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(p){if(p=Object(n.toArray)(p),!Array.isArray(p))p=Array(8).fill(p);else if(p.length===2)p=[p[0],p[1],p[0],p[1],p[0],p[1],p[0],p[1]];else if(p.length===4)p=[p[0],p[1],p[2],p[3],p[0],p[1],p[2],p[3]];else if(p.length===6)p=[p[0],p[1],p[2],p[3],p[4],p[5],p[2],p[3]];else if(p.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[p[0],p[1]],this.borderTopRightRadius=[p[2],p[3]],this.borderBottomRightRadius=[p[4],p[5]],this.borderBottomLeftRadius=[p[6],p[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(p){this[a]("bgcolor",Object(i.parseColor)(p));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(p){this[a]("paddingTop",Object(n.toNumber)(p));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(p){this[a]("paddingRight",Object(n.toNumber)(p));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(p){this[a]("paddingBottom",Object(n.toNumber)(p));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(p){this[a]("paddingLeft",Object(n.toNumber)(p));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)?p.length===2?p=[p[0],p[1],p[0],p[1]]:p.length===3&&(p=[p[0],p[1],p[2],p[1]]):p=[p,p,p,p],this.paddingTop=p[0],this.paddingRight=p[1],this.paddingBottom=p[2],this.paddingLeft=p[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(p){this[a]("clipPath",p);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(p){if(p!=null&&p!=="border-box"&&p!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",p);}}]);}(e["default"]);},/* 221 *//***/function(h,r,t){t.r(r),t.d(r,"Gradient",function(){return i;}),t.d(r,"isTransparent",function(){return a;}),t.d(r,"parseColor",function(){return o;}),t.d(r,"setFillColor",function(){return c;}),t.d(r,"setStrokeColor",function(){return m;}),t.d(r,"Color",function(){return l;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref137){var y=_ref137.vector,P=_ref137.colors;_classCallCheck(this,i);if(!Array.isArray(y)||y.length!==4&&y.length!==6&&y.length!==3)throw new TypeError("Invalid gradient");this.vector=y,this.colors=P.map(function(_ref138){var S=_ref138.offset,v=_ref138.color;return{offset:S,color:o(v)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(p){return p instanceof i?!1:p==null?!0:n()(p)[3]===0;}function o(p){if(p==null||(p||(p="transparent"),p instanceof i))return p;var y=n()(p);if(!y||!y.length)throw new TypeError("Invalid color value.");return"rgba(".concat(y.join(),")");}function s(p,y,P){var S=p.boundingBox[0];if(P.vector){var v=P.vector,_T17=P.colors;v.length===4?(v=[v[0]+S[0],v[1]+S[1],v[2]+S[0],v[3]+S[1]],p.setLinearGradient({vector:v,colors:_T17,type:y})):v.length===3?(v=[v[0]+S[0],v[1]+S[1],v[2]],p.setCircularGradient({vector:v,colors:_T17,type:y})):(v=[v[0]+S[0],v[1]+S[1],v[2],v[3]+S[0],v[4]+S[1],v[5]],p.setRadialGradient({vector:v,colors:_T17,type:y}));}else p.gradient&&p.gradient[y]&&(delete p.gradient[y],delete p.uniforms.u_radialGradientVector);}function c(p,_ref139){var y=_ref139.color,_ref139$rule=_ref139.rule,P=_ref139$rule===void 0?"nonzero":_ref139$rule;return s(p,"fill",y),y.vector||p.setFill({color:y,rule:P}),p;}function m(p,_ref140){var y=_ref140.color,P=_ref140.lineWidth,S=_ref140.lineCap,v=_ref140.lineJoin,T=_ref140.lineDash,f=_ref140.lineDashOffset,d=_ref140.miterLimit,u=_ref140.roundSegments;s(p,"stroke",y),y.vector&&(y=[0,0,0,1]),p.setStroke({color:y,thickness:P,cap:S,join:v,miterLimit:d,lineDash:T,lineDashOffset:f,roundSegments:u});}var l=/*#__PURE__*/function(_Array){function l(){var _y6,_y7,_n2,_n3;var _this31;var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var v=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,l);return _possibleConstructorReturn(_this31,(Array.isArray(y)&&(_y6=y,_y7=_slicedToArray(_y6,4),y=_y7[0],P=_y7[1],S=_y7[2],v=_y7[3],_y6),typeof y=="string"&&(_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],P=_n3[1],S=_n3[2],v=_n3[3],y/=255,P/=255,S/=255),_this31=_callSuper(this,l,[y,P,S,v]),_assertThisInitialized(_this31)));}_inherits(l,_Array);return _createClass(l,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(y){this[0]=y/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(y){this[1]=y/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(y){this[2]=y/255;}},{key:"a",get:function get(){return this[3];},set:function set(y){this[3]=y;}},{key:"hex",get:function get(){var y="0".concat(this.r.toString(16)).slice(-2),P="0".concat(this.g.toString(16)).slice(-2),S="0".concat(this.b.toString(16)).slice(-2);var v;return this.a<1&&(v=Math.round(this[3]*255),v="0".concat(v.toString(16)).slice(-2)),"#".concat(y).concat(P).concat(S).concat(v||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(y){return typeof y=="string"&&(y=n()(y),y[0]/=255,y[1]/=255,y[2]/=255),this[0]=y[0],this[1]=y[1],this[2]=y[2],this[3]=y[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 *//***/function(h,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,c){var m=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var l=0.5522848,p=s/2*l,y=c/2*l,P=a+s,S=o+c,v=a+s/2,T=o+c/2;m==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-y,v-p,o,v,o)):m==="rightTop"?i.bezierCurveTo(v+p,o,P,T-y,P,T):m==="rightBottom"?i.bezierCurveTo(P,T+y,v+p,S,v,S):m==="leftBottom"&&i.bezierCurveTo(v-p,S,a,T+y,a,T);}function n(i,_ref141,m){var _ref142=_slicedToArray(_ref141,4),a=_ref142[0],o=_ref142[1],s=_ref142[2],c=_ref142[3];if(!m||Array.isArray(m)&&m.every(function(l){return l===0;}))i.beginPath(),i.rect(a,o,s,c);else{typeof m=="number"&&(m=Array(8).fill(m));var _m$map=m.map(function(d,u){return u%2?Math.min(d,c/2):Math.min(d,s/2);}),_m$map2=_slicedToArray(_m$map,8),l=_m$map2[0],p=_m$map2[1],y=_m$map2[2],P=_m$map2[3],S=_m$map2[4],v=_m$map2[5],_T18=_m$map2[6],_f16=_m$map2[7];i.beginPath(),i.moveTo(a,o+p),e(i,a,o,l*2,p*2,"leftTop"),i.lineTo(a+s-y,o),e(i,a+s-y*2,o,y*2,P*2,"rightTop"),i.lineTo(a+s,o+c-v),e(i,a+s-S*2,o+c-v*2,S*2,v*2,"rightBottom"),i.lineTo(a+_T18,o+c),e(i,a,o+c-_f16*2,_T18*2,_f16*2,"leftBottom"),i.closePath();}return i;}},/* 223 *//***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array),r["default"]=function(e,n){if(!e)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _e2=_slicedToArray(e,2),_e2$=_slicedToArray(_e2[0],2),i=_e2$[0],a=_e2$[1],_e2$2=_slicedToArray(_e2[1],2),o=_e2$2[0],s=_e2$2[1],c=i*n[0]+a*n[2]+n[4],m=i*n[1]+a*n[3]+n[5],l=o*n[0]+a*n[2]+n[4],p=o*n[1]+a*n[3]+n[5],y=o*n[0]+s*n[2]+n[4],P=o*n[1]+s*n[3]+n[5],S=i*n[0]+s*n[2]+n[4],v=i*n[1]+s*n[3]+n[5],T=Math.min(c,l,y,S),f=Math.min(m,p,P,v),d=Math.max(c,l,y,S),u=Math.max(m,p,P,v);return{x:T,y:f,width:d-T,height:u-f,left:T,top:f,right:d,bottom:u};};},/* 224 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(m,l,p){return l in m?Object.defineProperty(m,l,{value:p,enumerable:!0,configurable:!0,writable:!0}):m[l]=p,m;}var s=Symbol("textureTask");var c=/*#__PURE__*/function(_n$default){function c(){var _this32;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,c);typeof l=="string"&&(l={texture:l}),_this32=_callSuper(this,c,[l]);return _this32;}/* override */_inherits(c,_n$default);return _createClass(c,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(c,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),l=_superPropGet3[0],p=_superPropGet3[1];var _this$attributes9=this.attributes,y=_this$attributes9.width,P=_this$attributes9.height;if(y==null||P==null){var S=this.textureImage,v=this.attributes.textureRect,_T19=this.attributes.sourceRect;if(v)y==null&&(l=v[0]+v[2]),P==null&&(p=v[1]+v[3]);else if(_T19){var _f17=this.layer?this.layer.displayRatio:1;y==null&&(l=_T19[2]/_f17),P==null&&(p=_T19[3]/_f17);}else if(S){var _f18=this.layer?this.layer.displayRatio:1;y==null&&(l=S.width/_f18),P==null&&(p=S.height/_f18);}}return[l,p];}},{key:"textureImageReady",get:function get(){return this[s]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(c,"draw",this,3)([l]);var p=this.mesh;return p&&Object(e.drawTexture)(this,p),l;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(l,p,y){if(_superPropGet(c,"onPropertyChange",this,3)([l,p,y]),l==="texture"&&(this[s]=Object(e.applyTexture)(this,p,!0)),l==="textureRect"){var _this$attributes10=this.attributes,P=_this$attributes10.width,S=_this$attributes10.height;(P==null||S==null)&&this.updateContours();}}}]);}(n["default"]);o(c,"Attr",i["default"]),a["default"].registerNode(c,"sprite");},/* 225 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_e$default2){function o(c){var _this33;_classCallCheck(this,o);_this33=_callSuper(this,o,[c]),_this33[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this33;}_inherits(o,_e$default2);return _createClass(o,[{key:"texture",get:function get(){return this[a]("texture");},set:function set(c){this[i]("texture",c);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(c){this[i]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(c){this[i]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(c){this[i]("textureRepeat",!!c);}}]);}(e["default"]);},/* 226 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return P;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),o=t(228),s=t(221),c=t(218),m=t(213),l=t(223);t(1).glMatrix.setMatrixArrayType(Array);function p(S,v,T){return v in S?Object.defineProperty(S,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[v]=T,S;}var y=Symbol("mesh");var P=/*#__PURE__*/function(_a$default){function P(){var _this34;var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof v=="string"&&(v={d:v}),_this34=_callSuper(this,P,[v]),_this34.effects={d:function d(T,f,_d4,u,g){var _i$a;var M=(_d4-u)/(g-u);if(M<=0)return T;if(M>=1)return f;var C=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(f)),A=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(C).concat([M]))[0];return A.reduce(function(O,w){return"".concat(O).concat(w.slice(2).join(" ")," ");},"M".concat(A[0][0]," ").concat(A[0][1],"C")).trim();}};return _this34;}/* override */_inherits(P,_a$default);return _createClass(P,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var v=this.path;if(v){var _T21;var _T20=this[y];if(_T20)_T20.path!==v&&(_T20.contours=v.contours,_T20.path=v);else{_T20=new e.Mesh2D(this.path),_T20.path=v;var d=this.attributes.fillColor,u=this.attributes.fillRule;d&&Object(s.setFillColor)(_T20,{color:d,rule:u});var g=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&g>0){var _this$attributes11=this.attributes,A=_this$attributes11.lineCap,L=_this$attributes11.lineJoin,O=_this$attributes11.miterLimit,w=_this$attributes11.lineDash,b=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_T20,{color:M,lineWidth:g,lineCap:A,lineJoin:L,miterLimit:O,lineDash:w,lineDashOffset:b,roundSegments:I});}this[y]=_T20;var C=this.attributes.clipPath;C&&this[y].setClipPath(C);}var _f19=this.opacity;return _T20.getOpacity()!==_f19&&_T20.setOpacity(_f19),(_T21=_T20).setTransform.apply(_T21,_toConsumableArray(this.renderMatrix)),_T20;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var v=this.path.boundingBox;return[v[0][0],v[0][1],v[1][0]-v[0][0],v[1][1]-v[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var v=this.mesh.boundingBox;return[v[0][0],v[0][1],v[1][0]-v[0][0],v[1][1]-v[0][1]];}return[0,0,0,0];}},{key:"originalClientCenter",get:function get(){return this.mesh?this.mesh.boundingCenter:[0,0];}},{key:"d",get:function get(){return this.attributes.d;}/* override */,set:function set(v){this.attributes.d=v;}},{key:"draw",value:function draw(){var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(P,"draw",this,3)([v]);var T=this.mesh;return T&&Object(c.drawTexture)(this,T),v;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var v=null;return this.mesh&&(v=this.mesh.boundingBox),Object(l["default"])(v,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(v){if(this.mesh){var _T22=this.mesh.getPointAtLength(v);if(_T22)return[_T22.x,_T22.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,T,f){if(_superPropGet(P,"onPropertyChange",this,3)([v,T,f]),(v==="d"||v==="normalize")&&this.updateContours(),this[y]&&(v==="fillColor"||v==="fillRule")){var _this$attributes12=this.attributes,d=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(s.setFillColor)(this[y],{color:d,rule:u});}if(this[y]&&(v==="strokeColor"||v==="lineWidth"||v==="lineCap"||v==="lineJoin"||v==="lineDash"||v==="lineDashOffset"||v==="roundSegments")){var _this$attributes13=this.attributes,_d5=_this$attributes13.strokeColor,_u9=_this$attributes13.lineWidth;if(_d5&&_u9>0){var _this$attributes14=this.attributes,g=_this$attributes14.lineCap,M=_this$attributes14.lineJoin,C=_this$attributes14.lineDash,A=_this$attributes14.lineDashOffset,L=_this$attributes14.miterLimit,O=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[y],{color:_d5,lineCap:g,lineJoin:M,lineWidth:_u9,lineDash:C,lineDashOffset:A,miterLimit:L,roundSegments:O});}}this[y]&&v==="clipPath"&&this[y].setClipPath(T),v==="texture"&&Object(c.applyTexture)(this,T);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);p(P,"Attr",o["default"]),m["default"].registerNode(P,"path");},/* 227 *//***/function(h,r,t){(function(e,n){h.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function w(b,I){var R=[],W=!0,z=!1,K=void 0;try{for(var J=b[Symbol.iterator](),q;!(W=(q=J.next()).done)&&(R.push(q.value),!(I&&R.length===I));W=!0);}catch(U){z=!0,K=U;}finally{try{!W&&J["return"]&&J["return"]();}finally{if(z)throw K;}}return R;}return function(b,I){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return w(b,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(b,I,R,W,z,K,J){var q=b.x,U=b.y;q*=I,U*=R;var G=W*q-z*U,Z=z*q+W*U;return{x:G+K,y:Z+J};},a=function a(b,I){var R=1.3333333333333333*Math.tan(I/4),W=Math.cos(b),z=Math.sin(b),K=Math.cos(b+I),J=Math.sin(b+I);return[{x:W-z*R,y:z+W*R},{x:K+J*R,y:J-K*R},{x:K,y:J}];},o=function o(b,I,R,W){var z=b*W-I*R<0?-1:1,K=Math.sqrt(b*b+I*I),J=Math.sqrt(b*b+I*I),q=b*R+I*W,U=q/(K*J);return U>1&&(U=1),U<-1&&(U=-1),z*Math.acos(U);},s=function s(b,I,R,W,z,K,J,q,U,G,Z,rt){var et=Math.pow(z,2),it=Math.pow(K,2),X=Math.pow(Z,2),ct=Math.pow(rt,2),ut=et*it-et*ct-it*X;ut<0&&(ut=0),ut/=et*ct+it*X,ut=Math.sqrt(ut)*(J===q?-1:1);var B=ut*z/K*rt,F=ut*-K/z*Z,Y=G*B-U*F+(b+R)/2,k=U*B+G*F+(I+W)/2,N=(Z-B)/z,$=(rt-F)/K,x=(-Z-B)/z,E=(-rt-F)/K,D=o(1,0,N,$),j=o(N,$,x,E);return q===0&&j>0&&(j-=n),q===1&&j<0&&(j+=n),[Y,k,D,j];},c=function c(b){var I=b.px,R=b.py,W=b.cx,z=b.cy,K=b.rx,J=b.ry,q=b.xAxisRotation,U=q===void 0?0:q,G=b.largeArcFlag,Z=G===void 0?0:G,rt=b.sweepFlag,et=rt===void 0?0:rt,it=[];if(K===0||J===0)return[];var X=Math.sin(U*n/360),ct=Math.cos(U*n/360),ut=ct*(I-W)/2+X*(R-z)/2,B=-X*(I-W)/2+ct*(R-z)/2;if(ut===0&&B===0)return[];K=Math.abs(K),J=Math.abs(J);var F=Math.pow(ut,2)/Math.pow(K,2)+Math.pow(B,2)/Math.pow(J,2);F>1&&(K*=Math.sqrt(F),J*=Math.sqrt(F));var Y=s(I,R,W,z,K,J,Z,et,X,ct,ut,B),k=e(Y,4),N=k[0],$=k[1],x=k[2],E=k[3],D=Math.max(Math.ceil(Math.abs(E)/(n/4)),1);E/=D;for(var j=0;j<D;j++)it.push(a(x,E)),x+=E;return it.map(function(H){var V=i(H[0],K,J,ct,X,N,$),Q=V.x,nt=V.y,st=i(H[1],K,J,ct,X,N,$),ft=st.x,pt=st.y,lt=i(H[2],K,J,ct,X,N,$),at=lt.x,ht=lt.y;return{x1:Q,y1:nt,x2:ft,y2:pt,x:at,y:ht};});},m={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
|
+
*/},l=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function p(w){var b=[];return w.replace(l,function(I,R,W){var z=R.toLowerCase();for(W=P(W),z=="m"&&W.length>2&&(b.push([R].concat(W.splice(0,2))),z="l",R=R=="m"?"l":"L");;){if(W.length==m[z])return W.unshift(R),b.push(W);if(W.length<m[z])throw new Error("malformed path data");b.push([R].concat(W.splice(0,m[z])));}}),b;}var y=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function P(w){var b=w.match(y);return b?b.map(Number):[];}function S(w){var b=w[0][0],I=w[0][1],R=b,W=I;return w.forEach(function(z){var K=z[0],J=z[2],q=z[4],U=z[6],G=z[1],Z=z[3],rt=z[5],et=z[7];b=Math.min(b,K,J,q,U),I=Math.min(I,G,Z,rt,et),R=Math.max(R,K,J,q,U),W=Math.max(W,G,Z,rt,et);}),[b,I,R,W];}function v(w,b){return Math.sqrt(Math.pow(w[0]-b[0],2)+Math.pow(w[1]-b[1],2))+Math.sqrt(Math.pow(w[2]-b[2],2)+Math.pow(w[3]-b[3],2));}function T(w,b){var I=w[0],R=w[2],W=w[4],z=w[6],K=w[1],J=w[3],q=w[5],U=w[7],G=b[0],Z=b[2],rt=b[4],et=b[6],it=b[1],X=b[3],ct=b[5],ut=b[7];return Math.sqrt(Math.pow(G-I,2)+Math.pow(it-K,2))+Math.sqrt(Math.pow(Z-R,2)+Math.pow(X-J,2))+Math.sqrt(Math.pow(rt-W,2)+Math.pow(ct-q,2))+Math.sqrt(Math.pow(et-z,2)+Math.pow(ut-U,2));}function f(w,b){var I=u(w.length),R=[];I.forEach(function(z){var K=0,J=0;z.forEach(function(q){K+=T(w[q],b[J++]);}),R.push({index:z,distance:K});}),R.sort(function(z,K){return z.distance-K.distance;});var W=[];return R[0].index.forEach(function(z){W.push(w[z]);}),W;}function d(w,b){var I=g(w.length),R=[];I.forEach(function(z){var K=0;z.forEach(function(J){K+=v(S(w[J]),S(b[J]));}),R.push({index:z,distance:K});}),R.sort(function(z,K){return z.distance-K.distance;});var W=[];return R[0].index.forEach(function(z){W.push(w[z]);}),W;}function u(w){for(var b=[],I=0;I<w;I++){for(var R=[],W=0;W<w;W++){var z=W+I;z>w-1&&(z-=w),R[z]=W;}b.push(R);}return b;}function g(w){for(var b=[],I=0;I<w;I++)b.push(I);return M(b);}function M(w){var b=[],I=[];function R(W){var z,K;for(z=0;z<W.length;z++)K=W.splice(z,1)[0],I.push(K),W.length==0&&b.push(I.slice()),R(W),W.splice(z,0,K),I.pop();return b;}return R(w);}var C={};C.parser=p,C.lerpCurve=function(w,b,I){return C.lerpPoints(w[0],w[1],b[0],b[1],I).concat(C.lerpPoints(w[2],w[3],b[2],b[3],I)).concat(C.lerpPoints(w[4],w[5],b[4],b[5],I)).concat(C.lerpPoints(w[6],w[7],b[6],b[7],I));},C.lerpPoints=function(w,b,I,R,W){return[w+(I-w)*W,b+(R-b)*W];},C.q2b=function(w,b,I,R,W,z){return[w,b,(w+2*I)/3,(b+2*R)/3,(W+2*I)/3,(z+2*R)/3,W,z];},C.path2shapes=function(w){for(var b=C.parser(w),I=0,R=0,W=0,z=b.length,K=[],J=null,q=void 0,U=void 0,G=void 0,Z=void 0,rt=void 0,et=void 0,it=void 0;W<z;W++){var X=b[W],ct=X[0],ut=b[W-1];switch(ct){case"m":rt=K.length,K[rt]=[],J=K[rt],I=I+X[1],R=R+X[2];break;case"M":rt=K.length,K[rt]=[],J=K[rt],I=X[1],R=X[2];break;case"l":J.push([I,R,I,R,I,R,I+X[1],R+X[2]]),I+=X[1],R+=X[2];break;case"L":J.push([I,R,X[1],X[2],X[1],X[2],X[1],X[2]]),I=X[1],R=X[2];break;case"h":J.push([I,R,I,R,I,R,I+X[1],R]),I+=X[1];break;case"H":J.push([I,R,X[1],R,X[1],R,X[1],R]),I=X[1];break;case"v":J.push([I,R,I,R,I,R,I,R+X[1]]),R+=X[1];break;case"V":J.push([I,R,I,X[1],I,X[1],I,X[1]]),R=X[1];break;case"C":J.push([I,R,X[1],X[2],X[3],X[4],X[5],X[6]]),I=X[5],R=X[6];break;case"S":ut[0]==="C"||ut[0]==="c"?J.push([I,R,I+ut[5]-ut[3],R+ut[6]-ut[4],X[1],X[2],X[3],X[4]]):(ut[0]==="S"||ut[0]==="s")&&J.push([I,R,I+ut[3]-ut[1],R+ut[4]-ut[2],X[1],X[2],X[3],X[4]]),I=X[3],R=X[4];break;case"c":J.push([I,R,I+X[1],R+X[2],I+X[3],R+X[4],I+X[5],R+X[6]]),I=I+X[5],R=R+X[6];break;case"s":ut[0]==="C"||ut[0]==="c"?J.push([I,R,I+ut[5]-ut[3],R+ut[6]-ut[4],I+X[1],R+X[2],I+X[3],R+X[4]]):(ut[0]==="S"||ut[0]==="s")&&J.push([I,R,I+ut[3]-ut[1],R+ut[4]-ut[2],I+X[1],R+X[2],I+X[3],R+X[4]]),I=I+X[3],R=R+X[4];break;case"a":et=c({rx:X[1],ry:X[2],px:I,py:R,xAxisRotation:X[3],largeArcFlag:X[4],sweepFlag:X[5],cx:I+X[6],cy:R+X[7]}),it=et[et.length-1],et.forEach(function(B,F){F===0?J.push([I,R,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):J.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=it.x,R=it.y;break;case"A":et=c({rx:X[1],ry:X[2],px:I,py:R,xAxisRotation:X[3],largeArcFlag:X[4],sweepFlag:X[5],cx:X[6],cy:X[7]}),it=et[et.length-1],et.forEach(function(B,F){F===0?J.push([I,R,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):J.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=it.x,R=it.y;break;case"Q":J.push(C.q2b(I,R,X[1],X[2],X[3],X[4])),I=X[3],R=X[4];break;case"q":J.push(C.q2b(I,R,I+X[1],R+X[2],X[3]+I,X[4]+R)),I+=X[3],R+=X[4];break;case"T":ut[0]==="Q"||ut[0]==="q"?(G=I+ut[3]-ut[1],Z=R+ut[4]-ut[2],J.push(C.q2b(I,R,G,Z,X[1],X[2]))):(ut[0]==="T"||ut[0]==="t")&&(J.push(C.q2b(I,R,I+I-G,R+R-Z,X[1],X[2])),G=I+I-G,Z=R+R-Z),I=X[1],R=X[2];break;case"t":ut[0]==="Q"||ut[0]==="q"?(G=I+ut[3]-ut[1],Z=R+ut[4]-ut[2],J.push(C.q2b(I,R,G,Z,I+X[1],R+X[2]))):(ut[0]==="T"||ut[0]==="t")&&(J.push(C.q2b(I,R,I+I-G,R+R-Z,I+X[1],R+X[2])),G=I+I-G,Z=R+R-Z),I+=X[1],R+=X[2];break;case"Z":q=J[0][0],U=J[0][1],J.push([I,R,q,U,q,U,q,U]);break;case"z":q=J[0][0],U=J[0][1],J.push([I,R,q,U,q,U,q,U]);break;}}return K;},C._upCurves=function(w,b){for(var I=0,R=0,W=w.length;I<b;I++)w.push(w[R].slice(0)),R++,R>W-1&&(R-=W);};function A(w,b,I,R,W,z,K,J,q){return{left:L(w,b,I,R,W,z,K,J,q),right:L(K,J,W,z,I,R,w,b,1-q,!0)};}function L(w,b,I,R,W,z,K,J,q,U){var G=(I-w)*q+w,Z=(R-b)*q+b,rt=(W-I)*q+I,et=(z-R)*q+R,it=(K-W)*q+W,X=(J-z)*q+z,ct=(rt-G)*q+G,ut=(et-Z)*q+Z,B=(it-rt)*q+rt,F=(X-et)*q+et,Y=(B-ct)*q+ct,k=(F-ut)*q+ut;return U?[Y,k,ct,ut,G,Z,w,b]:[w,b,G,Z,ct,ut,Y,k];}C._splitCurves=function(w,b){for(var I=0,R=0;I<b;I++){var W=w[R],z=A(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],0.5);w.splice(R,1),w.splice(R,0,z.left,z.right),R+=2,R>=w.length-1&&(R=0);}};function O(w,b){for(var I=function I(z){var K=w[w.length-1],J=[];K.forEach(function(q){J.push(q.slice(0));}),w.push(J);},R=0;R<b;R++)I();}return C.lerp=function(w,b,I){return C._lerp(C.path2shapes(w),C.path2shapes(b),I);},C.MIM_CURVES_COUNT=100,C._preprocessing=function(w,b){var I=w.length,R=b.length,W=JSON.parse(JSON.stringify(w)),z=JSON.parse(JSON.stringify(b));return I>R?O(z,I-R):I<R&&O(W,R-I),W=d(W,z),W.forEach(function(K,J){var q=K.length,U=z[J].length;q>U?q<C.MIM_CURVES_COUNT?(C._splitCurves(K,C.MIM_CURVES_COUNT-q),C._splitCurves(z[J],C.MIM_CURVES_COUNT-U)):C._splitCurves(z[J],q-U):q<U&&(U<C.MIM_CURVES_COUNT?(C._splitCurves(K,C.MIM_CURVES_COUNT-q),C._splitCurves(z[J],C.MIM_CURVES_COUNT-U)):C._splitCurves(K,U-q));}),W.forEach(function(K,J){W[J]=f(K,z[J]);}),[W,z];},C._lerp=function(w,b,I){var R=[];return w.forEach(function(W,z){var K=[];W.forEach(function(J,q){K.push(C.lerpCurve(J,b[z][q],I));}),R.push(K);}),R;},C.animate=function(w){var b=C.path2shapes(w.from),I=C.path2shapes(w.to),R=C._preprocessing(b,I),W=/* @__PURE__ */new Date(),z=w.end||function(){},K=w.progress||function(){},J=w.begin||function(){},q=w.easing||function(et){return et;},U=null,G=null,Z=w.time;J(b);var rt=function et(){var it=/* @__PURE__ */new Date()-W;if(it>=Z){G=I,K(G,1),z(G),cancelAnimationFrame(U);return;}var X=q(it/Z);G=C._lerp(R[0],R[1],X),K(G,X),U=requestAnimationFrame(et);};rt();},C;});},/* 228 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");var c=/*#__PURE__*/function(_e$default3){function c(l){var _this35;_classCallCheck(this,c);_this35=_callSuper(this,c,[l]),_this35[a]({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(c,_e$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(l){this[o]("d",l);}},{key:"normalize",get:function get(){return this[s]("normalize");},set:function set(l){this[o]("normalize",!!l);}},{key:"fillColor",get:function get(){return this[s]("fillColor");},set:function set(l){this[o]("fillColor",Object(n.parseColor)(l));}},{key:"fillRule",get:function get(){return this[s]("fillRule");},set:function set(l){if(l!=null&&l!=="nonzero"&&l!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",l);}},{key:"strokeColor",get:function get(){return this[s]("strokeColor");},set:function set(l){this[o]("strokeColor",Object(n.parseColor)(l));}},{key:"lineWidth",get:function get(){return this[s]("lineWidth");},set:function set(l){this[o]("lineWidth",Object(i.toNumber)(l));}},{key:"lineJoin",get:function get(){return this[s]("lineJoin");},set:function set(l){if(l!=null&&l!=="miter"&&l!=="bevel"&&l!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",l);}},{key:"lineCap",get:function get(){return this[s]("lineCap");},set:function set(l){if(l!=null&&l!=="butt"&&l!=="square"&&l!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",l);}},{key:"lineDash",get:function get(){return this[s]("lineDash");},set:function set(l){l=Object(i.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l]),this[o]("lineDash",l?l.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[s]("lineDashOffset");},set:function set(l){this[o]("lineDashOffset",Object(i.toNumber)(l));}},{key:"miterLimit",get:function get(){return this[s]("miterLimit");},set:function set(l){this[o]("miterLimit",Object(i.toNumber)(l));}},{key:"roundSegments",get:function get(){return this[s]("roundSegments");},set:function set(l){this[o]("roundSegments",l);}},{key:"texture",get:function get(){return this[s]("texture");},set:function set(l){this[o]("texture",l);}},{key:"textureRect",get:function get(){return this[s]("textureRect");},set:function set(l){this[o]("textureRect",l);}},{key:"sourceRect",get:function get(){return this[s]("sourceRect");},set:function set(l){this[o]("sourceRect",l);}},{key:"textureRepeat",get:function get(){return this[s]("textureRepeat");},set:function set(l){this[o]("textureRepeat",!!l);}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(l){this[o]("clipPath",l);}}]);}(e["default"]);},/* 229 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,c=_this$attributes15.width,m=_this$attributes15.height;return c>0&&m>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return m;});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_declareAlias");function c(l){var p=l.width,y=l.height;return"M0 0L".concat(p," 0L").concat(p," ").concat(y,"L0 ").concat(y,"Z");}var m=/*#__PURE__*/function(_e$default5){function m(p){var _this36;_classCallCheck(this,m);_this36=_callSuper(this,m,[p]),_this36[i]({width:0,height:0/* size */}),_this36[s]("size");return _this36;}// readonly
|
|
322
|
+
_inherits(m,_e$default5);return _createClass(m,[{key:"d",get:function get(){return this[o]("d");},set:function set(p){}// eslint-disable-line no-empty-function
|
|
323
|
+
},{key:"width",get:function get(){return this[o]("width");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("width",p)){var y=c(this);this[a]("d",y);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("height",p)){var y=c(this);this[a]("d",y);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}}]);}(e["default"]);},/* 231 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default6);return _createClass(o,[{key:"isVisible",get:function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.points;return c.length>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function m(p){var y=p.points,P=p.smooth,S=p.smoothRange,v=p.close,T=[];for(var d=0;d<y.length;d+=2)T.push([y[d],y[d+1]]);var f="";return P?f=Object(i.makeSmoothCurveLine)(T,S):T.length&&(f="M".concat(T.map(function(d){return d.join(" ");}).join("L"))),f&&v&&(f+="Z"),f;}var l=/*#__PURE__*/function(_e$default8){function l(y){var _this37;_classCallCheck(this,l);_this37=_callSuper(this,l,[y]),_this37[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
324
|
+
/* close */}),_this37[c]("close");return _this37;}// readonly
|
|
325
|
+
_inherits(l,_e$default8);return _createClass(l,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
326
|
+
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(y){y=y?"normal":"none",this.closeType=y;}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var P=m(this);this[o]("d",P);}}},{key:"smooth",get:function get(){return this[s]("smooth");},set:function set(y){if(this[o]("smooth",y)){var P=m(this);this[o]("d",P);}}},{key:"smoothRange",get:function get(){return this[s]("smoothRange");},set:function set(y){if(y&&!Array.isArray(y)&&(y=[y]),this[o]("smoothRange",y)&&this.smooth){var P=m(this);this[o]("d",P);}}},{key:"points",get:function get(){return this[s]("points");},set:function set(y){if(y=Object(n.toArray)(y),Array.isArray(y)&&(y=y.reduce(function(P,S){return Array.isArray(S)?[].concat(_toConsumableArray(P),_toConsumableArray(S.map(function(v){return Object(n.toNumber)(v);}))):[].concat(_toConsumableArray(P),[Object(n.toNumber)(S)]);},[])),this[o]("points",y)){var P=m(this);this[o]("d",P);}}}]);}(e["default"]);},/* 234 *//***/function(h,r,t){t.r(r),t.d(r,"makeSmoothCurveLine",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function a(c){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var l=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var p,y,P,S;if((n[c].x===n[c+1].x||n[c].y===n[c+1].y)&&(m=0,l=0),c<1?(p=n[0].x+(n[1].x-n[0].x)*m,y=n[0].y+(n[1].y-n[0].y)*m):(p=n[c].x+(n[c+1].x-n[c-1].x)*m,y=n[c].y+(n[c+1].y-n[c-1].y)*m),c>n.length-3){var v=n.length-1;P=n[v].x-(n[v].x-n[v-1].x)*l,S=n[v].y-(n[v].y-n[v-1].y)*l;}else P=n[c+1].x-(n[c+2].x-n[c].x)*l,S=n[c+1].y-(n[c+2].y-n[c].y)*l;return[{x:p,y:y},{x:P,y:S}];}n=n.map(function(_ref143){var _ref144=_slicedToArray(_ref143,2),c=_ref144[0],m=_ref144[1];return{x:c,y:m};});var o="",s=0;return n.forEach(function(c,m){if(m===0)o+="M".concat(c.x," ").concat(c.y);else{for(;m>i[s];)s++;if(s%2){var _a3=a(m-1),_a4=_slicedToArray(_a3,2),l=_a4[0],p=_a4[1];o+="C".concat([l.x,l.y,p.x,p.y,c.x,c.y].join(" "));}else o+="L".concat(c.x," ").concat(c.y);}}),o;}},/* 235 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(m){var _m$sides=_slicedToArray(m.sides,2),l=_m$sides[0],p=_m$sides[1];var y=m.angle%360;return y<0&&(y+=360),y=Math.PI*y/180,[0,0,l,0,p*Math.cos(y),p*Math.sin(y)];}var c=/*#__PURE__*/function(_e$default9){function c(l){var _this38;_classCallCheck(this,c);_this38=_callSuper(this,c,[l]),_this38[i]({sides:[0,0],angle:60,closeType:"normal"});return _this38;}// readonly
|
|
327
|
+
_inherits(c,_e$default9);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
328
|
+
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(l){if(l=Object(n.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l,l]),this[a]("sides",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("angle",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}}]);}(e["default"]);},/* 236 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(m){var _m$sides2=_slicedToArray(m.sides,2),l=_m$sides2[0],p=_m$sides2[1];var y=m.angle%360;y<0&&(y+=360),y=Math.PI*y/180;var P=p*Math.cos(y),S=p*Math.sin(y);return[0,0,l,0,P+l,S,P,S];}var c=/*#__PURE__*/function(_e$default11){function c(l){var _this39;_classCallCheck(this,c);_this39=_callSuper(this,c,[l]),_this39[i]({sides:[0,0],angle:90,closeType:"normal"});return _this39;}// readonly
|
|
329
|
+
_inherits(c,_e$default11);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
330
|
+
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(l){if(l=Object(n.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l,l]),this[a]("sides",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("angle",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}}]);}(e["default"]);},/* 238 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default12);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"regular");},/* 239 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(m){var l=m.edges,p=m.radius,y=m.offsetAngle,P=Math.PI*y/180-0.5*Math.PI;if(l<3||p<=0)return[];var S=[];for(var v=0;v<l;v++){var _T23=v*2*Math.PI/l+P,_f20=p*Math.cos(_T23),d=p*Math.sin(_T23);S.push(_f20,d);}return S;}var c=/*#__PURE__*/function(_e$default13){function c(l){var _this40;_classCallCheck(this,c);_this40=_callSuper(this,c,[l]),_this40[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this40;}// readonly
|
|
331
|
+
_inherits(c,_e$default13);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
332
|
+
},{key:"edges",get:function get(){return this[o]("edges");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("edges",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("radius",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("offsetAngle",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}}]);}(e["default"]);},/* 240 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default14);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"star");},/* 241 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(m){var l=m.angles,p=m.innerRadius,y=m.outerRadius,P=m.offsetAngle,S=Math.PI*P/180-0.5*Math.PI;if(l<3||p<=0||y<=0)return[];var v=[];for(var _T24=0;_T24<l*2;_T24++){var _f21=_T24*Math.PI/l+S,d=_T24%2?p:y,u=d*Math.cos(_f21),g=d*Math.sin(_f21);v.push(u,g);}return v;}var c=/*#__PURE__*/function(_e$default15){function c(l){var _this41;_classCallCheck(this,c);_this41=_callSuper(this,c,[l]),_this41[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this41;}// readonly
|
|
333
|
+
_inherits(c,_e$default15);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
334
|
+
},{key:"angles",get:function get(){return this[o]("angles");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("angles",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("innerRadius",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("outerRadius",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(l){l=Object(n.toArray)(l,!0),Array.isArray(l)||(l=[l,l]),this.innerRadius=l[0],this.outerRadius=l[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("offsetAngle",l)){var p=s(this);_superPropSet(c,"points",p,this,1,1);}}}]);}(e["default"]);},/* 242 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,c=_this$attributes16.radiusX,m=_this$attributes16.radiusY,l=_this$attributes16.startAngle,p=_this$attributes16.endAngle;return c>0&&m>0&&l!==p&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function m(p){var y=p.radiusX,P=p.radiusY,S=p.startAngle,v=p.endAngle,T=p.direction,f=p.closeType,d=T==="anitclockwise",u=new e.Figure2D();return f==="sector"&&u.moveTo(0,0),u.ellipse(0,0,y,P,0,Math.PI*S/180,Math.PI*v/180,d),f!=="none"&&u.closePath(),u.path.reduce(function(C,A){return C+A.join(" ");},"");}var l=/*#__PURE__*/function(_n$default2){function l(y){var _this42;_classCallCheck(this,l);_this42=_callSuper(this,l,[y]),_this42[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
|
|
335
|
+
closeType:"none"// none | sector | normal
|
|
336
|
+
}),_this42[c]("radius","angle");return _this42;}// readonly
|
|
337
|
+
_inherits(l,_n$default2);return _createClass(l,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
338
|
+
},{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusX",y)){var P=m(this);this[o]("d",P);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusY",y)){var P=m(this);this[o]("d",P);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.radiusX=y[0],this.radiusY=y[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}},{key:"direction",get:function get(){return this[s]("direction");},set:function set(y){if(y!=null&&y!=="clockwise"&&y!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",y);}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var P=m(this);this[o]("d",P);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var P=m(this);this[o]("d",P);}}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="sector"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var P=m(this);this[o]("d",P);}}}]);}(n["default"]);},/* 244 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default17);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"arc");},/* 245 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_e$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_e$default18);return _createClass(i,[{key:"radius",get:function get(){return _superPropGet(i,"radiusX",this,1);},set:function set(o){o=Object(n.toNumber)(o),_superPropSet(i,"radiusX",o,this,1,1),_superPropSet(i,"radiusY",o,this,1,1);}}]);}(e["default"]);},/* 246 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(s,c,m){return c in s?Object.defineProperty(s,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[c]=m,s;}var o=/*#__PURE__*/function(_e$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,c=_this$attributes17.innerRadius,m=_this$attributes17.outerRadius,l=_this$attributes17.startAngle,p=_this$attributes17.endAngle;return(c>0||m>0)&&l!==p&&_superPropGet(o,"isVisible",this,1);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function m(p){var _ref145;var y=p.innerRadius,P=p.outerRadius,S=p.startAngle,v=p.endAngle;var T=new e.Figure2D();if(S=Math.PI*S/180,v=Math.PI*v/180,y>P&&(_ref145=[P,y],y=_ref145[0],P=_ref145[1],_ref145),y<=0&&T.moveTo(0,0),T.arc(0,0,P,S,v,!1),y>0){var u=Math.PI*2;v<S&&(v=S+u+(v-S)%u),v-S>=u&&(v=S+u-1e-6),T.arc(0,0,y,v,S,!0);}return T.closePath(),T.path.reduce(function(u,g){return u+g.join(" ");},"");}var l=/*#__PURE__*/function(_n$default3){function l(y){var _this43;_classCallCheck(this,l);_this43=_callSuper(this,l,[y]),_this43[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this43[c]("radius","angle");return _this43;}// readonly
|
|
339
|
+
_inherits(l,_n$default3);return _createClass(l,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
340
|
+
},{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("innerRadius",y)){var P=m(this);this[o]("d",P);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("outerRadius",y)){var P=m(this);this[o]("d",P);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.innerRadius=y[0],this.outerRadius=y[1];}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var P=m(this);this[o]("d",P);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var P=m(this);this[o]("d",P);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}}]);}(n["default"]);},/* 248 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return P;});var e=t(12),n=t(218),i=t(219),a=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(S,v,T){return v in S?Object.defineProperty(S,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[v]=T,S;}var c=Symbol("textImage"),m=Symbol("textImageTask"),l=Symbol("textureContext"),p=Symbol("updateTextureRect"),y=Symbol("textCanvas");var P=/*#__PURE__*/function(_i$default3){function P(){var _this44;var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof v=="string"&&(v={text:v}),_this44=_callSuper(this,P,[v]);return _this44;}/* override */_inherits(P,_i$default3);return _createClass(P,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(P,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),v=_superPropGet5[0],T=_superPropGet5[1];var _this$attributes18=this.attributes,f=_this$attributes18.width,d=_this$attributes18.height;if(f==null||d==null){var u=this[c];u&&(f==null&&(v=u.rect[2]),d==null&&(T=u.rect[3]));}return[v,T];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(v){this.attributes.text=v;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(v){this.attributes.text=v;}},{key:"textImage",get:function get(){return this[c]||{};}},{key:"textImageReady",get:function get(){return this[m]||Promise.resolve();}/* override */},{key:"draw",value:function draw(v){_superPropGet(P,"draw",this,3)([v]);var T=this.mesh;if(T){var _f22=this[c];if(_f22){var d=T.texture;if(!d||this[l]&&this[l]!==this.renderer||_f22.needsUpdate?(_f22.needsUpdate=!1,Object(n.deleteTexture)(_f22.image,this.renderer),d=Object(n.createTexture)(_f22.image,this.renderer),this[p]=!0):d=T.uniforms.u_texSampler,this[p]){var _f22$rect$slice=_f22.rect.slice(2),_f22$rect$slice2=_slicedToArray(_f22$rect$slice,2),u=_f22$rect$slice2[0],g=_f22$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),M=_this$contentSize4[0],C=_this$contentSize4[1],A=this.attributes.textAlign,L=this.attributes.verticalAlign;var O=0;A==="center"?O=(M-u)/2:(A==="right"||A==="end")&&(O=M-u);var w=this.attributes.fontSize,b=this.attributes.lineHeight;var I=0;L==="top"?I=(w-b)/2:L==="bottom"&&(I=(b-w)/2);var _this$attributes19=this.attributes,R=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,z=this.attributes.borderWidth;O+=R+z,I+=W+z;var _this$attributes20=this.attributes,K=_this$attributes20.anchorX,J=_this$attributes20.anchorY;O-=this.offsetSize[0]*K,I-=this.offsetSize[1]*J,T.setTexture(d,{rect:[O,I,u,g]}),this[p]=!1,this[l]=this.renderer;}}}return v;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,T,f){v==="text"||v==="fontSize"||v==="fontFamily"||v==="fontStyle"||v==="fontVariant"||v==="fontWeight"||v==="fontStretch"||v==="lineHeight"||v==="strokeColor"||v==="fillColor"||v==="strokeWidth"?this.updateText():((v==="textAlign"||v==="verticalAlign")&&(this[p]=!0),_superPropGet(P,"onPropertyChange",this,3)([v,T,f]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(P,"updateContours",this,3)([]),this[p]=!0;}},{key:"updateText",value:function updateText(){var _this45=this;this[m]||(this[m]=Promise.resolve().then(function(){_this45[m]=null;var _this45$attributes=_this45.attributes,v=_this45$attributes.text,T=_this45$attributes.font,f=_this45$attributes.fillColor,d=_this45$attributes.strokeColor,u=_this45$attributes.strokeWidth,g=_this45.layer?_this45.layer.displayRatio:1;return _this45[y]=_this45[y]||e.ENV.createCanvas(1,1),_this45[c]=e.ENV.createText(v,{font:T,fillColor:f,strokeColor:d,strokeWidth:u,parseFont:e.parseFont,ratio:g,textCanvas:_this45[y]}),_this45[c].needsUpdate=!0,_this45.updateContours(),_this45.forceUpdate(),_this45[c];}));}}]);}(i["default"]);s(P,"Attr",a["default"]),o["default"].registerNode(P,"label");},/* 249 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_declareAlias");var l=/*#__PURE__*/function(_a$default2){function l(y){var _this46;_classCallCheck(this,l);_this46=_callSuper(this,l,[y]),_this46[o]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this46[m]("font");return _this46;}_inherits(l,_a$default2);return _createClass(l,[{key:"text",get:function get(){return this[c]("text")||" ";},set:function set(y){this[s]("text",y);}},{key:"fontSize",get:function get(){return this[c]("fontSize");},set:function set(y){this[s]("fontSize",Object(n.toNumber)(y));}},{key:"fontFamily",get:function get(){return this[c]("fontFamily");},set:function set(y){this[s]("fontFamily",y);}},{key:"fontStyle",get:function get(){return this[c]("fontStyle");},set:function set(y){this[s]("fontStyle",y);}},{key:"fontVariant",get:function get(){return this[c]("fontVariant");},set:function set(y){this[s]("fontVariant",y);}},{key:"fontWeight",get:function get(){return this[c]("fontWeight");},set:function set(y){this[s]("fontWeight",y);}},{key:"fontStretch",get:function get(){return this[c]("fontStretch");},set:function set(y){this[s]("fontStretch",y);}},{key:"lineHeight",get:function get(){return this[c]("lineHeight")||this.fontSize;},set:function set(y){this[s]("lineHeight",Object(n.toNumber)(y));}},{key:"textAlign",get:function get(){return this[c]("textAlign");},set:function set(y){this[s]("textAlign",y);}},{key:"strokeColor",get:function get(){return this[c]("strokeColor");},set:function set(y){this[s]("strokeColor",Object(i.parseColor)(y));}},{key:"strokeWidth",get:function get(){return this[c]("strokeWidth");},set:function set(y){this[s]("strokeWidth",Object(n.toNumber)(y));}},{key:"verticalAlign",get:function get(){return this[c]("verticalAlign");},set:function set(y){this[s]("verticalAlign",y);}},{key:"fillColor",get:function get(){return this[c]("fillColor");},set:function set(y){this[s]("fillColor",Object(i.parseColor)(y));}},{key:"font",get:function get(){var y=this.fontStyle,P=this.fontVariant,S=this.fontWeight,v=this.fontStretch,T=this.fontSize,f=this.lineHeight,d=this.fontFamily;return"".concat(y," ").concat(P," ").concat(S," ").concat(v," ").concat(T,"px/").concat(f,"px ").concat(d);},set:function set(y){if(y==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var P=Object(e.parseFont)(y);this.fontStyle=P.style,this.fontVariant=P.variant,this.fontWeight=P.weight,this.fontStretch=P.stretch,this.fontSize=Object(n.toNumber)("".concat(P.size).concat(P.unit)),P.lineHeight&&(this.lineHeight=P.pxLineHeight),this.fontFamily=P.family;}}}]);}(a["default"]);},/* 250 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(12),n=t(219),i=t(251),a=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function s(P,S,v){return S in P?Object.defineProperty(P,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[S]=v,P;}var c=Symbol("zOrder"),m=Symbol("ordered"),l=Symbol("children"),p=Symbol("sealed");var y=/*#__PURE__*/function(_n$default4){function y(){var _this47;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);_this47=_callSuper(this,y,[S]),_this47[l]=[],_this47[m]=null,_this47[c]=0;return _this47;}_inherits(y,_n$default4);return _createClass(y,[{key:"childNodes",get:function get(){return this[l];}},{key:"children",get:function get(){return this[l];}},{key:"orderedChildren",get:function get(){return this[m]||(this[m]=_toConsumableArray(this[l]),this[m].sort(function(S,v){return S.zIndex-v.zIndex||S.zOrder-v.zOrder;})),this[m];}},{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(v){return _this48.appendChild(v);});}},{key:"appendChild",value:function appendChild(S){return S.remove(),this[l].push(S),S.connect(this,this[c]++),this[m]&&(this[m].length&&S.zIndex<this[m][this[m].length-1].zIndex?this.reorder():this[m].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 v=_superPropGet(y,"cloneNode",this,3)([]);return S&&this[l].forEach(function(T){var f=T.cloneNode(S);v.appendChild(f);}),v;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(S){var v=this.orderedChildren;for(var _T25=v.length-1;_T25>=0;_T25--)if(v[_T25].dispatchPointerEvent(S))return!0;return _superPropGet(y,"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(y,"draw",this,3)([S]),!this[p]&&this.attributes.display!=="none"){var v=this.orderedChildren;for(var _T26=0;_T26<v.length;_T26++)v[_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,v){if(v==null)return this.appendChild(S);S.remove();var T=this[l].indexOf(v);if(T<0)throw new Error("Invalid reference node.");var f=v.zOrder;for(var d=T;d<this[l].length;d++){var u=this[l][d].zOrder,g=this[l][d];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:u+1,writable:!1,configurable:!0});}if(this[l].splice(T,0,S),S.connect(this,f),this[m])if(S.zIndex!==v.zIndex)this.reorder();else{var _d6=this[m].indexOf(v);this[m].splice(_d6,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,v){S.remove();var T=this[l].indexOf(v);if(T<0)throw new Error("Invalid reference node.");if(this[l][T]=S,S.connect(this,v.zOrder),this[m])if(S.zIndex!==v.zIndex)this.reorder();else{var _f23=this[m].indexOf(v);this[m][_f23]=S;}return v.disconnect(this),S;}},{key:"removeAllChildren",value:function removeAllChildren(){var S=this[l];for(var v=S.length-1;v>=0;v--)S[v].remove();}},{key:"removeChild",value:function removeChild(S){var v=this[l].indexOf(S);if(v>=0){if(this[l].splice(v,1),this[m]){var _T27=this[m].indexOf(S);this[m].splice(_T27,1);}return S.disconnect(this),S;}return null;}},{key:"reorder",value:function reorder(){this[m]=null;}},{key:"seal",value:function seal(){function S(d,u){var g=[];for(var M=0;M<d.length;M++){var C=_toConsumableArray(d[M]);for(var A=1;A<C.length;A+=2){var L=C[A],O=C[A+1];C[A]=L*u[0]+O*u[2]+u[4],C[A+1]=L*u[1]+O*u[3]+u[5];}g.push(C);}return g;}var v=this.orderedChildren,T=new e.Figure2D(),f=this.localMatrix;for(var d=0;d<v.length;d++){var u=v[d];if(u instanceof y&&(u=u.seal()),u.clientBox){var g=u.clientBox.contours.path;g=S(g,u.localMatrix),T.addPath(g);}if(u.path){var _g7=u.path.contours.path;_g7=S(_g7,u.localMatrix),T.addPath(_g7);}}return this[p]=!0,this.clientBox=T,{clientBox:T,localMatrix:f};}/* override */},{key:"setResolution",value:function setResolution(_ref146){var S=_ref146.width,v=_ref146.height;_superPropGet(y,"setResolution",this,3)([{width:S,height:v}]),this[l].forEach(function(T){T.setResolution({width:S,height:v});});}/* override */},{key:"updateContours",value:function updateContours(){this[p]||_superPropGet(y,"updateContours",this,3)([]);}}]);}(n["default"]);s(y,"Attr",i["default"]),a["default"].registerNode(y,"group");},/* 251 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_e$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_e$default20);return _createClass(n);}(e["default"]);},/* 252 *//***/function(h,r,t){t.r(r),t.d(r,"querySelectorAll",function(){return p;}),t.d(r,"querySelector",function(){return y;}),t.d(r,"isMatched",function(){return P;}),t.d(r,"compile",function(){return S;});var e=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var i=t(253);function a(v){return v.nodeType===1||n["default"].isSpriteNode(v.nodeName);}function o(v){return Array.from(v.childNodes||[]);}function s(v){return n["default"].isSpriteNode(v.nodeName)?v.parent||v.canvas||v.container:v.parentElement;}function c(v){var T=v.length,f,d,u;for(;--T>-1;){for(f=d=v[T],v[T]=null,u=!0;d;){if(v.indexOf(d)>-1){u=!1,v.splice(T,1);break;}d=s(d);}u&&(v[T]=f);}return v;}var m={isTag:a,existsOne:function existsOne(v,T){return T.some(function(f){return a(f)?v(f)||m.existsOne(v,o(f)):!1;});},getSiblings:function getSiblings(v){var T=s(v);return T&&o(T);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(v,T){if(v.nodeType===1&&T==="class"||T==="id")return v[T];if(this.hasAttrib(v,T)){var _f24=v.attributes[T];return Array.isArray(_f24)&&(_f24="[".concat(_f24.join(),"]")),String(_f24);}},hasAttrib:function hasAttrib(v,T){return v.attributes[T]!=null;},removeSubsets:c,getName:function getName(v){return v.tagName?v.tagName.toLowerCase():null;},findOne:function v(T,f){var d=null;for(var u=0,g=f.length;u<g&&!d;u++)if(T(f[u]))d=f[u];else{var M=o(f[u]);M&&M.length>0&&(d=v(T,M));}return d;},findAll:function v(T,f){var d=[];for(var u=0,g=f.length;u<g;u++){if(!a(f[u]))continue;T(f[u])&&d.push(f[u]);var M=o(f[u]);M&&(d=d.concat(v(T,M)));}return d;},getText:function v(T){return Array.isArray(T)?T.map(v).join(""):a(T)?v(o(T)):T.nodeType===3?T.nodeValue:n["default"].isSpriteNode(T.nodeName)?T.text:"";}};function l(v){if(typeof v!="string")return v;var T=v.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return T&&(T=T.map(function(f){var d=f.slice(1,-1).split("="),u=Object(e.parseColor)(d[1].replace(/['"]/g,""));return[f,"[".concat(d[0],"=\"").concat(u,"\"]")];}),T.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),f=_ref148[0],d=_ref148[1];v=v.replace(f,d);})),T=v.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.map(function(f){var d=f.slice(1,-1).split("="),u=d[1].slice(2,-2).split(/,/g).map(function(g){return g.trim();});return[f,"[".concat(d[0],"=\"[").concat(u,"]\"]")];}),T.forEach(function(_ref149){var _ref150=_slicedToArray(_ref149,2),f=_ref150[0],d=_ref150[1];v=v.replace(f,d);})),v;}function p(v,T){return i.selectAll(l(v),T,{adapter:m});}function y(v,T){return i.selectOne(l(v),T,{adapter:m});}function P(v,T){return i.is(v,l(T),{adapter:m});}function S(v){return i.compile(l(v),{adapter:m});}},/* 253 *//***/function(h,r,t){h.exports=S;var e=t(254),n=t(273).falseFunc,i=t(274);function a(v){return function(f,d,u){return d=d||{},d.adapter=d.adapter||e,v(f,d,u);};}var o=a(i),s=a(i.compileUnsafe);function c(v){return function(f,d,u){return u=u||{},u.adapter=u.adapter||e,typeof f!="function"&&(f=s(f,u,d)),f.shouldTestNextSiblings&&(d=l(u&&u.context||d,u.adapter)),Array.isArray(d)?d=u.adapter.removeSubsets(d):d=u.adapter.getChildren(d),v(f,d,u);};}function m(v,T){var f=T.getSiblings(v);if(!Array.isArray(f))return[];for(f=f.slice(0);f.shift()!==v;);return f;}function l(v,T){Array.isArray(v)||(v=[v]);for(var f=v.slice(0),d=0,u=v.length;d<u;d++){var g=m(f[d],T);f.push.apply(f,g);}return f;}var p=c(function(T,f,d){return T===n||!f||f.length===0?[]:d.adapter.findAll(T,f);}),y=c(function(T,f,d){return T===n||!f||f.length===0?null:d.adapter.findOne(T,f);});function P(v,T,f){return f=f||{},f.adapter=f.adapter||e,(typeof T=="function"?T:o(T,f))(v);}function S(v,T,f){return p(v,T,f);}S.compile=o,S.filters=i.Pseudos.filters,S.pseudos=i.Pseudos.pseudos,S.selectAll=p,S.selectOne=y,S.is=P,S.parse=o,S.iterate=p,S._compileUnsafe=s,S._compileToken=i.compileToken;},/* 254 *//***/function(h,r,t){var e=h.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){e[i]=n[i].bind(e);});});},/* 255 *//***/function(h,r,t){var e=t(256),n=t(257),i=e.isTag;h.exports={getInnerHTML:a,getOuterHTML:n,getText:o};function a(s,c){return s.children?s.children.map(function(m){return n(m,c);}).join(""):"";}function o(s){return Array.isArray(s)?s.map(o).join(""):i(s)?s.name==="br"?"\n":o(s.children):s.type===e.CDATA?o(s.children):s.type===e.Text?s.data:"";}},/* 256 *//***/function(h,r){h.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(h,r,t){var e=t(258),n=t(259),i=t(267);i.elementNames.__proto__=null,i.attributeNames.__proto__=null;var a={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function o(v,T){if(v){var f="",d;for(var u in v)d=v[u],f&&(f+=" "),T.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),f+=u,(d!==null&&d!==""||T.xmlMode)&&(f+='="'+(T.decodeEntities?n.encodeXML(d):d.replace(/\"/g,"""))+'"');return f;}}var s={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},c=h.exports=function(v,T){!Array.isArray(v)&&!v.cheerio&&(v=[v]),T=T||{};for(var f="",d=0;d<v.length;d++){var u=v[d];u.type==="root"?f+=c(u.children,T):e.isTag(u)?f+=l(u,T):u.type===e.Directive?f+=p(u):u.type===e.Comment?f+=S(u):u.type===e.CDATA?f+=P(u):f+=y(u,T);}return f;},m=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function l(v,T){T.xmlMode==="foreign"&&(v.name=i.elementNames[v.name]||v.name,v.parent&&m.indexOf(v.parent.name)>=0&&(T=Object.assign({},T,{xmlMode:!1}))),!T.xmlMode&&["svg","math"].indexOf(v.name)>=0&&(T=Object.assign({},T,{xmlMode:"foreign"}));var f="<"+v.name,d=o(v.attribs,T);return d&&(f+=" "+d),T.xmlMode&&(!v.children||v.children.length===0)?f+="/>":(f+=">",v.children&&(f+=c(v.children,T)),(!s[v.name]||T.xmlMode)&&(f+="</"+v.name+">")),f;}function p(v){return"<"+v.data+">";}function y(v,T){var f=v.data||"";return T.decodeEntities&&!(v.parent&&v.parent.name in a)&&(f=n.encodeXML(f)),f;}function P(v){return"<![CDATA["+v.children[0].data+"]]>";}function S(v){return"<!--"+v.data+"-->";}},/* 258 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});function e(n){return n.type==="tag"||n.type==="script"||n.type==="style";}r.isTag=e,r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype";},/* 259 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decodeStrict=r.decode=void 0;var e=t(260),n=t(266);function i(m,l){return(!l||l<=0?e.decodeXML:e.decodeHTML)(m);}r.decode=i;function a(m,l){return(!l||l<=0?e.decodeXML:e.decodeHTMLStrict)(m);}r.decodeStrict=a;function o(m,l){return(!l||l<=0?n.encodeXML:n.encodeHTML)(m);}r.encode=o;var s=t(266);Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function get(){return s.encodeXML;}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function get(){return s.escape;}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function get(){return s.encodeHTML;}});var c=t(260);Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function get(){return c.decodeXML;}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function get(){return c.decodeXML;}});},/* 260 *//***/function(h,r,t){var e=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{"default":l};};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeHTML=r.decodeHTMLStrict=r.decodeXML=void 0;var n=e(t(261)),i=e(t(262)),a=e(t(263)),o=e(t(264));r.decodeXML=s(a["default"]),r.decodeHTMLStrict=s(n["default"]);function s(l){var p=Object.keys(l).join("|"),y=m(l);p+="|#[xX][\\da-fA-F]+|#\\d+";var P=new RegExp("&(?:"+p+");","g");return function(S){return String(S).replace(P,y);};}var c=function c(l,p){return l<p?1:-1;};r.decodeHTML=function(){for(var l=Object.keys(i["default"]).sort(c),p=Object.keys(n["default"]).sort(c),y=0,P=0;y<p.length;y++)l[P]===p[y]?(p[y]+=";?",P++):p[y]+=";";var S=new RegExp("&(?:"+p.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),v=m(n["default"]);function T(f){return f.substr(-1)!==";"&&(f+=";"),v(f);}return function(f){return String(f).replace(S,T);};}();function m(l){return function(y){if(y.charAt(1)==="#"){var P=y.charAt(2);return P==="X"||P==="x"?o["default"](parseInt(y.substr(3),16)):o["default"](parseInt(y.substr(2),10));}return l[y.slice(1,-1)];};}},/* 261 *//***/function(h){h.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(h){h.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(h){h.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 *//***/function(h,r,t){var e=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{"default":a};};Object.defineProperty(r,"__esModule",{value:!0});var n=e(t(265));function i(a){if(a>=55296&&a<=57343||a>1114111)return"�";a in n["default"]&&(a=n["default"][a]);var o="";return a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),o;}r["default"]=i;},/* 265 *//***/function(h){h.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(h,r,t){var e=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{"default":T};};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=m(n["default"]),a=l(i);r.encodeXML=P(i,a);var o=e(t(261)),s=m(o["default"]),c=l(s);r.encodeHTML=P(s,c);function m(T){return Object.keys(T).sort().reduce(function(f,d){return f[T[d]]="&"+d+";",f;},{});}function l(T){for(var f=[],d=[],u=0,g=Object.keys(T);u<g.length;u++){var M=g[u];M.length===1?f.push("\\"+M):d.push(M);}f.sort();for(var C=0;C<f.length-1;C++){for(var A=C;A<f.length-1&&f[A].charCodeAt(1)+1===f[A+1].charCodeAt(1);)A+=1;var L=1+A-C;L<3||f.splice(C,L,f[C]+"-"+f[A]);}return d.unshift("["+f.join("")+"]"),new RegExp(d.join("|"),"g");}var p=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function y(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";";}function P(T,f){return function(d){return d.replace(f,function(u){return T[u];}).replace(p,y);};}var S=l(i);function v(T){return T.replace(S,y).replace(p,y);}r.escape=v;},/* 267 *//***/function(h){h.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(h,r){var t=r.getChildren=function(n){return n.children;},e=r.getParent=function(n){return n.parent;};r.getSiblings=function(n){var i=e(n);return i?t(i):[n];},r.getAttributeValue=function(n,i){return n.attribs&&n.attribs[i];},r.hasAttrib=function(n,i){return!!n.attribs&&hasOwnProperty.call(n.attribs,i);},r.getName=function(n){return n.name;};},/* 269 *//***/function(h,r){r.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var e=t.parent.children;e.splice(e.lastIndexOf(t),1);}},r.replaceElement=function(t,e){var n=e.prev=t.prev;n&&(n.next=e);var i=e.next=t.next;i&&(i.prev=e);var a=e.parent=t.parent;if(a){var o=a.children;o[o.lastIndexOf(t)]=e;}},r.appendChild=function(t,e){if(e.parent=t,t.children.push(e)!==1){var n=t.children[t.children.length-2];n.next=e,e.prev=n,e.next=null;}},r.append=function(t,e){var n=t.parent,i=t.next;if(e.next=i,e.prev=t,t.next=e,e.parent=n,i){if(i.prev=e,n){var a=n.children;a.splice(a.lastIndexOf(i),0,e);}}else n&&n.children.push(e);},r.prepend=function(t,e){var n=t.parent;if(n){var i=n.children;i.splice(i.lastIndexOf(t),0,e);}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e;};},/* 270 *//***/function(h,r,t){var e=t(256).isTag;h.exports={filter:n,find:i,findOneChild:a,findOne:o,existsOne:s,findAll:c};function n(m,l,p,y){return Array.isArray(l)||(l=[l]),(typeof y!="number"||!isFinite(y))&&(y=1/0),i(m,l,p!==!1,y);}function i(m,l,p,y){for(var P=[],S,v=0,T=l.length;v<T&&!(m(l[v])&&(P.push(l[v]),--y<=0)||(S=l[v].children,p&&S&&S.length>0&&(S=i(m,S,p,y),P=P.concat(S),y-=S.length,y<=0)));v++);return P;}function a(m,l){for(var p=0,y=l.length;p<y;p++)if(m(l[p]))return l[p];return null;}function o(m,l){for(var p=null,y=0,P=l.length;y<P&&!p;y++)if(e(l[y]))m(l[y])?p=l[y]:l[y].children.length>0&&(p=o(m,l[y].children));else continue;return p;}function s(m,l){for(var p=0,y=l.length;p<y;p++)if(e(l[p])&&(m(l[p])||l[p].children.length>0&&s(m,l[p].children)))return!0;return!1;}function c(m,l){for(var p=[],y=l.slice();y.length;){var P=y.shift();e(P)&&(P.children&&P.children.length>0&&y.unshift.apply(y,P.children),m(P)&&p.push(P));}return p;}},/* 271 *//***/function(h,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(s,c){for(var m in s)if(s.hasOwnProperty(m)){if(m==="tag_name"){if(!n(c)||!s.tag_name(c.name))return!1;}else if(m==="tag_type"){if(!s.tag_type(c.type))return!1;}else if(m==="tag_contains"){if(n(c)||!s.tag_contains(c.data))return!1;}else if(!c.attribs||!s[m](c.attribs[m]))return!1;}return!0;};var i={tag_name:function tag_name(s){return typeof s=="function"?function(c){return n(c)&&s(c.name);}:s==="*"?n:function(c){return n(c)&&c.name===s;};},tag_type:function tag_type(s){return typeof s=="function"?function(c){return s(c.type);}:function(c){return c.type===s;};},tag_contains:function tag_contains(s){return typeof s=="function"?function(c){return!n(c)&&s(c.data);}:function(c){return!n(c)&&c.data===s;};}};function a(s,c){return typeof c=="function"?function(m){return m.attribs&&c(m.attribs[s]);}:function(m){return m.attribs&&m.attribs[s]===c;};}function o(s,c){return function(m){return s(m)||c(m);};}r.getElements=function(s,c,m,l){var p=Object.keys(s).map(function(y){var P=s[y];return y in i?i[y](P):a(y,P);});return p.length===0?[]:this.filter(p.reduce(o),c,m,l);},r.getElementById=function(s,c,m){return Array.isArray(c)||(c=[c]),this.findOne(a("id",s),c,m!==!1);},r.getElementsByTagName=function(s,c,m,l){return this.filter(i.tag_name(s),c,m,l);},r.getElementsByTagType=function(s,c,m,l){return this.filter(i.tag_type(s),c,m,l);};},/* 272 *//***/function(h,r){r.removeSubsets=function(n){for(var i=n.length,a,o,s;--i>-1;){for(a=o=n[i],n[i]=null,s=!0;o;){if(n.indexOf(o)>-1){s=!1,n.splice(i,1);break;}o=o.parent;}s&&(n[i]=a);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},e=r.compareDocumentPosition=function(n,i){var a=[],o=[],s,c,m,l,p,y;if(n===i)return 0;for(s=n;s;)a.unshift(s),s=s.parent;for(s=i;s;)o.unshift(s),s=s.parent;for(y=0;a[y]===o[y];)y++;return y===0?t.DISCONNECTED:(c=a[y-1],m=c.children,l=a[y],p=o[y],m.indexOf(l)>m.indexOf(p)?c===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:c===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};r.uniqueSort=function(n){var i=n.length,a,o;for(n=n.slice();--i>-1;)a=n[i],o=n.indexOf(a),o>-1&&o<i&&n.splice(i,1);return n.sort(function(s,c){var m=e(s,c);return m&t.PRECEDING?-1:m&t.FOLLOWING?1:0;}),n;};},/* 273 *//***/function(h,r){h.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 *//***/function(h,r,t){h.exports=p;var e=t(275).parse,n=t(273),i=t(278),a=t(279),o=t(280),s=t(282),c=n.trueFunc,m=n.falseFunc,l=s.filters;function p(O,w,b){var I=P(O,w,b);return y(I,w);}function y(O,w){var b=w.adapter;return function(R){return b.isTag(R)&&O(R);};}function P(O,w,b){var I=e(O,w);return g(I,w,b);}function S(O){return O.type==="pseudo"&&(O.name==="scope"||Array.isArray(O.data)&&O.data.some(function(w){return w.some(S);}));}var v={type:"descendant"},T={type:"_flexibleDescendant"},f={type:"pseudo",name:"scope"},d={};function u(O,w,b){var I=w.adapter,R=!!b&&!!b.length&&b.every(function(W){return W===d||!!I.getParent(W);});O.forEach(function(W){if(!(W.length>0&&M(W[0])&&W[0].type!=="descendant"))if(R&&!(Array.isArray(W)?W.some(S):S(W)))W.unshift(v);else return;W.unshift(f);});}function g(O,w,b){O=O.filter(function(z){return z.length>0;}),O.forEach(i);var I=Array.isArray(b);b=w&&w.context||b,b&&!I&&(b=[b]),u(O,w,b);var R=!1,W=O.map(function(z){if(z[0]&&z[1]&&z[0].name==="scope"){var K=z[1].type;I&&K==="descendant"?z[1]=T:(K==="adjacent"||K==="sibling")&&(R=!0);}return C(z,w,b);}).reduce(A,m);return W.shouldTestNextSiblings=R,W;}function M(O){return a[O.type]<0;}function C(O,w,b){return O.reduce(function(I,R){if(I===m)return I;if(!(R.type in o))throw new Error("Rule type "+R.type+" is not supported by css-select");return o[R.type](I,R,w,b);},w&&w.rootFunc||c);}function A(O,w){return w===m||O===c?O:O===m||w===c?w:function(I){return O(I)||w(I);};}function L(O){return O.some(M);}l.not=function(O,w,b,I){var R={xmlMode:!!(b&&b.xmlMode),strict:!!(b&&b.strict),adapter:b.adapter};if(R.strict&&(w.length>1||w.some(L)))throw new Error("complex selectors in :not aren't allowed in strict mode");var W=g(w,R,I);return W===m?O:W===c?m:function(K){return!W(K)&&O(K);};},l.has=function(O,w,b){var I=b.adapter,R={xmlMode:!!(b&&b.xmlMode),strict:!!(b&&b.strict),adapter:I},W=w.some(L)?[d]:null,z=g(w,R,W);return z===m?m:z===c?function(J){return I.getChildren(J).some(I.isTag)&&O(J);}:(z=y(z,b),W?function(J){return O(J)&&(W[0]=J,I.existsOne(z,I.getChildren(J)));}:function(J){return O(J)&&I.existsOne(z,I.getChildren(J));});},l.matches=function(O,w,b,I){var R={xmlMode:!!(b&&b.xmlMode),strict:!!(b&&b.strict),rootFunc:O,adapter:b.adapter};return g(w,R,I);},p.compileToken=g,p.compileUnsafe=P,p.Pseudos=s;},/* 275 *//***/function(h,r,t){var e=this&&this.__createBinding||(Object.create?function(o,s,c,m){m===void 0&&(m=c),Object.defineProperty(o,m,{enumerable:!0,get:function get(){return s[c];}});}:function(o,s,c,m){m===void 0&&(m=c),o[m]=s[c];}),n=this&&this.__exportStar||function(o,s){for(var c in o)c!=="default"&&!s.hasOwnProperty(c)&&e(s,o,c);};Object.defineProperty(r,"__esModule",{value:!0}),n(t(276),r);var i=t(276);Object.defineProperty(r,"parse",{enumerable:!0,get:function get(){return i["default"];}});var a=t(277);Object.defineProperty(r,"stringify",{enumerable:!0,get:function get(){return a["default"];}});},/* 276 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=S;var e=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,a={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},s={"#":["id","equals"],".":["class","element"]},c=/* @__PURE__ */new Set(["has","not","matches"]),m=/* @__PURE__ */new Set(["contains","icontains"]),l=/* @__PURE__ */new Set(['"',"'"]);function p(f,d,u){var g=parseInt(d,16)-65536;return g!==g||u?d:g<0?// BMP codepoint
|
|
351
|
+
String.fromCharCode(g+65536):// Supplemental Plane codepoint (surrogate pair)
|
|
352
|
+
String.fromCharCode(g>>10|55296,g&1023|56320);}function y(f){return f.replace(n,p);}function P(f){return f===" "||f==="\n"||f===" "||f==="\f"||f==="\r";}function S(f,d){var u=[];if(f=v(u,""+f,d),f!=="")throw new Error("Unmatched selector: "+f);return u;}function v(f,d,u){var g=[],M=!1;function C(){var Z=d.match(e);if(!Z)throw new Error("Expected name, found "+d);var rt=Z[0];return d=d.substr(rt.length),y(rt);}function A(Z){for(;P(d.charAt(Z));)Z++;d=d.substr(Z);}function L(Z){for(var rt=0;d.charAt(--Z)==="\\";)rt++;return(rt&1)===1;}for(A(0);d!=="";){var O=d.charAt(0);if(P(O))M=!0,A(1);else if(O in o)g.push({type:o[O]}),M=!1,A(1);else if(O===","){if(g.length===0)throw new Error("Empty sub-selector");f.push(g),g=[],M=!1,A(1);}else if(M&&(g.length>0&&g.push({type:"descendant"}),M=!1),O==="*")d=d.substr(1),g.push({type:"universal"});else if(O in s){var w=s[O],b=w[0],I=w[1];d=d.substr(1),g.push({type:"attribute",name:b,action:I,value:C(),ignoreCase:!1});}else if(O==="["){d=d.substr(1);var R=d.match(i);if(!R)throw new Error("Malformed attribute selector: "+d);d=d.substr(R[0].length);var W=y(R[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),g.push({type:"attribute",name:W,action:a[R[2]],value:y(R[4]||R[5]||""),ignoreCase:!!R[6]});}else if(O===":"){if(d.charAt(1)===":"){d=d.substr(2),g.push({type:"pseudo-element",name:C().toLowerCase()});continue;}d=d.substr(1);var z=C().toLowerCase(),R=null;if(d.charAt(0)==="(")if(c.has(z)){var K=d.charAt(1),J=l.has(K);if(d=d.substr(J?2:1),R=[],d=v(R,d,u),J){if(d.charAt(0)!==K)throw new Error("Unmatched quotes in :"+z);d=d.substr(1);}if(d.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+z+" ("+d+")");d=d.substr(1);}else{for(var q=1,U=1;U>0&&q<d.length;q++)d.charAt(q)==="("&&!L(q)?U++:d.charAt(q)===")"&&!L(q)&&U--;if(U)throw new Error("Parenthesis not matched");if(R=d.substr(1,q-2),d=d.substr(q),m.has(z)){var K=R.charAt(0);K===R.slice(-1)&&l.has(K)&&(R=R.slice(1,-1)),R=y(R);}}g.push({type:"pseudo",name:z,data:R});}else if(e.test(d)){var G=C();(!u||("lowerCaseTags"in u?u.lowerCaseTags:!u.xmlMode))&&(G=G.toLowerCase()),g.push({type:"tag",name:G});}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),T(f,g),d;}return T(f,g),d;}function T(f,d){if(f.length>0&&d.length===0)throw new Error("Empty sub-selector");f.push(d);}},/* 277 *//***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(s){return s.map(i).join(", ");}r["default"]=n;function i(s){return s.map(a).join("");}function a(s){switch(s.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return s.name;case"pseudo-element":return"::"+s.name;case"pseudo":return s.data===null?":"+s.name:typeof s.data=="string"?":"+s.name+"("+s.data+")":":"+s.name+"("+n(s.data)+")";case"attribute":return s.action==="exists"?"["+s.name+"]":s.name==="id"&&s.action==="equals"&&!s.ignoreCase?"#"+s.value:s.name==="class"&&s.action==="element"&&!s.ignoreCase?"."+s.value:"["+s.name+e[s.action]+"='"+s.value+"'"+(s.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(s){return s;}},/* 278 *//***/function(h,r,t){h.exports=i;var e=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function i(o){for(var s=o.map(a),c=1;c<o.length;c++){var m=s[c];if(!(m<0))for(var l=c-1;l>=0&&m<s[l];l--){var p=o[l+1];o[l+1]=o[l],o[l]=p,s[l+1]=s[l],s[l]=m;}}}function a(o){var s=e[o.type];if(s===e.attribute)s=n[o.action],s===n.equals&&o.name==="id"&&(s=9),o.ignoreCase&&(s>>=1);else if(s===e.pseudo)if(!o.data)s=3;else if(o.name==="has"||o.name==="contains")s=0;else if(o.name==="matches"||o.name==="not"){s=0;for(var c=0;c<o.data.length;c++)if(o.data[c].length===1){var m=a(o.data[c][0]);if(m===0){s=0;break;}m>s&&(s=m);}o.data.length>1&&s>0&&(s-=1);}else s=1;return s;}},/* 279 *//***/function(h){h.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 *//***/function(h,r,t){var e=t(281),n=t(282);h.exports={__proto__:null,attribute:e.compile,pseudo:n.compile,//tags
|
|
353
|
+
tag:function tag(i,a,o){var s=a.name,c=o.adapter;return function(l){return c.getName(l)===s&&i(l);};},//traversal
|
|
354
|
+
descendant:function descendant(i,a,o){var s=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,c=o.adapter;return function(l){for(var p=!1;!p&&(l=c.getParent(l));)(!s||!s.has(l))&&(p=i(l),!p&&s&&s.add(l));return p;};},_flexibleDescendant:function _flexibleDescendant(i,a,o){var s=o.adapter;return function(m){for(var l=i(m);!l&&(m=s.getParent(m));)l=i(m);return l;};},parent:function parent(i,a,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var s=o.adapter;return function(l){return s.getChildren(l).some(c);};function c(m){return s.isTag(m)&&i(m);}},child:function child(i,a,o){var s=o.adapter;return function(m){var l=s.getParent(m);return!!l&&i(l);};},sibling:function sibling(i,a,o){var s=o.adapter;return function(m){for(var l=s.getSiblings(m),p=0;p<l.length;p++)if(s.isTag(l[p])){if(l[p]===m)break;if(i(l[p]))return!0;}return!1;};},adjacent:function adjacent(i,a,o){var s=o.adapter;return function(m){for(var l=s.getSiblings(m),p,y=0;y<l.length;y++)if(s.isTag(l[y])){if(l[y]===m)break;p=l[y];}return!!p&&i(p);};},universal:function universal(i){return i;}};},/* 281 *//***/function(h,r,t){var e=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(a,o,s){var c=o.name,m=o.value,l=s.adapter;return o.ignoreCase?(m=m.toLowerCase(),function(y){var P=l.getAttributeValue(y,c);return P!=null&&P.toLowerCase()===m&&a(y);}):function(y){return l.getAttributeValue(y,c)===m&&a(y);};},hyphen:function hyphen(a,o,s){var c=o.name,m=o.value,l=m.length,p=s.adapter;return o.ignoreCase?(m=m.toLowerCase(),function(P){var S=p.getAttributeValue(P,c);return S!=null&&(S.length===l||S.charAt(l)==="-")&&S.substr(0,l).toLowerCase()===m&&a(P);}):function(P){var S=p.getAttributeValue(P,c);return S!=null&&S.substr(0,l)===m&&(S.length===l||S.charAt(l)==="-")&&a(P);};},element:function element(a,o,s){var c=o.name,m=o.value,l=s.adapter;if(/\s/.test(m))return e;m=m.replace(n,"\\$&");var p="(?:^|\\s)"+m+"(?:$|\\s)",y=o.ignoreCase?"i":"",P=new RegExp(p,y);return function(v){var T=l.getAttributeValue(v,c);return T!=null&&P.test(T)&&a(v);};},exists:function exists(a,o,s){var c=o.name,m=s.adapter;return function(p){return m.hasAttrib(p,c)&&a(p);};},start:function start(a,o,s){var c=o.name,m=o.value,l=m.length,p=s.adapter;return l===0?e:o.ignoreCase?(m=m.toLowerCase(),function(P){var S=p.getAttributeValue(P,c);return S!=null&&S.substr(0,l).toLowerCase()===m&&a(P);}):function(P){var S=p.getAttributeValue(P,c);return S!=null&&S.substr(0,l)===m&&a(P);};},end:function end(a,o,s){var c=o.name,m=o.value,l=-m.length,p=s.adapter;return l===0?e:o.ignoreCase?(m=m.toLowerCase(),function(P){var S=p.getAttributeValue(P,c);return S!=null&&S.substr(l).toLowerCase()===m&&a(P);}):function(P){var S=p.getAttributeValue(P,c);return S!=null&&S.substr(l)===m&&a(P);};},any:function any(a,o,s){var c=o.name,m=o.value,l=s.adapter;if(m==="")return e;if(o.ignoreCase){var p=new RegExp(m.replace(n,"\\$&"),"i");return function(P){var S=l.getAttributeValue(P,c);return S!=null&&p.test(S)&&a(P);};}return function(P){var S=l.getAttributeValue(P,c);return S!=null&&S.indexOf(m)>=0&&a(P);};},not:function not(a,o,s){var c=o.name,m=o.value,l=s.adapter;return m===""?function(y){return!!l.getAttributeValue(y,c)&&a(y);}:o.ignoreCase?(m=m.toLowerCase(),function(y){var P=l.getAttributeValue(y,c);return P!=null&&P.toLowerCase()!==m&&a(y);}):function(y){return l.getAttributeValue(y,c)!==m&&a(y);};}};h.exports={compile:function compile(a,o,s){if(s&&s.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return i[o.action](a,o,s);},rules:i};},/* 282 *//***/function(h,r,t){var e=t(283),n=t(273),i=t(281),a=n.trueFunc,o=n.falseFunc,s=i.rules.equals;function c(T,f){var d={name:T,value:f};return function(g,M,C){return s(g,d,C);};}function m(T,f){return function(d){return!!f.getParent(d)&&T(d);};}var l={contains:function contains(T,f,d){var u=d.adapter;return function(M){return T(M)&&u.getText(M).indexOf(f)>=0;};},icontains:function icontains(T,f,d){var u=f.toLowerCase(),g=d.adapter;return function(C){return T(C)&&g.getText(C).toLowerCase().indexOf(u)>=0;};},//location specific methods
|
|
355
|
+
"nth-child":function nthChild(T,f,d){var u=e(f),g=d.adapter;return u===o?u:u===a?m(T,g):function(C){for(var A=g.getSiblings(C),L=0,O=0;L<A.length;L++)if(g.isTag(A[L])){if(A[L]===C)break;O++;}return u(O)&&T(C);};},"nth-last-child":function nthLastChild(T,f,d){var u=e(f),g=d.adapter;return u===o?u:u===a?m(T,g):function(C){for(var A=g.getSiblings(C),L=0,O=A.length-1;O>=0;O--)if(g.isTag(A[O])){if(A[O]===C)break;L++;}return u(L)&&T(C);};},"nth-of-type":function nthOfType(T,f,d){var u=e(f),g=d.adapter;return u===o?u:u===a?m(T,g):function(C){for(var A=g.getSiblings(C),L=0,O=0;O<A.length;O++)if(g.isTag(A[O])){if(A[O]===C)break;g.getName(A[O])===g.getName(C)&&L++;}return u(L)&&T(C);};},"nth-last-of-type":function nthLastOfType(T,f,d){var u=e(f),g=d.adapter;return u===o?u:u===a?m(T,g):function(C){for(var A=g.getSiblings(C),L=0,O=A.length-1;O>=0;O--)if(g.isTag(A[O])){if(A[O]===C)break;g.getName(A[O])===g.getName(C)&&L++;}return u(L)&&T(C);};},//TODO determine the actual root element
|
|
356
|
+
root:function root(T,f,d){var u=d.adapter;return function(g){return!u.getParent(g)&&T(g);};},scope:function scope(T,f,d,u){var g=d.adapter;if(!u||u.length===0)return l.root(T,f,d);function M(C,A){return typeof g.equals=="function"?g.equals(C,A):C===A;}return u.length===1?function(C){return M(u[0],C)&&T(C);}:function(C){return u.indexOf(C)>=0&&T(C);};},//jQuery extensions (others follow as pseudos)
|
|
357
|
+
checkbox:c("type","checkbox"),file:c("type","file"),password:c("type","password"),radio:c("type","radio"),reset:c("type","reset"),image:c("type","image"),submit:c("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
|
|
358
|
+
hover:function hover(T,f,d){var u=d.adapter;return typeof u.isHovered=="function"?function(M){return T(M)&&u.isHovered(M);}:o;},visited:function visited(T,f,d){var u=d.adapter;return typeof u.isVisited=="function"?function(M){return T(M)&&u.isVisited(M);}:o;},active:function active(T,f,d){var u=d.adapter;return typeof u.isActive=="function"?function(M){return T(M)&&u.isActive(M);}:o;}};function p(T,f){for(var d=0;T&&d<T.length;d++)if(f.isTag(T[d]))return T[d];}var y={empty:function empty(T,f){return!f.getChildren(T).some(function(d){return f.isTag(d)||d.type==="text";});},"first-child":function firstChild(T,f){return p(f.getSiblings(T),f)===T;},"last-child":function lastChild(T,f){for(var d=f.getSiblings(T),u=d.length-1;u>=0;u--){if(d[u]===T)return!0;if(f.isTag(d[u]))break;}return!1;},"first-of-type":function firstOfType(T,f){for(var d=f.getSiblings(T),u=0;u<d.length;u++)if(f.isTag(d[u])){if(d[u]===T)return!0;if(f.getName(d[u])===f.getName(T))break;}return!1;},"last-of-type":function lastOfType(T,f){for(var d=f.getSiblings(T),u=d.length-1;u>=0;u--)if(f.isTag(d[u])){if(d[u]===T)return!0;if(f.getName(d[u])===f.getName(T))break;}return!1;},"only-of-type":function onlyOfType(T,f){for(var d=f.getSiblings(T),u=0,g=d.length;u<g;u++)if(f.isTag(d[u])){if(d[u]===T)continue;if(f.getName(d[u])===f.getName(T))return!1;}return!0;},"only-child":function onlyChild(T,f){for(var d=f.getSiblings(T),u=0;u<d.length;u++)if(f.isTag(d[u])&&d[u]!==T)return!1;return!0;},//:matches(a, area, link)[href]
|
|
359
|
+
link:function link(T,f){return f.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,f){if(f.hasAttrib(T,"selected"))return!0;if(f.getName(T)!=="option")return!1;var d=f.getParent(T);if(!d||f.getName(d)!=="select"||f.hasAttrib(d,"multiple"))return!1;for(var u=f.getChildren(d),g=!1,M=0;M<u.length;M++)if(f.isTag(u[M]))if(u[M]===T)g=!0;else if(g){if(f.hasAttrib(u[M],"selected"))return!1;}else return!1;return g;},//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,f){return f.hasAttrib(T,"disabled");},enabled:function enabled(T,f){return!f.hasAttrib(T,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
370
|
+
checked:function checked(T,f){return f.hasAttrib(T,"checked")||y.selected(T,f);},//:matches(input, select, textarea)[required]
|
|
371
|
+
required:function required(T,f){return f.hasAttrib(T,"required");},//:matches(input, select, textarea):not([required])
|
|
372
|
+
optional:function optional(T,f){return!f.hasAttrib(T,"required");},//jQuery extensions
|
|
373
|
+
//:not(:empty)
|
|
374
|
+
parent:function parent(T,f){return!y.empty(T,f);},//:matches(h1, h2, h3, h4, h5, h6)
|
|
375
|
+
header:P(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
|
|
376
|
+
button:function button(T,f){var d=f.getName(T);return d==="button"||d==="input"&&f.getAttributeValue(T,"type")==="button";},//:matches(input, textarea, select, button)
|
|
377
|
+
input:P(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
|
|
378
|
+
text:function text(T,f){var d;return f.getName(T)==="input"&&(!(d=f.getAttributeValue(T,"type"))||d.toLowerCase()==="text");}};function P(T){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var f=new Set(T);return function(d,u){return f.has(u.getName(d));};}return function(d,u){return T.indexOf(u.getName(d))>=0;};}function S(T,f,d){if(d===null){if(T.length>2&&f!=="scope")throw new Error("pseudo-selector :"+f+" requires an argument");}else if(T.length===2)throw new Error("pseudo-selector :"+f+" doesn't have any arguments");}var v=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;h.exports={compile:function compile(T,f,d,u){var g=f.name,M=f.data,C=d.adapter;if(d&&d.strict&&!v.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof l[g]=="function")return l[g](T,M,d,u);if(typeof y[g]=="function"){var A=y[g];return S(A,g,M),A===o?A:T===a?function(O){return A(O,C,M);}:function(O){return A(O,C,M)&&T(O);};}else throw new Error("unmatched pseudo-class :"+g);},filters:l,pseudos:y};},/* 283 *//***/function(h,r,t){var e=t(284),n=t(285);h.exports=function(a){return n(e(a));},h.exports.parse=e,h.exports.compile=n;},/* 284 *//***/function(h,r){h.exports=e;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function e(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var a;return i[1]?(a=parseInt(i[1],10),isNaN(a)&&(i[1].charAt(0)==="-"?a=-1:a=1)):a=0,[a,i[3]?parseInt((i[2]||"")+i[3],10):0];}},/* 285 *//***/function(h,r,t){h.exports=a;var e=t(273),n=e.trueFunc,i=e.falseFunc;function a(o){var s=o[0],c=o[1]-1;if(c<0&&s<=0)return i;if(s===-1)return function(l){return l<=c;};if(s===0)return function(l){return l===c;};if(s===1)return c<0?n:function(l){return l>=c;};var m=c%s;return m<0&&(m+=s),s>1?function(l){return l>=c&&l%s===m;}:(s*=-1,function(l){return l<=c&&l%s===m;});}},/* 286 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return M;});var e=t(12),n=t(74),i=t(1),a=t(68),o=t(250),s=t(213),c=t(218);t(1).glMatrix.setMatrixArrayType(Array);function m(C,A){if(C==null)return{};var L=l(C,A),O,w;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(C);for(w=0;w<b.length;w++)O=b[w],!(A.indexOf(O)>=0)&&Object.prototype.propertyIsEnumerable.call(C,O)&&(L[O]=C[O]);}return L;}function l(C,A){if(C==null)return{};var L={},O=Object.keys(C),w,b;for(b=0;b<O.length;b++)w=O[b],!(A.indexOf(w)>=0)&&(L[w]=C[w]);return L;}var p={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
379
|
+
},y=Symbol("autoRender"),P=Symbol("renderer"),S=Symbol("timeline"),v=Symbol("prepareRender"),T=Symbol("tickRender"),f=Symbol("pass"),d=Symbol("fbo"),u=Symbol("tickers"),g=Symbol("layerTransformInvert");var M=/*#__PURE__*/function(_o$default){function M(){var _this49;var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this49=_callSuper(this,M),!A.canvas){var _this49$getResolution=_this49.getResolution(),b=_this49$getResolution.width,I=_this49$getResolution.height,R=e.ENV.createCanvas(b,I,{offscreen:!!A.offscreen,id:A.id,extra:A.extra});R.style&&(R.style.position="absolute"),R.dataset&&(R.dataset.layerId=A.id),R.contextType&&(A.contextType=R.contextType),A.canvas=R;}var L=A.canvas,O=Object.assign({},p,A);_this49[y]=O.autoRender,delete A.autoRender;var w=O.Renderer||e.Renderer;_this49[P]=new w(L,O),_this49.options=A,_this49.id=A.id,_this49[f]=[],_this49.setResolution(L),_this49.canvas=L,_this49[S]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[g]=null;return _this49;}_inherits(M,_o$default);return _createClass(M,[{key:"autoRender",get:function get(){return this[y];}},{key:"displayRatio",get:function get(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1;}},{key:"height",get:function get(){var _this$getResolution=this.getResolution(),A=_this$getResolution.height;return A/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[f];}},{key:"prepareRender",get:function get(){return this[v]?this[v]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[P];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,A=_this$parent$options.left,L=_this$parent$options.top;return[A,L];}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(),A=_this$getResolution2.width;return A/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,A=_this$attributes21.x,L=_this$attributes21.y;return[1,0,0,1,A,L];}},{key:"layerTransformInvert",get:function get(){if(this[g])return this[g];var A=this.transformMatrix;return A[0]===1&&A[1]===0&&A[2]===0&&A[3]===1&&A[4]===0&&A[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),A),this[g]);}},{key:"forceContextLoss",value:function forceContextLoss(){var A=this.renderer.glRenderer;if(A){var L=A.getExtension("WEBGL_lose_context");if(L)return L.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
|
|
380
|
+
// return true;
|
|
381
|
+
// }
|
|
382
|
+
},{key:"addPass",value:function addPass(){var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},A=_ref151.vertex,L=_ref151.fragment,O=_ref151.options,w=_ref151.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),b=_this$getResolution3.width,I=_this$getResolution3.height,R=this.renderer.createPassProgram({vertex:A,fragment:L,options:O}),W=new e.Figure2D();W.rect(0,0,b/this.displayRatio,I/this.displayRatio);var z=new e.Mesh2D(W);return z.setUniforms(w),z.setProgram(R),this[f].push(z),this.forceUpdate(),z;}return null;}// delete unused texture to release memory.
|
|
383
|
+
},{key:"deleteTexture",value:function deleteTexture(A){return Object(c.deleteTexture)(A,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(A){var L=A.type;if(L==="mousedown"||L==="mouseup"||L==="mousemove"){var R=this.__mouseCapturedTarget;if(R){if(R.layer===this)return R.dispatchEvent(A),!0;this.__mouseCapturedTarget=null;}}var O,w;var b=this.layerTransformInvert;if(b){O=A.x,w=A.y;var _R6=b,W=_R6[0]*O+_R6[2]*w+_R6[4],z=_R6[1]*O+_R6[3]*w+_R6[5];delete A.x,delete A.y,delete A.layerX,delete A.layerY,Object.defineProperties(A,{layerX:{value:W,configurable:!0},layerY:{value:z,configurable:!0},x:{value:W,configurable:!0},y:{value:z,configurable:!0}});}var I=_superPropGet(M,"dispatchPointerEvent",this,3)([A]);return b&&Object.defineProperties(A,{layerX:{value:O,configurable:!0},layerY:{value:w,configurable:!0},x:{value:O,configurable:!0},y:{value:w,configurable:!0}}),I;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this50=this;if(!this[v])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var A=null;var L=new Promise(function(O){A=O;});L._resolve=A,this[v]=L;}else{var _A2=null,_L8=null;var O=new Promise(function(w){_A2=w,_this50[y]&&(_L8=Object(a.requestAnimationFrame)(function(){delete O._requestID,_this50.render();}));});O._resolve=_A2,O._requestID=_L8,this[v]=O;}}},{key:"getFBO",value:function getFBO(){var A=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),L=_this$getResolution4.width,O=_this$getResolution4.height;return A&&(!this[d]||this[d].width!==L||this[d].height!==O)?(this[d]={width:L,height:O,target:A.createFBO(),buffer:A.createFBO(),swap:function swap(){var _ref152=[this.buffer,this.target];this.target=_ref152[0];this.buffer=_ref152[1];}},this[d]):this[d]?this[d]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var A=this.renderer,L=A.__globalTransformMatrix||A.globalTransformMatrix;A.__globalTransformMatrix=L;var O=i.mat2d.fromValues(1,0,0,1,0,0);A.setGlobalTransform.apply(A,_toConsumableArray(i.mat2d.multiply(O,L,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(A,L,O){if(_superPropGet(M,"onPropertyChange",this,3)([A,L,O]),A==="zIndex"&&(this.canvas.style.zIndex=L),A==="transform"||A==="translate"||A==="rotate"||A==="scale"||A==="skew"){var w=this[g];if(this[g]=null,this.updateGlobalTransform(),w&&!this.layerTransformInvert){var b=this.renderer,I=b.__globalTransformMatrix||b.globalTransformMatrix;b.setGlobalTransform.apply(b,_toConsumableArray(I));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[v]&&(this[v]._requestID&&Object(a.cancelAnimationFrame)(this[v]._requestID),this[v]._resolve(),delete this[v]);}},{key:"render",value:function render(){var _this51=this;var _ref153=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref153$clear=_ref153.clear,A=_ref153$clear===void 0?!0:_ref153$clear;var L=this[f].length?this.getFBO():null;L&&this.renderer.glRenderer.bindFBO(L.target),A&&this[P].clear();var O=this.draw();if(O&&O.length&&(this.renderer.drawMeshes(O),this.canvas.draw&&this.canvas.draw()),L){var w=this.renderer.glRenderer,b=this[f].length,_this$getResolution5=this.getResolution(),I=_this$getResolution5.width,R=_this$getResolution5.height,W=[0,0,I/this.displayRatio,R/this.displayRatio];this[f].forEach(function(z,K){z.blend=!0,z.setTexture(L.target.texture,{rect:W}),K===b-1?w.bindFBO(null):(L.swap(),w.bindFBO(L.target)),_this51[P].clear(),_this51.renderer.drawMeshes([z]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref154){var _this52=this;var A=_ref154.width,L=_ref154.height;var O=this.renderer,w=O.__globalTransformMatrix||O.globalTransformMatrix,b=w[4],I=w[5],R=w[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,z=_this$getResolution6.height;(W!==A||z!==L)&&(_superPropGet(M,"setResolution",this,3)([{width:A,height:L}]),this.canvas&&(this.canvas.width=A,this.canvas.height=L,O.updateResolution&&O.updateResolution()),this.attributes.size=[A,L],this[f].length&&this[f].forEach(function(U){var G=new e.Figure2D();G.rect(0,0,A/_this52.displayRatio,L/_this52.displayRatio),U.contours=G.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),K=_this$renderOffset[0],J=_this$renderOffset[1],q=this.displayRatio;(b!==K||I!==J||R!==q)&&(O.setGlobalTransform(q,0,0,q,K,J),O.__globalTransformMatrix=null,this[g]=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 A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _L$duration=L.duration,O=_L$duration===void 0?1/0:_L$duration,w=m(L,["duration"]);var b=this.timeline.fork(w),I=this;this[u]=this[u]||[],this[u].push({handler:A,duration:O});var _R7=function R(){var W=null,z=null;var K=function K(){var J=_this53[u].map(function(_ref155){var q=_ref155.handler,U=_ref155.duration;var G=Math.min(1,b.currentTime/U);return{value:q?q(b.currentTime,G):null,p:G};});I[T]||(I[T]=Promise.resolve().then(function(){I[y]&&I.render(),delete I[T];for(var q=J.length-1;q>=0;q--){var _J$q=J[q],U=_J$q.value,G=_J$q.p;(U===!1||G>=1)&&_this53[u].splice(q,1);}_this53[u].length>0&&_R7();}));};if(_this53[v]&&_this53[v]._type!=="ticker"&&(Object(a.cancelAnimationFrame)(_this53[v]._requestID),delete _this53[v]),!_this53[v]){var J=new Promise(function(q){W=q,z=Object(a.requestAnimationFrame)(K);});J._resolve=W,J._requestID=z,J._type="ticker",_this53[v]=J;}};_R7();}},{key:"toGlobalPos",value:function toGlobalPos(A,L){if(this.layerTransformInvert){var W=this.transformMatrix;A=W[0]*A+W[2]*L+W[4],L=W[1]*A+W[3]*L+W[5];}var _this$getResolution7=this.getResolution(),O=_this$getResolution7.width,w=_this$getResolution7.height,b=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];A=A*I[0]/O+b[0],L=L*I[1]/w+b[1];var R=this.displayRatio;return A*=R,L*=R,[A,L];}},{key:"toLocalPos",value:function toLocalPos(A,L){var _this$getResolution8=this.getResolution(),O=_this$getResolution8.width,w=_this$getResolution8.height,b=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];A=A*O/I[0]-b[0],L=L*w/I[1]-b[1];var R=this.displayRatio;A/=R,L/=R;var W=this.layerTransformInvert;return W&&(A=W[0]*A+W[2]*L+W[4],L=W[1]*A+W[3]*L+W[5]),[A,L];}}]);}(o["default"]);s["default"].registerNode(M,"layer");},/* 287 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return v;});var e=t(224),n=t(288),i=t(213),a=t(252),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(T,f){if(T==null)return{};var d=c(T,f),u,g;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(g=0;g<M.length;g++)u=M[g],!(f.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(T,u)&&(d[u]=T[u]);}return d;}function c(T,f){if(T==null)return{};var d={},u=Object.keys(T),g,M;for(M=0;M<u.length;M++)g=u[M],!(f.indexOf(g)>=0)&&(d[g]=T[g]);return d;}function m(T,f,d){return f in T?Object.defineProperty(T,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):T[f]=d,T;}var l="http://www.w3.org/2000/svg",p=Symbol["for"]("spritejs_setAttribute"),y=Symbol("root"),P=Symbol("task");function S(T){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var d=T[y];if(d&&d.children[0]){var u=T.svg,g=T.layer?T.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){var A=u.getAttribute("width");A=A?Object(o.sizeToPixel)(A):300;var L=u.getAttribute("height");L=L?Object(o.sizeToPixel)(L):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox","0 0 ".concat(Math.round(A)," ").concat(Math.round(L))),u.setAttribute("data-original-width",A),u.setAttribute("data-original-height",L);}var M=T.attributes.width||Number(u.getAttribute("data-original-width")),C=T.attributes.height||Number(u.getAttribute("data-original-height"));if(M*=g,C*=g,f&&T.attributes.flexible){var _A3=T.attributes.scale[0];if(M*=_A3,C*=_A3,u.setAttribute("width",M),u.setAttribute("height",C),M&&C&&T.textureImage){var _L9=T.textureImage.width,O=T.textureImage.height,w=T.clientSize;T.attributes.textureRect=[0,0,Math.round(w[0]*_L9/M),Math.round(w[1]*O/C)];}}else T[P]||(u.setAttribute("width",M),u.setAttribute("height",C),T[P]=Promise.resolve().then(function(){delete T[P];var A=d.innerHTML,L=new Blob([A],{type:"image/svg+xml"}),O=URL.createObjectURL(L),w=new Image();w.onload=function(){w.width&&w.height?(T.attributes[p]("texture",w),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[p]("texture",null);},w.src=O;}));}}var v=/*#__PURE__*/function(_e$default21){function v(){var _this54;var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,v);typeof f=="string"&&(f={svgText:f});var _f25=f,d=_f25.svgText,u=s(f,["svgText"]);if(_this54=_callSuper(this,v,[u]),_this54[y]=document.createElement("div"),d){_this54[y].innerHTML=d;var g=_this54[y].children[0];g?g.setAttribute("xmlns",l):(fetch(d).then(function(M){return M.text();}).then(function(M){_this54[y].innerHTML=M,(!_this54.observer||_this54.attributes.flexible)&&S(_assertThisInitialized(_this54));}),d=null);}if(!d){var _g8=document.createElementNS(l,"svg");_g8.setAttribute("xmlns",l),_this54[y].appendChild(_g8);}if(typeof MutationObserver=="function"){var _g9=new MutationObserver(function(M){S(_this54,!1);});_g9.observe(_this54[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_g9;}return _this54;}_inherits(v,_e$default21);return _createClass(v,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[y]?this[y].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref156){var f=_ref156.width,d=_ref156.height;_superPropGet(v,"setResolution",this,3)([{width:f,height:d}]),S(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(f){var d=_superPropGet(v,"dispatchPointerEvent",this,3)([f]);if(d&&this.attributes.passEvents&&typeof MouseEvent=="function"){var u=f.x,g=f.y;var _this$getOffsetPositi=this.getOffsetPosition(u,g),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),M=_this$getOffsetPositi2[0],C=_this$getOffsetPositi2[1];var A=f.originalEvent,L=this.attributes.anchor,O=this.clientSize;M=(M+L[0]*O[0])/2,C=(C+L[1]*O[1])/2;var w=f.type;if(w===A.type){var b=null;if(A instanceof MouseEvent)b=new MouseEvent(w,{screenX:M,screenY:C,clientX:M,clientY:C,bubbles:A.bubbles,button:A.button,buttons:A.buttons,cancelBubble:A.cancelBubble,cancelable:A.cancelable,currentTarget:A.currentTarget,fromElement:A.fromElement,relatedTarget:A.relatedTarget,returnValue:A.returnValue,srcElement:A.srcElement,target:A.target,toElement:A.toElement,// view: originalEvent.view,
|
|
388
|
+
which:A.witch});else if(A instanceof TouchEvent){var I=null;var R=A.changedTouches||[A];for(var W=0;W<R.length;W++){var z=R[W];if(f.identifier===z.identifier){I=z;break;}}if(I){var _W3=new Touch({identifier:I.identifier,target:I.target,clientX:M,clientY:C,screenX:M,screenY:C,pageX:M,pageY:C,radiusX:I.radiusX,radiusY:I.radiusY,rotationAngle:I.rotationAngle,force:I.force});b=new TouchEvent(w,{cancelable:A.cancelable,bubbles:A.bubbles,composed:A.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else b=A;b&&this.svg.dispatchEvent(b);}}return d;}},{key:"getElementById",value:function getElementById(f){return Object(a.querySelector)("#".concat(f),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(f){return Object(a.querySelectorAll)(".".concat(f),this);}},{key:"getElementsByName",value:function getElementsByName(f){return Object(a.querySelectorAll)("[name=\"".concat(f,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(f){return Object(a.querySelectorAll)(f,this);}},{key:"querySelector",value:function querySelector(f){return Object(a.querySelector)(f,this);}},{key:"querySelectorAll",value:function querySelectorAll(f){return Object(a.querySelectorAll)(f,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(f,d,u){_superPropGet(v,"onPropertyChange",this,3)([f,d,u]),f==="flexible"&&S(this),this.attributes.flexible&&(f==="width"||f==="height"||f==="scale"||f==="transform")&&S(this);}}]);}(e["default"]);m(v,"Attr",n["default"]),i["default"].registerNode(v,"spritesvg");},/* 288 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault");var o=/*#__PURE__*/function(_e$default22){function o(c){var _this55;_classCallCheck(this,o);_this55=_callSuper(this,o,[c]),_this55[a]({passEvents:!1,flexible:!1});return _this55;}// readonly
|
|
389
|
+
_inherits(o,_e$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(c){}// eslint-disable-line no-empty-function
|
|
390
|
+
},{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(c){return this[i]("passEvents",c);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(c){return this[i]("flexible",c);}}]);}(e["default"]);},/* 289 *//***/function(h,r,t){t.r(r);var e=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(c,m){var l=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);m&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable;})),l.push.apply(l,p);}return l;}function i(c){for(var m=1;m<arguments.length;m++){var l=arguments[m]!=null?arguments[m]:{};m%2?n(Object(l),!0).forEach(function(p){a(c,p,l[p]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(l)):n(Object(l)).forEach(function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(l,p));});}return c;}function a(c,m,l){return m in c?Object.defineProperty(c,m,{value:l,enumerable:!0,configurable:!0,writable:!0}):c[m]=l,c;}var o=Symbol("inited");var s=null;typeof Worker=="function"&&(s=/*#__PURE__*/function(_Worker){function s(c){var _this56;_classCallCheck(this,s);if(c.worker===!0&&(c.worker="./".concat(c.id,".worker.js")),_this56=_callSuper(this,s,[c.worker]),_this56.options=c,!c.canvas){var _this56$getResolution=_this56.getResolution(),m=_this56$getResolution.width,l=_this56$getResolution.height,p=e.ENV.createCanvas(m,l,{offscreen:!1});p.style&&(p.style.position="absolute"),p.dataset&&(p.dataset.layerId=c.id),c.canvas=p;}_this56.canvas=c.canvas;return _this56;}_inherits(s,_Worker);return _createClass(s,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref157){var c=_ref157.width,m=_ref157.height;if(this[o])this.postMessage({type:"resolution_change",width:c,height:m});else{this.canvas.width=c,this.canvas.height=m;var l=this.options,p=l.canvas.transferControlToOffscreen(),y=i({},l);delete y.container,y.canvas=p,this.postMessage({type:"create",options:y},[p]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,c=_this$canvas6.width,m=_this$canvas6.height;return{width:c,height:m};}return{width:300,height:150};}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"connect",value:function connect(c,m){Object.defineProperty(this,"parent",{value:c,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:m,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(c){this.postMessage({type:"event",event:{cancelBubble:c.cancelBubble,bubbles:c.bubbles,detail:c.detail,identifier:c.identifier,layerX:c.layerX,layerY:c.layerY,originalX:c.originalX,originalY:c.originalY,type:c.type,x:c.x,y:c.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),r["default"]=s;},/* 290 *//***/function(h,r,t){t.r(r),function(e){t.d(r,"default",function(){return M;});var n=t(12),i=t(68),a=t(70),o=t(286),s=t(289),c=t(250),m=t(291),l=t(214),p=t(218),y=t(213);t(1).glMatrix.setMatrixArrayType(Array);var P=Symbol("enteredTargets");function S(C){return C.id=C.id||"_layer".concat(Math.random().toString(36).slice(2,12)),C.dataset||(C.dataset={}),C.dataset.layerId=C.id,C.connect=function(A,L){C.parent=A,Object.defineProperty(C,"zOrder",{value:L,writable:!1,configurable:!0});},C.disconnect=function(A){delete C.zOrder;},C.canvas=C,C.getResolution=function(){return{width:0,height:0};},C.setResolution=function(){return!1;},C.options={handleEvent:!1},C;}function v(C,A){var L=C.children;var O=null;for(var w=0;w<L.length;w++){var b=L[w];if((A===b||O!=null)&&(O=b),O&&O!==A&&!O.offscreen)return O.canvas;}return null;}function T(C,A){var _C$renderOffset=_slicedToArray(C.renderOffset,2),L=_C$renderOffset[0],O=_C$renderOffset[1],_C$getResolution=C.getResolution(),w=_C$getResolution.width,b=_C$getResolution.height,I=C.displayRatio;C.renderer.drawImage(A.canvas,-L/I,-O/I,w/I,b/I);}var f={};function d(C){var A=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],L=C.container;L.addEventListener("mouseleave",function(O){var w=C[P];if(w.size){var b=new l["default"]("mouseleave");b.setOriginalEvent(O),_toConsumableArray(w).forEach(function(I){I.dispatchEvent(b);}),C[P].clear();}},{passive:!0}),A.forEach(function(O){L.addEventListener(O,function(w){var _C$options=C.options,b=_C$options.left,I=_C$options.top,R=_C$options.displayRatio,W=C.orderedChildren;Object(m["default"])(w,{offsetLeft:b,offsetTop:I,displayRatio:R}).forEach(function(K){var J=K.identifier;if(K.type==="touchmove"||K.type==="touchend"){var U=f[J];U&&U.dispatchEvent(K),K.type==="touchend"&&delete f[J];}else{for(var _U=W.length-1;_U>=0;_U--){var G=W[_U];if(G.options.handleEvent!==!1){if(G.dispatchPointerEvent(K)&&K.target!==G)break;K.cancelBubble=!1;}}if(K.target===W[0])for(var _U2=W.length-1;_U2>=0;_U2--){var _G=W[_U2];if(_G.options.handleEvent!==!1){K.target=_G;break;}}}var q=K.target;if(K.type==="touchstart"&&(f[J]=K.target),K.type==="mousemove"){var _U3=C[P];var _G2;if(q){var et=q.ancestors||[];_G2=/* @__PURE__ */new Set([q].concat(_toConsumableArray(et)));}else _G2=/* @__PURE__ */new Set();var Z=Object.entries(w);if(!_U3.has(q)&&q){var _et2=new l["default"]("mouseenter");_et2.setOriginalEvent(w),Z.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),X=_ref159[0],ct=_ref159[1];_et2[X]=ct;}),_U3.add(q),q.dispatchEvent(_et2);var it=q.ancestors;it&&it.forEach(function(X){X instanceof a["default"]&&!_U3.has(X)&&(_U3.add(X),X.dispatchEvent(_et2));});}var rt=new l["default"]("mouseleave");rt.setOriginalEvent(w),Z.forEach(function(_ref160){var _ref161=_slicedToArray(_ref160,2),et=_ref161[0],it=_ref161[1];rt[et]=it;}),_toConsumableArray(_U3).forEach(function(et){_G2.has(et)||(_U3["delete"](et),et.dispatchEvent(rt));});}});},{passive:O!=="contextmenu"});});}function u(C,A){if(A&&A.style){var L=C.width,O=C.height,w=C.mode,b=C.container;var I=b.clientWidth,R=b.clientHeight;L=L||I,O=O||R,w==="static"?(A.style.width="".concat(L,"px"),A.style.height="".concat(O,"px")):(A.style.top="0",A.style.left="0",A.style.width="".concat(I,"px"),A.style.height="".concat(R,"px"),A.style.transform="",A.style.webkitTransform="");}}var g=Symbol("offscreenLayerCount");var M=/*#__PURE__*/function(_c$default){/**
|
|
391
|
+
width
|
|
392
|
+
height
|
|
393
|
+
mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
|
|
394
|
+
*/function M(){var _this57;var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this57=_callSuper(this,M),!A.container)if(typeof n.ENV.Container=="function")A.container=new n.ENV.Container(A.width||300,A.height||150);else throw new Error("No container specified.");if(_this57.container=A.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.options=A,A.displayRatio=A.displayRatio||1,A.mode=A.mode||"scale",A.left=0,A.top=0,A.autoResize=A.autoResize!==!1,A.autoResize){var L;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?L=globalThis:L=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:e,L.addEventListener){var O=_this57;L.addEventListener("resize",function w(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(O.container)?O.resize():L.removeEventListener("resize",w);});}}_this57[P]=/* @__PURE__ */new Set(),_this57.setResolution(A),d(_this57),_this57[g]=0;return _this57;}_inherits(M,_c$default);return _createClass(M,[{key:"hasOffscreenCanvas",get:function get(){return this[g]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(A){this.options.displayRatio!==A&&(this.options.displayRatio=A,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(A){this.options.height!==A&&(this.options.height=A,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(A){this.options.mode!==A&&(this.options.mode=A,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(A){this.options.width!==A&&(this.options.width=A,this.resize());}},{key:"appendChild",value:function appendChild(A){!(A instanceof o["default"])&&!(A instanceof s["default"])&&S(A);var L=_superPropGet(M,"appendChild",this,3)([A]),O=A.canvas;return A.offscreen?this[g]++:this.container.appendChild(O),u(this.options,O),A.setResolution(this.getResolution()),L;}/* 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(A,L){!(A instanceof o["default"])&&!(A instanceof s["default"])&&S(A);var O=_superPropGet(M,"insertBefore",this,3)([A,L]),w=A.canvas;if(!A.offscreen){var b=v(this,A);this.container.insertBefore(w,b);}return u(this.options,w),A.setResolution(this.getResolution()),O;}},{key:"layer",value:function layer(){var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};L=Object.assign({},this.options,L),L.id=A;var O=this.orderedChildren;for(var I=0;I<O.length;I++)if(O[I].id===A)return O[I];var w=L.worker;var b;return w?b=new s["default"](L):b=new o["default"](L),this.appendChild(b),b;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(){var _this59=this;var _len13,A,_key13,L,O,w,_loop2,b,_args21=arguments;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:for(_len13=_args21.length,A=new Array(_len13),_key13=0;_key13<_len13;_key13++){A[_key13]=_args21[_key13];}L=[],O=[],w=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(b){var I,R,W,z;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:I=A[b];if(typeof I=="string")R=Object(p.loadTexture)(I);else if(Array.isArray(I))R=Object(p.loadFrames).apply(void 0,_toConsumableArray(I));else{W=I.id,z=I.src;R=Object(p.loadTexture)(z,W);}R instanceof Promise||(R=Promise.resolve(R)),O.push(R.then(function(W){L.push(W),w[b]=W;var z=new l["default"]({type:"preload",detail:{current:W,loaded:L,resources:A}});_this59.dispatchEvent(z);}));case 3:case"end":return _context20.stop();}},_loop2);});b=0;case 4:if(!(b<A.length)){_context21.next=9;break;}return _context21.delegateYield(_loop2(b),"t0",6);case 6:b++;_context21.next=4;break;case 9:_context21.next=11;return Promise.all(O);case 11:return _context21.abrupt("return",w);case 12:case"end":return _context21.stop();}},_callee20);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(A){var L=_superPropGet(M,"removeChild",this,3)([A]);if(L){A._prepareRenderFinished&&A._prepareRenderFinished();var O=A.canvas;O&&O.remove&&O.remove(),A.offscreen&&this[g]--;}return L;}// for offscreen mode rendering
|
|
395
|
+
},{key:"render",value:function render(){var A=this.orderedChildren;var L=null;var O=[];for(var w=0;w<A.length;w++){var b=A[w],I=O.length>0;if(b instanceof o["default"]&&!b.offscreen){if(!b.autoRender)I&&(console.warn("Some offscreen canvas will not be rendered."),O.length=0);else if(L=b,I){b.renderer.clear();for(var R=0;R<O.length;R++){var W=O[R];W.render(),T(b,W);}O.length=0,b.render({clear:!1});}else b.prepareRender&&b.render();}else b.offscreen?L?(b.prepareRender&&b.render(),T(L,b)):O.push(b):b instanceof s["default"]&&I&&(console.warn("Some offscreen canvas will not be rendered."),O.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(A,L){var O=_superPropGet(M,"replaceChild",this,3)([A,L]);L.canvas.remove&&L.canvas.remove(),L.offscreen&&this[g]--;var w=A.canvas;if(!A.offscreen){var b=v(this,A);this.container.insertBefore(w,b);}return u(this.options,w),A.setResolution(this.getResolution()),O;}},{key:"resize",value:function resize(){var A=this.options;this.children.forEach(function(L){u(A,L.canvas);}),this.setResolution(A),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _A4,_L10;var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},A=_ref162.width,L=_ref162.height;var O=this.container,w=O.clientWidth,b=O.clientHeight;(A==null||L==null)&&(A=(_A4=A)!==null&&_A4!==void 0?_A4:w,L=(_L10=L)!==null&&_L10!==void 0?_L10:b);var _this$options=this.options,I=_this$options.mode,R=_this$options.displayRatio;if(A*=R,L*=R,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var W=A;A=w*L/b,I==="stickyHeight"&&(this.options.left=0.5*(A-W)),I==="stickyRight"&&(this.options.left=A-W);}else if(I==="stickyWidth"||I==="stickyTop"||I==="stickyBottom"){var _W4=L;L=b*A/w,I==="stickyWidth"&&(this.options.top=0.5*(L-_W4)),I==="stickyBottom"&&(this.options.top=L-_W4);}_superPropGet(M,"setResolution",this,3)([{width:A,height:L}]);}},{key:"snapshot",value:function snapshot(){var _ref163=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref163$offscreen=_ref163.offscreen,A=_ref163$offscreen===void 0?!1:_ref163$offscreen,L=_ref163.layers;var O=A?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),w=_this$getResolution9.width,b=_this$getResolution9.height;this[O]=this[O]||n.ENV.createCanvas(w,b,{offscreen:A});var I=this[O].getContext("2d");L=L||this.orderedChildren,this[O].width=w,this[O].height=b;for(var R=0;R<L.length;R++){var W=L[R];if(!W.options.ignoreSnapshot){W.render&&W.render();var z=W.canvas;z&&z!==W&&I.drawImage(z,0,0,w,b);}}return this[O];}}]);}(c["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(M.prototype.layer3d=function(C){var _this60=this;var A=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var L=A.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(O,w){var b=document.createElement("script");b.async=!1,b.src=L,b.onload=function(){try{O(_this60.layer3d(C,A));}catch(I){w(I);}},document.documentElement.appendChild(b);});}),y["default"].registerNode(M,"scene");}.call(this,t(22));},/* 291 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref164=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref164$offsetTop=_ref164.offsetTop,a=_ref164$offsetTop===void 0?0:_ref164$offsetTop,_ref164$offsetLeft=_ref164.offsetLeft,o=_ref164$offsetLeft===void 0?0:_ref164$offsetLeft,_ref164$displayRatio=_ref164.displayRatio,s=_ref164$displayRatio===void 0?1:_ref164$displayRatio;var c,m;var l=[],_i$target$getBounding=i.target.getBoundingClientRect(),p=_i$target$getBounding.left,y=_i$target$getBounding.top,P=_i$target$getBounding.width,S=_i$target$getBounding.height,v=i.target.width,T=i.target.height,f=i.changedTouches||[i];for(var u=0;u<f.length;u++){var g=f[u],M=g.identifier,C=g.clientX,A=g.clientY;C!=null&&A!=null&&l.push({x:Math.round((C|0)-p),y:Math.round((A|0)-y),identifier:M});}l.length<=0&&l.push({x:c,y:m});var d=[];return l.forEach(function(u){u.x!=null&&u.y!=null&&(c=(u.x*v/P-o)/s,m=(u.y*T/S-a)/s);var g=new e["default"](i);Object.defineProperties(g,{layerX:{value:c,configurable:!0},layerY:{value:m,configurable:!0},originalX:{value:u.x},originalY:{value:u.y},x:{value:c,configurable:!0},y:{value:m,configurable:!0},identifier:{value:u.identifier}}),d.push(g);}),d;}}/******/]);Bt.version;Bt.Arc;Bt.Block;Bt.Cloud;Bt.Color;var es=Bt.Ellipse;Bt.Gradient;var Qt=Bt.Group,rs=Bt.Label,ns=Bt.Layer;Bt.LayerWorker;Bt.Node;Bt.Parallel;var le=Bt.Path,ue=Bt.Polyline,Yr=Bt.Rect;Bt.Regular;Bt.Ring;var is=Bt.Scene,jn=Bt.Sprite;Bt.SpriteSvg;Bt.Star;Bt.Triangle;Bt.helpers;Bt.createElement;Bt.isSpriteNode;Bt.registerNode;Bt.requestAnimationFrame;Bt.cancelAnimationFrame;Bt.ENV;var ze=(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 de(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h["default"]:h;}var ss=_typeof(ze)=="object"&&ze&&ze.Object===Object&&ze,$n=ss,os=$n,as=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ls=os||as||Function("return this")(),ie=ls,cs=ie,fs=cs.Symbol,je=fs,Vr=je,zn=Object.prototype,hs=zn.hasOwnProperty,us=zn.toString,De=Vr?Vr.toStringTag:void 0;function ds(h){var r=hs.call(h,De),t=h[De];try{h[De]=void 0;var e=!0;}catch(_unused18){}var n=us.call(h);return e&&(r?h[De]=t:delete h[De]),n;}var ps=ds,gs=Object.prototype,ms=gs.toString;function vs(h){return ms.call(h);}var ys=vs,kr=je,Ss=ps,xs=ys,Ts="[object Null]",Ms="[object Undefined]",Xr=kr?kr.toStringTag:void 0;function Ps(h){return h==null?h===void 0?Ms:Ts:Xr&&Xr in Object(h)?Ss(h):xs(h);}var me=Ps;function Os(h){return h!=null&&_typeof(h)=="object";}var oe=Os,Es=me,Cs=oe,As="[object Number]";function Rs(h){return typeof h=="number"||Cs(h)&&Es(h)==As;}var Is=Rs,kt=/* @__PURE__ */de(Is);function ws(){this.__data__=[],this.size=0;}var Ls=ws;function bs(h,r){return h===r||h!==h&&r!==r;}var Pr=bs,Ds=Pr;function Ns(h,r){for(var t=h.length;t--;)if(Ds(h[t][0],r))return t;return-1;}var nr=Ns,Ws=nr,Bs=Array.prototype,Fs=Bs.splice;function Us(h){var r=this.__data__,t=Ws(r,h);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():Fs.call(r,t,1),--this.size,!0;}var js=Us,$s=nr;function zs(h){var r=this.__data__,t=$s(r,h);return t<0?void 0:r[t][1];}var Gs=zs,Hs=nr;function Ks(h){return Hs(this.__data__,h)>-1;}var Ys=Ks,Vs=nr;function ks(h,r){var t=this.__data__,e=Vs(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var Xs=ks,Js=Ls,Zs=js,Qs=Gs,qs=Ys,_s=Xs;function Ce(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}Ce.prototype.clear=Js;Ce.prototype["delete"]=Zs;Ce.prototype.get=Qs;Ce.prototype.has=qs;Ce.prototype.set=_s;var ir=Ce,to=ir;function eo(){this.__data__=new to(),this.size=0;}var ro=eo;function no(h){var r=this.__data__,t=r["delete"](h);return this.size=r.size,t;}var io=no;function so(h){return this.__data__.get(h);}var oo=so;function ao(h){return this.__data__.has(h);}var lo=ao;function co(h){var r=_typeof(h);return h!=null&&(r=="object"||r=="function");}var pe=co,fo=me,ho=pe,uo="[object AsyncFunction]",po="[object Function]",go="[object GeneratorFunction]",mo="[object Proxy]";function vo(h){if(!ho(h))return!1;var r=fo(h);return r==po||r==go||r==uo||r==mo;}var Gn=vo,yo=ie,So=yo["__core-js_shared__"],xo=So,fr=xo,Jr=function(){var h=/[^.]+$/.exec(fr&&fr.keys&&fr.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:"";}();function To(h){return!!Jr&&Jr in h;}var Mo=To,Po=Function.prototype,Oo=Po.toString;function Eo(h){if(h!=null){try{return Oo.call(h);}catch(_unused19){}try{return h+"";}catch(_unused20){}}return"";}var Hn=Eo,Co=Gn,Ao=Mo,Ro=pe,Io=Hn,wo=/[\\^$.*+?()[\]{}|]/g,Lo=/^\[object .+?Constructor\]$/,bo=Function.prototype,Do=Object.prototype,No=bo.toString,Wo=Do.hasOwnProperty,Bo=RegExp("^"+No.call(Wo).replace(wo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fo(h){if(!Ro(h)||Ao(h))return!1;var r=Co(h)?Bo:Lo;return r.test(Io(h));}var Uo=Fo;function jo(h,r){return h==null?void 0:h[r];}var $o=jo,zo=Uo,Go=$o;function Ho(h,r){var t=Go(h,r);return zo(t)?t:void 0;}var ve=Ho,Ko=ve,Yo=ie,Vo=Ko(Yo,"Map"),Or=Vo,ko=ve,Xo=ko(Object,"create"),sr=Xo,Zr=sr;function Jo(){this.__data__=Zr?Zr(null):{},this.size=0;}var Zo=Jo;function Qo(h){var r=this.has(h)&&delete this.__data__[h];return this.size-=r?1:0,r;}var qo=Qo,_o=sr,ta="__lodash_hash_undefined__",ea=Object.prototype,ra=ea.hasOwnProperty;function na(h){var r=this.__data__;if(_o){var t=r[h];return t===ta?void 0:t;}return ra.call(r,h)?r[h]:void 0;}var ia=na,sa=sr,oa=Object.prototype,aa=oa.hasOwnProperty;function la(h){var r=this.__data__;return sa?r[h]!==void 0:aa.call(r,h);}var ca=la,fa=sr,ha="__lodash_hash_undefined__";function ua(h,r){var t=this.__data__;return this.size+=this.has(h)?0:1,t[h]=fa&&r===void 0?ha:r,this;}var da=ua,pa=Zo,ga=qo,ma=ia,va=ca,ya=da;function Ae(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}Ae.prototype.clear=pa;Ae.prototype["delete"]=ga;Ae.prototype.get=ma;Ae.prototype.has=va;Ae.prototype.set=ya;var Sa=Ae,Qr=Sa,xa=ir,Ta=Or;function Ma(){this.size=0,this.__data__={hash:new Qr(),map:new(Ta||xa)(),string:new Qr()};}var Pa=Ma;function Oa(h){var r=_typeof(h);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?h!=="__proto__":h===null;}var Ea=Oa,Ca=Ea;function Aa(h,r){var t=h.__data__;return Ca(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var or=Aa,Ra=or;function Ia(h){var r=Ra(this,h)["delete"](h);return this.size-=r?1:0,r;}var wa=Ia,La=or;function ba(h){return La(this,h).get(h);}var Da=ba,Na=or;function Wa(h){return Na(this,h).has(h);}var Ba=Wa,Fa=or;function Ua(h,r){var t=Fa(this,h),e=t.size;return t.set(h,r),this.size+=t.size==e?0:1,this;}var ja=Ua,$a=Pa,za=wa,Ga=Da,Ha=Ba,Ka=ja;function Re(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}Re.prototype.clear=$a;Re.prototype["delete"]=za;Re.prototype.get=Ga;Re.prototype.has=Ha;Re.prototype.set=Ka;var Kn=Re,Ya=ir,Va=Or,ka=Kn,Xa=200;function Ja(h,r){var t=this.__data__;if(t instanceof Ya){var e=t.__data__;if(!Va||e.length<Xa-1)return e.push([h,r]),this.size=++t.size,this;t=this.__data__=new ka(e);}return t.set(h,r),this.size=t.size,this;}var Za=Ja,Qa=ir,qa=ro,_a=io,tl=oo,el=lo,rl=Za;function Ie(h){var r=this.__data__=new Qa(h);this.size=r.size;}Ie.prototype.clear=qa;Ie.prototype["delete"]=_a;Ie.prototype.get=tl;Ie.prototype.has=el;Ie.prototype.set=rl;var Yn=Ie;function nl(h,r){for(var t=-1,e=h==null?0:h.length;++t<e&&r(h[t],t,h)!==!1;);return h;}var il=nl,sl=ve,ol=function(){try{var h=sl(Object,"defineProperty");return h({},"",{}),h;}catch(_unused21){}}(),Vn=ol,qr=Vn;function al(h,r,t){r=="__proto__"&&qr?qr(h,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):h[r]=t;}var kn=al,ll=kn,cl=Pr,fl=Object.prototype,hl=fl.hasOwnProperty;function ul(h,r,t){var e=h[r];(!(hl.call(h,r)&&cl(e,t))||t===void 0&&!(r in h))&&ll(h,r,t);}var Xn=ul,dl=Xn,pl=kn;function gl(h,r,t,e){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var o=r[i],s=e?e(t[o],h[o],o,t,h):void 0;s===void 0&&(s=h[o]),n?pl(t,o,s):dl(t,o,s);}return t;}var ar=gl;function ml(h,r){for(var t=-1,e=Array(h);++t<h;)e[t]=r(t);return e;}var vl=ml,yl=me,Sl=oe,xl="[object Arguments]";function Tl(h){return Sl(h)&&yl(h)==xl;}var Ml=Tl,_r=Ml,Pl=oe,Jn=Object.prototype,Ol=Jn.hasOwnProperty,El=Jn.propertyIsEnumerable,Cl=_r(/* @__PURE__ */function(){return arguments;}())?_r:function(h){return Pl(h)&&Ol.call(h,"callee")&&!El.call(h,"callee");},Zn=Cl,Al=Array.isArray,$e=Al,Ye={exports:{}};function Rl(){return!1;}var Il=Rl;Ye.exports;(function(h,r){var t=ie,e=Il,n=r&&!r.nodeType&&r,i=n&&!0&&h&&!h.nodeType&&h,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.isBuffer:void 0,c=s||e;h.exports=c;})(Ye,Ye.exports);var Er=Ye.exports,wl=9007199254740991,Ll=/^(?:0|[1-9]\d*)$/;function bl(h,r){var _r2;var t=_typeof(h);return r=(_r2=r)!==null&&_r2!==void 0?_r2:wl,!!r&&(t=="number"||t!="symbol"&&Ll.test(h))&&h>-1&&h%1==0&&h<r;}var Dl=bl,Nl=9007199254740991;function Wl(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=Nl;}var Qn=Wl,Bl=me,Fl=Qn,Ul=oe,jl="[object Arguments]",$l="[object Array]",zl="[object Boolean]",Gl="[object Date]",Hl="[object Error]",Kl="[object Function]",Yl="[object Map]",Vl="[object Number]",kl="[object Object]",Xl="[object RegExp]",Jl="[object Set]",Zl="[object String]",Ql="[object WeakMap]",ql="[object ArrayBuffer]",_l="[object DataView]",tc="[object Float32Array]",ec="[object Float64Array]",rc="[object Int8Array]",nc="[object Int16Array]",ic="[object Int32Array]",sc="[object Uint8Array]",oc="[object Uint8ClampedArray]",ac="[object Uint16Array]",lc="[object Uint32Array]",jt={};jt[tc]=jt[ec]=jt[rc]=jt[nc]=jt[ic]=jt[sc]=jt[oc]=jt[ac]=jt[lc]=!0;jt[jl]=jt[$l]=jt[ql]=jt[zl]=jt[_l]=jt[Gl]=jt[Hl]=jt[Kl]=jt[Yl]=jt[Vl]=jt[kl]=jt[Xl]=jt[Jl]=jt[Zl]=jt[Ql]=!1;function cc(h){return Ul(h)&&Fl(h.length)&&!!jt[Bl(h)];}var fc=cc;function hc(h){return function(r){return h(r);};}var lr=hc,Ve={exports:{}};Ve.exports;(function(h,r){var t=$n,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i&&t.process,o=function(){try{var s=n&&n.require&&n.require("util").types;return s||a&&a.binding&&a.binding("util");}catch(_unused22){}}();h.exports=o;})(Ve,Ve.exports);var Cr=Ve.exports,uc=fc,dc=lr,tn=Cr,en=tn&&tn.isTypedArray,pc=en?dc(en):uc,qn=pc,gc=vl,mc=Zn,vc=$e,yc=Er,Sc=Dl,xc=qn,Tc=Object.prototype,Mc=Tc.hasOwnProperty;function Pc(h,r){var t=vc(h),e=!t&&mc(h),n=!t&&!e&&yc(h),i=!t&&!e&&!n&&xc(h),a=t||e||n||i,o=a?gc(h.length,String):[],s=o.length;for(var c in h)(r||Mc.call(h,c))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
396
|
+
c=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
397
|
+
n&&(c=="offset"||c=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
398
|
+
i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||// Skip index properties.
|
|
399
|
+
Sc(c,s)))&&o.push(c);return o;}var _n=Pc,Oc=Object.prototype;function Ec(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Oc;return h===t;}var Ar=Ec;function Cc(h,r){return function(t){return h(r(t));};}var ti=Cc,Ac=ti,Rc=Ac(Object.keys,Object),Ic=Rc,wc=Ar,Lc=Ic,bc=Object.prototype,Dc=bc.hasOwnProperty;function Nc(h){if(!wc(h))return Lc(h);var r=[];for(var t in Object(h))Dc.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Wc=Nc,Bc=Gn,Fc=Qn;function Uc(h){return h!=null&&Fc(h.length)&&!Bc(h);}var Rr=Uc,jc=_n,$c=Wc,zc=Rr;function Gc(h){return zc(h)?jc(h):$c(h);}var Ir=Gc,Hc=ar,Kc=Ir;function Yc(h,r){return h&&Hc(r,Kc(r),h);}var Vc=Yc;function kc(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Xc=kc,Jc=pe,Zc=Ar,Qc=Xc,qc=Object.prototype,_c=qc.hasOwnProperty;function tf(h){if(!Jc(h))return Qc(h);var r=Zc(h),t=[];for(var e in h)e=="constructor"&&(r||!_c.call(h,e))||t.push(e);return t;}var ef=tf,rf=_n,nf=ef,sf=Rr;function of(h){return sf(h)?rf(h,!0):nf(h);}var wr=of,af=ar,lf=wr;function cf(h,r){return h&&af(r,lf(r),h);}var ff=cf,ke={exports:{}};ke.exports;(function(h,r){var t=ie,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i?t.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(c,m){if(m)return c.slice();var l=c.length,p=o?o(l):new c.constructor(l);return c.copy(p),p;}h.exports=s;})(ke,ke.exports);var hf=ke.exports;function uf(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var df=uf;function pf(h,r){for(var t=-1,e=h==null?0:h.length,n=0,i=[];++t<e;){var a=h[t];r(a,t,h)&&(i[n++]=a);}return i;}var ei=pf;function gf(){return[];}var ri=gf,mf=ei,vf=ri,yf=Object.prototype,Sf=yf.propertyIsEnumerable,rn=Object.getOwnPropertySymbols,xf=rn?function(h){return h==null?[]:(h=Object(h),mf(rn(h),function(r){return Sf.call(h,r);}));}:vf,Lr=xf,Tf=ar,Mf=Lr;function Pf(h,r){return Tf(h,Mf(h),r);}var Of=Pf;function Ef(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var br=Ef,Cf=ti,Af=Cf(Object.getPrototypeOf,Object),ni=Af,Rf=br,If=ni,wf=Lr,Lf=ri,bf=Object.getOwnPropertySymbols,Df=bf?function(h){for(var r=[];h;)Rf(r,wf(h)),h=If(h);return r;}:Lf,ii=Df,Nf=ar,Wf=ii;function Bf(h,r){return Nf(h,Wf(h),r);}var Ff=Bf,Uf=br,jf=$e;function $f(h,r,t){var e=r(h);return jf(h)?e:Uf(e,t(h));}var si=$f,zf=si,Gf=Lr,Hf=Ir;function Kf(h){return zf(h,Hf,Gf);}var oi=Kf,Yf=si,Vf=ii,kf=wr;function Xf(h){return Yf(h,kf,Vf);}var Jf=Xf,Zf=ve,Qf=ie,qf=Zf(Qf,"DataView"),_f=qf,th=ve,eh=ie,rh=th(eh,"Promise"),nh=rh,ih=ve,sh=ie,oh=ih(sh,"Set"),ai=oh,ah=ve,lh=ie,ch=ah(lh,"WeakMap"),fh=ch,gr=_f,mr=Or,vr=nh,yr=ai,Sr=fh,li=me,we=Hn,nn="[object Map]",hh="[object Object]",sn="[object Promise]",on="[object Set]",an="[object WeakMap]",ln="[object DataView]",uh=we(gr),dh=we(mr),ph=we(vr),gh=we(yr),mh=we(Sr),ge=li;(gr&&ge(new gr(new ArrayBuffer(1)))!=ln||mr&&ge(new mr())!=nn||vr&&ge(vr.resolve())!=sn||yr&&ge(new yr())!=on||Sr&&ge(new Sr())!=an)&&(ge=function ge(h){var r=li(h),t=r==hh?h.constructor:void 0,e=t?we(t):"";if(e)switch(e){case uh:return ln;case dh:return nn;case ph:return sn;case gh:return on;case mh:return an;}return r;});var cr=ge,vh=Object.prototype,yh=vh.hasOwnProperty;function Sh(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&yh.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var xh=Sh,Th=ie,Mh=Th.Uint8Array,ci=Mh,cn=ci;function Ph(h){var r=new h.constructor(h.byteLength);return new cn(r).set(new cn(h)),r;}var Dr=Ph,Oh=Dr;function Eh(h,r){var t=r?Oh(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Ch=Eh,Ah=/\w*$/;function Rh(h){var r=new h.constructor(h.source,Ah.exec(h));return r.lastIndex=h.lastIndex,r;}var Ih=Rh,fn=je,hn=fn?fn.prototype:void 0,un=hn?hn.valueOf:void 0;function wh(h){return un?Object(un.call(h)):{};}var Lh=wh,bh=Dr;function Dh(h,r){var t=r?bh(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var Nh=Dh,Wh=Dr,Bh=Ch,Fh=Ih,Uh=Lh,jh=Nh,$h="[object Boolean]",zh="[object Date]",Gh="[object Map]",Hh="[object Number]",Kh="[object RegExp]",Yh="[object Set]",Vh="[object String]",kh="[object Symbol]",Xh="[object ArrayBuffer]",Jh="[object DataView]",Zh="[object Float32Array]",Qh="[object Float64Array]",qh="[object Int8Array]",_h="[object Int16Array]",tu="[object Int32Array]",eu="[object Uint8Array]",ru="[object Uint8ClampedArray]",nu="[object Uint16Array]",iu="[object Uint32Array]";function su(h,r,t){var e=h.constructor;switch(r){case Xh:return Wh(h);case $h:case zh:return new e(+h);case Jh:return Bh(h,t);case Zh:case Qh:case qh:case _h:case tu:case eu:case ru:case nu:case iu:return jh(h,t);case Gh:return new e();case Hh:case Vh:return new e(h);case Kh:return Fh(h);case Yh:return new e();case kh:return Uh(h);}}var ou=su,au=pe,dn=Object.create,lu=/* @__PURE__ */function(){function h(){}return function(r){if(!au(r))return{};if(dn)return dn(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),cu=lu,fu=cu,hu=ni,uu=Ar;function du(h){return typeof h.constructor=="function"&&!uu(h)?fu(hu(h)):{};}var pu=du,gu=cr,mu=oe,vu="[object Map]";function yu(h){return mu(h)&&gu(h)==vu;}var Su=yu,xu=Su,Tu=lr,pn=Cr,gn=pn&&pn.isMap,Mu=gn?Tu(gn):xu,Pu=Mu,Ou=cr,Eu=oe,Cu="[object Set]";function Au(h){return Eu(h)&&Ou(h)==Cu;}var Ru=Au,Iu=Ru,wu=lr,mn=Cr,vn=mn&&mn.isSet,Lu=vn?wu(vn):Iu,fi=Lu,bu=/* @__PURE__ */de(fi),Du=Yn,Nu=il,Wu=Xn,Bu=Vc,Fu=ff,Uu=hf,ju=df,$u=Of,zu=Ff,Gu=oi,Hu=Jf,Ku=cr,Yu=xh,Vu=ou,ku=pu,Xu=$e,Ju=Er,Zu=Pu,Qu=pe,qu=fi,_u=Ir,td=wr,ed=1,rd=2,nd=4,hi="[object Arguments]",id="[object Array]",sd="[object Boolean]",od="[object Date]",ad="[object Error]",ui="[object Function]",ld="[object GeneratorFunction]",cd="[object Map]",fd="[object Number]",di="[object Object]",hd="[object RegExp]",ud="[object Set]",dd="[object String]",pd="[object Symbol]",gd="[object WeakMap]",md="[object ArrayBuffer]",vd="[object DataView]",yd="[object Float32Array]",Sd="[object Float64Array]",xd="[object Int8Array]",Td="[object Int16Array]",Md="[object Int32Array]",Pd="[object Uint8Array]",Od="[object Uint8ClampedArray]",Ed="[object Uint16Array]",Cd="[object Uint32Array]",Ut={};Ut[hi]=Ut[id]=Ut[md]=Ut[vd]=Ut[sd]=Ut[od]=Ut[yd]=Ut[Sd]=Ut[xd]=Ut[Td]=Ut[Md]=Ut[cd]=Ut[fd]=Ut[di]=Ut[hd]=Ut[ud]=Ut[dd]=Ut[pd]=Ut[Pd]=Ut[Od]=Ut[Ed]=Ut[Cd]=!0;Ut[ad]=Ut[ui]=Ut[gd]=!1;function He(h,r,t,e,n,i){var a,o=r&ed,s=r&rd,c=r&nd;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!Qu(h))return h;var m=Xu(h);if(m){if(a=Yu(h),!o)return ju(h,a);}else{var l=Ku(h),p=l==ui||l==ld;if(Ju(h))return Uu(h,o);if(l==di||l==hi||p&&!n){if(a=s||p?{}:ku(h),!o)return s?zu(h,Fu(a,h)):$u(h,Bu(a,h));}else{if(!Ut[l])return n?h:{};a=Vu(h,l,o);}}i||(i=new Du());var y=i.get(h);if(y)return y;i.set(h,a),qu(h)?h.forEach(function(v){a.add(He(v,r,t,v,h,i));}):Zu(h)&&h.forEach(function(v,T){a.set(T,He(v,r,t,T,h,i));});var P=c?s?Hu:Gu:s?td:_u,S=m?void 0:P(h);return Nu(S||h,function(v,T){S&&(T=v,v=h[T]),Wu(a,T,He(v,r,t,T,h,i));}),a;}var Ad=He,Rd=Ad,Id=1,wd=4;function Ld(h){return Rd(h,Id|wd);}var bd=Ld,Vt=/* @__PURE__ */de(bd);var pi="1.1.15-beta.2",Dd="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var h=window.__netlessUA||"";h+=" ".concat(Dd,"@").concat(pi),window.__netlessUA=h;}var _t={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:{combineUnitTime:100},pencilEraser:{useBitMap:!0,maxImageWidth:1024,maxImageHeight:1024},strokeWidth:{min:1,max:10}};function ae(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=h.length;if(t<2)return"";var e=h[0],n=h[1];if(t===2)return"M".concat(ye(e),"L").concat(ye(n));var i="";for(var a=2,o=t-1;a<o;a++)e=h[a],n=h[a+1],i+=Se(e,n);return r?"M".concat(Se(h[0],h[1]),"Q").concat(ye(h[1])).concat(Se(h[1],h[2]),"T").concat(i).concat(Se(h[t-1],h[0])).concat(Se(h[0],h[1]),"Z"):"M".concat(ye(h[0]),"Q").concat(ye(h[1])).concat(Se(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(ye(h[t-1]));}var Jt=/*#__PURE__*/function(){function Jt(r){_classCallCheck(this,Jt);tt(this,"maxImageWidth",_t.pencilEraser.maxImageWidth);tt(this,"maxImageHeight",_t.pencilEraser.maxImageHeight);tt(this,"syncUnitTime",_t.syncOpt.interval);tt(this,"vNodes");tt(this,"drawLayer");tt(this,"fullLayer");tt(this,"workId");tt(this,"isDelete",!1);var t=r.vNodes,e=r.fullLayer,n=r.drawLayer,i=r.workId,a=r.toolsOpt;this.vNodes=t,this.fullLayer=e,this.drawLayer=n,this.workId=i,this.syncUnitTime=a.syncUnitTime||this.syncUnitTime;}return _createClass(Jt,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return r.reduce(function(e,n){var i=e[e.length-1];return(n&&!i||n&&i&&!n.isNear(i,t))&&e.push(n),e;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(r){this.workId=r;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(r){var n,i,a;this.workOptions=r,this.syncUnitTime=r.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),e=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&e&&(e.opt=r,(a=this.vNodes)==null||a.setInfo(t,e));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(r){var n,i;var t;var e=(n=this.workId)==null?void 0:n.toString();if(e&&r){var a=this.fullLayer.getElementsByName(e)||this.drawLayer&&this.drawLayer.getElementsByName(e)||[];if(a.length!==1)return;var o=a[0],s=r.pos,c=r.zIndex,m=r.scale,l=r.angle,p=r.translate,y={};kt(c)&&(y.zIndex=c),s&&(y.pos=[s[0],s[1]]),m&&(y.scale=m),l&&(y.rotate=l),p&&(y.translate=p),o.attr(y);var P=o==null?void 0:o.getBoundingClientRect();return P&&(t=Pt(t,{x:Math.floor(P.x-Jt.SafeBorderPadding),y:Math.floor(P.y-Jt.SafeBorderPadding),w:Math.floor(P.width+Jt.SafeBorderPadding*2),h:Math.floor(P.height+Jt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(r,t){var e=r.group,n=r.eraserlines,i=r.pos,a=r.layer,o=a.parent;if(!t)return;var c=(a.renderer.glRenderer||a.renderer.canvasRenderer).options.displayRatio,m=e.getBoundingClientRect(),l=m.width*c*a.worldScaling[0],p=m.height*c*a.worldScaling[1];var y=1;(l>this.maxImageWidth||p>this.maxImageHeight)&&(y=Math.min(this.maxImageWidth/l,this.maxImageHeight/p));var P=a.getAttribute("scale");P=[P[0]*y,P[1]*y];var S=a.parent.parent,v=a.getAttribute("translate"),T=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),S,{offscreen:o.offscreen,width:o.width,height:o.height,contextType:"2d",autoRender:!1,// desynchronized: true,
|
|
400
|
+
bufferSize:500// depth: true,
|
|
401
|
+
},P,v),f=e.cloneNode(!0);this.addEraserlines(f,n,i,!1),T.appendChild(f);var d=T.parent;d.render();var u=T.renderer.canvasRenderer,g=u.options.displayRatio,M=this.getGroupRect(f,g),C=M.x,A=M.y,L=M.w,O=M.h,w=u.context;if(!w)return!1;var b=w.getImageData(C,A,L,O);var I=this.isTransparentRectByCanvas(b);if(se(f,d),S.removeChild(d),I){this.isDelete=!0,b=null;return;}se(e,o);var R=this.createSpriteNode(b,y,g,a.worldScaling);e.append(R),o.deleteTexture(b),b=null;}},{key:"createVmRenderNode",value:function createVmRenderNode(r,t,e,n,i){var a=e.width,o=e.height,s="bitMap-".concat(r),c=t.layer(s,e),m=new Qt({anchor:[0.5,0.5],pos:[a*0.5,o*0.5],size:[a,o],name:"viewport",id:r});return m.setAttribute("scale",n),m.setAttribute("translate",i),c.append(m),m;}},{key:"getGroupRect",value:function getGroupRect(r,t){var e=r.getBoundingClientRect(),n={x:Math.floor(e.x-Jt.SafeBorderPadding),y:Math.floor(e.y-Jt.SafeBorderPadding),w:Math.floor(e.width+Jt.SafeBorderPadding*2),h:Math.floor(e.height+Jt.SafeBorderPadding*2)},i=Math.floor(n.x*t),a=Math.floor(n.y*t),o=Math.floor(n.w*t),s=Math.floor(n.h*t);return{x:i,y:a,w:o,h:s};}},{key:"addEraserlines",value:function addEraserlines(r,t,e){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 a=i.thickness,o=i.op;var _iterator14=_createForOfIteratorHelper(o),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var s=_step14.value;var c=s.map(function(P,S){return S%2?P-e[1]:P-e[0];}),m=this.computEraserPoints(c,a),l=ae(m,!0),p={pos:[0,0],d:l,fillColor:"rgba(0,0,0,1)"},y=new le(p);y.addEventListener("beforerender",function(_ref165){var P=_ref165.detail;var S=P.context;n?S.blendFuncSeparate(S.ZERO,S.ZERO,S.ZERO,S.ZERO):S.globalCompositeOperation="destination-out";}),y.addEventListener("afterrender",function(_ref166){var P=_ref166.detail;var S=P.context;n?S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA):S.globalCompositeOperation="source-over";}),r.append(y);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(r){var t=!0;for(var _e3=0;_e3<r.data.length;_e3+=4)if(r.data[_e3+3]!==0){t=!1;break;}return t;}},{key:"createSpriteNode",value:function createSpriteNode(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[1,1];var i=new OffscreenCanvas(r.width,r.height),a=i.getContext("2d");a&&a.putImageData(r,0,0);var o={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:[r.width/e/n[0],r.height/e/n[1]],texture:i,scale:[1/t,1/t]};return new jn(o);}// private scaleImageData(imageData: ImageData, scale: number, ctx: CanvasRenderingContext2D) {
|
|
402
|
+
// const scaled = ctx.createImageData(imageData.width * scale, imageData.height * scale);
|
|
403
|
+
// for (let row = 0; row < imageData.height; row++) {
|
|
404
|
+
// for (let col = 0; col < imageData.width; col++) {
|
|
405
|
+
// const sourcePixel = [imageData.data[(row * imageData.width + col) * 4 + 0], imageData.data[(row * imageData.width + col) * 4 + 1], imageData.data[(row * imageData.width + col) * 4 + 2], imageData.data[(row * imageData.width + col) * 4 + 3]]
|
|
406
|
+
// for (let y = 0; y < scale; y++) {
|
|
407
|
+
// const destRow = Math.floor(row * scale) + y
|
|
408
|
+
// for (let x = 0; x < scale; x++) {
|
|
409
|
+
// const destCol = Math.floor(col * scale) + x
|
|
410
|
+
// for (let i = 0; i < 4; i++) {
|
|
411
|
+
// scaled.data[(destRow * scaled.width + destCol) * 4 + i] = sourcePixel[i]
|
|
412
|
+
// }
|
|
413
|
+
// }
|
|
414
|
+
// }
|
|
415
|
+
// }
|
|
416
|
+
// }
|
|
417
|
+
// return scaled
|
|
418
|
+
// }
|
|
419
|
+
},{key:"computEraserPoints",value:function computEraserPoints(r,t){var e=Math.ceil(t/2);return r.length===2?this.computDot(r,e):this.computLine(r,e);}},{key:"computDot",value:function computDot(r,t){var e=new xt(r[0],r[1]);return xt.GetDotStroke(e,t,8);}},{key:"computLine",value:function computLine(r,t){var e=[],n=[];var i,a;for(var o=0;o<r.length;o+=2){var s=new xt(r[o],r[o+1]);var c=void 0;if(o==r.length-2){var m=new xt(r[o-2],r[o-1]);c=_.Sub(s,m).uni(),i=s;}else{o===0&&(a=s);var _m3=new xt(r[o+2],r[o+3]);c=_.Sub(_m3,s).uni();}if(c){var _m4=_.Per(c).mul(t);e.push(xt.Sub(s,_m4)),n.push(xt.Add(s,_m4));}}if(i&&a){var _o3=xt.GetSemicircleStroke(i,e[e.length-1],-1,8),_s4=xt.GetSemicircleStroke(a,n[0],-1,8);return e.concat(_o3,n.reverse(),_s4);}return[];}},{key:"replace",value:function replace(r,t,e){var _this61=this;var a;if(!t){e&&r.append(e);return;}var n=r.getElementsByName(t);if(n.length){var _iterator15=_createForOfIteratorHelper(n),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var o=_step15.value;e?t0(e,o,r):(o.remove(),_Zt(o,r.parent));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}else e&&r.append(e);this.fullLayer===r?(a=this.drawLayer)==null||a.getElementsByName(t).forEach(function(o){var s;o.remove(),_Zt(o,(s=_this61.drawLayer)==null?void 0:s.parent);}):this.fullLayer.getElementsByName(t).forEach(function(o){o.remove(),_Zt(o,_this61.fullLayer.parent);});}},{key:"removeDrawCountNodes",value:function removeDrawCountNodes(r,t){var e=[];r.getElementsByName(this.workId).forEach(function(n){n.id&&t&&Number(n.id)<t&&e.push(n);});for(var _i2=0,_e4=e;_i2<_e4.length;_i2++){var n=_e4[_i2];n.remove(),_Zt(n,r.parent);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(r){var f;var t=r.node,e=r.opt,n=r.vNodes,i=r.willSerializeData,a=r.targetNode,o=e.zIndex,s=e.translate,c=e.angle,m=e.originPoint,l=e.scenePoint,p=e.scale,y=e.pointMap,P=e.thickness;var S;var v=a&&Vt(a)||n.get(t.name);if(!v)return;kt(o)&&(t.setAttribute("zIndex",o),v.opt.zIndex=o);var T=t.parent;if(T){if(m&&p&&a){var d=[v.op[0],v.op[1]];zr(v.op,l,p,s);var u=[v.op[0],v.op[1]],g=[u[0]-d[0],u[1]-d[1]];if(v.centerPos=[v.centerPos[0]+g[0],v.centerPos[1]+g[1]],v.opt.translate=void 0,v.opt.scale=void 0,v.opt.eraserlines)for(var _i3=0,_Object$values=Object.values(v.opt.eraserlines);_i3<_Object$values.length;_i3++){var M=_Object$values[_i3];var C=M.op,A=M.thickness;M.thickness=A*Math.max(p[0],p[1]);for(var L=0;L<C.length;L++)Gr(C[L],l,p,s);}}else if(s){if(t.setAttribute("translate",s),v.opt.translate=s,a){var _d7=[s[0]*T.worldScaling[0],s[1]*T.worldScaling[1]];S=Tr(v.rect,_d7),v.rect=S;}else{var _d8=Jt.getRectFromLayer(T,t.name);v.rect=_d8||v.rect;}}else if(kt(c))if(t.setAttribute("rotate",c),v.opt.rotate=c,a)S=Ii(v.rect,c),v.rect=S;else{var _d9=Jt.getRectFromLayer(T,t.name);v.rect=_d9||v.rect;}if(y){var _d10=y.get(t.name);if(_d10)for(var _u10=0,_g10=0;_u10<v.op.length;_u10+=3,_g10++)v.op[_u10]=_d10[_g10][0],v.op[_u10+1]=_d10[_g10][1];}if(P&&(f=v==null?void 0:v.opt)!=null&&f.thickness&&(v.opt.thickness=P),i&&!(m&&p&&a)){if(s){var _d11=v.op.map(function(u,g){var M=g%3;return M===0?u+s[0]:M===1?u+s[1]:u;});if(v.op=_d11,v.centerPos=[v.centerPos[0]+s[0],v.centerPos[1]+s[1]],v!=null&&v.opt&&(v.opt.translate=void 0),v.opt.eraserlines)for(var _i4=0,_Object$values2=Object.values(v.opt.eraserlines);_i4<_Object$values2.length;_i4++){var _u11=_Object$values2[_i4];var _g11=_u11.op;for(var _M6=0;_M6<_g11.length;_M6++){var _C3=_g11[_M6].map(function(A,L){return L%2?A+s[1]:A+s[0];});_u11.op[_M6]=_C3;}}}else if(kt(c)){var _d12=v.op;if(Vp(_d12,v.centerPos,c),v.op=_d12,v!=null&&v.opt&&(v.opt.rotate=void 0),v.opt.eraserlines)for(var _i5=0,_Object$values3=Object.values(v.opt.eraserlines);_i5<_Object$values3.length;_i5++){var _u12=_Object$values3[_i5];var _g12=_u12.op;for(var _M7=0;_M7<_g12.length;_M7++)kp(_g12[_M7],v.centerPos,c);}}}v&&n.setInfo(t.name,v);}}},{key:"getCenterPos",value:function getCenterPos(r,t){var e=t.worldPosition,n=t.worldScaling;return[(r.x+r.w/2-e[0])/n[0],(r.y+r.h/2-e[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(r,t){var e=r.getElementsByName(t)[0];if(e){var n=e.getBoundingClientRect();return{x:Math.floor(n.x-Jt.SafeBorderPadding),y:Math.floor(n.y-Jt.SafeBorderPadding),w:Math.floor(n.width+Jt.SafeBorderPadding*2),h:Math.floor(n.height+Jt.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(r){var t=r.toolsType,e=r.opt,n=r.node,i=r.updateOpt,a=r.willSerializeData;return!!(a&&(i.angle||i.translate)||i.thickness&&e.thickness&&e.thickness!==i.thickness||i.strokeType&&e.strokeType&&e.strokeType!==i.strokeType||i.originPoint&&i.scenePoint&&i.scale||i.pointMap&&i.pointMap.has(n.name)||t===dt.Text&&(i.fontSize||i.translate||i.textInfos&&i.textInfos.get(n.name))||t===dt.Image&&(i.angle||i.translate||i.scale||i.strokeColor&&i.type===Mr.Iconify)||t===i.toolsType&&i.willRefresh||e.eraserlines&&e.eraserlines.length&&(i.strokeColor||i.fillColor));}}]);}();tt(Jt,"SafeBorderPadding",10);var vt=Jt;var Nr=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 Wr={exports:{}};Wr.exports;(function(h){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(s,c){if(!i[s]){i[s]={};for(var m=0;m<s.length;m++)i[s][s.charAt(m)]=m;}return i[s][c];}var o={compressToBase64:function compressToBase64(s){if(s==null)return"";var c=o._compress(s,6,function(m){return e.charAt(m);});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"=";}},decompressFromBase64:function decompressFromBase64(s){return s==null?"":s==""?null:o._decompress(s.length,32,function(c){return a(e,s.charAt(c));});},compressToUTF16:function compressToUTF16(s){return s==null?"":o._compress(s,15,function(c){return t(c+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(s){return s==null?"":s==""?null:o._decompress(s.length,16384,function(c){return s.charCodeAt(c)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
420
|
+
compressToUint8Array:function compressToUint8Array(s){for(var c=o.compress(s),m=new Uint8Array(c.length*2),l=0,p=c.length;l<p;l++){var y=c.charCodeAt(l);m[l*2]=y>>>8,m[l*2+1]=y%256;}return m;},//decompress from uint8array (UCS-2 big endian format)
|
|
421
|
+
decompressFromUint8Array:function decompressFromUint8Array(s){if(s==null)return o.decompress(s);for(var c=new Array(s.length/2),m=0,l=c.length;m<l;m++)c[m]=s[m*2]*256+s[m*2+1];var p=[];return c.forEach(function(y){p.push(t(y));}),o.decompress(p.join(""));},//compress into a string that is already URI encoded
|
|
422
|
+
compressToEncodedURIComponent:function compressToEncodedURIComponent(s){return s==null?"":o._compress(s,6,function(c){return n.charAt(c);});},//decompress from an output of compressToEncodedURIComponent
|
|
423
|
+
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(s){return s==null?"":s==""?null:(s=s.replace(/ /g,"+"),o._decompress(s.length,32,function(c){return a(n,s.charAt(c));}));},compress:function compress(s){return o._compress(s,16,function(c){return t(c);});},_compress:function _compress(s,c,m){if(s==null)return"";var l,p,y={},P={},S="",v="",T="",f=2,d=3,u=2,g=[],M=0,C=0,A;for(A=0;A<s.length;A+=1)if(S=s.charAt(A),Object.prototype.hasOwnProperty.call(y,S)||(y[S]=d++,P[S]=!0),v=T+S,Object.prototype.hasOwnProperty.call(y,v))T=v;else{if(Object.prototype.hasOwnProperty.call(P,T)){if(T.charCodeAt(0)<256){for(l=0;l<u;l++)M=M<<1,C==c-1?(C=0,g.push(m(M)),M=0):C++;for(p=T.charCodeAt(0),l=0;l<8;l++)M=M<<1|p&1,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=p>>1;}else{for(p=1,l=0;l<u;l++)M=M<<1|p,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=0;for(p=T.charCodeAt(0),l=0;l<16;l++)M=M<<1|p&1,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=p>>1;}f--,f==0&&(f=Math.pow(2,u),u++),delete P[T];}else for(p=y[T],l=0;l<u;l++)M=M<<1|p&1,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=p>>1;f--,f==0&&(f=Math.pow(2,u),u++),y[v]=d++,T=String(S);}if(T!==""){if(Object.prototype.hasOwnProperty.call(P,T)){if(T.charCodeAt(0)<256){for(l=0;l<u;l++)M=M<<1,C==c-1?(C=0,g.push(m(M)),M=0):C++;for(p=T.charCodeAt(0),l=0;l<8;l++)M=M<<1|p&1,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=p>>1;}else{for(p=1,l=0;l<u;l++)M=M<<1|p,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=0;for(p=T.charCodeAt(0),l=0;l<16;l++)M=M<<1|p&1,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=p>>1;}f--,f==0&&(f=Math.pow(2,u),u++),delete P[T];}else for(p=y[T],l=0;l<u;l++)M=M<<1|p&1,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=p>>1;f--,f==0&&(f=Math.pow(2,u),u++);}for(p=2,l=0;l<u;l++)M=M<<1|p&1,C==c-1?(C=0,g.push(m(M)),M=0):C++,p=p>>1;for(;;)if(M=M<<1,C==c-1){g.push(m(M));break;}else C++;return g.join("");},decompress:function decompress(s){return s==null?"":s==""?null:o._decompress(s.length,32768,function(c){return s.charCodeAt(c);});},_decompress:function _decompress(s,c,m){var l=[],p=4,y=4,P=3,S="",v=[],T,f,d,u,g,M,C,A={val:m(0),position:c,index:1};for(T=0;T<3;T+=1)l[T]=T;for(d=0,g=Math.pow(2,2),M=1;M!=g;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=c,A.val=m(A.index++)),d|=(u>0?1:0)*M,M<<=1;switch(d){case 0:for(d=0,g=Math.pow(2,8),M=1;M!=g;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=c,A.val=m(A.index++)),d|=(u>0?1:0)*M,M<<=1;C=t(d);break;case 1:for(d=0,g=Math.pow(2,16),M=1;M!=g;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=c,A.val=m(A.index++)),d|=(u>0?1:0)*M,M<<=1;C=t(d);break;case 2:return"";}for(l[3]=C,f=C,v.push(C);;){if(A.index>s)return"";for(d=0,g=Math.pow(2,P),M=1;M!=g;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=c,A.val=m(A.index++)),d|=(u>0?1:0)*M,M<<=1;switch(C=d){case 0:for(d=0,g=Math.pow(2,8),M=1;M!=g;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=c,A.val=m(A.index++)),d|=(u>0?1:0)*M,M<<=1;l[y++]=t(d),C=y-1,p--;break;case 1:for(d=0,g=Math.pow(2,16),M=1;M!=g;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=c,A.val=m(A.index++)),d|=(u>0?1:0)*M,M<<=1;l[y++]=t(d),C=y-1,p--;break;case 2:return v.join("");}if(p==0&&(p=Math.pow(2,P),P++),l[C])S=l[C];else if(C===y)S=f+f.charAt(0);else return null;v.push(S),l[y++]=f+S.charAt(0),p--,f=S,p==0&&(p=Math.pow(2,P),P++);}}};return o;}();h!=null?h.exports=r:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r;});})(Wr);var gi=Wr.exports;function Ee(h){return JSON.parse(gi.decompress(h));}function te(h){return gi.compress(JSON.stringify(h));}var mi=/*#__PURE__*/function(_vt){function mi(t){var _this62;_classCallCheck(this,mi);_this62=_callSuper(this,mi,[t]);tt(_this62,"canRotate",!0);tt(_this62,"scaleType",bt.all);tt(_this62,"toolsType",dt.Pencil);tt(_this62,"syncTimestamp");tt(_this62,"syncIndex",0);tt(_this62,"tmpPoints",[]);tt(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */tt(_this62,"uniThickness");tt(_this62,"workOptions");tt(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(mi,_vt);return _createClass(mi,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:ot.None};var e=this.transformDataAll(!0),n={name:t};var i;var a=this.drawLayer||this.fullLayer;return e.length&&(i=this.draw({attrs:n,tasks:e,replaceId:t,layer:a})),{rect:i,type:ot.DrawWork,dataType:Tt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(mi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=t.drawCount,s=t.removeDrawCount,c=e.workId,_this$transformData=this.transformData(e,!1),m=_this$transformData.tasks,l=_this$transformData.effects,p=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,p,Math.max(0,this.tmpPoints.length-2));var y={name:c,id:kt(o)&&o.toString()||void 0};var P,S=!1;var v=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),m.length&&(m[0].taskId-this.syncTimestamp>this.syncUnitTime&&(S=!0,this.syncTimestamp=m[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){var _f26=n?this.fullLayer:this.drawLayer||this.fullLayer;P=this.draw({attrs:y,tasks:m,effects:l,layer:_f26,removeDrawCount:s});}if(i)return p>10&&this.tmpPoints.splice(0,p-10),{rect:P,type:ot.DrawWork,dataType:Tt.Local};var T=[];return this.tmpPoints.slice(v).forEach(function(f){T.push(f.x,f.y,_this63.computRadius(f.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ot.DrawWork,dataType:Tt.Local,rect:P,op:S?T:void 0,index:S?v*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var m;var e=this.workId;if(t.data){var _t$data=t.data,l=_t$data.op,p=_t$data.workState;l!=null&&l.length&&p===Ot.Done&&this.workOptions.strokeType===wt.Stroke&&this.updateTempPointsWithPressureWhenDone(l);}var n=this.transformDataAll(!0),i={name:e};var a;var o=this.fullLayer;if(n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:o})),this.tmpPoints.length<2)return this.replace(o,e),{type:ot.RemoveNode,removeIds:[e],rect:a};var s=[];this.tmpPoints.map(function(l){s.push(l.x,l.y,l.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var c=te(s);return(m=this.vNodes)==null||m.setInfo(e,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&vt.getCenterPos(a,o)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:a,type:ot.FullWork,dataType:Tt.Local,ops:c,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var l,p;var e=t.op,n=t.isFullWork,i=t.replaceId,_t$workState=t.workState,a=_t$workState===void 0?Ot.Done:_t$workState;this.tmpPoints.length=0;for(var y=0;y<e.length;y+=3){var P=new xt(e[y],e[y+1],e[y+2]);if(this.tmpPoints.length>0){var S=this.tmpPoints[this.tmpPoints.length-1],v=_.Sub(P,S).uni();P.setv(v);}this.tmpPoints.push(P);}if(this.tmpPoints.length<2)return;var o=this.transformDataAll(!0),s=(l=this.workId)==null?void 0:l.toString(),c={name:s};var m;if(s&&o.length){var _y8=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({attrs:c,tasks:o,replaceId:i,layer:_y8,isDrawEraserlines:a===Ot.Done}),(p=this.vNodes)==null||p.setInfo(s,{rect:m,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&vt.getCenterPos(m,_y8)});}return m;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(e,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this64=this;var e=t.attrs,n=t.tasks,i=t.replaceId,a=t.effects,o=t.layer,s=t.removeDrawCount,_t$isDrawEraserlines=t.isDrawEraserlines,c=_t$isDrawEraserlines===void 0?!0:_t$isDrawEraserlines,_this$workOptions=this.workOptions,m=_this$workOptions.strokeColor,l=_this$workOptions.strokeType,p=_this$workOptions.thickness,y=_this$workOptions.zIndex,P=_this$workOptions.scale,S=_this$workOptions.rotate,v=_this$workOptions.translate,T=_this$workOptions.eraserlines;a!=null&&a.size&&(a.forEach(function(C){var A;(A=o.getElementById(C+""))==null||A.remove();}),a.clear()),s&&this.removeDrawCountNodes(o,s);var f;var d=[],u=o.worldPosition,g=o.worldScaling;for(var C=0;C<n.length;C++){var _n$C=n[C],A=_n$C.pos,L=_n$C.points,_this$computDrawPoint=this.computDrawPoints(L),O=_this$computDrawPoint.ps,w=_this$computDrawPoint.rect;var b=void 0;var I=L.length===1;l===wt.Stroke||I?b=ae(O,!0):b=ae(O,!1);var R={pos:A,d:b,fillColor:l===wt.Stroke||I?m:void 0,lineDash:l===wt.Dotted&&!I?[1,p*2]:l===wt.LongDotted&&!I?[p,p*2]:void 0,strokeColor:m,lineCap:l===wt.Stroke||I?void 0:"round",lineWidth:l===wt.Stroke||I?0:p};f=Pt(f,{x:Math.floor((w.x+A[0])*g[0]+u[0]-vt.SafeBorderPadding),y:Math.floor((w.y+A[1])*g[1]+u[1]-vt.SafeBorderPadding),w:Math.floor(w.w*g[0]+2*vt.SafeBorderPadding),h:Math.floor(w.h*g[1]+2*vt.SafeBorderPadding)}),d.push(R);}P&&(e.scale=P),S&&(e.rotate=S),v&&(e.translate=v);var M=new Qt();if(f){this.centerPos=vt.getCenterPos(f,o);var _C4=l===wt.Stroke&&!T;M.attr(_objectSpread(_objectSpread({},e),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_C4?m:void 0,pos:this.centerPos,size:[(f.w-2*vt.SafeBorderPadding)/g[0],(f.h-2*vt.SafeBorderPadding)/g[1]],zIndex:y}));var _A5=d.map(function(L){return L.pos=[L.pos[0]-_this64.centerPos[0],L.pos[1]-_this64.centerPos[1]],new le(L);});M.append.apply(M,_toConsumableArray(_A5)),_C4&&M.seal(),T&&(this.scaleType=bt.proportional,this.drawEraserlines({group:M,eraserlines:T,pos:this.centerPos,layer:o},c)),this.replace(o,i,M);}if(P||S||v){var _C5=M==null?void 0:M.getBoundingClientRect();if(_C5)return{x:Math.floor(_C5.x-vt.SafeBorderPadding),y:Math.floor(_C5.y-vt.SafeBorderPadding),w:Math.floor(_C5.width+vt.SafeBorderPadding*2),h:Math.floor(_C5.height+vt.SafeBorderPadding*2)};}return f;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===wt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var e=this.workOptions.thickness;var n=t.map(function(i){return e=Math.max(e,i.radius),i.point;});return{ps:n,rect:Ft(n,e)};}},{key:"computStroke",value:function computStroke(t){return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t);}},{key:"computLineStroke",value:function computLineStroke(t){var e=[],n=[];for(var c=0;c<t.length;c++){var _t$c=t[c],m=_t$c.point,l=_t$c.radius;var p=m.v;c===0&&t.length>1&&(p=t[c+1].point.v);var y=_.Per(p).mul(l);e.push(xt.Sub(m,y)),n.push(xt.Add(m,y));}var i=t[t.length-1],a=xt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),o=xt.GetSemicircleStroke(t[0].point,n[0],-1,8),s=e.concat(a,n.reverse(),o);return{ps:s,rect:Ft(s)};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:xt.GetDotStroke(e,n,8),rect:i};}},{key:"transformData",value:function transformData(t,e){var n=t.op,i=t.workState;var a=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,s=_this$workOptions2.strokeType,c=_this$workOptions2.thickness,m=/* @__PURE__ */new Set();a=s===wt.Stroke?this.updateTempPointsWithPressure(n,c,m):this.updateTempPoints(n,c,m);var l=e?this.tmpPoints:this.tmpPoints.slice(a);return o=this.getTaskPoints(l,c),{tasks:o,effects:m,consumeIndex:a};}return{tasks:o,consumeIndex:a};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,e){return t*0.03*e+e*0.5;}},{key:"getMinZ",value:function getMinZ(t,e){return((e||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,e){var l;var n=[];if(t.length===0)return[];var i=0,a=t[0].x,o=t[0].y,s=[a,o],c=[],m=t[0].t;for(;i<t.length;){var p=t[i],y=p.x-a,P=p.y-o,S=p.z,v=e?this.computRadius(S,e):S;if(c.push({point:new xt(y,P,S,t[i].v),radius:v}),i>0&&i<t.length-1){var _T28=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_T28<60||_T28>300){var _f27=(l=c.pop())==null?void 0:l.point.clone();_f27&&n.push({taskId:m,pos:s,points:[].concat(_toConsumableArray(c),[{point:_f27,radius:v}])}),a=t[i].x,o=t[i].y,s=[a,o];var d=p.x-a,u=p.y-o;c=[{point:new xt(d,u,S),radius:v}],m=Date.now();}}i++;}return n.push({taskId:m,pos:s,points:c}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,e,n){var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var c=0;c<t.length;c+=2){o=Math.min(o,a);var m=this.tmpPoints.length,l=new xt(t[c],t[c+1]);if(m===0){this.tmpPoints.push(l);continue;}var p=m-1,y=this.tmpPoints[p],P=_.Sub(l,y).uni();if(l.isNear(y,e)){if(y.z<this.MAX_REPEAR){if(y.setz(Math.min(y.z+1,this.MAX_REPEAR)),o=Math.min(o,p),m>1){var _T29=m-1;for(;_T29>0;){var _f28=this.tmpPoints[_T29].distance(this.tmpPoints[_T29-1]),d=Math.max(this.tmpPoints[_T29].z-this.uniThickness*_f28,0);if(this.tmpPoints[_T29-1].z>=d)break;this.tmpPoints[_T29-1].setz(d),o=Math.min(o,_T29-1),_T29--;}}}else o=1/0;continue;}l.setv(P);var S=l.distance(y),v=Math.max(y.z-this.uniThickness*S,0);m>1&&_.Equals(P,y.v,0.02)&&(v>0||y.z<=0)&&(n&&y.t&&n.add(y.t),this.tmpPoints.pop(),o=Math.min(p,o)),l.setz(v),this.tmpPoints.push(l);}if(o===1/0)return this.tmpPoints.length;var s=a;if(o===a){s=Math.max(s-1,0);var _c4=this.tmpPoints[s].t;_c4&&(n==null||n.add(_c4));}else{var _c5=a-1;for(s=o;_c5>=0;){var _m5=this.tmpPoints[_c5].t;if(_m5&&(n==null||n.add(_m5),_c5<=o)){s=_c5,_c5=-1;break;}_c5--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPoints",value:function updateTempPoints(t,e,n){var c;var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var m=0;m<t.length;m+=2){var l=this.tmpPoints.length,p=new xt(t[m],t[m+1]);if(l===0){this.tmpPoints.push(p);continue;}var y=l-1,P=this.tmpPoints[y],S=_.Sub(p,P).uni();if(p.isNear(P,e/2)){o=Math.min(y,o);continue;}_.Equals(S,P.v,0.02)&&(n&&P.t&&n.add(P.t),this.tmpPoints.pop(),o=Math.min(y,o)),p.setv(S),this.tmpPoints.push(p);}var s=a;if(o===a){s=Math.max(s-1,0);var _m6=this.tmpPoints[s].t;_m6&&(n==null||n.add(_m6));}else{var _m7=Math.min(a-1,o);for(s=o;_m7>=0;){var _l4=(c=this.tmpPoints[_m7])==null?void 0:c.t;if(_l4&&(n==null||n.add(_l4),_m7<=o)){s=_m7,_m7=-1;break;}_m7--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var e=this.workOptions.thickness,n=t.length,i=this.getMinZ(e);for(var a=0;a<n;a+=2){var o=this.tmpPoints.length,s=new xt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var c=o-1,m=this.tmpPoints[c],l=_.Sub(s,m).uni(),p=s.distance(m);if(o>1&&m.z===i)break;if(s.isNear(m,e/2)){if(n<3&&m.z<this.MAX_REPEAR&&(m.setz(Math.min(m.z+1,this.MAX_REPEAR)),o>1)){var P=o-1;for(;P>0;){var S=this.tmpPoints[P].distance(this.tmpPoints[P-1]),v=Math.max(this.tmpPoints[P].z-this.uniThickness*S,-e/4);if(this.tmpPoints[P-1].z>=v)break;this.tmpPoints[P-1].setz(v),P--;}}continue;}s.setv(l);var y=Math.max(m.z-this.uniThickness*p,i);o>1&&_.Equals(l,m.v,0.02)&&m.z<=0&&this.tmpPoints.pop(),s.setz(y),this.tmpPoints.push(s);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.tagName==="GROUP"?_p(e)?e.setAttribute("bgcolor",a):e.children.forEach(function(l){l.setAttribute("strokeColor",a),l.getAttribute("fillColor")&&l.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(c=s==null?void 0:s.opt)!=null&&c.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(m=s.opt)!=null&&m.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),vt.updateNodeOpt(t);}}]);}(vt);var vi=/*#__PURE__*/function(_vt2){function vi(t){var _this65;_classCallCheck(this,vi);_this65=_callSuper(this,vi,[t]);tt(_this65,"toolsType",dt.LaserPen);tt(_this65,"canRotate",!1);tt(_this65,"scaleType",bt.none);tt(_this65,"syncTimestamp");tt(_this65,"syncIndex",0);tt(_this65,"tmpPoints",[]);tt(_this65,"workOptions");tt(_this65,"consumeIndex",0);_this65.workOptions=t.toolsOpt,_this65.syncTimestamp=0;return _this65;}_inherits(vi,_vt2);return _createClass(vi,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(vi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var e=t.data,n=t.isSubWorker,i=e.workId,a=e.op;if((a==null?void 0:a.length)===0)return{type:ot.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:ot.None};var _this$workOptions3=this.workOptions,o=_this$workOptions3.strokeColor,s=_this$workOptions3.thickness,c=_this$workOptions3.strokeType,m=Ft(this.tmpPoints,s);var l=!1;var p=this.syncIndex,y=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var P={name:i==null?void 0:i.toString(),opacity:1,lineDash:c===wt.Dotted?[1,s*2]:c===wt.LongDotted?[s,s*2]:void 0,strokeColor:o,lineCap:"round",lineWidth:s,anchor:[0.5,0.5]},S=this.getTaskPoints(y);if(S.length){var _T30=Date.now();_T30-this.syncTimestamp>this.syncUnitTime&&(l=!0,this.syncTimestamp=_T30,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:P,tasks:S,isDot:!1,layer:this.drawLayer||this.fullLayer});}var v=[];return this.tmpPoints.slice(p).forEach(function(T){v.push(T.x,T.y);}),_objectSpread({rect:{x:m.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:m.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:m.w*this.fullLayer.worldScaling[0],h:m.h*this.fullLayer.worldScaling[1]},type:ot.DrawWork,dataType:Tt.Local,op:l?v:void 0,index:l?p*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var t=(a=this.workId)==null?void 0:a.toString();var e;if(this.tmpPoints.length-1>this.consumeIndex){var o=this.tmpPoints.slice(this.consumeIndex);var s=o.length===1,_this$workOptions4=this.workOptions,c=_this$workOptions4.strokeColor,m=_this$workOptions4.thickness,l=_this$workOptions4.strokeType;if(s){var P=this.computDotStroke({point:o[0],radius:m/2});o=P.ps,e=P.rect;}else e=Ft(this.tmpPoints,m);var p={name:t==null?void 0:t.toString(),fillColor:s?c:void 0,opacity:1,lineDash:l===wt.Dotted&&!s?[1,m*2]:l===wt.LongDotted&&!s?[m,m*2]:void 0,strokeColor:c,lineCap:s?void 0:"round",lineWidth:s?0:m,anchor:[0.5,0.5]},y=this.getTaskPoints(o);y.length&&this.draw({attrs:p,tasks:y,isDot:s,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:e&&{x:e.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:e.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:e.w*this.fullLayer.worldScaling[0],h:e.h*this.fullLayer.worldScaling[1]},type:ot.FullWork,dataType:Tt.Local,ops:i,index:this.syncIndex*2},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var S;var e=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,a=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,s=_this$workOptions5.strokeType;if(!e.length){var v=Ft(this.tmpPoints,o);return{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]};}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(e||[]);var m,l=this.tmpPoints.slice(c);var p=l.length===1;if(p){var _v6=this.computDotStroke({point:l[0],radius:o/2});l=_v6.ps,m=_v6.rect;}else m=Ft(this.tmpPoints,o);var y={name:(S=this.workId)==null?void 0:S.toString(),fillColor:p?a:void 0,opacity:1,lineDash:s===wt.Dotted&&!p?[1,o*2]:s===wt.LongDotted&&!p?[o,o*2]:void 0,strokeColor:a,lineCap:p?void 0:"round",lineWidth:p?0:o,anchor:[0.5,0.5]},P=this.getTaskPoints(l);if(P.length){var _v7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:y,tasks:P,isDot:p,replaceId:n,layer:_v7});}return{x:m.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:m.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:m.w*this.fullLayer.worldScaling[0],h:m.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:xt.GetDotStroke(e,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(e){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new xt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this66=this;var e,n,i,a,o,_iterator16,_step16,_loop3;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:e=t.attrs,n=t.tasks,i=t.isDot,a=t.layer,o=this.workOptions.duration;_iterator16=_createForOfIteratorHelper(n);_context23.prev=2;_loop3=/*#__PURE__*/_regeneratorRuntime().mark(function _loop3(){var s,c,m,l,p,_this66$workOptions,y,P,S,_a$getResolution,v,_T31;return _regeneratorRuntime().wrap(function _loop3$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:s=_step16.value;c=new le(),m=s.pos,l=s.points;i?p=ae(l,!0):p=ae(l,!1),c.attr(_objectSpread(_objectSpread({},e),{},{pos:m,d:p}));_this66$workOptions=_this66.workOptions,y=_this66$workOptions.vertex,P=_this66$workOptions.fragment;if(y&&P){S=a.renderer.createProgram({vertex:y,fragment:P}),_a$getResolution=a.getResolution(),v=_a$getResolution.width,_T31=_a$getResolution.height;c.setUniforms({u_time:0,u_resolution:[v,_T31]}),c.setProgram(S);}a.appendChild(c),c.transition(o).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){c.remove();});case 6:case"end":return _context22.stop();}},_loop3);});_iterator16.s();case 5:if((_step16=_iterator16.n()).done){_context23.next=9;break;}return _context23.delegateYield(_loop3(),"t0",7);case 7:_context23.next=5;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23["catch"](2);_iterator16.e(_context23.t1);case 14:_context23.prev=14;_iterator16.f();return _context23.finish(14);case 17:case"end":return _context23.stop();}},_callee21,this,[[2,11,14,17]]);}));function draw(_x23){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var c;var e=[];if(t.length===0)return[];var n=0,i=t[0].x,a=t[0].y,o=[i,a],s=[];for(;n<t.length;){var m=t[n],l=m.x-i,p=m.y-a;if(s.push(new xt(l,p)),n>0&&n<t.length-1){var y=t[n].getAngleByPoints(t[n-1],t[n+1]);if(y<60||y>300){var P=(c=s.pop())==null?void 0:c.clone();P&&e.push({pos:o,points:[].concat(_toConsumableArray(s),[P])}),i=t[n].x,a=t[n].y,o=[i,a];var S=m.x-i,v=m.y-a;s=[new xt(S,v)];}}n++;}return e.push({pos:o,points:s}),e;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var e;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(i){if(i.name===t){var a=i.getBoundingClientRect();e=Pt(e,{x:a.x,y:a.y,w:a.width,h:a.height}),n.push(i);}}),n.length&&n.forEach(function(i){return i.remove();}),e;}}]);}(vt);var Nd=Xe;Xe.polyline=Xe;Xe.polygon=Wd;function Xe(h,r,t){var e=h.length,n=xe(h[0],r),i=[],a,o,s,c,m;for(t||(t=[]),a=1;a<e;a++){for(o=h[a-1],s=h[a],c=m=xe(s,r);;)if(n|c){if(n&c)break;n?(o=xr(o,s,n,r),n=xe(o,r)):(s=xr(o,s,c,r),c=xe(s,r));}else{i.push(o),c!==m?(i.push(s),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(s);break;}n=m;}return i.length&&t.push(i),t;}function Wd(h,r){var t,e,n,i,a,o,s;for(e=1;e<=8;e*=2){for(t=[],n=h[h.length-1],i=!(xe(n,r)&e),a=0;a<h.length;a++)o=h[a],s=!(xe(o,r)&e),s!==i&&t.push(xr(n,o,e,r)),s&&t.push(o),n=o,i=s;if(h=t,!h.length)break;}return t;}function xr(h,r,t,e){return t&8?[h[0]+(r[0]-h[0])*(e[3]-h[1])/(r[1]-h[1]),e[3]]:// top
|
|
424
|
+
t&4?[h[0]+(r[0]-h[0])*(e[1]-h[1])/(r[1]-h[1]),e[1]]:// bottom
|
|
425
|
+
t&2?[e[2],h[1]+(r[1]-h[1])*(e[2]-h[0])/(r[0]-h[0])]:// right
|
|
426
|
+
t&1?[e[0],h[1]+(r[1]-h[1])*(e[0]-h[0])/(r[0]-h[0])]:// left
|
|
427
|
+
null;}function xe(h,r){var t=0;return h[0]<r[0]?t|=1:h[0]>r[2]&&(t|=2),h[1]<r[1]?t|=4:h[1]>r[3]&&(t|=8),t;}var Br=/* @__PURE__ */de(Nd);var Me=/*#__PURE__*/function(_vt3){function Me(t,e){var _this67;_classCallCheck(this,Me);_this67=_callSuper(this,Me,[t]);tt(_this67,"canRotate",!1);tt(_this67,"scaleType",bt.none);tt(_this67,"toolsType",dt.Eraser);tt(_this67,"serviceWork");tt(_this67,"tmpPoints",[]);tt(_this67,"workOptions");tt(_this67,"worldPosition");tt(_this67,"worldScaling");tt(_this67,"eraserRect");tt(_this67,"eraserPolyline");_this67.serviceWork=e,_this67.workOptions=t.toolsOpt,_this67.worldPosition=_this67.fullLayer.worldPosition,_this67.worldScaling=_this67.fullLayer.worldScaling;return _this67;}_inherits(Me,_vt3);return _createClass(Me,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Me,"setWorkOptions",this,3)([t]);}},{key:"createEraserRect",value:function createEraserRect(t){var e=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_Me$eraserSizes$this$=Me.eraserSizes[this.workOptions.thickness],i=_Me$eraserSizes$this$.width,a=_Me$eraserSizes$this$.height;this.eraserRect={x:e-i*0.5,y:n-a*0.5,w:i,h:a},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h];}},{key:"computRectCenterPoints",value:function computRectCenterPoints(){var t=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){var _e5=new _(this.tmpPoints[0],this.tmpPoints[1]),n=new _(this.tmpPoints[2],this.tmpPoints[3]),i=_.Sub(n,_e5).uni(),a=_.Dist(_e5,n),_Me$eraserSizes$this$2=Me.eraserSizes[this.workOptions.thickness],o=_Me$eraserSizes$this$2.width,s=_Me$eraserSizes$this$2.height,c=Math.min(o,s),m=Math.round(a/c);if(m>1){var l=[];for(var p=0;p<m;p++){var y=_.Mul(i,p*c);l.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.y);}return l.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,e){var n=new _(t[0],t[1]),i=new _(e[0],e[1]),_Me$eraserSizes$this$3=Me.eraserSizes[this.workOptions.thickness],a=_Me$eraserSizes$this$3.width,o=_Me$eraserSizes$this$3.height;return _.Dist(n,i)<Math.hypot(a,o)*0.5;}},{key:"remove",value:function remove(t){var _this68=this;var e=t.curNodeMap,n=t.removeIds;var i;var _iterator17=_createForOfIteratorHelper(e.values()),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var a=_step17.value;if(a.rect&&this.eraserRect&&this.eraserPolyline&&Ue(this.eraserRect,a.rect)){var o=a.op,s=[],c=[];for(var l=0;l<o.length;l+=3){var p=new _(o[l]*this.worldScaling[0]+this.worldPosition[0],o[l+1]*this.worldScaling[1]+this.worldPosition[1],o[l+2]);c.push(p),s.push(new xt(p.x,p.y));}var m=s.length&&Ft(s)||a.rect;Ue(m,this.eraserRect)&&(c.length>1?Br.polyline(c.map(function(p){return p.XY;}),this.eraserPolyline).length&&n.add(a.name):n.add(a.name),i=Pt(i,a.rect||m));}}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}return n.forEach(function(a){var s;var o=_this68.fullLayer.getElementsByName(a);o[0]&&(o[0].remove(),_Zt(o[0],_this68.fullLayer.parent),(s=_this68.vNodes)==null||s["delete"](a));}),i&&(i.x-=vt.SafeBorderPadding,i.y-=vt.SafeBorderPadding,i.w+=vt.SafeBorderPadding*2,i.h+=vt.SafeBorderPadding*2),i;}},{key:"consume",value:function consume(t){var _t$data2=t.data,e=_t$data2.op,n=_t$data2.disableEraseImage,i=_t$data2.disableEraseText;if(!e||e.length===0)return _objectSpread({type:ot.None},this.baseConsumeResult);var a=this.tmpPoints.length;if(a>1&&this.isNear([e[0],e[1]],[this.tmpPoints[a-2],this.tmpPoints[a-1]]))return _objectSpread({type:ot.None},this.baseConsumeResult);a<3?this.tmpPoints.push(e[0],e[1]):this.tmpPoints.splice(2,2,e[0],e[1]);var o=this.computRectCenterPoints();var s;var c=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:ot.None},this.baseConsumeResult);var m=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:n,disableEraseText:i}));for(var l=0;l<o.length-1;l+=2){this.createEraserRect(o.slice(l,l+2));var p=this.remove({curNodeMap:m,removeIds:c});s=Pt(s,p);}return s&&c.size?{type:ot.RemoveNode,rect:s,removeIds:_toConsumableArray(c)}:_objectSpread({type:ot.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 e;if(this.serviceWork){var n=new Map(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator18=_createForOfIteratorHelper(i.values()),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var o=_step18.value;if((e=o.selectIds)!=null&&e.length){var _iterator20=_createForOfIteratorHelper(o.selectIds),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var s=_step20.value;n["delete"](s);}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}}}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}var _iterator19=_createForOfIteratorHelper(a.keys()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _o4=_step19.value;n["delete"](_o4);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return n;}return t;}}]);}(vt);// 来源于white-sdk
|
|
428
|
+
tt(Me,"eraserSizes",Nr);var fe=Me;var Bd="__lodash_hash_undefined__";function Fd(h){return this.__data__.set(h,Bd),this;}var Ud=Fd;function jd(h){return this.__data__.has(h);}var $d=jd,zd=Kn,Gd=Ud,Hd=$d;function Je(h){var r=-1,t=h==null?0:h.length;for(this.__data__=new zd();++r<t;)this.add(h[r]);}Je.prototype.add=Je.prototype.push=Gd;Je.prototype.has=Hd;var Fr=Je;function Kd(h,r){for(var t=-1,e=h==null?0:h.length;++t<e;)if(r(h[t],t,h))return!0;return!1;}var Yd=Kd;function Vd(h,r){return h.has(r);}var Ur=Vd,kd=Fr,Xd=Yd,Jd=Ur,Zd=1,Qd=2;function qd(h,r,t,e,n,i){var a=t&Zd,o=h.length,s=r.length;if(o!=s&&!(a&&s>o))return!1;var c=i.get(h),m=i.get(r);if(c&&m)return c==r&&m==h;var l=-1,p=!0,y=t&Qd?new kd():void 0;for(i.set(h,r),i.set(r,h);++l<o;){var P=h[l],S=r[l];if(e)var v=a?e(S,P,l,r,h,i):e(P,S,l,h,r,i);if(v!==void 0){if(v)continue;p=!1;break;}if(y){if(!Xd(r,function(T,f){if(!Jd(y,f)&&(P===T||n(P,T,t,e,i)))return y.push(f);})){p=!1;break;}}else if(!(P===S||n(P,S,t,e,i))){p=!1;break;}}return i["delete"](h),i["delete"](r),p;}var yi=qd;function _d(h){var r=-1,t=Array(h.size);return h.forEach(function(e,n){t[++r]=[n,e];}),t;}var tp=_d;function ep(h){var r=-1,t=Array(h.size);return h.forEach(function(e){t[++r]=e;}),t;}var jr=ep,yn=je,Sn=ci,rp=Pr,np=yi,ip=tp,sp=jr,op=1,ap=2,lp="[object Boolean]",cp="[object Date]",fp="[object Error]",hp="[object Map]",up="[object Number]",dp="[object RegExp]",pp="[object Set]",gp="[object String]",mp="[object Symbol]",vp="[object ArrayBuffer]",yp="[object DataView]",xn=yn?yn.prototype:void 0,hr=xn?xn.valueOf:void 0;function Sp(h,r,t,e,n,i,a){switch(t){case yp:if(h.byteLength!=r.byteLength||h.byteOffset!=r.byteOffset)return!1;h=h.buffer,r=r.buffer;case vp:return!(h.byteLength!=r.byteLength||!i(new Sn(h),new Sn(r)));case lp:case cp:case up:return rp(+h,+r);case fp:return h.name==r.name&&h.message==r.message;case dp:case gp:return h==r+"";case hp:var o=ip;case pp:var s=e&op;if(o||(o=sp),h.size!=r.size&&!s)return!1;var c=a.get(h);if(c)return c==r;e|=ap,a.set(h,r);var m=np(o(h),o(r),e,n,i,a);return a["delete"](h),m;case mp:if(hr)return hr.call(h)==hr.call(r);}return!1;}var xp=Sp,Tn=oi,Tp=1,Mp=Object.prototype,Pp=Mp.hasOwnProperty;function Op(h,r,t,e,n,i){var a=t&Tp,o=Tn(h),s=o.length,c=Tn(r),m=c.length;if(s!=m&&!a)return!1;for(var l=s;l--;){var p=o[l];if(!(a?p in r:Pp.call(r,p)))return!1;}var y=i.get(h),P=i.get(r);if(y&&P)return y==r&&P==h;var S=!0;i.set(h,r),i.set(r,h);for(var v=a;++l<s;){p=o[l];var T=h[p],f=r[p];if(e)var d=a?e(f,T,p,r,h,i):e(T,f,p,h,r,i);if(!(d===void 0?T===f||n(T,f,t,e,i):d)){S=!1;break;}v||(v=p=="constructor");}if(S&&!v){var u=h.constructor,g=r.constructor;u!=g&&"constructor"in h&&"constructor"in r&&!(typeof u=="function"&&u instanceof u&&typeof g=="function"&&g instanceof g)&&(S=!1);}return i["delete"](h),i["delete"](r),S;}var Ep=Op,ur=Yn,Cp=yi,Ap=xp,Rp=Ep,Mn=cr,Pn=$e,On=Er,Ip=qn,wp=1,En="[object Arguments]",Cn="[object Array]",Ge="[object Object]",Lp=Object.prototype,An=Lp.hasOwnProperty;function bp(h,r,t,e,n,i){var a=Pn(h),o=Pn(r),s=a?Cn:Mn(h),c=o?Cn:Mn(r);s=s==En?Ge:s,c=c==En?Ge:c;var m=s==Ge,l=c==Ge,p=s==c;if(p&&On(h)){if(!On(r))return!1;a=!0,m=!1;}if(p&&!m)return i||(i=new ur()),a||Ip(h)?Cp(h,r,t,e,n,i):Ap(h,r,s,t,e,n,i);if(!(t&wp)){var y=m&&An.call(h,"__wrapped__"),P=l&&An.call(r,"__wrapped__");if(y||P){var S=y?h.value():h,v=P?r.value():r;return i||(i=new ur()),n(S,v,t,e,i);}}return p?(i||(i=new ur()),Rp(h,r,t,e,n,i)):!1;}var Dp=bp,Np=Dp,Rn=oe;function Si(h,r,t,e,n){return h===r?!0:h==null||r==null||!Rn(h)&&!Rn(r)?h!==h&&r!==r:Np(h,r,t,e,Si,n);}var Wp=Si,Bp=Wp;function Fp(h,r){return Bp(h,r);}var Up=Fp,he=/* @__PURE__ */de(Up);var rr=/*#__PURE__*/function(_vt4){function rr(t){var _this69;_classCallCheck(this,rr);_this69=_callSuper(this,rr,[t]);tt(_this69,"toolsType",dt.Selector);tt(_this69,"tmpPoints",[]);tt(_this69,"workOptions");tt(_this69,"vNodes");tt(_this69,"selectIds");tt(_this69,"selectorColor");tt(_this69,"strokeColor");tt(_this69,"fillColor");tt(_this69,"oldSelectRect");tt(_this69,"canRotate",!1);tt(_this69,"canTextEdit",!1);tt(_this69,"canLock",!1);tt(_this69,"scaleType",bt.all);tt(_this69,"toolsTypes");tt(_this69,"shapeOpt");tt(_this69,"textOpt");tt(_this69,"isLocked");tt(_this69,"thickness");tt(_this69,"strokeType");tt(_this69,"useStroke");_this69.workOptions=t.toolsOpt,_this69.vNodes=t.vNodes;return _this69;}_inherits(rr,_vt4);return _createClass(rr,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=Ft(this.tmpPoints);if(e.w===0||e.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(e,t),n=_this$vNodes$getRectI.rectRange,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length,n=t.length;if(n>1){var i=new xt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);e===2?this.tmpPoints.splice(1,1,i):this.tmpPoints.push(i);}}},{key:"drawSelector",value:function drawSelector(t){var _this70=this;var e=t.drawRect,n=t.subNodeMap,i=t.selectorId,a=t.layer,o=t.isService,s=new Qt({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:9999}),c=[];if(o){var m=new Yr({normalize:!0,pos:[e.w/2,e.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:e.w,height:e.h,name:rr.selectorBorderId});c.push(m);}n.forEach(function(m,l){var p=[m.rect.x+m.rect.w/2-e.x,m.rect.y+m.rect.h/2-e.y],y=new Yr({normalize:!0,pos:p,lineWidth:1,strokeColor:n.size>1?_this70.selectorColor||_this70.workOptions.strokeColor:void 0,width:m.rect.w,height:m.rect.h,id:"selector-".concat(l),name:"selector-".concat(l)});c.push(y);}),c&&s.append.apply(s,c),(a==null?void 0:a.parent).appendChild(s);}},{key:"draw",value:function draw(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var s,c;var a=n.intersectRect,o=n.subNodeMap;(c=(s=e.parent)==null?void 0:s.getElementById(t))==null||c.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:o,selectorId:t,layer:e,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=bt.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 e=/* @__PURE__ */new Set();var n,i=!0;var _iterator21=_createForOfIteratorHelper(t.values()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var a=_step21.value;var o=a.opt,s=a.canRotate,c=a.scaleType,m=a.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),m!==dt.Pencil&&(i=!1),o.strokeType&&(this.strokeType=o.strokeType),m===dt.SpeechBalloon&&(e.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=o.placement),m===dt.Polygon&&(e.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices),m===dt.Star&&(e.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices,this.shapeOpt.innerRatio=o.innerRatio,this.shapeOpt.innerVerticeStep=o.innerVerticeStep),m===dt.Text&&(this.textOpt=o),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=s,this.scaleType=c),m===dt.Image&&(n=a),(c===bt.proportional&&this.scaleType!==bt.none||c===bt.none)&&(this.scaleType=c);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}i&&(this.useStroke=!0),e.size&&(this.toolsTypes=_toConsumableArray(e)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=bt.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,e;if(this.scaleType===bt.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],i=(e=this.vNodes.get(n))==null?void 0:e.op;if(i){var a=[];for(var o=0;o<i.length;o+=3)a.push([i[o],i[o+1]]);return a;}}}},{key:"consume",value:function consume(t){var _t$data3=t.data,e=_t$data3.op,n=_t$data3.workState;var i=this.oldSelectRect;if(n===Ot.Start&&(i=this.unSelectedAllIds()),!(e!=null&&e.length)||!this.vNodes.curNodeMap.size)return{type:ot.None};this.updateTempPoints(e);var a=this.computSelector();if(this.selectIds&&he(this.selectIds,a.selectIds))return{type:ot.None};this.selectIds=a.selectIds;var o=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(Wt,this.fullLayer,a),this.oldSelectRect=o;var s=this.getChildrenPoints();return _objectSpread({type:ot.Select,dataType:Tt.Local,rect:Pt(o,i),selectIds:a.selectIds,selectRect:o,selectorColor:this.selectorColor,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:s,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var e,n;var t=this.oldSelectRect;if(!((e=this.selectIds)!=null&&e.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,Wt,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return _objectSpread({type:ot.Select,dataType:Tt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return{type:ot.None};}},{key:"consumeService",value:function consumeService(){}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0;}},{key:"selectSingleTool",value:function selectSingleTool(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Wt;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var i=t[0],a=t[1];var o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:a,w:0,h:0},!1),s=_this$vNodes$getRectI2.nodeRange,c=_toConsumableArray(s.values()).sort(function(m,l){return(l.opt.zIndex||0)-(m.opt.zIndex||0);});var _iterator22=_createForOfIteratorHelper(c),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _m8=_step22.value;var _l5=this.fullLayer.getElementsByName(_m8.name);if(Ri(_l5).find(function(y){return y.isPointCollision(i,a);})){o=_m8;break;}}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}if(o){var m=o.name;if(!he(this.oldSelectRect,o.rect)){var l=/* @__PURE__ */new Map([[m,o]]);this.getSelecteorInfo(l),this.draw(e,this.fullLayer,{intersectRect:o.rect,subNodeMap:l,selectIds:this.selectIds||[]},n);}this.selectIds=[m],this.oldSelectRect=o.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator23=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _step23$value=_slicedToArray(_step23.value,2),_e6=_step23$value[0],n=_step23$value[1];n.isSelected&&(t=Pt(t,n.rect),this.vNodes.unSelected(_e6));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var e;var _iterator24=_createForOfIteratorHelper(t),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var n=_step24.value;var i=this.vNodes.get(n);i&&i.isSelected&&(e=Pt(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}return e;}},{key:"selectedByIds",value:function selectedByIds(t){var e;var _iterator25=_createForOfIteratorHelper(t),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var n=_step25.value;var i=this.vNodes.get(n);i&&(e=Pt(e,i.rect),this.vNodes.selected(n));}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}return e;}},{key:"getSelectorRect",value:function getSelectorRect(t,e){var o;var n;var i=(o=t.parent)==null?void 0:o.getElementById(e),a=i==null?void 0:i.getBoundingClientRect();return a&&(n=Pt(n,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+1),h:Math.floor(a.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===dt.Ellipse||t===dt.Triangle||t===dt.Rectangle||t===dt.Polygon||t===dt.Star||t===dt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var e,n,i,a,o,s,c,m,l,p,y,P,S,v,T,f,_iterator26,_step26,g,M,C,A,L,O,w,b,I,R,W,d,_g13,_M8,_C6,u;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:e=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,a=t.willSerializeData,o=t.worker,s=t.offset,c=this.fullLayer;if(c){_context24.next=3;break;}return _context24.abrupt("return");case 3:l=/* @__PURE__ */new Map(),p=e.originPoint,y=e.workState,P=e.angle,S=e.translate,v=e.dir,T=e.scale;s&&(S?e.translate=[S[0]+s[0],S[1]+s[1]]:e.translate=s);if(!(p||S||kt(P))){_context24.next=10;break;}if(!(y===Ot.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:ot.Select,dataType:Tt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(!(f=i.getLastTarget(),!f)){_context24.next=10;break;}return _context24.abrupt("return");case 10:if(!n){_context24.next=61;break;}_iterator26=_createForOfIteratorHelper(n);_context24.prev=12;_iterator26.s();case 14:if((_step26=_iterator26.n()).done){_context24.next=53;break;}g=_step26.value;M=i.get(g);if(!M){_context24.next=51;break;}C=M.toolsType,A=M.opt,L=(c==null?void 0:c.getElementsByName(g))[0];if(!L){_context24.next=51;break;}O=_objectSpread({},e);w=void 0;b=vt.isWillRefresh({toolsType:C,opt:A,updateOpt:O,vNodes:i,node:L,willSerializeData:a});if(!C){_context24.next=51;break;}w=f==null?void 0:f.get(g);I=Ai(C);if(!(I==null||I.updateNodeOpt({node:L,opt:O,vNodes:i,willSerializeData:a,targetNode:w}),M&&o&&b)){_context24.next=50;break;}R=o.createWorkShapeNode({workId:g,toolsType:C,toolsOpt:M.opt});R==null||R.setWorkId(g);W=void 0;if(!(C===dt.Image)){_context24.next=36;break;}_context24.next=33;return R.consumeServiceAsync({isFullWork:!0,replaceId:g,worker:o});case 33:W=_context24.sent;_context24.next=49;break;case 36:if(!(C===dt.Text)){_context24.next=42;break;}_context24.next=39;return R.consumeServiceAsync({isFullWork:!0,replaceId:g});case 39:W=_context24.sent;_context24.next=49;break;case 42:_context24.prev=42;W=R==null?void 0:R.consumeService({op:M.op,isFullWork:!0,replaceId:g,workState:y});_context24.next=49;break;case 46:_context24.prev=46;_context24.t0=_context24["catch"](42);return _context24.abrupt("continue",51);case 49:W&&(M.rect=W);case 50:M&&(l.set(g,M),m=Pt(m,M.rect));case 51:_context24.next=14;break;case 53:_context24.next=58;break;case 55:_context24.prev=55;_context24.t1=_context24["catch"](12);_iterator26.e(_context24.t1);case 58:_context24.prev=58;_iterator26.f();return _context24.finish(58);case 61:f&&y===Ot.Done&&(i.deleteLastTarget(),f=void 0);d=m;if(!(p&&S&&T&&v&&d&&!s)){_context24.next=81;break;}_g13=[[d.x,d.y],[d.x+d.w,d.y],[d.x+d.w,d.y+d.h],[d.x,d.y+d.h]];_context24.t2=v;_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?_M8=_g13[0]:S[0]>0?_M8=_g13[3]:S[1]>0?_M8=_g13[1]:_M8=_g13[2];return _context24.abrupt("break",76);case 70:S[0]<0&&S[1]>0?_M8=_g13[1]:S[0]<0?_M8=_g13[2]:S[1]>0?_M8=_g13[0]:_M8=_g13[3];return _context24.abrupt("break",76);case 72:S[0]<0&&S[1]<0?_M8=_g13[2]:S[0]<0?_M8=_g13[1]:S[1]<0?_M8=_g13[3]:_M8=_g13[0];return _context24.abrupt("break",76);case 74:S[0]>0&&S[1]<0?_M8=_g13[3]:S[0]>0?_M8=_g13[0]:S[1]<0?_M8=_g13[2]:_M8=_g13[1];return _context24.abrupt("break",76);case 76:_C6=_M8&&[p[0]-_M8[0],p[1]-_M8[1]]||[0,0];if(he(_C6,[0,0])){_context24.next=81;break;}_context24.next=80;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{workState:y},offset:_C6}));case 80:return _context24.abrupt("return",_context24.sent);case 81:this.getSelecteorInfo(l),this.draw(Wt,c,{selectIds:n||[],subNodeMap:l,intersectRect:d});u=Pt(this.oldSelectRect,d);return _context24.abrupt("return",(this.oldSelectRect=d,{type:ot.Select,dataType:Tt.Local,selectRect:d,renderRect:m,rect:Pt(u,d),selectIds:n}));case 84:case"end":return _context24.stop();}},_callee22,this,[[12,55,58,61],[42,46]]);}));function updateSelector(_x24){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:ot.Select,dataType:Tt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(We,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,e,n){var _this71=this;var i=e.selectIds,a=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,a);var s;var c=/* @__PURE__ */new Map();return i==null||i.forEach(function(m){var l=_this71.vNodes.get(m);l&&(s=Pt(s,l.rect),c.set(m,l));}),this.getSelecteorInfo(c),this.draw(a,this.fullLayer,{intersectRect:s,selectIds:i||[],subNodeMap:c},n),Pt(s,o);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this72=this;var n;var t;var e=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(i){var a=_this72.vNodes.get(i);a&&(t=Pt(t,a.rect),e.set(i,a));},this),this.getSelecteorInfo(e),this.draw(Wt,this.fullLayer,{intersectRect:t,subNodeMap:e,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var a;var e;var n=(a=this.selectIds)==null?void 0:a.filter(function(o){return!t.includes(o);});if(n!=null&&n.length&&(e=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);e=Pt(e,o);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:e,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var a,o;var e=this.oldSelectRect;this.selectIds=[];var n=(a=this.workId)==null?void 0:a.toString(),i=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(i,n,!0),this.oldSelectRect&&!he(e,this.oldSelectRect))return{type:ot.CursorHover,dataType:Tt.Local,rect:Pt(e,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),e&&!this.oldSelectRect)return this.cursorBlur(),{type:ot.CursorHover,dataType:Tt.Local,rect:e,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var e,n;this.selectIds=[];var t=(e=this.workId)==null?void 0:e.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(i){i.name===t&&i.remove();});}}]);}(vt);tt(rr,"selectorBorderId","selector-border");var Ze=rr;var xi=/*#__PURE__*/function(_vt5){function xi(t){var _this73;_classCallCheck(this,xi);_this73=_callSuper(this,xi,[t]);tt(_this73,"canRotate",!1);tt(_this73,"scaleType",bt.both);tt(_this73,"toolsType",dt.Arrow);tt(_this73,"tmpPoints",[]);tt(_this73,"workOptions");tt(_this73,"oldRect");tt(_this73,"arrowTipWidth");tt(_this73,"syncTimestamp");_this73.workOptions=t.toolsOpt,_this73.arrowTipWidth=_this73.workOptions.thickness*4,_this73.syncTimestamp=0,_this73.syncUnitTime=50;return _this73;}_inherits(xi,_vt5);return _createClass(xi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ot.None};var m;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],m=!1):m=this.updateTempPoints(s),!m)return{type:ot.None};var l;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;l=this.draw({workId:o,layer:y});}if(!i){var _y9=Date.now();return _y9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y9,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ot.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:ot.None};}var p=Pt(l,this.oldRect);return this.oldRect=l,_objectSpread(_objectSpread({rect:p},this.baseConsumeResult),{},{type:ot.DrawWork,dataType:Tt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=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:vt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:ot.FullWork,dataType:Tt.Local,ops:a,isSync:!0});}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawEraserlines,_this$workOptions6=this.workOptions,a=_this$workOptions6.strokeColor,o=_this$workOptions6.thickness,s=_this$workOptions6.zIndex,c=_this$workOptions6.scale,m=_this$workOptions6.rotate,l=_this$workOptions6.translate,p=_this$workOptions6.strokeType,y=_this$workOptions6.eraserlines,P=n.worldPosition,S=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(o),v=_this$computDrawPoint2.points,T=_this$computDrawPoint2.pos,f=_this$computDrawPoint2.rect,d=_this$computDrawPoint2.isTriangle,u=_this$computDrawPoint2.trianglePoints,g=_this$computDrawPoint2.trianglePos,M=[f.x+f.w/2,f.y+f.h/2],C={pos:M,name:e,id:e,zIndex:s,anchor:[0.5,0.5],size:[f.w,f.h]};c&&(C.scale=c),m&&(C.rotate=m),l&&(C.translate=l);var A=new Qt(C),L={points:u,pos:[g[0]-M[0],g[1]-M[1]],fillColor:a,strokeColor:a,lineWidth:0,normalize:!1},O=new ue(L);if(A.append(O),!d&&v&&T){var w={points:v,pos:[T[0]-M[0],T[1]-M[1]],fillColor:a,strokeColor:a,lineDash:p===wt.Dotted&&!d?[1,o*2]:p===wt.LongDotted&&!d?[o,o*2]:void 0,lineCap:p===wt.Normal?void 0:"round",lineWidth:o,normalize:!1},b=new ue(w);A.append(b);}if(y&&(this.scaleType=bt.proportional,this.drawEraserlines({group:A,eraserlines:y,pos:M,layer:n},i)),this.replace(n,e,A),c||m||l){var _w8=A.getBoundingClientRect();return{x:Math.floor(_w8.x-vt.SafeBorderPadding),y:Math.floor(_w8.y-vt.SafeBorderPadding),w:Math.floor(_w8.width+vt.SafeBorderPadding*2),h:Math.floor(_w8.height+vt.SafeBorderPadding*2)};}return{x:Math.floor(f.x*S[0]+P[0]-vt.SafeBorderPadding),y:Math.floor(f.y*S[1]+P[1]-vt.SafeBorderPadding),w:Math.floor(f.w*S[0]+2*vt.SafeBorderPadding),h:Math.floor(f.h*S[1]+2*vt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(t):this.computTrianglePoints();}},{key:"computFullArrowPoints",value:function computFullArrowPoints(t){var _this74=this;var e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),o=_.Mul(e,this.arrowTipWidth),s=_.Sub(this.tmpPoints[1],o),c=xt.Sub(s,n),m=xt.Add(s,n),l=_.Per(e).mul(t*1.5),p=xt.Sub(s,l),y=xt.Add(s,l),P=[this.tmpPoints[0],s],S=[p,this.tmpPoints[1],y],v=[i,a].concat(S,[c,m]);return{trianglePoints:S.map(function(T){return xt.Sub(T,_this74.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:P.map(function(T){return xt.Sub(T,_this74.tmpPoints[0]).XY;}).flat(1),rect:Ft(v),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this75=this;var t=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),e=this.tmpPoints[1].distance(this.tmpPoints[0]),n=_.Per(t).mul(Math.floor(e*3/8)),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],a];return{trianglePoints:o.map(function(s){return xt.Sub(s,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:Ft(o),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var e=t.op,n=t.isFullWork,_t$workState2=t.workState,i=_t$workState2===void 0?Ot.Done:_t$workState2,a=(c=this.workId)==null?void 0:c.toString();if(!a)return;this.tmpPoints.length=0;for(var l=0;l<e.length;l+=3)this.tmpPoints.push(new xt(e[l],e[l+1],e[l+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:a,layer:o,isDrawEraserlines:i===Ot.Done});return this.oldRect=s,(m=this.vNodes)==null||m.setInfo(a,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:vt.getCenterPos(s,o)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.tagName==="GROUP"?e.children.forEach(function(l){l.setAttribute("strokeColor",a),l.getAttribute("fillColor")&&l.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(c=s==null?void 0:s.opt)!=null&&c.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(m=s.opt)!=null&&m.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),vt.updateNodeOpt(t);}}]);}(vt);var Ti=/*#__PURE__*/function(_vt6){function Ti(t){var _this76;_classCallCheck(this,Ti);_this76=_callSuper(this,Ti,[t]);tt(_this76,"canRotate",!1);tt(_this76,"scaleType",bt.all);tt(_this76,"toolsType",dt.Ellipse);tt(_this76,"tmpPoints",[]);tt(_this76,"workOptions");tt(_this76,"oldRect");tt(_this76,"syncTimestamp");_this76.workOptions=t.toolsOpt,_this76.syncTimestamp=0,_this76.syncUnitTime=50;return _this76;}_inherits(Ti,_vt6);return _createClass(Ti,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ot.None};var m;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],m=!1):m=this.updateTempPoints(s),!m)return{type:ot.None};if(!i){var p=Date.now();return p-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=p,_objectSpread(_objectSpread({type:ot.DrawWork,dataType:Tt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(y){return[].concat(_toConsumableArray(y.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:ot.None};}var l;if(i||a){var _p3=n?this.fullLayer:this.drawLayer||this.fullLayer;l=this.draw({workId:o,layer:_p3,isDrawing:!0});var y=_p3.parent.parent,P={x:0,y:0,w:Math.floor(y.width),h:Math.floor(y.height)};if(Ke(l,P)!==qt.outside){var v=Pt(l,this.oldRect);return this.oldRect=l,_objectSpread({rect:v,type:ot.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}return{type:ot.None};}return{type:ot.None};}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=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&&vt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n,type:ot.FullWork,dataType:Tt.Local},this.baseConsumeResult),{},{ops:a,isSync:!0});}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,a=t.isDrawEraserlines,_this$workOptions7=this.workOptions,o=_this$workOptions7.strokeColor,s=_this$workOptions7.fillColor,c=_this$workOptions7.thickness,m=_this$workOptions7.zIndex,l=_this$workOptions7.scale,p=_this$workOptions7.rotate,y=_this$workOptions7.translate,P=_this$workOptions7.strokeType,S=_this$workOptions7.eraserlines,v=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(c),T=_this$computDrawPoint3.radius,f=_this$computDrawPoint3.rect,d=_this$computDrawPoint3.pos,u={closeType:"normal",radius:T,lineWidth:c,fillColor:s!=="transparent"&&s||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:P===wt.Dotted?[1,c*2]:P===wt.LongDotted?[c,c*2]:void 0},g={name:e,id:e,zIndex:m,pos:d,anchor:[0.5,0.5],size:[f.w,f.h]};l&&(g.scale=l),p&&(g.rotate=p),y&&(g.translate=y);var M=new Qt(g);if(i){var L=new le({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/v[0],1/v[1]]});M.append(L);}var C=new es(_objectSpread(_objectSpread({},u),{},{pos:[0,0]}));M.append(C),S&&(this.scaleType=bt.proportional,this.drawEraserlines({group:M,eraserlines:S,pos:d,layer:n},a)),this.replace(n,e,M);var A=M.getBoundingClientRect();return{x:Math.floor(A.x-vt.SafeBorderPadding),y:Math.floor(A.y-vt.SafeBorderPadding),w:Math.floor(A.width+vt.SafeBorderPadding*2),h:Math.floor(A.height+vt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=Ft(this.tmpPoints),n=Ft(this.tmpPoints,t),i=[Math.floor(e.x+e.w/2),Math.floor(e.y+e.h/2)];return{rect:n,pos:i,radius:[Math.floor(e.w/2),Math.floor(e.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var e=t.op,n=t.isFullWork,_t$workState3=t.workState,i=_t$workState3===void 0?Ot.Done:_t$workState3,a=(c=this.workId)==null?void 0:c.toString();if(!a)return;this.tmpPoints.length=0;for(var l=0;l<e.length;l+=3)this.tmpPoints.push(new xt(e[l],e[l+1],e[l+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:a,layer:o,isDrawing:!1,isDrawEraserlines:i===Ot.Done});return this.oldRect=s,(m=this.vNodes)==null||m.setInfo(a,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:vt.getCenterPos(s,o)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var l,p,y;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.strokeType,c=i.get(e.name);var m=e;return e.tagName==="GROUP"&&(m=e.children[0]),a&&(m.setAttribute("strokeColor",a),(l=c==null?void 0:c.opt)!=null&&l.strokeColor&&(c.opt.strokeColor=a)),o&&(o==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",o),(p=c==null?void 0:c.opt)!=null&&p.fillColor&&(c.opt.fillColor=o)),s&&c!=null&&c.opt&&(y=c.opt)!=null&&y.strokeType&&(c.opt.strokeType=s),c&&i.setInfo(e.name,c),vt.updateNodeOpt(t);}}]);}(vt);var Mi=/*#__PURE__*/function(_vt7){function Mi(t){var _this77;_classCallCheck(this,Mi);_this77=_callSuper(this,Mi,[t]);tt(_this77,"canRotate",!0);tt(_this77,"scaleType",bt.all);tt(_this77,"toolsType",dt.Rectangle);tt(_this77,"tmpPoints",[]);tt(_this77,"workOptions");tt(_this77,"oldRect");tt(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(Mi,_vt7);return _createClass(Mi,[{key:"transformData",value:function transformData(){var t=Ft(this.tmpPoints);return[[t.x,t.y,0],[t.x+t.w,t.y,0],[t.x+t.w,t.y+t.h,0],[t.x,t.y+t.h,0]];}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=this.workOptions.thickness,n=[];var _iterator27=_createForOfIteratorHelper(t),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var o=_step27.value;n.push(_construct(_,_toConsumableArray(o)));}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}var i=Ft(n,e),a=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:a,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ot.None};var m;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],m=!1):m=this.updateTempPoints(s),!m)return{type:ot.None};var l=this.transformData();var p;if(i||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({ps:l,workId:o,layer:P,isDrawing:!0});}if(!i){var _P2=Date.now();return _P2-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P2,_objectSpread({type:ot.DrawWork,dataType:Tt.Local,op:l.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ot.None};}var y=Pt(p,this.oldRect);return this.oldRect=p,_objectSpread({rect:y,type:ot.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var s;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.RemoveNode,removeIds:[t]};var e=this.transformData(),n=this.fullLayer,i=this.draw({ps:e,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var a=e.flat(1),o=te(a);return(s=this.vNodes)==null||s.setInfo(t,{rect:i,op:a,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&vt.getCenterPos(i,n)}),_objectSpread({rect:i,type:ot.FullWork,dataType:Tt.Local,ops:o,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,a=t.ps,o=t.replaceId,_t$isDrawEraserlines2=t.isDrawEraserlines,s=_t$isDrawEraserlines2===void 0?!0:_t$isDrawEraserlines2,_this$workOptions8=this.workOptions,c=_this$workOptions8.strokeColor,m=_this$workOptions8.fillColor,l=_this$workOptions8.thickness,p=_this$workOptions8.zIndex,y=_this$workOptions8.scale,P=_this$workOptions8.rotate,S=_this$workOptions8.translate,v=_this$workOptions8.strokeType,T=_this$workOptions8.eraserlines,f=n.worldPosition,d=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(a),u=_this$computDrawPoint4.points,g=_this$computDrawPoint4.rect,M=_this$computDrawPoint4.pos,C={close:!0,normalize:!0,points:u,lineWidth:l,fillColor:m!=="transparent"&&m||void 0,strokeColor:c,lineJoin:"round",lineCap:"round",lineDash:v===wt.Dotted?[1,l*2]:v===wt.LongDotted?[l,l*2]:void 0},A={x:Math.floor(g.x*d[0]+f[0]-vt.SafeBorderPadding),y:Math.floor(g.y*d[1]+f[1]-vt.SafeBorderPadding),w:Math.floor(g.w*d[0]+2*vt.SafeBorderPadding),h:Math.floor(g.h*d[0]+2*vt.SafeBorderPadding)},L=new Qt({name:e,id:e,zIndex:p,pos:M,anchor:[0.5,0.5],size:[g.w,g.h],scale:y,rotate:P,translate:S}),O=new ue(_objectSpread(_objectSpread({},C),{},{pos:[0,0]}));if(L.appendChild(O),i){var w=new le({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:c,lineWidth:1,scale:[1/d[0],1/d[1]]});L.appendChild(w);}if(T&&(this.scaleType=bt.proportional,this.drawEraserlines({group:L,eraserlines:T,pos:M,layer:n},s)),this.replace(n,o||e,L),y||P||S){var _w9=L.getBoundingClientRect();return{x:Math.floor(_w9.x-vt.SafeBorderPadding),y:Math.floor(_w9.y-vt.SafeBorderPadding),w:Math.floor(_w9.width+2*vt.SafeBorderPadding),h:Math.floor(_w9.height+2*vt.SafeBorderPadding)};}return A;}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var l,p;var e=t.op,n=t.isFullWork,i=t.replaceId,_t$workState4=t.workState,a=_t$workState4===void 0?Ot.Done:_t$workState4,o=(l=this.workId)==null?void 0:l.toString();if(!o)return;var s=[];for(var y=0;y<e.length;y+=3)s.push([e[y],e[y+1],e[y+2]]);var c=n?this.fullLayer:this.drawLayer||this.fullLayer,m=this.draw({ps:s,workId:o,layer:c,isDrawing:!1,replaceId:i,isDrawEraserlines:a===Ot.Done});return this.oldRect=m,(p=this.vNodes)==null||p.setInfo(o,{rect:m,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&vt.getCenterPos(m,c)}),m;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var l,p,y;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.strokeType,c=i.get(e.name);var m=e;return e.tagName==="GROUP"&&(m=e.children[0]),a&&(m.setAttribute("strokeColor",a),(l=c==null?void 0:c.opt)!=null&&l.strokeColor&&(c.opt.strokeColor=a)),o&&(o==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",o),(p=c==null?void 0:c.opt)!=null&&p.fillColor&&(c.opt.fillColor=o)),s&&c!=null&&c.opt&&(y=c.opt)!=null&&y.strokeType&&(c.opt.strokeType=s),c&&i.setInfo(e.name,c),vt.updateNodeOpt(t);}}]);}(vt);var Pi=/*#__PURE__*/function(_vt8){function Pi(t){var _this78;_classCallCheck(this,Pi);_this78=_callSuper(this,Pi,[t]);tt(_this78,"canRotate",!1);tt(_this78,"scaleType",bt.all);tt(_this78,"toolsType",dt.Star);tt(_this78,"tmpPoints",[]);tt(_this78,"workOptions");tt(_this78,"oldRect");tt(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(Pi,_vt8);return _createClass(Pi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ot.None};var m;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],m=!1):m=this.updateTempPoints(s),!m)return{type:ot.None};var l;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;l=this.draw({workId:o,layer:y,isDrawing:!0});}if(!i){var _y10=Date.now();return _y10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y10,_objectSpread({type:ot.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ot.None};}var p=Pt(l,this.oldRect);return this.oldRect=l,_objectSpread({rect:p,type:ot.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=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&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ot.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_t$isDrawEraserlines3=t.isDrawEraserlines,a=_t$isDrawEraserlines3===void 0?!0:_t$isDrawEraserlines3,_this$workOptions9=this.workOptions,o=_this$workOptions9.strokeColor,s=_this$workOptions9.fillColor,c=_this$workOptions9.thickness,m=_this$workOptions9.zIndex,l=_this$workOptions9.vertices,p=_this$workOptions9.innerVerticeStep,y=_this$workOptions9.innerRatio,P=_this$workOptions9.scale,S=_this$workOptions9.rotate,v=_this$workOptions9.translate,T=_this$workOptions9.strokeType,f=_this$workOptions9.eraserlines,d=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(c,l,p,y),u=_this$computDrawPoint5.rect,g=_this$computDrawPoint5.pos,M=_this$computDrawPoint5.points,C={close:!0,points:M,lineWidth:c,fillColor:s!=="transparent"&&s||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:T===wt.Dotted?[1,c*2]:T===wt.LongDotted?[c,c*2]:void 0},A={name:e,id:e,zIndex:m,pos:g,anchor:[0.5,0.5],size:[u.w,u.h]};P&&(A.scale=P),S&&(A.rotate=S),v&&(A.translate=v);var L=new Qt(A);if(i){var b=new le({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/d[0],1/d[1]]});L.append(b);}var O=new ue(_objectSpread(_objectSpread({},C),{},{pos:[0,0]}));L.append(O),f&&(this.scaleType=bt.proportional,this.drawEraserlines({group:L,eraserlines:f,pos:g,layer:n},a)),this.replace(n,e,L);var w=L.getBoundingClientRect();return{x:Math.floor(w.x-vt.SafeBorderPadding),y:Math.floor(w.y-vt.SafeBorderPadding),w:Math.floor(w.width+vt.SafeBorderPadding*2),h:Math.floor(w.height+vt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e,n,i){var a=Ft(this.tmpPoints),o=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],s=wi(a.w,a.h),c=Math.floor(Math.min(a.w,a.h)/2),m=i*c,l=[],p=2*Math.PI/e;for(var P=0;P<e;P++){var S=P*p-0.5*Math.PI;var v=void 0,_T32=void 0;P%n===1?(v=m*s[0]*Math.cos(S),_T32=m*s[1]*Math.sin(S)):(v=c*s[0]*Math.cos(S),_T32=c*s[1]*Math.sin(S),l.push(v,_T32)),l.push(v,_T32);}return{rect:Ft(this.tmpPoints,t),pos:o,points:l};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.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 c,m;var e=t.op,n=t.isFullWork,_t$workState5=t.workState,i=_t$workState5===void 0?Ot.Done:_t$workState5,a=(c=this.workId)==null?void 0:c.toString();if(!a)return;this.tmpPoints.length=0;for(var l=0;l<e.length;l+=3)this.tmpPoints.push(new xt(e[l],e[l+1],e[l+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:a,layer:o,isDrawing:!1,isDrawEraserlines:i===Ot.Done});return this.oldRect=s,(m=this.vNodes)==null||m.setInfo(a,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&vt.getCenterPos(s,o)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var v;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.vertices,m=n.innerVerticeStep,l=n.innerRatio,p=n.strokeType,y=i.get(e.name),P=y==null?void 0:y.opt;var S=e;return e.tagName==="GROUP"&&(S=e.children[0]),a&&(S.setAttribute("strokeColor",a),P!=null&&P.strokeColor&&(P.strokeColor=a)),o&&(o==="transparent"?S.setAttribute("fillColor","rgba(0,0,0,0)"):S.setAttribute("fillColor",o),P!=null&&P.fillColor&&(P.fillColor=o)),s===dt.Star&&(c&&(P.vertices=c),m&&(P.innerVerticeStep=m),l&&(P.innerRatio=l)),p&&y!=null&&y.opt&&(v=y.opt)!=null&&v.strokeType&&(y.opt.strokeType=p),y&&i.setInfo(e.name,_objectSpread(_objectSpread({},y),{},{opt:P})),vt.updateNodeOpt(t);}}]);}(vt);var Oi=/*#__PURE__*/function(_vt9){function Oi(t){var _this79;_classCallCheck(this,Oi);_this79=_callSuper(this,Oi,[t]);tt(_this79,"canRotate",!1);tt(_this79,"scaleType",bt.all);tt(_this79,"toolsType",dt.Polygon);tt(_this79,"tmpPoints",[]);tt(_this79,"workOptions");tt(_this79,"oldRect");tt(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(Oi,_vt9);return _createClass(Oi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=e.op,s=this.workId,c=o==null?void 0:o.length;if(!c||c<2)return{type:ot.None};var m;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(o[0],o[1])],m=!1):m=this.updateTempPoints(o),!m)return{type:ot.None};var l;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;l=this.draw({workId:s,layer:y,isDrawing:!0});}if(!i){var _y11=Date.now();return _y11-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y11,_objectSpread({type:ot.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ot.None};}var p=Pt(l,this.oldRect);return this.oldRect=l,_objectSpread({rect:p,type:ot.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=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&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ot.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_t$isDrawEraserlines4=t.isDrawEraserlines,a=_t$isDrawEraserlines4===void 0?!0:_t$isDrawEraserlines4,_this$workOptions10=this.workOptions,o=_this$workOptions10.strokeColor,s=_this$workOptions10.fillColor,c=_this$workOptions10.thickness,m=_this$workOptions10.zIndex,l=_this$workOptions10.vertices,p=_this$workOptions10.scale,y=_this$workOptions10.rotate,P=_this$workOptions10.translate,S=_this$workOptions10.strokeType,v=_this$workOptions10.eraserlines,T=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(c,l),f=_this$computDrawPoint6.rect,d=_this$computDrawPoint6.pos,u=_this$computDrawPoint6.points,g={close:!0,points:u,lineWidth:c,fillColor:s!=="transparent"&&s||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:S===wt.Dotted?[1,c*2]:S===wt.LongDotted?[c,c*2]:void 0},M={name:e,id:e,zIndex:m,pos:d,anchor:[0.5,0.5],size:[f.w,f.h]};p&&(M.scale=p),y&&(M.rotate=y),P&&(M.translate=P);var C=new Qt(M);if(i){var O=new le({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/T[0],1/T[1]]});C.append(O);}var A=new ue(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));C.append(A),v&&(this.scaleType=bt.proportional,this.drawEraserlines({group:C,eraserlines:v,pos:d,layer:n},a)),this.replace(n,e,C);var L=C.getBoundingClientRect();return{x:Math.floor(L.x-vt.SafeBorderPadding),y:Math.floor(L.y-vt.SafeBorderPadding),w:Math.floor(L.width+vt.SafeBorderPadding*2),h:Math.floor(L.height+vt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Ft(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=wi(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),s=[],c=2*Math.PI/e;for(var l=0;l<e;l++){var p=l*c-0.5*Math.PI,y=o*a[0]*Math.cos(p),P=o*a[1]*Math.sin(p);s.push(y,P);}return{rect:Ft(this.tmpPoints,t),pos:i,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.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 c,m;var e=t.op,n=t.isFullWork,_t$workState6=t.workState,i=_t$workState6===void 0?Ot.Done:_t$workState6,a=(c=this.workId)==null?void 0:c.toString();if(!a)return;this.tmpPoints.length=0;for(var l=0;l<e.length;l+=3)this.tmpPoints.push(new xt(e[l],e[l+1],e[l+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:a,layer:o,isDrawing:!1,isDrawEraserlines:i===Ot.Done});return this.oldRect=s,(m=this.vNodes)==null||m.setInfo(a,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&vt.getCenterPos(s,o)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var P;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.vertices,m=n.strokeType,l=i.get(e.name),p=l==null?void 0:l.opt;var y=e;return e.tagName==="GROUP"&&(y=e.children[0]),a&&(y.setAttribute("strokeColor",a),p!=null&&p.strokeColor&&(p.strokeColor=a)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),p!=null&&p.fillColor&&(p.fillColor=o)),s===dt.Polygon&&c&&(p.vertices=c),m&&l!=null&&l.opt&&(P=l.opt)!=null&&P.strokeType&&(l.opt.strokeType=m),l&&i.setInfo(e.name,_objectSpread(_objectSpread({},l),{},{opt:p})),vt.updateNodeOpt(t);}}]);}(vt);var re=/*#__PURE__*/function(){function re(){_classCallCheck(this,re);}return _createClass(re,null,[{key:"bezier",value:function bezier(r,t){var e=[];for(var n=0;n<t.length;n+=4){var i=t[n],a=t[n+1],o=t[n+2],s=t[n+3];i&&a&&o&&s?e.push.apply(e,_toConsumableArray(re.getBezierPoints(r,i,a,o,s))):i&&a&&o?e.push.apply(e,_toConsumableArray(re.getBezierPoints(r,i,a,o))):i&&a?e.push.apply(e,_toConsumableArray(re.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
|
|
429
|
+
* @desc 获取点,这里可以设置点的个数
|
|
430
|
+
* @param {number} num 点个数
|
|
431
|
+
* @param {Vec2d} p1 点坐标
|
|
432
|
+
* @param {Vec2d} p2 点坐标
|
|
433
|
+
* @param {Vec2d} p3 点坐标
|
|
434
|
+
* @param {Vec2d} p4 点坐标
|
|
435
|
+
* 如果参数是 num, p1, p2 为一阶贝塞尔
|
|
436
|
+
* 如果参数是 num, p1, c1, p2 为二阶贝塞尔
|
|
437
|
+
* 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
|
|
438
|
+
*/},{key:"getBezierPoints",value:function getBezierPoints(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var e=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var i=arguments.length>4?arguments[4]:undefined;var a=null;var o=[];!n&&!i?a=re.oneBezier:n&&!i?a=re.twoBezier:n&&i&&(a=re.threeBezier);for(var s=0;s<r;s++)a&&o.push(a(s/r,t,e,n,i));return i?o.push(i):n&&o.push(n),o;}/**
|
|
439
|
+
* @desc 一阶贝塞尔
|
|
440
|
+
* @param {number} t 当前百分比
|
|
441
|
+
* @param {Vec2d} p1 起点坐标
|
|
442
|
+
* @param {Vec2d} p2 终点坐标
|
|
443
|
+
*/},{key:"oneBezier",value:function oneBezier(r,t,e){var n=t.x+(e.x-t.x)*r,i=t.y+(e.y-t.y)*r;return new _(n,i);}/**
|
|
444
|
+
* @desc 二阶贝塞尔
|
|
445
|
+
* @param {number} t 当前百分比
|
|
446
|
+
* @param {Array} p1 起点坐标
|
|
447
|
+
* @param {Array} p2 终点坐标
|
|
448
|
+
* @param {Array} cp 控制点
|
|
449
|
+
*/},{key:"twoBezier",value:function twoBezier(r,t,e,n){var i=(1-r)*(1-r)*t.x+2*r*(1-r)*e.x+r*r*n.x,a=(1-r)*(1-r)*t.y+2*r*(1-r)*e.y+r*r*n.y;return new _(i,a);}/**
|
|
450
|
+
* @desc 三阶贝塞尔
|
|
451
|
+
* @param {number} t 当前百分比
|
|
452
|
+
* @param {Array} p1 起点坐标
|
|
453
|
+
* @param {Array} p2 终点坐标
|
|
454
|
+
* @param {Array} cp1 控制点1
|
|
455
|
+
* @param {Array} cp2 控制点2
|
|
456
|
+
*/},{key:"threeBezier",value:function threeBezier(r,t,e,n,i){var a=t.x*(1-r)*(1-r)*(1-r)+3*e.x*r*(1-r)*(1-r)+3*n.x*r*r*(1-r)+i.x*r*r*r,o=t.y*(1-r)*(1-r)*(1-r)+3*e.y*r*(1-r)*(1-r)+3*n.y*r*r*(1-r)+i.y*r*r*r;return new _(a,o);}}]);}();var Ei=/*#__PURE__*/function(_vt10){function Ei(t){var _this80;_classCallCheck(this,Ei);_this80=_callSuper(this,Ei,[t]);tt(_this80,"canRotate",!1);tt(_this80,"scaleType",bt.all);tt(_this80,"toolsType",dt.SpeechBalloon);tt(_this80,"ratio",0.8);tt(_this80,"tmpPoints",[]);tt(_this80,"workOptions");tt(_this80,"oldRect");tt(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(Ei,_vt10);return _createClass(Ei,[{key:"consume",value:function consume(t){var y;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(y=e==null?void 0:e.workId)==null?void 0:y.toString();if(!o)return{type:ot.None};var s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ot.None};var m;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],m=!1):m=this.updateTempPoints(s),!m)return{type:ot.None};var l;if(i||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;l=this.draw({workId:o,layer:P,isDrawing:!0});}if(!i){var _P3=Date.now();return _P3-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P3,_objectSpread({type:ot.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ot.None};}var p=Pt(l,this.oldRect);return this.oldRect=l,_objectSpread({rect:p,type:ot.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=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&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ot.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_t$isDrawEraserlines5=t.isDrawEraserlines,i=_t$isDrawEraserlines5===void 0?!0:_t$isDrawEraserlines5,_this$workOptions11=this.workOptions,a=_this$workOptions11.strokeColor,o=_this$workOptions11.fillColor,s=_this$workOptions11.thickness,c=_this$workOptions11.zIndex,m=_this$workOptions11.placement,l=_this$workOptions11.scale,p=_this$workOptions11.rotate,y=_this$workOptions11.translate,P=_this$workOptions11.strokeType,S=_this$workOptions11.eraserlines,_this$computDrawPoint7=this.computDrawPoints(s,m),v=_this$computDrawPoint7.rect,T=_this$computDrawPoint7.pos,f=_this$computDrawPoint7.points,d={points:f.map(function(A){return A.XY;}),lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,className:"".concat(T[0],",").concat(T[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:P===wt.Dotted?[1,s*2]:P===wt.LongDotted?[s,s*2]:void 0},u={name:e,id:e,zIndex:c,pos:T,anchor:[0.5,0.5],size:[v.w,v.h]};l&&(u.scale=l),p&&(u.rotate=p),y&&(u.translate=y);var g=new Qt(u),M=new ue(_objectSpread(_objectSpread({},d),{},{pos:[0,0]}));g.append(M),S&&(this.scaleType=bt.proportional,this.drawEraserlines({group:g,eraserlines:S,pos:T,layer:n},i)),this.replace(n,e,g);var C=g.getBoundingClientRect();return{x:Math.floor(C.x-vt.SafeBorderPadding),y:Math.floor(C.y-vt.SafeBorderPadding),w:Math.floor(C.width+vt.SafeBorderPadding*2),h:Math.floor(C.height+vt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var e=Ft(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=e.y+e.h*this.ratio;return[new _(e.x,e.y,0),new _(e.x+e.w,e.y,0),new _(e.x+e.w,n,0),new _(e.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=e.y+e.h*(1-this.ratio);return[new _(e.x,_n4,0),new _(e.x+e.w,_n4,0),new _(e.x+e.w,e.y+e.h,0),new _(e.x,e.y+e.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=e.x+e.w*(1-this.ratio);return[new _(_n5,e.y,0),new _(e.x+e.w,e.y,0),new _(e.x+e.w,e.y+e.h,0),new _(_n5,e.y+e.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=e.x+e.w*this.ratio;return[new _(e.x,e.y,0),new _(_n6,e.y,0),new _(_n6,e.y+e.h,0),new _(e.x,e.y+e.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Ft(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),s=[],c=_.Add(i[0],new _(0,o,0)),m=_.Add(i[0],new _(a,0,0)),l=re.getBezierPoints(10,c,i[0],m),p=_.Sub(i[1],new _(a,0,0)),y=_.Add(i[1],new _(0,o,0)),P=re.getBezierPoints(10,p,i[1],y),S=_.Sub(i[2],new _(0,o,0)),v=_.Sub(i[2],new _(a,0,0)),T=re.getBezierPoints(10,S,i[2],v),f=_.Add(i[3],new _(a,0,0)),d=_.Sub(i[3],new _(0,o,0)),u=re.getBezierPoints(10,f,i[3],d),g=a*(1-this.ratio)*10,M=o*(1-this.ratio)*10;switch(e){case"bottom":{var L=_.Sub(i[2],new _(a*5-g/2,0,0)),O=_.Sub(i[2],new _(a*5,-M,0)),w=_.Sub(i[2],new _(a*5+g/2,0,0));s.push.apply(s,[O,w].concat(_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(P),_toConsumableArray(T),[L]));break;}case"bottomRight":{var _L11=_.Sub(i[2],new _(a*1.1,0,0)),_O9=_.Sub(i[2],new _(a*1.1+g/2,-M,0)),_w10=_.Sub(i[2],new _(a*1.1+g,0,0));s.push.apply(s,[_O9,_w10].concat(_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(P),_toConsumableArray(T),[_L11]));break;}case"bottomLeft":{var _L12=_.Add(i[3],new _(a*1.1+g,0,0)),_O10=_.Add(i[3],new _(a*1.1+g/2,M,0)),_w11=_.Add(i[3],new _(a*1.1,0,0));s.push.apply(s,[_O10,_w11].concat(_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(P),_toConsumableArray(T),[_L12]));break;}case"top":{var _L13=_.Sub(i[1],new _(a*5-g/2,0,0)),_O11=_.Sub(i[1],new _(a*5,M,0)),_w12=_.Sub(i[1],new _(a*5+g/2,0,0));s.push.apply(s,[_O11,_L13].concat(_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),[_w12]));break;}case"topRight":{var _L14=_.Sub(i[1],new _(a*1.1,0,0)),_O12=_.Sub(i[1],new _(a*1.1+g/2,M,0)),_w13=_.Sub(i[1],new _(a*1.1+g,0,0));s.push.apply(s,[_O12,_L14].concat(_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),[_w13]));break;}case"topLeft":{var _L15=_.Add(i[0],new _(a*1.1+g,0,0)),_O13=_.Add(i[0],new _(a*1.1+g/2,-M,0)),_w14=_.Add(i[0],new _(a*1.1,0,0));s.push.apply(s,[_O13,_L15].concat(_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),[_w14]));break;}case"left":{var _L16=_.Add(i[0],new _(0,o*5-M/2,0)),_O14=_.Add(i[0],new _(-g,o*5,0)),_w15=_.Add(i[0],new _(0,o*5+M/2,0));s.push.apply(s,[_O14,_L16].concat(_toConsumableArray(l),_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),[_w15]));break;}case"leftTop":{var _L17=_.Add(i[0],new _(0,o*1.1,0)),_O15=_.Add(i[0],new _(-g,o*1.1+M/2,0)),_w16=_.Add(i[0],new _(0,o*1.1+M,0));s.push.apply(s,[_O15,_L17].concat(_toConsumableArray(l),_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),[_w16]));break;}case"leftBottom":{var _L18=_.Sub(i[3],new _(0,o*1.1+M,0)),_O16=_.Sub(i[3],new _(g,o*1.1+M/2,0)),_w17=_.Sub(i[3],new _(0,o*1.1,0));s.push.apply(s,[_O16,_L18].concat(_toConsumableArray(l),_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),[_w17]));break;}case"right":{var _L19=_.Add(i[1],new _(0,o*5-M/2,0)),_O17=_.Add(i[1],new _(g,o*5,0)),_w18=_.Add(i[1],new _(0,o*5+M/2,0));s.push.apply(s,[_O17,_w18].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(P),[_L19]));break;}case"rightTop":{var _L20=_.Add(i[1],new _(0,o*1.1,0)),_O18=_.Add(i[1],new _(g,o*1.1+M/2,0)),_w19=_.Add(i[1],new _(0,o*1.1+M,0));s.push.apply(s,[_O18,_w19].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(P),[_L20]));break;}case"rightBottom":{var _L21=_.Sub(i[2],new _(0,o*1.1+M,0)),_O19=_.Sub(i[2],new _(-g,o*1.1+M/2,0)),_w20=_.Sub(i[2],new _(0,o*1.1,0));s.push.apply(s,[_O19,_w20].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(P),[_L21]));break;}}var C=Ft(this.tmpPoints,t),A=[Math.floor(C.x+C.w/2),Math.floor(C.y+C.h/2)];return{rect:C,pos:A,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.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 c,m;var e=t.op,n=t.isFullWork,_t$workState7=t.workState,i=_t$workState7===void 0?Ot.Done:_t$workState7,a=(c=this.workId)==null?void 0:c.toString();if(!a)return;this.tmpPoints.length=0;for(var l=0;l<e.length;l+=3)this.tmpPoints.push(new xt(e[l],e[l+1],e[l+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:a,layer:o,isDrawing:!1,isDrawEraserlines:i===Ot.Done});return this.oldRect=s,(m=this.vNodes)==null||m.setInfo(a,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&vt.getCenterPos(s,o)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var P;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,c=n.placement,m=n.strokeType,l=i.get(e.name),p=l==null?void 0:l.opt;var y=e;return e.tagName==="GROUP"&&(y=e.children[0]),a&&(y.setAttribute("strokeColor",a),p!=null&&p.strokeColor&&(p.strokeColor=a)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),p!=null&&p.fillColor&&(p.fillColor=o)),s===dt.SpeechBalloon&&c&&(p.placement=c),m&&l!=null&&l.opt&&(P=l.opt)!=null&&P.strokeType&&(l.opt.strokeType=m),l&&i.setInfo(e.name,_objectSpread(_objectSpread({},l),{},{opt:p})),vt.updateNodeOpt(t);}}]);}(vt);var jp=me,$p=oe,zp="[object Boolean]";function Gp(h){return h===!0||h===!1||$p(h)&&jp(h)==zp;}var Hp=Gp,Te=/* @__PURE__ */de(Hp);var Be=/*#__PURE__*/function(_vt11){function Be(t){var _this81;_classCallCheck(this,Be);_this81=_callSuper(this,Be,[t]);tt(_this81,"canRotate",!0);tt(_this81,"scaleType",bt.all);tt(_this81,"toolsType",dt.Image);tt(_this81,"tmpPoints",[]);tt(_this81,"workOptions");tt(_this81,"oldRect");_this81.workOptions=t.toolsOpt,_this81.scaleType=Be.getScaleType(_this81.workOptions);return _this81;}_inherits(Be,_vt11);return _createClass(Be,[{key:"consume",value:function consume(){return{type:ot.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ot.None};}},{key:"draw",value:function draw(t){var e=t.layer,n=t.workId,i=t.replaceId,a=t.imageBitmap,_this$workOptions12=this.workOptions,o=_this$workOptions12.centerX,s=_this$workOptions12.centerY,c=_this$workOptions12.width,m=_this$workOptions12.height,l=_this$workOptions12.rotate,p=_this$workOptions12.zIndex,y=_this$workOptions12.eraserlines,P=new Qt({anchor:[0.5,0.5],pos:[o,s],name:n,size:[c,m],zIndex:p,rotate:l}),S={anchor:[0.5,0.5],pos:[0,0],size:[c,m],texture:a};a||(S.bgcolor="rgba(0,0,0,0.3)");var v=new jn(S);P.append(v),y&&this.drawEraserlines({group:P,eraserlines:y,pos:[o,s],layer:e}),this.replace(e,i||n,P);var T=P.getBoundingClientRect();if(T)return{x:Math.floor(T.x-vt.SafeBorderPadding),y:Math.floor(T.y-vt.SafeBorderPadding),w:Math.floor(T.width+vt.SafeBorderPadding*2),h:Math.floor(T.height+vt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var m,l,p,y,e,n,i,_this$workOptions13,a,o,s,c,P,S;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:e=t.isFullWork,n=t.replaceId,i=t.worker,_this$workOptions13=this.workOptions,a=_this$workOptions13.src,o=_this$workOptions13.uuid,s=((m=this.workId)==null?void 0:m.toString())||o,c=e?this.fullLayer:this.drawLayer||this.fullLayer;if(!a){_context25.next=8;break;}_context25.next=4;return i.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:s,isSubWorker:i instanceof Fi});case 4:P=_context25.sent;if(!P){_context25.next=8;break;}S=this.draw({workId:s,layer:c,replaceId:n,imageBitmap:P});return _context25.abrupt("return",(this.oldRect=s&&((p=(l=this.vNodes)==null?void 0:l.get(s))==null?void 0:p.rect)||void 0,(y=this.vNodes)==null||y.setInfo(s,{rect:S,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:S&&vt.getCenterPos(S,c)}),S));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x25){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var e=t.uniformScale,n=t.rotate;return e!==!1||n&&Math.abs(n)%90>0?bt.proportional:bt.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.translate,s=n.originPoint,c=n.scenePoint,m=n.scale,l=n.angle,p=n.isLocked,y=n.zIndex,P=n.strokeColor,S=a&&Vt(a)||i.get(e.name);if(!S)return;var v=e.parent;if(v){if(P&&(S.opt.strokeColor=P),kt(y)&&(e.setAttribute("zIndex",y),S.opt.zIndex=y),Te(p)&&(S.opt.locked=p),s&&c&&m&&o){var _S$opt=S.opt,_T33=_S$opt.centerX,_f29=_S$opt.centerY,d=_S$opt.width,u=_S$opt.height,g=_S$opt.uniformScale,M=g!==!1?[m[0],m[0]]:m,C=[_T33,_f29],A=[_T33,_f29];zr(A,c,M,o);var L=[A[0]-C[0],A[1]-C[1]];if(S.centerPos=[S.centerPos[0]+L[0],S.centerPos[1]+L[1]],S.opt.width=Math.round(d*M[0]),S.opt.height=Math.round(u*M[1]),S.opt.centerX=A[0],S.opt.centerY=A[1],S.opt.eraserlines)for(var _i6=0,_Object$values4=Object.values(S.opt.eraserlines);_i6<_Object$values4.length;_i6++){var O=_Object$values4[_i6];var w=O.op,b=O.thickness;O.thickness=b*Math.max(m[0],m[1]);for(var I=0;I<w.length;I++)Gr(w[I],c,m,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 _T34=_Object$values5[_i7];var _f30=_T34.op;for(var _d13=0;_d13<_f30.length;_d13++){var _u13=_f30[_d13].map(function(g,M){return M%2?g+o[1]:g+o[0];});_T34.op[_d13]=_u13;}}}else if(kt(l))if(S.opt.rotate=l,S.scaleType=Be.getScaleType(S.opt),a){var _T35=Ii(S.rect,l);S.rect=_T35;}else{var _T36=vt.getRectFromLayer(v,e.name);S.rect=_T36||S.rect;}return S&&i.setInfo(e.name,S),S==null?void 0:S.rect;}}}]);}(vt);var Ci=/*#__PURE__*/function(_vt12){function Ci(t){var _this82;_classCallCheck(this,Ci);_this82=_callSuper(this,Ci,[t]);tt(_this82,"canRotate",!1);tt(_this82,"scaleType",bt.both);tt(_this82,"toolsType",dt.Straight);tt(_this82,"tmpPoints",[]);tt(_this82,"workOptions");tt(_this82,"oldRect");tt(_this82,"straightTipWidth");tt(_this82,"syncTimestamp");_this82.workOptions=t.toolsOpt,_this82.straightTipWidth=_this82.workOptions.thickness/2,_this82.syncTimestamp=0,_this82.syncUnitTime=50;return _this82;}_inherits(Ci,_vt12);return _createClass(Ci,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,c=s==null?void 0:s.length;if(!c||c<2)return{type:ot.None};var m;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],m=!1):m=this.updateTempPoints(s),!m)return{type:ot.None};var l;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;l=this.draw({workId:o,layer:y});}if(!i){var _y12=Date.now();return _y12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y12,_objectSpread({type:ot.DrawWork,dataType:Tt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ot.None};}var p=Pt(l,this.oldRect);return this.oldRect=l,_objectSpread({rect:p,type:ot.DrawWork,dataType:Tt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=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&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:ot.FullWork,dataType:Tt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_t$isDrawEraserlines6=t.isDrawEraserlines,i=_t$isDrawEraserlines6===void 0?!0:_t$isDrawEraserlines6,_this$workOptions14=this.workOptions,a=_this$workOptions14.strokeColor,o=_this$workOptions14.thickness,s=_this$workOptions14.zIndex,c=_this$workOptions14.scale,m=_this$workOptions14.rotate,l=_this$workOptions14.translate,p=_this$workOptions14.strokeType,y=_this$workOptions14.eraserlines,P=n.worldPosition,S=n.worldScaling,_this$computDrawPoint8=this.computDrawPoints(o,p),v=_this$computDrawPoint8.d,T=_this$computDrawPoint8.rect,f=_this$computDrawPoint8.isDot,d=[T.x+T.w/2,T.y+T.h/2],u=new Qt({pos:d,anchor:[0.5,0.5],size:[T.w,T.h],name:e,id:e,normalize:!0,zIndex:s}),g={pos:[0,0],normalize:!0,d:v,fillColor:a,strokeColor:a,lineDash:p===wt.Dotted&&!f?[1,o*2]:p===wt.LongDotted&&!f?[o,o*2]:void 0,lineCap:p===wt.Normal||f?void 0:"round",lineWidth:p===wt.Normal||f?0:o};c&&(g.scale=c),m&&(g.rotate=m),l&&(g.translate=l);var M=new le(g);if(u.append(M),y&&(this.scaleType=bt.proportional,this.drawEraserlines({group:u,eraserlines:y,pos:d,layer:n},i)),this.replace(n,e,u),m||c||l){var A=M.getBoundingClientRect();return{x:Math.floor(A.x-vt.SafeBorderPadding),y:Math.floor(A.y-vt.SafeBorderPadding),w:Math.floor(A.width+vt.SafeBorderPadding*2),h:Math.floor(A.height+vt.SafeBorderPadding*2)};}return{x:Math.floor(T.x*S[0]+P[0]-vt.SafeBorderPadding),y:Math.floor(T.y*S[1]+P[1]-vt.SafeBorderPadding),w:Math.floor(T.w*S[0]+2*vt.SafeBorderPadding),h:Math.floor(T.h*S[1]+2*vt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t,e):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t,e){var n=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),i=_.Per(n).mul(t/2),a=xt.Sub(this.tmpPoints[0],i),o=xt.Add(this.tmpPoints[0],i),s=xt.Sub(this.tmpPoints[1],i),c=xt.Add(this.tmpPoints[1],i),m=xt.GetSemicircleStroke(this.tmpPoints[1],s,-1,8),l=xt.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),p=[a,s].concat(_toConsumableArray(m),[c,o],_toConsumableArray(l));var y;return e!==wt.Normal?y=ae(this.tmpPoints,!1):y=ae(p,!0),{d:y,rect:Ft(p),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var e=xt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:ae(e,!0),rect:Ft(e),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var e=t.op,n=t.isFullWork,_t$workState8=t.workState,i=_t$workState8===void 0?Ot.Done:_t$workState8,a=(c=this.workId)==null?void 0:c.toString();if(!a)return;this.tmpPoints.length=0;for(var l=0;l<e.length;l+=3)this.tmpPoints.push(new xt(e[l],e[l+1],e[l+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:a,layer:o,isDrawEraserlines:i===Ot.Done});return this.oldRect=s,(m=this.vNodes)==null||m.setInfo(a,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&vt.getCenterPos(s,o)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.tagName==="GROUP"?e.children.forEach(function(l){l.setAttribute("strokeColor",a),l.getAttribute("fillColor")&&l.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(c=s==null?void 0:s.opt)!=null&&c.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(m=s.opt)!=null&&m.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),vt.updateNodeOpt(t);}}]);}(vt);var ce=/*#__PURE__*/function(_vt13){function ce(t){var _this83;_classCallCheck(this,ce);_this83=_callSuper(this,ce,[t]);tt(_this83,"canRotate",!1);tt(_this83,"scaleType",bt.proportional);tt(_this83,"toolsType",dt.Text);tt(_this83,"tmpPoints",[]);tt(_this83,"workOptions");tt(_this83,"oldRect");_this83.workOptions=t.toolsOpt;return _this83;}_inherits(ce,_vt13);return _createClass(ce,[{key:"consume",value:function consume(){return{type:ot.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ot.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var e,n,i,_this$workOptions15,a,o,s,c,m,l,p,y,P,S,v,_T37;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:e=t.workId,n=t.layer,i=t.isDrawLabel,_this$workOptions15=this.workOptions,a=_this$workOptions15.boxSize,o=_this$workOptions15.boxPoint,s=_this$workOptions15.zIndex,c=n.worldPosition,m=n.worldScaling;if(!(!o||!a)){_context26.next=3;break;}return _context26.abrupt("return");case 3:l={name:e,id:e,pos:[o[0],o[1]],anchor:[0,0],size:a,zIndex:s},p=new Qt(l),y={x:o[0],y:o[1],w:a[0],h:a[1]},P={x:Math.floor(y.x*m[0]+c[0]),y:Math.floor(y.y*m[1]+c[1]),w:Math.floor(y.w*m[0])+2,h:Math.floor(y.h*m[1])+2};if(!(this.replace(n,e,p),i&&n&&this.workOptions.text)){_context26.next=11;break;}_context26.next=7;return ce.createLabels(this.workOptions,n,P);case 7:S=_context26.sent;v=S.labels;_T37=S.maxWidth;p.append.apply(p,_toConsumableArray(v)),P.w=Math.ceil(Math.max(_T37*n.worldScaling[0],P.w));case 11:return _context26.abrupt("return",P);case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x26){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var c,m,l,p,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:e=(c=this.workId)==null?void 0:c.toString();if(e){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,a=t.isDrawLabel;this.oldRect=i&&((l=(m=this.vNodes)==null?void 0:m.get(i))==null?void 0:l.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:e,layer:o,isDrawLabel:_typeof(a)>"u"&&this.workOptions.workState===Ot.Done||a});case 8:s=_context27.sent;return _context27.abrupt("return",((p=this.vNodes)==null||p.setInfo(e,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&vt.getCenterPos(s,o)}),s));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x27){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t,e){var P,S,n,i,a,o,s,c,m,l,p,y;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:if(this.workId){_context28.next=2;break;}return _context28.abrupt("return");case 2:n=this.workId.toString(),i=t.fontColor,a=t.fontBgColor,o=t.bold,s=t.italic,c=t.lineThrough,m=t.underline,l=t.zIndex,p=(P=this.vNodes)==null?void 0:P.get(n);if(p){_context28.next=5;break;}return _context28.abrupt("return");case 5:i&&(p.opt.fontColor=i),a&&(p.opt.fontBgColor=a),o&&(p.opt.bold=o),s&&(p.opt.italic=s),Te(c)&&(p.opt.lineThrough=c),Te(m)&&(p.opt.underline=m),kt(l)&&(p.opt.zIndex=l),this.oldRect=p.rect;_context28.next=8;return this.draw({workId:n,layer:this.fullLayer,isDrawLabel:_typeof(e)>"u"&&this.workOptions.workState===Ot.Done||e});case 8:y=_context28.sent;return _context28.abrupt("return",((S=this.vNodes)==null||S.setInfo(n,{rect:y,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:y&&vt.getCenterPos(y,this.fullLayer)}),y));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x28,_x29){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(t){var e=(t==null?void 0:t.parent).displayRatio||1,n=Math.ceil(t.worldScaling[0]*10)/10;var i=n;return n>=0.2&&n<1?i=n*e:n<=2&&n>=1?i=n*e*1.6:n>2&&n<=3?i=n*e*1.4:n>3&&n<=4?i=n*e*0.8:n>4&&(i=n*e*0.6),Math.floor(i*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(ce.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,e,n){var w,i,a,o,_ref167,s,c,m,l,p,y,P,S,v,T,f,d,u,g,M,C,A,L,O,b,I,R,W,z,K,J,q,U,G,Z,et,it,X,ct,ut,B,F,Y,k,rt,_X2,_ct,_ut,_X3,_ct2,_et3,_it2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:i=[],a=n.x,o=n.y,_ref167=(w=e.parent)==null?void 0:w.parent,s=_ref167.width,c=_ref167.height,m=Ee(t.text),l=m.length,p=t.fontSize,y=t.lineHeight,P=t.bold,S=t.textAlign,v=t.italic,T=t.fontFamily,f=t.verticalAlign,d=t.fontColor,u=t.fontBgColor,g=t.underline,M=t.lineThrough,C=ce.getSafetySnippetRatio(e)||1,A=Math.floor(p*C),L=ce.getSafetySnippetFontLength(A);O=0;b=0;case 3:if(!(b<l)){_context29.next=33;break;}I=m[b],R=y||A*1.5;if(!I){_context29.next=30;break;}W=e0(I),z=[0,0],K=[0,p*1.2];f==="middle"&&(z[1]=b*p*1.2+5);J=[0,-p*0.15];z[0]=5;q=Math.sin(Math.PI/180*20);U=0;G=[];Z=0;case 14:if(!(Z<W)){_context29.next=27;break;}S==="left"&&(J[0]=U),Z===0&&v==="italic"&&(J[0]=J[0]-q/2*p);et=I.slice(Z,Z+L);it={anchor:[0,0],pos:J,text:et,fontFamily:T,fontSize:A,lineHeight:R,strokeColor:d,fontWeight:P,fillColor:d,textAlign:S,fontStyle:v,scale:[1/C,1/C]};X=new rs(it);_context29.next=21;return X.textImageReady;case 21:ct=_context29.sent;ut=!0;if(ct){B=ct.rect&&ct.rect[2],F=ct.rect&&ct.rect[3];if(B&&F){Y=B/C,k=F/C;U=Y+U,v==="italic"&&(P==="bold"?U=U-q*p*1.2:U=U-q*p),((J[0]+z[0]+Y)*e.worldScaling[0]+a<=0||(J[0]+z[0])*e.worldScaling[0]+a>=s||(J[1]+z[1]+k)*e.worldScaling[1]+o<=0||(J[1]+z[1])*e.worldScaling[1]+o>=c)&&(X.disconnect(),ut=!1),ut&&G.push(X);}}Z+=L;case 25:_context29.next=14;break;case 27:K[0]=U,v==="italic"&&(K[0]=K[0]+q*p),O=Math.max(O,K[0]);rt=!0;if(((z[0]+K[0])*e.worldScaling[0]+a<=0||z[0]*e.worldScaling[0]+a>=s||(z[1]+K[1])*e.worldScaling[0]+o<=0||z[1]*e.worldScaling[1]+o>=c)&&(rt=!1),rt){if(g){_X2=Math.floor(p/10),_ct={normalize:!1,pos:[0,p*1.1+_X2/2],lineWidth:_X2,points:[0,0,Math.ceil(K[0]),0],strokeColor:d,className:"underline"},_ut=new ue(_ct);G.push(_ut);}if(M){_X3={normalize:!1,pos:[0,p*1.2/2],lineWidth:Math.floor(p/10),points:[0,0,Math.ceil(K[0]),0],strokeColor:d,className:"lineThrough"},_ct2=new ue(_X3);G.push(_ct2);}_et3={pos:z,anchor:[0,0],size:K,bgcolor:u},_it2=new Qt(_et3);_it2.append.apply(_it2,G),i.push(_it2);}case 30:b++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:i,maxWidth:O});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x30,_x31,_x32){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.fontBgColor,s=n.fontColor,c=n.translate,m=n.originPoint,l=n.scenePoint,p=n.scale,y=n.bold,P=n.italic,S=n.lineThrough,v=n.underline,T=n.fontSize,f=n.textInfos,d=n.zIndex,u=a&&Vt(a)||i.get(e.name);if(!u||!e.parent)return;var M=u.opt;if(kt(d)&&(e.setAttribute("zIndex",d),u.opt.zIndex=d),s&&M.fontColor&&(M.fontColor=s,e.children.forEach(function(C){C.tagName==="GROUP"&&C.children.forEach(function(A){A.tagName==="LABEL"?(A.setAttribute("fillColor",s),A.setAttribute("strokeColor",s)):A.tagName==="POLYLINE"&&A.setAttribute("strokeColor",s);});})),o&&M.fontBgColor&&(M.fontBgColor=o,e.children.forEach(function(C){C.tagName==="GROUP"&&C.setAttribute("bgcolor",o);})),y&&(M.bold=y),P&&(M.italic=P),Te(S)&&(M.lineThrough=S),Te(v)&&(M.underline=v),T&&(M.fontSize=T),m&&l&&p&&a&&M.boxPoint){var C=f==null?void 0:f.get(e.name);if(C){var w=C.fontSize,b=C.boxSize;M.boxSize=b||M.boxSize,M.fontSize=w||M.fontSize;}var A=[M.boxPoint[0],M.boxPoint[1]];zr(M.boxPoint,l,p,c);var L=[u.op[0],u.op[1]],O=[L[0]-A[0],L[1]-A[1]];if(u.centerPos=[u.centerPos[0]+O[0],u.centerPos[1]+O[1]],u.opt.eraserlines)for(var _i8=0,_Object$values6=Object.values(u.opt.eraserlines);_i8<_Object$values6.length;_i8++){var _w21=_Object$values6[_i8];var _b9=_w21.op,I=_w21.thickness;_w21.thickness=I*Math.max(p[0],p[1]);for(var R=0;R<_b9.length;R++)Gr(_b9[R],l,p,c);}}else if(c&&M.boxPoint&&(M.boxPoint=[M.boxPoint[0]+c[0],M.boxPoint[1]+c[1]],u.centerPos=[u.centerPos[0]+c[0],u.centerPos[1]+c[1]],u.opt.eraserlines))for(var _i9=0,_Object$values7=Object.values(u.opt.eraserlines);_i9<_Object$values7.length;_i9++){var _C7=_Object$values7[_i9];var _A6=_C7.op;for(var _L22=0;_L22<_A6.length;_L22++){var _O20=_A6[_L22].map(function(w,b){return b%2?w+c[1]:w+c[0];});_C7.op[_L22]=_O20;}}return u&&i.setInfo(e.name,u),u==null?void 0:u.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,e){var n=t.getElementsByName(e)[0];if(n){var i=n.getBoundingClientRect();var a={x:Math.floor(i.x),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 s=n.getBoundingClientRect();a=Pt(a,{x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)});}}),a;}}}]);}(vt);// 4k
|
|
457
|
+
tt(ce,"textImageSnippetSize",1024*4),tt(ce,"SafeBorderPadding",30);var Fe=ce;var Pe=/*#__PURE__*/function(_vt14){function Pe(t,e){var _this84;_classCallCheck(this,Pe);_this84=_callSuper(this,Pe,[t]);tt(_this84,"canRotate",!1);tt(_this84,"scaleType",bt.none);tt(_this84,"toolsType",dt.PencilEraser);tt(_this84,"serviceWork");tt(_this84,"tmpPoints",[]);tt(_this84,"workOptions");tt(_this84,"worldPosition");tt(_this84,"worldScaling");tt(_this84,"eraserRect");tt(_this84,"eraserPolyline");_this84.serviceWork=e,_this84.workOptions=t.toolsOpt,_this84.worldPosition=_this84.fullLayer.worldPosition,_this84.worldScaling=_this84.fullLayer.worldScaling;return _this84;}_inherits(Pe,_vt14);return _createClass(Pe,[{key:"consumeService",value:function consumeService(){}},{key:"createEraserRect",value:function createEraserRect(t){var e=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_Pe$eraserSizes$this$=Pe.eraserSizes[this.workOptions.thickness],i=_Pe$eraserSizes$this$.width,a=_Pe$eraserSizes$this$.height;this.eraserRect={x:e-i*0.5,y:n-a*0.5,w:i,h:a},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h];}},{key:"computRectCenterPoints",value:function computRectCenterPoints(){var t=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){var _e7=new _(this.tmpPoints[0],this.tmpPoints[1]),n=new _(this.tmpPoints[2],this.tmpPoints[3]),i=_.Sub(n,_e7).uni(),a=_.Dist(_e7,n),_Pe$eraserSizes$this$2=Pe.eraserSizes[this.workOptions.thickness],o=_Pe$eraserSizes$this$2.width,s=_Pe$eraserSizes$this$2.height,c=Math.min(o,s),m=Math.round(a/c);if(m>1){var l=[];for(var p=0;p<m;p++){var y=_.Mul(i,p*c);l.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.y);}return l.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,e){var n=new _(t[0],t[1]),i=new _(e[0],e[1]),_Pe$eraserSizes$this$3=Pe.eraserSizes[this.workOptions.thickness],a=_Pe$eraserSizes$this$3.width,o=_Pe$eraserSizes$this$3.height;return _.Dist(n,i)<Math.hypot(a,o)*0.5;}},{key:"cutPolyline",value:function cutPolyline(t,e){var n=[e],i=0;for(;i<t.length;){var s=t[i];if(s.length<2)break;n=a(n,s),i++;}return n;function a(s,c){var m=s;var _loop4=function _loop4(){var p=s[l],y=p.findIndex(function(P,S){return S<p.length-1?o([P,p[S+1]],[c[0],c[1]]):!1;});if(y!==-1&&y>-1){var P=[],S=p.slice(0,y+1);if(_.Equals(p[y],c[0])||S.push(c[0].clone().setz(p[y].z)),S.length>1&&P.push(S),y+c.length-1<p.length-1){var v=y+c.length-1,_T38=p.slice(v),_f31=c[c.length-1];_.Equals(p[v],_f31)||_T38.unshift(_f31.clone().setz(p[v].z)),_T38.length>1&&P.push(_T38);}return{v:(m.splice.apply(m,[l,1].concat(P)),m)};}},_ret;for(var l=0;l<s.length;l++){_ret=_loop4();if(_ret)return _ret.v;}return m;}function o(s,c){var m=_.Sub(s[1],s[0]),l=_.Sub(c[1],c[0]),p=_.Sub(c[0],s[0]);return Math.abs(_.Cpr(m,l))<0.1&&Math.abs(_.Cpr(m,p))<0.1;}}},{key:"isSamePoint",value:function isSamePoint(t,e){return t[0]===e[0]&&t[1]===e[1];}},{key:"translateIntersect",value:function translateIntersect(t){var _this85=this;var e=[];for(var n=0;n<t.length;n++){var i=t[n].filter(function(s,c,m){return!(c>0&&_this85.isSamePoint(s,m[c-1]));}),a=[];var o=0;for(;o<i.length;){var s=i[o],c=new _(s[0],s[1]);a.push(c),o++;}e.push(a);}return e;}},{key:"isLineEraser",value:function isLineEraser(t,e){return!(t===dt.Pencil&&!e);}},{key:"remove",value:function remove(t){var _this86=this;var e=t.curNodeMap,n=t.removeIds,i=t.newWorkDatas;var a;var _iterator28=_createForOfIteratorHelper(e.entries()),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var _step28$value=_slicedToArray(_step28.value,2),o=_step28$value[0],s=_step28$value[1];if(s.rect&&this.eraserRect&&this.eraserPolyline&&Ue(this.eraserRect,s.rect)){var c=s.op,m=s.toolsType,l=this.isLineEraser(m,!1),p=[],y=[];for(var S=0;S<c.length;S+=3){var v=new _(c[S]*this.worldScaling[0]+this.worldPosition[0],c[S+1]*this.worldScaling[1]+this.worldPosition[1],c[S+2]);y.push(v),p.push(new xt(v.x,v.y));}var P=p.length&&Ft(p)||s.rect;if(Ue(P,this.eraserRect)){if(y.length>1){var _S3=Br.polyline(y.map(function(v){return v.XY;}),this.eraserPolyline);if(_S3.length&&(n.add(s.name),!l)){var _v8=this.translateIntersect(_S3),_T39=this.cutPolyline(_v8,y);var _loop5=function _loop5(){var d="".concat(o,"_s_").concat(_f32),u=[];_T39[_f32].forEach(function(g){u.push((g.x-_this86.worldPosition[0])/_this86.worldScaling[0],(g.y-_this86.worldPosition[1])/_this86.worldScaling[1],g.z);}),s.opt&&s.toolsType&&_this86.vNodes&&(_this86.vNodes.setInfo(d,{rect:P,op:u,opt:s.opt,canRotate:s.canRotate,scaleType:s.scaleType,toolsType:s.toolsType}),i.set(d,{workId:d,op:u,opt:s.opt,toolsType:s.toolsType}));};for(var _f32=0;_f32<_T39.length;_f32++){_loop5();}}}else n.add(s.name);a=Pt(a,P);}}}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return n.forEach(function(o){var s;return(s=_this86.vNodes)==null?void 0:s["delete"](o);}),a&&(a.x-=vt.SafeBorderPadding,a.y-=vt.SafeBorderPadding,a.w+=vt.SafeBorderPadding*2,a.h+=vt.SafeBorderPadding*2),a;}},{key:"consume",value:function consume(t){var _t$data4=t.data,e=_t$data4.op,n=_t$data4.disableEraseImage,i=_t$data4.disableEraseText;if(!e||e.length===0)return _objectSpread({type:ot.None},this.baseConsumeResult);var a=this.tmpPoints.length;if(a>1&&this.isNear([e[0],e[1]],[this.tmpPoints[a-2],this.tmpPoints[a-1]]))return _objectSpread({type:ot.None},this.baseConsumeResult);a<3?this.tmpPoints.push(e[0],e[1]):this.tmpPoints.splice(2,2,e[0],e[1]);var o=this.computRectCenterPoints();var s;var c=/* @__PURE__ */new Set(),m=/* @__PURE__ */new Map();if(!this.vNodes)return _objectSpread({type:ot.None},this.baseConsumeResult);this.vNodes.setTarget();var l=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.getLastTarget(),{disableEraseImage:n,disableEraseText:i}));for(var p=0;p<o.length-1;p+=2){this.createEraserRect(o.slice(p,p+2));var y=this.remove({curNodeMap:l,removeIds:c,newWorkDatas:m});s=Pt(s,y);}if(this.vNodes.deleteLastTarget(),s&&c.size){var _iterator29=_createForOfIteratorHelper(m.keys()),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _p4=_step29.value;c.has(_p4)&&m["delete"](_p4);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}return{type:ot.RemoveNode,rect:s,removeIds:_toConsumableArray(c),newWorkDatas:m};}return _objectSpread({type:ot.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 e;if(this.serviceWork){var n=Vt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator30=_createForOfIteratorHelper(i.values()),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var o=_step30.value;if((e=o.selectIds)!=null&&e.length){var _iterator32=_createForOfIteratorHelper(o.selectIds),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var s=_step32.value;n["delete"](s);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}var _iterator31=_createForOfIteratorHelper(a.keys()),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _o5=_step31.value;n["delete"](_o5);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}return n;}return t;}}]);}(vt);// 来源于white-sdk
|
|
458
|
+
tt(Pe,"eraserSizes",Nr);var Qe=Pe;var Oe=/*#__PURE__*/function(_vt15){function Oe(t){var _this87;_classCallCheck(this,Oe);_this87=_callSuper(this,Oe,[t]);tt(_this87,"canRotate",!1);tt(_this87,"scaleType",bt.none);tt(_this87,"toolsType",dt.BitMapEraser);tt(_this87,"tmpPoints",[]);tt(_this87,"workOptions");tt(_this87,"worldPosition");tt(_this87,"worldScaling");tt(_this87,"eraserRect");tt(_this87,"eraserPolyline");tt(_this87,"syncUnitTime",_t.syncOpt.interval);tt(_this87,"syncIndex",0);tt(_this87,"syncTimestamp");_this87.workOptions=t.toolsOpt,_this87.worldPosition=_this87.fullLayer.worldPosition,_this87.worldScaling=_this87.fullLayer.worldScaling,_this87.syncTimestamp=0;return _this87;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Oe,_vt15);return _createClass(Oe,[{key:"combineConsume",value:function combineConsume(){if(this.tmpPoints.length<2)return{type:ot.None};var t=this.workOptions.thickness,_Oe$eraserSizes$t=Oe.eraserSizes[t],e=_Oe$eraserSizes$t.width,n=_Oe$eraserSizes$t.height,i=Math.max(e,n)/this.worldScaling[0],a=this.drawLayer||this.fullLayer,o=this.workId,s={name:o};return{rect:this.draw({attrs:s,consumePoints:this.tmpPoints,replaceId:o,layer:a,thickness:i}),type:ot.DrawWork,dataType:Tt.Local};}},{key:"consumeService",value:function consumeService(t){var e=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var l=0;l<e.length;l+=3){var p=new xt(e[l],e[l+1],e[l+2]);if(this.tmpPoints.length>0){var y=this.tmpPoints[this.tmpPoints.length-1],P=_.Sub(p,y).uni();p.setv(P);}this.tmpPoints.push(p);}if(this.tmpPoints.length<2)return;var a=this.tmpPoints[0].z*2,o=n?this.fullLayer:this.drawLayer||this.fullLayer,c={name:this.workId};return this.draw({attrs:c,consumePoints:this.tmpPoints,layer:o,thickness:a,replaceId:i});}},{key:"updateTempPoints",value:function updateTempPoints(t,e){var n=this.tmpPoints.length-1;var i=Date.now();for(var a=0;a<t.length;a+=2){var o=this.tmpPoints.length,s=new xt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var c=o-1,m=this.tmpPoints[c],l=_.Sub(s,m).uni();s.isNear(m,e/2)||(_.Equals(l,m.v,0.02)&&(this.tmpPoints.pop(),n--),s.setv(l),s.setT(i),this.tmpPoints.push(s));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,e){var n=/* @__PURE__ */new Map(),i=/* @__PURE__ */new Set();var a;if(!this.vNodes)return{willDeleteNodes:i,willUpdateNodes:n,rect:a};var o=this.worldPosition;var s=Ft(this.tmpPoints,t);s=Tr(s,o),s=Yp(s,this.worldScaling,o);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(s),c=_this$vNodes$getRectI3.nodeRange;if(!c.size)return{willDeleteNodes:i,willUpdateNodes:n,rect:a};var m=this.computEraserPointLines(this.tmpPoints);var _iterator33=_createForOfIteratorHelper(c.entries()),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _step33$value=_slicedToArray(_step33.value,2),l=_step33$value[0],p=_step33$value[1];if(p.toolsType===dt.Text||p.toolsType===dt.Image)continue;var y=Tr(p.rect,[-o[0],-o[1]]);y={x:y.x/this.worldScaling[0],y:y.y/this.worldScaling[1],w:y.w/this.worldScaling[0],h:y.h/this.worldScaling[1]};var P=[y.x,y.y,y.x+y.w,y.y+y.h],S=[],v=[];var _iterator34=_createForOfIteratorHelper(m),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _f35=_step34.value;Br.polyline(_f35,P,S);}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}if(S.length&&p.opt){var _iterator35=_createForOfIteratorHelper(S),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _f33=_step35.value;var d=[];for(var u=0;u<_f33.length;u++)u!==0&&he(_f33[u],_f33[u-1])||d.push.apply(d,_toConsumableArray(_f33[u]));v.push(d);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}if(p.opt.eraserlines||(p.opt.eraserlines=[]),p.opt.eraserlines){if(p.opt.eraserlines.push({op:v,thickness:t}),e){var _f34=p.toolsType,_d14=e.createWorkShapeNode({workId:l,toolsType:_f34,toolsOpt:p.opt});_d14==null||_d14.setWorkId(l);var _u14=_d14==null?void 0:_d14.consumeService({op:p.op,isFullWork:!0,replaceId:l});if(a=Pt(a,_u14),_d14!=null&&_d14.isDelete){e.removeNode(l),i.add(l);continue;}}n.set(l,p);}}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}return{willUpdateNodes:n,willDeleteNodes:i,rect:a};}},{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=t.removeDrawCount,s=t.drawCount,c=e.op;if(!c||c.length===0)return _objectSpread({type:ot.None},this.baseConsumeResult);var m=this.workOptions.thickness,_Oe$eraserSizes$m=Oe.eraserSizes[m],l=_Oe$eraserSizes$m.width,p=_Oe$eraserSizes$m.height,y=Math.max(l,p)/this.worldScaling[0],P=this.tmpPoints.length,S=this.tmpPoints[this.tmpPoints.length-1],v=this.updateTempPoints(c,y),T=this.tmpPoints[this.tmpPoints.length-1];if(P===this.tmpPoints.length&&T.equalsXY(S.x,S.y))return _objectSpread({type:ot.None},this.baseConsumeResult);this.syncIndex=Math.min(this.syncIndex,v,Math.max(0,this.tmpPoints.length-2));var f={name:this.workId,id:kt(s)&&s.toString()||void 0},d=this.syncIndex;this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var u=!1,g;var M=this.tmpPoints.slice(v);if(i||a){var A=n?this.fullLayer:this.drawLayer||this.fullLayer;g=this.draw({attrs:f,consumePoints:M,layer:A,removeDrawCount:o,thickness:y});}if(i)return v>10&&this.tmpPoints.splice(0,v-10),{rect:g,type:ot.DrawWork,dataType:Tt.Local};M[0].t-this.syncTimestamp>this.syncUnitTime&&(u=!0,this.syncTimestamp=M[0].t,this.syncIndex=this.tmpPoints.length);var C=[];return this.tmpPoints.slice(d).forEach(function(A){C.push(A.x,A.y,y/2);}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ot.DrawWork,dataType:Tt.Local,rect:g,op:u?C:void 0,index:u?d*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var e=t.attrs,n=t.consumePoints,i=t.layer,a=t.thickness,o=t.replaceId,s=t.removeDrawCount;s&&this.removeDrawCountNodes(i,s);var c=Ft(n,a);c={x:Math.floor(c.x*this.worldScaling[0]+this.worldPosition[0]-vt.SafeBorderPadding),y:Math.floor(c.y*this.worldScaling[1]+this.worldPosition[1]-vt.SafeBorderPadding),w:Math.floor(c.w*this.worldScaling[0]+2*vt.SafeBorderPadding),h:Math.floor(c.h*this.worldScaling[1]+2*vt.SafeBorderPadding)};var m=new Qt(_objectSpread(_objectSpread({},e),{},{normalize:!0,pos:[0,0],anchor:[0.5,0.5],zIndex:9999,bgcolor:"rgba(136,136,136,0.3)"})),l=this.computEraserPointLines(n),p=[];var _iterator36=_createForOfIteratorHelper(l),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _y13=_step36.value;p.push({op:_y13,thickness:a});}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}for(var _i10=0,_p5=p;_i10<_p5.length;_i10++){var y=_p5[_i10];var P=y.thickness,S=y.op,v=S.reduce(function(g,M,C,A){return C>0&&A[C-1][0]===M[0]&&A[C-1][1]===M[1]?g:g.concat(M[0],M[1]);},[]),_T40=this.computEraserPoints(v,P),_f36=ae(_T40,!0),d={pos:[0,0],d:_f36,fillColor:"rgba(136,136,136,0.3)"},u=new le(d);m.append(u),m.seal();}return this.replace(i,o,m),c;}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var i=0;var a=360-e;for(var o=1;o<t.length;o++){var s=t[o-1],c=t[o];if(o===1&&i===0&&(n[i]=[s.XY]),n[i].push(c.XY),o<t.length-1){var m=c.getAngleByPoints(s,t[o+1]);(m<e||m>a)&&(i++,n[i]=[c.XY]);}}return t.length===1&&n.length===0&&n.push([t[0].XY,t[0].XY]),n;}},{key:"consumeAll",value:function consumeAll(t){var e=t.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:ot.None},this.baseConsumeResult);var n=this.workOptions.thickness,_Oe$eraserSizes$n=Oe.eraserSizes[n],i=_Oe$eraserSizes$n.width,a=_Oe$eraserSizes$n.height,o=Math.max(i,a)/this.worldScaling[0],_this$getChangeNodes=this.getChangeNodes(o,e),s=_this$getChangeNodes.willDeleteNodes,c=_this$getChangeNodes.willUpdateNodes,m=_this$getChangeNodes.rect;if(s.size===0&&c.size===0)return _objectSpread(_objectSpread({type:ot.FullWork},this.baseConsumeResult),{},{rect:m});var l=[];this.tmpPoints.map(function(y){l.push(y.x,y.y,o/2);});var p=te(l);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ot.FullWork,dataType:Tt.Local,rect:m,ops:p,willUpdateNodes:c,willDeleteNodes:s});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(vt);// 来源于white-sdk
|
|
459
|
+
tt(Oe,"eraserSizes",Nr);var qe=Oe;function Ai(h){switch(h){case dt.Arrow:return xi;case dt.Pencil:return mi;case dt.Straight:return Ci;case dt.Ellipse:return Ti;case dt.Polygon:case dt.Triangle:return Oi;case dt.Star:case dt.Rhombus:return Pi;case dt.Rectangle:return Mi;case dt.SpeechBalloon:return Ei;case dt.Text:return Fe;case dt.LaserPen:return vi;case dt.Eraser:return fe;case dt.PencilEraser:return Qe;case dt.BitMapEraser:return qe;case dt.Selector:return Ze;case dt.Image:return Be;}}function $r(h,r){var t=h.toolsType,e=_objectWithoutProperties(h,_excluded);switch(t){case dt.Arrow:return new xi(e);case dt.Pencil:return new mi(e);case dt.Straight:return new Ci(e);case dt.Ellipse:return new Ti(e);case dt.Polygon:case dt.Triangle:return new Oi(e);case dt.Star:case dt.Rhombus:return new Pi(e);case dt.Rectangle:return new Mi(e);case dt.SpeechBalloon:return new Ei(e);case dt.Text:return new Fe(e);case dt.LaserPen:return new vi(e);case dt.Eraser:return new fe(e,r);case dt.BitMapEraser:return new qe(e);case dt.PencilEraser:return new Qe(e,r);case dt.Selector:return e.vNodes?new Ze(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case dt.Image:return new Be(e);default:return;}}function Ri(h){var r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator37=_createForOfIteratorHelper(h),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _e8=_step37.value;if(_e8.tagName==="GROUP"&&_e8.children.length)return Ri(_e8.children);_e8.tagName&&t.includes(_e8.tagName)&&r.push(_e8);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}return r;}function Pt(h,r){if(h&&r){var t=Math.min(h.x,r.x),_e9=Math.min(h.y,r.y),n=Math.max(h.x+h.w,r.x+r.w),i=Math.max(h.y+h.h,r.y+r.h),a=n-t,o=i-_e9;return{x:t,y:_e9,w:a,h:o};}return r||h;}function Ft(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var e=1/0,n=1/0,i=-1/0,a=-1/0;return h.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),s=_o$XY[0],c=_o$XY[1];e=Math.min(e,s-r),n=Math.min(n,c-r),i=Math.max(i,s+r),a=Math.max(a,c+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function Ue(h,r){return!(h.x+h.w<r.x||h.x>r.x+r.w||h.y+h.h<r.y||h.y>r.y+r.h);}function Nt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(h.x-r),y:Math.floor(h.y-r),w:Math.ceil(h.w+r*2),h:Math.ceil(h.h+r*2)};}function Tr(h,r){return{x:h.x+r[0],y:h.y+r[1],w:h.w,h:h.h};}function Kp(h,r){var t=new _(h.x,h.y),e=new _(h.x+h.w,h.y),n=new _(h.x+h.w,h.y+h.h),i=new _(h.x,h.y+h.h),a=new _(h.x+h.w/2,h.y+h.h/2),o=Math.PI*r/180,s=_.RotWith(t,a,o),c=_.RotWith(e,a,o),m=_.RotWith(n,a,o),l=_.RotWith(i,a,o);return[s,c,m,l];}function Ii(h,r){var t=Kp(h,r);return Ft(t);}function Yp(h,r,t){var e=new _(h.x,h.y),n=new _(h.x+h.w,h.y),i=new _(h.x+h.w,h.y+h.h),a=new _(h.x,h.y+h.h),o=new _(t[0],t[1]),s=new _(r[0],r[1]),c=_.ScaleWOrigin(e,s,o),m=_.ScaleWOrigin(n,s,o),l=_.ScaleWOrigin(i,s,o),p=_.ScaleWOrigin(a,s,o);return Ft([c,m,l,p]);}function Vp(h,r,t){var e=new _(r[0],r[1]);for(var n=0;n<h.length;n+=3){var i=new _(h[n],h[n+1]),a=Math.PI*t/180,o=_.RotWith(i,e,a);h[n]=o.x,h[n+1]=o.y;}}function kp(h,r,t){var e=new _(r[0],r[1]);for(var n=0;n<h.length;n+=2){var i=new _(h[n],h[n+1]),a=Math.PI*t/180,o=_.RotWith(i,e,a);h[n]=o.x,h[n+1]=o.y;}}function zr(h,r,t){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new _(r[0],r[1]);for(var i=0;i<h.length;i+=3){var a=new _(h[i],h[i+1]),o=new _(t[0],t[1]),s=_.ScaleWOrigin(a,o,n);h[i]=s.x+e[0],h[i+1]=s.y+e[1];}}function Gr(h,r,t){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new _(r[0],r[1]);for(var i=0;i<h.length;i+=2){var a=new _(h[i],h[i+1]),o=new _(t[0],t[1]),s=_.ScaleWOrigin(a,o,n);h[i]=s.x+e[0],h[i+1]=s.y+e[1];}}function Xp(h,r){return h[0]>=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function wi(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}function Jp(h){var _iterator38=_createForOfIteratorHelper(h),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var r=_step38.value;if(isNaN(r)||r===1/0||r===-1/0)return!1;}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return!0;}function Zp(h){return h!==Math.floor(h);}function Qp(h){var r=h.toString();return r.indexOf(".")!==-1?r.split(".")[1].length:0;}function qp(h,r){for(;r!==0;){var _ref168=[r,h%r];h=_ref168[0];r=_ref168[1];}return h;}var _p=function _p(h){if(h.tagName==="GROUP"){var r=Object.getOwnPropertySymbols(h).find(function(t){return t.toString()==="Symbol(sealed)";});if(r&&h[r])return!0;}return!1;},_Zt=function Zt(h,r){if(h.mesh&&h.mesh.texture&&h.name==="eraserTexture"){var t=h.mesh.texture.image;r.deleteTexture(t);}else if(h.tagName==="GROUP"&&h&&h.children){var _iterator39=_createForOfIteratorHelper(h.children),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _t3=_step39.value;_Zt(_t3,r);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}}},se=function se(h,r){_Zt(h,r),h.removeAllChildren();},t0=function t0(h,r,t){var e=t.parent;if(r){var n=r.children;if(n){var _iterator40=_createForOfIteratorHelper(n),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var i=_step40.value;if(_Zt(i,e),i.tagName==="GROUP"){var _iterator41=_createForOfIteratorHelper(i.children),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var a=_step41.value;_Zt(a,e);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}}}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}}r.parent.replaceChild(h,r);};function ye(h){return"".concat(_e(h.x),",").concat(_e(h.y)," ");}function Se(h,r){return"".concat(_e((h.x+r.x)/2),",").concat(_e((h.y+r.y)/2)," ");}function _e(h){return+h.toFixed(4);}var Ke=function Ke(h,r){return h.x+h.w<r.x||h.x>r.x+r.w||h.y+h.h<r.y||h.y>r.y+r.h?qt.outside:h.x>=r.x&&h.y>=r.y&&h.x+h.w<=r.x+r.w&&h.y+h.h<=r.y+r.h?qt.inside:qt.intersect;};function e0(h){var r=0;for(var t=0;t<h.length;t++){var _e10=h.charCodeAt(t);_e10>=1&&_e10<=126||65376<=_e10&&_e10<=65439?r++:r+=2;}return r;}var Ne="cursorhover",In=20,tr="mainView";var r0=/*#__PURE__*/function(){function r0(r,t){_classCallCheck(this,r0);tt(this,"viewId");tt(this,"scene");tt(this,"fullLayer");tt(this,"curNodeMap",/* @__PURE__ */new Map());tt(this,"targetNodeMap",[]);tt(this,"highLevelIds");tt(this,"canClearUids");tt(this,"localUid");this.viewId=r,this.scene=t;}return _createClass(r0,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"setLocalUid",value:function setLocalUid(r){this.localUid=r;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setCanClearUids",value:function setCanClearUids(r){this.canClearUids=r;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(r,t){var e=/* @__PURE__ */new Map();var _iterator42=_createForOfIteratorHelper(r.entries()),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _step42$value=_slicedToArray(_step42.value,2),n=_step42$value[0],i=_step42$value[1];i.toolsType===dt.Image&&(i.opt.locked||t&&t.disableEraseImage)||i.toolsType===dt.Text&&(i.opt.workState===Ot.Doing||i.opt.workState===Ot.Start||t&&t.disableEraseText)||this.isCanClearWorkId(n)&&e.set(n,i);}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return e;}},{key:"getNodesByType",value:function getNodesByType(r){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(e,n){e.toolsType===r&&t.set(n,e);}),t;}},{key:"gethasEraserNodes",value:function gethasEraserNodes(){var r=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(t,e){var n;(n=t.opt.eraserlines)!=null&&n.length&&r.set(e,t);}),r;}},{key:"hasRenderNodes",value:function hasRenderNodes(){return!0;}},{key:"has",value:function has(r){return this.curNodeMap.has(r);}},{key:"setInfo",value:function setInfo(r,t){var e=this.curNodeMap.get(r)||{name:r,rect:t.rect};t.rect&&(e.rect=Vt(t.rect)),t.op&&Jp(t.op)&&(e.op=Vt(t.op)),t.canRotate&&(e.canRotate=t.canRotate),t.scaleType&&(e.scaleType=t.scaleType),t.opt&&(e.opt=Vt(t.opt)),t.toolsType&&(e.toolsType=t.toolsType),t.centerPos&&(e.centerPos=Vt(t.centerPos)),Te(t.isSelected)&&(e.isSelected=t.isSelected),e.rect?this.curNodeMap.set(r,e):this.curNodeMap["delete"](r);}},{key:"selected",value:function selected(r){this.setInfo(r,{isSelected:!0});}},{key:"unSelected",value:function unSelected(r){this.setInfo(r,{isSelected:!1});}},{key:"delete",value:function _delete(r){this.curNodeMap["delete"](r);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n;var i=/* @__PURE__ */new Map();var _iterator43=_createForOfIteratorHelper(this.curNodeMap.entries()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _step43$value=_slicedToArray(_step43.value,2),a=_step43$value[0],o=_step43$value[1];if(Ue(r,o.rect)){if(t&&o.toolsType===dt.Image&&o.opt.locked||e&&o.toolsType===dt.Text&&(o.opt.workState===Ot.Doing||o.opt.workState===Ot.Start))continue;n=Pt(n,o.rect),i.set(a,o);}}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var e=Ai(t.toolsType);return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r));}},{key:"updateNodeRect",value:function updateNodeRect(r){var t=this.curNodeMap.get(r);if(t){var _e11=this.getNodeRectFormShape(r,t);if(!_e11){this.curNodeMap["delete"](r);return;}t.rect=_e11,this.curNodeMap.set(r,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(r){this.highLevelIds=r;var _iterator44=_createForOfIteratorHelper(this.highLevelIds.keys()),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var t=_step44.value;this.updateNodeRect(t);}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var r;var _iterator45=_createForOfIteratorHelper(this.curNodeMap.keys()),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var t=_step45.value;(r=this.highLevelIds)!=null&&r.has(t)||this.updateNodeRect(t);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(r){var t=/* @__PURE__ */new Map();var _iterator46=_createForOfIteratorHelper(r),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var _e12=_step46.value;var n=this.curNodeMap.get(_e12);n&&t.set(_e12,Vt(n));}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}return this.targetNodeMap.push(Vt(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(Vt(this.curNodeMap)),this.targetNodeMap.length-1;}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1);}},{key:"getTarget",value:function getTarget(r){return this.targetNodeMap[r];}},{key:"deleteTarget",value:function deleteTarget(r){this.targetNodeMap.length=r;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}},{key:"isLocalWorkId",value:function isLocalWorkId(r){return r.split(We).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(r){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(bu(this.canClearUids)){var t=r.split(We);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 Li=/*#__PURE__*/function(){function Li(r,t,e){_classCallCheck(this,Li);tt(this,"viewId");tt(this,"scene");tt(this,"fullLayer");tt(this,"vNodes");tt(this,"dpr");tt(this,"contextType");tt(this,"opt");tt(this,"cameraOpt");tt(this,"isSafari",!1);tt(this,"combinePostMsg",/* @__PURE__ */new Set());tt(this,"workerTaskId");tt(this,"protectedTask");tt(this,"hasPriorityDraw",!0);tt(this,"delayPostDoneResolve");tt(this,"cacheImages",/* @__PURE__ */new Map());tt(this,"imageResolveMap",/* @__PURE__ */new Map());tt(this,"taskUpdateCameraId");tt(this,"debounceUpdateCameraId");var n,i;if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(e,(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(_unused24){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 r0(r,this.scene);}return _createClass(Li,[{key:"createRenderLayer",value:function createRenderLayer(r){this.scene=this.createScene(r.offscreenCanvasOpt);var t=_t.bufferSize.full,e=_t.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:this.viewId===tr?t:e*2}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(r){return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:this.dpr=r,this.scene.displayRatio=r;case 1:case"end":return _context30.stop();}},_callee28,this);}));function updateDpr(_x33){return _updateDpr.apply(this,arguments);}return updateDpr;}()},{key:"getCachedImages",value:function getCachedImages(r){var t;return(t=this.cacheImages.get(r))==null?void 0:t.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(r){var _iterator47=_createForOfIteratorHelper(this.cacheImages.entries()),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _step47$value=_slicedToArray(_step47.value,2),t=_step47$value[0],_e13=_step47$value[1];if(t===r&&_e13.imageBitmap)return _e13.imageBitmap;}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(r,t){var _iterator48=_createForOfIteratorHelper(this.cacheImages.entries()),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _step48$value=_slicedToArray(_step48.value,2),_e14=_step48$value[0],n=_step48$value[1];t&&_e14===t||n.workId===r&&(n.imageBitmap.close(),this.cacheImages["delete"](_e14));}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(r){return r.imageBitmap.close();}),this.cacheImages.clear();}},{key:"clearImageResolveMap",value:function clearImageResolveMap(){this.imageResolveMap.forEach(function(_ref169){var r=_ref169.timer;r&&clearTimeout(r);}),this.imageResolveMap.clear();}},{key:"setHasPriorityDraw",value:function setHasPriorityDraw(r){this.hasPriorityDraw=r;}},{key:"getPriorityDraw",value:function getPriorityDraw(){return this.hasPriorityDraw;}},{key:"setIsSafari",value:function setIsSafari(r){this.isSafari=r;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(r){var t,e,n,i,a,o,s,c,_c6,m,l,p;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=r.msgType,e=r.toolsType,n=r.opt,i=r.imageSrc,a=r.imageBitmap,o=r.workId,s=r.dpr;_context31.t0=t;_context31.next=_context31.t0===ot.UpdateDpr?4:_context31.t0===ot.UpdateCamera?9:_context31.t0===ot.Destroy?12:_context31.t0===ot.Clear?14:_context31.t0===ot.UpdateTools?17:_context31.t0===ot.GetImageBitMap?19:21;break;case 4:_context31.t1=kt(s);if(!_context31.t1){_context31.next=8;break;}_context31.next=8;return this.updateDpr(s);case 8:return _context31.abrupt("break",21);case 9:_context31.next=11;return this.updateCamera(r);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(e&&n){c={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(c);}return _context31.abrupt("break",21);case 19:if(i&&a&&o){_c6=o.toString();this.cacheImages.set(i,{imageBitmap:a,workId:_c6});m=this.imageResolveMap.get(i);if(m){l=m.resolve,p=m.timer;p&&clearTimeout(p),l&&l(i);}this.deleteCachedImagesByWorkId(_c6,i);}return _context31.abrupt("break",21);case 21:case"end":return _context31.stop();}},_callee29,this);}));function on(_x34){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(r,t,e){var n=r*e,i=t*e;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(r){var _this88=this;var t,e,n,i,a,o,s,c,m,l,p,_this$getIconSize,_this$getIconSize2,v,_T41,_v9,_v10,S;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=r.toolsType,e=r.opt,n=r.workId,i=r.isSubWorker;if(!(t===dt.Image&&e&&n)){_context32.next=19;break;}a=n.toString(),o=e.src,s=e.type,c=e.width,m=e.height,l=e.strokeColor;if(!(!o||!s||!c||!m)){_context32.next=5;break;}return _context32.abrupt("return");case 5:p=o;if(s===Mr.Iconify){_this$getIconSize=this.getIconSize(c,m,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),v=_this$getIconSize2[0],_T41=_this$getIconSize2[1];p="".concat(o,"?width=").concat(v,"&height=").concat(_T41,"&color=").concat(l);}if(!this.cacheImages.has(p)){_context32.next=11;break;}_v9=this.getCachedImages(p);if(!_v9){_context32.next=11;break;}return _context32.abrupt("return",_v9);case 11:if(!this.imageResolveMap.has(p)){_context32.next=15;break;}_v10=this.getCachedImagesByWorkId(a);if(!_v10){_context32.next=15;break;}return _context32.abrupt("return",_v10);case 15:_context32.next=17;return new Promise(function(v){var T=_this88.imageResolveMap.get(p)||{resolve:void 0,timer:void 0};T.timer&&clearTimeout(T.timer),T.resolve=v,T.timer=setTimeout(function(){var f=_this88.imageResolveMap.get(p);f!=null&&f.resolve&&f.resolve(p);},5e3),_this88.imageResolveMap.set(p,T),_this88._post({sp:[{imageSrc:p,workId:a,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:i,type:ot.GetImageBitMap}]});});case 17:S=_context32.sent;return _context32.abrupt("return",(this.imageResolveMap["delete"](S),this.getCachedImages(p)));case 19:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x35){return _loadImageBitMap.apply(this,arguments);}return loadImageBitMap;}()},{key:"createLocalWork",value:function createLocalWork(r){var t=r.workId,e=r.opt,n=r.toolsType;t&&e&&(!this.localWork.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:e}),this.setWorkOpt({workId:t,toolsOpt:e}));}},{key:"updateScene",value:function updateScene(r){this.scene.attr(_objectSpread({},r));var t=r.width,e=r.height;this.scene.container.width=t,this.scene.container.height=e,this.scene.width=t,this.scene.height=e,this.updateLayer({width:t,height:e});}},{key:"updateLayer",value:function updateLayer(r){var t=r.width,e=r.height;this.fullLayer&&(this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",e),this.fullLayer.setAttribute("size",[t,e]),this.fullLayer.setAttribute("pos",[t*0.5,e*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(r,t){var e=new OffscreenCanvas(100,100);var n=["2d"];r===er.Full&&this.viewId===tr&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i11=0,_n7=n;_i11<_n7.length;_i11++){var i=_n7[_i11];try{if(e.getContext(i))return i;}catch(_unused25){continue;}}}},{key:"createScene",value:function createScene(r){var t=r.width,e=r.height,n=new OffscreenCanvas(t,e);r.contextType&&delete r.contextType;var i=new is(_objectSpread(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},r),{},{contextType:this.contextType,id:this.viewId}));return i.setAttribute("id",this.viewId),i;}},{key:"createLayer",value:function createLayer(r,t,e){var n=e.width,i=e.height,a="offscreen-".concat(r),o=t.layer(a,e),s=new Qt({anchor:[0.5,0.5],pos:[n*0.5,i*0.5],size:[n,i],name:"viewport",id:r});return o.append(s),s;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(){var r;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();}),se(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(),(r=this.serviceWork)==null||r.destroy();case 1:case"end":return _context33.stop();}},_callee31,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(r){this.localWork.setToolsOpt(r);}},{key:"setWorkOpt",value:function setWorkOpt(r){var t=r.workId,e=r.toolsOpt;t&&e&&this.localWork.setWorkOptions(t.toString(),e);}},{key:"destroy",value:function destroy(){var r;this.vNodes.clear(),this.fullLayer.remove(),_Zt(this.fullLayer,this.fullLayer.parent),this.clearCacheImages(),this.clearImageResolveMap(),this.scene.remove(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(r){return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:this.combinePostMsg.add(r);_context34.next=3;return this.runBatchPostData();case 3:case"end":return _context34.stop();}},_callee32,this);}));function post(_x36){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(){var _this89=this;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this89.workerTaskId=void 0,_this89.combinePost();},16));_context35.t0=this.type===er.Full&&!this.delayPostDoneResolve;if(!_context35.t0){_context35.next=6;break;}_context35.next=5;return new Promise(function(t){_this89.delayPostDoneResolve=t;});case 5:_context35.t0=_context35.sent;case 6:_context35.t1=_context35.t0;if(!_context35.t1){_context35.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context35.stop();}},_callee33,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var o,s;this.workerTaskId=void 0;var r=[],t=[];var e,n,i;var a=/* @__PURE__ */new Set();var _iterator49=_createForOfIteratorHelper(this.combinePostMsg.values()),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var c=_step49.value;if((o=c.render)!=null&&o.length){var _iterator50=_createForOfIteratorHelper(c.render),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var m=_step50.value;var l=!1;if(m.workId&&a.add(m.workId),m.isClearAll&&(m.rect=this.getSceneRect(),m.isClear=!0,delete m.isClearAll),m.drawCanvas){var p=this.getLayer(m.drawCanvas);if(!p||!(p.parent instanceof ns))continue;if(p.parent.render(),m.isDrawAll){var y=this.getSceneRect();m.rect=y,delete m.isDrawAll;}}var _iterator51=_createForOfIteratorHelper(r),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _p6=_step51.value;if(m.viewId===_p6.viewId){m.isClear&&_p6.clearCanvas&&_p6.isClear&&_p6.clearCanvas===m.clearCanvas&&(_p6.rect=Pt(_p6.rect,m.rect),l=!0),_p6.drawCanvas&&_p6.drawCanvas===m.drawCanvas&&(_p6.rect=Pt(_p6.rect,m.rect),l=!0);continue;}}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}l||(m.isClear&&!m.drawCanvas?r.unshift(m):r.push(m));}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}}if((s=c.sp)!=null&&s.length){var _iterator52=_createForOfIteratorHelper(c.sp),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _m9=_step52.value;var _l6=!1;var _iterator53=_createForOfIteratorHelper(t),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var _p7=_step53.value;if(he(_m9,_p7)){_l6=!0;break;}}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}_l6||t.push(_m9);}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}kt(c.fullWorkerDrawCount)&&(e=c.fullWorkerDrawCount),kt(c.subWorkerDrawCount)&&(n=c.subWorkerDrawCount),kt(c.consumeCount)&&(i=c.consumeCount);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}return this.combinePostMsg.clear(),{render:r,sp:t,fullWorkerDrawCount:e,subWorkerDrawCount:n,consumeCount:i,workIds:a,viewId:this.viewId};}},{key:"safariFixRect",value:function safariFixRect(r,t){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var e=this.scene.width,n=this.scene.height,i={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(e,r.w)),h:Math.floor(Math.min(n,r.h))};if(i.x+i.w>e&&(i.w=Math.floor(e-i.x)),i.y+i.h>n&&(i.h=Math.floor(n-i.y)),Zp(t)){var a=Qp(t),o=Math.pow(10,a),s=qp(o,t*o),c=i.x%s,m=i.x-c;m>=0?(i.x=m,i.w=i.w+c):(i.x=0,i.w=i.w+c-m);var l=i.y%s,p=i.y-l;p>=0?(i.y=p,i.h=i.h+l):(i.y=0,i.h=i.h+l-p);}return i;}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,r=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(r),h:Math.floor(t)};}}]);}();var bi=/*#__PURE__*/function(){function bi(r){_classCallCheck(this,bi);tt(this,"viewId");tt(this,"vNodes");tt(this,"thread");tt(this,"fullLayer");tt(this,"drawLayer");tt(this,"_post");tt(this,"tmpOpt");tt(this,"workShapes",/* @__PURE__ */new Map());tt(this,"drawCount",0);tt(this,"consumeCount",0);tt(this,"syncUnitTime",_t.syncOpt.interval);this.thread=r.thread,this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this._post=this.thread.post.bind(r.thread);}return _createClass(bi,[{key:"destroy",value:function destroy(){this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(r){return this.workShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e15={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e15),{},{workId:r}));n&&this.workShapes.set(r,n);}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var e=this.getWorkShape(r);e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t;return $r(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(r){var t,e,n;((t=this.tmpOpt)==null?void 0:t.toolsType)!==r.toolsType&&(e=this.tmpOpt)!=null&&e.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=r,(n=r.toolsOpt)!=null&&n.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(r){var t;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes["delete"](r);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(r){return r.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(r){var t=r.workId,e=r.opt,n=r.toolsType;if(t&&e&&n){var i=t.toString();var a;return t&&this.workShapes.has(i)?(a=this.workShapes.get(i),a==null||a.setWorkOptions(e)):a=this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:i}),a?(this.workShapes.set(i,a),a):void 0;}}}]);}();var n0=ie,i0=function i0(){return n0.Date.now();},s0=i0,o0=/\s/;function a0(h){for(var r=h.length;r--&&o0.test(h.charAt(r)););return r;}var l0=a0,c0=l0,f0=/^\s+/;function h0(h){return h&&h.slice(0,c0(h)+1).replace(f0,"");}var u0=h0,d0=me,p0=oe,g0="[object Symbol]";function m0(h){return _typeof(h)=="symbol"||p0(h)&&d0(h)==g0;}var v0=m0,y0=u0,wn=pe,S0=v0,Ln=NaN,x0=/^[-+]0x[0-9a-f]+$/i,T0=/^0b[01]+$/i,M0=/^0o[0-7]+$/i,P0=parseInt;function O0(h){if(typeof h=="number")return h;if(S0(h))return Ln;if(wn(h)){var r=typeof h.valueOf=="function"?h.valueOf():h;h=wn(r)?r+"":r;}if(typeof h!="string")return h===0?h:+h;h=y0(h);var t=T0.test(h);return t||M0.test(h)?P0(h.slice(2),t?2:8):x0.test(h)?Ln:+h;}var E0=O0,C0=pe,dr=s0,bn=E0,A0="Expected a function",R0=Math.max,I0=Math.min;function w0(h,r,t){var e,n,i,a,o,s,c=0,m=!1,l=!1,p=!0;if(typeof h!="function")throw new TypeError(A0);r=bn(r)||0,C0(t)&&(m=!!t.leading,l="maxWait"in t,i=l?R0(bn(t.maxWait)||0,r):i,p="trailing"in t?!!t.trailing:p);function y(M){var C=e,A=n;return e=n=void 0,c=M,a=h.apply(A,C),a;}function P(M){return c=M,o=setTimeout(T,r),m?y(M):a;}function S(M){var C=M-s,A=M-c,L=r-C;return l?I0(L,i-A):L;}function v(M){var C=M-s,A=M-c;return s===void 0||C>=r||C<0||l&&A>=i;}function T(){var M=dr();if(v(M))return f(M);o=setTimeout(T,S(M));}function f(M){return o=void 0,p&&e?y(M):(e=n=void 0,a);}function d(){o!==void 0&&clearTimeout(o),c=0,e=s=n=o=void 0;}function u(){return o===void 0?a:f(dr());}function g(){var M=dr(),C=v(M);if(e=arguments,n=this,s=M,C){if(o===void 0)return P(s);if(l)return clearTimeout(o),o=setTimeout(T,r),y(s);}return o===void 0&&(o=setTimeout(T,r)),a;}return g.cancel=d,g.flush=u,g;}var L0=w0,b0=L0,D0=pe,N0="Expected a function";function W0(h,r,t){var e=!0,n=!0;if(typeof h!="function")throw new TypeError(N0);return D0(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),b0(h,r,{leading:e,maxWait:r,trailing:n});}var B0=W0,F0=/* @__PURE__ */de(B0);function U0(h){return h;}var Di=U0;function j0(h,r,t){switch(t.length){case 0:return h.call(r);case 1:return h.call(r,t[0]);case 2:return h.call(r,t[0],t[1]);case 3:return h.call(r,t[0],t[1],t[2]);}return h.apply(r,t);}var $0=j0,z0=$0,Dn=Math.max;function G0(h,r,t){return r=Dn(r===void 0?h.length-1:r,0),function(){for(var e=arguments,n=-1,i=Dn(e.length-r,0),a=Array(i);++n<i;)a[n]=e[r+n];n=-1;for(var o=Array(r+1);++n<r;)o[n]=e[n];return o[r]=t(a),z0(h,this,o);};}var H0=G0;function K0(h){return function(){return h;};}var Y0=K0,V0=Y0,Nn=Vn,k0=Di,X0=Nn?function(h,r){return Nn(h,"toString",{configurable:!0,enumerable:!1,value:V0(r),writable:!0});}:k0,J0=X0,Z0=800,Q0=16,q0=Date.now;function _0(h){var r=0,t=0;return function(){var e=q0(),n=Q0-(e-t);if(t=e,n>0){if(++r>=Z0)return arguments[0];}else r=0;return h.apply(void 0,arguments);};}var tg=_0,eg=J0,rg=tg,ng=rg(eg),ig=ng,sg=Di,og=H0,ag=ig;function lg(h,r){return ag(og(h,r,sg),h+"");}var cg=lg;function fg(h,r,t,e){for(var n=h.length,i=t+(e?1:-1);e?i--:++i<n;)if(r(h[i],i,h))return i;return-1;}var hg=fg;function ug(h){return h!==h;}var dg=ug;function pg(h,r,t){for(var e=t-1,n=h.length;++e<n;)if(h[e]===r)return e;return-1;}var gg=pg,mg=hg,vg=dg,yg=gg;function Sg(h,r,t){return r===r?yg(h,r,t):mg(h,vg,t);}var xg=Sg,Tg=xg;function Mg(h,r){var t=h==null?0:h.length;return!!t&&Tg(h,r,0)>-1;}var Ni=Mg;function Pg(h,r,t){for(var e=-1,n=h==null?0:h.length;++e<n;)if(t(r,h[e]))return!0;return!1;}var Wi=Pg;function Og(h,r){for(var t=-1,e=h==null?0:h.length,n=Array(e);++t<e;)n[t]=r(h[t],t,h);return n;}var Eg=Og,Cg=Fr,Ag=Ni,Rg=Wi,Ig=Eg,wg=lr,Lg=Ur,bg=200;function Dg(h,r,t,e){var n=-1,i=Ag,a=!0,o=h.length,s=[],c=r.length;if(!o)return s;t&&(r=Ig(r,wg(t))),e?(i=Rg,a=!1):r.length>=bg&&(i=Lg,a=!1,r=new Cg(r));t:for(;++n<o;){var m=h[n],l=t==null?m:t(m);if(m=e||m!==0?m:0,a&&l===l){for(var p=c;p--;)if(r[p]===l)continue t;s.push(m);}else i(r,l,e)||s.push(m);}return s;}var Ng=Dg,Wn=je,Wg=Zn,Bg=$e,Bn=Wn?Wn.isConcatSpreadable:void 0;function Fg(h){return Bg(h)||Wg(h)||!!(Bn&&h&&h[Bn]);}var Ug=Fg,jg=br,$g=Ug;function Bi(h,r,t,e,n){var i=-1,a=h.length;for(t||(t=$g),n||(n=[]);++i<a;){var o=h[i];r>0&&t(o)?r>1?Bi(o,r-1,t,e,n):jg(n,o):e||(n[n.length]=o);}return n;}var zg=Bi;function Gg(){}var Hg=Gg,pr=ai,Kg=Hg,Yg=jr,Vg=1/0,kg=pr&&1/Yg(new pr([,-0]))[1]==Vg?function(h){return new pr(h);}:Kg,Xg=kg,Jg=Fr,Zg=Ni,Qg=Wi,qg=Ur,_g=Xg,tm=jr,em=200;function rm(h,r,t){var e=-1,n=Zg,i=h.length,a=!0,o=[],s=o;if(t)a=!1,n=Qg;else if(i>=em){var c=r?null:_g(h);if(c)return tm(c);a=!1,n=qg,s=new Jg();}else s=r?[]:o;t:for(;++e<i;){var m=h[e],l=r?r(m):m;if(m=t||m!==0?m:0,a&&l===l){for(var p=s.length;p--;)if(s[p]===l)continue t;r&&s.push(l),o.push(m);}else n(s,l,t)||(s!==o&&s.push(l),o.push(m));}return o;}var nm=rm,im=Ng,sm=zg,Fn=nm;function om(h,r,t){var e=h.length;if(e<2)return e?Fn(h[0]):[];for(var n=-1,i=Array(e);++n<e;)for(var a=h[n],o=-1;++o<e;)o!=n&&(i[n]=im(i[n]||a,h[o],r,t));return Fn(sm(i,1),r,t);}var am=om,lm=Rr,cm=oe;function fm(h){return cm(h)&&lm(h);}var hm=fm,um=ei,dm=cg,pm=am,gm=hm,mm=dm(function(h){return pm(um(h,gm));}),vm=mm,ym=/* @__PURE__ */de(vm);var Sm=/*#__PURE__*/function(_bi){function Sm(t){var _this90;_classCallCheck(this,Sm);_this90=_callSuper(this,Sm,[t]);tt(_this90,"combineUnitTime",_t.bezier.combineUnitTime);tt(_this90,"combineTimerId");tt(_this90,"combineDrawResolve");tt(_this90,"combineDrawActiveId");tt(_this90,"drawWorkActiveId");tt(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());tt(_this90,"batchEraserWorks",/* @__PURE__ */new Set());tt(_this90,"batchEraserRemoveNodes",/* @__PURE__ */new Set());tt(_this90,"batchEraserCombine",F0(function(){var t=_this90.updateBatchEraserCombineNode(_this90.batchEraserWorks,_this90.batchEraserRemoveNodes);_this90.batchEraserWorks.clear(),_this90.batchEraserRemoveNodes.clear(),t.length&&_this90._post({render:t});},200,{leading:!1}));return _this90;}_inherits(Sm,_bi);return _createClass(Sm,[{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(_x37){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,e){var _this91=this;var n,i,a,o,s,c,m,l;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=t.op,i=t.workId,a=t.scenePath,o=t.postCount;if(!(n!=null&&n.length&&i)){_context37.next=56;break;}s=i.toString(),c=this.getWorkShape(s);if(c){_context37.next=5;break;}return _context37.abrupt("return");case 5:m=c.toolsType;if(!(m===dt.LaserPen)){_context37.next=8;break;}return _context37.abrupt("return");case 8:_context37.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==s;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:a,viewId:this.viewId,msgType:ot.DrawWork,dataType:Tt.Local},e);case 13:_context37.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==s;if(!_context37.t1){_context37.next=18;break;}_context37.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:a,viewId:this.viewId,msgType:ot.DrawWork,dataType:Tt.Local},e);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&s!==Wt&&(this.drawWorkActiveId=s);kt(o)&&(this.consumeCount=o);l=c.consume({data:t,isFullWork:!0});_context37.t2=m;_context37.next=_context37.t2===dt.Selector?24:_context37.t2===dt.PencilEraser?30:_context37.t2===dt.BitMapEraser?33:_context37.t2===dt.Eraser?40:_context37.t2===dt.Arrow?43:_context37.t2===dt.Straight?43:_context37.t2===dt.Ellipse?43:_context37.t2===dt.Rectangle?43:_context37.t2===dt.Star?43:_context37.t2===dt.Polygon?43:_context37.t2===dt.SpeechBalloon?43:_context37.t2===dt.Pencil?49:56;break;case 24:_context37.t3=l.type===ot.Select;if(!_context37.t3){_context37.next=29;break;}l.selectIds&&e.runReverseSelectWork(l.selectIds);_context37.next=29;return this.drawSelector(l);case 29:return _context37.abrupt("break",56);case 30:_context37.next=32;return this.drawPencilEraser(l);case 32:return _context37.abrupt("break",56);case 33:this.drawCount++;this.combineTimerId||new Promise(function(p){_this91.combineDrawActiveId=s,_this91.combineDrawResolve=p,_this91.combineTimerId=setTimeout(function(){_this91.combineTimerId=void 0,_this91.combineDrawResolve&&_this91.combineDrawResolve(!0);},_this91.combineUnitTime);}).then(function(p){p&&_this91.drawBitMapCombine(s,_this91.drawCount),_this91.combineDrawResolve=void 0;});_context37.t4=l;if(!_context37.t4){_context37.next=39;break;}_context37.next=39;return this.drawBitMapEraser(l);case 39:return _context37.abrupt("break",56);case 40:_context37.next=42;return this.drawEraser(l);case 42:return _context37.abrupt("break",56);case 43:_context37.t5=l;if(!_context37.t5){_context37.next=48;break;}this.drawCount++;_context37.next=48;return this.drawShape(l);case 48:return _context37.abrupt("break",56);case 49:this.drawCount++;this.combineTimerId||new Promise(function(p){_this91.combineDrawActiveId=s,_this91.combineDrawResolve=p,_this91.combineTimerId=setTimeout(function(){_this91.combineTimerId=void 0,_this91.combineDrawResolve&&_this91.combineDrawResolve(!0);},_this91.combineUnitTime);}).then(function(p){p&&_this91.drawPencilCombine(s,_this91.drawCount),_this91.combineDrawResolve=void 0;});_context37.t6=l;if(!_context37.t6){_context37.next=55;break;}_context37.next=55;return this.drawPencil(l);case 55:return _context37.abrupt("break",56);case 56:case"end":return _context37.stop();}},_callee35,this);}));function consumeDraw(_x38,_x39){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,e){var o,s,c,n,i,a,m,l,p,y,P,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,a=t.isLockSentEventCursor;if(!n){_context38.next=42;break;}m=n.toString();this.drawWorkActiveId===m&&(this.drawWorkActiveId=void 0);l=this.workShapes.get(m);if(l){_context38.next=8;break;}return _context38.abrupt("return");case 8:p=l.toolsType;if(!(p===dt.LaserPen)){_context38.next=11;break;}return _context38.abrupt("return");case 11:y=this.workShapes.get(Ne),P=(o=y==null?void 0:y.selectIds)==null?void 0:o[0],S=l.consumeAll({data:t,workerEngine:this});_context38.t0=p;_context38.next=_context38.t0===dt.Selector?15:_context38.t0===dt.PencilEraser?21:_context38.t0===dt.BitMapEraser?23:_context38.t0===dt.Eraser?28:_context38.t0===dt.Arrow?30:_context38.t0===dt.Straight?30:_context38.t0===dt.Ellipse?30:_context38.t0===dt.Rectangle?30:_context38.t0===dt.Star?30:_context38.t0===dt.Polygon?30:_context38.t0===dt.SpeechBalloon?30:_context38.t0===dt.Pencil?35:42;break;case 15:S.selectIds&&P&&(s=S.selectIds)!=null&&s.includes(P)&&y.cursorBlur();S.selectIds&&e.runReverseSelectWork(S.selectIds);_context38.next=19;return this.drawSelector(_objectSpread(_objectSpread({},S),{},{scenePath:i}));case 19:(c=l.selectIds)!=null&&c.length?l.clearTmpPoints():this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",42);case 21:this.drawPencilEraser(_objectSpread(_objectSpread({},S),{},{scenePath:i}),a),l.clearTmpPoints();return _context38.abrupt("break",42);case 23:_context38.next=25;return this.drawBitMapEraserFull(l,_objectSpread(_objectSpread({},S),{},{scenePath:i}),a);case 25:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",42);case 28:this.drawEraser(_objectSpread(_objectSpread({},S),{},{scenePath:i}),a),l.clearTmpPoints();return _context38.abrupt("break",42);case 30:_context38.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},S),{},{scenePath:i}),a);case 32:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",42);case 35:_context38.t1=S!=null&&S.rect;if(!_context38.t1){_context38.next=40;break;}_context38.next=39;return this.drawPencilFull(_objectSpread(_objectSpread({},S),{},{scenePath:i}),a);case 39:this.drawCount=0;case 40:this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",42);case 42:case"end":return _context38.stop();}},_callee36,this);}));function consumeDrawAll(_x40,_x41){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,e){var _iterator54,_step54,n;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_iterator54=_createForOfIteratorHelper(this.workShapes.keys());_context39.prev=1;_iterator54.s();case 3:if((_step54=_iterator54.n()).done){_context39.next=9;break;}n=_step54.value;_context39.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:ot.DrawWork,dataType:Tt.Local},e);case 7:_context39.next=3;break;case 9:_context39.next=14;break;case 11:_context39.prev=11;_context39.t0=_context39["catch"](1);_iterator54.e(_context39.t0);case 14:_context39.prev=14;_iterator54.f();return _context39.finish(14);case 17:case"end":return _context39.stop();}},_callee37,this,[[1,11,14,17]]);}));function workShapesDone(_x42,_x43){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var i,a,e,n,o,s,c,m,l,p,y;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:e=this.setFullWork(t),n=t.ops&&Ee(t.ops)||t.op;if(!e){_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:s=(a=this.vNodes.get(o))==null?void 0:a.rect;if(!(e.toolsType===dt.Image)){_context40.next=13;break;}_context40.next=9;return e.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 9:c=_context40.sent;m=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);_context40.next=20;break;case 13:if(!(e.toolsType===dt.Text)){_context40.next=19;break;}_context40.next=16;return e.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:c=_context40.sent;_context40.next=20;break;case 19:c=e.consumeService({op:n,isFullWork:!0,replaceId:o}),m=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 20:c=Pt(c,m);l=[],p=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),c&&t.willRefresh&&(s&&l.push({rect:Nt(s),isClear:!0,clearCanvas:St.Bg,viewId:this.viewId}),l.push({rect:Nt(c),drawCanvas:St.Bg,viewId:this.viewId})),t.willSyncService&&p.push({opt:t.opt,toolsType:t.toolsType,type:ot.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),l.length||p.length)){_context40.next=26;break;}y={render:l,sp:p};_context40.next=26;return this._post(y);case 26:case"end":return _context40.stop();}},_callee38,this);}));function consumeFull(_x44){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var e=this.vNodes.get(t);if(e&&e.toolsType===dt.Text)return{type:ot.TextUpdate,toolsType:dt.Text,workId:t,dataType:Tt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t,e){var n,i,a,o,s,c,_iterator55,_step55,m,y,p;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:n=t.willSyncService,i=[],a=[],o=[],s=this.workShapes.get(Wt);if(s){_context41.next=3;break;}return _context41.abrupt("return");case 3:c=s.selectIds&&_toConsumableArray(s.selectIds)||[];_iterator55=_createForOfIteratorHelper(c);try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){m=_step55.value;if(this.vNodes.get(m)){y=this.commandDeleteText(m);y&&i.push(y);}p=this._removeWork(m);p.length&&a.push.apply(a,_toConsumableArray(p)),e==null||e.deleteCachedImagesByWorkId(m),o.push(m);}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}o.length&&i.push({type:ot.RemoveNode,removeIds:o});i.push({type:ot.Select,selectIds:[],willSyncService:n});_context41.next=10;return this.blurSelector();case 10:_context41.t0=a.length||i.length;if(!_context41.t0){_context41.next=14;break;}_context41.next=14;return this._post({render:a,sp:i});case 14:case"end":return _context41.stop();}},_callee39,this);}));function removeSelector(_x45,_x46){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:e=t.workId,n=e==null?void 0:e.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(_x47){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this92=this;var i,a,o;var e=this.vNodes.get(t);e&&((i=this.fullLayer)==null||i.getElementsByName(t).forEach(function(s){s.remove(),_Zt(s,_this92.fullLayer.parent);}),this.vNodes["delete"](t));var n=this.drawLayer&&vt.getRectFromLayer(this.drawLayer,t);if(n){var s=(a=this.drawLayer)==null?void 0:a.getElementsByName(t)[0];s&&(s.remove(),_Zt(s,(o=this.drawLayer)==null?void 0:o.parent));}return this.getWorkShape(t)&&this.clearWorkShapeNodeCache(t),{fullRect:e==null?void 0:e.rect,drawRect:n};}},{key:"_removeWork",value:function _removeWork(t){var _this$removeNode=this.removeNode(t),e=_this$removeNode.fullRect,n=_this$removeNode.drawRect,i=[];return e&&i.push({rect:Nt(e),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(e),drawCanvas:St.Bg,viewId:this.viewId}),n&&i.push({rect:Nt(n),clearCanvas:St.Float,isClear:!0,viewId:this.viewId},{rect:Nt(n),drawCanvas:St.Float,viewId:this.viewId}),i;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var e,n,i,a,o,s,c,_iterator56,_step56,m,l,p,y,P;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context43.next=32;break;}s=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],c=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator56=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context43.prev=4;_iterator56.s();case 6:if((_step56=_iterator56.n()).done){_context43.next=14;break;}m=_step56.value;l=m.rect,p=m.name,y=m.toolsType,P=m.opt;if(!(y===dt.Text&&P.workState===Ot.Done&&Xp([s,c],l))){_context43.next=12;break;}a=p,o=this.setFullWork({workId:p,toolsType:y,opt:P});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);_iterator56.e(_context43.t0);case 19:_context43.prev=19;_iterator56.f();return _context43.finish(19);case 22:_context43.t1=a;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:ot.Select,dataType:i,isSync:!0});case 30:_context43.next=32;return this._post({sp:[{type:ot.GetTextActive,toolsType:dt.Text,workId:a}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x48){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var _this93=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:e=this.workShapes.get(Wt),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context44.next=6;break;}i===ot.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context44.next=5;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this93.effectSelectNodeData)==null||a.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(_x49){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this94=this;var P,e,n,i,a,o,s,c,m,l,p,y;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:e=this.workShapes.get(Wt);if((P=e==null?void 0:e.selectIds)!=null&&P.length){_context45.next=3;break;}return _context45.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;o=i.willSerializeData;_context45.next=9;return e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:Vt(e.selectIds),vNodes:this.vNodes,willSerializeData:o,worker:this});case 9:s=_context45.sent;c=/* @__PURE__ */new Map();s!=null&&s.selectIds&&(m=ym(e.selectIds,s.selectIds),s.selectIds.forEach(function(S){var v=_this94.vNodes.get(S);if(v){var _T42=v.toolsType,_f37=v.op,d=v.opt;c.set(S,{opt:d,toolsType:_T42,ops:(_f37==null?void 0:_f37.length)&&te(_f37)||void 0});}}),e.selectIds=s.selectIds);l=[],p=[];s!=null&&s.rect&&l.push({rect:Nt(s.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(s.rect),drawCanvas:St.Bg,viewId:this.viewId});y=n&&n({res:s,workShapeNode:e,param:i,postData:{render:l,sp:p},newServiceStore:c})||{render:l,sp:p};m&&y.sp.push({type:ot.RemoveNode,removeIds:m,viewId:this.viewId});_context45.t0=y.render.length||y.sp.length;if(!_context45.t0){_context45.next=20;break;}_context45.next=20;return this._post(y);case 20:case"end":return _context45.stop();}},_callee43,this);}));function updateSelector(_x50){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:e=this.workShapes.get(Wt),n=e==null?void 0:e.blurSelector();if(!(this.clearWorkShapeNodeCache(Wt),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(a){a.name===Wt&&a.remove();}),n)){_context46.next=6;break;}a=[];a.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:Nt(n.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(n.rect),drawCanvas:St.Bg,viewId:this.viewId}],sp:a});case 6:case"end":return _context46.stop();}},_callee44,this);}));function blurSelector(_x51){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Wt);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Wt);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(){var t,a,e,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;e=this.workShapes.get(Wt);if(e){_context47.next=4;break;}return _context47.abrupt("return");case 4:if(!(e&&!((a=e.selectIds)!=null&&a.length))){_context47.next=8;break;}_context47.next=7;return this.blurSelector();case 7:return _context47.abrupt("return");case 8:n=e.oldSelectRect,i=e.reRenderSelector();if(!i){_context47.next=13;break;}o=Pt(n,i)||i;_context47.next=13;return this._post({render:[{rect:Nt(o),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(o),drawCanvas:St.Bg,viewId:this.viewId}],sp:[{type:ot.Select,selectIds:e.selectIds,selectRect:i,willSyncService:t,viewId:this.viewId,points:e.getChildrenPoints(),textOpt:e.textOpt,selectorColor:e.selectorColor,strokeColor:e.strokeColor,fillColor:e.fillColor,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,opt:e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt,thickness:e.thickness,useStroke:e.useStroke,strokeType:e.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,a,o,s,c,m,l,e,n,_e$updateSelectIds,p,y,P;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:e=this.workShapes.get(Wt),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(e){_context48.next=10;break;}!this.setFullWork(t)&&t.workId&&((i=this.tmpOpt)==null?void 0:i.toolsType)===dt.Selector&&this.createWorkShape(t.workId.toString());_context48.next=9;return this.updateFullSelectWork(t);case 9:return _context48.abrupt("return");case 10:if(!(e&&n!=null&&n.length)){_context48.next=16;break;}_e$updateSelectIds=e.updateSelectIds(n),p=_e$updateSelectIds.bgRect,y=_e$updateSelectIds.selectRect,P={render:[],sp:[]};p&&((a=P.render)==null||a.push({rect:Nt(p),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(p),drawCanvas:St.Bg,viewId:this.viewId}));(l=P.sp)==null||l.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||e.selectorColor,strokeColor:((s=t.opt)==null?void 0:s.strokeColor)||e.strokeColor,fillColor:((c=t.opt)==null?void 0:c.fillColor)||e.fillColor,textOpt:((m=t.opt)==null?void 0:m.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:ot.Select,selectRect:y,points:e.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt,thickness:e.thickness,useStroke:e.useStroke,strokeType:e.strokeType}));_context48.next=16;return this._post(P);case 16:case"end":return _context48.stop();}},_callee46,this);}));function updateFullSelectWork(_x52){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(Sm,"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(_x53){return _drawBitMapEraser.apply(this,arguments);}return drawBitMapEraser;}()},{key:"drawBitMapEraserFull",value:function(){var _drawBitMapEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,e,n){var i,a,o,s,c,_iterator57,_step57,_step57$value,l,p,m;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:i=e.rect,a=e.willUpdateNodes,o=e.willDeleteNodes,s=t.getWorkId(),c=[{type:ot.RemoveNode,removeIds:[s],viewId:this.viewId}];if(n&&c.push({type:ot.None,isLockSentEventCursor:n}),a!=null&&a.size||o!=null&&o.size){if(a!=null&&a.size){_iterator57=_createForOfIteratorHelper(a);try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){_step57$value=_slicedToArray(_step57.value,2),l=_step57$value[0],p=_step57$value[1];c.push({type:ot.UpdateNode,dataType:Tt.Local,opt:p.opt,workId:l,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}o!=null&&o.size&&c.push({type:ot.RemoveNode,removeIds:_toConsumableArray(o),viewId:this.thread.viewId});}m=[{isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId}];i&&m.push({rect:i,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:i,drawCanvas:St.Bg,viewId:this.viewId});_context50.next=6;return this._post({sp:c,render:m,fullWorkerDrawCount:1/0});case 6:case"end":return _context50.stop();}},_callee48,this);}));function drawBitMapEraserFull(_x54,_x55,_x56){return _drawBitMapEraserFull.apply(this,arguments);}return drawBitMapEraserFull;}()},{key:"drawBitMapCombine",value:function(){var _drawBitMapCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,e){var i,a,o,n,s,c;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;}s={render:[],fullWorkerDrawCount:e};if(n!=null&&n.rect){c=Nt(n.rect);(a=s.render)==null||a.push({rect:c,isClear:!0,clearCanvas:St.Float,viewId:this.viewId}),(o=s.render)==null||o.push({rect:c,drawCanvas:St.Float,viewId:this.viewId});}_context51.next=6;return this._post(s);case 6:case"end":return _context51.stop();}},_callee49,this);}));function drawBitMapCombine(_x57,_x58){return _drawBitMapCombine.apply(this,arguments);}return drawBitMapCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t,e){var i,a,o,n,s,c;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;}s={render:[],fullWorkerDrawCount:e};if(n!=null&&n.rect){c=Nt(n.rect);(a=s.render)==null||a.push({rect:c,isClear:!0,clearCanvas:St.Float,viewId:this.viewId}),(o=s.render)==null||o.push({rect:c,drawCanvas:St.Float,viewId:this.viewId});}_context52.next=6;return this._post(s);case 6:case"end":return _context52.stop();}},_callee50,this);}));function drawPencilCombine(_x59,_x60){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t){var n,e;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:Nt(t.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(t.rect),drawCanvas:St.Bg,viewId:this.viewId}));_context53.next=4;return this._post(e);case 4:case"end":return _context53.stop();}},_callee51,this);}));function drawSelector(_x61){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilEraser",value:function(){var _drawPencilEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,e){var _this95=this;var i,a,n,_iterator58,_step58,o,s;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:n=[];if((i=t.newWorkDatas)!=null&&i.size){_iterator58=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){o=_step58.value;s=o.workId.toString();this.batchEraserWorks.add(s),n.push({type:ot.FullWork,workId:s,ops:te(o.op),opt:o.opt,toolsType:o.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}delete t.newWorkDatas;}(a=t.removeIds)==null||a.forEach(function(o){_this95.batchEraserRemoveNodes.add(o);});e&&n.push({type:ot.None,isLockSentEventCursor:e});t.rect&&n.push(t);_context54.next=7;return this._post({sp:n,consumeCount:this.consumeCount});case 7:this.batchEraserCombine();case 8:case"end":return _context54.stop();}},_callee52,this);}));function drawPencilEraser(_x62,_x63){return _drawPencilEraser.apply(this,arguments);}return drawPencilEraser;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:n=[],i=[];e&&n.push({type:ot.None,isLockSentEventCursor:e});t.removeIds&&n.push(t);t.rect&&i.push({rect:t.rect,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:St.Bg,viewId:this.viewId});_context55.next=6;return this._post({sp:n,render:i,consumeCount:this.consumeCount});case 6:case"end":return _context55.stop();}},_callee53,this);}));function drawEraser(_x64,_x65){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(t){return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:_context56.next=2;return this._post({fullWorkerDrawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context56.stop();}},_callee54,this);}));function drawShape(_x66){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t){return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_context57.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context57.stop();}},_callee55,this);}));function drawPencil(_x67){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t,e){var i,a,n;return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:n={fullWorkerDrawCount:1/0,render:[],sp:[t]};e&&((i=n.sp)==null||i.push({type:ot.None,isLockSentEventCursor:e}));(a=n.render)==null||a.push({isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:St.Bg,viewId:this.viewId});_context58.next=5;return this._post(n);case 5:case"end":return _context58.stop();}},_callee56,this);}));function drawPencilFull(_x68,_x69){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this96=this;var n=[];var i;var _iterator59=_createForOfIteratorHelper(e.keys()),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var a=_step59.value;this.fullLayer.getElementsByName(a).forEach(function(o){var s=o.getBoundingClientRect();i=Pt(i,{x:s.x-fe.SafeBorderPadding,y:s.y-fe.SafeBorderPadding,w:s.width+fe.SafeBorderPadding*2,h:s.height+fe.SafeBorderPadding*2}),o.remove(),_Zt(_this96.fullLayer,_this96.fullLayer.parent);});}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}return t.forEach(function(a){var o=_this96.vNodes.get(a);if(o)if(_this96.fullLayer.getElementsByName(a)[0])i=Pt(i,o.rect);else{var c=_this96.setFullWork(_objectSpread(_objectSpread({},o),{},{workId:a})),m=c&&c.consumeService({op:o.op,isFullWork:!0});m&&(o.rect=m,i=Pt(i,m));}}),i&&n.push({rect:i,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:i,drawCanvas:St.Bg,viewId:this.viewId}),n;}},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(t){var e,_iterator60,_step60,n,i,a,o;return _regeneratorRuntime().wrap(function _callee57$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:_iterator60=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context59.prev=1;_iterator60.s();case 3:if((_step60=_iterator60.n()).done){_context59.next=23;break;}n=_step60.value;i=this.setFullWork(n);if(!i){_context59.next=21;break;}a=(e=i.getWorkId())==null?void 0:e.toString();if(!(i.toolsType===dt.Image)){_context59.next=13;break;}_context59.next=11;return i.consumeServiceAsync({isFullWork:!0,replaceId:a,worker:this});case 11:_context59.next=20;break;case 13:if(!(i.toolsType===dt.Text)){_context59.next=18;break;}_context59.next=16;return i.consumeServiceAsync({isFullWork:!0,replaceId:a});case 16:_context59.next=20;break;case 18:o=n.ops&&Ee(n.ops);i.consumeService({op:o,isFullWork:!0,replaceId:a}),n!=null&&n.updateNodeOpt&&i.updataOptService(n.updateNodeOpt);case 20:n.workId&&this.workShapes["delete"](n.workId.toString());case 21:_context59.next=3;break;case 23:_context59.next=28;break;case 25:_context59.prev=25;_context59.t0=_context59["catch"](1);_iterator60.e(_context59.t0);case 28:_context59.prev=28;_iterator60.f();return _context59.finish(28);case 31:_context59.next=33;return this.reRenderSelector(t);case 33:case"end":return _context59.stop();}},_callee57,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x70){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(t){var o,e,n,i,a,s,c;return _regeneratorRuntime().wrap(function _callee58$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:Ne,toolsType:n,opt:e});if(!(a&&i)){_context60.next=8;break;}s=a.cursorHover(i),c={render:[]};_context60.t0=s&&s.type===ot.CursorHover&&s.rect;if(!_context60.t0){_context60.next=8;break;}(o=c.render)==null||o.push({rect:Nt(s.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(s.rect),drawCanvas:St.Bg,viewId:this.viewId});_context60.next=8;return this._post(c);case 8:case"end":return _context60.stop();}},_callee58,this);}));function cursorHover(_x71){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(){var n,t,e;return _regeneratorRuntime().wrap(function _callee59$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:t=this.getWorkShape(Ne);_context61.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context61.t0){_context61.next=10;break;}e=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(Ne);_context61.t1=e;if(!_context61.t1){_context61.next=10;break;}_context61.next=10;return this._post({render:[{rect:Nt(e),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:Nt(e),drawCanvas:St.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 _context61.stop();}},_callee59,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(bi);var xm=/*#__PURE__*/function(){function xm(r){_classCallCheck(this,xm);tt(this,"viewId");tt(this,"vNodes");tt(this,"fullLayer");tt(this,"drawLayer");tt(this,"workShapes",/* @__PURE__ */new Map());tt(this,"selectorWorkShapes",/* @__PURE__ */new Map());tt(this,"thread");tt(this,"animationId");tt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());tt(this,"runEffectId");tt(this,"noAnimationRect");tt(this,"syncUnitTime",_t.syncOpt.interval);tt(this,"post");this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(xm,[{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 _callee60(r){return _regeneratorRuntime().wrap(function _callee60$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:this.activeWorkShape(r),this.runAnimation();case 1:case"end":return _context62.stop();}},_callee60,this);}));function consumeDraw(_x72){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(r){this.activeWorkShape(r),this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(r){this.activeSelectorShape(r);var t=r.workId,e=t==null?void 0:t.toString();e&&this.willRunEffectSelectorIds.add(e),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(r,t,e,n){return t.toolsType=e,t.node=$r({workId:r,toolsType:e,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(r){var _this97=this;r.forEach(function(t){_this97.selectorWorkShapes.forEach(function(e,n){var i;if((i=e.selectIds)!=null&&i.length){var a=e.selectIds.indexOf(t);a>-1&&(e.selectIds.splice(a,1),_this97.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(r){var t,e,n;return _regeneratorRuntime().wrap(function _callee61$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:t=r.workId,e=t==null?void 0:t.toString();if(!e){_context63.next=10;break;}n=this.workShapes.get(e);if(!n){_context63.next=8;break;}this.workShapes["delete"](e);_context63.next=7;return this.removeNode(e,r,n==null?void 0:n.totalRect,!1);case 7:return _context63.abrupt("return");case 8:_context63.next=10;return this.removeNode(e,r);case 10:case"end":return _context63.stop();}},_callee61,this);}));function removeWork(_x73){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(r){var t=r.workId,e=t==null?void 0:t.toString();e&&(this.activeSelectorShape(r),this.willRunEffectSelectorIds.add(e)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee62(r,t,e){var _this98=this;var n,c,i,a,o,s,_args64=arguments;return _regeneratorRuntime().wrap(function _callee62$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:n=_args64.length>3&&_args64[3]!==undefined?_args64[3]:!0;r.indexOf(Wt)>-1&&this.removeSelectWork(t);i=e;a=(c=this.vNodes.get(r))==null?void 0:c.rect;a&&(i=Pt(a,i));o=this.fullLayer&&vt.getRectFromLayer(this.fullLayer,r);i=Pt(i,o);s=this.drawLayer&&vt.getRectFromLayer(this.drawLayer,r);i=Pt(i,s);this.fullLayer.getElementsByName(r).forEach(function(m){m.remove(),_Zt(m,_this98.fullLayer.parent);});this.drawLayer.getElementsByName(r).forEach(function(m){m.remove(),_Zt(m,_this98.drawLayer.parent);});this.vNodes["delete"](r);_context64.t0=i;if(!_context64.t0){_context64.next=16;break;}_context64.next=16;return this.post({render:[{rect:Nt(i),isClear:!0,clearCanvas:n?St.Bg:St.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId},{rect:Nt(i),drawCanvas:n?St.Bg:St.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId}]});case 16:case"end":return _context64.stop();}},_callee62,this);}));function removeNode(_x74,_x75,_x76){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(r){var y,P,S,v;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op,c=r.useAnimation;if(!t)return;var m=t.toString(),l=(y=this.vNodes.get(m))==null?void 0:y.rect;if(!((P=this.workShapes)!=null&&P.has(m))){var _T43={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,useAnimation:_typeof(c)<"u"?c:_typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:l,isDiff:!1};n&&e&&(_T43=this.setNodeKey(m,_T43,n,e)),(S=this.workShapes)==null||S.set(m,_T43);}var p=(v=this.workShapes)==null?void 0:v.get(m);i&&(p.type=i),o&&(p.animationWorkData=Ee(o),p.ops=o),a&&(p.updateNodeOpt=a),s&&(p.isDiff=this.hasDiffData(p.animationWorkData||[],s,p.toolsType),p.animationWorkData=s),p.node&&p.node.getWorkId()!==m&&p.node.setWorkId(m),l&&(p.oldRect=l),n&&e&&(e.syncUnitTime&&(this.syncUnitTime=e.syncUnitTime),p.toolsType!==n&&n&&e&&this.setNodeKey(m,p,n,e),p.node&&p.node.setWorkOptions(e));}},{key:"hasDiffData",value:function hasDiffData(r,t,e){var n=r.length;if(t.length<n)return!0;switch(e){case dt.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break;}case dt.LaserPen:{for(var _i12=0;_i12<n;_i12+=2)if(t[_i12]!==r[_i12]||t[_i12+1]!==r[_i12+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(){var _this99=this;var n,i,a,o,s,c,m,l,p,y,P,S,v,T,f,d,u,g,M,C,A,L,O,w,b,I,R,W,z,K,J,q,U,G,Z,rt,et,r,t,e,_iterator61,_step61,_loop6;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator61=_createForOfIteratorHelper(this.workShapes.entries());_context66.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step61$value,it,X,ct,ut,_ct3,_ut2,_ct4,_ut3,B,F,_ct5,_ut4,_ct6,_ut5,_B,_F,Y,k,N,_k,_ct7,_ut6,_B2,_F2,_Y,_k2;return _regeneratorRuntime().wrap(function _loop6$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:_step61$value=_slicedToArray(_step61.value,2),it=_step61$value[0],X=_step61$value[1];_context65.t0=X.toolsType;_context65.next=_context65.t0===dt.Image?4:_context65.t0===dt.Text?11:_context65.t0===dt.Arrow?19:_context65.t0===dt.Straight?19:_context65.t0===dt.Rectangle?19:_context65.t0===dt.Ellipse?19:_context65.t0===dt.Star?19:_context65.t0===dt.Polygon?19:_context65.t0===dt.SpeechBalloon?19:_context65.t0===dt.Pencil?22:_context65.t0===dt.BitMapEraser?37:50;break;case 4:ct=X.oldRect;ct&&((n=t.render)==null||n.push({rect:ct,isClear:!0,clearCanvas:St.Bg,viewId:_this99.viewId}),(i=t.render)==null||i.push({rect:ct,drawCanvas:St.Bg,viewId:_this99.viewId}));_context65.next=8;return(a=X.node)==null?void 0:a.consumeServiceAsync({isFullWork:!0,worker:_this99.thread});case 8:ut=_context65.sent;_this99.selectorWorkShapes.forEach(function(B,F){var Y;(Y=B.selectIds)!=null&&Y.includes(it)&&(_this99.willRunEffectSelectorIds.add(F),_this99.noAnimationRect=Pt(_this99.noAnimationRect,ct),_this99.noAnimationRect=Pt(_this99.noAnimationRect,ut),_this99.runEffect());}),_this99.workShapes["delete"](it),(o=t.render)==null||o.push({rect:ut,drawCanvas:St.Bg,viewId:_this99.viewId});return _context65.abrupt("break",50);case 11:if(!X.node){_context65.next=18;break;}_ct3=X.oldRect;_ct3&&((s=t.render)==null||s.push({rect:_ct3,isClear:!0,clearCanvas:St.Bg,viewId:_this99.viewId}),(c=t.render)==null||c.push({rect:_ct3,drawCanvas:St.Bg,viewId:_this99.viewId}));_context65.next=16;return X.node.consumeServiceAsync({isFullWork:!0,replaceId:it});case 16:_ut2=_context65.sent;_this99.selectorWorkShapes.forEach(function(B,F){var Y;(Y=B.selectIds)!=null&&Y.includes(it)&&(_this99.willRunEffectSelectorIds.add(F),_this99.noAnimationRect=Pt(_this99.noAnimationRect,_ct3),_this99.noAnimationRect=Pt(_this99.noAnimationRect,_ut2),_this99.runEffect());}),(m=X.node)==null||m.clearTmpPoints(),_this99.workShapes["delete"](it),(l=t.render)==null||l.push({rect:_ut2,drawCanvas:St.Bg,viewId:_this99.viewId});case 18:return _context65.abrupt("break",50);case 19:_ct4=!!X.ops;if((p=X.animationWorkData)!=null&&p.length){_ut3=X.oldRect,B=X.node.oldRect;_ut3&&((y=t.render)==null||y.push({rect:_ut3,isClear:!0,clearCanvas:St.Bg,viewId:_this99.viewId}),(P=t.render)==null||P.push({rect:_ut3,drawCanvas:St.Bg,viewId:_this99.viewId})),B&&((S=t.render)==null||S.push({rect:B,isClear:!0,clearCanvas:St.ServiceFloat,viewId:_this99.viewId}));F=(v=X.node)==null?void 0:v.consumeService({op:X.animationWorkData,isFullWork:_ct4});e.set(it,{workState:_ut3?X.ops?Ot.Done:Ot.Doing:Ot.Start,op:X.animationWorkData.filter(function(Y,k){if(k%3!==2)return!0;}).slice(-2)}),_ct4?(_this99.selectorWorkShapes.forEach(function(Y,k){var N;(N=Y.selectIds)!=null&&N.includes(it)&&(_this99.willRunEffectSelectorIds.add(k),_this99.noAnimationRect=Pt(_this99.noAnimationRect,_ut3),_this99.noAnimationRect=Pt(_this99.noAnimationRect,B),_this99.noAnimationRect=Pt(_this99.noAnimationRect,F),_this99.runEffect());}),(T=X.node)==null||T.clearTmpPoints(),_this99.workShapes["delete"](it),(f=t.render)==null||f.push({rect:F,drawCanvas:St.Bg,viewId:_this99.viewId})):(d=t.render)==null||d.push({rect:F,drawCanvas:St.ServiceFloat,workerType:_ct4?void 0:Tt.Service,viewId:_this99.viewId}),X.animationWorkData.length=0;}return _context65.abrupt("break",50);case 22:if(!(!X.useAnimation&&X.ops)){_context65.next=28;break;}_ct5=(u=X.node)==null?void 0:u.consumeService({op:X.animationWorkData||[],isFullWork:!0,replaceId:it});_ut4=(g=X.node)==null?void 0:g.updataOptService(X.updateNodeOpt);_ct5=Pt(_ct5,_ut4),(M=t.render)==null||M.push({isClear:!0,rect:Pt(X.oldRect,_ct5),clearCanvas:St.Bg,viewId:_this99.viewId}),(C=t.render)==null||C.push({rect:Pt(X.oldRect,_ct5),drawCanvas:St.Bg,viewId:_this99.viewId}),_this99.selectorWorkShapes.forEach(function(B,F){var Y;(Y=B.selectIds)!=null&&Y.includes(it)&&(_this99.willRunEffectSelectorIds.add(F),_this99.noAnimationRect=Pt(_this99.noAnimationRect,_ct5),_this99.runEffect());}),(A=X.node)==null||A.clearTmpPoints(),_this99.workShapes["delete"](it);_context65.next=36;break;case 28:if(!X.useAnimation){_context65.next=36;break;}if(!X.isDel){_context65.next=32;break;}(L=X.node)==null||L.clearTmpPoints(),_this99.workShapes["delete"](it);return _context65.abrupt("break",50);case 32:_ct6=3,_ut5=_this99.computNextAnimationIndex(X,_ct6),_B=X.isDiff?0:Math.max(0,(X.animationIndex||0)-_ct6),_F=(X.animationWorkData||[]).slice(0,_ut5),Y=(w=(O=X.node)==null?void 0:O.getWorkId())==null?void 0:w.toString();if((X.animationIndex||0)<_ut5||X.isDiff){k=(b=X.node)==null?void 0:b.consumeService({op:_F,isFullWork:!1,replaceId:Y});if((I=t.render)==null||I.push({isClear:!0,rect:k,clearCanvas:St.ServiceFloat,viewId:_this99.viewId}),(R=t.render)==null||R.push({rect:k,drawCanvas:St.ServiceFloat,viewId:_this99.viewId}),X.animationIndex=_ut5,X.isDiff&&(X.isDiff=!1),_F.length){N=_F.filter(function($,x){if(x%_ct6!==_ct6-1)return!0;}).slice(-2);e.set(it,{workState:_B===0?Ot.Start:_ut5===((W=X.animationWorkData)==null?void 0:W.length)?Ot.Done:Ot.Doing,op:N});}}else if(X.ops){_k=(z=X.node)==null?void 0:z.consumeService({op:X.animationWorkData||[],isFullWork:!0,replaceId:Y});X.isDel=!0,(K=t.render)==null||K.push({isClear:!0,rect:_k,clearCanvas:St.ServiceFloat,viewId:_this99.viewId},{rect:_k,drawCanvas:St.ServiceFloat,viewId:_this99.viewId},{isClear:!0,rect:_k,clearCanvas:St.Bg,viewId:_this99.viewId},{rect:_k,drawCanvas:St.Bg,viewId:_this99.viewId}),e.set(it,{workState:Ot.Done,op:_F.filter(function(N,$){if($%_ct6!==_ct6-1)return!0;}).slice(-2)});}r=!0;return _context65.abrupt("break",50);case 36:return _context65.abrupt("break",50);case 37:if(!X.isDel){_context65.next=40;break;}(J=X.node)==null||J.clearTmpPoints(),_this99.workShapes["delete"](it);return _context65.abrupt("break",50);case 40:if(!(X.ops&&(q=X.animationWorkData)!=null&&q.length)){_context65.next=44;break;}_ct7=X.animationWorkData.slice(-3,-1);e.set(it,{workState:Ot.Done,op:_ct7}),X.isDel=!0;return _context65.abrupt("break",50);case 44:if(!X.useAnimation){_context65.next=49;break;}_ut6=_this99.computNextAnimationIndex(X,3),_B2=X.isDiff?0:Math.max(0,(X.animationIndex||0)-3),_F2=(X.animationWorkData||[]).slice(0,_ut6);if((X.animationIndex||0)<_ut6||X.isDiff){_Y=(U=X.node)==null?void 0:U.consumeService({op:_F2,isFullWork:!1,replaceId:it});if((G=t.render)==null||G.push({isClear:!0,rect:Pt(X.oldRect,_Y),clearCanvas:St.ServiceFloat,viewId:_this99.viewId}),(Z=t.render)==null||Z.push({rect:Pt(X.oldRect,_Y),drawCanvas:St.ServiceFloat,viewId:_this99.viewId}),X.animationIndex=_ut6,X.isDiff&&(X.isDiff=!1),_F2.length){_k2=_F2.filter(function(N,$){if($%3!==2)return!0;}).slice(-2);e.set(it,{workState:_B2===0?Ot.Start:_ut6===((rt=X.animationWorkData)==null?void 0:rt.length)?Ot.Done:Ot.Doing,op:_k2});}}r=!0;return _context65.abrupt("break",50);case 49:return _context65.abrupt("break",50);case 50:case"end":return _context65.stop();}},_loop6);});_iterator61.s();case 7:if((_step61=_iterator61.n()).done){_context66.next=11;break;}return _context66.delegateYield(_loop6(),"t0",9);case 9:_context66.next=7;break;case 11:_context66.next=16;break;case 13:_context66.prev=13;_context66.t1=_context66["catch"](4);_iterator61.e(_context66.t1);case 16:_context66.prev=16;_iterator61.f();return _context66.finish(16);case 19:r&&this.runAnimation();e.size&&(t.sp=[],e.forEach(function(it,X){var ct;(ct=t.sp)==null||ct.push({type:ot.Cursor,uid:X.split(We)[0],op:it.op,workState:it.workState,viewId:_this99.viewId});}));_context66.t2=(et=t.render)!=null&&et.length;if(!_context66.t2){_context66.next=25;break;}_context66.next=25;return this.post(t);case 25:case"end":return _context66.stop();}},_callee63,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this100=this;this.animationId||(this.animationId=setTimeout(function(){_this100.animationId=void 0,_this100.animationDraw();},16));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*48/t/this.syncUnitTime)*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"runEffect",value:function runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0));}},{key:"effectRunSelector",value:function(){var _effectRunSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(){var _this101=this;var r;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:this.runEffectId=void 0;r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,a;var e=_this101.selectorWorkShapes.get(t),n=e&&e.selectIds&&((i=e.node)==null?void 0:i.selectServiceNode(t,e,!0));r=Pt(r,n),(a=e==null?void 0:e.selectIds)!=null&&a.length||_this101.selectorWorkShapes["delete"](t);});_context67.t0=r;if(!_context67.t0){_context67.next=7;break;}_context67.next=7;return this.post({render:[{rect:Nt(r),isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:Nt(r),drawCanvas:St.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context67.stop();}},_callee64,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(r){var m,l,p;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.selectIds,o=r.imageBitmap;if(!t)return;var s=t.toString();if(!((m=this.selectorWorkShapes)!=null&&m.has(s))){var y={toolsType:n,selectIds:a,type:i,opt:e,imageBitmap:o};n&&e&&(y=this.setNodeKey(s,y,n,e)),(l=this.selectorWorkShapes)==null||l.set(s,y);}var c=(p=this.selectorWorkShapes)==null?void 0:p.get(s);i&&(c.type=i),c.node&&c.node.getWorkId()!==s&&c.node.setWorkId(s),o&&(c.imageBitmap=o),c.selectIds=a||[];}}]);}();var Tm=/*#__PURE__*/function(_bi2){function Tm(t){var _this102;_classCallCheck(this,Tm);_this102=_callSuper(this,Tm,[t]);tt(_this102,"drawWorkActiveId");return _this102;}_inherits(Tm,_bi2);return _createClass(Tm,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t){var i,e,n,a,o,s;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:e=this.setFullWork(t),n=t.ops&&Ee(t.ops);if(!e){_context68.next=18;break;}s=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===dt.Image)){_context68.next=9;break;}_context68.next=6;return e.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 6:a=_context68.sent;_context68.next=16;break;case 9:if(!(e.toolsType===dt.Text)){_context68.next=15;break;}_context68.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:s,isDrawLabel:!0});case 12:a=_context68.sent;_context68.next=16;break;case 15:a=e.consumeService({op:n,isFullWork:!0,replaceId:s}),o=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context68.abrupt("return",Pt(a,o));case 18:case"end":return _context68.stop();}},_callee65,this);}));function runFullWork(_x77){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"runSelectWork",value:function runSelectWork(t){var n;var e=this.setFullWork(t);e&&(n=t.selectIds)!=null&&n.length&&t.workId&&e.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator62=_createForOfIteratorHelper(this.workShapes.keys()),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var t=_step62.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}se(this.fullLayer,this.fullLayer.parent);}},{key:"canUseSubWorker",value:function canUseSubWorker(t){var e=this.thread.getPriorityDraw();return e||!e&&t!==dt.Pencil;}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t){var e,n,i,a,o,s,c;return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:e=t.workId,n=t.fullWorkerDrawCount,i=t.postCount,a=e==null?void 0:e.toString(),o=a&&this.workShapes.get(a);if(o){_context69.next=3;break;}return _context69.abrupt("return");case 3:_context69.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==a;if(!_context69.t0){_context69.next=8;break;}_context69.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:ot.DrawWork,dataType:Tt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&a!==Wt&&(this.drawWorkActiveId=a);s=o.toolsType;kt(i)&&(this.consumeCount=i);c=o.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:n});_context69.t1=s;_context69.next=_context69.t1===dt.Ellipse?15:_context69.t1===dt.Arrow?15:_context69.t1===dt.Straight?15:_context69.t1===dt.Rectangle?15:_context69.t1===dt.Star?15:_context69.t1===dt.Polygon?15:_context69.t1===dt.SpeechBalloon?15:_context69.t1===dt.Pencil?21:_context69.t1===dt.BitMapEraser?21:27;break;case 15:_context69.t2=c;if(!_context69.t2){_context69.next=20;break;}this.drawCount++;_context69.next=20;return this.drawShape(c);case 20:return _context69.abrupt("break",27);case 21:_context69.t3=c;if(!_context69.t3){_context69.next=26;break;}this.drawCount++;_context69.next=26;return this.drawPencil(c,e==null?void 0:e.toString());case 26:return _context69.abrupt("break",27);case 27:case"end":return _context69.stop();}},_callee66,this);}));function consumeDraw(_x78){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:e=t.workId;if(!e){_context70.next=12;break;}n=e.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);i=this.workShapes.get(n);if(i){_context70.next=7;break;}return _context70.abrupt("return");case 7:_context70.t0=i.toolsType;_context70.next=_context70.t0===dt.Arrow?10:_context70.t0===dt.Straight?10:_context70.t0===dt.Ellipse?10:_context70.t0===dt.Pencil?10:_context70.t0===dt.Rectangle?10:_context70.t0===dt.Star?10:_context70.t0===dt.Polygon?10:_context70.t0===dt.SpeechBalloon?10:_context70.t0===dt.BitMapEraser?10:12;break;case 10:this.drawCount=0,se(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n);return _context70.abrupt("break",12);case 12:case"end":return _context70.stop();}},_callee67,this);}));function consumeDrawAll(_x79){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){var e,n,i,a;return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context71.next=8;break;}i=this.removeNode(n);if(!i){_context71.next=8;break;}a=[];a.push({rect:Nt(i),clearCanvas:St.Float,isClear:!0,viewId:this.viewId},{rect:Nt(i),drawCanvas:St.Float,viewId:this.viewId});_context71.next=8;return this._post({render:a});case 8:case"end":return _context71.stop();}},_callee68,this);}));function removeWork(_x80){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this103=this;var e=this.workShapes.has(t);var n;return e&&(this.fullLayer.getElementsByName(t).forEach(function(i){var a=i.getBoundingClientRect();n=Pt(n,{x:a.x-vt.SafeBorderPadding,y:a.y-vt.SafeBorderPadding,w:a.width+vt.SafeBorderPadding*2,h:a.height+vt.SafeBorderPadding*2}),i.remove(),_Zt(i,_this103.fullLayer.parent);}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(t,e){return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:_context72.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:St.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context72.stop();}},_callee69,this);}));function drawPencil(_x81,_x82){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t){return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:_context73.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&Nt(t.rect),isClear:!0,clearCanvas:St.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Nt(t.rect),drawCanvas:St.Float,viewId:this.viewId}]});case 2:case"end":return _context73.stop();}},_callee70,this);}));function drawShape(_x83){return _drawShape2.apply(this,arguments);}return drawShape;}()}]);}(bi);var Mm=/*#__PURE__*/function(){function Mm(r){_classCallCheck(this,Mm);tt(this,"viewId");tt(this,"vNodes");tt(this,"topLayer");tt(this,"thread");tt(this,"post");tt(this,"serviceWorkShapes",/* @__PURE__ */new Map());tt(this,"localWorkShapes",/* @__PURE__ */new Map());tt(this,"tmpOpt");tt(this,"syncUnitTime",_t.syncOpt.interval);tt(this,"animationId");this.viewId=r.viewId,this.vNodes=r.vNodes,this.topLayer=r.topLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(Mm,[{key:"canUseTopLayer",value:function canUseTopLayer(r){return r===dt.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(r){return this.localWorkShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e16={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e16),{},{workId:r}));return n&&this.localWorkShapes.set(r,{node:n,toolsType:n.toolsType,workState:Ot.Start}),n;}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var n;var e=(n=this.localWorkShapes.get(r))==null?void 0:n.node;e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t=r.toolsType;if(t===dt.LaserPen)return $r(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(r){var t;return(t=r.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(r){var t;this.tmpOpt=r,(t=r.toolsOpt)!=null&&t.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consume({data:r,isFullWork:!1,isSubWorker:!0});a.rect&&(i.totalRect=Pt(a.rect,i.totalRect),i.result=a,i.workState=Ot.Doing,n&&this.localWorkShapes.set(n,i));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consumeAll({data:r});i.totalRect=Pt(a.rect,i.totalRect),i.result=a,i.workState=Ot.Done,n&&this.localWorkShapes.set(n,i);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(r,t,e,n){return t.toolsType=e,t.node=this.createWorkShapeNode({workId:r,toolsType:e,toolsOpt:n}),t;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(r){var p,y;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op;if(!t)return;var c=t.toString(),m=(p=this.vNodes.get(c))==null?void 0:p.rect;if(!((y=this.serviceWorkShapes)!=null&&y.has(c))){var P={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,oldRect:m};n&&e&&(P=this.setNodeKey(c,P,n,e)),this.serviceWorkShapes.set(c,P);}var l=this.serviceWorkShapes.get(c);i&&(l.type=i),o&&(l.animationWorkData=Ee(o),l.ops=o),a&&(l.updateNodeOpt=a),s&&(l.animationWorkData=s),l.node&&l.node.getWorkId()!==c&&l.node.setWorkId(c),m&&(l.oldRect=m),n&&e&&(l.toolsType!==n&&n&&e&&this.setNodeKey(c,l,n,e),l.node&&l.node.setWorkOptions(e));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(){var _this104=this;var a,o,s,c,r,t,e,n,i,_iterator63,_step63,_step63$value,m,l,y,P,S,v,_iterator64,_step64,_step64$value,_m10,_l7,p,_y14,_P4,_S4,_v11;return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator63=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context74.prev=4;_iterator63.s();case 6:if((_step63=_iterator63.n()).done){_context74.next=20;break;}_step63$value=_slicedToArray(_step63.value,2),m=_step63$value[0],l=_step63$value[1];_context74.t0=l.toolsType;_context74.next=_context74.t0===dt.LaserPen?11:18;break;case 11:y=this.computNextAnimationIndex(l,8),P=Math.max(0,l.animationIndex||0),S=(l.animationWorkData||[]).slice(P,y);if((l.animationIndex||0)<y){v=(a=l.node)==null?void 0:a.consumeService({op:S,isFullWork:!1});l.totalRect=Pt(l.totalRect,v),l.animationIndex=y,S.length&&t.set(m,{workState:P===0?Ot.Start:y===((o=l.animationWorkData)==null?void 0:o.length)?Ot.Done:Ot.Doing,op:S.slice(-2)});}if(!(n.push({isClear:!0,rect:l.totalRect,clearCanvas:St.TopFloat,viewId:this.viewId}),e.push({rect:l.totalRect,drawCanvas:St.TopFloat,viewId:this.viewId}),l.isDel)){_context74.next=16;break;}(s=l.node)==null||s.clearTmpPoints(),this.serviceWorkShapes["delete"](m);return _context74.abrupt("break",18);case 16:l.ops&&l.animationIndex===((c=l.animationWorkData)==null?void 0:c.length)&&!l.isDel&&(this.topLayer.getElementsByName(m.toString())[0]||(l.isDel=!0,this.serviceWorkShapes.set(m,l))),r=!0;return _context74.abrupt("break",18);case 18:_context74.next=6;break;case 20:_context74.next=25;break;case 22:_context74.prev=22;_context74.t1=_context74["catch"](4);_iterator63.e(_context74.t1);case 25:_context74.prev=25;_iterator63.f();return _context74.finish(25);case 28:_iterator64=_createForOfIteratorHelper(this.localWorkShapes.entries());_context74.prev=29;_iterator64.s();case 31:if((_step64=_iterator64.n()).done){_context74.next=44;break;}_step64$value=_slicedToArray(_step64.value,2),_m10=_step64$value[0],_l7=_step64$value[1];p=_l7.result,_y14=_l7.toolsType,_P4=_l7.totalRect,_S4=_l7.isDel,_v11=_l7.workState;_context74.t2=_y14;_context74.next=_context74.t2===dt.LaserPen?37:42;break;case 37:if(!(_P4&&(n.push({isClear:!0,rect:_P4,clearCanvas:St.TopFloat,viewId:this.viewId}),e.push({rect:_P4,drawCanvas:St.TopFloat,viewId:this.viewId})),_S4)){_context74.next=40;break;}_l7.node.clearTmpPoints(),this.localWorkShapes["delete"](_m10),i.push({removeIds:[_m10.toString()],viewId:this.viewId,type:ot.RemoveNode});return _context74.abrupt("break",42);case 40:p&&((p.op||p.ops)&&i.push(p),_l7.result=void 0),!this.topLayer.getElementsByName(_m10.toString())[0]&&_v11===Ot.Done&&(_l7.isDel=!0,this.localWorkShapes.set(_m10,_l7)),r=!0;return _context74.abrupt("break",42);case 42:_context74.next=31;break;case 44:_context74.next=49;break;case 46:_context74.prev=46;_context74.t3=_context74["catch"](29);_iterator64.e(_context74.t3);case 49:_context74.prev=49;_iterator64.f();return _context74.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(m,l){i.push({type:ot.Cursor,uid:l.split(We)[0],op:m.op,workState:m.workState,viewId:_this104.viewId});}),(e.length||n.length||i.length)&&this.post({render:[].concat(n,e),sp:i});case 53:case"end":return _context74.stop();}},_callee71,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this105=this;this.animationId||(this.animationId=setTimeout(function(){_this105.animationId=void 0,_this105.animationDraw();},16));}}]);}();var er=/* @__PURE__ */function(h){return h.Full="full",h.Sub="sub",h;}(er||{});var Pm=/*#__PURE__*/function(){function Pm(r,t){_classCallCheck(this,Pm);tt(this,"_self");tt(this,"version",pi);tt(this,"type");tt(this,"hasPriorityDraw",!0);tt(this,"workThreadMap",/* @__PURE__ */new Map());this._self=r,this.type=t,this.register();}return _createClass(Pm,[{key:"init",value:function init(r){var t=r.viewId,e=r.dpr,n=r.offscreenCanvasOpt,i=r.layerOpt,a=r.isSafari;if(!e||!n||!i)return;var o;this.type==="full"&&(o=new Om(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(o=new Fi(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this)),o.setHasPriorityDraw(this.hasPriorityDraw)),o&&a&&o.setIsSafari(a),o&&r.cameraOpt&&o.setCameraOpt(r.cameraOpt),o&&this.workThreadMap.set(t,o);}},{key:"register",value:function register(){var _this106=this;onmessage=/*#__PURE__*/function(){var _ref170=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(r){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_e17,n,i,a,o,_iterator65,_step65,c,_iterator66,_step66,_step66$value,_c7,m,l,_iterator67,_step67,_c8,s;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:t=r.data;if(!t){_context75.next=56;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context75.prev=4;_iterator=_asyncIterator(t.values());case 6:_context75.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context75.sent).done)){_context75.next=40;break;}_e17=_step.value;n=_e17.msgType,i=_e17.viewId,a=_e17.tasksqueue,o=_e17.mainTasksqueueCount;if(!(n===ot.Console)){_context75.next=14;break;}console.log(_this106);return _context75.abrupt("continue",37);case 14:if(!(n===ot.Init)){_context75.next=17;break;}_this106.init(_e17);return _context75.abrupt("continue",37);case 17:if(!(_this106.type==="sub"&&(n===ot.PriorityWorker||n===ot.PriorityMainThreadWorker))){_context75.next=22;break;}n===ot.PriorityWorker?_this106.hasPriorityDraw=!0:n===ot.PriorityMainThreadWorker&&(_this106.hasPriorityDraw=!1);_iterator65=_createForOfIteratorHelper(_this106.workThreadMap.values());try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){c=_step65.value;c.setHasPriorityDraw(_this106.hasPriorityDraw);}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}return _context75.abrupt("continue",37);case 22:if(!(n===ot.TasksQueue&&a!=null&&a.size)){_context75.next=27;break;}_iterator66=_createForOfIteratorHelper(_this106.workThreadMap.entries());try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){_step66$value=_slicedToArray(_step66.value,2),_c7=_step66$value[0],m=_step66$value[1];l=a.get(_c7);l&&m.on(l);}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}_this106.type==="full"&&kt(o)&&_this106.post({workerTasksqueueCount:o});return _context75.abrupt("continue",37);case 27:if(!(i===zi)){_context75.next=31;break;}_iterator67=_createForOfIteratorHelper(_this106.workThreadMap.values());try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){_c8=_step67.value;_c8.on(_e17),n===ot.Destroy&&_this106.workThreadMap["delete"](i);}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}return _context75.abrupt("continue",37);case 31:s=_this106.workThreadMap.get(i);_context75.t0=s;if(!_context75.t0){_context75.next=37;break;}_context75.next=36;return s.on(_e17);case 36:n===ot.Destroy&&_this106.workThreadMap["delete"](i);case 37:_iteratorAbruptCompletion=false;_context75.next=6;break;case 40:_context75.next=46;break;case 42:_context75.prev=42;_context75.t1=_context75["catch"](4);_didIteratorError=true;_iteratorError=_context75.t1;case 46:_context75.prev=46;_context75.prev=47;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context75.next=51;break;}_context75.next=51;return _iterator["return"]();case 51:_context75.prev=51;if(!_didIteratorError){_context75.next=54;break;}throw _iteratorError;case 54:return _context75.finish(51);case 55:return _context75.finish(46);case 56:case"end":return _context75.stop();}},_callee72,null,[[4,42,46,56],[47,,51,55]]);}));return function onmessage(_x84){return _ref170.apply(this,arguments);};}();}},{key:"post",value:function post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r);}}]);}();var Om=/*#__PURE__*/function(_Li){function Om(t,e,n){var _this107;_classCallCheck(this,Om);_this107=_callSuper(this,Om,[t,e,"full"/* Full */]);tt(_this107,"type","full");tt(_this107,"serviceDrawLayer");tt(_this107,"localDrawLayer");tt(_this107,"snapshotFullLayer");tt(_this107,"methodBuilder");tt(_this107,"localWork");tt(_this107,"serviceWork");tt(_this107,"_post");tt(_this107,"debounceUpdateCache",/* @__PURE__ */new Set());_this107._post=n;var i=_t.bufferSize.sub;_this107.serviceDrawLayer=_this107.createLayer("serviceDrawLayer",_this107.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i,contextType:"2d"})),_this107.localDrawLayer=_this107.createLayer("localDrawLayer",_this107.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i,contextType:"2d"}));var a={thread:_this107,viewId:_this107.viewId,vNodes:_this107.vNodes,fullLayer:_this107.fullLayer};_this107.localWork=new Sm(_objectSpread(_objectSpread({},a),{},{drawLayer:_this107.localDrawLayer})),_this107.serviceWork=new xm(_objectSpread(_objectSpread({},a),{},{drawLayer:_this107.serviceDrawLayer})),_this107.methodBuilder=new qi([Lt.CopyNode,Lt.SetColorNode,Lt.DeleteNode,Lt.RotateNode,Lt.ScaleNode,Lt.TranslateNode,Lt.ZIndexNode,Lt.SetFontStyle,Lt.SetPoint,Lt.SetLock,Lt.SetShapeOpt]).registerForWorker(_this107),_this107.vNodes.init(_this107.fullLayer);return _this107;}_inherits(Om,_Li);return _createClass(Om,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(){var _this108=this;var a,o,_this$combinePostData,t,e,n,s,_iterator68,_step68,c,m,i;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context76.next=28;break;}s=[];_iterator68=_createForOfIteratorHelper(t);_context76.prev=4;_iterator68.s();case 6:if((_step68=_iterator68.n()).done){_context76.next=19;break;}c=_step68.value;if(!c.rect){_context76.next=17;break;}if(!(c.rect=this.safariFixRect(Vt(c.rect),this.dpr),!c.rect)){_context76.next=11;break;}return _context76.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context76.next=16;break;}_context76.next=14;return this.getRectImageBitmap(c);case 14:m=_context76.sent;c.imageBitmap=m,n||(n=[]),n.push(m);case 16:s.push(c);case 17:_context76.next=6;break;case 19:_context76.next=24;break;case 21:_context76.prev=21;_context76.t0=_context76["catch"](4);_iterator68.e(_context76.t0);case 24:_context76.prev=24;_iterator68.f();return _context76.finish(24);case 27:e.render=s;case 28:i=(a=e.sp)==null?void 0:a.filter(function(s){return s.type!==ot.None||s.isLockSentEventCursor;});i!=null&&i.length?e.sp=i.map(function(s){return _objectSpread(_objectSpread({},s),{},{viewId:_this108.viewId});}):delete e.sp,e.fullWorkerDrawCount===void 0&&delete e.fullWorkerDrawCount,e.consumeCount===void 0&&delete e.consumeCount,(e!=null&&e.fullWorkerDrawCount||e.consumeCount||i!=null&&i.length||(o=e.render)!=null&&o.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context76.stop();}},_callee73,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 _callee74(t){var _this109=this;var e,n,i,a,o,s,c,m,_c9;return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context77.next=2;break;}return _context77.abrupt("return");case 2:e=t.msgType,n=t.dataType,i=t.workId,a=t.toolsType,o=t.workState,s=t.workIds;_context77.t0=e;_context77.next=_context77.t0===ot.AuthClear?6:_context77.t0===ot.CreateWork?9:_context77.t0===ot.DrawWork?11:_context77.t0===ot.Select?20:_context77.t0===ot.UpdateNode?27:_context77.t0===ot.FullWork?27:_context77.t0===ot.RemoveNode?29:_context77.t0===ot.GetTextActive?32:_context77.t0===ot.CursorHover?35:_context77.t0===ot.CursorBlur?38:_context77.t0===ot.GetVNodeInfo?41:43;break;case 6:c=t.clearUids,m=t.localUid;this.vNodes.setCanClearUids(c),this.vNodes.setLocalUid(m);return _context77.abrupt("break",43);case 9:a!==dt.LaserPen&&this.createLocalWork(t);return _context77.abrupt("break",43);case 11:_context77.t1=a!==dt.LaserPen;if(!_context77.t1){_context77.next=19;break;}if(!(o===Ot.Done&&n===Tt.Local)){_context77.next=18;break;}_context77.next=16;return this.consumeDrawAll(n,t);case 16:_context77.next=19;break;case 18:this.consumeDraw(n,t);case 19:return _context77.abrupt("break",43);case 20:if(!(i===Wt)){_context77.next=25;break;}_context77.next=23;return this.localWork.updateFullSelectWork(t);case 23:_context77.next=26;break;case 25:this.serviceWork.runSelectWork(t);case 26:return _context77.abrupt("return");case 27:this.consumeFull(n,t);return _context77.abrupt("return");case 29:_context77.next=31;return this.removeNode(t);case 31:return _context77.abrupt("return");case 32:_context77.next=34;return this.checkTextActive(t);case 34:return _context77.abrupt("return");case 35:_context77.next=37;return this.cursorHover(t);case 37:return _context77.abrupt("return");case 38:_context77.next=40;return this.cursorBlur();case 40:return _context77.abrupt("return");case 41:if(i&&s){_c9=s.map(function(m){return _this109.vNodes.get(m);});this.post({sp:[{type:ot.GetVNodeInfo,dataType:Tt.Worker,workId:i,vInfo:_c9}]});}return _context77.abrupt("break",43);case 43:_context77.next=45;return _superPropGet(Om,"on",this,3)([t]);case 45:case"end":return _context77.stop();}},_callee74,this);}));function on(_x85){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t){var _this110=this;var e,n,i,a,o,_iterator69,_step69,_loop7;return _regeneratorRuntime().wrap(function _callee75$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:e=t.dataType,n=t.workId,i=t.removeIds,a=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context79.next=20;break;}_iterator69=_createForOfIteratorHelper(o);_context79.prev=3;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var s;return _regeneratorRuntime().wrap(function _loop7$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:s=_step69.value;s===Wt?a.push(_this110.localWork.removeSelector(t,_this110)):e===Tt.Local?a.push(_this110.localWork.removeWork(t).then(function(){_this110.localWork.colloctEffectSelectWork(t),_this110.deleteCachedImagesByWorkId(s);})):e===Tt.Service&&a.push(_this110.serviceWork.removeWork(t).then(function(){_this110.localWork.colloctEffectSelectWork(t),_this110.deleteCachedImagesByWorkId(s);}));case 2:case"end":return _context78.stop();}},_loop7);});_iterator69.s();case 6:if((_step69=_iterator69.n()).done){_context79.next=10;break;}return _context79.delegateYield(_loop7(),"t0",8);case 8:_context79.next=6;break;case 10:_context79.next=15;break;case 12:_context79.prev=12;_context79.t1=_context79["catch"](3);_iterator69.e(_context79.t1);case 15:_context79.prev=15;_iterator69.f();return _context79.finish(15);case 18:_context79.next=20;return Promise.all(a);case 20:case"end":return _context79.stop();}},_callee75,null,[[3,12,15,18]]);}));function removeNode(_x86){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(t){var e;return _regeneratorRuntime().wrap(function _callee76$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:e=t.dataType;_context80.t0=e===Tt.Local;if(!_context80.t0){_context80.next=5;break;}_context80.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context80.stop();}},_callee76,this);}));function checkTextActive(_x87){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(){return _regeneratorRuntime().wrap(function _callee77$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:this.vNodes.clear();_superPropGet(Om,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),se(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),se(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context81.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:St.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:St.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId}],sp:[{type:ot.Clear}]});case 6:case"end":return _context81.stop();}},_callee77,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_superPropGet(Om,"updateLayer",this,3)([t]),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",e),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[e,n]),this.localDrawLayer.setAttribute("pos",[e*0.5,n*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",e),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[e,n]),this.serviceDrawLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var e=t.scale,n=t.centerX,i=t.centerY,a=t.width,o=t.height;(a!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:a,height:o}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[e,e]),this.fullLayer.setAttribute("translate",[-n,-i])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[e,e]),this.localDrawLayer.setAttribute("translate",[-n,-i])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[e,e]),this.serviceDrawLayer.setAttribute("translate",[-n,-i]));}},{key:"getLayer",value:function getLayer(t){switch(t){case St.Bg:return this.fullLayer;case St.ServiceFloat:return this.serviceDrawLayer;case St.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 _callee78(t,e){var n;return _regeneratorRuntime().wrap(function _callee78$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:_context82.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context82.sent;_context82.t0=n&&t===Tt.Local;if(!_context82.t0){_context82.next=7;break;}_context82.next=7;return this.localWork.consumeFull(n);case 7:n&&t===Tt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context82.stop();}},_callee78,this);}));function consumeFull(_x88,_x89){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,e){var n;return _regeneratorRuntime().wrap(function _callee79$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:n=e.workId;_context83.t0=t===Tt.Local&&n;if(!_context83.t0){_context83.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context83.next=6;return this.localWork.consumeDraw(e,this.serviceWork);case 6:t===Tt.Service&&this.serviceWork.consumeDraw(e);case 7:case"end":return _context83.stop();}},_callee79,this);}));function consumeDraw(_x90,_x91){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t,e){var n;return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:n=e.workId;_context84.t0=t===Tt.Local&&n;if(!_context84.t0){_context84.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context84.next=6;return this.localWork.consumeDrawAll(e,this.serviceWork);case 6:case"end":return _context84.stop();}},_callee80,this);}));function consumeDrawAll(_x92,_x93){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(t){return _regeneratorRuntime().wrap(function _callee81$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:_superPropGet(Om,"updateDpr",this,3)([t]);_context85.next=3;return this.post({render:[{isClearAll:!0,clearCanvas:St.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:this.viewId}]});case 3:case"end":return _context85.stop();}},_callee81,this);}));function updateDpr(_x94){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t){var _this111=this;var a,o,s,c,m,e,n,i,l,v,_iterator70,_step70,_step70$value,_T44,_f38,p,_iterator71,_step71,_step71$value,_v16,_T49,_f41,_iterator72,_step72,_step72$value,_v17,_T50,_f42,y,P,_v12,_iterator73,_step73,_T45,S,_iterator74,_step74,_v13,_T46,_iterator75,_step75,_f39,_iterator76,_step76,_step76$value,_v15,_step76$value$,_T48,_f40,d,u,g,M,C,A,L,O,w,b,_iterator77,_step77,_step77$value,_v14,_T47;return _regeneratorRuntime().wrap(function _callee82$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!he(this.cameraOpt,n))){_context86.next=42;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);l=!!this.serviceDrawLayer.children.length;if(!i){_context86.next=30;break;}v=!1;_iterator70=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context86.prev=7;_iterator70.s();case 9:if((_step70=_iterator70.n()).done){_context86.next=19;break;}_step70$value=_slicedToArray(_step70.value,2),_T44=_step70$value[0],_f38=_step70$value[1];_context86.t0=_f38.toolsType;_context86.next=_context86.t0===dt.Text?14:_context86.t0===dt.PencilEraser?14:_context86.t0===dt.Eraser?14:_context86.t0===dt.Selector?14:_context86.t0===dt.LaserPen?14:15;break;case 14:return _context86.abrupt("break",17);case 15:_T44!==Ne&&_T44!==Wt&&(v=!0);return _context86.abrupt("break",17);case 17:_context86.next=9;break;case 19:_context86.next=24;break;case 21:_context86.prev=21;_context86.t1=_context86["catch"](7);_iterator70.e(_context86.t1);case 24:_context86.prev=24;_iterator70.f();return _context86.finish(24);case 27:if(!v){_context86.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this111.taskUpdateCameraId=void 0,_this111.updateCamera(t);},In);return _context86.abrupt("return");case 30:p=/* @__PURE__ */new Map();_iterator71=_createForOfIteratorHelper(this.vNodes.getNodesByType(dt.Text).entries());try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){_step71$value=_slicedToArray(_step71.value,2),_v16=_step71$value[0],_T49=_step71$value[1];_f41=_T49.rect;p.set(_v16,{rect:Vt(_f41),scale:(a=this.cameraOpt)==null?void 0:a.scale});}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}_iterator72=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){_step72$value=_slicedToArray(_step72.value,2),_v17=_step72$value[0],_T50=_step72$value[1];_f42=_T50.rect;p.set(_v17,{rect:Vt(_f42),scale:(o=this.cameraOpt)==null?void 0:o.scale});}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}y=new Set(p.keys());P=!1;if(this.localWork.hasSelector()){_v12=(s=this.localWork.getSelector())==null?void 0:s.selectIds;if(_v12){P=!0;_iterator73=_createForOfIteratorHelper(_v12);try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){_T45=_step73.value;y.add(_T45);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}}}S=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator74=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){_v13=_step74.value;_T46=_v13.selectIds;if(_T46){S=!0;_iterator75=_createForOfIteratorHelper(_T46);try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){_f39=_step75.value;y.add(_f39);}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}}}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(y),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator76=_createForOfIteratorHelper(p.entries());try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){_step76$value=_slicedToArray(_step76.value,2),_v15=_step76$value[0],_step76$value$=_step76$value[1],_T48=_step76$value$.rect,_f40=_step76$value$.scale;d=this.vNodes.get(_v15);if(d){u=_T48,g=d.rect,M=this.getSceneRect(),C=Ke(u,M),A=Ke(g,M),L=d.toolsType,O=d.opt;w=!1;(C!==A||u.w!==g.w||u.h!==g.h||A===qt.intersect)&&(w=!0),L===dt.Text&&O.workState===Ot.Done&&w&&this.debounceUpdateCache.add(_v15);b=!1;_f40&&(c=this.cameraOpt)!=null&&c.scale&&_f40>this.cameraOpt.scale?A!==qt.outside&&C!==qt.inside&&(b=!0):_f40&&(m=this.cameraOpt)!=null&&m.scale&&_f40===this.cameraOpt.scale&&(u.x!==g.x||u.y!==g.y)&&(A===qt.inside&&C!==qt.inside||A===qt.intersect&&C===qt.intersect)&&(b=!0),O.eraserlines&&O.eraserlines.length&&b&&!this.debounceUpdateCache.has(_v15)&&this.debounceUpdateCache.add(_v15);}}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}if(P&&this.localWork.reRenderSelector(),S){_iterator77=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){_step77$value=_slicedToArray(_step77.value,2),_v14=_step77$value[0],_T47=_step77$value[1];this.serviceWork.runSelectWork({workId:_v14,selectIds:_T47.selectIds,msgType:ot.Select,dataType:Tt.Service,viewId:this.viewId});}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}}this.debounceUpdateCameraId=setTimeout(function(){var T;_this111.debounceUpdateCameraId=void 0;var v=[];var _iterator78=_createForOfIteratorHelper(_this111.debounceUpdateCache.values()),_step78;try{var _loop8=function _loop8(){var f=_step78.value;var d=_this111.vNodes.get(f);if(d){var u=d.toolsType,g=d.opt,M=d.rect,C=d.op,A=_this111.localWork.setFullWork({toolsType:u,opt:g,workId:f});if(A){var L=_this111.getSceneRect(),O=Ke(M,L);u===dt.Text?(T=_this111.fullLayer)!=null&&T.getElementsByName(f)[0]&&A instanceof Fe&&v.push(A.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:O!==qt.outside})):g.eraserlines&&g.eraserlines.length&&v.push(new Promise(function(w){var b=A.consumeService({op:C,isFullWork:!0,replaceId:f,workState:Ot.Done});_this111.localWork.clearWorkShapeNodeCache(f),w(b);}));}}_this111.debounceUpdateCache["delete"](f);};for(_iterator78.s();!(_step78=_iterator78.n()).done;){_loop8();}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}v.length?Promise.all(v).then(function(){var f=[];f.push({isClearAll:!0,clearCanvas:St.Bg,viewId:_this111.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:_this111.viewId}),f.length&&_this111.post({render:f}),_this111.vNodes.updateLowLevelNodesRect(),_this111.vNodes.clearHighLevelIds();}):(_this111.vNodes.updateLowLevelNodesRect(),_this111.vNodes.clearHighLevelIds());},In*10);}l&&e.push({isClearAll:!0,clearCanvas:St.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&e.push({isClearAll:!0,clearCanvas:St.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:this.viewId}),e.length&&this.post({render:e});case 42:case"end":return _context86.stop();}},_callee82,this,[[7,21,24,27]]);}));function updateCamera(_x95){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=t.rect,n=t.drawCanvas,i=Math.floor(e.x*this.dpr),a=Math.floor(e.y*this.dpr),o=Math.floor(e.w*this.dpr||1),s=Math.floor(e.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),i,a,o,s,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(t){return _regeneratorRuntime().wrap(function _callee83$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:_context87.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context87.stop();}},_callee83,this);}));function cursorHover(_x96){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(){return _regeneratorRuntime().wrap(function _callee84$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:_context88.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context88.stop();}},_callee84,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(Om,"destroy",this,3)([]);}}]);}(Li);var Fi=/*#__PURE__*/function(_Li2){function Fi(t,e,n){var _this112;_classCallCheck(this,Fi);_this112=_callSuper(this,Fi,[t,e,"sub"/* Sub */]);tt(_this112,"type","sub");tt(_this112,"_post");tt(_this112,"topLayer");tt(_this112,"snapshotFullLayer");tt(_this112,"serviceWork");tt(_this112,"localWork");tt(_this112,"topLayerWork");_this112._post=n;var i=_t.bufferSize.sub;_this112.topLayer=_this112.createLayer("topLayer",_this112.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i,contextType:"2d"}));var a={thread:_this112,viewId:_this112.viewId,vNodes:_this112.vNodes,fullLayer:_this112.fullLayer,topLayer:_this112.topLayer};_this112.localWork=new Tm(a),_this112.topLayerWork=new Mm(a),_this112.vNodes.init(_this112.fullLayer);return _this112;}_inherits(Fi,_Li2);return _createClass(Fi,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(){var _this113=this;var a,o,_this$combinePostData2,t,e,n,s,_iterator79,_step79,c,m,i;return _regeneratorRuntime().wrap(function _callee85$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,e=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context89.next=28;break;}s=[];_iterator79=_createForOfIteratorHelper(t);_context89.prev=4;_iterator79.s();case 6:if((_step79=_iterator79.n()).done){_context89.next=19;break;}c=_step79.value;if(!c.rect){_context89.next=17;break;}if(!(c.rect=this.safariFixRect(Vt(c.rect),this.dpr),!c.rect)){_context89.next=11;break;}return _context89.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context89.next=16;break;}_context89.next=14;return this.getRectImageBitmap(c);case 14:m=_context89.sent;c.imageBitmap=m,n||(n=[]),n.push(m);case 16:s.push(c);case 17:_context89.next=6;break;case 19:_context89.next=24;break;case 21:_context89.prev=21;_context89.t0=_context89["catch"](4);_iterator79.e(_context89.t0);case 24:_context89.prev=24;_iterator79.f();return _context89.finish(24);case 27:e.render=s;case 28:i=(a=e.sp)==null?void 0:a.filter(function(s){return s.type!==ot.None;});i!=null&&i.length?e.sp=i.map(function(s){return _objectSpread(_objectSpread({},s),{},{viewId:_this113.viewId});}):delete e.sp,e.consumeCount===void 0&&delete e.consumeCount,e.subWorkerDrawCount===void 0&&delete e.subWorkerDrawCount,(i!=null&&i.length||e.consumeCount||e.subWorkerDrawCount||(o=e==null?void 0:e.render)!=null&&o.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context89.stop();}},_callee85,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"getLayer",value:function getLayer(t,e){if(e&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case St.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t){var e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee86$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.dataType,o=t.workState;_context90.t0=e;_context90.next=_context90.t0===ot.UpdateTools?4:_context90.t0===ot.CreateWork?9:_context90.t0===ot.DrawWork?11:_context90.t0===ot.RemoveNode?18:_context90.t0===ot.FullWork?21:_context90.t0===ot.Snapshot?26:_context90.t0===ot.BoundingBox?33:40;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&i)){_context90.next=8;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context90.abrupt("return");case 8:return _context90.abrupt("break",40);case 9:this.createLocalWork(t);return _context90.abrupt("return");case 11:if(!(o===Ot.Done&&a===Tt.Local)){_context90.next=16;break;}_context90.next=14;return this.consumeDrawAll(a,t);case 14:_context90.next=17;break;case 16:this.consumeDraw(a,t);case 17:return _context90.abrupt("return");case 18:_context90.next=20;return this.removeNode(t);case 20:return _context90.abrupt("return");case 21:_context90.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context90.t1){_context90.next=25;break;}_context90.next=25;return this.consumeDrawAll(a,t);case 25:return _context90.abrupt("return");case 26:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===tr?6e3:3e3,contextType:"2d"}));_context90.t2=this.snapshotFullLayer;if(!_context90.t2){_context90.next=32;break;}_context90.next=31;return this.getSnapshot(t);case 31:this.snapshotFullLayer=void 0;case 32:return _context90.abrupt("return");case 33:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===tr?6e3:3e3,contextType:"2d"}));_context90.t3=this.snapshotFullLayer;if(!_context90.t3){_context90.next=39;break;}_context90.next=38;return this.getBoundingRect(t);case 38:this.snapshotFullLayer=void 0;case 39:return _context90.abrupt("return");case 40:_context90.next=42;return _superPropGet(Fi,"on",this,3)([t]);case 42:case"end":return _context90.stop();}},_callee86,this);}));function on(_x97){return _on3.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var e=t.workId,n=t.toolsType,i=t.opt;if(n&&this.topLayerWork.canUseTopLayer(n)&&e&&i){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(e.toString(),i);return;}n&&this.localWork.canUseSubWorker(n)&&_superPropGet(Fi,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t){var e;return _regeneratorRuntime().wrap(function _callee87$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:e=t.dataType;_context91.t0=e===Tt.Local;if(!_context91.t0){_context91.next=5;break;}_context91.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context91.stop();}},_callee87,this);}));function removeNode(_x98){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"getOffscreen",value:function getOffscreen(t,e){return this.getLayer(t,e).parent.canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee88$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:n=e.workId,i=e.toolsType;if(!n){_context92.next=11;break;}if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context92.next=5;break;}t===Tt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(e)),this.topLayerWork.consumeDraw(e);return _context92.abrupt("return");case 5:_context92.t0=i&&this.localWork.canUseSubWorker(i);if(!_context92.t0){_context92.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context92.next=10;return this.localWork.consumeDraw(e);case 10:return _context92.abrupt("return");case 11:case"end":return _context92.stop();}},_callee88,this);}));function consumeDraw(_x99,_x100){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(t,e){var n,i,a,o;return _regeneratorRuntime().wrap(function _callee89$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:n=e.workId,i=e.toolsType,a=e.dataType;if(!n){_context93.next=8;break;}o=n.toString();if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context93.next=6;break;}a===Tt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(e)),this.topLayerWork.consumeDrawAll(e);return _context93.abrupt("return");case 6:i&&this.localWork.canUseSubWorker(i)&&(this.localWork.getWorkShape(o)||_superPropGet(Fi,"createLocalWork",this,3)([e]),this.localWork.consumeDrawAll(e));return _context93.abrupt("return");case 8:case"end":return _context93.stop();}},_callee89,this);}));function consumeDrawAll(_x101,_x102){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(){return _regeneratorRuntime().wrap(function _callee90$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:this.vNodes.clear();_superPropGet(Fi,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),se(this.topLayer,this.topLayer.parent));_context94.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId}],sp:[{type:ot.Clear}]});case 5:case"end":return _context94.stop();}},_callee90,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=arguments.length>2?arguments[2]:undefined;var i=t.rect,a=t.drawCanvas,o=Math.floor(i.x*this.dpr),s=Math.floor(i.y*this.dpr),c=Math.floor(i.w*this.dpr||1),m=Math.floor(i.h*this.dpr||1);return createImageBitmap(this.getOffscreen(a,e),o,s,c,m,n);}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_superPropGet(Fi,"updateLayer",this,3)([t]),this.topLayer&&(this.topLayer.parent.setAttribute("width",e),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[e,n]),this.topLayer.setAttribute("pos",[e*0.5,n*0.5])),this.snapshotFullLayer&&(this.snapshotFullLayer.parent.setAttribute("width",e),this.snapshotFullLayer.parent.setAttribute("height",n),this.snapshotFullLayer.setAttribute("size",[e,n]),this.snapshotFullLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee91$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:_superPropGet(Fi,"updateDpr",this,3)([t]);e=!!this.topLayerWork.localWorkShapes.size,n=!!this.localWork.getWorkShapes().size,i=[];n&&i.push({isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId});e&&i.push({isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId});_context95.t0=i.length;if(!_context95.t0){_context95.next=8;break;}_context95.next=8;return this.post({render:i});case 8:case"end":return _context95.stop();}},_callee91,this);}));function updateDpr(_x103){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(t){var _this114=this;var e,n,i,a,_iterator80,_step80,_loop9;return _regeneratorRuntime().wrap(function _callee92$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!he(this.cameraOpt,n))){_context97.next=25;break;}i=!!this.topLayerWork.localWorkShapes.size,a=!!this.localWork.getWorkShapes().size;if(!(a&&this.localWork.workShapesDone(),this.setCameraOpt(n),a&&e.push({isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId}),i)){_context97.next=21;break;}e.push({isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId});_iterator80=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context97.prev=6;_loop9=/*#__PURE__*/_regeneratorRuntime().mark(function _loop9(){var _step80$value,o,s,c;return _regeneratorRuntime().wrap(function _loop9$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:_step80$value=_slicedToArray(_step80.value,2),o=_step80$value[0],s=_step80$value[1];if(s.totalRect){_this114.topLayer.getElementsByName(o.toString()).forEach(function(m){var l=m.getBoundingClientRect(),p=Nt({x:l.x,y:l.y,w:l.width,h:l.height});c=Pt(c,p);}),s.totalRect=c,_this114.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context96.stop();}},_loop9);});_iterator80.s();case 9:if((_step80=_iterator80.n()).done){_context97.next=13;break;}return _context97.delegateYield(_loop9(),"t0",11);case 11:_context97.next=9;break;case 13:_context97.next=18;break;case 15:_context97.prev=15;_context97.t1=_context97["catch"](6);_iterator80.e(_context97.t1);case 18:_context97.prev=18;_iterator80.f();return _context97.finish(18);case 21:_context97.t2=e.length;if(!_context97.t2){_context97.next=25;break;}_context97.next=25;return this.post({render:e});case 25:case"end":return _context97.stop();}},_callee92,this,[[6,15,18,21]]);}));function updateCamera(_x104){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,e){this.cameraOpt=t;var n=t.scale,i=t.centerX,a=t.centerY,o=t.width,s=t.height;(o!==this.scene.width||s!==this.scene.height)&&this.updateScene({width:o,height:s}),e?(e.setAttribute("scale",[n,n]),e.setAttribute("translate",[-i,-a])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-a]),this.topLayer.setAttribute("scale",[n,n]),this.topLayer.setAttribute("translate",[-i,-a]));}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93(t){var e,n,i,a,o,s,c,_i13,_Object$entries,_Object$entries$_i,l,p,y,P,S,m;return _regeneratorRuntime().wrap(function _callee93$(_context98){while(1)switch(_context98.prev=_context98.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context98.next=26;break;}s=Vt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i13=0,_Object$entries=Object.entries(n);case 5:if(!(_i13<_Object$entries.length)){_context98.next=21;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i13],2),l=_Object$entries$_i[0],p=_Object$entries$_i[1];if(!(p!=null&&p.type)){_context98.next=18;break;}_context98.t0=p==null?void 0:p.type;_context98.next=_context98.t0===ot.UpdateNode?11:_context98.t0===ot.FullWork?11:18;break;case 11:y=p.opt;P=_objectSpread(_objectSpread({},p),{},{opt:y,workId:l,msgType:ot.FullWork,dataType:Tt.Service,viewId:this.viewId});_context98.next=15;return this.localWork.runFullWork(P);case 15:S=_context98.sent;c=Pt(c,S);return _context98.abrupt("break",18);case 18:_i13++;_context98.next=5;break;case 21:a&&o&&(m={resizeWidth:a,resizeHeight:o});_context98.next=24;return this.getSnapshotRender({scenePath:e,curCameraOpt:s,options:m});case 24:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 26:case"end":return _context98.stop();}},_callee93,this);}));function getSnapshot(_x105){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(t){var o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee94$(_context99){while(1)switch(_context99.prev=_context99.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context99.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:St.None},!0,i);case 4:a=_context99.sent;a&&(this._post({sp:[{type:ot.Snapshot,scenePath:e,imageBitmap:a,viewId:this.viewId}]},[a]),a.close(),this.snapshotFullLayer&&se(this.snapshotFullLayer,this.snapshotFullLayer.parent),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context99.stop();}},_callee94,this);}));function getSnapshotRender(_x106){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee95(t){var e,n,i,a,o,_i14,_Object$entries2,_Object$entries2$_i,s,c,m;return _regeneratorRuntime().wrap(function _callee95$(_context100){while(1)switch(_context100.prev=_context100.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context100.next=27;break;}a=Vt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i14=0,_Object$entries2=Object.entries(n);case 5:if(!(_i14<_Object$entries2.length)){_context100.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i14],2),s=_Object$entries2$_i[0],c=_Object$entries2$_i[1];if(!(c!=null&&c.type)){_context100.next=16;break;}_context100.t0=c==null?void 0:c.type;_context100.next=_context100.t0===ot.UpdateNode?11:_context100.t0===ot.FullWork?11:16;break;case 11:_context100.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},c),{},{workId:s,msgType:ot.FullWork,dataType:Tt.Service,viewId:this.viewId}));case 13:m=_context100.sent;o=Pt(o,m);return _context100.abrupt("break",16);case 16:_i14++;_context100.next=5;break;case 19:_context100.t1=o;if(!_context100.t1){_context100.next=23;break;}_context100.next=23;return this.post({sp:[{type:ot.BoundingBox,scenePath:e,rect:o}]});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;se(this.snapshotFullLayer,this.snapshotFullLayer.parent);this.setCameraOpt(a,this.fullLayer);case 27:case"end":return _context100.stop();}},_callee95,this);}));function getBoundingRect(_x107){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Li);var Un=self;Un.sub=new Pm(Un,er.Sub);
|