2020-06-22 09:21:33 -04:00
|
|
|
var paper=function(u,q){var O=(u=u||require("./node/self.js")).window,k=u.document,H=new function(){function n(t,e,n){var i;return t&&((i=d(t,"length"))&&"number"==typeof i.value?r:function(t,e){for(var n in this)this.hasOwnProperty(n)&&t.call(e,this[n],n,this)}).call(t,e,n=n||t),n}var s=/^(statics|enumerable|beans|preserve)$/,t=[],i=t.slice,a=Object.create,d=Object.getOwnPropertyDescriptor,_=Object.defineProperty,r=t.forEach||function(t,e){for(var n=0,i=this.length;n<i;n++)t.call(e,this[n],n,this)},o=Object.assign||function(t){for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e];for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t};function h(a,o,h,u,l){var c={};function t(t,e){"string"==typeof(e=e||(e=d(o,t))&&(e.get?e:e.value))&&"#"===e[0]&&(e=a[e.substring(1)]||e);var n,i="function"==typeof e,r=e,s=l||i&&!e.base?e&&e.get?t in a:a[t]:null;l&&s||(i&&s&&(e.base=s),i&&!1!==u&&(n=t.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(c[n[3].toLowerCase()+n[4]]=n[2]),r&&!i&&r.get&&"function"==typeof r.get&&f.isPlainObject(r)||(r={value:r,writable:!0}),(d(a,t)||{configurable:!0}).configurable&&(r.configurable=!0,r.enumerable=null!=h?h:!n),_(a,t,r))}if(o){for(var e in o)o.hasOwnProperty(e)&&!s.test(e)&&t(e);for(var e in c){var n=c[e],i=a["set"+n],r=a["get"+n]||i&&a["is"+n];!r||!0!==u&&0!==r.length||t(e,{get:r,set:i})}}return a}function f(){for(var t=0,e=arguments.length;t<e;t++){var n=arguments[t];n&&o(this,n)}return this}return h(f,{inject:function(t){var e,n,i;t&&(e=!0===t.statics?t:t.statics,n=t.beans,i=t.preserve,e!==t&&h(this.prototype,t,t.enumerable,n,i),h(this,e,null,n,i));for(var r=1,s=arguments.length;r<s;r++)this.inject(arguments[r]);return this},extend:function(){for(var t,e,n,i=this,r=0,s=arguments.length;r<s&&(!t||!e);r++)n=arguments[r],t=t||n.initialize,e=e||n.prototype;return e=(t=t||function(){i.apply(this,arguments)}).prototype=e||a(this.prototype),_(e,"constructor",{value:t,writable:!0,configurable:!0}),h(t,this),arguments.length&&this.inject.apply(t,arguments),t.base=i,t}}).inject({enumerable:!1,initialize:f,set:f,inject:function(){for(var t=0,e=arguments.length;t<e;t++){var n=arguments[t];n&&h(this,n,n.enumerable,n.beans,n.preserve)}return this},extend:function(){var t=a(this);return t.inject.apply(t,arguments)},each:function(t,e){return n(this,t,e)},clone:function(){return new this.constructor(this)},statics:{set:o,each:n,create:a,define:_,describe:d,clone:function(t){return o(new t.constructor,t)},isPlainObject:function(t){var e=null!=t&&t.constructor;return e&&(e===Object||e===f||"Object"===e.name)},pick:function(t,e){return t!==q?t:e},slice:function(t,e,n){return i.call(t,e,n)}}})};"undefined"!=typeof module&&(module.exports=H),H.inject({enumerable:!1,toString:function(){return null!=this._id?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+H.each(this,function(t,e){var n;/^_/.test(e)||(n=typeof t,this.push(e+": "+("number"==n?b.instance.number(t):"string"==n?"'"+t+"'":t)))},[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(t){return H.importJSON(t,this)},exportJSON:function(t){return H.exportJSON(this,t)},toJSON:function(){return H.serialize(this)},set:function(t,e){return t&&H.filter(this,t,e,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function t(){var e=t.base.apply(this,arguments),n=e.prototype._class;return n&&!H.exports[n]&&(H.exports[n]=e),e},equals:function(t,e){if(t===e)return!0;if(t&&t.equals)return t.equals(e);if(e&&e.equals)return e.equals(t);if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)&&Array.isArray(e)){if((n=t.length)!==e.length)return!1;for(;n--;)if(!H.equals(t[n],e[n]))return!1}else{var n,i=Object.keys(t);if((n=i.length)!==Object.keys(e).length)return!1;for(;n--;){var r=i[n];if(!e.hasOwnProperty(r)||!H.equals(t[r],e[r]))return!1}}return!0}return!1},read:function(t,e,n,i){if(this===H){var r=this.peek(t,e);return t.__index++,r}var s,a=this.prototype,o=a._readIndex,h=e||o&&t.__index||0,u=t.length,l=t[h];return i=i||u-h,l instanceof this||n&&n.readNull&&null==l&&i<=1?(o&&(t.__index=h+1
|