@carandesign/drawui 0.2.1 → 0.2.3
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/CHANGELOG.md +12 -0
- package/README.md +153 -9
- package/dist/drawui.cjs.js +3 -3
- package/dist/drawui.es.js +588 -530
- package/dist/icons/IconHamburger.d.ts +3 -0
- package/dist/icons/index.d.ts +1 -0
- package/package.json +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
## [0.2.3] - 2026-01-19
|
|
3
|
+
### Edit
|
|
4
|
+
- Removed hover effect on DrawuiCard component
|
|
5
|
+
|
|
6
|
+
## [0.2.2] - 2026-01-19
|
|
7
|
+
### Added
|
|
8
|
+
- Component DrawuiCard has now dynamic height based on body content, otherwhise user can explicit height passing it as prop
|
|
9
|
+
|
|
10
|
+
## [0.2.1] - 2026-01-19
|
|
11
|
+
### Added
|
|
12
|
+
- Component support for `FillStyle` property of rough.js library
|
package/README.md
CHANGED
|
@@ -1,24 +1,168 @@
|
|
|
1
|
-
# DrawUI
|
|
1
|
+
# ✏️ DrawUI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
DrawUI is a React component library that brings a **hand-drawn, sketchy aesthetic** to your applications.
|
|
4
|
+
Powered by **Rough.js**, it helps you build playful, organic, and distinctive user interfaces that stand out from traditional design systems.
|
|
5
|
+
|
|
6
|
+
📖 Live documentation & interactive demos
|
|
7
|
+
https://drawui.caran.it
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Why DrawUI?
|
|
12
|
+
|
|
13
|
+
DrawUI is made for developers who want to add **personality and warmth** to their UI.
|
|
14
|
+
|
|
15
|
+
Perfect for:
|
|
16
|
+
- Creative projects
|
|
17
|
+
- Portfolios
|
|
18
|
+
- Educational tools
|
|
19
|
+
- Experimental or playful applications
|
|
5
20
|
|
|
6
21
|
---
|
|
7
22
|
|
|
8
23
|
## Features
|
|
9
24
|
|
|
10
|
-
- Hand-drawn
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
25
|
+
- Hand-drawn sketchy appearance powered by Rough.js
|
|
26
|
+
- Reusable React components
|
|
27
|
+
- Token-based theming system
|
|
28
|
+
- Built with TypeScript
|
|
29
|
+
- Lightweight and performant
|
|
30
|
+
- Easy to integrate with existing React projects
|
|
16
31
|
|
|
17
32
|
---
|
|
18
33
|
|
|
19
34
|
## Installation
|
|
20
35
|
|
|
36
|
+
Install DrawUI using your preferred package manager:
|
|
37
|
+
|
|
21
38
|
```bash
|
|
22
39
|
npm install @carandesign/drawui
|
|
23
40
|
# or
|
|
24
41
|
yarn add @carandesign/drawui
|
|
42
|
+
# or
|
|
43
|
+
pnpm add @carandesign/drawui
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Peer Dependencies
|
|
47
|
+
|
|
48
|
+
DrawUI requires React and Rough.js:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install react react-dom roughjs
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
Wrap your application with the DrawuiThemeProvider and start using components:
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { DrawuiThemeProvider, DrawuiButton } from '@carandesign/drawui';
|
|
62
|
+
|
|
63
|
+
function App() {
|
|
64
|
+
return (
|
|
65
|
+
<DrawuiThemeProvider>
|
|
66
|
+
<DrawuiButton>Click me!</DrawuiButton>
|
|
67
|
+
</DrawuiThemeProvider>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Theming
|
|
75
|
+
|
|
76
|
+
DrawUI uses a **token-based theming system** to keep styles consistent across components.
|
|
77
|
+
|
|
78
|
+
Customizable tokens include:
|
|
79
|
+
- Stroke (color and width)
|
|
80
|
+
- Roughness and bowing
|
|
81
|
+
- Fill styles
|
|
82
|
+
- Border radius
|
|
83
|
+
- Component sizes
|
|
84
|
+
|
|
85
|
+
### Custom Theme Example
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { DrawuiThemeProvider } from '@carandesign/drawui';
|
|
89
|
+
import type { DrawuiTheme } from '@carandesign/drawui';
|
|
90
|
+
|
|
91
|
+
const customTheme: Partial<DrawuiTheme> = {
|
|
92
|
+
stroke: {
|
|
93
|
+
thin: { color: '#2c3e50', width: 1.5 },
|
|
94
|
+
medium: { color: '#2c3e50', width: 2.5 },
|
|
95
|
+
thick: { color: '#2c3e50', width: 4 },
|
|
96
|
+
},
|
|
97
|
+
fill: {
|
|
98
|
+
background: '#ecf0f1',
|
|
99
|
+
},
|
|
100
|
+
roughness: {
|
|
101
|
+
roughness: 2,
|
|
102
|
+
bowing: 1,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
function App() {
|
|
107
|
+
return (
|
|
108
|
+
<DrawuiThemeProvider theme={customTheme}>
|
|
109
|
+
{/* Your app components */}
|
|
110
|
+
</DrawuiThemeProvider>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
📘 Full theming guide and token reference
|
|
116
|
+
https://drawui.caran.it
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Components
|
|
121
|
+
|
|
122
|
+
DrawUI includes a growing set of sketchy components:
|
|
123
|
+
|
|
124
|
+
- Button
|
|
125
|
+
- IconButton
|
|
126
|
+
- Card
|
|
127
|
+
- Divider
|
|
128
|
+
- Collapse / Accordion
|
|
129
|
+
- Icons (built-in icon set)
|
|
130
|
+
|
|
131
|
+
👉 View all components and live examples
|
|
132
|
+
https://drawui.caran.it
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Built with Rough.js
|
|
137
|
+
|
|
138
|
+
DrawUI is built on top of **Rough.js**, a lightweight graphics library that renders SVGs with a hand-drawn look.
|
|
139
|
+
|
|
140
|
+
Special thanks to **Preet Shihn** for creating Rough.js.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Contributing
|
|
145
|
+
|
|
146
|
+
Contributions, ideas, and feedback are welcome.
|
|
147
|
+
|
|
148
|
+
- Open an issue
|
|
149
|
+
- Submit a pull request
|
|
150
|
+
- Share your ideas
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Support the Project
|
|
155
|
+
|
|
156
|
+
If you find DrawUI useful or inspiring:
|
|
157
|
+
|
|
158
|
+
- ⭐ Star this repository on GitHub
|
|
159
|
+
- 🗣 Share it with other developers
|
|
160
|
+
- 🧪 Try it in your next creative project
|
|
161
|
+
|
|
162
|
+
Your support helps the project grow 🚀
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT License
|
package/dist/drawui.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react");var ie={exports:{}},B={};var Ae;function et(){if(Ae)return B;Ae=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(t,n,r){var a=null;if(r!==void 0&&(a=""+r),n.key!==void 0&&(a=""+n.key),"key"in n){r={};for(var i in n)i!=="key"&&(r[i]=n[i])}else r=n;return n=r.ref,{$$typeof:o,type:t,key:a,ref:n!==void 0?n:null,props:r}}return B.Fragment=e,B.jsx=s,B.jsxs=s,B}var Y={};var je;function tt(){return je||(je=1,process.env.NODE_ENV!=="production"&&(function(){function o(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===se?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case k:return"Fragment";case _:return"Profiler";case w:return"StrictMode";case J:return"Suspense";case K:return"SuspenseList";case te:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case m:return"Portal";case W:return p.displayName||"Context";case $:return(p._context.displayName||"Context")+".Consumer";case H:var M=p.render;return p=p.displayName,p||(p=M.displayName||M.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case ee:return M=p.displayName||null,M!==null?M:o(p.type)||"Memo";case j:M=p._payload,p=p._init;try{return o(p(M))}catch{}}return null}function e(p){return""+p}function s(p){try{e(p);var M=!1}catch{M=!0}if(M){M=console;var S=M.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return S.call(M,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),e(p)}}function t(p){if(p===k)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===j)return"<...>";try{var M=o(p);return M?"<"+M+">":"<...>"}catch{return"<...>"}}function n(){var p=E.A;return p===null?null:p.getOwner()}function r(){return Error("react-stack-top-frame")}function a(p){if(P.call(p,"key")){var M=Object.getOwnPropertyDescriptor(p,"key").get;if(M&&M.isReactWarning)return!1}return p.key!==void 0}function i(p,M){function S(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",M))}S.isReactWarning=!0,Object.defineProperty(p,"key",{get:S,configurable:!0})}function c(){var p=o(this.type);return F[p]||(F[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function l(p,M,S,R,oe,we){var T=S.ref;return p={$$typeof:g,type:p,key:M,props:S,_owner:R},(T!==void 0?T:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:c}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:oe}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:we}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,M,S,R,oe,we){var T=M.children;if(T!==void 0)if(R)if(A(T)){for(R=0;R<T.length;R++)h(T[R]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(T);if(P.call(M,"key")){T=o(p);var q=Object.keys(M).filter(function(Ke){return Ke!=="key"});R=0<q.length?"{key: someKey, "+q.join(": ..., ")+": ...}":"{key: someKey}",V[T+R]||(q=0<q.length?"{"+q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,T,E,q,E),V[E+T]=!0)}if(E=null,S!==void 0&&(s(S),E=""+S),i(w)&&(s(w.key),E=""+w.key),"key"in w){S={};for(var we in w)we!=="key"&&(S[we]=w[we])}else S=w;return E&&a(S,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,E,S,n(),oe,ve)}function h(p){f(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===j&&(p._payload.status==="fulfilled"?f(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function f(p){return typeof p=="object"&&p!==null&&p.$$typeof===g}var d=y,g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),W=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),R=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,A=Array.isArray,D=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(p){return p()}};var $,H={},ne=d.react_stack_bottom_frame.bind(d,r)(),re=D(t(r)),V={};Y.Fragment=b,Y.jsx=function(p,w,S){var T=1e4>R.recentlyCreatedOwnerStacks++;return u(p,w,S,!1,T?Error("react-stack-top-frame"):ne,T?D(t(p)):re)},Y.jsxs=function(p,w,S){var T=1e4>R.recentlyCreatedOwnerStacks++;return u(p,w,S,!0,T?Error("react-stack-top-frame"):ne,T?D(t(p)):re)}})()),Y}var $e;function st(){return $e||($e=1,process.env.NODE_ENV==="production"?ae.exports=et():ae.exports=tt()),ae.exports}var M=st();function Se(o,e,s){if(o&&o.length){const[t,n]=e,r=Math.PI/180*s,i=Math.cos(r),a=Math.sin(r);for(const c of o){const[l,u]=c;c[0]=(l-t)*i-(u-n)*a+t,c[1]=(l-t)*a+(u-n)*i+n}}}function nt(o,e,s){const t=[];o.forEach(n=>t.push(...n)),Se(t,e,s)}function rt(o,e){return o[0]===e[0]&&o[1]===e[1]}function ot(o,e,s,t=1){const n=s,r=Math.max(e,.1),i=o[0]&&o[0][0]&&typeof o[0][0]=="number"?[o]:o,a=[0,0];if(n)for(const l of i)Se(l,a,n);const c=at(i,r,t);if(n){for(const l of i)Se(l,a,-n);nt(c,a,-n)}return c}function at(o,e,s){const t=[];for(const l of o){const u=[...l];rt(u[0],u[u.length-1])||u.push([u[0][0],u[0][1]]),u.length>2&&t.push(u)}const n=[];e=Math.max(e,.1);const r=[];for(const l of t)for(let u=0;u<l.length-1;u++){const h=l[u],f=l[u+1];if(h[1]!==f[1]){const d=Math.min(h[1],f[1]);r.push({ymin:d,ymax:Math.max(h[1],f[1]),x:d===h[1]?h[0]:f[0],islope:(f[0]-h[0])/(f[1]-h[1])})}}if(r.sort((l,u)=>l.ymin<u.ymin?-1:l.ymin>u.ymin?1:l.x<u.x?-1:l.x>u.x?1:l.ymax===u.ymax?0:(l.ymax-u.ymax)/Math.abs(l.ymax-u.ymax)),!r.length)return n;let i=[],a=r[0].ymin,c=0;for(;i.length||r.length;){if(r.length){let l=-1;for(let h=0;h<r.length&&!(r[h].ymin>a);h++)l=h;r.splice(0,l+1).forEach(h=>{i.push({s:a,edge:h})})}if(i=i.filter(l=>!(l.edge.ymax<=a)),i.sort((l,u)=>l.edge.x===u.edge.x?0:(l.edge.x-u.edge.x)/Math.abs(l.edge.x-u.edge.x)),(s!==1||c%e===0)&&i.length>1)for(let l=0;l<i.length;l=l+2){const u=l+1;if(u>=i.length)break;const h=i[l].edge,f=i[u].edge;n.push([[Math.round(h.x),a],[Math.round(f.x),a]])}a+=s,i.forEach(l=>{l.edge.x=l.edge.x+s*l.edge.islope}),c++}return n}function X(o,e){var s;const t=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=e.strokeWidth*4),n=Math.round(Math.max(n,.1));let r=1;return e.roughness>=1&&(((s=e.randomizer)===null||s===void 0?void 0:s.next())||Math.random())>.7&&(r=n),ot(o,n,t,r||1)}class Ce{constructor(e){this.helper=e}fillPolygons(e,s){return this._fillPolygons(e,s)}_fillPolygons(e,s){const t=X(e,s);return{type:"fillSketch",ops:this.renderLines(t,s)}}renderLines(e,s){const t=[];for(const n of e)t.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],s));return t}}function be(o){const e=o[0],s=o[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class it extends Ce{fillPolygons(e,s){let t=s.hachureGap;t<0&&(t=s.strokeWidth*4),t=Math.max(t,.1);const n=Object.assign({},s,{hachureGap:t}),r=X(e,n),i=Math.PI/180*s.hachureAngle,a=[],c=t*.5*Math.cos(i),l=t*.5*Math.sin(i);for(const[h,f]of r)be([h,f])&&a.push([[h[0]-c,h[1]+l],[...f]],[[h[0]+c,h[1]-l],[...f]]);return{type:"fillSketch",ops:this.renderLines(a,s)}}}class ct extends Ce{fillPolygons(e,s){const t=this._fillPolygons(e,s),n=Object.assign({},s,{hachureAngle:s.hachureAngle+90}),r=this._fillPolygons(e,n);return t.ops=t.ops.concat(r.ops),t}}class ut{constructor(e){this.helper=e}fillPolygons(e,s){s=Object.assign({},s,{hachureAngle:0});const t=X(e,s);return this.dotsOnLines(t,s)}dotsOnLines(e,s){const t=[];let n=s.hachureGap;n<0&&(n=s.strokeWidth*4),n=Math.max(n,.1);let r=s.fillWeight;r<0&&(r=s.strokeWidth/2);const i=n/4;for(const a of e){const c=be(a),l=c/n,u=Math.ceil(l)-1,h=c-u*n,f=(a[0][0]+a[1][0])/2-n/4,d=Math.min(a[0][1],a[1][1]);for(let g=0;g<u;g++){const m=d+h+g*n,b=f-i+Math.random()*2*i,v=m-i+Math.random()*2*i,_=this.helper.ellipse(b,v,r,r,s);t.push(..._.ops)}}return{type:"fillSketch",ops:t}}}class lt{constructor(e){this.helper=e}fillPolygons(e,s){const t=X(e,s);return{type:"fillSketch",ops:this.dashedLine(t,s)}}dashedLine(e,s){const t=s.dashOffset<0?s.hachureGap<0?s.strokeWidth*4:s.hachureGap:s.dashOffset,n=s.dashGap<0?s.hachureGap<0?s.strokeWidth*4:s.hachureGap:s.dashGap,r=[];return e.forEach(i=>{const a=be(i),c=Math.floor(a/(t+n)),l=(a+n-c*(t+n))/2;let u=i[0],h=i[1];u[0]>h[0]&&(u=i[1],h=i[0]);const f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d<c;d++){const g=d*(t+n),m=g+t,b=[u[0]+g*Math.cos(f)+l*Math.cos(f),u[1]+g*Math.sin(f)+l*Math.sin(f)],v=[u[0]+m*Math.cos(f)+l*Math.cos(f),u[1]+m*Math.sin(f)+l*Math.sin(f)];r.push(...this.helper.doubleLineOps(b[0],b[1],v[0],v[1],s))}}),r}}class ht{constructor(e){this.helper=e}fillPolygons(e,s){const t=s.hachureGap<0?s.strokeWidth*4:s.hachureGap,n=s.zigzagOffset<0?t:s.zigzagOffset;s=Object.assign({},s,{hachureGap:t+n});const r=X(e,s);return{type:"fillSketch",ops:this.zigzagLines(r,n,s)}}zigzagLines(e,s,t){const n=[];return e.forEach(r=>{const i=be(r),a=Math.round(i/(2*s));let c=r[0],l=r[1];c[0]>l[0]&&(c=r[1],l=r[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let h=0;h<a;h++){const f=h*2*s,d=(h+1)*2*s,g=Math.sqrt(2*Math.pow(s,2)),m=[c[0]+f*Math.cos(u),c[1]+f*Math.sin(u)],b=[c[0]+d*Math.cos(u),c[1]+d*Math.sin(u)],v=[m[0]+g*Math.cos(u+Math.PI/4),m[1]+g*Math.sin(u+Math.PI/4)];n.push(...this.helper.doubleLineOps(m[0],m[1],v[0],v[1],t),...this.helper.doubleLineOps(v[0],v[1],b[0],b[1],t))}}),n}}const x={};function ft(o,e){let s=o.fillStyle||"hachure";if(!x[s])switch(s){case"zigzag":x[s]||(x[s]=new it(e));break;case"cross-hatch":x[s]||(x[s]=new ct(e));break;case"dots":x[s]||(x[s]=new ut(e));break;case"dashed":x[s]||(x[s]=new lt(e));break;case"zigzag-line":x[s]||(x[s]=new ht(e));break;default:s="hachure",x[s]||(x[s]=new Ce(e));break}return x[s]}function dt(){return Math.floor(Math.random()*2**31)}class pt{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const gt=0,Pe=1,Ve=2,ie={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function mt(o){const e=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:gt,text:RegExp.$1},o=o.substr(RegExp.$1.length);else if(o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))e[e.length]={type:Pe,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length);else return[];return e[e.length]={type:Ve,text:""},e}function Me(o,e){return o.type===e}function Le(o){const e=[],s=mt(o);let t="BOD",n=0,r=s[n];for(;!Me(r,Ve);){let i=0;const a=[];if(t==="BOD")if(r.text==="M"||r.text==="m")n++,i=ie[r.text],t=r.text;else return Le("M0,0"+o);else Me(r,Pe)?i=ie[t]:(n++,i=ie[r.text],t=r.text);if(n+i<s.length){for(let c=n;c<n+i;c++){const l=s[c];if(Me(l,Pe))a[a.length]=+l.text;else throw new Error("Param not a number: "+t+","+l.text)}if(typeof ie[t]=="number"){const c={key:t,data:a};e.push(c),n+=i,r=s[n],t==="M"&&(t="L"),t==="m"&&(t="l")}else throw new Error("Bad segment: "+t)}else throw new Error("Path data ended short")}return e}function Be(o){let e=0,s=0,t=0,n=0;const r=[];for(const{key:i,data:a}of o)switch(i){case"M":r.push({key:"M",data:[...a]}),[e,s]=a,[t,n]=a;break;case"m":e+=a[0],s+=a[1],r.push({key:"M",data:[e,s]}),t=e,n=s;break;case"L":r.push({key:"L",data:[...a]}),[e,s]=a;break;case"l":e+=a[0],s+=a[1],r.push({key:"L",data:[e,s]});break;case"C":r.push({key:"C",data:[...a]}),e=a[4],s=a[5];break;case"c":{const c=a.map((l,u)=>u%2?l+s:l+e);r.push({key:"C",data:c}),e=c[4],s=c[5];break}case"Q":r.push({key:"Q",data:[...a]}),e=a[2],s=a[3];break;case"q":{const c=a.map((l,u)=>u%2?l+s:l+e);r.push({key:"Q",data:c}),e=c[2],s=c[3];break}case"A":r.push({key:"A",data:[...a]}),e=a[5],s=a[6];break;case"a":e+=a[5],s+=a[6],r.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,s]});break;case"H":r.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],r.push({key:"H",data:[e]});break;case"V":r.push({key:"V",data:[...a]}),s=a[0];break;case"v":s+=a[0],r.push({key:"V",data:[s]});break;case"S":r.push({key:"S",data:[...a]}),e=a[2],s=a[3];break;case"s":{const c=a.map((l,u)=>u%2?l+s:l+e);r.push({key:"S",data:c}),e=c[2],s=c[3];break}case"T":r.push({key:"T",data:[...a]}),e=a[0],s=a[1];break;case"t":e+=a[0],s+=a[1],r.push({key:"T",data:[e,s]});break;case"Z":case"z":r.push({key:"Z",data:[]}),e=t,s=n;break}return r}function Ye(o){const e=[];let s="",t=0,n=0,r=0,i=0,a=0,c=0;for(const{key:l,data:u}of o){switch(l){case"M":e.push({key:"M",data:[...u]}),[t,n]=u,[r,i]=u;break;case"C":e.push({key:"C",data:[...u]}),t=u[4],n=u[5],a=u[2],c=u[3];break;case"L":e.push({key:"L",data:[...u]}),[t,n]=u;break;case"H":t=u[0],e.push({key:"L",data:[t,n]});break;case"V":n=u[0],e.push({key:"L",data:[t,n]});break;case"S":{let h=0,f=0;s==="C"||s==="S"?(h=t+(t-a),f=n+(n-c)):(h=t,f=n),e.push({key:"C",data:[h,f,...u]}),a=u[0],c=u[1],t=u[2],n=u[3];break}case"T":{const[h,f]=u;let d=0,g=0;s==="Q"||s==="T"?(d=t+(t-a),g=n+(n-c)):(d=t,g=n);const m=t+2*(d-t)/3,b=n+2*(g-n)/3,v=h+2*(d-h)/3,_=f+2*(g-f)/3;e.push({key:"C",data:[m,b,v,_,h,f]}),a=d,c=g,t=h,n=f;break}case"Q":{const[h,f,d,g]=u,m=t+2*(h-t)/3,b=n+2*(f-n)/3,v=d+2*(h-d)/3,_=g+2*(f-g)/3;e.push({key:"C",data:[m,b,v,_,d,g]}),a=h,c=f,t=d,n=g;break}case"A":{const h=Math.abs(u[0]),f=Math.abs(u[1]),d=u[2],g=u[3],m=u[4],b=u[5],v=u[6];h===0||f===0?(e.push({key:"C",data:[t,n,b,v,b,v]}),t=b,n=v):(t!==b||n!==v)&&(Ze(t,n,b,v,h,f,d,g,m).forEach(function(I){e.push({key:"C",data:I})}),t=b,n=v);break}case"Z":e.push({key:"Z",data:[]}),t=r,n=i;break}s=l}return e}function kt(o){return Math.PI*o/180}function Z(o,e,s){const t=o*Math.cos(s)-e*Math.sin(s),n=o*Math.sin(s)+e*Math.cos(s);return[t,n]}function Ze(o,e,s,t,n,r,i,a,c,l){const u=kt(i);let h=[],f=0,d=0,g=0,m=0;if(l)[f,d,g,m]=l;else{[o,e]=Z(o,e,-u),[s,t]=Z(s,t,-u);const R=(o-s)/2,P=(e-t)/2;let A=R*R/(n*n)+P*P/(r*r);A>1&&(A=Math.sqrt(A),n=A*n,r=A*r);const D=a===c?-1:1,$=n*n,H=r*r,ne=$*H-$*P*P-H*R*R,re=$*P*P+H*R*R,V=D*Math.sqrt(Math.abs(ne/re));g=V*n*P/r+(o+s)/2,m=V*-r*R/n+(e+t)/2,f=Math.asin(parseFloat(((e-m)/r).toFixed(9))),d=Math.asin(parseFloat(((t-m)/r).toFixed(9))),o<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=Math.PI*2+f),d<0&&(d=Math.PI*2+d),c&&f>d&&(f=f-Math.PI*2),!c&&d>f&&(d=d-Math.PI*2)}let b=d-f;if(Math.abs(b)>Math.PI*120/180){const R=d,P=s,A=t;c&&d>f?d=f+Math.PI*120/180*1:d=f+Math.PI*120/180*-1,s=g+n*Math.cos(d),t=m+r*Math.sin(d),h=Ze(s,t,P,A,n,r,i,0,c,[d,R,g,m])}b=d-f;const v=Math.cos(f),_=Math.sin(f),I=Math.cos(d),W=Math.sin(d),F=Math.tan(b/4),J=4/3*n*F,K=4/3*r*F,ee=[o,e],j=[o+J*_,e-K*v],te=[s+J*W,t-K*I],se=[s,t];if(j[0]=2*ee[0]-j[0],j[1]=2*ee[1]-j[1],l)return[j,te,se].concat(h);{h=[j,te,se].concat(h);const R=[];for(let P=0;P<h.length;P+=3){const A=Z(h[P][0],h[P][1],u),D=Z(h[P+1][0],h[P+1][1],u),$=Z(h[P+2][0],h[P+2][1],u);R.push([A[0],A[1],D[0],D[1],$[0],$[1]])}return R}}const bt={randOffset:_t,randOffsetWithRange:St,ellipse:Mt,doubleLineOps:Pt};function Ue(o,e,s,t,n){return{type:"path",ops:z(o,e,s,t,n)}}function he(o,e,s){const t=(o||[]).length;if(t>2){const n=[];for(let r=0;r<t-1;r++)n.push(...z(o[r][0],o[r][1],o[r+1][0],o[r+1][1],s));return e&&n.push(...z(o[t-1][0],o[t-1][1],o[0][0],o[0][1],s)),{type:"path",ops:n}}else if(t===2)return Ue(o[0][0],o[0][1],o[1][0],o[1][1],s);return{type:"path",ops:[]}}function vt(o,e){return he(o,!0,e)}function wt(o,e,s,t,n){const r=[[o,e],[o+s,e],[o+s,e+t],[o,e+t]];return vt(r,n)}function De(o,e){if(o.length){const t=typeof o[0][0]=="number"?[o]:o,n=ce(t[0],1*(1+e.roughness*.2),e),r=e.disableMultiStroke?[]:ce(t[0],1.5*(1+e.roughness*.22),Ne(e));for(let i=1;i<t.length;i++){const a=t[i];if(a.length){const c=ce(a,1*(1+e.roughness*.2),e),l=e.disableMultiStroke?[]:ce(a,1.5*(1+e.roughness*.22),Ne(e));for(const u of c)u.op!=="move"&&n.push(u);for(const u of l)u.op!=="move"&&r.push(u)}}return{type:"path",ops:n.concat(r)}}return{type:"path",ops:[]}}function Mt(o,e,s,t,n){const r=Xe(s,t,n);return Te(o,e,n,r).opset}function Xe(o,e,s){const t=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(o/2,2)+Math.pow(e/2,2))/2)),n=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*t)),r=Math.PI*2/n;let i=Math.abs(o/2),a=Math.abs(e/2);const c=1-s.curveFitting;return i+=k(i*c,s),a+=k(a*c,s),{increment:r,rx:i,ry:a}}function Te(o,e,s,t){const[n,r]=We(t.increment,o,e,t.rx,t.ry,1,t.increment*pe(.1,pe(.4,1,s),s),s);let i=ge(n,null,s);if(!s.disableMultiStroke&&s.roughness!==0){const[a]=We(t.increment,o,e,t.rx,t.ry,1.5,0,s),c=ge(a,null,s);i=i.concat(c)}return{estimatedPoints:r,opset:{type:"path",ops:i}}}function ze(o,e,s,t,n,r,i,a,c){const l=o,u=e;let h=Math.abs(s/2),f=Math.abs(t/2);h+=k(h*.01,c),f+=k(f*.01,c);let d=n,g=r;for(;d<0;)d+=Math.PI*2,g+=Math.PI*2;g-d>Math.PI*2&&(d=0,g=Math.PI*2);const m=Math.PI*2/c.curveStepCount,b=Math.min(m/2,(g-d)/2),v=Fe(b,l,u,h,f,d,g,1,c);if(!c.disableMultiStroke){const _=Fe(b,l,u,h,f,d,g,1.5,c);v.push(..._)}return i&&(a?v.push(...z(l,u,l+h*Math.cos(d),u+f*Math.sin(d),c),...z(l,u,l+h*Math.cos(g),u+f*Math.sin(g),c)):v.push({op:"lineTo",data:[l,u]},{op:"lineTo",data:[l+h*Math.cos(d),u+f*Math.sin(d)]})),{type:"path",ops:v}}function Ie(o,e){const s=Ye(Be(Le(o))),t=[];let n=[0,0],r=[0,0];for(const{key:i,data:a}of s)switch(i){case"M":{r=[a[0],a[1]],n=[a[0],a[1]];break}case"L":t.push(...z(r[0],r[1],a[0],a[1],e)),r=[a[0],a[1]];break;case"C":{const[c,l,u,h,f,d]=a;t.push(...Tt(c,l,u,h,f,d,r,e)),r=[f,d];break}case"Z":t.push(...z(r[0],r[1],n[0],n[1],e)),r=[n[0],n[1]];break}return{type:"path",ops:t}}function ye(o,e){const s=[];for(const t of o)if(t.length){const n=e.maxRandomnessOffset||0,r=t.length;if(r>2){s.push({op:"move",data:[t[0][0]+k(n,e),t[0][1]+k(n,e)]});for(let i=1;i<r;i++)s.push({op:"lineTo",data:[t[i][0]+k(n,e),t[i][1]+k(n,e)]})}}return{type:"fillPath",ops:s}}function G(o,e){return ft(e,bt).fillPolygons(o,e)}function yt(o,e,s,t,n,r,i){const a=o,c=e;let l=Math.abs(s/2),u=Math.abs(t/2);l+=k(l*.01,i),u+=k(u*.01,i);let h=n,f=r;for(;h<0;)h+=Math.PI*2,f+=Math.PI*2;f-h>Math.PI*2&&(h=0,f=Math.PI*2);const d=(f-h)/i.curveStepCount,g=[];for(let m=h;m<=f;m=m+d)g.push([a+l*Math.cos(m),c+u*Math.sin(m)]);return g.push([a+l*Math.cos(f),c+u*Math.sin(f)]),g.push([a,c]),G([g],i)}function _t(o,e){return k(o,e)}function St(o,e,s){return pe(o,e,s)}function Pt(o,e,s,t,n){return z(o,e,s,t,n,!0)}function Ne(o){const e=Object.assign({},o);return e.randomizer=void 0,o.seed&&(e.seed=o.seed+1),e}function Qe(o){return o.randomizer||(o.randomizer=new pt(o.seed||0)),o.randomizer.next()}function pe(o,e,s,t=1){return s.roughness*t*(Qe(s)*(e-o)+o)}function k(o,e,s=1){return pe(-o,o,e,s)}function z(o,e,s,t,n,r=!1){const i=r?n.disableMultiStrokeFill:n.disableMultiStroke,a=Ee(o,e,s,t,n,!0,!1);if(i)return a;const c=Ee(o,e,s,t,n,!0,!0);return a.concat(c)}function Ee(o,e,s,t,n,r,i){const a=Math.pow(o-s,2)+Math.pow(e-t,2),c=Math.sqrt(a);let l=1;c<200?l=1:c>500?l=.4:l=-.0016668*c+1.233334;let u=n.maxRandomnessOffset||0;u*u*100>a&&(u=c/10);const h=u/2,f=.2+Qe(n)*.2;let d=n.bowing*n.maxRandomnessOffset*(t-e)/200,g=n.bowing*n.maxRandomnessOffset*(o-s)/200;d=k(d,n,l),g=k(g,n,l);const m=[],b=()=>k(h,n,l),v=()=>k(u,n,l),_=n.preserveVertices;return i?m.push({op:"move",data:[o+(_?0:b()),e+(_?0:b())]}):m.push({op:"move",data:[o+(_?0:k(u,n,l)),e+(_?0:k(u,n,l))]}),i?m.push({op:"bcurveTo",data:[d+o+(s-o)*f+b(),g+e+(t-e)*f+b(),d+o+2*(s-o)*f+b(),g+e+2*(t-e)*f+b(),s+(_?0:b()),t+(_?0:b())]}):m.push({op:"bcurveTo",data:[d+o+(s-o)*f+v(),g+e+(t-e)*f+v(),d+o+2*(s-o)*f+v(),g+e+2*(t-e)*f+v(),s+(_?0:v()),t+(_?0:v())]}),m}function ce(o,e,s){if(!o.length)return[];const t=[];t.push([o[0][0]+k(e,s),o[0][1]+k(e,s)]),t.push([o[0][0]+k(e,s),o[0][1]+k(e,s)]);for(let n=1;n<o.length;n++)t.push([o[n][0]+k(e,s),o[n][1]+k(e,s)]),n===o.length-1&&t.push([o[n][0]+k(e,s),o[n][1]+k(e,s)]);return ge(t,null,s)}function ge(o,e,s){const t=o.length,n=[];if(t>3){const r=[],i=1-s.curveTightness;n.push({op:"move",data:[o[1][0],o[1][1]]});for(let a=1;a+2<t;a++){const c=o[a];r[0]=[c[0],c[1]],r[1]=[c[0]+(i*o[a+1][0]-i*o[a-1][0])/6,c[1]+(i*o[a+1][1]-i*o[a-1][1])/6],r[2]=[o[a+1][0]+(i*o[a][0]-i*o[a+2][0])/6,o[a+1][1]+(i*o[a][1]-i*o[a+2][1])/6],r[3]=[o[a+1][0],o[a+1][1]],n.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}}else t===3?(n.push({op:"move",data:[o[1][0],o[1][1]]}),n.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[2][0],o[2][1]]})):t===2&&n.push(...Ee(o[0][0],o[0][1],o[1][0],o[1][1],s,!0,!0));return n}function We(o,e,s,t,n,r,i,a){const c=a.roughness===0,l=[],u=[];if(c){o=o/4,u.push([e+t*Math.cos(-o),s+n*Math.sin(-o)]);for(let h=0;h<=Math.PI*2;h=h+o){const f=[e+t*Math.cos(h),s+n*Math.sin(h)];l.push(f),u.push(f)}u.push([e+t*Math.cos(0),s+n*Math.sin(0)]),u.push([e+t*Math.cos(o),s+n*Math.sin(o)])}else{const h=k(.5,a)-Math.PI/2;u.push([k(r,a)+e+.9*t*Math.cos(h-o),k(r,a)+s+.9*n*Math.sin(h-o)]);const f=Math.PI*2+h-.01;for(let d=h;d<f;d=d+o){const g=[k(r,a)+e+t*Math.cos(d),k(r,a)+s+n*Math.sin(d)];l.push(g),u.push(g)}u.push([k(r,a)+e+t*Math.cos(h+Math.PI*2+i*.5),k(r,a)+s+n*Math.sin(h+Math.PI*2+i*.5)]),u.push([k(r,a)+e+.98*t*Math.cos(h+i),k(r,a)+s+.98*n*Math.sin(h+i)]),u.push([k(r,a)+e+.9*t*Math.cos(h+i*.5),k(r,a)+s+.9*n*Math.sin(h+i*.5)])}return[u,l]}function Fe(o,e,s,t,n,r,i,a,c){const l=r+k(.1,c),u=[];u.push([k(a,c)+e+.9*t*Math.cos(l-o),k(a,c)+s+.9*n*Math.sin(l-o)]);for(let h=l;h<=i;h=h+o)u.push([k(a,c)+e+t*Math.cos(h),k(a,c)+s+n*Math.sin(h)]);return u.push([e+t*Math.cos(i),s+n*Math.sin(i)]),u.push([e+t*Math.cos(i),s+n*Math.sin(i)]),ge(u,null,c)}function Tt(o,e,s,t,n,r,i,a){const c=[],l=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const h=a.disableMultiStroke?1:2,f=a.preserveVertices;for(let d=0;d<h;d++)d===0?c.push({op:"move",data:[i[0],i[1]]}):c.push({op:"move",data:[i[0]+(f?0:k(l[0],a)),i[1]+(f?0:k(l[0],a))]}),u=f?[n,r]:[n+k(l[d],a),r+k(l[d],a)],c.push({op:"bcurveTo",data:[o+k(l[d],a),e+k(l[d],a),s+k(l[d],a),t+k(l[d],a),u[0],u[1]]});return c}function U(o){return[...o]}function He(o,e=0){const s=o.length;if(s<3)throw new Error("A curve must have at least three points.");const t=[];if(s===3)t.push(U(o[0]),U(o[1]),U(o[2]),U(o[2]));else{const n=[];n.push(o[0],o[0]);for(let a=1;a<o.length;a++)n.push(o[a]),a===o.length-1&&n.push(o[a]);const r=[],i=1-e;t.push(U(n[0]));for(let a=1;a+2<n.length;a++){const c=n[a];r[0]=[c[0],c[1]],r[1]=[c[0]+(i*n[a+1][0]-i*n[a-1][0])/6,c[1]+(i*n[a+1][1]-i*n[a-1][1])/6],r[2]=[n[a+1][0]+(i*n[a][0]-i*n[a+2][0])/6,n[a+1][1]+(i*n[a][1]-i*n[a+2][1])/6],r[3]=[n[a+1][0],n[a+1][1]],t.push(r[1],r[2],r[3])}}return t}function Et(o,e){return Math.sqrt(fe(o,e))}function fe(o,e){return Math.pow(o[0]-e[0],2)+Math.pow(o[1]-e[1],2)}function Rt(o,e,s){const t=fe(e,s);if(t===0)return fe(o,e);let n=((o[0]-e[0])*(s[0]-e[0])+(o[1]-e[1])*(s[1]-e[1]))/t;return n=Math.max(0,Math.min(1,n)),fe(o,N(e,s,n))}function N(o,e,s){return[o[0]+(e[0]-o[0])*s,o[1]+(e[1]-o[1])*s]}function xt(o,e){const s=o[e+0],t=o[e+1],n=o[e+2],r=o[e+3];let i=3*t[0]-2*s[0]-r[0];i*=i;let a=3*t[1]-2*s[1]-r[1];a*=a;let c=3*n[0]-2*r[0]-s[0];c*=c;let l=3*n[1]-2*r[1]-s[1];return l*=l,i<c&&(i=c),a<l&&(a=l),i+a}function Re(o,e,s,t){const n=t||[];if(xt(o,e)<s){const r=o[e+0];n.length?Et(n[n.length-1],r)>1&&n.push(r):n.push(r),n.push(o[e+3])}else{const i=o[e+0],a=o[e+1],c=o[e+2],l=o[e+3],u=N(i,a,.5),h=N(a,c,.5),f=N(c,l,.5),d=N(u,h,.5),g=N(h,f,.5),m=N(d,g,.5);Re([i,u,d,m],0,s,n),Re([m,g,f,l],0,s,n)}return n}function Ot(o,e){return me(o,0,o.length,e)}function me(o,e,s,t,n){const r=n||[],i=o[e],a=o[s-1];let c=0,l=1;for(let u=e+1;u<s-1;++u){const h=Rt(o[u],i,a);h>c&&(c=h,l=u)}return Math.sqrt(c)>t?(me(o,e,l+1,t,r),me(o,l,s,t,r)):(r.length||r.push(i),r.push(a)),r}function xe(o,e=.15,s){const t=[],n=(o.length-1)/3;for(let r=0;r<n;r++){const i=r*3;Re(o,i,e,t)}return s&&s>0?me(t,0,t.length,s):t}function Ct(o,e,s){const t=Le(o),n=Ye(Be(t)),r=[];let i=[],a=[0,0],c=[];const l=()=>{c.length>=4&&i.push(...xe(c,e)),c=[]},u=()=>{l(),i.length&&(r.push(i),i=[])};for(const{key:f,data:d}of n)switch(f){case"M":u(),a=[d[0],d[1]],i.push(a);break;case"L":l(),i.push([d[0],d[1]]);break;case"C":if(!c.length){const g=i.length?i[i.length-1]:a;c.push([g[0],g[1]])}c.push([d[0],d[1]]),c.push([d[2],d[3]]),c.push([d[4],d[5]]);break;case"Z":l(),i.push([a[0],a[1]]);break}if(u(),!s)return r;const h=[];for(const f of r){const d=Ot(f,s);d.length&&h.push(d)}return h}const C="none";class ke{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return dt()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,s,t){return{shape:e,sets:s||[],options:t||this.defaultOptions}}line(e,s,t,n,r){const i=this._o(r);return this._d("line",[Ue(e,s,t,n,i)],i)}rectangle(e,s,t,n,r){const i=this._o(r),a=[],c=wt(e,s,t,n,i);if(i.fill){const l=[[e,s],[e+t,s],[e+t,s+n],[e,s+n]];i.fillStyle==="solid"?a.push(ye([l],i)):a.push(G([l],i))}return i.stroke!==C&&a.push(c),this._d("rectangle",a,i)}ellipse(e,s,t,n,r){const i=this._o(r),a=[],c=Xe(t,n,i),l=Te(e,s,i,c);if(i.fill)if(i.fillStyle==="solid"){const u=Te(e,s,i,c).opset;u.type="fillPath",a.push(u)}else a.push(G([l.estimatedPoints],i));return i.stroke!==C&&a.push(l.opset),this._d("ellipse",a,i)}circle(e,s,t,n){const r=this.ellipse(e,s,t,t,n);return r.shape="circle",r}linearPath(e,s){const t=this._o(s);return this._d("linearPath",[he(e,!1,t)],t)}arc(e,s,t,n,r,i,a=!1,c){const l=this._o(c),u=[],h=ze(e,s,t,n,r,i,a,!0,l);if(a&&l.fill)if(l.fillStyle==="solid"){const f=Object.assign({},l);f.disableMultiStroke=!0;const d=ze(e,s,t,n,r,i,!0,!1,f);d.type="fillPath",u.push(d)}else u.push(yt(e,s,t,n,r,i,l));return l.stroke!==C&&u.push(h),this._d("arc",u,l)}curve(e,s){const t=this._o(s),n=[],r=De(e,t);if(t.fill&&t.fill!==C)if(t.fillStyle==="solid"){const i=De(e,Object.assign(Object.assign({},t),{disableMultiStroke:!0,roughness:t.roughness?t.roughness+t.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(i.ops)})}else{const i=[],a=e;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const u of l)u.length<3?i.push(...u):u.length===3?i.push(...xe(He([u[0],u[0],u[1],u[2]]),10,(1+t.roughness)/2)):i.push(...xe(He(u),10,(1+t.roughness)/2))}i.length&&n.push(G([i],t))}return t.stroke!==C&&n.push(r),this._d("curve",n,t)}polygon(e,s){const t=this._o(s),n=[],r=he(e,!0,t);return t.fill&&(t.fillStyle==="solid"?n.push(ye([e],t)):n.push(G([e],t))),t.stroke!==C&&n.push(r),this._d("polygon",n,t)}path(e,s){const t=this._o(s),n=[];if(!e)return this._d("path",n,t);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=t.fill&&t.fill!=="transparent"&&t.fill!==C,i=t.stroke!==C,a=!!(t.simplification&&t.simplification<1),c=a?4-4*(t.simplification||1):(1+t.roughness)/2,l=Ct(e,1,c),u=Ie(e,t);if(r)if(t.fillStyle==="solid")if(l.length===1){const h=Ie(e,Object.assign(Object.assign({},t),{disableMultiStroke:!0,roughness:t.roughness?t.roughness+t.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else n.push(ye(l,t));else n.push(G(l,t));return i&&(a?l.forEach(h=>{n.push(he(h,!1,t))}):n.push(u)),this._d("path",n,t)}opsToPath(e,s){let t="";for(const n of e.ops){const r=typeof s=="number"&&s>=0?n.data.map(i=>+i.toFixed(s)):n.data;switch(n.op){case"move":t+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":t+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":t+=`L${r[0]} ${r[1]} `;break}}return t.trim()}toPaths(e){const s=e.sets||[],t=e.options||this.defaultOptions,n=[];for(const r of s){let i=null;switch(r.type){case"path":i={d:this.opsToPath(r),stroke:t.stroke,strokeWidth:t.strokeWidth,fill:C};break;case"fillPath":i={d:this.opsToPath(r),stroke:C,strokeWidth:0,fill:t.fill||C};break;case"fillSketch":i=this.fillSketch(r,t);break}i&&n.push(i)}return n}fillSketch(e,s){let t=s.fillWeight;return t<0&&(t=s.strokeWidth/2),{d:this.opsToPath(e),stroke:s.fill||C,strokeWidth:t,fill:C}}_mergedShape(e){return e.filter((s,t)=>t===0?!0:s.op!=="move")}}class Lt{constructor(e,s){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ke(s)}draw(e){const s=e.sets||[],t=e.options||this.getDefaultOptions(),n=this.ctx,r=e.options.fixedDecimalPlaceDigits;for(const i of s)switch(i.type){case"path":n.save(),n.strokeStyle=t.stroke==="none"?"transparent":t.stroke,n.lineWidth=t.strokeWidth,t.strokeLineDash&&n.setLineDash(t.strokeLineDash),t.strokeLineDashOffset&&(n.lineDashOffset=t.strokeLineDashOffset),this._drawToContext(n,i,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=t.fill||"";const a=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,i,r,a),n.restore();break}case"fillSketch":this.fillSketch(n,i,t);break}}fillSketch(e,s,t){let n=t.fillWeight;n<0&&(n=t.strokeWidth/2),e.save(),t.fillLineDash&&e.setLineDash(t.fillLineDash),t.fillLineDashOffset&&(e.lineDashOffset=t.fillLineDashOffset),e.strokeStyle=t.fill||"",e.lineWidth=n,this._drawToContext(e,s,t.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,s,t,n="nonzero"){e.beginPath();for(const r of s.ops){const i=typeof t=="number"&&t>=0?r.data.map(a=>+a.toFixed(t)):r.data;switch(r.op){case"move":e.moveTo(i[0],i[1]);break;case"bcurveTo":e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case"lineTo":e.lineTo(i[0],i[1]);break}}s.type==="fillPath"?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,s,t,n,r){const i=this.gen.line(e,s,t,n,r);return this.draw(i),i}rectangle(e,s,t,n,r){const i=this.gen.rectangle(e,s,t,n,r);return this.draw(i),i}ellipse(e,s,t,n,r){const i=this.gen.ellipse(e,s,t,n,r);return this.draw(i),i}circle(e,s,t,n){const r=this.gen.circle(e,s,t,n);return this.draw(r),r}linearPath(e,s){const t=this.gen.linearPath(e,s);return this.draw(t),t}polygon(e,s){const t=this.gen.polygon(e,s);return this.draw(t),t}arc(e,s,t,n,r,i,a=!1,c){const l=this.gen.arc(e,s,t,n,r,i,a,c);return this.draw(l),l}curve(e,s){const t=this.gen.curve(e,s);return this.draw(t),t}path(e,s){const t=this.gen.path(e,s);return this.draw(t),t}}const ue="http://www.w3.org/2000/svg";class At{constructor(e,s){this.svg=e,this.gen=new ke(s)}draw(e){const s=e.sets||[],t=e.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,r=n.createElementNS(ue,"g"),i=e.options.fixedDecimalPlaceDigits;for(const a of s){let c=null;switch(a.type){case"path":{c=n.createElementNS(ue,"path"),c.setAttribute("d",this.opsToPath(a,i)),c.setAttribute("stroke",t.stroke),c.setAttribute("stroke-width",t.strokeWidth+""),c.setAttribute("fill","none"),t.strokeLineDash&&c.setAttribute("stroke-dasharray",t.strokeLineDash.join(" ").trim()),t.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${t.strokeLineDashOffset}`);break}case"fillPath":{c=n.createElementNS(ue,"path"),c.setAttribute("d",this.opsToPath(a,i)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",t.fill||""),(e.shape==="curve"||e.shape==="polygon")&&c.setAttribute("fill-rule","evenodd");break}case"fillSketch":{c=this.fillSketch(n,a,t);break}}c&&r.appendChild(c)}return r}fillSketch(e,s,t){let n=t.fillWeight;n<0&&(n=t.strokeWidth/2);const r=e.createElementNS(ue,"path");return r.setAttribute("d",this.opsToPath(s,t.fixedDecimalPlaceDigits)),r.setAttribute("stroke",t.fill||""),r.setAttribute("stroke-width",n+""),r.setAttribute("fill","none"),t.fillLineDash&&r.setAttribute("stroke-dasharray",t.fillLineDash.join(" ").trim()),t.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${t.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,s){return this.gen.opsToPath(e,s)}line(e,s,t,n,r){const i=this.gen.line(e,s,t,n,r);return this.draw(i)}rectangle(e,s,t,n,r){const i=this.gen.rectangle(e,s,t,n,r);return this.draw(i)}ellipse(e,s,t,n,r){const i=this.gen.ellipse(e,s,t,n,r);return this.draw(i)}circle(e,s,t,n){const r=this.gen.circle(e,s,t,n);return this.draw(r)}linearPath(e,s){const t=this.gen.linearPath(e,s);return this.draw(t)}polygon(e,s){const t=this.gen.polygon(e,s);return this.draw(t)}arc(e,s,t,n,r,i,a=!1,c){const l=this.gen.arc(e,s,t,n,r,i,a,c);return this.draw(l)}curve(e,s){const t=this.gen.curve(e,s);return this.draw(t)}path(e,s){const t=this.gen.path(e,s);return this.draw(t)}}const L={canvas(o,e){return new Lt(o,e)},svg(o,e){return new At(o,e)},generator(o){return new ke(o)},newSeed(){return ke.newSeed()}},Q=(o,e,s,t,n)=>`M${o+n},${e}
|
|
6
|
+
<%s key={someKey} {...props} />`,R,T,q,T),V[T+R]=!0)}if(T=null,S!==void 0&&(s(S),T=""+S),a(M)&&(s(M.key),T=""+M.key),"key"in M){S={};for(var ve in M)ve!=="key"&&(S[ve]=M[ve])}else S=M;return T&&i(S,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,T,S,n(),oe,we)}function h(p){f(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===j&&(p._payload.status==="fulfilled"?f(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function f(p){return typeof p=="object"&&p!==null&&p.$$typeof===g}var d=v,g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),W=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),E=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,A=Array.isArray,I=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(p){return p()}};var D,F={},ne=d.react_stack_bottom_frame.bind(d,r)(),re=I(t(r)),V={};Y.Fragment=k,Y.jsx=function(p,M,S){var R=1e4>E.recentlyCreatedOwnerStacks++;return u(p,M,S,!1,R?Error("react-stack-top-frame"):ne,R?I(t(p)):re)},Y.jsxs=function(p,M,S){var R=1e4>E.recentlyCreatedOwnerStacks++;return u(p,M,S,!0,R?Error("react-stack-top-frame"):ne,R?I(t(p)):re)}})()),Y}var $e;function st(){return $e||($e=1,process.env.NODE_ENV==="production"?ie.exports=et():ie.exports=tt()),ie.exports}var y=st();function Se(o,e,s){if(o&&o.length){const[t,n]=e,r=Math.PI/180*s,a=Math.cos(r),i=Math.sin(r);for(const c of o){const[l,u]=c;c[0]=(l-t)*a-(u-n)*i+t,c[1]=(l-t)*i+(u-n)*a+n}}}function nt(o,e,s){const t=[];o.forEach(n=>t.push(...n)),Se(t,e,s)}function rt(o,e){return o[0]===e[0]&&o[1]===e[1]}function ot(o,e,s,t=1){const n=s,r=Math.max(e,.1),a=o[0]&&o[0][0]&&typeof o[0][0]=="number"?[o]:o,i=[0,0];if(n)for(const l of a)Se(l,i,n);const c=it(a,r,t);if(n){for(const l of a)Se(l,i,-n);nt(c,i,-n)}return c}function it(o,e,s){const t=[];for(const l of o){const u=[...l];rt(u[0],u[u.length-1])||u.push([u[0][0],u[0][1]]),u.length>2&&t.push(u)}const n=[];e=Math.max(e,.1);const r=[];for(const l of t)for(let u=0;u<l.length-1;u++){const h=l[u],f=l[u+1];if(h[1]!==f[1]){const d=Math.min(h[1],f[1]);r.push({ymin:d,ymax:Math.max(h[1],f[1]),x:d===h[1]?h[0]:f[0],islope:(f[0]-h[0])/(f[1]-h[1])})}}if(r.sort((l,u)=>l.ymin<u.ymin?-1:l.ymin>u.ymin?1:l.x<u.x?-1:l.x>u.x?1:l.ymax===u.ymax?0:(l.ymax-u.ymax)/Math.abs(l.ymax-u.ymax)),!r.length)return n;let a=[],i=r[0].ymin,c=0;for(;a.length||r.length;){if(r.length){let l=-1;for(let h=0;h<r.length&&!(r[h].ymin>i);h++)l=h;r.splice(0,l+1).forEach(h=>{a.push({s:i,edge:h})})}if(a=a.filter(l=>!(l.edge.ymax<=i)),a.sort((l,u)=>l.edge.x===u.edge.x?0:(l.edge.x-u.edge.x)/Math.abs(l.edge.x-u.edge.x)),(s!==1||c%e===0)&&a.length>1)for(let l=0;l<a.length;l=l+2){const u=l+1;if(u>=a.length)break;const h=a[l].edge,f=a[u].edge;n.push([[Math.round(h.x),i],[Math.round(f.x),i]])}i+=s,a.forEach(l=>{l.edge.x=l.edge.x+s*l.edge.islope}),c++}return n}function X(o,e){var s;const t=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=e.strokeWidth*4),n=Math.round(Math.max(n,.1));let r=1;return e.roughness>=1&&(((s=e.randomizer)===null||s===void 0?void 0:s.next())||Math.random())>.7&&(r=n),ot(o,n,t,r||1)}class Ce{constructor(e){this.helper=e}fillPolygons(e,s){return this._fillPolygons(e,s)}_fillPolygons(e,s){const t=X(e,s);return{type:"fillSketch",ops:this.renderLines(t,s)}}renderLines(e,s){const t=[];for(const n of e)t.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],s));return t}}function be(o){const e=o[0],s=o[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class at extends Ce{fillPolygons(e,s){let t=s.hachureGap;t<0&&(t=s.strokeWidth*4),t=Math.max(t,.1);const n=Object.assign({},s,{hachureGap:t}),r=X(e,n),a=Math.PI/180*s.hachureAngle,i=[],c=t*.5*Math.cos(a),l=t*.5*Math.sin(a);for(const[h,f]of r)be([h,f])&&i.push([[h[0]-c,h[1]+l],[...f]],[[h[0]+c,h[1]-l],[...f]]);return{type:"fillSketch",ops:this.renderLines(i,s)}}}class ct extends Ce{fillPolygons(e,s){const t=this._fillPolygons(e,s),n=Object.assign({},s,{hachureAngle:s.hachureAngle+90}),r=this._fillPolygons(e,n);return t.ops=t.ops.concat(r.ops),t}}class ut{constructor(e){this.helper=e}fillPolygons(e,s){s=Object.assign({},s,{hachureAngle:0});const t=X(e,s);return this.dotsOnLines(t,s)}dotsOnLines(e,s){const t=[];let n=s.hachureGap;n<0&&(n=s.strokeWidth*4),n=Math.max(n,.1);let r=s.fillWeight;r<0&&(r=s.strokeWidth/2);const a=n/4;for(const i of e){const c=be(i),l=c/n,u=Math.ceil(l)-1,h=c-u*n,f=(i[0][0]+i[1][0])/2-n/4,d=Math.min(i[0][1],i[1][1]);for(let g=0;g<u;g++){const m=d+h+g*n,k=f-a+Math.random()*2*a,w=m-a+Math.random()*2*a,_=this.helper.ellipse(k,w,r,r,s);t.push(..._.ops)}}return{type:"fillSketch",ops:t}}}class lt{constructor(e){this.helper=e}fillPolygons(e,s){const t=X(e,s);return{type:"fillSketch",ops:this.dashedLine(t,s)}}dashedLine(e,s){const t=s.dashOffset<0?s.hachureGap<0?s.strokeWidth*4:s.hachureGap:s.dashOffset,n=s.dashGap<0?s.hachureGap<0?s.strokeWidth*4:s.hachureGap:s.dashGap,r=[];return e.forEach(a=>{const i=be(a),c=Math.floor(i/(t+n)),l=(i+n-c*(t+n))/2;let u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);const f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d<c;d++){const g=d*(t+n),m=g+t,k=[u[0]+g*Math.cos(f)+l*Math.cos(f),u[1]+g*Math.sin(f)+l*Math.sin(f)],w=[u[0]+m*Math.cos(f)+l*Math.cos(f),u[1]+m*Math.sin(f)+l*Math.sin(f)];r.push(...this.helper.doubleLineOps(k[0],k[1],w[0],w[1],s))}}),r}}class ht{constructor(e){this.helper=e}fillPolygons(e,s){const t=s.hachureGap<0?s.strokeWidth*4:s.hachureGap,n=s.zigzagOffset<0?t:s.zigzagOffset;s=Object.assign({},s,{hachureGap:t+n});const r=X(e,s);return{type:"fillSketch",ops:this.zigzagLines(r,n,s)}}zigzagLines(e,s,t){const n=[];return e.forEach(r=>{const a=be(r),i=Math.round(a/(2*s));let c=r[0],l=r[1];c[0]>l[0]&&(c=r[1],l=r[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let h=0;h<i;h++){const f=h*2*s,d=(h+1)*2*s,g=Math.sqrt(2*Math.pow(s,2)),m=[c[0]+f*Math.cos(u),c[1]+f*Math.sin(u)],k=[c[0]+d*Math.cos(u),c[1]+d*Math.sin(u)],w=[m[0]+g*Math.cos(u+Math.PI/4),m[1]+g*Math.sin(u+Math.PI/4)];n.push(...this.helper.doubleLineOps(m[0],m[1],w[0],w[1],t),...this.helper.doubleLineOps(w[0],w[1],k[0],k[1],t))}}),n}}const O={};function ft(o,e){let s=o.fillStyle||"hachure";if(!O[s])switch(s){case"zigzag":O[s]||(O[s]=new at(e));break;case"cross-hatch":O[s]||(O[s]=new ct(e));break;case"dots":O[s]||(O[s]=new ut(e));break;case"dashed":O[s]||(O[s]=new lt(e));break;case"zigzag-line":O[s]||(O[s]=new ht(e));break;default:s="hachure",O[s]||(O[s]=new Ce(e));break}return O[s]}function dt(){return Math.floor(Math.random()*2**31)}class pt{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const gt=0,Pe=1,Ve=2,ae={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function mt(o){const e=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:gt,text:RegExp.$1},o=o.substr(RegExp.$1.length);else if(o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))e[e.length]={type:Pe,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length);else return[];return e[e.length]={type:Ve,text:""},e}function Me(o,e){return o.type===e}function Le(o){const e=[],s=mt(o);let t="BOD",n=0,r=s[n];for(;!Me(r,Ve);){let a=0;const i=[];if(t==="BOD")if(r.text==="M"||r.text==="m")n++,a=ae[r.text],t=r.text;else return Le("M0,0"+o);else Me(r,Pe)?a=ae[t]:(n++,a=ae[r.text],t=r.text);if(n+a<s.length){for(let c=n;c<n+a;c++){const l=s[c];if(Me(l,Pe))i[i.length]=+l.text;else throw new Error("Param not a number: "+t+","+l.text)}if(typeof ae[t]=="number"){const c={key:t,data:i};e.push(c),n+=a,r=s[n],t==="M"&&(t="L"),t==="m"&&(t="l")}else throw new Error("Bad segment: "+t)}else throw new Error("Path data ended short")}return e}function Be(o){let e=0,s=0,t=0,n=0;const r=[];for(const{key:a,data:i}of o)switch(a){case"M":r.push({key:"M",data:[...i]}),[e,s]=i,[t,n]=i;break;case"m":e+=i[0],s+=i[1],r.push({key:"M",data:[e,s]}),t=e,n=s;break;case"L":r.push({key:"L",data:[...i]}),[e,s]=i;break;case"l":e+=i[0],s+=i[1],r.push({key:"L",data:[e,s]});break;case"C":r.push({key:"C",data:[...i]}),e=i[4],s=i[5];break;case"c":{const c=i.map((l,u)=>u%2?l+s:l+e);r.push({key:"C",data:c}),e=c[4],s=c[5];break}case"Q":r.push({key:"Q",data:[...i]}),e=i[2],s=i[3];break;case"q":{const c=i.map((l,u)=>u%2?l+s:l+e);r.push({key:"Q",data:c}),e=c[2],s=c[3];break}case"A":r.push({key:"A",data:[...i]}),e=i[5],s=i[6];break;case"a":e+=i[5],s+=i[6],r.push({key:"A",data:[i[0],i[1],i[2],i[3],i[4],e,s]});break;case"H":r.push({key:"H",data:[...i]}),e=i[0];break;case"h":e+=i[0],r.push({key:"H",data:[e]});break;case"V":r.push({key:"V",data:[...i]}),s=i[0];break;case"v":s+=i[0],r.push({key:"V",data:[s]});break;case"S":r.push({key:"S",data:[...i]}),e=i[2],s=i[3];break;case"s":{const c=i.map((l,u)=>u%2?l+s:l+e);r.push({key:"S",data:c}),e=c[2],s=c[3];break}case"T":r.push({key:"T",data:[...i]}),e=i[0],s=i[1];break;case"t":e+=i[0],s+=i[1],r.push({key:"T",data:[e,s]});break;case"Z":case"z":r.push({key:"Z",data:[]}),e=t,s=n;break}return r}function Ye(o){const e=[];let s="",t=0,n=0,r=0,a=0,i=0,c=0;for(const{key:l,data:u}of o){switch(l){case"M":e.push({key:"M",data:[...u]}),[t,n]=u,[r,a]=u;break;case"C":e.push({key:"C",data:[...u]}),t=u[4],n=u[5],i=u[2],c=u[3];break;case"L":e.push({key:"L",data:[...u]}),[t,n]=u;break;case"H":t=u[0],e.push({key:"L",data:[t,n]});break;case"V":n=u[0],e.push({key:"L",data:[t,n]});break;case"S":{let h=0,f=0;s==="C"||s==="S"?(h=t+(t-i),f=n+(n-c)):(h=t,f=n),e.push({key:"C",data:[h,f,...u]}),i=u[0],c=u[1],t=u[2],n=u[3];break}case"T":{const[h,f]=u;let d=0,g=0;s==="Q"||s==="T"?(d=t+(t-i),g=n+(n-c)):(d=t,g=n);const m=t+2*(d-t)/3,k=n+2*(g-n)/3,w=h+2*(d-h)/3,_=f+2*(g-f)/3;e.push({key:"C",data:[m,k,w,_,h,f]}),i=d,c=g,t=h,n=f;break}case"Q":{const[h,f,d,g]=u,m=t+2*(h-t)/3,k=n+2*(f-n)/3,w=d+2*(h-d)/3,_=g+2*(f-g)/3;e.push({key:"C",data:[m,k,w,_,d,g]}),i=h,c=f,t=d,n=g;break}case"A":{const h=Math.abs(u[0]),f=Math.abs(u[1]),d=u[2],g=u[3],m=u[4],k=u[5],w=u[6];h===0||f===0?(e.push({key:"C",data:[t,n,k,w,k,w]}),t=k,n=w):(t!==k||n!==w)&&(Ze(t,n,k,w,h,f,d,g,m).forEach(function($){e.push({key:"C",data:$})}),t=k,n=w);break}case"Z":e.push({key:"Z",data:[]}),t=r,n=a;break}s=l}return e}function kt(o){return Math.PI*o/180}function Z(o,e,s){const t=o*Math.cos(s)-e*Math.sin(s),n=o*Math.sin(s)+e*Math.cos(s);return[t,n]}function Ze(o,e,s,t,n,r,a,i,c,l){const u=kt(a);let h=[],f=0,d=0,g=0,m=0;if(l)[f,d,g,m]=l;else{[o,e]=Z(o,e,-u),[s,t]=Z(s,t,-u);const E=(o-s)/2,P=(e-t)/2;let A=E*E/(n*n)+P*P/(r*r);A>1&&(A=Math.sqrt(A),n=A*n,r=A*r);const I=i===c?-1:1,D=n*n,F=r*r,ne=D*F-D*P*P-F*E*E,re=D*P*P+F*E*E,V=I*Math.sqrt(Math.abs(ne/re));g=V*n*P/r+(o+s)/2,m=V*-r*E/n+(e+t)/2,f=Math.asin(parseFloat(((e-m)/r).toFixed(9))),d=Math.asin(parseFloat(((t-m)/r).toFixed(9))),o<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=Math.PI*2+f),d<0&&(d=Math.PI*2+d),c&&f>d&&(f=f-Math.PI*2),!c&&d>f&&(d=d-Math.PI*2)}let k=d-f;if(Math.abs(k)>Math.PI*120/180){const E=d,P=s,A=t;c&&d>f?d=f+Math.PI*120/180*1:d=f+Math.PI*120/180*-1,s=g+n*Math.cos(d),t=m+r*Math.sin(d),h=Ze(s,t,P,A,n,r,a,0,c,[d,E,g,m])}k=d-f;const w=Math.cos(f),_=Math.sin(f),$=Math.cos(d),W=Math.sin(d),H=Math.tan(k/4),J=4/3*n*H,K=4/3*r*H,ee=[o,e],j=[o+J*_,e-K*w],te=[s+J*W,t-K*$],se=[s,t];if(j[0]=2*ee[0]-j[0],j[1]=2*ee[1]-j[1],l)return[j,te,se].concat(h);{h=[j,te,se].concat(h);const E=[];for(let P=0;P<h.length;P+=3){const A=Z(h[P][0],h[P][1],u),I=Z(h[P+1][0],h[P+1][1],u),D=Z(h[P+2][0],h[P+2][1],u);E.push([A[0],A[1],I[0],I[1],D[0],D[1]])}return E}}const bt={randOffset:_t,randOffsetWithRange:St,ellipse:Mt,doubleLineOps:Pt};function Ue(o,e,s,t,n){return{type:"path",ops:z(o,e,s,t,n)}}function he(o,e,s){const t=(o||[]).length;if(t>2){const n=[];for(let r=0;r<t-1;r++)n.push(...z(o[r][0],o[r][1],o[r+1][0],o[r+1][1],s));return e&&n.push(...z(o[t-1][0],o[t-1][1],o[0][0],o[0][1],s)),{type:"path",ops:n}}else if(t===2)return Ue(o[0][0],o[0][1],o[1][0],o[1][1],s);return{type:"path",ops:[]}}function wt(o,e){return he(o,!0,e)}function vt(o,e,s,t,n){const r=[[o,e],[o+s,e],[o+s,e+t],[o,e+t]];return wt(r,n)}function De(o,e){if(o.length){const t=typeof o[0][0]=="number"?[o]:o,n=ce(t[0],1*(1+e.roughness*.2),e),r=e.disableMultiStroke?[]:ce(t[0],1.5*(1+e.roughness*.22),Ne(e));for(let a=1;a<t.length;a++){const i=t[a];if(i.length){const c=ce(i,1*(1+e.roughness*.2),e),l=e.disableMultiStroke?[]:ce(i,1.5*(1+e.roughness*.22),Ne(e));for(const u of c)u.op!=="move"&&n.push(u);for(const u of l)u.op!=="move"&&r.push(u)}}return{type:"path",ops:n.concat(r)}}return{type:"path",ops:[]}}function Mt(o,e,s,t,n){const r=Xe(s,t,n);return Re(o,e,n,r).opset}function Xe(o,e,s){const t=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(o/2,2)+Math.pow(e/2,2))/2)),n=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*t)),r=Math.PI*2/n;let a=Math.abs(o/2),i=Math.abs(e/2);const c=1-s.curveFitting;return a+=b(a*c,s),i+=b(i*c,s),{increment:r,rx:a,ry:i}}function Re(o,e,s,t){const[n,r]=We(t.increment,o,e,t.rx,t.ry,1,t.increment*pe(.1,pe(.4,1,s),s),s);let a=ge(n,null,s);if(!s.disableMultiStroke&&s.roughness!==0){const[i]=We(t.increment,o,e,t.rx,t.ry,1.5,0,s),c=ge(i,null,s);a=a.concat(c)}return{estimatedPoints:r,opset:{type:"path",ops:a}}}function Ie(o,e,s,t,n,r,a,i,c){const l=o,u=e;let h=Math.abs(s/2),f=Math.abs(t/2);h+=b(h*.01,c),f+=b(f*.01,c);let d=n,g=r;for(;d<0;)d+=Math.PI*2,g+=Math.PI*2;g-d>Math.PI*2&&(d=0,g=Math.PI*2);const m=Math.PI*2/c.curveStepCount,k=Math.min(m/2,(g-d)/2),w=He(k,l,u,h,f,d,g,1,c);if(!c.disableMultiStroke){const _=He(k,l,u,h,f,d,g,1.5,c);w.push(..._)}return a&&(i?w.push(...z(l,u,l+h*Math.cos(d),u+f*Math.sin(d),c),...z(l,u,l+h*Math.cos(g),u+f*Math.sin(g),c)):w.push({op:"lineTo",data:[l,u]},{op:"lineTo",data:[l+h*Math.cos(d),u+f*Math.sin(d)]})),{type:"path",ops:w}}function ze(o,e){const s=Ye(Be(Le(o))),t=[];let n=[0,0],r=[0,0];for(const{key:a,data:i}of s)switch(a){case"M":{r=[i[0],i[1]],n=[i[0],i[1]];break}case"L":t.push(...z(r[0],r[1],i[0],i[1],e)),r=[i[0],i[1]];break;case"C":{const[c,l,u,h,f,d]=i;t.push(...Rt(c,l,u,h,f,d,r,e)),r=[f,d];break}case"Z":t.push(...z(r[0],r[1],n[0],n[1],e)),r=[n[0],n[1]];break}return{type:"path",ops:t}}function ye(o,e){const s=[];for(const t of o)if(t.length){const n=e.maxRandomnessOffset||0,r=t.length;if(r>2){s.push({op:"move",data:[t[0][0]+b(n,e),t[0][1]+b(n,e)]});for(let a=1;a<r;a++)s.push({op:"lineTo",data:[t[a][0]+b(n,e),t[a][1]+b(n,e)]})}}return{type:"fillPath",ops:s}}function G(o,e){return ft(e,bt).fillPolygons(o,e)}function yt(o,e,s,t,n,r,a){const i=o,c=e;let l=Math.abs(s/2),u=Math.abs(t/2);l+=b(l*.01,a),u+=b(u*.01,a);let h=n,f=r;for(;h<0;)h+=Math.PI*2,f+=Math.PI*2;f-h>Math.PI*2&&(h=0,f=Math.PI*2);const d=(f-h)/a.curveStepCount,g=[];for(let m=h;m<=f;m=m+d)g.push([i+l*Math.cos(m),c+u*Math.sin(m)]);return g.push([i+l*Math.cos(f),c+u*Math.sin(f)]),g.push([i,c]),G([g],a)}function _t(o,e){return b(o,e)}function St(o,e,s){return pe(o,e,s)}function Pt(o,e,s,t,n){return z(o,e,s,t,n,!0)}function Ne(o){const e=Object.assign({},o);return e.randomizer=void 0,o.seed&&(e.seed=o.seed+1),e}function Qe(o){return o.randomizer||(o.randomizer=new pt(o.seed||0)),o.randomizer.next()}function pe(o,e,s,t=1){return s.roughness*t*(Qe(s)*(e-o)+o)}function b(o,e,s=1){return pe(-o,o,e,s)}function z(o,e,s,t,n,r=!1){const a=r?n.disableMultiStrokeFill:n.disableMultiStroke,i=Te(o,e,s,t,n,!0,!1);if(a)return i;const c=Te(o,e,s,t,n,!0,!0);return i.concat(c)}function Te(o,e,s,t,n,r,a){const i=Math.pow(o-s,2)+Math.pow(e-t,2),c=Math.sqrt(i);let l=1;c<200?l=1:c>500?l=.4:l=-.0016668*c+1.233334;let u=n.maxRandomnessOffset||0;u*u*100>i&&(u=c/10);const h=u/2,f=.2+Qe(n)*.2;let d=n.bowing*n.maxRandomnessOffset*(t-e)/200,g=n.bowing*n.maxRandomnessOffset*(o-s)/200;d=b(d,n,l),g=b(g,n,l);const m=[],k=()=>b(h,n,l),w=()=>b(u,n,l),_=n.preserveVertices;return a?m.push({op:"move",data:[o+(_?0:k()),e+(_?0:k())]}):m.push({op:"move",data:[o+(_?0:b(u,n,l)),e+(_?0:b(u,n,l))]}),a?m.push({op:"bcurveTo",data:[d+o+(s-o)*f+k(),g+e+(t-e)*f+k(),d+o+2*(s-o)*f+k(),g+e+2*(t-e)*f+k(),s+(_?0:k()),t+(_?0:k())]}):m.push({op:"bcurveTo",data:[d+o+(s-o)*f+w(),g+e+(t-e)*f+w(),d+o+2*(s-o)*f+w(),g+e+2*(t-e)*f+w(),s+(_?0:w()),t+(_?0:w())]}),m}function ce(o,e,s){if(!o.length)return[];const t=[];t.push([o[0][0]+b(e,s),o[0][1]+b(e,s)]),t.push([o[0][0]+b(e,s),o[0][1]+b(e,s)]);for(let n=1;n<o.length;n++)t.push([o[n][0]+b(e,s),o[n][1]+b(e,s)]),n===o.length-1&&t.push([o[n][0]+b(e,s),o[n][1]+b(e,s)]);return ge(t,null,s)}function ge(o,e,s){const t=o.length,n=[];if(t>3){const r=[],a=1-s.curveTightness;n.push({op:"move",data:[o[1][0],o[1][1]]});for(let i=1;i+2<t;i++){const c=o[i];r[0]=[c[0],c[1]],r[1]=[c[0]+(a*o[i+1][0]-a*o[i-1][0])/6,c[1]+(a*o[i+1][1]-a*o[i-1][1])/6],r[2]=[o[i+1][0]+(a*o[i][0]-a*o[i+2][0])/6,o[i+1][1]+(a*o[i][1]-a*o[i+2][1])/6],r[3]=[o[i+1][0],o[i+1][1]],n.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}}else t===3?(n.push({op:"move",data:[o[1][0],o[1][1]]}),n.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[2][0],o[2][1]]})):t===2&&n.push(...Te(o[0][0],o[0][1],o[1][0],o[1][1],s,!0,!0));return n}function We(o,e,s,t,n,r,a,i){const c=i.roughness===0,l=[],u=[];if(c){o=o/4,u.push([e+t*Math.cos(-o),s+n*Math.sin(-o)]);for(let h=0;h<=Math.PI*2;h=h+o){const f=[e+t*Math.cos(h),s+n*Math.sin(h)];l.push(f),u.push(f)}u.push([e+t*Math.cos(0),s+n*Math.sin(0)]),u.push([e+t*Math.cos(o),s+n*Math.sin(o)])}else{const h=b(.5,i)-Math.PI/2;u.push([b(r,i)+e+.9*t*Math.cos(h-o),b(r,i)+s+.9*n*Math.sin(h-o)]);const f=Math.PI*2+h-.01;for(let d=h;d<f;d=d+o){const g=[b(r,i)+e+t*Math.cos(d),b(r,i)+s+n*Math.sin(d)];l.push(g),u.push(g)}u.push([b(r,i)+e+t*Math.cos(h+Math.PI*2+a*.5),b(r,i)+s+n*Math.sin(h+Math.PI*2+a*.5)]),u.push([b(r,i)+e+.98*t*Math.cos(h+a),b(r,i)+s+.98*n*Math.sin(h+a)]),u.push([b(r,i)+e+.9*t*Math.cos(h+a*.5),b(r,i)+s+.9*n*Math.sin(h+a*.5)])}return[u,l]}function He(o,e,s,t,n,r,a,i,c){const l=r+b(.1,c),u=[];u.push([b(i,c)+e+.9*t*Math.cos(l-o),b(i,c)+s+.9*n*Math.sin(l-o)]);for(let h=l;h<=a;h=h+o)u.push([b(i,c)+e+t*Math.cos(h),b(i,c)+s+n*Math.sin(h)]);return u.push([e+t*Math.cos(a),s+n*Math.sin(a)]),u.push([e+t*Math.cos(a),s+n*Math.sin(a)]),ge(u,null,c)}function Rt(o,e,s,t,n,r,a,i){const c=[],l=[i.maxRandomnessOffset||1,(i.maxRandomnessOffset||1)+.3];let u=[0,0];const h=i.disableMultiStroke?1:2,f=i.preserveVertices;for(let d=0;d<h;d++)d===0?c.push({op:"move",data:[a[0],a[1]]}):c.push({op:"move",data:[a[0]+(f?0:b(l[0],i)),a[1]+(f?0:b(l[0],i))]}),u=f?[n,r]:[n+b(l[d],i),r+b(l[d],i)],c.push({op:"bcurveTo",data:[o+b(l[d],i),e+b(l[d],i),s+b(l[d],i),t+b(l[d],i),u[0],u[1]]});return c}function U(o){return[...o]}function Fe(o,e=0){const s=o.length;if(s<3)throw new Error("A curve must have at least three points.");const t=[];if(s===3)t.push(U(o[0]),U(o[1]),U(o[2]),U(o[2]));else{const n=[];n.push(o[0],o[0]);for(let i=1;i<o.length;i++)n.push(o[i]),i===o.length-1&&n.push(o[i]);const r=[],a=1-e;t.push(U(n[0]));for(let i=1;i+2<n.length;i++){const c=n[i];r[0]=[c[0],c[1]],r[1]=[c[0]+(a*n[i+1][0]-a*n[i-1][0])/6,c[1]+(a*n[i+1][1]-a*n[i-1][1])/6],r[2]=[n[i+1][0]+(a*n[i][0]-a*n[i+2][0])/6,n[i+1][1]+(a*n[i][1]-a*n[i+2][1])/6],r[3]=[n[i+1][0],n[i+1][1]],t.push(r[1],r[2],r[3])}}return t}function Tt(o,e){return Math.sqrt(fe(o,e))}function fe(o,e){return Math.pow(o[0]-e[0],2)+Math.pow(o[1]-e[1],2)}function Et(o,e,s){const t=fe(e,s);if(t===0)return fe(o,e);let n=((o[0]-e[0])*(s[0]-e[0])+(o[1]-e[1])*(s[1]-e[1]))/t;return n=Math.max(0,Math.min(1,n)),fe(o,N(e,s,n))}function N(o,e,s){return[o[0]+(e[0]-o[0])*s,o[1]+(e[1]-o[1])*s]}function xt(o,e){const s=o[e+0],t=o[e+1],n=o[e+2],r=o[e+3];let a=3*t[0]-2*s[0]-r[0];a*=a;let i=3*t[1]-2*s[1]-r[1];i*=i;let c=3*n[0]-2*r[0]-s[0];c*=c;let l=3*n[1]-2*r[1]-s[1];return l*=l,a<c&&(a=c),i<l&&(i=l),a+i}function Ee(o,e,s,t){const n=t||[];if(xt(o,e)<s){const r=o[e+0];n.length?Tt(n[n.length-1],r)>1&&n.push(r):n.push(r),n.push(o[e+3])}else{const a=o[e+0],i=o[e+1],c=o[e+2],l=o[e+3],u=N(a,i,.5),h=N(i,c,.5),f=N(c,l,.5),d=N(u,h,.5),g=N(h,f,.5),m=N(d,g,.5);Ee([a,u,d,m],0,s,n),Ee([m,g,f,l],0,s,n)}return n}function Ot(o,e){return me(o,0,o.length,e)}function me(o,e,s,t,n){const r=n||[],a=o[e],i=o[s-1];let c=0,l=1;for(let u=e+1;u<s-1;++u){const h=Et(o[u],a,i);h>c&&(c=h,l=u)}return Math.sqrt(c)>t?(me(o,e,l+1,t,r),me(o,l,s,t,r)):(r.length||r.push(a),r.push(i)),r}function xe(o,e=.15,s){const t=[],n=(o.length-1)/3;for(let r=0;r<n;r++){const a=r*3;Ee(o,a,e,t)}return s&&s>0?me(t,0,t.length,s):t}function Ct(o,e,s){const t=Le(o),n=Ye(Be(t)),r=[];let a=[],i=[0,0],c=[];const l=()=>{c.length>=4&&a.push(...xe(c,e)),c=[]},u=()=>{l(),a.length&&(r.push(a),a=[])};for(const{key:f,data:d}of n)switch(f){case"M":u(),i=[d[0],d[1]],a.push(i);break;case"L":l(),a.push([d[0],d[1]]);break;case"C":if(!c.length){const g=a.length?a[a.length-1]:i;c.push([g[0],g[1]])}c.push([d[0],d[1]]),c.push([d[2],d[3]]),c.push([d[4],d[5]]);break;case"Z":l(),a.push([i[0],i[1]]);break}if(u(),!s)return r;const h=[];for(const f of r){const d=Ot(f,s);d.length&&h.push(d)}return h}const L="none";class ke{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return dt()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,s,t){return{shape:e,sets:s||[],options:t||this.defaultOptions}}line(e,s,t,n,r){const a=this._o(r);return this._d("line",[Ue(e,s,t,n,a)],a)}rectangle(e,s,t,n,r){const a=this._o(r),i=[],c=vt(e,s,t,n,a);if(a.fill){const l=[[e,s],[e+t,s],[e+t,s+n],[e,s+n]];a.fillStyle==="solid"?i.push(ye([l],a)):i.push(G([l],a))}return a.stroke!==L&&i.push(c),this._d("rectangle",i,a)}ellipse(e,s,t,n,r){const a=this._o(r),i=[],c=Xe(t,n,a),l=Re(e,s,a,c);if(a.fill)if(a.fillStyle==="solid"){const u=Re(e,s,a,c).opset;u.type="fillPath",i.push(u)}else i.push(G([l.estimatedPoints],a));return a.stroke!==L&&i.push(l.opset),this._d("ellipse",i,a)}circle(e,s,t,n){const r=this.ellipse(e,s,t,t,n);return r.shape="circle",r}linearPath(e,s){const t=this._o(s);return this._d("linearPath",[he(e,!1,t)],t)}arc(e,s,t,n,r,a,i=!1,c){const l=this._o(c),u=[],h=Ie(e,s,t,n,r,a,i,!0,l);if(i&&l.fill)if(l.fillStyle==="solid"){const f=Object.assign({},l);f.disableMultiStroke=!0;const d=Ie(e,s,t,n,r,a,!0,!1,f);d.type="fillPath",u.push(d)}else u.push(yt(e,s,t,n,r,a,l));return l.stroke!==L&&u.push(h),this._d("arc",u,l)}curve(e,s){const t=this._o(s),n=[],r=De(e,t);if(t.fill&&t.fill!==L)if(t.fillStyle==="solid"){const a=De(e,Object.assign(Object.assign({},t),{disableMultiStroke:!0,roughness:t.roughness?t.roughness+t.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],i=e;if(i.length){const l=typeof i[0][0]=="number"?[i]:i;for(const u of l)u.length<3?a.push(...u):u.length===3?a.push(...xe(Fe([u[0],u[0],u[1],u[2]]),10,(1+t.roughness)/2)):a.push(...xe(Fe(u),10,(1+t.roughness)/2))}a.length&&n.push(G([a],t))}return t.stroke!==L&&n.push(r),this._d("curve",n,t)}polygon(e,s){const t=this._o(s),n=[],r=he(e,!0,t);return t.fill&&(t.fillStyle==="solid"?n.push(ye([e],t)):n.push(G([e],t))),t.stroke!==L&&n.push(r),this._d("polygon",n,t)}path(e,s){const t=this._o(s),n=[];if(!e)return this._d("path",n,t);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=t.fill&&t.fill!=="transparent"&&t.fill!==L,a=t.stroke!==L,i=!!(t.simplification&&t.simplification<1),c=i?4-4*(t.simplification||1):(1+t.roughness)/2,l=Ct(e,1,c),u=ze(e,t);if(r)if(t.fillStyle==="solid")if(l.length===1){const h=ze(e,Object.assign(Object.assign({},t),{disableMultiStroke:!0,roughness:t.roughness?t.roughness+t.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else n.push(ye(l,t));else n.push(G(l,t));return a&&(i?l.forEach(h=>{n.push(he(h,!1,t))}):n.push(u)),this._d("path",n,t)}opsToPath(e,s){let t="";for(const n of e.ops){const r=typeof s=="number"&&s>=0?n.data.map(a=>+a.toFixed(s)):n.data;switch(n.op){case"move":t+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":t+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":t+=`L${r[0]} ${r[1]} `;break}}return t.trim()}toPaths(e){const s=e.sets||[],t=e.options||this.defaultOptions,n=[];for(const r of s){let a=null;switch(r.type){case"path":a={d:this.opsToPath(r),stroke:t.stroke,strokeWidth:t.strokeWidth,fill:L};break;case"fillPath":a={d:this.opsToPath(r),stroke:L,strokeWidth:0,fill:t.fill||L};break;case"fillSketch":a=this.fillSketch(r,t);break}a&&n.push(a)}return n}fillSketch(e,s){let t=s.fillWeight;return t<0&&(t=s.strokeWidth/2),{d:this.opsToPath(e),stroke:s.fill||L,strokeWidth:t,fill:L}}_mergedShape(e){return e.filter((s,t)=>t===0?!0:s.op!=="move")}}class Lt{constructor(e,s){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ke(s)}draw(e){const s=e.sets||[],t=e.options||this.getDefaultOptions(),n=this.ctx,r=e.options.fixedDecimalPlaceDigits;for(const a of s)switch(a.type){case"path":n.save(),n.strokeStyle=t.stroke==="none"?"transparent":t.stroke,n.lineWidth=t.strokeWidth,t.strokeLineDash&&n.setLineDash(t.strokeLineDash),t.strokeLineDashOffset&&(n.lineDashOffset=t.strokeLineDashOffset),this._drawToContext(n,a,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=t.fill||"";const i=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,a,r,i),n.restore();break}case"fillSketch":this.fillSketch(n,a,t);break}}fillSketch(e,s,t){let n=t.fillWeight;n<0&&(n=t.strokeWidth/2),e.save(),t.fillLineDash&&e.setLineDash(t.fillLineDash),t.fillLineDashOffset&&(e.lineDashOffset=t.fillLineDashOffset),e.strokeStyle=t.fill||"",e.lineWidth=n,this._drawToContext(e,s,t.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,s,t,n="nonzero"){e.beginPath();for(const r of s.ops){const a=typeof t=="number"&&t>=0?r.data.map(i=>+i.toFixed(t)):r.data;switch(r.op){case"move":e.moveTo(a[0],a[1]);break;case"bcurveTo":e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":e.lineTo(a[0],a[1]);break}}s.type==="fillPath"?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,s,t,n,r){const a=this.gen.line(e,s,t,n,r);return this.draw(a),a}rectangle(e,s,t,n,r){const a=this.gen.rectangle(e,s,t,n,r);return this.draw(a),a}ellipse(e,s,t,n,r){const a=this.gen.ellipse(e,s,t,n,r);return this.draw(a),a}circle(e,s,t,n){const r=this.gen.circle(e,s,t,n);return this.draw(r),r}linearPath(e,s){const t=this.gen.linearPath(e,s);return this.draw(t),t}polygon(e,s){const t=this.gen.polygon(e,s);return this.draw(t),t}arc(e,s,t,n,r,a,i=!1,c){const l=this.gen.arc(e,s,t,n,r,a,i,c);return this.draw(l),l}curve(e,s){const t=this.gen.curve(e,s);return this.draw(t),t}path(e,s){const t=this.gen.path(e,s);return this.draw(t),t}}const ue="http://www.w3.org/2000/svg";class At{constructor(e,s){this.svg=e,this.gen=new ke(s)}draw(e){const s=e.sets||[],t=e.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,r=n.createElementNS(ue,"g"),a=e.options.fixedDecimalPlaceDigits;for(const i of s){let c=null;switch(i.type){case"path":{c=n.createElementNS(ue,"path"),c.setAttribute("d",this.opsToPath(i,a)),c.setAttribute("stroke",t.stroke),c.setAttribute("stroke-width",t.strokeWidth+""),c.setAttribute("fill","none"),t.strokeLineDash&&c.setAttribute("stroke-dasharray",t.strokeLineDash.join(" ").trim()),t.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${t.strokeLineDashOffset}`);break}case"fillPath":{c=n.createElementNS(ue,"path"),c.setAttribute("d",this.opsToPath(i,a)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",t.fill||""),(e.shape==="curve"||e.shape==="polygon")&&c.setAttribute("fill-rule","evenodd");break}case"fillSketch":{c=this.fillSketch(n,i,t);break}}c&&r.appendChild(c)}return r}fillSketch(e,s,t){let n=t.fillWeight;n<0&&(n=t.strokeWidth/2);const r=e.createElementNS(ue,"path");return r.setAttribute("d",this.opsToPath(s,t.fixedDecimalPlaceDigits)),r.setAttribute("stroke",t.fill||""),r.setAttribute("stroke-width",n+""),r.setAttribute("fill","none"),t.fillLineDash&&r.setAttribute("stroke-dasharray",t.fillLineDash.join(" ").trim()),t.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${t.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,s){return this.gen.opsToPath(e,s)}line(e,s,t,n,r){const a=this.gen.line(e,s,t,n,r);return this.draw(a)}rectangle(e,s,t,n,r){const a=this.gen.rectangle(e,s,t,n,r);return this.draw(a)}ellipse(e,s,t,n,r){const a=this.gen.ellipse(e,s,t,n,r);return this.draw(a)}circle(e,s,t,n){const r=this.gen.circle(e,s,t,n);return this.draw(r)}linearPath(e,s){const t=this.gen.linearPath(e,s);return this.draw(t)}polygon(e,s){const t=this.gen.polygon(e,s);return this.draw(t)}arc(e,s,t,n,r,a,i=!1,c){const l=this.gen.arc(e,s,t,n,r,a,i,c);return this.draw(l)}curve(e,s){const t=this.gen.curve(e,s);return this.draw(t)}path(e,s){const t=this.gen.path(e,s);return this.draw(t)}}const C={canvas(o,e){return new Lt(o,e)},svg(o,e){return new At(o,e)},generator(o){return new ke(o)},newSeed(){return ke.newSeed()}},Q=(o,e,s,t,n)=>`M${o+n},${e}
|
|
7
7
|
H${o+s-n}
|
|
8
8
|
A${n},${n} 0 0 1 ${o+s},${e+n}
|
|
9
9
|
V${e+t-n}
|
|
@@ -12,4 +12,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
12
12
|
A${n},${n} 0 0 1 ${o},${e+t-n}
|
|
13
13
|
V${e+n}
|
|
14
14
|
A${n},${n} 0 0 1 ${o+n},${e}
|
|
15
|
-
Z`,jt={"drawui-button":"_drawui-button_1nx7z_1"},de={stroke:{thin:{color:"#333",width:1.5},medium:{color:"#333",width:2.5},thick:{color:"#333",width:4}},roughness:{roughness:3,bowing:2},fill:{background:"#ccccccff"},radius:{none:0,sm:6,md:10,lg:16,full:30},buttonSize:{sm:{width:100,height:40,fontSize:12},md:{width:130,height:50,fontSize:15},lg:{width:150,height:60,fontSize:18},xl:{width:170,height:70,fontSize:20}},inputSize:{sm:{height:32,fontSize:12,paddingX:8},md:{height:40,fontSize:14,paddingX:12},lg:{height:48,fontSize:16,paddingX:16},xl:{height:48,fontSize:16,paddingX:16}}},Je=y.createContext(de),$t=({theme:o,children:e})=>{const s={...de,...o,stroke:{...de.stroke,...o?.stroke},radius:{...de.radius,...o?.radius}};return M.jsx(Je.Provider,{value:s,children:e})},O=()=>y.useContext(Je),Dt=({strokeWeight:o="medium",radius:e="md",size:s="sm",backgroundColor:t,children:n,fillStyle:r,...i})=>{const a=O(),c=y.useRef(null),[l,u]=y.useState(!1),h=a.buttonSize[s].width,f=a.buttonSize[s].height,d=a.buttonSize[s].fontSize;return y.useEffect(()=>{if(!c.current)return;const g=L.svg(c.current);c.current.innerHTML="";const m=a.stroke[o],b=g.path(Q(0,0,h,f,a.radius[e]),{stroke:m.color,strokeWidth:m.width,fill:t??a.fill.background,fillStyle:r,roughness:l?a.roughness.roughness+1:a.roughness.roughness,bowing:a.roughness.bowing});c.current.appendChild(b)},[l,o,e,a]),M.jsxs("button",{...i,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`${jt["drawui-button"]} ${i.className??""}`,style:{position:"relative",width:h,height:f,border:"none",background:"transparent",cursor:"pointer"},children:[M.jsx("svg",{ref:c,width:h,height:f,style:{position:"absolute",inset:0}}),M.jsx("span",{style:{position:"relative",fontSize:d,pointerEvents:"none"},children:n})]})},le={"drawui-card":"_drawui-card_vhoat_1","drawui-card-header":"_drawui-card-header_vhoat_7","drawui-card-body":"_drawui-card-body_vhoat_12","drawui-card-footer":"_drawui-card-footer_vhoat_17"},zt="_vertical_1tdom_6",It="_horizontal_1tdom_11",_e={"drawui-divider":"_drawui-divider_1tdom_1",vertical:zt,horizontal:It},Oe=({strokeWeight:o="medium",width:e="100%",vertical:s=!1,className:t,fillStyle:n})=>{const r=O(),i=y.useRef(null);return y.useEffect(()=>{if(!i.current)return;i.current.innerHTML="";const a=L.svg(i.current),c=r.stroke[o];if(s){const l=typeof e=="number"?e:100,u=a.line(0,0,0,l,{stroke:c.color,strokeWidth:c.width,roughness:r.roughness.roughness,bowing:r.roughness.bowing});i.current.appendChild(u)}else{const l=typeof e=="number"?e:300,u=a.line(0,0,l,0,{stroke:c.color,strokeWidth:c.width,roughness:r.roughness.roughness,bowing:r.roughness.bowing,fillStyle:n});i.current.appendChild(u)}},[r,o,e,s]),M.jsx("div",{className:`${_e["drawui-divider"]} ${s?_e.vertical:_e.horizontal} ${t??""}`,style:{width:s?void 0:e},children:M.jsx("svg",{ref:i,width:s?2:e,height:s?e:2,style:{display:"block"}})})},Nt=({strokeWeight:o="medium",radius:e="md",width:s=300,height:t=200,backgroundColor:n,header:r,footer:i,fillStyle:a,children:c,...l})=>{const u=O(),h=y.useRef(null),[f,d]=y.useState(!1);return y.useEffect(()=>{if(!h.current)return;const g=L.svg(h.current);h.current.innerHTML="";const m=u.stroke[o],b=g.path(Q(0,0,s,t,u.radius[e]),{stroke:m.color,strokeWidth:m.width,fill:n??u.fill.background,roughness:f?u.roughness.roughness+1:u.roughness.roughness,bowing:u.roughness.bowing,fillStyle:a});h.current.appendChild(b)},[o,e,s,t,n,u]),M.jsxs("div",{...l,className:`${le["drawui-card"]} ${l.className??""}`,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{position:"relative",width:s,height:t,cursor:"default",display:"flex",flexDirection:"column",overflow:"hidden"},children:[M.jsx("svg",{ref:h,width:s,height:t,style:{position:"absolute",inset:0,pointerEvents:"none"}}),r&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:le["drawui-card-header"],style:{position:"relative",zIndex:1},children:r}),M.jsx(Oe,{width:s,strokeWeight:"thick"})]}),M.jsx("div",{className:le["drawui-card-body"],style:{position:"relative",zIndex:1,flex:1},children:c}),i&&M.jsxs(M.Fragment,{children:[M.jsx(Oe,{width:s,strokeWeight:"thick"}),M.jsx("div",{className:le["drawui-card-footer"],style:{position:"relative",zIndex:1},children:i})]})]})},qe={"drawui-collapse":"_drawui-collapse_mgu8u_1","drawui-collapse-content":"_drawui-collapse-content_mgu8u_22"},Wt=({header:o,children:e,strokeWeight:s="medium",radius:t="md",width:n=300,fillStyle:r,className:i})=>{const a=O(),c=y.useRef(null);return y.useEffect(()=>{if(!c.current)return;const l=L.svg(c.current);c.current.innerHTML="";const u=a.stroke[s],h=l.path(Q(0,0,n,40,a.radius[t]),{stroke:u.color,strokeWidth:u.width,fill:"transparent",roughness:a.roughness.roughness,bowing:a.roughness.bowing,fillStyle:r});c.current.appendChild(h)},[a,s,t,n]),M.jsx("div",{className:`${qe["drawui-collapse"]} ${i??""}`,style:{width:n},children:M.jsxs("details",{children:[M.jsxs("summary",{style:{position:"relative"},children:[M.jsx("svg",{ref:c,width:n,height:40,style:{position:"absolute",inset:0,pointerEvents:"none"}}),M.jsx("span",{style:{position:"relative",zIndex:1},children:o})]}),M.jsx("div",{className:qe["drawui-collapse-content"],children:e})]})})},Ft={},Ht=({strokeWeight:o="medium",radius:e="md",size:s="sm",icon:t,fillStyle:n,backgroundColor:r,...i})=>{const a=O(),c=y.useRef(null),[l,u]=y.useState(!1),h=a.buttonSize[s].height;return y.useEffect(()=>{if(!c.current)return;const f=L.svg(c.current);c.current.innerHTML="";const d=a.stroke[o],g=f.path(Q(0,0,h,h,a.radius[e]),{stroke:d.color,strokeWidth:d.width,fill:r??a.fill.background,roughness:l?a.roughness.roughness+1:a.roughness.roughness,bowing:a.roughness.bowing,fillStyle:n});c.current.appendChild(g)},[l,o,e,a,h,r]),M.jsxs("button",{...i,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`${Ft["drawui-button"]} ${i.className??""}`,style:{position:"relative",width:h,height:h,border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:[M.jsx("svg",{ref:c,width:h,height:h,style:{position:"absolute",inset:0,pointerEvents:"none"}}),M.jsx("span",{style:{position:"relative",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:t})]})},Ge={"drawui-input":"_drawui-input_15az9_1","drawui-input-field":"_drawui-input-field_15az9_8"},qt=({strokeWeight:o="medium",backgroundColor:e,radius:s="md",inputSize:t="md",className:n,fillStyle:r,style:i,...a})=>{const c=O(),l=y.useRef(null),u=y.useRef(null),[h,f]=y.useState(!1),[d,g]=y.useState(!1),m=c.inputSize[t].height,b=c.inputSize[t].fontSize,v=c.inputSize[t].paddingX;return y.useEffect(()=>{if(!l.current||!u.current)return;const _=u.current.offsetWidth,I=L.svg(l.current);l.current.innerHTML="";const W=c.stroke[o],F=I.path(Q(0,0,_,m,c.radius[s]),{stroke:W.color,strokeWidth:W.width,fill:e??c.fill.background,roughness:h?c.roughness.roughness+1:c.roughness.roughness,bowing:c.roughness.bowing,fillStyle:r});l.current.appendChild(F)},[h,d,o,s,t,c,e]),M.jsxs("div",{ref:u,className:`${Ge["drawui-input"]} ${n??""}`,style:{height:m,...i},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[M.jsx("svg",{ref:l,width:"100%",height:m,style:{position:"absolute",inset:0}}),M.jsx("input",{...a,className:Ge["drawui-input-field"],style:{height:m,fontSize:b,paddingLeft:v,paddingRight:v},onFocus:_=>{f(!0),a.onFocus?.(_)},onBlur:_=>{f(!1),a.onBlur?.(_)}})]})},Gt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.path("M6 18 H18 L16 12 A6 6 0 0 0 8 12 Z",{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const u=i.circle(12,18,2,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(u)},[n,e,s]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Vt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.path("M2 12 L12 2 L22 12 V22 H2 Z",{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l)},[n,e,s]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Bt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.line(4,12,20,12,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l)},[n,e,s]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Yt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.line(12,4,12,20,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing}),u=i.line(4,12,20,12,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l),r.current.appendChild(u)},[n,e,s]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Zt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.circle(10,10,14,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"}),u=i.line(16,16,22,22,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l),r.current.appendChild(u)},[n,e,s]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Ut=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.circle(12,12,14,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);for(let u=0;u<8;u++){const h=u*Math.PI*2/8,f=12+7*Math.cos(h),d=12+7*Math.sin(h),g=12+10*Math.cos(h),m=12+10*Math.sin(h),b=i.line(f,d,g,m,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(b)}},[n,e,s]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Xt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=O(),r=y.useRef(null);return y.useEffect(()=>{if(!r.current)return;const i=L.svg(r.current);r.current.innerHTML="";const a=n.stroke[e],c=s??a.color,l=i.circle(12,8,6,{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const u=i.path("M4 20 Q12 16 20 20",{stroke:c,strokeWidth:a.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(u)},[n,e,s]),M.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})};exports.DrawuiButton=Dt;exports.DrawuiCard=Nt;exports.DrawuiCollapse=Wt;exports.DrawuiDivider=Oe;exports.DrawuiIconButton=Ht;exports.DrawuiInput=qt;exports.DrawuiThemeProvider=$t;exports.IconBell=Gt;exports.IconHome=Vt;exports.IconMinus=Bt;exports.IconPlus=Yt;exports.IconSearch=Zt;exports.IconSettings=Ut;exports.IconUser=Xt;exports.useDrawuiTheme=O;
|
|
15
|
+
Z`,jt={"drawui-button":"_drawui-button_1nx7z_1"},de={stroke:{thin:{color:"#333",width:1.5},medium:{color:"#333",width:2.5},thick:{color:"#333",width:4}},roughness:{roughness:3,bowing:2},fill:{background:"#ccccccff"},radius:{none:0,sm:6,md:10,lg:16,full:30},buttonSize:{sm:{width:100,height:40,fontSize:12},md:{width:130,height:50,fontSize:15},lg:{width:150,height:60,fontSize:18},xl:{width:170,height:70,fontSize:20}},inputSize:{sm:{height:32,fontSize:12,paddingX:8},md:{height:40,fontSize:14,paddingX:12},lg:{height:48,fontSize:16,paddingX:16},xl:{height:48,fontSize:16,paddingX:16}}},Je=v.createContext(de),$t=({theme:o,children:e})=>{const s={...de,...o,stroke:{...de.stroke,...o?.stroke},radius:{...de.radius,...o?.radius}};return y.jsx(Je.Provider,{value:s,children:e})},x=()=>v.useContext(Je),Dt=({strokeWeight:o="medium",radius:e="md",size:s="sm",backgroundColor:t,children:n,fillStyle:r,...a})=>{const i=x(),c=v.useRef(null),[l,u]=v.useState(!1),h=i.buttonSize[s].width,f=i.buttonSize[s].height,d=i.buttonSize[s].fontSize;return v.useEffect(()=>{if(!c.current)return;const g=C.svg(c.current);c.current.innerHTML="";const m=i.stroke[o],k=g.path(Q(0,0,h,f,i.radius[e]),{stroke:m.color,strokeWidth:m.width,fill:t??i.fill.background,fillStyle:r,roughness:l?i.roughness.roughness+1:i.roughness.roughness,bowing:i.roughness.bowing});c.current.appendChild(k)},[l,o,e,i]),y.jsxs("button",{...a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`${jt["drawui-button"]} ${a.className??""}`,style:{position:"relative",width:h,height:f,border:"none",background:"transparent",cursor:"pointer"},children:[y.jsx("svg",{ref:c,width:h,height:f,style:{position:"absolute",inset:0}}),y.jsx("span",{style:{position:"relative",fontSize:d,pointerEvents:"none"},children:n})]})},le={"drawui-card":"_drawui-card_vhoat_1","drawui-card-header":"_drawui-card-header_vhoat_7","drawui-card-body":"_drawui-card-body_vhoat_12","drawui-card-footer":"_drawui-card-footer_vhoat_17"},It="_vertical_1tdom_6",zt="_horizontal_1tdom_11",_e={"drawui-divider":"_drawui-divider_1tdom_1",vertical:It,horizontal:zt},Oe=({strokeWeight:o="medium",width:e="100%",vertical:s=!1,className:t,fillStyle:n})=>{const r=x(),a=v.useRef(null);return v.useEffect(()=>{if(!a.current)return;a.current.innerHTML="";const i=C.svg(a.current),c=r.stroke[o];if(s){const l=typeof e=="number"?e:100,u=i.line(0,0,0,l,{stroke:c.color,strokeWidth:c.width,roughness:r.roughness.roughness,bowing:r.roughness.bowing});a.current.appendChild(u)}else{const l=typeof e=="number"?e:300,u=i.line(0,0,l,0,{stroke:c.color,strokeWidth:c.width,roughness:r.roughness.roughness,bowing:r.roughness.bowing,fillStyle:n});a.current.appendChild(u)}},[r,o,e,s]),y.jsx("div",{className:`${_e["drawui-divider"]} ${s?_e.vertical:_e.horizontal} ${t??""}`,style:{width:s?void 0:e},children:y.jsx("svg",{ref:a,width:s?2:e,height:s?e:2,style:{display:"block"}})})},Nt=({strokeWeight:o="medium",radius:e="md",width:s=300,height:t,backgroundColor:n,header:r,footer:a,fillStyle:i,children:c,...l})=>{const u=x(),h=v.useRef(null),f=v.useRef(null),[d,g]=v.useState(t??200);v.useEffect(()=>{if(!f.current||t)return;const k=()=>{if(f.current){const _=f.current.scrollHeight;g(_)}};k();const w=new ResizeObserver(k);return w.observe(f.current),()=>w.disconnect()},[c,r,a,t]),v.useEffect(()=>{if(!h.current)return;const k=C.svg(h.current);h.current.innerHTML="";const w=u.stroke[o],_=t??d,$=k.path(Q(0,0,s,_,u.radius[e]),{stroke:w.color,strokeWidth:w.width,fill:n??u.fill.background,roughness:u.roughness.roughness,bowing:u.roughness.bowing,fillStyle:i});h.current.appendChild($)},[o,e,s,d,t,n,u,i]);const m=t??d;return y.jsxs("div",{...l,ref:f,className:`${le["drawui-card"]} ${l.className??""}`,style:{position:"relative",width:s,minHeight:t||"auto",height:t||"auto",cursor:"default",display:"flex",flexDirection:"column",overflow:"hidden"},children:[y.jsx("svg",{ref:h,width:s,height:m,style:{position:"absolute",inset:0,pointerEvents:"none"}}),r&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:le["drawui-card-header"],style:{position:"relative",zIndex:1},children:r}),y.jsx(Oe,{width:s,strokeWeight:"thick"})]}),y.jsx("div",{className:le["drawui-card-body"],style:{position:"relative",zIndex:1,flex:1},children:c}),a&&y.jsxs(y.Fragment,{children:[y.jsx(Oe,{width:s,strokeWeight:"thick"}),y.jsx("div",{className:le["drawui-card-footer"],style:{position:"relative",zIndex:1},children:a})]})]})},qe={"drawui-collapse":"_drawui-collapse_mgu8u_1","drawui-collapse-content":"_drawui-collapse-content_mgu8u_22"},Wt=({header:o,children:e,strokeWeight:s="medium",radius:t="md",width:n=300,fillStyle:r,className:a})=>{const i=x(),c=v.useRef(null);return v.useEffect(()=>{if(!c.current)return;const l=C.svg(c.current);c.current.innerHTML="";const u=i.stroke[s],h=l.path(Q(0,0,n,40,i.radius[t]),{stroke:u.color,strokeWidth:u.width,fill:"transparent",roughness:i.roughness.roughness,bowing:i.roughness.bowing,fillStyle:r});c.current.appendChild(h)},[i,s,t,n]),y.jsx("div",{className:`${qe["drawui-collapse"]} ${a??""}`,style:{width:n},children:y.jsxs("details",{children:[y.jsxs("summary",{style:{position:"relative"},children:[y.jsx("svg",{ref:c,width:n,height:40,style:{position:"absolute",inset:0,pointerEvents:"none"}}),y.jsx("span",{style:{position:"relative",zIndex:1},children:o})]}),y.jsx("div",{className:qe["drawui-collapse-content"],children:e})]})})},Ht={},Ft=({strokeWeight:o="medium",radius:e="md",size:s="sm",icon:t,fillStyle:n,backgroundColor:r,...a})=>{const i=x(),c=v.useRef(null),[l,u]=v.useState(!1),h=i.buttonSize[s].height;return v.useEffect(()=>{if(!c.current)return;const f=C.svg(c.current);c.current.innerHTML="";const d=i.stroke[o],g=f.path(Q(0,0,h,h,i.radius[e]),{stroke:d.color,strokeWidth:d.width,fill:r??i.fill.background,roughness:l?i.roughness.roughness+1:i.roughness.roughness,bowing:i.roughness.bowing,fillStyle:n});c.current.appendChild(g)},[l,o,e,i,h,r]),y.jsxs("button",{...a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`${Ht["drawui-button"]} ${a.className??""}`,style:{position:"relative",width:h,height:h,border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:[y.jsx("svg",{ref:c,width:h,height:h,style:{position:"absolute",inset:0,pointerEvents:"none"}}),y.jsx("span",{style:{position:"relative",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:t})]})},Ge={"drawui-input":"_drawui-input_15az9_1","drawui-input-field":"_drawui-input-field_15az9_8"},qt=({strokeWeight:o="medium",backgroundColor:e,radius:s="md",inputSize:t="md",className:n,fillStyle:r,style:a,...i})=>{const c=x(),l=v.useRef(null),u=v.useRef(null),[h,f]=v.useState(!1),[d,g]=v.useState(!1),m=c.inputSize[t].height,k=c.inputSize[t].fontSize,w=c.inputSize[t].paddingX;return v.useEffect(()=>{if(!l.current||!u.current)return;const _=u.current.offsetWidth,$=C.svg(l.current);l.current.innerHTML="";const W=c.stroke[o],H=$.path(Q(0,0,_,m,c.radius[s]),{stroke:W.color,strokeWidth:W.width,fill:e??c.fill.background,roughness:h?c.roughness.roughness+1:c.roughness.roughness,bowing:c.roughness.bowing,fillStyle:r});l.current.appendChild(H)},[h,d,o,s,t,c,e]),y.jsxs("div",{ref:u,className:`${Ge["drawui-input"]} ${n??""}`,style:{height:m,...a},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[y.jsx("svg",{ref:l,width:"100%",height:m,style:{position:"absolute",inset:0}}),y.jsx("input",{...i,className:Ge["drawui-input-field"],style:{height:m,fontSize:k,paddingLeft:w,paddingRight:w},onFocus:_=>{f(!0),i.onFocus?.(_)},onBlur:_=>{f(!1),i.onBlur?.(_)}})]})},Gt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],c=s??i.color,l=a.path("M6 18 H18 L16 12 A6 6 0 0 0 8 12 Z",{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const u=a.circle(12,18,2,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Vt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],c=s??i.color,l=a.path("M2 12 L12 2 L22 12 V22 H2 Z",{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Bt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],c=s??i.color,l=a.line(4,12,20,12,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Yt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],c=s??i.color,l=a.line(12,4,12,20,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing}),u=a.line(4,12,20,12,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l),r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Zt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],c=s??i.color,l=a.circle(10,10,14,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"}),u=a.line(16,16,22,22,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(l),r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Ut=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],c=s??i.color,l=a.circle(12,12,14,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);for(let u=0;u<8;u++){const h=u*Math.PI*2/8,f=12+7*Math.cos(h),d=12+7*Math.sin(h),g=12+10*Math.cos(h),m=12+10*Math.sin(h),k=a.line(f,d,g,m,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing});r.current.appendChild(k)}},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Xt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],c=s??i.color,l=a.circle(12,8,6,{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(l);const u=a.path("M4 20 Q12 16 20 20",{stroke:c,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing,fill:"transparent"});r.current.appendChild(u)},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})},Qt=({size:o=24,strokeWeight:e="medium",color:s,className:t})=>{const n=x(),r=v.useRef(null);return v.useEffect(()=>{if(!r.current)return;const a=C.svg(r.current);r.current.innerHTML="";const i=n.stroke[e],l={stroke:s??i.color,strokeWidth:i.width,roughness:n.roughness.roughness,bowing:n.roughness.bowing};r.current.appendChild(a.line(4,7,20,7,l)),r.current.appendChild(a.line(4,12,20,12,l)),r.current.appendChild(a.line(4,17,20,17,l))},[n,e,s]),y.jsx("svg",{ref:r,width:o,height:o,viewBox:"0 0 24 24",className:t})};exports.DrawuiButton=Dt;exports.DrawuiCard=Nt;exports.DrawuiCollapse=Wt;exports.DrawuiDivider=Oe;exports.DrawuiIconButton=Ft;exports.DrawuiInput=qt;exports.DrawuiThemeProvider=$t;exports.IconBell=Gt;exports.IconHamburger=Qt;exports.IconHome=Vt;exports.IconMinus=Bt;exports.IconPlus=Yt;exports.IconSearch=Zt;exports.IconSettings=Ut;exports.IconUser=Xt;exports.useDrawuiTheme=x;
|