From e78088c266bc3c6cafb31ed3559987deeb28e9a3 Mon Sep 17 00:00:00 2001 From: chenshenhai Date: Sat, 2 Mar 2024 21:30:18 +0800 Subject: [PATCH] feat: update pages --- docs/index.html | 4 +- .../{index.QJrYC8Mx.js => index.983JxlAr.js} | 2 +- docs/js/lib/draw.Q3HpuYqJ.js | 52 ++++++++++++ docs/js/lib/draw.tfoU9ZAP.js | 52 ------------ package.json | 4 +- pnpm-lock.yaml | 84 +++++++++---------- 6 files changed, 99 insertions(+), 99 deletions(-) rename docs/js/{index.QJrYC8Mx.js => index.983JxlAr.js} (99%) create mode 100644 docs/js/lib/draw.Q3HpuYqJ.js delete mode 100644 docs/js/lib/draw.tfoU9ZAP.js diff --git a/docs/index.html b/docs/index.html index ae239ee..ce56348 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,10 +9,10 @@ padding: 0; } - + - + diff --git a/docs/js/index.QJrYC8Mx.js b/docs/js/index.983JxlAr.js similarity index 99% rename from docs/js/index.QJrYC8Mx.js rename to docs/js/index.983JxlAr.js index e05dd5d..a6cd06c 100644 --- a/docs/js/index.QJrYC8Mx.js +++ b/docs/js/index.983JxlAr.js @@ -1,4 +1,4 @@ -import{r as Z,c as o2}from"./lib/react.dwzOUFZb.js";import{S as s2}from"./lib/draw.tfoU9ZAP.js";import"./lib/antd.mAE7kg8m.js";(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))C(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const F of l.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&C(F)}).observe(document,{childList:!0,subtree:!0});function v(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function C(n){if(n.ep)return;n.ep=!0;const l=v(n);fetch(n.href,l)}})();var k1={exports:{}},Q={};/** +import{r as Z,c as o2}from"./lib/react.dwzOUFZb.js";import{S as s2}from"./lib/draw.Q3HpuYqJ.js";import"./lib/antd.mAE7kg8m.js";(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))C(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const F of l.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&C(F)}).observe(document,{childList:!0,subtree:!0});function v(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function C(n){if(n.ep)return;n.ep=!0;const l=v(n);fetch(n.href,l)}})();var k1={exports:{}},Q={};/** * @license React * react-jsx-dev-runtime.development.js * diff --git a/docs/js/lib/draw.Q3HpuYqJ.js b/docs/js/lib/draw.Q3HpuYqJ.js new file mode 100644 index 0000000..25812ef --- /dev/null +++ b/docs/js/lib/draw.Q3HpuYqJ.js @@ -0,0 +1,52 @@ +import{r as A,R as l,e as ra,g as df}from"./react.dwzOUFZb.js";import{c as pe,A as uf,t as Ks,S as _d,a as Ge,I as se,D as vi,B as Ve,b as Jt,T as ff,F as J,R as he,C as Q,d as Xe,P as Od,m as Ya,E as aa,e as hf,f as vr,g as pf,h as gf,M as vf,i as mf}from"./antd.mAE7kg8m.js";let mi="idraw-studio";function Qs(e){mi=e}function Js(){return mi}function Td(e){return(...t)=>[mi,e,...t].join("-")}function Xa(...e){return[mi,...e].join("-")}const bf={locale:"en-US",Header:{},ElementDetail:{basicAttributes:"Basic",borderAttribute:"Border",contentAttribute:"Content",shadowAttribute:"Shadow",x:"X",y:"Y",w:"W",h:"H",background:"Background",solid:"Solid",dash:"Dash",inside:"Inside",outside:"Outside",centerLine:"Center",gradient:"Gradient",opacity:"Opacity",mixedBorderWidth:"Mixed",mixedBorderRadius:"Mixed",overflow:"Overflow",hidden:"Hidden",visible:"Visible",deepResizeInGroup:"Deep resize in group"},Menu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"}},yf={locale:"zh-CN",Header:{},ElementDetail:{basicAttributes:"基础",borderAttribute:"边框",contentAttribute:"内容",shadowAttribute:"阴影",x:"X",y:"Y",w:"宽",h:"高",background:"背景色",solid:"实线",dash:"虚线",inside:"内线",outside:"外线",centerLine:"中线",gradient:"渐变",opacity:"透明度",mixedBorderWidth:"混合边框",mixedBorderRadius:"混合圆角",overflow:"溢出",hidden:"隐藏",visible:"可视",deepResizeInGroup:"组内尺寸关联调整"},Menu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"}},qs={"en-US":bf,"zh-CN":yf},po="en-US",wf=e=>{const{localeCode:t}=A.useContext(le);return[A.useMemo(()=>{const a=(qs[t||po]||qs[po])[e];return Object.assign({},a)},[t,e])]},xf=e=>{const{themeMode:t}=e,n="theme",r=Xa(n),a=Xa(n,"dark"),i=pe({[r]:!0,[a]:t==="dark"});return{themeMode:t,className:i}},$d=e=>(e!=null&&e.topPrefix&&typeof(e==null?void 0:e.topPrefix)=="string"&&Qs(e.topPrefix),Object.assign({topPrefix:Js(),createPrefixName:Td,generateClassName:Xa,getClassNameTopPrefix:Js,setClassNameTopPrefix:Qs,localeCode:po},e||{})),le=A.createContext($d()),Ef=e=>{const{children:t,topPrefix:n,localeCode:r,container:a,themeMode:i}=e,o=$d({topPrefix:n,localeCode:r}),[s,c]=A.useState(o),{className:d}=xf({themeMode:i});return A.useEffect(()=>{c(Object.assign(Object.assign({},s),{localeCode:r,container:a}))},[r,a]),l.createElement(le.Provider,{value:Object.assign({},s)},l.createElement(uf,{theme:{algorithm:i==="dark"?Ks.darkAlgorithm:Ks.defaultAlgorithm}},l.createElement("div",{className:d},t)))};class el extends l.PureComponent{render(){const{children:t,className:n,split:r,style:a,size:i,eleRef:o}=this.props,s=["Pane",r,n];let c={flex:1,position:"relative",outline:"none"};return i!==void 0&&(r==="vertical"?c.width=i:(c.height=i,c.display="flex"),c.flex="none"),c=Object.assign({},c,a||{}),l.createElement("div",{ref:o,className:s.join(" "),style:c},t)}}const Sf="base-split-pane",Cf=()=>{const{generateClassName:e}=A.useContext(le);return{modClassName:e(Sf)}};function Mf(e){const{modClassName:t}=Cf(),{className:n,onClick:r,onDoubleClick:a,onMouseDown:i,onTouchEnd:o,onTouchStart:s,resizerClassName:c=t,split:d,style:u}=e,f=[c,d,n];return A.useMemo(()=>l.createElement("span",{role:"presentation",className:f.join(" "),style:u,onMouseDown:h=>i(h),onTouchStart:h=>{h.preventDefault(),s(h)},onTouchEnd:h=>{h.preventDefault(),o(h)},onClick:h=>{r&&(h.preventDefault(),r(h))},onDoubleClick:h=>{a&&(h.preventDefault(),a(h))}}),[])}const Af="xxxxx";function tl(e,t){if(e.selection)e.selection.empty();else try{t.getSelection().removeAllRanges()}catch{}}function nl(e,t,n,r){if(typeof r=="number"){const a=typeof t=="number"?t:0,i=typeof n=="number"&&n>=0?n:1/0;return Math.max(a,Math.min(i,r))}return e!==void 0?e:t}function _f(e){return l.Children.toArray(e).filter(t=>t)}class Za extends l.Component{constructor(t){super(t),this.onMouseDown=this.onMouseDown.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this);const{size:n,defaultSize:r,minSize:a,maxSize:i,primary:o}=t,s=n!==void 0?n:nl(r,a,i,null);this.state={active:!1,resized:!1,pane1Size:o==="first"?s:void 0,pane2Size:o==="second"?s:void 0,instanceProps:{size:n}}}componentDidMount(){document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove),this.setState(Za.getSizeUpdate(this.props,this.state))}static getDerivedStateFromProps(t,n){return Za.getSizeUpdate(t,n)}componentWillUnmount(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}onMouseDown(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchStart(n)}onTouchStart(t){const{allowResize:n,onDragStarted:r,split:a}=this.props;if(n){tl(document,window);const i=a==="vertical"?t.touches[0].clientX:t.touches[0].clientY;typeof r=="function"&&r(),this.setState({active:!0,position:i})}}onMouseMove(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchMove(n)}onTouchMove(t){const{allowResize:n,maxSize:r,minSize:a,onChange:i,split:o,step:s}=this.props,{active:c,position:d}=this.state;if(n&&c){tl(document,window);const u=this.props.primary==="first",f=u?this.pane1:this.pane2,h=u?this.pane2:this.pane1;if(f){const p=f,v=h;if(p.getBoundingClientRect){const g=p.getBoundingClientRect().width,m=p.getBoundingClientRect().height,b=o==="vertical"?t.touches[0].clientX:t.touches[0].clientY,y=o==="vertical"?g:m;let S=d-b;if(s){if(Math.abs(S)E&&(x=-x);let j=r;if(r!==void 0&&r<=0){const F=this.splitPane;o==="vertical"?j=F.getBoundingClientRect().width+r:j=F.getBoundingClientRect().height+r}let z=y-x;const k=d-S;zj?z=j:this.setState({position:k,resized:!0}),i&&i(z),this.setState({draggedSize:z,[u?"pane1Size":"pane2Size"]:z})}}}}onMouseUp(){const{allowResize:t,onDragFinished:n}=this.props,{active:r,draggedSize:a}=this.state;t&&r&&(typeof n=="function"&&n(a),this.setState({active:!1}))}static getSizeUpdate(t,n){const r={},{instanceProps:a}=n;if(a.size===t.size&&t.size!==void 0)return{};const i=t.size!==void 0?t.size:nl(t.defaultSize,t.minSize,t.maxSize,n.draggedSize);t.size!==void 0&&(r.draggedSize=i);const o=t.primary==="first";return r[o?"pane1Size":"pane2Size"]=i,r[o?"pane2Size":"pane1Size"]=void 0,r.instanceProps={size:t.size},r}render(){const{allowResize:t,children:n,className:r,onResizerClick:a,onResizerDoubleClick:i,paneClassName:o,pane1ClassName:s,pane2ClassName:c,paneStyle:d,pane1Style:u,pane2Style:f,resizerClassName:h,resizerStyle:p,split:v,style:g}=this.props,{pane1Size:m,pane2Size:b}=this.state,y=t?"":"disabled",S=h&&`${h} ${Af}`,x=_f(n),C=Object.assign({display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},g);v==="vertical"?Object.assign(C,{flexDirection:"row",left:0,right:0}):Object.assign(C,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});const E=["SplitPane",r,v,y],j=Object.assign(Object.assign({},d),u),z=Object.assign(Object.assign({},d),f),k=["Pane1",o,s].join(" "),F=["Pane2",o,c].join(" ");return l.createElement("div",{className:E.join(" "),ref:U=>{this.splitPane=U},style:C},l.createElement(el,{className:k,key:"pane1",eleRef:U=>{this.pane1=U},size:m,split:v,style:j},x[0]),l.createElement(Mf,{className:y,onClick:a,onDoubleClick:i,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",resizerClassName:S,split:v,style:p||{}}),l.createElement(el,{className:F,key:"pane2",eleRef:U=>{this.pane2=U},size:b,split:v,style:z},x[1]))}}var Of=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a({iconClassName:Xa(Tf)}),ae=e=>{const{className:t,style:n,children:r}=e,a=Of(e,["className","style","children"]),{iconClassName:i}=$f();return A.useMemo(()=>l.createElement("span",Object.assign({className:pe([i,t]),style:n},a),r),[i,n,t])},Pf=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M516.266667 938.666667h-38.4c-234.666667-21.333333-405.333333-230.4-384-465.066667 17.066667-204.8 179.2-366.933333 384-384 17.066667 0 34.133333 8.533333 42.666666 21.333333 8.533333 12.8 8.533333 34.133333-4.266666 46.933334-85.333333 115.2-59.733333 273.066667 55.466666 358.4 89.6 68.266667 213.333333 68.266667 302.933334 0 12.8-8.533333 29.866667-12.8 46.933333-4.266667 12.8 8.533333 21.333333 25.6 21.333333 42.666667-8.533333 115.2-64 217.6-153.6 290.133333-81.066667 59.733333-174.933333 93.866667-273.066666 93.866667zM396.8 187.733333c-123.733333 42.666667-213.333333 153.6-221.866667 290.133334-17.066667 187.733333 119.466667 354.133333 307.2 371.2 89.6 8.533333 179.2-17.066667 247.466667-76.8 46.933333-38.4 81.066667-89.6 102.4-145.066667-106.666667 38.4-226.133333 21.333333-320-46.933333-119.466667-93.866667-166.4-251.733333-115.2-392.533334z"}))),If=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 768c-141.376 0-256-114.624-256-256s114.624-256 256-256 256 114.624 256 256-114.624 256-256 256z m0-85.333333a170.666667 170.666667 0 1 0 0-341.333334 170.666667 170.666667 0 0 0 0 341.333334zM469.333333 85.333333a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0V85.333333z m0 768a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0v-85.333334zM85.333333 554.666667a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334H85.333333z m768 0a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334h-85.333334zM161.834667 222.165333a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m576 576a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m-515.669334 64a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z m576-576a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z"}))),zf="base-theme-switch",Rf=Td(zf),rl=e=>{if(!(typeof e>"u"))return e==="light"};function Df(e){return e===!0?"light":"dark"}const Nf=e=>{const{className:t,style:n,onChange:r,theme:a,defaultTheme:i}=e;return l.createElement(_d,{className:pe([Rf(),t]),style:n,checkedChildren:l.createElement(If,{style:{height:"100%"}}),unCheckedChildren:l.createElement(Pf,{style:{height:"100%"}}),checked:rl(i),defaultChecked:rl(a),onChange:o=>{const s=Df(o);r==null||r({theme:s})}})},al=Ge.Option,jf="base-locale-selector",Lf=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=A.useContext(le),s=o(jf);return A.useMemo(()=>l.createElement(Ge,{style:n,className:pe(s(),t),size:"small",defaultValue:r,value:a,onChange:i},l.createElement(al,{value:"en-US"},"English"),l.createElement(al,{value:"zh-CN"},"中文")),[t,n,r,a,i])};function ia(e,t){let n=-1;return function(...r){n>=0||(n=setTimeout(()=>{e(...r),n=-1},t))}}function Ko(e){const{accept:t,success:n,error:r}=e;let a=document.createElement("input");a.type="file",t&&(a.accept=t),a.addEventListener("change",function(){var i;const o=(i=a.files)===null||i===void 0?void 0:i[0];n({file:o}),a=null}),a.addEventListener("error",function(i){typeof r=="function"&&r(i),a=null}),a.click()}function kf(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsDataURL(e)})}function Bf(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsText(e)})}function Ff(e){const t=new TextEncoder().encode(e),n=new Blob([t],{type:"text/plain;charset=utf-8"});return window.URL.createObjectURL(n)}function Hf(e,t){const{fileName:n}=t,r=Ff(e);let a=document.createElement("a");a.href=r,a.download=n,a.click(),a=null}function Ka(e){return typeof e=="string"&&(/^\#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)||/^[a-z]{1,}$/i.test(e))}function Wf(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="linear-gradient"){const n=[];typeof e.angle=="number"?n.push(`${e.angle}deg`):n.push("180deg"),Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(${n.join(", ")})`}else if((e==null?void 0:e.type)==="radial-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`radial-gradient(circle, ${n.join(", ")})`}return t}function Qa(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="radial-gradient"||(e==null?void 0:e.type)==="linear-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.length>0&&(e.stops.forEach((r,a)=>{n.push(`${r.color} ${r.offset*100}%`),a===e.stops.length-1&&r.offset<1&&n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(90deg, ${n.join(", ")})`)}return t}function il(e,t){if(t===1)return e;let n=1;const r=/^\#[0-9a-f]{6,6}$/i,a=/^\#[0-9a-f]{8,8}$/i;let i=e;if(r.test(e)?n=parseInt(e.substring(5,7).replace(/^\#/,"0x")):a.test(e)&&(n=parseInt(e.substring(7,9).replace(/^\#/,"0x")),i=e.substring(0,7)),n=n*t,r.test(i)&&n>0&&n<1){const o=Math.max(0,Math.min(255,Math.ceil(n*256)));i=`${i.toUpperCase()}${o.toString(16).toUpperCase()}`}return i}function tr(){function e(){return((1+Math.random())*65536|0).toString(16).substring(1)}return`${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`}function zt(e){let t=0;for(let n=0;n=0)return n;if(r==="Array"){const a=[];return n.forEach(i=>{a.push(t(i))}),a}else if(r==="Object"){const a={};return Object.keys(n).forEach(s=>{a[s]=t(n[s])}),Object.getOwnPropertySymbols(n).forEach(s=>{a[s]=t(n[s])}),a}}return t(e)}function Bi(e){const t=qt(e),n=r=>{r.uuid=tr(),r.type==="group"&&r.detail.children&&r.detail.children.forEach(a=>{n(a)})};return n(t),t}function Gf(e){return Object.prototype.toString.call(e).replace(/[\]|\[]{1,1}/gi,"").split(" ")[1]}function Vf(e,t){const n=e.assets||{},r=qt(e),a=(t==null?void 0:t.loadItemMap)||{},i=o=>{o.forEach(s=>{var c,d,u;if(s.type==="image"&&s.detail.src){const f=s.detail.src;if(Qt(f)&&!n[f]&&a[f]&&typeof((c=a[f])===null||c===void 0?void 0:c.source)=="string")n[f]={type:"image",value:a[f].source};else if(!n[f]){const h=nr(f);n[h]||(n[h]={type:"image",value:f}),s.detail.src=h}}else if(s.type==="svg"){const f=s.detail.svg;if(Qt(f)&&!n[f]&&a[f]&&typeof((d=a[f])===null||d===void 0?void 0:d.source)=="string")n[f]={type:"svg",value:a[f].source};else if(!n[f]){const h=nr(f);n[h]||(n[h]={type:"svg",value:f}),s.detail.svg=h}}else if(s.type==="html"){const f=s.detail.html;if(Qt(f)&&!n[f]&&a[f]&&typeof((u=a[f])===null||u===void 0?void 0:u.source)=="string")n[f]={type:"html",value:a[f].source};else if(!n[f]){const h=nr(f);n[h]||(n[h]={type:"html",value:f}),s.detail.html=h}}else if(s.type==="group"&&Array.isArray(s.detail.children)){const f=s.detail.assets||{};Object.keys(f).forEach(h=>{n[h]||(n[h]=f[h])}),delete s.detail.assets,i(s.detail.children)}})};return i(r.elements),r.assets=n,r}function tt(e){return(Object.prototype.toString.call(e)||"").replace(/(\[object|\])/gi,"").trim()}const Tr={type(e,t){const n=tt(e);return t===!0?n.toLocaleLowerCase():n},array(e){return tt(e)==="Array"},json(e){return tt(e)==="Object"},function(e){return tt(e)==="Function"},asyncFunction(e){return tt(e)==="AsyncFunction"},boolean(e){return tt(e)==="Boolean"},string(e){return tt(e)==="String"},number(e){return tt(e)==="Number"},undefined(e){return tt(e)==="Undefined"},null(e){return tt(e)==="Null"},promise(e){return tt(e)==="Promise"}};function Uf(e,t){const{width:n,height:r}=t;return new Promise((a,i)=>{const o=` + + +
+ ${e} +
+
+
+ `,s=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),c=new FileReader;c.readAsDataURL(s),c.onload=function(d){var u;const f=(u=d==null?void 0:d.target)===null||u===void 0?void 0:u.result;a(f)},c.onerror=function(d){i(d)}})}function Yf(e){return new Promise((t,n)=>{const r=e,a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),i=new FileReader;i.readAsDataURL(a),i.onload=function(o){var s;const c=(s=o==null?void 0:o.target)===null||s===void 0?void 0:s.result;t(c)},i.onerror=function(o){n(o)}})}var Pd=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{Image:Xf}=window;function bi(e){return new Promise((t,n)=>{const r=new Xf;r.crossOrigin="anonymous",r.onload=function(){t(r)},r.onabort=n,r.onerror=n,r.src=e})}function Zf(e){return Pd(this,void 0,void 0,function*(){const t=yield Yf(e);return yield bi(t)})}function Kf(e){return e.replace(/\&/gi,"&")}function Qf(e,t){return Pd(this,void 0,void 0,function*(){e=Kf(e);const n=yield Uf(e,t);return yield bi(n)})}function an(e){return typeof e=="number"&&(e>0||e<=0)}function Jf(e){return an(e)}function qf(e){return an(e)}function Id(e){return typeof e=="number"&&e>=0}function eh(e){return typeof e=="number"&&e>=0}function th(e){return typeof e=="number"&&e>=-360&&e<=360}function nh(e){return Id(e)}function rh(e){return an(e)&&e>=0}function ah(e){return Ka(e)}function zd(e){return typeof e=="string"&&/^(http:\/\/|https:\/\/|\.\/|\/)/.test(`${e}`)}function Rd(e){return typeof e=="string"&&/^(data:image\/)/.test(`${e}`)}function ih(e){return Rd(e)||zd(e)}function oh(e){return typeof e=="string"&&/^()/i.test(`${e}`.trim())&&/<\/[\s]{0,}svg>$/i.test(`${e}`.trim())}function sh(e){let t=!1;if(typeof e=="string"){let n=document.createElement("div");n.innerHTML=e,n.children.length>0&&(t=!0),n=null}return t}function lh(e){return typeof e=="string"}function ch(e){return an(e)&&e>0}function dh(e){return an(e)&&e>0}function uh(e){return an(e)&&e>0}function fh(e){return["center","left","right"].includes(e)}function hh(e){return typeof e=="string"&&e.length>0}function ph(e){return["bold"].includes(e)}function gh(e){return/^(-?\d+(?:\.\d+)?)$/.test(`${e}`)}const At={x:Jf,y:qf,w:Id,h:eh,angle:th,number:an,numberStr:gh,borderWidth:nh,borderRadius:rh,color:ah,imageSrc:ih,imageURL:zd,imageBase64:Rd,svg:oh,html:sh,text:lh,fontSize:ch,lineHeight:dh,textAlign:fh,fontFamily:hh,fontWeight:ph,strokeWidth:uh};var oa=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Z=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},K,wt;const vh=12,mh="400",bh="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'";class Dd{constructor(t,n){K.set(this,void 0),wt.set(this,void 0),oa(this,K,t,"f"),oa(this,wt,Object.assign({devicePixelRatio:1,offscreenCanvas:null},n),"f"),this.$resetFont()}$undoPixelRatio(t){return t/Z(this,wt,"f").devicePixelRatio}$doPixelRatio(t){return Z(this,wt,"f").devicePixelRatio*t}$getContext(){return Z(this,K,"f")}$setContext(t){oa(this,K,t,"f")}$setFont(t){const n=[];t.fontWeight&&n.push(`${t.fontWeight}`),n.push(`${this.$doPixelRatio(t.fontSize||12)}px`),n.push(`${t.fontFamily||"sans-serif"}`),Z(this,K,"f").font=`${n.join(" ")}`}$resetFont(){this.$setFont({fontSize:vh,fontFamily:bh,fontWeight:mh})}$getOffscreenCanvas(){return Z(this,wt,"f").offscreenCanvas}$resize(t){const{width:n,height:r,devicePixelRatio:a,resetStyle:i}=t,{canvas:o}=Z(this,K,"f");o.width=n*a,o.height=r*a,oa(this,wt,Object.assign(Object.assign({},Z(this,wt,"f")),{devicePixelRatio:a}),"f"),i===!0&&(o.style.width=`${n}px`,o.style.height=`${r}px`)}$getSize(){const{devicePixelRatio:t}=Z(this,wt,"f"),{width:n,height:r}=Z(this,K,"f").canvas;return{width:n/t,height:r/t,devicePixelRatio:t}}get canvas(){return Z(this,K,"f").canvas}get fillStyle(){return Z(this,K,"f").fillStyle}set fillStyle(t){Z(this,K,"f").fillStyle=t}get strokeStyle(){return Z(this,K,"f").strokeStyle}set strokeStyle(t){Z(this,K,"f").strokeStyle=t}get lineWidth(){return this.$undoPixelRatio(Z(this,K,"f").lineWidth)}set lineWidth(t){Z(this,K,"f").lineWidth=this.$doPixelRatio(t)}get textAlign(){return Z(this,K,"f").textAlign}set textAlign(t){Z(this,K,"f").textAlign=t}get textBaseline(){return Z(this,K,"f").textBaseline}set textBaseline(t){Z(this,K,"f").textBaseline=t}get globalAlpha(){return Z(this,K,"f").globalAlpha}set globalAlpha(t){Z(this,K,"f").globalAlpha=t}get shadowColor(){return Z(this,K,"f").shadowColor}set shadowColor(t){Z(this,K,"f").shadowColor=t}get shadowOffsetX(){return this.$undoPixelRatio(Z(this,K,"f").shadowOffsetX)}set shadowOffsetX(t){Z(this,K,"f").shadowOffsetX=this.$doPixelRatio(t)}get shadowOffsetY(){return this.$undoPixelRatio(Z(this,K,"f").shadowOffsetY)}set shadowOffsetY(t){Z(this,K,"f").shadowOffsetY=this.$doPixelRatio(t)}get shadowBlur(){return this.$undoPixelRatio(Z(this,K,"f").shadowBlur)}set shadowBlur(t){Z(this,K,"f").shadowBlur=this.$doPixelRatio(t)}get lineCap(){return Z(this,K,"f").lineCap}set lineCap(t){Z(this,K,"f").lineCap=t}get globalCompositeOperation(){return Z(this,K,"f").globalCompositeOperation}set globalCompositeOperation(t){Z(this,K,"f").globalCompositeOperation=t}fill(...t){return Z(this,K,"f").fill(...t)}arc(t,n,r,a,i,o){return Z(this,K,"f").arc(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),a,i,o)}rect(t,n,r,a){return Z(this,K,"f").rect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}fillRect(t,n,r,a){return Z(this,K,"f").fillRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}clearRect(t,n,r,a){return Z(this,K,"f").clearRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}beginPath(){return Z(this,K,"f").beginPath()}closePath(){return Z(this,K,"f").closePath()}lineTo(t,n){return Z(this,K,"f").lineTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}moveTo(t,n){return Z(this,K,"f").moveTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}arcTo(t,n,r,a,i){return Z(this,K,"f").arcTo(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i))}getLineDash(){return Z(this,K,"f").getLineDash()}setLineDash(t){const n=t.map(r=>this.$doPixelRatio(r));return Z(this,K,"f").setLineDash(n)}stroke(t){return t?Z(this,K,"f").stroke(t):Z(this,K,"f").stroke()}translate(t,n){return Z(this,K,"f").translate(this.$doPixelRatio(t),this.$doPixelRatio(n))}rotate(t){return Z(this,K,"f").rotate(t)}drawImage(...t){const n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],s=t[t.length-4],c=t[t.length-3],d=t[t.length-2],u=t[t.length-1];return t.length===9?Z(this,K,"f").drawImage(n,this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o),this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u)):Z(this,K,"f").drawImage(n,this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u))}createPattern(t,n){return Z(this,K,"f").createPattern(t,n)}measureText(t){return Z(this,K,"f").measureText(t)}fillText(t,n,r,a){return a!==void 0?Z(this,K,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,K,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}strokeText(t,n,r,a){return a!==void 0?Z(this,K,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,K,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}save(){Z(this,K,"f").save()}restore(){Z(this,K,"f").restore()}scale(t,n){Z(this,K,"f").scale(t,n)}circle(t,n,r,a,i,o,s,c){Z(this,K,"f").ellipse(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),i,o,s,c)}isPointInPath(t,n){return Z(this,K,"f").isPointInPath(this.$doPixelRatio(t),this.$doPixelRatio(n))}clip(...t){return Z(this,K,"f").clip(...t)}setTransform(t,n,r,a,i,o){return Z(this,K,"f").setTransform(t,n,r,a,i,o)}getTransform(){return Z(this,K,"f").getTransform()}createLinearGradient(t,n,r,a){return Z(this,K,"f").createLinearGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}createRadialGradient(t,n,r,a,i,o){return Z(this,K,"f").createRadialGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o))}createConicGradient(t,n,r){return Z(this,K,"f").createConicGradient(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}}K=new WeakMap,wt=new WeakMap;function vn(e){const{width:t,height:n,ctx:r,devicePixelRatio:a}=e;let i=r;if(!i){const s=document.createElement("canvas");s.width=t*a,s.height=n*a,i=s.getContext("2d")}return new Dd(i,e)}function Ca(e){const{width:t,height:n,devicePixelRatio:r}=e,a=new OffscreenCanvas(t*r,n*r),o=a.getContext("2d").canvas.getContext("2d");return new Dd(o,{devicePixelRatio:r,offscreenCanvas:a})}function yh(e,t){const{width:n,height:r,devicePixelRatio:a,offscreen:i,createCustomContext2D:o}=t,s={width:n,height:r,devicePixelRatio:a},c=e.getContext("2d");if(o){const d=o(s),u=o(s),f=o(s),h=vn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}if(i===!0){const d=Ca(s),u=Ca(s),f=Ca(s),h=vn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}else{const d=vn(s),u=vn(s),f=vn(s),h=vn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{h.clearRect(0,0,n,r),h.drawImage(f.canvas,0,0,n,r),h.drawImage(d.canvas,0,0,n,r),h.drawImage(u.canvas,0,0,n,r),f.clearRect(0,0,n,r),d.clearRect(0,0,n,r),u.clearRect(0,0,n,r)}}}}var wh=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},nt=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Le;class en{constructor(){Le.set(this,void 0),wh(this,Le,new Map,"f")}on(t,n){if(nt(this,Le,"f").has(t)){const r=nt(this,Le,"f").get(t)||[];r==null||r.push(n),nt(this,Le,"f").set(t,r)}else nt(this,Le,"f").set(t,[n])}off(t,n){if(nt(this,Le,"f").has(t)){const r=nt(this,Le,"f").get(t);if(Array.isArray(r)){for(let a=0;a<(r==null?void 0:r.length);a++)if(r[a]===n){r.splice(a,1);break}}nt(this,Le,"f").set(t,r||[])}}trigger(t,n){const r=nt(this,Le,"f").get(t);return Array.isArray(r)?(r.forEach(a=>{a(n)}),!0):!1}has(t){if(nt(this,Le,"f").has(t)){const n=nt(this,Le,"f").get(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}destroy(){this.clear()}clear(){nt(this,Le,"f").clear()}}Le=new WeakMap;function xh(e,t){const n=(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y);return n===0?n:Math.sqrt(n)}function mr(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var sa=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},En=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Ma,jt,Ja,go;class Fr{constructor(t){Ma.add(this),jt.set(this,void 0),Ja.set(this,void 0),sa(this,Ja,qt(t.defaultStorage),"f"),sa(this,jt,En(this,Ma,"m",go).call(this),"f")}set(t,n){En(this,jt,"f")[t]=n}get(t){return En(this,jt,"f")[t]}getSnapshot(){return qt(En(this,jt,"f"))}clear(){sa(this,jt,En(this,Ma,"m",go).call(this),"f")}destroy(){sa(this,jt,null,"f")}}jt=new WeakMap,Ja=new WeakMap,Ma=new WeakSet,go=function(){return qt(En(this,Ja,"f"))};function Nd(e){const{activeStore:t}=e;return{scale:t==null?void 0:t.scale,offsetTop:t==null?void 0:t.offsetTop,offsetBottom:t==null?void 0:t.offsetBottom,offsetLeft:t==null?void 0:t.offsetLeft,offsetRight:t==null?void 0:t.offsetRight}}function jd(e){const{activeStore:t}=e;return{devicePixelRatio:t.devicePixelRatio,width:t==null?void 0:t.width,height:t==null?void 0:t.height,contextWidth:t==null?void 0:t.contextWidth,contextHeight:t==null?void 0:t.contextHeight}}function Eh(e){return e/Math.PI*180}function Ft(e){return e/180*Math.PI}function Ld(e,t,n,r){const a=Ft(t||0);n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(a),e.translate(-n.x,-n.y)),r(e),n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(-a),e.translate(-n.x,-n.y))}function _t(e,t,n){const r=vt(t);Ld(e,t.angle||0,r,()=>{n(e)})}function vt(e){return{x:e.x+e.w/2,y:e.y+e.h/2}}function kd(e){const t=Math.min(e[0].x,e[1].x,e[2].x,e[3].x),n=Math.min(e[0].y,e[1].y,e[2].y,e[3].y),r=Math.max(e[0].x,e[1].x,e[2].x,e[3].x),a=Math.max(e[0].y,e[1].y,e[2].y,e[3].y),i={x:t,y:n,w:r-t,h:a-n};return vt(i)}function Sh(e,t,n){const r=vo(e,t),a=vo(e,n);return a!==null&&r!==null?r>Math.PI*3/2&&aMath.PI*3/2&&r0)return Math.PI}else if(r===0){if(n<0)return Math.PI*3/2;if(n>0)return Math.PI/2}return n>0&&r<0?Math.atan(Math.abs(n)/Math.abs(r)):n>0&&r>0?Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r>0?Math.PI+Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r<0?2*Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):0}function je(e,t,n){let i=vo(e,t)+n;i>Math.PI*2?i=i-Math.PI*2:i<0-Math.PI*2&&(i=i+Math.PI*2),i<0&&(i=i+Math.PI*2);const o=xh(e,t);let s=0,c=0;return i===0?(s=0,c=0-o):i>0&&iMath.PI/2&&iMath.PI&&i<3/2*Math.PI?(s=0-Math.sin(i-Math.PI)*o,c=Math.cos(i-Math.PI)*o):i===3/2*Math.PI?(s=0-o,c=0):i>3/2*Math.PI&&i<2*Math.PI?(s=0-Math.sin(2*Math.PI-i)*o,c=0-Math.cos(2*Math.PI-i)*o):i===2*Math.PI&&(s=0,c=0-o),s+=e.x,c+=e.y,{x:s,y:c}}function qa(e,t){if((t==null?void 0:t.length)>0){let n=e.x,r=e.y;return t.forEach(a=>{const{x:i,y:o,w:s,h:c,angle:d=0}=a,u=vt({x:i,y:o,w:s,h:c,angle:d}),f=je(u,{x:n,y:r},Ft(d));n=f.x,r=f.y}),{x:n,y:r}}return e}function Bd(e,t,n){const{x:r,y:a,w:i,h:o}=e;let s={x:r,y:a},c={x:r+i,y:a},d={x:r+i,y:a+o},u={x:r,y:a+o};if(n&&(n>0||n<0)){const f=Ft(ht(n));s=je(t,s,f),c=je(t,c,f),d=je(t,d,f),u=je(t,u,f)}return[s,c,d,u]}function on(e){const{angle:t=0}=e,n=vt(e);return Bd(e,n,t)}function ol(e,t,n){return[je(e,{x:t[0].x,y:t[0].y},n),je(e,{x:t[1].x,y:t[1].y},n),je(e,{x:t[2].x,y:t[2].y},n),je(e,{x:t[3].x,y:t[3].y},n)]}function ht(e){if(!(e>0||e<0)||e===0)return 0;let t=e%360;return t<0&&(t+=360),t}function Fd(e){let t=!0;if(Array.isArray(e)){const n=[];e.forEach(r=>{var a;typeof r.uuid=="string"&&r.uuid?n.includes(r.uuid)?(t=!1,console.warn(`Duplicate uuids: ${r.uuid}`)):n.push(r.uuid):(t=!1,console.warn("Element missing uuid",r)),r.type==="group"&&(t=Fd((a=r==null?void 0:r.detail)===null||a===void 0?void 0:a.children))})}return t}function Ch(e){var t;const n={x:0,y:0,w:0,h:0};let r=null;for(let i=0;i0||s.angle<0)){const c=on(s);if(c.length===4){const d=[c[0].x,c[1].x,c[2].x,c[3].x],u=[c[0].y,c[1].y,c[2].y,c[3].y];s.x=Math.min(...d),s.y=Math.min(...u),s.w=Math.abs(Math.max(...d)-Math.min(...d)),s.h=Math.abs(Math.max(...u)-Math.min(...u))}}if(r){const c=Math.min(s.x,n.x),d=Math.min(s.y,n.y),u=Math.max(s.x+s.w,n.x+n.w),f=Math.max(s.y+s.h,n.y+n.h);n.x=c,n.y=d,n.w=Math.abs(u-c),n.h=Math.abs(f-d)}else n.x=s.x,n.y=s.y,n.w=s.w,n.h=s.h;r=s}return{x:Math.floor(n.x),y:Math.floor(n.y),w:Math.ceil(n.w),h:Math.ceil(n.h)}}function Hd(e,t){const n={x:0,y:0,w:0,h:0};e.forEach(a=>{const i={x:a.x,y:a.y,w:a.w,h:a.h,angle:a.angle};if(i.angle&&(i.angle>0||i.angle<0)){const u=on(i);if(u.length===4){const f=[u[0].x,u[1].x,u[2].x,u[3].x],h=[u[0].y,u[1].y,u[2].y,u[3].y];i.x=Math.min(...f),i.y=Math.min(...h),i.w=Math.abs(Math.max(...f)-Math.min(...f)),i.h=Math.abs(Math.max(...h)-Math.min(...h))}}const o=Math.min(i.x,n.x),s=Math.min(i.y,n.y),c=Math.max(i.x+i.w,n.x+n.w),d=Math.max(i.y+i.h,n.y+n.h);n.x=o,n.y=s,n.w=Math.abs(c-o),n.h=Math.abs(d-s)}),t!=null&&t.extend&&(n.x=Math.min(n.x,0),n.y=Math.min(n.y,0));const r={contextWidth:n.w,contextHeight:n.h};return t!=null&&t.viewWidth&&(t!=null&&t.viewHeight)&&(t==null?void 0:t.viewWidth)>0&&(t==null?void 0:t.viewHeight)>0&&(t.viewWidth>n.x+n.w&&(r.contextWidth=t.viewWidth-n.x),t.viewHeight>n.y+n.h&&(r.contextHeight=t.viewHeight-n.y)),r}function Mh(e,t,n){const r=Hd(e,{viewWidth:t.width,viewHeight:t.height,extend:n==null?void 0:n.extend});return(n==null?void 0:n.extend)===!0&&(r.contextWidth=Math.max(r.contextWidth,t.contextWidth),r.contextHeight=Math.max(r.contextHeight,t.contextHeight)),{contextSize:r}}function Wd(e,t){var n;let r=null;for(let a=0;a{const a=pt(r,t);a&&n.push(a)}),n}function pt(e,t){let n=null,r=t;for(let a=0;a{var o;for(let s=0;s=o&&r<=d&&i>=s}function _h(e,t){const{scale:n,offsetX:r,offsetY:a}=e,{viewSizeInfo:i}=t,{width:o,height:s,contextWidth:c,contextHeight:d}=i,u=c*n,f=d*n,h=0-r*n,p=0-a*n,v=o-(u+h/n),g=s-(f+p/n);return{scale:n,offsetLeft:h,offsetTop:p,offsetRight:v,offsetBottom:g}}function Oh(e){const{scale:t,point:n,viewScaleInfo:r}=e,{offsetLeft:a,offsetTop:i}=r,o=t/r.scale,s=n.x,c=n.y,d=s-s*o+(a*o-a),u=c-c*o+(i*o-i);return{moveX:d,moveY:u}}function Th(e){const{moveX:t=0,moveY:n=0,viewScaleInfo:r,viewSizeInfo:a}=e,{scale:i}=r,{width:o,height:s,contextWidth:c,contextHeight:d}=a;let u=r.offsetLeft,f=r.offsetRight,h=r.offsetTop,p=r.offsetBottom;u+=t,h+=n;const v=c*i,g=d*i;return f=o-(v+u),p=s-(g+h),{scale:i,offsetTop:h,offsetLeft:u,offsetRight:f,offsetBottom:p}}function Qo(e,t){const{viewScaleInfo:n}=t,{x:r,y:a,w:i,h:o,angle:s}=e,{scale:c,offsetTop:d,offsetLeft:u}=n;return{x:r*c+u,y:a*c+d,w:i*c,h:o*c,angle:s}}function Je(e,t){const{viewScaleInfo:n}=t,{x:r,y:a}=e,{scale:i,offsetTop:o,offsetLeft:s}=n;return{x:r*i+s,y:a*i+o}}function Re(e,t){return[Je(e[0],t),Je(e[1],t),Je(e[2],t),Je(e[3],t)]}function mo(e,t){const{context2d:n,element:r,viewScaleInfo:a,viewSizeInfo:i}=t,{angle:o=0}=r,{x:s,y:c,w:d,h:u}=Qo(r,{viewScaleInfo:a,viewSizeInfo:i}),f=on({x:s,y:c,w:d,h:u,angle:o});if(f.length>=2){n.beginPath(),n.moveTo(f[0].x,f[0].y);for(let h=1;h0)for(let f=d.length-1;f>=0;f--){let h=0,p=0,v=0;for(let m=0;m<=f;m++)h+=d[m].x,p+=d[m].y,v+=d[m].angle||0;const g=d[f];if(g&&g.type==="group"&&Array.isArray((n=g.detail)===null||n===void 0?void 0:n.children))for(let m=0;m=0;f--){const h=o.elements[f];if(((a=h==null?void 0:h.operations)===null||a===void 0?void 0:a.invisible)!==!0&&mo(e,{context2d:i,element:h,viewScaleInfo:s,viewSizeInfo:c})){u.index=f,u.element=h;break}}return u}function Ph(e,t){const{viewSizeInfo:n,viewScaleInfo:r}=t,{width:a,height:i}=n,{angle:o}=e,{x:s,y:c,w:d,h:u}=Qo(e,{viewScaleInfo:r,viewSizeInfo:n}),f=on({x:s,y:c,w:d,h:u,angle:o}),h={x:0,y:0,w:a,h:i},p=Math.min(f[0].x,f[1].x,f[2].x,f[3].x),v=Math.min(f[0].y,f[1].y,f[2].y,f[3].y),g=Math.max(f[0].x,f[1].x,f[2].x,f[3].x),m=Math.max(f[0].y,f[1].y,f[2].y,f[3].y),b={x:p,y:v,w:g-p,h:m-v};return Ah(h,b)}function Ud(e){const{x:t,y:n,h:r,w:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+r},{x:t,y:n+r}]}function ot(e){const{x:t,y:n,w:r,h:a,angle:i=0}=e;return i===0?Ud(e):Bd(e,vt({x:t,y:n,w:r,h:a,angle:i}),i)}function Jo(e){const t=[];let n=0,r=0;const a=[],i=[...e];for(let o=0;o0||f<0){const g=Ft(f);h=ol(v,h,g)}a.push({center:v,angle:f,radian:Ft(f)})}t.push(h)}return t}function Ih(e,t){const{groupQueue:n}=t;if(!(n.length>0))return[ot(e)];const r=[...n,e];return Jo(r)}function ei(e,t){return Ih(e,t).pop()||null}function bt(e,t){const{x:n,y:r}=e,{size:a,angle:i}=t;return{x:n-a/2,y:r-a/2,w:a,h:a,angle:i}}function la(e,t){const{groupQueue:n,controllerSize:r,viewScaleInfo:a}=t,i=(r&&r>0?r:8)/a.scale,{x:o,y:s,w:c,h:d,angle:u=0}=e,f=[{uuid:tr(),x:o,y:s,w:c,h:d,angle:u,type:"group",detail:{children:[]}},...n];let h=0;f.forEach(({angle:It=0})=>{h+=It});const p=ei(e,{groupQueue:n}),v=ei({x:o-i*2,y:s-i*2,h:d+i*4,w:c+i*4,angle:u},{groupQueue:[...n]}),g=mr(p[0],p[1]),m=mr(p[1],p[2]),b=mr(p[2],p[3]),y=mr(p[3],p[0]),S=p[0],x=p[1],C=p[2],E=p[3],j=bt(g,{size:i,angle:h}),z=bt(m,{size:i,angle:h}),k=bt(b,{size:i,angle:h}),F=bt(y,{size:i,angle:h}),U=bt(S,{size:i,angle:h}),L=bt(x,{size:i,angle:h}),O=bt(E,{size:i,angle:h}),$=bt(C,{size:i,angle:h}),R=ot(U),G=ot(L),N=ot(O),D=ot($),w=[R[1],G[0],G[3],R[2]],P=[G[3],G[2],D[1],D[0]],V=[N[1],D[0],D[3],N[2]],M=[R[3],R[2],N[1],N[0]],Y=ot(j),H=ot(z),_=ot(k),T=ot(F),I=mr(v[0],v[1]),B=bt(I,{size:i,angle:h}),ee=ot(B);return{elementWrapper:p,left:{type:"left",vertexes:M,center:y},right:{type:"right",vertexes:P,center:m},top:{type:"top",vertexes:w,center:g},bottom:{type:"bottom",vertexes:V,center:b},topLeft:{type:"top-left",vertexes:R,center:S},topRight:{type:"top-right",vertexes:G,center:x},bottomLeft:{type:"bottom-left",vertexes:N,center:E},bottomRight:{type:"bottom-right",vertexes:D,center:C},leftMiddle:{type:"left-middle",vertexes:T,center:y},rightMiddle:{type:"right-middle",vertexes:H,center:m},topMiddle:{type:"top-middle",vertexes:Y,center:g},bottomMiddle:{type:"bottom-middle",vertexes:_,center:b},rotate:{type:"rotate",vertexes:ee,center:I}}}function Yd(e){let t="";return e.forEach(n=>{t+=n.type+n.params.join(" ")}),t}function $e(e,t){let n=2;return typeof(t==null?void 0:t.decimalPlaces)<"u"&&(t==null?void 0:t.decimalPlaces)>=0&&(n=t.decimalPlaces),parseFloat(e.toFixed(n))}const _a="Text Element";function sn(){return{boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,lineHeight:20,fontFamily:"sans-serif",fontWeight:400,overflow:"hidden"}}function zh(){return{background:"#D9D9D9"}}function Rh(){return{background:"#D9D9D9",radius:0}}function Dh(e){const t=sn();return{text:_a,color:t.color,fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:e.w/_a.length,fontSize:e.w/_a.length,textAlign:"center",verticalAlign:"middle"}}function Nh(){return{svg:''}}function jh(){return{src:"data:image/svg+xml;base64,PHN2ZyAgIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiPjxwYXRoIGQ9Ik05MjggMTYwSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY2NDBjMCAxNy43IDE0LjMgMzIgMzIgMzJoODMyYzE3LjcgMCAzMi0xNC4zIDMyLTMyVjE5MmMwLTE3LjctMTQuMy0zMi0zMi0zMnogbS00MCA2MzJIMTM2di0zOS45bDEzOC41LTE2NC4zIDE1MC4xIDE3OEw2NTguMSA0ODkgODg4IDc2MS42Vjc5MnogbTAtMTI5LjhMNjY0LjIgMzk2LjhjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDQyNC42IDY2Ni40bC0xNDQtMTcwLjdjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDEzNiA2NTIuN1YyMzJoNzUydjQzMC4yeiIgIGZpbGw9IiM1MTUxNTEiPjwvcGF0aD48cGF0aCBkPSJNMzA0IDQ1NmM0OC42IDAgODgtMzkuNCA4OC04OHMtMzkuNC04OC04OC04OC04OCAzOS40LTg4IDg4IDM5LjQgODggODggODh6IG0wLTExNmMxNS41IDAgMjggMTIuNSAyOCAyOHMtMTIuNSAyOC0yOCAyOC0yOC0xMi41LTI4LTI4IDEyLjUtMjggMjgtMjh6IiAgZmlsbD0iIzUxNTE1MSI+PC9wYXRoPjwvc3ZnPg=="}}function Lh(){return{children:[],background:"#D9D9D9",overflow:"hidden"}}const kh=sn();function qo(e,t){const{viewScaleInfo:n}=t,{scale:r}=n;let{borderRadius:a}=e.detail;const{boxSizing:i=kh.boxSizing,borderWidth:o}=e.detail;Array.isArray(o)&&(a=0);let{x:s,y:c,w:d,h:u}=e,f=[0,0,0,0];if(typeof a=="number"){const p=a*r;f=[p,p,p,p]}else Array.isArray(a)&&(a==null?void 0:a.length)===4&&(f=[a[0]*r,a[1]*r,a[2]*r,a[3]*r]);let h=0;return typeof o=="number"&&(h=(o||0)*r),i==="border-box"?(s=e.x+h/2,c=e.y+h/2,d=e.w-h,u=e.h-h):i==="content-box"?(s=e.x-h/2,c=e.y-h/2,d=e.w+h,u=e.h+h):(s=e.x,c=e.y,d=e.w,u=e.h),d=Math.max(d,1),u=Math.max(u,1),f=f.map(p=>Math.min(p,d/2,u/2)),{x:s,y:c,w:d,h:u,radiusList:f}}const ze=e=>$e(e,{decimalPlaces:4});function Xd(e,t){const{detail:n}=e,{xRatio:r,yRatio:a,maxRatio:i}=t,o=(r+a)/2,{borderWidth:s,borderRadius:c,borderDash:d,shadowOffsetX:u,shadowOffsetY:f,shadowBlur:h}=n;if(typeof s=="number")n.borderWidth=ze(s*o);else if(Array.isArray(n.borderWidth)){const p=s;n.borderWidth=[ze(p[0]*a),ze(p[1]*r),ze(p[2]*a),ze(p[3]*r)]}if(typeof c=="number")n.borderRadius=ze(c*o);else if(Array.isArray(n.borderRadius)){const p=c;n.borderRadius=[p[0]*r,p[1]*r,p[2]*a,p[3]*a]}Array.isArray(d)&&d.forEach((p,v)=>{n.borderDash[v]=ze(p*i)}),typeof u=="number"&&(n.shadowOffsetX=ze(u*i)),typeof f=="number"&&(n.shadowOffsetX=ze(f*i)),typeof h=="number"&&(n.shadowOffsetX=ze(h*i))}function Bh(e,t){const{xRatio:n,yRatio:r}=t,{x:a,y:i,w:o,h:s}=e;e.x=ze(a*n),e.y=ze(i*r),e.w=ze(o*n),e.h=ze(s*r),Xd(e,t)}function Fh(e,t){const{minRatio:n,maxRatio:r}=t,{fontSize:a,lineHeight:i}=e.detail,o=(n+r)/2;a&&a>0&&(e.detail.fontSize=ze(a*o)),i&&i>0&&(e.detail.lineHeight=ze(i*o))}function Zd(e,t){const{type:n}=e;Bh(e,t),n==="circle"||(n==="text"?Fh(e,t):n==="image"||n==="svg"||n==="html"||n==="path"||n==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(r=>{Zd(r,t)}))}function Kd(e,t){const n=t.w&&t.w>0?t.w:e.w,r=t.h&&t.h>0?t.h:e.h,a=n/e.w,i=r/e.h;if(a===i&&a===1)return e;const o=Math.min(a,i),s=Math.max(a,i);e.w=n,e.h=r;const c={xRatio:a,yRatio:i,minRatio:o,maxRatio:s};return e.type==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(d=>{Zd(d,c)}),Xd(e,c),e}const Fi=200,Hi=200;function Hh(e,t){let n=0,r=0,a=Fi,i=Hi;if(t){const{viewScaleInfo:s,viewSizeInfo:c}=t,{scale:d,offsetLeft:u,offsetTop:f}=s,{width:h,height:p}=c,v=h/4,g=p/4;Fi>=v?a=v/d:a=Fi/d,Hi>=g?i=g/d:i=Hi/d,["circle","svg","image"].includes(e)?a=i=Math.max(a,i):e==="text"&&(i=a/_a.length*2),n=(0-u+h/2-a*d/2)/d,r=(0-f+p/2-i*d/2)/d}return{x:n,y:r,w:a,h:i}}function Wh(e,t,n){const r=Hh(e,n);let a={};return e==="rect"?a=zh():e==="circle"?a=Rh():e==="text"?a=Dh(r):e==="svg"?a=Nh():e==="image"?a=jh():e==="group"&&(a=Lh()),Object.assign(Object.assign(Object.assign({},r),t),{uuid:tr(),type:e,detail:Object.assign(Object.assign({},a),t.detail||{})})}function Qd(e,t,n){let r=!1;if(t.length===1){const a=t[0];n.splice(a,0,e),r=!0}else if(t.length>1){let a=n;for(let i=0;i1){let r=t;for(let a=0;a=0;s++)r[s]!==n[s]&&r[s]=0&&(n[o]=n[o]+1),Jd(n,e)}return{elements:e,from:n,to:r}}function Vh(e,t){var n;const r=Object.keys(t);for(let a=0;a{e[i][s]=o}),e[i]=[...e[i],...t[i]])))}return e}function Hr(e,t,n){var r,a;let i=null;for(let o=0;o0||t.h&&t.h>0)&&Kd(s,{w:t.w,h:t.h}),Vh(s,t),i=s;break}else s.type==="group"&&(i=Hr(e,t,((a=s==null?void 0:s.detail)===null||a===void 0?void 0:a.children)||[]))}return i}function Uh(e,t){var n,r,a,i,o,s,c,d;let u=0,f=0,h=1,p=((r=(n=e==null?void 0:e.elements)===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.x)||0,v=((i=(a=e==null?void 0:e.elements)===null||a===void 0?void 0:a[0])===null||i===void 0?void 0:i.y)||0,g=((s=(o=e==null?void 0:e.elements)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.w)||0,m=((d=(c=e==null?void 0:e.elements)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.h)||0;const{width:b,height:y}=t.viewSizeInfo;if(e.elements.forEach(x=>{const C={x:x.x,y:x.y,w:x.w,h:x.h,angle:x.angle};if(C.angle&&(C.angle>0||C.angle<0)){const F=on(C);if(F.length===4){const U=[F[0].x,F[1].x,F[2].x,F[3].x],L=[F[0].y,F[1].y,F[2].y,F[3].y];C.x=Math.min(...U),C.y=Math.min(...L),C.w=Math.abs(Math.max(...U)-Math.min(...U)),C.h=Math.abs(Math.max(...L)-Math.min(...L))}}const E=Math.min(C.x,p),j=Math.min(C.y,v),z=Math.max(C.x+C.w,p+g),k=Math.max(C.y+C.h,v+m);p=E,v=j,g=Math.abs(z-E),m=Math.abs(k-j)}),g>0&&m>0){const x=$e(b/g,{decimalPlaces:4}),C=$e(y/m,{decimalPlaces:4});h=Math.min(x,C,1),u=(g*h-b)/2/h+p,f=(m*h-y)/2/h+v}return{offsetX:$e(u,{decimalPlaces:0}),offsetY:$e(f,{decimalPlaces:0}),scale:h}}function Yh(e){let t=0,n=0;if(e){const{viewScaleInfo:a,viewSizeInfo:i}=e,{offsetLeft:o,offsetTop:s,scale:c}=a,{width:d,height:u}=i;t=0-o+d/c/2,n=0-s+u/c/2}return{x:t,y:n}}function bo(e,t,n){if(typeof t=="string")return t;const{viewElementSize:r,viewScaleInfo:a,opacity:i=1}=n,{x:o,y:s}=r,{scale:c}=a;if((t==null?void 0:t.type)==="linear-gradient"){const{start:d,end:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c},p={x:o+u.x*c,y:s+u.y*c},v=e.createLinearGradient(h.x,h.y,p.x,p.y);return f.forEach(g=>{v.addColorStop(g.offset,il(g.color,i))}),v}if((t==null?void 0:t.type)==="radial-gradient"){const{inner:d,outer:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c,radius:d.radius*c},p={x:o+u.x*c,y:s+u.y*c,radius:u.radius*c},v=e.createRadialGradient(h.x,h.y,h.radius,p.x,p.y,p.radius);return f.forEach(g=>{v.addColorStop(g.offset,il(g.color,i))}),v}return"#000000"}const yo=sn();function nn(e){var t,n,r,a;let i=1;return((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.opacity)!==void 0&&((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.opacity)>=0&&((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.opacity)<=1&&(i=(a=e==null?void 0:e.detail)===null||a===void 0?void 0:a.opacity),i}function rr(e,t,n){const{pattern:r,renderContent:a,originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c}=n||{},{parentOpacity:d}=n,u=nn(i)*d;Xh(e,t,{originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c,renderContent:()=>{e.globalAlpha=u,Zh(e,t,{pattern:r,viewScaleInfo:s,viewSizeInfo:c}),a==null||a(),Kh(e,t,{viewScaleInfo:s,viewSizeInfo:c}),e.globalAlpha=d}})}function Xh(e,t,n){const{renderContent:r,originElem:a,calcElemSize:i,viewSizeInfo:o}=n,s=o.devicePixelRatio,{clipPath:c}=(a==null?void 0:a.detail)||{};if(c&&i&&c.commands){const{x:d,y:u,w:f,h}=i,{originW:p,originH:v,originX:g,originY:m}=c,b=f/p,y=h/v,S=g*b,x=m*y,C=d-S,E=u-x;e.save(),e.translate(C,E),e.scale(s*b,s*y);const j=Yd(c.commands||[]),z=new Path2D(j);e.clip(z),e.translate(0-C,0-E),e.setTransform(1,0,0,1,0,0),_t(e,Object.assign({},t),()=>{r==null||r()}),e.restore()}else r==null||r()}function Zh(e,t,n){var r,a;const{pattern:i,viewScaleInfo:o,viewSizeInfo:s}=n,c=[];if(t.detail.background||i){const{x:d,y:u,w:f,h,radiusList:p}=qo(t,{viewScaleInfo:o,viewSizeInfo:s});if(e.beginPath(),e.moveTo(d+p[0],u),e.arcTo(d+f,u,d+f,u+h,p[1]),e.arcTo(d+f,u+h,d,u+h,p[2]),e.arcTo(d,u+h,d,u,p[3]),e.arcTo(d,u,d+f,u,p[0]),e.closePath(),typeof i=="string")e.fillStyle=i;else if(["CanvasPattern"].includes(Tr.type(i)))e.fillStyle=i;else if(typeof t.detail.background=="string")e.fillStyle=t.detail.background;else if(((r=t.detail.background)===null||r===void 0?void 0:r.type)==="linear-gradient"){const v=bo(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});e.fillStyle=v}else if(((a=t.detail.background)===null||a===void 0?void 0:a.type)==="radial-gradient"){const v=bo(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});if(e.fillStyle=v,c&&c.length>0)for(let g=0;g<(c==null?void 0:c.length);g++){const m=c[g];m.method==="translate"?e.translate(m.args[0]+d,m.args[1]+u):m.method==="rotate"?e.rotate(...m.args):m.method==="scale"&&e.scale(...m.args)}}e.fill(),c&&c.length>0&&e.setTransform(1,0,0,1,0,0)}}function Kh(e,t,n){if(t.detail.borderWidth===0||!Ka(t.detail.borderColor))return;const{viewScaleInfo:r}=n,{scale:a}=r;let i=yo.borderColor;Ka(t.detail.borderColor)===!0&&(i=t.detail.borderColor);const{borderWidth:o,borderRadius:s,borderDash:c,boxSizing:d=yo.boxSizing}=t.detail;let u=0;typeof o=="number"&&(u=o||1),u=u*a;let f=[0,0,0,0];if(typeof s=="number"){const b=s*a;f=[b,b,b,b]}else Array.isArray(s)&&(s==null?void 0:s.length)===4&&(f=[s[0]*a,s[1]*a,s[2]*a,s[3]*a]);e.strokeStyle=i;let h=[];Array.isArray(c)&&c.length>0&&(h=c.map(b=>Math.ceil(b*a)));let p=0,v=0,g=0,m=0;if(Array.isArray(o)&&(p=(o[0]||0)*a,v=(o[1]||0)*a,g=(o[2]||0)*a,m=(o[3]||0)*a),m||v||p||g){e.lineCap="butt";let{x:b,y,w:S,h:x}=t;d==="border-box"?(b=b+m/2,y=y+p/2,S=S-m/2-v/2,x=x-p/2-g/2):d==="content-box"?(b=b-m/2,y=y-p/2,S=S+m/2+v/2,x=x+p/2+g/2):(b=t.x,y=t.y,S=t.w,x=t.h),p&&(e.beginPath(),e.lineWidth=p,e.moveTo(b-m/2,y),e.lineTo(b+S+v/2,y),e.closePath(),e.stroke()),v&&(e.beginPath(),e.lineWidth=v,e.moveTo(b+S,y-p/2),e.lineTo(b+S,y+x+g/2),e.closePath(),e.stroke()),g&&(e.beginPath(),e.lineWidth=g,e.moveTo(b-m/2,y+x),e.lineTo(b+S+v/2,y+x),e.closePath(),e.stroke()),m&&(e.beginPath(),e.lineWidth=m,e.moveTo(b,y-p/2),e.lineTo(b,y+x+g/2),e.closePath(),e.stroke())}else{let{x:b,y,w:S,h:x}=t;d==="border-box"?(b=t.x+u/2,y=t.y+u/2,S=t.w-u,x=t.h-u):d==="content-box"?(b=t.x-u/2,y=t.y-u/2,S=t.w+u,x=t.h+u):(b=t.x,y=t.y,S=t.w,x=t.h),h.length>0?e.lineCap="butt":e.lineCap="square",S=Math.max(S,1),x=Math.max(x,1),f=f.map(C=>Math.min(C,S/2,x/2)),e.setLineDash(h),e.lineWidth=u,e.beginPath(),e.moveTo(b+f[0],y),e.arcTo(b+S,y,b+S,y+x,f[1]),e.arcTo(b+S,y+x,b,y+x,f[2]),e.arcTo(b,y+x,b,y,f[3]),e.arcTo(b,y,b+S,y,f[0]),e.closePath(),e.stroke()}e.setLineDash([])}function ar(e,t,n){const{detail:r}=t,{viewScaleInfo:a,renderContent:i}=n,{shadowColor:o,shadowOffsetX:s,shadowOffsetY:c,shadowBlur:d}=r;At.number(d)?(e.save(),e.shadowColor=o||yo.shadowColor,e.shadowOffsetX=(s||0)*a.scale,e.shadowOffsetY=(c||0)*a.scale,e.shadowBlur=(d||0)*a.scale,i(),e.restore()):(e.save(),e.shadowColor="transparent",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,i(),e.restore())}function Qh(e,t,n){const{detail:r,angle:a}=t,{calculator:i,viewScaleInfo:o,viewSizeInfo:s,parentOpacity:c}=n,{background:d="#000000",borderColor:u="#000000",boxSizing:f,borderWidth:h=0}=r;let p=0;typeof h=="number"&&h>0?p=h:Array.isArray(h)&&typeof h[0]=="number"&&h[0]>0&&(p=h[0]),p=p*o.scale;const{x:v,y:g,w:m,h:b}=(i==null?void 0:i.elementSize({x:t.x,y:t.y,w:t.w,h:t.h},o,s))||t,y=Object.assign(Object.assign({},t),{x:v,y:g,w:m,h:b,angle:a});_t(e,{x:v,y:g,w:m,h:b,angle:a},()=>{ar(e,y,{viewScaleInfo:o,viewSizeInfo:s,renderContent:()=>{let S=m/2,x=b/2;const C=v+S,E=g+x;if(p>0&&(f==="border-box"?(S=S-p,x=x-p):f==="center-line"?(S=S-p/2,x=x-p/2):(S=S-p,x=x-p)),S>=0&&x>=0){const j=nn(y)*c;if(e.globalAlpha=j,typeof p=="number"&&p>0){const k=p/2+S,F=p/2+x;e.beginPath(),e.strokeStyle=u,e.lineWidth=p,e.circle(C,E,k,F,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath();const z=bo(e,d,{viewElementSize:{x:v,y:g,w:m,h:b},viewScaleInfo:o,opacity:e.globalAlpha});e.fillStyle=z,e.circle(C,E,S,x,0,0,2*Math.PI),e.closePath(),e.fill(),e.globalAlpha=c}}})})}function Jh(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize(t,a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});_t(e,{x:s,y:c,w:d,h:u,angle:f},()=>{ar(e,h,{viewScaleInfo:a,viewSizeInfo:i,renderContent:()=>{rr(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{}})}})})}function qh(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t,p=Object.assign(Object.assign({},t),{x:c,y:d,w:u,h:f,angle:h});_t(e,{x:c,y:d,w:u,h:f,angle:h},()=>{ar(e,p,{viewScaleInfo:i,viewSizeInfo:o,renderContent:()=>{rr(e,p,{originElem:t,calcElemSize:{x:c,y:d,w:u,h:f,angle:h},viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s,renderContent:()=>{if(!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="image"&&r){e.globalAlpha=nn(t)*s;const{x:v,y:g,w:m,h:b,radiusList:y}=qo(p,{viewScaleInfo:i,viewSizeInfo:o});e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(v+y[0],g),e.arcTo(v+m,g,v+m,g+b,y[1]),e.arcTo(v+m,g+b,v,g+b,y[2]),e.arcTo(v,g+b,v,g,y[3]),e.arcTo(v,g,v+m,g,y[0]),e.closePath(),e.fill(),e.clip(),e.drawImage(r,v,g,m,b),e.globalAlpha=s,e.restore()}}})}})})}function ep(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t;_t(e,{x:c,y:d,w:u,h:f,angle:h},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="svg"&&r&&(e.globalAlpha=nn(t)*s,e.drawImage(r,c,d,u,f),e.globalAlpha=s)})}function tp(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t;_t(e,{x:c,y:d,w:u,h:f,angle:h},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="html"&&r&&(e.globalAlpha=nn(t)*s,e.drawImage(r,c,d,u,f),e.globalAlpha=s)})}const Wi=sn();function np(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize(t,a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});_t(e,{x:s,y:c,w:d,h:u,angle:f},()=>{rr(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{const p=Object.assign(Object.assign({},Wi),t.detail),v=(p.fontSize||Wi.fontSize)*a.scale,g=p.lineHeight?p.lineHeight*a.scale:v;e.fillStyle=t.detail.color||Wi.color,e.textBaseline="top",e.$setFont({fontWeight:p.fontWeight,fontSize:v,fontFamily:p.fontFamily});const m=p.text.replace(/\r\n/gi,` +`),b=g,y=m.split(` +`),S=[];let x=0;y.forEach((E,j)=>{let z="";if(E.length>0){for(let k=0;ku));k++)if(E.length-1===k&&(x+1)*b{let k=s;p.textAlign==="center"?k=s+(d-j.width)/2:p.textAlign==="right"&&(k=s+(d-j.width)),e.fillText(j.text,k,E+b*z)})}}})})}function rp(e,t,n){const{detail:r}=t,{originX:a,originY:i,originW:o,originH:s}=r,{calculator:c,viewScaleInfo:d,viewSizeInfo:u,parentOpacity:f}=n,{x:h,y:p,w:v,h:g,angle:m}=(c==null?void 0:c.elementSize(t,d,u))||t,b=v/o,y=g/s,S=a*b,x=i*y,C=h-S,E=p-x,j=d.scale*u.devicePixelRatio,z=Object.assign(Object.assign({},t),{x:h,y:p,w:v,h:g,angle:m});_t(e,{x:h,y:p,w:v,h:g,angle:m},()=>{rr(e,z,{originElem:t,calcElemSize:{x:h,y:p,w:v,h:g,angle:m},viewScaleInfo:d,viewSizeInfo:u,parentOpacity:f,renderContent:()=>{ar(e,z,{viewScaleInfo:d,viewSizeInfo:u,renderContent:()=>{e.save(),e.translate(C,E),e.scale(j*b/d.scale,j*y/d.scale);const k=Yd(r.commands||[]),F=new Path2D(k);r.fill&&(e.fillStyle=r.fill,e.fill(F)),r.stroke&&r.strokeWidth!==0&&(e.strokeStyle=r.stroke,e.lineWidth=(r.strokeWidth||1)/u.devicePixelRatio,e.lineCap=r.strokeLineCap||"square",e.stroke(F)),e.translate(-C,-E),e.restore()}})}})})}function eu(e,t,n){var r;if(((r=t==null?void 0:t.operations)===null||r===void 0?void 0:r.invisible)===!0)return;const{w:a,h:i}=t,{scale:o}=n.viewScaleInfo;if(!(o<1&&(a*o<1||i*o<1)||n.parentOpacity===0))try{switch(t.type){case"rect":{Jh(e,t,n);break}case"circle":{Qh(e,t,n);break}case"text":{np(e,t,n);break}case"image":{qh(e,t,n);break}case"svg":{ep(e,t,n);break}case"html":{tp(e,t,n);break}case"path":{rp(e,t,n);break}case"group":{const s=Object.assign(Object.assign({},n.elementAssets||{}),t.detail.assets||{});ap(e,t,Object.assign(Object.assign({},n),{elementAssets:s}));break}default:break}}catch(s){console.error(s)}}function ap(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize({x:t.x,y:t.y,w:t.w,h:t.h,angle:t.angle},a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});_t(e,{x:s,y:c,w:d,h:u,angle:f},()=>{e.globalAlpha=nn(t)*o,ar(e,h,{viewScaleInfo:a,viewSizeInfo:i,renderContent:()=>{rr(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{const{x:p,y:v,w:g,h:m,radiusList:b}=qo(h,{viewScaleInfo:a,viewSizeInfo:i});if(t.detail.overflow==="hidden"&&(e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(p+b[0],v),e.arcTo(p+g,v,p+g,v+m,b[1]),e.arcTo(p+g,v+m,p,v+m,b[2]),e.arcTo(p,v+m,p,v,b[3]),e.arcTo(p,v,p+g,v,b[0]),e.closePath(),e.fill(),e.clip()),Array.isArray(t.detail.children)){const{parentElementSize:y}=n,S={x:y.x+t.x,y:y.y+t.y,w:t.w||y.w,h:t.h||y.h,angle:t.angle},{calculator:x}=n;for(let C=0;C{rr(e,p,{originElem:s,calcElemSize:{x:c,y:d,w:u,h:f,angle:h},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{}})}})}var Gi=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},fe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},br=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ke,jr,Xn,Ze,Mt,Oa,Vi,sl,ll,cl,tu,nu;const lp=["image","svg","html"],$r=e=>{var t,n,r;let a=null;return e.type==="image"?a=((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.src)||null:e.type==="svg"?a=((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.svg)||null:e.type==="html"&&(a=((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.html)||null),typeof a=="string"&&a?Qt(a)?a:nr(a):nr(`${tr()}-${e.uuid}-${tr()}-${tr()}`)};class cp extends en{constructor(){super(),Ke.add(this),jr.set(this,{}),Xn.set(this,{}),Ze.set(this,{}),Mt.set(this,!1),fe(this,Ke,"m",Oa).call(this,"image",(t,n)=>Gi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.src])===null||r===void 0?void 0:r.value)||t.detail.src,i=yield bi(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}})),fe(this,Ke,"m",Oa).call(this,"html",(t,n)=>Gi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.html])===null||r===void 0?void 0:r.value)||t.detail.html,i=yield Qf(a,{width:t.detail.originW||t.w,height:t.detail.originH||t.h});return{uuid:t.uuid,lastModified:Date.now(),content:i}})),fe(this,Ke,"m",Oa).call(this,"svg",(t,n)=>Gi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.svg])===null||r===void 0?void 0:r.value)||t.detail.svg,i=yield Zf(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}}))}isDestroyed(){return fe(this,Mt,"f")}destroy(){br(this,Mt,!0,"f"),this.clear(),br(this,jr,null,"f"),br(this,Xn,null,"f"),br(this,Ze,null,"f")}load(t,n){fe(this,Mt,"f")!==!0&&(fe(this,Ke,"m",nu).call(this,t)||lp.includes(t.type)&&fe(this,Ke,"m",tu).call(this,t,n))}getContent(t){var n,r;const a=$r(t);return((r=(n=fe(this,Ze,"f"))===null||n===void 0?void 0:n[a])===null||r===void 0?void 0:r.content)||null}getLoadItemMap(){return fe(this,Ze,"f")}setLoadItemMap(t){br(this,Ze,t,"f")}}jr=new WeakMap,Xn=new WeakMap,Ze=new WeakMap,Mt=new WeakMap,Ke=new WeakSet,Oa=function(t,n){fe(this,jr,"f")[t]=n},Vi=function(t){var n,r,a;let i=null;return t.type==="image"?i=((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.src)||null:t.type==="svg"?i=((r=t==null?void 0:t.detail)===null||r===void 0?void 0:r.svg)||null:t.type==="html"&&(i=((a=t==null?void 0:t.detail)===null||a===void 0?void 0:a.html)||null),i},sl=function(t){return{element:t,status:"null",content:null,error:null,startTime:-1,endTime:-1,source:fe(this,Ke,"m",Vi).call(this,t)}},ll=function(t){const n=$r(t.element),r=fe(this,Ze,"f")[n];fe(this,Mt,"f")||(r?r.startTime{fe(this,Mt,"f")||(r.content=o.content,r.endTime=Date.now(),r.status="load",fe(this,Ke,"m",ll).call(this,r))}).catch(o=>{console.warn(`Load element source "${r.source}" fail`,o,t),r.endTime=Date.now(),r.status="error",r.error=o,fe(this,Ke,"m",cl).call(this,r)}))},nu=function(t){var n;const r=$r(t),a=(n=fe(this,Xn,"f"))===null||n===void 0?void 0:n[r];return!!(a&&a.status==="error"&&a.source&&a.source===fe(this,Ke,"m",Vi).call(this,t))};var yr=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},rt=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},wo,Lt,St,Ta,ru;class au extends en{constructor(t){super(),wo.add(this),Lt.set(this,void 0),St.set(this,new cp),Ta.set(this,!1),yr(this,Lt,t,"f"),rt(this,wo,"m",ru).call(this)}isDestroyed(){return rt(this,Ta,"f")}destroy(){this.clear(),yr(this,Lt,null,"f"),rt(this,St,"f").destroy(),yr(this,St,null,"f"),yr(this,Ta,!0,"f")}updateOptions(t){yr(this,Lt,t,"f")}drawData(t,n){const r=rt(this,St,"f"),{calculator:a}=rt(this,Lt,"f"),i=rt(this,Lt,"f").viewContext;i.clearRect(0,0,i.canvas.width,i.canvas.height);const o={x:0,y:0,w:n.viewSizeInfo.width,h:n.viewSizeInfo.height};t.underlay&&sp(i,t.underlay,Object.assign({loader:r,calculator:a,parentElementSize:o,parentOpacity:1},n)),op(i,t,Object.assign({loader:r,calculator:a,parentElementSize:o,elementAssets:t.assets,parentOpacity:1},n))}scale(t){const{sharer:n}=rt(this,Lt,"f");if(!n)return;const{data:r,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s,width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}=n.getActiveStoreSnapshot();r&&this.drawData(r,{viewScaleInfo:{scale:t,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s},viewSizeInfo:{width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}})}setLoadItemMap(t){rt(this,St,"f").setLoadItemMap(t)}getLoadItemMap(){return rt(this,St,"f").getLoadItemMap()}getLoader(){return rt(this,St,"f")}}Lt=new WeakMap,St=new WeakMap,Ta=new WeakMap,wo=new WeakSet,ru=function(){const t=rt(this,St,"f");t.on("load",n=>{this.trigger("load",n)}),t.on("error",n=>{console.error(n)})};var dl=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ul=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Sn;class iu{constructor(t){Sn.set(this,void 0),dl(this,Sn,t,"f")}destroy(){dl(this,Sn,null,"f")}elementSize(t,n,r){return Qo(t,{viewScaleInfo:n,viewSizeInfo:r})}isElementInView(t,n,r){return Ph(t,{viewScaleInfo:n,viewSizeInfo:r})}isPointInElement(t,n,r,a){const i=ul(this,Sn,"f").viewContext;return mo(t,{context2d:i,element:n,viewScaleInfo:r,viewSizeInfo:a})}getPointElement(t,n){const r=ul(this,Sn,"f").viewContext;return $h(t,Object.assign(Object.assign({},n),{context2d:r}))}}Sn=new WeakMap;var Ui=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ne=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},we,Zn,Ye,$a,ou,Pa,Ia,za,Ra,Da,Na,ja,La,xt,Et,Yt;function fl(e){return e>0||e<0||e===0}class dp extends en{constructor(t){super(),we.add(this),Zn.set(this,void 0),Ye.set(this,void 0),$a.set(this,!1),Pa.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;const a=ne(this,we,"m",Et).call(this,r);if(!ne(this,we,"m",Yt).call(this,a))return;r.preventDefault(),r.stopPropagation();const i=r.deltaX>0||r.deltaX<0?r.deltaX:0,o=r.deltaY>0||r.deltaY<0?r.deltaY:0;r.ctrlKey===!0&&this.has("wheelScale")?this.trigger("wheelScale",{deltaX:i,deltaY:o,point:a}):this.has("wheel")&&this.trigger("wheel",{deltaX:i,deltaY:o,point:a})}),Ia.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);ne(this,we,"m",Yt).call(this,a)}),za.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);if(!ne(this,we,"m",Yt).call(this,a))return;const i=500,o=Date.now(),s=ne(this,Ye,"f").get("prevClickPoint");s&&o-s.t<=i&&Math.abs(s.x-a.x)<=5&&Math.abs(s.y-a.y)<=5?this.trigger("doubleClick",{point:a}):ne(this,Ye,"f").set("prevClickPoint",a)}),Ra.set(this,r=>{if(ne(this,Ye,"f").set("hasPointDown",!1),!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);this.trigger("pointLeave",{point:a})}),Da.set(this,r=>{if(ne(this,Ye,"f").set("hasPointDown",!1),!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);this.trigger("pointEnd",{point:a})}),Na.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault(),r.stopPropagation();const a=ne(this,we,"m",Et).call(this,r);if(!ne(this,we,"m",Yt).call(this,a)){ne(this,Ye,"f").get("hasPointDown")&&(this.trigger("pointLeave",{point:a}),ne(this,Ye,"f").set("hasPointDown",!1));return}ne(this,Ye,"f").get("hasPointDown")===!0&&this.trigger("pointMove",{point:a})}),ja.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);ne(this,we,"m",Yt).call(this,a)&&(ne(this,Ye,"f").set("hasPointDown",!0),this.trigger("pointStart",{point:a}))}),La.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);ne(this,we,"m",Yt).call(this,a)&&this.trigger("hover",{point:a})});const n=new Fr({defaultStorage:{hasPointDown:!1,prevClickPoint:null}});Ui(this,Ye,n,"f"),Ui(this,Zn,t,"f"),ne(this,we,"m",ou).call(this)}onEvents(){if(ne(this,$a,"f"))return;const t=window;t.addEventListener("mousemove",ne(this,La,"f")),t.addEventListener("mousedown",ne(this,ja,"f")),t.addEventListener("mousemove",ne(this,Na,"f")),t.addEventListener("mouseup",ne(this,Da,"f")),t.addEventListener("mouseleave",ne(this,Ra,"f")),t.addEventListener("wheel",ne(this,Pa,"f"),{passive:!1}),t.addEventListener("click",ne(this,za,"f")),t.addEventListener("contextmenu",ne(this,Ia,"f"))}offEvents(){const t=window;t.removeEventListener("mousemove",ne(this,La,"f")),t.removeEventListener("mousedown",ne(this,ja,"f")),t.removeEventListener("mousemove",ne(this,Na,"f")),t.removeEventListener("mouseup",ne(this,Da,"f")),t.removeEventListener("mouseleave",ne(this,Ra,"f")),t.removeEventListener("wheel",ne(this,Pa,"f")),t.removeEventListener("click",ne(this,za,"f")),t.removeEventListener("contextmenu",ne(this,Ia,"f"))}destroy(){this.offEvents(),ne(this,Ye,"f").destroy(),Ui(this,$a,!0,"f")}}Zn=new WeakMap,Ye=new WeakMap,$a=new WeakMap,Pa=new WeakMap,Ia=new WeakMap,za=new WeakMap,Ra=new WeakMap,Da=new WeakMap,Na=new WeakMap,ja=new WeakMap,La=new WeakMap,we=new WeakSet,ou=function(){this.onEvents()},xt=function(t){return t.target===ne(this,Zn,"f").boardContent.boardContext.canvas},Et=function(t){const r=ne(this,Zn,"f").boardContent.boardContext.canvas.getBoundingClientRect();return{x:t.clientX-r.left,y:t.clientY-r.top,t:Date.now()}},Yt=function(t){const n=ne(this,Zn,"f").sharer.getActiveViewSizeInfo(),{width:r,height:a}=n;return!!(fl(t.x)&&fl(t.y)&&t.x<=r&&t.y<=a)};var hl=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ge=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ve,Cn;const up={width:0,height:0,devicePixelRatio:1,contextWidth:0,contextHeight:0,data:null,scale:1,offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0};class fp{constructor(){ve.set(this,void 0),Cn.set(this,void 0);const t=new Fr({defaultStorage:up}),n=new Fr({defaultStorage:{}});hl(this,ve,t,"f"),hl(this,Cn,n,"f")}getActiveStorage(t){return ge(this,ve,"f").get(t)}setActiveStorage(t,n){return ge(this,ve,"f").set(t,n)}getActiveStoreSnapshot(){return ge(this,ve,"f").getSnapshot()}getSharedStorage(t){return ge(this,Cn,"f").get(t)}setSharedStorage(t,n){return ge(this,Cn,"f").set(t,n)}getSharedStoreSnapshot(){return ge(this,Cn,"f").getSnapshot()}getActiveViewScaleInfo(){return{scale:ge(this,ve,"f").get("scale"),offsetTop:ge(this,ve,"f").get("offsetTop"),offsetBottom:ge(this,ve,"f").get("offsetBottom"),offsetLeft:ge(this,ve,"f").get("offsetLeft"),offsetRight:ge(this,ve,"f").get("offsetRight")}}setActiveViewScaleInfo(t){const{scale:n,offsetTop:r,offsetBottom:a,offsetLeft:i,offsetRight:o}=t;ge(this,ve,"f").set("scale",n),ge(this,ve,"f").set("offsetTop",r),ge(this,ve,"f").set("offsetBottom",a),ge(this,ve,"f").set("offsetLeft",i),ge(this,ve,"f").set("offsetRight",o)}setActiveViewSizeInfo(t){ge(this,ve,"f").set("width",t.width),ge(this,ve,"f").set("height",t.height),ge(this,ve,"f").set("devicePixelRatio",t.devicePixelRatio),ge(this,ve,"f").set("contextWidth",t.contextWidth),ge(this,ve,"f").set("contextHeight",t.contextHeight)}getActiveViewSizeInfo(){return{width:ge(this,ve,"f").get("width"),height:ge(this,ve,"f").get("height"),devicePixelRatio:ge(this,ve,"f").get("devicePixelRatio"),contextWidth:ge(this,ve,"f").get("contextWidth"),contextHeight:ge(this,ve,"f").get("contextHeight")}}}ve=new WeakMap,Cn=new WeakMap;var ka=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},De=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Lr,st,Kn,Mn,su,lu;const{requestAnimationFrame:hp}=window;class pp extends en{constructor(t){super(),Lr.add(this),st.set(this,void 0),Kn.set(this,[]),Mn.set(this,"FREE"),ka(this,st,t,"f"),De(this,Lr,"m",su).call(this)}drawFrame(){const{sharer:t}=De(this,st,"f"),n=t.getActiveStoreSnapshot(),r=t.getSharedStoreSnapshot();De(this,Kn,"f").push({activeStore:n,sharedStore:r}),De(this,Lr,"m",lu).call(this)}scale(t){const{scale:n,point:r}=t,{sharer:a}=De(this,st,"f"),{moveX:i,moveY:o}=Oh({scale:n,point:r,viewScaleInfo:a.getActiveViewScaleInfo(),viewSizeInfo:a.getActiveViewSizeInfo()});return a.setActiveStorage("scale",n),{moveX:i,moveY:o}}scroll(t){const{sharer:n}=De(this,st,"f"),r=n.getActiveViewScaleInfo(),{moveX:a,moveY:i}=t,o=n.getActiveViewSizeInfo(),s=Th({moveX:a,moveY:i,viewScaleInfo:r,viewSizeInfo:o});return n.setActiveViewScaleInfo(s),s}updateViewScaleInfo(t){const{sharer:n}=De(this,st,"f"),r=_h(t,{viewSizeInfo:n.getActiveViewSizeInfo()});return n.setActiveViewScaleInfo(r),r}resize(t={}){const{sharer:n}=De(this,st,"f"),r=n.getActiveViewSizeInfo(),a=Object.assign(Object.assign({},r),t),{width:i,height:o,devicePixelRatio:s}=a,{underContext:c,boardContext:d,helperContext:u,viewContext:f}=De(this,st,"f").boardContent;return d.canvas.width=i*s,d.canvas.height=o*s,d.canvas.style.width=`${i}px`,d.canvas.style.height=`${o}px`,c.canvas.width=i*s,c.canvas.height=o*s,u.canvas.width=i*s,u.canvas.height=o*s,f.canvas.width=i*s,f.canvas.height=o*s,n.setActiveViewSizeInfo(a),a}}st=new WeakMap,Kn=new WeakMap,Mn=new WeakMap,Lr=new WeakSet,su=function(){const{renderer:t}=De(this,st,"f");t.on("load",()=>{this.drawFrame()})},lu=function e(){if(De(this,Mn,"f")==="DRAWING"||De(this,Kn,"f").length===0)return;ka(this,Mn,"DRAWING","f");const t=De(this,Kn,"f").shift(),{renderer:n,boardContent:r,beforeDrawFrame:a,afterDrawFrame:i}=De(this,st,"f");if(t){const{scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u,width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g}=t.activeStore,m={scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u},b={width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g};t!=null&&t.activeStore.data&&n.drawData(t.activeStore.data,{viewScaleInfo:m,viewSizeInfo:b}),a({snapshot:t}),r.drawView(),i({snapshot:t})}if(De(this,Kn,"f").length===0){ka(this,Mn,"COMPLETE","f");return}ka(this,Mn,"DRAWING","f")&&hp(()=>{De(this,Lr,"m",e).call(this)})};var kt=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},W=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Te,An,Ct,ti,de,Pe,Qn,ft,at,_n,Jn,Ba,cu,pl,gl,vl,ml,bl,yl,wl,xl,El,Sl,du,uu,fu,Pr;const ca=10;class gp{constructor(t){Te.add(this),An.set(this,void 0),Ct.set(this,new WeakMap),ti.set(this,[]),de.set(this,[]),Pe.set(this,void 0),Qn.set(this,void 0),ft.set(this,void 0),at.set(this,void 0),_n.set(this,void 0),Jn.set(this,new en),Ba.set(this,!1);const{boardContent:n}=t,r=new fp,a=new iu({viewContext:n.viewContext}),i=new dp({boardContent:n,sharer:r}),o=new au({viewContext:n.viewContext,sharer:r,calculator:a});kt(this,An,t,"f"),kt(this,ft,r,"f"),kt(this,Pe,i,"f"),kt(this,Qn,o,"f"),kt(this,_n,a,"f"),kt(this,at,new pp({boardContent:t.boardContent,sharer:r,renderer:o,calculator:W(this,_n,"f"),beforeDrawFrame:s=>{W(this,Te,"m",uu).call(this,s)},afterDrawFrame:s=>{W(this,Te,"m",fu).call(this,s)}}),"f"),W(this,Te,"m",cu).call(this),W(this,Te,"m",Pr).call(this)}isDestroyed(){return W(this,Ba,"f")}destroy(){W(this,Pe,"f").destroy(),W(this,Qn,"f").destroy(),W(this,_n,"f").destroy(),W(this,Jn,"f").destroy(),kt(this,Ba,!0,"f")}getSharer(){return W(this,ft,"f")}getViewer(){return W(this,at,"f")}getRenderer(){return W(this,Qn,"f")}setData(t){const n=W(this,ft,"f");W(this,ft,"f").setActiveStorage("data",t);const r=n.getActiveViewSizeInfo(),a=Hd(t.elements,{viewWidth:r.width,viewHeight:r.height,extend:!0});W(this,at,"f").drawFrame();const i=Object.assign(Object.assign({},r),a);return W(this,ft,"f").setActiveViewSizeInfo(i),{viewSizeInfo:i}}getData(){const{data:t}=W(this,ft,"f").getActiveStoreSnapshot();return t}use(t){var n,r,a;if(W(this,Ct,"f").has(t)){const h=W(this,Ct,"f").get(t);if(h){(r=(n=h.middlewareObject).use)===null||r===void 0||r.call(n),h.status="enable",W(this,Ct,"f").set(t,h),W(this,Te,"m",Pr).call(this);return}}const{boardContent:i,container:o}=W(this,An,"f"),s=W(this,ft,"f"),c=W(this,at,"f"),d=W(this,_n,"f"),u=W(this,Jn,"f"),f=t({boardContent:i,sharer:s,viewer:c,calculator:d,eventHub:u,container:o});(a=f.use)===null||a===void 0||a.call(f),W(this,ti,"f").push(t),W(this,de,"f").push(f),W(this,Ct,"f").set(t,{status:"enable",middlewareObject:f}),W(this,Te,"m",Pr).call(this)}disuse(t){var n,r;const a=W(this,Ct,"f").get(t);a&&((r=(n=a.middlewareObject).disuse)===null||r===void 0||r.call(n),a.status="disable",W(this,Ct,"f").set(t,a),W(this,Te,"m",Pr).call(this))}scale(t){const n=W(this,at,"f"),{moveX:r,moveY:a}=n.scale(t);n.scroll({moveX:r,moveY:a})}scroll(t){return W(this,at,"f").scroll(t)}updateViewScaleInfo(t){return W(this,at,"f").updateViewScaleInfo(t)}resize(t){const n=W(this,at,"f").resize(t),{width:r,height:a,devicePixelRatio:i}=t,{boardContent:o}=W(this,An,"f");o.viewContext.$resize({width:r,height:a,devicePixelRatio:i}),o.helperContext.$resize({width:r,height:a,devicePixelRatio:i}),o.boardContext.$resize({width:r,height:a,devicePixelRatio:i}),o.underContext.$resize({width:r,height:a,devicePixelRatio:i}),W(this,at,"f").drawFrame(),W(this,Pe,"f").trigger("resize",n),W(this,ft,"f").setActiveViewSizeInfo(t)}clear(){const{boardContent:t}=W(this,An,"f"),{underContext:n,helperContext:r,viewContext:a,boardContext:i}=t;n.clearRect(0,0,n.canvas.width,n.canvas.height),r.clearRect(0,0,r.canvas.width,r.canvas.height),a.clearRect(0,0,a.canvas.width,a.canvas.height),i.clearRect(0,0,i.canvas.width,i.canvas.height),W(this,Te,"m",du).call(this)}getEventHub(){return W(this,Jn,"f")}onWatcherEvents(){W(this,Pe,"f").onEvents()}offWatcherEvents(){W(this,Pe,"f").offEvents()}}An=new WeakMap,Ct=new WeakMap,ti=new WeakMap,de=new WeakMap,Pe=new WeakMap,Qn=new WeakMap,ft=new WeakMap,at=new WeakMap,_n=new WeakMap,Jn=new WeakMap,Ba=new WeakMap,Te=new WeakSet,cu=function(){W(this,Pe,"f").on("pointStart",W(this,Te,"m",pl).bind(this)),W(this,Pe,"f").on("pointEnd",W(this,Te,"m",gl).bind(this)),W(this,Pe,"f").on("pointMove",ia(t=>{W(this,Te,"m",vl).call(this,t)},ca)),W(this,Pe,"f").on("hover",ia(t=>{W(this,Te,"m",ml).call(this,t)},ca)),W(this,Pe,"f").on("wheel",ia(t=>{W(this,Te,"m",yl).call(this,t)},ca)),W(this,Pe,"f").on("wheelScale",ia(t=>{W(this,Te,"m",wl).call(this,t)},ca)),W(this,Pe,"f").on("scrollX",W(this,Te,"m",xl).bind(this)),W(this,Pe,"f").on("scrollY",W(this,Te,"m",El).bind(this)),W(this,Pe,"f").on("resize",W(this,Te,"m",Sl).bind(this)),W(this,Pe,"f").on("doubleClick",W(this,Te,"m",bl).bind(this)),W(this,Qn,"f").on("load",()=>{W(this,Jn,"f").trigger("loadResource")})},pl=function(t){var n;for(let r=0;r{const a=n.get(r);(a==null?void 0:a.status)==="enable"&&(a!=null&&a.middlewareObject)&&t.push(a.middlewareObject)}),kt(this,de,t,"f")};const vp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MDc6MjYrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjliMGM0MzI2LWU4ZTQtNDlkNy04MmUzLTgxODkwYTE2ZmU1YSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjMzOGFhZDBmLWZkZjMtODE0MS1iMTZmLWNiZWIzNTQyYTJhMCIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjUwODAxNzc1LWZlNGEtNDQyMy05NDQ3LThkYWRhNzZhYTllOSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NTA4MDE3NzUtZmU0YS00NDIzLTk0NDctOGRhZGE3NmFhOWU5IiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjA3OjI2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6OWIwYzQzMjYtZThlNC00OWQ3LTgyZTMtODE4OTBhMTZmZTVhIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7W6XrzAAAGLklEQVRYhb2Xf2iUdRzHX/txtfXLplZ6Wblm6fzRmG6r7Uou1AxKRjQKYUqgaLBACFogppcK1h8aLRkMSYaJIA5hYMomZpskEfPOufCaDpZ6t7rbre263U3vzn3643meu+eu3XNzvz7w4bbdc/e89nl/Pu/v50HUCAQCx1tbW0uAx4CHgSwggxkKERkziUQif2mQ0WjU53a7vwSeBB4BTEDmTICmBBwYGDivVlDjlFAo9KvT6dwIPAHkANkq6MwDXr169bCISENDg9TX14s+BgcHf2hubi5mBmRPCXj06NFPREQ6OjoEkPLycrl06VIMMhKJeFwu1xdMs+wpAYuLi9eIiIyOjkpeXp4AAsj27dvF7/fHQIPB4C9dXV0fME2ypwQEXvX7/bdFRNauXRsDBMRkMsnhw4cTZB8YGGhsamp6hSmW3Qhw1Y0bN86LiNTW1iYAallWViZtbW162ftcLtdO/i/7tAAWtba2ficicvLkyTEBtdy6dasMDg7GQIeHh9s7OzvfBx5nkrIbAS7du3fvxyIiPT09hoBa1tXVJcv+fWNj4zLgUeAhJiC7EeDLwOsiMioisnDhwnFBrlixQi5evKiX/c6tW7c+R5E9lweU3QjwReDV/v7+bhGRqqqqcQFquWnTJvH5fHrZLzocjkoSZU9bTSPA54GV165daxYROXDgwAMBannw4MFk2RsaGhqWME7ZjQDNwIrTp09/JSLS0tIyIUBACgoK5MKFCzHIcDj85+3btz8FZpFGdiPAZ4DCmpqaTSIiPp9vwoBaVlVVidfr1ct+/sqVK+9iILsR4FzgJcASDoeHRUSKioomDQnI/v37E2T3+Xz1hw4dWjSW7EaAeUA+UNbX12cXEdmyZcuUAAJiNpvlzJkzetl73G53rVrN2EmUCjATuA9EgYjL5eoGKCkpGatNHijmz5/Pxo0b2blzJ2azOfZ3k8lUYDabv45Go/Y7d+6sIY0VZQOjGqDT6bxeWlrKqlWrJgRlsVhYv349FRUVWCwWcnJyEt4PBoOuoaEhu9frvdzR0fHTtm3buolvRpLqe3OBp4EllZWV74mIRKNRyc3NTSvf7Nmzpbq6Wk6cOCFut1uSY2RkJOB0Ou3Nzc3Ha2trPwPWAGXAEuBZFFPPAbKMevBhYA6wCKgIBoP9IiKrV682hLPZbP8DEpH7vb29N1paWn602WwHFyxYsAX4EKgE3gIsQBFQgOIeT6j3z0wFqEkc60OPx9Odn58/t6SkhPb29jFLbrVa2bNnDwBer7fv5s2bPQ6Ho7upqcnZ1tbmASJq3gPC6utdYESXYfWeo6mkBaUHRQ/odrv/yM/Pt5SWlqb8kAbncDh+W7lyZYN683u6DOvAwipsOOnniA4wZf9lqhdoVYzY7fbrQMpBsdlsWK1WRkZGAtXV1d8D/wA+wKNLr5o+YEC9ZggIAEHiFbyfDhCUCcoFngIWFxYWrtMaat68eQl9V15eHmu2+vr6OuAd4A2gGFgMLERp/mdQ+noWyuadi9Jr2aQ4k42GBPXDs1Ga97WhoaFbIiIbNmxIANTWq87Ozp9VuApgGfACihPkoRjwI+p3mlSgtA9ZRkYNYwwKJBr2rl27sFqthEKhwZqamqOAX5f/AsPE5btLvM/GJWO6yFb/82eBonPnztWJiJw9e1YAWb58eUzaI0eOfAO8CbwCPIfiZZN+eEoncSaKLPOApbt3794uIuL1ehOktdvtF4C3gRKURXcOSn9lTRRsvIAZKI4+l/gjQFREZMeOHSIiEggE+tetW/cRitkuRhmERxnnxjxZQFDWnzzURwCv1+vUHxHHjh37lri0C1Am9KGpgDMC1G8SQnxxCHs8Hqf2RldX10+bN28+i+JjwyT62KSaP13oAfWTHO7t7f0dIBQK/b1v375GlEnVjPYuyoQaHlNTDahVMALca29vdwBcvnz5+KlTp26OATft1UuODBS7yEOxj0K/329HOSWWopjxlE1tchhtM7FriPfgXSDDbrfXo0gbJr4QzIi0WiRPYBbKZJrUV23b0dYn7XSYcsBkS9EiO/k6lApq1cwiPjzaAM1Y9cYC1G6uAWrPCtrvMwoHqU02Q5caIEzj1KaS+D+vIjxtLug31gAAAABJRU5ErkJggg==",hu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MzE6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjY0MTBhYjUzLWM0ZjEtNDVhNS04MjhkLTIxOTczOWFjOTk3MSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjBkMDNmNjM5LTE5MzctY2Y0MC1hMTg0LTIyMjg0NzczNWNmYSIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjgyYjQwZGRmLWE0ZGEtNDY3MC1iYzc2LTBhYjY3ZmI5M2I0ZSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ODJiNDBkZGYtYTRkYS00NjcwLWJjNzYtMGFiNjdmYjkzYjRlIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjMxOjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NjQxMGFiNTMtYzRmMS00NWE1LTgyOGQtMjE5NzM5YWM5OTcxIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz57vRudAAAEk0lEQVRYhe3ZW0jbVxzA8e8/MX+NYnG9uI4xE3bvoLt0FzradRfGBtsYo32YdAhb6WQyBqV7KOylpYjzZShDGfjmyxgbgjjwyRm16SYMhgiNKDhbL3VtNF4xJOnf3x7+59i/Wf4aTbInf3AwJMdzPjnnf/n9/jFEhGzDMIxMb3uAIsDs6ek5urS05Dtz5syE+uwekAQS6u89YD19gC0NIpJ1c8GZQHlXV9fJRCIxGo/HxxoaGj4CngWOAEGgEihXfT07MeQC3MB1dna+lkgkRkXF6urq3xcuXPgUOAE8DzwGPOiGLARwEy4ej4+JiITD4elr167NiIgsLi7eqq2trQPeBI4Bj7sh8w10xZmmeds0zdn+/v5/RERisdjUuXPnvgLeAl50Q+YTaAA+oKy7u/uE3laNAwSQ4uLiu6FQ6G4G5DG13YeAMjWWkU+gBygJhULHNe769etTTpwDGXUiz58//yXwujp5qoAHgBLAk0+gNxKJHEulUiMKN2ma5gwgPp/vjhOXjlxYWJisq6urBV5RW30IKAW8eQPGYrGjlmXdEBEZHBy8aZrmFCCmac729fVtAHt7e6MO5N2+vr47IiJLS0s3L126dBZ4Sh2LZUBRwVdwYGBgVuwOYh/zsoF0bnPBVzDTMRgOh6dFhROokSIi8/Pz0+pEeaPQx+DGWdzV1XVSX2LcgCIic3NzMzU1NV8D7wIvq9WrLNRZvOk62NHRccqJTAdGo9Hb1dXV3wAfYt9VjgAPFfI66EQWAxU9PT0fuwEvXrzYBJwF3gFeAAJAhfrfrO4k/7lxZxnr2JlJqry8POnWyePx6H4JR0vhktVkHGOXQI20SkpKLLcOhmGsA5YCaZiVLS5XoADi9XpdkznDMERhnE0fCgUHZhvOW+CO4/8A5hR7wFxjD5hr7AFzjZyBlmVlrOYdYaS1HUUuQA/gWV9fd51URDyqn1c1j6MVFGjoidfW1oq2ABrYj0V82OmVzwHNajVdB88C5wOKTdM87NaxsrKyQsFKHC2BnTDo+/TWt8Bd5INeVC44NDT0xXYZdXNz8w/AaeyS8yjwCPdzQu92ht2m/OUjIyOfS1pkAoqItLS0fA+8D7wKPA0cxs6qC1O4T0xMfKYnb21tnXEDNjc3z+nXbW1t3wFvYz9dCAL7KUThHovFPtGTNjU1jQFSX18/lg68cuXKLUAaGxs3vkB7e/u3wHHgCQpUdnpTqdQvesJgMDisUVevXh3Xry9fvnxTv66qqprQ/cfHx/vVNj/J/couv0DAv7q6+pMDeYPNSalkwkUikX7s4ukl4FHgAODPN1CXnPsWFxd/dCAjW+GGhoZCwAfYpeczwMPAPjVW3gv3IvXN98disZ8dyBGNCwQC4/r94eHhfuy6+JS6zATUCeJXY+W9cNfIUuDAwsLCr05kIBDYeBQ8Ojr6h8Lpx25BtbWlGpfv62BG5PLy8m+SFpOTk38C76mVe84NVyhgOvLgysrK7xoXjUb/Uqt2XG1rEDiYCbcd0MgwsWtk+J1EI03An0wmw5Zlefx+/2n1eRKIO5r+rWTTpFsZ/gWFrGMmeObuqwAAAABJRU5ErkJggg==",mp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAEvUlEQVRYhc2Y20/cVRDHP8v+uKzAWkpDCtZq8BYhJkq8PBoJxgj7I2m0ryaSyFN9IT74pI8+8WJiggRj/APApFkSTGRJ+qKGUiyxbGPEWsUSuVhYC12Wy8+HmeMeYPe3d3WSye/k/M7le+bMzJkZ+J9ToEJreGVYN+vihcytstjQocUlAw0WCSoIVCv3Ae8CXwIt+u8XHVeOG8qLqgAHqAFCQCNwGugCthBJGd7S/tM6LqTzHI5KuqzgaoAHgEvAtwrkG2AG8FzXvep5nue67lX9N6P/PR1/SefXlBtkFXKNDUA/RyX1D9uUbYzOb9D1ygbSQU7eDMxhSSsSiVz3AxiJRK57nuf19/fPad8coqONFCBJPyUOIKc1OvcbgiY9ICDT8+0DHge2gR0gBeyTtviM5HeKAGlrrfMZVwhdAVaAr4F3KNF4gkA9cBbowOc68+3LwDn1Mhdy4/OcYk54nPr6+m54nofruvPa9SFQ6wfQTweNgTwInAGuQWk6mEUvHwb+Au4Dexx7ffK9+0q+CHWIBIOZ9skHYKWfK9tQ8gZoLDjIyWCg3ORY+2T8aYOyg4EaRIFrkCs4QU1NTSvabC20zyIDzuyfkYzEahHX8jHwE/LwXwHeJ4P7KIVIu5ouxFDC+HgLAy4MfEF2v1UpgOezATSiNVf6EvAWsD01NXVtdnb2bk9Pz81sp/q3KIi8t83Ae4DX0tJy0z7t8PDwD4FAYIX/WILVwKMAzc3Nu/agoaGhzmg0ugcsV0hIvlSNoH8IuIiebHJycrls4sotwaxGYvueAPAjEg3jum79yMjIr5WUjFLOxMpBIopWoBN4GfhOJ+4NDg4ulVt6i4uLm7r+BvAscA4fCXrAAfJQJ5Fg8gPgMuCMjo62d3V1LW1sbKRKlpXSxMTEmjZ/5qQrOwHwUAGmkIjiHhJdfKrM/Pz8Y+3t7RvT09Ob5QAYi8X2tbmke2cEZwAaCdoAt5QvIzEbiUSitbe3tyoej++UCnBhYSGkzdu6d1aQxkgOkfwgieQMCeCu8iwSnpNKpcIdHR3BZDJ5UCy4SCSyvL6+/giiSou67wE+eYmhAKKkIaAJUdynkdflNcQF3dFTpooxjmg0aozDAz4DXkB8bxPy1OYM7QzIOuAU0AY8pQu9CrwJ3AK8UCj0RyHgZmZmli1w3wOvAM/oHo1kiZiygbSDh7PAE8DzQA/wBqKnnuM4a2NjY7dygbtw4cICRy31deBFJA09o7eWsU7kJ1KTLJmyRyOSn5zS70fAkwBtbW2/DwwMHHR3d9d3dnY2rK6u7o2Pj2/GYrH9eDzurK2tndM1vwI+QXT7T2BTD5skQz6SCyAcLRoZkGEFGQbeRqpbubK+BPA5MI14h00L3I6Cy2h4+eQbJsKuRa6iQcGFFfB5oBt4DpFsI+Ky7iDBxW3gBhBH/GtC+R7i1lKk3UxRAG2QpvxWr0AbtB3SA5jkx36djH/dVlDbyibN3M8GDvJPyI2PSulixm/u6kZ1OQCaJ/S+tndJX6tvsFBIxcCUdA3vW5ubxMrObc0hDMhd/Rqp5QQHxeW8dubnHGM7tzVv/IECMlxQ/bpcRfRMqaNRheNcUGG9XFWDACfzWs/6Fl3t/xtO//8gpbCORQAAAABJRU5ErkJggg==",bp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAER0lEQVRYhe2YT2hjRRjAf8lL22xsNsm6EWKrSKvuIkIh+O9QRFxEW18KUsoe7FHoRaWCN1FPetOrIHgVKS0q9P5OxaJbodkalgVrtVZjS7Ntd02z6abPw3yzmaT585q+elj2g2HmvZn35jffN/PNNwP35R6XgM/fuif4n+dO2klQvgsaZRc4NJJvoJbHdhrIAkJAN2ADHwFfAw9J3ZoB/b9I0AA6A0SBc0Aa2EVpSqddeZ+QdmfkO+u0gIPSQQR4HfhRQH4AHMDNZDJXXNd1M5nMFalzdB3wJTAOPAD0yEB9066G6wXepVZTd5MpTdporZ6jVqsatmMJoTR3HvgJQ1u2bS+3ArRte9l1XXdsbGyJo1pdBN6Wf3d3ChlAmSQO9LeC8fquQRpDWaerHWSjSr1iu4BkJyOsF9u2s67rkslkluTVxygltAVsJBZqdCngEj5osIlW+4EYytRNF04jeu3vulCT+7QkLH20dEOhumft97pQI4s3+iiRSPwtxVSbd39J8eEGvzFXc1NAs8KSFAZeBt4AHgNeBFDWObkEAne7HAK2gT2gCFQatdca1GbtBj4E3veFprVYVLXXcg4GqM6588BbAMlkcm1qamqzr6/v6ikBet5RgiizJoDPAXdgYGDZXHkzMzPrrk9CdRWngUeAsxxdCzVwpgZ/BigWiz1mo4mJif7jqMajeJrU5hywgGvAej6fvzA0NLThN1Eul9uT4g5VTbYFNKUIfAbsZ7PZvuHh4Wt+As7Ozu5IcY2j219TQB0NV4A7qODgO4CFhYWLg4ODOb8AHccpG4A68m6pRQ1YAQ6A28A+8BXwBcDq6upTqVTquh+AuVyuW4q/opRRaQdZD1gCbgE3ge+BT4HdfD7/ZDwe/z2bzRY6hRsfH1/e3Nx8FDX/sgbgoZfvg6jo4ixqW7oIPA+8CrwHrAJuJBLJd+JaHMf5k6qmPgGeQe1SCenXk0/U21xcIC8AzwGvAJPAEuAmEon1xcXFba9w8/Pz5oqdB14CnpY+oij35km0qwmjwqAU8ISM9hIwBeQA17KsG9PT07+1gxsZGdmgdqW+BjwLDAAPoo4ALU+W9arVwWoIpXp9kouKZpPAO8AwQCwW+2d0dLQ0OTkZSafT0UKhUJ6bm9t2HKeysrIS3tra0g7+KvABUJC0g5rrJdRcbLpImtleRzYashc1P2OSXwbebDVykX3gW+Ab1AHqhuQ3pe6AJlFMO0CoPROHDcio5I8DL1A9C8dQbmod+APYAK4DvwjQnsDdErgyVTfTEaCG1GFYGHXG7TVSo2OkdvhlAflXoHSuNdfStFqaRhEi2kfdprrj6M5LAt0I8EDaaMdflPal48CB95hMr3Bt8h4jD0kyL5E0pN6dysZzW7N2AqjbmhdIZjJvufTOpE19x3g+9s1XJ/ck5tVbfdhu+rxDfLiSO+lFToCjZwrXyH2/0Lwv95z8B1jAqXmDnj4YAAAAAElFTkSuQmCC",yp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAIiklEQVRYhe2YW2yUxxmGn7W96zXGNnZsr2FJHQyYBHNIU1ttAqVUVjlJUAtxQyUXhKgQktUDdSUkuEDtBVJ9UQXRC0RJRblrq/SCIARpFImWQ8VBIZQinJpQYozNyWaxiw/rfXsx3+z+6xNOe9tPGv2nOTzzffPPvDMhSXwJC1nKAXIDV/9ellLAqF1T9o5A2Ry7J5A/Fbh3mUMh8qYJ5kHCQATID6QIkBcAHAVGgKFAStq33EB53/ao5Rm064i9g0CmqcDyrNICYCZQBJTYdaa9j1jelDUwCAwAz4F+ex61DhZauXzr1CDwDHhq1wFg2Do1KWAo0NsCAyoDKoGYXcuBWdZY1PKnzAsDQB/wBOg1yKTVN8vqmoHz6nOgC7gHdFrbCasrNRFgyMCj5qVXgDlANfAaMA/4ir2rMI+MtSHgEdAN9BjsiNVZYR0sNq8+AtqB69Z2MuDBcYA+pAXW0yoDWgTUWXrd8k1l+cBcSxjIIBlPB63G8uUB/8Z57znwAkgGAX1YC4BSK7QIWA7UWwoDJJNJzp49y4ULF2hvb6e7u5tEIkFhYSGVlZXMmzePhoYGNmzYQElJCVZv2tPt7e3s2bOHvr4+9u3bx/r16+PWjg/zQ9x4BEk+5UkqklQt6ZuSdkn6jaRbMhsYGFBbW5uWLVvmp5MpU3V1tVpbW9XV1aWgbdy4MZ2npqbGvx6W9DtJ35e0RFJREDBX0gxJcUnfkPQDScck3fGlz549q7q6ummBjU2xWEzvvfdeGvCtt95Kf6uoqAiyfyBpt6SvSZrlAUOSIpLKJS2X9D1Jv5Z025d69913FQqFJmy8rKxMS5YsUUNDg5YvX67Zs2dPCrpjxw6NjIxoxYoV6XdVVVVBwI8l/UTS1yWVesBcC+18SRsk/ULS33yJtra2CRtramrSiRMn1NXVpWQyKUlKpVJ6+vSpTp48qZ07dyo/P39cua1bt6q+vn4ywL9IapX0tqQyDxiRFDPq3ZL+JCklSadOnRrXwMKFC3X69GlNx65du6aVK1eOqyMYjTGAf50IsNC8t1FSm6TPJOn+/fuKxWJZFb/zzjvjBvx0bO/evQqHwxNG4mUe9MtYMZk5bwHA4cOH6enpSc9BixYt4uTJk5SVlflXfcBN4DFuapoHLPQfz58/z9WrVwmFQsTjceLxOHfv3uUlNlZcpFeMEtzsXg2QSCQ4duxYulQoFOLQoUNBuE7gvAE+x82b/VZHyblz52hsbCSZTL4MCGWrqUECq0gQsBi3ts4B+PDDD3n48GG61OrVq1mzZo1/fGZw54HbVmGV1bMAWPbRRx9NC24CwD7cajLiAXNwIS7ELW3lAGfOnMmqZPv27cHHvwM3gH8AnwH/wnn0C+AuwLZt25g/f/5L4cLhMNu2bfOPnbh1+xkZ9UMebvmKGmQEoLOzM11JQUEBK1eu9I/JAFAPTqnk4hTNY9xS1V5TU1N7+fJlOjo6SKXS+jPLJFFUVMTixYsxmJtW/inOi2nAXDI/C0BWeMvKyojFYv6xz1LCKhnCRSEBPMCFfBaQKi0tfb2+vn5qFzp7AnwCXAM+t45mAUJGfgMwOpoWtIRCWZ/89BB8TuJ+lG5cNEatkXYgjtN+BYG2ktaxBE4U3AP+iRsud3EeHCTwk6Ss0IhvtaKiIk3Q19dHb28vhYWF4H6mYtxwiBrQIE4aPTHgIVzoO3E/TzlOV4YD3/stj9eMPj2xzg4HAYMSPQnkxePxNGB/fz+XLl1iy5Yt4HTeq+aZTtyA9h18Yb33G6aRQBqyDiUNLihmH1q54LAZ9ZHKISPRn1loaGxsJGjHjx8PPi6xtAgnNufgVHcRmf1J2DpTiJsjvYout3c5gQ49Ns89s3fpOdB70I+Hx7iBXrV27VqKi4tJJBKAm3auXLmCDfpy4G3rZSHur/aSPg83BCpx24MFuNUlbnkHcGMubEDdxpG0lBn8AcBBsgfsVysqKti6dStHjhwBYGRkhJaWFs6dO0ckEgGYj9v0xIA71rkha7jUgBYCb5hHGRoaIj8/f4Z5s8jafUpmN/diLBwAkmZKWiipSdKvJN2VpI6ODhUVFWUt7Js2bdLAwMBYLdAt6VNJlyV9IumLsRkOHjyo2tparVixQrdvp2Xmn00YrJI0R05VBRV+GjAiqcoUxA8lnfI1HD16dJz6WLVqla5fvz4tFdPZ2anm5uas8s3Nzf7zp5J+LmmNpFcl5U8GmCupWFKtpO9K+qWkG76W3bt3j4OMRqNqaWnRhQsXNDQ0lAWVTCZ169YtHThwQFVVVePKtrS0+Kw3pgsYso+Vkuol7ZD0W0ldvsHW1tZJZXxtba0aGxvV1NSkdevWaenSpYpGoxPmXb9+vXp6ejzgx5J+ZiGeLSk8GaD34ky5Hd23JP1I0h8kPQmGu7y8/L/aNEUiEe3fv1/Dw8Pp6Es6KqlZ0puSXpHbVU4KiPVglqQFkr4j6aeSfi/pvq/13r172rVrlyorK6cFFo1GtXnzZl25ciU4Ch5J+qOkH0v6tqTXzDk5EwGGlNFjOWQOd8px4vUN4E3cpn2pz/jgwQPef/99Ll68yJ07d+jt7WVwcJBIJEJJSQlz586loaGBTZs2UVdXF5w0OoDLwFWcbPsct6r04+bRLHEYCoWyAD1kBDfHleHmsxrccccS3NFHNV/eenBy6iZwCycMOnHz5wBuDh2nyyY6H0zhFmoF7vtxk+l9q3ieQfrDo8msF7cy3cN56g7ZWnKcep7IxnrQmz+wHKu2K3EKJWbPpWSUTQ4ZtRJc23sC6ZGB9ZM52JwcboIQjzUvZvNxYfeHlyVkZFcBbux6wKA6ShjoM5yM8uH0Xpuy8ekAQuZc2W8P8nEei9p9mMmPgAfJHO0O27e0lHppw9MEDJo//A4eoE91iB48SJ80lFMB/t/+V/sPGZfTmtMFR4EAAAAASUVORK5CYII=";var ni=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ae=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},We,ri,kr,On,Fa,Xt,pu,gu,Rt,Cl,Ml;class wp{constructor(t,n){We.add(this),ri.set(this,void 0),kr.set(this,void 0),On.set(this,null),Fa.set(this,null),Xt.set(this,{auto:vp,"drag-default":mp,"drag-active":bp,"rotate-0":hu,rotate:yp}),ni(this,kr,t,"f"),ni(this,ri,n.eventHub,"f"),Ae(this,We,"m",pu).call(this),Ae(this,We,"m",gu).call(this)}}ri=new WeakMap,kr=new WeakMap,On=new WeakMap,Fa=new WeakMap,Xt=new WeakMap,We=new WeakSet,pu=function(){const t=Ae(this,ri,"f");Ae(this,We,"m",Rt).call(this,"default"),t.on("cursor",n=>{var r;n.type==="over-element"||!n.type?Ae(this,We,"m",Rt).call(this,"auto"):n.type==="resize-rotate"?Ae(this,We,"m",Rt).call(this,"rotate"):typeof n.type=="string"&&(!((r=n.type)===null||r===void 0)&&r.startsWith("resize-"))?Ae(this,We,"m",Cl).call(this,n):n.type==="drag-default"?Ae(this,We,"m",Rt).call(this,"drag-default"):n.type==="drag-active"?Ae(this,We,"m",Rt).call(this,"drag-active"):Ae(this,We,"m",Rt).call(this,"auto")})},gu=function(){bi(hu).then(t=>{ni(this,Fa,t,"f")}).catch(t=>{console.error(t)})},Rt=function(t){if(Ae(this,On,"f")===t)return;ni(this,On,t,"f");const n=Ae(this,Xt,"f")[Ae(this,On,"f")]||Ae(this,Xt,"f").auto;let r=0,a=0;(t.startsWith("rotate-")&&Ae(this,Xt,"f")[Ae(this,On,"f")]||t==="rotate")&&(r=10,a=10),t==="default"?Ae(this,kr,"f").style.cursor="default":Ae(this,kr,"f").style.cursor=`image-set(url(${n})2x) ${r} ${a}, auto`},Cl=function(t){var n;let r=0;t.type==="resize-top"?r+=0:t.type==="resize-top-right"?r+=45:t.type==="resize-right"?r+=90:t.type==="resize-bottom-right"?r+=135:t.type==="resize-bottom"?r+=180:t.type==="resize-bottom-left"?r+=225:t.type==="resize-left"?r+=270:t.type==="resize-top-left"&&(r+=315),r+=ht(((n=t==null?void 0:t.element)===null||n===void 0?void 0:n.angle)||0),Array.isArray(t.groupQueue)&&t.groupQueue.length>0&&t.groupQueue.forEach(i=>{r+=ht(i.angle||0)}),r=ht(r);const a=Ae(this,We,"m",Ml).call(this,r);Ae(this,We,"m",Rt).call(this,a)},Ml=function(t){const n=`rotate-${t}`;if(!Ae(this,Xt,"f")[n]){const r=Ae(this,Fa,"f");if(r){const a=document.createElement("canvas"),i=r.width,o=r.height,s={x:i/2,y:o/2};a.width=i,a.height=o;const c=a.getContext("2d"),d=Ft(t);c.translate(s.x,s.y),c.rotate(d),c.translate(-s.x,-s.y),c.drawImage(r,0,0,i,o),c.translate(s.x,s.y),c.rotate(-d),c.translate(-s.x,-s.y);const u=a.toDataURL("image/png");Ae(this,Xt,"f")[n]=u}}return n};const et="SELECT",Ce=Symbol(`${et}_actionType`),Vt=Symbol(`${et}_resizeType`),da=Symbol(`${et}_areaStart`),ua=Symbol(`${et}_areaEnd`),wr=Symbol(`${et}_hoverElement`),Yi=Symbol(`${et}_hoverElementVertexes`),xr=Symbol(`${et}_selectedElementList`),xp=Symbol(`${et}_selectedElementListVertexes`),mn=Symbol(`${et}_selectedElementController`),Fe=Symbol(`${et}_groupQueue`),Xi=Symbol(`${et}_groupQueueVertexesList`),fa=Symbol(`${et}_isMoving`),vu=2,Ep=4,mu=1,Vr="#1973ba",Al="#5b5959b5",bu=10;function Bt(e,t,n){const{borderColor:r,borderWidth:a,background:i,lineDash:o}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.fillStyle=i,e.setLineDash(o),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[1].x,t[1].y),e.lineTo(t[2].x,t[2].y),e.lineTo(t[3].x,t[3].y),e.lineTo(t[0].x,t[0].y),e.closePath(),e.stroke(),e.fill()}function Sp(e,t,n,r){const{borderColor:a,borderWidth:i,lineDash:o}=r;e.setLineDash([]),e.lineWidth=i,e.strokeStyle=a,e.setLineDash(o),e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.closePath(),e.stroke()}function Cp(e,t,n){const{size:r,borderColor:a,borderWidth:i,background:o}=n,s=t,c=r/2,d=c,u=c;if(d>=0&&u>=0){if(typeof i=="number"&&i>0){const f=i/2+d,h=i/2+u;e.beginPath(),e.strokeStyle=a,e.lineWidth=i,e.circle(s.x,s.y,f,h,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath(),e.fillStyle=o,e.circle(s.x,s.y,d,u,0,0,2*Math.PI),e.closePath(),e.fill()}}function Dt(e,t,n){const{borderColor:r,borderWidth:a,background:i,lineDash:o}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.fillStyle=i,e.setLineDash(o),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[2].x,t[2].y),e.closePath(),e.stroke(),e.beginPath(),e.moveTo(t[1].x,t[1].y),e.lineTo(t[3].x,t[3].y),e.closePath(),e.stroke()}function _l(e,t,n){if(!t)return;const r={borderColor:Vr,borderWidth:1,background:"transparent",lineDash:[]};Bt(e,Re(t,n),r)}function Ol(e,t,n){if(!t)return;const r={borderColor:Al,borderWidth:1,background:"transparent",lineDash:[]};Bt(e,Re(t,n),r);const{controller:a}=n;if(a){const{topLeft:i,topRight:o,bottomLeft:s,bottomRight:c,topMiddle:d,bottomMiddle:u,leftMiddle:f,rightMiddle:h}=a,p=Object.assign(Object.assign({},r),{borderWidth:1,background:Al});Dt(e,Re(d.vertexes,n),p),Dt(e,Re(u.vertexes,n),p),Dt(e,Re(f.vertexes,n),p),Dt(e,Re(h.vertexes,n),p),Dt(e,Re(i.vertexes,n),p),Dt(e,Re(o.vertexes,n),p),Dt(e,Re(s.vertexes,n),p),Dt(e,Re(c.vertexes,n),p)}}function Tl(e,t,n){if(!t)return;const{hideControllers:r}=n,{elementWrapper:a,topLeft:i,topRight:o,bottomLeft:s,bottomRight:c,top:d,rotate:u}=t,f={borderColor:Vr,borderWidth:vu,background:"transparent",lineDash:[]},h=Object.assign(Object.assign({},f),{borderWidth:Ep,background:"#FFFFFF"});Bt(e,Re(a,n),f),r||(Sp(e,Je(d.center,n),Je(u.center,n),Object.assign(Object.assign({},h),{borderWidth:2})),Bt(e,Re(i.vertexes,n),h),Bt(e,Re(o.vertexes,n),h),Bt(e,Re(s.vertexes,n),h),Bt(e,Re(c.vertexes,n),h),Cp(e,Je(u.center,n),Object.assign(Object.assign({},h),{size:bu,borderWidth:2})))}function Mp(e,t){const{start:n,end:r}=t;e.setLineDash([]),e.lineWidth=mu,e.strokeStyle=Vr,e.fillStyle="#1976d24f",e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,n.y),e.lineTo(r.x,r.y),e.lineTo(n.x,r.y),e.closePath(),e.stroke(),e.fill()}function Ap(e,t){const{areaSize:n}=t,{x:r,y:a,w:i,h:o}=n;e.setLineDash([]),e.lineWidth=mu,e.strokeStyle=Vr,e.fillStyle="#1976d21c",e.beginPath(),e.moveTo(r,a),e.lineTo(r+i,a),e.lineTo(r+i,a+o),e.lineTo(r,a+o),e.closePath(),e.stroke(),e.fill()}function _p(e,t,n){for(let r=0;r0?Math.abs(e):0-Math.abs(e)}function xo(e,t){const{ctx:n,viewScaleInfo:r,viewSizeInfo:a,vertexes:i}=t,o=Je(i[0],{viewScaleInfo:r,viewSizeInfo:a}),s=Je(i[1],{viewScaleInfo:r,viewSizeInfo:a}),c=Je(i[2],{viewScaleInfo:r,viewSizeInfo:a}),d=Je(i[3],{viewScaleInfo:r,viewSizeInfo:a});return n.beginPath(),n.moveTo(o.x,o.y),n.lineTo(s.x,s.y),n.lineTo(c.x,c.y),n.lineTo(d.x,d.y),n.lineTo(o.x,o.y),n.closePath(),!!n.isPointInPath(e.x,e.y)}function $l(e,t){const{ctx:n,viewScaleInfo:r,viewSizeInfo:a,groupQueue:i}=t;if(!i||!((i==null?void 0:i.length)>0))return!1;const o=Jo(i),s=o[o.length-1];return s?xo(e,{ctx:n,vertexes:s,viewScaleInfo:r,viewSizeInfo:a}):!1}function Er(e,t){var n,r,a;const i={type:null,elements:[],elementVertexesList:[],groupQueue:[],groupQueueVertexesList:[]},{ctx:o,data:s,calculator:c,selectedElements:d,viewScaleInfo:u,viewSizeInfo:f,areaSize:h,groupQueue:p,selectedElementController:v}=t;if(v){const{left:g,right:m,top:b,bottom:y,topLeft:S,topRight:x,bottomLeft:C,bottomRight:E,rotate:j}=v,z=[g,m,b,y,S,x,C,E,j];for(let k=0;k0&&(i.groupQueue=p||[],i.elements=[d[0]]);break}}}if(p&&Array.isArray(p)&&p.length>0){const g=p[p.length-1];if(!((n=g==null?void 0:g.detail)===null||n===void 0)&&n.children&&Array.isArray((r=g==null?void 0:g.detail)===null||r===void 0?void 0:r.children))for(let m=g.detail.children.length-1;m>=0;m--){const b=g.detail.children[m],y=ei(b,{groupQueue:p});if(y&&xo(e,{ctx:o,vertexes:y,viewScaleInfo:u,viewSizeInfo:f}))return i.type||(i.type="over-element"),i.groupQueue=p,i.elements=[b],i}return i}if(i.type!==null)return i;if(h&&Array.isArray(d)&&(d==null?void 0:d.length)>1){const{x:g,y:m,w:b,h:y}=h;if(e.x>=g&&e.x<=g+b&&e.y>=m&&e.y<=m+y)return i.type="list-area",i.elements=d,i}if(s){const{index:g,element:m}=c.getPointElement(e,{data:s,viewScaleInfo:u,viewSizeInfo:f});if(g>=0&&m&&((a=m==null?void 0:m.operations)===null||a===void 0?void 0:a.invisible)!==!0)return i.elements=[m],i.type="over-element",i}return i}function Op(e,t){var n,r,a,i,o,s,c,d,u;let{x:f,y:h,w:p,h:v,angle:g=0}=e;const m=vt({x:f,y:h,w:p,h:v,angle:g});g=ht(g);const b=Ft(g),y=!!(!((n=e==null?void 0:e.operations)===null||n===void 0)&&n.limitRatio),{start:S,end:x,resizeType:C,scale:E}=t;let j=Object.assign({},S),z=Object.assign({},x),k={x:j.x,y:m.y},F={x:z.x,y:m.y},U=Object.assign({},k),L=Object.assign({},F),O={x:m.x,y:j.y},$={x:m.x,y:z.y},R=Object.assign({},O),G=Object.assign({},$),N=(L.x-U.x)/E,D=(L.y-U.y)/E,w=ha(N,D),P=(G.x-R.x)/E,V=(G.y-R.y)/E,M=ha(P,V);(g>0||g<0)&&(j=je(m,S,0-b),z=je(m,x,0-b),k={x:j.x,y:m.y},F={x:z.x,y:m.y},U=je(m,k,b),L=je(m,F,b),O={x:m.x,y:j.y},$={x:m.x,y:z.y},R=je(m,O,b),G=je(m,$,b),N=(L.x-U.x)/E,D=(L.y-U.y)/E,w=ha(N,D),w=re(w,D),P=(G.x-R.x)/E,V=(G.y-R.y)/E,M=ha(P,V),M=re(M,V));let Y=(x.x-S.x)/E,H=(x.y-S.y)/E;if(y===!0){if(["resize-top","resize-bottom","resize-left","resize-right"].includes(C)){const _=Math.max(Math.abs(Y),Math.abs(H));Y=(Y>=0?1:-1)*_,H=(H>=0?1:-1)*_/e.w*e.h;const T=Math.max(Math.abs(P),Math.abs(V));P=(P>=0?1:-1)*T,V=(V>=0?1:-1)*T/e.w*e.h;const I=Math.max(Math.abs(N),Math.abs(D));N=(N>=0?1:-1)*I,D=(D>=0?1:-1)*I/e.w*e.h}else if(["resize-top-left","resize-top-right","resize-bottom-left","resize-bottom-right"].includes(C)){{const _=Math.abs(Y);Y=(Y>=0?1:-1)*_;const T=_/e.w*e.h;C==="resize-top-left"||C==="resize-bottom-right"?H=Y>0?T:-T:(C==="resize-top-right"||C==="resize-bottom-left")&&(H=Y>0?-T:T)}w=Math.abs(w),M=w/e.w*e.h}}switch(C){case"resize-top":{if(g===0)v-H>0&&(h+=H,v-=H,((r=e.operations)===null||r===void 0?void 0:r.limitRatio)===!0&&(f+=H/e.h*e.w/2,p-=H/e.h*e.w));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=0-re(M,V);const I=ce(g),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}else if(g<180){M=re(M,P);const I=ce(g-90),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}else if(g<270){M=re(M,V);const I=ce(g-180),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}else if(g<360){M=0-re(M,P);const I=ce(g-270),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I)}v+M>0&&(((a=e.operations)===null||a===void 0?void 0:a.limitRatio)===!0&&(p=p+M/e.h*e.w),v=v+M,f=_-p/2,h=T-v/2)}break}case"resize-bottom":{if(g===0)e.h+H>0&&(v+=H,((i=e.operations)===null||i===void 0?void 0:i.limitRatio)===!0&&(f-=H/e.h*e.w/2,p+=H/e.h*e.w));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=re(M,V);const I=ce(g),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}else if(g<180){M=0-re(M,P);const I=ce(g-90),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I)}else if(g<270){M=re(M,P);const I=ce(g-180),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}else if(g<360){M=re(M,P);const I=ce(g-270),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}v+M>0&&(((o=e.operations)===null||o===void 0?void 0:o.limitRatio)===!0&&(p=p+M/e.h*e.w),v=v+M,f=_-p/2,h=T-v/2)}break}case"resize-left":{if(g===0)e.w-Y>0&&(f+=Y,p-=Y,((s=e.operations)===null||s===void 0?void 0:s.limitRatio)===!0&&(v-=Y/e.w*e.h,h+=Y/e.w*e.h/2));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){w=0-re(w,N);const I=ce(g),B=w/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I)}else if(g<180){w=re(w,N);const I=ce(g-90),B=w/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}else if(g<270){w=re(w,D);const I=ce(g-180),B=w/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}else if(g<360){w=re(w,D);const I=ce(g-270),B=w/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}p+w>0&&(((c=e.operations)===null||c===void 0?void 0:c.limitRatio)===!0&&(v=v+w/e.w*e.h),p=p+w,f=_-p/2,h=T-v/2)}break}case"resize-right":{if(g===0)e.w+Y>0&&(p+=Y,((d=e.operations)===null||d===void 0?void 0:d.limitRatio)===!0&&(h-=Y*e.h/e.w/2,v+=Y*e.h/e.w));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){w=re(w,D);const I=ce(g),B=w/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}else if(g<180){w=re(w,H);const I=ce(g-90),B=w/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}else if(g<270){w=re(w,H);const I=ce(g-180),B=w/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I),w=0-w}else if(g<360){w=re(w,Y);const I=ce(g-270),B=w/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}p+w>0&&(((u=e.operations)===null||u===void 0?void 0:u.limitRatio)===!0&&(v=v+w/e.w*e.h),p=p+w,f=_-p/2,h=T-v/2)}break}case"resize-top-left":{if(g===0)p-Y>0&&(f+=Y,p-=Y),v-H>0&&(h+=H,v-=H);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=0-re(M,V),w=0-re(w,y?0-M:N);const I=M/2;_=_+I*Math.sin(b),T=T-I*Math.cos(b);const B=w/2;_=_-B*Math.cos(b),T=T-B*Math.sin(b)}else if(g<180){M=re(M,P),w=re(w,y?M:N);const I=ce(g-90),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}else if(g<270){M=re(M,V),w=re(w,y?M:D);const I=ce(g-180),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<360){M=0-re(M,P),w=re(w,y?M:D);const I=ce(g-270),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}case"resize-top-right":{if(g===0)p+Y>0&&(p+=Y),v-H>0&&(h+=H,v-=H);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=0-re(M,V),w=re(w,y?M:D);const I=ce(g),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<180){M=re(M,P),w=re(w,y?M:D);const I=ce(g-90),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}else if(g<270){const I=ce(g-180);M=re(M,V),w=re(w,y?M:0-N);const B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_-ee*Math.cos(I),T=T-ee*Math.sin(I)}else if(g<360){M=0-re(M,P),w=re(w,y?M:N);const I=ce(g-270),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}case"resize-bottom-left":{if(g===0)e.h+H>0&&(v+=H),e.w-Y>0&&(f+=Y,p-=Y);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=re(M,V),w=0-re(w,y?0-M:N);const I=ce(g),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_-ee*Math.cos(I),T=T-ee*Math.sin(I)}else if(g<180){M=0-re(M,P),w=re(w,y?M:N);const I=ce(g-90),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}else if(g<270){M=re(M,P),w=re(w,y?M:D);const I=ce(g-180),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<360){M=re(M,P),w=re(w,y?M:D);const I=ce(g-270),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}case"resize-bottom-right":{if(g===0)e.h+H>0&&(v+=H),e.w+Y>0&&(p+=Y);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=re(M,V),w=re(w,y?M:D);const I=ce(g),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<180){M=0-re(M,P),w=re(w,y?M:H);const I=ce(g-90),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}else if(g<270){M=re(M,P),w=re(w,y?M:0-D);const I=ce(g-180),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I);const ee=w/2;_=_-ee*Math.cos(I),T=T-ee*Math.sin(I)}else if(g<360){M=re(M,P),w=re(w,y?M:N);const I=ce(g-270),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}}return{x:f,y:h,w:p,h:v,angle:e.angle}}function Tp(e,t){const{x:n,y:r,w:a,h:i,angle:o=0}=e,{center:s,start:c,end:d,viewScaleInfo:u,viewSizeInfo:f}=t,h=Je(s,{viewScaleInfo:u,viewSizeInfo:f}),p=ht(o),v=Sh(h,c,d),g=p+Eh(v);return{x:n,y:r,w:a,h:i,angle:g}}function $p(e,t){var n;const r=[],a=[],i=[],{calculator:o,viewScaleInfo:s,viewSizeInfo:c,start:d,end:u}=t;if(!(Array.isArray(e.elements)&&d&&u))return{indexes:r,uuids:a,elements:i};const f=Math.min(d.x,u.x),h=Math.max(d.x,u.x),p=Math.min(d.y,u.y),v=Math.max(d.y,u.y);for(let g=0;g=f&&y.x<=h&&y.y>=p&&y.y<=v&&(r.push(g),a.push(m.uuid),i.push(m),b.angle&&(b.angle>0||b.angle<0))){const S=on(b);if(S.length===4){const x=[S[0].x,S[1].x,S[2].x,S[3].x],C=[S[0].y,S[1].y,S[2].y,S[3].y];b.x=Math.min(...x),b.y=Math.min(...C),b.w=Math.abs(Math.max(...x)-Math.min(...x)),b.h=Math.abs(Math.max(...C)-Math.min(...C))}}}return{indexes:r,uuids:a,elements:i}}function Zi(e,t){var n;if(!Array.isArray(e))return null;const r={x:0,y:0,w:0,h:0},{calculator:a,viewScaleInfo:i,viewSizeInfo:o}=t;let s=null;for(let c=0;c0||u.angle<0)){const f=on(u);if(f.length===4){const h=[f[0].x,f[1].x,f[2].x,f[3].x],p=[f[0].y,f[1].y,f[2].y,f[3].y];u.x=Math.min(...h),u.y=Math.min(...p),u.w=Math.abs(Math.max(...h)-Math.min(...h)),u.h=Math.abs(Math.max(...p)-Math.min(...p))}}if(s){const f=Math.min(u.x,r.x),h=Math.min(u.y,r.y),p=Math.max(u.x+u.w,r.x+r.w),v=Math.max(u.y+u.h,r.y+r.h);r.x=f,r.y=h,r.w=Math.abs(p-f),r.h=Math.abs(v-h)}else r.x=u.x,r.y=u.y,r.w=u.w,r.h=u.h;s=u}return r}function Pp(e,t){var n;if((t==null?void 0:t.type)==="group"&&Array.isArray((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.children))for(let r=0;r{const{x:s,y:c,w:d,h:u,angle:f=0}=o;i.push({x:s,y:c,w:d,h:u,angle:0-f})}),(n==null?void 0:n.length)>0){const o=qa(e,i),s=qa(t,i);r=s.x-o.x,a=s.y-o.y}return{moveX:r,moveY:a}}const ai="@middleware/text-edit",Eo="@middleware/text-change",zp=sn(),So=e=>{const{eventHub:t,boardContent:n,viewer:r}=e,a=n.boardContext.canvas,i=document.createElement("div");i.setAttribute("contenteditable","true");const o=document.createElement("div"),s=e.container||document.body,c=document.createElement("div");let d=null,u=[];o.appendChild(i),o.style.position="absolute",c.appendChild(o),c.style.position="fixed",c.style.top="0",c.style.bottom="0",c.style.left="0",c.style.right="0",c.style.display="none",s.appendChild(c);const f=y=>{m(),g(y),c.style.display="block"},h=()=>{c.style.display="none",d=null,u=[]},p=()=>{const y=a.getBoundingClientRect(),{left:S,top:x,width:C,height:E}=y;return{left:S,top:x,width:C,height:E}},v=y=>{const{size:S,parent:x}=y,C=document.createElement("div"),{x:E,y:j,w:z,h:k}=S,F=ht(S.angle||0);return C.style.position="absolute",C.style.left=`${E}px`,C.style.top=`${j}px`,C.style.width=`${z}px`,C.style.height=`${k}px`,C.style.transform=`rotate(${F}deg)`,x.appendChild(C),C},g=y=>{const{viewScaleInfo:S,element:x,groupQueue:C}=y,{scale:E,offsetTop:j,offsetLeft:z}=S;o.children&&Array.from(o.children).forEach(N=>{N.remove()});let k=o;for(let N=0;N0&&(U=x.x*E,L=x.y*E,O=x.w*E,$=x.h*E);let R="center",G="center";F.textAlign==="left"?R="start":F.textAlign==="right"&&(R="end"),F.verticalAlign==="top"?G="start":F.verticalAlign==="bottom"&&(G="end"),i.style.display="inline-flex",i.style.justifyContent=R,i.style.alignItems=G,i.style.position="absolute",i.style.left=`${U-1}px`,i.style.top=`${L-1}px`,i.style.width=`${O+2}px`,i.style.height=`${$+2}px`,i.style.transform=`rotate(${ht(x.angle||0)}deg)`,i.style.boxSizing="border-box",i.style.border="1px solid #1973ba",i.style.resize="none",i.style.overflow="hidden",i.style.wordBreak="break-all",i.style.background="#FFFFFF",i.style.color="#333333",i.style.fontSize=`${F.fontSize*E}px`,i.style.lineHeight=`${F.lineHeight*E}px`,i.style.fontFamily=F.fontFamily,i.style.fontWeight=`${F.fontWeight}`,i.style.padding="0",i.style.margin="0",i.style.outline="none",i.innerText=F.text||"",k.appendChild(i)},m=()=>{const{left:y,top:S,width:x,height:C}=p();o.style.position="absolute",o.style.overflow="hidden",o.style.top=`${S}px`,o.style.left=`${y}px`,o.style.width=`${x}px`,o.style.height=`${C}px`};c.addEventListener("click",()=>{h()}),i.addEventListener("click",y=>{y.stopPropagation()}),i.addEventListener("input",()=>{d&&u&&(d.detail.text=i.innerText||"",t.trigger(Eo,{element:{uuid:d.uuid,detail:{text:d.detail.text}},position:[...u||[]]}),r.drawFrame())}),i.addEventListener("blur",()=>{d&&u&&t.trigger(Eo,{element:{uuid:d.uuid,detail:{text:d.detail.text}},position:[...u]}),h()});const b=y=>{var S;y!=null&&y.position&&(y!=null&&y.element)&&((S=y==null?void 0:y.element)===null||S===void 0?void 0:S.type)==="text"&&(d=y.element,u=y.position),f(y)};return{name:"@middleware/text-editor",use(){t.on(ai,b)},disuse(){t.off(ai,b)}}},Ha="@middleware/select",Co="@middleware/select-clear",Mo=e=>{const{viewer:t,sharer:n,boardContent:r,calculator:a,eventHub:i}=e,{helperContext:o}=r;let s=null,c=null;n.setSharedStorage(Ce,null);const d=()=>n.getSharedStorage(xr),u=b=>{let y=n.getSharedStorage(Fe);Array.isArray(y)||(y=[]),y.length>0?Pp(b,y[y.length-1])?y.push(b):y=[]:y.length===0&&y.push(b);const S=Jo(y);return n.setSharedStorage(Fe,y),n.setSharedStorage(Xi,S),y.length>0},f=b=>{n.setSharedStorage(wr,b);let y=null;b&&(y=ei(b,{groupQueue:n.getSharedStorage(Fe)})),n.setSharedStorage(Yi,y)},h=(b,y)=>{if(n.setSharedStorage(xr,b),b.length===1){const S=la(b[0],{groupQueue:n.getSharedStorage(Fe),controllerSize:bu,viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(mn,S)}else n.setSharedStorage(mn,null);(y==null?void 0:y.triggerEvent)===!0&&i.trigger(Ha,{uuids:b.map(S=>S.uuid)})},p=()=>({ctx:o,calculator:a,data:n.getActiveStorage("data"),selectedElements:d(),viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Fe),areaSize:null,selectedElementController:n.getSharedStorage(mn)}),v=()=>{n.setSharedStorage(Ce,null),n.setSharedStorage(Vt,null),n.setSharedStorage(da,null),n.setSharedStorage(ua,null),n.setSharedStorage(Fe,[]),n.setSharedStorage(Xi,[]),n.setSharedStorage(wr,null),n.setSharedStorage(Yi,null),n.setSharedStorage(xr,[]),n.setSharedStorage(xp,null),n.setSharedStorage(mn,null),n.setSharedStorage(fa,null)};v();const g=({uuids:b,positions:y})=>{let S=[];const x=n.getSharedStorage(Ce),C=n.getActiveStorage("data");y&&Array.isArray(y)?S=Vd(y,(C==null?void 0:C.elements)||[]):S=Aa(b,(C==null?void 0:C.elements)||[]);let E=!1;if(!x&&S.length===1?(n.setSharedStorage(Ce,"select"),E=!0):x==="select"&&S.length===1&&(E=!0),E){const j=S[0],z=Gd(j.uuid,(C==null?void 0:C.elements)||[]);n.setSharedStorage(Fe,z),h(S),t.drawFrame()}},m=()=>{v(),t.drawFrame()};return{name:"@middleware/selector",use(){i.on(Ha,g),i.on(Co,m)},disuse(){i.off(Ha,g),i.off(Co,m)},hover:b=>{var y,S,x,C,E;const j=n.getSharedStorage(Vt),z=n.getSharedStorage(Ce),k=n.getSharedStorage(Fe),F=R=>{const G=R.type;c===null&&i.trigger("cursor",{type:G,groupQueue:R.groupQueue,element:R.elements[0]})};if((k==null?void 0:k.length)>0){if(!$l(b.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Fe)})){f(null),t.drawFrame();return}const G=Er(b.point,p());if(F(G),j||["area","drag","drag-list"].includes(z)){f(null),t.drawFrame();return}if(((y=G==null?void 0:G.elements)===null||y===void 0?void 0:y.length)===1){f(G.elements[0]),t.drawFrame();return}f(null),t.drawFrame();return}if(j||["area","drag","drag-list"].includes(z)){f(null);return}if(z==="drag"){f(null);return}const U=d(),L=n.getActiveViewScaleInfo(),O=n.getActiveViewSizeInfo(),$=Er(b.point,Object.assign(Object.assign({},p()),{areaSize:Zi(U,{viewScaleInfo:L,viewSizeInfo:O,calculator:a})}));if(F($),$.type!==null&&!($.type==="over-element"&&n.getSharedStorage(Ce)==="select"&&$.elements.length===1&&$.elements[0].uuid===((x=(S=d())===null||S===void 0?void 0:S[0])===null||x===void 0?void 0:x.uuid))&&!($.type==="over-element"&&n.getSharedStorage(Ce)===null&&$.elements.length===1&&$.elements[0].uuid===((C=n.getSharedStorage(wr))===null||C===void 0?void 0:C.uuid))){if($.type==="over-element"&&((E=$==null?void 0:$.elements)===null||E===void 0?void 0:E.length)===1){f($.elements[0]),t.drawFrame();return}if(n.getSharedStorage(wr)){f(null),t.drawFrame();return}}},pointStart:b=>{var y,S,x,C,E,j,z,k,F,U;s=b.point;const L=n.getSharedStorage(Fe);if((L==null?void 0:L.length)>0){if($l(b.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:L})){const R=Er(b.point,p());if(((y=R==null?void 0:R.elements)===null||y===void 0?void 0:y.length)===1&&((x=(S=R.elements[0])===null||S===void 0?void 0:S.operations)===null||x===void 0?void 0:x.lock)===!0)return;f(null),R.type==="over-element"&&((C=R==null?void 0:R.elements)===null||C===void 0?void 0:C.length)===1?(h([R.elements[0]],{triggerEvent:!0}),n.setSharedStorage(Ce,"drag")):!((E=R.type)===null||E===void 0)&&E.startsWith("resize-")?(n.setSharedStorage(Vt,R.type),n.setSharedStorage(Ce,"resize")):h([],{triggerEvent:!0})}else v();t.drawFrame();return}const O=Zi(d(),{viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),calculator:a}),$=Er(b.point,Object.assign(Object.assign({},p()),{areaSize:O,groupQueue:[]}));((j=$==null?void 0:$.elements)===null||j===void 0?void 0:j.length)===1&&((k=(z=$.elements[0])===null||z===void 0?void 0:z.operations)===null||k===void 0?void 0:k.lock)===!0||(f(null),$.type==="list-area"?n.setSharedStorage(Ce,"drag-list"):$.type==="over-element"&&((F=$==null?void 0:$.elements)===null||F===void 0?void 0:F.length)===1?(h([$.elements[0]],{triggerEvent:!0}),n.setSharedStorage(Ce,"drag")):!((U=$.type)===null||U===void 0)&&U.startsWith("resize-")?(n.setSharedStorage(Vt,$.type),n.setSharedStorage(Ce,"resize")):(v(),n.setSharedStorage(Ce,"area"),n.setSharedStorage(da,b.point),h([],{triggerEvent:!0})),t.drawFrame())},pointMove:b=>{var y,S,x;n.setSharedStorage(fa,!0);const C=n.getActiveStorage("data"),E=d(),j=n.getActiveStorage("scale")||1,z=n.getActiveViewScaleInfo(),k=n.getActiveViewSizeInfo(),F=s,U=b.point,L=n.getSharedStorage(Vt),O=n.getSharedStorage(Ce),$=n.getSharedStorage(Fe);if(O==="drag"){if(c="drag",C&&(E==null?void 0:E.length)===1&&F&&U&&((S=(y=E[0])===null||y===void 0?void 0:y.operations)===null||S===void 0?void 0:S.lock)!==!0){const{moveX:R,moveY:G}=Ip(F,U,$);E[0].x+=R/j,E[0].y+=G/j,h([E[0]])}t.drawFrame()}else if(O==="drag-list"){if(c="drag-list",C&&F&&U&&(E==null?void 0:E.length)>1){const R=(U.x-F.x)/j,G=(U.y-F.y)/j;E.forEach(N=>{var D;N&&((D=N==null?void 0:N.operations)===null||D===void 0?void 0:D.lock)!==!0&&(N.x+=R,N.y+=G)}),n.setActiveStorage("data",C)}t.drawFrame()}else if(O==="resize"){if(C&&(E==null?void 0:E.length)===1&&F&&(L!=null&&L.startsWith("resize-"))){c="resize";const R=[];$.forEach(D=>{const{x:w,y:P,w:V,h:M,angle:Y=0}=D;R.push({x:w,y:P,w:V,h:M,angle:0-Y})});let G=F,N=U;if($.length>0&&(G=qa(F,R),N=qa(U,R)),L==="resize-rotate"){const D=n.getSharedStorage(mn),w=[D.topLeft.center,D.topRight.center,D.bottomLeft.center,D.bottomRight.center],P=kd(w),V=Tp(E[0],{center:P,viewScaleInfo:z,viewSizeInfo:k,start:F,end:U,resizeType:L,sharer:n});E[0].angle=V.angle}else{const D=Op(E[0],{scale:j,start:G,end:N,resizeType:L,sharer:n});E[0].x=D.x,E[0].y=D.y,E[0].type==="group"&&((x=E[0].operations)===null||x===void 0?void 0:x.deepResize)===!0?Kd(E[0],{w:D.w,h:D.h}):(E[0].w=D.w,E[0].h=D.h)}h([E[0]]),t.drawFrame()}}else O==="area"&&(c="area",n.setSharedStorage(ua,b.point),t.drawFrame());s=b.point},pointEnd(b){c=null,n.setSharedStorage(fa,!1);const y=n.getActiveStorage("data"),S=n.getSharedStorage(Vt),x=n.getSharedStorage(Ce),C=n.getActiveViewSizeInfo();let E=!1;if(s=null,x==="resize"&&S)n.setSharedStorage(Vt,null),E=!0;else if(x==="area"){if(n.setSharedStorage(Ce,null),y){const z=n.getSharedStorage(da),k=n.getSharedStorage(ua);if(z&&k){const{elements:F}=$p(y,{start:z,end:k,calculator:a,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()});F.length>0&&(n.setSharedStorage(Ce,"drag-list"),h(F,{triggerEvent:!0}),E=!0)}}}else x==="drag-list"?(n.setSharedStorage(Ce,"drag-list-end"),E=!0):y&&(a.getPointElement(b.point,{data:y,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()}).element?(n.setSharedStorage(Ce,"select"),E=!0):n.setSharedStorage(Ce,null));n.getSharedStorage(Ce)===null&&(v(),E=!0),(()=>{if(E){if(y&&Array.isArray(y==null?void 0:y.elements)&&["drag","drag-list"].includes(x)){const z=Mh(y.elements,C,{extend:!0});n.setActiveStorage("contextHeight",z.contextSize.contextHeight),n.setActiveStorage("contextWidth",z.contextSize.contextWidth)}y&&["drag","drag-list","drag-list-end","resize"].includes(x)&&i.trigger("change",{data:y,type:"dragElement"}),t.drawFrame()}})()},pointLeave(){s=null,v(),t.drawFrame()},doubleClick(b){var y,S,x,C,E,j;const z=Er(b.point,p());if(n.setSharedStorage(mn,null),n.setSharedStorage(xr,[]),!(z.elements.length===1&&((S=(y=z.elements[0])===null||y===void 0?void 0:y.operations)===null||S===void 0?void 0:S.lock)===!0)){if(z.elements.length===1&&((x=z.elements[0])===null||x===void 0?void 0:x.type)==="group"){if(u(z.elements[0])===!0){n.setSharedStorage(Ce,null),t.drawFrame();return}}else z.elements.length===1&&((C=z.elements[0])===null||C===void 0?void 0:C.type)==="text"&&i.trigger(ai,{element:z.elements[0],groupQueue:n.getSharedStorage(Fe)||[],position:tn((E=z.elements[0])===null||E===void 0?void 0:E.uuid,((j=n.getActiveStorage("data"))===null||j===void 0?void 0:j.elements)||[]),viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(Ce,null)}},beforeDrawFrame({snapshot:b}){var y;const{activeStore:S,sharedStore:x}=b,{scale:C,offsetLeft:E,offsetTop:j,offsetRight:z,offsetBottom:k,width:F,height:U,contextHeight:L,contextWidth:O,devicePixelRatio:$}=S,R=e.sharer,G={scale:C,offsetLeft:E,offsetTop:j,offsetRight:z,offsetBottom:k},N={width:F,height:U,contextHeight:L,contextWidth:O,devicePixelRatio:$},w=x[xr][0],P=x[wr],V=x[Yi],M=x[Ce],Y=x[da],H=x[ua],_=x[Fe],T=x[Xi],I=x[fa],B={calculator:a,viewScaleInfo:G,viewSizeInfo:N},ee=w?la(w,{groupQueue:_,controllerSize:10,viewScaleInfo:G}):null,ut=!!(!((y=P==null?void 0:P.operations)===null||y===void 0)&&y.lock);if((_==null?void 0:_.length)>0)_p(o,T,B),P&&M!=="drag"&&(ut?Ol(o,V,Object.assign(Object.assign({},B),{controller:la(P,{groupQueue:_,controllerSize:10,viewScaleInfo:G})})):_l(o,V,B)),!ut&&w&&["select","drag","resize"].includes(M)&&Tl(o,ee,Object.assign(Object.assign({},B),{element:w,groupQueue:_,hideControllers:!!I&&M==="drag"}));else if(P&&M!=="drag"&&(ut?Ol(o,V,Object.assign(Object.assign({},B),{controller:la(P,{groupQueue:_,controllerSize:10,viewScaleInfo:G})})):_l(o,V,B)),!ut&&w&&["select","drag","resize"].includes(M))Tl(o,ee,Object.assign(Object.assign({},B),{element:w,groupQueue:_,hideControllers:!!I&&M==="drag"}));else if(M==="area"&&Y&&H)Mp(o,{start:Y,end:H});else if(["drag-list","drag-list-end"].includes(M)){const It=Zi(d(),{viewScaleInfo:R.getActiveViewScaleInfo(),viewSizeInfo:R.getActiveViewSizeInfo(),calculator:a});It&&Ap(o,{areaSize:It})}}}},Ur="SCROLL",Wa=Symbol(`${Ur}_xThumbRect`),Ga=Symbol(`${Ur}_yThumbRect`),Tn=Symbol(`${Ur}_prevPoint`),Ao=Symbol(`${Ur}_activePoint`),Ir=Symbol(`${Ur}_activeThumbType`),Rp=12,Pl=16,Dp=.36,Il={width:Rp,thumbColor:"#000000AA",scrollBarColor:"#FFFFFF60",showScrollBar:!1};function zl(e,t,n){const r=e,{x:a,y:i,w:o,h:s}=n;return r.beginPath(),r.rect(a,i,o,s),r.closePath(),!!r.isPointInPath(t.x,t.y)}function Np(e,t,n){let r=null;const{xThumbRect:a,yThumbRect:i}=n;return a&&zl(e,t,a)?r="X":i&&zl(e,t,i)&&(r="Y"),r}function jp(e){const{sharedStore:t}=e;return{activePoint:t[Ao]||null,prevPoint:t[Tn]||null,activeThumbType:t[Ir]||null,xThumbRect:t[Wa]||null,yThumbRect:t[Ga]||null}}function Lp(e,t){const{width:n,height:r}=t,{offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s}=e,c=Pl*2.5,d=Pl;let u=0,f=0;u=Math.max(c,n-d*2-(Math.abs(o)+Math.abs(s))),u>=n&&(u=n),f=Math.max(c,r-d*2-(Math.abs(a)+Math.abs(i))),f>=r&&(f=r);const h=d,p=n-u-d;let v=h;o>0?v=h:s>0?v=p:o<=0&&u>0&&!(o===0&&s===0)&&(v=h+(n-u)*Math.abs(o)/(Math.abs(o)+Math.abs(s)),v=Math.min(Math.max(0,v-h),n-u));const g=d,m=r-f-d;let b=g;a>0?b=g:i>0?b=m:a<=0&&f>0&&!(a===0&&i===0)&&(b=g+(r-f)*Math.abs(a)/(Math.abs(a)+Math.abs(i)),b=Math.min(Math.max(0,b-g),r-f));const y={x:v,y:r-d,w:u,h:d},S={x:n-d,y:b,w:d,h:f};return{lineSize:d,xSize:u,ySize:f,translateY:b,translateX:v,thumbColor:Il.thumbColor,scrollBarColor:Il.scrollBarColor,xThumbRect:y,yThumbRect:S}}function Rl(e,t){let{x:n,y:r,h:a,w:i}=t;e.save(),e.shadowColor="#FFFFFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=1;{const{color:o,axis:s}=t;s==="X"?(r=r+a/4+0,a=a/2):s==="Y"&&(n=n+i/4+0,i=i/2);let c=t.r;c=Math.min(c,i/2,a/2),(i{const{viewer:t,boardContent:n,sharer:r}=e,{helperContext:a}=n;r.setSharedStorage(Wa,null),r.setSharedStorage(Ga,null);const i=()=>{r.setSharedStorage(Tn,null),r.setSharedStorage(Ao,null),r.setSharedStorage(Ir,null)};i();const o=d=>{const u=r.getSharedStorage(Tn);if(u){const{offsetLeft:f,offsetRight:h}=r.getActiveViewScaleInfo(),{width:p}=r.getActiveViewSizeInfo(),v=-(d.x-u.x),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveX:m}),t.drawFrame()}},s=d=>{const u=r.getSharedStorage(Tn);if(u){const{offsetTop:f,offsetBottom:h}=r.getActiveViewScaleInfo(),{height:p}=r.getActiveViewSizeInfo(),v=-(d.y-u.y),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveY:m}),t.drawFrame()}},c=d=>Np(a,d,{xThumbRect:r.getSharedStorage(Wa),yThumbRect:r.getSharedStorage(Ga)});return{name:"@middleware/scroller",wheel:d=>{t.scroll({moveX:0-d.deltaX,moveY:0-d.deltaY}),t.drawFrame()},pointStart:d=>{const{point:u}=d,f=c(u);if(f==="X"||f==="Y")return r.setSharedStorage(Ir,f),r.setSharedStorage(Tn,u),!1},pointMove:d=>{const{point:u}=d,f=r.getSharedStorage(Ir);if(f==="X"||f==="Y")return r.setSharedStorage(Ao,u),f==="X"?o(u):f==="Y"&&s(u),r.setSharedStorage(Tn,u),!1},pointEnd:()=>{const d=r.getSharedStorage(Ir);if(i(),d==="X"||d==="Y")return t.scroll({moveX:0,moveY:0}),t.drawFrame(),!1},beforeDrawFrame({snapshot:d}){const{xThumbRect:u,yThumbRect:f}=Bp(a,{snapshot:d});r.setSharedStorage(Wa,u),r.setSharedStorage(Ga,f)}}},yu="@middleware/scale",Oo=e=>{const{viewer:t,sharer:n,eventHub:r}=e,a=50,i=.05;return{name:"@middleware/scaler",wheelScale(o){const{deltaY:s,point:c}=o,{scale:d}=n.getActiveViewScaleInfo();let u=d;if(s<0?u=d*1.1:s>0&&(u=d*.9),ua)return;const{moveX:f,moveY:h}=t.scale({scale:u,point:c});t.scroll({moveX:f,moveY:h}),t.drawFrame();const p=$e(d);r.trigger(yu,{scale:p})}}},Ne=16,Fp="#FFFFFFA8",Hp="#00000080",wu="#000000",xu="#00000080",Eu="monospace",To=10,Su=100,Dl="#AAAAAA20",Nl="#AAAAAA40",wi=1;function Cu(e){const{scale:t,viewLength:n,viewOffset:r}=e,a=[];let i=10;i=$e(i/t,{decimalPlaces:0}),i=Math.max(10,Math.min(i,1e3));const o=i*10,s=i*5;let c=0;const d=i*t,u=0-r,f=0,h=u%d,p=(u-h+d)/t,v=f+(d-h);for(;v+c*d{e.fillStyle=xu,e.textBaseline="top",e.$setFont({fontWeight:Su,fontSize:To,fontFamily:Eu}),e.fillText(h,s+To,d.position+s)})}}}function Yp(e,t){const{viewSizeInfo:n}=t,{width:r,height:a}=n;e.beginPath(),e.moveTo(0,0),e.lineTo(r+1,0),e.lineTo(r+1,Ne),e.lineTo(Ne,Ne),e.lineTo(Ne,a+1),e.lineTo(0,a+1),e.lineTo(0,0),e.closePath(),e.fillStyle=Fp,e.fill(),e.lineWidth=wi,e.setLineDash([]),e.strokeStyle=Hp,e.stroke()}function Xp(e,t){const{xList:n,yList:r,viewSizeInfo:a}=t,{width:i,height:o}=a;for(let s=0;s{const{boardContent:t,viewer:n,eventHub:r}=e,{helperContext:a,underContext:i}=t;let o=!0,s=!0;const c=d=>{typeof(d==null?void 0:d.show)=="boolean"&&(o=d.show),typeof(d==null?void 0:d.showGrid)=="boolean"&&(s=d.showGrid),(typeof(d==null?void 0:d.show)=="boolean"||typeof(d==null?void 0:d.showGrid)=="boolean")&&n.drawFrame()};return{name:"@middleware/ruler",use(){r.on($o,c)},disuse(){r.off($o,c)},beforeDrawFrame:({snapshot:d})=>{if(o===!0){const u=Nd(d),f=jd(d);Yp(a,{viewScaleInfo:u,viewSizeInfo:f});const h=Wp({viewScaleInfo:u,viewSizeInfo:f});Vp(a,{scaleList:h});const p=Gp({viewScaleInfo:u,viewSizeInfo:f});Up(a,{scaleList:p}),s===!0&&Xp(i,{xList:h,yList:p,viewScaleInfo:u,viewSizeInfo:f})}}}},Zp="DRAG",pa=Symbol(`${Zp}_prevPoint`),Io=e=>{const{eventHub:t,sharer:n,viewer:r}=e;let a=!1;return{name:"@middleware/dragger",hover(){a!==!0&&t.trigger("cursor",{type:"drag-default"})},pointStart(i){const{point:o}=i;n.setSharedStorage(pa,o),a=!0,t.trigger("cursor",{type:"drag-active"})},pointMove(i){const{point:o}=i,s=n.getSharedStorage(pa);if(o&&s){const c=o.x-s.x,d=o.y-s.y;r.scroll({moveX:c,moveY:d}),r.drawFrame()}n.setSharedStorage(pa,o)},pointEnd(){a=!1,n.setSharedStorage(pa,null),t.trigger("cursor",{type:"drag-default"})}}};var Ki=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},_e=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},zo,Oe,Va,ii,Mu;class Kp{constructor(t,n){zo.add(this),Oe.set(this,void 0),Va.set(this,void 0),ii.set(this,void 0);const{devicePixelRatio:r=1,width:a,height:i,createCustomContext2D:o}=n;Ki(this,ii,t,"f");const s=document.createElement("canvas");Ki(this,Va,s,"f"),_e(this,zo,"m",Mu).call(this),t.appendChild(s);const c=yh(s,{width:a,height:i,devicePixelRatio:r,offscreen:!0,createCustomContext2D:o}),d=new gp({boardContent:c,container:t}),u=d.getSharer();u.setActiveViewSizeInfo({width:a,height:i,devicePixelRatio:r,contextWidth:a,contextHeight:i}),Ki(this,Oe,d,"f"),this.resize(u.getActiveViewSizeInfo());const f=d.getEventHub();new wp(t,{eventHub:f})}isDestroyed(){return _e(this,Oe,"f").isDestroyed()}destroy(){_e(this,Oe,"f").destroy(),_e(this,Va,"f").remove()}use(t){_e(this,Oe,"f").use(t)}disuse(t){_e(this,Oe,"f").disuse(t)}setData(t){Fd((t==null?void 0:t.elements)||[]),_e(this,Oe,"f").setData(t)}getData(){return _e(this,Oe,"f").getData()}scale(t){_e(this,Oe,"f").scale(t),_e(this,Oe,"f").getViewer().drawFrame()}resize(t){const n=_e(this,Oe,"f"),a=n.getSharer().getActiveViewSizeInfo();n.resize(Object.assign(Object.assign({},a),t))}clear(){_e(this,Oe,"f").clear()}on(t,n){_e(this,Oe,"f").getEventHub().on(t,n)}off(t,n){_e(this,Oe,"f").getEventHub().off(t,n)}trigger(t,n){_e(this,Oe,"f").getEventHub().trigger(t,n)}getViewInfo(){const n=_e(this,Oe,"f").getSharer(),r=n.getActiveViewSizeInfo(),a=n.getActiveViewScaleInfo();return{viewSizeInfo:r,viewScaleInfo:a}}refresh(){_e(this,Oe,"f").getViewer().drawFrame()}setViewScale(t){_e(this,Oe,"f").updateViewScaleInfo(t)}getLoadItemMap(){return _e(this,Oe,"f").getRenderer().getLoadItemMap()}onBoardWatcherEvents(){_e(this,Oe,"f").onWatcherEvents()}offBoardWatcherEvents(){_e(this,Oe,"f").offWatcherEvents()}}Oe=new WeakMap,Va=new WeakMap,ii=new WeakMap,zo=new WeakSet,Mu=function(){const t=_e(this,ii,"f");t.style.position="relative"};const Qp={enableScroll:!0,enableSelect:!0,enableScale:!0,enableRuler:!0,enableTextEdit:!0,enableDrag:!1};var Jp=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function qp(e){return Jp(this,void 0,void 0,function*(){const{data:t,width:n,height:r,devicePixelRatio:a,viewScaleInfo:i,viewSizeInfo:o,loadItemMap:s}=e;let c=Ca({width:n,height:r,devicePixelRatio:a}),d=new iu({viewContext:c}),u=new au({viewContext:c,calculator:d});u.setLoadItemMap(s),u.drawData(t,{viewScaleInfo:i,viewSizeInfo:o,forceDrawAll:!0});let f=null,h=c.$getOffscreenCanvas();if(h){const p=yield h.convertToBlob();f=window.URL.createObjectURL(p)}return h=null,c=null,d=null,u=null,{blobURL:f,width:n,height:r,devicePixelRatio:a}})}const e3="change",jl={change:e3,ruler:$o,scale:yu,select:Ha,clearSelect:Co,textEdit:ai,textChange:Eo},Se={};Object.keys(jl).forEach(e=>{Object.defineProperty(Se,e,{value:jl[e],writable:!1})});var t3=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},Qi=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},me=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Ro,be,qn,Au;class n3{constructor(t,n){Ro.add(this),be.set(this,void 0),qn.set(this,void 0);const r=Object.assign(Object.assign({},Qp),n),{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s}=r,c=new Kp(t,{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s});Qi(this,be,c,"f"),Qi(this,qn,r,"f"),me(this,Ro,"m",Au).call(this)}reset(t){const n=me(this,be,"f"),{enableRuler:r,enableScale:a,enableScroll:i,enableSelect:o,enableTextEdit:s,enableDrag:c}=t;i===!0?n.use(_o):i===!1&&n.disuse(_o),o===!0?n.use(Mo):o===!1&&n.disuse(Mo),a===!0?n.use(Oo):a===!1&&n.disuse(Oo),r===!0?n.use(Po):r===!1&&n.disuse(Po),s===!0?n.use(So):s===!1&&n.disuse(So),c===!0?n.use(Io):c===!1&&n.disuse(Io),n.refresh(),Qi(this,qn,Object.assign(Object.assign({},me(this,qn,"f")),t),"f")}setData(t){const n=me(this,be,"f");n.setData(t),n.trigger(Se.change,{data:t,type:"setData"})}getData(t){const n=me(this,be,"f").getData();return n&&(t==null?void 0:t.compact)===!0?Vf(n,{loadItemMap:me(this,be,"f").getLoadItemMap()}):n}getViewInfo(){return me(this,be,"f").getViewInfo()}scale(t){me(this,be,"f").scale(t)}setViewScale(t){const n=me(this,be,"f");n.setViewScale(t),n.refresh()}centerContent(t){const n=(t==null?void 0:t.data)||me(this,be,"f").getData(),{viewSizeInfo:r}=this.getViewInfo();if(Array.isArray(n==null?void 0:n.elements)&&(n==null?void 0:n.elements.length)>0){const a=Uh(n,{viewSizeInfo:r});this.setViewScale(a)}}resize(t){me(this,be,"f").resize(t)}on(t,n){me(this,be,"f").on(t,n)}off(t,n){me(this,be,"f").off(t,n)}trigger(t,n){me(this,be,"f").trigger(t,n)}selectElement(t){this.selectElements([t])}selectElements(t){this.trigger(Se.select,{uuids:t})}selectElementByPosition(t){this.selectElementsByPositions([t])}selectElementsByPositions(t){this.trigger(Se.select,{positions:t})}cancelElements(){this.trigger(Se.select,{uuids:[]})}createElement(t,n){const{viewScaleInfo:r,viewSizeInfo:a}=me(this,be,"f").getViewInfo();return Wh(t,(n==null?void 0:n.element)||{},(n==null?void 0:n.viewCenter)===!0?{viewScaleInfo:r,viewSizeInfo:a}:void 0)}updateElement(t){const n=me(this,be,"f"),r=n.getData()||{elements:[]};Hr(t.uuid,t,r.elements),n.setData(r),n.refresh(),n.trigger(Se.change,{data:r,type:"updateElement"})}addElement(t,n){var r;const a=me(this,be,"f"),i=a.getData()||{elements:[]};if(!n||!(!((r=n==null?void 0:n.position)===null||r===void 0)&&r.length))i.elements.push(t);else if(n!=null&&n.position){const o=[...n==null?void 0:n.position];Qd(t,o,i.elements)}return a.setData(i),a.refresh(),a.trigger(Se.change,{data:i,type:"addElement"}),i}deleteElement(t){const n=me(this,be,"f"),r=n.getData()||{elements:[]};Gh(t,r.elements),n.setData(r),n.refresh(),n.trigger(Se.change,{data:r,type:"deleteElement"})}moveElement(t,n){const r=me(this,be,"f"),a=r.getData()||{elements:[]},i=tn(t,a.elements),{elements:o}=qd(a.elements,{from:i,to:n});a.elements=o,r.setData(a),r.refresh(),r.trigger(Se.change,{data:a,type:"moveElement"})}getImageBlobURL(t){return t3(this,void 0,void 0,function*(){const n=this.getData()||{elements:[]},{devicePixelRatio:r}=t,a=Ch(n.elements),{viewSizeInfo:i}=this.getViewInfo();return yield qp({width:a.w,height:a.h,devicePixelRatio:r,data:n,viewScaleInfo:{scale:1,offsetLeft:-a.x,offsetTop:-a.y,offsetBottom:0,offsetRight:0},viewSizeInfo:Object.assign(Object.assign({},i),{devicePixelRatio:r}),loadItemMap:me(this,be,"f").getLoadItemMap()})})}isDestroyed(){return me(this,be,"f").isDestroyed()}destroy(){me(this,be,"f").destroy()}getViewCenter(){const{viewScaleInfo:t,viewSizeInfo:n}=this.getViewInfo();return Yh({viewScaleInfo:t,viewSizeInfo:n})}$onBoardWatcherEvents(){me(this,be,"f").onBoardWatcherEvents()}$offBoardWatcherEvents(){me(this,be,"f").offBoardWatcherEvents()}}be=new WeakMap,qn=new WeakMap,Ro=new WeakSet,Au=function(){const{enableRuler:t,enableScale:n,enableScroll:r,enableSelect:a,enableTextEdit:i,enableDrag:o}=me(this,qn,"f"),s=me(this,be,"f");r===!0&&s.use(_o),a===!0&&s.use(Mo),n===!0&&s.use(Oo),t===!0&&s.use(Po),i===!0&&s.use(So),o===!0&&s.use(Io)};const r3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}),l.createElement("path",{d:"M921 867L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}))),a3="base-scale-selector",i3=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=A.useContext(le),s=o(a3),c=s("menu-item"),d=s("input"),[u,f]=A.useState(100);A.useEffect(()=>{const m=$e(parseFloat(a||"1")*100);f(m)},[a]);const h=m=>{const{key:b}=m;i==null||i(b)},p=m=>{m.stopPropagation()},g={items:[{label:l.createElement("span",{className:c},l.createElement(se,{className:d,size:"small",value:u,suffix:"%",onClick:p,step:1,min:10,max:1e4,controls:!1,onChange:m=>{if(m&&m>0){const b=$e(m/100);i==null||i(`${b}`)}}})),key:"custom"},...[.5,1,2,3].map(m=>({key:`${m}`,label:l.createElement("span",{className:c},`${$e(m*100)}%`)}))],onClick:h,selectedKeys:[`${a||r}`]};return A.useMemo(()=>l.createElement(vi,{className:pe(s(),t),menu:g},l.createElement(Ve,{icon:l.createElement(r3,null),size:"small"},`${$e(parseFloat(a||"1")*100)}%`)),[t,n,r,a,i,u])},o3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M508 512m-112 0a112 112 0 1 0 224 0 112 112 0 1 0-224 0Z"}),l.createElement("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3-7.7 16.2-7.7 35.2 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM508 688c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z"}))),s3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M942.3 486.4l-0.1-0.1-0.1-0.1c-36.4-76.7-80-138.7-130.7-186L760.7 351c43.7 40.2 81.5 93.7 114.1 160.9C791.5 684.2 673.4 766 512 766c-51.3 0-98.3-8.3-141.2-25.1l-54.7 54.7C374.6 823.8 439.8 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0.1-51.3zM878.3 154.2l-42.4-42.4c-3.1-3.1-8.2-3.1-11.3 0L707.8 228.5C649.4 200.2 584.2 186 512 186c-192.2 0-335.4 100.5-430.2 300.3v0.1c-7.7 16.2-7.7 35.2 0 51.5 36.4 76.7 80 138.7 130.7 186.1L111.8 824.5c-3.1 3.1-3.1 8.2 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0l712.8-712.8c3.1-3 3.1-8.1 0-11.2zM398.9 537.4c-1.9-8.2-2.9-16.7-2.9-25.4 0-61.9 50.1-112 112-112 8.7 0 17.3 1 25.4 2.9L398.9 537.4z m184.5-184.5C560.5 342.1 535 336 508 336c-97.2 0-176 78.8-176 176 0 27 6.1 52.5 16.9 75.4L263.3 673c-43.7-40.2-81.5-93.7-114.1-160.9C232.6 339.8 350.7 258 512 258c51.3 0 98.3 8.3 141.2 25.1l-69.8 69.8z"}),l.createElement("path",{d:"M508 624c-6.4 0-12.7-0.5-18.8-1.6l-51.1 51.1c21.4 9.3 45.1 14.4 69.9 14.4 97.2 0 176-78.8 176-176 0-24.8-5.1-48.5-14.4-69.9l-51.1 51.1c1 6.1 1.6 12.4 1.6 18.8C620 573.9 569.9 624 508 624z"}))),_u=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"}))),Ou=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),Tu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M853.333333 170.666667H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666666v128a42.666667 42.666667 0 0 0 85.333333 0V256h256v554.666667H384a42.666667 42.666667 0 0 0 0 85.333333h256a42.666667 42.666667 0 0 0 0-85.333333h-85.333333V256h256v85.333333a42.666667 42.666667 0 0 0 85.333333 0V213.333333a42.666667 42.666667 0 0 0-42.666667-42.666666z"}))),$u=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M0.00592 521.157814v-103.646801l430.267025 235.101281c36.191582 13.567843 70.207188 15.615819 111.870706 0.191998l440.986902-258.365013v103.614802l-435.386966 258.877007c-42.175512 18.303788-91.326944 18.303788-126.398539 0L0.00592 521.157814z"}),l.createElement("path",{d:"M0.00592 743.651242v-104.798789l406.427301 221.43744c17.2798 9.439891 40.511532 17.599797 65.119247 20.383764h27.999676c32.511624-5.023942 47.103455-10.207882 67.615218-22.943735l415.931191-258.173014v98.974855l-430.875018 268.95689c-42.111513 17.439798-95.806892 18.079791-130.878487 0.575994L0.00592 743.619242zM20.069688 246.024995L399.073306 20.971598c41.279523-26.303696 90.430954-27.967677 133.342458-4.35195l421.083131 198.621703c35.743587 17.599797 37.18357 61.311291 2.655969 81.151062l-414.043212 226.205384a165.758083 165.758083 0 0 1-133.374458 4.415949L22.725657 327.208057C9.157814 318.664155 0.90191 303.56033 0.229917 285.000545c-0.607993-18.911781 10.719876-32.159628 19.807771-38.94355z"})," ")),Pu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}))),Iu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32z m-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792z m0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z"}),l.createElement("path",{d:"M304 456c48.6 0 88-39.4 88-88s-39.4-88-88-88-88 39.4-88 88 39.4 88 88 88z m0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}))),l3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M256 682.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0zM768 170.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0z"}),l.createElement("path",{d:"M707.84 316.16a42.666667 42.666667 0 0 1 0 60.330667l-331.178667 331.178666a42.666667 42.666667 0 0 1-60.330666-60.330666l331.178666-331.178667a42.666667 42.666667 0 0 1 60.330667 0z"}))),zu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M145 96l66 746.6L511.8 928l299.6-85.4L878.7 96H145z m610.9 700.6l-244.1 69.6-245.2-69.6-56.7-641.2h603.8l-57.8 641.2z"}),l.createElement("path",{d:"M281 249l1.7 24.3 22.7 253.5h206.5v-0.1h112.9l-11.4 118.5L511 672.9v0.2h-0.8l-102.4-27.7-6.5-73.2h-91l11.3 144.7 188.6 52h1.7v-0.4l187.7-51.7 1.7-16.3 21.2-242.2 3.2-24.3H511v0.2H389.9l-8.2-94.2h352.1l1.7-19.5 4.8-47.2L742 249H511z"}))),c3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-0.7 5.2-2L869 536.2c14.7-12.8 14.7-35.6 0-48.4z"}))),d3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 0.3L512 465.6l-99.3-118.4-66.1-0.3c-4.4 0-8 3.5-8 8 0 1.9 0.7 3.7 1.9 5.2l130.1 155L340.5 670c-1.2 1.5-1.9 3.3-1.9 5.2 0 4.4 3.6 8 8 8l66.1-0.3L512 564.4l99.3 118.4 66 0.3c4.4 0 8-3.5 8-8 0-1.9-0.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}),l.createElement("path",{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),Ut="node",u3=e=>{const{className:t,style:n,type:r,uuid:a,nodeKey:i,title:o,position:s,generateClassName:c,onTitleChange:d,onOperationToggle:u,onDelete:f,onSelect:h,onGoToGroup:p,operations:v,isSelected:g}=e,[m,b]=A.useState(!1),[y,S]=A.useState(!1),x=A.useRef(o),C=c(Ut),E=c(Ut,"icon"),j=c(Ut,"title"),z=c(Ut,"title","input"),k=c(Ut,"title","icon"),F=c(Ut,"action"),U=c(Ut,"selected"),L=A.useRef(0),O=A.useRef(null);A.useEffect(()=>{var H;m===!0&&((H=O.current)===null||H===void 0||H.focus())},[m]);const $=H=>{b(!1),d==null||d({uuid:i,value:H.target.value||""})},R=H=>{x.current=H.target.value||""},G=H=>{var _;H.code==="Enter"&&(b(!1),d==null||d({uuid:i,value:((_=H==null?void 0:H.target)===null||_===void 0?void 0:_.value)||""}))},N=H=>{H.stopPropagation(),H.preventDefault()},D=H=>{H.stopPropagation(),S(!0)},w=H=>{H.stopPropagation(),S(!1)},P=H=>{const _=Date.now(),T=_-L.current;L.current=_,h==null||h({uuids:[a],positions:[s]}),T<=300&&T>0&&(H.stopPropagation(),H.preventDefault(),b(!0))},V=H=>{H.stopPropagation(),H.preventDefault(),f==null||f({uuid:i})},M=H=>{H.stopPropagation(),H.preventDefault(),u==null||u({uuid:i,operations:{invisible:!v.invisible}})},Y=H=>{H.stopPropagation(),H.preventDefault(),p==null||p({uuid:a,position:s})};return A.useMemo(()=>{x.current=o;function H(_){return _==="rect"?l.createElement(_u,{className:k}):_==="circle"?l.createElement(Ou,{className:k}):_==="text"?l.createElement(Tu,{className:k}):_==="path"?l.createElement(l3,{className:k}):_==="image"?l.createElement(Iu,{className:k}):_==="svg"?l.createElement(Pu,{className:k}):_==="group"?l.createElement($u,{className:k}):_==="html"?l.createElement(zu,{className:k}):l.createElement("span",{className:k})}return l.createElement("span",{key:i,style:n,className:pe(C,t,g?U:null),onClick:P,onMouseOver:D,onMouseLeave:w},l.createElement("span",{className:j},H(r),l.createElement("span",null,o)),y&&l.createElement("span",{className:F},r==="group"&&l.createElement(c3,{className:E,onClick:Y}),v.invisible?l.createElement(s3,{className:E,onClick:M}):l.createElement(o3,{className:E,onClick:M}),l.createElement(d3,{className:E,onClick:V})),m&&l.createElement("span",{className:z},l.createElement(Jt,{ref:O,size:"small",defaultValue:o,onBlur:$,onClick:N,onKeyDown:G,onChange:R})))},[i,o,m,r,y,v,g])};function f3(e,t){const n=[],{position:r}=t;if(Array.isArray(e)){const a=[...r];e.forEach((i,o)=>{a.push(o),n.push(Ru(i,Object.assign(Object.assign({},t),{position:[...a]}))),a.pop()})}return n}const Ru=(e,t)=>{const{onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,position:s,selectedKeys:c}=t,d={key:e.key,title:l.createElement(u3,{uuid:e.key,title:e.title,position:s,operations:e.operations,nodeKey:e.key,type:e.type,generateClassName:t.generateClassName,onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,isSelected:c==null?void 0:c.includes(e.key)}),children:[]};if(Array.isArray(e.children)){const u=[...s];e.children.forEach((f,h)=>{u.push(h),d.children.push(Ru(f,Object.assign(Object.assign({},t),{position:[...u]}))),u.pop()})}return d},h3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}),l.createElement("path",{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8C574.1 404.4 544.1 392 512 392z"}))),p3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M264 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM760 654c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),g3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M120 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM120 654h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),v3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M904 158H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 582H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),m3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H212V212h200v200zM864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H612V212h200v200zM864 544H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z m-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}))),b3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333zM128 469.333333v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM128 640v85.333333h85.333333v-85.333333z m0-341.333333v85.333333h85.333333v-85.333333z m341.333333 341.333333v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128zM128 810.666667v85.333333h768v-85.333333z"}))),y3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M592 928H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96zM976 0H784a48 48 0 1 0 0 96h144v144.016a48 48 0 1 0 96 0V48a48 48 0 0 0-48-48zM240 928H96v-144a48 48 0 1 0-96 0v192a48 48 0 0 0 48 48h192a48 48 0 1 0 0-96zM48 640a48 48 0 0 0 48-48V432a48 48 0 1 0-96 0v160a48 48 0 0 0 48 48zM240 0H48a48 48 0 0 0-48 48v192a48 48 0 1 0 96 0V96h144a48 48 0 1 0 0-96z m784 592V432a48 48 0 1 0-96 0v160a48 48 0 1 0 96 0zM592 0H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96z m384 736a48 48 0 0 0-48 48v144h-144a48 48 0 1 0 0 96h192a48 48 0 0 0 48-48V784a48 48 0 0 0-48-48z"}))),w3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333z m-512-170.666667v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM469.333333 640v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v768h85.333333V128z m170.666667 0v85.333333h85.333333V128z m170.666666 682.666667v85.333333h85.333334v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m-512 0v85.333333h85.333333v-85.333333z"}))),x3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333zM128 213.333333h85.333333V128H128v85.333333z m170.666667 0h85.333333V128h-85.333333v85.333333z m0 341.333334h85.333333v-85.333334h-85.333333v85.333334zM128 896h85.333333v-85.333333H128v85.333333z m341.333333 0h85.333334v-85.333333h-85.333334v85.333333zM128 554.666667h85.333333v-85.333334H128v85.333334z m0 170.666666h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m170.666667-170.666666h85.333333v-85.333334h-85.333333v85.333334z m170.666667-426.666667v768h85.333333V128h-85.333333z m-170.666667 768h85.333333v-85.333333h-85.333333v85.333333z m0-682.666667h85.333333V128h-85.333333v85.333333z m-170.666667 341.333334h85.333334v-85.333334h-85.333334v85.333334z m0-341.333334h85.333334V128h-85.333334v85.333333z m0 170.666667h85.333334v-85.333333h-85.333334v85.333333z"}))),E3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333z m0-341.333333h85.333333v-85.333334h-85.333333v85.333334z m170.666666 0h85.333334v-85.333334h-85.333334v85.333334z m0 341.333333h85.333334v-85.333333h-85.333334v85.333333zM128 725.333333h85.333333v-85.333333H128v85.333333z m0 170.666667h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333334H128v85.333334z m0-170.666667h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m341.333334-341.333333h85.333333v-85.333333h-85.333333v85.333333z m0 170.666667h85.333333v-85.333334h-85.333333v85.333334zM128 128v85.333333h768V128H128z m682.666667 597.333333h85.333333v-85.333333h-85.333333v85.333333z m-170.666667 170.666667h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-512h85.333334v-85.333333h-85.333334v85.333333z m341.333334 512h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-341.333333h85.333333v-85.333334h-85.333333v85.333334z"}))),S3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M341.333333 512a42.666667 42.666667 0 0 0 42.666667 42.666667h256a42.666667 42.666667 0 0 0 0-85.333334H384a42.666667 42.666667 0 0 0-42.666667 42.666667z"}),l.createElement("path",{d:"M384 682.666667H307.626667A176.213333 176.213333 0 0 1 128 527.786667 170.666667 170.666667 0 0 1 298.666667 341.333333h85.333333a42.666667 42.666667 0 0 0 0-85.333333H307.626667a262.4 262.4 0 0 0-262.826667 222.293333A256 256 0 0 0 298.666667 768h85.333333a42.666667 42.666667 0 0 0 0-85.333333zM981.333333 479.573333A262.826667 262.826667 0 0 0 715.093333 256h-64.426666C616.106667 256 597.333333 275.2 597.333333 298.666667a42.666667 42.666667 0 0 0 42.666667 42.666666h76.373333A176.213333 176.213333 0 0 1 896 496.213333 170.666667 170.666667 0 0 1 725.333333 682.666667h-85.333333a42.666667 42.666667 0 0 0 0 85.333333h85.333333a256 256 0 0 0 256-288.426667z"}))),C3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M712 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM136 374h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM136 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM540 824H358c-87.3 0-158-70.7-158-158V484c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v182c0 127 103 230 230 230h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),M3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM484 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM658 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 476h-56c-4.4 0-8 3.6-8 8v182c0 87.3-70.7 158-158 158H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c127 0 230-103 230-230V484c0-4.4-3.6-8-8-8z"}))),A3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M656 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128H358c-127 0-230 103-230 230v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-87.3 70.7-158 158-158h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),_3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM666 128H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c87.3 0 158 70.7 158 158v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-127-103-230-230-230z"}))),Ll=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M896 810.666667v85.333333h-85.333333v-85.333333h85.333333z m-170.666667 0v85.333333h-85.333333v-85.333333h85.333333z m-170.666666 0v85.333333h-85.333334v-85.333333h85.333334z m-170.666667 0v85.333333H298.666667v-85.333333h85.333333z m-170.666667 0v85.333333H128v-85.333333h85.333333z m682.666667-170.666667v85.333333h-85.333333v-85.333333h85.333333zM213.333333 640v85.333333H128v-85.333333h85.333333z m0-170.666667v85.333334H128v-85.333334h85.333333z m469.333334-341.333333a213.418667 213.418667 0 0 1 213.12 204.074667L896 341.333333v213.333334h-85.333333V341.333333a128.426667 128.426667 0 0 0-120.490667-127.786666L682.666667 213.333333h-213.333334V128h213.333334zM213.333333 298.666667v85.333333H128V298.666667h85.333333z m0-170.666667v85.333333H128V128h85.333333z m170.666667 0v85.333333H298.666667V128h85.333333z"}))),O3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72z"}),l.createElement("path",{d:"M864 256H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}))),T3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M510.762667 970.666667A458.666667 458.666667 0 1 1 969.429333 512a459.178667 459.178667 0 0 1-458.666666 458.666667z m0-853.333334a394.666667 394.666667 0 1 0 394.666666 394.666667 395.093333 395.093333 0 0 0-394.666666-394.666667z"}),l.createElement("path",{d:"M512 724.48A212.48 212.48 0 1 1 724.48 512 212.736 212.736 0 0 1 512 724.48z m0-360.96A148.48 148.48 0 1 0 660.48 512 148.608 148.608 0 0 0 512 363.52z"}))),$3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M272.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512z"}),l.createElement("path",{d:"M576.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}))),Du=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z"}))),P3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M841.065412 337.317647v352.015059c0 46.802824-23.070118 74.752-39.936 95.111529-14.095059 17.106824-21.443765 26.684235-21.443765 41.803294V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-107.39953c0-37.526588 19.576471-61.199059 35.297882-80.173176 14.576941-17.648941 26.142118-31.563294 26.142118-56.681412V337.317647c0-18.793412-16.143059-36.502588-33.189647-36.502588-19.817412 0-24.033882 3.072-24.214588 3.19247-3.975529 5.360941-3.855059 34.273882-3.794824 57.584942 0.060235 11.384471 0.120471 24.094118-0.12047 38.068705-0.240941 16.504471-12.830118 28.792471-30.358589 29.696a30.117647 30.117647 0 0 1-29.876706-30.117647v-127.698823c0-18.492235-13.372235-32.406588-31.081411-32.406588-16.263529 0-28.190118 12.107294-29.635765 29.394823v120.651294a30.117647 30.117647 0 0 1-60.235294 0V268.047059l-0.120471-0.602353v-46.561882c0-3.975529-0.843294-38.671059-28.551529-38.671059-27.105882 0-31.201882 24.214588-31.201883 38.671059v42.345411c0 1.686588-0.662588 3.252706-0.963764 4.879059v156.250353a30.117647 30.117647 0 0 1-60.235294 0V262.686118c-2.891294-11.685647-11.324235-23.491765-28.069647-23.491765-17.227294 0-31.744 15.721412-31.744 34.334118v201.788235c0 0.421647-0.361412 0.783059-0.361412 1.204706v66.319059a30.117647 30.117647 0 0 1-60.235294 0v-50.236236c-10.601412-3.855059-25.961412-6.987294-34.755765-4.999529-7.107765 1.385412-14.275765 7.649882-18.733176 16.323765a43.309176 43.309176 0 0 0-0.542118 38.369882L345.148235 766.192941a31.563294 31.563294 0 0 1 2.108236 6.505412 32.888471 32.888471 0 0 0 35.418353 25.961412 30.238118 30.238118 0 0 1 33.310117 29.936941V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-77.462588a92.521412 92.521412 0 0 1-66.680471-67.764706L187.934118 567.055059a104.448 104.448 0 0 1 1.927529-90.774588c12.890353-24.877176 35.418353-42.706824 60.295529-47.766589 12.649412-2.590118 29.756235-1.867294 46.682353 1.566118v-43.369412c0-0.602353 0.301176-1.144471 0.361412-1.746823v-111.435294c0-52.163765 41.321412-94.569412 91.979294-94.569412 12.047059 0 23.612235 2.409412 34.093177 6.746353 11.986824-38.791529 44.152471-63.668706 86.317176-63.668706 40.237176 0 71.800471 25.419294 83.666824 63.909647 10.721882-4.517647 22.467765-6.987294 34.876235-6.987294 41.502118 0 75.776 26.744471 87.160471 64.572235 11.023059-2.409412 22.226824-2.951529 32.286117-2.951529 50.718118 0 93.485176 44.272941 93.485177 96.737882z"}))),I3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M170.666667 298.666667a42.666667 42.666667 0 1 1-85.333334 0V256a170.666667 170.666667 0 0 1 170.666667-170.666667h42.666667a42.666667 42.666667 0 1 1 0 85.333334H256a85.333333 85.333333 0 0 0-85.333333 85.333333v42.666667z m554.666666-128a42.666667 42.666667 0 0 1 0-85.333334h42.666667a170.666667 170.666667 0 0 1 170.666667 170.666667v42.666667a42.666667 42.666667 0 0 1-85.333334 0V256a85.333333 85.333333 0 0 0-85.333333-85.333333h-42.666667z m128 554.666666a42.666667 42.666667 0 0 1 85.333334 0v42.666667a170.666667 170.666667 0 0 1-170.666667 170.666667h-42.666667a42.666667 42.666667 0 0 1 0-85.333334h42.666667a85.333333 85.333333 0 0 0 85.333333-85.333333v-42.666667zM298.666667 853.333333a42.666667 42.666667 0 0 1 0 85.333334H256a170.666667 170.666667 0 0 1-170.666667-170.666667v-42.666667a42.666667 42.666667 0 0 1 85.333334 0v42.666667a85.333333 85.333333 0 0 0 85.333333 85.333333h42.666667z"}))),z3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M118.979048 637.074286l137.99619 66.243047 255.171048 123.587048 246.076952-119.222857 147.163429-70.485334a73.142857 73.142857 0 0 1-34.230857 97.109334l-327.119239 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 734.305524A73.142857 73.142857 0 0 1 118.979048 637.074286z m786.090666-153.063619a73.142857 73.142857 0 0 1-33.913904 97.767619L544.01219 740.205714a73.142857 73.142857 0 0 1-63.780571 0L153.136762 581.778286A73.142857 73.142857 0 0 1 117.51619 487.862857l362.300953 170.886095 32.329143 15.652572 327.119238-158.427429 65.80419-31.939047zM544.036571 139.190857l327.094858 158.403048a73.142857 73.142857 0 0 1 0 131.657143l-327.094858 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 429.251048a73.142857 73.142857 0 0 1 0-131.657143L480.256 139.215238a73.142857 73.142857 0 0 1 63.780571 0z m-31.890285 65.828572L185.027048 363.422476l327.119238 158.427429 327.119238-158.427429L512.146286 205.04381z"}))),R3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8c-16.4 12.8-16.4 37.5 0 50.3l450.8 352.1c5.3 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}))),D3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 42.666667a469.333333 469.333333 0 1 0 469.333333 469.333333A469.333333 469.333333 0 0 0 512 42.666667z m0 864a394.666667 394.666667 0 1 1 394.666667-394.666667 395.146667 395.146667 0 0 1-394.666667 394.666667z"}),l.createElement("path",{d:"M304.906667 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}),l.createElement("path",{d:"M512 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333334 0 66.666667 66.666667 0 1 0-133.333334 0Z"}),l.createElement("path",{d:"M719.093333 512m-66.666666 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}))),N3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M935.253333 111.786667a42.666667 42.666667 0 0 0-23.04-23.04A42.666667 42.666667 0 0 0 896 85.333333h-256a42.666667 42.666667 0 0 0 0 85.333334h153.173333L170.666667 793.173333V640a42.666667 42.666667 0 0 0-85.333334 0v256a42.666667 42.666667 0 0 0 3.413334 16.213333 42.666667 42.666667 0 0 0 23.04 23.04A42.666667 42.666667 0 0 0 128 938.666667h256a42.666667 42.666667 0 0 0 0-85.333334H230.826667L853.333333 230.826667V384a42.666667 42.666667 0 0 0 85.333334 0V128a42.666667 42.666667 0 0 0-3.413334-16.213333z"}))),j3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M128 128h64v389.312A384.32 384.32 0 0 1 506.688 832H896v64H192a64 64 0 0 1-64-64V128z m313.6 704A320.384 320.384 0 0 0 192 582.4V832h249.6z"}))),L3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M929.19 352.19c3.12 3.12 3.12 8.19 0 11.31L363.51 929.19c-3.12 3.12-8.19 3.12-11.31 0L94.81 671.81c-3.12-3.12-3.12-8.19 0-11.31L660.49 94.81c3.12-3.12 8.19-3.12 11.31 0l257.39 257.38z m-424.26 5.66l108.89 108.89c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0L456.85 405.93l-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-62.23 62.23 161.22 161.22 469.52-469.52-161.23-161.21-62.23 62.23 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91z"}))),k3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M725.333333 341.333333a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666666a42.666667 42.666667 0 1 0 42.666667 42.666666 42.666667 42.666667 0 0 0-42.666667-42.666666z"}),l.createElement("path",{d:"M640 256H85.333333a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM938.666667 256h-128a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333zM512 640a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666667 42.666667 42.666667 42.666667 0 0 0-42.666667-42.666667z"}),l.createElement("path",{d:"M426.666667 554.666667H85.333333a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM938.666667 554.666667h-341.333334a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM298.666667 938.666667a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666666 42.666667 42.666667 42.666667 0 0 0-42.666666-42.666667z"}),l.createElement("path",{d:"M938.666667 853.333333H384a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM213.333333 853.333333H85.333333a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333z"}))),B3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M802.742857 777.485714c49.942857 0 90.742857-41.371429 90.742857-92 0-61.142857-90.742857-160.914286-90.742857-160.914285S712 624.342857 712 685.485714c0 50.628571 40.8 92 90.742857 92z m-430.971428-50.4c8.114286 8.114286 21.257143 8.114286 29.257142 0l292.685715-292.571428c8.114286-8.114286 8.114286-21.257143 0-29.257143l-292.571429-292.571429c-0.685714-0.685714-1.485714-1.371429-2.285714-1.942857l-89.371429-89.371428a10.411429 10.411429 0 0 0-14.628571 0l-54.857143 54.857142a10.411429 10.411429 0 0 0 0 14.628572l76.8 76.8-237.485714 237.6c-8.114286 8.114286-8.114286 21.257143 0 29.257143l292.457143 292.571428z m14.742857-512.685714l204.457143 204.457143H182.171429l204.342857-204.457143zM960 859.428571H64c-5.028571 0-9.142857 4.114286-9.142857 9.142858v91.428571c0 5.028571 4.114286 9.142857 9.142857 9.142857h896c5.028571 0 9.142857-4.114286 9.142857-9.142857v-91.428571c0-5.028571-4.114286-9.142857-9.142857-9.142858z"}))),F3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669c3.2 4.1 9.4 4.1 12.6 0l112-141.7c4.1-5.2 0.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}))),H3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 474H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM506.3 399.3c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7 0.4-11.7-5.7-11.7H550V104c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v156h-62.8c-6 0-9.4 7-5.7 11.7l100.8 127.6zM517.7 624.7c-2.9-3.7-8.5-3.7-11.3 0L405.6 752.3c-3.7 4.7-0.4 11.7 5.7 11.7H474v156c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V764h62.8c6 0 9.4-7 5.7-11.7L517.7 624.7z"}))),W3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355c-3.2-4.1-9.4-4.1-12.6 0l-112 141.7c-4.1 5.2-0.4 12.9 6.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"}))),{DirectoryTree:G3}=ff,V3="base-element-tree",Ji=e=>{const t=e.split("-").map(n=>parseInt(n));return t.shift(),t},U3=l.forwardRef((e,t)=>{const{height:n,className:r,style:a,treeData:i,onTitleChange:o,onOperationToggle:s,onSelect:c,selectedKeys:d,onDrop:u,defaultExpandedKeys:f,expandedKeys:h,onDelete:p,onExpand:v,onGoToGroup:g}=e,{createPrefixName:m}=A.useContext(le),b=m(V3),y=(x,C)=>{const j=[Ji(C.node.pos)],z=[x[0]];c==null||c({uuids:z,positions:j})},S=({uuid:x})=>{p==null||p({uuid:x})};return A.useMemo(()=>{const x=f3(i||[],{generateClassName:b,onTitleChange:o,onOperationToggle:s,onDelete:S,onGoToGroup:g,position:[],selectedKeys:d||[]});return l.createElement(G3,{ref:t,height:n,style:a,className:pe(b(),r),showLine:!0,blockNode:!0,multiple:!0,selectedKeys:d,switcherIcon:l.createElement(Du,null),icon:null,onSelect:y,treeData:x,defaultExpandedKeys:f,expandedKeys:h,onExpand:v,draggable:{icon:!1,nodeDraggable:()=>!0},onDrop:C=>{const{dragNode:E,node:j,dropToGap:z,dropPosition:k}=C,F=Ji(E.pos),U=Ji(j.pos);z===!0&&k>=0?U[U.length-1]=k:j.dragOverGapBottom===!0?U[U.length-1]=U[U.length-1]+1:j.dragOverGapTop===!0?U[U.length-1]=Math.max(0,U[U.length-1]-1):j.dragOver===!0&&U.push(0),u==null||u({from:F,to:U})}})},[r,a,y,i,d])});var Y3=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{const{value:t,onChange:n}=e,r=Y3(e,["value","onChange"]),a=o=>{n==null||n(o)},i=()=>{a(!t)};return l.createElement(Ve,Object.assign({},r,{type:t?"primary":"default",onClick:i}))},Z3="ElementDetail",ln=()=>{const[e]=wf(Z3);return e},K3="base-element-basic-attribute",Nt=e=>At.number(e*1)?$e(e*1):e,kl=e=>{if(At.number(e*1)){const t=$e(e*1);return ht(t)}return e},Q3=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,o=A.useRef(null),{createPrefixName:s}=A.useContext(le),c=s(K3),d=c(),u=c("row"),f=c("col"),h=c("input"),p=c("form-item"),v=ln(),g=m=>{var b;((b=r==null?void 0:r.operations)===null||b===void 0?void 0:b.limitRatio)===!0&&(m!=null&&m.hasOwnProperty("w")?m.h=$e(m.w/r.w*r.h):m!=null&&m.hasOwnProperty("h")&&(m.w=$e(m.h/r.h*r.w))),a==null||a(m)};return A.useEffect(()=>{var m;const{type:b,x:y,y:S,w:x,h:C,angle:E=0,operations:j={}}=r||{},z={x:y,y:S,w:x,h:C,angle:E,operations:{limitRatio:j.limitRatio}};b==="group"&&(z.operations.deepResize=j.deepResize),(m=o.current)===null||m===void 0||m.setFieldsValue(z)},[r]),A.useMemo(()=>l.createElement(J,{ref:o,style:n,className:pe(d,t),onValuesChange:g},l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"x"},l.createElement(se,{className:h,size:"small",placeholder:"X",prefix:"X",disabled:i,formatter:Nt,parser:Nt}))),l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"y"},l.createElement(se,{className:h,size:"small",placeholder:"Y",prefix:"Y",disabled:i,formatter:Nt,parser:Nt})))),l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"w"},l.createElement(se,{className:h,size:"small",placeholder:"Width",prefix:v.w,disabled:i,formatter:Nt,parser:Nt}))),l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"h"},l.createElement(se,{className:h,size:"small",placeholder:"Height",prefix:v.h,disabled:i,formatter:Nt,parser:Nt}))),l.createElement(Q,{span:4,className:f},l.createElement(J.Item,{className:p,name:["operations","limitRatio"]},l.createElement(X3,{icon:l.createElement(S3,null),size:"small",disabled:i})))),l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"angle"},l.createElement(se,{className:h,size:"small",placeholder:"Angle",prefix:l.createElement(j3,{style:{fontSize:14}}),disabled:i,formatter:kl,parser:kl,suffix:"°"})))),(r==null?void 0:r.type)==="group"&&l.createElement(he,{className:u},l.createElement(Q,{span:18,className:f},v.deepResizeInGroup),l.createElement(Q,{span:6,className:f},l.createElement(J.Item,{className:p,name:["operations","deepResize"]},l.createElement(_d,{size:"small"}))))),[v,i,r])};var Qe={},Yr={},J3=typeof ra=="object"&&ra&&ra.Object===Object&&ra,Nu=J3,q3=Nu,eg=typeof self=="object"&&self&&self.Object===Object&&self,tg=q3||eg||Function("return this")(),mt=tg,ng=mt,rg=ng.Symbol,Xr=rg,Bl=Xr,ju=Object.prototype,ag=ju.hasOwnProperty,ig=ju.toString,Sr=Bl?Bl.toStringTag:void 0;function og(e){var t=ag.call(e,Sr),n=e[Sr];try{e[Sr]=void 0;var r=!0}catch{}var a=ig.call(e);return r&&(t?e[Sr]=n:delete e[Sr]),a}var sg=og,lg=Object.prototype,cg=lg.toString;function dg(e){return cg.call(e)}var ug=dg,Fl=Xr,fg=sg,hg=ug,pg="[object Null]",gg="[object Undefined]",Hl=Fl?Fl.toStringTag:void 0;function vg(e){return e==null?e===void 0?gg:pg:Hl&&Hl in Object(e)?fg(e):hg(e)}var cn=vg,mg=Array.isArray,ct=mg;function bg(e){return e!=null&&typeof e=="object"}var Ot=bg,yg=cn,wg=ct,xg=Ot,Eg="[object String]";function Sg(e){return typeof e=="string"||!wg(e)&&xg(e)&&yg(e)==Eg}var Cg=Sg;function Mg(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++a];if(n(i[c],c,i)===!1)break}return t}}var Ag=Mg,_g=Ag,Og=_g(),Tg=Og;function $g(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ug}var ts=Yg,Xg=cn,Zg=ts,Kg=Ot,Qg="[object Arguments]",Jg="[object Array]",qg="[object Boolean]",ev="[object Date]",tv="[object Error]",nv="[object Function]",rv="[object Map]",av="[object Number]",iv="[object Object]",ov="[object RegExp]",sv="[object Set]",lv="[object String]",cv="[object WeakMap]",dv="[object ArrayBuffer]",uv="[object DataView]",fv="[object Float32Array]",hv="[object Float64Array]",pv="[object Int8Array]",gv="[object Int16Array]",vv="[object Int32Array]",mv="[object Uint8Array]",bv="[object Uint8ClampedArray]",yv="[object Uint16Array]",wv="[object Uint32Array]",xe={};xe[fv]=xe[hv]=xe[pv]=xe[gv]=xe[vv]=xe[mv]=xe[bv]=xe[yv]=xe[wv]=!0;xe[Qg]=xe[Jg]=xe[dv]=xe[qg]=xe[uv]=xe[ev]=xe[tv]=xe[nv]=xe[rv]=xe[av]=xe[iv]=xe[ov]=xe[sv]=xe[lv]=xe[cv]=!1;function xv(e){return Kg(e)&&Zg(e.length)&&!!xe[Xg(e)]}var Ev=xv;function Sv(e){return function(t){return e(t)}}var ns=Sv,si={exports:{}};si.exports;(function(e,t){var n=Nu,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,s=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(si,si.exports);var rs=si.exports,Cv=Ev,Mv=ns,Gl=rs,Vl=Gl&&Gl.isTypedArray,Av=Vl?Mv(Vl):Cv,Fu=Av,_v=Pg,Ov=ku,Tv=ct,$v=es,Pv=Bu,Iv=Fu,zv=Object.prototype,Rv=zv.hasOwnProperty;function Dv(e,t){var n=Tv(e),r=!n&&Ov(e),a=!n&&!r&&$v(e),i=!n&&!r&&!a&&Iv(e),o=n||r||a||i,s=o?_v(e.length,String):[],c=s.length;for(var d in e)(t||Rv.call(e,d))&&!(o&&(d=="length"||a&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Pv(d,c)))&&s.push(d);return s}var Hu=Dv,Nv=Object.prototype;function jv(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Nv;return e===n}var as=jv;function Lv(e,t){return function(n){return e(t(n))}}var Wu=Lv,kv=Wu,Bv=kv(Object.keys,Object),Fv=Bv,Hv=as,Wv=Fv,Gv=Object.prototype,Vv=Gv.hasOwnProperty;function Uv(e){if(!Hv(e))return Wv(e);var t=[];for(var n in Object(e))Vv.call(e,n)&&n!="constructor"&&t.push(n);return t}var Yv=Uv;function Xv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ir=Xv,Zv=cn,Kv=ir,Qv="[object AsyncFunction]",Jv="[object Function]",qv="[object GeneratorFunction]",e6="[object Proxy]";function t6(e){if(!Kv(e))return!1;var t=Zv(e);return t==Jv||t==qv||t==Qv||t==e6}var Gu=t6,n6=Gu,r6=ts;function a6(e){return e!=null&&r6(e.length)&&!n6(e)}var xi=a6,i6=Hu,o6=Yv,s6=xi;function l6(e){return s6(e)?i6(e):o6(e)}var Zr=l6,c6=Tg,d6=Zr;function u6(e,t){return e&&c6(e,t,d6)}var Vu=u6;function f6(e){return e}var Uu=f6,h6=Uu;function p6(e){return typeof e=="function"?e:h6}var g6=p6,v6=Vu,m6=g6;function b6(e,t){return e&&v6(e,m6(t))}var is=b6,y6=Wu,w6=y6(Object.getPrototypeOf,Object),os=w6,x6=cn,E6=os,S6=Ot,C6="[object Object]",M6=Function.prototype,A6=Object.prototype,Yu=M6.toString,_6=A6.hasOwnProperty,O6=Yu.call(Object);function T6(e){if(!S6(e)||x6(e)!=C6)return!1;var t=E6(e);if(t===null)return!0;var n=_6.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Yu.call(n)==O6}var $6=T6;function P6(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n-1}var Y6=U6,X6=Ei;function Z6(e,t){var n=this.__data__,r=X6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var K6=Z6,Q6=z6,J6=F6,q6=G6,em=Y6,tm=K6;function or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&hb?new cb:void 0;for(i.set(e,t),i.set(t,e);++f0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,rw.default)(t,function(r){Array.isArray(r)?e(r).map(function(a){return n.push(a)}):(0,tw.default)(r)?(0,q4.default)(r,function(a,i){a===!0&&n.push(i),n.push(i+"-"+a)}):(0,Q4.default)(r)&&n.push(r)}),n};Yr.default=aw;var Kr={};function iw(e,t){for(var n=-1,r=e==null?0:e.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=t.default&&(0,M5.default)(t.default)||{};return n.map(function(a){var i=t[a];return i&&(0,S5.default)(i,function(o,s){r[s]||(r[s]={}),r[s]=A5({},r[s],i[s])}),a}),r};Kr.default=_5;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.autoprefix=void 0;var O5=is,Mc=$5(O5),T5=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){j5(a,r);function a(){var i,o,s,c;N5(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){W5(a,r);function a(){var i,o,s,c;H5(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:!0;r[o]=s};return t===0&&a("first-child"),t===n-1&&a("last-child"),(t===0||t%2===0)&&a("even"),Math.abs(t%2)===1&&a("odd"),a("nth-child",t),r};ms.default=V5;Object.defineProperty(Qe,"__esModule",{value:!0});Qe.ReactCSS=Qe.loop=Qe.handleActive=bs=Qe.handleHover=Qe.hover=void 0;var U5=Yr,Y5=ur(U5),X5=Kr,Z5=ur(X5),K5=Qr,Q5=ur(K5),J5=Jr,b0=ur(J5),q5=qr,eE=ur(q5),tE=ms,nE=ur(tE);function ur(e){return e&&e.__esModule?e:{default:e}}Qe.hover=b0.default;var bs=Qe.handleHover=b0.default;Qe.handleActive=eE.default;Qe.loop=nE.default;var rE=Qe.ReactCSS=function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;as?h=1:h=Math.round(f*100/s)/100,n.a!==h)return{h:n.h,s:n.s,l:n.l,a:h,source:"rgb"}}else{var p=void 0;if(u<0?p=0:u>o?p=1:p=Math.round(u*100/o)/100,a!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}return null},ao={},iE=function(t,n,r,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=t,o.fillRect(0,0,i.width,i.height),o.fillStyle=n,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},oE=function(t,n,r,a){var i=t+"-"+n+"-"+r+(a?"-server":"");if(ao[i])return ao[i];var o=iE(t,n,r,a);return ao[i]=o,o},Oc=Object.assign||function(e){for(var t=1;t-1},wE=function(t){return Number(String(t).replace(/%/g,""))},xE=1,oe=function(e){gE(t,e);function t(n){hE(this,t);var r=pE(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(a){r.setUpdatedValue(a.target.value,a)},r.handleKeyDown=function(a){var i=wE(a.target.value);if(!isNaN(i)&&yE(a.keyCode)){var o=r.getArrowOffset(),s=a.keyCode===y0?i+o:i-o;r.setUpdatedValue(s,a)}},r.handleDrag=function(a){if(r.props.dragLabel){var i=Math.round(r.props.value+a.movementX);i>=0&&i<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(i),a)}},r.handleMouseDown=function(a){r.props.dragLabel&&(a.preventDefault(),r.handleDrag(a),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+xE++,r}return uE(t,[{key:"componentDidUpdate",value:function(r,a){this.props.value!==this.state.value&&(r.value!==this.props.value||a.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return fE({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||vE}},{key:"setUpdatedValue",value:function(r,a){var i=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(i,a),this.setState({value:r})}},{key:"render",value:function(){var r=this,a=ie({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return l.createElement("div",{style:a.wrap},l.createElement("input",{id:this.inputId,style:a.input,ref:function(o){return r.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?l.createElement("label",{htmlFor:this.inputId,style:a.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(A.PureComponent||A.Component),EE=function(t,n,r,a){var i=a.clientWidth,o=a.clientHeight,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(a.getBoundingClientRect().left+window.pageXOffset),u=c-(a.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var f=void 0;if(u<0)f=359;else if(u>o)f=0;else{var h=-(u*100/o)+100;f=360*h/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var p=void 0;if(d<0)p=0;else if(d>i)p=359;else{var v=d*100/i;p=360*v/100}if(r.h!==p)return{h:p,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},SE=function(){function e(t,n){for(var r=0;r1?$n("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):$n("Invalid argument supplied to oneOf, expected an array."),va;function $(R,G,N,D,w){for(var P=R[G],V=0;V0?", expected one of type ["+M.join(", ")+"]":"";return new c("Invalid "+P+" `"+V+"` supplied to "+("`"+w+"`"+T+"."))}return d(G)}function S(){function O($,R,G,N,D){return j($[R])?null:new c("Invalid "+N+" `"+D+"` supplied to "+("`"+G+"`, expected a ReactNode."))}return d(O)}function x(O,$,R,G,N){return new c((O||"React class")+": "+$+" type `"+R+"."+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function C(O){function $(R,G,N,D,w){var P=R[G],V=k(P);if(V!=="object")return new c("Invalid "+D+" `"+w+"` of type `"+V+"` "+("supplied to `"+N+"`, expected `object`."));for(var M in O){var Y=O[M];if(typeof Y!="function")return x(N,D,w,M,F(Y));var H=Y(P,M,N,D,w+"."+M,bn);if(H)return H}return null}return d($)}function E(O){function $(R,G,N,D,w){var P=R[G],V=k(P);if(V!=="object")return new c("Invalid "+D+" `"+w+"` of type `"+V+"` "+("supplied to `"+N+"`, expected `object`."));var M=NE({},R[G],O);for(var Y in M){var H=O[Y];if(io(O,Y)&&typeof H!="function")return x(N,D,w,Y,F(H));if(!H)return new c("Invalid "+D+" `"+w+"` key `"+Y+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(R[G],null," ")+` +Valid keys: `+JSON.stringify(Object.keys(O),null," "));var _=H(P,Y,N,D,w+"."+Y,bn);if(_)return _}return null}return d($)}function j(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(j);if(O===null||e(O))return!0;var $=a(O);if($){var R=$.call(O),G;if($!==O.entries){for(;!(G=R.next()).done;)if(!j(G.value))return!1}else for(;!(G=R.next()).done;){var N=G.value;if(N&&!j(N[1]))return!1}}else return!1;return!0;default:return!1}}function z(O,$){return O==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function k(O){var $=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":z($,O)?"symbol":$}function F(O){if(typeof O>"u"||O===null)return""+O;var $=k(O);if($==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return $}function U(O){var $=F(O);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function L(O){return!O.constructor||!O.constructor.name?i:O.constructor.name}return o.checkPropTypes=Ic,o.resetWarningCache=Ic.resetWarningCache,o.PropTypes=o,o};{var LE=E0,kE=!0;w0.exports=jE(LE.isElement,kE)}var BE=w0.exports;const X=df(BE);function FE(){this.__data__=[],this.size=0}function ea(e,t){return e===t||e!==e&&t!==t}function $i(e,t){for(var n=e.length;n--;)if(ea(e[n][0],t))return n;return-1}var HE=Array.prototype,WE=HE.splice;function GE(e){var t=this.__data__,n=$i(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():WE.call(t,n,1),--this.size,!0}function VE(e){var t=this.__data__,n=$i(t,e);return n<0?void 0:t[n][1]}function UE(e){return $i(this.__data__,e)>-1}function YE(e,t){var n=this.__data__,r=$i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Tt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=n7}function pr(e){return e!=null&&Ss(e.length)&&!ws(e)}function r7(e){return Wt(e)&&pr(e)}function a7(){return!1}var z0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bc=z0&&typeof module=="object"&&module&&!module.nodeType&&module,i7=Bc&&Bc.exports===z0,Fc=i7?dt.Buffer:void 0,o7=Fc?Fc.isBuffer:void 0,hi=o7||a7,s7="[object Object]",l7=Function.prototype,c7=Object.prototype,R0=l7.toString,d7=c7.hasOwnProperty,u7=R0.call(Object);function f7(e){if(!Wt(e)||un(e)!=s7)return!1;var t=P0(e);if(t===null)return!0;var n=d7.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&R0.call(n)==u7}var h7="[object Arguments]",p7="[object Array]",g7="[object Boolean]",v7="[object Date]",m7="[object Error]",b7="[object Function]",y7="[object Map]",w7="[object Number]",x7="[object Object]",E7="[object RegExp]",S7="[object Set]",C7="[object String]",M7="[object WeakMap]",A7="[object ArrayBuffer]",_7="[object DataView]",O7="[object Float32Array]",T7="[object Float64Array]",$7="[object Int8Array]",P7="[object Int16Array]",I7="[object Int32Array]",z7="[object Uint8Array]",R7="[object Uint8ClampedArray]",D7="[object Uint16Array]",N7="[object Uint32Array]",Ee={};Ee[O7]=Ee[T7]=Ee[$7]=Ee[P7]=Ee[I7]=Ee[z7]=Ee[R7]=Ee[D7]=Ee[N7]=!0;Ee[h7]=Ee[p7]=Ee[A7]=Ee[g7]=Ee[_7]=Ee[v7]=Ee[m7]=Ee[b7]=Ee[y7]=Ee[w7]=Ee[x7]=Ee[E7]=Ee[S7]=Ee[C7]=Ee[M7]=!1;function j7(e){return Wt(e)&&Ss(e.length)&&!!Ee[un(e)]}function L7(e){return function(t){return e(t)}}var D0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Br=D0&&typeof module=="object"&&module&&!module.nodeType&&module,k7=Br&&Br.exports===D0,so=k7&&A0.process,Hc=function(){try{var e=Br&&Br.require&&Br.require("util").types;return e||so&&so.binding&&so.binding("util")}catch{}}(),Wc=Hc&&Hc.isTypedArray,Cs=Wc?L7(Wc):j7;function Wo(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var B7=Object.prototype,F7=B7.hasOwnProperty;function H7(e,t,n){var r=e[t];(!(F7.call(e,t)&&ea(r,n))||n===void 0&&!(t in e))&&xs(e,t,n)}function W7(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i-1&&e%1==0&&e0){if(++t>=oC)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var dC=cC(iC);function uC(e,t){return dC(nC(e,t,Ii),e+"")}function fC(e,t,n){if(!qe(n))return!1;var r=typeof t;return(r=="number"?pr(n)&&Ms(t,n.length):r=="string"&&t in n)?ea(n[t],e):!1}function hC(e){return uC(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&fC(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r=t||j<0||f&&z>=i}function b(){var E=lo();if(m(E))return y(E);s=setTimeout(b,g(E))}function y(E){return s=void 0,h&&r?p(E):(r=a=void 0,o)}function S(){s!==void 0&&clearTimeout(s),d=0,r=c=a=s=void 0}function x(){return s===void 0?o:y(lo())}function C(){var E=lo(),j=m(E);if(r=arguments,a=this,c=E,j){if(s===void 0)return v(c);if(f)return clearTimeout(s),s=setTimeout(b,t),p(c)}return s===void 0&&(s=setTimeout(b,t)),o}return C.cancel=S,C.flush=x,C}var AC="Expected a function";function _C(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(AC);return qe(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),k0(e,t,{leading:r,maxWait:t,trailing:a})}var OC=function(t,n,r){var a=r.getBoundingClientRect(),i=a.width,o=a.height,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(r.getBoundingClientRect().left+window.pageXOffset),u=c-(r.getBoundingClientRect().top+window.pageYOffset);d<0?d=0:d>i&&(d=i),u<0?u=0:u>o&&(u=o);var f=d/i,h=1-u/o;return{h:n.h,s:f,v:h,a:n.a,source:"hsv"}},TC=function(){function e(t,n){for(var r=0;r=0,i=!n&&a&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(qC,arguments)},brighten:function(){return this._applyModification(eM,arguments)},darken:function(){return this._applyModification(tM,arguments)},desaturate:function(){return this._applyModification(KC,arguments)},saturate:function(){return this._applyModification(QC,arguments)},greyscale:function(){return this._applyModification(JC,arguments)},spin:function(){return this._applyModification(nM,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(iM,arguments)},complement:function(){return this._applyCombination(rM,arguments)},monochromatic:function(){return this._applyCombination(oM,arguments)},splitcomplement:function(){return this._applyCombination(aM,arguments)},triad:function(){return this._applyCombination(Qc,[3])},tetrad:function(){return this._applyCombination(Qc,[4])}};q.fromRatio=function(e,t){if(pi(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=zr(e[r]));e=n}return q(e,t)};function VC(e){var t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,s=!1;return typeof e=="string"&&(e=uM(e)),pi(e)=="object"&&(yt(e.r)&&yt(e.g)&&yt(e.b)?(t=UC(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):yt(e.h)&&yt(e.s)&&yt(e.v)?(r=zr(e.s),a=zr(e.v),t=XC(e.h,r,a),o=!0,s="hsv"):yt(e.h)&&yt(e.s)&&yt(e.l)&&(r=zr(e.s),i=zr(e.l),t=YC(e.h,r,i),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=F0(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function UC(e,t,n){return{r:Me(e,255)*255,g:Me(t,255)*255,b:Me(n,255)*255}}function Yc(e,t,n){e=Me(e,255),t=Me(t,255),n=Me(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=(r+a)/2;if(r==a)i=o=0;else{var c=r-a;switch(o=s>.5?c/(2-r-a):c/(r+a),r){case e:i=(t-n)/c+(t1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(t===0)r=a=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),a=o(c,s,e),i=o(c,s,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function Xc(e,t,n){e=Me(e,255),t=Me(t,255),n=Me(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=r,c=r-a;if(o=r===0?0:c/r,r==a)i=0;else{switch(r){case e:i=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(q(r));return i}function oM(e,t){t=t||6;for(var n=q(e).toHsv(),r=n.h,a=n.s,i=n.v,o=[],s=1/t;t--;)o.push(q({h:r,s:a,v:i})),i=(i+s)%1;return o}q.mix=function(e,t,n){n=n===0?0:n||50;var r=q(e).toRgb(),a=q(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return q(o)};q.readability=function(e,t){var n=q(e),r=q(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};q.isReadable=function(e,t,n){var r=q.readability(e,t),a,i;switch(i=!1,a=fM(n),a.level+a.size){case"AAsmall":case"AAAlarge":i=r>=4.5;break;case"AAlarge":i=r>=3;break;case"AAAsmall":i=r>=7;break}return i};q.mostReadable=function(e,t,n){var r=null,a=0,i,o,s,c;n=n||{},o=n.includeFallbackColors,s=n.level,c=n.size;for(var d=0;da&&(a=i,r=q(t[d]));return q.isReadable(e,r,{level:s,size:c})||!o?r:(n.includeFallbackColors=!1,q.mostReadable(e,["#fff","#000"],n))};var Go=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},sM=q.hexNames=lM(Go);function lM(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function F0(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Me(e,t){cM(e)&&(e="100%");var n=dM(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Di(e){return Math.min(1,Math.max(0,e))}function He(e){return parseInt(e,16)}function cM(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function dM(e){return typeof e=="string"&&e.indexOf("%")!=-1}function lt(e){return e.length==1?"0"+e:""+e}function zr(e){return e<=1&&(e=e*100+"%"),e}function H0(e){return Math.round(parseFloat(e)*255).toString(16)}function Jc(e){return He(e)/255}var it=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function yt(e){return!!it.CSS_UNIT.exec(e)}function uM(e){e=e.replace(WC,"").replace(GC,"").toLowerCase();var t=!1;if(Go[e])e=Go[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=it.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=it.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=it.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=it.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=it.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=it.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=it.hex8.exec(e))?{r:He(n[1]),g:He(n[2]),b:He(n[3]),a:Jc(n[4]),format:t?"name":"hex8"}:(n=it.hex6.exec(e))?{r:He(n[1]),g:He(n[2]),b:He(n[3]),format:t?"name":"hex"}:(n=it.hex4.exec(e))?{r:He(n[1]+""+n[1]),g:He(n[2]+""+n[2]),b:He(n[3]+""+n[3]),a:Jc(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=it.hex3.exec(e))?{r:He(n[1]+""+n[1]),g:He(n[2]+""+n[2]),b:He(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function fM(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}var qc=function(t){var n=["r","g","b","a","h","s","l","v"],r=0,a=0;return HC(n,function(i){if(t[i]&&(r+=1,isNaN(t[i])||(a+=1),i==="s"||i==="l")){var o=/^\d+%$/;o.test(t[i])&&(a+=1)}}),r===a?t:!1},Rr=function(t,n){var r=t.hex?q(t.hex):q(t),a=r.toHsl(),i=r.toHsv(),o=r.toRgb(),s=r.toHex();a.s===0&&(a.h=n||0,i.h=n||0);var c=s==="000000"&&o.a===0;return{hsl:a,hex:c?"transparent":"#"+s,rgb:o,hsv:i,oldHue:t.h||n||a.h,source:t.source}},Gt=function(t){if(t==="transparent")return!0;var n=String(t).charAt(0)==="#"?1:0;return t.length!==4+n&&t.length<7+n&&q(t).isValid()},_s=function(t){if(!t)return"#fff";var n=Rr(t);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},co=function(t,n){var r=t.replace("°","");return q(n+" ("+r+")")._ok},Mr=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){wM(a,r);function a(){var i,o,s,c;yM(this,a);for(var d=arguments.length,u=Array(d),f=0;fs))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&IM?new gi:void 0;for(i.set(e,t),i.set(t,e);++f=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var ba=24,ZA=J0.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?ba:r,i=e.height,o=i===void 0?ba:i,s=e.style,c=s===void 0?{}:s,d=XA(e,["fill","width","height","style"]);return bd.default.createElement("svg",md({viewBox:"0 0 "+ba+" "+ba,style:md({fill:n,width:a,height:o},c)},d),bd.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},KA=function(){function e(t,n){for(var r=0;r1&&(a.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(a.a*100)/100,source:"rgb"},i)):(a.h||a.s||a.l)&&(typeof a.s=="string"&&a.s.includes("%")&&(a.s=a.s.replace("%","")),typeof a.l=="string"&&a.l.includes("%")&&(a.l=a.l.replace("%","")),a.s==1?a.s=.01:a.l==1&&(a.l=.01),r.props.onChange({h:a.h||r.props.hsl.h,s:Number(vd(a.s)?r.props.hsl.s:a.s),l:Number(vd(a.l)?r.props.hsl.l:a.l),source:"hsl"},i))},r.showHighlight=function(a){a.currentTarget.style.background="#eee"},r.hideHighlight=function(a){a.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return KA(t,[{key:"render",value:function(){var r=this,a=ie({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(oe,{style:{input:a.input,label:a.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(oe,{style:{input:a.input,label:a.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),l.createElement("div",{style:a.wrap,className:"flexbox-fix"},i,l.createElement("div",{style:a.toggle},l.createElement("div",{style:a.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},l.createElement(ZA,{style:a.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.hsl.a!==1&&a.view==="hex"?{view:"rgb"}:null}}]),t}(l.Component);q0.defaultProps={view:"hex"};var yd=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return l.createElement("div",{style:t.picker})},e_=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return l.createElement("div",{style:t.picker})},zs=function(t){var n=t.width,r=t.onChange,a=t.disableAlpha,i=t.rgb,o=t.hsl,s=t.hsv,c=t.hex,d=t.renderers,u=t.styles,f=u===void 0?{}:u,h=t.className,p=h===void 0?"":h,v=t.defaultView,g=ie(ke({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},f),{disableAlpha:a});return l.createElement("div",{style:g.picker,className:"chrome-picker "+p},l.createElement("div",{style:g.saturation},l.createElement(Ri,{style:g.Saturation,hsl:o,hsv:s,pointer:e_,onChange:r})),l.createElement("div",{style:g.body},l.createElement("div",{style:g.controls,className:"flexbox-fix"},l.createElement("div",{style:g.color},l.createElement("div",{style:g.swatch},l.createElement("div",{style:g.active}),l.createElement(fr,{renderers:d}))),l.createElement("div",{style:g.toggles},l.createElement("div",{style:g.hue},l.createElement(hr,{style:g.Hue,hsl:o,pointer:yd,onChange:r})),l.createElement("div",{style:g.alpha},l.createElement(ys,{style:g.Alpha,rgb:i,hsl:o,pointer:yd,renderers:d,onChange:r})))),l.createElement(q0,{rgb:i,hsl:o,hex:c,view:v,onChange:r,disableAlpha:a})))};zs.propTypes={width:X.oneOfType([X.string,X.number]),disableAlpha:X.bool,styles:X.object,defaultView:X.oneOf(["hex","rgb","hsl"])};zs.defaultProps={width:225,disableAlpha:!1,styles:{}};const t_=Be(zs);var n_=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.active,s=ie({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:_s(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:o,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(pn,{style:s.color,color:n,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:s.dot}))},r_=function(t){var n=t.hex,r=t.rgb,a=t.onChange,i=ie({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),o=function(c,d){c.r||c.g||c.b?a({r:c.r||r.r,g:c.g||r.g,b:c.b||r.b,source:"rgb"},d):a({hex:c.hex,source:"hex"},d)};return l.createElement("div",{style:i.fields,className:"flexbox-fix"},l.createElement("div",{style:i.active}),l.createElement(oe,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:o}))},Rs=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.colors,i=t.hex,o=t.rgb,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(ke({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},c)),h=function(v,g){v.hex?Gt(v.hex)&&n({hex:v.hex,source:"hex"},g):n(v,g)};return l.createElement(ta,{style:f.Compact,styles:c},l.createElement("div",{style:f.compact,className:"compact-picker "+u},l.createElement("div",null,gn(a,function(p){return l.createElement(n_,{key:p,color:p,active:p.toLowerCase()===i,onClick:h,onSwatchHover:r})}),l.createElement("div",{style:f.clear})),l.createElement(r_,{hex:i,rgb:o,onChange:h})))};Rs.propTypes={colors:X.arrayOf(X.string),styles:X.object};Rs.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};Be(Rs);var a_=function(t){var n=t.hover,r=t.color,a=t.onClick,i=t.onSwatchHover,o={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=ie({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:o}},{hover:n});return l.createElement("div",{style:s.swatch},l.createElement(pn,{color:r,onClick:a,onHover:i,focusStyle:o}))};const i_=bs(a_);var Ds=function(t){var n=t.width,r=t.colors,a=t.onChange,i=t.onSwatchHover,o=t.triangle,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(ke({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},c),{"hide-triangle":o==="hide","top-left-triangle":o==="top-left","top-right-triangle":o==="top-right","bottom-left-triangle":o==="bottom-left","bottom-right-triangle":o==="bottom-right"}),h=function(v,g){return a({hex:v,source:"hex"},g)};return l.createElement("div",{style:f.card,className:"github-picker "+u},l.createElement("div",{style:f.triangleShadow}),l.createElement("div",{style:f.triangle}),gn(r,function(p){return l.createElement(i_,{color:p,key:p,onClick:h,onSwatchHover:i})}))};Ds.propTypes={width:X.oneOfType([X.string,X.number]),colors:X.arrayOf(X.string),triangle:X.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:X.object};Ds.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Be(Ds);var o_=function(t){var n=t.direction,r=ie({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return l.createElement("div",{style:r.picker})},s_=Object.assign||function(e){for(var t=1;t.5});return l.createElement("div",{style:r.picker})},u_=function(){var t=ie({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return l.createElement("div",{style:t.pointer},l.createElement("div",{style:t.left},l.createElement("div",{style:t.leftInside})),l.createElement("div",{style:t.right},l.createElement("div",{style:t.rightInside})))},wd=function(t){var n=t.onClick,r=t.label,a=t.children,i=t.active,o=ie({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return l.createElement("div",{style:o.button,onClick:n},r||a)},f_=function(t){var n=t.rgb,r=t.currentColor,a=ie({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return l.createElement("div",null,l.createElement("div",{style:a.label},"new"),l.createElement("div",{style:a.swatches},l.createElement("div",{style:a.new}),l.createElement("div",{style:a.current})),l.createElement("div",{style:a.label},"current"))},h_=function(){function e(t,n){for(var r=0;r100&&(u.a=100),u.a/=100,n({h:a.h,s:a.s,l:a.l,a:u.a,source:"rgb"},f))};return l.createElement("div",{style:s.fields,className:"flexbox-fix"},l.createElement("div",{style:s.double},l.createElement(oe,{style:{input:s.input,label:s.label},label:"hex",value:i.replace("#",""),onChange:c})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.alpha},l.createElement(oe,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:c,dragLabel:"true",dragMax:"100"})))},b_=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var ya=24,M_=tf.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?ya:r,i=e.height,o=i===void 0?ya:i,s=e.style,c=s===void 0?{}:s,d=C_(e,["fill","width","height","style"]);return Ed.default.createElement("svg",xd({viewBox:"0 0 "+ya+" "+ya,style:xd({fill:n,width:a,height:o},c)},d),Ed.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},A_=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.first,s=t.last,c=t.active,d=ie({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:_s(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:o,last:s,active:c,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(pn,{color:n,style:d.color,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:d.check},l.createElement(M_,null)))},__=function(t){var n=t.onClick,r=t.onSwatchHover,a=t.group,i=t.active,o=ie({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return l.createElement("div",{style:o.group},gn(a,function(s,c){return l.createElement(A_,{key:s,color:s,active:s.toLowerCase()===i,first:c===0,last:c===a.length-1,onClick:n,onSwatchHover:r})}))},Bs=function(t){var n=t.width,r=t.height,a=t.onChange,i=t.onSwatchHover,o=t.colors,s=t.hex,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(ke({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},d)),p=function(g,m){return a({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.picker,className:"swatches-picker "+f},l.createElement(ta,null,l.createElement("div",{style:h.overflow},l.createElement("div",{style:h.body},gn(o,function(v){return l.createElement(__,{key:v.toString(),group:v,active:s,onClick:p,onSwatchHover:i})}),l.createElement("div",{style:h.clear})))))};Bs.propTypes={width:X.oneOfType([X.string,X.number]),height:X.oneOfType([X.string,X.number]),colors:X.arrayOf(X.arrayOf(X.string)),styles:X.object};Bs.defaultProps={width:320,height:240,colors:[[Pn[900],Pn[700],Pn[500],Pn[300],Pn[100]],[In[900],In[700],In[500],In[300],In[100]],[zn[900],zn[700],zn[500],zn[300],zn[100]],[Rn[900],Rn[700],Rn[500],Rn[300],Rn[100]],[Dn[900],Dn[700],Dn[500],Dn[300],Dn[100]],[Nn[900],Nn[700],Nn[500],Nn[300],Nn[100]],[jn[900],jn[700],jn[500],jn[300],jn[100]],[Ln[900],Ln[700],Ln[500],Ln[300],Ln[100]],[kn[900],kn[700],kn[500],kn[300],kn[100]],["#194D33",Dr[700],Dr[500],Dr[300],Dr[100]],[Bn[900],Bn[700],Bn[500],Bn[300],Bn[100]],[Fn[900],Fn[700],Fn[500],Fn[300],Fn[100]],[Hn[900],Hn[700],Hn[500],Hn[300],Hn[100]],[Wn[900],Wn[700],Wn[500],Wn[300],Wn[100]],[Gn[900],Gn[700],Gn[500],Gn[300],Gn[100]],[Vn[900],Vn[700],Vn[500],Vn[300],Vn[100]],[Un[900],Un[700],Un[500],Un[300],Un[100]],[Yn[900],Yn[700],Yn[500],Yn[300],Yn[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Be(Bs);var Fs=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.hex,i=t.colors,o=t.width,s=t.triangle,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(ke({default:{card:{width:o,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},d),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),p=function(g,m){Gt(g)&&n({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.card,className:"twitter-picker "+f},l.createElement("div",{style:h.triangleShadow}),l.createElement("div",{style:h.triangle}),l.createElement("div",{style:h.body},gn(i,function(v,g){return l.createElement(pn,{key:g,color:v,hex:v,style:h.swatch,onClick:p,onHover:r,focusStyle:{boxShadow:"0 0 4px "+v}})}),l.createElement("div",{style:h.hash},"#"),l.createElement(oe,{label:null,style:{input:h.input},value:a.replace("#",""),onChange:p}),l.createElement("div",{style:h.clear})))};Fs.propTypes={width:X.oneOfType([X.string,X.number]),triangle:X.oneOf(["hide","top-left","top-right"]),colors:X.arrayOf(X.string),styles:X.object};Fs.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Be(Fs);var Hs=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(t.hsl.h)+", "+Math.round(t.hsl.s*100)+"%, "+Math.round(t.hsl.l*100)+"%)"}}});return l.createElement("div",{style:n.picker})};Hs.propTypes={hsl:X.shape({h:X.number,s:X.number,l:X.number,a:X.number})};Hs.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Ws=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(t.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return l.createElement("div",{style:n.picker})};Ws.propTypes={hsl:X.shape({h:X.number,s:X.number,l:X.number,a:X.number})};Ws.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var O_=function(t){var n=t.onChange,r=t.rgb,a=t.hsl,i=t.hex,o=t.hsv,s=function(p,v){if(p.hex)Gt(p.hex)&&n({hex:p.hex,source:"hex"},v);else if(p.rgb){var g=p.rgb.split(",");co(p.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},v)}else if(p.hsv){var m=p.hsv.split(",");co(p.hsv,"hsv")&&(m[2]=m[2].replace("%",""),m[1]=m[1].replace("%",""),m[0]=m[0].replace("°",""),m[1]==1?m[1]=.01:m[2]==1&&(m[2]=.01),n({h:Number(m[0]),s:Number(m[1]),v:Number(m[2]),source:"hsv"},v))}else if(p.hsl){var b=p.hsl.split(",");co(p.hsl,"hsl")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),f[1]==1?f[1]=.01:f[2]==1&&(f[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},v))}},c=ie({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),d=r.r+", "+r.g+", "+r.b,u=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.l*100)+"%",f=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.v*100)+"%";return l.createElement("div",{style:c.wrap,className:"flexbox-fix"},l.createElement("div",{style:c.fields},l.createElement("div",{style:c.double},l.createElement(oe,{style:{input:c.input,label:c.label},label:"hex",value:i,onChange:s})),l.createElement("div",{style:c.column},l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"rgb",value:d,onChange:s})),l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"hsv",value:f,onChange:s})),l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"hsl",value:u,onChange:s})))))},Gs=function(t){var n=t.width,r=t.onChange,a=t.rgb,i=t.hsl,o=t.hsv,s=t.hex,c=t.header,d=t.styles,u=d===void 0?{}:d,f=t.className,h=f===void 0?"":f,p=ie(ke({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+a.r+", "+a.g+", "+a.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return l.createElement("div",{style:p.picker,className:"google-picker "+h},l.createElement("div",{style:p.head},c),l.createElement("div",{style:p.swatch}),l.createElement("div",{style:p.saturation},l.createElement(Ri,{hsl:i,hsv:o,pointer:Hs,onChange:r})),l.createElement("div",{style:p.body},l.createElement("div",{style:p.controls,className:"flexbox-fix"},l.createElement("div",{style:p.hue},l.createElement(hr,{style:p.Hue,hsl:i,radius:"4px",pointer:Ws,onChange:r}))),l.createElement(O_,{rgb:a,hsl:i,hex:s,hsv:o,onChange:r})))};Gs.propTypes={width:X.oneOfType([X.string,X.number]),styles:X.object,header:X.string};Gs.defaultProps={width:652,styles:{},header:"Color picker"};Be(Gs);function T_(e){let t=e.toLocaleUpperCase();const n={r:0,g:0,b:0,a:1};return/^\#[0-9a-f]{3,3}$/i.test(t)?t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}FF`:/^\#[0-9a-f]{6,6}$/i.test(t)&&(t=`${t}FF`),/^\#[0-9a-f]{8,8}$/i.test(t)&&(n.r=parseInt(`${t[1]}${t[2]}`,16),n.g=parseInt(`${t[3]}${t[4]}`,16),n.b=parseInt(`${t[5]}${t[6]}`,16),n.a=parseInt(`${t[7]}${t[8]}`,16)/255),n}function $_(e){const t=[];return t.push(e.r.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.g.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.b.toString(16).padStart(2,"0").toLocaleUpperCase()),e.a<1&&t.push(Math.floor(e.a*255).toString(16).padStart(2,"0").toLocaleUpperCase()),`#${t.join("")}`}const P_=({value:e="",onChange:t,className:n})=>l.createElement(t_,{className:n,color:T_(e),onChangeComplete:r=>{const a=$_(r==null?void 0:r.rgb);t==null||t(a)}}),nf="base-element-field-multiple-color-picker",rf=16,Sd=e=>{var t,n;const r=(t=e.currentTarget.parentElement)===null||t===void 0?void 0:t.getBoundingClientRect(),a=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.x-rf/2;let o=parseFloat((n=i/a.width)===null||n===void 0?void 0:n.toFixed(2));return o=Math.min(Math.max(o,0),1),o};function I_(e){const{mode:t,value:n,internalColor:r,internalLinearGradient:a,internalRadialGradient:i,currentPickedColor:o,onChange:s,onSelectStop:c}=e,[d,u]=A.useState(Qa(n)),[f,h]=A.useState(null),p=A.useRef(!1),{createPrefixName:v}=A.useContext(le),g=v(nf),m=g("gradient-root"),b=g("gradient-delete"),y=g("gradient"),S=g("gradient-bar"),x=g("gradient-point"),C=g("gradient-point-active");A.useEffect(()=>{var L;const O=Qa(n);u(O),["linear-gradient","radial-gradient"].includes(n==null?void 0:n.type)&&(f||h((L=n==null?void 0:n.stops)===null||L===void 0?void 0:L[0]))},[n]),A.useEffect(()=>{f?c==null||c(Object.assign({},f)):c==null||c(f)},[f]);const E=L=>{L.stopPropagation(),p.current=!0;const O=Sd(L);let $=null;if(t==="linear-gradient"?$=a:t==="radial-gradient"&&($=i),$){const R=[...$.stops];for(let N=0;ND.offset&&!w){R.push(P),h(P);break}if(!w)break}const G=Object.assign(Object.assign({},$),{stops:R});s==null||s(G)}},j=L=>{if(p.current===!0&&f){const O=Sd(L);let $=null;if(t==="linear-gradient"?$=a:t==="radial-gradient"&&($=i),$){const R=[...$.stops];for(let D=0;DD.offset-w.offset),N=Object.assign(Object.assign({},$),{stops:G});s==null||s(N)}}},z=L=>{L.stopPropagation(),p.current=!1},k=(L,O)=>{L.stopPropagation(),h(O),p.current=!0},F=()=>{let L=null;t==="linear-gradient"?L=a:t==="radial-gradient"&&(L=i);let O=-1;if(L&&f){const $=[...L.stops];for(let R=0;R<$.length;R++)if($[R].offset===f.offset){O=R;break}if(O>=0){$.splice(O,1);const R=Object.assign(Object.assign({},L),{stops:$});s==null||s(R)}}},U=L=>{p.current=!1};return A.useMemo(()=>{var L,O,$;return l.createElement(l.Fragment,null,(t==="linear-gradient"||t==="radial-gradient")&&l.createElement("div",{className:m},l.createElement("div",{className:y,"data-css":d,style:{background:d}},l.createElement("div",{className:S,onMouseDown:E,onMouseUp:z,onMouseMove:j,onMouseLeave:z},($=(O=(L=t==="linear-gradient"?a:i)===null||L===void 0?void 0:L.stops)===null||O===void 0?void 0:O.map)===null||$===void 0?void 0:$.call(O,(R,G)=>l.createElement("span",{key:G,className:pe({[x]:!0,[C]:(f==null?void 0:f.offset)===R.offset}),style:{left:`calc(${R.offset*100}% - ${rf/2}px)`,background:R.color},onMouseDown:N=>{k(N,R)},onMouseUp:U})))),l.createElement("div",{className:b,onClick:R=>{R.stopPropagation(),F()}},l.createElement(O3,null))))},[t,d,o,r,a,i,f])}function Cd(e){let t="solid";return e&&(e!=null&&e.type)&&(t=e.type),t}function z_(e){const{value:t,onChange:n,elementSize:r,disabledLinearGradient:a,disabledRadialGradient:i}=e,[o,s]=A.useState(Qa(t)),[c,d]=A.useState(Cd(t)),[u,f]=A.useState("#000000"),[h,p]=A.useState(null),[v,g]=A.useState(null),[m,b]=A.useState(null),y=A.useRef(null),S=A.useRef(null),x=A.useRef(null),{createPrefixName:C}=A.useContext(le),E=C(nf),j=E(),z=E("header"),k=E("internal-picker"),F=E("radio-group"),U=E("row"),L=E("col"),O=E("input"),$=E("form-item");A.useEffect(()=>{s(Qa(t)),d(Cd(t)),typeof t=="string"?(p(t),f(t)):(t==null?void 0:t.type)==="linear-gradient"?g(t):(t==null?void 0:t.type)==="radial-gradient"&&b(t)},[t]),A.useEffect(()=>{var w,P;c==="linear-gradient"&&(t==null?void 0:t.type)===c?(w=S.current)===null||w===void 0||w.setFieldsValue(t):c==="radial-gradient"&&(t==null?void 0:t.type)===c&&((P=x.current)===null||P===void 0||P.setFieldsValue(t))},[c,t]);const R=w=>{var P,V,M,Y,H,_;let T;w==="linear-gradient"?(T={type:"linear-gradient",start:{x:0,y:0},end:{x:0,y:(r==null?void 0:r.h)||0},stops:[]},typeof t=="string"?(T.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],g(T)):(t==null?void 0:t.type)==="radial-gradient"&&(T.stops=[...(t==null?void 0:t.stops)||[]],g(T)),(P=S.current)===null||P===void 0||P.setFieldsValue(T)):w==="radial-gradient"?(T={type:"radial-gradient",inner:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:0},outer:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:Math.min(((r==null?void 0:r.w)||0)/2,((r==null?void 0:r.h)||0)/2)},stops:[]},typeof t=="string"?(T.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],b(T)):(t==null?void 0:t.type)==="linear-gradient"&&(T.stops=[...(t==null?void 0:t.stops)||[]],b(T)),(V=x.current)===null||V===void 0||V.setFieldsValue(T)):w==="solid"&&(T=t,(t==null?void 0:t.type)==="linear-gradient"?(T=((Y=(M=t==null?void 0:t.stops)===null||M===void 0?void 0:M[0])===null||Y===void 0?void 0:Y.color)||"#000000",p(T)):(t==null?void 0:t.type)==="radial-gradient"&&(T=((_=(H=t==null?void 0:t.stops)===null||H===void 0?void 0:H[0])===null||_===void 0?void 0:_.color)||"#000000",p(T))),T&&(n==null||n(T))},G=w=>{if(c==="solid")n==null||n(w.color);else if(y.current){if(c==="linear-gradient"&&v&&Array.isArray(v==null?void 0:v.stops)){const P=[...v.stops];for(let M=0;M{const P=Object.assign({},v);w!=null&&w.start&&(P.start=Object.assign(Object.assign({},P.start),w.start)),w!=null&&w.end&&(P.end=Object.assign(Object.assign({},P.end),w.end)),n==null||n(P)},D=w=>{const P=Object.assign({},m);w!=null&&w.inner&&(P.inner=Object.assign(Object.assign({},P.inner),w.inner)),w!=null&&w.outer&&(P.outer=Object.assign(Object.assign({},P.outer),w.outer)),n==null||n(P)};return A.useMemo(()=>l.createElement("div",{className:j},!a&&!i&&l.createElement("div",{className:z},l.createElement(Xe.Group,{className:F,size:"small",buttonStyle:"solid",value:c,onChange:({target:{value:w}})=>{R(w)}},l.createElement(Xe.Button,{value:"solid"},l.createElement(B3,null)),!a&&l.createElement(Xe.Button,{value:"linear-gradient"},l.createElement(N3,null)),!i&&l.createElement(Xe.Button,{value:"radial-gradient"},l.createElement(T3,null)))),!a&&c==="linear-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:S,onValuesChange:N},l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"Start"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["start","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["start","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"End"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["end","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["end","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))))),!i&&c==="radial-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:x,onValuesChange:D},l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"Inner"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["inner","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["inner","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"}),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["inner","radius"]},l.createElement(se,{className:O,size:"small",prefix:"R"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"Outer"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["outer","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["outer","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"}),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["outer","radius"]},l.createElement(se,{className:O,size:"small",prefix:"R"})))))),(!a||!i)&&(c==="linear-gradient"||c==="radial-gradient")&&l.createElement(I_,{mode:c,value:t,currentPickedColor:u,internalColor:h,internalLinearGradient:v,internalRadialGradient:m,onChange:w=>{(w==null?void 0:w.type)==="linear-gradient"?(g(w),n==null||n(w)):(w==null?void 0:w.type)==="radial-gradient"&&(b(w),n==null||n(w))},onSelectStop:w=>{w!=null&&w.color&&f(w.color),y.current=w}}),l.createElement(P_,{value:u,className:k,onChange:w=>{f(w),G({color:w})}})),[c,o,h,v,m,u,a,i])}const R_="base-element-field-multiple-color";function ji(e){const{value:t,onChange:n,disabled:r,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o}=e,s=ln(),d=(y=>{let S="";return typeof y=="string"?S=y:["linear-gradient","radial-gradient"].includes(y==null?void 0:y.type)&&(S=s.gradient),S})(t),u=typeof t=="string",f=A.useRef(null),{createPrefixName:h,container:p}=A.useContext(le),v=h(R_),g=v(),m=v("preview"),b=()=>p||document.body;return A.useMemo(()=>{const y=Wf(t||"transparent");return l.createElement(l.Fragment,null,l.createElement(Jt,{className:g,size:"small",disabled:r,prefix:r?l.createElement("span",null):l.createElement(Od,{placement:"left",content:l.createElement(z_,{value:t,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o,onChange:n}),trigger:"click",getPopupContainer:b,getTooltipContainer:b},l.createElement("span",{className:m,style:{background:y}})),readOnly:!u,value:d,onChange:S=>{n==null||n(S.target.value)}}),l.createElement("div",{ref:f}))},[t,n,r,a])}const fo=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 384a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m0 170.666667a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m170.666667 0a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m-170.666667 170.666666a42.666667 42.666667 0 1 0-42.666667-42.666666 42.666667 42.666667 0 0 0 42.666667 42.666666z m341.333333-597.333333H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666667v682.666666a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667V170.666667a42.666667 42.666667 0 0 0-42.666667-42.666667z m-42.666666 682.666667H213.333333V213.333333h597.333334zM341.333333 554.666667a42.666667 42.666667 0 1 0-42.666666-42.666667 42.666667 42.666667 0 0 0 42.666666 42.666667z"}))),D_="base-element-border-attribute",Zo=4;function _r(e){const{borderRadius:t,borderWidth:n,borderColor:r,boxSizing:a,borderDash:i}=(e==null?void 0:e.detail)||{};let o="solid",s=Zo;Array.isArray(i)&&(i==null?void 0:i.length)>0&&i[0]>=1&&typeof n=="number"&&(o="dash",s=Math.ceil(i[0]));const c={borderRadiusList:[0,0,0,0],borderWidthList:[0,0,0,0],borderColor:r,borderType:o,boxSizing:a,borderDashNum:s};return typeof t=="number"?(c.borderRadius=t,c.borderRadiusList=[t,t,t,t]):Array.isArray(t)?c.borderRadiusList=[t[0]||0,t[1]||0,t[2]||0,t[3]||0]:c.borderRadius=0,typeof n=="number"?(c.borderWidth=n,c.borderWidthList=[n,n,n,n]):Array.isArray(n)?c.borderWidthList=[n[0]||0,n[1]||0,n[2]||0,n[3]||0]:c.borderWidth=0,c}const N_=e=>{var t,n;const{className:r,style:a,element:i,disabled:o,onChange:s}=e,c=A.useRef(null),{createPrefixName:d}=A.useContext(le),u=d(D_),f=u(),h=u("row"),p=u("col"),v=u("input"),g=u("form-item"),[m,b]=A.useState(Array.isArray((t=i==null?void 0:i.detail)===null||t===void 0?void 0:t.borderRadius)),[y,S]=A.useState(Array.isArray((n=i==null?void 0:i.detail)===null||n===void 0?void 0:n.borderWidth)),[x,C]=A.useState(y),E=ln(),j=z=>{var k,F;const U=_r(i),{borderColor:L,boxSizing:O,borderType:$,borderDashNum:R}=z,G={};if(L&&(G.borderColor=L),O&&(G.boxSizing=O),y===!0&&z.borderWidthList){const N=[0,0,0,0],D=Array.from((z==null?void 0:z.borderWidthList)||[null,null,null,null]);for(let w=0;w<4;w++){const P=D[w];typeof P=="number"?N[w]=P:N[w]=((k=U==null?void 0:U.borderWidthList)===null||k===void 0?void 0:k[w])||0,G.borderWidth=N}}else typeof z.borderWidth=="number"&&(G.borderWidth=z.borderWidth);if(m===!0&&z.borderRadiusList){const N=[0,0,0,0],D=Array.from((z==null?void 0:z.borderRadiusList)||[null,null,null,null]);for(let w=0;w<4;w++){const P=D[w];typeof P=="number"?N[w]=P:N[w]=((F=U==null?void 0:U.borderRadiusList)===null||F===void 0?void 0:F[w])||0,G.borderRadius=N}}else typeof z.borderRadius=="number"&&(G.borderRadius=z.borderRadius);y===!0?G.borderDash=[]:$==="solid"?G.borderDash=[]:$==="dash"?G.borderDash=[Zo,Zo]:R&&R>0&&(G.borderDash=[R,R]),s==null||s({detail:G})};return A.useEffect(()=>{var z,k,F;const U=Array.isArray((z=i==null?void 0:i.detail)===null||z===void 0?void 0:z.borderWidth),L=Array.isArray((k=i==null?void 0:i.detail)===null||k===void 0?void 0:k.borderRadius);S(U),b(L),C(U);const O=_r(i);(F=c.current)===null||F===void 0||F.setFieldsValue(O)},[i]),A.useMemo(()=>{const z=_r(i);return l.createElement(J,{ref:c,style:a,className:pe(f,r),onValuesChange:j},l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:16,className:p},y?l.createElement(Jt,{className:v,size:"small",prefix:l.createElement(fo,{style:{fontSize:14}}),disabled:!0,value:E.mixedBorderWidth}):l.createElement(J.Item,{className:g,name:"borderWidth"},l.createElement(se,{className:v,size:"small",min:0,placeholder:"Border Width",prefix:l.createElement(fo,{style:{fontSize:14}}),disabled:o||y}))),l.createElement(Q,{span:4,className:p},l.createElement(Ve,{icon:l.createElement(fo,null),size:"small",disabled:o,type:y?"primary":"default",onClick:()=>{var k;const F=!y;if(S(F),C(F),!F){const U=_r(i),L=U.borderWidth||((k=U.borderWidthList)===null||k===void 0?void 0:k[0])||0;j({borderWidth:L})}}}))),y&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",0]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(E3,null),disabled:o||!y,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",1]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(x3,null),disabled:o||!y,min:0})))),l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",2]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(b3,null),disabled:o||!y,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",3]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(w3,null),disabled:o||!y,min:0})))))),!["circle"].includes(i==null?void 0:i.type)&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:16,className:p},m?l.createElement(Jt,{className:v,size:"small",prefix:l.createElement(Ll,{style:{fontSize:14}}),disabled:!0,value:E.mixedBorderRadius}):l.createElement(J.Item,{className:g,name:"borderRadius"},l.createElement(se,{className:v,size:"small",placeholder:"Radius",prefix:l.createElement(Ll,{style:{fontSize:14}}),disabled:o||m||x,min:0}))),l.createElement(Q,{span:4,className:p},l.createElement(Ve,{icon:l.createElement(I3,null),size:"small",disabled:o||x,type:m?"primary":"default",onClick:()=>{var k;const F=!m;if(b(F),!F){const U=_r(i),L=U.borderRadius||((k=U.borderRadiusList)===null||k===void 0?void 0:k[0])||0;j({borderRadius:L})}}}))),m&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",0]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(A3,null),disabled:o||!m||x,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",1]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(_3,null),disabled:o||!m||x,min:0})))),l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",2]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(C3,null),disabled:o||!m||x,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",3]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(M3,null),disabled:o||!m||x,min:0})))))),l.createElement(he,{className:h},l.createElement(Q,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"boxSizing"},l.createElement(Ge,{size:"small",disabled:o},l.createElement(Ge.Option,{value:"border-box"},E.inside),l.createElement(Ge.Option,{value:"content-box"},E.outside),l.createElement(Ge.Option,{value:"center-line"},E.centerLine)))),l.createElement(Q,{className:p,span:"13"},l.createElement(J.Item,{className:g,name:"borderColor"},l.createElement(ji,{elementSize:i?yi(i):void 0,disabled:o,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(he,{className:h},l.createElement(Q,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"borderType"},l.createElement(Ge,{size:"small",disabled:o||y},l.createElement(Ge.Option,{value:"solid"},E.solid),l.createElement(Ge.Option,{value:"dash"},E.dash)))),l.createElement(Q,{className:p,span:"13"},z.borderType==="dash"&&l.createElement(J.Item,{className:g,name:"borderDashNum"},l.createElement(se,{disabled:o||y,className:v,size:"small",style:{width:"100%"},prefix:l.createElement(y3,{style:{fontSize:14}})})))))},[E,i,o,m,y,x])},j_="base-element-detail-circle",L_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),i=r(j_)();return A.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])};var k_=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{TextArea:B_}=Jt,F_="base-element-field-image-picker",{useCallback:Md}=l,H_=["image/png","image/jpeg","image/jpg","image/png"],W_=({value:e="",onChange:t})=>{const[n,r]=A.useState(e),[a,i]=A.useState("free"),{createPrefixName:o}=A.useContext(le),s=o(F_),c=s(),d=s("box"),u=s("entity"),f=s("action"),h=s("action-text"),p=s("action-upload"),v=Md(y=>{const S=y||"";let x=3,C=300;return S.length>128&&(x=10),{rows:x,width:C}},[n]),g=y=>{t==null||t(y||e)},m=y=>{r(y),At.imageSrc(y)&&g(y)},b=Md(()=>{a!=="picking"&&(Ko({success:y=>k_(void 0,void 0,void 0,function*(){if(H_.includes(y.file.type)!==!0){Ya.error(`File's type "${y.file.type}" is not supported!`);return}try{const S=yield kf(y.file);m(S.toString())}catch{Ya.error(`Failed to parse file ${y.file.name}`)}i("free")}),error:y=>{console.log(y),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return A.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("img",{className:u,src:e||n}),l.createElement("div",{className:f},l.createElement("div",{className:h},l.createElement(Od,{content:()=>l.createElement("div",null,l.createElement(B_,{value:e||n,style:{width:v(e||n).width},rows:v(e||n).rows,onChange:y=>{m(y.target.value||"")}})),trigger:"click"},l.createElement("span",{style:{display:"inline-block",width:"100%",height:"100%",lineHeight:"50px"}},"URL"))),l.createElement("div",{onClick:b,className:p},l.createElement("span",null,"Upload"))))),[e,n])},G_="base-element-detail-image",V_=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=A.useContext(le),u=c(G_)(),f=A.useRef(null),h=v=>{const{src:g=""}=(v==null?void 0:v.detail)||{};return{src:g,imageResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.imageResource){const{assetId:m}=o({type:"image",value:v.imageResource});m&&Qt(m)&&(g.src=m)}a==null||a({detail:g})};return A.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),A.useMemo(()=>l.createElement("div",{style:n,className:pe(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"imageResource"},l.createElement(W_,null)))),[r,s])},U_="base-element-detail-path",Y_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),i=r(U_)();return A.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])},X_="base-element-detail-rect",Z_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),i=r(X_)();return A.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])};var K_=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const Q_="base-element-field-svg-picker",J_=["image/svg+xml"];function q_(e){const t=document.createElement("div");return t.innerHTML=e,document.querySelector("svg").setAttribute("_t",Date.now()+""),{__html:t.innerHTML}}const e9=({value:e="",onChange:t})=>{const[n,r]=A.useState(e),[a,i]=A.useState("free"),{createPrefixName:o}=A.useContext(le),s=o(Q_),c=s(),d=s("box"),u=s("entity"),f=s("action");s("action-text");const h=s("action-upload"),p=m=>{t==null||t(m||e)},v=m=>{r(m),At.svg(m)&&p(m)},g=A.useCallback(()=>{a!=="picking"&&(Ko({success:m=>K_(void 0,void 0,void 0,function*(){if(J_.includes(m.file.type)!==!0){Ya.error(`File's type "${m.file.type}" is not supported!`);return}try{let b=(yield Bf(m.file)).toString();b=b.substring(b.indexOf("{console.log(m),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return A.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("div",{className:u,dangerouslySetInnerHTML:q_(e||n)}),l.createElement("div",{className:f},l.createElement("div",{onClick:g,className:h},l.createElement("span",null,"Upload"))))),[e,n])},t9="base-element-detail-svg",n9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=A.useContext(le),u=c(t9)(),f=A.useRef(null),h=v=>{const{svg:g=""}=(v==null?void 0:v.detail)||{};return{svg:g,svgResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.svgResource){const{assetId:m}=o({type:"svg",value:v.svgResource});m&&Qt(m)&&(g.svg=m)}a==null||a({detail:g})};return A.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),A.useMemo(()=>l.createElement("div",{style:n,className:pe(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"svgResource"},l.createElement(e9,null)))),[r,s])},r9="base-element-detail-text",yn={fontSize:20},{TextArea:a9}=Jt,wn=e=>At.number(e*1)?$e(e*1):e,i9=e=>{const{color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o,text:s=""}=(e==null?void 0:e.detail)||{};return{text:s,color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o}},o9=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=A.useContext(le),s=o(r9),c=s(),d=s("row"),u=s("col"),f=s("switch"),h=s("form-item"),p=A.useRef(null);A.useEffect(()=>{var g;const m=i9(r);(g=p.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(c,t)},l.createElement(J,{ref:p,style:n,className:c,onValuesChange:v},l.createElement(he,{className:d},l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"verticalAlign"},l.createElement(Xe.Group,{disabled:i,className:f,size:"small"},l.createElement(Xe.Button,{value:"top"},l.createElement(W3,{style:yn})),l.createElement(Xe.Button,{value:"middle"},l.createElement(H3,{style:yn})),l.createElement(Xe.Button,{value:"bottom"},l.createElement(F3,{style:yn}))))),l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"textAlign"},l.createElement(Xe.Group,{disabled:i,className:f,size:"small"},l.createElement(Xe.Button,{value:"left"},l.createElement(g3,{style:yn})),l.createElement(Xe.Button,{value:"center"},l.createElement(p3,{style:yn})),l.createElement(Xe.Button,{value:"right"},l.createElement(v3,{style:yn})))))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Text Color"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"color"},l.createElement(ji,{elementSize:r?yi(r):void 0,disabled:i,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Font Size"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontSize"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:wn,parser:wn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Font Weight"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontWeight"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:100,max:1e3,min:100,formatter:wn,parser:wn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Line Height"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"lineHeight"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:wn,parser:wn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"24",className:u},l.createElement(J.Item,{className:h,name:"text",style:{width:"100%"}},l.createElement(a9,{disabled:i,style:{width:"100%"},rows:3})))))),[n,t])},s9="base-element-detail-group",l9=e=>{const{overflow:t}=(e==null?void 0:e.detail)||{};return{overflow:t}},c9=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=A.useContext(le),s=o(s9),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=A.useRef(null),p=ln();A.useEffect(()=>{var g;const m=l9(r);(g=h.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(c,t)},l.createElement(J,{ref:h,style:n,className:c,onValuesChange:v},l.createElement(he,{className:d},l.createElement(Q,{className:u,span:"10"},p.overflow),l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:f,name:"overflow"},l.createElement(Ge,{size:"small",disabled:i},l.createElement(Ge.Option,{value:"visible"},p.visible),l.createElement(Ge.Option,{value:"hidden"},p.hidden))))))),[n,t,p])},d9="base-element-detail-attribute",u9=e=>{const{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}=e,{createPrefixName:o}=A.useContext(le),c=o(d9)();return A.useMemo(()=>l.createElement("div",{className:c},(t==null?void 0:t.type)==="circle"&&l.createElement(L_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="image"&&l.createElement(V_,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="svg"&&l.createElement(n9,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="group"&&l.createElement(c9,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="path"&&l.createElement(Y_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="rect"&&l.createElement(Z_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="text"&&l.createElement(o9,{element:t,onChange:n})),[r,t])},f9="base-element-content-attribute",h9=e=>{let{opacity:t}=(e==null?void 0:e.detail)||{};const{background:n}=(e==null?void 0:e.detail)||{};return typeof t=="number"&&t>=0&&t<=1||(t=1),{background:n,opacity:t}},p9=e=>{const{style:t,element:n,disabled:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,s=A.useRef(null),{createPrefixName:c}=A.useContext(le),d=c(f9),u=d(),f=d("row"),h=d("col"),p=d("form-item"),v=b=>{const y=b;a==null||a({detail:y})},g=b=>{a==null||a(b)},m=ln();return A.useEffect(()=>{var b;const y=h9(n);(b=s.current)===null||b===void 0||b.setFieldsValue(y)},[n]),A.useMemo(()=>l.createElement(l.Fragment,null,l.createElement(J,{ref:s,style:t,className:u,onValuesChange:v},["rect","circle","text","group","path"].includes(n==null?void 0:n.type)&&l.createElement(he,{className:f},l.createElement(Q,{className:h,span:"10"},m.background),l.createElement(Q,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"background"},l.createElement(ji,{elementSize:n?yi(n):void 0,disabled:r})))),l.createElement(he,{className:f},l.createElement(Q,{className:h,span:"10"},m.opacity),l.createElement(Q,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"opacity"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},step:.1}))))),l.createElement(u9,{element:n,disabled:r,onChange:g,getElementAsset:i,createElementAsset:o})),[m,n,r,a])},g9="base-element-shadow-attribute",v9=e=>{const{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}=(e==null?void 0:e.detail)||{};return{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}},m9=e=>{const{style:t,element:n,disabled:r,onChange:a}=e,i=A.useRef(null),{createPrefixName:o}=A.useContext(le),s=o(g9),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=v=>{const g=v;a==null||a({detail:g})},p=ln();return A.useEffect(()=>{var v;const g=v9(n);(v=i.current)===null||v===void 0||v.setFieldsValue(g)},[n]),A.useMemo(()=>l.createElement(J,{ref:i,style:t,className:c,onValuesChange:h},l.createElement(he,{className:d},l.createElement(Q,{className:u,span:"14"},l.createElement(J.Item,{className:f,name:"shadowColor"},l.createElement(ji,{elementSize:n?yi(n):void 0,disabled:r,disabledLinearGradient:!0,disabledRadialGradient:!0}))),l.createElement(Q,{className:u,span:"10"},l.createElement(J.Item,{className:f,name:"shadowBlur"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"}})))),l.createElement(he,null,l.createElement(Q,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetX"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},prefix:"X"}))),l.createElement(Q,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetY"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},prefix:"Y"}))))),[p,n,r])},b9="base-element-detail",y9=sn(),w9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,{createPrefixName:s}=A.useContext(le),c=s(b9),d=ln();let u=r;r&&(u=Object.assign(Object.assign({},r||{}),{detail:Object.assign(Object.assign({},y9),r==null?void 0:r.detail)}));const f=[{key:"basic-attribute",label:d.basicAttributes,children:l.createElement(Q3,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}})},{key:"border-attribute",label:d.borderAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(N_,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(aa,{image:aa.PRESENTED_IMAGE_SIMPLE,description:!1})},{key:"content-attribute",label:d.contentAttribute,children:l.createElement(p9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)},getElementAsset:i,createElementAsset:o})},{key:"shadow-attribute",label:d.shadowAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(m9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(aa,{image:aa.PRESENTED_IMAGE_SIMPLE,description:!1})}];return A.useMemo(()=>l.createElement("div",{style:n,className:pe(c(),t)},l.createElement(hf,{ghost:!0,items:f,size:"small",defaultActiveKey:f.map(h=>h.key)})),[u,d])},af=e=>{var t;const n={uuid:e.uuid,key:e.uuid,title:e.name||e.detail.text||e.type||"unamed",type:e.type,children:[],operations:e.operations||{}};return e.type==="group"&&Array.isArray((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.children)&&e.detail.children.forEach(r=>{n.children.push(af(r))}),n};function Ie(e){const t=[];return e.elements.forEach(n=>{const r=af(n);t.push(r)}),t}var x9=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a0){const r=pt(e,n.elements);(r==null?void 0:r.type)==="group"&&(r.detail.children=t.elements)}}const S9="dark",C9="en-US";function M9(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});let n=[],r=t;e!=null&&e.defaultEditingGroupUUID&&(n=tn(e.defaultEditingGroupUUID,t.elements)),r=er(n,t);const a=Ie(r);return{localeCode:(e==null?void 0:e.defaultLocale)||C9,themeMode:(e==null?void 0:e.defaultThemeMode)||S9,data:t,editingData:r,editingDataPosition:n,treeData:a,selectedUUIDs:(e==null?void 0:e.defaultSelectedElementUUIDs)||[],scaleInfo:Object.assign({scale:1,from:"init"},(e==null?void 0:e.defaultScaleInfo)||{})}}function A9(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});return{localeCode:"en-US",themeMode:(e==null?void 0:e.themeMode)||"light",data:Object.assign({elements:[]},(e==null?void 0:e.data)||{}),editingData:er([],t),editingDataPosition:[],treeData:[],selectedUUIDs:[],scaleInfo:Object.assign({scale:1,from:"control"},(e==null?void 0:e.scaleInfo)||{})}}function _9(e,t){var n,r;switch(t.type){case"update":return t!=null&&t.payload?Object.assign(Object.assign({},e),t==null?void 0:t.payload):e;case"updateThemeMode":return!((n=t==null?void 0:t.payload)===null||n===void 0)&&n.themeMode?Object.assign(Object.assign({},e),{themeMode:(r=t==null?void 0:t.payload)===null||r===void 0?void 0:r.themeMode}):e;default:return e}}const gr=A.createContext({state:A9(),dispatch:()=>{}}),O9=gr.Provider,T9={locale:"en-US",NavMenu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"},Toolbar:{layers:"Layers",ruler:"Ruler",attributes:"Attributes",hand:"Hand tool",centerContent:"Center content"},contextMenu:{copy:"Copy",paste:"Paste",cut:"Cut",delete:"Delete"}},$9={locale:"zh-CN",NavMenu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"},Toolbar:{layers:"图层",ruler:"标尺",attributes:"属性",hand:"拖拽工具",centerContent:"内容居中"},contextMenu:{copy:"复制",paste:"粘贴",cut:"剪切",delete:"删除"}},P9={"en-US":T9,"zh-CN":$9},Vs=e=>{const{state:t}=A.useContext(gr),n=t.localeCode;return[A.useMemo(()=>{const i=P9[n][e];return Object.assign({},i)},[n,e])]},I9="mod-toolbar",z9=()=>{const[e]=Vs("Toolbar");return e},R9=e=>{const{className:t,style:n,openLeftSider:r,openRightSider:a,onClickToggleLayer:i,onClickToggleSetting:o,sharedStore:s}=e,c={fontSize:16},{createPrefixName:d}=A.useContext(le),u=d(I9),f=u(),h=u("left"),p=u("right"),v=u("btn"),[g,m]=A.useState(!1),[b,y]=A.useState(!0),S=z9();A.useEffect(()=>{const C=s.get("idraw");C==null||C.reset({enableRuler:b,enableDrag:g,enableSelect:!g})},[g,b]);const x={size:"small",className:v,shape:"default"};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(f,t)},l.createElement("div",{className:h}),l.createElement("div",{className:p},l.createElement(vr,{title:S.layers},l.createElement(Ve,Object.assign({},x,{type:r?"primary":"default",icon:l.createElement(z3,{style:c}),onClick:i}))),l.createElement(vr,{title:S.attributes},l.createElement(Ve,Object.assign({},x,{type:a?"primary":"default",icon:l.createElement(k3,{style:c}),onClick:o}))),l.createElement(vr,{title:S.ruler},l.createElement(Ve,Object.assign({},x,{type:b?"primary":"default",icon:l.createElement(L3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{y(!b)}}))),l.createElement(vr,{title:S.hand},l.createElement(Ve,Object.assign({},x,{type:g?"primary":"default",icon:l.createElement(P3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{m(!g)}}))),l.createElement(vr,{title:S.centerContent},l.createElement(Ve,Object.assign({},x,{type:"text",icon:l.createElement(h3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{const C=s.get("idraw");C==null||C.centerContent()}}))))),[r,a,i,o,g,b,S])},D9="mod-panel-layer",N9=e=>{const{className:t,style:n,height:r,defaultSelectedElementUUIDs:a=[],sharedStore:i,sharedEvent:o,useContextMenuOptions:s}=e,{state:c,dispatch:d}=A.useContext(gr),{createPrefixName:u}=A.useContext(le),f=u(D9),{treeData:h,selectedUUIDs:p,editingData:v}=c,g=A.useRef(null),[m,b]=A.useState(a),y=f(),S=f("content"),x=f("header"),C=f("header","title"),E=f("header","btn"),[j]=s({sharedEvent:o,sharedStore:i}),z=()=>{if(c.editingDataPosition.length===0)return"";const L=pt(c.editingDataPosition,c.data.elements);return(L==null?void 0:L.name)||(L==null?void 0:L.type)||""},k=L=>{const O=i.get("idraw");O==null||O.selectElementsByPositions(L)};A.useEffect(()=>{o.on("scrollToLayer",({uuid:L})=>{var O;L&&((O=g.current)===null||O===void 0||O.scrollTo({key:L,align:"top"}))})},[]),A.useEffect(()=>{if(p[0]&&p.length===1){const O=Gd(p[0],v.elements).map(R=>R.uuid);p[0]&&O.push(p[0]);const $=[...m];O.forEach(R=>{$.includes(R)||$.push(R)}),b($)}},[p,v]);const F=()=>{o.trigger("resetEditingView",{type:"back-root",position:null})},U=()=>{o.trigger("resetEditingView",{type:"back-one",position:null})};return A.useMemo(()=>Array.isArray(h)&&h.length>0?l.createElement("div",{style:n,className:pe(y,t),onContextMenu:L=>{L.preventDefault()}},l.createElement("div",{className:x},l.createElement(Ve,{className:E,size:"small",icon:l.createElement($3,null),disabled:!(c.editingDataPosition.length>0),onClick:F}),l.createElement(Ve,{className:E,size:"small",icon:l.createElement(R3,null),disabled:!(c.editingDataPosition.length>0),onClick:U}),l.createElement("span",{className:C},z())),l.createElement(vi,{menu:{items:j},trigger:["contextMenu"]},l.createElement("div",{className:S},l.createElement(U3,{ref:g,height:r,treeData:h,selectedKeys:p,expandedKeys:m,onTitleChange:({uuid:L,value:O})=>{Hr(L,{name:O},c.editingData.elements);const $=Ie(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:$}})},onOperationToggle:({uuid:L,operations:O})=>{Hr(L,{operations:O},c.editingData.elements);const $=Ie(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:$}})},onSelect:L=>{p!=null&&p.includes(L.uuids[0])||k(L.positions)},onDrop:L=>{const{elements:O}=qd(v.elements,{from:L.from,to:L.to}),$=pt(L.to,v.elements);$&&($.x=0,$.y=0);const R=Ie(v);d({type:"update",payload:{editingData:Object.assign(Object.assign({},v),{elements:[...O]}),treeData:R}})},onDelete:({uuid:L})=>{o.trigger("deleteElement",{uuid:L})},onGoToGroup:L=>{o.trigger("resetEditingView",{type:"go-to-group",position:L.position})},onExpand:(L,{node:O})=>{const $=O.key;if($){let R=[...m];m.includes($)?R.splice(R.indexOf($),1):R=[...R,$],b(R)}}})))):l.createElement("div",{style:n,className:pe(y,t),onContextMenu:L=>{L.preventDefault()}},l.createElement("div",{className:x},"..."),l.createElement("div",{className:S},l.createElement("div",{style:{padding:"20px 0",textAlign:"center"}},"Empty"))),[h,p,m,v.elements,c.editingDataPosition,j])},j9="mod-panel-detail",L9=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),{state:a,dispatch:i}=A.useContext(gr),o=r(j9),{selectedUUIDs:s,editingData:c}=a,d=o(),u=A.useCallback(v=>{if((s==null?void 0:s.length)===1&&s[0]){const g=s[0];Hr(g,v,c.elements),i({type:"update",payload:{editingData:Object.assign({},c)}})}},[c,s]),f=A.useCallback(v=>(s==null?void 0:s.length)>1?null:Wd(v,c.elements),[c,s[0]]),h=A.useCallback(v=>{var g,m;let b=null;return v&&Qt(v)&&(b=((m=(g=c.assets)===null||g===void 0?void 0:g[v])===null||m===void 0?void 0:m.value)||null),b},[c,s[0]]),p=A.useCallback(v=>{const g=nr(v.value);return c.assets||(c.assets={}),c.assets[g]=v,{assetId:g,assetItem:v}},[c,s[0]]);return A.useMemo(()=>{const v=f(s[0]);return l.createElement("div",{style:n,className:pe(d,t),onContextMenu:g=>{g.preventDefault()}},l.createElement(w9,{element:v,onChange:u,getElementAsset:h,createElementAsset:p}))},[s[0]])},k9="mod-export-image-file",Us=700,B9=Us+48,Nr=500,F9=Us-Nr,wa={devicePixelRatio:1,fileName:"download.png"},H9=e=>{const{className:t,style:n,sharedStore:r}=e,{createPrefixName:a}=A.useContext(le),i=a(k9),o=i(),s=i("preview"),c=i("options"),d=i("canvas"),[u,f]=A.useState(null),[h,p]=A.useState(!0),[v,g]=A.useState(null),[m]=J.useForm(),b=A.useCallback(S=>{const x=r.get("idraw");x&&(p(!0),x.getImageBlobURL({devicePixelRatio:S}).then(({blobURL:C,width:E,height:j,devicePixelRatio:z})=>{C&&(g(C),f({width:E,height:j,devicePixelRatio:z}))}).catch(C=>{console.log(C)}).finally(()=>{p(!1)}))},[]);A.useEffect(()=>{m.setFieldsValue({devicePixelRatio:wa.devicePixelRatio,fileName:wa.fileName}),setTimeout(()=>{b(wa.devicePixelRatio)},10)},[]);const y=()=>{if(!v)return;const S=m.getFieldsValue(),x=document.createElement("a");x.href=v,x.download=S.fileName||wa.fileName,document.body.appendChild(x),x.click(),document.body.removeChild(x)};return A.useMemo(()=>l.createElement("div",{style:Object.assign(Object.assign({},n),{width:Us}),className:pe(o,t)},l.createElement(pf,{tip:"Loading...",spinning:h},l.createElement("div",{className:s,style:{width:Nr,height:Nr*3/4}},v&&l.createElement("img",{className:d,style:{maxWidth:Nr,maxHeight:Nr*3/4},src:v}))),l.createElement("div",{className:c,style:{width:F9}},l.createElement("div",{style:{marginBottom:6}},"Width: ",u==null?void 0:u.width),l.createElement("div",null,"Height: ",u==null?void 0:u.height),l.createElement(gf,null),l.createElement("div",null,l.createElement(J,{form:m,layout:"vertical",onValuesChange:S=>{S.devicePixelRatio>0&&setTimeout(()=>{b(S.devicePixelRatio)},10)},disabled:h},l.createElement(J.Item,{label:"Device pixel ratio",name:"devicePixelRatio"},l.createElement(Ge,{size:"small",options:[1,2,3,4].map(S=>({label:`x${S}`,value:S}))})),l.createElement(J.Item,{label:"File name",name:"fileName"},l.createElement(Jt,{size:"small",placeholder:"File name"})),l.createElement(Ve,{type:"primary",onClick:y,disabled:h||!v,loading:h},"Download"))))),[u,h,v,b])};var W9=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function G9(e){return new Promise(function(t,n){const r=new FileReader;r.onload=function(){t(r)},r.onerror=n,e.type==="application/json"?r.readAsText(e):r.readAsArrayBuffer(e)})}function V9(e){Ko({accept:"application/json",success:t=>W9(this,void 0,void 0,function*(){var n,r,a;const o=(yield G9(t.file)).result;if(typeof o=="string")try{const s=JSON.parse(o);(n=e==null?void 0:e.success)===null||n===void 0||n.call(e,{json:s})}catch(s){(r=e==null?void 0:e.error)===null||r===void 0||r.call(e,s)}else(a=e==null?void 0:e.error)===null||a===void 0||a.call(e,Error("ERROR_PICK_FILE_FAIL"))}),error:e==null?void 0:e.error})}const U9=()=>{const[e]=Vs("NavMenu");return e},Y9="mod-nav-menu",X9=e=>{const{className:t,style:n,sharedStore:r,sharedEvent:a}=e,[i,o]=vf.useModal(),{createPrefixName:s}=A.useContext(le),c=s(Y9),d=c(),u=c("dropdown"),[f,h]=A.useState([]),p=U9(),v=({key:x,domEvent:C})=>{C.preventDefault(),a.trigger("createElement",{type:x,element:{name:x}})},g=x=>{const C=r.get("idraw");C==null||C.resize({devicePixelRatio:x})},m={more:[{key:"about-idraw-stuido",label:p.about,disabled:!0},{key:"line",type:"divider"},{key:"file",label:p.file,children:[{key:"import-json-file",label:p.importJSONFile,onClick:()=>{V9({success:({json:x})=>{a.trigger("resetData",{data:x})},error:()=>{}})}},{key:"export-image",label:p.exportImage,onClick:()=>{i.info({icon:null,title:"Whole image file",width:B9,content:l.createElement(H9,{sharedEvent:a,sharedStore:r}),footer:null,closable:!0})}},{key:"export-json-file",label:p.exportJSONFile,onClick:()=>{const x=r.get("idraw"),C=x==null?void 0:x.getData({compact:!0});if(C){const E=JSON.stringify(C);Hf(E,{fileName:"downdown.json"})}}}]},{key:"preferences",label:p.preferences,children:[{key:"device-pixel-ratio",label:p.devicePixelRatio,type:"group",children:[{key:"device-pixel-ratio-x1",label:"x1",onClick:()=>{g(1)}},{key:"device-pixel-ratio-x2",label:"x2",onClick:()=>{g(2)}},{key:"device-pixel-ratio-x3",label:"x3",onClick:()=>{g(3)}}]}]}],element:[{key:"rect",label:p.rect,icon:l.createElement(_u,null),onClick:v},{key:"circle",label:p.circle,icon:l.createElement(Ou,null),onClick:v},{key:"text",label:p.text,icon:l.createElement(Tu,null),onClick:v},{key:"image",label:p.image,icon:l.createElement(Iu,null),onClick:v},{key:"svg",label:p.svg,icon:l.createElement(Pu,null),onClick:v},{key:"html",label:p.html,disabled:!0,icon:l.createElement(zu,null),onClick:v},{key:"group",label:p.group,icon:l.createElement($u,null),onClick:v}]},b={size:"small",type:"text"},y=[{key:"more",button:l.createElement(D3,{style:{fontSize:20}})},{key:"element",button:l.createElement(m3,{style:{fontSize:20}})}],S=()=>{const x=r.get("idraw"),C=[];if(x){const{viewSizeInfo:E}=x.getViewInfo(),{devicePixelRatio:j}=E;C.push(`device-pixel-ratio-x${j}`)}h(C)};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(d,t)},y.map((x,C)=>l.createElement(vi,{key:C,trigger:["click","click"],menu:{items:m[x.key]||[],selectedKeys:f},placement:"bottom",overlayClassName:u,onOpenChange:E=>{E===!0&&S()}},l.createElement(Ve,Object.assign({},b,{onClick:E=>E.preventDefault()}),l.createElement(mf.Compact,null,x.button,l.createElement(Du,{style:{fontSize:10,marginLeft:4}}))))),o),[f,p])},Z9="mod-header",K9=e=>{const{logo:t,navigationMenu:n,navigationCenter:r,className:a,style:i,openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f}=e,{state:h,dispatch:p}=A.useContext(gr),{createPrefixName:v}=A.useContext(le),g=v(Z9),m=g(),b=g("left"),y=g("right"),S=g("center"),x=g("locale"),C=g("scale"),E=g("switch"),{localeCode:j,scaleInfo:z}=h;return A.useMemo(()=>l.createElement("div",{style:i,className:pe(m,a)},l.createElement("div",{className:b},t,n||l.createElement(X9,{sharedStore:u,sharedEvent:f}),l.createElement(R9,{openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f})),r&&l.createElement("div",{className:S},r),l.createElement("div",{className:y},l.createElement(i3,{className:C,value:`${$e(z.scale)}`,onChange:k=>{const F=parseFloat(k);F>0&&(p==null||p({type:"update",payload:{scaleInfo:{scale:$e(F),from:"control"}}}))}}),l.createElement(Lf,{className:x,value:j,onChange:k=>{p==null||p({type:"update",payload:{localeCode:k}})}}),l.createElement(Nf,{className:E,theme:h==null?void 0:h.themeMode,onChange:({theme:k})=>{p==null||p({type:"updateThemeMode",payload:{themeMode:k}})}}))),[j,z,o,s,c,d])},Q9="mod-sketch",J9=e=>{const t=A.useRef(null),n=A.useRef(null),r=A.useRef(!1),{className:a,style:i,width:o,height:s,sharedEvent:c,sharedStore:d,useContextMenuOptions:u}=e,{generateClassName:f}=A.useContext(le),{state:h,dispatch:p}=A.useContext(gr),{editingData:v}=h,g=f(Q9),m=A.useRef([]),b=A.useRef(h.editingData),y=A.useRef(h.data),S=A.useRef([]),[x]=u({sharedEvent:c,sharedStore:d});return A.useEffect(()=>{m.current=[...h.editingDataPosition],y.current=h.data,b.current=h.editingData,S.current=[...h.selectedUUIDs]},[h.editingDataPosition,h.data,h.editingData,h.selectedUUIDs]),A.useEffect(()=>{if(!(t!=null&&t.current)||n!=null&&n.current)return;const C={width:o,height:s,devicePixelRatio:window.devicePixelRatio},E=new n3(t.current,C);n.current=E;const j=N=>{const D=b.current;let{uuids:w}=N;const{positions:P}=N;P&&Array.isArray(P)&&(w=Vd(P,D.elements).map(M=>M.uuid)),p({type:"update",payload:{selectedUUIDs:w}})},z=N=>{const{data:D,type:w}=N,P=b.current;if(["addElement","updateElement","deleteElement","moveElement","dragElement","resizeElement"].includes(w)){const V={editingData:Object.assign({},D)};["addElement","deleteElement","moveElement"].includes(w)&&(V.treeData=Ie(P)),p({type:"update",payload:V})}},k=N=>{const{scale:D}=N;p({type:"update",payload:{scaleInfo:{scale:D,from:"event"}}})},F=N=>{const{element:D}=N;E.updateElement(D);const w=Object.assign({},E.getData()),P=Ie(w);p({type:"update",payload:{editingData:Object.assign({},w),treeData:P}})},U=N=>{const{type:D,element:w}=N,P=E.createElement(D,{element:w,viewCenter:!0});let V=E.getViewCenter();const M=S.current;let Y=[];const H=E.getData();if(Array.isArray(M)&&M.length===1){const I=M[0],B=tn(I,H.elements);let ee=pt(B,H.elements);if(B.length>1){Y=[...B];let ut=Y.pop();ut+=1;const It=[...Y];Y.push(ut),ee=pt(It,H.elements),V=vt(ee),P.x=V.x-P.w/2,P.y=V.y-P.h/2}}const _=E.addElement(P,{position:Y}),T=Ie(_);p({type:"update",payload:{editingData:Object.assign({},_),treeData:T}}),E.selectElements([P.uuid])},L=N=>{const{element:D,position:w=[]}=N;let P=E.getViewCenter();const V=S.current;let M=w;const Y=E.getData();if(Array.isArray(V)&&V.length===1){const T=V[0],I=tn(T,Y.elements),B=pt(I,Y.elements);I.length>0&&(B==null?void 0:B.type)==="group"&&Array.isArray(B.detail.children)&&(M=[...I],M.push(B.detail.children.length),P=vt(B))}const H=E.addElement(Object.assign(Object.assign({},D),{x:P.x-D.w/2,y:P.y-D.h/2}),{position:M}),_=Ie(H);p({type:"update",payload:{editingData:Object.assign({},H),treeData:_}}),E.selectElements([D.uuid])},O=N=>{const{uuid:D}=N;E==null||E.deleteElement(D);const w=E==null?void 0:E.getData();if(w){const P=Ie(w);p({type:"update",payload:{editingData:Object.assign({},w),treeData:P}}),E.trigger(Se.clearSelect,{})}},$=N=>{const{type:D,position:w}=N,P=n==null?void 0:n.current;if(!P)return;const V=m.current,M=y.current,Y=b.current;if(V.length>0&&E9(V,Y,M),D==="go-to-group"&&w){const H=[...V,...w],_=er(H,M),T=Ie(_);p({type:"update",payload:{data:Object.assign({},M),editingData:Object.assign({},_),editingDataPosition:H,treeData:T}}),P.centerContent({data:_}),P.trigger(Se.clearSelect,{})}else if(D==="back-one"&&V.length>0){const H=[...V];H.pop();const _=er(H,M),T=Ie(_);p({type:"update",payload:{data:Object.assign({},M),editingData:Object.assign({},_),editingDataPosition:[...H],treeData:T}}),P.centerContent({data:_}),P.trigger(Se.clearSelect,{})}else if(D==="back-root"){const H=[],_=er(H,M),T=Ie(_);p({type:"update",payload:{data:Object.assign({},M),editingData:_,editingDataPosition:H,treeData:T}}),P.centerContent({data:_}),P.trigger(Se.clearSelect,{})}},R=N=>{const{data:D}=N,w=[],P=er(w,D),V=Ie(P);p({type:"update",payload:{data:Object.assign({},D),editingData:Object.assign({},P),editingDataPosition:w,treeData:V}}),E.setViewScale({scale:1,offsetX:0,offsetY:0}),E.trigger(Se.clearSelect,{})},G=N=>{const{editingData:D}=N,w=Ie(D);p({type:"update",payload:{editingData:Object.assign({},D),treeData:w}}),E.trigger(Se.clearSelect,{})};if(E.on(Se.select,j),E.on(Se.change,z),E.on(Se.scale,k),E.on(Se.textChange,F),c.on("createElement",U),c.on("addElement",L),c.on("deleteElement",O),c.on("resetEditingView",$),c.on("resetData",R),c.on("resetEditingData",G),c.on("dispatch",p),!r.current){if(h.scaleInfo){const{scale:N,offsetX:D,offsetY:w}=h.scaleInfo;N&&D&&w&&E.setViewScale({scale:N,offsetX:D,offsetY:w})}r.current=!0}return d.set("idraw",E),()=>{r.current=!1,E.off(Se.select,j),E.off(Se.change,z),E.off(Se.scale,k),E.off(Se.textChange,F),d.set("idraw",null)}},[]),A.useEffect(()=>{n!=null&&n.current&&n.current.setData(v)},[v]),A.useEffect(()=>{if(n!=null&&n.current){const C=n.current;h.scaleInfo.from==="control"&&C.scale({scale:h.scaleInfo.scale,point:{x:o/2,y:s/2}})}},[h.scaleInfo]),A.useEffect(()=>{const C=n.current,E=t.current;C&&C.resize({width:o,height:s}),E&&(E.style.width=`${o}px`,E.style.height=`${s}px`)},[o,s]),A.useMemo(()=>l.createElement(vi,{menu:{items:x},trigger:["contextMenu"]},l.createElement("div",{ref:t,className:pe(g,a),style:Object.assign(Object.assign({},i),{width:o,height:s,padding:0})})),[x])},q9="mod-dashboard",xa=240,Ea=240,Or=36,eO=A.forwardRef((e,t)=>{const{className:n,style:r,width:a,height:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,sharedStore:u,sharedEvent:f,useContextMenuOptions:h,handleKeyboard:p}=e,{createPrefixName:v}=A.useContext(le),g=v(q9),[m,b]=A.useState(!0),[y,S]=A.useState(!0);A.useEffect(()=>{const E=j=>{["INPUT","TEXTAREA"].includes(j.target.nodeName)||p(j,{sharedEvent:f,sharedStore:u})};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E)}},[]);const[x,C]=A.useState({leftWidth:m?xa:0,rightWidth:y?Ea:0,centerWidth:a-(m?xa:0)-(y?Ea:0)});return A.useEffect(()=>{const E=m?xa:0,j=y?Ea:0,z=a-E-j;C({leftWidth:E,rightWidth:j,centerWidth:z})},[i,a,m,y]),A.useMemo(()=>{const{leftWidth:E,rightWidth:j,centerWidth:z}=x;return l.createElement("div",{ref:t,className:pe(g(),n),style:Object.assign(Object.assign({},r),{width:a,height:i,padding:0})},l.createElement("div",{className:g("header"),style:{height:Or}},l.createElement(K9,{sharedEvent:f,sharedStore:u,logo:o,navigationMenu:s,navigationCenter:c,openLeftSider:m,openRightSider:y,onClickToggleLayer:()=>{const k=!m;let F=E;k?F=xa:F=0,C({leftWidth:F,rightWidth:j,centerWidth:a-F-j}),b(k)},onClickToggleSetting:()=>{const k=!y;let F=j;k?F=Ea:F=0,C({leftWidth:E,rightWidth:F,centerWidth:a-E-F}),S(k)}})),l.createElement("div",{className:g("content"),style:{top:Or}},l.createElement(Za,{split:"vertical",defaultSize:z+j,allowResize:!0,onChange:k=>{const F=a-k,U=k-j;U<100||C({leftWidth:F,rightWidth:j,centerWidth:U})},pane1Style:{width:E},pane2Style:{width:z+j}},l.createElement("div",null,m&&l.createElement(N9,{height:i-Or,className:g("left"),defaultSelectedElementUUIDs:d,sharedEvent:f,sharedStore:u,useContextMenuOptions:h})),l.createElement("div",{style:{width:x.centerWidth+x.rightWidth,display:"flex",flexDirection:"row"}},l.createElement(J9,{className:g("center"),width:z,height:i-Or,sharedStore:u,sharedEvent:f,useContextMenuOptions:h}),l.createElement("div",{className:g("right"),style:{width:j,height:i-Or}},l.createElement(L9,null))))))},[n,m,y,x,i])});function Ad(){return{idraw:null,clipboard:{type:"default",data:null},selectedUUIDs:[]}}function tO(e){const{sharedEvent:t,sharedStore:n}=e;t.on("copy",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=Aa(a,i.elements);o.length>0&&n.set("clipboard",{type:"copy-elements",data:o})}}),t.on("paste",()=>{const r=n.get("idraw"),a=n.get("clipboard"),i=n.get("selectedUUIDs");if(r&&["copy-elements","cut-elements"].includes(a==null?void 0:a.type)&&Array.isArray(a.data)){const o=a.data,s=[];if(a.type==="copy-elements"){for(let h=0;h0&&d[d.length-1]++,s.forEach(h=>{r.addElement(h,{position:d})});const u=r==null?void 0:r.getData(),f=Ie(u);t.trigger("dispatch",{type:"update",payload:{editingData:u,treeData:f}}),r.selectElement(s[0].uuid),setTimeout(()=>{t.trigger("scrollToLayer",{uuid:s[0].uuid})},100)}}),t.on("cut",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const c=Aa(a,i.elements);c.length>0&&n.set("clipboard",{type:"cut-elements",data:c.map(d=>Bi(d))}),c.forEach(d=>{r==null||r.deleteElement(d.uuid)})}const o=r==null?void 0:r.getData(),s=Ie(o);t.trigger("dispatch",{type:"update",payload:{editingData:o,treeData:s}}),r==null||r.trigger(Se.clearSelect)}),t.on("delete",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=Aa(a,i.elements);if(o.length>0){for(let d=0;d{const[t]=Vs("contextMenu"),{sharedEvent:n}=e;return[[{label:t.copy,key:"copy",onClick:()=>{n.trigger("copy")}},{label:t.paste,key:"paste-here",onClick:()=>{n.trigger("paste")}},{label:t.cut,key:"cut",onClick:()=>{n.trigger("cut")}},{label:t.delete,key:"delete",onClick:()=>{n.trigger("delete")}}]]};var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});var rO=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ho={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},of={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:rO?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Ys={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var Sa=1;Sa<20;Sa++)Ys["f"+Sa]=111+Sa;function Li(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(o){return sf(o,t)}),a=function(s){return r.some(function(c){return lf(c,s)})},i=n==null?a:a(n);return i}function aO(e,t){return Li(e,t)}function iO(e,t){return Li(e,{byKey:!0},t)}function sf(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var o in ho)r[ho[o]]=!1;var s=!0,c=!1,d=void 0;try{for(var u=a[Symbol.iterator](),f;!(s=(f=u.next()).done);s=!0){var h=f.value,p=h.endsWith("?")&&h.length>1;p&&(h=h.slice(0,-1));var v=Xs(h),g=ho[v];if(h.length>1&&!g&&!of[h]&&!Ys[v])throw new TypeError('Unknown modifier: "'+h+'"');(i===1||!g)&&(n?r.key=v:r.which=cf(h)),g&&(r[g]=p?null:!0)}}catch(m){c=!0,d=m}finally{try{!s&&u.return&&u.return()}finally{if(c)throw d}}return r}function lf(e,t){for(var n in e){var r=e[n],a=void 0;if(r!=null&&(n==="key"&&t.key!=null?a=t.key.toLowerCase():n==="which"?a=r===91&&t.which===93?91:t.which:a=t[n],!(a==null&&r===!1)&&a!==r))return!1}return!0}function cf(e){e=Xs(e);var t=Ys[e]||e.toUpperCase().charCodeAt(0);return t}function Xs(e){return e=e.toLowerCase(),e=of[e]||e,e}var xn=Pt.default=Li;Pt.isHotkey=Li;Pt.isCodeHotkey=aO;Pt.isKeyHotkey=iO;Pt.parseHotkey=sf;Pt.compareHotkey=lf;Pt.toKeyCode=cf;Pt.toKeyName=Xs;const oO=(e,t)=>{const{sharedEvent:n}=t;xn("mod+c",e)?n.trigger("copy",void 0):xn("mod+v",e)?n.trigger("paste",void 0):xn("mod+x",e)?n.trigger("cut",void 0):xn("del",e)||xn("backspace",e)?n.trigger("delete",void 0):xn("mod+s",e)&&console.log("Save ... ")},cO=l.forwardRef((e,t)=>{const{width:n=1e3,height:r=600,style:a,className:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,prefiexName:u,onEditGroupElement:f,useContextMenuOptions:h=nO,handleKeyboard:p=oO}=e,[v,g]=A.useReducer(_9,M9(e)),m=A.useRef(null),b=A.useRef(new en),y=A.useRef(new Fr({defaultStorage:Ad()}));return A.useEffect(()=>{const S=pt(v.editingDataPosition,v.data.elements);f==null||f({uuid:S==null?void 0:S.uuid,position:[...v.editingDataPosition]})},[v.editingDataPosition]),A.useImperativeHandle(t,()=>({getSharedEvent(){return b.current},getSharedStore(){return y.current},dispatch(x){const{type:C,payload:E}=x;g({type:C,payload:E})}}),[]),A.useEffect(()=>(b.current||(b.current=new en),y.current||(y.current=new Fr({defaultStorage:Ad()})),tO({sharedEvent:b.current,sharedStore:y.current}),()=>{var S,x;(S=y.current)===null||S===void 0||S.clear(),(x=b.current)===null||x===void 0||x.destroy(),b.current=null,y.current=null}),[]),A.useEffect(()=>{const S=y.current;S&&S.set("selectedUUIDs",[...v.selectedUUIDs])},[v.selectedUUIDs]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("switchTheme",{theme:v.themeMode})},[v.themeMode]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("changeLocale",{locale:v.localeCode})},[v.localeCode]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("trackDataChange",{data:v.data})},[v.data]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("trackEditingDataChange",{editingData:v.editingData,editingDataPosition:v.editingDataPosition})},[v.editingData,v.editingDataPosition]),A.useMemo(()=>l.createElement(Ef,{localeCode:v.localeCode,container:m.current,topPrefix:u,themeMode:v.themeMode},l.createElement(O9,{value:{state:v,dispatch:g}},l.createElement(eO,{logo:o,navigationMenu:s,navigationCenter:c,ref:m,width:n,height:r,style:a,className:i,defaultSelectedElementUUIDs:d,sharedEvent:b.current,sharedStore:y.current,useContextMenuOptions:h,handleKeyboard:p}))),[u,n,r,v,g,m])});export{cO as S}; diff --git a/docs/js/lib/draw.tfoU9ZAP.js b/docs/js/lib/draw.tfoU9ZAP.js deleted file mode 100644 index 8d8c9cb..0000000 --- a/docs/js/lib/draw.tfoU9ZAP.js +++ /dev/null @@ -1,52 +0,0 @@ -import{r as M,R as l,e as na,g as of}from"./react.dwzOUFZb.js";import{c as pe,A as sf,t as Ys,S as Cd,a as We,I as se,D as fi,B as Ge,b as Kn,T as lf,F as J,R as he,C as Q,d as Ye,P as Md,m as Ga,E as ra,e as cf,f as fr,g as df,h as uf,M as ff,i as hf}from"./antd.mAE7kg8m.js";let hi="idraw-studio";function Xs(e){hi=e}function Zs(){return hi}function Ad(e){return(...t)=>[hi,e,...t].join("-")}function Va(...e){return[hi,...e].join("-")}const pf={locale:"en-US",Header:{},ElementDetail:{basicAttributes:"Basic",borderAttribute:"Border",contentAttribute:"Content",shadowAttribute:"Shadow",x:"X",y:"Y",w:"W",h:"H",background:"Background",solid:"Solid",dash:"Dash",inside:"Inside",outside:"Outside",centerLine:"Center",gradient:"Gradient",opacity:"Opacity",mixedBorderWidth:"Mixed",mixedBorderRadius:"Mixed",overflow:"Overflow",hidden:"Hidden",visible:"Visible",deepResizeInGroup:"Deep resize in group"},Menu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"}},gf={locale:"zh-CN",Header:{},ElementDetail:{basicAttributes:"基础",borderAttribute:"边框",contentAttribute:"内容",shadowAttribute:"阴影",x:"X",y:"Y",w:"宽",h:"高",background:"背景色",solid:"实线",dash:"虚线",inside:"内线",outside:"外线",centerLine:"中线",gradient:"渐变",opacity:"透明度",mixedBorderWidth:"混合边框",mixedBorderRadius:"混合圆角",overflow:"溢出",hidden:"隐藏",visible:"可视",deepResizeInGroup:"组内尺寸关联调整"},Menu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"}},Ks={"en-US":pf,"zh-CN":gf},fo="en-US",vf=e=>{const{localeCode:t}=M.useContext(le);return[M.useMemo(()=>{const a=(Ks[t||fo]||Ks[fo])[e];return Object.assign({},a)},[t,e])]},mf=e=>{const{themeMode:t}=e,n="theme",r=Va(n),a=Va(n,"dark"),i=pe({[r]:!0,[a]:t==="dark"});return{themeMode:t,className:i}},_d=e=>(e!=null&&e.topPrefix&&typeof(e==null?void 0:e.topPrefix)=="string"&&Xs(e.topPrefix),Object.assign({topPrefix:Zs(),createPrefixName:Ad,generateClassName:Va,getClassNameTopPrefix:Zs,setClassNameTopPrefix:Xs,localeCode:fo},e||{})),le=M.createContext(_d()),bf=e=>{const{children:t,topPrefix:n,localeCode:r,container:a,themeMode:i}=e,o=_d({topPrefix:n,localeCode:r}),[s,c]=M.useState(o),{className:d}=mf({themeMode:i});return M.useEffect(()=>{c(Object.assign(Object.assign({},s),{localeCode:r,container:a}))},[r,a]),l.createElement(le.Provider,{value:Object.assign({},s)},l.createElement(sf,{theme:{algorithm:i==="dark"?Ys.darkAlgorithm:Ys.defaultAlgorithm}},l.createElement("div",{className:d},t)))};class Qs extends l.PureComponent{render(){const{children:t,className:n,split:r,style:a,size:i,eleRef:o}=this.props,s=["Pane",r,n];let c={flex:1,position:"relative",outline:"none"};return i!==void 0&&(r==="vertical"?c.width=i:(c.height=i,c.display="flex"),c.flex="none"),c=Object.assign({},c,a||{}),l.createElement("div",{ref:o,className:s.join(" "),style:c},t)}}const yf="base-split-pane",wf=()=>{const{generateClassName:e}=M.useContext(le);return{modClassName:e(yf)}};function xf(e){const{modClassName:t}=wf(),{className:n,onClick:r,onDoubleClick:a,onMouseDown:i,onTouchEnd:o,onTouchStart:s,resizerClassName:c=t,split:d,style:u}=e,f=[c,d,n];return M.useMemo(()=>l.createElement("span",{role:"presentation",className:f.join(" "),style:u,onMouseDown:h=>i(h),onTouchStart:h=>{h.preventDefault(),s(h)},onTouchEnd:h=>{h.preventDefault(),o(h)},onClick:h=>{r&&(h.preventDefault(),r(h))},onDoubleClick:h=>{a&&(h.preventDefault(),a(h))}}),[])}const Ef="xxxxx";function Js(e,t){if(e.selection)e.selection.empty();else try{t.getSelection().removeAllRanges()}catch{}}function qs(e,t,n,r){if(typeof r=="number"){const a=typeof t=="number"?t:0,i=typeof n=="number"&&n>=0?n:1/0;return Math.max(a,Math.min(i,r))}return e!==void 0?e:t}function Sf(e){return l.Children.toArray(e).filter(t=>t)}class Ua extends l.Component{constructor(t){super(t),this.onMouseDown=this.onMouseDown.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this);const{size:n,defaultSize:r,minSize:a,maxSize:i,primary:o}=t,s=n!==void 0?n:qs(r,a,i,null);this.state={active:!1,resized:!1,pane1Size:o==="first"?s:void 0,pane2Size:o==="second"?s:void 0,instanceProps:{size:n}}}componentDidMount(){document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove),this.setState(Ua.getSizeUpdate(this.props,this.state))}static getDerivedStateFromProps(t,n){return Ua.getSizeUpdate(t,n)}componentWillUnmount(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}onMouseDown(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchStart(n)}onTouchStart(t){const{allowResize:n,onDragStarted:r,split:a}=this.props;if(n){Js(document,window);const i=a==="vertical"?t.touches[0].clientX:t.touches[0].clientY;typeof r=="function"&&r(),this.setState({active:!0,position:i})}}onMouseMove(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchMove(n)}onTouchMove(t){const{allowResize:n,maxSize:r,minSize:a,onChange:i,split:o,step:s}=this.props,{active:c,position:d}=this.state;if(n&&c){Js(document,window);const u=this.props.primary==="first",f=u?this.pane1:this.pane2,h=u?this.pane2:this.pane1;if(f){const p=f,v=h;if(p.getBoundingClientRect){const g=p.getBoundingClientRect().width,m=p.getBoundingClientRect().height,b=o==="vertical"?t.touches[0].clientX:t.touches[0].clientY,y=o==="vertical"?g:m;let E=d-b;if(s){if(Math.abs(E)C&&(w=-w);let j=r;if(r!==void 0&&r<=0){const F=this.splitPane;o==="vertical"?j=F.getBoundingClientRect().width+r:j=F.getBoundingClientRect().height+r}let R=y-w;const B=d-E;Rj?R=j:this.setState({position:B,resized:!0}),i&&i(R),this.setState({draggedSize:R,[u?"pane1Size":"pane2Size"]:R})}}}}onMouseUp(){const{allowResize:t,onDragFinished:n}=this.props,{active:r,draggedSize:a}=this.state;t&&r&&(typeof n=="function"&&n(a),this.setState({active:!1}))}static getSizeUpdate(t,n){const r={},{instanceProps:a}=n;if(a.size===t.size&&t.size!==void 0)return{};const i=t.size!==void 0?t.size:qs(t.defaultSize,t.minSize,t.maxSize,n.draggedSize);t.size!==void 0&&(r.draggedSize=i);const o=t.primary==="first";return r[o?"pane1Size":"pane2Size"]=i,r[o?"pane2Size":"pane1Size"]=void 0,r.instanceProps={size:t.size},r}render(){const{allowResize:t,children:n,className:r,onResizerClick:a,onResizerDoubleClick:i,paneClassName:o,pane1ClassName:s,pane2ClassName:c,paneStyle:d,pane1Style:u,pane2Style:f,resizerClassName:h,resizerStyle:p,split:v,style:g}=this.props,{pane1Size:m,pane2Size:b}=this.state,y=t?"":"disabled",E=h&&`${h} ${Ef}`,w=Sf(n),S=Object.assign({display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},g);v==="vertical"?Object.assign(S,{flexDirection:"row",left:0,right:0}):Object.assign(S,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});const C=["SplitPane",r,v,y],j=Object.assign(Object.assign({},d),u),R=Object.assign(Object.assign({},d),f),B=["Pane1",o,s].join(" "),F=["Pane2",o,c].join(" ");return l.createElement("div",{className:C.join(" "),ref:V=>{this.splitPane=V},style:S},l.createElement(Qs,{className:B,key:"pane1",eleRef:V=>{this.pane1=V},size:m,split:v,style:j},w[0]),l.createElement(xf,{className:y,onClick:a,onDoubleClick:i,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",resizerClassName:E,split:v,style:p||{}}),l.createElement(Qs,{className:F,key:"pane2",eleRef:V=>{this.pane2=V},size:b,split:v,style:R},w[1]))}}var Cf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a({iconClassName:Va(Mf)}),ae=e=>{const{className:t,style:n,children:r}=e,a=Cf(e,["className","style","children"]),{iconClassName:i}=Af();return M.useMemo(()=>l.createElement("span",Object.assign({className:pe([i,t]),style:n},a),r),[i,n,t])},_f=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M516.266667 938.666667h-38.4c-234.666667-21.333333-405.333333-230.4-384-465.066667 17.066667-204.8 179.2-366.933333 384-384 17.066667 0 34.133333 8.533333 42.666666 21.333333 8.533333 12.8 8.533333 34.133333-4.266666 46.933334-85.333333 115.2-59.733333 273.066667 55.466666 358.4 89.6 68.266667 213.333333 68.266667 302.933334 0 12.8-8.533333 29.866667-12.8 46.933333-4.266667 12.8 8.533333 21.333333 25.6 21.333333 42.666667-8.533333 115.2-64 217.6-153.6 290.133333-81.066667 59.733333-174.933333 93.866667-273.066666 93.866667zM396.8 187.733333c-123.733333 42.666667-213.333333 153.6-221.866667 290.133334-17.066667 187.733333 119.466667 354.133333 307.2 371.2 89.6 8.533333 179.2-17.066667 247.466667-76.8 46.933333-38.4 81.066667-89.6 102.4-145.066667-106.666667 38.4-226.133333 21.333333-320-46.933333-119.466667-93.866667-166.4-251.733333-115.2-392.533334z"}))),Of=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 768c-141.376 0-256-114.624-256-256s114.624-256 256-256 256 114.624 256 256-114.624 256-256 256z m0-85.333333a170.666667 170.666667 0 1 0 0-341.333334 170.666667 170.666667 0 0 0 0 341.333334zM469.333333 85.333333a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0V85.333333z m0 768a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0v-85.333334zM85.333333 554.666667a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334H85.333333z m768 0a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334h-85.333334zM161.834667 222.165333a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m576 576a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m-515.669334 64a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z m576-576a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z"}))),Tf="base-theme-switch",$f=Ad(Tf),el=e=>{if(!(typeof e>"u"))return e==="light"};function Pf(e){return e===!0?"light":"dark"}const If=e=>{const{className:t,style:n,onChange:r,theme:a,defaultTheme:i}=e;return l.createElement(Cd,{className:pe([$f(),t]),style:n,checkedChildren:l.createElement(Of,{style:{height:"100%"}}),unCheckedChildren:l.createElement(_f,{style:{height:"100%"}}),checked:el(i),defaultChecked:el(a),onChange:o=>{const s=Pf(o);r==null||r({theme:s})}})},tl=We.Option,zf="base-locale-selector",Rf=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=M.useContext(le),s=o(zf);return M.useMemo(()=>l.createElement(We,{style:n,className:pe(s(),t),size:"small",defaultValue:r,value:a,onChange:i},l.createElement(tl,{value:"en-US"},"English"),l.createElement(tl,{value:"zh-CN"},"中文")),[t,n,r,a,i])};function aa(e,t){let n=-1;return function(...r){n>=0||(n=setTimeout(()=>{e(...r),n=-1},t))}}function Yo(e){const{accept:t,success:n,error:r}=e;let a=document.createElement("input");a.type="file",t&&(a.accept=t),a.addEventListener("change",function(){var i;const o=(i=a.files)===null||i===void 0?void 0:i[0];n({file:o}),a=null}),a.addEventListener("error",function(i){typeof r=="function"&&r(i),a=null}),a.click()}function Nf(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsDataURL(e)})}function Df(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsText(e)})}function jf(e){const t=new TextEncoder().encode(e),n=new Blob([t],{type:"text/plain;charset=utf-8"});return window.URL.createObjectURL(n)}function Lf(e,t){const{fileName:n}=t,r=jf(e);let a=document.createElement("a");a.href=r,a.download=n,a.click(),a=null}function Ya(e){return typeof e=="string"&&(/^\#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)||/^[a-z]{1,}$/i.test(e))}function kf(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="linear-gradient"){const n=[];typeof e.angle=="number"?n.push(`${e.angle}deg`):n.push("180deg"),Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(${n.join(", ")})`}else if((e==null?void 0:e.type)==="radial-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`radial-gradient(circle, ${n.join(", ")})`}return t}function Xa(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="radial-gradient"||(e==null?void 0:e.type)==="linear-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.length>0&&(e.stops.forEach((r,a)=>{n.push(`${r.color} ${r.offset*100}%`),a===e.stops.length-1&&r.offset<1&&n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(90deg, ${n.join(", ")})`)}return t}function nl(e,t){if(t===1)return e;let n=1;const r=/^\#[0-9a-f]{6,6}$/i,a=/^\#[0-9a-f]{8,8}$/i;let i=e;if(r.test(e)?n=parseInt(e.substring(5,7).replace(/^\#/,"0x")):a.test(e)&&(n=parseInt(e.substring(7,9).replace(/^\#/,"0x")),i=e.substring(0,7)),n=n*t,r.test(i)&&n>0&&n<1){const o=Math.max(0,Math.min(255,Math.ceil(n*256)));i=`${i.toUpperCase()}${o.toString(16).toUpperCase()}`}return i}function Xn(){function e(){return((1+Math.random())*65536|0).toString(16).substring(1)}return`${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`}function Tt(e){let t=0;for(let n=0;n=0)return n;if(r==="Array"){const a=[];return n.forEach(i=>{a.push(t(i))}),a}else if(r==="Object"){const a={};return Object.keys(n).forEach(s=>{a[s]=t(n[s])}),Object.getOwnPropertySymbols(n).forEach(s=>{a[s]=t(n[s])}),a}}return t(e)}function Li(e){const t=Kt(e),n=r=>{r.uuid=Xn(),r.type==="group"&&r.detail.children&&r.detail.children.forEach(a=>{n(a)})};return n(t),t}function Bf(e){return Object.prototype.toString.call(e).replace(/[\]|\[]{1,1}/gi,"").split(" ")[1]}function Ff(e,t){const n=e.assets||{},r=Kt(e),a=(t==null?void 0:t.loadItemMap)||{},i=o=>{o.forEach(s=>{var c,d,u;if(s.type==="image"&&s.detail.src){const f=s.detail.src;if(Zt(f)&&!n[f]&&a[f]&&typeof((c=a[f])===null||c===void 0?void 0:c.source)=="string")n[f]={type:"image",value:a[f].source};else if(!n[f]){const h=Zn(f);n[h]||(n[h]={type:"image",value:f}),s.detail.src=h}}else if(s.type==="svg"){const f=s.detail.svg;if(Zt(f)&&!n[f]&&a[f]&&typeof((d=a[f])===null||d===void 0?void 0:d.source)=="string")n[f]={type:"svg",value:a[f].source};else if(!n[f]){const h=Zn(f);n[h]||(n[h]={type:"svg",value:f}),s.detail.svg=h}}else if(s.type==="html"){const f=s.detail.html;if(Zt(f)&&!n[f]&&a[f]&&typeof((u=a[f])===null||u===void 0?void 0:u.source)=="string")n[f]={type:"html",value:a[f].source};else if(!n[f]){const h=Zn(f);n[h]||(n[h]={type:"html",value:f}),s.detail.html=h}}else if(s.type==="group"&&Array.isArray(s.detail.children)){const f=s.detail.assets||{};Object.keys(f).forEach(h=>{n[h]||(n[h]=f[h])}),delete s.detail.assets,i(s.detail.children)}})};return i(r.elements),r.assets=n,r}function qe(e){return(Object.prototype.toString.call(e)||"").replace(/(\[object|\])/gi,"").trim()}const Mr={type(e,t){const n=qe(e);return t===!0?n.toLocaleLowerCase():n},array(e){return qe(e)==="Array"},json(e){return qe(e)==="Object"},function(e){return qe(e)==="Function"},asyncFunction(e){return qe(e)==="AsyncFunction"},boolean(e){return qe(e)==="Boolean"},string(e){return qe(e)==="String"},number(e){return qe(e)==="Number"},undefined(e){return qe(e)==="Undefined"},null(e){return qe(e)==="Null"},promise(e){return qe(e)==="Promise"}};function Hf(e,t){const{width:n,height:r}=t;return new Promise((a,i)=>{const o=` - - -
- ${e} -
-
-
- `,s=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),c=new FileReader;c.readAsDataURL(s),c.onload=function(d){var u;const f=(u=d==null?void 0:d.target)===null||u===void 0?void 0:u.result;a(f)},c.onerror=function(d){i(d)}})}function Wf(e){return new Promise((t,n)=>{const r=e,a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),i=new FileReader;i.readAsDataURL(a),i.onload=function(o){var s;const c=(s=o==null?void 0:o.target)===null||s===void 0?void 0:s.result;t(c)},i.onerror=function(o){n(o)}})}var Od=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{Image:Gf}=window;function pi(e){return new Promise((t,n)=>{const r=new Gf;r.crossOrigin="anonymous",r.onload=function(){t(r)},r.onabort=n,r.onerror=n,r.src=e})}function Vf(e){return Od(this,void 0,void 0,function*(){const t=yield Wf(e);return yield pi(t)})}function Uf(e){return e.replace(/\&/gi,"&")}function Yf(e,t){return Od(this,void 0,void 0,function*(){e=Uf(e);const n=yield Hf(e,t);return yield pi(n)})}function en(e){return typeof e=="number"&&(e>0||e<=0)}function Xf(e){return en(e)}function Zf(e){return en(e)}function Td(e){return typeof e=="number"&&e>=0}function Kf(e){return typeof e=="number"&&e>=0}function Qf(e){return typeof e=="number"&&e>=-360&&e<=360}function Jf(e){return Td(e)}function qf(e){return en(e)&&e>=0}function eh(e){return Ya(e)}function $d(e){return typeof e=="string"&&/^(http:\/\/|https:\/\/|\.\/|\/)/.test(`${e}`)}function Pd(e){return typeof e=="string"&&/^(data:image\/)/.test(`${e}`)}function th(e){return Pd(e)||$d(e)}function nh(e){return typeof e=="string"&&/^()/i.test(`${e}`.trim())&&/<\/[\s]{0,}svg>$/i.test(`${e}`.trim())}function rh(e){let t=!1;if(typeof e=="string"){let n=document.createElement("div");n.innerHTML=e,n.children.length>0&&(t=!0),n=null}return t}function ah(e){return typeof e=="string"}function ih(e){return en(e)&&e>0}function oh(e){return en(e)&&e>0}function sh(e){return en(e)&&e>0}function lh(e){return["center","left","right"].includes(e)}function ch(e){return typeof e=="string"&&e.length>0}function dh(e){return["bold"].includes(e)}function uh(e){return/^(-?\d+(?:\.\d+)?)$/.test(`${e}`)}const St={x:Xf,y:Zf,w:Td,h:Kf,angle:Qf,number:en,numberStr:uh,borderWidth:Jf,borderRadius:qf,color:eh,imageSrc:th,imageURL:$d,imageBase64:Pd,svg:nh,html:rh,text:ah,fontSize:ih,lineHeight:oh,textAlign:lh,fontFamily:ch,fontWeight:dh,strokeWidth:sh};var ia=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Z=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},K,mt;class Id{constructor(t,n){K.set(this,void 0),mt.set(this,void 0),ia(this,K,t,"f"),ia(this,mt,Object.assign({devicePixelRatio:1,offscreenCanvas:null},n),"f")}$undoPixelRatio(t){return t/Z(this,mt,"f").devicePixelRatio}$doPixelRatio(t){return Z(this,mt,"f").devicePixelRatio*t}$getContext(){return Z(this,K,"f")}$setContext(t){ia(this,K,t,"f")}$setFont(t){const n=[];t.fontWeight&&n.push(`${t.fontWeight}`),n.push(`${this.$doPixelRatio(t.fontSize||12)}px`),n.push(`${t.fontFamily||"sans-serif"}`),Z(this,K,"f").font=`${n.join(" ")}`}$getOffscreenCanvas(){return Z(this,mt,"f").offscreenCanvas}$resize(t){const{width:n,height:r,devicePixelRatio:a,resetStyle:i}=t,{canvas:o}=Z(this,K,"f");o.width=n*a,o.height=r*a,ia(this,mt,Object.assign(Object.assign({},Z(this,mt,"f")),{devicePixelRatio:a}),"f"),i===!0&&(o.style.width=`${n}px`,o.style.height=`${r}px`)}$getSize(){const{devicePixelRatio:t}=Z(this,mt,"f"),{width:n,height:r}=Z(this,K,"f").canvas;return{width:n/t,height:r/t,devicePixelRatio:t}}get canvas(){return Z(this,K,"f").canvas}get fillStyle(){return Z(this,K,"f").fillStyle}set fillStyle(t){Z(this,K,"f").fillStyle=t}get strokeStyle(){return Z(this,K,"f").strokeStyle}set strokeStyle(t){Z(this,K,"f").strokeStyle=t}get lineWidth(){return this.$undoPixelRatio(Z(this,K,"f").lineWidth)}set lineWidth(t){Z(this,K,"f").lineWidth=this.$doPixelRatio(t)}get textAlign(){return Z(this,K,"f").textAlign}set textAlign(t){Z(this,K,"f").textAlign=t}get textBaseline(){return Z(this,K,"f").textBaseline}set textBaseline(t){Z(this,K,"f").textBaseline=t}get globalAlpha(){return Z(this,K,"f").globalAlpha}set globalAlpha(t){Z(this,K,"f").globalAlpha=t}get shadowColor(){return Z(this,K,"f").shadowColor}set shadowColor(t){Z(this,K,"f").shadowColor=t}get shadowOffsetX(){return this.$undoPixelRatio(Z(this,K,"f").shadowOffsetX)}set shadowOffsetX(t){Z(this,K,"f").shadowOffsetX=this.$doPixelRatio(t)}get shadowOffsetY(){return this.$undoPixelRatio(Z(this,K,"f").shadowOffsetY)}set shadowOffsetY(t){Z(this,K,"f").shadowOffsetY=this.$doPixelRatio(t)}get shadowBlur(){return this.$undoPixelRatio(Z(this,K,"f").shadowBlur)}set shadowBlur(t){Z(this,K,"f").shadowBlur=this.$doPixelRatio(t)}get lineCap(){return Z(this,K,"f").lineCap}set lineCap(t){Z(this,K,"f").lineCap=t}get globalCompositeOperation(){return Z(this,K,"f").globalCompositeOperation}set globalCompositeOperation(t){Z(this,K,"f").globalCompositeOperation=t}fill(...t){return Z(this,K,"f").fill(...t)}arc(t,n,r,a,i,o){return Z(this,K,"f").arc(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),a,i,o)}rect(t,n,r,a){return Z(this,K,"f").rect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}fillRect(t,n,r,a){return Z(this,K,"f").fillRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}clearRect(t,n,r,a){return Z(this,K,"f").clearRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}beginPath(){return Z(this,K,"f").beginPath()}closePath(){return Z(this,K,"f").closePath()}lineTo(t,n){return Z(this,K,"f").lineTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}moveTo(t,n){return Z(this,K,"f").moveTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}arcTo(t,n,r,a,i){return Z(this,K,"f").arcTo(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i))}getLineDash(){return Z(this,K,"f").getLineDash()}setLineDash(t){const n=t.map(r=>this.$doPixelRatio(r));return Z(this,K,"f").setLineDash(n)}stroke(t){return t?Z(this,K,"f").stroke(t):Z(this,K,"f").stroke()}translate(t,n){return Z(this,K,"f").translate(this.$doPixelRatio(t),this.$doPixelRatio(n))}rotate(t){return Z(this,K,"f").rotate(t)}drawImage(...t){const n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],s=t[t.length-4],c=t[t.length-3],d=t[t.length-2],u=t[t.length-1];return t.length===9?Z(this,K,"f").drawImage(n,this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o),this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u)):Z(this,K,"f").drawImage(n,this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u))}createPattern(t,n){return Z(this,K,"f").createPattern(t,n)}measureText(t){return Z(this,K,"f").measureText(t)}fillText(t,n,r,a){return a!==void 0?Z(this,K,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,K,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}strokeText(t,n,r,a){return a!==void 0?Z(this,K,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,K,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}save(){Z(this,K,"f").save()}restore(){Z(this,K,"f").restore()}scale(t,n){Z(this,K,"f").scale(t,n)}circle(t,n,r,a,i,o,s,c){Z(this,K,"f").ellipse(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),i,o,s,c)}isPointInPath(t,n){return Z(this,K,"f").isPointInPath(this.$doPixelRatio(t),this.$doPixelRatio(n))}clip(...t){return Z(this,K,"f").clip(...t)}setTransform(t,n,r,a,i,o){return Z(this,K,"f").setTransform(t,n,r,a,i,o)}getTransform(){return Z(this,K,"f").getTransform()}createLinearGradient(t,n,r,a){return Z(this,K,"f").createLinearGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}createRadialGradient(t,n,r,a,i,o){return Z(this,K,"f").createRadialGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o))}createConicGradient(t,n,r){return Z(this,K,"f").createConicGradient(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}}K=new WeakMap,mt=new WeakMap;function fn(e){const{width:t,height:n,ctx:r,devicePixelRatio:a}=e;let i=r;if(!i){const s=document.createElement("canvas");s.width=t*a,s.height=n*a,i=s.getContext("2d")}return new Id(i,e)}function Ea(e){const{width:t,height:n,devicePixelRatio:r}=e,a=new OffscreenCanvas(t*r,n*r),o=a.getContext("2d").canvas.getContext("2d");return new Id(o,{devicePixelRatio:r,offscreenCanvas:a})}function fh(e,t){const{width:n,height:r,devicePixelRatio:a,offscreen:i,createCustomContext2D:o}=t,s={width:n,height:r,devicePixelRatio:a},c=e.getContext("2d");if(o){const d=o(s),u=o(s),f=o(s),h=fn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}if(i===!0){const d=Ea(s),u=Ea(s),f=Ea(s),h=fn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}else{const d=fn(s),u=fn(s),f=fn(s),h=fn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{h.clearRect(0,0,n,r),h.drawImage(f.canvas,0,0,n,r),h.drawImage(d.canvas,0,0,n,r),h.drawImage(u.canvas,0,0,n,r),f.clearRect(0,0,n,r),d.clearRect(0,0,n,r),u.clearRect(0,0,n,r)}}}}var hh=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},et=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},je;class Qt{constructor(){je.set(this,void 0),hh(this,je,new Map,"f")}on(t,n){if(et(this,je,"f").has(t)){const r=et(this,je,"f").get(t)||[];r==null||r.push(n),et(this,je,"f").set(t,r)}else et(this,je,"f").set(t,[n])}off(t,n){if(et(this,je,"f").has(t)){const r=et(this,je,"f").get(t);if(Array.isArray(r)){for(let a=0;a<(r==null?void 0:r.length);a++)if(r[a]===n){r.splice(a,1);break}}et(this,je,"f").set(t,r||[])}}trigger(t,n){const r=et(this,je,"f").get(t);return Array.isArray(r)?(r.forEach(a=>{a(n)}),!0):!1}has(t){if(et(this,je,"f").has(t)){const n=et(this,je,"f").get(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}destroy(){this.clear()}clear(){et(this,je,"f").clear()}}je=new WeakMap;function ph(e,t){const n=(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y);return n===0?n:Math.sqrt(n)}function hr(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var oa=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},bn=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Sa,zt,Za,ho;class Br{constructor(t){Sa.add(this),zt.set(this,void 0),Za.set(this,void 0),oa(this,Za,Kt(t.defaultStorage),"f"),oa(this,zt,bn(this,Sa,"m",ho).call(this),"f")}set(t,n){bn(this,zt,"f")[t]=n}get(t){return bn(this,zt,"f")[t]}getSnapshot(){return Kt(bn(this,zt,"f"))}clear(){oa(this,zt,bn(this,Sa,"m",ho).call(this),"f")}destroy(){oa(this,zt,null,"f")}}zt=new WeakMap,Za=new WeakMap,Sa=new WeakSet,ho=function(){return Kt(bn(this,Za,"f"))};function zd(e){const{activeStore:t}=e;return{scale:t==null?void 0:t.scale,offsetTop:t==null?void 0:t.offsetTop,offsetBottom:t==null?void 0:t.offsetBottom,offsetLeft:t==null?void 0:t.offsetLeft,offsetRight:t==null?void 0:t.offsetRight}}function Rd(e){const{activeStore:t}=e;return{devicePixelRatio:t.devicePixelRatio,width:t==null?void 0:t.width,height:t==null?void 0:t.height,contextWidth:t==null?void 0:t.contextWidth,contextHeight:t==null?void 0:t.contextHeight}}function gh(e){return e/Math.PI*180}function jt(e){return e/180*Math.PI}function Nd(e,t,n,r){const a=jt(t||0);n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(a),e.translate(-n.x,-n.y)),r(e),n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(-a),e.translate(-n.x,-n.y))}function Ct(e,t,n){const r=Ft(t);Nd(e,t.angle||0,r,()=>{n(e)})}function Ft(e){return{x:e.x+e.w/2,y:e.y+e.h/2}}function Dd(e){const t=Math.min(e[0].x,e[1].x,e[2].x,e[3].x),n=Math.min(e[0].y,e[1].y,e[2].y,e[3].y),r=Math.max(e[0].x,e[1].x,e[2].x,e[3].x),a=Math.max(e[0].y,e[1].y,e[2].y,e[3].y),i={x:t,y:n,w:r-t,h:a-n};return Ft(i)}function vh(e,t,n){const r=po(e,t),a=po(e,n);return a!==null&&r!==null?r>Math.PI*3/2&&aMath.PI*3/2&&r0)return Math.PI}else if(r===0){if(n<0)return Math.PI*3/2;if(n>0)return Math.PI/2}return n>0&&r<0?Math.atan(Math.abs(n)/Math.abs(r)):n>0&&r>0?Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r>0?Math.PI+Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r<0?2*Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):0}function De(e,t,n){let i=po(e,t)+n;i>Math.PI*2?i=i-Math.PI*2:i<0-Math.PI*2&&(i=i+Math.PI*2),i<0&&(i=i+Math.PI*2);const o=ph(e,t);let s=0,c=0;return i===0?(s=0,c=0-o):i>0&&iMath.PI/2&&iMath.PI&&i<3/2*Math.PI?(s=0-Math.sin(i-Math.PI)*o,c=Math.cos(i-Math.PI)*o):i===3/2*Math.PI?(s=0-o,c=0):i>3/2*Math.PI&&i<2*Math.PI?(s=0-Math.sin(2*Math.PI-i)*o,c=0-Math.cos(2*Math.PI-i)*o):i===2*Math.PI&&(s=0,c=0-o),s+=e.x,c+=e.y,{x:s,y:c}}function Ka(e,t){if((t==null?void 0:t.length)>0){let n=e.x,r=e.y;return t.forEach(a=>{const{x:i,y:o,w:s,h:c,angle:d=0}=a,u=Ft({x:i,y:o,w:s,h:c,angle:d}),f=De(u,{x:n,y:r},jt(d));n=f.x,r=f.y}),{x:n,y:r}}return e}function jd(e,t,n){const{x:r,y:a,w:i,h:o}=e;let s={x:r,y:a},c={x:r+i,y:a},d={x:r+i,y:a+o},u={x:r,y:a+o};if(n&&(n>0||n<0)){const f=jt(ft(n));s=De(t,s,f),c=De(t,c,f),d=De(t,d,f),u=De(t,u,f)}return[s,c,d,u]}function tn(e){const{angle:t=0}=e,n=Ft(e);return jd(e,n,t)}function rl(e,t,n){return[De(e,{x:t[0].x,y:t[0].y},n),De(e,{x:t[1].x,y:t[1].y},n),De(e,{x:t[2].x,y:t[2].y},n),De(e,{x:t[3].x,y:t[3].y},n)]}function ft(e){if(!(e>0||e<0)||e===0)return 0;let t=e%360;return t<0&&(t+=360),t}function Ld(e){let t=!0;if(Array.isArray(e)){const n=[];e.forEach(r=>{var a;typeof r.uuid=="string"&&r.uuid?n.includes(r.uuid)?(t=!1,console.warn(`Duplicate uuids: ${r.uuid}`)):n.push(r.uuid):(t=!1,console.warn("Element missing uuid",r)),r.type==="group"&&(t=Ld((a=r==null?void 0:r.detail)===null||a===void 0?void 0:a.children))})}return t}function mh(e){var t;const n={x:0,y:0,w:0,h:0};let r=null;for(let i=0;i0||s.angle<0)){const c=tn(s);if(c.length===4){const d=[c[0].x,c[1].x,c[2].x,c[3].x],u=[c[0].y,c[1].y,c[2].y,c[3].y];s.x=Math.min(...d),s.y=Math.min(...u),s.w=Math.abs(Math.max(...d)-Math.min(...d)),s.h=Math.abs(Math.max(...u)-Math.min(...u))}}if(r){const c=Math.min(s.x,n.x),d=Math.min(s.y,n.y),u=Math.max(s.x+s.w,n.x+n.w),f=Math.max(s.y+s.h,n.y+n.h);n.x=c,n.y=d,n.w=Math.abs(u-c),n.h=Math.abs(f-d)}else n.x=s.x,n.y=s.y,n.w=s.w,n.h=s.h;r=s}return{x:Math.floor(n.x),y:Math.floor(n.y),w:Math.ceil(n.w),h:Math.ceil(n.h)}}function kd(e,t){const n={x:0,y:0,w:0,h:0};e.forEach(a=>{const i={x:a.x,y:a.y,w:a.w,h:a.h,angle:a.angle};if(i.angle&&(i.angle>0||i.angle<0)){const u=tn(i);if(u.length===4){const f=[u[0].x,u[1].x,u[2].x,u[3].x],h=[u[0].y,u[1].y,u[2].y,u[3].y];i.x=Math.min(...f),i.y=Math.min(...h),i.w=Math.abs(Math.max(...f)-Math.min(...f)),i.h=Math.abs(Math.max(...h)-Math.min(...h))}}const o=Math.min(i.x,n.x),s=Math.min(i.y,n.y),c=Math.max(i.x+i.w,n.x+n.w),d=Math.max(i.y+i.h,n.y+n.h);n.x=o,n.y=s,n.w=Math.abs(c-o),n.h=Math.abs(d-s)}),t!=null&&t.extend&&(n.x=Math.min(n.x,0),n.y=Math.min(n.y,0));const r={contextWidth:n.w,contextHeight:n.h};return t!=null&&t.viewWidth&&(t!=null&&t.viewHeight)&&(t==null?void 0:t.viewWidth)>0&&(t==null?void 0:t.viewHeight)>0&&(t.viewWidth>n.x+n.w&&(r.contextWidth=t.viewWidth-n.x),t.viewHeight>n.y+n.h&&(r.contextHeight=t.viewHeight-n.y)),r}function bh(e,t,n){const r=kd(e,{viewWidth:t.width,viewHeight:t.height,extend:n==null?void 0:n.extend});return(n==null?void 0:n.extend)===!0&&(r.contextWidth=Math.max(r.contextWidth,t.contextWidth),r.contextHeight=Math.max(r.contextHeight,t.contextHeight)),{contextSize:r}}function Bd(e,t){var n;let r=null;for(let a=0;a{const a=Qn(r,t);a&&n.push(a)}),n}function Qn(e,t){let n=null,r=t;for(let a=0;a{var o;for(let s=0;s=o&&r<=d&&i>=s}function wh(e,t){const{scale:n,offsetX:r,offsetY:a}=e,{viewSizeInfo:i}=t,{width:o,height:s,contextWidth:c,contextHeight:d}=i,u=c*n,f=d*n,h=0-r*n,p=0-a*n,v=o-(u+h/n),g=s-(f+p/n);return{scale:n,offsetLeft:h,offsetTop:p,offsetRight:v,offsetBottom:g}}function xh(e){const{scale:t,point:n,viewScaleInfo:r}=e,{offsetLeft:a,offsetTop:i}=r,o=t/r.scale,s=n.x,c=n.y,d=s-s*o+(a*o-a),u=c-c*o+(i*o-i);return{moveX:d,moveY:u}}function Eh(e){const{moveX:t=0,moveY:n=0,viewScaleInfo:r,viewSizeInfo:a}=e,{scale:i}=r,{width:o,height:s,contextWidth:c,contextHeight:d}=a;let u=r.offsetLeft,f=r.offsetRight,h=r.offsetTop,p=r.offsetBottom;u+=t,h+=n;const v=c*i,g=d*i;return f=o-(v+u),p=s-(g+h),{scale:i,offsetTop:h,offsetLeft:u,offsetRight:f,offsetBottom:p}}function Xo(e,t){const{viewScaleInfo:n}=t,{x:r,y:a,w:i,h:o,angle:s}=e,{scale:c,offsetTop:d,offsetLeft:u}=n;return{x:r*c+u,y:a*c+d,w:i*c,h:o*c,angle:s}}function Qe(e,t){const{viewScaleInfo:n}=t,{x:r,y:a}=e,{scale:i,offsetTop:o,offsetLeft:s}=n;return{x:r*i+s,y:a*i+o}}function Ie(e,t){return[Qe(e[0],t),Qe(e[1],t),Qe(e[2],t),Qe(e[3],t)]}function go(e,t){const{context2d:n,element:r,viewScaleInfo:a,viewSizeInfo:i}=t,{angle:o=0}=r,{x:s,y:c,w:d,h:u}=Xo(r,{viewScaleInfo:a,viewSizeInfo:i}),f=tn({x:s,y:c,w:d,h:u,angle:o});if(f.length>=2){n.beginPath(),n.moveTo(f[0].x,f[0].y);for(let h=1;h0)for(let f=d.length-1;f>=0;f--){let h=0,p=0,v=0;for(let m=0;m<=f;m++)h+=d[m].x,p+=d[m].y,v+=d[m].angle||0;const g=d[f];if(g&&g.type==="group"&&Array.isArray((n=g.detail)===null||n===void 0?void 0:n.children))for(let m=0;m=0;f--){const h=o.elements[f];if(((a=h==null?void 0:h.operations)===null||a===void 0?void 0:a.invisible)!==!0&&go(e,{context2d:i,element:h,viewScaleInfo:s,viewSizeInfo:c})){u.index=f,u.element=h;break}}return u}function Ch(e,t){const{viewSizeInfo:n,viewScaleInfo:r}=t,{width:a,height:i}=n,{angle:o}=e,{x:s,y:c,w:d,h:u}=Xo(e,{viewScaleInfo:r,viewSizeInfo:n}),f=tn({x:s,y:c,w:d,h:u,angle:o}),h={x:0,y:0,w:a,h:i},p=Math.min(f[0].x,f[1].x,f[2].x,f[3].x),v=Math.min(f[0].y,f[1].y,f[2].y,f[3].y),g=Math.max(f[0].x,f[1].x,f[2].x,f[3].x),m=Math.max(f[0].y,f[1].y,f[2].y,f[3].y),b={x:p,y:v,w:g-p,h:m-v};return yh(h,b)}function Wd(e){const{x:t,y:n,h:r,w:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+r},{x:t,y:n+r}]}function at(e){const{x:t,y:n,w:r,h:a,angle:i=0}=e;return i===0?Wd(e):jd(e,Ft({x:t,y:n,w:r,h:a,angle:i}),i)}function Zo(e){const t=[];let n=0,r=0;const a=[],i=[...e];for(let o=0;o0||f<0){const g=jt(f);h=rl(v,h,g)}a.push({center:v,angle:f,radian:jt(f)})}t.push(h)}return t}function Mh(e,t){const{groupQueue:n}=t;if(!(n.length>0))return[at(e)];const r=[...n,e];return Zo(r)}function Qa(e,t){return Mh(e,t).pop()||null}function gt(e,t){const{x:n,y:r}=e,{size:a,angle:i}=t;return{x:n-a/2,y:r-a/2,w:a,h:a,angle:i}}function sa(e,t){const{groupQueue:n,controllerSize:r,viewScaleInfo:a}=t,i=(r&&r>0?r:8)/a.scale,{x:o,y:s,w:c,h:d,angle:u=0}=e,f=[{uuid:Xn(),x:o,y:s,w:c,h:d,angle:u,type:"group",detail:{children:[]}},...n];let h=0;f.forEach(({angle:Di=0})=>{h+=Di});const p=Qa(e,{groupQueue:n}),v=Qa({x:o-i*2,y:s-i*2,h:d+i*4,w:c+i*4,angle:u},{groupQueue:[...n]}),g=hr(p[0],p[1]),m=hr(p[1],p[2]),b=hr(p[2],p[3]),y=hr(p[3],p[0]),E=p[0],w=p[1],S=p[2],C=p[3],j=gt(g,{size:i,angle:h}),R=gt(m,{size:i,angle:h}),B=gt(b,{size:i,angle:h}),F=gt(y,{size:i,angle:h}),V=gt(E,{size:i,angle:h}),L=gt(w,{size:i,angle:h}),_=gt(C,{size:i,angle:h}),T=gt(S,{size:i,angle:h}),P=at(V),k=at(L),N=at(_),D=at(T),x=[P[1],k[0],k[3],P[2]],z=[k[3],k[2],D[1],D[0]],X=[N[1],D[0],D[3],N[2]],A=[P[3],P[2],N[1],N[0]],U=at(j),G=at(R),O=at(B),$=at(F),I=hr(v[0],v[1]),H=gt(I,{size:i,angle:h}),ee=at(H);return{elementWrapper:p,left:{type:"left",vertexes:A,center:y},right:{type:"right",vertexes:z,center:m},top:{type:"top",vertexes:x,center:g},bottom:{type:"bottom",vertexes:X,center:b},topLeft:{type:"top-left",vertexes:P,center:E},topRight:{type:"top-right",vertexes:k,center:w},bottomLeft:{type:"bottom-left",vertexes:N,center:C},bottomRight:{type:"bottom-right",vertexes:D,center:S},leftMiddle:{type:"left-middle",vertexes:$,center:y},rightMiddle:{type:"right-middle",vertexes:G,center:m},topMiddle:{type:"top-middle",vertexes:U,center:g},bottomMiddle:{type:"bottom-middle",vertexes:O,center:b},rotate:{type:"rotate",vertexes:ee,center:I}}}function Gd(e){let t="";return e.forEach(n=>{t+=n.type+n.params.join(" ")}),t}function Te(e,t){let n=2;return typeof(t==null?void 0:t.decimalPlaces)<"u"&&(t==null?void 0:t.decimalPlaces)>=0&&(n=t.decimalPlaces),parseFloat(e.toFixed(n))}const Ma="Text Element";function nn(){return{boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,lineHeight:20,fontFamily:"sans-serif",fontWeight:400,overflow:"hidden"}}function Ah(){return{background:"#D9D9D9"}}function _h(){return{background:"#D9D9D9",radius:0}}function Oh(e){const t=nn();return{text:Ma,color:t.color,fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:e.w/Ma.length,fontSize:e.w/Ma.length,textAlign:"center",verticalAlign:"middle"}}function Th(){return{svg:''}}function $h(){return{src:"data:image/svg+xml;base64,PHN2ZyAgIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiPjxwYXRoIGQ9Ik05MjggMTYwSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY2NDBjMCAxNy43IDE0LjMgMzIgMzIgMzJoODMyYzE3LjcgMCAzMi0xNC4zIDMyLTMyVjE5MmMwLTE3LjctMTQuMy0zMi0zMi0zMnogbS00MCA2MzJIMTM2di0zOS45bDEzOC41LTE2NC4zIDE1MC4xIDE3OEw2NTguMSA0ODkgODg4IDc2MS42Vjc5MnogbTAtMTI5LjhMNjY0LjIgMzk2LjhjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDQyNC42IDY2Ni40bC0xNDQtMTcwLjdjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDEzNiA2NTIuN1YyMzJoNzUydjQzMC4yeiIgIGZpbGw9IiM1MTUxNTEiPjwvcGF0aD48cGF0aCBkPSJNMzA0IDQ1NmM0OC42IDAgODgtMzkuNCA4OC04OHMtMzkuNC04OC04OC04OC04OCAzOS40LTg4IDg4IDM5LjQgODggODggODh6IG0wLTExNmMxNS41IDAgMjggMTIuNSAyOCAyOHMtMTIuNSAyOC0yOCAyOC0yOC0xMi41LTI4LTI4IDEyLjUtMjggMjgtMjh6IiAgZmlsbD0iIzUxNTE1MSI+PC9wYXRoPjwvc3ZnPg=="}}function Ph(){return{children:[],background:"#D9D9D9",overflow:"hidden"}}const Ih=nn();function Ko(e,t){const{viewScaleInfo:n}=t,{scale:r}=n;let{borderRadius:a}=e.detail;const{boxSizing:i=Ih.boxSizing,borderWidth:o}=e.detail;Array.isArray(o)&&(a=0);let{x:s,y:c,w:d,h:u}=e,f=[0,0,0,0];if(typeof a=="number"){const p=a*r;f=[p,p,p,p]}else Array.isArray(a)&&(a==null?void 0:a.length)===4&&(f=[a[0]*r,a[1]*r,a[2]*r,a[3]*r]);let h=0;return typeof o=="number"&&(h=(o||0)*r),i==="border-box"?(s=e.x+h/2,c=e.y+h/2,d=e.w-h,u=e.h-h):i==="content-box"?(s=e.x-h/2,c=e.y-h/2,d=e.w+h,u=e.h+h):(s=e.x,c=e.y,d=e.w,u=e.h),d=Math.max(d,1),u=Math.max(u,1),f=f.map(p=>Math.min(p,d/2,u/2)),{x:s,y:c,w:d,h:u,radiusList:f}}const Pe=e=>Te(e,{decimalPlaces:4});function Vd(e,t){const{detail:n}=e,{xRatio:r,yRatio:a,maxRatio:i}=t,o=(r+a)/2,{borderWidth:s,borderRadius:c,borderDash:d,shadowOffsetX:u,shadowOffsetY:f,shadowBlur:h}=n;if(typeof s=="number")n.borderWidth=Pe(s*o);else if(Array.isArray(n.borderWidth)){const p=s;n.borderWidth=[Pe(p[0]*a),Pe(p[1]*r),Pe(p[2]*a),Pe(p[3]*r)]}if(typeof c=="number")n.borderRadius=Pe(c*o);else if(Array.isArray(n.borderRadius)){const p=c;n.borderRadius=[p[0]*r,p[1]*r,p[2]*a,p[3]*a]}Array.isArray(d)&&d.forEach((p,v)=>{n.borderDash[v]=Pe(p*i)}),typeof u=="number"&&(n.shadowOffsetX=Pe(u*i)),typeof f=="number"&&(n.shadowOffsetX=Pe(f*i)),typeof h=="number"&&(n.shadowOffsetX=Pe(h*i))}function zh(e,t){const{xRatio:n,yRatio:r}=t,{x:a,y:i,w:o,h:s}=e;e.x=Pe(a*n),e.y=Pe(i*r),e.w=Pe(o*n),e.h=Pe(s*r),Vd(e,t)}function Rh(e,t){const{minRatio:n,maxRatio:r}=t,{fontSize:a,lineHeight:i}=e.detail,o=(n+r)/2;a&&a>0&&(e.detail.fontSize=Pe(a*o)),i&&i>0&&(e.detail.lineHeight=Pe(i*o))}function Ud(e,t){const{type:n}=e;zh(e,t),n==="circle"||(n==="text"?Rh(e,t):n==="image"||n==="svg"||n==="html"||n==="path"||n==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(r=>{Ud(r,t)}))}function Yd(e,t){const n=t.w&&t.w>0?t.w:e.w,r=t.h&&t.h>0?t.h:e.h,a=n/e.w,i=r/e.h;if(a===i&&a===1)return e;const o=Math.min(a,i),s=Math.max(a,i);e.w=n,e.h=r;const c={xRatio:a,yRatio:i,minRatio:o,maxRatio:s};return e.type==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(d=>{Ud(d,c)}),Vd(e,c),e}const ki=200,Bi=200;function Nh(e,t){let n=0,r=0,a=ki,i=Bi;if(t){const{viewScaleInfo:s,viewSizeInfo:c}=t,{scale:d,offsetLeft:u,offsetTop:f}=s,{width:h,height:p}=c,v=h/4,g=p/4;ki>=v?a=v/d:a=ki/d,Bi>=g?i=g/d:i=Bi/d,["circle","svg","image"].includes(e)?a=i=Math.max(a,i):e==="text"&&(i=a/Ma.length*2),n=(0-u+h/2-a*d/2)/d,r=(0-f+p/2-i*d/2)/d}return{x:n,y:r,w:a,h:i}}function Dh(e,t,n){const r=Nh(e,n);let a={};return e==="rect"?a=Ah():e==="circle"?a=_h():e==="text"?a=Oh(r):e==="svg"?a=Th():e==="image"?a=$h():e==="group"&&(a=Ph()),Object.assign(Object.assign(Object.assign({},r),t),{uuid:Xn(),type:e,detail:Object.assign(Object.assign({},a),t.detail||{})})}function Xd(e,t,n){let r=!1;if(t.length===1){const a=t[0];n.splice(a,0,e),r=!0}else if(t.length>1){let a=n;for(let i=0;i1){let r=t;for(let a=0;a=0;s++)r[s]!==n[s]&&r[s]=0&&(n[o]=n[o]+1),Zd(n,e)}return{elements:e,from:n,to:r}}function Lh(e,t){var n;const r=Object.keys(t);for(let a=0;a{e[i][s]=o}),e[i]=[...e[i],...t[i]])))}return e}function Fr(e,t,n){var r,a;let i=null;for(let o=0;o0||t.h&&t.h>0)&&Yd(s,{w:t.w,h:t.h}),Lh(s,t),i=s;break}else s.type==="group"&&(i=Fr(e,t,((a=s==null?void 0:s.detail)===null||a===void 0?void 0:a.children)||[]))}return i}function kh(e,t){var n,r,a,i,o,s,c,d;let u=0,f=0,h=1,p=((r=(n=e==null?void 0:e.elements)===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.x)||0,v=((i=(a=e==null?void 0:e.elements)===null||a===void 0?void 0:a[0])===null||i===void 0?void 0:i.y)||0,g=((s=(o=e==null?void 0:e.elements)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.w)||0,m=((d=(c=e==null?void 0:e.elements)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.h)||0;const{width:b,height:y}=t.viewSizeInfo;if(e.elements.forEach(w=>{const S={x:w.x,y:w.y,w:w.w,h:w.h,angle:w.angle};if(S.angle&&(S.angle>0||S.angle<0)){const F=tn(S);if(F.length===4){const V=[F[0].x,F[1].x,F[2].x,F[3].x],L=[F[0].y,F[1].y,F[2].y,F[3].y];S.x=Math.min(...V),S.y=Math.min(...L),S.w=Math.abs(Math.max(...V)-Math.min(...V)),S.h=Math.abs(Math.max(...L)-Math.min(...L))}}const C=Math.min(S.x,p),j=Math.min(S.y,v),R=Math.max(S.x+S.w,p+g),B=Math.max(S.y+S.h,v+m);p=C,v=j,g=Math.abs(R-C),m=Math.abs(B-j)}),g>0&&m>0){const w=Te(b/g,{decimalPlaces:4}),S=Te(y/m,{decimalPlaces:4});h=Math.min(w,S,1),u=(g*h-b)/2/h+p,f=(m*h-y)/2/h+v}return{offsetX:Te(u,{decimalPlaces:0}),offsetY:Te(f,{decimalPlaces:0}),scale:h}}function Bh(e){let t=0,n=0;if(e){const{viewScaleInfo:a,viewSizeInfo:i}=e,{offsetLeft:o,offsetTop:s,scale:c}=a,{width:d,height:u}=i;t=0-o+d/c/2,n=0-s+u/c/2}return{x:t,y:n}}function vo(e,t,n){if(typeof t=="string")return t;const{viewElementSize:r,viewScaleInfo:a,opacity:i=1}=n,{x:o,y:s}=r,{scale:c}=a;if((t==null?void 0:t.type)==="linear-gradient"){const{start:d,end:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c},p={x:o+u.x*c,y:s+u.y*c},v=e.createLinearGradient(h.x,h.y,p.x,p.y);return f.forEach(g=>{v.addColorStop(g.offset,nl(g.color,i))}),v}if((t==null?void 0:t.type)==="radial-gradient"){const{inner:d,outer:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c,radius:d.radius*c},p={x:o+u.x*c,y:s+u.y*c,radius:u.radius*c},v=e.createRadialGradient(h.x,h.y,h.radius,p.x,p.y,p.radius);return f.forEach(g=>{v.addColorStop(g.offset,nl(g.color,i))}),v}return"#000000"}const mo=nn();function Jt(e){var t,n,r,a;let i=1;return((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.opacity)!==void 0&&((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.opacity)>=0&&((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.opacity)<=1&&(i=(a=e==null?void 0:e.detail)===null||a===void 0?void 0:a.opacity),i}function Jn(e,t,n){const{pattern:r,renderContent:a,originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c}=n||{},{parentOpacity:d}=n,u=Jt(i)*d;Fh(e,t,{originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c,renderContent:()=>{e.globalAlpha=u,Hh(e,t,{pattern:r,viewScaleInfo:s,viewSizeInfo:c}),a==null||a(),Wh(e,t,{viewScaleInfo:s,viewSizeInfo:c}),e.globalAlpha=d}})}function Fh(e,t,n){const{renderContent:r,originElem:a,calcElemSize:i,viewSizeInfo:o}=n,s=o.devicePixelRatio,{clipPath:c}=(a==null?void 0:a.detail)||{};if(c&&i&&c.commands){const{x:d,y:u,w:f,h}=i,{originW:p,originH:v,originX:g,originY:m}=c,b=f/p,y=h/v,E=g*b,w=m*y,S=d-E,C=u-w;e.save(),e.translate(S,C),e.scale(s*b,s*y);const j=Gd(c.commands||[]),R=new Path2D(j);e.clip(R),e.translate(0-S,0-C),e.setTransform(1,0,0,1,0,0),Ct(e,Object.assign({},t),()=>{r==null||r()}),e.restore()}else r==null||r()}function Hh(e,t,n){var r,a;const{pattern:i,viewScaleInfo:o,viewSizeInfo:s}=n,c=[];if(t.detail.background||i){const{x:d,y:u,w:f,h,radiusList:p}=Ko(t,{viewScaleInfo:o,viewSizeInfo:s});if(e.beginPath(),e.moveTo(d+p[0],u),e.arcTo(d+f,u,d+f,u+h,p[1]),e.arcTo(d+f,u+h,d,u+h,p[2]),e.arcTo(d,u+h,d,u,p[3]),e.arcTo(d,u,d+f,u,p[0]),e.closePath(),typeof i=="string")e.fillStyle=i;else if(["CanvasPattern"].includes(Mr.type(i)))e.fillStyle=i;else if(typeof t.detail.background=="string")e.fillStyle=t.detail.background;else if(((r=t.detail.background)===null||r===void 0?void 0:r.type)==="linear-gradient"){const v=vo(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});e.fillStyle=v}else if(((a=t.detail.background)===null||a===void 0?void 0:a.type)==="radial-gradient"){const v=vo(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});if(e.fillStyle=v,c&&c.length>0)for(let g=0;g<(c==null?void 0:c.length);g++){const m=c[g];m.method==="translate"?e.translate(m.args[0]+d,m.args[1]+u):m.method==="rotate"?e.rotate(...m.args):m.method==="scale"&&e.scale(...m.args)}}e.fill(),c&&c.length>0&&e.setTransform(1,0,0,1,0,0)}}function Wh(e,t,n){if(t.detail.borderWidth===0||!Ya(t.detail.borderColor))return;const{viewScaleInfo:r}=n,{scale:a}=r;let i=mo.borderColor;Ya(t.detail.borderColor)===!0&&(i=t.detail.borderColor);const{borderWidth:o,borderRadius:s,borderDash:c,boxSizing:d=mo.boxSizing}=t.detail;let u=0;typeof o=="number"&&(u=o||1),u=u*a;let f=[0,0,0,0];if(typeof s=="number"){const b=s*a;f=[b,b,b,b]}else Array.isArray(s)&&(s==null?void 0:s.length)===4&&(f=[s[0]*a,s[1]*a,s[2]*a,s[3]*a]);e.strokeStyle=i;let h=[];Array.isArray(c)&&c.length>0&&(h=c.map(b=>Math.ceil(b*a)));let p=0,v=0,g=0,m=0;if(Array.isArray(o)&&(p=(o[0]||0)*a,v=(o[1]||0)*a,g=(o[2]||0)*a,m=(o[3]||0)*a),m||v||p||g){e.lineCap="butt";let{x:b,y,w:E,h:w}=t;d==="border-box"?(b=b+m/2,y=y+p/2,E=E-m/2-v/2,w=w-p/2-g/2):d==="content-box"?(b=b-m/2,y=y-p/2,E=E+m/2+v/2,w=w+p/2+g/2):(b=t.x,y=t.y,E=t.w,w=t.h),p&&(e.beginPath(),e.lineWidth=p,e.moveTo(b-m/2,y),e.lineTo(b+E+v/2,y),e.closePath(),e.stroke()),v&&(e.beginPath(),e.lineWidth=v,e.moveTo(b+E,y-p/2),e.lineTo(b+E,y+w+g/2),e.closePath(),e.stroke()),g&&(e.beginPath(),e.lineWidth=g,e.moveTo(b-m/2,y+w),e.lineTo(b+E+v/2,y+w),e.closePath(),e.stroke()),m&&(e.beginPath(),e.lineWidth=m,e.moveTo(b,y-p/2),e.lineTo(b,y+w+g/2),e.closePath(),e.stroke())}else{let{x:b,y,w:E,h:w}=t;d==="border-box"?(b=t.x+u/2,y=t.y+u/2,E=t.w-u,w=t.h-u):d==="content-box"?(b=t.x-u/2,y=t.y-u/2,E=t.w+u,w=t.h+u):(b=t.x,y=t.y,E=t.w,w=t.h),h.length>0?e.lineCap="butt":e.lineCap="square",E=Math.max(E,1),w=Math.max(w,1),f=f.map(S=>Math.min(S,E/2,w/2)),e.setLineDash(h),e.lineWidth=u,e.beginPath(),e.moveTo(b+f[0],y),e.arcTo(b+E,y,b+E,y+w,f[1]),e.arcTo(b+E,y+w,b,y+w,f[2]),e.arcTo(b,y+w,b,y,f[3]),e.arcTo(b,y,b+E,y,f[0]),e.closePath(),e.stroke()}e.setLineDash([])}function qn(e,t,n){const{detail:r}=t,{viewScaleInfo:a,renderContent:i}=n,{shadowColor:o,shadowOffsetX:s,shadowOffsetY:c,shadowBlur:d}=r;St.number(d)?(e.save(),e.shadowColor=o||mo.shadowColor,e.shadowOffsetX=(s||0)*a.scale,e.shadowOffsetY=(c||0)*a.scale,e.shadowBlur=(d||0)*a.scale,i(),e.restore()):i()}function Gh(e,t,n){const{detail:r,angle:a}=t,{background:i="#000000",borderColor:o="#000000",boxSizing:s,borderWidth:c=0}=r;let d=0;typeof c=="number"&&c>0?d=c:Array.isArray(c)&&typeof c[0]=="number"&&c[0]>0&&(d=c[0]);const{calculator:u,viewScaleInfo:f,viewSizeInfo:h,parentOpacity:p}=n,{x:v,y:g,w:m,h:b}=(u==null?void 0:u.elementSize({x:t.x,y:t.y,w:t.w,h:t.h},f,h))||t,y=Object.assign(Object.assign({},t),{x:v,y:g,w:m,h:b,angle:a});Ct(e,{x:v,y:g,w:m,h:b,angle:a},()=>{qn(e,y,{viewScaleInfo:f,viewSizeInfo:h,renderContent:()=>{let E=m/2,w=b/2;const S=v+E,C=g+w;if(d>0&&(s==="border-box"?(E=E-d,w=w-d):s==="center-line"?(E=E-d/2,w=w-d/2):(E=E-d,w=w-d)),E>=0&&w>=0){const j=Jt(y)*p;if(e.globalAlpha=j,typeof c=="number"&&c>0){const B=c/2+E,F=c/2+w;e.beginPath(),e.strokeStyle=o,e.lineWidth=c,e.circle(S,C,B,F,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath();const R=vo(e,i,{viewElementSize:{x:v,y:g,w:m,h:b},viewScaleInfo:f,opacity:e.globalAlpha});e.fillStyle=R,e.circle(S,C,E,w,0,0,2*Math.PI),e.closePath(),e.fill(),e.globalAlpha=p}}})})}function Vh(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize(t,a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});Ct(e,{x:s,y:c,w:d,h:u,angle:f},()=>{qn(e,h,{viewScaleInfo:a,viewSizeInfo:i,renderContent:()=>{Jn(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{}})}})})}function Uh(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t,p=Object.assign(Object.assign({},t),{x:c,y:d,w:u,h:f,angle:h});Ct(e,{x:c,y:d,w:u,h:f,angle:h},()=>{qn(e,p,{viewScaleInfo:i,viewSizeInfo:o,renderContent:()=>{Jn(e,p,{originElem:t,calcElemSize:{x:c,y:d,w:u,h:f,angle:h},viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s,renderContent:()=>{if(!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="image"&&r){e.globalAlpha=Jt(t)*s;const{x:v,y:g,w:m,h:b,radiusList:y}=Ko(p,{viewScaleInfo:i,viewSizeInfo:o});e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(v+y[0],g),e.arcTo(v+m,g,v+m,g+b,y[1]),e.arcTo(v+m,g+b,v,g+b,y[2]),e.arcTo(v,g+b,v,g,y[3]),e.arcTo(v,g,v+m,g,y[0]),e.closePath(),e.fill(),e.clip(),e.drawImage(r,v,g,m,b),e.globalAlpha=s,e.restore()}}})}})})}function Yh(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t;Ct(e,{x:c,y:d,w:u,h:f,angle:h},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="svg"&&r&&(e.globalAlpha=Jt(t)*s,e.drawImage(r,c,d,u,f),e.globalAlpha=s)})}function Xh(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t;Ct(e,{x:c,y:d,w:u,h:f,angle:h},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="html"&&r&&(e.globalAlpha=Jt(t)*s,e.drawImage(r,c,d,u,f),e.globalAlpha=s)})}const Fi=nn();function Zh(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize(t,a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});Ct(e,{x:s,y:c,w:d,h:u,angle:f},()=>{Jn(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{const p=Object.assign(Object.assign({},Fi),t.detail),v=(p.fontSize||Fi.fontSize)*a.scale,g=p.lineHeight?p.lineHeight*a.scale:v;e.fillStyle=t.detail.color||Fi.color,e.textBaseline="top",e.$setFont({fontWeight:p.fontWeight,fontSize:v,fontFamily:p.fontFamily});const m=p.text.replace(/\r\n/gi,` -`),b=g,y=m.split(` -`),E=[];let w=0;y.forEach((C,j)=>{let R="";if(C.length>0){for(let B=0;Bu));B++)if(C.length-1===B&&(w+1)*b{let B=s;p.textAlign==="center"?B=s+(d-j.width)/2:p.textAlign==="right"&&(B=s+(d-j.width)),e.fillText(j.text,B,C+b*R)})}}})})}function Kh(e,t,n){const{detail:r}=t,{originX:a,originY:i,originW:o,originH:s}=r,{calculator:c,viewScaleInfo:d,viewSizeInfo:u,parentOpacity:f}=n,{x:h,y:p,w:v,h:g,angle:m}=(c==null?void 0:c.elementSize(t,d,u))||t,b=v/o,y=g/s,E=a*b,w=i*y,S=h-E,C=p-w,j=d.scale*u.devicePixelRatio,R=Object.assign(Object.assign({},t),{x:h,y:p,w:v,h:g,angle:m});Ct(e,{x:h,y:p,w:v,h:g,angle:m},()=>{Jn(e,R,{originElem:t,calcElemSize:{x:h,y:p,w:v,h:g,angle:m},viewScaleInfo:d,viewSizeInfo:u,parentOpacity:f,renderContent:()=>{qn(e,R,{viewScaleInfo:d,viewSizeInfo:u,renderContent:()=>{e.save(),e.translate(S,C),e.scale(j*b/d.scale,j*y/d.scale);const B=Gd(r.commands||[]),F=new Path2D(B);r.fill&&(e.fillStyle=r.fill,e.fill(F)),r.stroke&&r.strokeWidth!==0&&(e.strokeStyle=r.stroke,e.lineWidth=(r.strokeWidth||1)/u.devicePixelRatio,e.lineCap=r.strokeLineCap||"square",e.stroke(F)),e.translate(-S,-C),e.restore()}})}})})}function Qd(e,t,n){var r;if(((r=t==null?void 0:t.operations)===null||r===void 0?void 0:r.invisible)===!0)return;const{w:a,h:i}=t,{scale:o}=n.viewScaleInfo;if(!(o<1&&(a*o<1||i*o<1)||n.parentOpacity===0))try{switch(t.type){case"rect":{Vh(e,t,n);break}case"circle":{Gh(e,t,n);break}case"text":{Zh(e,t,n);break}case"image":{Uh(e,t,n);break}case"svg":{Yh(e,t,n);break}case"html":{Xh(e,t,n);break}case"path":{Kh(e,t,n);break}case"group":{const s=Object.assign(Object.assign({},n.elementAssets||{}),t.detail.assets||{});Qh(e,t,Object.assign(Object.assign({},n),{elementAssets:s}));break}default:break}}catch(s){console.error(s)}}function Qh(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize({x:t.x,y:t.y,w:t.w,h:t.h,angle:t.angle},a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});Ct(e,{x:s,y:c,w:d,h:u,angle:f},()=>{e.globalAlpha=Jt(t)*o,qn(e,h,{viewScaleInfo:a,viewSizeInfo:i,renderContent:()=>{Jn(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{const{x:p,y:v,w:g,h:m,radiusList:b}=Ko(h,{viewScaleInfo:a,viewSizeInfo:i});if(t.detail.overflow==="hidden"&&(e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(p+b[0],v),e.arcTo(p+g,v,p+g,v+m,b[1]),e.arcTo(p+g,v+m,p,v+m,b[2]),e.arcTo(p,v+m,p,v,b[3]),e.arcTo(p,v,p+g,v,b[0]),e.closePath(),e.fill(),e.clip()),Array.isArray(t.detail.children)){const{parentElementSize:y}=n,E={x:y.x+t.x,y:y.y+t.y,w:t.w||y.w,h:t.h||y.h,angle:t.angle},{calculator:w}=n;for(let S=0;S{Jn(e,p,{originElem:s,calcElemSize:{x:c,y:d,w:u,h:f,angle:h},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{}})}})}var Hi=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},fe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},pr=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ze,Nr,Dr,Xe,Et,Aa,Wi,al,il,ol,Jd,qd;const tp=["image","svg","html"],Ar=e=>{var t,n,r;let a=null;return e.type==="image"?a=((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.src)||null:e.type==="svg"?a=((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.svg)||null:e.type==="html"&&(a=((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.html)||null),typeof a=="string"&&a?Zt(a)?a:Zn(a):Zn(`${Xn()}-${e.uuid}-${Xn()}-${Xn()}`)};class np extends Qt{constructor(){super(),Ze.add(this),Nr.set(this,{}),Dr.set(this,{}),Xe.set(this,{}),Et.set(this,!1),fe(this,Ze,"m",Aa).call(this,"image",(t,n)=>Hi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.src])===null||r===void 0?void 0:r.value)||t.detail.src,i=yield pi(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}})),fe(this,Ze,"m",Aa).call(this,"html",(t,n)=>Hi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.html])===null||r===void 0?void 0:r.value)||t.detail.html,i=yield Yf(a,{width:t.detail.originW||t.w,height:t.detail.originH||t.h});return{uuid:t.uuid,lastModified:Date.now(),content:i}})),fe(this,Ze,"m",Aa).call(this,"svg",(t,n)=>Hi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.svg])===null||r===void 0?void 0:r.value)||t.detail.svg,i=yield Vf(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}}))}isDestroyed(){return fe(this,Et,"f")}destroy(){pr(this,Et,!0,"f"),this.clear(),pr(this,Nr,null,"f"),pr(this,Dr,null,"f"),pr(this,Xe,null,"f")}load(t,n){fe(this,Et,"f")!==!0&&(fe(this,Ze,"m",qd).call(this,t)||tp.includes(t.type)&&fe(this,Ze,"m",Jd).call(this,t,n))}getContent(t){var n,r;const a=Ar(t);return((r=(n=fe(this,Xe,"f"))===null||n===void 0?void 0:n[a])===null||r===void 0?void 0:r.content)||null}getLoadItemMap(){return fe(this,Xe,"f")}setLoadItemMap(t){pr(this,Xe,t,"f")}}Nr=new WeakMap,Dr=new WeakMap,Xe=new WeakMap,Et=new WeakMap,Ze=new WeakSet,Aa=function(t,n){fe(this,Nr,"f")[t]=n},Wi=function(t){var n,r,a;let i=null;return t.type==="image"?i=((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.src)||null:t.type==="svg"?i=((r=t==null?void 0:t.detail)===null||r===void 0?void 0:r.svg)||null:t.type==="html"&&(i=((a=t==null?void 0:t.detail)===null||a===void 0?void 0:a.html)||null),i},al=function(t){return{element:t,status:"null",content:null,error:null,startTime:-1,endTime:-1,source:fe(this,Ze,"m",Wi).call(this,t)}},il=function(t){const n=Ar(t.element),r=fe(this,Xe,"f")[n];fe(this,Et,"f")||(r?r.startTime{fe(this,Et,"f")||(r.content=o.content,r.endTime=Date.now(),r.status="load",fe(this,Ze,"m",il).call(this,r))}).catch(o=>{console.warn(`Load element source "${r.source}" fail`,o,t),r.endTime=Date.now(),r.status="error",r.error=o,fe(this,Ze,"m",ol).call(this,r)}))},qd=function(t){var n;const r=Ar(t),a=(n=fe(this,Dr,"f"))===null||n===void 0?void 0:n[r];return!!(a&&a.status==="error"&&a.source&&a.source===fe(this,Ze,"m",Wi).call(this,t))};var gr=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},tt=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},bo,Rt,wt,_a,eu;class tu extends Qt{constructor(t){super(),bo.add(this),Rt.set(this,void 0),wt.set(this,new np),_a.set(this,!1),gr(this,Rt,t,"f"),tt(this,bo,"m",eu).call(this)}isDestroyed(){return tt(this,_a,"f")}destroy(){this.clear(),gr(this,Rt,null,"f"),tt(this,wt,"f").destroy(),gr(this,wt,null,"f"),gr(this,_a,!0,"f")}updateOptions(t){gr(this,Rt,t,"f")}drawData(t,n){const r=tt(this,wt,"f"),{calculator:a}=tt(this,Rt,"f"),i=tt(this,Rt,"f").viewContext;i.clearRect(0,0,i.canvas.width,i.canvas.height);const o={x:0,y:0,w:n.viewSizeInfo.width,h:n.viewSizeInfo.height};t.underlay&&ep(i,t.underlay,Object.assign({loader:r,calculator:a,parentElementSize:o,parentOpacity:1},n)),qh(i,t,Object.assign({loader:r,calculator:a,parentElementSize:o,elementAssets:t.assets,parentOpacity:1},n))}scale(t){const{sharer:n}=tt(this,Rt,"f");if(!n)return;const{data:r,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s,width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}=n.getActiveStoreSnapshot();r&&this.drawData(r,{viewScaleInfo:{scale:t,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s},viewSizeInfo:{width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}})}setLoadItemMap(t){tt(this,wt,"f").setLoadItemMap(t)}getLoadItemMap(){return tt(this,wt,"f").getLoadItemMap()}getLoader(){return tt(this,wt,"f")}}Rt=new WeakMap,wt=new WeakMap,_a=new WeakMap,bo=new WeakSet,eu=function(){const t=tt(this,wt,"f");t.on("load",n=>{this.trigger("load",n)}),t.on("error",()=>{})};var sl=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ll=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},yn;class nu{constructor(t){yn.set(this,void 0),sl(this,yn,t,"f")}destroy(){sl(this,yn,null,"f")}elementSize(t,n,r){return Xo(t,{viewScaleInfo:n,viewSizeInfo:r})}isElementInView(t,n,r){return Ch(t,{viewScaleInfo:n,viewSizeInfo:r})}isPointInElement(t,n,r,a){const i=ll(this,yn,"f").viewContext;return go(t,{context2d:i,element:n,viewScaleInfo:r,viewSizeInfo:a})}getPointElement(t,n){const r=ll(this,yn,"f").viewContext;return Sh(t,Object.assign(Object.assign({},n),{context2d:r}))}}yn=new WeakMap;var Gi=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ne=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},we,Gn,Ue,Oa,ru,Ta,$a,Pa,Ia,za,Ra,Na,Da,bt,yt,Vt;function cl(e){return e>0||e<0||e===0}class rp extends Qt{constructor(t){super(),we.add(this),Gn.set(this,void 0),Ue.set(this,void 0),Oa.set(this,!1),Ta.set(this,r=>{if(!ne(this,we,"m",bt).call(this,r))return;const a=ne(this,we,"m",yt).call(this,r);if(!ne(this,we,"m",Vt).call(this,a))return;r.preventDefault(),r.stopPropagation();const i=r.deltaX>0||r.deltaX<0?r.deltaX:0,o=r.deltaY>0||r.deltaY<0?r.deltaY:0;r.ctrlKey===!0&&this.has("wheelScale")?this.trigger("wheelScale",{deltaX:i,deltaY:o,point:a}):this.has("wheel")&&this.trigger("wheel",{deltaX:i,deltaY:o,point:a})}),$a.set(this,r=>{if(!ne(this,we,"m",bt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",yt).call(this,r);ne(this,we,"m",Vt).call(this,a)}),Pa.set(this,r=>{if(!ne(this,we,"m",bt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",yt).call(this,r);if(!ne(this,we,"m",Vt).call(this,a))return;const i=500,o=Date.now(),s=ne(this,Ue,"f").get("prevClickPoint");s&&o-s.t<=i&&Math.abs(s.x-a.x)<=5&&Math.abs(s.y-a.y)<=5?this.trigger("doubleClick",{point:a}):ne(this,Ue,"f").set("prevClickPoint",a)}),Ia.set(this,r=>{if(ne(this,Ue,"f").set("hasPointDown",!1),!ne(this,we,"m",bt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",yt).call(this,r);this.trigger("pointLeave",{point:a})}),za.set(this,r=>{if(ne(this,Ue,"f").set("hasPointDown",!1),!ne(this,we,"m",bt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",yt).call(this,r);this.trigger("pointEnd",{point:a})}),Ra.set(this,r=>{if(!ne(this,we,"m",bt).call(this,r))return;r.preventDefault(),r.stopPropagation();const a=ne(this,we,"m",yt).call(this,r);if(!ne(this,we,"m",Vt).call(this,a)){ne(this,Ue,"f").get("hasPointDown")&&(this.trigger("pointLeave",{point:a}),ne(this,Ue,"f").set("hasPointDown",!1));return}ne(this,Ue,"f").get("hasPointDown")===!0&&this.trigger("pointMove",{point:a})}),Na.set(this,r=>{if(!ne(this,we,"m",bt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",yt).call(this,r);ne(this,we,"m",Vt).call(this,a)&&(ne(this,Ue,"f").set("hasPointDown",!0),this.trigger("pointStart",{point:a}))}),Da.set(this,r=>{if(!ne(this,we,"m",bt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",yt).call(this,r);ne(this,we,"m",Vt).call(this,a)&&this.trigger("hover",{point:a})});const n=new Br({defaultStorage:{hasPointDown:!1,prevClickPoint:null}});Gi(this,Ue,n,"f"),Gi(this,Gn,t,"f"),ne(this,we,"m",ru).call(this)}onEvents(){if(ne(this,Oa,"f"))return;const t=window;t.addEventListener("mousemove",ne(this,Da,"f")),t.addEventListener("mousedown",ne(this,Na,"f")),t.addEventListener("mousemove",ne(this,Ra,"f")),t.addEventListener("mouseup",ne(this,za,"f")),t.addEventListener("mouseleave",ne(this,Ia,"f")),t.addEventListener("wheel",ne(this,Ta,"f"),{passive:!1}),t.addEventListener("click",ne(this,Pa,"f")),t.addEventListener("contextmenu",ne(this,$a,"f"))}offEvents(){const t=window;t.removeEventListener("mousemove",ne(this,Da,"f")),t.removeEventListener("mousedown",ne(this,Na,"f")),t.removeEventListener("mousemove",ne(this,Ra,"f")),t.removeEventListener("mouseup",ne(this,za,"f")),t.removeEventListener("mouseleave",ne(this,Ia,"f")),t.removeEventListener("wheel",ne(this,Ta,"f")),t.removeEventListener("click",ne(this,Pa,"f")),t.removeEventListener("contextmenu",ne(this,$a,"f"))}destroy(){this.offEvents(),ne(this,Ue,"f").destroy(),Gi(this,Oa,!0,"f")}}Gn=new WeakMap,Ue=new WeakMap,Oa=new WeakMap,Ta=new WeakMap,$a=new WeakMap,Pa=new WeakMap,Ia=new WeakMap,za=new WeakMap,Ra=new WeakMap,Na=new WeakMap,Da=new WeakMap,we=new WeakSet,ru=function(){this.onEvents()},bt=function(t){return t.target===ne(this,Gn,"f").boardContent.boardContext.canvas},yt=function(t){const r=ne(this,Gn,"f").boardContent.boardContext.canvas.getBoundingClientRect();return{x:t.clientX-r.left,y:t.clientY-r.top,t:Date.now()}},Vt=function(t){const n=ne(this,Gn,"f").sharer.getActiveViewSizeInfo(),{width:r,height:a}=n;return!!(cl(t.x)&&cl(t.y)&&t.x<=r&&t.y<=a)};var dl=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ge=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ve,wn;const ap={width:0,height:0,devicePixelRatio:1,contextWidth:0,contextHeight:0,data:null,scale:1,offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0};class ip{constructor(){ve.set(this,void 0),wn.set(this,void 0);const t=new Br({defaultStorage:ap}),n=new Br({defaultStorage:{}});dl(this,ve,t,"f"),dl(this,wn,n,"f")}getActiveStorage(t){return ge(this,ve,"f").get(t)}setActiveStorage(t,n){return ge(this,ve,"f").set(t,n)}getActiveStoreSnapshot(){return ge(this,ve,"f").getSnapshot()}getSharedStorage(t){return ge(this,wn,"f").get(t)}setSharedStorage(t,n){return ge(this,wn,"f").set(t,n)}getSharedStoreSnapshot(){return ge(this,wn,"f").getSnapshot()}getActiveViewScaleInfo(){return{scale:ge(this,ve,"f").get("scale"),offsetTop:ge(this,ve,"f").get("offsetTop"),offsetBottom:ge(this,ve,"f").get("offsetBottom"),offsetLeft:ge(this,ve,"f").get("offsetLeft"),offsetRight:ge(this,ve,"f").get("offsetRight")}}setActiveViewScaleInfo(t){const{scale:n,offsetTop:r,offsetBottom:a,offsetLeft:i,offsetRight:o}=t;ge(this,ve,"f").set("scale",n),ge(this,ve,"f").set("offsetTop",r),ge(this,ve,"f").set("offsetBottom",a),ge(this,ve,"f").set("offsetLeft",i),ge(this,ve,"f").set("offsetRight",o)}setActiveViewSizeInfo(t){ge(this,ve,"f").set("width",t.width),ge(this,ve,"f").set("height",t.height),ge(this,ve,"f").set("devicePixelRatio",t.devicePixelRatio),ge(this,ve,"f").set("contextWidth",t.contextWidth),ge(this,ve,"f").set("contextHeight",t.contextHeight)}getActiveViewSizeInfo(){return{width:ge(this,ve,"f").get("width"),height:ge(this,ve,"f").get("height"),devicePixelRatio:ge(this,ve,"f").get("devicePixelRatio"),contextWidth:ge(this,ve,"f").get("contextWidth"),contextHeight:ge(this,ve,"f").get("contextHeight")}}}ve=new WeakMap,wn=new WeakMap;var ja=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ze=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},jr,it,Vn,xn,au,iu;const{requestAnimationFrame:op}=window;class sp extends Qt{constructor(t){super(),jr.add(this),it.set(this,void 0),Vn.set(this,[]),xn.set(this,"FREE"),ja(this,it,t,"f"),ze(this,jr,"m",au).call(this)}drawFrame(){const{sharer:t}=ze(this,it,"f"),n=t.getActiveStoreSnapshot(),r=t.getSharedStoreSnapshot();ze(this,Vn,"f").push({activeStore:n,sharedStore:r}),ze(this,jr,"m",iu).call(this)}scale(t){const{scale:n,point:r}=t,{sharer:a}=ze(this,it,"f"),{moveX:i,moveY:o}=xh({scale:n,point:r,viewScaleInfo:a.getActiveViewScaleInfo(),viewSizeInfo:a.getActiveViewSizeInfo()});return a.setActiveStorage("scale",n),{moveX:i,moveY:o}}scroll(t){const{sharer:n}=ze(this,it,"f"),r=n.getActiveViewScaleInfo(),{moveX:a,moveY:i}=t,o=n.getActiveViewSizeInfo(),s=Eh({moveX:a,moveY:i,viewScaleInfo:r,viewSizeInfo:o});return n.setActiveViewScaleInfo(s),s}updateViewScaleInfo(t){const{sharer:n}=ze(this,it,"f"),r=wh(t,{viewSizeInfo:n.getActiveViewSizeInfo()});return n.setActiveViewScaleInfo(r),r}resize(t={}){const{sharer:n}=ze(this,it,"f"),r=n.getActiveViewSizeInfo(),a=Object.assign(Object.assign({},r),t),{width:i,height:o,devicePixelRatio:s}=a,{underContext:c,boardContext:d,helperContext:u,viewContext:f}=ze(this,it,"f").boardContent;return d.canvas.width=i*s,d.canvas.height=o*s,d.canvas.style.width=`${i}px`,d.canvas.style.height=`${o}px`,c.canvas.width=i*s,c.canvas.height=o*s,u.canvas.width=i*s,u.canvas.height=o*s,f.canvas.width=i*s,f.canvas.height=o*s,n.setActiveViewSizeInfo(a),a}}it=new WeakMap,Vn=new WeakMap,xn=new WeakMap,jr=new WeakSet,au=function(){const{renderer:t}=ze(this,it,"f");t.on("load",()=>{this.drawFrame()})},iu=function e(){if(ze(this,xn,"f")==="DRAWING"||ze(this,Vn,"f").length===0)return;ja(this,xn,"DRAWING","f");const t=ze(this,Vn,"f").shift(),{renderer:n,boardContent:r,beforeDrawFrame:a,afterDrawFrame:i}=ze(this,it,"f");if(t){const{scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u,width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g}=t.activeStore,m={scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u},b={width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g};t!=null&&t.activeStore.data&&n.drawData(t.activeStore.data,{viewScaleInfo:m,viewSizeInfo:b}),a({snapshot:t}),r.drawView(),i({snapshot:t})}if(ze(this,Vn,"f").length===0){ja(this,xn,"COMPLETE","f");return}ja(this,xn,"DRAWING","f")&&op(()=>{ze(this,jr,"m",e).call(this)})};var Nt=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},W=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Oe,En,xt,Ja,de,$e,_r,dt,nt,Sn,Or,La,ou,ul,fl,hl,pl,gl,vl,ml,bl,yl,wl,su,lu,cu,Tr;const la=10;class lp{constructor(t){Oe.add(this),En.set(this,void 0),xt.set(this,new WeakMap),Ja.set(this,[]),de.set(this,[]),$e.set(this,void 0),_r.set(this,void 0),dt.set(this,void 0),nt.set(this,void 0),Sn.set(this,void 0),Or.set(this,new Qt),La.set(this,!1);const{boardContent:n}=t,r=new ip,a=new nu({viewContext:n.viewContext}),i=new rp({boardContent:n,sharer:r}),o=new tu({viewContext:n.viewContext,sharer:r,calculator:a});Nt(this,En,t,"f"),Nt(this,dt,r,"f"),Nt(this,$e,i,"f"),Nt(this,_r,o,"f"),Nt(this,Sn,a,"f"),Nt(this,nt,new sp({boardContent:t.boardContent,sharer:r,renderer:o,calculator:W(this,Sn,"f"),beforeDrawFrame:s=>{W(this,Oe,"m",lu).call(this,s)},afterDrawFrame:s=>{W(this,Oe,"m",cu).call(this,s)}}),"f"),W(this,Oe,"m",ou).call(this),W(this,Oe,"m",Tr).call(this)}isDestroyed(){return W(this,La,"f")}destroy(){W(this,$e,"f").destroy(),W(this,_r,"f").destroy(),W(this,Sn,"f").destroy(),W(this,Or,"f").destroy(),Nt(this,La,!0,"f")}getSharer(){return W(this,dt,"f")}getViewer(){return W(this,nt,"f")}getRenderer(){return W(this,_r,"f")}setData(t){const n=W(this,dt,"f");W(this,dt,"f").setActiveStorage("data",t);const r=n.getActiveViewSizeInfo(),a=kd(t.elements,{viewWidth:r.width,viewHeight:r.height,extend:!0});W(this,nt,"f").drawFrame();const i=Object.assign(Object.assign({},r),a);return W(this,dt,"f").setActiveViewSizeInfo(i),{viewSizeInfo:i}}getData(){const{data:t}=W(this,dt,"f").getActiveStoreSnapshot();return t}use(t){var n,r,a;if(W(this,xt,"f").has(t)){const h=W(this,xt,"f").get(t);if(h){(r=(n=h.middlewareObject).use)===null||r===void 0||r.call(n),h.status="enable",W(this,xt,"f").set(t,h),W(this,Oe,"m",Tr).call(this);return}}const{boardContent:i,container:o}=W(this,En,"f"),s=W(this,dt,"f"),c=W(this,nt,"f"),d=W(this,Sn,"f"),u=W(this,Or,"f"),f=t({boardContent:i,sharer:s,viewer:c,calculator:d,eventHub:u,container:o});(a=f.use)===null||a===void 0||a.call(f),W(this,Ja,"f").push(t),W(this,de,"f").push(f),W(this,xt,"f").set(t,{status:"enable",middlewareObject:f}),W(this,Oe,"m",Tr).call(this)}disuse(t){var n,r;const a=W(this,xt,"f").get(t);a&&((r=(n=a.middlewareObject).disuse)===null||r===void 0||r.call(n),a.status="disable",W(this,xt,"f").set(t,a),W(this,Oe,"m",Tr).call(this))}scale(t){const n=W(this,nt,"f"),{moveX:r,moveY:a}=n.scale(t);n.scroll({moveX:r,moveY:a})}scroll(t){return W(this,nt,"f").scroll(t)}updateViewScaleInfo(t){return W(this,nt,"f").updateViewScaleInfo(t)}resize(t){const n=W(this,nt,"f").resize(t),{width:r,height:a,devicePixelRatio:i}=t,{boardContent:o}=W(this,En,"f");o.viewContext.$resize({width:r,height:a,devicePixelRatio:i}),o.helperContext.$resize({width:r,height:a,devicePixelRatio:i}),o.boardContext.$resize({width:r,height:a,devicePixelRatio:i}),o.underContext.$resize({width:r,height:a,devicePixelRatio:i}),W(this,nt,"f").drawFrame(),W(this,$e,"f").trigger("resize",n),W(this,dt,"f").setActiveViewSizeInfo(t)}clear(){const{boardContent:t}=W(this,En,"f"),{underContext:n,helperContext:r,viewContext:a,boardContext:i}=t;n.clearRect(0,0,n.canvas.width,n.canvas.height),r.clearRect(0,0,r.canvas.width,r.canvas.height),a.clearRect(0,0,a.canvas.width,a.canvas.height),i.clearRect(0,0,i.canvas.width,i.canvas.height),W(this,Oe,"m",su).call(this)}getEventHub(){return W(this,Or,"f")}onWatcherEvents(){W(this,$e,"f").onEvents()}offWatcherEvents(){W(this,$e,"f").offEvents()}}En=new WeakMap,xt=new WeakMap,Ja=new WeakMap,de=new WeakMap,$e=new WeakMap,_r=new WeakMap,dt=new WeakMap,nt=new WeakMap,Sn=new WeakMap,Or=new WeakMap,La=new WeakMap,Oe=new WeakSet,ou=function(){W(this,$e,"f").on("pointStart",W(this,Oe,"m",ul).bind(this)),W(this,$e,"f").on("pointEnd",W(this,Oe,"m",fl).bind(this)),W(this,$e,"f").on("pointMove",aa(t=>{W(this,Oe,"m",hl).call(this,t)},la)),W(this,$e,"f").on("hover",aa(t=>{W(this,Oe,"m",pl).call(this,t)},la)),W(this,$e,"f").on("wheel",aa(t=>{W(this,Oe,"m",vl).call(this,t)},la)),W(this,$e,"f").on("wheelScale",aa(t=>{W(this,Oe,"m",ml).call(this,t)},la)),W(this,$e,"f").on("scrollX",W(this,Oe,"m",bl).bind(this)),W(this,$e,"f").on("scrollY",W(this,Oe,"m",yl).bind(this)),W(this,$e,"f").on("resize",W(this,Oe,"m",wl).bind(this)),W(this,$e,"f").on("doubleClick",W(this,Oe,"m",gl).bind(this))},ul=function(t){var n;for(let r=0;r{const a=n.get(r);(a==null?void 0:a.status)==="enable"&&(a!=null&&a.middlewareObject)&&t.push(a.middlewareObject)}),Nt(this,de,t,"f")};const cp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MDc6MjYrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjliMGM0MzI2LWU4ZTQtNDlkNy04MmUzLTgxODkwYTE2ZmU1YSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjMzOGFhZDBmLWZkZjMtODE0MS1iMTZmLWNiZWIzNTQyYTJhMCIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjUwODAxNzc1LWZlNGEtNDQyMy05NDQ3LThkYWRhNzZhYTllOSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NTA4MDE3NzUtZmU0YS00NDIzLTk0NDctOGRhZGE3NmFhOWU5IiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjA3OjI2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6OWIwYzQzMjYtZThlNC00OWQ3LTgyZTMtODE4OTBhMTZmZTVhIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7W6XrzAAAGLklEQVRYhb2Xf2iUdRzHX/txtfXLplZ6Wblm6fzRmG6r7Uou1AxKRjQKYUqgaLBACFogppcK1h8aLRkMSYaJIA5hYMomZpskEfPOufCaDpZ6t7rbre263U3vzn3643meu+eu3XNzvz7w4bbdc/e89nl/Pu/v50HUCAQCx1tbW0uAx4CHgSwggxkKERkziUQif2mQ0WjU53a7vwSeBB4BTEDmTICmBBwYGDivVlDjlFAo9KvT6dwIPAHkANkq6MwDXr169bCISENDg9TX14s+BgcHf2hubi5mBmRPCXj06NFPREQ6OjoEkPLycrl06VIMMhKJeFwu1xdMs+wpAYuLi9eIiIyOjkpeXp4AAsj27dvF7/fHQIPB4C9dXV0fME2ypwQEXvX7/bdFRNauXRsDBMRkMsnhw4cTZB8YGGhsamp6hSmW3Qhw1Y0bN86LiNTW1iYAallWViZtbW162ftcLtdO/i/7tAAWtba2ficicvLkyTEBtdy6dasMDg7GQIeHh9s7OzvfBx5nkrIbAS7du3fvxyIiPT09hoBa1tXVJcv+fWNj4zLgUeAhJiC7EeDLwOsiMioisnDhwnFBrlixQi5evKiX/c6tW7c+R5E9lweU3QjwReDV/v7+bhGRqqqqcQFquWnTJvH5fHrZLzocjkoSZU9bTSPA54GV165daxYROXDgwAMBannw4MFk2RsaGhqWME7ZjQDNwIrTp09/JSLS0tIyIUBACgoK5MKFCzHIcDj85+3btz8FZpFGdiPAZ4DCmpqaTSIiPp9vwoBaVlVVidfr1ct+/sqVK+9iILsR4FzgJcASDoeHRUSKioomDQnI/v37E2T3+Xz1hw4dWjSW7EaAeUA+UNbX12cXEdmyZcuUAAJiNpvlzJkzetl73G53rVrN2EmUCjATuA9EgYjL5eoGKCkpGatNHijmz5/Pxo0b2blzJ2azOfZ3k8lUYDabv45Go/Y7d+6sIY0VZQOjGqDT6bxeWlrKqlWrJgRlsVhYv349FRUVWCwWcnJyEt4PBoOuoaEhu9frvdzR0fHTtm3buolvRpLqe3OBp4EllZWV74mIRKNRyc3NTSvf7Nmzpbq6Wk6cOCFut1uSY2RkJOB0Ou3Nzc3Ha2trPwPWAGXAEuBZFFPPAbKMevBhYA6wCKgIBoP9IiKrV682hLPZbP8DEpH7vb29N1paWn602WwHFyxYsAX4EKgE3gIsQBFQgOIeT6j3z0wFqEkc60OPx9Odn58/t6SkhPb29jFLbrVa2bNnDwBer7fv5s2bPQ6Ho7upqcnZ1tbmASJq3gPC6utdYESXYfWeo6mkBaUHRQ/odrv/yM/Pt5SWlqb8kAbncDh+W7lyZYN683u6DOvAwipsOOnniA4wZf9lqhdoVYzY7fbrQMpBsdlsWK1WRkZGAtXV1d8D/wA+wKNLr5o+YEC9ZggIAEHiFbyfDhCUCcoFngIWFxYWrtMaat68eQl9V15eHmu2+vr6OuAd4A2gGFgMLERp/mdQ+noWyuadi9Jr2aQ4k42GBPXDs1Ga97WhoaFbIiIbNmxIANTWq87Ozp9VuApgGfACihPkoRjwI+p3mlSgtA9ZRkYNYwwKJBr2rl27sFqthEKhwZqamqOAX5f/AsPE5btLvM/GJWO6yFb/82eBonPnztWJiJw9e1YAWb58eUzaI0eOfAO8CbwCPIfiZZN+eEoncSaKLPOApbt3794uIuL1ehOktdvtF4C3gRKURXcOSn9lTRRsvIAZKI4+l/gjQFREZMeOHSIiEggE+tetW/cRitkuRhmERxnnxjxZQFDWnzzURwCv1+vUHxHHjh37lri0C1Am9KGpgDMC1G8SQnxxCHs8Hqf2RldX10+bN28+i+JjwyT62KSaP13oAfWTHO7t7f0dIBQK/b1v375GlEnVjPYuyoQaHlNTDahVMALca29vdwBcvnz5+KlTp26OATft1UuODBS7yEOxj0K/329HOSWWopjxlE1tchhtM7FriPfgXSDDbrfXo0gbJr4QzIi0WiRPYBbKZJrUV23b0dYn7XSYcsBkS9EiO/k6lApq1cwiPjzaAM1Y9cYC1G6uAWrPCtrvMwoHqU02Q5caIEzj1KaS+D+vIjxtLug31gAAAABJRU5ErkJggg==",du="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MzE6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjY0MTBhYjUzLWM0ZjEtNDVhNS04MjhkLTIxOTczOWFjOTk3MSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjBkMDNmNjM5LTE5MzctY2Y0MC1hMTg0LTIyMjg0NzczNWNmYSIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjgyYjQwZGRmLWE0ZGEtNDY3MC1iYzc2LTBhYjY3ZmI5M2I0ZSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ODJiNDBkZGYtYTRkYS00NjcwLWJjNzYtMGFiNjdmYjkzYjRlIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjMxOjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NjQxMGFiNTMtYzRmMS00NWE1LTgyOGQtMjE5NzM5YWM5OTcxIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz57vRudAAAEk0lEQVRYhe3ZW0jbVxzA8e8/MX+NYnG9uI4xE3bvoLt0FzradRfGBtsYo32YdAhb6WQyBqV7KOylpYjzZShDGfjmyxgbgjjwyRm16SYMhgiNKDhbL3VtNF4xJOnf3x7+59i/Wf4aTbInf3AwJMdzPjnnf/n9/jFEhGzDMIxMb3uAIsDs6ek5urS05Dtz5syE+uwekAQS6u89YD19gC0NIpJ1c8GZQHlXV9fJRCIxGo/HxxoaGj4CngWOAEGgEihXfT07MeQC3MB1dna+lkgkRkXF6urq3xcuXPgUOAE8DzwGPOiGLARwEy4ej4+JiITD4elr167NiIgsLi7eqq2trQPeBI4Bj7sh8w10xZmmeds0zdn+/v5/RERisdjUuXPnvgLeAl50Q+YTaAA+oKy7u/uE3laNAwSQ4uLiu6FQ6G4G5DG13YeAMjWWkU+gBygJhULHNe769etTTpwDGXUiz58//yXwujp5qoAHgBLAk0+gNxKJHEulUiMKN2ma5gwgPp/vjhOXjlxYWJisq6urBV5RW30IKAW8eQPGYrGjlmXdEBEZHBy8aZrmFCCmac729fVtAHt7e6MO5N2+vr47IiJLS0s3L126dBZ4Sh2LZUBRwVdwYGBgVuwOYh/zsoF0bnPBVzDTMRgOh6dFhROokSIi8/Pz0+pEeaPQx+DGWdzV1XVSX2LcgCIic3NzMzU1NV8D7wIvq9WrLNRZvOk62NHRccqJTAdGo9Hb1dXV3wAfYt9VjgAPFfI66EQWAxU9PT0fuwEvXrzYBJwF3gFeAAJAhfrfrO4k/7lxZxnr2JlJqry8POnWyePx6H4JR0vhktVkHGOXQI20SkpKLLcOhmGsA5YCaZiVLS5XoADi9XpdkznDMERhnE0fCgUHZhvOW+CO4/8A5hR7wFxjD5hr7AFzjZyBlmVlrOYdYaS1HUUuQA/gWV9fd51URDyqn1c1j6MVFGjoidfW1oq2ABrYj0V82OmVzwHNajVdB88C5wOKTdM87NaxsrKyQsFKHC2BnTDo+/TWt8Bd5INeVC44NDT0xXYZdXNz8w/AaeyS8yjwCPdzQu92ht2m/OUjIyOfS1pkAoqItLS0fA+8D7wKPA0cxs6qC1O4T0xMfKYnb21tnXEDNjc3z+nXbW1t3wFvYz9dCAL7KUThHovFPtGTNjU1jQFSX18/lg68cuXKLUAaGxs3vkB7e/u3wHHgCQpUdnpTqdQvesJgMDisUVevXh3Xry9fvnxTv66qqprQ/cfHx/vVNj/J/couv0DAv7q6+pMDeYPNSalkwkUikX7s4ukl4FHgAODPN1CXnPsWFxd/dCAjW+GGhoZCwAfYpeczwMPAPjVW3gv3IvXN98disZ8dyBGNCwQC4/r94eHhfuy6+JS6zATUCeJXY+W9cNfIUuDAwsLCr05kIBDYeBQ8Ojr6h8Lpx25BtbWlGpfv62BG5PLy8m+SFpOTk38C76mVe84NVyhgOvLgysrK7xoXjUb/Uqt2XG1rEDiYCbcd0MgwsWtk+J1EI03An0wmw5Zlefx+/2n1eRKIO5r+rWTTpFsZ/gWFrGMmeObuqwAAAABJRU5ErkJggg==",dp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAEvUlEQVRYhc2Y20/cVRDHP8v+uKzAWkpDCtZq8BYhJkq8PBoJxgj7I2m0ryaSyFN9IT74pI8+8WJiggRj/APApFkSTGRJ+qKGUiyxbGPEWsUSuVhYC12Wy8+HmeMeYPe3d3WSye/k/M7le+bMzJkZ+J9ToEJreGVYN+vihcytstjQocUlAw0WCSoIVCv3Ae8CXwIt+u8XHVeOG8qLqgAHqAFCQCNwGugCthBJGd7S/tM6LqTzHI5KuqzgaoAHgEvAtwrkG2AG8FzXvep5nue67lX9N6P/PR1/SefXlBtkFXKNDUA/RyX1D9uUbYzOb9D1ygbSQU7eDMxhSSsSiVz3AxiJRK57nuf19/fPad8coqONFCBJPyUOIKc1OvcbgiY9ICDT8+0DHge2gR0gBeyTtviM5HeKAGlrrfMZVwhdAVaAr4F3KNF4gkA9cBbowOc68+3LwDn1Mhdy4/OcYk54nPr6+m54nofruvPa9SFQ6wfQTweNgTwInAGuQWk6mEUvHwb+Au4Dexx7ffK9+0q+CHWIBIOZ9skHYKWfK9tQ8gZoLDjIyWCg3ORY+2T8aYOyg4EaRIFrkCs4QU1NTSvabC20zyIDzuyfkYzEahHX8jHwE/LwXwHeJ4P7KIVIu5ouxFDC+HgLAy4MfEF2v1UpgOezATSiNVf6EvAWsD01NXVtdnb2bk9Pz81sp/q3KIi8t83Ae4DX0tJy0z7t8PDwD4FAYIX/WILVwKMAzc3Nu/agoaGhzmg0ugcsV0hIvlSNoH8IuIiebHJycrls4sotwaxGYvueAPAjEg3jum79yMjIr5WUjFLOxMpBIopWoBN4GfhOJ+4NDg4ulVt6i4uLm7r+BvAscA4fCXrAAfJQJ5Fg8gPgMuCMjo62d3V1LW1sbKRKlpXSxMTEmjZ/5qQrOwHwUAGmkIjiHhJdfKrM/Pz8Y+3t7RvT09Ob5QAYi8X2tbmke2cEZwAaCdoAt5QvIzEbiUSitbe3tyoej++UCnBhYSGkzdu6d1aQxkgOkfwgieQMCeCu8iwSnpNKpcIdHR3BZDJ5UCy4SCSyvL6+/giiSou67wE+eYmhAKKkIaAJUdynkdflNcQF3dFTpooxjmg0aozDAz4DXkB8bxPy1OYM7QzIOuAU0AY8pQu9CrwJ3AK8UCj0RyHgZmZmli1w3wOvAM/oHo1kiZiygbSDh7PAE8DzQA/wBqKnnuM4a2NjY7dygbtw4cICRy31deBFJA09o7eWsU7kJ1KTLJmyRyOSn5zS70fAkwBtbW2/DwwMHHR3d9d3dnY2rK6u7o2Pj2/GYrH9eDzurK2tndM1vwI+QXT7T2BTD5skQz6SCyAcLRoZkGEFGQbeRqpbubK+BPA5MI14h00L3I6Cy2h4+eQbJsKuRa6iQcGFFfB5oBt4DpFsI+Ky7iDBxW3gBhBH/GtC+R7i1lKk3UxRAG2QpvxWr0AbtB3SA5jkx36djH/dVlDbyibN3M8GDvJPyI2PSulixm/u6kZ1OQCaJ/S+tndJX6tvsFBIxcCUdA3vW5ubxMrObc0hDMhd/Rqp5QQHxeW8dubnHGM7tzVv/IECMlxQ/bpcRfRMqaNRheNcUGG9XFWDACfzWs/6Fl3t/xtO//8gpbCORQAAAABJRU5ErkJggg==",up="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAER0lEQVRYhe2YT2hjRRjAf8lL22xsNsm6EWKrSKvuIkIh+O9QRFxEW18KUsoe7FHoRaWCN1FPetOrIHgVKS0q9P5OxaJbodkalgVrtVZjS7Ntd02z6abPw3yzmaT585q+elj2g2HmvZn35jffN/PNNwP35R6XgM/fuif4n+dO2klQvgsaZRc4NJJvoJbHdhrIAkJAN2ADHwFfAw9J3ZoB/b9I0AA6A0SBc0Aa2EVpSqddeZ+QdmfkO+u0gIPSQQR4HfhRQH4AHMDNZDJXXNd1M5nMFalzdB3wJTAOPAD0yEB9066G6wXepVZTd5MpTdporZ6jVqsatmMJoTR3HvgJQ1u2bS+3ArRte9l1XXdsbGyJo1pdBN6Wf3d3ChlAmSQO9LeC8fquQRpDWaerHWSjSr1iu4BkJyOsF9u2s67rkslkluTVxygltAVsJBZqdCngEj5osIlW+4EYytRNF04jeu3vulCT+7QkLH20dEOhumft97pQI4s3+iiRSPwtxVSbd39J8eEGvzFXc1NAs8KSFAZeBt4AHgNeBFDWObkEAne7HAK2gT2gCFQatdca1GbtBj4E3veFprVYVLXXcg4GqM6588BbAMlkcm1qamqzr6/v6ikBet5RgiizJoDPAXdgYGDZXHkzMzPrrk9CdRWngUeAsxxdCzVwpgZ/BigWiz1mo4mJif7jqMajeJrU5hywgGvAej6fvzA0NLThN1Eul9uT4g5VTbYFNKUIfAbsZ7PZvuHh4Wt+As7Ozu5IcY2j219TQB0NV4A7qODgO4CFhYWLg4ODOb8AHccpG4A68m6pRQ1YAQ6A28A+8BXwBcDq6upTqVTquh+AuVyuW4q/opRRaQdZD1gCbgE3ge+BT4HdfD7/ZDwe/z2bzRY6hRsfH1/e3Nx8FDX/sgbgoZfvg6jo4ixqW7oIPA+8CrwHrAJuJBLJd+JaHMf5k6qmPgGeQe1SCenXk0/U21xcIC8AzwGvAJPAEuAmEon1xcXFba9w8/Pz5oqdB14CnpY+oij35km0qwmjwqAU8ISM9hIwBeQA17KsG9PT07+1gxsZGdmgdqW+BjwLDAAPoo4ALU+W9arVwWoIpXp9kouKZpPAO8AwQCwW+2d0dLQ0OTkZSafT0UKhUJ6bm9t2HKeysrIS3tra0g7+KvABUJC0g5rrJdRcbLpImtleRzYashc1P2OSXwbebDVykX3gW+Ab1AHqhuQ3pe6AJlFMO0CoPROHDcio5I8DL1A9C8dQbmod+APYAK4DvwjQnsDdErgyVTfTEaCG1GFYGHXG7TVSo2OkdvhlAflXoHSuNdfStFqaRhEi2kfdprrj6M5LAt0I8EDaaMdflPal48CB95hMr3Bt8h4jD0kyL5E0pN6dysZzW7N2AqjbmhdIZjJvufTOpE19x3g+9s1XJ/ck5tVbfdhu+rxDfLiSO+lFToCjZwrXyH2/0Lwv95z8B1jAqXmDnj4YAAAAAElFTkSuQmCC",fp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAIiklEQVRYhe2YW2yUxxmGn7W96zXGNnZsr2FJHQyYBHNIU1ttAqVUVjlJUAtxQyUXhKgQktUDdSUkuEDtBVJ9UQXRC0RJRblrq/SCIARpFImWQ8VBIZQinJpQYozNyWaxiw/rfXsx3+z+6xNOe9tPGv2nOTzzffPPvDMhSXwJC1nKAXIDV/9ellLAqF1T9o5A2Ry7J5A/Fbh3mUMh8qYJ5kHCQATID6QIkBcAHAVGgKFAStq33EB53/ao5Rm064i9g0CmqcDyrNICYCZQBJTYdaa9j1jelDUwCAwAz4F+ex61DhZauXzr1CDwDHhq1wFg2Do1KWAo0NsCAyoDKoGYXcuBWdZY1PKnzAsDQB/wBOg1yKTVN8vqmoHz6nOgC7gHdFrbCasrNRFgyMCj5qVXgDlANfAaMA/4ir2rMI+MtSHgEdAN9BjsiNVZYR0sNq8+AtqB69Z2MuDBcYA+pAXW0yoDWgTUWXrd8k1l+cBcSxjIIBlPB63G8uUB/8Z57znwAkgGAX1YC4BSK7QIWA7UWwoDJJNJzp49y4ULF2hvb6e7u5tEIkFhYSGVlZXMmzePhoYGNmzYQElJCVZv2tPt7e3s2bOHvr4+9u3bx/r16+PWjg/zQ9x4BEk+5UkqklQt6ZuSdkn6jaRbMhsYGFBbW5uWLVvmp5MpU3V1tVpbW9XV1aWgbdy4MZ2npqbGvx6W9DtJ35e0RFJREDBX0gxJcUnfkPQDScck3fGlz549q7q6ummBjU2xWEzvvfdeGvCtt95Kf6uoqAiyfyBpt6SvSZrlAUOSIpLKJS2X9D1Jv5Z025d69913FQqFJmy8rKxMS5YsUUNDg5YvX67Zs2dPCrpjxw6NjIxoxYoV6XdVVVVBwI8l/UTS1yWVesBcC+18SRsk/ULS33yJtra2CRtramrSiRMn1NXVpWQyKUlKpVJ6+vSpTp48qZ07dyo/P39cua1bt6q+vn4ywL9IapX0tqQyDxiRFDPq3ZL+JCklSadOnRrXwMKFC3X69GlNx65du6aVK1eOqyMYjTGAf50IsNC8t1FSm6TPJOn+/fuKxWJZFb/zzjvjBvx0bO/evQqHwxNG4mUe9MtYMZk5bwHA4cOH6enpSc9BixYt4uTJk5SVlflXfcBN4DFuapoHLPQfz58/z9WrVwmFQsTjceLxOHfv3uUlNlZcpFeMEtzsXg2QSCQ4duxYulQoFOLQoUNBuE7gvAE+x82b/VZHyblz52hsbCSZTL4MCGWrqUECq0gQsBi3ts4B+PDDD3n48GG61OrVq1mzZo1/fGZw54HbVmGV1bMAWPbRRx9NC24CwD7cajLiAXNwIS7ELW3lAGfOnMmqZPv27cHHvwM3gH8AnwH/wnn0C+AuwLZt25g/f/5L4cLhMNu2bfOPnbh1+xkZ9UMebvmKGmQEoLOzM11JQUEBK1eu9I/JAFAPTqnk4hTNY9xS1V5TU1N7+fJlOjo6SKXS+jPLJFFUVMTixYsxmJtW/inOi2nAXDI/C0BWeMvKyojFYv6xz1LCKhnCRSEBPMCFfBaQKi0tfb2+vn5qFzp7AnwCXAM+t45mAUJGfgMwOpoWtIRCWZ/89BB8TuJ+lG5cNEatkXYgjtN+BYG2ktaxBE4U3AP+iRsud3EeHCTwk6Ss0IhvtaKiIk3Q19dHb28vhYWF4H6mYtxwiBrQIE4aPTHgIVzoO3E/TzlOV4YD3/stj9eMPj2xzg4HAYMSPQnkxePxNGB/fz+XLl1iy5Yt4HTeq+aZTtyA9h18Yb33G6aRQBqyDiUNLihmH1q54LAZ9ZHKISPRn1loaGxsJGjHjx8PPi6xtAgnNufgVHcRmf1J2DpTiJsjvYout3c5gQ49Ns89s3fpOdB70I+Hx7iBXrV27VqKi4tJJBKAm3auXLmCDfpy4G3rZSHur/aSPg83BCpx24MFuNUlbnkHcGMubEDdxpG0lBn8AcBBsgfsVysqKti6dStHjhwBYGRkhJaWFs6dO0ckEgGYj9v0xIA71rkha7jUgBYCb5hHGRoaIj8/f4Z5s8jafUpmN/diLBwAkmZKWiipSdKvJN2VpI6ODhUVFWUt7Js2bdLAwMBYLdAt6VNJlyV9IumLsRkOHjyo2tparVixQrdvp2Xmn00YrJI0R05VBRV+GjAiqcoUxA8lnfI1HD16dJz6WLVqla5fvz4tFdPZ2anm5uas8s3Nzf7zp5J+LmmNpFcl5U8GmCupWFKtpO9K+qWkG76W3bt3j4OMRqNqaWnRhQsXNDQ0lAWVTCZ169YtHThwQFVVVePKtrS0+Kw3pgsYso+Vkuol7ZD0W0ldvsHW1tZJZXxtba0aGxvV1NSkdevWaenSpYpGoxPmXb9+vXp6ejzgx5J+ZiGeLSk8GaD34ky5Hd23JP1I0h8kPQmGu7y8/L/aNEUiEe3fv1/Dw8Pp6Es6KqlZ0puSXpHbVU4KiPVglqQFkr4j6aeSfi/pvq/13r172rVrlyorK6cFFo1GtXnzZl25ciU4Ch5J+qOkH0v6tqTXzDk5EwGGlNFjOWQOd8px4vUN4E3cpn2pz/jgwQPef/99Ll68yJ07d+jt7WVwcJBIJEJJSQlz586loaGBTZs2UVdXF5w0OoDLwFWcbPsct6r04+bRLHEYCoWyAD1kBDfHleHmsxrccccS3NFHNV/eenBy6iZwCycMOnHz5wBuDh2nyyY6H0zhFmoF7vtxk+l9q3ieQfrDo8msF7cy3cN56g7ZWnKcep7IxnrQmz+wHKu2K3EKJWbPpWSUTQ4ZtRJc23sC6ZGB9ZM52JwcboIQjzUvZvNxYfeHlyVkZFcBbux6wKA6ShjoM5yM8uH0Xpuy8ekAQuZc2W8P8nEei9p9mMmPgAfJHO0O27e0lHppw9MEDJo//A4eoE91iB48SJ80lFMB/t/+V/sPGZfTmtMFR4EAAAAASUVORK5CYII=";var qa=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Me=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},He,ei,Lr,Cn,ka,Ut,uu,fu,$t,xl,El;class hp{constructor(t,n){He.add(this),ei.set(this,void 0),Lr.set(this,void 0),Cn.set(this,null),ka.set(this,null),Ut.set(this,{auto:cp,"drag-default":dp,"drag-active":up,"rotate-0":du,rotate:fp}),qa(this,Lr,t,"f"),qa(this,ei,n.eventHub,"f"),Me(this,He,"m",uu).call(this),Me(this,He,"m",fu).call(this)}}ei=new WeakMap,Lr=new WeakMap,Cn=new WeakMap,ka=new WeakMap,Ut=new WeakMap,He=new WeakSet,uu=function(){const t=Me(this,ei,"f");Me(this,He,"m",$t).call(this,"default"),t.on("cursor",n=>{var r;n.type==="over-element"||!n.type?Me(this,He,"m",$t).call(this,"auto"):n.type==="resize-rotate"?Me(this,He,"m",$t).call(this,"rotate"):typeof n.type=="string"&&(!((r=n.type)===null||r===void 0)&&r.startsWith("resize-"))?Me(this,He,"m",xl).call(this,n):n.type==="drag-default"?Me(this,He,"m",$t).call(this,"drag-default"):n.type==="drag-active"?Me(this,He,"m",$t).call(this,"drag-active"):Me(this,He,"m",$t).call(this,"auto")})},fu=function(){pi(du).then(t=>{qa(this,ka,t,"f")}).catch(t=>{console.error(t)})},$t=function(t){if(Me(this,Cn,"f")===t)return;qa(this,Cn,t,"f");const n=Me(this,Ut,"f")[Me(this,Cn,"f")]||Me(this,Ut,"f").auto;let r=0,a=0;(t.startsWith("rotate-")&&Me(this,Ut,"f")[Me(this,Cn,"f")]||t==="rotate")&&(r=10,a=10),t==="default"?Me(this,Lr,"f").style.cursor="default":Me(this,Lr,"f").style.cursor=`image-set(url(${n})2x) ${r} ${a}, auto`},xl=function(t){var n;let r=0;t.type==="resize-top"?r+=0:t.type==="resize-top-right"?r+=45:t.type==="resize-right"?r+=90:t.type==="resize-bottom-right"?r+=135:t.type==="resize-bottom"?r+=180:t.type==="resize-bottom-left"?r+=225:t.type==="resize-left"?r+=270:t.type==="resize-top-left"&&(r+=315),r+=ft(((n=t==null?void 0:t.element)===null||n===void 0?void 0:n.angle)||0),Array.isArray(t.groupQueue)&&t.groupQueue.length>0&&t.groupQueue.forEach(i=>{r+=ft(i.angle||0)}),r=ft(r);const a=Me(this,He,"m",El).call(this,r);Me(this,He,"m",$t).call(this,a)},El=function(t){const n=`rotate-${t}`;if(!Me(this,Ut,"f")[n]){const r=Me(this,ka,"f");if(r){const a=document.createElement("canvas"),i=r.width,o=r.height,s={x:i/2,y:o/2};a.width=i,a.height=o;const c=a.getContext("2d"),d=jt(t);c.translate(s.x,s.y),c.rotate(d),c.translate(-s.x,-s.y),c.drawImage(r,0,0,i,o),c.translate(s.x,s.y),c.rotate(-d),c.translate(-s.x,-s.y);const u=a.toDataURL("image/png");Me(this,Ut,"f")[n]=u}}return n};const st="SELECT",Se=Symbol(`${st}_actionType`),Wt=Symbol(`${st}_resizeType`),ca=Symbol(`${st}_areaStart`),da=Symbol(`${st}_areaEnd`),vr=Symbol(`${st}_hoverElement`),Vi=Symbol(`${st}_hoverElementVertexes`),mr=Symbol(`${st}_selectedElementList`),pp=Symbol(`${st}_selectedElementListVertexes`),hn=Symbol(`${st}_selectedElementController`),Be=Symbol(`${st}_groupQueue`),Ui=Symbol(`${st}_groupQueueVertexesList`),hu=2,gp=4,pu=1,Gr="#1973ba",Sl="#5b5959b5",gu=10;function Dt(e,t,n){const{borderColor:r,borderWidth:a,background:i,lineDash:o}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.fillStyle=i,e.setLineDash(o),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[1].x,t[1].y),e.lineTo(t[2].x,t[2].y),e.lineTo(t[3].x,t[3].y),e.lineTo(t[0].x,t[0].y),e.closePath(),e.stroke(),e.fill()}function vp(e,t,n,r){const{borderColor:a,borderWidth:i,lineDash:o}=r;e.setLineDash([]),e.lineWidth=i,e.strokeStyle=a,e.setLineDash(o),e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.closePath(),e.stroke()}function mp(e,t,n){const{size:r,borderColor:a,borderWidth:i,background:o}=n,s=t,c=r/2,d=c,u=c;if(d>=0&&u>=0){if(typeof i=="number"&&i>0){const f=i/2+d,h=i/2+u;e.beginPath(),e.strokeStyle=a,e.lineWidth=i,e.circle(s.x,s.y,f,h,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath(),e.fillStyle=o,e.circle(s.x,s.y,d,u,0,0,2*Math.PI),e.closePath(),e.fill()}}function Cl(e,t,n){if(!t)return;const r={borderColor:Gr,borderWidth:1,background:"transparent",lineDash:[]};Dt(e,Ie(t,n),r)}function Pt(e,t,n){const{borderColor:r,borderWidth:a,background:i,lineDash:o}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.fillStyle=i,e.setLineDash(o),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[2].x,t[2].y),e.closePath(),e.stroke(),e.beginPath(),e.moveTo(t[1].x,t[1].y),e.lineTo(t[3].x,t[3].y),e.closePath(),e.stroke()}function Ml(e,t,n){if(!t)return;const r={borderColor:Sl,borderWidth:1,background:"transparent",lineDash:[]};Dt(e,Ie(t,n),r);const{controller:a}=n;if(a){const{topLeft:i,topRight:o,bottomLeft:s,bottomRight:c,topMiddle:d,bottomMiddle:u,leftMiddle:f,rightMiddle:h}=a,p=Object.assign(Object.assign({},r),{borderWidth:1,background:Sl});Pt(e,Ie(d.vertexes,n),p),Pt(e,Ie(u.vertexes,n),p),Pt(e,Ie(f.vertexes,n),p),Pt(e,Ie(h.vertexes,n),p),Pt(e,Ie(i.vertexes,n),p),Pt(e,Ie(o.vertexes,n),p),Pt(e,Ie(s.vertexes,n),p),Pt(e,Ie(c.vertexes,n),p)}}function Al(e,t,n){if(!t)return;const{elementWrapper:r,topLeft:a,topRight:i,bottomLeft:o,bottomRight:s,top:c,rotate:d}=t,u={borderColor:Gr,borderWidth:hu,background:"transparent",lineDash:[]},f=Object.assign(Object.assign({},u),{borderWidth:gp,background:"#FFFFFF"});vp(e,Qe(c.center,n),Qe(d.center,n),Object.assign(Object.assign({},f),{borderWidth:2})),Dt(e,Ie(r,n),u),Dt(e,Ie(a.vertexes,n),f),Dt(e,Ie(i.vertexes,n),f),Dt(e,Ie(o.vertexes,n),f),Dt(e,Ie(s.vertexes,n),f),mp(e,Qe(d.center,n),Object.assign(Object.assign({},f),{size:gu,borderWidth:2}))}function bp(e,t){const{start:n,end:r}=t;e.setLineDash([]),e.lineWidth=pu,e.strokeStyle=Gr,e.fillStyle="#1976d24f",e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,n.y),e.lineTo(r.x,r.y),e.lineTo(n.x,r.y),e.closePath(),e.stroke(),e.fill()}function yp(e,t){const{areaSize:n}=t,{x:r,y:a,w:i,h:o}=n;e.setLineDash([]),e.lineWidth=pu,e.strokeStyle=Gr,e.fillStyle="#1976d21c",e.beginPath(),e.moveTo(r,a),e.lineTo(r+i,a),e.lineTo(r+i,a+o),e.lineTo(r,a+o),e.closePath(),e.stroke(),e.fill()}function wp(e,t,n){for(let r=0;r0?Math.abs(e):0-Math.abs(e)}function yo(e,t){const{ctx:n,viewScaleInfo:r,viewSizeInfo:a,vertexes:i}=t,o=Qe(i[0],{viewScaleInfo:r,viewSizeInfo:a}),s=Qe(i[1],{viewScaleInfo:r,viewSizeInfo:a}),c=Qe(i[2],{viewScaleInfo:r,viewSizeInfo:a}),d=Qe(i[3],{viewScaleInfo:r,viewSizeInfo:a});return n.beginPath(),n.moveTo(o.x,o.y),n.lineTo(s.x,s.y),n.lineTo(c.x,c.y),n.lineTo(d.x,d.y),n.lineTo(o.x,o.y),n.closePath(),!!n.isPointInPath(e.x,e.y)}function _l(e,t){const{ctx:n,viewScaleInfo:r,viewSizeInfo:a,groupQueue:i}=t;if(!i||!((i==null?void 0:i.length)>0))return!1;const o=Zo(i),s=o[o.length-1];return s?yo(e,{ctx:n,vertexes:s,viewScaleInfo:r,viewSizeInfo:a}):!1}function br(e,t){var n,r,a;const i={type:null,elements:[],elementVertexesList:[],groupQueue:[],groupQueueVertexesList:[]},{ctx:o,data:s,calculator:c,selectedElements:d,viewScaleInfo:u,viewSizeInfo:f,areaSize:h,groupQueue:p,selectedElementController:v}=t;if(v){const{left:g,right:m,top:b,bottom:y,topLeft:E,topRight:w,bottomLeft:S,bottomRight:C,rotate:j}=v,R=[g,m,b,y,E,w,S,C,j];for(let B=0;B0&&(i.groupQueue=p||[],i.elements=[d[0]]);break}}}if(p&&Array.isArray(p)&&p.length>0){const g=p[p.length-1];if(!((n=g==null?void 0:g.detail)===null||n===void 0)&&n.children&&Array.isArray((r=g==null?void 0:g.detail)===null||r===void 0?void 0:r.children))for(let m=g.detail.children.length-1;m>=0;m--){const b=g.detail.children[m],y=Qa(b,{groupQueue:p});if(y&&yo(e,{ctx:o,vertexes:y,viewScaleInfo:u,viewSizeInfo:f}))return i.type||(i.type="over-element"),i.groupQueue=p,i.elements=[b],i}return i}if(i.type!==null)return i;if(h&&Array.isArray(d)&&(d==null?void 0:d.length)>1){const{x:g,y:m,w:b,h:y}=h;if(e.x>=g&&e.x<=g+b&&e.y>=m&&e.y<=m+y)return i.type="list-area",i.elements=d,i}if(s){const{index:g,element:m}=c.getPointElement(e,{data:s,viewScaleInfo:u,viewSizeInfo:f});if(g>=0&&m&&((a=m==null?void 0:m.operations)===null||a===void 0?void 0:a.invisible)!==!0)return i.elements=[m],i.type="over-element",i}return i}function xp(e,t){var n,r,a,i,o,s,c,d,u;let{x:f,y:h,w:p,h:v,angle:g=0}=e;const m=Ft({x:f,y:h,w:p,h:v,angle:g});g=ft(g);const b=jt(g),y=!!(!((n=e==null?void 0:e.operations)===null||n===void 0)&&n.limitRatio),{start:E,end:w,resizeType:S,scale:C}=t;let j=Object.assign({},E),R=Object.assign({},w),B={x:j.x,y:m.y},F={x:R.x,y:m.y},V=Object.assign({},B),L=Object.assign({},F),_={x:m.x,y:j.y},T={x:m.x,y:R.y},P=Object.assign({},_),k=Object.assign({},T),N=(L.x-V.x)/C,D=(L.y-V.y)/C,x=ua(N,D),z=(k.x-P.x)/C,X=(k.y-P.y)/C,A=ua(z,X);(g>0||g<0)&&(j=De(m,E,0-b),R=De(m,w,0-b),B={x:j.x,y:m.y},F={x:R.x,y:m.y},V=De(m,B,b),L=De(m,F,b),_={x:m.x,y:j.y},T={x:m.x,y:R.y},P=De(m,_,b),k=De(m,T,b),N=(L.x-V.x)/C,D=(L.y-V.y)/C,x=ua(N,D),x=re(x,D),z=(k.x-P.x)/C,X=(k.y-P.y)/C,A=ua(z,X),A=re(A,X));let U=(w.x-E.x)/C,G=(w.y-E.y)/C;if(y===!0){if(["resize-top","resize-bottom","resize-left","resize-right"].includes(S)){const O=Math.max(Math.abs(U),Math.abs(G));U=(U>=0?1:-1)*O,G=(G>=0?1:-1)*O/e.w*e.h;const $=Math.max(Math.abs(z),Math.abs(X));z=(z>=0?1:-1)*$,X=(X>=0?1:-1)*$/e.w*e.h;const I=Math.max(Math.abs(N),Math.abs(D));N=(N>=0?1:-1)*I,D=(D>=0?1:-1)*I/e.w*e.h}else if(["resize-top-left","resize-top-right","resize-bottom-left","resize-bottom-right"].includes(S)){{const O=Math.abs(U);U=(U>=0?1:-1)*O;const $=O/e.w*e.h;S==="resize-top-left"||S==="resize-bottom-right"?G=U>0?$:-$:(S==="resize-top-right"||S==="resize-bottom-left")&&(G=U>0?-$:$)}x=Math.abs(x),A=x/e.w*e.h}}switch(S){case"resize-top":{if(g===0)v-G>0&&(h+=G,v-=G,((r=e.operations)===null||r===void 0?void 0:r.limitRatio)===!0&&(f+=G/e.h*e.w/2,p-=G/e.h*e.w));else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){A=0-re(A,X);const I=ce(g),H=A/2;O=O+H*Math.sin(I),$=$-H*Math.cos(I)}else if(g<180){A=re(A,z);const I=ce(g-90),H=A/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I)}else if(g<270){A=re(A,X);const I=ce(g-180),H=A/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I)}else if(g<360){A=0-re(A,z);const I=ce(g-270),H=A/2;O=O-H*Math.cos(I),$=$-H*Math.sin(I)}v+A>0&&(((a=e.operations)===null||a===void 0?void 0:a.limitRatio)===!0&&(p=p+A/e.h*e.w),v=v+A,f=O-p/2,h=$-v/2)}break}case"resize-bottom":{if(g===0)e.h+G>0&&(v+=G,((i=e.operations)===null||i===void 0?void 0:i.limitRatio)===!0&&(f-=G/e.h*e.w/2,p+=G/e.h*e.w));else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){A=re(A,X);const I=ce(g),H=A/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I)}else if(g<180){A=0-re(A,z);const I=ce(g-90),H=A/2;O=O-H*Math.cos(I),$=$-H*Math.sin(I)}else if(g<270){A=re(A,z);const I=ce(g-180),H=A/2;O=O+H*Math.sin(I),$=$-H*Math.cos(I)}else if(g<360){A=re(A,z);const I=ce(g-270),H=A/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I)}v+A>0&&(((o=e.operations)===null||o===void 0?void 0:o.limitRatio)===!0&&(p=p+A/e.h*e.w),v=v+A,f=O-p/2,h=$-v/2)}break}case"resize-left":{if(g===0)e.w-U>0&&(f+=U,p-=U,((s=e.operations)===null||s===void 0?void 0:s.limitRatio)===!0&&(v-=U/e.w*e.h,h+=U/e.w*e.h/2));else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){x=0-re(x,N);const I=ce(g),H=x/2;O=O-H*Math.cos(I),$=$-H*Math.sin(I)}else if(g<180){x=re(x,N);const I=ce(g-90),H=x/2;O=O+H*Math.sin(I),$=$-H*Math.cos(I)}else if(g<270){x=re(x,D);const I=ce(g-180),H=x/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I)}else if(g<360){x=re(x,D);const I=ce(g-270),H=x/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I)}p+x>0&&(((c=e.operations)===null||c===void 0?void 0:c.limitRatio)===!0&&(v=v+x/e.w*e.h),p=p+x,f=O-p/2,h=$-v/2)}break}case"resize-right":{if(g===0)e.w+U>0&&(p+=U,((d=e.operations)===null||d===void 0?void 0:d.limitRatio)===!0&&(h-=U*e.h/e.w/2,v+=U*e.h/e.w));else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){x=re(x,D);const I=ce(g),H=x/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I)}else if(g<180){x=re(x,G);const I=ce(g-90),H=x/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I)}else if(g<270){x=re(x,G);const I=ce(g-180),H=x/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I),x=0-x}else if(g<360){x=re(x,U);const I=ce(g-270),H=x/2;O=O+H*Math.sin(I),$=$-H*Math.cos(I)}p+x>0&&(((u=e.operations)===null||u===void 0?void 0:u.limitRatio)===!0&&(v=v+x/e.w*e.h),p=p+x,f=O-p/2,h=$-v/2)}break}case"resize-top-left":{if(g===0)p-U>0&&(f+=U,p-=U),v-G>0&&(h+=G,v-=G);else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){A=0-re(A,X),x=0-re(x,y?0-A:N);const I=A/2;O=O+I*Math.sin(b),$=$-I*Math.cos(b);const H=x/2;O=O-H*Math.cos(b),$=$-H*Math.sin(b)}else if(g<180){A=re(A,z),x=re(x,y?A:N);const I=ce(g-90),H=A/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I);const ee=x/2;O=O+ee*Math.sin(I),$=$-ee*Math.cos(I)}else if(g<270){A=re(A,X),x=re(x,y?A:D);const I=ce(g-180),H=A/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I);const ee=x/2;O=O+ee*Math.cos(I),$=$+ee*Math.sin(I)}else if(g<360){A=0-re(A,z),x=re(x,y?A:D);const I=ce(g-270),H=A/2;O=O-H*Math.cos(I),$=$-H*Math.sin(I);const ee=x/2;O=O-ee*Math.sin(I),$=$+ee*Math.cos(I)}v+A>0&&(v=v+A),p+x>0&&(p=p+x),f=O-p/2,h=$-v/2}break}case"resize-top-right":{if(g===0)p+U>0&&(p+=U),v-G>0&&(h+=G,v-=G);else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){A=0-re(A,X),x=re(x,y?A:D);const I=ce(g),H=A/2;O=O+H*Math.sin(I),$=$-H*Math.cos(I);const ee=x/2;O=O+ee*Math.cos(I),$=$+ee*Math.sin(I)}else if(g<180){A=re(A,z),x=re(x,y?A:D);const I=ce(g-90),H=A/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I);const ee=x/2;O=O-ee*Math.sin(I),$=$+ee*Math.cos(I)}else if(g<270){const I=ce(g-180);A=re(A,X),x=re(x,y?A:0-N);const H=A/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I);const ee=x/2;O=O-ee*Math.cos(I),$=$-ee*Math.sin(I)}else if(g<360){A=0-re(A,z),x=re(x,y?A:N);const I=ce(g-270),H=A/2;O=O-H*Math.cos(I),$=$-H*Math.sin(I);const ee=x/2;O=O+ee*Math.sin(I),$=$-ee*Math.cos(I)}v+A>0&&(v=v+A),p+x>0&&(p=p+x),f=O-p/2,h=$-v/2}break}case"resize-bottom-left":{if(g===0)e.h+G>0&&(v+=G),e.w-U>0&&(f+=U,p-=U);else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){A=re(A,X),x=0-re(x,y?0-A:N);const I=ce(g),H=A/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I);const ee=x/2;O=O-ee*Math.cos(I),$=$-ee*Math.sin(I)}else if(g<180){A=0-re(A,z),x=re(x,y?A:N);const I=ce(g-90),H=A/2;O=O-H*Math.cos(I),$=$-H*Math.sin(I);const ee=x/2;O=O+ee*Math.sin(I),$=$-ee*Math.cos(I)}else if(g<270){A=re(A,z),x=re(x,y?A:D);const I=ce(g-180),H=A/2;O=O+H*Math.sin(I),$=$-H*Math.cos(I);const ee=x/2;O=O+ee*Math.cos(I),$=$+ee*Math.sin(I)}else if(g<360){A=re(A,z),x=re(x,y?A:D);const I=ce(g-270),H=A/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I);const ee=x/2;O=O-ee*Math.sin(I),$=$+ee*Math.cos(I)}v+A>0&&(v=v+A),p+x>0&&(p=p+x),f=O-p/2,h=$-v/2}break}case"resize-bottom-right":{if(g===0)e.h+G>0&&(v+=G),e.w+U>0&&(p+=U);else if(g>0||g<0){let O=m.x,$=m.y;if(g<90){A=re(A,X),x=re(x,y?A:D);const I=ce(g),H=A/2;O=O-H*Math.sin(I),$=$+H*Math.cos(I);const ee=x/2;O=O+ee*Math.cos(I),$=$+ee*Math.sin(I)}else if(g<180){A=0-re(A,z),x=re(x,y?A:G);const I=ce(g-90),H=A/2;O=O-H*Math.cos(I),$=$-H*Math.sin(I);const ee=x/2;O=O-ee*Math.sin(I),$=$+ee*Math.cos(I)}else if(g<270){A=re(A,z),x=re(x,y?A:0-D);const I=ce(g-180),H=A/2;O=O+H*Math.sin(I),$=$-H*Math.cos(I);const ee=x/2;O=O-ee*Math.cos(I),$=$-ee*Math.sin(I)}else if(g<360){A=re(A,z),x=re(x,y?A:N);const I=ce(g-270),H=A/2;O=O+H*Math.cos(I),$=$+H*Math.sin(I);const ee=x/2;O=O+ee*Math.sin(I),$=$-ee*Math.cos(I)}v+A>0&&(v=v+A),p+x>0&&(p=p+x),f=O-p/2,h=$-v/2}break}}return{x:f,y:h,w:p,h:v,angle:e.angle}}function Ep(e,t){const{x:n,y:r,w:a,h:i,angle:o=0}=e,{center:s,start:c,end:d,viewScaleInfo:u,viewSizeInfo:f}=t,h=Qe(s,{viewScaleInfo:u,viewSizeInfo:f}),p=ft(o),v=vh(h,c,d),g=p+gh(v);return{x:n,y:r,w:a,h:i,angle:g}}function Sp(e,t){var n;const r=[],a=[],i=[],{calculator:o,viewScaleInfo:s,viewSizeInfo:c,start:d,end:u}=t;if(!(Array.isArray(e.elements)&&d&&u))return{indexes:r,uuids:a,elements:i};const f=Math.min(d.x,u.x),h=Math.max(d.x,u.x),p=Math.min(d.y,u.y),v=Math.max(d.y,u.y);for(let g=0;g=f&&y.x<=h&&y.y>=p&&y.y<=v&&(r.push(g),a.push(m.uuid),i.push(m),b.angle&&(b.angle>0||b.angle<0))){const E=tn(b);if(E.length===4){const w=[E[0].x,E[1].x,E[2].x,E[3].x],S=[E[0].y,E[1].y,E[2].y,E[3].y];b.x=Math.min(...w),b.y=Math.min(...S),b.w=Math.abs(Math.max(...w)-Math.min(...w)),b.h=Math.abs(Math.max(...S)-Math.min(...S))}}}return{indexes:r,uuids:a,elements:i}}function Yi(e,t){var n;if(!Array.isArray(e))return null;const r={x:0,y:0,w:0,h:0},{calculator:a,viewScaleInfo:i,viewSizeInfo:o}=t;let s=null;for(let c=0;c0||u.angle<0)){const f=tn(u);if(f.length===4){const h=[f[0].x,f[1].x,f[2].x,f[3].x],p=[f[0].y,f[1].y,f[2].y,f[3].y];u.x=Math.min(...h),u.y=Math.min(...p),u.w=Math.abs(Math.max(...h)-Math.min(...h)),u.h=Math.abs(Math.max(...p)-Math.min(...p))}}if(s){const f=Math.min(u.x,r.x),h=Math.min(u.y,r.y),p=Math.max(u.x+u.w,r.x+r.w),v=Math.max(u.y+u.h,r.y+r.h);r.x=f,r.y=h,r.w=Math.abs(p-f),r.h=Math.abs(v-h)}else r.x=u.x,r.y=u.y,r.w=u.w,r.h=u.h;s=u}return r}function Cp(e,t){var n;if((t==null?void 0:t.type)==="group"&&Array.isArray((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.children))for(let r=0;r{const{x:s,y:c,w:d,h:u,angle:f=0}=o;i.push({x:s,y:c,w:d,h:u,angle:0-f})}),(n==null?void 0:n.length)>0){const o=Ka(e,i),s=Ka(t,i);r=s.x-o.x,a=s.y-o.y}return{moveX:r,moveY:a}}const wo="@middleware/text-edit",Ap=nn(),xo=e=>{const{eventHub:t,boardContent:n,viewer:r}=e,a=n.boardContext.canvas,i=document.createElement("textarea"),o=document.createElement("div"),s=e.container||document.body,c=document.createElement("div");let d=null;o.appendChild(i),o.style.position="absolute",c.appendChild(o),c.style.position="fixed",c.style.top="0",c.style.bottom="0",c.style.left="0",c.style.right="0",c.style.display="none",s.appendChild(c);const u=b=>{g(),v(b),c.style.display="block"},f=()=>{c.style.display="none",d=null},h=()=>{const b=a.getBoundingClientRect(),{left:y,top:E,width:w,height:S}=b;return{left:y,top:E,width:w,height:S}},p=b=>{const{size:y,parent:E}=b,w=document.createElement("div"),{x:S,y:C,w:j,h:R}=y,B=ft(y.angle||0);return w.style.position="absolute",w.style.left=`${S}px`,w.style.top=`${C}px`,w.style.width=`${j}px`,w.style.height=`${R}px`,w.style.transform=`rotate(${B}deg)`,E.appendChild(w),w},v=b=>{const{viewScaleInfo:y,element:E,groupQueue:w}=b,{scale:S,offsetTop:C,offsetLeft:j}=y;o.children&&Array.from(o.children).forEach(T=>{T.remove()});let R=o;for(let T=0;T0&&(F=E.x*S,V=E.y*S,L=E.w*S,_=E.h*S),i.style.position="absolute",i.style.left=`${F-1}px`,i.style.top=`${V-1}px`,i.style.width=`${L+2}px`,i.style.height=`${_+2}px`,i.style.transform=`rotate(${ft(E.angle||0)}deg)`,i.style.boxSizing="border-box",i.style.border="1px solid #1973ba",i.style.resize="none",i.style.overflow="hidden",i.style.wordBreak="break-all",i.style.background="#FFFFFF",i.style.color="#333333",i.style.fontSize=`${B.fontSize*S}px`,i.style.lineHeight=`${B.lineHeight*S}px`,i.style.fontFamily=B.fontFamily,i.style.fontWeight=`${B.fontWeight}`,i.style.padding="0",i.style.margin="0",i.style.outline="none",i.value=B.text||"",R.appendChild(i)},g=()=>{const{left:b,top:y,width:E,height:w}=h();o.style.position="absolute",o.style.overflow="hidden",o.style.top=`${y}px`,o.style.left=`${b}px`,o.style.width=`${E}px`,o.style.height=`${w}px`};c.addEventListener("click",()=>{f()}),i.addEventListener("click",b=>{b.stopPropagation()}),i.addEventListener("input",b=>{d&&(d.detail.text=b.target.value||"",r.drawFrame())}),i.addEventListener("blur",()=>{f()});const m=b=>{var y;b!=null&&b.element&&((y=b==null?void 0:b.element)===null||y===void 0?void 0:y.type)==="text"&&(d=b.element),u(b)};return{name:"@middleware/text-editor",use(){t.on(wo,m)},disuse(){t.off(wo,m)}}},Lt="@middleware/select",ut="@middleware/select-clear",Eo=e=>{const{viewer:t,sharer:n,boardContent:r,calculator:a,eventHub:i}=e,{helperContext:o}=r;let s=null,c=null;n.setSharedStorage(Se,null);const d=()=>n.getSharedStorage(mr),u=b=>{let y=n.getSharedStorage(Be);Array.isArray(y)||(y=[]),y.length>0?Cp(b,y[y.length-1])?y.push(b):y=[]:y.length===0&&y.push(b);const E=Zo(y);return n.setSharedStorage(Be,y),n.setSharedStorage(Ui,E),y.length>0},f=b=>{n.setSharedStorage(vr,b);let y=null;b&&(y=Qa(b,{groupQueue:n.getSharedStorage(Be)})),n.setSharedStorage(Vi,y)},h=(b,y)=>{if(n.setSharedStorage(mr,b),b.length===1){const E=sa(b[0],{groupQueue:n.getSharedStorage(Be),controllerSize:gu,viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(hn,E)}else n.setSharedStorage(hn,null);(y==null?void 0:y.triggerEvent)===!0&&i.trigger(Lt,{uuids:b.map(E=>E.uuid)})},p=()=>({ctx:o,calculator:a,data:n.getActiveStorage("data"),selectedElements:d(),viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Be),areaSize:null,selectedElementController:n.getSharedStorage(hn)}),v=()=>{n.setSharedStorage(Se,null),n.setSharedStorage(Wt,null),n.setSharedStorage(ca,null),n.setSharedStorage(da,null),n.setSharedStorage(Be,[]),n.setSharedStorage(Ui,[]),n.setSharedStorage(vr,null),n.setSharedStorage(Vi,null),n.setSharedStorage(mr,[]),n.setSharedStorage(pp,null),n.setSharedStorage(hn,null)};v();const g=({uuids:b,positions:y})=>{let E=[];const w=n.getSharedStorage(Se),S=n.getActiveStorage("data");y&&Array.isArray(y)?E=Hd(y,(S==null?void 0:S.elements)||[]):E=Ca(b,(S==null?void 0:S.elements)||[]);let C=!1;if(!w&&E.length===1?(n.setSharedStorage(Se,"select"),C=!0):w==="select"&&E.length===1&&(C=!0),C){const j=E[0],R=Fd(j.uuid,(S==null?void 0:S.elements)||[]);n.setSharedStorage(Be,R),h(E),t.drawFrame()}},m=()=>{v(),t.drawFrame()};return{name:"@middleware/selector",use(){i.on(Lt,g),i.on(ut,m)},disuse(){i.off(Lt,g),i.off(ut,m)},hover:b=>{var y,E,w,S,C;const j=n.getSharedStorage(Wt),R=n.getSharedStorage(Se),B=n.getSharedStorage(Be),F=P=>{const k=P.type;c===null&&i.trigger("cursor",{type:k,groupQueue:P.groupQueue,element:P.elements[0]})};if((B==null?void 0:B.length)>0){if(!_l(b.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Be)})){f(null),t.drawFrame();return}const k=br(b.point,p());if(F(k),j||["area","drag","drag-list"].includes(R)){f(null),t.drawFrame();return}if(((y=k==null?void 0:k.elements)===null||y===void 0?void 0:y.length)===1){f(k.elements[0]),t.drawFrame();return}f(null),t.drawFrame();return}if(j||["area","drag","drag-list"].includes(R)){f(null);return}if(R==="drag"){f(null);return}const V=d(),L=n.getActiveViewScaleInfo(),_=n.getActiveViewSizeInfo(),T=br(b.point,Object.assign(Object.assign({},p()),{areaSize:Yi(V,{viewScaleInfo:L,viewSizeInfo:_,calculator:a})}));if(F(T),T.type!==null&&!(T.type==="over-element"&&n.getSharedStorage(Se)==="select"&&T.elements.length===1&&T.elements[0].uuid===((w=(E=d())===null||E===void 0?void 0:E[0])===null||w===void 0?void 0:w.uuid))&&!(T.type==="over-element"&&n.getSharedStorage(Se)===null&&T.elements.length===1&&T.elements[0].uuid===((S=n.getSharedStorage(vr))===null||S===void 0?void 0:S.uuid))){if(T.type==="over-element"&&((C=T==null?void 0:T.elements)===null||C===void 0?void 0:C.length)===1){f(T.elements[0]),t.drawFrame();return}if(n.getSharedStorage(vr)){f(null),t.drawFrame();return}}},pointStart:b=>{var y,E,w,S,C,j,R,B,F,V;s=b.point;const L=n.getSharedStorage(Be);if((L==null?void 0:L.length)>0){if(_l(b.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:L})){const P=br(b.point,p());if(((y=P==null?void 0:P.elements)===null||y===void 0?void 0:y.length)===1&&((w=(E=P.elements[0])===null||E===void 0?void 0:E.operations)===null||w===void 0?void 0:w.lock)===!0)return;f(null),P.type==="over-element"&&((S=P==null?void 0:P.elements)===null||S===void 0?void 0:S.length)===1?(h([P.elements[0]],{triggerEvent:!0}),n.setSharedStorage(Se,"drag")):!((C=P.type)===null||C===void 0)&&C.startsWith("resize-")?(n.setSharedStorage(Wt,P.type),n.setSharedStorage(Se,"resize")):h([],{triggerEvent:!0})}else v();t.drawFrame();return}const _=Yi(d(),{viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),calculator:a}),T=br(b.point,Object.assign(Object.assign({},p()),{areaSize:_,groupQueue:[]}));((j=T==null?void 0:T.elements)===null||j===void 0?void 0:j.length)===1&&((B=(R=T.elements[0])===null||R===void 0?void 0:R.operations)===null||B===void 0?void 0:B.lock)===!0||(f(null),T.type==="list-area"?n.setSharedStorage(Se,"drag-list"):T.type==="over-element"&&((F=T==null?void 0:T.elements)===null||F===void 0?void 0:F.length)===1?(h([T.elements[0]],{triggerEvent:!0}),n.setSharedStorage(Se,"drag")):!((V=T.type)===null||V===void 0)&&V.startsWith("resize-")?(n.setSharedStorage(Wt,T.type),n.setSharedStorage(Se,"resize")):(v(),n.setSharedStorage(Se,"area"),n.setSharedStorage(ca,b.point),h([],{triggerEvent:!0})),t.drawFrame())},pointMove:b=>{var y,E,w;const S=n.getActiveStorage("data"),C=d(),j=n.getActiveStorage("scale")||1,R=n.getActiveViewScaleInfo(),B=n.getActiveViewSizeInfo(),F=s,V=b.point,L=n.getSharedStorage(Wt),_=n.getSharedStorage(Se),T=n.getSharedStorage(Be);if(_==="drag"){if(c="drag",S&&(C==null?void 0:C.length)===1&&F&&V&&((E=(y=C[0])===null||y===void 0?void 0:y.operations)===null||E===void 0?void 0:E.lock)!==!0){const{moveX:P,moveY:k}=Mp(F,V,T);C[0].x+=P/j,C[0].y+=k/j,h([C[0]])}t.drawFrame()}else if(_==="drag-list"){if(c="drag-list",S&&F&&V&&(C==null?void 0:C.length)>1){const P=(V.x-F.x)/j,k=(V.y-F.y)/j;C.forEach(N=>{var D;N&&((D=N==null?void 0:N.operations)===null||D===void 0?void 0:D.lock)!==!0&&(N.x+=P,N.y+=k)}),n.setActiveStorage("data",S)}t.drawFrame()}else if(_==="resize"){if(S&&(C==null?void 0:C.length)===1&&F&&(L!=null&&L.startsWith("resize-"))){c="resize";const P=[];T.forEach(D=>{const{x,y:z,w:X,h:A,angle:U=0}=D;P.push({x,y:z,w:X,h:A,angle:0-U})});let k=F,N=V;if(T.length>0&&(k=Ka(F,P),N=Ka(V,P)),L==="resize-rotate"){const D=n.getSharedStorage(hn),x=[D.topLeft.center,D.topRight.center,D.bottomLeft.center,D.bottomRight.center],z=Dd(x),X=Ep(C[0],{center:z,viewScaleInfo:R,viewSizeInfo:B,start:F,end:V,resizeType:L,sharer:n});C[0].angle=X.angle}else{const D=xp(C[0],{scale:j,start:k,end:N,resizeType:L,sharer:n});C[0].x=D.x,C[0].y=D.y,C[0].type==="group"&&((w=C[0].operations)===null||w===void 0?void 0:w.deepResize)===!0?Yd(C[0],{w:D.w,h:D.h}):(C[0].w=D.w,C[0].h=D.h)}h([C[0]]),t.drawFrame()}}else _==="area"&&(c="area",n.setSharedStorage(da,b.point),t.drawFrame());s=b.point},pointEnd(b){c=null;const y=n.getActiveStorage("data"),E=n.getSharedStorage(Wt),w=n.getSharedStorage(Se),S=n.getActiveViewSizeInfo();let C=!1;if(s=null,w==="resize"&&E)n.setSharedStorage(Wt,null),C=!0;else if(w==="area"){if(n.setSharedStorage(Se,null),y){const R=n.getSharedStorage(ca),B=n.getSharedStorage(da);if(R&&B){const{elements:F}=Sp(y,{start:R,end:B,calculator:a,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()});F.length>0&&(n.setSharedStorage(Se,"drag-list"),h(F,{triggerEvent:!0}),C=!0)}}}else w==="drag-list"?(n.setSharedStorage(Se,"drag-list-end"),C=!0):y&&(a.getPointElement(b.point,{data:y,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()}).element?(n.setSharedStorage(Se,"select"),C=!0):n.setSharedStorage(Se,null));n.getSharedStorage(Se)===null&&(v(),C=!0),(()=>{if(C){if(y&&Array.isArray(y==null?void 0:y.elements)&&["drag","drag-list"].includes(w)){const R=bh(y.elements,S,{extend:!0});n.setActiveStorage("contextHeight",R.contextSize.contextHeight),n.setActiveStorage("contextWidth",R.contextSize.contextWidth)}y&&["drag","drag-list","drag-list-end","resize"].includes(w)&&i.trigger("change",{data:y,type:"dragElement"}),t.drawFrame()}})()},pointLeave(){s=null,v(),t.drawFrame()},doubleClick(b){var y,E,w,S;const C=br(b.point,p());if(n.setSharedStorage(hn,null),n.setSharedStorage(mr,[]),!(C.elements.length===1&&((E=(y=C.elements[0])===null||y===void 0?void 0:y.operations)===null||E===void 0?void 0:E.lock)===!0)){if(C.elements.length===1&&((w=C.elements[0])===null||w===void 0?void 0:w.type)==="group"){if(u(C.elements[0])===!0){n.setSharedStorage(Se,null),t.drawFrame();return}}else C.elements.length===1&&((S=C.elements[0])===null||S===void 0?void 0:S.type)==="text"&&i.trigger(wo,{element:C.elements[0],groupQueue:n.getSharedStorage(Be)||[],viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(Se,null)}},beforeDrawFrame({snapshot:b}){var y;const{activeStore:E,sharedStore:w}=b,{scale:S,offsetLeft:C,offsetTop:j,offsetRight:R,offsetBottom:B,width:F,height:V,contextHeight:L,contextWidth:_,devicePixelRatio:T}=E,P=e.sharer,k={scale:S,offsetLeft:C,offsetTop:j,offsetRight:R,offsetBottom:B},N={width:F,height:V,contextHeight:L,contextWidth:_,devicePixelRatio:T},x=w[mr][0],z=w[vr],X=w[Vi],A=w[Se],U=w[ca],G=w[da],O=w[Be],$=w[Ui],I={calculator:a,viewScaleInfo:k,viewSizeInfo:N},H=x?sa(x,{groupQueue:O,controllerSize:10,viewScaleInfo:k}):null,ee=!!(!((y=z==null?void 0:z.operations)===null||y===void 0)&&y.lock);if((O==null?void 0:O.length)>0)wp(o,$,I),z&&A!=="drag"&&(ee?Ml(o,X,Object.assign(Object.assign({},I),{controller:sa(z,{groupQueue:O,controllerSize:10,viewScaleInfo:k})})):Cl(o,X,I)),!ee&&x&&["select","drag","resize"].includes(A)&&Al(o,H,Object.assign({},I));else if(z&&A!=="drag"&&(ee?Ml(o,X,Object.assign(Object.assign({},I),{controller:sa(z,{groupQueue:O,controllerSize:10,viewScaleInfo:k})})):Cl(o,X,I)),!ee&&x&&["select","drag","resize"].includes(A))Al(o,H,Object.assign({},I));else if(A==="area"&&U&&G)bp(o,{start:U,end:G});else if(["drag-list","drag-list-end"].includes(A)){const ur=Yi(d(),{viewScaleInfo:P.getActiveViewScaleInfo(),viewSizeInfo:P.getActiveViewSizeInfo(),calculator:a});ur&&yp(o,{areaSize:ur})}}}},Vr="SCROLL",Ba=Symbol(`${Vr}_xThumbRect`),Fa=Symbol(`${Vr}_yThumbRect`),Mn=Symbol(`${Vr}_prevPoint`),So=Symbol(`${Vr}_activePoint`),$r=Symbol(`${Vr}_activeThumbType`),_p=12,Ol=16,Op=.36,Tl={width:_p,thumbColor:"#000000AA",scrollBarColor:"#FFFFFF60",showScrollBar:!1};function $l(e,t,n){const r=e,{x:a,y:i,w:o,h:s}=n;return r.beginPath(),r.rect(a,i,o,s),r.closePath(),!!r.isPointInPath(t.x,t.y)}function Tp(e,t,n){let r=null;const{xThumbRect:a,yThumbRect:i}=n;return a&&$l(e,t,a)?r="X":i&&$l(e,t,i)&&(r="Y"),r}function $p(e){const{sharedStore:t}=e;return{activePoint:t[So]||null,prevPoint:t[Mn]||null,activeThumbType:t[$r]||null,xThumbRect:t[Ba]||null,yThumbRect:t[Fa]||null}}function Pp(e,t){const{width:n,height:r}=t,{offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s}=e,c=Ol*2.5,d=Ol;let u=0,f=0;u=Math.max(c,n-d*2-(Math.abs(o)+Math.abs(s))),u>=n&&(u=n),f=Math.max(c,r-d*2-(Math.abs(a)+Math.abs(i))),f>=r&&(f=r);const h=d,p=n-u-d;let v=h;o>0?v=h:s>0?v=p:o<=0&&u>0&&!(o===0&&s===0)&&(v=h+(n-u)*Math.abs(o)/(Math.abs(o)+Math.abs(s)),v=Math.min(Math.max(0,v-h),n-u));const g=d,m=r-f-d;let b=g;a>0?b=g:i>0?b=m:a<=0&&f>0&&!(a===0&&i===0)&&(b=g+(r-f)*Math.abs(a)/(Math.abs(a)+Math.abs(i)),b=Math.min(Math.max(0,b-g),r-f));const y={x:v,y:r-d,w:u,h:d},E={x:n-d,y:b,w:d,h:f};return{lineSize:d,xSize:u,ySize:f,translateY:b,translateX:v,thumbColor:Tl.thumbColor,scrollBarColor:Tl.scrollBarColor,xThumbRect:y,yThumbRect:E}}function Pl(e,t){let{x:n,y:r,h:a,w:i}=t;e.save(),e.shadowColor="#FFFFFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=1;{const{color:o,axis:s}=t;s==="X"?(r=r+a/4+0,a=a/2):s==="Y"&&(n=n+i/4+0,i=i/2);let c=t.r;c=Math.min(c,i/2,a/2),(i{const{viewer:t,boardContent:n,sharer:r}=e,{helperContext:a}=n;r.setSharedStorage(Ba,null),r.setSharedStorage(Fa,null);const i=()=>{r.setSharedStorage(Mn,null),r.setSharedStorage(So,null),r.setSharedStorage($r,null)};i();const o=d=>{const u=r.getSharedStorage(Mn);if(u){const{offsetLeft:f,offsetRight:h}=r.getActiveViewScaleInfo(),{width:p}=r.getActiveViewSizeInfo(),v=-(d.x-u.x),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveX:m}),t.drawFrame()}},s=d=>{const u=r.getSharedStorage(Mn);if(u){const{offsetTop:f,offsetBottom:h}=r.getActiveViewScaleInfo(),{height:p}=r.getActiveViewSizeInfo(),v=-(d.y-u.y),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveY:m}),t.drawFrame()}},c=d=>Tp(a,d,{xThumbRect:r.getSharedStorage(Ba),yThumbRect:r.getSharedStorage(Fa)});return{name:"@middleware/scroller",wheel:d=>{t.scroll({moveX:0-d.deltaX,moveY:0-d.deltaY}),t.drawFrame()},pointStart:d=>{const{point:u}=d,f=c(u);if(f==="X"||f==="Y")return r.setSharedStorage($r,f),r.setSharedStorage(Mn,u),!1},pointMove:d=>{const{point:u}=d,f=r.getSharedStorage($r);if(f==="X"||f==="Y")return r.setSharedStorage(So,u),f==="X"?o(u):f==="Y"&&s(u),r.setSharedStorage(Mn,u),!1},pointEnd:()=>{const d=r.getSharedStorage($r);if(i(),d==="X"||d==="Y")return t.scroll({moveX:0,moveY:0}),t.drawFrame(),!1},beforeDrawFrame({snapshot:d}){const{xThumbRect:u,yThumbRect:f}=zp(a,{snapshot:d});r.setSharedStorage(Ba,u),r.setSharedStorage(Fa,f)}}},Mo="@middleware/scale",Ao=e=>{const{viewer:t,sharer:n,eventHub:r}=e,a=50,i=.05;return{name:"@middleware/scaler",wheelScale(o){const{deltaY:s,point:c}=o,{scale:d}=n.getActiveViewScaleInfo();let u=d;if(s<0?u=d*1.1:s>0&&(u=d*.9),ua)return;const{moveX:f,moveY:h}=t.scale({scale:u,point:c});t.scroll({moveX:f,moveY:h}),t.drawFrame();const p=Te(d);r.trigger(Mo,{scale:p})}}},Ne=16,Rp="#FFFFFFA8",Np="#00000080",vu="#000000",mu="#00000080",bu="monospace",_o=10,yu=100,Il="#AAAAAA20",zl="#AAAAAA40",mi=1;function wu(e){const{scale:t,viewLength:n,viewOffset:r}=e,a=[];let i=10;i=Te(i/t,{decimalPlaces:0}),i=Math.max(10,Math.min(i,1e3));const o=i*10,s=i*5;let c=0;const d=i*t,u=0-r,f=0,h=u%d,p=(u-h+d)/t,v=f+(d-h);for(;v+c*d{e.fillStyle=mu,e.textBaseline="top",e.$setFont({fontWeight:yu,fontSize:_o,fontFamily:bu}),e.fillText(h,s+_o,d.position+s)})}}}function Bp(e,t){const{viewSizeInfo:n}=t,{width:r,height:a}=n;e.beginPath(),e.moveTo(0,0),e.lineTo(r+1,0),e.lineTo(r+1,Ne),e.lineTo(Ne,Ne),e.lineTo(Ne,a+1),e.lineTo(0,a+1),e.lineTo(0,0),e.closePath(),e.fillStyle=Rp,e.fill(),e.lineWidth=mi,e.setLineDash([]),e.strokeStyle=Np,e.stroke()}function Fp(e,t){const{xList:n,yList:r,viewSizeInfo:a}=t,{width:i,height:o}=a;for(let s=0;s{const{boardContent:t,viewer:n,eventHub:r}=e,{helperContext:a,underContext:i}=t;let o=!0,s=!0;const c=d=>{typeof(d==null?void 0:d.show)=="boolean"&&(o=d.show),typeof(d==null?void 0:d.showGrid)=="boolean"&&(s=d.showGrid),(typeof(d==null?void 0:d.show)=="boolean"||typeof(d==null?void 0:d.showGrid)=="boolean")&&n.drawFrame()};return{name:"@middleware/ruler",use(){r.on(Rl,c)},disuse(){r.off(Rl,c)},beforeDrawFrame:({snapshot:d})=>{if(o===!0){const u=zd(d),f=Rd(d);Bp(a,{viewScaleInfo:u,viewSizeInfo:f});const h=Dp({viewScaleInfo:u,viewSizeInfo:f});Lp(a,{scaleList:h});const p=jp({viewScaleInfo:u,viewSizeInfo:f});kp(a,{scaleList:p}),s===!0&&Fp(i,{xList:h,yList:p,viewScaleInfo:u,viewSizeInfo:f})}}}},Hp="DRAG",fa=Symbol(`${Hp}_prevPoint`),To=e=>{const{eventHub:t,sharer:n,viewer:r}=e;let a=!1;return{name:"@middleware/dragger",hover(){a!==!0&&t.trigger("cursor",{type:"drag-default"})},pointStart(i){const{point:o}=i;n.setSharedStorage(fa,o),a=!0,t.trigger("cursor",{type:"drag-active"})},pointMove(i){const{point:o}=i,s=n.getSharedStorage(fa);if(o&&s){const c=o.x-s.x,d=o.y-s.y;r.scroll({moveX:c,moveY:d}),r.drawFrame()}n.setSharedStorage(fa,o)},pointEnd(){a=!1,n.setSharedStorage(fa,null),t.trigger("cursor",{type:"drag-default"})}}};var Xi=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ae=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},$o,_e,Ha,ti,xu;class Wp{constructor(t,n){$o.add(this),_e.set(this,void 0),Ha.set(this,void 0),ti.set(this,void 0);const{devicePixelRatio:r=1,width:a,height:i,createCustomContext2D:o}=n;Xi(this,ti,t,"f");const s=document.createElement("canvas");Xi(this,Ha,s,"f"),Ae(this,$o,"m",xu).call(this),t.appendChild(s);const c=fh(s,{width:a,height:i,devicePixelRatio:r,offscreen:!0,createCustomContext2D:o}),d=new lp({boardContent:c,container:t}),u=d.getSharer();u.setActiveViewSizeInfo({width:a,height:i,devicePixelRatio:r,contextWidth:a,contextHeight:i}),Xi(this,_e,d,"f"),this.resize(u.getActiveViewSizeInfo());const f=d.getEventHub();new hp(t,{eventHub:f})}isDestroyed(){return Ae(this,_e,"f").isDestroyed()}destroy(){Ae(this,_e,"f").destroy(),Ae(this,Ha,"f").remove()}use(t){Ae(this,_e,"f").use(t)}disuse(t){Ae(this,_e,"f").disuse(t)}setData(t){Ld((t==null?void 0:t.elements)||[]),Ae(this,_e,"f").setData(t)}getData(){return Ae(this,_e,"f").getData()}scale(t){Ae(this,_e,"f").scale(t),Ae(this,_e,"f").getViewer().drawFrame()}resize(t){const n=Ae(this,_e,"f"),a=n.getSharer().getActiveViewSizeInfo();n.resize(Object.assign(Object.assign({},a),t))}clear(){Ae(this,_e,"f").clear()}on(t,n){Ae(this,_e,"f").getEventHub().on(t,n)}off(t,n){Ae(this,_e,"f").getEventHub().off(t,n)}trigger(t,n){Ae(this,_e,"f").getEventHub().trigger(t,n)}getViewInfo(){const n=Ae(this,_e,"f").getSharer(),r=n.getActiveViewSizeInfo(),a=n.getActiveViewScaleInfo();return{viewSizeInfo:r,viewScaleInfo:a}}refresh(){Ae(this,_e,"f").getViewer().drawFrame()}setViewScale(t){Ae(this,_e,"f").updateViewScaleInfo(t)}getLoadItemMap(){return Ae(this,_e,"f").getRenderer().getLoadItemMap()}onBoardWatcherEvents(){Ae(this,_e,"f").onWatcherEvents()}offBoardWatcherEvents(){Ae(this,_e,"f").offWatcherEvents()}}_e=new WeakMap,Ha=new WeakMap,ti=new WeakMap,$o=new WeakSet,xu=function(){const t=Ae(this,ti,"f");t.style.position="relative"};const Gp={enableScroll:!0,enableSelect:!0,enableScale:!0,enableRuler:!0,enableTextEdit:!0,enableDrag:!1};var Vp=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function Up(e){return Vp(this,void 0,void 0,function*(){const{data:t,width:n,height:r,devicePixelRatio:a,viewScaleInfo:i,viewSizeInfo:o,loadItemMap:s}=e;let c=Ea({width:n,height:r,devicePixelRatio:a}),d=new nu({viewContext:c}),u=new tu({viewContext:c,calculator:d});u.setLoadItemMap(s),u.drawData(t,{viewScaleInfo:i,viewSizeInfo:o,forceDrawAll:!0});let f=null,h=c.$getOffscreenCanvas();if(h){const p=yield h.convertToBlob();f=window.URL.createObjectURL(p)}return h=null,c=null,d=null,u=null,{blobURL:f,width:n,height:r,devicePixelRatio:a}})}var Yp=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},Zi=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},me=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Po,be,Un,Eu;class Xp{constructor(t,n){Po.add(this),be.set(this,void 0),Un.set(this,void 0);const r=Object.assign(Object.assign({},Gp),n),{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s}=r,c=new Wp(t,{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s});Zi(this,be,c,"f"),Zi(this,Un,r,"f"),me(this,Po,"m",Eu).call(this)}reset(t){const n=me(this,be,"f"),{enableRuler:r,enableScale:a,enableScroll:i,enableSelect:o,enableTextEdit:s,enableDrag:c}=t;i===!0?n.use(Co):i===!1&&n.disuse(Co),o===!0?n.use(Eo):o===!1&&n.disuse(Eo),a===!0?n.use(Ao):a===!1&&n.disuse(Ao),r===!0?n.use(Oo):r===!1&&n.disuse(Oo),s===!0?n.use(xo):s===!1&&n.disuse(xo),c===!0?n.use(To):c===!1&&n.disuse(To),n.refresh(),Zi(this,Un,Object.assign(Object.assign({},me(this,Un,"f")),t),"f")}setData(t){const n=me(this,be,"f");n.setData(t),n.trigger("change",{data:t,type:"setData"})}getData(t){const n=me(this,be,"f").getData();return n&&(t==null?void 0:t.compact)===!0?Ff(n,{loadItemMap:me(this,be,"f").getLoadItemMap()}):n}getViewInfo(){return me(this,be,"f").getViewInfo()}scale(t){me(this,be,"f").scale(t)}setViewScale(t){const n=me(this,be,"f");n.setViewScale(t),n.refresh()}centerContent(t){const n=(t==null?void 0:t.data)||me(this,be,"f").getData(),{viewSizeInfo:r}=this.getViewInfo();if(Array.isArray(n==null?void 0:n.elements)&&(n==null?void 0:n.elements.length)>0){const a=kh(n,{viewSizeInfo:r});this.setViewScale(a)}}resize(t){me(this,be,"f").resize(t)}on(t,n){me(this,be,"f").on(t,n)}off(t,n){me(this,be,"f").off(t,n)}trigger(t,n){me(this,be,"f").trigger(t,n)}selectElement(t){this.selectElements([t])}selectElements(t){this.trigger(Lt,{uuids:t})}selectElementByPosition(t){this.selectElementsByPositions([t])}selectElementsByPositions(t){this.trigger(Lt,{positions:t})}cancelElements(){this.trigger(Lt,{uuids:[]})}createElement(t,n){const{viewScaleInfo:r,viewSizeInfo:a}=me(this,be,"f").getViewInfo();return Dh(t,(n==null?void 0:n.element)||{},(n==null?void 0:n.viewCenter)===!0?{viewScaleInfo:r,viewSizeInfo:a}:void 0)}updateElement(t){const n=me(this,be,"f"),r=n.getData()||{elements:[]};Fr(t.uuid,t,r.elements),n.setData(r),n.refresh(),n.trigger("change",{data:r,type:"updateElement"})}addElement(t,n){var r;const a=me(this,be,"f"),i=a.getData()||{elements:[]};if(!n||!(!((r=n==null?void 0:n.position)===null||r===void 0)&&r.length))i.elements.push(t);else if(n!=null&&n.position){const o=[...n==null?void 0:n.position];Xd(t,o,i.elements)}return a.setData(i),a.refresh(),a.trigger("change",{data:i,type:"addElement"}),i}deleteElement(t){const n=me(this,be,"f"),r=n.getData()||{elements:[]};jh(t,r.elements),n.setData(r),n.refresh(),n.trigger("change",{data:r,type:"deleteElement"})}moveElement(t,n){const r=me(this,be,"f"),a=r.getData()||{elements:[]},i=vi(t,a.elements),{elements:o}=Kd(a.elements,{from:i,to:n});a.elements=o,r.setData(a),r.refresh(),r.trigger("change",{data:a,type:"moveElement"})}getImageBlobURL(t){return Yp(this,void 0,void 0,function*(){const n=this.getData()||{elements:[]},{devicePixelRatio:r}=t,a=mh(n.elements),{viewSizeInfo:i}=this.getViewInfo();return yield Up({width:a.w,height:a.h,devicePixelRatio:r,data:n,viewScaleInfo:{scale:1,offsetLeft:-a.x,offsetTop:-a.y,offsetBottom:0,offsetRight:0},viewSizeInfo:Object.assign(Object.assign({},i),{devicePixelRatio:r}),loadItemMap:me(this,be,"f").getLoadItemMap()})})}isDestroyed(){return me(this,be,"f").isDestroyed()}destroy(){me(this,be,"f").destroy()}getViewCenter(){const{viewScaleInfo:t,viewSizeInfo:n}=this.getViewInfo();return Bh({viewScaleInfo:t,viewSizeInfo:n})}$onBoardWatcherEvents(){me(this,be,"f").onBoardWatcherEvents()}$offBoardWatcherEvents(){me(this,be,"f").offBoardWatcherEvents()}}be=new WeakMap,Un=new WeakMap,Po=new WeakSet,Eu=function(){const{enableRuler:t,enableScale:n,enableScroll:r,enableSelect:a,enableTextEdit:i,enableDrag:o}=me(this,Un,"f"),s=me(this,be,"f");r===!0&&s.use(Co),a===!0&&s.use(Eo),n===!0&&s.use(Ao),t===!0&&s.use(Oo),i===!0&&s.use(xo),o===!0&&s.use(To)};const Zp=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}),l.createElement("path",{d:"M921 867L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}))),Kp="base-scale-selector",Qp=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=M.useContext(le),s=o(Kp),c=s("menu-item"),d=s("input"),[u,f]=M.useState(100);M.useEffect(()=>{const m=Te(parseFloat(a||"1")*100);f(m)},[a]);const h=m=>{const{key:b}=m;i==null||i(b)},p=m=>{m.stopPropagation()},g={items:[{label:l.createElement("span",{className:c},l.createElement(se,{className:d,size:"small",value:u,suffix:"%",onClick:p,step:1,min:10,max:1e4,controls:!1,onChange:m=>{if(m&&m>0){const b=Te(m/100);i==null||i(`${b}`)}}})),key:"custom"},...[.5,1,2,3].map(m=>({key:`${m}`,label:l.createElement("span",{className:c},`${Te(m*100)}%`)}))],onClick:h,selectedKeys:[`${a||r}`]};return M.useMemo(()=>l.createElement(fi,{className:pe(s(),t),menu:g},l.createElement(Ge,{icon:l.createElement(Zp,null),size:"small"},`${Te(parseFloat(a||"1")*100)}%`)),[t,n,r,a,i,u])},Jp=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M508 512m-112 0a112 112 0 1 0 224 0 112 112 0 1 0-224 0Z"}),l.createElement("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3-7.7 16.2-7.7 35.2 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM508 688c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z"}))),qp=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M942.3 486.4l-0.1-0.1-0.1-0.1c-36.4-76.7-80-138.7-130.7-186L760.7 351c43.7 40.2 81.5 93.7 114.1 160.9C791.5 684.2 673.4 766 512 766c-51.3 0-98.3-8.3-141.2-25.1l-54.7 54.7C374.6 823.8 439.8 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0.1-51.3zM878.3 154.2l-42.4-42.4c-3.1-3.1-8.2-3.1-11.3 0L707.8 228.5C649.4 200.2 584.2 186 512 186c-192.2 0-335.4 100.5-430.2 300.3v0.1c-7.7 16.2-7.7 35.2 0 51.5 36.4 76.7 80 138.7 130.7 186.1L111.8 824.5c-3.1 3.1-3.1 8.2 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0l712.8-712.8c3.1-3 3.1-8.1 0-11.2zM398.9 537.4c-1.9-8.2-2.9-16.7-2.9-25.4 0-61.9 50.1-112 112-112 8.7 0 17.3 1 25.4 2.9L398.9 537.4z m184.5-184.5C560.5 342.1 535 336 508 336c-97.2 0-176 78.8-176 176 0 27 6.1 52.5 16.9 75.4L263.3 673c-43.7-40.2-81.5-93.7-114.1-160.9C232.6 339.8 350.7 258 512 258c51.3 0 98.3 8.3 141.2 25.1l-69.8 69.8z"}),l.createElement("path",{d:"M508 624c-6.4 0-12.7-0.5-18.8-1.6l-51.1 51.1c21.4 9.3 45.1 14.4 69.9 14.4 97.2 0 176-78.8 176-176 0-24.8-5.1-48.5-14.4-69.9l-51.1 51.1c1 6.1 1.6 12.4 1.6 18.8C620 573.9 569.9 624 508 624z"}))),Su=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"}))),Cu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),Mu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M853.333333 170.666667H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666666v128a42.666667 42.666667 0 0 0 85.333333 0V256h256v554.666667H384a42.666667 42.666667 0 0 0 0 85.333333h256a42.666667 42.666667 0 0 0 0-85.333333h-85.333333V256h256v85.333333a42.666667 42.666667 0 0 0 85.333333 0V213.333333a42.666667 42.666667 0 0 0-42.666667-42.666666z"}))),Au=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M0.00592 521.157814v-103.646801l430.267025 235.101281c36.191582 13.567843 70.207188 15.615819 111.870706 0.191998l440.986902-258.365013v103.614802l-435.386966 258.877007c-42.175512 18.303788-91.326944 18.303788-126.398539 0L0.00592 521.157814z"}),l.createElement("path",{d:"M0.00592 743.651242v-104.798789l406.427301 221.43744c17.2798 9.439891 40.511532 17.599797 65.119247 20.383764h27.999676c32.511624-5.023942 47.103455-10.207882 67.615218-22.943735l415.931191-258.173014v98.974855l-430.875018 268.95689c-42.111513 17.439798-95.806892 18.079791-130.878487 0.575994L0.00592 743.619242zM20.069688 246.024995L399.073306 20.971598c41.279523-26.303696 90.430954-27.967677 133.342458-4.35195l421.083131 198.621703c35.743587 17.599797 37.18357 61.311291 2.655969 81.151062l-414.043212 226.205384a165.758083 165.758083 0 0 1-133.374458 4.415949L22.725657 327.208057C9.157814 318.664155 0.90191 303.56033 0.229917 285.000545c-0.607993-18.911781 10.719876-32.159628 19.807771-38.94355z"})," ")),_u=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}))),Ou=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32z m-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792z m0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z"}),l.createElement("path",{d:"M304 456c48.6 0 88-39.4 88-88s-39.4-88-88-88-88 39.4-88 88 39.4 88 88 88z m0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}))),e3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M256 682.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0zM768 170.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0z"}),l.createElement("path",{d:"M707.84 316.16a42.666667 42.666667 0 0 1 0 60.330667l-331.178667 331.178666a42.666667 42.666667 0 0 1-60.330666-60.330666l331.178666-331.178667a42.666667 42.666667 0 0 1 60.330667 0z"}))),Tu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M145 96l66 746.6L511.8 928l299.6-85.4L878.7 96H145z m610.9 700.6l-244.1 69.6-245.2-69.6-56.7-641.2h603.8l-57.8 641.2z"}),l.createElement("path",{d:"M281 249l1.7 24.3 22.7 253.5h206.5v-0.1h112.9l-11.4 118.5L511 672.9v0.2h-0.8l-102.4-27.7-6.5-73.2h-91l11.3 144.7 188.6 52h1.7v-0.4l187.7-51.7 1.7-16.3 21.2-242.2 3.2-24.3H511v0.2H389.9l-8.2-94.2h352.1l1.7-19.5 4.8-47.2L742 249H511z"}))),t3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-0.7 5.2-2L869 536.2c14.7-12.8 14.7-35.6 0-48.4z"}))),n3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 0.3L512 465.6l-99.3-118.4-66.1-0.3c-4.4 0-8 3.5-8 8 0 1.9 0.7 3.7 1.9 5.2l130.1 155L340.5 670c-1.2 1.5-1.9 3.3-1.9 5.2 0 4.4 3.6 8 8 8l66.1-0.3L512 564.4l99.3 118.4 66 0.3c4.4 0 8-3.5 8-8 0-1.9-0.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}),l.createElement("path",{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),Gt="node",r3=e=>{const{className:t,style:n,type:r,uuid:a,nodeKey:i,title:o,position:s,generateClassName:c,onTitleChange:d,onOperationToggle:u,onDelete:f,onSelect:h,onGoToGroup:p,operations:v,isSelected:g}=e,[m,b]=M.useState(!1),[y,E]=M.useState(!1),w=M.useRef(o),S=c(Gt),C=c(Gt,"icon"),j=c(Gt,"title"),R=c(Gt,"title","input"),B=c(Gt,"title","icon"),F=c(Gt,"action"),V=c(Gt,"selected"),L=M.useRef(0),_=M.useRef(null);M.useEffect(()=>{var G;m===!0&&((G=_.current)===null||G===void 0||G.focus())},[m]);const T=G=>{b(!1),d==null||d({uuid:i,value:G.target.value||""})},P=G=>{w.current=G.target.value||""},k=G=>{var O;G.code==="Enter"&&(b(!1),d==null||d({uuid:i,value:((O=G==null?void 0:G.target)===null||O===void 0?void 0:O.value)||""}))},N=G=>{G.stopPropagation(),G.preventDefault()},D=G=>{G.stopPropagation(),E(!0)},x=G=>{G.stopPropagation(),E(!1)},z=G=>{const O=Date.now(),$=O-L.current;L.current=O,h==null||h({uuids:[a],positions:[s]}),$<=300&&$>0&&(G.stopPropagation(),G.preventDefault(),b(!0))},X=G=>{G.stopPropagation(),G.preventDefault(),f==null||f({uuid:i})},A=G=>{G.stopPropagation(),G.preventDefault(),u==null||u({uuid:i,operations:{invisible:!v.invisible}})},U=G=>{G.stopPropagation(),G.preventDefault(),p==null||p({uuid:a,position:s})};return M.useMemo(()=>{w.current=o;function G(O){return O==="rect"?l.createElement(Su,{className:B}):O==="circle"?l.createElement(Cu,{className:B}):O==="text"?l.createElement(Mu,{className:B}):O==="path"?l.createElement(e3,{className:B}):O==="image"?l.createElement(Ou,{className:B}):O==="svg"?l.createElement(_u,{className:B}):O==="group"?l.createElement(Au,{className:B}):O==="html"?l.createElement(Tu,{className:B}):l.createElement("span",{className:B})}return l.createElement("span",{key:i,style:n,className:pe(S,t,g?V:null),onClick:z,onMouseOver:D,onMouseLeave:x},l.createElement("span",{className:j},G(r),l.createElement("span",null,o)),y&&l.createElement("span",{className:F},r==="group"&&l.createElement(t3,{className:C,onClick:U}),v.invisible?l.createElement(qp,{className:C,onClick:A}):l.createElement(Jp,{className:C,onClick:A}),l.createElement(n3,{className:C,onClick:X})),m&&l.createElement("span",{className:R},l.createElement(Kn,{ref:_,size:"small",defaultValue:o,onBlur:T,onClick:N,onKeyDown:k,onChange:P})))},[i,o,m,r,y,v,g])};function a3(e,t){const n=[],{position:r}=t;if(Array.isArray(e)){const a=[...r];e.forEach((i,o)=>{a.push(o),n.push($u(i,Object.assign(Object.assign({},t),{position:[...a]}))),a.pop()})}return n}const $u=(e,t)=>{const{onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,position:s,selectedKeys:c}=t,d={key:e.key,title:l.createElement(r3,{uuid:e.key,title:e.title,position:s,operations:e.operations,nodeKey:e.key,type:e.type,generateClassName:t.generateClassName,onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,isSelected:c==null?void 0:c.includes(e.key)}),children:[]};if(Array.isArray(e.children)){const u=[...s];e.children.forEach((f,h)=>{u.push(h),d.children.push($u(f,Object.assign(Object.assign({},t),{position:[...u]}))),u.pop()})}return d},i3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}),l.createElement("path",{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8C574.1 404.4 544.1 392 512 392z"}))),o3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M264 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM760 654c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),s3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M120 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM120 654h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),l3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M904 158H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 582H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),c3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H212V212h200v200zM864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H612V212h200v200zM864 544H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z m-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}))),d3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333zM128 469.333333v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM128 640v85.333333h85.333333v-85.333333z m0-341.333333v85.333333h85.333333v-85.333333z m341.333333 341.333333v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128zM128 810.666667v85.333333h768v-85.333333z"}))),u3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M592 928H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96zM976 0H784a48 48 0 1 0 0 96h144v144.016a48 48 0 1 0 96 0V48a48 48 0 0 0-48-48zM240 928H96v-144a48 48 0 1 0-96 0v192a48 48 0 0 0 48 48h192a48 48 0 1 0 0-96zM48 640a48 48 0 0 0 48-48V432a48 48 0 1 0-96 0v160a48 48 0 0 0 48 48zM240 0H48a48 48 0 0 0-48 48v192a48 48 0 1 0 96 0V96h144a48 48 0 1 0 0-96z m784 592V432a48 48 0 1 0-96 0v160a48 48 0 1 0 96 0zM592 0H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96z m384 736a48 48 0 0 0-48 48v144h-144a48 48 0 1 0 0 96h192a48 48 0 0 0 48-48V784a48 48 0 0 0-48-48z"}))),f3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333z m-512-170.666667v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM469.333333 640v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v768h85.333333V128z m170.666667 0v85.333333h85.333333V128z m170.666666 682.666667v85.333333h85.333334v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m-512 0v85.333333h85.333333v-85.333333z"}))),h3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333zM128 213.333333h85.333333V128H128v85.333333z m170.666667 0h85.333333V128h-85.333333v85.333333z m0 341.333334h85.333333v-85.333334h-85.333333v85.333334zM128 896h85.333333v-85.333333H128v85.333333z m341.333333 0h85.333334v-85.333333h-85.333334v85.333333zM128 554.666667h85.333333v-85.333334H128v85.333334z m0 170.666666h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m170.666667-170.666666h85.333333v-85.333334h-85.333333v85.333334z m170.666667-426.666667v768h85.333333V128h-85.333333z m-170.666667 768h85.333333v-85.333333h-85.333333v85.333333z m0-682.666667h85.333333V128h-85.333333v85.333333z m-170.666667 341.333334h85.333334v-85.333334h-85.333334v85.333334z m0-341.333334h85.333334V128h-85.333334v85.333333z m0 170.666667h85.333334v-85.333333h-85.333334v85.333333z"}))),p3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333z m0-341.333333h85.333333v-85.333334h-85.333333v85.333334z m170.666666 0h85.333334v-85.333334h-85.333334v85.333334z m0 341.333333h85.333334v-85.333333h-85.333334v85.333333zM128 725.333333h85.333333v-85.333333H128v85.333333z m0 170.666667h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333334H128v85.333334z m0-170.666667h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m341.333334-341.333333h85.333333v-85.333333h-85.333333v85.333333z m0 170.666667h85.333333v-85.333334h-85.333333v85.333334zM128 128v85.333333h768V128H128z m682.666667 597.333333h85.333333v-85.333333h-85.333333v85.333333z m-170.666667 170.666667h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-512h85.333334v-85.333333h-85.333334v85.333333z m341.333334 512h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-341.333333h85.333333v-85.333334h-85.333333v85.333334z"}))),g3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M341.333333 512a42.666667 42.666667 0 0 0 42.666667 42.666667h256a42.666667 42.666667 0 0 0 0-85.333334H384a42.666667 42.666667 0 0 0-42.666667 42.666667z"}),l.createElement("path",{d:"M384 682.666667H307.626667A176.213333 176.213333 0 0 1 128 527.786667 170.666667 170.666667 0 0 1 298.666667 341.333333h85.333333a42.666667 42.666667 0 0 0 0-85.333333H307.626667a262.4 262.4 0 0 0-262.826667 222.293333A256 256 0 0 0 298.666667 768h85.333333a42.666667 42.666667 0 0 0 0-85.333333zM981.333333 479.573333A262.826667 262.826667 0 0 0 715.093333 256h-64.426666C616.106667 256 597.333333 275.2 597.333333 298.666667a42.666667 42.666667 0 0 0 42.666667 42.666666h76.373333A176.213333 176.213333 0 0 1 896 496.213333 170.666667 170.666667 0 0 1 725.333333 682.666667h-85.333333a42.666667 42.666667 0 0 0 0 85.333333h85.333333a256 256 0 0 0 256-288.426667z"}))),v3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M712 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM136 374h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM136 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM540 824H358c-87.3 0-158-70.7-158-158V484c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v182c0 127 103 230 230 230h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),m3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM484 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM658 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 476h-56c-4.4 0-8 3.6-8 8v182c0 87.3-70.7 158-158 158H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c127 0 230-103 230-230V484c0-4.4-3.6-8-8-8z"}))),b3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M656 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128H358c-127 0-230 103-230 230v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-87.3 70.7-158 158-158h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),y3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM666 128H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c87.3 0 158 70.7 158 158v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-127-103-230-230-230z"}))),Nl=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M896 810.666667v85.333333h-85.333333v-85.333333h85.333333z m-170.666667 0v85.333333h-85.333333v-85.333333h85.333333z m-170.666666 0v85.333333h-85.333334v-85.333333h85.333334z m-170.666667 0v85.333333H298.666667v-85.333333h85.333333z m-170.666667 0v85.333333H128v-85.333333h85.333333z m682.666667-170.666667v85.333333h-85.333333v-85.333333h85.333333zM213.333333 640v85.333333H128v-85.333333h85.333333z m0-170.666667v85.333334H128v-85.333334h85.333333z m469.333334-341.333333a213.418667 213.418667 0 0 1 213.12 204.074667L896 341.333333v213.333334h-85.333333V341.333333a128.426667 128.426667 0 0 0-120.490667-127.786666L682.666667 213.333333h-213.333334V128h213.333334zM213.333333 298.666667v85.333333H128V298.666667h85.333333z m0-170.666667v85.333333H128V128h85.333333z m170.666667 0v85.333333H298.666667V128h85.333333z"}))),w3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72z"}),l.createElement("path",{d:"M864 256H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}))),x3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M510.762667 970.666667A458.666667 458.666667 0 1 1 969.429333 512a459.178667 459.178667 0 0 1-458.666666 458.666667z m0-853.333334a394.666667 394.666667 0 1 0 394.666666 394.666667 395.093333 395.093333 0 0 0-394.666666-394.666667z"}),l.createElement("path",{d:"M512 724.48A212.48 212.48 0 1 1 724.48 512 212.736 212.736 0 0 1 512 724.48z m0-360.96A148.48 148.48 0 1 0 660.48 512 148.608 148.608 0 0 0 512 363.52z"}))),E3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M272.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512z"}),l.createElement("path",{d:"M576.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}))),Pu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z"}))),S3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M841.065412 337.317647v352.015059c0 46.802824-23.070118 74.752-39.936 95.111529-14.095059 17.106824-21.443765 26.684235-21.443765 41.803294V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-107.39953c0-37.526588 19.576471-61.199059 35.297882-80.173176 14.576941-17.648941 26.142118-31.563294 26.142118-56.681412V337.317647c0-18.793412-16.143059-36.502588-33.189647-36.502588-19.817412 0-24.033882 3.072-24.214588 3.19247-3.975529 5.360941-3.855059 34.273882-3.794824 57.584942 0.060235 11.384471 0.120471 24.094118-0.12047 38.068705-0.240941 16.504471-12.830118 28.792471-30.358589 29.696a30.117647 30.117647 0 0 1-29.876706-30.117647v-127.698823c0-18.492235-13.372235-32.406588-31.081411-32.406588-16.263529 0-28.190118 12.107294-29.635765 29.394823v120.651294a30.117647 30.117647 0 0 1-60.235294 0V268.047059l-0.120471-0.602353v-46.561882c0-3.975529-0.843294-38.671059-28.551529-38.671059-27.105882 0-31.201882 24.214588-31.201883 38.671059v42.345411c0 1.686588-0.662588 3.252706-0.963764 4.879059v156.250353a30.117647 30.117647 0 0 1-60.235294 0V262.686118c-2.891294-11.685647-11.324235-23.491765-28.069647-23.491765-17.227294 0-31.744 15.721412-31.744 34.334118v201.788235c0 0.421647-0.361412 0.783059-0.361412 1.204706v66.319059a30.117647 30.117647 0 0 1-60.235294 0v-50.236236c-10.601412-3.855059-25.961412-6.987294-34.755765-4.999529-7.107765 1.385412-14.275765 7.649882-18.733176 16.323765a43.309176 43.309176 0 0 0-0.542118 38.369882L345.148235 766.192941a31.563294 31.563294 0 0 1 2.108236 6.505412 32.888471 32.888471 0 0 0 35.418353 25.961412 30.238118 30.238118 0 0 1 33.310117 29.936941V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-77.462588a92.521412 92.521412 0 0 1-66.680471-67.764706L187.934118 567.055059a104.448 104.448 0 0 1 1.927529-90.774588c12.890353-24.877176 35.418353-42.706824 60.295529-47.766589 12.649412-2.590118 29.756235-1.867294 46.682353 1.566118v-43.369412c0-0.602353 0.301176-1.144471 0.361412-1.746823v-111.435294c0-52.163765 41.321412-94.569412 91.979294-94.569412 12.047059 0 23.612235 2.409412 34.093177 6.746353 11.986824-38.791529 44.152471-63.668706 86.317176-63.668706 40.237176 0 71.800471 25.419294 83.666824 63.909647 10.721882-4.517647 22.467765-6.987294 34.876235-6.987294 41.502118 0 75.776 26.744471 87.160471 64.572235 11.023059-2.409412 22.226824-2.951529 32.286117-2.951529 50.718118 0 93.485176 44.272941 93.485177 96.737882z"}))),C3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M170.666667 298.666667a42.666667 42.666667 0 1 1-85.333334 0V256a170.666667 170.666667 0 0 1 170.666667-170.666667h42.666667a42.666667 42.666667 0 1 1 0 85.333334H256a85.333333 85.333333 0 0 0-85.333333 85.333333v42.666667z m554.666666-128a42.666667 42.666667 0 0 1 0-85.333334h42.666667a170.666667 170.666667 0 0 1 170.666667 170.666667v42.666667a42.666667 42.666667 0 0 1-85.333334 0V256a85.333333 85.333333 0 0 0-85.333333-85.333333h-42.666667z m128 554.666666a42.666667 42.666667 0 0 1 85.333334 0v42.666667a170.666667 170.666667 0 0 1-170.666667 170.666667h-42.666667a42.666667 42.666667 0 0 1 0-85.333334h42.666667a85.333333 85.333333 0 0 0 85.333333-85.333333v-42.666667zM298.666667 853.333333a42.666667 42.666667 0 0 1 0 85.333334H256a170.666667 170.666667 0 0 1-170.666667-170.666667v-42.666667a42.666667 42.666667 0 0 1 85.333334 0v42.666667a85.333333 85.333333 0 0 0 85.333333 85.333333h42.666667z"}))),M3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M118.979048 637.074286l137.99619 66.243047 255.171048 123.587048 246.076952-119.222857 147.163429-70.485334a73.142857 73.142857 0 0 1-34.230857 97.109334l-327.119239 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 734.305524A73.142857 73.142857 0 0 1 118.979048 637.074286z m786.090666-153.063619a73.142857 73.142857 0 0 1-33.913904 97.767619L544.01219 740.205714a73.142857 73.142857 0 0 1-63.780571 0L153.136762 581.778286A73.142857 73.142857 0 0 1 117.51619 487.862857l362.300953 170.886095 32.329143 15.652572 327.119238-158.427429 65.80419-31.939047zM544.036571 139.190857l327.094858 158.403048a73.142857 73.142857 0 0 1 0 131.657143l-327.094858 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 429.251048a73.142857 73.142857 0 0 1 0-131.657143L480.256 139.215238a73.142857 73.142857 0 0 1 63.780571 0z m-31.890285 65.828572L185.027048 363.422476l327.119238 158.427429 327.119238-158.427429L512.146286 205.04381z"}))),A3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8c-16.4 12.8-16.4 37.5 0 50.3l450.8 352.1c5.3 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}))),_3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 42.666667a469.333333 469.333333 0 1 0 469.333333 469.333333A469.333333 469.333333 0 0 0 512 42.666667z m0 864a394.666667 394.666667 0 1 1 394.666667-394.666667 395.146667 395.146667 0 0 1-394.666667 394.666667z"}),l.createElement("path",{d:"M304.906667 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}),l.createElement("path",{d:"M512 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333334 0 66.666667 66.666667 0 1 0-133.333334 0Z"}),l.createElement("path",{d:"M719.093333 512m-66.666666 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}))),O3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M935.253333 111.786667a42.666667 42.666667 0 0 0-23.04-23.04A42.666667 42.666667 0 0 0 896 85.333333h-256a42.666667 42.666667 0 0 0 0 85.333334h153.173333L170.666667 793.173333V640a42.666667 42.666667 0 0 0-85.333334 0v256a42.666667 42.666667 0 0 0 3.413334 16.213333 42.666667 42.666667 0 0 0 23.04 23.04A42.666667 42.666667 0 0 0 128 938.666667h256a42.666667 42.666667 0 0 0 0-85.333334H230.826667L853.333333 230.826667V384a42.666667 42.666667 0 0 0 85.333334 0V128a42.666667 42.666667 0 0 0-3.413334-16.213333z"}))),T3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M128 128h64v389.312A384.32 384.32 0 0 1 506.688 832H896v64H192a64 64 0 0 1-64-64V128z m313.6 704A320.384 320.384 0 0 0 192 582.4V832h249.6z"}))),$3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M929.19 352.19c3.12 3.12 3.12 8.19 0 11.31L363.51 929.19c-3.12 3.12-8.19 3.12-11.31 0L94.81 671.81c-3.12-3.12-3.12-8.19 0-11.31L660.49 94.81c3.12-3.12 8.19-3.12 11.31 0l257.39 257.38z m-424.26 5.66l108.89 108.89c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0L456.85 405.93l-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-62.23 62.23 161.22 161.22 469.52-469.52-161.23-161.21-62.23 62.23 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91z"}))),P3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M725.333333 341.333333a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666666a42.666667 42.666667 0 1 0 42.666667 42.666666 42.666667 42.666667 0 0 0-42.666667-42.666666z"}),l.createElement("path",{d:"M640 256H85.333333a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM938.666667 256h-128a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333zM512 640a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666667 42.666667 42.666667 42.666667 0 0 0-42.666667-42.666667z"}),l.createElement("path",{d:"M426.666667 554.666667H85.333333a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM938.666667 554.666667h-341.333334a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM298.666667 938.666667a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666666 42.666667 42.666667 42.666667 0 0 0-42.666666-42.666667z"}),l.createElement("path",{d:"M938.666667 853.333333H384a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM213.333333 853.333333H85.333333a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333z"}))),I3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M802.742857 777.485714c49.942857 0 90.742857-41.371429 90.742857-92 0-61.142857-90.742857-160.914286-90.742857-160.914285S712 624.342857 712 685.485714c0 50.628571 40.8 92 90.742857 92z m-430.971428-50.4c8.114286 8.114286 21.257143 8.114286 29.257142 0l292.685715-292.571428c8.114286-8.114286 8.114286-21.257143 0-29.257143l-292.571429-292.571429c-0.685714-0.685714-1.485714-1.371429-2.285714-1.942857l-89.371429-89.371428a10.411429 10.411429 0 0 0-14.628571 0l-54.857143 54.857142a10.411429 10.411429 0 0 0 0 14.628572l76.8 76.8-237.485714 237.6c-8.114286 8.114286-8.114286 21.257143 0 29.257143l292.457143 292.571428z m14.742857-512.685714l204.457143 204.457143H182.171429l204.342857-204.457143zM960 859.428571H64c-5.028571 0-9.142857 4.114286-9.142857 9.142858v91.428571c0 5.028571 4.114286 9.142857 9.142857 9.142857h896c5.028571 0 9.142857-4.114286 9.142857-9.142857v-91.428571c0-5.028571-4.114286-9.142857-9.142857-9.142858z"}))),z3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669c3.2 4.1 9.4 4.1 12.6 0l112-141.7c4.1-5.2 0.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}))),R3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 474H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM506.3 399.3c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7 0.4-11.7-5.7-11.7H550V104c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v156h-62.8c-6 0-9.4 7-5.7 11.7l100.8 127.6zM517.7 624.7c-2.9-3.7-8.5-3.7-11.3 0L405.6 752.3c-3.7 4.7-0.4 11.7 5.7 11.7H474v156c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V764h62.8c6 0 9.4-7 5.7-11.7L517.7 624.7z"}))),N3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355c-3.2-4.1-9.4-4.1-12.6 0l-112 141.7c-4.1 5.2-0.4 12.9 6.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"}))),{DirectoryTree:D3}=lf,j3="base-element-tree",Ki=e=>{const t=e.split("-").map(n=>parseInt(n));return t.shift(),t},L3=l.forwardRef((e,t)=>{const{height:n,className:r,style:a,treeData:i,onTitleChange:o,onOperationToggle:s,onSelect:c,selectedKeys:d,onDrop:u,defaultExpandedKeys:f,expandedKeys:h,onDelete:p,onExpand:v,onGoToGroup:g}=e,{createPrefixName:m}=M.useContext(le),b=m(j3),y=(w,S)=>{const j=[Ki(S.node.pos)],R=[w[0]];c==null||c({uuids:R,positions:j})},E=({uuid:w})=>{p==null||p({uuid:w})};return M.useMemo(()=>{const w=a3(i||[],{generateClassName:b,onTitleChange:o,onOperationToggle:s,onDelete:E,onGoToGroup:g,position:[],selectedKeys:d||[]});return l.createElement(D3,{ref:t,height:n,style:a,className:pe(b(),r),showLine:!0,blockNode:!0,multiple:!0,selectedKeys:d,switcherIcon:l.createElement(Pu,null),icon:null,onSelect:y,treeData:w,defaultExpandedKeys:f,expandedKeys:h,onExpand:v,draggable:{icon:!1,nodeDraggable:()=>!0},onDrop:S=>{const{dragNode:C,node:j,dropToGap:R,dropPosition:B}=S,F=Ki(C.pos),V=Ki(j.pos);R===!0&&B>=0?V[V.length-1]=B:j.dragOverGapBottom===!0?V[V.length-1]=V[V.length-1]+1:j.dragOverGapTop===!0?V[V.length-1]=Math.max(0,V[V.length-1]-1):j.dragOver===!0&&V.push(0),u==null||u({from:F,to:V})}})},[r,a,y,i,d])});var k3=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{const{value:t,onChange:n}=e,r=k3(e,["value","onChange"]),a=o=>{n==null||n(o)},i=()=>{a(!t)};return l.createElement(Ge,Object.assign({},r,{type:t?"primary":"default",onClick:i}))},F3="ElementDetail",rn=()=>{const[e]=vf(F3);return e},H3="base-element-basic-attribute",It=e=>St.number(e*1)?Te(e*1):e,Dl=e=>{if(St.number(e*1)){const t=Te(e*1);return ft(t)}return e},W3=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,o=M.useRef(null),{createPrefixName:s}=M.useContext(le),c=s(H3),d=c(),u=c("row"),f=c("col"),h=c("input"),p=c("form-item"),v=rn(),g=m=>{var b;((b=r==null?void 0:r.operations)===null||b===void 0?void 0:b.limitRatio)===!0&&(m!=null&&m.hasOwnProperty("w")?m.h=Te(m.w/r.w*r.h):m!=null&&m.hasOwnProperty("h")&&(m.w=Te(m.h/r.h*r.w))),a==null||a(m)};return M.useEffect(()=>{var m;const{type:b,x:y,y:E,w,h:S,angle:C=0,operations:j={}}=r||{},R={x:y,y:E,w,h:S,angle:C,operations:{limitRatio:j.limitRatio}};b==="group"&&(R.operations.deepResize=j.deepResize),(m=o.current)===null||m===void 0||m.setFieldsValue(R)},[r]),M.useMemo(()=>l.createElement(J,{ref:o,style:n,className:pe(d,t),onValuesChange:g},l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"x"},l.createElement(se,{className:h,size:"small",placeholder:"X",prefix:"X",disabled:i,formatter:It,parser:It}))),l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"y"},l.createElement(se,{className:h,size:"small",placeholder:"Y",prefix:"Y",disabled:i,formatter:It,parser:It})))),l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"w"},l.createElement(se,{className:h,size:"small",placeholder:"Width",prefix:v.w,disabled:i,formatter:It,parser:It}))),l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"h"},l.createElement(se,{className:h,size:"small",placeholder:"Height",prefix:v.h,disabled:i,formatter:It,parser:It}))),l.createElement(Q,{span:4,className:f},l.createElement(J.Item,{className:p,name:["operations","limitRatio"]},l.createElement(B3,{icon:l.createElement(g3,null),size:"small",disabled:i})))),l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"angle"},l.createElement(se,{className:h,size:"small",placeholder:"Angle",prefix:l.createElement(T3,{style:{fontSize:14}}),disabled:i,formatter:Dl,parser:Dl,suffix:"°"})))),(r==null?void 0:r.type)==="group"&&l.createElement(he,{className:u},l.createElement(Q,{span:18,className:f},v.deepResizeInGroup),l.createElement(Q,{span:6,className:f},l.createElement(J.Item,{className:p,name:["operations","deepResize"]},l.createElement(Cd,{size:"small"}))))),[v,i,r])};var Ke={},Ur={},G3=typeof na=="object"&&na&&na.Object===Object&&na,Iu=G3,V3=Iu,U3=typeof self=="object"&&self&&self.Object===Object&&self,Y3=V3||U3||Function("return this")(),pt=Y3,X3=pt,Z3=X3.Symbol,Yr=Z3,jl=Yr,zu=Object.prototype,K3=zu.hasOwnProperty,Q3=zu.toString,yr=jl?jl.toStringTag:void 0;function J3(e){var t=K3.call(e,yr),n=e[yr];try{e[yr]=void 0;var r=!0}catch{}var a=Q3.call(e);return r&&(t?e[yr]=n:delete e[yr]),a}var q3=J3,eg=Object.prototype,tg=eg.toString;function ng(e){return tg.call(e)}var rg=ng,Ll=Yr,ag=q3,ig=rg,og="[object Null]",sg="[object Undefined]",kl=Ll?Ll.toStringTag:void 0;function lg(e){return e==null?e===void 0?sg:og:kl&&kl in Object(e)?ag(e):ig(e)}var an=lg,cg=Array.isArray,lt=cg;function dg(e){return e!=null&&typeof e=="object"}var Mt=dg,ug=an,fg=lt,hg=Mt,pg="[object String]";function gg(e){return typeof e=="string"||!fg(e)&&hg(e)&&ug(e)==pg}var vg=gg;function mg(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++a];if(n(i[c],c,i)===!1)break}return t}}var bg=mg,yg=bg,wg=yg(),xg=wg;function Eg(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Lg}var Jo=kg,Bg=an,Fg=Jo,Hg=Mt,Wg="[object Arguments]",Gg="[object Array]",Vg="[object Boolean]",Ug="[object Date]",Yg="[object Error]",Xg="[object Function]",Zg="[object Map]",Kg="[object Number]",Qg="[object Object]",Jg="[object RegExp]",qg="[object Set]",ev="[object String]",tv="[object WeakMap]",nv="[object ArrayBuffer]",rv="[object DataView]",av="[object Float32Array]",iv="[object Float64Array]",ov="[object Int8Array]",sv="[object Int16Array]",lv="[object Int32Array]",cv="[object Uint8Array]",dv="[object Uint8ClampedArray]",uv="[object Uint16Array]",fv="[object Uint32Array]",xe={};xe[av]=xe[iv]=xe[ov]=xe[sv]=xe[lv]=xe[cv]=xe[dv]=xe[uv]=xe[fv]=!0;xe[Wg]=xe[Gg]=xe[nv]=xe[Vg]=xe[rv]=xe[Ug]=xe[Yg]=xe[Xg]=xe[Zg]=xe[Kg]=xe[Qg]=xe[Jg]=xe[qg]=xe[ev]=xe[tv]=!1;function hv(e){return Hg(e)&&Fg(e.length)&&!!xe[Bg(e)]}var pv=hv;function gv(e){return function(t){return e(t)}}var qo=gv,ri={exports:{}};ri.exports;(function(e,t){var n=Iu,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,s=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(ri,ri.exports);var es=ri.exports,vv=pv,mv=qo,Fl=es,Hl=Fl&&Fl.isTypedArray,bv=Hl?mv(Hl):vv,ju=bv,yv=Sg,wv=Nu,xv=lt,Ev=Qo,Sv=Du,Cv=ju,Mv=Object.prototype,Av=Mv.hasOwnProperty;function _v(e,t){var n=xv(e),r=!n&&wv(e),a=!n&&!r&&Ev(e),i=!n&&!r&&!a&&Cv(e),o=n||r||a||i,s=o?yv(e.length,String):[],c=s.length;for(var d in e)(t||Av.call(e,d))&&!(o&&(d=="length"||a&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Sv(d,c)))&&s.push(d);return s}var Lu=_v,Ov=Object.prototype;function Tv(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ov;return e===n}var ts=Tv;function $v(e,t){return function(n){return e(t(n))}}var ku=$v,Pv=ku,Iv=Pv(Object.keys,Object),zv=Iv,Rv=ts,Nv=zv,Dv=Object.prototype,jv=Dv.hasOwnProperty;function Lv(e){if(!Rv(e))return Nv(e);var t=[];for(var n in Object(e))jv.call(e,n)&&n!="constructor"&&t.push(n);return t}var kv=Lv;function Bv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var er=Bv,Fv=an,Hv=er,Wv="[object AsyncFunction]",Gv="[object Function]",Vv="[object GeneratorFunction]",Uv="[object Proxy]";function Yv(e){if(!Hv(e))return!1;var t=Fv(e);return t==Gv||t==Vv||t==Wv||t==Uv}var Bu=Yv,Xv=Bu,Zv=Jo;function Kv(e){return e!=null&&Zv(e.length)&&!Xv(e)}var bi=Kv,Qv=Lu,Jv=kv,qv=bi;function e6(e){return qv(e)?Qv(e):Jv(e)}var Xr=e6,t6=xg,n6=Xr;function r6(e,t){return e&&t6(e,t,n6)}var Fu=r6;function a6(e){return e}var Hu=a6,i6=Hu;function o6(e){return typeof e=="function"?e:i6}var s6=o6,l6=Fu,c6=s6;function d6(e,t){return e&&l6(e,c6(t))}var ns=d6,u6=ku,f6=u6(Object.getPrototypeOf,Object),rs=f6,h6=an,p6=rs,g6=Mt,v6="[object Object]",m6=Function.prototype,b6=Object.prototype,Wu=m6.toString,y6=b6.hasOwnProperty,w6=Wu.call(Object);function x6(e){if(!g6(e)||h6(e)!=v6)return!1;var t=p6(e);if(t===null)return!0;var n=y6.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Wu.call(n)==w6}var E6=x6;function S6(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n-1}var k6=L6,B6=yi;function F6(e,t){var n=this.__data__,r=B6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var H6=F6,W6=M6,G6=z6,V6=D6,U6=k6,Y6=H6;function tr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&ib?new tb:void 0;for(i.set(e,t),i.set(t,e);++f0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,Z4.default)(t,function(r){Array.isArray(r)?e(r).map(function(a){return n.push(a)}):(0,Y4.default)(r)?(0,V4.default)(r,function(a,i){a===!0&&n.push(i),n.push(i+"-"+a)}):(0,W4.default)(r)&&n.push(r)}),n};Ur.default=K4;var Zr={};function Q4(e,t){for(var n=-1,r=e==null?0:e.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=t.default&&(0,m5.default)(t.default)||{};return n.map(function(a){var i=t[a];return i&&(0,g5.default)(i,function(o,s){r[s]||(r[s]={}),r[s]=b5({},r[s],i[s])}),a}),r};Zr.default=y5;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.autoprefix=void 0;var w5=ns,Ec=E5(w5),x5=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){T5(a,r);function a(){var i,o,s,c;O5(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){N5(a,r);function a(){var i,o,s,c;R5(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:!0;r[o]=s};return t===0&&a("first-child"),t===n-1&&a("last-child"),(t===0||t%2===0)&&a("even"),Math.abs(t%2)===1&&a("odd"),a("nth-child",t),r};ps.default=j5;Object.defineProperty(Ke,"__esModule",{value:!0});Ke.ReactCSS=Ke.loop=Ke.handleActive=gs=Ke.handleHover=Ke.hover=void 0;var L5=Ur,k5=or(L5),B5=Zr,F5=or(B5),H5=Kr,W5=or(H5),G5=Qr,p0=or(G5),V5=Jr,U5=or(V5),Y5=ps,X5=or(Y5);function or(e){return e&&e.__esModule?e:{default:e}}Ke.hover=p0.default;var gs=Ke.handleHover=p0.default;Ke.handleActive=U5.default;Ke.loop=X5.default;var Z5=Ke.ReactCSS=function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;as?h=1:h=Math.round(f*100/s)/100,n.a!==h)return{h:n.h,s:n.s,l:n.l,a:h,source:"rgb"}}else{var p=void 0;if(u<0?p=0:u>o?p=1:p=Math.round(u*100/o)/100,a!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}return null},no={},Q5=function(t,n,r,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=t,o.fillRect(0,0,i.width,i.height),o.fillStyle=n,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},J5=function(t,n,r,a){var i=t+"-"+n+"-"+r+(a?"-server":"");if(no[i])return no[i];var o=Q5(t,n,r,a);return no[i]=o,o},Mc=Object.assign||function(e){for(var t=1;t-1},fE=function(t){return Number(String(t).replace(/%/g,""))},hE=1,oe=function(e){sE(t,e);function t(n){iE(this,t);var r=oE(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(a){r.setUpdatedValue(a.target.value,a)},r.handleKeyDown=function(a){var i=fE(a.target.value);if(!isNaN(i)&&uE(a.keyCode)){var o=r.getArrowOffset(),s=a.keyCode===g0?i+o:i-o;r.setUpdatedValue(s,a)}},r.handleDrag=function(a){if(r.props.dragLabel){var i=Math.round(r.props.value+a.movementX);i>=0&&i<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(i),a)}},r.handleMouseDown=function(a){r.props.dragLabel&&(a.preventDefault(),r.handleDrag(a),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+hE++,r}return rE(t,[{key:"componentDidUpdate",value:function(r,a){this.props.value!==this.state.value&&(r.value!==this.props.value||a.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return aE({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||lE}},{key:"setUpdatedValue",value:function(r,a){var i=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(i,a),this.setState({value:r})}},{key:"render",value:function(){var r=this,a=ie({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return l.createElement("div",{style:a.wrap},l.createElement("input",{id:this.inputId,style:a.input,ref:function(o){return r.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?l.createElement("label",{htmlFor:this.inputId,style:a.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(M.PureComponent||M.Component),pE=function(t,n,r,a){var i=a.clientWidth,o=a.clientHeight,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(a.getBoundingClientRect().left+window.pageXOffset),u=c-(a.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var f=void 0;if(u<0)f=359;else if(u>o)f=0;else{var h=-(u*100/o)+100;f=360*h/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var p=void 0;if(d<0)p=0;else if(d>i)p=359;else{var v=d*100/i;p=360*v/100}if(r.h!==p)return{h:p,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},gE=function(){function e(t,n){for(var r=0;r1?An("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):An("Invalid argument supplied to oneOf, expected an array."),pa;function T(P,k,N,D,x){for(var z=P[k],X=0;X<_.length;X++)if(s(z,_[X]))return null;var A=JSON.stringify(_,function(G,O){var $=F(O);return $==="symbol"?String(O):O});return new c("Invalid "+D+" `"+x+"` of value `"+String(z)+"` "+("supplied to `"+N+"`, expected one of "+A+"."))}return d(T)}function b(_){function T(P,k,N,D,x){if(typeof _!="function")return new c("Property `"+x+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var z=P[k],X=B(z);if(X!=="object")return new c("Invalid "+D+" `"+x+"` of type "+("`"+X+"` supplied to `"+N+"`, expected an object."));for(var A in z)if(ro(z,A)){var U=_(z,A,N,D,x+"."+A,pn);if(U instanceof Error)return U}return null}return d(T)}function y(_){if(!Array.isArray(_))return An("Invalid argument supplied to oneOfType, expected an instance of array."),pa;for(var T=0;T<_.length;T++){var P=_[T];if(typeof P!="function")return An("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+V(P)+" at index "+T+"."),pa}function k(N,D,x,z,X){for(var A=[],U=0;U<_.length;U++){var G=_[U],O=G(N,D,x,z,X,pn);if(O==null)return null;O.data&&ro(O.data,"expectedType")&&A.push(O.data.expectedType)}var $=A.length>0?", expected one of type ["+A.join(", ")+"]":"";return new c("Invalid "+z+" `"+X+"` supplied to "+("`"+x+"`"+$+"."))}return d(k)}function E(){function _(T,P,k,N,D){return j(T[P])?null:new c("Invalid "+N+" `"+D+"` supplied to "+("`"+k+"`, expected a ReactNode."))}return d(_)}function w(_,T,P,k,N){return new c((_||"React class")+": "+T+" type `"+P+"."+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function S(_){function T(P,k,N,D,x){var z=P[k],X=B(z);if(X!=="object")return new c("Invalid "+D+" `"+x+"` of type `"+X+"` "+("supplied to `"+N+"`, expected `object`."));for(var A in _){var U=_[A];if(typeof U!="function")return w(N,D,x,A,F(U));var G=U(z,A,N,D,x+"."+A,pn);if(G)return G}return null}return d(T)}function C(_){function T(P,k,N,D,x){var z=P[k],X=B(z);if(X!=="object")return new c("Invalid "+D+" `"+x+"` of type `"+X+"` "+("supplied to `"+N+"`, expected `object`."));var A=OE({},P[k],_);for(var U in A){var G=_[U];if(ro(_,U)&&typeof G!="function")return w(N,D,x,U,F(G));if(!G)return new c("Invalid "+D+" `"+x+"` key `"+U+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(P[k],null," ")+` -Valid keys: `+JSON.stringify(Object.keys(_),null," "));var O=G(z,U,N,D,x+"."+U,pn);if(O)return O}return null}return d(T)}function j(_){switch(typeof _){case"number":case"string":case"undefined":return!0;case"boolean":return!_;case"object":if(Array.isArray(_))return _.every(j);if(_===null||e(_))return!0;var T=a(_);if(T){var P=T.call(_),k;if(T!==_.entries){for(;!(k=P.next()).done;)if(!j(k.value))return!1}else for(;!(k=P.next()).done;){var N=k.value;if(N&&!j(N[1]))return!1}}else return!1;return!0;default:return!1}}function R(_,T){return _==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function B(_){var T=typeof _;return Array.isArray(_)?"array":_ instanceof RegExp?"object":R(T,_)?"symbol":T}function F(_){if(typeof _>"u"||_===null)return""+_;var T=B(_);if(T==="object"){if(_ instanceof Date)return"date";if(_ instanceof RegExp)return"regexp"}return T}function V(_){var T=F(_);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function L(_){return!_.constructor||!_.constructor.name?i:_.constructor.name}return o.checkPropTypes=Tc,o.resetWarningCache=Tc.resetWarningCache,o.PropTypes=o,o};{var $E=b0,PE=!0;v0.exports=TE($E.isElement,PE)}var IE=v0.exports;const Y=of(IE);function zE(){this.__data__=[],this.size=0}function qr(e,t){return e===t||e!==e&&t!==t}function _i(e,t){for(var n=e.length;n--;)if(qr(e[n][0],t))return n;return-1}var RE=Array.prototype,NE=RE.splice;function DE(e){var t=this.__data__,n=_i(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():NE.call(t,n,1),--this.size,!0}function jE(e){var t=this.__data__,n=_i(t,e);return n<0?void 0:t[n][1]}function LE(e){return _i(this.__data__,e)>-1}function kE(e,t){var n=this.__data__,r=_i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function At(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=XS}function cr(e){return e!=null&&ws(e.length)&&!ms(e)}function ZS(e){return Bt(e)&&cr(e)}function KS(){return!1}var T0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jc=T0&&typeof module=="object"&&module&&!module.nodeType&&module,QS=jc&&jc.exports===T0,Lc=QS?ct.Buffer:void 0,JS=Lc?Lc.isBuffer:void 0,ci=JS||KS,qS="[object Object]",e7=Function.prototype,t7=Object.prototype,$0=e7.toString,n7=t7.hasOwnProperty,r7=$0.call(Object);function a7(e){if(!Bt(e)||sn(e)!=qS)return!1;var t=_0(e);if(t===null)return!0;var n=n7.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&$0.call(n)==r7}var i7="[object Arguments]",o7="[object Array]",s7="[object Boolean]",l7="[object Date]",c7="[object Error]",d7="[object Function]",u7="[object Map]",f7="[object Number]",h7="[object Object]",p7="[object RegExp]",g7="[object Set]",v7="[object String]",m7="[object WeakMap]",b7="[object ArrayBuffer]",y7="[object DataView]",w7="[object Float32Array]",x7="[object Float64Array]",E7="[object Int8Array]",S7="[object Int16Array]",C7="[object Int32Array]",M7="[object Uint8Array]",A7="[object Uint8ClampedArray]",_7="[object Uint16Array]",O7="[object Uint32Array]",Ee={};Ee[w7]=Ee[x7]=Ee[E7]=Ee[S7]=Ee[C7]=Ee[M7]=Ee[A7]=Ee[_7]=Ee[O7]=!0;Ee[i7]=Ee[o7]=Ee[b7]=Ee[s7]=Ee[y7]=Ee[l7]=Ee[c7]=Ee[d7]=Ee[u7]=Ee[f7]=Ee[h7]=Ee[p7]=Ee[g7]=Ee[v7]=Ee[m7]=!1;function T7(e){return Bt(e)&&ws(e.length)&&!!Ee[sn(e)]}function $7(e){return function(t){return e(t)}}var P0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kr=P0&&typeof module=="object"&&module&&!module.nodeType&&module,P7=kr&&kr.exports===P0,io=P7&&E0.process,kc=function(){try{var e=kr&&kr.require&&kr.require("util").types;return e||io&&io.binding&&io.binding("util")}catch{}}(),Bc=kc&&kc.isTypedArray,xs=Bc?$7(Bc):T7;function Bo(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var I7=Object.prototype,z7=I7.hasOwnProperty;function R7(e,t,n){var r=e[t];(!(z7.call(e,t)&&qr(r,n))||n===void 0&&!(t in e))&&bs(e,t,n)}function N7(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i-1&&e%1==0&&e0){if(++t>=J7)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var nC=tC(Q7);function rC(e,t){return nC(X7(e,t,Ti),e+"")}function aC(e,t,n){if(!Je(n))return!1;var r=typeof t;return(r=="number"?cr(n)&&Es(t,n.length):r=="string"&&t in n)?qr(n[t],e):!1}function iC(e){return rC(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&aC(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r=t||j<0||f&&R>=i}function b(){var C=oo();if(m(C))return y(C);s=setTimeout(b,g(C))}function y(C){return s=void 0,h&&r?p(C):(r=a=void 0,o)}function E(){s!==void 0&&clearTimeout(s),d=0,r=c=a=s=void 0}function w(){return s===void 0?o:y(oo())}function S(){var C=oo(),j=m(C);if(r=arguments,a=this,c=C,j){if(s===void 0)return v(c);if(f)return clearTimeout(s),s=setTimeout(b,t),p(c)}return s===void 0&&(s=setTimeout(b,t)),o}return S.cancel=E,S.flush=w,S}var bC="Expected a function";function yC(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(bC);return Je(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),N0(e,t,{leading:r,maxWait:t,trailing:a})}var wC=function(t,n,r){var a=r.getBoundingClientRect(),i=a.width,o=a.height,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(r.getBoundingClientRect().left+window.pageXOffset),u=c-(r.getBoundingClientRect().top+window.pageYOffset);d<0?d=0:d>i&&(d=i),u<0?u=0:u>o&&(u=o);var f=d/i,h=1-u/o;return{h:n.h,s:f,v:h,a:n.a,source:"hsv"}},xC=function(){function e(t,n){for(var r=0;r=0,i=!n&&a&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(VC,arguments)},brighten:function(){return this._applyModification(UC,arguments)},darken:function(){return this._applyModification(YC,arguments)},desaturate:function(){return this._applyModification(HC,arguments)},saturate:function(){return this._applyModification(WC,arguments)},greyscale:function(){return this._applyModification(GC,arguments)},spin:function(){return this._applyModification(XC,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(QC,arguments)},complement:function(){return this._applyCombination(ZC,arguments)},monochromatic:function(){return this._applyCombination(JC,arguments)},splitcomplement:function(){return this._applyCombination(KC,arguments)},triad:function(){return this._applyCombination(Xc,[3])},tetrad:function(){return this._applyCombination(Xc,[4])}};q.fromRatio=function(e,t){if(di(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=Pr(e[r]));e=n}return q(e,t)};function jC(e){var t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,s=!1;return typeof e=="string"&&(e=rM(e)),di(e)=="object"&&(vt(e.r)&&vt(e.g)&&vt(e.b)?(t=LC(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):vt(e.h)&&vt(e.s)&&vt(e.v)?(r=Pr(e.s),a=Pr(e.v),t=BC(e.h,r,a),o=!0,s="hsv"):vt(e.h)&&vt(e.s)&&vt(e.l)&&(r=Pr(e.s),i=Pr(e.l),t=kC(e.h,r,i),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=j0(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function LC(e,t,n){return{r:Ce(e,255)*255,g:Ce(t,255)*255,b:Ce(n,255)*255}}function Gc(e,t,n){e=Ce(e,255),t=Ce(t,255),n=Ce(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=(r+a)/2;if(r==a)i=o=0;else{var c=r-a;switch(o=s>.5?c/(2-r-a):c/(r+a),r){case e:i=(t-n)/c+(t1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(t===0)r=a=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),a=o(c,s,e),i=o(c,s,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function Vc(e,t,n){e=Ce(e,255),t=Ce(t,255),n=Ce(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=r,c=r-a;if(o=r===0?0:c/r,r==a)i=0;else{switch(r){case e:i=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(q(r));return i}function JC(e,t){t=t||6;for(var n=q(e).toHsv(),r=n.h,a=n.s,i=n.v,o=[],s=1/t;t--;)o.push(q({h:r,s:a,v:i})),i=(i+s)%1;return o}q.mix=function(e,t,n){n=n===0?0:n||50;var r=q(e).toRgb(),a=q(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return q(o)};q.readability=function(e,t){var n=q(e),r=q(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};q.isReadable=function(e,t,n){var r=q.readability(e,t),a,i;switch(i=!1,a=aM(n),a.level+a.size){case"AAsmall":case"AAAlarge":i=r>=4.5;break;case"AAlarge":i=r>=3;break;case"AAAsmall":i=r>=7;break}return i};q.mostReadable=function(e,t,n){var r=null,a=0,i,o,s,c;n=n||{},o=n.includeFallbackColors,s=n.level,c=n.size;for(var d=0;da&&(a=i,r=q(t[d]));return q.isReadable(e,r,{level:s,size:c})||!o?r:(n.includeFallbackColors=!1,q.mostReadable(e,["#fff","#000"],n))};var Fo=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},qC=q.hexNames=eM(Fo);function eM(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function j0(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ce(e,t){tM(e)&&(e="100%");var n=nM(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Ii(e){return Math.min(1,Math.max(0,e))}function Fe(e){return parseInt(e,16)}function tM(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function nM(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ot(e){return e.length==1?"0"+e:""+e}function Pr(e){return e<=1&&(e=e*100+"%"),e}function L0(e){return Math.round(parseFloat(e)*255).toString(16)}function Zc(e){return Fe(e)/255}var rt=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function vt(e){return!!rt.CSS_UNIT.exec(e)}function rM(e){e=e.replace(NC,"").replace(DC,"").toLowerCase();var t=!1;if(Fo[e])e=Fo[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=rt.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=rt.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=rt.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=rt.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=rt.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=rt.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=rt.hex8.exec(e))?{r:Fe(n[1]),g:Fe(n[2]),b:Fe(n[3]),a:Zc(n[4]),format:t?"name":"hex8"}:(n=rt.hex6.exec(e))?{r:Fe(n[1]),g:Fe(n[2]),b:Fe(n[3]),format:t?"name":"hex"}:(n=rt.hex4.exec(e))?{r:Fe(n[1]+""+n[1]),g:Fe(n[2]+""+n[2]),b:Fe(n[3]+""+n[3]),a:Zc(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=rt.hex3.exec(e))?{r:Fe(n[1]+""+n[1]),g:Fe(n[2]+""+n[2]),b:Fe(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function aM(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}var Kc=function(t){var n=["r","g","b","a","h","s","l","v"],r=0,a=0;return RC(n,function(i){if(t[i]&&(r+=1,isNaN(t[i])||(a+=1),i==="s"||i==="l")){var o=/^\d+%$/;o.test(t[i])&&(a+=1)}}),r===a?t:!1},Ir=function(t,n){var r=t.hex?q(t.hex):q(t),a=r.toHsl(),i=r.toHsv(),o=r.toRgb(),s=r.toHex();a.s===0&&(a.h=n||0,i.h=n||0);var c=s==="000000"&&o.a===0;return{hsl:a,hex:c?"transparent":"#"+s,rgb:o,hsv:i,oldHue:t.h||n||a.h,source:t.source}},Ht=function(t){if(t==="transparent")return!0;var n=String(t).charAt(0)==="#"?1:0;return t.length!==4+n&&t.length<7+n&&q(t).isValid()},Cs=function(t){if(!t)return"#fff";var n=Ir(t);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},so=function(t,n){var r=t.replace("°","");return q(n+" ("+r+")")._ok},xr=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){fM(a,r);function a(){var i,o,s,c;uM(this,a);for(var d=arguments.length,u=Array(d),f=0;fs))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&CM?new ui:void 0;for(i.set(e,t),i.set(t,e);++f=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var va=24,FA=X0.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?va:r,i=e.height,o=i===void 0?va:i,s=e.style,c=s===void 0?{}:s,d=BA(e,["fill","width","height","style"]);return gd.default.createElement("svg",pd({viewBox:"0 0 "+va+" "+va,style:pd({fill:n,width:a,height:o},c)},d),gd.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},HA=function(){function e(t,n){for(var r=0;r1&&(a.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(a.a*100)/100,source:"rgb"},i)):(a.h||a.s||a.l)&&(typeof a.s=="string"&&a.s.includes("%")&&(a.s=a.s.replace("%","")),typeof a.l=="string"&&a.l.includes("%")&&(a.l=a.l.replace("%","")),a.s==1?a.s=.01:a.l==1&&(a.l=.01),r.props.onChange({h:a.h||r.props.hsl.h,s:Number(hd(a.s)?r.props.hsl.s:a.s),l:Number(hd(a.l)?r.props.hsl.l:a.l),source:"hsl"},i))},r.showHighlight=function(a){a.currentTarget.style.background="#eee"},r.hideHighlight=function(a){a.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return HA(t,[{key:"render",value:function(){var r=this,a=ie({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(oe,{style:{input:a.input,label:a.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(oe,{style:{input:a.input,label:a.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),l.createElement("div",{style:a.wrap,className:"flexbox-fix"},i,l.createElement("div",{style:a.toggle},l.createElement("div",{style:a.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},l.createElement(FA,{style:a.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.hsl.a!==1&&a.view==="hex"?{view:"rgb"}:null}}]),t}(l.Component);Z0.defaultProps={view:"hex"};var vd=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return l.createElement("div",{style:t.picker})},UA=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return l.createElement("div",{style:t.picker})},$s=function(t){var n=t.width,r=t.onChange,a=t.disableAlpha,i=t.rgb,o=t.hsl,s=t.hsv,c=t.hex,d=t.renderers,u=t.styles,f=u===void 0?{}:u,h=t.className,p=h===void 0?"":h,v=t.defaultView,g=ie(Le({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},f),{disableAlpha:a});return l.createElement("div",{style:g.picker,className:"chrome-picker "+p},l.createElement("div",{style:g.saturation},l.createElement(Pi,{style:g.Saturation,hsl:o,hsv:s,pointer:UA,onChange:r})),l.createElement("div",{style:g.body},l.createElement("div",{style:g.controls,className:"flexbox-fix"},l.createElement("div",{style:g.color},l.createElement("div",{style:g.swatch},l.createElement("div",{style:g.active}),l.createElement(sr,{renderers:d}))),l.createElement("div",{style:g.toggles},l.createElement("div",{style:g.hue},l.createElement(lr,{style:g.Hue,hsl:o,pointer:vd,onChange:r})),l.createElement("div",{style:g.alpha},l.createElement(vs,{style:g.Alpha,rgb:i,hsl:o,pointer:vd,renderers:d,onChange:r})))),l.createElement(Z0,{rgb:i,hsl:o,hex:c,view:v,onChange:r,disableAlpha:a})))};$s.propTypes={width:Y.oneOfType([Y.string,Y.number]),disableAlpha:Y.bool,styles:Y.object,defaultView:Y.oneOf(["hex","rgb","hsl"])};$s.defaultProps={width:225,disableAlpha:!1,styles:{}};const YA=ke($s);var XA=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.active,s=ie({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:Cs(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:o,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(dn,{style:s.color,color:n,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:s.dot}))},ZA=function(t){var n=t.hex,r=t.rgb,a=t.onChange,i=ie({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),o=function(c,d){c.r||c.g||c.b?a({r:c.r||r.r,g:c.g||r.g,b:c.b||r.b,source:"rgb"},d):a({hex:c.hex,source:"hex"},d)};return l.createElement("div",{style:i.fields,className:"flexbox-fix"},l.createElement("div",{style:i.active}),l.createElement(oe,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:o}))},Ps=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.colors,i=t.hex,o=t.rgb,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(Le({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},c)),h=function(v,g){v.hex?Ht(v.hex)&&n({hex:v.hex,source:"hex"},g):n(v,g)};return l.createElement(ea,{style:f.Compact,styles:c},l.createElement("div",{style:f.compact,className:"compact-picker "+u},l.createElement("div",null,un(a,function(p){return l.createElement(XA,{key:p,color:p,active:p.toLowerCase()===i,onClick:h,onSwatchHover:r})}),l.createElement("div",{style:f.clear})),l.createElement(ZA,{hex:i,rgb:o,onChange:h})))};Ps.propTypes={colors:Y.arrayOf(Y.string),styles:Y.object};Ps.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};ke(Ps);var KA=function(t){var n=t.hover,r=t.color,a=t.onClick,i=t.onSwatchHover,o={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=ie({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:o}},{hover:n});return l.createElement("div",{style:s.swatch},l.createElement(dn,{color:r,onClick:a,onHover:i,focusStyle:o}))};const QA=gs(KA);var Is=function(t){var n=t.width,r=t.colors,a=t.onChange,i=t.onSwatchHover,o=t.triangle,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(Le({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},c),{"hide-triangle":o==="hide","top-left-triangle":o==="top-left","top-right-triangle":o==="top-right","bottom-left-triangle":o==="bottom-left","bottom-right-triangle":o==="bottom-right"}),h=function(v,g){return a({hex:v,source:"hex"},g)};return l.createElement("div",{style:f.card,className:"github-picker "+u},l.createElement("div",{style:f.triangleShadow}),l.createElement("div",{style:f.triangle}),un(r,function(p){return l.createElement(QA,{color:p,key:p,onClick:h,onSwatchHover:i})}))};Is.propTypes={width:Y.oneOfType([Y.string,Y.number]),colors:Y.arrayOf(Y.string),triangle:Y.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:Y.object};Is.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};ke(Is);var JA=function(t){var n=t.direction,r=ie({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return l.createElement("div",{style:r.picker})},qA=Object.assign||function(e){for(var t=1;t.5});return l.createElement("div",{style:r.picker})},r_=function(){var t=ie({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return l.createElement("div",{style:t.pointer},l.createElement("div",{style:t.left},l.createElement("div",{style:t.leftInside})),l.createElement("div",{style:t.right},l.createElement("div",{style:t.rightInside})))},md=function(t){var n=t.onClick,r=t.label,a=t.children,i=t.active,o=ie({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return l.createElement("div",{style:o.button,onClick:n},r||a)},a_=function(t){var n=t.rgb,r=t.currentColor,a=ie({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return l.createElement("div",null,l.createElement("div",{style:a.label},"new"),l.createElement("div",{style:a.swatches},l.createElement("div",{style:a.new}),l.createElement("div",{style:a.current})),l.createElement("div",{style:a.label},"current"))},i_=function(){function e(t,n){for(var r=0;r100&&(u.a=100),u.a/=100,n({h:a.h,s:a.s,l:a.l,a:u.a,source:"rgb"},f))};return l.createElement("div",{style:s.fields,className:"flexbox-fix"},l.createElement("div",{style:s.double},l.createElement(oe,{style:{input:s.input,label:s.label},label:"hex",value:i.replace("#",""),onChange:c})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.alpha},l.createElement(oe,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:c,dragLabel:"true",dragMax:"100"})))},d_=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var ma=24,m_=Q0.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?ma:r,i=e.height,o=i===void 0?ma:i,s=e.style,c=s===void 0?{}:s,d=v_(e,["fill","width","height","style"]);return yd.default.createElement("svg",bd({viewBox:"0 0 "+ma+" "+ma,style:bd({fill:n,width:a,height:o},c)},d),yd.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},b_=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.first,s=t.last,c=t.active,d=ie({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:Cs(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:o,last:s,active:c,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(dn,{color:n,style:d.color,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:d.check},l.createElement(m_,null)))},y_=function(t){var n=t.onClick,r=t.onSwatchHover,a=t.group,i=t.active,o=ie({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return l.createElement("div",{style:o.group},un(a,function(s,c){return l.createElement(b_,{key:s,color:s,active:s.toLowerCase()===i,first:c===0,last:c===a.length-1,onClick:n,onSwatchHover:r})}))},js=function(t){var n=t.width,r=t.height,a=t.onChange,i=t.onSwatchHover,o=t.colors,s=t.hex,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(Le({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},d)),p=function(g,m){return a({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.picker,className:"swatches-picker "+f},l.createElement(ea,null,l.createElement("div",{style:h.overflow},l.createElement("div",{style:h.body},un(o,function(v){return l.createElement(y_,{key:v.toString(),group:v,active:s,onClick:p,onSwatchHover:i})}),l.createElement("div",{style:h.clear})))))};js.propTypes={width:Y.oneOfType([Y.string,Y.number]),height:Y.oneOfType([Y.string,Y.number]),colors:Y.arrayOf(Y.arrayOf(Y.string)),styles:Y.object};js.defaultProps={width:320,height:240,colors:[[_n[900],_n[700],_n[500],_n[300],_n[100]],[On[900],On[700],On[500],On[300],On[100]],[Tn[900],Tn[700],Tn[500],Tn[300],Tn[100]],[$n[900],$n[700],$n[500],$n[300],$n[100]],[Pn[900],Pn[700],Pn[500],Pn[300],Pn[100]],[In[900],In[700],In[500],In[300],In[100]],[zn[900],zn[700],zn[500],zn[300],zn[100]],[Rn[900],Rn[700],Rn[500],Rn[300],Rn[100]],[Nn[900],Nn[700],Nn[500],Nn[300],Nn[100]],["#194D33",zr[700],zr[500],zr[300],zr[100]],[Dn[900],Dn[700],Dn[500],Dn[300],Dn[100]],[jn[900],jn[700],jn[500],jn[300],jn[100]],[Ln[900],Ln[700],Ln[500],Ln[300],Ln[100]],[kn[900],kn[700],kn[500],kn[300],kn[100]],[Bn[900],Bn[700],Bn[500],Bn[300],Bn[100]],[Fn[900],Fn[700],Fn[500],Fn[300],Fn[100]],[Hn[900],Hn[700],Hn[500],Hn[300],Hn[100]],[Wn[900],Wn[700],Wn[500],Wn[300],Wn[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};ke(js);var Ls=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.hex,i=t.colors,o=t.width,s=t.triangle,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(Le({default:{card:{width:o,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},d),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),p=function(g,m){Ht(g)&&n({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.card,className:"twitter-picker "+f},l.createElement("div",{style:h.triangleShadow}),l.createElement("div",{style:h.triangle}),l.createElement("div",{style:h.body},un(i,function(v,g){return l.createElement(dn,{key:g,color:v,hex:v,style:h.swatch,onClick:p,onHover:r,focusStyle:{boxShadow:"0 0 4px "+v}})}),l.createElement("div",{style:h.hash},"#"),l.createElement(oe,{label:null,style:{input:h.input},value:a.replace("#",""),onChange:p}),l.createElement("div",{style:h.clear})))};Ls.propTypes={width:Y.oneOfType([Y.string,Y.number]),triangle:Y.oneOf(["hide","top-left","top-right"]),colors:Y.arrayOf(Y.string),styles:Y.object};Ls.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};ke(Ls);var ks=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(t.hsl.h)+", "+Math.round(t.hsl.s*100)+"%, "+Math.round(t.hsl.l*100)+"%)"}}});return l.createElement("div",{style:n.picker})};ks.propTypes={hsl:Y.shape({h:Y.number,s:Y.number,l:Y.number,a:Y.number})};ks.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Bs=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(t.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return l.createElement("div",{style:n.picker})};Bs.propTypes={hsl:Y.shape({h:Y.number,s:Y.number,l:Y.number,a:Y.number})};Bs.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var w_=function(t){var n=t.onChange,r=t.rgb,a=t.hsl,i=t.hex,o=t.hsv,s=function(p,v){if(p.hex)Ht(p.hex)&&n({hex:p.hex,source:"hex"},v);else if(p.rgb){var g=p.rgb.split(",");so(p.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},v)}else if(p.hsv){var m=p.hsv.split(",");so(p.hsv,"hsv")&&(m[2]=m[2].replace("%",""),m[1]=m[1].replace("%",""),m[0]=m[0].replace("°",""),m[1]==1?m[1]=.01:m[2]==1&&(m[2]=.01),n({h:Number(m[0]),s:Number(m[1]),v:Number(m[2]),source:"hsv"},v))}else if(p.hsl){var b=p.hsl.split(",");so(p.hsl,"hsl")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),f[1]==1?f[1]=.01:f[2]==1&&(f[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},v))}},c=ie({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),d=r.r+", "+r.g+", "+r.b,u=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.l*100)+"%",f=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.v*100)+"%";return l.createElement("div",{style:c.wrap,className:"flexbox-fix"},l.createElement("div",{style:c.fields},l.createElement("div",{style:c.double},l.createElement(oe,{style:{input:c.input,label:c.label},label:"hex",value:i,onChange:s})),l.createElement("div",{style:c.column},l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"rgb",value:d,onChange:s})),l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"hsv",value:f,onChange:s})),l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"hsl",value:u,onChange:s})))))},Fs=function(t){var n=t.width,r=t.onChange,a=t.rgb,i=t.hsl,o=t.hsv,s=t.hex,c=t.header,d=t.styles,u=d===void 0?{}:d,f=t.className,h=f===void 0?"":f,p=ie(Le({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+a.r+", "+a.g+", "+a.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return l.createElement("div",{style:p.picker,className:"google-picker "+h},l.createElement("div",{style:p.head},c),l.createElement("div",{style:p.swatch}),l.createElement("div",{style:p.saturation},l.createElement(Pi,{hsl:i,hsv:o,pointer:ks,onChange:r})),l.createElement("div",{style:p.body},l.createElement("div",{style:p.controls,className:"flexbox-fix"},l.createElement("div",{style:p.hue},l.createElement(lr,{style:p.Hue,hsl:i,radius:"4px",pointer:Bs,onChange:r}))),l.createElement(w_,{rgb:a,hsl:i,hex:s,hsv:o,onChange:r})))};Fs.propTypes={width:Y.oneOfType([Y.string,Y.number]),styles:Y.object,header:Y.string};Fs.defaultProps={width:652,styles:{},header:"Color picker"};ke(Fs);function x_(e){let t=e.toLocaleUpperCase();const n={r:0,g:0,b:0,a:1};return/^\#[0-9a-f]{3,3}$/i.test(t)?t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}FF`:/^\#[0-9a-f]{6,6}$/i.test(t)&&(t=`${t}FF`),/^\#[0-9a-f]{8,8}$/i.test(t)&&(n.r=parseInt(`${t[1]}${t[2]}`,16),n.g=parseInt(`${t[3]}${t[4]}`,16),n.b=parseInt(`${t[5]}${t[6]}`,16),n.a=parseInt(`${t[7]}${t[8]}`,16)/255),n}function E_(e){const t=[];return t.push(e.r.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.g.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.b.toString(16).padStart(2,"0").toLocaleUpperCase()),e.a<1&&t.push(Math.floor(e.a*255).toString(16).padStart(2,"0").toLocaleUpperCase()),`#${t.join("")}`}const S_=({value:e="",onChange:t,className:n})=>l.createElement(YA,{className:n,color:x_(e),onChangeComplete:r=>{const a=E_(r==null?void 0:r.rgb);t==null||t(a)}}),J0="base-element-field-multiple-color-picker",q0=16,wd=e=>{var t,n;const r=(t=e.currentTarget.parentElement)===null||t===void 0?void 0:t.getBoundingClientRect(),a=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.x-q0/2;let o=parseFloat((n=i/a.width)===null||n===void 0?void 0:n.toFixed(2));return o=Math.min(Math.max(o,0),1),o};function C_(e){const{mode:t,value:n,internalColor:r,internalLinearGradient:a,internalRadialGradient:i,currentPickedColor:o,onChange:s,onSelectStop:c}=e,[d,u]=M.useState(Xa(n)),[f,h]=M.useState(null),p=M.useRef(!1),{createPrefixName:v}=M.useContext(le),g=v(J0),m=g("gradient-root"),b=g("gradient-delete"),y=g("gradient"),E=g("gradient-bar"),w=g("gradient-point"),S=g("gradient-point-active");M.useEffect(()=>{var L;const _=Xa(n);u(_),["linear-gradient","radial-gradient"].includes(n==null?void 0:n.type)&&(f||h((L=n==null?void 0:n.stops)===null||L===void 0?void 0:L[0]))},[n]),M.useEffect(()=>{f?c==null||c(Object.assign({},f)):c==null||c(f)},[f]);const C=L=>{L.stopPropagation(),p.current=!0;const _=wd(L);let T=null;if(t==="linear-gradient"?T=a:t==="radial-gradient"&&(T=i),T){const P=[...T.stops];for(let N=0;ND.offset&&!x){P.push(z),h(z);break}if(!x)break}const k=Object.assign(Object.assign({},T),{stops:P});s==null||s(k)}},j=L=>{if(p.current===!0&&f){const _=wd(L);let T=null;if(t==="linear-gradient"?T=a:t==="radial-gradient"&&(T=i),T){const P=[...T.stops];for(let D=0;DD.offset-x.offset),N=Object.assign(Object.assign({},T),{stops:k});s==null||s(N)}}},R=L=>{L.stopPropagation(),p.current=!1},B=(L,_)=>{L.stopPropagation(),h(_),p.current=!0},F=()=>{let L=null;t==="linear-gradient"?L=a:t==="radial-gradient"&&(L=i);let _=-1;if(L&&f){const T=[...L.stops];for(let P=0;P=0){T.splice(_,1);const P=Object.assign(Object.assign({},L),{stops:T});s==null||s(P)}}},V=L=>{p.current=!1};return M.useMemo(()=>{var L,_,T;return l.createElement(l.Fragment,null,(t==="linear-gradient"||t==="radial-gradient")&&l.createElement("div",{className:m},l.createElement("div",{className:y,"data-css":d,style:{background:d}},l.createElement("div",{className:E,onMouseDown:C,onMouseUp:R,onMouseMove:j,onMouseLeave:R},(T=(_=(L=t==="linear-gradient"?a:i)===null||L===void 0?void 0:L.stops)===null||_===void 0?void 0:_.map)===null||T===void 0?void 0:T.call(_,(P,k)=>l.createElement("span",{key:k,className:pe({[w]:!0,[S]:(f==null?void 0:f.offset)===P.offset}),style:{left:`calc(${P.offset*100}% - ${q0/2}px)`,background:P.color},onMouseDown:N=>{B(N,P)},onMouseUp:V})))),l.createElement("div",{className:b,onClick:P=>{P.stopPropagation(),F()}},l.createElement(w3,null))))},[t,d,o,r,a,i,f])}function xd(e){let t="solid";return e&&(e!=null&&e.type)&&(t=e.type),t}function M_(e){const{value:t,onChange:n,elementSize:r,disabledLinearGradient:a,disabledRadialGradient:i}=e,[o,s]=M.useState(Xa(t)),[c,d]=M.useState(xd(t)),[u,f]=M.useState("#000000"),[h,p]=M.useState(null),[v,g]=M.useState(null),[m,b]=M.useState(null),y=M.useRef(null),E=M.useRef(null),w=M.useRef(null),{createPrefixName:S}=M.useContext(le),C=S(J0),j=C(),R=C("header"),B=C("internal-picker"),F=C("radio-group"),V=C("row"),L=C("col"),_=C("input"),T=C("form-item");M.useEffect(()=>{s(Xa(t)),d(xd(t)),typeof t=="string"?(p(t),f(t)):(t==null?void 0:t.type)==="linear-gradient"?g(t):(t==null?void 0:t.type)==="radial-gradient"&&b(t)},[t]),M.useEffect(()=>{var x,z;c==="linear-gradient"&&(t==null?void 0:t.type)===c?(x=E.current)===null||x===void 0||x.setFieldsValue(t):c==="radial-gradient"&&(t==null?void 0:t.type)===c&&((z=w.current)===null||z===void 0||z.setFieldsValue(t))},[c,t]);const P=x=>{var z,X,A,U,G,O;let $;x==="linear-gradient"?($={type:"linear-gradient",start:{x:0,y:0},end:{x:0,y:(r==null?void 0:r.h)||0},stops:[]},typeof t=="string"?($.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],g($)):(t==null?void 0:t.type)==="radial-gradient"&&($.stops=[...(t==null?void 0:t.stops)||[]],g($)),(z=E.current)===null||z===void 0||z.setFieldsValue($)):x==="radial-gradient"?($={type:"radial-gradient",inner:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:0},outer:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:Math.min(((r==null?void 0:r.w)||0)/2,((r==null?void 0:r.h)||0)/2)},stops:[]},typeof t=="string"?($.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],b($)):(t==null?void 0:t.type)==="linear-gradient"&&($.stops=[...(t==null?void 0:t.stops)||[]],b($)),(X=w.current)===null||X===void 0||X.setFieldsValue($)):x==="solid"&&($=t,(t==null?void 0:t.type)==="linear-gradient"?($=((U=(A=t==null?void 0:t.stops)===null||A===void 0?void 0:A[0])===null||U===void 0?void 0:U.color)||"#000000",p($)):(t==null?void 0:t.type)==="radial-gradient"&&($=((O=(G=t==null?void 0:t.stops)===null||G===void 0?void 0:G[0])===null||O===void 0?void 0:O.color)||"#000000",p($))),$&&(n==null||n($))},k=x=>{if(c==="solid")n==null||n(x.color);else if(y.current){if(c==="linear-gradient"&&v&&Array.isArray(v==null?void 0:v.stops)){const z=[...v.stops];for(let A=0;A{const z=Object.assign({},v);x!=null&&x.start&&(z.start=Object.assign(Object.assign({},z.start),x.start)),x!=null&&x.end&&(z.end=Object.assign(Object.assign({},z.end),x.end)),n==null||n(z)},D=x=>{const z=Object.assign({},m);x!=null&&x.inner&&(z.inner=Object.assign(Object.assign({},z.inner),x.inner)),x!=null&&x.outer&&(z.outer=Object.assign(Object.assign({},z.outer),x.outer)),n==null||n(z)};return M.useMemo(()=>l.createElement("div",{className:j},!a&&!i&&l.createElement("div",{className:R},l.createElement(Ye.Group,{className:F,size:"small",buttonStyle:"solid",value:c,onChange:({target:{value:x}})=>{P(x)}},l.createElement(Ye.Button,{value:"solid"},l.createElement(I3,null)),!a&&l.createElement(Ye.Button,{value:"linear-gradient"},l.createElement(O3,null)),!i&&l.createElement(Ye.Button,{value:"radial-gradient"},l.createElement(x3,null)))),!a&&c==="linear-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:E,onValuesChange:N},l.createElement(he,{className:V},l.createElement(Q,{className:L,span:"4"},"Start"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["start","x"]},l.createElement(se,{className:_,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["start","y"]},l.createElement(se,{className:_,size:"small",prefix:"Y"})))),l.createElement(he,{className:V},l.createElement(Q,{className:L,span:"4"},"End"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["end","x"]},l.createElement(se,{className:_,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["end","y"]},l.createElement(se,{className:_,size:"small",prefix:"Y"})))))),!i&&c==="radial-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:w,onValuesChange:D},l.createElement(he,{className:V},l.createElement(Q,{className:L,span:"4"},"Inner"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["inner","x"]},l.createElement(se,{className:_,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["inner","y"]},l.createElement(se,{className:_,size:"small",prefix:"Y"})))),l.createElement(he,{className:V},l.createElement(Q,{className:L,span:"4"}),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["inner","radius"]},l.createElement(se,{className:_,size:"small",prefix:"R"})))),l.createElement(he,{className:V},l.createElement(Q,{className:L,span:"4"},"Outer"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["outer","x"]},l.createElement(se,{className:_,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["outer","y"]},l.createElement(se,{className:_,size:"small",prefix:"Y"})))),l.createElement(he,{className:V},l.createElement(Q,{className:L,span:"4"}),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:T,name:["outer","radius"]},l.createElement(se,{className:_,size:"small",prefix:"R"})))))),(!a||!i)&&(c==="linear-gradient"||c==="radial-gradient")&&l.createElement(C_,{mode:c,value:t,currentPickedColor:u,internalColor:h,internalLinearGradient:v,internalRadialGradient:m,onChange:x=>{(x==null?void 0:x.type)==="linear-gradient"?(g(x),n==null||n(x)):(x==null?void 0:x.type)==="radial-gradient"&&(b(x),n==null||n(x))},onSelectStop:x=>{x!=null&&x.color&&f(x.color),y.current=x}}),l.createElement(S_,{value:u,className:B,onChange:x=>{f(x),k({color:x})}})),[c,o,h,v,m,u,a,i])}const A_="base-element-field-multiple-color";function Ri(e){const{value:t,onChange:n,disabled:r,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o}=e,s=rn(),d=(y=>{let E="";return typeof y=="string"?E=y:["linear-gradient","radial-gradient"].includes(y==null?void 0:y.type)&&(E=s.gradient),E})(t),u=typeof t=="string",f=M.useRef(null),{createPrefixName:h,container:p}=M.useContext(le),v=h(A_),g=v(),m=v("preview"),b=()=>p||document.body;return M.useMemo(()=>{const y=kf(t||"transparent");return l.createElement(l.Fragment,null,l.createElement(Kn,{className:g,size:"small",disabled:r,prefix:r?l.createElement("span",null):l.createElement(Md,{placement:"left",content:l.createElement(M_,{value:t,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o,onChange:n}),trigger:"click",getPopupContainer:b,getTooltipContainer:b},l.createElement("span",{className:m,style:{background:y}})),readOnly:!u,value:d}),l.createElement("div",{ref:f}))},[t,n,r,a])}const co=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 384a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m0 170.666667a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m170.666667 0a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m-170.666667 170.666666a42.666667 42.666667 0 1 0-42.666667-42.666666 42.666667 42.666667 0 0 0 42.666667 42.666666z m341.333333-597.333333H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666667v682.666666a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667V170.666667a42.666667 42.666667 0 0 0-42.666667-42.666667z m-42.666666 682.666667H213.333333V213.333333h597.333334zM341.333333 554.666667a42.666667 42.666667 0 1 0-42.666666-42.666667 42.666667 42.666667 0 0 0 42.666666 42.666667z"}))),__="base-element-border-attribute",Uo=4;function Sr(e){const{borderRadius:t,borderWidth:n,borderColor:r,boxSizing:a,borderDash:i}=(e==null?void 0:e.detail)||{};let o="solid",s=Uo;Array.isArray(i)&&(i==null?void 0:i.length)>0&&i[0]>=1&&typeof n=="number"&&(o="dash",s=Math.ceil(i[0]));const c={borderRadiusList:[0,0,0,0],borderWidthList:[0,0,0,0],borderColor:r,borderType:o,boxSizing:a,borderDashNum:s};return typeof t=="number"?(c.borderRadius=t,c.borderRadiusList=[t,t,t,t]):Array.isArray(t)?c.borderRadiusList=[t[0]||0,t[1]||0,t[2]||0,t[3]||0]:c.borderRadius=0,typeof n=="number"?(c.borderWidth=n,c.borderWidthList=[n,n,n,n]):Array.isArray(n)?c.borderWidthList=[n[0]||0,n[1]||0,n[2]||0,n[3]||0]:c.borderWidth=0,c}const O_=e=>{var t,n;const{className:r,style:a,element:i,disabled:o,onChange:s}=e,c=M.useRef(null),{createPrefixName:d}=M.useContext(le),u=d(__),f=u(),h=u("row"),p=u("col"),v=u("input"),g=u("form-item"),[m,b]=M.useState(Array.isArray((t=i==null?void 0:i.detail)===null||t===void 0?void 0:t.borderRadius)),[y,E]=M.useState(Array.isArray((n=i==null?void 0:i.detail)===null||n===void 0?void 0:n.borderWidth)),[w,S]=M.useState(y),C=rn(),j=R=>{var B,F;const V=Sr(i),{borderColor:L,boxSizing:_,borderType:T,borderDashNum:P}=R,k={};if(L&&(k.borderColor=L),_&&(k.boxSizing=_),y===!0&&R.borderWidthList){const N=[0,0,0,0],D=Array.from((R==null?void 0:R.borderWidthList)||[null,null,null,null]);for(let x=0;x<4;x++){const z=D[x];typeof z=="number"?N[x]=z:N[x]=((B=V==null?void 0:V.borderWidthList)===null||B===void 0?void 0:B[x])||0,k.borderWidth=N}}else typeof R.borderWidth=="number"&&(k.borderWidth=R.borderWidth);if(m===!0&&R.borderRadiusList){const N=[0,0,0,0],D=Array.from((R==null?void 0:R.borderRadiusList)||[null,null,null,null]);for(let x=0;x<4;x++){const z=D[x];typeof z=="number"?N[x]=z:N[x]=((F=V==null?void 0:V.borderRadiusList)===null||F===void 0?void 0:F[x])||0,k.borderRadius=N}}else typeof R.borderRadius=="number"&&(k.borderRadius=R.borderRadius);y===!0?k.borderDash=[]:T==="solid"?k.borderDash=[]:T==="dash"?k.borderDash=[Uo,Uo]:P&&P>0&&(k.borderDash=[P,P]),s==null||s({detail:k})};return M.useEffect(()=>{var R,B,F;const V=Array.isArray((R=i==null?void 0:i.detail)===null||R===void 0?void 0:R.borderWidth),L=Array.isArray((B=i==null?void 0:i.detail)===null||B===void 0?void 0:B.borderRadius);E(V),b(L),S(V);const _=Sr(i);(F=c.current)===null||F===void 0||F.setFieldsValue(_)},[i]),M.useMemo(()=>{const R=Sr(i);return l.createElement(J,{ref:c,style:a,className:pe(f,r),onValuesChange:j},l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:16,className:p},y?l.createElement(Kn,{className:v,size:"small",prefix:l.createElement(co,{style:{fontSize:14}}),disabled:!0,value:C.mixedBorderWidth}):l.createElement(J.Item,{className:g,name:"borderWidth"},l.createElement(se,{className:v,size:"small",min:0,placeholder:"Border Width",prefix:l.createElement(co,{style:{fontSize:14}}),disabled:o||y}))),l.createElement(Q,{span:4,className:p},l.createElement(Ge,{icon:l.createElement(co,null),size:"small",disabled:o,type:y?"primary":"default",onClick:()=>{var B;const F=!y;if(E(F),S(F),!F){const V=Sr(i),L=V.borderWidth||((B=V.borderWidthList)===null||B===void 0?void 0:B[0])||0;j({borderWidth:L})}}}))),y&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",0]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(p3,null),disabled:o||!y,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",1]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(h3,null),disabled:o||!y,min:0})))),l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",2]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(d3,null),disabled:o||!y,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",3]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(f3,null),disabled:o||!y,min:0})))))),l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:16,className:p},m?l.createElement(Kn,{className:v,size:"small",prefix:l.createElement(Nl,{style:{fontSize:14}}),disabled:!0,value:C.mixedBorderRadius}):l.createElement(J.Item,{className:g,name:"borderRadius"},l.createElement(se,{className:v,size:"small",placeholder:"Radius",prefix:l.createElement(Nl,{style:{fontSize:14}}),disabled:o||m||w,min:0}))),l.createElement(Q,{span:4,className:p},l.createElement(Ge,{icon:l.createElement(C3,null),size:"small",disabled:o||w,type:m?"primary":"default",onClick:()=>{var B;const F=!m;if(b(F),!F){const V=Sr(i),L=V.borderRadius||((B=V.borderRadiusList)===null||B===void 0?void 0:B[0])||0;j({borderRadius:L})}}}))),m&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",0]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(b3,null),disabled:o||!m||w,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",1]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(y3,null),disabled:o||!m||w,min:0})))),l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",2]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(v3,null),disabled:o||!m||w,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",3]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(m3,null),disabled:o||!m||w,min:0})))))),l.createElement(he,{className:h},l.createElement(Q,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"boxSizing"},l.createElement(We,{size:"small",disabled:o},l.createElement(We.Option,{value:"border-box"},C.inside),l.createElement(We.Option,{value:"content-box"},C.outside),l.createElement(We.Option,{value:"center-line"},C.centerLine)))),l.createElement(Q,{className:p,span:"13"},l.createElement(J.Item,{className:g,name:"borderColor"},l.createElement(Ri,{elementSize:i?gi(i):void 0,disabled:o,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(he,{className:h},l.createElement(Q,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"borderType"},l.createElement(We,{size:"small",disabled:o||y},l.createElement(We.Option,{value:"solid"},C.solid),l.createElement(We.Option,{value:"dash"},C.dash)))),l.createElement(Q,{className:p,span:"13"},R.borderType==="dash"&&l.createElement(J.Item,{className:g,name:"borderDashNum"},l.createElement(se,{disabled:o||y,className:v,size:"small",style:{width:"100%"},prefix:l.createElement(u3,{style:{fontSize:14}})})))))},[C,i,o,m,y,w])},T_="base-element-detail-circle",$_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=M.useContext(le),i=r(T_)();return M.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])};var P_=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{TextArea:I_}=Kn,z_="base-element-field-image-picker",{useCallback:Ed}=l,R_=["image/png","image/jpeg","image/jpg","image/png"],N_=({value:e="",onChange:t})=>{const[n,r]=M.useState(e),[a,i]=M.useState("free"),{createPrefixName:o}=M.useContext(le),s=o(z_),c=s(),d=s("box"),u=s("entity"),f=s("action"),h=s("action-text"),p=s("action-upload"),v=Ed(y=>{const E=y||"";let w=3,S=300;return E.length>128&&(w=10),{rows:w,width:S}},[n]),g=y=>{t==null||t(y||e)},m=y=>{r(y),St.imageSrc(y)&&g(y)},b=Ed(()=>{a!=="picking"&&(Yo({success:y=>P_(void 0,void 0,void 0,function*(){if(R_.includes(y.file.type)!==!0){Ga.error(`File's type "${y.file.type}" is not supported!`);return}try{const E=yield Nf(y.file);m(E.toString())}catch{Ga.error(`Failed to parse file ${y.file.name}`)}i("free")}),error:y=>{console.log(y),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return M.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("img",{className:u,src:e||n}),l.createElement("div",{className:f},l.createElement("div",{className:h},l.createElement(Md,{content:()=>l.createElement("div",null,l.createElement(I_,{value:e||n,style:{width:v(e||n).width},rows:v(e||n).rows,onChange:y=>{m(y.target.value||"")}})),trigger:"click"},l.createElement("span",{style:{display:"inline-block",width:"100%",height:"100%",lineHeight:"50px"}},"URL"))),l.createElement("div",{onClick:b,className:p},l.createElement("span",null,"Upload"))))),[e,n])},D_="base-element-detail-image",j_=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=M.useContext(le),u=c(D_)(),f=M.useRef(null),h=v=>{const{src:g=""}=(v==null?void 0:v.detail)||{};return{src:g,imageResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.imageResource){const{assetId:m}=o({type:"image",value:v.imageResource});m&&Zt(m)&&(g.src=m)}a==null||a({detail:g})};return M.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),M.useMemo(()=>l.createElement("div",{style:n,className:pe(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"imageResource"},l.createElement(N_,null)))),[r,s])},L_="base-element-detail-path",k_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=M.useContext(le),i=r(L_)();return M.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])},B_="base-element-detail-rect",F_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=M.useContext(le),i=r(B_)();return M.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])};var H_=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const W_="base-element-field-svg-picker",G_=["image/svg+xml"];function V_(e){const t=document.createElement("div");return t.innerHTML=e,document.querySelector("svg").setAttribute("_t",Date.now()+""),{__html:t.innerHTML}}const U_=({value:e="",onChange:t})=>{const[n,r]=M.useState(e),[a,i]=M.useState("free"),{createPrefixName:o}=M.useContext(le),s=o(W_),c=s(),d=s("box"),u=s("entity"),f=s("action");s("action-text");const h=s("action-upload"),p=m=>{t==null||t(m||e)},v=m=>{r(m),St.svg(m)&&p(m)},g=M.useCallback(()=>{a!=="picking"&&(Yo({success:m=>H_(void 0,void 0,void 0,function*(){if(G_.includes(m.file.type)!==!0){Ga.error(`File's type "${m.file.type}" is not supported!`);return}try{let b=(yield Df(m.file)).toString();b=b.substring(b.indexOf("{console.log(m),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return M.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("div",{className:u,dangerouslySetInnerHTML:V_(e||n)}),l.createElement("div",{className:f},l.createElement("div",{onClick:g,className:h},l.createElement("span",null,"Upload"))))),[e,n])},Y_="base-element-detail-svg",X_=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=M.useContext(le),u=c(Y_)(),f=M.useRef(null),h=v=>{const{svg:g=""}=(v==null?void 0:v.detail)||{};return{svg:g,svgResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.svgResource){const{assetId:m}=o({type:"svg",value:v.svgResource});m&&Zt(m)&&(g.svg=m)}a==null||a({detail:g})};return M.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),M.useMemo(()=>l.createElement("div",{style:n,className:pe(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"svgResource"},l.createElement(U_,null)))),[r,s])},Z_="base-element-detail-text",gn={fontSize:20},vn=e=>St.number(e*1)?Te(e*1):e,K_=e=>{const{color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o}=(e==null?void 0:e.detail)||{};return{color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o}},Q_=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=M.useContext(le),s=o(Z_),c=s(),d=s("row"),u=s("col"),f=s("switch"),h=s("form-item"),p=M.useRef(null);M.useEffect(()=>{var g;const m=K_(r);(g=p.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return M.useMemo(()=>l.createElement("div",{style:n,className:pe(c,t)},l.createElement(J,{ref:p,style:n,className:c,onValuesChange:v},l.createElement(he,{className:d},l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"verticalAlign"},l.createElement(Ye.Group,{disabled:i,className:f,size:"small"},l.createElement(Ye.Button,{value:"top"},l.createElement(N3,{style:gn})),l.createElement(Ye.Button,{value:"middle"},l.createElement(R3,{style:gn})),l.createElement(Ye.Button,{value:"bottom"},l.createElement(z3,{style:gn}))))),l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"textAlign"},l.createElement(Ye.Group,{disabled:i,className:f,size:"small"},l.createElement(Ye.Button,{value:"left"},l.createElement(s3,{style:gn})),l.createElement(Ye.Button,{value:"center"},l.createElement(o3,{style:gn})),l.createElement(Ye.Button,{value:"right"},l.createElement(l3,{style:gn})))))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Text Color"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"color"},l.createElement(Ri,{elementSize:r?gi(r):void 0,disabled:i,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Font Size"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontSize"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:vn,parser:vn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Font Weight"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontWeight"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:100,max:1e3,min:100,formatter:vn,parser:vn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Line Height"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"lineHeight"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:vn,parser:vn})))))),[n,t])},J_="base-element-detail-group",q_=e=>{const{overflow:t}=(e==null?void 0:e.detail)||{};return{overflow:t}},e9=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=M.useContext(le),s=o(J_),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=M.useRef(null),p=rn();M.useEffect(()=>{var g;const m=q_(r);(g=h.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return M.useMemo(()=>l.createElement("div",{style:n,className:pe(c,t)},l.createElement(J,{ref:h,style:n,className:c,onValuesChange:v},l.createElement(he,{className:d},l.createElement(Q,{className:u,span:"10"},p.overflow),l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:f,name:"overflow"},l.createElement(We,{size:"small",disabled:i},l.createElement(We.Option,{value:"visible"},p.visible),l.createElement(We.Option,{value:"hidden"},p.hidden))))))),[n,t,p])},t9="base-element-detail-attribute",n9=e=>{const{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}=e,{createPrefixName:o}=M.useContext(le),c=o(t9)();return M.useMemo(()=>l.createElement("div",{className:c},(t==null?void 0:t.type)==="circle"&&l.createElement($_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="image"&&l.createElement(j_,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="svg"&&l.createElement(X_,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="group"&&l.createElement(e9,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="path"&&l.createElement(k_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="rect"&&l.createElement(F_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="text"&&l.createElement(Q_,{element:t,onChange:n})),[r,t])},r9="base-element-content-attribute",a9=e=>{let{opacity:t}=(e==null?void 0:e.detail)||{};const{background:n}=(e==null?void 0:e.detail)||{};return typeof t=="number"&&t>=0&&t<=1||(t=1),{background:n,opacity:t}},i9=e=>{const{style:t,element:n,disabled:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,s=M.useRef(null),{createPrefixName:c}=M.useContext(le),d=c(r9),u=d(),f=d("row"),h=d("col"),p=d("form-item"),v=b=>{const y=b;a==null||a({detail:y})},g=b=>{a==null||a(b)},m=rn();return M.useEffect(()=>{var b;const y=a9(n);(b=s.current)===null||b===void 0||b.setFieldsValue(y)},[n]),M.useMemo(()=>l.createElement(l.Fragment,null,l.createElement(J,{ref:s,style:t,className:u,onValuesChange:v},["rect","circle","text","group","path"].includes(n==null?void 0:n.type)&&l.createElement(he,{className:f},l.createElement(Q,{className:h,span:"10"},m.background),l.createElement(Q,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"background"},l.createElement(Ri,{elementSize:n?gi(n):void 0,disabled:r})))),l.createElement(he,{className:f},l.createElement(Q,{className:h,span:"10"},m.opacity),l.createElement(Q,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"opacity"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},step:.1}))))),l.createElement(n9,{element:n,disabled:r,onChange:g,getElementAsset:i,createElementAsset:o})),[m,n,r,a])},o9="base-element-shadow-attribute",s9=e=>{const{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}=(e==null?void 0:e.detail)||{};return{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}},l9=e=>{const{style:t,element:n,disabled:r,onChange:a}=e,i=M.useRef(null),{createPrefixName:o}=M.useContext(le),s=o(o9),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=v=>{const g=v;a==null||a({detail:g})},p=rn();return M.useEffect(()=>{var v;const g=s9(n);(v=i.current)===null||v===void 0||v.setFieldsValue(g)},[n]),M.useMemo(()=>l.createElement(J,{ref:i,style:t,className:c,onValuesChange:h},l.createElement(he,{className:d},l.createElement(Q,{className:u,span:"14"},l.createElement(J.Item,{className:f,name:"shadowColor"},l.createElement(Ri,{elementSize:n?gi(n):void 0,disabled:r,disabledLinearGradient:!0,disabledRadialGradient:!0}))),l.createElement(Q,{className:u,span:"10"},l.createElement(J.Item,{className:f,name:"shadowBlur"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"}})))),l.createElement(he,null,l.createElement(Q,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetX"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},prefix:"X"}))),l.createElement(Q,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetY"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},prefix:"Y"}))))),[p,n,r])},c9="base-element-detail",d9=nn(),u9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,{createPrefixName:s}=M.useContext(le),c=s(c9),d=rn();let u=r;r&&(u=Object.assign(Object.assign({},r||{}),{detail:Object.assign(Object.assign({},d9),r==null?void 0:r.detail)}));const f=[{key:"basic-attribute",label:d.basicAttributes,children:l.createElement(W3,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}})},{key:"border-attribute",label:d.borderAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(O_,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(ra,{image:ra.PRESENTED_IMAGE_SIMPLE,description:!1})},{key:"content-attribute",label:d.contentAttribute,children:l.createElement(i9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)},getElementAsset:i,createElementAsset:o})},{key:"shadow-attribute",label:d.shadowAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(l9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(ra,{image:ra.PRESENTED_IMAGE_SIMPLE,description:!1})}];return M.useMemo(()=>l.createElement("div",{style:n,className:pe(c(),t)},l.createElement(cf,{ghost:!0,items:f,size:"small",defaultActiveKey:f.map(h=>h.key)})),[u,d])},ef=e=>{var t;const n={uuid:e.uuid,key:e.uuid,title:e.name||e.detail.text||e.type||"unamed",type:e.type,children:[],operations:e.operations||{}};return e.type==="group"&&Array.isArray((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.children)&&e.detail.children.forEach(r=>{n.children.push(ef(r))}),n};function Re(e){const t=[];return e.elements.forEach(n=>{const r=ef(n);t.push(r)}),t}var f9=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a0){const r=Qn(e,n.elements);(r==null?void 0:r.type)==="group"&&(r.detail.children=t.elements)}}const p9="dark",g9="en-US";function v9(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});let n=[],r=t;e!=null&&e.defaultEditingGroupUUID&&(n=vi(e.defaultEditingGroupUUID,t.elements)),r=Yn(n,t);const a=Re(r);return{localeCode:(e==null?void 0:e.defaultLocale)||g9,themeMode:(e==null?void 0:e.defaultThemeMode)||p9,data:t,editingData:r,editingDataPosition:n,treeData:a,selectedUUIDs:(e==null?void 0:e.defaultSelectedElementUUIDs)||[],scaleInfo:Object.assign({scale:1,from:"init"},(e==null?void 0:e.defaultScaleInfo)||{})}}function m9(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});return{localeCode:"en-US",themeMode:(e==null?void 0:e.themeMode)||"light",data:Object.assign({elements:[]},(e==null?void 0:e.data)||{}),editingData:Yn([],t),editingDataPosition:[],treeData:[],selectedUUIDs:[],scaleInfo:Object.assign({scale:1,from:"control"},(e==null?void 0:e.scaleInfo)||{})}}function b9(e,t){var n,r;switch(t.type){case"update":return t!=null&&t.payload?Object.assign(Object.assign({},e),t==null?void 0:t.payload):e;case"updateThemeMode":return!((n=t==null?void 0:t.payload)===null||n===void 0)&&n.themeMode?Object.assign(Object.assign({},e),{themeMode:(r=t==null?void 0:t.payload)===null||r===void 0?void 0:r.themeMode}):e;default:return e}}const dr=M.createContext({state:m9(),dispatch:()=>{}}),y9=dr.Provider,w9={locale:"en-US",NavMenu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"},Toolbar:{layers:"Layers",ruler:"Ruler",attributes:"Attributes",hand:"Hand tool",centerContent:"Center content"},contextMenu:{copy:"Copy",paste:"Paste",cut:"Cut",delete:"Delete"}},x9={locale:"zh-CN",NavMenu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"},Toolbar:{layers:"图层",ruler:"标尺",attributes:"属性",hand:"拖拽工具",centerContent:"内容居中"},contextMenu:{copy:"复制",paste:"粘贴",cut:"剪切",delete:"删除"}},E9={"en-US":w9,"zh-CN":x9},Hs=e=>{const{state:t}=M.useContext(dr),n=t.localeCode;return[M.useMemo(()=>{const i=E9[n][e];return Object.assign({},i)},[n,e])]},S9="mod-toolbar",C9=()=>{const[e]=Hs("Toolbar");return e},M9=e=>{const{className:t,style:n,openLeftSider:r,openRightSider:a,onClickToggleLayer:i,onClickToggleSetting:o,sharedStore:s}=e,c={fontSize:16},{createPrefixName:d}=M.useContext(le),u=d(S9),f=u(),h=u("left"),p=u("right"),v=u("btn"),[g,m]=M.useState(!1),[b,y]=M.useState(!0),E=C9();M.useEffect(()=>{const S=s.get("idraw");S==null||S.reset({enableRuler:b,enableDrag:g,enableSelect:!g})},[g,b]);const w={size:"small",className:v,shape:"default"};return M.useMemo(()=>l.createElement("div",{style:n,className:pe(f,t)},l.createElement("div",{className:h}),l.createElement("div",{className:p},l.createElement(fr,{title:E.layers},l.createElement(Ge,Object.assign({},w,{type:r?"primary":"default",icon:l.createElement(M3,{style:c}),onClick:i}))),l.createElement(fr,{title:E.attributes},l.createElement(Ge,Object.assign({},w,{type:a?"primary":"default",icon:l.createElement(P3,{style:c}),onClick:o}))),l.createElement(fr,{title:E.ruler},l.createElement(Ge,Object.assign({},w,{type:b?"primary":"default",icon:l.createElement($3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{y(!b)}}))),l.createElement(fr,{title:E.hand},l.createElement(Ge,Object.assign({},w,{type:g?"primary":"default",icon:l.createElement(S3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{m(!g)}}))),l.createElement(fr,{title:E.centerContent},l.createElement(Ge,Object.assign({},w,{type:"text",icon:l.createElement(i3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{const S=s.get("idraw");S==null||S.centerContent()}}))))),[r,a,i,o,g,b,E])},A9="mod-panel-layer",_9=e=>{const{className:t,style:n,height:r,defaultSelectedElementUUIDs:a=[],sharedStore:i,sharedEvent:o,useContextMenuOptions:s}=e,{state:c,dispatch:d}=M.useContext(dr),{createPrefixName:u}=M.useContext(le),f=u(A9),{treeData:h,selectedUUIDs:p,editingData:v}=c,g=M.useRef(null),[m,b]=M.useState(a),y=f(),E=f("content"),w=f("header"),S=f("header","title"),C=f("header","btn"),[j]=s({sharedEvent:o,sharedStore:i}),R=()=>{if(c.editingDataPosition.length===0)return"";const L=Qn(c.editingDataPosition,c.data.elements);return(L==null?void 0:L.name)||(L==null?void 0:L.type)||""},B=L=>{const _=i.get("idraw");_==null||_.selectElementsByPositions(L)};M.useEffect(()=>{o.on("scrollToLayer",({uuid:L})=>{var _;L&&((_=g.current)===null||_===void 0||_.scrollTo({key:L,align:"top"}))})},[]),M.useEffect(()=>{if(p[0]&&p.length===1){const _=Fd(p[0],v.elements).map(P=>P.uuid);p[0]&&_.push(p[0]);const T=[...m];_.forEach(P=>{T.includes(P)||T.push(P)}),b(T)}},[p,v]);const F=()=>{o.trigger("resetEditingView",{type:"back-root",position:null})},V=()=>{o.trigger("resetEditingView",{type:"back-one",position:null})};return M.useMemo(()=>Array.isArray(h)&&h.length>0?l.createElement("div",{style:n,className:pe(y,t),onContextMenu:L=>{L.preventDefault()}},l.createElement("div",{className:w},l.createElement(Ge,{className:C,size:"small",icon:l.createElement(E3,null),disabled:!(c.editingDataPosition.length>0),onClick:F}),l.createElement(Ge,{className:C,size:"small",icon:l.createElement(A3,null),disabled:!(c.editingDataPosition.length>0),onClick:V}),l.createElement("span",{className:S},R())),l.createElement(fi,{menu:{items:j},trigger:["contextMenu"]},l.createElement("div",{className:E},l.createElement(L3,{ref:g,height:r,treeData:h,selectedKeys:p,expandedKeys:m,onTitleChange:({uuid:L,value:_})=>{Fr(L,{name:_},c.editingData.elements);const T=Re(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:T}})},onOperationToggle:({uuid:L,operations:_})=>{Fr(L,{operations:_},c.editingData.elements);const T=Re(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:T}})},onSelect:L=>{p!=null&&p.includes(L.uuids[0])||B(L.positions)},onDrop:L=>{const{elements:_}=Kd(v.elements,{from:L.from,to:L.to}),T=Re(v);d({type:"update",payload:{editingData:Object.assign(Object.assign({},v),{elements:[..._]}),treeData:T}})},onDelete:({uuid:L})=>{o.trigger("deleteElement",{uuid:L})},onGoToGroup:L=>{o.trigger("resetEditingView",{type:"go-to-group",position:L.position})},onExpand:(L,{node:_})=>{const T=_.key;if(T){let P=[...m];m.includes(T)?P.splice(P.indexOf(T),1):P=[...P,T],b(P)}}})))):l.createElement("div",{style:n,className:pe(y,t),onContextMenu:L=>{L.preventDefault()}},l.createElement("div",{className:w},"..."),l.createElement("div",{className:E},l.createElement("div",{style:{padding:"20px 0",textAlign:"center"}},"Empty"))),[h,p,m,v.elements,c.editingDataPosition,j])},O9="mod-panel-detail",T9=e=>{const{className:t,style:n}=e,{createPrefixName:r}=M.useContext(le),{state:a,dispatch:i}=M.useContext(dr),o=r(O9),{selectedUUIDs:s,editingData:c}=a,d=o(),u=M.useCallback(v=>{if((s==null?void 0:s.length)===1&&s[0]){const g=s[0];Fr(g,v,c.elements),i({type:"update",payload:{editingData:Object.assign({},c)}})}},[c,s]),f=M.useCallback(v=>(s==null?void 0:s.length)>1?null:Bd(v,c.elements),[c,s[0]]),h=M.useCallback(v=>{var g,m;let b=null;return v&&Zt(v)&&(b=((m=(g=c.assets)===null||g===void 0?void 0:g[v])===null||m===void 0?void 0:m.value)||null),b},[c,s[0]]),p=M.useCallback(v=>{const g=Zn(v.value);return c.assets||(c.assets={}),c.assets[g]=v,{assetId:g,assetItem:v}},[c,s[0]]);return M.useMemo(()=>{const v=f(s[0]);return l.createElement("div",{style:n,className:pe(d,t),onContextMenu:g=>{g.preventDefault()}},l.createElement(u9,{element:v,onChange:u,getElementAsset:h,createElementAsset:p}))},[s[0]])},$9="mod-export-image-file",Ws=700,P9=Ws+48,Rr=500,I9=Ws-Rr,ba={devicePixelRatio:1,fileName:"download.png"},z9=e=>{const{className:t,style:n,sharedStore:r}=e,{createPrefixName:a}=M.useContext(le),i=a($9),o=i(),s=i("preview"),c=i("options"),d=i("canvas"),[u,f]=M.useState(null),[h,p]=M.useState(!0),[v,g]=M.useState(null),[m]=J.useForm(),b=M.useCallback(E=>{const w=r.get("idraw");w&&(p(!0),w.getImageBlobURL({devicePixelRatio:E}).then(({blobURL:S,width:C,height:j,devicePixelRatio:R})=>{S&&(g(S),f({width:C,height:j,devicePixelRatio:R}))}).catch(S=>{console.log(S)}).finally(()=>{p(!1)}))},[]);M.useEffect(()=>{m.setFieldsValue({devicePixelRatio:ba.devicePixelRatio,fileName:ba.fileName}),setTimeout(()=>{b(ba.devicePixelRatio)},10)},[]);const y=()=>{if(!v)return;const E=m.getFieldsValue(),w=document.createElement("a");w.href=v,w.download=E.fileName||ba.fileName,document.body.appendChild(w),w.click(),document.body.removeChild(w)};return M.useMemo(()=>l.createElement("div",{style:Object.assign(Object.assign({},n),{width:Ws}),className:pe(o,t)},l.createElement(df,{tip:"Loading...",spinning:h},l.createElement("div",{className:s,style:{width:Rr,height:Rr*3/4}},v&&l.createElement("img",{className:d,style:{maxWidth:Rr,maxHeight:Rr*3/4},src:v}))),l.createElement("div",{className:c,style:{width:I9}},l.createElement("div",{style:{marginBottom:6}},"Width: ",u==null?void 0:u.width),l.createElement("div",null,"Height: ",u==null?void 0:u.height),l.createElement(uf,null),l.createElement("div",null,l.createElement(J,{form:m,layout:"vertical",onValuesChange:E=>{E.devicePixelRatio>0&&setTimeout(()=>{b(E.devicePixelRatio)},10)},disabled:h},l.createElement(J.Item,{label:"Device pixel ratio",name:"devicePixelRatio"},l.createElement(We,{size:"small",options:[1,2,3,4].map(E=>({label:`x${E}`,value:E}))})),l.createElement(J.Item,{label:"File name",name:"fileName"},l.createElement(Kn,{size:"small",placeholder:"File name"})),l.createElement(Ge,{type:"primary",onClick:y,disabled:h||!v,loading:h},"Download"))))),[u,h,v,b])};var R9=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function N9(e){return new Promise(function(t,n){const r=new FileReader;r.onload=function(){t(r)},r.onerror=n,e.type==="application/json"?r.readAsText(e):r.readAsArrayBuffer(e)})}function D9(e){Yo({accept:"application/json",success:t=>R9(this,void 0,void 0,function*(){var n,r,a;const o=(yield N9(t.file)).result;if(typeof o=="string")try{const s=JSON.parse(o);(n=e==null?void 0:e.success)===null||n===void 0||n.call(e,{json:s})}catch(s){(r=e==null?void 0:e.error)===null||r===void 0||r.call(e,s)}else(a=e==null?void 0:e.error)===null||a===void 0||a.call(e,Error("ERROR_PICK_FILE_FAIL"))}),error:e==null?void 0:e.error})}const j9=()=>{const[e]=Hs("NavMenu");return e},L9="mod-nav-menu",k9=e=>{const{className:t,style:n,sharedStore:r,sharedEvent:a}=e,[i,o]=ff.useModal(),{createPrefixName:s}=M.useContext(le),c=s(L9),d=c(),u=c("dropdown"),[f,h]=M.useState([]),p=j9(),v=({key:w,domEvent:S})=>{S.preventDefault(),a.trigger("createElement",{type:w,element:{name:w}})},g=w=>{const S=r.get("idraw");S==null||S.resize({devicePixelRatio:w})},m={more:[{key:"about-idraw-stuido",label:p.about,disabled:!0},{key:"line",type:"divider"},{key:"file",label:p.file,children:[{key:"import-json-file",label:p.importJSONFile,onClick:()=>{D9({success:({json:w})=>{a.trigger("resetData",{data:w})},error:()=>{}})}},{key:"export-image",label:p.exportImage,onClick:()=>{i.info({icon:null,title:"Whole image file",width:P9,content:l.createElement(z9,{sharedEvent:a,sharedStore:r}),footer:null,closable:!0})}},{key:"export-json-file",label:p.exportJSONFile,onClick:()=>{const w=r.get("idraw"),S=w==null?void 0:w.getData({compact:!0});if(S){const C=JSON.stringify(S);Lf(C,{fileName:"downdown.json"})}}}]},{key:"preferences",label:p.preferences,children:[{key:"device-pixel-ratio",label:p.devicePixelRatio,type:"group",children:[{key:"device-pixel-ratio-x1",label:"x1",onClick:()=>{g(1)}},{key:"device-pixel-ratio-x2",label:"x2",onClick:()=>{g(2)}},{key:"device-pixel-ratio-x3",label:"x3",onClick:()=>{g(3)}}]}]}],element:[{key:"rect",label:p.rect,icon:l.createElement(Su,null),onClick:v},{key:"circle",label:p.circle,icon:l.createElement(Cu,null),onClick:v},{key:"text",label:p.text,icon:l.createElement(Mu,null),onClick:v},{key:"image",label:p.image,icon:l.createElement(Ou,null),onClick:v},{key:"svg",label:p.svg,icon:l.createElement(_u,null),onClick:v},{key:"html",label:p.html,disabled:!0,icon:l.createElement(Tu,null),onClick:v},{key:"group",label:p.group,icon:l.createElement(Au,null),onClick:v}]},b={size:"small",type:"text"},y=[{key:"more",button:l.createElement(_3,{style:{fontSize:20}})},{key:"element",button:l.createElement(c3,{style:{fontSize:20}})}],E=()=>{const w=r.get("idraw"),S=[];if(w){const{viewSizeInfo:C}=w.getViewInfo(),{devicePixelRatio:j}=C;S.push(`device-pixel-ratio-x${j}`)}h(S)};return M.useMemo(()=>l.createElement("div",{style:n,className:pe(d,t)},y.map((w,S)=>l.createElement(fi,{key:S,trigger:["click","click"],menu:{items:m[w.key]||[],selectedKeys:f},placement:"bottom",overlayClassName:u,onOpenChange:C=>{C===!0&&E()}},l.createElement(Ge,Object.assign({},b,{onClick:C=>C.preventDefault()}),l.createElement(hf.Compact,null,w.button,l.createElement(Pu,{style:{fontSize:10,marginLeft:4}}))))),o),[f,p])},B9="mod-header",F9=e=>{const{logo:t,navigationMenu:n,navigationCenter:r,className:a,style:i,openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f}=e,{state:h,dispatch:p}=M.useContext(dr),{createPrefixName:v}=M.useContext(le),g=v(B9),m=g(),b=g("left"),y=g("right"),E=g("center"),w=g("locale"),S=g("scale"),C=g("switch"),{localeCode:j,scaleInfo:R}=h;return M.useMemo(()=>l.createElement("div",{style:i,className:pe(m,a)},l.createElement("div",{className:b},t,n||l.createElement(k9,{sharedStore:u,sharedEvent:f}),l.createElement(M9,{openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f})),r&&l.createElement("div",{className:E},r),l.createElement("div",{className:y},l.createElement(Qp,{className:S,value:`${Te(R.scale)}`,onChange:B=>{const F=parseFloat(B);F>0&&(p==null||p({type:"update",payload:{scaleInfo:{scale:Te(F),from:"control"}}}))}}),l.createElement(Rf,{className:w,value:j,onChange:B=>{p==null||p({type:"update",payload:{localeCode:B}})}}),l.createElement(If,{className:C,theme:h==null?void 0:h.themeMode,onChange:({theme:B})=>{p==null||p({type:"updateThemeMode",payload:{themeMode:B}})}}))),[j,R,o,s,c,d])},H9="mod-sketch",W9=e=>{const t=M.useRef(null),n=M.useRef(null),r=M.useRef(!1),{className:a,style:i,width:o,height:s,sharedEvent:c,sharedStore:d,useContextMenuOptions:u}=e,{generateClassName:f}=M.useContext(le),{state:h,dispatch:p}=M.useContext(dr),{editingData:v}=h,g=f(H9),m=M.useRef([]),b=M.useRef(h.editingData),y=M.useRef(h.data),[E]=u({sharedEvent:c,sharedStore:d});return M.useEffect(()=>{m.current=[...h.editingDataPosition],y.current=h.data,b.current=h.editingData},[h.editingDataPosition,h.data,h.editingData]),M.useEffect(()=>{if(!(t!=null&&t.current)||n!=null&&n.current)return;const w={width:o,height:s,devicePixelRatio:window.devicePixelRatio},S=new Xp(t.current,w);n.current=S;const C=P=>{const k=b.current;let{uuids:N}=P;const{positions:D}=P;D&&Array.isArray(D)&&(N=Hd(D,k.elements).map(z=>z.uuid)),p({type:"update",payload:{selectedUUIDs:N}})},j=P=>{const{data:k,type:N}=P,D=b.current;if(["addElement","updateElement","deleteElement","moveElement","dragElement","resizeElement"].includes(N)){const x={editingData:Object.assign({},k)};["addElement","deleteElement","moveElement"].includes(N)&&(x.treeData=Re(D)),p({type:"update",payload:x})}},R=P=>{const{scale:k}=P;p({type:"update",payload:{scaleInfo:{scale:k,from:"event"}}})},B=P=>{const{type:k,element:N}=P,D=S.createElement(k,{element:N,viewCenter:!0}),x=S.addElement(D),z=Re(x);p({type:"update",payload:{editingData:Object.assign({},x),treeData:z}}),S.selectElements([D.uuid])},F=P=>{const{element:k,position:N=[]}=P,D=S.getViewCenter(),x=S.addElement(Object.assign(Object.assign({},k),{x:D.x-k.w/2,y:D.y-k.h/2}),{position:N}),z=Re(x);p({type:"update",payload:{editingData:Object.assign({},x),treeData:z}}),S.selectElements([k.uuid])},V=P=>{const{uuid:k}=P;S==null||S.deleteElement(k);const N=S==null?void 0:S.getData();if(N){const D=Re(N);p({type:"update",payload:{editingData:Object.assign({},N),treeData:D}}),S.trigger(ut,{})}},L=P=>{const{type:k,position:N}=P,D=n==null?void 0:n.current;if(!D)return;const x=m.current,z=y.current,X=b.current;if(x.length>0&&h9(x,X,z),k==="go-to-group"&&N){const A=[...x,...N],U=Yn(A,z),G=Re(U);p({type:"update",payload:{data:Object.assign({},z),editingData:Object.assign({},U),editingDataPosition:A,treeData:G}}),D.centerContent({data:U}),D.trigger(ut,{})}else if(k==="back-one"&&x.length>0){const A=[...x];A.pop();const U=Yn(A,z),G=Re(U);p({type:"update",payload:{data:Object.assign({},z),editingData:Object.assign({},U),editingDataPosition:[...A],treeData:G}}),D.centerContent({data:U}),D.trigger(ut,{})}else if(k==="back-root"){const A=[],U=Yn(A,z),G=Re(U);p({type:"update",payload:{data:Object.assign({},z),editingData:U,editingDataPosition:A,treeData:G}}),D.centerContent({data:U}),D.trigger(ut,{})}},_=P=>{const{data:k}=P,N=[],D=Yn(N,k),x=Re(D);p({type:"update",payload:{data:Object.assign({},k),editingData:Object.assign({},D),editingDataPosition:N,treeData:x}}),S.setViewScale({scale:1,offsetX:0,offsetY:0}),S.trigger(ut,{})},T=P=>{const{editingData:k}=P,N=Re(k);p({type:"update",payload:{editingData:Object.assign({},k),treeData:N}}),S.trigger(ut,{})};if(S.on(Lt,C),S.on("change",j),S.on(Mo,R),c.on("createElement",B),c.on("addElement",F),c.on("deleteElement",V),c.on("resetEditingView",L),c.on("resetData",_),c.on("resetEditingData",T),c.on("dispatch",p),!r.current){if(h.scaleInfo){const{scale:P,offsetX:k,offsetY:N}=h.scaleInfo;P&&k&&N&&S.setViewScale({scale:P,offsetX:k,offsetY:N})}r.current=!0}return d.set("idraw",S),()=>{r.current=!1,S.off(Lt,C),S.off("change",j),S.off(Mo,R),d.set("idraw",null)}},[]),M.useEffect(()=>{n!=null&&n.current&&n.current.setData(v)},[v]),M.useEffect(()=>{if(n!=null&&n.current){const w=n.current;h.scaleInfo.from==="control"&&w.scale({scale:h.scaleInfo.scale,point:{x:o/2,y:s/2}})}},[h.scaleInfo]),M.useEffect(()=>{const w=n.current,S=t.current;w&&w.resize({width:o,height:s}),S&&(S.style.width=`${o}px`,S.style.height=`${s}px`)},[o,s]),M.useMemo(()=>l.createElement(fi,{menu:{items:E},trigger:["contextMenu"]},l.createElement("div",{ref:t,className:pe(g,a),style:Object.assign(Object.assign({},i),{width:o,height:s,padding:0})})),[E])},G9="mod-dashboard",ya=240,wa=240,Cr=36,V9=M.forwardRef((e,t)=>{const{className:n,style:r,width:a,height:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,sharedStore:u,sharedEvent:f,useContextMenuOptions:h,handleKeyboard:p}=e,{createPrefixName:v}=M.useContext(le),g=v(G9),[m,b]=M.useState(!0),[y,E]=M.useState(!0);M.useEffect(()=>{const C=j=>{["INPUT","TEXTAREA"].includes(j.target.nodeName)||p(j,{sharedEvent:f,sharedStore:u})};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C)}},[]);const[w,S]=M.useState({leftWidth:m?ya:0,rightWidth:y?wa:0,centerWidth:a-(m?ya:0)-(y?wa:0)});return M.useEffect(()=>{const C=m?ya:0,j=y?wa:0,R=a-C-j;S({leftWidth:C,rightWidth:j,centerWidth:R})},[i,a,m,y]),M.useMemo(()=>{const{leftWidth:C,rightWidth:j,centerWidth:R}=w;return l.createElement("div",{ref:t,className:pe(g(),n),style:Object.assign(Object.assign({},r),{width:a,height:i,padding:0})},l.createElement("div",{className:g("header"),style:{height:Cr}},l.createElement(F9,{sharedEvent:f,sharedStore:u,logo:o,navigationMenu:s,navigationCenter:c,openLeftSider:m,openRightSider:y,onClickToggleLayer:()=>{const B=!m;let F=C;B?F=ya:F=0,S({leftWidth:F,rightWidth:j,centerWidth:a-F-j}),b(B)},onClickToggleSetting:()=>{const B=!y;let F=j;B?F=wa:F=0,S({leftWidth:C,rightWidth:F,centerWidth:a-C-F}),E(B)}})),l.createElement("div",{className:g("content"),style:{top:Cr}},l.createElement(Ua,{split:"vertical",defaultSize:R+j,allowResize:!0,onChange:B=>{const F=a-B,V=B-j;V<100||S({leftWidth:F,rightWidth:j,centerWidth:V})},pane1Style:{width:C},pane2Style:{width:R+j}},l.createElement("div",null,m&&l.createElement(_9,{height:i-Cr,className:g("left"),defaultSelectedElementUUIDs:d,sharedEvent:f,sharedStore:u,useContextMenuOptions:h})),l.createElement("div",{style:{width:w.centerWidth+w.rightWidth,display:"flex",flexDirection:"row"}},l.createElement(W9,{className:g("center"),width:R,height:i-Cr,sharedStore:u,sharedEvent:f,useContextMenuOptions:h}),l.createElement("div",{className:g("right"),style:{width:j,height:i-Cr}},l.createElement(T9,null))))))},[n,m,y,w,i])});function Sd(){return{idraw:null,clipboard:{type:"default",data:null},selectedUUIDs:[]}}function U9(e){const{sharedEvent:t,sharedStore:n}=e;t.on("copy",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=Ca(a,i.elements);o.length>0&&n.set("clipboard",{type:"copy-elements",data:o})}}),t.on("paste",()=>{const r=n.get("idraw"),a=n.get("clipboard"),i=n.get("selectedUUIDs");if(r&&["copy-elements","cut-elements"].includes(a==null?void 0:a.type)&&Array.isArray(a.data)){const o=a.data,s=[];if(a.type==="copy-elements"){for(let h=0;h0&&d[d.length-1]++,s.forEach(h=>{r.addElement(h,{position:d})});const u=r==null?void 0:r.getData(),f=Re(u);t.trigger("dispatch",{type:"update",payload:{editingData:u,treeData:f}}),r.selectElement(s[0].uuid),setTimeout(()=>{t.trigger("scrollToLayer",{uuid:s[0].uuid})},100)}}),t.on("cut",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const c=Ca(a,i.elements);c.length>0&&n.set("clipboard",{type:"cut-elements",data:c.map(d=>Li(d))}),c.forEach(d=>{r==null||r.deleteElement(d.uuid)})}const o=r==null?void 0:r.getData(),s=Re(o);t.trigger("dispatch",{type:"update",payload:{editingData:o,treeData:s}}),r==null||r.trigger(ut)}),t.on("delete",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=Ca(a,i.elements);if(o.length>0){for(let d=0;d{const[t]=Hs("contextMenu"),{sharedEvent:n}=e;return[[{label:t.copy,key:"copy",onClick:()=>{n.trigger("copy")}},{label:t.paste,key:"paste-here",onClick:()=>{n.trigger("paste")}},{label:t.cut,key:"cut",onClick:()=>{n.trigger("cut")}},{label:t.delete,key:"delete",onClick:()=>{n.trigger("delete")}}]]};var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});var X9=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),uo={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},tf={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:X9?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Gs={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var xa=1;xa<20;xa++)Gs["f"+xa]=111+xa;function Ni(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(o){return nf(o,t)}),a=function(s){return r.some(function(c){return rf(c,s)})},i=n==null?a:a(n);return i}function Z9(e,t){return Ni(e,t)}function K9(e,t){return Ni(e,{byKey:!0},t)}function nf(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var o in uo)r[uo[o]]=!1;var s=!0,c=!1,d=void 0;try{for(var u=a[Symbol.iterator](),f;!(s=(f=u.next()).done);s=!0){var h=f.value,p=h.endsWith("?")&&h.length>1;p&&(h=h.slice(0,-1));var v=Vs(h),g=uo[v];if(h.length>1&&!g&&!tf[h]&&!Gs[v])throw new TypeError('Unknown modifier: "'+h+'"');(i===1||!g)&&(n?r.key=v:r.which=af(h)),g&&(r[g]=p?null:!0)}}catch(m){c=!0,d=m}finally{try{!s&&u.return&&u.return()}finally{if(c)throw d}}return r}function rf(e,t){for(var n in e){var r=e[n],a=void 0;if(r!=null&&(n==="key"&&t.key!=null?a=t.key.toLowerCase():n==="which"?a=r===91&&t.which===93?91:t.which:a=t[n],!(a==null&&r===!1)&&a!==r))return!1}return!0}function af(e){e=Vs(e);var t=Gs[e]||e.toUpperCase().charCodeAt(0);return t}function Vs(e){return e=e.toLowerCase(),e=tf[e]||e,e}var mn=Ot.default=Ni;Ot.isHotkey=Ni;Ot.isCodeHotkey=Z9;Ot.isKeyHotkey=K9;Ot.parseHotkey=nf;Ot.compareHotkey=rf;Ot.toKeyCode=af;Ot.toKeyName=Vs;const Q9=(e,t)=>{const{sharedEvent:n}=t;mn("mod+c",e)?n.trigger("copy",void 0):mn("mod+v",e)?n.trigger("paste",void 0):mn("mod+x",e)?n.trigger("cut",void 0):mn("del",e)||mn("backspace",e)?n.trigger("delete",void 0):mn("mod+s",e)&&console.log("Save ... ")},eO=l.forwardRef((e,t)=>{const{width:n=1e3,height:r=600,style:a,className:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,prefiexName:u,onEditGroupElement:f,useContextMenuOptions:h=Y9,handleKeyboard:p=Q9}=e,[v,g]=M.useReducer(b9,v9(e)),m=M.useRef(null),b=M.useRef(new Qt),y=M.useRef(new Br({defaultStorage:Sd()}));return M.useEffect(()=>{const E=Qn(v.editingDataPosition,v.data.elements);f==null||f({uuid:E==null?void 0:E.uuid,position:[...v.editingDataPosition]})},[v.editingDataPosition]),M.useImperativeHandle(t,()=>({getSharedEvent(){return b.current},getSharedStore(){return y.current},dispatch(w){const{type:S,payload:C}=w;g({type:S,payload:C})}}),[]),M.useEffect(()=>(b.current||(b.current=new Qt),y.current||(y.current=new Br({defaultStorage:Sd()})),U9({sharedEvent:b.current,sharedStore:y.current}),()=>{var E,w;(E=y.current)===null||E===void 0||E.clear(),(w=b.current)===null||w===void 0||w.destroy(),b.current=null,y.current=null}),[]),M.useEffect(()=>{const E=y.current;E&&E.set("selectedUUIDs",[...v.selectedUUIDs])},[v.selectedUUIDs]),M.useEffect(()=>{const E=b.current;E==null||E.trigger("switchTheme",{theme:v.themeMode})},[v.themeMode]),M.useEffect(()=>{const E=b.current;E==null||E.trigger("changeLocale",{locale:v.localeCode})},[v.localeCode]),M.useEffect(()=>{const E=b.current;E==null||E.trigger("trackDataChange",{data:v.data})},[v.data]),M.useEffect(()=>{const E=b.current;E==null||E.trigger("trackEditingDataChange",{editingData:v.editingData,editingDataPosition:v.editingDataPosition})},[v.editingData,v.editingDataPosition]),M.useMemo(()=>l.createElement(bf,{localeCode:v.localeCode,container:m.current,topPrefix:u,themeMode:v.themeMode},l.createElement(y9,{value:{state:v,dispatch:g}},l.createElement(V9,{logo:o,navigationMenu:s,navigationCenter:c,ref:m,width:n,height:r,style:a,className:i,defaultSelectedElementUUIDs:d,sharedEvent:b.current,sharedStore:y.current,useContextMenuOptions:h,handleKeyboard:p}))),[u,n,r,v,g,m])});export{eO as S}; diff --git a/package.json b/package.json index a5c5033..9d78dcb 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "vite-node": "^1.2.2" }, "dependencies": { - "@idraw/studio": "0.4.0-alpha.14", + "@idraw/studio": "0.4.0-alpha.15", "antd": "^5.14.0", - "idraw": "0.4.0-beta.14", + "idraw": "0.4.0-beta.15", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a45cbc..8148d9f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,14 +6,14 @@ settings: dependencies: '@idraw/studio': - specifier: 0.4.0-alpha.14 - version: 0.4.0-alpha.14(antd@5.14.0)(idraw@0.4.0-beta.14)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) + specifier: 0.4.0-alpha.15 + version: 0.4.0-alpha.15(antd@5.14.0)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) antd: specifier: ^5.14.0 version: 5.14.0(react-dom@18.2.0)(react@18.2.0) idraw: - specifier: 0.4.0-beta.14 - version: 0.4.0-beta.14 + specifier: 0.4.0-beta.15 + version: 0.4.0-beta.15 react: specifier: ^18.2.0 version: 18.2.0 @@ -567,79 +567,79 @@ packages: react: 18.2.0 dev: false - /@idraw/board@0.4.0-beta.14(@idraw/renderer@0.4.0-beta.14)(@idraw/util@0.4.0-beta.14): - resolution: {integrity: sha512-zExc7ApG40KHMfJYO+Yh7WX+1PrP8davglU2bbBRjyIyoI3LwofU+Fi/CPcTs6FX7AogsRZCsxCmumydiWtOFw==} + /@idraw/board@0.4.0-beta.15(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15): + resolution: {integrity: sha512-p6LbruqZehOhwav5C8E060zrP7cfR8Wm/8nEKR4gtxQKbX6UaOQI5qFPEwpPJmvVglBkq/GO3omdwUq8k67vqg==} peerDependencies: - '@idraw/renderer': ^0.4.0-beta.14 - '@idraw/util': ^0.4.0-beta.14 + '@idraw/renderer': ^0.4.0-beta.15 + '@idraw/util': ^0.4.0-beta.15 dependencies: - '@idraw/renderer': 0.4.0-beta.14(@idraw/util@0.4.0-beta.14) - '@idraw/util': 0.4.0-beta.14 + '@idraw/renderer': 0.4.0-beta.15(@idraw/util@0.4.0-beta.15) + '@idraw/util': 0.4.0-beta.15 dev: false - /@idraw/core@0.4.0-beta.14(@idraw/board@0.4.0-beta.14)(@idraw/renderer@0.4.0-beta.14)(@idraw/util@0.4.0-beta.14): - resolution: {integrity: sha512-ETvPorckR4SsxEu6K6on++j5GLUdxcRFrajn16byF2EIH8w47Bf+NLRxLbxxKzN+BZaymbXb8QLfJJ8V4DWPsg==} + /@idraw/core@0.4.0-beta.15(@idraw/board@0.4.0-beta.15)(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15): + resolution: {integrity: sha512-j9ECmfZ51BfuHilpF7f4glijxBrYqALVN5EUZrsknPAyWcoO4gtpoyTv1MwpX1MJ/I4jivhn9J0HJriRTHkHaA==} peerDependencies: - '@idraw/board': ^0.4.0-beta.14 - '@idraw/renderer': ^0.4.0-beta.14 - '@idraw/util': ^0.4.0-beta.14 + '@idraw/board': ^0.4.0-beta.15 + '@idraw/renderer': ^0.4.0-beta.15 + '@idraw/util': ^0.4.0-beta.15 dependencies: - '@idraw/board': 0.4.0-beta.14(@idraw/renderer@0.4.0-beta.14)(@idraw/util@0.4.0-beta.14) - '@idraw/renderer': 0.4.0-beta.14(@idraw/util@0.4.0-beta.14) - '@idraw/util': 0.4.0-beta.14 + '@idraw/board': 0.4.0-beta.15(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15) + '@idraw/renderer': 0.4.0-beta.15(@idraw/util@0.4.0-beta.15) + '@idraw/util': 0.4.0-beta.15 dev: false - /@idraw/renderer@0.4.0-beta.14(@idraw/util@0.4.0-beta.14): - resolution: {integrity: sha512-bP1NacfhTkpG9SiPvFqUUOZHWxzcW5RlaXgx4m5UVzQtbs7Wp9sgy8a6LcFVUhTU9VI72i1Dct6Obq8X2YqB3w==} + /@idraw/renderer@0.4.0-beta.15(@idraw/util@0.4.0-beta.15): + resolution: {integrity: sha512-9U+McaaPO98JJQhHJKGKqKEPEiQD5KtOQgx/xfkmnMMl1z/B2OBiY9G8IgZzkQY8OI2fjvqgm4opmWIbPeSmkA==} peerDependencies: - '@idraw/util': ^0.4.0-beta.14 + '@idraw/util': ^0.4.0-beta.15 dependencies: - '@idraw/util': 0.4.0-beta.14 + '@idraw/util': 0.4.0-beta.15 dev: false - /@idraw/studio-base@0.4.0-alpha.14(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.14)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-tWCK6XPM1Ok+ZL6jTxv6Ll/S5q1P65X32B+NMmInvC/VroImQVpOQ94IBT+ABGvQXGqxfWDEK9EooSlVujfuxA==} + /@idraw/studio-base@0.4.0-alpha.15(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-NsX5XamyssJJLdlBvrHlDdY0i+7sO1EmgYkS+lyurCZJLKUWaFlsO88QvEZzUrpbbWOy8WZeQeP9ADCd9Pi3xw==} peerDependencies: antd: ^5.12.1 classnames: ^2.3.2 - idraw: ^0.4.0-beta.14 + idraw: ^0.4.0-beta.15 react: ^18.2.0 react-color: ^2.19.3 react-dom: ^18.2.0 dependencies: antd: 5.14.0(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - idraw: 0.4.0-beta.14 + idraw: 0.4.0-beta.15 react: 18.2.0 react-color: 2.19.3(react@18.2.0) react-dom: 18.2.0(react@18.2.0) dev: false - /@idraw/studio@0.4.0-alpha.14(antd@5.14.0)(idraw@0.4.0-beta.14)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Gd5VJcjXasTtS0Cda7Fkeh2/jbdByblscSlghszUntJaycFD5KRZ5AulpFb5NZvL+IdbULbwu9ZoNLrropsyNQ==} + /@idraw/studio@0.4.0-alpha.15(antd@5.14.0)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-22CUYoy5QOkc/2DKWtWSp4I4AMC4WatHd8ulLno12Wv4/IwcxIuCkJfAdUcA/Hk0ZAfXiqF16VCJGB4dHPbcEQ==} peerDependencies: antd: ^5.12.1 - idraw: ^0.4.0-beta.14 + idraw: ^0.4.0-beta.15 react: ^18.2.0 react-color: ^2.19.3 react-dom: ^18.2.0 dependencies: - '@idraw/studio-base': 0.4.0-alpha.14(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.14)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) + '@idraw/studio-base': 0.4.0-alpha.15(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) antd: 5.14.0(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - idraw: 0.4.0-beta.14 + idraw: 0.4.0-beta.15 is-hotkey: 0.2.0 react: 18.2.0 react-color: 2.19.3(react@18.2.0) react-dom: 18.2.0(react@18.2.0) dev: false - /@idraw/types@0.4.0-beta.14: - resolution: {integrity: sha512-VJ9nrEFbTBDrOyQOJrjz0k41LhYJZwSGsBh7IUnGK+QOihUyWMrXam7p2LeeeqrpqvX0dn4mFMGIsuLixmav4Q==} + /@idraw/types@0.4.0-beta.15: + resolution: {integrity: sha512-Tmuwrp1nNVmb6KoxSREB/nhcTMj+dwfwF02fqkHlWBDOnACQ1JlsuvN/YTIxXi55OteUKGNggxZuQ1fV+S7qJg==} dev: false - /@idraw/util@0.4.0-beta.14: - resolution: {integrity: sha512-jPbBdGBtxgPO7YfrjkQiobHR7iXveQQXX92OZPnn34duCcNRjLYjq8O+DDaXbqOxyWXYjl6XhSXl/M4zb9XZgQ==} + /@idraw/util@0.4.0-beta.15: + resolution: {integrity: sha512-0NVkYVXMWS/VdmC43lCz2AtLFyZCp1deGQKLUidoNLR/0EiAdKuPMbPRGXnxOZ83BEpwlIxP3ZozmcZuR9asyQ==} dev: false /@jridgewell/gen-mapping@0.3.3: @@ -1202,14 +1202,14 @@ packages: dev: true optional: true - /idraw@0.4.0-beta.14: - resolution: {integrity: sha512-7zCjOzqsl0u1RwuL+/KSnr5V55TB43YMpF5fGQDz1tfElhWkRuhSebuqDMSfwg53idhzFE3qYOjXN8mYyFpHnQ==} + /idraw@0.4.0-beta.15: + resolution: {integrity: sha512-Sx+9kUI5rw+p5CxELU3LkDYgx3o2X+GAhLm7NN5dzdgxGy3pjhwCgcoPujt9mUYgHTTgBKZqCcwqkr33mMSA2A==} dependencies: - '@idraw/board': 0.4.0-beta.14(@idraw/renderer@0.4.0-beta.14)(@idraw/util@0.4.0-beta.14) - '@idraw/core': 0.4.0-beta.14(@idraw/board@0.4.0-beta.14)(@idraw/renderer@0.4.0-beta.14)(@idraw/util@0.4.0-beta.14) - '@idraw/renderer': 0.4.0-beta.14(@idraw/util@0.4.0-beta.14) - '@idraw/types': 0.4.0-beta.14 - '@idraw/util': 0.4.0-beta.14 + '@idraw/board': 0.4.0-beta.15(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15) + '@idraw/core': 0.4.0-beta.15(@idraw/board@0.4.0-beta.15)(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15) + '@idraw/renderer': 0.4.0-beta.15(@idraw/util@0.4.0-beta.15) + '@idraw/types': 0.4.0-beta.15 + '@idraw/util': 0.4.0-beta.15 dev: false /image-size@0.5.5: