UNPKG

@hpcc-js/react

Version:
1 lines 126 kB
{"version":3,"file":"index.umd.cjs","sources":["../../../node_modules/preact/dist/preact.module.js","../../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js","../../../node_modules/preact/hooks/dist/hooks.module.js","../../../node_modules/preact/compat/dist/compat.module.js","../src/image.tsx","../src/ImageChar.tsx","../src/shape.tsx","../src/icon.tsx","../src/text.tsx","../src/edge.tsx","../src/render.ts","../src/span.tsx","../src/vertex.tsx","../src/vertex2.tsx","../src/vertex3.tsx","../src/vertex4.tsx","../src/subgraph.tsx","../src/__package__.ts"],"sourcesContent":["var n,l,u,t,i,r,o,e,f,c,s,a,h,p,v,y,d={},w=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function m(n,l){for(var u in l)n[u]=l[u];return n}function b(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function k(l,u,t){var i,r,o,e={};for(o in u)\"key\"==o?i=u[o]:\"ref\"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return x(l,e,i,r,null)}function x(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function M(){return{current:null}}function S(n){return n.children}function C(n,l){this.props=n,this.context=l}function $(n,l){if(null==l)return n.__?$(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return\"function\"==typeof n.type?$(n):null}function I(n){if(n.__P&&n.__d){var u=n.__v,t=u.__e,i=[],r=[],o=m({},u);o.__v=u.__v+1,l.vnode&&l.vnode(o),q(n.__P,o,u,n.__n,n.__P.namespaceURI,32&u.__u?[t]:null,i,null==t?$(u):t,!!(32&u.__u),r),o.__v=u.__v,o.__.__k[o.__i]=o,D(i,o,r),u.__e=u.__=null,o.__e!=t&&P(o)}}function P(n){if(null!=(n=n.__)&&null!=n.__c)return n.__e=n.__c.base=null,n.__k.some(function(l){if(null!=l&&null!=l.__e)return n.__e=n.__c.base=l.__e}),P(n)}function A(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!H.__r++||r!=l.debounceRendering)&&((r=l.debounceRendering)||o)(H)}function H(){try{for(var n,l=1;i.length;)i.length>l&&i.sort(e),n=i.shift(),l=i.length,I(n)}finally{i.length=H.__r=0}}function L(n,l,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,g,m=t&&t.__k||w,b=l.length;for(f=T(u,l,m,f,b),a=0;a<b;a++)null!=(p=u.__k[a])&&(h=-1!=p.__i&&m[p.__i]||d,p.__i=a,_=q(n,p,h,i,r,o,e,f,c,s),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&J(h.ref,null,p),s.push(p.ref,p.__c||v,p)),null==y&&null!=v&&(y=v),(g=!!(4&p.__u))||h.__k===p.__k?(f=j(p,f,n,g),g&&h.__e&&(h.__e=null)):\"function\"==typeof p.type&&void 0!==_?f=_:v&&(f=v.nextSibling),p.__u&=-7);return u.__e=y,f}function T(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&\"boolean\"!=typeof o&&\"function\"!=typeof o?(\"string\"==typeof o||\"number\"==typeof o||\"bigint\"==typeof o||o.constructor==String?o=n.__k[r]=x(null,o,null,null,null):g(o)?o=n.__k[r]=x(S,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=n.__k[r]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=O(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),\"function\"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=$(e)),K(e,e));return t}function j(n,l,u,t){var i,r;if(\"function\"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=j(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=$(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8==l.nodeType);return l}function F(n,l){return l=l||[],null==n||\"boolean\"==typeof n||(g(n)?n.some(function(n){F(n,l)}):l.push(n)),l}function O(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==e||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function z(n,l,u){\"-\"==l[0]?n.setProperty(l,null==u?\"\":u):n[l]=null==u?\"\":\"number\"!=typeof u||_.test(l)?u:u+\"px\"}function N(n,l,u,t,i){var r,o;n:if(\"style\"==l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof t&&(n.style.cssText=t=\"\"),t)for(l in t)u&&l in u||z(n.style,l,\"\");if(u)for(l in u)t&&u[l]==t[l]||z(n.style,l,u[l])}else if(\"o\"==l[0]&&\"n\"==l[1])r=l!=(l=l.replace(a,\"$1\")),o=l.toLowerCase(),l=o in n||\"onFocusOut\"==l||\"onFocusIn\"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u[s]=t[s]:(u[s]=h,n.addEventListener(l,r?v:p,r)):n.removeEventListener(l,r?v:p,r);else{if(\"http://www.w3.org/2000/svg\"==i)l=l.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(\"width\"!=l&&\"height\"!=l&&\"href\"!=l&&\"list\"!=l&&\"form\"!=l&&\"tabIndex\"!=l&&\"download\"!=l&&\"rowSpan\"!=l&&\"colSpan\"!=l&&\"role\"!=l&&\"popover\"!=l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null==u||!1===u&&\"-\"!=l[4]?n.removeAttribute(l):n.setAttribute(l,\"popover\"==l&&1==u?\"\":u))}}function V(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u[c])u[c]=h++;else if(u[c]<t[s])return;return t(l.event?l.event(u):u)}}}function q(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,d,_,k,x,M,$,I,P,A,H,T=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if(\"function\"==typeof T)try{if(k=u.props,x=T.prototype&&T.prototype.render,M=(a=T.contextType)&&i[a.__c],$=a?M?M.props.value:a.__:i,t.__c?_=(h=u.__c=t.__c).__=h.__E:(x?u.__c=h=new T(k,$):(u.__c=h=new C(k,$),h.constructor=T,h.render=Q),M&&M.sub(h),h.state||(h.state={}),h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),x&&null==h.__s&&(h.__s=h.state),x&&null!=T.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=m({},h.__s)),m(h.__s,T.getDerivedStateFromProps(k,h.__s))),v=h.props,y=h.state,h.__v=u,p)x&&null==T.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),x&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(x&&null==T.getDerivedStateFromProps&&k!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(k,$),u.__v==t.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(k,h.__s,$)){u.__v!=t.__v&&(h.props=k,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),w.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(k,h.__s,$),x&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,d)})}if(h.context=$,h.props=k,h.__P=n,h.__e=!1,I=l.__r,P=0,x)h.state=h.__s,h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),w.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++P<25);h.state=h.__s,null!=h.getChildContext&&(i=m(m({},i),h.getChildContext())),x&&!p&&null!=h.getSnapshotBeforeUpdate&&(d=h.getSnapshotBeforeUpdate(v,y)),A=null!=a&&a.type===S&&null==a.key?E(a.props.children):a,f=L(n,g(A)?A:[A],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),_&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f}else{for(H=o.length;H--;)b(o[H]);B(u)}else u.__e=t.__e,u.__k=t.__k,n.then||B(u);l.__e(n,u,t)}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=G(t.__e,u,t,i,r,o,e,c,s);return(a=l.diffed)&&a(u),128&u.__u?void 0:f}function B(n){n&&(n.__c&&(n.__c.__e=!0),n.__k&&n.__k.some(B))}function D(n,u,t){for(var i=0;i<t.length;i++)J(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function E(n){return\"object\"!=typeof n||null==n||n.__b>0?n:g(n)?n.map(E):m({},n)}function G(u,t,i,r,o,e,f,c,s){var a,h,p,v,y,w,_,m=i.props||d,k=t.props,x=t.type;if(\"svg\"==x?o=\"http://www.w3.org/2000/svg\":\"math\"==x?o=\"http://www.w3.org/1998/Math/MathML\":o||(o=\"http://www.w3.org/1999/xhtml\"),null!=e)for(a=0;a<e.length;a++)if((y=e[a])&&\"setAttribute\"in y==!!x&&(x?y.localName==x:3==y.nodeType)){u=y,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(t,e),c=!1),e=null}if(null==x)m===k||c&&u.data==k||(u.data=k);else{if(e=e&&n.call(u.childNodes),!c&&null!=e)for(m={},a=0;a<u.attributes.length;a++)m[(y=u.attributes[a]).name]=y.value;for(a in m)y=m[a],\"dangerouslySetInnerHTML\"==a?p=y:\"children\"==a||a in k||\"value\"==a&&\"defaultValue\"in k||\"checked\"==a&&\"defaultChecked\"in k||N(u,a,null,y,o);for(a in k)y=k[a],\"children\"==a?v=y:\"dangerouslySetInnerHTML\"==a?h=y:\"value\"==a?w=y:\"checked\"==a?_=y:c&&\"function\"!=typeof y||m[a]===y||N(u,a,y,m[a],o);if(h)c||p&&(h.__html==p.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(p&&(u.innerHTML=\"\"),L(\"template\"==t.type?u.content:u,g(v)?v:[v],t,i,r,\"foreignObject\"==x?\"http://www.w3.org/1999/xhtml\":o,e,f,e?e[0]:i.__k&&$(i,0),c,s),null!=e)for(a=e.length;a--;)b(e[a]);c||(a=\"value\",\"progress\"==x&&null==w?u.removeAttribute(\"value\"):null!=w&&(w!==u[a]||\"progress\"==x&&!w||\"option\"==x&&w!=m[a])&&N(u,a,w,m[a],o),a=\"checked\",null!=_&&_!=u[a]&&N(u,a,_,m[a],o))}return u}function J(n,u,t){try{if(\"function\"==typeof n){var i=\"function\"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function K(n,u,t){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||J(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&K(i[r],u,t||\"function\"!=typeof n.type);t||b(n.__e),n.__c=n.__=n.__e=void 0}function Q(n,l,u){return this.constructor(n,u)}function R(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l.__&&l.__(u,t),o=(r=\"function\"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],q(t,u=(!r&&i||t).__k=k(S,null,[u]),o||d,d,t.namespaceURI,!r&&i?[i]:o?null:t.firstChild?n.call(t.childNodes):null,e,!r&&i?i:o?o.__e:t.firstChild,r,f),D(e,u,f)}function U(n,l){R(n,l,U)}function W(l,u,t){var i,r,o,e,f=m({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)\"key\"==o?i=u[o]:\"ref\"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),x(l.type,f,i||l.key,r||l.ref,null)}function X(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,A(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}return l.__c=\"__cC\"+y++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=w.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},C.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=m({},this.state),\"function\"==typeof n&&(n=n(m({},u),this.props)),n&&m(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),A(this))},C.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),A(this))},C.prototype.render=S,i=[],o=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},H.__r=0,f=Math.random().toString(8),c=\"__d\"+f,s=\"__a\"+f,a=/(PointerCapture)$|Capture$/i,h=0,p=V(!1),v=V(!0),y=0;export{C as Component,S as Fragment,W as cloneElement,X as createContext,k as createElement,M as createRef,k as h,U as hydrate,t as isValidElement,l as options,R as render,F as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","import{options as r,Fragment as e}from\"preact\";export{Fragment}from\"preact\";var t=/[\"&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o=\"\",f=\"\";n<r.length;n++){switch(r.charCodeAt(n)){case 34:f=\"&quot;\";break;case 38:f=\"&amp;\";break;case 60:f=\"&lt;\";break;default:continue}n!==e&&(o+=r.slice(e,n)),o+=f,e=n+1}return n!==e&&(o+=r.slice(e,n)),o}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=0,i=Array.isArray;function u(e,t,n,o,i,u){t||(t={});var a,c,p=t;if(\"ref\"in p)for(c in p={},t)\"ref\"==c?a=t[c]:p[c]=t[c];var l={type:e,props:p,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--f,__i:-1,__u:0,__source:i,__self:u};if(\"function\"==typeof e&&(a=e.defaultProps))for(c in a)void 0===p[c]&&(p[c]=a[c]);return r.vnode&&r.vnode(l),l}function a(r){var t=u(e,{tpl:r,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t}var c={},p=/[A-Z]/g;function l(e,t){if(r.attr){var f=r.attr(e,t);if(\"string\"==typeof f)return f}if(t=function(r){return null!==r&&\"object\"==typeof r&&\"function\"==typeof r.valueOf?r.valueOf():r}(t),\"ref\"===e||\"key\"===e)return\"\";if(\"style\"===e&&\"object\"==typeof t){var i=\"\";for(var u in t){var a=t[u];if(null!=a&&\"\"!==a){var l=\"-\"==u[0]?u:c[u]||(c[u]=u.replace(p,\"-$&\").toLowerCase()),s=\";\";\"number\"!=typeof a||l.startsWith(\"--\")||o.test(l)||(s=\"px;\"),i=i+l+\":\"+a+s}}return e+'=\"'+n(i)+'\"'}return null==t||!1===t||\"function\"==typeof t||\"object\"==typeof t?\"\":!0===t?e:e+'=\"'+n(\"\"+t)+'\"'}function s(r){if(null==r||\"boolean\"==typeof r||\"function\"==typeof r)return null;if(\"object\"==typeof r){if(void 0===r.constructor)return r;if(i(r)){for(var e=0;e<r.length;e++)r[e]=s(r[e]);return r}}return n(\"\"+r)}export{u as jsx,l as jsxAttr,u as jsxDEV,s as jsxEscape,a as jsxTemplate,u as jsxs};\n//# sourceMappingURL=jsxRuntime.module.js.map\n","import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=n,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.some(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){if(\"function\"==typeof n){var r=n(t());return function(){n(null),r&&\"function\"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=p(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function j(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z),t.__h.some(B),t.__h=[]}catch(r){t.__h=[],c.__e(r,n.__v)}}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.some(z),i.__h.some(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k=\"function\"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return\"function\"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,y as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,h as useReducer,A as useRef,d as useState};\n//# sourceMappingURL=hooks.module.js.map\n","import{Component as n,createElement as t,options as e,toChildArray as r,Fragment as u,render as o,hydrate as i,createContext as l,createRef as c,cloneElement as f}from\"preact\";export{Component,Fragment,Fragment as StrictMode,createContext,createElement,createRef}from\"preact\";import{useState as a,useLayoutEffect as s,useEffect as h,useCallback as v,useContext as d,useDebugValue as m,useId as p,useImperativeHandle as y,useMemo as _,useReducer as b,useRef as S}from\"preact/hooks\";export*from\"preact/hooks\";function g(n,t){for(var e in t)n[e]=t[e];return n}function E(n,t){for(var e in n)if(\"__source\"!==e&&!(e in t))return!0;for(var r in t)if(\"__source\"!==r&&n[r]!==t[r])return!0;return!1}function C(n,t){var e=t(),r=a({t:{__:e,u:t}}),u=r[0].t,o=r[1];return s(function(){u.__=e,u.u=t,R(u)&&o({t:u})},[n,e,t]),h(function(){return R(u)&&o({t:u}),n(function(){R(u)&&o({t:u})})},[n]),e}function R(n){try{return!((t=n.__)===(e=n.u())&&(0!==t||1/t==1/e)||t!=t&&e!=e)}catch(n){return!0}var t,e}function x(n){n()}function w(n){return n}function k(){return[!1,x]}var I=s;function M(n,t){this.props=n,this.context=t}function N(n,e){function r(n){var t=this.props.ref;return t!=n.ref&&t&&(\"function\"==typeof t?t(null):t.current=null),e?!e(this.props,n)||t!=n.ref:E(this.props,n)}function u(e){return this.shouldComponentUpdate=r,t(n,e)}return u.displayName=\"Memo(\"+(n.displayName||n.name)+\")\",u.__f=u.prototype.isReactComponent=!0,u.type=n,u}(M.prototype=new n).isPureReactComponent=!0,M.prototype.shouldComponentUpdate=function(n,t){return E(this.props,n)||E(this.state,t)};var T=e.__b;e.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),T&&T(n)};var A=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.forward_ref\")||3911;function D(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=A,t.render=n,t.prototype.isReactComponent=t.__f=!0,t.displayName=\"ForwardRef(\"+(n.displayName||n.name)+\")\",t}var F=function(n,t){return null==n?null:r(r(n).map(t))},L={map:F,forEach:F,count:function(n){return n?r(n).length:0},only:function(n){var t=r(n);if(1!==t.length)throw\"Children.only\";return t[0]},toArray:r},O=e.__e;e.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);O(n,t,e,r)};var U=e.unmount;function V(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){\"function\"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return V(n,t,e)})),n}function W(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return W(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n}function P(){this.__u=0,this.o=null,this.__b=null}function j(n){var t=n.__&&n.__.__c;return t&&t.__a&&t.__a(n)}function z(n){var e,r,u,o=null;function i(i){if(e||(e=n()).then(function(n){n&&(o=n.default||n),u=!0},function(n){r=n,u=!0}),r)throw r;if(!u)throw e;return o?t(o,i):null}return i.displayName=\"Lazy\",i.__f=!0,i}function B(){this.i=null,this.l=null}e.unmount=function(n){var t=n.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),U&&U(n)},(P.prototype=new n).__c=function(n,t){var e=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(e);var u=j(r.__v),o=!1,i=function(){o||r.__z||(o=!0,e.__R=null,u?u(c):c())};e.__R=i;var l=e.__P;e.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=W(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=l,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},P.prototype.componentWillUnmount=function(){this.o=[]},P.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement(\"div\"),o=this.__v.__k[0].__c;this.__v.__k[0]=V(this.__b,r,o.__O=o.__P)}this.__b=null}var i=e.__a&&t(u,null,n.fallback);return i&&(i.__u&=-33),[t(u,null,e.__a?null:n.children),i]};var H=function(n,t,e){if(++e[1]===e[0]&&n.l.delete(t),n.props.revealOrder&&(\"t\"!==n.props.revealOrder[0]||!n.l.size))for(e=n.i;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.i=e=e[2]}};function Z(n){return this.getChildContext=function(){return n.context},n.children}function Y(n){var e=this,r=n.h;if(e.componentWillUnmount=function(){o(null,e.v),e.v=null,e.h=null},e.h&&e.h!==r&&e.componentWillUnmount(),!e.v){for(var u=e.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;e.h=r,e.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:u.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(n,t){this.childNodes.push(n),e.h.insertBefore(n,t)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.h.removeChild(n)}}}o(t(Z,{context:e.context},n.__v),e.v)}function $(n,e){var r=t(Y,{__v:n,h:e});return r.containerInfo=e,r}(B.prototype=new n).__a=function(n){var t=this,e=j(t.__v),r=t.l.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),H(t,n,r)):u()};e?e(o):o()}},B.prototype.render=function(n){this.i=null,this.l=new Map;var t=r(n.children);n.revealOrder&&\"b\"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return n.children},B.prototype.componentDidUpdate=B.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(t,e){H(n,e,t)})};var q=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.element\")||60103,G=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,J=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,K=/[A-Z0-9]/g,Q=\"undefined\"!=typeof document,X=function(n){return(\"undefined\"!=typeof Symbol&&\"symbol\"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};function nn(n,t,e){return null==t.__k&&(t.textContent=\"\"),o(n,t),\"function\"==typeof e&&e(),n?n.__c:null}function tn(n,t,e){return i(n,t),\"function\"==typeof e&&e(),n?n.__c:null}n.prototype.isReactComponent=!0,[\"componentWillMount\",\"componentWillReceiveProps\",\"componentWillUpdate\"].forEach(function(t){Object.defineProperty(n.prototype,t,{configurable:!0,get:function(){return this[\"UNSAFE_\"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var en=e.event;e.event=function(n){return en&&(n=en(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var rn,un={configurable:!0,get:function(){return this.class}},on=e.vnode;e.vnode=function(n){\"string\"==typeof n.type&&function(n){var t=n.props,e=n.type,u={},o=-1==e.indexOf(\"-\");for(var i in t){var l=t[i];if(!(\"value\"===i&&\"defaultValue\"in t&&null==l||Q&&\"children\"===i&&\"noscript\"===e||\"class\"===i||\"className\"===i)){var c=i.toLowerCase();\"defaultValue\"===i&&\"value\"in t&&null==t.value?i=\"value\":\"download\"===i&&!0===l?l=\"\":\"translate\"===c&&\"no\"===l?l=!1:\"o\"===c[0]&&\"n\"===c[1]?\"ondoubleclick\"===c?i=\"ondblclick\":\"onchange\"!==c||\"input\"!==e&&\"textarea\"!==e||X(t.type)?\"onfocus\"===c?i=\"onfocusin\":\"onblur\"===c?i=\"onfocusout\":J.test(i)&&(i=c):c=i=\"oninput\":o&&G.test(i)?i=i.replace(K,\"-$&\").toLowerCase():null===l&&(l=void 0),\"oninput\"===c&&u[i=c]&&(i=\"oninputCapture\"),u[i]=l}}\"select\"==e&&(u.multiple&&Array.isArray(u.value)&&(u.value=r(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),null!=u.defaultValue&&(u.value=r(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value}))),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,\"className\",un)):t.className&&(u.class=u.className=t.className),n.props=u}(n),n.$$typeof=q,on&&on(n)};var ln=e.__r;e.__r=function(n){ln&&ln(n),rn=n.__c};var cn=e.diffed;e.diffed=function(n){cn&&cn(n);var t=n.props,e=n.__e;null!=e&&\"textarea\"===n.type&&\"value\"in t&&t.value!==e.value&&(e.value=null==t.value?\"\":t.value),rn=null};var fn={ReactCurrentDispatcher:{current:{readContext:function(n){return rn.__n[n.__c].props.value},useCallback:v,useContext:d,useDebugValue:m,useDeferredValue:w,useEffect:h,useId:p,useImperativeHandle:y,useInsertionEffect:I,useLayoutEffect:s,useMemo:_,useReducer:b,useRef:S,useState:a,useSyncExternalStore:C,useTransition:k}}},an=\"18.3.1\";function sn(n){return t.bind(null,n)}function hn(n){return!!n&&n.$$typeof===q}function vn(n){return hn(n)&&n.type===u}function dn(n){return!!n&&\"string\"==typeof n.displayName&&0==n.displayName.indexOf(\"Memo(\")}function mn(n){return hn(n)?f.apply(null,arguments):n}function pn(n){return!!n.__k&&(o(null,n),!0)}function yn(n){return n&&(n.base||1===n.nodeType&&n)||null}var _n=function(n,t){return n(t)},bn=function(n,t){var r=e.debounceRendering;e.debounceRendering=function(n){return n()};var u=n(t);return e.debounceRendering=r,u},Sn=hn,gn={useState:a,useId:p,useReducer:b,useEffect:h,useLayoutEffect:s,useInsertionEffect:I,useTransition:k,useDeferredValue:w,useSyncExternalStore:C,startTransition:x,useRef:S,useImperativeHandle:y,useMemo:_,useCallback:v,useContext:d,useDebugValue:m,version:\"18.3.1\",Children:L,render:nn,hydrate:tn,unmountComponentAtNode:pn,createPortal:$,createElement:t,createContext:l,createFactory:sn,cloneElement:mn,createRef:c,Fragment:u,isValidElement:hn,isElement:Sn,isFragment:vn,isMemo:dn,findDOMNode:yn,Component:n,PureComponent:M,memo:N,forwardRef:D,flushSync:bn,unstable_batchedUpdates:_n,StrictMode:u,Suspense:P,SuspenseList:B,lazy:z,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:fn};export{L as Children,M as PureComponent,P as Suspense,B as SuspenseList,fn as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,mn as cloneElement,sn as createFactory,$ as createPortal,gn as default,yn as findDOMNode,bn as flushSync,D as forwardRef,tn as hydrate,Sn as isElement,vn as isFragment,dn as isMemo,hn as isValidElement,z as lazy,N as memo,nn as render,x as startTransition,pn as unmountComponentAtNode,_n as unstable_batchedUpdates,w as useDeferredValue,I as useInsertionEffect,C as useSyncExternalStore,k as useTransition,an as version};\n//# sourceMappingURL=compat.module.js.map\n","import * as PReact from \"./preact-shim.ts\";\r\n\r\ninterface ImageProps {\r\n href: string;\r\n x?: number;\r\n y?: number;\r\n height?: number;\r\n yOffset?: number;\r\n}\r\n\r\nexport const Image: PReact.FunctionComponent<ImageProps> = ({\r\n href,\r\n x,\r\n y = 0,\r\n height = 12\r\n}) => {\r\n\r\n return <image\r\n xlinkHref={href}\r\n x={x - height / 2}\r\n y={y - height / 2}\r\n width={height}\r\n height={height}\r\n ></image>;\r\n};\r\n","import * as PReact from \"./preact-shim.ts\";\r\nimport { Utility } from \"@hpcc-js/common\";\r\n\r\nexport interface ImageCharProps {\r\n x?: number;\r\n y?: number;\r\n height?: number;\r\n fill?: string;\r\n stroke?: string;\r\n fontFamily?: string;\r\n char?: string;\r\n yOffset?: number;\r\n fontWeight?: number;\r\n}\r\n\r\nexport const ImageChar: PReact.FunctionComponent<ImageCharProps> = ({\r\n x,\r\n y = 0,\r\n height = 12,\r\n fill,\r\n stroke,\r\n fontFamily = \"FontAwesome\",\r\n char = \"\",\r\n fontWeight\r\n}) => {\r\n\r\n const renderChar = PReact.useMemo(() => {\r\n return fontFamily === \"FontAwesome\" ? Utility.faChar(char) : char;\r\n }, [char, fontFamily]);\r\n\r\n return <text\r\n x={x}\r\n y={y}\r\n fill={fill}\r\n stroke={stroke}\r\n fontFamily={fontFamily}\r\n fontSize={`${height}px`}\r\n fontWeight={fontWeight}\r\n dominantBaseline=\"middle\"\r\n style={{ textAnchor: \"middle\", alignmentBaseline: \"middle\" }}\r\n >{renderChar}</text>;\r\n};\r\n","import * as PReact from \"./preact-shim.ts\";\r\n\r\ninterface CircleProps {\r\n radius?: number;\r\n fill?: string;\r\n stroke?: string;\r\n strokeWidth?: number;\r\n shapeRendering?: \"auto\" | \"optimizeSpeed\" | \"crispEdges\" | \"geometricPrecision\";\r\n}\r\n\r\nexport const Circle: PReact.FunctionComponent<CircleProps> = ({\r\n radius = 32,\r\n fill = \"navy\",\r\n stroke = fill,\r\n strokeWidth = 1,\r\n shapeRendering\r\n}) => <circle\r\n r={radius}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n shapeRendering={shapeRendering}\r\n />;\r\n\r\ninterface SquareProps {\r\n radius?: number;\r\n cornerRadius?: number;\r\n fill?: string;\r\n stroke?: string;\r\n strokeWidth?: number;\r\n shapeRendering?: \"auto\" | \"optimizeSpeed\" | \"crispEdges\" | \"geometricPrecision\";\r\n}\r\n\r\nexport const Square: PReact.FunctionComponent<SquareProps> = ({\r\n radius = 30,\r\n cornerRadius = 0,\r\n fill = \"white\",\r\n stroke,\r\n strokeWidth = 1,\r\n shapeRendering\r\n}) => <rect\r\n x={-radius}\r\n y={-radius}\r\n rx={cornerRadius}\r\n ry={cornerRadius}\r\n width={radius * 2}\r\n height={radius * 2}\r\n fill={fill}\r\n stroke={stroke || fill}\r\n strokeWidth={strokeWidth}\r\n shapeRendering={shapeRendering}\r\n />;\r\n\r\ninterface RectangleProps {\r\n width?: number;\r\n height?: number;\r\n cornerRadius?: number;\r\n fill?: string;\r\n stroke?: string;\r\n strokeWidth?: number;\r\n shapeRendering?: \"auto\" | \"optimizeSpeed\" | \"crispEdges\" | \"geometricPrecision\";\r\n}\r\n\r\nexport const Rectangle: PReact.FunctionComponent<RectangleProps> = ({\r\n width = 30,\r\n height = 30,\r\n cornerRadius = 0,\r\n fill = \"white\",\r\n stroke = \"black\",\r\n strokeWidth = 1,\r\n shapeRendering\r\n}) => {\r\n return <rect\r\n x={-width / 2}\r\n y={-height / 2}\r\n rx={cornerRadius}\r\n ry={cornerRadius}\r\n width={width}\r\n height={height}\r\n fill={fill}\r\n stroke={stroke || fill}\r\n strokeWidth={strokeWidth}\r\n shapeRendering={shapeRendering}\r\n />;\r\n};\r\n\r\ninterface ShapeProps {\r\n shape?: \"circle\" | \"square\" | \"rectangle\";\r\n height?: number;\r\n width?: number;\r\n fill?: string;\r\n stroke?: string;\r\n strokeWidth?: number;\r\n shapeRendering?: \"auto\" | \"optimizeSpeed\" | \"crispEdges\" | \"geometricPrecision\";\r\n cornerRadius?: number;\r\n}\r\n\r\nexport const Shape: PReact.FunctionComponent<ShapeProps> = ({\r\n shape = \"circle\",\r\n height = 128,\r\n width,\r\n fill,\r\n stroke,\r\n strokeWidth = 1,\r\n shapeRendering,\r\n cornerRadius\r\n}) => {\r\n switch (shape) {\r\n case \"square\":\r\n return <Square\r\n radius={height / 2}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n shapeRendering={shapeRendering}\r\n cornerRadius={cornerRadius}\r\n />;\r\n case \"rectangle\":\r\n return <Rectangle\r\n width={width ?? height}\r\n height={height}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n shapeRendering={shapeRendering}\r\n cornerRadius={cornerRadius}\r\n />;\r\n case \"circle\":\r\n default:\r\n return <Circle\r\n radius={height / 2}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n shapeRendering={shapeRendering}\r\n />;\r\n }\r\n};\r\n","import * as PReact from \"./preact-shim.ts\";\r\nimport { Palette } from \"@hpcc-js/common\";\r\nimport { Image } from \"./image.tsx\";\r\nimport { ImageChar } from \"./ImageChar.tsx\";\r\nimport { Shape } from \"./shape.tsx\";\r\n\r\nexport interface IconProps {\r\n shape?: \"circle\" | \"square\" | \"rectangle\";\r\n width?: number;\r\n height?: number;\r\n padding?: number;\r\n fill?: string;\r\n stroke?: string;\r\n strokeWidth?: number;\r\n imageUrl?: string;\r\n imageFontFamily?: string;\r\n imageChar?: string;\r\n imageCharFill?: string;\r\n xOffset?: number;\r\n yOffset?: number;\r\n cornerRadius?: number;\r\n shapeRendering?: \"auto\" | \"optimizeSpeed\" | \"crispEdges\" | \"geometricPrecision\";\r\n}\r\n\r\nexport const Icon: PReact.FunctionComponent<IconProps> = ({\r\n shape = \"circle\",\r\n width,\r\n height = 32,\r\n fill,\r\n stroke,\r\n strokeWidth = 0,\r\n imageUrl = \"\",\r\n imageFontFamily = \"FontAwesome\",\r\n imageChar = \"\",\r\n imageCharFill = Palette.textColor(fill),\r\n padding = height / 5,\r\n xOffset = 0,\r\n yOffset = 0,\r\n cornerRadius,\r\n shapeRendering\r\n}) => {\r\n return <>\r\n <Shape\r\n shape={shape}\r\n width={width}\r\n height={height}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n shapeRendering={shapeRendering}\r\n cornerRadius={cornerRadius}\r\n />\r\n {imageUrl ?\r\n <Image\r\n href={imageUrl}\r\n x={xOffset}\r\n y={yOffset}\r\n height={height - padding}\r\n ></Image> :\r\n <ImageChar\r\n x={xOffset}\r\n y={yOffset}\r\n height={height - padding}\r\n fontFamily={imageFontFamily}\r\n char={imageChar}\r\n fill={imageCharFill}\r\n fontWeight={400}\r\n ></ImageChar>\r\n }\r\n </>;\r\n};\r\n\r\nexport interface IconEx extends IconProps {\r\n id: string;\r\n}\r\n\r\nexport interface IconsProps {\r\n icons: IconEx[];\r\n}\r\n\r\nexport const Icons: PReact.FunctionComponent<IconsProps> = ({\r\n icons = []\r\n}) => {\r\n const IconComponents = icons.map(cat => {\r\n return <g\r\n key={cat.id}\r\n id={cat.id}\r\n >\r\n <Icon\r\n {...cat}\r\n />\r\n </g>;\r\n });\r\n return <>{IconComponents}</>;\r\n};\r\n","import * as PReact from \"./preact-shim.ts\";\r\nimport { Utility } from \"@hpcc-js/common\";\r\nimport { Icon } from \"./icon.tsx\";\r\nimport { Rectangle } from \"./shape.tsx\";\r\n\r\nexport interface TextLineProps {\r\n text: string;\r\n height?: number;\r\n anchor?: string;\r\n baseline?: string;\r\n fontFamily?: string;\r\n fill?: string;\r\n}\r\n\r\nexport const TextLine: PReact.FunctionComponent<TextLineProps> = ({\r\n text,\r\n height = 12,\r\n anchor = \"middle\",\r\n baseline = \"middle\",\r\n fontFamily = \"Verdana\",\r\n fill = \"black\"\r\n}) => {\r\n return <text\r\n font-family={fontFamily}\r\n font-size={`${height}px`}\r\n text-anchor={anchor}\r\n dominant-baseline={baseline}\r\n fill={fill}\r\n >{text}</text>;\r\n};\r\n\r\nexport interface TextProps {\r\n text: string;\r\n height?: number;\r\n fontFamily?: string;\r\n fill?: string;\r\n onSizeUpdate?: (size: { width: number, height: number }) => void;\r\n}\r\n\r\nexport const Text: PReact.FunctionComponent<TextProps> = ({\r\n text,\r\n height = 12,\r\n fontFamily = \"Verdana\",\r\n fill = \"black\",\r\n onSizeUpdate\r\n}) => {\r\n const [totalWidth, setTotalWidth] = PReact.useState(0);\r\n const [totalHeight, setTotalHeight] = PReact.useState(0);\r\n\r\n PReact.useEffect(() => {\r\n if (onSizeUpdate) {\r\n onSizeUpdate({ width: totalWidth, height: totalHeight });\r\n }\r\n }, [totalWidth, totalHeight, onSizeUpdate]);\r\n\r\n const parts = PReact.useMemo(() => {\r\n return text.split(\"\\n\");\r\n }, [text]);\r\n\r\n PReact.useLayoutEffect(() => {\r\n const size = Utility.textSize(parts, fontFamily, height);\r\n setTotalWidth(size.width);\r\n setTotalHeight(size.height);\r\n }, [fontFamily, height, parts]);\r\n\r\n const TextLines = PReact.useMemo(() => {\r\n const yOffset = -(totalHeight / 2) + (height / 2);\r\n return parts.map((p, i) => {\r\n return <g key={`key-${i}`} transform={`translate(0 ${yOffset + i * (height + 2)})`}>\r\n <TextLine\r\n text={p}\r\n height={height}\r\n fontFamily={fontFamily}\r\n fill={fill}\r\n />\r\n </g>;\r\n });\r\n }, [parts, totalHeight, height, fontFamily, fill]);\r\n\r\n return <g>{TextLines}</g>;\r\n};\r\n\r\nexport interface TextBoxProps {\r\n text: string;\r\n height?: number;\r\n fontFamily?: string;\r\n padding?: number;\r\n fill?: string;\r\n stroke?: string;\r\n textFill?: string;\r\n strokeWidth?: number;\r\n cornerRadius?: number;\r\n textOffsetY?: number;\r\n onSizeUpdate?: (size: { width: number, height: number }) => void;\r\n}\r\n\r\nexport const TextBox: PReact.FunctionComponent<TextBoxProps> = ({\r\n text,\r\n height = 12,\r\n fontFamily = \"Verdana\",\r\n padding = 4,\r\n fill = \"whitesmoke\",\r\n stroke = \"lightgray\",\r\n textFill = \"black\",\r\n strokeWidth = 1,\r\n cornerRadius = 0,\r\n onSizeUpdate\r\n}) => {\r\n const [textWidth, setTextWidthUpdate] = PReact.useState(0);\r\n const [textHeight, setTextHeightUpdate] = PReact.useState(0);\r\n\r\n PReact.useEffect(() => {\r\n if (onSizeUpdate) {\r\n onSizeUpdate({ width: textWidth, height: textHeight });\r\n }\r\n }, [textWidth, textHeight, onSizeUpdate]);\r\n\r\n const onTextSizeUpdate = PReact.useCallback(size => {\r\n setTextWidthUpdate(size.width);\r\n setTextHeightUpdate(size.height);\r\n }, []);\r\n\r\n const w = textWidth + padding * 2 + strokeWidth;\r\n const h = textHeight + padding * 2 + strokeWidth;\r\n const textOffsetY = Math.floor(height / 10);\r\n\r\n return <>\r\n <Rectangle\r\n width={w}\r\n height={h}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n cornerRadius={cornerRadius}\r\n />\r\n <g transform={`translate(0 ${textOffsetY})`}>\r\n <Text\r\n text={text}\r\n fontFamily={fontFamily}\r\n height={height}\r\n fill={textFill}\r\n onSizeUpdate={onTextSizeUpdate}\r\n />\r\n </g>\r\n </>;\r\n};\r\n\r\nexport interface LabelledRect extends TextBoxProps {\r\n width?: number;\r\n fontSize?: number;\r\n}\r\n\r\nexport const LabelledRect: PReact.FunctionComponent<LabelledRect> = ({\r\n text,\r\n height = 12,\r\n width = 12,\r\n fontFamily = \"Verdana\",\r\n fontSize = 10,\r\n padding = 3,\r\n fill = \"whitesmoke\",\r\n stroke = \"lightgray\",\r\n textFill = \"black\",\r\n strokeWidth = 1,\r\n cornerRadius = 0,\r\n onSizeUpdate\r\n}) => {\r\n\r\n const [actualWidth, setActualWidthUpdate] = PReact.useState(width);\r\n const [actualHeight, setActualHeightUpdate] = PReact.useState(height);\r\n\r\n PReact.useLayoutEffect(() => {\r\n const size = Utility.textSize(text, fontFamily, fontSize);\r\n setActualWidthUpdate(size.width + padding * 2);\r\n setActualHeightUpdate(size.height + padding * 2);\r\n }, [text, fontFamily, fontSize, padding]);\r\n\r\n PReact.useLayoutEffect(() => {\r\n if (onSizeUpdate) {\r\n onSizeUpdate({ width: actualWidth, height: actualHeight });\r\n }\r\n }, [actualWidth, actualHeight, padding, onSizeUpdate]);\r\n\r\n return <>\r\n <Rectangle\r\n width={width}\r\n height={height}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n cornerRadius={cornerRadius}\r\n />\r\n <g transform={`translate(${-(width / 2) + padding} ${-(height / 2) + padding})`}>\r\n <TextLine\r\n text={text}\r\n fontFamily={fontFamily}\r\n height={fontSize}\r\n fill={textFill}\r\n anchor=\"start\"\r\n baseline=\"hanging\"\r\n />\r\n </g>\r\n </>;\r\n};\r\n\r\nexport interface IconLabelledRect extends LabelledRect {\r\n icon: string;\r\n iconFontFamily?: string;\r\n iconFontSize?: number;\r\n}\r\n\r\nexport const IconLabelledRect: PReact.FunctionComponent<IconLabelledRect> = ({\r\n icon,\r\n iconFontFamily,\r\n text,\r\n height = 12,\r\n width = 12,\r\n fontFamily = \"Verdana\",\r\n fontSize = 10,\r\n padding = 3,\r\n fill = \"whitesmoke\",\r\n stroke = \"lightgray\",\r\n textFill = \"black\",\r\n strokeWidth = 1,\r\n cornerRadius = 0\r\n}) => {\r\n\r\n return <>\r\n <Rectangle\r\n width={width}\r\n height={height}\r\n fill={fill}\r\n stroke={stroke}\r\n strokeWidth={strokeWidth}\r\n cornerRadius={cornerRadius}\r\n />\r\n <g transform={`translate(${-(width / 2) + padding} ${-(height / 2) + padding})`}>\r\n <Icon\r\n shape=\"square\"\r\n imageFontFamily={iconFontFamily}\r\n imageChar={icon}\r\n height={height}\r\n fill={fill}\r\n imageCharFill={textFill}\r\n />\r\n </g>\r\n <g transform={`translate(${-(width / 2) + (padding * 2) + height} ${-(height / 2) + padding})`}>\r\n <TextLine\r\n text={text}\r\n fontFamily={fontFamily}\r\n height={fontSize}\r\n fill={textFill}\r\n anchor=\"start\"\r\n baseline=\"hanging\"\r\n />\r\n </g>\r\n </>;\r\n};\r\n","import * as PReact from \"./preact-shim.ts\";\r\nimport { VertexProps } from \"./vertex.tsx\";\r\nimport { Text } from \"./text.tsx\";\r\n\r\ntype Point = [number, number];\r\n\r\nexport interface EdgeProps<V extends VertexProps = VertexProps> {\r\n id: string | number;\r\n origData?: any;\r\n source: V;\r\n target: V;\r\n label?: string;\r\n labelPos?: Point;\r\n weight?: number;\r\n strokeDasharray?: string;\r\n strokeWidth?: number;\r\n stroke?: string;\r\n fontFamily?: string;\r\n labelFill?: string;\r\n labelHeight?: number,\r\n path?: string;\r\n points?: Array<[number, number]>;\r\n curveDepth?: number;\r\n}\r\n\r\nexport const Edge: PReact.FunctionComponent<EdgeProps> = ({\r\n label,\r\n labelPos,\r\n labelFill = \"black\",\r\n labelHeight = 12,\r\n path,\r\n stroke,\r\n strokeWidth,\r\n strokeDasharray\r\n}) => {\r\n return <>\r\n <path d={path} stroke={stroke} style={{ strokeWidth, strokeDasharray }}></path>\r\n {\r\n label && labelPos && labelPos.length === 2 ?\r\n <g transform={`translate(${labelPos[0]} ${labelPos[1]})`}>\r\n <Text text={label} fill={labelFill} height={labelHeight} />\r\n </g> : undefined\r\n }\r\n </>;\r\n};\r\n","import { h, FunctionComponent, render as preactRender } from \"preact\";\r\nimport { HTMLWidget, SVGWidget } from \"@hpcc-js/common\";\r\n\r\nexport function render<P>(C: FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) {\r\n preactRender(h(C, props), parent, replaceNode);\r\n}\r\n\r\nexport function svgRender<P>(C: FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) {\r\n preactRender(h(\"svg\", null, h(C, props)), parent, replaceNode);\r\n}\r\n\r\nexport class HTMLAdapter<P> extends HTMLWidget {\r\n\r\n props(): P;\r\n props(_: Partial<P>): this;\r\n props(_?: Partial<P>): P | this {\r\n if (!arguments.length) return this._props;\r\n this._props = { ...this._props, ..._ };\r\n return this;\r\n }\r\n\r\n prop<K extends keyof P>(_: K): P[K];\r\n prop<K extends keyof P>(_: K, value: P[K]): this;\r\n prop<K extends keyof P>(_: K, value?: P[K]): this | P[K] {\r\n if (arguments.length === 1) return this._props[_];\r\n this._props[_] = value;\r\n return this;\r\n }\r\n\r\n constructor(protected readonly _component: FunctionComponent<P>) {\r\n super();\r\n }\r\n\r\n update(domNode, element) {\r\n super.update(domNode, element);\r\n render(this._component, this._props, domNode);\r\n }\r\n}\r\nHTMLAdapter.prototype._class += \" react_HTMLAdapter\";\r\n\r\nexport interface HTMLAdapter<P> {\r\n _props: P;\r\n}\r\nHTMLAdapter.prototype.publish(\"props\", {}, \"object\", \"Properties\");\r\n\r\nexport class SVGAdapter<P> extends SVGWidget {\r\n\r\n props(): P;\r\n props(_: Partial<P>): this;\r\n props(_?: Partial<P>): P | this {\r\n if (!arguments.length) return this._props;\r\n this._props = { ...this._props, ..._ };\r\n return this;\r\n }\r\n\r\n prop<K extends keyof P>(_: K): P[K];\r\n prop<K extends keyof P>(_: K, value: P[K]): this;\r\n prop<K extends keyof P>(_: K, value?: P[K]): this | P[K] {\r\n if (arguments.length === 1) return this._props[_];\r\n this._props[_] = value;\r\n return this;\r\n }\r\n\r\n constructor(protected readonly _component: FunctionComponent<P>) {\r\n super();\r\n }\r\n\r\n update(domNode, element) {\r\n super.update(domNode, element);\r\n render(this._component, this._props, domNode);\r\n }\r\n}\r\nSVGAdapter.prototype._class += \" react_SVGAdapter\";\r\n\r\nexport interface SVGAdapter<P> {\r\n _props: P;\r\n}\r\nSVGAdapter.prototype.publish(\"props\", {}, \"object\", \"Properties\");\r\n","import * as PReact from \"./preact-shim.ts\";\r\n\r\nexport interface SpanProps {\r\n text: string;\r\n}\r\n\r\nexport const Span: PReact.FunctionComponent<SpanProps> = ({\r\n text\r\n}) => <span>{text}</span>;\r\n","import * as PReact from \"./preact-shim.ts\";\r\nimport { Icon, IconProps } from \"./icon.tsx\";\r\nimport { TextBox } from \"./text.tsx\";\r\n\r\nexport interface AnnotationsProps {\r\n x: number;\r\n y: number;\r\n annotationIDs: string[];\r\n stepSize?: number;\r\n}\r\n\r\nexport const Annotations: PReact.FunctionComponent<AnnotationsProps> = ({\r\n x,\r\n y,\r\n annotationIDs = [],\r\n stepSize = -16\r\n}) => {\r\n const IconComponents = annotationIDs.map((id, i) => <g\r\n key={id}\r\n transform={`translate(${x + i * stepSize} ${y})`}\r\n >\r\n <use\r\n xlinkHref={\"#\" + id}\r\n />\r\n </g>\r\n );\r\n return <>{IconComponents}</>;\r\n};\r\n\r\nexport interface VertexProps {\r\n id: string | number;\r\n origData?: any;\r\n centroid?: boolean;\r\n categoryID?: string;\r\n text: string;\r\n textHeight?: number;\r\n textPadding?: number;\r\n icon?: IconProps;\r\n annotationsHeight?: number;\r\n annotationIDs?: string[];\r\n textFill?: string;\r\n textboxFill?: string;\r\n textboxStroke?: string;\r\n textFontFamily?: string;\r\n onSizeUpdate?: (size: { width: number, height: number }) => void;\r\n showLabel?: boolean;\r\n scale?: number\r\n}\r\n\r\nexport con