archidocs 1.3.3 → 1.4.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/dev.js +4 -1
- package/dist/core/load.js +7 -1
- package/dist/core/rules.js +2 -2
- package/dist/core/views/deployment.d.ts +4 -0
- package/dist/core/views/deployment.js +15 -1
- package/dist/core/views/generated.d.ts +3 -1
- package/dist/core/views/generated.js +9 -2
- package/dist/core/views/index.d.ts +1 -0
- package/dist/core/views/index.js +1 -0
- package/dist/core/views/resolve.js +3 -3
- package/dist/core/views/save-as-view.d.ts +8 -3
- package/dist/core/views/save-as-view.js +16 -6
- package/dist/core/views/types.d.ts +9 -1
- package/dist/mcp/server.js +8 -4
- package/dist/mcp/writes.js +4 -1
- package/dist/render/index.d.ts +1 -1
- package/dist/render/index.js +1 -1
- package/dist/render/layout.d.ts +3 -1
- package/dist/render/layout.js +6 -1
- package/dist/render/sequence.d.ts +6 -3
- package/dist/render/sequence.js +7 -4
- package/dist/render/svg.d.ts +3 -1
- package/dist/render/svg.js +48 -10
- package/dist/render/tokens.d.ts +8 -0
- package/dist/render/tokens.js +12 -0
- package/dist/schema/bundle.d.ts +8 -0
- package/dist/schema/bundle.js +2 -0
- package/dist/schema/workspace.d.ts +17 -0
- package/dist/schema/workspace.js +19 -1
- package/dist/viewer/assets/font-BEgf3E5J.js +1 -0
- package/dist/viewer/assets/index-CzXU8F_3.css +1 -0
- package/dist/viewer/assets/index-DmVLe9LK.js +75 -0
- package/dist/viewer/assets/layout.worker-ueOYAv7N.js +63 -0
- package/dist/viewer/assets/png-D-pNKY71.js +1 -0
- package/dist/viewer/assets/rolldown-runtime-pP25SEvz.js +1 -0
- package/dist/viewer/assets/sequence-svg-BtEmwvN4.js +2 -0
- package/dist/viewer/assets/svg-DXIkkkSu.js +2 -0
- package/dist/viewer/assets/teams-N-WbqOXA.js +66 -0
- package/dist/viewer/index.html +5 -2
- package/guide/topics/deployments.md +17 -3
- package/package.json +1 -1
- package/schemas/model.schema.json +35 -1
- package/dist/viewer/assets/index-BhiW2o_9.js +0 -138
- package/dist/viewer/assets/index-YFA-pYjQ.css +0 -1
- package/dist/viewer/assets/layout.worker-BRHAGJrD.js +0 -26
- package/dist/viewer/assets/png-CJovcggr.js +0 -1
- package/dist/viewer/assets/svg-Cg6M1xWg.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./font-BEgf3E5J.js";var n,r=Array(128).fill(void 0);r.push(void 0,null,!0,!1);var i=r.length;function a(e){i===r.length&&r.push(r.length+1);let t=i;return i=r[t],r[t]=e,t}function o(e){return r[e]}function s(e){e<132||(r[e]=i,i=e)}function c(e){let t=o(e);return s(e),t}var l=0,u=null;function d(){return(u===null||u.byteLength===0)&&(u=new Uint8Array(n.memory.buffer)),u}var f=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},p=typeof f.encodeInto==`function`?function(e,t){return f.encodeInto(e,t)}:function(e,t){let n=f.encode(e);return t.set(n),{read:e.length,written:n.length}};function m(e,t,n){if(n===void 0){let n=f.encode(e),r=t(n.length,1)>>>0;return d().subarray(r,r+n.length).set(n),l=n.length,r}let r=e.length,i=t(r,1)>>>0,a=d(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=d().subarray(i+o,i+r),a=p(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return l=o,i}function h(e){return e==null}var g=null;function _(){return(g===null||g.byteLength===0)&&(g=new Int32Array(n.memory.buffer)),g}var v=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&v.decode();function y(e,t){return e>>>=0,v.decode(d().subarray(e,e+t))}function b(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`);return e.ptr}function x(e,t){try{return e.apply(this,t)}catch(e){n.__wbindgen_exn_store(a(e))}}var S=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_bbox_free(e>>>0)),C=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,S.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,S.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_bbox_free(e)}get x(){return n.__wbg_get_bbox_x(this.__wbg_ptr)}set x(e){n.__wbg_set_bbox_x(this.__wbg_ptr,e)}get y(){return n.__wbg_get_bbox_y(this.__wbg_ptr)}set y(e){n.__wbg_set_bbox_y(this.__wbg_ptr,e)}get width(){return n.__wbg_get_bbox_width(this.__wbg_ptr)}set width(e){n.__wbg_set_bbox_width(this.__wbg_ptr,e)}get height(){return n.__wbg_get_bbox_height(this.__wbg_ptr)}set height(e){n.__wbg_set_bbox_height(this.__wbg_ptr,e)}},w=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_renderedimage_free(e>>>0)),T=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,w.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,w.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_renderedimage_free(e)}get width(){return n.renderedimage_width(this.__wbg_ptr)>>>0}get height(){return n.renderedimage_height(this.__wbg_ptr)>>>0}asPng(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.renderedimage_asPng(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return c(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}get pixels(){return c(n.renderedimage_pixels(this.__wbg_ptr))}},E=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_resvg_free(e>>>0)),D=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_resvg_free(e)}constructor(e,t,r){try{let d=n.__wbindgen_add_to_stack_pointer(-16);var i=h(t)?0:m(t,n.__wbindgen_malloc,n.__wbindgen_realloc),o=l;n.resvg_new(d,a(e),i,o,h(r)?0:a(r));var s=_()[d/4+0],u=_()[d/4+1];if(_()[d/4+2])throw c(u);return this.__wbg_ptr=s>>>0,this}finally{n.__wbindgen_add_to_stack_pointer(16)}}get width(){return n.resvg_width(this.__wbg_ptr)}get height(){return n.resvg_height(this.__wbg_ptr)}render(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_render(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return T.__wrap(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}toString(){let e,t;try{let a=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_toString(a,this.__wbg_ptr);var r=_()[a/4+0],i=_()[a/4+1];return e=r,t=i,y(r,i)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}innerBBox(){let e=n.resvg_innerBBox(this.__wbg_ptr);return e===0?void 0:C.__wrap(e)}getBBox(){let e=n.resvg_getBBox(this.__wbg_ptr);return e===0?void 0:C.__wrap(e)}cropByBBox(e){b(e,C),n.resvg_cropByBBox(this.__wbg_ptr,e.__wbg_ptr)}imagesToResolve(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_imagesToResolve(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return c(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}resolveImage(e,t){try{let i=n.__wbindgen_add_to_stack_pointer(-16),o=m(e,n.__wbindgen_malloc,n.__wbindgen_realloc),s=l;n.resvg_resolveImage(i,this.__wbg_ptr,o,s,a(t));var r=_()[i/4+0];if(_()[i/4+1])throw c(r)}finally{n.__wbindgen_add_to_stack_pointer(16)}}};async function O(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function k(){let e={};return e.wbg={},e.wbg.__wbg_new_28c511d9baebfa89=function(e,t){return a(Error(y(e,t)))},e.wbg.__wbindgen_memory=function(){let e=n.memory;return a(e)},e.wbg.__wbg_buffer_12d079cc21e14bdb=function(e){let t=o(e).buffer;return a(t)},e.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb=function(e,t,n){return a(new Uint8Array(o(e),t>>>0,n>>>0))},e.wbg.__wbindgen_object_drop_ref=function(e){c(e)},e.wbg.__wbg_new_63b92bc8671ed464=function(e){return a(new Uint8Array(o(e)))},e.wbg.__wbg_values_839f3396d5aac002=function(e){return a(o(e).values())},e.wbg.__wbg_next_196c84450b364254=function(){return x(function(e){return a(o(e).next())},arguments)},e.wbg.__wbg_done_298b57d23c0fc80c=function(e){return o(e).done},e.wbg.__wbg_value_d93c65011f51a456=function(e){let t=o(e).value;return a(t)},e.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6=function(e){let t;try{t=o(e)instanceof Uint8Array}catch{t=!1}return t},e.wbg.__wbindgen_string_get=function(e,t){let r=o(t),i=typeof r==`string`?r:void 0;var a=h(i)?0:m(i,n.__wbindgen_malloc,n.__wbindgen_realloc),s=l;_()[e/4+1]=s,_()[e/4+0]=a},e.wbg.__wbg_new_16b304a2cfa7ff4a=function(){return a([])},e.wbg.__wbindgen_string_new=function(e,t){return a(y(e,t))},e.wbg.__wbg_push_a5b05aedc7234f9f=function(e,t){return o(e).push(o(t))},e.wbg.__wbg_length_c20a40f15020d68a=function(e){return o(e).length},e.wbg.__wbg_set_a47bac70306a19a7=function(e,t,n){o(e).set(o(t),n>>>0)},e.wbg.__wbindgen_throw=function(e,t){throw Error(y(e,t))},e}function A(e,t){return n=e.exports,j.__wbindgen_wasm_module=t,g=null,u=null,n}async function j(e){if(n!==void 0)return n;e===void 0&&(e=new URL(`index_bg.wasm`,void 0));let t=k();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await O(await e,t);return A(r,i)}var M=j,N=!1,P=async e=>{if(N)throw Error("Already initialized. The `initWasm()` function can be used only once.");await M(await e),N=!0},F=class extends D{constructor(e,t){if(!N)throw Error("Wasm has not been initialized. Call `initWasm()` function.");let n=t?.font;if(n&&I(n)){let r={...t,font:{...n,fontBuffers:void 0}};super(e,JSON.stringify(r),n.fontBuffers)}else super(e,JSON.stringify(t))}};function I(e){return Object.prototype.hasOwnProperty.call(e,`fontBuffers`)}var L,R;async function z(n,r,i={}){await(L??=P(r)),R??=t.map(e=>Uint8Array.from(atob(e.base64),e=>e.charCodeAt(0)));let a=new F(n,{fitTo:{mode:`zoom`,value:i.scale??2},font:{fontBuffers:R,defaultFontFamily:e,sansSerifFamily:e}});try{let e=a.render();try{return e.asPng()}finally{e.free()}}finally{a.free()}}export{z as renderPng};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});export{l as n,c as r,o as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./index-DmVLe9LK.js";import{codeTile as r,opening as i,sourceLine as a}from"./svg-DXIkkkSu.js";import{c as o,l as s,n as c,s as l,t as u,u as d}from"./teams-N-WbqOXA.js";var f=24,p=72,m=44,h={sync:{dash:null,head:`filled`},async:{dash:null,head:`open`},return:{dash:`6 4`,head:`open`}};function g({bundle:t,view:r,source:l,brokers:h=!1,theme:g=`light`,label:S}){let C=c[g],w=new Map(t.elements.map(e=>[e.id,e])),T=e=>w.get(e)?.name??e,E=e(r,{name:T,brokers:h}),D=u(t),O=a(l,S),k=x(C),A=Math.ceil(Math.max(E.width,k.width,d(r.title,20,700),d(O,12))+48),j=Math.ceil(p+E.height+m);return[...i(A,j,C.ground,_(C.ink)),s(f,34,r.title,{size:20,fill:C.ink,weight:700}),s(f,56,O,{size:12,fill:C.muted}),`<g transform="translate(${f},${p})">`,...E.columns.map(e=>v(C,e.x,E)),...E.activations.map(e=>{let t=E.columns.find(t=>t.id===e.participant).x-n.bar/2+e.depth*n.bar/2;return`<rect x="${o(t)}" y="${o(e.top-6)}" width="${n.bar}" height="${o(e.bottom-e.top+12)}" fill="${C.tint}" stroke="${C.faint}"/>`}),...E.columns.map(e=>y(C,e.id,e.x,e.width,w.get(e.id),D.get(w.get(e.id)?.owner??``))),...E.rows.map(e=>b(C,e,T)),`</g>`,`<g transform="translate(${f},${o(p+E.height)})">`,...k.parts,`</g>`,`</svg>`,``].join(`
|
|
2
|
+
`)}var _=e=>`<marker id="head-filled" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="${e}"/></marker><marker id="head-open" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10" fill="none" stroke="${e}" stroke-width="1.5"/></marker>`,v=(e,t,n)=>`<path d="M${o(t)},44 L${o(t)},${o(n.height-10)}" fill="none" stroke="${e.faint}" stroke-dasharray="3 4"/>`;function y(e,t,i,a,c,u){let f=i-a/2,p=c?.name??t,m=c!==void 0&&`external`in c&&c.external,h=u?d(u.code,10,700)+16+4:0;return[`<g>`,`<rect x="${o(f)}" y="0" width="${o(a)}" height="44" fill="${m?e.ground:e.paper}" stroke="${e.ink}" stroke-width="1.5"${m?` stroke-dasharray="6 4"`:``}/>`,s(f+14,27,l(p,n.nameSize,a-20-h,700),{size:n.nameSize,fill:e.ink,weight:700}),...u?[r(e,u,f+a-6,14)]:[],`</g>`].join(``)}function b(e,r,i){let{dash:a,head:c}=h[r.style],l=r.x2>=r.x1?1:-1,u=r.x1+l*14,d=r.x1+l*28,f=l>0?void 0:`end`,p=[t(r,i),r.note].filter(e=>e!==void 0);return[`<path data-step="${r.key}" d="M${o(r.x1)},${o(r.y)} L${o(r.x2)},${o(r.y)}" fill="none" stroke="${e.ink}" stroke-width="1.5"${a?` stroke-dasharray="${a}"`:``} marker-end="url(#head-${c})"/>`,`<circle cx="${o(u)}" cy="${o(r.y)}" r="9" fill="${e.ink}"/>`,s(u,r.y+3.5,r.key,{size:r.key.length>2?8:10,fill:e.paper,anchor:`middle`,weight:700}),s(d,r.y-7,r.label,{size:n.labelSize,fill:e.ink,...f?{anchor:f}:{}}),...p.map((t,i)=>s(d,r.y+16+i*n.lineHeight,t,{size:n.subSize,fill:e.muted,...f?{anchor:f}:{}}))].join(``)}function x(e){let t=[],n=0;for(let[r,i]of[[`Sync call`,`sync`],[`Async`,`async`],[`Return`,`return`]]){let{dash:a,head:o}=h[i];t.push(`<path d="M${n},12 L${n+32},12" fill="none" stroke="${e.ink}" stroke-width="1.5"${a?` stroke-dasharray="${a}"`:``} marker-end="url(#head-${o})"/>`),n+=40,t.push(s(n,16,r,{size:11,fill:e.muted})),n+=d(r,11)+24}return{parts:t,width:n-24}}export{g as renderSequenceSvg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as e,g as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l,y as u}from"./teams-N-WbqOXA.js";import{n as d,t as f}from"./font-BEgf3E5J.js";var p=24,m=72,h=44,g=1.5,_=6,v=(e,t)=>t??[e.workspace,e.commit?.slice(0,7)??`uncommitted`,...e.date?[e.date.slice(0,10)]:[]].join(` · `),y=(e,t,n,r)=>[`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}" font-family="${d}, sans-serif">`,`<style>${f.map(e=>`@font-face{font-family:"${d}";font-weight:${e.weight};src:url(data:font/ttf;base64,${e.base64}) format("truetype")}`).join(``)}</style>`,`<defs>${r}</defs>`,`<rect width="${e}" height="${t}" fill="${n}"/>`];function b({bundle:t,view:a,layout:o,source:s,theme:u=`light`,label:d}){let f=i[u],g=new Map(t.elements.map(e=>[e.id,e])),_=new Map(t.targets.map(e=>[e.id,e])),b=c(t),C=new Map(o.nodes.map(e=>[e.id,e])),w=new Set(a.nodes.map(e=>e.parent).filter(e=>e!==null)),T=a.title,E=v(s,d),O=N(f,t,a.lens,a.nodes.some(e=>e.instances!==void 0)),k=Math.ceil(Math.max(o.width,O.width,l(T,20,700),l(E,12))+48),A=Math.ceil(m+o.height+p+h),P=e=>e.parent===null?0:1+P(a.nodes.find(t=>t.id===e.parent)),F=a.nodes.map(e=>({n:e,d:P(e)})).sort((e,t)=>e.d-t.d).map(({n:e})=>e),I=a.lens!==void 0&&`team`in a.lens,L=new Map(a.nodes.map(e=>[e.id,e])),R=e=>e.kind===`target`?1+(e.parent===null?0:R(L.get(e.parent))):0,z=e=>{let t=e.parent===null?void 0:L.get(e.parent);return t===void 0?f.ground:t.kind===`target`?f[`target-${n(R(t))}`]:z(t)},B=e=>f[`target-${n(R(e))}`],V=0,H=e=>{let t=C.get(e.id),n=g.get(e.element??e.id),r=e.kind===`target`?_.get(e.id):void 0,i=b.get(n?.owner??r?.owner??``);return w.has(e.id)?j(f,e,t,i,z(e),e.kind===`target`?B(e):void 0,r?.kind):D(f,e,t,n,i,I,`clip-${V++}`)};return[...y(k,A,f.ground,`${x(`arrow`,f.edge)}${a.lens?x(`arrow-faint`,f[`edge-faint`])+x(`arrow-lit`,f.ink):``}${S(f)}`),r(p,34,T,{size:20,fill:f.ink,weight:700}),r(p,56,E,{size:12,fill:f.muted}),`<g transform="translate(${p},${m})">`,...F.filter(e=>w.has(e.id)).map(H),...o.edges.map(e=>M(f,e.points,a.edges.find(t=>t.from===e.from&&t.to===e.to))),...F.filter(e=>!w.has(e.id)).map(H),`</g>`,`<g transform="translate(${p},${e(m+o.height+p)})">`,...O.parts,`</g>`,`</svg>`,``].join(`
|
|
2
|
+
`)}var x=(e,t)=>`<marker id="${e}" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="${t}"/></marker>`,S=e=>`<pattern id="broker" width="12" height="12" patternUnits="userSpaceOnUse"><rect x="8" width="4" height="12" fill="${e.rule}"/></pattern>`;function C(t,n,r,i,[a,o,s,c]){let l=(t,n,r)=>t?`A${e(t)},${e(t)} 0 0 1 ${e(n)},${e(r)} `:``;return`M${e(t+a)},${e(n)} L${e(t+r-o)},${e(n)} ${l(o,t+r,n+o)}L${e(t+r)},${e(n+i-s)} ${l(s,t+r-s,n+i)}L${e(t+c)},${e(n+i)} ${l(c,t,n+i-c)}L${e(t)},${e(n+a)} ${l(a,t+a,n)}Z`}function w(t,n,i,a){let o=l(n.code,10,700)+16,s=i-o;return[`<rect x="${e(s)}" y="${e(a)}" width="${e(o)}" height="16" fill="${t[`code-bg`]}"/>`,`<rect x="${e(s)}" y="${e(a)}" width="5" height="16" fill="${n.color}"/>`,r(s+10,a+12,n.code,{size:10,fill:t[`code-fg`],weight:700})].join(``)}function T(e,t,n,r,i){let a={frame:e.ink,fill:n,name:e.ink,sub:e.muted,edge:r?.color??e.ink},o=t.mark;return o?o.hit?i?{...a,fill:e.paper,ring:r?.color??e.ink}:o.side===`origin`?{...a,fill:e.herebg,edge:e.ink,ring:e.here}:o.side===`upstream`?{...a,frame:e.up,fill:e.upbg,edge:e.up}:o.side===`downstream`?{...a,frame:e.down,fill:e.downbg,edge:e.down,double:!0}:{...a,frame:e.path,fill:e.pathbg,edge:e.path}:{frame:e.line,fill:e.ground,name:e.faint,sub:e.faint,edge:e.line}:a}function E(t,n,i){let a=n.mark;if(a?.distance===void 0)return[];let o=a.side===`origin`?`ORIGIN`:a.side?`${a.side.toUpperCase()} ${a.distance}`:String(a.distance),s=l(o,10,700)+12,c=i.x+i.width-36-s,u=i.y-10,[d,f,p]=a.side===`origin`?[t.here,t[`on-here`],t.ink]:a.side===`upstream`?[t.up,t.paper,void 0]:a.side===`downstream`?[t.down,t.paper,void 0]:[t.paper,t.ink,t.ink];return[`<rect x="${e(c)}" y="${e(u)}" width="${e(s)}" height="16" fill="${d}"${p?` stroke="${p}" stroke-width="${g}"`:``}/>`,r(c+6,u+12,o,{size:10,fill:f,weight:700})]}function D(t,n,i,o,c,d,f){let{x:p,y:m,width:h,height:v}=i,y=o?.kind===`service`?o.type:void 0,b=n.kind===`system`,x=T(t,n,b?t.tint:t.paper,c,d),S=n.kind===`person`?Math.min(36,v/2):0,D=C(p,m,h,v,n.kind===`person`?[S,S,S,S]:y===`datastore`?[0,0,12,12]:[0,0,0,0]),O=n.external?` stroke-dasharray="6 4"`:``,j=b?2:g,M=c?l(c.code,10,700)+16+8:0,N=n.instances===void 0?void 0:u(n.instances),P=N===void 0?0:a(N)+8,I=p+_+(n.kind===`person`?12:8),L=n.kind===`person`?p+h-16:p+h-10;return[`<g>`,...N===void 0?[]:k(x,p,m,h,v),...x.ring?[`<path d="${C(p-4,m-4,h+8,v+8,S?[S+4,S+4,S+4,S+4]:y===`datastore`?[0,0,16,16]:[0,0,0,0])}" fill="${x.ring}"/>`]:[],`<clipPath id="${f}"><path d="${D}"/></clipPath>`,`<path d="${D}" fill="${x.fill}"/>`,...y===`broker`?[`<path d="${D}" fill="url(#broker)"/>`]:[],`<path d="${D}" fill="none" stroke="${x.frame}" stroke-width="${j}"${O}/>`,...x.double?[`<path d="${C(p+3,m+3,h-6,v-6,[0,0,y===`datastore`?9:0,y===`datastore`?9:0])}" fill="none" stroke="${x.frame}" stroke-width="${g}"/>`]:[],`<rect x="${e(p-1)}" y="${e(m-1)}" width="7" height="${e(v+2)}" fill="${x.edge}" clip-path="url(#${f})"/>`,r(I,m+v/2-4,s(n.name,13,L-I-M-P,700),{size:13,fill:x.name,weight:700}),r(I,m+v/2+13,s(F(n,o),11,L-I),{size:11,fill:x.sub}),...c?[w(t,c,L,m+8)]:[],...N===void 0?[]:[A(t,x,N,L-M,m+8)],...E(t,n,i),...n.mark?.hit&&n.collapsed?[`<rect x="${e(p+h-42)}" y="${e(m+v-18)}" width="10" height="10" fill="${t.ink}" stroke="${t.paper}" stroke-width="2"/>`]:[],`</g>`].join(``)}var O=5;function k(t,n,r,i,a){return[2,1].map(o=>`<rect x="${e(n+o*5)}" y="${e(r+o*5)}" width="${e(i)}" height="${e(a)}" fill="${t.fill}" stroke="${t.frame}" stroke-width="${g}"/>`)}function A(t,n,i,o,s){let c=a(i),l=o-c;return[`<rect x="${e(l)}" y="${e(s)}" width="${e(c)}" height="16" fill="${t.paper}" stroke="${n.frame}" stroke-width="1"/>`,r(l+6,s+12,i,{size:10,fill:n.name,weight:700})].join(``)}function j(t,n,i,a,c,u,d){let{x:f,y:p,width:m,height:h}=i,v=n.kind===`target`,y=n.mark&&!n.mark.hit,b=n.external?t.ink:t.line,x=u??(y?`none`:o(t.container,c)),S=n.external?` stroke-dasharray="6 4"`:``,C=a?l(a.code,10,700)+16+8:0,T=f+(v?12:16);return[`<g>`,`<rect x="${e(f)}" y="${e(p)}" width="${e(m)}" height="${e(h)}" fill="${x}" stroke="${b}" stroke-width="${g}"${S}/>`,...v?[]:[`<rect x="${e(f-g/2)}" y="${e(p-g/2)}" width="${_}" height="${e(h+g)}" fill="${b}"/>`],r(T,p+22,s(`${n.name} · ${d??P(n)}`,13,f+m-10-T-C,700),{size:13,fill:y?t.faint:t.ink,weight:700}),...a?[w(t,a,f+m-10,p+9)]:[],...E(t,n,i),`</g>`].join(``)}function M(t,n,r){let i=n.map((t,n)=>`${n===0?`M`:`L`}${e(t.x)},${e(t.y)}`).join(` `);return r.lit?`<path d="${i}" fill="none" stroke="${t.ink}" stroke-width="2.5" marker-end="url(#arrow-lit)"/>`:r.lit===!1?`<path d="${i}" fill="none" stroke="${t[`edge-faint`]}" stroke-width="${g}" marker-end="url(#arrow-faint)"/>`:`<path d="${i}" fill="none" stroke="${t.edge}" stroke-width="${g}" marker-end="url(#arrow)"/>`}function N(n,i,a,o){let s=[],c=0,u=e=>{s.push(r(c,16,e,{size:11,fill:n.muted})),c+=l(e,11)+24},d=t=>{s.push(`<rect x="${e(c)}" y="4" width="28" height="16" ${t}/>`),c+=36};if(s.push(w(n,{code:`ABC`,color:n.muted},c+l(`ABC`,10,700)+16,4)),c+=l(`ABC`,10,700)+24,u(`Team (stripe and code)`),d(`fill="${n.paper}" stroke="${n.ink}" stroke-width="${g}" stroke-dasharray="6 4"`),u(`External`),s.push(`<rect x="${e(c)}" y="4" width="28" height="16" fill="${n.paper}"/><rect x="${e(c)}" y="4" width="28" height="16" fill="url(#broker)" stroke="${n.ink}" stroke-width="${g}"/>`),c+=36,u(`Broker`),o){for(let t of[2,1,0])s.push(`<rect x="${e(c+t*3)}" y="${e(1+t*3)}" width="22" height="12" fill="${n.paper}" stroke="${n.ink}" stroke-width="${g}"/>`);c+=36,u(`Stacked: scaled (×3 fixed, 2–10 autoscale)`)}return a&&(`impact`in a?(d(`fill="${n.herebg}" stroke="${n.here}" stroke-width="2.5"`),u(`Origin`),d(`fill="${n.up}"`),u(`Upstream`),d(`fill="${n.down}"`),u(`Downstream`)):`team`in a?d(`fill="${n.paper}" stroke="${n.muted}" stroke-width="3"`):d(`fill="${n.pathbg}" stroke="${n.path}" stroke-width="${g}"`),u(`Lens: ${t(i,a)}`)),{parts:s,width:c-24}}var P=e=>({person:`Person`,system:`System`,service:`Service`,component:`Component`,target:`Deployment Target`,deployment:`Deployment`})[e.kind];function F(e,t){let n=e.kind!==`deployment`&&t?.kind===`service`&&t.type!==`app`?{datastore:`Datastore`,broker:`Broker`}[t.type]:P(e),r=t&&`technology`in t?t.technology:null;return[`${e.external?`External `:``}${n}`,...r?[r]:[]].join(` · `)}export{O as STACK_OFFSET,w as codeTile,y as opening,b as renderSvg,v as sourceLine};
|