@likec4/core 1.23.1 → 1.24.1
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/builder/index.d.mts +3 -3
- package/dist/builder/index.d.ts +3 -3
- package/dist/builder/index.mjs +2 -2
- package/dist/compute-view/index.d.mts +4 -4
- package/dist/compute-view/index.d.ts +4 -4
- package/dist/compute-view/index.mjs +4 -4
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.mjs +4 -4
- package/dist/model/index.d.mts +5 -5
- package/dist/model/index.d.ts +5 -5
- package/dist/model/index.mjs +1 -1
- package/dist/shared/{core.3xeQpJ_K.d.cts → core.3L0y_SNW.d.mts} +2 -2
- package/dist/shared/{core.QP35c488.d.cts → core.Bhx0OGK8.d.mts} +1 -1
- package/dist/shared/{core.QP35c488.d.mts → core.Bhx0OGK8.d.ts} +1 -1
- package/dist/shared/{core.DsDq-blc.d.ts → core.BreLKHbT.d.mts} +1 -2
- package/dist/shared/{core.DQCc-Jxk.d.ts → core.BsAIrb_r.d.ts} +1 -1
- package/dist/shared/{core.CJaCUZQ9.d.mts → core.C9UbC1nX.d.ts} +1 -2
- package/dist/shared/core.CHsHWcLq.mjs +2499 -0
- package/dist/shared/{core.s6UB2oA0.d.ts → core.DBToPQ3n.d.ts} +2 -2
- package/dist/shared/{core.GIZxdz4M.mjs → core.DT2JT2Cd.mjs} +1 -1
- package/dist/shared/{core.1pNr6Ryk.d.ts → core.DbfQeUKm.d.mts} +5 -4
- package/dist/shared/{core.uGbvOLGK.mjs → core.Mz23ea8u.mjs} +29 -10
- package/dist/shared/{core.BYs5deiY.d.cts → core.RiWsY3jz.d.mts} +1 -1
- package/dist/shared/{core.DKJ2y3NP.d.mts → core.k4jahJ8j.d.ts} +5 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.d.mts +92 -4
- package/dist/utils/index.d.ts +92 -4
- package/dist/utils/index.mjs +2 -2
- package/package.json +5 -29
- package/src/compute-view/deployment-view/clean-connections.ts +1 -1
- package/src/compute-view/deployment-view/stages/stage-final.ts +1 -1
- package/src/compute-view/element-view/compute.ts +1 -1
- package/src/compute-view/element-view/memory/memory.ts +1 -1
- package/src/compute-view/memory/ops.ts +1 -1
- package/src/compute-view/relationships-view/layout.ts +1 -1
- package/src/compute-view/relationships-view/utils.ts +1 -1
- package/src/model/DeploymentElementModel.ts +4 -6
- package/src/model/DeploymentModel.ts +1 -1
- package/src/model/LikeC4Model.ts +23 -2
- package/src/model/view/LikeC4ViewModel.ts +5 -6
- package/src/types/deployments.ts +0 -1
- package/src/types/index.ts +1 -1
- package/src/types/theme.ts +1 -1
- package/src/utils/index.ts +8 -1
- package/src/utils/mnemonist.ts +8 -0
- package/src/utils/set.ts +5 -3
- package/dist/builder/index.cjs +0 -887
- package/dist/builder/index.d.cts +0 -509
- package/dist/compute-view/index.cjs +0 -86
- package/dist/compute-view/index.d.cts +0 -23
- package/dist/index.cjs +0 -3857
- package/dist/index.d.cts +0 -146
- package/dist/model/index.cjs +0 -40
- package/dist/model/index.d.cts +0 -259
- package/dist/shared/core.BHQYwEvc.d.mts +0 -12
- package/dist/shared/core.BS_nXBsP.d.cts +0 -858
- package/dist/shared/core.BYiA0A6H.cjs +0 -39
- package/dist/shared/core.CEJQrbXY.cjs +0 -441
- package/dist/shared/core.D0KD4FiT.d.mts +0 -127
- package/dist/shared/core.DEzbhxsA.cjs +0 -14874
- package/dist/shared/core.DUbKSpjd.cjs +0 -26
- package/dist/shared/core.DqmAHWZs.cjs +0 -7501
- package/dist/shared/core.OjOfEBRQ.d.cts +0 -731
- package/dist/shared/core.QP35c488.d.ts +0 -185
- package/dist/shared/core.f1tiPwpd.mjs +0 -14819
- package/dist/types/index.cjs +0 -110
- package/dist/types/index.d.cts +0 -72
- package/dist/utils/index.cjs +0 -99
- package/dist/utils/index.d.cts +0 -340
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { I as IterableContainer, R as ReorderedArray, a as ancestorsFqn, c as commonAncestor, b as compareByFqnHierarchically, d as compareFqnHierarchically, h as hierarchyDistance, e as hierarchyLevel, i as isAncestor, f as isDescendantOf, g as isSameHierarchy, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, j as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.
|
|
2
|
-
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.
|
|
3
|
-
export { default as objectHash } from '/home/runner/work/likec4/likec4/node_modules/.pnpm/@types+object-hash@3.0.6/node_modules/@types/object-hash/index.d.ts';
|
|
1
|
+
export { I as IterableContainer, R as ReorderedArray, a as ancestorsFqn, c as commonAncestor, b as compareByFqnHierarchically, d as compareFqnHierarchically, h as hierarchyDistance, e as hierarchyLevel, i as isAncestor, f as isDescendantOf, g as isSameHierarchy, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, j as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.BsAIrb_r.js';
|
|
2
|
+
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.Bhx0OGK8.js';
|
|
4
3
|
import { IsNumericLiteral } from 'type-fest';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -33,6 +32,25 @@ declare class DefaultMap<K, V> implements Iterable<[K, V]> {
|
|
|
33
32
|
static autoIncrement(): number;
|
|
34
33
|
}
|
|
35
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Mnemonist DefaultWeakMap Typings
|
|
37
|
+
* ================================
|
|
38
|
+
*/
|
|
39
|
+
declare class DefaultWeakMap<K extends object, V> {
|
|
40
|
+
|
|
41
|
+
// Constructor
|
|
42
|
+
constructor(factory: (key: K) => V);
|
|
43
|
+
|
|
44
|
+
// Methods
|
|
45
|
+
clear(): void;
|
|
46
|
+
set(key: K, value: V): this;
|
|
47
|
+
delete(key: K): boolean;
|
|
48
|
+
has(key: K): boolean;
|
|
49
|
+
get(key: K): V;
|
|
50
|
+
peek(key: K): V | undefined;
|
|
51
|
+
inspect(): any;
|
|
52
|
+
}
|
|
53
|
+
|
|
36
54
|
/**
|
|
37
55
|
* Mnemonist LinkedList Typings
|
|
38
56
|
* =============================
|
|
@@ -66,6 +84,52 @@ declare class LinkedList<T> implements Iterable<T> {
|
|
|
66
84
|
static from<I>(iterable: Iterable<I> | {[key: string]: I}): LinkedList<I>;
|
|
67
85
|
}
|
|
68
86
|
|
|
87
|
+
interface MultiMapConstructor {
|
|
88
|
+
new <K, V>(container: SetConstructor): MultiMap<K, V, Set<V>>;
|
|
89
|
+
new <K, V>(container?: ArrayConstructor): MultiMap<K, V, V[]>;
|
|
90
|
+
|
|
91
|
+
from<K, V>(
|
|
92
|
+
iterable: Iterable<[K, V]> | {[key: string]: V},
|
|
93
|
+
Container: SetConstructor
|
|
94
|
+
): MultiMap<K, V, Set<V>>;
|
|
95
|
+
from<K, V>(
|
|
96
|
+
iterable: Iterable<[K, V]> | {[key: string]: V},
|
|
97
|
+
Container?: ArrayConstructor
|
|
98
|
+
): MultiMap<K, V, V[]>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Mnemonist MultiMap Typings
|
|
102
|
+
* ===========================
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
interface MultiMap<K, V, C extends V[] | Set<V> = V[]> extends Iterable<[K, V]> {
|
|
106
|
+
|
|
107
|
+
// Members
|
|
108
|
+
dimension: number;
|
|
109
|
+
size: number;
|
|
110
|
+
|
|
111
|
+
// Methods
|
|
112
|
+
clear(): void;
|
|
113
|
+
set(key: K, value: V): this;
|
|
114
|
+
delete(key: K): boolean;
|
|
115
|
+
remove(key: K, value: V): boolean;
|
|
116
|
+
has(key: K): boolean;
|
|
117
|
+
get(key: K): C | undefined;
|
|
118
|
+
multiplicity(key: K): number;
|
|
119
|
+
forEach(callback: (value: V, key: K, map: this) => void, scope?: any): void;
|
|
120
|
+
forEachAssociation(callback: (value: C, key: K, map: this) => void, scope?: any): void;
|
|
121
|
+
keys(): IterableIterator<K>;
|
|
122
|
+
values(): IterableIterator<V>;
|
|
123
|
+
entries(): IterableIterator<[K, V]>;
|
|
124
|
+
containers(): IterableIterator<C>;
|
|
125
|
+
associations(): IterableIterator<[K, C]>;
|
|
126
|
+
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
127
|
+
inspect(): any;
|
|
128
|
+
toJSON(): any;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare const MultiMap: MultiMapConstructor;
|
|
132
|
+
|
|
69
133
|
/**
|
|
70
134
|
* Mnemonist Queue Typings
|
|
71
135
|
* ========================
|
|
@@ -337,4 +401,28 @@ declare function symmetricDifference<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): S
|
|
|
337
401
|
*/
|
|
338
402
|
declare function stringHash(str: string): string;
|
|
339
403
|
|
|
340
|
-
|
|
404
|
+
function getDefaultExportFromCjs (x) {
|
|
405
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function commonjsRequire(path) {
|
|
409
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
var object_hash$1 = {exports: {}};
|
|
413
|
+
|
|
414
|
+
var hasRequiredObject_hash;
|
|
415
|
+
|
|
416
|
+
function requireObject_hash () {
|
|
417
|
+
if (hasRequiredObject_hash) return object_hash$1.exports;
|
|
418
|
+
hasRequiredObject_hash = 1;
|
|
419
|
+
(function (module, exports) {
|
|
420
|
+
!function(e){module.exports=e();}(function(){return function r(o,i,u){function s(n,e){if(!i[n]){if(!o[n]){var t="function"==typeof commonjsRequire&&commonjsRequire;if(!e&&t)return t(n,true);if(a)return a(n,true);throw new Error("Cannot find module '"+n+"'")}e=i[n]={exports:{}};o[n][0].call(e.exports,function(e){var t=o[n][1][e];return s(t||e)},e,e.exports,r,o,i,u);}return i[n].exports}for(var a="function"==typeof commonjsRequire&&commonjsRequire,e=0;e<u.length;e++)s(u[e]);return s}({1:[function(w,b,m){!function(e,n,s,c,d,h,p,g,y){var r=w("crypto");function t(e,t){t=u(e,t);var n;return void 0===(n="passthrough"!==t.algorithm?r.createHash(t.algorithm):new l).write&&(n.write=n.update,n.end=n.update),f(t,n).dispatch(e),n.update||n.end(""),n.digest?n.digest("buffer"===t.encoding?void 0:t.encoding):(e=n.read(),"buffer"!==t.encoding?e.toString(t.encoding):e)}(m=b.exports=t).sha1=function(e){return t(e)},m.keys=function(e){return t(e,{excludeValues:true,algorithm:"sha1",encoding:"hex"})},m.MD5=function(e){return t(e,{algorithm:"md5",encoding:"hex"})},m.keysMD5=function(e){return t(e,{algorithm:"md5",encoding:"hex",excludeValues:true})};var o=r.getHashes?r.getHashes().slice():["sha1","md5"],i=(o.push("passthrough"),["buffer","hex","binary","base64"]);function u(e,t){var n={};if(n.algorithm=(t=t||{}).algorithm||"sha1",n.encoding=t.encoding||"hex",n.excludeValues=!!t.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=true===t.ignoreUnknown,n.respectType=false!==t.respectType,n.respectFunctionNames=false!==t.respectFunctionNames,n.respectFunctionProperties=false!==t.respectFunctionProperties,n.unorderedArrays=true===t.unorderedArrays,n.unorderedSets=false!==t.unorderedSets,n.unorderedObjects=false!==t.unorderedObjects,n.replacer=t.replacer||void 0,n.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var r=0;r<o.length;++r)o[r].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=o[r]);if(-1===o.indexOf(n.algorithm))throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+o.join(", "));if(-1===i.indexOf(n.encoding)&&"passthrough"!==n.algorithm)throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+i.join(", "));return n}function a(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function f(o,t,i){i=i||[];function u(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return {dispatch:function(e){return this["_"+(null===(e=o.replacer?o.replacer(e):e)?"null":typeof e)](e)},_object:function(t){var n,e=Object.prototype.toString.call(t),r=/\[object (.*)\]/i.exec(e);r=(r=r?r[1]:"unknown:["+e+"]").toLowerCase();if(0<=(e=i.indexOf(t)))return this.dispatch("[CIRCULAR:"+e+"]");if(i.push(t),void 0!==s&&s.isBuffer&&s.isBuffer(t))return u("buffer:"),u(t);if("object"===r||"function"===r||"asyncfunction"===r)return e=Object.keys(t),o.unorderedObjects&&(e=e.sort()),false===o.respectType||a(t)||e.splice(0,0,"prototype","__proto__","constructor"),o.excludeKeys&&(e=e.filter(function(e){return !o.excludeKeys(e)})),u("object:"+e.length+":"),n=this,e.forEach(function(e){n.dispatch(e),u(":"),o.excludeValues||n.dispatch(t[e]),u(",");});if(!this["_"+r]){if(o.ignoreUnknown)return u("["+r+"]");throw new Error('Unknown object type "'+r+'"')}this["_"+r](t);},_array:function(e,t){t=void 0!==t?t:false!==o.unorderedArrays;var n=this;if(u("array:"+e.length+":"),!t||e.length<=1)return e.forEach(function(e){return n.dispatch(e)});var r=[],t=e.map(function(e){var t=new l,n=i.slice();return f(o,t,n).dispatch(e),r=r.concat(n.slice(i.length)),t.read().toString()});return i=i.concat(r),t.sort(),this._array(t,false)},_date:function(e){return u("date:"+e.toJSON())},_symbol:function(e){return u("symbol:"+e.toString())},_error:function(e){return u("error:"+e.toString())},_boolean:function(e){return u("bool:"+e.toString())},_string:function(e){u("string:"+e.length+":"),u(e.toString());},_function:function(e){u("fn:"),a(e)?this.dispatch("[native]"):this.dispatch(e.toString()),false!==o.respectFunctionNames&&this.dispatch("function-name:"+String(e.name)),o.respectFunctionProperties&&this._object(e);},_number:function(e){return u("number:"+e.toString())},_xml:function(e){return u("xml:"+e.toString())},_null:function(){return u("Null")},_undefined:function(){return u("Undefined")},_regexp:function(e){return u("regex:"+e.toString())},_uint8array:function(e){return u("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return u("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return u("int8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return u("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return u("int16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return u("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return u("int32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return u("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return u("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return u("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return u("url:"+e.toString())},_map:function(e){u("map:");e=Array.from(e);return this._array(e,false!==o.unorderedSets)},_set:function(e){u("set:");e=Array.from(e);return this._array(e,false!==o.unorderedSets)},_file:function(e){return u("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(o.ignoreUnknown)return u("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return u("domwindow")},_bigint:function(e){return u("bigint:"+e.toString())},_process:function(){return u("process")},_timer:function(){return u("timer")},_pipe:function(){return u("pipe")},_tcp:function(){return u("tcp")},_udp:function(){return u("udp")},_tty:function(){return u("tty")},_statwatcher:function(){return u("statwatcher")},_securecontext:function(){return u("securecontext")},_connection:function(){return u("connection")},_zlib:function(){return u("zlib")},_context:function(){return u("context")},_nodescript:function(){return u("nodescript")},_httpparser:function(){return u("httpparser")},_dataview:function(){return u("dataview")},_signal:function(){return u("signal")},_fsevent:function(){return u("fsevent")},_tlswrap:function(){return u("tlswrap")}}}function l(){return {buf:"",write:function(e){this.buf+=e;},end:function(e){this.buf+=e;},read:function(){return this.buf}}}m.writeToStream=function(e,t,n){return void 0===n&&(n=t,t={}),f(t=u(e,t),n).dispatch(e)};}.call(this,w("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/");},{buffer:3,crypto:5,lYpoI2:11}],2:[function(e,t,f){!function(e,t,n,r,o,i,u,s,a){!function(e){var a="undefined"!=typeof Uint8Array?Uint8Array:Array,t="+".charCodeAt(0),n="/".charCodeAt(0),r="0".charCodeAt(0),o="a".charCodeAt(0),i="A".charCodeAt(0),u="-".charCodeAt(0),s="_".charCodeAt(0);function f(e){e=e.charCodeAt(0);return e===t||e===u?62:e===n||e===s?63:e<r?-1:e<r+10?e-r+26+26:e<i+26?e-i:e<o+26?e-o+26:void 0}e.toByteArray=function(e){var t,n;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.length,r="="===e.charAt(r-2)?2:"="===e.charAt(r-1)?1:0,o=new a(3*e.length/4-r),i=0<r?e.length-4:e.length,u=0;function s(e){o[u++]=e;}for(t=0;t<i;t+=4,0)s((16711680&(n=f(e.charAt(t))<<18|f(e.charAt(t+1))<<12|f(e.charAt(t+2))<<6|f(e.charAt(t+3))))>>16),s((65280&n)>>8),s(255&n);return 2==r?s(255&(n=f(e.charAt(t))<<2|f(e.charAt(t+1))>>4)):1==r&&(s((n=f(e.charAt(t))<<10|f(e.charAt(t+1))<<4|f(e.charAt(t+2))>>2)>>8&255),s(255&n)),o},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,u="";function s(e){return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t<r;t+=3)n=(e[t]<<16)+(e[t+1]<<8)+e[t+2],u+=s((o=n)>>18&63)+s(o>>12&63)+s(o>>6&63)+s(63&o);switch(i){case 1:u=(u+=s((n=e[e.length-1])>>2))+s(n<<4&63)+"==";break;case 2:u=(u=(u+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+s(n>>4&63))+s(n<<2&63)+"=";}return u};}(void 0===f?this.base64js={}:f);}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib");},{buffer:3,lYpoI2:11}],3:[function(O,e,H){!function(e,n,f,r,h,p,g,y,w){var a=O("base64-js"),i=O("ieee754");function f(e,t,n){if(!(this instanceof f))return new f(e,t,n);var r,o,i,u,s=typeof e;if("base64"===t&&"string"==s)for(e=(u=e).trim?u.trim():u.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==s)r=j(e);else if("string"==s)r=f.byteLength(e,t);else {if("object"!=s)throw new Error("First argument needs to be a number, array or string.");r=j(e.length);}if(f._useTypedArrays?o=f._augment(new Uint8Array(r)):((o=this).length=r,o._isBuffer=true),f._useTypedArrays&&"number"==typeof e.byteLength)o._set(e);else if(C(u=e)||f.isBuffer(u)||u&&"object"==typeof u&&"number"==typeof u.length)for(i=0;i<r;i++)f.isBuffer(e)?o[i]=e.readUInt8(i):o[i]=e[i];else if("string"==s)o.write(e,0,t);else if("number"==s&&!f._useTypedArrays&&!n)for(i=0;i<r;i++)o[i]=0;return o}function b(e,t,n,r){return f._charsWritten=c(function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function m(e,t,n,r){return f._charsWritten=c(function(e){for(var t,n,r=[],o=0;o<e.length;o++)n=e.charCodeAt(o),t=n>>8,n=n%256,r.push(n),r.push(t);return r}(t),e,n,r)}function v(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;o++)r+=String.fromCharCode(e[o]);return r}function o(e,t,n,r){r||(d("boolean"==typeof n,"missing or invalid endian"),d(null!=t,"missing offset"),d(t+1<e.length,"Trying to read beyond buffer length"));var o,r=e.length;if(!(r<=t))return n?(o=e[t],t+1<r&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<r&&(o|=e[t+1])),o}function u(e,t,n,r){r||(d("boolean"==typeof n,"missing or invalid endian"),d(null!=t,"missing offset"),d(t+3<e.length,"Trying to read beyond buffer length"));var o,r=e.length;if(!(r<=t))return n?(t+2<r&&(o=e[t+2]<<16),t+1<r&&(o|=e[t+1]<<8),o|=e[t],t+3<r&&(o+=e[t+3]<<24>>>0)):(t+1<r&&(o=e[t+1]<<16),t+2<r&&(o|=e[t+2]<<8),t+3<r&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}function _(e,t,n,r){if(r||(d("boolean"==typeof n,"missing or invalid endian"),d(null!=t,"missing offset"),d(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t))return r=o(e,t,n,true),32768&r?-1*(65535-r+1):r}function E(e,t,n,r){if(r||(d("boolean"==typeof n,"missing or invalid endian"),d(null!=t,"missing offset"),d(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t))return r=u(e,t,n,true),2147483648&r?-1*(4294967295-r+1):r}function I(e,t,n,r){return r||(d("boolean"==typeof n,"missing or invalid endian"),d(t+3<e.length,"Trying to read beyond buffer length")),i.read(e,t,n,23,4)}function A(e,t,n,r){return r||(d("boolean"==typeof n,"missing or invalid endian"),d(t+7<e.length,"Trying to read beyond buffer length")),i.read(e,t,n,52,8)}function s(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+1<e.length,"trying to write beyond buffer length"),Y(t,65535));o=e.length;if(!(o<=n))for(var i=0,u=Math.min(o-n,2);i<u;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i);}function l(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+3<e.length,"trying to write beyond buffer length"),Y(t,4294967295));o=e.length;if(!(o<=n))for(var i=0,u=Math.min(o-n,4);i<u;i++)e[n+i]=t>>>8*(r?i:3-i)&255;}function B(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+1<e.length,"Trying to write beyond buffer length"),F(t,32767,-32768)),e.length<=n||s(e,0<=t?t:65535+t+1,n,r,o);}function L(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+3<e.length,"Trying to write beyond buffer length"),F(t,2147483647,-2147483648)),e.length<=n||l(e,0<=t?t:4294967295+t+1,n,r,o);}function U(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+3<e.length,"Trying to write beyond buffer length"),D(t,34028234663852886e22,-34028234663852886e22)),e.length<=n||i.write(e,t,n,r,23,4);}function x(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+7<e.length,"Trying to write beyond buffer length"),D(t,17976931348623157e292,-17976931348623157e292)),e.length<=n||i.write(e,t,n,r,52,8);}H.Buffer=f,H.SlowBuffer=f,H.INSPECT_MAX_BYTES=50,f.poolSize=8192,f._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return false}}(),f.isEncoding=function(e){switch(String(e).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "raw":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return true;default:return false}},f.isBuffer=function(e){return !(null==e||!e._isBuffer)},f.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case "hex":n=e.length/2;break;case "utf8":case "utf-8":n=T(e).length;break;case "ascii":case "binary":case "raw":n=e.length;break;case "base64":n=M(e).length;break;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":n=2*e.length;break;default:throw new Error("Unknown encoding")}return n},f.concat=function(e,t){if(d(C(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new f(0);if(1===e.length)return e[0];if("number"!=typeof t)for(o=t=0;o<e.length;o++)t+=e[o].length;for(var n=new f(t),r=0,o=0;o<e.length;o++){var i=e[o];i.copy(n,r),r+=i.length;}return n},f.prototype.write=function(e,t,n,r){isFinite(t)?isFinite(n)||(r=n,n=void 0):(a=r,r=t,t=n,n=a),t=Number(t)||0;var o,i,u,s,a=this.length-t;switch((!n||a<(n=Number(n)))&&(n=a),r=String(r||"utf8").toLowerCase()){case "hex":o=function(e,t,n,r){n=Number(n)||0;var o=e.length-n;(!r||o<(r=Number(r)))&&(r=o),d((o=t.length)%2==0,"Invalid hex string"),o/2<r&&(r=o/2);for(var i=0;i<r;i++){var u=parseInt(t.substr(2*i,2),16);d(!isNaN(u),"Invalid hex string"),e[n+i]=u;}return f._charsWritten=2*i,i}(this,e,t,n);break;case "utf8":case "utf-8":i=this,u=t,s=n,o=f._charsWritten=c(T(e),i,u,s);break;case "ascii":case "binary":o=b(this,e,t,n);break;case "base64":i=this,u=t,s=n,o=f._charsWritten=c(M(e),i,u,s);break;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":o=m(this,e,t,n);break;default:throw new Error("Unknown encoding")}return o},f.prototype.toString=function(e,t,n){var r,o,i,u,s=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):s.length)===t)return "";switch(e){case "hex":r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0);(!n||n<0||r<n)&&(n=r);for(var o="",i=t;i<n;i++)o+=k(e[i]);return o}(s,t,n);break;case "utf8":case "utf-8":r=function(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var i=t;i<n;i++)e[i]<=127?(r+=N(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return r+N(o)}(s,t,n);break;case "ascii":case "binary":r=v(s,t,n);break;case "base64":o=s,u=n,r=0===(i=t)&&u===o.length?a.fromByteArray(o):a.fromByteArray(o.slice(i,u));break;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":r=function(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}(s,t,n);break;default:throw new Error("Unknown encoding")}return r},f.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},f.prototype.copy=function(e,t,n,r){if(t=t||0,(r=r||0===r?r:this.length)!==(n=n||0)&&0!==e.length&&0!==this.length){d(n<=r,"sourceEnd < sourceStart"),d(0<=t&&t<e.length,"targetStart out of bounds"),d(0<=n&&n<this.length,"sourceStart out of bounds"),d(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length);var o=(r=e.length-t<r-n?e.length-t+n:r)-n;if(o<100||!f._useTypedArrays)for(var i=0;i<o;i++)e[i+t]=this[i+n];else e._set(this.subarray(n,n+o),t);}},f.prototype.slice=function(e,t){var n=this.length;if(e=S(e,n,0),t=S(t,n,n),f._useTypedArrays)return f._augment(this.subarray(e,t));for(var r=t-e,o=new f(r,void 0,true),i=0;i<r;i++)o[i]=this[i+e];return o},f.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},f.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},f.prototype.readUInt8=function(e,t){if(t||(d(null!=e,"missing offset"),d(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},f.prototype.readUInt16LE=function(e,t){return o(this,e,true,t)},f.prototype.readUInt16BE=function(e,t){return o(this,e,false,t)},f.prototype.readUInt32LE=function(e,t){return u(this,e,true,t)},f.prototype.readUInt32BE=function(e,t){return u(this,e,false,t)},f.prototype.readInt8=function(e,t){if(t||(d(null!=e,"missing offset"),d(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){return _(this,e,true,t)},f.prototype.readInt16BE=function(e,t){return _(this,e,false,t)},f.prototype.readInt32LE=function(e,t){return E(this,e,true,t)},f.prototype.readInt32BE=function(e,t){return E(this,e,false,t)},f.prototype.readFloatLE=function(e,t){return I(this,e,true,t)},f.prototype.readFloatBE=function(e,t){return I(this,e,false,t)},f.prototype.readDoubleLE=function(e,t){return A(this,e,true,t)},f.prototype.readDoubleBE=function(e,t){return A(this,e,false,t)},f.prototype.writeUInt8=function(e,t,n){n||(d(null!=e,"missing value"),d(null!=t,"missing offset"),d(t<this.length,"trying to write beyond buffer length"),Y(e,255)),t>=this.length||(this[t]=e);},f.prototype.writeUInt16LE=function(e,t,n){s(this,e,t,true,n);},f.prototype.writeUInt16BE=function(e,t,n){s(this,e,t,false,n);},f.prototype.writeUInt32LE=function(e,t,n){l(this,e,t,true,n);},f.prototype.writeUInt32BE=function(e,t,n){l(this,e,t,false,n);},f.prototype.writeInt8=function(e,t,n){n||(d(null!=e,"missing value"),d(null!=t,"missing offset"),d(t<this.length,"Trying to write beyond buffer length"),F(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n));},f.prototype.writeInt16LE=function(e,t,n){B(this,e,t,true,n);},f.prototype.writeInt16BE=function(e,t,n){B(this,e,t,false,n);},f.prototype.writeInt32LE=function(e,t,n){L(this,e,t,true,n);},f.prototype.writeInt32BE=function(e,t,n){L(this,e,t,false,n);},f.prototype.writeFloatLE=function(e,t,n){U(this,e,t,true,n);},f.prototype.writeFloatBE=function(e,t,n){U(this,e,t,false,n);},f.prototype.writeDoubleLE=function(e,t,n){x(this,e,t,true,n);},f.prototype.writeDoubleBE=function(e,t,n){x(this,e,t,false,n);},f.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,d("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),d(t<=n,"end < start"),n!==t&&0!==this.length){d(0<=t&&t<this.length,"start out of bounds"),d(0<=n&&n<=this.length,"end out of bounds");for(var r=t;r<n;r++)this[r]=e;}},f.prototype.inspect=function(){for(var e=[],t=this.length,n=0;n<t;n++)if(e[n]=k(this[n]),n===H.INSPECT_MAX_BYTES){e[n+1]="...";break}return "<Buffer "+e.join(" ")+">"},f.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(f._useTypedArrays)return new f(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t<n;t+=1)e[t]=this[t];return e.buffer};var t=f.prototype;function S(e,t,n){return "number"!=typeof e?n:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function j(e){return (e=~~Math.ceil(+e))<0?0:e}function C(e){return (Array.isArray||function(e){return "[object Array]"===Object.prototype.toString.call(e)})(e)}function k(e){return e<16?"0"+e.toString(16):e.toString(16)}function T(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t.push(e.charCodeAt(n));else for(var o=n,i=(55296<=r&&r<=57343&&n++,encodeURIComponent(e.slice(o,n+1)).substr(1).split("%")),u=0;u<i.length;u++)t.push(parseInt(i[u],16));}return t}function M(e){return a.toByteArray(e)}function c(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function N(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function Y(e,t){d("number"==typeof e,"cannot write a non-number as a number"),d(0<=e,"specified a negative value for writing an unsigned value"),d(e<=t,"value is larger than maximum value for type"),d(Math.floor(e)===e,"value has a fractional component");}function F(e,t,n){d("number"==typeof e,"cannot write a non-number as a number"),d(e<=t,"value larger than maximum allowed value"),d(n<=e,"value smaller than minimum allowed value"),d(Math.floor(e)===e,"value has a fractional component");}function D(e,t,n){d("number"==typeof e,"cannot write a non-number as a number"),d(e<=t,"value larger than maximum allowed value"),d(n<=e,"value smaller than minimum allowed value");}function d(e,t){if(!e)throw new Error(t||"Failed assertion")}f._augment=function(e){return e._isBuffer=true,e._get=e.get,e._set=e.set,e.get=t.get,e.set=t.set,e.write=t.write,e.toString=t.toString,e.toLocaleString=t.toString,e.toJSON=t.toJSON,e.copy=t.copy,e.slice=t.slice,e.readUInt8=t.readUInt8,e.readUInt16LE=t.readUInt16LE,e.readUInt16BE=t.readUInt16BE,e.readUInt32LE=t.readUInt32LE,e.readUInt32BE=t.readUInt32BE,e.readInt8=t.readInt8,e.readInt16LE=t.readInt16LE,e.readInt16BE=t.readInt16BE,e.readInt32LE=t.readInt32LE,e.readInt32BE=t.readInt32BE,e.readFloatLE=t.readFloatLE,e.readFloatBE=t.readFloatBE,e.readDoubleLE=t.readDoubleLE,e.readDoubleBE=t.readDoubleBE,e.writeUInt8=t.writeUInt8,e.writeUInt16LE=t.writeUInt16LE,e.writeUInt16BE=t.writeUInt16BE,e.writeUInt32LE=t.writeUInt32LE,e.writeUInt32BE=t.writeUInt32BE,e.writeInt8=t.writeInt8,e.writeInt16LE=t.writeInt16LE,e.writeInt16BE=t.writeInt16BE,e.writeInt32LE=t.writeInt32LE,e.writeInt32BE=t.writeInt32BE,e.writeFloatLE=t.writeFloatLE,e.writeFloatBE=t.writeFloatBE,e.writeDoubleLE=t.writeDoubleLE,e.writeDoubleBE=t.writeDoubleBE,e.fill=t.fill,e.inspect=t.inspect,e.toArrayBuffer=t.toArrayBuffer,e};}.call(this,O("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},O("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer");},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(c,d,e){!function(e,t,a,n,r,o,i,u,s){var a=c("buffer").Buffer,f=4,l=new a(f);l.fill(0);d.exports={hash:function(e,t,n,r){for(var o=t(function(e,t){e.length%f!=0&&(n=e.length+(f-e.length%f),e=a.concat([e,l],n));for(var n,r=[],o=t?e.readInt32BE:e.readInt32LE,i=0;i<e.length;i+=f)r.push(o.call(e,i));return r}(e=a.isBuffer(e)?e:new a(e),r),8*e.length),t=r,i=new a(n),u=t?i.writeInt32BE:i.writeInt32LE,s=0;s<o.length;s++)u.call(i,o[s],4*s,true);return i}};}.call(this,c("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{buffer:3,lYpoI2:11}],5:[function(v,e,_){!function(l,c,u,d,h,p,g,y,w){var u=v("buffer").Buffer,e=v("./sha"),t=v("./sha256"),n=v("./rng"),b={sha1:e,sha256:t,md5:v("./md5")},s=64,a=new u(s);function r(e,n){var r=b[e=e||"sha1"],o=[];return r||i("algorithm:",e,"is not yet supported"),{update:function(e){return u.isBuffer(e)||(e=new u(e)),o.push(e),e.length,this},digest:function(e){var t=u.concat(o),t=n?function(e,t,n){u.isBuffer(t)||(t=new u(t)),u.isBuffer(n)||(n=new u(n)),t.length>s?t=e(t):t.length<s&&(t=u.concat([t,a],s));for(var r=new u(s),o=new u(s),i=0;i<s;i++)r[i]=54^t[i],o[i]=92^t[i];return n=e(u.concat([r,n])),e(u.concat([o,n]))}(r,n,t):r(t);return o=null,e?t.toString(e):t}}}function i(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}a.fill(0),_.createHash=function(e){return r(e)},_.createHmac=r,_.randomBytes=function(e,t){if(!t||!t.call)return new u(n(e));try{t.call(this,void 0,new u(n(e)));}catch(e){t(e);}};var o,f=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],m=function(e){_[e]=function(){i("sorry,",e,"is not implemented yet");};};for(o in f)m(f[o]);}.call(this,v("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},v("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(w,b,e){!function(e,r,o,i,u,a,f,l,y){var t=w("./helpers");function n(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,u=0;u<e.length;u+=16){var s=n,a=r,f=o,l=i,n=c(n,r,o,i,e[u+0],7,-680876936),i=c(i,n,r,o,e[u+1],12,-389564586),o=c(o,i,n,r,e[u+2],17,606105819),r=c(r,o,i,n,e[u+3],22,-1044525330);n=c(n,r,o,i,e[u+4],7,-176418897),i=c(i,n,r,o,e[u+5],12,1200080426),o=c(o,i,n,r,e[u+6],17,-1473231341),r=c(r,o,i,n,e[u+7],22,-45705983),n=c(n,r,o,i,e[u+8],7,1770035416),i=c(i,n,r,o,e[u+9],12,-1958414417),o=c(o,i,n,r,e[u+10],17,-42063),r=c(r,o,i,n,e[u+11],22,-1990404162),n=c(n,r,o,i,e[u+12],7,1804603682),i=c(i,n,r,o,e[u+13],12,-40341101),o=c(o,i,n,r,e[u+14],17,-1502002290),n=d(n,r=c(r,o,i,n,e[u+15],22,1236535329),o,i,e[u+1],5,-165796510),i=d(i,n,r,o,e[u+6],9,-1069501632),o=d(o,i,n,r,e[u+11],14,643717713),r=d(r,o,i,n,e[u+0],20,-373897302),n=d(n,r,o,i,e[u+5],5,-701558691),i=d(i,n,r,o,e[u+10],9,38016083),o=d(o,i,n,r,e[u+15],14,-660478335),r=d(r,o,i,n,e[u+4],20,-405537848),n=d(n,r,o,i,e[u+9],5,568446438),i=d(i,n,r,o,e[u+14],9,-1019803690),o=d(o,i,n,r,e[u+3],14,-187363961),r=d(r,o,i,n,e[u+8],20,1163531501),n=d(n,r,o,i,e[u+13],5,-1444681467),i=d(i,n,r,o,e[u+2],9,-51403784),o=d(o,i,n,r,e[u+7],14,1735328473),n=h(n,r=d(r,o,i,n,e[u+12],20,-1926607734),o,i,e[u+5],4,-378558),i=h(i,n,r,o,e[u+8],11,-2022574463),o=h(o,i,n,r,e[u+11],16,1839030562),r=h(r,o,i,n,e[u+14],23,-35309556),n=h(n,r,o,i,e[u+1],4,-1530992060),i=h(i,n,r,o,e[u+4],11,1272893353),o=h(o,i,n,r,e[u+7],16,-155497632),r=h(r,o,i,n,e[u+10],23,-1094730640),n=h(n,r,o,i,e[u+13],4,681279174),i=h(i,n,r,o,e[u+0],11,-358537222),o=h(o,i,n,r,e[u+3],16,-722521979),r=h(r,o,i,n,e[u+6],23,76029189),n=h(n,r,o,i,e[u+9],4,-640364487),i=h(i,n,r,o,e[u+12],11,-421815835),o=h(o,i,n,r,e[u+15],16,530742520),n=p(n,r=h(r,o,i,n,e[u+2],23,-995338651),o,i,e[u+0],6,-198630844),i=p(i,n,r,o,e[u+7],10,1126891415),o=p(o,i,n,r,e[u+14],15,-1416354905),r=p(r,o,i,n,e[u+5],21,-57434055),n=p(n,r,o,i,e[u+12],6,1700485571),i=p(i,n,r,o,e[u+3],10,-1894986606),o=p(o,i,n,r,e[u+10],15,-1051523),r=p(r,o,i,n,e[u+1],21,-2054922799),n=p(n,r,o,i,e[u+8],6,1873313359),i=p(i,n,r,o,e[u+15],10,-30611744),o=p(o,i,n,r,e[u+6],15,-1560198380),r=p(r,o,i,n,e[u+13],21,1309151649),n=p(n,r,o,i,e[u+4],6,-145523070),i=p(i,n,r,o,e[u+11],10,-1120210379),o=p(o,i,n,r,e[u+2],15,718787259),r=p(r,o,i,n,e[u+9],21,-343485551),n=g(n,s),r=g(r,a),o=g(o,f),i=g(i,l);}return Array(n,r,o,i)}function s(e,t,n,r,o,i){return g((t=g(g(t,e),g(r,i)))<<o|t>>>32-o,n)}function c(e,t,n,r,o,i,u){return s(t&n|~t&r,e,t,o,i,u)}function d(e,t,n,r,o,i,u){return s(t&r|n&~r,e,t,o,i,u)}function h(e,t,n,r,o,i,u){return s(t^n^r,e,t,o,i,u)}function p(e,t,n,r,o,i,u){return s(n^(t|~r),e,t,o,i,u)}function g(e,t){var n=(65535&e)+(65535&t);return (e>>16)+(t>>16)+(n>>16)<<16|65535&n}b.exports=function(e){return t.hash(e,n,16)};}.call(this,w("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,l,t){!function(e,t,n,r,o,i,u,s,f){l.exports=function(e){for(var t,n=new Array(e),r=0;r<e;r++)0==(3&r)&&(t=4294967296*Math.random()),n[r]=t>>>((3&r)<<3)&255;return n};}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{buffer:3,lYpoI2:11}],8:[function(c,d,e){!function(e,t,n,r,o,s,a,f,l){var i=c("./helpers");function u(l,c){l[c>>5]|=128<<24-c%32,l[15+(c+64>>9<<4)]=c;for(var e,t,n,r=Array(80),o=1732584193,i=-271733879,u=-1732584194,s=271733878,d=-1009589776,h=0;h<l.length;h+=16){for(var p=o,g=i,y=u,w=s,b=d,a=0;a<80;a++){r[a]=a<16?l[h+a]:v(r[a-3]^r[a-8]^r[a-14]^r[a-16],1);var f=m(m(v(o,5),(f=i,t=u,n=s,(e=a)<20?f&t|~f&n:!(e<40)&&e<60?f&t|f&n|t&n:f^t^n)),m(m(d,r[a]),(e=a)<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514)),d=s,s=u,u=v(i,30),i=o,o=f;}o=m(o,p),i=m(i,g),u=m(u,y),s=m(s,w),d=m(d,b);}return Array(o,i,u,s,d)}function m(e,t){var n=(65535&e)+(65535&t);return (e>>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t){return e<<t|e>>>32-t}d.exports=function(e){return i.hash(e,u,20,true)};}.call(this,c("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(c,d,e){!function(e,t,n,r,u,s,a,f,l){function b(e,t){var n=(65535&e)+(65535&t);return (e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,l){var c,d=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),t=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),n=new Array(64);e[l>>5]|=128<<24-l%32,e[15+(l+64>>9<<4)]=l;for(var r,o,h=0;h<e.length;h+=16){for(var i=t[0],u=t[1],s=t[2],p=t[3],a=t[4],g=t[5],y=t[6],w=t[7],f=0;f<64;f++)n[f]=f<16?e[f+h]:b(b(b((o=n[f-2],m(o,17)^m(o,19)^v(o,10)),n[f-7]),(o=n[f-15],m(o,7)^m(o,18)^v(o,3))),n[f-16]),c=b(b(b(b(w,m(o=a,6)^m(o,11)^m(o,25)),a&g^~a&y),d[f]),n[f]),r=b(m(r=i,2)^m(r,13)^m(r,22),i&u^i&s^u&s),w=y,y=g,g=a,a=b(p,c),p=s,s=u,u=i,i=b(c,r);t[0]=b(i,t[0]),t[1]=b(u,t[1]),t[2]=b(s,t[2]),t[3]=b(p,t[3]),t[4]=b(a,t[4]),t[5]=b(g,t[5]),t[6]=b(y,t[6]),t[7]=b(w,t[7]);}return t}var i=c("./helpers"),m=function(e,t){return e>>>t|e<<32-t},v=function(e,t){return e>>>t};d.exports=function(e){return i.hash(e,o,32,true)};}.call(this,c("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,f){!function(e,t,n,r,o,i,u,s,a){f.read=function(e,t,n,r,o){var i,u,l=8*o-r-1,c=(1<<l)-1,d=c>>1,s=-7,a=n?o-1:0,f=n?-1:1,o=e[t+a];for(a+=f,i=o&(1<<-s)-1,o>>=-s,s+=l;0<s;i=256*i+e[t+a],a+=f,s-=8);for(u=i&(1<<-s)-1,i>>=-s,s+=r;0<s;u=256*u+e[t+a],a+=f,s-=8);if(0===i)i=1-d;else {if(i===c)return u?NaN:1/0*(o?-1:1);u+=Math.pow(2,r),i-=d;}return (o?-1:1)*u*Math.pow(2,i-r)},f.write=function(e,t,l,n,r,c){var o,i,u=8*c-r-1,s=(1<<u)-1,a=s>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:c-1,h=n?1:-1,c=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,o=s):(o=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(t+=1<=o+a?d/n:d*Math.pow(2,1-a))*n&&(o++,n/=2),s<=o+a?(i=0,o=s):1<=o+a?(i=(t*n-1)*Math.pow(2,r),o+=a):(i=t*Math.pow(2,a-1)*Math.pow(2,r),o=0));8<=r;e[l+f]=255&i,f+=h,i/=256,r-=8);for(o=o<<r|i,u+=r;0<u;e[l+f]=255&o,f+=h,o/=256,u-=8);e[l+f-h]|=128*c;};}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754");},{buffer:3,lYpoI2:11}],11:[function(e,h,t){!function(e,t,n,r,o,f,l,c,d){var i,u,s;function a(){}(e=h.exports={}).nextTick=(u="undefined"!=typeof window&&window.setImmediate,s="undefined"!=typeof window&&window.postMessage&&window.addEventListener,u?function(e){return window.setImmediate(e)}:s?(i=[],window.addEventListener("message",function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<i.length&&i.shift()());},true),function(e){i.push(e),window.postMessage("process-tick","*");}):function(e){setTimeout(e,0);}),e.title="browser",e.browser=true,e.env={},e.argv=[],e.on=a,e.addListener=a,e.once=a,e.off=a,e.removeListener=a,e.removeAllListeners=a,e.emit=a,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return "/"},e.chdir=function(e){throw new Error("process.chdir is not supported")};}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process");},{buffer:3,lYpoI2:11}]},{},[1])(1)});
|
|
421
|
+
} (object_hash$1));
|
|
422
|
+
return object_hash$1.exports;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
var object_hashExports = requireObject_hash();
|
|
426
|
+
var object_hash = /*@__PURE__*/getDefaultExportFromCjs(object_hashExports);
|
|
427
|
+
|
|
428
|
+
export { DefaultMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, commonHead, compareNatural, compareRelations, delay, difference, equals as equalsSet, getOrCreate, hasAtLeast, ifilter, ifind, iflat, imap, intersection, ireduce, isIterable, isNonEmptyArray, isString, isome, iunique, object_hash as objectHash, stringHash, symmetricDifference, toArray, toSet, union };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as t,
|
|
2
|
-
export { D as DefaultMap, e as LinkedList, q as Queue, S as Stack,
|
|
1
|
+
import { d as t, a0 as n, o as commonAncestor, s as compareFqnHierarchically } from '../shared/core.CHsHWcLq.mjs';
|
|
2
|
+
export { D as DefaultMap, e as DefaultWeakMap, f as LinkedList, g as MultiMap, q as Queue, S as Stack, k as ancestorsFqn, h as commonHead, r as compareByFqnHierarchically, j as compareNatural, M as difference, N as equalsSet, B as getOrCreate, a as hasAtLeast, u as hierarchyDistance, v as hierarchyLevel, F as ifilter, i as ifind, G as iflat, H as imap, O as intersection, w as isAncestor, x as isDescendantOf, I as isIterable, C as isNonEmptyArray, c as isSameHierarchy, E as isString, J as isome, K as iunique, n as nameFromFqn, T as objectHash, p as parentFqn, y as sortByFqnHierarchically, z as sortNaturalByFqn, A as sortParentsFirst, R as stringHash, P as symmetricDifference, L as toArray, t as toSet, Q as union } from '../shared/core.CHsHWcLq.mjs';
|
|
3
3
|
import { i as invariant } from '../shared/core.Btj1m6H6.mjs';
|
|
4
4
|
|
|
5
5
|
function o(r,n){let e=Math.ceil(r),t=Math.floor(n);if(t<e)throw new RangeError(`randomInteger: The range [${r.toString()},${n.toString()}] contains no integer`);return Math.floor(Math.random()*(t-e+1)+e)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -23,10 +23,6 @@
|
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"sources": "./src/index.ts",
|
|
26
|
-
"require": {
|
|
27
|
-
"types": "./dist/index.d.cts",
|
|
28
|
-
"default": "./dist/index.cjs"
|
|
29
|
-
},
|
|
30
26
|
"default": {
|
|
31
27
|
"types": "./dist/index.d.mts",
|
|
32
28
|
"import": "./dist/index.mjs",
|
|
@@ -35,10 +31,6 @@
|
|
|
35
31
|
},
|
|
36
32
|
"./builder": {
|
|
37
33
|
"sources": "./src/builder/index.ts",
|
|
38
|
-
"require": {
|
|
39
|
-
"types": "./dist/builder/index.d.cts",
|
|
40
|
-
"default": "./dist/builder/index.cjs"
|
|
41
|
-
},
|
|
42
34
|
"default": {
|
|
43
35
|
"types": "./dist/builder/index.d.mts",
|
|
44
36
|
"import": "./dist/builder/index.mjs",
|
|
@@ -47,10 +39,6 @@
|
|
|
47
39
|
},
|
|
48
40
|
"./compute-view": {
|
|
49
41
|
"sources": "./src/compute-view/index.ts",
|
|
50
|
-
"require": {
|
|
51
|
-
"types": "./dist/compute-view/index.d.cts",
|
|
52
|
-
"default": "./dist/compute-view/index.cjs"
|
|
53
|
-
},
|
|
54
42
|
"default": {
|
|
55
43
|
"types": "./dist/compute-view/index.d.mts",
|
|
56
44
|
"import": "./dist/compute-view/index.mjs",
|
|
@@ -59,10 +47,6 @@
|
|
|
59
47
|
},
|
|
60
48
|
"./model": {
|
|
61
49
|
"sources": "./src/model/index.ts",
|
|
62
|
-
"require": {
|
|
63
|
-
"types": "./dist/model/index.d.cts",
|
|
64
|
-
"default": "./dist/model/index.cjs"
|
|
65
|
-
},
|
|
66
50
|
"default": {
|
|
67
51
|
"types": "./dist/model/index.d.mts",
|
|
68
52
|
"import": "./dist/model/index.mjs",
|
|
@@ -71,10 +55,6 @@
|
|
|
71
55
|
},
|
|
72
56
|
"./utils": {
|
|
73
57
|
"sources": "./src/utils/index.ts",
|
|
74
|
-
"require": {
|
|
75
|
-
"types": "./dist/utils/index.d.cts",
|
|
76
|
-
"default": "./dist/utils/index.cjs"
|
|
77
|
-
},
|
|
78
58
|
"default": {
|
|
79
59
|
"types": "./dist/utils/index.d.mts",
|
|
80
60
|
"import": "./dist/utils/index.mjs",
|
|
@@ -83,10 +63,6 @@
|
|
|
83
63
|
},
|
|
84
64
|
"./types": {
|
|
85
65
|
"sources": "./src/types/index.ts",
|
|
86
|
-
"require": {
|
|
87
|
-
"types": "./dist/types/index.d.cts",
|
|
88
|
-
"default": "./dist/types/index.cjs"
|
|
89
|
-
},
|
|
90
66
|
"default": {
|
|
91
67
|
"types": "./dist/types/index.d.mts",
|
|
92
68
|
"import": "./dist/types/index.mjs",
|
|
@@ -111,16 +87,16 @@
|
|
|
111
87
|
"graphology": "^0.25.4",
|
|
112
88
|
"graphology-dag": "^0.4.1",
|
|
113
89
|
"graphology-types": "^0.24.8",
|
|
114
|
-
"mnemonist": "
|
|
90
|
+
"mnemonist": "0.40.2",
|
|
115
91
|
"natural-compare-lite": "^1.4.0",
|
|
116
92
|
"object-hash": "^3.0.0",
|
|
117
93
|
"obliterator": "^2.0.5",
|
|
118
|
-
"remeda": "^2.20.
|
|
94
|
+
"remeda": "^2.20.2",
|
|
119
95
|
"turbo": "^2.4.2",
|
|
120
96
|
"typescript": "5.7.3",
|
|
121
97
|
"unbuild": "^3.3.1",
|
|
122
|
-
"vitest": "^3.0.
|
|
123
|
-
"@likec4/tsconfig": "1.
|
|
98
|
+
"vitest": "^3.0.6",
|
|
99
|
+
"@likec4/tsconfig": "1.24.1"
|
|
124
100
|
},
|
|
125
101
|
"scripts": {
|
|
126
102
|
"typecheck": "tsc --noEmit",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DefaultMap } from 'mnemonist'
|
|
2
1
|
import {
|
|
3
2
|
dropWhile,
|
|
4
3
|
filter,
|
|
@@ -25,6 +24,7 @@ import { findConnection } from '../../model/connection/deployment'
|
|
|
25
24
|
import { RelationshipsAccum } from '../../model/DeploymentElementModel'
|
|
26
25
|
import type { RelationshipModel } from '../../model/RelationModel'
|
|
27
26
|
import { imap, toArray } from '../../utils/iterable'
|
|
27
|
+
import { DefaultMap } from '../../utils/mnemonist'
|
|
28
28
|
import { intersection, union } from '../../utils/set'
|
|
29
29
|
import type { Connection, Connections } from './_types'
|
|
30
30
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DefaultMap } from 'mnemonist'
|
|
2
1
|
import { forEach, only, pipe } from 'remeda'
|
|
3
2
|
import { differenceConnections } from '../../../model/connection'
|
|
4
3
|
import type { RelationshipModel } from '../../../model/RelationModel'
|
|
5
4
|
import { isAncestor, sortByFqnHierarchically } from '../../../utils/fqn'
|
|
6
5
|
import { ifilter, isome, toArray } from '../../../utils/iterable'
|
|
6
|
+
import { DefaultMap } from '../../../utils/mnemonist'
|
|
7
7
|
import { difference, union } from '../../../utils/set'
|
|
8
8
|
import { treeFromMemoryState } from '../../memory'
|
|
9
9
|
import { cleanCrossBoundary, cleanRedundantRelationships } from '../clean-connections'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DefaultMap } from 'mnemonist'
|
|
2
1
|
import { filter, findLast, forEach, map, pipe } from 'remeda'
|
|
3
2
|
import { invariant, nonexhaustive, nonNullable } from '../../errors'
|
|
4
3
|
import { ConnectionModel } from '../../model/connection/model/ConnectionModel'
|
|
@@ -17,6 +16,7 @@ import type {
|
|
|
17
16
|
import { isViewRuleAutoLayout, isViewRuleGroup, isViewRulePredicate, whereOperatorAsPredicate } from '../../types'
|
|
18
17
|
import * as Expr from '../../types/expression'
|
|
19
18
|
import { sortParentsFirst } from '../../utils'
|
|
19
|
+
import { DefaultMap } from '../../utils/mnemonist'
|
|
20
20
|
import { applyCustomElementProperties } from '../utils/applyCustomElementProperties'
|
|
21
21
|
import { applyCustomRelationProperties } from '../utils/applyCustomRelationProperties'
|
|
22
22
|
import { applyViewRuleStyles } from '../utils/applyViewRuleStyles'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack } from 'mnemonist'
|
|
2
1
|
import { nonNullable } from '../../../errors'
|
|
3
2
|
import type { ConnectionModel } from '../../../model/connection'
|
|
4
3
|
import type { ElementModel } from '../../../model/ElementModel'
|
|
5
4
|
import type { Expression, NodeId, ViewRuleGroup } from '../../../types'
|
|
5
|
+
import { Stack } from '../../../utils/mnemonist'
|
|
6
6
|
import { type ComputeCtx, type CtxElement, type MutableState, type StageExpression, AbstractMemory } from '../../memory'
|
|
7
7
|
import { NodesGroup } from './NodeGroup'
|
|
8
8
|
import { ActiveGroupStageExclude, StageExclude } from './stage-exclude'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DefaultMap } from 'mnemonist'
|
|
2
1
|
import { Connection } from '../../model'
|
|
3
2
|
import { isAncestor, sortParentsFirst } from '../../utils'
|
|
4
3
|
import { toArray } from '../../utils/iterable'
|
|
4
|
+
import { DefaultMap } from '../../utils/mnemonist'
|
|
5
5
|
import type { AnyCtx, ComputeMemory, CtxElement } from './_types'
|
|
6
6
|
|
|
7
7
|
export function treeFromMemoryState<T extends AnyCtx, M extends ComputeMemory<T> = ComputeMemory<T>>(
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import dagre, { type EdgeConfig, type GraphLabel } from '@dagrejs/dagre'
|
|
2
|
-
import { DefaultMap } from 'mnemonist'
|
|
3
2
|
import { concat, filter, forEachObj, groupBy, map, mapToObj, pipe, prop, reduce, tap } from 'remeda'
|
|
4
3
|
import { invariant } from '../../errors'
|
|
5
4
|
import type { ElementModel } from '../../model/ElementModel'
|
|
@@ -7,6 +6,7 @@ import type { RelationshipModel } from '../../model/RelationModel'
|
|
|
7
6
|
import type { DiagramNode, DiagramView, Fqn, NodeId } from '../../types'
|
|
8
7
|
import { sortParentsFirst } from '../../utils'
|
|
9
8
|
import { toArray } from '../../utils/iterable'
|
|
9
|
+
import { DefaultMap } from '../../utils/mnemonist'
|
|
10
10
|
import type { RelationshipsViewData } from './_types'
|
|
11
11
|
import { treeFromElements } from './utils'
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DefaultMap } from 'mnemonist'
|
|
2
1
|
import { nonNullable } from '../../errors'
|
|
3
2
|
import type { ElementModel } from '../../model/ElementModel'
|
|
4
3
|
import type { Fqn } from '../../types'
|
|
5
4
|
import { isAncestor, isDescendantOf, sortParentsFirst } from '../../utils/fqn'
|
|
5
|
+
import { DefaultMap } from '../../utils/mnemonist'
|
|
6
6
|
|
|
7
7
|
export function treeFromElements(elements: Iterable<ElementModel>) {
|
|
8
8
|
const sorted = sortParentsFirst([...elements]) as ReadonlyArray<ElementModel>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type DeploymentNode,
|
|
9
9
|
type DeploymentNodeKind,
|
|
10
10
|
type DeploymentRelation,
|
|
11
|
+
type ElementKind,
|
|
11
12
|
type ElementShape as C4ElementShape,
|
|
12
13
|
type IteratorLike,
|
|
13
14
|
type Link,
|
|
@@ -43,6 +44,7 @@ abstract class AbstractDeploymentElementModel<M extends AnyAux = AnyAux> {
|
|
|
43
44
|
|
|
44
45
|
abstract readonly $model: LikeC4DeploymentModel<M>
|
|
45
46
|
abstract readonly $node: DeploymentNode | DeployedInstance
|
|
47
|
+
abstract readonly kind: DeploymentNodeKind | ElementKind
|
|
46
48
|
|
|
47
49
|
get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color' | 'size'> {
|
|
48
50
|
return {
|
|
@@ -65,10 +67,6 @@ abstract class AbstractDeploymentElementModel<M extends AnyAux = AnyAux> {
|
|
|
65
67
|
return this.$node.tags ?? []
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
get kind(): DeploymentNodeKind | string | null {
|
|
69
|
-
return this.$node.kind ?? null
|
|
70
|
-
}
|
|
71
|
-
|
|
72
70
|
get description(): string | null {
|
|
73
71
|
return this.$node.description ?? null
|
|
74
72
|
}
|
|
@@ -375,8 +373,8 @@ export class DeployedInstanceModel<M extends AnyAux = AnyAux> extends AbstractDe
|
|
|
375
373
|
return this.$instance.tags ?? []
|
|
376
374
|
}
|
|
377
375
|
|
|
378
|
-
override get kind():
|
|
379
|
-
return this
|
|
376
|
+
override get kind(): ElementKind {
|
|
377
|
+
return this.element.kind
|
|
380
378
|
}
|
|
381
379
|
|
|
382
380
|
override get description(): string | null {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DefaultMap } from 'mnemonist'
|
|
2
1
|
import { values } from 'remeda'
|
|
3
2
|
import type { LiteralUnion } from 'type-fest'
|
|
4
3
|
import { invariant, nonNullable } from '../errors'
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
import { ancestorsFqn, parentFqn, sortParentsFirst } from '../utils/fqn'
|
|
15
14
|
import { getOrCreate } from '../utils/getOrCreate'
|
|
16
15
|
import { isString } from '../utils/guards'
|
|
16
|
+
import { DefaultMap } from '../utils/mnemonist'
|
|
17
17
|
import {
|
|
18
18
|
type DeployedInstancesIterator,
|
|
19
19
|
type DeploymentElementModel,
|
package/src/model/LikeC4Model.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DefaultMap } from 'mnemonist'
|
|
2
1
|
import { mapValues, pipe, sort, values } from 'remeda'
|
|
3
2
|
import type { LiteralUnion } from 'type-fest'
|
|
4
3
|
import { computeView, unsafeComputeView } from '../compute-view'
|
|
@@ -11,6 +10,7 @@ import type { AnyParsedLikeC4Model, GenericLikeC4Model, LikeC4ModelDump } from '
|
|
|
11
10
|
import type { ModelRelation } from '../types/relation'
|
|
12
11
|
import { compareNatural } from '../utils'
|
|
13
12
|
import { ancestorsFqn, commonAncestor, parentFqn } from '../utils/fqn'
|
|
13
|
+
import { DefaultMap } from '../utils/mnemonist'
|
|
14
14
|
import type {
|
|
15
15
|
DeployedInstanceModel,
|
|
16
16
|
DeploymentElementModel,
|
|
@@ -86,7 +86,7 @@ export class LikeC4Model<M extends AnyAux = LikeC4Model.Any> {
|
|
|
86
86
|
*/
|
|
87
87
|
static makeCompute<M extends AnyParsedLikeC4Model>(parsed: M): (viewsource: LikeC4View) => ComputeViewResult {
|
|
88
88
|
let { views, ...rest } = parsed as Omit<M, '__'>
|
|
89
|
-
const model = new LikeC4Model(
|
|
89
|
+
const model = new LikeC4Model({ ...rest, views: {} })
|
|
90
90
|
return (viewsource) => computeView(viewsource, model)
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -417,6 +417,27 @@ export class LikeC4Model<M extends AnyAux = LikeC4Model.Any> {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
export namespace LikeC4Model {
|
|
420
|
+
export const EMPTY = LikeC4Model.create({
|
|
421
|
+
specification: {
|
|
422
|
+
elements: {},
|
|
423
|
+
relationships: {},
|
|
424
|
+
deployments: {},
|
|
425
|
+
tags: [],
|
|
426
|
+
},
|
|
427
|
+
globals: {
|
|
428
|
+
predicates: {},
|
|
429
|
+
dynamicPredicates: {},
|
|
430
|
+
styles: {},
|
|
431
|
+
},
|
|
432
|
+
deployments: {
|
|
433
|
+
elements: {},
|
|
434
|
+
relations: {},
|
|
435
|
+
},
|
|
436
|
+
elements: {},
|
|
437
|
+
relations: {},
|
|
438
|
+
views: {},
|
|
439
|
+
}) as LikeC4Model<AnyAux>
|
|
440
|
+
|
|
420
441
|
export type Any = Aux<
|
|
421
442
|
string,
|
|
422
443
|
string,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { sort } from 'remeda'
|
|
2
1
|
import { nonNullable } from '../../errors'
|
|
3
2
|
import type { IteratorLike } from '../../types'
|
|
4
3
|
import type { Link, Tag } from '../../types/element'
|
|
@@ -16,7 +15,7 @@ import {
|
|
|
16
15
|
isElementView,
|
|
17
16
|
isScopedElementView,
|
|
18
17
|
} from '../../types/view'
|
|
19
|
-
import {
|
|
18
|
+
import { DefaultMap, ifind } from '../../utils'
|
|
20
19
|
import type { ElementModel } from '../ElementModel'
|
|
21
20
|
import type { LikeC4Model } from '../LikeC4Model'
|
|
22
21
|
import { type AnyAux, getId } from '../types'
|
|
@@ -32,13 +31,13 @@ export class LikeC4ViewModel<M extends AnyAux, V extends ComputedView | DiagramV
|
|
|
32
31
|
readonly #includeElements = new Set<M['Element']>()
|
|
33
32
|
readonly #includeDeployments = new Set<M['Deployment']>()
|
|
34
33
|
readonly #includeRelations = new Set<M['RelationId']>()
|
|
35
|
-
readonly #allTags = new
|
|
34
|
+
readonly #allTags = new DefaultMap((_key: Tag) => new Set<NodeModel<M, V> | EdgeModel<M, V>>())
|
|
36
35
|
|
|
37
36
|
constructor(
|
|
38
37
|
public readonly $model: LikeC4Model<M>,
|
|
39
38
|
public readonly $view: V,
|
|
40
39
|
) {
|
|
41
|
-
for (const node of
|
|
40
|
+
for (const node of $view.nodes) {
|
|
42
41
|
const el = new NodeModel(this, Object.freeze(node))
|
|
43
42
|
this.#nodes.set(node.id, el)
|
|
44
43
|
if (!node.parent) {
|
|
@@ -51,7 +50,7 @@ export class LikeC4ViewModel<M extends AnyAux, V extends ComputedView | DiagramV
|
|
|
51
50
|
this.#includeElements.add(el.element.id)
|
|
52
51
|
}
|
|
53
52
|
for (const tag of el.tags) {
|
|
54
|
-
|
|
53
|
+
this.#allTags.get(tag).add(el)
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
|
|
@@ -63,7 +62,7 @@ export class LikeC4ViewModel<M extends AnyAux, V extends ComputedView | DiagramV
|
|
|
63
62
|
this.node(edge.target),
|
|
64
63
|
)
|
|
65
64
|
for (const tag of edgeModel.tags) {
|
|
66
|
-
|
|
65
|
+
this.#allTags.get(tag).add(edgeModel)
|
|
67
66
|
}
|
|
68
67
|
for (const rel of edge.relations) {
|
|
69
68
|
this.#includeRelations.add(rel)
|
package/src/types/deployments.ts
CHANGED
|
@@ -42,7 +42,6 @@ export interface DeployedInstance {
|
|
|
42
42
|
readonly title?: string
|
|
43
43
|
readonly description?: string | null
|
|
44
44
|
readonly technology?: string | null
|
|
45
|
-
readonly kind?: string | null // TODO: ensure the property is set
|
|
46
45
|
readonly tags?: NonEmptyArray<Tag> | null
|
|
47
46
|
readonly links?: NonEmptyArray<Link> | null
|
|
48
47
|
readonly style?: DeploymentElementStyle
|
package/src/types/index.ts
CHANGED
package/src/types/theme.ts
CHANGED
package/src/utils/index.ts
CHANGED
package/src/utils/set.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
intersection as _intersection,
|
|
3
|
+
symmetricDifference as _symmetricDifference,
|
|
4
|
+
} from 'mnemonist/patch'
|
|
5
|
+
|
|
2
6
|
import { hasAtLeast } from 'remeda'
|
|
3
7
|
import type { NonEmptyArray } from '../types/_common'
|
|
4
8
|
|
|
5
|
-
const { intersection: _intersection, symmetricDifference: _symmetricDifference } = set
|
|
6
|
-
|
|
7
9
|
/**
|
|
8
10
|
* Returns new set as a union of given sets
|
|
9
11
|
* Keeps order of elements
|