@kekonic/diagrams-studio 1.0.0-rc.10
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/LICENSE +21 -0
- package/README.md +47 -0
- package/dist/browser/assets/SourceEditor-CVJmi6AX.js +23 -0
- package/dist/browser/assets/codicon-DF1abBS2.ttf +0 -0
- package/dist/browser/assets/dist-gV3Je5I4.js +52 -0
- package/dist/browser/assets/editor-bEjdOiDy.css +1 -0
- package/dist/browser/assets/editor.api-Cj6q1WDf.js +430 -0
- package/dist/browser/assets/editor.worker-BmdWdrHZ.js +33 -0
- package/dist/browser/assets/elk-B5tw4IVJ.js +25 -0
- package/dist/browser/assets/format-B3CctFKU.js +479 -0
- package/dist/browser/assets/format-BCE_sElR.css +1 -0
- package/dist/browser/assets/github-dark-C-LZuMrd.js +1 -0
- package/dist/browser/assets/github-light-EUqPIrTm.js +1 -0
- package/dist/browser/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/dist/browser/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/dist/browser/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/dist/browser/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/dist/browser/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/dist/browser/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/dist/browser/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/dist/browser/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/dist/browser/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/dist/browser/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/dist/browser/assets/index-CWVmUaAY.css +1 -0
- package/dist/browser/assets/index-KMDzz6hs.js +3092 -0
- package/dist/browser/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/dist/browser/assets/inter-latin-500-normal-DPWUe_Rm.js +1 -0
- package/dist/browser/assets/kekonic-diagrams-symbol-DLqXST9D.svg +38 -0
- package/dist/browser/assets/language-jwV6PbsO.js +11 -0
- package/dist/browser/assets/monaco-features-BReLWANr.js +28 -0
- package/dist/browser/assets/monaco-features-CRQ1X1Hr.css +1 -0
- package/dist/browser/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/dist/browser/assets/wasm-BnjxR4X6.js +1 -0
- package/dist/browser/favicon.svg +38 -0
- package/dist/browser/index.html +17 -0
- package/dist/index.d.mts +185 -0
- package/dist/index.mjs +465 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,3092 @@
|
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var ee=x.prototype=new b;ee.constructor=x,_(ee,y.prototype),ee.isPureReactComponent=!0;var te=Array.isArray;function ne(){}var S={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function C(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ie(e,t){return C(e.type,t,e.props)}function ae(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function oe(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var se=/\/+/g;function ce(e,t){return typeof e==`object`&&e&&e.key!=null?oe(``+e.key):t.toString(36)}function le(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ne,ne):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ue(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ue(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ce(e,0):a,te(o)?(i=``,c!=null&&(i=c.replace(se,`$&/`)+`/`),ue(o,r,i,``,function(e){return e})):o!=null&&(ae(o)&&(o=ie(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(se,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(te(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ce(a,u),c+=ue(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ce(a,u++),c+=ue(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ue(le(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function w(e,t,n){if(e==null)return e;var r=[],i=0;return ue(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function de(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var fe=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function pe(e){var t=S.T,n={};n.types=t===null?null:t.types,S.T=n;try{var r=e(),i=S.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(ne,fe)}catch(e){fe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),S.T=t}}function me(e){var t=S.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else pe(me.bind(null,e))}var he={map:w,forEach:function(e,t,n){w(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return w(e,function(){t++}),t},toArray:function(e){return w(e,function(e){return e})||[]},only:function(e){if(!ae(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=he,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},e.addTransitionType=me,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!re.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return C(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)re.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return C(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ae,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:de}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=pe,e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return S.H.useEffect(e,t)},e.useEffectEvent=function(e){return S.H.useEffectEvent(e)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return S.H.useTransition()},e.version=`19.3.1`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,ee||(ee=!0,ie());else{var t=n(l);t!==null&&se(x,t.startTime-e)}}}var ee=!1,te=-1,ne=5,S=-1;function re(){return g?!0:!(e.unstable_now()-S<ne)}function C(){if(g=!1,ee){var t=e.unstable_now();S=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&se(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():ee=!1}}}var ie;if(typeof y==`function`)ie=function(){y(C)};else if(typeof MessageChannel<`u`){var ae=new MessageChannel,oe=ae.port2;ae.port1.onmessage=C,ie=function(){oe.postMessage(null)}}else ie=function(){_(C,0)};function se(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,se(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,ie()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),a=t(((e,t)=>{t.exports=i()})),o=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),s=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=o()})),c=t((e=>{var t=a(),n=r(),i=s();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=a;break}if(c===r){s=!0,r=i,n=a;break}c=c.sibling}if(!s){for(c=a.child;c;){if(c===n){s=!0,n=a,r=i;break}if(c===r){s=!0,r=a,n=i;break}c=c.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var x=null,ee=null;function te(e,t,n){return e===n||e===t&&(x=e,!0)}function ne(e,t,n){return e===n?(ee=e,!1):e===t&&(ee!==null&&(x=e),!0)}function S(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function re(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var C=Object.assign,ie=Symbol.for(`react.element`),ae=Symbol.for(`react.transitional.element`),oe=Symbol.for(`react.portal`),se=Symbol.for(`react.fragment`),ce=Symbol.for(`react.strict_mode`),le=Symbol.for(`react.profiler`),ue=Symbol.for(`react.consumer`),w=Symbol.for(`react.context`),de=Symbol.for(`react.forward_ref`),fe=Symbol.for(`react.suspense`),pe=Symbol.for(`react.suspense_list`),me=Symbol.for(`react.memo`),he=Symbol.for(`react.lazy`),ge=Symbol.for(`react.activity`),_e=Symbol.for(`react.legacy_hidden`),ve=Symbol.for(`react.memo_cache_sentinel`),ye=Symbol.for(`react.view_transition`),be=Symbol.for(`react.recoverable`),xe=Symbol.iterator;function Se(e){return typeof e!=`object`||!e?null:(e=xe&&e[xe]||e[`@@iterator`],typeof e==`function`?e:null)}var Ce=Symbol.for(`react.client.reference`);function we(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===Ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case se:return`Fragment`;case le:return`Profiler`;case ce:return`StrictMode`;case fe:return`Suspense`;case pe:return`SuspenseList`;case ge:return`Activity`;case ye:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case oe:return`Portal`;case w:return e.displayName||`Context`;case ue:return(e._context.displayName||`Context`)+`.Consumer`;case de:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case me:return t=e.displayName||null,t===null?we(e.type)||`Memo`:t;case he:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var Te=Array.isArray,T=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee={pending:!1,data:null,method:null,action:null},De=[],Oe=-1;function ke(e){return{current:e}}function Ae(e){0>Oe||(e.current=De[Oe],De[Oe]=null,Oe--)}function D(e,t){Oe++,De[Oe]=e.current,e.current=t}var je=ke(null),Me=ke(null),Ne=ke(null),Pe=ke(null);function Fe(e,t){switch(D(Ne,t),D(Me,e),D(je,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ae(je),D(je,e)}function Ie(){Ae(je),Ae(Me),Ae(Ne)}function Le(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,D(Pe,e)),t=je.current;var n=dp(t,e.type);t!==n&&(D(Me,e),D(je,n))}function Re(e){Me.current===e&&(Ae(je),Ae(Me)),Pe.current===e&&(Ae(Pe),sh._currentValue=Ee)}var ze,Be;function Ve(e){if(ze===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ze=t&&t[1]||``,Be=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+ze+e+Be}var He=!1;function Ue(e,t){if(!e||He)return``;He=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{He=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ve(n):``}function We(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve(`Lazy`);case 13:return e.child!==t&&t!==null?Ve(`Suspense Fallback`):Ve(`Suspense`);case 19:return Ve(`SuspenseList`);case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return Ve(`Activity`);case 30:return Ve(`ViewTransition`);default:return``}}function Ge(e){try{var t=``,n=null;do t+=We(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Ke=Object.prototype.hasOwnProperty,qe=t.unstable_scheduleCallback,Je=t.unstable_cancelCallback,Ye=t.unstable_shouldYield,Xe=t.unstable_requestPaint,Ze=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,$e=t.unstable_ImmediatePriority,et=t.unstable_UserBlockingPriority,tt=t.unstable_NormalPriority,nt=t.unstable_LowPriority,rt=t.unstable_IdlePriority,it=t.log,at=t.unstable_setDisableYieldValue,ot=null,st=null;function O(e){if(typeof it==`function`&&at(e),st&&typeof st.setStrictMode==`function`)try{st.setStrictMode(ot,e)}catch{}}var ct=Math.clz32?Math.clz32:dt,lt=Math.log,ut=Math.LN2;function dt(e){return e>>>=0,e===0?32:31-(lt(e)/ut|0)|0}var ft=256,pt=262144,mt=4194304;function ht(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function gt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ht(n))):i=ht(o):i=ht(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ht(n))):i=ht(o)):i=ht(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function _t(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-ct(n),i=1<<r;t|=e[r],n&=~i}return t}function yt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bt(){var e=mt;return mt<<=1,!(mt&62914560)&&(mt=4194304),e}function xt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function St(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ct(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&wt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function wt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ct(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ct(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Et(e,t){var n=t&-t;return n=n&42?1:Dt(n),(n&(e.suspendedLanes|t))===0?n:0}function Dt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ot(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function kt(){var e=E.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function At(e,t){var n=E.p;try{return E.p=e,t()}finally{E.p=n}}var jt=Math.random().toString(36).slice(2),Mt=`__reactFiber$`+jt,Nt=`__reactProps$`+jt,Pt=`__reactContainer$`+jt,Ft=`__reactEvents$`+jt,It=`__reactListeners$`+jt,Lt=`__reactHandles$`+jt,Rt=`__reactResources$`+jt,zt=`__reactMarker$`+jt,Bt=`__reactLoad$`+jt;function Vt(e){delete e[Mt],delete e[Nt],delete e[It],delete e[Lt]}function Ht(e){var t;if(t=e[Mt])return t;for(var n=e.parentNode;n;){if(t=n[Pt]||n[Mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[Mt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Ut(e){if(e=e[Mt]||e[Pt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Gt(e){var t=e[Rt];return t||=e[Rt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Kt(e){e[zt]=!0}function qt(e){e[Bt]=void 0}var Jt=new Set,Yt={};function Xt(e,t){Zt(e,t),Zt(e+`Capture`,t)}function Zt(e,t){for(Yt[e]=t,e=0;e<t.length;e++)Jt.add(t[e])}var Qt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),$t={},en={};function tn(e){return Ke.call(en,e)?!0:Ke.call($t,e)?!1:Qt.test(e)?en[e]=!0:($t[e]=!0,!1)}var k=!1;function nn(){var e=k;return k=!1,e}function rn(e,t,n){if(tn(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function an(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function A(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function on(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function sn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function cn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ln(e){if(!e._valueTracker){var t=sn(e)?`checked`:`value`;e._valueTracker=cn(e,t,``+e[t])}}function un(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=sn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var dn=/[\n"\\]/g;function fn(e){return e.replace(dn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function pn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+on(t)):e.value!==``+on(t)&&(e.value=``+on(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):hn(e,on(n)):o===`number`&&e.value==t?hn(e,on(e.value)):hn(e,on(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+on(s):e.removeAttribute(`name`)}function mn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){ln(e);return}n=n==null?``:``+on(n),t=t==null?n:``+on(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),ln(e)}function hn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function gn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+on(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _n(e,t,n){t!=null&&(t=``+on(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+on(n)}function vn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(Te(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=on(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),ln(e)}function yn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function xn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||bn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Sn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,k=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(xn(e,i,r),k=!0)}else for(var a in t)t.hasOwnProperty(a)&&xn(e,a,t[a])}function Cn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var wn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Tn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function En(e){return Tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Dn(){}var On=null;function kn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var An=null,jn=null;function Mn(e){var t=Ut(e);if(t&&(e=t.stateNode)){var n=e[Nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(pn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+fn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Nt]||null;if(!i)throw Error(o(90));pn(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&un(r)}break a;case`textarea`:_n(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&gn(e,!!n.multiple,t,!1)}}}var Nn=!1;function Pn(e,t,n){if(Nn)return e(t,n);Nn=!0;try{return e(t)}finally{if(Nn=!1,(An!==null||jn!==null)&&(zd(),An&&(t=An,e=jn,jn=An=null,Mn(t),e)))for(t=0;t<e.length;t++)Mn(e[t])}}function Fn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Nt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var In=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ln=!1;if(In)try{var Rn={};Object.defineProperty(Rn,"passive",{get:function(){Ln=!0}}),window.addEventListener(`test`,Rn,Rn),window.removeEventListener(`test`,Rn,Rn)}catch{Ln=!1}var zn=null,Bn=null,Vn=null;function Hn(){if(Vn)return Vn;var e,t=Bn,n=t.length,r,i=`value`in zn?zn.value:zn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Vn=i.slice(e,1<r?1-r:void 0)}function Un(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Wn(){return!0}function Gn(){return!1}function Kn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Wn:Gn,this.isPropagationStopped=Gn,this}return C(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Wn)},persist:function(){},isPersistent:Wn}),t}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jn=Kn(qn),Yn=C({},qn,{view:0,detail:0}),Xn=Kn(Yn),Zn,Qn,$n,er=C({},Yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==$n&&($n&&e.type===`mousemove`?(Zn=e.screenX-$n.screenX,Qn=e.screenY-$n.screenY):Qn=Zn=0,$n=e),Zn)},movementY:function(e){return`movementY`in e?e.movementY:Qn}}),tr=Kn(er),nr=Kn(C({},er,{dataTransfer:0})),rr=Kn(C({},Yn,{relatedTarget:0})),ir=Kn(C({},qn,{animationName:0,elapsedTime:0,pseudoElement:0})),ar=Kn(C({},qn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),or=Kn(C({},qn,{data:0})),sr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},cr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},lr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ur(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lr[e])?!!t[e]:!1}function dr(){return ur}var fr=Kn(C({},Yn,{key:function(e){if(e.key){var t=sr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?cr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dr,charCode:function(e){return e.type===`keypress`?Un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),pr=Kn(C({},er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),mr=Kn(C({},qn,{submitter:0})),j=Kn(C({},Yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dr})),hr=Kn(C({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0})),gr=Kn(C({},er,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),_r=Kn(C({},qn,{newState:0,oldState:0,source:0})),vr=[9,13,27,32],yr=In&&`CompositionEvent`in window,br=null;In&&`documentMode`in document&&(br=document.documentMode);var xr=In&&`TextEvent`in window&&!br,Sr=In&&(!yr||br&&8<br&&11>=br),Cr=` `,wr=!1;function Tr(e,t){switch(e){case`keyup`:return vr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Dr=!1;function Or(e,t){switch(e){case`compositionend`:return Er(t);case`keypress`:return t.which===32?(wr=!0,Cr):null;case`textInput`:return e=t.data,e===Cr&&wr?null:e;default:return null}}function kr(e,t){if(Dr)return e===`compositionend`||!yr&&Tr(e,t)?(e=Hn(),Vn=Bn=zn=null,Dr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Sr&&t.locale!==`ko`?null:t.data;default:return null}}var Ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Ar[e.type]:t===`textarea`}function Mr(e,t,n,r){An?jn?jn.push(r):jn=[r]:An=r,t=Jf(t,`onChange`),0<t.length&&(n=new Jn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Nr=null,Pr=null;function Fr(e){Vf(e,0)}function Ir(e){if(un(Wt(e)))return e}function Lr(e,t){if(e===`change`)return t}var Rr=!1;if(In){var zr;if(In){var Br=`oninput`in document;if(!Br){var Vr=document.createElement(`div`);Vr.setAttribute(`oninput`,`return;`),Br=typeof Vr.oninput==`function`}zr=Br}else zr=!1;Rr=zr&&(!document.documentMode||9<document.documentMode)}function Hr(){Nr&&(Nr.detachEvent(`onpropertychange`,Ur),Pr=Nr=null)}function Ur(e){if(e.propertyName===`value`&&Ir(Pr)){var t=[];Mr(t,Pr,e,kn(e)),Pn(Fr,t)}}function Wr(e,t,n){e===`focusin`?(Hr(),Nr=t,Pr=n,Nr.attachEvent(`onpropertychange`,Ur)):e===`focusout`&&Hr()}function Gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ir(Pr)}function Kr(e,t){if(e===`click`)return Ir(t)}function qr(e,t){if(e===`input`||e===`change`)return Ir(t)}function Jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Yr=typeof Object.is==`function`?Object.is:Jr;function Xr(e,t){if(Yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ke.call(t,i)||!Yr(e[i],t[i]))return!1}return!0}function Zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $r(e,t){var n=Qr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Qr(n)}}function ei(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ei(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ti(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Zr(e.document)}return t}function ni(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ri=In&&`documentMode`in document&&11>=document.documentMode,ii=null,ai=null,oi=null,si=!1;function ci(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;si||ii==null||ii!==Zr(r)||(r=ii,`selectionStart`in r&&ni(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),oi&&Xr(oi,r)||(oi=r,r=Jf(ai,`onSelect`),0<r.length&&(t=new Jn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ii)))}function li(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ui={animationend:li(`Animation`,`AnimationEnd`),animationiteration:li(`Animation`,`AnimationIteration`),animationstart:li(`Animation`,`AnimationStart`),transitionrun:li(`Transition`,`TransitionRun`),transitionstart:li(`Transition`,`TransitionStart`),transitioncancel:li(`Transition`,`TransitionCancel`),transitionend:li(`Transition`,`TransitionEnd`)},di={},fi={};In&&(fi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ui.animationend.animation,delete ui.animationiteration.animation,delete ui.animationstart.animation),`TransitionEvent`in window||delete ui.transitionend.transition);function pi(e){if(di[e])return di[e];if(!ui[e])return e;var t=ui[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fi)return di[e]=t[n];return e}var mi=pi(`animationend`),hi=pi(`animationiteration`),gi=pi(`animationstart`),_i=pi(`transitionrun`),vi=pi(`transitionstart`),yi=pi(`transitioncancel`),bi=pi(`transitionend`),xi=new Map,Si=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Si.push(`scrollEnd`);function Ci(e,t){xi.set(e,t),Xt(t,[e])}var wi=0;function Ti(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=wi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Ei(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Di(e,t){return e=Ei(e),t=Ei(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Oi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ki=[],Ai=0,ji=0;function Mi(){for(var e=Ai,t=ji=Ai=0;t<e;){var n=ki[t];ki[t++]=null;var r=ki[t];ki[t++]=null;var i=ki[t];ki[t++]=null;var a=ki[t];if(ki[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ii(n,i,a)}}function Ni(e,t,n,r){ki[Ai++]=e,ki[Ai++]=t,ki[Ai++]=n,ki[Ai++]=r,ji|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pi(e,t,n,r){return Ni(e,t,n,r),Li(e)}function Fi(e,t){return Ni(e,null,null,t),Li(e)}function Ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ct(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Li(e){if(50<kd)throw kd=0,Ad=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var M={};function Ri(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zi(e,t,n,r){return new Ri(e,t,n,r)}function Bi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vi(e,t){var n=e.alternate;return n===null?(n=zi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Hi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ui(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)Bi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,je.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ge:return e=zi(31,n,t,i),e.elementType=ge,e.lanes=a,e;case se:return Wi(n.children,i,a,t);case ce:s=8,i|=24;break;case le:return e=zi(12,n,t,i|2),e.elementType=le,e.lanes=a,e;case fe:return e=zi(13,n,t,i),e.elementType=fe,e.lanes=a,e;case pe:return e=zi(19,n,t,i),e.elementType=pe,e.lanes=a,e;case _e:case ye:return e=i|32,e=zi(30,n,t,e),e.elementType=ye,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case w:s=10;break a;case ue:s=9;break a;case de:s=11;break a;case me:s=14;break a;case he:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=zi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Wi(e,t,n,r){return e=zi(7,e,r,t),e.lanes=n,e}function Gi(e,t,n){return e=zi(6,e,null,t),e.lanes=n,e}function Ki(e){var t=zi(18,null,null,0);return t.stateNode=e,t}function qi(e,t,n){return t=zi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ji=new WeakMap;function Yi(e,t){if(typeof e==`object`&&e){var n=Ji.get(e);return n===void 0?(t={value:e,source:t,stack:Ge(t)},Ji.set(e,t),t):n}return{value:e,source:t,stack:Ge(t)}}var Xi=[],Zi=0,Qi=null,$i=0,ea=[],ta=0,na=null,ra=1,ia=``;function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=Qi,Qi=e,$i=t}function oa(e,t,n){ea[ta++]=ra,ea[ta++]=ia,ea[ta++]=na,na=e;var r=ra;e=ia;var i=32-ct(r)-1;r&=~(1<<i),n+=1;var a=32-ct(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ra=1<<32-ct(t)+i|n<<i|r,ia=a+e}else ra=1<<a|n<<i|r,ia=e}function sa(e){e.return!==null&&(aa(e,1),oa(e,1,0))}function ca(e){for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null;for(;e===na;)na=ea[--ta],ea[ta]=null,ia=ea[--ta],ea[ta]=null,ra=ea[--ta],ea[ta]=null}function la(e,t){ea[ta++]=ra,ea[ta++]=ia,ea[ta++]=na,ra=t.id,ia=t.overflow,na=e}var ua=null,N=null,P=!1,da=null,fa=!1,pa=Error(o(519));function ma(e){throw ba(Yi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),pa}function ha(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Mt]=e,t[Nt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),mn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),vn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Dn),t=!0):t=!1,t||ma(e,!0)}function ga(e){for(ua=e.return;ua;)switch(ua.tag){case 5:case 31:case 13:fa=!1;return;case 27:case 3:fa=!0;return;default:ua=ua.return}}function _a(e){if(e!==ua)return!1;if(!P)return ga(e),P=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&N&&ma(e),ga(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));N=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));N=dm(e)}else t===27?(t=N,Sp(e.type)?(e=um,um=null,N=e):N=t):N=ua?lm(e.stateNode.nextSibling):null;return!0}function va(){N=ua=null,P=!1}function ya(){var e=da;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),da=null),e}function ba(e){da===null?da=[e]:da.push(e)}var xa=ke(null),Sa=null,Ca=null;function wa(e,t,n){D(xa,t._currentValue),t._currentValue=n}function Ta(e){e._currentValue=xa.current,Ae(xa)}function Ea(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Da(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Ea(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ea(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Ea(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Oa(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Yr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===Pe.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&Da(t,e,n,r),t.flags|=262144,e!==null}function ka(e){for(e=e.firstContext;e!==null;){if(!Yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Aa(e){Sa=e,Ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ja(e){return Na(Sa,e)}function Ma(e,t){return Sa===null&&Aa(e),Na(e,t)}function Na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ca===null){if(e===null)throw Error(o(308));Ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ca=Ca.next=t;return n}var Pa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Fa=t.unstable_scheduleCallback,Ia=t.unstable_NormalPriority,F={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function La(){return{controller:new Pa,data:new Map,refCount:0}}function Ra(e){e.refCount--,e.refCount===0&&Fa(Ia,function(){e.controller.abort()})}function za(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ba=null;function Va(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ha=null,Ua=0,Wa=0,Ga=null;function Ka(e,t){if(Ha===null){var n=Ha=[];Ua=0,Wa=Pf(),Ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ua++,t.then(qa,qa),t}function qa(){if(--Ua===0&&(Ba=null,Ha!==null)){Ga!==null&&(Ga.status=`fulfilled`);var e=Ha;Ha=null,Wa=0,Ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ja(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ya=T.S;T.S=function(e,t){if(hd=Ze(),typeof t==`object`&&t&&typeof t.then==`function`&&Ka(e,t),Ba!==null)for(var n=bf;n!==null;)za(n,Ba),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)za(r,n),r=r.next;if(Wa!==0){r=Ba,r===null&&(r=Ba=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ya!==null&&Ya(e,t)};var Xa=ke(null);function Za(){var e=Xa.current;return e===null?q.pooledCache:e}function Qa(e,t){t===null?D(Xa,Xa.current):D(Xa,t.pool)}function $a(){var e=Za();return e===null?null:{parent:F._currentValue,pool:e}}var eo=Error(o(460)),to=Error(o(474)),no=Error(o(542)),ro={then:function(){}};function io(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ao(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Dn,Dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,lo(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(Dn,Dn);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,lo(e),e}throw so=t,eo}}function oo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(so=e,eo):e}}var so=null;function co(){if(so===null)throw Error(o(459));var e=so;return so=null,e}function lo(e){if(e===eo||e===no)throw Error(o(483))}var uo=null,fo=0;function po(e){var t=fo;return fo+=1,uo===null&&(uo=[]),ao(uo,e,t)}function mo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ho(e,t){throw t.$$typeof===ie?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function go(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Vi(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Gi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===se?(e=d(e,t,n.props.children,r,n.key),mo(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===he&&oo(a)===t.type)?(t=i(t,n.props),mo(t,n),t.return=e,t):(t=Ui(n.type,n.key,n.props,null,e.mode,r),mo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=qi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Wi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Gi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ae:return n=Ui(t.type,t.key,t.props,null,e.mode,n),mo(n,t),n.return=e,n;case oe:return t=qi(t,e.mode,n),t.return=e,t;case he:return t=oo(t),f(e,t,n)}if(Te(t)||Se(t))return t=Wi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,po(t),n);if(t.$$typeof===w)return f(e,Ma(e,t),n);ho(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case ae:return n.key===i?l(e,t,n,r):null;case oe:return n.key===i?u(e,t,n,r):null;case he:return n=oo(n),p(e,t,n,r)}if(Te(n)||Se(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,po(n),r);if(n.$$typeof===w)return p(e,t,Ma(e,n),r);ho(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case ae:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case oe:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case he:return r=oo(r),m(e,t,n,r,i)}if(Te(r)||Se(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,po(r),i);if(r.$$typeof===w)return m(e,t,n,Ma(t,r),i);ho(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),P&&aa(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return P&&aa(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),P&&aa(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),P&&aa(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return P&&aa(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),P&&aa(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===se&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case ae:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===se){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),mo(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===he&&oo(l)===r.type){n(e,r.sibling),c=i(r,a.props),mo(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===se?(c=Wi(a.props.children,e.mode,c,a.key),mo(c,a),c.return=e,e=c):(c=Ui(a.type,a.key,a.props,null,e.mode,c),mo(c,a),c.return=e,e=c)}return s(e);case oe:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=qi(a,e.mode,c),c.return=e,e=c}return s(e);case he:return a=oo(a),_(e,r,a,c)}if(Te(a))return h(e,r,a,c);if(Se(a)){if(l=Se(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,po(a),c);if(a.$$typeof===w)return _(e,r,Ma(e,a),c);ho(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Gi(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{fo=0;var i=_(e,t,n,r);return uo=null,i}catch(t){if(t===eo||t===no)throw t;var a=zi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var _o=go(!0),vo=go(!1),yo=!1;function bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function So(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Li(e),Ii(e,null,n),t}return Ni(e,r,t,n),Li(e)}function wo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tt(e,n)}}function To(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Eo=!1;function Do(){if(Eo){var e=Ga;if(e!==null)throw e}}function Oo(e,t,n,r){Eo=!1;var i=e.updateQueue;yo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===Wa&&(Eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=C({},d,f);break a;case 2:yo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function ko(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function Ao(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ko(n[e],t)}var jo=ke(null),Mo=ke(0);function No(e,t){e=id,D(Mo,e),D(jo,t),id=e|t.baseLanes}function Po(){D(Mo,id),D(jo,jo.current)}function Fo(){id=Mo.current,Ae(jo),Ae(Mo)}var Io=ke(null),Lo=null;function Ro(e){var t=e.alternate;D(Uo,Uo.current&1),D(Io,e),Lo===null&&(t===null||jo.current!==null||t.memoizedState!==null)&&(Lo=e)}function zo(e){D(Uo,Uo.current),D(Io,e),Lo===null&&(Lo=e)}function Bo(e){e.tag===22?(D(Uo,Uo.current),D(Io,e),Lo===null&&(Lo=e)):Vo()}function Vo(){D(Uo,Uo.current),D(Io,Io.current)}function Ho(e){Ae(Io),Lo===e&&(Lo=null),Ae(Uo)}var Uo=ke(0);function Wo(e,t){D(Io,Io.current),D(Uo,t)}function Go(e){Ae(Uo),Ae(Io),Lo===e&&(Lo=null)}function Ko(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qo=0,I=null,L=null,Jo=null,Yo=!1,Xo=!1,Zo=!1,Qo=0,$o=0,es=null,ts=0;function R(){throw Error(o(321))}function ns(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function rs(e,t,n,r,i,a){return qo=a,I=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?vc:yc,Zo=!1,a=n(r,i),Zo=!1,Xo&&(a=as(t,n,r,i)),is(e),a}function is(e){T.H=_c;var t=L!==null&&L.next!==null;if(qo=0,Jo=L=I=null,Yo=!1,$o=0,es=null,t)throw Error(o(300));e===null||V||(e=e.dependencies,e!==null&&ka(e)&&(V=!0))}function as(e,t,n,r){I=e;var i=0;do{if(Xo&&(es=null),$o=0,Xo=!1,25<=i)throw Error(o(301));if(i+=1,Jo=L=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}T.H=bc,a=t(n,r)}while(Xo);return a}function os(){var e=T.H,t=e.useState()[0];return t=typeof t.then==`function`?ds(t):t,e=e.useState()[0],(L===null?null:L.memoizedState)!==e&&(I.flags|=1024),t}function ss(){var e=Qo!==0;return Qo=0,e}function cs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ls(e){if(Yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Yo=!1}qo=0,Jo=L=I=null,Xo=!1,$o=Qo=0,es=null}function z(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jo===null?I.memoizedState=Jo=e:Jo=Jo.next=e,Jo}function B(){if(L===null){var e=I.alternate;e=e===null?null:e.memoizedState}else e=L.next;var t=Jo===null?I.memoizedState:Jo.next;if(t!==null)Jo=t,L=e;else{if(e===null)throw I.alternate===null?Error(o(467)):Error(o(310));L=e,e={memoizedState:L.memoizedState,baseState:L.baseState,baseQueue:L.baseQueue,queue:L.queue,next:null},Jo===null?I.memoizedState=Jo=e:Jo=Jo.next=e}return Jo}function us(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ds(e){var t=$o;return $o+=1,es===null&&(es=[]),e=ao(es,e,t),t=I,(Jo===null?t.memoizedState:Jo.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?vc:yc),e}function fs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ds(e);if(e.$$typeof===be)return;if(e.$$typeof===w)return ja(e)}throw Error(o(438,String(e)))}function ps(e){var t=null,n=I.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=I.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=us(),I.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ve;return t.index++,n}function ms(e,t){return typeof t==`function`?t(e):t}function hs(e){return gs(B(),L,e)}function gs(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(qo&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Wa&&(d=!0);else if((qo&p)===p){u=u.next,p===Wa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,I.lanes|=p,od|=p;f=u.action,Zo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,I.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Yr(a,e.memoizedState)&&(V=!0,d&&(n=Ga,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function _s(e){var t=B(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Yr(a,t.memoizedState)||(V=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function vs(e,t,n){var r=I,i=B(),a=P;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Yr((L||i).memoizedState,n);if(s&&(i.memoizedState=n,V=!0),i=i.queue,Us(xs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Jo!==null&&!!(Jo.memoizedState.tag&1),Rs(e?9:8,{destroy:void 0},bs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,q===null)throw Error(o(349));a||qo&127||ys(r,t,n)}return n}function ys(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=I.updateQueue,t===null?(t=us(),I.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bs(e,t,n,r){t.value=n,t.getSnapshot=r,Ss(t)&&Cs(e)}function xs(e,t,n){return n(function(){Ss(t)&&Cs(e)})}function Ss(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch{return!0}}function Cs(e){var t=Fi(e,2);t!==null&&Pd(t,e,2)}function ws(e){var t=z();if(typeof e==`function`){var n=e;if(e=n(),Zo){O(!0);try{n()}finally{O(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:e},t}function Ts(e,t,n,r){return e.baseState=n,gs(e,L,typeof r==`function`?r:ms)}function Es(e,t,n,r,i){if(mc(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};T.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Ds(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Ds(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=T.T,o={};o.types=a===null?null:a.types,T.T=o;try{var s=n(i,r),c=T.S;c!==null&&c(o,s),Os(e,t,s)}catch(n){As(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),T.T=a}}else try{a=n(i,r),Os(e,t,a)}catch(n){As(e,t,n)}}function Os(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ks(e,t,n)},function(n){return As(e,t,n)}):ks(e,t,n)}function ks(e,t,n){t.status=`fulfilled`,t.value=n,js(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ds(e,n)))}function As(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,js(t),t=t.next;while(t!==r)}e.action=null}function js(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ms(e,t){return t}function Ns(e,t){if(P){var n=q.formState;if(n!==null){a:{var r=I;if(P){if(N){b:{for(var i=N,a=fa;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){N=lm(i.nextSibling),r=i.data===`F!`;break a}}ma(r)}r=!1}r&&(t=n[0])}}return n=z(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:t},n.queue=r,n=dc.bind(null,I,r),r.dispatch=n,r=ws(!1),a=pc.bind(null,I,!1,r.queue),r=z(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Es.bind(null,I,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ps(e){return Fs(B(),L,e)}function Fs(e,t,n){if(t=gs(e,t,Ms)[0],e=hs(ms)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ds(t)}catch(e){throw e===eo?no:e}else r=t;t=B();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(I.flags|=2048,Rs(9,{destroy:void 0},Is.bind(null,i,n),null)),[r,a,e]}function Is(e,t){e.action=t}function Ls(e){var t=B(),n=L;if(n!==null)return Fs(t,n,e);B(),t=t.memoizedState,n=B();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=I.updateQueue,t===null&&(t=us(),I.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function zs(){return B().memoizedState}function Bs(e,t,n,r){var i=z();I.flags|=e,i.memoizedState=Rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Vs(e,t,n,r){var i=B();r=r===void 0?null:r;var a=i.memoizedState.inst;L!==null&&r!==null&&ns(r,L.memoizedState.deps)?i.memoizedState=Rs(t,a,n,r):(I.flags|=e,i.memoizedState=Rs(1|t,a,n,r))}function Hs(e,t){Bs(8390656,8,e,t)}function Us(e,t){Vs(2048,8,e,t)}function Ws(e){I.flags|=4;var t=I.updateQueue;if(t===null)t=us(),I.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gs(e){var t=B().memoizedState;return Ws({ref:t,nextImpl:e}),function(){if(K&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Ks(e,t){return Vs(4,2,e,t)}function qs(e,t){return Vs(4,4,e,t)}function Js(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ys(e,t,n){n=n==null?null:n.concat([e]),Vs(4,4,Js.bind(null,t,e),n)}function Xs(){}function Zs(e,t){var n=B();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ns(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qs(e,t){var n=B();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ns(t,r[1]))return r[0];if(r=e(),Zo){O(!0);try{e()}finally{O(!1)}}return n.memoizedState=[r,t],r}function $s(e,t,n){return n===void 0||qo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),I.lanes|=e,od|=e,n)}function ec(e,t,n,r){return Yr(n,t)?n:jo.current===null?!(qo&106)||qo&1073741824&&!(Y&261930)?(V=!0,e.memoizedState=n):(e=Md(),I.lanes|=e,od|=e,t):(e=$s(e,n,r),Yr(e,t)||(V=!0),e)}function tc(e,t,n,r,i){var a=E.p;E.p=a!==0&&8>a?a:8;var o=T.T,s={};s.types=o===null?null:o.types,T.T=s,pc(e,!1,t,n);try{var c=i(),l=T.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Ja(c,r),jd(e)):fc(e,t,r,jd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{E.p=a,o!==null&&s.types!==null&&(o.types=s.types),T.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=ic(e).queue;tc(e,i,t,Ee,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ee,baseState:Ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:Ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},jd())}function oc(){return ja(sh)}function sc(){return B().memoizedState}function cc(){return B().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=So(n);var r=Co(t,e,n);r!==null&&(Pd(r,t,n),wo(r,t,n)),t={cache:La()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=Pi(e,t,n,r),n!==null&&(Pd(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,jd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Yr(s,o))return Ni(e,t,i,0),q===null&&Mi(),!1}catch{}if(n=Pi(e,t,i,r),n!==null)return Pd(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(o(479))}else t=Pi(e,n,r,2),t!==null&&Pd(t,e,2)}function mc(e){var t=e.alternate;return e===I||t!==null&&t===I}function hc(e,t){Xo=Yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tt(e,n)}}var _c={readContext:ja,use:fs,useCallback:R,useContext:R,useEffect:R,useImperativeHandle:R,useLayoutEffect:R,useInsertionEffect:R,useMemo:R,useReducer:R,useRef:R,useState:R,useDebugValue:R,useDeferredValue:R,useTransition:R,useSyncExternalStore:R,useId:R,useHostTransitionStatus:R,useFormState:R,useActionState:R,useOptimistic:R,useMemoCache:R,useCacheRefresh:R,useEffectEvent:R},vc={readContext:ja,use:fs,useCallback:function(e,t){return z().memoizedState=[e,t===void 0?null:t],e},useContext:ja,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=z();t=t===void 0?null:t;var r=e();if(Zo){O(!0);try{e()}finally{O(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=z();if(n!==void 0){var i=n(t);if(Zo){O(!0);try{n(t)}finally{O(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=uc.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=z();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=dc.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(z(),e,t)},useTransition:function(){var e=ws(!1);return e=tc.bind(null,I,e.queue,!0,!1),z().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,i=z();if(P){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),q===null)throw Error(o(349));Y&127||ys(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Hs(xs.bind(null,r,a,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},bs.bind(null,r,a,n,t),null),n},useId:function(){var e=z(),t=q.identifierPrefix;if(P){var n=ia,r=ra;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ts++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:oc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e){var t=z();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pc.bind(null,I,!0,n),n.dispatch=t,[e,t]},useMemoCache:ps,useCacheRefresh:function(){return z().memoizedState=lc.bind(null,I)},useEffectEvent:function(e){var t=z(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},yc={readContext:ja,use:fs,useCallback:Zs,useContext:ja,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:hs,useRef:zs,useState:function(){return hs(ms)},useDebugValue:Xs,useDeferredValue:function(e,t){return ec(B(),L.memoizedState,e,t)},useTransition:function(){var e=hs(ms)[0],t=B().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:sc,useHostTransitionStatus:oc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){return Ts(B(),L,e,t)},useMemoCache:ps,useCacheRefresh:cc,useEffectEvent:Gs},bc={readContext:ja,use:fs,useCallback:Zs,useContext:ja,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:_s,useRef:zs,useState:function(){return _s(ms)},useDebugValue:Xs,useDeferredValue:function(e,t){var n=B();return L===null?$s(n,e,t):ec(n,L.memoizedState,e,t)},useTransition:function(){var e=_s(ms)[0],t=B().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:sc,useHostTransitionStatus:oc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){var n=B();return L===null?(n.baseState=e,[e,n.queue.dispatch]):Ts(n,L,e,t)},useMemoCache:ps,useCacheRefresh:cc,useEffectEvent:Gs};function xc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Sc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=So(r);i.payload=t,n!=null&&(i.callback=n),t=Co(e,i,r),t!==null&&(Pd(t,e,r),wo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=So(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Co(e,i,r),t!==null&&(Pd(t,e,r),wo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=So(n);r.tag=2,t!=null&&(r.callback=t),t=Co(e,r,n),t!==null&&(Pd(t,e,n),wo(t,e,n))}};function Cc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Xr(n,r)||!Xr(i,a):!0}function wc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Sc.enqueueReplaceState(t,t.state,null)}function Tc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=C({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ec(e){Oi(e)}function Dc(e){console.error(e)}function Oc(e){Oi(e)}function kc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function jc(e,t,n){return n=So(n),n.tag=3,n.payload={element:null},n.callback=function(){kc(e,t)},n}function Mc(e){return e=So(e),e.tag=3,e}function Nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ac(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ac(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Pc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Oa(t,n,i,!0),n=Io.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Lo===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,i)),!1;case 22:return n.flags|=65536,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,i)),!1}throw Error(o(435,n.tag))}return mf(e,r,i),Kd(),!1}if(P)return t=Io.current,t===null?(r!==pa&&(t=Error(o(423),{cause:r}),ba(Yi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Yi(r,n),i=jc(e.stateNode,r,i),To(e,i),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==pa&&(e=Error(o(422),{cause:r}),ba(Yi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=Yi(a,n),dd===null?dd=[a]:dd.push(a),ad!==4&&(ad=2),t===null)return!0;r=Yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=jc(n.stateNode,r,e),To(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(vd===null||!vd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Mc(i),Nc(i,e,n,r),To(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Fc=Error(o(461)),V=!1;function Ic(e,t,n,r){t.child=e===null?vo(t,null,n,r):_o(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Aa(t),r=rs(e,t,n,o,a,i),s=ss(),e!==null&&!V?(cs(e,t,i),ul(e,t,i)):(P&&s&&sa(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Bi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Ui(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Xr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Vi(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Xr(a,r)&&e.ref===t.ref){if(V=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(V=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Qa(t,a===null?null:a.cachePool),a===null?Po():No(t,a),Bo(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Qa(t,null),Po(),Vo()):(Qa(t,a.cachePool),No(t,a),Vo(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Za();return a=a===null?null:{parent:F._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Qa(t,null),Po(),Bo(t),e!==null&&Oa(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return _o(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Ho(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(P){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(zo(t),(e=N)?(e=am(e,fa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:na===null?null:{id:ra,overflow:ia},retryLane:536870912,hydrationErrors:null},n=Ki(e),n.return=t,t.child=n,ua=t,N=null)):e=null,e===null)throw ma(t);return t.lanes=536870912,null}return Uc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(zo(t),i){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(V||Oa(e,t,n,!1),i=(n&e.childLanes)!==0,V||i){if(jo.current===null){if(r=q,r!==null&&(s=Et(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Fi(e,s),Pd(r,e,s),Fc;Kd()}t=Wc(e,t,n)}else e=a.treeContext,N=lm(s.nextSibling),ua=t,P=!0,da=null,fa=!1,e!==null&&la(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Vi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return Aa(t),n=rs(e,t,n,r,void 0,i),r=ss(),e!==null&&!V?(cs(e,t,i),ul(e,t,i)):(P&&r&&sa(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Aa(t),t.updateQueue=null,n=as(t,r,n,i),is(e),r=ss(),e!==null&&!V?(cs(e,t,a),ul(e,t,a)):(P&&r&&sa(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Aa(t),t.stateNode===null){var a=M,o=n.contextType;typeof o==`object`&&o&&(a=ja(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Sc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},bo(t),o=n.contextType,a.context=typeof o==`object`&&o?ja(o):M,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(xc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Sc.enqueueReplaceState(a,a.state,null),Oo(t,r,a,i),Do(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Tc(n,s);a.props=c;var l=a.context,u=n.contextType;o=M,typeof u==`object`&&u&&(o=ja(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&wc(t,a,r,o),yo=!1;var f=t.memoizedState;a.state=f,Oo(t,r,a,i),Do(),l=t.memoizedState,s||f!==l||yo?(typeof d==`function`&&(xc(t,n,d,r),l=t.memoizedState),(c=yo||Cc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,xo(e,t),o=t.memoizedProps,u=Tc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=M,typeof l==`object`&&l&&(c=ja(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&wc(t,a,r,c),yo=!1,f=t.memoizedState,a.state=f,Oo(t,r,a,i),Do();var p=t.memoizedState;o!==d||f!==p||yo||e!==null&&e.dependencies!==null&&ka(e.dependencies)?(typeof s==`function`&&(xc(t,n,s,r),p=t.memoizedState),(u=yo||Cc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ka(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=_o(t,e.child,null,i),t.child=_o(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function H(e,t,n,r){return va(),t.flags|=256,Ic(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:$a()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Uo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(P){if(i?Ro(t):Vo(),(e=N)?(e=am(e,fa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:na===null?null:{id:ra,overflow:ia},retryLane:536870912,hydrationErrors:null},n=Ki(e),n.return=t,t.child=n,ua=t,N=null)):e=null,e===null)throw ma(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Vo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Wi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Vc(null,r)):(Ro(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Vo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Vi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Wi(i,a,n,null),i.flags|=2):i=Vi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=$a():(s=F._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Vc(e.child,r)):(Ro(t),n=e.child,e=n.sibling,n=Vi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=zi(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return _o(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(Ro(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Vo(),a=i.fallback,s=t.mode,i=tl({mode:`visible`,children:i.children},s),a=Wi(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,_o(t,e.child,null,c),i=t.child,i.memoizedState=Zc(c),i.childLanes=Qc(e,r,c),t.memoizedState=Xc,Vc(null,i)):(Vo(),t.child=e.child,t.flags|=128,null);if(Ro(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,ba({value:i,source:null,stack:null})),nl(e,t,c)}if(V||Oa(e,t,c,!1),r=(c&e.childLanes)!==0,V||r){if(jo.current!==null)return nl(e,t,c);if(r=q,r!==null&&(i=Et(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Fi(e,i),Pd(r,e,i),Fc;return om(a)||Kd(),nl(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,N=lm(a.nextSibling),ua=t,P=!0,da=null,fa=!1,e!==null&&la(t,e),t=el(t,i.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ea(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ko(n)===null&&(t=e),e=e.sibling}return t}function ol(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Uo.current;if(t.flags&128)return Wo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Wo(t,o),i===`backwards`&&e!==null?(sl(e),Ic(e,t,r,n),sl(e)):Ic(e,t,r,n),r=P?$i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ko(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return wa(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Oa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Vi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ka(e)))}function fl(e,t,n){switch(t.tag){case 3:Fe(t,t.stateNode.containerInfo),wa(t,F,e.memoizedState.cache),va();break;case 27:case 5:Le(t);break;case 4:Fe(t,t.stateNode.containerInfo);break;case 10:wa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ro(t),t.flags|=128,null;r=Oa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Ro(t),e=ul(e,t,n),e===null?null:e.sibling)}Ro(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Oa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Wo(t,Uo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:wa(t,F,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)V=!0;else{if(!dl(e,n)&&!(t.flags&128))return V=!1,fl(e,t,n);V=!!(e.flags&131072)}}else V=!1,P&&t.flags&1048576&&oa(t,$i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=oo(t.elementType),t.type=e,typeof e==`function`)Bi(e)?(r=Tc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===de){t.tag=11,t=Lc(null,t,e,r,n);break a}if(i===me){t.tag=14,t=Rc(null,t,e,r,n);break a}if(i===w){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=we(e)||e,Error(o(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Tc(r,t.pendingProps),Yc(e,t,r,i,n);case 3:a:{if(Fe(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,xo(e,t),Oo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,wa(t,F,r),r!==a.cache&&Da(t,[F],n,!0),Do(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=H(e,t,r,n);break a}if(r!==i){i=Yi(Error(o(424)),t),ba(i),t=H(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(N=lm(e.firstChild),ua=t,P=!0,da=null,fa=!0,n=vo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(va(),r===i){t=ul(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:P||(t.stateNode=fp(t.type,t.pendingProps,Ne.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Le(t),e===null&&P&&(r=t.stateNode=hm(t.type,t.pendingProps,Ne.current),ua=t,fa=!0,i=N,Sp(t.type)?(um=i,N=lm(r.firstChild)):N=i),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&P&&((i=r=N)&&(r=rm(r,t.type,t.pendingProps,fa),r===null?i=!1:(t.stateNode=r,ua=t,N=lm(r.firstChild),fa=!1,i=!0)),i||ma(t)),Le(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=rs(e,t,os,null,null,n),sh._currentValue=i),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&P&&((e=n=N)&&(n=im(n,t.pendingProps,fa),n===null?e=!1:(t.stateNode=n,ua=t,N=null,e=!0)),e||ma(t)),null;case 13:return $c(e,t,n);case 4:return Fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_o(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Aa(t),i=ja(i),r=r(i),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Aa(t),r=ja(F),e===null?(i=Za(),i===null&&(i=q,a=La(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},bo(t),wa(t,F,i)):((e.lanes&n)!==0&&(xo(e,t),Oo(t,null,null,n),Do()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,wa(t,F,r),r!==i.cache&&Da(t,[F],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),wa(t,F,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:P&&sa(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw so=ro,to}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw so=ro,to}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:bt(),e.lanes|=t,ud|=t)}function vl(e,t){if(!P)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function U(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function yl(e,t,n){var r=t.pendingProps;switch(ca(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return U(t),null;case 1:return U(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ta(F),Ie(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(_a(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ya())),U(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(ml(t),a===null?(U(t),hl(t,i,null,r,n)):(U(t),gl(t,a))):a?a===e.memoizedState?(U(t),t.flags&=-16777217):(ml(t),U(t),gl(t,a)):(e=e.memoizedProps,e!==r&&ml(t),U(t),hl(t,i,e,r,n)),null;case 27:if(Re(t),n=Ne.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return U(t),t.subtreeFlags&=-33554433,null}e=je.current,_a(t)?ha(t,e):(e=hm(i,r,n),t.stateNode=e,ml(t))}return U(t),t.subtreeFlags&=-33554433,null;case 5:if(Re(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return U(t),t.subtreeFlags&=-33554433,null}if(a=je.current,_a(t))ha(t,a);else{var s=lp(Ne.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[Mt]=t,a[Nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return U(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=Ne.current,_a(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ua,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||ma(t,!0)}else e=lp(e).createTextNode(r),e[Mt]=t,t.stateNode=e}return U(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=_a(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[Mt]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),e=!1}else n=ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ho(t),t):(Ho(t),null);if(t.flags&128)throw Error(o(558))}return U(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=_a(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[Mt]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),i=!1}else i=ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ho(t),t):(Ho(t),null)}return Ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),U(t),null);case 4:return Ie(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,U(t),null;case 10:return Ta(t.type),U(t),null;case 19:if(Go(t),r=t.memoizedState,r===null)return U(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)vl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ko(e),a!==null){for(t.flags|=128,vl(r,!1),e=a.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Hi(n,e),n=n.sibling;return Wo(t,Uo.current&1|2),P&&aa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ze()>gd&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Ko(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!P)return U(t),null}else 2*Ze()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ze(),e.sibling=null,a=Uo.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||P?Wo(t,a):(n=a,D(Io,t),D(Uo,n),Lo===null&&(Lo=t)),P&&aa(t,r.treeForkCount),e}return U(t),null;case 22:case 23:return Ho(t),Fo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(U(t),t.subtreeFlags&6&&(t.flags|=8192)):U(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ae(Xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ta(F),U(t),null;case 25:return null;case 30:return t.flags|=33554432,U(t),null}throw Error(o(156,t.tag))}function bl(e,t){switch(ca(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ta(F),Ie(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Re(t),null;case 31:if(t.memoizedState!==null){if(Ho(t),t.alternate===null)throw Error(o(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Go(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ie(),null;case 10:return Ta(t.type),null;case 22:case 23:return Ho(t),Fo(),e!==null&&Ae(Xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ta(F),null;case 25:return null;default:return null}}function xl(e,t){switch(ca(t),t.tag){case 3:Ta(F),Ie();break;case 26:case 27:case 5:Re(t);break;case 4:Ie();break;case 31:t.memoizedState!==null&&Ho(t);break;case 13:Ho(t);break;case 19:Go(t);break;case 10:Ta(t.type);break;case 22:case 23:Ho(t),Fo(),e!==null&&Ae(Xa);break;case 24:Ta(F)}}function Sl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Cl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ao(t,n)}catch(t){Z(e,e.return,t)}}}function Tl(e,t,n){n.props=Tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ti(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&em(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&tm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Nt]=t}catch(t){Z(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dn)),Ol(e,r),k=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),k=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[Mt]=e,t[Nt]=n}catch(t){Z(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Bl=!0,Tp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=Di(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ti(r,n),a=Di(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Nd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Di(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=Di(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Nd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode);t=Di(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ti(n,r),a=Di(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,W=!1,ou=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,du=!1,fu=!1,pu=!1;function mu(e,t,n){if(e=e.containerInfo,sp=gh,e=ti(e),ni(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),hu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),hu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),hu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&$l(e),hu(n))}}Vl=null}function hu(e){for(;lu!==null;){var t=lu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=Tc(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Ti(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=Di(i.default,i.update),i!==`none`&&Kl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,lu=r;break}lu=t.return}}function gu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&Sl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Tc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Fu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ao(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Fu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||W;t=au,i=W,au=r,(W=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),au=t,W=i}break;case 30:Fu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Fu(e,n)}}function _u(e,t){for(e=e.child;e!==null;)vu(e,t),e=e.sibling}function vu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}yu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,k=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function yu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:vu(n,r);break a;case 22:n.memoizedState===null&&yu(n,r);break a;default:yu(n,r)}}e=e.sibling}}function bu(e){var t=e.alternate;t!==null&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var G=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(st&&typeof st.onCommitFiberUnmount==`function`)try{st.onCommitFiberUnmount(ot,n)}catch{}switch(n.tag){case 26:W||Dl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!W&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:W||Dl(n,t),Al(n);var r=G,i=xu;Sp(n.type)&&(G=n.stateNode,xu=!1),Su(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),G=r,xu=i;break;case 5:W||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=G,i=xu,G=null,Su(e,t,n),G=r,xu=i,G!==null){if(xu)try{(G.nodeType===9?G.body:G.nodeName===`HTML`?G.ownerDocument.body:G).removeChild(n.stateNode),k=!0}catch(e){Z(n,t,e)}else try{G.removeChild(n.stateNode),k=!0}catch(e){Z(n,t,e)}}break;case 18:G!==null&&(xu?(e=G,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(G,n.stateNode));break;case 4:r=G,i=xu,G=n.stateNode.containerInfo,xu=!0,Su(e,t,n),G=r,xu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),W||Cl(4,n,t),Su(e,t,n);break;case 1:W||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:W=(r=W)||n.memoizedState!==null,Su(e,t,n),W=r;break;case 30:Dl(n,t),Su(e,t,n);break;case 7:W||Dl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(o(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Ou(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){G=l.stateNode,xu=!1;break a}break;case 5:G=l.stateNode,xu=!1;break a;case 3:case 4:G=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(G===null)throw Error(o(160));Cu(s,c,a),G=null,xu=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}Ou(t,e,n),ju(e),i&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),i&512&&(W||r===null||Dl(r,r.return)),i&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=ku,Ou(t,e,n),ju(e),i&512&&(W||r===null||Dl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[zt]||r[Mt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[Mt]=e,Kt(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[Mt]=e,Kt(r),t=r}e.stateNode=t}}else au||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||W||t.parentNode.removeChild(t)):i.count--,n===null?au||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),i&512&&(W||r===null||Dl(r,r.return)),r!==null&&i&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=ou,ou=!1,Ou(t,e,n),ou=a,ju(e),i&512&&(W||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{yn(t,``),k=!0}catch(t){Z(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),i&1024&&(su=!0);break;case 6:if(Ou(t,e,n),ju(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,k=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(k=!1,Wm=null,a=ku,ku=bm(t.containerInfo),Ou(t,e,n),ku=a,ju(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}su&&(su=!1,Mu(e)),k=!1;break;case 4:i=ou,ou=au,r=nn(),a=ku,ku=bm(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=a,k&&du&&(fu=!0),k=r,ou=i;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Ze()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=W,u=ou;au=c||a,ou=u||a,W=l||s,Ou(t,e,n),W=l,ou=u,au=c,ju(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||au||W||(t=s||W,n=au,r=W,au=a||au,W=t,Iu(e,2),au=n,W=r),!a&&ou||_u(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:i&512&&(W||r===null||Dl(r,r.return)),i=nn(),a=du,s=(n&335544064)===n,c=e.memoizedProps,du=s&&Di(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&k&&(e.flags|=4),du=a,k=i;break;case 21:break;case 7:i&512&&(W||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ml(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(jl(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(yn(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(o(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else iu(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(pu=uu=!1,Wl(),Nu(t,e),!uu&&!fu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),pu=!0}Ul=null;break;case 5:Nu(t,e);break;case 4:r=uu,uu=!1,Nu(t,e),uu&&(fu=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Xl(e,!1));break;case 30:r=uu,i=Wl(),uu=!1,Nu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ti(a,o),o=Ti(n.memoizedProps,o);var s=Di(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),uu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Iu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Iu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Iu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||W||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Dl(n,n.return),Iu(n,r);break;case 7:Dl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Lu(i,a,n),Sl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)ko(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||Km(bm(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),El(a,a.return);break;case 30:Lu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ra(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ra(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&pu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ra(a)));break;case 12:if(a&2048){Bu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Hu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=ku;ku=bm(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Cl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(bu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var Qu={getCacheForType:function(e){var t=ja(F),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ja(F).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return K&2&&Y!==0?Y&-Y:T.T===null?kt():Pf()}function Md(){if(ld===0){if(!(Y&536870912)||P){var e=pt;pt<<=1,!(pt&3932160)&&(pt=262144),ld=e}else ld=536870912}return e=Io.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(Ti(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Y,ld,!1)),St(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(sd|=n),ad===4&&Rd(e,Y,ld,!1)),Ef(e))}function Fd(e,t,n){if(K&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||_t(e,t),i=r?Yd(e,t):qd(e,t,!0),a=r;do{if(i===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Ld(n))i=qd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=a,sd|=a,i=4;break a}a=fd,fd=i,a!==null&&(fd===null?fd=a:fd.push.apply(fd,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=md+300-Ze(),10<i)){if(Rd(r,t,ld,!td),gt(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,a,`Throttled`,-0,0),i);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,a,null,-0,0)}break}}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dn},Vl=null,Ku(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Ze():(a&4194048)===a?hd-Ze():0,m=eh(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rd(e,t,n,r){t=vt(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ct(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&wt(e,n,t)}function zd(){return K&6?!0:(Df(0,!1),!1)}function Bd(){if(J!==null){if(X===0)var e=J.return;else e=J,Ca=Sa=null,ls(e),uo=null,fo=0,e=J;for(;e!==null;)xl(e.alternate,e),e=e.return;J=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),q=e,J=n=Vi(e.current,null),Y=t,X=0,ed=null,td=!1,nd=_t(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=vt(e,t),Mi(),n}function Hd(e,t){I=null,T.H=_c,t===eo||t===no?(t=co(),X=3):t===to?(t=co(),X=4):X=t===Fc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,J===null&&(ad=1,kc(e,Yi(t,e.current)))}function Ud(){var e=Io.current;return e===null?!0:(Y&4194048)===Y?Lo===null:(Y&62914560)===Y||Y&536870912?e===Lo:!1}function Wd(){var e=T.H;return T.H=_c,e===null?_c:e}function Gd(){var e=T.A;return T.A=Qu,e}function Kd(){ad=4,td||(Y&4194048)!==Y&&Io.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||q===null||Rd(q,Y,ld,!1)}function qd(e,t,n){var r=K;K|=2;var i=Wd(),a=Gd();(q!==e||Y!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if(X!==0&&J!==null){var s=J,c=ed;switch(X){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Io.current===null&&(t=!0);var l=X;if(X=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=X,X=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,Ca=Sa=null,K=r,T.H=i,T.A=a,J===null&&(q=null,Y=0,Mi()),o}function Jd(){for(;J!==null;)Zd(J)}function Yd(e,t){var n=K;K|=2;var r=Wd(),i=Gd();q!==e||Y!==t?(_d=null,gd=Ze()+500,Vd(e,t)):nd=_t(e,t);a:do try{if(X!==0&&J!==null){t=J;var a=ed;b:switch(X){case 1:X=0,ed=null,$d(e,t,a,1);break;case 2:case 9:if(io(a)){X=0,ed=null,Qd(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),Ef(e)},a.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:io(a)?(X=0,ed=null,Qd(t)):(X=0,ed=null,$d(e,t,a,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Ym(s):c.stateNode.complete){X=0,ed=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,ef(u))}break b}}X=0,ed=null,$d(e,t,a,5);break;case 6:X=0,ed=null,$d(e,t,a,6);break;case 8:Bd(),ad=6;break a;default:throw Error(o(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return Ca=Sa=null,T.H=r,T.A=i,K=n,J===null?(q=null,Y=0,Mi(),ad):0}function Xd(){for(;J!==null&&!Ye();)Zd(J)}function Zd(e){var t=pl(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ls(t);var r=t;r===ua&&(P?(ga(r),r.tag===5&&r.stateNode!=null&&(N=r.stateNode)):(ga(r),P=!0));default:xl(n,t),t=J=Hi(t,id),t=pl(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function $d(e,t,n,r){Ca=Sa=null,ls(t),uo=null,fo=0;var i=t.return;try{if(Pc(e,i,t,n,Y)){ad=1,kc(e,Yi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;ad=1,kc(e,Yi(n,e.current)),J=null;return}t.flags&32768?(P||r===1?e=!0:nd||Y&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=Io.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=yl(t.alternate,t,id);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);ad=6,J=null}function nf(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(K&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===q&&(J=q=null,Y=0),xd=t,bd=e,Sd=n,wd=i,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=ji,Ct(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Va(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(tt,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=T.T,T.T=null,i=E.p,E.p=2,a=K,K|=4;try{mu(e,t,n)}finally{K=a,E.p=i,T.T=r}}yd=1,Bl?Ed=Mp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,Pu(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=T.T,T.T=null;var i=E.p;E.p=2;var a=K;K|=4;try{du=fu=!1,Au(t,e,n),n=cp;var o=ti(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&ei(s.ownerDocument.documentElement,s)){if(c!==null&&ni(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=$r(s,h),v=$r(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{K=a,E.p=i,T.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=T.T,T.T=null;var r=E.p;E.p=2;var i=K;K|=4;try{gu(e,t.alternate,t)}finally{K=i,E.p=r,T.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,Xe();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),Ot(r),n=n.stateNode,st&&typeof st.onCommitFiberRoot==`function`)try{st.onCommitFiberRoot(ot,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=T.T,a=E.p,E.p=2,T.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{T.T=n,E.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ra(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=Ot(Sd),r=T.T,i=E.p;try{E.p=32>n?32:n,T.T=null,n=wd,wd=null;var a=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,K&6)throw Error(o(331));var c=K;if(K|=4,Yu(a.current),Vu(a,a.current,s,n),K=c,Df(0,!1),st&&typeof st.onPostCommitFiberRoot==`function`)try{st.onPostCommitFiberRoot(ot,a)}catch{}return!0}finally{E.p=i,T.T=r,uf(e,t)}}function pf(e,t,n){t=Yi(n,t),t=jc(e.stateNode,t,2),e=Co(e,t,2),e!==null&&(St(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Yi(n,e),n=Mc(2),r=Co(t,n,2),r!==null&&(Nc(n,r,t,e),St(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(rd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(ad===4||ad===3&&(Y&62914560)===Y&&300>Ze()-md?K&2?cd|=n:Vd(e,0):cd|=n,ud===Y&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=bt()),e=Fi(e,t),e!==null&&(St(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return qe(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ct(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Y,a=gt(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||_t(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=Ze(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ct(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=yt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=gt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||_t(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Je(r),Ot(n)){case 2:case 8:n=et;break;case 32:n=tt;break;case 268435456:n=rt;break;default:n=tt}return r=jf.bind(null,e),n=qe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Je(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Y;return r=gt(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Ze()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){K&6?qe($e,Of):kf()})}function Pf(){if(Tf===0){var e=Wa;e===0&&(e=ft,ft<<=1,!(ft&261888)&&(ft=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:En(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Nt]||null).action),o=r.submitter;o&&(t=(t=o[Nt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Jn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);rc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),rc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<Si.length;Lf++){var Rf=Si[Lf];Ci(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}Ci(mi,`onAnimationEnd`),Ci(hi,`onAnimationIteration`),Ci(gi,`onAnimationStart`),Ci(`dblclick`,`onDoubleClick`),Ci(`focusin`,`onFocus`),Ci(`focusout`,`onBlur`),Ci(_i,`onTransitionRun`),Ci(vi,`onTransitionStart`),Ci(yi,`onTransitionCancel`),Ci(bi,`onTransitionEnd`),Zt(`onMouseEnter`,[`mouseout`,`mouseover`]),Zt(`onMouseLeave`,[`mouseout`,`mouseover`]),Zt(`onPointerEnter`,[`pointerout`,`pointerover`]),Zt(`onPointerLeave`,[`pointerout`,`pointerover`]),Xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Oi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Oi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Ft];n===void 0&&(n=t[Ft]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Jt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Ht(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Pn(function(){var r=a,i=kn(n),o=[];a:{var s=xi.get(e);if(s!==void 0){var c=Jn,u=e;switch(e){case`keypress`:if(Un(n)===0)break a;case`keydown`:case`keyup`:c=fr;break;case`focusin`:u=`focus`,c=rr;break;case`focusout`:u=`blur`,c=rr;break;case`beforeblur`:case`afterblur`:c=rr;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=tr;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=nr;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=j;break;case mi:case hi:case gi:c=ir;break;case bi:c=hr;break;case`scroll`:case`scrollend`:c=Xn;break;case`wheel`:c=gr;break;case`copy`:case`cut`:case`paste`:c=ar;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=pr;break;case`submit`:c=mr;break;case`toggle`:case`beforetoggle`:c=_r}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Fn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==On&&(u=n.relatedTarget||n.fromElement)&&(Ht(u)||u[Pt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?Ht(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=tr,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=pr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:Wt(s),h=c==null?u:Wt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Ht(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?re(s,c,Yf):null,s!==null&&Xf(o,u,s,d,!1),c!==null&&f!==null&&Xf(o,f,c,d,!0)))}a:{if(s=r?Wt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Lr;else if(jr(s)){if(Rr)_=qr;else{_=Gr;var v=Wr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Cn(r.elementType)&&(_=Lr):_=Kr;if(_&&=_(e,r)){Mr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?Wt(r):window,e){case`focusin`:(jr(v)||v.contentEditable===`true`)&&(ii=v,ai=r,oi=null);break;case`focusout`:oi=ai=ii=null;break;case`mousedown`:si=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:si=!1,ci(o,n,i);break;case`selectionchange`:if(ri)break;case`keydown`:case`keyup`:ci(o,n,i)}var y;if(yr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Dr?Tr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(Sr&&n.locale!==`ko`&&(Dr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Dr&&(y=Hn()):(zn=i,Bn=`value`in zn?zn.value:zn.textContent,Dr=!0)),v=Jf(r,b),0<v.length&&(b=new or(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=Er(n),y!==null&&(b.data=y)))),(y=xr?Or(e,n):kr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new or(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),If(o,e,r,n,i)}Vf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Fn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Fn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Fn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Fn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
9
|
+
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&yn(e,``+r);else return;break;case`className`:an(e,`class`,r);break;case`tabIndex`:an(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:an(e,n,r);break;case`style`:Sn(e,r,a);return;case`data`:if(t!==`object`){an(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=En(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=En(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Dn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=En(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),rn(e,`popover`,r);break;case`xlinkActuate`:A(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:A(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:A(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:A(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:A(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:A(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:A(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:A(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:A(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:rn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=wn.get(n)||n,rn(e,n,r);else return}k=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:Sn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)yn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Dn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Yt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[Nt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}k=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):rn(e,n,r)}return}k=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:$(e,t,a,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:$(e,t,r,d,n,null)}}mn(e,a,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&gn(e,!!r,n,!0):gn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:$(e,t,s,c,n,null)}vn(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:$(e,t,u,r,n,null)}return;default:if(Cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(k=!0),a=m;break;case`name`:m!==f&&(k=!0),i=m;break;case`checked`:m!==f&&(k=!0),u=m;break;case`defaultChecked`:m!==f&&(k=!0),d=m;break;case`value`:m!==f&&(k=!0),s=m;break;case`defaultValue`:m!==f&&(k=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}pn(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||$(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(k=!0),p=a;break;case`defaultValue`:a!==l&&(k=!0),c=a;break;case`multiple`:a!==l&&(k=!0),s=a;default:a!==l&&$(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?gn(e,!!n,n?[]:``,!1):gn(e,!!n,t,!0)):gn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(k=!0),p=i;break;case`defaultValue`:i!==a&&(k=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&$(e,t,s,i,r,a)}_n(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(k=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[Mt]=r,n[Nt]=t,np(n,e,t),Kt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[zt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:C({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Ht(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=re(n,a,S),t===null?t=!1:(h(t,!0,te,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=re(r,a,S),t===null?t=!1:(h(t,!0,ne,a,r),a=x,ee=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),Zp(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Vt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[zt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Dn&&(e.onclick=null),Vt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=E.d;E.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Ut(e);t!==null&&t.tag===5&&t.type===`form`?ac(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=fn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Kt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+fn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+fn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+fn(n.imageSizes)+`"]`)):i+=`[href="`+fn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=C({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Bt]=!0,o.onload=o.onerror=function(){qt(o)}),Kt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+fn(r)+`"][href="`+fn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=C({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Kt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Gt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=C({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Kt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Gt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=C({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Kt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Gt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=C({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Kt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=Ne.current)?bm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Gt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=Gt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Fm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Gt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pm(e){return`href="`+fn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Bt]){r.loading=1;return}}else t=e.createElement(`link`),t[Bt]=!0,t.onload=t.onerror=qt.bind(null,t),np(t,`link`,n),Kt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+fn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+fn(n.href)+`"]`);if(r)return t.instance=r,Kt(r),r;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Kt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Kt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Kt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Kt(i),i):(r=n,(i=vm.get(a))&&(r=C({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Kt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[zt]||a[Mt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Kt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:w,Provider:null,Consumer:null,_currentValue:Ee,_currentValue2:Ee,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xt(0),this.hiddenUpdates=xt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=zi(3,null,null,t),e.current=a,a.stateNode=e,t=La(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},bo(a),e}function uh(e){return e?(e=M,e):M}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=So(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Co(e,r,t),n!==null&&(Pd(n,e,t),wo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Fi(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=Dt(t);var n=Fi(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=2,yh(e,t,n,r)}finally{E.p=a,T.T=i}}function vh(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=8,yh(e,t,n,r)}finally{E.p=a,T.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ht(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ct(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(K&6)&&(gd=Ze()+500,Df(0,!1))}}break;case 31:case 13:s=Fi(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=kn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Ht(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Qe()){case $e:return 2;case et:return 8;case tt:case nt:return 32;case rt:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ut(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Ht(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,At(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,At(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);On=r,n.target.dispatchEvent(r),On=null}else return t=Ut(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Ut(n);a!==null&&(e.splice(t,3),t-=3,rc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Nt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Nt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Pt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=kt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(o(527,Kh,`19.3.1`));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:T,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{ot=Jh.inject(qh),st=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(o(299));var n=!1,r=``,i=Ec,a=Dc,s=Oc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,s,Uh),e[Pt]=t.current,Wf(e),new Wh(t)}})),l=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=c()})),u=e(r(),1),d=l(),f=/^([a-z0-9][a-z0-9_-]*):([a-z0-9][a-z0-9_-]*)$/i,p=[`database`,`queue`,`user`,`choice`,`success`,`warning`,`gateway`,`event`,`server`,`note`,`service`],m={cart:`lucide:shopping-cart`,cloud:`lucide:cloud`,api:`lucide:waypoints`,person:`lucide:user`,actor:`lucide:user`,lambda:`logos:aws-lambda`,aws:`logos:aws`,azure:`logos:microsoft-azure`,gcp:`logos:google-cloud`,k8s:`logos:kubernetes`,docker:`logos:docker`,postgres:`logos:postgresql`,redis:`logos:redis`,kafka:`logos:kafka`,github:`logos:github-icon`,vercel:`simple-icons:vercel`};function h(e){let t=e.trim();return!t||t===`none`?`none`:m[t.toLowerCase()]||(f.test(t)?t.toLowerCase():p.includes(t.toLowerCase())?`builtin:${t.toLowerCase()}`:`lucide:${t.toLowerCase()}`)}function g(e){let t=h(e);if(t===`none`)return null;let n=f.exec(t);return n?{prefix:n[1].toLowerCase(),name:n[2].toLowerCase(),id:t}:null}function _(){return p.map(e=>`builtin:${e}`)}var v=`0 0 20 20`;function y(e){return{body:`<g class="flow-node-icon-glyph" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" opacity="0.88">${e}</g>`,viewBox:v,width:20,height:20,paint:`stroke`}}var b={database:y(`<ellipse cx="10" cy="4" rx="8" ry="3"/><path d="M2 4v12c0 1.7 3.6 3 8 3s8-1.3 8-3V4"/><path d="M2 10c0 1.7 3.6 3 8 3s8-1.3 8-3"/>`),queue:y(`<path d="M5 5h8a4 4 0 0 1 0 10H5a4 4 0 0 1 0-10Z"/><path d="M5 5a4 4 0 0 0 0 10"/>`),user:y(`<circle cx="10" cy="7" r="4"/><path d="M3 18c0-3.9 3.1-7 7-7s7 3.1 7 7"/>`),choice:y(`<path d="M10 3 17 10 10 17 3 10Z"/><path d="M10 7v6M7 10h6"/>`),success:y(`<path d="M6 10l3 3 6-7"/>`),warning:y(`<path d="M10 4 17 17H3Z"/><path d="M10 9v4M10 15h.01"/>`),gateway:y(`<path d="M3 10h14M10 3v14M6 6l8 8M14 6 6 14"/>`),event:y(`<path d="M5 10h10M10 5v10"/><circle cx="10" cy="10" r="7"/>`),server:y(`<rect x="3" y="3" width="14" height="14" rx="2"/><path d="M6 7h8M6 10h8M6 13h8"/><circle cx="15" cy="7" r="0.8" fill="currentColor" stroke="none"/>`),note:y(`<path d="M5 3h8l4 4v10H5Z"/><path d="M13 3v4h4"/>`),service:y(`<rect x="3" y="3" width="14" height="14" rx="3"/><path d="M6 8h8M6 11h8M6 14h5"/>`)};function x(e){let t=e.toLowerCase(),n=b[t];return n?{id:`builtin:${t}`,...n}:null}async function ee(e){if(typeof window<`u`)return null;try{let t=globalThis.process?.getBuiltinModule?.(`module`);if(!t)return null;let{createRequire:n}=t;return n(import.meta.url)(e)}catch{return null}}async function te(e){let t=await ee(e);if(t)return t;throw Error(`Complete Iconify collection "${e}" is unavailable in the browser; resolve individual icons or register a collection`)}var ne={mdi:()=>te(`@iconify-json/mdi/icons.json`),logos:()=>te(`@iconify-json/logos/icons.json`),lucide:()=>te(`@iconify-json/lucide/icons.json`),carbon:()=>te(`@iconify-json/carbon/icons.json`),"simple-icons":()=>te(`@iconify-json/simple-icons/icons.json`)},S=Object.freeze({left:0,top:0,width:16,height:16}),re=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),C=Object.freeze({...S,...re}),ie=Object.freeze({...C,body:``,hidden:!1}),ae=Object.freeze({width:null,height:null}),oe=Object.freeze({...ae,...re});function se(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function ce(e,t){let n=se(e,t);for(let r in ie)r in re?r in e&&!(r in n)&&(n[r]=re[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function le(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function ue(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=ce(r[e]||i[e],a)}return o(t),n.forEach(o),ce(e,a)}function w(e,t){if(e.icons[t])return ue(e,t,[]);let n=le(e,[t])[t];return n?ue(e,t,n):null}var de=/(-?[0-9.]*[0-9]+[0-9.]*)/g,fe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function pe(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(de);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=fe.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function me(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function he(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ge(e,t,n){let r=me(e);return he(r.defs,t+r.content+n)}var _e=e=>e===`unset`||e===`undefined`||e===`none`;function ve(e,t){let n={...C,...e},r={...oe,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=ge(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=pe(d,c/l)):(u=o===`auto`?c:o,d=s===null?pe(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{_e(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var ye=/\sid="(\S+)"/g,be=new Map;function xe(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=be.get(e)||0;return be.set(e,t+1),t?`${e}${t}`:e}function Se(e){let t=[],n;for(;n=ye.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=xe(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function Ce(e){let t=e.trim().toLowerCase();if(t===`black`)return{r:0,g:0,b:0};if(t===`white`)return{r:255,g:255,b:255};let n=/^#([0-9a-f]{3})$/i.exec(t);if(n){let e=n[1];return{r:Number.parseInt(e[0]+e[0],16),g:Number.parseInt(e[1]+e[1],16),b:Number.parseInt(e[2]+e[2],16)}}let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r){let e=r[1];return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16)}}let i=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(t);return i?{r:Number(i[1]),g:Number(i[2]),b:Number(i[3])}:null}function we(e,t,n){let r=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r[0]+.7152*r[1]+.0722*r[2]}function Te(e){let t=e.trim().toLowerCase();if(!t||t===`none`||t===`currentcolor`||t===`transparent`||t.startsWith(`url(`)||t.startsWith(`var(`))return!1;let n=Ce(t);if(!n)return!1;let r=we(n.r,n.g,n.b),i=Math.max(n.r,n.g,n.b),a=Math.min(n.r,n.g,n.b),o=i===0?0:(i-a)/i;return r<=.28&&o<.45||r<=.12}function T(e){return e.replace(/\b(fill|stroke)="([^"]*)"/gi,(e,t,n)=>Te(n)?`${t}="currentColor"`:e)}function E(e){return`brand`}function Ee(e,t,n){if(t===`theme`||t===`brand`)return t;if(n?.hasIconColor)return`theme`;let r=g(e);return r?E(r.prefix):`brand`}var De=1.75;function Oe(e,t,n={}){let r=n.maxAspect??De,i=e.width>0&&e.height>0?e.width/e.height:1,a=Math.min(t*i,t*r);return{width:Math.max(0,a),height:Math.max(0,t)}}var ke=new Map,Ae=new Map(Object.entries(ne)),D=new Map,je=new Map,Me=new Map,Ne=new Set,Pe=`https://api.iconify.design`;function Fe(e){let t=e.left??0,n=e.top??0,r=e.width??16,i=e.height??16;return{viewBox:`${t} ${n} ${r} ${i}`,width:r,height:i}}function Ie(e,t){let n=ve(t,{height:`unset`,width:`unset`}),r=Fe(t);return{id:e,body:Se(n.body),viewBox:n.attributes.viewBox??r.viewBox,width:r.width,height:r.height,paint:`fill`}}function Le(e){Pe=e.replace(/\/$/,``)}async function Re(e){let t=e.toLowerCase(),n=ke.get(t);if(n)return n;let r=D.get(t);if(!r){let e=Ae.get(t);if(!e)return D.set(t,Promise.resolve(null)),null;r=e().then(e=>(ke.set(t,e),e)).catch(e=>(D.delete(t),console.warn(`[kdiagram-icons] failed to load collection "${t}"`,e),null)),D.set(t,r)}return r}function ze(e,t,n){if(e===`builtin`)return x(t);let r=Me.get(n);if(r)return r;let i=ke.get(e);if(!i)return null;let a=w(i,t);return a?Ie(n,a):null}function Be(e,t){return e?{...e,...t,icons:{...e.icons,...t.icons},aliases:{...e.aliases,...t.aliases}}:t}async function Ve(e,t){if(typeof fetch!=`function`||t.length===0)return;let n=new URLSearchParams({icons:t.join(`,`)}),r=await fetch(`${Pe}/${encodeURIComponent(e)}.json?${n}`);if(!r.ok)throw Error(`Iconify API returned ${r.status} for collection "${e}"`);let i=await r.json();ke.set(e,Be(ke.get(e),i))}function He(e){let t=g(e);if(!t)return null;if(je.has(t.id))return je.get(t.id)??null;let n=ze(t.prefix,t.name,t.id);return(n||ke.has(t.prefix)||t.prefix===`builtin`)&&je.set(t.id,n),n}async function Ue(e){let t=[...e].map(e=>g(e)).filter(e=>e!=null),n=new Map;for(let e of t){if(e.prefix===`builtin`||je.has(e.id))continue;let t=n.get(e.prefix)??[];t.includes(e.name)||t.push(e.name),n.set(e.prefix,t)}let r=typeof window<`u`;await Promise.all([...n].map(async([e,t])=>{let n=ke.get(e),i=n?t.filter(e=>!w(n,e)):t;i.length!==0&&(!r||Ne.has(e)?await Re(e):await Ve(e,i))})).catch(e=>{console.warn(`[kdiagram-icons] failed to preload requested icons`,e)});for(let e of t)je.has(e.id)||je.set(e.id,ze(e.prefix,e.name,e.id))}function We(e){let t=new Set;for(let n of e){if(!n.icon||n.icon===`none`)continue;let e=h(n.icon);e!==`none`&&t.add(e)}return[...t]}var Ge=`var(--icon-color, var(--node-stroke, var(--kd-node-stroke)))`;function Ke(e,t,n,r={}){let{width:i,height:a}=Oe(e,r.height??20,{maxAspect:r.maxAspect}),o=r.paint??Ee(e.id,void 0,{hasIconColor:!!r.color}),s=r.className??`flow-node-icon-mark`,c=o===`theme`?T(e.body):e.body,l=r.color??(o===`theme`?Ge:``),u=l?`color="${l}"`:``;return`<g class="${s}" transform="translate(${t-i/2}, ${n-a/2})"${u?` ${u}`:``}><svg width="${i}" height="${a}" viewBox="${e.viewBox}" overflow="visible" aria-hidden="true">${c}</svg></g>`}function qe(e,t,n,r={}){let i=He(e);return i?Ke(i,t,n,{...r,paint:r.paint??Ee(e,void 0,{hasIconColor:!!r.color})}):``}function Je(e){return new Worker(new URL(`editor.worker-BmdWdrHZ.js`,import.meta.url).href,{name:e?.name})}self.MonacoEnvironment={getWorker(){return new Je}};var Ye=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Xe(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ye(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Ze=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Qe=e=>{let t=Ze(e);return t.charAt(0).toUpperCase()+t.slice(1)},$e=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),et={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function tt(e){return e!=null}function nt(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??et.width,a=e.size??e.height??et.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?$e(...c):$e(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??et[`stroke-width`])*Number(e.size??e.width??et.width)/Number(t.size??t.width??et.width):t.strokeWidth??et[`stroke-width`];return[`svg`,{...Object.entries(et).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&tt(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&tt(t.width)&&{[r(`width`)]:t.width},...`height`in t&&tt(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function rt(e,t={}){return nt(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var it=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},at=(0,u.createContext)({}),ot=()=>(0,u.useContext)(at),st=(0,u.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:d={node:l,aliases:[],size:24},...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=ot()??{},b=!!c||it(f),[x,ee,te=[]]=rt(d,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:$e(y,s),hasA11yProp:b,attributes:f});return(0,u.createElement)(x,{ref:p,...ee},[...te.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function O(e,t=[],n=[]){let r=typeof e==`string`?Xe(e,t,n):e,i=(0,u.forwardRef)(({className:e,...t},n)=>(0,u.createElement)(st,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Qe(r.name)),i}var ct={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};ct.node;var lt=O(ct),ut={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};ut.node;var dt=O(ut),ft={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};ft.node;var pt=O(ft),mt={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};mt.node;var ht=O(mt),gt={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};gt.node;var _t=O(gt),vt={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};vt.node;var yt=O(vt),bt={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};bt.node;var xt=O(bt),St={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};St.node;var Ct=O(St),wt={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};wt.node;var Tt=O(wt),Et={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Et.node;var Dt=O(Et),Ot={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Ot.node;var kt=O(Ot),At={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};At.node;var jt=O(At),Mt={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Mt.node;var Nt=O(Mt),Pt={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Pt.node;var Ft=O(Pt),It={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};It.node;var Lt=O(It),Rt={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};Rt.node;var zt=O(Rt),Bt={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Bt.node;var Vt=O(Bt),Ht={name:`save-all`,size:24,node:[[`path`,{d:`M10 2v3a1 1 0 0 0 1 1h5`,key:`1xspal`}],[`path`,{d:`M18 18v-6a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6`,key:`1ra60u`}],[`path`,{d:`M18 22H4a2 2 0 0 1-2-2V6`,key:`pblm9e`}],[`path`,{d:`M8 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9.172a2 2 0 0 1 1.414.586l2.828 2.828A2 2 0 0 1 22 6.828V16a2 2 0 0 1-2.01 2z`,key:`1yve0x`}]]};Ht.node;var Ut=O(Ht),Wt={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};Wt.node;var Gt=O(Wt),Kt={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};Kt.node;var qt=O(Kt),Jt={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Jt.node;var Yt=O(Jt),Xt={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Xt.node;var Zt=O(Xt),Qt={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Qt.node;var $t=O(Qt),en={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};en.node;var tn=O(en),k={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};k.node;var nn=O(k),rn=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),an=t(((e,t)=>{t.exports=rn()})),A=an();function on({diagnostics:e,onReveal:t}){return!e||e.length===0?(0,A.jsx)(`div`,{className:`diag diag-ok`,children:`No diagnostics`}):(0,A.jsx)(A.Fragment,{children:e.map((e,n)=>(0,A.jsxs)(`button`,{type:`button`,className:`diag diag-action diag-${e.severity}`,onClick:()=>t(e.range),children:[(0,A.jsx)(`strong`,{children:e.severity}),` `,(0,A.jsx)(`code`,{children:e.code}),` `,e.message,e.hint?(0,A.jsxs)(`span`,{className:`hint`,children:[` — `,e.hint]}):null]},`${e.code}-${n}`))})}function sn({icon:e,label:t,iconOnly:n,active:r,className:i,title:a,"aria-label":o,...s}){let c=[`icon-btn`,n?`icon-btn-only`:null,r?`active`:null,i].filter(Boolean).join(` `);return(0,A.jsxs)(`button`,{...s,type:`button`,className:c,title:a??(typeof t==`string`?t:void 0),"aria-label":o??(typeof t==`string`?t:void 0),"aria-pressed":r,children:[(0,A.jsx)(e,{size:16,strokeWidth:1.75,"aria-hidden":!0}),!n&&t!=null?(0,A.jsx)(`span`,{children:t}):null]})}var cn=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),ln=function(e,t){return new URL(e,t).href},un={},dn=function(e){return e.pathname.endsWith(`.css`)},fn=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},pn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ln(t,n);let r=s(t),i=dn(r);return fn(un,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:cn,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},mn=(0,u.lazy)(()=>pn(()=>import(`./SourceEditor-CVJmi6AX.js`).then(e=>({default:e.SourceEditor})),[],import.meta.url));function hn({source:e,onChange:t,diagnostics:n,themeMode:r,documents:i,activeDocumentId:a,onDocument:o,dirty:s,canSave:c,saveState:l,saveError:d,onSave:f,onSaveAs:p,onOpenFile:m,onFormat:h,revealRange:g,onRevealRange:_}){(0,u.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),c&&f())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c,f,!0]);let v=l===`saving`?`Saving…`:l===`saved`?`Saved`:l===`error`?d??`Save failed`:`Save source (⌘S)`;return(0,A.jsxs)(`section`,{className:`editor-pane`,children:[(0,A.jsxs)(`div`,{className:`editor-filebar`,role:`navigation`,"aria-label":`Open example`,children:[(0,A.jsx)(Ct,{size:14,strokeWidth:1.75,"aria-hidden":!0,className:`editor-filebar-icon`}),(0,A.jsxs)(`div`,{className:`editor-filebar-select-wrap`,children:[(0,A.jsx)(`select`,{className:`editor-filebar-select`,value:a,disabled:i.length===0,"aria-label":`Document`,onChange:e=>o(e.target.value),children:i.length===0?(0,A.jsx)(`option`,{value:``,children:`(none yet)`}):i.map(e=>(0,A.jsxs)(`option`,{value:e.id,children:[e.label,e.id===a&&s?` *`:``]},e.id))}),(0,A.jsx)(dt,{size:14,strokeWidth:2,"aria-hidden":!0,className:`editor-filebar-caret`})]}),s?(0,A.jsx)(`span`,{className:`editor-dirty-dot`,title:`Unsaved changes`,"aria-hidden":!0}):null,m?(0,A.jsx)(sn,{icon:Tt,iconOnly:!0,label:`Open .kdiagram file`,title:`Open .kdiagram file`,onClick:m}):null,(0,A.jsx)(sn,{icon:tn,iconOnly:!0,label:`Format source`,title:`Format source`,onClick:h}),(0,A.jsx)(sn,{icon:Gt,iconOnly:!0,label:`Save KDiagram source`,title:v,disabled:!c,active:l===`saved`,onClick:f}),p?(0,A.jsx)(sn,{icon:Ut,iconOnly:!0,label:`Save KDiagram source as`,title:`Save source as…`,onClick:p}):null]}),(0,A.jsx)(u.Suspense,{fallback:(0,A.jsx)(`div`,{className:`source-editor-loading`,children:`Loading editor…`}),children:(0,A.jsx)(mn,{value:e,onChange:t,themeMode:r,revealRange:g})}),(0,A.jsx)(`div`,{className:`pane-header pane-header-sub`,children:(0,A.jsxs)(`h2`,{children:[(0,A.jsx)($t,{size:14,strokeWidth:1.75,"aria-hidden":!0}),`Diagnostics`]})}),(0,A.jsx)(`div`,{className:`diagnostics`,children:(0,A.jsx)(on,{diagnostics:n,onReveal:_})})]})}var gn=new Set([`children`,`localName`,`ref`,`style`,`className`]),_n=new WeakMap,vn=(e,t,n,r,i)=>{let a=i?.[t];a===void 0?(e[t]=n,n==null&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==r&&((e,t,n)=>{let r=_n.get(e);r===void 0&&_n.set(e,r=new Map);let i=r.get(t);n===void 0?i!==void 0&&(r.delete(t),e.removeEventListener(t,i)):i===void 0?(r.set(t,i={handleEvent:n}),e.addEventListener(t,i)):i.handleEvent=n})(e,a,n)},yn=({react:e,tagName:t,elementClass:n,events:r,displayName:i})=>{let a=new Set(Object.keys(r??{})),o=e.forwardRef(((i,o)=>{let s=e.useRef(new Map),c=e.useRef(null),l={},u={};for(let[e,t]of Object.entries(i))gn.has(e)?l[e===`className`?`class`:e]=t:a.has(e)||e in n.prototype?u[e]=t:l[e]=t;return e.useLayoutEffect((()=>{if(c.current===null)return;let e=new Map;for(let t in u)vn(c.current,t,i[t],s.current.get(t),r),s.current.delete(t),e.set(t,i[t]);for(let[e,t]of s.current)vn(c.current,e,void 0,t,r);s.current=e})),e.useLayoutEffect((()=>{c.current?.removeAttribute(`defer-hydration`)}),[]),l.suppressHydrationWarning=!0,e.createElement(t,{...l,ref:e.useCallback((e=>{c.current=e,typeof o==`function`?o(e):o!==null&&(o.current=e)}),[o])})}));return o.displayName=i??n.name,o},bn=globalThis,xn=bn.ShadowRoot&&(bn.ShadyCSS===void 0||bn.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,Sn=Symbol(),Cn=new WeakMap,wn=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Sn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(xn&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Cn.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Cn.set(t,e))}return e}toString(){return this.cssText}},Tn=e=>new wn(typeof e==`string`?e:e+``,void 0,Sn),En=(e,...t)=>new wn(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,Sn),Dn=(e,t)=>{if(xn)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=bn.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},On=xn?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return Tn(t)})(e):e,{is:kn,defineProperty:An,getOwnPropertyDescriptor:jn,getOwnPropertyNames:Mn,getOwnPropertySymbols:Nn,getPrototypeOf:Pn}=Object,Fn=globalThis,In=Fn.trustedTypes,Ln=In?In.emptyScript:``,Rn=Fn.reactiveElementPolyfillSupport,zn=(e,t)=>e,Bn={toAttribute(e,t){switch(t){case Boolean:e=e?Ln:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Vn=(e,t)=>!kn(e,t),Hn={attribute:!0,type:String,converter:Bn,reflect:!1,useDefault:!1,hasChanged:Vn};Symbol.metadata??=Symbol(`metadata`),Fn.litPropertyMetadata??=new WeakMap;var Un=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Hn){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&An(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=jn(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Hn}static _$Ei(){if(this.hasOwnProperty(zn(`elementProperties`)))return;let e=Pn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(zn(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zn(`properties`))){let e=this.properties,t=[...Mn(e),...Nn(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(On(e))}else e!==void 0&&t.push(On(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Dn(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?Bn:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?Bn:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??Vn)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};Un.elementStyles=[],Un.shadowRootOptions={mode:`open`},Un[zn(`elementProperties`)]=new Map,Un[zn(`finalized`)]=new Map,Rn?.({ReactiveElement:Un}),(Fn.reactiveElementVersions??=[]).push(`2.1.2`);var Wn=globalThis,Gn=e=>e,Kn=Wn.trustedTypes,qn=Kn?Kn.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,Jn=`$lit$`,Yn=`lit$${Math.random().toFixed(9).slice(2)}$`,Xn=`?`+Yn,Zn=`<${Xn}>`,Qn=document,$n=()=>Qn.createComment(``),er=e=>e===null||typeof e!=`object`&&typeof e!=`function`,tr=Array.isArray,nr=e=>tr(e)||typeof e?.[Symbol.iterator]==`function`,rr=`[
|
|
10
|
+
\f\r]`,ir=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ar=/-->/g,or=/>/g,sr=RegExp(`>|${rr}(?:([^\\s"'>=/]+)(${rr}*=${rr}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),cr=/'/g,lr=/"/g,ur=/^(?:script|style|textarea|title)$/i,dr=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),fr=dr(1),pr=dr(2),mr=Symbol.for(`lit-noChange`),j=Symbol.for(`lit-nothing`),hr=new WeakMap,gr=Qn.createTreeWalker(Qn,129);function _r(e,t){if(!tr(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return qn===void 0?t:qn.createHTML(t)}var vr=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=ir;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===ir?c[1]===`!--`?o=ar:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=sr):(ur.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=sr):o=or:o===sr?c[0]===`>`?(o=i??ir,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?sr:c[3]===`"`?lr:cr):o===lr||o===cr?o=sr:o===ar||o===or?o=ir:(o=sr,i=void 0);let d=o===sr&&e[t+1].startsWith(`/>`)?` `:``;a+=o===ir?n+Zn:l>=0?(r.push(s),n.slice(0,l)+Jn+n.slice(l)+Yn+d):n+Yn+(l===-2?t:d)}return[_r(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},yr=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=vr(t,n);if(this.el=e.createElement(l,r),gr.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=gr.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(Jn)){let t=u[o++],n=i.getAttribute(e).split(Yn),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?wr:r[1]===`?`?Tr:r[1]===`@`?Er:Cr}),i.removeAttribute(e)}else e.startsWith(Yn)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(ur.test(i.tagName)){let e=i.textContent.split(Yn),t=e.length-1;if(t>0){i.textContent=Kn?Kn.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],$n()),gr.nextNode(),c.push({type:2,index:++a});i.append(e[t],$n())}}}else if(i.nodeType===8){if(i.data===Xn)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(Yn,e+1))!==-1;)c.push({type:7,index:a}),e+=Yn.length-1}}a++}}static createElement(e,t){let n=Qn.createElement(`template`);return n.innerHTML=e,n}};function br(e,t,n=e,r){if(t===mr)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=er(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=br(e,i._$AS(e,t.values),i,r)),t}var xr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??Qn).importNode(t,!0);gr.currentNode=r;let i=gr.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Sr(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Dr(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=gr.nextNode(),a++)}return gr.currentNode=Qn,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Sr=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=br(this,e,t),er(e)?e===j||e==null||e===``?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==mr&&this._(e):e._$litType$===void 0?e.nodeType===void 0?nr(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==j&&er(this._$AH)?this._$AA.nextSibling.data=e:this.T(Qn.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=yr.createElement(_r(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new xr(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=hr.get(e.strings);return t===void 0&&hr.set(e.strings,t=new yr(e)),t}k(t){tr(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O($n()),this.O($n()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=Gn(e).nextSibling;Gn(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Cr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=br(this,e,t,0),a=!er(e)||e!==this._$AH&&e!==mr,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=br(this,r[n+o],t,o),s===mr&&(s=this._$AH[o]),a||=!er(s)||s!==this._$AH[o],s===j?e=j:e!==j&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},wr=class extends Cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}},Tr=class extends Cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},Er=class extends Cr{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=br(this,e,t,0)??j)===mr)return;let n=this._$AH,r=e===j&&n!==j||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==j&&(n===j||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Dr=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){br(this,e)}},Or=Wn.litHtmlPolyfillSupport;Or?.(yr,Sr),(Wn.litHtmlVersions??=[]).push(`3.3.3`);var kr=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Sr(t.insertBefore($n(),e),e,void 0,n??{})}return i._$AI(e),i},Ar=globalThis,jr=class extends Un{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=kr(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return mr}};jr._$litElement$=!0,jr.finalized=!0,Ar.litElementHydrateSupport?.({LitElement:jr});var Mr=Ar.litElementPolyfillSupport;Mr?.({LitElement:jr}),(Ar.litElementVersions??=[]).push(`4.2.2`);function Nr(e){if(!e)return`neutral`;let t=e.trim().toLowerCase();return/^(yes|y|true|ok)\b/.test(t)||t===`yes`?`yes`:/^(no|n|false)\b/.test(t)||t===`no`?`no`:/\byes\b/.test(t)&&!/\bno\b/.test(t)?`yes`:/\bno\b/.test(t)&&!/\byes\b/.test(t)?`no`:`neutral`}function Pr(e){if(e===`yes`||e===`no`||e===`neutral`)return e}function Fr(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`animation`}var Ir={1:`one`,one:`one`,exactlyone:`one`,"0..1":`zeroOrOne`,"0:1":`zeroOrOne`,"01":`zeroOrOne`,zeroorone:`zeroOrOne`,optional:`zeroOrOne`,"1..n":`oneOrMany`,"1..*":`oneOrMany`,"1:n":`oneOrMany`,"1:*":`oneOrMany`,n:`oneOrMany`,many:`oneOrMany`,"+":`oneOrMany`,oneormany:`oneOrMany`,"0..n":`zeroOrMany`,"0..*":`zeroOrMany`,"0:n":`zeroOrMany`,"0:*":`zeroOrMany`,"*":`zeroOrMany`,zeroormany:`zeroOrMany`};function Lr(e){return Ir[e.trim().toLowerCase().replace(/\s+/g,``)]}function Rr(e){if(e==null||e===``||typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)return;let t=String(e).trim();if(!t)return;let n=Br(t);if(n)return n;let r=t.split(/[:|]/).map(e=>e.trim()).filter(Boolean);if(r.length>=2){let e=Lr(r[0]),t=Lr(r[1]);if(e&&t)return{from:e,to:t}}let i=Lr(t);if(i)return{from:`one`,to:i}}function zr(e){if(!e)return!0;let t=e.trim();return!t||Br(t)||/^(?:1|0\.\.1|1\.\.N|0\.\.N|N|\*):\s*(?:1|0\.\.1|1\.\.N|0\.\.N|N|\*)$/i.test(t)||/^(?:\d+\.\.[Nn*]|\d+:[Nn*]|\*|[Nn]|0\.\.[Nn*])$/i.test(t)?!0:Rr(t)?!/[a-z]/i.test(t.replace(/n/gi,``)):!1}function Br(e){let t=e.replace(/\s+/g,``).match(/^([|}{o]+)--([|}{o]+)$/);if(!t)return;let n=Vr(t[1]),r=Vr(t[2]);if(n&&r)return{from:n,to:r}}function Vr(e){if(e===`}o`||e===`o{`)return`zeroOrMany`;if(e===`}|`||e===`|{`)return`oneOrMany`;if(e===`||`)return`one`;if(e===`o|`||e===`|o`)return`zeroOrOne`;if(e===`|`)return`one`;if(e===`o`)return`zeroOrOne`}function Hr(e,t=!1){return{from:e?`one`:`zeroOrOne`,to:t?e?`one`:`zeroOrOne`:`zeroOrMany`}}var Ur=new Set([`PK`,`PRIMARY`,`FK`,`FOREIGN`,`UK`,`UNIQUE`,`NN`,`NOTNULL`,`NOT_NULL`]);function Wr(e){let t=e.trim();if(!t)return null;let n,r=t.split(/\s+\/\/\s+/);r.length>1&&(t=r[0].trim(),n=r.slice(1).join(` // `).trim()||void 0);let i,a=t.match(/^(.*?)\s*->\s*(\S.*?)\s*$/);if(a){let e=Jr(a[2]);e&&(t=a[1].trim(),i=e)}else{let e=t.match(/^(.*?)\s+(?:ref|references)\s+(\S.*?)\s*$/i);if(e){let n=Jr(e[2]);n&&(t=e[1].trim(),i=n)}}let o=t.replace(/\s*:\s*/g,` `).split(/\s+/).filter(Boolean);if(o.length===0)return null;let s=o[0],c=[],l=!1,u=[];for(let e=1;e<o.length;e++){let t=o[e],n=t.toUpperCase();if(n===`NOT`&&o[e+1]?.toUpperCase()===`NULL`)l=!0,e++;else switch(n){case`PK`:case`PRIMARY`:c.includes(`pk`)||c.push(`pk`);break;case`FK`:case`FOREIGN`:c.includes(`fk`)||c.push(`fk`);break;case`UK`:case`UNIQUE`:c.includes(`uk`)||c.push(`uk`);break;case`NN`:case`NOTNULL`:case`NOT_NULL`:l=!0;break;default:Ur.has(n)||u.push(t)}}return i&&!c.includes(`fk`)&&c.push(`fk`),{name:s,type:u.length?u.join(` `):void 0,keys:c,notNull:l||void 0,references:i,note:n}}function Gr(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=Wr(String(n));e&&t.push(e)}return t}function Kr(e,t){return e?e.findIndex(e=>e.name===t):-1}var qr=`[A-Za-z_][\\w-]*`;function Jr(e){let t=e.trim();if(!t)return;let n=t.match(RegExp(`^(${qr})\\.\\(\\s*(${qr}(?:\\s*,\\s*${qr})+)\\s*\\)$`));if(n){let e=n[2].split(/\s*,\s*/).filter(Boolean),t=e[0];return!t||e.length<2?void 0:{table:n[1],column:t,columns:e}}let r=t.match(RegExp(`^(${qr})\\.(${qr})$`));if(r)return{table:r[1],column:r[2]}}function Yr(e){return e.columns&&e.columns.length>0?e.columns:[e.column]}function Xr(e){return(e??[]).filter(e=>e.keys.includes(`pk`)).map(e=>e.name)}function Zr(e,t){let n=e.length>0&&e.every(e=>!!e.notNull),r=Xr(t),i=new Set(e.map(e=>e.name)),a=e.length>0&&e.every(e=>e.keys.includes(`uk`)),o=r.length>0&&r.every(e=>i.has(e))&&e.every(e=>r.includes(e.name)),s=a||o,c=e.length>0&&e.every(e=>e.keys.includes(`pk`));return{cardinality:Hr(n,s),identifying:c}}function Qr(e,t,n){if(!e||!n)return[];let r=e.filter(e=>e.references?.table===t);if(new Set(r.flatMap(e=>Yr(e.references))).size>1&&r.some(e=>e.name===n))return r;let i=e.find(e=>e.name===n);return i?[i]:[]}function $r(e){let t=[];for(let n of e.keys)t.push(n.toUpperCase());e.notNull&&t.push(`NN`);let n=[];e.type&&n.push(e.type),n.push(...t),e.references&&n.push(`-> ${ei(e.references)}`);let r=e.name;return n.length&&(r+=`: ${n.join(` `)}`),e.note&&(r+=` // ${e.note}`),r}function ei(e){let t=Yr(e);return t.length>1?`${e.table}.(${t.join(`, `)})`:`${e.table}.${e.column}`}var ti={alt:`alternate`,alternate:`alternate`,opt:`optional`,optional:`optional`,loop:`loop`,par:`parallel`,parallel:`parallel`,critical:`critical`,break:`break`,group:`section`,section:`section`,box:`section`};function ni(e){switch(e){case`alternate`:return`Alternate`;case`optional`:return`Optional`;case`loop`:return`Loop`;case`parallel`:return`Parallel`;case`critical`:return`Critical`;case`break`:return`Break`;case`section`:return`Section`}}function ri(e){return ti[e.toLowerCase()]}var ii=new Set([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`,`OPTIONS`,`TRACE`,`CONNECT`]),ai=/^\/[A-Za-z0-9._~:@%+{}/-]+$/;function oi(e){return ii.has(e.toUpperCase())}function si(e){let t=e.indexOf(` `);if(t>0){let n=e.slice(0,t),r=e.slice(t+1);if(oi(n)&&ai.test(r))return`${n} ${r}`}return ai.test(e)?e:`"${e}"`}var ci=[`<->`,`<..`,`<~`,`<=`,`<-`,`x-`,`=>`,`~>`,`..>`,`-->`,`-x`,`->`,`--`],li=/[A-Za-z0-9._~:@%+{}/-]/;function ui(e,t=[]){let n=[],r=0,i=1,a=1,o=(t,n)=>{let r=e.slice(0,t).split(`
|
|
11
|
+
`).length,i=t-(e.lastIndexOf(`
|
|
12
|
+
`,t-1)+1)+1,a=e.slice(0,n).split(`
|
|
13
|
+
`).length,o=n-(e.lastIndexOf(`
|
|
14
|
+
`,n-1)+1)+1;return{start:{line:r,column:i,offset:t},end:{line:a,column:o,offset:n}}};for(;r<e.length;){let s=r;if(e[r]===`
|
|
15
|
+
`){n.push({type:`newline`,value:`
|
|
16
|
+
`,range:o(s,++r)}),i++,a=1;continue}if(e[r]===` `||e[r]===` `||e[r]===`\r`||e[r]===`;`){r++,a++;continue}if(e.slice(r,r+2)===`//`){r+=2;let t=r;for(;r<e.length&&e[r]!==`
|
|
17
|
+
`;)r++;n.push({type:`comment`,value:e.slice(t,r).trim(),range:o(s,r)});continue}if(e.slice(r,r+2)===`/*`){for(r+=2;r<e.length&&e.slice(r,r+2)!==`*/`;)r++;r<e.length&&(r+=2);continue}if(e[r]===`[`){n.push({type:`lbracket`,value:`[`,range:o(s,++r)}),a++;continue}if(e[r]===`]`){n.push({type:`rbracket`,value:`]`,range:o(s,++r)}),a++;continue}if(e[r]===`(`){n.push({type:`lparen`,value:`(`,range:o(s,++r)}),a++;continue}if(e[r]===`)`){n.push({type:`rparen`,value:`)`,range:o(s,++r)}),a++;continue}if(e[r]===`{`){n.push({type:`lbrace`,value:`{`,range:o(s,++r)}),a++;continue}if(e[r]===`}`){n.push({type:`rbrace`,value:`}`,range:o(s,++r)}),a++;continue}if(e[r]===`:`){n.push({type:`colon`,value:`:`,range:o(s,++r)}),a++;continue}if(e[r]===`,`){n.push({type:`comma`,value:`,`,range:o(s,++r)}),a++;continue}if(e[r]===`*`){n.push({type:`star`,value:`*`,range:o(s,++r)}),a++;continue}if(e[r]===`#`){let i=r+1;for(;i<e.length&&/[0-9a-fA-F]/.test(e[i]);)i++;let c=i-r-1;if(c===3||c===4||c===6||c===8){n.push({type:`identifier`,value:e.slice(r,i),range:o(s,i)}),a+=i-r,r=i;continue}t.push({severity:`error`,code:`FM006`,message:`Unexpected character "#"`,range:o(s,s+1),hint:`Use a valid hex color (#rgb, #rrggbb, #rgba, or #rrggbbaa)`}),r++,a++;continue}let c=!1;for(let t of ci)if(e.slice(r,r+t.length)===t){if(t===`--`){let t=e[r+2];if(t&&/[A-Za-z0-9_-]/.test(t))continue}n.push({type:`edgeOp`,value:t,range:o(s,r+t.length)}),r+=t.length,a+=t.length,c=!0;break}if(!c){if(e[r]===`.`)n.push({type:`dot`,value:`.`,range:o(s,++r)}),a++;else if(e[r]===`"`){if(e.slice(r,r+3)===`"""`){r+=3;let i=``;for(;r<e.length&&e.slice(r,r+3)!==`"""`;)i+=e[r++];e.slice(r,r+3)===`"""`?r+=3:t.push({severity:`error`,code:`FM007`,message:`Unclosed string literal`,range:o(s,r)}),n.push({type:`string`,value:i,range:o(s,r)});continue}r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[++r];i+=t===`n`?`
|
|
18
|
+
`:t===`t`?` `:t===`r`?`\r`:t}else i+=e[r];r++}r>=e.length||e[r]!==`"`?t.push({severity:`error`,code:`FM007`,message:`Unclosed string literal`,range:o(s,r)}):r++,n.push({type:`string`,value:i,range:o(s,r)})}else if(/[0-9]/.test(e[r])){let t=``;for(;r<e.length&&/[0-9]/.test(e[r]);)t+=e[r++];if(e[r]===`.`&&/[0-9]/.test(e[r+1]??``))for(t+=e[r++];r<e.length&&/[0-9]/.test(e[r]);)t+=e[r++];n.push({type:`number`,value:t,range:o(s,r)})}else if(e[r]===`-`&&e[r+1]===`-`&&/[a-zA-Z_]/.test(e[r+2]??``)){let t=`--`;for(r+=2;r<e.length&&/[a-zA-Z0-9_-]/.test(e[r]);)t+=e[r++];n.push({type:`identifier`,value:t,range:o(s,r)})}else if(/[a-zA-Z_]/.test(e[r])){let t=``;for(;r<e.length&&/[a-zA-Z0-9_-]/.test(e[r]);)t+=e[r++];n.push({type:`identifier`,value:t,range:o(s,r)})}else if(e[r]===`/`&&e[r+1]!==`/`&&e[r+1]!==`*`&&li.test(e[r+1]??``)){let t=r+1;for(;t<e.length&&li.test(e[t]);)t++;n.push({type:`route`,value:e.slice(r,t),range:o(s,t)}),r=t}else t.push({severity:`error`,code:`FM006`,message:`Unexpected character "${e[r]}"`,range:o(s,s+1)}),r++,a++}}return n.push({type:`eof`,value:``,range:o(e.length,e.length)}),n}function di(e){let t=[];return new fi(ui(e,t),t,e).parseDocument()}var fi=class{constructor(e,t,n){this.tokens=e,this.diagnostics=t,this.source=n,this.pos=0}peek(e=0){return this.tokens[this.pos+e]??this.tokens[this.tokens.length-1]}advance(){return this.tokens[this.pos++]??this.tokens[this.tokens.length-1]}at(e,t){let n=this.peek();return n.type===e&&(t===void 0||n.value===t)}atWord(e){let t=this.peek();return t.type===`identifier`&&t.value===e}skipNewlines(){this.skipTrivia()}skipTrivia(){for(;this.at(`newline`)||this.at(`comment`);)this.advance()}error(e,t,n,r){this.diagnostics.push({severity:`error`,code:e,message:t,range:n,hint:r})}parseDocument(){this.skipNewlines();let e;if(this.atWord(`kdiagram`)){this.advance();let t=this.advance();t.type===`number`&&(e=Number(t.value)),this.skipNewlines()}let t=[];for(;!this.at(`eof`)&&(this.skipNewlines(),!this.at(`eof`));)this.atWord(`diagram`)?t.push(this.parseDiagram(`flow`)):this.atWord(`state`)?t.push(this.parseDiagram(`state`)):this.atWord(`sequence`)?t.push(this.parseSequence()):this.atWord(`model`)?t.push(this.parseModel(e)):(this.error(`FM001`,`Unexpected token "${this.peek().value}"`,this.peek().range),this.advance()),this.skipNewlines();return{type:`Document`,version:e,body:t,diagnostics:this.diagnostics}}parseSequence(){let e=this.peek().range.start;this.advance(),this.skipTrivia();let t;this.at(`string`)&&(t=this.advance().value,this.skipTrivia()),this.at(`lbrace`)?this.advance():this.error(`FM002`,`Expected "{" to open sequence`,this.peek().range);let n=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipNewlines(),!(this.at(`rbrace`)||this.at(`eof`)));){let e=this.parseSequenceStatement();e&&(Array.isArray(e)?n.push(...e):n.push(e))}this.at(`rbrace`)?this.advance():this.error(`FM002`,`Expected "}" to close sequence`,this.peek().range);let r=this.tokens[Math.min(this.pos,this.tokens.length-1)].range.end;return{type:`Sequence`,name:t,statements:n,range:{start:e,end:r}}}parseSequenceStatement(){if(this.at(`identifier`)&&this.peek(1).type===`colon`){let e=this.advance();return this.advance(),this.parseNode(e.value,e.range)}if(this.atWord(`activate`))return this.parseSequenceActivate();if(this.atWord(`deactivate`))return this.parseSequenceDeactivate();if(this.atWord(`create`))return this.parseSequenceCreate();if(this.atWord(`destroy`))return this.parseSequenceDestroy();if(this.atWord(`note`))return this.parseSequenceNote();if(this.atWord(`autonumber`))return{type:`SequenceAutonumber`,range:this.advance().range};if(this.atWord(`divider`))return this.parseSequenceDivider();if(this.atWord(`alt`)||this.atWord(`alternate`)||this.atWord(`opt`)||this.atWord(`optional`)||this.atWord(`loop`)||this.atWord(`par`)||this.atWord(`parallel`)||this.atWord(`critical`)||this.atWord(`break`)||this.atWord(`group`)||this.atWord(`section`)||this.atWord(`box`))return this.parseSequenceFragment();if(this.atWord(`style`))return this.parseStyle();if(this.atWord(`direction`)||this.atWord(`density`))return this.parseDirective();if(this.atWord(`layout`))return this.parseLayoutBlock();if(this.atWord(`edges`))return this.parseEdgePolicyBlock();if(this.atWord(`render`))return this.parseRenderBlock();if(this.atWord(`presentation`))return this.parsePresentationBlock();if(this.atWord(`animation`))return this.parseAnimationBlock();if(this.at(`star`)&&this.peek(1).type===`edgeOp`){let e=this.advance();return this.parseEdgeChain(`*`,void 0,e.range)}if(this.at(`identifier`)){if(this.looksLikeStyleRef())return this.parseStyleRefStatement();let e=this.advance();if(this.at(`dot`)||this.at(`edgeOp`)){let t=this.parseQualifiedName(e.value,e.range);return this.parseEdgeChain(t.nodeId,t.column,e.range)}return this.error(`FM003`,`Unexpected identifier "${e.value}"`,e.range),null}return this.error(`FM004`,`Unexpected token "${this.peek().value}"`,this.peek().range),this.advance(),null}parseSequenceActivate(){let e=this.advance(),t=this.advance();return t.type===`identifier`?{type:`SequenceActivate`,participantId:t.value,range:{start:e.range.start,end:t.range.end}}:(this.error(`FM140`,`Expected participant id after activate`,t.range),{type:`SequenceActivate`,participantId:``,range:e.range})}parseSequenceDeactivate(){let e=this.advance(),t=this.advance();return t.type===`identifier`?{type:`SequenceDeactivate`,participantId:t.value,range:{start:e.range.start,end:t.range.end}}:(this.error(`FM141`,`Expected participant id after deactivate`,t.range),{type:`SequenceDeactivate`,participantId:``,range:e.range})}parseSequenceCreate(){let e=this.advance();if(this.skipTrivia(),!(this.at(`identifier`)&&this.peek(1).type===`colon`))return this.error(`FM142`,'Expected `create id: kind "Label"`',this.peek().range),{type:`SequenceCreate`,node:{type:`Node`,id:``,kind:`participant`,properties:{},styleRefs:[],range:e.range},range:e.range};let t=this.advance();this.advance();let n=this.parseNode(t.value,t.range);return{type:`SequenceCreate`,node:n,range:{start:e.range.start,end:n.range.end}}}parseSequenceDestroy(){let e=this.advance(),t=this.advance();return t.type===`identifier`?{type:`SequenceDestroy`,participantId:t.value,range:{start:e.range.start,end:t.range.end}}:(this.error(`FM143`,`Expected participant id after destroy`,t.range),{type:`SequenceDestroy`,participantId:``,range:e.range})}parseSequenceNote(){let e=this.advance();this.skipTrivia();let t=`over`;this.atWord(`over`)?(this.advance(),t=`over`):this.atWord(`left`)?(this.advance(),this.skipTrivia(),this.atWord(`of`)&&this.advance(),t=`left`):this.atWord(`right`)?(this.advance(),this.skipTrivia(),this.atWord(`of`)&&this.advance(),t=`right`):this.error(`FM144`,`Expected note placement (over | left of | right of)`,this.peek().range),this.skipTrivia();let n=[];for(;this.at(`identifier`)&&(n.push(this.advance().value),this.skipTrivia(),this.at(`comma`));)this.advance(),this.skipTrivia();let r=``;return this.at(`string`)?r=this.advance().value:this.error(`FM145`,`Expected note text string`,this.peek().range),{type:`SequenceNote`,placement:t,participantIds:n,text:r,range:{start:e.range.start,end:this.peek(-1)?.range.end??e.range.end}}}parseSequenceDivider(){let e=this.advance();this.skipTrivia();let t;return this.at(`string`)&&(t=this.advance().value),{type:`SequenceDivider`,label:t,range:{start:e.range.start,end:this.peek(-1)?.range.end??e.range.end}}}parseSequenceFragment(){let e=this.peek(),t=ri(e.value)??`section`;this.advance(),this.skipTrivia();let n;this.at(`string`)&&(n=this.advance().value,this.skipTrivia());let r=this.parseOptionalIsStyleRefs();this.skipTrivia();let i=[],a=this.parseSequenceFragmentBody(n,r);for(i.push(a);t===`alternate`&&(this.atWord(`else`)||this.atWord(`otherwise`))||t===`parallel`&&(this.atWord(`and`)||this.atWord(`also`));){this.advance(),this.skipTrivia();let e;this.at(`string`)&&(e=this.advance().value,this.skipTrivia());let t=this.parseOptionalIsStyleRefs();this.skipTrivia(),i.push(this.parseSequenceFragmentBody(e,t))}return{type:`SequenceFragment`,operator:t,label:n,styleRefs:r,operands:i,range:{start:e.range.start,end:this.peek(-1)?.range.end??e.range.end}}}parseSequenceFragmentBody(e,t=[]){let n=this.peek().range.start;if(!this.at(`lbrace`))return this.error(`FM146`,`Expected "{" to open fragment body`,this.peek().range),{label:e,styleRefs:t,statements:[],range:this.peek().range};this.advance();let r=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipNewlines(),!(this.at(`rbrace`)||this.at(`eof`)));){let e=this.parseSequenceStatement();e&&(Array.isArray(e)?r.push(...e):r.push(e))}return this.at(`rbrace`)?this.advance():this.error(`FM146`,`Expected "}" to close fragment body`,this.peek().range),{label:e,styleRefs:t,statements:r,range:{start:n,end:this.peek(-1)?.range.end??n}}}parseDiagram(e){let t=this.peek().range.start;this.advance(),this.skipTrivia();let n;this.at(`string`)&&(n=this.advance().value,this.skipTrivia()),this.at(`lbrace`)?this.advance():this.error(`FM002`,`Expected "{" to open ${e} diagram`,this.peek().range);let r=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipNewlines(),!(this.at(`rbrace`)||this.at(`eof`)));){let e=this.parseStatement(!0);e&&(Array.isArray(e)?r.push(...e):r.push(e))}this.at(`rbrace`)?this.advance():this.error(`FM002`,`Expected "}" to close diagram`,this.peek().range);let i=this.tokens[Math.min(this.pos,this.tokens.length-1)].range.end;return{type:`Diagram`,diagramKind:e,name:n,statements:r,range:{start:t,end:i}}}parseModel(e){let t=this.peek().range.start;this.advance(),this.skipTrivia();let n;this.at(`string`)&&(n=this.advance().value,this.skipTrivia()),e!==void 0&&e<2&&this.error(`FM220`,"`model` requires `kdiagram 2` at the top of the file",this.peek().range,"Add `kdiagram 2` before the model block or use a standalone `diagram`."),this.at(`lbrace`)?this.advance():this.error(`FM002`,`Expected "{" to open model`,this.peek().range);let r=[],i=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipNewlines(),!(this.at(`rbrace`)||this.at(`eof`)));){if(this.atWord(`view`)){i.push(this.parseView());continue}let e=this.parseModelStatement(!0);e&&(Array.isArray(e)?r.push(...e):r.push(e))}this.at(`rbrace`)?this.advance():this.error(`FM002`,`Expected "}" to close model`,this.peek().range);let a=this.tokens[Math.min(this.pos,this.tokens.length-1)].range.end;return{type:`Model`,name:n,statements:r,views:i,range:{start:t,end:a}}}parseView(){let e=this.peek().range.start;this.advance(),this.skipTrivia();let t;this.at(`string`)||this.at(`identifier`)?t=this.advance().value:(this.error(`FM221`,"Expected view name after `view`",this.peek().range),t=`unnamed`),this.skipTrivia(),this.at(`lbrace`)?this.advance():this.error(`FM002`,`Expected "{" to open view`,this.peek().range);let n=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipNewlines(),!(this.at(`rbrace`)||this.at(`eof`)));){let e=this.parseViewStatement();e&&(Array.isArray(e)?n.push(...e):n.push(e))}this.at(`rbrace`)?this.advance():this.error(`FM002`,`Expected "}" to close view`,this.peek().range);let r=this.tokens[Math.min(this.pos,this.tokens.length-1)].range.end;return{type:`View`,name:t,statements:n,range:{start:e,end:r}}}parseModelStatement(e=!1){if(this.atWord(`layout`)||this.atWord(`edges`)||this.atWord(`render`)||this.atWord(`presentation`)||this.atWord(`animation`)||this.atWord(`include`)||this.atWord(`exclude`)||this.atWord(`intent`)||this.atWord(`collapse`)){let e=this.advance().value;return this.error(`FM222`,`\`${e}\` belongs in a \`view\` block, not in the model`,this.peek(-1).range,"Move edges, layout, presentation, animation, and include/exclude into `view name { … }`."),this.skipStatementTail(),null}let t=this.parseStatement(e);if(!t)return null;if(Array.isArray(t)){for(let e of t)if(e.type===`Edge`)return this.error(`FM222`,"Edges belong in a `view` block, not in the model",e.range,"Declare nodes and groups in the model; put `a -> b` wiring inside each view."),null;return t}return t.type===`Edge`?(this.error(`FM222`,"Edges belong in a `view` block, not in the model",t.range,"Declare nodes and groups in the model; put `a -> b` wiring inside each view."),null):t.type===`Directive`||t.type===`LayoutBlock`||t.type===`EdgePolicyBlock`||t.type===`RenderBlock`||t.type===`PresentationBlock`||t.type===`AnimationBlock`?(this.error(`FM222`,`\`${t.type}\` belongs in a \`view\` block, not in the model`,t.range,"Move presentation and layout into `view name { … }`."),null):t}parseViewStatement(){if(this.atWord(`include`))return this.parseIncludeExclude(`include`);if(this.atWord(`exclude`))return this.parseIncludeExclude(`exclude`);if(this.atWord(`intent`)||this.atWord(`collapse`)){let e=this.advance().value;return this.error(`FM223`,`\`${e}\` is not supported — use explicit summary nodes in the model and include/exclude in the view`,this.peek(-1).range),this.skipStatementTail(),null}if(this.atWord(`direction`)||this.atWord(`density`))return this.parseDirective();if(this.atWord(`layout`))return this.parseLayoutBlock();if(this.atWord(`edges`))return this.parseEdgePolicyBlock();if(this.atWord(`render`))return this.parseRenderBlock();if(this.atWord(`presentation`))return this.parsePresentationBlock();if(this.atWord(`animation`))return this.parseAnimationBlock();if(this.at(`identifier`)){let e=this.advance();if(this.at(`dot`)||this.at(`edgeOp`)){let t=this.parseQualifiedName(e.value,e.range);return this.parseEdgeChain(t.nodeId,t.column,e.range)}return this.error(`FM223`,`Unexpected token in view block: "${e.value}"`,e.range,"Expected include/exclude, an edge (`a -> b`), layout, presentation, or animation."),null}return this.error(`FM223`,`Unexpected token in view block: "${this.peek().value}"`,this.peek().range),this.advance(),null}parseIncludeExclude(e){let t=this.advance().range.start,n=this.parseSelectorList(),r={start:t,end:this.peek(-1)?.range.end??{line:1,column:1,offset:0}};return e===`include`?{type:`Include`,selectors:n,range:r}:{type:`Exclude`,selectors:n,range:r}}parseSelectorList(){if(this.skipTrivia(),this.at(`lbracket`)){this.advance();let e=[];for(;!this.at(`rbracket`)&&!this.at(`eof`)&&(this.skipTrivia(),!this.at(`rbracket`));){let t=this.parseSelectorToken();t?e.push(t):(this.error(`FM225`,`Expected selector in include/exclude list`,this.peek().range),this.advance()),this.skipTrivia(),this.at(`comma`)&&this.advance()}return this.at(`rbracket`)&&this.advance(),e}let e=[];for(;;){this.skipTrivia();let t=this.parseSelectorToken();if(!t)break;if(e.push(t),this.skipTrivia(),this.at(`comma`))this.advance();else break}return e.length===0&&this.error(`FM225`,`Expected at least one selector`,this.peek().range),e}parseSelectorToken(){if(this.at(`star`))return this.advance().value;if(!this.at(`identifier`))return;let e=this.advance().value;return this.at(`dot`)&&(this.advance(),this.at(`star`)?(e+=`.*`,this.advance()):this.at(`identifier`)?e+=`.${this.advance().value}`:this.error(`FM225`,`Expected "*" or identifier after "." in selector`,this.peek().range)),e}skipStatementTail(){for(;!this.at(`newline`)&&!this.at(`eof`)&&!this.at(`rbrace`);)this.advance()}parseStatement(e=!1,t){if(this.at(`identifier`)&&this.peek(1).type===`colon`){if(t===`database`&&(this.peek().value===`profile`||this.peek().value===`partitioned`||this.peek().value===`audience`)||e&&hi(this.peek().value))return this.parseDirective();let n=this.advance();return this.advance(),this.parseNode(n.value,n.range)}if(this.atWord(`group`)||this.atWord(`boundary`)||this.atWord(`zone`)||this.atWord(`swimlane`)||this.atWord(`database`))return this.parseGroup();if(this.atWord(`style`))return this.parseStyle();if(this.atWord(`direction`)||this.atWord(`density`))return this.parseDirective();if(this.atWord(`layout`))return this.parseLayoutBlock();if(this.atWord(`edges`))return this.parseEdgePolicyBlock();if(this.atWord(`render`))return this.parseRenderBlock();if(this.atWord(`presentation`))return this.parsePresentationBlock();if(this.atWord(`animation`))return this.parseAnimationBlock();if(this.at(`identifier`)){if(this.looksLikeStyleRef())return this.parseStyleRefStatement();if(e&&this.looksLikeGroupMember())return this.parseGroupMemberList();let t=this.advance();if(this.at(`dot`)||this.at(`edgeOp`)){let e=this.parseQualifiedName(t.value,t.range);return this.parseEdgeChain(e.nodeId,e.column,t.range)}return this.error(`FM003`,`Unexpected identifier "${t.value}"`,t.range),null}return this.error(`FM004`,`Unexpected token "${this.peek().value}"`,this.peek().range),this.advance(),null}parseNode(e,t){let n=t.start,r=this.advance(),i=r.value,a;this.at(`string`)&&(a=this.advance().value);let o=this.parseOptionalIsStyleRefs(),s=this.parseOptionalProperties();o.push(...this.parseOptionalIsStyleRefs());let c=this.peek(-1)?.range.end??r.range.end;return{type:`Node`,id:e,kind:i,label:a,properties:s,styleRefs:o,range:{start:n,end:c}}}parseOptionalIsStyleRefs(){let e=[];for(;this.atWord(`is`);){this.advance();let t=this.advance();if(t.type!==`identifier`){this.error(`FM008`,`Expected style name after "is"`,t.range);break}e.push(t.value)}return e}parseQualifiedName(e,t){if(!this.at(`dot`))return{nodeId:e};this.advance();let n=this.advance();return n.type===`identifier`?{nodeId:e,column:n.value}:(this.error(`FM007`,`Expected column name after '.'`,n.range),{nodeId:e})}parseEdgeChain(e,t,n){let r=[],i=e,a=t,o=n.start;for(;this.at(`edgeOp`);){let e=this.advance(),t,n,s;if(this.at(`star`)){let e=this.advance();t=`*`,s=e.range}else{let e=this.advance();if(e.type!==`identifier`){this.error(`FM005`,`Expected target node id after edge operator`,e.range,`Add a target node id after the edge operator.`);break}let r=this.parseQualifiedName(e.value,e.range);t=r.nodeId,n=r.column,s=e.range}let c=this.parseEdgeLabel(),l=this.parseOptionalProperties(),u=this.peek(-1)?.range.end??s.end;if(r.push({type:`Edge`,from:i,to:t,fromColumn:a,toColumn:n,op:e.value,label:c,properties:l,styleRefs:[],range:{start:o,end:u}}),i=t,a=n,o=s.start,this.atWord(`is`)){this.advance();let e=this.advance();r[r.length-1].styleRefs.push(e.value)}}return r}parseEdgeLabel(){if(this.at(`string`)||this.at(`route`))return this.advance().value;if(this.at(`identifier`)&&oi(this.peek().value)&&this.peek(1).type===`route`)return`${this.advance().value} ${this.advance().value}`}looksLikeStyleRef(){let e=this.pos;for(;this.tokens[e]?.type===`identifier`&&(e++,this.tokens[e]?.type===`comma`);)e++;let t=this.tokens[e];return t?.type===`identifier`&&t.value===`is`}looksLikeGroupMember(){if(!this.at(`identifier`))return!1;let e=this.peek(1);return!(e.type===`colon`||e.type===`edgeOp`||e.type===`dot`||e.type===`identifier`&&e.value===`is`)}parseStyleRefStatement(){let e=this.peek().range.start,t=[this.advance().value];for(;this.at(`comma`);)this.advance(),t.push(this.advance().value);return this.advance(),{type:`StyleRef`,targetIds:t,styleName:this.advance().value,range:{start:e,end:this.peek(-1)?.range.end??e}}}parseGroupMemberList(){let e=this.peek().range.start,t=[this.advance().value];for(;this.at(`comma`);)this.advance(),t.push(this.advance().value);return{type:`GroupMember`,nodeIds:t,range:{start:e,end:this.peek(-1)?.range.end??e}}}parseGroup(){let e=this.peek().range.start,t=this.advance(),n=t.value,r,i;this.at(`identifier`)&&(r=this.advance().value),this.at(`string`)&&(i=this.advance().value);let a={};if(this.at(`lbrace`)){this.advance();let o=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipNewlines(),!(this.at(`rbrace`)||this.at(`eof`)));){let e=this.parseStatement(!0,n);e&&(Array.isArray(e)?o.push(...e):o.push(e))}this.at(`rbrace`)&&this.advance();let s=this.peek(-1)?.range.end??t.range.end;return{type:`Group`,id:r,label:i,groupKind:n,statements:o,properties:a,range:{start:e,end:s}}}return this.error(`FM006`,`Expected { after group declaration`,this.peek().range),{type:`Group`,id:r,label:i,groupKind:n,statements:[],properties:a,range:{start:e,end:t.range.end}}}parseStyle(){let e=this.advance().range.start,t=this.advance(),n=t.value,r=`node`;this.atWord(`for`)&&(this.advance(),this.atWord(`edge`)?(this.advance(),r=`edge`):this.atWord(`fragment`)&&(this.advance(),r=`fragment`));let i=this.parseBlockProperties();return{type:`Style`,name:n,target:r,properties:i,range:{start:e,end:this.peek(-1)?.range.end??t.range.end}}}parseDirective(){let e=this.advance(),t=e.range.start,n=e.value,r;return this.at(`colon`)&&this.advance(),this.at(`lbracket`)?r=this.parseIdentifierList():!this.at(`newline`)&&!this.at(`comment`)&&!this.at(`rbrace`)&&!this.at(`eof`)&&(r=this.parsePropertyValue()),{type:`Directive`,name:n,value:r,range:{start:t,end:this.peek(-1)?.range.end??e.range.end}}}parseLayoutBlock(){let e=this.advance().range.start;return{type:`LayoutBlock`,properties:this.parseBlockProperties(),range:{start:e,end:this.peek(-1)?.range.end??{line:1,column:1,offset:0}}}}parseEdgePolicyBlock(){let e=this.advance().range.start;return{type:`EdgePolicyBlock`,properties:this.parseBlockProperties(),range:{start:e,end:this.peek(-1)?.range.end??{line:1,column:1,offset:0}}}}parseRenderBlock(){let e=this.advance().range.start;return{type:`RenderBlock`,properties:this.at(`lbrace`)?this.parseBlockProperties():{},range:{start:e,end:this.peek(-1)?.range.end??{line:1,column:1,offset:0}}}}parsePresentationBlock(){let e=this.advance().range.start;return{type:`PresentationBlock`,properties:this.at(`lbrace`)?this.parseBlockProperties():{},range:{start:e,end:this.peek(-1)?.range.end??{line:1,column:1,offset:0}}}}parseAnimationBlock(){let e=this.advance();this.skipTrivia();let t=`Animation`;if(this.at(`string`)?(t=this.advance().value,this.skipTrivia()):this.error(`FM120`,"Expected quoted animation name after `animation`",this.peek().range),!this.at(`lbrace`))return this.error(`FM121`,`Expected "{" to open animation block`,this.peek().range),{type:`AnimationBlock`,name:t,cues:[],range:{start:e.range.start,end:e.range.end}};this.advance();let n=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipTrivia(),!(this.at(`rbrace`)||this.at(`eof`)));){let e=this.parseAnimationCue();e&&n.push(e)}return this.at(`rbrace`)?this.advance():this.error(`FM121`,`Expected "}" to close animation block`,this.peek().range),{type:`AnimationBlock`,name:t,cues:n,range:{start:e.range.start,end:this.peek(-1)?.range.end??e.range.end}}}parseAnimationCue(){let e=this.peek().range;if(this.atWord(`loop`))return this.advance(),{type:`loop`,range:e};if(this.atWord(`wait`))return this.advance(),{type:`wait`,durationMs:this.parseDurationMs()??400,range:{start:e.start,end:this.peek(-1)?.range.end??e.end}};if(this.atWord(`parallel`)){if(this.advance(),this.skipTrivia(),!this.at(`lbrace`))return this.error(`FM121`,`Expected "{" to open parallel animation group`,this.peek().range),null;this.advance();let t=[];for(;!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipTrivia(),!(this.at(`rbrace`)||this.at(`eof`)));){if(this.atWord(`parallel`)){this.error(`FM130`,`Nested parallel groups are not supported`,this.peek().range,`Keep parallel groups one level deep`),this.advance();continue}if(this.atWord(`loop`)){this.error(`FM129`,"`loop` belongs on the animation block, not inside parallel",this.peek().range),this.advance();continue}let e=this.parseAnimationCue();e&&t.push(e)}return this.at(`rbrace`)?this.advance():this.error(`FM121`,`Expected "}" to close parallel group`,this.peek().range),{type:`parallel`,cues:t,range:{start:e.start,end:this.peek(-1)?.range.end??e.end}}}if(this.atWord(`dim`)||this.atWord(`activate`)||this.atWord(`pulse`)){let t=this.advance().value,n=this.parseAnimationTargets(),r;t===`pulse`&&this.atWord(`for`)&&(this.advance(),r=this.parseDurationMs());let i={start:e.start,end:this.peek(-1)?.range.end??e.end};return t===`pulse`?{type:`pulse`,targets:n,durationMs:r,range:i}:{type:t,targets:n,range:i}}if(this.atWord(`flow`)){this.advance();let t=this.parseAnimationPath(),n;return this.atWord(`for`)&&(this.advance(),n=this.parseDurationMs()),{type:`flow`,path:t,durationMs:n,range:{start:e.start,end:this.peek(-1)?.range.end??e.end}}}return this.error(`FM122`,`Unexpected animation cue "${this.peek().value}"`,this.peek().range,`Expected dim, activate, pulse, flow, wait, parallel, or loop`),this.advance(),null}parseAnimationTargets(){let e=[];for(;;){if(this.skipTrivia(),this.at(`star`))this.advance(),e.push({type:`all`});else if(this.at(`identifier`)){let t=this.advance().value;if(this.at(`edgeOp`)&&this.peek().value===`->`){if(this.advance(),!this.at(`identifier`)){this.error(`FM123`,"Expected node id after `->` in animation target",this.peek().range);break}let n=this.advance().value;e.push({type:`edge`,from:t,to:n})}else e.push({type:`node`,id:t})}else break;if(this.skipTrivia(),this.at(`comma`))this.advance();else break}return e.length===0&&this.error(`FM124`,`Expected animation target (* or node id)`,this.peek().range),e}parseAnimationPath(){let e=[];if(!this.at(`identifier`))return this.error(`FM125`,`Expected node id to start flow path`,this.peek().range),e;for(e.push(this.advance().value);this.at(`edgeOp`)&&this.peek().value===`->`;){if(this.advance(),!this.at(`identifier`)){this.error(`FM125`,"Expected node id after `->` in flow path",this.peek().range);break}e.push(this.advance().value)}return e.length<2&&this.error(`FM126`,`flow path needs at least two node ids (a -> b)`,this.peek().range),e}parseDurationMs(){if(!this.at(`number`)){this.error(`FM127`,`Expected duration (e.g. 800ms or 1.5s)`,this.peek().range);return}let e=Number(this.advance().value);if(Number.isFinite(e))return this.at(`identifier`)&&(this.peek().value===`ms`||this.peek().value===`s`)&&this.advance().value===`s`?Math.round(e*1e3):Math.round(e)}parseBlockProperties(){let e={};if(!this.at(`lbrace`))return e;for(this.advance();!this.at(`rbrace`)&&!this.at(`eof`);)if(this.skipTrivia(),this.at(`identifier`)){let t=this.advance().value;if(this.at(`colon`)&&this.advance(),t===`columns`&&this.at(`lbrace`)){e[t]=this.parseColumnsBlock();continue}if(t===`fields`&&this.at(`lbrace`)){e[t]=this.parseFieldsBlock();continue}if(this.at(`lbracket`)){e[t]=this.parseIdentifierList();continue}if(this.at(`newline`)||this.at(`comment`)||this.at(`rbrace`)||this.at(`eof`))continue;e[t]=t.startsWith(`--`)||t===`iconColor`?this.parseCssValue():this.parsePropertyValue()}else this.at(`rbrace`)||this.advance();return this.at(`rbrace`)&&this.advance(),e}parsePropertyValue(){let e=this.advance();if(e.type===`number`)return Number(e.value);if(e.value===`true`||e.value===`false`)return e.value===`true`;if(e.type===`string`)return e.value;let t=e.value;for(;this.at(`colon`)&&this.peek(1).type===`identifier`;)this.advance(),t+=`:${this.advance().value}`;return t}parseCssValue(){if(this.at(`string`))return this.advance().value;if(this.at(`newline`)||this.at(`comment`)||this.at(`rbrace`)||this.at(`eof`))return``;let e=this.peek().range.start.offset,t=e;for(;!this.at(`newline`)&&!this.at(`comment`)&&!this.at(`rbrace`)&&!this.at(`eof`);)t=this.advance().range.end.offset;return this.source.slice(e,t).trim()}parseColumnsBlock(){let e=[];if(!this.at(`lbrace`))return e;for(this.advance();!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipTrivia(),!(this.at(`rbrace`)||this.at(`eof`)));){if(this.peek().type!==`identifier`){this.error(`FM113`,`Expected column name in columns block`,this.peek().range),this.advance();continue}let t=this.advance();this.at(`colon`)&&this.advance();let n=[],r=0;for(;!this.at(`newline`)&&!this.at(`comment`)&&!this.at(`rbrace`)&&!this.at(`eof`)&&!(this.at(`comma`)&&r===0);){let e=this.advance();(e.type===`lparen`||e.type===`lbracket`)&&(r+=1),(e.type===`rparen`||e.type===`rbracket`)&&(r=Math.max(0,r-1)),n.push(e.value)}let i;this.at(`comment`)&&(i=this.advance().value||void 0),this.at(`comma`)&&this.advance();let a=pi(n),o=i?`${t.value}: ${a} // ${i}`:`${t.value}: ${a}`;e.push(o.trim())}return this.at(`rbrace`)&&this.advance(),e}parseFieldsBlock(e=0){let t=[];if(!this.at(`lbrace`))return t;for(this.advance();!this.at(`rbrace`)&&!this.at(`eof`)&&(this.skipTrivia(),!(this.at(`rbrace`)||this.at(`eof`)));){if(this.peek().type!==`identifier`){this.error(`FM113`,`Expected field name in fields block`,this.peek().range),this.advance();continue}let n=this.advance();this.at(`colon`)&&this.advance();let r=[];for(;!this.at(`newline`)&&!this.at(`comment`)&&!this.at(`lbrace`)&&!this.at(`rbrace`)&&!this.at(`eof`)&&!this.at(`comma`);)r.push(this.advance().value);let i;this.at(`comment`)&&(i=this.advance().value||void 0);let a=`>`.repeat(e),o=pi(r),s=i?`${a}${n.value}: ${o} // ${i}`:`${a}${n.value}: ${o}`;t.push(s.trim()),this.at(`lbrace`)&&t.push(...this.parseFieldsBlock(e+1)),this.at(`comma`)&&this.advance()}return this.at(`rbrace`)&&this.advance(),t}parseOptionalProperties(){return this.at(`lbrace`)?this.parseBlockProperties():{}}parseIdentifierList(){let e=[];if(!this.at(`lbracket`))return e;for(this.advance();!this.at(`rbracket`)&&!this.at(`eof`)&&(this.skipTrivia(),!this.at(`rbracket`));)e.push(this.advance().value),this.at(`comma`)&&this.advance();return this.at(`rbracket`)&&this.advance(),e}};function pi(e){if(e.length===0)return``;let t=``;for(let n of e)n===`.`||n===`(`||n===`[`||n===`)`||n===`]`?t=t.trimEnd()+n:n===`,`?t=t.trimEnd()+`,`:t.endsWith(`.`)||t.endsWith(`(`)||t.endsWith(`[`)||t.endsWith(`,`)?t+=n:t+=t?` ${n}`:n;return t.trim()}var mi=new Set([`padding`,`arrange`,`align`,`gap`,`columns`,`rows`,`column`,`row`,`span`,`colSpan`,`rowSpan`,`chrome`,`shape`,`icon`,`iconPaint`,`iconColor`]);function hi(e){return mi.has(e)}var gi=400,_i=600;function vi(e,t,n){let r=new Set,i=[];for(let a of e){let e=Fr(a.name);if(r.has(e)){let t=2;for(;r.has(`${e}-${t}`);)t++;e=`${e}-${t}`}r.add(e);let o=!1,s=[];for(let e of a.cues){if(e.type===`loop`){o=!0;continue}let r=yi(e,t,n);r&&s.push(r)}let c=s.length===0?`auto`:`authored`;i.push({id:e,name:a.name,loop:o,cues:s,source:c})}return i}function yi(e,t,n){switch(e.type){case`dim`:case`activate`:return{op:e.type,targets:bi(e.targets,t,n,e.range)};case`pulse`:return{op:`pulse`,targets:bi(e.targets,t,n,e.range),durationMs:e.durationMs??gi};case`flow`:for(let r of e.path)t.has(r)||n.push({severity:`error`,code:`FM128`,message:`Unknown node "${r}" in animation flow path`,range:e.range});return{op:`flow`,path:e.path,durationMs:e.durationMs??_i};case`wait`:return{op:`wait`,durationMs:e.durationMs};case`parallel`:{let r=[];for(let i of e.cues){if(i.type===`loop`){n.push({severity:`warning`,code:`FM129`,message:"`loop` inside parallel is ignored — place it on the animation block",range:i.range});continue}if(i.type===`parallel`){n.push({severity:`error`,code:`FM130`,message:`Nested parallel groups are not supported`,range:i.range});continue}let e=yi(i,t,n);e&&r.push(e)}return{op:`parallel`,cues:r}}case`loop`:return null}}function bi(e,t,n,r){let i=[];for(let a of e)a.type===`all`?i.push({type:`all`}):a.type===`node`?(t.has(a.id)||n.push({severity:`error`,code:`FM128`,message:`Unknown node "${a.id}" in animation`,range:r}),i.push({type:`node`,id:a.id})):((!t.has(a.from)||!t.has(a.to))&&n.push({severity:`error`,code:`FM128`,message:`Unknown edge endpoints "${a.from} -> ${a.to}" in animation`,range:r}),i.push({type:`edge`,from:a.from,to:a.to}));return i}var xi=[`preset`,`background`,`grid`,`frame`,`legend`,`nodeGradient`,`groupHeaders`];function Si(e,t=0){return e==null?{top:t,right:t,bottom:t,left:t}:typeof e==`number`?{top:e,right:e,bottom:e,left:e}:{top:e.top??t,right:e.right??t,bottom:e.bottom??t,left:e.left??t}}var Ci={title:!1,labelCase:`as-authored`,showKindSubtitles:!1,showEndpoints:!1,groupAccent:!1,clampLabels:!0};function wi(e,t){if(e===!1||e==null)return!1;if(e===!0||e===`auto`)return t?{text:t,align:`start`}:!1;if(typeof e==`object`){let n=e.text??t;return n?{text:n,subtitle:e.subtitle,align:e.align??`start`}:!1}return!1}function Ti(e,t){let n={...Ci,...e};return{title:wi(n.title,t),padding:Si(n.padding,0),contentPadding:Si(n.contentPadding,0),labelCase:`as-authored`,showKindSubtitles:n.showKindSubtitles===!0,showEndpoints:n.showEndpoints===!0,groupAccent:n.groupAccent===!0,clampLabels:n.clampLabels!==!1}}function Ei(e){let t={},n=t=>{let n=e[t];return typeof n==`string`?n:void 0},r=t=>{let n=e[t];if(typeof n==`boolean`)return n;if(n===`true`)return!0;if(n===`false`)return!1},i=t=>{let n=e[t];return typeof n==`number`?n:void 0},a=e.title,o=n(`titleSubtitle`),s=n(`titleAlign`);a===!1||a===`false`||a===`none`?t.title=!1:a===!0||a===`true`||a===`auto`?t.title=o||s?{subtitle:o,align:s}:a!==`auto`||`auto`:typeof a==`string`?t.title={text:a,subtitle:o,align:s}:(o||s)&&(t.title={subtitle:o,align:s});let c=i(`padding`);c!=null&&(t.padding=c);let l=i(`contentPadding`);l!=null&&(t.contentPadding=l),t.labelCase=`as-authored`;let u=r(`showKindSubtitles`);u!=null&&(t.showKindSubtitles=u);let d=r(`showEndpoints`);if(d!=null&&(t.showEndpoints=d),e.groupAccent===`auto`)t.groupAccent=!0;else{let e=r(`groupAccent`);e!=null&&(t.groupAccent=e)}let f=r(`clampLabels`);return f!=null&&(t.clampLabels=f),t}function Di(e,t){return`as-authored`}function Oi(e,t){return e}function ki(...e){let t;for(let n of e)n&&(t={...t,...n});return t}var Ai=[`rectangle`,`rounded`,`pill`,`circle`,`ellipse`,`diamond`,`hexagon`,`triangle`,`parallelogram`,`trapezoid`,`document`,`folded-document`,`cylinder`,`cloud`,`person`,`queue`,`stream`,`table`,`boundary`],ji={note:`folded-document`,card:`rounded`,round:`rounded`,roundedbox:`rounded`,rect:`rectangle`,box:`rectangle`,cyl:`cylinder`,hex:`hexagon`,diam:`diamond`,capsule:`pill`,stadium:`pill`,pipe:`queue`,log:`stream`};function Mi(e){if(!e)return`rounded`;let t=String(e).trim().toLowerCase();return t?ji[t]??t:`rounded`}function Ni(e){if(!e)return!1;let t=Mi(e);return Ai.includes(t)}var Pi=[`rectangle`,`rounded`,`hexagon`,`circle`,`ellipse`],Fi={hex:`hexagon`,round:`circle`,rect:`rectangle`,box:`rectangle`};function Ii(e){if(!e)return`rectangle`;let t=String(e).trim().toLowerCase();return t?Fi[t]?Fi[t]:Mi(t):`rectangle`}function Li(e){if(!e)return!1;let t=Ii(e);return Pi.includes(t)}function M(e,t){let n=new Set(t.capabilities??[]);(t.shape===`rounded`||t.shape===`rectangle`||t.shape===`table`||t.shape===`boundary`)&&n.add(`card`);let r=Mi(t.shape),i=[`flow-node-${e}`,`flow-shape-${r}`,...t.extraClasses??[]];return{shape:r,icon:t.icon,subtitle:t.subtitle,classNames:[...new Set(i)],cssVars:t.cssVars??{},defaultMinWidth:t.min??120,defaultMaxWidth:t.max??240,defaultDepth:t.depth??1,category:t.category,capabilities:[...n]}}function Ri(e){let t=e.replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):`Node`}function zi(e){return e.replace(/[^a-z0-9-]/gi,``)||`generic`}var Bi={note:M(`note`,{shape:`folded-document`,subtitle:`Note`,category:`general`,min:120,max:280,capabilities:[`annotation`]}),label:M(`label`,{shape:`rounded`,subtitle:`Label`,category:`general`,min:64,max:200,capabilities:[`annotation`,`symbolic`]}),group:M(`group`,{shape:`boundary`,subtitle:`Group`,category:`general`,min:160,max:400,capabilities:[`boundary`]}),image:M(`image`,{shape:`rectangle`,subtitle:`Image`,category:`general`,min:80,max:320}),icon:M(`icon`,{shape:`rounded`,subtitle:`Icon`,category:`general`,min:56,max:96,capabilities:[`symbolic`,`icon-only`]}),start:M(`start`,{shape:`pill`,subtitle:`Start`,category:`flowchart`,min:88,max:160,capabilities:[`symbolic`]}),end:M(`end`,{shape:`pill`,subtitle:`End`,category:`flowchart`,min:88,max:160,capabilities:[`symbolic`]}),process:M(`process`,{shape:`rounded`,subtitle:`Process`,category:`flowchart`,min:128,max:260}),task:M(`task`,{shape:`rounded`,subtitle:`Task`,category:`flowchart`,min:120,max:240}),subprocess:M(`subprocess`,{shape:`rounded`,subtitle:`Subprocess`,category:`flowchart`,min:140,max:280}),choice:M(`choice`,{shape:`diamond`,subtitle:`Decision`,category:`flowchart`,min:180,max:360}),decision:M(`decision`,{shape:`diamond`,subtitle:`Decision`,category:`flowchart`,min:180,max:360,extraClasses:[`flow-node-choice`]}),io:M(`io`,{shape:`parallelogram`,subtitle:`Input / Output`,category:`flowchart`,min:120,max:240}),document:M(`document`,{shape:`document`,subtitle:`Document`,category:`flowchart`,min:120,max:240}),preparation:M(`preparation`,{shape:`hexagon`,subtitle:`Preparation`,category:`flowchart`,min:120,max:220}),manual:M(`manual`,{shape:`trapezoid`,subtitle:`Manual`,category:`flowchart`,min:120,max:240}),connector:M(`connector`,{shape:`circle`,subtitle:`Connector`,category:`flowchart`,min:36,max:56,capabilities:[`symbolic`]}),user:M(`user`,{shape:`person`,subtitle:`Person`,category:`architecture`,min:120,max:260,extraClasses:[`flow-node-user`]}),person:M(`person`,{shape:`person`,subtitle:`Person`,category:`architecture`,min:120,max:260,extraClasses:[`flow-node-user`]}),actor:M(`actor`,{shape:`rounded`,subtitle:`Actor`,category:`architecture`,icon:`user`,min:120,max:240,extraClasses:[`flow-node-actor`],capabilities:[`sequence-lifeline`]}),participant:M(`participant`,{shape:`rounded`,subtitle:`Participant`,category:`architecture`,min:120,max:240,extraClasses:[`flow-node-participant`],capabilities:[`sequence-lifeline`]}),system:M(`system`,{shape:`rounded`,subtitle:`Software System`,category:`architecture`,min:200,max:360}),external:M(`external`,{shape:`rounded`,subtitle:`External System`,category:`architecture`,min:120,max:280}),container:M(`container`,{shape:`rounded`,subtitle:`Container`,category:`architecture`,min:176,max:320}),component:M(`component`,{shape:`rounded`,subtitle:`Component`,category:`architecture`,min:148,max:280}),service:M(`service`,{shape:`rounded`,subtitle:`Service`,category:`architecture`,min:128,max:280}),application:M(`application`,{shape:`rounded`,subtitle:`Application`,category:`architecture`,min:140,max:280,extraClasses:[`flow-node-service`]}),module:M(`module`,{shape:`rounded`,subtitle:`Module`,category:`architecture`,min:120,max:240,extraClasses:[`flow-node-service`]}),package:M(`package`,{shape:`folded-document`,subtitle:`Package`,category:`architecture`,min:120,max:240}),deployment:M(`deployment`,{shape:`rectangle`,subtitle:`Deployment`,category:`architecture`,min:140,max:280,extraClasses:[`flow-node-service`]}),server:M(`server`,{shape:`rectangle`,subtitle:`Server`,category:`infrastructure`,min:120,max:240,extraClasses:[`flow-node-service`]}),database:M(`database`,{shape:`cylinder`,subtitle:`Database`,category:`infrastructure`,min:100,max:200,capabilities:[`datastore`]}),cache:M(`cache`,{shape:`cylinder`,subtitle:`Cache`,category:`infrastructure`,min:100,max:200,capabilities:[`datastore`],extraClasses:[`flow-node-database`]}),store:M(`store`,{shape:`cylinder`,subtitle:`Data store`,category:`infrastructure`,min:100,max:220,capabilities:[`datastore`],extraClasses:[`flow-node-database`]}),bucket:M(`bucket`,{shape:`cylinder`,subtitle:`Object store`,category:`infrastructure`,min:100,max:220,capabilities:[`datastore`],extraClasses:[`flow-node-database`]}),queue:M(`queue`,{shape:`queue`,subtitle:`Queue`,category:`infrastructure`,min:100,max:180,capabilities:[`messaging`]}),topic:M(`topic`,{shape:`stream`,subtitle:`Topic`,category:`infrastructure`,min:100,max:220,capabilities:[`messaging`],extraClasses:[`flow-node-stream`]}),stream:M(`stream`,{shape:`stream`,subtitle:`Stream`,category:`infrastructure`,min:120,max:260,capabilities:[`messaging`]}),gateway:M(`gateway`,{shape:`hexagon`,subtitle:`Gateway`,category:`infrastructure`,min:110,max:200}),loadbalancer:M(`loadbalancer`,{shape:`hexagon`,subtitle:`Load balancer`,category:`infrastructure`,min:120,max:220,extraClasses:[`flow-node-gateway`]}),cloud:M(`cloud`,{shape:`cloud`,subtitle:`Cloud`,category:`infrastructure`,min:140,max:260}),firewall:M(`firewall`,{shape:`rectangle`,subtitle:`Firewall`,category:`infrastructure`,min:100,max:200,extraClasses:[`flow-node-gateway`]}),zone:M(`zone`,{shape:`boundary`,subtitle:`Zone`,category:`infrastructure`,min:180,max:400,capabilities:[`boundary`]}),broker:M(`broker`,{shape:`hexagon`,subtitle:`Broker`,category:`messaging`,min:110,max:200,capabilities:[`messaging`]}),event:M(`event`,{shape:`pill`,subtitle:`Event`,category:`messaging`,min:90,max:180,capabilities:[`messaging`,`symbolic`]}),command:M(`command`,{shape:`rounded`,subtitle:`Command`,category:`messaging`,min:110,max:220,capabilities:[`messaging`],extraClasses:[`flow-node-service`]}),message:M(`message`,{shape:`document`,subtitle:`Message`,category:`messaging`,min:100,max:200,capabilities:[`messaging`]}),worker:M(`worker`,{shape:`rounded`,subtitle:`Worker`,category:`messaging`,min:110,max:200,extraClasses:[`flow-node-service`]}),producer:M(`producer`,{shape:`rounded`,subtitle:`Producer`,category:`messaging`,min:110,max:200,capabilities:[`messaging`],extraClasses:[`flow-node-service`]}),consumer:M(`consumer`,{shape:`rounded`,subtitle:`Consumer`,category:`messaging`,min:110,max:200,capabilities:[`messaging`],extraClasses:[`flow-node-service`]}),dlq:M(`dlq`,{shape:`queue`,subtitle:`Dead-letter queue`,category:`messaging`,min:110,max:200,capabilities:[`messaging`],extraClasses:[`flow-node-queue`,`flow-node-warning`]}),job:M(`job`,{shape:`rounded`,subtitle:`Job`,category:`messaging`,min:110,max:200,extraClasses:[`flow-node-worker`]}),table:M(`table`,{shape:`cylinder`,subtitle:`Table`,category:`modeling`,min:160,max:320,capabilities:[`datastore`,`erd-table`]}),entity:M(`entity`,{shape:`cylinder`,subtitle:`Entity`,category:`modeling`,min:160,max:320,capabilities:[`datastore`,`erd-table`],extraClasses:[`flow-node-table`]}),class:M(`class`,{shape:`table`,subtitle:`Class`,category:`modeling`,min:160,max:320,capabilities:[`erd-table`],extraClasses:[`flow-node-table`]}),interface:M(`interface`,{shape:`rounded`,subtitle:`Interface`,category:`modeling`,min:120,max:240,extraClasses:[`flow-node-service`]}),aggregate:M(`aggregate`,{shape:`rounded`,subtitle:`Aggregate`,category:`modeling`,min:140,max:280,extraClasses:[`flow-node-service`]}),projection:M(`projection`,{shape:`rounded`,subtitle:`Projection`,category:`modeling`,min:140,max:280,extraClasses:[`flow-node-service`]}),policy:M(`policy`,{shape:`hexagon`,subtitle:`Policy`,category:`modeling`,min:120,max:220,extraClasses:[`flow-node-gateway`]}),access:M(`access`,{shape:`rounded`,subtitle:`Access`,category:`modeling`,min:150,max:260}),index:M(`index`,{shape:`rectangle`,subtitle:`Index`,category:`modeling`,min:150,max:260}),invariant:M(`invariant`,{shape:`hexagon`,subtitle:`Invariant`,category:`modeling`,min:140,max:240,extraClasses:[`flow-node-gateway`]}),state:M(`state`,{shape:`rounded`,subtitle:`State`,category:`state`,min:100,max:200}),initial:M(`initial`,{shape:`circle`,subtitle:`Initial`,category:`state`,min:28,max:40,capabilities:[`symbolic`]}),final:M(`final`,{shape:`circle`,subtitle:`Final`,category:`state`,min:32,max:48,capabilities:[`symbolic`]}),junction:M(`junction`,{shape:`circle`,subtitle:`Junction`,category:`state`,min:24,max:36,capabilities:[`symbolic`]}),fork:M(`fork`,{shape:`rectangle`,subtitle:`Fork`,category:`state`,min:80,max:160,capabilities:[`symbolic`]}),join:M(`join`,{shape:`rectangle`,subtitle:`Join`,category:`state`,min:80,max:160,capabilities:[`symbolic`]}),success:M(`success`,{shape:`rounded`,subtitle:`Success`,category:`flowchart`,min:128,max:260}),warning:M(`warning`,{shape:`rounded`,subtitle:`Manual review`,category:`flowchart`,min:128,max:260}),failure:M(`failure`,{shape:`rounded`,subtitle:`Failure`,category:`flowchart`,min:120,max:240,extraClasses:[`flow-node-warning`]}),commit:M(`commit`,{shape:`circle`,subtitle:`Commit`,category:`git`,min:28,max:44,capabilities:[`symbolic`]}),branch:M(`branch`,{shape:`pill`,subtitle:`Branch`,category:`git`,min:72,max:160,capabilities:[`symbolic`]}),tag:M(`tag`,{shape:`pill`,subtitle:`Tag`,category:`git`,min:64,max:140,capabilities:[`symbolic`]})};for(let[e,t]of Object.entries({rectangle:{shape:`rectangle`,subtitle:`Rectangle`,category:`shape`,min:100,max:240},rounded:{shape:`rounded`,subtitle:`Rounded`,category:`shape`,min:100,max:240},pill:{shape:`pill`,subtitle:`Pill`,category:`shape`,min:88,max:180,capabilities:[`symbolic`]},circle:{shape:`circle`,subtitle:`Circle`,category:`shape`,min:36,max:72,capabilities:[`symbolic`]},ellipse:{shape:`ellipse`,subtitle:`Ellipse`,category:`shape`,min:100,max:200},diamond:{shape:`diamond`,subtitle:`Diamond`,category:`shape`,min:120,max:280},hexagon:{shape:`hexagon`,subtitle:`Hexagon`,category:`shape`,min:110,max:220},triangle:{shape:`triangle`,subtitle:`Triangle`,category:`shape`,min:64,max:140,capabilities:[`symbolic`]},parallelogram:{shape:`parallelogram`,subtitle:`Parallelogram`,category:`shape`,min:120,max:240},trapezoid:{shape:`trapezoid`,subtitle:`Trapezoid`,category:`shape`,min:120,max:240},"folded-document":{shape:`folded-document`,subtitle:`Folded document`,category:`shape`,min:120,max:240,capabilities:[`annotation`]},cylinder:{shape:`cylinder`,subtitle:`Cylinder`,category:`shape`,min:100,max:200,capabilities:[`datastore`]},boundary:{shape:`boundary`,subtitle:`Boundary`,category:`shape`,min:160,max:400,capabilities:[`boundary`]}}))e in Bi||(Bi[e]=M(e,t));var Vi={shape:`rounded`,subtitle:`Node`,classNames:[`flow-node-generic`],cssVars:{},defaultMinWidth:100,defaultMaxWidth:200,defaultDepth:1,category:`general`,capabilities:[`card`]};function Hi(e){return Bi[e]||M(e,{shape:e,subtitle:Ri(e),category:`shape`})}function Ui(e){let t=Bi[e];if(t)return{defaults:t,isBuiltin:!0};let n=Mi(e);return n!==e&&Ni(n)?{defaults:Hi(n),isBuiltin:!0}:Ai.includes(e)?{defaults:Hi(e),isBuiltin:!0}:{defaults:{...Vi,subtitle:Ri(e),classNames:[`flow-node-${zi(e)}`,`flow-node-generic`]},isBuiltin:!1}}function Wi(e,t){return Ui(e).defaults.capabilities.includes(t)}function Gi(e){return Ui(e).defaults.subtitle}var Ki=Object.keys(Bi).sort(),qi=Bi;function Ji(e){switch(e.toLowerCase()){case`lr`:case`right`:return`LR`;case`rl`:return`RL`;case`td`:case`tb`:case`down`:return`TD`;case`bt`:return`BT`;default:return e.toUpperCase()}}function Yi(e){let t=e.split(`
|
|
19
|
+
`);if(t.length<2)return e;let n=e=>/^[ ]*/.exec(e)?.[0].length??0,r=t.filter(e=>e.trim().length>0);if(r.length===0)return e;let i=Math.min(...r.map(n));return i<=0?e:t.map(e=>e.trim().length===0?``:e.slice(i)).join(`
|
|
20
|
+
`)}function Xi(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,`payload`))return;let r=e.payload;if(typeof r!=`string`){n.push({severity:`warning`,code:`FM148`,message:`Sequence payload must be a string excerpt`,range:t,hint:`Paste the excerpt between """, so JSON can keep its own quotes.`});return}let i=r.replace(/\r\n/g,`
|
|
21
|
+
`),a=Yi(i.includes(`
|
|
22
|
+
`)?i.replace(/^\n+/,``).replace(/[ \t]*$/,``).replace(/\n+$/,``):i.trim());if(!a)return;let o=a.split(`
|
|
23
|
+
`);return o.length>6&&n.push({severity:`warning`,code:`FM148`,message:`Sequence payload is ${o.length} lines; the excerpt will be shortened to 6`,range:t,hint:`Keep the fields a reader needs on this message.`}),a}function Zi(e,t,n){if(t===`*`)return`found`;if(n===`*`)return`lost`;switch(e){case`-->`:return`return`;case`~>`:case`<~`:case`=>`:case`<=`:return`async`;case`-x`:case`x-`:return`failure`;default:return`sync`}}function Qi(e){let t=e.styles??e.style;return Array.isArray(t)?t.map(String):typeof t==`string`?[t]:[]}function $i(e){let t={};for(let[n,r]of Object.entries(e))(typeof r==`string`||typeof r==`number`||typeof r==`boolean`)&&(n.startsWith(`--`)||n===`iconColor`)&&(n===`iconColor`?t[`--icon-color`]=String(r):n.startsWith(`--`)&&(t[n]=String(r)));return t}function ea(e,t,n){if(t.has(e.id))return n.push({severity:`error`,code:`FM101`,message:`Duplicate participant id "${e.id}"`,range:e.range}),t.get(e.id)??null;let{defaults:r,isBuiltin:i}=Ui(e.kind);i||n.push({severity:`warning`,code:`FM102`,message:`Unknown node kind "${e.kind}" — using generic defaults`,range:e.range,hint:`Any kind can be a sequence lifeline; prefer participant, actor, or architecture kinds.`});let a=e.properties.shape==null?void 0:String(e.properties.shape),o=a?Mi(a):void 0;a&&!Ni(o)&&n.push({severity:`warning`,code:`FM111`,message:`Unknown shape "${a}"`,range:e.range});let s=[...Qi(e.properties),...e.styleRefs],c={...r.cssVars,...$i(e.properties)},l=e.properties.icon==null?void 0:String(e.properties.icon),u=l===`none`?void 0:l===void 0?r.shape===`person`?void 0:r.icon:l,d=e.properties.iconPaint==null?void 0:String(e.properties.iconPaint).toLowerCase(),f=d===`theme`||d===`brand`?d:void 0,p=e.properties.iconColor!=null&&String(e.properties.iconColor).length>0?String(e.properties.iconColor):void 0,m={...c,...p?{"--icon-color":p}:{}},h={id:e.id,label:e.label??e.id,labelAuthored:e.label!=null,kind:e.kind,shape:o??r.shape,icon:u,iconPaint:f,iconColor:p,minWidth:r.defaultMinWidth,maxWidth:r.defaultMaxWidth,depth:r.defaultDepth,styleRefs:s,unresolvedVars:Object.keys(m).length?m:void 0,sourceRange:e.range};return t.set(e.id,h),h}function ta(e){let t=e.order;return e.order+=1,t}function na(e,t,n){t!==`*`&&t&&(e.nodes.has(t)?e.participantOrder.includes(t)||e.participantOrder.push(t):e.diagnostics.push({severity:`error`,code:`FM147`,message:`Unknown participant "${t}" — declare with \`id: kind "Label"\` before use`,range:n??{start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}}}))}function ra(e,t,n){let r=ta(e),i=t.id??`msg${e.edgeCounter++}`,a={...t,id:i,order:r};e.messages.push(a);let o=n?.styleRefs??[],s=n?.branch??(a.label==null?void 0:Nr(a.label));return a.from&&a.to&&a.from!==`*`&&a.to!==`*`&&e.edges.push({id:i,from:a.from,to:a.to,label:a.label,labelAuthored:a.labelAuthored,kind:a.kind===`async`?`eventual`:a.kind===`failure`?`failure`:a.kind===`return`?`dependency`:a.kind===`destroy`?`failure`:`sync`,arrows:`end`,styleRefs:o,branch:s===`neutral`?void 0:s,sequenceOrder:r,sequenceKind:a.kind,sourceRange:a.sourceRange}),a}function ia(e,t,n){let r=e.openActivations.get(t);if(!r||r.length===0)return;let i=r.pop();e.activations.push({id:i.id,participantId:t,startOrder:i.startOrder,endOrder:n,sourceRange:i.range})}function aa(e,t,n,r){let i=e.openActivations.get(t)??[];return!i.some(e=>e.startOrder===n)&&(i.push({id:`act${e.nextActId++}`,startOrder:n,range:r}),e.openActivations.set(t,i),!0)}function oa(e,t){for(let n of e)switch(n.type){case`Node`:ea(n,t.nodes,t.diagnostics),t.participantOrder.includes(n.id)||t.participantOrder.push(n.id);break;case`Edge`:{let e=n.from,r=n.to;na(t,e,n.range),na(t,r,n.range);let i=Zi(n.op,e,r),a=[...Qi(n.properties),...n.styleRefs],o=Pr(n.properties.branch)??(n.label==null?void 0:Nr(n.label)),s=Xi(n.properties,n.range,t.diagnostics),c=ra(t,{from:e===`*`?null:e,to:r===`*`?null:r,kind:i,label:n.label,labelAuthored:n.label!=null,...s?{payload:s}:{},sourceRange:n.range},{styleRefs:a,branch:o});if(i===`sync`&&c.to){let e=aa(t,c.to,c.order,n.range);c.from&&c.from!==c.to?t.callStack.push({messageId:c.id,to:c.to,from:c.from}):e&&c.from===c.to&&ia(t,c.to,c.order)}else if(i===`return`&&c.from){let e=[...t.callStack].reverse().findIndex(e=>e.to===c.from);if(e>=0){let n=t.callStack.length-1-e;c.replyTo=t.callStack[n].messageId,t.callStack.splice(n,1)}ia(t,c.from,c.order)}break}case`SequenceActivate`:{na(t,n.participantId,n.range);let e=t.messages.at(-1)?.to===n.participantId?Math.max(0,t.order-1):t.order;aa(t,n.participantId,e,n.range);break}case`SequenceDeactivate`:na(t,n.participantId,n.range),ia(t,n.participantId,Math.max(0,t.order-1));break;case`SequenceCreate`:{ea(n.node,t.nodes,t.diagnostics),t.participantOrder.includes(n.node.id)||t.participantOrder.push(n.node.id);let e=t.messages.at(-1);ra(t,{from:e?.to??e?.from??null,to:n.node.id,kind:`create`,label:n.node.label,labelAuthored:n.node.label!=null,sourceRange:n.range});break}case`SequenceDestroy`:na(t,n.participantId,n.range),ra(t,{from:n.participantId,to:n.participantId,kind:`destroy`,sourceRange:n.range}),ia(t,n.participantId,t.order-1);break;case`SequenceNote`:{for(let e of n.participantIds)na(t,e,n.range);let e=ta(t);t.notes.push({id:`note${t.nextNoteId++}`,order:e,placement:n.placement,participantIds:n.participantIds,text:n.text,sourceRange:n.range});break}case`SequenceDivider`:{let e=ta(t);t.dividers.push({id:`div${t.nextDivId++}`,order:e,label:n.label,sourceRange:n.range});break}case`SequenceAutonumber`:t.autonumber=!0;break;case`SequenceFragment`:sa(n,t);break;case`Style`:t.styles.push({name:n.name,target:n.target,properties:Object.fromEntries(Object.entries(n.properties).map(([e,t])=>[e,String(t)]))});break;case`StyleRef`:for(let e of n.targetIds){let r=t.nodes.get(e);r&&!r.styleRefs.includes(n.styleName)&&r.styleRefs.push(n.styleName)}}}function sa(e,t){let n=`frag${t.nextFragId++}`,r=t.order,i=[];for(let n of e.operands){let e=t.order,r=t.fragments.length;oa(n.statements,t);let a=t.fragments.splice(r),o=Math.max(e,t.order-1);i.push({label:n.label,styleRefs:[...n.styleRefs],startOrder:e,endOrder:o,children:a})}let a=Math.max(r,t.order-1);t.fragments.push({id:n,operator:e.operator,label:e.label,styleRefs:[...e.styleRefs],unresolvedVars:{},startOrder:r,endOrder:a,operands:i,sourceRange:e.range})}function ca(e){let t=[];for(let n of e)if(n.type===`AnimationBlock`&&t.push(n),n.type===`SequenceFragment`)for(let e of n.operands)t.push(...ca(e.statements));return t}function la(e){let t=Math.max(0,e.order-1);for(let[n,r]of e.openActivations)for(;r.length;){let i=r.pop();e.activations.push({id:i.id,participantId:n,startOrder:i.startOrder,endOrder:t,sourceRange:i.range})}}function ua(e,t=0){let n=[...e.diagnostics],r=e.body[t];if(!r||r.type!==`Sequence`)return n.push({severity:`error`,code:`FM100`,message:`No sequence diagram found at index`,range:{start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}}}),{graph:{id:`empty`,diagramKind:`sequence`,nodes:[],edges:[],groups:[],styles:[],animations:[],diagnostics:n},layoutHints:{},routingHints:{},renderHints:{},diagnostics:n};let i=r,a={nodes:new Map,edges:[],styles:[],diagnostics:n,participantOrder:[],messages:[],activations:[],fragments:[],notes:[],dividers:[],autonumber:!1,order:0,edgeCounter:0,openActivations:new Map,callStack:[],nextActId:0,nextFragId:0,nextNoteId:0,nextDivId:0};oa(i.statements,a),la(a);let o={autonumber:a.autonumber,messages:a.messages,activations:a.activations,fragments:a.fragments,notes:a.notes,dividers:a.dividers,participantOrder:a.participantOrder},s={id:i.name?i.name.toLowerCase().replace(/\s+/g,`-`):`sequence`,title:i.name,diagramKind:`sequence`,sequence:o,nodes:a.participantOrder.map(e=>a.nodes.get(e)).filter(Boolean),edges:a.edges,groups:[],styles:a.styles,animations:vi(ca(i.statements),a.nodes,n),diagnostics:n},c=N(i);n.push(...c.diagnostics);let{diagnostics:l,...u}=c;return u.layoutHints={...u.layoutHints,direction:u.layoutHints.direction??`TD`},{graph:s,...u,diagnostics:n}}function N(e){let t={},n={},r={},i=[],a=[];for(let i of e.statements){if(i.type===`Directive`&&(i.name===`direction`&&i.value&&(t.direction=Ji(String(i.value))),i.name===`density`&&i.value)){let e=String(i.value);(e===`compact`||e===`normal`||e===`spacious`)&&(t.density=e)}if(i.type===`LayoutBlock`&&(i.properties.direction&&(t.direction=Ji(String(i.properties.direction))),i.properties.density)){let e=String(i.properties.density);(e===`compact`||e===`normal`||e===`spacious`)&&(t.density=e)}if(i.type===`EdgePolicyBlock`&&i.properties.route&&(n.route=String(i.properties.route)),i.type===`RenderBlock`&&i.properties.theme&&(r.theme=String(i.properties.theme)),i.type===`PresentationBlock`){let e=Ei(i.properties);e&&a.push(e)}}let o=ki(...a);return o&&(r.presentation=o),{layoutHints:t,routingHints:n,renderHints:r,diagnostics:i}}var P={partition:`partition`,sort:`sort`,ref:`reference`,reference:`reference`,copy:`materialized`,materialized:`materialized`};function da(e){return e.match(/^(>*)/)?.[1]?.length??0}function fa(e){let t=e.trim();if(!t)return null;let n=0;for(;t.startsWith(`>`);)n+=1,t=t.slice(1).trimStart();let r,i=t.split(/\s+\/\/\s+/);i.length>1&&(t=i[0].trim(),r=i.slice(1).join(` // `).trim()||void 0);let a=t.replace(/\s*:\s*/g,` `).split(/\s+/).filter(Boolean);if(a.length===0)return null;let o=a[0],s=[],c=!1,l=[];for(let e of a.slice(1)){let t=e.toLowerCase();if(t===`required`||t===`nn`){c=!0;continue}if(t===`optional`)continue;let n=P[t];n?s.includes(n)||s.push(n):l.push(e)}return{name:o,type:l.length?l.join(` `):void 0,keys:[],notNull:c||void 0,note:r,depth:n,roles:s.length?s:void 0}}function pa(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=fa(String(n));e&&t.push(e)}return t}function ma(e){let t=[];e.type&&t.push(e.type),e.notNull&&t.push(`required`);for(let n of e.roles??[])n===`reference`?t.push(`ref`):n===`materialized`?t.push(`copy`):t.push(n);let n=e.name;return t.length&&(n+=`: ${t.join(` `)}`),e.note&&(n+=` // ${e.note}`),n}var ha=[`couchdb`,`mongodb`,`dynamodb`,`cosmosdb`,`firestore`],ga={couchdb:{name:`couchdb`,product:`CouchDB`,partitionMode:`when-declared`,partitionInDocumentId:!0,databaseReadAudience:!0,partitionCommit:!1,multiDocumentTransaction:!1,crossPartition:`when-partitioned`},mongodb:{name:`mongodb`,product:`MongoDB`,partitionMode:`when-declared`,partitionInDocumentId:!1,databaseReadAudience:!1,partitionCommit:!0,multiDocumentTransaction:!0,crossPartition:`when-partitioned`},dynamodb:{name:`dynamodb`,product:`DynamoDB`,partitionMode:`always`,partitionInDocumentId:!1,databaseReadAudience:!1,partitionCommit:!0,multiDocumentTransaction:!0,crossPartition:`requires-global-index`},cosmosdb:{name:`cosmosdb`,product:`Cosmos DB`,partitionMode:`always`,partitionInDocumentId:!1,databaseReadAudience:!1,partitionCommit:!0,multiDocumentTransaction:!1,crossPartition:`when-partitioned`},firestore:{name:`firestore`,product:`Firestore`,partitionMode:`never`,partitionInDocumentId:!1,databaseReadAudience:!1,partitionCommit:!1,multiDocumentTransaction:!0,crossPartition:`collection-group`}};function _a(e){if(!e)return;let t=e.trim().toLowerCase();if(va(t))return ga[t]}function va(e){return ha.includes(e)}function ya(e,t){return e?.partitionMode===`always`||e?.partitionMode!==`never`&&t===!0}function ba(e,t,n){return!n||t===`application`?!0:!t||t===`document`||e.length===0?!1:e.every(e=>xa(e,t))}function xa(e,t){return t===`partition`?e.partitionCommit:e.multiDocumentTransaction}function Sa(e,t){return e.name===`couchdb`?`Partitioned CouchDB document "${t}" has no partition field`:e.name===`mongodb`?`Sharded MongoDB document "${t}" has no shard key`:`${e.product} document "${t}" has no partition key`}function Ca(e){return e.name===`couchdb`?`Set partition to the field embedded in the document _id, for example partition: employeeId.`:e.name===`mongodb`?`Set partition to the shard key field. The shard key stays a document field.`:e.name===`dynamodb`?`Set partition to the table partition key attribute.`:`Set partition to the container partition key.`}function wa(e,t){if(e.partitionMode===`always`)return`${e.product} database "${t}" is marked unpartitioned, and every ${Fa(e)} has a partition key`;if(e.partitionMode===`never`)return`${e.product} database "${t}" is marked partitioned, and ${e.product} does not take a document partition key`}function Ta(e){return e.partitionMode===`never`?`Remove partitioned and scope each access path by collection.`:`Remove partitioned: false and set partition on each document.`}function Ea(e,t){return`${e.product} document "${t}" sets a partition key, and ${e.product} does not take one`}function Da(e,t,n){return e.name===`couchdb`?`Access "${t}" crosses CouchDB partitions`:e.name===`mongodb`?`Access "${t}" misses the MongoDB shard key and scatters across shards`:e.name===`dynamodb`?n?`Access "${t}" uses global secondary index "${n}", which has its own partition key`:`Access "${t}" queries across DynamoDB partitions without a global secondary index`:e.name===`firestore`?`Access "${t}" is a Firestore collection group query`:`Access "${t}" crosses ${e.product} partitions`}function Oa(e,t){return e.name===`couchdb`?`Partition-local queries read one shard range. A global index or a duplicated projection serves cross-partition reads.`:e.name===`mongodb`?`Include the shard key for a targeted query, or record this scatter-gather read as a tradeoff.`:e.name===`dynamodb`?t?`A global secondary index is eventually consistent by default and has its own throughput.`:`A Query on the base table needs the partition key. Model a global secondary index or a Scan as its own access path.`:e.name===`cosmosdb`?`A cross-partition query is allowed and is billed in request units.`:`A collection group query needs a collection group index, and security rules apply to each matching document.`}function ka(e){return`Access "${e}" asks for a partition query, and Firestore does not have partition keys`}function Aa(e){return e?.name===`couchdb`?`A partitioned CouchDB index cannot answer a query across partitions.`:e?.name===`mongodb`?`A shard-local index does not answer a query across shards.`:e?.name===`dynamodb`?`A local secondary index stays on the table partition key. Use a global secondary index for a cross-partition read.`:e?.name===`cosmosdb`?`A partition-scoped index does not serve a cross-partition query.`:e?.name===`firestore`?`Use one scope for the access path and the index: a collection, or a collection group.`:`The access path and the index cover different scopes.`}function ja(e,t,n){if(t===`partition`||t===`transaction`){let r=n.filter(e=>!xa(e,t)),i=(r.length>0?r:n).map(e=>e.product);return i.length===0?`Invariant "${e}" claims enforcement "${t}" and no database profile says the store can commit it`:t===`partition`?`Invariant "${e}" is enforced in one partition, and ${Ia(i)} cannot commit a partition as one unit`:`Invariant "${e}" uses a multi-document transaction, and ${Ia(i)} cannot commit one`}return t===`document`?`Invariant "${e}" reads more than one document but enforcement is a single document`:`Invariant "${e}" reads more than one document and does not say where that is enforced`}function Ma(e,t){if(t.length>1)return`Name an enforcement every database involved can commit, or set enforcement: application.`;let n=t[0];return n?e===`document`?`${Na(n)} Keep the rule in one document, or set enforcement: application and name the coordination.`:`${Na(n)} ${Pa(n)}`:`Set enforcement to document, partition, transaction, or application.`}function Na(e){return e.name===`couchdb`?`CouchDB commits one document at a time.`:e.name===`mongodb`?`MongoDB can commit a bounded multi-document transaction.`:e.name===`dynamodb`?`DynamoDB TransactWriteItems commits up to 100 items across partition keys.`:e.name===`cosmosdb`?`Cosmos DB commits atomically inside one logical partition.`:`A Firestore transaction reads every document before it writes.`}function Pa(e){return e.name===`couchdb`?`Set enforcement: document or enforcement: application.`:e.name===`cosmosdb`?`Set enforcement: partition or enforcement: application.`:`Set enforcement: transaction or enforcement: application.`}function Fa(e){return e.name===`dynamodb`?`table`:e.name===`cosmosdb`?`container`:`database`}function Ia(e){return e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e.at(-1)}`}var F={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function La(e,t){let n=pa(t.fields),r=n.length>0,i=Ba(e,t,r);return{columns:r?n:void 0,forceTable:e===`document`&&r,data:i,generatedNote:i?.role===`document`?i.idPattern:void 0,generatedSubtitle:i?.role===`document`&&i.partition?`partition ${i.partition}`:void 0,generatedDescription:Za(i)}}function Ra(e){let t={};for(let n of e)n.type===`Directive`&&n.value!=null&&(n.name===`profile`&&(t.profile=String(n.value)),n.name===`audience`&&(t.audience=String(n.value)),n.name===`partitioned`&&(t.partitioned=lo(n.value)));return t}function za(e){let t=[...e.nodes.values()],n=e.nodes;for(let r of t){let t=r.data;if(!t)continue;let i=r.sourceRange??F;if((t.role===`access`||t.role===`index`)&&Ya(e.edges,r,t.on,Xa(t),i,n,e.diagnostics),t.role===`invariant`){t.on&&Ya(e.edges,r,t.on,`invariant`,i,n,e.diagnostics);for(let a of t.spans??[])Ya(e.edges,r,a,`invariant`,i,n,e.diagnostics)}}Va(e.groups,t,e.diagnostics);for(let n of t){let r=n.data;if(!r)continue;let i=n.sourceRange??F;r.role===`document`&&Ha(n,e.groups,e.diagnostics,i),r.role===`access`&&Wa(n,t,e.groups,e.diagnostics,i),r.role===`index`&&Ka(n,t,e.diagnostics,i),r.role===`invariant`&&qa(n,t,e.groups,e.diagnostics,i)}Ja(t,e.groups,e.diagnostics)}function Ba(e,t,n){if(e===`document`){let e=ro(t,`idPattern`),r=ro(t,`partition`),i=ro(t,`audience`);return!n&&!e&&!r&&!i?void 0:{role:`document`,idPattern:e,partition:r,audience:i}}if(e===`access`)return{role:`access`,on:ro(t,`on`),scope:ao(t.scope),using:ro(t,`using`),consistency:ro(t,`consistency`),returns:ro(t,`returns`),partition:ro(t,`partition`)};if(e===`index`)return{role:`index`,on:ro(t,`on`),scope:oo(t.scope),keys:io(t.keys),partial:ro(t,`partial`)};if(e===`invariant`)return{role:`invariant`,on:ro(t,`on`),spans:io(t.spans),reads:so(t.reads),enforcement:co(t.enforcement)}}function Va(e,t,n){for(let r of e){if(r.kind!==`database`)continue;let i=r.dataStore?.profile;if(!i)continue;let a=_a(i),o=eo(r,t,e);if(!a){n.push({severity:`warning`,code:`DM202`,message:`Database "${r.id}" profile "${i}" has no constraint pack`,range:o,hint:`Known profiles: ${ha.join(`, `)}.`});continue}let s=r.dataStore?.partitioned===!0;if(!(a.partitionMode===`always`&&r.dataStore?.partitioned===!1||a.partitionMode===`never`&&s))continue;let c=wa(a,r.id);c&&n.push({severity:`warning`,code:`DM201`,message:c,range:o,hint:Ta(a)})}}function Ha(e,t,n,r){let i=e.data,a=Qa(e,t),o=_a(a?.dataStore?.profile);Ua(e,i.partition,n,r),o&&(o.partitionMode===`never`?i.partition&&n.push({severity:`warning`,code:`DM201`,message:Ea(o,e.id),range:r,hint:`Remove partition and scope the access path by collection.`}):ya(o,a?.dataStore?.partitioned)&&(i.partition||n.push({severity:`warning`,code:`DM201`,message:Sa(o,e.id),range:r,hint:Ca(o)}),o.partitionInDocumentId&&(i.idPattern?i.partition&&!no(i.idPattern,i.partition)&&n.push({severity:`warning`,code:`DM201`,message:`Partitioned CouchDB document "${e.id}" does not place "${i.partition}" in its _id`,range:r,hint:`Include {${i.partition}} before the colon in idPattern.`}):n.push({severity:`warning`,code:`DM201`,message:`Partitioned CouchDB document "${e.id}" has no _id pattern`,range:r,hint:`CouchDB partitioned ids look like "{partition}:{docId}".`}))))}function Ua(e,t,n,r){t&&e.columns?.length&&(e.columns.find(e=>e.name===t)?.roles?.includes(`partition`)||n.push({severity:`warning`,code:`DM207`,message:`Document "${e.id}" partition "${t}" is not a partition field`,range:r,hint:`Mark that field with the partition role: ${t}: string required partition`}))}function Wa(e,t,n,r,i){let a=e.data,o=a.on?t.find(e=>e.id===a.on):void 0,s=a.using?t.find(e=>e.id===a.using):void 0,c=o?Qa(o,n):void 0;if(a.scope===`direct`)return;let l=_a(c?.dataStore?.profile);if(l?.crossPartition===`collection-group`&&a.scope===`partition`&&r.push({severity:`warning`,code:`DM206`,message:ka(e.id),range:i,hint:`Use scope: direct for a document get. Leave scope unset for a collection query.`}),!a.using||!s||s.data?.role!==`index`){r.push({severity:`warning`,code:`DM203`,message:`Access "${e.id}" has no supporting index`,range:i,hint:`Point using at an index on the same document, or set scope: direct for an _id lookup.`});return}s.data.on&&a.on&&s.data.on!==a.on&&r.push({severity:`warning`,code:`DM203`,message:`Access "${e.id}" uses index "${s.id}", which is on "${s.data.on}"`,range:i,hint:`Declare the index with on: ${a.on}.`});let u=to(s,c);a.scope===`partition`&&u===`global`&&r.push({severity:`warning`,code:`DM209`,message:`Access "${e.id}" expects a partition query but index "${s.id}" is global`,range:i}),a.scope===`global`&&u===`partitioned`&&r.push({severity:`warning`,code:`DM209`,message:l?.name===`firestore`?`Access "${e.id}" is a collection group query but index "${s.id}" covers one collection`:`Access "${e.id}" is global but index "${s.id}" only covers one partition`,range:i,hint:Aa(l)}),Ga(e,a,l,c,s,u,r,i)}function Ga(e,t,n,r,i,a,o,s){if(!n||!(t.scope===`global`||t.scope==null&&a===`global`)||n.crossPartition===`when-partitioned`&&!ya(n,r?.dataStore?.partitioned))return;let c=i?.data?.scope===`global`?i.id:void 0;o.push({severity:`warning`,code:`DM206`,message:Da(n,e.id,c),range:s,hint:Oa(n,c!==void 0)})}function Ka(e,t,n,r){let i=e.data,a=i.on?t.find(e=>e.id===i.on):void 0;if(!a?.columns?.length||!i.keys?.length)return;let o=new Set(a.columns.map(e=>e.name));for(let t of i.keys)o.has(t)||n.push({severity:`warning`,code:`DM208`,message:`Index "${e.id}" key "${t}" is not a field of "${a.id}"`,range:r})}function qa(e,t,n,r,i){let a=e.data,o=[...new Set([...a.on?[a.on]:[],...a.spans??[]])],s=a.reads===`many`||(a.spans?.length??0)>1,c=$a(o,t,n);ba(c,a.enforcement,s)||r.push({severity:`warning`,code:`DM204`,message:ja(e.id,a.enforcement,c),range:i,hint:Ma(a.enforcement,c)})}function Ja(e,t,n){for(let r of t){if(!_a(r.dataStore?.profile)?.databaseReadAudience)continue;let i=e.filter(e=>e.data?.role===`document`&&Qa(e,t)?.id===r.id),a=new Set;r.dataStore?.audience&&a.add(r.dataStore.audience);for(let e of i)e.data?.audience&&a.add(e.data.audience);a.size>1&&n.push({severity:`warning`,code:`DM205`,message:`Database "${r.id}" mixes read audiences (${[...a].sort().join(`, `)})`,range:i[0]?.sourceRange??F,hint:`CouchDB members can read every document in a database. Split incompatible audiences into separate databases.`})}}function Ya(e,t,n,r,i,a,o){n&&(a.has(n)?e.some(e=>e.from===t.id&&e.to===n)||e.push({id:`data-${t.id}-${n}`,from:t.id,to:n,label:r,labelAuthored:!0,kind:`dependency`,arrows:`end`,styleRefs:[],sourceRange:i}):o.push({severity:`warning`,code:`DM210`,message:`${t.kind} "${t.id}" targets unknown node "${n}"`,range:i}))}function Xa(e){return e.role===`access`?e.scope===`direct`?`id lookup`:e.scope===`global`?`global query`:e.scope===`partition`?`partition query`:`access`:e.scope===`global`?`global index`:e.scope===`partitioned`?`partitioned index`:`index`}function Za(e){if(e){if(e.role===`access`)return`${e.scope===`partition`?`partition query`:e.scope===`global`?`global query`:e.scope===`direct`?`id lookup`:`access`}${e.using?` via ${e.using}`:``}${e.consistency?` · ${e.consistency}`:``}`;if(e.role===`index`)return`${e.scope===`global`?`global index`:e.scope===`partitioned`?`partitioned index`:`index`} · ${e.keys?.length?e.keys.join(`, `):`keys unset`}`;if(e.role===`invariant`)return`${e.enforcement===`application`?`application enforced`:e.enforcement===`document`?`one document`:e.enforcement===`partition`?`one partition`:e.enforcement===`transaction`?`transaction`:`enforcement unset`}${e.reads===`many`?` · reads many`:``}`}}function Qa(e,t){if(!e)return;let n=new Map(t.map(e=>[e.id,e])),r=e.groupId;for(;r;){let e=n.get(r);if(!e)return;if(e.kind===`database`)return e;r=e.parentId}}function $a(e,t,n){let r=new Map;for(let i of e){let e=_a(Qa(t.find(e=>e.id===i),n)?.dataStore?.profile);e&&r.set(e.name,e)}return[...r.values()]}function eo(e,t,n){return t.find(t=>Qa(t,n)?.id===e.id&&t.sourceRange)?.sourceRange??F}function to(e,t){if(e.data?.scope===`global`)return`global`;if(e.data?.scope===`partitioned`)return`partitioned`;let n=_a(t?.dataStore?.profile);return n?.crossPartition===`collection-group`||ya(n,t?.dataStore?.partitioned)?`partitioned`:`global`}function no(e,t){return e.includes(`{${t}}`)||e.includes(t)}function ro(e,t){let n=e[t];if(typeof n==`string`&&n.trim())return n.trim();if(typeof n==`number`||typeof n==`boolean`)return String(n)}function io(e){if(!Array.isArray(e))return;let t=e.map(e=>String(e).trim()).filter(Boolean);return t.length?t:void 0}function ao(e){let t=String(e??``).toLowerCase();if(t===`direct`||t===`id`)return`direct`;if(t===`partition`||t===`partitioned`)return`partition`;if(t===`global`)return`global`}function oo(e){let t=String(e??``).toLowerCase();if(t===`global`)return`global`;if(t===`partition`||t===`partitioned`)return`partitioned`}function so(e){let t=String(e??``).toLowerCase();if(t===`many`||t===`multiple`)return`many`;if(t===`one`||t===`single`)return`one`}function co(e){let t=String(e??``).toLowerCase();if(t===`document`||t===`doc`)return`document`;if(t===`partition`)return`partition`;if(t===`transaction`)return`transaction`;if(t===`application`||t===`app`)return`application`}function lo(e){return e===!0||e===`true`||e===`yes`}function uo(e){let t=e.toLowerCase(),n,r=3;for(let e of Ki){let i=fo(t,e.toLowerCase());i<r&&(r=i,n=e)}return n}function fo(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array.from({length:r+1},()=>0));for(let e=0;e<=n;e++)i[e][0]=e;for(let e=0;e<=r;e++)i[0][e]=e;for(let a=1;a<=n;a++)for(let n=1;n<=r;n++){let r=e[a-1]===t[n-1]?0:1;i[a][n]=Math.min(i[a-1][n]+1,i[a][n-1]+1,i[a-1][n-1]+r)}return i[n][r]}function po(e){let t=[],n=e.styles;if(Array.isArray(n))for(let e of n)t.push(String(e));return t}function mo(e){let t={};for(let[n,r]of Object.entries(e))n.startsWith(`--`)&&(t[n]=String(r));return Object.keys(t).length?t:void 0}function ho(e){switch(e){case`=>`:case`<=`:return`async`;case`~>`:case`<~`:return`eventual`;case`..>`:case`<..`:case`-->`:return`dependency`;case`-x`:case`x-`:return`failure`;case`--`:return`association`;default:return`sync`}}function go(e){return e===`<-`||e===`<=`||e===`<..`||e===`x-`||e===`<~`}function _o(e){return e===`<->`?`both`:e===`--`?`none`:`end`}function vo(e){if(e===`low`||e===`normal`||e===`high`)return e}function yo(e){if(typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)return;let t=String(e).trim().toLowerCase();if(t===`start`||t===`begin`||t===`source`)return`start`;if(t===`middle`||t===`mid`||t===`center`)return`middle`;if(t===`end`||t===`target`)return`end`}function bo(e){if(e===`auto`||e===`flat`||e===`compound`||e===`swimlane`)return e}function xo(e){return e.some(e=>e.kind===`swimlane`&&e.parentId==null)}function So(e,t){return xo(e)?{...t,direction:t.direction??`LR`,groupLayout:t.groupLayout===`flat`?`flat`:`swimlane`}:t}function Co(e){switch(e){case`straight`:case`balanced`:case`basic`:return e;default:return}}function wo(e){if(e===`compact`||e===`normal`||e===`spacious`)return e}function To(e){return e===`mid`||e===`comfortable`||e===`roomy`}function Eo(e){if(e===`none`||e===`gaps`||e===`jumps`||e===`smart`)return e;if(e===`gap`)return`gaps`}function Do(e){if(e===!0||e===!1)return e;if(e===`true`)return!0;if(e===`false`)return!1}function Oo(e){if(e==null||e===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function ko(e){let t=Oo(e);if(!(t==null||t<=0))return Math.min(2,Math.max(.75,t))}function Ao(e,t){for(let n of e)switch(n.type){case`Node`:{if(t.nodes.has(n.id)){t.diagnostics.push({severity:`error`,code:`FM101`,message:`Duplicate node id "${n.id}"`,range:n.range});break}let{defaults:e,isBuiltin:r}=Ui(n.kind);if(!r){let e=uo(n.kind);t.diagnostics.push({severity:`warning`,code:`FM102`,message:`Unknown node kind "${n.kind}" — using generic defaults`,range:n.range,hint:e?`Did you mean "${e}"?`:`See built-in kinds (service, database, event, process, …) or keep an open kind.`})}let i=La(n.kind,n.properties),a=i.columns??Gr(n.properties.columns),o=a.length>0,s=n.properties.shape==null?void 0:String(n.properties.shape),c=s?Mi(s):void 0;s&&!Ni(c)&&t.diagnostics.push({severity:`warning`,code:`FM111`,message:`Unknown shape "${s}" — rendering falls back to rounded unless a custom shape is registered`,range:n.range,hint:`Known shapes: rectangle, rounded, pill, diamond, hexagon, cylinder, queue, cloud, document, …`});let l=e.capabilities.includes(`erd-table`)||n.kind===`table`||n.kind===`entity`,u=c??(o&&l||i.forceTable?`table`:e.shape),d=[...po(n.properties),...n.styleRefs],f={...e.cssVars,...mo(n.properties)},p=o?Math.max(e.defaultMinWidth,200):e.defaultMinWidth,m=o?Math.max(e.defaultMaxWidth,360):e.defaultMaxWidth,h=n.properties.icon==null?void 0:String(n.properties.icon),g=h===`none`?void 0:h===void 0?u===`person`?void 0:e.icon:h,_=n.properties.iconPaint==null?void 0:String(n.properties.iconPaint).toLowerCase(),v=_===`theme`||_===`brand`?_:void 0,y=n.properties.iconColor!=null&&String(n.properties.iconColor).length>0?String(n.properties.iconColor):void 0,b=n.properties.side==null?void 0:String(n.properties.side).toLowerCase(),x=b===`west`||b===`east`||b===`north`||b===`south`?b:void 0;b&&!x&&t.diagnostics.push({severity:`warning`,code:`FM115`,message:`Unknown side "${b}" — use west, east, north, or south`,range:n.range,hint:`side is a surround layout hint for satellite nodes.`});let ee={...f,...y?{"--icon-color":y}:{}},te=t.groupStack.at(-1);t.nodes.set(n.id,{id:n.id,label:n.label??n.id,labelAuthored:n.label!=null,kind:n.kind,shape:u,icon:g,iconPaint:v,iconColor:y,side:x,groupId:te,styleRefs:d,unresolvedVars:Object.keys(ee).length?ee:void 0,note:n.properties.note==null?i.generatedNote:String(n.properties.note),showSubtitle:n.properties.subtitle===!0,subtitle:typeof n.properties.subtitle==`string`&&n.properties.subtitle.length>0?String(n.properties.subtitle):i.generatedSubtitle,technology:n.properties.technology!=null&&String(n.properties.technology).length>0?String(n.properties.technology):void 0,description:n.properties.description!=null&&String(n.properties.description).length>0?String(n.properties.description):i.generatedDescription,columns:o?a:void 0,data:i.data,minWidth:n.properties.minWidth??p,maxWidth:n.properties.maxWidth??m,depth:n.properties.depth??e.defaultDepth,scale:ko(n.properties.scale),sourceRange:n.range}),te&&t.groups.find(e=>e.id===te)?.members?.push({kind:`node`,id:n.id});break}case`Edge`:{t.edgeCounter++;let e=n.fromColumn??(n.properties.fromColumn==null?n.properties.fromCol==null?void 0:String(n.properties.fromCol):String(n.properties.fromColumn)),r=n.toColumn??(n.properties.toColumn==null?n.properties.toCol==null?void 0:String(n.properties.toCol):String(n.properties.toColumn)),i=Rr(n.properties.cardinality??n.properties.rel)??Rr(n.label),a=Pr(n.properties.branch)??(i&&zr(n.label)?void 0:Nr(n.label)),o=Do(n.properties.identifying),s=n.properties.icon==null?void 0:String(n.properties.icon),c=s&&s!==`none`?s:void 0,l=n.properties.iconPaint==null?void 0:String(n.properties.iconPaint).toLowerCase(),u=l===`theme`||l===`brand`?l:void 0,d=n.properties.iconColor!=null&&String(n.properties.iconColor).length>0?String(n.properties.iconColor):void 0,f=go(n.op),p=String(n.properties.arrows??``).toLowerCase(),m=p===`both`||p===`start`||p===`end`||p===`none`?p:_o(n.op);t.edges.push({id:`e${t.edgeCounter}`,from:f?n.to:n.from,to:f?n.from:n.to,fromColumn:f?r:e,toColumn:f?e:r,label:n.label,labelAuthored:n.label!=null,kind:ho(n.op),arrows:m,styleRefs:[...po(n.properties),...n.styleRefs],icon:c,iconPaint:u,iconColor:d,priority:vo(n.properties.priority),labelPosition:yo(n.properties.labelPosition??n.properties.labelAt),branch:a,cardinality:i,identifying:o??void 0,sourceRange:n.range});break}case`Group`:{let e=n.id??`group_${t.groups.length+1}`,r=Bo(n.statements);r.shapeDiagnostic&&t.diagnostics.push(r.shapeDiagnostic);let i=r.icon,a=i&&i!==`none`?i:void 0,o={id:e,label:n.label??e,labelAuthored:n.label!=null,kind:n.groupKind,parentId:t.groupStack.at(-1),nodeIds:[],childGroupIds:[],members:[],styleRefs:[],paddingHint:r.paddingHint,chrome:r.chrome,shape:r.shape,icon:a,iconPaint:r.iconPaint,iconColor:r.iconColor,arrange:r.arrange,align:r.align,gap:r.gap,columns:r.columns,rows:r.rows,column:r.column,row:r.row,span:r.span,colSpan:r.colSpan,rowSpan:r.rowSpan,cellArrange:r.cellArrange,dataStore:n.groupKind===`database`?Ra(n.statements):void 0};if(t.groupStack.length>0){let n=t.groups.find(e=>e.id===t.groupStack.at(-1));n?.childGroupIds.push(e),n?.members?.push({kind:`group`,id:e})}t.groups.push(o),t.groupStack.push(e),Ao(n.statements,t);for(let n of t.nodes.values())n.groupId===e&&!o.nodeIds.includes(n.id)&&o.nodeIds.push(n.id);o.arrange===`stack`&&o.childGroupIds.length===0&&o.cellArrange==null&&(o.cellArrange=`stack`,o.arrange=void 0),t.groupStack.pop();break}case`Style`:{let e={};for(let[t,r]of Object.entries(n.properties))e[t]=String(r);t.styles.push({name:n.name,target:n.target,properties:e});break}case`StyleRef`:{let e=t.styles.find(e=>e.name===n.styleName);for(let r of n.targetIds){let i=t.nodes.get(r);i?i.styleRefs.includes(n.styleName)||i.styleRefs.push(n.styleName):t.diagnostics.push({severity:`warning`,code:`FM105`,message:e?.target===`edge`?`Style "${n.styleName}" targets edges — use \`a -> b is ${n.styleName}\` or styles: […] on the edge`:`Style ref "${n.styleName}" references unknown node "${r}"`,range:n.range})}break}case`GroupMember`:{let e=t.groupStack.at(-1);if(!e)break;let r=t.groups.find(t=>t.id===e);for(let i of n.nodeIds){let a=t.nodes.get(i);a?(a.groupId=e,r&&!r.nodeIds.includes(i)&&r.nodeIds.push(i),r&&!r.members?.some(e=>e.kind===`node`&&e.id===i)&&r.members?.push({kind:`node`,id:i})):t.pendingGroupMembers.push({nodeId:i,groupId:e,range:n.range})}break}}}function jo(e){for(let t of e)if(t.type===`Directive`&&t.name===`padding`&&t.value!=null)return String(t.value)}function Mo(e){if(e===!0||e===`true`||e===`on`)return!0;if(e===!1||e===`false`||e===`none`||e===`off`)return!1}function No(e){if(e===`stack`||e===`row`||e===`grid`||e===`surround`)return e}function Po(e){if(e===`stretch`||e===`start`||e===`center`||e===`end`)return e}function Fo(e){if(e===`flow`||e===`pack`||e===`stack`)return e}function Io(e){if(typeof e==`number`&&Number.isFinite(e)&&e>=1)return Math.floor(e);if(typeof e==`string`){let t=Number(e);return Number.isFinite(t)&&t>=1?Math.floor(t):void 0}if(Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`string`))return e.map(String)}function Lo(e){if(typeof e==`number`&&Number.isFinite(e)&&e>=1)return Math.floor(e);if(typeof e==`string`){let t=Number(e);if(Number.isFinite(t)&&t>=1&&String(t)===e.trim())return Math.floor(t);if(e.trim())return e.trim()}}function Ro(e){let t=typeof e==`number`?e:Number(e);if(!(!Number.isFinite(t)||t<1))return Math.floor(t)}function zo(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim()){let t=Number(e);if(Number.isFinite(t))return t;let n=e.trim();return n===`compact`||n===`normal`||n===`spacious`?n:void 0}}function Bo(e){let t={paddingHint:jo(e)};for(let n of e)if(n.type===`Directive`&&n.value!=null)switch(n.name){case`chrome`:{let e=Mo(n.value);e!=null&&(t.chrome=e);break}case`shape`:{let e=String(n.value),r=Ii(e);Li(e)?t.shape=r:(t.shapeDiagnostic={severity:`warning`,code:`FM113`,message:`Unsupported group shape "${e}" — using rectangle chrome`,range:n.range,hint:`Group chrome shapes: rectangle, rounded, hexagon, circle, ellipse.`},t.shape=`rectangle`);break}case`icon`:t.icon=String(n.value);break;case`iconPaint`:{let e=String(n.value).toLowerCase();(e===`theme`||e===`brand`)&&(t.iconPaint=e);break}case`iconColor`:{let e=String(n.value).trim();e.length>0&&(t.iconColor=e);break}case`arrange`:{let e=No(n.value),r=Fo(n.value);e?t.arrange=e:r&&(t.cellArrange=r);break}case`align`:{let e=Po(n.value);e&&(t.align=e);break}case`gap`:{let e=zo(n.value);e!=null&&(t.gap=e);break}case`columns`:{let e=Io(n.value);e!=null&&(t.columns=e);break}case`rows`:{let e=Io(n.value);e!=null&&(t.rows=e);break}case`column`:{let e=Lo(n.value);e!=null&&(t.column=e);break}case`row`:{let e=Lo(n.value);e!=null&&(t.row=e);break}case`span`:{let e=Ro(n.value);e!=null&&(t.span=e);break}case`colSpan`:{let e=Ro(n.value);e!=null&&(t.colSpan=e);break}case`rowSpan`:{let e=Ro(n.value);e!=null&&(t.rowSpan=e);break}}return t}function Vo(e,t){let n=[];for(let r of xi)r in e&&n.push({severity:`warning`,code:`FM210`,message:`presentation.${r} was removed — SVG is chromeless by default; set title, legend, padding, groupAccent, etc. explicitly`,range:t,hint:r===`preset`?`Presets (document/slide/print/embed) no longer exist.`:`Drop ${r}; backgrounds, grids, and frames are not part of the SVG embed model.`});return n}function Ho(e){let t={},n={},r={},i=[],a=[];for(let o of e.statements){if(o.type===`Directive`&&(o.name===`direction`&&o.value&&(t.direction=Ji(String(o.value))),o.name===`density`&&o.value)){To(o.value)&&i.push({severity:`error`,code:`FM112`,message:`density "${String(o.value)}" is not supported`,range:o.range,hint:`Use density compact, normal, or spacious`});let e=wo(o.value);e&&(t.density=e)}if(o.type===`LayoutBlock`){if(o.properties.direction&&(t.direction=Ji(String(o.properties.direction))),o.properties.density){To(o.properties.density)&&i.push({severity:`error`,code:`FM112`,message:`density "${String(o.properties.density)}" is not supported`,range:o.range,hint:`Use density compact, normal, or spacious`});let e=wo(o.properties.density);e&&(t.density=e)}if(o.properties.spacingScale!=null){let e=Oo(o.properties.spacingScale);e!=null&&(t.spacingScale=e)}let e=bo(o.properties.groupLayout);e&&(t.groupLayout=e);let n=Co(o.properties.nodePlacement);n&&(t.nodePlacement=n);let r=Do(o.properties.considerModelOrder);r!=null&&(t.considerModelOrder=r);let a=Oo(o.properties.groupGap);a!=null&&(t.groupGap=a);let s=Oo(o.properties.edgeNodeSpacing);s!=null&&(t.edgeNodeSpacing=s);let c=Oo(o.properties.edgeEdgeSpacing);c!=null&&(t.edgeEdgeSpacing=c);let l=Oo(o.properties.edgeLabelSpacing);l!=null&&(t.edgeLabelSpacing=l);let u=No(o.properties.arrange);u&&(t.arrange=u);let d=Po(o.properties.align);d&&(t.align=d);let f=zo(o.properties.gap);f!=null&&(t.gap=f);let p=Io(o.properties.columns);p!=null&&(t.columns=p);let m=Io(o.properties.rows);m!=null&&(t.rows=m);let h=o.properties.edgeGap==null?``:String(o.properties.edgeGap);if(h===`tight`||h===`normal`||h===`wide`){let e={tight:{edgeNodeSpacing:28,edgeEdgeSpacing:14,edgeLabelSpacing:10},normal:{edgeNodeSpacing:36,edgeEdgeSpacing:28,edgeLabelSpacing:16},wide:{edgeNodeSpacing:72,edgeEdgeSpacing:56,edgeLabelSpacing:28}}[h];t.edgeNodeSpacing??=e.edgeNodeSpacing,t.edgeEdgeSpacing??=e.edgeEdgeSpacing,t.edgeLabelSpacing??=e.edgeLabelSpacing}}if(o.type===`EdgePolicyBlock`){if(o.properties.route&&(n.route=String(o.properties.route)),o.properties.crossings){let e=Eo(o.properties.crossings);e&&(n.crossings=e)}o.properties.cornerRadius!=null&&(n.cornerRadius=Number(o.properties.cornerRadius)),o.properties.parallel&&(n.parallel=String(o.properties.parallel)),o.properties.arrowheads!=null&&(n.arrowheads=o.properties.arrowheads!==!1)}if(o.type===`PresentationBlock`&&(i.push(...Vo(o.properties,o.range)),a.push(Ei(o.properties))),o.type===`RenderBlock`){o.properties.theme&&(r.theme=String(o.properties.theme)),o.properties.shadows!=null&&(r.shadows=o.properties.shadows!==!1),o.properties.roundedCorners!=null&&(r.roundedCorners=o.properties.roundedCorners!==!1);let e=o.properties.presentation;typeof e==`string`?i.push({severity:`warning`,code:`FM210`,message:`render.presentation: "${e}" presets were removed — SVG is chromeless by default`,range:o.range,hint:`Use presentation { title, padding, groupAccent, … } for opt-in chrome.`}):(i.push(...Vo(o.properties,o.range)),a.push(Ei(o.properties)))}}let o=ki(...a);return o&&(r.presentation=o),{layoutHints:t,routingHints:n,renderHints:r,diagnostics:i}}function Uo(e,t=0){let n=e.body[t];if(n?.type===`Sequence`)return ua(e,t);let r=[...e.diagnostics],i=n;if(!i||i.type!==`Diagram`)return r.push({severity:`error`,code:`FM100`,message:`No diagram found in document`,range:{start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}}}),{graph:{id:`empty`,nodes:[],edges:[],groups:[],styles:[],animations:[],diagnostics:r},layoutHints:{},routingHints:{},renderHints:{},diagnostics:r};let a=new Map,o=[],s=[],c=[],l=[];Ao(i.statements,{nodes:a,edges:o,groups:s,styles:c,diagnostics:r,groupStack:[],edgeCounter:0,pendingGroupMembers:l});for(let e of l){let t=a.get(e.nodeId),n=s.find(t=>t.id===e.groupId);t&&n?(t.groupId=e.groupId,n.nodeIds.includes(e.nodeId)||n.nodeIds.push(e.nodeId),n.members?.some(t=>t.kind===`node`&&t.id===e.nodeId)||n.members?.push({kind:`node`,id:e.nodeId})):r.push({severity:`warning`,code:`FM106`,message:`Group membership references unknown node "${e.nodeId}"`,range:e.range})}for(let e of o)a.has(e.from)||r.push({severity:`error`,code:`FM103`,message:`Edge references unknown node "${e.from}"`,range:e.sourceRange??i.range}),a.has(e.to)||r.push({severity:`error`,code:`FM104`,message:`Edge references unknown node "${e.to}"`,range:e.sourceRange??i.range});for(let e of s){if(e.arrange!==`surround`)continue;let t=e.childGroupIds.length;t===0?r.push({severity:`error`,code:`FM114`,message:`Group "${e.id}" uses arrange: surround but has no nested hub group`,range:i.range,hint:`Nest exactly one group as the center; place satellite nodes as siblings of that group.`}):t>1&&r.push({severity:`error`,code:`FM114`,message:`Group "${e.id}" uses arrange: surround with ${t} nested groups`,range:i.range,hint:`Surround allows exactly one nested hub group per parent; nest further surround layers inside that hub.`})}let u=o.length,d=[];for(let e of a.values())if(e.columns)for(let t of e.columns){let n=t.references;if(!n)continue;let o=Yr(n),s=a.get(n.table);if(!s)r.push({severity:`error`,code:`FM107`,message:`FK "${e.id}.${t.name}" references unknown table "${n.table}"`,range:e.sourceRange??i.range});else{for(let a of o)Kr(s.columns,a)<0&&s.columns?.length&&r.push({severity:`warning`,code:`FM108`,message:`FK "${e.id}.${t.name}" references unknown column "${n.table}.${a}"`,range:e.sourceRange??i.range});d.push({child:e,childCol:t,parentId:n.table,parentCols:o})}}let f=new Map;for(let e of d){let t=`${e.child.id}\0${e.parentId}`,n=f.get(t)??[];n.push(e),f.set(t,n)}let p=[];for(let e of f.values()){let t=e[0].parentId,n=e[0].child;if(new Set(e.flatMap(e=>e.parentCols)).size<=1)for(let r of e)p.push({parentId:t,child:n,links:[r]});else p.push({parentId:t,child:n,links:e})}for(let e of p){let t=Zr(e.links.map(e=>e.childCol),e.child.columns),n=[...new Set(e.links.flatMap(e=>e.parentCols))],r=e.links.map(e=>e.childCol.name),i=n[0],a=r[0],s=o.filter(t=>t.from===e.parentId&&t.to===e.child.id&&(t.fromColumn==null||n.includes(t.fromColumn))&&(t.toColumn==null||r.includes(t.toColumn)));if(s.length>0){for(let e of s)e.fromColumn??=i,e.toColumn??=a,e.cardinality??=t.cardinality,e.identifying??=t.identifying;continue}let c=o.find(t=>t.from===e.child.id&&t.to===e.parentId&&(t.fromColumn==null||r.includes(t.fromColumn))&&(t.toColumn==null||n.includes(t.toColumn)));c?(c.fromColumn??=a,c.toColumn??=i,c.cardinality??={from:t.cardinality.to,to:t.cardinality.from},c.identifying??=t.identifying):(u++,o.push({id:`e${u}`,from:e.parentId,to:e.child.id,fromColumn:i,toColumn:a,kind:`sync`,styleRefs:[],cardinality:t.cardinality,identifying:t.identifying,sourceRange:e.child.sourceRange}))}for(let e of o){let t=a.get(e.from),n=a.get(e.to);if(e.fromColumn&&t&&Kr(t.columns,e.fromColumn)<0&&r.push({severity:`warning`,code:`FM109`,message:`Edge column "${e.from}.${e.fromColumn}" not found on table`,range:e.sourceRange??i.range}),e.toColumn&&n&&Kr(n.columns,e.toColumn)<0&&r.push({severity:`warning`,code:`FM110`,message:`Edge column "${e.to}.${e.toColumn}" not found on table`,range:e.sourceRange??i.range}),!(e.fromColumn||e.toColumn)||t?.shape!==`table`||n?.shape!==`table`)continue;let o=n.columns?.some(t=>t.name===e.toColumn&&(t.keys.includes(`fk`)||!!t.references)),s=o?n:t,c=o?t:n,l=o?e.toColumn:e.fromColumn,u=Qr(s.columns,c.id,l),d=Zr(u,s.columns);!e.cardinality&&!Rr(e.label)&&(e.cardinality=o?d.cardinality:{from:d.cardinality.to,to:d.cardinality.from}),e.identifying??=u.length>0&&d.identifying}if(i.diagramKind===`state`){let e=[...a.values()].filter(e=>e.kind===`initial`),t=[...a.values()].filter(e=>e.kind===`final`);e.length!==1&&r.push({severity:e.length===0?`warning`:`error`,code:`FM150`,message:e.length===0?`State diagram has no initial pseudostate`:`State diagram must have exactly one initial pseudostate`,range:e[1]?.sourceRange??i.range,hint:'Declare one symbolic entry node, for example `entry: initial "Start"`.'}),t.length===0&&r.push({severity:`warning`,code:`FM151`,message:`State diagram has no final state`,range:i.range,hint:'Declare at least one terminal node, for example `done: final "Completed"`.'});for(let t of e){let e=o.filter(e=>e.to===t.id),n=o.filter(e=>e.from===t.id);e.length>0&&r.push({severity:`error`,code:`FM152`,message:`Initial pseudostate "${t.id}" cannot have incoming transitions`,range:e[0]?.sourceRange??t.sourceRange??i.range}),n.length!==1&&r.push({severity:`warning`,code:`FM153`,message:`Initial pseudostate "${t.id}" should have exactly one outgoing transition`,range:t.sourceRange??i.range})}for(let e of t){let t=o.find(t=>t.from===e.id);t&&r.push({severity:`error`,code:`FM154`,message:`Final state "${e.id}" cannot have outgoing transitions`,range:t.sourceRange??e.sourceRange??i.range})}}za({nodes:a,edges:o,groups:s,diagnostics:r});let m={id:i.name?i.name.toLowerCase().replace(/\s+/g,`-`):`diagram`,title:i.name,diagramKind:i.diagramKind,nodes:[...a.values()],edges:o,groups:s,styles:c,animations:vi(Wo(i.statements),a,r),diagnostics:r},h=Ho(i);r.push(...h.diagnostics);let{diagnostics:g,..._}=h;return _.layoutHints=i.diagramKind===`state`?{..._.layoutHints,direction:_.layoutHints.direction??`TD`}:So(s,_.layoutHints),{graph:m,..._,diagnostics:r}}function Wo(e){let t=[];for(let n of e)n.type===`AnimationBlock`&&t.push(n),n.type===`Group`&&t.push(...Wo(n.statements));return t}function Go(e){let t=[];return e.body.forEach((e,n)=>{if(e.type===`Diagram`)t.push({kind:(e.diagramKind,`diagram`),index:n,title:e.name});else if(e.type===`Sequence`)t.push({kind:`sequence`,index:n,title:e.name});else if(e.type===`Model`)for(let r of e.views)t.push({kind:`model-view`,index:n,modelName:e.name,viewName:r.name,title:r.name})}),t}function Ko(e,t){return e.views.find(e=>e.name===t)}function qo(e){return e.views.find(e=>e.name==="default")??e.views.find(e=>e.name===`main`)??e.views[0]}function I(e){return typeof e==`number`?{diagramIndex:e}:{diagramIndex:e?.diagramIndex??0,view:e?.view}}function L(e){return e}function Jo(e){let t=[],n=[];for(let r of e)r.type===`Include`&&t.push(...r.selectors),r.type===`Exclude`&&n.push(...r.selectors);return{includes:t,excludes:n}}function Yo(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop(),i=t.find(t=>t.id===e);if(i){for(let e of i.nodeIds)n.add(e);for(let e of i.childGroupIds)r.push(e)}}return n}function Xo(e,t,n){if(e===`*`)return!0;if(e.endsWith(`.*`)){let r=e.slice(0,-2);return t===r||t.startsWith(`${r}.`)?!0:Yo(r,n).has(t)}return n.some(t=>t.id===e)&&Yo(e,n).has(t)||t===e}function Zo(e,t,n,r){let i;if(n.length===0)i=new Set(e);else{i=new Set;for(let r of e)n.some(e=>Xo(e,r,t))&&i.add(r)}for(let e of i)r.some(n=>Xo(n,e,t))&&i.delete(e);return i}function Qo(e,t){let n=e.map(e=>{let n=e.nodeIds.filter(e=>t.has(e));return{...e,nodeIds:n,childGroupIds:[...e.childGroupIds]}}),r=new Map(n.map(e=>[e.id,e])),i=new Set;for(let e of n)e.nodeIds.length>0&&i.add(e.id);let a=!0;for(;a;){a=!1;for(let e of n){if(!i.has(e.id)||!e.parentId||i.has(e.parentId))continue;let t=r.get(e.parentId);t&&(t.arrange!=null||t.columns!=null||t.rows!=null)&&(i.add(t.id),a=!0)}}let o=!0;for(;o;){o=!1;for(let e of n){if(!i.has(e.id))continue;let t=e.childGroupIds.filter(e=>i.has(e));e.nodeIds.length===0&&t.length===0&&(i.delete(e.id),o=!0)}}return n.filter(e=>i.has(e.id)).map(e=>{let t=e.childGroupIds.filter(e=>i.has(e)),n=[...e.nodeIds.map(e=>({kind:`node`,id:e})),...t.map(e=>({kind:`group`,id:e}))];return{...e,childGroupIds:t,members:n}})}function $o(e,t,n){if(e===`*`||n.some(t=>t.id===e))return!0;if(e.endsWith(`.*`)){let r=e.slice(0,-2);return!!(n.some(e=>e.id===r)||t.some(e=>e===r||e.startsWith(`${r}.`)))}return t.includes(e)}function es(e,t,n,r){for(let i of e){if(i.type!==`Include`&&i.type!==`Exclude`)continue;let e=i.type===`Include`?`include`:`exclude`;for(let a of i.selectors)$o(a,t,n)||r.push({severity:`warning`,code:`FM233`,message:`${e} selector "${a}" matches no nodes or groups`,range:i.range,hint:"Use a bare id, a group id, `prefix.*`, or `*`."})}}function ts(e,t,n){let r=[...e.diagnostics],{includes:i,excludes:a}=Jo(t),o=e.nodes.map(e=>e.id);es(t,o,e.groups,r);let s=Zo(o,e.groups,i,a),c=e.nodes.filter(e=>s.has(e.id)),l=new Set(c.map(e=>e.id)),u=[],d=new Set;for(let t of e.edges){if(!l.has(t.from)||!l.has(t.to)||t.from===t.to)continue;let e=`${t.from}|${t.to}|${t.label??``}|${t.kind}`;d.has(e)||(d.add(e),u.push(t))}let f=Qo(e.groups,l);return{id:`${n.modelId}-${R(n.viewName)}`,title:n.viewName,diagramKind:e.diagramKind,nodes:c,edges:u,groups:f,styles:e.styles,diagnostics:r,view:{name:n.viewName,modelId:n.modelId,modelTitle:n.modelTitle}}}function R(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`view`}function ns(e){return{id:e.id,title:e.title,diagramKind:e.diagramKind===`state`?`state`:`flow`,nodes:e.nodes,edges:e.edges,groups:e.groups,styles:e.styles,diagnostics:e.diagnostics}}function rs(e){return e.type===`Include`||e.type===`Exclude`}function is(e){return e.filter(e=>!rs(e))}function as(e,t,n,r){let i=[...e.diagnostics],a=new Map(e.nodes.map(e=>[e.id,e])),o={id:e.id,title:e.title,diagramKind:e.diagramKind,nodes:e.nodes,edges:e.edges,groups:e.groups,styles:e.styles,animations:vi(Wo(t),a,i),diagnostics:i,view:e.view?{...e.view,modelTitle:e.view.modelTitle??r}:void 0},s=Ho(n);i.push(...s.diagnostics),o.diagnostics=i;let{diagnostics:c,...l}=s;return l.layoutHints=e.diagramKind===`state`?{...l.layoutHints,direction:l.layoutHints.direction??`TD`}:So(e.groups,l.layoutHints),L({graph:o,...l,diagnostics:i})}function os(e,t,n){let r=[...n],i=e.name?.toLowerCase().replace(/\s+/g,`-`)??`model`;if(e.views.length===0)return Uo({type:`Document`,version:2,body:[{type:`Diagram`,diagramKind:`flow`,name:e.name,statements:e.statements,range:e.range}],diagnostics:r},0);let a=(t?Ko(e,t):void 0)??(t?void 0:qo(e));if(!a){let n=e.views.map(e=>e.name).join(`, `);return r.push({severity:`error`,code:`FM228`,message:t?`View "${t}" was not found in model "${e.name??i}"`:`Model has views but no view was selected`,range:e.range,hint:n?`Available views: ${n}`:"Add a `view` block or omit views for a full render."}),ss(r)}let o=is(a.statements),s=ns(Uo({type:`Document`,version:2,body:[{type:`Diagram`,diagramKind:`flow`,name:e.name,statements:[...e.statements,...o],range:e.range}],diagnostics:[]},0).graph);s.diagnostics=[...r,...s.diagnostics];let c=ts(s,a.statements,{viewName:a.name,modelId:i,modelTitle:e.name,range:a.range}),l=o;return as(c,l,{type:`Diagram`,diagramKind:`flow`,name:a.name,statements:l,range:a.range},e.name)}function ss(e){return{graph:{id:`empty`,nodes:[],edges:[],groups:[],styles:[],animations:[],diagnostics:e},layoutHints:{},routingHints:{},renderHints:{},diagnostics:e}}function cs(e,t=0){let{diagramIndex:n,view:r}=I(t),i=e.body[n];return i?.type===`Model`?os(i,r,e.diagnostics):r?ss([...e.diagnostics,{severity:`error`,code:`FM227`,message:`--view requires a model block at index ${n}`,range:i?.range??{start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}},hint:"Use --view with `kdiagram 2` model files or omit --view for standalone diagrams."}]):i?.type===`Sequence`?ua(e,n):Uo(e,n)}function ls(e,t=0){return cs(e,t)}var z=` `;function B(e){let t=di(e);return t.diagnostics.some(e=>e.severity===`error`)?e.trimEnd()+`
|
|
24
|
+
`:us(t)}function us(e){let t=[];return e.version!=null&&t.push(`kdiagram ${e.version}`),t.push(...e.body.map(ds)),t.join(`
|
|
25
|
+
|
|
26
|
+
`)+`
|
|
27
|
+
`}function ds(e){return e.type===`Sequence`?_s(e):e.type===`Model`?fs(e):ms(e)}function fs(e){let t=[e.name==null?`model {`:`model "${e.name}" {`];for(let n of e.statements)ys(n,1,t);for(let n of e.views){(e.statements.length>0||e.views.indexOf(n)>0)&&t.push(``),t.push(`${z}view ${n.name} {`);for(let e of n.statements)ps(e,2,t);t.push(`${z}}`)}return t.push(`}`),t.join(`
|
|
28
|
+
`)}function ps(e,t,n){let r=z.repeat(t);switch(e.type){case`Include`:n.push(`${r}include ${e.selectors.join(`, `)}`);break;case`Exclude`:n.push(`${r}exclude ${e.selectors.join(`, `)}`);break;default:ys(e,t,n)}}function ms(e){let t=e.diagramKind===`state`?`state`:`diagram`,n=[e.name==null?`${t} {`:`${t} "${e.name}" {`],r=e.statements.filter(hs),i=e.statements.filter(e=>!hs(e));for(let e of r)ys(e,1,n);r.length>0&&i.length>0&&n.push(``);let a;for(let t of i){let r=a!=null&&e.statements.indexOf(t)===e.statements.indexOf(a)+1;a&&r&&js(a,t)&&n.push(``),ys(t,1,n),a=t}return n.push(`}`),n.join(`
|
|
29
|
+
`)}function hs(e){return gs(e)<1/0}function gs(e){return e.type===`Directive`&&e.name===`direction`?0:e.type===`Directive`&&e.name===`density`?1:e.type===`LayoutBlock`?2:e.type===`EdgePolicyBlock`?3:e.type===`RenderBlock`?4:e.type===`PresentationBlock`?5:1/0}function _s(e){let t=[e.name==null?`sequence {`:`sequence "${e.name}" {`];return As(e.statements,t,e=>vs(e,1,t)),t.push(`}`),t.join(`
|
|
30
|
+
`)}function vs(e,t,n){let r=z.repeat(t);switch(e.type){case`SequenceActivate`:n.push(`${r}activate ${e.participantId}`);break;case`SequenceDeactivate`:n.push(`${r}deactivate ${e.participantId}`);break;case`SequenceCreate`:{let i=e.node,a=i.styleRefs.map(e=>` is ${e}`).join(``);Ts(`${r}create ${i.id}: ${i.kind}${i.label?` "${i.label}"`:``}${a}`,i.properties,t,n);break}case`SequenceDestroy`:n.push(`${r}destroy ${e.participantId}`);break;case`SequenceNote`:{let t=e.participantIds.join(`, `),i=e.placement===`over`?`over ${t}`:e.placement===`left`?`left of ${t}`:`right of ${t}`;n.push(`${r}note ${i} "${e.text}"`);break}case`SequenceDivider`:n.push(e.label?`${r}divider "${e.label}"`:`${r}divider`);break;case`SequenceAutonumber`:n.push(`${r}autonumber`);break;case`SequenceFragment`:{let i=e.label?` "${e.label}"`:``;for(let a=0;a<e.operands.length;a++){let o=e.operands[a],s=`${a===0?e.operator:e.operator===`parallel`?`and`:`else`}${a===0?i:o.label?` "${o.label}"`:``}${o.styleRefs.map(e=>` is ${e}`).join(``)} {`;a===0?n.push(`${r}${s}`):n[n.length-1]===`${r}}`?n[n.length-1]=`${r}} ${s}`:n.push(`${r}${s}`),As(o.statements,n,e=>vs(e,t+1,n)),n.push(`${r}}`)}break}default:ys(e,t,n)}}function ys(e,t,n){let r=z.repeat(t);switch(e.type){case`Directive`:n.push(`${r}${bs(e)}`);break;case`Node`:{let i=e.styleRefs.map(e=>` is ${e}`).join(``);Ts(`${r}${e.id}: ${e.kind}${e.label?` "${e.label}"`:``}${i}`,e.properties,t,n);break}case`Edge`:{let i=e.fromColumn?`${e.from}.${e.fromColumn}`:e.from,a=e.toColumn?`${e.to}.${e.toColumn}`:e.to,o=e.label?` ${si(e.label)}`:``,s=e.styleRefs.map(e=>` is ${e}`).join(``);Ts(`${r}${i} ${e.op} ${a}${o}`,e.properties,t,n,s);break}case`Group`:Os(e,t,n);break;case`Style`:{let i=e.target===`edge`?` for edge`:e.target===`fragment`?` for fragment`:``;ks(`${r}style ${e.name}${i}`,e.properties,t,n);break}case`StyleRef`:n.push(`${r}${e.targetIds.join(`, `)} is ${e.styleName}`);break;case`GroupMember`:n.push(`${r}${e.nodeIds.join(`, `)}`);break;case`LayoutBlock`:ks(`${r}layout`,e.properties,t,n);break;case`EdgePolicyBlock`:ks(`${r}edges`,e.properties,t,n);break;case`RenderBlock`:ks(`${r}render`,e.properties,t,n);break;case`PresentationBlock`:ks(`${r}presentation`,e.properties,t,n);break;case`AnimationBlock`:n.push(`${r}animation "${e.name}" {`),As(e.cues,n,e=>{for(let t of xs(e))n.push(t?`${r}${z}${t}`:``)}),n.push(`${r}}`)}}function bs(e){let t=Array.isArray(e.value)?e.value.join(`, `):e.value??``;return e.name===`direction`||e.name===`density`?`${e.name} ${t}`:`${e.name}: ${Ms(e.value??``)}`}function xs(e){if(e.type===`parallel`){let t=[`parallel {`],n;for(let r of e.cues){n&&js(n,r)&&t.push(``);for(let e of xs(r))t.push(e?`${z}${e}`:``);n=r}return t.push(`}`),t}return[Ss(e)]}function Ss(e){switch(e.type){case`loop`:return`loop`;case`wait`:return`wait ${ws(e.durationMs)}`;case`dim`:case`activate`:return`${e.type} ${e.targets.map(Cs).join(`, `)}`;case`pulse`:{let t=e.durationMs==null?``:` for ${ws(e.durationMs)}`;return`pulse ${e.targets.map(Cs).join(`, `)}${t}`}case`flow`:{let t=e.durationMs==null?``:` for ${ws(e.durationMs)}`;return`flow ${e.path.join(` -> `)}${t}`}case`parallel`:return`parallel { … }`}}function Cs(e){return e.type===`all`?`*`:e.type===`node`?e.id:`${e.from} -> ${e.to}`}function ws(e){return e>=1e3&&e%100==0?`${e/1e3}s`:`${e}ms`}function Ts(e,t,n,r,i=``){let a=z.repeat(n),o=Object.entries(t);if(o.length===0){r.push(`${e}${i}`);return}let s=o.some(([,e])=>typeof e==`string`&&e.includes(`
|
|
31
|
+
`));if(o.length===1&&!s&&o[0][0]!==`columns`&&o[0][0]!==`fields`){let[t,n]=o[0];r.push(`${e} { ${t}: ${Ms(n)} }${i}`)}else{r.push(`${e} {`);for(let[e,t]of o)if(e===`columns`&&Array.isArray(t)){r.push(`${a}${z}columns {`);for(let e of t){let t=Wr(String(e)),n=t?$r(t):String(e);r.push(`${a}${z}${z}${n}`)}r.push(`${a}${z}}`)}else e===`fields`&&Array.isArray(t)?(r.push(`${a}${z}fields {`),Es(t.map(String),n+2,r),r.push(`${a}${z}}`)):r.push(`${a}${z}${e}: ${Ms(t)}`);r.push(`${a}}${i}`)}}function Es(e,t,n){Ds(e,t,n,0,0)}function Ds(e,t,n,r,i){let a=r;for(;a<e.length;){let r=da(e[a]??``);if(r<i)return a;if(r>i){a+=1;continue}let o=fa(e[a]??``),s=o?ma(o):(e[a]??``).replace(/^>+/,``),c=z.repeat(t);a+1<e.length&&da(e[a+1]??``)>r?(n.push(`${c}${s} {`),a=Ds(e,t+1,n,a+1,i+1),n.push(`${c}}`)):(n.push(`${c}${s}`),a+=1)}return a}function Os(e,t,n){let r=z.repeat(t),i=e.id?`${e.id} `:``,a=e.label==null?``:`"${e.label}" `;n.push(`${r}${e.groupKind} ${i}${a}{`),As(e.statements,n,e=>ys(e,t+1,n)),n.push(`${r}}`)}function ks(e,t,n,r){let i=Object.entries(t);if(i.length===0){r.push(`${e} {}`);return}if(i.length===1){let[t,n]=i[0];r.push(`${e} { ${t}: ${Ms(n)} }`);return}let a=z.repeat(n);r.push(`${e} {`);for(let[e,t]of i)r.push(`${a}${z}${e}: ${Ms(t)}`);r.push(`${a}}`)}function As(e,t,n){let r;for(let i of e)r&&js(r,i)&&t.push(``),n(i),r=i}function js(e,t){return t.range.start.line>e.range.end.line+1}function Ms(e){return Array.isArray(e)?`[${e.map(e=>`"${e}"`).join(`, `)}]`:typeof e==`string`?/^[A-Za-z_][A-Za-z0-9_-]*$/.test(e)?e:(e.includes(`
|
|
32
|
+
`)||e.includes(`"`))&&!e.includes(`"""`)?e.includes(`
|
|
33
|
+
`)?`"""\n${e.replace(/^\n+/,``).replace(/\n[ \t]*$/,``)}\n"""`:`"""${e}"""`:JSON.stringify(e):String(e)}var Ns={fromAttribute:e=>e!==`false`,toAttribute:e=>e?``:`false`};function Ps(){return typeof document>`u`?`dark`:document.documentElement.dataset.theme===`light`?`light`:`dark`}function Fs(e){return e===`auto`?Ps():e}function Is(e){return e>=100?`${Math.round(e)}ms`:`${e.toFixed(1)}ms`}function Ls(e){return typeof e==`number`?`${e}px`:e}var Rs=2400,zs=400,Bs=class extends jr{constructor(...e){super(...e),this.source=``,this.theme=`auto`,this.height=420,this.frameless=!1,this.showThemeToggle=!0,this.showViewControls=!0,this.showStats=!1,this.showAnimationControls=!0,this.autoplay=!1,this.animationLoop=!1,this.animation=``,this.view=``,this.showViewSwitcher=!0,this.#e=null,this.#t=[],this.#n=0,this.#r=null,this.#i=null,this.#a=`dark`,this.#o=!1,this.#s=!1,this.#c=null,this.#l=null,this.#u=!1,this.#d=!0,this.#f=null,this.#p=[],this.#m={id:null,playing:!1,timeMs:0,durationMs:0,loop:!1,speed:1},this.#h=null,this.#g=()=>{this.#u=document.fullscreenElement!=null&&document.fullscreenElement===this,this.requestUpdate(),requestAnimationFrame(()=>{requestAnimationFrame(()=>this.#e?.fit())})},this.#E=e=>{if(!this.showAnimationControls||this.#p.length===0)return;let t=this.#e?.animations;t&&(e.key===` `||e.code===`Space`?(e.preventDefault(),this.#m.playing?t.pause():t.play()):e.key===`ArrowRight`?(e.preventDefault(),t.step(1)):e.key===`ArrowLeft`&&(e.preventDefault(),t.step(-1)))},this.#A=()=>{this.#k()},this.#j=()=>{this.#O(zs)},this.#M=e=>{this.#k(e.target!==e.currentTarget)},this.#N=()=>{queueMicrotask(()=>{let e=this.renderRoot,t=e instanceof ShadowRoot?e.activeElement:null;t instanceof Element&&t.closest(`.overlay`)||this.#O(zs)})},this.#P=e=>{this.#k(e.target!==e.currentTarget),this.#E(e)},this.#F=e=>{if(this.#k(),e.composedPath().some(e=>e instanceof Element&&(e.classList.contains(`overlay--animation`)||e.classList.contains(`overlay--tools`)||e.classList.contains(`overlay--stats`))))return;let t=this.renderRoot,n=t instanceof ShadowRoot?t.activeElement:null;n instanceof HTMLElement&&n.blur();let r=e.currentTarget;r instanceof HTMLElement&&r.focus({preventScroll:!0})}}static{this.properties={source:{type:String},theme:{type:String},height:{},frameless:{type:Boolean,converter:Ns,reflect:!0},showThemeToggle:{type:Boolean,attribute:`show-theme-toggle`,converter:Ns},showViewControls:{type:Boolean,attribute:`show-view-controls`,converter:Ns},showStats:{type:Boolean,attribute:`show-stats`,converter:Ns},showAnimationControls:{type:Boolean,attribute:`animation-controls`,converter:Ns},autoplay:{type:Boolean,converter:Ns},animationLoop:{type:Boolean,attribute:`loop`,converter:Ns},animation:{type:String},view:{type:String,reflect:!0},showViewSwitcher:{type:Boolean,attribute:`show-view-switcher`,converter:Ns},options:{attribute:!1}}}static{this.styles=En`
|
|
34
|
+
:host {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
position: relative;
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
border: 1px solid var(--border, color-mix(in oklch, currentColor 18%, transparent));
|
|
43
|
+
background: var(--kd-bg, var(--bg-panel, var(--bg, transparent)));
|
|
44
|
+
color: var(--text, inherit);
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
font-family: var(--font-ui, inherit);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([hidden]) {
|
|
50
|
+
display: none !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host(:fullscreen) {
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100% !important;
|
|
56
|
+
background: var(--kd-bg, var(--bg, #0b0f14));
|
|
57
|
+
border: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([frameless]:not([frameless="false"]):not(:fullscreen)) {
|
|
61
|
+
border: 0;
|
|
62
|
+
background: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([frameless]:not([frameless="false"]):not(:fullscreen)) .viewport {
|
|
66
|
+
background: transparent;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.sr-only {
|
|
70
|
+
position: absolute;
|
|
71
|
+
width: 1px;
|
|
72
|
+
height: 1px;
|
|
73
|
+
padding: 0;
|
|
74
|
+
margin: -1px;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
clip: rect(0, 0, 0, 0);
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
border: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.error {
|
|
82
|
+
margin: 0;
|
|
83
|
+
padding: 0.55rem 0.75rem;
|
|
84
|
+
border-bottom: 1px solid
|
|
85
|
+
var(--border-soft, color-mix(in oklch, currentColor 12%, transparent));
|
|
86
|
+
color: var(--danger, #f87171);
|
|
87
|
+
font-size: 0.85rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.stage {
|
|
91
|
+
position: relative;
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
flex: 1 1 0;
|
|
95
|
+
min-height: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.stage:focus {
|
|
101
|
+
outline: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.viewport {
|
|
105
|
+
position: relative;
|
|
106
|
+
flex: 1 1 0;
|
|
107
|
+
width: 100%;
|
|
108
|
+
min-height: 0;
|
|
109
|
+
background: var(--kd-bg, var(--bg, transparent));
|
|
110
|
+
z-index: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.viewport .kdiagram-viewport,
|
|
114
|
+
.viewport .kdiagram-canvas,
|
|
115
|
+
.viewport svg {
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
display: block;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.overlay {
|
|
122
|
+
position: absolute;
|
|
123
|
+
z-index: 2;
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: 0.35rem;
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
opacity: 1;
|
|
129
|
+
transform: translateY(0);
|
|
130
|
+
transition:
|
|
131
|
+
opacity 180ms ease,
|
|
132
|
+
transform 180ms ease;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.overlay > * {
|
|
136
|
+
pointer-events: auto;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.stage[data-controls-visible="false"] .overlay {
|
|
140
|
+
opacity: 0;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.stage[data-controls-visible="false"] .overlay > * {
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.stage[data-controls-visible="false"] .overlay--tools {
|
|
149
|
+
transform: translateY(-4px);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.stage[data-controls-visible="false"] .overlay--animation,
|
|
153
|
+
.stage[data-controls-visible="false"] .overlay--stats {
|
|
154
|
+
transform: translateY(4px);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.overlay--tools {
|
|
158
|
+
top: 0.55rem;
|
|
159
|
+
right: 0.55rem;
|
|
160
|
+
padding: 0.15rem;
|
|
161
|
+
border: 1px solid var(--border-soft, color-mix(in oklch, currentColor 12%, transparent));
|
|
162
|
+
background: color-mix(in oklch, var(--bg-elevated, var(--bg, #111)) 92%, transparent);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.overlay--stats {
|
|
166
|
+
left: 0.55rem;
|
|
167
|
+
bottom: 0.55rem;
|
|
168
|
+
padding: 0.2rem 0.45rem;
|
|
169
|
+
border: 1px solid var(--border-soft, color-mix(in oklch, currentColor 12%, transparent));
|
|
170
|
+
background: color-mix(in oklch, var(--bg-elevated, var(--bg, #111)) 88%, transparent);
|
|
171
|
+
color: var(--text-muted, color-mix(in oklch, currentColor 70%, transparent));
|
|
172
|
+
font-size: 0.68rem;
|
|
173
|
+
font-variant-numeric: tabular-nums;
|
|
174
|
+
gap: 0.55rem;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.tools {
|
|
178
|
+
display: inline-flex;
|
|
179
|
+
gap: 0.25rem;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.icon-btn {
|
|
183
|
+
appearance: none;
|
|
184
|
+
display: inline-flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
width: 1.85rem;
|
|
188
|
+
height: 1.85rem;
|
|
189
|
+
padding: 0;
|
|
190
|
+
border: 1px solid transparent;
|
|
191
|
+
background: transparent;
|
|
192
|
+
color: var(--text-muted, color-mix(in oklch, currentColor 70%, transparent));
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
flex: 0 0 auto;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.icon-btn:hover {
|
|
198
|
+
color: var(--text, inherit);
|
|
199
|
+
border-color: var(--border, color-mix(in oklch, currentColor 18%, transparent));
|
|
200
|
+
background: color-mix(in oklch, var(--bg-elevated, currentColor) 8%, transparent);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.icon-btn:focus-visible {
|
|
204
|
+
color: var(--text, inherit);
|
|
205
|
+
outline: none;
|
|
206
|
+
border-color: var(--accent, #5b9fd4);
|
|
207
|
+
box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent, #5b9fd4) 55%, transparent);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.icon-btn svg {
|
|
211
|
+
width: 16px;
|
|
212
|
+
height: 16px;
|
|
213
|
+
display: block;
|
|
214
|
+
flex: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.overlay--animation {
|
|
218
|
+
left: 0.55rem;
|
|
219
|
+
right: 0.55rem;
|
|
220
|
+
bottom: 0.55rem;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.anim-bar {
|
|
225
|
+
display: inline-flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
gap: 0.25rem;
|
|
228
|
+
max-width: min(44rem, 100%);
|
|
229
|
+
padding: 0.3rem 0.45rem;
|
|
230
|
+
border: 1px solid var(--border-soft, color-mix(in oklch, currentColor 12%, transparent));
|
|
231
|
+
background: color-mix(in oklch, var(--bg-elevated, var(--bg, #111)) 92%, transparent);
|
|
232
|
+
color: var(--text, inherit);
|
|
233
|
+
font-size: 0.72rem;
|
|
234
|
+
font-variant-numeric: tabular-nums;
|
|
235
|
+
border-radius: 0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.anim-select {
|
|
239
|
+
position: relative;
|
|
240
|
+
display: inline-flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
gap: 0.28rem;
|
|
243
|
+
height: 1.85rem;
|
|
244
|
+
min-width: 0;
|
|
245
|
+
max-width: 12rem;
|
|
246
|
+
padding: 0 1.25rem 0 0.4rem;
|
|
247
|
+
border: 1px solid transparent;
|
|
248
|
+
border-radius: 0;
|
|
249
|
+
background: transparent;
|
|
250
|
+
color: var(--text-muted, color-mix(in oklch, currentColor 78%, transparent));
|
|
251
|
+
flex: 0 1 auto;
|
|
252
|
+
box-sizing: border-box;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.anim-select--speed {
|
|
256
|
+
max-width: 4.75rem;
|
|
257
|
+
padding-left: 0.4rem;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.model-view-select {
|
|
261
|
+
max-width: 10rem;
|
|
262
|
+
margin-right: 0.15rem;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.anim-select:hover {
|
|
266
|
+
color: var(--text, inherit);
|
|
267
|
+
border-color: var(--border, color-mix(in oklch, currentColor 18%, transparent));
|
|
268
|
+
background: color-mix(in oklch, var(--bg-elevated, currentColor) 8%, transparent);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* Keyboard focus only — mouse/open must not stack a second system ring. */
|
|
272
|
+
.anim-select:has(select:focus-visible) {
|
|
273
|
+
color: var(--text, inherit);
|
|
274
|
+
border-color: var(--accent, #5b9fd4);
|
|
275
|
+
background: color-mix(in oklch, var(--bg-elevated, currentColor) 8%, transparent);
|
|
276
|
+
outline: none;
|
|
277
|
+
box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent, #5b9fd4) 55%, transparent);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.anim-select__glyph {
|
|
281
|
+
display: inline-flex;
|
|
282
|
+
flex: 0 0 auto;
|
|
283
|
+
opacity: 0.8;
|
|
284
|
+
pointer-events: none;
|
|
285
|
+
color: inherit;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.anim-select__glyph svg {
|
|
289
|
+
width: 14px;
|
|
290
|
+
height: 14px;
|
|
291
|
+
display: block;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.anim-select select {
|
|
295
|
+
appearance: none;
|
|
296
|
+
-webkit-appearance: none;
|
|
297
|
+
-moz-appearance: none;
|
|
298
|
+
border: 0;
|
|
299
|
+
background: transparent;
|
|
300
|
+
color: inherit;
|
|
301
|
+
font: inherit;
|
|
302
|
+
font-size: inherit;
|
|
303
|
+
line-height: 1.2;
|
|
304
|
+
padding: 0;
|
|
305
|
+
margin: 0;
|
|
306
|
+
min-width: 0;
|
|
307
|
+
max-width: 100%;
|
|
308
|
+
flex: 1 1 auto;
|
|
309
|
+
cursor: pointer;
|
|
310
|
+
outline: none;
|
|
311
|
+
box-shadow: none;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.anim-select select:focus,
|
|
315
|
+
.anim-select select:focus-visible,
|
|
316
|
+
.anim-select select:active {
|
|
317
|
+
outline: none;
|
|
318
|
+
outline-offset: 0;
|
|
319
|
+
box-shadow: none;
|
|
320
|
+
border: 0;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.anim-select select::-moz-focus-inner {
|
|
324
|
+
border: 0;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.anim-select__caret {
|
|
328
|
+
position: absolute;
|
|
329
|
+
right: 0.3rem;
|
|
330
|
+
top: 50%;
|
|
331
|
+
transform: translateY(-50%);
|
|
332
|
+
display: inline-flex;
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
opacity: 0.75;
|
|
335
|
+
color: inherit;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.anim-select__caret svg {
|
|
339
|
+
width: 12px;
|
|
340
|
+
height: 12px;
|
|
341
|
+
display: block;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.anim-scrub {
|
|
345
|
+
-webkit-appearance: none;
|
|
346
|
+
appearance: none;
|
|
347
|
+
width: min(14rem, 32vw);
|
|
348
|
+
height: 1.85rem;
|
|
349
|
+
margin: 0 0.25rem;
|
|
350
|
+
background: transparent;
|
|
351
|
+
cursor: pointer;
|
|
352
|
+
flex: 1 1 auto;
|
|
353
|
+
min-width: 6rem;
|
|
354
|
+
border-radius: 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.anim-scrub:focus {
|
|
358
|
+
outline: none;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.anim-scrub:focus-visible {
|
|
362
|
+
box-shadow: 0 0 0 1px var(--accent, #5b9fd4);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.anim-scrub::-webkit-slider-runnable-track {
|
|
366
|
+
height: 6px;
|
|
367
|
+
border-radius: 0;
|
|
368
|
+
background: color-mix(in oklch, var(--text, currentColor) 16%, transparent);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.anim-scrub::-webkit-slider-thumb {
|
|
372
|
+
-webkit-appearance: none;
|
|
373
|
+
appearance: none;
|
|
374
|
+
width: 12px;
|
|
375
|
+
height: 12px;
|
|
376
|
+
margin-top: -3px;
|
|
377
|
+
border-radius: 0;
|
|
378
|
+
border: 2px solid var(--bg-elevated, var(--bg, #111));
|
|
379
|
+
background: var(--accent, #b38eee);
|
|
380
|
+
box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent, #b38eee) 55%, transparent);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.anim-scrub::-moz-range-track {
|
|
384
|
+
height: 6px;
|
|
385
|
+
border-radius: 0;
|
|
386
|
+
background: color-mix(in oklch, var(--text, currentColor) 16%, transparent);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.anim-scrub::-moz-range-thumb {
|
|
390
|
+
width: 12px;
|
|
391
|
+
height: 12px;
|
|
392
|
+
border-radius: 0;
|
|
393
|
+
border: 2px solid var(--bg-elevated, var(--bg, #111));
|
|
394
|
+
background: var(--accent, #b38eee);
|
|
395
|
+
box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent, #b38eee) 55%, transparent);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.anim-time {
|
|
399
|
+
color: var(--text-muted, color-mix(in oklch, currentColor 70%, transparent));
|
|
400
|
+
min-width: 4.5rem;
|
|
401
|
+
text-align: center;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.icon-btn.is-pressed,
|
|
405
|
+
.icon-btn[aria-pressed="true"] {
|
|
406
|
+
color: var(--accent-contrast, #0b0f14);
|
|
407
|
+
background: var(--accent, #b38eee);
|
|
408
|
+
border-color: var(--accent, #b38eee);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.icon-btn.is-pressed:hover,
|
|
412
|
+
.icon-btn[aria-pressed="true"]:hover {
|
|
413
|
+
color: var(--accent-contrast, #0b0f14);
|
|
414
|
+
background: color-mix(in oklch, var(--accent, #b38eee) 85%, white);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
@media (prefers-reduced-motion: reduce) {
|
|
418
|
+
.overlay {
|
|
419
|
+
transition: none;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
`}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;connectedCallback(){super.connectedCallback(),this.#_(),document.addEventListener(`fullscreenchange`,this.#g),this.#I(),this.hasUpdated&&this.#z()}disconnectedCallback(){document.removeEventListener(`fullscreenchange`,this.#g),this.#i?.disconnect(),this.#i=null,this.#D(),this.#R(),super.disconnectedCallback()}firstUpdated(){this.#b(),this.#k(),this.#z()}updated(e){e.has(`height`)&&(this.#_(),this.#o&&requestAnimationFrame(()=>this.#e?.fit())),e.has(`theme`)&&(this.#I(),this.#B()),(e.has(`source`)||e.has(`options`))&&this.#o&&(e.has(`source`)&&this.#b(),this.#V()),e.has(`view`)&&this.#o&&(this.#V(),this.#y(this.view||void 0)),this.#o&&(e.has(`autoplay`)||e.has(`animationLoop`)||e.has(`animation`)||e.has(`showAnimationControls`))&&this.#T()}#_(){this.style.height=Ls(this.height)}async ready(){if(await this.updateComplete,this.#e||await this.#z(),!this.#e)throw Error(this.#c??`k-diagram failed to mount`);await this.#e.ready()}fit(){this.#e?.fit()}zoomIn(){this.#e?.zoomIn()}zoomOut(){this.#e?.zoomOut()}resetView(){this.#e?.resetView()}get animations(){return this.#e?.animations}async refreshTheme(){if(!this.#o||!this.#e)return;let e=Fs(this.theme===`auto`?`auto`:this.theme);this.#a=e,this.#r=e;let t=await this.#e.setTheme(e);this.#l=t.stats,this.#v(t),this.requestUpdate(),requestAnimationFrame(()=>this.#e?.fit())}#v(e){this.dispatchEvent(new CustomEvent(`kdiagram-render`,{detail:e,bubbles:!0,composed:!0}))}#y(e){this.dispatchEvent(new CustomEvent(`kdiagram-view-change`,{detail:{view:e},bubbles:!0,composed:!0}))}#b(){let e=di(this.source);this.#t=Go(e).filter(e=>e.kind===`model-view`&&e.viewName).map(e=>({viewName:e.viewName,title:e.title??e.viewName})),this.#t.length>0&&this.view&&!this.#t.some(e=>e.viewName===this.view)&&(this.view=this.#t[0].viewName)}#x(){let e=this.options?.view??this.view;return e?{...this.options,view:e}:{...this.options}}#S(e){let t=e.target.value;this.view=t}#C(){return this.showViewSwitcher&&this.#t.length>1}#w(e){this.#h?.(),this.#p=e.animations.list();let t=0,n=``;this.#h=e.animations.subscribe(r=>{this.#m=r,this.#p=e.animations.list(),this.dispatchEvent(new CustomEvent(`kdiagram-animation-timeupdate`,{detail:r,bubbles:!0,composed:!0}));let i=`${r.id}|${r.playing}|${r.loop}|${r.speed}|${r.durationMs}`,a=performance.now();(i!==n||!r.playing||a-t>50)&&(n=i,t=a,this.requestUpdate())}),this.#T()}#T(){let e=this.#e?.animations;if(!e)return;this.#p=e.list(),this.animationLoop&&e.setLoop(!0);let t=(this.animation??``).trim();if(t){let n=this.#p.find(e=>e.id===t||e.name.toLowerCase()===t.toLowerCase());n&&this.#m.id!==n.id&&(e.play(n.id),this.autoplay||e.pause(),this.dispatchEvent(new CustomEvent(`kdiagram-animation-change`,{detail:{id:n.id},bubbles:!0,composed:!0})))}this.autoplay&&this.#p.length>0&&e.play(this.#m.id??this.#p[0].id)}#E;#D(){this.#f!=null&&(clearTimeout(this.#f),this.#f=null)}#O(e=Rs){this.#D(),this.#f=setTimeout(()=>{this.#f=null;let e=this.renderRoot,t=e instanceof ShadowRoot?e.activeElement:null;t instanceof Element&&t.closest(`.overlay`)||(this.#d=!1,this.requestUpdate())},e)}#k(e=!1){this.#d||(this.#d=!0,this.requestUpdate()),this.#D(),e||this.#O()}#A;#j;#M;#N;#P;#F;#I(){this.#i?.disconnect(),this.#i=null,this.theme===`auto`?(this.#a=Ps(),this.#i=new MutationObserver(()=>{let e=Ps();e!==this.#a&&(this.#a=e,this.#B(),this.requestUpdate())}),this.#i.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})):this.#a=Fs(this.theme)}#L(){return this.renderRoot.querySelector(`.viewport`)}#R(){this.#h?.(),this.#h=null,this.#p=[],this.#n+=1,this.#e?.destroy(),this.#e=null,this.#o=!1,this.#r=null}async#z(){if(!this.#L()||!this.isConnected)return;let e=++this.#n;this.#h?.(),this.#h=null,this.#e?.destroy(),this.#e=null,this.#o=!1,this.#r=null;try{let{KDiagram:t}=await pn(async()=>{let{KDiagram:e}=await import(`./dist-gV3Je5I4.js`);return{KDiagram:e}},[],import.meta.url);try{await t.ensureFonts()}catch{}if(e!==this.#n||!this.isConnected)return;let n=this.#L();if(!n)return;n.replaceChildren();let r=this.source,i=Fs(this.theme===`auto`?`auto`:this.theme);this.#a=i;let a=t.renderToElement(r,n,{...this.#x(),theme:i});if(e!==this.#n){a.destroy();return}this.#e=a;let o=await a.ready();if(e!==this.#n)return;this.#r=i,this.#l=o.stats,this.#o=!0,this.#c=o.ok?null:o.diagnostics[0]?.message??`Render failed`,this.#w(a),this.#v(o),this.requestUpdate(),requestAnimationFrame(()=>a.fit())}catch(t){if(e!==this.#n)return;this.#c=t instanceof Error?t.message:String(t),this.requestUpdate()}}async#B(){if(!this.#o||!this.#e)return;let e=Fs(this.theme===`auto`?`auto`:this.theme);if(this.#a=e,this.#r===e){this.requestUpdate();return}this.#r=e;let t=await this.#e.setTheme(e);this.#l=t.stats,this.#v(t),this.requestUpdate(),requestAnimationFrame(()=>this.#e?.fit())}async#V(){let e=this.#e;if(this.#o&&e){this.#s=!0,this.requestUpdate();try{let t=await e.update(this.source,this.#x());this.#l=t.stats,this.#c=t.ok?null:t.diagnostics[0]?.message??`Update failed`,this.#p=e.animations.list(),this.#T(),this.#v(t),requestAnimationFrame(()=>e.fit())}catch(e){this.#c=e instanceof Error?e.message:String(e)}finally{this.#s=!1,this.requestUpdate()}}}async#H(){try{document.fullscreenElement?await document.exitFullscreen():await this.requestFullscreen()}catch{}}#U(){this.theme=this.#a===`dark`?`light`:`dark`}#W(e,t=16){return fr`
|
|
423
|
+
<svg
|
|
424
|
+
width=${t}
|
|
425
|
+
height=${t}
|
|
426
|
+
viewBox="0 0 24 24"
|
|
427
|
+
fill="none"
|
|
428
|
+
stroke="currentColor"
|
|
429
|
+
stroke-width="1.75"
|
|
430
|
+
stroke-linecap="round"
|
|
431
|
+
stroke-linejoin="round"
|
|
432
|
+
aria-hidden="true"
|
|
433
|
+
>
|
|
434
|
+
${e}
|
|
435
|
+
</svg>
|
|
436
|
+
`}render(){let e=this.#s?`Updating…`:this.options?.zoomOnWheel===`always`?`Drag to pan / scroll to zoom`:`Drag to pan / Ctrl or ⌘ plus scroll to zoom`,t=this.showThemeToggle||this.showViewControls||this.#C(),n=this.#C(),r=this.showStats&&this.#l,i=this.showAnimationControls&&this.#p.length>0&&this.#e!=null,a=Math.max(this.#m.durationMs,1),o=`${Vs(this.#m.timeMs)} / ${Vs(this.#m.durationMs)}`;return fr`
|
|
437
|
+
<span class="sr-only">Live diagram. ${e}.</span>
|
|
438
|
+
${this.#c?fr`<p class="error" role="status">${this.#c}</p>`:j}
|
|
439
|
+
<div
|
|
440
|
+
class="stage"
|
|
441
|
+
data-controls-visible=${String(this.#d)}
|
|
442
|
+
tabindex="0"
|
|
443
|
+
@keydown=${this.#P}
|
|
444
|
+
@pointerdown=${this.#F}
|
|
445
|
+
@pointermove=${this.#A}
|
|
446
|
+
@pointerenter=${this.#A}
|
|
447
|
+
@pointerleave=${this.#j}
|
|
448
|
+
@focusin=${this.#M}
|
|
449
|
+
@focusout=${this.#N}
|
|
450
|
+
>
|
|
451
|
+
<div class="viewport" data-theme=${this.#a}></div>
|
|
452
|
+
${r&&this.#l?fr`
|
|
453
|
+
<div
|
|
454
|
+
class="overlay overlay--stats"
|
|
455
|
+
aria-label="${this.#l.layoutAlgorithm} / ${this.#l.routerAlgorithm}"
|
|
456
|
+
>
|
|
457
|
+
<span>${this.#l.nodeCount}n</span>
|
|
458
|
+
<span>${this.#l.edgeCount}e</span>
|
|
459
|
+
<span>${Is(this.#l.totalMs)}</span>
|
|
460
|
+
</div>
|
|
461
|
+
`:j}
|
|
462
|
+
${i?fr`
|
|
463
|
+
<div
|
|
464
|
+
class="overlay overlay--animation"
|
|
465
|
+
role="toolbar"
|
|
466
|
+
aria-label="Animation controls"
|
|
467
|
+
>
|
|
468
|
+
<div class="anim-bar">
|
|
469
|
+
${this.#p.length>1?fr`
|
|
470
|
+
<label class="anim-select">
|
|
471
|
+
<span class="anim-select__glyph" aria-hidden="true">
|
|
472
|
+
${this.#W([pr`<path d="M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z"></path>`,pr`<path d="m6.2 5.3 3.1 3.9"></path>`,pr`<path d="m12.4 3.4 3.1 4"></path>`,pr`<path d="M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"></path>`],14)}
|
|
473
|
+
</span>
|
|
474
|
+
<select
|
|
475
|
+
aria-label="Animation"
|
|
476
|
+
@change=${e=>{let t=e.target.value;this.#e?.animations.play(t),this.dispatchEvent(new CustomEvent(`kdiagram-animation-change`,{detail:{id:t},bubbles:!0,composed:!0}))}}
|
|
477
|
+
>
|
|
478
|
+
${this.#p.map(e=>fr`
|
|
479
|
+
<option
|
|
480
|
+
value=${e.id}
|
|
481
|
+
?selected=${e.id===(this.#m.id??this.#p[0]?.id)}
|
|
482
|
+
>
|
|
483
|
+
${e.name}
|
|
484
|
+
</option>
|
|
485
|
+
`)}
|
|
486
|
+
</select>
|
|
487
|
+
<span class="anim-select__caret" aria-hidden="true">
|
|
488
|
+
${this.#W(pr`<path d="M6 9l6 6 6-6"></path>`,12)}
|
|
489
|
+
</span>
|
|
490
|
+
</label>
|
|
491
|
+
`:j}
|
|
492
|
+
<button
|
|
493
|
+
type="button"
|
|
494
|
+
class="icon-btn"
|
|
495
|
+
aria-label="Previous step"
|
|
496
|
+
@click=${()=>this.#e?.animations.step(-1)}
|
|
497
|
+
>
|
|
498
|
+
${this.#W(pr`<path d="M15 18l-6-6 6-6"></path>`)}
|
|
499
|
+
</button>
|
|
500
|
+
<button
|
|
501
|
+
type="button"
|
|
502
|
+
class="icon-btn"
|
|
503
|
+
aria-label=${this.#m.playing?`Pause`:`Play`}
|
|
504
|
+
@click=${()=>{this.#m.playing?this.#e?.animations.pause():this.#e?.animations.play()}}
|
|
505
|
+
>
|
|
506
|
+
${this.#m.playing?this.#W(pr`<path d="M6 4h4v16H6zM14 4h4v16h-4z" fill="currentColor" stroke="none"></path>`):this.#W(pr`<path d="M8 5v14l11-7z" fill="currentColor" stroke="none"></path>`)}
|
|
507
|
+
</button>
|
|
508
|
+
<button
|
|
509
|
+
type="button"
|
|
510
|
+
class="icon-btn"
|
|
511
|
+
aria-label="Next step"
|
|
512
|
+
@click=${()=>this.#e?.animations.step(1)}
|
|
513
|
+
>
|
|
514
|
+
${this.#W(pr`<path d="M9 18l6-6-6-6"></path>`)}
|
|
515
|
+
</button>
|
|
516
|
+
<input
|
|
517
|
+
class="anim-scrub"
|
|
518
|
+
type="range"
|
|
519
|
+
min="0"
|
|
520
|
+
max=${a}
|
|
521
|
+
step="16"
|
|
522
|
+
.value=${String(this.#m.timeMs)}
|
|
523
|
+
aria-label="Scrub animation"
|
|
524
|
+
@input=${e=>{let t=Number(e.target.value);this.#e?.animations.seek(t)}}
|
|
525
|
+
/>
|
|
526
|
+
<span class="anim-time">${o}</span>
|
|
527
|
+
<label class="anim-select anim-select--speed">
|
|
528
|
+
<select
|
|
529
|
+
aria-label="Playback speed"
|
|
530
|
+
@change=${e=>{let t=Number(e.target.value);this.#e?.animations.setSpeed(t)}}
|
|
531
|
+
>
|
|
532
|
+
${Hs.map(e=>{let t=Us(e);return fr`
|
|
533
|
+
<option
|
|
534
|
+
value=${t}
|
|
535
|
+
?selected=${t===Us(this.#m.speed)}
|
|
536
|
+
>
|
|
537
|
+
${Ws(e)}
|
|
538
|
+
</option>
|
|
539
|
+
`})}
|
|
540
|
+
</select>
|
|
541
|
+
<span class="anim-select__caret" aria-hidden="true">
|
|
542
|
+
${this.#W(pr`<path d="M6 9l6 6 6-6"></path>`,12)}
|
|
543
|
+
</span>
|
|
544
|
+
</label>
|
|
545
|
+
<button
|
|
546
|
+
type="button"
|
|
547
|
+
class="icon-btn ${this.#m.loop?`is-pressed`:``}"
|
|
548
|
+
aria-label=${this.#m.loop?`Loop on`:`Loop off`}
|
|
549
|
+
aria-pressed=${this.#m.loop?`true`:`false`}
|
|
550
|
+
title=${this.#m.loop?`Loop on`:`Loop off`}
|
|
551
|
+
@click=${()=>this.#e?.animations.setLoop(!this.#m.loop)}
|
|
552
|
+
>
|
|
553
|
+
${this.#W(pr`<path d="M17 1l4 4-4 4M3 11V9a4 4 0 0 1 4-4h14M7 23l-4-4 4-4M21 13v2a4 4 0 0 1-4 4H3"></path>`)}
|
|
554
|
+
</button>
|
|
555
|
+
</div>
|
|
556
|
+
</div>
|
|
557
|
+
`:j}
|
|
558
|
+
${t?fr`
|
|
559
|
+
<div class="overlay overlay--tools" role="toolbar" aria-label="Diagram controls">
|
|
560
|
+
${n?fr`
|
|
561
|
+
<label class="anim-select model-view-select">
|
|
562
|
+
<span class="sr-only">Model view</span>
|
|
563
|
+
<select
|
|
564
|
+
aria-label="Model view"
|
|
565
|
+
.value=${this.view||this.#t[0]?.viewName||``}
|
|
566
|
+
@change=${this.#S}
|
|
567
|
+
>
|
|
568
|
+
${this.#t.map(e=>fr`
|
|
569
|
+
<option value=${e.viewName}>${e.title}</option>
|
|
570
|
+
`)}
|
|
571
|
+
</select>
|
|
572
|
+
<span class="anim-select__caret" aria-hidden="true">
|
|
573
|
+
${this.#W(pr`<path d="M6 9l6 6 6-6"></path>`,12)}
|
|
574
|
+
</span>
|
|
575
|
+
</label>
|
|
576
|
+
`:j}
|
|
577
|
+
${this.showViewControls?fr`
|
|
578
|
+
<div class="tools" role="group" aria-label="View">
|
|
579
|
+
<button
|
|
580
|
+
type="button"
|
|
581
|
+
class="icon-btn"
|
|
582
|
+
aria-label="Zoom out"
|
|
583
|
+
@click=${()=>this.zoomOut()}
|
|
584
|
+
>
|
|
585
|
+
${this.#W(pr`<path d="M5 12h14"></path>`)}
|
|
586
|
+
</button>
|
|
587
|
+
<button
|
|
588
|
+
type="button"
|
|
589
|
+
class="icon-btn"
|
|
590
|
+
aria-label="Zoom in"
|
|
591
|
+
@click=${()=>this.zoomIn()}
|
|
592
|
+
>
|
|
593
|
+
${this.#W(pr`<path d="M12 5v14M5 12h14"></path>`)}
|
|
594
|
+
</button>
|
|
595
|
+
<button
|
|
596
|
+
type="button"
|
|
597
|
+
class="icon-btn"
|
|
598
|
+
aria-label="Fit to view"
|
|
599
|
+
@click=${()=>this.fit()}
|
|
600
|
+
>
|
|
601
|
+
${this.#W(pr`<path d="M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"></path>`)}
|
|
602
|
+
</button>
|
|
603
|
+
<button
|
|
604
|
+
type="button"
|
|
605
|
+
class="icon-btn"
|
|
606
|
+
aria-label=${this.#u?`Exit fullscreen`:`Fullscreen`}
|
|
607
|
+
@click=${()=>void this.#H()}
|
|
608
|
+
>
|
|
609
|
+
${this.#u?this.#W(pr`<path d="M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7"></path>`):this.#W(pr`<path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"></path>`)}
|
|
610
|
+
</button>
|
|
611
|
+
</div>
|
|
612
|
+
`:j}
|
|
613
|
+
${this.showThemeToggle?fr`
|
|
614
|
+
<button
|
|
615
|
+
type="button"
|
|
616
|
+
class="icon-btn"
|
|
617
|
+
aria-label=${this.#a===`dark`?`Switch to light theme`:`Switch to dark theme`}
|
|
618
|
+
@click=${()=>this.#U()}
|
|
619
|
+
>
|
|
620
|
+
${this.#a===`dark`?this.#W([pr`<circle cx="12" cy="12" r="4"></circle>`,pr`<path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"></path>`]):this.#W(pr`<path d="M21 14.5A8.5 8.5 0 1 1 9.5 3a7 7 0 0 0 11.5 11.5z"></path>`)}
|
|
621
|
+
</button>
|
|
622
|
+
`:j}
|
|
623
|
+
</div>
|
|
624
|
+
`:j}
|
|
625
|
+
</div>
|
|
626
|
+
`}};function Vs(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}var Hs=[.5,.75,1,1.25,1.5,2];function Us(e){let t=Hs.find(t=>Math.abs(t-e)<.01)??Hs.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t);return String(t)}function Ws(e){return`${e}×`}var Gs=`k-diagram`;function Ks(){customElements.get(`k-diagram`)||customElements.define(Gs,Bs)}Ks();var qs=yn({react:u,tagName:Gs,elementClass:Bs,events:{onKDiagramRender:`kdiagram-render`,onKDiagramViewChange:`kdiagram-view-change`}}),Js=u.forwardRef(function({className:e,...t},n){return(0,A.jsx)(qs,{ref:n,className:[`kd-live`,e].filter(Boolean).join(` `),...t})}),Ys={connected:!1,documents:[],capabilities:{write:!1,export:!0},presentation:{theme:`dark`,options:{theme:`dark`}},viewport:{zoom:1,x:0,y:0}};function Xs(e,t){switch(t.type){case`ready`:return{...e,connected:!0,sessionId:t.sessionId,documents:t.documents,activeDocumentId:t.activeDocumentId,capabilities:t.capabilities,presentation:t.presentation,error:void 0};case`document`:{let n=e.documents.some(e=>e.id===t.id)?e.documents.map(e=>e.id===t.id?Zs(t):e):[...e.documents,Zs(t)];return{...e,documents:n,activeDocumentId:t.id,error:void 0}}case`render`:return t.documentId!==e.activeDocumentId||e.render&&t.revision<e.render.revision?e:{...e,render:t};case`selection`:return{...e,selection:t.selection};case`viewport`:return{...e,viewport:t.viewport};case`presentation`:return{...e,presentation:t.presentation};case`saved`:return e;case`error`:return{...e,error:{code:t.code,message:t.message}}}}function Zs(e){return{id:e.id,path:e.path,label:e.label,revision:e.revision,source:e.source,activeView:e.activeView,compileTargets:e.compileTargets}}var Qs={tight:{edgeNodeSpacing:28,edgeEdgeSpacing:14,edgeLabelSpacing:10},normal:{edgeNodeSpacing:36,edgeEdgeSpacing:28,edgeLabelSpacing:16},wide:{edgeNodeSpacing:72,edgeEdgeSpacing:56,edgeLabelSpacing:28}};function $s(e,t=e.theme){let n={};e.spacingScale!=null&&(n.spacingScale=e.spacingScale),e.density&&(n.density=e.density),e.direction&&(n.direction=e.direction),e.nodePlacement&&(n.nodePlacement=e.nodePlacement),e.groupLayout&&(n.groupLayout=e.groupLayout),e.modelOrder===`on`&&(n.considerModelOrder=!0),e.modelOrder===`off`&&(n.considerModelOrder=!1),e.groupGap&&(n.groupGap=Number(e.groupGap)),e.edgeGaps&&Object.assign(n,Qs[e.edgeGaps]);let r={};return e.edgeStyle&&(r.route=e.edgeStyle),e.crossings&&(r.crossings=e.crossings),{theme:t,layout:n,edges:r,...e.roundedCorners?{roundedCorners:!0}:{},debug:{showPorts:e.showPorts,showBounds:e.showBounds}}}var ec={theme:`dark`,direction:``,density:``,groupLayout:``,edgeStyle:``,crossings:``};function tc(e){let t=ic(e);if(!t)return{...ec};let n={...ec};for(let e of t.statements)if(e.type===`Directive`&&e.name===`direction`)n.direction=vc(String(e.value??``),[`LR`,`RL`,`TD`,`BT`]);else if(e.type===`Directive`&&e.name===`density`)n.density=vc(String(e.value??``),[`compact`,`normal`,`spacious`]);else if(e.type===`LayoutBlock`){let t=mc(e.properties,`direction`),r=mc(e.properties,`density`);t&&(n.direction=vc(t,[`LR`,`RL`,`TD`,`BT`])),r&&(n.density=vc(r,[`compact`,`normal`,`spacious`]));let i=mc(e.properties,`groupLayout`);i&&(n.groupLayout=vc(i,[`auto`,`compound`,`flat`,`swimlane`]))}else if(e.type===`EdgePolicyBlock`){let t=mc(e.properties,`route`),r=mc(e.properties,`crossings`);t&&(n.edgeStyle=vc(t,[`metro`,`rounded`,`orthogonal`,`straight`,`bezier`])),r&&(n.crossings=vc(r,[`jumps`,`smart`,`gaps`,`none`]))}else e.type===`RenderBlock`&&(n.theme=vc(String(e.properties.theme??`dark`),[`dark`,`light`])||`dark`);return n}function nc(e,t,n){let r=ic(e);if(!r)return e;if(t===`direction`||t===`density`){let i=r.statements.find(e=>e.type===`LayoutBlock`);if(n&&i?.properties[t]!=null)return oc(e,r,`LayoutBlock`,`layout`,t,n);let a=ac(e,r,t,n);if(n)return a;let o=ic(a);return o?oc(a,o,`LayoutBlock`,`layout`,t,``):a}return t===`groupLayout`?oc(e,r,`LayoutBlock`,`layout`,`groupLayout`,n):t===`theme`?oc(e,r,`RenderBlock`,`render`,`theme`,n):oc(e,r,`EdgePolicyBlock`,`edges`,t===`edgeStyle`?`route`:`crossings`,n)}function rc(e){return Object.keys(ec).reduce((e,t)=>nc(e,t,``),e)}function ic(e){let t=di(e).body[0];return t?.type===`Diagram`?t:null}function ac(e,t,n,r){let i=t.statements.find(e=>e.type===`Directive`&&e.name===n);return i?r?pc(e,i.range.start.offset,i.range.end.offset,`${n} ${r}`):dc(e,t,i):r?cc(e,t,`${n} ${r}`,lc(n)):e}function oc(e,t,n,r,i,a){let o=t.statements.find(e=>e.type===n);if(!o)return a?cc(e,t,sc(r,{[i]:a}),lc(r)):e;let s=e.slice(o.range.start.offset,o.range.end.offset),c=s.indexOf(`{`),l=s.lastIndexOf(`}`);if(!s.slice(c+1,l).includes(`
|
|
627
|
+
`)){let n={...o.properties};return a?n[i]=a:delete n[i],Object.keys(n).length===0?dc(e,t,o):pc(e,o.range.start.offset,o.range.end.offset,sc(r,n))}let u=RegExp(`^([\\t ]*${_c(i)}[\\t ]*:[\\t ]*)(.*?)([\\t ]*//.*)?$`,`m`),d=u.exec(s);if(d){let n=a?s.replace(u,`$1${a}$3`):gc(s,d.index,d[0].length);return n.slice(n.indexOf(`{`)+1,n.lastIndexOf(`}`)).trim()?pc(e,o.range.start.offset,o.range.end.offset,n):dc(e,t,o)}if(!a)return e;let f=`${fc(e,o.range.start.offset)} ${i}: ${a}\n`,p=`${s.slice(0,l)}${f}${s.slice(l)}`;return pc(e,o.range.start.offset,o.range.end.offset,p)}function sc(e,t,n=``){return`${e} {\n${Object.entries(t).map(([e,t])=>`${n} ${e}: ${hc(t)}`).join(`
|
|
628
|
+
`)}\n${n}}`}function cc(e,t,n,r){let i=`${fc(e,t.range.start.offset)} `,a=n.split(`
|
|
629
|
+
`).map(e=>`${i}${e}`).join(`
|
|
630
|
+
`),o=t.statements.find(e=>lc(e)>r);if(o){let t=e.lastIndexOf(`
|
|
631
|
+
`,o.range.start.offset-1)+1,n=lc(o)===1/0;return`${e.slice(0,t)}${a}\n${n?`
|
|
632
|
+
`:``}${e.slice(t)}`}let s=e.lastIndexOf(`}`,t.range.end.offset);return s<0?e:`${e.slice(0,s)}${a}\n${e.slice(s)}`}function lc(e){let t=typeof e==`string`?e:e.type===`Directive`?e.name:e.type===`LayoutBlock`?`layout`:e.type===`EdgePolicyBlock`?`edges`:e.type===`RenderBlock`?`render`:e.type===`PresentationBlock`?`presentation`:`content`,n=[`direction`,`density`,`layout`,`edges`,`render`,`presentation`];return n.indexOf(t)===-1?1/0:n.indexOf(t)}function uc(e,t){let n=e.lastIndexOf(`
|
|
633
|
+
`,t.range.start.offset-1)+1,r=e.indexOf(`
|
|
634
|
+
`,t.range.end.offset);return pc(e,n,r<0?t.range.end.offset:r+1,``)}function dc(e,t,n){let r=uc(e,n);if(t.statements.some(e=>e!==n&&lc(e)<1/0))return r;let i=ic(r)?.statements[0];if(!i)return r;let a=r.lastIndexOf(`
|
|
635
|
+
`,i.range.start.offset-1)+1,o=r.slice(0,a);return o.endsWith(`
|
|
636
|
+
|
|
637
|
+
`)?`${o.slice(0,-1)}${r.slice(a)}`:r}function fc(e,t){let n=e.lastIndexOf(`
|
|
638
|
+
`,t-1)+1;return/^\s*/.exec(e.slice(n,t))?.[0]??``}function pc(e,t,n,r){return`${e.slice(0,t)}${r}${e.slice(n)}`}function mc(e,t){let n=e[t];return typeof n==`string`?n:``}function hc(e){return Array.isArray(e)?`[${e.join(`, `)}]`:String(e)}function gc(e,t,n){let r=e.lastIndexOf(`
|
|
639
|
+
`,t-1)+1,i=e.indexOf(`
|
|
640
|
+
`,t+n),a=i<0?t+n:i+1;return`${e.slice(0,r)}${e.slice(a)}`}function _c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function vc(e,t){return t.includes(e)?e:``}var yc={theme:`dark`,direction:``,density:``,spacingScale:null,nodePlacement:``,groupLayout:``,modelOrder:``,groupGap:``,edgeGaps:``,edgeStyle:``,crossings:``,roundedCorners:!1,showPorts:!1,showBounds:!1},bc={tight:{edgeNodeSpacing:28,edgeEdgeSpacing:14,edgeLabelSpacing:10},normal:{edgeNodeSpacing:36,edgeEdgeSpacing:28,edgeLabelSpacing:16},wide:{edgeNodeSpacing:72,edgeEdgeSpacing:56,edgeLabelSpacing:28}};function xc(e,t=e.theme){let n={};e.spacingScale!=null&&(n.spacingScale=e.spacingScale),e.density&&(n.density=e.density),e.direction&&(n.direction=e.direction),e.nodePlacement&&(n.nodePlacement=e.nodePlacement),e.groupLayout&&(n.groupLayout=e.groupLayout),e.modelOrder===`on`&&(n.considerModelOrder=!0),e.modelOrder===`off`&&(n.considerModelOrder=!1),e.groupGap&&(n.groupGap=Number(e.groupGap)),e.edgeGaps&&Object.assign(n,bc[e.edgeGaps]);let r={};return e.edgeStyle&&(r.route=e.edgeStyle),e.crossings&&(r.crossings=e.crossings),{theme:t,layout:n,edges:r,...e.roundedCorners?{roundedCorners:!0}:{},debug:{showPorts:e.showPorts,showBounds:e.showBounds}}}var Sc={"--kd-bg":`#070b12`,"--kd-surface":`#10161f`,"--kd-surface-2":`#171e29`,"--kd-surface-3":`#222a36`,"--kd-text":`#e8ebf1`,"--kd-muted":`#9099a5`,"--kd-border":`#343e4a`,"--kd-edge":`#7e8792`,"--kd-edge-label-bg":`#151c26`,"--kd-edge-label-text":`#e8ebf1`,"--kd-edge-label-stroke":`#3d4754`,"--kd-accent":`#b38eee`,"--kd-danger":`#f07f77`,"--kd-danger-fill":`#2a1214`,"--kd-warning":`#ecae62`,"--kd-success":`#61c594`,"--kd-choice":`#a3a0d8`,"--kd-user-fill":`#16122a`,"--kd-user-stroke":`#b38eee`,"--kd-service-fill":`#141222`,"--kd-service-stroke":`#b38eee`,"--kd-system-fill":`#17102e`,"--kd-system-stroke":`#c2a9ee`,"--kd-container-fill":`#141222`,"--kd-container-stroke":`#b38eee`,"--kd-component-fill":`#161822`,"--kd-component-stroke":`#9a8fb8`,"--kd-data-fill":`#0a1a20`,"--kd-data-stroke":`#5bbdda`,"--kd-table-fill":`#10161f`,"--kd-table-header-fill":`#171e29`,"--kd-table-title":`#e8ebf1`,"--kd-table-zebra":`rgba(144, 153, 165, 0.06)`,"--kd-table-badge-pk-fill":`#b38eee`,"--kd-table-badge-fk-fill":`#6b5f9a`,"--kd-table-badge-uk-fill":`#2f7a62`,"--kd-table-badge-text":`#e8ebf1`,"--kd-choice-fill":`#1a1b2c`,"--kd-choice-stroke":`#a3a0d8`,"--kd-success-fill":`#0a2015`,"--kd-success-stroke":`#61c594`,"--kd-on-success":`#61c594`,"--kd-warning-fill":`#271e0a`,"--kd-warning-stroke":`#ecae62`,"--kd-on-warning":`#ecae62`,"--kd-on-danger":`#f07f77`,"--kd-on-muted":`#e8ebf1`,"--kd-event-fill":`#101e17`,"--kd-async-stroke":`#61c594`,"--kd-external-fill":`#111418`,"--kd-external-stroke":`#9099a5`,"--kd-group-fill":`rgba(179, 142, 238, 0.1)`,"--kd-group-stroke":`rgba(179, 142, 238, 0.42)`,"--kd-node-fill":`var(--kd-surface)`,"--kd-node-stroke":`var(--kd-border)`,"--kd-node-shadow":`rgba(2, 6, 12, 0.45)`,"--kd-node-glow":`rgba(179, 142, 238, 0.14)`,"--kd-edge-yes":`var(--kd-success)`,"--kd-edge-no":`var(--kd-danger)`,"--kd-edge-yes-label-bg":`#0f5138`,"--kd-edge-yes-label-text":`#ecfdf5`,"--kd-edge-no-label-bg":`#8f2a2a`,"--kd-edge-no-label-text":`#fef2f2`,"--kd-port-fill":`var(--kd-bg)`,"--kd-port-stroke":`var(--kd-accent)`,"--kd-sequence-lifeline":`color-mix(in srgb, var(--kd-edge) 38%, transparent)`,"--kd-sequence-activation-fill":`color-mix(in srgb, var(--kd-accent) 24%, var(--kd-surface))`,"--kd-sequence-activation-stroke":`color-mix(in srgb, var(--kd-accent) 62%, var(--kd-edge))`,"--kd-sequence-fragment-fill":`rgba(179, 142, 238, 0.05)`,"--kd-sequence-fragment-stroke":`rgba(179, 142, 238, 0.38)`,"--kd-sequence-note-fill":`color-mix(in srgb, var(--kd-warning) 16%, var(--kd-surface))`,"--kd-sequence-note-stroke":`color-mix(in srgb, var(--kd-warning) 48%, var(--kd-border))`,"--kd-sequence-badge-fill":`var(--kd-text)`,"--kd-sequence-badge-text":`var(--kd-bg)`},Cc={"--kd-bg":`#f2f5f9`,"--kd-surface":`#ffffff`,"--kd-surface-2":`#eef2f7`,"--kd-surface-3":`#e0e5eb`,"--kd-text":`#141b24`,"--kd-muted":`#565e69`,"--kd-border":`#c4cbd4`,"--kd-edge":`#616a75`,"--kd-edge-label-bg":`#ffffff`,"--kd-edge-label-text":`#141b24`,"--kd-edge-label-stroke":`#c4cbd4`,"--kd-accent":`#6e36af`,"--kd-danger":`#c53637`,"--kd-danger-fill":`#fef2f2`,"--kd-warning":`#b67700`,"--kd-success":`#007d50`,"--kd-choice":`#6360a0`,"--kd-user-fill":`#f2eaff`,"--kd-user-stroke":`#6e36af`,"--kd-service-fill":`#f7f2ff`,"--kd-service-stroke":`#6e36af`,"--kd-system-fill":`#ece2ff`,"--kd-system-stroke":`#522188`,"--kd-container-fill":`#f7f2ff`,"--kd-container-stroke":`#6e36af`,"--kd-component-fill":`#f7f5fb`,"--kd-component-stroke":`#6b5f8a`,"--kd-data-fill":`#e8f7fb`,"--kd-data-stroke":`#0e7490`,"--kd-table-fill":`#ffffff`,"--kd-table-header-fill":`#eef2f7`,"--kd-table-title":`#141b24`,"--kd-table-zebra":`rgba(86, 94, 105, 0.07)`,"--kd-table-badge-pk-fill":`#6e36af`,"--kd-table-badge-fk-fill":`#6b5f9a`,"--kd-table-badge-uk-fill":`#2f7a62`,"--kd-table-badge-text":`#ffffff`,"--kd-choice-fill":`#f3f2fa`,"--kd-choice-stroke":`#6360a0`,"--kd-success-fill":`#ecfdf5`,"--kd-success-stroke":`#007d50`,"--kd-on-success":`#007d50`,"--kd-warning-fill":`#fffbeb`,"--kd-warning-stroke":`#b67700`,"--kd-on-warning":`#b67700`,"--kd-on-danger":`#c53637`,"--kd-on-muted":`#141b24`,"--kd-event-fill":`#f0fdf4`,"--kd-async-stroke":`#007d50`,"--kd-external-fill":`#f8fafc`,"--kd-external-stroke":`#565e69`,"--kd-group-fill":`rgba(110, 54, 175, 0.07)`,"--kd-group-stroke":`rgba(110, 54, 175, 0.32)`,"--kd-node-fill":`var(--kd-surface)`,"--kd-node-stroke":`var(--kd-border)`,"--kd-node-shadow":`rgba(20, 27, 36, 0.12)`,"--kd-node-glow":`rgba(110, 54, 175, 0.08)`,"--kd-edge-yes":`var(--kd-success)`,"--kd-edge-no":`var(--kd-danger)`,"--kd-edge-yes-label-bg":`#007d50`,"--kd-edge-yes-label-text":`#ffffff`,"--kd-edge-no-label-bg":`#c53637`,"--kd-edge-no-label-text":`#ffffff`,"--kd-port-fill":`var(--kd-bg)`,"--kd-port-stroke":`var(--kd-accent)`,"--kd-sequence-lifeline":`color-mix(in srgb, var(--kd-edge) 42%, transparent)`,"--kd-sequence-activation-fill":`color-mix(in srgb, var(--kd-accent) 14%, var(--kd-surface))`,"--kd-sequence-activation-stroke":`color-mix(in srgb, var(--kd-accent) 55%, var(--kd-edge))`,"--kd-sequence-fragment-fill":`rgba(110, 54, 175, 0.045)`,"--kd-sequence-fragment-stroke":`rgba(110, 54, 175, 0.32)`,"--kd-sequence-note-fill":`color-mix(in srgb, var(--kd-warning) 12%, var(--kd-surface))`,"--kd-sequence-note-stroke":`color-mix(in srgb, var(--kd-warning) 42%, var(--kd-border))`,"--kd-sequence-badge-fill":`var(--kd-text)`,"--kd-sequence-badge-text":`var(--kd-bg)`},wc=new Map;function Tc(e){let t=wc.get(e);return t?{...t}:e===`light`?{...Cc}:{...Sc}}function Ec(e,t){wc.set(e,t)}function Dc(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}function Oc(e,t=!1){if(!t)return Ac;let n=Tc(e),r=Object.entries(n).map(([e,t])=>` ${e}: ${t};`);return`${`.k-diagram[data-theme="${Dc(e)}"]`} {\n${r.join(`
|
|
641
|
+
`)}\n}\n${Ac}`}function kc(e){return`flow-node-${e.replace(/[^a-z0-9-]/gi,``)}`}var Ac=`
|
|
642
|
+
.k-diagram {
|
|
643
|
+
font-family: "Inter", "Segoe UI", system-ui, sans-serif;
|
|
644
|
+
}
|
|
645
|
+
.flow-node-shell { fill: var(--node-fill, var(--kd-node-fill)); stroke: var(--node-stroke, var(--kd-node-stroke)); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
|
|
646
|
+
.flow-node-shell-rim { pointer-events: none; }
|
|
647
|
+
.flow-node-title { fill: var(--node-title-fill, var(--kd-text)); font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
|
|
648
|
+
.flow-node-subtitle { fill: var(--kd-muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
|
|
649
|
+
.flow-node-technology { fill: var(--kd-muted); font-size: 11px; font-weight: 500; letter-spacing: 0.01em; font-style: italic; }
|
|
650
|
+
.flow-node-description { fill: var(--kd-muted); font-size: 11px; font-weight: 500; letter-spacing: 0.01em; opacity: 0.92; }
|
|
651
|
+
.flow-node-note-text { fill: var(--kd-muted); font-size: 9px; font-style: italic; }
|
|
652
|
+
.flow-node-icon-glyph { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.88; }
|
|
653
|
+
.flow-port-marker { fill: var(--node-stroke, var(--kd-node-stroke)); stroke: none; }
|
|
654
|
+
.flow-node-user, .flow-node-actor, .flow-node-person { --node-fill: var(--kd-user-fill); --node-stroke: var(--kd-user-stroke); }
|
|
655
|
+
.flow-node-participant { --node-fill: var(--kd-surface); --node-stroke: var(--kd-border); }
|
|
656
|
+
.flow-node-system { --node-fill: var(--kd-system-fill); --node-stroke: var(--kd-system-stroke); }
|
|
657
|
+
.flow-node-system .flow-node-shell { stroke-width: 2; }
|
|
658
|
+
.flow-node-container { --node-fill: var(--kd-container-fill); --node-stroke: var(--kd-container-stroke); }
|
|
659
|
+
.flow-node-component { --node-fill: var(--kd-component-fill); --node-stroke: var(--kd-component-stroke); }
|
|
660
|
+
.flow-node-service, .flow-node-worker, .flow-node-application, .flow-node-module, .flow-node-process, .flow-node-task, .flow-node-subprocess, .flow-node-command, .flow-node-producer, .flow-node-consumer, .flow-node-job, .flow-node-aggregate, .flow-node-projection, .flow-node-interface, .flow-node-deployment, .flow-node-server, .flow-node-state { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-service-stroke); }
|
|
661
|
+
.flow-node-database, .flow-node-entity, .flow-node-cache, .flow-node-store, .flow-node-bucket { --node-fill: var(--kd-data-fill); --node-stroke: var(--kd-data-stroke); }
|
|
662
|
+
.flow-node-table, .flow-node-class { --node-fill: var(--kd-table-fill, var(--kd-service-fill)); --node-stroke: var(--kd-service-stroke); }
|
|
663
|
+
.flow-node-gateway, .flow-node-broker, .flow-node-loadbalancer, .flow-node-firewall, .flow-node-preparation, .flow-node-policy { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-accent); }
|
|
664
|
+
.flow-node-queue, .flow-node-dlq, .flow-node-topic, .flow-node-stream { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-accent); }
|
|
665
|
+
.flow-node-event, .flow-node-start, .flow-node-end, .flow-node-branch, .flow-node-tag { --node-fill: var(--kd-event-fill); --node-stroke: var(--kd-async-stroke); }
|
|
666
|
+
.flow-node-choice, .flow-node-decision { --node-fill: var(--kd-choice-fill); --node-stroke: var(--kd-choice-stroke); }
|
|
667
|
+
.flow-node-warning, .flow-node-failure, .flow-node-manual { --node-fill: var(--kd-warning-fill); --node-stroke: var(--kd-warning-stroke); --node-title-fill: var(--kd-on-warning); }
|
|
668
|
+
.flow-node-success { --node-fill: var(--kd-success-fill); --node-stroke: var(--kd-success-stroke); --node-title-fill: var(--kd-on-success); }
|
|
669
|
+
.flow-node-external { --node-fill: var(--kd-external-fill); --node-stroke: var(--kd-external-stroke); --node-stroke-dash: 5 3.5; }
|
|
670
|
+
.flow-node-note, .flow-node-document, .flow-node-message, .flow-node-package { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-muted); }
|
|
671
|
+
.flow-node-cloud, .flow-node-zone, .flow-node-group, .flow-node-boundary { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-service-stroke); }
|
|
672
|
+
.flow-node-io { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-accent); }
|
|
673
|
+
.flow-node-connector, .flow-node-commit { --node-fill: var(--kd-text); --node-stroke: var(--kd-text); }
|
|
674
|
+
.flow-node-initial, .flow-node-junction {
|
|
675
|
+
--node-fill: var(--kd-async-stroke);
|
|
676
|
+
--node-stroke: var(--kd-async-stroke);
|
|
677
|
+
--node-title-fill: var(--kd-on-success);
|
|
678
|
+
}
|
|
679
|
+
.flow-node-final {
|
|
680
|
+
--node-fill: var(--kd-success-fill);
|
|
681
|
+
--node-stroke: var(--kd-async-stroke);
|
|
682
|
+
--node-title-fill: var(--kd-on-success);
|
|
683
|
+
}
|
|
684
|
+
/* Icon-only kind (node shell) — do not put glyph color rules here. */
|
|
685
|
+
.flow-node-icon {
|
|
686
|
+
--node-fill: color-mix(in srgb, var(--kd-node-fill) 88%, var(--kd-accent, var(--kd-text)) 12%);
|
|
687
|
+
--node-stroke: var(--kd-node-stroke);
|
|
688
|
+
}
|
|
689
|
+
/* Glyph wrapper — --icon-color for icon-only tint; else node stroke / theme. */
|
|
690
|
+
.flow-node-icon-mark {
|
|
691
|
+
color: var(--icon-color, var(--node-stroke, var(--kd-node-stroke)));
|
|
692
|
+
}
|
|
693
|
+
.flow-node-fork, .flow-node-join { --node-fill: var(--kd-text); --node-stroke: var(--kd-text); }
|
|
694
|
+
.flow-node-rectangle, .flow-node-rounded, .flow-shape-rectangle, .flow-shape-rounded { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-service-stroke); }
|
|
695
|
+
.flow-node-pill, .flow-shape-pill { --node-fill: var(--kd-event-fill); --node-stroke: var(--kd-async-stroke); }
|
|
696
|
+
.flow-node-diamond, .flow-shape-diamond { --node-fill: var(--kd-choice-fill); --node-stroke: var(--kd-choice-stroke); }
|
|
697
|
+
.flow-node-hexagon, .flow-shape-hexagon { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-accent); }
|
|
698
|
+
.flow-node-cylinder, .flow-shape-cylinder { --node-fill: var(--kd-data-fill); --node-stroke: var(--kd-data-stroke); }
|
|
699
|
+
.flow-node-ellipse, .flow-shape-ellipse, .flow-node-circle, .flow-shape-circle { --node-fill: var(--kd-event-fill); --node-stroke: var(--kd-async-stroke); }
|
|
700
|
+
.flow-node-triangle, .flow-shape-triangle, .flow-node-parallelogram, .flow-shape-parallelogram, .flow-node-trapezoid, .flow-shape-trapezoid { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-accent); }
|
|
701
|
+
.flow-node-folded-document, .flow-shape-folded-document { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-muted); }
|
|
702
|
+
.flow-shape-document { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-muted); }
|
|
703
|
+
.flow-shape-cloud, .flow-shape-boundary { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-service-stroke); }
|
|
704
|
+
.flow-shape-person { --node-fill: var(--kd-user-fill); --node-stroke: var(--kd-user-stroke); }
|
|
705
|
+
.flow-shape-queue, .flow-shape-stream { --node-fill: var(--kd-service-fill); --node-stroke: var(--kd-accent); }
|
|
706
|
+
.flow-node-shell-partition { pointer-events: none; }
|
|
707
|
+
/* Built-in semantic styles (is danger, is success, ...) — also applied via StyleDefinition. */
|
|
708
|
+
.kd-style-danger, .kd-style-dangerous, .kd-style-error, .kd-style-fail, .kd-style-failure,
|
|
709
|
+
.kd-style-critical {
|
|
710
|
+
--node-fill: var(--kd-danger-fill); --node-stroke: var(--kd-danger); --node-title-fill: var(--kd-on-danger);
|
|
711
|
+
}
|
|
712
|
+
.kd-style-warning, .kd-style-warn, .kd-style-caution {
|
|
713
|
+
--node-fill: var(--kd-warning-fill); --node-stroke: var(--kd-warning-stroke); --node-title-fill: var(--kd-on-warning);
|
|
714
|
+
}
|
|
715
|
+
.kd-style-success, .kd-style-ok, .kd-style-pass {
|
|
716
|
+
--node-fill: var(--kd-success-fill); --node-stroke: var(--kd-success-stroke); --node-title-fill: var(--kd-on-success);
|
|
717
|
+
}
|
|
718
|
+
.kd-style-muted, .kd-style-deprecated, .kd-style-inactive {
|
|
719
|
+
--node-fill: var(--kd-surface); --node-stroke: var(--kd-muted); --node-stroke-dash: 5 3.5; --node-title-fill: var(--kd-on-muted);
|
|
720
|
+
}
|
|
721
|
+
.kd-style-info, .kd-style-accent {
|
|
722
|
+
--node-fill: var(--kd-service-fill); --node-stroke: var(--kd-accent);
|
|
723
|
+
}
|
|
724
|
+
.flow-table-shell { stroke: none; }
|
|
725
|
+
.flow-table-border { fill: none; stroke: var(--node-stroke, var(--kd-node-stroke)); stroke-width: 1.5; }
|
|
726
|
+
.flow-table-title { fill: var(--kd-table-title, var(--kd-text)); font-weight: 700; letter-spacing: -0.01em; }
|
|
727
|
+
.flow-table-note { fill: var(--kd-muted); font-weight: 500; opacity: 0.82; letter-spacing: 0; font-size: 10px; }
|
|
728
|
+
.flow-table-col-name { fill: var(--kd-text); font-weight: 600; letter-spacing: -0.01em; }
|
|
729
|
+
.flow-table-col-pk { font-weight: 700; }
|
|
730
|
+
.flow-table-col-type { fill: var(--kd-muted); font-weight: 500; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; font-size: 10px; }
|
|
731
|
+
.flow-table-col-nn { fill: var(--kd-muted); font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; font-size: 9px; opacity: 0.72; }
|
|
732
|
+
.flow-table-col-note { fill: var(--kd-muted); font-weight: 500; opacity: 0.78; letter-spacing: 0; font-size: 9.5px; }
|
|
733
|
+
.flow-table-badge-pk { fill: var(--kd-table-badge-pk-fill); }
|
|
734
|
+
.flow-table-badge-fk { fill: var(--kd-table-badge-fk-fill); }
|
|
735
|
+
.flow-table-badge-uk { fill: var(--kd-table-badge-uk-fill); }
|
|
736
|
+
.flow-table-badge-text { fill: var(--kd-table-badge-text); font-weight: 800; letter-spacing: 0.02em; }
|
|
737
|
+
.flow-table-zebra { pointer-events: none; }
|
|
738
|
+
.flow-doc-mark { fill: var(--kd-table-badge-pk-fill); font-weight: 700; }
|
|
739
|
+
.flow-doc-required { font-weight: 700; }
|
|
740
|
+
.flow-group-database > .flow-group-box { stroke-dasharray: none; stroke-width: 1.75; }
|
|
741
|
+
.flow-group-box { fill: none; stroke: var(--kd-group-stroke); }
|
|
742
|
+
.flow-group-accented .flow-group-box { fill: var(--kd-group-fill); }
|
|
743
|
+
.flow-group-header-bar { fill: color-mix(in srgb, var(--kd-group-fill) 88%, var(--kd-text) 12%); pointer-events: none; }
|
|
744
|
+
.flow-group-header-rule { stroke: var(--kd-group-stroke); stroke-width: 1; pointer-events: none; }
|
|
745
|
+
.flow-group-swimlane-sep { stroke: var(--kd-group-stroke); stroke-width: 1; pointer-events: none; }
|
|
746
|
+
.flow-group-label { fill: var(--kd-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
|
|
747
|
+
.flow-group-label-icon { color: var(--icon-color, var(--kd-muted)); }
|
|
748
|
+
.flow-group-chromeless { pointer-events: none; }
|
|
749
|
+
.flow-edge-label-bg { fill: var(--kd-edge-label-bg); stroke: var(--kd-edge-label-stroke); stroke-width: 1; }
|
|
750
|
+
.flow-edge-label-leader { stroke: var(--kd-edge-label-stroke); stroke-width: 1; fill: none; opacity: 0.85; }
|
|
751
|
+
.flow-edge-label-text { fill: var(--kd-edge-label-text); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
|
|
752
|
+
.flow-edge-label-icon { color: var(--icon-color, var(--kd-edge-label-text)); }
|
|
753
|
+
.flow-debug-port { fill: var(--kd-accent); stroke: var(--kd-bg); stroke-width: 1.5; opacity: 0.95; }
|
|
754
|
+
.flow-debug-port-source { fill: var(--kd-edge-yes, var(--kd-accent)); }
|
|
755
|
+
.flow-debug-port-target { fill: var(--kd-edge-no, var(--kd-danger, var(--kd-accent))); }
|
|
756
|
+
.flow-edge-endpoint { stroke: var(--kd-bg); stroke-width: 1.25; opacity: 0.95; }
|
|
757
|
+
.flow-canvas-title-text { fill: var(--kd-text); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
|
|
758
|
+
.flow-canvas-subtitle-text { fill: var(--kd-muted); font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }
|
|
759
|
+
.flow-canvas-legend-text { fill: var(--kd-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
|
|
760
|
+
.flow-group-label-bar { fill: var(--kd-text); font-weight: 700; }
|
|
761
|
+
.flow-edge-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
|
|
762
|
+
.flow-sequence-message-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
|
|
763
|
+
.flow-sequence-message.flow-edge-eventual {
|
|
764
|
+
opacity: 1;
|
|
765
|
+
stroke-dasharray: none;
|
|
766
|
+
}
|
|
767
|
+
.flow-sequence-message.flow-edge-dependency { opacity: 1; }
|
|
768
|
+
.flow-sequence-message-label { fill: var(--kd-text); font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
|
|
769
|
+
.flow-sequence-message-label-bg { fill: var(--kd-edge-label-bg); stroke: var(--kd-edge-label-stroke); stroke-width: 1; }
|
|
770
|
+
.flow-sequence-message-head { stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: none; }
|
|
771
|
+
.flow-sequence-badge { fill: var(--kd-sequence-badge-fill, var(--kd-text)); }
|
|
772
|
+
.flow-sequence-badge-text { fill: var(--kd-sequence-badge-text, var(--kd-bg)); font-size: 9px; font-weight: 700; }
|
|
773
|
+
.flow-sequence-payload-card { fill: var(--kd-surface); stroke: var(--kd-border); stroke-width: 1; }
|
|
774
|
+
.flow-sequence-payload-accent { fill: var(--kd-edge); }
|
|
775
|
+
.flow-sequence-payload-async .flow-sequence-payload-accent { fill: var(--kd-async-stroke); }
|
|
776
|
+
.flow-sequence-payload-return .flow-sequence-payload-accent { fill: var(--kd-muted); }
|
|
777
|
+
.flow-sequence-payload-failure .flow-sequence-payload-accent { fill: var(--kd-danger); }
|
|
778
|
+
.flow-sequence-payload-text { fill: var(--kd-text); font-size: 10px; font-weight: 500; }
|
|
779
|
+
.flow-sequence-endpoint { fill: var(--kd-text); stroke: var(--kd-bg); stroke-width: 1.5; }
|
|
780
|
+
.flow-sequence-lifeline { stroke: var(--kd-sequence-lifeline, var(--kd-edge)); stroke-width: 1.15; stroke-dasharray: 1.15 5.5; stroke-linecap: round; }
|
|
781
|
+
.flow-sequence-activation { fill: var(--kd-sequence-activation-fill, var(--kd-surface-2)); stroke: var(--kd-sequence-activation-stroke, var(--kd-edge)); stroke-width: 1.2; }
|
|
782
|
+
.flow-sequence-fragment-box { fill: var(--kd-sequence-fragment-fill); stroke: var(--kd-sequence-fragment-stroke); stroke-width: 1.25; }
|
|
783
|
+
.flow-sequence-fragment-tab { fill: color-mix(in srgb, var(--kd-accent) 18%, var(--kd-surface)); stroke: var(--kd-sequence-fragment-stroke); stroke-width: 1.15; }
|
|
784
|
+
.flow-sequence-fragment-tab-label { fill: var(--kd-text); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; }
|
|
785
|
+
.flow-sequence-fragment-operand {
|
|
786
|
+
fill: var(--kd-sequence-fragment-fill, transparent);
|
|
787
|
+
stroke: none;
|
|
788
|
+
pointer-events: none;
|
|
789
|
+
}
|
|
790
|
+
.flow-sequence-fragment-sep { stroke: var(--kd-sequence-fragment-stroke, var(--kd-group-stroke)); stroke-width: 1; }
|
|
791
|
+
.flow-sequence-fragment-label,
|
|
792
|
+
.flow-sequence-fragment-guard { fill: var(--kd-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
|
|
793
|
+
.flow-sequence-divider-rule { stroke: var(--kd-border); stroke-width: 1; }
|
|
794
|
+
.flow-sequence-divider-chip { fill: var(--kd-bg); stroke: var(--kd-border); stroke-width: 1; }
|
|
795
|
+
.flow-sequence-divider-label { fill: var(--kd-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
|
|
796
|
+
.flow-sequence-note-card { fill: var(--kd-sequence-note-fill, var(--kd-surface-2)); stroke: var(--kd-sequence-note-stroke, var(--kd-border)); stroke-width: 1.15; }
|
|
797
|
+
.flow-sequence-note-fold { fill: color-mix(in srgb, var(--kd-sequence-note-stroke, var(--kd-border)) 28%, var(--kd-sequence-note-fill, var(--kd-surface))); stroke: var(--kd-sequence-note-stroke, var(--kd-border)); stroke-width: 1; }
|
|
798
|
+
.flow-sequence-note-text { fill: var(--kd-text); font-size: 11px; font-weight: 500; }
|
|
799
|
+
.flow-sequence-destroy { stroke-linecap: round; }
|
|
800
|
+
.flow-edge-label-yes .flow-edge-label-bg { fill: var(--kd-edge-yes-label-bg); stroke: var(--kd-edge-yes); }
|
|
801
|
+
.flow-edge-label-yes .flow-edge-label-text { fill: var(--kd-edge-yes-label-text); }
|
|
802
|
+
.flow-edge-label-no .flow-edge-label-bg { fill: var(--kd-edge-no-label-bg); stroke: var(--kd-edge-no); }
|
|
803
|
+
.flow-edge-label-no .flow-edge-label-text { fill: var(--kd-edge-no-label-text); }
|
|
804
|
+
.flow-edge-branch-yes { stroke: var(--kd-edge-yes); }
|
|
805
|
+
.flow-edge-branch-no { stroke: var(--kd-edge-no); }
|
|
806
|
+
.flow-edge-async { stroke-dasharray: 6 4; }
|
|
807
|
+
.flow-edge-eventual { stroke-dasharray: 2 6; opacity: 0.85; }
|
|
808
|
+
.flow-edge-association { stroke-dasharray: 1 0; opacity: 0.75; }
|
|
809
|
+
.flow-edge-dependency { stroke-dasharray: 2 4; opacity: 0.82; }
|
|
810
|
+
.flow-edge-failure { stroke: var(--kd-danger); }
|
|
811
|
+
|
|
812
|
+
/* Diagram animation emphasis (interactive player)
|
|
813
|
+
* Resolve --kd-* on .k-diagram (SVG root), not on .kdiagram-viewport —
|
|
814
|
+
* intermediate vars on the viewport can't see tokens defined on the SVG child.
|
|
815
|
+
* Active emphasis must NOT replace semantic strokes (yes/no, kind, danger, …).
|
|
816
|
+
*/
|
|
817
|
+
.k-diagram {
|
|
818
|
+
--kd-anim-dim-opacity: 0.62;
|
|
819
|
+
/* Soft haze — keep presence via wide blur, not a tight bright ring. */
|
|
820
|
+
--kd-anim-glow: color-mix(in srgb, var(--kd-text, #e8ebf1) 18%, transparent);
|
|
821
|
+
--kd-anim-glow-soft: color-mix(in srgb, var(--kd-text, #e8ebf1) 9%, transparent);
|
|
822
|
+
/* Pulse peak — stronger than steady active so the beat reads clearly. */
|
|
823
|
+
--kd-anim-pulse-glow: color-mix(in srgb, var(--kd-text, #e8ebf1) 36%, transparent);
|
|
824
|
+
--kd-anim-pulse-glow-soft: color-mix(in srgb, var(--kd-text, #e8ebf1) 16%, transparent);
|
|
825
|
+
/* Fallback only when an edge has no resolvable stroke (flow overlays set inline). */
|
|
826
|
+
--kd-anim-flow-stroke: color-mix(in srgb, var(--kd-accent, #b38eee) 55%, white);
|
|
827
|
+
--kd-anim-flow-core: color-mix(in srgb, var(--kd-accent, #b38eee) 30%, white);
|
|
828
|
+
}
|
|
829
|
+
.k-diagram .flow-anim-dim {
|
|
830
|
+
opacity: var(--kd-anim-dim-opacity);
|
|
831
|
+
}
|
|
832
|
+
.k-diagram .flow-anim-active {
|
|
833
|
+
opacity: 1 !important;
|
|
834
|
+
}
|
|
835
|
+
.k-diagram .flow-anim-active.flow-node {
|
|
836
|
+
filter: drop-shadow(0 0 8px var(--kd-anim-glow))
|
|
837
|
+
drop-shadow(0 0 22px var(--kd-anim-glow-soft));
|
|
838
|
+
}
|
|
839
|
+
.k-diagram .flow-anim-active.flow-node :is(.flow-node-shell, rect.flow-node-shell) {
|
|
840
|
+
stroke-width: 2.5px;
|
|
841
|
+
}
|
|
842
|
+
.k-diagram .flow-anim-active.flow-edge .flow-edge-path,
|
|
843
|
+
.k-diagram .flow-anim-active.flow-edge .flow-edge-jump,
|
|
844
|
+
.k-diagram .flow-anim-active.flow-edge .flow-sequence-message-path {
|
|
845
|
+
stroke-width: 2.6px;
|
|
846
|
+
stroke-opacity: 1;
|
|
847
|
+
filter: drop-shadow(0 0 6px var(--kd-anim-glow))
|
|
848
|
+
drop-shadow(0 0 16px var(--kd-anim-glow-soft));
|
|
849
|
+
}
|
|
850
|
+
.k-diagram .flow-anim-active.flow-sequence-fragment .flow-sequence-fragment-box {
|
|
851
|
+
stroke-width: 2.2px;
|
|
852
|
+
filter: drop-shadow(0 0 8px var(--kd-anim-glow))
|
|
853
|
+
drop-shadow(0 0 18px var(--kd-anim-glow-soft));
|
|
854
|
+
}
|
|
855
|
+
.k-diagram .flow-anim-active.flow-sequence-fragment-operand {
|
|
856
|
+
filter: drop-shadow(0 0 6px var(--kd-anim-glow-soft));
|
|
857
|
+
}
|
|
858
|
+
.k-diagram .flow-anim-pulse {
|
|
859
|
+
animation: flow-anim-pulse 0.65s ease-in-out infinite;
|
|
860
|
+
}
|
|
861
|
+
@keyframes flow-anim-pulse {
|
|
862
|
+
0%, 100% {
|
|
863
|
+
filter: drop-shadow(0 0 6px var(--kd-anim-glow))
|
|
864
|
+
drop-shadow(0 0 14px var(--kd-anim-glow-soft));
|
|
865
|
+
}
|
|
866
|
+
50% {
|
|
867
|
+
filter: drop-shadow(0 0 14px var(--kd-anim-pulse-glow))
|
|
868
|
+
drop-shadow(0 0 36px var(--kd-anim-pulse-glow-soft));
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
.k-diagram .flow-anim-flow-track {
|
|
872
|
+
fill: none;
|
|
873
|
+
stroke: color-mix(in srgb, var(--kd-anim-flow-stroke) 40%, transparent);
|
|
874
|
+
stroke-width: 5;
|
|
875
|
+
stroke-linecap: round;
|
|
876
|
+
stroke-linejoin: round;
|
|
877
|
+
pointer-events: none;
|
|
878
|
+
}
|
|
879
|
+
.k-diagram .flow-anim-flow-overlay {
|
|
880
|
+
fill: none;
|
|
881
|
+
stroke: var(--kd-anim-flow-stroke);
|
|
882
|
+
stroke-width: 3.75;
|
|
883
|
+
stroke-linecap: round;
|
|
884
|
+
stroke-linejoin: round;
|
|
885
|
+
pointer-events: none;
|
|
886
|
+
filter: drop-shadow(0 0 8px var(--kd-anim-glow))
|
|
887
|
+
drop-shadow(0 0 18px var(--kd-anim-glow-soft));
|
|
888
|
+
}
|
|
889
|
+
.k-diagram .flow-anim-flow-core {
|
|
890
|
+
fill: none;
|
|
891
|
+
stroke: var(--kd-anim-flow-core);
|
|
892
|
+
stroke-width: 1.75;
|
|
893
|
+
stroke-linecap: round;
|
|
894
|
+
stroke-linejoin: round;
|
|
895
|
+
pointer-events: none;
|
|
896
|
+
}
|
|
897
|
+
.k-diagram .flow-anim-flow-head {
|
|
898
|
+
fill: var(--kd-anim-flow-core);
|
|
899
|
+
stroke: var(--kd-anim-flow-stroke);
|
|
900
|
+
stroke-width: 1.5;
|
|
901
|
+
pointer-events: none;
|
|
902
|
+
filter: drop-shadow(0 0 8px var(--kd-anim-glow))
|
|
903
|
+
drop-shadow(0 0 18px var(--kd-anim-glow-soft));
|
|
904
|
+
}
|
|
905
|
+
@media (prefers-reduced-motion: reduce) {
|
|
906
|
+
.k-diagram .flow-anim-pulse {
|
|
907
|
+
animation: none;
|
|
908
|
+
filter: drop-shadow(0 0 8px var(--kd-anim-glow))
|
|
909
|
+
drop-shadow(0 0 18px var(--kd-anim-glow-soft));
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
`;function jc(e){return Gi(e)}function Mc(e,t){return t||Nr(e)}function Nc(e){return e===`yes`?`flow-edge-branch-yes`:e===`no`?`flow-edge-branch-no`:``}function Pc(e){return e===`yes`?`flow-edge-label-yes`:e===`no`?`flow-edge-label-no`:``}function Fc(e,t){return e===`yes`?`var(--kd-edge-yes)`:e===`no`?`var(--kd-edge-no)`:t}function V(e,t,n){return{"--kd-sequence-fragment-fill":`color-mix(in srgb, var(${e}) ${t}%, transparent)`,"--kd-sequence-fragment-stroke":`color-mix(in srgb, var(${e}) ${n}%, transparent)`}}var Ic=[{aliases:[`danger`,`dangerous`,`error`,`fail`,`failed`,`failure`],node:{"--node-fill":`var(--kd-danger-fill)`,"--node-stroke":`var(--kd-danger)`,"--node-title-fill":`var(--kd-on-danger)`,badge:`!`},edge:{"--edge-stroke":`var(--kd-danger)`,strokeWidth:`2.4`},fragment:V(`--kd-danger`,3.5,34)},{aliases:[`warning`,`warn`,`caution`],node:{"--node-fill":`var(--kd-warning-fill)`,"--node-stroke":`var(--kd-warning-stroke)`,"--node-title-fill":`var(--kd-on-warning)`,badge:`!`},edge:{"--edge-stroke":`var(--kd-warning)`,strokeWidth:`2.2`},fragment:V(`--kd-warning`,3.5,32)},{aliases:[`success`,`ok`,`pass`],node:{"--node-fill":`var(--kd-success-fill)`,"--node-stroke":`var(--kd-success-stroke)`,"--node-title-fill":`var(--kd-on-success)`,badge:`✓`},edge:{"--edge-stroke":`var(--kd-success)`,strokeWidth:`2.2`},fragment:V(`--kd-success`,3.5,32)},{aliases:[`critical`],node:{"--node-fill":`var(--kd-danger-fill)`,"--node-stroke":`var(--kd-danger)`,"--node-title-fill":`var(--kd-on-danger)`,badge:`!`,strokeWidth:`2.6`},edge:{"--edge-stroke":`var(--kd-danger)`,strokeWidth:`3`},fragment:V(`--kd-danger`,5,40)},{aliases:[`muted`,`deprecated`,`inactive`],node:{"--node-fill":`var(--kd-surface)`,"--node-stroke":`var(--kd-muted)`,"--node-title-fill":`var(--kd-on-muted)`,strokeDash:`5 3.5`},edge:{"--edge-stroke":`var(--kd-muted)`,strokeDash:`5 3.5`},fragment:V(`--kd-muted`,2.5,26)},{aliases:[`info`,`accent`],node:{"--node-fill":`var(--kd-service-fill)`,"--node-stroke":`var(--kd-accent)`},edge:{"--edge-stroke":`var(--kd-accent)`},fragment:V(`--kd-accent`,3,28)}];function Lc(e,t,n){return t.map(t=>({name:t,target:e,properties:{...n}}))}var Rc=[`danger`,`warning`,`success`,`critical`,`muted`,`info`],zc=Ic.flatMap(e=>[...Lc(`node`,e.aliases,e.node),...Lc(`edge`,e.aliases,e.edge),...Lc(`fragment`,e.aliases,e.fragment)]);function Bc(e){let t=e=>`${e.target??`node`}:${e.name}`,n=new Map;for(let e of zc)n.set(t(e),e);for(let r of e)n.set(t(r),r);return[...n.values()]}function Vc(e,t,n,r,i){for(let[a,o]of Object.entries(e.properties))a.startsWith(`--`)?t[a]=o:a===`badge`?n=o:a===`strokeWidth`?r=Number(o):a===`strokeDash`&&(i=o);return{badge:n,strokeWidth:r,strokeDash:i}}function Hc(e,t){for(let[n,r]of Object.entries(e.properties))n.startsWith(`--`)?t[n]=r:n===`fill`?t[`--kd-sequence-fragment-fill`]=r:n===`stroke`&&(t[`--kd-sequence-fragment-stroke`]=r)}function Uc(e,t){let n=Ui(e.kind).defaults,r={...n.cssVars,...e.unresolvedVars},i,a,o,s=Bc(t);for(let t of e.styleRefs){let e=s.find(e=>e.name===t&&(e.target??`node`)===`node`);e&&({badge:i,strokeWidth:a,strokeDash:o}=Vc(e,r,i,a,o))}e.kind===`external`&&!o&&(o=`5 3.5`);let c=`flow-shape-${e.shape??n.shape}`,l=n.classNames.filter(t=>t!==`flow-node-${e.kind}`&&!t.startsWith(`flow-shape-`)),u=e.styleRefs.map(e=>`kd-style-${e.replace(/[^a-z0-9-]/gi,``)}`);return{cssVars:r,classes:[...l,c,...u],badge:i,strokeWidth:a,strokeDash:o}}function Wc(e,t){let n={},r,i,a=Bc(t);for(let t of e.styleRefs){let e=a.find(e=>e.name===t&&e.target===`edge`);e&&({strokeWidth:r,strokeDash:i}=Vc(e,n,void 0,r,i))}return{cssVars:n,classes:e.styleRefs.map(e=>`kd-style-${e.replace(/[^a-z0-9-]/gi,``)}`),strokeWidth:r,strokeDash:i}}function Gc(e,t){let n={...e.unresolvedVars},r=Bc(t);for(let t of e.styleRefs){let e=r.find(e=>e.name===t&&e.target===`fragment`);e&&Hc(e,n)}return{cssVars:n,classes:e.styleRefs.map(e=>`kd-style-${e.replace(/[^a-z0-9-]/gi,``)}`)}}function Kc(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function qc(e){let t=e.trim().replace(/^#/,``),n=t.length===3?t.split(``).map(e=>e+e).join(``):t;return/^[0-9a-fA-F]{6}$/.test(n)?{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}:null}function Jc({r:e,g:t,b:n}){let r=e=>Math.max(0,Math.min(255,Math.round(e)));return`#${[r(e),r(t),r(n)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function Yc(e){let t=qc(e);return t?cl(t):null}function H(e){return Jc(ll(e))}function Xc({l:e,c:t,h:n},r){let i=rl(e)*100,a=Math.max(0,t),o=(n%360+360)%360;return r==null?`oklch(${nl(i)}% ${nl(a)} ${nl(o)})`:`oklch(${nl(i)}% ${nl(a)} ${nl(o)} / ${rl(r)})`}function Zc(e){return e.l<.55}function Qc(e,t){let n=qc(e);if(!n)return e;let r=rl(t);return`rgba(${Math.round(n.r)}, ${Math.round(n.g)}, ${Math.round(n.b)}, ${r})`}function $c(e,t,n=1){return{l:rl(t),c:Math.max(0,Math.min(.04,e.c)*n),h:Number.isFinite(e.h)?e.h:260}}function el(e,t,n){let r=rl(n);return{l:t+(e.l-t)*r*.35+(e.l<t?-.02:.02)*r,c:e.c*r*.55,h:e.h}}function tl(e,t){return{...e,h:((e.h+t)%360+360)%360}}function nl(e){return(Math.round(e*1e3)/1e3).toString()}function rl(e){return Math.max(0,Math.min(1,e))}function il(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function al(e){return rl(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)*255}function ol({r:e,g:t,b:n}){let r=il(e),i=il(t),a=il(n),o=Math.cbrt(.4122214708*r+.5363325363*i+.0514459929*a),s=Math.cbrt(.2119034982*r+.6806995451*i+.1073969566*a),c=Math.cbrt(.0883024619*r+.2817188376*i+.6299787005*a);return{L:.2104542553*o+.793617785*s-.0040720468*c,a:1.9779984951*o-2.428592205*s+.4505937099*c,b:.0259040371*o+.7827717662*s-.808675766*c}}function sl({L:e,a:t,b:n}){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r*r*r,s=i*i*i,c=a*a*a;return{r:al(4.0767416621*o-3.3077115913*s+.2309699292*c),g:al(-1.2684380046*o+2.6097574011*s-.3413193965*c),b:al(-.0041960863*o-.7034186147*s+1.707614701*c)}}function cl(e){let{L:t,a:n,b:r}=ol(e),i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n)*180/Math.PI;return a<0&&(a+=360),{l:t,c:i,h:i<1e-6?0:a}}function ll({l:e,c:t,h:n}){let r=(n%360+360)%360*Math.PI/180;return sl({L:rl(e),a:t*Math.cos(r),b:t*Math.sin(r)})}var ul=`studio-live`;function dl(e){return e===`light`?{mode:e,accent:H({l:.47,c:.183,h:301}),neutral:H({l:.975,c:.012,h:301})}:{mode:e,accent:H({l:.72,c:.14,h:301}),neutral:H({l:.16,c:.02,h:301})}}var fl=[{id:`default`,label:`Default`},{id:`ocean`,label:`Ocean`},{id:`forest`,label:`Forest`},{id:`ember`,label:`Ember`},{id:`slate`,label:`Slate`}];function pl(e,t){if(e==="default")return dl(t);let n=t===`dark`;switch(e){case`ocean`:return{mode:t,accent:H({l:n?.78:.45,c:n?.09:.1,h:230}),neutral:H({l:n?.16:.97,c:.012,h:230})};case`forest`:return{mode:t,accent:H({l:n?.78:.42,c:n?.1:.11,h:150}),neutral:H({l:n?.155:.97,c:.01,h:145})};case`ember`:return{mode:t,accent:H({l:n?.76:.5,c:n?.12:.13,h:40}),neutral:H({l:n?.15:.97,c:.012,h:50})};case`slate`:return{mode:t,accent:H({l:n?.82:.38,c:.01,h:260}),neutral:H({l:n?.14:.96,c:.004,h:260})}}}function ml(e){let t=qc(e);return t?Jc(t).toLowerCase():e.trim().toLowerCase()}function hl(e,t){let n=dl(e.mode),r=dl(t),i=ml(e.neutral)===ml(n.neutral);return{mode:t,accent:ml(e.accent)===ml(n.accent)?r.accent:_l(e.accent,t),neutral:i?r.neutral:gl(e.neutral,t,r.neutral)}}function gl(e,t,n){let r=Yc(e),i=Yc(n);return!r||!i?n:H({l:i.l,c:r.c,h:r.h})}function _l(e,t){let n=Yc(e);if(!n)return e;let r=t===`dark`?Math.max(.55,Math.min(.86,n.l)):Math.max(.28,Math.min(.5,n.l));return H({...n,l:r})}function vl(e,t){let n=dl(e);return t?{mode:e,accent:typeof t.accent==`string`?t.accent:n.accent,neutral:typeof t.neutral==`string`?t.neutral:n.neutral}:n}function U(e,t){return Yc(e)??t}function yl(e,t){return t===Zc(e)?e:$c(e,t?.155:.97)}function bl(e){let t=U(e.accent,{l:.72,c:.14,h:301}),n=U(e.neutral,{l:.16,c:.02,h:301}),r=e.mode===`dark`,i=yl(n,r),a=$c(i,i.l),o=$c(i,r?i.l+.04:i.l-.03),s=$c(i,r?i.l+.025:i.l-.02),c=$c(i,r?Math.max(.08,i.l-.03):Math.min(1,i.l+.01)),l=$c(i,r?i.l+.14:i.l-.18,1.2),u=$c(i,r?i.l+.08:i.l-.1,.9),d=$c(i,r?.93:.18,.4),f=$c(i,r?.68:.42,.5),p=$c(i,r?.48:.58,.4);return{"--bg":Xc(a),"--bg-elevated":Xc(o),"--bg-panel":Xc(s),"--bg-input":Xc(c),"--border":Xc(l),"--border-soft":Xc(u),"--text":Xc(d),"--text-muted":Xc(f),"--text-faint":Xc(p),"--accent":Xc(t),"--accent-soft":Xc(t,r?.18:.12),"--accent-contrast":Xc(t.l>.6?$c(i,.16,.4):$c(i,.98,.3)),"--accent-strong":Xc({l:.47,c:Math.min(.183,Math.max(.08,t.c)),h:t.h}),"--accent-strong-hover":Xc({l:.42,c:Math.min(.18,Math.max(.08,t.c*.9)),h:t.h}),"--on-accent-strong":Xc($c(i,.98,.3)),"--focus":Xc(t,r?.45:.4),"--shadow":r?`0 12px 40px oklch(0% 0 0 / 0.45)`:`0 12px 40px oklch(20% 0 0 / 0.12)`}}function xl(e){let t=document.documentElement;for(let[n,r]of Object.entries(e))t.style.setProperty(n,r)}function Sl(e){let t=Tc(e.mode),n=U(e.accent,{l:.72,c:.14,h:301}),r=U(e.neutral,{l:.16,c:.02,h:301}),i=e.mode===`dark`,a=yl(r,i),o=H($c(a,a.l)),s=H($c(a,i?a.l+.05:a.l-.03)),c=H($c(a,i?a.l+.09:a.l-.06)),l=H($c(a,i?a.l+.14:a.l-.1)),u=H($c(a,i?.93:.2,.35)),d=H($c(a,i?.68:.45,.45)),f=H($c(a,i?a.l+.16:a.l-.2,1.1)),p=H($c(a,i?.62:.5,.7)),m=H(n),h=Yc(s)?.l??(i?.22:.96),g=e=>H(el(n,h,e)),_=H(tl(n,28));return{...t,"--kd-bg":o,"--kd-surface":s,"--kd-surface-2":c,"--kd-surface-3":l,"--kd-text":u,"--kd-muted":d,"--kd-border":f,"--kd-edge":p,"--kd-edge-label-bg":c,"--kd-edge-label-text":u,"--kd-edge-label-stroke":f,"--kd-accent":m,"--kd-user-fill":g(i?.7:.45),"--kd-user-stroke":m,"--kd-service-fill":g(i?.55:.35),"--kd-service-stroke":m,"--kd-data-fill":H(el(tl(n,28),h,i?.6:.4)),"--kd-data-stroke":_,"--kd-table-fill":s,"--kd-table-header-fill":c,"--kd-table-title":u,"--kd-table-zebra":Qc(f,i?.35:.45),"--kd-table-badge-pk-fill":m,"--kd-table-badge-fk-fill":H({...tl(n,40),c:Math.min(.06,n.c+.01),l:i?Math.min(.55,n.l-.1):Math.max(.4,n.l)}),"--kd-table-badge-uk-fill":H(el(Yc(t[`--kd-success`]??m)??{l:.7,c:.1,h:160},h,i?.7:.5)),"--kd-table-badge-text":i?u:`#ffffff`,"--kd-event-fill":g(i?.4:.25),"--kd-event-stroke":t[`--kd-success`]??m,"--kd-external-fill":c,"--kd-external-stroke":d,"--kd-group-fill":Qc(m,i?.08:.06),"--kd-group-stroke":Qc(m,i?.35:.28),"--kd-grid-dot":Qc(m,i?.1:.08),"--kd-node-fill":`var(--kd-surface)`,"--kd-node-stroke":`var(--kd-border)`,"--kd-node-shadow":i?`rgba(0, 0, 0, 0.42)`:`rgba(15, 23, 42, 0.1)`,"--kd-node-glow":Qc(m,i?.14:.08),"--kd-port-fill":`var(--kd-bg)`,"--kd-port-stroke":`var(--kd-accent)`,"--kd-choice-fill":H(el(tl(n,40),h,i?.55:.35)),"--kd-choice-stroke":t[`--kd-choice`]??H(tl(n,40)),"--kd-success-fill":H(el(Yc(t[`--kd-success`]??m)??{l:.7,c:.1,h:160},h,i?.5:.3)),"--kd-success-stroke":t[`--kd-success`],"--kd-warning-fill":H(el(Yc(t[`--kd-warning`]??m)??{l:.78,c:.12,h:70},h,i?.5:.3)),"--kd-warning-stroke":t[`--kd-warning`]}}var Cl=yc;function wl(e){return xc(e,ul)}function Tl(e){return{...wl(e),snapshotTheme:!0}}function El({source:e}){let t=(0,u.useMemo)(()=>{let{theme:t,...n}=$s({...Cl,...tc(e)},`dark`);return n},[e]);return(0,A.jsx)(`main`,{className:`embed-shell`,children:(0,A.jsx)(Js,{source:e,theme:`auto`,height:`100%`,frameless:!0,showThemeToggle:!0,showViewControls:!0,showAnimationControls:!0,options:t})})}function Dl(e,t,n=5){return!e||e.id!==t.id?null:Math.hypot(t.x-e.x,t.y-e.y)<=n?e.nodeId:null}function Ol({source:e,renderOptions:t,activeView:n,onViewChange:r,liveRef:i,result:a,onRender:o,onNodeNavigate:s}){let c=(0,u.useMemo)(()=>{let{theme:e,...n}=t;return{...n,zoomOnWheel:`always`}},[t]);return(0,A.jsxs)(`section`,{className:`preview-pane output-pane`,children:[(0,A.jsxs)(`div`,{className:`pane-header preview-header`,children:[(0,A.jsxs)(`h2`,{children:[(0,A.jsx)(xt,{size:14,strokeWidth:1.75,"aria-hidden":!0}),`Preview`]}),(0,A.jsx)(`span`,{className:`preview-hint`,children:`Click a node to reveal its source`})]}),(0,A.jsx)(kl,{source:e,liveOptions:c,activeView:n,onViewChange:r,liveRef:i,onRender:o,onNodeNavigate:s}),a?.stats?(0,A.jsxs)(`footer`,{className:`output-status`,children:[(0,A.jsxs)(`span`,{children:[a.stats.nodeCount,`n`]}),(0,A.jsxs)(`span`,{children:[a.stats.edgeCount,`e`]}),(0,A.jsxs)(`span`,{children:[a.stats.totalMs.toFixed(1),`ms`]})]}):null]})}function kl({source:e,liveOptions:t,activeView:n,onViewChange:r,liveRef:i,onRender:a,onNodeNavigate:o}){let s=(0,u.useRef)(void 0),c=e=>{for(let t of e.nativeEvent.composedPath())if(t instanceof Element){let e=t.getAttribute(`data-node-id`);if(e)return e}return null};return(0,A.jsx)(`div`,{className:`preview-stage`,onPointerDownCapture:e=>{if(e.button!==0)return;let t=c(e);t&&(s.current={id:e.pointerId,x:e.clientX,y:e.clientY,nodeId:t})},onPointerUpCapture:e=>{let t=s.current;s.current=void 0;let n=Dl(t,{id:e.pointerId,x:e.clientX,y:e.clientY});n&&o(n)},onPointerCancelCapture:()=>{s.current=void 0},children:(0,A.jsx)(Js,{ref:i,className:`preview preview--live`,source:e,theme:ul,height:`100%`,view:n,showThemeToggle:!1,showViewControls:!0,showAnimationControls:!0,options:t,onKDiagramRender:e=>a(e.detail),onKDiagramViewChange:e=>r?.(e.detail.view)})})}var Al=2e5;function jl(e){let t=new URLSearchParams(e.replace(/^#/,``)),n=t.get(`source`);return{source:n?Il(n):void 0,embed:t.get(`embed`)===`1`}}function Ml(e,t=`https://diagrams.kekonic.com/studio/`,n=!1){let r=new URL(t);r.search=``;let i=new URLSearchParams;return n&&i.set(`embed`,`1`),i.set(`source`,Fl(e)),r.hash=i.toString(),r.toString()}function Nl(e,t){return`<iframe src="${Ll(Ml(e,t,!0))}" title="KDiagram diagram" width="100%" height="560" loading="lazy" allow="fullscreen"></iframe>`}function Pl(e){return`<k-diagram id="k-diagram" theme="auto" height="560"></k-diagram>
|
|
913
|
+
|
|
914
|
+
<script type="module">
|
|
915
|
+
import "@kekonic/diagrams-element";
|
|
916
|
+
|
|
917
|
+
const diagram = document.querySelector("#k-diagram");
|
|
918
|
+
diagram.source = ${JSON.stringify(e).replaceAll(`<`,`\\u003c`)};
|
|
919
|
+
<\/script>`}function Fl(e){let t=new TextEncoder().encode(e);if(t.byteLength>Al)throw Error(`This diagram is too large to share in a URL. Save the .kdiagram file instead.`);let n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function Il(e){try{let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t.padEnd(Math.ceil(t.length/4)*4,`=`),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));return i.byteLength>Al?void 0:new TextDecoder(`utf-8`,{fatal:!0}).decode(i)}catch{return}}function Ll(e){return e.replaceAll(`&`,`&`).replaceAll(`"`,`"`)}function Rl({source:e,studioUrl:t,onRenderSvg:n,onClose:r}){let[i,a]=(0,u.useState)(),[o,s]=(0,u.useState)(),c=(0,u.useMemo)(()=>({link:Ml(e,t),iframe:Nl(e,t),component:Pl(e)}),[e,t]);(0,u.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let l=async(e,t)=>{s(void 0);try{let r=t??await n();if(!r)throw Error(`Fix diagram errors before copying SVG.`);await Bl(r),a(e),window.setTimeout(()=>a(t=>t===e?void 0:t),1800)}catch(e){s(e instanceof Error?e.message:`Could not copy to the clipboard`)}};return(0,A.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,onMouseDown:r,children:(0,A.jsxs)(`section`,{className:`share-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`share-title`,onMouseDown:e=>e.stopPropagation(),children:[(0,A.jsxs)(`header`,{className:`share-header`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{id:`share-title`,children:`Share and embed`}),(0,A.jsx)(`p`,{children:`Choose an editable source link or a presentation-ready embed.`})]}),(0,A.jsx)(sn,{icon:nn,iconOnly:!0,label:`Close`,onClick:r,autoFocus:!0})]}),(0,A.jsxs)(`div`,{className:`share-options`,children:[(0,A.jsx)(zl,{icon:Nt,title:`Editable Studio link`,description:`Opens this source in the hosted Studio. Source stays in the URL fragment.`,value:c.link,copied:i===`link`,onCopy:()=>void l(`link`,c.link)}),(0,A.jsx)(zl,{icon:yt,title:`Interactive iframe`,description:`A diagram-only pan, zoom, fullscreen, and animation embed.`,value:c.iframe,copied:i===`iframe`,onCopy:()=>void l(`iframe`,c.iframe)}),(0,A.jsx)(zl,{icon:pt,title:`Web component`,description:`Framework-neutral code for projects that install KDiagram from npm.`,value:c.component,copied:i===`component`,onCopy:()=>void l(`component`,c.component)}),(0,A.jsx)(zl,{icon:kt,title:`SVG markup`,description:`Self-contained rendered markup for documents, sites, and design tools.`,copied:i===`svg`,onCopy:()=>void l(`svg`)})]}),o?(0,A.jsx)(`p`,{className:`share-error`,children:o}):null]})})}function zl({icon:e,title:t,description:n,value:r,copied:i,onCopy:a}){return(0,A.jsxs)(`article`,{className:`share-option`,children:[(0,A.jsx)(e,{size:18,strokeWidth:1.75,"aria-hidden":!0}),(0,A.jsxs)(`div`,{className:`share-option-copy`,children:[(0,A.jsx)(`h3`,{children:t}),(0,A.jsx)(`p`,{children:n}),r?(0,A.jsx)(`textarea`,{value:r,readOnly:!0,rows:t===`Editable Studio link`?2:4}):null]}),(0,A.jsx)(sn,{icon:i?lt:ht,iconOnly:!0,label:i?`Copied`:`Copy ${t}`,active:i,onClick:a})]})}async function Bl(e){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();let n=document.execCommand(`copy`);if(t.remove(),!n)throw Error(`Clipboard access is unavailable.`)}var Vl=(0,u.createContext)(null);function Hl(e){let t=(0,u.useContext)(Vl);if(!t)throw Error(`${e} must be used within <Accordion>`);return t}function Ul(e){return e==null?new Set:new Set(Array.isArray(e)?e:[e])}function Wl({type:e=`multiple`,defaultValue:t,value:n,onValueChange:r,children:i,className:a}){let[o,s]=(0,u.useState)(()=>Ul(t)),c=n==null?o:Ul(n),l=(0,u.useId)(),d=(0,u.useCallback)(t=>{let i=new Set(c);i.has(t)?i.delete(t):(e===`single`&&i.clear(),i.add(t)),n??s(i),r?.([...i])},[n,r,c,e]),f=(0,u.useMemo)(()=>({type:e,open:c,toggle:d,baseId:l}),[e,c,d,l]);return(0,A.jsx)(Vl.Provider,{value:f,children:(0,A.jsx)(`div`,{className:a?`accordion ${a}`:`accordion`,children:i})})}function Gl({value:e,title:t,children:n,className:r}){let{open:i,toggle:a,baseId:o}=Hl(`AccordionItem`),s=i.has(e),c=`${o}-panel-${e}`,l=`${o}-header-${e}`;return(0,A.jsxs)(`div`,{className:r?`accordion-item ${r}`:`accordion-item`,"data-state":s?`open`:`closed`,children:[(0,A.jsx)(`h3`,{className:`accordion-heading`,children:(0,A.jsxs)(`button`,{type:`button`,id:l,className:`accordion-trigger`,"aria-expanded":s,"aria-controls":c,onClick:()=>a(e),children:[(0,A.jsx)(`span`,{className:`accordion-title`,children:t}),(0,A.jsx)(dt,{size:14,strokeWidth:1.75,className:`accordion-chevron`,"aria-hidden":!0})]})}),(0,A.jsx)(`div`,{id:c,role:`region`,"aria-labelledby":l,className:`accordion-panel`,hidden:!s,children:n})]})}function Kl(e){let t=e.trim();if(/^#[0-9a-fA-F]{6}$/.test(t))return t;if(/^#[0-9a-fA-F]{3}$/.test(t)){let[e,n,r]=t.slice(1);return`#${e}${e}${n}${n}${r}${r}`}return`#000000`}function ql(e){for(let{id:t}of fl){let n=pl(t,e.mode);if(Kl(n.accent).toLowerCase()===Kl(e.accent).toLowerCase()&&Kl(n.neutral).toLowerCase()===Kl(e.neutral).toLowerCase())return t}return null}function Jl({label:e,value:t,onChange:n}){return(0,A.jsxs)(`label`,{className:`field color-field`,children:[(0,A.jsx)(`span`,{className:`field-label`,children:e}),(0,A.jsxs)(`div`,{className:`color-row`,children:[(0,A.jsx)(`input`,{type:`color`,value:Kl(t),onChange:e=>n(e.target.value),"aria-label":`${e} color`}),(0,A.jsx)(`input`,{type:`text`,className:`color-hex`,value:t,spellCheck:!1,"aria-label":`${e} hex value`,onChange:e=>n(e.target.value)})]})]})}function Yl({seeds:e,onChange:t,onReset:n}){let r=ql(e);return(0,A.jsxs)(`div`,{className:`theme-panel`,children:[(0,A.jsx)(`div`,{className:`theme-presets`,role:`group`,"aria-label":`Palette presets`,children:fl.map(({id:n,label:i})=>{let a=pl(n,e.mode);return(0,A.jsxs)(`button`,{type:`button`,className:`theme-preset`,"data-active":r===n?`true`:void 0,"aria-pressed":r===n,title:`${i} palette`,onClick:()=>t(a),children:[(0,A.jsx)(`span`,{className:`theme-preset__swatch`,style:{background:`linear-gradient(135deg, ${a.neutral} 45%, ${a.accent} 45%)`},"aria-hidden":!0}),(0,A.jsx)(`span`,{children:i})]},n)})}),(0,A.jsxs)(`div`,{className:`field-stack`,children:[(0,A.jsx)(Jl,{label:`Accent`,value:e.accent,onChange:e=>t({accent:e})}),(0,A.jsx)(Jl,{label:`Neutral`,value:e.neutral,onChange:e=>t({neutral:e})})]}),(0,A.jsx)(sn,{icon:Vt,label:`Reset palette`,className:`ghost tiny`,onClick:n})]})}function Xl(e){return e===``||e==null}function Zl({def:e,options:t,onChange:n}){let r=t[e.id];if(e.kind===`segment`){let t=String(r??``),i=Xl(r);return(0,A.jsxs)(`div`,{className:i?`field field-segment is-auto`:`field field-segment`,title:e.title,children:[(0,A.jsx)(`span`,{className:`field-label`,children:e.label}),(0,A.jsx)(`div`,{className:`segmented`,role:`radiogroup`,"aria-label":e.label,children:e.options.map(r=>{let i=t===r.value,a=r.title??r.label;return(0,A.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":i,className:i?`segment is-selected`:`segment`,title:a,onClick:()=>n(e.id,r.value),children:r.shortLabel??r.label},r.value||`__empty`)})})]})}if(e.kind===`select`){let t=Xl(r);return(0,A.jsxs)(`label`,{className:t?`field is-auto`:`field`,title:e.title,children:[(0,A.jsx)(`span`,{className:`field-label`,children:e.label}),(0,A.jsx)(`select`,{value:String(r??``),onChange:t=>n(e.id,t.target.value),children:e.options.map(e=>(0,A.jsx)(`option`,{value:e.value,children:e.label},e.value||`__empty`))})]})}if(e.kind===`range`){let t=typeof r==`number`?r:null,i=t==null,a=i?e.nullLabel??`Auto`:e.format?.(t)??String(t),o=(e.min+e.max)/2;return(0,A.jsxs)(`label`,{className:i?`field field-range is-auto`:`field field-range`,title:e.title,children:[(0,A.jsxs)(`span`,{className:`field-label`,children:[e.label,(0,A.jsx)(`output`,{children:a})]}),(0,A.jsxs)(`div`,{className:`range-row`,children:[(0,A.jsx)(`input`,{type:`range`,min:e.min,max:e.max,step:e.step,value:t??o,onChange:t=>n(e.id,parseFloat(t.target.value))}),(0,A.jsx)(`button`,{type:`button`,className:`ghost tiny`,title:`Use diagram source / engine default`,disabled:i,onClick:()=>n(e.id,null),children:`Auto`})]})]})}let i=!!r;return(0,A.jsxs)(`div`,{className:`field field-toggle`,title:e.title,children:[(0,A.jsx)(`span`,{className:`field-label`,id:`toggle-${e.id}`,children:e.label}),(0,A.jsx)(`button`,{type:`button`,className:i?`toggle is-on`:`toggle`,role:`switch`,"aria-checked":i,"aria-labelledby":`toggle-${e.id}`,onClick:()=>n(e.id,!i),children:(0,A.jsx)(`span`,{className:`toggle-thumb`,"aria-hidden":!0})})]})}var Ql={value:``,label:`Auto`,shortLabel:`Auto`},$l=[{id:`theme`,section:`appearance`,label:`Theme`,kind:`segment`,title:`The exported palette. This updates render.theme in the diagram source.`,options:[{value:`dark`,label:`Dark`},{value:`light`,label:`Light`}]},{id:`direction`,section:`layout`,label:`Direction`,kind:`segment`,title:`Auto follows direction in the diagram source`,options:[Ql,{value:`TD`,label:`Top → down`,shortLabel:`↓`,title:`Top → down`},{value:`LR`,label:`Left → right`,shortLabel:`→`,title:`Left → right`},{value:`BT`,label:`Bottom → top`,shortLabel:`↑`,title:`Bottom → top`},{value:`RL`,label:`Right → left`,shortLabel:`←`,title:`Right → left`}]},{id:`density`,section:`layout`,label:`Density`,kind:`segment`,title:`Auto follows density in the diagram source`,options:[Ql,{value:`compact`,label:`Compact`,shortLabel:`Tight`},{value:`normal`,label:`Normal`,shortLabel:`Normal`},{value:`spacious`,label:`Spacious`,shortLabel:`Loose`}]},{id:`groupLayout`,section:`layout`,label:`Groups`,kind:`segment`,title:`How groups participate in layout. This updates layout.groupLayout in the source.`,options:[Ql,{value:`auto`,label:`Engine`,shortLabel:`Engine`},{value:`compound`,label:`Nested`,shortLabel:`Nest`},{value:`flat`,label:`Flat`},{value:`swimlane`,label:`Lanes`,shortLabel:`Lanes`}]},{id:`edgeStyle`,section:`edges`,label:`Edge style`,kind:`segment`,title:`Auto follows edges.route in the diagram source`,options:[Ql,{value:`metro`,label:`Metro`,shortLabel:`Metro`,title:`Rounded orthogonal corridor`},{value:`rounded`,label:`Rounded`,shortLabel:`Round`,title:`Orthogonal with smaller corner radius`},{value:`orthogonal`,label:`Orthogonal`,shortLabel:`Ortho`,title:`Sharp orthogonal polyline`},{value:`straight`,label:`Straight`,shortLabel:`Line`,title:`Port-to-port chord, or a short dogleg around nodes`},{value:`bezier`,label:`Bezier`,shortLabel:`Curve`,title:`Smooth cubic that follows the corridor`}]},{id:`crossings`,section:`edges`,label:`Crossings`,kind:`segment`,title:`Auto follows edges.crossings in the diagram source`,options:[Ql,{value:`jumps`,label:`Jumps`},{value:`smart`,label:`Smart`},{value:`gaps`,label:`Gaps`},{value:`none`,label:`None`}]}];function eu(e){return $l.filter(t=>t.section===e)}function tu({options:e,onChange:t,onReset:n,themeSeeds:r,onThemeSeedsChange:i,onResetThemeSeeds:a}){let o=eu(`appearance`),s=eu(`layout`),c=eu(`edges`);return(0,A.jsx)(`div`,{className:`sidebar-panel adjust-panel`,children:(0,A.jsxs)(Wl,{type:`multiple`,defaultValue:[`appearance`,`layout`,`edges`],className:`sidebar-accordion`,children:[(0,A.jsx)(Gl,{value:`appearance`,title:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Lt,{size:14,strokeWidth:1.75,"aria-hidden":!0}),`Appearance`]}),children:(0,A.jsxs)(`div`,{className:`field-stack`,children:[o.map(n=>(0,A.jsx)(Zl,{def:n,options:e,onChange:t},n.id)),(0,A.jsx)(Yl,{seeds:r,onChange:i,onReset:a}),(0,A.jsx)(`p`,{className:`field-help`,children:`Mode is saved in source. The selected palette is embedded in exported SVG files.`})]})}),(0,A.jsx)(Gl,{value:`layout`,title:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(jt,{size:14,strokeWidth:1.75,"aria-hidden":!0}),`Layout`]}),children:(0,A.jsxs)(`div`,{className:`field-stack`,children:[s.map(n=>(0,A.jsx)(Zl,{def:n,options:e,onChange:t},n.id)),(0,A.jsx)(`div`,{className:`section-actions`,children:(0,A.jsx)(sn,{icon:Vt,label:`Remove settings`,className:`ghost tiny`,onClick:n})})]})}),(0,A.jsx)(Gl,{value:`edges`,title:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Dt,{size:14,strokeWidth:1.75,"aria-hidden":!0}),`Edges`]}),children:(0,A.jsx)(`div`,{className:`field-stack`,children:c.map(n=>(0,A.jsx)(Zl,{def:n,options:e,onChange:t},n.id))})})]})})}function nu({open:e,options:t,onChange:n,onReset:r,themeSeeds:i,onThemeSeedsChange:a,onResetThemeSeeds:o}){return e?(0,A.jsxs)(`aside`,{className:`drawer sidebar`,"aria-label":`Adjust diagram`,children:[(0,A.jsx)(`header`,{className:`sidebar-header`,children:(0,A.jsxs)(`h2`,{children:[(0,A.jsx)(Yt,{size:16,strokeWidth:1.75,"aria-hidden":!0}),`Diagram settings`]})}),(0,A.jsx)(`div`,{className:`sidebar-body`,children:(0,A.jsx)(tu,{options:t,onChange:n,onReset:r,themeSeeds:i,onThemeSeedsChange:a,onResetThemeSeeds:o})})]}):null}var ru=`kdiagram-studio:`;function iu(e,t){try{let n=localStorage.getItem(ru+e);return n==null?t:JSON.parse(n)}catch{return t}}function au(e,t){try{localStorage.setItem(ru+e,JSON.stringify(t))}catch{}}function W({left:e,right:t,storageKey:n=`splitRatio`,defaultRatio:r=.38,minLeftPct:i=22,maxLeftPct:a=62}){let[o,s]=(0,u.useState)(()=>iu(n,r)),c=(0,u.useRef)(!1),l=(0,u.useRef)(null);(0,u.useEffect)(()=>{au(n,o)},[o,n]);let d=(0,u.useCallback)(e=>{c.current=!0,e.target.setPointerCapture(e.pointerId)},[]),f=(0,u.useCallback)(e=>{if(!c.current||!l.current)return;let t=l.current.getBoundingClientRect(),n=(e.clientX-t.left)/t.width,r=Math.min(a/100,Math.max(i/100,n));s(r)},[a,i]),p=(0,u.useCallback)(()=>{c.current=!1},[]);return(0,A.jsxs)(`div`,{className:`split-pane`,ref:l,style:{gridTemplateColumns:`minmax(0, ${o}fr) 6px minmax(0, ${1-o}fr)`},children:[(0,A.jsx)(`div`,{className:`split-pane-left`,children:e}),(0,A.jsx)(`div`,{className:`split-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":Math.round(o*100),tabIndex:0,onPointerDown:d,onPointerMove:f,onPointerUp:p,onKeyDown:e=>{e.key===`ArrowLeft`&&s(e=>Math.max(i/100,e-.02)),e.key===`ArrowRight`&&s(e=>Math.min(a/100,e+.02))}}),(0,A.jsx)(`div`,{className:`split-pane-right`,children:t})]})}var ou=new URL(`kekonic-diagrams-symbol-DLqXST9D.svg`,import.meta.url).href;function su({product:e,theme:t,connection:n,onToggleTheme:r,onExport:i,onShare:a,onToggleSidebar:o,sidebarOpen:s}){return(0,A.jsxs)(`header`,{className:`toolbar`,children:[(0,A.jsxs)(`div`,{className:`brand`,children:[(0,A.jsx)(`img`,{className:`brand-mark`,src:ou,width:26,height:20,alt:``}),(0,A.jsx)(`h1`,{children:`Kekonic`}),(0,A.jsx)(`span`,{className:`tag`,children:e})]}),n?(0,A.jsx)(`span`,{className:`connection-status`,"data-connected":n.connected,children:n.label}):null,(0,A.jsx)(`div`,{className:`toolbar-spacer`}),(0,A.jsxs)(`div`,{className:`toolbar-actions`,children:[(0,A.jsx)(sn,{icon:_t,label:`Export SVG`,onClick:i}),(0,A.jsx)(sn,{icon:qt,label:`Share`,onClick:a}),(0,A.jsx)(sn,{icon:t===`dark`?Ft:Zt,iconOnly:!0,label:t===`dark`?`Switch to light theme`:`Switch to dark theme`,title:t===`dark`?`Dark — click for light`:`Light — click for dark`,onClick:r}),(0,A.jsx)(sn,{icon:zt,iconOnly:!0,label:s?`Hide sidebar`:`Show sidebar`,title:s?`Hide sidebar`:`Show sidebar`,active:s,"aria-expanded":s,onClick:o})]})]})}var cu=Object.entries(Object.assign({"../../../../../examples/architecture-icons.kdiagram":`kdiagram 1
|
|
920
|
+
|
|
921
|
+
diagram "Architecture icons" {
|
|
922
|
+
direction TD
|
|
923
|
+
presentation {
|
|
924
|
+
title: "Architecture icons"
|
|
925
|
+
titleSubtitle: "Lucide, logos, and simple-icons samples — catalog only, not a system map."
|
|
926
|
+
groupAccent: false
|
|
927
|
+
showKindSubtitles: false
|
|
928
|
+
}
|
|
929
|
+
layout {
|
|
930
|
+
density: compact
|
|
931
|
+
spacingScale: 1
|
|
932
|
+
considerModelOrder: true
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
group catalog {
|
|
936
|
+
arrange: grid
|
|
937
|
+
columns: 2
|
|
938
|
+
align: stretch
|
|
939
|
+
|
|
940
|
+
group people "People" {
|
|
941
|
+
column: 1
|
|
942
|
+
row: 1
|
|
943
|
+
arrange: pack
|
|
944
|
+
ada: user "Ada" { icon: user }
|
|
945
|
+
clerk: actor "Clerk" { icon: user-round }
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
group lucide "Lucide" {
|
|
949
|
+
column: 2
|
|
950
|
+
row: 1
|
|
951
|
+
arrange: pack
|
|
952
|
+
api: gateway "API" { icon: waypoints }
|
|
953
|
+
cart: service "Checkout" { icon: shopping-cart }
|
|
954
|
+
mail: consumer "Mail" { icon: mail }
|
|
955
|
+
tower: topic "Events" { icon: radio-tower }
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
group brands "Brand icons" {
|
|
959
|
+
column: 1
|
|
960
|
+
row: 2
|
|
961
|
+
arrange: pack
|
|
962
|
+
aws: cloud "AWS" {
|
|
963
|
+
icon: "logos:aws"
|
|
964
|
+
iconPaint: brand
|
|
965
|
+
}
|
|
966
|
+
pg: database "Postgres" {
|
|
967
|
+
icon: "logos:postgresql"
|
|
968
|
+
iconPaint: brand
|
|
969
|
+
}
|
|
970
|
+
stripe: external "Stripe" {
|
|
971
|
+
icon: "simple-icons:stripe"
|
|
972
|
+
iconPaint: brand
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
`,"../../../../../examples/charge-cart-sequence.kdiagram":`kdiagram 1
|
|
978
|
+
|
|
979
|
+
sequence "Charge a cart" {
|
|
980
|
+
autonumber
|
|
981
|
+
|
|
982
|
+
presentation {
|
|
983
|
+
title: auto
|
|
984
|
+
titleSubtitle: "The call, the event, and the reply. Each excerpt is only the fields that matter."
|
|
985
|
+
groupAccent: false
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
shopper: actor "Shopper" { icon: user }
|
|
989
|
+
web: gateway "Web" { icon: waypoints }
|
|
990
|
+
orders: service "Orders" { icon: receipt }
|
|
991
|
+
bus: topic "orders.v1" { icon: radio-tower }
|
|
992
|
+
payments: service "Payments" { icon: credit-card }
|
|
993
|
+
|
|
994
|
+
shopper -> web POST /checkout {
|
|
995
|
+
payload: """
|
|
996
|
+
{
|
|
997
|
+
"cartId": "c_91",
|
|
998
|
+
"tenders": ["card"]
|
|
999
|
+
}
|
|
1000
|
+
"""
|
|
1001
|
+
}
|
|
1002
|
+
activate web
|
|
1003
|
+
|
|
1004
|
+
web -> orders "PlaceOrder" {
|
|
1005
|
+
payload: """
|
|
1006
|
+
{
|
|
1007
|
+
"cartId": "c_91",
|
|
1008
|
+
"idempotencyKey": "c_91"
|
|
1009
|
+
}
|
|
1010
|
+
"""
|
|
1011
|
+
}
|
|
1012
|
+
activate orders
|
|
1013
|
+
|
|
1014
|
+
orders => bus "AuthorizeRequested" {
|
|
1015
|
+
payload: """
|
|
1016
|
+
{
|
|
1017
|
+
"cartId": "c_91",
|
|
1018
|
+
"amount": 4200,
|
|
1019
|
+
"currency": "usd"
|
|
1020
|
+
}
|
|
1021
|
+
"""
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
bus => payments "AuthorizeRequested"
|
|
1025
|
+
activate payments
|
|
1026
|
+
|
|
1027
|
+
payments --> orders "authorized" {
|
|
1028
|
+
payload: """
|
|
1029
|
+
{
|
|
1030
|
+
"authRef": "auth_18",
|
|
1031
|
+
"status": "authorized"
|
|
1032
|
+
}
|
|
1033
|
+
"""
|
|
1034
|
+
}
|
|
1035
|
+
deactivate payments
|
|
1036
|
+
deactivate orders
|
|
1037
|
+
|
|
1038
|
+
web --> shopper "201 Created"
|
|
1039
|
+
deactivate web
|
|
1040
|
+
}
|
|
1041
|
+
`,"../../../../../examples/checkout-schema.kdiagram":`kdiagram 1
|
|
1042
|
+
|
|
1043
|
+
diagram "Checkout schema" {
|
|
1044
|
+
direction LR
|
|
1045
|
+
presentation {
|
|
1046
|
+
title: "Checkout schema"
|
|
1047
|
+
titleSubtitle: "Identity, catalog, and orders — keys, cardinality, and bounded contexts."
|
|
1048
|
+
groupAccent: false
|
|
1049
|
+
}
|
|
1050
|
+
layout {
|
|
1051
|
+
density: compact
|
|
1052
|
+
spacingScale: 1
|
|
1053
|
+
groupLayout: compound
|
|
1054
|
+
nodePlacement: basic
|
|
1055
|
+
considerModelOrder: true
|
|
1056
|
+
edgeNodeSpacing: 28
|
|
1057
|
+
edgeEdgeSpacing: 16
|
|
1058
|
+
}
|
|
1059
|
+
edges {
|
|
1060
|
+
route: orthogonal
|
|
1061
|
+
crossings: gaps
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
group identity "Identity" {
|
|
1065
|
+
customers: table "customers" {
|
|
1066
|
+
note: "Account holder"
|
|
1067
|
+
columns {
|
|
1068
|
+
id: uuid PK
|
|
1069
|
+
email: varchar(320) UK NN
|
|
1070
|
+
name: text NN
|
|
1071
|
+
created_at: timestamptz NN
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
customer_profiles: table "customer_profiles" {
|
|
1076
|
+
columns {
|
|
1077
|
+
customer_id: uuid PK FK NN -> customers.id
|
|
1078
|
+
phone: text
|
|
1079
|
+
default_locale: text NN // en|es
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
addresses: table "addresses" {
|
|
1084
|
+
columns {
|
|
1085
|
+
id: uuid PK
|
|
1086
|
+
customer_id: uuid FK NN -> customers.id
|
|
1087
|
+
line1: text NN
|
|
1088
|
+
city: text NN
|
|
1089
|
+
country: char(2) NN
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
group catalog "Catalog" {
|
|
1095
|
+
categories: table "categories" {
|
|
1096
|
+
columns {
|
|
1097
|
+
id: uuid PK
|
|
1098
|
+
parent_id: uuid FK -> categories.id
|
|
1099
|
+
slug: text UK NN
|
|
1100
|
+
name: text NN
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
products: table "products" {
|
|
1105
|
+
columns {
|
|
1106
|
+
id: uuid PK
|
|
1107
|
+
category_id: uuid FK NN -> categories.id
|
|
1108
|
+
sku: text UK NN
|
|
1109
|
+
name: text NN
|
|
1110
|
+
unit_price: numeric(10,2) NN
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
group sales "Orders" {
|
|
1116
|
+
orders: table "orders" {
|
|
1117
|
+
columns {
|
|
1118
|
+
id: uuid PK
|
|
1119
|
+
customer_id: uuid FK NN -> customers.id
|
|
1120
|
+
billing_address_id: uuid FK NN -> addresses.id
|
|
1121
|
+
shipping_address_id: uuid FK -> addresses.id
|
|
1122
|
+
status: text NN // open|paid|shipped
|
|
1123
|
+
total: numeric(10,2) NN
|
|
1124
|
+
placed_at: timestamptz NN
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
order_items: table "order_items" {
|
|
1129
|
+
columns {
|
|
1130
|
+
order_id: uuid PK FK NN -> orders.id
|
|
1131
|
+
line_no: int PK NN
|
|
1132
|
+
product_id: uuid FK NN -> products.id
|
|
1133
|
+
qty: int NN
|
|
1134
|
+
unit_price: numeric(10,2) NN
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
payments: table "payments" {
|
|
1139
|
+
columns {
|
|
1140
|
+
id: uuid PK
|
|
1141
|
+
order_id: uuid FK UK NN -> orders.id
|
|
1142
|
+
provider: text NN
|
|
1143
|
+
amount: numeric(10,2) NN
|
|
1144
|
+
status: text NN
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
`,"../../../../../examples/commerce-context-map.kdiagram":`kdiagram 1
|
|
1150
|
+
|
|
1151
|
+
diagram "Commerce bounded contexts" {
|
|
1152
|
+
layout {
|
|
1153
|
+
direction: LR
|
|
1154
|
+
density: spacious
|
|
1155
|
+
considerModelOrder: true
|
|
1156
|
+
groupLayout: compound
|
|
1157
|
+
}
|
|
1158
|
+
edges {
|
|
1159
|
+
route: orthogonal
|
|
1160
|
+
crossings: gaps
|
|
1161
|
+
}
|
|
1162
|
+
presentation {
|
|
1163
|
+
title: auto
|
|
1164
|
+
titleSubtitle: "How catalog, ordering, payments, and fulfillment relate — not a C4 container view."
|
|
1165
|
+
groupAccent: true
|
|
1166
|
+
showKindSubtitles: false
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
boundary identity "Identity" {
|
|
1170
|
+
accounts: service "Accounts"
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
boundary catalog "Catalog" {
|
|
1174
|
+
products: service "Product catalog"
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
boundary ordering "Ordering" {
|
|
1178
|
+
orders: aggregate "Order"
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
boundary payments "Payments" {
|
|
1182
|
+
charges: service "Charges"
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
boundary fulfillment "Fulfillment" {
|
|
1186
|
+
stock: service "Inventory"
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
accounts -> orders "Customer ids — published language" { priority: high }
|
|
1190
|
+
products -> orders "Product snapshot — anticorruption" { priority: high }
|
|
1191
|
+
orders -> charges "Authorize charge — customer / supplier" { priority: high }
|
|
1192
|
+
charges -> orders "Payment result — conformist"
|
|
1193
|
+
orders -> stock "OrderPlaced contract — open host" { priority: high }
|
|
1194
|
+
stock -> orders "Reservation result — customer / supplier"
|
|
1195
|
+
|
|
1196
|
+
animation "Checkout integration" {
|
|
1197
|
+
dim *
|
|
1198
|
+
activate orders
|
|
1199
|
+
wait 250ms
|
|
1200
|
+
flow orders -> charges for 700ms
|
|
1201
|
+
activate charges
|
|
1202
|
+
pulse charges for 800ms
|
|
1203
|
+
flow charges -> orders for 700ms
|
|
1204
|
+
activate orders
|
|
1205
|
+
wait 400ms
|
|
1206
|
+
flow orders -> stock for 700ms
|
|
1207
|
+
activate stock
|
|
1208
|
+
wait 500ms
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
`,"../../../../../examples/complete-sequence.kdiagram":`kdiagram 1
|
|
1212
|
+
|
|
1213
|
+
sequence "Checkout payment" {
|
|
1214
|
+
autonumber
|
|
1215
|
+
|
|
1216
|
+
presentation {
|
|
1217
|
+
title: auto
|
|
1218
|
+
titleSubtitle: "Authorize, capture, and hand off — participants, replies, fragments, and lifecycle."
|
|
1219
|
+
groupAccent: false
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
shopper: actor "Shopper" { icon: user }
|
|
1223
|
+
web: gateway "Web" { icon: waypoints }
|
|
1224
|
+
orders: service "Orders" { icon: receipt }
|
|
1225
|
+
payments: service "Payments" { icon: credit-card }
|
|
1226
|
+
bank: external "Bank" { icon: landmark }
|
|
1227
|
+
|
|
1228
|
+
note left of shopper "Session is already authenticated. The cart id is the idempotency key."
|
|
1229
|
+
|
|
1230
|
+
shopper -> web "POST /checkout"
|
|
1231
|
+
activate web
|
|
1232
|
+
web -> orders "PlaceOrder"
|
|
1233
|
+
activate orders
|
|
1234
|
+
orders -> orders "validate cart"
|
|
1235
|
+
|
|
1236
|
+
note over orders, payments "Retrying Authorize must not double-charge"
|
|
1237
|
+
|
|
1238
|
+
orders -> payments "Authorize with the cart idempotency key"
|
|
1239
|
+
activate payments
|
|
1240
|
+
payments -> bank "place hold"
|
|
1241
|
+
bank --> payments "authorized"
|
|
1242
|
+
payments --> orders "auth ref"
|
|
1243
|
+
|
|
1244
|
+
alternate "funds captured" is success {
|
|
1245
|
+
loop "each tender" {
|
|
1246
|
+
payments -> bank "capture part"
|
|
1247
|
+
}
|
|
1248
|
+
orders -> orders "commit"
|
|
1249
|
+
} else "declined" is danger {
|
|
1250
|
+
payments -x bank "void hold"
|
|
1251
|
+
orders -x web "402 Payment Required"
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
optional "receipt" {
|
|
1255
|
+
orders => web "OrderAccepted"
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
parallel "ledger" {
|
|
1259
|
+
orders => payments "capture booked"
|
|
1260
|
+
} and "audit" {
|
|
1261
|
+
web => shopper "pending notice"
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
critical "single writer" {
|
|
1265
|
+
orders -> orders "flush outbox"
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
break "hold expired" is danger {
|
|
1269
|
+
payments -> bank "release hold"
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
section "Carrier handoff" {
|
|
1273
|
+
orders -> orders "open handoff"
|
|
1274
|
+
create shipment: subprocess "Shipment" { icon: package-open }
|
|
1275
|
+
orders -> shipment "start picking"
|
|
1276
|
+
note right of shipment "Lives only until the carrier accepts the label"
|
|
1277
|
+
shipment --> orders "tracking"
|
|
1278
|
+
destroy shipment
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
divider "After the response"
|
|
1282
|
+
* -> web "edge retry"
|
|
1283
|
+
web -> * "dropped ack"
|
|
1284
|
+
deactivate orders
|
|
1285
|
+
web --> shopper "201 Created"
|
|
1286
|
+
deactivate web
|
|
1287
|
+
}
|
|
1288
|
+
`,"../../../../../examples/employee-schedules.kdiagram":`diagram "Employee schedules" {
|
|
1289
|
+
direction LR
|
|
1290
|
+
presentation {
|
|
1291
|
+
title: "Employee schedules"
|
|
1292
|
+
titleSubtitle: "The employee week stays in one CouchDB partition. Team coverage does not."
|
|
1293
|
+
showKindSubtitles: true
|
|
1294
|
+
groupAccent: true
|
|
1295
|
+
}
|
|
1296
|
+
layout {
|
|
1297
|
+
direction: LR
|
|
1298
|
+
arrange: row
|
|
1299
|
+
align: start
|
|
1300
|
+
gap: 36
|
|
1301
|
+
density: compact
|
|
1302
|
+
groupLayout: compound
|
|
1303
|
+
nodePlacement: basic
|
|
1304
|
+
considerModelOrder: true
|
|
1305
|
+
edgeNodeSpacing: 28
|
|
1306
|
+
edgeEdgeSpacing: 16
|
|
1307
|
+
}
|
|
1308
|
+
edges {
|
|
1309
|
+
route: orthogonal
|
|
1310
|
+
crossings: gaps
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
group paths "Access paths" {
|
|
1314
|
+
arrange: stack
|
|
1315
|
+
gap: 18
|
|
1316
|
+
|
|
1317
|
+
employeeWeek: access "Employee week" {
|
|
1318
|
+
minWidth: 250
|
|
1319
|
+
on: shift
|
|
1320
|
+
scope: partition
|
|
1321
|
+
using: byEmployeeDate
|
|
1322
|
+
returns: many
|
|
1323
|
+
consistency: strong
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
teamDay: access "Team day" {
|
|
1327
|
+
minWidth: 250
|
|
1328
|
+
on: shift
|
|
1329
|
+
scope: global
|
|
1330
|
+
using: byTeamDate
|
|
1331
|
+
returns: many
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
openProfile: access "Open HR profile" {
|
|
1335
|
+
minWidth: 250
|
|
1336
|
+
on: profileDoc
|
|
1337
|
+
scope: direct
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
noOverlap: invariant "No overlapping shifts" {
|
|
1341
|
+
minWidth: 250
|
|
1342
|
+
on: shift
|
|
1343
|
+
reads: many
|
|
1344
|
+
enforcement: application
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
database schedules "schedules" {
|
|
1349
|
+
arrange: row
|
|
1350
|
+
gap: 24
|
|
1351
|
+
profile: couchdb
|
|
1352
|
+
partitioned: true
|
|
1353
|
+
audience: "schedule readers"
|
|
1354
|
+
|
|
1355
|
+
shift: document "Shift assignment" {
|
|
1356
|
+
idPattern: "{employeeId}:{shiftId}"
|
|
1357
|
+
partition: employeeId
|
|
1358
|
+
fields {
|
|
1359
|
+
employeeId: string required partition
|
|
1360
|
+
shiftId: string required
|
|
1361
|
+
teamId: string required
|
|
1362
|
+
window: object {
|
|
1363
|
+
startsAt: datetime required
|
|
1364
|
+
endsAt: datetime required
|
|
1365
|
+
}
|
|
1366
|
+
role: string required
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
group indexes "Indexes" {
|
|
1371
|
+
arrange: stack
|
|
1372
|
+
gap: 16
|
|
1373
|
+
|
|
1374
|
+
byEmployeeDate: index "By employee and start" {
|
|
1375
|
+
minWidth: 250
|
|
1376
|
+
on: shift
|
|
1377
|
+
scope: partitioned
|
|
1378
|
+
keys: ["employeeId", "startsAt"]
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
byTeamDate: index "By team and start" {
|
|
1382
|
+
minWidth: 250
|
|
1383
|
+
on: shift
|
|
1384
|
+
scope: global
|
|
1385
|
+
keys: ["teamId", "startsAt"]
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
database hr "HR profiles" {
|
|
1391
|
+
profile: couchdb
|
|
1392
|
+
partitioned: true
|
|
1393
|
+
audience: "hr staff"
|
|
1394
|
+
|
|
1395
|
+
profileDoc: document "HR profile" {
|
|
1396
|
+
idPattern: "{employeeId}:profile"
|
|
1397
|
+
partition: employeeId
|
|
1398
|
+
fields {
|
|
1399
|
+
employeeId: string required partition
|
|
1400
|
+
accommodation: string
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
`,"../../../../../examples/expense-approval.kdiagram":`kdiagram 1
|
|
1406
|
+
|
|
1407
|
+
diagram "Expense approval" {
|
|
1408
|
+
layout {
|
|
1409
|
+
density: compact
|
|
1410
|
+
considerModelOrder: true
|
|
1411
|
+
}
|
|
1412
|
+
edges {
|
|
1413
|
+
route: orthogonal
|
|
1414
|
+
crossings: gaps
|
|
1415
|
+
}
|
|
1416
|
+
presentation {
|
|
1417
|
+
title: auto
|
|
1418
|
+
titleSubtitle: "Who owns each step from submit through policy checks to approval."
|
|
1419
|
+
groupAccent: false
|
|
1420
|
+
showKindSubtitles: false
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
swimlane employee "Employee" {
|
|
1424
|
+
submit: task "Submit claim"
|
|
1425
|
+
correct: task "Correct claim" {
|
|
1426
|
+
styles: ["warning"]
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
swimlane controls "Automated controls" {
|
|
1431
|
+
validate: task "Validate policy"
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
swimlane manager "Manager" {
|
|
1435
|
+
approve: decision "Approve?"
|
|
1436
|
+
paid: task "Record payment" {
|
|
1437
|
+
styles: ["success"]
|
|
1438
|
+
}
|
|
1439
|
+
reject: task "Return for correction" {
|
|
1440
|
+
styles: ["warning"]
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
submit -> validate { priority: high }
|
|
1445
|
+
validate -> approve "valid" { priority: high }
|
|
1446
|
+
validate -> correct "needs correction"
|
|
1447
|
+
correct -> submit "resubmit"
|
|
1448
|
+
approve -> paid "yes" { priority: high }
|
|
1449
|
+
approve -> reject "no"
|
|
1450
|
+
reject -> correct
|
|
1451
|
+
|
|
1452
|
+
animation "Needs correction" {
|
|
1453
|
+
dim *
|
|
1454
|
+
activate submit
|
|
1455
|
+
wait 200ms
|
|
1456
|
+
flow submit -> validate for 500ms
|
|
1457
|
+
activate validate
|
|
1458
|
+
pulse validate for 700ms
|
|
1459
|
+
flow validate -> correct for 500ms
|
|
1460
|
+
activate correct
|
|
1461
|
+
pulse correct for 800ms
|
|
1462
|
+
flow correct -> submit for 500ms
|
|
1463
|
+
wait 400ms
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
animation "Approved" {
|
|
1467
|
+
dim *
|
|
1468
|
+
activate submit
|
|
1469
|
+
wait 200ms
|
|
1470
|
+
flow submit -> validate -> approve for 900ms
|
|
1471
|
+
activate approve
|
|
1472
|
+
pulse approve for 700ms
|
|
1473
|
+
flow approve -> paid for 500ms
|
|
1474
|
+
activate paid
|
|
1475
|
+
wait 500ms
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
`,"../../../../../examples/geometry-kinds.kdiagram":`kdiagram 1
|
|
1479
|
+
|
|
1480
|
+
diagram "Geometry kinds" {
|
|
1481
|
+
direction LR
|
|
1482
|
+
presentation {
|
|
1483
|
+
title: "Geometry kinds"
|
|
1484
|
+
titleSubtitle: "Built-in shapes and aliases — catalog only, not a system map."
|
|
1485
|
+
groupAccent: false
|
|
1486
|
+
showKindSubtitles: false
|
|
1487
|
+
}
|
|
1488
|
+
layout {
|
|
1489
|
+
density: compact
|
|
1490
|
+
spacingScale: 1
|
|
1491
|
+
considerModelOrder: true
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
group catalog {
|
|
1495
|
+
arrange: grid
|
|
1496
|
+
columns: 2
|
|
1497
|
+
align: stretch
|
|
1498
|
+
|
|
1499
|
+
group basics "Basics" {
|
|
1500
|
+
arrange: pack
|
|
1501
|
+
r: rectangle "Rect"
|
|
1502
|
+
round: rounded "Rounded"
|
|
1503
|
+
p: pill "Pill"
|
|
1504
|
+
ell: ellipse "Ellipse"
|
|
1505
|
+
cir: circle "O"
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
group flowchart "Flowchart" {
|
|
1509
|
+
arrange: pack
|
|
1510
|
+
d: diamond "Diamond"
|
|
1511
|
+
h: hexagon "Hexagon"
|
|
1512
|
+
para: parallelogram "IO"
|
|
1513
|
+
trap: trapezoid "Manual"
|
|
1514
|
+
tri: triangle "Warn"
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
group media "Media" {
|
|
1518
|
+
arrange: pack
|
|
1519
|
+
c: cylinder "Cylinder"
|
|
1520
|
+
cl: cloud "Cloud"
|
|
1521
|
+
doc: document "Doc"
|
|
1522
|
+
fold: folded-document "Note"
|
|
1523
|
+
per: person "Actor"
|
|
1524
|
+
q: queue "Q"
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
group aliases "Aliases" {
|
|
1528
|
+
arrange: pack
|
|
1529
|
+
a: diam "Alias◆"
|
|
1530
|
+
b: hex "Alias⬡"
|
|
1531
|
+
box: rect "Alias□"
|
|
1532
|
+
cap: capsule "Alias⬭"
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
`,"../../../../../examples/language-kinds-and-edges.kdiagram":`kdiagram 1
|
|
1537
|
+
|
|
1538
|
+
diagram "Language atlas — kinds and edges" {
|
|
1539
|
+
direction TD
|
|
1540
|
+
presentation {
|
|
1541
|
+
title: "Language atlas"
|
|
1542
|
+
titleSubtitle: "Kinds, content knobs, and edge operators — catalog only, not a system map."
|
|
1543
|
+
groupAccent: false
|
|
1544
|
+
showKindSubtitles: false
|
|
1545
|
+
}
|
|
1546
|
+
layout {
|
|
1547
|
+
density: compact
|
|
1548
|
+
spacingScale: 1
|
|
1549
|
+
considerModelOrder: true
|
|
1550
|
+
}
|
|
1551
|
+
edges {
|
|
1552
|
+
route: orthogonal
|
|
1553
|
+
crossings: gaps
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
group showcase {
|
|
1557
|
+
arrange: grid
|
|
1558
|
+
columns: 3
|
|
1559
|
+
align: stretch
|
|
1560
|
+
|
|
1561
|
+
group features "Content features" {
|
|
1562
|
+
arrange: pack
|
|
1563
|
+
|
|
1564
|
+
featTitle: service "Checkout" {
|
|
1565
|
+
icon: shopping-cart
|
|
1566
|
+
subtitle: "Authored caption"
|
|
1567
|
+
note: "note: footnote"
|
|
1568
|
+
scale: 1.15
|
|
1569
|
+
minWidth: 160
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
featKind: service "Inventory" {
|
|
1573
|
+
icon: package
|
|
1574
|
+
subtitle: true
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
featShape: service "Payments" {
|
|
1578
|
+
shape: hexagon
|
|
1579
|
+
icon: credit-card
|
|
1580
|
+
subtitle: "shape: hexagon"
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
featBrand: external "Stripe" {
|
|
1584
|
+
icon: "simple-icons:stripe"
|
|
1585
|
+
iconPaint: brand
|
|
1586
|
+
subtitle: "iconPaint: brand"
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
featPlain: service "Silent" {
|
|
1590
|
+
icon: none
|
|
1591
|
+
note: "icon: none"
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
featPerson: person "Operator" { subtitle: true }
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
group edges "Edge treatments" {
|
|
1598
|
+
arrange: grid
|
|
1599
|
+
columns: 2
|
|
1600
|
+
|
|
1601
|
+
group syncEdge "Sync ->" {
|
|
1602
|
+
arrange: pack
|
|
1603
|
+
syncA: service "Caller" { icon: waypoints }
|
|
1604
|
+
syncB: service "Callee" { icon: box }
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
group eventEdge "Async =>" {
|
|
1608
|
+
arrange: pack
|
|
1609
|
+
eventA: service "Publisher" { icon: megaphone }
|
|
1610
|
+
eventB: broker "Bus" { icon: radio-tower }
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
group eventualEdge "Eventual ~>" {
|
|
1614
|
+
arrange: pack
|
|
1615
|
+
evA: service "Writer" { icon: pencil }
|
|
1616
|
+
evB: service "Reader" { icon: book-open }
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
group assocEdge "Association --" {
|
|
1620
|
+
arrange: pack
|
|
1621
|
+
asA: service "Peer A" { icon: box }
|
|
1622
|
+
asB: service "Peer B" { icon: box }
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
group reverseEdge "Reverse <-" {
|
|
1626
|
+
arrange: pack
|
|
1627
|
+
revA: service "Sink" { icon: inbox }
|
|
1628
|
+
revB: service "Source" { icon: send }
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
group biEdge "Bidirectional <->" {
|
|
1632
|
+
arrange: pack
|
|
1633
|
+
biA: service "Left" { icon: arrow-left-right }
|
|
1634
|
+
biB: service "Right" { icon: arrow-left-right }
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
group softEdge "Soft ..>" {
|
|
1638
|
+
arrange: pack
|
|
1639
|
+
softA: service "Reader" { icon: eye }
|
|
1640
|
+
softB: cache "Cache" { icon: database }
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
group failEdge "Failure -x" {
|
|
1644
|
+
arrange: pack
|
|
1645
|
+
failA: service "Pay" { icon: credit-card }
|
|
1646
|
+
failB: failure "Declined" { icon: circle-x }
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
group yesEdge "Branch yes" {
|
|
1650
|
+
arrange: pack
|
|
1651
|
+
yesA: choice "Eligible?" { subtitle: true }
|
|
1652
|
+
yesB: success "Approve" { icon: circle-check }
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
group noEdge "Branch no" {
|
|
1656
|
+
arrange: pack
|
|
1657
|
+
noA: choice "In stock?" { subtitle: true }
|
|
1658
|
+
noB: warning "Backorder" { icon: circle-alert }
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
group hiEdge "Priority high" {
|
|
1662
|
+
arrange: pack
|
|
1663
|
+
hiA: service "Critical" {
|
|
1664
|
+
icon: zap
|
|
1665
|
+
scale: 1.1
|
|
1666
|
+
}
|
|
1667
|
+
hiB: service "Path" { icon: arrow-right }
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
group loEdge "Priority low" {
|
|
1671
|
+
arrange: pack
|
|
1672
|
+
loA: service "Background" { icon: moon }
|
|
1673
|
+
loB: service "Job" { icon: cog }
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
group architecture "Architecture" {
|
|
1678
|
+
arrange: pack
|
|
1679
|
+
|
|
1680
|
+
customer: user "Customer" { subtitle: true }
|
|
1681
|
+
actor1: actor "Clerk" { subtitle: true }
|
|
1682
|
+
personN: person "Operator" { subtitle: true }
|
|
1683
|
+
api: gateway "API Gateway" {
|
|
1684
|
+
icon: waypoints
|
|
1685
|
+
subtitle: true
|
|
1686
|
+
}
|
|
1687
|
+
checkout: service "Checkout" {
|
|
1688
|
+
icon: shopping-cart
|
|
1689
|
+
subtitle: true
|
|
1690
|
+
}
|
|
1691
|
+
app: application "Storefront" {
|
|
1692
|
+
icon: layout-template
|
|
1693
|
+
subtitle: true
|
|
1694
|
+
}
|
|
1695
|
+
box: container "App container" {
|
|
1696
|
+
icon: box
|
|
1697
|
+
subtitle: true
|
|
1698
|
+
}
|
|
1699
|
+
part: component "Pricing" {
|
|
1700
|
+
icon: puzzle
|
|
1701
|
+
subtitle: true
|
|
1702
|
+
}
|
|
1703
|
+
sys: system "Commerce" {
|
|
1704
|
+
icon: network
|
|
1705
|
+
subtitle: true
|
|
1706
|
+
}
|
|
1707
|
+
deploy: deployment "k8s" {
|
|
1708
|
+
icon: cloud
|
|
1709
|
+
subtitle: true
|
|
1710
|
+
}
|
|
1711
|
+
host: server "Node pool" {
|
|
1712
|
+
icon: server
|
|
1713
|
+
subtitle: true
|
|
1714
|
+
}
|
|
1715
|
+
mod: module "Tax" {
|
|
1716
|
+
icon: blocks
|
|
1717
|
+
subtitle: true
|
|
1718
|
+
}
|
|
1719
|
+
pkg: package "billing" {
|
|
1720
|
+
icon: package
|
|
1721
|
+
subtitle: true
|
|
1722
|
+
}
|
|
1723
|
+
stripe: external "Stripe" {
|
|
1724
|
+
icon: "simple-icons:stripe"
|
|
1725
|
+
iconPaint: brand
|
|
1726
|
+
subtitle: true
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
group infrastructure "Infrastructure" {
|
|
1731
|
+
arrange: pack
|
|
1732
|
+
|
|
1733
|
+
ordersDb: database "Orders DB" {
|
|
1734
|
+
icon: database
|
|
1735
|
+
subtitle: true
|
|
1736
|
+
}
|
|
1737
|
+
sessions: cache "Sessions" {
|
|
1738
|
+
icon: database
|
|
1739
|
+
subtitle: true
|
|
1740
|
+
}
|
|
1741
|
+
storeN: store "Warehouse" {
|
|
1742
|
+
icon: warehouse
|
|
1743
|
+
subtitle: true
|
|
1744
|
+
}
|
|
1745
|
+
bucketN: bucket "Receipts" {
|
|
1746
|
+
icon: archive
|
|
1747
|
+
subtitle: true
|
|
1748
|
+
}
|
|
1749
|
+
lb: loadbalancer "Edge LB" {
|
|
1750
|
+
icon: scale
|
|
1751
|
+
subtitle: true
|
|
1752
|
+
}
|
|
1753
|
+
cloudN: cloud "Cloud" {
|
|
1754
|
+
icon: cloud
|
|
1755
|
+
subtitle: true
|
|
1756
|
+
}
|
|
1757
|
+
fw: firewall "WAF" {
|
|
1758
|
+
icon: shield
|
|
1759
|
+
subtitle: true
|
|
1760
|
+
}
|
|
1761
|
+
zoneN: zone "DMZ" { subtitle: true }
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
group messaging "Messaging" {
|
|
1765
|
+
arrange: pack
|
|
1766
|
+
|
|
1767
|
+
bus: broker "Event bus" {
|
|
1768
|
+
icon: radio-tower
|
|
1769
|
+
subtitle: true
|
|
1770
|
+
}
|
|
1771
|
+
jobs: queue "jobs" {
|
|
1772
|
+
icon: list-ordered
|
|
1773
|
+
subtitle: true
|
|
1774
|
+
}
|
|
1775
|
+
topicN: topic "orders" {
|
|
1776
|
+
icon: radio
|
|
1777
|
+
subtitle: true
|
|
1778
|
+
}
|
|
1779
|
+
streamN: stream "checkout.v1" {
|
|
1780
|
+
icon: waves
|
|
1781
|
+
subtitle: true
|
|
1782
|
+
}
|
|
1783
|
+
placed: event "OrderPlaced" {
|
|
1784
|
+
icon: sparkles
|
|
1785
|
+
subtitle: true
|
|
1786
|
+
}
|
|
1787
|
+
cmd: command "PlaceOrder" {
|
|
1788
|
+
icon: terminal
|
|
1789
|
+
subtitle: true
|
|
1790
|
+
}
|
|
1791
|
+
msg: message "Payload" {
|
|
1792
|
+
icon: mail
|
|
1793
|
+
subtitle: true
|
|
1794
|
+
}
|
|
1795
|
+
fulfill: worker "Fulfillment" {
|
|
1796
|
+
icon: cog
|
|
1797
|
+
subtitle: true
|
|
1798
|
+
}
|
|
1799
|
+
prod: producer "Publisher" {
|
|
1800
|
+
icon: upload
|
|
1801
|
+
subtitle: true
|
|
1802
|
+
}
|
|
1803
|
+
cons: consumer "Subscriber" {
|
|
1804
|
+
icon: download
|
|
1805
|
+
subtitle: true
|
|
1806
|
+
}
|
|
1807
|
+
dead: dlq "orders.dlq" {
|
|
1808
|
+
icon: circle-alert
|
|
1809
|
+
subtitle: true
|
|
1810
|
+
}
|
|
1811
|
+
jobN: job "Nightly" {
|
|
1812
|
+
icon: clock
|
|
1813
|
+
subtitle: true
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
group flowchart "Flowchart" {
|
|
1818
|
+
arrange: pack
|
|
1819
|
+
|
|
1820
|
+
startN: start "Begin" { subtitle: true }
|
|
1821
|
+
endN: end "Done" { subtitle: true }
|
|
1822
|
+
step: process "Reserve stock" {
|
|
1823
|
+
icon: list-checks
|
|
1824
|
+
subtitle: true
|
|
1825
|
+
}
|
|
1826
|
+
work: task "Pick" {
|
|
1827
|
+
icon: check-square
|
|
1828
|
+
subtitle: true
|
|
1829
|
+
}
|
|
1830
|
+
sub: subprocess "Ship" {
|
|
1831
|
+
icon: git-branch
|
|
1832
|
+
subtitle: true
|
|
1833
|
+
}
|
|
1834
|
+
stocked: choice "In stock?" { subtitle: true }
|
|
1835
|
+
decide: decision "Approve?" { subtitle: true }
|
|
1836
|
+
prep: preparation "Prep" {
|
|
1837
|
+
icon: wrench
|
|
1838
|
+
subtitle: true
|
|
1839
|
+
}
|
|
1840
|
+
manualN: manual "Review" {
|
|
1841
|
+
icon: hand
|
|
1842
|
+
subtitle: true
|
|
1843
|
+
}
|
|
1844
|
+
ioN: io "Scan" {
|
|
1845
|
+
icon: scan-line
|
|
1846
|
+
subtitle: true
|
|
1847
|
+
}
|
|
1848
|
+
docN: document "Invoice" {
|
|
1849
|
+
icon: file-text
|
|
1850
|
+
subtitle: true
|
|
1851
|
+
}
|
|
1852
|
+
noteN: note "Ops note" {
|
|
1853
|
+
icon: sticky-note
|
|
1854
|
+
subtitle: true
|
|
1855
|
+
}
|
|
1856
|
+
conn: connector "A" { subtitle: true }
|
|
1857
|
+
confirmed: success "Confirmed" {
|
|
1858
|
+
icon: circle-check
|
|
1859
|
+
subtitle: true
|
|
1860
|
+
}
|
|
1861
|
+
denied: warning "Unavailable" {
|
|
1862
|
+
icon: circle-alert
|
|
1863
|
+
subtitle: true
|
|
1864
|
+
}
|
|
1865
|
+
failN: failure "Failed" {
|
|
1866
|
+
icon: circle-x
|
|
1867
|
+
subtitle: true
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
group modeling "Modeling" {
|
|
1872
|
+
arrange: pack
|
|
1873
|
+
|
|
1874
|
+
orders: table "orders" {
|
|
1875
|
+
subtitle: "ERD card"
|
|
1876
|
+
columns {
|
|
1877
|
+
id: uuid PK
|
|
1878
|
+
status: text NN // lifecycle
|
|
1879
|
+
total: numeric
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
product: entity "Product" {
|
|
1883
|
+
icon: tag
|
|
1884
|
+
subtitle: true
|
|
1885
|
+
}
|
|
1886
|
+
cls: class "Order" {
|
|
1887
|
+
icon: layers
|
|
1888
|
+
subtitle: true
|
|
1889
|
+
}
|
|
1890
|
+
iface: interface "Pricer" {
|
|
1891
|
+
icon: plug
|
|
1892
|
+
subtitle: true
|
|
1893
|
+
}
|
|
1894
|
+
agg: aggregate "Cart" {
|
|
1895
|
+
icon: shopping-basket
|
|
1896
|
+
subtitle: true
|
|
1897
|
+
}
|
|
1898
|
+
proj: projection "OrderView" {
|
|
1899
|
+
icon: eye
|
|
1900
|
+
subtitle: true
|
|
1901
|
+
}
|
|
1902
|
+
pol: policy "RefundPolicy" {
|
|
1903
|
+
icon: scroll-text
|
|
1904
|
+
subtitle: true
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
group stateGit "State & git" {
|
|
1909
|
+
arrange: pack
|
|
1910
|
+
|
|
1911
|
+
st: state "Pending" { subtitle: true }
|
|
1912
|
+
ini: initial "I"
|
|
1913
|
+
fin: final "F"
|
|
1914
|
+
jct: junction "J"
|
|
1915
|
+
forkN: fork "Fork" { subtitle: true }
|
|
1916
|
+
joinN: join "Join" { subtitle: true }
|
|
1917
|
+
commitN: commit "c"
|
|
1918
|
+
branchN: branch "main" { subtitle: true }
|
|
1919
|
+
tagN: tag "v1" { subtitle: true }
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
group general "General" {
|
|
1923
|
+
arrange: pack
|
|
1924
|
+
|
|
1925
|
+
iconN: icon "Mark" {
|
|
1926
|
+
icon: star
|
|
1927
|
+
subtitle: true
|
|
1928
|
+
}
|
|
1929
|
+
labelN: label "Tag" { subtitle: true }
|
|
1930
|
+
img: image "Logo" {
|
|
1931
|
+
icon: image
|
|
1932
|
+
subtitle: true
|
|
1933
|
+
}
|
|
1934
|
+
grp: group "Bundle" {
|
|
1935
|
+
icon: folders
|
|
1936
|
+
subtitle: true
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
featTitle -> featKind
|
|
1942
|
+
featKind -> featShape
|
|
1943
|
+
|
|
1944
|
+
syncA -> syncB "sync ->" { priority: high }
|
|
1945
|
+
eventA => eventB "async =>"
|
|
1946
|
+
evA ~> evB "eventual ~>"
|
|
1947
|
+
asA -- asB "association"
|
|
1948
|
+
revB <- revA "reverse <-"
|
|
1949
|
+
biA <-> biB "bidirectional"
|
|
1950
|
+
softA ..> softB "dependency ..>"
|
|
1951
|
+
failA -x failB "failure -x"
|
|
1952
|
+
yesA -> yesB "yes" { branch: yes }
|
|
1953
|
+
noA -> noB "no" { branch: no }
|
|
1954
|
+
hiA -> hiB "priority: high" { priority: high }
|
|
1955
|
+
loA -> loB "priority: low" { priority: low }
|
|
1956
|
+
}
|
|
1957
|
+
`,"../../../../../examples/order-aggregate.kdiagram":`kdiagram 1
|
|
1958
|
+
|
|
1959
|
+
diagram "Order aggregate" {
|
|
1960
|
+
layout {
|
|
1961
|
+
direction: LR
|
|
1962
|
+
density: compact
|
|
1963
|
+
considerModelOrder: true
|
|
1964
|
+
groupLayout: compound
|
|
1965
|
+
}
|
|
1966
|
+
edges {
|
|
1967
|
+
route: orthogonal
|
|
1968
|
+
crossings: gaps
|
|
1969
|
+
}
|
|
1970
|
+
presentation {
|
|
1971
|
+
title: auto
|
|
1972
|
+
titleSubtitle: "What the Order aggregate protects in one transaction — not ports and adapters."
|
|
1973
|
+
groupAccent: true
|
|
1974
|
+
showKindSubtitles: true
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
placeOrder: command "PlaceOrder"
|
|
1978
|
+
|
|
1979
|
+
boundary orderAgg "Order aggregate" {
|
|
1980
|
+
arrange: stack
|
|
1981
|
+
order: aggregate "Order" {
|
|
1982
|
+
description: "Root. Owns status, totals, and the outbox record."
|
|
1983
|
+
}
|
|
1984
|
+
line: component "Order line" {
|
|
1985
|
+
description: "Quantity and product snapshot. Cannot persist alone."
|
|
1986
|
+
subtitle: "Entity"
|
|
1987
|
+
}
|
|
1988
|
+
money: component "Money" {
|
|
1989
|
+
description: "Amount plus currency."
|
|
1990
|
+
subtitle: "Value object"
|
|
1991
|
+
styles: ["muted"]
|
|
1992
|
+
}
|
|
1993
|
+
invariant: policy "Lines must share the order currency"
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
placed: event "OrderPlaced" {
|
|
1997
|
+
styles: ["info"]
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
placeOrder -> order { priority: high }
|
|
2001
|
+
order -> line "contains"
|
|
2002
|
+
line -> money "priced as"
|
|
2003
|
+
order -> invariant
|
|
2004
|
+
order -> placed { priority: high }
|
|
2005
|
+
|
|
2006
|
+
animation "PlaceOrder" {
|
|
2007
|
+
dim *
|
|
2008
|
+
activate placeOrder
|
|
2009
|
+
wait 200ms
|
|
2010
|
+
flow placeOrder -> order for 500ms
|
|
2011
|
+
activate order
|
|
2012
|
+
pulse order for 800ms
|
|
2013
|
+
flow order -> line for 400ms
|
|
2014
|
+
activate line
|
|
2015
|
+
flow order -> invariant for 400ms
|
|
2016
|
+
activate invariant
|
|
2017
|
+
pulse invariant for 700ms
|
|
2018
|
+
flow order -> placed for 500ms
|
|
2019
|
+
activate placed
|
|
2020
|
+
wait 500ms
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
`,"../../../../../examples/order-event-storm.kdiagram":`kdiagram 1
|
|
2024
|
+
|
|
2025
|
+
diagram "Order domain — event storm" {
|
|
2026
|
+
layout {
|
|
2027
|
+
direction: LR
|
|
2028
|
+
density: compact
|
|
2029
|
+
considerModelOrder: true
|
|
2030
|
+
arrange: row
|
|
2031
|
+
align: stretch
|
|
2032
|
+
}
|
|
2033
|
+
edges {
|
|
2034
|
+
route: orthogonal
|
|
2035
|
+
crossings: gaps
|
|
2036
|
+
}
|
|
2037
|
+
presentation {
|
|
2038
|
+
title: auto
|
|
2039
|
+
titleSubtitle: "Discovery timeline from catalog browse through payment to fulfillment."
|
|
2040
|
+
groupAccent: false
|
|
2041
|
+
showKindSubtitles: true
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
group browse "Browse" {
|
|
2045
|
+
arrange: stack
|
|
2046
|
+
shopper: person "Shopper"
|
|
2047
|
+
browseCatalog: command "Browse catalog"
|
|
2048
|
+
catalogShown: event "CatalogShown" {
|
|
2049
|
+
styles: ["info"]
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
group checkout "Checkout" {
|
|
2054
|
+
arrange: stack
|
|
2055
|
+
placeOrder: command "Place order"
|
|
2056
|
+
order: aggregate "Order"
|
|
2057
|
+
paymentPolicy: policy "Must authorize before confirm"
|
|
2058
|
+
paymentAuthorized: event "PaymentAuthorized" {
|
|
2059
|
+
styles: ["success"]
|
|
2060
|
+
}
|
|
2061
|
+
orderPlaced: event "OrderPlaced" {
|
|
2062
|
+
styles: ["info"]
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
group fulfill "Fulfill" {
|
|
2067
|
+
arrange: stack
|
|
2068
|
+
reserveStock: command "Reserve stock"
|
|
2069
|
+
stockReserved: event "StockReserved"
|
|
2070
|
+
pickReleased: event "PickReleased"
|
|
2071
|
+
outOfStock: event "ReservationFailed" {
|
|
2072
|
+
styles: ["warning"]
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
shopper -> browseCatalog
|
|
2077
|
+
browseCatalog -> catalogShown
|
|
2078
|
+
catalogShown -> placeOrder
|
|
2079
|
+
placeOrder -> order
|
|
2080
|
+
order -> paymentPolicy
|
|
2081
|
+
paymentPolicy -> paymentAuthorized "authorized"
|
|
2082
|
+
paymentAuthorized -> orderPlaced
|
|
2083
|
+
orderPlaced -> reserveStock
|
|
2084
|
+
reserveStock -> stockReserved
|
|
2085
|
+
stockReserved -> pickReleased
|
|
2086
|
+
reserveStock -> outOfStock "no stock"
|
|
2087
|
+
|
|
2088
|
+
animation "Place order" {
|
|
2089
|
+
dim *
|
|
2090
|
+
activate shopper
|
|
2091
|
+
wait 200ms
|
|
2092
|
+
flow shopper -> browseCatalog -> catalogShown -> placeOrder for 1s
|
|
2093
|
+
activate placeOrder
|
|
2094
|
+
flow placeOrder -> order for 400ms
|
|
2095
|
+
activate order
|
|
2096
|
+
pulse order for 600ms
|
|
2097
|
+
flow order -> paymentPolicy -> paymentAuthorized -> orderPlaced for 900ms
|
|
2098
|
+
activate orderPlaced
|
|
2099
|
+
pulse orderPlaced for 800ms
|
|
2100
|
+
wait 400ms
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
`,"../../../../../examples/order-fulfillment-sequence.kdiagram":`kdiagram 1
|
|
2104
|
+
|
|
2105
|
+
sequence "Order fulfillment — interaction" {
|
|
2106
|
+
autonumber
|
|
2107
|
+
|
|
2108
|
+
presentation {
|
|
2109
|
+
title: auto
|
|
2110
|
+
titleSubtitle: "Checkout through outbox publish and fan-out; DLQ after retry limit."
|
|
2111
|
+
groupAccent: false
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
customer: person "Customer" { icon: user }
|
|
2115
|
+
checkoutApi: gateway "Checkout API" { icon: waypoints }
|
|
2116
|
+
orders: service "Orders" { icon: receipt }
|
|
2117
|
+
stripe: external "Stripe" { icon: "simple-icons:stripe" }
|
|
2118
|
+
orderDb: database "Orders DB" { icon: database }
|
|
2119
|
+
outboxRelay: worker "Outbox" { icon: send }
|
|
2120
|
+
orderEvents: topic "orders.v1" { icon: radio-tower }
|
|
2121
|
+
inventory: service "Inventory" { icon: warehouse }
|
|
2122
|
+
warehouse: external "Warehouse" { icon: package-open }
|
|
2123
|
+
notifications: consumer "Notify" { icon: mail }
|
|
2124
|
+
deadLetters: dlq "DLQ" { styles: ["warning"] }
|
|
2125
|
+
|
|
2126
|
+
customer -> checkoutApi "POST /orders"
|
|
2127
|
+
checkoutApi -> orders "PlaceOrder"
|
|
2128
|
+
activate orders
|
|
2129
|
+
orders -> stripe "authorizes"
|
|
2130
|
+
stripe --> orders "ok"
|
|
2131
|
+
orders -> orderDb "commit + outbox"
|
|
2132
|
+
deactivate orders
|
|
2133
|
+
|
|
2134
|
+
outboxRelay -> orderDb "reads"
|
|
2135
|
+
outboxRelay => orderEvents "OrderPlaced"
|
|
2136
|
+
|
|
2137
|
+
parallel "Inventory" is info {
|
|
2138
|
+
orderEvents => inventory "OrderPlaced"
|
|
2139
|
+
activate inventory
|
|
2140
|
+
inventory -> warehouse "pick"
|
|
2141
|
+
warehouse --> inventory "accepted"
|
|
2142
|
+
deactivate inventory
|
|
2143
|
+
} and "Notify" is info {
|
|
2144
|
+
orderEvents => notifications "OrderPlaced"
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
divider "Retries exhausted"
|
|
2148
|
+
orderEvents => deadLetters "after retries"
|
|
2149
|
+
|
|
2150
|
+
animation "Order accepted" {
|
|
2151
|
+
dim *
|
|
2152
|
+
activate customer
|
|
2153
|
+
flow customer -> checkoutApi -> orders for 800ms
|
|
2154
|
+
activate orders
|
|
2155
|
+
flow orders -> stripe for 450ms
|
|
2156
|
+
flow orders -> orderDb for 450ms
|
|
2157
|
+
activate outboxRelay
|
|
2158
|
+
flow outboxRelay -> orderDb for 400ms
|
|
2159
|
+
flow outboxRelay -> orderEvents for 550ms
|
|
2160
|
+
pulse orderEvents for 350ms
|
|
2161
|
+
parallel {
|
|
2162
|
+
flow orderEvents -> inventory for 550ms
|
|
2163
|
+
flow orderEvents -> notifications for 550ms
|
|
2164
|
+
}
|
|
2165
|
+
flow inventory -> warehouse for 450ms
|
|
2166
|
+
wait 700ms
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
animation "Delivery retries exhausted" {
|
|
2170
|
+
dim *
|
|
2171
|
+
activate outboxRelay
|
|
2172
|
+
flow outboxRelay -> orderEvents for 550ms
|
|
2173
|
+
pulse orderEvents for 350ms
|
|
2174
|
+
flow orderEvents -> deadLetters for 600ms
|
|
2175
|
+
pulse deadLetters for 800ms
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
`,"../../../../../examples/order-fulfillment.kdiagram":`kdiagram 1
|
|
2179
|
+
|
|
2180
|
+
diagram "Order fulfillment — from checkout to warehouse" {
|
|
2181
|
+
layout {
|
|
2182
|
+
direction: LR
|
|
2183
|
+
density: compact
|
|
2184
|
+
spacingScale: 1
|
|
2185
|
+
groupLayout: compound
|
|
2186
|
+
considerModelOrder: true
|
|
2187
|
+
}
|
|
2188
|
+
edges {
|
|
2189
|
+
route: metro
|
|
2190
|
+
crossings: gaps
|
|
2191
|
+
}
|
|
2192
|
+
presentation {
|
|
2193
|
+
title: auto
|
|
2194
|
+
titleSubtitle: "Checkout commits through an outbox; inventory and notifications continue from orders.v1."
|
|
2195
|
+
groupAccent: false
|
|
2196
|
+
showKindSubtitles: false
|
|
2197
|
+
clampLabels: true
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
group composition {
|
|
2201
|
+
chrome: false
|
|
2202
|
+
arrange: grid
|
|
2203
|
+
columns: 3
|
|
2204
|
+
rows: 2
|
|
2205
|
+
align: stretch
|
|
2206
|
+
|
|
2207
|
+
group entryPath {
|
|
2208
|
+
chrome: false
|
|
2209
|
+
column: 1
|
|
2210
|
+
row: 1
|
|
2211
|
+
arrange: stack
|
|
2212
|
+
|
|
2213
|
+
customer: user "Customer" { icon: user }
|
|
2214
|
+
|
|
2215
|
+
group experience "Digital experience" {
|
|
2216
|
+
arrange: stack
|
|
2217
|
+
storefront: application "Web storefront" { icon: shopping-cart }
|
|
2218
|
+
checkoutApi: gateway "Checkout API" { icon: waypoints }
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
group orderingStage {
|
|
2223
|
+
chrome: false
|
|
2224
|
+
column: 1
|
|
2225
|
+
row: 2
|
|
2226
|
+
arrange: row
|
|
2227
|
+
|
|
2228
|
+
group ordering "Ordering" {
|
|
2229
|
+
arrange: stack
|
|
2230
|
+
orders: service "Order service" {
|
|
2231
|
+
icon: receipt
|
|
2232
|
+
styles: ["info"]
|
|
2233
|
+
}
|
|
2234
|
+
orderDb: database "Orders DB" {
|
|
2235
|
+
subtitle: "Orders + outbox"
|
|
2236
|
+
icon: database
|
|
2237
|
+
}
|
|
2238
|
+
outboxRelay: worker "Outbox relay" { icon: send }
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
stripe: external "Stripe" {
|
|
2242
|
+
icon: "simple-icons:stripe"
|
|
2243
|
+
iconPaint: brand
|
|
2244
|
+
styles: ["muted"]
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
group backbone "Events" {
|
|
2249
|
+
column: 2
|
|
2250
|
+
row: 2
|
|
2251
|
+
arrange: row
|
|
2252
|
+
orderEvents: topic "orders.v1" {
|
|
2253
|
+
icon: radio-tower
|
|
2254
|
+
styles: ["info"]
|
|
2255
|
+
}
|
|
2256
|
+
deadLetters: dlq "DLQ" { styles: ["warning"] }
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
group fulfillmentStage {
|
|
2260
|
+
chrome: false
|
|
2261
|
+
column: 3
|
|
2262
|
+
row: 2
|
|
2263
|
+
arrange: row
|
|
2264
|
+
|
|
2265
|
+
group fulfillment "Fulfillment" {
|
|
2266
|
+
arrange: stack
|
|
2267
|
+
inventory: service "Inventory service" { icon: warehouse }
|
|
2268
|
+
inventoryDb: database "Inventory DB" { icon: database }
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
warehouse: external "Warehouse" { icon: package-open }
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
group communicationsStage {
|
|
2275
|
+
chrome: false
|
|
2276
|
+
column: 3
|
|
2277
|
+
row: 1
|
|
2278
|
+
arrange: row
|
|
2279
|
+
|
|
2280
|
+
group communications "Communications" {
|
|
2281
|
+
arrange: stack
|
|
2282
|
+
notifications: consumer "Notification worker" { icon: mail }
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
emailProvider: external "Email provider" {
|
|
2286
|
+
icon: mail-check
|
|
2287
|
+
styles: ["muted"]
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
customer -> storefront "checks out" { priority: high }
|
|
2293
|
+
storefront -> checkoutApi "POST /orders" { priority: high }
|
|
2294
|
+
checkoutApi -> orders "PlaceOrder" { priority: high }
|
|
2295
|
+
orders -> stripe "authorizes" { priority: high }
|
|
2296
|
+
orders -> orderDb "commits + outbox" { priority: high }
|
|
2297
|
+
outboxRelay -> orderDb "reads outbox"
|
|
2298
|
+
outboxRelay => orderEvents "publishes OrderPlaced" { priority: high }
|
|
2299
|
+
orderEvents => inventory "OrderPlaced" { priority: high }
|
|
2300
|
+
inventory -> inventoryDb "reserves"
|
|
2301
|
+
inventory -> warehouse "releases pick"
|
|
2302
|
+
orderEvents => notifications "OrderPlaced" { priority: high }
|
|
2303
|
+
notifications -> emailProvider "confirms"
|
|
2304
|
+
orderEvents => deadLetters "after retries" { styles: ["warning"] }
|
|
2305
|
+
|
|
2306
|
+
animation "Order accepted" {
|
|
2307
|
+
dim *
|
|
2308
|
+
activate customer
|
|
2309
|
+
flow customer -> storefront -> checkoutApi -> orders for 600ms
|
|
2310
|
+
pulse orders for 500ms
|
|
2311
|
+
flow orders -> stripe for 500ms
|
|
2312
|
+
flow orders -> orderDb for 500ms
|
|
2313
|
+
activate outboxRelay
|
|
2314
|
+
flow outboxRelay -> orderDb for 400ms
|
|
2315
|
+
flow outboxRelay -> orderEvents for 600ms
|
|
2316
|
+
pulse orderEvents for 400ms
|
|
2317
|
+
parallel {
|
|
2318
|
+
flow orderEvents -> inventory for 600ms
|
|
2319
|
+
flow orderEvents -> notifications for 600ms
|
|
2320
|
+
}
|
|
2321
|
+
parallel {
|
|
2322
|
+
flow inventory -> inventoryDb for 500ms
|
|
2323
|
+
flow notifications -> emailProvider for 500ms
|
|
2324
|
+
}
|
|
2325
|
+
flow inventory -> warehouse for 500ms
|
|
2326
|
+
wait 800ms
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
animation "Delivery retries exhausted" {
|
|
2330
|
+
dim *
|
|
2331
|
+
activate outboxRelay
|
|
2332
|
+
flow outboxRelay -> orderEvents for 600ms
|
|
2333
|
+
pulse orderEvents for 400ms
|
|
2334
|
+
flow orderEvents -> deadLetters for 600ms
|
|
2335
|
+
pulse deadLetters for 800ms
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
`,"../../../../../examples/order-hexagon.kdiagram":`diagram "Order service — ports and adapters" {
|
|
2339
|
+
density spacious
|
|
2340
|
+
presentation { groupAccent: true }
|
|
2341
|
+
edges {
|
|
2342
|
+
route: bezier
|
|
2343
|
+
crossings: gaps
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
group composition {
|
|
2347
|
+
chrome: false
|
|
2348
|
+
arrange: row
|
|
2349
|
+
align: center
|
|
2350
|
+
|
|
2351
|
+
group input "" {
|
|
2352
|
+
chrome: false
|
|
2353
|
+
|
|
2354
|
+
httpClient: service "HTTP Client" { icon: service }
|
|
2355
|
+
externalTrigger: rect "External Trigger" { icon: service }
|
|
2356
|
+
messageBroker: rect "Message Broker" { icon: queue }
|
|
2357
|
+
user: actor "User" { icon: user }
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
group app "" {
|
|
2361
|
+
chrome: true
|
|
2362
|
+
arrange: row
|
|
2363
|
+
shape: hexagon
|
|
2364
|
+
|
|
2365
|
+
group driving "Driving / User Interface" {
|
|
2366
|
+
chrome: false
|
|
2367
|
+
arrange: stack
|
|
2368
|
+
httpAdapter: component "OrderHttpAdapter" {
|
|
2369
|
+
subtitle: Driving
|
|
2370
|
+
icon: waypoints
|
|
2371
|
+
}
|
|
2372
|
+
graphqlAdapter: component "OrderGraphqlAdapter" {
|
|
2373
|
+
subtitle: Driving
|
|
2374
|
+
icon: share-2
|
|
2375
|
+
}
|
|
2376
|
+
stripeWebhook: component "StripeWebhookAdapter" {
|
|
2377
|
+
subtitle: Driving
|
|
2378
|
+
icon: "simple-icons:stripe"
|
|
2379
|
+
iconPaint: brand
|
|
2380
|
+
}
|
|
2381
|
+
kafkaAdapter: component "OrderKafkaAdapter" {
|
|
2382
|
+
subtitle: Driving
|
|
2383
|
+
icon: radio-tower
|
|
2384
|
+
}
|
|
2385
|
+
cliAdapter: component "OrderCliAdapter" {
|
|
2386
|
+
subtitle: Test
|
|
2387
|
+
icon: terminal
|
|
2388
|
+
styles: ["muted"]
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
group appLayer "" {
|
|
2393
|
+
shape: hexagon
|
|
2394
|
+
arrange: surround
|
|
2395
|
+
|
|
2396
|
+
group stack "" {
|
|
2397
|
+
arrange: stack
|
|
2398
|
+
shape: hexagon
|
|
2399
|
+
useCase: component "CreateOrderHandler" {
|
|
2400
|
+
subtitle: "Application Use Case"
|
|
2401
|
+
icon: receipt
|
|
2402
|
+
styles: ["info"]
|
|
2403
|
+
}
|
|
2404
|
+
group domain "Domain" {
|
|
2405
|
+
order: aggregate "Order" {
|
|
2406
|
+
subtitle: Domain
|
|
2407
|
+
icon: package
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
createOrder: interface "CreateOrderCommand" {
|
|
2413
|
+
subtitle: "Inbound Port"
|
|
2414
|
+
side: west
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
eventsPort: interface "EventPublishPort" {
|
|
2418
|
+
subtitle: "Outbound Port"
|
|
2419
|
+
side: east
|
|
2420
|
+
}
|
|
2421
|
+
orderRepo: interface "OrderRepositoryPort" {
|
|
2422
|
+
subtitle: "Outbound Port"
|
|
2423
|
+
side: east
|
|
2424
|
+
}
|
|
2425
|
+
paymentsPort: interface "PaymentPort" {
|
|
2426
|
+
subtitle: "Outbound Port"
|
|
2427
|
+
side: east
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
group driven "Driven / Infra" {
|
|
2432
|
+
chrome: false
|
|
2433
|
+
arrange: stack
|
|
2434
|
+
stripeClient: component "StripePaymentAdapter" {
|
|
2435
|
+
subtitle: Driven
|
|
2436
|
+
icon: "simple-icons:stripe"
|
|
2437
|
+
iconPaint: brand
|
|
2438
|
+
}
|
|
2439
|
+
postgresAdapter: component "PostgresOrderAdapter" {
|
|
2440
|
+
subtitle: Driven
|
|
2441
|
+
icon: database
|
|
2442
|
+
}
|
|
2443
|
+
inMemoryAdapter: component "InMemoryOrderAdapter" {
|
|
2444
|
+
subtitle: Test
|
|
2445
|
+
icon: boxes
|
|
2446
|
+
styles: ["muted"]
|
|
2447
|
+
}
|
|
2448
|
+
outboxPublisher: component "OutboxPublishAdapter" {
|
|
2449
|
+
subtitle: Driven
|
|
2450
|
+
icon: send
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
group output "" {
|
|
2456
|
+
chrome: false
|
|
2457
|
+
|
|
2458
|
+
stripe: external "Stripe" { styles: ["muted"] }
|
|
2459
|
+
pg: database "Database" { icon: postgres }
|
|
2460
|
+
kafka: topic "orders.v1" { icon: radio-tower }
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
httpAdapter ..> createOrder "maps to"
|
|
2465
|
+
graphqlAdapter ..> createOrder
|
|
2466
|
+
stripeWebhook ..> createOrder
|
|
2467
|
+
kafkaAdapter ..> createOrder
|
|
2468
|
+
cliAdapter ..> createOrder
|
|
2469
|
+
createOrder ..> useCase
|
|
2470
|
+
useCase ..> order "uses"
|
|
2471
|
+
useCase ..> orderRepo "depends on"
|
|
2472
|
+
useCase ..> paymentsPort "depends on"
|
|
2473
|
+
useCase ..> eventsPort "depends on"
|
|
2474
|
+
postgresAdapter ..> orderRepo "implements"
|
|
2475
|
+
inMemoryAdapter ..> orderRepo "implements"
|
|
2476
|
+
stripeClient ..> paymentsPort "implements"
|
|
2477
|
+
outboxPublisher ..> eventsPort "implements"
|
|
2478
|
+
postgresAdapter -> pg "persists"
|
|
2479
|
+
stripeClient -> stripe "authorizes"
|
|
2480
|
+
outboxPublisher => kafka "publishes"
|
|
2481
|
+
|
|
2482
|
+
httpClient -> httpAdapter
|
|
2483
|
+
httpClient <.. httpAdapter
|
|
2484
|
+
httpClient -> graphqlAdapter
|
|
2485
|
+
httpClient <.. graphqlAdapter
|
|
2486
|
+
externalTrigger -> stripeWebhook
|
|
2487
|
+
messageBroker -> kafkaAdapter
|
|
2488
|
+
user -> cliAdapter
|
|
2489
|
+
}
|
|
2490
|
+
`,"../../../../../examples/order-lifecycle.kdiagram":`kdiagram 1
|
|
2491
|
+
|
|
2492
|
+
state "Order lifecycle" {
|
|
2493
|
+
presentation {
|
|
2494
|
+
title: auto
|
|
2495
|
+
titleSubtitle: "Legal statuses after checkout. Guards are illustrative."
|
|
2496
|
+
showKindSubtitles: false
|
|
2497
|
+
}
|
|
2498
|
+
layout {
|
|
2499
|
+
direction: LR
|
|
2500
|
+
density: compact
|
|
2501
|
+
spacingScale: 1
|
|
2502
|
+
considerModelOrder: true
|
|
2503
|
+
}
|
|
2504
|
+
edges {
|
|
2505
|
+
route: orthogonal
|
|
2506
|
+
crossings: gaps
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
entry: initial
|
|
2510
|
+
placed: state "Placed" { styles: ["info"] }
|
|
2511
|
+
authorized: state "Authorized"
|
|
2512
|
+
reserved: state "Reserved"
|
|
2513
|
+
shipped: final "Shipped" { styles: ["success"] }
|
|
2514
|
+
abandoned: final "Abandoned" { styles: ["warning"] }
|
|
2515
|
+
cancelled: final "Cancelled" { styles: ["muted"] }
|
|
2516
|
+
|
|
2517
|
+
entry -> placed
|
|
2518
|
+
placed -> authorized "approved"
|
|
2519
|
+
placed -> abandoned "declined"
|
|
2520
|
+
authorized -> reserved "in stock"
|
|
2521
|
+
authorized -> cancelled "cancel"
|
|
2522
|
+
reserved -> shipped "ship"
|
|
2523
|
+
reserved -> cancelled "cancel"
|
|
2524
|
+
}
|
|
2525
|
+
`,"../../../../../examples/order-placed-events.kdiagram":`kdiagram 1
|
|
2526
|
+
|
|
2527
|
+
diagram "OrderPlaced — event consumers" {
|
|
2528
|
+
layout {
|
|
2529
|
+
direction: LR
|
|
2530
|
+
density: compact
|
|
2531
|
+
spacingScale: 1
|
|
2532
|
+
considerModelOrder: true
|
|
2533
|
+
groupLayout: compound
|
|
2534
|
+
}
|
|
2535
|
+
edges {
|
|
2536
|
+
route: metro
|
|
2537
|
+
crossings: gaps
|
|
2538
|
+
}
|
|
2539
|
+
presentation {
|
|
2540
|
+
title: auto
|
|
2541
|
+
titleSubtitle: "Outbox publish fans out to inventory and notifications; exhausted deliveries reach the DLQ."
|
|
2542
|
+
groupAccent: false
|
|
2543
|
+
showKindSubtitles: false
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
group composition {
|
|
2547
|
+
chrome: false
|
|
2548
|
+
arrange: grid
|
|
2549
|
+
columns: 3
|
|
2550
|
+
rows: 2
|
|
2551
|
+
align: stretch
|
|
2552
|
+
|
|
2553
|
+
group publish "Publish" {
|
|
2554
|
+
column: 1
|
|
2555
|
+
row: 2
|
|
2556
|
+
arrange: stack
|
|
2557
|
+
outboxRelay: worker "Outbox relay" { icon: send }
|
|
2558
|
+
orderDb: database "Orders DB" {
|
|
2559
|
+
subtitle: Outbox
|
|
2560
|
+
icon: database
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
group backbone "Events" {
|
|
2565
|
+
column: 2
|
|
2566
|
+
row: 2
|
|
2567
|
+
arrange: row
|
|
2568
|
+
orderEvents: topic "orders.v1" {
|
|
2569
|
+
icon: radio-tower
|
|
2570
|
+
styles: ["info"]
|
|
2571
|
+
}
|
|
2572
|
+
deadLetters: dlq "DLQ" { styles: ["warning"] }
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
group fulfillmentStage {
|
|
2576
|
+
chrome: false
|
|
2577
|
+
column: 3
|
|
2578
|
+
row: 2
|
|
2579
|
+
arrange: row
|
|
2580
|
+
|
|
2581
|
+
group fulfillment "Fulfillment" {
|
|
2582
|
+
arrange: stack
|
|
2583
|
+
inventory: service "Inventory service" { icon: warehouse }
|
|
2584
|
+
inventoryDb: database "Inventory DB" { icon: database }
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
warehouse: external "Warehouse" { icon: package-open }
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
group communicationsStage {
|
|
2591
|
+
chrome: false
|
|
2592
|
+
column: 3
|
|
2593
|
+
row: 1
|
|
2594
|
+
arrange: row
|
|
2595
|
+
|
|
2596
|
+
group communications "Communications" {
|
|
2597
|
+
arrange: stack
|
|
2598
|
+
notifications: consumer "Notification worker" { icon: mail }
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
emailProvider: external "Email provider" {
|
|
2602
|
+
icon: mail-check
|
|
2603
|
+
styles: ["muted"]
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
outboxRelay -> orderDb "reads outbox"
|
|
2609
|
+
outboxRelay => orderEvents "publishes OrderPlaced" { priority: high }
|
|
2610
|
+
orderEvents => inventory "OrderPlaced" { priority: high }
|
|
2611
|
+
inventory -> inventoryDb "reserves"
|
|
2612
|
+
inventory -> warehouse "releases pick"
|
|
2613
|
+
orderEvents => notifications "OrderPlaced" { priority: high }
|
|
2614
|
+
notifications -> emailProvider "confirms"
|
|
2615
|
+
orderEvents => deadLetters "after retries" { styles: ["warning"] }
|
|
2616
|
+
|
|
2617
|
+
animation "Event fan-out" {
|
|
2618
|
+
dim *
|
|
2619
|
+
activate outboxRelay
|
|
2620
|
+
flow outboxRelay -> orderDb for 400ms
|
|
2621
|
+
flow outboxRelay -> orderEvents for 600ms
|
|
2622
|
+
pulse orderEvents for 400ms
|
|
2623
|
+
parallel {
|
|
2624
|
+
flow orderEvents -> inventory for 600ms
|
|
2625
|
+
flow orderEvents -> notifications for 600ms
|
|
2626
|
+
}
|
|
2627
|
+
parallel {
|
|
2628
|
+
flow inventory -> inventoryDb for 500ms
|
|
2629
|
+
flow notifications -> emailProvider for 500ms
|
|
2630
|
+
}
|
|
2631
|
+
flow inventory -> warehouse for 500ms
|
|
2632
|
+
wait 800ms
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
animation "Delivery retries exhausted" {
|
|
2636
|
+
dim *
|
|
2637
|
+
activate outboxRelay
|
|
2638
|
+
flow outboxRelay -> orderEvents for 600ms
|
|
2639
|
+
pulse orderEvents for 400ms
|
|
2640
|
+
flow orderEvents -> deadLetters for 600ms
|
|
2641
|
+
pulse deadLetters for 800ms
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
`,"../../../../../examples/order-review-slide.kdiagram":`kdiagram 1
|
|
2645
|
+
|
|
2646
|
+
diagram "Order fulfillment — review slide" {
|
|
2647
|
+
layout {
|
|
2648
|
+
direction: LR
|
|
2649
|
+
density: compact
|
|
2650
|
+
spacingScale: 1.05
|
|
2651
|
+
groupLayout: compound
|
|
2652
|
+
considerModelOrder: true
|
|
2653
|
+
}
|
|
2654
|
+
edges {
|
|
2655
|
+
route: metro
|
|
2656
|
+
crossings: smart
|
|
2657
|
+
cornerRadius: 6
|
|
2658
|
+
}
|
|
2659
|
+
render {
|
|
2660
|
+
theme: light
|
|
2661
|
+
shadows: false
|
|
2662
|
+
roundedCorners: false
|
|
2663
|
+
}
|
|
2664
|
+
presentation {
|
|
2665
|
+
title: auto
|
|
2666
|
+
titleSubtitle: "Same topology as the fulfillment map — presentation chrome for review decks."
|
|
2667
|
+
groupAccent: false
|
|
2668
|
+
showKindSubtitles: false
|
|
2669
|
+
clampLabels: true
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
group composition {
|
|
2673
|
+
chrome: false
|
|
2674
|
+
arrange: grid
|
|
2675
|
+
columns: 3
|
|
2676
|
+
rows: 2
|
|
2677
|
+
align: stretch
|
|
2678
|
+
|
|
2679
|
+
group entryPath {
|
|
2680
|
+
chrome: false
|
|
2681
|
+
column: 1
|
|
2682
|
+
row: 1
|
|
2683
|
+
arrange: stack
|
|
2684
|
+
|
|
2685
|
+
customer: user "Customer" { icon: user }
|
|
2686
|
+
|
|
2687
|
+
group experience "Digital experience" {
|
|
2688
|
+
arrange: stack
|
|
2689
|
+
storefront: application "Web storefront" { icon: shopping-cart }
|
|
2690
|
+
checkoutApi: gateway "Checkout API" { icon: waypoints }
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
group orderingStage {
|
|
2695
|
+
chrome: false
|
|
2696
|
+
column: 1
|
|
2697
|
+
row: 2
|
|
2698
|
+
arrange: row
|
|
2699
|
+
|
|
2700
|
+
group ordering "Ordering" {
|
|
2701
|
+
arrange: stack
|
|
2702
|
+
orders: service "Order service" {
|
|
2703
|
+
icon: receipt
|
|
2704
|
+
styles: ["info"]
|
|
2705
|
+
}
|
|
2706
|
+
orderDb: database "Orders DB" {
|
|
2707
|
+
subtitle: "Orders + outbox"
|
|
2708
|
+
icon: database
|
|
2709
|
+
}
|
|
2710
|
+
outboxRelay: worker "Outbox relay" { icon: send }
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
stripe: external "Stripe" {
|
|
2714
|
+
icon: "simple-icons:stripe"
|
|
2715
|
+
iconPaint: brand
|
|
2716
|
+
styles: ["muted"]
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
group backbone "Events" {
|
|
2721
|
+
column: 2
|
|
2722
|
+
row: 2
|
|
2723
|
+
arrange: row
|
|
2724
|
+
orderEvents: topic "orders.v1" {
|
|
2725
|
+
icon: radio-tower
|
|
2726
|
+
styles: ["info"]
|
|
2727
|
+
}
|
|
2728
|
+
deadLetters: dlq "DLQ" { styles: ["warning"] }
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
group fulfillmentStage {
|
|
2732
|
+
chrome: false
|
|
2733
|
+
column: 3
|
|
2734
|
+
row: 2
|
|
2735
|
+
arrange: row
|
|
2736
|
+
|
|
2737
|
+
group fulfillment "Fulfillment" {
|
|
2738
|
+
arrange: stack
|
|
2739
|
+
inventory: service "Inventory service" { icon: warehouse }
|
|
2740
|
+
inventoryDb: database "Inventory DB" { icon: database }
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
warehouse: external "Warehouse" { icon: package-open }
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
group communicationsStage {
|
|
2747
|
+
chrome: false
|
|
2748
|
+
column: 3
|
|
2749
|
+
row: 1
|
|
2750
|
+
arrange: row
|
|
2751
|
+
|
|
2752
|
+
group communications "Communications" {
|
|
2753
|
+
arrange: stack
|
|
2754
|
+
notifications: consumer "Notification worker" { icon: mail }
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
emailProvider: external "Email provider" {
|
|
2758
|
+
icon: mail-check
|
|
2759
|
+
styles: ["muted"]
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
customer -> storefront "checks out" { priority: high }
|
|
2765
|
+
storefront -> checkoutApi "POST /orders" { priority: high }
|
|
2766
|
+
checkoutApi -> orders "PlaceOrder" { priority: high }
|
|
2767
|
+
orders -> stripe "authorizes" { priority: high }
|
|
2768
|
+
orders -> orderDb "commits + outbox" { priority: high }
|
|
2769
|
+
outboxRelay -> orderDb "reads outbox"
|
|
2770
|
+
outboxRelay => orderEvents "publishes OrderPlaced" { priority: high }
|
|
2771
|
+
orderEvents => inventory "OrderPlaced" { priority: high }
|
|
2772
|
+
inventory -> inventoryDb "reserves"
|
|
2773
|
+
inventory -> warehouse "releases pick"
|
|
2774
|
+
orderEvents => notifications "OrderPlaced" { priority: high }
|
|
2775
|
+
notifications -> emailProvider "confirms"
|
|
2776
|
+
orderEvents => deadLetters "after retries" { styles: ["warning"] }
|
|
2777
|
+
|
|
2778
|
+
animation "Order accepted" {
|
|
2779
|
+
dim *
|
|
2780
|
+
activate customer
|
|
2781
|
+
flow customer -> storefront -> checkoutApi -> orders for 600ms
|
|
2782
|
+
pulse orders for 500ms
|
|
2783
|
+
flow orders -> stripe for 500ms
|
|
2784
|
+
flow orders -> orderDb for 500ms
|
|
2785
|
+
activate outboxRelay
|
|
2786
|
+
flow outboxRelay -> orderDb for 400ms
|
|
2787
|
+
flow outboxRelay -> orderEvents for 600ms
|
|
2788
|
+
pulse orderEvents for 400ms
|
|
2789
|
+
parallel {
|
|
2790
|
+
flow orderEvents -> inventory for 600ms
|
|
2791
|
+
flow orderEvents -> notifications for 600ms
|
|
2792
|
+
}
|
|
2793
|
+
parallel {
|
|
2794
|
+
flow inventory -> inventoryDb for 500ms
|
|
2795
|
+
flow notifications -> emailProvider for 500ms
|
|
2796
|
+
}
|
|
2797
|
+
flow inventory -> warehouse for 500ms
|
|
2798
|
+
wait 800ms
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
animation "Delivery retries exhausted" {
|
|
2802
|
+
dim *
|
|
2803
|
+
activate outboxRelay
|
|
2804
|
+
flow outboxRelay -> orderEvents for 600ms
|
|
2805
|
+
pulse orderEvents for 400ms
|
|
2806
|
+
flow orderEvents -> deadLetters for 600ms
|
|
2807
|
+
pulse deadLetters for 800ms
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
`,"../../../../../examples/refund-request.kdiagram":`kdiagram 1
|
|
2811
|
+
|
|
2812
|
+
diagram "Customer refund request" {
|
|
2813
|
+
layout {
|
|
2814
|
+
direction: LR
|
|
2815
|
+
arrange: row
|
|
2816
|
+
density: compact
|
|
2817
|
+
spacingScale: 1
|
|
2818
|
+
considerModelOrder: true
|
|
2819
|
+
groupLayout: compound
|
|
2820
|
+
}
|
|
2821
|
+
edges {
|
|
2822
|
+
route: orthogonal
|
|
2823
|
+
crossings: gaps
|
|
2824
|
+
}
|
|
2825
|
+
presentation {
|
|
2826
|
+
title: auto
|
|
2827
|
+
titleSubtitle: "Eligibility, inspection, approval, and payout — by owner."
|
|
2828
|
+
groupAccent: false
|
|
2829
|
+
showKindSubtitles: false
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
request: task "Submit refund request"
|
|
2833
|
+
|
|
2834
|
+
group support "Support" {
|
|
2835
|
+
arrange: stack
|
|
2836
|
+
eligible: decision "In return window?"
|
|
2837
|
+
inspect: task "Inspect item"
|
|
2838
|
+
condition: decision "Condition OK?"
|
|
2839
|
+
deny: task "Deny" {
|
|
2840
|
+
styles: ["warning"]
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
group finance "Finance" {
|
|
2845
|
+
arrange: stack
|
|
2846
|
+
limit: decision "Under auto-approve?"
|
|
2847
|
+
manager: task "Manager review"
|
|
2848
|
+
approve: task "Approve" {
|
|
2849
|
+
styles: ["success"]
|
|
2850
|
+
}
|
|
2851
|
+
payout: task "Refund to card" {
|
|
2852
|
+
icon: credit-card
|
|
2853
|
+
subtitle: Stripe
|
|
2854
|
+
}
|
|
2855
|
+
notify: task "Email confirmation" {
|
|
2856
|
+
icon: mail
|
|
2857
|
+
}
|
|
2858
|
+
closed: task "Close case" {
|
|
2859
|
+
styles: ["success"]
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
request -> eligible { priority: high }
|
|
2864
|
+
eligible -> inspect "yes" { priority: high }
|
|
2865
|
+
eligible -x deny "no"
|
|
2866
|
+
inspect -> condition { priority: high }
|
|
2867
|
+
condition -> limit "yes" { priority: high }
|
|
2868
|
+
condition -x deny "no"
|
|
2869
|
+
limit -> approve "yes" { priority: high }
|
|
2870
|
+
limit -> manager "no" { priority: high }
|
|
2871
|
+
manager -> approve { priority: high }
|
|
2872
|
+
approve -> payout { priority: high }
|
|
2873
|
+
payout -> notify { priority: high }
|
|
2874
|
+
notify -> closed { priority: high }
|
|
2875
|
+
deny -> closed
|
|
2876
|
+
|
|
2877
|
+
animation "Denied" {
|
|
2878
|
+
dim *
|
|
2879
|
+
activate request
|
|
2880
|
+
wait 250ms
|
|
2881
|
+
flow request -> eligible for 500ms
|
|
2882
|
+
activate eligible
|
|
2883
|
+
pulse eligible for 800ms
|
|
2884
|
+
flow eligible -> deny -> closed for 1.2s
|
|
2885
|
+
activate closed
|
|
2886
|
+
wait 600ms
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
`,"../../../../../examples/storefront-model.kdiagram":`kdiagram 2
|
|
2890
|
+
|
|
2891
|
+
model "Storefront" {
|
|
2892
|
+
customer: person "Customer" {
|
|
2893
|
+
description: "A shopper browsing the catalog and placing orders."
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
boundary company "Commerce Co." {
|
|
2897
|
+
platform: system "Commerce platform" {
|
|
2898
|
+
description: "Lets customers check out and coordinates payment, fulfillment, and email."
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2902
|
+
boundary commerce "Commerce platform" {
|
|
2903
|
+
arrange: grid
|
|
2904
|
+
columns: 4
|
|
2905
|
+
align: stretch
|
|
2906
|
+
gap: 40
|
|
2907
|
+
|
|
2908
|
+
zone experience {
|
|
2909
|
+
column: 1
|
|
2910
|
+
arrange: stack
|
|
2911
|
+
|
|
2912
|
+
web: container "Web application" {
|
|
2913
|
+
technology: "SPA"
|
|
2914
|
+
description: "Lets customers browse the catalog and submit checkout."
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
zone application {
|
|
2919
|
+
column: 2
|
|
2920
|
+
arrange: stack
|
|
2921
|
+
|
|
2922
|
+
api: container "API application" {
|
|
2923
|
+
technology: "Node.js"
|
|
2924
|
+
description: "Accepts orders, authorizes payment, and records the outbox."
|
|
2925
|
+
}
|
|
2926
|
+
notifications: container "Notification worker" {
|
|
2927
|
+
technology: "Node.js"
|
|
2928
|
+
description: "Sends order confirmation email after OrderPlaced."
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
zone records {
|
|
2933
|
+
column: 3
|
|
2934
|
+
arrange: stack
|
|
2935
|
+
|
|
2936
|
+
ordersDb: container "Orders database" {
|
|
2937
|
+
shape: cylinder
|
|
2938
|
+
technology: "PostgreSQL"
|
|
2939
|
+
description: "Stores orders and the transactional outbox."
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
zone stock {
|
|
2944
|
+
column: 4
|
|
2945
|
+
arrange: stack
|
|
2946
|
+
|
|
2947
|
+
inventory: container "Inventory service" {
|
|
2948
|
+
technology: "Node.js"
|
|
2949
|
+
description: "Reserves stock and releases warehouse picks."
|
|
2950
|
+
}
|
|
2951
|
+
inventoryDb: container "Inventory database" {
|
|
2952
|
+
shape: cylinder
|
|
2953
|
+
technology: "PostgreSQL"
|
|
2954
|
+
description: "Stores stock levels for reservations."
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
group externals {
|
|
2960
|
+
chrome: false
|
|
2961
|
+
arrange: stack
|
|
2962
|
+
align: stretch
|
|
2963
|
+
|
|
2964
|
+
stripe: external "Stripe" {
|
|
2965
|
+
description: "Card payment service used to authorize charges."
|
|
2966
|
+
}
|
|
2967
|
+
warehouse: external "Warehouse" {
|
|
2968
|
+
description: "Fulfillment partner that pick-packs and ships orders."
|
|
2969
|
+
}
|
|
2970
|
+
email: external "Email provider" {
|
|
2971
|
+
description: "Sends transactional mail such as order confirmations."
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
boundary apiComponents "API application" {
|
|
2976
|
+
arrange: stack
|
|
2977
|
+
align: stretch
|
|
2978
|
+
gap: 28
|
|
2979
|
+
|
|
2980
|
+
controller: component "Orders controller" {
|
|
2981
|
+
technology: "HTTP"
|
|
2982
|
+
description: "Handles checkout requests and maps them into order commands."
|
|
2983
|
+
}
|
|
2984
|
+
orders: component "Order service" {
|
|
2985
|
+
description: "Applies order policy, records the outbox, and requests payment."
|
|
2986
|
+
}
|
|
2987
|
+
payments: component "Payment client" {
|
|
2988
|
+
description: "Authorizes card charges through Stripe."
|
|
2989
|
+
}
|
|
2990
|
+
repo: component "Order repository" {
|
|
2991
|
+
description: "Reads and writes orders in the orders database."
|
|
2992
|
+
}
|
|
2993
|
+
publisher: component "Outbox publisher" {
|
|
2994
|
+
description: "Publishes OrderPlaced after the checkout transaction commits."
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
view Context {
|
|
2999
|
+
include customer, company, externals
|
|
3000
|
+
|
|
3001
|
+
customer -> platform "Places orders and checks status [HTTPS]"
|
|
3002
|
+
platform -> stripe "Authorizes card payments [HTTPS]"
|
|
3003
|
+
platform -> warehouse "Releases pick-and-pack work"
|
|
3004
|
+
platform -> email "Sends order confirmations [SMTP]"
|
|
3005
|
+
|
|
3006
|
+
layout {
|
|
3007
|
+
direction: TD
|
|
3008
|
+
}
|
|
3009
|
+
presentation {
|
|
3010
|
+
groupAccent: true
|
|
3011
|
+
showKindSubtitles: true
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
view containers {
|
|
3016
|
+
include customer, commerce.*, externals
|
|
3017
|
+
|
|
3018
|
+
customer -> web "Browses and checks out [HTTPS]" { priority: high }
|
|
3019
|
+
web -> api "Places orders [JSON/HTTPS]" { priority: high }
|
|
3020
|
+
api -> stripe "Authorizes payments [HTTPS]" { priority: high }
|
|
3021
|
+
api -> ordersDb "Reads and writes orders [SQL]" { priority: high }
|
|
3022
|
+
api => inventory "Publishes OrderPlaced"
|
|
3023
|
+
api => notifications "Publishes OrderPlaced"
|
|
3024
|
+
inventory -> inventoryDb "Reads and writes stock [SQL]"
|
|
3025
|
+
inventory -> warehouse "Releases picks"
|
|
3026
|
+
notifications -> email "Sends confirmation [SMTP]"
|
|
3027
|
+
|
|
3028
|
+
layout {
|
|
3029
|
+
direction: LR
|
|
3030
|
+
density: spacious
|
|
3031
|
+
spacingScale: 2
|
|
3032
|
+
groupLayout: compound
|
|
3033
|
+
considerModelOrder: true
|
|
3034
|
+
}
|
|
3035
|
+
edges {
|
|
3036
|
+
route: bezier
|
|
3037
|
+
crossings: gaps
|
|
3038
|
+
cornerRadius: 4
|
|
3039
|
+
}
|
|
3040
|
+
presentation {
|
|
3041
|
+
groupAccent: true
|
|
3042
|
+
showKindSubtitles: true
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
view components {
|
|
3047
|
+
include web, apiComponents.*, ordersDb, stripe, inventory, notifications
|
|
3048
|
+
exclude api
|
|
3049
|
+
|
|
3050
|
+
web -> controller "Places orders [JSON/HTTPS]" { priority: high }
|
|
3051
|
+
controller -> orders "CreateOrder" { priority: high }
|
|
3052
|
+
orders -> payments "Authorize payment"
|
|
3053
|
+
payments -> stripe "Authorizes charges [HTTPS]"
|
|
3054
|
+
orders -> repo "Save order + outbox"
|
|
3055
|
+
repo -> ordersDb "Reads and writes orders [SQL]"
|
|
3056
|
+
orders -> publisher "Enqueue OrderPlaced"
|
|
3057
|
+
publisher => inventory "Publishes OrderPlaced"
|
|
3058
|
+
publisher => notifications "Publishes OrderPlaced"
|
|
3059
|
+
|
|
3060
|
+
layout {
|
|
3061
|
+
direction: LR
|
|
3062
|
+
density: spacious
|
|
3063
|
+
spacingScale: 1.05
|
|
3064
|
+
groupLayout: compound
|
|
3065
|
+
considerModelOrder: true
|
|
3066
|
+
}
|
|
3067
|
+
edges {
|
|
3068
|
+
route: orthogonal
|
|
3069
|
+
crossings: gaps
|
|
3070
|
+
cornerRadius: 4
|
|
3071
|
+
}
|
|
3072
|
+
presentation {
|
|
3073
|
+
groupAccent: false
|
|
3074
|
+
showKindSubtitles: true
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
`})).map(([e,t])=>{let n=e.split(`/`).pop().replace(`.kdiagram`,``);return{id:n,label:n.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),source:t}}).sort((e,t)=>e.label.localeCompare(t.label)),lu=`order-fulfillment`,uu=cu.find(e=>e.id===lu)??cu[0],du=`kdiagram-icon-api`,fu=`kdiagram-public-studio`;function pu(e,t=document.baseURI){return new URL(e.replace(/^\//,``),new URL(`.`,t)).toString()}function mu(e){let t=e.querySelector(`meta[name="${du}"]`)?.content.trim();return hu(e.baseURI,t)}function hu(e,t){return new URL(t||`__kdiagram/icons`,new URL(`.`,e)).toString().replace(/\/$/,``)}function gu(e){let t=e.querySelector(`meta[name="${fu}"]`)?.content.trim();return new URL(t||`.`,e.baseURI).toString()}async function _u(e,t){return{ok:!1,error:`Saving to the repo is only available in the Vite dev server.`}}function vu(){return!1}var yu={types:[{description:`KDiagram diagram`,accept:{"text/plain":[`.kdiagram`]}}],excludeAcceptAllOption:!1};async function bu(e=window,t=document){if(e.showOpenFilePicker)try{let[t]=await e.showOpenFilePicker({...yu,multiple:!1});if(!t)return null;let n=await t.getFile();return{name:t.name,source:await n.text(),handle:t}}catch(e){if(wu(e))return null;throw e}return Su(t)}async function G(e,t,n,r=!1,i=window,a=document){let o=r?void 0:n;if(!o&&i.showSaveFilePicker)try{o=await i.showSaveFilePicker({...yu,suggestedName:xu(t)})}catch(e){if(wu(e))return null;throw e}let s=e.endsWith(`
|
|
3079
|
+
`)?e:`${e}\n`;if(o){let e=await o.createWritable();return await e.write(s),await e.close(),{name:o.name,handle:o,downloaded:!1}}return Cu(s,xu(t),a),{name:xu(t),downloaded:!0}}function xu(e){let t=e.trim()||`diagram`;return t.toLowerCase().endsWith(`.kdiagram`)?t:`${t}.kdiagram`}function Su(e){return new Promise(t=>{let n=e.createElement(`input`);n.type=`file`,n.accept=`.kdiagram,text/plain`,n.hidden=!0,n.addEventListener(`change`,()=>{let e=n.files?.[0];n.remove(),e?e.text().then(n=>t({name:e.name,source:n})):t(null)},{once:!0}),n.addEventListener(`cancel`,()=>{n.remove(),t(null)},{once:!0}),e.body.append(n),n.click()})}function Cu(e,t,n){let r=URL.createObjectURL(new Blob([e],{type:`text/plain;charset=utf-8`})),i=n.createElement(`a`);i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}function wu(e){return e instanceof DOMException&&e.name===`AbortError`}var Tu=new Set([`direction`,`density`,`spacingScale`,`nodePlacement`,`groupLayout`,`modelOrder`,`groupGap`,`edgeGaps`]);function Eu(e){Ec(ul,Sl(e)),xl(bl(e))}function Du(e){let t=iu(`draft`,null),n=e??t?.source??uu?.source??`diagram {
|
|
3080
|
+
direction LR
|
|
3081
|
+
a: service "A"
|
|
3082
|
+
b: service "B"
|
|
3083
|
+
a -> b
|
|
3084
|
+
}
|
|
3085
|
+
`,r=tc(n).theme,i=vl(r,iu(`themeSeeds`,null)),a=e?`Shared diagram.kdiagram`:t?.name??uu?.label??`Diagram`,o=e||t?`browser-document`:uu?.id??`browser-document`,[s,c]=(0,u.useState)(n),[l,d]=(0,u.useState)(n),[f,p]=(0,u.useState)(n),[m,h]=(0,u.useState)(o),[g,_]=(0,u.useState)(a),[v,y]=(0,u.useState)(),[b,x]=(0,u.useState)(`idle`),[ee,te]=(0,u.useState)(null),[ne,S]=(0,u.useState)(()=>({...Cl,...tc(n)})),[re,C]=(0,u.useState)(i),[ie,ae]=(0,u.useState)(null),[oe,se]=(0,u.useState)(!1),[ce,le]=(0,u.useState)(void 0),ue=(0,u.useRef)(null),w=(0,u.useRef)(void 0),de=(0,u.useRef)(s),fe=(0,u.useRef)(ne),pe=(0,u.useRef)(re);de.current=s,fe.current=ne,pe.current=re;let me=(0,u.useMemo)(()=>Go(di(l)).filter(e=>e.kind===`model-view`&&e.viewName).map(e=>({kind:`model-view`,viewName:e.viewName,title:e.title??e.viewName})),[l]);(0,u.useEffect)(()=>{me.length===0?le(void 0):le(e=>e&&me.some(t=>t.viewName===e)?e:me.find(e=>e.viewName==="default")?.viewName??me.find(e=>e.viewName===`main`)?.viewName??me[0]?.viewName)},[me]);let he=(0,u.useMemo)(()=>({...wl(ne),view:ce}),[ce,ne]),ge=(0,u.useMemo)(()=>cu.some(e=>e.id===m)?cu:[...cu,{id:m,label:g,source:s}],[g,m,s]),_e=(0,u.useCallback)(e=>{ae(e),se(!0)},[]);(0,u.useEffect)(()=>{Eu(pe.current)},[]),(0,u.useEffect)(()=>{document.documentElement.dataset.chromeTheme=ne.theme,document.documentElement.dataset.theme=ne.theme,au(`theme`,ne.theme),C(e=>{if(e.mode===ne.theme)return e;let t=hl(e,ne.theme);return pe.current=t,t})},[ne.theme]),(0,u.useEffect)(()=>{pe.current=re,au(`themeSeeds`,re),Eu(re),ue.current?.refreshTheme()},[re]),(0,u.useEffect)(()=>{au(`draft`,{source:s,name:g})},[g,s]);let ve=(0,u.useCallback)(e=>{de.current=e,c(e),S(t=>{let n={...t,...tc(e)};return fe.current=n,n}),clearTimeout(w.current),w.current=setTimeout(()=>{d(e)},200)},[]),ye=(0,u.useCallback)((e,t)=>{if(Ou(e)&&typeof t==`string`){let n=nc(de.current,e,t);de.current=n,c(n),d(n),S(e=>{let t={...e,...tc(n)};return fe.current=t,t}),clearTimeout(w.current)}else S(n=>{let r={...n,[e]:t};return fe.current=r,r}),Tu.has(e)&&requestAnimationFrame(()=>{ue.current?.fit()})},[]),be=(0,u.useCallback)(()=>{let e=rc(de.current);de.current=e,c(e),d(e),S(t=>{let n={...t,...tc(e)};return fe.current=n,n}),clearTimeout(w.current),requestAnimationFrame(()=>{ue.current?.fit()})},[]),xe=(0,u.useCallback)(()=>{let e=fe.current.theme===`dark`?`light`:`dark`;ye(`theme`,e)},[ye]),Se=(0,u.useCallback)(e=>{C(t=>{let n={...t,...e,mode:t.mode};return pe.current=n,n})},[]),Ce=(0,u.useCallback)(()=>{C(e=>{let t=dl(e.mode);return pe.current=t,t})},[]),we=s!==f,Te=b!==`saving`,T=(0,u.useCallback)((e,t,n)=>{let r=cu.find(t=>t.id===e);h(e),_(r?.label??e),y(void 0),de.current=t,c(t),d(t),p(t),n?.activeView!==void 0&&le(n.activeView),n?.compileTargets&&n.compileTargets.length>0&&le(n.activeView??n.compileTargets.find(e=>e.viewName==="default")?.viewName??n.compileTargets.find(e=>e.viewName===`main`)?.viewName??n.compileTargets[0]?.viewName),S(e=>{let n={...e,...tc(t)};return fe.current=n,n}),x(`idle`),te(null),clearTimeout(w.current),requestAnimationFrame(()=>{ue.current?.fit()})},[]),E=(0,u.useCallback)(async(e=!1)=>{x(`saving`),te(null);try{let t=cu.some(e=>e.id===m);if(!e&&!v&&vu()&&t){let e=await _u(m,de.current);if(!e.ok)throw Error(e.error)}else{let t=await G(de.current,g,v,e);if(!t){x(`idle`);return}y(t.handle),_(t.name),h(`browser-document`)}let n=de.current.endsWith(`
|
|
3086
|
+
`)?de.current:`${de.current}\n`;de.current=n,c(n),d(n),p(n),x(`saved`),window.setTimeout(()=>x(e=>e===`saved`?`idle`:e),1600)}catch(e){x(`error`),te(e instanceof Error?e.message:`Could not save the diagram file`)}},[g,m,v]),Ee=(0,u.useCallback)(async()=>{try{let e=await bu();if(!e)return;y(e.handle),_(e.name),h(`browser-document`),de.current=e.source,c(e.source),d(e.source),p(e.source),S(t=>{let n={...t,...tc(e.source)};return fe.current=n,n}),x(`idle`),te(null),clearTimeout(w.current),requestAnimationFrame(()=>ue.current?.fit())}catch(e){x(`error`),te(e instanceof Error?e.message:`Could not open the diagram file`)}},[]),De=(0,u.useCallback)(()=>{let e=B(de.current);de.current=e,c(e),d(e),clearTimeout(w.current)},[]),Oe=(0,u.useRef)(ce);Oe.current=ce;let ke=(0,u.useCallback)(async()=>{Eu(pe.current);let e={...Tl(fe.current),view:Oe.current,snapshotTheme:!0},{KDiagram:t}=await pn(async()=>{let{KDiagram:e}=await import(`./dist-gV3Je5I4.js`);return{KDiagram:e}},[],import.meta.url),n=await t.renderToSvg(de.current,e);return n.ok&&n.svg?n.svg:null},[]);return{liveRef:ue,source:s,previewSource:l,exampleId:m,documents:ge,documentName:g,dirty:we,canSave:Te,saveState:b,saveError:ee,options:ne,themeSeeds:re,renderOptions:he,result:ie,ready:oe,updateSource:ve,setOption:ye,resetOptions:be,toggleTheme:xe,patchThemeSeeds:Se,resetThemeSeeds:Ce,loadExample:T,saveExample:E,saveAs:()=>E(!0),openFile:Ee,formatSource:De,exportSvg:(0,u.useCallback)(async()=>{let e=await ke();if(!e)return;let t=new Blob([e],{type:`image/svg+xml`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${g.replace(/\.kdiagram$/i,``)||`diagram`}.svg`,r.click(),URL.revokeObjectURL(n)},[g,ke]),renderSvg:ke,applyResult:_e,fit:(0,u.useCallback)(()=>{ue.current?.fit()},[]),zoomIn:(0,u.useCallback)(()=>{ue.current?.zoomIn()},[]),zoomOut:(0,u.useCallback)(()=>{ue.current?.zoomOut()},[]),resetView:(0,u.useCallback)(()=>{ue.current?.resetView()},[]),compileTargets:me,activeView:ce,setActiveView:le}}function Ou(e){return e===`theme`||e===`direction`||e===`density`||e===`groupLayout`||e===`edgeStyle`||e===`crossings`}function ku(e){let t=Du(),[n,r]=(0,u.useState)(Ys),[i,a]=(0,u.useState)(``),[o,s]=(0,u.useState)(!1),[c,l]=(0,u.useState)({label:`Connecting…`,connected:!1}),d=(0,u.useRef)(n),f=(0,u.useRef)(void 0);d.current=n;let p=(0,u.useCallback)(async t=>{let n=await fetch(pu(`message?token=${encodeURIComponent(e)}`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});n.ok||l({label:`Request failed: ${n.status}`,connected:!1})},[e]),m=(0,u.useCallback)(e=>{t.loadExample(e.id,e.source,{activeView:e.activeView,compileTargets:e.compileTargets}),a(e.source)},[t.loadExample]);(0,u.useEffect)(()=>{let t=new EventSource(pu(`events?token=${encodeURIComponent(e)}`));return t.onmessage=e=>{let t=JSON.parse(e.data);switch(r(e=>{let n=Xs(e,t);return d.current=n,n}),t.type){case`ready`:{s(t.capabilities.write),l({label:`Connected`,connected:!0});let e=t.documents.find(e=>e.id===t.activeDocumentId);e&&m(e);break}case`document`:m(t);break;case`saved`:{let e=d.current.documents.find(e=>e.id===t.documentId);e&&a(e.source),l({label:`Saved`,connected:!0});break}case`error`:l({label:`${t.code}: ${t.message}`,connected:!1})}},t.onerror=()=>l({label:`Reconnecting…`,connected:!1}),()=>t.close()},[m,e]);let h=(0,u.useCallback)(e=>{t.updateSource(e),clearTimeout(f.current),f.current=setTimeout(()=>{let t=d.current.documents.find(e=>e.id===d.current.activeDocumentId);if(!t)return;let n=Math.max(t.revision+1,(d.current.render?.revision??0)+1);t.revision=n,t.source=e,p({version:1,type:`source`,documentId:t.id,revision:n,source:e})},120)},[p,t.updateSource]),g=(0,u.useCallback)(e=>void p({version:1,type:`open`,documentId:e}),[p]),_=(0,u.useCallback)(e=>{let t=d.current.activeDocumentId;t&&p({version:1,type:`selectView`,documentId:t,view:e})},[p]),v=(0,u.useCallback)(()=>{let e=d.current.documents.find(e=>e.id===d.current.activeDocumentId);e&&o&&p({version:1,type:`save`,documentId:e.id,revision:e.revision,source:t.source})},[p,t.source,o]),y=(0,u.useCallback)(()=>{h(B(t.source))},[h,t.source]);return{...t,documents:n.documents,activeDocumentId:n.activeDocumentId??``,connection:c,dirty:t.source!==i,canSave:o&&t.source!==i,updateSource:h,loadExample:e=>g(e),saveExample:async()=>v(),formatSource:y,selectView:_}}function Au(){return iu(`sidebarOpen`,!1)}function ju(){let e=new URLSearchParams(location.search).get(`token`),t=jl(location.hash);return t.embed?(0,A.jsx)(El,{source:t.source??`diagram {
|
|
3087
|
+
direction LR
|
|
3088
|
+
a: service "A"
|
|
3089
|
+
b: service "B"
|
|
3090
|
+
a -> b
|
|
3091
|
+
}
|
|
3092
|
+
`}):e?(0,A.jsx)(Nu,{token:e}):(0,A.jsx)(Mu,{sharedSource:t.source})}function Mu({sharedSource:e}){let t=Du(e);return(0,A.jsx)(Pu,{studio:t,documents:t.documents,activeDocumentId:t.exampleId})}function Nu({token:e}){let t=ku(e);return(0,A.jsx)(Pu,{studio:t,documents:t.documents,activeDocumentId:t.activeDocumentId,connection:t.connection})}function Pu({studio:e,documents:t,activeDocumentId:n,connection:r}){let[i,a]=(0,u.useState)(Au),[o,s]=(0,u.useState)(!1),[c,l]=(0,u.useState)(),d=(0,u.useCallback)(e=>{l({range:e,requestId:Date.now()})},[]),f=(0,u.useCallback)(e=>{a(e),au(`sidebarOpen`,e)},[]);(0,u.useEffect)(()=>{requestAnimationFrame(()=>e.fit())},[i,e.fit]);let p=(0,u.useCallback)(t=>{let n=e.result?.graph?.nodes.find(e=>e.id===t)?.sourceRange;n&&d(n)},[d,e.result]),m=e.setActiveView,h=e.fit,g=`selectView`in e?e.selectView:void 0,_=(0,u.useCallback)(e=>{m(e),g?.(e),requestAnimationFrame(()=>h())},[h,g,m]);return(0,A.jsxs)(`div`,{className:`app-shell`,"data-chrome-theme":e.options.theme,children:[(0,A.jsx)(su,{product:`Studio`,theme:e.options.theme,connection:r,onToggleTheme:e.toggleTheme,onExport:()=>void e.exportSvg(),onShare:()=>s(!0),onToggleSidebar:()=>f(!i),sidebarOpen:i}),(0,A.jsxs)(`div`,{className:`workspace-row`,children:[(0,A.jsx)(W,{left:(0,A.jsx)(hn,{source:e.source,onChange:e.updateSource,diagnostics:e.result?.diagnostics,themeMode:e.options.theme,documents:t,activeDocumentId:n,onDocument:n=>{let r=t.find(e=>e.id===n);e.loadExample(n,r?.source??``)},dirty:e.dirty,canSave:e.canSave,saveState:e.saveState,saveError:e.saveError,onSave:()=>void e.saveExample(),onSaveAs:r?void 0:()=>void e.saveAs(),onOpenFile:r?void 0:()=>void e.openFile(),onFormat:e.formatSource,revealRange:c,onRevealRange:d}),right:(0,A.jsx)(Ol,{source:e.previewSource,renderOptions:e.renderOptions,activeView:e.activeView,onViewChange:_,liveRef:e.liveRef,result:e.result,onRender:e.applyResult,onNodeNavigate:p})}),(0,A.jsx)(nu,{open:i,options:e.options,onChange:e.setOption,onReset:e.resetOptions,themeSeeds:e.themeSeeds,onThemeSeedsChange:e.patchThemeSeeds,onResetThemeSeeds:e.resetThemeSeeds})]}),o?(0,A.jsx)(Rl,{source:e.source,studioUrl:gu(document),onRenderSvg:e.renderSvg,onClose:()=>s(!1)}):null]})}Le(mu(document));var Fu=document.getElementById(`app`);if(!Fu)throw Error(`#app missing`);(0,d.createRoot)(Fu).render((0,A.jsx)(u.StrictMode,{children:(0,A.jsx)(ju,{})}));export{h as $,Oi as A,Fr as B,Ui as C,Ni as D,Ai as E,ni as F,We as G,pn as H,Kr as I,Le as J,Ue as K,Qr as L,Ti as M,di as N,Mi as O,ci as P,_ as Q,Yr as R,Ki as S,Gi as T,an as U,Nr as V,qe as W,Ee as X,Oe as Y,m as Z,ls as _,Rc as a,ha as b,Mc as c,Ac as d,g as et,Tc as f,B as g,Oc as h,Kc as i,ki as j,Di as k,Fc as l,Ec as m,Gc as n,Nc as o,kc as p,He as q,Uc as r,Pc as s,Wc as t,r as tt,jc as u,cs as v,Wi as w,qi as x,Go as y,zr as z};
|