@myoc/common 0.19.531 → 0.19.533

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 (44) hide show
  1. package/dist/dev/index.js +4 -1
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/constants.d.ts +1 -0
  5. package/dist/types/element/src/gif.d.ts +29 -0
  6. package/dist/types/element/src/image.d.ts +6 -1
  7. package/dist/types/element/src/index.d.ts +2 -0
  8. package/dist/types/element/src/newElement.d.ts +1 -0
  9. package/dist/types/element/src/renderGif.d.ts +5 -0
  10. package/dist/types/element/src/types.d.ts +12 -0
  11. package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
  12. package/dist/types/excalidraw/actions/actionCanvas.d.ts +6 -6
  13. package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
  14. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
  15. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  16. package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -1
  17. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  18. package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
  19. package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -3
  20. package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
  21. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +2 -1
  22. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
  23. package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -2
  24. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  25. package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -1
  26. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
  27. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  28. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
  29. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  30. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
  31. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  32. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  33. package/dist/types/excalidraw/components/App.d.ts +8 -1
  34. package/dist/types/excalidraw/components/App.gif.d.ts +18 -0
  35. package/dist/types/excalidraw/components/GifPlaybackControls.d.ts +10 -0
  36. package/dist/types/excalidraw/components/icons.d.ts +4 -0
  37. package/dist/types/excalidraw/data/blob.d.ts +2 -2
  38. package/dist/types/excalidraw/data/json.d.ts +1 -1
  39. package/dist/types/excalidraw/data/restoreGif.d.ts +4 -0
  40. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -0
  41. package/dist/types/excalidraw/scene/types.d.ts +2 -1
  42. package/dist/types/excalidraw/types.d.ts +12 -2
  43. package/dist/types/excalidraw/viewport.d.ts +1 -1
  44. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var ze=Object.create;var Q=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Je=(e,t)=>()=>(e&&(t=e(e=0)),t);var J=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var et=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of je(t))!Qe.call(e,o)&&o!==n&&Q(e,o,{get:()=>t[o],enumerable:!(r=qe(t,o))||r.enumerable});return e};var ee=(e,t,n)=>(n=e!=null?ze(Ze(e)):{},et(t||!e||!e.__esModule?Q(n,"default",{value:e,enumerable:!0}):n,e));var h,p=Je(()=>{h={PROD:!0}});var Ce=J(($,we)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof $=="object"?we.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})($,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(i,l){this._listeners[i]=this._listeners[i]||[],this._listeners[i].indexOf(l)<0&&this._listeners[i].push(l)},e.prototype.removeEventListener=function(i,l){if(this._listeners[i]){var u=this._listeners[i].indexOf(l);u>=0&&this._listeners[i].splice(u,1)}},e.prototype.dispatchEvent=function(i){if(this._listeners[i.type]&&this._listeners[i.type].length)for(var l=this._listeners[i.type].slice(),u=0,m=l.length;u<m;++u)l[u].call(this,i)};var t=function(i){return typeof i.constructor=="function"&&i.constructor.name==="GeneratorFunction"},n=function(i){return{next:function(){var l=i();return l?{value:l}:{done:!0}}}},r=function(i){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:i})}}},o=function(i,l){var u=typeof i;if(u==="object"){if(typeof i.next=="function")return i;if(typeof i.then=="function")return r(i)}return u==="function"?t(i)?i():n(i):r(l.resolve(i))},s=function(i,l,u){this.target=i,this.type=l,this.data=u},a=function(i,l,u){if(e.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=u||{},this._options.promise=this._options.promise||Promise,this._iterator=o(i,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return a.prototype=new e,a.prototype.constructor=a,a.prototype.concurrency=function(i){return typeof i<"u"&&(this._concurrency=i,this.active()&&this._proceed()),this._concurrency},a.prototype.size=function(){return this._size},a.prototype.active=function(){return!!this._promise},a.prototype.promise=function(){return this._promise},a.prototype.start=function(){var i=this,l=this._options.promise;return this._promise=new l(function(u,m){i._callbacks={reject:m,resolve:u},i._proceed()}),this._promise},a.prototype._fireEvent=function(i,l){this.dispatchEvent(new s(this,i,l))},a.prototype._settle=function(i){i?this._callbacks.reject(i):this._callbacks.resolve(),this._promise=null,this._callbacks=null},a.prototype._onPooledPromiseFulfilled=function(i,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:i,result:l}),this._proceed())},a.prototype._onPooledPromiseRejected=function(i,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:i,error:l}),this._settle(l||new Error("Unknown error")))},a.prototype._trackPromise=function(i){var l=this;i.then(function(u){l._onPooledPromiseFulfilled(i,u)},function(u){l._onPooledPromiseRejected(i,u)}).catch(function(u){l._settle(new Error("Promise processing failed: "+u))})},a.prototype._proceed=function(){if(!this._done){for(var i={done:!1};this._size<this._concurrency&&!(i=this._iterator.next()).done;)this._size++,this._trackPromise(i.value);this._done=i===null||!!i.done}this._done&&this._size===0&&this._settle()},a.PromisePoolEvent=s,a.PromisePool=a,a})});var We=J(H=>{"use strict";p();Object.defineProperty(H,"__esModule",{value:!0});H.sanitizeUrl=void 0;var un=/^([^\w]*)(javascript|data|vbscript)/im,pn=/&#(\w+)(^\w|;)?/g,dn=/&(newline|tab);/gi,fn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,hn=/^.+(:|&colon;)/gim,mn=[".","/"];function En(e){return mn.indexOf(e[0])>-1}function Tn(e){return e.replace(pn,function(t,n){return String.fromCharCode(n)})}function gn(e){var t=Tn(e||"").replace(dn,"").replace(fn,"").trim();if(!t)return"about:blank";if(En(t))return t;var n=t.match(hn);if(!n)return t;var r=n[0];return un.test(r)?"about:blank":t}H.sanitizeUrl=gn});p();p();var te=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t],r=this.scoreFunction(n);for(;t>0;){let o=(t+1>>1)-1,s=this.content[o];if(r<this.scoreFunction(s))this.content[t]=s,t=o;else break}this.content[t]=n}bubbleUp(t){let n=this.content.length,r=this.content[t],o=this.scoreFunction(r);for(;;){let s=(t+1<<1)-1,a=s+1,i=t,l=o;if(s<n){let u=this.scoreFunction(this.content[s]);u<l&&(i=s,l=u)}if(a<n&&this.scoreFunction(this.content[a])<l&&(i=a),i===t)break;this.content[t]=this.content[i],t=i}this.content[t]=r}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};p();var Sn=e=>Array.isArray(e)&&e.length===4&&typeof e[0]=="number"&&typeof e[1]=="number"&&typeof e[2]=="number"&&typeof e[3]=="number";p();p();function C(e){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}var nt=/^\s+/,rt=/\s+$/;function c(e,t){if(e=e||"",t=t||{},e instanceof c)return e;if(!(this instanceof c))return new c(e,t);var n=ot(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,o,s,a,i;return n=t.r/255,r=t.g/255,o=t.b/255,n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*s+.7152*a+.0722*i},setAlpha:function(t){return this._a=le(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=re(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=re(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=ne(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ne(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return oe(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return lt(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(E(this._r,255)*100)+"%",g:Math.round(E(this._g,255)*100)+"%",b:Math.round(E(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%)":"rgba("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:_t[oe(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+se(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+se(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,o=this._a<1&&this._a>=0,s=!n&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return c(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(dt,arguments)},brighten:function(){return this._applyModification(ft,arguments)},darken:function(){return this._applyModification(ht,arguments)},desaturate:function(){return this._applyModification(ct,arguments)},saturate:function(){return this._applyModification(ut,arguments)},greyscale:function(){return this._applyModification(pt,arguments)},spin:function(){return this._applyModification(mt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(gt,arguments)},complement:function(){return this._applyCombination(Et,arguments)},monochromatic:function(){return this._applyCombination(bt,arguments)},splitcomplement:function(){return this._applyCombination(Tt,arguments)},triad:function(){return this._applyCombination(ie,[3])},tetrad:function(){return this._applyCombination(ie,[4])}};c.fromRatio=function(e,t){if(C(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=O(e[r]));e=n}return c(e,t)};function ot(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,s=null,a=!1,i=!1;return typeof e=="string"&&(e=vt(e)),C(e)=="object"&&(x(e.r)&&x(e.g)&&x(e.b)?(t=st(e.r,e.g,e.b),a=!0,i=String(e.r).substr(-1)==="%"?"prgb":"rgb"):x(e.h)&&x(e.s)&&x(e.v)?(r=O(e.s),o=O(e.v),t=at(e.h,r,o),a=!0,i="hsv"):x(e.h)&&x(e.s)&&x(e.l)&&(r=O(e.s),s=O(e.l),t=it(e.h,r,s),a=!0,i="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=le(n),{ok:a,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function st(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function ne(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,a,i=(r+o)/2;if(r==o)s=a=0;else{var l=r-o;switch(a=i>.5?l/(2-r-o):l/(r+o),r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,l:i}}function it(e,t,n){var r,o,s;e=E(e,360),t=E(t,100),n=E(n,100);function a(u,m,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?u+(m-u)*6*g:g<1/2?m:g<2/3?u+(m-u)*(2/3-g)*6:u}if(t===0)r=o=s=n;else{var i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=a(l,i,e+1/3),o=a(l,i,e),s=a(l,i,e-1/3)}return{r:r*255,g:o*255,b:s*255}}function re(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,a,i=r,l=r-o;if(a=r===0?0:l/r,r==o)s=0;else{switch(r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,v:i}}function at(e,t,n){e=E(e,360)*6,t=E(t,100),n=E(n,100);var r=Math.floor(e),o=e-r,s=n*(1-t),a=n*(1-o*t),i=n*(1-(1-o)*t),l=r%6,u=[n,a,s,s,i,n][l],m=[i,n,n,a,s,s][l],g=[s,s,i,n,n,a][l];return{r:u*255,g:m*255,b:g*255}}function oe(e,t,n,r){var o=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function lt(e,t,n,r,o){var s=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16)),A(ce(r))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function se(e,t,n,r){var o=[A(ce(r)),A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return o.join("")}c.equals=function(e,t){return!e||!t?!1:c(e).toRgbString()==c(t).toRgbString()};c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ct(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=P(n.s),c(n)}function ut(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=P(n.s),c(n)}function pt(e){return c(e).desaturate(100)}function dt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=P(n.l),c(n)}function ft(e,t){t=t===0?0:t||10;var n=c(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),c(n)}function ht(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=P(n.l),c(n)}function mt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function Et(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function ie(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=c(e).toHsl(),r=[c(e)],o=360/t,s=1;s<t;s++)r.push(c({h:(n.h+s*o)%360,s:n.s,l:n.l}));return r}function Tt(e){var t=c(e).toHsl(),n=t.h;return[c(e),c({h:(n+72)%360,s:t.s,l:t.l}),c({h:(n+216)%360,s:t.s,l:t.l})]}function gt(e,t,n){t=t||6,n=n||30;var r=c(e).toHsl(),o=360/n,s=[c(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,s.push(c(r));return s}function bt(e,t){t=t||6;for(var n=c(e).toHsv(),r=n.h,o=n.s,s=n.v,a=[],i=1/t;t--;)a.push(c({h:r,s:o,v:s})),s=(s+i)%1;return a}c.mix=function(e,t,n){n=n===0?0:n||50;var r=c(e).toRgb(),o=c(t).toRgb(),s=n/100,a={r:(o.r-r.r)*s+r.r,g:(o.g-r.g)*s+r.g,b:(o.b-r.b)*s+r.b,a:(o.a-r.a)*s+r.a};return c(a)};c.readability=function(e,t){var n=c(e),r=c(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};c.isReadable=function(e,t,n){var r=c.readability(e,t),o,s;switch(s=!1,o=St(n),o.level+o.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};c.mostReadable=function(e,t,n){var r=null,o=0,s,a,i,l;n=n||{},a=n.includeFallbackColors,i=n.level,l=n.size;for(var u=0;u<t.length;u++)s=c.readability(e,t[u]),s>o&&(o=s,r=c(t[u]));return c.isReadable(e,r,{level:i,size:l})||!a?r:(n.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],n))};var B=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_t=c.hexNames=At(B);function At(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function le(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function E(e,t){xt(e)&&(e="100%");var n=yt(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function P(e){return Math.min(1,Math.max(0,e))}function b(e){return parseInt(e,16)}function xt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function yt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function A(e){return e.length==1?"0"+e:""+e}function O(e){return e<=1&&(e=e*100+"%"),e}function ce(e){return Math.round(parseFloat(e)*255).toString(16)}function ae(e){return b(e)/255}var _=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function x(e){return!!_.CSS_UNIT.exec(e)}function vt(e){e=e.replace(nt,"").replace(rt,"").toLowerCase();var t=!1;if(B[e])e=B[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=_.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=_.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=_.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=_.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=_.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=_.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=_.hex8.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),a:ae(n[4]),format:t?"name":"hex8"}:(n=_.hex6.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),format:t?"name":"hex"}:(n=_.hex4.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),a:ae(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=_.hex3.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function St(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}import{clamp as W}from"@excalidraw/math";import{degreesToRadians as Mt}from"@excalidraw/math";var K=typeof window<"u"?new Map:null,ue=93,pe=180;function de(e,t,n,r){let o=e/255,s=t/255,a=n/255,i=Mt(r),l=Math.cos(i),u=Math.sin(i),m=[.213+l*.787-u*.213,.715-l*.715-u*.715,.072-l*.072+u*.928,.213-l*.213+u*.143,.715+l*.285+u*.14,.072-l*.072-u*.283,.213-l*.213-u*.787,.715-l*.715+u*.715,.072+l*.928+u*.072],g=o*m[0]+s*m[1]+a*m[2],Z=o*m[3]+s*m[4]+a*m[5],y=o*m[6]+s*m[7]+a*m[8];return{r:Math.round(Math.max(0,Math.min(1,g))*255),g:Math.round(Math.max(0,Math.min(1,Z))*255),b:Math.round(Math.max(0,Math.min(1,y))*255)}}var Rt=(e,t,n,r)=>{let o=W(r,0,100)/100,s=u=>{let m=u*(1-o)+(255-u)*o;return Math.round(W(m,0,255))},a=s(e),i=s(t),l=s(n);return{r:a,g:i,b:l}},Cn=(e,t=!0)=>{if(!t)return e;let n=K?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),a=Rt(s.r,s.g,s.b,ue),i=de(a.r,a.g,a.b,pe),l=V(i.r,i.g,i.b,o);return K&&K.set(e,l),l},Ot=(e,t,n)=>{let r=ue/100,o=1-2*r,s=a=>Math.round(W((a-255*r)/o,0,255));return{r:s(e),g:s(t),b:s(n)}},Pn=e=>{let t=c(e),n=t.getAlpha(),r=t.toRgb(),o=de(r.r,r.g,r.b,pe),s=Ot(o.r,o.g,o.b);return V(s.r,s.g,s.b,n)},Lt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Dn=5,kn=5,Un=4,D=4,v=1,d={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:["#f8f9fa","#e9ecef","#ced4da","#868e96","#343a40"],red:["#fff5f5","#ffc9c9","#ff8787","#fa5252","#e03131"],pink:["#fff0f6","#fcc2d7","#f783ac","#e64980","#c2255c"],grape:["#f8f0fc","#eebefa","#da77f2","#be4bdb","#9c36b5"],violet:["#f3f0ff","#d0bfff","#9775fa","#7950f2","#6741d9"],blue:["#e7f5ff","#a5d8ff","#4dabf7","#228be6","#1971c2"],cyan:["#e3fafc","#99e9f2","#3bc9db","#15aabf","#0c8599"],teal:["#e6fcf5","#96f2d7","#38d9a9","#12b886","#099268"],green:["#ebfbee","#b2f2bb","#69db7c","#40c057","#2f9e44"],yellow:["#fff9db","#ffec99","#ffd43b","#fab005","#f08c00"],orange:["#fff4e6","#ffd8a8","#ffa94d","#fd7e14","#e8590c"],bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},fe=Lt(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Nn=5,Hn=[d.black,d.red[D],d.green[D],d.blue[D],d.yellow[D]],Gn=[d.transparent,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Bn=[d.white,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Kn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Wn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...fe},Vn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...fe},Yn=e=>[d.cyan[e],d.blue[e],d.violet[e],d.grape[e],d.pink[e],d.green[e],d.teal[e],d.yellow[e],d.orange[e],d.red[e]],V=(e,t,n,r)=>{let o=`#${(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;if(r!==void 0&&r<1){let s=Math.round(r*255).toString(16).padStart(2,"0");return`${o}${s}`}return o},$n=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return V(n,r,o,s)},he=e=>c(e).getAlpha()===0,Xn=e=>c(e).getAlpha()===1,zn=240,Ft=(e,t,n)=>(e*299+t*587+n*114)/1e3,qn=(e,t=160)=>{if(!e)return!0;if(he(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return Ft(r,o,s)<t},jn=e=>{if(e=e.trim(),he(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};p();var er=typeof window<"u"&&"ResizeObserver"in window,tr="Excalidraw",nr=36,rr=10,or=20,sr=8,ir=5,ar=1,lr=30,cr=Math.PI/12,ur="red",pr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},dr={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},fr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},It=(f=>(f.COPY="copy",f.PASTE="paste",f.CUT="cut",f.KEYDOWN="keydown",f.KEYUP="keyup",f.MOUSE_MOVE="mousemove",f.RESIZE="resize",f.UNLOAD="unload",f.FOCUS="focus",f.BLUR="blur",f.DRAG_OVER="dragover",f.DROP="drop",f.GESTURE_END="gestureend",f.BEFORE_UNLOAD="beforeunload",f.GESTURE_START="gesturestart",f.GESTURE_CHANGE="gesturechange",f.POINTER_MOVE="pointermove",f.POINTER_DOWN="pointerdown",f.POINTER_UP="pointerup",f.STATE_CHANGE="statechange",f.WHEEL="wheel",f.TOUCH_START="touchstart",f.TOUCH_END="touchend",f.HASHCHANGE="hashchange",f.VISIBILITY_CHANGE="visibilitychange",f.SCROLL="scroll",f.EXCALIDRAW_LINK="excalidraw-link",f.MENU_ITEM_SELECT="menu.itemSelect",f.MESSAGE="message",f.FULLSCREENCHANGE="fullscreenchange",f))(It||{}),hr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},k={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},mr={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name",DROPDOWN_MENU_EVENT_WRAPPER:"dropdown-menu-event-wrapper"},Er={sm:16,md:20,lg:28,xl:36},Ee="Xiaolai",L="Segoe UI Emoji",T={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},Te="sans-serif",ge="monospace",wt={[Te]:998,[ge]:999},Y={[Ee]:100,...wt,[L]:1e3};function Ct(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return ge;default:return Te}}var be=e=>{let t=Ct(e);switch(e){case T.Excalifont:return[Ee,t,L];default:return[t,L]}},Tr={LIGHT:"light",DARK:"dark"},gr="invert(93%) hue-rotate(180deg)",br={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},_r=1,Ar=20,xr=T.Excalifont,yr="left",vr="top",_e="{version}",Pt=2,Dt=2*Pt,kt=1e-5,Sr=2*Dt-kt,Mr="#ffffff",Rr="#1e1e1e",Or="#a2f1a6",Lr=["selectAll"],Fr=20,Ir=5,Ae={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Ut={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawClipboard:"application/vnd.excalidraw.clipboard+json"},me={...Ut,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Ae},wr=[me.text,me.html,...Object.values(Ae)],Cr={png:"png",svg:"svg",clipboard:"clipboard"},Pr={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Dr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,kr=500,Ur=300,Nr=500,Hr=1e4,Gr=3e4,Br=100,Kr=.1,Wr=.1,Vr=30,Yr=300,$r=6e4,Xr=3e3,zr={canvasActions:{changeViewBackgroundColor:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},qr=2,jr=[1,2,3],Zr=10,Nt=1440,Ht=100*1024*1024,Qr={maxWidthOrHeight:Nt,maxFileSizeBytes:Ht,placeholderTransitionDuration:300},Jr="http://www.w3.org/2000/svg",eo=`<?xml version="1.0" standalone="no"?>
1
+ var ze=Object.create;var Q=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Je=(e,t)=>()=>(e&&(t=e(e=0)),t);var J=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var et=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of je(t))!Qe.call(e,o)&&o!==n&&Q(e,o,{get:()=>t[o],enumerable:!(r=qe(t,o))||r.enumerable});return e};var ee=(e,t,n)=>(n=e!=null?ze(Ze(e)):{},et(t||!e||!e.__esModule?Q(n,"default",{value:e,enumerable:!0}):n,e));var h,p=Je(()=>{h={PROD:!0}});var Ce=J(($,we)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof $=="object"?we.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})($,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(i,l){this._listeners[i]=this._listeners[i]||[],this._listeners[i].indexOf(l)<0&&this._listeners[i].push(l)},e.prototype.removeEventListener=function(i,l){if(this._listeners[i]){var u=this._listeners[i].indexOf(l);u>=0&&this._listeners[i].splice(u,1)}},e.prototype.dispatchEvent=function(i){if(this._listeners[i.type]&&this._listeners[i.type].length)for(var l=this._listeners[i.type].slice(),u=0,m=l.length;u<m;++u)l[u].call(this,i)};var t=function(i){return typeof i.constructor=="function"&&i.constructor.name==="GeneratorFunction"},n=function(i){return{next:function(){var l=i();return l?{value:l}:{done:!0}}}},r=function(i){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:i})}}},o=function(i,l){var u=typeof i;if(u==="object"){if(typeof i.next=="function")return i;if(typeof i.then=="function")return r(i)}return u==="function"?t(i)?i():n(i):r(l.resolve(i))},s=function(i,l,u){this.target=i,this.type=l,this.data=u},a=function(i,l,u){if(e.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=u||{},this._options.promise=this._options.promise||Promise,this._iterator=o(i,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return a.prototype=new e,a.prototype.constructor=a,a.prototype.concurrency=function(i){return typeof i<"u"&&(this._concurrency=i,this.active()&&this._proceed()),this._concurrency},a.prototype.size=function(){return this._size},a.prototype.active=function(){return!!this._promise},a.prototype.promise=function(){return this._promise},a.prototype.start=function(){var i=this,l=this._options.promise;return this._promise=new l(function(u,m){i._callbacks={reject:m,resolve:u},i._proceed()}),this._promise},a.prototype._fireEvent=function(i,l){this.dispatchEvent(new s(this,i,l))},a.prototype._settle=function(i){i?this._callbacks.reject(i):this._callbacks.resolve(),this._promise=null,this._callbacks=null},a.prototype._onPooledPromiseFulfilled=function(i,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:i,result:l}),this._proceed())},a.prototype._onPooledPromiseRejected=function(i,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:i,error:l}),this._settle(l||new Error("Unknown error")))},a.prototype._trackPromise=function(i){var l=this;i.then(function(u){l._onPooledPromiseFulfilled(i,u)},function(u){l._onPooledPromiseRejected(i,u)}).catch(function(u){l._settle(new Error("Promise processing failed: "+u))})},a.prototype._proceed=function(){if(!this._done){for(var i={done:!1};this._size<this._concurrency&&!(i=this._iterator.next()).done;)this._size++,this._trackPromise(i.value);this._done=i===null||!!i.done}this._done&&this._size===0&&this._settle()},a.PromisePoolEvent=s,a.PromisePool=a,a})});var We=J(H=>{"use strict";p();Object.defineProperty(H,"__esModule",{value:!0});H.sanitizeUrl=void 0;var pn=/^([^\w]*)(javascript|data|vbscript)/im,dn=/&#(\w+)(^\w|;)?/g,fn=/&(newline|tab);/gi,hn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,mn=/^.+(:|&colon;)/gim,En=[".","/"];function Tn(e){return En.indexOf(e[0])>-1}function gn(e){return e.replace(dn,function(t,n){return String.fromCharCode(n)})}function bn(e){var t=gn(e||"").replace(fn,"").replace(hn,"").trim();if(!t)return"about:blank";if(Tn(t))return t;var n=t.match(mn);if(!n)return t;var r=n[0];return pn.test(r)?"about:blank":t}H.sanitizeUrl=bn});p();p();var te=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t],r=this.scoreFunction(n);for(;t>0;){let o=(t+1>>1)-1,s=this.content[o];if(r<this.scoreFunction(s))this.content[t]=s,t=o;else break}this.content[t]=n}bubbleUp(t){let n=this.content.length,r=this.content[t],o=this.scoreFunction(r);for(;;){let s=(t+1<<1)-1,a=s+1,i=t,l=o;if(s<n){let u=this.scoreFunction(this.content[s]);u<l&&(i=s,l=u)}if(a<n&&this.scoreFunction(this.content[a])<l&&(i=a),i===t)break;this.content[t]=this.content[i],t=i}this.content[t]=r}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};p();var Mn=e=>Array.isArray(e)&&e.length===4&&typeof e[0]=="number"&&typeof e[1]=="number"&&typeof e[2]=="number"&&typeof e[3]=="number";p();p();function C(e){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}var nt=/^\s+/,rt=/\s+$/;function c(e,t){if(e=e||"",t=t||{},e instanceof c)return e;if(!(this instanceof c))return new c(e,t);var n=ot(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,o,s,a,i;return n=t.r/255,r=t.g/255,o=t.b/255,n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*s+.7152*a+.0722*i},setAlpha:function(t){return this._a=le(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=re(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=re(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=ne(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ne(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return oe(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return lt(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(E(this._r,255)*100)+"%",g:Math.round(E(this._g,255)*100)+"%",b:Math.round(E(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%)":"rgba("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:_t[oe(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+se(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+se(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,o=this._a<1&&this._a>=0,s=!n&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return c(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(dt,arguments)},brighten:function(){return this._applyModification(ft,arguments)},darken:function(){return this._applyModification(ht,arguments)},desaturate:function(){return this._applyModification(ct,arguments)},saturate:function(){return this._applyModification(ut,arguments)},greyscale:function(){return this._applyModification(pt,arguments)},spin:function(){return this._applyModification(mt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(gt,arguments)},complement:function(){return this._applyCombination(Et,arguments)},monochromatic:function(){return this._applyCombination(bt,arguments)},splitcomplement:function(){return this._applyCombination(Tt,arguments)},triad:function(){return this._applyCombination(ie,[3])},tetrad:function(){return this._applyCombination(ie,[4])}};c.fromRatio=function(e,t){if(C(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=O(e[r]));e=n}return c(e,t)};function ot(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,s=null,a=!1,i=!1;return typeof e=="string"&&(e=vt(e)),C(e)=="object"&&(x(e.r)&&x(e.g)&&x(e.b)?(t=st(e.r,e.g,e.b),a=!0,i=String(e.r).substr(-1)==="%"?"prgb":"rgb"):x(e.h)&&x(e.s)&&x(e.v)?(r=O(e.s),o=O(e.v),t=at(e.h,r,o),a=!0,i="hsv"):x(e.h)&&x(e.s)&&x(e.l)&&(r=O(e.s),s=O(e.l),t=it(e.h,r,s),a=!0,i="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=le(n),{ok:a,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function st(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function ne(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,a,i=(r+o)/2;if(r==o)s=a=0;else{var l=r-o;switch(a=i>.5?l/(2-r-o):l/(r+o),r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,l:i}}function it(e,t,n){var r,o,s;e=E(e,360),t=E(t,100),n=E(n,100);function a(u,m,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?u+(m-u)*6*g:g<1/2?m:g<2/3?u+(m-u)*(2/3-g)*6:u}if(t===0)r=o=s=n;else{var i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=a(l,i,e+1/3),o=a(l,i,e),s=a(l,i,e-1/3)}return{r:r*255,g:o*255,b:s*255}}function re(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,a,i=r,l=r-o;if(a=r===0?0:l/r,r==o)s=0;else{switch(r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,v:i}}function at(e,t,n){e=E(e,360)*6,t=E(t,100),n=E(n,100);var r=Math.floor(e),o=e-r,s=n*(1-t),a=n*(1-o*t),i=n*(1-(1-o)*t),l=r%6,u=[n,a,s,s,i,n][l],m=[i,n,n,a,s,s][l],g=[s,s,i,n,n,a][l];return{r:u*255,g:m*255,b:g*255}}function oe(e,t,n,r){var o=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function lt(e,t,n,r,o){var s=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16)),A(ce(r))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function se(e,t,n,r){var o=[A(ce(r)),A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return o.join("")}c.equals=function(e,t){return!e||!t?!1:c(e).toRgbString()==c(t).toRgbString()};c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ct(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=P(n.s),c(n)}function ut(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=P(n.s),c(n)}function pt(e){return c(e).desaturate(100)}function dt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=P(n.l),c(n)}function ft(e,t){t=t===0?0:t||10;var n=c(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),c(n)}function ht(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=P(n.l),c(n)}function mt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function Et(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function ie(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=c(e).toHsl(),r=[c(e)],o=360/t,s=1;s<t;s++)r.push(c({h:(n.h+s*o)%360,s:n.s,l:n.l}));return r}function Tt(e){var t=c(e).toHsl(),n=t.h;return[c(e),c({h:(n+72)%360,s:t.s,l:t.l}),c({h:(n+216)%360,s:t.s,l:t.l})]}function gt(e,t,n){t=t||6,n=n||30;var r=c(e).toHsl(),o=360/n,s=[c(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,s.push(c(r));return s}function bt(e,t){t=t||6;for(var n=c(e).toHsv(),r=n.h,o=n.s,s=n.v,a=[],i=1/t;t--;)a.push(c({h:r,s:o,v:s})),s=(s+i)%1;return a}c.mix=function(e,t,n){n=n===0?0:n||50;var r=c(e).toRgb(),o=c(t).toRgb(),s=n/100,a={r:(o.r-r.r)*s+r.r,g:(o.g-r.g)*s+r.g,b:(o.b-r.b)*s+r.b,a:(o.a-r.a)*s+r.a};return c(a)};c.readability=function(e,t){var n=c(e),r=c(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};c.isReadable=function(e,t,n){var r=c.readability(e,t),o,s;switch(s=!1,o=St(n),o.level+o.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};c.mostReadable=function(e,t,n){var r=null,o=0,s,a,i,l;n=n||{},a=n.includeFallbackColors,i=n.level,l=n.size;for(var u=0;u<t.length;u++)s=c.readability(e,t[u]),s>o&&(o=s,r=c(t[u]));return c.isReadable(e,r,{level:i,size:l})||!a?r:(n.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],n))};var B=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_t=c.hexNames=At(B);function At(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function le(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function E(e,t){xt(e)&&(e="100%");var n=yt(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function P(e){return Math.min(1,Math.max(0,e))}function b(e){return parseInt(e,16)}function xt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function yt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function A(e){return e.length==1?"0"+e:""+e}function O(e){return e<=1&&(e=e*100+"%"),e}function ce(e){return Math.round(parseFloat(e)*255).toString(16)}function ae(e){return b(e)/255}var _=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function x(e){return!!_.CSS_UNIT.exec(e)}function vt(e){e=e.replace(nt,"").replace(rt,"").toLowerCase();var t=!1;if(B[e])e=B[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=_.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=_.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=_.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=_.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=_.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=_.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=_.hex8.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),a:ae(n[4]),format:t?"name":"hex8"}:(n=_.hex6.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),format:t?"name":"hex"}:(n=_.hex4.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),a:ae(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=_.hex3.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function St(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}import{clamp as W}from"@excalidraw/math";import{degreesToRadians as Mt}from"@excalidraw/math";var K=typeof window<"u"?new Map:null,ue=93,pe=180;function de(e,t,n,r){let o=e/255,s=t/255,a=n/255,i=Mt(r),l=Math.cos(i),u=Math.sin(i),m=[.213+l*.787-u*.213,.715-l*.715-u*.715,.072-l*.072+u*.928,.213-l*.213+u*.143,.715+l*.285+u*.14,.072-l*.072-u*.283,.213-l*.213-u*.787,.715-l*.715+u*.715,.072+l*.928+u*.072],g=o*m[0]+s*m[1]+a*m[2],Z=o*m[3]+s*m[4]+a*m[5],y=o*m[6]+s*m[7]+a*m[8];return{r:Math.round(Math.max(0,Math.min(1,g))*255),g:Math.round(Math.max(0,Math.min(1,Z))*255),b:Math.round(Math.max(0,Math.min(1,y))*255)}}var Rt=(e,t,n,r)=>{let o=W(r,0,100)/100,s=u=>{let m=u*(1-o)+(255-u)*o;return Math.round(W(m,0,255))},a=s(e),i=s(t),l=s(n);return{r:a,g:i,b:l}},Pn=(e,t=!0)=>{if(!t)return e;let n=K?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),a=Rt(s.r,s.g,s.b,ue),i=de(a.r,a.g,a.b,pe),l=V(i.r,i.g,i.b,o);return K&&K.set(e,l),l},Ot=(e,t,n)=>{let r=ue/100,o=1-2*r,s=a=>Math.round(W((a-255*r)/o,0,255));return{r:s(e),g:s(t),b:s(n)}},Dn=e=>{let t=c(e),n=t.getAlpha(),r=t.toRgb(),o=de(r.r,r.g,r.b,pe),s=Ot(o.r,o.g,o.b);return V(s.r,s.g,s.b,n)},Lt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),kn=5,Un=5,Nn=4,D=4,v=1,d={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:["#f8f9fa","#e9ecef","#ced4da","#868e96","#343a40"],red:["#fff5f5","#ffc9c9","#ff8787","#fa5252","#e03131"],pink:["#fff0f6","#fcc2d7","#f783ac","#e64980","#c2255c"],grape:["#f8f0fc","#eebefa","#da77f2","#be4bdb","#9c36b5"],violet:["#f3f0ff","#d0bfff","#9775fa","#7950f2","#6741d9"],blue:["#e7f5ff","#a5d8ff","#4dabf7","#228be6","#1971c2"],cyan:["#e3fafc","#99e9f2","#3bc9db","#15aabf","#0c8599"],teal:["#e6fcf5","#96f2d7","#38d9a9","#12b886","#099268"],green:["#ebfbee","#b2f2bb","#69db7c","#40c057","#2f9e44"],yellow:["#fff9db","#ffec99","#ffd43b","#fab005","#f08c00"],orange:["#fff4e6","#ffd8a8","#ffa94d","#fd7e14","#e8590c"],bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},fe=Lt(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Hn=5,Gn=[d.black,d.red[D],d.green[D],d.blue[D],d.yellow[D]],Bn=[d.transparent,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Kn=[d.white,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Wn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Vn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...fe},Yn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...fe},$n=e=>[d.cyan[e],d.blue[e],d.violet[e],d.grape[e],d.pink[e],d.green[e],d.teal[e],d.yellow[e],d.orange[e],d.red[e]],V=(e,t,n,r)=>{let o=`#${(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;if(r!==void 0&&r<1){let s=Math.round(r*255).toString(16).padStart(2,"0");return`${o}${s}`}return o},Xn=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return V(n,r,o,s)},he=e=>c(e).getAlpha()===0,zn=e=>c(e).getAlpha()===1,qn=240,Ft=(e,t,n)=>(e*299+t*587+n*114)/1e3,jn=(e,t=160)=>{if(!e)return!0;if(he(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return Ft(r,o,s)<t},Zn=e=>{if(e=e.trim(),he(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};p();var tr=typeof window<"u"&&"ResizeObserver"in window,nr="Excalidraw",rr=36,or=10,sr=20,ir=8,ar=5,lr=1,cr=30,ur=Math.PI/12,pr="red",dr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},fr={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},hr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},It=(f=>(f.COPY="copy",f.PASTE="paste",f.CUT="cut",f.KEYDOWN="keydown",f.KEYUP="keyup",f.MOUSE_MOVE="mousemove",f.RESIZE="resize",f.UNLOAD="unload",f.FOCUS="focus",f.BLUR="blur",f.DRAG_OVER="dragover",f.DROP="drop",f.GESTURE_END="gestureend",f.BEFORE_UNLOAD="beforeunload",f.GESTURE_START="gesturestart",f.GESTURE_CHANGE="gesturechange",f.POINTER_MOVE="pointermove",f.POINTER_DOWN="pointerdown",f.POINTER_UP="pointerup",f.STATE_CHANGE="statechange",f.WHEEL="wheel",f.TOUCH_START="touchstart",f.TOUCH_END="touchend",f.HASHCHANGE="hashchange",f.VISIBILITY_CHANGE="visibilitychange",f.SCROLL="scroll",f.EXCALIDRAW_LINK="excalidraw-link",f.MENU_ITEM_SELECT="menu.itemSelect",f.MESSAGE="message",f.FULLSCREENCHANGE="fullscreenchange",f))(It||{}),mr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},k={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},Er={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name",DROPDOWN_MENU_EVENT_WRAPPER:"dropdown-menu-event-wrapper"},Tr={sm:16,md:20,lg:28,xl:36},Ee="Xiaolai",L="Segoe UI Emoji",T={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},Te="sans-serif",ge="monospace",wt={[Te]:998,[ge]:999},Y={[Ee]:100,...wt,[L]:1e3};function Ct(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return ge;default:return Te}}var be=e=>{let t=Ct(e);switch(e){case T.Excalifont:return[Ee,t,L];default:return[t,L]}},gr={LIGHT:"light",DARK:"dark"},br="invert(93%) hue-rotate(180deg)",_r={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},Ar=1,xr=20,yr=T.Excalifont,vr="left",Sr="top",_e="{version}",Pt=2,Dt=2*Pt,kt=1e-5,Mr=2*Dt-kt,Rr="#ffffff",Or="#1e1e1e",Lr="#a2f1a6",Fr=["selectAll"],Ir=20,wr=5,Ae={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Ut={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawClipboard:"application/vnd.excalidraw.clipboard+json"},me={...Ut,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Ae},Cr=[me.text,me.html,...Object.values(Ae)],Pr={png:"png",svg:"svg",clipboard:"clipboard"},Dr={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},kr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Ur=500,Nr=300,Hr=500,Gr=1e4,Br=3e4,Kr=100,Wr=.1,Vr=.1,Yr=30,$r=300,Xr=6e4,zr=3e3,qr={canvasActions:{changeViewBackgroundColor:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},jr=2,Zr=[1,2,3],Qr=10,Nt=1440,Ht=300*1024*1024,Gt=25*1024*1024,Jr={maxWidthOrHeight:Nt,maxFileSizeBytes:Ht,gifAutoDecodeMaxFileSizeBytes:Gt,placeholderTransitionDuration:300},eo="http://www.w3.org/2000/svg",to=`<?xml version="1.0" standalone="no"?>
2
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- `,to=128,no={excalidraw:2},ro=5,oo=.7,so=11,io={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},ao={LEFT:"left",CENTER:"center",RIGHT:"right"},lo=20,co=70,uo=.25,po=32,fo={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Gt={architect:0,artist:1,cartoonist:2},ho=["thin","medium","bold"],xe={thin:1,medium:2,bold:4,extraBold:8},Bt={thin:.5,medium:1,bold:2,extraBold:4},mo=(e,t)=>e==="freedraw"?Bt[t]:xe[t],Kt="medium",Eo={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:xe[Kt],strokeStyle:"solid",roughness:Gt.artist,opacity:100,locked:!1},Wt="search",To={name:"default",defaultTab:Wt},go={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser",autoshape:"autoshape",bucketfill:"bucketfill"},bo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw"},_o="Untitled",Ao={generalStats:1,elementProperties:2},xo=1,yo={sharp:"sharp",round:"round",elbow:"elbow"},vo=.3,So="element",Mo=Symbol.for("__test__originalId__"),Vt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Vt||{}),Ro=20,Oo=35,Lo=700,Fo={background:"var(--mobile-action-button-bg)"},Io=.5,wo=.2;p();var U={[T.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[T.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[T["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[T["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[T.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[T.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[T.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[T["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[T.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[Y.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[Y["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},ko={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Uo="local:",No=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=U[e]?.metrics||U[T.Excalifont].metrics,a=t/r,i=(n-a*o+a*s)/2;return a*o+i},Ho=e=>{let{lineHeight:t}=U[e]?.metrics||U[T.Excalifont].metrics;return t};p();var ye=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Se(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=ve();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var Me="excalidraw.desktopUIMode",Yo=599,$o=1e3,Xo=500,zo=600,qo=1180,jo=1440,Zo=1229,Re=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Qo=/^Win/.test(navigator.platform),Oe=/\b(android)\b/i.test(navigator.userAgent),Jo=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Yt=navigator.userAgent.indexOf("Chrome")!==-1,es=!Yt&&navigator.userAgent.indexOf("Safari")!==-1,Le=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,ts=()=>navigator.brave?.isBrave?.name==="isBrave",$t=(e,t)=>e<=599||t<500&&e<1e3,Xt=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},zt=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let o=(n.platform||"").toLowerCase(),s=o==="windows"||o==="macos"||o==="linux"||o==="chrome os";if(n.mobile===!0)return!0;if(n.mobile===!1&&o==="android")return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches;if(s)return!1}if(Le)return!0;if(Oe){let o=/Mobile/i.test(e);if(o||!o)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1},ns=(e,t)=>$t(e,t)?"phone":Xt(e,t)?"tablet":"desktop",rs=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,os=e=>{let t=e??"",n="unknown";return Le?n="ios":Oe?n="android":t&&(n="other"),{isMobileDevice:zt(),platform:n}},ss=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Me);if(e==="compact"||e==="full")return e}catch{}return null},qt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Me,e)}catch{}},is=e=>{if(!(e!=="compact"&&e!=="full"))return qt(e),e};var Fe={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},M={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Re?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},jt=new Map([[M.Z,Fe.Z],[M.Y,Fe.Y]]),Zt=e=>/^[a-z]$/.test(e.toLowerCase()),us=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=jt.get(t);return!!(n&&!Zt(e.key)&&e.code===n)},ps=e=>e===M.ARROW_LEFT||e===M.ARROW_RIGHT||e===M.ARROW_DOWN||e===M.ARROW_UP,ds=e=>e.altKey,fs=e=>e.shiftKey,hs=e=>e.shiftKey;p();import{pointFrom as Ie,pointFromPair as Qt}from"@excalidraw/math";var gs=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},bs=(e,t,n,r)=>{let o=n.map(y=>y[e]),s=Math.max(...o),a=Math.min(...o),i=s-a,l=i===0?1:t/i,u=1/0,m=n.map(y=>{let S=y[e]*l,w=[...y];return w[e]=S,S<u&&(u=S),w});if(!r||m.length===2)return m;let g=a-u;return m.map(y=>Qt(y.map((S,w)=>w===e?S+g:S)))},_s=(e,t,n)=>n?Ie(Math.round(e/n)*n,Math.round(t/n)*n):Ie(e,t);p();var De=ee(Ce(),1),Pe=class{pool;entries={};constructor(t,n){this.pool=new De.default(t,n)}all(){let t=n=>{if(n.data.result){let[r,o]=n.data.result;this.entries[r]=o}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};p();p();p();var ke=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");p();var F=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};p();import{average as N}from"@excalidraw/math";var X=null,ks=e=>{X=e},Us=()=>{if(X)return X;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),o=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${s}`},Ns=e=>e.charAt(0).toUpperCase()+e.slice(1),Hs=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),Jt=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Gs=e=>Jt(e)||e instanceof Element&&!!e.closest("label, button"),Bs=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search")||e instanceof HTMLElement&&e.closest(".cm-editor")!==null,en=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${be(n).map(r=>`, ${r}`).join("")}`;return L},Ks=({fontSize:e,fontFamily:t})=>`${e}px ${en({fontFamily:t})}`,Ws=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Vs=(e,t)=>{let n=0,r=null,o=(...s)=>{r=s,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...s)},t)};return o.flush=()=>{if(clearTimeout(n),r){let s=r;r=null,e(...s)}},o.cancel=()=>{r=null,clearTimeout(n)},o},Ys=e=>{let t=null,n=null,r=()=>{t=window.requestAnimationFrame(()=>{t=null;let s=n;n=null,s&&e(...s)})},o=(...s)=>{n=s,t===null&&r()};return o.flush=()=>{t!==null&&(cancelAnimationFrame(t),t=null),n&&(e(...n),n=null)},o.cancel=()=>{n=null,t!==null&&(cancelAnimationFrame(t),t=null)},o},$s=e=>1-Math.pow(1-e,4),Xs=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,o=Array(Math.ceil(e.length/t));for(;n<e.length;)o[r++]=e.slice(n,n+=t);return o},zs=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},qs=()=>{let e=window.getSelection();e&&e.removeAllRanges()},js=(e,t)=>Math.abs(e-t),Zs=e=>e==="selection"||e==="lasso",Qs=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveTool===void 0?e.activeTool.lastActiveTool:t.lastActiveTool,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},Js=()=>document.fullscreenElement?.nodeName==="HTML",ei=()=>document.documentElement.requestFullscreen(),ti=()=>document.exitFullscreen(),ni=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:a})=>{let i=(e-r)/n.value-s,l=(t-o)/n.value-a;return{x:i,y:l}},ri=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:a})=>{let i=(e+s)*n.value+r,l=(t+a)*n.value+o;return{x:i,y:l}},oi=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),tn="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",nn="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",rn=new RegExp(`^[^${tn}]*[${nn}]`),si=e=>rn.test(e),ii=e=>{let[t,n]=e;return{x:t,y:n}},ai=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},li=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},ci=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},ui=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},ve=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},pi=(e,t)=>{let n=[{value:1,symbol:"b"},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"}],r=/\.0+$|(\.[0-9]*[1-9])0+$/,o;for(o=n.length-1;o>0&&!(e>=n[o].value);o--);return(e/n[o].value).toFixed(t).replace(r,"$1")+n[o].symbol},di=()=>document.querySelector('meta[name="version"]')?.content||_e,fi=()=>{let t=document.createElement("canvas").getContext("2d");if(!t)return!1;let n=12;return t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("\u{1F600}",0,0),t.getImageData(n,n,1,1).data[0]!==0},hi=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},mi=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},Ei=e=>{e.preventDefault(),e.returnValue=""},Ti=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),gi=()=>q()?1:Date.now(),bi=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),_i=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Ai=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),xi=e=>e.reduce((t,n,r)=>{let o={...n,prev:null,next:null};if(r!==0){let s=t[r-1];if(o.prev=s,s.next=o,r===e.length-1){let a=t[0];o.next=a,a.prev=o}}return t.push(o),t},[]),on=e=>Array.isArray(e)?e:e.values(),yi=e=>Array.isArray(e)?e:Array.from(on(e)),q=()=>h.MODE===k.TEST,vi=()=>h.MODE===k.DEVELOPMENT,Ne=()=>h.MODE===k.PRODUCTION,Si=()=>typeof process<"u"&&!0,Mi=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Ri=(e,t)=>{let n=!1;for(let r in t){let o=t[r];if(typeof o<"u"){if(e[r]===o&&(typeof o!="object"||o===null))continue;n=!0}}return n?{...e,...t}:e},Oi=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},sn=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},Li=()=>sn()==="iframe",Fi=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Ii=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},Ue=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,an=(e,t,n,r=!1)=>{let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let a of n)if(!(e[a]===t[a]||Ue(e[a],t[a])))return r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),!1;return!0}return o.every(a=>{let i=n?.[a],l=i?i(e[a],t[a]):e[a]===t[a]||Ue(e[a],t[a]);return!l&&r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),l})},wi=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},Ci=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Pi(e,t){if(!e)throw new Error(t)}var Di=e=>{let t,n,r=function(o){let s=Object.entries(o);if(t){let i=!0;for(let[l,u]of s)if(t.get(l)!==u){i=!1;break}if(i)return n}let a=e(o);return t=new Map(s),n=a,a};return r.clear=()=>{t=void 0,n=void 0},r},ki=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Ui=e=>JSON.parse(JSON.stringify(e)),Ni=(e,t)=>an(e,t)?e:t;function Hi(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function Gi(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],o=e[1],s=e[2],a=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${o[0].toFixed(2)},${o[1].toFixed(2)} ${N(o[0],s[0]).toFixed(2)},${N(o[1],s[1]).toFixed(2)} T`;for(let i=2,l=n-1;i<l;i++)r=e[i],o=e[i+1],a+=`${N(r[0],o[0]).toFixed(2)},${N(r[1],o[1]).toFixed(2)} `;return t&&(a+="Z"),a}var Bi=e=>e.replace(/\r?\n|\r/g,`
4
- `);function Ki(e){return e}var Se=async(e,...t)=>new Promise(n=>{n(e(...t))}),Wi=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Vi=e=>{try{return JSON.parse(e)}catch{return null}},He=e=>e.replace(/"/g,"&quot;"),Yi=e=>Array.isArray(e)?e:[e],ln=e=>Array.isArray(e),cn=e=>ln(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,$i=(e,t)=>{if(cn(e)===0)return null;let n=t||(o=>o),r=null;for(let o of e){let s=n(o);if((r===null||r===s)&&s!=null)r=s;else return null}return r},Ge="excalidraw-feature-flags",z={COMPLEX_BINDINGS:!1},R=null,Xi=e=>{if(!R)try{let t=localStorage.getItem(Ge);t&&(R=JSON.parse(t)??z)}catch{}return(R||z)[e]},zi=(e,t)=>{try{R={...R||z,[e]:t},localStorage.setItem(Ge,JSON.stringify(R))}catch(n){console.error("unable to set feature flag",n)}},qi=(e,t)=>t.includes(e);var Be=new F(Date.now()),Ke=0,ta=()=>Math.floor(Be.next()*2**31),na=e=>{Be=new F(e),Ke=0},ra=()=>q()?`id${Ke++}`:ke();p();var Ve=ee(We(),1);var bn=e=>(e=e.trim(),e&&(0,Ve.sanitizeUrl)(He(e))),ca=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),ua=e=>{if(e=bn(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var G=class{subscribers=[];on(...t){let n=t.flat().filter(r=>typeof r=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(o=>typeof o=="function");n.push(()=>r());let r=this.on(...n);return r}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(r=>!n.includes(r))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};p();var Ye=class{constructor(t){this.behavior=t}emitters=new Map;lastPayload=new Map;emittedOnce=new Set;getEmitter(t){let n=this.emitters.get(t);return n||(n=new G,this.emitters.set(t,n)),n}toPromiseValue(t){return t.length===1?t[0]:t}on(t,n){let r=this.behavior[t],o=this.lastPayload.get(t);if(n)return r.replay==="last"&&o&&(queueMicrotask(()=>n(...o)),r.cardinality==="once")?()=>{}:this.getEmitter(t).on(n);if(r.cardinality!=="once"||r.replay!=="last")throw new Error(`Event "${String(t)}" requires a callback`);return o?Promise.resolve(this.toPromiseValue(o)):new Promise(s=>{this.getEmitter(t).once((...a)=>{s(this.toPromiseValue(a))})})}emit(t,...n){let r=this.behavior[t];if(!Ne()&&r.cardinality==="once"){if(this.emittedOnce.has(t))throw new Error(`Event "${String(t)}" can only be emitted once`);this.emittedOnce.add(t)}r.replay==="last"&&this.lastPayload.set(t,n);try{this.getEmitter(t).trigger(...n)}finally{r.cardinality==="once"&&this.getEmitter(t).clear()}}clear(){this.lastPayload.clear(),this.emittedOnce.clear();for(let t of this.emitters.values())t.clear();this.emitters.clear()}};p();var $e=class{constructor(t,n=Object.is){this.isEqual=n;this.value=t}version=0;value;waiters=new Set;subscribers=new Set;getSnapshot(){return{version:this.version,value:this.value}}set(t){if(this.isEqual(this.value,t))return!1;this.value=t,this.version+=1;let n=this.getSnapshot();for(let r of this.subscribers)r(n);for(let r of this.waiters)r(n);return this.waiters.clear(),!0}update(t){return this.set(t(this.value))}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}pull(t=-1){return this.version!==t?Promise.resolve(this.getSnapshot()):new Promise(n=>{this.waiters.add(n)})}};p();var I=(e,t=5)=>parseFloat(e.toPrecision(t)),_n=e=>I(e.reduce((t,n)=>t+n)/e.length),j=class e{static DEBUG_LOG_TIMES=!0;static TIMES_AGGR={};static TIMES_AVG={};static LAST_DEBUG_LOG_CALL=0;static DEBUG_LOG_INTERVAL_ID=null;static LAST_FRAME_TIMESTAMP=0;static FRAME_COUNT=0;static ANIMATION_FRAME_ID=null;static scheduleAnimationFrame=()=>{e.DEBUG_LOG_INTERVAL_ID!==null&&(e.ANIMATION_FRAME_ID=requestAnimationFrame(t=>{e.LAST_FRAME_TIMESTAMP!==t&&(e.LAST_FRAME_TIMESTAMP=t,e.FRAME_COUNT++),e.DEBUG_LOG_INTERVAL_ID!==null&&e.scheduleAnimationFrame()}))};static setupInterval=()=>{e.DEBUG_LOG_INTERVAL_ID===null&&(console.info("%c(starting perf recording)","color: lime"),e.DEBUG_LOG_INTERVAL_ID=window.setInterval(e.debugLogger,1e3),e.scheduleAnimationFrame()),e.LAST_DEBUG_LOG_CALL=Date.now()};static debugLogger=()=>{if(e.DEBUG_LOG_TIMES){for(let[t,{t:n,times:r}]of Object.entries(e.TIMES_AGGR))r.length&&(console.info(t,I(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>I(o))),e.TIMES_AGGR[t]={t:n,times:[]});for(let[t,{t:n,times:r,avg:o}]of Object.entries(e.TIMES_AVG))if(r.length){let s=r.reduce((i,l)=>i+l),a=I(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${a}ms/frame across ${e.FRAME_COUNT} frames (${I(a/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?_n([o,a]):a}}}e.FRAME_COUNT=0,Date.now()-e.LAST_DEBUG_LOG_CALL>600&&e.DEBUG_LOG_INTERVAL_ID!==null&&(console.info("%c(stopping perf recording)","color: red"),window.clearInterval(e.DEBUG_LOG_INTERVAL_ID),window.cancelAnimationFrame(e.ANIMATION_FRAME_ID),e.ANIMATION_FRAME_ID=null,e.FRAME_COUNT=0,e.LAST_FRAME_TIMESTAMP=0,e.DEBUG_LOG_INTERVAL_ID=null,e.TIMES_AGGR={},e.TIMES_AVG={})};static logTime=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AGGR[n]=e.TIMES_AGGR[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AGGR[n].t=r};static logTimeAverage=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AVG[n]=e.TIMES_AVG[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AVG[n].t=r};static logWrapper=t=>(n,r="default")=>(...o)=>{let s=performance.now(),a=n(...o);return e[t](performance.now()-s,r),a};static logTimeWrap=e.logWrapper("logTime");static logTimeAverageWrap=e.logWrapper("logTimeAverage");static perfWrap=(t,n="default")=>(...r)=>{console.time(n);let o=t(...r);return console.timeEnd(n),o};static CHANGED_CACHE={};static logChanged(t,n){let r=e.CHANGED_CACHE[t];if(e.CHANGED_CACHE[t]=n,!r)return;let o=new Set([...Object.keys(r),...Object.keys(n)]),s={};for(let a of o){let i=r[a],l=n[a];Xe(i,l)||(s[a]={prev:i,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function Xe(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object"||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!Xe(e[o],t[o]))return!1;return!0}export{Xr as ACTIVE_THRESHOLD,wr as ALLOWED_PASTE_MIME_TYPES,tr as APP_NAME,so as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,oo as ARROW_LABEL_WIDTH_FRACTION,yo as ARROW_TYPE,Ye as AppEventBus,Lo as BIND_MODE_TIMEOUT,ro as BOUND_TEXT_PADDING,Bn as BUCKET_FILL_BACKGROUND_PICKS,te as BinaryHeap,Lr as CANVAS_ONLY_ACTIONS,Wt as CANVAS_SEARCH_TAB,Ee as CJK_HAND_DRAWN_FALLBACK_FONT,mr as CLASSES,Fe as CODES,kn as COLORS_PER_ROW,Rr as COLOR_CHARCOAL_BLACK,zn as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,Nn as COLOR_TOP_PICKS_SLOTS,Or as COLOR_VOICE_CALL,Mr as COLOR_WHITE,pr as CURSOR_TYPE,gr as DARK_THEME_FILTER,po as DEFAULT_ADAPTIVE_RADIUS,Kn as DEFAULT_CANVAS_BACKGROUND_PICKS,Un as DEFAULT_CHART_COLOR_INDEX,Sr as DEFAULT_COLLISION_THRESHOLD,v as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Vn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Gn as DEFAULT_ELEMENT_BACKGROUND_PICKS,Eo as DEFAULT_ELEMENT_PROPS,D as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Wn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Hn as DEFAULT_ELEMENT_STROKE_PICKS,Kt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Zr as DEFAULT_EXPORT_PADDING,_o as DEFAULT_FILENAME,xr as DEFAULT_FONT_FAMILY,Ar as DEFAULT_FONT_SIZE,Fr as DEFAULT_GRID_SIZE,Ir as DEFAULT_GRID_STEP,Qr as DEFAULT_IMAGE_OPTIONS,ur as DEFAULT_LASER_COLOR,Nt as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,uo as DEFAULT_PROPORTIONAL_RADIUS,vo as DEFAULT_REDUCED_GLOBAL_ALPHA,To as DEFAULT_SIDEBAR,Io as DEFAULT_STROKE_STREAMLINE,wo as DEFAULT_STROKE_STREAMLINE_PRECISE,yr as DEFAULT_TEXT_ALIGN,Pt as DEFAULT_TRANSFORM_HANDLE_SPACING,zr as DEFAULT_UI_OPTIONS,_e as DEFAULT_VERSION,vr as DEFAULT_VERTICAL_ALIGN,Oo as DOUBLE_TAP_POSITION_THRESHOLD,rr as DRAGGING_THRESHOLD,j as Debug,bo as EDITOR_LS_KEYS,So as ELEMENT_LINK_KEY,co as ELEMENT_PENDING_DRAW_SHAPE_OPACITY,lo as ELEMENT_READY_TO_ERASE_OPACITY,ir as ELEMENT_SHIFT_TRANSLATE_AMOUNT,ar as ELEMENT_TRANSLATE_AMOUNT,to as ENCRYPTION_KEY_BITS,k as ENV,kt as EPSILON,It as EVENT,Pr as EXPORT_DATA_TYPES,Cr as EXPORT_IMAGE_TYPES,jr as EXPORT_SCALES,G as Emitter,T as FONT_FAMILY,Y as FONT_FAMILY_FALLBACKS,wt as FONT_FAMILY_GENERIC_FALLBACKS,U as FONT_METADATA,Er as FONT_SIZES,br as FRAME_STYLE,Bt as FREEDRAW_STROKE_WIDTH,ko as GOOGLE_FONTS_RANGES,Yr as HYPERLINK_TOOLTIP_DELAY,$r as IDLE_THRESHOLD,Ae as IMAGE_MIME_TYPES,kr as IMAGE_RENDER_TIMEOUT,M as KEYS,jt as KeyCodeMap,sr as LINE_CONFIRM_THRESHOLD,Ro as LINE_POLYGON_POINT_MERGE_DISTANCE,Uo as LOCAL_FONT_PROTOCOL,Ht as MAX_ALLOWED_FILE_BYTES,Dn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,qr as MAX_DECIMALS_FOR_SVG_EXPORT,Vr as MAX_ZOOM,me as MIME_TYPES,or as MINIMUM_ARROW_SIZE,_r as MIN_FONT_SIZE,xo as MIN_WIDTH_OR_HEIGHT,Wr as MIN_ZOOM,Fo as MOBILE_ACTION_BUTTON_BG,ge as MONOSPACE_GENERIC_FONT,Xo as MQ_MAX_HEIGHT_LANDSCAPE,Yo as MQ_MAX_MOBILE,qo as MQ_MAX_TABLET,$o as MQ_MAX_WIDTH_LANDSCAPE,zo as MQ_MIN_TABLET,jo as MQ_MIN_WIDTH_DESKTOP,Zo as MQ_RIGHT_SIDEBAR_MIN_WIDTH,Mo as ORIG_ID,dr as POINTER_BUTTON,fr as POINTER_EVENTS,Pe as PromisePool,ye as Queue,Gt as ROUGHNESS,fo as ROUNDNESS,Te as SANS_SERIF_GENERIC_FONT,Br as SCROLL_TIMEOUT,cr as SHIFT_LOCKING_ANGLE,Dt as SIDE_RESIZING_THRESHOLD,Ao as STATS_PANELS,Ut as STRING_MIME_TYPES,xe as STROKE_WIDTH,ho as STROKE_WIDTH_KEYS,eo as SVG_DOCUMENT_PREAMBLE,Jr as SVG_NS,Ur as TAP_TWICE_TIMEOUT,ao as TEXT_ALIGN,nr as TEXT_AUTOWRAP_THRESHOLD,lr as TEXT_TO_CENTER_SNAP_THRESHOLD,Tr as THEME,Hr as TITLE_TIMEOUT,go as TOOL_TYPE,Nr as TOUCH_CTX_MENU_TIMEOUT,Vt as UserIdleState,no as VERSIONS,Gr as VERSION_TIMEOUT,io as VERTICAL_ALIGN,$e as VersionedSnapshotStore,L as WINDOWS_EMOJI_FALLBACK_FONT,hr as YOUTUBE_STATES,Kr as ZOOM_STEP,Hi as addEventListener,ei as allowFullScreen,Cn as applyDarkModeFilter,xi as arrayToList,bi as arrayToMap,_i as arrayToMapWithIndex,Ai as arrayToObject,Ci as assertNever,Ti as bytesToHexString,Ns as capitalizeString,Yi as castArray,Xs as chunk,Ui as cloneJSON,$n as colorToHex,wi as composeEventHandlers,os as createUserAgentDescriptor,Vs as debounce,rs as deriveStylesPanelMode,js as distance,$s as easeOut,He as escapeDoubleQuotes,ti as exitFullScreen,li as findIndex,ci as findLastIndex,mi as focusNearestParent,Yn as getAllColorsSpecificShade,Us as getDateTime,Dr as getExportSource,Xi as getFeatureFlag,be as getFontFamilyFallbacks,en as getFontFamilyString,Ks as getFontString,ns as getFormFactor,sn as getFrame,Ct as getGenericFontFamilyFallback,oi as getGlobalCSSVariable,_s as getGridPoint,Ho as getLineHeight,hi as getNearestScrollableContainer,gs as getSizeFromPoints,mo as getStrokeWidthByKey,Gi as getSvgPathFromStroke,gi as getUpdatedTimestamp,di as getVersion,No as getVerticalOffset,Pi as invariant,Oe as isAndroid,Wi as isAnyTrue,ps as isArrowKey,Sn as isBounds,ts as isBrave,Yt as isChrome,qn as isColorDark,Re as isDarwin,vi as isDevEnv,Jo as isFirefox,Js as isFullScreen,Le as isIOS,Jt as isInputLike,Gs as isInteractive,Zt as isLatinChar,ca as isLocalLink,ki as isMemberOf,$t as isMobileBreakpoint,Xn as isOpaqueColor,Oi as isPrimitive,Ne as isProdEnv,Fi as isPromiseLike,si as isRTL,ln as isReadonlyArray,Li as isRunningInIframe,es as isSafari,Zs as isSelectionLikeTool,Si as isServerEnv,an as isShallowEqual,Xt as isTabletBreakpoint,q as isTestEnv,Hs as isToolIcon,he as isTransparent,Qo as isWindows,Bs as isWritableElement,ss as loadDesktopUIModePreference,ui as mapFind,us as matchKey,Di as memoize,ai as muteFSAbortError,pi as nFormatter,Ws as nextAnimationFrame,Bi as normalizeEOL,jn as normalizeInputColor,bn as normalizeLink,qi as oneOf,Ei as preventUnload,Se as promiseTry,Ii as queryFocusableElements,ra as randomId,ta as randomInteger,$i as reduceToCommonValue,Pn as removeDarkModeFilter,qs as removeSelection,bs as rescalePoints,na as reseed,ve as resolvablePromise,V as rgbToHex,Vi as safelyParseJSON,ri as sceneCoordsToViewportCoords,zs as selectNode,ks as setDateTimeForTests,is as setDesktopUIMode,zi as setFeatureFlag,fs as shouldMaintainAspectRatio,ds as shouldResizeFromCenter,hs as shouldRotateWithDiscreteAngle,cn as sizeOf,fi as supportsEmoji,er as supportsResizeObserver,Ys as throttleRAF,yi as toArray,Ki as toBrandedType,on as toIterable,ua as toValidURL,ii as tupleToCoors,Qs as updateActiveTool,Ri as updateObject,Ni as updateStable,ni as viewportCoordsToSceneCoords,Mi as wrapEvent};
3
+ `,no=128,ro={excalidraw:2},oo=5,so=.7,io=11,ao={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},lo={LEFT:"left",CENTER:"center",RIGHT:"right"},co=20,uo=70,po=.25,fo=32,ho={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Bt={architect:0,artist:1,cartoonist:2},mo=["thin","medium","bold"],xe={thin:1,medium:2,bold:4,extraBold:8},Kt={thin:.5,medium:1,bold:2,extraBold:4},Eo=(e,t)=>e==="freedraw"?Kt[t]:xe[t],Wt="medium",To={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:xe[Wt],strokeStyle:"solid",roughness:Bt.artist,opacity:100,locked:!1},Vt="search",go={name:"default",defaultTab:Vt},bo={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser",autoshape:"autoshape",bucketfill:"bucketfill"},_o={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw"},Ao="Untitled",xo={generalStats:1,elementProperties:2},yo=1,vo={sharp:"sharp",round:"round",elbow:"elbow"},So=.3,Mo="element",Ro=Symbol.for("__test__originalId__"),Yt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Yt||{}),Oo=20,Lo=35,Fo=700,Io={background:"var(--mobile-action-button-bg)"},wo=.5,Co=.2;p();var U={[T.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[T.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[T["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[T["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[T.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[T.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[T.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[T["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[T.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[Y.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[Y["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Uo={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},No="local:",Ho=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=U[e]?.metrics||U[T.Excalifont].metrics,a=t/r,i=(n-a*o+a*s)/2;return a*o+i},Go=e=>{let{lineHeight:t}=U[e]?.metrics||U[T.Excalifont].metrics;return t};p();var ye=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Se(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=ve();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var Me="excalidraw.desktopUIMode",$o=599,Xo=1e3,zo=500,qo=600,jo=1180,Zo=1440,Qo=1229,Re=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Jo=/^Win/.test(navigator.platform),Oe=/\b(android)\b/i.test(navigator.userAgent),es=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,$t=navigator.userAgent.indexOf("Chrome")!==-1,ts=!$t&&navigator.userAgent.indexOf("Safari")!==-1,Le=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,ns=()=>navigator.brave?.isBrave?.name==="isBrave",Xt=(e,t)=>e<=599||t<500&&e<1e3,zt=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},qt=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let o=(n.platform||"").toLowerCase(),s=o==="windows"||o==="macos"||o==="linux"||o==="chrome os";if(n.mobile===!0)return!0;if(n.mobile===!1&&o==="android")return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches;if(s)return!1}if(Le)return!0;if(Oe){let o=/Mobile/i.test(e);if(o||!o)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1},rs=(e,t)=>Xt(e,t)?"phone":zt(e,t)?"tablet":"desktop",os=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,ss=e=>{let t=e??"",n="unknown";return Le?n="ios":Oe?n="android":t&&(n="other"),{isMobileDevice:qt(),platform:n}},is=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Me);if(e==="compact"||e==="full")return e}catch{}return null},jt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Me,e)}catch{}},as=e=>{if(!(e!=="compact"&&e!=="full"))return jt(e),e};var Fe={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},M={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Re?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},Zt=new Map([[M.Z,Fe.Z],[M.Y,Fe.Y]]),Qt=e=>/^[a-z]$/.test(e.toLowerCase()),ps=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Zt.get(t);return!!(n&&!Qt(e.key)&&e.code===n)},ds=e=>e===M.ARROW_LEFT||e===M.ARROW_RIGHT||e===M.ARROW_DOWN||e===M.ARROW_UP,fs=e=>e.altKey,hs=e=>e.shiftKey,ms=e=>e.shiftKey;p();import{pointFrom as Ie,pointFromPair as Jt}from"@excalidraw/math";var bs=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},_s=(e,t,n,r)=>{let o=n.map(y=>y[e]),s=Math.max(...o),a=Math.min(...o),i=s-a,l=i===0?1:t/i,u=1/0,m=n.map(y=>{let S=y[e]*l,w=[...y];return w[e]=S,S<u&&(u=S),w});if(!r||m.length===2)return m;let g=a-u;return m.map(y=>Jt(y.map((S,w)=>w===e?S+g:S)))},As=(e,t,n)=>n?Ie(Math.round(e/n)*n,Math.round(t/n)*n):Ie(e,t);p();var De=ee(Ce(),1),Pe=class{pool;entries={};constructor(t,n){this.pool=new De.default(t,n)}all(){let t=n=>{if(n.data.result){let[r,o]=n.data.result;this.entries[r]=o}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};p();p();p();var ke=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");p();var F=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};p();import{average as N}from"@excalidraw/math";var X=null,Us=e=>{X=e},Ns=()=>{if(X)return X;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),o=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${s}`},Hs=e=>e.charAt(0).toUpperCase()+e.slice(1),Gs=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),en=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Bs=e=>en(e)||e instanceof Element&&!!e.closest("label, button"),Ks=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search")||e instanceof HTMLElement&&e.closest(".cm-editor")!==null,tn=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${be(n).map(r=>`, ${r}`).join("")}`;return L},Ws=({fontSize:e,fontFamily:t})=>`${e}px ${tn({fontFamily:t})}`,Vs=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Ys=(e,t)=>{let n=0,r=null,o=(...s)=>{r=s,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...s)},t)};return o.flush=()=>{if(clearTimeout(n),r){let s=r;r=null,e(...s)}},o.cancel=()=>{r=null,clearTimeout(n)},o},$s=e=>{let t=null,n=null,r=()=>{t=window.requestAnimationFrame(()=>{t=null;let s=n;n=null,s&&e(...s)})},o=(...s)=>{n=s,t===null&&r()};return o.flush=()=>{t!==null&&(cancelAnimationFrame(t),t=null),n&&(e(...n),n=null)},o.cancel=()=>{n=null,t!==null&&(cancelAnimationFrame(t),t=null)},o},Xs=e=>1-Math.pow(1-e,4),zs=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,o=Array(Math.ceil(e.length/t));for(;n<e.length;)o[r++]=e.slice(n,n+=t);return o},qs=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},js=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Zs=(e,t)=>Math.abs(e-t),Qs=e=>e==="selection"||e==="lasso",Js=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveTool===void 0?e.activeTool.lastActiveTool:t.lastActiveTool,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},ei=()=>document.fullscreenElement?.nodeName==="HTML",ti=()=>document.documentElement.requestFullscreen(),ni=()=>document.exitFullscreen(),ri=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:a})=>{let i=(e-r)/n.value-s,l=(t-o)/n.value-a;return{x:i,y:l}},oi=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:a})=>{let i=(e+s)*n.value+r,l=(t+a)*n.value+o;return{x:i,y:l}},si=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),nn="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",rn="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",on=new RegExp(`^[^${nn}]*[${rn}]`),ii=e=>on.test(e),ai=e=>{let[t,n]=e;return{x:t,y:n}},li=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},ci=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},ui=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},pi=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},ve=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},di=(e,t)=>{let n=[{value:1,symbol:"b"},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"}],r=/\.0+$|(\.[0-9]*[1-9])0+$/,o;for(o=n.length-1;o>0&&!(e>=n[o].value);o--);return(e/n[o].value).toFixed(t).replace(r,"$1")+n[o].symbol},fi=()=>document.querySelector('meta[name="version"]')?.content||_e,hi=()=>{let t=document.createElement("canvas").getContext("2d");if(!t)return!1;let n=12;return t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("\u{1F600}",0,0),t.getImageData(n,n,1,1).data[0]!==0},mi=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},Ei=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},Ti=e=>{e.preventDefault(),e.returnValue=""},gi=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),bi=()=>q()?1:Date.now(),_i=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Ai=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),xi=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),yi=e=>e.reduce((t,n,r)=>{let o={...n,prev:null,next:null};if(r!==0){let s=t[r-1];if(o.prev=s,s.next=o,r===e.length-1){let a=t[0];o.next=a,a.prev=o}}return t.push(o),t},[]),sn=e=>Array.isArray(e)?e:e.values(),vi=e=>Array.isArray(e)?e:Array.from(sn(e)),q=()=>h.MODE===k.TEST,Si=()=>h.MODE===k.DEVELOPMENT,Ne=()=>h.MODE===k.PRODUCTION,Mi=()=>typeof process<"u"&&!0,Ri=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Oi=(e,t)=>{let n=!1;for(let r in t){let o=t[r];if(typeof o<"u"){if(e[r]===o&&(typeof o!="object"||o===null))continue;n=!0}}return n?{...e,...t}:e},Li=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},an=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},Fi=()=>an()==="iframe",Ii=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,wi=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},Ue=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,ln=(e,t,n,r=!1)=>{let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let a of n)if(!(e[a]===t[a]||Ue(e[a],t[a])))return r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),!1;return!0}return o.every(a=>{let i=n?.[a],l=i?i(e[a],t[a]):e[a]===t[a]||Ue(e[a],t[a]);return!l&&r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),l})},Ci=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},Pi=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Di(e,t){if(!e)throw new Error(t)}var ki=e=>{let t,n,r=function(o){let s=Object.entries(o);if(t){let i=!0;for(let[l,u]of s)if(t.get(l)!==u){i=!1;break}if(i)return n}let a=e(o);return t=new Map(s),n=a,a};return r.clear=()=>{t=void 0,n=void 0},r},Ui=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Ni=e=>JSON.parse(JSON.stringify(e)),Hi=(e,t)=>ln(e,t)?e:t;function Gi(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function Bi(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],o=e[1],s=e[2],a=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${o[0].toFixed(2)},${o[1].toFixed(2)} ${N(o[0],s[0]).toFixed(2)},${N(o[1],s[1]).toFixed(2)} T`;for(let i=2,l=n-1;i<l;i++)r=e[i],o=e[i+1],a+=`${N(r[0],o[0]).toFixed(2)},${N(r[1],o[1]).toFixed(2)} `;return t&&(a+="Z"),a}var Ki=e=>e.replace(/\r?\n|\r/g,`
4
+ `);function Wi(e){return e}var Se=async(e,...t)=>new Promise(n=>{n(e(...t))}),Vi=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Yi=e=>{try{return JSON.parse(e)}catch{return null}},He=e=>e.replace(/"/g,"&quot;"),$i=e=>Array.isArray(e)?e:[e],cn=e=>Array.isArray(e),un=e=>cn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,Xi=(e,t)=>{if(un(e)===0)return null;let n=t||(o=>o),r=null;for(let o of e){let s=n(o);if((r===null||r===s)&&s!=null)r=s;else return null}return r},Ge="excalidraw-feature-flags",z={COMPLEX_BINDINGS:!1},R=null,zi=e=>{if(!R)try{let t=localStorage.getItem(Ge);t&&(R=JSON.parse(t)??z)}catch{}return(R||z)[e]},qi=(e,t)=>{try{R={...R||z,[e]:t},localStorage.setItem(Ge,JSON.stringify(R))}catch(n){console.error("unable to set feature flag",n)}},ji=(e,t)=>t.includes(e);var Be=new F(Date.now()),Ke=0,na=()=>Math.floor(Be.next()*2**31),ra=e=>{Be=new F(e),Ke=0},oa=()=>q()?`id${Ke++}`:ke();p();var Ve=ee(We(),1);var _n=e=>(e=e.trim(),e&&(0,Ve.sanitizeUrl)(He(e))),ua=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),pa=e=>{if(e=_n(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var G=class{subscribers=[];on(...t){let n=t.flat().filter(r=>typeof r=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(o=>typeof o=="function");n.push(()=>r());let r=this.on(...n);return r}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(r=>!n.includes(r))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};p();var Ye=class{constructor(t){this.behavior=t}emitters=new Map;lastPayload=new Map;emittedOnce=new Set;getEmitter(t){let n=this.emitters.get(t);return n||(n=new G,this.emitters.set(t,n)),n}toPromiseValue(t){return t.length===1?t[0]:t}on(t,n){let r=this.behavior[t],o=this.lastPayload.get(t);if(n)return r.replay==="last"&&o&&(queueMicrotask(()=>n(...o)),r.cardinality==="once")?()=>{}:this.getEmitter(t).on(n);if(r.cardinality!=="once"||r.replay!=="last")throw new Error(`Event "${String(t)}" requires a callback`);return o?Promise.resolve(this.toPromiseValue(o)):new Promise(s=>{this.getEmitter(t).once((...a)=>{s(this.toPromiseValue(a))})})}emit(t,...n){let r=this.behavior[t];if(!Ne()&&r.cardinality==="once"){if(this.emittedOnce.has(t))throw new Error(`Event "${String(t)}" can only be emitted once`);this.emittedOnce.add(t)}r.replay==="last"&&this.lastPayload.set(t,n);try{this.getEmitter(t).trigger(...n)}finally{r.cardinality==="once"&&this.getEmitter(t).clear()}}clear(){this.lastPayload.clear(),this.emittedOnce.clear();for(let t of this.emitters.values())t.clear();this.emitters.clear()}};p();var $e=class{constructor(t,n=Object.is){this.isEqual=n;this.value=t}version=0;value;waiters=new Set;subscribers=new Set;getSnapshot(){return{version:this.version,value:this.value}}set(t){if(this.isEqual(this.value,t))return!1;this.value=t,this.version+=1;let n=this.getSnapshot();for(let r of this.subscribers)r(n);for(let r of this.waiters)r(n);return this.waiters.clear(),!0}update(t){return this.set(t(this.value))}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}pull(t=-1){return this.version!==t?Promise.resolve(this.getSnapshot()):new Promise(n=>{this.waiters.add(n)})}};p();var I=(e,t=5)=>parseFloat(e.toPrecision(t)),An=e=>I(e.reduce((t,n)=>t+n)/e.length),j=class e{static DEBUG_LOG_TIMES=!0;static TIMES_AGGR={};static TIMES_AVG={};static LAST_DEBUG_LOG_CALL=0;static DEBUG_LOG_INTERVAL_ID=null;static LAST_FRAME_TIMESTAMP=0;static FRAME_COUNT=0;static ANIMATION_FRAME_ID=null;static scheduleAnimationFrame=()=>{e.DEBUG_LOG_INTERVAL_ID!==null&&(e.ANIMATION_FRAME_ID=requestAnimationFrame(t=>{e.LAST_FRAME_TIMESTAMP!==t&&(e.LAST_FRAME_TIMESTAMP=t,e.FRAME_COUNT++),e.DEBUG_LOG_INTERVAL_ID!==null&&e.scheduleAnimationFrame()}))};static setupInterval=()=>{e.DEBUG_LOG_INTERVAL_ID===null&&(console.info("%c(starting perf recording)","color: lime"),e.DEBUG_LOG_INTERVAL_ID=window.setInterval(e.debugLogger,1e3),e.scheduleAnimationFrame()),e.LAST_DEBUG_LOG_CALL=Date.now()};static debugLogger=()=>{if(e.DEBUG_LOG_TIMES){for(let[t,{t:n,times:r}]of Object.entries(e.TIMES_AGGR))r.length&&(console.info(t,I(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>I(o))),e.TIMES_AGGR[t]={t:n,times:[]});for(let[t,{t:n,times:r,avg:o}]of Object.entries(e.TIMES_AVG))if(r.length){let s=r.reduce((i,l)=>i+l),a=I(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${a}ms/frame across ${e.FRAME_COUNT} frames (${I(a/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?An([o,a]):a}}}e.FRAME_COUNT=0,Date.now()-e.LAST_DEBUG_LOG_CALL>600&&e.DEBUG_LOG_INTERVAL_ID!==null&&(console.info("%c(stopping perf recording)","color: red"),window.clearInterval(e.DEBUG_LOG_INTERVAL_ID),window.cancelAnimationFrame(e.ANIMATION_FRAME_ID),e.ANIMATION_FRAME_ID=null,e.FRAME_COUNT=0,e.LAST_FRAME_TIMESTAMP=0,e.DEBUG_LOG_INTERVAL_ID=null,e.TIMES_AGGR={},e.TIMES_AVG={})};static logTime=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AGGR[n]=e.TIMES_AGGR[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AGGR[n].t=r};static logTimeAverage=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AVG[n]=e.TIMES_AVG[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AVG[n].t=r};static logWrapper=t=>(n,r="default")=>(...o)=>{let s=performance.now(),a=n(...o);return e[t](performance.now()-s,r),a};static logTimeWrap=e.logWrapper("logTime");static logTimeAverageWrap=e.logWrapper("logTimeAverage");static perfWrap=(t,n="default")=>(...r)=>{console.time(n);let o=t(...r);return console.timeEnd(n),o};static CHANGED_CACHE={};static logChanged(t,n){let r=e.CHANGED_CACHE[t];if(e.CHANGED_CACHE[t]=n,!r)return;let o=new Set([...Object.keys(r),...Object.keys(n)]),s={};for(let a of o){let i=r[a],l=n[a];Xe(i,l)||(s[a]={prev:i,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function Xe(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object"||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!Xe(e[o],t[o]))return!1;return!0}export{zr as ACTIVE_THRESHOLD,Cr as ALLOWED_PASTE_MIME_TYPES,nr as APP_NAME,io as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,so as ARROW_LABEL_WIDTH_FRACTION,vo as ARROW_TYPE,Ye as AppEventBus,Fo as BIND_MODE_TIMEOUT,oo as BOUND_TEXT_PADDING,Kn as BUCKET_FILL_BACKGROUND_PICKS,te as BinaryHeap,Fr as CANVAS_ONLY_ACTIONS,Vt as CANVAS_SEARCH_TAB,Ee as CJK_HAND_DRAWN_FALLBACK_FONT,Er as CLASSES,Fe as CODES,Un as COLORS_PER_ROW,Or as COLOR_CHARCOAL_BLACK,qn as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,Hn as COLOR_TOP_PICKS_SLOTS,Lr as COLOR_VOICE_CALL,Rr as COLOR_WHITE,dr as CURSOR_TYPE,br as DARK_THEME_FILTER,fo as DEFAULT_ADAPTIVE_RADIUS,Wn as DEFAULT_CANVAS_BACKGROUND_PICKS,Nn as DEFAULT_CHART_COLOR_INDEX,Mr as DEFAULT_COLLISION_THRESHOLD,v as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Yn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Bn as DEFAULT_ELEMENT_BACKGROUND_PICKS,To as DEFAULT_ELEMENT_PROPS,D as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Vn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Gn as DEFAULT_ELEMENT_STROKE_PICKS,Wt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Qr as DEFAULT_EXPORT_PADDING,Ao as DEFAULT_FILENAME,yr as DEFAULT_FONT_FAMILY,xr as DEFAULT_FONT_SIZE,Gt as DEFAULT_GIF_AUTO_DECODE_MAX_FILE_SIZE_BYTES,Ir as DEFAULT_GRID_SIZE,wr as DEFAULT_GRID_STEP,Jr as DEFAULT_IMAGE_OPTIONS,pr as DEFAULT_LASER_COLOR,Nt as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,po as DEFAULT_PROPORTIONAL_RADIUS,So as DEFAULT_REDUCED_GLOBAL_ALPHA,go as DEFAULT_SIDEBAR,wo as DEFAULT_STROKE_STREAMLINE,Co as DEFAULT_STROKE_STREAMLINE_PRECISE,vr as DEFAULT_TEXT_ALIGN,Pt as DEFAULT_TRANSFORM_HANDLE_SPACING,qr as DEFAULT_UI_OPTIONS,_e as DEFAULT_VERSION,Sr as DEFAULT_VERTICAL_ALIGN,Lo as DOUBLE_TAP_POSITION_THRESHOLD,or as DRAGGING_THRESHOLD,j as Debug,_o as EDITOR_LS_KEYS,Mo as ELEMENT_LINK_KEY,uo as ELEMENT_PENDING_DRAW_SHAPE_OPACITY,co as ELEMENT_READY_TO_ERASE_OPACITY,ar as ELEMENT_SHIFT_TRANSLATE_AMOUNT,lr as ELEMENT_TRANSLATE_AMOUNT,no as ENCRYPTION_KEY_BITS,k as ENV,kt as EPSILON,It as EVENT,Dr as EXPORT_DATA_TYPES,Pr as EXPORT_IMAGE_TYPES,Zr as EXPORT_SCALES,G as Emitter,T as FONT_FAMILY,Y as FONT_FAMILY_FALLBACKS,wt as FONT_FAMILY_GENERIC_FALLBACKS,U as FONT_METADATA,Tr as FONT_SIZES,_r as FRAME_STYLE,Kt as FREEDRAW_STROKE_WIDTH,Uo as GOOGLE_FONTS_RANGES,$r as HYPERLINK_TOOLTIP_DELAY,Xr as IDLE_THRESHOLD,Ae as IMAGE_MIME_TYPES,Ur as IMAGE_RENDER_TIMEOUT,M as KEYS,Zt as KeyCodeMap,ir as LINE_CONFIRM_THRESHOLD,Oo as LINE_POLYGON_POINT_MERGE_DISTANCE,No as LOCAL_FONT_PROTOCOL,Ht as MAX_ALLOWED_FILE_BYTES,kn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,jr as MAX_DECIMALS_FOR_SVG_EXPORT,Yr as MAX_ZOOM,me as MIME_TYPES,sr as MINIMUM_ARROW_SIZE,Ar as MIN_FONT_SIZE,yo as MIN_WIDTH_OR_HEIGHT,Vr as MIN_ZOOM,Io as MOBILE_ACTION_BUTTON_BG,ge as MONOSPACE_GENERIC_FONT,zo as MQ_MAX_HEIGHT_LANDSCAPE,$o as MQ_MAX_MOBILE,jo as MQ_MAX_TABLET,Xo as MQ_MAX_WIDTH_LANDSCAPE,qo as MQ_MIN_TABLET,Zo as MQ_MIN_WIDTH_DESKTOP,Qo as MQ_RIGHT_SIDEBAR_MIN_WIDTH,Ro as ORIG_ID,fr as POINTER_BUTTON,hr as POINTER_EVENTS,Pe as PromisePool,ye as Queue,Bt as ROUGHNESS,ho as ROUNDNESS,Te as SANS_SERIF_GENERIC_FONT,Kr as SCROLL_TIMEOUT,ur as SHIFT_LOCKING_ANGLE,Dt as SIDE_RESIZING_THRESHOLD,xo as STATS_PANELS,Ut as STRING_MIME_TYPES,xe as STROKE_WIDTH,mo as STROKE_WIDTH_KEYS,to as SVG_DOCUMENT_PREAMBLE,eo as SVG_NS,Nr as TAP_TWICE_TIMEOUT,lo as TEXT_ALIGN,rr as TEXT_AUTOWRAP_THRESHOLD,cr as TEXT_TO_CENTER_SNAP_THRESHOLD,gr as THEME,Gr as TITLE_TIMEOUT,bo as TOOL_TYPE,Hr as TOUCH_CTX_MENU_TIMEOUT,Yt as UserIdleState,ro as VERSIONS,Br as VERSION_TIMEOUT,ao as VERTICAL_ALIGN,$e as VersionedSnapshotStore,L as WINDOWS_EMOJI_FALLBACK_FONT,mr as YOUTUBE_STATES,Wr as ZOOM_STEP,Gi as addEventListener,ti as allowFullScreen,Pn as applyDarkModeFilter,yi as arrayToList,_i as arrayToMap,Ai as arrayToMapWithIndex,xi as arrayToObject,Pi as assertNever,gi as bytesToHexString,Hs as capitalizeString,$i as castArray,zs as chunk,Ni as cloneJSON,Xn as colorToHex,Ci as composeEventHandlers,ss as createUserAgentDescriptor,Ys as debounce,os as deriveStylesPanelMode,Zs as distance,Xs as easeOut,He as escapeDoubleQuotes,ni as exitFullScreen,ci as findIndex,ui as findLastIndex,Ei as focusNearestParent,$n as getAllColorsSpecificShade,Ns as getDateTime,kr as getExportSource,zi as getFeatureFlag,be as getFontFamilyFallbacks,tn as getFontFamilyString,Ws as getFontString,rs as getFormFactor,an as getFrame,Ct as getGenericFontFamilyFallback,si as getGlobalCSSVariable,As as getGridPoint,Go as getLineHeight,mi as getNearestScrollableContainer,bs as getSizeFromPoints,Eo as getStrokeWidthByKey,Bi as getSvgPathFromStroke,bi as getUpdatedTimestamp,fi as getVersion,Ho as getVerticalOffset,Di as invariant,Oe as isAndroid,Vi as isAnyTrue,ds as isArrowKey,Mn as isBounds,ns as isBrave,$t as isChrome,jn as isColorDark,Re as isDarwin,Si as isDevEnv,es as isFirefox,ei as isFullScreen,Le as isIOS,en as isInputLike,Bs as isInteractive,Qt as isLatinChar,ua as isLocalLink,Ui as isMemberOf,Xt as isMobileBreakpoint,zn as isOpaqueColor,Li as isPrimitive,Ne as isProdEnv,Ii as isPromiseLike,ii as isRTL,cn as isReadonlyArray,Fi as isRunningInIframe,ts as isSafari,Qs as isSelectionLikeTool,Mi as isServerEnv,ln as isShallowEqual,zt as isTabletBreakpoint,q as isTestEnv,Gs as isToolIcon,he as isTransparent,Jo as isWindows,Ks as isWritableElement,is as loadDesktopUIModePreference,pi as mapFind,ps as matchKey,ki as memoize,li as muteFSAbortError,di as nFormatter,Vs as nextAnimationFrame,Ki as normalizeEOL,Zn as normalizeInputColor,_n as normalizeLink,ji as oneOf,Ti as preventUnload,Se as promiseTry,wi as queryFocusableElements,oa as randomId,na as randomInteger,Xi as reduceToCommonValue,Dn as removeDarkModeFilter,js as removeSelection,_s as rescalePoints,ra as reseed,ve as resolvablePromise,V as rgbToHex,Yi as safelyParseJSON,oi as sceneCoordsToViewportCoords,qs as selectNode,Us as setDateTimeForTests,as as setDesktopUIMode,qi as setFeatureFlag,hs as shouldMaintainAspectRatio,fs as shouldResizeFromCenter,ms as shouldRotateWithDiscreteAngle,un as sizeOf,hi as supportsEmoji,tr as supportsResizeObserver,$s as throttleRAF,vi as toArray,Wi as toBrandedType,sn as toIterable,pa as toValidURL,ai as tupleToCoors,Js as updateActiveTool,Oi as updateObject,Hi as updateStable,ri as viewportCoordsToSceneCoords,Ri as wrapEvent};
@@ -231,6 +231,7 @@ export declare const EXPORT_SCALES: number[];
231
231
  export declare const DEFAULT_EXPORT_PADDING = 10;
232
232
  export declare const DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 1440;
233
233
  export declare const MAX_ALLOWED_FILE_BYTES: number;
234
+ export declare const DEFAULT_GIF_AUTO_DECODE_MAX_FILE_SIZE_BYTES: number;
234
235
  export declare const DEFAULT_IMAGE_OPTIONS: AppProps["imageOptions"];
235
236
  export declare const SVG_NS = "http://www.w3.org/2000/svg";
236
237
  export declare const SVG_DOCUMENT_PREAMBLE = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n";
@@ -0,0 +1,29 @@
1
+ import type { DataURL } from "@excalidraw/excalidraw/types";
2
+ import type { ExcalidrawGifCache, ExcalidrawGifPlayback, ExcalidrawImageElement, FileId, NonDeletedExcalidrawElement } from "./types";
3
+ export type GifDecodeStatus = "pending" | "success" | "error" | "deferred";
4
+ export declare const configureGifWorkerUrl: (workerUrl: string | undefined) => void;
5
+ type GifImageCache = Map<FileId, {
6
+ gifDecodeStatus?: GifDecodeStatus;
7
+ gif?: ExcalidrawGifCache;
8
+ }>;
9
+ type ImageCacheEntry = NonNullable<ReturnType<GifImageCache["get"]>>;
10
+ export declare const decodeGifFrames: (dataURL: DataURL) => Promise<{
11
+ frames: HTMLCanvasElement[];
12
+ delays: number[];
13
+ width: number;
14
+ height: number;
15
+ }>;
16
+ export declare const getDataURLByteLength: (dataURL: DataURL) => number;
17
+ export declare const decodeGifFramesQueued: (dataURL: DataURL) => Promise<{
18
+ frames: HTMLCanvasElement[];
19
+ delays: number[];
20
+ width: number;
21
+ height: number;
22
+ }>;
23
+ export declare const createGifPlaybackMetadata: (opts?: {
24
+ playing?: boolean;
25
+ }) => ExcalidrawGifPlayback;
26
+ export declare const getGifRenderFrame: (element: ExcalidrawImageElement, cacheEntry: ImageCacheEntry | null | undefined, runtimeFrameIndex?: number) => HTMLCanvasElement | undefined;
27
+ export declare const hasActiveGifDecode: (visibleElements: readonly NonDeletedExcalidrawElement[], imageCache: GifImageCache) => boolean;
28
+ export declare const hasPlayableGif: (visibleElements: readonly NonDeletedExcalidrawElement[], imageCache: GifImageCache) => boolean;
29
+ export {};
@@ -5,10 +5,13 @@ export declare const getThumbHashPlaceholder: (thumbHash: string) => HTMLCanvasE
5
5
  export declare const loadHTMLImageElement: (dataURL: DataURL) => Promise<HTMLImageElement>;
6
6
  /** NOTE: updates cache even if already populated with given image. Thus,
7
7
  * you should filter out the images upstream if you want to optimize this. */
8
- export declare const updateImageCache: ({ fileIds, files, imageCache, }: {
8
+ export declare const updateImageCache: ({ fileIds, files, imageCache, onImageCacheUpdate, gifAutoDecodeMaxFileSizeBytes, forceGifDecode, }: {
9
9
  fileIds: FileId[];
10
10
  files: BinaryFiles;
11
11
  imageCache: AppClassProperties["imageCache"];
12
+ onImageCacheUpdate?: (fileId: FileId) => void;
13
+ gifAutoDecodeMaxFileSizeBytes?: number;
14
+ forceGifDecode?: boolean;
12
15
  }) => Promise<{
13
16
  imageCache: Map<FileId, {
14
17
  image: HTMLImageElement | Promise<HTMLImageElement>;
@@ -16,6 +19,8 @@ export declare const updateImageCache: ({ fileIds, files, imageCache, }: {
16
19
  isPlaceholder?: boolean;
17
20
  placeholderImage?: HTMLImageElement;
18
21
  transitionStart?: number;
22
+ gifDecodeStatus?: "pending" | "success" | "error" | "deferred";
23
+ gif?: import("./types").ExcalidrawGifCache;
19
24
  }>;
20
25
  /** includes errored files because they cache was updated nonetheless */
21
26
  updatedFiles: Map<FileId, true>;
@@ -33,6 +33,7 @@ export * from "./flowchart";
33
33
  export * from "./arrows/focus";
34
34
  export * from "./fractionalIndex";
35
35
  export * from "./frame";
36
+ export * from "./gif";
36
37
  export * from "./groups";
37
38
  export * from "./heading";
38
39
  export * from "./image";
@@ -42,6 +43,7 @@ export * from "./newElement";
42
43
  export * from "./normalise";
43
44
  export * from "./positionElementsOnGrid";
44
45
  export * from "./renderElement";
46
+ export * from "./renderGif";
45
47
  export * from "./resizeElements";
46
48
  export * from "./resizeTest";
47
49
  export * from "./Scene";
@@ -75,4 +75,5 @@ export declare const newImageElement: (opts: {
75
75
  thumbHash?: ExcalidrawImageElement["thumbHash"];
76
76
  scale?: ExcalidrawImageElement["scale"];
77
77
  crop?: ExcalidrawImageElement["crop"];
78
+ gifPlayback?: ExcalidrawImageElement["gifPlayback"];
78
79
  } & ElementConstructorOpts) => NonDeleted<ExcalidrawImageElement>;
@@ -0,0 +1,5 @@
1
+ import type { StaticCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
2
+ import type { ExcalidrawImageElement } from "./types";
3
+ type DrawImagePlaceholder = (element: ExcalidrawImageElement, context: CanvasRenderingContext2D, theme: StaticCanvasRenderConfig["theme"]) => void;
4
+ export declare const drawGifDecodePlaceholder: (element: ExcalidrawImageElement, context: CanvasRenderingContext2D, theme: StaticCanvasRenderConfig["theme"], drawImagePlaceholder: DrawImagePlaceholder) => void;
5
+ export {};
@@ -126,6 +126,17 @@ export type ImageCrop = {
126
126
  naturalWidth: number;
127
127
  naturalHeight: number;
128
128
  };
129
+ export type ExcalidrawGifPlayback = {
130
+ frameIndex: number;
131
+ speed: number;
132
+ playing: boolean;
133
+ };
134
+ export type ExcalidrawGifCache = {
135
+ frames: HTMLCanvasElement[];
136
+ delays: number[];
137
+ width: number;
138
+ height: number;
139
+ };
129
140
  export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
130
141
  type: "image";
131
142
  fileId: FileId | null;
@@ -138,6 +149,7 @@ export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
138
149
  scale: [number, number];
139
150
  /** whether an element is cropped */
140
151
  crop: ImageCrop | null;
152
+ gifPlayback: ExcalidrawGifPlayback | null;
141
153
  }>;
142
154
  export type InitializedExcalidrawImageElement = MarkNonNullable<ExcalidrawImageElement, "fileId">;
143
155
  export type ExcalidrawFrameElement = _ExcalidrawElementBase & {
@@ -121,7 +121,7 @@ export declare const actionBindText: {
121
121
  isRotating: boolean;
122
122
  zoom: import("../types").Zoom;
123
123
  openMenu: "canvas" | null;
124
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
124
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
125
125
  openSidebar: {
126
126
  name: import("../types").SidebarName;
127
127
  tab?: import("../types").SidebarTabName;
@@ -309,7 +309,7 @@ export declare const actionWrapTextInContainer: {
309
309
  isRotating: boolean;
310
310
  zoom: import("../types").Zoom;
311
311
  openMenu: "canvas" | null;
312
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
312
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
313
313
  openSidebar: {
314
314
  name: import("../types").SidebarName;
315
315
  tab?: import("../types").SidebarTabName;
@@ -106,7 +106,7 @@ export declare const actionZoomIn: {
106
106
  isResizing: boolean;
107
107
  isRotating: boolean;
108
108
  openMenu: "canvas" | null;
109
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
109
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
110
110
  openSidebar: {
111
111
  name: import("../types").SidebarName;
112
112
  tab?: import("../types").SidebarTabName;
@@ -298,7 +298,7 @@ export declare const actionZoomOut: {
298
298
  isResizing: boolean;
299
299
  isRotating: boolean;
300
300
  openMenu: "canvas" | null;
301
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
301
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
302
302
  openSidebar: {
303
303
  name: import("../types").SidebarName;
304
304
  tab?: import("../types").SidebarTabName;
@@ -490,7 +490,7 @@ export declare const actionResetZoom: {
490
490
  isResizing: boolean;
491
491
  isRotating: boolean;
492
492
  openMenu: "canvas" | null;
493
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
493
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
494
494
  openSidebar: {
495
495
  name: import("../types").SidebarName;
496
496
  tab?: import("../types").SidebarTabName;
@@ -682,7 +682,7 @@ export declare const actionZoomToFitSelectionInViewport: {
682
682
  isResizing: boolean;
683
683
  isRotating: boolean;
684
684
  openMenu: "canvas" | null;
685
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
685
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
686
686
  openSidebar: {
687
687
  name: import("../types").SidebarName;
688
688
  tab?: import("../types").SidebarTabName;
@@ -873,7 +873,7 @@ export declare const actionZoomToFitSelection: {
873
873
  isResizing: boolean;
874
874
  isRotating: boolean;
875
875
  openMenu: "canvas" | null;
876
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
876
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
877
877
  openSidebar: {
878
878
  name: import("../types").SidebarName;
879
879
  tab?: import("../types").SidebarTabName;
@@ -1064,7 +1064,7 @@ export declare const actionZoomToFit: {
1064
1064
  isResizing: boolean;
1065
1065
  isRotating: boolean;
1066
1066
  openMenu: "canvas" | null;
1067
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
1067
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
1068
1068
  openSidebar: {
1069
1069
  name: import("../types").SidebarName;
1070
1070
  tab?: import("../types").SidebarTabName;
@@ -102,7 +102,7 @@ export declare const actionPaste: {
102
102
  isRotating: boolean;
103
103
  zoom: import("../types").Zoom;
104
104
  openMenu: "canvas" | null;
105
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
105
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
106
106
  openSidebar: {
107
107
  name: import("../types").SidebarName;
108
108
  tab?: import("../types").SidebarTabName;
@@ -328,7 +328,7 @@ export declare const actionCopyAsPng: {
328
328
  isRotating: boolean;
329
329
  zoom: import("../types").Zoom;
330
330
  openMenu: "canvas" | null;
331
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
331
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
332
332
  openSidebar: {
333
333
  name: import("../types").SidebarName;
334
334
  tab?: import("../types").SidebarTabName;
@@ -103,7 +103,7 @@ export declare const actionToggleCropEditor: {
103
103
  isRotating: boolean;
104
104
  zoom: import("../types").Zoom;
105
105
  openMenu: "canvas" | null;
106
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
106
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
107
107
  openSidebar: {
108
108
  name: import("../types").SidebarName;
109
109
  tab?: import("../types").SidebarTabName;
@@ -104,7 +104,7 @@ export declare const actionDeleteSelected: {
104
104
  isRotating: boolean;
105
105
  zoom: import("../types").Zoom;
106
106
  openMenu: "canvas" | null;
107
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
107
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
108
108
  openSidebar: {
109
109
  name: import("../types").SidebarName;
110
110
  tab?: import("../types").SidebarTabName;
@@ -314,7 +314,7 @@ export declare const actionDeleteSelected: {
314
314
  isRotating: boolean;
315
315
  zoom: import("../types").Zoom;
316
316
  openMenu: "canvas" | null;
317
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
317
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
318
318
  openSidebar: {
319
319
  name: import("../types").SidebarName;
320
320
  tab?: import("../types").SidebarTabName;
@@ -491,7 +491,7 @@ export declare const actionDeleteSelected: {
491
491
  isRotating: boolean;
492
492
  zoom: import("../types").Zoom;
493
493
  openMenu: "canvas" | null;
494
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
494
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
495
495
  openSidebar: {
496
496
  name: import("../types").SidebarName;
497
497
  tab?: import("../types").SidebarTabName;
@@ -93,7 +93,7 @@ export declare const actionDeselect: {
93
93
  isRotating: boolean;
94
94
  zoom: import("../types").Zoom;
95
95
  openMenu: "canvas" | null;
96
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
96
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
97
97
  openSidebar: {
98
98
  name: import("../types").SidebarName;
99
99
  tab?: import("../types").SidebarTabName;
@@ -114,7 +114,7 @@ export declare const actionToggleElementLock: {
114
114
  isRotating: boolean;
115
115
  zoom: import("../types").Zoom;
116
116
  openMenu: "canvas" | null;
117
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
117
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
118
118
  openSidebar: {
119
119
  name: import("../types").SidebarName;
120
120
  tab?: import("../types").SidebarTabName;
@@ -301,7 +301,7 @@ export declare const actionUnlockAllElements: {
301
301
  isRotating: boolean;
302
302
  zoom: import("../types").Zoom;
303
303
  openMenu: "canvas" | null;
304
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
304
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null;
305
305
  openSidebar: {
306
306
  name: import("../types").SidebarName;
307
307
  tab?: import("../types").SidebarTabName;