@myoc/element 0.19.518 → 0.19.519

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/dev/index.js +540 -542
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +14 -14
  4. package/dist/types/common/src/colors.d.ts +1 -1
  5. package/dist/types/element/src/bounds.d.ts +18 -1
  6. package/dist/types/element/src/visualdebug.d.ts +1 -2
  7. package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -0
  8. package/dist/types/excalidraw/actions/actionCanvas.d.ts +11 -0
  9. package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -0
  10. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -0
  11. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -0
  12. package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -0
  13. package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -0
  14. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -0
  15. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -0
  16. package/dist/types/excalidraw/actions/actionExport.d.ts +2 -0
  17. package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -0
  18. package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -0
  19. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
  20. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -0
  21. package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -0
  22. package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -0
  23. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -0
  24. package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -0
  25. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -0
  26. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -0
  27. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -0
  28. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -0
  29. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -0
  30. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -0
  31. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +3 -2
  32. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -0
  33. package/dist/types/excalidraw/components/App.d.ts +1 -0
  34. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +7 -4
  35. package/dist/types/excalidraw/data/blob.d.ts +1 -0
  36. package/dist/types/excalidraw/data/json.d.ts +1 -0
  37. package/dist/types/excalidraw/types.d.ts +8 -0
  38. package/dist/types/utils/src/index.d.ts +1 -2
  39. package/package.json +4 -4
  40. package/dist/types/utils/src/bbox.d.ts +0 -9
  41. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -1,31 +1,31 @@
1
- var ip=Object.create;var Ds=Object.defineProperty;var rp=Object.getOwnPropertyDescriptor;var ap=Object.getOwnPropertyNames;var sp=Object.getPrototypeOf,lp=Object.prototype.hasOwnProperty;var dp=(e,t)=>()=>(e&&(t=e(e=0)),t);var bo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var cp=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ap(t))!lp.call(e,i)&&i!==n&&Ds(e,i,{get:()=>t[i],enumerable:!(o=rp(t,i))||o.enumerable});return e};var si=(e,t,n)=>(n=e!=null?ip(sp(e)):{},cp(t||!e||!e.__esModule?Ds(n,"default",{value:e,enumerable:!0}):n,e));var C,I=dp(()=>{C={PROD:!0}});var Hc=bo((_6,Nc)=>{I();var Fc="Expected a function",Oc=NaN,V0="[object Symbol]",U0=/^\s+|\s+$/g,Y0=/^[-+]0x[0-9a-f]+$/i,X0=/^0b[01]+$/i,$0=/^0o[0-7]+$/i,Z0=parseInt,q0=typeof global=="object"&&global&&global.Object===Object&&global,K0=typeof self=="object"&&self&&self.Object===Object&&self,Q0=q0||K0||Function("return this")(),J0=Object.prototype,ef=J0.toString,tf=Math.max,nf=Math.min,is=function(){return Q0.Date.now()};function of(e,t,n){var o,i,r,a,s,l,d=0,c=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(Fc);t=Rc(t)||0,mr(n)&&(c=!!n.leading,u="maxWait"in n,r=u?tf(Rc(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h);function m(S){var v=o,L=i;return o=i=void 0,d=S,a=e.apply(L,v),a}function f(S){return d=S,s=setTimeout(x,t),c?m(S):a}function g(S){var v=S-l,L=S-d,T=t-v;return u?nf(T,r-L):T}function E(S){var v=S-l,L=S-d;return l===void 0||v>=t||v<0||u&&L>=r}function x(){var S=is();if(E(S))return y(S);s=setTimeout(x,g(S))}function y(S){return s=void 0,h&&o?m(S):(o=i=void 0,a)}function w(){s!==void 0&&clearTimeout(s),d=0,o=l=i=s=void 0}function M(){return s===void 0?a:y(is())}function b(){var S=is(),v=E(S);if(o=arguments,i=this,l=S,v){if(s===void 0)return f(l);if(u)return s=setTimeout(x,t),m(l)}return s===void 0&&(s=setTimeout(x,t)),a}return b.cancel=w,b.flush=M,b}function rf(e,t,n){var o=!0,i=!0;if(typeof e!="function")throw new TypeError(Fc);return mr(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),of(e,t,{leading:o,maxWait:t,trailing:i})}function mr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function af(e){return!!e&&typeof e=="object"}function sf(e){return typeof e=="symbol"||af(e)&&ef.call(e)==V0}function Rc(e){if(typeof e=="number")return e;if(sf(e))return Oc;if(mr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=mr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(U0,"");var n=X0.test(e);return n||$0.test(e)?Z0(e.slice(2),n?2:8):Y0.test(e)?Oc:+e}Nc.exports=rf});var Fu=bo(J=>{"use strict";I();var Is=Symbol.for("react.transitional.element"),Mg=Symbol.for("react.portal"),Pg=Symbol.for("react.fragment"),Ig=Symbol.for("react.strict_mode"),Sg=Symbol.for("react.profiler"),vg=Symbol.for("react.consumer"),Ag=Symbol.for("react.context"),kg=Symbol.for("react.forward_ref"),Tg=Symbol.for("react.suspense"),Lg=Symbol.for("react.memo"),Cu=Symbol.for("react.lazy"),vu=Symbol.iterator;function Cg(e){return e===null||typeof e!="object"?null:(e=vu&&e[vu]||e["@@iterator"],typeof e=="function"?e:null)}var Bu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Du=Object.assign,Gu={};function yo(e,t,n){this.props=e,this.context=t,this.refs=Gu,this.updater=n||Bu}yo.prototype.isReactComponent={};yo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};yo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ou(){}Ou.prototype=yo.prototype;function Ss(e,t,n){this.props=e,this.context=t,this.refs=Gu,this.updater=n||Bu}var vs=Ss.prototype=new Ou;vs.constructor=Ss;Du(vs,yo.prototype);vs.isPureReactComponent=!0;var Au=Array.isArray,fe={H:null,A:null,T:null,S:null},Ru=Object.prototype.hasOwnProperty;function As(e,t,n,o,i,r){return n=r.ref,{$$typeof:Is,type:e,key:t,ref:n!==void 0?n:null,props:r}}function Bg(e,t){return As(e.type,t,void 0,void 0,void 0,e.props)}function ks(e){return typeof e=="object"&&e!==null&&e.$$typeof===Is}function Dg(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ku=/\/+/g;function Ps(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Dg(""+e.key):t.toString(36)}function Tu(){}function Gg(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Tu,Tu):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function xo(e,t,n,o,i){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(r){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Is:case Mg:a=!0;break;case Cu:return a=e._init,xo(a(e._payload),t,n,o,i)}}if(a)return i=i(e),a=o===""?"."+Ps(e,0):o,Au(i)?(n="",a!=null&&(n=a.replace(ku,"$&/")+"/"),xo(i,t,n,"",function(d){return d})):i!=null&&(ks(i)&&(i=Bg(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(ku,"$&/")+"/")+a)),t.push(i)),1;a=0;var s=o===""?".":o+":";if(Au(e))for(var l=0;l<e.length;l++)o=e[l],r=s+Ps(o,l),a+=xo(o,t,n,r,i);else if(l=Cg(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,r=s+Ps(o,l++),a+=xo(o,t,n,r,i);else if(r==="object"){if(typeof e.then=="function")return xo(Gg(e),t,n,o,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function vr(e,t,n){if(e==null)return e;var o=[],i=0;return xo(e,o,"","",function(r){return t.call(n,r,i++)}),o}function Og(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Rg(){}J.Children={map:vr,forEach:function(e,t,n){vr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return vr(e,function(){t++}),t},toArray:function(e){return vr(e,function(t){return t})||[]},only:function(e){if(!ks(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};J.Component=yo;J.Fragment=Pg;J.Profiler=Sg;J.PureComponent=Ss;J.StrictMode=Ig;J.Suspense=Tg;J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=fe;J.act=function(){throw Error("act(...) is not supported in production builds of React.")};J.cache=function(e){return function(){return e.apply(null,arguments)}};J.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Du({},e.props),i=e.key,r=void 0;if(t!=null)for(a in t.ref!==void 0&&(r=void 0),t.key!==void 0&&(i=""+t.key),t)!Ru.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(o[a]=t[a]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];o.children=s}return As(e.type,i,void 0,void 0,r,o)};J.createContext=function(e){return e={$$typeof:Ag,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:vg,_context:e},e};J.createElement=function(e,t,n){var o,i={},r=null;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)Ru.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(i[o]=t[o]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)i[o]===void 0&&(i[o]=a[o]);return As(e,r,void 0,void 0,null,i)};J.createRef=function(){return{current:null}};J.forwardRef=function(e){return{$$typeof:kg,render:e}};J.isValidElement=ks;J.lazy=function(e){return{$$typeof:Cu,_payload:{_status:-1,_result:e},_init:Og}};J.memo=function(e,t){return{$$typeof:Lg,type:e,compare:t===void 0?null:t}};J.startTransition=function(e){var t=fe.T,n={};fe.T=n;try{var o=e(),i=fe.S;i!==null&&i(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Rg,Lu)}catch(r){Lu(r)}finally{fe.T=t}};J.unstable_useCacheRefresh=function(){return fe.H.useCacheRefresh()};J.use=function(e){return fe.H.use(e)};J.useActionState=function(e,t,n){return fe.H.useActionState(e,t,n)};J.useCallback=function(e,t){return fe.H.useCallback(e,t)};J.useContext=function(e){return fe.H.useContext(e)};J.useDebugValue=function(){};J.useDeferredValue=function(e,t){return fe.H.useDeferredValue(e,t)};J.useEffect=function(e,t){return fe.H.useEffect(e,t)};J.useId=function(){return fe.H.useId()};J.useImperativeHandle=function(e,t,n){return fe.H.useImperativeHandle(e,t,n)};J.useInsertionEffect=function(e,t){return fe.H.useInsertionEffect(e,t)};J.useLayoutEffect=function(e,t){return fe.H.useLayoutEffect(e,t)};J.useMemo=function(e,t){return fe.H.useMemo(e,t)};J.useOptimistic=function(e,t){return fe.H.useOptimistic(e,t)};J.useReducer=function(e,t,n){return fe.H.useReducer(e,t,n)};J.useRef=function(e){return fe.H.useRef(e)};J.useState=function(e){return fe.H.useState(e)};J.useSyncExternalStore=function(e,t,n){return fe.H.useSyncExternalStore(e,t,n)};J.useTransition=function(){return fe.H.useTransition()};J.version="19.0.0"});var Hu=bo((OM,Nu)=>{"use strict";I();Nu.exports=Fu()});var Wu=bo(Ar=>{"use strict";I();var Fg=Symbol.for("react.transitional.element"),Ng=Symbol.for("react.fragment");function zu(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:Fg,type:e,key:o,ref:t!==void 0?t:null,props:n}}Ar.Fragment=Ng;Ar.jsx=zu;Ar.jsxs=zu});var Ts=bo((HM,_u)=>{"use strict";I();_u.exports=Wu()});I();import{toIterable as eE}from"@excalidraw/common";I();import{SHIFT_LOCKING_ANGLE as rn,viewportCoordsToSceneCoords as ur}from"@excalidraw/common";import{normalizeRadians as yc,radiansBetweenAngles as c0,radiansDifference as u0}from"@excalidraw/math";import{pointsEqual as p0}from"@excalidraw/math";I();I();I();I();I();I();I();I();I();function Br(e,t,n){if(e&&e.length){let[o,i]=t,r=Math.PI/180*n,a=Math.cos(r),s=Math.sin(r);for(let l of e){let[d,c]=l;l[0]=(d-o)*a-(c-i)*s+o,l[1]=(d-o)*s+(c-i)*a+i}}}function pp(e,t,n){let o=[];e.forEach(i=>o.push(...i)),Br(o,t,n)}function hp(e,t){return e[0]===t[0]&&e[1]===t[1]}function Gs(e,t,n,o=1){let i=n,r=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,s=[0,0];if(i)for(let d of a)Br(d,s,i);let l=mp(a,r,o);if(i){for(let d of a)Br(d,s,-i);pp(l,s,-i)}return l}function mp(e,t,n){let o=[];for(let d of e){let c=[...d];hp(c[0],c[c.length-1])||c.push([c[0][0],c[0][1]]),c.length>2&&o.push(c)}let i=[];t=Math.max(t,.1);let r=[];for(let d of o)for(let c=0;c<d.length-1;c++){let u=d[c],h=d[c+1];if(u[1]!==h[1]){let m=Math.min(u[1],h[1]);r.push({ymin:m,ymax:Math.max(u[1],h[1]),x:m===u[1]?u[0]:h[0],islope:(h[0]-u[0])/(h[1]-u[1])})}}if(r.sort((d,c)=>d.ymin<c.ymin?-1:d.ymin>c.ymin?1:d.x<c.x?-1:d.x>c.x?1:d.ymax===c.ymax?0:(d.ymax-c.ymax)/Math.abs(d.ymax-c.ymax)),!r.length)return i;let a=[],s=r[0].ymin,l=0;for(;a.length||r.length;){if(r.length){let d=-1;for(let u=0;u<r.length&&!(r[u].ymin>s);u++)d=u;r.splice(0,d+1).forEach(u=>{a.push({s,edge:u})})}if(a=a.filter(d=>!(d.edge.ymax<=s)),a.sort((d,c)=>d.edge.x===c.edge.x?0:(d.edge.x-c.edge.x)/Math.abs(d.edge.x-c.edge.x)),(n!==1||l%t===0)&&a.length>1)for(let d=0;d<a.length;d=d+2){let c=d+1;if(c>=a.length)break;let u=a[d].edge,h=a[c].edge;i.push([[Math.round(u.x),s],[Math.round(h.x),s]])}s+=n,a.forEach(d=>{d.edge.x=d.edge.x+n*d.edge.islope}),l++}return i}function Lt(e,t){var n;let o=t.hachureAngle+90,i=t.hachureGap;i<0&&(i=t.strokeWidth*4),i=Math.max(i,.1);let r=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(r=i),Gs(e,i,o,r||1)}var dn=class{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){let o=Lt(t,n);return{type:"fillSketch",ops:this.renderLines(o,n)}}renderLines(t,n){let o=[];for(let i of t)o.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],n));return o}};I();I();function cn(e){let t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}var li=class extends dn{fillPolygons(t,n){let o=n.hachureGap;o<0&&(o=n.strokeWidth*4),o=Math.max(o,.1);let i=Object.assign({},n,{hachureGap:o}),r=Lt(t,i),a=Math.PI/180*n.hachureAngle,s=[],l=o*.5*Math.cos(a),d=o*.5*Math.sin(a);for(let[u,h]of r)cn([u,h])&&s.push([[u[0]-l,u[1]+d],[...h]],[[u[0]+l,u[1]-d],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,n)}}};I();var di=class extends dn{fillPolygons(t,n){let o=this._fillPolygons(t,n),i=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),r=this._fillPolygons(t,i);return o.ops=o.ops.concat(r.ops),o}};I();var ci=class{constructor(t){this.helper=t}fillPolygons(t,n){n=Object.assign({},n,{hachureAngle:0});let o=Lt(t,n);return this.dotsOnLines(o,n)}dotsOnLines(t,n){let o=[],i=n.hachureGap;i<0&&(i=n.strokeWidth*4),i=Math.max(i,.1);let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let a=i/4;for(let s of t){let l=cn(s),d=l/i,c=Math.ceil(d)-1,u=l-c*i,h=(s[0][0]+s[1][0])/2-i/4,m=Math.min(s[0][1],s[1][1]);for(let f=0;f<c;f++){let g=m+u+f*i,E=h-a+Math.random()*2*a,x=g-a+Math.random()*2*a,y=this.helper.ellipse(E,x,r,r,n);o.push(...y.ops)}}return{type:"fillSketch",ops:o}}};I();var ui=class{constructor(t){this.helper=t}fillPolygons(t,n){let o=Lt(t,n);return{type:"fillSketch",ops:this.dashedLine(o,n)}}dashedLine(t,n){let o=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,i=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,r=[];return t.forEach(a=>{let s=cn(a),l=Math.floor(s/(o+i)),d=(s+i-l*(o+i))/2,c=a[0],u=a[1];c[0]>u[0]&&(c=a[1],u=a[0]);let h=Math.atan((u[1]-c[1])/(u[0]-c[0]));for(let m=0;m<l;m++){let f=m*(o+i),g=f+o,E=[c[0]+f*Math.cos(h)+d*Math.cos(h),c[1]+f*Math.sin(h)+d*Math.sin(h)],x=[c[0]+g*Math.cos(h)+d*Math.cos(h),c[1]+g*Math.sin(h)+d*Math.sin(h)];r.push(...this.helper.doubleLineOps(E[0],E[1],x[0],x[1],n))}}),r}};I();var pi=class{constructor(t){this.helper=t}fillPolygons(t,n){let o=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,i=n.zigzagOffset<0?o:n.zigzagOffset;n=Object.assign({},n,{hachureGap:o+i});let r=Lt(t,n);return{type:"fillSketch",ops:this.zigzagLines(r,i,n)}}zigzagLines(t,n,o){let i=[];return t.forEach(r=>{let a=cn(r),s=Math.round(a/(2*n)),l=r[0],d=r[1];l[0]>d[0]&&(l=r[1],d=r[0]);let c=Math.atan((d[1]-l[1])/(d[0]-l[0]));for(let u=0;u<s;u++){let h=u*2*n,m=(u+1)*2*n,f=Math.sqrt(2*Math.pow(n,2)),g=[l[0]+h*Math.cos(c),l[1]+h*Math.sin(c)],E=[l[0]+m*Math.cos(c),l[1]+m*Math.sin(c)],x=[g[0]+f*Math.cos(c+Math.PI/4),g[1]+f*Math.sin(c+Math.PI/4)];i.push(...this.helper.doubleLineOps(g[0],g[1],x[0],x[1],o),...this.helper.doubleLineOps(x[0],x[1],E[0],E[1],o))}}),i}};var Ue={};function Os(e,t){let n=e.fillStyle||"hachure";if(!Ue[n])switch(n){case"zigzag":Ue[n]||(Ue[n]=new li(t));break;case"cross-hatch":Ue[n]||(Ue[n]=new di(t));break;case"dots":Ue[n]||(Ue[n]=new ci(t));break;case"dashed":Ue[n]||(Ue[n]=new ui(t));break;case"zigzag-line":Ue[n]||(Ue[n]=new pi(t));break;case"hachure":default:n="hachure",Ue[n]||(Ue[n]=new dn(t));break}return Ue[n]}I();function Rs(){return Math.floor(Math.random()*2**31)}var hi=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};I();I();var mi={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function fp(e){let t=new Array;for(;e!=="";)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:2,text:""},t}function Dr(e,t){return e.type===t}function Jn(e){let t=[],n=fp(e),o="BOD",i=0,r=n[i];for(;!Dr(r,2);){let a=0,s=[];if(o==="BOD")if(r.text==="M"||r.text==="m")i++,a=mi[r.text],o=r.text;else return Jn("M0,0"+e);else Dr(r,1)?a=mi[o]:(i++,a=mi[r.text],o=r.text);if(i+a<n.length){for(let l=i;l<i+a;l++){let d=n[l];if(Dr(d,1))s[s.length]=+d.text;else throw new Error("Param not a number: "+o+","+d.text)}if(typeof mi[o]=="number"){let l={key:o,data:s};t.push(l),i+=a,r=n[i],o==="M"&&(o="L"),o==="m"&&(o="l")}else throw new Error("Bad segment: "+o)}else throw new Error("Path data ended short")}return t}I();function Mo(e){let t=0,n=0,o=0,i=0,r=[];for(let{key:a,data:s}of e)switch(a){case"M":r.push({key:"M",data:[...s]}),[t,n]=s,[o,i]=s;break;case"m":t+=s[0],n+=s[1],r.push({key:"M",data:[t,n]}),o=t,i=n;break;case"L":r.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],r.push({key:"L",data:[t,n]});break;case"C":r.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{let l=s.map((d,c)=>c%2?d+n:d+t);r.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":r.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{let l=s.map((d,c)=>c%2?d+n:d+t);r.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":r.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],r.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":r.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],r.push({key:"H",data:[t]});break;case"V":r.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],r.push({key:"V",data:[n]});break;case"S":r.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{let l=s.map((d,c)=>c%2?d+n:d+t);r.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":r.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],r.push({key:"T",data:[t,n]});break;case"Z":case"z":r.push({key:"Z",data:[]}),t=o,n=i;break}return r}I();function Io(e){let t=[],n="",o=0,i=0,r=0,a=0,s=0,l=0;for(let{key:d,data:c}of e){switch(d){case"M":t.push({key:"M",data:[...c]}),[o,i]=c,[r,a]=c;break;case"C":t.push({key:"C",data:[...c]}),o=c[4],i=c[5],s=c[2],l=c[3];break;case"L":t.push({key:"L",data:[...c]}),[o,i]=c;break;case"H":o=c[0],t.push({key:"L",data:[o,i]});break;case"V":i=c[0],t.push({key:"L",data:[o,i]});break;case"S":{let u=0,h=0;n==="C"||n==="S"?(u=o+(o-s),h=i+(i-l)):(u=o,h=i),t.push({key:"C",data:[u,h,...c]}),s=c[0],l=c[1],o=c[2],i=c[3];break}case"T":{let[u,h]=c,m=0,f=0;n==="Q"||n==="T"?(m=o+(o-s),f=i+(i-l)):(m=o,f=i);let g=o+2*(m-o)/3,E=i+2*(f-i)/3,x=u+2*(m-u)/3,y=h+2*(f-h)/3;t.push({key:"C",data:[g,E,x,y,u,h]}),s=m,l=f,o=u,i=h;break}case"Q":{let[u,h,m,f]=c,g=o+2*(u-o)/3,E=i+2*(h-i)/3,x=m+2*(u-m)/3,y=f+2*(h-f)/3;t.push({key:"C",data:[g,E,x,y,m,f]}),s=u,l=h,o=m,i=f;break}case"A":{let u=Math.abs(c[0]),h=Math.abs(c[1]),m=c[2],f=c[3],g=c[4],E=c[5],x=c[6];u===0||h===0?(t.push({key:"C",data:[o,i,E,x,E,x]}),o=E,i=x):(o!==E||i!==x)&&(Fs(o,i,E,x,u,h,m,f,g).forEach(function(w){t.push({key:"C",data:w})}),o=E,i=x);break}case"Z":t.push({key:"Z",data:[]}),o=r,i=a;break}n=d}return t}function gp(e){return Math.PI*e/180}function Po(e,t,n){let o=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return[o,i]}function Fs(e,t,n,o,i,r,a,s,l,d){let c=gp(a),u=[],h=0,m=0,f=0,g=0;if(d)[h,m,f,g]=d;else{[e,t]=Po(e,t,-c),[n,o]=Po(n,o,-c);let F=(e-n)/2,O=(t-o)/2,K=F*F/(i*i)+O*O/(r*r);K>1&&(K=Math.sqrt(K),i=K*i,r=K*r);let Y=s===l?-1:1,se=i*i,H=r*r,A=se*H-se*O*O-H*F*F,_=se*O*O+H*F*F,X=Y*Math.sqrt(Math.abs(A/_));f=X*i*O/r+(e+n)/2,g=X*-r*F/i+(t+o)/2,h=Math.asin(parseFloat(((t-g)/r).toFixed(9))),m=Math.asin(parseFloat(((o-g)/r).toFixed(9))),e<f&&(h=Math.PI-h),n<f&&(m=Math.PI-m),h<0&&(h=Math.PI*2+h),m<0&&(m=Math.PI*2+m),l&&h>m&&(h=h-Math.PI*2),!l&&m>h&&(m=m-Math.PI*2)}let E=m-h;if(Math.abs(E)>Math.PI*120/180){let F=m,O=n,K=o;l&&m>h?m=h+Math.PI*120/180*1:m=h+Math.PI*120/180*-1,n=f+i*Math.cos(m),o=g+r*Math.sin(m),u=Fs(n,o,O,K,i,r,a,0,l,[m,F,f,g])}E=m-h;let x=Math.cos(h),y=Math.sin(h),w=Math.cos(m),M=Math.sin(m),b=Math.tan(E/4),S=4/3*i*b,v=4/3*r*b,L=[e,t],T=[e+S*y,t-v*x],D=[n+S*M,o-v*w],B=[n,o];if(T[0]=2*L[0]-T[0],T[1]=2*L[1]-T[1],d)return[T,D,B].concat(u);{u=[T,D,B].concat(u);let F=[];for(let O=0;O<u.length;O+=3){let K=Po(u[O][0],u[O][1],c),Y=Po(u[O+1][0],u[O+1][1],c),se=Po(u[O+2][0],u[O+2][1],c);F.push([K[0],K[1],Y[0],Y[1],se[0],se[1]])}return F}}var Ep={randOffset:wp,randOffsetWithRange:bp,ellipse:yp,doubleLineOps:Mp};function Gr(e,t,n,o,i){return{type:"path",ops:Wt(e,t,n,o,i)}}function So(e,t,n){let o=(e||[]).length;if(o>2){let i=[];for(let r=0;r<o-1;r++)i.push(...Wt(e[r][0],e[r][1],e[r+1][0],e[r+1][1],n));return t&&i.push(...Wt(e[o-1][0],e[o-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}else if(o===2)return Gr(e[0][0],e[0][1],e[1][0],e[1][1],n);return{type:"path",ops:[]}}function xp(e,t){return So(e,!0,t)}function _s(e,t,n,o,i){let r=[[e,t],[e+n,t],[e+n,t+o],[e,t+o]];return xp(r,i)}function Or(e,t){let n=Hs(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){let o=Hs(e,1.5*(1+t.roughness*.22),Pp(t));n=n.concat(o)}return{type:"path",ops:n}}function yp(e,t,n,o,i){let r=Rr(n,o,i);return Ei(e,t,i,r).opset}function Rr(e,t,n){let o=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*o)),r=Math.PI*2/i,a=Math.abs(e/2),s=Math.abs(t/2),l=1-n.curveFitting;return a+=z(a*l,n),s+=z(s*l,n),{increment:r,rx:a,ry:s}}function Ei(e,t,n,o){let[i,r]=zs(o.increment,e,t,o.rx,o.ry,1,o.increment*fi(.1,fi(.4,1,n),n),n),a=gi(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[s]=zs(o.increment,e,t,o.rx,o.ry,1.5,0,n),l=gi(s,null,n);a=a.concat(l)}return{estimatedPoints:r,opset:{type:"path",ops:a}}}function Fr(e,t,n,o,i,r,a,s,l){let d=e,c=t,u=Math.abs(n/2),h=Math.abs(o/2);u+=z(u*.01,l),h+=z(h*.01,l);let m=i,f=r;for(;m<0;)m+=Math.PI*2,f+=Math.PI*2;f-m>Math.PI*2&&(m=0,f=Math.PI*2);let g=Math.PI*2/l.curveStepCount,E=Math.min(g/2,(f-m)/2),x=Ws(E,d,c,u,h,m,f,1,l);if(!l.disableMultiStroke){let y=Ws(E,d,c,u,h,m,f,1.5,l);x.push(...y)}return a&&(s?x.push(...Wt(d,c,d+u*Math.cos(m),c+h*Math.sin(m),l),...Wt(d,c,d+u*Math.cos(f),c+h*Math.sin(f),l)):x.push({op:"lineTo",data:[d,c]},{op:"lineTo",data:[d+u*Math.cos(m),c+h*Math.sin(m)]})),{type:"path",ops:x}}function Nr(e,t){let n=Io(Mo(Jn(e))),o=[],i=[0,0],r=[0,0];for(let{key:a,data:s}of n)switch(a){case"M":{r=[s[0],s[1]],i=[s[0],s[1]];break}case"L":o.push(...Wt(r[0],r[1],s[0],s[1],t)),r=[s[0],s[1]];break;case"C":{let[l,d,c,u,h,m]=s;o.push(...Ip(l,d,c,u,h,m,r,t)),r=[h,m];break}case"Z":o.push(...Wt(r[0],r[1],i[0],i[1],t)),r=[i[0],i[1]];break}return{type:"path",ops:o}}function xi(e,t){let n=[];for(let o of e)if(o.length){let i=t.maxRandomnessOffset||0,r=o.length;if(r>2){n.push({op:"move",data:[o[0][0]+z(i,t),o[0][1]+z(i,t)]});for(let a=1;a<r;a++)n.push({op:"lineTo",data:[o[a][0]+z(i,t),o[a][1]+z(i,t)]})}}return{type:"fillPath",ops:n}}function Fn(e,t){return Os(t,Ep).fillPolygons(e,t)}function js(e,t,n,o,i,r,a){let s=e,l=t,d=Math.abs(n/2),c=Math.abs(o/2);d+=z(d*.01,a),c+=z(c*.01,a);let u=i,h=r;for(;u<0;)u+=Math.PI*2,h+=Math.PI*2;h-u>Math.PI*2&&(u=0,h=Math.PI*2);let m=(h-u)/a.curveStepCount,f=[];for(let g=u;g<=h;g=g+m)f.push([s+d*Math.cos(g),l+c*Math.sin(g)]);return f.push([s+d*Math.cos(h),l+c*Math.sin(h)]),f.push([s,l]),Fn([f],a)}function wp(e,t){return z(e,t)}function bp(e,t,n){return fi(e,t,n)}function Mp(e,t,n,o,i){return Wt(e,t,n,o,i,!0)}function Pp(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Vs(e){return e.randomizer||(e.randomizer=new hi(e.seed||0)),e.randomizer.next()}function fi(e,t,n,o=1){return n.roughness*o*(Vs(n)*(t-e)+e)}function z(e,t,n=1){return fi(-e,e,t,n)}function Wt(e,t,n,o,i,r=!1){let a=r?i.disableMultiStrokeFill:i.disableMultiStroke,s=Ns(e,t,n,o,i,!0,!1);if(a)return s;let l=Ns(e,t,n,o,i,!0,!0);return s.concat(l)}function Ns(e,t,n,o,i,r,a){let s=Math.pow(e-n,2)+Math.pow(t-o,2),l=Math.sqrt(s),d=1;l<200?d=1:l>500?d=.4:d=-.0016668*l+1.233334;let c=i.maxRandomnessOffset||0;c*c*100>s&&(c=l/10);let u=c/2,h=.2+Vs(i)*.2,m=i.bowing*i.maxRandomnessOffset*(o-t)/200,f=i.bowing*i.maxRandomnessOffset*(e-n)/200;m=z(m,i,d),f=z(f,i,d);let g=[],E=()=>z(u,i,d),x=()=>z(c,i,d),y=i.preserveVertices;return r&&(a?g.push({op:"move",data:[e+(y?0:E()),t+(y?0:E())]}):g.push({op:"move",data:[e+(y?0:z(c,i,d)),t+(y?0:z(c,i,d))]})),a?g.push({op:"bcurveTo",data:[m+e+(n-e)*h+E(),f+t+(o-t)*h+E(),m+e+2*(n-e)*h+E(),f+t+2*(o-t)*h+E(),n+(y?0:E()),o+(y?0:E())]}):g.push({op:"bcurveTo",data:[m+e+(n-e)*h+x(),f+t+(o-t)*h+x(),m+e+2*(n-e)*h+x(),f+t+2*(o-t)*h+x(),n+(y?0:x()),o+(y?0:x())]}),g}function Hs(e,t,n){let o=[];o.push([e[0][0]+z(t,n),e[0][1]+z(t,n)]),o.push([e[0][0]+z(t,n),e[0][1]+z(t,n)]);for(let i=1;i<e.length;i++)o.push([e[i][0]+z(t,n),e[i][1]+z(t,n)]),i===e.length-1&&o.push([e[i][0]+z(t,n),e[i][1]+z(t,n)]);return gi(o,null,n)}function gi(e,t,n){let o=e.length,i=[];if(o>3){let r=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let s=1;s+2<o;s++){let l=e[s];r[0]=[l[0],l[1]],r[1]=[l[0]+(a*e[s+1][0]-a*e[s-1][0])/6,l[1]+(a*e[s+1][1]-a*e[s-1][1])/6],r[2]=[e[s+1][0]+(a*e[s][0]-a*e[s+2][0])/6,e[s+1][1]+(a*e[s][1]-a*e[s+2][1])/6],r[3]=[e[s+1][0],e[s+1][1]],i.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}if(t&&t.length===2){let s=n.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+z(s,n),t[1]+z(s,n)]})}}else o===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):o===2&&i.push(...Wt(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function zs(e,t,n,o,i,r,a,s){let l=s.roughness===0,d=[],c=[];if(l){e=e/4,c.push([t+o*Math.cos(-e),n+i*Math.sin(-e)]);for(let u=0;u<=Math.PI*2;u=u+e){let h=[t+o*Math.cos(u),n+i*Math.sin(u)];d.push(h),c.push(h)}c.push([t+o*Math.cos(0),n+i*Math.sin(0)]),c.push([t+o*Math.cos(e),n+i*Math.sin(e)])}else{let u=z(.5,s)-Math.PI/2;c.push([z(r,s)+t+.9*o*Math.cos(u-e),z(r,s)+n+.9*i*Math.sin(u-e)]);let h=Math.PI*2+u-.01;for(let m=u;m<h;m=m+e){let f=[z(r,s)+t+o*Math.cos(m),z(r,s)+n+i*Math.sin(m)];d.push(f),c.push(f)}c.push([z(r,s)+t+o*Math.cos(u+Math.PI*2+a*.5),z(r,s)+n+i*Math.sin(u+Math.PI*2+a*.5)]),c.push([z(r,s)+t+.98*o*Math.cos(u+a),z(r,s)+n+.98*i*Math.sin(u+a)]),c.push([z(r,s)+t+.9*o*Math.cos(u+a*.5),z(r,s)+n+.9*i*Math.sin(u+a*.5)])}return[c,d]}function Ws(e,t,n,o,i,r,a,s,l){let d=r+z(.1,l),c=[];c.push([z(s,l)+t+.9*o*Math.cos(d-e),z(s,l)+n+.9*i*Math.sin(d-e)]);for(let u=d;u<=a;u=u+e)c.push([z(s,l)+t+o*Math.cos(u),z(s,l)+n+i*Math.sin(u)]);return c.push([t+o*Math.cos(a),n+i*Math.sin(a)]),c.push([t+o*Math.cos(a),n+i*Math.sin(a)]),gi(c,null,l)}function Ip(e,t,n,o,i,r,a,s){let l=[],d=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],c=[0,0],u=s.disableMultiStroke?1:2,h=s.preserveVertices;for(let m=0;m<u;m++)m===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(h?0:z(d[0],s)),a[1]+(h?0:z(d[0],s))]}),c=h?[i,r]:[i+z(d[m],s),r+z(d[m],s)],l.push({op:"bcurveTo",data:[e+z(d[m],s),t+z(d[m],s),n+z(d[m],s),o+z(d[m],s),c[0],c[1]]});return l}I();function vo(e){return[...e]}function Us(e,t=0){let n=e.length;if(n<3)throw new Error("A curve must have at least three points.");let o=[];if(n===3)o.push(vo(e[0]),vo(e[1]),vo(e[2]),vo(e[2]));else{let i=[];i.push(e[0],e[0]);for(let s=1;s<e.length;s++)i.push(e[s]),s===e.length-1&&i.push(e[s]);let r=[],a=1-t;o.push(vo(i[0]));for(let s=1;s+2<i.length;s++){let l=i[s];r[0]=[l[0],l[1]],r[1]=[l[0]+(a*i[s+1][0]-a*i[s-1][0])/6,l[1]+(a*i[s+1][1]-a*i[s-1][1])/6],r[2]=[i[s+1][0]+(a*i[s][0]-a*i[s+2][0])/6,i[s+1][1]+(a*i[s][1]-a*i[s+2][1])/6],r[3]=[i[s+1][0],i[s+1][1]],o.push(r[1],r[2],r[3])}}return o}I();function Sp(e,t){return Math.sqrt(yi(e,t))}function yi(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function vp(e,t,n){let o=yi(t,n);if(o===0)return yi(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/o;return i=Math.max(0,Math.min(1,i)),yi(e,Nn(t,n,i))}function Nn(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Ap(e,t){let n=e[t+0],o=e[t+1],i=e[t+2],r=e[t+3],a=3*o[0]-2*n[0]-r[0];a*=a;let s=3*o[1]-2*n[1]-r[1];s*=s;let l=3*i[0]-2*r[0]-n[0];l*=l;let d=3*i[1]-2*r[1]-n[1];return d*=d,a<l&&(a=l),s<d&&(s=d),a+s}function Hr(e,t,n,o){let i=o||[];if(Ap(e,t)<n){let r=e[t+0];i.length?Sp(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{let a=e[t+0],s=e[t+1],l=e[t+2],d=e[t+3],c=Nn(a,s,.5),u=Nn(s,l,.5),h=Nn(l,d,.5),m=Nn(c,u,.5),f=Nn(u,h,.5),g=Nn(m,f,.5);Hr([a,c,m,g],0,n,i),Hr([g,f,h,d],0,n,i)}return i}function Ao(e,t){return wi(e,0,e.length,t)}function wi(e,t,n,o,i){let r=i||[],a=e[t],s=e[n-1],l=0,d=1;for(let c=t+1;c<n-1;++c){let u=vp(e[c],a,s);u>l&&(l=u,d=c)}return Math.sqrt(l)>o?(wi(e,t,d+1,o,r),wi(e,d,n,o,r)):(r.length||r.push(a),r.push(s)),r}function _t(e,t=.15,n){let o=[],i=(e.length-1)/3;for(let r=0;r<i;r++){let a=r*3;Hr(e,a,t,o)}return n&&n>0?wi(o,0,o.length,n):o}I();function Ys(e,t,n){let o=Jn(e),i=Io(Mo(o)),r=[],a=[],s=[0,0],l=[],d=()=>{l.length>=4&&a.push(..._t(l,t)),l=[]},c=()=>{d(),a.length&&(r.push(a),a=[])};for(let{key:h,data:m}of i)switch(h){case"M":c(),s=[m[0],m[1]],a.push(s);break;case"L":d(),a.push([m[0],m[1]]);break;case"C":if(!l.length){let f=a.length?a[a.length-1]:s;l.push([f[0],f[1]])}l.push([m[0],m[1]]),l.push([m[2],m[3]]),l.push([m[4],m[5]]);break;case"Z":d(),a.push([s[0],s[1]]);break}if(c(),!n)return r;let u=[];for(let h of r){let m=Ao(h,n);m.length&&u.push(m)}return u}var tt="none",dt=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Rs()}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,o){return{shape:t,sets:n||[],options:o||this.defaultOptions}}line(t,n,o,i,r){let a=this._o(r);return this._d("line",[Gr(t,n,o,i,a)],a)}rectangle(t,n,o,i,r){let a=this._o(r),s=[],l=_s(t,n,o,i,a);if(a.fill){let d=[[t,n],[t+o,n],[t+o,n+i],[t,n+i]];a.fillStyle==="solid"?s.push(xi([d],a)):s.push(Fn([d],a))}return a.stroke!==tt&&s.push(l),this._d("rectangle",s,a)}ellipse(t,n,o,i,r){let a=this._o(r),s=[],l=Rr(o,i,a),d=Ei(t,n,a,l);if(a.fill)if(a.fillStyle==="solid"){let c=Ei(t,n,a,l).opset;c.type="fillPath",s.push(c)}else s.push(Fn([d.estimatedPoints],a));return a.stroke!==tt&&s.push(d.opset),this._d("ellipse",s,a)}circle(t,n,o,i){let r=this.ellipse(t,n,o,o,i);return r.shape="circle",r}linearPath(t,n){let o=this._o(n);return this._d("linearPath",[So(t,!1,o)],o)}arc(t,n,o,i,r,a,s=!1,l){let d=this._o(l),c=[],u=Fr(t,n,o,i,r,a,s,!0,d);if(s&&d.fill)if(d.fillStyle==="solid"){let h=Object.assign({},d);h.disableMultiStroke=!0;let m=Fr(t,n,o,i,r,a,!0,!1,h);m.type="fillPath",c.push(m)}else c.push(js(t,n,o,i,r,a,d));return d.stroke!==tt&&c.push(u),this._d("arc",c,d)}curve(t,n){let o=this._o(n),i=[],r=Or(t,o);if(o.fill&&o.fill!==tt&&t.length>=3)if(o.fillStyle==="solid"){let a=Or(t,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{let a=Us(t),s=_t(a,10,(1+o.roughness)/2);i.push(Fn([s],o))}return o.stroke!==tt&&i.push(r),this._d("curve",i,o)}polygon(t,n){let o=this._o(n),i=[],r=So(t,!0,o);return o.fill&&(o.fillStyle==="solid"?i.push(xi([t],o)):i.push(Fn([t],o))),o.stroke!==tt&&i.push(r),this._d("polygon",i,o)}path(t,n){let o=this._o(n),i=[];if(!t)return this._d("path",i,o);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let r=o.fill&&o.fill!=="transparent"&&o.fill!==tt,a=o.stroke!==tt,s=!!(o.simplification&&o.simplification<1),l=s?4-4*(o.simplification||1):(1+o.roughness)/2,d=Ys(t,1,l),c=Nr(t,o);if(r)if(o.fillStyle==="solid")if(d.length===1){let u=Nr(t,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else i.push(xi(d,o));else i.push(Fn(d,o));return a&&(s?d.forEach(u=>{i.push(So(u,!1,o))}):i.push(c)),this._d("path",i,o)}opsToPath(t,n){let o="";for(let i of t.ops){let r=typeof n=="number"&&n>=0?i.data.map(a=>+a.toFixed(n)):i.data;switch(i.op){case"move":o+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":o+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":o+=`L${r[0]} ${r[1]} `;break}}return o.trim()}toPaths(t){let n=t.sets||[],o=t.options||this.defaultOptions,i=[];for(let r of n){let a=null;switch(r.type){case"path":a={d:this.opsToPath(r),stroke:o.stroke,strokeWidth:o.strokeWidth,fill:tt};break;case"fillPath":a={d:this.opsToPath(r),stroke:tt,strokeWidth:0,fill:o.fill||tt};break;case"fillSketch":a=this.fillSketch(r,o);break}a&&i.push(a)}return i}fillSketch(t,n){let o=n.fillWeight;return o<0&&(o=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||tt,strokeWidth:o,fill:tt}}_mergedShape(t){return t.filter((n,o)=>o===0?!0:n.op!=="move")}};var bi=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new dt(n)}draw(t){let n=t.sets||[],o=t.options||this.getDefaultOptions(),i=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(let a of n)switch(a.type){case"path":i.save(),i.strokeStyle=o.stroke==="none"?"transparent":o.stroke,i.lineWidth=o.strokeWidth,o.strokeLineDash&&i.setLineDash(o.strokeLineDash),o.strokeLineDashOffset&&(i.lineDashOffset=o.strokeLineDashOffset),this._drawToContext(i,a,r),i.restore();break;case"fillPath":{i.save(),i.fillStyle=o.fill||"";let s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,a,r,s),i.restore();break}case"fillSketch":this.fillSketch(i,a,o);break}}fillSketch(t,n,o){let i=o.fillWeight;i<0&&(i=o.strokeWidth/2),t.save(),o.fillLineDash&&t.setLineDash(o.fillLineDash),o.fillLineDashOffset&&(t.lineDashOffset=o.fillLineDashOffset),t.strokeStyle=o.fill||"",t.lineWidth=i,this._drawToContext(t,n,o.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,o,i="nonzero"){t.beginPath();for(let r of n.ops){let a=typeof o=="number"&&o>=0?r.data.map(s=>+s.toFixed(o)):r.data;switch(r.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1]);break}}n.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,o,i,r){let a=this.gen.line(t,n,o,i,r);return this.draw(a),a}rectangle(t,n,o,i,r){let a=this.gen.rectangle(t,n,o,i,r);return this.draw(a),a}ellipse(t,n,o,i,r){let a=this.gen.ellipse(t,n,o,i,r);return this.draw(a),a}circle(t,n,o,i){let r=this.gen.circle(t,n,o,i);return this.draw(r),r}linearPath(t,n){let o=this.gen.linearPath(t,n);return this.draw(o),o}polygon(t,n){let o=this.gen.polygon(t,n);return this.draw(o),o}arc(t,n,o,i,r,a,s=!1,l){let d=this.gen.arc(t,n,o,i,r,a,s,l);return this.draw(d),d}curve(t,n){let o=this.gen.curve(t,n);return this.draw(o),o}path(t,n){let o=this.gen.path(t,n);return this.draw(o),o}};I();I();var ko="http://www.w3.org/2000/svg";var Mi=class{constructor(t,n){this.svg=t,this.gen=new dt(n)}draw(t){let n=t.sets||[],o=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,r=i.createElementNS(ko,"g"),a=t.options.fixedDecimalPlaceDigits;for(let s of n){let l=null;switch(s.type){case"path":{l=i.createElementNS(ko,"path"),l.setAttribute("d",this.opsToPath(s,a)),l.setAttribute("stroke",o.stroke),l.setAttribute("stroke-width",o.strokeWidth+""),l.setAttribute("fill","none"),o.strokeLineDash&&l.setAttribute("stroke-dasharray",o.strokeLineDash.join(" ").trim()),o.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${o.strokeLineDashOffset}`);break}case"fillPath":{l=i.createElementNS(ko,"path"),l.setAttribute("d",this.opsToPath(s,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",o.fill||""),(t.shape==="curve"||t.shape==="polygon")&&l.setAttribute("fill-rule","evenodd");break}case"fillSketch":{l=this.fillSketch(i,s,o);break}}l&&r.appendChild(l)}return r}fillSketch(t,n,o){let i=o.fillWeight;i<0&&(i=o.strokeWidth/2);let r=t.createElementNS(ko,"path");return r.setAttribute("d",this.opsToPath(n,o.fixedDecimalPlaceDigits)),r.setAttribute("stroke",o.fill||""),r.setAttribute("stroke-width",i+""),r.setAttribute("fill","none"),o.fillLineDash&&r.setAttribute("stroke-dasharray",o.fillLineDash.join(" ").trim()),o.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${o.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,o,i,r){let a=this.gen.line(t,n,o,i,r);return this.draw(a)}rectangle(t,n,o,i,r){let a=this.gen.rectangle(t,n,o,i,r);return this.draw(a)}ellipse(t,n,o,i,r){let a=this.gen.ellipse(t,n,o,i,r);return this.draw(a)}circle(t,n,o,i){let r=this.gen.circle(t,n,o,i);return this.draw(r)}linearPath(t,n){let o=this.gen.linearPath(t,n);return this.draw(o)}polygon(t,n){let o=this.gen.polygon(t,n);return this.draw(o)}arc(t,n,o,i,r,a,s=!1,l){let d=this.gen.arc(t,n,o,i,r,a,s,l);return this.draw(d)}curve(t,n){let o=this.gen.curve(t,n);return this.draw(o)}path(t,n){let o=this.gen.path(t,n);return this.draw(o)}};var Hn={canvas(e,t){return new bi(e,t)},svg(e,t){return new Mi(e,t)},generator(e){return new dt(e)},newSeed(){return dt.newSeed()}};import{arrayToMap as Ec,invariant as Xa,rescalePoints as pc,sizeOf as Qm}from"@excalidraw/common";import{degreesToRadians as Ya,lineSegment as Se,pointDistance as Jm,pointFrom as G,pointFromArray as xc,pointRotateRads as ce}from"@excalidraw/math";I();import{invariant as kp}from"@excalidraw/common";import{curve as Tp,lineSegment as Lp,pointFrom as he,pointDistance as N2,pointFromArray as Cp,pointFromVector as Bp,pointRotateRads as ft,polygon as Xs,polygonFromPoints as zr,PRECISION as H2,segmentsIntersectAt as z2,vector as Dp,vectorAdd as Gp,vectorFromPoint as Op,vectorScale as W2}from"@excalidraw/math";import{getElementAbsoluteCoords as j2}from"@excalidraw/element";var $s=e=>{let{angle:t,width:n,height:o,x:i,y:r}=e,a=i+n/2,s=r+o/2,l=he(a,s),d;return e.type==="diamond"?d=Xs(ft(he(a,r),l,t),ft(he(i+n,s),l,t),ft(he(a,r+o),l,t),ft(he(i,s),l,t)):d=Xs(ft(he(i,r),l,t),ft(he(i+n,r),l,t),ft(he(i+n,r+o),l,t),ft(he(i,r+o),l,t)),{type:"polygon",data:d}};var Zs=e=>{let{width:t,height:n,angle:o,x:i,y:r}=e;return{type:"ellipse",data:{center:he(i+t/2,r+n/2),angle:o,halfWidth:t/2,halfHeight:n/2}}},jt=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},qs=(e,t=he(0,0),n,o)=>{let i=l=>ft(he(l[0]+t[0],l[1]+t[1]),o,n),r=jt(e),a=[],s=he(0,0);for(let l of r){if(l.op==="move"){let d=Cp(l.data);kp(d!=null,"Ops data is not a point"),s=i(d)}if(l.op==="bcurveTo"){let d=i(he(l.data[0],l.data[1])),c=i(he(l.data[2],l.data[3])),u=i(he(l.data[4],l.data[5]));a.push(Tp(s,d,c,u)),s=u}}return{type:"polycurve",data:a}},Rp=e=>{let t=e[0],n=[];for(let o=1;o<e.length;o++){let i=e[o];n.push(Lp(t,i)),t=i}return n},Ks=(e,t,n=!1)=>{let o=r=>ft(Bp(Gp(Op(r),Dp(e.x,e.y))),t,e.angle),i=Rp(e.points.map(r=>o(r)));return n?{type:"polygon",data:zr(i.flat())}:{type:"polyline",data:i}},Qs=(e,t,n=he(0,0),o,i)=>{let r=c=>ft(he(c[0]+n[0],c[1]+n[1]),i,o);if(e.roundness===null)return{type:"polygon",data:zr(e.points.map(c=>r(c)))};let a=jt(t),s=[],l=!1;for(let c of a)c.op==="move"?(l=!l,l&&s.push(he(c.data[0],c.data[1]))):c.op==="bcurveTo"?l&&(s.push(he(c.data[0],c.data[1])),s.push(he(c.data[2],c.data[3])),s.push(he(c.data[4],c.data[5]))):c.op==="lineTo"&&l&&s.push(he(c.data[0],c.data[1]));let d=_t(s,10,5).map(c=>r(c));return{type:"polygon",data:zr(d)}};I();I();function Js(e,t,n,o=i=>i){return e*o(.5-t*(.5-n))}function Fp(e){return[-e[0],-e[1]]}function Et(e,t){return[e[0]+t[0],e[1]+t[1]]}function ct(e,t){return[e[0]-t[0],e[1]-t[1]]}function gt(e,t){return[e[0]*t,e[1]*t]}function Np(e,t){return[e[0]/t,e[1]/t]}function To(e){return[e[1],-e[0]]}function el(e,t){return e[0]*t[0]+e[1]*t[1]}function Hp(e,t){return e[0]===t[0]&&e[1]===t[1]}function zp(e){return Math.hypot(e[0],e[1])}function Wp(e){return e[0]*e[0]+e[1]*e[1]}function tl(e,t){return Wp(ct(e,t))}function il(e){return Np(e,zp(e))}function _p(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Lo(e,t,n){let o=Math.sin(n),i=Math.cos(n),r=e[0]-t[0],a=e[1]-t[1],s=r*i-a*o,l=r*o+a*i;return[s+t[0],l+t[1]]}function Wr(e,t,n){return Et(e,gt(ct(t,e),n))}function nl(e,t,n){return Et(e,gt(t,n))}var{min:eo,PI:jp}=Math,ol=.275,Co=jp+1e-4;function Vp(e,t={}){let{size:n=16,smoothing:o=.5,thinning:i=.5,simulatePressure:r=!0,easing:a=H=>H,start:s={},end:l={},last:d=!1}=t,{cap:c=!0,easing:u=H=>H*(2-H)}=s,{cap:h=!0,easing:m=H=>--H*H*H+1}=l;if(e.length===0||n<=0)return[];let f=e[e.length-1].runningLength,g=s.taper===!1?0:s.taper===!0?Math.max(n,f):s.taper,E=l.taper===!1?0:l.taper===!0?Math.max(n,f):l.taper,x=Math.pow(n*o,2),y=[],w=[],M=e.slice(0,10).reduce((H,A)=>{let _=A.pressure;if(r){let X=eo(1,A.distance/n),ve=eo(1,1-X);_=eo(1,H+(ve-H)*(X*ol))}return(H+_)/2},e[0].pressure),b=Js(n,i,e[e.length-1].pressure,a),S,v=e[0].vector,L=e[0].point,T=L,D=L,B=T,F=!1;for(let H=0;H<e.length;H++){let{pressure:A}=e[H],{point:_,vector:X,distance:ve,runningLength:Tt}=e[H];if(H<e.length-1&&f-Tt<3)continue;if(i){if(r){let et=eo(1,ve/n),lt=eo(1,1-et);A=eo(1,M+(lt-M)*(et*ol))}b=Js(n,i,A,a)}else b=n/2;S===void 0&&(S=b);let oi=Tt<g?u(Tt/g):1,Lr=f-Tt<E?m((f-Tt)/E):1;b=Math.max(.01,b*Math.min(oi,Lr));let ii=(H<e.length-1?e[H+1]:e[H]).vector,wo=H<e.length-1?el(X,ii):1,Cr=el(X,v)<0&&!F,ri=wo!==null&&wo<0;if(Cr||ri){let et=gt(To(v),b);for(let lt=1/13,ln=0;ln<=1;ln+=lt)D=Lo(ct(_,et),_,Co*ln),y.push(D),B=Lo(Et(_,et),_,Co*-ln),w.push(B);L=D,T=B,ri&&(F=!0);continue}if(F=!1,H===e.length-1){let et=gt(To(X),b);y.push(ct(_,et)),w.push(Et(_,et));continue}let ai=gt(To(Wr(ii,X,wo)),b);D=ct(_,ai),(H<=1||tl(L,D)>x)&&(y.push(D),L=D),B=Et(_,ai),(H<=1||tl(T,B)>x)&&(w.push(B),T=B),M=A,v=X}let O=e[0].point.slice(0,2),K=e.length>1?e[e.length-1].point.slice(0,2):Et(e[0].point,[1,1]),Y=[],se=[];if(e.length===1){if(!(g||E)||d){let H=nl(O,il(To(ct(O,K))),-(S||b)),A=[];for(let _=1/13,X=_;X<=1;X+=_)A.push(Lo(H,O,Co*2*X));return A}}else{if(!(g||E&&e.length===1))if(c)for(let A=1/13,_=A;_<=1;_+=A){let X=Lo(w[0],O,Co*_);Y.push(X)}else{let A=ct(y[0],w[0]),_=gt(A,.5),X=gt(A,.51);Y.push(ct(O,_),ct(O,X),Et(O,X),Et(O,_))}let H=To(Fp(e[e.length-1].vector));if(E||g&&e.length===1)se.push(K);else if(h){let A=nl(K,H,b);for(let _=1/29,X=_;X<1;X+=_)se.push(Lo(A,K,Co*3*X))}else se.push(Et(K,gt(H,b)),Et(K,gt(H,b*.99)),ct(K,gt(H,b*.99)),ct(K,gt(H,b)))}return y.concat(se,w.reverse(),Y)}function Up(e,t={}){var n;let{streamline:o=.5,size:i=16,last:r=!1}=t;if(e.length===0)return[];let a=.15+(1-o)*.85,s=Array.isArray(e[0])?e:e.map(({x:m,y:f,pressure:g=.5})=>[m,f,g]);if(s.length===2){let m=s[1];s=s.slice(0,-1);for(let f=1;f<5;f++)s.push(Wr(s[0],m,f/4))}s.length===1&&(s=[...s,[...Et(s[0],[1,1]),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,c=0,u=l[0],h=s.length-1;for(let m=1;m<s.length;m++){let f=r&&m===h?s[m].slice(0,2):Wr(u.point,s[m],a);if(Hp(u.point,f))continue;let g=_p(f,u.point);if(c+=g,m<h&&!d){if(c<i)continue;d=!0}u={point:f,pressure:s[m][2]>=0?s[m][2]:.5,vector:il(ct(u.point,f)),distance:g,runningLength:c},l.push(u)}return l[0].vector=((n=l[1])==null?void 0:n.vector)||[0,0],l}function rl(e,t={}){return Vp(Up(e,t),t)}import{pointFrom as me,pointDistance as ac,pointRotateRads as on}from"@excalidraw/math";import{ROUGHNESS as Wm,THEME as Ua,isTransparent as Jo,assertNever as _m,COLOR_PALETTE as jm,LINE_POLYGON_POINT_MERGE_DISTANCE as Vm,applyDarkModeFilter as ei}from"@excalidraw/common";I();import{isRightAngleRads as km,lineSegment as tc,pointFrom as rr,pointRotateRads as Wa}from"@excalidraw/math";import{BOUND_TEXT_PADDING as ar,DEFAULT_REDUCED_GLOBAL_ALPHA as Tm,ELEMENT_READY_TO_ERASE_OPACITY as Lm,FRAME_STYLE as qo,DARK_THEME_FILTER as Cm,MIME_TYPES as ja,THEME as uo,distance as Tn,getFontString as Bm,isRTL as Dm,getVerticalOffset as Gm,invariant as Om,applyDarkModeFilter as lr,isSafari as Rm}from"@excalidraw/common";I();import{pointFrom as Vt,pointCenter as Yp,pointRotateRads as un,vectorFromPoint as _r,vectorNormalize as al,vectorSubtract as sl,vectorAdd as Pi,vectorScale as Ii,pointFromVector as ll,clamp as Le,isCloseTo as dl}from"@excalidraw/math";var Ce=10,q2=(e,t,n,o,i,r,a,s)=>{let{width:l,height:d}=jr(e),c=o/l,u=i/d,h=(e.crop?.x??0)/c,m=(e.crop?.y??0)/u,f=un(Vt(r,a),le(e,t),-e.angle);r=f[0],a=f[1];let g=e.width,E=e.height,x=e.crop??{x:0,y:0,width:o,height:i,naturalWidth:o,naturalHeight:i},y=x.height,w=x.width,M=e.scale[0]===-1,b=e.scale[1]===-1,S=a-e.y,v=r-e.x;n.includes("n")&&(E=Le(e.height-S,Ce,b?d-m:e.height+m)),n.includes("s")&&(S=a-e.y-e.height,E=Le(e.height+S,Ce,b?e.height+m:d-m)),n.includes("e")&&(v=r-e.x-e.width,g=Le(e.width+v,Ce,M?e.width+h:l-h)),n.includes("w")&&(g=Le(e.width-v,Ce,M?l-h:e.width+h));let L=B=>{B.height=E*u,B.width=g*c};L(x);let T=(B,F)=>{L(F),B.includes("n")&&(b||(F.y+=y-F.height)),B.includes("s")&&b&&(F.y+=y-F.height),B.includes("e")&&M&&(F.x+=w-F.width),B.includes("w")&&(M||(F.x+=w-F.width))};switch(n){case"n":{if(s){let B=h+e.width/2,F=l-h-e.width/2,O=Math.min(B,F)*2;g=Le(E*s,Ce,O),E=g/s}T(n,x),s&&(x.x+=(w-x.width)/2);break}case"s":{if(s){let B=h+e.width/2,F=l-h-e.width/2,O=Math.min(B,F)*2;g=Le(E*s,Ce,O),E=g/s}T(n,x),s&&(x.x+=(w-x.width)/2);break}case"w":{if(s){let B=m+e.height/2,F=d-m-e.height/2,O=Math.min(B,F)*2;E=Le(g/s,Ce,O),g=E*s}T(n,x),s&&(x.y+=(y-x.height)/2);break}case"e":{if(s){let B=m+e.height/2,F=d-m-e.height/2,O=Math.min(B,F)*2;E=Le(g/s,Ce,O),g=E*s}T(n,x),s&&(x.y+=(y-x.height)/2);break}case"ne":{if(s)if(v>-S){let B=b?d-m:m+e.height;E=Le(g/s,Ce,B),g=E*s}else{let B=M?h+e.width:l-h;g=Le(E*s,Ce,B),E=g/s}T(n,x);break}case"nw":{if(s)if(v<S){let B=b?d-m:m+e.height;E=Le(g/s,Ce,B),g=E*s}else{let B=M?l-h:h+e.width;g=Le(E*s,Ce,B),E=g/s}T(n,x);break}case"se":{if(s)if(v>S){let B=b?m+e.height:d-m;E=Le(g/s,Ce,B),g=E*s}else{let B=M?h+e.width:l-h;g=Le(E*s,Ce,B),E=g/s}T(n,x);break}case"sw":{if(s)if(-v>S){let B=b?m+e.height:d-m;E=Le(g/s,Ce,B),g=E*s}else{let B=M?l-h:h+e.width;g=Le(E*s,Ce,B),E=g/s}T(n,x);break}default:break}let D=Xp(e,n,g,E,!!s);return dl(x.width,x.naturalWidth)&&dl(x.height,x.naturalHeight)&&(x=null),{x:D[0],y:D[1],width:g,height:E,crop:x}},Xp=(e,t,n,o,i)=>{let[r,a,s,l]=pn(e,e.width,e.height,!0),d=Vt(r,a),c=Vt(s,l),u=Yp(d,c),[h,m,f,g]=pn(e,n,o,!0),E=f-h,x=g-m,y=[...d];if(["n","w","nw"].includes(t)&&(y=[c[0]-Math.abs(E),c[1]-Math.abs(x)]),t==="ne"){let L=[d[0],c[1]];y=[L[0],L[1]-Math.abs(x)]}if(t==="sw"){let L=[c[0],d[1]];y=[L[0]-Math.abs(E),L[1]]}i&&(["s","n"].includes(t)&&(y[0]=u[0]-E/2),["e","w"].includes(t)&&(y[1]=u[1]-x/2));let w=e.angle,M=un(y,u,w),b=[y[0]+Math.abs(E)/2,y[1]+Math.abs(x)/2],S=un(b,u,w);y=un(M,S,-w);let v=[...y];return v[0]+=e.x-h,v[1]+=e.y-m,v},cl=(e,t)=>{if(e.crop){let{width:n,height:o}=jr(e),[i,r,a,s,l,d]=Q(e,t),c=_r(un(Vt(i,r),Vt(l,d),e.angle)),u=_r(un(Vt(a,r),Vt(l,d),e.angle)),h=al(sl(u,c)),m=_r(un(Vt(i,s),Vt(l,d),e.angle)),f=sl(m,c),g=al(f),{cropX:E,cropY:x}=$p(e.crop,e.scale),y=Pi(Pi(c,Ii(h,-E*n/e.crop.naturalWidth)),Ii(g,-x*o/e.crop.naturalHeight)),w=ll(Pi(Pi(y,Ii(h,n/2)),Ii(g,o/2))),M=un(ll(y),w,-e.angle);return{...e,x:M[0],y:M[1],width:n,height:o,crop:null}}return e},jr=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),n=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:n}}return{width:e.width,height:e.height}},$p=(e,t)=>{let n=e.x,o=e.y,i=t[0]===-1,r=t[1]===-1;return i&&(n=e.naturalWidth-Math.abs(n)-e.width),r&&(o=e.naturalHeight-Math.abs(o)-e.height),{cropX:n,cropY:o}},K2=(e,t=!1)=>{let n=e.crop;if(!n)return null;let o=e.scale[0]===-1,i=e.scale[1]===-1,r=n.x,a=n.y;if(o&&(r=n.naturalWidth-n.width-n.x),i&&(a=n.naturalHeight-n.height-n.y),t)return{x:r,y:a};let{width:s,height:l}=jr(e);return{x:r/(n.naturalWidth/s),y:a/(n.naturalHeight/l)}};I();import{pointCenter as $d,pointFrom as N,pointRotateRads as _e,pointsEqual as Zd,pointDistance as $n,vectorFromPoint as Mm,curveLength as Pm,curvePointAtLength as Im}from"@excalidraw/math";import{DRAGGING_THRESHOLD as Sm,KEYS as Xn,shouldRotateWithDiscreteAngle as $o,getGridPoint as qd,invariant as Ke,isShallowEqual as vm,getFeatureFlag as co}from"@excalidraw/common";I();import{arrayToMap as ud,getFeatureFlag as vh,invariant as Mt,isTransparent as Ah}from"@excalidraw/common";import{PRECISION as Uo,clamp as Sa,lineSegment as Zi,pointDistance as Mn,pointDistanceSq as nn,pointFrom as ae,pointFromVector as Xi,pointRotateRads as pe,pointsEqual as kh,vectorFromPoint as jo,vectorNormalize as Ia,vectorScale as $i}from"@excalidraw/math";I();import{invariant as zl,isTransparent as Wl}from"@excalidraw/common";import{curveIntersectLineSegment as _l,isPointWithinBounds as la,lineSegment as Ho,lineSegmentIntersectionPoints as jl,pointFrom as Me,pointFromVector as Y1,pointRotateRads as it,pointsEqual as Vl,vectorFromPoint as X1,vectorNormalize as $1,vectorScale as Z1}from"@excalidraw/math";import{ellipse as q1,ellipseSegmentInterceptPoints as K1}from"@excalidraw/math/ellipse";I();import{DEFAULT_ADAPTIVE_RADIUS as n1,DEFAULT_PROPORTIONAL_RADIUS as Ur,invariant as o1,LINE_CONFIRM_THRESHOLD as i1,ROUNDNESS as Yr}from"@excalidraw/common";import{bezierEquation as r1,curve as Yt,curveCatmullRomCubicApproxPoints as wl,curveOffsetPoints as bl,lineSegment as Ie,lineSegmentIntersectionPoints as xl,pointDistance as Wn,pointFrom as W,pointFromArray as a1,pointFromVector as s1,pointRotateRads as nt,pointTranslate as yl,rectangle as l1,vectorFromPoint as Ml,vectorNormalize as d1,vectorScale as Xr}from"@excalidraw/math";I();import{ROUNDNESS as Bo,assertNever as Zp}from"@excalidraw/common";import{pointsEqual as ul}from"@excalidraw/math";var zn=e=>!!e&&e.type==="image"&&!!e.fileId,Ae=e=>!!e&&e.type==="image",pl=e=>!!e&&e.type==="embeddable",Si=e=>!!e&&e.type==="iframe",vi=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),te=e=>e!=null&&e.type==="text",Ai=e=>e!=null&&e.type==="frame",hl=e=>e!=null&&e.type==="magicframe",ee=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),Pe=e=>e!=null&&qp(e.type),qp=e=>e==="freedraw",ne=e=>e!=null&&Jp(e.type),Ut=e=>e!=null&&e.type==="line",j=e=>e!=null&&e.type==="arrow",U=e=>j(e)&&e.elbowed,nx=e=>j(e)&&!e.elbowed,Kp=e=>j(e)&&!e.elbowed&&!e.roundness,Qp=e=>j(e)&&!e.elbowed&&e.roundness!==null,Jp=e=>e==="arrow"||e==="line",Be=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&e1(e.type),e1=e=>e==="arrow",ge=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),ml=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),Do=e=>e!=null&&(e.type==="rectangle"||e.type==="image"||e.type==="text"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="freedraw"),t1=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||j(e)),ox=e=>{let t=e?.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return Zp(t,null),!1}},Vr=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",Ct=e=>t1(e)&&!!e.boundElements?.some(({type:t})=>t==="text"),Ee=e=>e!==null&&"containerId"in e&&e.containerId!==null&&te(e),ix=e=>!!e.startBinding||!!e.endBinding,fl=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",gl=e=>e==="line"||e==="arrow"||e==="diamond",rx=(e,t)=>!!((e===Bo.ADAPTIVE_RADIUS||e===Bo.LEGACY)&&fl(t.type)||e===Bo.PROPORTIONAL_RADIUS&&gl(t.type)),ax=e=>gl(e.type)?{type:Bo.PROPORTIONAL_RADIUS}:fl(e.type)?{type:Bo.ADAPTIVE_RADIUS}:null,sx=e=>Kp(e)?"sharpArrow":Qp(e)?"curvedArrow":U(e)?"elbowArrow":"line",lx=e=>e.length>3&&ul(e[0],e[e.length-1]),El=e=>e.length>3||e.length===3&&!ul(e[0],e[e.length-1]),dx=e=>{switch(e){case"rectangle":case"diamond":case"ellipse":case"arrow":case"line":case"freedraw":case"text":case"image":case"frame":case"embeddable":return!0;default:return!1}};var Go=new WeakMap,$r=(e,t)=>{let n=Go.get(e);if(!n)return;let{version:o,shapes:i}=n;if(o!==e.version){Go.delete(e);return}return i.get(t)},Zr=(e,t,n)=>{let o=Go.get(e);if(!o){Go.set(e,{version:e.version,shapes:new Map([[n,t]])});return}let{version:i,shapes:r}=o;if(i!==e.version){Go.set(e,{version:e.version,shapes:new Map([[n,t]])});return}r.set(n,t)};function _n(e,t){let n=$r(e,0);if(n)return n;let o=Il(e,t),i=[],r=[];for(let s=0;s<o.length;s+=1){let l=o[s],d=o[s-1]&&a1(o[s-1].data.slice(-2));switch(l.op){case"move":continue;case"lineTo":if(!d)throw new Error("prevPoint is undefined");i.push(Ie(W(e.x+d[0],e.y+d[1]),W(e.x+l.data[0],e.y+l.data[1])));continue;case"bcurveTo":if(!d)throw new Error("prevPoint is undefined");r.push(Yt(W(e.x+d[0],e.y+d[1]),W(e.x+l.data[0],e.y+l.data[1]),W(e.x+l.data[2],e.y+l.data[3]),W(e.x+l.data[4],e.y+l.data[5])));continue;default:console.error("Unknown op type",l.op)}}let a=[i,r];return Zr(e,a,0),a}function hn(e,t=0){let n=$r(e,t);if(n)return n;let o=Xt(Math.min(e.width,e.height),e);o===0&&(o=.01);let i=l1(W(e.x,e.y),W(e.x+e.width,e.y+e.height)),r=Ie(W(i[0][0]+o,i[0][1]),W(i[1][0]-o,i[0][1])),a=Ie(W(i[1][0],i[0][1]+o),W(i[1][0],i[1][1]-o)),s=Ie(W(i[0][0]+o,i[1][1]),W(i[1][0]-o,i[1][1])),l=Ie(W(i[0][0],i[1][1]-o),W(i[0][0],i[0][1]+o)),d=[Yt(l[1],W(l[1][0]+2/3*(i[0][0]-l[1][0]),l[1][1]+2/3*(i[0][1]-l[1][1])),W(r[0][0]+2/3*(i[0][0]-r[0][0]),r[0][1]+2/3*(i[0][1]-r[0][1])),r[0]),Yt(r[1],W(r[1][0]+2/3*(i[1][0]-r[1][0]),r[1][1]+2/3*(i[0][1]-r[1][1])),W(a[0][0]+2/3*(i[1][0]-a[0][0]),a[0][1]+2/3*(i[0][1]-a[0][1])),a[0]),Yt(a[1],W(a[1][0]+2/3*(i[1][0]-a[1][0]),a[1][1]+2/3*(i[1][1]-a[1][1])),W(s[1][0]+2/3*(i[1][0]-s[1][0]),s[1][1]+2/3*(i[1][1]-s[1][1])),s[1]),Yt(s[0],W(s[0][0]+2/3*(i[0][0]-s[0][0]),s[0][1]+2/3*(i[1][1]-s[0][1])),W(l[0][0]+2/3*(i[0][0]-l[0][0]),l[0][1]+2/3*(i[1][1]-l[0][1])),l[0])],c=t>0?d.map(m=>wl(bl(m,t))):[[d[0]],[d[1]],[d[2]],[d[3]]],h=[[Ie(c[0][c[0].length-1][3],c[1][0][0]),Ie(c[1][c[1].length-1][3],c[2][0][0]),Ie(c[2][c[2].length-1][3],c[3][0][0]),Ie(c[3][c[3].length-1][3],c[0][0][0])],c.flat()];return Zr(e,h,t),h}function Pl(e,t=0){let[n,o,i,r,a,s,l,d]=no(e),c=e.roundness?Xt(Math.abs(n-l),e):(n-l)*.01,u=e.roundness?Xt(Math.abs(r-o),e):(r-o)*.01,[h,m,f,g]=[W(e.x+n,e.y+o),W(e.x+i,e.y+r),W(e.x+a,e.y+s),W(e.x+l,e.y+d)];return[Yt(W(m[0]-c,m[1]-u),m,m,W(m[0]-c,m[1]+u)),Yt(W(f[0]+c,f[1]-u),f,f,W(f[0]-c,f[1]-u)),Yt(W(g[0]+c,g[1]+u),g,g,W(g[0]+c,g[1]-u)),Yt(W(h[0]-c,h[1]+u),h,h,W(h[0]+c,h[1]+u))]}function mn(e,t=0){let n=$r(e,t);if(n)return n;let i=Pl(e,t).map(s=>wl(bl(s,t))),a=[[Ie(i[0][i[0].length-1][3],i[1][0][0]),Ie(i[1][i[1].length-1][3],i[2][0][0]),Ie(i[2][i[2].length-1][3],i[3][0][0]),Ie(i[3][i[3].length-1][3],i[0][0][0])],i.flat()];return Zr(e,a,t),a}var $t=(e,t=1)=>{if(e.length>=3){let[n,o]=[e[0],e[e.length-1]];return Wn(n,o)<=i1/t}return!1},Xt=(e,t)=>{if(t.roundness?.type===Yr.PROPORTIONAL_RADIUS||t.roundness?.type===Yr.LEGACY)return e*Ur;if(t.roundness?.type===Yr.ADAPTIVE_RADIUS){let n=t.roundness?.value??n1,o=n/Ur;return e<=o?e*Ur:n}return 0},c1=(e,t)=>{let n=e.type==="rectangle"?15:0,o=s=>{let l=d1(Ml(s[1],s[0])),d=Xr(l,n);return Ie(yl(s[0],d),yl(s[1],Xr(d,-1)))},i=le(e,t),r=o(Do(e)?Ie(nt(W(e.x,e.y),i,e.angle),nt(W(e.x+e.width,e.y+e.height),i,e.angle)):Ie(nt(W(e.x+e.width/2,e.y),i,e.angle),nt(W(e.x+e.width/2,e.y+e.height),i,e.angle))),a=o(Do(e)?Ie(nt(W(e.x+e.width,e.y),i,e.angle),nt(W(e.x,e.y+e.height),i,e.angle)):Ie(nt(W(e.x,e.y+e.height/2),i,e.angle),nt(W(e.x+e.width,e.y+e.height/2),i,e.angle)));return[r,a]},ki=(e,t,n,o)=>{let i=le(t,n);return(t.type==="diamond"?Pl(t).map(s=>{let l=r1(s,.5),d=nt(l,i,t.angle);return W(d[0],d[1])}):[nt(W(t.x+t.width,t.y+t.height/2),i,t.angle),nt(W(t.x+t.width/2,t.y+t.height),i,t.angle),nt(W(t.x,t.y+t.height/2),i,t.angle),nt(W(t.x+t.width/2,t.y),i,t.angle)]).find(s=>Wn(e,s)<=xt(o)+t.strokeWidth/2&&!Bt({point:e,element:t,threshold:0,elementsMap:n,overrideShouldTestInside:!0}))},to=(e,t,n,o,i,r,a=!0)=>{if(o1(e.points.length>=2,"Arrow must have at least two points"),e.width<3&&e.height<3)return null;if(a){let x=ki(t,n,i,r);if(x)return x}let[s,l]=c1(n,i),d=R.getPointAtIndexGlobalCoordinates(e,o==="start"?1:e.points.length-2,i);if(e.points.length===2){let x=o==="start"?e.endBinding:e.startBinding,y=x&&i.get(x.elementId),w=x&&y&&Ye(fn(x.fixedPoint),y,i);w&&(d=w)}let c=s1(Xr(Ml(t,d),2*Wn(d,t)+Math.max(Wn(s[0],s[1]),Wn(l[0],l[1]))),d),u=Ie(c,d),h=xl(s,u),m=xl(l,u),f=h&&Wn(d,h),g=m&&Wn(d,m),E=null;return f!=null&&g!=null?E=f<g?h:m:E=h||m||null,E&&Zt(E,n,i)?E:null};I();import{ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO as D1,ARROW_LABEL_WIDTH_FRACTION as G1,BOUND_TEXT_PADDING as Dt,DEFAULT_FONT_SIZE as O1,TEXT_ALIGN as Cl,VERTICAL_ALIGN as Bl,getFontString as Gi,isProdEnv as R1,invariant as F1}from"@excalidraw/common";import{pointFrom as Dl,pointRotateRads as N1}from"@excalidraw/math";I();var Oo={},Sl=(e,t)=>{let n=Oo[e]||(Oo[e]={height:t});return n.height=t,n},vl=e=>{Oo[e]&&delete Oo[e]},Px=e=>Oo[e]?.height??null;I();import{BOUND_TEXT_PADDING as Li,DEFAULT_FONT_SIZE as u1,DEFAULT_FONT_FAMILY as p1,getFontString as h1,isTestEnv as m1,normalizeEOL as f1}from"@excalidraw/common";var ot=(e,t,n)=>{let o=e.split(`
1
+ var qu=Object.create;var Ts=Object.defineProperty;var Ku=Object.getOwnPropertyDescriptor;var Qu=Object.getOwnPropertyNames;var Ju=Object.getPrototypeOf,ep=Object.prototype.hasOwnProperty;var tp=(e,t)=>()=>(e&&(t=e(e=0)),t);var yo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var np=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qu(t))!ep.call(e,i)&&i!==n&&Ts(e,i,{get:()=>t[i],enumerable:!(o=Ku(t,i))||o.enumerable});return e};var ii=(e,t,n)=>(n=e!=null?qu(Ju(e)):{},np(t||!e||!e.__esModule?Ts(n,"default",{value:e,enumerable:!0}):n,e));var C,I=tp(()=>{C={PROD:!0}});var Cc=yo((A6,Lc)=>{I();var Tc="Expected a function",Ac=NaN,O0="[object Symbol]",R0=/^\s+|\s+$/g,F0=/^[-+]0x[0-9a-f]+$/i,N0=/^0b[01]+$/i,H0=/^0o[0-7]+$/i,z0=parseInt,W0=typeof global=="object"&&global&&global.Object===Object&&global,_0=typeof self=="object"&&self&&self.Object===Object&&self,j0=W0||_0||Function("return this")(),V0=Object.prototype,Y0=V0.toString,U0=Math.max,X0=Math.min,es=function(){return j0.Date.now()};function $0(e,t,n){var o,i,r,a,s,l,d=0,c=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(Tc);t=kc(t)||0,dr(n)&&(c=!!n.leading,u="maxWait"in n,r=u?U0(kc(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h);function m(S){var v=o,k=i;return o=i=void 0,d=S,a=e.apply(k,v),a}function g(S){return d=S,s=setTimeout(x,t),c?m(S):a}function f(S){var v=S-l,k=S-d,T=t-v;return u?X0(T,r-k):T}function E(S){var v=S-l,k=S-d;return l===void 0||v>=t||v<0||u&&k>=r}function x(){var S=es();if(E(S))return y(S);s=setTimeout(x,f(S))}function y(S){return s=void 0,h&&o?m(S):(o=i=void 0,a)}function w(){s!==void 0&&clearTimeout(s),d=0,o=l=i=s=void 0}function M(){return s===void 0?a:y(es())}function b(){var S=es(),v=E(S);if(o=arguments,i=this,l=S,v){if(s===void 0)return g(l);if(u)return s=setTimeout(x,t),m(l)}return s===void 0&&(s=setTimeout(x,t)),a}return b.cancel=w,b.flush=M,b}function Z0(e,t,n){var o=!0,i=!0;if(typeof e!="function")throw new TypeError(Tc);return dr(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),$0(e,t,{leading:o,maxWait:t,trailing:i})}function dr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function q0(e){return!!e&&typeof e=="object"}function K0(e){return typeof e=="symbol"||q0(e)&&Y0.call(e)==O0}function kc(e){if(typeof e=="number")return e;if(K0(e))return Ac;if(dr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=dr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(R0,"");var n=N0.test(e);return n||H0.test(e)?z0(e.slice(2),n?2:8):F0.test(e)?Ac:+e}Lc.exports=Z0});var Tu=yo(J=>{"use strict";I();var ws=Symbol.for("react.transitional.element"),hg=Symbol.for("react.portal"),mg=Symbol.for("react.fragment"),fg=Symbol.for("react.strict_mode"),gg=Symbol.for("react.profiler"),Eg=Symbol.for("react.consumer"),xg=Symbol.for("react.context"),yg=Symbol.for("react.forward_ref"),wg=Symbol.for("react.suspense"),bg=Symbol.for("react.memo"),Pu=Symbol.for("react.lazy"),xu=Symbol.iterator;function Mg(e){return e===null||typeof e!="object"?null:(e=xu&&e[xu]||e["@@iterator"],typeof e=="function"?e:null)}var Iu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Su=Object.assign,vu={};function Eo(e,t,n){this.props=e,this.context=t,this.refs=vu,this.updater=n||Iu}Eo.prototype.isReactComponent={};Eo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Eo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Au(){}Au.prototype=Eo.prototype;function bs(e,t,n){this.props=e,this.context=t,this.refs=vu,this.updater=n||Iu}var Ms=bs.prototype=new Au;Ms.constructor=bs;Su(Ms,Eo.prototype);Ms.isPureReactComponent=!0;var yu=Array.isArray,ge={H:null,A:null,T:null,S:null},ku=Object.prototype.hasOwnProperty;function Ps(e,t,n,o,i,r){return n=r.ref,{$$typeof:ws,type:e,key:t,ref:n!==void 0?n:null,props:r}}function Pg(e,t){return Ps(e.type,t,void 0,void 0,void 0,e.props)}function Is(e){return typeof e=="object"&&e!==null&&e.$$typeof===ws}function Ig(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var wu=/\/+/g;function ys(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ig(""+e.key):t.toString(36)}function bu(){}function Sg(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(bu,bu):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function go(e,t,n,o,i){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(r){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case ws:case hg:a=!0;break;case Pu:return a=e._init,go(a(e._payload),t,n,o,i)}}if(a)return i=i(e),a=o===""?"."+ys(e,0):o,yu(i)?(n="",a!=null&&(n=a.replace(wu,"$&/")+"/"),go(i,t,n,"",function(d){return d})):i!=null&&(Is(i)&&(i=Pg(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(wu,"$&/")+"/")+a)),t.push(i)),1;a=0;var s=o===""?".":o+":";if(yu(e))for(var l=0;l<e.length;l++)o=e[l],r=s+ys(o,l),a+=go(o,t,n,r,i);else if(l=Mg(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,r=s+ys(o,l++),a+=go(o,t,n,r,i);else if(r==="object"){if(typeof e.then=="function")return go(Sg(e),t,n,o,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function br(e,t,n){if(e==null)return e;var o=[],i=0;return go(e,o,"","",function(r){return t.call(n,r,i++)}),o}function vg(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Mu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Ag(){}J.Children={map:br,forEach:function(e,t,n){br(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return br(e,function(){t++}),t},toArray:function(e){return br(e,function(t){return t})||[]},only:function(e){if(!Is(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};J.Component=Eo;J.Fragment=mg;J.Profiler=gg;J.PureComponent=bs;J.StrictMode=fg;J.Suspense=wg;J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ge;J.act=function(){throw Error("act(...) is not supported in production builds of React.")};J.cache=function(e){return function(){return e.apply(null,arguments)}};J.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Su({},e.props),i=e.key,r=void 0;if(t!=null)for(a in t.ref!==void 0&&(r=void 0),t.key!==void 0&&(i=""+t.key),t)!ku.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(o[a]=t[a]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];o.children=s}return Ps(e.type,i,void 0,void 0,r,o)};J.createContext=function(e){return e={$$typeof:xg,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Eg,_context:e},e};J.createElement=function(e,t,n){var o,i={},r=null;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)ku.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(i[o]=t[o]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)i[o]===void 0&&(i[o]=a[o]);return Ps(e,r,void 0,void 0,null,i)};J.createRef=function(){return{current:null}};J.forwardRef=function(e){return{$$typeof:yg,render:e}};J.isValidElement=Is;J.lazy=function(e){return{$$typeof:Pu,_payload:{_status:-1,_result:e},_init:vg}};J.memo=function(e,t){return{$$typeof:bg,type:e,compare:t===void 0?null:t}};J.startTransition=function(e){var t=ge.T,n={};ge.T=n;try{var o=e(),i=ge.S;i!==null&&i(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Ag,Mu)}catch(r){Mu(r)}finally{ge.T=t}};J.unstable_useCacheRefresh=function(){return ge.H.useCacheRefresh()};J.use=function(e){return ge.H.use(e)};J.useActionState=function(e,t,n){return ge.H.useActionState(e,t,n)};J.useCallback=function(e,t){return ge.H.useCallback(e,t)};J.useContext=function(e){return ge.H.useContext(e)};J.useDebugValue=function(){};J.useDeferredValue=function(e,t){return ge.H.useDeferredValue(e,t)};J.useEffect=function(e,t){return ge.H.useEffect(e,t)};J.useId=function(){return ge.H.useId()};J.useImperativeHandle=function(e,t,n){return ge.H.useImperativeHandle(e,t,n)};J.useInsertionEffect=function(e,t){return ge.H.useInsertionEffect(e,t)};J.useLayoutEffect=function(e,t){return ge.H.useLayoutEffect(e,t)};J.useMemo=function(e,t){return ge.H.useMemo(e,t)};J.useOptimistic=function(e,t){return ge.H.useOptimistic(e,t)};J.useReducer=function(e,t,n){return ge.H.useReducer(e,t,n)};J.useRef=function(e){return ge.H.useRef(e)};J.useState=function(e){return ge.H.useState(e)};J.useSyncExternalStore=function(e,t,n){return ge.H.useSyncExternalStore(e,t,n)};J.useTransition=function(){return ge.H.useTransition()};J.version="19.0.0"});var Cu=yo((wM,Lu)=>{"use strict";I();Lu.exports=Tu()});var Du=yo(Mr=>{"use strict";I();var kg=Symbol.for("react.transitional.element"),Tg=Symbol.for("react.fragment");function Bu(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:kg,type:e,key:o,ref:t!==void 0?t:null,props:n}}Mr.Fragment=Tg;Mr.jsx=Bu;Mr.jsxs=Bu});var Ss=yo((IM,Gu)=>{"use strict";I();Gu.exports=Du()});I();import{toIterable as Yg}from"@excalidraw/common";I();import{SHIFT_LOCKING_ANGLE as on,viewportCoordsToSceneCoords as ar}from"@excalidraw/common";import{normalizeRadians as uc,radiansBetweenAngles as t0,radiansDifference as n0}from"@excalidraw/math";import{pointsEqual as o0}from"@excalidraw/math";I();I();I();I();I();I();I();I();I();function Ar(e,t,n){if(e&&e.length){let[o,i]=t,r=Math.PI/180*n,a=Math.cos(r),s=Math.sin(r);for(let l of e){let[d,c]=l;l[0]=(d-o)*a-(c-i)*s+o,l[1]=(d-o)*s+(c-i)*a+i}}}function ip(e,t,n){let o=[];e.forEach(i=>o.push(...i)),Ar(o,t,n)}function rp(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ls(e,t,n,o=1){let i=n,r=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,s=[0,0];if(i)for(let d of a)Ar(d,s,i);let l=ap(a,r,o);if(i){for(let d of a)Ar(d,s,-i);ip(l,s,-i)}return l}function ap(e,t,n){let o=[];for(let d of e){let c=[...d];rp(c[0],c[c.length-1])||c.push([c[0][0],c[0][1]]),c.length>2&&o.push(c)}let i=[];t=Math.max(t,.1);let r=[];for(let d of o)for(let c=0;c<d.length-1;c++){let u=d[c],h=d[c+1];if(u[1]!==h[1]){let m=Math.min(u[1],h[1]);r.push({ymin:m,ymax:Math.max(u[1],h[1]),x:m===u[1]?u[0]:h[0],islope:(h[0]-u[0])/(h[1]-u[1])})}}if(r.sort((d,c)=>d.ymin<c.ymin?-1:d.ymin>c.ymin?1:d.x<c.x?-1:d.x>c.x?1:d.ymax===c.ymax?0:(d.ymax-c.ymax)/Math.abs(d.ymax-c.ymax)),!r.length)return i;let a=[],s=r[0].ymin,l=0;for(;a.length||r.length;){if(r.length){let d=-1;for(let u=0;u<r.length&&!(r[u].ymin>s);u++)d=u;r.splice(0,d+1).forEach(u=>{a.push({s,edge:u})})}if(a=a.filter(d=>!(d.edge.ymax<=s)),a.sort((d,c)=>d.edge.x===c.edge.x?0:(d.edge.x-c.edge.x)/Math.abs(d.edge.x-c.edge.x)),(n!==1||l%t===0)&&a.length>1)for(let d=0;d<a.length;d=d+2){let c=d+1;if(c>=a.length)break;let u=a[d].edge,h=a[c].edge;i.push([[Math.round(u.x),s],[Math.round(h.x),s]])}s+=n,a.forEach(d=>{d.edge.x=d.edge.x+n*d.edge.islope}),l++}return i}function kt(e,t){var n;let o=t.hachureAngle+90,i=t.hachureGap;i<0&&(i=t.strokeWidth*4),i=Math.max(i,.1);let r=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(r=i),Ls(e,i,o,r||1)}var ln=class{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){let o=kt(t,n);return{type:"fillSketch",ops:this.renderLines(o,n)}}renderLines(t,n){let o=[];for(let i of t)o.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],n));return o}};I();I();function dn(e){let t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}var ri=class extends ln{fillPolygons(t,n){let o=n.hachureGap;o<0&&(o=n.strokeWidth*4),o=Math.max(o,.1);let i=Object.assign({},n,{hachureGap:o}),r=kt(t,i),a=Math.PI/180*n.hachureAngle,s=[],l=o*.5*Math.cos(a),d=o*.5*Math.sin(a);for(let[u,h]of r)dn([u,h])&&s.push([[u[0]-l,u[1]+d],[...h]],[[u[0]+l,u[1]-d],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,n)}}};I();var ai=class extends ln{fillPolygons(t,n){let o=this._fillPolygons(t,n),i=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),r=this._fillPolygons(t,i);return o.ops=o.ops.concat(r.ops),o}};I();var si=class{constructor(t){this.helper=t}fillPolygons(t,n){n=Object.assign({},n,{hachureAngle:0});let o=kt(t,n);return this.dotsOnLines(o,n)}dotsOnLines(t,n){let o=[],i=n.hachureGap;i<0&&(i=n.strokeWidth*4),i=Math.max(i,.1);let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let a=i/4;for(let s of t){let l=dn(s),d=l/i,c=Math.ceil(d)-1,u=l-c*i,h=(s[0][0]+s[1][0])/2-i/4,m=Math.min(s[0][1],s[1][1]);for(let g=0;g<c;g++){let f=m+u+g*i,E=h-a+Math.random()*2*a,x=f-a+Math.random()*2*a,y=this.helper.ellipse(E,x,r,r,n);o.push(...y.ops)}}return{type:"fillSketch",ops:o}}};I();var li=class{constructor(t){this.helper=t}fillPolygons(t,n){let o=kt(t,n);return{type:"fillSketch",ops:this.dashedLine(o,n)}}dashedLine(t,n){let o=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,i=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,r=[];return t.forEach(a=>{let s=dn(a),l=Math.floor(s/(o+i)),d=(s+i-l*(o+i))/2,c=a[0],u=a[1];c[0]>u[0]&&(c=a[1],u=a[0]);let h=Math.atan((u[1]-c[1])/(u[0]-c[0]));for(let m=0;m<l;m++){let g=m*(o+i),f=g+o,E=[c[0]+g*Math.cos(h)+d*Math.cos(h),c[1]+g*Math.sin(h)+d*Math.sin(h)],x=[c[0]+f*Math.cos(h)+d*Math.cos(h),c[1]+f*Math.sin(h)+d*Math.sin(h)];r.push(...this.helper.doubleLineOps(E[0],E[1],x[0],x[1],n))}}),r}};I();var di=class{constructor(t){this.helper=t}fillPolygons(t,n){let o=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,i=n.zigzagOffset<0?o:n.zigzagOffset;n=Object.assign({},n,{hachureGap:o+i});let r=kt(t,n);return{type:"fillSketch",ops:this.zigzagLines(r,i,n)}}zigzagLines(t,n,o){let i=[];return t.forEach(r=>{let a=dn(r),s=Math.round(a/(2*n)),l=r[0],d=r[1];l[0]>d[0]&&(l=r[1],d=r[0]);let c=Math.atan((d[1]-l[1])/(d[0]-l[0]));for(let u=0;u<s;u++){let h=u*2*n,m=(u+1)*2*n,g=Math.sqrt(2*Math.pow(n,2)),f=[l[0]+h*Math.cos(c),l[1]+h*Math.sin(c)],E=[l[0]+m*Math.cos(c),l[1]+m*Math.sin(c)],x=[f[0]+g*Math.cos(c+Math.PI/4),f[1]+g*Math.sin(c+Math.PI/4)];i.push(...this.helper.doubleLineOps(f[0],f[1],x[0],x[1],o),...this.helper.doubleLineOps(x[0],x[1],E[0],E[1],o))}}),i}};var Ye={};function Cs(e,t){let n=e.fillStyle||"hachure";if(!Ye[n])switch(n){case"zigzag":Ye[n]||(Ye[n]=new ri(t));break;case"cross-hatch":Ye[n]||(Ye[n]=new ai(t));break;case"dots":Ye[n]||(Ye[n]=new si(t));break;case"dashed":Ye[n]||(Ye[n]=new li(t));break;case"zigzag-line":Ye[n]||(Ye[n]=new di(t));break;case"hachure":default:n="hachure",Ye[n]||(Ye[n]=new ln(t));break}return Ye[n]}I();function Bs(){return Math.floor(Math.random()*2**31)}var ci=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};I();I();var ui={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function sp(e){let t=new Array;for(;e!=="";)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:2,text:""},t}function kr(e,t){return e.type===t}function Qn(e){let t=[],n=sp(e),o="BOD",i=0,r=n[i];for(;!kr(r,2);){let a=0,s=[];if(o==="BOD")if(r.text==="M"||r.text==="m")i++,a=ui[r.text],o=r.text;else return Qn("M0,0"+e);else kr(r,1)?a=ui[o]:(i++,a=ui[r.text],o=r.text);if(i+a<n.length){for(let l=i;l<i+a;l++){let d=n[l];if(kr(d,1))s[s.length]=+d.text;else throw new Error("Param not a number: "+o+","+d.text)}if(typeof ui[o]=="number"){let l={key:o,data:s};t.push(l),i+=a,r=n[i],o==="M"&&(o="L"),o==="m"&&(o="l")}else throw new Error("Bad segment: "+o)}else throw new Error("Path data ended short")}return t}I();function wo(e){let t=0,n=0,o=0,i=0,r=[];for(let{key:a,data:s}of e)switch(a){case"M":r.push({key:"M",data:[...s]}),[t,n]=s,[o,i]=s;break;case"m":t+=s[0],n+=s[1],r.push({key:"M",data:[t,n]}),o=t,i=n;break;case"L":r.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],r.push({key:"L",data:[t,n]});break;case"C":r.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{let l=s.map((d,c)=>c%2?d+n:d+t);r.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":r.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{let l=s.map((d,c)=>c%2?d+n:d+t);r.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":r.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],r.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":r.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],r.push({key:"H",data:[t]});break;case"V":r.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],r.push({key:"V",data:[n]});break;case"S":r.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{let l=s.map((d,c)=>c%2?d+n:d+t);r.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":r.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],r.push({key:"T",data:[t,n]});break;case"Z":case"z":r.push({key:"Z",data:[]}),t=o,n=i;break}return r}I();function Mo(e){let t=[],n="",o=0,i=0,r=0,a=0,s=0,l=0;for(let{key:d,data:c}of e){switch(d){case"M":t.push({key:"M",data:[...c]}),[o,i]=c,[r,a]=c;break;case"C":t.push({key:"C",data:[...c]}),o=c[4],i=c[5],s=c[2],l=c[3];break;case"L":t.push({key:"L",data:[...c]}),[o,i]=c;break;case"H":o=c[0],t.push({key:"L",data:[o,i]});break;case"V":i=c[0],t.push({key:"L",data:[o,i]});break;case"S":{let u=0,h=0;n==="C"||n==="S"?(u=o+(o-s),h=i+(i-l)):(u=o,h=i),t.push({key:"C",data:[u,h,...c]}),s=c[0],l=c[1],o=c[2],i=c[3];break}case"T":{let[u,h]=c,m=0,g=0;n==="Q"||n==="T"?(m=o+(o-s),g=i+(i-l)):(m=o,g=i);let f=o+2*(m-o)/3,E=i+2*(g-i)/3,x=u+2*(m-u)/3,y=h+2*(g-h)/3;t.push({key:"C",data:[f,E,x,y,u,h]}),s=m,l=g,o=u,i=h;break}case"Q":{let[u,h,m,g]=c,f=o+2*(u-o)/3,E=i+2*(h-i)/3,x=m+2*(u-m)/3,y=g+2*(h-g)/3;t.push({key:"C",data:[f,E,x,y,m,g]}),s=u,l=h,o=m,i=g;break}case"A":{let u=Math.abs(c[0]),h=Math.abs(c[1]),m=c[2],g=c[3],f=c[4],E=c[5],x=c[6];u===0||h===0?(t.push({key:"C",data:[o,i,E,x,E,x]}),o=E,i=x):(o!==E||i!==x)&&(Ds(o,i,E,x,u,h,m,g,f).forEach(function(w){t.push({key:"C",data:w})}),o=E,i=x);break}case"Z":t.push({key:"Z",data:[]}),o=r,i=a;break}n=d}return t}function lp(e){return Math.PI*e/180}function bo(e,t,n){let o=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return[o,i]}function Ds(e,t,n,o,i,r,a,s,l,d){let c=lp(a),u=[],h=0,m=0,g=0,f=0;if(d)[h,m,g,f]=d;else{[e,t]=bo(e,t,-c),[n,o]=bo(n,o,-c);let N=(e-n)/2,G=(t-o)/2,q=N*N/(i*i)+G*G/(r*r);q>1&&(q=Math.sqrt(q),i=q*i,r=q*r);let U=s===l?-1:1,le=i*i,H=r*r,A=le*H-le*G*G-H*N*N,_=le*G*G+H*N*N,X=U*Math.sqrt(Math.abs(A/_));g=X*i*G/r+(e+n)/2,f=X*-r*N/i+(t+o)/2,h=Math.asin(parseFloat(((t-f)/r).toFixed(9))),m=Math.asin(parseFloat(((o-f)/r).toFixed(9))),e<g&&(h=Math.PI-h),n<g&&(m=Math.PI-m),h<0&&(h=Math.PI*2+h),m<0&&(m=Math.PI*2+m),l&&h>m&&(h=h-Math.PI*2),!l&&m>h&&(m=m-Math.PI*2)}let E=m-h;if(Math.abs(E)>Math.PI*120/180){let N=m,G=n,q=o;l&&m>h?m=h+Math.PI*120/180*1:m=h+Math.PI*120/180*-1,n=g+i*Math.cos(m),o=f+r*Math.sin(m),u=Ds(n,o,G,q,i,r,a,0,l,[m,N,g,f])}E=m-h;let x=Math.cos(h),y=Math.sin(h),w=Math.cos(m),M=Math.sin(m),b=Math.tan(E/4),S=4/3*i*b,v=4/3*r*b,k=[e,t],T=[e+S*y,t-v*x],R=[n+S*M,o-v*w],O=[n,o];if(T[0]=2*k[0]-T[0],T[1]=2*k[1]-T[1],d)return[T,R,O].concat(u);{u=[T,R,O].concat(u);let N=[];for(let G=0;G<u.length;G+=3){let q=bo(u[G][0],u[G][1],c),U=bo(u[G+1][0],u[G+1][1],c),le=bo(u[G+2][0],u[G+2][1],c);N.push([q[0],q[1],U[0],U[1],le[0],le[1]])}return N}}var dp={randOffset:pp,randOffsetWithRange:hp,ellipse:up,doubleLineOps:mp};function Tr(e,t,n,o,i){return{type:"path",ops:Ht(e,t,n,o,i)}}function Po(e,t,n){let o=(e||[]).length;if(o>2){let i=[];for(let r=0;r<o-1;r++)i.push(...Ht(e[r][0],e[r][1],e[r+1][0],e[r+1][1],n));return t&&i.push(...Ht(e[o-1][0],e[o-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}else if(o===2)return Tr(e[0][0],e[0][1],e[1][0],e[1][1],n);return{type:"path",ops:[]}}function cp(e,t){return Po(e,!0,t)}function Ns(e,t,n,o,i){let r=[[e,t],[e+n,t],[e+n,t+o],[e,t+o]];return cp(r,i)}function Lr(e,t){let n=Os(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){let o=Os(e,1.5*(1+t.roughness*.22),fp(t));n=n.concat(o)}return{type:"path",ops:n}}function up(e,t,n,o,i){let r=Cr(n,o,i);return mi(e,t,i,r).opset}function Cr(e,t,n){let o=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*o)),r=Math.PI*2/i,a=Math.abs(e/2),s=Math.abs(t/2),l=1-n.curveFitting;return a+=z(a*l,n),s+=z(s*l,n),{increment:r,rx:a,ry:s}}function mi(e,t,n,o){let[i,r]=Rs(o.increment,e,t,o.rx,o.ry,1,o.increment*pi(.1,pi(.4,1,n),n),n),a=hi(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[s]=Rs(o.increment,e,t,o.rx,o.ry,1.5,0,n),l=hi(s,null,n);a=a.concat(l)}return{estimatedPoints:r,opset:{type:"path",ops:a}}}function Br(e,t,n,o,i,r,a,s,l){let d=e,c=t,u=Math.abs(n/2),h=Math.abs(o/2);u+=z(u*.01,l),h+=z(h*.01,l);let m=i,g=r;for(;m<0;)m+=Math.PI*2,g+=Math.PI*2;g-m>Math.PI*2&&(m=0,g=Math.PI*2);let f=Math.PI*2/l.curveStepCount,E=Math.min(f/2,(g-m)/2),x=Fs(E,d,c,u,h,m,g,1,l);if(!l.disableMultiStroke){let y=Fs(E,d,c,u,h,m,g,1.5,l);x.push(...y)}return a&&(s?x.push(...Ht(d,c,d+u*Math.cos(m),c+h*Math.sin(m),l),...Ht(d,c,d+u*Math.cos(g),c+h*Math.sin(g),l)):x.push({op:"lineTo",data:[d,c]},{op:"lineTo",data:[d+u*Math.cos(m),c+h*Math.sin(m)]})),{type:"path",ops:x}}function Dr(e,t){let n=Mo(wo(Qn(e))),o=[],i=[0,0],r=[0,0];for(let{key:a,data:s}of n)switch(a){case"M":{r=[s[0],s[1]],i=[s[0],s[1]];break}case"L":o.push(...Ht(r[0],r[1],s[0],s[1],t)),r=[s[0],s[1]];break;case"C":{let[l,d,c,u,h,m]=s;o.push(...gp(l,d,c,u,h,m,r,t)),r=[h,m];break}case"Z":o.push(...Ht(r[0],r[1],i[0],i[1],t)),r=[i[0],i[1]];break}return{type:"path",ops:o}}function fi(e,t){let n=[];for(let o of e)if(o.length){let i=t.maxRandomnessOffset||0,r=o.length;if(r>2){n.push({op:"move",data:[o[0][0]+z(i,t),o[0][1]+z(i,t)]});for(let a=1;a<r;a++)n.push({op:"lineTo",data:[o[a][0]+z(i,t),o[a][1]+z(i,t)]})}}return{type:"fillPath",ops:n}}function Rn(e,t){return Cs(t,dp).fillPolygons(e,t)}function Hs(e,t,n,o,i,r,a){let s=e,l=t,d=Math.abs(n/2),c=Math.abs(o/2);d+=z(d*.01,a),c+=z(c*.01,a);let u=i,h=r;for(;u<0;)u+=Math.PI*2,h+=Math.PI*2;h-u>Math.PI*2&&(u=0,h=Math.PI*2);let m=(h-u)/a.curveStepCount,g=[];for(let f=u;f<=h;f=f+m)g.push([s+d*Math.cos(f),l+c*Math.sin(f)]);return g.push([s+d*Math.cos(h),l+c*Math.sin(h)]),g.push([s,l]),Rn([g],a)}function pp(e,t){return z(e,t)}function hp(e,t,n){return pi(e,t,n)}function mp(e,t,n,o,i){return Ht(e,t,n,o,i,!0)}function fp(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function zs(e){return e.randomizer||(e.randomizer=new ci(e.seed||0)),e.randomizer.next()}function pi(e,t,n,o=1){return n.roughness*o*(zs(n)*(t-e)+e)}function z(e,t,n=1){return pi(-e,e,t,n)}function Ht(e,t,n,o,i,r=!1){let a=r?i.disableMultiStrokeFill:i.disableMultiStroke,s=Gs(e,t,n,o,i,!0,!1);if(a)return s;let l=Gs(e,t,n,o,i,!0,!0);return s.concat(l)}function Gs(e,t,n,o,i,r,a){let s=Math.pow(e-n,2)+Math.pow(t-o,2),l=Math.sqrt(s),d=1;l<200?d=1:l>500?d=.4:d=-.0016668*l+1.233334;let c=i.maxRandomnessOffset||0;c*c*100>s&&(c=l/10);let u=c/2,h=.2+zs(i)*.2,m=i.bowing*i.maxRandomnessOffset*(o-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;m=z(m,i,d),g=z(g,i,d);let f=[],E=()=>z(u,i,d),x=()=>z(c,i,d),y=i.preserveVertices;return r&&(a?f.push({op:"move",data:[e+(y?0:E()),t+(y?0:E())]}):f.push({op:"move",data:[e+(y?0:z(c,i,d)),t+(y?0:z(c,i,d))]})),a?f.push({op:"bcurveTo",data:[m+e+(n-e)*h+E(),g+t+(o-t)*h+E(),m+e+2*(n-e)*h+E(),g+t+2*(o-t)*h+E(),n+(y?0:E()),o+(y?0:E())]}):f.push({op:"bcurveTo",data:[m+e+(n-e)*h+x(),g+t+(o-t)*h+x(),m+e+2*(n-e)*h+x(),g+t+2*(o-t)*h+x(),n+(y?0:x()),o+(y?0:x())]}),f}function Os(e,t,n){let o=[];o.push([e[0][0]+z(t,n),e[0][1]+z(t,n)]),o.push([e[0][0]+z(t,n),e[0][1]+z(t,n)]);for(let i=1;i<e.length;i++)o.push([e[i][0]+z(t,n),e[i][1]+z(t,n)]),i===e.length-1&&o.push([e[i][0]+z(t,n),e[i][1]+z(t,n)]);return hi(o,null,n)}function hi(e,t,n){let o=e.length,i=[];if(o>3){let r=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let s=1;s+2<o;s++){let l=e[s];r[0]=[l[0],l[1]],r[1]=[l[0]+(a*e[s+1][0]-a*e[s-1][0])/6,l[1]+(a*e[s+1][1]-a*e[s-1][1])/6],r[2]=[e[s+1][0]+(a*e[s][0]-a*e[s+2][0])/6,e[s+1][1]+(a*e[s][1]-a*e[s+2][1])/6],r[3]=[e[s+1][0],e[s+1][1]],i.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}if(t&&t.length===2){let s=n.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+z(s,n),t[1]+z(s,n)]})}}else o===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):o===2&&i.push(...Ht(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function Rs(e,t,n,o,i,r,a,s){let l=s.roughness===0,d=[],c=[];if(l){e=e/4,c.push([t+o*Math.cos(-e),n+i*Math.sin(-e)]);for(let u=0;u<=Math.PI*2;u=u+e){let h=[t+o*Math.cos(u),n+i*Math.sin(u)];d.push(h),c.push(h)}c.push([t+o*Math.cos(0),n+i*Math.sin(0)]),c.push([t+o*Math.cos(e),n+i*Math.sin(e)])}else{let u=z(.5,s)-Math.PI/2;c.push([z(r,s)+t+.9*o*Math.cos(u-e),z(r,s)+n+.9*i*Math.sin(u-e)]);let h=Math.PI*2+u-.01;for(let m=u;m<h;m=m+e){let g=[z(r,s)+t+o*Math.cos(m),z(r,s)+n+i*Math.sin(m)];d.push(g),c.push(g)}c.push([z(r,s)+t+o*Math.cos(u+Math.PI*2+a*.5),z(r,s)+n+i*Math.sin(u+Math.PI*2+a*.5)]),c.push([z(r,s)+t+.98*o*Math.cos(u+a),z(r,s)+n+.98*i*Math.sin(u+a)]),c.push([z(r,s)+t+.9*o*Math.cos(u+a*.5),z(r,s)+n+.9*i*Math.sin(u+a*.5)])}return[c,d]}function Fs(e,t,n,o,i,r,a,s,l){let d=r+z(.1,l),c=[];c.push([z(s,l)+t+.9*o*Math.cos(d-e),z(s,l)+n+.9*i*Math.sin(d-e)]);for(let u=d;u<=a;u=u+e)c.push([z(s,l)+t+o*Math.cos(u),z(s,l)+n+i*Math.sin(u)]);return c.push([t+o*Math.cos(a),n+i*Math.sin(a)]),c.push([t+o*Math.cos(a),n+i*Math.sin(a)]),hi(c,null,l)}function gp(e,t,n,o,i,r,a,s){let l=[],d=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],c=[0,0],u=s.disableMultiStroke?1:2,h=s.preserveVertices;for(let m=0;m<u;m++)m===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(h?0:z(d[0],s)),a[1]+(h?0:z(d[0],s))]}),c=h?[i,r]:[i+z(d[m],s),r+z(d[m],s)],l.push({op:"bcurveTo",data:[e+z(d[m],s),t+z(d[m],s),n+z(d[m],s),o+z(d[m],s),c[0],c[1]]});return l}I();function Io(e){return[...e]}function Ws(e,t=0){let n=e.length;if(n<3)throw new Error("A curve must have at least three points.");let o=[];if(n===3)o.push(Io(e[0]),Io(e[1]),Io(e[2]),Io(e[2]));else{let i=[];i.push(e[0],e[0]);for(let s=1;s<e.length;s++)i.push(e[s]),s===e.length-1&&i.push(e[s]);let r=[],a=1-t;o.push(Io(i[0]));for(let s=1;s+2<i.length;s++){let l=i[s];r[0]=[l[0],l[1]],r[1]=[l[0]+(a*i[s+1][0]-a*i[s-1][0])/6,l[1]+(a*i[s+1][1]-a*i[s-1][1])/6],r[2]=[i[s+1][0]+(a*i[s][0]-a*i[s+2][0])/6,i[s+1][1]+(a*i[s][1]-a*i[s+2][1])/6],r[3]=[i[s+1][0],i[s+1][1]],o.push(r[1],r[2],r[3])}}return o}I();function Ep(e,t){return Math.sqrt(gi(e,t))}function gi(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function xp(e,t,n){let o=gi(t,n);if(o===0)return gi(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/o;return i=Math.max(0,Math.min(1,i)),gi(e,Fn(t,n,i))}function Fn(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function yp(e,t){let n=e[t+0],o=e[t+1],i=e[t+2],r=e[t+3],a=3*o[0]-2*n[0]-r[0];a*=a;let s=3*o[1]-2*n[1]-r[1];s*=s;let l=3*i[0]-2*r[0]-n[0];l*=l;let d=3*i[1]-2*r[1]-n[1];return d*=d,a<l&&(a=l),s<d&&(s=d),a+s}function Gr(e,t,n,o){let i=o||[];if(yp(e,t)<n){let r=e[t+0];i.length?Ep(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{let a=e[t+0],s=e[t+1],l=e[t+2],d=e[t+3],c=Fn(a,s,.5),u=Fn(s,l,.5),h=Fn(l,d,.5),m=Fn(c,u,.5),g=Fn(u,h,.5),f=Fn(m,g,.5);Gr([a,c,m,f],0,n,i),Gr([f,g,h,d],0,n,i)}return i}function So(e,t){return Ei(e,0,e.length,t)}function Ei(e,t,n,o,i){let r=i||[],a=e[t],s=e[n-1],l=0,d=1;for(let c=t+1;c<n-1;++c){let u=xp(e[c],a,s);u>l&&(l=u,d=c)}return Math.sqrt(l)>o?(Ei(e,t,d+1,o,r),Ei(e,d,n,o,r)):(r.length||r.push(a),r.push(s)),r}function zt(e,t=.15,n){let o=[],i=(e.length-1)/3;for(let r=0;r<i;r++){let a=r*3;Gr(e,a,t,o)}return n&&n>0?Ei(o,0,o.length,n):o}I();function _s(e,t,n){let o=Qn(e),i=Mo(wo(o)),r=[],a=[],s=[0,0],l=[],d=()=>{l.length>=4&&a.push(...zt(l,t)),l=[]},c=()=>{d(),a.length&&(r.push(a),a=[])};for(let{key:h,data:m}of i)switch(h){case"M":c(),s=[m[0],m[1]],a.push(s);break;case"L":d(),a.push([m[0],m[1]]);break;case"C":if(!l.length){let g=a.length?a[a.length-1]:s;l.push([g[0],g[1]])}l.push([m[0],m[1]]),l.push([m[2],m[3]]),l.push([m[4],m[5]]);break;case"Z":d(),a.push([s[0],s[1]]);break}if(c(),!n)return r;let u=[];for(let h of r){let m=So(h,n);m.length&&u.push(m)}return u}var tt="none",lt=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Bs()}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,o){return{shape:t,sets:n||[],options:o||this.defaultOptions}}line(t,n,o,i,r){let a=this._o(r);return this._d("line",[Tr(t,n,o,i,a)],a)}rectangle(t,n,o,i,r){let a=this._o(r),s=[],l=Ns(t,n,o,i,a);if(a.fill){let d=[[t,n],[t+o,n],[t+o,n+i],[t,n+i]];a.fillStyle==="solid"?s.push(fi([d],a)):s.push(Rn([d],a))}return a.stroke!==tt&&s.push(l),this._d("rectangle",s,a)}ellipse(t,n,o,i,r){let a=this._o(r),s=[],l=Cr(o,i,a),d=mi(t,n,a,l);if(a.fill)if(a.fillStyle==="solid"){let c=mi(t,n,a,l).opset;c.type="fillPath",s.push(c)}else s.push(Rn([d.estimatedPoints],a));return a.stroke!==tt&&s.push(d.opset),this._d("ellipse",s,a)}circle(t,n,o,i){let r=this.ellipse(t,n,o,o,i);return r.shape="circle",r}linearPath(t,n){let o=this._o(n);return this._d("linearPath",[Po(t,!1,o)],o)}arc(t,n,o,i,r,a,s=!1,l){let d=this._o(l),c=[],u=Br(t,n,o,i,r,a,s,!0,d);if(s&&d.fill)if(d.fillStyle==="solid"){let h=Object.assign({},d);h.disableMultiStroke=!0;let m=Br(t,n,o,i,r,a,!0,!1,h);m.type="fillPath",c.push(m)}else c.push(Hs(t,n,o,i,r,a,d));return d.stroke!==tt&&c.push(u),this._d("arc",c,d)}curve(t,n){let o=this._o(n),i=[],r=Lr(t,o);if(o.fill&&o.fill!==tt&&t.length>=3)if(o.fillStyle==="solid"){let a=Lr(t,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{let a=Ws(t),s=zt(a,10,(1+o.roughness)/2);i.push(Rn([s],o))}return o.stroke!==tt&&i.push(r),this._d("curve",i,o)}polygon(t,n){let o=this._o(n),i=[],r=Po(t,!0,o);return o.fill&&(o.fillStyle==="solid"?i.push(fi([t],o)):i.push(Rn([t],o))),o.stroke!==tt&&i.push(r),this._d("polygon",i,o)}path(t,n){let o=this._o(n),i=[];if(!t)return this._d("path",i,o);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let r=o.fill&&o.fill!=="transparent"&&o.fill!==tt,a=o.stroke!==tt,s=!!(o.simplification&&o.simplification<1),l=s?4-4*(o.simplification||1):(1+o.roughness)/2,d=_s(t,1,l),c=Dr(t,o);if(r)if(o.fillStyle==="solid")if(d.length===1){let u=Dr(t,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else i.push(fi(d,o));else i.push(Rn(d,o));return a&&(s?d.forEach(u=>{i.push(Po(u,!1,o))}):i.push(c)),this._d("path",i,o)}opsToPath(t,n){let o="";for(let i of t.ops){let r=typeof n=="number"&&n>=0?i.data.map(a=>+a.toFixed(n)):i.data;switch(i.op){case"move":o+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":o+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":o+=`L${r[0]} ${r[1]} `;break}}return o.trim()}toPaths(t){let n=t.sets||[],o=t.options||this.defaultOptions,i=[];for(let r of n){let a=null;switch(r.type){case"path":a={d:this.opsToPath(r),stroke:o.stroke,strokeWidth:o.strokeWidth,fill:tt};break;case"fillPath":a={d:this.opsToPath(r),stroke:tt,strokeWidth:0,fill:o.fill||tt};break;case"fillSketch":a=this.fillSketch(r,o);break}a&&i.push(a)}return i}fillSketch(t,n){let o=n.fillWeight;return o<0&&(o=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||tt,strokeWidth:o,fill:tt}}_mergedShape(t){return t.filter((n,o)=>o===0?!0:n.op!=="move")}};var xi=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new lt(n)}draw(t){let n=t.sets||[],o=t.options||this.getDefaultOptions(),i=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(let a of n)switch(a.type){case"path":i.save(),i.strokeStyle=o.stroke==="none"?"transparent":o.stroke,i.lineWidth=o.strokeWidth,o.strokeLineDash&&i.setLineDash(o.strokeLineDash),o.strokeLineDashOffset&&(i.lineDashOffset=o.strokeLineDashOffset),this._drawToContext(i,a,r),i.restore();break;case"fillPath":{i.save(),i.fillStyle=o.fill||"";let s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,a,r,s),i.restore();break}case"fillSketch":this.fillSketch(i,a,o);break}}fillSketch(t,n,o){let i=o.fillWeight;i<0&&(i=o.strokeWidth/2),t.save(),o.fillLineDash&&t.setLineDash(o.fillLineDash),o.fillLineDashOffset&&(t.lineDashOffset=o.fillLineDashOffset),t.strokeStyle=o.fill||"",t.lineWidth=i,this._drawToContext(t,n,o.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,o,i="nonzero"){t.beginPath();for(let r of n.ops){let a=typeof o=="number"&&o>=0?r.data.map(s=>+s.toFixed(o)):r.data;switch(r.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1]);break}}n.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,o,i,r){let a=this.gen.line(t,n,o,i,r);return this.draw(a),a}rectangle(t,n,o,i,r){let a=this.gen.rectangle(t,n,o,i,r);return this.draw(a),a}ellipse(t,n,o,i,r){let a=this.gen.ellipse(t,n,o,i,r);return this.draw(a),a}circle(t,n,o,i){let r=this.gen.circle(t,n,o,i);return this.draw(r),r}linearPath(t,n){let o=this.gen.linearPath(t,n);return this.draw(o),o}polygon(t,n){let o=this.gen.polygon(t,n);return this.draw(o),o}arc(t,n,o,i,r,a,s=!1,l){let d=this.gen.arc(t,n,o,i,r,a,s,l);return this.draw(d),d}curve(t,n){let o=this.gen.curve(t,n);return this.draw(o),o}path(t,n){let o=this.gen.path(t,n);return this.draw(o),o}};I();I();var vo="http://www.w3.org/2000/svg";var yi=class{constructor(t,n){this.svg=t,this.gen=new lt(n)}draw(t){let n=t.sets||[],o=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,r=i.createElementNS(vo,"g"),a=t.options.fixedDecimalPlaceDigits;for(let s of n){let l=null;switch(s.type){case"path":{l=i.createElementNS(vo,"path"),l.setAttribute("d",this.opsToPath(s,a)),l.setAttribute("stroke",o.stroke),l.setAttribute("stroke-width",o.strokeWidth+""),l.setAttribute("fill","none"),o.strokeLineDash&&l.setAttribute("stroke-dasharray",o.strokeLineDash.join(" ").trim()),o.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${o.strokeLineDashOffset}`);break}case"fillPath":{l=i.createElementNS(vo,"path"),l.setAttribute("d",this.opsToPath(s,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",o.fill||""),(t.shape==="curve"||t.shape==="polygon")&&l.setAttribute("fill-rule","evenodd");break}case"fillSketch":{l=this.fillSketch(i,s,o);break}}l&&r.appendChild(l)}return r}fillSketch(t,n,o){let i=o.fillWeight;i<0&&(i=o.strokeWidth/2);let r=t.createElementNS(vo,"path");return r.setAttribute("d",this.opsToPath(n,o.fixedDecimalPlaceDigits)),r.setAttribute("stroke",o.fill||""),r.setAttribute("stroke-width",i+""),r.setAttribute("fill","none"),o.fillLineDash&&r.setAttribute("stroke-dasharray",o.fillLineDash.join(" ").trim()),o.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${o.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,o,i,r){let a=this.gen.line(t,n,o,i,r);return this.draw(a)}rectangle(t,n,o,i,r){let a=this.gen.rectangle(t,n,o,i,r);return this.draw(a)}ellipse(t,n,o,i,r){let a=this.gen.ellipse(t,n,o,i,r);return this.draw(a)}circle(t,n,o,i){let r=this.gen.circle(t,n,o,i);return this.draw(r)}linearPath(t,n){let o=this.gen.linearPath(t,n);return this.draw(o)}polygon(t,n){let o=this.gen.polygon(t,n);return this.draw(o)}arc(t,n,o,i,r,a,s=!1,l){let d=this.gen.arc(t,n,o,i,r,a,s,l);return this.draw(d)}curve(t,n){let o=this.gen.curve(t,n);return this.draw(o)}path(t,n){let o=this.gen.path(t,n);return this.draw(o)}};var Nn={canvas(e,t){return new xi(e,t)},svg(e,t){return new yi(e,t)},generator(e){return new lt(e)},newSeed(){return lt.newSeed()}};import{arrayToMap as Va,invariant as _a,rescalePoints as rc,sizeOf as jm}from"@excalidraw/common";import{degreesToRadians as Wa,lineSegment as fe,pointDistance as Vm,pointFrom as B,pointFromArray as cc,pointRotateRads as ie}from"@excalidraw/math";I();import{invariant as wp}from"@excalidraw/common";import{curve as bp,lineSegment as Mp,pointFrom as he,pointDistance as T2,pointFromArray as Pp,pointFromVector as Ip,pointRotateRads as mt,polygon as js,polygonFromPoints as Or,PRECISION as L2,segmentsIntersectAt as C2,vector as Sp,vectorAdd as vp,vectorFromPoint as Ap,vectorScale as B2}from"@excalidraw/math";import{getElementAbsoluteCoords as G2}from"@excalidraw/element";var Vs=e=>{let{angle:t,width:n,height:o,x:i,y:r}=e,a=i+n/2,s=r+o/2,l=he(a,s),d;return e.type==="diamond"?d=js(mt(he(a,r),l,t),mt(he(i+n,s),l,t),mt(he(a,r+o),l,t),mt(he(i,s),l,t)):d=js(mt(he(i,r),l,t),mt(he(i+n,r),l,t),mt(he(i+n,r+o),l,t),mt(he(i,r+o),l,t)),{type:"polygon",data:d}};var Ys=e=>{let{width:t,height:n,angle:o,x:i,y:r}=e;return{type:"ellipse",data:{center:he(i+t/2,r+n/2),angle:o,halfWidth:t/2,halfHeight:n/2}}},Wt=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},Us=(e,t=he(0,0),n,o)=>{let i=l=>mt(he(l[0]+t[0],l[1]+t[1]),o,n),r=Wt(e),a=[],s=he(0,0);for(let l of r){if(l.op==="move"){let d=Pp(l.data);wp(d!=null,"Ops data is not a point"),s=i(d)}if(l.op==="bcurveTo"){let d=i(he(l.data[0],l.data[1])),c=i(he(l.data[2],l.data[3])),u=i(he(l.data[4],l.data[5]));a.push(bp(s,d,c,u)),s=u}}return{type:"polycurve",data:a}},kp=e=>{let t=e[0],n=[];for(let o=1;o<e.length;o++){let i=e[o];n.push(Mp(t,i)),t=i}return n},Xs=(e,t,n=!1)=>{let o=r=>mt(Ip(vp(Ap(r),Sp(e.x,e.y))),t,e.angle),i=kp(e.points.map(r=>o(r)));return n?{type:"polygon",data:Or(i.flat())}:{type:"polyline",data:i}},$s=(e,t,n=he(0,0),o,i)=>{let r=c=>mt(he(c[0]+n[0],c[1]+n[1]),i,o);if(e.roundness===null)return{type:"polygon",data:Or(e.points.map(c=>r(c)))};let a=Wt(t),s=[],l=!1;for(let c of a)c.op==="move"?(l=!l,l&&s.push(he(c.data[0],c.data[1]))):c.op==="bcurveTo"?l&&(s.push(he(c.data[0],c.data[1])),s.push(he(c.data[2],c.data[3])),s.push(he(c.data[4],c.data[5]))):c.op==="lineTo"&&l&&s.push(he(c.data[0],c.data[1]));let d=zt(s,10,5).map(c=>r(c));return{type:"polygon",data:Or(d)}};I();I();function Zs(e,t,n,o=i=>i){return e*o(.5-t*(.5-n))}function Tp(e){return[-e[0],-e[1]]}function gt(e,t){return[e[0]+t[0],e[1]+t[1]]}function dt(e,t){return[e[0]-t[0],e[1]-t[1]]}function ft(e,t){return[e[0]*t,e[1]*t]}function Lp(e,t){return[e[0]/t,e[1]/t]}function Ao(e){return[e[1],-e[0]]}function qs(e,t){return e[0]*t[0]+e[1]*t[1]}function Cp(e,t){return e[0]===t[0]&&e[1]===t[1]}function Bp(e){return Math.hypot(e[0],e[1])}function Dp(e){return e[0]*e[0]+e[1]*e[1]}function Ks(e,t){return Dp(dt(e,t))}function el(e){return Lp(e,Bp(e))}function Gp(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function ko(e,t,n){let o=Math.sin(n),i=Math.cos(n),r=e[0]-t[0],a=e[1]-t[1],s=r*i-a*o,l=r*o+a*i;return[s+t[0],l+t[1]]}function Rr(e,t,n){return gt(e,ft(dt(t,e),n))}function Qs(e,t,n){return gt(e,ft(t,n))}var{min:Jn,PI:Op}=Math,Js=.275,To=Op+1e-4;function Rp(e,t={}){let{size:n=16,smoothing:o=.5,thinning:i=.5,simulatePressure:r=!0,easing:a=H=>H,start:s={},end:l={},last:d=!1}=t,{cap:c=!0,easing:u=H=>H*(2-H)}=s,{cap:h=!0,easing:m=H=>--H*H*H+1}=l;if(e.length===0||n<=0)return[];let g=e[e.length-1].runningLength,f=s.taper===!1?0:s.taper===!0?Math.max(n,g):s.taper,E=l.taper===!1?0:l.taper===!0?Math.max(n,g):l.taper,x=Math.pow(n*o,2),y=[],w=[],M=e.slice(0,10).reduce((H,A)=>{let _=A.pressure;if(r){let X=Jn(1,A.distance/n),ve=Jn(1,1-X);_=Jn(1,H+(ve-H)*(X*Js))}return(H+_)/2},e[0].pressure),b=Zs(n,i,e[e.length-1].pressure,a),S,v=e[0].vector,k=e[0].point,T=k,R=k,O=T,N=!1;for(let H=0;H<e.length;H++){let{pressure:A}=e[H],{point:_,vector:X,distance:ve,runningLength:At}=e[H];if(H<e.length-1&&g-At<3)continue;if(i){if(r){let et=Jn(1,ve/n),st=Jn(1,1-et);A=Jn(1,M+(st-M)*(et*Js))}b=Zs(n,i,A,a)}else b=n/2;S===void 0&&(S=b);let ei=At<f?u(At/f):1,Sr=g-At<E?m((g-At)/E):1;b=Math.max(.01,b*Math.min(ei,Sr));let ti=(H<e.length-1?e[H+1]:e[H]).vector,xo=H<e.length-1?qs(X,ti):1,vr=qs(X,v)<0&&!N,ni=xo!==null&&xo<0;if(vr||ni){let et=ft(Ao(v),b);for(let st=1/13,sn=0;sn<=1;sn+=st)R=ko(dt(_,et),_,To*sn),y.push(R),O=ko(gt(_,et),_,To*-sn),w.push(O);k=R,T=O,ni&&(N=!0);continue}if(N=!1,H===e.length-1){let et=ft(Ao(X),b);y.push(dt(_,et)),w.push(gt(_,et));continue}let oi=ft(Ao(Rr(ti,X,xo)),b);R=dt(_,oi),(H<=1||Ks(k,R)>x)&&(y.push(R),k=R),O=gt(_,oi),(H<=1||Ks(T,O)>x)&&(w.push(O),T=O),M=A,v=X}let G=e[0].point.slice(0,2),q=e.length>1?e[e.length-1].point.slice(0,2):gt(e[0].point,[1,1]),U=[],le=[];if(e.length===1){if(!(f||E)||d){let H=Qs(G,el(Ao(dt(G,q))),-(S||b)),A=[];for(let _=1/13,X=_;X<=1;X+=_)A.push(ko(H,G,To*2*X));return A}}else{if(!(f||E&&e.length===1))if(c)for(let A=1/13,_=A;_<=1;_+=A){let X=ko(w[0],G,To*_);U.push(X)}else{let A=dt(y[0],w[0]),_=ft(A,.5),X=ft(A,.51);U.push(dt(G,_),dt(G,X),gt(G,X),gt(G,_))}let H=Ao(Tp(e[e.length-1].vector));if(E||f&&e.length===1)le.push(q);else if(h){let A=Qs(q,H,b);for(let _=1/29,X=_;X<1;X+=_)le.push(ko(A,q,To*3*X))}else le.push(gt(q,ft(H,b)),gt(q,ft(H,b*.99)),dt(q,ft(H,b*.99)),dt(q,ft(H,b)))}return y.concat(le,w.reverse(),U)}function Fp(e,t={}){var n;let{streamline:o=.5,size:i=16,last:r=!1}=t;if(e.length===0)return[];let a=.15+(1-o)*.85,s=Array.isArray(e[0])?e:e.map(({x:m,y:g,pressure:f=.5})=>[m,g,f]);if(s.length===2){let m=s[1];s=s.slice(0,-1);for(let g=1;g<5;g++)s.push(Rr(s[0],m,g/4))}s.length===1&&(s=[...s,[...gt(s[0],[1,1]),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,c=0,u=l[0],h=s.length-1;for(let m=1;m<s.length;m++){let g=r&&m===h?s[m].slice(0,2):Rr(u.point,s[m],a);if(Cp(u.point,g))continue;let f=Gp(g,u.point);if(c+=f,m<h&&!d){if(c<i)continue;d=!0}u={point:g,pressure:s[m][2]>=0?s[m][2]:.5,vector:el(dt(u.point,g)),distance:f,runningLength:c},l.push(u)}return l[0].vector=((n=l[1])==null?void 0:n.vector)||[0,0],l}function tl(e,t={}){return Rp(Fp(e,t),t)}import{pointFrom as me,pointDistance as Jd,pointRotateRads as nn}from"@excalidraw/math";import{ROUGHNESS as Bm,THEME as za,isTransparent as qo,assertNever as Dm,COLOR_PALETTE as Gm,LINE_POLYGON_POINT_MERGE_DISTANCE as Om,applyDarkModeFilter as Ko}from"@excalidraw/common";I();import{isRightAngleRads as ym,lineSegment as $d,pointFrom as Ji,pointRotateRads as Ra}from"@excalidraw/math";import{BOUND_TEXT_PADDING as er,DEFAULT_REDUCED_GLOBAL_ALPHA as wm,ELEMENT_READY_TO_ERASE_OPACITY as bm,FRAME_STYLE as tr,DARK_THEME_FILTER as Mm,MIME_TYPES as Na,THEME as lo,distance as kn,getFontString as Pm,isRTL as Im,getVerticalOffset as Sm,invariant as vm,applyDarkModeFilter as or,isSafari as Am}from"@excalidraw/common";I();import{pointFrom as _t,pointCenter as Np,pointRotateRads as cn,vectorFromPoint as Fr,vectorNormalize as nl,vectorSubtract as ol,vectorAdd as wi,vectorScale as bi,pointFromVector as il,clamp as Le,isCloseTo as rl}from"@excalidraw/math";var Ce=10,W2=(e,t,n,o,i,r,a,s)=>{let{width:l,height:d}=Nr(e),c=o/l,u=i/d,h=(e.crop?.x??0)/c,m=(e.crop?.y??0)/u,g=cn(_t(r,a),de(e,t),-e.angle);r=g[0],a=g[1];let f=e.width,E=e.height,x=e.crop??{x:0,y:0,width:o,height:i,naturalWidth:o,naturalHeight:i},y=x.height,w=x.width,M=e.scale[0]===-1,b=e.scale[1]===-1,S=a-e.y,v=r-e.x;n.includes("n")&&(E=Le(e.height-S,Ce,b?d-m:e.height+m)),n.includes("s")&&(S=a-e.y-e.height,E=Le(e.height+S,Ce,b?e.height+m:d-m)),n.includes("e")&&(v=r-e.x-e.width,f=Le(e.width+v,Ce,M?e.width+h:l-h)),n.includes("w")&&(f=Le(e.width-v,Ce,M?l-h:e.width+h));let k=O=>{O.height=E*u,O.width=f*c};k(x);let T=(O,N)=>{k(N),O.includes("n")&&(b||(N.y+=y-N.height)),O.includes("s")&&b&&(N.y+=y-N.height),O.includes("e")&&M&&(N.x+=w-N.width),O.includes("w")&&(M||(N.x+=w-N.width))};switch(n){case"n":{if(s){let O=h+e.width/2,N=l-h-e.width/2,G=Math.min(O,N)*2;f=Le(E*s,Ce,G),E=f/s}T(n,x),s&&(x.x+=(w-x.width)/2);break}case"s":{if(s){let O=h+e.width/2,N=l-h-e.width/2,G=Math.min(O,N)*2;f=Le(E*s,Ce,G),E=f/s}T(n,x),s&&(x.x+=(w-x.width)/2);break}case"w":{if(s){let O=m+e.height/2,N=d-m-e.height/2,G=Math.min(O,N)*2;E=Le(f/s,Ce,G),f=E*s}T(n,x),s&&(x.y+=(y-x.height)/2);break}case"e":{if(s){let O=m+e.height/2,N=d-m-e.height/2,G=Math.min(O,N)*2;E=Le(f/s,Ce,G),f=E*s}T(n,x),s&&(x.y+=(y-x.height)/2);break}case"ne":{if(s)if(v>-S){let O=b?d-m:m+e.height;E=Le(f/s,Ce,O),f=E*s}else{let O=M?h+e.width:l-h;f=Le(E*s,Ce,O),E=f/s}T(n,x);break}case"nw":{if(s)if(v<S){let O=b?d-m:m+e.height;E=Le(f/s,Ce,O),f=E*s}else{let O=M?l-h:h+e.width;f=Le(E*s,Ce,O),E=f/s}T(n,x);break}case"se":{if(s)if(v>S){let O=b?m+e.height:d-m;E=Le(f/s,Ce,O),f=E*s}else{let O=M?h+e.width:l-h;f=Le(E*s,Ce,O),E=f/s}T(n,x);break}case"sw":{if(s)if(-v>S){let O=b?m+e.height:d-m;E=Le(f/s,Ce,O),f=E*s}else{let O=M?l-h:h+e.width;f=Le(E*s,Ce,O),E=f/s}T(n,x);break}default:break}let R=Hp(e,n,f,E,!!s);return rl(x.width,x.naturalWidth)&&rl(x.height,x.naturalHeight)&&(x=null),{x:R[0],y:R[1],width:f,height:E,crop:x}},Hp=(e,t,n,o,i)=>{let[r,a,s,l]=un(e,e.width,e.height,!0),d=_t(r,a),c=_t(s,l),u=Np(d,c),[h,m,g,f]=un(e,n,o,!0),E=g-h,x=f-m,y=[...d];if(["n","w","nw"].includes(t)&&(y=[c[0]-Math.abs(E),c[1]-Math.abs(x)]),t==="ne"){let k=[d[0],c[1]];y=[k[0],k[1]-Math.abs(x)]}if(t==="sw"){let k=[c[0],d[1]];y=[k[0]-Math.abs(E),k[1]]}i&&(["s","n"].includes(t)&&(y[0]=u[0]-E/2),["e","w"].includes(t)&&(y[1]=u[1]-x/2));let w=e.angle,M=cn(y,u,w),b=[y[0]+Math.abs(E)/2,y[1]+Math.abs(x)/2],S=cn(b,u,w);y=cn(M,S,-w);let v=[...y];return v[0]+=e.x-h,v[1]+=e.y-m,v},al=(e,t)=>{if(e.crop){let{width:n,height:o}=Nr(e),[i,r,a,s,l,d]=K(e,t),c=Fr(cn(_t(i,r),_t(l,d),e.angle)),u=Fr(cn(_t(a,r),_t(l,d),e.angle)),h=nl(ol(u,c)),m=Fr(cn(_t(i,s),_t(l,d),e.angle)),g=ol(m,c),f=nl(g),{cropX:E,cropY:x}=zp(e.crop,e.scale),y=wi(wi(c,bi(h,-E*n/e.crop.naturalWidth)),bi(f,-x*o/e.crop.naturalHeight)),w=il(wi(wi(y,bi(h,n/2)),bi(f,o/2))),M=cn(il(y),w,-e.angle);return{...e,x:M[0],y:M[1],width:n,height:o,crop:null}}return e},Nr=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),n=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:n}}return{width:e.width,height:e.height}},zp=(e,t)=>{let n=e.x,o=e.y,i=t[0]===-1,r=t[1]===-1;return i&&(n=e.naturalWidth-Math.abs(n)-e.width),r&&(o=e.naturalHeight-Math.abs(o)-e.height),{cropX:n,cropY:o}},_2=(e,t=!1)=>{let n=e.crop;if(!n)return null;let o=e.scale[0]===-1,i=e.scale[1]===-1,r=n.x,a=n.y;if(o&&(r=n.naturalWidth-n.width-n.x),i&&(a=n.naturalHeight-n.height-n.y),t)return{x:r,y:a};let{width:s,height:l}=Nr(e);return{x:r/(n.naturalWidth/s),y:a/(n.naturalHeight/l)}};I();import{pointCenter as Wd,pointFrom as F,pointRotateRads as _e,pointsEqual as _d,pointDistance as Xn,vectorFromPoint as hm,curveLength as mm,curvePointAtLength as fm}from"@excalidraw/math";import{DRAGGING_THRESHOLD as gm,KEYS as Un,shouldRotateWithDiscreteAngle as Uo,getGridPoint as jd,invariant as Ke,isShallowEqual as Em,getFeatureFlag as so}from"@excalidraw/common";I();import{arrayToMap as ld,getFeatureFlag as xh,invariant as wt,isTransparent as yh}from"@excalidraw/common";import{PRECISION as jo,clamp as wa,lineSegment as Ui,pointDistance as bn,pointDistanceSq as tn,pointFrom as se,pointFromVector as Vi,pointRotateRads as pe,pointsEqual as wh,vectorFromPoint as Wo,vectorNormalize as ya,vectorScale as Yi}from"@excalidraw/math";I();import{invariant as Fl,isTransparent as Nl}from"@excalidraw/common";import{curveIntersectLineSegment as Hl,isPointWithinBounds as oa,lineSegment as Fo,lineSegmentIntersectionPoints as zl,pointFrom as Pe,pointFromVector as N1,pointRotateRads as it,pointsEqual as Wl,vectorFromPoint as H1,vectorNormalize as z1,vectorScale as W1}from"@excalidraw/math";import{ellipse as _1,ellipseSegmentInterceptPoints as j1}from"@excalidraw/math/ellipse";I();import{DEFAULT_ADAPTIVE_RADIUS as $p,DEFAULT_PROPORTIONAL_RADIUS as zr,invariant as Zp,LINE_CONFIRM_THRESHOLD as qp,ROUNDNESS as Wr}from"@excalidraw/common";import{bezierEquation as Kp,curve as Vt,curveCatmullRomCubicApproxPoints as El,curveOffsetPoints as xl,lineSegment as Ie,lineSegmentIntersectionPoints as fl,pointDistance as zn,pointFrom as W,pointFromArray as Qp,pointFromVector as Jp,pointRotateRads as nt,pointTranslate as gl,rectangle as e1,vectorFromPoint as yl,vectorNormalize as t1,vectorScale as _r}from"@excalidraw/math";I();import{ROUNDNESS as Lo,assertNever as Wp}from"@excalidraw/common";import{pointsEqual as sl}from"@excalidraw/math";var Hn=e=>!!e&&e.type==="image"&&!!e.fileId,Ae=e=>!!e&&e.type==="image",ll=e=>!!e&&e.type==="embeddable",Mi=e=>!!e&&e.type==="iframe",Pi=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),te=e=>e!=null&&e.type==="text",Ii=e=>e!=null&&e.type==="frame",dl=e=>e!=null&&e.type==="magicframe",ee=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),Se=e=>e!=null&&_p(e.type),_p=e=>e==="freedraw",ne=e=>e!=null&&Yp(e.type),jt=e=>e!=null&&e.type==="line",j=e=>e!=null&&e.type==="arrow",Y=e=>j(e)&&e.elbowed,X2=e=>j(e)&&!e.elbowed,jp=e=>j(e)&&!e.elbowed&&!e.roundness,Vp=e=>j(e)&&!e.elbowed&&e.roundness!==null,Yp=e=>e==="arrow"||e==="line",Be=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&Up(e.type),Up=e=>e==="arrow",Ee=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),cl=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),Co=e=>e!=null&&(e.type==="rectangle"||e.type==="image"||e.type==="text"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="freedraw"),Xp=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||j(e)),ul=e=>{let t=e?.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return Wp(t,null),!1}},Hr=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",Tt=e=>Xp(e)&&!!e.boundElements?.some(({type:t})=>t==="text"),xe=e=>e!==null&&"containerId"in e&&e.containerId!==null&&te(e),$2=e=>!!e.startBinding||!!e.endBinding,pl=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",hl=e=>e==="line"||e==="arrow"||e==="diamond",Z2=(e,t)=>!!((e===Lo.ADAPTIVE_RADIUS||e===Lo.LEGACY)&&pl(t.type)||e===Lo.PROPORTIONAL_RADIUS&&hl(t.type)),q2=e=>hl(e.type)?{type:Lo.PROPORTIONAL_RADIUS}:pl(e.type)?{type:Lo.ADAPTIVE_RADIUS}:null,K2=e=>jp(e)?"sharpArrow":Vp(e)?"curvedArrow":Y(e)?"elbowArrow":"line",Q2=e=>e.length>3&&sl(e[0],e[e.length-1]),ml=e=>e.length>3||e.length===3&&!sl(e[0],e[e.length-1]),J2=e=>{switch(e){case"rectangle":case"diamond":case"ellipse":case"arrow":case"line":case"freedraw":case"text":case"image":case"frame":case"embeddable":return!0;default:return!1}};var Bo=new WeakMap,jr=(e,t)=>{let n=Bo.get(e);if(!n)return;let{version:o,shapes:i}=n;if(o!==e.version){Bo.delete(e);return}return i.get(t)},Vr=(e,t,n)=>{let o=Bo.get(e);if(!o){Bo.set(e,{version:e.version,shapes:new Map([[n,t]])});return}let{version:i,shapes:r}=o;if(i!==e.version){Bo.set(e,{version:e.version,shapes:new Map([[n,t]])});return}r.set(n,t)};function Wn(e,t){let n=jr(e,0);if(n)return n;let o=bl(e,t),i=[],r=[];for(let s=0;s<o.length;s+=1){let l=o[s],d=o[s-1]&&Qp(o[s-1].data.slice(-2));switch(l.op){case"move":continue;case"lineTo":if(!d)throw new Error("prevPoint is undefined");i.push(Ie(W(e.x+d[0],e.y+d[1]),W(e.x+l.data[0],e.y+l.data[1])));continue;case"bcurveTo":if(!d)throw new Error("prevPoint is undefined");r.push(Vt(W(e.x+d[0],e.y+d[1]),W(e.x+l.data[0],e.y+l.data[1]),W(e.x+l.data[2],e.y+l.data[3]),W(e.x+l.data[4],e.y+l.data[5])));continue;default:console.error("Unknown op type",l.op)}}let a=[i,r];return Vr(e,a,0),a}function pn(e,t=0){let n=jr(e,t);if(n)return n;let o=Yt(Math.min(e.width,e.height),e);o===0&&(o=.01);let i=e1(W(e.x,e.y),W(e.x+e.width,e.y+e.height)),r=Ie(W(i[0][0]+o,i[0][1]),W(i[1][0]-o,i[0][1])),a=Ie(W(i[1][0],i[0][1]+o),W(i[1][0],i[1][1]-o)),s=Ie(W(i[0][0]+o,i[1][1]),W(i[1][0]-o,i[1][1])),l=Ie(W(i[0][0],i[1][1]-o),W(i[0][0],i[0][1]+o)),d=[Vt(l[1],W(l[1][0]+2/3*(i[0][0]-l[1][0]),l[1][1]+2/3*(i[0][1]-l[1][1])),W(r[0][0]+2/3*(i[0][0]-r[0][0]),r[0][1]+2/3*(i[0][1]-r[0][1])),r[0]),Vt(r[1],W(r[1][0]+2/3*(i[1][0]-r[1][0]),r[1][1]+2/3*(i[0][1]-r[1][1])),W(a[0][0]+2/3*(i[1][0]-a[0][0]),a[0][1]+2/3*(i[0][1]-a[0][1])),a[0]),Vt(a[1],W(a[1][0]+2/3*(i[1][0]-a[1][0]),a[1][1]+2/3*(i[1][1]-a[1][1])),W(s[1][0]+2/3*(i[1][0]-s[1][0]),s[1][1]+2/3*(i[1][1]-s[1][1])),s[1]),Vt(s[0],W(s[0][0]+2/3*(i[0][0]-s[0][0]),s[0][1]+2/3*(i[1][1]-s[0][1])),W(l[0][0]+2/3*(i[0][0]-l[0][0]),l[0][1]+2/3*(i[1][1]-l[0][1])),l[0])],c=t>0?d.map(m=>El(xl(m,t))):[[d[0]],[d[1]],[d[2]],[d[3]]],h=[[Ie(c[0][c[0].length-1][3],c[1][0][0]),Ie(c[1][c[1].length-1][3],c[2][0][0]),Ie(c[2][c[2].length-1][3],c[3][0][0]),Ie(c[3][c[3].length-1][3],c[0][0][0])],c.flat()];return Vr(e,h,t),h}function wl(e,t=0){let[n,o,i,r,a,s,l,d]=to(e),c=e.roundness?Yt(Math.abs(n-l),e):(n-l)*.01,u=e.roundness?Yt(Math.abs(r-o),e):(r-o)*.01,[h,m,g,f]=[W(e.x+n,e.y+o),W(e.x+i,e.y+r),W(e.x+a,e.y+s),W(e.x+l,e.y+d)];return[Vt(W(m[0]-c,m[1]-u),m,m,W(m[0]-c,m[1]+u)),Vt(W(g[0]+c,g[1]-u),g,g,W(g[0]-c,g[1]-u)),Vt(W(f[0]+c,f[1]+u),f,f,W(f[0]+c,f[1]-u)),Vt(W(h[0]-c,h[1]+u),h,h,W(h[0]+c,h[1]+u))]}function hn(e,t=0){let n=jr(e,t);if(n)return n;let i=wl(e,t).map(s=>El(xl(s,t))),a=[[Ie(i[0][i[0].length-1][3],i[1][0][0]),Ie(i[1][i[1].length-1][3],i[2][0][0]),Ie(i[2][i[2].length-1][3],i[3][0][0]),Ie(i[3][i[3].length-1][3],i[0][0][0])],i.flat()];return Vr(e,a,t),a}var Ut=(e,t=1)=>{if(e.length>=3){let[n,o]=[e[0],e[e.length-1]];return zn(n,o)<=qp/t}return!1},Yt=(e,t)=>{if(t.roundness?.type===Wr.PROPORTIONAL_RADIUS||t.roundness?.type===Wr.LEGACY)return e*zr;if(t.roundness?.type===Wr.ADAPTIVE_RADIUS){let n=t.roundness?.value??$p,o=n/zr;return e<=o?e*zr:n}return 0},n1=(e,t)=>{let n=e.type==="rectangle"?15:0,o=s=>{let l=t1(yl(s[1],s[0])),d=_r(l,n);return Ie(gl(s[0],d),gl(s[1],_r(d,-1)))},i=de(e,t),r=o(Co(e)?Ie(nt(W(e.x,e.y),i,e.angle),nt(W(e.x+e.width,e.y+e.height),i,e.angle)):Ie(nt(W(e.x+e.width/2,e.y),i,e.angle),nt(W(e.x+e.width/2,e.y+e.height),i,e.angle))),a=o(Co(e)?Ie(nt(W(e.x+e.width,e.y),i,e.angle),nt(W(e.x,e.y+e.height),i,e.angle)):Ie(nt(W(e.x,e.y+e.height/2),i,e.angle),nt(W(e.x+e.width,e.y+e.height/2),i,e.angle)));return[r,a]},Si=(e,t,n,o)=>{let i=de(t,n);return(t.type==="diamond"?wl(t).map(s=>{let l=Kp(s,.5),d=nt(l,i,t.angle);return W(d[0],d[1])}):[nt(W(t.x+t.width,t.y+t.height/2),i,t.angle),nt(W(t.x+t.width/2,t.y+t.height),i,t.angle),nt(W(t.x,t.y+t.height/2),i,t.angle),nt(W(t.x+t.width/2,t.y),i,t.angle)]).find(s=>zn(e,s)<=Et(o)+t.strokeWidth/2&&!Lt({point:e,element:t,threshold:0,elementsMap:n,overrideShouldTestInside:!0}))},eo=(e,t,n,o,i,r,a=!0)=>{if(Zp(e.points.length>=2,"Arrow must have at least two points"),e.width<3&&e.height<3)return null;if(a){let x=Si(t,n,i,r);if(x)return x}let[s,l]=n1(n,i),d=D.getPointAtIndexGlobalCoordinates(e,o==="start"?1:e.points.length-2,i);if(e.points.length===2){let x=o==="start"?e.endBinding:e.startBinding,y=x&&i.get(x.elementId),w=x&&y&&Ue(mn(x.fixedPoint),y,i);w&&(d=w)}let c=Jp(_r(yl(t,d),2*zn(d,t)+Math.max(zn(s[0],s[1]),zn(l[0],l[1]))),d),u=Ie(c,d),h=fl(s,u),m=fl(l,u),g=h&&zn(d,h),f=m&&zn(d,m),E=null;return g!=null&&f!=null?E=g<f?h:m:E=h||m||null,E&&Xt(E,n,i)?E:null};I();import{ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO as S1,ARROW_LABEL_WIDTH_FRACTION as v1,BOUND_TEXT_PADDING as Ct,DEFAULT_FONT_SIZE as A1,TEXT_ALIGN as kl,VERTICAL_ALIGN as Tl,getFontString as Ci,isProdEnv as k1,invariant as T1}from"@excalidraw/common";import{pointFrom as Ll,pointRotateRads as L1}from"@excalidraw/math";I();var Do={},Ml=(e,t)=>{let n=Do[e]||(Do[e]={height:t});return n.height=t,n},Pl=e=>{Do[e]&&delete Do[e]},hx=e=>Do[e]?.height??null;I();import{BOUND_TEXT_PADDING as Ai,DEFAULT_FONT_SIZE as o1,DEFAULT_FONT_FAMILY as i1,getFontString as r1,isTestEnv as a1,normalizeEOL as s1}from"@excalidraw/common";var ot=(e,t,n)=>{let o=e.split(`
2
2
  `).map(s=>s||" ").join(`
3
- `),i=parseFloat(t),r=g1(o,i,n);return{width:Ll(o,t),height:r}},Al="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),kl=(e,t)=>{let n=E1(e);return n===0?ot(Al.split("").join(`
4
- `),e,t).width+Li*2:n+Li*2},Ci=(e,t)=>ot("",e,t).width+Li*2,Ax=()=>Ll(Al,h1({fontSize:u1,fontFamily:p1}))>0,Ro=e=>f1(e).replace(/\t/g," "),Kr=e=>Ro(e).split(`
5
- `),kx=e=>{let t=Kr(e.text).length;return e.height/t/e.fontSize},Bi=(e,t)=>e*t,Tl=(e,t)=>Bi(e,t)+Li*2,Ti,Tx=e=>{Ti=e},qr=class{canvas;constructor(){this.canvas=document.createElement("canvas")}getLineWidth(t,n){let o=this.canvas.getContext("2d");o.font=n;let r=o.measureText(t).width;return m1()?r*10:r}},gn=(e,t)=>(Ti||(Ti=new qr),Ti.getLineWidth(e,t)),Ll=(e,t)=>{let n=Kr(e),o=0;return n.forEach(i=>{o=Math.max(o,gn(i,t))}),o},g1=(e,t,n)=>{let o=Kr(e).length;return Bi(t,n)*o},oo=(()=>{let e={};return{calculate:(i,r)=>{let a=i.charCodeAt(0);if(e[r]||(e[r]=[]),!e[r][a]){let s=gn(i,r);e[r][a]=s}return e[r][a]},getCache:i=>e[i],clearCache:i=>{e[i]=[]}}})(),Lx=e=>{let t=oo.getCache(e);if(!t)return 0;let n=t.filter(o=>o!==void 0);return Math.min(...n)},E1=e=>{let t=oo.getCache(e);if(!t)return 0;let n=t.filter(o=>o!==void 0);return Math.max(...n)};I();import{isDevEnv as x1,isTestEnv as y1}from"@excalidraw/common";var Qr,Di,Jr,Ox=e=>(Qr||(Qr=ie.class(...Object.values(qt))),Qr.test(e)),w1=()=>{if(!Di)try{Di=M1()}catch{Di=b1()}return Di},ea=()=>(Jr||(Jr=P1()),Jr),ut={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},qt={CHAR:/\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄/u,OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},jn={FLAG:/\p{RI}\p{RI}/u,JOINER:/(?:\p{Emoji_Modifier}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?/u,ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},b1=()=>ie.or(ea(),xe.On(ut.HYPHEN,ut.WHITESPACE,qt.CHAR)),M1=()=>ie.or(ea(),xe.Before(ut.WHITESPACE).Build(),xe.After(ut.WHITESPACE,ut.HYPHEN).Build(),xe.Before(qt.CHAR,qt.CURRENCY).NotPrecededBy(ut.OPENING,qt.OPENING).Build(),xe.After(qt.CHAR).NotFollowedBy(ut.HYPHEN,ut.CLOSING,qt.CLOSING).Build(),xe.BeforeMany(qt.OPENING).NotPrecededBy(ut.OPENING).Build(),xe.AfterMany(qt.CLOSING).NotFollowedBy(ut.CLOSING).Build(),xe.AfterMany(ut.CLOSING).FollowedBy(ut.OPENING).Build()),P1=()=>ie.group(ie.or(jn.FLAG,ie.and(jn.MOST,jn.JOINER,ie.build(`(?:${jn.ZWJ.source}(?:${jn.FLAG.source}|${jn.ANY.source}${jn.JOINER.source}))*`)))),ie={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>ie.build(ie.join(...e)),or:(...e)=>ie.build(e.map(t=>t.source).join("|")),group:(...e)=>ie.build(`(${ie.join(...e)})`),class:(...e)=>ie.build(`[${ie.join(...e)}]`)},xe={On:(...e)=>{let t=ie.join(...e);return ie.build(`([${t}])`)},Before:(...e)=>{let t=ie.join(...e),n=()=>ie.build(`(?=[${t}])`);return xe.Chain(n)},After:(...e)=>{let t=ie.join(...e),n=()=>ie.build(`(?<=[${t}])`);return xe.Chain(n)},BeforeMany:(...e)=>{let t=ie.join(...e),n=()=>ie.build(`(?<![${t}])(?=[${t}])`);return xe.Chain(n)},AfterMany:(...e)=>{let t=ie.join(...e),n=()=>ie.build(`(?<=[${t}])(?![${t}])`);return xe.Chain(n)},NotBefore:(...e)=>{let t=ie.join(...e),n=()=>ie.build(`(?![${t}])`);return xe.Chain(n)},NotAfter:(...e)=>{let t=ie.join(...e),n=()=>ie.build(`(?<![${t}])`);return xe.Chain(n)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),o=xe.After(...t).Build(),i=()=>ie.and(o,n);return xe.Chain(i)},FollowedBy:(...t)=>{let n=e(),o=xe.Before(...t).Build(),i=()=>ie.and(n,o);return xe.Chain(i)},NotPrecededBy:(...t)=>{let n=e(),o=xe.NotAfter(...t).Build(),i=()=>ie.and(o,n);return xe.Chain(i)},NotFollowedBy:(...t)=>{let n=e(),o=xe.NotBefore(...t).Build(),i=()=>ie.and(n,o);return xe.Chain(i)}})},I1=e=>{let t=w1();return e.normalize("NFC").split(t).filter(Boolean)},Kt=(e,t,n)=>v1(e,t,n).map(o=>o.text).join(`
6
- `),S1=e=>{let t=0;return e.split(`
7
- `).map(n=>{let o=t,i=o+n.length;return t=i+1,{text:n,start:o,end:i}})},v1=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return S1(e);let o=[],i=0;for(let r of e.split(`
8
- `))gn(r,t)<=n?o.push({text:r,start:i,end:i+r.length}):o.push(...A1(r,t,n,i)),i+=r.length+1;return o},A1=(e,t,n,o)=>{let i=[],r=I1(e),a="",s=o,l=o,d=0,c=o,u=0;for(;u<r.length;){let h=r[u],m=c,f=m+h.length,g=a+h,E=C1(h)?d+oo.calculate(h,t):gn(g,t);if(/\s/.test(h)||E<=n){a||(s=m),a=g,l=f,d=E,c=f,u++;continue}if(a)i.push(L1(a,s,l)),a="",s=m,l=m,d=0;else{let x=k1(h,t,n,m),y=x[x.length-1]??{text:"",start:m,end:m},w=x.slice(0,-1);i.push(...w),a=y.text,s=y.start,l=y.end,d=gn(y.text,t),c=f,u++}}if(a){let h=T1(a,s,l,t,n);i.push(h)}return i},k1=(e,t,n,o)=>{if(ea().test(e))return[{text:e,start:o,end:o+e.length}];B1(e);let i=[],r=Array.from(e),a="",s=o,l=o,d=0,c=o;for(let u of r){let h=c,m=h+u.length,f=oo.calculate(u,t),g=d+f;if(g<=n){a||(s=h),a=a+u,l=m,d=g,c=m;continue}a&&i.push({text:a,start:s,end:l}),a=u,s=h,l=m,d=f,c=m}return a&&i.push({text:a,start:s,end:l}),i},T1=(e,t,n,o,i)=>{if(!(gn(e,o)>i))return{text:e,start:t,end:n};let[,a,s]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],l=gn(a,o);for(let d of Array.from(s)){let c=oo.calculate(d,o),u=l+c;if(u>i)break;a=a+d,l=u}return{text:a,start:t,end:n-(e.length-a.length)}},L1=(e,t,n)=>{let o=e.trimEnd();return{text:o,start:t,end:n-(e.length-o.length)}},C1=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,B1=e=>{if((y1()||x1())&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")};var Oi=(e,t,n)=>{let o=n.getNonDeletedElementsMap(),i;R1()||F1(!t||!j(t)||e.angle===0,"text element angle must be 0 if bound to arrow container");let r={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:t?j(t)?0:t.angle:e.angle};r.text=e.text,(t||!e.autoResize)&&(i=t?yt(t,e):e.width,r.text=Kt(e.originalText,Gi(e),i));let a=ot(r.text,Gi(e),e.lineHeight);if(e.autoResize&&(r.width=a.width),r.height=a.height,t){let s=No(t,e),l=yt(t,e);if(!j(t)&&a.height>s){let h=ta(a.height,t.type);n.mutateElement(t,{height:h}),Sl(t.id,h)}if(a.width>l){let h=ta(a.width,t.type);n.mutateElement(t,{width:h})}let d={...e,...r},{x:c,y:u}=Fo(t,d,o);r.x=c,r.y=u}n.mutateElement(e,r)},Vn=(e,t,n,o=!1)=>{let i=t.getNonDeletedElementsMap();if(!Qt(e))return;vl(e.id);let a=Z(e,i);if(a&&a.text){if(!e)return;let s=a.text,l=a.height,d=a.width,c=yt(e,a),u=No(e,a),h=e.height;if(o||n!=="n"&&n!=="s"){s&&(s=Kt(a.originalText,Gi(a),c));let m=ot(s,Gi(a),a.lineHeight);l=m.height,d=m.width}if(l>u){h=ta(l,e.type);let m=h-e.height,f=!j(e)&&(n==="ne"||n==="nw"||n==="n")?e.y-m:e.y;t.mutateElement(e,{height:h,y:f})}t.mutateElement(a,{text:s,width:d,height:l}),j(e)||t.mutateElement(a,Fo(e,a,i))}},Fo=(e,t,n)=>{if(j(e))return R.getBoundTextElementPosition(e,t,n);let o=na(e),i=No(e,t),r=yt(e,t),a,s;t.verticalAlign===Bl.TOP?s=o.y:t.verticalAlign===Bl.BOTTOM?s=o.y+(i-t.height):s=o.y+(i/2-t.height/2),t.textAlign===Cl.LEFT?a=o.x:t.textAlign===Cl.RIGHT?a=o.x+(r-t.width):a=o.x+(r/2-t.width/2);let l=e.angle??0;if(l!==0){let d=Dl(o.x+r/2,o.y+i/2),c=Dl(a+t.width/2,s+t.height/2),[u,h]=N1(c,d,l);return{x:u-t.width/2,y:h-t.height/2}}return{x:a,y:s}},Qt=e=>e?.boundElements?.length&&e?.boundElements?.find(t=>t.type==="text")?.id||null,Z=(e,t)=>{if(!e)return null;let n=Qt(e);return n&&t.get(n)||null},De=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,Ux=(e,t,n)=>{if(!j(e))return{x:e.x+e.width/2,y:e.y+e.height/2};if(R.getPointsGlobalCoordinates(e,n).length%2===1){let a=Math.floor(e.points.length/2),s=R.getPointGlobalCoordinates(e,e.points[a],n);return{x:s[0],y:s[1]}}let i=e.points.length/2-1,r=R.getEditorMidPoints(e,n,t)[i];return r||(r=R.getSegmentMidPoint(e,i+1,n)),{x:r[0],y:r[1]}},na=e=>{let t=Dt,n=Dt;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},Yx=(e,t)=>j(t)?0:t?t.angle:e.angle,Xx=(e,t,n)=>{if(j(e))return R.getBoundTextElementPosition(e,t,n)},$x=(e,t)=>e.some(n=>{if(Ee(n)){let o=De(n,t);return!j(o)}return!1}),Zx=(e,t)=>e.some(n=>{if(Ee(n)){let o=De(n,t);return!j(o)}return te(n)}),H1=new Set(["rectangle","ellipse","diamond","arrow"]),qx=e=>H1.has(e.type),ta=(e,t)=>{e=Math.ceil(e);let n=Dt*2;return t==="ellipse"?Math.round((e+n)/Math.sqrt(2)*2):t==="arrow"?e+n*8:t==="diamond"?2*(e+n):e+n},yt=(e,t)=>{let{width:n}=e;if(j(e)){let o=(t?.fontSize??O1)*D1;return Math.max(G1*n,o)}return e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Dt*2:e.type==="diamond"?Math.round(n/2)-Dt*2:n-Dt*2},No=(e,t)=>{let{height:n}=e;return j(e)?n-Dt*8*2<=0?t.height:n:e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Dt*2:e.type==="diamond"?Math.round(n/2)-Dt*2:n-Dt*2},Kx=(e,t=`
3
+ `),i=parseFloat(t),r=l1(o,i,n);return{width:Al(o,t),height:r}},Il="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),Sl=(e,t)=>{let n=d1(e);return n===0?ot(Il.split("").join(`
4
+ `),e,t).width+Ai*2:n+Ai*2},ki=(e,t)=>ot("",e,t).width+Ai*2,Ex=()=>Al(Il,r1({fontSize:o1,fontFamily:i1}))>0,Go=e=>s1(e).replace(/\t/g," "),Ur=e=>Go(e).split(`
5
+ `),xx=e=>{let t=Ur(e.text).length;return e.height/t/e.fontSize},Ti=(e,t)=>e*t,vl=(e,t)=>Ti(e,t)+Ai*2,vi,yx=e=>{vi=e},Yr=class{canvas;constructor(){this.canvas=document.createElement("canvas")}getLineWidth(t,n){let o=this.canvas.getContext("2d");o.font=n;let r=o.measureText(t).width;return a1()?r*10:r}},fn=(e,t)=>(vi||(vi=new Yr),vi.getLineWidth(e,t)),Al=(e,t)=>{let n=Ur(e),o=0;return n.forEach(i=>{o=Math.max(o,fn(i,t))}),o},l1=(e,t,n)=>{let o=Ur(e).length;return Ti(t,n)*o},no=(()=>{let e={};return{calculate:(i,r)=>{let a=i.charCodeAt(0);if(e[r]||(e[r]=[]),!e[r][a]){let s=fn(i,r);e[r][a]=s}return e[r][a]},getCache:i=>e[i],clearCache:i=>{e[i]=[]}}})(),wx=e=>{let t=no.getCache(e);if(!t)return 0;let n=t.filter(o=>o!==void 0);return Math.min(...n)},d1=e=>{let t=no.getCache(e);if(!t)return 0;let n=t.filter(o=>o!==void 0);return Math.max(...n)};I();import{isDevEnv as c1,isTestEnv as u1}from"@excalidraw/common";var Xr,Li,$r,Sx=e=>(Xr||(Xr=re.class(...Object.values($t))),Xr.test(e)),p1=()=>{if(!Li)try{Li=m1()}catch{Li=h1()}return Li},Zr=()=>($r||($r=f1()),$r),ct={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},$t={CHAR:/\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄/u,OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},_n={FLAG:/\p{RI}\p{RI}/u,JOINER:/(?:\p{Emoji_Modifier}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?/u,ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},h1=()=>re.or(Zr(),ye.On(ct.HYPHEN,ct.WHITESPACE,$t.CHAR)),m1=()=>re.or(Zr(),ye.Before(ct.WHITESPACE).Build(),ye.After(ct.WHITESPACE,ct.HYPHEN).Build(),ye.Before($t.CHAR,$t.CURRENCY).NotPrecededBy(ct.OPENING,$t.OPENING).Build(),ye.After($t.CHAR).NotFollowedBy(ct.HYPHEN,ct.CLOSING,$t.CLOSING).Build(),ye.BeforeMany($t.OPENING).NotPrecededBy(ct.OPENING).Build(),ye.AfterMany($t.CLOSING).NotFollowedBy(ct.CLOSING).Build(),ye.AfterMany(ct.CLOSING).FollowedBy(ct.OPENING).Build()),f1=()=>re.group(re.or(_n.FLAG,re.and(_n.MOST,_n.JOINER,re.build(`(?:${_n.ZWJ.source}(?:${_n.FLAG.source}|${_n.ANY.source}${_n.JOINER.source}))*`)))),re={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>re.build(re.join(...e)),or:(...e)=>re.build(e.map(t=>t.source).join("|")),group:(...e)=>re.build(`(${re.join(...e)})`),class:(...e)=>re.build(`[${re.join(...e)}]`)},ye={On:(...e)=>{let t=re.join(...e);return re.build(`([${t}])`)},Before:(...e)=>{let t=re.join(...e),n=()=>re.build(`(?=[${t}])`);return ye.Chain(n)},After:(...e)=>{let t=re.join(...e),n=()=>re.build(`(?<=[${t}])`);return ye.Chain(n)},BeforeMany:(...e)=>{let t=re.join(...e),n=()=>re.build(`(?<![${t}])(?=[${t}])`);return ye.Chain(n)},AfterMany:(...e)=>{let t=re.join(...e),n=()=>re.build(`(?<=[${t}])(?![${t}])`);return ye.Chain(n)},NotBefore:(...e)=>{let t=re.join(...e),n=()=>re.build(`(?![${t}])`);return ye.Chain(n)},NotAfter:(...e)=>{let t=re.join(...e),n=()=>re.build(`(?<![${t}])`);return ye.Chain(n)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),o=ye.After(...t).Build(),i=()=>re.and(o,n);return ye.Chain(i)},FollowedBy:(...t)=>{let n=e(),o=ye.Before(...t).Build(),i=()=>re.and(n,o);return ye.Chain(i)},NotPrecededBy:(...t)=>{let n=e(),o=ye.NotAfter(...t).Build(),i=()=>re.and(o,n);return ye.Chain(i)},NotFollowedBy:(...t)=>{let n=e(),o=ye.NotBefore(...t).Build(),i=()=>re.and(n,o);return ye.Chain(i)}})},g1=e=>{let t=p1();return e.normalize("NFC").split(t).filter(Boolean)},Zt=(e,t,n)=>x1(e,t,n).map(o=>o.text).join(`
6
+ `),E1=e=>{let t=0;return e.split(`
7
+ `).map(n=>{let o=t,i=o+n.length;return t=i+1,{text:n,start:o,end:i}})},x1=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return E1(e);let o=[],i=0;for(let r of e.split(`
8
+ `))fn(r,t)<=n?o.push({text:r,start:i,end:i+r.length}):o.push(...y1(r,t,n,i)),i+=r.length+1;return o},y1=(e,t,n,o)=>{let i=[],r=g1(e),a="",s=o,l=o,d=0,c=o,u=0;for(;u<r.length;){let h=r[u],m=c,g=m+h.length,f=a+h,E=P1(h)?d+no.calculate(h,t):fn(f,t);if(/\s/.test(h)||E<=n){a||(s=m),a=f,l=g,d=E,c=g,u++;continue}if(a)i.push(M1(a,s,l)),a="",s=m,l=m,d=0;else{let x=w1(h,t,n,m),y=x[x.length-1]??{text:"",start:m,end:m},w=x.slice(0,-1);i.push(...w),a=y.text,s=y.start,l=y.end,d=fn(y.text,t),c=g,u++}}if(a){let h=b1(a,s,l,t,n);i.push(h)}return i},w1=(e,t,n,o)=>{if(Zr().test(e))return[{text:e,start:o,end:o+e.length}];I1(e);let i=[],r=Array.from(e),a="",s=o,l=o,d=0,c=o;for(let u of r){let h=c,m=h+u.length,g=no.calculate(u,t),f=d+g;if(f<=n){a||(s=h),a=a+u,l=m,d=f,c=m;continue}a&&i.push({text:a,start:s,end:l}),a=u,s=h,l=m,d=g,c=m}return a&&i.push({text:a,start:s,end:l}),i},b1=(e,t,n,o,i)=>{if(!(fn(e,o)>i))return{text:e,start:t,end:n};let[,a,s]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],l=fn(a,o);for(let d of Array.from(s)){let c=no.calculate(d,o),u=l+c;if(u>i)break;a=a+d,l=u}return{text:a,start:t,end:n-(e.length-a.length)}},M1=(e,t,n)=>{let o=e.trimEnd();return{text:o,start:t,end:n-(e.length-o.length)}},P1=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,I1=e=>{if((u1()||c1())&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")};var Bi=(e,t,n)=>{let o=n.getNonDeletedElementsMap(),i;k1()||T1(!t||!j(t)||e.angle===0,"text element angle must be 0 if bound to arrow container");let r={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:t?j(t)?0:t.angle:e.angle};r.text=e.text,(t||!e.autoResize)&&(i=t?xt(t,e):e.width,r.text=Zt(e.originalText,Ci(e),i));let a=ot(r.text,Ci(e),e.lineHeight);if(e.autoResize&&(r.width=a.width),r.height=a.height,t){let s=Ro(t,e),l=xt(t,e);if(!j(t)&&a.height>s){let h=qr(a.height,t.type);n.mutateElement(t,{height:h}),Ml(t.id,h)}if(a.width>l){let h=qr(a.width,t.type);n.mutateElement(t,{width:h})}let d={...e,...r},{x:c,y:u}=Oo(t,d,o);r.x=c,r.y=u}n.mutateElement(e,r)},jn=(e,t,n,o=!1)=>{let i=t.getNonDeletedElementsMap();if(!qt(e))return;Pl(e.id);let a=Q(e,i);if(a&&a.text){if(!e)return;let s=a.text,l=a.height,d=a.width,c=xt(e,a),u=Ro(e,a),h=e.height;if(o||n!=="n"&&n!=="s"){s&&(s=Zt(a.originalText,Ci(a),c));let m=ot(s,Ci(a),a.lineHeight);l=m.height,d=m.width}if(l>u){h=qr(l,e.type);let m=h-e.height,g=!j(e)&&(n==="ne"||n==="nw"||n==="n")?e.y-m:e.y;t.mutateElement(e,{height:h,y:g})}t.mutateElement(a,{text:s,width:d,height:l}),j(e)||t.mutateElement(a,Oo(e,a,i))}},Oo=(e,t,n)=>{if(j(e))return D.getBoundTextElementPosition(e,t,n);let o=Kr(e),i=Ro(e,t),r=xt(e,t),a,s;t.verticalAlign===Tl.TOP?s=o.y:t.verticalAlign===Tl.BOTTOM?s=o.y+(i-t.height):s=o.y+(i/2-t.height/2),t.textAlign===kl.LEFT?a=o.x:t.textAlign===kl.RIGHT?a=o.x+(r-t.width):a=o.x+(r/2-t.width/2);let l=e.angle??0;if(l!==0){let d=Ll(o.x+r/2,o.y+i/2),c=Ll(a+t.width/2,s+t.height/2),[u,h]=L1(c,d,l);return{x:u-t.width/2,y:h-t.height/2}}return{x:a,y:s}},qt=e=>e?.boundElements?.length&&e?.boundElements?.find(t=>t.type==="text")?.id||null,Q=(e,t)=>{if(!e)return null;let n=qt(e);return n&&t.get(n)||null},De=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,Ox=(e,t,n)=>{if(!j(e))return{x:e.x+e.width/2,y:e.y+e.height/2};if(D.getPointsGlobalCoordinates(e,n).length%2===1){let a=Math.floor(e.points.length/2),s=D.getPointGlobalCoordinates(e,e.points[a],n);return{x:s[0],y:s[1]}}let i=e.points.length/2-1,r=D.getEditorMidPoints(e,n,t)[i];return r||(r=D.getSegmentMidPoint(e,i+1,n)),{x:r[0],y:r[1]}},Kr=e=>{let t=Ct,n=Ct;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},Rx=(e,t)=>j(t)?0:t?t.angle:e.angle,Fx=(e,t,n)=>{if(j(e))return D.getBoundTextElementPosition(e,t,n)},Nx=(e,t)=>e.some(n=>{if(xe(n)){let o=De(n,t);return!j(o)}return!1}),Hx=(e,t)=>e.some(n=>{if(xe(n)){let o=De(n,t);return!j(o)}return te(n)}),C1=new Set(["rectangle","ellipse","diamond","arrow"]),zx=e=>C1.has(e.type),qr=(e,t)=>{e=Math.ceil(e);let n=Ct*2;return t==="ellipse"?Math.round((e+n)/Math.sqrt(2)*2):t==="arrow"?e+n*8:t==="diamond"?2*(e+n):e+n},xt=(e,t)=>{let{width:n}=e;if(j(e)){let o=(t?.fontSize??A1)*S1;return Math.max(v1*n,o)}return e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Ct*2:e.type==="diamond"?Math.round(n/2)-Ct*2:n-Ct*2},Ro=(e,t)=>{let{height:n}=e;return j(e)?n-Ct*8*2<=0?t.height:n:e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Ct*2:e.type==="diamond"?Math.round(n/2)-Ct*2:n-Ct*2},Wx=(e,t=`
9
9
 
10
- `)=>e.reduce((o,i)=>(te(i)&&o.push(i.text),o),[]).join(t);I();import{curvePointDistance as oa,distanceToLineSegment as ia,pointRotateRads as ra}from"@excalidraw/math";import{ellipse as z1,ellipseDistanceFromPoint as W1}from"@excalidraw/math/ellipse";var En=(e,t,n)=>{switch(e.type){case"selection":case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return _1(e,t,n);case"diamond":return j1(e,t,n);case"ellipse":return V1(e,t,n);case"line":case"arrow":case"freedraw":return U1(e,t,n)}},_1=(e,t,n)=>{let o=le(e,t),i=ra(n,o,-e.angle),[r,a]=hn(e);return Math.min(...r.map(s=>ia(i,s)),...a.map(s=>oa(s,i)).filter(s=>s!==null))},j1=(e,t,n)=>{let o=le(e,t),i=ra(n,o,-e.angle),[r,a]=mn(e);return Math.min(...r.map(s=>ia(i,s)),...a.map(s=>oa(s,i)).filter(s=>s!==null))},V1=(e,t,n)=>{let o=le(e,t);return W1(ra(n,o,-e.angle),z1(o,e.width/2,e.height/2))},U1=(e,t,n)=>{let[o,i]=_n(e,t);return Math.min(...o.map(r=>ia(n,r)),...i.map(r=>oa(r,n)))};I();var aa=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",ay=e=>e==="rectangle"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line"||e==="text"||e==="embeddable",sy=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",ly=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",Gl=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",dy=e=>e==="arrow",cy=e=>e==="arrow";var Ri=e=>{if(e.type==="arrow")return!1;let t=aa(e.type)&&!Wl(e.backgroundColor)||Ct(e)||vi(e)||te(e);return e.type==="line"?t&&$t(e.points):e.type==="freedraw"?t&&$t(e.points):t||Ae(e)},sa=null,Ol=null,Rl=1/0,Fl=!1,Nl=!1,Bt=({point:e,element:t,threshold:n,elementsMap:o,frameNameBound:i=null,overrideShouldTestInside:r=!1})=>{if(sa&&Vl(e,sa)&&Rl<=n&&r===Nl){let u=Ol?.deref();if(u&&u.id===t.id&&u.version===t.version&&u.versionNonce===t.versionNonce)return Fl}let a=i?la(Me(i.x-n,i.y-n),e,Me(i.x+i.width+n,i.y+i.height+n)):!1,s=ue(t,o,!0);if(!Ul(e,s,t.angle,n)&&!a)return!1;let c=(r||Ri(t))&&Zt(e,t,o)||Hl(e,t,o,n)||a;return sa=e,Ol=new WeakRef(t),Rl=n,Nl=r,Fl=c,c},Ul=(e,t,n,o=0)=>{let i=n===0?e:it(e,xn(t),-n);return la(Me(t[0]-o,t[1]-o),i,Me(t[2]+o,t[3]+o))},Q1=(e,t,n,o=0)=>{let i=ue(t,n,!0);return Ul(e,i,t.angle,o)},Sy=(e,t)=>!Bt(e)&&!J1(e.point,e.element,t)&&Q1(e.point,e.element,t),J1=(e,t,n)=>{let o=Z(t,n);if(!o)return!1;let i=ne(t)?{...o,...R.getBoundTextElementPosition(t,o,n)}:o;return Zt(e,i,n)},Yl=(e,[t,n],o,i=0)=>{let r=Me(t,n),a=!ee(e),s=Math.max(1,i),l=[t-s,n-s,t+s,n+s],d=ue(e,o);if(!Ot(l,d))return!1;if(e.frameId){let h=o.get(e.frameId);if(h&&ee(h)){let m=ue(h,o);if(!wt(r,m))return!1}}let c=Gt(e,o,Ho(le(e,o),r)),u=En(e,o,r);return a?c.length===0||u<=i:c.length>0&&u<=s},Fi=(e,t,n,o)=>{let i=[];for(let r=t.length-1;r>=0;--r){let a=t[r];if(zl(!a.isDeleted,"Elements in the function parameter for getAllElementsAtPositionForBinding() should not contain deleted elements"),ge(a,!1)&&Yl(a,e,n,o)&&(i.push(a),aa(a.type)&&!Wl(a.backgroundColor)))break}return i},Jt=(e,t,n,o)=>{let i=Fi(e,t,n,o);return!i||i.length===0?null:i.length===1?i[0]:i.sort((r,a)=>a.width**2+a.height**2-(r.width**2+r.height**2)).pop()},Xl=(e,t,n,o,i)=>{let r=[];for(let s=n.length-1;s>=0;--s){let l=n[s];zl(!l.isDeleted,"Elements in the function parameter for getAllElementsAtPositionForBinding() should not contain deleted elements"),ge(l,!1)&&Yl(l,e,o,i)&&r.push(l)}if(!r||r.length===0)return null;if(r.length===1)return r[0];let a=r.filter(s=>En(s,o,e)<=Ne(s,t)||Zt(e,s,o));return a.length===0?null:a[0]},Gt=(e,t,n,o=0,i=!1)=>{let r=[Math.min(n[0][0]-o,n[1][0]-o),Math.min(n[0][1]-o,n[1][1]-o),Math.max(n[0][0]+o,n[1][0]+o),Math.max(n[0][1]+o,n[1][1]+o)],a=ue(e,t);if(!Ot(r,a))return[];switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"selection":case"magicframe":return th(e,t,n,o,i);case"diamond":return nh(e,t,n,o,i);case"ellipse":return oh(e,t,n,o);case"line":case"freedraw":case"arrow":return eh(e,n,t,i)}},$l=(e,t,n,o,i,r=!1)=>{for(let a of e){let s=Ni(a[0],a[1],a[2],a[3]),l=[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])];if(!Ot(s,l))continue;let d=_l(a,t);if(d.length>0){for(let c of d)n.push(it(c,o,i));if(r)return n}}return n},Zl=(e,t,n,o,i,r=!1)=>{for(let a of e){let s=jl(a,t);if(s&&(n.push(it(s,o,i)),r))return n}return n},eh=(e,t,n,o=!1)=>{let[i,r]=_n(e,n),a=[];for(let s of i){let l=jl(s,t);if(l&&(a.push(l),o))return a}for(let s of r){let l=Ni(s[0],s[1],s[2],s[3]),d=[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])];if(!Ot(l,d))continue;let c=_l(s,t,{iterLimit:10});if(c.length>0&&(a.push(...c),o))return a}return a},th=(e,t,n,o=0,i=!1)=>{let r=le(e,t),a=it(n[0],r,-e.angle),s=it(n[1],r,-e.angle),l=Ho(a,s),[d,c]=hn(e,o),u=[];return Zl(d,l,u,r,e.angle,i),i&&u.length>0||$l(c,l,u,r,e.angle,i),u},nh=(e,t,n,o=0,i=!1)=>{let r=le(e,t),a=it(n[0],r,-e.angle),s=it(n[1],r,-e.angle),l=Ho(a,s),[d,c]=mn(e,o),u=[];return Zl(d,l,u,r,e.angle,i),i&&u.length>0||$l(c,l,u,r,e.angle,i),u},oh=(e,t,n,o=0)=>{let i=le(e,t),r=it(n[0],i,-e.angle),a=it(n[1],i,-e.angle);return K1(q1(i,e.width/2+o,e.height/2+o),Ho(r,a)).map(s=>it(s,i,e.angle))},Hl=(e,t,n,o=1)=>En(t,n,e)<=o,Zt=(e,t,n)=>{if((ne(t)||Pe(t))&&!$t(t.points))return!1;let[o,i,r,a]=ue(t,n);if(!la(Me(o,i),e,Me(r,a)))return!1;let s=Me((o+r)/2,(i+a)/2),l=Y1(Z1($1(X1(e,s,.1)),Math.max(t.width,t.height)*2),s),d=Ho(e,l);return Gt(t,n,d).filter((u,h,m)=>m.findIndex(f=>Vl(f,u))===h).length%2===1},da=(e,t,n)=>{let o=(a,s)=>{let{x:l,y:d,width:c,height:u,angle:h}=a,m=le(a,n);if(a.type==="diamond"){let[g,E,x,y,w,M,b,S]=no(a);return[Me(l+g,d+E-s),Me(l+x+s,d+y),Me(l+w,d+M+s),Me(l+b-s,d+S)].map(L=>it(L,m,h))}if(a.type==="ellipse"){let g=l+c/2,E=d+u/2,x=c/2,y=u/2;return[Me(g,E-y-s),Me(g+x+s,E),Me(g,E+y+s),Me(g-x-s,E)].map(M=>it(M,m,h))}return[Me(l-s,d-s),Me(l+c+s,d-s),Me(l+c+s,d+u+s),Me(l-s,d+u+s)].map(g=>it(g,m,h))},i=-1*Math.max(e.width,e.height)/20;return o(e,i).every(a=>Zt(a,t,n))};I();import{invariant as ql,isDevEnv as ih,isTestEnv as rh}from"@excalidraw/common";import{pointFrom as yn,pointFromVector as Hi,pointRotateRads as zi,pointScaleFromOrigin as Wi,pointsEqual as ah,triangleIncludesPoint as ca,vectorCross as Xe,vectorFromPoint as oe,vectorScale as _i}from"@excalidraw/math";var we=[1,0],ke=[0,1],Ze=[-1,0],rt=[0,-1],en=e=>{let[t,n]=e,o=Math.abs(t),i=Math.abs(n);return t>i?we:t<=-i?Ze:n>o?ke:rt},$e=(e,t)=>en(oe(e,t)),bt=(e,t)=>qe($e(e,t)),ye=(e,t)=>e[0]===t[0]&&e[1]===t[1],qe=e=>ye(e,we)||ye(e,Ze),Cy=e=>!qe(e),sh=(e,t,n)=>{let o=xn(t);(ih()||rh())&&(ql(e.width>0&&e.height>0,"Diamond element has no width or height"),ql(!ah(o,n),"The point is too close to the element mid point to determine heading"));let i=.95,r=Hi(_i(oe(zi(yn(e.x+e.width/2,e.y),o,e.angle),o),i),o),a=Hi(_i(oe(zi(yn(e.x+e.width,e.y+e.height/2),o,e.angle),o),i),o),s=Hi(_i(oe(zi(yn(e.x+e.width/2,e.y+e.height),o,e.angle),o),i),o),l=Hi(_i(oe(zi(yn(e.x,e.y+e.height/2),o,e.angle),o),i),o);if(Xe(oe(n,r),oe(r,a))<=0&&Xe(oe(n,r),oe(r,l))>0)return $e(r,o);if(Xe(oe(n,a),oe(a,s))<=0&&Xe(oe(n,a),oe(a,r))>0)return $e(a,o);if(Xe(oe(n,s),oe(s,l))<=0&&Xe(oe(n,s),oe(s,a))>0)return $e(s,o);if(Xe(oe(n,l),oe(l,r))<=0&&Xe(oe(n,l),oe(l,s))>0)return $e(l,o);if(Xe(oe(n,o),oe(r,o))<=0&&Xe(oe(n,o),oe(a,o))>0){let c=e.width>e.height?r:a;return $e(c,o)}else if(Xe(oe(n,o),oe(a,o))<=0&&Xe(oe(n,o),oe(s,o))>0){let c=e.width>e.height?s:a;return $e(c,o)}else if(Xe(oe(n,o),oe(s,o))<=0&&Xe(oe(n,o),oe(l,o))>0){let c=e.width>e.height?s:l;return $e(c,o)}let d=e.width>e.height?r:l;return $e(d,o)},zo=(e,t,n)=>{let i=xn(t);if(e.type==="diamond")return sh(e,t,n);let r=Wi(yn(t[0],t[1]),i,2),a=Wi(yn(t[2],t[1]),i,2),s=Wi(yn(t[0],t[3]),i,2),l=Wi(yn(t[2],t[3]),i,2);return ca([r,a,i],n)?rt:ca([a,l,i],n)?we:ca([l,s,i],n)?ke:Ze},ua=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1];I();import{getSizeFromPoints as Sh,randomInteger as Ma,getUpdatedTimestamp as Pa}from"@excalidraw/common";I();import{clamp as ji,pointDistance as ma,pointFrom as q,pointScaleFromOrigin as lh,pointsEqual as _o,pointTranslate as ha,vector as Rt,vectorCross as Vi,vectorFromPoint as fa,vectorScale as dh}from"@excalidraw/math";import{BinaryHeap as ch,invariant as io,isAnyTrue as uh,getSizeFromPoints as Kl,isDevEnv as ph,arrayToMap as hh}from"@excalidraw/common";var ga=1,re=40,mh=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let o=[];e.points.map(a=>q(e.x+a[0],e.y+a[1])).forEach((a,s,l)=>{if(s<2)return o.push(a);let d=$e(a,l[s-1]),c=$e(l[s-1],l[s-2]);if(ye(d,c)){let u=n?.findIndex(m=>m.index===s-1)??-1,h=n?.findIndex(m=>m.index===s)??-1;h!==-1&&(n[h].start=q(l[s-2][0]-e.x,l[s-2][1]-e.y)),u!==-1&&n.splice(u,1),o.splice(-1,1),n.forEach(m=>{m.index>s-1&&(m.index-=1)})}return o.push(a)});let i=[];o.forEach((a,s,l)=>{if(s<3)return i.push(a);if(ma(l[s-2],l[s-1])<ga){let d=n?.findIndex(h=>h.index===s-2)??-1,c=n?.findIndex(h=>h.index===s-1)??-1;c!==-1&&n.splice(c,1),d!==-1&&n.splice(d,1),i.splice(-2,2),n.forEach(h=>{h.index>s-2&&(h.index-=2)});let u=bt(a,l[s-1]);return i.push(q(u?a[0]:l[s-2][0],u?l[s-2][1]:a[1]))}i.push(a)});let r=n.filter(a=>a.index!==1&&a.index!==i.length-1);return r.length===0?tn(ya(wa(xa(e,Ea(e,t,i.map(a=>q(a[0]-e.x,a[1]-e.y))))??[])),r,null,null):(ph()&&io(id(i),"Invalid elbow points with fixed segments"),tn(i,r,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},fh=(e,t,n)=>{let o=t.map(T=>T.index),r=(e.fixedSegments?.map(T=>T.index)??[]).findIndex(T=>!o.includes(T));if(r===-1||!e.fixedSegments?.[r])return{points:e.points};let a=e.fixedSegments[r].index,s=e.fixedSegments[r-1],l=e.fixedSegments[r+1],d=e.x+(s?s.end[0]:0),c=e.y+(s?s.end[1]:0),u=s?null:e.startBinding,h=l?null:e.endBinding,{startHeading:m,endHeading:f,startGlobalPoint:g,endGlobalPoint:E,hoveredStartElement:x,hoveredEndElement:y,...w}=Ea({x:d,y:c,startBinding:u,endBinding:h,startArrowhead:null,endArrowhead:null,points:e.points},n,[q(0,0),q(e.x+(l?.start[0]??e.points[e.points.length-1][0])-d,e.y+(l?.start[1]??e.points[e.points.length-1][1])-c)],{isDragging:!1}),{points:M}=tn(ya(wa(xa(e,{startHeading:m,endHeading:f,startGlobalPoint:g,endGlobalPoint:E,hoveredStartElement:x,hoveredEndElement:y,...w})??[])),t,null,null);if(!M||M.length<2)throw new Error("Property 'points' is required in the update returned by normalizeArrowElementUpdate()");let b=[];if(s)for(let T=0;T<s.index;T++)b.push(q(e.x+e.points[T][0],e.y+e.points[T][1]));if(M.forEach(T=>{b.push(q(e.x+(s?s.end[0]:0)+T[0],e.y+(s?s.end[1]:0)+T[1]))}),l)for(let T=l.index;T<e.points.length;T++)b.push(q(e.x+e.points[T][0],e.y+e.points[T][1]));let S=(l?.index??e.points.length)-(s?.index??0)-1,v=t.map(T=>T.index>a?{...T,index:T.index-S+(M.length-1)}:T),L=b.flatMap((T,D)=>{let B=b[D-1],F=b[D+1];if(B&&F){let O=$e(T,B),K=$e(F,T);if(ye(O,K))return v.forEach(Y=>{Y.index>D&&(Y.index-=1)}),[];if(ye(O,ua(K)))return v.forEach(Y=>{Y.index>D&&(Y.index+=1)}),[T,T]}return[T]});return tn(L,v,!1,!1)},gh=(e,t,n,o,i,r)=>{let a=t.map((b,S)=>e.fixedSegments==null||e.fixedSegments[S]===void 0||e.fixedSegments[S].index!==b.index||(b.start[0]!==e.fixedSegments[S].start[0]&&b.end[0]!==e.fixedSegments[S].end[0])!=(b.start[1]!==e.fixedSegments[S].start[1]&&b.end[1]!==e.fixedSegments[S].end[1])?S:null).filter(b=>b!==null).shift();if(a==null)return{points:e.points};let s=e.fixedSegments?.findIndex(b=>b.index===1)??-1,l=e.fixedSegments?.findIndex(b=>b.index===e.points.length-1)??-1,d=ma(t[a].start,t[a].end),c=d<re+5;if(s===-1&&t[a].index===1&&i){let b=qe(n),v=(b?ye(n,we):ye(n,ke))?c?d/2:re:c?-d/2:-re;t[a].start=q(t[a].start[0]+(b?v:0),t[a].start[1]+(b?0:v))}if(l===-1&&t[a].index===e.points.length-1&&r){let b=qe(o),v=(b?ye(o,we):ye(o,ke))?c?d/2:re:c?-d/2:-re;t[a].end=q(t[a].end[0]+(b?v:0),t[a].end[1]+(b?0:v))}let u=t.map(b=>({...b,start:q(e.x+b.start[0],e.y+b.start[1]),end:q(e.x+b.end[0],e.y+b.end[1])})),h=e.points.map((b,S)=>q(e.x+b[0],e.y+b[1])),m=u[a].index-1,f=u[a].index,g=u[a].start,E=u[a].end,x=h[m-1]&&!_o(h[m],h[m-1])?bt(h[m-1],h[m]):void 0,y=h[f+1]&&!_o(h[f],h[f+1])?bt(h[f+1],h[f]):void 0;if(x!==void 0){let b=x?1:0;h[m-1][b]=g[b]}if(h[m]=g,h[f]=E,y!==void 0){let b=y?1:0;h[f+1][b]=E[b]}let w=u.findIndex(b=>b.index===m);if(w!==-1){let b=bt(u[w].end,u[w].start)?1:0;u[w].start[b]=g[b],u[w].end=g}let M=u.findIndex(b=>b.index===f+1);if(M!==-1){let b=bt(u[M].end,u[M].start)?1:0;u[M].end[b]=E[b],u[M].start=E}if(s===-1&&m===0){let b=i?qe(n):bt(h[1],h[0]);h.unshift(q(b?g[0]:e.x+e.points[0][0],b?e.y+e.points[0][1]:g[1])),i&&h.unshift(q(e.x+e.points[0][0],e.y+e.points[0][1]));for(let S of u)S.index+=i?2:1}if(l===-1&&f===e.points.length-1){let b=qe(o);h.push(q(b?E[0]:e.x+e.points[e.points.length-1][0],b?e.y+e.points[e.points.length-1][1]:E[1])),r&&h.push(q(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return tn(h,u.map(b=>({...b,start:q(b.start[0]-e.x,b.start[1]-e.y),end:q(b.end[0]-e.x,b.end[1]-e.y)})),!1,!1)},Eh=(e,t,n,o,i,r,a,s,l)=>{let d=e.startIsSpecial??null,c=e.endIsSpecial??null,u=t.map((E,x)=>x===0?q(e.x+E[0],e.y+E[1]):x===t.length-1?q(e.x+E[0],e.y+E[1]):q(e.x+e.points[x][0],e.y+e.points[x][1])),h=n.map(E=>({...E,start:q(e.x+(E.start[0]-t[0][0]),e.y+(E.start[1]-t[0][1])),end:q(e.x+(E.end[0]-t[0][0]),e.y+(E.end[1]-t[0][1]))})),m=[],f=2+(d?1:0),g=2+(c?1:0);for(;m.length+f<u.length-g;)m.push(u[m.length+f]);{let E=u.at(d?2:1),x=u.at(d?3:2);if(!E||!x)throw new Error(`Second and third points must exist when handling endpoint drag (${d})`);let y=qe(o),w=qe(en(fa(E,x)));if(s&&y===w){let M=y?ye(o,we):ye(o,ke);if(m.unshift(q(w?r[0]+(M?re:-re):x[0],w?x[1]:r[1]+(M?re:-re))),m.unshift(q(y?r[0]+(M?re:-re):r[0],y?r[1]:r[1]+(M?re:-re))),!d){d=!0;for(let b of h)b.index>1&&(b.index+=1)}}else if(m.unshift(q(w?r[0]:E[0],w?E[1]:r[1])),d){d=!1;for(let M of h)M.index>1&&(M.index-=1)}m.unshift(r)}{let E=u.at(u.length-(c?3:2)),x=u.at(u.length-(c?4:3));if(!E||!x)throw new Error(`Second and third to last points must exist when handling endpoint drag (${c})`);let y=qe(i),w=bt(x,E);if(l&&y===w){let M=y?ye(i,we):ye(i,ke);m.push(q(w?a[0]+(M?re:-re):x[0],w?x[1]:a[1]+(M?re:-re))),m.push(q(y?a[0]+(M?re:-re):a[0],y?a[1]:a[1]+(M?re:-re))),c||(c=!0)}else m.push(q(w?a[0]:E[0],w?E[1]:a[1])),c&&(c=!1)}return m.push(a),tn(m,h.map(({index:E})=>({index:E,start:m[E-1],end:m[E]})).map(E=>({...E,start:q(E.start[0]-r[0],E.start[1]-r[1]),end:q(E.end[0]-r[0],E.end[1]-r[1])})),d,c)},wn=1e6,ro=(e,t,n,o)=>{if(e.points.length<2)return{points:n.points??e.points};C.PROD||(io(!n.points||n.points.length>=2,"Updated point array length must match the arrow point length, contain exactly the new start and end points or not be specified at all (i.e. you can't add new points between start and end manually to elbow arrows)"),io(!e.fixedSegments||e.fixedSegments.map(b=>b.start[0]===b.end[0]||b.start[1]===b.end[1]).every(Boolean),"Fixed segments must be either horizontal or vertical"),io(!n.fixedSegments||n.fixedSegments.map(b=>b.start[0]===b.end[0]||b.start[1]===b.end[1]).every(Boolean),"Updates to fixed segments must be either horizontal or vertical"),io(e.points.slice(1).map((b,S)=>b[0]===e.points[S][0]||b[1]===e.points[S][1]),"Elbow arrow segments must be either horizontal or vertical"),io(n.fixedSegments?.find(b=>b.index===1&&_o(b.start,(n.points??e.points)[0]))==null&&n.fixedSegments?.find(b=>b.index===(n.points??e.points).length-1&&_o(b.end,(n.points??e.points)[(n.points??e.points).length-1]))==null,"The first and last segments cannot be fixed"));let i=n.fixedSegments??e.fixedSegments??[],r=n.points?n.points&&n.points.length===2?e.points.map((b,S)=>S===0?n.points[0]:S===e.points.length-1?n.points[1]:b):n.points.slice():e.points.slice(),{startBinding:a,endBinding:s,...l}=n,d=typeof a<"u"?a:e.startBinding,c=typeof s<"u"?s:e.endBinding,u=d&&Yi(d.elementId,t),h=c&&Yi(c.elementId,t),m=id(r);if(d&&!u&&m||c&&!h&&m||t.size===0&&m||Object.keys(l).length===0&&(u?.id!==d?.elementId||h?.id!==c?.elementId))return tn(r.map(b=>q(e.x+b[0],e.y+b[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:f,endHeading:g,startGlobalPoint:E,endGlobalPoint:x,hoveredStartElement:y,hoveredEndElement:w,...M}=Ea({x:e.x,y:e.y,startBinding:d,endBinding:c,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,r,o);return t.size===0&&m?tn(r.map(b=>q(e.x+b[0],e.y+b[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial):!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?mh(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((b,S)=>_o(b,e.points[S]??q(1/0,1/0)))&&m?{}:i.length===0?tn(ya(wa(xa(e,{startHeading:f,endHeading:g,startGlobalPoint:E,endGlobalPoint:x,hoveredStartElement:y,hoveredEndElement:w,...M})??[])),i,null,null):(e.fixedSegments?.length??0)>i.length?fh(e,i,t):n.points?n.points&&n.fixedSegments?n:Eh(e,r,i,f,g,E,x,y,w):gh(e,i,f,g,y,w)},Ea=(e,t,n,o)=>{let i=ha(n[0],Rt(e.x,e.y)),r=ha(n[n.length-1],Rt(e.x,e.y)),a=null,s=null;if(o?.isDragging&&o?.isBindingEnabled!==!1){let b=Array.from(t.values());a=td(i,t,b,o?.zoom)||null,s=td(r,t,b,o?.zoom)||null}else a=e.startBinding&&Yi(e.startBinding.elementId,t)||null,s=e.endBinding&&Yi(e.endBinding.elementId,t)||null;let l=Jl({...e,angle:0,type:"arrow",elbowed:!0,points:n},"start",e.startBinding?.fixedPoint,i,a,t,o?.isDragging,o?.isBindingEnabled,o?.isMidpointSnappingEnabled),d=Jl({...e,angle:0,type:"arrow",elbowed:!0,points:n},"end",e.endBinding?.fixedPoint,r,s,t,o?.isDragging,o?.isBindingEnabled,o?.isMidpointSnappingEnabled),c=ed(l,d,a,i,t,o?.zoom),u=ed(d,l,s,r,t,o?.zoom),h=[l[0]-2,l[1]-2,l[0]+2,l[1]+2],m=[d[0]-2,d[1]-2,d[0]+2,d[1]+2],f=a?pt(a,t,bn(c,e.startArrowhead?Ne(a,{elbowed:!0})*6:Ne(a,{elbowed:!0})*2,1)):h,g=s?pt(s,t,bn(u,e.endArrowhead?Ne(s,{elbowed:!0})*6:Ne(s,{elbowed:!0})*2,1)):m,E=wt(l,s?pt(s,t,bn(u,re,re)):m)||wt(d,a?pt(a,t,bn(c,re,re)):h),x=od(E?[h,m]:[f,g]),y=wh(E?h:f,E?m:g,x,E?bn(c,!a&&!s?0:re,0):bn(c,!a&&!s?0:re-(e.startArrowhead?Un*6:Un*2),re),E?bn(u,!a&&!s?0:re,0):bn(u,!a&&!s?0:re-(e.endArrowhead?Un*6:Un*2),re),E,a&&pt(a,t),s&&pt(s,t)),w=Ql(y[0],c,l),M=Ql(y[1],u,d);return{dynamicAABBs:y,startDonglePosition:w,startGlobalPoint:l,startHeading:c,endDonglePosition:M,endGlobalPoint:d,endHeading:u,commonBounds:x,hoveredStartElement:a,hoveredEndElement:s,boundsOverlap:E,startElementBounds:f,endElementBounds:g}},xa=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:o,startGlobalPoint:i,startHeading:r,endDonglePosition:a,endGlobalPoint:s,endHeading:l,commonBounds:d,hoveredEndElement:c}=t,u=bh(n,o||i,r,a||s,l,d),h=o&&Ui(o,u),m=a&&Ui(a,u),f=Ui(s,u);f&&c&&(f.closed=!0);let g=Ui(i,u);g&&e.startBinding&&(g.closed=!0);let E=h&&m&&(wt(h.pos,n[1])||wt(m.pos,n[0])),x=xh(h||g,m||f,u,r||we,l||we,E?[]:n);if(x){let y=x.map(w=>[w.pos[0],w.pos[1]]);return h&&y.unshift(i),m&&y.push(s),y}return null},bn=(e,t,n)=>{switch(e){case rt:return[t,n,n,n];case we:return[n,t,n,n];case ke:return[n,n,t,n]}return[n,n,n,t]},xh=(e,t,n,o,i,r)=>{let a=pa(e.pos,t.pos),s=new ch(l=>l.f);for(s.push(e);s.size()>0;){let l=s.pop();if(!l||l.closed)continue;if(l===t)return yh(e,l);l.closed=!0;let d=Ph(l.addr,n);for(let c=0;c<4;c++){let u=d[c];if(!u||u.closed)continue;let h=lh(u.pos,l.pos,.5);if(uh(...r.map(M=>wt(h,M))))continue;let m=Ih(c),f=l.parent?en(fa(l.pos,l.parent.pos)):o,g=ua(f);if(ye(g,m)||nd(e.addr,u.addr)&&ye(m,o)||nd(t.addr,u.addr)&&ye(m,i))continue;let x=f!==m,y=l.g+pa(u.pos,l.pos)+(x?Math.pow(a,3):0),w=u.visited;if(!w||y<u.g){let M=Mh(u,t,m,i);u.visited=!0,u.parent=l,u.h=pa(t.pos,u.pos)+M*Math.pow(a,2),u.g=y,u.f=u.g+u.h,w?s.rescoreElement(u):s.push(u)}}}return null},yh=(e,t)=>{let n=t,o=[];for(;n.parent;)o.unshift(n),n=n.parent;return o.unshift(e),o},pa=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),wh=(e,t,n,o,i,r,a,s)=>{let l=a??e,d=s??t,[c,u,h,m]=o??[0,0,0,0],[f,g,E,x]=i??[0,0,0,0],y=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((l[0]+d[2])/2,e[0]-m):(l[0]+d[2])/2:e[0]>t[0]?e[0]-m:n[0]-m,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((l[1]+d[3])/2,e[1]-c):(l[1]+d[3])/2:e[1]>t[1]?e[1]-c:n[1]-c,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((l[2]+d[0])/2,e[2]+u):(l[2]+d[0])/2:e[2]<t[2]?e[2]+u:n[2]+u,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((l[3]+d[1])/2,e[3]+h):(l[3]+d[1])/2:e[3]<t[3]?e[3]+h:n[3]+h],w=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((d[0]+l[2])/2,t[0]-x):(d[0]+l[2])/2:t[0]>e[0]?t[0]-x:n[0]-x,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((d[1]+l[3])/2,t[1]-f):(d[1]+l[3])/2:t[1]>e[1]?t[1]-f:n[1]-f,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((d[2]+l[0])/2,t[2]+g):(d[2]+l[0])/2:t[2]<e[2]?t[2]+g:n[2]+g,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((d[3]+l[1])/2,t[3]+E):(d[3]+l[1])/2:t[3]<e[3]?t[3]+E:n[3]+E],M=od([y,w]);if(!r&&y[2]-y[0]+w[2]-w[0]>M[2]-M[0]+1e-11&&y[3]-y[1]+w[3]-w[1]>M[3]-M[1]+1e-11){let[b,S]=[(w[0]+w[2])/2,(w[1]+w[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let v=y[2]+(w[0]-y[2])/2,L=w[3]+(y[1]-w[3])/2;return Vi(Rt(e[2]-b,e[1]-S),Rt(e[0]-b,e[3]-S))>0?[[y[0],y[1],v,y[3]],[v,w[1],w[2],w[3]]]:[[y[0],L,y[2],y[3]],[w[0],w[1],w[2],L]]}else if(e[2]<t[0]&&e[3]<t[1]){let v=y[2]+(w[0]-y[2])/2,L=y[3]+(w[1]-y[3])/2;return Vi(Rt(e[0]-b,e[1]-S),Rt(e[2]-b,e[3]-S))>0?[[y[0],y[1],y[2],L],[w[0],L,w[2],w[3]]]:[[y[0],y[1],v,y[3]],[v,w[1],w[2],w[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let v=w[2]+(y[0]-w[2])/2,L=y[3]+(w[1]-y[3])/2;return Vi(Rt(e[2]-b,e[1]-S),Rt(e[0]-b,e[3]-S))>0?[[v,y[1],y[2],y[3]],[w[0],w[1],v,w[3]]]:[[y[0],y[1],y[2],L],[w[0],L,w[2],w[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let v=w[2]+(y[0]-w[2])/2,L=w[3]+(y[1]-w[3])/2;return Vi(Rt(e[0]-b,e[1]-S),Rt(e[2]-b,e[3]-S))>0?[[v,y[1],y[2],y[3]],[w[0],w[1],v,w[3]]]:[[y[0],L,y[2],y[3]],[w[0],w[1],w[2],L]]}}return[y,w]},bh=(e,t,n,o,i,r)=>{let a=new Set,s=new Set;n===Ze||n===we?s.add(t[1]):a.add(t[0]),i===Ze||i===we?s.add(o[1]):a.add(o[0]),e.forEach(c=>{a.add(c[0]),a.add(c[2]),s.add(c[1]),s.add(c[3])}),a.add(r[0]),a.add(r[2]),s.add(r[1]),s.add(r[3]);let l=Array.from(s).sort((c,u)=>c-u),d=Array.from(a).sort((c,u)=>c-u);return{row:l.length,col:d.length,data:l.flatMap((c,u)=>d.map((h,m)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[m,u],pos:[h,c]})))}},Ql=(e,t,n)=>{switch(t){case rt:return q(n[0],e[1]);case we:return q(e[2],n[1]);case ke:return q(n[0],e[3])}return q(e[0],n[1])},Mh=(e,t,n,o)=>{if(o===we)switch(n){case we:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case rt:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ke:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case Ze:return e.pos[1]===t.pos[1]?4:2}else if(o===Ze)switch(n){case we:return e.pos[1]===t.pos[1]?4:2;case rt:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case ke:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case Ze:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(o===rt)switch(n){case we:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case rt:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case ke:return e.pos[0]===t.pos[0]?4:2;case Ze:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(o===ke)switch(n){case we:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case rt:return e.pos[0]===t.pos[0]?4:2;case ke:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case Ze:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},Ph=([e,t],n)=>[Wo([e,t-1],n),Wo([e+1,t],n),Wo([e,t+1],n),Wo([e-1,t],n)],Wo=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,Ui=(e,t)=>{for(let n=0;n<t.col;n++)for(let o=0;o<t.row;o++){let i=Wo([n,o],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},od=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],Yi=(e,t)=>{let n=t.get(e);return n&&ge(n)?n:null},tn=(e,t,n,o)=>{let i=e[0][0],r=e[0][1],a=e.map(s=>ha(s,dh(fa(e[0]),-1)));return(i<-wn||i>wn||r<-wn||r>wn||i+a[a.length-1][0]<-wn||i+a[a.length-1][0]>wn||r+a[a.length-1][1]<-wn||r+a[a.length-1][1]>wn)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:r,points:a,...Kl(a)}),a=a.map(([s,l])=>q(ji(s,-1e6,1e6),ji(l,-1e6,1e6))),{points:a,x:ji(i,-1e6,1e6),y:ji(r,-1e6,1e6),fixedSegments:(t?.length??0)>0?t:null,...Kl(a),startIsSpecial:n,endIsSpecial:o}},ya=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,o)=>{if(o===0||o===e.length-1)return!0;let i=e[o+1],r=Math.abs(n[1]-i[1])<Math.abs(n[0]-i[0]);return t===r?(t=r,!1):(t=r,!0)})}return e},wa=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let o=e[n-1];return ma(o,t)>ga}):e,Ih=e=>{switch(e){case 0:return rt;case 1:return we;case 2:return ke}return Ze},Jl=(e,t,n,o,i,r,a,s=!0,l=!0)=>a?s&&i&&r?ba(e,i,t,r,void 0,l):o:i?Ye(n||[0,0],i,r??hh([i])):o,ed=(e,t,n,o,i,r)=>rd(e,t,n,n&&pt(n,i,Array(4).fill(En(n,i,e))),o,i,r),td=(e,t,n,o)=>Jt(e,n,t,xt(o)),nd=(e,t)=>e[0]===t[0]&&e[1]===t[1],id=(e,t=ga)=>e.slice(1).map((n,o)=>Math.abs(n[0]-e[o][0])<t||Math.abs(n[1]-e[o][1])<t).every(Boolean);var Te=(e,t,n,o)=>{let i=!1,{points:r,fixedSegments:a,fileId:s}=n;U(e)&&(Object.keys(n).length===0||typeof r<"u"||typeof a<"u")?n={...n,angle:0,...ro({...e,x:n.x||e.x,y:n.y||e.y},t,n,o)}:typeof r<"u"&&(n={...Sh(r),...n});for(let l in n){let d=n[l];if(typeof d<"u"){if(e[l]===d&&(typeof d!="object"||d===null||l==="groupIds"||l==="scale"))continue;if(l==="scale"){let c=e[l],u=d;if(c[0]===u[0]&&c[1]===u[1])continue}else if(l==="points"){let c=e[l],u=d;if(c.length===u.length){let h=!1,m=c.length;for(;--m;){let f=c[m],g=u[m];if(f[0]!==g[0]||f[1]!==g[1]){h=!0;break}}if(!h)continue}}e[l]=d,i=!0}}return i&&((typeof n.height<"u"||typeof n.width<"u"||typeof s<"u"||typeof r<"u")&&at.delete(e),e.version=n.version??e.version+1,e.versionNonce=n.versionNonce??Ma(),e.updated=Pa()),e},He=(e,t,n=!1)=>{let o=!1;for(let i in t){let r=t[i];if(typeof r<"u"){if(e[i]===r&&(typeof r!="object"||r===null))continue;o=!0}}return!o&&!n?e:{...e,...t,version:t.version??e.version+1,versionNonce:t.versionNonce??Ma(),updated:Pa()}},ad=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=Ma(),e.updated=Pa(),e);var pd=5,Un=5,Th=10,Yo=10/1.5,Ne=(e,t)=>(t.elbowed?Un:pd)+e.strokeWidth/2,xt=e=>{let t=Math.max(pd,15),n=e?.value&&e.value<1?e.value:1;return Sa(t/(n*1.5),t,t*2)},Ft=e=>e.isBindingEnabled,Lh=(e,t,n,o,i,r,a)=>{let{start:s,end:l}=va(e,t,n,o,i.getNonDeletedElementsMap(),i.getNonDeletedElements(),r,{...a,finalize:!0});if(sd(e,s,"start",i,r.isBindingEnabled),sd(e,l,"end",i,r.isBindingEnabled),s.focusPoint||l.focusPoint){let d=new Map;s.focusPoint&&d.set(0,{point:Pt(e,"startBinding",e.startBinding,s.element,i.getNonDeletedElementsMap())||e.points[0]}),l.focusPoint&&d.set(e.points.length-1,{point:Pt(e,"endBinding",e.endBinding,l.element,i.getNonDeletedElementsMap())||e.points[e.points.length-1]}),R.movePoints(e,i,d)}return{start:s,end:l}},sd=(e,{mode:t,element:n,focusPoint:o},i,r,a=!0)=>{t===null?Oe(e,i,r):t!==void 0&&Nt(e,n,t,i,r,o,a)},hd=(e,t,n,o,i)=>{Mt(t.size===1,"Bound elbow arrows cannot be moved");let r=t.entries().next().value;Mt(r,"There should be a position update for dragging an elbow arrow endpoint");let[a,{point:s}]=r,l=R.getPointGlobalCoordinates(e,s,n),d=Jt(l,o,n,xt(i)),c=d?{element:d,mode:"orbit",focusPoint:R.getPointAtIndexGlobalCoordinates(e,a,n)}:{mode:null},u={mode:void 0};return a===0?{start:c,end:u}:{start:u,end:c}},Ch=(e,t,n,o,i,r,a,s,l,d,c)=>{let u={mode:void 0},h={mode:void 0},m=e.points.length>2,f=R.getPointGlobalCoordinates(e,t.get(i?a:s).point,n),g=Jt(f,o,n);if(i)return g?u={element:g,mode:"inside",focusPoint:f}:u={mode:null},{start:u,end:h};if(r){let E=l?.selectedLinearElement?.initialState.origin;if(g&&e.startBinding?.elementId===g.id){let x=ae(g.x+g.width/2,g.y+g.height/2);return{start:m?{mode:void 0}:{mode:"inside",element:g,focusPoint:E??x},end:m?{mode:"orbit",element:g,focusPoint:f}:{mode:"inside",element:g,focusPoint:f}}}if(g&&e.startBinding){let x=e.startBinding;if(Fi(f,o,n).find(w=>w.id===x.elementId)){let w=n.get(e.startBinding.elementId);return Mt(w,"Other element must be in the elements map"),{start:m?{mode:void 0}:{mode:w.id!==g.id?"orbit":"inside",element:w,focusPoint:E??ae(e.x,e.y)},end:{mode:"orbit",element:g,focusPoint:f}}}}if(e.startBinding&&e.startBinding.elementId!==g?.id){let x=n.get(e.startBinding.elementId);Mt(x,"Other element must be in the elements map");let w={mode:!!l.selectedLinearElement?.initialState.arrowStartIsInside?"inside":"orbit",element:x,focusPoint:c?le(x,n):E??ae(e.x,e.y)},M=g&&da(x,g,n),b;if(g){let S=d==="inside"||d==="skip";b={mode:S&&!M?"inside":"orbit",element:g,focusPoint:f}}else b={mode:null};return{start:m?{mode:void 0}:w,end:b}}if(!e.startBinding)return g?h={mode:d==="inside"||d==="skip"?"inside":"orbit",element:g,focusPoint:f}:h={mode:null},{start:u,end:h}}Mt(!1,"New arrow creation should not reach here")},ld=(e,t,n,o,i,r,a,s)=>{let l={mode:void 0},d={mode:void 0},c=a.points.length>2,u=Jt(e,i,o),h=n?Fi(e,i,o).some(E=>E.id===n.elementId):!1,m=n?o.get(n.elementId):null,f=h&&m?Ah(m.backgroundColor):!1,g=u&&m&&da(m,u,o);return r==="inside"||r==="skip"?(l=u?{element:!h||!m||f?u:m,focusPoint:e,mode:"inside"}:{mode:null},d=s&&u&&u.id===n?.elementId?{mode:null}:d,{current:l,other:d}):u?u.id===t?.elementId&&t.mode==="inside"?{current:{mode:"inside",focusPoint:e,element:u},other:d}:n?n.elementId===u.id?n.mode==="orbit"?(l={element:u,mode:"orbit",focusPoint:e},d={mode:s?null:void 0},{current:l,other:c?{mode:void 0}:d}):(l={element:u,mode:"inside",focusPoint:e},{current:l,other:c?{mode:void 0}:d}):(h&&m&&!f?l={element:m,mode:"inside",focusPoint:e}:l={element:u,mode:"orbit",focusPoint:e},{current:l,other:c?{mode:void 0}:d}):(l={element:u,mode:"orbit",focusPoint:e},{current:l,other:c?{mode:void 0}:d}):{current:{mode:null},other:d}},va=(e,t,n,o,i,r,a,s)=>vh("COMPLEX_BINDINGS")?Bh(e,t,i,r,a,s):md(e,t,n,o,i,r,a,s),md=(e,t,n,o,i,r,a,s)=>{let d=e.points.length-1,c=t.has(0),u=t.has(d),h={mode:void 0},m={mode:void 0};if(Mt(e.points.length>1,"Do not attempt to bind linear elements with a single point"),!c&&!u)return{start:h,end:m};if(c&&u)return{start:{mode:null},end:{mode:null}};if(!Ft(a))return h=c?{mode:null}:h,m=u?{mode:null}:m,{start:h,end:m};if(U(e))return hd(e,t,i,r,s?.zoom);let f=c?e.endBinding:e.startBinding,g=t.get(c?0:d)?.point;Mt(g,`Local point must be defined for ${c?"start":"end"} dragging`);let E=R.getPointGlobalCoordinates(e,g,i),x=Jt(E,r,i,xt(a.zoom)),y=x&&(s?.angleLocked?Zt(ae(n,o),x,i):Zt(E,x,i)),w=f?i.get(f.elementId):void 0,M=f&&w&&Ye(f.fixedPoint,w,i),b=w&&M&&Bt({point:M,element:w,elementsMap:i,threshold:0,overrideShouldTestInside:!0});if(f&&f.elementId===x?.id&&(!s?.newArrow||a.selectedLinearElement?.initialState.origin))return{start:{mode:"inside",element:x,focusPoint:c?E:s?.newArrow?a.selectedLinearElement.initialState.origin:R.getPointAtIndexGlobalCoordinates(e,0,i)},end:{mode:"inside",element:x,focusPoint:u?E:R.getPointAtIndexGlobalCoordinates(e,-1,i)}};if(s?.altKey)return{start:c?x?{mode:"inside",element:x,focusPoint:E}:{mode:null}:h,end:u?x?{mode:"inside",element:x,focusPoint:E}:{mode:null}:m};let S=x?y?{mode:"inside",element:x,focusPoint:E}:{mode:"orbit",element:x,focusPoint:to(e,E,x,c?"start":"end",i,a.zoom,a.isMidpointSnappingEnabled)||E}:{mode:null},v=R.getPointAtIndexGlobalCoordinates(e,c?-1:0,i),L=M&&w&&Bt({point:E,element:w,elementsMap:i,threshold:xt(a.zoom),overrideShouldTestInside:!0}),D=(s?.newArrow?a.selectedLinearElement?.initialState.arrowStartIsInside:f?.mode==="inside")?{mode:void 0}:w&&!b&&!L&&a.selectedLinearElement?.initialState.altFocusPoint?{mode:"orbit",element:w,focusPoint:a.selectedLinearElement.initialState.altFocusPoint}:s?.angleLocked&&w?{mode:"orbit",element:w,focusPoint:to(e,v,w,c?"end":"start",i,a.zoom,a.isMidpointSnappingEnabled)||v}:{mode:void 0};return{start:c?S:D,end:u?S:D}},Bh=(e,t,n,o,i,r)=>{let a=i.bindMode||"orbit",s=0,l=e.points.length-1,d=t.has(s),c=t.has(l),u={mode:void 0},h={mode:void 0};if(Mt(e.points.length>1,"Do not attempt to bind linear elements with a single point"),!d&&!c)return{start:u,end:h};if(d&&c)return{start:{mode:null},end:{mode:null}};if(!Ft(i))return u=d?{mode:null}:u,h=c?{mode:null}:h,{start:u,end:h};if(U(e))return hd(e,t,n,o);if(r?.newArrow){let{start:m,end:f}=Ch(e,t,n,o,d,c,s,l,i,a,r?.shiftKey);return{start:m,end:f}}if(d){let m=t.get(s)?.point;Mt(m,"Local point must be defined for start dragging");let f=R.getPointGlobalCoordinates(e,m,n),{current:g,other:E}=ld(f,e.startBinding,e.endBinding,n,o,a,e,r?.finalize);return{start:g,end:E}}if(c){let m=t.get(l)?.point;Mt(m,"Local point must be defined for end dragging");let f=R.getPointGlobalCoordinates(e,m,n),{current:g,other:E}=ld(f,e.endBinding,e.startBinding,n,o,a,e,r?.finalize);return{start:E,end:g}}return{start:u,end:h}},d3=(e,t,n)=>{e.forEach(o=>{Lh(o,new Map,1/0,1/0,t,n)})},Nt=(e,t,n,o,i,r,a=!0)=>{let s=i.getNonDeletedElementsMap(),l;U(e)?l={elementId:t.id,mode:"orbit",...Nh(e,t,o,s,a)}:l={elementId:t.id,mode:n,...ao(e,t,o,s,r)},i.mutateElement(e,{[o==="start"?"startBinding":"endBinding"]:l}),ud(t.boundElements||[]).has(e.id)||i.mutateElement(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Oe=(e,t,n)=>{let o=t==="start"?"startBinding":"endBinding",i=e[o];if(i==null)return null;let r=e[t==="start"?"endBinding":"startBinding"];if(!r||r.elementId!==i.elementId){let a=n.getNonDeletedElementsMap().get(i.elementId);n.mutateElement(a,{boundElements:a.boundElements?.filter(s=>s.id!==e.id)})}return n.mutateElement(e,{[o]:null}),i.elementId},Re=(e,t,n)=>{if(!ge(e))return;let{simultaneouslyUpdated:o}=n??{},i=Gh(o),r=t.getNonDeletedElementsMap();n?.changedElements&&(r=new Map(r),n.changedElements.forEach(s=>{r.set(s.id,s)})),qi(r,e,s=>{if(!j(s)||s.isDeleted||!Dh(s,e))return;let l=s.startBinding?r.get(s.startBinding.elementId):null,d=s.endBinding?l?.id===s.endBinding.elementId?l:r.get(s.endBinding.elementId):null;if(i.has(s.id))return;let c=Ki(r,s,(h,m)=>{if(h&&ge(h)&&(m==="startBinding"||m==="endBinding")&&(e.id===s[m]?.elementId||e.id===s[m==="startBinding"?"endBinding":"startBinding"]?.elementId)){let f=Pt(s,m,s[m],h,r);if(f)return[m==="startBinding"?0:s.points.length-1,{point:f}]}return null}).filter(h=>h!==null);R.movePoints(s,t,new Map(c),{moveMidPointsWithElement:!!l&&l?.id===d?.id});let u=Z(s,r);u&&!u.isDeleted&&Vn(s,t,!1)})},dd=(e,t,n,o,i)=>{Mt(!U(e),"Elbow arrows not supported for indirect updates");let r=e[t],a=r&&n.get(r.elementId),s=R.getPointAtIndexGlobalCoordinates(e,t==="startBinding"?0:-1,n),l=a&&Bt({element:a,point:s,elementsMap:n,threshold:xt(i.zoom)}),d=t==="startBinding"?"start":"end";if(Oe(e,d,o),l){let c=t==="startBinding"?0:e.points.length-1,u=e.points[c],h=md(e,new Map([[c,{point:u}]]),s[0],s[1],n,o.getNonDeletedElements(),i);h[d]&&h[d].element?.id===a.id&&h[d].mode&&Nt(e,a,h[d].mode,d,o,h[d].focusPoint)}},c3=(e,t,n,o)=>{if(j(e)){let i=t.getNonDeletedElementsMap();e.startBinding&&dd(e,"startBinding",i,t,n),e.endBinding&&dd(e,"endBinding",i,t,n)}else Re(e,t,{...o,changedElements:new Map([[e.id,e]])})},Dh=(e,t)=>e.startBinding?.elementId===t.id||e.endBinding?.elementId===t.id,Gh=e=>new Set((e||[]).map(t=>t.id)),rd=(e,t,n,o,i,r,a)=>{let s=en(jo(t,e));return!n||!o?s:Oh(i,n,r,a)?zo(n,o,e):en(jo(e,le(n,r)))},Oh=(e,t,n,o)=>{let i=En(t,n,e),r=xt(o);return i>r?null:i},ba=(e,t,n,o,i,r=!0)=>{let a=U(e),s=R.getPointAtIndexGlobalCoordinates(e,n==="start"?0:-1,o);if(e.points.length<2)return s;let l=ml(t)&&a?Rh(e,t,o,s):s,d=i&&!a?i[1]:R.getPointAtIndexGlobalCoordinates(e,n==="start"?1:-2,o),c=Ne(t,e),u=pt(t,o),h=xn(u),m=null;if(a){let f=qe(zo(t,u,s)),E=(r?Aa(t,o,l,.05,e):void 0)||s,x=ae(f?h[0]:E[0],f?E[1]:h[1]),y=i??Zi(x,Xi($i(Ia(jo(E,x)),Math.max(t.width,t.height)*2),x));if(m=Gt(t,o,y,c).sort(nn)[0],!m){let w=ae(f?E[0]:h[0],f?h[1]:E[1]),M=Zi(w,Xi($i(Ia(jo(E,w)),Math.max(t.width,t.height)*2),w));m=Gt(t,o,M,Un).sort(nn)[0]}}else{let f=i;if(!f){let g=$i(Ia(jo(l,d)),Mn(l,d)+Math.max(t.width,t.height)+c*2);f=i??Zi(Xi(g,d),Xi($i(g,-1),d))}m=Mn(l,d)<1?l:Gt(t,o,f,c).sort((g,E)=>nn(g,d)-nn(E,d))[0]}return!m||nn(l,m)<Uo?l:m},Rh=(e,t,n,o)=>{let i=le(t,n),r=pe(o,i,-t.angle),a=Ne(t,e);return r[0]<t.x&&r[1]<t.y?r[1]-t.y>-a?pe(ae(t.x-a,t.y),i,t.angle):pe(ae(t.x,t.y-a),i,t.angle):r[0]<t.x&&r[1]>t.y+t.height?r[0]-t.x>-a?pe(ae(t.x,t.y+t.height+a),i,t.angle):pe(ae(t.x-a,t.y+t.height),i,t.angle):r[0]>t.x+t.width&&r[1]>t.y+t.height?r[0]-t.x<t.width+a?pe(ae(t.x+t.width,t.y+t.height+a),i,t.angle):pe(ae(t.x+t.width+a,t.y+t.height),i,t.angle):r[0]>t.x+t.width&&r[1]<t.y?r[0]-t.x<t.width+a?pe(ae(t.x+t.width,t.y-a),i,t.angle):pe(ae(t.x+t.width+a,t.y),i,t.angle):o},Aa=(e,t,n,o=.05,i)=>{let{x:r,y:a,width:s,height:l,angle:d}=e,c=le(e,t,-.1,-.1),u=pe(n,c,-d),h=i?Ne(e,i):0,m=Sa(o*l,5,80),f=Sa(o*s,5,80);if(!(Mn(c,u)<h)){if(u[0]<=r+s/2&&u[1]>c[1]-m&&u[1]<c[1]+m)return pe(ae(r-h,c[1]),c,d);if(u[1]<=a+l/2&&u[0]>c[0]-f&&u[0]<c[0]+f)return pe(ae(c[0],a-h),c,d);if(u[0]>=r+s/2&&u[1]>c[1]-m&&u[1]<c[1]+m)return pe(ae(r+s+h,c[1]),c,d);if(u[1]>=a+l/2&&u[0]>c[0]-f&&u[0]<c[0]+f)return pe(ae(c[0],a+l+h),c,d);if(e.type==="diamond"){let g=h,E=ae(r+s/4-g,a+l/4-g),x=ae(r+3*s/4+g,a+l/4-g),y=ae(r+s/4-g,a+3*l/4+g),w=ae(r+3*s/4+g,a+3*l/4+g);if(Mn(E,u)<Math.max(f,m))return pe(E,c,d);if(Mn(x,u)<Math.max(f,m))return pe(x,c,d);if(Mn(y,u)<Math.max(f,m))return pe(y,c,d);if(Mn(w,u)<Math.max(f,m))return pe(w,c,d)}}},Fh=(e,t,n)=>{let o=e[t];if(!o)return{element:null,fixedPoint:null,focusPoint:null,binding:o,mode:null};let i=n.get(o.elementId);return{element:i,fixedPoint:o.fixedPoint,focusPoint:Ye(fn(o.fixedPoint),i,n),binding:o,mode:o.mode}},cd=e=>e.width*e.height,Pt=(e,t,n,o,i,r)=>{if(n==null||n.elementId!==o.id&&e.points.length>2||kh(e.points[e.points.length-1],ae(0,0)))return null;let a=Ye(fn(n.fixedPoint),o,i);if(n.mode==="inside")return R.createPointAt(e,i,a[0],a[1],null);let{element:s,focusPoint:l}=Fh(e,t==="startBinding"?"endBinding":"startBinding",i),d=R.getPointAtIndexGlobalCoordinates(e,t==="startBinding"?1:-2,i),c=e.points.length===2&&l||d,u=c&&Zi(a,c),h=s&&u&&Gt(s,i,u,Ne(s,e)).sort((w,M)=>nn(w,a)-nn(M,a))[0],m=u&&Gt(o,i,u,Ne(o,e)).sort((w,M)=>nn(w,c)-nn(M,c))[0],f=e.startArrowhead!==null,g=e.endArrowhead!==null,E=!f&&!g||t==="startBinding"&&f||t==="endBinding"&&g?a:m||a;if(s&&m&&!r&&cd(s)<cd(o)*2&&Bt({element:s,point:m,elementsMap:i,threshold:Ne(s,e),overrideShouldTestInside:!0}))return R.createPointAt(e,i,E[0],E[1],null);let y=Mn(s&&(h||l)||d,m||a)<=Th;return s?y?R.createPointAt(e,i,E?.[0]||a[0],E?.[1]||a[1],null):R.createPointAt(e,i,m?.[0]||a[0],m?.[1]||a[1],null):R.createPointAt(e,i,y?a[0]:m?.[0]??a[0],y?a[1]:m?.[1]??a[1],null)},Nh=(e,t,n,o,i=!0,r=!0)=>{let a=[t.x,t.y,t.x+t.width,t.y+t.height],s=i?ba(e,t,n,o,void 0,r):R.getPointAtIndexGlobalCoordinates(e,n==="start"?0:-1,o),l=ae(a[0]+(a[2]-a[0])/2,a[1]+(a[3]-a[1])/2),d=pe(s,l,-t.angle);return{fixedPoint:fn([(d[0]-t.x)/Math.max(t.width,Uo),(d[1]-t.y)/Math.max(t.height,Uo)])}},ao=(e,t,n,o,i)=>{let r=i||R.getPointAtIndexGlobalCoordinates(e,n==="start"?0:-1,o),a=le(t,o),s=pe(r,a,-t.angle),l=(s[0]-t.x)/Math.max(t.width,Uo),d=(s[1]-t.y)/Math.max(t.height,Uo);return{fixedPoint:fn([l,d])}},fd=(e,t,n)=>{for(let o of e){if("boundElements"in o&&o.boundElements&&Object.assign(o,{boundElements:o.boundElements.reduce((i,r)=>{let a=t.get(r.id);return a&&i.push({...r,id:a}),i},[])}),"containerId"in o&&o.containerId&&Object.assign(o,{containerId:t.get(o.containerId)??null}),"endBinding"in o&&o.endBinding){let i=t.get(o.endBinding.elementId);Object.assign(o,{endBinding:i?{...o.endBinding,elementId:i}:null})}if("startBinding"in o&&o.startBinding){let i=t.get(o.startBinding.elementId);Object.assign(o,{startBinding:i?{...o.startBinding,elementId:i}:null})}U(o)&&Object.assign(o,ro(o,n,{points:[o.points[0],o.points[o.points.length-1]]}))}},u3=(e,t)=>{let n=ud(e);for(let o of t)Pn.unbindAffected(n,o,(i,r)=>Te(i,n,r)),In.unbindAffected(n,o,(i,r)=>Te(i,n,r))},Vo=(e,t,n=[])=>{if(!e)return null;let o=e.filter(i=>!t.has(i.id));return o.push(...n.map(i=>({id:i.id,type:i.type}))),o},gd=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),qi=(e,t,n)=>{ge(t)&&(t.boundElements?.slice()??[]).forEach(({id:i})=>{n(e.get(i),"boundElements",i)})},Ki=(e,t,n)=>{let o=[];if(t.frameId){let i=t.frameId;o.push(n(e.get(i),"frameId",i))}if(Ee(t)){let i=t.containerId;o.push(n(e.get(i),"containerId",i))}if(j(t)){if(t.startBinding){let i=t.startBinding.elementId;o.push(n(e.get(i),"startBinding",i))}if(t.endBinding){let i=t.endBinding.elementId;o.push(n(e.get(i),"endBinding",i))}}return o},Pn=class{static unbindAffected(t,n,o){n&&Ki(t,n,i=>{!i||i.isDeleted||qi(t,i,(r,a,s)=>{s===n.id&&o(i,{boundElements:Vo(i.boundElements,new Set([s]))})})})}static rebindAffected=(t,n,o)=>{!n||n.isDeleted||Ki(t,n,(i,r)=>{if(!i||i.isDeleted){o(n,{[r]:null});return}r!=="frameId"&&(i.boundElements?.find(a=>a.id===n.id)||(j(n)&&o(i,{boundElements:Vo(i.boundElements,new Set,new Array(n))}),te(n)&&(i.boundElements?.find(a=>a.type==="text")?o(n,{[r]:null}):o(i,{boundElements:Vo(i.boundElements,new Set,new Array(n))}))))})}},In=class{static unbindAffected(t,n,o){n&&qi(t,n,i=>{!i||i.isDeleted||Ki(t,i,(r,a,s)=>{s===n.id&&o(i,{[a]:null})})})}static rebindAffected=(t,n,o)=>{!n||n.isDeleted||qi(t,n,(i,r,a)=>{if(!i||i.isDeleted){o(n,{boundElements:Vo(n.boundElements,new Set([a]))});return}te(i)&&((n.boundElements?.slice()??[]).reverse().find(l=>l.type==="text")?.id===i.id?i.containerId!==n.id&&o(i,{containerId:n.id}):(i.containerId!==null&&o(i,{containerId:null}),o(n,{boundElements:Vo(n.boundElements,new Set([i.id]))})))})}},Ye=(e,t,n)=>{let[o,i]=fn(e);return pe(ae(t.x+t.width*o,t.y+t.height*i),le(t,n),t.angle)},Hh=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),o=e.endBinding&&t.get(e.endBinding.elementId),i=n&&e.startBinding?Ye(e.startBinding.fixedPoint,n,t):ae(e.x+e.points[0][0],e.y+e.points[0][1]),r=o&&e.endBinding?Ye(e.endBinding.fixedPoint,o,t):ae(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[i,r]},Ed=(e,t)=>{let[n,o]=Hh(e,t);return[R.pointFromAbsoluteCoords(e,n,t),R.pointFromAbsoluteCoords(e,o,t)]},zh=e=>Array.isArray(e)&&e.length===2&&e.every(t=>Number.isFinite(t)),fn=e=>{if(!zh(e))return[.5001,.5001];let t=1e-4;return Math.abs(e[0]-.5)<t||Math.abs(e[1]-.5)<t?e.map(n=>Math.abs(n-.5)<t?.5001:n):e},Wh=e=>e.type==="ellipse"||e.type==="diamond"?e.type:"rectangle",_h={rectangle:[{centerAngle:0,sectorWidth:75,side:"right"},{centerAngle:45,sectorWidth:15,side:"bottom-right"},{centerAngle:90,sectorWidth:75,side:"bottom"},{centerAngle:135,sectorWidth:15,side:"bottom-left"},{centerAngle:180,sectorWidth:75,side:"left"},{centerAngle:225,sectorWidth:15,side:"top-left"},{centerAngle:270,sectorWidth:75,side:"top"},{centerAngle:315,sectorWidth:15,side:"top-right"}],diamond:[{centerAngle:0,sectorWidth:15,side:"right"},{centerAngle:45,sectorWidth:75,side:"bottom-right"},{centerAngle:90,sectorWidth:15,side:"bottom"},{centerAngle:135,sectorWidth:75,side:"bottom-left"},{centerAngle:180,sectorWidth:15,side:"left"},{centerAngle:225,sectorWidth:75,side:"top-left"},{centerAngle:270,sectorWidth:15,side:"top"},{centerAngle:315,sectorWidth:75,side:"top-right"}],ellipse:[{centerAngle:0,sectorWidth:15,side:"right"},{centerAngle:45,sectorWidth:75,side:"bottom-right"},{centerAngle:90,sectorWidth:15,side:"bottom"},{centerAngle:135,sectorWidth:75,side:"bottom-left"},{centerAngle:180,sectorWidth:15,side:"left"},{centerAngle:225,sectorWidth:75,side:"top-left"},{centerAngle:270,sectorWidth:15,side:"top"},{centerAngle:315,sectorWidth:75,side:"top-right"}]},jh=e=>e.map((t,n)=>{let o=t.sectorWidth/2,i=t.centerAngle-o,r=t.centerAngle+o;return i=(i%360+360)%360,r=(r%360+360)%360,{start:i,end:r,side:t.side}}),Vh=(e,t)=>{let[n,o]=e,i=n-.5,r=o-.5,a=Math.atan2(r,i);a<0&&(a+=2*Math.PI);let s=a*180/Math.PI,l=_h[t],d=jh(l);for(let h of d)if(h.start<=h.end){if(s>=h.start&&s<=h.end)return h.side}else if(s>=h.start||s<=h.end)return h.side;let c=1/0,u=l[0].side;for(let h of l){let m=Math.abs(s-h.centerAngle);m>180&&(m=360-m),m<c&&(c=m,u=h.side)}return u},p3=(e,t)=>{let n=t.get(e.elementId);if(!n||n.isDeleted||!ge(n))return null;let o=le(n,t),i=Wh(n),r=Vh(fn(e.fixedPoint),i),a=.01;if(n.type==="diamond"){let[s,l]=mn(n),[d,c,u,h]=s,m,f;switch(r){case"left":{if(l.length>=3){let E=l[2][1];m=E[0]-a,f=E[1]}else{let g=Ge(c[1],u[0]);m=g[0]-a,f=g[1]}break}case"right":{if(l.length>=1){let E=l[0][1];m=E[0]+a,f=E[1]}else{let g=Ge(h[1],d[0]);m=g[0]+a,f=g[1]}break}case"top":{if(l.length>=4){let E=l[3][1];m=E[0],f=E[1]-a}else{let g=Ge(u[1],h[0]);m=g[0],f=g[1]-a}break}case"bottom":{if(l.length>=2){let E=l[1][1];m=E[0],f=E[1]+a}else{let g=Ge(d[1],c[0]);m=g[0],f=g[1]+a}break}case"top-right":{let g=Ge(h[0],h[1]);m=g[0]+a*.707,f=g[1]-a*.707;break}case"bottom-right":{let g=Ge(d[0],d[1]);m=g[0]+a*.707,f=g[1]+a*.707;break}case"bottom-left":{let g=Ge(c[0],c[1]);m=g[0]-a*.707,f=g[1]+a*.707;break}case"top-left":{let g=Ge(u[0],u[1]);m=g[0]-a*.707,f=g[1]-a*.707;break}default:return null}return pe(ae(m,f),o,n.angle)}if(n.type==="ellipse"){let s=n.x+n.width/2,l=n.y+n.height/2,d=n.width/2,c=n.height/2,u,h;switch(r){case"top":{u=s,h=l-c-a;break}case"right":{u=s+d+a,h=l;break}case"bottom":{u=s,h=l+c+a;break}case"left":{u=s-d-a,h=l;break}case"top-right":{let m=-Math.PI/4,f=d*Math.cos(m),g=c*Math.sin(m);u=s+f+a*.707,h=l+g-a*.707;break}case"bottom-right":{let m=Math.PI/4,f=d*Math.cos(m),g=c*Math.sin(m);u=s+f+a*.707,h=l+g+a*.707;break}case"bottom-left":{let m=3*Math.PI/4,f=d*Math.cos(m),g=c*Math.sin(m);u=s+f-a*.707,h=l+g+a*.707;break}case"top-left":{let m=-3*Math.PI/4,f=d*Math.cos(m),g=c*Math.sin(m);u=s+f-a*.707,h=l+g-a*.707;break}default:return null}return pe(ae(u,h),o,n.angle)}if(Do(n)){let[s,l]=hn(n),[d,c,u,h]=s,m,f;switch(r){case"top":{let g=Ge(d[0],d[1]);m=g[0],f=g[1]-a;break}case"right":{let g=Ge(c[0],c[1]);m=g[0]+a,f=g[1];break}case"bottom":{let g=Ge(u[0],u[1]);m=g[0],f=g[1]+a;break}case"left":{let g=Ge(h[0],h[1]);m=g[0]-a,f=g[1];break}case"top-left":{if(l.length>=1){let g=l[0],E=g[0],x=g[3],y=Ge(E,x);m=y[0]-a*.707,f=y[1]-a*.707}else m=n.x-a,f=n.y-a;break}case"top-right":{if(l.length>=2){let g=l[1],E=g[0],x=g[3],y=Ge(E,x);m=y[0]+a*.707,f=y[1]-a*.707}else m=n.x+n.width+a,f=n.y-a;break}case"bottom-right":{if(l.length>=3){let g=l[2],E=g[0],x=g[3],y=Ge(E,x);m=y[0]+a*.707,f=y[1]+a*.707}else m=n.x+n.width+a,f=n.y+n.height+a;break}case"bottom-left":{if(l.length>=4){let g=l[3],E=g[0],x=g[3],y=Ge(E,x);m=y[0]-a*.707,f=y[1]+a*.707}else m=n.x-a,f=n.y+n.height+a;break}default:return null}return pe(ae(m,f),o,n.angle)}return null},Ge=(e,t)=>ae((e[0]+t[0])/2,(e[1]+t[1])/2);I();import{arrayToMap as zd,findIndex as Wd,findLastIndex as _d}from"@excalidraw/common";I();I();import{arrayToMap as lm,isShallowEqual as dm}from"@excalidraw/common";import{lineSegment as nr,pointFrom as st,pointRotateRads as lo}from"@excalidraw/math";I();import{arrayToMap as It}from"@excalidraw/common";import{isPointWithinBounds as Kh,pointFrom as Da}from"@excalidraw/math";I();import{vectorCross as bd,vectorFromPoint as Qi}from"@excalidraw/math";function xd(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function Uh(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var Yh=1e-6;function yd(e,t){let n=Qi(e[1],e[0]),o=Qi(t,e[0]),i=bd(n,o);return Math.abs(i)<Yh}function ka(e,t){let n=Qi(e[1],e[0]),o=Qi(t,e[0]);return bd(n,o)<0}function wd(e,t){return yd(e,t[0])||yd(e,t[1])||(ka(e,t[0])?!ka(e,t[1]):ka(e,t[1]))}function Md(e,t){return Uh(xd(e),xd(t))&&wd(e,t)&&wd(t,e)}I();import{arrayToMap as Ji}from"@excalidraw/common";import{validateOrderKey as Xh,generateNKeysBetween as $h}from"@excalidraw/fractional-indexing";var Ta=class extends Error{code="ELEMENT_HAS_INVALID_INDEX"},Zh=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:o,reconciliationContext:i})=>{let r=[],a=l=>`${l?.index}:${l?.id}:${l?.type}:${l?.isDeleted}:${l?.version}:${l?.versionNonce}`,s=e.map(l=>l.index);for(let[l,d]of s.entries()){let c=s[l-1],u=s[l+1];if(La(d,c,u)||r.push(`Fractional indices invariant has been compromised: "${a(e[l-1])}", "${a(e[l])}", "${a(e[l+1])}"`),n&&Ct(e[l])){let h=e[l],m=Z(h,Ji(e));m&&m.index<=h.index&&r.push(`Fractional indices invariant for bound elements has been compromised: "${a(m)}", "${a(h)}"`)}}if(r.length){let l=new Ta,d=[];if(i&&(d.push("Additional reconciliation context:"),d.push(i.localElements.map(c=>a(c))),d.push(i.remoteElements.map(c=>a(c)))),o||console.error(r.join(`
10
+ `)=>e.reduce((o,i)=>(te(i)&&o.push(i.text),o),[]).join(t);I();import{curvePointDistance as Qr,distanceToLineSegment as Jr,pointRotateRads as ea}from"@excalidraw/math";import{ellipse as B1,ellipseDistanceFromPoint as D1}from"@excalidraw/math/ellipse";var gn=(e,t,n)=>{switch(e.type){case"selection":case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return G1(e,t,n);case"diamond":return O1(e,t,n);case"ellipse":return R1(e,t,n);case"line":case"arrow":case"freedraw":return F1(e,t,n)}},G1=(e,t,n)=>{let o=de(e,t),i=ea(n,o,-e.angle),[r,a]=pn(e);return Math.min(...r.map(s=>Jr(i,s)),...a.map(s=>Qr(s,i)).filter(s=>s!==null))},O1=(e,t,n)=>{let o=de(e,t),i=ea(n,o,-e.angle),[r,a]=hn(e);return Math.min(...r.map(s=>Jr(i,s)),...a.map(s=>Qr(s,i)).filter(s=>s!==null))},R1=(e,t,n)=>{let o=de(e,t);return D1(ea(n,o,-e.angle),B1(o,e.width/2,e.height/2))},F1=(e,t,n)=>{let[o,i]=Wn(e,t);return Math.min(...o.map(r=>Jr(n,r)),...i.map(r=>Qr(r,n)))};I();var ta=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",qx=e=>e==="rectangle"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line"||e==="text"||e==="embeddable",Kx=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",Qx=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",Cl=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",Jx=e=>e==="arrow",ey=e=>e==="arrow";var Di=e=>{if(e.type==="arrow")return!1;let t=ta(e.type)&&!Nl(e.backgroundColor)||Tt(e)||Pi(e)||te(e);return e.type==="line"?t&&Ut(e.points):e.type==="freedraw"?t&&Ut(e.points):t||Ae(e)},na=null,Bl=null,Dl=1/0,Gl=!1,Ol=!1,Lt=({point:e,element:t,threshold:n,elementsMap:o,frameNameBound:i=null,overrideShouldTestInside:r=!1})=>{if(na&&Wl(e,na)&&Dl<=n&&r===Ol){let u=Bl?.deref();if(u&&u.id===t.id&&u.version===t.version&&u.versionNonce===t.versionNonce)return Gl}let a=i?oa(Pe(i.x-n,i.y-n),e,Pe(i.x+i.width+n,i.y+i.height+n)):!1,s=ue(t,o,!0);if(!_l(e,s,t.angle,n)&&!a)return!1;let c=(r||Di(t))&&Xt(e,t,o)||Rl(e,t,o,n)||a;return na=e,Bl=new WeakRef(t),Dl=n,Ol=r,Gl=c,c},_l=(e,t,n,o=0)=>{let i=n===0?e:it(e,En(t),-n);return oa(Pe(t[0]-o,t[1]-o),i,Pe(t[2]+o,t[3]+o))},V1=(e,t,n,o=0)=>{let i=ue(t,n,!0);return _l(e,i,t.angle,o)},fy=(e,t)=>!Lt(e)&&!Y1(e.point,e.element,t)&&V1(e.point,e.element,t),Y1=(e,t,n)=>{let o=Q(t,n);if(!o)return!1;let i=ne(t)?{...o,...D.getBoundTextElementPosition(t,o,n)}:o;return Xt(e,i,n)},jl=(e,[t,n],o,i=0)=>{let r=Pe(t,n),a=!ee(e),s=Math.max(1,i),l=[t-s,n-s,t+s,n+s],d=ue(e,o);if(!Qt(l,d))return!1;if(e.frameId){let h=o.get(e.frameId);if(h&&ee(h)){let m=ue(h,o);if(!Dt(r,m))return!1}}let c=Bt(e,o,Fo(de(e,o),r)),u=gn(e,o,r);return a?c.length===0||u<=i:c.length>0&&u<=s},Gi=(e,t,n,o)=>{let i=[];for(let r=t.length-1;r>=0;--r){let a=t[r];if(Fl(!a.isDeleted,"Elements in the function parameter for getAllElementsAtPositionForBinding() should not contain deleted elements"),Ee(a,!1)&&jl(a,e,n,o)&&(i.push(a),ta(a.type)&&!Nl(a.backgroundColor)))break}return i},Kt=(e,t,n,o)=>{let i=Gi(e,t,n,o);return!i||i.length===0?null:i.length===1?i[0]:i.sort((r,a)=>a.width**2+a.height**2-(r.width**2+r.height**2)).pop()},Vl=(e,t,n,o,i)=>{let r=[];for(let s=n.length-1;s>=0;--s){let l=n[s];Fl(!l.isDeleted,"Elements in the function parameter for getAllElementsAtPositionForBinding() should not contain deleted elements"),Ee(l,!1)&&jl(l,e,o,i)&&r.push(l)}if(!r||r.length===0)return null;if(r.length===1)return r[0];let a=r.filter(s=>gn(s,o,e)<=Ne(s,t)||Xt(e,s,o));return a.length===0?null:a[0]},Bt=(e,t,n,o=0,i=!1)=>{let r=[Math.min(n[0][0]-o,n[1][0]-o),Math.min(n[0][1]-o,n[1][1]-o),Math.max(n[0][0]+o,n[1][0]+o),Math.max(n[0][1]+o,n[1][1]+o)],a=ue(e,t);if(!Qt(r,a))return[];switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"selection":case"magicframe":return X1(e,t,n,o,i);case"diamond":return $1(e,t,n,o,i);case"ellipse":return Z1(e,t,n,o);case"line":case"freedraw":case"arrow":return U1(e,n,t,i)}},Yl=(e,t,n,o,i,r=!1)=>{for(let a of e){let s=Oi(a[0],a[1],a[2],a[3]),l=[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])];if(!Qt(s,l))continue;let d=Hl(a,t);if(d.length>0){for(let c of d)n.push(it(c,o,i));if(r)return n}}return n},Ul=(e,t,n,o,i,r=!1)=>{for(let a of e){let s=zl(a,t);if(s&&(n.push(it(s,o,i)),r))return n}return n},U1=(e,t,n,o=!1)=>{let[i,r]=Wn(e,n),a=[];for(let s of i){let l=zl(s,t);if(l&&(a.push(l),o))return a}for(let s of r){let l=Oi(s[0],s[1],s[2],s[3]),d=[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])];if(!Qt(l,d))continue;let c=Hl(s,t,{iterLimit:10});if(c.length>0&&(a.push(...c),o))return a}return a},X1=(e,t,n,o=0,i=!1)=>{let r=de(e,t),a=it(n[0],r,-e.angle),s=it(n[1],r,-e.angle),l=Fo(a,s),[d,c]=pn(e,o),u=[];return Ul(d,l,u,r,e.angle,i),i&&u.length>0||Yl(c,l,u,r,e.angle,i),u},$1=(e,t,n,o=0,i=!1)=>{let r=de(e,t),a=it(n[0],r,-e.angle),s=it(n[1],r,-e.angle),l=Fo(a,s),[d,c]=hn(e,o),u=[];return Ul(d,l,u,r,e.angle,i),i&&u.length>0||Yl(c,l,u,r,e.angle,i),u},Z1=(e,t,n,o=0)=>{let i=de(e,t),r=it(n[0],i,-e.angle),a=it(n[1],i,-e.angle);return j1(_1(i,e.width/2+o,e.height/2+o),Fo(r,a)).map(s=>it(s,i,e.angle))},Rl=(e,t,n,o=1)=>gn(t,n,e)<=o,Xt=(e,t,n)=>{if((ne(t)||Se(t))&&!Ut(t.points))return!1;let[o,i,r,a]=ue(t,n);if(!oa(Pe(o,i),e,Pe(r,a)))return!1;let s=Pe((o+r)/2,(i+a)/2),l=N1(W1(z1(H1(e,s,.1)),Math.max(t.width,t.height)*2),s),d=Fo(e,l);return Bt(t,n,d).filter((u,h,m)=>m.findIndex(g=>Wl(g,u))===h).length%2===1},ia=(e,t,n)=>{let o=(a,s)=>{let{x:l,y:d,width:c,height:u,angle:h}=a,m=de(a,n);if(a.type==="diamond"){let[f,E,x,y,w,M,b,S]=to(a);return[Pe(l+f,d+E-s),Pe(l+x+s,d+y),Pe(l+w,d+M+s),Pe(l+b-s,d+S)].map(k=>it(k,m,h))}if(a.type==="ellipse"){let f=l+c/2,E=d+u/2,x=c/2,y=u/2;return[Pe(f,E-y-s),Pe(f+x+s,E),Pe(f,E+y+s),Pe(f-x-s,E)].map(M=>it(M,m,h))}return[Pe(l-s,d-s),Pe(l+c+s,d-s),Pe(l+c+s,d+u+s),Pe(l-s,d+u+s)].map(f=>it(f,m,h))},i=-1*Math.max(e.width,e.height)/20;return o(e,i).every(a=>Xt(a,t,n))};I();import{invariant as Xl,isDevEnv as q1,isTestEnv as K1}from"@excalidraw/common";import{pointFrom as xn,pointFromVector as Ri,pointRotateRads as Fi,pointScaleFromOrigin as Ni,pointsEqual as Q1,triangleIncludesPoint as ra,vectorCross as Xe,vectorFromPoint as oe,vectorScale as Hi}from"@excalidraw/math";var be=[1,0],ke=[0,1],Ze=[-1,0],rt=[0,-1],Jt=e=>{let[t,n]=e,o=Math.abs(t),i=Math.abs(n);return t>i?be:t<=-i?Ze:n>o?ke:rt},$e=(e,t)=>Jt(oe(e,t)),yt=(e,t)=>qe($e(e,t)),we=(e,t)=>e[0]===t[0]&&e[1]===t[1],qe=e=>we(e,be)||we(e,Ze),by=e=>!qe(e),J1=(e,t,n)=>{let o=En(t);(q1()||K1())&&(Xl(e.width>0&&e.height>0,"Diamond element has no width or height"),Xl(!Q1(o,n),"The point is too close to the element mid point to determine heading"));let i=.95,r=Ri(Hi(oe(Fi(xn(e.x+e.width/2,e.y),o,e.angle),o),i),o),a=Ri(Hi(oe(Fi(xn(e.x+e.width,e.y+e.height/2),o,e.angle),o),i),o),s=Ri(Hi(oe(Fi(xn(e.x+e.width/2,e.y+e.height),o,e.angle),o),i),o),l=Ri(Hi(oe(Fi(xn(e.x,e.y+e.height/2),o,e.angle),o),i),o);if(Xe(oe(n,r),oe(r,a))<=0&&Xe(oe(n,r),oe(r,l))>0)return $e(r,o);if(Xe(oe(n,a),oe(a,s))<=0&&Xe(oe(n,a),oe(a,r))>0)return $e(a,o);if(Xe(oe(n,s),oe(s,l))<=0&&Xe(oe(n,s),oe(s,a))>0)return $e(s,o);if(Xe(oe(n,l),oe(l,r))<=0&&Xe(oe(n,l),oe(l,s))>0)return $e(l,o);if(Xe(oe(n,o),oe(r,o))<=0&&Xe(oe(n,o),oe(a,o))>0){let c=e.width>e.height?r:a;return $e(c,o)}else if(Xe(oe(n,o),oe(a,o))<=0&&Xe(oe(n,o),oe(s,o))>0){let c=e.width>e.height?s:a;return $e(c,o)}else if(Xe(oe(n,o),oe(s,o))<=0&&Xe(oe(n,o),oe(l,o))>0){let c=e.width>e.height?s:l;return $e(c,o)}let d=e.width>e.height?r:l;return $e(d,o)},No=(e,t,n)=>{let i=En(t);if(e.type==="diamond")return J1(e,t,n);let r=Ni(xn(t[0],t[1]),i,2),a=Ni(xn(t[2],t[1]),i,2),s=Ni(xn(t[0],t[3]),i,2),l=Ni(xn(t[2],t[3]),i,2);return ra([r,a,i],n)?rt:ra([a,l,i],n)?be:ra([l,s,i],n)?ke:Ze},aa=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1];I();import{getSizeFromPoints as Eh,randomInteger as Ea,getUpdatedTimestamp as xa}from"@excalidraw/common";I();import{clamp as zi,pointDistance as da,pointFrom as Z,pointScaleFromOrigin as eh,pointsEqual as zo,pointTranslate as la,vector as Gt,vectorCross as Wi,vectorFromPoint as ca,vectorScale as th}from"@excalidraw/math";import{BinaryHeap as nh,invariant as oo,isAnyTrue as oh,getSizeFromPoints as $l,isDevEnv as ih,arrayToMap as rh}from"@excalidraw/common";var ua=1,ae=40,ah=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let o=[];e.points.map(a=>Z(e.x+a[0],e.y+a[1])).forEach((a,s,l)=>{if(s<2)return o.push(a);let d=$e(a,l[s-1]),c=$e(l[s-1],l[s-2]);if(we(d,c)){let u=n?.findIndex(m=>m.index===s-1)??-1,h=n?.findIndex(m=>m.index===s)??-1;h!==-1&&(n[h].start=Z(l[s-2][0]-e.x,l[s-2][1]-e.y)),u!==-1&&n.splice(u,1),o.splice(-1,1),n.forEach(m=>{m.index>s-1&&(m.index-=1)})}return o.push(a)});let i=[];o.forEach((a,s,l)=>{if(s<3)return i.push(a);if(da(l[s-2],l[s-1])<ua){let d=n?.findIndex(h=>h.index===s-2)??-1,c=n?.findIndex(h=>h.index===s-1)??-1;c!==-1&&n.splice(c,1),d!==-1&&n.splice(d,1),i.splice(-2,2),n.forEach(h=>{h.index>s-2&&(h.index-=2)});let u=yt(a,l[s-1]);return i.push(Z(u?a[0]:l[s-2][0],u?l[s-2][1]:a[1]))}i.push(a)});let r=n.filter(a=>a.index!==1&&a.index!==i.length-1);return r.length===0?en(ma(fa(ha(e,pa(e,t,i.map(a=>Z(a[0]-e.x,a[1]-e.y))))??[])),r,null,null):(ih()&&oo(td(i),"Invalid elbow points with fixed segments"),en(i,r,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},sh=(e,t,n)=>{let o=t.map(T=>T.index),r=(e.fixedSegments?.map(T=>T.index)??[]).findIndex(T=>!o.includes(T));if(r===-1||!e.fixedSegments?.[r])return{points:e.points};let a=e.fixedSegments[r].index,s=e.fixedSegments[r-1],l=e.fixedSegments[r+1],d=e.x+(s?s.end[0]:0),c=e.y+(s?s.end[1]:0),u=s?null:e.startBinding,h=l?null:e.endBinding,{startHeading:m,endHeading:g,startGlobalPoint:f,endGlobalPoint:E,hoveredStartElement:x,hoveredEndElement:y,...w}=pa({x:d,y:c,startBinding:u,endBinding:h,startArrowhead:null,endArrowhead:null,points:e.points},n,[Z(0,0),Z(e.x+(l?.start[0]??e.points[e.points.length-1][0])-d,e.y+(l?.start[1]??e.points[e.points.length-1][1])-c)],{isDragging:!1}),{points:M}=en(ma(fa(ha(e,{startHeading:m,endHeading:g,startGlobalPoint:f,endGlobalPoint:E,hoveredStartElement:x,hoveredEndElement:y,...w})??[])),t,null,null);if(!M||M.length<2)throw new Error("Property 'points' is required in the update returned by normalizeArrowElementUpdate()");let b=[];if(s)for(let T=0;T<s.index;T++)b.push(Z(e.x+e.points[T][0],e.y+e.points[T][1]));if(M.forEach(T=>{b.push(Z(e.x+(s?s.end[0]:0)+T[0],e.y+(s?s.end[1]:0)+T[1]))}),l)for(let T=l.index;T<e.points.length;T++)b.push(Z(e.x+e.points[T][0],e.y+e.points[T][1]));let S=(l?.index??e.points.length)-(s?.index??0)-1,v=t.map(T=>T.index>a?{...T,index:T.index-S+(M.length-1)}:T),k=b.flatMap((T,R)=>{let O=b[R-1],N=b[R+1];if(O&&N){let G=$e(T,O),q=$e(N,T);if(we(G,q))return v.forEach(U=>{U.index>R&&(U.index-=1)}),[];if(we(G,aa(q)))return v.forEach(U=>{U.index>R&&(U.index+=1)}),[T,T]}return[T]});return en(k,v,!1,!1)},lh=(e,t,n,o,i,r)=>{let a=t.map((b,S)=>e.fixedSegments==null||e.fixedSegments[S]===void 0||e.fixedSegments[S].index!==b.index||(b.start[0]!==e.fixedSegments[S].start[0]&&b.end[0]!==e.fixedSegments[S].end[0])!=(b.start[1]!==e.fixedSegments[S].start[1]&&b.end[1]!==e.fixedSegments[S].end[1])?S:null).filter(b=>b!==null).shift();if(a==null)return{points:e.points};let s=e.fixedSegments?.findIndex(b=>b.index===1)??-1,l=e.fixedSegments?.findIndex(b=>b.index===e.points.length-1)??-1,d=da(t[a].start,t[a].end),c=d<ae+5;if(s===-1&&t[a].index===1&&i){let b=qe(n),v=(b?we(n,be):we(n,ke))?c?d/2:ae:c?-d/2:-ae;t[a].start=Z(t[a].start[0]+(b?v:0),t[a].start[1]+(b?0:v))}if(l===-1&&t[a].index===e.points.length-1&&r){let b=qe(o),v=(b?we(o,be):we(o,ke))?c?d/2:ae:c?-d/2:-ae;t[a].end=Z(t[a].end[0]+(b?v:0),t[a].end[1]+(b?0:v))}let u=t.map(b=>({...b,start:Z(e.x+b.start[0],e.y+b.start[1]),end:Z(e.x+b.end[0],e.y+b.end[1])})),h=e.points.map((b,S)=>Z(e.x+b[0],e.y+b[1])),m=u[a].index-1,g=u[a].index,f=u[a].start,E=u[a].end,x=h[m-1]&&!zo(h[m],h[m-1])?yt(h[m-1],h[m]):void 0,y=h[g+1]&&!zo(h[g],h[g+1])?yt(h[g+1],h[g]):void 0;if(x!==void 0){let b=x?1:0;h[m-1][b]=f[b]}if(h[m]=f,h[g]=E,y!==void 0){let b=y?1:0;h[g+1][b]=E[b]}let w=u.findIndex(b=>b.index===m);if(w!==-1){let b=yt(u[w].end,u[w].start)?1:0;u[w].start[b]=f[b],u[w].end=f}let M=u.findIndex(b=>b.index===g+1);if(M!==-1){let b=yt(u[M].end,u[M].start)?1:0;u[M].end[b]=E[b],u[M].start=E}if(s===-1&&m===0){let b=i?qe(n):yt(h[1],h[0]);h.unshift(Z(b?f[0]:e.x+e.points[0][0],b?e.y+e.points[0][1]:f[1])),i&&h.unshift(Z(e.x+e.points[0][0],e.y+e.points[0][1]));for(let S of u)S.index+=i?2:1}if(l===-1&&g===e.points.length-1){let b=qe(o);h.push(Z(b?E[0]:e.x+e.points[e.points.length-1][0],b?e.y+e.points[e.points.length-1][1]:E[1])),r&&h.push(Z(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return en(h,u.map(b=>({...b,start:Z(b.start[0]-e.x,b.start[1]-e.y),end:Z(b.end[0]-e.x,b.end[1]-e.y)})),!1,!1)},dh=(e,t,n,o,i,r,a,s,l)=>{let d=e.startIsSpecial??null,c=e.endIsSpecial??null,u=t.map((E,x)=>x===0?Z(e.x+E[0],e.y+E[1]):x===t.length-1?Z(e.x+E[0],e.y+E[1]):Z(e.x+e.points[x][0],e.y+e.points[x][1])),h=n.map(E=>({...E,start:Z(e.x+(E.start[0]-t[0][0]),e.y+(E.start[1]-t[0][1])),end:Z(e.x+(E.end[0]-t[0][0]),e.y+(E.end[1]-t[0][1]))})),m=[],g=2+(d?1:0),f=2+(c?1:0);for(;m.length+g<u.length-f;)m.push(u[m.length+g]);{let E=u.at(d?2:1),x=u.at(d?3:2);if(!E||!x)throw new Error(`Second and third points must exist when handling endpoint drag (${d})`);let y=qe(o),w=qe(Jt(ca(E,x)));if(s&&y===w){let M=y?we(o,be):we(o,ke);if(m.unshift(Z(w?r[0]+(M?ae:-ae):x[0],w?x[1]:r[1]+(M?ae:-ae))),m.unshift(Z(y?r[0]+(M?ae:-ae):r[0],y?r[1]:r[1]+(M?ae:-ae))),!d){d=!0;for(let b of h)b.index>1&&(b.index+=1)}}else if(m.unshift(Z(w?r[0]:E[0],w?E[1]:r[1])),d){d=!1;for(let M of h)M.index>1&&(M.index-=1)}m.unshift(r)}{let E=u.at(u.length-(c?3:2)),x=u.at(u.length-(c?4:3));if(!E||!x)throw new Error(`Second and third to last points must exist when handling endpoint drag (${c})`);let y=qe(i),w=yt(x,E);if(l&&y===w){let M=y?we(i,be):we(i,ke);m.push(Z(w?a[0]+(M?ae:-ae):x[0],w?x[1]:a[1]+(M?ae:-ae))),m.push(Z(y?a[0]+(M?ae:-ae):a[0],y?a[1]:a[1]+(M?ae:-ae))),c||(c=!0)}else m.push(Z(w?a[0]:E[0],w?E[1]:a[1])),c&&(c=!1)}return m.push(a),en(m,h.map(({index:E})=>({index:E,start:m[E-1],end:m[E]})).map(E=>({...E,start:Z(E.start[0]-r[0],E.start[1]-r[1]),end:Z(E.end[0]-r[0],E.end[1]-r[1])})),d,c)},yn=1e6,io=(e,t,n,o)=>{if(e.points.length<2)return{points:n.points??e.points};C.PROD||(oo(!n.points||n.points.length>=2,"Updated point array length must match the arrow point length, contain exactly the new start and end points or not be specified at all (i.e. you can't add new points between start and end manually to elbow arrows)"),oo(!e.fixedSegments||e.fixedSegments.map(b=>b.start[0]===b.end[0]||b.start[1]===b.end[1]).every(Boolean),"Fixed segments must be either horizontal or vertical"),oo(!n.fixedSegments||n.fixedSegments.map(b=>b.start[0]===b.end[0]||b.start[1]===b.end[1]).every(Boolean),"Updates to fixed segments must be either horizontal or vertical"),oo(e.points.slice(1).map((b,S)=>b[0]===e.points[S][0]||b[1]===e.points[S][1]),"Elbow arrow segments must be either horizontal or vertical"),oo(n.fixedSegments?.find(b=>b.index===1&&zo(b.start,(n.points??e.points)[0]))==null&&n.fixedSegments?.find(b=>b.index===(n.points??e.points).length-1&&zo(b.end,(n.points??e.points)[(n.points??e.points).length-1]))==null,"The first and last segments cannot be fixed"));let i=n.fixedSegments??e.fixedSegments??[],r=n.points?n.points&&n.points.length===2?e.points.map((b,S)=>S===0?n.points[0]:S===e.points.length-1?n.points[1]:b):n.points.slice():e.points.slice(),{startBinding:a,endBinding:s,...l}=n,d=typeof a<"u"?a:e.startBinding,c=typeof s<"u"?s:e.endBinding,u=d&&ji(d.elementId,t),h=c&&ji(c.elementId,t),m=td(r);if(d&&!u&&m||c&&!h&&m||t.size===0&&m||Object.keys(l).length===0&&(u?.id!==d?.elementId||h?.id!==c?.elementId))return en(r.map(b=>Z(e.x+b[0],e.y+b[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:g,endHeading:f,startGlobalPoint:E,endGlobalPoint:x,hoveredStartElement:y,hoveredEndElement:w,...M}=pa({x:e.x,y:e.y,startBinding:d,endBinding:c,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,r,o);return t.size===0&&m?en(r.map(b=>Z(e.x+b[0],e.y+b[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial):!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?ah(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((b,S)=>zo(b,e.points[S]??Z(1/0,1/0)))&&m?{}:i.length===0?en(ma(fa(ha(e,{startHeading:g,endHeading:f,startGlobalPoint:E,endGlobalPoint:x,hoveredStartElement:y,hoveredEndElement:w,...M})??[])),i,null,null):(e.fixedSegments?.length??0)>i.length?sh(e,i,t):n.points?n.points&&n.fixedSegments?n:dh(e,r,i,g,f,E,x,y,w):lh(e,i,g,f,y,w)},pa=(e,t,n,o)=>{let i=la(n[0],Gt(e.x,e.y)),r=la(n[n.length-1],Gt(e.x,e.y)),a=null,s=null;if(o?.isDragging&&o?.isBindingEnabled!==!1){let b=Array.from(t.values());a=Ql(i,t,b,o?.zoom)||null,s=Ql(r,t,b,o?.zoom)||null}else a=e.startBinding&&ji(e.startBinding.elementId,t)||null,s=e.endBinding&&ji(e.endBinding.elementId,t)||null;let l=ql({...e,angle:0,type:"arrow",elbowed:!0,points:n},"start",e.startBinding?.fixedPoint,i,a,t,o?.isDragging,o?.isBindingEnabled,o?.isMidpointSnappingEnabled),d=ql({...e,angle:0,type:"arrow",elbowed:!0,points:n},"end",e.endBinding?.fixedPoint,r,s,t,o?.isDragging,o?.isBindingEnabled,o?.isMidpointSnappingEnabled),c=Kl(l,d,a,i,t,o?.zoom),u=Kl(d,l,s,r,t,o?.zoom),h=[l[0]-2,l[1]-2,l[0]+2,l[1]+2],m=[d[0]-2,d[1]-2,d[0]+2,d[1]+2],g=a?ut(a,t,wn(c,e.startArrowhead?Ne(a,{elbowed:!0})*6:Ne(a,{elbowed:!0})*2,1)):h,f=s?ut(s,t,wn(u,e.endArrowhead?Ne(s,{elbowed:!0})*6:Ne(s,{elbowed:!0})*2,1)):m,E=Dt(l,s?ut(s,t,wn(u,ae,ae)):m)||Dt(d,a?ut(a,t,wn(c,ae,ae)):h),x=ed(E?[h,m]:[g,f]),y=ph(E?h:g,E?m:f,x,E?wn(c,!a&&!s?0:ae,0):wn(c,!a&&!s?0:ae-(e.startArrowhead?Vn*6:Vn*2),ae),E?wn(u,!a&&!s?0:ae,0):wn(u,!a&&!s?0:ae-(e.endArrowhead?Vn*6:Vn*2),ae),E,a&&ut(a,t),s&&ut(s,t)),w=Zl(y[0],c,l),M=Zl(y[1],u,d);return{dynamicAABBs:y,startDonglePosition:w,startGlobalPoint:l,startHeading:c,endDonglePosition:M,endGlobalPoint:d,endHeading:u,commonBounds:x,hoveredStartElement:a,hoveredEndElement:s,boundsOverlap:E,startElementBounds:g,endElementBounds:f}},ha=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:o,startGlobalPoint:i,startHeading:r,endDonglePosition:a,endGlobalPoint:s,endHeading:l,commonBounds:d,hoveredEndElement:c}=t,u=hh(n,o||i,r,a||s,l,d),h=o&&_i(o,u),m=a&&_i(a,u),g=_i(s,u);g&&c&&(g.closed=!0);let f=_i(i,u);f&&e.startBinding&&(f.closed=!0);let E=h&&m&&(Dt(h.pos,n[1])||Dt(m.pos,n[0])),x=ch(h||f,m||g,u,r||be,l||be,E?[]:n);if(x){let y=x.map(w=>[w.pos[0],w.pos[1]]);return h&&y.unshift(i),m&&y.push(s),y}return null},wn=(e,t,n)=>{switch(e){case rt:return[t,n,n,n];case be:return[n,t,n,n];case ke:return[n,n,t,n]}return[n,n,n,t]},ch=(e,t,n,o,i,r)=>{let a=sa(e.pos,t.pos),s=new nh(l=>l.f);for(s.push(e);s.size()>0;){let l=s.pop();if(!l||l.closed)continue;if(l===t)return uh(e,l);l.closed=!0;let d=fh(l.addr,n);for(let c=0;c<4;c++){let u=d[c];if(!u||u.closed)continue;let h=eh(u.pos,l.pos,.5);if(oh(...r.map(M=>Dt(h,M))))continue;let m=gh(c),g=l.parent?Jt(ca(l.pos,l.parent.pos)):o,f=aa(g);if(we(f,m)||Jl(e.addr,u.addr)&&we(m,o)||Jl(t.addr,u.addr)&&we(m,i))continue;let x=g!==m,y=l.g+sa(u.pos,l.pos)+(x?Math.pow(a,3):0),w=u.visited;if(!w||y<u.g){let M=mh(u,t,m,i);u.visited=!0,u.parent=l,u.h=sa(t.pos,u.pos)+M*Math.pow(a,2),u.g=y,u.f=u.g+u.h,w?s.rescoreElement(u):s.push(u)}}}return null},uh=(e,t)=>{let n=t,o=[];for(;n.parent;)o.unshift(n),n=n.parent;return o.unshift(e),o},sa=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),ph=(e,t,n,o,i,r,a,s)=>{let l=a??e,d=s??t,[c,u,h,m]=o??[0,0,0,0],[g,f,E,x]=i??[0,0,0,0],y=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((l[0]+d[2])/2,e[0]-m):(l[0]+d[2])/2:e[0]>t[0]?e[0]-m:n[0]-m,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((l[1]+d[3])/2,e[1]-c):(l[1]+d[3])/2:e[1]>t[1]?e[1]-c:n[1]-c,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((l[2]+d[0])/2,e[2]+u):(l[2]+d[0])/2:e[2]<t[2]?e[2]+u:n[2]+u,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((l[3]+d[1])/2,e[3]+h):(l[3]+d[1])/2:e[3]<t[3]?e[3]+h:n[3]+h],w=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((d[0]+l[2])/2,t[0]-x):(d[0]+l[2])/2:t[0]>e[0]?t[0]-x:n[0]-x,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((d[1]+l[3])/2,t[1]-g):(d[1]+l[3])/2:t[1]>e[1]?t[1]-g:n[1]-g,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((d[2]+l[0])/2,t[2]+f):(d[2]+l[0])/2:t[2]<e[2]?t[2]+f:n[2]+f,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((d[3]+l[1])/2,t[3]+E):(d[3]+l[1])/2:t[3]<e[3]?t[3]+E:n[3]+E],M=ed([y,w]);if(!r&&y[2]-y[0]+w[2]-w[0]>M[2]-M[0]+1e-11&&y[3]-y[1]+w[3]-w[1]>M[3]-M[1]+1e-11){let[b,S]=[(w[0]+w[2])/2,(w[1]+w[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let v=y[2]+(w[0]-y[2])/2,k=w[3]+(y[1]-w[3])/2;return Wi(Gt(e[2]-b,e[1]-S),Gt(e[0]-b,e[3]-S))>0?[[y[0],y[1],v,y[3]],[v,w[1],w[2],w[3]]]:[[y[0],k,y[2],y[3]],[w[0],w[1],w[2],k]]}else if(e[2]<t[0]&&e[3]<t[1]){let v=y[2]+(w[0]-y[2])/2,k=y[3]+(w[1]-y[3])/2;return Wi(Gt(e[0]-b,e[1]-S),Gt(e[2]-b,e[3]-S))>0?[[y[0],y[1],y[2],k],[w[0],k,w[2],w[3]]]:[[y[0],y[1],v,y[3]],[v,w[1],w[2],w[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let v=w[2]+(y[0]-w[2])/2,k=y[3]+(w[1]-y[3])/2;return Wi(Gt(e[2]-b,e[1]-S),Gt(e[0]-b,e[3]-S))>0?[[v,y[1],y[2],y[3]],[w[0],w[1],v,w[3]]]:[[y[0],y[1],y[2],k],[w[0],k,w[2],w[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let v=w[2]+(y[0]-w[2])/2,k=w[3]+(y[1]-w[3])/2;return Wi(Gt(e[0]-b,e[1]-S),Gt(e[2]-b,e[3]-S))>0?[[v,y[1],y[2],y[3]],[w[0],w[1],v,w[3]]]:[[y[0],k,y[2],y[3]],[w[0],w[1],w[2],k]]}}return[y,w]},hh=(e,t,n,o,i,r)=>{let a=new Set,s=new Set;n===Ze||n===be?s.add(t[1]):a.add(t[0]),i===Ze||i===be?s.add(o[1]):a.add(o[0]),e.forEach(c=>{a.add(c[0]),a.add(c[2]),s.add(c[1]),s.add(c[3])}),a.add(r[0]),a.add(r[2]),s.add(r[1]),s.add(r[3]);let l=Array.from(s).sort((c,u)=>c-u),d=Array.from(a).sort((c,u)=>c-u);return{row:l.length,col:d.length,data:l.flatMap((c,u)=>d.map((h,m)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[m,u],pos:[h,c]})))}},Zl=(e,t,n)=>{switch(t){case rt:return Z(n[0],e[1]);case be:return Z(e[2],n[1]);case ke:return Z(n[0],e[3])}return Z(e[0],n[1])},mh=(e,t,n,o)=>{if(o===be)switch(n){case be:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case rt:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ke:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case Ze:return e.pos[1]===t.pos[1]?4:2}else if(o===Ze)switch(n){case be:return e.pos[1]===t.pos[1]?4:2;case rt:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case ke:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case Ze:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(o===rt)switch(n){case be:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case rt:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case ke:return e.pos[0]===t.pos[0]?4:2;case Ze:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(o===ke)switch(n){case be:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case rt:return e.pos[0]===t.pos[0]?4:2;case ke:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case Ze:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},fh=([e,t],n)=>[Ho([e,t-1],n),Ho([e+1,t],n),Ho([e,t+1],n),Ho([e-1,t],n)],Ho=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,_i=(e,t)=>{for(let n=0;n<t.col;n++)for(let o=0;o<t.row;o++){let i=Ho([n,o],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},ed=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],ji=(e,t)=>{let n=t.get(e);return n&&Ee(n)?n:null},en=(e,t,n,o)=>{let i=e[0][0],r=e[0][1],a=e.map(s=>la(s,th(ca(e[0]),-1)));return(i<-yn||i>yn||r<-yn||r>yn||i+a[a.length-1][0]<-yn||i+a[a.length-1][0]>yn||r+a[a.length-1][1]<-yn||r+a[a.length-1][1]>yn)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:r,points:a,...$l(a)}),a=a.map(([s,l])=>Z(zi(s,-1e6,1e6),zi(l,-1e6,1e6))),{points:a,x:zi(i,-1e6,1e6),y:zi(r,-1e6,1e6),fixedSegments:(t?.length??0)>0?t:null,...$l(a),startIsSpecial:n,endIsSpecial:o}},ma=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,o)=>{if(o===0||o===e.length-1)return!0;let i=e[o+1],r=Math.abs(n[1]-i[1])<Math.abs(n[0]-i[0]);return t===r?(t=r,!1):(t=r,!0)})}return e},fa=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let o=e[n-1];return da(o,t)>ua}):e,gh=e=>{switch(e){case 0:return rt;case 1:return be;case 2:return ke}return Ze},ql=(e,t,n,o,i,r,a,s=!0,l=!0)=>a?s&&i&&r?ga(e,i,t,r,void 0,l):o:i?Ue(n||[0,0],i,r??rh([i])):o,Kl=(e,t,n,o,i,r)=>nd(e,t,n,n&&ut(n,i,Array(4).fill(gn(n,i,e))),o,i,r),Ql=(e,t,n,o)=>Kt(e,n,t,Et(o)),Jl=(e,t)=>e[0]===t[0]&&e[1]===t[1],td=(e,t=ua)=>e.slice(1).map((n,o)=>Math.abs(n[0]-e[o][0])<t||Math.abs(n[1]-e[o][1])<t).every(Boolean);var Te=(e,t,n,o)=>{let i=!1,{points:r,fixedSegments:a,fileId:s}=n;Y(e)&&(Object.keys(n).length===0||typeof r<"u"||typeof a<"u")?n={...n,angle:0,...io({...e,x:n.x||e.x,y:n.y||e.y},t,n,o)}:typeof r<"u"&&(n={...Eh(r),...n});for(let l in n){let d=n[l];if(typeof d<"u"){if(e[l]===d&&(typeof d!="object"||d===null||l==="groupIds"||l==="scale"))continue;if(l==="scale"){let c=e[l],u=d;if(c[0]===u[0]&&c[1]===u[1])continue}else if(l==="points"){let c=e[l],u=d;if(c.length===u.length){let h=!1,m=c.length;for(;--m;){let g=c[m],f=u[m];if(g[0]!==f[0]||g[1]!==f[1]){h=!0;break}}if(!h)continue}}e[l]=d,i=!0}}return i&&((typeof n.height<"u"||typeof n.width<"u"||typeof s<"u"||typeof r<"u")&&at.delete(e),e.version=n.version??e.version+1,e.versionNonce=n.versionNonce??Ea(),e.updated=xa()),e},He=(e,t,n=!1)=>{let o=!1;for(let i in t){let r=t[i];if(typeof r<"u"){if(e[i]===r&&(typeof r!="object"||r===null))continue;o=!0}}return!o&&!n?e:{...e,...t,version:t.version??e.version+1,versionNonce:t.versionNonce??Ea(),updated:xa()}},od=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=Ea(),e.updated=xa(),e);var dd=5,Vn=5,bh=10,Vo=10/1.5,Ne=(e,t)=>(t.elbowed?Vn:dd)+e.strokeWidth/2,Et=e=>{let t=Math.max(dd,15),n=e?.value&&e.value<1?e.value:1;return wa(t/(n*1.5),t,t*2)},Ot=e=>e.isBindingEnabled,Mh=(e,t,n,o,i,r,a)=>{let{start:s,end:l}=ba(e,t,n,o,i.getNonDeletedElementsMap(),i.getNonDeletedElements(),r,{...a,finalize:!0});if(id(e,s,"start",i,r.isBindingEnabled),id(e,l,"end",i,r.isBindingEnabled),s.focusPoint||l.focusPoint){let d=new Map;s.focusPoint&&d.set(0,{point:bt(e,"startBinding",e.startBinding,s.element,i.getNonDeletedElementsMap())||e.points[0]}),l.focusPoint&&d.set(e.points.length-1,{point:bt(e,"endBinding",e.endBinding,l.element,i.getNonDeletedElementsMap())||e.points[e.points.length-1]}),D.movePoints(e,i,d)}return{start:s,end:l}},id=(e,{mode:t,element:n,focusPoint:o},i,r,a=!0)=>{t===null?Oe(e,i,r):t!==void 0&&Rt(e,n,t,i,r,o,a)},cd=(e,t,n,o,i)=>{wt(t.size===1,"Bound elbow arrows cannot be moved");let r=t.entries().next().value;wt(r,"There should be a position update for dragging an elbow arrow endpoint");let[a,{point:s}]=r,l=D.getPointGlobalCoordinates(e,s,n),d=Kt(l,o,n,Et(i)),c=d?{element:d,mode:"orbit",focusPoint:D.getPointAtIndexGlobalCoordinates(e,a,n)}:{mode:null},u={mode:void 0};return a===0?{start:c,end:u}:{start:u,end:c}},Ph=(e,t,n,o,i,r,a,s,l,d,c)=>{let u={mode:void 0},h={mode:void 0},m=e.points.length>2,g=D.getPointGlobalCoordinates(e,t.get(i?a:s).point,n),f=Kt(g,o,n);if(i)return f?u={element:f,mode:"inside",focusPoint:g}:u={mode:null},{start:u,end:h};if(r){let E=l?.selectedLinearElement?.initialState.origin;if(f&&e.startBinding?.elementId===f.id){let x=se(f.x+f.width/2,f.y+f.height/2);return{start:m?{mode:void 0}:{mode:"inside",element:f,focusPoint:E??x},end:m?{mode:"orbit",element:f,focusPoint:g}:{mode:"inside",element:f,focusPoint:g}}}if(f&&e.startBinding){let x=e.startBinding;if(Gi(g,o,n).find(w=>w.id===x.elementId)){let w=n.get(e.startBinding.elementId);return wt(w,"Other element must be in the elements map"),{start:m?{mode:void 0}:{mode:w.id!==f.id?"orbit":"inside",element:w,focusPoint:E??se(e.x,e.y)},end:{mode:"orbit",element:f,focusPoint:g}}}}if(e.startBinding&&e.startBinding.elementId!==f?.id){let x=n.get(e.startBinding.elementId);wt(x,"Other element must be in the elements map");let w={mode:!!l.selectedLinearElement?.initialState.arrowStartIsInside?"inside":"orbit",element:x,focusPoint:c?de(x,n):E??se(e.x,e.y)},M=f&&ia(x,f,n),b;if(f){let S=d==="inside"||d==="skip";b={mode:S&&!M?"inside":"orbit",element:f,focusPoint:g}}else b={mode:null};return{start:m?{mode:void 0}:w,end:b}}if(!e.startBinding)return f?h={mode:d==="inside"||d==="skip"?"inside":"orbit",element:f,focusPoint:g}:h={mode:null},{start:u,end:h}}wt(!1,"New arrow creation should not reach here")},rd=(e,t,n,o,i,r,a,s)=>{let l={mode:void 0},d={mode:void 0},c=a.points.length>2,u=Kt(e,i,o),h=n?Gi(e,i,o).some(E=>E.id===n.elementId):!1,m=n?o.get(n.elementId):null,g=h&&m?yh(m.backgroundColor):!1,f=u&&m&&ia(m,u,o);return r==="inside"||r==="skip"?(l=u?{element:!h||!m||g?u:m,focusPoint:e,mode:"inside"}:{mode:null},d=s&&u&&u.id===n?.elementId?{mode:null}:d,{current:l,other:d}):u?u.id===t?.elementId&&t.mode==="inside"?{current:{mode:"inside",focusPoint:e,element:u},other:d}:n?n.elementId===u.id?n.mode==="orbit"?(l={element:u,mode:"orbit",focusPoint:e},d={mode:s?null:void 0},{current:l,other:c?{mode:void 0}:d}):(l={element:u,mode:"inside",focusPoint:e},{current:l,other:c?{mode:void 0}:d}):(h&&m&&!g?l={element:m,mode:"inside",focusPoint:e}:l={element:u,mode:"orbit",focusPoint:e},{current:l,other:c?{mode:void 0}:d}):(l={element:u,mode:"orbit",focusPoint:e},{current:l,other:c?{mode:void 0}:d}):{current:{mode:null},other:d}},ba=(e,t,n,o,i,r,a,s)=>xh("COMPLEX_BINDINGS")?Ih(e,t,i,r,a,s):ud(e,t,n,o,i,r,a,s),ud=(e,t,n,o,i,r,a,s)=>{let d=e.points.length-1,c=t.has(0),u=t.has(d),h={mode:void 0},m={mode:void 0};if(wt(e.points.length>1,"Do not attempt to bind linear elements with a single point"),!c&&!u)return{start:h,end:m};if(c&&u)return{start:{mode:null},end:{mode:null}};if(!Ot(a))return h=c?{mode:null}:h,m=u?{mode:null}:m,{start:h,end:m};if(Y(e))return cd(e,t,i,r,s?.zoom);let g=c?e.endBinding:e.startBinding,f=t.get(c?0:d)?.point;wt(f,`Local point must be defined for ${c?"start":"end"} dragging`);let E=D.getPointGlobalCoordinates(e,f,i),x=Kt(E,r,i,Et(a.zoom)),y=x&&(s?.angleLocked?Xt(se(n,o),x,i):Xt(E,x,i)),w=g?i.get(g.elementId):void 0,M=g&&w&&Ue(g.fixedPoint,w,i),b=w&&M&&Lt({point:M,element:w,elementsMap:i,threshold:0,overrideShouldTestInside:!0});if(g&&g.elementId===x?.id&&(!s?.newArrow||a.selectedLinearElement?.initialState.origin))return{start:{mode:"inside",element:x,focusPoint:c?E:s?.newArrow?a.selectedLinearElement.initialState.origin:D.getPointAtIndexGlobalCoordinates(e,0,i)},end:{mode:"inside",element:x,focusPoint:u?E:D.getPointAtIndexGlobalCoordinates(e,-1,i)}};if(s?.altKey)return{start:c?x?{mode:"inside",element:x,focusPoint:E}:{mode:null}:h,end:u?x?{mode:"inside",element:x,focusPoint:E}:{mode:null}:m};let S=x?y?{mode:"inside",element:x,focusPoint:E}:{mode:"orbit",element:x,focusPoint:eo(e,E,x,c?"start":"end",i,a.zoom,a.isMidpointSnappingEnabled)||E}:{mode:null},v=D.getPointAtIndexGlobalCoordinates(e,c?-1:0,i),k=M&&w&&Lt({point:E,element:w,elementsMap:i,threshold:Et(a.zoom),overrideShouldTestInside:!0}),R=(s?.newArrow?a.selectedLinearElement?.initialState.arrowStartIsInside:g?.mode==="inside")?{mode:void 0}:w&&!b&&!k&&a.selectedLinearElement?.initialState.altFocusPoint?{mode:"orbit",element:w,focusPoint:a.selectedLinearElement.initialState.altFocusPoint}:s?.angleLocked&&w?{mode:"orbit",element:w,focusPoint:eo(e,v,w,c?"end":"start",i,a.zoom,a.isMidpointSnappingEnabled)||v}:{mode:void 0};return{start:c?S:R,end:u?S:R}},Ih=(e,t,n,o,i,r)=>{let a=i.bindMode||"orbit",s=0,l=e.points.length-1,d=t.has(s),c=t.has(l),u={mode:void 0},h={mode:void 0};if(wt(e.points.length>1,"Do not attempt to bind linear elements with a single point"),!d&&!c)return{start:u,end:h};if(d&&c)return{start:{mode:null},end:{mode:null}};if(!Ot(i))return u=d?{mode:null}:u,h=c?{mode:null}:h,{start:u,end:h};if(Y(e))return cd(e,t,n,o);if(r?.newArrow){let{start:m,end:g}=Ph(e,t,n,o,d,c,s,l,i,a,r?.shiftKey);return{start:m,end:g}}if(d){let m=t.get(s)?.point;wt(m,"Local point must be defined for start dragging");let g=D.getPointGlobalCoordinates(e,m,n),{current:f,other:E}=rd(g,e.startBinding,e.endBinding,n,o,a,e,r?.finalize);return{start:f,end:E}}if(c){let m=t.get(l)?.point;wt(m,"Local point must be defined for end dragging");let g=D.getPointGlobalCoordinates(e,m,n),{current:f,other:E}=rd(g,e.endBinding,e.startBinding,n,o,a,e,r?.finalize);return{start:E,end:f}}return{start:u,end:h}},Jy=(e,t,n)=>{e.forEach(o=>{Mh(o,new Map,1/0,1/0,t,n)})},Rt=(e,t,n,o,i,r,a=!0)=>{let s=i.getNonDeletedElementsMap(),l;Y(e)?l={elementId:t.id,mode:"orbit",...Lh(e,t,o,s,a)}:l={elementId:t.id,mode:n,...ro(e,t,o,s,r)},i.mutateElement(e,{[o==="start"?"startBinding":"endBinding"]:l}),ld(t.boundElements||[]).has(e.id)||i.mutateElement(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Oe=(e,t,n)=>{let o=t==="start"?"startBinding":"endBinding",i=e[o];if(i==null)return null;let r=e[t==="start"?"endBinding":"startBinding"];if(!r||r.elementId!==i.elementId){let a=n.getNonDeletedElementsMap().get(i.elementId);n.mutateElement(a,{boundElements:a.boundElements?.filter(s=>s.id!==e.id)})}return n.mutateElement(e,{[o]:null}),i.elementId},Re=(e,t,n)=>{if(!Ee(e))return;let{simultaneouslyUpdated:o}=n??{},i=vh(o),r=t.getNonDeletedElementsMap();n?.changedElements&&(r=new Map(r),n.changedElements.forEach(s=>{r.set(s.id,s)})),Xi(r,e,s=>{if(!j(s)||s.isDeleted||!Sh(s,e))return;let l=s.startBinding?r.get(s.startBinding.elementId):null,d=s.endBinding?l?.id===s.endBinding.elementId?l:r.get(s.endBinding.elementId):null;if(i.has(s.id))return;let c=$i(r,s,(h,m)=>{if(h&&Ee(h)&&(m==="startBinding"||m==="endBinding")&&(e.id===s[m]?.elementId||e.id===s[m==="startBinding"?"endBinding":"startBinding"]?.elementId)){let g=bt(s,m,s[m],h,r);if(g)return[m==="startBinding"?0:s.points.length-1,{point:g}]}return null}).filter(h=>h!==null);D.movePoints(s,t,new Map(c),{moveMidPointsWithElement:!!l&&l?.id===d?.id});let u=Q(s,r);u&&!u.isDeleted&&jn(s,t,!1)})},ad=(e,t,n,o,i)=>{wt(!Y(e),"Elbow arrows not supported for indirect updates");let r=e[t],a=r&&n.get(r.elementId),s=D.getPointAtIndexGlobalCoordinates(e,t==="startBinding"?0:-1,n),l=a&&Lt({element:a,point:s,elementsMap:n,threshold:Et(i.zoom)}),d=t==="startBinding"?"start":"end";if(Oe(e,d,o),l){let c=t==="startBinding"?0:e.points.length-1,u=e.points[c],h=ud(e,new Map([[c,{point:u}]]),s[0],s[1],n,o.getNonDeletedElements(),i);h[d]&&h[d].element?.id===a.id&&h[d].mode&&Rt(e,a,h[d].mode,d,o,h[d].focusPoint)}},e3=(e,t,n,o)=>{if(j(e)){let i=t.getNonDeletedElementsMap();e.startBinding&&ad(e,"startBinding",i,t,n),e.endBinding&&ad(e,"endBinding",i,t,n)}else Re(e,t,{...o,changedElements:new Map([[e.id,e]])})},Sh=(e,t)=>e.startBinding?.elementId===t.id||e.endBinding?.elementId===t.id,vh=e=>new Set((e||[]).map(t=>t.id)),nd=(e,t,n,o,i,r,a)=>{let s=Jt(Wo(t,e));return!n||!o?s:Ah(i,n,r,a)?No(n,o,e):Jt(Wo(e,de(n,r)))},Ah=(e,t,n,o)=>{let i=gn(t,n,e),r=Et(o);return i>r?null:i},ga=(e,t,n,o,i,r=!0)=>{let a=Y(e),s=D.getPointAtIndexGlobalCoordinates(e,n==="start"?0:-1,o);if(e.points.length<2)return s;let l=cl(t)&&a?kh(e,t,o,s):s,d=i&&!a?i[1]:D.getPointAtIndexGlobalCoordinates(e,n==="start"?1:-2,o),c=Ne(t,e),u=ut(t,o),h=En(u),m=null;if(a){let g=qe(No(t,u,s)),E=(r?Ma(t,o,l,.05,e):void 0)||s,x=se(g?h[0]:E[0],g?E[1]:h[1]),y=i??Ui(x,Vi(Yi(ya(Wo(E,x)),Math.max(t.width,t.height)*2),x));if(m=Bt(t,o,y,c).sort(tn)[0],!m){let w=se(g?E[0]:h[0],g?h[1]:E[1]),M=Ui(w,Vi(Yi(ya(Wo(E,w)),Math.max(t.width,t.height)*2),w));m=Bt(t,o,M,Vn).sort(tn)[0]}}else{let g=i;if(!g){let f=Yi(ya(Wo(l,d)),bn(l,d)+Math.max(t.width,t.height)+c*2);g=i??Ui(Vi(f,d),Vi(Yi(f,-1),d))}m=bn(l,d)<1?l:Bt(t,o,g,c).sort((f,E)=>tn(f,d)-tn(E,d))[0]}return!m||tn(l,m)<jo?l:m},kh=(e,t,n,o)=>{let i=de(t,n),r=pe(o,i,-t.angle),a=Ne(t,e);return r[0]<t.x&&r[1]<t.y?r[1]-t.y>-a?pe(se(t.x-a,t.y),i,t.angle):pe(se(t.x,t.y-a),i,t.angle):r[0]<t.x&&r[1]>t.y+t.height?r[0]-t.x>-a?pe(se(t.x,t.y+t.height+a),i,t.angle):pe(se(t.x-a,t.y+t.height),i,t.angle):r[0]>t.x+t.width&&r[1]>t.y+t.height?r[0]-t.x<t.width+a?pe(se(t.x+t.width,t.y+t.height+a),i,t.angle):pe(se(t.x+t.width+a,t.y+t.height),i,t.angle):r[0]>t.x+t.width&&r[1]<t.y?r[0]-t.x<t.width+a?pe(se(t.x+t.width,t.y-a),i,t.angle):pe(se(t.x+t.width+a,t.y),i,t.angle):o},Ma=(e,t,n,o=.05,i)=>{let{x:r,y:a,width:s,height:l,angle:d}=e,c=de(e,t,-.1,-.1),u=pe(n,c,-d),h=i?Ne(e,i):0,m=wa(o*l,5,80),g=wa(o*s,5,80);if(!(bn(c,u)<h)){if(u[0]<=r+s/2&&u[1]>c[1]-m&&u[1]<c[1]+m)return pe(se(r-h,c[1]),c,d);if(u[1]<=a+l/2&&u[0]>c[0]-g&&u[0]<c[0]+g)return pe(se(c[0],a-h),c,d);if(u[0]>=r+s/2&&u[1]>c[1]-m&&u[1]<c[1]+m)return pe(se(r+s+h,c[1]),c,d);if(u[1]>=a+l/2&&u[0]>c[0]-g&&u[0]<c[0]+g)return pe(se(c[0],a+l+h),c,d);if(e.type==="diamond"){let f=h,E=se(r+s/4-f,a+l/4-f),x=se(r+3*s/4+f,a+l/4-f),y=se(r+s/4-f,a+3*l/4+f),w=se(r+3*s/4+f,a+3*l/4+f);if(bn(E,u)<Math.max(g,m))return pe(E,c,d);if(bn(x,u)<Math.max(g,m))return pe(x,c,d);if(bn(y,u)<Math.max(g,m))return pe(y,c,d);if(bn(w,u)<Math.max(g,m))return pe(w,c,d)}}},Th=(e,t,n)=>{let o=e[t];if(!o)return{element:null,fixedPoint:null,focusPoint:null,binding:o,mode:null};let i=n.get(o.elementId);return{element:i,fixedPoint:o.fixedPoint,focusPoint:Ue(mn(o.fixedPoint),i,n),binding:o,mode:o.mode}},sd=e=>e.width*e.height,bt=(e,t,n,o,i,r)=>{if(n==null||n.elementId!==o.id&&e.points.length>2||wh(e.points[e.points.length-1],se(0,0)))return null;let a=Ue(mn(n.fixedPoint),o,i);if(n.mode==="inside")return D.createPointAt(e,i,a[0],a[1],null);let{element:s,focusPoint:l}=Th(e,t==="startBinding"?"endBinding":"startBinding",i),d=D.getPointAtIndexGlobalCoordinates(e,t==="startBinding"?1:-2,i),c=e.points.length===2&&l||d,u=c&&Ui(a,c),h=s&&u&&Bt(s,i,u,Ne(s,e)).sort((w,M)=>tn(w,a)-tn(M,a))[0],m=u&&Bt(o,i,u,Ne(o,e)).sort((w,M)=>tn(w,c)-tn(M,c))[0],g=e.startArrowhead!==null,f=e.endArrowhead!==null,E=!g&&!f||t==="startBinding"&&g||t==="endBinding"&&f?a:m||a;if(s&&m&&!r&&sd(s)<sd(o)*2&&Lt({element:s,point:m,elementsMap:i,threshold:Ne(s,e),overrideShouldTestInside:!0}))return D.createPointAt(e,i,E[0],E[1],null);let y=bn(s&&(h||l)||d,m||a)<=bh;return s?y?D.createPointAt(e,i,E?.[0]||a[0],E?.[1]||a[1],null):D.createPointAt(e,i,m?.[0]||a[0],m?.[1]||a[1],null):D.createPointAt(e,i,y?a[0]:m?.[0]??a[0],y?a[1]:m?.[1]??a[1],null)},Lh=(e,t,n,o,i=!0,r=!0)=>{let a=[t.x,t.y,t.x+t.width,t.y+t.height],s=i?ga(e,t,n,o,void 0,r):D.getPointAtIndexGlobalCoordinates(e,n==="start"?0:-1,o),l=se(a[0]+(a[2]-a[0])/2,a[1]+(a[3]-a[1])/2),d=pe(s,l,-t.angle);return{fixedPoint:mn([(d[0]-t.x)/Math.max(t.width,jo),(d[1]-t.y)/Math.max(t.height,jo)])}},ro=(e,t,n,o,i)=>{let r=i||D.getPointAtIndexGlobalCoordinates(e,n==="start"?0:-1,o),a=de(t,o),s=pe(r,a,-t.angle),l=(s[0]-t.x)/Math.max(t.width,jo),d=(s[1]-t.y)/Math.max(t.height,jo);return{fixedPoint:mn([l,d])}},pd=(e,t,n)=>{for(let o of e){if("boundElements"in o&&o.boundElements&&Object.assign(o,{boundElements:o.boundElements.reduce((i,r)=>{let a=t.get(r.id);return a&&i.push({...r,id:a}),i},[])}),"containerId"in o&&o.containerId&&Object.assign(o,{containerId:t.get(o.containerId)??null}),"endBinding"in o&&o.endBinding){let i=t.get(o.endBinding.elementId);Object.assign(o,{endBinding:i?{...o.endBinding,elementId:i}:null})}if("startBinding"in o&&o.startBinding){let i=t.get(o.startBinding.elementId);Object.assign(o,{startBinding:i?{...o.startBinding,elementId:i}:null})}Y(o)&&Object.assign(o,io(o,n,{points:[o.points[0],o.points[o.points.length-1]]}))}},t3=(e,t)=>{let n=ld(e);for(let o of t)Mn.unbindAffected(n,o,(i,r)=>Te(i,n,r)),Pn.unbindAffected(n,o,(i,r)=>Te(i,n,r))},_o=(e,t,n=[])=>{if(!e)return null;let o=e.filter(i=>!t.has(i.id));return o.push(...n.map(i=>({id:i.id,type:i.type}))),o},hd=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),Xi=(e,t,n)=>{Ee(t)&&(t.boundElements?.slice()??[]).forEach(({id:i})=>{n(e.get(i),"boundElements",i)})},$i=(e,t,n)=>{let o=[];if(t.frameId){let i=t.frameId;o.push(n(e.get(i),"frameId",i))}if(xe(t)){let i=t.containerId;o.push(n(e.get(i),"containerId",i))}if(j(t)){if(t.startBinding){let i=t.startBinding.elementId;o.push(n(e.get(i),"startBinding",i))}if(t.endBinding){let i=t.endBinding.elementId;o.push(n(e.get(i),"endBinding",i))}}return o},Mn=class{static unbindAffected(t,n,o){n&&$i(t,n,i=>{!i||i.isDeleted||Xi(t,i,(r,a,s)=>{s===n.id&&o(i,{boundElements:_o(i.boundElements,new Set([s]))})})})}static rebindAffected=(t,n,o)=>{!n||n.isDeleted||$i(t,n,(i,r)=>{if(!i||i.isDeleted){o(n,{[r]:null});return}r!=="frameId"&&(i.boundElements?.find(a=>a.id===n.id)||(j(n)&&o(i,{boundElements:_o(i.boundElements,new Set,new Array(n))}),te(n)&&(i.boundElements?.find(a=>a.type==="text")?o(n,{[r]:null}):o(i,{boundElements:_o(i.boundElements,new Set,new Array(n))}))))})}},Pn=class{static unbindAffected(t,n,o){n&&Xi(t,n,i=>{!i||i.isDeleted||$i(t,i,(r,a,s)=>{s===n.id&&o(i,{[a]:null})})})}static rebindAffected=(t,n,o)=>{!n||n.isDeleted||Xi(t,n,(i,r,a)=>{if(!i||i.isDeleted){o(n,{boundElements:_o(n.boundElements,new Set([a]))});return}te(i)&&((n.boundElements?.slice()??[]).reverse().find(l=>l.type==="text")?.id===i.id?i.containerId!==n.id&&o(i,{containerId:n.id}):(i.containerId!==null&&o(i,{containerId:null}),o(n,{boundElements:_o(n.boundElements,new Set([i.id]))})))})}},Ue=(e,t,n)=>{let[o,i]=mn(e);return pe(se(t.x+t.width*o,t.y+t.height*i),de(t,n),t.angle)},Ch=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),o=e.endBinding&&t.get(e.endBinding.elementId),i=n&&e.startBinding?Ue(e.startBinding.fixedPoint,n,t):se(e.x+e.points[0][0],e.y+e.points[0][1]),r=o&&e.endBinding?Ue(e.endBinding.fixedPoint,o,t):se(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[i,r]},md=(e,t)=>{let[n,o]=Ch(e,t);return[D.pointFromAbsoluteCoords(e,n,t),D.pointFromAbsoluteCoords(e,o,t)]},Bh=e=>Array.isArray(e)&&e.length===2&&e.every(t=>Number.isFinite(t)),mn=e=>{if(!Bh(e))return[.5001,.5001];let t=1e-4;return Math.abs(e[0]-.5)<t||Math.abs(e[1]-.5)<t?e.map(n=>Math.abs(n-.5)<t?.5001:n):e},Dh=e=>e.type==="ellipse"||e.type==="diamond"?e.type:"rectangle",Gh={rectangle:[{centerAngle:0,sectorWidth:75,side:"right"},{centerAngle:45,sectorWidth:15,side:"bottom-right"},{centerAngle:90,sectorWidth:75,side:"bottom"},{centerAngle:135,sectorWidth:15,side:"bottom-left"},{centerAngle:180,sectorWidth:75,side:"left"},{centerAngle:225,sectorWidth:15,side:"top-left"},{centerAngle:270,sectorWidth:75,side:"top"},{centerAngle:315,sectorWidth:15,side:"top-right"}],diamond:[{centerAngle:0,sectorWidth:15,side:"right"},{centerAngle:45,sectorWidth:75,side:"bottom-right"},{centerAngle:90,sectorWidth:15,side:"bottom"},{centerAngle:135,sectorWidth:75,side:"bottom-left"},{centerAngle:180,sectorWidth:15,side:"left"},{centerAngle:225,sectorWidth:75,side:"top-left"},{centerAngle:270,sectorWidth:15,side:"top"},{centerAngle:315,sectorWidth:75,side:"top-right"}],ellipse:[{centerAngle:0,sectorWidth:15,side:"right"},{centerAngle:45,sectorWidth:75,side:"bottom-right"},{centerAngle:90,sectorWidth:15,side:"bottom"},{centerAngle:135,sectorWidth:75,side:"bottom-left"},{centerAngle:180,sectorWidth:15,side:"left"},{centerAngle:225,sectorWidth:75,side:"top-left"},{centerAngle:270,sectorWidth:15,side:"top"},{centerAngle:315,sectorWidth:75,side:"top-right"}]},Oh=e=>e.map((t,n)=>{let o=t.sectorWidth/2,i=t.centerAngle-o,r=t.centerAngle+o;return i=(i%360+360)%360,r=(r%360+360)%360,{start:i,end:r,side:t.side}}),Rh=(e,t)=>{let[n,o]=e,i=n-.5,r=o-.5,a=Math.atan2(r,i);a<0&&(a+=2*Math.PI);let s=a*180/Math.PI,l=Gh[t],d=Oh(l);for(let h of d)if(h.start<=h.end){if(s>=h.start&&s<=h.end)return h.side}else if(s>=h.start||s<=h.end)return h.side;let c=1/0,u=l[0].side;for(let h of l){let m=Math.abs(s-h.centerAngle);m>180&&(m=360-m),m<c&&(c=m,u=h.side)}return u},n3=(e,t)=>{let n=t.get(e.elementId);if(!n||n.isDeleted||!Ee(n))return null;let o=de(n,t),i=Dh(n),r=Rh(mn(e.fixedPoint),i),a=.01;if(n.type==="diamond"){let[s,l]=hn(n),[d,c,u,h]=s,m,g;switch(r){case"left":{if(l.length>=3){let E=l[2][1];m=E[0]-a,g=E[1]}else{let f=Ge(c[1],u[0]);m=f[0]-a,g=f[1]}break}case"right":{if(l.length>=1){let E=l[0][1];m=E[0]+a,g=E[1]}else{let f=Ge(h[1],d[0]);m=f[0]+a,g=f[1]}break}case"top":{if(l.length>=4){let E=l[3][1];m=E[0],g=E[1]-a}else{let f=Ge(u[1],h[0]);m=f[0],g=f[1]-a}break}case"bottom":{if(l.length>=2){let E=l[1][1];m=E[0],g=E[1]+a}else{let f=Ge(d[1],c[0]);m=f[0],g=f[1]+a}break}case"top-right":{let f=Ge(h[0],h[1]);m=f[0]+a*.707,g=f[1]-a*.707;break}case"bottom-right":{let f=Ge(d[0],d[1]);m=f[0]+a*.707,g=f[1]+a*.707;break}case"bottom-left":{let f=Ge(c[0],c[1]);m=f[0]-a*.707,g=f[1]+a*.707;break}case"top-left":{let f=Ge(u[0],u[1]);m=f[0]-a*.707,g=f[1]-a*.707;break}default:return null}return pe(se(m,g),o,n.angle)}if(n.type==="ellipse"){let s=n.x+n.width/2,l=n.y+n.height/2,d=n.width/2,c=n.height/2,u,h;switch(r){case"top":{u=s,h=l-c-a;break}case"right":{u=s+d+a,h=l;break}case"bottom":{u=s,h=l+c+a;break}case"left":{u=s-d-a,h=l;break}case"top-right":{let m=-Math.PI/4,g=d*Math.cos(m),f=c*Math.sin(m);u=s+g+a*.707,h=l+f-a*.707;break}case"bottom-right":{let m=Math.PI/4,g=d*Math.cos(m),f=c*Math.sin(m);u=s+g+a*.707,h=l+f+a*.707;break}case"bottom-left":{let m=3*Math.PI/4,g=d*Math.cos(m),f=c*Math.sin(m);u=s+g-a*.707,h=l+f+a*.707;break}case"top-left":{let m=-3*Math.PI/4,g=d*Math.cos(m),f=c*Math.sin(m);u=s+g-a*.707,h=l+f-a*.707;break}default:return null}return pe(se(u,h),o,n.angle)}if(Co(n)){let[s,l]=pn(n),[d,c,u,h]=s,m,g;switch(r){case"top":{let f=Ge(d[0],d[1]);m=f[0],g=f[1]-a;break}case"right":{let f=Ge(c[0],c[1]);m=f[0]+a,g=f[1];break}case"bottom":{let f=Ge(u[0],u[1]);m=f[0],g=f[1]+a;break}case"left":{let f=Ge(h[0],h[1]);m=f[0]-a,g=f[1];break}case"top-left":{if(l.length>=1){let f=l[0],E=f[0],x=f[3],y=Ge(E,x);m=y[0]-a*.707,g=y[1]-a*.707}else m=n.x-a,g=n.y-a;break}case"top-right":{if(l.length>=2){let f=l[1],E=f[0],x=f[3],y=Ge(E,x);m=y[0]+a*.707,g=y[1]-a*.707}else m=n.x+n.width+a,g=n.y-a;break}case"bottom-right":{if(l.length>=3){let f=l[2],E=f[0],x=f[3],y=Ge(E,x);m=y[0]+a*.707,g=y[1]+a*.707}else m=n.x+n.width+a,g=n.y+n.height+a;break}case"bottom-left":{if(l.length>=4){let f=l[3],E=f[0],x=f[3],y=Ge(E,x);m=y[0]-a*.707,g=y[1]+a*.707}else m=n.x-a,g=n.y+n.height+a;break}default:return null}return pe(se(m,g),o,n.angle)}return null},Ge=(e,t)=>se((e[0]+t[0])/2,(e[1]+t[1])/2);I();import{arrayToMap as Dd,findIndex as Gd,findLastIndex as Od}from"@excalidraw/common";I();I();import{arrayToMap as Jh,isShallowEqual as em}from"@excalidraw/common";I();import{arrayToMap as Mt}from"@excalidraw/common";import{isPointWithinBounds as Wh,pointFrom as Aa,segmentsIntersectAt as _h}from"@excalidraw/math";I();import{arrayToMap as Zi}from"@excalidraw/common";import{validateOrderKey as Fh,generateNKeysBetween as Nh}from"@excalidraw/fractional-indexing";var Pa=class extends Error{code="ELEMENT_HAS_INVALID_INDEX"},Hh=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:o,reconciliationContext:i})=>{let r=[],a=l=>`${l?.index}:${l?.id}:${l?.type}:${l?.isDeleted}:${l?.version}:${l?.versionNonce}`,s=e.map(l=>l.index);for(let[l,d]of s.entries()){let c=s[l-1],u=s[l+1];if(Ia(d,c,u)||r.push(`Fractional indices invariant has been compromised: "${a(e[l-1])}", "${a(e[l])}", "${a(e[l+1])}"`),n&&Tt(e[l])){let h=e[l],m=Q(h,Zi(e));m&&m.index<=h.index&&r.push(`Fractional indices invariant for bound elements has been compromised: "${a(m)}", "${a(h)}"`)}}if(r.length){let l=new Pa,d=[];if(i&&(d.push("Additional reconciliation context:"),d.push(i.localElements.map(c=>a(c))),d.push(i.remoteElements.map(c=>a(c)))),o||console.error(r.join(`
11
11
 
12
- `),l.stack,e.map(c=>a(c)),...d),t)throw l}},Id=e=>e.sort((t,n)=>Pd(t)&&Pd(n)?t.index<n.index?-1:t.index>n.index?1:t.id<n.id?-1:1:1),Yn=(e,t)=>{try{let n=Ji(e),o=qh(e,t),i=Ba(e,o),r=e.map(a=>{let s=i.get(a);return s?{...a,index:s.index}:a});Zh(r,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[a,{index:s}]of i)Te(a,n,{index:s})}catch{Ca(e)}return e},Ca=e=>{let t=Ji(e),n=vd(e),o=Ba(e,n);for(let[i,{index:r}]of o)Te(i,t,{index:r});return e},Sd=e=>{let t=Ji(e),n=vd(e),o=Ba(e,n);for(let[i,{index:r}]of o)t.set(i.id,He(i,{index:r}));return t},qh=(e,t)=>{let n=[],o=0;for(;o<e.length;)if(t.has(e[o].id)){let i=[o-1,o];for(;++o<e.length&&t.has(e[o].id);)i.push(o);i.push(o),n.push(i)}else o++;return n},vd=e=>{let t=[],n,o,i=-1,r=0,a=d=>{let c=e[i]?e[i].index:void 0,u=e[d-1]?.index;return!c&&u||c&&u&&u>c?[u,d-1]:[c,i]},s=d=>{let c=e[r]?e[r].index:void 0;if(c&&d<r)return[c,r];let u=r;for(;++u<e.length;){let h=e[u]?.index;if(!c&&h||c&&h&&h>c)return[h,u]}return[void 0,u]},l=0;for(;l<e.length;){let d=e[l].index;if([n,i]=a(l),[o,r]=s(l),La(d,n,o))l++;else{let c=[i,l];for(;++l<e.length;){let u=e[l].index,[h,m]=a(l),[f,g]=s(l);if(La(u,h,f))break;[n,i]=[h,m],[o,r]=[f,g],c.push(l)}c.push(r),t.push(c)}}return t},La=(e,t,n)=>{if(!e)return!1;try{Xh(e)}catch{return!1}return t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e},Ba=(e,t)=>{let n=new Map;for(let o of t){let i=o.shift(),r=o.pop(),a=$h(e[i]?.index,e[r]?.index,o.length);for(let s=0;s<o.length;s++){let l=e[o[s]];n.set(l,{index:a[s]})}}return n},Pd=e=>!!e.index;var Ad=(e,t,n)=>{let o=It(e);for(let i of t)if(i.frameId){let r=n.get(i.id),a=n.get(i.frameId),s=r&&o.get(r);s&&Te(s,o,{frameId:a??null})}};function so(e,t,n){let o=Ga(t,n),i=Ga(e,n);return o.some(a=>i.some(s=>Md(a,s)))}var kd=(e,t,n)=>er(Cd(e,t,n,!1)).filter(o=>!ee(o)&&!o.frameId||o.frameId===t.id),Oa=(e,t,n)=>tr(ue(e,n),ue(t,n)),O3=(e,t)=>{let n=It(e);return e.filter(o=>so(o,t,n))},An=(e,t,n)=>{let[o,i,r,a]=Q(t,n),[s,l,d,c]=We(e);return o<=s&&i<=l&&r>=d&&a>=c},Sn=(e,t,n)=>An([e],t,n)||so(e,t,n)||Oa(e,t,n),R3=(e,t,n)=>{let[o,i,r,a]=Q(t,n);return Kh(Da(o,i),Da(e.x,e.y),Da(r,a))},F3=(e,t,n)=>{let o=It(e),i=t.flatMap(r=>ze(e,r));return i.length===0?!0:!!i.find(r=>An([r],n,o)||so(r,n,o))},N3=(e,t,n)=>{let o=It(e),i=t.flatMap(r=>ze(e,r));return i.length===0?!0:i.find(r=>An([r],n,o)||so(r,n,o))===void 0},H3=e=>{let t=new Map;for(let n of e){let o=ee(n)?n.id:n.frameId;o&&!t.has(o)&&t.set(o,kn(e,o))}return t},kn=(e,t)=>{let n=[];for(let o of e.values())o.frameId===t&&n.push(o);return n},Qh=e=>e.filter(t=>ee(t)),z3=e=>{let t=It(Qh(e));return e.filter(n=>t.has(n.id)||!n.frameId||!t.has(n.frameId))},W3=(e,t,n,o)=>{let i=kn(e,t.id),r=new Set(i),a=new Set([...kd(e,t,o),...i.filter(h=>Oa(h,t,o))]),s=i.filter(h=>!a.has(h)),l=new Set(Array.from(a).flatMap(h=>h.groupIds));for(let h of s)if(!so(h,t,o))h.groupIds.length===0&&r.delete(h);else if(h.groupIds.length>0)for(let m of h.groupIds)l.add(m);for(let h of s)if(h.groupIds.length>0){let m=!0;for(let f of h.groupIds)l.has(f)&&(m=!1);m&&r.delete(h)}let d=Array.from(a).filter(h=>h.groupIds.length===0);for(let h of d)r.add(h);let c=Array.from(a).filter(h=>h.groupIds.length>0),u=Bd(c,n);for(let[h,m]of Object.entries(u))if(m){let f=ze(e,h);if(An(f,t,o))for(let g of f)r.add(g)}return[...r].filter(h=>!(te(h)&&h.containerId))},_3=(e,t,n)=>Jh(er(e,kd(e,t,n)),t,n),Jh=(e,t,n)=>{let o=[],i=new Map;for(let r of e){let a=!1;if(r.groupIds.length>0){if(r.groupIds.some(s=>i.get(s)))a=!0;else{let s=new Set(r.groupIds.flatMap(l=>ze(n,l)));a=!An(Array.from(s),t,n)}r.groupIds.forEach(s=>{i.set(s,a)})}a||o.push(r)}return o},vn=(e,t)=>e.frameId&&t.get(e.frameId)||null,j3=(e,t)=>{let n=new Set,o=It(e);e=er(e);for(let a of e)ee(a)&&a.id!==t.id&&n.add(a.id);let i=new Set,r=[];for(let a of e)if(!(ee(a)||a.frameId&&n.has(a.frameId)))if(a.groupIds.length){let s=a.groupIds.at(-1);if(!i.has(s)){i.add(s);let l=ze(e,s);if(l.some(d=>Sn(d,t,o)))for(let d of l)r.push(d)}}else Sn(a,t,o)&&r.push(a);return r},em=e=>{let t;for(let n of e){if(ee(n)||!n.frameId)return null;if(t===void 0)t=n.frameId;else if(t!==n.frameId)return null}return t??null},tm=(e,t)=>{for(let n=e.length-1;n>=0;n--){let o=e[n];if(o.id===t)return n;if(o.frameId===t)return n+1}return null},nm=(e,t,n)=>{let o=It(e),i=em(t),r=new Set,a=new Set;for(let c of t)ee(c)&&c.id!==n.id&&a.add(c.id);for(let c of er(e,t)){if(ee(c)||c.frameId&&a.has(c.frameId)||c.frameId&&c.frameId!==n.id)continue;r.add(c);let u=Z(c,o);u&&!r.has(u)&&r.add(u)}for(let c of r)c.frameId!==n.id&&Te(c,o,{frameId:n.id});if(!r.size||i===n.id)return e;let s=Array.from(e.values()).filter(c=>!r.has(c)),l=tm(s,n.id);if(l===null)return e;let d=[...s.slice(0,l),...r,...s.slice(l)];return Yn(d,It([...r])),Array.isArray(e)?d:new Map(d.map(c=>[c.id,c]))},Td=(e,t)=>{let n=new Map,o=new Map;for(let i of e)if(i.frameId){n.set(i.id,i);let r=o.get(i.frameId)||[];r.push(i);let a=Z(i,t);a&&(n.set(a.id,a),r.push(a)),o.set(i.frameId,r)}for(let[,i]of n)Te(i,t,{frameId:null})},om=(e,t)=>{let n=kn(e,t.id);return Td(n,It(e)),e},V3=(e,t,n)=>nm(om(e,n),t,n).slice(),U3=(e,t,n)=>{let o=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(o);if(t.editingGroupId)for(let s of o)s.groupIds.length===0?i.add(s):s.groupIds.flatMap(l=>ze(e,l)).forEach(l=>i.add(l));let r=new Set,a=It(e);return i.forEach(s=>{s.frameId&&!ee(s)&&!Ld(s,a,t)&&r.add(s)}),r.size>0&&Td(r,a),e},er=(e,t)=>{let n=new Set,o=t||e;for(let a of o.values()){let s=a.groupIds[a.groupIds.length-1];s&&n.add(s)}let i=new Set;for(let a of n)ze(e,a).some(s=>ee(s))&&i.add(a);let r=[];for(let a of o.values())i.has(a.groupIds[a.groupIds.length-1])||r.push(a);return r},im=(e,t,n)=>{let o=te(e)&&De(e,t)||e;return o.frameId&&n.selectedElementIds[o.id]&&n.selectedElementIds[o.frameId]?vn(o,t):n.selectedElementIds[o.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:vn(o,t)},Ld=(e,t,n,o)=>{let i=o?.targetFrame??im(e,t,n);if(!i)return!1;let r=te(e)&&De(e,t)||e,a=l=>{o?.checkedGroups&&r.groupIds.forEach(d=>{o.checkedGroups?.set(d,l)})};if(!n.selectedElementIds[r.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[r.id]&&n.selectedElementIds[i.id])return!0;if(r.groupIds.length===0)return Sn(r,i,t);for(let l of r.groupIds)if(o?.checkedGroups?.has(l))return o.checkedGroups.get(l);let s=new Set(r.groupIds.filter(l=>o?.checkedGroups?!o.checkedGroups.has(l):!0).flatMap(l=>ze(t,l)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let l=new Set(Ht(t,n));if(n.frameToHighlight!==null)return!0;l.forEach(c=>{s.delete(c)})}for(let l of s)if(ee(l))return a(!1),!1;for(let l of s)if(Sn(l,i,t))return a(!0),!0;return!1},Y3=(e,t,n,o,i)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let r=so(e,t,o)||Oa(e,t,o);if(r){for(let a of e.groupIds)i?.set(a,!0);return!0}if(!r&&e.groupIds.length>0&&!An([e],t,o)){let a=!1;if(n.selectedElementsAreBeingDragged)a=Ld(e,o,n,{targetFrame:t,checkedGroups:i});else{a=e.frameId===t.id;for(let s of e.groupIds)i?.set(s,a)}for(let s of e.groupIds)i?.set(s,a);return a}return!1},rm="Frame",am="AI Frame",sm=e=>Ai(e)?rm:am,X3=e=>e.name===null?sm(e):e.name,$3=(e,t,n)=>e.filter(o=>(!o.frameId||o.frameId===t.id)&&Ot(ue(o,n),ue(t,n))),Z3=e=>{let t=It(e);return e.length>1&&e.some(n=>n.frameId&&t.has(n.frameId))};var cm=e=>e.locked||Ee(e),um=(e,t)=>e.filter(n=>!(n.frameId&&t.has(n.frameId))),pm=e=>{let t=new Set;return e.forEach(n=>{ee(n)&&t.add(n.id)}),um(e,t)},Cd=(e,t,n,o=!0,i="contain")=>{let[r,a,s,l]=Q(t,n),d=Math.min(r,s),c=Math.min(a,l),u=Math.max(r,s),h=Math.max(a,l),m=[d,c,u,h],f=[nr(st(d,c),st(u,c)),nr(st(u,c),st(u,h)),nr(st(u,h),st(d,h)),nr(st(d,h),st(d,c))],g=o?new Set:null,E={},x=new Set;for(let y of e){if(cm(y))continue;let w=y.groupIds.at(-1);w&&(E[w]||(E[w]=[]),E[w].push(y));let M=y.strokeWidth,b=null,S=ue(y,n);S=[S[0]-M/2,S[1]-M/2,S[2]+M/2,S[3]+M/2];let v=j(y)&&Z(y,n);if(v){let{x:D,y:B}=R.getBoundTextElementPosition(y,v,n);b=[D,B,D+v.width,B+v.height]}let L=vn(y,n);if(L&&Sn(y,L,n)){let D=ue(L,n);S=[Math.max(S[0],D[0]),Math.max(S[1],D[1]),Math.min(S[2],D[2]),Math.min(S[3],D[3])],b=b?[Math.max(b[0],D[0]),Math.max(b[1],D[1]),Math.min(b[2],D[2]),Math.min(b[3],D[3])]:null}let T=b?[Math.min(b[0],S[0]),Math.min(b[1],S[1]),Math.max(b[2],S[2]),Math.max(b[3],S[3])]:S;if(tr(m,T)){g&&ee(y)&&g.add(y.id),x.add(y);continue}if(i==="overlap"&&b&&Ot(m,b)){x.add(y);continue}if(i==="overlap"&&Ot(m,S)){let D=!1;if(ne(y)||Pe(y)){let B=le(y,n);D=y.points.some(F=>{let O=lo(st(y.x+F[0],y.y+F[1]),B,y.angle);return wt(O,m)})}else{let B=ue(y,n,!0),F=le(y,n);D=[lo(st((B[0]+B[2])/2,B[1]),F,y.angle),lo(st(B[2],(B[1]+B[3])/2),F,y.angle),lo(st((B[0]+B[2])/2,B[3]),F,y.angle),lo(st(B[0],(B[1]+B[3])/2),F,y.angle)].some(O=>wt(lo(O,F,y.angle),m))}if(D||(D=f.some(B=>Gt(y,n,B,M/2,!0).length>0)),D){g&&ee(y)&&g.add(y.id),x.add(y);continue}}}return g&&x.forEach(y=>{y.frameId&&g.has(y.frameId)&&x.delete(y)}),i==="overlap"?Array.from(x).forEach(y=>{let w=y.groupIds.at(-1);(w?E[w]:null)?.forEach(b=>x.add(b))}):i==="contain"&&x.forEach(y=>{let w=y.groupIds.at(-1),M=w?E[w]:null;M&&!M.every(b=>x.has(b))&&x.delete(y)}),e.filter(y=>x.has(y))},lw=(e,t,n,o)=>{let i=new Set(t.map(r=>r.id));return e.filter(r=>{let a=Gd(r,n.width,n.height,n,o);return!i.has(r.id)&&a})},dw=function(){let e=null,t=null,n=null,o=(i,r)=>(n!=null&&i===e&&r.selectedElementIds===t||(n=i.some(a=>r.selectedElementIds[a.id]),e=i,t=r.selectedElementIds),n);return o.clearCache=()=>{e=null,t=null,n=null},o}(),Ht=(e,t,n)=>{let o=new Set,i=[];for(let r of e.values()){if(t.selectedElementIds[r.id]){i.push(r),o.add(r.id);continue}if(n?.includeBoundTextElement&&Ee(r)&&t.selectedElementIds[r?.containerId]){i.push(r),o.add(r.id);continue}}if(n?.includeElementsInFrames){let r=[];return i.forEach(a=>{ee(a)&&kn(e,a.id).forEach(s=>!o.has(s.id)&&r.push(s)),r.push(a)}),r}return i},cw=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:Ht(e,t,{includeBoundTextElement:!0}),Ra=(e,t)=>dm(t.selectedElementIds,e)?t.selectedElementIds:e,hm=(e,t)=>{let n=e.filter(ne);if(n.length===1){let o=n[0],i=o.boundElements?.map(a=>a.id)??[];if(e.every(a=>a.id===o.id||i.includes(a.id)))return new R(o,lm(t))}return null},uw=(e,t,n)=>({selectedLinearElement:hm(e,t),...Dd({editingGroupId:n.editingGroupId,selectedElementIds:pm(e).reduce((o,i)=>(Ee(i)||(o[i.id]=!0),o),{})},t,n,null)}),pw=(e,t)=>t.editingTextElement||e.length===1&&te(e[0])&&e[0]||null;var mm=(e,t,n)=>{let o=n.reduce((i,r)=>(r.groupIds.includes(e)&&(i[r.id]=!0),i),{});return Object.keys(o).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...o}}},Dd=function(){let e=null,t=null,n=null,o=(r,a,s,l)=>{if(n!==void 0&&a===t&&r===e&&s.editingGroupId===n?.editingGroupId)return n;let d={};for(let h of r){let m=h.groupIds;if(s.editingGroupId){let f=m.indexOf(s.editingGroupId);f>-1&&(m=m.slice(0,f))}if(m.length>0){let f=m[m.length-1];d[f]=!0}}let c={},u=a.reduce((h,m)=>{if(m.isDeleted)return h;let f=m.groupIds.find(g=>d[g]);return f&&(h[m.id]=!0,Array.isArray(c[f])?c[f].push(m.id):c[f]=[m.id]),h},{});for(let h of Object.keys(c))c[h].length<2&&d[h]&&(d[h]=!1);return t=a,e=r,n={editingGroupId:s.editingGroupId,selectedGroupIds:d,selectedElementIds:Ra({...s.selectedElementIds,...u},l)},n},i=(r,a,s,l)=>{let d=l?l.scene.getSelectedElements({selectedElementIds:r.selectedElementIds,elements:a}):Ht(a,r);return d.length?o(d,a,r,s):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:Ra(r.selectedElementIds,s)}};return i.clearCache=()=>{t=null,e=null,n=null},i}(),fm=(e,t)=>Fa(e,t)!=null,Fa=(e,t)=>t.groupIds.filter(n=>n!==e.editingGroupId).find(n=>e.selectedGroupIds[n]),gm=e=>Object.entries(e.selectedGroupIds).filter(([t,n])=>n).map(([t,n])=>t),Bd=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let o of e){let i=o.groupIds;if(t.editingGroupId){let r=i.indexOf(t.editingGroupId);r>-1&&(i=i.slice(0,r))}if(i.length>0){let r=i[i.length-1];n={...n,...mm(r,n,e)}}}return n.selectedGroupIds},xw=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),Em=(e,t)=>e.groupIds.includes(t),ze=(e,t)=>{let n=[];for(let o of e.values())Em(o,t)&&n.push(o);return n},xm=(e,t)=>e.groupIds.find(n=>t[n]),yw=(e,t,n)=>{let o=[...e],i=n?o.indexOf(n):-1,r=i>-1?i:o.length;return o.splice(r,0,t),o},ww=(e,t)=>e.filter(n=>!t[n]),or=(e,t)=>{let n=new Map;return e.forEach(o=>{let i=o.groupIds.length===0?o.id:o.groupIds[o.groupIds.length-1],r=n.get(i)||[],a=Z(o,t);a&&r.push(a),n.set(i,[...r,o])}),Array.from(n.values())},Od=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let o of n.groupIds??[])t.add(o);return t},Rd=e=>{let t=e.flatMap(i=>i.groupIds),n=new Map,o=0;for(let i of t)n.set(i,(n.get(i)??0)+1),n.get(i)>o&&(o=n.get(i));return o===e.length},Fd=e=>e.groupIds.length>0,Nd=(e,t,n)=>{let o=[...e],i=t?e.indexOf(t):-1,r=i>-1?i:e.length;for(let a=0;a<r;a++)o[a]=n(o[a]);return o},ir=(e,t,n)=>{let o=gm(n),i=e.filter(u=>!Ee(u)),r=new Map,a=new Map,s=u=>{let h=a.get(u.id)||[],m=Z(u,t);m&&h.push(m),a.set(u.id,[...h,u])},l=(u,h)=>{let m=r.get(h)||[],f=Z(u,t);f&&m.push(f),r.set(h,[...m,u])},d=(u,h)=>{let m=u.groupIds.indexOf(h,0);return u.groupIds.slice(0,m).length>0?l(u,u.groupIds[m-1]):s(u)},c=e.every(u=>fm(n,u));return i.forEach(u=>{let h=xm(u,n.selectedGroupIds);h?o.length===1&&c?d(u,h):l(u,h):s(u)}),Array.from(r.values()).concat(Array.from(a.values()))};var Na=(e,t)=>e.frameId===t||e.id===t,jd=(e,t,n)=>{let o=[],i=[],r=null,a=-1,s=zd(n||Ht(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++a<e.length;){let l=e[a];s.get(l.id)?(i.length&&(o=o.concat(i),i=[]),o.push(a),r=a+1):l.isDeleted&&r===a?(r=a+1,i.push(a)):i=[]}return o},ym=e=>{let t=0;return e.reduce((n,o,i)=>(i>0&&e[i-1]!==o-1&&(t=++t),(n[t]||(n[t]=[])).push(o),n),[])},Hd=(e,t,n,o)=>{if("containerId"in e&&e.containerId){let i=o.getElement(e.containerId);if(i)return n==="left"?Math.min(t.indexOf(i),t.indexOf(e)):Math.max(t.indexOf(i),t.indexOf(e))}else{let i=e.boundElements?.find(r=>r.type!=="arrow")?.id;if(i){let r=o.getElement(i);if(r)return n==="left"?Math.min(t.indexOf(r),t.indexOf(e)):Math.max(t.indexOf(r),t.indexOf(e))}}},wm=(e,t)=>{let n=-1,o=-1;return e.forEach((i,r)=>{Na(i,t)&&(n===-1&&(n=r),o=r)}),n===-1?[]:e.slice(n,o+1)},Xo=(e,t,n,o,i,r)=>{let a=r||Jt(e,n,o);if(!a)return n;let s=Z(a,o),l=te(a)?De(a,o):null,d=[a.id,s?.id,l?.id].filter(h=>!!h),c=n.findIndex(h=>d.includes(h.id)),u=n.findIndex(h=>h.id===t.id);if(u!==-1&&c!==-1&&u<c){let h=Array.from(n),m=h.splice(u,1)[0];h.splice(c,0,m),i.replaceAllElements(h)}return n},bm=(e,t,n,o,i,r)=>{let a=t[n],s=h=>h.isDeleted?!1:i?h.frameId===i:e.editingGroupId?h.groupIds.includes(e.editingGroupId):!0,l=o==="left"?_d(t,h=>s(h),Math.max(0,n-1)):Wd(t,h=>s(h),n+1),d=t[l];if(!d)return-1;if(e.editingGroupId){if(a?.groupIds.join("")===d?.groupIds.join(""))return Hd(d,t,o,r)??l;if(!d?.groupIds.includes(e.editingGroupId))return-1}if(!i&&(d.frameId||ee(d))){let h=wm(t,d.frameId||d.id);return o==="left"?t.indexOf(h[0]):t.indexOf(h[h.length-1])}if(!d.groupIds.length)return Hd(d,t,o,r)??l;let c=e.editingGroupId?d.groupIds[d.groupIds.indexOf(e.editingGroupId)-1]:d.groupIds[d.groupIds.length-1],u=ze(t,c);return u.length?o==="left"?t.indexOf(u[0]):t.indexOf(u[u.length-1]):l},Vd=(e,t)=>t.reduce((n,o)=>{let i=e[o];return n.set(i.id,i),n},new Map),Ud=(e,t,n,o)=>{let i=jd(e,t),r=Vd(e,i),a=ym(i);n==="right"&&(a=a.reverse());let s=new Set(i.filter(l=>ee(e[l])).map(l=>e[l].id));return a.forEach((l,d)=>{let c=l[0],u=l[l.length-1],h=n==="left"?c:u,m=l.some(w=>{let M=e[w];return M.frameId&&s.has(M.frameId)})?null:e[h]?.frameId,f=bm(t,e,h,n,m,o);if(f===-1||h===f)return;let g=n==="left"?e.slice(0,f):e.slice(0,c),E=e.slice(c,u+1),x=n==="left"?e.slice(f,c):e.slice(u+1,f+1),y=n==="left"?e.slice(u+1):e.slice(f+1);e=n==="left"?[...g,...E,...x,...y]:[...g,...x,...E,...y]}),Yn(e,r),e},Yd=(e,t,n,o,i)=>{let r=jd(e,t,i),a=Vd(e,r),s=[],l,d;if(n==="left"){if(o)l=Wd(e,f=>Na(f,o));else if(t.editingGroupId){let f=ze(e,t.editingGroupId);if(!f.length)return e;l=e.indexOf(f[0])}else l=0;d=r[r.length-1]}else{if(o)d=_d(e,f=>Na(f,o));else if(t.editingGroupId){let f=ze(e,t.editingGroupId);if(!f.length)return e;d=e.indexOf(f[f.length-1])}else d=e.length-1;l=r[0]}l===-1&&(l=0);for(let f=l;f<d+1;f++)r.includes(f)||s.push(e[f]);let c=Array.from(a.values()),u=e.slice(0,l),h=e.slice(d+1),m=n==="left"?[...u,...c,...s,...h]:[...u,...s,...c,...h];return Yn(m,a),m};function Xd(e,t,n,o){let i=zd(Ht(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),r={regularElements:[],frameChildren:new Map},a=new Set;for(let d of e)i.has(d.id)&&ee(d)&&a.add(d.id);for(let d of e)if(i.has(d.id))if(ee(d)||d.frameId&&a.has(d.frameId))r.regularElements.push(d);else if(!d.frameId)r.regularElements.push(d);else{let c=r.frameChildren.get(d.frameId)||[];c.push(d),r.frameChildren.set(d.frameId,c)}let s=e,l=Array.from(r.frameChildren.entries());for(let[d,c]of l)s=o(e,t,n,d,c);return o(s,t,n,null,r.regularElements)}var Lw=(e,t,n)=>Ud(e,t,"left",n),Cw=(e,t,n)=>Ud(e,t,"right",n),Bw=(e,t)=>Xd(e,t,"left",Yd),Dw=(e,t)=>Xd(e,t,"right",Yd);var Ha=({points:e})=>{let t=e[0][0],n=e[0][1];return{points:e.map(o=>N(o[0]-t,o[1]-n)),offsetX:t,offsetY:n}},R=class e{elementId;selectedPointsIndices;initialState;isDragging;lastUncommittedPoint;lastCommittedPoint;pointerOffset;hoverPointIndex;segmentMidPointHoveredCoords;hoveredFocusPointBinding;draggedFocusPointBinding;elbowed;customLineAngle;isEditing;pointerDownState;constructor(t,n,o=!1){this.elementId=t.id,Zd(t.points[0],N(0,0))||(console.error("Linear element is not normalized",Error().stack),Te(t,n,e.getNormalizeElementPointsAndCoords(t))),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.lastCommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.initialState={prevSelectedPointsIndices:null,lastClickedPoint:-1,origin:null,segmentMidpoint:{value:null,index:null,added:!1},arrowStartIsInside:!1,altFocusPoint:null},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.hoveredFocusPointBinding=null,this.draggedFocusPointBinding=null,this.elbowed=U(t)&&t.elbowed,this.customLineAngle=null,this.isEditing=o}static POINT_HANDLE_SIZE=10;static getElement(t,n){let o=n.get(t);return o||null}static handleBoxSelection(t,n,o,i){if(!n.selectedLinearElement?.isEditing||!n.selectionElement)return!1;let{selectedLinearElement:r}=n,{selectedPointsIndices:a,elementId:s}=r,l=e.getElement(s,i);if(!l)return!1;let[d,c,u,h]=Q(n.selectionElement,i),f=e.getPointsGlobalCoordinates(l,i).reduce((g,E,x)=>((E[0]>=d&&E[0]<=u&&E[1]>=c&&E[1]<=h||t.shiftKey&&a?.includes(x))&&g.push(x),g),[]).filter(g=>!(U(l)&&g!==0&&g!==l.points.length-1));o({selectedLinearElement:{...r,selectedPointsIndices:f.length?f:null}})}static handlePointerMove(t,n,o,i,r){let a=n.scene.getNonDeletedElementsMap(),s=n.scene.getNonDeletedElements(),{elementId:l}=r,d=e.getElement(l,a);Ke(d,"Element being dragged must exist in the scene"),Ke(d.points.length>1,"Element must have at least 2 points");let c=d.points.length-1,u=d.points[c],h=d.points[c-1],m=r.customLineAngle??Qd(h,d.points[c]),f=0,g=0;if($o(t)){let[b,S]=e._getShiftLockedDelta(d,a,h,N(o,i),t[Xn.CTRL_OR_CMD]?null:n.getEffectiveGridSize(),m),v=N(b+h[0],S+h[1]);f=v[0]-u[0],g=v[1]-u[1]}else{let b=e.createPointAt(d,a,o-r.pointerOffset.x,i-r.pointerOffset.y,t[Xn.CTRL_OR_CMD]?null:n.getEffectiveGridSize());f=b[0]-u[0],g=b[1]-u[1]}let E=null,{positions:x,updates:y}=Kd([c],f,g,o,i,a,d,s,n,$o(t),t.altKey,r);if(e.movePoints(d,n.scene,x,{startBinding:y?.startBinding,endBinding:y?.endBinding,moveMidPointsWithElement:y?.moveMidPointsWithElement},{isBindingEnabled:n.state.isBindingEnabled,isMidpointSnappingEnabled:n.state.isMidpointSnappingEnabled}),Be(d,!1)&&Ft(n.state)&&(E=y?.suggestedBinding??null),Be(d)&&Xo(e.getPointGlobalCoordinates(d,d.points[d.points.length-1],a),d,s,a,n.scene),n.state.selectedLinearElement?.customLineAngle===m&&r.initialState.altFocusPoint&&(!E||vm(n.state.suggestedBinding??[],E)))return null;let w=Be(d)&&d.startBinding&&a.get(d.startBinding.elementId);return{selectedLinearElement:{...r,customLineAngle:m,initialState:{...r.initialState,altFocusPoint:!r.initialState.altFocusPoint&&w&&y?.suggestedBinding?.element.id!==w.id?to(d,N(d.x,d.y),w,"start",a,n.state.zoom,n.state.isMidpointSnappingEnabled):r.initialState.altFocusPoint}},suggestedBinding:E}}static handlePointDragging(t,n,o,i,r){let a=n.scene.getNonDeletedElementsMap(),s=n.scene.getNonDeletedElements(),{elbowed:l,elementId:d,initialState:c}=r,u=Array.from(r.selectedPointsIndices??[]),{lastClickedPoint:h}=c,m=e.getElement(d,a);Ke(m,"Element being dragged must exist in the scene"),Ke(m.points.length>1,"Element must have at least 2 points"),Ke(u,"There must be selected points in order to drag them"),l&&u.some((A,_)=>A>0&&A!==m.points.length-1?(u[_]=m.points.length-1,h=m.points.length-1,!0):!1),(h<0||!u.includes(h)||!m.points[h])&&(console.error(`There must be a valid lastClickedPoint in order to drag it. selectedPointsIndices(${JSON.stringify(u)}) points(0..${m.points.length-1}) lastClickedPoint(${h}) isElbowArrow: ${l}`),h=m.points.length-1);let f=m.points[h],g=m.points[h===0?1:h-1],E=u.length===1,x=r.customLineAngle??Qd(g,m.points[h]),y=u.includes(0),w=u.includes(m.points.length-1),M=0,b=0;if($o(t)&&E){let[A,_]=e._getShiftLockedDelta(m,a,g,N(o,i),t[Xn.CTRL_OR_CMD]?null:n.getEffectiveGridSize(),x),X=N(A+g[0],_+g[1]);M=X[0]-f[0],b=X[1]-f[1]}else{let A=e.createPointAt(m,a,o-r.pointerOffset.x,i-r.pointerOffset.y,t[Xn.CTRL_OR_CMD]?null:n.getEffectiveGridSize());M=A[0]-f[0],b=A[1]-f[1]}let S=null,{positions:v,updates:L}=Kd(u,M,b,o,i,a,m,s,n,$o(t)&&E,t.altKey,r);e.movePoints(m,n.scene,v,{startBinding:L?.startBinding,endBinding:L?.endBinding,moveMidPointsWithElement:L?.moveMidPointsWithElement},{isBindingEnabled:n.state.isBindingEnabled,isMidpointSnappingEnabled:n.state.isMidpointSnappingEnabled}),Be(m,!1)&&Ft(n.state)&&(y||w)&&(S=L?.suggestedBinding??null),Be(m)&&y!==w&&Xo(e.getPointGlobalCoordinates(m,y?m.points[0]:m.points[m.points.length-1],a),m,s,a,n.scene),Z(m,a)&&Vn(m,n.scene,!1);let D=l?w?[m.points.length-1]:[0]:u,B=l?D[0]:h,F=!y&&!w?e.getPointGlobalCoordinates(m,f,a):null,O=B,K=Be(m)&&m.startBinding&&a.get(m.startBinding.elementId),Y=Be(m)&&m.endBinding&&a.get(m.endBinding.elementId),se=w&&K&&L?.suggestedBinding?.element.id!==K.id?K:y&&Y&&L?.suggestedBinding?.element.id!==Y.id?Y:null;return{selectedLinearElement:{...r,selectedPointsIndices:D,initialState:{...r.initialState,lastClickedPoint:B,altFocusPoint:!r.initialState.altFocusPoint&&Be(m)&&se?to(m,N(m.x,m.y),se,"start",a,n.state.zoom,n.state.isMidpointSnappingEnabled):r.initialState.altFocusPoint},segmentMidPointHoveredCoords:F,hoverPointIndex:O,isDragging:!0,customLineAngle:x},suggestedBinding:S}}static handlePointerUp(t,n,o,i){let r=i.getNonDeletedElementsMap(),{elementId:a,selectedPointsIndices:s,isDragging:l,initialState:d}=n,c=e.getElement(a,r);if(!c)return n;if(l&&s)for(let u of s)(u===0||u===c.points.length-1)&&$t(c.points,o.zoom.value)&&(Ut(c)&&i.mutateElement(c,{...Jd(c,!0)},{informMutation:!1,isDragging:!1}),e.movePoints(c,i,new Map([[u,{point:u===0?c.points[c.points.length-1]:c.points[0]}]])));return{...n,segmentMidPointHoveredCoords:null,hoverPointIndex:-1,selectedPointsIndices:l||t.shiftKey?!l&&t.shiftKey&&d.prevSelectedPointsIndices?.includes(d.lastClickedPoint)?s&&s.filter(u=>u!==d.lastClickedPoint):s:s?.includes(d.lastClickedPoint)?[d.lastClickedPoint]:s,isDragging:!1,customLineAngle:null,initialState:{...n.initialState,origin:null,arrowStartIsInside:!1}}}static getEditorMidPoints=(t,n,o)=>{let i=Z(t,n);if(!U(t)&&!o.selectedLinearElement?.isEditing&&t.points.length>2&&!i)return[];let r=e.getPointsGlobalCoordinates(t,n),a=0,s=[];for(;a<r.length-1;){if(e.isSegmentTooShort(t,t.points[a],t.points[a+1],a,o.zoom,n)){s.push(null),a++;continue}let l=e.getSegmentMidPoint(t,a+1,n);s.push(l),a++}return s};static getSegmentMidpointHitCoords=(t,n,o,i)=>{let{elementId:r}=t,a=e.getElement(r,i);if(!a)return null;let s=e.getPointIndexUnderCursor(a,i,o.zoom,n.x,n.y);if(!U(a)&&s>=0||e.getPointsGlobalCoordinates(a,i).length>=3&&!o.selectedLinearElement?.isEditing&&!U(a))return null;let d=(e.POINT_HANDLE_SIZE+1)/o.zoom.value,c=t.segmentMidPointHoveredCoords;if(c&&$n(N(c[0],c[1]),N(n.x,n.y))<=d)return c;let u=0,h=e.getEditorMidPoints(a,i,o);for(;u<h.length;){if(h[u]!==null&&$n(h[u],N(n.x,n.y))<=d)return h[u];u++}return null};static isSegmentTooShort(t,n,o,i,r,a){if(U(t))return i>=0&&i<t.points.length?$n(n,o)*r.value<e.POINT_HANDLE_SIZE/2:!1;let s=$n(n,o);if(t.points.length>2&&t.roundness){let[l,d]=_n(t,a);Ke(l.length===0&&d.length>0,"Only linears built out of curves are supported"),Ke(l.length+d.length>=i,"Invalid segment index while calculating mid point"),s=Pm(d[i])}return s*r.value<e.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,o){if(U(t)){Ke(t.points.length>=n,"Invalid segment index while calculating elbow arrow mid point");let a=$d(t.points[n-1],t.points[n]);return N(t.x+a[0],t.y+a[1])}let[i,r]=_n(t,o);if(Ke(i.length===0&&r.length>0||i.length>0&&r.length===0,"Only linears built out of either segments or curves are supported"),Ke(i.length+r.length>=n,"Invalid segment index while calculating mid point"),i.length){let a=i[n-1];return $d(a[0],a[1])}if(r.length){let a=r[n-1];return Im(a,.5)}Ke(!1,"Invalid segment type while calculating mid point")}static getSegmentMidPointIndex(t,n,o,i){let r=e.getElement(t.elementId,i);if(!r)return-1;let a=e.getEditorMidPoints(r,i,n),s=0;for(;s<a.length;){if(e.arePointsEqual(o,a[s]))return s+1;s++}return-1}static handlePointerDown(t,n,o,i,r,a){let s=n.state,l=a.getNonDeletedElementsMap(),d={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!r)return d;let{elementId:c}=r,u=e.getElement(c,l);if(!u)return d;let h=e.getSegmentMidpointHitCoords(r,i,s,l),m=N(i.x,i.y),f=null;if(h)f=e.getSegmentMidPointIndex(r,s,h,l);else if(t.altKey&&s.selectedLinearElement?.isEditing)return r.lastUncommittedPoint==null&&(a.mutateElement(u,{points:[...u.points,e.createPointAt(u,l,i.x,i.y,t[Xn.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),d.didAddPoint=!0),o.scheduleCapture(),d.linearElementEditor={...r,initialState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:-1,origin:m,segmentMidpoint:{value:h,index:f,added:!1},arrowStartIsInside:!!n.state.newElement&&(n.state.bindMode==="inside"||n.state.bindMode==="skip"),altFocusPoint:null},selectedPointsIndices:[u.points.length-1],lastUncommittedPoint:null},d.didAddPoint=!0,d;let g=e.getPointIndexUnderCursor(u,l,s.zoom,i.x,i.y);(g>=0||h)&&(d.hitElement=u);let[E,x,y,w]=Q(u,l),M=(E+y)/2,b=(x+w)/2,S=g>-1&&_e(N(u.x+u.points[g][0],u.y+u.points[g][1]),N(M,b),u.angle),v=g>-1||t.shiftKey?t.shiftKey||r.selectedPointsIndices?.includes(g)?Am([...r.selectedPointsIndices||[],g]):[g]:null;return d.linearElementEditor={...r,initialState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:g,origin:m,segmentMidpoint:{value:h,index:f,added:!1},arrowStartIsInside:!!n.state.newElement&&(n.state.bindMode==="inside"||n.state.bindMode==="skip"),altFocusPoint:null},selectedPointsIndices:v,pointerOffset:S?{x:i.x-S[0],y:i.y-S[1]}:{x:0,y:0}},d}static arePointsEqual(t,n){return!t&&!n?!0:!t||!n?!1:Zd(t,n)}static handlePointerMoveInEditMode(t,n,o,i){let r=i.state;if(!r.selectedLinearElement?.isEditing)return null;let{elementId:a,lastUncommittedPoint:s}=r.selectedLinearElement,l=i.scene.getNonDeletedElementsMap(),d=e.getElement(a,l);if(!d)return r.selectedLinearElement;let{points:c}=d,u=c[c.length-1];if(!t.altKey)return u===s&&e.deletePoints(d,i,[c.length-1]),r.selectedLinearElement?.lastUncommittedPoint?{...r.selectedLinearElement,lastUncommittedPoint:null}:r.selectedLinearElement;let h;if($o(t)&&c.length>=2){let m=c[c.length-2],[f,g]=e._getShiftLockedDelta(d,l,m,N(n,o),t[Xn.CTRL_OR_CMD]?null:i.getEffectiveGridSize());h=N(f+m[0],g+m[1])}else h=e.createPointAt(d,l,n-r.selectedLinearElement.pointerOffset.x,o-r.selectedLinearElement.pointerOffset.y,t[Xn.CTRL_OR_CMD]||U(d)?null:i.getEffectiveGridSize());return u===s?e.movePoints(d,i.scene,new Map([[d.points.length-1,{point:h}]])):e.addPoints(d,i.scene,[h]),{...r.selectedLinearElement,lastUncommittedPoint:d.points[d.points.length-1]}}static getPointGlobalCoordinates(t,n,o){let[i,r,a,s]=Q(t,o),l=(i+a)/2,d=(r+s)/2,{x:c,y:u}=t;return _e(N(c+n[0],u+n[1]),N(l,d),t.angle)}static getPointsGlobalCoordinates(t,n){let[o,i,r,a]=Q(t,n),s=(o+r)/2,l=(i+a)/2;return t.points.map(d=>{let{x:c,y:u}=t;return _e(N(c+d[0],u+d[1]),N(s,l),t.angle)})}static getPointAtIndexGlobalCoordinates(t,n,o){let i=n<0?t.points.length+n:n,[,,,,r,a]=Q(t,o),s=N(r,a),l=t.points[i],{x:d,y:c}=t;return l?_e(N(d+l[0],c+l[1]),s,t.angle):_e(N(d,c),s,t.angle)}static pointFromAbsoluteCoords(t,n,o){if(U(t))return N(n[0]-t.x,n[1]-t.y);let[i,r,a,s]=Q(t,o),l=(i+a)/2,d=(r+s)/2,[c,u]=_e(N(n[0],n[1]),N(l,d),-t.angle);return N(c-t.x,u-t.y)}static getPointIndexUnderCursor(t,n,o,i,r){let a=e.getPointsGlobalCoordinates(t,n),s=a.length;for(;--s>-1;){let l=a[s];if($n(N(i,r),N(l[0],l[1]))*o.value<e.POINT_HANDLE_SIZE+1)return s}return-1}static createPointAt(t,n,o,i,r){let a=qd(o,i,r),[s,l,d,c]=Q(t,n),u=(s+d)/2,h=(l+c)/2,[m,f]=_e(N(a[0],a[1]),N(u,h),-t.angle);return N(m-t.x,f-t.y)}static getNormalizeElementPointsAndCoords(t){let{points:n,offsetX:o,offsetY:i}=Ha(t);return{points:n,x:t.x+o,y:t.y+i}}static duplicateSelectedPoints(t,n){Ke(t.selectedLinearElement?.isEditing,"Not currently editing a linear element");let o=n.getNonDeletedElementsMap(),{selectedPointsIndices:i,elementId:r}=t.selectedLinearElement,a=e.getElement(r,o);Ke(a,"The linear element does not exist in the provided Scene"),Ke(i!=null,"There are no selected points to duplicate");let{points:s}=a,l=[],d=!1,c=-1,u=s.reduce((h,m,f)=>{if(++c,h.push(m),i.includes(f)){let E=s[f+1];E||(d=!0),h.push(E?N((m[0]+E[0])/2,(m[1]+E[1])/2):N(m[0],m[1])),l.push(c+1),++c}return h},[]);if(n.mutateElement(a,{points:u}),d){let h=a.points[a.points.length-1];e.movePoints(a,n,new Map([[a.points.length-1,{point:N(h[0]+30,h[1]+30)}]]))}return{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:l}}}static deletePoints(t,n,o){let i=n.state.selectedLinearElement?.isEditing&&n.state.selectedLinearElement?.lastUncommittedPoint===t.points[t.points.length-1],r=t.points.filter((c,u)=>!o.includes(u));Ut(t)&&t.polygon&&(i||o.includes(0)||o.includes(t.points.length-1))&&(r[0]=N(r[r.length-1][0],r[r.length-1][1]));let{points:s,offsetX:l,offsetY:d}=Ha({points:r});e._updatePoints(t,n.scene,s,l,d)}static addPoints(t,n,o){let i=[...t.points,...o];Ut(t)&&t.polygon&&(i[0]=N(i[i.length-1][0],i[i.length-1][1]));let{points:r,offsetX:a,offsetY:s}=Ha({points:i});e._updatePoints(t,n,r,a,s)}static movePoints(t,n,o,i,r){let{points:a}=t;if(Ut(t)&&t.polygon){let u=o.get(0),h=o.get(a.length-1);u?o.set(a.length-1,{point:N(u.point[0],u.point[1]),isDragging:u.isDragging}):h&&o.set(0,{point:N(h.point[0],h.point[1]),isDragging:h.isDragging})}let s=o.get(0)?.point??N(0,0),[l,d]=s,c=U(t)?[o.get(0)?.point??a[0],o.get(a.length-1)?.point??a[a.length-1]]:a.map((u,h)=>{let m=o.get(h)?.point??u;return i?.moveMidPointsWithElement&&h!==0&&h!==a.length-1&&!o.has(h)?m:N(m[0]-l,m[1]-d)});e._updatePoints(t,n,c,l,d,i,{isDragging:Array.from(o.values()).some(u=>u.isDragging),isBindingEnabled:r?.isBindingEnabled,isMidpointSnappingEnabled:r?.isMidpointSnappingEnabled})}static shouldAddMidpoint(t,n,o,i){let r=e.getElement(t.elementId,i);if(r&&U(r)||!r)return!1;let{segmentMidpoint:a}=t.initialState;if(a.added||a.value===null||a.index===null||t.initialState.origin===null)return!1;let s=t.initialState.origin,l=$n(s,N(n.x,n.y));return!(!o.selectedLinearElement?.isEditing&&l<Sm/o.zoom.value)}static addMidpoint(t,n,o,i,r){let a=r.getNonDeletedElementsMap(),s=e.getElement(t.elementId,a);if(!s)return;let{segmentMidpoint:l}=t.initialState,d={pointerDownState:t.initialState,selectedPointsIndices:t.selectedPointsIndices},c=e.createPointAt(s,a,n.x,n.y,i&&!U(s)?o.getEffectiveGridSize():null),u=[...s.points.slice(0,l.index),c,...s.points.slice(l.index)];return r.mutateElement(s,{points:u}),d.pointerDownState={...t.initialState,segmentMidpoint:{...t.initialState.segmentMidpoint,added:!0},lastClickedPoint:l.index},d.selectedPointsIndices=[l.index],d}static _updatePoints(t,n,o,i,r,a,s){if(U(t)){let l={};a?.startBinding!==void 0&&(l.startBinding=a.startBinding),a?.endBinding!==void 0&&(l.endBinding=a.endBinding),l.points=Array.from(o),n.mutateElement(t,l,{informMutation:!0,isDragging:s?.isDragging??!1,isBindingEnabled:s?.isBindingEnabled,isMidpointSnappingEnabled:s?.isMidpointSnappingEnabled})}else{let l=za(t,o),d=za(t,t.points),c=(l[0]+l[2])/2,u=(l[1]+l[3])/2,h=(d[0]+d[2])/2,m=(d[1]+d[3])/2,f=h-c,g=m-u,E=_e(N(i,r),N(f,g),t.angle);n.mutateElement(t,{...a,points:o,x:t.x+E[0],y:t.y+E[1]})}}static _getShiftLockedDelta(t,n,o,i,r,a){let s=e.getPointGlobalCoordinates(t,o,n);if(U(t))return[i[0]-s[0],i[1]-s[1]];let[l,d]=qd(i[0],i[1],r),{width:c,height:u}=ec(s[0],s[1],l,d,a);return _e(N(c,u),N(0,0),-t.angle)}static getBoundTextElementPosition=(t,n,o)=>{e.getPointsGlobalCoordinates(t,o).length<2&&Te(n,o,{isDeleted:!0});let r=0,a=0;if(t.points.length%2===1){let s=Math.floor(t.points.length/2),l=e.getPointGlobalCoordinates(t,t.points[s],o);r=l[0]-n.width/2,a=l[1]-n.height/2}else{let s=t.points.length/2-1,l=e.getSegmentMidPoint(t,s+1,o);r=l[0]-n.width/2,a=l[1]-n.height/2}return{x:r,y:a}};static getMinMaxXYWithBoundText=(t,n,o,i)=>{let[r,a,s,l]=o,d=(r+s)/2,c=(a+l)/2,{x:u,y:h}=e.getBoundTextElementPosition(t,i,n),m=u+i.width,f=h+i.height,g=N(d,c),E=_e(N(r,a),g,t.angle),x=_e(N(s,a),g,t.angle),y=_e(N(u,h),g,-t.angle),w=_e(N(m,h),g,-t.angle),M=_e(N(u,f),g,-t.angle),b=_e(N(m,f),g,-t.angle);return E[0]<x[0]&&E[1]>=x[1]?(r=Math.min(r,M[0]),s=Math.max(s,Math.max(w[0],b[0])),a=Math.min(a,y[1]),l=Math.max(l,b[1])):E[0]>=x[0]&&E[1]>x[1]?(r=Math.min(r,b[0]),s=Math.max(s,Math.max(y[0],w[0])),a=Math.min(a,M[1]),l=Math.max(l,w[1])):E[0]>=x[0]?(r=Math.min(r,w[0]),s=Math.max(s,M[0]),a=Math.min(a,b[1]),l=Math.max(l,y[1])):E[1]<=x[1]&&(r=Math.min(r,Math.min(w[0],y[0])),s=Math.max(s,b[0]),a=Math.min(a,w[1]),l=Math.max(l,M[1])),[r,a,s,l,d,c]};static getElementAbsoluteCoords=(t,n,o=!1)=>{let i=at.generateElementShape(t,null),r=jt(i[0]),[a,s,l,d]=Zo(r),c=a+t.x,u=s+t.y,h=l+t.x,m=d+t.y,f=(c+h)/2,g=(u+m)/2,E=o&&Z(t,n);return E?e.getMinMaxXYWithBoundText(t,n,[c,u,h,m],E):[c,u,h,m,f,g]};static moveFixedSegment(t,n,o,i,r){let a=r.getNonDeletedElementsMap(),s=e.getElement(t.elementId,a);if(!s||!U(s))return t;if(n&&n>0&&n<s.points.length){let l=qe(en(Mm(s.points[n],s.points[n-1]))),d=(s.fixedSegments??[]).reduce((m,f)=>(m[f.index]=f,m),{});d[n]={index:n,start:N(l?s.points[n-1][0]:o-s.x,l?i-s.y:s.points[n-1][1]),end:N(l?s.points[n][0]:o-s.x,l?i-s.y:s.points[n][1])};let c=Object.values(d).sort((m,f)=>m.index-f.index),u=c.map(m=>m.index).reduce((m,f)=>f<n?m+1:m,0);r.mutateElement(s,{fixedSegments:c});let h=N(s.x+(s.fixedSegments[u].start[0]+s.fixedSegments[u].end[0])/2,s.y+(s.fixedSegments[u].start[1]+s.fixedSegments[u].end[1])/2);return{...t,segmentMidPointHoveredCoords:h,initialState:{...t.initialState,segmentMidpoint:{added:!1,index:s.fixedSegments[u].index,value:h}}}}return t}static deleteFixedSegment(t,n,o){n.mutateElement(t,{fixedSegments:t.fixedSegments?.filter(i=>i.index!==o)})}},Am=e=>{let t=[...new Set(e.filter(n=>n!==null&&n!==-1))];return t=t.sort((n,o)=>n-o),t.length?t:null},Kd=(e,t,n,o,i,r,a,s,l,d,c,u)=>{let h=new Map(e.map(Y=>{let se=a.points[Y]??a.points.at(-1);return[Y,{point:N(se[0]+t,se[1]+n),isDragging:!0}]}));if(!j(a))return{positions:h};let m=e.includes(0),f=e.includes(a.points.length-1),{start:g,end:E}=va(a,h,o,i,r,s,l.state,{newArrow:!!l.state.newElement,angleLocked:d,altKey:c});if(U(a)){let Y=m?g.element:f?E.element:null;return{positions:h,updates:{suggestedBinding:Y?{element:Y,midPoint:l.state.isMidpointSnappingEnabled?Aa(Y,r,N(o-u.pointerOffset.x,i-u.pointerOffset.y)):void 0}:null}}}if(!m&&!f){let Y={...a,points:a.points.map((H,A)=>h.get(A)?.point??H)},se=new Map(h);if(a.startBinding){let H=r.get(a.startBinding.elementId);if(H){let A=Pt(Y,"startBinding",a.startBinding,H,r)??null;A&&se.set(0,{point:A,isDragging:!0})}}if(a.endBinding){let H=r.get(a.endBinding.elementId);if(H){let A=Pt(Y,"endBinding",a.endBinding,H,r)??null;A&&se.set(a.points.length-1,{point:A,isDragging:!0})}}return{positions:se}}if(m===f)return{positions:h};let x={suggestedBinding:null};g.mode===null?x.startBinding=null:g.mode?(x.startBinding={elementId:g.element.id,mode:g.mode,...ao(a,g.element,"start",r,g.focusPoint)},m&&(x.startBinding.mode==="orbit"||!co("COMPLEX_BINDINGS"))&&(x.suggestedBinding=g.element?{element:g.element,midPoint:ki(N(o-u.pointerOffset.x,i-u.pointerOffset.y),g.element,r,l.state.zoom)}:null)):m&&(x.suggestedBinding=l.state.suggestedBinding),E.mode===null?x.endBinding=null:E.mode?(x.endBinding={elementId:E.element.id,mode:E.mode,...ao(a,E.element,"end",r,E.focusPoint)},f&&(x.endBinding.mode==="orbit"||!co("COMPLEX_BINDINGS"))&&(x.suggestedBinding=E.element?{element:E.element,midPoint:ki(N(o-u.pointerOffset.x,i-u.pointerOffset.y),E.element,r,l.state.zoom)}:null)):f&&(x.suggestedBinding=l.state.suggestedBinding);let y=m?N(a.points[0][0]+t,a.points[0][1]+n):a.points[0],w=f?N(a.points[a.points.length-1][0]+t,a.points[a.points.length-1][1]+n):a.points[a.points.length-1],M={...a,points:[y,...a.points.slice(1,-1),w],startBinding:x.startBinding===void 0?a.startBinding:x.startBinding===null?null:x.startBinding,endBinding:x.endBinding===void 0?a.endBinding:x.endBinding===null?null:x.endBinding},b=a.endBinding&&M.startBinding&&m&&M.startBinding.elementId===a.endBinding.elementId,S=a.startBinding&&M.endBinding&&f&&a.startBinding.elementId===M.endBinding.elementId,v=M.endBinding?E.element??r.get(M.endBinding.elementId):null,L=b?M.points[M.points.length-1]:S&&l.state.bindMode!=="inside"&&co("COMPLEX_BINDINGS")?M.points[0]:v&&Pt(M,"endBinding",M.endBinding,v,r,f)||M.points[M.points.length-1];M.points[M.points.length-1]=L;let T=M.startBinding?g.element??r.get(M.startBinding.elementId):null,D=S&&co("COMPLEX_BINDINGS")?M.points[0]:b&&l.state.bindMode!=="inside"&&co("COMPLEX_BINDINGS")?L:T&&Pt(M,"startBinding",M.startBinding,T,r,m)||M.points[0],B=!b&&!(S&&l.state.bindMode!=="inside"&&co("COMPLEX_BINDINGS"))&&!!v,F=$n(D,M.points[0])!==0,O=new Set(e);T&&F&&O.add(0),v&&B&&O.add(a.points.length-1);let K=Array.from(O);return{updates:x,positions:new Map(K.map(Y=>[Y,Y===0?{point:D,isDragging:!0}:Y===a.points.length-1?{point:L,isDragging:!0}:h.get(Y)]))}},Qd=(e,t)=>Math.atan2(t[1]-e[1],t[0]-e[0]);var Fm=(e,t)=>zn(e)&&!t.imageCache.has(e.fileId),dr=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;case"arrow":return e.endArrowhead||e.endArrowhead?40:20;default:return 20}},Nm=(e,t,n,o,i=1)=>{let r=(t?.opacity??100)*e.opacity/1e4*i;return(n.has(e.id)||o&&o.some(a=>a.id===e.id)||t&&n.has(t.id))&&(r*=Lm/100),r},Hm=(e,t,n)=>{let r=dr(e),[a,s,l,d]=Q(e,t),c=ne(e)||Pe(e)?Tn(a,l):e.width,u=ne(e)||Pe(e)?Tn(s,d):e.height,h=c*window.devicePixelRatio+r*2,m=u*window.devicePixelRatio+r*2,f=n.value;return(h*f>32767||m*f>32767)&&(f=Math.min(32767/h,32767/m)),h*m*f*f>16777216&&(f=Math.sqrt(16777216/(h*m))),h=Math.floor(h*f),m=Math.floor(m*f),{width:h,height:m,scale:f}},oc=(e,t,n,o,i)=>{let r=document.createElement("canvas"),a=r.getContext("2d"),s=dr(e),{width:l,height:d,scale:c}=Hm(e,t,n);if(!l||!d)return null;r.width=l,r.height=d;let u=-100,h=0;if(ne(e)||Pe(e)){let[x,y]=Q(e,t);u=e.x>x?Tn(e.x,x)*window.devicePixelRatio*c:0,h=e.y>y?Tn(e.y,y)*window.devicePixelRatio*c:0,a.translate(u,h)}a.save(),a.translate(s*c,s*c),a.scale(window.devicePixelRatio*c,window.devicePixelRatio*c);let m=Hn.canvas(r);sr(e,m,a,o),a.restore();let f=Z(e,t),g=document.createElement("canvas"),E=g.getContext("2d");if(j(e)&&f){let[x,y,w,M]=Q(e,t),b=Math.max(Tn(x,w),Tn(y,M));g.width=b*window.devicePixelRatio*c+s*c*10,g.height=b*window.devicePixelRatio*c+s*c*10,E.translate(g.width/2,g.height/2),E.rotate(e.angle),E.drawImage(r,-r.width/2,-r.height/2,r.width,r.height);let[,,,,S,v]=Q(f,t);E.rotate(-e.angle);let L=(g.width-r.width)/2,T=(g.height-r.height)/2,D=g.width/2-(S-x)*window.devicePixelRatio*c-L-s*c,B=g.height/2-(v-y)*window.devicePixelRatio*c-T-s*c;E.translate(-D,-B),E.clearRect(-(f.width/2+ar)*window.devicePixelRatio*c,-(f.height/2+ar)*window.devicePixelRatio*c,(f.width+ar*2)*window.devicePixelRatio*c,(f.height+ar*2)*window.devicePixelRatio*c)}return{element:e,canvas:r,theme:i.theme,scale:c,zoomValue:n.value,canvasOffsetX:u,canvasOffsetY:h,boundTextElementVersion:Z(e,t)?.version||null,containingFrameOpacity:vn(e,t)?.opacity||100,boundTextCanvas:g,angle:e.angle,imageCrop:Ae(e)?e.crop:null}},cb=14,ic=typeof document<"u"?document.createElement("img"):{src:""};ic.src=`data:${ja.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var rc=typeof document<"u"?document.createElement("img"):{src:""};rc.src=`data:${ja.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var zm=(e,t,n)=>{t.fillStyle=n===uo.DARK?"#2E2E2E":"#E7E7E7",t.fillRect(0,0,e.width,e.height);let o=Math.min(e.width,e.height),i=Math.min(o,Math.min(o*.4,100));t.drawImage(e.status==="error"?rc:ic,e.width/2-i/2,e.height/2-i/2,i,i)},sr=(e,t,n,o)=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{n.lineJoin="round",n.lineCap="round",t.draw(at.generateElementShape(e,o));break}case"arrow":case"line":{n.lineJoin="round",n.lineCap="round",at.generateElementShape(e,o).forEach(i=>{t.draw(i)});break}case"freedraw":{n.save();let i=at.generateElementShape(e,o);for(let r of i)typeof r=="string"?(n.fillStyle=o.theme===uo.DARK?lr(e.strokeColor):e.strokeColor,n.fill(new Path2D(r))):t.draw(r);n.restore();break}case"image":{n.save();let i=e.fileId!==null?o.imageCache.get(e.fileId):null,r=zn(e)?i?.image:void 0;if(r!=null&&!(r instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,Xt(Math.min(e.width,e.height),e)),n.clip());let{x:a,y:s,width:l,height:d}=e.crop?e.crop:{x:0,y:0,width:r.naturalWidth,height:r.naturalHeight},c=o.theme===uo.DARK&&i?.mimeType===ja.svg;if(c&&Rm){let u=window.devicePixelRatio||1,h=document.createElement("canvas");h.width=e.width*u,h.height=e.height*u;let m=h.getContext("2d");if(m){m.scale(u,u),m.drawImage(r,a,s,l,d,0,0,e.width,e.height);let f=m.getImageData(0,0,h.width,h.height),g=f.data;for(let E=0;E<g.length;E+=4)g[E]=255-g[E],g[E+1]=255-g[E+1],g[E+2]=255-g[E+2];m.putImageData(f,0,0),n.drawImage(h,0,0,h.width,h.height,0,0,e.width,e.height)}}else c&&(n.filter=Cm),n.drawImage(r,a,s,l,d,0,0,e.width,e.height)}else zm(e,n,o.theme);n.restore();break}default:if(te(e)){let i=Dm(e.text),r=i&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",i?"rtl":"ltr"),n.save(),n.font=Bm(e),n.fillStyle=o.theme===uo.DARK?lr(e.strokeColor):e.strokeColor,n.textAlign=e.textAlign;let a=e.text.replace(/\r\n?/g,`
12
+ `),l.stack,e.map(c=>a(c)),...d),t)throw l}},gd=e=>e.sort((t,n)=>fd(t)&&fd(n)?t.index<n.index?-1:t.index>n.index?1:t.id<n.id?-1:1:1),Yn=(e,t)=>{try{let n=Zi(e),o=zh(e,t),i=va(e,o),r=e.map(a=>{let s=i.get(a);return s?{...a,index:s.index}:a});Hh(r,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[a,{index:s}]of i)Te(a,n,{index:s})}catch{Sa(e)}return e},Sa=e=>{let t=Zi(e),n=xd(e),o=va(e,n);for(let[i,{index:r}]of o)Te(i,t,{index:r});return e},Ed=e=>{let t=Zi(e),n=xd(e),o=va(e,n);for(let[i,{index:r}]of o)t.set(i.id,He(i,{index:r}));return t},zh=(e,t)=>{let n=[],o=0;for(;o<e.length;)if(t.has(e[o].id)){let i=[o-1,o];for(;++o<e.length&&t.has(e[o].id);)i.push(o);i.push(o),n.push(i)}else o++;return n},xd=e=>{let t=[],n,o,i=-1,r=0,a=d=>{let c=e[i]?e[i].index:void 0,u=e[d-1]?.index;return!c&&u||c&&u&&u>c?[u,d-1]:[c,i]},s=d=>{let c=e[r]?e[r].index:void 0;if(c&&d<r)return[c,r];let u=r;for(;++u<e.length;){let h=e[u]?.index;if(!c&&h||c&&h&&h>c)return[h,u]}return[void 0,u]},l=0;for(;l<e.length;){let d=e[l].index;if([n,i]=a(l),[o,r]=s(l),Ia(d,n,o))l++;else{let c=[i,l];for(;++l<e.length;){let u=e[l].index,[h,m]=a(l),[g,f]=s(l);if(Ia(u,h,g))break;[n,i]=[h,m],[o,r]=[g,f],c.push(l)}c.push(r),t.push(c)}}return t},Ia=(e,t,n)=>{if(!e)return!1;try{Fh(e)}catch{return!1}return t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e},va=(e,t)=>{let n=new Map;for(let o of t){let i=o.shift(),r=o.pop(),a=Nh(e[i]?.index,e[r]?.index,o.length);for(let s=0;s<o.length;s++){let l=e[o[s]];n.set(l,{index:a[s]})}}return n},fd=e=>!!e.index;var yd=(e,t,n)=>{let o=Mt(e);for(let i of t)if(i.frameId){let r=n.get(i.id),a=n.get(i.frameId),s=r&&o.get(r);s&&Te(s,o,{frameId:a??null})}};function ao(e,t,n){let o=ka(t,n),i=ka(e,n);return o.some(a=>i.some(s=>_h(a,s)))}var wd=(e,t,n)=>qi(Pd(e,t,n,!1)).filter(o=>!ee(o)&&!o.frameId||o.frameId===t.id),Ta=(e,t,n)=>La(ue(e,n),ue(t,n)),b3=(e,t)=>{let n=Mt(e);return e.filter(o=>ao(o,t,n))},vn=(e,t,n)=>{let[o,i,r,a]=K(t,n),[s,l,d,c]=We(e);return o<=s&&i<=l&&r>=d&&a>=c},In=(e,t,n)=>vn([e],t,n)||ao(e,t,n)||Ta(e,t,n),M3=(e,t,n)=>{let[o,i,r,a]=K(t,n);return Wh(Aa(o,i),Aa(e.x,e.y),Aa(r,a))},P3=(e,t,n)=>{let o=Mt(e),i=t.flatMap(r=>ze(e,r));return i.length===0?!0:!!i.find(r=>vn([r],n,o)||ao(r,n,o))},I3=(e,t,n)=>{let o=Mt(e),i=t.flatMap(r=>ze(e,r));return i.length===0?!0:i.find(r=>vn([r],n,o)||ao(r,n,o))===void 0},S3=e=>{let t=new Map;for(let n of e){let o=ee(n)?n.id:n.frameId;o&&!t.has(o)&&t.set(o,An(e,o))}return t},An=(e,t)=>{let n=[];for(let o of e.values())o.frameId===t&&n.push(o);return n},jh=e=>e.filter(t=>ee(t)),v3=e=>{let t=Mt(jh(e));return e.filter(n=>t.has(n.id)||!n.frameId||!t.has(n.frameId))},A3=(e,t,n,o)=>{let i=An(e,t.id),r=new Set(i),a=new Set([...wd(e,t,o),...i.filter(h=>Ta(h,t,o))]),s=i.filter(h=>!a.has(h)),l=new Set(Array.from(a).flatMap(h=>h.groupIds));for(let h of s)if(!ao(h,t,o))h.groupIds.length===0&&r.delete(h);else if(h.groupIds.length>0)for(let m of h.groupIds)l.add(m);for(let h of s)if(h.groupIds.length>0){let m=!0;for(let g of h.groupIds)l.has(g)&&(m=!1);m&&r.delete(h)}let d=Array.from(a).filter(h=>h.groupIds.length===0);for(let h of d)r.add(h);let c=Array.from(a).filter(h=>h.groupIds.length>0),u=Id(c,n);for(let[h,m]of Object.entries(u))if(m){let g=ze(e,h);if(vn(g,t,o))for(let f of g)r.add(f)}return[...r].filter(h=>!(te(h)&&h.containerId))},k3=(e,t,n)=>Vh(qi(e,wd(e,t,n)),t,n),Vh=(e,t,n)=>{let o=[],i=new Map;for(let r of e){let a=!1;if(r.groupIds.length>0){if(r.groupIds.some(s=>i.get(s)))a=!0;else{let s=new Set(r.groupIds.flatMap(l=>ze(n,l)));a=!vn(Array.from(s),t,n)}r.groupIds.forEach(s=>{i.set(s,a)})}a||o.push(r)}return o},Sn=(e,t)=>e.frameId&&t.get(e.frameId)||null,T3=(e,t)=>{let n=new Set,o=Mt(e);e=qi(e);for(let a of e)ee(a)&&a.id!==t.id&&n.add(a.id);let i=new Set,r=[];for(let a of e)if(!(ee(a)||a.frameId&&n.has(a.frameId)))if(a.groupIds.length){let s=a.groupIds.at(-1);if(!i.has(s)){i.add(s);let l=ze(e,s);if(l.some(d=>In(d,t,o)))for(let d of l)r.push(d)}}else In(a,t,o)&&r.push(a);return r},Yh=e=>{let t;for(let n of e){if(ee(n)||!n.frameId)return null;if(t===void 0)t=n.frameId;else if(t!==n.frameId)return null}return t??null},Uh=(e,t)=>{for(let n=e.length-1;n>=0;n--){let o=e[n];if(o.id===t)return n;if(o.frameId===t)return n+1}return null},Xh=(e,t,n)=>{let o=Mt(e),i=Yh(t),r=new Set,a=new Set;for(let c of t)ee(c)&&c.id!==n.id&&a.add(c.id);for(let c of qi(e,t)){if(ee(c)||c.frameId&&a.has(c.frameId)||c.frameId&&c.frameId!==n.id)continue;r.add(c);let u=Q(c,o);u&&!r.has(u)&&r.add(u)}for(let c of r)c.frameId!==n.id&&Te(c,o,{frameId:n.id});if(!r.size||i===n.id)return e;let s=Array.from(e.values()).filter(c=>!r.has(c)),l=Uh(s,n.id);if(l===null)return e;let d=[...s.slice(0,l),...r,...s.slice(l)];return Yn(d,Mt([...r])),Array.isArray(e)?d:new Map(d.map(c=>[c.id,c]))},bd=(e,t)=>{let n=new Map,o=new Map;for(let i of e)if(i.frameId){n.set(i.id,i);let r=o.get(i.frameId)||[];r.push(i);let a=Q(i,t);a&&(n.set(a.id,a),r.push(a)),o.set(i.frameId,r)}for(let[,i]of n)Te(i,t,{frameId:null})},$h=(e,t)=>{let n=An(e,t.id);return bd(n,Mt(e)),e},L3=(e,t,n)=>Xh($h(e,n),t,n).slice(),C3=(e,t,n)=>{let o=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(o);if(t.editingGroupId)for(let s of o)s.groupIds.length===0?i.add(s):s.groupIds.flatMap(l=>ze(e,l)).forEach(l=>i.add(l));let r=new Set,a=Mt(e);return i.forEach(s=>{s.frameId&&!ee(s)&&!Md(s,a,t)&&r.add(s)}),r.size>0&&bd(r,a),e},qi=(e,t)=>{let n=new Set,o=t||e;for(let a of o.values()){let s=a.groupIds[a.groupIds.length-1];s&&n.add(s)}let i=new Set;for(let a of n)ze(e,a).some(s=>ee(s))&&i.add(a);let r=[];for(let a of o.values())i.has(a.groupIds[a.groupIds.length-1])||r.push(a);return r},Zh=(e,t,n)=>{let o=te(e)&&De(e,t)||e;return o.frameId&&n.selectedElementIds[o.id]&&n.selectedElementIds[o.frameId]?Sn(o,t):n.selectedElementIds[o.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:Sn(o,t)},Md=(e,t,n,o)=>{let i=o?.targetFrame??Zh(e,t,n);if(!i)return!1;let r=te(e)&&De(e,t)||e,a=l=>{o?.checkedGroups&&r.groupIds.forEach(d=>{o.checkedGroups?.set(d,l)})};if(!n.selectedElementIds[r.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[r.id]&&n.selectedElementIds[i.id])return!0;if(r.groupIds.length===0)return In(r,i,t);for(let l of r.groupIds)if(o?.checkedGroups?.has(l))return o.checkedGroups.get(l);let s=new Set(r.groupIds.filter(l=>o?.checkedGroups?!o.checkedGroups.has(l):!0).flatMap(l=>ze(t,l)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let l=new Set(Ft(t,n));if(n.frameToHighlight!==null)return!0;l.forEach(c=>{s.delete(c)})}for(let l of s)if(ee(l))return a(!1),!1;for(let l of s)if(In(l,i,t))return a(!0),!0;return!1},B3=(e,t,n,o,i)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let r=ao(e,t,o)||Ta(e,t,o);if(r){for(let a of e.groupIds)i?.set(a,!0);return!0}if(!r&&e.groupIds.length>0&&!vn([e],t,o)){let a=!1;if(n.selectedElementsAreBeingDragged)a=Md(e,o,n,{targetFrame:t,checkedGroups:i});else{a=e.frameId===t.id;for(let s of e.groupIds)i?.set(s,a)}for(let s of e.groupIds)i?.set(s,a);return a}return!1},qh="Frame",Kh="AI Frame",Qh=e=>Ii(e)?qh:Kh,D3=e=>e.name===null?Qh(e):e.name,G3=(e,t,n)=>e.filter(o=>(!o.frameId||o.frameId===t.id)&&Qt(ue(o,n),ue(t,n))),O3=e=>{let t=Mt(e);return e.length>1&&e.some(n=>n.frameId&&t.has(n.frameId))};var tm=e=>e.locked||xe(e),nm=(e,t)=>e.filter(n=>!(n.frameId&&t.has(n.frameId))),om=e=>{let t=new Set;return e.forEach(n=>{ee(n)&&t.add(n.id)}),nm(e,t)},Pd=(e,t,n,o=!0,i="contain")=>{let[r,a,s,l]=K(t,n),d=Math.min(r,s),c=Math.min(a,l),u=Math.max(r,s),h=Math.max(a,l);return vd({elements:e,bounds:[d,c,u,h],elementsMap:n,type:i,shouldIgnoreElementFromSelection:tm,excludeElementsInFrames:o})},Y3=(e,t,n,o)=>{let i=new Set(t.map(r=>r.id));return e.filter(r=>{let a=Ad(r,n.width,n.height,n,o);return!i.has(r.id)&&a})},U3=function(){let e=null,t=null,n=null,o=(i,r)=>(n!=null&&i===e&&r.selectedElementIds===t||(n=i.some(a=>r.selectedElementIds[a.id]),e=i,t=r.selectedElementIds),n);return o.clearCache=()=>{e=null,t=null,n=null},o}(),Ft=(e,t,n)=>{let o=new Set,i=[];for(let r of e.values()){if(t.selectedElementIds[r.id]){i.push(r),o.add(r.id);continue}if(n?.includeBoundTextElement&&xe(r)&&t.selectedElementIds[r?.containerId]){i.push(r),o.add(r.id);continue}}if(n?.includeElementsInFrames){let r=[];return i.forEach(a=>{ee(a)&&An(e,a.id).forEach(s=>!o.has(s.id)&&r.push(s)),r.push(a)}),r}return i},X3=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:Ft(e,t,{includeBoundTextElement:!0}),Ca=(e,t)=>em(t.selectedElementIds,e)?t.selectedElementIds:e,im=(e,t)=>{let n=e.filter(ne);if(n.length===1){let o=n[0],i=o.boundElements?.map(a=>a.id)??[];if(e.every(a=>a.id===o.id||i.includes(a.id)))return new D(o,Jh(t))}return null},$3=(e,t,n)=>({selectedLinearElement:im(e,t),...Sd({editingGroupId:n.editingGroupId,selectedElementIds:om(e).reduce((o,i)=>(xe(i)||(o[i.id]=!0),o),{})},t,n,null)}),Z3=(e,t)=>t.editingTextElement||e.length===1&&te(e[0])&&e[0]||null;var rm=(e,t,n)=>{let o=n.reduce((i,r)=>(r.groupIds.includes(e)&&(i[r.id]=!0),i),{});return Object.keys(o).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...o}}},Sd=function(){let e=null,t=null,n=null,o=(r,a,s,l)=>{if(n!==void 0&&a===t&&r===e&&s.editingGroupId===n?.editingGroupId)return n;let d={};for(let h of r){let m=h.groupIds;if(s.editingGroupId){let g=m.indexOf(s.editingGroupId);g>-1&&(m=m.slice(0,g))}if(m.length>0){let g=m[m.length-1];d[g]=!0}}let c={},u=a.reduce((h,m)=>{if(m.isDeleted)return h;let g=m.groupIds.find(f=>d[f]);return g&&(h[m.id]=!0,Array.isArray(c[g])?c[g].push(m.id):c[g]=[m.id]),h},{});for(let h of Object.keys(c))c[h].length<2&&d[h]&&(d[h]=!1);return t=a,e=r,n={editingGroupId:s.editingGroupId,selectedGroupIds:d,selectedElementIds:Ca({...s.selectedElementIds,...u},l)},n},i=(r,a,s,l)=>{let d=l?l.scene.getSelectedElements({selectedElementIds:r.selectedElementIds,elements:a}):Ft(a,r);return d.length?o(d,a,r,s):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:Ca(r.selectedElementIds,s)}};return i.clearCache=()=>{t=null,e=null,n=null},i}(),am=(e,t)=>Ba(e,t)!=null,Ba=(e,t)=>t.groupIds.filter(n=>n!==e.editingGroupId).find(n=>e.selectedGroupIds[n]),sm=e=>Object.entries(e.selectedGroupIds).filter(([t,n])=>n).map(([t,n])=>t),Id=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let o of e){let i=o.groupIds;if(t.editingGroupId){let r=i.indexOf(t.editingGroupId);r>-1&&(i=i.slice(0,r))}if(i.length>0){let r=i[i.length-1];n={...n,...rm(r,n,e)}}}return n.selectedGroupIds},tw=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),lm=(e,t)=>e.groupIds.includes(t),ze=(e,t)=>{let n=[];for(let o of e.values())lm(o,t)&&n.push(o);return n},dm=(e,t)=>e.groupIds.find(n=>t[n]),nw=(e,t,n)=>{let o=[...e],i=n?o.indexOf(n):-1,r=i>-1?i:o.length;return o.splice(r,0,t),o},ow=(e,t)=>e.filter(n=>!t[n]),Ki=(e,t)=>{let n=new Map;return e.forEach(o=>{let i=o.groupIds.length===0?o.id:o.groupIds[o.groupIds.length-1],r=n.get(i)||[],a=Q(o,t);a&&r.push(a),n.set(i,[...r,o])}),Array.from(n.values())},kd=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let o of n.groupIds??[])t.add(o);return t},Td=e=>{let t=e.flatMap(i=>i.groupIds),n=new Map,o=0;for(let i of t)n.set(i,(n.get(i)??0)+1),n.get(i)>o&&(o=n.get(i));return o===e.length},Ld=e=>e.groupIds.length>0,Cd=(e,t,n)=>{let o=[...e],i=t?e.indexOf(t):-1,r=i>-1?i:e.length;for(let a=0;a<r;a++)o[a]=n(o[a]);return o},Qi=(e,t,n)=>{let o=sm(n),i=e.filter(u=>!xe(u)),r=new Map,a=new Map,s=u=>{let h=a.get(u.id)||[],m=Q(u,t);m&&h.push(m),a.set(u.id,[...h,u])},l=(u,h)=>{let m=r.get(h)||[],g=Q(u,t);g&&m.push(g),r.set(h,[...m,u])},d=(u,h)=>{let m=u.groupIds.indexOf(h,0);return u.groupIds.slice(0,m).length>0?l(u,u.groupIds[m-1]):s(u)},c=e.every(u=>am(n,u));return i.forEach(u=>{let h=dm(u,n.selectedGroupIds);h?o.length===1&&c?d(u,h):l(u,h):s(u)}),Array.from(r.values()).concat(Array.from(a.values()))};var Da=(e,t)=>e.frameId===t||e.id===t,Rd=(e,t,n)=>{let o=[],i=[],r=null,a=-1,s=Dd(n||Ft(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++a<e.length;){let l=e[a];s.get(l.id)?(i.length&&(o=o.concat(i),i=[]),o.push(a),r=a+1):l.isDeleted&&r===a?(r=a+1,i.push(a)):i=[]}return o},cm=e=>{let t=0;return e.reduce((n,o,i)=>(i>0&&e[i-1]!==o-1&&(t=++t),(n[t]||(n[t]=[])).push(o),n),[])},Bd=(e,t,n,o)=>{if("containerId"in e&&e.containerId){let i=o.getElement(e.containerId);if(i)return n==="left"?Math.min(t.indexOf(i),t.indexOf(e)):Math.max(t.indexOf(i),t.indexOf(e))}else{let i=e.boundElements?.find(r=>r.type!=="arrow")?.id;if(i){let r=o.getElement(i);if(r)return n==="left"?Math.min(t.indexOf(r),t.indexOf(e)):Math.max(t.indexOf(r),t.indexOf(e))}}},um=(e,t)=>{let n=-1,o=-1;return e.forEach((i,r)=>{Da(i,t)&&(n===-1&&(n=r),o=r)}),n===-1?[]:e.slice(n,o+1)},Yo=(e,t,n,o,i,r)=>{let a=r||Kt(e,n,o);if(!a)return n;let s=Q(a,o),l=te(a)?De(a,o):null,d=[a.id,s?.id,l?.id].filter(h=>!!h),c=n.findIndex(h=>d.includes(h.id)),u=n.findIndex(h=>h.id===t.id);if(u!==-1&&c!==-1&&u<c){let h=Array.from(n),m=h.splice(u,1)[0];h.splice(c,0,m),i.replaceAllElements(h)}return n},pm=(e,t,n,o,i,r)=>{let a=t[n],s=h=>h.isDeleted?!1:i?h.frameId===i:e.editingGroupId?h.groupIds.includes(e.editingGroupId):!0,l=o==="left"?Od(t,h=>s(h),Math.max(0,n-1)):Gd(t,h=>s(h),n+1),d=t[l];if(!d)return-1;if(e.editingGroupId){if(a?.groupIds.join("")===d?.groupIds.join(""))return Bd(d,t,o,r)??l;if(!d?.groupIds.includes(e.editingGroupId))return-1}if(!i&&(d.frameId||ee(d))){let h=um(t,d.frameId||d.id);return o==="left"?t.indexOf(h[0]):t.indexOf(h[h.length-1])}if(!d.groupIds.length)return Bd(d,t,o,r)??l;let c=e.editingGroupId?d.groupIds[d.groupIds.indexOf(e.editingGroupId)-1]:d.groupIds[d.groupIds.length-1],u=ze(t,c);return u.length?o==="left"?t.indexOf(u[0]):t.indexOf(u[u.length-1]):l},Fd=(e,t)=>t.reduce((n,o)=>{let i=e[o];return n.set(i.id,i),n},new Map),Nd=(e,t,n,o)=>{let i=Rd(e,t),r=Fd(e,i),a=cm(i);n==="right"&&(a=a.reverse());let s=new Set(i.filter(l=>ee(e[l])).map(l=>e[l].id));return a.forEach((l,d)=>{let c=l[0],u=l[l.length-1],h=n==="left"?c:u,m=l.some(w=>{let M=e[w];return M.frameId&&s.has(M.frameId)})?null:e[h]?.frameId,g=pm(t,e,h,n,m,o);if(g===-1||h===g)return;let f=n==="left"?e.slice(0,g):e.slice(0,c),E=e.slice(c,u+1),x=n==="left"?e.slice(g,c):e.slice(u+1,g+1),y=n==="left"?e.slice(u+1):e.slice(g+1);e=n==="left"?[...f,...E,...x,...y]:[...f,...x,...E,...y]}),Yn(e,r),e},Hd=(e,t,n,o,i)=>{let r=Rd(e,t,i),a=Fd(e,r),s=[],l,d;if(n==="left"){if(o)l=Gd(e,g=>Da(g,o));else if(t.editingGroupId){let g=ze(e,t.editingGroupId);if(!g.length)return e;l=e.indexOf(g[0])}else l=0;d=r[r.length-1]}else{if(o)d=Od(e,g=>Da(g,o));else if(t.editingGroupId){let g=ze(e,t.editingGroupId);if(!g.length)return e;d=e.indexOf(g[g.length-1])}else d=e.length-1;l=r[0]}l===-1&&(l=0);for(let g=l;g<d+1;g++)r.includes(g)||s.push(e[g]);let c=Array.from(a.values()),u=e.slice(0,l),h=e.slice(d+1),m=n==="left"?[...u,...c,...s,...h]:[...u,...s,...c,...h];return Yn(m,a),m};function zd(e,t,n,o){let i=Dd(Ft(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),r={regularElements:[],frameChildren:new Map},a=new Set;for(let d of e)i.has(d.id)&&ee(d)&&a.add(d.id);for(let d of e)if(i.has(d.id))if(ee(d)||d.frameId&&a.has(d.frameId))r.regularElements.push(d);else if(!d.frameId)r.regularElements.push(d);else{let c=r.frameChildren.get(d.frameId)||[];c.push(d),r.frameChildren.set(d.frameId,c)}let s=e,l=Array.from(r.frameChildren.entries());for(let[d,c]of l)s=o(e,t,n,d,c);return o(s,t,n,null,r.regularElements)}var hw=(e,t,n)=>Nd(e,t,"left",n),mw=(e,t,n)=>Nd(e,t,"right",n),fw=(e,t)=>zd(e,t,"left",Hd),gw=(e,t)=>zd(e,t,"right",Hd);var Ga=({points:e})=>{let t=e[0][0],n=e[0][1];return{points:e.map(o=>F(o[0]-t,o[1]-n)),offsetX:t,offsetY:n}},D=class e{elementId;selectedPointsIndices;initialState;isDragging;lastUncommittedPoint;lastCommittedPoint;pointerOffset;hoverPointIndex;segmentMidPointHoveredCoords;hoveredFocusPointBinding;draggedFocusPointBinding;elbowed;customLineAngle;isEditing;pointerDownState;constructor(t,n,o=!1){this.elementId=t.id,_d(t.points[0],F(0,0))||(console.error("Linear element is not normalized",Error().stack),Te(t,n,e.getNormalizeElementPointsAndCoords(t))),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.lastCommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.initialState={prevSelectedPointsIndices:null,lastClickedPoint:-1,origin:null,segmentMidpoint:{value:null,index:null,added:!1},arrowStartIsInside:!1,altFocusPoint:null},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.hoveredFocusPointBinding=null,this.draggedFocusPointBinding=null,this.elbowed=Y(t)&&t.elbowed,this.customLineAngle=null,this.isEditing=o}static POINT_HANDLE_SIZE=10;static getElement(t,n){let o=n.get(t);return o||null}static handleBoxSelection(t,n,o,i){if(!n.selectedLinearElement?.isEditing||!n.selectionElement)return!1;let{selectedLinearElement:r}=n,{selectedPointsIndices:a,elementId:s}=r,l=e.getElement(s,i);if(!l)return!1;let[d,c,u,h]=K(n.selectionElement,i),g=e.getPointsGlobalCoordinates(l,i).reduce((f,E,x)=>((E[0]>=d&&E[0]<=u&&E[1]>=c&&E[1]<=h||t.shiftKey&&a?.includes(x))&&f.push(x),f),[]).filter(f=>!(Y(l)&&f!==0&&f!==l.points.length-1));o({selectedLinearElement:{...r,selectedPointsIndices:g.length?g:null}})}static handlePointerMove(t,n,o,i,r){let a=n.scene.getNonDeletedElementsMap(),s=n.scene.getNonDeletedElements(),{elementId:l}=r,d=e.getElement(l,a);Ke(d,"Element being dragged must exist in the scene"),Ke(d.points.length>1,"Element must have at least 2 points");let c=d.points.length-1,u=d.points[c],h=d.points[c-1],m=r.customLineAngle??Yd(h,d.points[c]),g=0,f=0;if(Uo(t)){let[b,S]=e._getShiftLockedDelta(d,a,h,F(o,i),t[Un.CTRL_OR_CMD]?null:n.getEffectiveGridSize(),m),v=F(b+h[0],S+h[1]);g=v[0]-u[0],f=v[1]-u[1]}else{let b=e.createPointAt(d,a,o-r.pointerOffset.x,i-r.pointerOffset.y,t[Un.CTRL_OR_CMD]?null:n.getEffectiveGridSize());g=b[0]-u[0],f=b[1]-u[1]}let E=null,{positions:x,updates:y}=Vd([c],g,f,o,i,a,d,s,n,Uo(t),t.altKey,r);if(e.movePoints(d,n.scene,x,{startBinding:y?.startBinding,endBinding:y?.endBinding,moveMidPointsWithElement:y?.moveMidPointsWithElement},{isBindingEnabled:n.state.isBindingEnabled,isMidpointSnappingEnabled:n.state.isMidpointSnappingEnabled}),Be(d,!1)&&Ot(n.state)&&(E=y?.suggestedBinding??null),Be(d)&&Yo(e.getPointGlobalCoordinates(d,d.points[d.points.length-1],a),d,s,a,n.scene),n.state.selectedLinearElement?.customLineAngle===m&&r.initialState.altFocusPoint&&(!E||Em(n.state.suggestedBinding??[],E)))return null;let w=Be(d)&&d.startBinding&&a.get(d.startBinding.elementId);return{selectedLinearElement:{...r,customLineAngle:m,initialState:{...r.initialState,altFocusPoint:!r.initialState.altFocusPoint&&w&&y?.suggestedBinding?.element.id!==w.id?eo(d,F(d.x,d.y),w,"start",a,n.state.zoom,n.state.isMidpointSnappingEnabled):r.initialState.altFocusPoint}},suggestedBinding:E}}static handlePointDragging(t,n,o,i,r){let a=n.scene.getNonDeletedElementsMap(),s=n.scene.getNonDeletedElements(),{elbowed:l,elementId:d,initialState:c}=r,u=Array.from(r.selectedPointsIndices??[]),{lastClickedPoint:h}=c,m=e.getElement(d,a);Ke(m,"Element being dragged must exist in the scene"),Ke(m.points.length>1,"Element must have at least 2 points"),Ke(u,"There must be selected points in order to drag them"),l&&u.some((A,_)=>A>0&&A!==m.points.length-1?(u[_]=m.points.length-1,h=m.points.length-1,!0):!1),(h<0||!u.includes(h)||!m.points[h])&&(console.error(`There must be a valid lastClickedPoint in order to drag it. selectedPointsIndices(${JSON.stringify(u)}) points(0..${m.points.length-1}) lastClickedPoint(${h}) isElbowArrow: ${l}`),h=m.points.length-1);let g=m.points[h],f=m.points[h===0?1:h-1],E=u.length===1,x=r.customLineAngle??Yd(f,m.points[h]),y=u.includes(0),w=u.includes(m.points.length-1),M=0,b=0;if(Uo(t)&&E){let[A,_]=e._getShiftLockedDelta(m,a,f,F(o,i),t[Un.CTRL_OR_CMD]?null:n.getEffectiveGridSize(),x),X=F(A+f[0],_+f[1]);M=X[0]-g[0],b=X[1]-g[1]}else{let A=e.createPointAt(m,a,o-r.pointerOffset.x,i-r.pointerOffset.y,t[Un.CTRL_OR_CMD]?null:n.getEffectiveGridSize());M=A[0]-g[0],b=A[1]-g[1]}let S=null,{positions:v,updates:k}=Vd(u,M,b,o,i,a,m,s,n,Uo(t)&&E,t.altKey,r);e.movePoints(m,n.scene,v,{startBinding:k?.startBinding,endBinding:k?.endBinding,moveMidPointsWithElement:k?.moveMidPointsWithElement},{isBindingEnabled:n.state.isBindingEnabled,isMidpointSnappingEnabled:n.state.isMidpointSnappingEnabled}),Be(m,!1)&&Ot(n.state)&&(y||w)&&(S=k?.suggestedBinding??null),Be(m)&&y!==w&&Yo(e.getPointGlobalCoordinates(m,y?m.points[0]:m.points[m.points.length-1],a),m,s,a,n.scene),Q(m,a)&&jn(m,n.scene,!1);let R=l?w?[m.points.length-1]:[0]:u,O=l?R[0]:h,N=!y&&!w?e.getPointGlobalCoordinates(m,g,a):null,G=O,q=Be(m)&&m.startBinding&&a.get(m.startBinding.elementId),U=Be(m)&&m.endBinding&&a.get(m.endBinding.elementId),le=w&&q&&k?.suggestedBinding?.element.id!==q.id?q:y&&U&&k?.suggestedBinding?.element.id!==U.id?U:null;return{selectedLinearElement:{...r,selectedPointsIndices:R,initialState:{...r.initialState,lastClickedPoint:O,altFocusPoint:!r.initialState.altFocusPoint&&Be(m)&&le?eo(m,F(m.x,m.y),le,"start",a,n.state.zoom,n.state.isMidpointSnappingEnabled):r.initialState.altFocusPoint},segmentMidPointHoveredCoords:N,hoverPointIndex:G,isDragging:!0,customLineAngle:x},suggestedBinding:S}}static handlePointerUp(t,n,o,i){let r=i.getNonDeletedElementsMap(),{elementId:a,selectedPointsIndices:s,isDragging:l,initialState:d}=n,c=e.getElement(a,r);if(!c)return n;if(l&&s)for(let u of s)(u===0||u===c.points.length-1)&&Ut(c.points,o.zoom.value)&&(jt(c)&&i.mutateElement(c,{...Ud(c,!0)},{informMutation:!1,isDragging:!1}),e.movePoints(c,i,new Map([[u,{point:u===0?c.points[c.points.length-1]:c.points[0]}]])));return{...n,segmentMidPointHoveredCoords:null,hoverPointIndex:-1,selectedPointsIndices:l||t.shiftKey?!l&&t.shiftKey&&d.prevSelectedPointsIndices?.includes(d.lastClickedPoint)?s&&s.filter(u=>u!==d.lastClickedPoint):s:s?.includes(d.lastClickedPoint)?[d.lastClickedPoint]:s,isDragging:!1,customLineAngle:null,initialState:{...n.initialState,origin:null,arrowStartIsInside:!1}}}static getEditorMidPoints=(t,n,o)=>{let i=Q(t,n);if(!Y(t)&&!o.selectedLinearElement?.isEditing&&t.points.length>2&&!i)return[];let r=e.getPointsGlobalCoordinates(t,n),a=0,s=[];for(;a<r.length-1;){if(e.isSegmentTooShort(t,t.points[a],t.points[a+1],a,o.zoom,n)){s.push(null),a++;continue}let l=e.getSegmentMidPoint(t,a+1,n);s.push(l),a++}return s};static getSegmentMidpointHitCoords=(t,n,o,i)=>{let{elementId:r}=t,a=e.getElement(r,i);if(!a)return null;let s=e.getPointIndexUnderCursor(a,i,o.zoom,n.x,n.y);if(!Y(a)&&s>=0||e.getPointsGlobalCoordinates(a,i).length>=3&&!o.selectedLinearElement?.isEditing&&!Y(a))return null;let d=(e.POINT_HANDLE_SIZE+1)/o.zoom.value,c=t.segmentMidPointHoveredCoords;if(c&&Xn(F(c[0],c[1]),F(n.x,n.y))<=d)return c;let u=0,h=e.getEditorMidPoints(a,i,o);for(;u<h.length;){if(h[u]!==null&&Xn(h[u],F(n.x,n.y))<=d)return h[u];u++}return null};static isSegmentTooShort(t,n,o,i,r,a){if(Y(t))return i>=0&&i<t.points.length?Xn(n,o)*r.value<e.POINT_HANDLE_SIZE/2:!1;let s=Xn(n,o);if(t.points.length>2&&t.roundness){let[l,d]=Wn(t,a);Ke(l.length===0&&d.length>0,"Only linears built out of curves are supported"),Ke(l.length+d.length>=i,"Invalid segment index while calculating mid point"),s=mm(d[i])}return s*r.value<e.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,o){if(Y(t)){Ke(t.points.length>=n,"Invalid segment index while calculating elbow arrow mid point");let a=Wd(t.points[n-1],t.points[n]);return F(t.x+a[0],t.y+a[1])}let[i,r]=Wn(t,o);if(Ke(i.length===0&&r.length>0||i.length>0&&r.length===0,"Only linears built out of either segments or curves are supported"),Ke(i.length+r.length>=n,"Invalid segment index while calculating mid point"),i.length){let a=i[n-1];return Wd(a[0],a[1])}if(r.length){let a=r[n-1];return fm(a,.5)}Ke(!1,"Invalid segment type while calculating mid point")}static getSegmentMidPointIndex(t,n,o,i){let r=e.getElement(t.elementId,i);if(!r)return-1;let a=e.getEditorMidPoints(r,i,n),s=0;for(;s<a.length;){if(e.arePointsEqual(o,a[s]))return s+1;s++}return-1}static handlePointerDown(t,n,o,i,r,a){let s=n.state,l=a.getNonDeletedElementsMap(),d={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!r)return d;let{elementId:c}=r,u=e.getElement(c,l);if(!u)return d;let h=e.getSegmentMidpointHitCoords(r,i,s,l),m=F(i.x,i.y),g=null;if(h)g=e.getSegmentMidPointIndex(r,s,h,l);else if(t.altKey&&s.selectedLinearElement?.isEditing)return r.lastUncommittedPoint==null&&(a.mutateElement(u,{points:[...u.points,e.createPointAt(u,l,i.x,i.y,t[Un.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),d.didAddPoint=!0),o.scheduleCapture(),d.linearElementEditor={...r,initialState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:-1,origin:m,segmentMidpoint:{value:h,index:g,added:!1},arrowStartIsInside:!!n.state.newElement&&(n.state.bindMode==="inside"||n.state.bindMode==="skip"),altFocusPoint:null},selectedPointsIndices:[u.points.length-1],lastUncommittedPoint:null},d.didAddPoint=!0,d;let f=e.getPointIndexUnderCursor(u,l,s.zoom,i.x,i.y);(f>=0||h)&&(d.hitElement=u);let[E,x,y,w]=K(u,l),M=(E+y)/2,b=(x+w)/2,S=f>-1&&_e(F(u.x+u.points[f][0],u.y+u.points[f][1]),F(M,b),u.angle),v=f>-1||t.shiftKey?t.shiftKey||r.selectedPointsIndices?.includes(f)?xm([...r.selectedPointsIndices||[],f]):[f]:null;return d.linearElementEditor={...r,initialState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:f,origin:m,segmentMidpoint:{value:h,index:g,added:!1},arrowStartIsInside:!!n.state.newElement&&(n.state.bindMode==="inside"||n.state.bindMode==="skip"),altFocusPoint:null},selectedPointsIndices:v,pointerOffset:S?{x:i.x-S[0],y:i.y-S[1]}:{x:0,y:0}},d}static arePointsEqual(t,n){return!t&&!n?!0:!t||!n?!1:_d(t,n)}static handlePointerMoveInEditMode(t,n,o,i){let r=i.state;if(!r.selectedLinearElement?.isEditing)return null;let{elementId:a,lastUncommittedPoint:s}=r.selectedLinearElement,l=i.scene.getNonDeletedElementsMap(),d=e.getElement(a,l);if(!d)return r.selectedLinearElement;let{points:c}=d,u=c[c.length-1];if(!t.altKey)return u===s&&e.deletePoints(d,i,[c.length-1]),r.selectedLinearElement?.lastUncommittedPoint?{...r.selectedLinearElement,lastUncommittedPoint:null}:r.selectedLinearElement;let h;if(Uo(t)&&c.length>=2){let m=c[c.length-2],[g,f]=e._getShiftLockedDelta(d,l,m,F(n,o),t[Un.CTRL_OR_CMD]?null:i.getEffectiveGridSize());h=F(g+m[0],f+m[1])}else h=e.createPointAt(d,l,n-r.selectedLinearElement.pointerOffset.x,o-r.selectedLinearElement.pointerOffset.y,t[Un.CTRL_OR_CMD]||Y(d)?null:i.getEffectiveGridSize());return u===s?e.movePoints(d,i.scene,new Map([[d.points.length-1,{point:h}]])):e.addPoints(d,i.scene,[h]),{...r.selectedLinearElement,lastUncommittedPoint:d.points[d.points.length-1]}}static getPointGlobalCoordinates(t,n,o){let[i,r,a,s]=K(t,o),l=(i+a)/2,d=(r+s)/2,{x:c,y:u}=t;return _e(F(c+n[0],u+n[1]),F(l,d),t.angle)}static getPointsGlobalCoordinates(t,n){let[o,i,r,a]=K(t,n),s=(o+r)/2,l=(i+a)/2;return t.points.map(d=>{let{x:c,y:u}=t;return _e(F(c+d[0],u+d[1]),F(s,l),t.angle)})}static getPointAtIndexGlobalCoordinates(t,n,o){let i=n<0?t.points.length+n:n,[,,,,r,a]=K(t,o),s=F(r,a),l=t.points[i],{x:d,y:c}=t;return l?_e(F(d+l[0],c+l[1]),s,t.angle):_e(F(d,c),s,t.angle)}static pointFromAbsoluteCoords(t,n,o){if(Y(t))return F(n[0]-t.x,n[1]-t.y);let[i,r,a,s]=K(t,o),l=(i+a)/2,d=(r+s)/2,[c,u]=_e(F(n[0],n[1]),F(l,d),-t.angle);return F(c-t.x,u-t.y)}static getPointIndexUnderCursor(t,n,o,i,r){let a=e.getPointsGlobalCoordinates(t,n),s=a.length;for(;--s>-1;){let l=a[s];if(Xn(F(i,r),F(l[0],l[1]))*o.value<e.POINT_HANDLE_SIZE+1)return s}return-1}static createPointAt(t,n,o,i,r){let a=jd(o,i,r),[s,l,d,c]=K(t,n),u=(s+d)/2,h=(l+c)/2,[m,g]=_e(F(a[0],a[1]),F(u,h),-t.angle);return F(m-t.x,g-t.y)}static getNormalizeElementPointsAndCoords(t){let{points:n,offsetX:o,offsetY:i}=Ga(t);return{points:n,x:t.x+o,y:t.y+i}}static duplicateSelectedPoints(t,n){Ke(t.selectedLinearElement?.isEditing,"Not currently editing a linear element");let o=n.getNonDeletedElementsMap(),{selectedPointsIndices:i,elementId:r}=t.selectedLinearElement,a=e.getElement(r,o);Ke(a,"The linear element does not exist in the provided Scene"),Ke(i!=null,"There are no selected points to duplicate");let{points:s}=a,l=[],d=!1,c=-1,u=s.reduce((h,m,g)=>{if(++c,h.push(m),i.includes(g)){let E=s[g+1];E||(d=!0),h.push(E?F((m[0]+E[0])/2,(m[1]+E[1])/2):F(m[0],m[1])),l.push(c+1),++c}return h},[]);if(n.mutateElement(a,{points:u}),d){let h=a.points[a.points.length-1];e.movePoints(a,n,new Map([[a.points.length-1,{point:F(h[0]+30,h[1]+30)}]]))}return{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:l}}}static deletePoints(t,n,o){let i=n.state.selectedLinearElement?.isEditing&&n.state.selectedLinearElement?.lastUncommittedPoint===t.points[t.points.length-1],r=t.points.filter((c,u)=>!o.includes(u));jt(t)&&t.polygon&&(i||o.includes(0)||o.includes(t.points.length-1))&&(r[0]=F(r[r.length-1][0],r[r.length-1][1]));let{points:s,offsetX:l,offsetY:d}=Ga({points:r});e._updatePoints(t,n.scene,s,l,d)}static addPoints(t,n,o){let i=[...t.points,...o];jt(t)&&t.polygon&&(i[0]=F(i[i.length-1][0],i[i.length-1][1]));let{points:r,offsetX:a,offsetY:s}=Ga({points:i});e._updatePoints(t,n,r,a,s)}static movePoints(t,n,o,i,r){let{points:a}=t;if(jt(t)&&t.polygon){let u=o.get(0),h=o.get(a.length-1);u?o.set(a.length-1,{point:F(u.point[0],u.point[1]),isDragging:u.isDragging}):h&&o.set(0,{point:F(h.point[0],h.point[1]),isDragging:h.isDragging})}let s=o.get(0)?.point??F(0,0),[l,d]=s,c=Y(t)?[o.get(0)?.point??a[0],o.get(a.length-1)?.point??a[a.length-1]]:a.map((u,h)=>{let m=o.get(h)?.point??u;return i?.moveMidPointsWithElement&&h!==0&&h!==a.length-1&&!o.has(h)?m:F(m[0]-l,m[1]-d)});e._updatePoints(t,n,c,l,d,i,{isDragging:Array.from(o.values()).some(u=>u.isDragging),isBindingEnabled:r?.isBindingEnabled,isMidpointSnappingEnabled:r?.isMidpointSnappingEnabled})}static shouldAddMidpoint(t,n,o,i){let r=e.getElement(t.elementId,i);if(r&&Y(r)||!r)return!1;let{segmentMidpoint:a}=t.initialState;if(a.added||a.value===null||a.index===null||t.initialState.origin===null)return!1;let s=t.initialState.origin,l=Xn(s,F(n.x,n.y));return!(!o.selectedLinearElement?.isEditing&&l<gm/o.zoom.value)}static addMidpoint(t,n,o,i,r){let a=r.getNonDeletedElementsMap(),s=e.getElement(t.elementId,a);if(!s)return;let{segmentMidpoint:l}=t.initialState,d={pointerDownState:t.initialState,selectedPointsIndices:t.selectedPointsIndices},c=e.createPointAt(s,a,n.x,n.y,i&&!Y(s)?o.getEffectiveGridSize():null),u=[...s.points.slice(0,l.index),c,...s.points.slice(l.index)];return r.mutateElement(s,{points:u}),d.pointerDownState={...t.initialState,segmentMidpoint:{...t.initialState.segmentMidpoint,added:!0},lastClickedPoint:l.index},d.selectedPointsIndices=[l.index],d}static _updatePoints(t,n,o,i,r,a,s){if(Y(t)){let l={};a?.startBinding!==void 0&&(l.startBinding=a.startBinding),a?.endBinding!==void 0&&(l.endBinding=a.endBinding),l.points=Array.from(o),n.mutateElement(t,l,{informMutation:!0,isDragging:s?.isDragging??!1,isBindingEnabled:s?.isBindingEnabled,isMidpointSnappingEnabled:s?.isMidpointSnappingEnabled})}else{let l=Oa(t,o),d=Oa(t,t.points),c=(l[0]+l[2])/2,u=(l[1]+l[3])/2,h=(d[0]+d[2])/2,m=(d[1]+d[3])/2,g=h-c,f=m-u,E=_e(F(i,r),F(g,f),t.angle);n.mutateElement(t,{...a,points:o,x:t.x+E[0],y:t.y+E[1]})}}static _getShiftLockedDelta(t,n,o,i,r,a){let s=e.getPointGlobalCoordinates(t,o,n);if(Y(t))return[i[0]-s[0],i[1]-s[1]];let[l,d]=jd(i[0],i[1],r),{width:c,height:u}=Xd(s[0],s[1],l,d,a);return _e(F(c,u),F(0,0),-t.angle)}static getBoundTextElementPosition=(t,n,o)=>{e.getPointsGlobalCoordinates(t,o).length<2&&Te(n,o,{isDeleted:!0});let r=0,a=0;if(t.points.length%2===1){let s=Math.floor(t.points.length/2),l=e.getPointGlobalCoordinates(t,t.points[s],o);r=l[0]-n.width/2,a=l[1]-n.height/2}else{let s=t.points.length/2-1,l=e.getSegmentMidPoint(t,s+1,o);r=l[0]-n.width/2,a=l[1]-n.height/2}return{x:r,y:a}};static getMinMaxXYWithBoundText=(t,n,o,i)=>{let[r,a,s,l]=o,d=(r+s)/2,c=(a+l)/2,{x:u,y:h}=e.getBoundTextElementPosition(t,i,n),m=u+i.width,g=h+i.height,f=F(d,c),E=_e(F(r,a),f,t.angle),x=_e(F(s,a),f,t.angle),y=_e(F(u,h),f,-t.angle),w=_e(F(m,h),f,-t.angle),M=_e(F(u,g),f,-t.angle),b=_e(F(m,g),f,-t.angle);return E[0]<x[0]&&E[1]>=x[1]?(r=Math.min(r,M[0]),s=Math.max(s,Math.max(w[0],b[0])),a=Math.min(a,y[1]),l=Math.max(l,b[1])):E[0]>=x[0]&&E[1]>x[1]?(r=Math.min(r,b[0]),s=Math.max(s,Math.max(y[0],w[0])),a=Math.min(a,M[1]),l=Math.max(l,w[1])):E[0]>=x[0]?(r=Math.min(r,w[0]),s=Math.max(s,M[0]),a=Math.min(a,b[1]),l=Math.max(l,y[1])):E[1]<=x[1]&&(r=Math.min(r,Math.min(w[0],y[0])),s=Math.max(s,b[0]),a=Math.min(a,w[1]),l=Math.max(l,M[1])),[r,a,s,l,d,c]};static getElementAbsoluteCoords=(t,n,o=!1)=>{let i=at.generateElementShape(t,null),r=Wt(i[0]),[a,s,l,d]=Xo(r),c=a+t.x,u=s+t.y,h=l+t.x,m=d+t.y,g=(c+h)/2,f=(u+m)/2,E=o&&Q(t,n);return E?e.getMinMaxXYWithBoundText(t,n,[c,u,h,m],E):[c,u,h,m,g,f]};static moveFixedSegment(t,n,o,i,r){let a=r.getNonDeletedElementsMap(),s=e.getElement(t.elementId,a);if(!s||!Y(s))return t;if(n&&n>0&&n<s.points.length){let l=qe(Jt(hm(s.points[n],s.points[n-1]))),d=(s.fixedSegments??[]).reduce((m,g)=>(m[g.index]=g,m),{});d[n]={index:n,start:F(l?s.points[n-1][0]:o-s.x,l?i-s.y:s.points[n-1][1]),end:F(l?s.points[n][0]:o-s.x,l?i-s.y:s.points[n][1])};let c=Object.values(d).sort((m,g)=>m.index-g.index),u=c.map(m=>m.index).reduce((m,g)=>g<n?m+1:m,0);r.mutateElement(s,{fixedSegments:c});let h=F(s.x+(s.fixedSegments[u].start[0]+s.fixedSegments[u].end[0])/2,s.y+(s.fixedSegments[u].start[1]+s.fixedSegments[u].end[1])/2);return{...t,segmentMidPointHoveredCoords:h,initialState:{...t.initialState,segmentMidpoint:{added:!1,index:s.fixedSegments[u].index,value:h}}}}return t}static deleteFixedSegment(t,n,o){n.mutateElement(t,{fixedSegments:t.fixedSegments?.filter(i=>i.index!==o)})}},xm=e=>{let t=[...new Set(e.filter(n=>n!==null&&n!==-1))];return t=t.sort((n,o)=>n-o),t.length?t:null},Vd=(e,t,n,o,i,r,a,s,l,d,c,u)=>{let h=new Map(e.map(U=>{let le=a.points[U]??a.points.at(-1);return[U,{point:F(le[0]+t,le[1]+n),isDragging:!0}]}));if(!j(a))return{positions:h};let m=e.includes(0),g=e.includes(a.points.length-1),{start:f,end:E}=ba(a,h,o,i,r,s,l.state,{newArrow:!!l.state.newElement,angleLocked:d,altKey:c});if(Y(a)){let U=m?f.element:g?E.element:null;return{positions:h,updates:{suggestedBinding:U?{element:U,midPoint:l.state.isMidpointSnappingEnabled?Ma(U,r,F(o-u.pointerOffset.x,i-u.pointerOffset.y)):void 0}:null}}}if(!m&&!g){let U={...a,points:a.points.map((H,A)=>h.get(A)?.point??H)},le=new Map(h);if(a.startBinding){let H=r.get(a.startBinding.elementId);if(H){let A=bt(U,"startBinding",a.startBinding,H,r)??null;A&&le.set(0,{point:A,isDragging:!0})}}if(a.endBinding){let H=r.get(a.endBinding.elementId);if(H){let A=bt(U,"endBinding",a.endBinding,H,r)??null;A&&le.set(a.points.length-1,{point:A,isDragging:!0})}}return{positions:le}}if(m===g)return{positions:h};let x={suggestedBinding:null};f.mode===null?x.startBinding=null:f.mode?(x.startBinding={elementId:f.element.id,mode:f.mode,...ro(a,f.element,"start",r,f.focusPoint)},m&&(x.startBinding.mode==="orbit"||!so("COMPLEX_BINDINGS"))&&(x.suggestedBinding=f.element?{element:f.element,midPoint:Si(F(o-u.pointerOffset.x,i-u.pointerOffset.y),f.element,r,l.state.zoom)}:null)):m&&(x.suggestedBinding=l.state.suggestedBinding),E.mode===null?x.endBinding=null:E.mode?(x.endBinding={elementId:E.element.id,mode:E.mode,...ro(a,E.element,"end",r,E.focusPoint)},g&&(x.endBinding.mode==="orbit"||!so("COMPLEX_BINDINGS"))&&(x.suggestedBinding=E.element?{element:E.element,midPoint:Si(F(o-u.pointerOffset.x,i-u.pointerOffset.y),E.element,r,l.state.zoom)}:null)):g&&(x.suggestedBinding=l.state.suggestedBinding);let y=m?F(a.points[0][0]+t,a.points[0][1]+n):a.points[0],w=g?F(a.points[a.points.length-1][0]+t,a.points[a.points.length-1][1]+n):a.points[a.points.length-1],M={...a,points:[y,...a.points.slice(1,-1),w],startBinding:x.startBinding===void 0?a.startBinding:x.startBinding===null?null:x.startBinding,endBinding:x.endBinding===void 0?a.endBinding:x.endBinding===null?null:x.endBinding},b=a.endBinding&&M.startBinding&&m&&M.startBinding.elementId===a.endBinding.elementId,S=a.startBinding&&M.endBinding&&g&&a.startBinding.elementId===M.endBinding.elementId,v=M.endBinding?E.element??r.get(M.endBinding.elementId):null,k=b?M.points[M.points.length-1]:S&&l.state.bindMode!=="inside"&&so("COMPLEX_BINDINGS")?M.points[0]:v&&bt(M,"endBinding",M.endBinding,v,r,g)||M.points[M.points.length-1];M.points[M.points.length-1]=k;let T=M.startBinding?f.element??r.get(M.startBinding.elementId):null,R=S&&so("COMPLEX_BINDINGS")?M.points[0]:b&&l.state.bindMode!=="inside"&&so("COMPLEX_BINDINGS")?k:T&&bt(M,"startBinding",M.startBinding,T,r,m)||M.points[0],O=!b&&!(S&&l.state.bindMode!=="inside"&&so("COMPLEX_BINDINGS"))&&!!v,N=Xn(R,M.points[0])!==0,G=new Set(e);T&&N&&G.add(0),v&&O&&G.add(a.points.length-1);let q=Array.from(G);return{updates:x,positions:new Map(q.map(U=>[U,U===0?{point:R,isDragging:!0}:U===a.points.length-1?{point:k,isDragging:!0}:h.get(U)]))}},Yd=(e,t)=>Math.atan2(t[1]-e[1],t[0]-e[0]);var km=(e,t)=>Hn(e)&&!t.imageCache.has(e.fileId),ir=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;case"arrow":return e.endArrowhead||e.endArrowhead?40:20;default:return 20}},Tm=(e,t,n,o,i=1)=>{let r=(t?.opacity??100)*e.opacity/1e4*i;return(n.has(e.id)||o&&o.some(a=>a.id===e.id)||t&&n.has(t.id))&&(r*=bm/100),r},Lm=(e,t,n)=>{let r=ir(e),[a,s,l,d]=K(e,t),c=ne(e)||Se(e)?kn(a,l):e.width,u=ne(e)||Se(e)?kn(s,d):e.height,h=c*window.devicePixelRatio+r*2,m=u*window.devicePixelRatio+r*2,g=n.value;return(h*g>32767||m*g>32767)&&(g=Math.min(32767/h,32767/m)),h*m*g*g>16777216&&(g=Math.sqrt(16777216/(h*m))),h=Math.floor(h*g),m=Math.floor(m*g),{width:h,height:m,scale:g}},qd=(e,t,n,o,i)=>{let r=document.createElement("canvas"),a=r.getContext("2d"),s=ir(e),{width:l,height:d,scale:c}=Lm(e,t,n);if(!l||!d)return null;r.width=l,r.height=d;let u=-100,h=0;if(ne(e)||Se(e)){let[x,y]=K(e,t);u=e.x>x?kn(e.x,x)*window.devicePixelRatio*c:0,h=e.y>y?kn(e.y,y)*window.devicePixelRatio*c:0,a.translate(u,h)}a.save(),a.translate(s*c,s*c),a.scale(window.devicePixelRatio*c,window.devicePixelRatio*c);let m=Nn.canvas(r);nr(e,m,a,o),a.restore();let g=Q(e,t),f=document.createElement("canvas"),E=f.getContext("2d");if(j(e)&&g){let[x,y,w,M]=K(e,t),b=Math.max(kn(x,w),kn(y,M));f.width=b*window.devicePixelRatio*c+s*c*10,f.height=b*window.devicePixelRatio*c+s*c*10,E.translate(f.width/2,f.height/2),E.rotate(e.angle),E.drawImage(r,-r.width/2,-r.height/2,r.width,r.height);let[,,,,S,v]=K(g,t);E.rotate(-e.angle);let k=(f.width-r.width)/2,T=(f.height-r.height)/2,R=f.width/2-(S-x)*window.devicePixelRatio*c-k-s*c,O=f.height/2-(v-y)*window.devicePixelRatio*c-T-s*c;E.translate(-R,-O),E.clearRect(-(g.width/2+er)*window.devicePixelRatio*c,-(g.height/2+er)*window.devicePixelRatio*c,(g.width+er*2)*window.devicePixelRatio*c,(g.height+er*2)*window.devicePixelRatio*c)}return{element:e,canvas:r,theme:i.theme,scale:c,zoomValue:n.value,canvasOffsetX:u,canvasOffsetY:h,boundTextElementVersion:Q(e,t)?.version||null,containingFrameOpacity:Sn(e,t)?.opacity||100,boundTextCanvas:f,angle:e.angle,imageCrop:Ae(e)?e.crop:null}},Xw=14,Kd=typeof document<"u"?document.createElement("img"):{src:""};Kd.src=`data:${Na.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var Qd=typeof document<"u"?document.createElement("img"):{src:""};Qd.src=`data:${Na.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var Cm=(e,t,n)=>{t.fillStyle=n===lo.DARK?"#2E2E2E":"#E7E7E7",t.fillRect(0,0,e.width,e.height);let o=Math.min(e.width,e.height),i=Math.min(o,Math.min(o*.4,100));t.drawImage(e.status==="error"?Qd:Kd,e.width/2-i/2,e.height/2-i/2,i,i)},nr=(e,t,n,o)=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{n.lineJoin="round",n.lineCap="round",t.draw(at.generateElementShape(e,o));break}case"arrow":case"line":{n.lineJoin="round",n.lineCap="round",at.generateElementShape(e,o).forEach(i=>{t.draw(i)});break}case"freedraw":{n.save();let i=at.generateElementShape(e,o);for(let r of i)typeof r=="string"?(n.fillStyle=or(e.strokeColor,o.theme===lo.DARK),n.fill(new Path2D(r))):t.draw(r);n.restore();break}case"image":{n.save();let i=e.fileId!==null?o.imageCache.get(e.fileId):null,r=Hn(e)?i?.image:void 0;if(r!=null&&!(r instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,Yt(Math.min(e.width,e.height),e)),n.clip());let{x:a,y:s,width:l,height:d}=e.crop?e.crop:{x:0,y:0,width:r.naturalWidth,height:r.naturalHeight},c=o.theme===lo.DARK&&i?.mimeType===Na.svg;if(c&&Am){let u=window.devicePixelRatio||1,h=document.createElement("canvas");h.width=e.width*u,h.height=e.height*u;let m=h.getContext("2d");if(m){m.scale(u,u),m.drawImage(r,a,s,l,d,0,0,e.width,e.height);let g=m.getImageData(0,0,h.width,h.height),f=g.data;for(let E=0;E<f.length;E+=4)f[E]=255-f[E],f[E+1]=255-f[E+1],f[E+2]=255-f[E+2];m.putImageData(g,0,0),n.drawImage(h,0,0,h.width,h.height,0,0,e.width,e.height)}}else c&&(n.filter=Mm),n.drawImage(r,a,s,l,d,0,0,e.width,e.height)}else Cm(e,n,o.theme);n.restore();break}default:if(te(e)){let i=Im(e.text),r=i&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",i?"rtl":"ltr"),n.save(),n.font=Pm(e),n.fillStyle=or(e.strokeColor,o.theme===lo.DARK),n.textAlign=e.textAlign;let a=e.text.replace(/\r\n?/g,`
13
13
  `).split(`
14
- `),s=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,l=Bi(e.fontSize,e.lineHeight),d=Gm(e.fontFamily,e.fontSize,l);for(let c=0;c<a.length;c++)n.fillText(a[c],s,c*l+d);n.restore(),r&&n.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},Ko=new WeakMap,nc=(e,t,n,o)=>{let i=n?o.zoom:{value:1},r=Ko.get(e),a=r&&r.zoomValue!==i.value&&!o?.shouldCacheIgnoreZoom,s=Z(e,t),l=s?.version||null,d=Ae(e)?e.crop:null,c=vn(e,t)?.opacity||100;if(!r||a||r.theme!==o.theme||r.boundTextElementVersion!==l||r.imageCrop!==d||r.containingFrameOpacity!==c||j(e)&&s&&e.angle!==r.angle){let u=oc(e,t,i,n,o);return u?(Ko.set(e,u),u):null}return r},_a=(e,t,n,o,i)=>{let r=e.element,a=dr(r),s=e.scale,[l,d,c,u]=Q(r,i),h=((l+c)/2+o.scrollX)*window.devicePixelRatio,m=((d+u)/2+o.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let f=Z(r,i);if(j(r)&&f){let g=(e.boundTextCanvas.width-e.canvas.width)/2,E=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(h,m),t.drawImage(e.boundTextCanvas,-(c-l)/2*window.devicePixelRatio-g/s-a,-(u-d)/2*window.devicePixelRatio-E/s-a,e.boundTextCanvas.width/s,e.boundTextCanvas.height/s)}else if(t.translate(h,m),t.rotate(r.angle),"scale"in e.element&&!Fm(r,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-h,-m),t.drawImage(e.canvas,(l+o.scrollX)*window.devicePixelRatio-a*e.scale/e.scale,(d+o.scrollY)*window.devicePixelRatio-a*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),C.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX==="true"&&Ct(r)){let g=Z(r,i),E=na(r);t.strokeStyle="#c92a2a",t.lineWidth=3,t.strokeRect((E.x+o.scrollX)*window.devicePixelRatio,(E.y+o.scrollY)*window.devicePixelRatio,yt(r,g)*window.devicePixelRatio,No(r,g)*window.devicePixelRatio)}t.restore()},ub=(e,t,n,o)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let i=.5/n.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=o,t.strokeRect(i,i,e.width,e.height),t.restore()},pb=(e,t,n,o,i,r,a)=>{let s=a.openDialog?.name==="elementLinkSelector"&&!a.selectedElementIds[e.id]&&!a.hoveredElementIds[e.id];switch(i.globalAlpha=Nm(e,vn(e,t),r.elementsPendingErasure,r.pendingFlowchartNodes,s?Tm:1),e.type){case"magicframe":case"frame":{a.frameRendering.enabled&&a.frameRendering.outline&&(i.save(),i.translate(e.x+a.scrollX,e.y+a.scrollY),i.fillStyle="rgba(0, 0, 200, 0.04)",i.lineWidth=qo.strokeWidth/a.zoom.value,i.strokeStyle=a.theme===uo.DARK?lr(qo.strokeColor):qo.strokeColor,hl(e)&&(i.strokeStyle=a.theme===uo.LIGHT?"#7affd7":lr("#1d8264")),qo.radius&&i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,qo.radius/a.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break}case"freedraw":{if(r.isExporting){let[l,d,c,u]=Q(e,t),h=(l+c)/2+a.scrollX,m=(d+u)/2+a.scrollY,f=(c-l)/2-(e.x-l),g=(u-d)/2-(e.y-d);i.save(),i.translate(h,m),i.rotate(e.angle),i.translate(-f,-g),sr(e,o,i,r),i.restore()}else{let l=nc(e,n,r,a);if(!l)return;_a(l,i,r,a,n)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(r.isExporting){let[l,d,c,u]=Q(e,t),h=(l+c)/2+a.scrollX,m=(d+u)/2+a.scrollY,f=(c-l)/2-(e.x-l),g=(u-d)/2-(e.y-d);if(te(e)){let x=De(e,t);if(j(x)){let y=R.getBoundTextElementPosition(x,e,t);f=(c-l)/2-(y.x-l),g=(u-d)/2-(y.y-d)}}i.save(),i.translate(h,m);let E=Z(e,t);if(j(e)&&E){let x=document.createElement("canvas"),y=x.getContext("2d"),w=Math.max(Tn(l,c),Tn(d,u)),M=dr(e);x.width=w*a.exportScale+M*10*a.exportScale,x.height=w*a.exportScale+M*10*a.exportScale,y.translate(x.width/2,x.height/2),y.scale(a.exportScale,a.exportScale),f=e.width/2-(e.x-l),g=e.height/2-(e.y-d),y.rotate(e.angle);let b=Hn.canvas(x);y.translate(-f,-g),sr(e,b,y,r),y.translate(f,g),y.rotate(-e.angle);let[,,,,S,v]=Q(E,t),L=(l+c)/2-S,T=(d+u)/2-v;y.translate(-L,-T),y.clearRect(-E.width/2,-E.height/2,E.width,E.height),i.scale(1/a.exportScale,1/a.exportScale),i.drawImage(x,-x.width/2,-x.height/2,x.width,x.height)}else i.rotate(e.angle),e.type==="image"&&i.scale(e.scale[0],e.scale[1]),i.translate(-f,-g),sr(e,o,i,r);i.restore()}else{let l=nc(e,n,r,a);if(!l)return;let d=i.imageSmoothingEnabled;if(!a?.shouldCacheIgnoreZoom&&(!e.angle||km(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===a.croppingElementId&&Ae(l.element)&&l.element.crop!==null){i.save(),i.globalAlpha=.1;let c=oc(cl(l.element,t),n,a.zoom,r,a);c&&_a(c,i,r,a,n),i.restore()}_a(l,i,r,a,n),i.imageSmoothingEnabled=d}break}default:throw new Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1};function hb(e,t,n){let o=ue({...e,angle:0},n),i=rr((o[0]+o[2])/2,(o[1]+o[3])/2);return Om(t.length>=2,"Freepath outline must have at least 2 points"),t.slice(2).reduce((r,a)=>(r.push(tc(r[r.length-1][1],Wa(rr(a[0]+e.x,a[1]+e.y),i,e.angle))),r),[tc(Wa(rr(t[0][0]+e.x,t[0][1]+e.y),i,e.angle),Wa(rr(t[1][0]+e.x,t[1][1]+e.y),i,e.angle))])}var at=class e{static rg=new dt;static cache=new WeakMap;static get=(t,n)=>{let o=e.cache.get(t);if(o&&(n===null||o.theme===n))return o.shape};static delete=t=>{e.cache.delete(t),Ko.delete(t)};static destroy=()=>{e.cache=new WeakMap};static generateElementShape=(t,n)=>{let o=n?.isExporting?void 0:e.get(t,n?n.theme:null);if(o!==void 0)return o;Ko.delete(t);let i=Xm(t,e.rg,n||{isExporting:!1,canvasBackgroundColor:jm.white,embedsValidationStatus:null,theme:Ua.LIGHT});return n?.isExporting||e.cache.set(t,{shape:i,theme:n?.theme||Ua.LIGHT}),i}},Um=e=>[8,8+e],cc=e=>[1.5,6+e];function Ym(e){let t=e.roughness,n=Math.max(e.width,e.height),o=Math.min(e.width,e.height);return o>=20&&n>=50||o>=15&&e.roundness&&Gl(e.type)||ne(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var Qe=(e,t=!1,n=!1)=>{let o={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?Um(e.strokeWidth):e.strokeStyle==="dotted"?cc(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:Ym(e),stroke:n?ei(e.strokeColor):e.strokeColor,preserveVertices:t||e.roughness<Wm.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return o.fillStyle=e.fillStyle,o.fill=Jo(e.backgroundColor)?void 0:n?ei(e.backgroundColor):e.backgroundColor,e.type==="ellipse"&&(o.curveFitting=1),o;case"line":case"freedraw":return $t(e.points)&&(o.fillStyle=e.fillStyle,o.fill=e.backgroundColor==="transparent"?void 0:n?ei(e.backgroundColor):e.backgroundColor),o;case"arrow":return o;default:throw new Error(`Unimplemented type ${e.type}`)}},sc=(e,t,n)=>vi(e)&&(t||pl(e)&&n?.get(e.id)!==!0)&&Jo(e.backgroundColor)&&Jo(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:Si(e)?{...e,strokeColor:Jo(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Jo(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,Qo=(e,t,n)=>{if(t===null)return[];let[,,o,i,r,a]=t;return[e.line(o,i,r,a,n)]},cr=(e,t,n)=>{if(t===null)return[];let[o,i,r,a,s,l]=t;return[e.line(r,a,o,i,n),e.line(s,l,o,i,n)]},Zn=(e,t)=>{let n={...t};if(e.strokeStyle==="dotted"){let o=cc(e.strokeWidth-1);n.strokeLineDash=[o[0],o[1]-1]}else delete n.strokeLineDash;return n.roughness=Math.min(1,n.roughness||0),n},Va=(e,t,n,o,i,r=1)=>{if(o===null)return[];let[a,s,l]=o,d={...t,fill:i,fillStyle:"solid",stroke:n,roughness:Math.min(.5,t.roughness||0)};return delete d.strokeLineDash,[e.circle(a,s,l*r,d)]},lc=(e,t,n,o,i,r,a,s)=>{if(o===null)return[];let l=s?ei(e.strokeColor):e.strokeColor,d=s?ei(a):a,c=-.25,u=.8;switch(o){case"circle":case"circle_outline":return Va(i,r,l,je(e,t,n,o),o==="circle_outline"?d:l);case"triangle":case"triangle_outline":{let h=je(e,t,n,o);if(h===null)return[];let[m,f,g,E,x,y]=h,w={...r,fill:o==="triangle_outline"?d:l,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)};return delete w.strokeLineDash,[i.polygon([[m,f],[g,E],[x,y],[m,f]],w)]}case"diamond":case"diamond_outline":{let h=je(e,t,n,o);if(h===null)return[];let[m,f,g,E,x,y,w,M]=h,b={...r,fill:o==="diamond_outline"?d:l,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)};return delete b.strokeLineDash,[i.polygon([[m,f],[g,E],[x,y],[w,M],[m,f]],b)]}case"cardinality_one":return Qo(i,je(e,t,n,o),Zn(e,r));case"cardinality_many":return cr(i,je(e,t,n,o),Zn(e,r));case"cardinality_one_or_many":{let h=Zn(e,r);return[...cr(i,je(e,t,n,"cardinality_many"),h),...Qo(i,je(e,t,n,"cardinality_one",c),h)]}case"cardinality_exactly_one":{let h=Zn(e,r);return[...Qo(i,je(e,t,n,"cardinality_one",-.5),h),...Qo(i,je(e,t,n,"cardinality_one"),h)]}case"cardinality_zero_or_one":{let h=Zn(e,r);return[...Va(i,r,l,je(e,t,n,"circle_outline",1.5),d,u),...Qo(i,je(e,t,n,"cardinality_one",-.5),h)]}case"cardinality_zero_or_many":{let h=Zn(e,r);return[...cr(i,je(e,t,n,"cardinality_many"),h),...Va(i,r,l,je(e,t,n,"circle_outline",1.5),d,u)]}case"bar":case"arrow":default:return cr(i,je(e,t,n,o),Zn(e,r))}},Il=(e,t)=>{let n=new dt,o={seed:e.seed,disableMultiStroke:!0,disableMultiStrokeFill:!0,roughness:0,preserveVertices:!0},i=le(e,t);switch(e.type){case"line":case"arrow":{let r=e.points.length?e.points:[me(0,0)];return U(e)?n.path(uc(r,16),o).sets[0].ops:e.roundness?n.curve(r,o).sets[0].ops.slice(0,e.points.length).map((a,s)=>{if(s===0){let l=on(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle);return{op:"move",data:me(l[0]-e.x,l[1]-e.y)}}return{op:"bcurveTo",data:[on(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle),on(me(e.x+a.data[2],e.y+a.data[3]),i,e.angle),on(me(e.x+a.data[4],e.y+a.data[5]),i,e.angle)].map(l=>me(l[0]-e.x,l[1]-e.y)).flat()}}):r.map((a,s)=>{let l=on(me(e.x+a[0],e.y+a[1]),i,e.angle);return{op:s===0?"move":"lineTo",data:me(l[0]-e.x,l[1]-e.y)}})}case"freedraw":{if(e.points.length<2)return[];let r=Ao(e.points,.75);return n.curve(r,o).sets[0].ops.slice(0,e.points.length).map((a,s)=>{if(s===0){let l=on(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle);return{op:"move",data:me(l[0]-e.x,l[1]-e.y)}}return{op:"bcurveTo",data:[on(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle),on(me(e.x+a.data[2],e.y+a.data[3]),i,e.angle),on(me(e.x+a.data[4],e.y+a.data[5]),i,e.angle)].map(l=>me(l[0]-e.x,l[1]-e.y)).flat()}})}}},Xm=(e,t,{isExporting:n,canvasBackgroundColor:o,embedsValidationStatus:i,theme:r})=>{let a=r===Ua.DARK;switch(e.type){case"rectangle":case"iframe":case"embeddable":{let s;if(e.roundness){let l=e.width,d=e.height,c=Xt(Math.min(l,d),e);s=t.path(`M ${c} 0 L ${l-c} 0 Q ${l} 0, ${l} ${c} L ${l} ${d-c} Q ${l} ${d}, ${l-c} ${d} L ${c} ${d} Q 0 ${d}, 0 ${d-c} L 0 ${c} Q 0 0, ${c} 0`,Qe(sc(e,n,i),!0,a))}else s=t.rectangle(0,0,e.width,e.height,Qe(sc(e,n,i),!1,a));return s}case"diamond":{let s,[l,d,c,u,h,m,f,g]=no(e);if(e.roundness){let E=Xt(Math.abs(l-f),e),x=Xt(Math.abs(u-d),e);s=t.path(`M ${l+E} ${d+x} L ${c-E} ${u-x}
14
+ `),s=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,l=Ti(e.fontSize,e.lineHeight),d=Sm(e.fontFamily,e.fontSize,l);for(let c=0;c<a.length;c++)n.fillText(a[c],s,c*l+d);n.restore(),r&&n.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},$o=new WeakMap,Zd=(e,t,n,o)=>{let i=n?o.zoom:{value:1},r=$o.get(e),a=r&&r.zoomValue!==i.value&&!o?.shouldCacheIgnoreZoom,s=Q(e,t),l=s?.version||null,d=Ae(e)?e.crop:null,c=Sn(e,t)?.opacity||100;if(!r||a||r.theme!==o.theme||r.boundTextElementVersion!==l||r.imageCrop!==d||r.containingFrameOpacity!==c||j(e)&&s&&e.angle!==r.angle){let u=qd(e,t,i,n,o);return u?($o.set(e,u),u):null}return r},Fa=(e,t,n,o,i)=>{let r=e.element,a=ir(r),s=e.scale,[l,d,c,u]=K(r,i),h=((l+c)/2+o.scrollX)*window.devicePixelRatio,m=((d+u)/2+o.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let g=Q(r,i);if(j(r)&&g){let f=(e.boundTextCanvas.width-e.canvas.width)/2,E=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(h,m),t.drawImage(e.boundTextCanvas,-(c-l)/2*window.devicePixelRatio-f/s-a,-(u-d)/2*window.devicePixelRatio-E/s-a,e.boundTextCanvas.width/s,e.boundTextCanvas.height/s)}else if(t.translate(h,m),t.rotate(r.angle),"scale"in e.element&&!km(r,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-h,-m),t.drawImage(e.canvas,(l+o.scrollX)*window.devicePixelRatio-a*e.scale/e.scale,(d+o.scrollY)*window.devicePixelRatio-a*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),C.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX==="true"&&Tt(r)){let f=Q(r,i),E=Kr(r);t.strokeStyle="#c92a2a",t.lineWidth=3,t.strokeRect((E.x+o.scrollX)*window.devicePixelRatio,(E.y+o.scrollY)*window.devicePixelRatio,xt(r,f)*window.devicePixelRatio,Ro(r,f)*window.devicePixelRatio)}t.restore()},$w=(e,t,n,o)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let i=.5/n.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=o,t.strokeRect(i,i,e.width,e.height),t.restore()},Zw=(e,t,n,o,i,r,a)=>{let s=a.openDialog?.name==="elementLinkSelector"&&!a.selectedElementIds[e.id]&&!a.hoveredElementIds[e.id];switch(i.globalAlpha=Tm(e,Sn(e,t),r.elementsPendingErasure,r.pendingFlowchartNodes,s?wm:1),e.type){case"magicframe":case"frame":{a.frameRendering.enabled&&a.frameRendering.outline&&(i.save(),i.translate(e.x+a.scrollX,e.y+a.scrollY),i.fillStyle="rgba(0, 0, 200, 0.04)",i.lineWidth=tr.strokeWidth/a.zoom.value,i.strokeStyle=or(tr.strokeColor,a.theme===lo.DARK),dl(e)&&(i.strokeStyle=a.theme===lo.LIGHT?"#7affd7":or("#1d8264")),tr.radius&&i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,tr.radius/a.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break}case"freedraw":{if(r.isExporting){let[l,d,c,u]=K(e,t),h=(l+c)/2+a.scrollX,m=(d+u)/2+a.scrollY,g=(c-l)/2-(e.x-l),f=(u-d)/2-(e.y-d);i.save(),i.translate(h,m),i.rotate(e.angle),i.translate(-g,-f),nr(e,o,i,r),i.restore()}else{let l=Zd(e,n,r,a);if(!l)return;Fa(l,i,r,a,n)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(r.isExporting){let[l,d,c,u]=K(e,t),h=(l+c)/2+a.scrollX,m=(d+u)/2+a.scrollY,g=(c-l)/2-(e.x-l),f=(u-d)/2-(e.y-d);if(te(e)){let x=De(e,t);if(j(x)){let y=D.getBoundTextElementPosition(x,e,t);g=(c-l)/2-(y.x-l),f=(u-d)/2-(y.y-d)}}i.save(),i.translate(h,m);let E=Q(e,t);if(j(e)&&E){let x=document.createElement("canvas"),y=x.getContext("2d"),w=Math.max(kn(l,c),kn(d,u)),M=ir(e);x.width=w*a.exportScale+M*10*a.exportScale,x.height=w*a.exportScale+M*10*a.exportScale,y.translate(x.width/2,x.height/2),y.scale(a.exportScale,a.exportScale),g=e.width/2-(e.x-l),f=e.height/2-(e.y-d),y.rotate(e.angle);let b=Nn.canvas(x);y.translate(-g,-f),nr(e,b,y,r),y.translate(g,f),y.rotate(-e.angle);let[,,,,S,v]=K(E,t),k=(l+c)/2-S,T=(d+u)/2-v;y.translate(-k,-T),y.clearRect(-E.width/2,-E.height/2,E.width,E.height),i.scale(1/a.exportScale,1/a.exportScale),i.drawImage(x,-x.width/2,-x.height/2,x.width,x.height)}else i.rotate(e.angle),e.type==="image"&&i.scale(e.scale[0],e.scale[1]),i.translate(-g,-f),nr(e,o,i,r);i.restore()}else{let l=Zd(e,n,r,a);if(!l)return;let d=i.imageSmoothingEnabled;if(!a?.shouldCacheIgnoreZoom&&(!e.angle||ym(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===a.croppingElementId&&Ae(l.element)&&l.element.crop!==null){i.save(),i.globalAlpha=.1;let c=qd(al(l.element,t),n,a.zoom,r,a);c&&Fa(c,i,r,a,n),i.restore()}Fa(l,i,r,a,n),i.imageSmoothingEnabled=d}break}default:throw new Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1};function qw(e,t,n){let o=ue({...e,angle:0},n),i=Ji((o[0]+o[2])/2,(o[1]+o[3])/2);return vm(t.length>=2,"Freepath outline must have at least 2 points"),t.slice(2).reduce((r,a)=>(r.push($d(r[r.length-1][1],Ra(Ji(a[0]+e.x,a[1]+e.y),i,e.angle))),r),[$d(Ra(Ji(t[0][0]+e.x,t[0][1]+e.y),i,e.angle),Ra(Ji(t[1][0]+e.x,t[1][1]+e.y),i,e.angle))])}var at=class e{static rg=new lt;static cache=new WeakMap;static get=(t,n)=>{let o=e.cache.get(t);if(o&&(n===null||o.theme===n))return o.shape};static delete=t=>{e.cache.delete(t),$o.delete(t)};static destroy=()=>{e.cache=new WeakMap};static generateElementShape=(t,n)=>{let o=n?.isExporting?void 0:e.get(t,n?n.theme:null);if(o!==void 0)return o;$o.delete(t);let i=Nm(t,e.rg,n||{isExporting:!1,canvasBackgroundColor:Gm.white,embedsValidationStatus:null,theme:za.LIGHT});return n?.isExporting||e.cache.set(t,{shape:i,theme:n?.theme||za.LIGHT}),i}},Rm=e=>[8,8+e],oc=e=>[1.5,6+e];function Fm(e){let t=e.roughness,n=Math.max(e.width,e.height),o=Math.min(e.width,e.height);return o>=20&&n>=50||o>=15&&e.roundness&&Cl(e.type)||ne(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var Qe=(e,t=!1,n=!1)=>{let o={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?Rm(e.strokeWidth):e.strokeStyle==="dotted"?oc(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:Fm(e),stroke:Ko(e.strokeColor,n),preserveVertices:t||e.roughness<Bm.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return o.fillStyle=e.fillStyle,o.fill=qo(e.backgroundColor)?void 0:Ko(e.backgroundColor,n),e.type==="ellipse"&&(o.curveFitting=1),o;case"line":case"freedraw":return Ut(e.points)&&(o.fillStyle=e.fillStyle,o.fill=e.backgroundColor==="transparent"?void 0:Ko(e.backgroundColor,n)),o;case"arrow":return o;default:throw new Error(`Unimplemented type ${e.type}`)}},ec=(e,t,n)=>Pi(e)&&(t||ll(e)&&n?.get(e.id)!==!0)&&qo(e.backgroundColor)&&qo(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:Mi(e)?{...e,strokeColor:qo(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:qo(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,Zo=(e,t,n)=>{if(t===null)return[];let[,,o,i,r,a]=t;return[e.line(o,i,r,a,n)]},rr=(e,t,n)=>{if(t===null)return[];let[o,i,r,a,s,l]=t;return[e.line(r,a,o,i,n),e.line(s,l,o,i,n)]},$n=(e,t)=>{let n={...t};if(e.strokeStyle==="dotted"){let o=oc(e.strokeWidth-1);n.strokeLineDash=[o[0],o[1]-1]}else delete n.strokeLineDash;return n.roughness=Math.min(1,n.roughness||0),n},Ha=(e,t,n,o,i,r=1)=>{if(o===null)return[];let[a,s,l]=o,d={...t,fill:i,fillStyle:"solid",stroke:n,roughness:Math.min(.5,t.roughness||0)};return delete d.strokeLineDash,[e.circle(a,s,l*r,d)]},tc=(e,t,n,o,i,r,a,s)=>{if(o===null)return[];let l=Ko(e.strokeColor,s),d=Ko(a,s),c=-.25,u=.8;switch(o){case"circle":case"circle_outline":return Ha(i,r,l,je(e,t,n,o),o==="circle_outline"?d:l);case"triangle":case"triangle_outline":{let h=je(e,t,n,o);if(h===null)return[];let[m,g,f,E,x,y]=h,w={...r,fill:o==="triangle_outline"?d:l,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)};return delete w.strokeLineDash,[i.polygon([[m,g],[f,E],[x,y],[m,g]],w)]}case"diamond":case"diamond_outline":{let h=je(e,t,n,o);if(h===null)return[];let[m,g,f,E,x,y,w,M]=h,b={...r,fill:o==="diamond_outline"?d:l,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)};return delete b.strokeLineDash,[i.polygon([[m,g],[f,E],[x,y],[w,M],[m,g]],b)]}case"cardinality_one":return Zo(i,je(e,t,n,o),$n(e,r));case"cardinality_many":return rr(i,je(e,t,n,o),$n(e,r));case"cardinality_one_or_many":{let h=$n(e,r);return[...rr(i,je(e,t,n,"cardinality_many"),h),...Zo(i,je(e,t,n,"cardinality_one",c),h)]}case"cardinality_exactly_one":{let h=$n(e,r);return[...Zo(i,je(e,t,n,"cardinality_one",-.5),h),...Zo(i,je(e,t,n,"cardinality_one"),h)]}case"cardinality_zero_or_one":{let h=$n(e,r);return[...Ha(i,r,l,je(e,t,n,"circle_outline",1.5),d,u),...Zo(i,je(e,t,n,"cardinality_one",-.5),h)]}case"cardinality_zero_or_many":{let h=$n(e,r);return[...rr(i,je(e,t,n,"cardinality_many"),h),...Ha(i,r,l,je(e,t,n,"circle_outline",1.5),d,u)]}case"bar":case"arrow":default:return rr(i,je(e,t,n,o),$n(e,r))}},bl=(e,t)=>{let n=new lt,o={seed:e.seed,disableMultiStroke:!0,disableMultiStrokeFill:!0,roughness:0,preserveVertices:!0},i=de(e,t);switch(e.type){case"line":case"arrow":{let r=e.points.length?e.points:[me(0,0)];return Y(e)?n.path(ic(r,16),o).sets[0].ops:e.roundness?n.curve(r,o).sets[0].ops.slice(0,e.points.length).map((a,s)=>{if(s===0){let l=nn(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle);return{op:"move",data:me(l[0]-e.x,l[1]-e.y)}}return{op:"bcurveTo",data:[nn(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle),nn(me(e.x+a.data[2],e.y+a.data[3]),i,e.angle),nn(me(e.x+a.data[4],e.y+a.data[5]),i,e.angle)].map(l=>me(l[0]-e.x,l[1]-e.y)).flat()}}):r.map((a,s)=>{let l=nn(me(e.x+a[0],e.y+a[1]),i,e.angle);return{op:s===0?"move":"lineTo",data:me(l[0]-e.x,l[1]-e.y)}})}case"freedraw":{if(e.points.length<2)return[];let r=So(e.points,.75);return n.curve(r,o).sets[0].ops.slice(0,e.points.length).map((a,s)=>{if(s===0){let l=nn(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle);return{op:"move",data:me(l[0]-e.x,l[1]-e.y)}}return{op:"bcurveTo",data:[nn(me(e.x+a.data[0],e.y+a.data[1]),i,e.angle),nn(me(e.x+a.data[2],e.y+a.data[3]),i,e.angle),nn(me(e.x+a.data[4],e.y+a.data[5]),i,e.angle)].map(l=>me(l[0]-e.x,l[1]-e.y)).flat()}})}}},Nm=(e,t,{isExporting:n,canvasBackgroundColor:o,embedsValidationStatus:i,theme:r})=>{let a=r===za.DARK;switch(e.type){case"rectangle":case"iframe":case"embeddable":{let s;if(e.roundness){let l=e.width,d=e.height,c=Yt(Math.min(l,d),e);s=t.path(`M ${c} 0 L ${l-c} 0 Q ${l} 0, ${l} ${c} L ${l} ${d-c} Q ${l} ${d}, ${l-c} ${d} L ${c} ${d} Q 0 ${d}, 0 ${d-c} L 0 ${c} Q 0 0, ${c} 0`,Qe(ec(e,n,i),!0,a))}else s=t.rectangle(0,0,e.width,e.height,Qe(ec(e,n,i),!1,a));return s}case"diamond":{let s,[l,d,c,u,h,m,g,f]=to(e);if(e.roundness){let E=Yt(Math.abs(l-g),e),x=Yt(Math.abs(u-d),e);s=t.path(`M ${l+E} ${d+x} L ${c-E} ${u-x}
15
15
  C ${c} ${u}, ${c} ${u}, ${c-E} ${u+x}
16
16
  L ${h+E} ${m-x}
17
17
  C ${h} ${m}, ${h} ${m}, ${h-E} ${m-x}
18
- L ${f+E} ${g+x}
19
- C ${f} ${g}, ${f} ${g}, ${f+E} ${g-x}
18
+ L ${g+E} ${f+x}
19
+ C ${g} ${f}, ${g} ${f}, ${g+E} ${f-x}
20
20
  L ${l-E} ${d+x}
21
- C ${l} ${d}, ${l} ${d}, ${l+E} ${d+x}`,Qe(e,!0,a))}else s=t.polygon([[l,d],[c,u],[h,m],[f,g]],Qe(e,!1,a));return s}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,Qe(e,!1,a));case"line":case"arrow":{let s,l=Qe(e,!1,a),d=e.points.length?e.points:[me(0,0)];if(U(e)?d.every(c=>Math.abs(c[0])<=1e6&&Math.abs(c[1])<=1e6)?s=[t.path(uc(d,16),Qe(e,!0,a))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(d)),s=[]):e.roundness?s=[t.curve(d,l)]:l.fill?s=[t.polygon(d,l)]:s=[t.linearPath(d,l)],e.type==="arrow"){let{startArrowhead:c=null,endArrowhead:u="arrow"}=e;if(c!==null){let h=lc(e,s,"start",c,t,l,o,a);s.push(...h)}if(u!==null){let h=lc(e,s,"end",u,t,l,o,a);s.push(...h)}}return s}case"freedraw":{let s=[];if($t(e.points)){let l=Ao(e.points,.75);s.push(t.curve(l,{...Qe(e,!1,a),stroke:"none"}))}return s.push($m(e)),s}case"frame":case"magicframe":case"text":case"image":return null;default:return _m(e,`generateElementShape(): Unimplemented type ${e?.type}`),null}},uc=(e,t)=>{let n=[];for(let i=1;i<e.length-1;i+=1){let r=e[i-1],a=e[i+1],s=e[i],l=bt(s,r),d=bt(a,s),c=Math.min(t,ac(e[i],a)/2,ac(e[i],r)/2);l?r[0]<s[0]?n.push([e[i][0]-c,e[i][1]]):n.push([e[i][0]+c,e[i][1]]):r[1]<s[1]?n.push([e[i][0],e[i][1]-c]):n.push([e[i][0],e[i][1]+c]),n.push(e[i]),d?a[0]<s[0]?n.push([e[i][0]-c,e[i][1]]):n.push([e[i][0]+c,e[i][1]]):a[1]<s[1]?n.push([e[i][0],e[i][1]-c]):n.push([e[i][0],e[i][1]+c])}let o=[`M ${e[0][0]} ${e[0][1]}`];for(let i=0;i<n.length;i+=3)o.push(`L ${n[i][0]} ${n[i][1]}`),o.push(`Q ${n[i+1][0]} ${n[i+1][1]}, ${n[i+2][0]} ${n[i+2][1]}`);return o.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),o.join(" ")},ti=(e,t)=>{switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return $s(e);case"arrow":case"line":{let n=at.generateElementShape(e,null)[0],[,,,,o,i]=Q(e,t);return Ri(e)?Qs(e,n,me(e.x,e.y),e.angle,me(o,i)):qs(n,me(e.x,e.y),e.angle,me(o,i))}case"ellipse":return Zs(e);case"freedraw":{let[,,,,n,o]=Q(e,t);return Ks(e,me(n,o),Ri(e))}}},Jd=(e,t)=>{let n=[...e.points];if(t){if(!El(e.points))return null;let i=n[0],r=n[n.length-1];Math.hypot(i[0]-r[0],i[1]-r[1])>Vm||n.length<4?n.push(me(i[0],i[1])):n[n.length-1]=me(i[0],i[1])}return{polygon:t,points:n}},$m=e=>Km(Zm(e)),Zm=e=>{let t=e.simulatePressure?e.points:e.points.length?e.points.map(([n,o],i)=>[n,o,e.pressures[i]]):[[0,0,.5]];return rl(t,{simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:n=>Math.sin(n*Math.PI/2),last:!0})},dc=(e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2],qm=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g,Km=e=>{if(!e.length)return"";let t=e.length-1;return e.reduce((n,o,i,r)=>(i===t?n.push(o,dc(o,r[0]),"L",r[0],"Z"):n.push(o,dc(o,r[i+1])),n),["M",e[0],"Q"]).join(" ").replace(qm,"$1")};var $a=class e{static boundsCache=new WeakMap;static nonRotatedBoundsCache=new WeakMap;static getBounds(t,n,o=!1){let i=o&&t.angle!==0?e.nonRotatedBoundsCache.get(t):e.boundsCache.get(t);if(i?.version&&i.version===t.version&&!Ee(t))return i.bounds;if(o&&t.angle!==0){let a=e.calculateBounds({...t,angle:0},n);return e.nonRotatedBoundsCache.set(t,{version:t.version,bounds:a}),a}let r=e.calculateBounds(t,n);return e.boundsCache.set(t,{version:t.version,bounds:r}),r}static calculateBounds(t,n){let o,[i,r,a,s,l,d]=Q(t,n);if(Pe(t)){let[c,u,h,m]=Za(t.points.map(([f,g])=>ce(G(f,g),G(l-t.x,d-t.y),t.angle)));return[c+t.x,u+t.y,h+t.x,m+t.y]}else if(ne(t))o=l0(t,l,d,n);else if(t.type==="diamond"){let[c,u]=ce(G(l,r),G(l,d),t.angle),[h,m]=ce(G(l,s),G(l,d),t.angle),[f,g]=ce(G(i,d),G(l,d),t.angle),[E,x]=ce(G(a,d),G(l,d),t.angle),y=Math.min(c,h,f,E),w=Math.min(u,m,g,x),M=Math.max(c,h,f,E),b=Math.max(u,m,g,x);o=[y,w,M,b]}else if(t.type==="ellipse"){let c=(a-i)/2,u=(s-r)/2,h=Math.cos(t.angle),m=Math.sin(t.angle),f=Math.hypot(c*h,u*m),g=Math.hypot(u*h,c*m);o=[l-f,d-g,l+f,d+g]}else{let[c,u]=ce(G(i,r),G(l,d),t.angle),[h,m]=ce(G(i,s),G(l,d),t.angle),[f,g]=ce(G(a,s),G(l,d),t.angle),[E,x]=ce(G(a,r),G(l,d),t.angle),y=Math.min(c,h,f,E),w=Math.min(u,m,g,x),M=Math.max(c,h,f,E),b=Math.max(u,m,g,x);o=[y,w,M,b]}return o}},Q=(e,t,n=!1)=>{if(Pe(e))return n0(e);if(ne(e))return R.getElementAbsoluteCoords(e,t,n);if(te(e)){let o=t?De(e,t):null;if(j(o)){let{x:i,y:r}=R.getBoundTextElementPosition(o,e,t);return[i,r,i+e.width,r+e.height,i+e.width/2,r+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},Ga=(e,t)=>{let n=ti(e,t),[o,i,r,a,s,l]=Q(e,t),d=G(s,l);if(n.type==="polycurve"){let x=n.data.map(w=>_t(w,10)),y=[];if(Ut(e)&&!e.polygon||j(e))for(let w of x){let M=0;for(;M<w.length-1;)y.push(Se(G(w[M][0],w[M][1]),G(w[M+1][0],w[M+1][1]))),M++}else{let w=x.flat(),M=0;for(;M<w.length-1;)y.push(Se(G(w[M][0],w[M][1]),G(w[M+1][0],w[M+1][1]))),M++}return y}else{if(n.type==="polyline")return n.data;if(e0(e)){let[E,x]=hn(e),y=x.map(M=>mc(M,d,e.angle)).flat();return[...hc(E,d,e.angle),...y]}else if(e.type==="diamond"){let[E,x]=mn(e),y=x.map(M=>mc(M,d,e.angle)).flat();return[...hc(E,d,e.angle),...y]}else if(n.type==="polygon"){if(te(e)){let y=De(e,t);if(y&&ne(y))return[Se(G(o,i),G(r,i)),Se(G(r,i),G(r,a)),Se(G(r,a),G(o,a)),Se(G(o,a),G(o,i))]}let E=n.data,x=[];for(let y=0;y<E.length-1;y++)x.push(Se(E[y],E[y+1]));return x}else if(n.type==="ellipse")return t0(e)}let[c,u,h,m,,,f,g]=[[o,i],[r,i],[o,a],[r,a],[s,i],[s,a],[o,l],[r,l]].map(E=>ce(E,d,e.angle));return[Se(c,u),Se(h,m),Se(c,h),Se(u,m),Se(c,g),Se(h,g),Se(u,f),Se(m,f)]},e0=e=>e!=null&&(e.type==="rectangle"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),hc=(e,t,n)=>e.map(o=>Se(ce(o[0],t,n),ce(o[1],t,n))),mc=(e,t,n)=>{let o=_t(e,10),i=0,r=[];for(;i<o.length-1;)r.push(Se(ce(G(o[i][0],o[i][1]),t,n),ce(G(o[i+1][0],o[i+1][1]),t,n))),i++;return r},t0=e=>{let t=G(e.x+e.width/2,e.y+e.height/2),n=e.width/2,o=e.height/2,i=[],r=[],a=90,s=Math.PI*2/a;for(let l=0;l<a;l++){let d=l*s,c=t[0]+n*Math.cos(d),u=t[1]+o*Math.sin(d);r.push(ce(G(c,u),t,e.angle))}for(let l=0;l<r.length-1;l++)i.push(Se(r[l],r[l+1]));return i.push(Se(r[r.length-1],r[0])),i},jb=e=>[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2],no=e=>{let t=Math.floor(e.width/2)+1,n=0,o=e.width,i=Math.floor(e.height/2)+1,r=t,a=e.height;return[t,n,o,i,r,a,0,i]},fc=(e,t,n,o,i)=>{let r=1-e;return Math.pow(r,3)*t+3*Math.pow(r,2)*e*n+3*r*Math.pow(e,2)*o+Math.pow(e,3)*i},gc=(e,t,n,o)=>{let i=t-e,r=n-t,a=o-n,s=3*i-6*r+3*a,l=6*r-6*i,d=3*i,c=l*l-4*s*d;if(!(c>=0))return!1;let h=null,m=null,f=1/0,g=1/0;return s===0?f=g=-d/l:(f=(-l+Math.sqrt(c))/(2*s),g=(-l-Math.sqrt(c))/(2*s)),f>=0&&f<=1&&(h=fc(f,e,t,n,o)),g>=0&&g<=1&&(m=fc(g,e,t,n,o)),[h,m]},Ni=(e,t,n,o)=>{let i=gc(e[0],t[0],n[0],o[0]),r=gc(e[1],t[1],n[1],o[1]),a=Math.min(e[0],o[0]),s=Math.max(e[0],o[0]);if(i){let c=i.filter(u=>u!==null);a=Math.min(a,...c),s=Math.max(s,...c)}let l=Math.min(e[1],o[1]),d=Math.max(e[1],o[1]);if(r){let c=r.filter(u=>u!==null);l=Math.min(l,...c),d=Math.max(d,...c)}return[a,l,s,d]},Zo=(e,t)=>{let n=G(0,0),{minX:o,minY:i,maxX:r,maxY:a}=e.reduce((s,{op:l,data:d})=>{if(l==="move"){let c=xc(d);Xa(c!=null,"Op data is not a point"),n=c}else if(l==="bcurveTo"){let c=G(d[0],d[1]),u=G(d[2],d[3]),h=G(d[4],d[5]),m=t?t(c):c,f=t?t(u):u,g=t?t(h):h,E=t?t(n):n;n=h;let[x,y,w,M]=Ni(E,m,f,g);s.minX=Math.min(s.minX,x),s.minY=Math.min(s.minY,y),s.maxX=Math.max(s.maxX,w),s.maxY=Math.max(s.maxY,M)}return s},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[o,i,r,a]},Za=(e,t=0)=>{let n=1/0,o=1/0,i=-1/0,r=-1/0;for(let[a,s]of e)n=Math.min(n,a),o=Math.min(o,s),i=Math.max(i,a),r=Math.max(r,s);return[n-t,o-t,i+t,r+t]},n0=e=>{let[t,n,o,i]=Za(e.points),r=t+e.x,a=n+e.y,s=o+e.x,l=i+e.y;return[r,a,s,l,(r+s)/2,(a+l)/2]},o0=20,i0=15,r0=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"cardinality_many":case"cardinality_one_or_many":case"cardinality_zero_or_many":return i0;case"cardinality_one":case"cardinality_exactly_one":case"cardinality_zero_or_one":return o0;default:return 15}},a0=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},je=(e,t,n,o,i=0)=>{if(o===null||t.length<1)return null;let r=jt(t[0]);if(r.length<1)return null;let a=n==="start"?1:r.length-1,s=r[a].data;Xa(s.length===6,"Op data length is not 6");let l=G(s[4],s[5]),d=G(s[2],s[3]),c=G(s[0],s[1]),u=r[a-1],h=G(0,0);if(u.op==="move"){let A=xc(u.data);Xa(A!=null,"Op data is not a point"),h=A}else u.op==="bcurveTo"&&(h=G(u.data[4],u.data[5]));let m=(A,_)=>Math.pow(1-A,3)*l[_]+3*A*Math.pow(1-A,2)*d[_]+3*Math.pow(A,2)*(1-A)*c[_]+h[_]*Math.pow(A,3),[f,g]=n==="start"?h:l,[E,x]=[m(.3,0),m(.3,1)],y=Math.hypot(f-E,g-x),w=(f-E)/y,M=(g-x)/y,b=r0(o),S=0;{let[A,_]=n==="end"?e.points[e.points.length-1]:e.points[0],[X,ve]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];S=Math.hypot(A-X,_-ve)}let L=Math.min(b,S*(o==="diamond"||o==="diamond_outline"?.25:.5)),T=f-w*L*i,D=g-M*L*i,B=T-w*L,F=D-M*L;if(o==="circle"||o==="circle_outline"){let A=Math.hypot(F-D,B-T)+e.strokeWidth-2;return[T,D,A]}let O=a0(o);if(o==="cardinality_many"||o==="cardinality_one_or_many"){let[A,_]=ce(G(T,D),G(B,F),Ya(-O)),[X,ve]=ce(G(T,D),G(B,F),Ya(O));return[B,F,A,_,X,ve]}let[K,Y]=ce(G(B,F),G(T,D),-O*Math.PI/180),[se,H]=ce(G(B,F),G(T,D),Ya(O));if(o==="diamond"||o==="diamond_outline"){let A,_;if(n==="start"){let[X,ve]=e.points.length>1?e.points[1]:[0,0];[A,_]=ce(G(T+L*2,D),G(T,D),Math.atan2(ve-D,X-T))}else{let[X,ve]=e.points.length>1?e.points[e.points.length-2]:[0,0];[A,_]=ce(G(T-L*2,D),G(T,D),Math.atan2(D-ve,T-X))}return[T,D,K,Y,A,_,se,H]}return[T,D,K,Y,se,H]},s0=e=>{let t=Hn.generator(),n=Qe(e),o=e.roundness?"curve":n.fill?"polygon":"linearPath";return t[o](e.points,n)},l0=(e,t,n,o)=>{let i=Z(e,o);if(e.points.length<2){let[u,h]=e.points[0],[m,f]=ce(G(e.x+u,e.y+h),G(t,n),e.angle),g=[m,f,m,f];if(i){let E=R.getMinMaxXYWithBoundText(e,o,[m,f,m,f],i);g=[E[0],E[1],E[2],E[3]]}return g}let a=at.get(e,null)?.[0]??s0(e),s=jt(a),d=Zo(s,([u,h])=>ce(G(e.x+u,e.y+h),G(t,n),e.angle)),c=[d[0],d[1],d[2],d[3]];if(i){let u=R.getMinMaxXYWithBoundText(e,o,c,i);c=[u[0],u[1],u[2],u[3]]}return c},ue=(e,t,n=!1)=>$a.getBounds(e,t,n),We=(e,t)=>{if(!Qm(e))return[0,0,0,0];let n=1/0,o=-1/0,i=1/0,r=-1/0,a=t||Ec(e);return e.forEach(s=>{let[l,d,c,u]=ue(s,a);n=Math.min(n,l),i=Math.min(i,d),o=Math.max(o,c),r=Math.max(r,u)}),[n,i,o,r]},Vb=(e,t)=>{let[n,o,i,r]=We(e);return[n+t.x,o+t.y,i+t.x,r+t.y]},pn=(e,t,n,o)=>{if(!(ne(e)||Pe(e)))return[e.x,e.y,e.x+t,e.y+n];let i=pc(0,t,pc(1,n,e.points,o),o),r;if(Pe(e))r=Za(i);else{let c=Hn.generator(),u=e.roundness?c.curve(i,Qe(e)):c.linearPath(i,Qe(e)),h=jt(u);r=Zo(h)}let[a,s,l,d]=r;return[a+e.x,s+e.y,l+e.x,d+e.y]},za=(e,t)=>{let n=Hn.generator(),o=e.roundness==null?n.linearPath(t,Qe(e)):n.curve(t,Qe(e)),i=jt(o),[r,a,s,l]=Zo(i);return[r+e.x,a+e.y,s+e.x,l+e.y]},Ub=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,o=e[0],i=Ec(e);return e.forEach(r=>{let[a,s,l,d]=ue(r,i),c=Jm(G((a+l)/2,(s+d)/2),G(t.x,t.y));c<n&&(n=c,o=r)}),ue(o,i)},Fe=e=>{let[t,n,o,i]=We(e);return{minX:t,minY:n,maxX:o,maxY:i,width:o-t,height:i-n,midX:(t+o)/2,midY:(n+i)/2}},Yb=({scrollX:e,scrollY:t,width:n,height:o,zoom:i})=>[-e,-t,-e+n/i.value,-t+o/i.value],xn=e=>G(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),pt=(e,t,n)=>{let o={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},i=le(e,t),[r,a]=ce(G(o.minX,o.minY),i,e.angle),[s,l]=ce(G(o.maxX,o.minY),i,e.angle),[d,c]=ce(G(o.maxX,o.maxY),i,e.angle),[u,h]=ce(G(o.minX,o.maxY),i,e.angle),m=[Math.min(r,s,d,u),Math.min(a,l,c,h),Math.max(r,s,d,u),Math.max(a,l,c,h)];if(n){let[f,g,E,x]=n;return[m[0]-x,m[1]-f,m[2]+g,m[3]+E]}return m},wt=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],d0=(e,t)=>e[0]>=t[0]&&e[0]<=t[2]&&e[1]>=t[1]&&e[1]<=t[3],Ot=(e,t)=>{if(e==null||t==null)return!1;let[n,o,i,r]=e,[a,s,l,d]=t;return n<l&&i>a&&o<d&&r>s},tr=(e,t)=>[G(t[0],t[1]),G(t[0],t[3]),G(t[2],t[1]),G(t[2],t[3])].every(n=>d0(n,e)),le=(e,t,n=0,o=0)=>{if(ne(e)||Pe(e)){let[a,s,l,d]=Q(e,t),[c,u]=G((a+l)/2,(s+d)/2);return G(c+n,u+o)}let[i,r]=xn(ue(e,t));return G(i+n,r+o)};var h0=.1,wc=e=>ne(e)||Pe(e)?e.points.length<2||e.points.length===2&&j(e)&&p0(e.points[0],e.points[e.points.length-1],h0):e.width===0&&e.height===0,Gd=(e,t,n,o,i)=>{let[r,a,s,l]=ue(e,i),d=ur({clientX:o.offsetLeft,clientY:o.offsetTop},o),c=ur({clientX:o.offsetLeft+t,clientY:o.offsetTop+n},o);return d.x<=s&&d.y<=l&&c.x>=r&&c.y>=a},e6=(e,t,n,o,i,r)=>{let[a,s,l,d]=We(e,i),c=ur({clientX:o.offsetLeft+(r?.left||0),clientY:o.offsetTop+(r?.top||0)},o),u=ur({clientX:o.offsetLeft+t-(r?.right||0),clientY:o.offsetTop+n-(r?.bottom||0)},o);return a>=c.x&&s>=c.y&&l<=u.x&&d<=u.y},qa=(e,t,n)=>{let o=Math.abs(t),i=Math.abs(n);if(e==="line"||e==="arrow"||e==="freedraw"){let r=Math.round(Math.atan(i/o)/rn)*rn;r===0?n=0:r===Math.PI/2?t=0:n=o*Math.tan(r)*Math.sign(n)||n}else e!=="selection"&&(n=o*Math.sign(n));return{width:t,height:n}},ec=(e,t,n,o,i)=>{let r=n-e,a=o-t,s=Math.atan2(a,r),l=Math.round(s/rn)*rn;if(i){let d=Math.floor(i/rn)*rn;c0(s,d,d+rn)&&(u0(s,i)<rn/6?l=i:yc(s)>yc(i)?l=d+rn:l=d)}if(l===0)a=0;else if(l===Math.PI/2)r=0;else{let d=Math.tan(l),c=-1,u=t-d*e,h=-1/d,m=-1,f=o-h*n,g=(c*f-m*u)/(d*m-h*c),E=(u*h-f*d)/(d*m-h*c);r=g-e,a=E-t}return{width:r,height:a}},t6=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t};I();var s6=(e,t,n,o)=>{let i=ir(e,n.getNonDeletedElementsMap(),o),r=Fe(e);return i.flatMap(a=>{let s=m0(a,r,t);return a.map(l=>{let d=n.mutateElement(l,{x:l.x+s.x,y:l.y+s.y});return Re(l,n,{simultaneouslyUpdated:a}),d})})},m0=(e,t,{axis:n,position:o})=>{let i=Fe(e),[r,a]=n==="x"?["minX","maxX"]:["minY","maxY"],s={x:0,y:0};return o==="start"?{...s,[n]:t[r]-i[r]}:o==="end"?{...s,[n]:t[a]-i[a]}:{...s,[n]:(t[r]+t[a])/2-(i[r]+i[a])/2}};I();I();var pr=class{root;gap;constructor(t=0){this.root=null,this.gap=t}fit(t){let n=t.length,o=n>0?t[0].w:0,i=n>0?t[0].h:0;this.root={x:0,y:0,w:o,h:i};for(let r=0;r<n;r++){let a=t[r],s=this.findNode(this.root,a.w,a.h);s?a.fit=this.splitNode(s,a.w,a.h):a.fit=this.growNode(a.w,a.h)}}findNode(t,n,o){return t?t.used?this.findNode(t.right||null,n,o)||this.findNode(t.down||null,n,o):n<=t.w&&o<=t.h?t:null:null}splitNode(t,n,o){return t.used=!0,t.down={x:t.x,y:t.y+o+this.gap,w:t.w,h:t.h-o-this.gap},t.right={x:t.x+n+this.gap,y:t.y,w:t.w-n-this.gap,h:o},t}growNode(t,n){if(!this.root)return null;let o=t<=this.root.w,i=n<=this.root.h,r=i&&this.root.h>=this.root.w+t+this.gap,a=o&&this.root.w>=this.root.h+n+this.gap;return r?this.growRight(t,n):a?this.growDown(t,n):i?this.growRight(t,n):o?this.growDown(t,n):null}growRight(t,n){if(!this.root)return null;this.root={used:!0,x:0,y:0,w:this.root.w+t+this.gap,h:this.root.h,down:this.root,right:{x:this.root.w+this.gap,y:0,w:t,h:this.root.h}};let o=this.findNode(this.root,t,n);return o?this.splitNode(o,t,n):null}growDown(t,n){if(!this.root)return null;this.root={used:!0,x:0,y:0,w:this.root.w,h:this.root.h+n+this.gap,down:{x:0,y:this.root.h+this.gap,w:this.root.w,h:n},right:this.root};let o=this.findNode(this.root,t,n);return o?this.splitNode(o,t,n):null}};I();var f0=[1,1.08,1.18,1.32,1.5,1.75,2.1,2.6,3.25],g0=[1,4/3,3/4,3/2,2/3,2,1/2],E0=(e,t)=>{let n=Math.max(e.length,t.length);for(let o=0;o<n;o++){let i=(e[o]??0)-(t[o]??0);if(i!==0)return i}return 0},x0=(e,t)=>t.packedW*t.packedH-e.packedW*e.packedH||Math.max(t.packedW,t.packedH)-Math.max(e.packedW,e.packedH)||t.packedH-e.packedH||t.packedW-e.packedW,bc=(e,t,n)=>Math.min(Math.max(e,t),n),y0=(e,t)=>e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y,w0=(e,t)=>t.x>=e.x&&t.y>=e.y&&t.x+t.w<=e.x+e.w&&t.y+t.h<=e.y+e.h,Mc=e=>{let t=e.filter(n=>n.fit);return t.length===0?null:t.reduce((n,o)=>({minX:Math.min(n.minX,o.fit.x),minY:Math.min(n.minY,o.fit.y),maxX:Math.max(n.maxX,o.fit.x+o.actualW),maxY:Math.max(n.maxY,o.fit.y+o.actualH)}),{minX:t[0].fit.x,minY:t[0].fit.y,maxX:t[0].fit.x+t[0].actualW,maxY:t[0].fit.y+t[0].actualH})},b0=(e,t)=>{let n=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2;return e.reduce((i,r)=>{if(!r.fit)return i;let a=r.fit.x+r.actualW/2,s=r.fit.y+r.actualH/2;return i+Math.abs(a-n)+Math.abs(s-o)},0)},M0=e=>{let t=[];e:for(let n=0;n<e.length;n++){let o=e[n];if(!(o.w<=0||o.h<=0)){for(let i=0;i<e.length;i++)if(n!==i&&w0(e[i],o))continue e;t.some(i=>i.x===o.x&&i.y===o.y&&i.w===o.w&&i.h===o.h)||t.push(o)}}return t},P0=(e,t)=>{let n=[];for(let o of e){if(!y0(o,t)){n.push(o);continue}t.x>o.x&&n.push({x:o.x,y:o.y,w:t.x-o.x,h:o.h}),t.x+t.w<o.x+o.w&&n.push({x:t.x+t.w,y:o.y,w:o.x+o.w-(t.x+t.w),h:o.h}),t.y>o.y&&n.push({x:o.x,y:o.y,w:o.w,h:t.y-o.y}),t.y+t.h<o.y+o.h&&n.push({x:o.x,y:t.y+t.h,w:o.w,h:o.y+o.h-(t.y+t.h)})}return M0(n)},I0=(e,t,n,o)=>{let i=e.x+e.w-t.packedW,r=e.y+e.h-t.packedH,a=[{x:e.x,y:e.y},{x:i,y:e.y},{x:e.x,y:r},{x:i,y:r}];return n==="center-distance"&&a.push({x:bc(o.x-t.actualW/2,e.x,i),y:bc(o.y-t.actualH/2,e.y,r)}),a.filter((s,l,d)=>d.findIndex(c=>c.x===s.x&&c.y===s.y)===l)},S0=(e,t,n,o,i,r,a)=>{let s=e.w*e.h-t.packedW*t.packedH,l=e.w-t.packedW,d=e.h-t.packedH,c=Math.min(l,d),u=Math.max(l,d);if(o==="best-area-fit")return[s,c,u,n.y,n.x];let h=i?{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2}:{x:r/2,y:a/2},m=n.x+t.actualW/2,f=n.y+t.actualH/2,g=Math.abs(m-h.x)+Math.abs(f-h.y),E=i?{minX:Math.min(i.minX,n.x),minY:Math.min(i.minY,n.y),maxX:Math.max(i.maxX,n.x+t.actualW),maxY:Math.max(i.maxY,n.y+t.actualH)}:{minX:n.x,minY:n.y,maxX:n.x+t.actualW,maxY:n.y+t.actualH},x=E.maxX-E.minX,y=E.maxY-E.minY,w=x*y;return[g,w,s,c,u]},v0=(e,t,n,o)=>{let i=[{x:0,y:0,w:t,h:n}];for(let l of e){let d=Mc(e),c=null;for(let u of i){if(l.packedW>u.w||l.packedH>u.h)continue;let h=d?{x:(d.minX+d.maxX)/2,y:(d.minY+d.maxY)/2}:{x:t/2,y:n/2},m=I0(u,l,o,h);for(let f of m){let g=S0(u,l,f,o,d,t,n);(!c||E0(g,c.score)<0)&&(c={x:f.x,y:f.y,score:g})}}if(!c)return null;l.fit={x:c.x,y:c.y},i=P0(i,{x:c.x,y:c.y,w:l.packedW,h:l.packedH})}let r=Mc(e);if(!r)return{width:0,height:0,spread:0};let a=r.minX,s=r.minY;return e.forEach(l=>{l.fit&&(l.fit={x:l.fit.x-a,y:l.fit.y-s})}),{width:r.maxX-r.minX,height:r.maxY-r.minY,spread:b0(e,{minX:0,minY:0,maxX:r.maxX-r.minX,maxY:r.maxY-r.minY})}},Pc=(e,t={})=>{let n=Math.max(t.gap??0,0),o=t.heuristic??"best-area-fit";if(e.forEach(d=>{d.fit=null}),e.length===0)return{width:0,height:0};let i=e.map(d=>({source:d,actualW:d.w,actualH:d.h,packedW:d.w+n,packedH:d.h+n,fit:null})).sort(x0),r=i.reduce((d,c)=>d+c.packedW*c.packedH,0),a=Math.max(...i.map(d=>d.packedW)),s=Math.max(...i.map(d=>d.packedH)),l=null;for(let d of f0){let c=r*d;for(let u of g0){let h=Math.max(a,Math.ceil(Math.sqrt(c*u))),m=Math.max(s,Math.ceil(c/h)),f=i.map(M=>({...M,fit:null})),g=v0(f,h,m,o);if(!g)continue;let E={width:g.width,height:g.height,spread:g.spread,blocks:f};if(!l){l=E;continue}let x=E.width*E.height-l.width*l.height,y=Math.abs(E.width-E.height),w=Math.abs(l.width-l.height);(x<0||x===0&&(y<w||y===w&&(E.spread<l.spread||E.spread===l.spread&&E.width+E.height<l.width+l.height)))&&(l=E)}if(l)break}return l?(l.blocks.forEach(d=>{d.source.fit=d.fit}),{width:l.width,height:l.height}):null};var A0=(e,t,n)=>{let o=Fe(t),i=n.x-o.minX,r=n.y-o.minY;t.forEach(a=>{e.mutateElement(a,{x:a.x+i,y:a.y+r})})},Ic=e=>e.map(t=>({w:t.boundingBox.width,h:t.boundingBox.height,group:t.group})).sort((t,n)=>n.w*n.h-t.w*t.h||Math.max(n.w,n.h)-Math.max(t.w,t.h)||n.h-t.h||n.w-t.w),Sc=(e,t,n)=>{let o=t.filter(i=>i.fit);return o.forEach(i=>{A0(e,i.group,{x:n.x+(i.fit?.x??0),y:n.y+(i.fit?.y??0)})}),o.flatMap(i=>i.group)},vc=(e,t,n)=>{let o=t.flatMap(l=>l.group),i=Fe(o),r={x:i.minX,y:i.minY},a=Ic(t);return new pr(n).fit(a),Sc(e,a,r)},Ka=(e,t,n,o)=>{let i=t.flatMap(d=>d.group),r=Fe(i),a={x:r.minX,y:r.minY},s=Ic(t);return Pc(s,{gap:n,heuristic:o})?Sc(e,s,a):(console.warn(`Packing heuristic [${o}] failed - using binary tree packer`),vc(e,t,n))},x6=(e,t,n,o,i)=>{let a=or(t,n).map(s=>({group:s,boundingBox:Fe(s)}));switch(o){case"bin-packing":case"bin-packing-center":return Ka(e,a,i,"center-distance");case"bin-packing-max-rects":return Ka(e,a,i,"best-area-fit");case"bin-packing-binary-tree":return vc(e,a,i);default:return console.warn(`Unimplemented algorithm [${o}] - using bin-packing`),Ka(e,a,i,"center-distance")}};I();import{arrayToMap as bf,arrayToObject as an,assertNever as Yc,isDevEnv as Dn,isShallowEqual as Xc,isTestEnv as Gn,randomInteger as Uc}from"@excalidraw/common";I();import{assertNever as N0,COLOR_PALETTE as H0,isDevEnv as z0,isTestEnv as W0,randomId as _0,Emitter as Tc,toIterable as ho}from"@excalidraw/common";I();import{ORIG_ID as C0,randomId as kc,randomInteger as B0,arrayToMap as D0,castArray as Qa,findLastIndex as po,getUpdatedTimestamp as G0,isTestEnv as O0}from"@excalidraw/common";I();import{arrayToMap as k0}from"@excalidraw/common";var T0=e=>{let t=(i,r)=>i.groupIds[i.groupIds.length-r-1],n=(i,r)=>{let a=new Map,s=[];for(let l of i){let d=t(l,r);if(d===void 0){s.push(l);continue}let c=a.get(d);c||(c=[],a.set(d,c),s.push(d)),c.push(l)}return s.flatMap(l=>typeof l=="string"?n(a.get(l),r+1):[l])},o=n(e,0);return o.length!==e.length?(console.error("defragmentGroups: lost some elements... bailing!"),e):o},L0=e=>{let t=k0(e),n=new Set;for(let o of e)if(!n.has(o)){if(o.boundElements?.length){n.add(o);for(let i of o.boundElements){let r=t.get(i.id);r&&i.type==="text"&&n.add(r)}continue}o.type==="text"&&o.containerId&&t.get(o.containerId)?.boundElements?.some(i=>i.id===o.id)||n.add(o)}return n.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...n]},Ac=e=>L0(T0(e));var R0=(e,t,n,o)=>{let i=es(n);return O0()&&F0(i,n.id),i.id=kc(),i.updated=G0(),o&&(i.seed=B0(),ad(i)),i.groupIds=Nd(i.groupIds,e,r=>(t.has(r)||t.set(r,kc()),t.get(r))),i},B6=e=>{let{elements:t}=e,n="appState"in e?e.appState:{editingGroupId:null,selectedGroupIds:{}},o=new Map,i=new Map,r=[],a=[],s=new Map,l=new Map,d=new Map,c=D0(t),u=e.type==="in-place"?e.idsOfElementsToDuplicate:new Map(t.map(x=>[x.id,x])),h=e.type==="everything"&&e.preserveFrameChildrenOrder;if(e.type==="in-place")for(let x of Object.keys(e.appState.selectedGroupIds))t.filter(y=>y.groupIds?.includes(x)).forEach(y=>u.set(y.id,y));t=Ac(t);let m=t.slice(),f=x=>{let w=Qa(x).reduce((M,b)=>{if(o.has(b.id))return M;o.set(b.id,!0);let S=R0(n.editingGroupId,i,b,e.randomizeSeed);return o.set(S.id,!0),d.set(S.id,S),s.set(b.id,S.id),l.set(S.id,b),a.push(b),r.push(S),M.push(S),M},[]);return Array.isArray(x)?w:w[0]||null},g=(x,y)=>{if(y){if(x>m.length-1){m.push(...Qa(y));return}m.splice(x+1,0,...Qa(y))}},E=new Set(t.filter(x=>u.has(x.id)&&ee(x)).map(x=>x.id));for(let x of t){if(o.has(x.id)||!u.has(x.id))continue;let y=Fa(n,x);if(y){let w=ze(t,y).flatMap(b=>ee(b)&&!h?[...kn(t,b.id),b]:[b]),M=po(m,b=>b.groupIds?.includes(y));g(M,f(w));continue}if(!(!h&&x.frameId&&E.has(x.frameId))){if(ee(x)){let w=x.id;if(h){g(po(m,S=>S.id===w),f(x));continue}let M=kn(t,w),b=po(m,S=>S.frameId===w||S.id===w);g(b,f([...M,x]));continue}if(Ct(x)){let w=Z(x,c),M=po(m,b=>b.id===x.id||"containerId"in b&&b.containerId===x.id);w?g(M,f([x,w])):g(M,f(x));continue}if(Ee(x)){let w=De(x,c),M=po(m,b=>b.id===x.id||b.id===w?.id);w?g(M,f([w,x])):g(M,f(x));continue}g(po(m,w=>w.id===x.id),f(x))}}if(fd(r,s,d),Ad(m,a,s),e.overrides)for(let x of r){let y=l.get(x.id);y&&Object.assign(x,e.overrides({duplicateElement:x,origElement:y,origIdToDuplicateId:s}))}return{duplicatedElements:r,duplicateElementsMap:d,elementsWithDuplicates:m,origIdToDuplicateId:s}},Ja=(e,t=0)=>{if(e==null||typeof e!="object")return e;let n=Object.prototype.toString.call(e);if(n==="[object Object]"){let o=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let i in e)if(e.hasOwnProperty(i)){if(t===0&&(i==="shape"||i==="canvas"))continue;o[i]=Ja(e[i],t+1)}return o}if(Array.isArray(e)){let o=e.length,i=new Array(o);for(;o--;)i[o]=Ja(e[o],t+1);return i}return C.DEV&&n!=="[object Object]"&&n!=="[object Array]"&&n.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},es=e=>Ja(e),F0=(e,t)=>{Object.defineProperty(e,C0,{value:t,writable:!1,enumerable:!1})};var Je={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},Lc=class{constructor(t){this.app=t}onDurableIncrementEmitter=new Tc;onStoreIncrementEmitter=new Tc;scheduledMacroActions=new Set;scheduledMicroActions=[];_snapshot=Bn.empty();get snapshot(){return this._snapshot}set snapshot(t){this._snapshot=t}scheduleAction(t){this.scheduledMacroActions.add(t),this.satisfiesScheduledActionsInvariant()}scheduleCapture(){this.scheduleAction(Je.IMMEDIATELY)}scheduleMicroAction(t){let{action:n}=t,o;if("change"in t)o=t.change;else{let r=Bn.create(this.app.scene.getElementsMapIncludingDeleted(),this.app.state),a=r.maybeClone(n,t.elements?Sd(t.elements):void 0,t.appState);o=ni.create(r,a)}let i="delta"in t?t.delta:void 0;this.scheduledMicroActions.push(()=>this.processAction({action:n,change:o,delta:i}))}commit(t,n){this.flushMicroActions();try{let o=this.getScheduledMacroAction();this.processAction({action:o,elements:t,appState:n})}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledMacroActions=new Set}}clear(){this.snapshot=Bn.empty(),this.scheduledMacroActions=new Set}emitDurableIncrement(t,n=void 0,o=void 0){let i=this.snapshot,r,a;if(n?r=n:r=ni.create(i,t),o?a=o:a=os.calculate(i,t),!a.isEmpty()){let s=new ts(r,a);this.onDurableIncrementEmitter.trigger(s),this.onStoreIncrementEmitter.trigger(s)}}emitEphemeralIncrement(t,n=void 0){let o;if(n)o=n;else{let r=this.snapshot;o=ni.create(r,t)}let i=new ns(o);this.onStoreIncrementEmitter.trigger(i)}applyChangeToSnapshot(t){let n=this.snapshot,o=this.snapshot.applyChange(t);return n===o?null:o}maybeCloneSnapshot(t,n,o){if(!n&&!o)return null;let i=this.snapshot,r=this.snapshot.maybeClone(t,n,o);return i===r?null:r}flushMicroActions(){for(let t of this.scheduledMicroActions)try{t()}catch(n){console.error("Failed to execute scheduled micro action",n)}this.scheduledMicroActions=[]}processAction(t){let{action:n}=t;if(n===Je.EVENTUALLY&&!this.onStoreIncrementEmitter.subscribers.length)return;let o;if("change"in t?o=this.applyChangeToSnapshot(t.change):o=this.maybeCloneSnapshot(n,t.elements,t.appState),!o)return;let i="change"in t?t.change:void 0,r="delta"in t?t.delta:void 0;try{switch(n){case Je.IMMEDIATELY:this.emitDurableIncrement(o,i,r);break;case Je.NEVER:case Je.EVENTUALLY:this.emitEphemeralIncrement(o,i);break;default:N0(n,"Unknown store action")}}finally{switch(n){case Je.IMMEDIATELY:case Je.NEVER:this.snapshot=o;break}}}getScheduledMacroAction(){let t;return this.scheduledMacroActions.has(Je.IMMEDIATELY)?t=Je.IMMEDIATELY:this.scheduledMacroActions.has(Je.NEVER)?t=Je.NEVER:t=Je.EVENTUALLY,t}satisfiesScheduledActionsInvariant(){if(!(this.scheduledMacroActions.size>=0&&this.scheduledMacroActions.size<=Object.keys(Je).length)){let t=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledMacroActions.size}".`;if(console.error(t,this.scheduledMacroActions.values()),W0()||z0())throw new Error(t)}}},ni=class e{constructor(t,n){this.elements=t;this.appState=n}static create(t,n){let o=n.getChangedElements(t),i=n.getChangedAppState(t);return new e(o,i)}},hr=class{constructor(t,n){this.type=t;this.change=n}static isDurable(t){return t.type==="durable"}static isEphemeral(t){return t.type==="ephemeral"}},ts=class extends hr{constructor(n,o){super("durable",n);this.change=n;this.delta=o}},ns=class extends hr{constructor(n){super("ephemeral",n);this.change=n}},os=class e{constructor(t,n,o){this.id=t;this.elements=n;this.appState=o}static create(t,n,o={id:_0()}){return new this(o.id,t,n)}static calculate(t,n){let o=n.metadata.didElementsChange?Cn.calculate(t.elements,n.elements):Cn.empty(),i=n.metadata.didAppStateChange?Ln.calculate(t.appState,n.appState):Ln.empty();return this.create(o,i)}static restore(t){let{id:n,elements:o,appState:i}=t;return new this(n,Cn.restore(o),Ln.restore(i))}static load({id:t,elements:{added:n,removed:o,updated:i},appState:{delta:r}}){let a=Cn.create(n,o,i),s=Ln.create(r);return new this(t,a,s)}static squash(...t){let n=e.empty();for(let o of t)n.elements.squash(o.elements),n.appState.squash(o.appState);return n}static inverse(t){return this.create(t.elements.inverse(),t.appState.inverse())}static applyTo(t,n,o,i){let[r,a]=t.elements.applyTo(n,Bn.empty().elements,i),[s,l]=t.appState.applyTo(o,r);return[r,s,a||l]}static applyLatestChanges(t,n,o,i){return this.create(t.elements.applyLatestChanges(n,o,i),t.appState,{id:t.id})}static empty(){return e.create(Cn.empty(),Ln.empty())}isEmpty(){return this.elements.isEmpty()&&this.appState.isEmpty()}},Bn=class e{constructor(t,n,o={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t;this.appState=n;this.metadata=o}_lastChangedElementsHash=0;_lastChangedAppStateHash=0;static create(t,n,o={didElementsChange:!1,didAppStateChange:!1}){return new e(t,Cc(n)?n:mo(n),o)}static empty(){return new e(new Map,j0(),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}getChangedElements(t){let n={};for(let o of ho(t.elements))this.elements.get(o.id)||(n[o.id]=He(o,{isDeleted:!0}));for(let o of ho(this.elements))t.elements.get(o.id)!==o&&(n[o.id]=o);return n}getChangedAppState(t){return $.getRightDifferences(t.appState,this.appState).reduce((n,o)=>Object.assign(n,{[o]:this.appState[o]}),{})}isEmpty(){return this.metadata.isEmpty}applyChange(t){let n=new Map(this.elements);for(let[i,r]of Object.entries(t.elements))n.set(i,r);let o=mo({...this.appState,...t.appState});return e.create(n,o,{didElementsChange:Object.keys(t.elements).length>0,didAppStateChange:Object.keys(t.appState).length>0})}maybeClone(t,n,o){let i={shouldCompareHashes:!1};t===Je.EVENTUALLY&&(i.shouldCompareHashes=!0);let r=this.maybeCreateElementsSnapshot(n,i),a=this.maybeCreateAppStateSnapshot(o,i),s=!1,l=!1;return this.elements!==r&&(s=!0),this.appState!==a&&(l=!0),!s&&!l?this:new e(r,a,{didElementsChange:s,didAppStateChange:l})}maybeCreateAppStateSnapshot(t,n={shouldCompareHashes:!1}){if(!t)return this.appState;let o=Cc(t)?t:mo(t);return this.detectChangedAppState(o,n)?o:this.appState}maybeCreateElementsSnapshot(t,n={shouldCompareHashes:!1}){if(!t)return this.elements;let o=this.detectChangedElements(t,n);return o?.size?this.createElementsSnapshot(o):this.elements}detectChangedAppState(t,n={shouldCompareHashes:!1}){if(this.appState===t)return;let o=$.isRightDifferent(this.appState,t);if(!o)return;let i=Gc(JSON.stringify(t));if(!(n.shouldCompareHashes&&this._lastChangedAppStateHash===i))return this._lastChangedAppStateHash=i,o}detectChangedElements(t,n={shouldCompareHashes:!1}){if(this.elements===t)return;let o=new Map;for(let r of ho(this.elements))t.get(r.id)||o.set(r.id,He(r,{isDeleted:!0}));for(let r of ho(t)){let a=this.elements.get(r.id);if(!a||a.version<r.version){if(Ae(r)&&!zn(r))continue;o.set(r.id,r)}}if(!o.size)return;let i=Dc(o);if(!(n.shouldCompareHashes&&this._lastChangedElementsHash===i))return this._lastChangedElementsHash=i,o}createElementsSnapshot(t){let n=new Map;for(let o of ho(this.elements))n.set(o.id,o);for(let o of ho(t))n.set(o.id,es(o));return n}},Bc="__observedAppState",j0=()=>({name:null,editingGroupId:null,viewBackgroundColor:H0.white,selectedElementIds:{},selectedGroupIds:{},selectedLinearElement:null,croppingElementId:null,activeLockedId:null,lockedMultiSelections:{}}),mo=e=>{let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,croppingElementId:e.croppingElementId,activeLockedId:e.activeLockedId,lockedMultiSelections:e.lockedMultiSelections,selectedLinearElement:e.selectedLinearElement?{elementId:e.selectedLinearElement.elementId,isEditing:!!e.selectedLinearElement.isEditing}:null};return Reflect.defineProperty(t,Bc,{value:!0,enumerable:!1}),t},Cc=e=>!!Reflect.get(e,Bc);I();var Vc=si(Hc(),1);import{randomInteger as lf,arrayToMap as df,toBrandedType as zc,isDevEnv as Wc,isTestEnv as _c,toArray as cf}from"@excalidraw/common";import{isNonDeletedElement as uf}from"@excalidraw/element";import{isFrameLikeElement as pf}from"@excalidraw/element";import{getElementsInGroup as hf}from"@excalidraw/element";import{syncInvalidIndices as mf,syncMovedIndices as ff,validateFractionalIndices as gf}from"@excalidraw/element";import{getSelectedElements as Ef}from"@excalidraw/element";import{mutateElement as xf}from"@excalidraw/element";var jc=e=>{let t=new Map,n=[];for(let o of e)o.isDeleted||(n.push(o),t.set(o.id,o));return{elementsMap:t,elements:n}},yf=(0,Vc.default)(e=>{(Wc()||_c()||window?.DEBUG_FRACTIONAL_INDICES)&&gf(e,{shouldThrow:Wc()||_c(),includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),wf=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],n="";for(let o of t)n+=`${o}:${e[o]?"1":"0"}`;return n},fo=class{callbacks=new Set;nonDeletedElements=[];nonDeletedElementsMap=zc(new Map);elements=[];nonDeletedFramesLikes=[];frames=[];elementsMap=zc(new Map);selectedElementsCache={selectedElementIds:null,elements:null,cache:new Map};sceneNonce;getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}constructor(t=null,n){t&&this.replaceAllElements(t,n)}getSelectedElements(t){let n=wf(t),o=t?.elements||this.nonDeletedElements;if(this.selectedElementsCache.elements===o&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let r=this.selectedElementsCache.cache.get(n);if(r)return r}else t?.elements==null&&this.selectedElementsCache.cache.clear();let i=Ef(o,{selectedElementIds:t.selectedElementIds},t);return t?.elements==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(n,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let n=this.getElement(t);return n&&uf(n)?n:null}mapElements(t){let n=!1,o=this.elements.map(i=>{let r=t(i);return r!==i&&(n=!0),r});return n&&this.replaceAllElements(o),n}replaceAllElements(t,n){let o=cf(t),i=[];n?.skipValidation||yf(o),this.elements=mf(o),this.elementsMap.clear(),this.elements.forEach(a=>{pf(a)&&i.push(a),this.elementsMap.set(a.id,a)});let r=jc(this.elements);this.nonDeletedElements=r.elements,this.nonDeletedElementsMap=r.elementsMap,this.frames=i,this.nonDeletedFramesLikes=jc(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=lf();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),this.callbacks.clear()}insertElementsAtIndex(t,n){if(!t.length)return;if(n===null&&(n=this.elements.length),!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let o=[...this.elements.slice(0,n),...t,...this.elements.slice(n)];ff(o,df(t)),this.replaceAllElements(o)}insertElement=t=>{this.insertElementsAtIndex([t],null)};getElementIndex(t){return this.elements.findIndex(n=>n.id===t)}getContainerElement=t=>t&&t.containerId&&this.getElement(t.containerId)||null;getElementsFromId=t=>{let n=this.getNonDeletedElementsMap(),o=n.get(t);return o?[o]:hf(n,t)};mutateElement(t,n,o={informMutation:!0,isDragging:!1}){let i=this.getNonDeletedElementsMap(),{version:r}=t,{version:a}=xf(t,i,n,o);return this.elementsMap.has(t.id)&&r!==a&&o.informMutation&&this.triggerUpdate(),t}};var $=class e{constructor(t,n){this.deleted=t;this.inserted=n}static create(t,n,o,i){let r=o&&i!=="inserted"?o(t,"deleted"):t,a=o&&i!=="deleted"?o(n,"inserted"):n;return new e(r,a)}static calculate(t,n,o,i){if(t===n)return e.empty();let r={},a={};for(let d of this.getDifferences(t,n))r[d]=t[d],a[d]=n[d];let[s,l]=i?i(r,a):[r,a];return e.create(s,l,o)}static empty(){return new e({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static merge(t,n,o=e.empty()){return e.create({...t.deleted,...n.deleted,...o.deleted},{...t.inserted,...n.inserted,...o.inserted})}static mergeObjects(t,n,o={}){let i={...t};for(let r of Object.keys(o))delete i[r];return{...i,...n}}static mergeArrays(t,n,o,i){return Object.values(e.mergeObjects(an(t??[],i),an(n??[],i),an(o??[],i)))}static diffObjects(t,n,o,i){if(!t[o]&&!n[o])return;let r=t[o]!==null&&typeof t[o]=="object",a=n[o]!==null&&typeof n[o]=="object";if(r||a){let s=t[o]??{},l=n[o]??{},d=e.getLeftDifferences(s,l).reduce((u,h)=>(u[h]=i(s[h]),u),{}),c=e.getRightDifferences(s,l).reduce((u,h)=>(u[h]=i(l[h]),u),{});Object.keys(d).length||Object.keys(c).length?(Reflect.set(t,o,d),Reflect.set(n,o,c)):(Reflect.deleteProperty(t,o),Reflect.deleteProperty(n,o))}else t[o]===n[o]&&(Reflect.deleteProperty(t,o),Reflect.deleteProperty(n,o))}static diffArrays(t,n,o,i){if(!(!t[o]&&!n[o])&&(Array.isArray(t[o])||Array.isArray(n[o]))){let r=Array.isArray(t[o])?t[o]:[],a=Array.isArray(n[o])?n[o]:[],s=an(e.getLeftDifferences(an(r,i),an(a,i)),d=>d),l=an(e.getRightDifferences(an(r,i),an(a,i)),d=>d);if(Object.keys(s).length||Object.keys(l).length){let d=r.filter(u=>s[i?i(u):String(u)]),c=a.filter(u=>l[i?i(u):String(u)]);Reflect.set(t,o,d),Reflect.set(n,o,c)}else Reflect.deleteProperty(t,o),Reflect.deleteProperty(n,o)}}static isLeftDifferent(t,n,o=!1){return!!this.distinctKeysIterator("left",t,n,o).next().value}static isRightDifferent(t,n,o=!1){return!!this.distinctKeysIterator("right",t,n,o).next().value}static isInnerDifferent(t,n,o=!1){return!!!!this.distinctKeysIterator("inner",t,n,o).next().value}static isDifferent(t,n,o=!1){return!!!!this.distinctKeysIterator("full",t,n,o).next().value}static getLeftDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("left",t,n,o)).sort()}static getRightDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("right",t,n,o)).sort()}static getInnerDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("inner",t,n,o)).sort()}static getDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("full",t,n,o)).sort()}static*distinctKeysIterator(t,n,o,i=!1){if(n===o)return;let r=[];t==="left"?r=Object.keys(n):t==="right"?r=Object.keys(o):t==="inner"?r=Object.keys(n).filter(a=>a in o):t==="full"?r=Array.from(new Set([...Object.keys(n),...Object.keys(o)])):Yc(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let a of r){let s=n[a],l=o[a];if(s!==l){if(!i&&typeof s=="object"&&typeof l=="object"&&s!==null&&l!==null&&Xc(s,l))continue;yield a}}}},Ln=class e{constructor(t){this.delta=t}static create(t){return new e(t)}static calculate(t,n){let o=$.calculate(t,n,e.orderAppStateKeys,e.postProcess);return new e(o)}static restore(t){let{delta:n}=t;return new e(n)}static empty(){return new e($.create({},{}))}inverse(){let t=$.create(this.delta.inserted,this.delta.deleted);return new e(t)}squash(t){if(t.isEmpty())return this;let n=$.mergeObjects(this.delta.deleted.selectedElementIds??{},t.delta.deleted.selectedElementIds??{}),o=$.mergeObjects(this.delta.inserted.selectedElementIds??{},t.delta.inserted.selectedElementIds??{}),i=$.mergeObjects(this.delta.deleted.selectedGroupIds??{},t.delta.deleted.selectedGroupIds??{}),r=$.mergeObjects(this.delta.inserted.selectedGroupIds??{},t.delta.inserted.selectedGroupIds??{}),a=$.mergeObjects(this.delta.deleted.lockedMultiSelections??{},t.delta.deleted.lockedMultiSelections??{}),s=$.mergeObjects(this.delta.inserted.lockedMultiSelections??{},t.delta.inserted.lockedMultiSelections??{}),l={},d={};return(Object.keys(n).length||Object.keys(o).length)&&(d.selectedElementIds=n,l.selectedElementIds=o),(Object.keys(i).length||Object.keys(r).length)&&(d.selectedGroupIds=i,l.selectedGroupIds=r),(Object.keys(a).length||Object.keys(s).length)&&(d.lockedMultiSelections=a,l.lockedMultiSelections=s),this.delta=$.merge(this.delta,t.delta,$.create(d,l)),this}applyTo(t,n){try{let{selectedElementIds:o={},selectedGroupIds:i={},lockedMultiSelections:r={}}=this.delta.deleted,{selectedElementIds:a={},selectedGroupIds:s={},lockedMultiSelections:l={},selectedLinearElement:d,...c}=this.delta.inserted,u=$.mergeObjects(t.selectedElementIds,a,o),h=$.mergeObjects(t.selectedGroupIds,s,i),m=$.mergeObjects(t.lockedMultiSelections,l,r),f=d&&n.has(d.elementId)?new R(n.get(d.elementId),n,d.isEditing):null,g={...t,...c,selectedElementIds:u,selectedGroupIds:h,lockedMultiSelections:m,selectedLinearElement:typeof d<"u"?f:t.selectedLinearElement},E=this.filterInvisibleChanges(t,g,n);return[g,E]}catch(o){if(console.error("Couldn't apply appstate change",o),Gn()||Dn())throw o;return[t,!1]}}isEmpty(){return $.isEmpty(this.delta)}filterInvisibleChanges(t,n,o){let i=mo(t),r=mo(n),a=$.isRightDifferent(e.stripElementsProps(i),e.stripElementsProps(r)),s=$.isRightDifferent(e.stripStandaloneProps(i),e.stripStandaloneProps(r));if(!a&&!s)return!1;let l={value:a};if(s){let d=$.getRightDifferences(e.stripStandaloneProps(i),e.stripStandaloneProps(r)),c=new Set;(d.includes("editingGroupId")||d.includes("selectedGroupIds"))&&(c=Od(o));for(let u of d)switch(u){case"selectedElementIds":n[u]=e.filterSelectedElements(n[u],o,l);break;case"selectedGroupIds":n[u]=e.filterSelectedGroups(n[u],c,l);break;case"croppingElementId":{let y=n[u];if(!y)l.value=!0;else{let w=o.get(y);w&&!w.isDeleted?l.value=!0:n[u]=null}break}case"editingGroupId":let h=n[u];h?c.has(h)?l.value=!0:n[u]=null:l.value=!0;break;case"selectedLinearElement":let m=n[u];if(!m)l.value=!0;else{let y=o.get(m.elementId);y&&!y.isDeleted?l.value=!0:n[u]=null}break;case"lockedMultiSelections":let f=t[u]||{},g=n[u]||{};Xc(f,g)||(l.value=!0);break;case"activeLockedId":let E=t[u]||null,x=n[u]||null;E!==x&&(l.value=!0);break;default:Yc(u,`Unknown ObservedElementsAppState's key "${u}"`,!0)}}return l.value}static filterSelectedElements(t,n,o){let i=Object.keys(t);if(!i.length)return o.value=!0,t;let r={...t};for(let a of i){let s=n.get(a);s&&!s.isDeleted?o.value=!0:delete r[a]}return r}static filterSelectedGroups(t,n,o){if(!Object.keys(t).length)return o.value=!0,t;let r={...t};for(let a of Object.keys(r))n.has(a)?o.value=!0:delete r[a];return r}static stripElementsProps(t){let{editingGroupId:n,selectedGroupIds:o,selectedElementIds:i,selectedLinearElement:r,croppingElementId:a,lockedMultiSelections:s,activeLockedId:l,...d}=t;return d}static stripStandaloneProps(t){let{name:n,viewBackgroundColor:o,...i}=t;return i}static postProcess(t,n){try{$.diffObjects(t,n,"selectedElementIds",o=>!0),$.diffObjects(t,n,"selectedGroupIds",o=>o??!1),$.diffObjects(t,n,"lockedMultiSelections",o=>o??{})}catch(o){if(console.error("Couldn't postprocess appstate change deltas."),Gn()||Dn())throw o}finally{return[t,n]}}static orderAppStateKeys(t){let n={};for(let o of Object.keys(t).sort())n[o]=t[o];return n}},Cn=class e{constructor(t,n,o){this.added=t;this.removed=n;this.updated=o}static create(t,n,o,i={shouldRedistribute:!1}){let r;if(i.shouldRedistribute){let a={},s={},l={},d=[...Object.entries(t),...Object.entries(n),...Object.entries(o)];for(let[c,u]of d)this.satisfiesAddition(u)?a[c]=u:this.satisfiesRemoval(u)?s[c]=u:l[c]=u;r=new e(a,s,l)}else r=new e(t,n,o);return(Gn()||Dn())&&(e.validate(r,"added",this.satisfiesAddition),e.validate(r,"removed",this.satisfiesRemoval),e.validate(r,"updated",this.satisfiesUpdate)),r}static restore(t){let{added:n,removed:o,updated:i}=t;return e.create(n,o,i)}static satisfiesAddition=({deleted:t,inserted:n})=>t.isDeleted===!0&&!n.isDeleted;static satisfiesRemoval=({deleted:t,inserted:n})=>!t.isDeleted&&n.isDeleted===!0;static satisfiesUpdate=({deleted:t,inserted:n})=>!!t.isDeleted==!!n.isDeleted;static satisfiesCommmonInvariants=({deleted:t,inserted:n})=>!!(Number.isInteger(t.version)&&Number.isInteger(n.version)&&t.version>=0&&n.version>=0&&t.version!==n.version);static satisfiesUniqueInvariants=(t,n)=>{let{added:o,removed:i,updated:r}=t;return[o[n],i[n],r[n]].filter(Boolean).length===1};static validate(t,n,o){for(let[i,r]of Object.entries(t[n]))if(!this.satisfiesCommmonInvariants(r)||!this.satisfiesUniqueInvariants(t,i)||!o(r))throw console.error(`Broken invariant for "${n}" delta, element "${i}", delta:`,r),new Error(`ElementsDelta invariant broken for element "${i}".`)}static calculate(t,n){if(t===n)return e.empty();let o={},i={},r={};for(let a of t.values())if(!n.get(a.id)){let l={...a},d={isDeleted:!0,version:a.version+1,versionNonce:Uc()},c=$.create(l,d,e.stripIrrelevantProps);a.isDeleted?r[a.id]=c:i[a.id]=c}for(let a of n.values()){let s=t.get(a.id);if(!s){let l={isDeleted:!0,version:a.version-1,versionNonce:Uc()},d={...a},c=$.create(l,d,e.stripIrrelevantProps);a.isDeleted?r[a.id]=c:o[a.id]=c;continue}if(s.versionNonce!==a.versionNonce){let l=$.calculate(s,a,e.stripIrrelevantProps,e.postProcess);if(typeof s.isDeleted=="boolean"&&typeof a.isDeleted=="boolean"&&s.isDeleted!==a.isDeleted){s.isDeleted&&!a.isDeleted?o[a.id]=l:i[a.id]=l;continue}r[a.id]=l}}return e.create(o,i,r)}static empty(){return e.create({},{},{})}inverse(){let t=r=>{let a={};for(let[s,{inserted:l,deleted:d}]of Object.entries(r))a[s]=$.create({...l},{...d});return a},n=t(this.added),o=t(this.removed),i=t(this.updated);return e.create(o,n,i)}isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.removed).length===0&&Object.keys(this.updated).length===0}applyLatestChanges(t,n,o){let i=(d,c)=>(u,h)=>{let m;switch(h){case"deleted":m=d;break;case"inserted":m=c;break}if(!m)return console.error("Element not found when trying to apply latest changes"),u;let f={};for(let g of Object.keys(u))switch(g){case"boundElements":f[g]=u[g];break;default:f[g]=m[g]}return f},r=d=>{let c={};for(let[u,h]of Object.entries(d)){let m=t.get(u),f=n.get(u),g=null;m||f?g=$.create(h.deleted,h.inserted,i(m,f),o):g=h,$.isInnerDifferent(g.deleted,g.inserted)&&(c[u]=g)}return c},a=r(this.added),s=r(this.removed),l=r(this.updated);return e.create(a,s,l,{shouldRedistribute:!0})}applyTo(t,n=Bn.empty().elements,o){let i=new Map(t),r,a={containsVisibleDifference:!1,containsZindexDifference:!1,applyDirection:void 0};try{let s=e.createApplier(t,i,n,a,o),l=s(this.added),d=s(this.removed),c=s(this.updated),u=this.resolveConflicts(t,i,a.applyDirection);r=new Map([...l,...d,...c,...u])}catch(s){if(console.error("Couldn't apply elements delta",s),Gn()||Dn())throw s;return[t,!0]}try{i=e.reorderElements(i,r,a),e.redrawElements(i,r)}catch(s){if(console.error("Couldn't mutate elements after applying elements change",s),Gn()||Dn())throw s}finally{return[i,a.containsVisibleDifference]}}squash(t){if(t.isEmpty())return this;let{added:n,removed:o,updated:i}=t,r=(a,s)=>{let l=$.mergeArrays(a.deleted.boundElements??[],s.deleted.boundElements??[],void 0,c=>c.id)??[],d=$.mergeArrays(a.inserted.boundElements??[],s.inserted.boundElements??[],void 0,c=>c.id)??[];if(!(!l.length&&!d.length))return $.create({boundElements:l},{boundElements:d})};for(let[a,s]of Object.entries(n)){let l=this.added[a]??this.removed[a]??this.updated[a];if(!l)this.added[a]=s;else{let d=r(l,s);delete this.removed[a],delete this.updated[a],this.added[a]=$.merge(l,s,d)}}for(let[a,s]of Object.entries(o)){let l=this.added[a]??this.removed[a]??this.updated[a];if(!l)this.removed[a]=s;else{let d=r(l,s);delete this.added[a],delete this.updated[a],this.removed[a]=$.merge(l,s,d)}}for(let[a,s]of Object.entries(i)){let l=this.added[a]??this.removed[a]??this.updated[a];if(!l)this.updated[a]=s;else{let d=r(l,s),c=$.merge(l,s,d);l===this.added[a]?this.added[a]=c:l===this.removed[a]?this.removed[a]=c:this.updated[a]=c}}return(Gn()||Dn())&&(e.validate(this,"added",e.satisfiesAddition),e.validate(this,"removed",e.satisfiesRemoval),e.validate(this,"updated",e.satisfiesUpdate)),this}static createApplier=(t,n,o,i,r)=>a=>{let s=e.createGetter(n,o,i);return Object.entries(a).reduce((l,[d,c])=>{let u=s(d,c.inserted);if(u){let h=e.applyDelta(u,c,i,r);if(n.set(h.id,h),l.set(h.id,h),!i.applyDirection){let m=t.get(d);m&&(i.applyDirection=m.version>h.version?"backward":"forward")}}return l},new Map)};static createGetter=(t,n,o)=>(i,r)=>{let a=t.get(i);return a||(a=n.get(i),a?(o.containsZindexDifference=!0,(!r.isDeleted||r.isDeleted&&!a.isDeleted)&&(o.containsVisibleDifference=!0)):a=He({id:i,version:1},{...r})),a};static applyDelta(t,n,o,i){let r={};for(let a of Object.keys(n.inserted)){if(a==="boundElements"||i?.excludedProperties?.has(a))continue;let s=n.inserted[a];Reflect.set(r,a,s)}if(n.deleted.boundElements?.length||n.inserted.boundElements?.length){let a=$.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,s=>s.id);Object.assign(r,{boundElements:a})}if(!o.containsVisibleDifference){let{index:a,...s}=r,l=e.checkForVisibleDifference(t,s);o.containsVisibleDifference=l}return o.containsZindexDifference||(o.containsZindexDifference=n.deleted.index!==n.inserted.index),He(t,r,!0)}static checkForVisibleDifference(t,n){return t.isDeleted&&n.isDeleted!==!1?!1:t.isDeleted&&n.isDeleted===!1||t.isDeleted===!1&&n.isDeleted?!0:$.isRightDifferent(t,n)}resolveConflicts(t,n,o="forward"){let i=new Map,r=(s,l)=>{let d=n.get(s.id);if(!d)return;let c=t.get(s.id),u=o==="forward"?d.version+1:d.version-1,h=l,m;c===d?m=He(d,{...h,version:u},!0):m=Te(d,n,{...h,version:c?.version!==d.version?d.version:u}),i.set(m.id,m),n.set(m.id,m)};for(let s of Object.keys(this.removed))e.unbindAffected(t,n,s,r);for(let s of Object.keys(this.added))e.rebindAffected(t,n,s,r);for(let[s]of Array.from(Object.entries(this.updated)).filter(([l,d])=>Object.keys({...d.deleted,...d.inserted}).find(c=>gd.has(c)))){let l=n.get(s);!l||l.isDeleted||e.rebindAffected(t,n,s,r)}let a=new Map(Array.from(t).filter(([s])=>i.has(s)));return this.squash(e.calculate(a,i)),i}static unbindAffected(t,n,o,i){let r=()=>t.get(o),a=()=>n.get(o);Pn.unbindAffected(n,r(),i),Pn.unbindAffected(n,a(),i),In.unbindAffected(n,r(),i),In.unbindAffected(n,a(),i)}static rebindAffected(t,n,o,i){let r=()=>t.get(o),a=()=>n.get(o);Pn.unbindAffected(n,r(),i),Pn.rebindAffected(n,a(),i),In.unbindAffected(n,r(),(s,l)=>{te(s)&&i(s,l)}),In.rebindAffected(n,a(),i)}static redrawElements(t,n){try{let o=new fo(t,{skipValidation:!0});e.redrawTextBoundingBoxes(o,n),e.redrawBoundArrows(o,n)}catch(o){if(console.error("Couldn't redraw elements",o),Gn()||Dn())throw o}finally{return t}}static redrawTextBoundingBoxes(t,n){let o=t.getNonDeletedElementsMap(),i=new Map;for(let r of n.values()){if(Ee(r)){let{containerId:a}=r,s=a?o.get(a):void 0;s&&i.set(s.id,{container:s,boundText:r})}if(Ct(r)){let a=Qt(r),s=a?o.get(a):void 0;s&&i.set(r.id,{container:r,boundText:s})}}for(let{container:r,boundText:a}of i.values())r.isDeleted||a.isDeleted||Oi(a,r,t)}static redrawBoundArrows(t,n){for(let o of n.values())!o.isDeleted&&ge(o)&&Re(o,t,{changedElements:n})}static reorderElements(t,n,o){if(!o.containsZindexDifference)return t;let i=Array.from(t.values()),r=Id([...i]),a=$.getRightDifferences(i,r,!0).reduce((s,l)=>{let d=i[Number(l)];return d&&n.has(d.id)&&s.set(d.id,d),s},new Map);return!o.containsVisibleDifference&&a.size&&(o.containsVisibleDifference=!0),bf(Yn(r,a))}static postProcess(t,n){try{$.diffArrays(t,n,"boundElements",r=>r.id);let o=t.points??[],i=n.points??[];$.isDifferent(o,i)||(Reflect.deleteProperty(t,"points"),Reflect.deleteProperty(n,"points"))}catch(o){if(console.error("Couldn't postprocess elements delta."),Gn()||Dn())throw o}finally{return[t,n]}}static stripIrrelevantProps(t){let{id:n,updated:o,...i}=t;return i}};I();var f4=(e,t,n,o,i)=>{let[r,a,s,l]=n.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],d=Fe(e),c=ir(e,t,o).map(f=>[f,Fe(f)]).sort((f,g)=>f[1][a]-g[1][a]),u=0;for(let f of c)u+=f[1][l];let h=(d[l]-u)/(c.length-1);if(h<0){let f=c.findIndex(y=>y[1][r]===d[r]),g=c.findIndex(y=>y[1][s]===d[s]),E=(c[g][1][a]-c[f][1][a])/(c.length-1),x=c[f][1][a];return c.flatMap(([y,w],M)=>{let b={x:0,y:0};return M!==f&&M!==g&&(x+=E,b[n.axis]=x-w[a]),y.map(S=>{let v=i.mutateElement(S,{x:S.x+b.x,y:S.y+b.y});return Re(S,i,{simultaneouslyUpdated:y}),v})})}let m=d[r];return c.flatMap(([f,g])=>{let E={x:0,y:0};return E[n.axis]=m-g[r],m+=h,m+=g[l],f.map(x=>{let y=i.mutateElement(x,{x:x.x+E.x,y:x.y+E.y});return Re(x,i,{simultaneouslyUpdated:f}),y})})};I();import{TEXT_AUTOWRAP_THRESHOLD as Mf,getGridPoint as Pf,getFontString as If,DRAGGING_THRESHOLD as Sf}from"@excalidraw/common";var S4=(e,t,n,o,i,r)=>{if(t.length===1&&U(t[0])&&(t[0].startBinding||t[0].endBinding))return;let a=t.filter(h=>{if(U(h)&&h.startBinding&&h.endBinding){let m=t.find(g=>g.id===h.startBinding?.elementId),f=t.find(g=>g.id===h.endBinding?.elementId);return m&&f}return!0}),s=new Set(a),l=a.filter(h=>ee(h)).map(h=>h.id);if(l.length>0)for(let h of o.getNonDeletedElements())h.frameId!==null&&l.includes(h.frameId)&&s.add(h);let d=[];for(let h of s){let m=e.originalElements.get(h.id);if(!m)return;d.push(m)}let c=vf(We(d),n,i,r),u=new Set(Array.from(s,h=>h.id));s.forEach(h=>{let m=!j(h),f=m||(h.startBinding?u.has(h.startBinding.elementId):!1),g=m||(h.endBinding?u.has(h.endBinding.elementId):!1);if(j(h)){if(s.size>1||Math.max(Math.abs(c.x),Math.abs(c.y))>Sf||!h.startBinding&&!h.endBinding){rs(e,h,o,c);let E=h.startBinding&&!f,x=h.endBinding&&!g;(E||x)&&(E&&Oe(h,"start",o),x&&Oe(h,"end",o))}}else{rs(e,h,o,c);let E=Z(h,o.getNonDeletedElementsMap());E&&rs(e,E,o,c),Re(h,o,{simultaneouslyUpdated:Array.from(s)})}})},vf=(e,t,n,o)=>{let[i,r]=e,a=i+t.x+n.x,s=r+t.y+n.y;if(n.x===0||n.y===0){let[l,d]=Pf(i+t.x,r+t.y,o);n.x===0&&(a=l),n.y===0&&(s=d)}return{x:a-i,y:s-r}},rs=(e,t,n,o)=>{let i=e.originalElements.get(t.id)??t,r=i.x+o.x,a=i.y+o.y;n.mutateElement(t,{x:r,y:a})},v4=(e,t,n)=>{let[o,i]=We(e);return[t-o,n-i]},A4=({newElement:e,elementType:t,originX:n,originY:o,x:i,y:r,width:a,height:s,shouldMaintainAspectRatio:l,shouldResizeFromCenter:d,zoom:c,scene:u,widthAspectRatio:h=null,originOffset:m=null,informMutation:f=!0})=>{l&&e.type!=="selection"&&(h?s=a/h:(Math.abs(r-o)>Math.abs(i-n)?{width:a,height:s}=qa(t,s,i<n?-a:a):{width:a,height:s}=qa(t,a,r<o?-s:s),s<0&&(s=-s)));let g=i<n?n-a:n,E=r<o?o-s:o;d&&(a+=a,s+=s,g=n-a/2,E=o-s/2);let x=null;if(te(e)){s=e.height;let y=Ci(If({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);a=Math.max(a,y),Math.abs(i-n)>Mf/c&&(x={autoResize:!1}),E=o,d&&(g=n-a/2)}if(a!==0&&s!==0){let y=null;Ae(e)&&(y={initialWidth:a,initialHeight:s}),u.mutateElement(e,{x:g+(m?.x??0),y:E+(m?.y??0),width:a,height:s,...x,...y},{informMutation:f,isDragging:!1})}};I();import{ELEMENT_LINK_KEY as fr,normalizeLink as $c}from"@excalidraw/common";var B4=(e,t)=>{let n=window.location.href;try{let o=new URL(n);return o.searchParams.set(fr,e),$c(o.toString())}catch(o){console.error(o)}return $c(n)},D4=(e,t)=>{if(e.length>0&&Af(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},Af=e=>!!(e.length===1||e.length>1&&Rd(e)),G4=e=>{try{let t=new URL(e);return t.searchParams.has(fr)&&t.host===window.location.host}catch{return!1}},O4=e=>{try{let{searchParams:t}=new URL(e);if(t.has(fr))return t.get(fr)}catch{}return null};I();import{FONT_FAMILY as Hf,VERTICAL_ALIGN as zf,escapeDoubleQuotes as as,getFontString as Wf}from"@excalidraw/common";I();import{DEFAULT_ELEMENT_PROPS as On,DEFAULT_FONT_FAMILY as kf,DEFAULT_FONT_SIZE as Tf,DEFAULT_TEXT_ALIGN as Lf,DEFAULT_VERTICAL_ALIGN as Cf,VERTICAL_ALIGN as Bf,randomInteger as Df,randomId as Gf,getFontString as gr,getUpdatedTimestamp as Of,getLineHeight as Rf}from"@excalidraw/common";var St=(e,{x:t,y:n,strokeColor:o=On.strokeColor,backgroundColor:i=On.backgroundColor,fillStyle:r=On.fillStyle,strokeWidth:a=On.strokeWidth,strokeStyle:s=On.strokeStyle,roughness:l=On.roughness,opacity:d=On.opacity,width:c=0,height:u=0,angle:h=0,groupIds:m=[],frameId:f=null,index:g=null,roundness:E=null,boundElements:x=null,link:y=null,locked:w=On.locked,...M})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||c<-1e6||c>1e6||u<-1e6||u>1e6)&&console.error("New element size or position is too large",{x:t,y:n,width:c,height:u,points:M.points}),{id:M.id||Gf(),type:e,x:t,y:n,width:c,height:u,angle:h,strokeColor:o,backgroundColor:i,fillStyle:r,strokeWidth:a,strokeStyle:s,roughness:l,opacity:d,groupIds:m,frameId:f,index:g,roundness:E,seed:M.seed??Df(),version:M.version||1,versionNonce:M.versionNonce??0,isDeleted:!1,boundElements:x,updated:Of(),link:y,locked:w,customData:M.customData}),qn=e=>St(e.type,e),U4=e=>St("embeddable",e),Y4=e=>({...St("iframe",e)}),Zc=e=>He({...St("frame",e),type:"frame",name:e?.name||null},{}),qc=e=>He({...St("magicframe",e),type:"magicframe",name:e?.name||null},{}),Kc=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),Kn=e=>{let t=e.fontFamily||kf,n=e.fontSize||Tf,o=e.lineHeight||Rf(t),i=Ro(e.text),r=ot(i,gr({fontFamily:t,fontSize:n}),o),a=e.textAlign||Lf,s=e.verticalAlign||Cf,l=Kc({textAlign:a,verticalAlign:s},r),d={...St("text",e),text:i,fontSize:n,fontFamily:t,textAlign:a,verticalAlign:s,x:e.x-l.x,y:e.y-l.y,width:r.width,height:r.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:o};return He(d,{})},Ff=(e,t,n)=>{let{width:o,height:i}=ot(n,gr(e),e.lineHeight);e.autoResize||(o=e.width);let{textAlign:r,verticalAlign:a}=e,s,l;if(r==="center"&&a===Bf.MIDDLE&&!e.containerId&&e.autoResize){let d=ot(e.text,gr(e),e.lineHeight),c=Kc(e,{width:o-d.width,height:i-d.height});s=e.x-c.x,l=e.y-c.y}else{let[d,c,u,h]=Q(e,t),[m,f,g,E]=pn(e,o,i,!1),x=(d-m)/2,y=(c-f)/2,w=(u-g)/2,M=(h-E)/2;[s,l]=Nf({s:!0,e:r==="center"||r==="left",w:r==="center"||r==="right"},e.x,e.y,e.angle,x,y,w,M)}return{width:o,height:i,x:Number.isFinite(s)?s:e.x,y:Number.isFinite(l)?l:e.y}},Nf=(e,t,n,o,i,r,a,s)=>{let l=Math.cos(o),d=Math.sin(o);return e.e&&e.w?t+=i+a:e.e?(t+=i*(1+l),n+=i*d,t+=a*(1-l),n+=a*-d):e.w&&(t+=i*(1-l),n+=i*-d,t+=a*(1+l),n+=a*d),e.n&&e.s?n+=r+s:e.n?(t+=r*d,n+=r*(1-l),t+=s*-d,n+=s*(1+l)):e.s&&(t+=r*-d,n+=r*(1+l),t+=s*d,n+=s*(1-l)),[t,n]},X4=(e,t,n,o=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(o=Kt(o,gr(e),t?yt(t,e):e.width));let i=Ff(e,n,o);return{text:o,...i}},$4=e=>({...St(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure}),Qc=e=>{let t={...St(e.type,e),points:e.points||[],startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null};return Ut(t)?{...t,polygon:e.polygon??!1}:t},Er=e=>e.elbowed?{...St(e.type,e),points:e.points||[],startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...St(e.type,e),points:e.points||[],startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},Jc=e=>({...St("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,fileName:e.fileName??null,scale:e.scale??[1,1],crop:e.crop??null});var vt=new Map,_f=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)/,jf=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,Vf=/^https:\/\/(?:www\.)?figma\.com/,eu=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,Uf=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,Yf=/^(?:https?:\/\/)?forms\.microsoft\.com\//,tu=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,Xf=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,$f=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,Zf=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,nu=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,ou=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,qf=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,ru=e=>{let t;try{let a=new URL(e.startsWith("http")?e:`https://${e}`);t=a.searchParams.get("t")||a.searchParams.get("start")}catch{t=e.match(/[?&#](?:t|start)=([^&#\s]+)/)?.[1]}if(!t)return 0;if(/^\d+$/.test(t))return parseInt(t,10);let n=t.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(!n)return 0;let[,o="0",i="0",r="0"]=n;return parseInt(o)*3600+parseInt(i)*60+parseInt(r)},Kf=e=>{try{let t=new URL(e.startsWith("http")?e:`https://${e}`);if(t.hostname.replace(/^www\./,"")!=="drive.google.com")return null;let o=null,i=t.pathname.match(/^\/file\/d\/([^/]+)(?:\/|$)/);if(i?.[1]?o=i[1]:(t.pathname==="/open"||t.pathname==="/uc")&&(o=t.searchParams.get("id")),!o||!/^[a-zA-Z0-9_-]+$/.test(o))return null;let r=t.searchParams.get("resourcekey"),a=ru(t.toString());return{fileId:o,resourceKey:r&&/^[a-zA-Z0-9_-]+$/.test(r)?r:void 0,timestamp:a>0?a:void 0}}catch{return null}},ls=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","drive.google.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com","forms.microsoft.com"]),iu=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","drive.google.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com","forms.microsoft.com"]),ss=e=>`<html><body>${e}</body></html>`,t5=e=>{if(!e)return null;if(vt.has(e))return vt.get(e);let t=e,n=iu.has(ds(e,iu)||""),o="generic",i={w:560,h:840},r=e.match(_f);if(r?.[2]){let c=ru(t),u=c>0?`&start=${c}`:"",h=e.includes("shorts");switch(o="video",r[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${u}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${r[2]}&enablejsapi=1${u}`;break;default:e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${u}`;break}return i=h?{w:315,h:560}:{w:560,h:315},vt.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}}let a=e.match(jf);if(a?.[1]){let c=a?.[1],u=/^\d+$/.test(c)?void 0:new URIError("Invalid embed link format");return o="video",e=`https://player.vimeo.com/video/${c}?api=1`,i={w:560,h:315},vt.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,error:u,sandbox:{allowSameOrigin:n}}}let s=Kf(e);if(s){o="video";let c=new URLSearchParams;s.resourceKey&&c.set("resourcekey",s.resourceKey),s.timestamp&&c.set("t",`${s.timestamp}`);let u=c.toString();return e=`https://drive.google.com/file/d/${s.fileId}/preview${u?`?${u}`:""}`,i={w:560,h:315},vt.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}}if(e.match(Vf))return o="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},vt.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}};let d=e.match($f);if(d)return e=d[1]==="embed"?d[0]:d[0].replace("/v","/embed"),vt.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}};if(Yf.test(e)&&!e.includes("embed=true")&&(e+=e.includes("?")?"&embed=true":"?embed=true"),tu.test(e)){let c=e.match(tu)[1],u=as(`https://twitter.com/x/status/${c}`),h={type:"document",srcdoc:m=>ss(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${m}"><a href="${u}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return vt.set(t,h),h}if(ou.test(e)){let[,c,u,h]=e.match(ou),m=as(`https://reddit.com/r/${c}/comments/${u}/${h}`),f={type:"document",srcdoc:g=>ss(`<blockquote class="reddit-embed-bq" data-embed-theme="${g}"><a href="${m}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return vt.set(t,f),f}if(eu.test(e)){let[,c,u]=e.match(eu),h=as(`https://gist.github.com/${c}/${u}`),m={type:"document",srcdoc:()=>ss(`
21
+ C ${l} ${d}, ${l} ${d}, ${l+E} ${d+x}`,Qe(e,!0,a))}else s=t.polygon([[l,d],[c,u],[h,m],[g,f]],Qe(e,!1,a));return s}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,Qe(e,!1,a));case"line":case"arrow":{let s,l=Qe(e,!1,a),d=e.points.length?e.points:[me(0,0)];if(Y(e)?d.every(c=>Math.abs(c[0])<=1e6&&Math.abs(c[1])<=1e6)?s=[t.path(ic(d,16),Qe(e,!0,a))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(d)),s=[]):e.roundness?s=[t.curve(d,l)]:l.fill?s=[t.polygon(d,l)]:s=[t.linearPath(d,l)],e.type==="arrow"){let{startArrowhead:c=null,endArrowhead:u="arrow"}=e;if(c!==null){let h=tc(e,s,"start",c,t,l,o,a);s.push(...h)}if(u!==null){let h=tc(e,s,"end",u,t,l,o,a);s.push(...h)}}return s}case"freedraw":{let s=[];if(Ut(e.points)){let l=So(e.points,.75);s.push(t.curve(l,{...Qe(e,!1,a),stroke:"none"}))}return s.push(Hm(e)),s}case"frame":case"magicframe":case"text":case"image":return null;default:return Dm(e,`generateElementShape(): Unimplemented type ${e?.type}`),null}},ic=(e,t)=>{let n=[];for(let i=1;i<e.length-1;i+=1){let r=e[i-1],a=e[i+1],s=e[i],l=yt(s,r),d=yt(a,s),c=Math.min(t,Jd(e[i],a)/2,Jd(e[i],r)/2);l?r[0]<s[0]?n.push([e[i][0]-c,e[i][1]]):n.push([e[i][0]+c,e[i][1]]):r[1]<s[1]?n.push([e[i][0],e[i][1]-c]):n.push([e[i][0],e[i][1]+c]),n.push(e[i]),d?a[0]<s[0]?n.push([e[i][0]-c,e[i][1]]):n.push([e[i][0]+c,e[i][1]]):a[1]<s[1]?n.push([e[i][0],e[i][1]-c]):n.push([e[i][0],e[i][1]+c])}let o=[`M ${e[0][0]} ${e[0][1]}`];for(let i=0;i<n.length;i+=3)o.push(`L ${n[i][0]} ${n[i][1]}`),o.push(`Q ${n[i+1][0]} ${n[i+1][1]}, ${n[i+2][0]} ${n[i+2][1]}`);return o.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),o.join(" ")},Qo=(e,t)=>{switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return Vs(e);case"arrow":case"line":{let n=at.generateElementShape(e,null)[0],[,,,,o,i]=K(e,t);return Di(e)?$s(e,n,me(e.x,e.y),e.angle,me(o,i)):Us(n,me(e.x,e.y),e.angle,me(o,i))}case"ellipse":return Ys(e);case"freedraw":{let[,,,,n,o]=K(e,t);return Xs(e,me(n,o),Di(e))}}},Ud=(e,t)=>{let n=[...e.points];if(t){if(!ml(e.points))return null;let i=n[0],r=n[n.length-1];Math.hypot(i[0]-r[0],i[1]-r[1])>Om||n.length<4?n.push(me(i[0],i[1])):n[n.length-1]=me(i[0],i[1])}return{polygon:t,points:n}},Hm=e=>_m(zm(e)),zm=e=>{let t=e.simulatePressure?e.points:e.points.length?e.points.map(([n,o],i)=>[n,o,e.pressures[i]]):[[0,0,.5]];return tl(t,{simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:n=>Math.sin(n*Math.PI/2),last:!0})},nc=(e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2],Wm=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g,_m=e=>{if(!e.length)return"";let t=e.length-1;return e.reduce((n,o,i,r)=>(i===t?n.push(o,nc(o,r[0]),"L",r[0],"Z"):n.push(o,nc(o,r[i+1])),n),["M",e[0],"Q"]).join(" ").replace(Wm,"$1")};var ja=class e{static boundsCache=new WeakMap;static nonRotatedBoundsCache=new WeakMap;static getBounds(t,n,o=!1){let i=o&&t.angle!==0?e.nonRotatedBoundsCache.get(t):e.boundsCache.get(t);if(i?.version&&i.version===t.version&&!xe(t))return i.bounds;if(o&&t.angle!==0){let a=e.calculateBounds({...t,angle:0},n);return e.nonRotatedBoundsCache.set(t,{version:t.version,bounds:a}),a}let r=e.calculateBounds(t,n);return e.boundsCache.set(t,{version:t.version,bounds:r}),r}static calculateBounds(t,n){let o,[i,r,a,s,l,d]=K(t,n);if(Se(t)){let[c,u,h,m]=Ya(t.points.map(([g,f])=>ie(B(g,f),B(l-t.x,d-t.y),t.angle)));return[c+t.x,u+t.y,h+t.x,m+t.y]}else if(ne(t))o=Jm(t,l,d,n);else if(t.type==="diamond"){let[c,u]=ie(B(l,r),B(l,d),t.angle),[h,m]=ie(B(l,s),B(l,d),t.angle),[g,f]=ie(B(i,d),B(l,d),t.angle),[E,x]=ie(B(a,d),B(l,d),t.angle),y=Math.min(c,h,g,E),w=Math.min(u,m,f,x),M=Math.max(c,h,g,E),b=Math.max(u,m,f,x);o=[y,w,M,b]}else if(t.type==="ellipse"){let c=(a-i)/2,u=(s-r)/2,h=Math.cos(t.angle),m=Math.sin(t.angle),g=Math.hypot(c*h,u*m),f=Math.hypot(u*h,c*m);o=[l-g,d-f,l+g,d+f]}else{let[c,u]=ie(B(i,r),B(l,d),t.angle),[h,m]=ie(B(i,s),B(l,d),t.angle),[g,f]=ie(B(a,s),B(l,d),t.angle),[E,x]=ie(B(a,r),B(l,d),t.angle),y=Math.min(c,h,g,E),w=Math.min(u,m,f,x),M=Math.max(c,h,g,E),b=Math.max(u,m,f,x);o=[y,w,M,b]}return o}},K=(e,t,n=!1)=>{if(Se(e))return Xm(e);if(ne(e))return D.getElementAbsoluteCoords(e,t,n);if(te(e)){let o=t?De(e,t):null;if(j(o)){let{x:i,y:r}=D.getBoundTextElementPosition(o,e,t);return[i,r,i+e.width,r+e.height,i+e.width/2,r+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},ka=(e,t)=>{let n=Qo(e,t),[o,i,r,a,s,l]=K(e,t),d=B(s,l);if(n.type==="polycurve"){let x=n.data.map(w=>zt(w,10)),y=[];if(jt(e)&&!e.polygon||j(e))for(let w of x){let M=0;for(;M<w.length-1;)y.push(fe(B(w[M][0],w[M][1]),B(w[M+1][0],w[M+1][1]))),M++}else{let w=x.flat(),M=0;for(;M<w.length-1;)y.push(fe(B(w[M][0],w[M][1]),B(w[M+1][0],w[M+1][1]))),M++}return y}else{if(n.type==="polyline")return n.data;if(Ym(e)){let[E,x]=pn(e),y=x.map(M=>sc(M,d,e.angle)).flat();return[...ac(E,d,e.angle),...y]}else if(e.type==="diamond"){let[E,x]=hn(e),y=x.map(M=>sc(M,d,e.angle)).flat();return[...ac(E,d,e.angle),...y]}else if(n.type==="polygon"){if(te(e)){let y=De(e,t);if(y&&ne(y))return[fe(B(o,i),B(r,i)),fe(B(r,i),B(r,a)),fe(B(r,a),B(o,a)),fe(B(o,a),B(o,i))]}let E=n.data,x=[];for(let y=0;y<E.length-1;y++)x.push(fe(E[y],E[y+1]));return x}else if(n.type==="ellipse")return Um(e)}let[c,u,h,m,,,g,f]=[[o,i],[r,i],[o,a],[r,a],[s,i],[s,a],[o,l],[r,l]].map(E=>ie(E,d,e.angle));return[fe(c,u),fe(h,m),fe(c,h),fe(u,m),fe(c,f),fe(h,f),fe(u,g),fe(m,g)]},Ym=e=>e!=null&&(e.type==="rectangle"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),ac=(e,t,n)=>e.map(o=>fe(ie(o[0],t,n),ie(o[1],t,n))),sc=(e,t,n)=>{let o=zt(e,10),i=0,r=[];for(;i<o.length-1;)r.push(fe(ie(B(o[i][0],o[i][1]),t,n),ie(B(o[i+1][0],o[i+1][1]),t,n))),i++;return r},Um=e=>{let t=B(e.x+e.width/2,e.y+e.height/2),n=e.width/2,o=e.height/2,i=[],r=[],a=90,s=Math.PI*2/a;for(let l=0;l<a;l++){let d=l*s,c=t[0]+n*Math.cos(d),u=t[1]+o*Math.sin(d);r.push(ie(B(c,u),t,e.angle))}for(let l=0;l<r.length-1;l++)i.push(fe(r[l],r[l+1]));return i.push(fe(r[r.length-1],r[0])),i},kb=e=>[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2],to=e=>{let t=Math.floor(e.width/2)+1,n=0,o=e.width,i=Math.floor(e.height/2)+1,r=t,a=e.height;return[t,n,o,i,r,a,0,i]},lc=(e,t,n,o,i)=>{let r=1-e;return Math.pow(r,3)*t+3*Math.pow(r,2)*e*n+3*r*Math.pow(e,2)*o+Math.pow(e,3)*i},dc=(e,t,n,o)=>{let i=t-e,r=n-t,a=o-n,s=3*i-6*r+3*a,l=6*r-6*i,d=3*i,c=l*l-4*s*d;if(!(c>=0))return!1;let h=null,m=null,g=1/0,f=1/0;return s===0?g=f=-d/l:(g=(-l+Math.sqrt(c))/(2*s),f=(-l-Math.sqrt(c))/(2*s)),g>=0&&g<=1&&(h=lc(g,e,t,n,o)),f>=0&&f<=1&&(m=lc(f,e,t,n,o)),[h,m]},Oi=(e,t,n,o)=>{let i=dc(e[0],t[0],n[0],o[0]),r=dc(e[1],t[1],n[1],o[1]),a=Math.min(e[0],o[0]),s=Math.max(e[0],o[0]);if(i){let c=i.filter(u=>u!==null);a=Math.min(a,...c),s=Math.max(s,...c)}let l=Math.min(e[1],o[1]),d=Math.max(e[1],o[1]);if(r){let c=r.filter(u=>u!==null);l=Math.min(l,...c),d=Math.max(d,...c)}return[a,l,s,d]},Xo=(e,t)=>{let n=B(0,0),{minX:o,minY:i,maxX:r,maxY:a}=e.reduce((s,{op:l,data:d})=>{if(l==="move"){let c=cc(d);_a(c!=null,"Op data is not a point"),n=c}else if(l==="bcurveTo"){let c=B(d[0],d[1]),u=B(d[2],d[3]),h=B(d[4],d[5]),m=t?t(c):c,g=t?t(u):u,f=t?t(h):h,E=t?t(n):n;n=h;let[x,y,w,M]=Oi(E,m,g,f);s.minX=Math.min(s.minX,x),s.minY=Math.min(s.minY,y),s.maxX=Math.max(s.maxX,w),s.maxY=Math.max(s.maxY,M)}return s},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[o,i,r,a]},Ya=(e,t=0)=>{let n=1/0,o=1/0,i=-1/0,r=-1/0;for(let[a,s]of e)n=Math.min(n,a),o=Math.min(o,s),i=Math.max(i,a),r=Math.max(r,s);return[n-t,o-t,i+t,r+t]},Xm=e=>{let[t,n,o,i]=Ya(e.points),r=t+e.x,a=n+e.y,s=o+e.x,l=i+e.y;return[r,a,s,l,(r+s)/2,(a+l)/2]},$m=20,Zm=15,qm=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"cardinality_many":case"cardinality_one_or_many":case"cardinality_zero_or_many":return Zm;case"cardinality_one":case"cardinality_exactly_one":case"cardinality_zero_or_one":return $m;default:return 15}},Km=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},je=(e,t,n,o,i=0)=>{if(o===null||t.length<1)return null;let r=Wt(t[0]);if(r.length<1)return null;let a=n==="start"?1:r.length-1,s=r[a].data;_a(s.length===6,"Op data length is not 6");let l=B(s[4],s[5]),d=B(s[2],s[3]),c=B(s[0],s[1]),u=r[a-1],h=B(0,0);if(u.op==="move"){let A=cc(u.data);_a(A!=null,"Op data is not a point"),h=A}else u.op==="bcurveTo"&&(h=B(u.data[4],u.data[5]));let m=(A,_)=>Math.pow(1-A,3)*l[_]+3*A*Math.pow(1-A,2)*d[_]+3*Math.pow(A,2)*(1-A)*c[_]+h[_]*Math.pow(A,3),[g,f]=n==="start"?h:l,[E,x]=[m(.3,0),m(.3,1)],y=Math.hypot(g-E,f-x),w=(g-E)/y,M=(f-x)/y,b=qm(o),S=0;{let[A,_]=n==="end"?e.points[e.points.length-1]:e.points[0],[X,ve]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];S=Math.hypot(A-X,_-ve)}let k=Math.min(b,S*(o==="diamond"||o==="diamond_outline"?.25:.5)),T=g-w*k*i,R=f-M*k*i,O=T-w*k,N=R-M*k;if(o==="circle"||o==="circle_outline"){let A=Math.hypot(N-R,O-T)+e.strokeWidth-2;return[T,R,A]}let G=Km(o);if(o==="cardinality_many"||o==="cardinality_one_or_many"){let[A,_]=ie(B(T,R),B(O,N),Wa(-G)),[X,ve]=ie(B(T,R),B(O,N),Wa(G));return[O,N,A,_,X,ve]}let[q,U]=ie(B(O,N),B(T,R),-G*Math.PI/180),[le,H]=ie(B(O,N),B(T,R),Wa(G));if(o==="diamond"||o==="diamond_outline"){let A,_;if(n==="start"){let[X,ve]=e.points.length>1?e.points[1]:[0,0];[A,_]=ie(B(T+k*2,R),B(T,R),Math.atan2(ve-R,X-T))}else{let[X,ve]=e.points.length>1?e.points[e.points.length-2]:[0,0];[A,_]=ie(B(T-k*2,R),B(T,R),Math.atan2(R-ve,T-X))}return[T,R,q,U,A,_,le,H]}return[T,R,q,U,le,H]},Qm=e=>{let t=Nn.generator(),n=Qe(e),o=e.roundness?"curve":n.fill?"polygon":"linearPath";return t[o](e.points,n)},Jm=(e,t,n,o)=>{let i=Q(e,o);if(e.points.length<2){let[u,h]=e.points[0],[m,g]=ie(B(e.x+u,e.y+h),B(t,n),e.angle),f=[m,g,m,g];if(i){let E=D.getMinMaxXYWithBoundText(e,o,[m,g,m,g],i);f=[E[0],E[1],E[2],E[3]]}return f}let a=at.get(e,null)?.[0]??Qm(e),s=Wt(a),d=Xo(s,([u,h])=>ie(B(e.x+u,e.y+h),B(t,n),e.angle)),c=[d[0],d[1],d[2],d[3]];if(i){let u=D.getMinMaxXYWithBoundText(e,o,c,i);c=[u[0],u[1],u[2],u[3]]}return c},ue=(e,t,n=!1)=>ja.getBounds(e,t,n),We=(e,t)=>{if(!jm(e))return[0,0,0,0];let n=1/0,o=-1/0,i=1/0,r=-1/0,a=t||Va(e);return e.forEach(s=>{let[l,d,c,u]=ue(s,a);n=Math.min(n,l),i=Math.min(i,d),o=Math.max(o,c),r=Math.max(r,u)}),[n,i,o,r]},Tb=(e,t)=>{let[n,o,i,r]=We(e);return[n+t.x,o+t.y,i+t.x,r+t.y]},un=(e,t,n,o)=>{if(!(ne(e)||Se(e)))return[e.x,e.y,e.x+t,e.y+n];let i=rc(0,t,rc(1,n,e.points,o),o),r;if(Se(e))r=Ya(i);else{let c=Nn.generator(),u=e.roundness?c.curve(i,Qe(e)):c.linearPath(i,Qe(e)),h=Wt(u);r=Xo(h)}let[a,s,l,d]=r;return[a+e.x,s+e.y,l+e.x,d+e.y]},Oa=(e,t)=>{let n=Nn.generator(),o=e.roundness==null?n.linearPath(t,Qe(e)):n.curve(t,Qe(e)),i=Wt(o),[r,a,s,l]=Xo(i);return[r+e.x,a+e.y,s+e.x,l+e.y]},Lb=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,o=e[0],i=Va(e);return e.forEach(r=>{let[a,s,l,d]=ue(r,i),c=Vm(B((a+l)/2,(s+d)/2),B(t.x,t.y));c<n&&(n=c,o=r)}),ue(o,i)},Fe=e=>{let[t,n,o,i]=We(e);return{minX:t,minY:n,maxX:o,maxY:i,width:o-t,height:i-n,midX:(t+o)/2,midY:(n+i)/2}},Cb=({scrollX:e,scrollY:t,width:n,height:o,zoom:i})=>[-e,-t,-e+n/i.value,-t+o/i.value],En=e=>B(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),ut=(e,t,n)=>{let o={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},i=de(e,t),[r,a]=ie(B(o.minX,o.minY),i,e.angle),[s,l]=ie(B(o.maxX,o.minY),i,e.angle),[d,c]=ie(B(o.maxX,o.maxY),i,e.angle),[u,h]=ie(B(o.minX,o.maxY),i,e.angle),m=[Math.min(r,s,d,u),Math.min(a,l,c,h),Math.max(r,s,d,u),Math.max(a,l,c,h)];if(n){let[g,f,E,x]=n;return[m[0]-x,m[1]-g,m[2]+f,m[3]+E]}return m},Dt=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],e0=(e,t)=>e[0]>=t[0]&&e[0]<=t[2]&&e[1]>=t[1]&&e[1]<=t[3],Qt=(e,t)=>{if(e==null||t==null)return!1;let[n,o,i,r]=e,[a,s,l,d]=t;return n<l&&i>a&&o<d&&r>s},La=(e,t)=>[B(t[0],t[1]),B(t[0],t[3]),B(t[2],t[1]),B(t[2],t[3])].every(n=>e0(n,e)),vd=({elements:e,elementsMap:t,bounds:n,type:o,excludeElementsInFrames:i,shouldIgnoreElementFromSelection:r})=>{t||(t=Va(e));let a=ul(n)?ue(n,t):n,[s,l,d,c]=a,u=[fe(B(s,l),B(d,l)),fe(B(d,l),B(d,c)),fe(B(d,c),B(s,c)),fe(B(s,c),B(s,l))],h=i?new Set:null,m={},g=new Set;for(let f of e){if(r?.(f))continue;let E=f.groupIds.at(-1);E&&(m[E]||(m[E]=[]),m[E].push(f));let x=f.strokeWidth,y=null,w=ue(f,t);w=[w[0]-x/2,w[1]-x/2,w[2]+x/2,w[3]+x/2];let M=j(f)&&Q(f,t);if(M){let{x:v,y:k}=D.getBoundTextElementPosition(f,M,t);y=[v,k,v+M.width,k+M.height]}let b=Sn(f,t);if(b&&In(f,b,t)){let v=ue(b,t);w=[Math.max(w[0],v[0]),Math.max(w[1],v[1]),Math.min(w[2],v[2]),Math.min(w[3],v[3])],y=y?[Math.max(y[0],v[0]),Math.max(y[1],v[1]),Math.min(y[2],v[2]),Math.min(y[3],v[3])]:null}let S=y?[Math.min(y[0],w[0]),Math.min(y[1],w[1]),Math.max(y[2],w[2]),Math.max(y[3],w[3])]:w;if(La(a,S)){h&&ee(f)&&h.add(f.id),g.add(f);continue}if(o==="overlap"&&y&&Qt(a,y)){g.add(f);continue}if(o==="overlap"&&Qt(a,w)){let v=!1;if(ne(f)||Se(f)){let k=de(f,t);v=f.points.some(T=>{let R=ie(B(f.x+T[0],f.y+T[1]),k,f.angle);return Dt(R,a)})}else{let k=ue(f,t,!0),T=de(f,t);v=[ie(B((k[0]+k[2])/2,k[1]),T,f.angle),ie(B(k[2],(k[1]+k[3])/2),T,f.angle),ie(B((k[0]+k[2])/2,k[3]),T,f.angle),ie(B(k[0],(k[1]+k[3])/2),T,f.angle)].some(R=>Dt(ie(R,T,f.angle),a))}if(v||(v=u.some(k=>Bt(f,t,k,x/2,!0).length>0)),v){h&&ee(f)&&h.add(f.id),g.add(f);continue}}}return h&&g.forEach(f=>{f.frameId&&h.has(f.frameId)&&g.delete(f)}),o==="overlap"?Array.from(g).forEach(f=>{let E=f.groupIds.at(-1);(E?m[E]:null)?.forEach(y=>g.add(y))}):o==="contain"&&g.forEach(f=>{let E=f.groupIds.at(-1),x=E?m[E]:null;x&&!x.every(y=>g.has(y))&&g.delete(f)}),e.filter(f=>g.has(f))},de=(e,t,n=0,o=0)=>{if(ne(e)||Se(e)){let[a,s,l,d]=K(e,t),[c,u]=B((a+l)/2,(s+d)/2);return B(c+n,u+o)}let[i,r]=En(ue(e,t));return B(i+n,r+o)};var i0=.1,pc=e=>ne(e)||Se(e)?e.points.length<2||e.points.length===2&&j(e)&&o0(e.points[0],e.points[e.points.length-1],i0):e.width===0&&e.height===0,Ad=(e,t,n,o,i)=>{let[r,a,s,l]=ue(e,i),d=ar({clientX:o.offsetLeft,clientY:o.offsetTop},o),c=ar({clientX:o.offsetLeft+t,clientY:o.offsetTop+n},o);return d.x<=s&&d.y<=l&&c.x>=r&&c.y>=a},Hb=(e,t,n,o,i,r)=>{let[a,s,l,d]=We(e,i),c=ar({clientX:o.offsetLeft+(r?.left||0),clientY:o.offsetTop+(r?.top||0)},o),u=ar({clientX:o.offsetLeft+t-(r?.right||0),clientY:o.offsetTop+n-(r?.bottom||0)},o);return a>=c.x&&s>=c.y&&l<=u.x&&d<=u.y},Ua=(e,t,n)=>{let o=Math.abs(t),i=Math.abs(n);if(e==="line"||e==="arrow"||e==="freedraw"){let r=Math.round(Math.atan(i/o)/on)*on;r===0?n=0:r===Math.PI/2?t=0:n=o*Math.tan(r)*Math.sign(n)||n}else e!=="selection"&&(n=o*Math.sign(n));return{width:t,height:n}},Xd=(e,t,n,o,i)=>{let r=n-e,a=o-t,s=Math.atan2(a,r),l=Math.round(s/on)*on;if(i){let d=Math.floor(i/on)*on;t0(s,d,d+on)&&(n0(s,i)<on/6?l=i:uc(s)>uc(i)?l=d+on:l=d)}if(l===0)a=0;else if(l===Math.PI/2)r=0;else{let d=Math.tan(l),c=-1,u=t-d*e,h=-1/d,m=-1,g=o-h*n,f=(c*g-m*u)/(d*m-h*c),E=(u*h-g*d)/(d*m-h*c);r=f-e,a=E-t}return{width:r,height:a}},zb=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t};I();var Ub=(e,t,n,o)=>{let i=Qi(e,n.getNonDeletedElementsMap(),o),r=Fe(e);return i.flatMap(a=>{let s=r0(a,r,t);return a.map(l=>{let d=n.mutateElement(l,{x:l.x+s.x,y:l.y+s.y});return Re(l,n,{simultaneouslyUpdated:a}),d})})},r0=(e,t,{axis:n,position:o})=>{let i=Fe(e),[r,a]=n==="x"?["minX","maxX"]:["minY","maxY"],s={x:0,y:0};return o==="start"?{...s,[n]:t[r]-i[r]}:o==="end"?{...s,[n]:t[a]-i[a]}:{...s,[n]:(t[r]+t[a])/2-(i[r]+i[a])/2}};I();I();var sr=class{root;gap;constructor(t=0){this.root=null,this.gap=t}fit(t){let n=t.length,o=n>0?t[0].w:0,i=n>0?t[0].h:0;this.root={x:0,y:0,w:o,h:i};for(let r=0;r<n;r++){let a=t[r],s=this.findNode(this.root,a.w,a.h);s?a.fit=this.splitNode(s,a.w,a.h):a.fit=this.growNode(a.w,a.h)}}findNode(t,n,o){return t?t.used?this.findNode(t.right||null,n,o)||this.findNode(t.down||null,n,o):n<=t.w&&o<=t.h?t:null:null}splitNode(t,n,o){return t.used=!0,t.down={x:t.x,y:t.y+o+this.gap,w:t.w,h:t.h-o-this.gap},t.right={x:t.x+n+this.gap,y:t.y,w:t.w-n-this.gap,h:o},t}growNode(t,n){if(!this.root)return null;let o=t<=this.root.w,i=n<=this.root.h,r=i&&this.root.h>=this.root.w+t+this.gap,a=o&&this.root.w>=this.root.h+n+this.gap;return r?this.growRight(t,n):a?this.growDown(t,n):i?this.growRight(t,n):o?this.growDown(t,n):null}growRight(t,n){if(!this.root)return null;this.root={used:!0,x:0,y:0,w:this.root.w+t+this.gap,h:this.root.h,down:this.root,right:{x:this.root.w+this.gap,y:0,w:t,h:this.root.h}};let o=this.findNode(this.root,t,n);return o?this.splitNode(o,t,n):null}growDown(t,n){if(!this.root)return null;this.root={used:!0,x:0,y:0,w:this.root.w,h:this.root.h+n+this.gap,down:{x:0,y:this.root.h+this.gap,w:this.root.w,h:n},right:this.root};let o=this.findNode(this.root,t,n);return o?this.splitNode(o,t,n):null}};I();var a0=[1,1.08,1.18,1.32,1.5,1.75,2.1,2.6,3.25],s0=[1,4/3,3/4,3/2,2/3,2,1/2],l0=(e,t)=>{let n=Math.max(e.length,t.length);for(let o=0;o<n;o++){let i=(e[o]??0)-(t[o]??0);if(i!==0)return i}return 0},d0=(e,t)=>t.packedW*t.packedH-e.packedW*e.packedH||Math.max(t.packedW,t.packedH)-Math.max(e.packedW,e.packedH)||t.packedH-e.packedH||t.packedW-e.packedW,hc=(e,t,n)=>Math.min(Math.max(e,t),n),c0=(e,t)=>e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y,u0=(e,t)=>t.x>=e.x&&t.y>=e.y&&t.x+t.w<=e.x+e.w&&t.y+t.h<=e.y+e.h,mc=e=>{let t=e.filter(n=>n.fit);return t.length===0?null:t.reduce((n,o)=>({minX:Math.min(n.minX,o.fit.x),minY:Math.min(n.minY,o.fit.y),maxX:Math.max(n.maxX,o.fit.x+o.actualW),maxY:Math.max(n.maxY,o.fit.y+o.actualH)}),{minX:t[0].fit.x,minY:t[0].fit.y,maxX:t[0].fit.x+t[0].actualW,maxY:t[0].fit.y+t[0].actualH})},p0=(e,t)=>{let n=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2;return e.reduce((i,r)=>{if(!r.fit)return i;let a=r.fit.x+r.actualW/2,s=r.fit.y+r.actualH/2;return i+Math.abs(a-n)+Math.abs(s-o)},0)},h0=e=>{let t=[];e:for(let n=0;n<e.length;n++){let o=e[n];if(!(o.w<=0||o.h<=0)){for(let i=0;i<e.length;i++)if(n!==i&&u0(e[i],o))continue e;t.some(i=>i.x===o.x&&i.y===o.y&&i.w===o.w&&i.h===o.h)||t.push(o)}}return t},m0=(e,t)=>{let n=[];for(let o of e){if(!c0(o,t)){n.push(o);continue}t.x>o.x&&n.push({x:o.x,y:o.y,w:t.x-o.x,h:o.h}),t.x+t.w<o.x+o.w&&n.push({x:t.x+t.w,y:o.y,w:o.x+o.w-(t.x+t.w),h:o.h}),t.y>o.y&&n.push({x:o.x,y:o.y,w:o.w,h:t.y-o.y}),t.y+t.h<o.y+o.h&&n.push({x:o.x,y:t.y+t.h,w:o.w,h:o.y+o.h-(t.y+t.h)})}return h0(n)},f0=(e,t,n,o)=>{let i=e.x+e.w-t.packedW,r=e.y+e.h-t.packedH,a=[{x:e.x,y:e.y},{x:i,y:e.y},{x:e.x,y:r},{x:i,y:r}];return n==="center-distance"&&a.push({x:hc(o.x-t.actualW/2,e.x,i),y:hc(o.y-t.actualH/2,e.y,r)}),a.filter((s,l,d)=>d.findIndex(c=>c.x===s.x&&c.y===s.y)===l)},g0=(e,t,n,o,i,r,a)=>{let s=e.w*e.h-t.packedW*t.packedH,l=e.w-t.packedW,d=e.h-t.packedH,c=Math.min(l,d),u=Math.max(l,d);if(o==="best-area-fit")return[s,c,u,n.y,n.x];let h=i?{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2}:{x:r/2,y:a/2},m=n.x+t.actualW/2,g=n.y+t.actualH/2,f=Math.abs(m-h.x)+Math.abs(g-h.y),E=i?{minX:Math.min(i.minX,n.x),minY:Math.min(i.minY,n.y),maxX:Math.max(i.maxX,n.x+t.actualW),maxY:Math.max(i.maxY,n.y+t.actualH)}:{minX:n.x,minY:n.y,maxX:n.x+t.actualW,maxY:n.y+t.actualH},x=E.maxX-E.minX,y=E.maxY-E.minY,w=x*y;return[f,w,s,c,u]},E0=(e,t,n,o)=>{let i=[{x:0,y:0,w:t,h:n}];for(let l of e){let d=mc(e),c=null;for(let u of i){if(l.packedW>u.w||l.packedH>u.h)continue;let h=d?{x:(d.minX+d.maxX)/2,y:(d.minY+d.maxY)/2}:{x:t/2,y:n/2},m=f0(u,l,o,h);for(let g of m){let f=g0(u,l,g,o,d,t,n);(!c||l0(f,c.score)<0)&&(c={x:g.x,y:g.y,score:f})}}if(!c)return null;l.fit={x:c.x,y:c.y},i=m0(i,{x:c.x,y:c.y,w:l.packedW,h:l.packedH})}let r=mc(e);if(!r)return{width:0,height:0,spread:0};let a=r.minX,s=r.minY;return e.forEach(l=>{l.fit&&(l.fit={x:l.fit.x-a,y:l.fit.y-s})}),{width:r.maxX-r.minX,height:r.maxY-r.minY,spread:p0(e,{minX:0,minY:0,maxX:r.maxX-r.minX,maxY:r.maxY-r.minY})}},fc=(e,t={})=>{let n=Math.max(t.gap??0,0),o=t.heuristic??"best-area-fit";if(e.forEach(d=>{d.fit=null}),e.length===0)return{width:0,height:0};let i=e.map(d=>({source:d,actualW:d.w,actualH:d.h,packedW:d.w+n,packedH:d.h+n,fit:null})).sort(d0),r=i.reduce((d,c)=>d+c.packedW*c.packedH,0),a=Math.max(...i.map(d=>d.packedW)),s=Math.max(...i.map(d=>d.packedH)),l=null;for(let d of a0){let c=r*d;for(let u of s0){let h=Math.max(a,Math.ceil(Math.sqrt(c*u))),m=Math.max(s,Math.ceil(c/h)),g=i.map(M=>({...M,fit:null})),f=E0(g,h,m,o);if(!f)continue;let E={width:f.width,height:f.height,spread:f.spread,blocks:g};if(!l){l=E;continue}let x=E.width*E.height-l.width*l.height,y=Math.abs(E.width-E.height),w=Math.abs(l.width-l.height);(x<0||x===0&&(y<w||y===w&&(E.spread<l.spread||E.spread===l.spread&&E.width+E.height<l.width+l.height)))&&(l=E)}if(l)break}return l?(l.blocks.forEach(d=>{d.source.fit=d.fit}),{width:l.width,height:l.height}):null};var x0=(e,t,n)=>{let o=Fe(t),i=n.x-o.minX,r=n.y-o.minY;t.forEach(a=>{e.mutateElement(a,{x:a.x+i,y:a.y+r})})},gc=e=>e.map(t=>({w:t.boundingBox.width,h:t.boundingBox.height,group:t.group})).sort((t,n)=>n.w*n.h-t.w*t.h||Math.max(n.w,n.h)-Math.max(t.w,t.h)||n.h-t.h||n.w-t.w),Ec=(e,t,n)=>{let o=t.filter(i=>i.fit);return o.forEach(i=>{x0(e,i.group,{x:n.x+(i.fit?.x??0),y:n.y+(i.fit?.y??0)})}),o.flatMap(i=>i.group)},xc=(e,t,n)=>{let o=t.flatMap(l=>l.group),i=Fe(o),r={x:i.minX,y:i.minY},a=gc(t);return new sr(n).fit(a),Ec(e,a,r)},Xa=(e,t,n,o)=>{let i=t.flatMap(d=>d.group),r=Fe(i),a={x:r.minX,y:r.minY},s=gc(t);return fc(s,{gap:n,heuristic:o})?Ec(e,s,a):(console.warn(`Packing heuristic [${o}] failed - using binary tree packer`),xc(e,t,n))},o6=(e,t,n,o,i)=>{let a=Ki(t,n).map(s=>({group:s,boundingBox:Fe(s)}));switch(o){case"bin-packing":case"bin-packing-center":return Xa(e,a,i,"center-distance");case"bin-packing-max-rects":return Xa(e,a,i,"best-area-fit");case"bin-packing-binary-tree":return xc(e,a,i);default:return console.warn(`Unimplemented algorithm [${o}] - using bin-packing`),Xa(e,a,i,"center-distance")}};I();import{arrayToMap as pf,arrayToObject as rn,assertNever as Nc,isDevEnv as Bn,isShallowEqual as Hc,isTestEnv as Dn,randomInteger as Fc}from"@excalidraw/common";I();import{assertNever as T0,COLOR_PALETTE as L0,isDevEnv as C0,isTestEnv as B0,randomId as D0,Emitter as bc,toIterable as uo}from"@excalidraw/common";I();import{ORIG_ID as M0,randomId as wc,randomInteger as P0,arrayToMap as I0,castArray as $a,findLastIndex as co,getUpdatedTimestamp as S0,isTestEnv as v0}from"@excalidraw/common";I();import{arrayToMap as y0}from"@excalidraw/common";var w0=e=>{let t=(i,r)=>i.groupIds[i.groupIds.length-r-1],n=(i,r)=>{let a=new Map,s=[];for(let l of i){let d=t(l,r);if(d===void 0){s.push(l);continue}let c=a.get(d);c||(c=[],a.set(d,c),s.push(d)),c.push(l)}return s.flatMap(l=>typeof l=="string"?n(a.get(l),r+1):[l])},o=n(e,0);return o.length!==e.length?(console.error("defragmentGroups: lost some elements... bailing!"),e):o},b0=e=>{let t=y0(e),n=new Set;for(let o of e)if(!n.has(o)){if(o.boundElements?.length){n.add(o);for(let i of o.boundElements){let r=t.get(i.id);r&&i.type==="text"&&n.add(r)}continue}o.type==="text"&&o.containerId&&t.get(o.containerId)?.boundElements?.some(i=>i.id===o.id)||n.add(o)}return n.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...n]},yc=e=>b0(w0(e));var A0=(e,t,n,o)=>{let i=qa(n);return v0()&&k0(i,n.id),i.id=wc(),i.updated=S0(),o&&(i.seed=P0(),od(i)),i.groupIds=Cd(i.groupIds,e,r=>(t.has(r)||t.set(r,wc()),t.get(r))),i},E6=e=>{let{elements:t}=e,n="appState"in e?e.appState:{editingGroupId:null,selectedGroupIds:{}},o=new Map,i=new Map,r=[],a=[],s=new Map,l=new Map,d=new Map,c=I0(t),u=e.type==="in-place"?e.idsOfElementsToDuplicate:new Map(t.map(x=>[x.id,x])),h=e.type==="everything"&&e.preserveFrameChildrenOrder;if(e.type==="in-place")for(let x of Object.keys(e.appState.selectedGroupIds))t.filter(y=>y.groupIds?.includes(x)).forEach(y=>u.set(y.id,y));t=yc(t);let m=t.slice(),g=x=>{let w=$a(x).reduce((M,b)=>{if(o.has(b.id))return M;o.set(b.id,!0);let S=A0(n.editingGroupId,i,b,e.randomizeSeed);return o.set(S.id,!0),d.set(S.id,S),s.set(b.id,S.id),l.set(S.id,b),a.push(b),r.push(S),M.push(S),M},[]);return Array.isArray(x)?w:w[0]||null},f=(x,y)=>{if(y){if(x>m.length-1){m.push(...$a(y));return}m.splice(x+1,0,...$a(y))}},E=new Set(t.filter(x=>u.has(x.id)&&ee(x)).map(x=>x.id));for(let x of t){if(o.has(x.id)||!u.has(x.id))continue;let y=Ba(n,x);if(y){let w=ze(t,y).flatMap(b=>ee(b)&&!h?[...An(t,b.id),b]:[b]),M=co(m,b=>b.groupIds?.includes(y));f(M,g(w));continue}if(!(!h&&x.frameId&&E.has(x.frameId))){if(ee(x)){let w=x.id;if(h){f(co(m,S=>S.id===w),g(x));continue}let M=An(t,w),b=co(m,S=>S.frameId===w||S.id===w);f(b,g([...M,x]));continue}if(Tt(x)){let w=Q(x,c),M=co(m,b=>b.id===x.id||"containerId"in b&&b.containerId===x.id);w?f(M,g([x,w])):f(M,g(x));continue}if(xe(x)){let w=De(x,c),M=co(m,b=>b.id===x.id||b.id===w?.id);w?f(M,g([w,x])):f(M,g(x));continue}f(co(m,w=>w.id===x.id),g(x))}}if(pd(r,s,d),yd(m,a,s),e.overrides)for(let x of r){let y=l.get(x.id);y&&Object.assign(x,e.overrides({duplicateElement:x,origElement:y,origIdToDuplicateId:s}))}return{duplicatedElements:r,duplicateElementsMap:d,elementsWithDuplicates:m,origIdToDuplicateId:s}},Za=(e,t=0)=>{if(e==null||typeof e!="object")return e;let n=Object.prototype.toString.call(e);if(n==="[object Object]"){let o=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let i in e)if(e.hasOwnProperty(i)){if(t===0&&(i==="shape"||i==="canvas"))continue;o[i]=Za(e[i],t+1)}return o}if(Array.isArray(e)){let o=e.length,i=new Array(o);for(;o--;)i[o]=Za(e[o],t+1);return i}return C.DEV&&n!=="[object Object]"&&n!=="[object Array]"&&n.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},qa=e=>Za(e),k0=(e,t)=>{Object.defineProperty(e,M0,{value:t,writable:!1,enumerable:!1})};var Je={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},Mc=class{constructor(t){this.app=t}onDurableIncrementEmitter=new bc;onStoreIncrementEmitter=new bc;scheduledMacroActions=new Set;scheduledMicroActions=[];_snapshot=Cn.empty();get snapshot(){return this._snapshot}set snapshot(t){this._snapshot=t}scheduleAction(t){this.scheduledMacroActions.add(t),this.satisfiesScheduledActionsInvariant()}scheduleCapture(){this.scheduleAction(Je.IMMEDIATELY)}scheduleMicroAction(t){let{action:n}=t,o;if("change"in t)o=t.change;else{let r=Cn.create(this.app.scene.getElementsMapIncludingDeleted(),this.app.state),a=r.maybeClone(n,t.elements?Ed(t.elements):void 0,t.appState);o=Jo.create(r,a)}let i="delta"in t?t.delta:void 0;this.scheduledMicroActions.push(()=>this.processAction({action:n,change:o,delta:i}))}commit(t,n){this.flushMicroActions();try{let o=this.getScheduledMacroAction();this.processAction({action:o,elements:t,appState:n})}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledMacroActions=new Set}}clear(){this.snapshot=Cn.empty(),this.scheduledMacroActions=new Set}emitDurableIncrement(t,n=void 0,o=void 0){let i=this.snapshot,r,a;if(n?r=n:r=Jo.create(i,t),o?a=o:a=Ja.calculate(i,t),!a.isEmpty()){let s=new Ka(r,a);this.onDurableIncrementEmitter.trigger(s),this.onStoreIncrementEmitter.trigger(s)}}emitEphemeralIncrement(t,n=void 0){let o;if(n)o=n;else{let r=this.snapshot;o=Jo.create(r,t)}let i=new Qa(o);this.onStoreIncrementEmitter.trigger(i)}applyChangeToSnapshot(t){let n=this.snapshot,o=this.snapshot.applyChange(t);return n===o?null:o}maybeCloneSnapshot(t,n,o){if(!n&&!o)return null;let i=this.snapshot,r=this.snapshot.maybeClone(t,n,o);return i===r?null:r}flushMicroActions(){for(let t of this.scheduledMicroActions)try{t()}catch(n){console.error("Failed to execute scheduled micro action",n)}this.scheduledMicroActions=[]}processAction(t){let{action:n}=t;if(n===Je.EVENTUALLY&&!this.onStoreIncrementEmitter.subscribers.length)return;let o;if("change"in t?o=this.applyChangeToSnapshot(t.change):o=this.maybeCloneSnapshot(n,t.elements,t.appState),!o)return;let i="change"in t?t.change:void 0,r="delta"in t?t.delta:void 0;try{switch(n){case Je.IMMEDIATELY:this.emitDurableIncrement(o,i,r);break;case Je.NEVER:case Je.EVENTUALLY:this.emitEphemeralIncrement(o,i);break;default:T0(n,"Unknown store action")}}finally{switch(n){case Je.IMMEDIATELY:case Je.NEVER:this.snapshot=o;break}}}getScheduledMacroAction(){let t;return this.scheduledMacroActions.has(Je.IMMEDIATELY)?t=Je.IMMEDIATELY:this.scheduledMacroActions.has(Je.NEVER)?t=Je.NEVER:t=Je.EVENTUALLY,t}satisfiesScheduledActionsInvariant(){if(!(this.scheduledMacroActions.size>=0&&this.scheduledMacroActions.size<=Object.keys(Je).length)){let t=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledMacroActions.size}".`;if(console.error(t,this.scheduledMacroActions.values()),B0()||C0())throw new Error(t)}}},Jo=class e{constructor(t,n){this.elements=t;this.appState=n}static create(t,n){let o=n.getChangedElements(t),i=n.getChangedAppState(t);return new e(o,i)}},lr=class{constructor(t,n){this.type=t;this.change=n}static isDurable(t){return t.type==="durable"}static isEphemeral(t){return t.type==="ephemeral"}},Ka=class extends lr{constructor(n,o){super("durable",n);this.change=n;this.delta=o}},Qa=class extends lr{constructor(n){super("ephemeral",n);this.change=n}},Ja=class e{constructor(t,n,o){this.id=t;this.elements=n;this.appState=o}static create(t,n,o={id:D0()}){return new this(o.id,t,n)}static calculate(t,n){let o=n.metadata.didElementsChange?Ln.calculate(t.elements,n.elements):Ln.empty(),i=n.metadata.didAppStateChange?Tn.calculate(t.appState,n.appState):Tn.empty();return this.create(o,i)}static restore(t){let{id:n,elements:o,appState:i}=t;return new this(n,Ln.restore(o),Tn.restore(i))}static load({id:t,elements:{added:n,removed:o,updated:i},appState:{delta:r}}){let a=Ln.create(n,o,i),s=Tn.create(r);return new this(t,a,s)}static squash(...t){let n=e.empty();for(let o of t)n.elements.squash(o.elements),n.appState.squash(o.appState);return n}static inverse(t){return this.create(t.elements.inverse(),t.appState.inverse())}static applyTo(t,n,o,i){let[r,a]=t.elements.applyTo(n,Cn.empty().elements,i),[s,l]=t.appState.applyTo(o,r);return[r,s,a||l]}static applyLatestChanges(t,n,o,i){return this.create(t.elements.applyLatestChanges(n,o,i),t.appState,{id:t.id})}static empty(){return e.create(Ln.empty(),Tn.empty())}isEmpty(){return this.elements.isEmpty()&&this.appState.isEmpty()}},Cn=class e{constructor(t,n,o={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t;this.appState=n;this.metadata=o}_lastChangedElementsHash=0;_lastChangedAppStateHash=0;static create(t,n,o={didElementsChange:!1,didAppStateChange:!1}){return new e(t,Pc(n)?n:po(n),o)}static empty(){return new e(new Map,G0(),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}getChangedElements(t){let n={};for(let o of uo(t.elements))this.elements.get(o.id)||(n[o.id]=He(o,{isDeleted:!0}));for(let o of uo(this.elements))t.elements.get(o.id)!==o&&(n[o.id]=o);return n}getChangedAppState(t){return $.getRightDifferences(t.appState,this.appState).reduce((n,o)=>Object.assign(n,{[o]:this.appState[o]}),{})}isEmpty(){return this.metadata.isEmpty}applyChange(t){let n=new Map(this.elements);for(let[i,r]of Object.entries(t.elements))n.set(i,r);let o=po({...this.appState,...t.appState});return e.create(n,o,{didElementsChange:Object.keys(t.elements).length>0,didAppStateChange:Object.keys(t.appState).length>0})}maybeClone(t,n,o){let i={shouldCompareHashes:!1};t===Je.EVENTUALLY&&(i.shouldCompareHashes=!0);let r=this.maybeCreateElementsSnapshot(n,i),a=this.maybeCreateAppStateSnapshot(o,i),s=!1,l=!1;return this.elements!==r&&(s=!0),this.appState!==a&&(l=!0),!s&&!l?this:new e(r,a,{didElementsChange:s,didAppStateChange:l})}maybeCreateAppStateSnapshot(t,n={shouldCompareHashes:!1}){if(!t)return this.appState;let o=Pc(t)?t:po(t);return this.detectChangedAppState(o,n)?o:this.appState}maybeCreateElementsSnapshot(t,n={shouldCompareHashes:!1}){if(!t)return this.elements;let o=this.detectChangedElements(t,n);return o?.size?this.createElementsSnapshot(o):this.elements}detectChangedAppState(t,n={shouldCompareHashes:!1}){if(this.appState===t)return;let o=$.isRightDifferent(this.appState,t);if(!o)return;let i=vc(JSON.stringify(t));if(!(n.shouldCompareHashes&&this._lastChangedAppStateHash===i))return this._lastChangedAppStateHash=i,o}detectChangedElements(t,n={shouldCompareHashes:!1}){if(this.elements===t)return;let o=new Map;for(let r of uo(this.elements))t.get(r.id)||o.set(r.id,He(r,{isDeleted:!0}));for(let r of uo(t)){let a=this.elements.get(r.id);if(!a||a.version<r.version){if(Ae(r)&&!Hn(r))continue;o.set(r.id,r)}}if(!o.size)return;let i=Sc(o);if(!(n.shouldCompareHashes&&this._lastChangedElementsHash===i))return this._lastChangedElementsHash=i,o}createElementsSnapshot(t){let n=new Map;for(let o of uo(this.elements))n.set(o.id,o);for(let o of uo(t))n.set(o.id,qa(o));return n}},Ic="__observedAppState",G0=()=>({name:null,editingGroupId:null,viewBackgroundColor:L0.white,selectedElementIds:{},selectedGroupIds:{},selectedLinearElement:null,croppingElementId:null,activeLockedId:null,lockedMultiSelections:{}}),po=e=>{let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,croppingElementId:e.croppingElementId,activeLockedId:e.activeLockedId,lockedMultiSelections:e.lockedMultiSelections,selectedLinearElement:e.selectedLinearElement?{elementId:e.selectedLinearElement.elementId,isEditing:!!e.selectedLinearElement.isEditing}:null};return Reflect.defineProperty(t,Ic,{value:!0,enumerable:!1}),t},Pc=e=>!!Reflect.get(e,Ic);I();var Rc=ii(Cc(),1);import{randomInteger as Q0,arrayToMap as J0,toBrandedType as Bc,isDevEnv as Dc,isTestEnv as Gc,toArray as ef}from"@excalidraw/common";import{isNonDeletedElement as tf}from"@excalidraw/element";import{isFrameLikeElement as nf}from"@excalidraw/element";import{getElementsInGroup as of}from"@excalidraw/element";import{syncInvalidIndices as rf,syncMovedIndices as af,validateFractionalIndices as sf}from"@excalidraw/element";import{getSelectedElements as lf}from"@excalidraw/element";import{mutateElement as df}from"@excalidraw/element";var Oc=e=>{let t=new Map,n=[];for(let o of e)o.isDeleted||(n.push(o),t.set(o.id,o));return{elementsMap:t,elements:n}},cf=(0,Rc.default)(e=>{(Dc()||Gc()||window?.DEBUG_FRACTIONAL_INDICES)&&sf(e,{shouldThrow:Dc()||Gc(),includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),uf=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],n="";for(let o of t)n+=`${o}:${e[o]?"1":"0"}`;return n},ho=class{callbacks=new Set;nonDeletedElements=[];nonDeletedElementsMap=Bc(new Map);elements=[];nonDeletedFramesLikes=[];frames=[];elementsMap=Bc(new Map);selectedElementsCache={selectedElementIds:null,elements:null,cache:new Map};sceneNonce;getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}constructor(t=null,n){t&&this.replaceAllElements(t,n)}getSelectedElements(t){let n=uf(t),o=t?.elements||this.nonDeletedElements;if(this.selectedElementsCache.elements===o&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let r=this.selectedElementsCache.cache.get(n);if(r)return r}else t?.elements==null&&this.selectedElementsCache.cache.clear();let i=lf(o,{selectedElementIds:t.selectedElementIds},t);return t?.elements==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(n,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let n=this.getElement(t);return n&&tf(n)?n:null}mapElements(t){let n=!1,o=this.elements.map(i=>{let r=t(i);return r!==i&&(n=!0),r});return n&&this.replaceAllElements(o),n}replaceAllElements(t,n){let o=ef(t),i=[];n?.skipValidation||cf(o),this.elements=rf(o),this.elementsMap.clear(),this.elements.forEach(a=>{nf(a)&&i.push(a),this.elementsMap.set(a.id,a)});let r=Oc(this.elements);this.nonDeletedElements=r.elements,this.nonDeletedElementsMap=r.elementsMap,this.frames=i,this.nonDeletedFramesLikes=Oc(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=Q0();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),this.callbacks.clear()}insertElementsAtIndex(t,n){if(!t.length)return;if(n===null&&(n=this.elements.length),!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let o=[...this.elements.slice(0,n),...t,...this.elements.slice(n)];af(o,J0(t)),this.replaceAllElements(o)}insertElement=t=>{this.insertElementsAtIndex([t],null)};getElementIndex(t){return this.elements.findIndex(n=>n.id===t)}getContainerElement=t=>t&&t.containerId&&this.getElement(t.containerId)||null;getElementsFromId=t=>{let n=this.getNonDeletedElementsMap(),o=n.get(t);return o?[o]:of(n,t)};mutateElement(t,n,o={informMutation:!0,isDragging:!1}){let i=this.getNonDeletedElementsMap(),{version:r}=t,{version:a}=df(t,i,n,o);return this.elementsMap.has(t.id)&&r!==a&&o.informMutation&&this.triggerUpdate(),t}};var $=class e{constructor(t,n){this.deleted=t;this.inserted=n}static create(t,n,o,i){let r=o&&i!=="inserted"?o(t,"deleted"):t,a=o&&i!=="deleted"?o(n,"inserted"):n;return new e(r,a)}static calculate(t,n,o,i){if(t===n)return e.empty();let r={},a={};for(let d of this.getDifferences(t,n))r[d]=t[d],a[d]=n[d];let[s,l]=i?i(r,a):[r,a];return e.create(s,l,o)}static empty(){return new e({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static merge(t,n,o=e.empty()){return e.create({...t.deleted,...n.deleted,...o.deleted},{...t.inserted,...n.inserted,...o.inserted})}static mergeObjects(t,n,o={}){let i={...t};for(let r of Object.keys(o))delete i[r];return{...i,...n}}static mergeArrays(t,n,o,i){return Object.values(e.mergeObjects(rn(t??[],i),rn(n??[],i),rn(o??[],i)))}static diffObjects(t,n,o,i){if(!t[o]&&!n[o])return;let r=t[o]!==null&&typeof t[o]=="object",a=n[o]!==null&&typeof n[o]=="object";if(r||a){let s=t[o]??{},l=n[o]??{},d=e.getLeftDifferences(s,l).reduce((u,h)=>(u[h]=i(s[h]),u),{}),c=e.getRightDifferences(s,l).reduce((u,h)=>(u[h]=i(l[h]),u),{});Object.keys(d).length||Object.keys(c).length?(Reflect.set(t,o,d),Reflect.set(n,o,c)):(Reflect.deleteProperty(t,o),Reflect.deleteProperty(n,o))}else t[o]===n[o]&&(Reflect.deleteProperty(t,o),Reflect.deleteProperty(n,o))}static diffArrays(t,n,o,i){if(!(!t[o]&&!n[o])&&(Array.isArray(t[o])||Array.isArray(n[o]))){let r=Array.isArray(t[o])?t[o]:[],a=Array.isArray(n[o])?n[o]:[],s=rn(e.getLeftDifferences(rn(r,i),rn(a,i)),d=>d),l=rn(e.getRightDifferences(rn(r,i),rn(a,i)),d=>d);if(Object.keys(s).length||Object.keys(l).length){let d=r.filter(u=>s[i?i(u):String(u)]),c=a.filter(u=>l[i?i(u):String(u)]);Reflect.set(t,o,d),Reflect.set(n,o,c)}else Reflect.deleteProperty(t,o),Reflect.deleteProperty(n,o)}}static isLeftDifferent(t,n,o=!1){return!!this.distinctKeysIterator("left",t,n,o).next().value}static isRightDifferent(t,n,o=!1){return!!this.distinctKeysIterator("right",t,n,o).next().value}static isInnerDifferent(t,n,o=!1){return!!!!this.distinctKeysIterator("inner",t,n,o).next().value}static isDifferent(t,n,o=!1){return!!!!this.distinctKeysIterator("full",t,n,o).next().value}static getLeftDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("left",t,n,o)).sort()}static getRightDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("right",t,n,o)).sort()}static getInnerDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("inner",t,n,o)).sort()}static getDifferences(t,n,o=!1){return Array.from(this.distinctKeysIterator("full",t,n,o)).sort()}static*distinctKeysIterator(t,n,o,i=!1){if(n===o)return;let r=[];t==="left"?r=Object.keys(n):t==="right"?r=Object.keys(o):t==="inner"?r=Object.keys(n).filter(a=>a in o):t==="full"?r=Array.from(new Set([...Object.keys(n),...Object.keys(o)])):Nc(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let a of r){let s=n[a],l=o[a];if(s!==l){if(!i&&typeof s=="object"&&typeof l=="object"&&s!==null&&l!==null&&Hc(s,l))continue;yield a}}}},Tn=class e{constructor(t){this.delta=t}static create(t){return new e(t)}static calculate(t,n){let o=$.calculate(t,n,e.orderAppStateKeys,e.postProcess);return new e(o)}static restore(t){let{delta:n}=t;return new e(n)}static empty(){return new e($.create({},{}))}inverse(){let t=$.create(this.delta.inserted,this.delta.deleted);return new e(t)}squash(t){if(t.isEmpty())return this;let n=$.mergeObjects(this.delta.deleted.selectedElementIds??{},t.delta.deleted.selectedElementIds??{}),o=$.mergeObjects(this.delta.inserted.selectedElementIds??{},t.delta.inserted.selectedElementIds??{}),i=$.mergeObjects(this.delta.deleted.selectedGroupIds??{},t.delta.deleted.selectedGroupIds??{}),r=$.mergeObjects(this.delta.inserted.selectedGroupIds??{},t.delta.inserted.selectedGroupIds??{}),a=$.mergeObjects(this.delta.deleted.lockedMultiSelections??{},t.delta.deleted.lockedMultiSelections??{}),s=$.mergeObjects(this.delta.inserted.lockedMultiSelections??{},t.delta.inserted.lockedMultiSelections??{}),l={},d={};return(Object.keys(n).length||Object.keys(o).length)&&(d.selectedElementIds=n,l.selectedElementIds=o),(Object.keys(i).length||Object.keys(r).length)&&(d.selectedGroupIds=i,l.selectedGroupIds=r),(Object.keys(a).length||Object.keys(s).length)&&(d.lockedMultiSelections=a,l.lockedMultiSelections=s),this.delta=$.merge(this.delta,t.delta,$.create(d,l)),this}applyTo(t,n){try{let{selectedElementIds:o={},selectedGroupIds:i={},lockedMultiSelections:r={}}=this.delta.deleted,{selectedElementIds:a={},selectedGroupIds:s={},lockedMultiSelections:l={},selectedLinearElement:d,...c}=this.delta.inserted,u=$.mergeObjects(t.selectedElementIds,a,o),h=$.mergeObjects(t.selectedGroupIds,s,i),m=$.mergeObjects(t.lockedMultiSelections,l,r),g=d&&n.has(d.elementId)?new D(n.get(d.elementId),n,d.isEditing):null,f={...t,...c,selectedElementIds:u,selectedGroupIds:h,lockedMultiSelections:m,selectedLinearElement:typeof d<"u"?g:t.selectedLinearElement},E=this.filterInvisibleChanges(t,f,n);return[f,E]}catch(o){if(console.error("Couldn't apply appstate change",o),Dn()||Bn())throw o;return[t,!1]}}isEmpty(){return $.isEmpty(this.delta)}filterInvisibleChanges(t,n,o){let i=po(t),r=po(n),a=$.isRightDifferent(e.stripElementsProps(i),e.stripElementsProps(r)),s=$.isRightDifferent(e.stripStandaloneProps(i),e.stripStandaloneProps(r));if(!a&&!s)return!1;let l={value:a};if(s){let d=$.getRightDifferences(e.stripStandaloneProps(i),e.stripStandaloneProps(r)),c=new Set;(d.includes("editingGroupId")||d.includes("selectedGroupIds"))&&(c=kd(o));for(let u of d)switch(u){case"selectedElementIds":n[u]=e.filterSelectedElements(n[u],o,l);break;case"selectedGroupIds":n[u]=e.filterSelectedGroups(n[u],c,l);break;case"croppingElementId":{let y=n[u];if(!y)l.value=!0;else{let w=o.get(y);w&&!w.isDeleted?l.value=!0:n[u]=null}break}case"editingGroupId":let h=n[u];h?c.has(h)?l.value=!0:n[u]=null:l.value=!0;break;case"selectedLinearElement":let m=n[u];if(!m)l.value=!0;else{let y=o.get(m.elementId);y&&!y.isDeleted?l.value=!0:n[u]=null}break;case"lockedMultiSelections":let g=t[u]||{},f=n[u]||{};Hc(g,f)||(l.value=!0);break;case"activeLockedId":let E=t[u]||null,x=n[u]||null;E!==x&&(l.value=!0);break;default:Nc(u,`Unknown ObservedElementsAppState's key "${u}"`,!0)}}return l.value}static filterSelectedElements(t,n,o){let i=Object.keys(t);if(!i.length)return o.value=!0,t;let r={...t};for(let a of i){let s=n.get(a);s&&!s.isDeleted?o.value=!0:delete r[a]}return r}static filterSelectedGroups(t,n,o){if(!Object.keys(t).length)return o.value=!0,t;let r={...t};for(let a of Object.keys(r))n.has(a)?o.value=!0:delete r[a];return r}static stripElementsProps(t){let{editingGroupId:n,selectedGroupIds:o,selectedElementIds:i,selectedLinearElement:r,croppingElementId:a,lockedMultiSelections:s,activeLockedId:l,...d}=t;return d}static stripStandaloneProps(t){let{name:n,viewBackgroundColor:o,...i}=t;return i}static postProcess(t,n){try{$.diffObjects(t,n,"selectedElementIds",o=>!0),$.diffObjects(t,n,"selectedGroupIds",o=>o??!1),$.diffObjects(t,n,"lockedMultiSelections",o=>o??{})}catch(o){if(console.error("Couldn't postprocess appstate change deltas."),Dn()||Bn())throw o}finally{return[t,n]}}static orderAppStateKeys(t){let n={};for(let o of Object.keys(t).sort())n[o]=t[o];return n}},Ln=class e{constructor(t,n,o){this.added=t;this.removed=n;this.updated=o}static create(t,n,o,i={shouldRedistribute:!1}){let r;if(i.shouldRedistribute){let a={},s={},l={},d=[...Object.entries(t),...Object.entries(n),...Object.entries(o)];for(let[c,u]of d)this.satisfiesAddition(u)?a[c]=u:this.satisfiesRemoval(u)?s[c]=u:l[c]=u;r=new e(a,s,l)}else r=new e(t,n,o);return(Dn()||Bn())&&(e.validate(r,"added",this.satisfiesAddition),e.validate(r,"removed",this.satisfiesRemoval),e.validate(r,"updated",this.satisfiesUpdate)),r}static restore(t){let{added:n,removed:o,updated:i}=t;return e.create(n,o,i)}static satisfiesAddition=({deleted:t,inserted:n})=>t.isDeleted===!0&&!n.isDeleted;static satisfiesRemoval=({deleted:t,inserted:n})=>!t.isDeleted&&n.isDeleted===!0;static satisfiesUpdate=({deleted:t,inserted:n})=>!!t.isDeleted==!!n.isDeleted;static satisfiesCommmonInvariants=({deleted:t,inserted:n})=>!!(Number.isInteger(t.version)&&Number.isInteger(n.version)&&t.version>=0&&n.version>=0&&t.version!==n.version);static satisfiesUniqueInvariants=(t,n)=>{let{added:o,removed:i,updated:r}=t;return[o[n],i[n],r[n]].filter(Boolean).length===1};static validate(t,n,o){for(let[i,r]of Object.entries(t[n]))if(!this.satisfiesCommmonInvariants(r)||!this.satisfiesUniqueInvariants(t,i)||!o(r))throw console.error(`Broken invariant for "${n}" delta, element "${i}", delta:`,r),new Error(`ElementsDelta invariant broken for element "${i}".`)}static calculate(t,n){if(t===n)return e.empty();let o={},i={},r={};for(let a of t.values())if(!n.get(a.id)){let l={...a},d={isDeleted:!0,version:a.version+1,versionNonce:Fc()},c=$.create(l,d,e.stripIrrelevantProps);a.isDeleted?r[a.id]=c:i[a.id]=c}for(let a of n.values()){let s=t.get(a.id);if(!s){let l={isDeleted:!0,version:a.version-1,versionNonce:Fc()},d={...a},c=$.create(l,d,e.stripIrrelevantProps);a.isDeleted?r[a.id]=c:o[a.id]=c;continue}if(s.versionNonce!==a.versionNonce){let l=$.calculate(s,a,e.stripIrrelevantProps,e.postProcess);if(typeof s.isDeleted=="boolean"&&typeof a.isDeleted=="boolean"&&s.isDeleted!==a.isDeleted){s.isDeleted&&!a.isDeleted?o[a.id]=l:i[a.id]=l;continue}r[a.id]=l}}return e.create(o,i,r)}static empty(){return e.create({},{},{})}inverse(){let t=r=>{let a={};for(let[s,{inserted:l,deleted:d}]of Object.entries(r))a[s]=$.create({...l},{...d});return a},n=t(this.added),o=t(this.removed),i=t(this.updated);return e.create(o,n,i)}isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.removed).length===0&&Object.keys(this.updated).length===0}applyLatestChanges(t,n,o){let i=(d,c)=>(u,h)=>{let m;switch(h){case"deleted":m=d;break;case"inserted":m=c;break}if(!m)return console.error("Element not found when trying to apply latest changes"),u;let g={};for(let f of Object.keys(u))switch(f){case"boundElements":g[f]=u[f];break;default:g[f]=m[f]}return g},r=d=>{let c={};for(let[u,h]of Object.entries(d)){let m=t.get(u),g=n.get(u),f=null;m||g?f=$.create(h.deleted,h.inserted,i(m,g),o):f=h,$.isInnerDifferent(f.deleted,f.inserted)&&(c[u]=f)}return c},a=r(this.added),s=r(this.removed),l=r(this.updated);return e.create(a,s,l,{shouldRedistribute:!0})}applyTo(t,n=Cn.empty().elements,o){let i=new Map(t),r,a={containsVisibleDifference:!1,containsZindexDifference:!1,applyDirection:void 0};try{let s=e.createApplier(t,i,n,a,o),l=s(this.added),d=s(this.removed),c=s(this.updated),u=this.resolveConflicts(t,i,a.applyDirection);r=new Map([...l,...d,...c,...u])}catch(s){if(console.error("Couldn't apply elements delta",s),Dn()||Bn())throw s;return[t,!0]}try{i=e.reorderElements(i,r,a),e.redrawElements(i,r)}catch(s){if(console.error("Couldn't mutate elements after applying elements change",s),Dn()||Bn())throw s}finally{return[i,a.containsVisibleDifference]}}squash(t){if(t.isEmpty())return this;let{added:n,removed:o,updated:i}=t,r=(a,s)=>{let l=$.mergeArrays(a.deleted.boundElements??[],s.deleted.boundElements??[],void 0,c=>c.id)??[],d=$.mergeArrays(a.inserted.boundElements??[],s.inserted.boundElements??[],void 0,c=>c.id)??[];if(!(!l.length&&!d.length))return $.create({boundElements:l},{boundElements:d})};for(let[a,s]of Object.entries(n)){let l=this.added[a]??this.removed[a]??this.updated[a];if(!l)this.added[a]=s;else{let d=r(l,s);delete this.removed[a],delete this.updated[a],this.added[a]=$.merge(l,s,d)}}for(let[a,s]of Object.entries(o)){let l=this.added[a]??this.removed[a]??this.updated[a];if(!l)this.removed[a]=s;else{let d=r(l,s);delete this.added[a],delete this.updated[a],this.removed[a]=$.merge(l,s,d)}}for(let[a,s]of Object.entries(i)){let l=this.added[a]??this.removed[a]??this.updated[a];if(!l)this.updated[a]=s;else{let d=r(l,s),c=$.merge(l,s,d);l===this.added[a]?this.added[a]=c:l===this.removed[a]?this.removed[a]=c:this.updated[a]=c}}return(Dn()||Bn())&&(e.validate(this,"added",e.satisfiesAddition),e.validate(this,"removed",e.satisfiesRemoval),e.validate(this,"updated",e.satisfiesUpdate)),this}static createApplier=(t,n,o,i,r)=>a=>{let s=e.createGetter(n,o,i);return Object.entries(a).reduce((l,[d,c])=>{let u=s(d,c.inserted);if(u){let h=e.applyDelta(u,c,i,r);if(n.set(h.id,h),l.set(h.id,h),!i.applyDirection){let m=t.get(d);m&&(i.applyDirection=m.version>h.version?"backward":"forward")}}return l},new Map)};static createGetter=(t,n,o)=>(i,r)=>{let a=t.get(i);return a||(a=n.get(i),a?(o.containsZindexDifference=!0,(!r.isDeleted||r.isDeleted&&!a.isDeleted)&&(o.containsVisibleDifference=!0)):a=He({id:i,version:1},{...r})),a};static applyDelta(t,n,o,i){let r={};for(let a of Object.keys(n.inserted)){if(a==="boundElements"||i?.excludedProperties?.has(a))continue;let s=n.inserted[a];Reflect.set(r,a,s)}if(n.deleted.boundElements?.length||n.inserted.boundElements?.length){let a=$.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,s=>s.id);Object.assign(r,{boundElements:a})}if(!o.containsVisibleDifference){let{index:a,...s}=r,l=e.checkForVisibleDifference(t,s);o.containsVisibleDifference=l}return o.containsZindexDifference||(o.containsZindexDifference=n.deleted.index!==n.inserted.index),He(t,r,!0)}static checkForVisibleDifference(t,n){return t.isDeleted&&n.isDeleted!==!1?!1:t.isDeleted&&n.isDeleted===!1||t.isDeleted===!1&&n.isDeleted?!0:$.isRightDifferent(t,n)}resolveConflicts(t,n,o="forward"){let i=new Map,r=(s,l)=>{let d=n.get(s.id);if(!d)return;let c=t.get(s.id),u=o==="forward"?d.version+1:d.version-1,h=l,m;c===d?m=He(d,{...h,version:u},!0):m=Te(d,n,{...h,version:c?.version!==d.version?d.version:u}),i.set(m.id,m),n.set(m.id,m)};for(let s of Object.keys(this.removed))e.unbindAffected(t,n,s,r);for(let s of Object.keys(this.added))e.rebindAffected(t,n,s,r);for(let[s]of Array.from(Object.entries(this.updated)).filter(([l,d])=>Object.keys({...d.deleted,...d.inserted}).find(c=>hd.has(c)))){let l=n.get(s);!l||l.isDeleted||e.rebindAffected(t,n,s,r)}let a=new Map(Array.from(t).filter(([s])=>i.has(s)));return this.squash(e.calculate(a,i)),i}static unbindAffected(t,n,o,i){let r=()=>t.get(o),a=()=>n.get(o);Mn.unbindAffected(n,r(),i),Mn.unbindAffected(n,a(),i),Pn.unbindAffected(n,r(),i),Pn.unbindAffected(n,a(),i)}static rebindAffected(t,n,o,i){let r=()=>t.get(o),a=()=>n.get(o);Mn.unbindAffected(n,r(),i),Mn.rebindAffected(n,a(),i),Pn.unbindAffected(n,r(),(s,l)=>{te(s)&&i(s,l)}),Pn.rebindAffected(n,a(),i)}static redrawElements(t,n){try{let o=new ho(t,{skipValidation:!0});e.redrawTextBoundingBoxes(o,n),e.redrawBoundArrows(o,n)}catch(o){if(console.error("Couldn't redraw elements",o),Dn()||Bn())throw o}finally{return t}}static redrawTextBoundingBoxes(t,n){let o=t.getNonDeletedElementsMap(),i=new Map;for(let r of n.values()){if(xe(r)){let{containerId:a}=r,s=a?o.get(a):void 0;s&&i.set(s.id,{container:s,boundText:r})}if(Tt(r)){let a=qt(r),s=a?o.get(a):void 0;s&&i.set(r.id,{container:r,boundText:s})}}for(let{container:r,boundText:a}of i.values())r.isDeleted||a.isDeleted||Bi(a,r,t)}static redrawBoundArrows(t,n){for(let o of n.values())!o.isDeleted&&Ee(o)&&Re(o,t,{changedElements:n})}static reorderElements(t,n,o){if(!o.containsZindexDifference)return t;let i=Array.from(t.values()),r=gd([...i]),a=$.getRightDifferences(i,r,!0).reduce((s,l)=>{let d=i[Number(l)];return d&&n.has(d.id)&&s.set(d.id,d),s},new Map);return!o.containsVisibleDifference&&a.size&&(o.containsVisibleDifference=!0),pf(Yn(r,a))}static postProcess(t,n){try{$.diffArrays(t,n,"boundElements",r=>r.id);let o=t.points??[],i=n.points??[];$.isDifferent(o,i)||(Reflect.deleteProperty(t,"points"),Reflect.deleteProperty(n,"points"))}catch(o){if(console.error("Couldn't postprocess elements delta."),Dn()||Bn())throw o}finally{return[t,n]}}static stripIrrelevantProps(t){let{id:n,updated:o,...i}=t;return i}};I();var e4=(e,t,n,o,i)=>{let[r,a,s,l]=n.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],d=Fe(e),c=Qi(e,t,o).map(g=>[g,Fe(g)]).sort((g,f)=>g[1][a]-f[1][a]),u=0;for(let g of c)u+=g[1][l];let h=(d[l]-u)/(c.length-1);if(h<0){let g=c.findIndex(y=>y[1][r]===d[r]),f=c.findIndex(y=>y[1][s]===d[s]),E=(c[f][1][a]-c[g][1][a])/(c.length-1),x=c[g][1][a];return c.flatMap(([y,w],M)=>{let b={x:0,y:0};return M!==g&&M!==f&&(x+=E,b[n.axis]=x-w[a]),y.map(S=>{let v=i.mutateElement(S,{x:S.x+b.x,y:S.y+b.y});return Re(S,i,{simultaneouslyUpdated:y}),v})})}let m=d[r];return c.flatMap(([g,f])=>{let E={x:0,y:0};return E[n.axis]=m-f[r],m+=h,m+=f[l],g.map(x=>{let y=i.mutateElement(x,{x:x.x+E.x,y:x.y+E.y});return Re(x,i,{simultaneouslyUpdated:g}),y})})};I();import{TEXT_AUTOWRAP_THRESHOLD as hf,getGridPoint as mf,getFontString as ff,DRAGGING_THRESHOLD as gf}from"@excalidraw/common";var c4=(e,t,n,o,i,r)=>{if(t.length===1&&Y(t[0])&&(t[0].startBinding||t[0].endBinding))return;let a=t.filter(h=>{if(Y(h)&&h.startBinding&&h.endBinding){let m=t.find(f=>f.id===h.startBinding?.elementId),g=t.find(f=>f.id===h.endBinding?.elementId);return m&&g}return!0}),s=new Set(a),l=a.filter(h=>ee(h)).map(h=>h.id);if(l.length>0)for(let h of o.getNonDeletedElements())h.frameId!==null&&l.includes(h.frameId)&&s.add(h);let d=[];for(let h of s){let m=e.originalElements.get(h.id);if(!m)return;d.push(m)}let c=Ef(We(d),n,i,r),u=new Set(Array.from(s,h=>h.id));s.forEach(h=>{let m=!j(h),g=m||(h.startBinding?u.has(h.startBinding.elementId):!1),f=m||(h.endBinding?u.has(h.endBinding.elementId):!1);if(j(h)){if(s.size>1||Math.max(Math.abs(c.x),Math.abs(c.y))>gf||!h.startBinding&&!h.endBinding){ts(e,h,o,c);let E=h.startBinding&&!g,x=h.endBinding&&!f;(E||x)&&(E&&Oe(h,"start",o),x&&Oe(h,"end",o))}}else{ts(e,h,o,c);let E=Q(h,o.getNonDeletedElementsMap());E&&ts(e,E,o,c),Re(h,o,{simultaneouslyUpdated:Array.from(s)})}})},Ef=(e,t,n,o)=>{let[i,r]=e,a=i+t.x+n.x,s=r+t.y+n.y;if(n.x===0||n.y===0){let[l,d]=mf(i+t.x,r+t.y,o);n.x===0&&(a=l),n.y===0&&(s=d)}return{x:a-i,y:s-r}},ts=(e,t,n,o)=>{let i=e.originalElements.get(t.id)??t,r=i.x+o.x,a=i.y+o.y;n.mutateElement(t,{x:r,y:a})},u4=(e,t,n)=>{let[o,i]=We(e);return[t-o,n-i]},p4=({newElement:e,elementType:t,originX:n,originY:o,x:i,y:r,width:a,height:s,shouldMaintainAspectRatio:l,shouldResizeFromCenter:d,zoom:c,scene:u,widthAspectRatio:h=null,originOffset:m=null,informMutation:g=!0})=>{l&&e.type!=="selection"&&(h?s=a/h:(Math.abs(r-o)>Math.abs(i-n)?{width:a,height:s}=Ua(t,s,i<n?-a:a):{width:a,height:s}=Ua(t,a,r<o?-s:s),s<0&&(s=-s)));let f=i<n?n-a:n,E=r<o?o-s:o;d&&(a+=a,s+=s,f=n-a/2,E=o-s/2);let x=null;if(te(e)){s=e.height;let y=ki(ff({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);a=Math.max(a,y),Math.abs(i-n)>hf/c&&(x={autoResize:!1}),E=o,d&&(f=n-a/2)}if(a!==0&&s!==0){let y=null;Ae(e)&&(y={initialWidth:a,initialHeight:s}),u.mutateElement(e,{x:f+(m?.x??0),y:E+(m?.y??0),width:a,height:s,...x,...y},{informMutation:g,isDragging:!1})}};I();import{ELEMENT_LINK_KEY as cr,normalizeLink as zc}from"@excalidraw/common";var E4=(e,t)=>{let n=window.location.href;try{let o=new URL(n);return o.searchParams.set(cr,e),zc(o.toString())}catch(o){console.error(o)}return zc(n)},x4=(e,t)=>{if(e.length>0&&xf(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},xf=e=>!!(e.length===1||e.length>1&&Td(e)),y4=e=>{try{let t=new URL(e);return t.searchParams.has(cr)&&t.host===window.location.host}catch{return!1}},w4=e=>{try{let{searchParams:t}=new URL(e);if(t.has(cr))return t.get(cr)}catch{}return null};I();import{FONT_FAMILY as Lf,VERTICAL_ALIGN as Cf,escapeDoubleQuotes as ns,getFontString as Bf}from"@excalidraw/common";I();import{DEFAULT_ELEMENT_PROPS as Gn,DEFAULT_FONT_FAMILY as yf,DEFAULT_FONT_SIZE as wf,DEFAULT_TEXT_ALIGN as bf,DEFAULT_VERTICAL_ALIGN as Mf,VERTICAL_ALIGN as Pf,randomInteger as If,randomId as Sf,getFontString as ur,getUpdatedTimestamp as vf,getLineHeight as Af}from"@excalidraw/common";var Pt=(e,{x:t,y:n,strokeColor:o=Gn.strokeColor,backgroundColor:i=Gn.backgroundColor,fillStyle:r=Gn.fillStyle,strokeWidth:a=Gn.strokeWidth,strokeStyle:s=Gn.strokeStyle,roughness:l=Gn.roughness,opacity:d=Gn.opacity,width:c=0,height:u=0,angle:h=0,groupIds:m=[],frameId:g=null,index:f=null,roundness:E=null,boundElements:x=null,link:y=null,locked:w=Gn.locked,...M})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||c<-1e6||c>1e6||u<-1e6||u>1e6)&&console.error("New element size or position is too large",{x:t,y:n,width:c,height:u,points:M.points}),{id:M.id||Sf(),type:e,x:t,y:n,width:c,height:u,angle:h,strokeColor:o,backgroundColor:i,fillStyle:r,strokeWidth:a,strokeStyle:s,roughness:l,opacity:d,groupIds:m,frameId:g,index:f,roundness:E,seed:M.seed??If(),version:M.version||1,versionNonce:M.versionNonce??0,isDeleted:!1,boundElements:x,updated:vf(),link:y,locked:w,customData:M.customData}),Zn=e=>Pt(e.type,e),L4=e=>Pt("embeddable",e),C4=e=>({...Pt("iframe",e)}),Wc=e=>He({...Pt("frame",e),type:"frame",name:e?.name||null},{}),_c=e=>He({...Pt("magicframe",e),type:"magicframe",name:e?.name||null},{}),jc=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),qn=e=>{let t=e.fontFamily||yf,n=e.fontSize||wf,o=e.lineHeight||Af(t),i=Go(e.text),r=ot(i,ur({fontFamily:t,fontSize:n}),o),a=e.textAlign||bf,s=e.verticalAlign||Mf,l=jc({textAlign:a,verticalAlign:s},r),d={...Pt("text",e),text:i,fontSize:n,fontFamily:t,textAlign:a,verticalAlign:s,x:e.x-l.x,y:e.y-l.y,width:r.width,height:r.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:o};return He(d,{})},kf=(e,t,n)=>{let{width:o,height:i}=ot(n,ur(e),e.lineHeight);e.autoResize||(o=e.width);let{textAlign:r,verticalAlign:a}=e,s,l;if(r==="center"&&a===Pf.MIDDLE&&!e.containerId&&e.autoResize){let d=ot(e.text,ur(e),e.lineHeight),c=jc(e,{width:o-d.width,height:i-d.height});s=e.x-c.x,l=e.y-c.y}else{let[d,c,u,h]=K(e,t),[m,g,f,E]=un(e,o,i,!1),x=(d-m)/2,y=(c-g)/2,w=(u-f)/2,M=(h-E)/2;[s,l]=Tf({s:!0,e:r==="center"||r==="left",w:r==="center"||r==="right"},e.x,e.y,e.angle,x,y,w,M)}return{width:o,height:i,x:Number.isFinite(s)?s:e.x,y:Number.isFinite(l)?l:e.y}},Tf=(e,t,n,o,i,r,a,s)=>{let l=Math.cos(o),d=Math.sin(o);return e.e&&e.w?t+=i+a:e.e?(t+=i*(1+l),n+=i*d,t+=a*(1-l),n+=a*-d):e.w&&(t+=i*(1-l),n+=i*-d,t+=a*(1+l),n+=a*d),e.n&&e.s?n+=r+s:e.n?(t+=r*d,n+=r*(1-l),t+=s*-d,n+=s*(1+l)):e.s&&(t+=r*-d,n+=r*(1+l),t+=s*d,n+=s*(1-l)),[t,n]},B4=(e,t,n,o=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(o=Zt(o,ur(e),t?xt(t,e):e.width));let i=kf(e,n,o);return{text:o,...i}},D4=e=>({...Pt(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure}),Vc=e=>{let t={...Pt(e.type,e),points:e.points||[],startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null};return jt(t)?{...t,polygon:e.polygon??!1}:t},pr=e=>e.elbowed?{...Pt(e.type,e),points:e.points||[],startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...Pt(e.type,e),points:e.points||[],startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},Yc=e=>({...Pt("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,fileName:e.fileName??null,scale:e.scale??[1,1],crop:e.crop??null});var It=new Map,Df=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)/,Gf=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,Of=/^https:\/\/(?:www\.)?figma\.com/,Uc=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,Rf=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,Ff=/^(?:https?:\/\/)?forms\.microsoft\.com\//,Xc=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,Nf=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,Hf=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,zf=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,$c=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,Zc=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,Wf=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,Kc=e=>{let t;try{let a=new URL(e.startsWith("http")?e:`https://${e}`);t=a.searchParams.get("t")||a.searchParams.get("start")}catch{t=e.match(/[?&#](?:t|start)=([^&#\s]+)/)?.[1]}if(!t)return 0;if(/^\d+$/.test(t))return parseInt(t,10);let n=t.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(!n)return 0;let[,o="0",i="0",r="0"]=n;return parseInt(o)*3600+parseInt(i)*60+parseInt(r)},_f=e=>{try{let t=new URL(e.startsWith("http")?e:`https://${e}`);if(t.hostname.replace(/^www\./,"")!=="drive.google.com")return null;let o=null,i=t.pathname.match(/^\/file\/d\/([^/]+)(?:\/|$)/);if(i?.[1]?o=i[1]:(t.pathname==="/open"||t.pathname==="/uc")&&(o=t.searchParams.get("id")),!o||!/^[a-zA-Z0-9_-]+$/.test(o))return null;let r=t.searchParams.get("resourcekey"),a=Kc(t.toString());return{fileId:o,resourceKey:r&&/^[a-zA-Z0-9_-]+$/.test(r)?r:void 0,timestamp:a>0?a:void 0}}catch{return null}},is=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","drive.google.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com","forms.microsoft.com"]),qc=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","drive.google.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com","forms.microsoft.com"]),os=e=>`<html><body>${e}</body></html>`,z4=e=>{if(!e)return null;if(It.has(e))return It.get(e);let t=e,n=qc.has(rs(e,qc)||""),o="generic",i={w:560,h:840},r=e.match(Df);if(r?.[2]){let c=Kc(t),u=c>0?`&start=${c}`:"",h=e.includes("shorts");switch(o="video",r[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${u}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${r[2]}&enablejsapi=1${u}`;break;default:e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${u}`;break}return i=h?{w:315,h:560}:{w:560,h:315},It.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}}let a=e.match(Gf);if(a?.[1]){let c=a?.[1],u=/^\d+$/.test(c)?void 0:new URIError("Invalid embed link format");return o="video",e=`https://player.vimeo.com/video/${c}?api=1`,i={w:560,h:315},It.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,error:u,sandbox:{allowSameOrigin:n}}}let s=_f(e);if(s){o="video";let c=new URLSearchParams;s.resourceKey&&c.set("resourcekey",s.resourceKey),s.timestamp&&c.set("t",`${s.timestamp}`);let u=c.toString();return e=`https://drive.google.com/file/d/${s.fileId}/preview${u?`?${u}`:""}`,i={w:560,h:315},It.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}}if(e.match(Of))return o="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},It.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}};let d=e.match(Hf);if(d)return e=d[1]==="embed"?d[0]:d[0].replace("/v","/embed"),It.set(t,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}};if(Ff.test(e)&&!e.includes("embed=true")&&(e+=e.includes("?")?"&embed=true":"?embed=true"),Xc.test(e)){let c=e.match(Xc)[1],u=ns(`https://twitter.com/x/status/${c}`),h={type:"document",srcdoc:m=>os(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${m}"><a href="${u}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return It.set(t,h),h}if(Zc.test(e)){let[,c,u,h]=e.match(Zc),m=ns(`https://reddit.com/r/${c}/comments/${u}/${h}`),g={type:"document",srcdoc:f=>os(`<blockquote class="reddit-embed-bq" data-embed-theme="${f}"><a href="${m}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return It.set(t,g),g}if(Uc.test(e)){let[,c,u]=e.match(Uc),h=ns(`https://gist.github.com/${c}/${u}`),m={type:"document",srcdoc:()=>os(`
22
22
  <script src="${h}.js"><\/script>
23
23
  <style type="text/css">
24
24
  * { margin: 0px; }
25
25
  table, .gist { height: 100%; }
26
26
  .gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
27
27
  </style>
28
- `),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return vt.set(e,m),m}return vt.set(e,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}},n5=e=>{let t;Si(e)?t="IFrame element":t=!e.link||e?.link===""?"Empty Web-Embed":e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),o=Hf.Helvetica,i=Wf({fontSize:n,fontFamily:o});return Kn({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:o,fontSize:n,text:Kt(t,i,e.width-20),textAlign:"center",verticalAlign:zf.MIDDLE,angle:e.angle??0})},ds=(e,t)=>{try{let{hostname:n}=new URL(e),o=n.replace(/^www\./,"");if(t instanceof Set){if(ls.has(o))return o;let r=o.replace(/^([^.]+)/,"*");return ls.has(r)?r:null}let i=t.replace(/^www\./,"");if(o===i)return i}catch{}return null},o5=e=>{let t=e.match(Xf);if(t&&t.length===2)return t[1];let n=e.match(qf);if(n&&n.length===2)return n[1];let o=e.match(Uf);if(o&&o.length===2)return o[1];if(nu.test(e))return`https://giphy.com/embed/${nu.exec(e)[1]}`;let i=e.match(Zf);return i&&i.length===2?i[1]:e},i5=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let n=t(e);if(typeof n=="boolean")return n}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if(ds(e,n))return!0;return!1}}return!!ds(e,ls)};I();import{KEYS as xr,invariant as yr,toBrandedType as Qf}from"@excalidraw/common";import{pointFrom as au}from"@excalidraw/math";var go=100,Qn=100,x5=e=>{switch(e){case xr.ARROW_UP:return"up";case xr.ARROW_DOWN:return"down";case xr.ARROW_RIGHT:return"right";case xr.ARROW_LEFT:return"left";default:return"right"}},du=(e,t,n,o)=>{let i=[...n.values()].reduce((r,a)=>{let s;if(U(a)&&(s=a[e==="predecessors"?"startBinding":"endBinding"])&&a[e==="predecessors"?"endBinding":"startBinding"]?.elementId===t.id){let l=n.get(s.elementId);if(!l)return r;yr(ge(l),"not an ExcalidrawBindableElement");let d=e==="predecessors"?a.points[a.points.length-1]:[0,0],c=zo(t,pt(t,n),[d[0]+a.x,d[1]+a.y]);r.push({relative:l,heading:c})}return r},[]);switch(o){case"up":return i.filter(r=>ye(r.heading,rt)).map(r=>r.relative);case"down":return i.filter(r=>ye(r.heading,ke)).map(r=>r.relative);case"right":return i.filter(r=>ye(r.heading,we)).map(r=>r.relative);case"left":return i.filter(r=>ye(r.heading,Ze)).map(r=>r.relative)}},cs=(e,t,n)=>du("successors",e,t,n),us=(e,t,n)=>du("predecessors",e,t,n),Jf=(e,t,n)=>{let o=Qn+e.width;if(n==="up"||n==="down"){let s=go+e.height,l=e.x,d=e.x+e.width;if(t.every(c=>c.x+c.width<l||c.x>d))return{x:0,y:s*(n==="up"?-1:1)}}else if(n==="right"||n==="left"){let s=e.y,l=e.y+e.height;if(t.every(d=>d.y+d.height<s||d.y>l))return{x:(Qn+e.width)*(n==="left"?-1:1),y:0}}if(n==="up"||n==="down"){let s=go+e.height,l=(t.length===0,s),d=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*o:t.length/2*o*-1;return n==="up"?{x:d,y:l*-1}:{x:d,y:l}}let i=go+e.height,r=(t.length===0,Qn+e.width),a=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return n==="left"?{x:r*-1,y:a}:{x:r,y:a}},eg=(e,t,n,o)=>{let i=o.getNonDeletedElementsMap(),r=cs(e,i,n),a=us(e,i,n),s=Jf(e,[...r,...a],n),l=qn({type:e.type,x:e.x+s.x,y:e.y+s.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});yr(Vr(l),"not an ExcalidrawFlowchartNodeElement");let d=cu(e,l,n,t,o);return{nextNode:l,bindingArrow:d}},tg=(e,t,n,o,i)=>{let r=[];for(let a=0;a<i;a++){let s,l;if(n==="left"||n==="right"){let u=go*(i-1)+i*e.height,h=e.y+e.height/2-u/2,m=Qn+e.width;n==="left"&&(m*=-1),s=e.x+m;let f=(go+e.height)*a;l=h+f}else{let u=Qn*(i-1)+i*e.width,h=e.x+e.width/2-u/2,m=go+e.height;n==="up"&&(m*=-1),l=e.y+m;let f=(Qn+e.width)*a;s=h+f}let d=qn({type:e.type,x:s,y:l,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});yr(Vr(d),"not an ExcalidrawFlowchartNodeElement");let c=cu(e,d,n,t,o);r.push(d),r.push(c)}return r},cu=(e,t,n,o,i)=>{let r,a;switch(n){case"up":{r=e.x+e.width/2,a=e.y-6;break}case"down":{r=e.x+e.width/2,a=e.y+e.height+6;break}case"right":{r=e.x+e.width+6,a=e.y+e.height/2;break}case"left":{r=e.x-6,a=e.y+e.height/2;break}}let l,d;switch(n){case"up":{l=t.x+t.width/2-r,d=t.y+t.height-a+6;break}case"down":{l=t.x+t.width/2-r,d=t.y-a-6;break}case"right":{l=t.x-r-6,d=t.y-a+t.height/2;break}case"left":{l=t.x+t.width-r+6,d=t.y-a+t.height/2;break}}let c=Er({type:"arrow",x:r,y:a,startArrowhead:null,endArrowhead:o.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[au(0,0),au(l,d)],elbowed:!0}),u=i.getNonDeletedElementsMap();Nt(c,e,"orbit","start",i),Nt(c,t,"orbit","end",i);let h=new Map;h.set(e.id,e),h.set(t.id,t),h.set(c.id,c),R.movePoints(c,i,new Map([[1,{point:c.points[1]}]]));let m=ro(c,Qf(new Map([...u.entries(),[e.id,e],[t.id,t],[c.id,c]])),{points:c.points});return{...c,...m}},su=class{isExploring=!1;sameLevelNodes=[];sameLevelIndex=0;direction=null;visitedNodes=new Set;clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(t,n,o){if(!ge(t))return null;if(o!==this.direction&&this.clear(),this.visitedNodes.has(t.id)||this.visitedNodes.add(t.id),this.isExploring&&o===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let i=[...cs(t,n,o),...us(t,n,o)];if(i.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=i,this.direction=o,this.visitedNodes.add(i[0].id),i[0].id;if(o===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(t.id);let a=["up","right","down","left"].filter(s=>s!==o).map(s=>[...cs(t,n,s),...us(t,n,s)]).flat().filter(s=>!this.visitedNodes.has(s.id));for(let s of a)if(!this.visitedNodes.has(s.id))return this.visitedNodes.add(s.id),this.isExploring=!0,this.direction=o,s.id}return null}},lu=class{isCreatingChart=!1;numberOfNodes=0;direction="right";pendingNodes=null;createNodes(t,n,o,i){let r=i.getNonDeletedElementsMap();if(o!==this.direction){let{nextNode:a,bindingArrow:s}=eg(t,n,o,i);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=o,this.pendingNodes=[a,s]}else{this.numberOfNodes+=1;let a=tg(t,n,o,i,this.numberOfNodes);this.isCreatingChart=!0,this.direction=o,this.pendingNodes=a}if(t.frameId){let a=r.get(t.frameId);yr(a&&Ai(a),"not an ExcalidrawFrameElement"),a&&this.pendingNodes.every(s=>An([s],a,r)||Sn(s,a,r))&&(this.pendingNodes=this.pendingNodes.map(s=>Te(s,r,{frameId:t.frameId})))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},y5=(e,t)=>{for(let[,n]of t)if(n.type==="arrow"&&(n.startBinding?.elementId===e.id||n.endBinding?.elementId===e.id))return!0;return!1};I();import{pointDistance as Eo,pointFrom as ps}from"@excalidraw/math";import{invariant as uu}from"@excalidraw/common";var wr=(e,t,n,o,i,r,a=!1)=>{if(U(t)||!Ft(i)||t.points.length!==2)return!1;if(!a){let l=t.startBinding?.elementId===n.id?0:t.points.length-1,d=R.getPointAtIndexGlobalCoordinates(t,l,o);if(Eo(e,d)<Yo*1.5/i.zoom.value)return!1}let s=R.getPointAtIndexGlobalCoordinates(t,r==="end"?t.points.length-1:0,o);return Eo(e,s)>=Yo*1.5/i.zoom.value&&Bt({element:n,elementsMap:o,point:e,threshold:Ne(n,t),overrideShouldTestInside:!0})},ng=(e,t,n,o,i,r,a)=>{let s=new Map,l=n?"startBinding":"endBinding",d=n?"endBinding":"startBinding",c=e[l],u=e[d];if(c&&t){let h=t&&u&&c.elementId===u.elementId;a||h?c={...c,mode:"inside"}:c={...c,mode:"orbit"};let m=n?0:e.points.length-1,f=Pt(e,l,c,t,o,!0);f&&s.set(m,{point:f})}if(u&&u.mode==="orbit"){let h=o.get(u.elementId);if(h&&ge(h)&&Ft(r)){let m=t&&u.elementId===t.id;a||m?u={...u,mode:"inside"}:u={...u,mode:"orbit"};let f=n?e.points.length-1:0,g=Pt(e,d,u,h,o);g&&s.set(f,{point:g})}}s.size>0&&R.movePoints(e,i,s,{[l]:c,[d]:u})},pu=(e,t,n,o,i,r,a)=>{let s=R.getElement(e.elementId,t);if(!s||!Be(s)||U(s)||!e.hoveredFocusPointBinding||!e.draggedFocusPointBinding)return;let l=e.draggedFocusPointBinding==="start",d=l?s.startBinding:s.endBinding,{x:c,y:u}=e.pointerOffset,h=ps(n.x-c,n.y-u),m=l?"startBinding":"endBinding",f=Xl(h,s,o.getNonDeletedElements(),t,xt(i.zoom));if(f&&Ft(i)){s[m]&&f.id!==d?.elementId&&Oe(s,e.draggedFocusPointBinding,o);let g=a&&s[m]?.mode==="orbit"?"inside":!a&&s[m]?.mode==="inside"?"orbit":null;(!s[m]||g)&&Nt(s,f,g||"orbit",e.draggedFocusPointBinding,o,h),o.mutateElement(s,{[m]:{...s[m],elementId:f.id,mode:g||s[m]?.mode||"orbit",...ao(s,f,e.draggedFocusPointBinding,t,h)}})}else{let g=new Map,E=l?0:s.points.length-1;g.set(E,{point:R.createPointAt(s,t,h[0],h[1],r)}),R.movePoints(s,o,g),s[m]&&Oe(s,l?"start":"end",o)}ng(s,f,l,t,o,i,a),f&&Ft(i)&&Xo(h,s,o.getElementsIncludingDeleted(),t,o,f)},T5=(e,t,n,o)=>{let i=ps(t.origin.x,t.origin.y),r=Yo*1.5/o.zoom.value;if(e.startBinding?.elementId){let a=n.get(e.startBinding.elementId);if(a&&ge(a)&&!a.isDeleted){let s=Ye(e.startBinding.fixedPoint,a,n);if(wr(s,e,a,n,o,"start")&&Eo(i,s)<=r)return{hitFocusPoint:"start",pointerOffset:{x:i[0]-s[0],y:i[1]-s[1]}}}}if(e.endBinding?.elementId){let a=n.get(e.endBinding.elementId);if(a&&ge(a)&&!a.isDeleted){let s=Ye(e.endBinding.fixedPoint,a,n);if(wr(s,e,a,n,o,"end")&&Eo(i,s)<=r)return{hitFocusPoint:"end",pointerOffset:{x:i[0]-s[0],y:i[1]-s[1]}}}}return{hitFocusPoint:null,pointerOffset:{x:0,y:0}}},L5=(e,t)=>{uu(e.draggedFocusPointBinding,"Must have a dragged focus point at pointer release");let n=R.getElement(e.elementId,t.getNonDeletedElementsMap());uu(n,"Arrow must be in the scene");let o=e.draggedFocusPointBinding==="start"?"startBinding":"endBinding",i=e.draggedFocusPointBinding==="start"?"endBinding":"startBinding",r=n[o]?.elementId,a=n[i]?.elementId,s=r&&t.getNonDeletedElements().find(d=>d.id!==r&&d.id!==a&&ge(d)&&d.boundElements?.find(({id:c})=>c===n.id));s&&t.mutateElement(s,{boundElements:s.boundElements?.filter(({id:d})=>d!==n.id)});let l=r&&t.getNonDeletedElementsMap().get(r);l&&t.mutateElement(l,{boundElements:[...(l.boundElements||[])?.filter(({id:d})=>d!==n.id),{id:n.id,type:"arrow"}]})},C5=(e,t,n,o,i)=>{let r=o.getNonDeletedElementsMap(),a=ps(t,n),s=Yo*1.5/i.zoom.value;if(e.startBinding?.elementId){let l=r.get(e.startBinding.elementId);if(l&&ge(l)&&!l.isDeleted){let d=Ye(e.startBinding.fixedPoint,l,r);if(wr(d,e,l,r,i,"start")&&Eo(a,d)<=s)return"start"}}if(e.endBinding?.elementId){let l=r.get(e.endBinding.elementId);if(l&&ge(l)&&!l.isDeleted){let d=Ye(e.endBinding.fixedPoint,l,r);if(wr(d,e,l,r,i,"end")&&Eo(a,d)<=s)return"end"}}return null};I();import{MIME_TYPES as hu,SVG_NS as og}from"@excalidraw/common";var ig=e=>new Promise((t,n)=>{let o=new Image;o.onload=()=>{t(o)},o.onerror=i=>{n(i)},o.src=e}),R5=async({fileIds:e,files:t,imageCache:n})=>{let o=new Map,i=new Map;return await Promise.all(e.reduce((r,a)=>{let s=t[a];return s&&!o.has(a)?(o.set(a,!0),r.concat((async()=>{try{if(s.mimeType===hu.binary)throw new Error("Only images can be added to ImageCache");let l=ig(s.dataURL),d={image:l,mimeType:s.mimeType};n.set(a,d);let c=await l;n.set(a,{...d,image:c})}catch{i.set(a,!0)}})())):r},[])),{imageCache:n,updatedFiles:o,erroredFiles:i}},F5=e=>e.filter(t=>zn(t)),rg=e=>e?.nodeName.toLowerCase()==="svg",N5=e=>{let t=new DOMParser().parseFromString(e,hu.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||!rg(n))throw new Error("Invalid SVG");{n.hasAttribute("xmlns")||n.setAttribute("xmlns",og);let i=n.getAttribute("width"),r=n.getAttribute("height");(i?.includes("%")||i==="auto")&&(i=null),(r?.includes("%")||r==="auto")&&(r=null);let a=n.getAttribute("viewBox");if(!i||!r){if(i=i||"50",r=r||"50",a){let s=a.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);s&&([,i,r]=s)}n.setAttribute("width",i),n.setAttribute("height",r)}return a||n.setAttribute("viewBox",`0 0 ${i} ${r}`),n.outerHTML}};I();var ag=e=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),mu=(e,t)=>{switch(e){case"height":return t.height;case"width":return t.width;case"size":return t.width*t.height;case"scale":return(t.width+t.height)/2}},sg=(e,t,n)=>n==="first"?mu(e,t[0].boundingBox):t.reduce((i,r)=>i+mu(e,r.boundingBox),0)/t.length,lg=(e,t,n)=>{switch(e){case"height":return t/n.height;case"width":return t/n.width;case"size":return Math.sqrt(t/(n.width*n.height));case"scale":return t/((n.width+n.height)/2)}},j5=(e,t,n,o="average",i="size")=>{let a=or(t,n).map(d=>({group:d,boundingBox:Fe(d)}));if(a.length===0)return t;let s=sg(i,a,o),l=[];return a.forEach(d=>{let c=lg(i,s,d.boundingBox);if(!Number.isFinite(c)||c<=0)return;let u=ag(d.boundingBox);d.group.forEach(h=>{let m={x:h.x+h.width/2,y:h.y+h.height/2},f={x:u.x+(m.x-u.x)*c,y:u.y+(m.y-u.y)*c},g=h.width*c,E=h.height*c;e.mutateElement(h,{x:f.x-g/2,y:f.y-E/2,width:g,height:E}),l.push(h)})}),l};I();var $5=(e,t,n,o=50)=>{if(!e||e.length===0)return[];let i=[],r=Array.isArray(e[0])?e:e.map(m=>[m]),a=r.length,s=Math.max(1,Math.ceil(Math.sqrt(a))),l=[];for(let m=0;m<a;m+=s)l.push(r.slice(m,m+s));let d=0,c=l.map(m=>{let f=0,g=0,E=m.map(x=>{let[y,w,M,b]=We(x);return{elements:x,bounds:[y,w,M,b],width:M-y,height:b-w}});return E.forEach((x,y)=>{f+=x.width,y<E.length-1&&(f+=o),x.height>g&&(g=x.height)}),d+=g,{unitBounds:E,width:f,maxHeight:g}}),u=d+Math.max(0,l.length-1)*o,h=n-u/2;return c.forEach(m=>{let{unitBounds:f,width:g,maxHeight:E}=m,x=t-g/2;f.forEach(y=>{let[w,M]=y.bounds,b=x-w,S=h-M;y.elements.forEach(v=>{i.push(He(v,{x:v.x+b,y:v.y+S}))}),x+=y.width+o}),h+=E+o}),i};I();import{pointCenter as dg,normalizeRadians as Mr,pointFrom as de,pointRotateRads as At}from"@excalidraw/math";import{MIN_FONT_SIZE as ms,SHIFT_LOCKING_ANGLE as Pr,rescalePoints as fu,getFontString as br}from"@excalidraw/common";var sM=(e,t,n,o,i,r,a,s,l,d,c)=>{let u=o.getNonDeletedElementsMap();if(n.length===1){let[h]=n;if(t==="rotation")U(h)||(cg(h,o,s,l,i),Re(h,o));else if(t){let m=n[0].id,f=u.get(m),g=e.get(m);if(f&&g){let{nextWidth:E,nextHeight:x}=fg(f,g,t,s,l,{shouldMaintainAspectRatio:a,shouldResizeFromCenter:r});mg(E,x,f,g,e,o,t,{shouldMaintainAspectRatio:a,shouldResizeFromCenter:r})}}return te(h)&&Re(h,o),!0}else if(n.length>1){if(t==="rotation")return pg(e,n,o,s,l,i,d,c),!0;if(t){let{nextWidth:h,nextHeight:m,flipByX:f,flipByY:g,originalBoundingBox:E}=gg(n,e,u,t,s,l,{shouldMaintainAspectRatio:a,shouldResizeFromCenter:r});return Eg(n,u,t,o,e,{shouldResizeFromCenter:r,shouldMaintainAspectRatio:a,flipByX:f,flipByY:g,nextWidth:h,nextHeight:m,originalBoundingBox:E}),!0}}return!1},cg=(e,t,n,o,i)=>{let[r,a,s,l]=Q(e,t.getNonDeletedElementsMap()),d=(r+s)/2,c=(a+l)/2,u;ee(e)?u=0:(u=5*Math.PI/2+Math.atan2(o-c,n-d),i&&(u=u+Pr/2,u=u-u%Pr),u=Mr(u));let h=Qt(e),m={angle:u};if(Be(e)&&(m={...m},e.startBinding&&Oe(e,"start",t),e.endBinding&&Oe(e,"end",t)),t.mutateElement(e,m),h){let f=t.getElement(h);if(f&&!j(e)){let{x:g,y:E}=Fo(e,f,t.getNonDeletedElementsMap());t.mutateElement(f,{angle:u,x:g,y:E})}}},gu=(e,t,n,o)=>ne(e)||Pe(e)?{points:fu(0,t,fu(1,n,e.points,o),o)}:{},fs=(e,t,n)=>{let o=e.width;if(Ee(e)){let a=De(e,t);a&&(o=yt(a,e))}let r=e.fontSize*(n/o);return r<ms?null:{size:r}},ug=(e,t,n,o,i,r,a)=>{let s=n.getNonDeletedElementsMap(),l=t.width*(a/t.height),d=fs(t,s,l);if(d!==null){if(o.includes("n")||o.includes("s")){let c=de(e.x,e.y),u=hs(c,e.width,e.height,l,a,e.angle,o,!1,i);n.mutateElement(t,{fontSize:d.size,width:l,height:a,x:u.x,y:u.y});return}if(o==="e"||o==="w"){let c=Ci(br({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),u=Math.max(c,r),h=Kt(t.originalText,br(t),Math.abs(u)),m=ot(h,br(t),t.lineHeight),f=m.height,g=de(e.x,e.y),E=hs(g,e.width,e.height,u,f,t.angle,o,!1,i),x={width:Math.abs(u),height:Math.abs(m.height),x:E.x,y:E.y,text:h,autoResize:!1};n.mutateElement(t,x)}}},pg=(e,t,n,o,i,r,a,s)=>{let l=n.getNonDeletedElementsMap(),d=5*Math.PI/2+Math.atan2(i-s,o-a);r&&(d+=Pr/2,d-=d%Pr);let c=new Map(t.map(u=>[u.id,u]));for(let u of t)if(!ee(u)){let[h,m,f,g]=Q(u,l),E=(h+f)/2,x=(m+g)/2,y=e.get(u.id)?.angle??u.angle,[w,M]=At(de(E,x),de(a,s),d+y-u.angle),b=U(u)?{points:Ed(u,l)}:{x:u.x+(w-E),y:u.y+(M-x),angle:Mr(d+y)};n.mutateElement(u,b),Re(u,n,{simultaneouslyUpdated:t}),Be(u)&&(u.startBinding&&(c.has(u.startBinding.elementId)||Oe(u,"start",n)),u.endBinding&&(c.has(u.endBinding.elementId)||Oe(u,"end",n)));let S=Z(u,l);if(S&&!j(u)){let{x:v,y:L}=Fo(u,S,l);n.mutateElement(S,{x:v,y:L,angle:Mr(d+y)})}}n.triggerUpdate()},lM=(e,t,n,o,i)=>{let[r,a,s,l]=t.length===1?Q(t[0],n):We(t),d=(r+s)/2,c=(a+l)/2,u=t.length===1?t[0].angle:0;switch([o,i]=At(de(o,i),de(d,c),-u),e){case"n":return At(de(o-(r+s)/2,i-a),de(0,0),u);case"s":return At(de(o-(r+s)/2,i-l),de(0,0),u);case"w":return At(de(o-r,i-(a+l)/2),de(0,0),u);case"e":return At(de(o-s,i-(a+l)/2),de(0,0),u);case"nw":return At(de(o-r,i-a),de(0,0),u);case"ne":return At(de(o-s,i-a),de(0,0),u);case"sw":return At(de(o-r,i-l),de(0,0),u);case"se":return At(de(o-s,i-l),de(0,0),u);default:return[0,0]}},dM=(e,t)=>{let[,[n,o]]=t.points;return e==="nw"&&(n<0||o<0)||e==="ne"&&n>=0||e==="sw"&&n<=0||e==="se"&&(n>0||o>0)?"end":"origin"},hg=(e,t,n)=>{if(n)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},hs=(e,t,n,o,i,r,a,s,l)=>{let d=hg(a,s,l),[c,u]=e;switch(d){case"top-left":return{x:c+(t-o)/2+(o-t)/2*Math.cos(r)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(o-t)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"top-right":return{x:c+(t-o)/2*(Math.cos(r)+1)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(t-o)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"bottom-left":return{x:c+(t-o)/2*(1-Math.cos(r))+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(o-t)/2*Math.sin(r)};case"bottom-right":return{x:c+(t-o)/2*(Math.cos(r)+1)+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(t-o)/2*Math.sin(r)};case"center":return{x:c-(o-t)/2,y:u-(i-n)/2};case"east-side":return{x:c+(t-o)/2*(Math.cos(r)+1),y:u+(t-o)/2*Math.sin(r)+(n-i)/2};case"west-side":return{x:c+(t-o)/2*(1-Math.cos(r)),y:u+(o-t)/2*Math.sin(r)+(n-i)/2};case"north-side":return{x:c+(t-o)/2+(n-i)/2*Math.sin(r),y:u+(i-n)/2*(Math.cos(r)-1)};case"south-side":return{x:c+(t-o)/2+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)}}},mg=(e,t,n,o,i,r,a,{shouldInformMutation:s=!0,shouldMaintainAspectRatio:l=!1,shouldResizeFromCenter:d=!1}={})=>{if(te(n)&&te(o))return ug(o,n,r,a,d,e,t);let c={},u=r.getNonDeletedElementsMap(),h=Z(n,u);if(h){let E=i.get(h.id);if(E&&(c={fontSize:E.fontSize}),l){let x={...n,width:e,height:t},y=fs(h,u,yt(x,h));if(y===null)return;c={fontSize:y.size}}else{let x=kl(br(h),h.lineHeight),y=Tl(h.fontSize,h.lineHeight);e=Math.max(e,x),t=Math.max(t,y)}}let m=gu(o,e,t,!0),f=de(o.x,o.y);if(ne(o)){let[E,x]=ue(o,i);f=de(E,x)}let g=hs(f,o.width,o.height,e,t,o.angle,a,l,d);if(ne(o)&&m.points){let E=o.x-f[0],x=o.y-f[1];g.x+=E,g.y+=x;let y=m.points[0][0],w=m.points[0][1];g.x+=y,g.y+=w,m.points=m.points.map(M=>de(M[0]-y,M[1]-w))}if(e<0&&(g.x=g.x+e),t<0&&(g.y=g.y+t),"scale"in n&&"scale"in o&&r.mutateElement(n,{scale:[(Math.sign(e)||o.scale[0])*o.scale[0],(Math.sign(t)||o.scale[1])*o.scale[1]]}),j(n)&&h&&l){let E=e/n.width*h.fontSize;if(E<ms)return;c.fontSize=E}if(e!==0&&t!==0&&Number.isFinite(g.x)&&Number.isFinite(g.y)){let E={...g,width:Math.abs(e),height:Math.abs(t),...m};Be(n)&&(n.startBinding&&(E={...E},n.startBinding&&Oe(n,"start",r)),n.endBinding&&(E={...E,endBinding:null})),r.mutateElement(n,E,{informMutation:s,isDragging:!1}),h&&c!=null&&r.mutateElement(h,{fontSize:c.fontSize}),Vn(n,r,a,l),Re(n,r)}},fg=(e,t,n,o,i,{shouldMaintainAspectRatio:r=!1,shouldResizeFromCenter:a=!1}={})=>{let[s,l,d,c]=pn(t,t.width,t.height,!0),u=de(s,l),h=de(d,c),m=dg(u,h),f=At(de(o,i),m,-t.angle),[g,E,x,y]=pn(e,e.width,e.height,!0),w=x-g,M=y-E,b=h[0]-u[0],S=h[1]-u[1],v=b/w,L=S/M;n.includes("e")&&(v=(f[0]-u[0])/w),n.includes("s")&&(L=(f[1]-u[1])/M),n.includes("w")&&(v=(h[0]-f[0])/w),n.includes("n")&&(L=(h[1]-f[1])/M);let T=e.width*v,D=e.height*L;if(a&&(T=2*T-t.width,D=2*D-t.height),r){let B=Math.abs(T)/t.width,F=Math.abs(D)/t.height;if(n.length===1&&(D*=B,T*=F),n.length===2){let O=Math.max(B,F);T=t.width*O*Math.sign(T),D=t.height*O*Math.sign(D)}}return{nextWidth:T,nextHeight:D}},gg=(e,t,n,o,i,r,{shouldMaintainAspectRatio:a=!1,shouldResizeFromCenter:s=!1}={})=>{let l=e.map(O=>t.get(O.id)),d=l.reduce((O,K)=>{if(!ne(K))return O;let Y=Qt(K);if(!Y)return O;let se=t.get(Y)??null;return Ee(se)?[...O,{...se,...R.getBoundTextElementPosition(K,se,n)}]:O},[]),c=Fe(l.map(O=>O).concat(d)),{minX:u,minY:h,maxX:m,maxY:f,midX:g,midY:E}=c,x=m-u,y=f-h,w={ne:[u,f],se:[u,h],sw:[m,h],nw:[m,f],e:[u,h+y/2],w:[m,h+y/2],n:[u+x/2,f],s:[u+x/2,h]},[M,b]=s?[g,E]:w[o],S=s?2:1,v=Math.max(Math.abs(i-M)/x||0,Math.abs(r-b)/y||0)*S,L=o.includes("e")||o.includes("w")?Math.abs(i-M)*S:x,T=o.includes("n")||o.includes("s")?Math.abs(r-b)*S:y;a&&(L=x*v*Math.sign(i-M),T=y*v*Math.sign(r-b));let D={ne:[i<M,r>b],se:[i<M,r<b],sw:[i>M,r<b],nw:[i>M,r>b],e:[i<M,!1],w:[i>M,!1],n:[!1,r>b],s:[!1,r<b]},[B,F]=D[o].map(O=>O);return{originalBoundingBox:c,nextWidth:L,nextHeight:T,flipByX:B,flipByY:F}},Eg=(e,t,n,o,i,{shouldMaintainAspectRatio:r=!1,shouldResizeFromCenter:a=!1,flipByX:s=!1,flipByY:l=!1,nextHeight:d,nextWidth:c,originalBoundingBox:u}={})=>{if(c===void 0&&d===void 0&&s===void 0&&l===void 0||d===0||c===0)return;i||(i=t);let h=e.reduce((S,v)=>{let L=i.get(v.id);return L&&S.push({orig:L,latest:v}),S},[]),m;if(u)m=u;else{let S=h.reduce((v,{orig:L})=>{if(!ne(L))return v;let T=Qt(L);if(!T)return v;let D=i.get(T)??null;return Ee(D)?[...v,{...D,...R.getBoundTextElementPosition(L,D,t)}]:v},[]);m=Fe(h.map(({orig:v})=>v).concat(S))}let{minX:f,minY:g,maxX:E,maxY:x,midX:y,midY:w}=m,M=E-f,b=x-g;if(c===void 0&&d===void 0&&(c=M,d=b),r&&(c===void 0?c=d*(M/b):d===void 0?d=c*(b/M):Math.abs(c/d-M/b)>.001&&(c=d*(M/b))),c&&d){let S=n.includes("e")||n.includes("w")?Math.abs(c)/M:1,v=n.includes("n")||n.includes("s")?Math.abs(d)/b:1,L;n.length===1?L=n.includes("e")||n.includes("w")?S:v:L=Math.max(Math.abs(c)/M||0,Math.abs(d)/b||0);let T={ne:[f,x],se:[f,g],sw:[E,g],nw:[E,x],e:[f,g+b/2],w:[E,g+b/2],n:[f+M/2,x],s:[f+M/2,g]},[D,B]=a?[y,w]:T[n],F=r||h.some(A=>A.latest.angle!==0||te(A.latest)||Fd(A.latest));F&&(S=L,v=L);let[O,K]=[s?-1:1,l?-1:1],Y=[];for(let{orig:A,latest:_}of h){if(te(A)&&Ee(A))continue;let X=A.width*S,ve=A.height*v,Tt=Mr(A.angle*O*K),oi=ne(A)||Pe(A),Lr=A.x-D,ii=A.y-B,wo=s&&!oi?X:0,Cr=l&&!oi?ve:0,ri=D+O*(Lr*S+wo),ai=B+K*(ii*v+Cr),et=gu(A,X*O,ve*K,!1),lt={x:ri,y:ai,width:X,height:ve,angle:Tt,...et};if(U(A)&&(A.startBinding&&(lt.startBinding={...A.startBinding,fixedPoint:[s?-A.startBinding.fixedPoint[0]+1:A.startBinding.fixedPoint[0],l?-A.startBinding.fixedPoint[1]+1:A.startBinding.fixedPoint[1]]}),A.endBinding&&(lt.endBinding={...A.endBinding,fixedPoint:[s?-A.endBinding.fixedPoint[0]+1:A.endBinding.fixedPoint[0],l?-A.endBinding.fixedPoint[1]+1:A.endBinding.fixedPoint[1]]}),A.fixedSegments&&et.points&&(lt.fixedSegments=A.fixedSegments.map(zt=>({...zt,start:et.points[zt.index-1],end:et.points[zt.index]})))),Ae(A)&&(lt.scale=[A.scale[0]*O,A.scale[1]*K]),te(A)){let zt=fs(A,t,X);if(!zt)return;lt.fontSize=zt.size}let ln=i.get(Qt(A)??"");if(ln)if(F){let zt=ln.fontSize*L;if(zt<ms)return;lt.boundTextFontSize=zt}else lt.boundTextFontSize=ln.fontSize;Y.push({element:_,update:lt})}let se=Y.map(({element:A})=>A),H=new Map(Y.map(({element:A})=>[A.id,A]));for(let{element:A,update:{boundTextFontSize:_,...X}}of Y){let{angle:ve}=X;o.mutateElement(A,X),Re(A,o,{simultaneouslyUpdated:se}),Be(A)&&(A.startBinding&&(H.has(A.startBinding.elementId)||Oe(A,"start",o)),A.endBinding&&(H.has(A.endBinding.elementId)||Oe(A,"end",o)));let Tt=Z(A,t);Tt&&_&&(o.mutateElement(Tt,{fontSize:_,angle:ne(A)?void 0:ve}),Vn(A,o,n,!0))}o.triggerUpdate()}};I();import{pointFrom as ht,pointOnLineSegment as Mu,pointRotateRads as Sr}from"@excalidraw/math";import{SIDE_RESIZING_THRESHOLD as bs}from"@excalidraw/common";I();import{DEFAULT_TRANSFORM_HANDLE_SPACING as Es}from"@excalidraw/common";import{pointFrom as Eu,pointRotateRads as xg}from"@excalidraw/math";var xu={mouse:8,pen:16,touch:28},yg=16,wu={e:!0,s:!0,n:!0,w:!0},gM={e:!0,s:!0,n:!0,w:!0},EM={e:!0,s:!0,n:!0,w:!0,rotation:!0},yu={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},gs={e:!0,s:!0,n:!0,w:!0},sn=(e,t,n,o,i,r,a)=>{let[s,l]=xg(Eu(e+n/2,t+o/2),Eu(i,r),a);return[s-n/2,l-o/2,n,o]},Ir=e=>!(e.formFactor==="phone"&&e.userAgent.isMobileDevice),xs=e=>Ir(e)?wu:{},ys=([e,t,n,o,i,r],a,s,l,d={},c=4,u=Es)=>{let h=xu[l],m=h/s.value,f=h/s.value,g=h/s.value,E=h/s.value,x=n-e,y=o-t,w=c/s.value,M=(h-u*2)/(2*s.value),b={nw:d.nw?void 0:sn(e-w-g+M,t-w-E+M,m,f,i,r,a),ne:d.ne?void 0:sn(n+w-M,t-w-E+M,m,f,i,r,a),sw:d.sw?void 0:sn(e-w-g+M,o+w-M,m,f,i,r,a),se:d.se?void 0:sn(n+w-M,o+w-M,m,f,i,r,a),rotation:d.rotation?void 0:sn(e+x/2-m/2,t-w-E+M-yg/s.value,m,f,i,r,a)},S=5*xu.mouse/s.value;return Math.abs(x)>S&&(d.n||(b.n=sn(e+x/2-m/2,t-w-E+M,m,f,i,r,a)),d.s||(b.s=sn(e+x/2-m/2,o+w-M,m,f,i,r,a))),Math.abs(y)>S&&(d.w||(b.w=sn(e-w-g+M,t+y/2-f/2,m,f,i,r,a)),d.e||(b.e=sn(n+w-M,t+y/2-f/2,m,f,i,r,a))),b},bu=(e,t,n,o="mouse",i=wu)=>{if(e.locked||U(e))return{};if(e.type==="freedraw"||ne(e)){if(e.points.length===2){let[,a]=e.points;a[0]===0||a[1]===0?i=gs:a[0]>0&&a[1]<0?i=yu:a[0]>0&&a[1]>0?i=gs:a[0]<0&&a[1]>0?i=yu:a[0]<0&&a[1]<0&&(i=gs)}}else ee(e)&&(i={...i,rotation:!0});let r=ne(e)?Es+8:Ae(e)?0:Es;return ys(Q(e,n,!0),e.angle,t,o,i,r,Ae(e)?0:void 0)},xM=(e,t,n)=>{if(t.selectedLinearElement?.isEditing||t.selectedLinearElement?.isDragging)return!1;if(e.length>1)return!0;let o=e[0];return U(o)?!1:ne(o)?o.points.length>2&&!n.userAgent.isMobileDevice:!0};var Ms=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],wg=(e,t,n,o,i,r,a,s)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:l,...d}=bu(e,r,t,a,xs(s));if(l&&Ms(l,o,i))return"rotation";let c=Object.keys(d).filter(u=>{let h=d[u];return h?Ms(h,o,i):!1});if(c.length>0)return c[0];if(Ir(s)){let[u,h,m,f,g,E]=Q(e,t);if(!(ne(e)&&e.points.length<=2)){let x=Ae(e)?0:bs/r.value,y=bs/r.value,w=Pu(ht(u-x,h-x),ht(m+x,f+x),ht(g,E),e.angle);for(let[M,b]of Object.entries(w))if(Mu(ht(o,i),b,y))return M}}return!1},vM=(e,t,n,o,i,r,a,s)=>e.reduce((l,d)=>{if(l)return l;let c=wg(d,a,t,n,o,i,r,s);return c?{element:d,transformHandleType:c}:null},null),AM=([e,t,n,o],i,r,a,s,l)=>{let d=ys([e,t,n,o,(e+n)/2,(t+o)/2],0,a,s,xs(l)),c=Object.keys(d).find(u=>{let h=d[u];return h&&Ms(h,i,r)});if(c)return c;if(Ir(l)){let u=(e+n)/2,h=(t+o)/2,m=bs/a.value,f=Pu(ht(e-m,t-m),ht(n+m,o+m),ht(u,h),0);for(let[g,E]of Object.entries(f))if(Mu(ht(i,r),E,m))return g}return!1},ws=["ns","nesw","ew","nwse"],bg=(e,t)=>{let n=ws.indexOf(e);if(n>=0){let o=Math.round(t/(Math.PI/4));e=ws[(n+o)%ws.length]}return e},kM=e=>{let{element:t,transformHandleType:n}=e,o=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":o?i="nesw":i="nwse";break;case"ne":case"sw":o?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=bg(i,t.angle)),i?`${i}-resize`:""},Pu=([e,t],[n,o],i,r)=>{let a=Sr(ht(e,t),i,r),s=Sr(ht(n,t),i,r),l=Sr(ht(e,o),i,r),d=Sr(ht(n,o),i,r);return{n:[a,s],e:[s,d],s:[d,l],w:[l,a]}};I();import{KEYS as mt}from"@excalidraw/common";I();I();function Iu(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Iu(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Su(){for(var e=0,t,n,o="";e<arguments.length;)(t=arguments[e++])&&(n=Iu(t))&&(o&&(o+=" "),o+=n);return o}var be=si(Hu(),1),p=si(Ts(),1);import{THEME as Hg}from"@excalidraw/common";var kt=e=>"var(--icon-fill-color)",ju=e=>e===Hg.LIGHT?"#fff":"#1e1e1e",P=(e,t=512)=>{let{width:n=512,height:o=n,mirror:i,style:r,...a}=typeof t=="number"?{width:t}:t;return(0,p.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${o}`,className:Su({"rtl-mirror":i}),style:r,...a,children:typeof e=="string"?(0,p.jsx)("path",{fill:"currentColor",d:e}):e})},k={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},V={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Ve={width:40,height:20},jM=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("rect",{x:3,y:8,width:18,height:4,rx:1}),(0,p.jsx)("line",{x1:12,y1:8,x2:12,y2:21}),(0,p.jsx)("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),(0,p.jsx)("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),k),VM=P((0,p.jsxs)("svg",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,p.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),k),UM=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,p.jsx)("circle",{cx:"12",cy:"19",r:"1"}),(0,p.jsx)("circle",{cx:"12",cy:"5",r:"1"})]}),k),YM=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,p.jsx)("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,p.jsx)("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),k),XM=P((0,p.jsxs)("svg",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),(0,p.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),(0,p.jsx)("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),k),$M=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M6.5 9.5l3.5 -3"}),(0,p.jsx)("path",{d:"M14 5.5l3 1.5"}),(0,p.jsx)("path",{d:"M18.5 10l-2.5 7"}),(0,p.jsx)("path",{d:"M13.5 17.5l-7 -5"})]}),k),ZM=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:(0,p.jsx)("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),(0,p.jsx)("g",{mask:"url(#UnlockedIcon)",children:(0,p.jsx)("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),V),qM=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),(0,p.jsx)("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),(0,p.jsx)("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),V),KM=P((0,p.jsx)("g",{fill:"currentColor",children:(0,p.jsx)("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3"})}),{width:24,height:24}),QM=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),(0,p.jsx)("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),JM=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),(0,p.jsx)("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),eP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),(0,p.jsx)("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"}),tP=P((0,p.jsx)("g",{fill:"currentColor",children:(0,p.jsx)("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"}),Ls=P((0,p.jsxs)("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),(0,p.jsx)("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),nP=P((0,p.jsxs)("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[(0,p.jsx)("path",{d:"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255"}),(0,p.jsx)("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Vu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),k),Uu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),k),Yu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"9"})]}),k),Xu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,p.jsx)("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),(0,p.jsx)("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),k),$u=P((0,p.jsx)("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),V),oP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),(0,p.jsx)("path",{d:"M16 7h4"}),(0,p.jsx)("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),k),Zu=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),(0,p.jsx)("path",{d:"m11.25 5.417 3.333 3.333"})]}),V),qu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),(0,p.jsx)("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),(0,p.jsx)("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),(0,p.jsx)("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),(0,p.jsx)("polyline",{points:"5 20 11 4 13 4 20 20"})]}),k),iP=P((0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 7v-2h13v2"}),(0,p.jsx)("path",{d:"M10 5v14"}),(0,p.jsx)("path",{d:"M12 19h-4"}),(0,p.jsx)("path",{d:"M15 13v-1h6v1"}),(0,p.jsx)("path",{d:"M18 12v7"}),(0,p.jsx)("path",{d:"M17 19h2"})]}),k),Ku=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M12.5 6.667h.01"}),(0,p.jsx)("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),(0,p.jsx)("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),(0,p.jsx)("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),V),Qu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),(0,p.jsx)("path",{d:"M18 13.3l-6.3 -6.3"})]}),k),rP=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),V),aP=P((0,p.jsx)("path",{d:"M5 10h10",strokeWidth:"1.25"}),V),sP=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M21 21l-6 -6"}),(0,p.jsx)("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),(0,p.jsx)("path",{d:"M3 4v4h4"})]}),k),lP=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),V),dP=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("polyline",{points:"12 16 18 10 12 4"}),(0,p.jsx)("polyline",{points:"8 4 2 10 8 16"})]}),V),cP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),(0,p.jsx)("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),V),uP=P((0,p.jsx)("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),V),pP=P((0,p.jsx)("g",{stroke:"currentColor",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...V,strokeWidth:1.5}),hP=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),(0,p.jsx)("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),(0,p.jsx)("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),k),mP=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),V),fP=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,p.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),(0,p.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),k),gP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,p.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),(0,p.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),k),EP=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),V),xP=P((0,p.jsx)("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),V),yP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),(0,p.jsx)("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),V),wP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),(0,p.jsx)("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),k),bP=P((0,p.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),MP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),(0,p.jsx)("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),V),PP=P("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),IP=P("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),SP=P((0,p.jsx)("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),V),vP=P("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512}),AP=P("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),kP=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),(0,p.jsx)("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),(0,p.jsx)("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),k),TP=P((0,p.jsx)("g",{strokeWidth:1.5,children:(0,p.jsx)("path",{d:"M6 18l12 -12"})}),k),LP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15 8h.01"}),(0,p.jsx)("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),(0,p.jsx)("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),(0,p.jsx)("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),(0,p.jsx)("path",{d:"M19 16v6"}),(0,p.jsx)("path",{d:"M22 19l-3 3l-3 -3"})]}),k),CP=P("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512}),BP=P("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),DP=P("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),GP=P("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),OP=P("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),RP=P((0,p.jsx)("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),V),FP=P((0,p.jsx)("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),V),NP=P("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),HP=P((0,p.jsx)("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),V),zP=P("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"),WP=P("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24}),_P=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),(0,p.jsx)("path",{d:"M12 14v-11"}),(0,p.jsx)("path",{d:"M9 6l3 -3l3 3"})]}),k),jP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),(0,p.jsx)("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64}),VP=P((0,p.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),Ju=(0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 10l0 10"}),(0,p.jsx)("path",{d:"M12 10l4 4"}),(0,p.jsx)("path",{d:"M12 10l-4 4"}),(0,p.jsx)("path",{d:"M4 4l16 0"})]}),ep=(0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 5l0 14"}),(0,p.jsx)("path",{d:"M16 9l-4 -4"}),(0,p.jsx)("path",{d:"M8 9l4 -4"})]}),UP=P(ep,k),YP=P(ep,{...k,style:{transform:"rotate(180deg)"}}),XP=P(Ju,k),$P=P(Ju,{...k,style:{transform:"rotate(180deg)"}}),ZP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),qP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),KP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),QP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),JP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),eI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),tI=P((0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),V),nI=P((0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),V),oI=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,p.jsx)("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),(0,p.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),(0,p.jsx)("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),k),iI=P("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),rI=P("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),aI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M15 5 5 15M5 5l10 10"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),sI=P("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0}),lI=P("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),dI=P("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512}),cI=be.default.memo(({theme:e})=>P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M25 26H111V111H25",fill:kt(e)}),(0,p.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:kt(e),strokeWidth:"2"}),(0,p.jsx)("path",{d:"M100 100H160V160H100",fill:kt(e)}),(0,p.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:kt(e),strokeWidth:"2"}),(0,p.jsxs)("g",{fill:ju(e),stroke:kt(e),strokeWidth:"6",children:[(0,p.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),uI=be.default.memo(({theme:e})=>P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M25 26H111V111H25",fill:kt(e)}),(0,p.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:kt(e),strokeWidth:"2"}),(0,p.jsx)("path",{d:"M100 100H160V160H100",fill:kt(e)}),(0,p.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:kt(e),strokeWidth:"2"}),(0,p.jsxs)("g",{fill:ju(e),stroke:kt(e),strokeWidth:"6",children:[(0,p.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),pI=P((0,p.jsx)("g",{strokeWidth:1.25,children:(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),V),hI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),(0,p.jsx)("g",{mask:"url(#FillHachureIcon)",children:(0,p.jsx)("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),V),mI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",children:[(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:(0,p.jsx)("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("g",{mask:"url(#FillCrossHatchIcon)",children:(0,p.jsx)("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),fI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...V,fill:"currentColor"}),gI=P((0,p.jsx)(p.Fragment,{children:(0,p.jsx)("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),V),EI=P((0,p.jsx)("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),V),xI=P((0,p.jsx)("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),V),yI=be.default.memo(({theme:e})=>P((0,p.jsx)("path",{d:"M6 10H34",stroke:kt(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),wI=P((0,p.jsxs)("g",{strokeWidth:"2",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 12h2"}),(0,p.jsx)("path",{d:"M17 12h2"}),(0,p.jsx)("path",{d:"M11 12h2"})]}),k),bI=P((0,p.jsxs)("g",{strokeWidth:"2",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 12v.01"}),(0,p.jsx)("path",{d:"M8 12v.01"}),(0,p.jsx)("path",{d:"M12 12v.01"}),(0,p.jsx)("path",{d:"M16 12v.01"}),(0,p.jsx)("path",{d:"M20 12v.01"})]}),k),MI=P((0,p.jsx)("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),V),PI=P((0,p.jsx)("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),V),II=P((0,p.jsx)("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),V),SI=P((0,p.jsxs)("svg",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),(0,p.jsx)("path",{d:"M13.3333 3.33331V3.34331"}),(0,p.jsx)("path",{d:"M16.6667 3.33331V3.34331"}),(0,p.jsx)("path",{d:"M16.6667 6.66669V6.67669"}),(0,p.jsx)("path",{d:"M16.6667 10V10.01"}),(0,p.jsx)("path",{d:"M3.33334 13.3333V13.3433"}),(0,p.jsx)("path",{d:"M16.6667 13.3333V13.3433"}),(0,p.jsx)("path",{d:"M3.33334 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M6.66666 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M10 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M13.3333 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M16.6667 16.6667V16.6767"})]}),V),vI=P((0,p.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),(0,p.jsx)("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),(0,p.jsx)("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),(0,p.jsx)("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),(0,p.jsx)("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),(0,p.jsx)("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),(0,p.jsx)("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),(0,p.jsx)("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),(0,p.jsx)("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),(0,p.jsx)("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),(0,p.jsx)("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),(0,p.jsx)("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),k),AI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,fill:"none",strokeLinecap:"round",children:[(0,p.jsx)("path",{d:"M7,11 H19"}),(0,p.jsx)("path",{d:"M25,6 L33,16 M33,6 L25,16"})]}),Ve)),kI=be.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M7,11 H33 M23,5 L33,11 L23,17"})}),Ve)),TI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",children:[(0,p.jsx)("path",{d:"M7,11 H23",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{d:"M23,5 L35,11 L23,17 Z"})]}),Ve)),LI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",children:[(0,p.jsx)("path",{d:"M7,11 H23"}),(0,p.jsx)("path",{d:"M23,5 L35,11 L23,17 Z"})]}),Ve)),CI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[(0,p.jsx)("path",{d:"M7,11 H25",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("circle",{cx:"29",cy:"11",r:"4"})]}),Ve)),BI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[(0,p.jsx)("path",{d:"M7,11 H25",strokeLinecap:"round"}),(0,p.jsx)("circle",{cx:"29",cy:"11",r:"4"})]}),Ve)),DI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",children:[(0,p.jsx)("path",{d:"M7,11 H21",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{d:"M21,11 L28,5 L35,11 L28,17 Z"})]}),Ve)),GI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,strokeLinecap:"round",children:[(0,p.jsx)("path",{d:"M7,11 H21"}),(0,p.jsx)("path",{d:"M21,11 L28,5 L35,11 L28,17 Z"})]}),Ve)),OI=be.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",strokeLinecap:"round",children:(0,p.jsx)("path",{d:"M11,11 H31 M31,5 V17"})}),Ve)),RI=be.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M15,5 V17"})}),Ve)),FI=be.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M15,11 L7,5 M15,11 L7,17"})}),Ve)),NI=be.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M23,5 V17 M15,11 L7,5 M15,11 L7,17"})}),Ve)),HI=be.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M15,5 V17 M7,5 V17"})}),Ve)),zI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:[(0,p.jsx)("path",{d:"M35,11 H19 M11,11 H7 M7,5 V17"}),(0,p.jsx)("circle",{cx:"15",cy:"11",r:"4"})]}),Ve)),WI=be.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:[(0,p.jsx)("path",{d:"M35,11 H27 M19,11 H7 M15,11 L7,5 M15,11 L7,17"}),(0,p.jsx)("circle",{cx:"23",cy:"11",r:"4"})]}),Ve)),_I=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),jI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),VI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),UI=P((0,p.jsx)(p.Fragment,{children:(0,p.jsx)("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),V),YI=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 7v-2h13v2"}),(0,p.jsx)("path",{d:"M10 5v14"}),(0,p.jsx)("path",{d:"M12 19h-4"}),(0,p.jsx)("path",{d:"M15 13v-1h6v1"}),(0,p.jsx)("path",{d:"M18 12v7"}),(0,p.jsx)("path",{d:"M17 19h2"})]}),k),XI=P((0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 12h10"}),(0,p.jsx)("path",{d:"M7 5v14"}),(0,p.jsx)("path",{d:"M17 5v14"}),(0,p.jsx)("path",{d:"M15 19h4"}),(0,p.jsx)("path",{d:"M15 5h4"}),(0,p.jsx)("path",{d:"M5 19h4"}),(0,p.jsx)("path",{d:"M5 5h4"})]})}),k),$I=P((0,p.jsx)(p.Fragment,{children:(0,p.jsx)("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),V),ZI=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 8l-4 4l4 4"}),(0,p.jsx)("path",{d:"M17 8l4 4l-4 4"}),(0,p.jsx)("path",{d:"M14 4l-4 16"})]}),k);var qI=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,p.jsx)("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),(0,p.jsx)("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),k),KI=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,p.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),(0,p.jsx)("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),k),QI=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,p.jsx)("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),(0,p.jsx)("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),k),JI=be.default.memo(({theme:e})=>P((0,p.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),(0,p.jsx)("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),k)),eS=be.default.memo(({theme:e})=>P((0,p.jsxs)("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),(0,p.jsx)("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),k)),tS=be.default.memo(({theme:e})=>P((0,p.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),(0,p.jsx)("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),(0,p.jsx)("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),k)),nS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M21 19h-18l9 -15"}),(0,p.jsx)("path",{d:"M20.615 15.171h.015"}),(0,p.jsx)("path",{d:"M19.515 11.771h.015"}),(0,p.jsx)("path",{d:"M17.715 8.671h.015"}),(0,p.jsx)("path",{d:"M15.415 5.971h.015"})]}),k),oS=P((0,p.jsx)("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512}),iS=P((0,p.jsx)("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"})),rS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),(0,p.jsx)("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),(0,p.jsx)("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),(0,p.jsx)("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),k),aS=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),(0,p.jsx)("path",{d:"M7 11l5 5l5 -5"}),(0,p.jsx)("path",{d:"M12 4l0 12"})]}),k),sS=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),(0,p.jsx)("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),k),lS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,p.jsx)("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,p.jsx)("path",{d:"M9.15 14.85l8.85 -10.85"}),(0,p.jsx)("path",{d:"M6 4l8.85 10.85"})]}),k),dS=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),(0,p.jsx)("path",{d:"M12 17l0 .01"}),(0,p.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),k),cS=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 4v16l13 -8z"})]}),k),uS=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),k),pS=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 12l5 5l10 -10"})]}),k),hS=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),(0,p.jsx)("path",{d:"M12 9v4"}),(0,p.jsx)("path",{d:"M12 17h.01"})]}),k),mS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M11 7l6 6"}),(0,p.jsx)("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),k),fS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 3l-4 7h8z"}),(0,p.jsx)("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,p.jsx)("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),k),gS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 7l16 0"}),(0,p.jsx)("path",{d:"M4 17l16 0"}),(0,p.jsx)("path",{d:"M7 4l0 16"}),(0,p.jsx)("path",{d:"M17 4l0 16"})]}),k),ES=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),(0,p.jsx)("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),k),xS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),(0,p.jsx)("path",{d:"M4 15l8 4l8 -4"}),(0,p.jsx)("path",{d:"M12 4v7"}),(0,p.jsx)("path",{d:"M15 8l-3 3l-3 -3"})]}),k),yS=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M4.16602 10H15.8327"}),(0,p.jsx)("path",{d:"M12.5 13.3333L15.8333 10"}),(0,p.jsx)("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),V),wS=P((0,p.jsxs)("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[(0,p.jsx)("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),(0,p.jsx)("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),bS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,p.jsx)("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),(0,p.jsx)("path",{d:"M15 6l3 3"}),(0,p.jsx)("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),(0,p.jsx)("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),k),MS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,p.jsx)("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),(0,p.jsx)("path",{d:"M15 6l3 3"}),(0,p.jsx)("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),(0,p.jsx)("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),k),PS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),(0,p.jsx)("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),(0,p.jsx)("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),(0,p.jsx)("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),(0,p.jsx)("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),(0,p.jsx)("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),k),IS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),(0,p.jsx)("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),(0,p.jsx)("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),(0,p.jsx)("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),k),SS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),(0,p.jsx)("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),k),vS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),(0,p.jsx)("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),(0,p.jsx)("path",{d:"M3 3l18 18"})]}),k),AS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),(0,p.jsx)("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),(0,p.jsx)("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),(0,p.jsx)("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),(0,p.jsx)("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),(0,p.jsx)("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),k),kS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),(0,p.jsx)("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),(0,p.jsx)("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),(0,p.jsx)("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),(0,p.jsx)("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),(0,p.jsx)("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),k),TS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),(0,p.jsx)("path",{d:"M21 21l-6 -6"})]}),k),LS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),(0,p.jsx)("path",{d:"M12 7v5l3 3"}),(0,p.jsx)("path",{d:"M19 16l-2 3h4l-2 3"})]}),k),CS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 8l0 4l2 2"}),(0,p.jsx)("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),k),BS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),(0,p.jsx)("path",{d:"M5 10a7 7 0 0 0 14 0"}),(0,p.jsx)("path",{d:"M8 21l8 0"}),(0,p.jsx)("path",{d:"M12 17l0 4"})]}),k),DS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 3l18 18"}),(0,p.jsx)("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),(0,p.jsx)("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),(0,p.jsx)("path",{d:"M8 21l8 0"}),(0,p.jsx)("path",{d:"M12 17l0 4"})]}),k),GS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),k),OS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),(0,p.jsx)("path",{d:"M12 20v.01"}),(0,p.jsx)("path",{d:"M16 20v.01"}),(0,p.jsx)("path",{d:"M8 20v.01"}),(0,p.jsx)("path",{d:"M4 20v.01"}),(0,p.jsx)("path",{d:"M4 16v.01"}),(0,p.jsx)("path",{d:"M4 12v.01"}),(0,p.jsx)("path",{d:"M4 8v.01"}),(0,p.jsx)("path",{d:"M4 4v.01"}),(0,p.jsx)("path",{d:"M8 4v.01"}),(0,p.jsx)("path",{d:"M12 4v.01"}),(0,p.jsx)("path",{d:"M16 4v.01"}),(0,p.jsx)("path",{d:"M20 4v.01"}),(0,p.jsx)("path",{d:"M20 8v.01"}),(0,p.jsx)("path",{d:"M20 12v.01"}),(0,p.jsx)("path",{d:"M20 16v.01"}),(0,p.jsx)("path",{d:"M20 20v.01"})]}),k),RS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 3v18"}),(0,p.jsx)("path",{d:"M19 21v-18"}),(0,p.jsx)("path",{d:"M5 7h14"}),(0,p.jsx)("path",{d:"M5 15h14"}),(0,p.jsx)("path",{d:"M8 13v4"}),(0,p.jsx)("path",{d:"M11 13v4"}),(0,p.jsx)("path",{d:"M16 13v4"}),(0,p.jsx)("path",{d:"M14 5v4"}),(0,p.jsx)("path",{d:"M11 5v4"}),(0,p.jsx)("path",{d:"M8 5v4"}),(0,p.jsx)("path",{d:"M3 21h18"})]}),k),FS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 12l18 0"}),(0,p.jsx)("path",{d:"M7 16l10 0l-10 5l0 -5"}),(0,p.jsx)("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),k),NS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 3l0 18"}),(0,p.jsx)("path",{d:"M16 7l0 10l5 0l-5 -10"}),(0,p.jsx)("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),k),HS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),(0,p.jsx)("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),(0,p.jsx)("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),k),zS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),(0,p.jsx)("path",{d:"M22 22l-3 -3"}),(0,p.jsx)("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),(0,p.jsx)("path",{d:"M3 11v-1"}),(0,p.jsx)("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),(0,p.jsx)("path",{d:"M10 3h1"}),(0,p.jsx)("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),k),WS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),(0,p.jsx)("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),(0,p.jsx)("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),(0,p.jsx)("path",{d:"M10 15l2 6l2 -6"}),(0,p.jsx)("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),k),_S=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),(0,p.jsx)("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),(0,p.jsx)("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),(0,p.jsx)("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),(0,p.jsx)("path",{d:"M11 21v-6l3 6v-6"})]}),k),jS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),(0,p.jsx)("path",{d:"M4 8l5 0"}),(0,p.jsx)("path",{d:"M15 8l4 0"})]}),k),VS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),(0,p.jsx)("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),(0,p.jsx)("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),(0,p.jsx)("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),(0,p.jsx)("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),k),US=P((0,p.jsxs)("g",{stroke:"currentColor",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...k,strokeWidth:1.5}),YS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),(0,p.jsx)("path",{d:"M21 12h-13l3 -3"}),(0,p.jsx)("path",{d:"M11 15l-3 -3"})]}),k),XS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),(0,p.jsx)("path",{d:"M10 9l5 3l-5 3z"})]}),k),$S=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 6h18"}),(0,p.jsx)("path",{d:"M3 12h18"}),(0,p.jsx)("path",{d:"M3 18h18"}),(0,p.jsx)("path",{d:"M6 3v18"}),(0,p.jsx)("path",{d:"M12 3v18"}),(0,p.jsx)("path",{d:"M18 3v18"})]}),k),ZS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),(0,p.jsx)("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),(0,p.jsx)("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),k),qS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 18l12 -12"}),(0,p.jsx)("path",{d:"M18 10v-4h-4"})]}),k),KS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),(0,p.jsx)("path",{d:"M18 4l3 3l-3 3"})]}),k),QS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{d:"M16,12L20,9L16,6"}),(0,p.jsx)("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),k),JS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 9l6 6l6 -6"})]}),k),ev=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 15l6 -6l6 6"})]}),k),tv=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 15l6 -6l6 6"})]}),k),nv=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),(0,p.jsx)("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),k),ov=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 7l0 10"}),(0,p.jsx)("path",{d:"M7 5l10 0"}),(0,p.jsx)("path",{d:"M7 19l10 0"}),(0,p.jsx)("path",{d:"M19 7l0 10"})]}),k),iv=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("rect",{x:"4",y:"4",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"10",y:"4",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"16",y:"4",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"4",y:"10",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"10",y:"10",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"16",y:"10",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"4",y:"16",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"10",y:"16",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"16",y:"16",width:"4",height:"4",rx:"1"})]}),k),rv=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("rect",{x:"7",y:"6",width:"10",height:"8",rx:"1",strokeDasharray:"2 2"}),(0,p.jsx)("line",{x1:"3",y1:"6",x2:"3",y2:"14"}),(0,p.jsx)("polyline",{points:"2 8 3 6 4 8"}),(0,p.jsx)("polyline",{points:"2 12 3 14 4 12"}),(0,p.jsx)("line",{x1:"7",y1:"18",x2:"17",y2:"18"}),(0,p.jsx)("polyline",{points:"9 17 7 18 9 19"}),(0,p.jsx)("polyline",{points:"15 17 17 18 15 19"})]}),k),av=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),(0,p.jsx)("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),k),sv=P((0,p.jsx)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:.5,viewBox:"0 0 640 512",children:(0,p.jsx)("path",{d:"M15 15C24.4 5.7 39.6 5.7 49 15l63 63L112 40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96c0 13.3-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l38.1 0L15 49C5.7 39.6 5.7 24.4 15 15zM133.5 243.9C158.6 193.6 222.7 112 320 112s161.4 81.6 186.5 131.9c3.8 7.6 3.8 16.5 0 24.2C481.4 318.4 417.3 400 320 400s-161.4-81.6-186.5-131.9c-3.8-7.6-3.8-16.5 0-24.2zM320 320a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM591 15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-63 63 38.1 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24s24 10.7 24 24l0 38.1 63-63zM15 497c-9.4-9.4-9.4-24.6 0-33.9l63-63L40 400c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0c13.3 0 24 10.7 24 24l0 96c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-38.1L49 497c-9.4 9.4-24.6 9.4-33.9 0zm576 0l-63-63 0 38.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24l96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-38.1 0 63 63c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"})})),lv=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 6l8 0"}),(0,p.jsx)("path",{d:"M16 6l4 0"}),(0,p.jsx)("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 12l2 0"}),(0,p.jsx)("path",{d:"M10 12l10 0"}),(0,p.jsx)("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 18l11 0"}),(0,p.jsx)("path",{d:"M19 18l1 0"})]}),k),dv=P((0,p.jsxs)("g",{strokeWidth:1,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),k),cv=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),(0,p.jsx)("path",{d:"M13.5 6.5l4 4"})]}),k),uv=P((0,p.jsxs)("g",{strokeWidth:1,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M11 7l-5 5l5 5"}),(0,p.jsx)("path",{d:"M17 7l-5 5l5 5"})]}),k),pv=P((0,p.jsxs)("g",{strokeWidth:"1.75",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),(0,p.jsx)("path",{d:"M15 4l0 16"})]}),k),hv=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"})]}),k),mv=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 4l18 0"}),(0,p.jsx)("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),(0,p.jsx)("path",{d:"M12 16l0 4"}),(0,p.jsx)("path",{d:"M9 20l6 0"}),(0,p.jsx)("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),k);var fv=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("polyline",{points:"9 6 15 12 9 18"})]}),k),gv=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 6l8 0"}),(0,p.jsx)("path",{d:"M16 6l4 0"}),(0,p.jsx)("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 12l2 0"}),(0,p.jsx)("path",{d:"M10 12l10 0"}),(0,p.jsx)("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 18l11 0"}),(0,p.jsx)("path",{d:"M19 18l1 0"})]}),k);var tp=[{icon:Ls,value:"selection",key:mt.V,numericKey:void 0,fillable:!0,myocSimplifiedMode:!0},{icon:Vu,value:"rectangle",key:mt.R,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Uu,value:"diamond",key:mt.D,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Yu,value:"ellipse",key:mt.O,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Xu,value:"arrow",key:mt.A,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:$u,value:"line",key:mt.L,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Zu,value:"freedraw",key:[mt.P,mt.X],numericKey:void 0,fillable:!1,myocSimplifiedMode:!0},{icon:qu,value:"text",key:mt.T,numericKey:void 0,fillable:!1,myocSimplifiedMode:!0},{icon:Ku,value:"image",key:[mt.I],numericKey:void 0,fillable:!1,myocSimplifiedMode:!0},{icon:Qu,value:"eraser",key:mt.E,numericKey:void 0,fillable:!1,myocSimplifiedMode:!0}],zg=e=>e.state.preferredSelectionTool.type==="lasso"?[{value:"lasso",icon:Ls,key:mt.V,fillable:!0,myocSimplifiedMode:!0},...tp.slice(1)]:tp,Iv=(e,t)=>zg(t).find((o,i)=>o.numericKey!=null&&e===o.numericKey?.toString()||o.key&&(typeof o.key=="string"?o.key===e:o.key.includes(e)))?.value||null,Sv=(e,t)=>{let n=Z(e,t);return n?e.type==="arrow"?ti({...n,...R.getBoundTextElementPosition(e,n,t)},t):ti(n,t):null};I();var Tv=(e,t)=>!!(!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="lasso"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||Ht(t,e).length));I();import{pointFrom as kr}from"@excalidraw/math";import{DEFAULT_FONT_FAMILY as Wg,DEFAULT_FONT_SIZE as _g,TEXT_ALIGN as jg,VERTICAL_ALIGN as Vg,getSizeFromPoints as Ug,randomId as Yg,arrayToMap as Xg,assertNever as Cs,cloneJSON as op,getFontString as $g,isDevEnv as Zg,toBrandedType as qg,getLineHeight as Kg}from"@excalidraw/common";var Tr={width:100,height:0},Rn=100,Qg=(e,t,n)=>{let o=Kn({x:0,y:0,textAlign:jg.CENTER,verticalAlign:Vg.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:o.id})}),Oi(o,e,n),[e,o]},np=(e,t,n,o,i)=>{let r,a;if(Object.assign(e,{startBinding:e?.startBinding||null,endBinding:e.endBinding||null}),t){let c=t?.width??Rn,u=t?.height??Rn,h;t.id&&(h=o.getElement(t.id),h||console.error(`No element for start binding with id ${t.id} found`));let m=t.x||e.x-c,f=t.y||e.y-u/2,g=h?h.type:t.type;if(g){if(g==="text"){let E="";h&&h.type==="text"?E=h.text:t.type==="text"&&(E=t.text),E||console.error(`No text found for start binding text element for ${e.id}`),r=Kn({x:m,y:f,type:"text",...h,...t,text:E}),Object.assign(r,{x:t.x||e.x-r.width,y:t.y||e.y-r.height/2})}else switch(g){case"rectangle":case"ellipse":case"diamond":{r=qn({x:m,y:f,width:c,height:u,...h,...t,type:g});break}default:Cs(e,`Unhandled element start type "${t.type}"`,!0)}Nt(e,r,"orbit","start",i)}}if(n){let c=n?.height??Rn,u=n?.width??Rn,h;n.id&&(h=o.getElement(n.id),h||console.error(`No element for end binding with id ${n.id} found`));let m=n.x||e.x+e.width,f=n.y||e.y-c/2,g=h?h.type:n.type;if(g){if(g==="text"){let E="";h&&h.type==="text"?E=h.text:n.type==="text"&&(E=n.text),E||console.error(`No text found for end binding text element for ${e.id}`),a=Kn({x:m,y:f,type:"text",...h,...n,text:E}),Object.assign(a,{y:n.y||e.y-a.height/2})}else switch(g){case"rectangle":case"ellipse":case"diamond":{a=qn({x:m,y:f,width:u,height:c,...h,...n,type:g});break}default:Cs(e,`Unhandled element end type "${g}"`,!0)}Nt(e,a,"orbit","end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:r,endBoundElement:a};let s=e.points.length-1,l=.5,d=op(e.points);return e.points[s][0]>e.points[s-1][0]&&(d[0][0]=l,d[s][0]-=l),e.points[s][0]<e.points[s-1][0]&&(d[0][0]=-l,d[s][0]+=l),e.points[s][1]>e.points[s-1][1]&&(d[0][1]=l,d[s][1]-=l),e.points[s][1]<e.points[s-1][1]&&(d[0][1]=-l,d[s][1]+=l),Object.assign(e,R.getNormalizeElementPointsAndCoords({...e,points:d})),{linearElement:e,startBoundElement:r,endBoundElement:a}},Bs=class{excalidrawElements=new Map;add=t=>{t&&this.excalidrawElements.set(t.id,t)};getElements=()=>Ca(Array.from(this.excalidrawElements.values()));getElementsMap=()=>qg(Xg(this.getElements()));getElement=t=>this.excalidrawElements.get(t)},jv=(e,t)=>{if(!e)return[];let n=op(e),o=new Bs,i=new Map,r=new Map;for(let l of n){let d,c=l.id;switch(t?.regenerateIds!==!1&&Object.assign(l,{id:Yg()}),l.type){case"rectangle":case"ellipse":case"diamond":{let h=l?.label?.text&&l.width===void 0?0:l?.width||Rn,m=l?.label?.text&&l.height===void 0?0:l?.height||Rn;d=qn({...l,width:h,height:m});break}case"line":{let h=l.width||Tr.width,m=l.height||Tr.height;d=Qc({width:h,height:m,points:[kr(0,0),kr(h,m)],...l});break}case"arrow":{let h=l.width||Tr.width,m=l.height||Tr.height;d=Er({width:h,height:m,endArrowhead:"arrow",points:[kr(0,0),kr(h,m)],...l,type:"arrow"}),Object.assign(d,Ug(d.points));break}case"text":{let h=l?.fontFamily||Wg,m=l?.fontSize||_g,f=l?.lineHeight||Kg(h),g=l.text??"",E=Ro(g),x=ot(E,$g({fontFamily:h,fontSize:m}),f);d=Kn({width:x.width,height:x.height,fontFamily:h,fontSize:m,...l});break}case"image":{d=Jc({width:l?.width||Rn,height:l?.height||Rn,...l});break}case"frame":{d=Zc({x:0,y:0,...l});break}case"magicframe":{d=qc({x:0,y:0,...l});break}case"freedraw":case"iframe":case"embeddable":{d=l;break}default:d=l,Cs(l,`Unhandled element type "${l.type}"`,!0)}o.getElement(d.id)?console.error(`Duplicate id found for ${d.id}`):(o.add(d),i.set(d.id,l),c&&r.set(c,d.id))}let a=o.getElementsMap(),s=new fo(a);for(let[l,d]of i){let c=o.getElement(l);switch(d.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if(d.label?.text){let[u,h]=Qg(c,d?.label,s);if(o.add(u),o.add(h),j(u)){let m=d.type==="arrow"?d?.start:void 0,f=d.type==="arrow"?d?.end:void 0;if(m&&m.id){let y=r.get(m.id);y&&Object.assign(m,{id:y})}if(f&&f.id){let y=r.get(f.id);y&&Object.assign(f,{id:y})}let{linearElement:g,startBoundElement:E,endBoundElement:x}=np(u,m,f,o,s);u=g,o.add(g),o.add(E),o.add(x)}}else switch(d.type){case"arrow":{let{start:u,end:h}=d;if(u&&u.id){let E=r.get(u.id);Object.assign(u,{id:E})}if(h&&h.id){let E=r.get(h.id);Object.assign(h,{id:E})}let{linearElement:m,startBoundElement:f,endBoundElement:g}=np(c,u,h,o,s);o.add(m),o.add(f),o.add(g);break}}break}}}for(let[l,d]of i){if(d.type!=="frame"&&d.type!=="magicframe")continue;let c=o.getElement(l);if(!c)throw new Error(`Excalidraw element with id ${l} doesn't exist`);let u=[];d.children.forEach(b=>{let S=r.get(b);if(!S)throw new Error(`Element with ${b} wasn't mapped correctly`);let v=o.getElement(S);if(!v)throw new Error(`Frame element with id ${S} doesn't exist`);Object.assign(v,{frameId:c.id}),v?.boundElements?.forEach(L=>{let T=o.getElement(L.id);if(!T)throw new Error(`Bound element with id ${L.id} doesn't exist`);Object.assign(T,{frameId:c.id}),u.push(T)}),u.push(v)});let[h,m,f,g]=We(u),E=10;h=h-E,m=m-E,f=f+E,g=g+E;let x=c?.x||h,y=c?.y||m,w=c?.width||f-h,M=c?.height||g-m;Object.assign(c,{x,y,width:w,height:M}),Zg()&&d.children.length&&(c?.x||c?.y||c?.width||c?.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return o.getElements()};I();var $v=({app:e,event:t})=>{let n=e.state;if(n.selectedLinearElement&&e.lastPointerMoveCoords){if(n.selectedLinearElement.draggedFocusPointBinding)return pu(n.selectedLinearElement,e.scene.getNonDeletedElementsMap(),e.lastPointerMoveCoords,e.scene,n,e.getEffectiveGridSize(),t.altKey),!0;if(n.selectedLinearElement.hoverPointIndex!==null&&e.lastPointerMoveEvent&&n.selectedLinearElement.initialState.lastClickedPoint>=0&&n.selectedLinearElement.isDragging)return R.handlePointDragging(e.lastPointerMoveEvent,e,e.lastPointerMoveCoords.x,e.lastPointerMoveCoords.y,n.selectedLinearElement),!0}return!1};I();var Jg=e=>{switch(e){case void 0:case null:return null;case"dot":return"circle";case"crowfoot_one":return"cardinality_one";case"crowfoot_many":return"cardinality_many";case"crowfoot_one_or_many":return"cardinality_one_or_many";default:return e}},Kv=e=>{let t=Jg(e);return t===null?null:t};var n7=e=>e.reduce((t,n)=>t+n.version,0),Dc=e=>{let t=5381;for(let n of eE(e))t=(t<<5)+t+n.versionNonce;return t>>>0},Gc=e=>{let t=5381;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);t=(t<<5)+t+o}return t>>>0},o7=e=>e.filter(t=>!t.isDeleted&&!wc(t)),i7=e=>e.filter(t=>!t.isDeleted),r7=e=>!e.isDeleted;export{Ln as AppStateDelta,Th as BASE_ARROW_MIN_LENGTH,pd as BASE_BINDING_GAP,Un as BASE_BINDING_GAP_ELBOW,re as BASE_PADDING,In as BindableElement,Pn as BoundElement,Je as CaptureUpdateAction,cb as DEFAULT_LINK_SIZE,wu as DEFAULT_OMIT_SIDES,$ as Delta,ts as DurableIncrement,$a as ElementBounds,Cn as ElementsDelta,ns as EphemeralIncrement,Yo as FOCUS_POINT_SIZE,lu as FlowChartCreator,su as FlowChartNavigator,ke as HEADING_DOWN,Ze as HEADING_LEFT,we as HEADING_RIGHT,rt as HEADING_UP,h0 as INVISIBLY_SMALL_ELEMENT_SIZE,Ta as InvalidFractionalIndexError,R as LinearElementEditor,Ce as MINIMAL_CROP_SIZE,EM as OMIT_SIDES_FOR_FRAME,gM as OMIT_SIDES_FOR_MULTIPLE_ELEMENTS,tp as SHAPES,fo as Scene,at as ShapeCache,Lc as Store,ni as StoreChange,os as StoreDelta,hr as StoreIncrement,Bn as StoreSnapshot,pt as aabbForElement,nm as addElementsToFrame,tg as addNewNodes,yw as addToGroup,s6 as alignElements,x6 as arrangeElements,Rh as avoidRectangularCorner,Nt as bindBindingElement,Ad as bindElementsToFramesAfterDuplication,Lh as bindOrUnbindBindingElement,d3 as bindOrUnbindBindingElements,ba as bindPointToSnapToElementOutline,gd as bindingProperties,tr as boundsContainBounds,ad as bumpVersion,Nh as calculateFixedPointForElbowArrowBinding,ao as calculateFixedPointForNonElbowArrowBinding,rx as canApplyRoundnessTypeToElement,El as canBecomePolygon,Gl as canChangeRoundness,Af as canCreateLinkFromElements,cy as canHaveArrowheads,Ir as canResizeFromSides,oo as charWidth,ye as compareHeading,Fo as computeBoundTextPosition,ta as computeContainerDimensionForBoundText,Ox as containsCJK,jv as convertToExcalidrawElements,n5 as createPlaceholderEmbeddableLabel,ss as createSrcDoc,q2 as cropElement,mn as deconstructDiamondElement,_n as deconstructLinearOrFreeDrawElement,hn as deconstructRectanguloidElement,es as deepCopyElement,B4 as defaultGetElementLinkFromSelection,kx as detectLineHeight,En as distanceToElement,f4 as distributeElements,Ot as doBoundsIntersect,A4 as dragNewElement,S4 as dragSelectedElements,R0 as duplicateElement,B6 as duplicateElements,xw as editGroupForSelectedElement,le as elementCenterPoint,Sn as elementOverlapsWithFrame,Ko as elementWithCanvasCache,An as elementsAreInFrameBounds,Rd as elementsAreInSameGroup,i5 as embeddableURLValidator,pm as excludeElementsInFramesFromSelection,j3 as filterElementsEligibleAsFrameChildren,Iv as findShapeByKey,u3 as fixBindingsAfterDeletion,fd as fixDuplicatedBindingsAfterDuplication,ua as flipHeading,Z3 as frameAndChildrenSelectedTogether,Il as generateLinearCollisionShape,Qe as generateRoughOptions,pw as getActiveTextElement,Fi as getAllHoveredElementAtPoint,Tl as getApproxMinLineHeight,kl as getApproxMinLineWidth,Ed as getArrowLocalFixedPoints,a0 as getArrowheadAngle,Kv as getArrowheadForPicker,je as getArrowheadPoints,r0 as getArrowheadSize,Ne as getBindingGap,p3 as getBindingSideMidPoint,va as getBindingStrategyForDraggingBindingElementEndpoints,Z as getBoundTextElement,Qt as getBoundTextElementId,Xx as getBoundTextElementPosition,No as getBoundTextMaxHeight,yt as getBoundTextMaxWidth,Sv as getBoundTextShape,Za as getBoundsFromPoints,xn as getCenterForBounds,Ub as getClosestElementBounds,Fe as getCommonBoundingBox,We as getCommonBounds,em as getCommonFrameId,Ux as getContainerCenter,na as getContainerCoords,De as getContainerElement,vn as getContainingFrame,Xt as getCornerRadius,Ni as getCubicBezierCurveBound,kM as getCursorForResizingElement,sm as getDefaultFrameName,ax as getDefaultRoundnessTypeForElement,Pl as getDiamondBaseCorners,no as getDiamondPoints,v4 as getDragOffsetXY,Vb as getDraggedElementsBounds,Q as getElementAbsoluteCoords,ue as getElementBounds,Ga as getElementLineSegments,za as getElementPointsCoords,ti as getElementShape,vM as getElementWithTransformHandleType,kd as getElementsCompletelyInFrame,ze as getElementsInGroup,_3 as getElementsInNewFrame,W3 as getElementsInResizingFrame,O3 as getElementsIntersectingFrame,$3 as getElementsOverlappingFrame,Cd as getElementsWithinSelection,t5 as getEmbedLink,K2 as getFlipAdjustedCropPosition,kn as getFrameChildren,tm as getFrameChildrenInsertionIndex,Qh as getFrameLikeElements,X3 as getFrameLikeTitle,hb as getFreedrawOutlineAsSegments,Zm as getFreedrawOutlinePoints,Ye as getGlobalFixedPointForBindableElement,Hh as getGlobalFixedPoints,rd as getHeadingForElbowArrowSnap,Jt as getHoveredElementForBinding,Xl as getHoveredElementForFocusPoint,F5 as getInitializedImageElements,Bi as getLineHeightInPx,gn as getLineWidth,sx as getLinearElementSubType,x5 as getLinkDirectionFromKey,D4 as getLinkIdAndTypeFromSelection,ec as getLockedLinearCursorAlignSize,E1 as getMaxCharWidth,or as getMaximumGroups,Lx as getMinCharWidth,Zo as getMinMaxXYFromCurvePathOps,Ci as getMinTextElementWidth,Nd as getNewGroupIdsForDuplication,i7 as getNonDeletedElements,Od as getNonDeletedGroupIds,t6 as getNormalizedDimensions,mo as getObservedAppState,xs as getOmitSidesForEditorInterface,Px as getOriginalContainerHeightFromCache,qa as getPerfectElementSize,us as getPredecessors,jb as getRectangleBoxAbsoluteCoords,Nm as getRenderOpacity,dM as getResizeArrowDirection,lM as getResizeOffsetXY,pn as getResizedElementAbsoluteCoords,z3 as getRootElements,n7 as getSceneVersion,Ht as getSelectedElements,ir as getSelectedElementsByGroup,Fa as getSelectedGroupForElement,xm as getSelectedGroupIdForElement,gm as getSelectedGroupIds,uw as getSelectionStateForElements,ki as getSnapOutlineMidPoint,cw as getTargetElements,im as getTargetFrame,Yx as getTextElementAngle,Kx as getTextFromElements,g1 as getTextHeight,Ll as getTextWidth,zg as getToolbarTools,AM as getTransformHandleTypeFromCoords,bu as getTransformHandles,ys as getTransformHandlesFromCoords,cl as getUncroppedImageElement,jr as getUncroppedWidthAndHeight,lw as getVisibleAndNonSelectedElements,o7 as getVisibleElements,Yb as getVisibleSceneBounds,v1 as getWrappedTextLines,H3 as groupByFrameLikes,F3 as groupsAreAtLeastIntersectingTheFrame,N3 as groupsAreCompletelyOutOfFrame,Vn as handleBindTextResize,pu as handleFocusPointDrag,C5 as handleFocusPointHover,T5 as handleFocusPointPointerDown,L5 as handleFocusPointPointerUp,aa as hasBackground,Ct as hasBoundTextElement,xM as hasBoundingBox,ay as hasStrokeColor,ly as hasStrokeStyle,sy as hasStrokeWidth,Dc as hashElementsVersion,Gc as hashString,$e as headingForPoint,zo as headingForPointFromElement,bt as headingForPointIsHorizontal,qe as headingIsHorizontal,Cy as headingIsVertical,J1 as hitElementBoundText,Q1 as hitElementBoundingBox,Sy as hitElementBoundingBoxOnly,Bt as hitElementItself,Gt as intersectElementWithLineSegment,ix as isArrowBoundToElement,j as isArrowElement,ge as isBindableElement,da as isBindableElementInsideOtherBindable,Be as isBindingElement,e1 as isBindingElementType,Ft as isBindingEnabled,Ee as isBoundToContainer,R3 as isCursorInFrame,Qp as isCurvedArrow,U as isElbowArrow,e6 as isElementCompletelyInViewport,Oa as isElementContainingFrame,Ld as isElementInFrame,Em as isElementInGroup,Gd as isElementInViewport,so as isElementIntersectingFrame,G4 as isElementLink,dx as isEligibleFrameChildType,pl as isEmbeddableElement,ox as isExcalidrawElement,zh as isFixedPoint,Vr as isFlowchartNodeElement,wr as isFocusPointVisible,Ai as isFrameElement,ee as isFrameLikeElement,Pe as isFreeDrawElement,qp as isFreeDrawElementType,rg as isHTMLSVGElement,Si as isIframeElement,vi as isIframeLikeElement,Ae as isImageElement,Fd as isInGroup,zn as isInitializedImageElement,wc as isInvisiblySmallElement,Ut as isLineElement,ne as isLinearElement,Jp as isLinearElementType,hl as isMagicFrameElement,Ax as isMeasureTextSupported,y5 as isNodeInFlowchart,r7 as isNonDeletedElement,$t as isPathALoop,Zt as isPointInElement,Do as isRectangularElement,ml as isRectanguloidElement,fm as isSelectedViaGroup,Kp as isSharpArrow,nx as isSimpleArrow,dw as isSomeElementSelected,t1 as isTextBindableContainer,te as isTextElement,fl as isUsingAdaptiveRadius,gl as isUsingProportionalRadius,lx as isValidPolygon,qx as isValidTextContainer,ig as loadHTMLImageElement,Ra as makeNextSelectedElementIds,xt as maxBindingDistance_simple,$v as maybeHandleArrowPointlikeDrag,o5 as maybeParseEmbedSrc,fs as measureFontSizeFromWidth,ot as measureText,Bw as moveAllLeft,Dw as moveAllRight,Xo as moveArrowAboveBindable,Lw as moveOneLeft,Cw as moveOneRight,Te as mutateElement,Er as newArrowElement,qn as newElement,He as newElementWith,U4 as newEmbeddableElement,Zc as newFrameElement,$4 as newFreeDrawElement,Y4 as newIframeElement,Jc as newImageElement,Qc as newLinearElement,qc as newMagicFrameElement,Kn as newTextElement,j5 as normaliseElements,Jg as normalizeArrowhead,Ac as normalizeElementOrder,fn as normalizeFixedPoint,N5 as normalizeSVG,Ro as normalizeText,er as omitGroupsContainingFrameLikes,Jh as omitPartialGroups,Id as orderByFractionalIndex,Oo as originalContainerCache,O4 as parseElementLinkFromURL,I1 as parseTokens,wt as pointInsideBounds,d0 as pointInsideBoundsInclusive,$5 as positionElementsOnGrid,to as projectFixedPointOntoDiagonal,Oi as redrawTextBoundingBox,X4 as refreshTextDimensions,om as removeAllElementsFromFrame,Td as removeElementsFromFrame,ww as removeFromSelectedGroups,pb as renderElement,ub as renderSelectionElement,V3 as replaceAllElementsInFrame,gu as rescalePointsInElement,vl as resetOriginalContainerCache,Eg as resizeMultipleElements,mg as resizeSingleElement,ug as resizeSingleTextElement,wg as resizeTest,mm as selectGroup,Dd as selectGroupsForSelectedElements,Bd as selectGroupsFromGivenElements,Tx as setCustomTextMetricsProvider,$x as shouldAllowVerticalAlign,Y3 as shouldApplyFrameClip,Ri as shouldTestInside,Tv as showSelectedShapeActions,Aa as snapToMid,Zx as suppportsHorizontalAlign,Ca as syncInvalidIndices,Sd as syncInvalidIndicesImmutable,Yn as syncMovedIndices,Jd as toggleLinePolygonState,dy as toolIsArrow,sM as transformElements,Oe as unbindBindingElement,c3 as updateBindings,Re as updateBoundElements,Pt as updateBoundPoint,ro as updateElbowArrowPoints,U3 as updateFrameMembershipOfSelectedElements,R5 as updateImageCache,Sl as updateOriginalContainerCache,id as validateElbowPoints,Zh as validateFractionalIndices,en as vectorToHeading,Kt as wrapText};
28
+ `),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return It.set(e,m),m}return It.set(e,{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:o,sandbox:{allowSameOrigin:n}}},W4=e=>{let t;Mi(e)?t="IFrame element":t=!e.link||e?.link===""?"Empty Web-Embed":e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),o=Lf.Helvetica,i=Bf({fontSize:n,fontFamily:o});return qn({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:o,fontSize:n,text:Zt(t,i,e.width-20),textAlign:"center",verticalAlign:Cf.MIDDLE,angle:e.angle??0})},rs=(e,t)=>{try{let{hostname:n}=new URL(e),o=n.replace(/^www\./,"");if(t instanceof Set){if(is.has(o))return o;let r=o.replace(/^([^.]+)/,"*");return is.has(r)?r:null}let i=t.replace(/^www\./,"");if(o===i)return i}catch{}return null},_4=e=>{let t=e.match(Nf);if(t&&t.length===2)return t[1];let n=e.match(Wf);if(n&&n.length===2)return n[1];let o=e.match(Rf);if(o&&o.length===2)return o[1];if($c.test(e))return`https://giphy.com/embed/${$c.exec(e)[1]}`;let i=e.match(zf);return i&&i.length===2?i[1]:e},j4=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let n=t(e);if(typeof n=="boolean")return n}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if(rs(e,n))return!0;return!1}}return!!rs(e,is)};I();import{KEYS as hr,invariant as mr,toBrandedType as jf}from"@excalidraw/common";import{pointFrom as Qc}from"@excalidraw/math";var mo=100,Kn=100,o5=e=>{switch(e){case hr.ARROW_UP:return"up";case hr.ARROW_DOWN:return"down";case hr.ARROW_RIGHT:return"right";case hr.ARROW_LEFT:return"left";default:return"right"}},tu=(e,t,n,o)=>{let i=[...n.values()].reduce((r,a)=>{let s;if(Y(a)&&(s=a[e==="predecessors"?"startBinding":"endBinding"])&&a[e==="predecessors"?"endBinding":"startBinding"]?.elementId===t.id){let l=n.get(s.elementId);if(!l)return r;mr(Ee(l),"not an ExcalidrawBindableElement");let d=e==="predecessors"?a.points[a.points.length-1]:[0,0],c=No(t,ut(t,n),[d[0]+a.x,d[1]+a.y]);r.push({relative:l,heading:c})}return r},[]);switch(o){case"up":return i.filter(r=>we(r.heading,rt)).map(r=>r.relative);case"down":return i.filter(r=>we(r.heading,ke)).map(r=>r.relative);case"right":return i.filter(r=>we(r.heading,be)).map(r=>r.relative);case"left":return i.filter(r=>we(r.heading,Ze)).map(r=>r.relative)}},as=(e,t,n)=>tu("successors",e,t,n),ss=(e,t,n)=>tu("predecessors",e,t,n),Vf=(e,t,n)=>{let o=Kn+e.width;if(n==="up"||n==="down"){let s=mo+e.height,l=e.x,d=e.x+e.width;if(t.every(c=>c.x+c.width<l||c.x>d))return{x:0,y:s*(n==="up"?-1:1)}}else if(n==="right"||n==="left"){let s=e.y,l=e.y+e.height;if(t.every(d=>d.y+d.height<s||d.y>l))return{x:(Kn+e.width)*(n==="left"?-1:1),y:0}}if(n==="up"||n==="down"){let s=mo+e.height,l=(t.length===0,s),d=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*o:t.length/2*o*-1;return n==="up"?{x:d,y:l*-1}:{x:d,y:l}}let i=mo+e.height,r=(t.length===0,Kn+e.width),a=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return n==="left"?{x:r*-1,y:a}:{x:r,y:a}},Yf=(e,t,n,o)=>{let i=o.getNonDeletedElementsMap(),r=as(e,i,n),a=ss(e,i,n),s=Vf(e,[...r,...a],n),l=Zn({type:e.type,x:e.x+s.x,y:e.y+s.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});mr(Hr(l),"not an ExcalidrawFlowchartNodeElement");let d=nu(e,l,n,t,o);return{nextNode:l,bindingArrow:d}},Uf=(e,t,n,o,i)=>{let r=[];for(let a=0;a<i;a++){let s,l;if(n==="left"||n==="right"){let u=mo*(i-1)+i*e.height,h=e.y+e.height/2-u/2,m=Kn+e.width;n==="left"&&(m*=-1),s=e.x+m;let g=(mo+e.height)*a;l=h+g}else{let u=Kn*(i-1)+i*e.width,h=e.x+e.width/2-u/2,m=mo+e.height;n==="up"&&(m*=-1),l=e.y+m;let g=(Kn+e.width)*a;s=h+g}let d=Zn({type:e.type,x:s,y:l,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});mr(Hr(d),"not an ExcalidrawFlowchartNodeElement");let c=nu(e,d,n,t,o);r.push(d),r.push(c)}return r},nu=(e,t,n,o,i)=>{let r,a;switch(n){case"up":{r=e.x+e.width/2,a=e.y-6;break}case"down":{r=e.x+e.width/2,a=e.y+e.height+6;break}case"right":{r=e.x+e.width+6,a=e.y+e.height/2;break}case"left":{r=e.x-6,a=e.y+e.height/2;break}}let l,d;switch(n){case"up":{l=t.x+t.width/2-r,d=t.y+t.height-a+6;break}case"down":{l=t.x+t.width/2-r,d=t.y-a-6;break}case"right":{l=t.x-r-6,d=t.y-a+t.height/2;break}case"left":{l=t.x+t.width-r+6,d=t.y-a+t.height/2;break}}let c=pr({type:"arrow",x:r,y:a,startArrowhead:null,endArrowhead:o.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[Qc(0,0),Qc(l,d)],elbowed:!0}),u=i.getNonDeletedElementsMap();Rt(c,e,"orbit","start",i),Rt(c,t,"orbit","end",i);let h=new Map;h.set(e.id,e),h.set(t.id,t),h.set(c.id,c),D.movePoints(c,i,new Map([[1,{point:c.points[1]}]]));let m=io(c,jf(new Map([...u.entries(),[e.id,e],[t.id,t],[c.id,c]])),{points:c.points});return{...c,...m}},Jc=class{isExploring=!1;sameLevelNodes=[];sameLevelIndex=0;direction=null;visitedNodes=new Set;clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(t,n,o){if(!Ee(t))return null;if(o!==this.direction&&this.clear(),this.visitedNodes.has(t.id)||this.visitedNodes.add(t.id),this.isExploring&&o===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let i=[...as(t,n,o),...ss(t,n,o)];if(i.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=i,this.direction=o,this.visitedNodes.add(i[0].id),i[0].id;if(o===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(t.id);let a=["up","right","down","left"].filter(s=>s!==o).map(s=>[...as(t,n,s),...ss(t,n,s)]).flat().filter(s=>!this.visitedNodes.has(s.id));for(let s of a)if(!this.visitedNodes.has(s.id))return this.visitedNodes.add(s.id),this.isExploring=!0,this.direction=o,s.id}return null}},eu=class{isCreatingChart=!1;numberOfNodes=0;direction="right";pendingNodes=null;createNodes(t,n,o,i){let r=i.getNonDeletedElementsMap();if(o!==this.direction){let{nextNode:a,bindingArrow:s}=Yf(t,n,o,i);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=o,this.pendingNodes=[a,s]}else{this.numberOfNodes+=1;let a=Uf(t,n,o,i,this.numberOfNodes);this.isCreatingChart=!0,this.direction=o,this.pendingNodes=a}if(t.frameId){let a=r.get(t.frameId);mr(a&&Ii(a),"not an ExcalidrawFrameElement"),a&&this.pendingNodes.every(s=>vn([s],a,r)||In(s,a,r))&&(this.pendingNodes=this.pendingNodes.map(s=>Te(s,r,{frameId:t.frameId})))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},i5=(e,t)=>{for(let[,n]of t)if(n.type==="arrow"&&(n.startBinding?.elementId===e.id||n.endBinding?.elementId===e.id))return!0;return!1};I();import{pointDistance as fo,pointFrom as ls}from"@excalidraw/math";import{invariant as ou}from"@excalidraw/common";var fr=(e,t,n,o,i,r,a=!1)=>{if(Y(t)||!Ot(i)||t.points.length!==2)return!1;if(!a){let l=t.startBinding?.elementId===n.id?0:t.points.length-1,d=D.getPointAtIndexGlobalCoordinates(t,l,o);if(fo(e,d)<Vo*1.5/i.zoom.value)return!1}let s=D.getPointAtIndexGlobalCoordinates(t,r==="end"?t.points.length-1:0,o);return fo(e,s)>=Vo*1.5/i.zoom.value&&Lt({element:n,elementsMap:o,point:e,threshold:Ne(n,t),overrideShouldTestInside:!0})},Xf=(e,t,n,o,i,r,a)=>{let s=new Map,l=n?"startBinding":"endBinding",d=n?"endBinding":"startBinding",c=e[l],u=e[d];if(c&&t){let h=t&&u&&c.elementId===u.elementId;a||h?c={...c,mode:"inside"}:c={...c,mode:"orbit"};let m=n?0:e.points.length-1,g=bt(e,l,c,t,o,!0);g&&s.set(m,{point:g})}if(u&&u.mode==="orbit"){let h=o.get(u.elementId);if(h&&Ee(h)&&Ot(r)){let m=t&&u.elementId===t.id;a||m?u={...u,mode:"inside"}:u={...u,mode:"orbit"};let g=n?e.points.length-1:0,f=bt(e,d,u,h,o);f&&s.set(g,{point:f})}}s.size>0&&D.movePoints(e,i,s,{[l]:c,[d]:u})},iu=(e,t,n,o,i,r,a)=>{let s=D.getElement(e.elementId,t);if(!s||!Be(s)||Y(s)||!e.hoveredFocusPointBinding||!e.draggedFocusPointBinding)return;let l=e.draggedFocusPointBinding==="start",d=l?s.startBinding:s.endBinding,{x:c,y:u}=e.pointerOffset,h=ls(n.x-c,n.y-u),m=l?"startBinding":"endBinding",g=Vl(h,s,o.getNonDeletedElements(),t,Et(i.zoom));if(g&&Ot(i)){s[m]&&g.id!==d?.elementId&&Oe(s,e.draggedFocusPointBinding,o);let f=a&&s[m]?.mode==="orbit"?"inside":!a&&s[m]?.mode==="inside"?"orbit":null;(!s[m]||f)&&Rt(s,g,f||"orbit",e.draggedFocusPointBinding,o,h),o.mutateElement(s,{[m]:{...s[m],elementId:g.id,mode:f||s[m]?.mode||"orbit",...ro(s,g,e.draggedFocusPointBinding,t,h)}})}else{let f=new Map,E=l?0:s.points.length-1;f.set(E,{point:D.createPointAt(s,t,h[0],h[1],r)}),D.movePoints(s,o,f),s[m]&&Oe(s,l?"start":"end",o)}Xf(s,g,l,t,o,i,a),g&&Ot(i)&&Yo(h,s,o.getElementsIncludingDeleted(),t,o,g)},m5=(e,t,n,o)=>{let i=ls(t.origin.x,t.origin.y),r=Vo*1.5/o.zoom.value;if(e.startBinding?.elementId){let a=n.get(e.startBinding.elementId);if(a&&Ee(a)&&!a.isDeleted){let s=Ue(e.startBinding.fixedPoint,a,n);if(fr(s,e,a,n,o,"start")&&fo(i,s)<=r)return{hitFocusPoint:"start",pointerOffset:{x:i[0]-s[0],y:i[1]-s[1]}}}}if(e.endBinding?.elementId){let a=n.get(e.endBinding.elementId);if(a&&Ee(a)&&!a.isDeleted){let s=Ue(e.endBinding.fixedPoint,a,n);if(fr(s,e,a,n,o,"end")&&fo(i,s)<=r)return{hitFocusPoint:"end",pointerOffset:{x:i[0]-s[0],y:i[1]-s[1]}}}}return{hitFocusPoint:null,pointerOffset:{x:0,y:0}}},f5=(e,t)=>{ou(e.draggedFocusPointBinding,"Must have a dragged focus point at pointer release");let n=D.getElement(e.elementId,t.getNonDeletedElementsMap());ou(n,"Arrow must be in the scene");let o=e.draggedFocusPointBinding==="start"?"startBinding":"endBinding",i=e.draggedFocusPointBinding==="start"?"endBinding":"startBinding",r=n[o]?.elementId,a=n[i]?.elementId,s=r&&t.getNonDeletedElements().find(d=>d.id!==r&&d.id!==a&&Ee(d)&&d.boundElements?.find(({id:c})=>c===n.id));s&&t.mutateElement(s,{boundElements:s.boundElements?.filter(({id:d})=>d!==n.id)});let l=r&&t.getNonDeletedElementsMap().get(r);l&&t.mutateElement(l,{boundElements:[...(l.boundElements||[])?.filter(({id:d})=>d!==n.id),{id:n.id,type:"arrow"}]})},g5=(e,t,n,o,i)=>{let r=o.getNonDeletedElementsMap(),a=ls(t,n),s=Vo*1.5/i.zoom.value;if(e.startBinding?.elementId){let l=r.get(e.startBinding.elementId);if(l&&Ee(l)&&!l.isDeleted){let d=Ue(e.startBinding.fixedPoint,l,r);if(fr(d,e,l,r,i,"start")&&fo(a,d)<=s)return"start"}}if(e.endBinding?.elementId){let l=r.get(e.endBinding.elementId);if(l&&Ee(l)&&!l.isDeleted){let d=Ue(e.endBinding.fixedPoint,l,r);if(fr(d,e,l,r,i,"end")&&fo(a,d)<=s)return"end"}}return null};I();import{MIME_TYPES as ru,SVG_NS as $f}from"@excalidraw/common";var Zf=e=>new Promise((t,n)=>{let o=new Image;o.onload=()=>{t(o)},o.onerror=i=>{n(i)},o.src=e}),b5=async({fileIds:e,files:t,imageCache:n})=>{let o=new Map,i=new Map;return await Promise.all(e.reduce((r,a)=>{let s=t[a];return s&&!o.has(a)?(o.set(a,!0),r.concat((async()=>{try{if(s.mimeType===ru.binary)throw new Error("Only images can be added to ImageCache");let l=Zf(s.dataURL),d={image:l,mimeType:s.mimeType};n.set(a,d);let c=await l;n.set(a,{...d,image:c})}catch{i.set(a,!0)}})())):r},[])),{imageCache:n,updatedFiles:o,erroredFiles:i}},M5=e=>e.filter(t=>Hn(t)),qf=e=>e?.nodeName.toLowerCase()==="svg",P5=e=>{let t=new DOMParser().parseFromString(e,ru.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||!qf(n))throw new Error("Invalid SVG");{n.hasAttribute("xmlns")||n.setAttribute("xmlns",$f);let i=n.getAttribute("width"),r=n.getAttribute("height");(i?.includes("%")||i==="auto")&&(i=null),(r?.includes("%")||r==="auto")&&(r=null);let a=n.getAttribute("viewBox");if(!i||!r){if(i=i||"50",r=r||"50",a){let s=a.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);s&&([,i,r]=s)}n.setAttribute("width",i),n.setAttribute("height",r)}return a||n.setAttribute("viewBox",`0 0 ${i} ${r}`),n.outerHTML}};I();var Kf=e=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),au=(e,t)=>{switch(e){case"height":return t.height;case"width":return t.width;case"size":return t.width*t.height;case"scale":return(t.width+t.height)/2}},Qf=(e,t,n)=>n==="first"?au(e,t[0].boundingBox):t.reduce((i,r)=>i+au(e,r.boundingBox),0)/t.length,Jf=(e,t,n)=>{switch(e){case"height":return t/n.height;case"width":return t/n.width;case"size":return Math.sqrt(t/(n.width*n.height));case"scale":return t/((n.width+n.height)/2)}},k5=(e,t,n,o="average",i="size")=>{let a=Ki(t,n).map(d=>({group:d,boundingBox:Fe(d)}));if(a.length===0)return t;let s=Qf(i,a,o),l=[];return a.forEach(d=>{let c=Jf(i,s,d.boundingBox);if(!Number.isFinite(c)||c<=0)return;let u=Kf(d.boundingBox);d.group.forEach(h=>{let m={x:h.x+h.width/2,y:h.y+h.height/2},g={x:u.x+(m.x-u.x)*c,y:u.y+(m.y-u.y)*c},f=h.width*c,E=h.height*c;e.mutateElement(h,{x:g.x-f/2,y:g.y-E/2,width:f,height:E}),l.push(h)})}),l};I();var D5=(e,t,n,o=50)=>{if(!e||e.length===0)return[];let i=[],r=Array.isArray(e[0])?e:e.map(m=>[m]),a=r.length,s=Math.max(1,Math.ceil(Math.sqrt(a))),l=[];for(let m=0;m<a;m+=s)l.push(r.slice(m,m+s));let d=0,c=l.map(m=>{let g=0,f=0,E=m.map(x=>{let[y,w,M,b]=We(x);return{elements:x,bounds:[y,w,M,b],width:M-y,height:b-w}});return E.forEach((x,y)=>{g+=x.width,y<E.length-1&&(g+=o),x.height>f&&(f=x.height)}),d+=f,{unitBounds:E,width:g,maxHeight:f}}),u=d+Math.max(0,l.length-1)*o,h=n-u/2;return c.forEach(m=>{let{unitBounds:g,width:f,maxHeight:E}=m,x=t-f/2;g.forEach(y=>{let[w,M]=y.bounds,b=x-w,S=h-M;y.elements.forEach(v=>{i.push(He(v,{x:v.x+b,y:v.y+S}))}),x+=y.width+o}),h+=E+o}),i};I();import{pointCenter as eg,normalizeRadians as Er,pointFrom as ce,pointRotateRads as St}from"@excalidraw/math";import{MIN_FONT_SIZE as cs,SHIFT_LOCKING_ANGLE as xr,rescalePoints as su,getFontString as gr}from"@excalidraw/common";var U5=(e,t,n,o,i,r,a,s,l,d,c)=>{let u=o.getNonDeletedElementsMap();if(n.length===1){let[h]=n;if(t==="rotation")Y(h)||(tg(h,o,s,l,i),Re(h,o));else if(t){let m=n[0].id,g=u.get(m),f=e.get(m);if(g&&f){let{nextWidth:E,nextHeight:x}=ag(g,f,t,s,l,{shouldMaintainAspectRatio:a,shouldResizeFromCenter:r});rg(E,x,g,f,e,o,t,{shouldMaintainAspectRatio:a,shouldResizeFromCenter:r})}}return te(h)&&Re(h,o),!0}else if(n.length>1){if(t==="rotation")return og(e,n,o,s,l,i,d,c),!0;if(t){let{nextWidth:h,nextHeight:m,flipByX:g,flipByY:f,originalBoundingBox:E}=sg(n,e,u,t,s,l,{shouldMaintainAspectRatio:a,shouldResizeFromCenter:r});return lg(n,u,t,o,e,{shouldResizeFromCenter:r,shouldMaintainAspectRatio:a,flipByX:g,flipByY:f,nextWidth:h,nextHeight:m,originalBoundingBox:E}),!0}}return!1},tg=(e,t,n,o,i)=>{let[r,a,s,l]=K(e,t.getNonDeletedElementsMap()),d=(r+s)/2,c=(a+l)/2,u;ee(e)?u=0:(u=5*Math.PI/2+Math.atan2(o-c,n-d),i&&(u=u+xr/2,u=u-u%xr),u=Er(u));let h=qt(e),m={angle:u};if(Be(e)&&(m={...m},e.startBinding&&Oe(e,"start",t),e.endBinding&&Oe(e,"end",t)),t.mutateElement(e,m),h){let g=t.getElement(h);if(g&&!j(e)){let{x:f,y:E}=Oo(e,g,t.getNonDeletedElementsMap());t.mutateElement(g,{angle:u,x:f,y:E})}}},lu=(e,t,n,o)=>ne(e)||Se(e)?{points:su(0,t,su(1,n,e.points,o),o)}:{},us=(e,t,n)=>{let o=e.width;if(xe(e)){let a=De(e,t);a&&(o=xt(a,e))}let r=e.fontSize*(n/o);return r<cs?null:{size:r}},ng=(e,t,n,o,i,r,a)=>{let s=n.getNonDeletedElementsMap(),l=t.width*(a/t.height),d=us(t,s,l);if(d!==null){if(o.includes("n")||o.includes("s")){let c=ce(e.x,e.y),u=ds(c,e.width,e.height,l,a,e.angle,o,!1,i);n.mutateElement(t,{fontSize:d.size,width:l,height:a,x:u.x,y:u.y});return}if(o==="e"||o==="w"){let c=ki(gr({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),u=Math.max(c,r),h=Zt(t.originalText,gr(t),Math.abs(u)),m=ot(h,gr(t),t.lineHeight),g=m.height,f=ce(e.x,e.y),E=ds(f,e.width,e.height,u,g,t.angle,o,!1,i),x={width:Math.abs(u),height:Math.abs(m.height),x:E.x,y:E.y,text:h,autoResize:!1};n.mutateElement(t,x)}}},og=(e,t,n,o,i,r,a,s)=>{let l=n.getNonDeletedElementsMap(),d=5*Math.PI/2+Math.atan2(i-s,o-a);r&&(d+=xr/2,d-=d%xr);let c=new Map(t.map(u=>[u.id,u]));for(let u of t)if(!ee(u)){let[h,m,g,f]=K(u,l),E=(h+g)/2,x=(m+f)/2,y=e.get(u.id)?.angle??u.angle,[w,M]=St(ce(E,x),ce(a,s),d+y-u.angle),b=Y(u)?{points:md(u,l)}:{x:u.x+(w-E),y:u.y+(M-x),angle:Er(d+y)};n.mutateElement(u,b),Re(u,n,{simultaneouslyUpdated:t}),Be(u)&&(u.startBinding&&(c.has(u.startBinding.elementId)||Oe(u,"start",n)),u.endBinding&&(c.has(u.endBinding.elementId)||Oe(u,"end",n)));let S=Q(u,l);if(S&&!j(u)){let{x:v,y:k}=Oo(u,S,l);n.mutateElement(S,{x:v,y:k,angle:Er(d+y)})}}n.triggerUpdate()},X5=(e,t,n,o,i)=>{let[r,a,s,l]=t.length===1?K(t[0],n):We(t),d=(r+s)/2,c=(a+l)/2,u=t.length===1?t[0].angle:0;switch([o,i]=St(ce(o,i),ce(d,c),-u),e){case"n":return St(ce(o-(r+s)/2,i-a),ce(0,0),u);case"s":return St(ce(o-(r+s)/2,i-l),ce(0,0),u);case"w":return St(ce(o-r,i-(a+l)/2),ce(0,0),u);case"e":return St(ce(o-s,i-(a+l)/2),ce(0,0),u);case"nw":return St(ce(o-r,i-a),ce(0,0),u);case"ne":return St(ce(o-s,i-a),ce(0,0),u);case"sw":return St(ce(o-r,i-l),ce(0,0),u);case"se":return St(ce(o-s,i-l),ce(0,0),u);default:return[0,0]}},$5=(e,t)=>{let[,[n,o]]=t.points;return e==="nw"&&(n<0||o<0)||e==="ne"&&n>=0||e==="sw"&&n<=0||e==="se"&&(n>0||o>0)?"end":"origin"},ig=(e,t,n)=>{if(n)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},ds=(e,t,n,o,i,r,a,s,l)=>{let d=ig(a,s,l),[c,u]=e;switch(d){case"top-left":return{x:c+(t-o)/2+(o-t)/2*Math.cos(r)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(o-t)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"top-right":return{x:c+(t-o)/2*(Math.cos(r)+1)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(t-o)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"bottom-left":return{x:c+(t-o)/2*(1-Math.cos(r))+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(o-t)/2*Math.sin(r)};case"bottom-right":return{x:c+(t-o)/2*(Math.cos(r)+1)+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(t-o)/2*Math.sin(r)};case"center":return{x:c-(o-t)/2,y:u-(i-n)/2};case"east-side":return{x:c+(t-o)/2*(Math.cos(r)+1),y:u+(t-o)/2*Math.sin(r)+(n-i)/2};case"west-side":return{x:c+(t-o)/2*(1-Math.cos(r)),y:u+(o-t)/2*Math.sin(r)+(n-i)/2};case"north-side":return{x:c+(t-o)/2+(n-i)/2*Math.sin(r),y:u+(i-n)/2*(Math.cos(r)-1)};case"south-side":return{x:c+(t-o)/2+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)}}},rg=(e,t,n,o,i,r,a,{shouldInformMutation:s=!0,shouldMaintainAspectRatio:l=!1,shouldResizeFromCenter:d=!1}={})=>{if(te(n)&&te(o))return ng(o,n,r,a,d,e,t);let c={},u=r.getNonDeletedElementsMap(),h=Q(n,u);if(h){let E=i.get(h.id);if(E&&(c={fontSize:E.fontSize}),l){let x={...n,width:e,height:t},y=us(h,u,xt(x,h));if(y===null)return;c={fontSize:y.size}}else{let x=Sl(gr(h),h.lineHeight),y=vl(h.fontSize,h.lineHeight);e=Math.max(e,x),t=Math.max(t,y)}}let m=lu(o,e,t,!0),g=ce(o.x,o.y);if(ne(o)){let[E,x]=ue(o,i);g=ce(E,x)}let f=ds(g,o.width,o.height,e,t,o.angle,a,l,d);if(ne(o)&&m.points){let E=o.x-g[0],x=o.y-g[1];f.x+=E,f.y+=x;let y=m.points[0][0],w=m.points[0][1];f.x+=y,f.y+=w,m.points=m.points.map(M=>ce(M[0]-y,M[1]-w))}if(e<0&&(f.x=f.x+e),t<0&&(f.y=f.y+t),"scale"in n&&"scale"in o&&r.mutateElement(n,{scale:[(Math.sign(e)||o.scale[0])*o.scale[0],(Math.sign(t)||o.scale[1])*o.scale[1]]}),j(n)&&h&&l){let E=e/n.width*h.fontSize;if(E<cs)return;c.fontSize=E}if(e!==0&&t!==0&&Number.isFinite(f.x)&&Number.isFinite(f.y)){let E={...f,width:Math.abs(e),height:Math.abs(t),...m};Be(n)&&(n.startBinding&&(E={...E},n.startBinding&&Oe(n,"start",r)),n.endBinding&&(E={...E,endBinding:null})),r.mutateElement(n,E,{informMutation:s,isDragging:!1}),h&&c!=null&&r.mutateElement(h,{fontSize:c.fontSize}),jn(n,r,a,l),Re(n,r)}},ag=(e,t,n,o,i,{shouldMaintainAspectRatio:r=!1,shouldResizeFromCenter:a=!1}={})=>{let[s,l,d,c]=un(t,t.width,t.height,!0),u=ce(s,l),h=ce(d,c),m=eg(u,h),g=St(ce(o,i),m,-t.angle),[f,E,x,y]=un(e,e.width,e.height,!0),w=x-f,M=y-E,b=h[0]-u[0],S=h[1]-u[1],v=b/w,k=S/M;n.includes("e")&&(v=(g[0]-u[0])/w),n.includes("s")&&(k=(g[1]-u[1])/M),n.includes("w")&&(v=(h[0]-g[0])/w),n.includes("n")&&(k=(h[1]-g[1])/M);let T=e.width*v,R=e.height*k;if(a&&(T=2*T-t.width,R=2*R-t.height),r){let O=Math.abs(T)/t.width,N=Math.abs(R)/t.height;if(n.length===1&&(R*=O,T*=N),n.length===2){let G=Math.max(O,N);T=t.width*G*Math.sign(T),R=t.height*G*Math.sign(R)}}return{nextWidth:T,nextHeight:R}},sg=(e,t,n,o,i,r,{shouldMaintainAspectRatio:a=!1,shouldResizeFromCenter:s=!1}={})=>{let l=e.map(G=>t.get(G.id)),d=l.reduce((G,q)=>{if(!ne(q))return G;let U=qt(q);if(!U)return G;let le=t.get(U)??null;return xe(le)?[...G,{...le,...D.getBoundTextElementPosition(q,le,n)}]:G},[]),c=Fe(l.map(G=>G).concat(d)),{minX:u,minY:h,maxX:m,maxY:g,midX:f,midY:E}=c,x=m-u,y=g-h,w={ne:[u,g],se:[u,h],sw:[m,h],nw:[m,g],e:[u,h+y/2],w:[m,h+y/2],n:[u+x/2,g],s:[u+x/2,h]},[M,b]=s?[f,E]:w[o],S=s?2:1,v=Math.max(Math.abs(i-M)/x||0,Math.abs(r-b)/y||0)*S,k=o.includes("e")||o.includes("w")?Math.abs(i-M)*S:x,T=o.includes("n")||o.includes("s")?Math.abs(r-b)*S:y;a&&(k=x*v*Math.sign(i-M),T=y*v*Math.sign(r-b));let R={ne:[i<M,r>b],se:[i<M,r<b],sw:[i>M,r<b],nw:[i>M,r>b],e:[i<M,!1],w:[i>M,!1],n:[!1,r>b],s:[!1,r<b]},[O,N]=R[o].map(G=>G);return{originalBoundingBox:c,nextWidth:k,nextHeight:T,flipByX:O,flipByY:N}},lg=(e,t,n,o,i,{shouldMaintainAspectRatio:r=!1,shouldResizeFromCenter:a=!1,flipByX:s=!1,flipByY:l=!1,nextHeight:d,nextWidth:c,originalBoundingBox:u}={})=>{if(c===void 0&&d===void 0&&s===void 0&&l===void 0||d===0||c===0)return;i||(i=t);let h=e.reduce((S,v)=>{let k=i.get(v.id);return k&&S.push({orig:k,latest:v}),S},[]),m;if(u)m=u;else{let S=h.reduce((v,{orig:k})=>{if(!ne(k))return v;let T=qt(k);if(!T)return v;let R=i.get(T)??null;return xe(R)?[...v,{...R,...D.getBoundTextElementPosition(k,R,t)}]:v},[]);m=Fe(h.map(({orig:v})=>v).concat(S))}let{minX:g,minY:f,maxX:E,maxY:x,midX:y,midY:w}=m,M=E-g,b=x-f;if(c===void 0&&d===void 0&&(c=M,d=b),r&&(c===void 0?c=d*(M/b):d===void 0?d=c*(b/M):Math.abs(c/d-M/b)>.001&&(c=d*(M/b))),c&&d){let S=n.includes("e")||n.includes("w")?Math.abs(c)/M:1,v=n.includes("n")||n.includes("s")?Math.abs(d)/b:1,k;n.length===1?k=n.includes("e")||n.includes("w")?S:v:k=Math.max(Math.abs(c)/M||0,Math.abs(d)/b||0);let T={ne:[g,x],se:[g,f],sw:[E,f],nw:[E,x],e:[g,f+b/2],w:[E,f+b/2],n:[g+M/2,x],s:[g+M/2,f]},[R,O]=a?[y,w]:T[n],N=r||h.some(A=>A.latest.angle!==0||te(A.latest)||Ld(A.latest));N&&(S=k,v=k);let[G,q]=[s?-1:1,l?-1:1],U=[];for(let{orig:A,latest:_}of h){if(te(A)&&xe(A))continue;let X=A.width*S,ve=A.height*v,At=Er(A.angle*G*q),ei=ne(A)||Se(A),Sr=A.x-R,ti=A.y-O,xo=s&&!ei?X:0,vr=l&&!ei?ve:0,ni=R+G*(Sr*S+xo),oi=O+q*(ti*v+vr),et=lu(A,X*G,ve*q,!1),st={x:ni,y:oi,width:X,height:ve,angle:At,...et};if(Y(A)&&(A.startBinding&&(st.startBinding={...A.startBinding,fixedPoint:[s?-A.startBinding.fixedPoint[0]+1:A.startBinding.fixedPoint[0],l?-A.startBinding.fixedPoint[1]+1:A.startBinding.fixedPoint[1]]}),A.endBinding&&(st.endBinding={...A.endBinding,fixedPoint:[s?-A.endBinding.fixedPoint[0]+1:A.endBinding.fixedPoint[0],l?-A.endBinding.fixedPoint[1]+1:A.endBinding.fixedPoint[1]]}),A.fixedSegments&&et.points&&(st.fixedSegments=A.fixedSegments.map(Nt=>({...Nt,start:et.points[Nt.index-1],end:et.points[Nt.index]})))),Ae(A)&&(st.scale=[A.scale[0]*G,A.scale[1]*q]),te(A)){let Nt=us(A,t,X);if(!Nt)return;st.fontSize=Nt.size}let sn=i.get(qt(A)??"");if(sn)if(N){let Nt=sn.fontSize*k;if(Nt<cs)return;st.boundTextFontSize=Nt}else st.boundTextFontSize=sn.fontSize;U.push({element:_,update:st})}let le=U.map(({element:A})=>A),H=new Map(U.map(({element:A})=>[A.id,A]));for(let{element:A,update:{boundTextFontSize:_,...X}}of U){let{angle:ve}=X;o.mutateElement(A,X),Re(A,o,{simultaneouslyUpdated:le}),Be(A)&&(A.startBinding&&(H.has(A.startBinding.elementId)||Oe(A,"start",o)),A.endBinding&&(H.has(A.endBinding.elementId)||Oe(A,"end",o)));let At=Q(A,t);At&&_&&(o.mutateElement(At,{fontSize:_,angle:ne(A)?void 0:ve}),jn(A,o,n,!0))}o.triggerUpdate()}};I();import{pointFrom as pt,pointOnLineSegment as mu,pointRotateRads as wr}from"@excalidraw/math";import{SIDE_RESIZING_THRESHOLD as Es}from"@excalidraw/common";I();import{DEFAULT_TRANSFORM_HANDLE_SPACING as hs}from"@excalidraw/common";import{pointFrom as du,pointRotateRads as dg}from"@excalidraw/math";var cu={mouse:8,pen:16,touch:28},cg=16,pu={e:!0,s:!0,n:!0,w:!0},tM={e:!0,s:!0,n:!0,w:!0},nM={e:!0,s:!0,n:!0,w:!0,rotation:!0},uu={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},ps={e:!0,s:!0,n:!0,w:!0},an=(e,t,n,o,i,r,a)=>{let[s,l]=dg(du(e+n/2,t+o/2),du(i,r),a);return[s-n/2,l-o/2,n,o]},yr=e=>!(e.formFactor==="phone"&&e.userAgent.isMobileDevice),ms=e=>yr(e)?pu:{},fs=([e,t,n,o,i,r],a,s,l,d={},c=4,u=hs)=>{let h=cu[l],m=h/s.value,g=h/s.value,f=h/s.value,E=h/s.value,x=n-e,y=o-t,w=c/s.value,M=(h-u*2)/(2*s.value),b={nw:d.nw?void 0:an(e-w-f+M,t-w-E+M,m,g,i,r,a),ne:d.ne?void 0:an(n+w-M,t-w-E+M,m,g,i,r,a),sw:d.sw?void 0:an(e-w-f+M,o+w-M,m,g,i,r,a),se:d.se?void 0:an(n+w-M,o+w-M,m,g,i,r,a),rotation:d.rotation?void 0:an(e+x/2-m/2,t-w-E+M-cg/s.value,m,g,i,r,a)},S=5*cu.mouse/s.value;return Math.abs(x)>S&&(d.n||(b.n=an(e+x/2-m/2,t-w-E+M,m,g,i,r,a)),d.s||(b.s=an(e+x/2-m/2,o+w-M,m,g,i,r,a))),Math.abs(y)>S&&(d.w||(b.w=an(e-w-f+M,t+y/2-g/2,m,g,i,r,a)),d.e||(b.e=an(n+w-M,t+y/2-g/2,m,g,i,r,a))),b},hu=(e,t,n,o="mouse",i=pu)=>{if(e.locked||Y(e))return{};if(e.type==="freedraw"||ne(e)){if(e.points.length===2){let[,a]=e.points;a[0]===0||a[1]===0?i=ps:a[0]>0&&a[1]<0?i=uu:a[0]>0&&a[1]>0?i=ps:a[0]<0&&a[1]>0?i=uu:a[0]<0&&a[1]<0&&(i=ps)}}else ee(e)&&(i={...i,rotation:!0});let r=ne(e)?hs+8:Ae(e)?0:hs;return fs(K(e,n,!0),e.angle,t,o,i,r,Ae(e)?0:void 0)},oM=(e,t,n)=>{if(t.selectedLinearElement?.isEditing||t.selectedLinearElement?.isDragging)return!1;if(e.length>1)return!0;let o=e[0];return Y(o)?!1:ne(o)?o.points.length>2&&!n.userAgent.isMobileDevice:!0};var xs=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],ug=(e,t,n,o,i,r,a,s)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:l,...d}=hu(e,r,t,a,ms(s));if(l&&xs(l,o,i))return"rotation";let c=Object.keys(d).filter(u=>{let h=d[u];return h?xs(h,o,i):!1});if(c.length>0)return c[0];if(yr(s)){let[u,h,m,g,f,E]=K(e,t);if(!(ne(e)&&e.points.length<=2)){let x=Ae(e)?0:Es/r.value,y=Es/r.value,w=fu(pt(u-x,h-x),pt(m+x,g+x),pt(f,E),e.angle);for(let[M,b]of Object.entries(w))if(mu(pt(o,i),b,y))return M}}return!1},uM=(e,t,n,o,i,r,a,s)=>e.reduce((l,d)=>{if(l)return l;let c=ug(d,a,t,n,o,i,r,s);return c?{element:d,transformHandleType:c}:null},null),pM=([e,t,n,o],i,r,a,s,l)=>{let d=fs([e,t,n,o,(e+n)/2,(t+o)/2],0,a,s,ms(l)),c=Object.keys(d).find(u=>{let h=d[u];return h&&xs(h,i,r)});if(c)return c;if(yr(l)){let u=(e+n)/2,h=(t+o)/2,m=Es/a.value,g=fu(pt(e-m,t-m),pt(n+m,o+m),pt(u,h),0);for(let[f,E]of Object.entries(g))if(mu(pt(i,r),E,m))return f}return!1},gs=["ns","nesw","ew","nwse"],pg=(e,t)=>{let n=gs.indexOf(e);if(n>=0){let o=Math.round(t/(Math.PI/4));e=gs[(n+o)%gs.length]}return e},hM=e=>{let{element:t,transformHandleType:n}=e,o=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":o?i="nesw":i="nwse";break;case"ne":case"sw":o?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=pg(i,t.angle)),i?`${i}-resize`:""},fu=([e,t],[n,o],i,r)=>{let a=wr(pt(e,t),i,r),s=wr(pt(n,t),i,r),l=wr(pt(e,o),i,r),d=wr(pt(n,o),i,r);return{n:[a,s],e:[s,d],s:[d,l],w:[l,a]}};I();import{KEYS as ht}from"@excalidraw/common";I();I();function gu(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=gu(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Eu(){for(var e=0,t,n,o="";e<arguments.length;)(t=arguments[e++])&&(n=gu(t))&&(o&&(o+=" "),o+=n);return o}var Me=ii(Cu(),1),p=ii(Ss(),1);import{THEME as Lg}from"@excalidraw/common";var vt=e=>"var(--icon-fill-color)",Ou=e=>e===Lg.LIGHT?"#fff":"#1e1e1e",P=(e,t=512)=>{let{width:n=512,height:o=n,mirror:i,style:r,...a}=typeof t=="number"?{width:t}:t;return(0,p.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${o}`,className:Eu({"rtl-mirror":i}),style:r,...a,children:typeof e=="string"?(0,p.jsx)("path",{fill:"currentColor",d:e}):e})},L={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},V={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Ve={width:40,height:20},kM=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("rect",{x:3,y:8,width:18,height:4,rx:1}),(0,p.jsx)("line",{x1:12,y1:8,x2:12,y2:21}),(0,p.jsx)("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),(0,p.jsx)("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),L),TM=P((0,p.jsxs)("svg",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,p.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),L),LM=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,p.jsx)("circle",{cx:"12",cy:"19",r:"1"}),(0,p.jsx)("circle",{cx:"12",cy:"5",r:"1"})]}),L),CM=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,p.jsx)("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,p.jsx)("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),L),BM=P((0,p.jsxs)("svg",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),(0,p.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),(0,p.jsx)("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),L),DM=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M6.5 9.5l3.5 -3"}),(0,p.jsx)("path",{d:"M14 5.5l3 1.5"}),(0,p.jsx)("path",{d:"M18.5 10l-2.5 7"}),(0,p.jsx)("path",{d:"M13.5 17.5l-7 -5"})]}),L),GM=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:(0,p.jsx)("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),(0,p.jsx)("g",{mask:"url(#UnlockedIcon)",children:(0,p.jsx)("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),V),OM=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),(0,p.jsx)("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),(0,p.jsx)("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),V),RM=P((0,p.jsx)("g",{fill:"currentColor",children:(0,p.jsx)("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3"})}),{width:24,height:24}),FM=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),(0,p.jsx)("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),NM=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),(0,p.jsx)("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),HM=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),(0,p.jsx)("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"}),zM=P((0,p.jsx)("g",{fill:"currentColor",children:(0,p.jsx)("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"}),vs=P((0,p.jsxs)("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),(0,p.jsx)("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),WM=P((0,p.jsxs)("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[(0,p.jsx)("path",{d:"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255"}),(0,p.jsx)("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Ru=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),L),Fu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),L),Nu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"9"})]}),L),Hu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,p.jsx)("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),(0,p.jsx)("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),L),zu=P((0,p.jsx)("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),V),_M=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),(0,p.jsx)("path",{d:"M16 7h4"}),(0,p.jsx)("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),L),Wu=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),(0,p.jsx)("path",{d:"m11.25 5.417 3.333 3.333"})]}),V),_u=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),(0,p.jsx)("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),(0,p.jsx)("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),(0,p.jsx)("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),(0,p.jsx)("polyline",{points:"5 20 11 4 13 4 20 20"})]}),L),jM=P((0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 7v-2h13v2"}),(0,p.jsx)("path",{d:"M10 5v14"}),(0,p.jsx)("path",{d:"M12 19h-4"}),(0,p.jsx)("path",{d:"M15 13v-1h6v1"}),(0,p.jsx)("path",{d:"M18 12v7"}),(0,p.jsx)("path",{d:"M17 19h2"})]}),L),ju=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M12.5 6.667h.01"}),(0,p.jsx)("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),(0,p.jsx)("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),(0,p.jsx)("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),V),Vu=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),(0,p.jsx)("path",{d:"M18 13.3l-6.3 -6.3"})]}),L),VM=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),V),YM=P((0,p.jsx)("path",{d:"M5 10h10",strokeWidth:"1.25"}),V),UM=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M21 21l-6 -6"}),(0,p.jsx)("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),(0,p.jsx)("path",{d:"M3 4v4h4"})]}),L),XM=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),V),$M=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("polyline",{points:"12 16 18 10 12 4"}),(0,p.jsx)("polyline",{points:"8 4 2 10 8 16"})]}),V),ZM=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),(0,p.jsx)("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),V),qM=P((0,p.jsx)("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),V),KM=P((0,p.jsx)("g",{stroke:"currentColor",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...V,strokeWidth:1.5}),QM=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),(0,p.jsx)("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),(0,p.jsx)("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),L),JM=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),V),eP=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,p.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),(0,p.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),L),tP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,p.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),(0,p.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),L),nP=P((0,p.jsx)("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),V),oP=P((0,p.jsx)("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),V),iP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),(0,p.jsx)("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),V),rP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),(0,p.jsx)("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),L),aP=P((0,p.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),sP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),(0,p.jsx)("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),V),lP=P("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),dP=P("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),cP=P((0,p.jsx)("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),V),uP=P("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512}),pP=P("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),hP=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),(0,p.jsx)("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),(0,p.jsx)("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),L),mP=P((0,p.jsx)("g",{strokeWidth:1.5,children:(0,p.jsx)("path",{d:"M6 18l12 -12"})}),L),fP=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15 8h.01"}),(0,p.jsx)("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),(0,p.jsx)("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),(0,p.jsx)("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),(0,p.jsx)("path",{d:"M19 16v6"}),(0,p.jsx)("path",{d:"M22 19l-3 3l-3 -3"})]}),L),gP=P("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512}),EP=P("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),xP=P("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),yP=P("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),wP=P("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),bP=P((0,p.jsx)("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),V),MP=P((0,p.jsx)("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),V),PP=P("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),IP=P((0,p.jsx)("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),V),SP=P("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"),vP=P("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24}),AP=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),(0,p.jsx)("path",{d:"M12 14v-11"}),(0,p.jsx)("path",{d:"M9 6l3 -3l3 3"})]}),L),kP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),(0,p.jsx)("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64}),TP=P((0,p.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),Yu=(0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 10l0 10"}),(0,p.jsx)("path",{d:"M12 10l4 4"}),(0,p.jsx)("path",{d:"M12 10l-4 4"}),(0,p.jsx)("path",{d:"M4 4l16 0"})]}),Uu=(0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 5l0 14"}),(0,p.jsx)("path",{d:"M16 9l-4 -4"}),(0,p.jsx)("path",{d:"M8 9l4 -4"})]}),LP=P(Uu,L),CP=P(Uu,{...L,style:{transform:"rotate(180deg)"}}),BP=P(Yu,L),DP=P(Yu,{...L,style:{transform:"rotate(180deg)"}}),GP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),OP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),RP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),FP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),NP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),HP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),zP=P((0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),V),WP=P((0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),V),_P=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,p.jsx)("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),(0,p.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),(0,p.jsx)("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),L),jP=P("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),VP=P("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),YP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M15 5 5 15M5 5l10 10"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),UP=P("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0}),XP=P("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),$P=P("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512}),ZP=Me.default.memo(({theme:e})=>P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M25 26H111V111H25",fill:vt(e)}),(0,p.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:vt(e),strokeWidth:"2"}),(0,p.jsx)("path",{d:"M100 100H160V160H100",fill:vt(e)}),(0,p.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:vt(e),strokeWidth:"2"}),(0,p.jsxs)("g",{fill:Ou(e),stroke:vt(e),strokeWidth:"6",children:[(0,p.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),qP=Me.default.memo(({theme:e})=>P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M25 26H111V111H25",fill:vt(e)}),(0,p.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:vt(e),strokeWidth:"2"}),(0,p.jsx)("path",{d:"M100 100H160V160H100",fill:vt(e)}),(0,p.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:vt(e),strokeWidth:"2"}),(0,p.jsxs)("g",{fill:Ou(e),stroke:vt(e),strokeWidth:"6",children:[(0,p.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,p.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),KP=P((0,p.jsx)("g",{strokeWidth:1.25,children:(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),V),QP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),(0,p.jsx)("g",{mask:"url(#FillHachureIcon)",children:(0,p.jsx)("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),V),JP=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("g",{clipPath:"url(#a)",children:[(0,p.jsx)("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),(0,p.jsx)("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:(0,p.jsx)("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("g",{mask:"url(#FillCrossHatchIcon)",children:(0,p.jsx)("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),eI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...V,fill:"currentColor"}),tI=P((0,p.jsx)(p.Fragment,{children:(0,p.jsx)("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),V),nI=P((0,p.jsx)("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),V),oI=P((0,p.jsx)("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),V),iI=Me.default.memo(({theme:e})=>P((0,p.jsx)("path",{d:"M6 10H34",stroke:vt(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),rI=P((0,p.jsxs)("g",{strokeWidth:"2",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 12h2"}),(0,p.jsx)("path",{d:"M17 12h2"}),(0,p.jsx)("path",{d:"M11 12h2"})]}),L),aI=P((0,p.jsxs)("g",{strokeWidth:"2",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 12v.01"}),(0,p.jsx)("path",{d:"M8 12v.01"}),(0,p.jsx)("path",{d:"M12 12v.01"}),(0,p.jsx)("path",{d:"M16 12v.01"}),(0,p.jsx)("path",{d:"M20 12v.01"})]}),L),sI=P((0,p.jsx)("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),V),lI=P((0,p.jsx)("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),V),dI=P((0,p.jsx)("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),V),cI=P((0,p.jsxs)("svg",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),(0,p.jsx)("path",{d:"M13.3333 3.33331V3.34331"}),(0,p.jsx)("path",{d:"M16.6667 3.33331V3.34331"}),(0,p.jsx)("path",{d:"M16.6667 6.66669V6.67669"}),(0,p.jsx)("path",{d:"M16.6667 10V10.01"}),(0,p.jsx)("path",{d:"M3.33334 13.3333V13.3433"}),(0,p.jsx)("path",{d:"M16.6667 13.3333V13.3433"}),(0,p.jsx)("path",{d:"M3.33334 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M6.66666 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M10 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M13.3333 16.6667V16.6767"}),(0,p.jsx)("path",{d:"M16.6667 16.6667V16.6767"})]}),V),uI=P((0,p.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),(0,p.jsx)("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),(0,p.jsx)("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),(0,p.jsx)("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),(0,p.jsx)("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),(0,p.jsx)("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),(0,p.jsx)("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),(0,p.jsx)("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),(0,p.jsx)("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),(0,p.jsx)("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),(0,p.jsx)("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),(0,p.jsx)("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),L),pI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,fill:"none",strokeLinecap:"round",children:[(0,p.jsx)("path",{d:"M7,11 H19"}),(0,p.jsx)("path",{d:"M25,6 L33,16 M33,6 L25,16"})]}),Ve)),hI=Me.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M7,11 H33 M23,5 L33,11 L23,17"})}),Ve)),mI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",children:[(0,p.jsx)("path",{d:"M7,11 H23",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{d:"M23,5 L35,11 L23,17 Z"})]}),Ve)),fI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",children:[(0,p.jsx)("path",{d:"M7,11 H23"}),(0,p.jsx)("path",{d:"M23,5 L35,11 L23,17 Z"})]}),Ve)),gI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[(0,p.jsx)("path",{d:"M7,11 H25",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("circle",{cx:"29",cy:"11",r:"4"})]}),Ve)),EI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[(0,p.jsx)("path",{d:"M7,11 H25",strokeLinecap:"round"}),(0,p.jsx)("circle",{cx:"29",cy:"11",r:"4"})]}),Ve)),xI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",children:[(0,p.jsx)("path",{d:"M7,11 H21",strokeWidth:2,strokeLinecap:"round"}),(0,p.jsx)("path",{d:"M21,11 L28,5 L35,11 L28,17 Z"})]}),Ve)),yI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,strokeLinecap:"round",children:[(0,p.jsx)("path",{d:"M7,11 H21"}),(0,p.jsx)("path",{d:"M21,11 L28,5 L35,11 L28,17 Z"})]}),Ve)),wI=Me.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",strokeLinecap:"round",children:(0,p.jsx)("path",{d:"M11,11 H31 M31,5 V17"})}),Ve)),bI=Me.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M15,5 V17"})}),Ve)),MI=Me.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M15,11 L7,5 M15,11 L7,17"})}),Ve)),PI=Me.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M23,5 V17 M15,11 L7,5 M15,11 L7,17"})}),Ve)),II=Me.default.memo(({flip:e=!1})=>P((0,p.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,p.jsx)("path",{d:"M35,11 H7 M15,5 V17 M7,5 V17"})}),Ve)),SI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:[(0,p.jsx)("path",{d:"M35,11 H19 M11,11 H7 M7,5 V17"}),(0,p.jsx)("circle",{cx:"15",cy:"11",r:"4"})]}),Ve)),vI=Me.default.memo(({flip:e=!1})=>P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:[(0,p.jsx)("path",{d:"M35,11 H27 M19,11 H7 M15,11 L7,5 M15,11 L7,17"}),(0,p.jsx)("circle",{cx:"23",cy:"11",r:"4"})]}),Ve)),AI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),kI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),TI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("g",{clipPath:"url(#a)",children:(0,p.jsx)("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,p.jsx)("defs",{children:(0,p.jsx)("clipPath",{id:"a",children:(0,p.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),V),LI=P((0,p.jsx)(p.Fragment,{children:(0,p.jsx)("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),V),CI=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 7v-2h13v2"}),(0,p.jsx)("path",{d:"M10 5v14"}),(0,p.jsx)("path",{d:"M12 19h-4"}),(0,p.jsx)("path",{d:"M15 13v-1h6v1"}),(0,p.jsx)("path",{d:"M18 12v7"}),(0,p.jsx)("path",{d:"M17 19h2"})]}),L),BI=P((0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 12h10"}),(0,p.jsx)("path",{d:"M7 5v14"}),(0,p.jsx)("path",{d:"M17 5v14"}),(0,p.jsx)("path",{d:"M15 19h4"}),(0,p.jsx)("path",{d:"M15 5h4"}),(0,p.jsx)("path",{d:"M5 19h4"}),(0,p.jsx)("path",{d:"M5 5h4"})]})}),L),DI=P((0,p.jsx)(p.Fragment,{children:(0,p.jsx)("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:(0,p.jsx)("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),V),GI=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 8l-4 4l4 4"}),(0,p.jsx)("path",{d:"M17 8l4 4l-4 4"}),(0,p.jsx)("path",{d:"M14 4l-4 16"})]}),L);var OI=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,p.jsx)("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),(0,p.jsx)("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),L),RI=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,p.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),(0,p.jsx)("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),L),FI=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,p.jsx)("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),(0,p.jsx)("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),L),NI=Me.default.memo(({theme:e})=>P((0,p.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),(0,p.jsx)("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),L)),HI=Me.default.memo(({theme:e})=>P((0,p.jsxs)("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),(0,p.jsx)("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),L)),zI=Me.default.memo(({theme:e})=>P((0,p.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),(0,p.jsx)("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),(0,p.jsx)("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),L)),WI=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M21 19h-18l9 -15"}),(0,p.jsx)("path",{d:"M20.615 15.171h.015"}),(0,p.jsx)("path",{d:"M19.515 11.771h.015"}),(0,p.jsx)("path",{d:"M17.715 8.671h.015"}),(0,p.jsx)("path",{d:"M15.415 5.971h.015"})]}),L),_I=P((0,p.jsx)("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512}),jI=P((0,p.jsx)("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"})),VI=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),(0,p.jsx)("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),(0,p.jsx)("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),(0,p.jsx)("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),L),YI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),(0,p.jsx)("path",{d:"M7 11l5 5l5 -5"}),(0,p.jsx)("path",{d:"M12 4l0 12"})]}),L),UI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),(0,p.jsx)("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),L),XI=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,p.jsx)("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,p.jsx)("path",{d:"M9.15 14.85l8.85 -10.85"}),(0,p.jsx)("path",{d:"M6 4l8.85 10.85"})]}),L),$I=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),(0,p.jsx)("path",{d:"M12 17l0 .01"}),(0,p.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),L),ZI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M7 4v16l13 -8z"})]}),L),qI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),L),KI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 12l5 5l10 -10"})]}),L),QI=P((0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),(0,p.jsx)("path",{d:"M12 9v4"}),(0,p.jsx)("path",{d:"M12 17h.01"})]}),L),JI=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M11 7l6 6"}),(0,p.jsx)("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),L),eS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 3l-4 7h8z"}),(0,p.jsx)("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,p.jsx)("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),L),tS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 7l16 0"}),(0,p.jsx)("path",{d:"M4 17l16 0"}),(0,p.jsx)("path",{d:"M7 4l0 16"}),(0,p.jsx)("path",{d:"M17 4l0 16"})]}),L),nS=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),(0,p.jsx)("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),L),oS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),(0,p.jsx)("path",{d:"M4 15l8 4l8 -4"}),(0,p.jsx)("path",{d:"M12 4v7"}),(0,p.jsx)("path",{d:"M15 8l-3 3l-3 -3"})]}),L),iS=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{d:"M4.16602 10H15.8327"}),(0,p.jsx)("path",{d:"M12.5 13.3333L15.8333 10"}),(0,p.jsx)("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),V),rS=P((0,p.jsxs)("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[(0,p.jsx)("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),(0,p.jsx)("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),aS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,p.jsx)("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),(0,p.jsx)("path",{d:"M15 6l3 3"}),(0,p.jsx)("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),(0,p.jsx)("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),L),sS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,p.jsx)("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),(0,p.jsx)("path",{d:"M15 6l3 3"}),(0,p.jsx)("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),(0,p.jsx)("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),L),lS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),(0,p.jsx)("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),(0,p.jsx)("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),(0,p.jsx)("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),(0,p.jsx)("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),(0,p.jsx)("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),L),dS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),(0,p.jsx)("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),(0,p.jsx)("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),(0,p.jsx)("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),L),cS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),(0,p.jsx)("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),L),uS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),(0,p.jsx)("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),(0,p.jsx)("path",{d:"M3 3l18 18"})]}),L),pS=P((0,p.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),(0,p.jsx)("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),(0,p.jsx)("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),(0,p.jsx)("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),(0,p.jsx)("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),(0,p.jsx)("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),L),hS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),(0,p.jsx)("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),(0,p.jsx)("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),(0,p.jsx)("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),(0,p.jsx)("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),(0,p.jsx)("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),L),mS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),(0,p.jsx)("path",{d:"M21 21l-6 -6"})]}),L),fS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),(0,p.jsx)("path",{d:"M12 7v5l3 3"}),(0,p.jsx)("path",{d:"M19 16l-2 3h4l-2 3"})]}),L),gS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 8l0 4l2 2"}),(0,p.jsx)("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),L),ES=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),(0,p.jsx)("path",{d:"M5 10a7 7 0 0 0 14 0"}),(0,p.jsx)("path",{d:"M8 21l8 0"}),(0,p.jsx)("path",{d:"M12 17l0 4"})]}),L),xS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 3l18 18"}),(0,p.jsx)("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),(0,p.jsx)("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),(0,p.jsx)("path",{d:"M8 21l8 0"}),(0,p.jsx)("path",{d:"M12 17l0 4"})]}),L),yS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),L),wS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),(0,p.jsx)("path",{d:"M12 20v.01"}),(0,p.jsx)("path",{d:"M16 20v.01"}),(0,p.jsx)("path",{d:"M8 20v.01"}),(0,p.jsx)("path",{d:"M4 20v.01"}),(0,p.jsx)("path",{d:"M4 16v.01"}),(0,p.jsx)("path",{d:"M4 12v.01"}),(0,p.jsx)("path",{d:"M4 8v.01"}),(0,p.jsx)("path",{d:"M4 4v.01"}),(0,p.jsx)("path",{d:"M8 4v.01"}),(0,p.jsx)("path",{d:"M12 4v.01"}),(0,p.jsx)("path",{d:"M16 4v.01"}),(0,p.jsx)("path",{d:"M20 4v.01"}),(0,p.jsx)("path",{d:"M20 8v.01"}),(0,p.jsx)("path",{d:"M20 12v.01"}),(0,p.jsx)("path",{d:"M20 16v.01"}),(0,p.jsx)("path",{d:"M20 20v.01"})]}),L),bS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 3v18"}),(0,p.jsx)("path",{d:"M19 21v-18"}),(0,p.jsx)("path",{d:"M5 7h14"}),(0,p.jsx)("path",{d:"M5 15h14"}),(0,p.jsx)("path",{d:"M8 13v4"}),(0,p.jsx)("path",{d:"M11 13v4"}),(0,p.jsx)("path",{d:"M16 13v4"}),(0,p.jsx)("path",{d:"M14 5v4"}),(0,p.jsx)("path",{d:"M11 5v4"}),(0,p.jsx)("path",{d:"M8 5v4"}),(0,p.jsx)("path",{d:"M3 21h18"})]}),L),MS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 12l18 0"}),(0,p.jsx)("path",{d:"M7 16l10 0l-10 5l0 -5"}),(0,p.jsx)("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),L),PS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M12 3l0 18"}),(0,p.jsx)("path",{d:"M16 7l0 10l5 0l-5 -10"}),(0,p.jsx)("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),L),IS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),(0,p.jsx)("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),(0,p.jsx)("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),L),SS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),(0,p.jsx)("path",{d:"M22 22l-3 -3"}),(0,p.jsx)("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),(0,p.jsx)("path",{d:"M3 11v-1"}),(0,p.jsx)("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),(0,p.jsx)("path",{d:"M10 3h1"}),(0,p.jsx)("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),L),vS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),(0,p.jsx)("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),(0,p.jsx)("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),(0,p.jsx)("path",{d:"M10 15l2 6l2 -6"}),(0,p.jsx)("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),L),AS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),(0,p.jsx)("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),(0,p.jsx)("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),(0,p.jsx)("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),(0,p.jsx)("path",{d:"M11 21v-6l3 6v-6"})]}),L),kS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),(0,p.jsx)("path",{d:"M4 8l5 0"}),(0,p.jsx)("path",{d:"M15 8l4 0"})]}),L),TS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),(0,p.jsx)("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),(0,p.jsx)("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),(0,p.jsx)("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),(0,p.jsx)("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),L),LS=P((0,p.jsxs)("g",{stroke:"currentColor",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...L,strokeWidth:1.5}),CS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),(0,p.jsx)("path",{d:"M21 12h-13l3 -3"}),(0,p.jsx)("path",{d:"M11 15l-3 -3"})]}),L),BS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),(0,p.jsx)("path",{d:"M10 9l5 3l-5 3z"})]}),L),DS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 6h18"}),(0,p.jsx)("path",{d:"M3 12h18"}),(0,p.jsx)("path",{d:"M3 18h18"}),(0,p.jsx)("path",{d:"M6 3v18"}),(0,p.jsx)("path",{d:"M12 3v18"}),(0,p.jsx)("path",{d:"M18 3v18"})]}),L),GS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),(0,p.jsx)("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),(0,p.jsx)("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),L),OS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 18l12 -12"}),(0,p.jsx)("path",{d:"M18 10v-4h-4"})]}),L),RS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),(0,p.jsx)("path",{d:"M18 4l3 3l-3 3"})]}),L),FS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{d:"M16,12L20,9L16,6"}),(0,p.jsx)("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),L),NS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 9l6 6l6 -6"})]}),L),HS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 15l6 -6l6 6"})]}),L),zS=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 15l6 -6l6 6"})]}),L),WS=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),(0,p.jsx)("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),L),_S=P((0,p.jsxs)("g",{children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M5 7l0 10"}),(0,p.jsx)("path",{d:"M7 5l10 0"}),(0,p.jsx)("path",{d:"M7 19l10 0"}),(0,p.jsx)("path",{d:"M19 7l0 10"})]}),L),jS=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("rect",{x:"4",y:"4",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"10",y:"4",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"16",y:"4",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"4",y:"10",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"10",y:"10",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"16",y:"10",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"4",y:"16",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"10",y:"16",width:"4",height:"4",rx:"1"}),(0,p.jsx)("rect",{x:"16",y:"16",width:"4",height:"4",rx:"1"})]}),L),VS=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("rect",{x:"7",y:"6",width:"10",height:"8",rx:"1",strokeDasharray:"2 2"}),(0,p.jsx)("line",{x1:"3",y1:"6",x2:"3",y2:"14"}),(0,p.jsx)("polyline",{points:"2 8 3 6 4 8"}),(0,p.jsx)("polyline",{points:"2 12 3 14 4 12"}),(0,p.jsx)("line",{x1:"7",y1:"18",x2:"17",y2:"18"}),(0,p.jsx)("polyline",{points:"9 17 7 18 9 19"}),(0,p.jsx)("polyline",{points:"15 17 17 18 15 19"})]}),L),YS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),(0,p.jsx)("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),L),US=P((0,p.jsx)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:.5,viewBox:"0 0 640 512",children:(0,p.jsx)("path",{d:"M15 15C24.4 5.7 39.6 5.7 49 15l63 63L112 40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96c0 13.3-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l38.1 0L15 49C5.7 39.6 5.7 24.4 15 15zM133.5 243.9C158.6 193.6 222.7 112 320 112s161.4 81.6 186.5 131.9c3.8 7.6 3.8 16.5 0 24.2C481.4 318.4 417.3 400 320 400s-161.4-81.6-186.5-131.9c-3.8-7.6-3.8-16.5 0-24.2zM320 320a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM591 15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-63 63 38.1 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24s24 10.7 24 24l0 38.1 63-63zM15 497c-9.4-9.4-9.4-24.6 0-33.9l63-63L40 400c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0c13.3 0 24 10.7 24 24l0 96c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-38.1L49 497c-9.4 9.4-24.6 9.4-33.9 0zm576 0l-63-63 0 38.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24l96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-38.1 0 63 63c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"})})),XS=P((0,p.jsxs)("g",{strokeWidth:1.5,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 6l8 0"}),(0,p.jsx)("path",{d:"M16 6l4 0"}),(0,p.jsx)("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 12l2 0"}),(0,p.jsx)("path",{d:"M10 12l10 0"}),(0,p.jsx)("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 18l11 0"}),(0,p.jsx)("path",{d:"M19 18l1 0"})]}),L),$S=P((0,p.jsxs)("g",{strokeWidth:1,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),L),ZS=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),(0,p.jsx)("path",{d:"M13.5 6.5l4 4"})]}),L),qS=P((0,p.jsxs)("g",{strokeWidth:1,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M11 7l-5 5l5 5"}),(0,p.jsx)("path",{d:"M17 7l-5 5l5 5"})]}),L),KS=P((0,p.jsxs)("g",{strokeWidth:"1.75",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),(0,p.jsx)("path",{d:"M15 4l0 16"})]}),L),QS=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"})]}),L),JS=P((0,p.jsxs)("g",{strokeWidth:"1.25",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M3 4l18 0"}),(0,p.jsx)("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),(0,p.jsx)("path",{d:"M12 16l0 4"}),(0,p.jsx)("path",{d:"M9 20l6 0"}),(0,p.jsx)("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),L);var ev=P((0,p.jsxs)("g",{strokeWidth:"1.5",children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("polyline",{points:"9 6 15 12 9 18"})]}),L),tv=P((0,p.jsxs)("g",{strokeWidth:1.25,children:[(0,p.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,p.jsx)("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 6l8 0"}),(0,p.jsx)("path",{d:"M16 6l4 0"}),(0,p.jsx)("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 12l2 0"}),(0,p.jsx)("path",{d:"M10 12l10 0"}),(0,p.jsx)("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,p.jsx)("path",{d:"M4 18l11 0"}),(0,p.jsx)("path",{d:"M19 18l1 0"})]}),L);var Xu=[{icon:vs,value:"selection",key:ht.V,numericKey:void 0,fillable:!0,myocSimplifiedMode:!0},{icon:Ru,value:"rectangle",key:ht.R,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Fu,value:"diamond",key:ht.D,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Nu,value:"ellipse",key:ht.O,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Hu,value:"arrow",key:ht.A,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:zu,value:"line",key:ht.L,numericKey:void 0,fillable:!0,myocSimplifiedMode:!1},{icon:Wu,value:"freedraw",key:[ht.P,ht.X],numericKey:void 0,fillable:!1,myocSimplifiedMode:!0},{icon:_u,value:"text",key:ht.T,numericKey:void 0,fillable:!1,myocSimplifiedMode:!0},{icon:ju,value:"image",key:[ht.I],numericKey:void 0,fillable:!1,myocSimplifiedMode:!0},{icon:Vu,value:"eraser",key:ht.E,numericKey:void 0,fillable:!1,myocSimplifiedMode:!0}],Cg=e=>e.state.preferredSelectionTool.type==="lasso"?[{value:"lasso",icon:vs,key:ht.V,fillable:!0,myocSimplifiedMode:!0},...Xu.slice(1)]:Xu,dv=(e,t)=>Cg(t).find((o,i)=>o.numericKey!=null&&e===o.numericKey?.toString()||o.key&&(typeof o.key=="string"?o.key===e:o.key.includes(e)))?.value||null,cv=(e,t)=>{let n=Q(e,t);return n?e.type==="arrow"?Qo({...n,...D.getBoundTextElementPosition(e,n,t)},t):Qo(n,t):null};I();var mv=(e,t)=>!!(!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="lasso"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||Ft(t,e).length));I();import{pointFrom as Pr}from"@excalidraw/math";import{DEFAULT_FONT_FAMILY as Bg,DEFAULT_FONT_SIZE as Dg,TEXT_ALIGN as Gg,VERTICAL_ALIGN as Og,getSizeFromPoints as Rg,randomId as Fg,arrayToMap as Ng,assertNever as As,cloneJSON as Zu,getFontString as Hg,isDevEnv as zg,toBrandedType as Wg,getLineHeight as _g}from"@excalidraw/common";var Ir={width:100,height:0},On=100,jg=(e,t,n)=>{let o=qn({x:0,y:0,textAlign:Gg.CENTER,verticalAlign:Og.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:o.id})}),Bi(o,e,n),[e,o]},$u=(e,t,n,o,i)=>{let r,a;if(Object.assign(e,{startBinding:e?.startBinding||null,endBinding:e.endBinding||null}),t){let c=t?.width??On,u=t?.height??On,h;t.id&&(h=o.getElement(t.id),h||console.error(`No element for start binding with id ${t.id} found`));let m=t.x||e.x-c,g=t.y||e.y-u/2,f=h?h.type:t.type;if(f){if(f==="text"){let E="";h&&h.type==="text"?E=h.text:t.type==="text"&&(E=t.text),E||console.error(`No text found for start binding text element for ${e.id}`),r=qn({x:m,y:g,type:"text",...h,...t,text:E}),Object.assign(r,{x:t.x||e.x-r.width,y:t.y||e.y-r.height/2})}else switch(f){case"rectangle":case"ellipse":case"diamond":{r=Zn({x:m,y:g,width:c,height:u,...h,...t,type:f});break}default:As(e,`Unhandled element start type "${t.type}"`,!0)}Rt(e,r,"orbit","start",i)}}if(n){let c=n?.height??On,u=n?.width??On,h;n.id&&(h=o.getElement(n.id),h||console.error(`No element for end binding with id ${n.id} found`));let m=n.x||e.x+e.width,g=n.y||e.y-c/2,f=h?h.type:n.type;if(f){if(f==="text"){let E="";h&&h.type==="text"?E=h.text:n.type==="text"&&(E=n.text),E||console.error(`No text found for end binding text element for ${e.id}`),a=qn({x:m,y:g,type:"text",...h,...n,text:E}),Object.assign(a,{y:n.y||e.y-a.height/2})}else switch(f){case"rectangle":case"ellipse":case"diamond":{a=Zn({x:m,y:g,width:u,height:c,...h,...n,type:f});break}default:As(e,`Unhandled element end type "${f}"`,!0)}Rt(e,a,"orbit","end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:r,endBoundElement:a};let s=e.points.length-1,l=.5,d=Zu(e.points);return e.points[s][0]>e.points[s-1][0]&&(d[0][0]=l,d[s][0]-=l),e.points[s][0]<e.points[s-1][0]&&(d[0][0]=-l,d[s][0]+=l),e.points[s][1]>e.points[s-1][1]&&(d[0][1]=l,d[s][1]-=l),e.points[s][1]<e.points[s-1][1]&&(d[0][1]=-l,d[s][1]+=l),Object.assign(e,D.getNormalizeElementPointsAndCoords({...e,points:d})),{linearElement:e,startBoundElement:r,endBoundElement:a}},ks=class{excalidrawElements=new Map;add=t=>{t&&this.excalidrawElements.set(t.id,t)};getElements=()=>Sa(Array.from(this.excalidrawElements.values()));getElementsMap=()=>Wg(Ng(this.getElements()));getElement=t=>this.excalidrawElements.get(t)},kv=(e,t)=>{if(!e)return[];let n=Zu(e),o=new ks,i=new Map,r=new Map;for(let l of n){let d,c=l.id;switch(t?.regenerateIds!==!1&&Object.assign(l,{id:Fg()}),l.type){case"rectangle":case"ellipse":case"diamond":{let h=l?.label?.text&&l.width===void 0?0:l?.width||On,m=l?.label?.text&&l.height===void 0?0:l?.height||On;d=Zn({...l,width:h,height:m});break}case"line":{let h=l.width||Ir.width,m=l.height||Ir.height;d=Vc({width:h,height:m,points:[Pr(0,0),Pr(h,m)],...l});break}case"arrow":{let h=l.width||Ir.width,m=l.height||Ir.height;d=pr({width:h,height:m,endArrowhead:"arrow",points:[Pr(0,0),Pr(h,m)],...l,type:"arrow"}),Object.assign(d,Rg(d.points));break}case"text":{let h=l?.fontFamily||Bg,m=l?.fontSize||Dg,g=l?.lineHeight||_g(h),f=l.text??"",E=Go(f),x=ot(E,Hg({fontFamily:h,fontSize:m}),g);d=qn({width:x.width,height:x.height,fontFamily:h,fontSize:m,...l});break}case"image":{d=Yc({width:l?.width||On,height:l?.height||On,...l});break}case"frame":{d=Wc({x:0,y:0,...l});break}case"magicframe":{d=_c({x:0,y:0,...l});break}case"freedraw":case"iframe":case"embeddable":{d=l;break}default:d=l,As(l,`Unhandled element type "${l.type}"`,!0)}o.getElement(d.id)?console.error(`Duplicate id found for ${d.id}`):(o.add(d),i.set(d.id,l),c&&r.set(c,d.id))}let a=o.getElementsMap(),s=new ho(a);for(let[l,d]of i){let c=o.getElement(l);switch(d.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if(d.label?.text){let[u,h]=jg(c,d?.label,s);if(o.add(u),o.add(h),j(u)){let m=d.type==="arrow"?d?.start:void 0,g=d.type==="arrow"?d?.end:void 0;if(m&&m.id){let y=r.get(m.id);y&&Object.assign(m,{id:y})}if(g&&g.id){let y=r.get(g.id);y&&Object.assign(g,{id:y})}let{linearElement:f,startBoundElement:E,endBoundElement:x}=$u(u,m,g,o,s);u=f,o.add(f),o.add(E),o.add(x)}}else switch(d.type){case"arrow":{let{start:u,end:h}=d;if(u&&u.id){let E=r.get(u.id);Object.assign(u,{id:E})}if(h&&h.id){let E=r.get(h.id);Object.assign(h,{id:E})}let{linearElement:m,startBoundElement:g,endBoundElement:f}=$u(c,u,h,o,s);o.add(m),o.add(g),o.add(f);break}}break}}}for(let[l,d]of i){if(d.type!=="frame"&&d.type!=="magicframe")continue;let c=o.getElement(l);if(!c)throw new Error(`Excalidraw element with id ${l} doesn't exist`);let u=[];d.children.forEach(b=>{let S=r.get(b);if(!S)throw new Error(`Element with ${b} wasn't mapped correctly`);let v=o.getElement(S);if(!v)throw new Error(`Frame element with id ${S} doesn't exist`);Object.assign(v,{frameId:c.id}),v?.boundElements?.forEach(k=>{let T=o.getElement(k.id);if(!T)throw new Error(`Bound element with id ${k.id} doesn't exist`);Object.assign(T,{frameId:c.id}),u.push(T)}),u.push(v)});let[h,m,g,f]=We(u),E=10;h=h-E,m=m-E,g=g+E,f=f+E;let x=c?.x||h,y=c?.y||m,w=c?.width||g-h,M=c?.height||f-m;Object.assign(c,{x,y,width:w,height:M}),zg()&&d.children.length&&(c?.x||c?.y||c?.width||c?.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return o.getElements()};I();var Dv=({app:e,event:t})=>{let n=e.state;if(n.selectedLinearElement&&e.lastPointerMoveCoords){if(n.selectedLinearElement.draggedFocusPointBinding)return iu(n.selectedLinearElement,e.scene.getNonDeletedElementsMap(),e.lastPointerMoveCoords,e.scene,n,e.getEffectiveGridSize(),t.altKey),!0;if(n.selectedLinearElement.hoverPointIndex!==null&&e.lastPointerMoveEvent&&n.selectedLinearElement.initialState.lastClickedPoint>=0&&n.selectedLinearElement.isDragging)return D.handlePointDragging(e.lastPointerMoveEvent,e,e.lastPointerMoveCoords.x,e.lastPointerMoveCoords.y,n.selectedLinearElement),!0}return!1};I();var Vg=e=>{switch(e){case void 0:case null:return null;case"dot":return"circle";case"crowfoot_one":return"cardinality_one";case"crowfoot_many":return"cardinality_many";case"crowfoot_one_or_many":return"cardinality_one_or_many";default:return e}},Rv=e=>{let t=Vg(e);return t===null?null:t};var Wv=e=>e.reduce((t,n)=>t+n.version,0),Sc=e=>{let t=5381;for(let n of Yg(e))t=(t<<5)+t+n.versionNonce;return t>>>0},vc=e=>{let t=5381;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);t=(t<<5)+t+o}return t>>>0},_v=e=>e.filter(t=>!t.isDeleted&&!pc(t)),jv=e=>e.filter(t=>!t.isDeleted),Vv=e=>!e.isDeleted;export{Tn as AppStateDelta,bh as BASE_ARROW_MIN_LENGTH,dd as BASE_BINDING_GAP,Vn as BASE_BINDING_GAP_ELBOW,ae as BASE_PADDING,Pn as BindableElement,Mn as BoundElement,Je as CaptureUpdateAction,Xw as DEFAULT_LINK_SIZE,pu as DEFAULT_OMIT_SIDES,$ as Delta,Ka as DurableIncrement,ja as ElementBounds,Ln as ElementsDelta,Qa as EphemeralIncrement,Vo as FOCUS_POINT_SIZE,eu as FlowChartCreator,Jc as FlowChartNavigator,ke as HEADING_DOWN,Ze as HEADING_LEFT,be as HEADING_RIGHT,rt as HEADING_UP,i0 as INVISIBLY_SMALL_ELEMENT_SIZE,Pa as InvalidFractionalIndexError,D as LinearElementEditor,Ce as MINIMAL_CROP_SIZE,nM as OMIT_SIDES_FOR_FRAME,tM as OMIT_SIDES_FOR_MULTIPLE_ELEMENTS,Xu as SHAPES,ho as Scene,at as ShapeCache,Mc as Store,Jo as StoreChange,Ja as StoreDelta,lr as StoreIncrement,Cn as StoreSnapshot,ut as aabbForElement,Xh as addElementsToFrame,Uf as addNewNodes,nw as addToGroup,Ub as alignElements,o6 as arrangeElements,kh as avoidRectangularCorner,Rt as bindBindingElement,yd as bindElementsToFramesAfterDuplication,Mh as bindOrUnbindBindingElement,Jy as bindOrUnbindBindingElements,ga as bindPointToSnapToElementOutline,hd as bindingProperties,La as boundsContainBounds,od as bumpVersion,Lh as calculateFixedPointForElbowArrowBinding,ro as calculateFixedPointForNonElbowArrowBinding,Z2 as canApplyRoundnessTypeToElement,ml as canBecomePolygon,Cl as canChangeRoundness,xf as canCreateLinkFromElements,ey as canHaveArrowheads,yr as canResizeFromSides,no as charWidth,we as compareHeading,Oo as computeBoundTextPosition,qr as computeContainerDimensionForBoundText,Sx as containsCJK,kv as convertToExcalidrawElements,W4 as createPlaceholderEmbeddableLabel,os as createSrcDoc,W2 as cropElement,hn as deconstructDiamondElement,Wn as deconstructLinearOrFreeDrawElement,pn as deconstructRectanguloidElement,qa as deepCopyElement,E4 as defaultGetElementLinkFromSelection,xx as detectLineHeight,gn as distanceToElement,e4 as distributeElements,Qt as doBoundsIntersect,p4 as dragNewElement,c4 as dragSelectedElements,A0 as duplicateElement,E6 as duplicateElements,tw as editGroupForSelectedElement,de as elementCenterPoint,In as elementOverlapsWithFrame,$o as elementWithCanvasCache,vn as elementsAreInFrameBounds,Td as elementsAreInSameGroup,vd as elementsOverlappingBBox,j4 as embeddableURLValidator,om as excludeElementsInFramesFromSelection,T3 as filterElementsEligibleAsFrameChildren,dv as findShapeByKey,t3 as fixBindingsAfterDeletion,pd as fixDuplicatedBindingsAfterDuplication,aa as flipHeading,O3 as frameAndChildrenSelectedTogether,bl as generateLinearCollisionShape,Qe as generateRoughOptions,Z3 as getActiveTextElement,Gi as getAllHoveredElementAtPoint,vl as getApproxMinLineHeight,Sl as getApproxMinLineWidth,md as getArrowLocalFixedPoints,Km as getArrowheadAngle,Rv as getArrowheadForPicker,je as getArrowheadPoints,qm as getArrowheadSize,Ne as getBindingGap,n3 as getBindingSideMidPoint,ba as getBindingStrategyForDraggingBindingElementEndpoints,Q as getBoundTextElement,qt as getBoundTextElementId,Fx as getBoundTextElementPosition,Ro as getBoundTextMaxHeight,xt as getBoundTextMaxWidth,cv as getBoundTextShape,Ya as getBoundsFromPoints,En as getCenterForBounds,Lb as getClosestElementBounds,Fe as getCommonBoundingBox,We as getCommonBounds,Yh as getCommonFrameId,Ox as getContainerCenter,Kr as getContainerCoords,De as getContainerElement,Sn as getContainingFrame,Yt as getCornerRadius,Oi as getCubicBezierCurveBound,hM as getCursorForResizingElement,Qh as getDefaultFrameName,q2 as getDefaultRoundnessTypeForElement,wl as getDiamondBaseCorners,to as getDiamondPoints,u4 as getDragOffsetXY,Tb as getDraggedElementsBounds,K as getElementAbsoluteCoords,ue as getElementBounds,ka as getElementLineSegments,Oa as getElementPointsCoords,Qo as getElementShape,uM as getElementWithTransformHandleType,wd as getElementsCompletelyInFrame,ze as getElementsInGroup,k3 as getElementsInNewFrame,A3 as getElementsInResizingFrame,b3 as getElementsIntersectingFrame,G3 as getElementsOverlappingFrame,Pd as getElementsWithinSelection,z4 as getEmbedLink,_2 as getFlipAdjustedCropPosition,An as getFrameChildren,Uh as getFrameChildrenInsertionIndex,jh as getFrameLikeElements,D3 as getFrameLikeTitle,qw as getFreedrawOutlineAsSegments,zm as getFreedrawOutlinePoints,Ue as getGlobalFixedPointForBindableElement,Ch as getGlobalFixedPoints,nd as getHeadingForElbowArrowSnap,Kt as getHoveredElementForBinding,Vl as getHoveredElementForFocusPoint,M5 as getInitializedImageElements,Ti as getLineHeightInPx,fn as getLineWidth,K2 as getLinearElementSubType,o5 as getLinkDirectionFromKey,x4 as getLinkIdAndTypeFromSelection,Xd as getLockedLinearCursorAlignSize,d1 as getMaxCharWidth,Ki as getMaximumGroups,wx as getMinCharWidth,Xo as getMinMaxXYFromCurvePathOps,ki as getMinTextElementWidth,Cd as getNewGroupIdsForDuplication,jv as getNonDeletedElements,kd as getNonDeletedGroupIds,zb as getNormalizedDimensions,po as getObservedAppState,ms as getOmitSidesForEditorInterface,hx as getOriginalContainerHeightFromCache,Ua as getPerfectElementSize,ss as getPredecessors,kb as getRectangleBoxAbsoluteCoords,Tm as getRenderOpacity,$5 as getResizeArrowDirection,X5 as getResizeOffsetXY,un as getResizedElementAbsoluteCoords,v3 as getRootElements,Wv as getSceneVersion,Ft as getSelectedElements,Qi as getSelectedElementsByGroup,Ba as getSelectedGroupForElement,dm as getSelectedGroupIdForElement,sm as getSelectedGroupIds,$3 as getSelectionStateForElements,Si as getSnapOutlineMidPoint,X3 as getTargetElements,Zh as getTargetFrame,Rx as getTextElementAngle,Wx as getTextFromElements,l1 as getTextHeight,Al as getTextWidth,Cg as getToolbarTools,pM as getTransformHandleTypeFromCoords,hu as getTransformHandles,fs as getTransformHandlesFromCoords,al as getUncroppedImageElement,Nr as getUncroppedWidthAndHeight,Y3 as getVisibleAndNonSelectedElements,_v as getVisibleElements,Cb as getVisibleSceneBounds,x1 as getWrappedTextLines,S3 as groupByFrameLikes,P3 as groupsAreAtLeastIntersectingTheFrame,I3 as groupsAreCompletelyOutOfFrame,jn as handleBindTextResize,iu as handleFocusPointDrag,g5 as handleFocusPointHover,m5 as handleFocusPointPointerDown,f5 as handleFocusPointPointerUp,ta as hasBackground,Tt as hasBoundTextElement,oM as hasBoundingBox,qx as hasStrokeColor,Qx as hasStrokeStyle,Kx as hasStrokeWidth,Sc as hashElementsVersion,vc as hashString,$e as headingForPoint,No as headingForPointFromElement,yt as headingForPointIsHorizontal,qe as headingIsHorizontal,by as headingIsVertical,Y1 as hitElementBoundText,V1 as hitElementBoundingBox,fy as hitElementBoundingBoxOnly,Lt as hitElementItself,Bt as intersectElementWithLineSegment,$2 as isArrowBoundToElement,j as isArrowElement,Ee as isBindableElement,ia as isBindableElementInsideOtherBindable,Be as isBindingElement,Up as isBindingElementType,Ot as isBindingEnabled,xe as isBoundToContainer,M3 as isCursorInFrame,Vp as isCurvedArrow,Y as isElbowArrow,Hb as isElementCompletelyInViewport,Ta as isElementContainingFrame,Md as isElementInFrame,lm as isElementInGroup,Ad as isElementInViewport,ao as isElementIntersectingFrame,y4 as isElementLink,J2 as isEligibleFrameChildType,ll as isEmbeddableElement,ul as isExcalidrawElement,Bh as isFixedPoint,Hr as isFlowchartNodeElement,fr as isFocusPointVisible,Ii as isFrameElement,ee as isFrameLikeElement,Se as isFreeDrawElement,_p as isFreeDrawElementType,qf as isHTMLSVGElement,Mi as isIframeElement,Pi as isIframeLikeElement,Ae as isImageElement,Ld as isInGroup,Hn as isInitializedImageElement,pc as isInvisiblySmallElement,jt as isLineElement,ne as isLinearElement,Yp as isLinearElementType,dl as isMagicFrameElement,Ex as isMeasureTextSupported,i5 as isNodeInFlowchart,Vv as isNonDeletedElement,Ut as isPathALoop,Xt as isPointInElement,Co as isRectangularElement,cl as isRectanguloidElement,am as isSelectedViaGroup,jp as isSharpArrow,X2 as isSimpleArrow,U3 as isSomeElementSelected,Xp as isTextBindableContainer,te as isTextElement,pl as isUsingAdaptiveRadius,hl as isUsingProportionalRadius,Q2 as isValidPolygon,zx as isValidTextContainer,Zf as loadHTMLImageElement,Ca as makeNextSelectedElementIds,Et as maxBindingDistance_simple,Dv as maybeHandleArrowPointlikeDrag,_4 as maybeParseEmbedSrc,us as measureFontSizeFromWidth,ot as measureText,fw as moveAllLeft,gw as moveAllRight,Yo as moveArrowAboveBindable,hw as moveOneLeft,mw as moveOneRight,Te as mutateElement,pr as newArrowElement,Zn as newElement,He as newElementWith,L4 as newEmbeddableElement,Wc as newFrameElement,D4 as newFreeDrawElement,C4 as newIframeElement,Yc as newImageElement,Vc as newLinearElement,_c as newMagicFrameElement,qn as newTextElement,k5 as normaliseElements,Vg as normalizeArrowhead,yc as normalizeElementOrder,mn as normalizeFixedPoint,P5 as normalizeSVG,Go as normalizeText,qi as omitGroupsContainingFrameLikes,Vh as omitPartialGroups,gd as orderByFractionalIndex,Do as originalContainerCache,w4 as parseElementLinkFromURL,g1 as parseTokens,Dt as pointInsideBounds,e0 as pointInsideBoundsInclusive,D5 as positionElementsOnGrid,eo as projectFixedPointOntoDiagonal,Bi as redrawTextBoundingBox,B4 as refreshTextDimensions,$h as removeAllElementsFromFrame,bd as removeElementsFromFrame,ow as removeFromSelectedGroups,Zw as renderElement,$w as renderSelectionElement,L3 as replaceAllElementsInFrame,lu as rescalePointsInElement,Pl as resetOriginalContainerCache,lg as resizeMultipleElements,rg as resizeSingleElement,ng as resizeSingleTextElement,ug as resizeTest,rm as selectGroup,Sd as selectGroupsForSelectedElements,Id as selectGroupsFromGivenElements,yx as setCustomTextMetricsProvider,Nx as shouldAllowVerticalAlign,B3 as shouldApplyFrameClip,Di as shouldTestInside,mv as showSelectedShapeActions,Ma as snapToMid,Hx as suppportsHorizontalAlign,Sa as syncInvalidIndices,Ed as syncInvalidIndicesImmutable,Yn as syncMovedIndices,Ud as toggleLinePolygonState,Jx as toolIsArrow,U5 as transformElements,Oe as unbindBindingElement,e3 as updateBindings,Re as updateBoundElements,bt as updateBoundPoint,io as updateElbowArrowPoints,C3 as updateFrameMembershipOfSelectedElements,b5 as updateImageCache,Ml as updateOriginalContainerCache,td as validateElbowPoints,Hh as validateFractionalIndices,Jt as vectorToHeading,Zt as wrapText};
29
29
  /*! Bundled license information:
30
30
 
31
31
  react/cjs/react.production.js: