@mlightcad/common 1.2.4 → 1.2.6
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/dist/common.js +678 -382
- package/dist/common.umd.cjs +1 -1
- package/lib/AcCmColor.d.ts +106 -132
- package/lib/AcCmColor.d.ts.map +1 -1
- package/lib/AcCmColor.js +356 -493
- package/lib/AcCmColor.js.map +1 -1
- package/lib/AcCmColorMethod.d.ts +17 -0
- package/lib/AcCmColorMethod.d.ts.map +1 -0
- package/lib/AcCmColorMethod.js +18 -0
- package/lib/AcCmColorMethod.js.map +1 -0
- package/lib/AcCmColorUtil.d.ts +45 -12
- package/lib/AcCmColorUtil.d.ts.map +1 -1
- package/lib/AcCmColorUtil.js +254 -15
- package/lib/AcCmColorUtil.js.map +1 -1
- package/lib/AcCmEntityColor.d.ts +119 -0
- package/lib/AcCmEntityColor.d.ts.map +1 -0
- package/lib/AcCmEntityColor.js +198 -0
- package/lib/AcCmEntityColor.js.map +1 -0
- package/lib/AcCmLodashUtils.d.ts +6 -0
- package/lib/AcCmLodashUtils.d.ts.map +1 -1
- package/lib/AcCmLodashUtils.js +31 -0
- package/lib/AcCmLodashUtils.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/dist/common.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(a=typeof globalThis<"u"?globalThis:a||self,_(a.common={}))})(this,function(a){"use strict";function _(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in n)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const C={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},M=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];function L(n,e,t){return Math.max(e,Math.min(t,n))}const I=class I{constructor(){this._colorIndex=256,this._color=null,this._colorName=null}get color(){return this._color}set color(e){e==null?this._color=null:(this._color=Math.round(L(e,0,256*256*256-1)),this._colorIndex=this.getColorIndexByValue(this._color),this._colorName=this.getColorNameByValue(this._color))}get hexColor(){if(this._color&&this._color>0&&this._color<=16777215){let e=this._color.toString(16).toUpperCase();for(;e.length<6;)e="0"+e;return`0x${e}`}return""}get cssColor(){return`rgb(${this.red},${this.green},${this.blue})`}get red(){return this.color?this.color>>16&255:null}get green(){return this.color?this.color>>8&255:null}get blue(){return this.color?this.color&255:null}get colorIndex(){return this._colorIndex}set colorIndex(e){e==null?this._colorIndex=null:(this._colorIndex=L(e,0,256),this._colorIndex>0&&this._colorIndex<256?(this._color=M[e],this._colorName=this.getColorNameByValue(this._color)):(this._color=null,this._colorName=null))}get colorName(){return this._colorName}set colorName(e){if(e){const t=C[e.toLowerCase()];t!==void 0?(this._colorName=e,this._color=t,this._colorIndex=this.getColorIndexByValue(this._color)):console.warn("Unknown color: "+e)}else this._colorName=null}get hasColorName(){return this._colorName==null}get hasColorIndex(){return this._colorIndex==null}get isByLayer(){return this.colorIndex==256}setByLayer(){return this.colorIndex=256,this}get isByBlock(){return this.colorIndex==0}setByBlock(){return this.colorIndex=0,this}setScalar(e){return this.setRGB(e,e,e),this}setRGB(e,t,r){const o=Math.round(L(e,0,255)),s=Math.round(L(t,0,255)),l=Math.round(L(r,0,255));return this.color=(o<<16)+(s<<8)+l,this}setColorName(e){const t=C[e.toLowerCase()];return t!==void 0?this.color=t:console.warn("Unknown color "+e),this}clone(){const e=new I;return e.colorIndex=this.colorIndex,e.color=this.color,e._colorName=this._colorName,this}copy(e){return this.colorIndex=e.colorIndex,this.color=e.color,this._colorName=e._colorName,this}equals(e){return e.color==this.color&&e.colorIndex==this.colorIndex&&e._colorName==this._colorName}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this.colorName?this.colorName:this.hexColor}getColorNameByValue(e){for(const[t,r]of Object.entries(C))if(r===e)return t;return null}getColorIndexByValue(e){const t=M.length-1;for(let r=1;r<t;++r)if(M[r]===e)return r;return null}};I.NAMES=C;let B=I;const W={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class Y{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const o=this._listeners[e];if(o!==void 0){const s=o.indexOf(t);s!==-1&&o.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const o=r.slice(0);for(let s=0,l=o.length;s<l;s++)o[s].call(this,e)}}}class x{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const r of this.listeners)r.call(null,e,...t)}}var Z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function J(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var U={exports:{}};(function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(Z,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],s={},l=null;function f(c,h){var i=c[h];if(typeof i.bind=="function")return i.bind(c);try{return Function.prototype.bind.call(i,c)}catch{return function(){return Function.prototype.apply.apply(i,[c,arguments])}}}function O(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function w(c){return c==="debug"&&(c="log"),typeof console===t?!1:c==="trace"&&r?O:console[c]!==void 0?f(console,c):console.log!==void 0?f(console,"log"):e}function y(){for(var c=this.getLevel(),h=0;h<o.length;h++){var i=o[h];this[i]=h<c?e:this.methodFactory(i,c,this.name)}if(this.log=this.debug,typeof console===t&&c<this.levels.SILENT)return"No console available for logging"}function P(c){return function(){typeof console!==t&&(y.call(this),this[c].apply(this,arguments))}}function g(c,h,i){return w(c)||P.apply(this,arguments)}function G(c,h){var i=this,T,R,b,p="loglevel";typeof c=="string"?p+=":"+c:typeof c=="symbol"&&(p=void 0);function se(u){var d=(o[u]||"silent").toUpperCase();if(!(typeof window===t||!p)){try{window.localStorage[p]=d;return}catch{}try{window.document.cookie=encodeURIComponent(p)+"="+d+";"}catch{}}}function H(){var u;if(!(typeof window===t||!p)){try{u=window.localStorage[p]}catch{}if(typeof u===t)try{var d=window.document.cookie,N=encodeURIComponent(p),z=d.indexOf(N+"=");z!==-1&&(u=/^([^;]+)/.exec(d.slice(z+N.length+1))[1])}catch{}return i.levels[u]===void 0&&(u=void 0),u}}function le(){if(!(typeof window===t||!p)){try{window.localStorage.removeItem(p)}catch{}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function k(u){var d=u;if(typeof d=="string"&&i.levels[d.toUpperCase()]!==void 0&&(d=i.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=i.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+u)}i.name=c,i.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},i.methodFactory=h||g,i.getLevel=function(){return b??R??T},i.setLevel=function(u,d){return b=k(u),d!==!1&&se(b),y.call(i)},i.setDefaultLevel=function(u){R=k(u),H()||i.setLevel(u,!1)},i.resetLevel=function(){b=null,le(),y.call(i)},i.enableAll=function(u){i.setLevel(i.levels.TRACE,u)},i.disableAll=function(u){i.setLevel(i.levels.SILENT,u)},i.rebuild=function(){if(l!==i&&(T=k(l.getLevel())),y.call(i),l===i)for(var u in s)s[u].rebuild()},T=k(l?l.getLevel():"WARN");var K=H();K!=null&&(b=k(K)),y.call(i)}l=new G,l.getLogger=function(h){if(typeof h!="symbol"&&typeof h!="string"||h==="")throw new TypeError("You must supply a name when creating a logger.");var i=s[h];return i||(i=s[h]=new G(h,l.methodFactory)),i};var ie=typeof window!==t?window.log:void 0;return l.noConflict=function(){return typeof window!==t&&window.log===l&&(window.log=ie),l},l.getLoggers=function(){return s},l.default=l,l})})(U);var D=U.exports;const X=_({__proto__:null,default:J(D)},[D]),Q=!0,E=X;E.setLevel("debug");const ee=n=>{try{E.setLevel(n)}catch(e){E.setLevel("error"),E.error(e)}};function A(n){return n===null||typeof n!="object"?n:Array.isArray(n)?[...n]:{...n}}function q(n,...e){for(const t of e)if(t)for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&n[r]===void 0&&(n[r]=t[r]);return n}function F(n,e){return n!=null&&Object.prototype.hasOwnProperty.call(n,e)}function j(n){return n==null?!0:Array.isArray(n)||typeof n=="string"?n.length===0:n instanceof Map||n instanceof Set?n.size===0:typeof n=="object"?Object.keys(n).length===0:!1}function m(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(typeof n!="object")return n===e;if(Array.isArray(n)!==Array.isArray(e))return!1;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(let o=0;o<n.length;o++)if(!m(n[o],e[o]))return!1;return!0}const t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(const o of t)if(!Object.prototype.hasOwnProperty.call(e,o)||!m(n[o],e[o]))return!1;return!0}class S{constructor(e,t){this.events={attrChanged:new x,modelChanged:new x},this._changing=!1,this._previousAttributes={},this._pending=!1;const r=e||{};t&&q(r,t),this.attributes=r,this.changed={}}get(e){return this.attributes[e]}set(e,t,r){if(e==null)return this;let o;typeof e=="object"?(o=e,r=t):(o={},o[e]=t),r||(r={});const s=r.unset,l=r.silent,f=[],O=this._changing;this._changing=!0,O||(this._previousAttributes=A(this.attributes),this.changed={});const w=this.attributes,y=this.changed,P=this._previousAttributes;for(const g in o)t=o[g],m(w[g],t)||f.push(g),m(P[g],t)?delete y[g]:y[g]=t,s?delete w[g]:w[g]=t;if(!l){f.length&&(this._pending=r);for(let g=0;g<f.length;g++)this.events.attrChanged.dispatch({object:this,attrName:f[g],attrValue:w[f[g]],options:r})}if(O)return this;if(!l)for(;this._pending;)r=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:r});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!j(this.changed):F(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?A(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,r={};for(const o in e){const s=e[o];m(t[o],s)||(r[o]=s)}return r}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return A(this._previousAttributes)}clone(){const e=A(this.attributes);return new S(e)}}class v{constructor(){this.entries=new Map}static getInstance(){return v.instance||(v.instance=new v),v.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries)console.log(`${e}:`),console.log(t.format())}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class te{static formatBytes(e,t=2){if(e===0)return"0 B";const r=1024,o=Math.max(0,t),s=["B","KB","MB","GB","TB"],l=Math.floor(Math.log(e)/Math.log(r)),f=e/Math.pow(r,l);return`${parseFloat(f.toFixed(o))} ${s[l]}`}}class re{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class ne{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}scheduleTask(e){return new Promise((t,r)=>{const o=()=>{Promise.resolve(e()).then(t).catch(r)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(o):setTimeout(o,0)})}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let r=e;for(let o=0;o<t;o++){const s=this.tasks[o];try{r=await this.scheduleTask(async()=>{const l=await s.run(r);return this.onProgress((o+1)/t,s),l})}catch(l){if(this.onError({error:l,taskIndex:o,task:s}))break}}this.onComplete(r)}}class V{constructor(e,t,r){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,r=this.handlers.length;t<r;t+=2){const o=this.handlers[t],s=this.handlers[t+1];if(o.global&&(o.lastIndex=0),o.test(e))return s}return null}}const $=new V;class oe{constructor(e){this.manager=e!==void 0?e:$,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((r,o)=>{this.load(e,r,t,o)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}a.AcCmColor=B,a.AcCmErrors=W,a.AcCmEventDispatcher=Y,a.AcCmEventManager=x,a.AcCmLoader=oe,a.AcCmLoadingManager=V,a.AcCmObject=S,a.AcCmPerformanceCollector=v,a.AcCmTask=re,a.AcCmTaskScheduler=ne,a.AcTrStringUtil=te,a.DEBUG_MODE=Q,a.DefaultLoadingManager=$,a.clone=A,a.defaults=q,a.has=F,a.isEmpty=j,a.isEqual=m,a.log=E,a.setLogLevel=ee,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(u,M){typeof exports=="object"&&typeof module<"u"?M(exports):typeof define=="function"&&define.amd?define(["exports"],M):(u=typeof globalThis<"u"?globalThis:u||self,M(u.common={}))})(this,function(u){"use strict";function M(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in r)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var o=(r=>(r[r.ByColor=1]="ByColor",r[r.ByACI=2]="ByACI",r[r.ByLayer=3]="ByLayer",r[r.ByBlock=4]="ByBlock",r[r.None=0]="None",r))(o||{});const x={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},T=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];class _{static getColorByIndex(e){return T[e]}static getIndexByColor(e){const t=T.length-1;for(let n=1;n<t;++n)if(T[n]===e)return n}static getColorByName(e){return x[e.toLowerCase()]}static getNameByColor(e){for(const[t,n]of Object.entries(x))if(n===e)return t}static getNameByIndex(e){const t=this.getColorByIndex(e);return this.getNameByColor(t)}}class v{constructor(e=o.ByLayer,t){this._colorMethod=e,this._colorMethod==o.ByColor&&t==null?this._value=16777215:this._colorMethod==o.ByACI?t==null?this._value=8:t===0?this._colorMethod=o.ByBlock:t===256?this._colorMethod=o.ByLayer:this._value=Math.max(0,Math.min(t,256)):this._value=t}get colorMethod(){return this._colorMethod}set colorMethod(e){this._colorMethod=e}get red(){const e=this.RGB;return e!=null?e>>16&255:void 0}get green(){const e=this.RGB;return e!=null?e>>8&255:void 0}get blue(){const e=this.RGB;return e!=null?e&255:void 0}get RGB(){switch(this._colorMethod){case o.ByColor:case o.ByBlock:case o.ByLayer:return this._value;case o.ByACI:return this._value?_.getColorByIndex(this._value):this._value;default:return}}setRGB(e,t,n){const s=Math.max(0,Math.min(255,Math.round(e))),i=Math.max(0,Math.min(255,Math.round(t))),a=Math.max(0,Math.min(255,Math.round(n)));return this._value=s<<16|i<<8|a,this._colorMethod=o.ByColor,this}setRGBValue(e){return e==null||!Number.isFinite(e)?(console.warn("Invalid RGB value:",e),this):(this._value=e&16777215,this._colorMethod=o.ByColor,this)}setRGBFromCss(e){if(!e)return this;const t=e.trim().toLowerCase();if(t.startsWith("#")){let i=0,a=0,d=0;if(t.length===7)i=parseInt(t.substr(1,2),16),a=parseInt(t.substr(3,2),16),d=parseInt(t.substr(5,2),16);else if(t.length===4)i=parseInt(t[1]+t[1],16),a=parseInt(t[2]+t[2],16),d=parseInt(t[3]+t[3],16);else return console.warn("Invalid hex color:",e),this;return this.setRGB(i,a,d)}const n=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(n){const i=parseInt(n[1],10),a=parseInt(n[2],10),d=parseInt(n[3],10);return this.setRGB(i,a,d)}const s=_.getColorByName(e);return s!==void 0?this.setRGBValue(s):(console.warn("Unknown CSS color string:",e),this)}setScalar(e){return this.setRGB(e,e,e)}get hexColor(){const e=this.RGB;return e==null?void 0:"0x"+e.toString(16).padStart(6,"0").toUpperCase()}get cssColor(){const e=this.RGB;if(e!=null)return`rgb(${e>>16&255},${e>>8&255},${e&255})`}get colorIndex(){return this._colorMethod===o.ByACI?this._value:this._colorMethod===o.ByLayer?256:this._colorMethod===o.ByBlock?0:void 0}set colorIndex(e){if(e==null)return;const t=Math.max(0,Math.min(256,Math.round(e)));t===0?(this._colorMethod=o.ByBlock,this._value=void 0):t===256?(this._colorMethod=o.ByLayer,this._value=void 0):(this._colorMethod=o.ByACI,this._value=t)}get isByColor(){return this._colorMethod===o.ByColor}get isByACI(){return this._colorMethod===o.ByACI}get isByLayer(){return this._colorMethod===o.ByLayer}setByLayer(e){return this._colorMethod=o.ByLayer,e==null?this._value=256:this._value=e,this}get isByBlock(){return this._colorMethod===o.ByBlock}setByBlock(e){return this._colorMethod=o.ByBlock,e==null?this._value=0:this._value=e,this}get colorName(){switch(this._colorMethod){case o.ByLayer:return"ByLayer";case o.ByBlock:return"ByBlock";case o.ByColor:return this._value?_.getNameByColor(this._value):"";case o.ByACI:return this._value?_.getNameByIndex(this._value):"";default:return}}set colorName(e){if(!e)return;const t=_.getColorByName(e);t!==void 0?(this._value=t,this._colorMethod=o.ByColor):console.warn("Unknown color name:",e)}clone(){const e=new v;return e._colorMethod=this._colorMethod,e._value=this._value,e}copy(e){return this._colorMethod=e._colorMethod,this._value=e._value,this}equals(e){return this._colorMethod===e._colorMethod&&this._value===e._value}toString(){switch(this._colorMethod){case o.ByLayer:return"ByLayer";case o.ByBlock:return"ByBlock";case o.ByACI:return this._value!==void 0?String(this._value):"";case o.ByColor:return this._value?`${this.red},${this.green},${this.blue}`:"";default:return""}}static fromString(e){if(!e)return;const t=e.trim();if(/^bylayer$/i.test(t))return new v(o.ByLayer);if(/^byblock$/i.test(t))return new v(o.ByBlock);if(/^\d{1,3},\d{1,3},\d{1,3}$/i.test(t)){const[s,i,a]=t.split(",").map(Number),d=new v(o.ByColor);return d.setRGB(s,i,a),d}if(/^\d+$/.test(t)){const s=parseInt(t,10);return new v(o.ByACI,s)}const n=_.getColorByName(t);if(n!=null)return new v(o.ByColor,n);console.warn("Unknown color name:",e)}}class Y{constructor(e=o.ByColor,t=0){this._colorMethod=e,this._value=t}get colorMethd(){return this._colorMethod}get red(){return this._value>>16&255}set red(e){this._colorMethod=o.ByColor,this._value=this._value&65535|(e&255)<<16}get green(){return this._value>>8&255}set green(e){this._colorMethod=o.ByColor,this._value=this._value&16711935|(e&255)<<8}get blue(){return this._value&255}set blue(e){this._colorMethod=o.ByColor,this._value=this._value&16776960|e&255}setRGB(e,t,n){this._colorMethod=o.ByColor,this._value=(e&255)<<16|(t&255)<<8|n&255}get colorIndex(){return this._value}set colorIndex(e){this._colorMethod=o.ByACI,this._value=e}get layerIndex(){return this._value}set layerIndex(e){this._colorMethod=o.ByLayer,this._value=e}isByColor(){return this._colorMethod===o.ByColor}isByLayer(){return this._colorMethod===o.ByLayer}isByBlock(){return this._colorMethod===o.ByBlock}isByACI(){return this._colorMethod===o.ByACI}isNone(){return this._colorMethod===o.None}get rawValue(){return this._value}set rawValue(e){this._value=e}}const Z={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class J{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let i=0,a=s.length;i<a;i++)s[i].call(this,e)}}}class R{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const n of this.listeners)n.call(null,e,...t)}}var X=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Q(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var D={exports:{}};(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(X,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},a=null;function d(h,f){var l=h[f];if(typeof l.bind=="function")return l.bind(h);try{return Function.prototype.bind.call(l,h)}catch{return function(){return Function.prototype.apply.apply(l,[h,arguments])}}}function A(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function b(h){return h==="debug"&&(h="log"),typeof console===t?!1:h==="trace"&&n?A:console[h]!==void 0?d(console,h):console.log!==void 0?d(console,"log"):e}function m(){for(var h=this.getLevel(),f=0;f<s.length;f++){var l=s[f];this[l]=f<h?e:this.methodFactory(l,h,this.name)}if(this.log=this.debug,typeof console===t&&h<this.levels.SILENT)return"No console available for logging"}function P(h){return function(){typeof console!==t&&(m.call(this),this[h].apply(this,arguments))}}function y(h,f,l){return b(h)||P.apply(this,arguments)}function H(h,f){var l=this,I,U,L,p="loglevel";typeof h=="string"?p+=":"+h:typeof h=="symbol"&&(p=void 0);function ae(c){var g=(s[c]||"silent").toUpperCase();if(!(typeof window===t||!p)){try{window.localStorage[p]=g;return}catch{}try{window.document.cookie=encodeURIComponent(p)+"="+g+";"}catch{}}}function z(){var c;if(!(typeof window===t||!p)){try{c=window.localStorage[p]}catch{}if(typeof c===t)try{var g=window.document.cookie,O=encodeURIComponent(p),W=g.indexOf(O+"=");W!==-1&&(c=/^([^;]+)/.exec(g.slice(W+O.length+1))[1])}catch{}return l.levels[c]===void 0&&(c=void 0),c}}function ue(){if(!(typeof window===t||!p)){try{window.localStorage.removeItem(p)}catch{}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function E(c){var g=c;if(typeof g=="string"&&l.levels[g.toUpperCase()]!==void 0&&(g=l.levels[g.toUpperCase()]),typeof g=="number"&&g>=0&&g<=l.levels.SILENT)return g;throw new TypeError("log.setLevel() called with invalid level: "+c)}l.name=h,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=f||y,l.getLevel=function(){return L??U??I},l.setLevel=function(c,g){return L=E(c),g!==!1&&ae(L),m.call(l)},l.setDefaultLevel=function(c){U=E(c),z()||l.setLevel(c,!1)},l.resetLevel=function(){L=null,ue(),m.call(l)},l.enableAll=function(c){l.setLevel(l.levels.TRACE,c)},l.disableAll=function(c){l.setLevel(l.levels.SILENT,c)},l.rebuild=function(){if(a!==l&&(I=E(a.getLevel())),m.call(l),a===l)for(var c in i)i[c].rebuild()},I=E(a?a.getLevel():"WARN");var K=z();K!=null&&(L=E(K)),m.call(l)}a=new H,a.getLogger=function(f){if(typeof f!="symbol"&&typeof f!="string"||f==="")throw new TypeError("You must supply a name when creating a logger.");var l=i[f];return l||(l=i[f]=new H(f,a.methodFactory)),l};var le=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=le),a},a.getLoggers=function(){return i},a.default=a,a})})(D);var G=D.exports;const ee=M({__proto__:null,default:Q(G)},[G]),te=!0,C=ee;C.setLevel("debug");const re=r=>{try{C.setLevel(r)}catch(e){C.setLevel("error"),C.error(e)}};function k(r){return r===null||typeof r!="object"?r:Array.isArray(r)?[...r]:{...r}}function N(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map(N);const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=N(r[t]));return e}function F(r,...e){for(const t of e)if(t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&r[n]===void 0&&(r[n]=t[n]);return r}function q(r,e){return r!=null&&Object.prototype.hasOwnProperty.call(r,e)}function j(r){return r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:r instanceof Map||r instanceof Set?r.size===0:typeof r=="object"?Object.keys(r).length===0:!1}function B(r,e){if(r===e)return!0;if(r==null||e==null)return r===e;if(typeof r!=typeof e)return!1;if(typeof r!="object")return r===e;if(Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++)if(!B(r[s],e[s]))return!1;return!0}const t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;for(const s of t)if(!Object.prototype.hasOwnProperty.call(e,s)||!B(r[s],e[s]))return!1;return!0}class S{constructor(e,t){this.events={attrChanged:new R,modelChanged:new R},this._changing=!1,this._previousAttributes={},this._pending=!1;const n=e||{};t&&F(n,t),this.attributes=n,this.changed={}}get(e){return this.attributes[e]}set(e,t,n){if(e==null)return this;let s;typeof e=="object"?(s=e,n=t):(s={},s[e]=t),n||(n={});const i=n.unset,a=n.silent,d=[],A=this._changing;this._changing=!0,A||(this._previousAttributes=k(this.attributes),this.changed={});const b=this.attributes,m=this.changed,P=this._previousAttributes;for(const y in s)t=s[y],B(b[y],t)||d.push(y),B(P[y],t)?delete m[y]:m[y]=t,i?delete b[y]:b[y]=t;if(!a){d.length&&(this._pending=n);for(let y=0;y<d.length;y++)this.events.attrChanged.dispatch({object:this,attrName:d[y],attrValue:b[d[y]],options:n})}if(A)return this;if(!a)for(;this._pending;)n=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:n});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!j(this.changed):q(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?k(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,n={};for(const s in e){const i=e[s];B(t[s],i)||(n[s]=i)}return n}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return k(this._previousAttributes)}clone(){const e=k(this.attributes);return new S(e)}}class w{constructor(){this.entries=new Map}static getInstance(){return w.instance||(w.instance=new w),w.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries)console.log(`${e}:`),console.log(t.format())}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class ne{static formatBytes(e,t=2){if(e===0)return"0 B";const n=1024,s=Math.max(0,t),i=["B","KB","MB","GB","TB"],a=Math.floor(Math.log(e)/Math.log(n)),d=e/Math.pow(n,a);return`${parseFloat(d.toFixed(s))} ${i[a]}`}}class se{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class oe{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}scheduleTask(e){return new Promise((t,n)=>{const s=()=>{Promise.resolve(e()).then(t).catch(n)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(s):setTimeout(s,0)})}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let n=e;for(let s=0;s<t;s++){const i=this.tasks[s];try{n=await this.scheduleTask(async()=>{const a=await i.run(n);return this.onProgress((s+1)/t,i),a})}catch(a){if(this.onError({error:a,taskIndex:s,task:i}))break}}this.onComplete(n)}}class ${constructor(e,t,n){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,n=this.handlers.length;t<n;t+=2){const s=this.handlers[t],i=this.handlers[t+1];if(s.global&&(s.lastIndex=0),s.test(e))return i}return null}}const V=new $;class ie{constructor(e){this.manager=e!==void 0?e:V,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((n,s)=>{this.load(e,n,t,s)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}u.AcCmColor=v,u.AcCmColorMethod=o,u.AcCmColorUtil=_,u.AcCmEntityColor=Y,u.AcCmErrors=Z,u.AcCmEventDispatcher=J,u.AcCmEventManager=R,u.AcCmLoader=ie,u.AcCmLoadingManager=$,u.AcCmObject=S,u.AcCmPerformanceCollector=w,u.AcCmTask=se,u.AcCmTaskScheduler=oe,u.AcTrStringUtil=ne,u.DEBUG_MODE=te,u.DefaultLoadingManager=V,u.clone=k,u.deepClone=N,u.defaults=F,u.has=q,u.isEmpty=j,u.isEqual=B,u.log=C,u.setLogLevel=re,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/lib/AcCmColor.d.ts
CHANGED
|
@@ -1,201 +1,175 @@
|
|
|
1
|
+
import { AcCmColorMethod } from './AcCmColorMethod';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @module AcCmColor
|
|
9
|
-
* @version 1.0.0
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Represents a color in AutoCAD, supporting various color formats.
|
|
13
|
-
*
|
|
14
|
-
* @class AcCmColor
|
|
15
|
-
* @version 1.0.0
|
|
3
|
+
* Represents an AutoCAD color. This class supports color methods:
|
|
4
|
+
* - ByColor: explicit RGB
|
|
5
|
+
* - ByACI: AutoCAD Color Index (0-256)
|
|
6
|
+
* - ByLayer: color inherited from layer
|
|
7
|
+
* - ByBlock: color inherited from block
|
|
16
8
|
*/
|
|
17
9
|
export declare class AcCmColor {
|
|
18
|
-
|
|
19
|
-
private
|
|
20
|
-
private _colorName;
|
|
21
|
-
static NAMES: Record<string, number>;
|
|
10
|
+
/** The method used to determine the entity's color */
|
|
11
|
+
private _colorMethod;
|
|
22
12
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
13
|
+
* Internal value representing the color.
|
|
14
|
+
* - RGB: packed 0xRRGGBB for `ByColor`
|
|
15
|
+
* - ACI: 0–256 for `ByACI`
|
|
16
|
+
* - Layer index: 256 for `ByLayer`
|
|
17
|
+
* - Block indicator: 0 for `ByBlock`
|
|
25
18
|
*/
|
|
26
|
-
|
|
19
|
+
private _value?;
|
|
27
20
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @
|
|
21
|
+
* Constructs a new AcCmColor.
|
|
22
|
+
* @param method Initial color method (defaults to `ByColor`)
|
|
23
|
+
* @param value Internal packed value
|
|
31
24
|
*/
|
|
32
|
-
|
|
25
|
+
constructor(method?: AcCmColorMethod, value?: number);
|
|
26
|
+
/** Gets the current color method. */
|
|
27
|
+
get colorMethod(): AcCmColorMethod;
|
|
33
28
|
/**
|
|
34
|
-
* Sets the color
|
|
29
|
+
* Sets the color method.
|
|
35
30
|
*
|
|
36
|
-
*
|
|
31
|
+
* Note: Changing the method does not modify `_value`.
|
|
37
32
|
*/
|
|
38
|
-
set
|
|
33
|
+
set colorMethod(method: AcCmColorMethod);
|
|
34
|
+
/** Gets the red component (0–255). */
|
|
35
|
+
get red(): number | undefined;
|
|
36
|
+
/** Gets the green component (0–255). */
|
|
37
|
+
get green(): number | undefined;
|
|
38
|
+
/** Gets the blue component (0–255). */
|
|
39
|
+
get blue(): number | undefined;
|
|
39
40
|
/**
|
|
40
|
-
* Gets the
|
|
41
|
+
* Gets the packed RGB value (0xRRGGBB).
|
|
41
42
|
*
|
|
42
|
-
*
|
|
43
|
+
* - For `ByColor`, returns `_value` directly
|
|
44
|
+
* - For `ByACI`, converts index to RGB via `AcCmColorUtil`
|
|
45
|
+
* - For `ByLayer` or `ByBlock`, returns `_value` directly
|
|
43
46
|
*/
|
|
44
|
-
get
|
|
47
|
+
get RGB(): number | undefined;
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Sets the RGB color.
|
|
47
50
|
*
|
|
48
|
-
* @
|
|
51
|
+
* @param r Red component (0–255)
|
|
52
|
+
* @param g Green component (0–255)
|
|
53
|
+
* @param b Blue component (0–255)
|
|
54
|
+
* @returns The current instance for chaining
|
|
49
55
|
*/
|
|
50
|
-
|
|
56
|
+
setRGB(r: number, g: number, b: number): this;
|
|
51
57
|
/**
|
|
52
|
-
*
|
|
58
|
+
* Sets the RGB color by a single packed number (0xRRGGBB).
|
|
53
59
|
*
|
|
54
|
-
* @
|
|
60
|
+
* @param value Packed RGB number
|
|
55
61
|
*/
|
|
56
|
-
|
|
62
|
+
setRGBValue(value: number | undefined | null): this;
|
|
57
63
|
/**
|
|
58
|
-
*
|
|
64
|
+
* Sets the RGB color from a CSS color string.
|
|
59
65
|
*
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
66
|
+
* Examples:
|
|
67
|
+
* - "#FF00FF"
|
|
68
|
+
* - "#F0F"
|
|
69
|
+
* - "rgb(255,0,255)"
|
|
70
|
+
* - "rgba(255,0,255,0.5)"
|
|
71
|
+
* - "red" (named colors)
|
|
65
72
|
*
|
|
66
|
-
* @
|
|
73
|
+
* @param cssString CSS color string
|
|
74
|
+
* @returns The current instance for chaining
|
|
67
75
|
*/
|
|
68
|
-
|
|
76
|
+
setRGBFromCss(cssString: string): this;
|
|
69
77
|
/**
|
|
70
|
-
*
|
|
71
|
-
* 0 and 256 are special values.
|
|
78
|
+
* Sets the color as a scalar grayscale value.
|
|
72
79
|
*
|
|
73
|
-
* @
|
|
80
|
+
* @param scalar Scalar value (0–255)
|
|
81
|
+
* @returns The current instance for chaining
|
|
74
82
|
*/
|
|
75
|
-
|
|
83
|
+
setScalar(scalar: number): this;
|
|
76
84
|
/**
|
|
77
|
-
*
|
|
78
|
-
* 256 is set, 256 will be used.
|
|
79
|
-
* - 0 indicates that the entity uses the color of the BlockReference that's displaying it. If the entity
|
|
80
|
-
* is not displayed through a block reference (for example, it is directly owned by the model space
|
|
81
|
-
* block table record) and its color is 0, then it will display as though its color were 7.
|
|
82
|
-
* - 256 indicates that the entity uses the color specified in the layer table record it references.
|
|
83
|
-
*
|
|
84
|
-
* @param {number | null} value - The color index to set (0-256).
|
|
85
|
+
* Gets the hexadecimal representation of the color (e.g., "0xFF00FF").
|
|
85
86
|
*/
|
|
86
|
-
|
|
87
|
+
get hexColor(): string | undefined;
|
|
87
88
|
/**
|
|
88
|
-
* Gets the
|
|
89
|
-
*
|
|
90
|
-
* @returns {string | null} The color name.
|
|
89
|
+
* Gets the CSS RGB color string (e.g., "rgb(255,0,255)").
|
|
91
90
|
*/
|
|
92
|
-
get
|
|
91
|
+
get cssColor(): string | undefined;
|
|
92
|
+
/** Gets the AutoCAD Color Index (ACI), or undefined if not ByACI, ByBlock, or ByLayer. */
|
|
93
|
+
get colorIndex(): number | undefined;
|
|
93
94
|
/**
|
|
94
|
-
* Sets the
|
|
95
|
+
* Sets the AutoCAD Color Index (0–256).
|
|
95
96
|
*
|
|
96
|
-
*
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Checks if the color has a name.
|
|
97
|
+
* - 0 sets the color method to `ByBlock`
|
|
98
|
+
* - 256 sets the color method to `ByLayer`
|
|
99
|
+
* - 1–255 sets the color method to `ByACI`
|
|
101
100
|
*
|
|
102
|
-
* @
|
|
101
|
+
* @param index ACI index
|
|
103
102
|
*/
|
|
104
|
-
|
|
103
|
+
set colorIndex(index: number | undefined);
|
|
105
104
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* @returns {boolean} True if the color has no index, false otherwise.
|
|
105
|
+
* Returns true if the color method is ByColor (explicit RGB).
|
|
109
106
|
*/
|
|
110
|
-
get
|
|
107
|
+
get isByColor(): boolean;
|
|
111
108
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* @returns {boolean} True if the color is "ByLayer", false otherwise.
|
|
109
|
+
* Returns true if the color method is ByACI.
|
|
115
110
|
*/
|
|
111
|
+
get isByACI(): boolean;
|
|
112
|
+
/** Returns true if the color method is ByLayer. */
|
|
116
113
|
get isByLayer(): boolean;
|
|
117
114
|
/**
|
|
118
|
-
* Sets the color to
|
|
119
|
-
*
|
|
120
|
-
* @returns {AcCmColor} The current instance.
|
|
121
|
-
*/
|
|
122
|
-
setByLayer(): this;
|
|
123
|
-
/**
|
|
124
|
-
* Checks if the color is set to "ByBlock".
|
|
125
|
-
*
|
|
126
|
-
* @returns {boolean} True if the color is "ByBlock", false otherwise.
|
|
115
|
+
* Sets the color to ByLayer.
|
|
116
|
+
* @param value - Option layer color value
|
|
127
117
|
*/
|
|
118
|
+
setByLayer(value?: number): this;
|
|
119
|
+
/** Returns true if the color method is ByBlock. */
|
|
128
120
|
get isByBlock(): boolean;
|
|
129
121
|
/**
|
|
130
|
-
* Sets the color to
|
|
131
|
-
*
|
|
132
|
-
* @returns {AcCmColor} The current instance.
|
|
133
|
-
*/
|
|
134
|
-
setByBlock(): this;
|
|
135
|
-
/**
|
|
136
|
-
* Sets the color using a scalar value (RGB).
|
|
137
|
-
*
|
|
138
|
-
* @param {number} scalar - The scalar value (0-255).
|
|
139
|
-
* @returns {AcCmColor} The current instance.
|
|
122
|
+
* Sets the color to ByBlock.
|
|
123
|
+
* @param value - Option layer color value
|
|
140
124
|
*/
|
|
141
|
-
|
|
125
|
+
setByBlock(value?: number): this;
|
|
142
126
|
/**
|
|
143
|
-
*
|
|
127
|
+
* Gets the color name.
|
|
144
128
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* @param {number} b - The blue component (0-255).
|
|
148
|
-
* @returns {AcCmColor} The current instance.
|
|
129
|
+
* For `ByColor` or `ByACI`, resolves the name via `AcCmColorUtil`.
|
|
130
|
+
* For `ByLayer` or `ByBlock`, returns the corresponding string.
|
|
149
131
|
*/
|
|
150
|
-
|
|
132
|
+
get colorName(): string | undefined;
|
|
151
133
|
/**
|
|
152
134
|
* Sets the color by name.
|
|
153
135
|
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
136
|
+
* Resolves the name to an RGB value via `AcCmColorUtil`.
|
|
137
|
+
*
|
|
138
|
+
* @param name Color name
|
|
156
139
|
*/
|
|
157
|
-
|
|
140
|
+
set colorName(name: string | undefined);
|
|
158
141
|
/**
|
|
159
|
-
*
|
|
142
|
+
* Creates a clone of this color instance.
|
|
160
143
|
*
|
|
161
|
-
* @returns
|
|
144
|
+
* @returns A new AcCmColor instance with the same method and value
|
|
162
145
|
*/
|
|
163
|
-
clone():
|
|
146
|
+
clone(): AcCmColor;
|
|
164
147
|
/**
|
|
165
|
-
* Copies
|
|
148
|
+
* Copies color values from another AcCmColor instance.
|
|
166
149
|
*
|
|
167
|
-
* @param
|
|
168
|
-
* @returns
|
|
150
|
+
* @param other The source color
|
|
151
|
+
* @returns The current instance
|
|
169
152
|
*/
|
|
170
|
-
copy(
|
|
153
|
+
copy(other: AcCmColor): this;
|
|
171
154
|
/**
|
|
172
|
-
* Checks
|
|
155
|
+
* Checks equality with another color.
|
|
173
156
|
*
|
|
174
|
-
* @param
|
|
175
|
-
* @returns
|
|
157
|
+
* @param other The color to compare
|
|
158
|
+
* @returns True if color method and value are identical
|
|
176
159
|
*/
|
|
177
|
-
equals(
|
|
160
|
+
equals(other: AcCmColor): boolean;
|
|
178
161
|
/**
|
|
179
162
|
* Returns a string representation of the color.
|
|
180
163
|
*
|
|
181
|
-
*
|
|
164
|
+
* - "ByLayer" for ByLayer colors
|
|
165
|
+
* - "ByBlock" for ByBlock colors
|
|
166
|
+
* - One number for color index
|
|
167
|
+
* - Three comma-separated numbers for RGB color
|
|
182
168
|
*/
|
|
183
169
|
toString(): string;
|
|
184
170
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* @private
|
|
188
|
-
* @param {number} target - The RGB value to find a name for.
|
|
189
|
-
* @returns {string | null} The color name if found, null otherwise.
|
|
190
|
-
*/
|
|
191
|
-
private getColorNameByValue;
|
|
192
|
-
/**
|
|
193
|
-
* Finds the AutoCAD color index associated with a given RGB value.
|
|
194
|
-
*
|
|
195
|
-
* @private
|
|
196
|
-
* @param {number} target - The RGB value to find an index for.
|
|
197
|
-
* @returns {number | null} The color index if found, null otherwise.
|
|
171
|
+
* Creates one AcCmColor from one string
|
|
198
172
|
*/
|
|
199
|
-
|
|
173
|
+
static fromString(name: string): AcCmColor | undefined;
|
|
200
174
|
}
|
|
201
175
|
//# sourceMappingURL=AcCmColor.d.ts.map
|
package/lib/AcCmColor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcCmColor.d.ts","sourceRoot":"","sources":["../src/AcCmColor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AcCmColor.d.ts","sourceRoot":"","sources":["../src/AcCmColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGnD;;;;;;GAMG;AACH,qBAAa,SAAS;IACpB,sDAAsD;IACtD,OAAO,CAAC,YAAY,CAAiB;IAErC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,CAAQ;IAEvB;;;;OAIG;gBAED,MAAM,GAAE,eAAyC,EACjD,KAAK,CAAC,EAAE,MAAM;IAwBhB,qCAAqC;IACrC,IAAI,WAAW,IAAI,eAAe,CAEjC;IAED;;;;OAIG;IACH,IAAI,WAAW,CAAC,MAAM,EAAE,eAAe,EAEtC;IAMD,sCAAsC;IACtC,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAG5B;IAED,wCAAwC;IACxC,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAG9B;IAED,uCAAuC;IACvC,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAG7B;IAED;;;;;;OAMG;IACH,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAa5B;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAStC;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAU5C;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM;IA4C/B;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM;IAIxB;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,GAAG,SAAS,CAOjC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,GAAG,SAAS,CAIjC;IAMD,0FAA0F;IAC1F,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAKnC;IAED;;;;;;;;OAQG;IACH,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAcvC;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAMD,mDAAmD;IACnD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;OAGG;IACH,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM;IAUzB,mDAAmD;IACnD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;OAGG;IACH,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM;IAczB;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAalC;IAED;;;;;;OAMG;IACH,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EASrC;IAMD;;;;OAIG;IACH,KAAK,IAAI,SAAS;IAOlB;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,SAAS;IAMrB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS;IAUvB;;;;;;;OAOG;IACH,QAAQ,IAAI,MAAM;IAiBlB;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;CAmCvD"}
|