wiki/static/js/excalidraw.js

868 lines
490 KiB
JavaScript
Raw Normal View History

2022-09-02 17:44:10 +08:00
(function(){
shadow$provide[595]=function(ka,N,Ba,w){var m=N(2);!function(G,p){"object"==typeof w&&"object"==typeof Ba?Ba.exports=p(N(14),N(23)):"function"==typeof define&&define.amd?define(["react","react-dom"],p):"object"==typeof w?w.Excalidraw=p(N(14),N(23)):G.Excalidraw=p(G.React,G.ReactDOM)}(self,function(G,p){return function(){function l(u){var g=a[u];if(void 0!==g)return g.exports;g=a[u]={id:u,exports:{}};return t[u](g,g.exports,l),g.exports}var c,h,n,t={7945:function(u,g,e){u.exports=e(1602)},4516:function(u){var g=
Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;u.exports=function(){try{if(!Object.assign)return!1;var x=new String("abc");if(x[5]="de","5"===Object.getOwnPropertyNames(x)[0])return!1;var z={};for(x=0;10>x;x++)z["_"+String.fromCharCode(x)]=x;if("0123456789"!==Object.getOwnPropertyNames(z).map(function(K){return z[K]}).join(""))return!1;var y={};return"abcdefghijklmnopqrst".split("").forEach(function(K){y[K]=K}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},
y)).join("")}catch(K){return!1}}()?Object.assign:function(x,z){var y;if(null==x)throw new TypeError("Object.assign cannot be called with null or undefined");var K=Object(x);for(var E=1;E<arguments.length;E++){for(var A in y=Object(arguments[E]))e.call(y,A)&&(K[A]=y[A]);if(g){var D=g(y);for(var r=0;r<D.length;r++)k.call(y,D[r])&&(K[D[r]]=y[D[r]])}}return K}},6094:function(u,g,e){function k(E,A,D){var r,V={},ea=null,Q=null;for(r in void 0!==D&&(ea=""+D),void 0!==A.key&&(ea=""+A.key),void 0!==A.ref&&
(Q=A.ref),A)y.call(A,r)&&!K.hasOwnProperty(r)&&(V[r]=A[r]);if(E&&E.defaultProps)for(r in A=E.defaultProps)void 0===V[r]&&(V[r]=A[r]);return{$$typeof:x,type:E,key:ea,ref:Q,props:V,_owner:z.current}}e(4516);u=e(4698);var x=60103;if(g.Fragment=60107,"function"==typeof Symbol&&Symbol.for)e=Symbol.for,x=e("react.element"),g.Fragment=e("react.fragment");var z=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y=Object.prototype.hasOwnProperty,K={key:!0,ref:!0,__self:!0,__source:!0};
g.jsx=k;g.jsxs=k},4512:function(u,g,e){u.exports=e(6094)},1602:function(u){u=function(g){function e(ma,wa,sa){return Object.defineProperty(ma,wa,{value:sa,enumerable:!0,configurable:!0,writable:!0}),ma[wa]}function k(ma,wa,sa,Fa){wa=Object.create((wa&&wa.prototype instanceof z?wa:z).prototype);Fa=new ea(Fa||[]);return wa._invoke=function(Ma,La,Ra){var qb=M;return function(sb,Kb){if(qb===da)throw Error("Generator is already running");if(qb===za){if("throw"===sb)throw Kb;return ca()}Ra.method=sb;for(Ra.arg=
Kb;;){if(sb=Ra.delegate)if(sb=D(sb,Ra)){if(sb===Z)continue;return sb}if("next"===Ra.method)Ra.sent=Ra._sent=Ra.arg;else if("throw"===Ra.method){if(qb===M)throw qb=za,Ra.arg;Ra.dispatchException(Ra.arg)}else"return"===Ra.method&&Ra.abrupt("return",Ra.arg);qb=da;sb=x(Ma,La,Ra);if("normal"===sb.type){if(qb=Ra.done?za:S,sb.arg===Z)continue;return{value:sb.arg,done:Ra.done}}"throw"===sb.type&&(qb=za,Ra.method="throw",Ra.arg=sb.arg)}}}(ma,sa,Fa),wa}function x(ma,wa,sa){try{return{type:"normal",arg:ma.call(wa,
sa)}}catch(Fa){return{type:"throw",arg:Fa}}}function z(){}function y(){}function K(){}function E(ma){["next","throw","return"].forEach(function(wa){e(ma,wa,function(sa){return this._invoke(wa,sa)})})}function A(ma,wa){function sa(Ma,La,Ra,qb){Ma=x(ma[Ma],ma,La);if("throw"!==Ma.type){var sb=Ma.arg;return(Ma=sb.value)&&"object"==typeof Ma&&L.call(Ma,"__await")?wa.resolve(Ma.__await).then(function(Kb){sa("next",Kb,Ra,qb)},function(Kb){sa("throw",Kb,Ra,qb)}):wa.resolve(Ma).then(function(Kb){sb.value=
Kb;Ra(sb)},function(Kb){return sa("throw",Kb,Ra,qb)})}qb(Ma.arg)}var Fa;this._invoke=function(Ma,La){function Ra(){return new wa(function(qb,sb){sa(Ma,La,qb,sb)})}return Fa=Fa?Fa.then(Ra,Ra):Ra()}}function D(ma,wa){var sa=ma.iterator[wa.method];if(sa===O){if(wa.delegate=null,"throw"===wa.method){if(ma.iterator.return&&(wa.method="return",wa.arg=O,D(ma,wa),"throw"===wa.method))return Z;wa.method="throw";wa.arg=new TypeError("The iterator does not provide a 'throw' method")}return Z}sa=x(sa,ma.iterator,
wa.arg);return"throw"===sa.type?(wa.method="throw",wa.arg=sa.arg,wa.delegate=null,Z):(sa=sa.arg)?sa.done?(wa[ma.resultName]=sa.value,wa.next=ma.nextLoc,"return"!==wa.method&&(wa.method="next",wa.arg=O),wa.delegate=null,Z):sa:(wa.method="throw",wa.arg=new TypeError("iterator result is not an object"),wa.delegate=null,Z)}function r(ma){var wa={tryLoc:ma[0]};1 in ma&&(wa.catchLoc=ma[1]);2 in ma&&(wa.finallyLoc=ma[2],wa.afterLoc=ma[3]);this.tryEntries.push(wa)}function V(ma){var wa=ma.completion||{};
wa.type="normal";delete wa.arg;ma.completion=wa}function ea(ma){this.tryEntries=[{tryLoc:"root"}];ma.forEach(r,this);this.reset(!0)}function Q(ma){if(ma){var wa=ma[P];if(wa)return wa.call(ma);if("function"==typeof ma.next)return ma;if(!isNaN(ma.length)){var sa=-1;wa=function Ma(){for(;++sa<ma.length;)if(L.call(ma,sa))return Ma.value=ma[sa],Ma.done=!1,Ma;return Ma.value=O,Ma.done=!0,Ma};return wa.next=wa}}return{next:ca}}function ca(){return{value:O,done:!0}}var O,T=Object.prototype,L=T.hasOwnProperty,
Y="function"==typeof Symbol?Symbol:{},P=Y.iterator||"@@iterator",W=Y.asyncIterator||"@@asyncIterator",J=Y.toStringTag||"@@toStringTag";try{e({},"")}catch(ma){e=function(wa,sa,Fa){return wa[sa]=Fa}}g.wrap=k;var M="suspendedStart",S="suspendedYield",da="executing",za="completed",Z={};Y={};Y[P]=function(){return this};var ta=Object.getPrototypeOf;(ta=ta&&ta(ta(Q([]))))&&ta!==T&&L.call(ta,P)&&(Y=ta);var fa=K.prototype=z.prototype=Object.create(Y);return y.prototype=fa.constructor=K,K.constructor=y,y.displayName=
e(K,J,"GeneratorFunction"),g.isGeneratorFunction=function(ma){ma="function"==typeof ma&&ma.constructor;return!!ma&&(ma===y||"GeneratorFunction"===(ma.displayName||ma.name))},g.mark=function(ma){return Object.setPrototypeOf?Object.setPrototypeOf(ma,K):(ma.__proto__=K,e(ma,J,"GeneratorFunction")),ma.prototype=Object.create(fa),ma},g.awrap=function(ma){return{__await:ma}},E(A.prototype),A.prototype[W]=function(){return this},g.AsyncIterator=A,g.async=function(ma,wa,sa,Fa,Ma){void 0===Ma&&(Ma=Promise);
var La=new A(k(ma,wa,sa,Fa),Ma);return g.isGeneratorFunction(wa)?La:La.next().then(function(Ra){return Ra.done?Ra.value:La.next()})},E(fa),e(fa,J,"Generator"),fa[P]=function(){return this},fa.toString=function(){return"[object Generator]"},g.keys=function(ma){var wa=[],sa;for(sa in ma)wa.push(sa);return wa.reverse(),function Ma(){for(;wa.length;){var La=wa.pop();if(La in ma)return Ma.value=La,Ma.done=!1,Ma}return Ma.done=!0,Ma}},g.values=Q,ea.prototype={constructor:ea,reset:function(ma){if(this.prev=
0,this.next=0,this.sent=this._sent=O,this.done=!1,this.delegate=null,this.method="next",this.arg=O,this.tryEntries.forEach(V),!ma)for(var wa in this)"t"===wa.charAt(0)&&L.call(this,wa)&&!isNaN(+wa.slice(1))&&(this[wa]=O)},stop:function(){this.done=!0;var ma=this.tryEntries[0].completion;if("throw"===ma.type)throw ma.arg;return this.rval},dispatchException:function(ma){function wa(sb,Kb){return La.type="throw",La.arg=ma,sa.next=sb,Kb&&(sa.method="next",sa.arg=O),!!Kb}if(this.done)throw ma;for(var sa=
this,Fa=this.tryEntries.length-1;0<=Fa;--Fa){var Ma=this.tryEntries[Fa],La=Ma.completion;if("root"===Ma.tryLoc)return wa("end");if(Ma.tryLoc<=this.prev){var Ra=L.call(Ma,"catchLoc"),qb=L.call(Ma,"finallyLoc");if(Ra&&qb){if(this.prev<Ma.catchLoc)return wa(Ma.catchLoc,!0);if(this.prev<Ma.finallyLoc)return wa(Ma.finallyLoc)}else if(Ra){if(this.prev<Ma.catchLoc)return wa(Ma.catchLoc,!0)}else{if(!qb)throw Error("try statement without catch or finally");if(this.prev<Ma.finallyLoc)return wa(Ma.finallyLoc)}}}},
abrupt:function(ma,wa){for(var sa=this.tryEntries.length-1;0<=sa;--sa){var Fa=this.tryEntries[sa];if(Fa.tryLoc<=this.prev&&L.call(Fa,"finallyLoc")&&this.prev<Fa.finallyLoc){var Ma=Fa;break}}Ma&&("break"===ma||"continue"===ma)&&Ma.tryLoc<=wa&&wa<=Ma.finallyLoc&&(Ma=null);sa=Ma?Ma.completion:{};return sa.type=ma,sa.arg=wa,Ma?(this.method="next",this.next=Ma.finallyLoc,Z):this.complete(sa)},complete:function(ma,wa){if("throw"===ma.type)throw ma.arg;return"break"===ma.type||"continue"===ma.type?this.next=
ma.arg:"return"===ma.type?(this.rval=this.arg=ma.arg,this.method="return",this.next="end"):"normal"===ma.type&&wa&&(this.next=wa),Z},finish:function(ma){for(var wa=this.tryEntries.length-1;0<=wa;--wa){var sa=this.tryEntries[wa];if(sa.finallyLoc===ma)return this.complete(sa.completion,sa.afterLoc),V(sa),Z}},catch:function(ma){for(var wa=this.tryEntries.length-1;0<=wa;--wa){var sa=this.tryEntries[wa];if(sa.tryLoc===ma){ma=sa.completion;if("throw"===ma.type){var Fa=ma.arg;V(sa)}return Fa}}throw Error("illegal catch attempt");
},delegateYield:function(ma,wa,sa){return this.delegate={iterator:Q(ma),resultName:wa,nextLoc:sa},"next"===this.method&&(this.arg=O),Z}},g}(u.exports);try{regeneratorRuntime=u}catch(g){Function("r","regeneratorRuntime \x3d r")(u)}},8336:function(u,g,e){g=e(487);e=e(4295);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},554:function(u,g,e){g=e(487);e=e(9135);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,
{insert:"head",singleton:!1});u.exports=e.locals||{}},2789:function(u,g,e){g=e(487);e=e(3729);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},5080:function(u,g,e){g=e(487);e=e(4241);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},7225:function(u,g,e){g=e(487);e=e(6029);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",
singleton:!1});u.exports=e.locals||{}},778:function(u,g,e){g=e(487);e=e(9609);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4220:function(u,g,e){g=e(487);e=e(2345);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1292:function(u,g,e){g=e(487);e=e(6578);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=
e.locals||{}},196:function(u,g,e){g=e(487);e=e(9482);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},2205:function(u,g,e){g=e(487);e=e(7955);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1310:function(u,g,e){g=e(487);e=e(3195);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},3922:function(u,
g,e){g=e(487);e=e(2978);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},7096:function(u,g,e){g=e(487);e=e(1587);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},7117:function(u,g,e){g=e(487);e=e(9478);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1106:function(u,g,e){g=e(487);e=
e(7369);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},3336:function(u,g,e){g=e(487);e=e(1434);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},694:function(u,g,e){g=e(487);e=e(5644);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},8328:function(u,g,e){g=e(487);e=e(6843);"string"==
typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},8051:function(u,g,e){g=e(487);e=e(8461);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4301:function(u,g,e){g=e(487);e=e(9935);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},9966:function(u,g,e){g=e(487);e=e(532);"string"==typeof(e=e.__esModule?
e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4623:function(u,g,e){g=e(487);e=e(3874);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1528:function(u,g,e){g=e(487);e=e(2681);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},518:function(u,g,e){g=e(487);e=e(6759);"string"==typeof(e=e.__esModule?e.default:e)&&(e=
[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},9757:function(u,g,e){g=e(487);e=e(9650);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},5422:function(u,g,e){g=e(487);e=e(2044);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},6781:function(u,g,e){g=e(487);e=e(6626);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);
g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},580:function(u,g,e){g=e(487);e=e(6359);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4285:function(u,g,e){g=e(487);e=e(9915);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},3313:function(u,g,e){g=e(487);e=e(9310);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",
singleton:!1});u.exports=e.locals||{}},8635:function(u,g,e){g=e(487);e=e(6464);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);g(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},487:function(u,g,e){function k(O){for(var T=-1,L=0;L<r.length;L++)if(r[L].identifier===O){T=L;break}return T}function x(O,T){for(var L={},Y=[],P=0;P<O.length;P++){var W=O[P],J=T.base?W[0]+T.base:W[0],M=L[J]||0,S="".concat(J," ").concat(M);L[J]=M+1;J=k(S);W={css:W[1],media:W[2],sourceMap:W[3]};-1!==J?
(r[J].references++,r[J].updater(W)):r.push({identifier:S,updater:E(W,T),references:1});Y.push(S)}return Y}function z(O){var T=document.createElement("style"),L=O.attributes||{};if(void 0===L.nonce){var Y=e.nc;Y&&(L.nonce=Y)}if(Object.keys(L).forEach(function(P){T.setAttribute(P,L[P])}),"function"==typeof O.insert)O.insert(T);else{O=D(O.insert||"head");if(!O)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");O.appendChild(T)}return T}
function y(O,T,L,Y){L=L?"":Y.media?"@media ".concat(Y.media," {").concat(Y.css,"}"):Y.css;O.styleSheet?O.styleSheet.cssText=ea(T,L):(L=document.createTextNode(L),Y=O.childNodes,Y[T]&&O.removeChild(Y[T]),Y.length?O.insertBefore(L,Y[T]):O.appendChild(L))}function K(O,T,L){T=L.css;var Y=L.media;L=L.sourceMap;if(Y?O.setAttribute("media",Y):O.removeAttribute("media"),L&&"undefined"!=typeof btoa&&(T+="\n/*# sourceMappingURL\x3ddata:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(L)))),
" */")),O.styleSheet)O.styleSheet.cssText=T;else{for(;O.firstChild;)O.removeChild(O.firstChild);O.appendChild(document.createTextNode(T))}}function E(O,T){if(T.singleton){var L=ca++;var Y=Q||=z(T);var P=y.bind(null,Y,L,!1);var W=y.bind(null,Y,L,!0)}else Y=z(T),P=K.bind(null,Y,T),W=function(){if(null===Y.parentNode)var J=!1;else Y.parentNode.removeChild(Y),J=void 0;!J};return P(O),function(J){J?(J.css!==O.css||J.media!==O.media||J.sourceMap!==O.sourceMap)&&P(O=J):W()}}var A,D=function(){var O={};return function(T){if(void 0===
O[T]){var L=document.querySelector(T);if(window.HTMLIFrameElement&&L instanceof window.HTMLIFrameElement)try{L=L.contentDocument.head}catch(Y){L=null}O[T]=L}return O[T]}}(),r=[],V,ea=(V=[],function(O,T){return V[O]=T,V.filter(Boolean).join("\n")}),Q=null,ca=0;u.exports=function(O,T){(T=T||{}).singleton||"boolean"==typeof T.singleton||(T.singleton=(void 0===A&&(A=!(!(window&&document&&document.all)||window.atob)),A));var L=x(O=O||[],T);return function(Y){if(Y=Y||[],"[object Array]"===Object.prototype.toString.call(Y)){for(var P=
0;P<L.length;P++){var W=k(L[P]);r[W].references--}Y=x(Y,T);for(P=0;P<L.length;P++)W=k(L[P]),0===r[W].references&&(r[W].updater(),r.splice(W,1));L=Y}}}},788:function(u,g,e){function k(z){if(!e.o(x,z))return Promise.resolve().then(function(){var E=Error("Cannot find module '"+z+"'");throw E.code="MODULE_NOT_FOUND",E;});var y=x[z],K=y[0];return Promise.all(y.slice(1).map(e.e)).then(function(){return e.t(K,19)})}var x={"./ar-SA.json":[7822,558],"./bg-BG.json":[1203,384],"./ca-ES.json":[510,351],"./cs-CZ.json":[7605,
387],"./da-DK.json":[2392,617],"./de-DE.json":[2853,43],"./el-GR.json":[9876,526],"./en.json":[1463],"./es-ES.json":[2264,317],"./fa-IR.json":[3747,710],"./fi-FI.json":[9490,472],"./fr-FR.json":[7830,364],"./he-IL.json":[1994,262],"./hi-IN.json":[4646,933],"./hu-HU.json":[6373,661],"./id-ID.json":[3247,491],"./it-IT.json":[3257,465],"./ja-JP.json":[198,137],"./kab-KAB.json":[228,164],"./kk-KZ.json":[8972,649],"./ko-KR.json":[7596,60],"./lv-LV.json":[2327,899],"./my-MM.json":[7704,242],"./nb-NO.json":[1167,
246],"./nl-NL.json":[290,196],"./nn-NO.json":[4481,920],"./oc-FR.json":[2284,565],"./pa-IN.json":[6773,280],"./percentages.json":[4451],"./pl-PL.json":[3661,852],"./pt-BR.json":[8881,381],"./pt-PT.json":[5622,149],"./ro-RO.json":[2013,752],"./ru-RU.json":[2253,869],"./sk-SK.json":[4570,401],"./sv-SE.json":[6006,698],"./tr-TR.json":[7315,213],"./uk-UA.json":[334,583],"./zh-CN.json":[1037,304],"./zh-TW.json":[931,62]};k.keys=function(){return Object.keys(x)};k.id=788;u.exports=k},9713:function(u){u.exports=
function(g,e,k){return e in g?Object.defineProperty(g,e,{value:k,enumerable:!0,configurable:!0,writable:!0}):g[e]=k,g}},6479:function(u,g,e){var k=e(7316);u.exports=function(x,z){if(null==x)return{};var y,K=k(x,z);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(x);for(y=0;y<E.length;y++){var A=E[y];0<=z.indexOf(A)||Object.prototype.propertyIsEnumerable.call(x,A)&&(K[A]=x[A])}}return K}},7316:function(u){u.exports=function(g,e){if(null==g)return{};var k,x={},z=Object.keys(g);for(k=
0;k<z.length;k++){var y=z[k];0<=e.indexOf(y)||(x[y]=g[y])}return x}},4295:function(u,g,e){e.r(g);var k=e(3645),x=e.n(k);k=e(1667);k=e.n(k);var z=e(7464);e=e(9638);x=x()(function(y){return y[1]});z=k()(z.Z);k=k()(e.Z);x.push([u.id,'@font-face{font-family:"Virgil";src:url('+z+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+k+");font-display:swap}",""]);g.default=x},9135:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;-webkit-margin-end:.3em;margin-inline-end:.3em;-webkit-transform:scaleY(0.9);transform:scaleY(0.9)}",
""]);g.default=e},3729:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500}",""]);g.default=e},4241:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}",
""]);g.default=e},6029:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",
""]);g.default=e},9609:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir\x3dltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir\x3drtl] .excalidraw .CollabButton-collaborators{left:-5px}",
""]);g.default=e},2345:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir\x3dltr] .excalidraw .color-picker{left:-5.5px}:root[dir\x3drtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir\x3dltr] .excalidraw .color-picker-triangle{left:12px}:root[dir\x3drtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg\x3d\x3d") left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir\x3dltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir\x3drtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir\x3dltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir\x3drtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir\x3dltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir\x3drtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;-webkit-padding-start:.5em;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir\x3dltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir\x3drtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem;border:1px solid #dee2e6;positio
""]);g.default=e},6578:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;-webkit-margin-end:20px;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{-webkit-margin-end:0;margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',
""]);g.default=e},9482:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor) * 7);grid-gap:var(--metric);padding:calc(var(--space-factor) * 2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor) * 7) 1fr calc( var(--space-factor) * 7 );position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor) * 2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",
""]);g.default=e},7955:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg\x3d\x3d") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor) * 3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding) * 2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{-webkit-filter:none;filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor) * 2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions\x3e*{margin-bottom:calc(var(--space-factor) * 3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}',
""]);g.default=e},3195:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer\x3e*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);g.default=e},2978:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});
e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",
""]);g.default=e},1587:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer\x3espan{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",
""]);g.default=e},9478:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus,.excalidraw .picker button:focus{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus svg,.excalidraw .picker button:focus svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir\x3dltr] .excalidraw .picker-triangle{left:12px}:root[dir\x3drtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-auto-flow:column;grid-gap:.5rem;border-radius:4px}:root[dir\x3drtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir\x3dltr] .excalidraw .picker-keybinding{right:2px}:root[dir\x3drtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label\x3dtransparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label\x3dtransparent] .picker-keybinding{color:#000}',
""]);g.default=e},7369:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:4px;padding:calc(var(--padding) * var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]);g.default=e},1434:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-padding-end:18px;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .layer-ui__library-items{max-height:50vh;overflow:auto}.excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}:root[dir\x3dltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir\x3dltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir\x3drtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir\x3drtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir\x3dltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(-76px, 0);transform:translate(-76px, 0)}:root[dir\x3drtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(76px, 0);transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{-webkit-transform:translate(0, 92px);transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir\x3dltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir\x3drtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center\x3e*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;-webkit-margin-end:1em;margin-inline-end:1em}",
""]);g.default=e},5644:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit__dragger{display:flex;height:100%;width:100%}.excalidraw .library-unit__dragger\x3esvg{-webkit-filter:var(--theme-filter);filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__removeFromLibrary,.excalidraw .library-unit__removeFromLibrary:hover,.excalidraw .library-unit__removeFromLibrary:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:0;position:absolute;right:5px;top:5px}.excalidraw .library-unit__removeFromLibrary\x3esvg{height:16px;width:16px}.excalidraw .library-unit__pulse{-webkit-transform:scale(1);transform:scale(1);-webkit-animation:library-unit__pulse-animation 1s ease-in infinite;animation:library-unit__pulse-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:50%;top:50%;width:20px;height:20px;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit__active{cursor:pointer}@-webkit-keyframes library-unit__pulse-animation{0%{-webkit-transform:scale(0.95);transform:scale(0.95)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.95);transform:scale(0.95)}}@keyframes library-unit__pulse-animation{0%{-webkit-transform:scale(0.95);transform:scale(0.95)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.95);transform:scale(0.95)}}",
""]);g.default=e},6843:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor) * 10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-animation:Modal__content_fade-in .1s ease-out .05s forwards;animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@-webkit-keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor) * 7);height:calc(var(--space-factor) * 7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor) * 5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",
""]);g.default=e},8461:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",
""]);g.default=e},9935:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .popover{position:absolute;z-index:10}",""]);g.default=e},532:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",
""]);g.default=e},3874:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor) * var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]);g.default=e},2681:function(u,
g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir\x3drtl] .excalidraw .Stats{left:12px;right:initial}:root[dir\x3drtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir\x3drtl] .excalidraw .Stats .close{float:left}",
""]);g.default=e},6759:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{color:var(--text-primary-color);display:inline-block;border:1.5px solid var(--button-gray-1);line-height:1;padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw .TextInput:not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw .TextInput:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}",
""]);g.default=e},9650:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{-webkit-animation:fade-in .5s;animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@-webkit-keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-in{from{opacity:0}to{opacity:1}}",
""]);g.default=e},2044:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;font-family:Cascadia;cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:var(--space-factor);-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1)}.excalidraw .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--space-factor)}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__icon+.ToolIcon__label{-webkit-margin-start:0;margin-inline-start:0}.excalidraw .ToolIcon__label{color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon_size_small .ToolIcon__icon{width:2rem;height:2rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:focus,.excalidraw .Modal .ToolIcon_type_button:focus,.excalidraw .ToolIcon_type_button:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_radio:focus+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating:focus{box-shadow:none}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{background-color:var(--button-gray-1);width:2rem;height:2em}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:hover{background-color:var(-
""]);g.default=e},6626:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex;height:100%}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",
""]);g.default=e},6359:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor) var(--space-factor) var(--space-factor) var(--space-factor);display:flex;flex-wrap:wrap;justify-content:flex-end}.excalidraw .UserList\x3e*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile\x3e*{margin:0 var(--space-factor) var(--space-factor) 0}",
""]);g.default=e},9915:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",
""]);g.default=e},9310:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url(\'data:image/svg+xml,\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"292.4" height\x3d"292.4" viewBox\x3d"0 0 292 292"\x3e\x3cpath d\x3d"M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/\x3e\x3c/svg\x3e\');--focus-highlight-color: #a5d8ff;--icon-fill-color: #000000;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #dee2e6;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.15);--space-factor: 0.25rem;--text-primary-color: #343a40}.excalidraw.theme--dark{background:#000}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url(\'data:image/svg+xml,\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"292.4" height\x3d"292.4" viewBox\x3d"0 0 292 292"\x3e\x3cpath fill\x3d"%23ced4da" d\x3d"M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/\x3e\x3c/svg\x3e\');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #4dabf7;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelC
""]);g.default=e},6464:function(u,g,e){e.r(g);var k=e(3645);e=e.n(k)()(function(x){return x[1]});e.push([u.id,"",""]);e.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};g.default=e},3645:function(u){u.exports=function(g){var e=[];return e.toString=function(){return this.map(function(k){var x=g(k);return k[2]?"@media ".concat(k[2]," {").concat(x,"}"):x}).join("")},e.i=function(k,x,z){"string"==typeof k&&(k=[[null,k,""]]);var y={};if(z)for(var K=0;K<this.length;K++){var E=this[K][0];null!=E&&(y[E]=
!0)}for(K=0;K<k.length;K++)E=[].concat(k[K]),z&&y[E[0]]||(x&&(E[2]?E[2]="".concat(x," and ").concat(E[2]):E[2]=x),e.push(E))},e}},1667:function(u){u.exports=function(g,e){return e||={},"string"!=typeof(g=g&&g.__esModule?g.default:g)?g:(/^['"].*['"]$/.test(g)&&(g=g.slice(1,-1)),e.hash&&(g+=e.hash),/["'() \t\n]/.test(g)||e.needQuotes?'"'.concat(g.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):g)}},9638:function(u,g,e){g.Z=e.p+"excalidraw-assets/Cascadia.woff2"},7464:function(u,g,e){g.Z=e.p+"excalidraw-assets/Virgil.woff2"},
8288:function(u,g,e){e.d(g,{iC:function(){return x},f:function(){return z},qx:function(){return y},Iw:function(){return K},$e:function(){return E},wZ:function(){return A},ay:function(){return D},oc:function(){return r},Oh:function(){return V},Ks:function(){return k},Vi:function(){return ea},$C:function(){return Q},ut:function(){return ca},_D:function(){return O},n5:function(){return T},rk:function(){return L},Hg:function(){return Y},hs:function(){return P},k:function(){return W},LO:function(){return J},
r8:function(){return M},pb:function(){return S},Gj:function(){return da},nM:function(){return za},Lg:function(){return Z},HM:function(){return ta},V4:function(){return fa},EH:function(){return ma},ZF:function(){return wa},UO:function(){return sa},ah:function(){return Fa},cW:function(){return Ma},kV:function(){return La},sS:function(){return Ra},Yx:function(){return qb},zK:function(){return sb},ZB:function(){return Kb},qy:function(){return Vb}});var k;u=e(8635);e=e.n(u);var x="Excalidraw",z=10,y=8,
K=5,E=1,A=30,D=Math.PI/12,r={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},V={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};!function(gb){gb.COPY="copy";gb.PASTE="paste";gb.CUT="cut";gb.KEYDOWN="keydown";gb.KEYUP="keyup";gb.MOUSE_MOVE="mousemove";gb.RESIZE="resize";gb.UNLOAD="unload";gb.FOCUS="focus";gb.BLUR="blur";gb.DRAG_OVER="dragover";gb.DROP="drop";gb.GESTURE_END="gestureend";gb.BEFORE_UNLOAD="beforeunload";gb.GESTURE_START="gesturestart";gb.GESTURE_CHANGE=
"gesturechange";gb.POINTER_MOVE="pointermove";gb.POINTER_UP="pointerup";gb.STATE_CHANGE="statechange";gb.WHEEL="wheel";gb.TOUCH_START="touchstart";gb.TOUCH_END="touchend";gb.HASHCHANGE="hashchange";gb.VISIBILITY_CHANGE="visibilitychange";gb.SCROLL="scroll"}(k||={});var ea={TEST:"test",DEVELOPMENT:"development"},Q={SHAPE_ACTIONS_MENU:"App-menu__left"},ca={Virgil:1,Helvetica:2,Cascadia:3},O="Segoe UI Emoji",T=20,L=ca.Virgil,Y="left",P="top",W=20,J={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json"},
M={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},S=window.location.origin,da=300,za=500,Z=5E3,ta=100,fa=.1,ma={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},wa=e().themeFilter,sa={addLibrary:"addLibrary"},Fa={addLibrary:"addLibrary"},Ma={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},La=730,Ra=1E3,qb=500,sb=2,Kb=[1,2,3],Vb=10},21:function(u,g,e){function k(ba,
v){if(!(ba instanceof v))throw new TypeError("Cannot call a class as a function");}function x(ba,v){for(var C=0;C<v.length;C++){var U=v[C];U.enumerable=U.enumerable||!1;U.configurable=!0;"value"in U&&(U.writable=!0);Object.defineProperty(ba,U.key,U)}}function z(ba,v,C){return v&&x(ba.prototype,v),C&&x(ba,C),ba}function y(ba,v){return(y=Object.setPrototypeOf||function(C,U){return C.__proto__=U,C})(ba,v)}function K(ba,v){if("function"!=typeof v&&null!==v)throw new TypeError("Super expression must either be null or a function");
ba.prototype=Object.create(v&&v.prototype,{constructor:{value:ba,writable:!0,configurable:!0}});v&&y(ba,v)}function E(ba){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(v){return typeof v}:function(v){return v&&"function"==typeof Symbol&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v})(ba)}function A(ba){if(void 0===ba)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ba}function D(ba,v){return!v||"object"!==
E(v)&&"function"!=typeof v?A(ba):v}function r(ba){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)})(ba)}function V(ba){var v=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(C){return!1}}();return function(){var C=r(ba);if(v){var U=r(this).constructor;C=Reflect.construct(C,
arguments,U)}else C=C.apply(this,arguments);return D(this,C)}}function ea(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function Q(ba,v){if(ba){if("string"==typeof ba)return ea(ba,v);var C=Object.prototype.toString.call(ba).slice(8,-1);return"Object"===C&&ba.constructor&&(C=ba.constructor.name),"Map"===C||"Set"===C?Array.from(ba):"Arguments"===C||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(C)?ea(ba,v):void 0}}function ca(ba,v){if(!(ba=function(C){if(Array.isArray(C))return C}(ba)||
function(C,U){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(C)){var B=[],oa=!0,va=!1,ja=void 0;try{for(var xa,Aa=C[Symbol.iterator]();!(oa=(xa=Aa.next()).done)&&(B.push(xa.value),!U||B.length!==U);oa=!0);}catch(Ca){va=!0,ja=Ca}finally{try{oa||null==Aa.return||Aa.return()}finally{if(va)throw ja;}}return B}}(ba,v)||Q(ba,v)))throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return ba}
function O(ba){var v=Array.isArray(ba)?ea(ba):void 0;v||(v="undefined"!=typeof Symbol&&Symbol.iterator in Object(ba)?Array.from(ba):void 0);if(!(ba=v||Q(ba)))throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return ba}function T(ba,v,C){return v in ba?Object.defineProperty(ba,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):ba[v]=C,ba}function L(ba,v,C){if(ba&&ba.length){const [U,B]=v;v=
Math.PI/180*C;const oa=Math.cos(v),va=Math.sin(v);ba.forEach(ja=>{const [xa,Aa]=ja;ja[0]=(xa-U)*oa-(Aa-B)*va+U;ja[1]=(xa-U)*va+(Aa-B)*oa+B})}}function Y(ba){const v=ba[0];ba=ba[1];return Math.sqrt(Math.pow(v[0]-ba[0],2)+Math.pow(v[1]-ba[1],2))}function P(ba,v,C,U){const B=v[1]-ba[1];v=ba[0]-v[0];ba=B*ba[0]+v*ba[1];const oa=U[1]-C[1];U=C[0]-U[0];C=oa*C[0]+U*C[1];const va=B*U-oa*v;return va?[(U*ba-v*C)/va,(B*C-oa*ba)/va]:null}function W(ba,v,C){const U=ba.length;if(3>U)return!1;const B=[Number.MAX_SAFE_INTEGER,
C];v=[v,C];C=0;for(let oa=0;oa<U;oa++){const va=ba[oa],ja=ba[(oa+1)%U];if(S(va,ja,v,B)){if(0===M(va,v,ja))return J(va,v,ja);C++}}return 1==C%2}function J(ba,v,C){return v[0]<=Math.max(ba[0],C[0])&&v[0]>=Math.min(ba[0],C[0])&&v[1]<=Math.max(ba[1],C[1])&&v[1]>=Math.min(ba[1],C[1])}function M(ba,v,C){ba=(v[1]-ba[1])*(C[0]-v[0])-(v[0]-ba[0])*(C[1]-v[1]);return 0===ba?0:0<ba?1:2}function S(ba,v,C,U){const B=M(ba,v,C),oa=M(ba,v,U),va=M(C,U,ba),ja=M(C,U,v);return B!==oa&&va!==ja||!(0!==B||!J(ba,C,v))||!(0!==
oa||!J(ba,U,v))||!(0!==va||!J(C,ba,U))||!(0!==ja||!J(C,v,U))}function da(ba,v){const C=[0,0],U=Math.round(v.hachureAngle+90);U&&L(ba,C,U);v=function(B,oa){var va=[...B];va[0].join(",")!==va[va.length-1].join(",")&&va.push([va[0][0],va[0][1]]);B=[];if(va&&2<va.length){let xa=oa.hachureGap;0>xa&&(xa=4*oa.strokeWidth);xa=Math.max(xa,.1);oa=[];for(var ja=0;ja<va.length-1;ja++){const Ia=va[ja],Wa=va[ja+1];if(Ia[1]!==Wa[1]){const $a=Math.min(Ia[1],Wa[1]);oa.push({ymin:$a,ymax:Math.max(Ia[1],Wa[1]),x:$a===
Ia[1]?Ia[0]:Wa[0],islope:(Wa[0]-Ia[0])/(Wa[1]-Ia[1])})}}if(oa.sort((Ia,Wa)=>Ia.ymin<Wa.ymin?-1:Ia.ymin>Wa.ymin?1:Ia.x<Wa.x?-1:Ia.x>Wa.x?1:Ia.ymax===Wa.ymax?0:(Ia.ymax-Wa.ymax)/Math.abs(Ia.ymax-Wa.ymax)),!oa.length)return B;let Aa=[],Ca=oa[0].ymin;for(;Aa.length||oa.length;){if(oa.length){va=-1;for(ja=0;ja<oa.length&&!(oa[ja].ymin>Ca);ja++)va=ja;oa.splice(0,va+1).forEach(Ia=>{Aa.push({s:Ca,edge:Ia})})}if(Aa=Aa.filter(Ia=>!(Ia.edge.ymax<=Ca)),Aa.sort((Ia,Wa)=>Ia.edge.x===Wa.edge.x?0:(Ia.edge.x-Wa.edge.x)/
Math.abs(Ia.edge.x-Wa.edge.x)),1<Aa.length)for(va=0;va<Aa.length;va+=2){ja=va+1;if(ja>=Aa.length)break;B.push([[Math.round(Aa[va].edge.x),Ca],[Math.round(Aa[ja].edge.x),Ca]])}Ca+=xa;Aa.forEach(Ia=>{Ia.edge.x+=xa*Ia.edge.islope})}}return B}(ba,v);return U&&(L(ba,C,-U),function(B,oa,va){const ja=[];B.forEach(xa=>ja.push(...xa));L(ja,oa,va)}(v,C,-U)),v}function za(ba){const v=[];a:{var C=ba;for(var U=[];""!==C;){if(!C.match(/^([ \t\r\n,]+)/))if(C.match(/^([aAcChHlLmMqQsStTvVzZ])/))U[U.length]={type:0,
text:RegExp.$1};else{if(!C.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)){C=[];break a}U[U.length]={type:1,text:`${parseFloat(RegExp.$1)}`}}C=C.substr(RegExp.$1.length)}C=(U[U.length]={type:2,text:""},U)}U="BOD";let B=0;for(var oa=C[B];2!==oa.type;){let va=0;const ja=[];if("BOD"===U){if("M"!==oa.text&&"m"!==oa.text)return za("M0,0"+ba);B++;va=ck[oa.text];U=oa.text}else 1===oa.type?va=ck[U]:(B++,va=ck[oa.text],U=oa.text);if(!(B+va<C.length))throw Error("Path data ended short");
for(oa=B;oa<B+va;oa++){const xa=C[oa];if(1!==xa.type)throw Error("Param not a number: "+U+","+xa.text);ja[ja.length]=+xa.text}if("number"!=typeof ck[U])throw Error("Bad segment: "+U);v.push({key:U,data:ja});B+=va;oa=C[B];"M"===U&&(U="L");"m"===U&&(U="l")}return v}function Z(ba){let v=0,C=0,U=0,B=0;const oa=[];for(const {key:va,data:ja}of ba)switch(va){case "M":oa.push({key:"M",data:[...ja]});[v,C]=ja;[U,B]=ja;break;case "m":v+=ja[0];C+=ja[1];oa.push({key:"M",data:[v,C]});U=v;B=C;break;case "L":oa.push({key:"L",
data:[...ja]});[v,C]=ja;break;case "l":v+=ja[0];C+=ja[1];oa.push({key:"L",data:[v,C]});break;case "C":oa.push({key:"C",data:[...ja]});v=ja[4];C=ja[5];break;case "c":ba=ja.map((xa,Aa)=>Aa%2?xa+C:xa+v);oa.push({key:"C",data:ba});v=ba[4];C=ba[5];break;case "Q":oa.push({key:"Q",data:[...ja]});v=ja[2];C=ja[3];break;case "q":ba=ja.map((xa,Aa)=>Aa%2?xa+C:xa+v);oa.push({key:"Q",data:ba});v=ba[2];C=ba[3];break;case "A":oa.push({key:"A",data:[...ja]});v=ja[5];C=ja[6];break;case "a":v+=ja[5];C+=ja[6];oa.push({key:"A",
data:[ja[0],ja[1],ja[2],ja[3],ja[4],v,C]});break;case "H":oa.push({key:"H",data:[...ja]});v=ja[0];break;case "h":v+=ja[0];oa.push({key:"H",data:[v]});break;case "V":oa.push({key:"V",data:[...ja]});C=ja[0];break;case "v":C+=ja[0];oa.push({key:"V",data:[C]});break;case "S":oa.push({key:"S",data:[...ja]});v=ja[2];C=ja[3];break;case "s":ba=ja.map((xa,Aa)=>Aa%2?xa+C:xa+v);oa.push({key:"S",data:ba});v=ba[2];C=ba[3];break;case "T":oa.push({key:"T",data:[...ja]});v=ja[0];C=ja[1];break;case "t":v+=ja[0];C+=
ja[1];oa.push({key:"T",data:[v,C]});break;case "Z":case "z":oa.push({key:"Z",data:[]}),v=U,C=B}return oa}function ta(ba){const v=[];var C="";let U=0,B=0,oa=0,va=0,ja=0,xa=0;for(const {key:Ca,data:Ia}of ba){switch(Ca){case "M":v.push({key:"M",data:[...Ia]});[U,B]=Ia;[oa,va]=Ia;break;case "C":v.push({key:"C",data:[...Ia]});U=Ia[4];B=Ia[5];ja=Ia[2];xa=Ia[3];break;case "L":v.push({key:"L",data:[...Ia]});[U,B]=Ia;break;case "H":U=Ia[0];v.push({key:"L",data:[U,B]});break;case "V":B=Ia[0];v.push({key:"L",
data:[U,B]});break;case "S":var Aa=ba=0;"C"===C||"S"===C?(ba=U+(U-ja),Aa=B+(B-xa)):(ba=U,Aa=B);v.push({key:"C",data:[ba,Aa,...Ia]});ja=Ia[0];xa=Ia[1];U=Ia[2];B=Ia[3];break;case "T":const [Wa,$a]=Ia;Aa=ba=0;"Q"===C||"T"===C?(ba=U+(U-ja),Aa=B+(B-xa)):(ba=U,Aa=B);v.push({key:"C",data:[U+2*(ba-U)/3,B+2*(Aa-B)/3,Wa+2*(ba-Wa)/3,$a+2*(Aa-$a)/3,Wa,$a]});ja=ba;xa=Aa;U=Wa;B=$a;break;case "Q":const [rb,Hb,Xb,jc]=Ia;v.push({key:"C",data:[U+2*(rb-U)/3,B+2*(Hb-B)/3,Xb+2*(rb-Xb)/3,jc+2*(Hb-jc)/3,Xb,jc]});ja=rb;
xa=Hb;U=Xb;B=jc;break;case "A":C=Math.abs(Ia[0]);ba=Math.abs(Ia[1]);Aa=Ia[2];const nc=Ia[3],Tc=Ia[4],Xc=Ia[5],Pc=Ia[6];if(0===C||0===ba)v.push({key:"C",data:[U,B,Xc,Pc,Xc,Pc]}),U=Xc,B=Pc;else if(U!==Xc||B!==Pc)ma(U,B,Xc,Pc,C,ba,Aa,nc,Tc).forEach(function(Zc){v.push({key:"C",data:Zc})}),U=Xc,B=Pc;break;case "Z":v.push({key:"Z",data:[]}),U=oa,B=va}C=Ca}return v}function fa(ba,v,C){return[ba*Math.cos(C)-v*Math.sin(C),ba*Math.sin(C)+v*Math.cos(C)]}function ma(ba,v,C,U,B,oa,va,ja,xa,Aa){const Ca=(Ia=va,
Math.PI*Ia/180);var Ia;Ia=[];if(Aa)[ja,Wa,$a,rb]=Aa;else{[ba,v]=fa(ba,v,-Ca);[C,U]=fa(C,U,-Ca);var Wa=(ba-C)/2;var $a=(v-U)/2;var rb=Wa*Wa/(B*B)+$a*$a/(oa*oa);1<rb&&(rb=Math.sqrt(rb),B*=rb,oa*=rb);rb=B*B;var Hb=oa*oa;ja=(ja===xa?-1:1)*Math.sqrt(Math.abs((rb*Hb-rb*$a*$a-Hb*Wa*Wa)/(rb*$a*$a+Hb*Wa*Wa)));$a=ja*B*$a/oa+(ba+C)/2;rb=ja*-oa*Wa/B+(v+U)/2;ja=Math.asin(parseFloat(((v-rb)/oa).toFixed(9)));Wa=Math.asin(parseFloat(((U-rb)/oa).toFixed(9)));ba<$a&&(ja=Math.PI-ja);C<$a&&(Wa=Math.PI-Wa);0>ja&&(ja=
2*Math.PI+ja);0>Wa&&(Wa=2*Math.PI+Wa);xa&&ja>Wa&&(ja-=2*Math.PI);!xa&&Wa>ja&&(Wa-=2*Math.PI)}if(Math.abs(Wa-ja)>120*Math.PI/180){Hb=Wa;const Xb=C,jc=U;Wa=xa&&Wa>ja?ja+120*Math.PI/180:ja+120*Math.PI/180*-1;Ia=ma(C=$a+B*Math.cos(Wa),U=rb+oa*Math.sin(Wa),Xb,jc,B,oa,va,0,xa,[Wa,Hb,$a,rb])}va=Math.tan((Wa-ja)/4);B=4/3*B*va;va*=4/3*oa;oa=[ba,v];ba=[ba+B*Math.sin(ja),v-va*Math.cos(ja)];v=[C+B*Math.sin(Wa),U-va*Math.cos(Wa)];C=[C,U];if(ba[0]=2*oa[0]-ba[0],ba[1]=2*oa[1]-ba[1],Aa)return[ba,v,C].concat(Ia);
Ia=[ba,v,C].concat(Ia);Aa=[];for(C=0;C<Ia.length;C+=3)U=fa(Ia[C][0],Ia[C][1],Ca),ba=fa(Ia[C+1][0],Ia[C+1][1],Ca),v=fa(Ia[C+2][0],Ia[C+2][1],Ca),Aa.push([U[0],U[1],ba[0],ba[1],v[0],v[1]]);return Aa}function wa(ba,v,C){const U=(ba||[]).length;if(2<U){const B=[];for(let oa=0;oa<U-1;oa++)B.push(...gb(ba[oa][0],ba[oa][1],ba[oa+1][0],ba[oa+1][1],C));return v&&B.push(...gb(ba[U-1][0],ba[U-1][1],ba[0][0],ba[0][1],C)),{type:"path",ops:B}}return 2===U?{type:"path",ops:gb(ba[0][0],ba[0][1],ba[1][0],ba[1][1],
C)}:{type:"path",ops:[]}}function sa(ba,v){let C=yb(ba,1+.2*v.roughness,v);if(!v.disableMultiStroke){var U=1.5*(1+.22*v.roughness);const B=Object.assign({},v);B.randomizer=void 0;v.seed&&(B.seed=v.seed+1);ba=yb(ba,U,B);C=C.concat(ba)}return{type:"path",ops:C}}function Fa(ba,v,C){const U=2*Math.PI/Math.max(C.curveStepCount,C.curveStepCount/Math.sqrt(200)*Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(ba/2,2)+Math.pow(v/2,2))/2)));ba=Math.abs(ba/2);v=Math.abs(v/2);const B=1-C.curveFitting;return ba+=Vb(ba*
B,C),v+=Vb(v*B,C),{increment:U,rx:ba,ry:v}}function Ma(ba,v,C,U){const [B,oa]=Za(U.increment,ba,v,U.rx,U.ry,1,U.increment*Kb(.1,Kb(.4,1,C),C),C);let va=lb(B,null,C);C.disableMultiStroke||([ba]=Za(U.increment,ba,v,U.rx,U.ry,1.5,0,C),C=lb(ba,null,C),va=va.concat(C));return{estimatedPoints:oa,opset:{type:"path",ops:va}}}function La(ba,v,C,U,B,oa,va,ja,xa){C=Math.abs(C/2);U=Math.abs(U/2);C+=Vb(.01*C,xa);for(U+=Vb(.01*U,xa);0>B;)B+=2*Math.PI,oa+=2*Math.PI;oa-B>2*Math.PI&&(B=0,oa=2*Math.PI);var Aa=Math.min(2*
Math.PI/xa.curveStepCount/2,(oa-B)/2);const Ca=cb(Aa,ba,v,C,U,B,oa,1,xa);xa.disableMultiStroke||(Aa=cb(Aa,ba,v,C,U,B,oa,1.5,xa),Ca.push(...Aa));return va&&(ja?Ca.push(...gb(ba,v,ba+C*Math.cos(B),v+U*Math.sin(B),xa),...gb(ba,v,ba+C*Math.cos(oa),v+U*Math.sin(oa),xa)):Ca.push({op:"lineTo",data:[ba,v]},{op:"lineTo",data:[ba+C*Math.cos(B),v+U*Math.sin(B)]})),{type:"path",ops:Ca}}function Ra(ba,v){const C=[];if(ba.length){const U=v.maxRandomnessOffset||0,B=ba.length;if(2<B){C.push({op:"move",data:[ba[0][0]+
Vb(U,v),ba[0][1]+Vb(U,v)]});for(let oa=1;oa<B;oa++)C.push({op:"lineTo",data:[ba[oa][0]+Vb(U,v),ba[oa][1]+Vb(U,v)]})}}return{type:"fillPath",ops:C}}function qb(ba,v){var C=ln;let U=v.fillStyle||"hachure";if(!Ah[U])switch(U){case "zigzag":Ah[U]||(Ah[U]=new Hi(C));break;case "cross-hatch":Ah[U]||(Ah[U]=new mh(C));break;case "dots":Ah[U]||(Ah[U]=new Ii(C));break;case "dashed":Ah[U]||(Ah[U]=new ug(C));break;case "zigzag-line":Ah[U]||(Ah[U]=new ii(C));break;default:U="hachure",Ah[U]||(Ah[U]=new Of(C))}return Ah[U].fillPolygon(ba,
v)}function sb(ba){return ba.randomizer||(ba.randomizer=new pi(ba.seed||0)),ba.randomizer.next()}function Kb(ba,v,C,U=1){return C.roughness*U*(sb(C)*(v-ba)+ba)}function Vb(ba,v,C=1){return Kb(-ba,ba,v,C)}function gb(ba,v,C,U,B,oa=!1){const va=oa?B.disableMultiStrokeFill:B.disableMultiStroke;oa=Bb(ba,v,C,U,B,!0,!1);if(va)return oa;ba=Bb(ba,v,C,U,B,!0,!0);return oa.concat(ba)}function Bb(ba,v,C,U,B,oa,va){var ja=Math.pow(ba-C,2)+Math.pow(v-U,2),xa=Math.sqrt(ja);let Aa;Aa=200>xa?1:500<xa?.4:-.0016668*
xa+1.233334;let Ca=B.maxRandomnessOffset||0;Ca*Ca*100>ja&&(Ca=xa/10);ja=Ca/2;xa=.2+.2*sb(B);let Ia=B.bowing*B.maxRandomnessOffset*(U-v)/200,Wa=B.bowing*B.maxRandomnessOffset*(ba-C)/200;Ia=Vb(Ia,B,Aa);Wa=Vb(Wa,B,Aa);const $a=[],rb=B.preserveVertices;return oa&&(va?$a.push({op:"move",data:[ba+(rb?0:Vb(ja,B,Aa)),v+(rb?0:Vb(ja,B,Aa))]}):$a.push({op:"move",data:[ba+(rb?0:Vb(Ca,B,Aa)),v+(rb?0:Vb(Ca,B,Aa))]})),va?$a.push({op:"bcurveTo",data:[Ia+ba+(C-ba)*xa+Vb(ja,B,Aa),Wa+v+(U-v)*xa+Vb(ja,B,Aa),Ia+ba+2*
(C-ba)*xa+Vb(ja,B,Aa),Wa+v+2*(U-v)*xa+Vb(ja,B,Aa),C+(rb?0:Vb(ja,B,Aa)),U+(rb?0:Vb(ja,B,Aa))]}):$a.push({op:"bcurveTo",data:[Ia+ba+(C-ba)*xa+Vb(Ca,B,Aa),Wa+v+(U-v)*xa+Vb(Ca,B,Aa),Ia+ba+2*(C-ba)*xa+Vb(Ca,B,Aa),Wa+v+2*(U-v)*xa+Vb(Ca,B,Aa),C+(rb?0:Vb(Ca,B,Aa)),U+(rb?0:Vb(Ca,B,Aa))]}),$a}function yb(ba,v,C){const U=[];U.push([ba[0][0]+Vb(v,C),ba[0][1]+Vb(v,C)]);U.push([ba[0][0]+Vb(v,C),ba[0][1]+Vb(v,C)]);for(let B=1;B<ba.length;B++)U.push([ba[B][0]+Vb(v,C),ba[B][1]+Vb(v,C)]),B===ba.length-1&&U.push([ba[B][0]+
Vb(v,C),ba[B][1]+Vb(v,C)]);return lb(U,null,C)}function lb(ba,v,C){const U=ba.length,B=[];if(3<U){const oa=[],va=1-C.curveTightness;B.push({op:"move",data:[ba[1][0],ba[1][1]]});for(let ja=1;ja+2<U;ja++){const xa=ba[ja];oa[0]=[xa[0],xa[1]];oa[1]=[xa[0]+(va*ba[ja+1][0]-va*ba[ja-1][0])/6,xa[1]+(va*ba[ja+1][1]-va*ba[ja-1][1])/6];oa[2]=[ba[ja+1][0]+(va*ba[ja][0]-va*ba[ja+2][0])/6,ba[ja+1][1]+(va*ba[ja][1]-va*ba[ja+2][1])/6];oa[3]=[ba[ja+1][0],ba[ja+1][1]];B.push({op:"bcurveTo",data:[oa[1][0],oa[1][1],
oa[2][0],oa[2][1],oa[3][0],oa[3][1]]})}v&&2===v.length&&(ba=C.maxRandomnessOffset,B.push({op:"lineTo",data:[v[0]+Vb(ba,C),v[1]+Vb(ba,C)]}))}else 3===U?(B.push({op:"move",data:[ba[1][0],ba[1][1]]}),B.push({op:"bcurveTo",data:[ba[1][0],ba[1][1],ba[2][0],ba[2][1],ba[2][0],ba[2][1]]})):2===U&&B.push(...gb(ba[0][0],ba[0][1],ba[1][0],ba[1][1],C));return B}function Za(ba,v,C,U,B,oa,va,ja){const xa=[],Aa=[],Ca=Vb(.5,ja)-Math.PI/2;Aa.push([Vb(oa,ja)+v+.9*U*Math.cos(Ca-ba),Vb(oa,ja)+C+.9*B*Math.sin(Ca-ba)]);
for(let Ia=Ca;Ia<2*Math.PI+Ca-.01;Ia+=ba){const Wa=[Vb(oa,ja)+v+U*Math.cos(Ia),Vb(oa,ja)+C+B*Math.sin(Ia)];xa.push(Wa);Aa.push(Wa)}return Aa.push([Vb(oa,ja)+v+U*Math.cos(Ca+2*Math.PI+.5*va),Vb(oa,ja)+C+B*Math.sin(Ca+2*Math.PI+.5*va)]),Aa.push([Vb(oa,ja)+v+.98*U*Math.cos(Ca+va),Vb(oa,ja)+C+.98*B*Math.sin(Ca+va)]),Aa.push([Vb(oa,ja)+v+.9*U*Math.cos(Ca+.5*va),Vb(oa,ja)+C+.9*B*Math.sin(Ca+.5*va)]),[Aa,xa]}function cb(ba,v,C,U,B,oa,va,ja,xa){var Aa=oa+Vb(.1,xa);oa=[];for(oa.push([Vb(ja,xa)+v+.9*U*Math.cos(Aa-
ba),Vb(ja,xa)+C+.9*B*Math.sin(Aa-ba)]);Aa<=va;Aa+=ba)oa.push([Vb(ja,xa)+v+U*Math.cos(Aa),Vb(ja,xa)+C+B*Math.sin(Aa)]);return oa.push([v+U*Math.cos(va),C+B*Math.sin(va)]),oa.push([v+U*Math.cos(va),C+B*Math.sin(va)]),lb(oa,null,xa)}function Na(ba,v,C,U,B,oa,va,ja){const xa=[],Aa=[ja.maxRandomnessOffset||1,(ja.maxRandomnessOffset||1)+.3];let Ca;const Ia=ja.disableMultiStroke?1:2,Wa=ja.preserveVertices;for(let $a=0;$a<Ia;$a++)0===$a?xa.push({op:"move",data:[va[0],va[1]]}):xa.push({op:"move",data:[va[0]+
(Wa?0:Vb(Aa[0],ja)),va[1]+(Wa?0:Vb(Aa[0],ja))]}),Ca=Wa?[B,oa]:[B+Vb(Aa[$a],ja),oa+Vb(Aa[$a],ja)],xa.push({op:"bcurveTo",data:[ba+Vb(Aa[$a],ja),v+Vb(Aa[$a],ja),C+Vb(Aa[$a],ja),U+Vb(Aa[$a],ja),Ca[0],Ca[1]]});return xa}function Ka(ba,v){return Math.pow(ba[0]-v[0],2)+Math.pow(ba[1]-v[1],2)}function Ua(ba,v,C){return[ba[0]+(v[0]-ba[0])*C,ba[1]+(v[1]-ba[1])*C]}function hb(ba,v,C,U){U=U||[];var B=ba[v+0],oa=ba[v+1],va=ba[v+2];const ja=ba[v+3];var xa=3*oa[0]-2*B[0]-ja[0];xa*=xa;oa=3*oa[1]-2*B[1]-ja[1];oa*=
oa;let Aa=3*va[0]-2*ja[0]-B[0];Aa*=Aa;B=3*va[1]-2*ja[1]-B[1];(B*=B,xa<Aa&&(xa=Aa),oa<B&&(oa=B),xa+oa)<C?(C=ba[v+0],U.length?1<(Ca=U[U.length-1],Ia=C,Math.sqrt(Ka(Ca,Ia)))&&U.push(C):U.push(C),U.push(ba[v+3])):(Ca=ba[v+0],xa=ba[v+1],Ia=ba[v+2],ba=ba[v+3],v=Ua(Ca,xa,.5),B=Ua(xa,Ia,.5),Ia=Ua(Ia,ba,.5),xa=Ua(v,B,.5),B=Ua(B,Ia,.5),va=Ua(xa,B,.5),hb([Ca,v,xa,va],0,C,U),hb([va,B,Ia,ba],0,C,U));var Ca,Ia;return U}function Sb(ba,v,C,U,B){B=B||[];const oa=ba[v],va=ba[C-1];let ja=0,xa=1;for(let $a=v+1;$a<C-
1;++$a){a:{var Aa=ba[$a],Ca=oa,Ia=va;var Wa=Ka(Ca,Ia);if(0===Wa){Wa=Ka(Aa,Ca);break a}let rb=((Aa[0]-Ca[0])*(Ia[0]-Ca[0])+(Aa[1]-Ca[1])*(Ia[1]-Ca[1]))/Wa;Wa=(rb=Math.max(0,Math.min(1,rb)),Ka(Aa,Ua(Ca,Ia,rb)))}Aa=Wa;Aa>ja&&(ja=Aa,xa=$a)}return Math.sqrt(ja)>U?(Sb(ba,v,xa+1,U,B),Sb(ba,xa,C,U,B)):(B.length||B.push(oa),B.push(va)),B}function xb(ba,v=.15,C){const U=[],B=(ba.length-1)/3;for(let oa=0;oa<B;oa++)hb(ba,3*oa,v,U);return C&&0<C?Sb(U,0,U.length,C):U}function bc(ba){var v,C,U="";if("string"==typeof ba||
"number"==typeof ba)U+=ba;else if("object"==typeof ba)if(Array.isArray(ba))for(v=0;v<ba.length;v++)ba[v]&&(C=bc(ba[v]))&&(U&&(U+=" "),U+=C);else for(v in ba)ba[v]&&(U&&(U+=" "),U+=v);return U}function oc(){for(var ba,v,C=0,U="";C<arguments.length;)(ba=arguments[C++])&&(v=bc(ba))&&(U&&(U+=" "),U+=v);return U}function wc(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return zc(ja,xa);var Aa=
Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return zc(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function zc(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function $c(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return td(ja,xa);var Aa=
Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return td(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function td(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function bd(ba,v,C,U=B=>B){return ba*U(.5-v*(.5-C))}function Xd(ba,v){return[ba[0]+v[0],ba[1]+v[1]]}function xe(ba,v){return[ba[0]-v[0],ba[1]-v[1]]}function vd(ba,v){return[ba[0]*v,ba[1]*v]}
function zd(ba){return[ba[1],-ba[0]]}function Ie(ba,v){return ba[0]===v[0]&&ba[1]===v[1]}function qg(ba,v){ba=xe(ba,v);return ba[0]*ba[0]+ba[1]*ba[1]}function qf(ba){var v=Math.hypot(ba[0],ba[1]);return[ba[0]/v,ba[1]/v]}function rf(ba,v){return Math.hypot(ba[1]-v[1],ba[0]-v[0])}function hf(ba,v,C){let U=Math.sin(C);C=Math.cos(C);let B=ba[0]-v[0];ba=ba[1]-v[1];return[B*C-ba*U+v[0],B*U+ba*C+v[1]]}function Gf(ba,v,C){return Xd(ba,vd(xe(v,ba),C))}function og(ba,v,C){return Xd(ba,vd(v,C))}function Ih(ba,
v={}){var C;let {size:U=16,smoothing:B=.5,thinning:oa=.5,simulatePressure:va=!0,easing:ja=pf=>pf,start:xa={},end:Aa={},last:Ca=!1}=v,{cap:Ia=!0,taper:Wa=0,easing:$a=pf=>pf*(2-pf)}=xa,{cap:rb=!0,taper:Hb=0,easing:Xb=pf=>--pf*pf*pf+1}=Aa;if(0===ba.length)return[];var jc,nc=ba[ba.length-1].runningLength,Tc=Math.pow(U*B,2);v=[];var Xc=[],Pc=ba.slice(0,10).reduce((pf,Ae)=>{var ah=Ae.pressure;va&&(Ae=Wl(1,Ae.distance/U),ah=Wl(1,1-Ae),ah=Wl(1,pf+.275*Ae*(ah-pf)));return(pf+ah)/2},ba[0].pressure),Zc=bd(U,
oa,ba[ba.length-1].pressure,ja);let Dd=ba[0].vector;var Yd=ba[0].point;let md=Yd;var sd=Yd,Hd=md,He=!0;for(let pf=0;pf<ba.length-1;pf++){var {pressure:Sg}=ba[pf];let {point:Ae,vector:ah,distance:Wi,runningLength:rk}=ba[pf];if(!(0<pf&&He&&rk<U/2)){(He&&=!1,oa)?(va&&(Zc=Wl(1,Wi/U),Sg=Wl(1,1-Zc),Sg=Wl(1,Pc+.275*Zc*(Sg-Pc))),Zc=bd(U,oa,Sg,ja)):Zc=U/2;void 0===jc&&(jc=Zc);var ni=rk<Wa?$a(rk/Wa):1,Ai=nc-rk<Hb?Xb((nc-rk)/Hb):1;Zc=Math.max(.01,Zc*Math.min(ni,Ai));Ai=(null==(C=ba[pf+1])?void 0:C.vector)||
ah;ni=ah[0]*Ai[0]+ah[1]*Ai[1];if(0>ni){Yd=vd(zd(Dd),Zc);for(let El=1/13,Fl=0;1>=Fl;Fl+=El)Hd=hf(Xd(Ae,Yd),Ae,Gm*-Fl),sd=hf(xe(Ae,Yd),Ae,Gm*Fl),Xc.push(Hd),v.push(sd);Yd=sd;md=Hd}else Hd=vd(zd(Gf(Ai,ah,ni)),Zc),sd=xe(Ae,Hd),Hd=Xd(Ae,Hd),((Pc=2>pf||.25>ni)||qg(Yd,sd)>Tc)&&(v.push(sd),Yd=sd),(Pc||qg(md,Hd)>Tc)&&(Xc.push(Hd),md=Hd),Pc=Sg,Dd=ah}}C=ba[0];jc=ba[ba.length-1];if((nc=He||2>Xc.length||2>v.length)&&(!Wa&&!Hb||Ca)){v=0;Xc=Ie(C.point,jc.point)?Xd(C.point,[1,1]):jc.point;for(sd=0;sd<ba.length;sd++){let {pressure:pf,
runningLength:Ae}=ba[sd];if(Ae>U){v=bd(U,oa,pf,ja);break}}v=og(C.point,zd(qf(xe(C.point,Xc))),-(v||Zc));Xc=[];for(let pf=1/13,Ae=pf;1>=Ae;Ae+=pf)Xc.push(hf(v,C.point,2*Gm*Ae));return Xc}ba=[];He=[];if(1<v.length&&1<Xc.length){Hd=Xc[1];for(Tc=1;Tc<v.length;Tc++)if(!Ie(Hd,v[Tc])){sd=v[Tc];break}if(Ia||Wa)if(Wa||Hb&&nc)ba.push(C.point.slice(0,2));else{if(!Ie(Hd,sd)){Hd=og(C.point,qf(xe(sd,Hd)),-rf(Hd,sd)/2);for(let pf=1/13,Ae=pf;1>=Ae;Ae+=pf){Tc=hf(Hd,C.point,Gm*Ae);if(1>rf(Tc,sd))break;ba.push(Tc)}v.shift();
Xc.shift()}}else Ie(Hd,sd)||(Tc=qf(xe(sd,Hd)),sd=rf(Hd,sd)/2,ba.push(og(C.point,Tc,-sd),og(C.point,Tc,.95*-sd),og(C.point,Tc,.95*sd),og(C.point,Tc,sd)),v.shift(),Xc.shift());C=vd(Xd(v[v.length-1],Xc[Xc.length-1]),.5);sd=jc.point;Hd=zd(qf(xe(sd,C)));if(rb||Hb)if(Hb||Wa&&nc)He.push(sd.slice(0,2));else{Zc=og(sd,Hd,Zc);for(let pf=1/29,Ae=0;1>=Ae;Ae+=pf)Hd=hf(Zc,sd,3*Gm*Ae),He.push(Hd)}else C=Gf(C,sd,.95),Zc*=.95,He.push(og(C,Hd,Zc),og(sd,Hd,Zc),og(sd,Hd,-Zc),og(C,Hd,-Zc))}return v.concat(He,Xc.reverse(),
ba)}function Jh(ba,v={}){return Ih(function(C,U={}){var B;let {streamline:oa=.5,size:va=16,last:ja=!1}=U;if(0===C.length)return[];U=.15+.85*(1-oa);C=Array.isArray(C[0])?C:C.map(({x:$a,y:rb,pressure:Hb=.5})=>[$a,rb,Hb]);1===C.length&&C.push([...Xd(C[0],[1,1]),C[0][2]||.5]);let xa=[{point:[C[0][0],C[0][1]],pressure:C[0][2]||.25,vector:[1,1],distance:0,runningLength:0}],Aa=!1,Ca=0,Ia=xa[0],Wa=C.length-1;for(let $a=1;$a<C.length;$a++){let rb=ja&&$a===Wa?C[$a]:Gf(Ia.point,C[$a],U);if(Ie(Ia.point,rb))continue;
let Hb=rf(rb,Ia.point);if(Ca+=Hb,$a<Wa&&!Aa){if(Ca<va)continue;Aa=!0}Ia={point:rb,pressure:C[$a][2]||.5,vector:qf(xe(Ia.point,rb)),distance:Hb,runningLength:Ca};xa.push(Ia)}return xa[0].vector=(null==(B=xa[1])?void 0:B.vector)||[0,0],xa}(ba,v),v)}function Te(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function yg(ba){for(var v=1;v<
arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Te(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Te(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function xg(ba){var v=Se(ba);v=new Path2D(v);return Oh.set(ba,v),v}function Se(ba){return function(v){if(!v.length)return"";var C=v.length-1;return v.reduce(function(U,B,oa,va){return oa===
C?U.push(B,Ab(B,va[0]),"L",va[0],"Z"):U.push(B,Ab(B,va[oa+1])),U},["M",v[0],"Q"]).join(" ").replaceAll(Ue,"$1")}(Jh(ba.simulatePressure?ba.points:ba.points.length?ba.points.map(function(v,C){v=ca(v,2);return[v[0],v[1],ba.pressures[C]]}):[[0,0,.5]],{simulatePressure:ba.simulatePressure,size:4.25*ba.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:function(v){return Math.sin(v*Math.PI/2)},last:!1}))}function Ab(ba,v){return[(ba[0]+v[0])/2,(ba[1]+v[1])/2]}function Jb(ba,v){var C=Object.keys(ba);
if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function vb(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Jb(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Jb(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,
U))})}return ba}function ab(ba,v){if(null==ba)return{};var C;if(null==ba)var U={};else{U={};var B=Object.keys(ba);for(C=0;C<B.length;C++){var oa=B[C];0<=v.indexOf(oa)||(U[oa]=ba[oa])}}if(Object.getOwnPropertySymbols)for(B=Object.getOwnPropertySymbols(ba),C=0;C<B.length;C++)oa=B[C],0<=v.indexOf(oa)||Object.prototype.propertyIsEnumerable.call(ba,oa)&&(U[oa]=ba[oa]);return U}function nb(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,
xa){if(ja){if("string"==typeof ja)return Db(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Db(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function Db(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function Zb(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));
C.push.apply(C,U)}return C}function tc(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Zb(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Zb(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Dc(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=
U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Rc(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Dc(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Dc(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Gd(ba,v){var C="undefined"!=
typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return ld(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return ld(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=
ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function ld(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=
0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function ne(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function yc(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?ne(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):
ne(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function cc(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Be(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,
B).enumerable}));C.push.apply(C,U)}return C}function jd(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Be(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Be(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Je(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);
v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function zb(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Je(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Je(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function pc(ba,v){var C=Object.keys(ba);
if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function ob(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?pc(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):pc(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,
U))})}return ba}function qc(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function xd(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?qc(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):qc(Object(C)).forEach(function(U){Object.defineProperty(ba,
U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Ld(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function $d(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Ld(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):
Ld(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function bf(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Kc(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?bf(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?
Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):bf(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function ad(ba){var v=ba.options,C=ba.value,U=ba.label,B=ba.onChange,oa=ba.onClose,va=de().useRef(),ja=de().useRef(),xa=de().useRef(null);de().useEffect(function(){ja.current?ja.current.focus():xa.current&&xa.current.focus()},[]);return(0,Va.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":U,onKeyDown:function(Aa){var Ca=
v.find(function(rb){return rb.keyBinding===Aa.key.toLowerCase()});if(Aa.metaKey||Aa.altKey||Aa.ctrlKey||!Ca)if("Tab"===Aa.key)setTimeout(function(){ja.current!==document.activeElement&&oa()},0);else if(oh(Aa.key)){Ca=Cg.rtl;var Ia=Array.prototype.indexOf.call(xa.current.children,document.activeElement);if(-1!==Ia){var Wa=v.length,$a=Ia;switch(Aa.key){case Ca?"ArrowLeft":"ArrowRight":case "ArrowDown":$a=(Ia+1)%Wa;break;case Ca?"ArrowRight":"ArrowLeft":case "ArrowUp":$a=(Wa+Ia-1)%Wa}xa.current.children[$a].focus()}Aa.preventDefault()}else"Escape"!==
Aa.key&&"Enter"!==Aa.key||(Aa.preventDefault(),oa());else Ca=v.indexOf(Ca),xa.current.children[Ca].focus(),Aa.preventDefault();Aa.nativeEvent.stopImmediatePropagation();Aa.stopPropagation()},children:(0,Va.jsx)("div",{className:"picker-content",ref:xa,children:v.map(function(Aa,Ca){return(0,Va.jsxs)("button",{className:"picker-option",onClick:function(Ia){Ia.currentTarget.focus();B(Aa.value)},title:"".concat(Aa.text," — ").concat(Aa.keyBinding.toUpperCase()),"aria-label":Aa.text||"none","aria-keyshortcuts":Aa.keyBinding,
ref:function(Ia){Ia&&0===Ca&&(va.current=Ia);Ia&&Aa.value===C&&(ja.current=Ia)},onFocus:function(){B(Aa.value)},children:[Aa.icon,(0,Va.jsx)("span",{className:"picker-keybinding",children:Aa.keyBinding})]},Aa.text)})})})}function sc(ba){var v,C=ba.value,U=ba.label,B=ba.options,oa=ba.onChange;ba=ba.group;ba=void 0===ba?"":ba;var va=ca(de().useState(!1),2),ja=va[0],xa=va[1],Aa=de().useRef(null);va=Cg.rtl;return(0,Va.jsxs)("label",{className:"picker-container",children:[(0,Va.jsx)("button",{name:ba,
className:ja?"active":"","aria-label":U,onClick:function(){return xa(!ja)},ref:Aa,children:null===(v=B.find(function(Ca){return Ca.value===C}))||void 0===v?void 0:v.icon}),(0,Va.jsx)(de().Suspense,{fallback:"",children:ja?(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)(Ga,Kc(Kc({onCloseRequest:function(Ca){return Ca.target!==Aa.current&&xa(!1)}},va?{right:5.5}:{left:-5.5}),{},{children:(0,Va.jsx)(ad,{options:B,value:C,label:U,onChange:oa,onClose:function(){var Ca;xa(!1);null===(Ca=Aa.current)||void 0===
Ca||Ca.focus()}})})),(0,Va.jsx)("div",{className:"picker-triangle"})]}):null})]})}function Fb(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function qd(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Fb(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,
Object.getOwnPropertyDescriptors(C)):Fb(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function sf(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Sd(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?sf(Object(C),!0).forEach(function(U){T(ba,
U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):sf(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function jg(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Ja(ba){for(var v=1;v<arguments.length;v++){var C=
null!=arguments[v]?arguments[v]:{};v%2?jg(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):jg(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function fb(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return Xa(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,
-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Xa(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function Xa(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function pb(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,
[],function(){})),!0}catch(ba){return!1}}function Pb(ba,v,C){return(Pb=pb()?Reflect.construct:function(U,B,oa){var va=[null];va.push.apply(va,B);U=new (Function.bind.apply(U,va));return oa&&y(U,oa.prototype),U}).apply(null,arguments)}function Bc(ba){var v="function"==typeof Map?new Map:void 0;return(Bc=function(C){function U(){return Pb(C,arguments,r(this).constructor)}if(null===C||(B=C,-1===Function.toString.call(B).indexOf("[native code]")))return C;var B;if("function"!=typeof C)throw new TypeError("Super expression must either be null or a function");
if(void 0!==v){if(v.has(C))return v.get(C);v.set(C,U)}return U.prototype=Object.create(C.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),y(U,C)})(ba)}function Ec(ba){var v=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(C){return!1}}();return function(){var C=r(ba);if(v){var U=r(this).constructor;
C=Reflect.construct(C,arguments,U)}else C=C.apply(this,arguments);return D(this,C)}}function Nc(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return Ed(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Ed(ja,
xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==
C.return||C.return()}finally{if(va)throw B;}}}}function Ed(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function ed(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Ud(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?ed(Object(C),!0).forEach(function(U){T(ba,
U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):ed(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function od(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function ge(ba){for(var v=1;v<arguments.length;v++){var C=
null!=arguments[v]?arguments[v]:{};v%2?od(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):od(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function kg(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return oe(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,
-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return oe(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function oe(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function bb(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));
C.push.apply(C,U)}return C}function ia(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?bb(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):bb(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function pa(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=
U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function ya(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?pa(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):pa(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Pa(ba,v){var C=Object.keys(ba);
if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function mb(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Pa(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Pa(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,
U))})}return ba}function Eb(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function ac(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Eb(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Eb(Object(C)).forEach(function(U){Object.defineProperty(ba,
U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function vc(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function id(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?vc(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):
vc(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Kd(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function we(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Kd(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?
Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Kd(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Ge(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function he(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Ge(Object(C),
!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Ge(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function ke(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return re(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&
ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return re(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function re(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function tf(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));
C.push.apply(C,U)}return C}function Kg(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?tf(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):tf(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Uh(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=
U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Vh(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Uh(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Uh(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Lg(ba,v){var C="undefined"!=
typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return Ye(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Ye(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=
ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function Ye(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=
0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function ph(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Jd(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?ph(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):
ph(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function gi(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function oi(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?gi(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?
Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):gi(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Vj(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Ni(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Vj(Object(C),
!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Vj(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Qe(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Ck(ba){for(var v=1;v<
arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Qe(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Qe(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Xk(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,
B).enumerable}));C.push.apply(C,U)}return C}function xh(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Xk(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Xk(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function ol(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);
v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Ol(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?ol(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):ol(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function xj(ba,v){var C=Object.keys(ba);
if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function sg(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?xj(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):xj(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,
U))})}return ba}function yj(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return Gi(ja,xa);var Aa=Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Gi(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);
var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function Gi(ba,
v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function Pl(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Wj(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Pl(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,
Object.getOwnPropertyDescriptors(C)):Pl(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Yk(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Zi(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,
B).enumerable}));C.push.apply(C,U)}return C}function Ek(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function Yj(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,U)}return C}function ql(ba){for(var v=
1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Yj(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Yj(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function lj(ba,v){var C="undefined"!=typeof Symbol&&ba[Symbol.iterator]||ba["@@iterator"];if(!C){if(Array.isArray(ba)||(C=function(ja,xa){if(ja){if("string"==typeof ja)return $i(ja,
xa);var Aa=Object.prototype.toString.call(ja).slice(8,-1);"Object"===Aa&&ja.constructor&&(Aa=ja.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ja);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return $i(ja,xa)}}(ba))||v&&ba&&"number"==typeof ba.length){C&&(ba=C);var U=0;v=function(){};return{s:v,n:function(){return U>=ba.length?{done:!0}:{done:!1,value:ba[U++]}},e:function(ja){throw ja;},f:v}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}var B,oa=!0,va=!1;return{s:function(){C=C.call(ba)},n:function(){var ja=C.next();return oa=ja.done,ja},e:function(ja){va=!0;B=ja},f:function(){try{oa||null==C.return||C.return()}finally{if(va)throw B;}}}}function $i(ba,v){(null==v||v>ba.length)&&(v=ba.length);for(var C=0,U=Array(v);C<v;C++)U[C]=ba[C];return U}function Zj(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));
C.push.apply(C,U)}return C}function Wd(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Zj(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Zj(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Pe(ba){var v=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;
if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(C){return!1}}();return function(){var C=r(ba);if(v){var U=r(this).constructor;C=Reflect.construct(C,arguments,U)}else C=C.apply(this,arguments);return D(this,C)}}function Wh(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,B).enumerable}));C.push.apply(C,
U)}return C}function qh(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Wh(Object(C),!0).forEach(function(U){T(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Wh(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}function Ng(ba,v){var C=Object.keys(ba);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(ba);v&&(U=U.filter(function(B){return Object.getOwnPropertyDescriptor(ba,
B).enumerable}));C.push.apply(C,U)}return C}function km(ba){for(var v=1;v<arguments.length;v++){var C=null!=arguments[v]?arguments[v]:{};v%2?Ng(Object(C),!0).forEach(function(U){mj()(ba,U,C[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ba,Object.getOwnPropertyDescriptors(C)):Ng(Object(C)).forEach(function(U){Object.defineProperty(ba,U,Object.getOwnPropertyDescriptor(C,U))})}return ba}e.r(g);e.d(g,{FONT_FAMILY:function(){return Cc.ut},default:function(){return Ov},defaultLang:function(){return Vg},
exportToBlob:function(){return Ru},exportToCanvas:function(){return it},exportToSvg:function(){return Yv},getElementMap:function(){return al},getFreeDrawSvgPath:function(){return Se},getSceneVersion:function(){return Uj},isInvisiblySmallElement:function(){return Kj},languages:function(){return bk},loadFromBlob:function(){return vl},loadLibraryFromBlob:function(){return jo},restore:function(){return Tm},restoreAppState:function(){return Um},restoreElements:function(){return sl},serializeAsJSON:function(){return Jn}});
var Hg=e(6479),Xh=e.n(Hg),ak=e(9713),mj=e.n(ak),ve=e(4698),de=e.n(ve),Cc=e(8288),Fk=JSON.parse('{"u2":"@excalidraw/excalidraw","i8":"0.10.0"}');"production"!==Cc.Vi.TEST&&(e.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(Fk.u2,"@").concat(Fk.i8,"/dist/"));var ff=e(8950),Oi=e(7945),Zd=e.n(Oi),Pm=e(1463),Hk=e(4451),Vg={code:"en",label:"English"},bk=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",
label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"ko-KR",label:"한국어"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},
{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"lv-LV",label:"Latviešu"},{code:"cs-CZ",label:"Česky"},
{code:"kk-KZ",label:"Қазақ тілі"}].concat([Vg]).sort(function(ba,v){return ba.label>v.label?1:-1}).filter(function(ba){return 85<=Hk[ba.code]});"production"===Cc.Vi.DEVELOPMENT&&bk.unshift({code:"__test__",label:"test language"},{code:"".concat("__test__",".rtl"),label:"test language (rtl)",rtl:!0});var Cg=Vg,yh={},tg=function(){var ba=(0,ff.Z)(Zd().mark(function U(C){return Zd().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(Cg=C,document.documentElement.dir=Cg.rtl?"rtl":"ltr",document.documentElement.lang=
Cg.code,!C.code.startsWith("__test__")){B.next=7;break}yh={};B.next=10;break;case 7:return B.next=9,e(788)("./".concat(Cg.code,".json"));case 9:yh=B.sent;case 10:case "end":return B.stop()}},U)}));return function(C){return ba.apply(this,arguments)}}(),zh=function(ba,v){for(var C=0;C<v.length;++C){var U=v[C];if(void 0===ba[U])return;ba=ba[U]}if("string"==typeof ba)return ba},$b=function(ba,v){if(Cg.code.startsWith("__test__"))return ba=v?"".concat(ba,"(").concat(JSON.stringify(v).slice(1,-1),")"):
ba,"[[".concat(ba,"]]");var C=ba.split(".");C=zh(yh,C)||zh(Pm,C);if(void 0===C)throw Error("Can't find translation for ".concat(ba));if(v)for(var U in v)C=C.replace("{{".concat(U,"}}"),v[U]);return C},Va=e(4512),Aj=function(){return(0,Va.jsx)("div",{className:"LoadingMessage",children:(0,Va.jsx)("span",{children:$b("labels.loadingScene")})})},Rl=function(ba){function v(){var B,oa;k(this,v);for(var va=arguments.length,ja=Array(va),xa=0;xa<va;xa++)ja[xa]=arguments[xa];return D(oa,(B=oa=U.call.apply(U,
[this].concat(ja)),oa.state={isLoading:!0},B))}K(v,ba);var C,U=V(v);return z(v,[{key:"componentDidMount",value:(C=(0,ff.Z)(Zd().mark(function oa(){var va,ja=this;return Zd().wrap(function(xa){for(;;)switch(xa.prev=xa.next){case 0:return va=bk.find(function(Aa){return Aa.code===ja.props.langCode})||Vg,xa.next=3,tg(va);case 3:this.setState({isLoading:!1});case 4:case "end":return xa.stop()}},oa,this)})),function(){return C.apply(this,arguments)})},{key:"render",value:function(){return this.state.isLoading?
(0,Va.jsx)(Aj,{}):this.props.children}}]),v}(de().Component);class Of{constructor(ba){this.helper=ba}fillPolygon(ba,v){return this._fillPolygon(ba,v)}_fillPolygon(ba,v,C=!1){let U=da(ba,v);C&&(ba=this.connectingLines(ba,U),U=U.concat(ba));return{type:"fillSketch",ops:this.renderLines(U,v)}}renderLines(ba,v){const C=[];for(const U of ba)C.push(...this.helper.doubleLineOps(U[0][0],U[0][1],U[1][0],U[1][1],v));return C}connectingLines(ba,v){const C=[];if(1<v.length)for(let B=1;B<v.length;B++){var U=v[B-
1];3>Y(U)||(U=[v[B][0],U[1]],3<Y(U)&&(U=this.splitOnIntersections(ba,U),C.push(...U)))}return C}midPointInPolygon(ba,v){return W(ba,(v[0][0]+v[1][0])/2,(v[0][1]+v[1][1])/2)}splitOnIntersections(ba,v){var C=Math.max(5,.1*Y(v)),U=[];for(var B=0;B<ba.length;B++){var oa=ba[B],va=ba[(B+1)%ba.length];if(S(oa,va,...v)&&(oa=P(oa,va,v[0],v[1]))){va=Y([oa,v[0]]);const ja=Y([oa,v[1]]);va>C&&ja>C&&U.push({point:oa,distance:va})}}if(1<U.length){C=U.sort((ja,xa)=>ja.distance-xa.distance).map(ja=>ja.point);if(W(ba,
...v[0])||C.shift(),W(ba,...v[1])||C.pop(),1>=C.length)return this.midPointInPolygon(ba,v)?[v]:[];v=[v[0],...C,v[1]];C=[];for(U=0;U<v.length-1;U+=2)B=[v[U],v[U+1]],this.midPointInPolygon(ba,B)&&C.push(B);return C}return this.midPointInPolygon(ba,v)?[v]:[]}}class Hi extends Of{fillPolygon(ba,v){return this._fillPolygon(ba,v,!0)}}class mh extends Of{fillPolygon(ba,v){const C=this._fillPolygon(ba,v);v=Object.assign({},v,{hachureAngle:v.hachureAngle+90});ba=this._fillPolygon(ba,v);return C.ops=C.ops.concat(ba.ops),
C}}class Ii{constructor(ba){this.helper=ba}fillPolygon(ba,v){ba=da(ba,v=Object.assign({},v,{curveStepCount:4,hachureAngle:0,roughness:1}));return this.dotsOnLines(ba,v)}dotsOnLines(ba,v){const C=[];let U=v.hachureGap;0>U&&(U=4*v.strokeWidth);U=Math.max(U,.1);let B=v.fillWeight;0>B&&(B=v.strokeWidth/2);const oa=U/4;for(const Aa of ba){var va=Y(Aa);ba=Math.ceil(va/U)-1;va-=ba*U;const Ca=(Aa[0][0]+Aa[1][0])/2-U/4,Ia=Math.min(Aa[0][1],Aa[1][1]);for(let Wa=0;Wa<ba;Wa++){var ja=Ia+va+Wa*U,xa=this.helper.randOffsetWithRange(Ca-
oa,Ca+oa,v);ja=this.helper.randOffsetWithRange(ja-oa,ja+oa,v);xa=this.helper.ellipse(xa,ja,B,B,v);C.push(...xa.ops)}}return{type:"fillSketch",ops:C}}}class ug{constructor(ba){this.helper=ba}fillPolygon(ba,v){ba=da(ba,v);return{type:"fillSketch",ops:this.dashedLine(ba,v)}}dashedLine(ba,v){const C=0>v.dashOffset?0>v.hachureGap?4*v.strokeWidth:v.hachureGap:v.dashOffset,U=0>v.dashGap?0>v.hachureGap?4*v.strokeWidth:v.hachureGap:v.dashGap,B=[];return ba.forEach(oa=>{var va=Y(oa);const ja=Math.floor(va/
(C+U));va=(va+U-ja*(C+U))/2;let xa=oa[0];var Aa=oa[1];xa[0]>Aa[0]&&(xa=oa[1],Aa=oa[0]);oa=Math.atan((Aa[1]-xa[1])/(Aa[0]-xa[0]));for(Aa=0;Aa<ja;Aa++){var Ca=Aa*(C+U),Ia=Ca+C;Ca=[xa[0]+Ca*Math.cos(oa)+va*Math.cos(oa),xa[1]+Ca*Math.sin(oa)+va*Math.sin(oa)];Ia=[xa[0]+Ia*Math.cos(oa)+va*Math.cos(oa),xa[1]+Ia*Math.sin(oa)+va*Math.sin(oa)];B.push(...this.helper.doubleLineOps(Ca[0],Ca[1],Ia[0],Ia[1],v))}}),B}}class ii{constructor(ba){this.helper=ba}fillPolygon(ba,v){const C=0>v.hachureGap?4*v.strokeWidth:
v.hachureGap,U=0>v.zigzagOffset?C:v.zigzagOffset;ba=da(ba,v=Object.assign({},v,{hachureGap:C+U}));return{type:"fillSketch",ops:this.zigzagLines(ba,U,v)}}zigzagLines(ba,v,C){const U=[];return ba.forEach(B=>{var oa=Y(B);oa=Math.round(oa/(2*v));let va=B[0];var ja=B[1];va[0]>ja[0]&&(va=B[1],ja=B[0]);B=Math.atan((ja[1]-va[1])/(ja[0]-va[0]));for(ja=0;ja<oa;ja++){var xa=2*ja*v,Aa=2*(ja+1)*v,Ca=Math.sqrt(2*Math.pow(v,2));xa=[va[0]+xa*Math.cos(B),va[1]+xa*Math.sin(B)];Aa=[va[0]+Aa*Math.cos(B),va[1]+Aa*Math.sin(B)];
Ca=[xa[0]+Ca*Math.cos(B+Math.PI/4),xa[1]+Ca*Math.sin(B+Math.PI/4)];U.push(...this.helper.doubleLineOps(xa[0],xa[1],Ca[0],Ca[1],C),...this.helper.doubleLineOps(Ca[0],Ca[1],Aa[0],Aa[1],C))}}),U}}const Ah={};class pi{constructor(ba){this.seed=ba}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const ck={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},ln={randOffset:function(ba,v){return Vb(ba,v)},randOffsetWithRange:function(ba,
v,C){return Kb(ba,v,C)},ellipse:function(ba,v,C,U,B){C=Fa(C,U,B);return Ma(ba,v,B,C).opset},doubleLineOps:function(ba,v,C,U,B){return gb(ba,v,C,U,B,!0)}};class aj{constructor(ba){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,combineNestedSvgPaths:!1,disableMultiStroke:!1,disableMultiStrokeFill:!1,
preserveVertices:!1};this.config=ba||{};this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(ba){return ba?Object.assign({},this.defaultOptions,ba):this.defaultOptions}_d(ba,v,C){return{shape:ba,sets:v||[],options:C||this.defaultOptions}}line(ba,v,C,U,B){B=this._o(B);return this._d("line",[{type:"path",ops:gb(ba,v,C,U,B)}],B)}rectangle(ba,v,C,U,B){B=this._o(B);const oa=[];var va=wa([[ba,v],[ba+C,v],[ba+C,v+U],[ba,v+U]],
!0,B);B.fill&&(ba=[[ba,v],[ba+C,v],[ba+C,v+U],[ba,v+U]],"solid"===B.fillStyle?oa.push(Ra(ba,B)):oa.push(qb(ba,B)));return"none"!==B.stroke&&oa.push(va),this._d("rectangle",oa,B)}ellipse(ba,v,C,U,B){B=this._o(B);const oa=[];U=Fa(C,U,B);C=Ma(ba,v,B,U);B.fill&&("solid"===B.fillStyle?(ba=Ma(ba,v,B,U).opset,ba.type="fillPath",oa.push(ba)):oa.push(qb(C.estimatedPoints,B)));return"none"!==B.stroke&&oa.push(C.opset),this._d("ellipse",oa,B)}circle(ba,v,C,U){ba=this.ellipse(ba,v,C,C,U);return ba.shape="circle",
ba}linearPath(ba,v){v=this._o(v);return this._d("linearPath",[wa(ba,!1,v)],v)}arc(ba,v,C,U,B,oa,va=!1,ja){ja=this._o(ja);const xa=[],Aa=La(ba,v,C,U,B,oa,va,!0,ja);if(va&&ja.fill)if("solid"===ja.fillStyle)ba=La(ba,v,C,U,B,oa,!0,!1,ja),ba.type="fillPath",xa.push(ba);else{va=xa.push;C=Math.abs(C/2);U=Math.abs(U/2);C+=Vb(.01*C,ja);for(U+=Vb(.01*U,ja);0>B;)B+=2*Math.PI,oa+=2*Math.PI;oa-B>2*Math.PI&&(B=0,oa=2*Math.PI);const Ca=(oa-B)/ja.curveStepCount,Ia=[];for(;B<=oa;B+=Ca)Ia.push([ba+C*Math.cos(B),v+
U*Math.sin(B)]);ba=(Ia.push([ba+C*Math.cos(oa),v+U*Math.sin(oa)]),Ia.push([ba,v]),qb(Ia,ja));va.call(xa,ba)}return"none"!==ja.stroke&&xa.push(Aa),this._d("arc",xa,ja)}curve(ba,v){v=this._o(v);const C=[],U=sa(ba,v);v.fill&&"none"!==v.fill&&3<=ba.length&&(ba=xb(function(B,oa=0){var va=B.length;if(3>va)throw Error("A curve must have at least three points.");const ja=[];if(3===va)ja.push([...B[0]],[...B[1]],[...B[2]],[...B[2]]);else{va=[];va.push(B[0],B[0]);for(var xa=1;xa<B.length;xa++)va.push(B[xa]),
xa===B.length-1&&va.push(B[xa]);B=[];oa=1-oa;ja.push([...va[0]]);for(xa=1;xa+2<va.length;xa++){const Aa=va[xa];B[0]=[Aa[0],Aa[1]];B[1]=[Aa[0]+(oa*va[xa+1][0]-oa*va[xa-1][0])/6,Aa[1]+(oa*va[xa+1][1]-oa*va[xa-1][1])/6];B[2]=[va[xa+1][0]+(oa*va[xa][0]-oa*va[xa+2][0])/6,va[xa+1][1]+(oa*va[xa][1]-oa*va[xa+2][1])/6];B[3]=[va[xa+1][0],va[xa+1][1]];ja.push(B[1],B[2],B[3])}}return ja}(ba),10,(1+v.roughness)/2),"solid"===v.fillStyle?C.push(Ra(ba,v)):C.push(qb(ba,v)));return"none"!==v.stroke&&C.push(U),this._d("curve",
C,v)}polygon(ba,v){v=this._o(v);const C=[],U=wa(ba,!0,v);return v.fill&&("solid"===v.fillStyle?C.push(Ra(ba,v)):C.push(qb(ba,v))),"none"!==v.stroke&&C.push(U),this._d("polygon",C,v)}path(ba,v){const C=this._o(v),U=[];if(!ba)return this._d("path",U,C);ba=(ba||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");v=C.fill&&"transparent"!==C.fill&&"none"!==C.fill;const B="none"!==C.stroke,oa=!!(C.simplification&&1>C.simplification),va=function(ja,xa,Aa){var Ca=ta(Z(za(ja)));ja=[];let Ia=
[];var Wa=[0,0];let $a=[];const rb=()=>{4<=$a.length&&Ia.push(...xb($a,xa));$a=[]};for(const {key:Hb,data:Xb}of Ca)switch(Hb){case "M":rb();Ia.length&&(ja.push(Ia),Ia=[]);Wa=[Xb[0],Xb[1]];Ia.push(Wa);break;case "L":rb();Ia.push([Xb[0],Xb[1]]);break;case "C":$a.length||(Ca=Ia.length?Ia[Ia.length-1]:Wa,$a.push([Ca[0],Ca[1]]));$a.push([Xb[0],Xb[1]]);$a.push([Xb[2],Xb[3]]);$a.push([Xb[4],Xb[5]]);break;case "Z":rb(),Ia.push([Wa[0],Wa[1]])}rb();Ia.length&&(ja.push(Ia),Ia=[]);if(!Aa)return ja;Wa=[];for(const Hb of ja)ja=
Sb(Hb,0,Hb.length,Aa),ja.length&&Wa.push(ja);return Wa}(ba,1,oa?4-4*C.simplification:(1+C.roughness)/2);if(v)if(C.combineNestedSvgPaths){const ja=[];va.forEach(xa=>ja.push(...xa));"solid"===C.fillStyle?U.push(Ra(ja,C)):U.push(qb(ja,C))}else va.forEach(ja=>{"solid"===C.fillStyle?U.push(Ra(ja,C)):U.push(qb(ja,C))});return B&&(oa?va.forEach(ja=>{U.push(wa(ja,!1,C))}):U.push(function(ja,xa){ja=ta(Z(za(ja)));const Aa=[];let Ca=[0,0],Ia=[0,0];for(const {key:Wa,data:$a}of ja)switch(Wa){case "M":const rb=
1*(xa.maxRandomnessOffset||0),Hb=xa.preserveVertices;Aa.push({op:"move",data:$a.map(Zc=>Zc+(Hb?0:Vb(rb,xa)))});Ia=[$a[0],$a[1]];Ca=[$a[0],$a[1]];break;case "L":Aa.push(...gb(Ia[0],Ia[1],$a[0],$a[1],xa));Ia=[$a[0],$a[1]];break;case "C":const [Xb,jc,nc,Tc,Xc,Pc]=$a;Aa.push(...Na(Xb,jc,nc,Tc,Xc,Pc,Ia,xa));Ia=[Xc,Pc];break;case "Z":Aa.push(...gb(Ia[0],Ia[1],Ca[0],Ca[1],xa)),Ia=[Ca[0],Ca[1]]}return{type:"path",ops:Aa}}(ba,C))),this._d("path",U,C)}opsToPath(ba,v){let C="";for(const U of ba.ops)switch(ba=
"number"==typeof v&&0<=v?U.data.map(B=>+B.toFixed(v)):U.data,U.op){case "move":C+=`M${ba[0]} ${ba[1]} `;break;case "bcurveTo":C+=`C${ba[0]} ${ba[1]}, ${ba[2]} ${ba[3]}, ${ba[4]} ${ba[5]} `;break;case "lineTo":C+=`L${ba[0]} ${ba[1]} `}return C.trim()}toPaths(ba){var v=ba.sets||[];ba=ba.options||this.defaultOptions;const C=[];for(const U of v){v=null;switch(U.type){case "path":v={d:this.opsToPath(U),stroke:ba.stroke,strokeWidth:ba.strokeWidth,fill:"none"};break;case "fillPath":v={d:this.opsToPath(U),
stroke:"none",strokeWidth:0,fill:ba.fill||"none"};break;case "fillSketch":v=this.fillSketch(U,ba)}v&&C.push(v)}return C}fillSketch(ba,v){let C=v.fillWeight;return 0>C&&(C=v.strokeWidth/2),{d:this.opsToPath(ba),stroke:v.fill||"none",strokeWidth:C,fill:"none"}}}class $k{constructor(ba,v){this.canvas=ba;this.ctx=this.canvas.getContext("2d");this.gen=new aj(v)}draw(ba){const v=ba.sets||[],C=ba.options||this.getDefaultOptions(),U=this.ctx;for(const B of v)switch(B.type){case "path":U.save();U.strokeStyle=
"none"===C.stroke?"transparent":C.stroke;U.lineWidth=C.strokeWidth;C.strokeLineDash&&U.setLineDash(C.strokeLineDash);C.strokeLineDashOffset&&(U.lineDashOffset=C.strokeLineDashOffset);this._drawToContext(U,B);U.restore();break;case "fillPath":U.save();U.fillStyle=C.fill||"";this._drawToContext(U,B,"curve"===ba.shape||"polygon"===ba.shape?"evenodd":"nonzero");U.restore();break;case "fillSketch":this.fillSketch(U,B,C)}}fillSketch(ba,v,C){let U=C.fillWeight;0>U&&(U=C.strokeWidth/2);ba.save();C.fillLineDash&&
ba.setLineDash(C.fillLineDash);C.fillLineDashOffset&&(ba.lineDashOffset=C.fillLineDashOffset);ba.strokeStyle=C.fill||"";ba.lineWidth=U;this._drawToContext(ba,v);ba.restore()}_drawToContext(ba,v,C="nonzero"){ba.beginPath();for(const U of v.ops){const B=U.data;switch(U.op){case "move":ba.moveTo(B[0],B[1]);break;case "bcurveTo":ba.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case "lineTo":ba.lineTo(B[0],B[1])}}"fillPath"===v.type?ba.fill(C):ba.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(ba,
v,C,U,B){ba=this.gen.line(ba,v,C,U,B);return this.draw(ba),ba}rectangle(ba,v,C,U,B){ba=this.gen.rectangle(ba,v,C,U,B);return this.draw(ba),ba}ellipse(ba,v,C,U,B){ba=this.gen.ellipse(ba,v,C,U,B);return this.draw(ba),ba}circle(ba,v,C,U){ba=this.gen.circle(ba,v,C,U);return this.draw(ba),ba}linearPath(ba,v){ba=this.gen.linearPath(ba,v);return this.draw(ba),ba}polygon(ba,v){ba=this.gen.polygon(ba,v);return this.draw(ba),ba}arc(ba,v,C,U,B,oa,va=!1,ja){ba=this.gen.arc(ba,v,C,U,B,oa,va,ja);return this.draw(ba),
ba}curve(ba,v){ba=this.gen.curve(ba,v);return this.draw(ba),ba}path(ba,v){ba=this.gen.path(ba,v);return this.draw(ba),ba}}class Hn{constructor(ba,v){this.svg=ba;this.gen=new aj(v)}draw(ba){var v=ba.sets||[];const C=ba.options||this.getDefaultOptions(),U=this.svg.ownerDocument||window.document,B=U.createElementNS("http://www.w3.org/2000/svg","g"),oa=ba.options.fixedDecimalPlaceDigits;for(const va of v){v=null;switch(va.type){case "path":v=U.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",
this.opsToPath(va,oa));v.setAttribute("stroke",C.stroke);v.setAttribute("stroke-width",C.strokeWidth+"");v.setAttribute("fill","none");C.strokeLineDash&&v.setAttribute("stroke-dasharray",C.strokeLineDash.join(" ").trim());C.strokeLineDashOffset&&v.setAttribute("stroke-dashoffset",`${C.strokeLineDashOffset}`);break;case "fillPath":v=U.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",this.opsToPath(va,oa));v.setAttribute("stroke","none");v.setAttribute("stroke-width","0");v.setAttribute("fill",
C.fill||"");"curve"!==ba.shape&&"polygon"!==ba.shape||v.setAttribute("fill-rule","evenodd");break;case "fillSketch":v=this.fillSketch(U,va,C)}v&&B.appendChild(v)}return B}fillSketch(ba,v,C){let U=C.fillWeight;0>U&&(U=C.strokeWidth/2);ba=ba.createElementNS("http://www.w3.org/2000/svg","path");return ba.setAttribute("d",this.opsToPath(v,C.fixedDecimalPlaceDigits)),ba.setAttribute("stroke",C.fill||""),ba.setAttribute("stroke-width",U+""),ba.setAttribute("fill","none"),C.fillLineDash&&ba.setAttribute("stroke-dasharray",
C.fillLineDash.join(" ").trim()),C.fillLineDashOffset&&ba.setAttribute("stroke-dashoffset",`${C.fillLineDashOffset}`),ba}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(ba,v){return this.gen.opsToPath(ba,v)}line(ba,v,C,U,B){ba=this.gen.line(ba,v,C,U,B);return this.draw(ba)}rectangle(ba,v,C,U,B){ba=this.gen.rectangle(ba,v,C,U,B);return this.draw(ba)}ellipse(ba,v,C,U,B){ba=this.gen.ellipse(ba,v,C,U,B);return this.draw(ba)}circle(ba,v,C,U){ba=this.gen.circle(ba,
v,C,U);return this.draw(ba)}linearPath(ba,v){ba=this.gen.linearPath(ba,v);return this.draw(ba)}polygon(ba,v){ba=this.gen.polygon(ba,v);return this.draw(ba)}arc(ba,v,C,U,B,oa,va=!1,ja){ba=this.gen.arc(ba,v,C,U,B,oa,va,ja);return this.draw(ba)}curve(ba,v){ba=this.gen.curve(ba,v);return this.draw(ba)}path(ba,v){ba=this.gen.path(ba,v);return this.draw(ba)}}var Bj={canvas:(ba,v)=>new $k(ba,v),svg:(ba,v)=>new Hn(ba,v),generator:ba=>new aj(ba),newSeed:()=>aj.newSeed()};let dk=(ba=21)=>{let v="",C=crypto.getRandomValues(new Uint8Array(ba));
for(;ba--;){let U=63&C[ba];v+=36>U?U.toString(36):62>U?(U-26).toString(36).toUpperCase():63>U?"_":"-"}return v};var Xg=function(ba){return null!=ba&&"text"===ba.type},ki=function(ba){return null!=ba&&"freedraw"===ba.type},Dg=function(ba){return null!=ba&&oj(ba.type)},oj=function(ba){return"arrow"===ba||"line"===ba},Wg=function(ba){return null!=ba&&"arrow"===ba.type},Ze=function(ba){return null!=ba&&("rectangle"===ba.type||"diamond"===ba.type||"ellipse"===ba.type||"text"===ba.type)},Jf=function(ba,
v,C,U,B){return[(ba-C)*Math.cos(B)-(v-U)*Math.sin(B)+C,(ba-C)*Math.sin(B)+(v-U)*Math.cos(B)+U]},Df=function(ba,v,C){return Jf(ba[0],ba[1],v[0],v[1],C)},qi=function(ba,v,C,U,B,oa,va,ja){var xa=Math.cos(U);U=Math.sin(U);return ba.e&&ba.w?v+=B+va:ba.e?(v+=B*(1+xa),C+=B*U,v+=va*(1-xa),C+=va*-U):ba.w&&(v+=B*(1-xa),C+=B*-U,v+=va*(1+xa),C+=va*U),ba.n&&ba.s?C+=oa+ja:ba.n?(v+=oa*U,C+=oa*(1-xa),v+=ja*-U,C+=ja*(1+xa)):ba.s&&(v+=oa*-U,C+=oa*(1+xa),v+=ja*U,C+=ja*(1-xa)),[v,C]},qj=function(ba){var v=1<arguments.length&&
void 0!==arguments[1]?arguments[1]:1;if(3<=ba.length){var C=[ba[0],ba[ba.length-1]],U=C[0];C=C[1];return Math.hypot(C[0]-U[0],C[1]-U[1])<=Cc.qx/v}return!1},ek=function(ba,v,C){var U=ba.length;if(3>U)return!1;var B=[Number.MAX_SAFE_INTEGER,C];v=[v,C];for(var oa=C=0;oa<U;oa++){var va=ba[oa],ja=ba[(oa+1)%U],xa=va,Aa=ja,Ca=v,Ia=B,Wa=Qi(xa,Aa,Ca),$a=Qi(xa,Aa,Ia),rb=Qi(Ca,Ia,xa),Hb=Qi(Ca,Ia,Aa);if(Wa!==$a&&rb!==Hb||0===Wa&&nh(xa,Ca,Aa)||0===$a&&nh(xa,Ia,Aa)||0===rb&&nh(Ca,xa,Ia)||0===Hb&&nh(Ca,Aa,Ia)){if(0===
Qi(va,v,ja))return nh(va,v,ja);C++}}return 1==C%2},nh=function(ba,v,C){return v[0]<=Math.max(ba[0],C[0])&&v[0]>=Math.min(ba[0],C[0])&&v[1]<=Math.max(ba[1],C[1])&&v[1]>=Math.min(ba[1],C[1])},Qi=function(ba,v,C){ba=(v[1]-ba[1])*(C[0]-v[0])-(v[0]-ba[0])*(C[1]-v[1]);return 0===ba?0:0<ba?1:2},Ch=function(ba,v,C){return C?[Math.round(ba/C)*C,Math.round(v/C)*C]:[ba,v]},lm=function(ba,v,C){var U=C.map(function(xa){return xa[ba]}),B=Math.max.apply(Math,O(U));U=Math.min.apply(Math,O(U));B-=U;var oa=0===B?1:
v/B,va=1/0;v=C.map(function(xa){return xa.map(function(Aa,Ca){if(Ca!==ba)return Aa;Aa*=oa;return va=Math.min(Aa,va),Aa})});if(2===v.length)return v;var ja=U-va;return v.map(function(xa){return xa.map(function(Aa,Ca){return Ca===ba?Aa+ja:Aa})})},Vf=function(ba){if(ki(ba)){var v=ca(tl(ba.points),4);ba=[v[0]+ba.x,v[1]+ba.y,v[2]+ba.x,v[3]+ba.y]}else ba=Dg(ba)?jf(ba):[ba.x,ba.y,ba.x+ba.width,ba.y+ba.height];return ba},Ik=function(ba){var v,C=wc(ba.sets);try{for(C.s();!(v=C.n()).done;){var U=v.value;if("path"===
U.type)return U.ops}}catch(B){C.e(B)}finally{C.f()}return ba.sets[0].ops},Mh=function(ba,v){var C=[0,0];ba=ba.reduce(function(U,B){var oa=B.op;B=B.data;if("move"===oa)C=B;else if("bcurveTo"===oa){var va=[B[0],B[1]],ja=[B[2],B[3]],xa=[B[4],B[5]],Aa=C;C=xa;oa=function(Wa,$a){return Math.pow(1-Wa,3)*xa[$a]+3*Wa*Math.pow(1-Wa,2)*ja[$a]+3*Math.pow(Wa,2)*(1-Wa)*va[$a]+Aa[$a]*Math.pow(Wa,3)};for(B=0;1>=B;){var Ca=oa(B,0),Ia=oa(B,1);v&&(Ia=ca(v(Ca,Ia),2),Ca=Ia[0],Ia=Ia[1]);U.minY=Math.min(U.minY,Ia);U.minX=
Math.min(U.minX,Ca);U.maxX=Math.max(U.maxX,Ca);U.maxY=Math.max(U.maxY,Ia);B+=.1}}return U},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[ba.minX,ba.minY,ba.maxX,ba.maxY]},tl=function(ba){var v,C=1/0,U=1/0,B=-1/0,oa=-1/0;ba=wc(ba);try{for(ba.s();!(v=ba.n()).done;){var va=ca(v.value,2),ja=va[0],xa=va[1];C=Math.min(C,ja);U=Math.min(U,xa);B=Math.max(B,ja);oa=Math.max(oa,xa)}}catch(Aa){ba.e(Aa)}finally{ba.f()}return[C,U,B,oa]},jf=function(ba){if(2>ba.points.length||!kh.get(ba)){var v=ba.points.reduce(function(C,
U){var B=ca(U,2);U=B[0];B=B[1];return C.minY=Math.min(C.minY,B),C.minX=Math.min(C.minX,U),C.maxX=Math.max(C.maxX,U),C.maxY=Math.max(C.maxY,B),C},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});ba=[v.minX+ba.x,v.minY+ba.y,v.maxX+ba.x,v.maxY+ba.y]}else v=kh.get(ba),v=Ik(v[0]),v=ca(Mh(v),4),ba=[v[0]+ba.x,v[1]+ba.y,v[2]+ba.x,v[3]+ba.y];return ba},gk=function(ba){var v=ca(Vf(ba),4),C=v[0],U=v[1];var B=v[2];var oa=v[3],va=(C+B)/2,ja=(U+oa)/2;if(ki(ba))return B=tl(ba.points.map(function(Ia){Ia=ca(Ia,2);return Jf(Ia[0],
Ia[1],va-ba.x,ja-ba.y,ba.angle)})),B=ca(B,4),[B[0]+ba.x,B[1]+ba.y,B[2]+ba.x,B[3]+ba.y];if(Dg(ba))B=function(Ia,Wa,$a){if(2>Ia.points.length||!kh.get(Ia)){var rb=Ia.points.reduce(function(Hb,Xb){var jc=ca(Xb,2);Xb=jc[0];jc=jc[1];var nc=ca(Jf(Ia.x+Xb,Ia.y+jc,Wa,$a,Ia.angle),2);return Xb=nc[0],jc=nc[1],Hb.minY=Math.min(Hb.minY,jc),Hb.minX=Math.min(Hb.minX,Xb),Hb.maxX=Math.max(Hb.maxX,Xb),Hb.maxY=Math.max(Hb.maxY,jc),Hb},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[rb.minX,rb.minY,rb.maxX,rb.maxY]}rb=
kh.get(Ia);rb=Ik(rb[0]);return Mh(rb,function(Hb,Xb){return Jf(Ia.x+Hb,Ia.y+Xb,Wa,$a,Ia.angle)})}(ba,va,ja);else if("diamond"===ba.type){U=ca(Jf(va,U,va,ja,ba.angle),2);v=U[0];U=U[1];oa=ca(Jf(va,oa,va,ja,ba.angle),2);var xa=oa[0];oa=oa[1];var Aa=ca(Jf(C,ja,va,ja,ba.angle),2);C=Aa[0];Aa=Aa[1];var Ca=ca(Jf(B,ja,va,ja,ba.angle),2);B=Ca[0];Ca=Ca[1];B=[Math.min(v,xa,C,B),Math.min(U,oa,Aa,Ca),Math.max(v,xa,C,B),Math.max(U,oa,Aa,Ca)]}else"ellipse"===ba.type?(B=(B-C)/2,U=(oa-U)/2,xa=Math.cos(ba.angle),C=
Math.sin(ba.angle),v=Math.hypot(B*xa,U*C),B=Math.hypot(U*xa,B*C),B=[va-v,ja-B,va+v,ja+B]):(xa=ca(Jf(C,U,va,ja,ba.angle),2),v=xa[0],xa=xa[1],Aa=ca(Jf(C,oa,va,ja,ba.angle),2),C=Aa[0],Aa=Aa[1],Ca=ca(Jf(B,oa,va,ja,ba.angle),2),oa=Ca[0],Ca=Ca[1],U=ca(Jf(B,U,va,ja,ba.angle),2),B=U[0],U=U[1],B=[Math.min(v,C,oa,B),Math.min(xa,Aa,Ca,U),Math.max(v,C,oa,B),Math.max(xa,Aa,Ca,U)]);return B},Bg=function(ba){if(!ba.length)return[0,0,0,0];var v=1/0,C=-1/0,U=1/0,B=-1/0;return ba.forEach(function(oa){oa=ca(gk(oa),
4);var va=oa[1],ja=oa[2],xa=oa[3];v=Math.min(v,oa[0]);U=Math.min(U,va);C=Math.max(C,ja);B=Math.max(B,xa)}),[v,U,C,B]},Re=function(ba,v,C){if(!Dg(ba)&&!ki(ba))return[ba.x,ba.y,ba.x+v,ba.y+C];v=lm(0,v,lm(1,C,ba.points));ki(ba)?v=tl(v):(C=Bj.generator(),v="sharp"===ba.strokeSharpness?C.linearPath(v,Yf(ba)):C.curve(v,Yf(ba)),v=Ik(v),v=Mh(v));v=ca(v,4);return[v[0]+ba.x,v[1]+ba.y,v[2]+ba.x,v[3]+ba.y]},ul=function(ba,v,C){var U=Bj.generator();v="sharp"===C?U.linearPath(v,Yf(ba)):U.curve(v,Yf(ba));v=Ik(v);
v=ca(Mh(v),4);return[v[0]+ba.x,v[1]+ba.y,v[2]+ba.x,v[3]+ba.y]},mf=JSON.parse('{"white":"#ffffff","black":"#000000","gray":["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],"red":["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],"pink":["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],"grape":["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],"violet":["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],"indigo":["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],"blue":["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],"cyan":["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],"teal":["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],"green":["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],"lime":["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],"yellow":["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],"orange":["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}'),
$h=function(ba){return[mf.red[ba],mf.pink[ba],mf.grape[ba],mf.violet[ba],mf.indigo[ba],mf.blue[ba],mf.cyan[ba],mf.teal[ba],mf.green[ba],mf.lime[ba],mf.yellow[ba],mf.orange[ba]]},ri={canvasBackground:[mf.white,mf.gray[0],mf.gray[1]].concat(O($h(0))),elementBackground:["transparent",mf.gray[4],mf.gray[6]].concat(O($h(6))),elementStroke:[mf.black,mf.gray[8],mf.gray[7]].concat(O($h(9)))},rh=e(6207),xi=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),nj=/^Win/.test(window.navigator.platform),Af=
xi?"metaKey":"ctrlKey",oh=function(ba){return"ArrowLeft"===ba||"ArrowRight"===ba||"ArrowDown"===ba||"ArrowUp"===ba},Nh=function(ba){return ba.charAt(0).toUpperCase()+ba.slice(1)},Dj=function(ba){return ba instanceof HTMLElement&&"wysiwyg"===ba.dataset.type||ba instanceof HTMLBRElement||ba instanceof HTMLTextAreaElement||ba instanceof HTMLInputElement&&("text"===ba.type||"number"===ba.type)},mm=function(ba){ba=ba.fontFamily;for(var v=0,C=Object.entries(Cc.ut);v<C.length;v++){var U=ca(C[v],2),B=U[0];
if(U[1]===ba)return"".concat(B,", ").concat(Cc._D)}return Cc._D},jk=function(ba){var v=ba.fontFamily;return"".concat(ba.fontSize,"px ").concat(mm({fontFamily:v}))},Vl=function(ba,v){var C=document.createElement("div"),U=document.body;C.style.position="absolute";C.style.whiteSpace="pre";C.style.font=v;U.appendChild(C);C.innerText=ba.split("\n").map(function(B){return B||" "}).join("\n");ba=C.offsetWidth;v=C.offsetHeight;U=document.createElement("span");U.style.display="inline-block";U.style.overflow=
"hidden";U.style.width="1px";U.style.height="1px";C.appendChild(U);U=U.offsetTop+U.offsetHeight;return document.body.removeChild(C),{width:ba,height:v,baseline:U}},Sm=function(ba,v){var C=0,U=null,B=function(){for(var oa=arguments.length,va=Array(oa),ja=0;ja<oa;ja++)va[ja]=arguments[ja];U=va;clearTimeout(C);C=window.setTimeout(function(){U=null;ba.apply(void 0,va)},v)};return B.flush=function(){if(clearTimeout(C),U){var oa=U;U=null;ba.apply(void 0,O(oa))}},B.cancel=function(){U=null;clearTimeout(C)},
B},Pi=function(ba){ba&&(ba.style.cursor="")},yi=function(ba,v){ba&&(ba.style.cursor=v)},si=function(ba,v){ba&&("selection"===v?Pi(ba):ba.style.cursor=Cc.oc.CROSSHAIR)},Ul=function(){var ba;return"HTML"===(null===(ba=document.fullscreenElement)||void 0===ba?void 0:ba.nodeName)},Vd=function(ba){return ba=ba.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),xi?ba.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):ba.replace(/\bCtrlOrCmd\b/i,
"Ctrl")},hh=function(ba,v){var C=v.zoom,U=1/C.value;return{x:(ba.clientX-C.translation.x-v.offsetLeft)*U-v.scrollX,y:(ba.clientY-C.translation.y-v.offsetTop)*U-v.scrollY}},hk=function(ba,v){var C=v.zoom;return{x:(ba.sceneX+v.scrollX+v.offsetLeft)*C.value+C.translation.x,y:(ba.sceneY+v.scrollY+v.offsetTop)*C.value+C.translation.y}},Gj=function(ba){return getComputedStyle(document.documentElement).getPropertyValue("--".concat(ba))},ik=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ",
"]")),Hj=function(ba){ba=ca(ba,2);return{x:ba[0],y:ba[1]}},kk=function(ba){if("AbortError"!==(null==ba?void 0:ba.name))throw ba;},Ri=function(ba){var v=5===ba.length&&"0"===ba.substr(4,1),C=9===ba.length&&"00"===ba.substr(7,2);return v||C||ba===ri.elementBackground[0]},ag=function(ba){return function(v){(0,rh.unstable_batchedUpdates)(ba,v)}},Bm=Cc.ZB.includes(devicePixelRatio)?devicePixelRatio:1,Ij=function(){var ba=new Map,v=Cc.rk,C=Cc.n5,U=mf.black,B=Cc.Hg,oa="".concat($b("labels.untitled"),"-"),
va=oa.concat;var ja=new Date;var xa=ja.getFullYear();var Aa="".concat(ja.getMonth()+1).padStart(2,"0"),Ca="".concat(ja.getDate()).padStart(2,"0"),Ia="".concat(ja.getHours()).padStart(2,"0");ja="".concat(ja.getMinutes()).padStart(2,"0");xa="".concat(xa,"-").concat(Aa,"-").concat(Ca,"-").concat(Ia).concat(ja);return{theme:"light",collaborators:ba,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:v,currentItemFontSize:C,
currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:U,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:B,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:Bm,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,
gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:va.call(oa,xa),openMenu:null,openPopup:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:mf.white,
zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1}},xl={theme:{browser:!0,export:!1},collaborators:{browser:!1,export:!1},currentChartType:{browser:!0,export:!1},currentItemBackgroundColor:{browser:!0,export:!1},currentItemEndArrowhead:{browser:!0,export:!1},currentItemFillStyle:{browser:!0,export:!1},currentItemFontFamily:{browser:!0,export:!1},currentItemFontSize:{browser:!0,export:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1},currentItemOpacity:{browser:!0,
export:!1},currentItemRoughness:{browser:!0,export:!1},currentItemStartArrowhead:{browser:!0,export:!1},currentItemStrokeColor:{browser:!0,export:!1},currentItemStrokeSharpness:{browser:!0,export:!1},currentItemStrokeStyle:{browser:!0,export:!1},currentItemStrokeWidth:{browser:!0,export:!1},currentItemTextAlign:{browser:!0,export:!1},cursorButton:{browser:!0,export:!1},draggingElement:{browser:!1,export:!1},editingElement:{browser:!1,export:!1},editingGroupId:{browser:!0,export:!1},editingLinearElement:{browser:!1,
export:!1},elementLocked:{browser:!0,export:!1},elementType:{browser:!0,export:!1},errorMessage:{browser:!1,export:!1},exportBackground:{browser:!0,export:!1},exportEmbedScene:{browser:!0,export:!1},exportScale:{browser:!0,export:!1},exportWithDarkMode:{browser:!0,export:!1},fileHandle:{browser:!1,export:!1},gridSize:{browser:!0,export:!0},height:{browser:!1,export:!1},isBindingEnabled:{browser:!1,export:!1},isLibraryOpen:{browser:!1,export:!1},isLoading:{browser:!1,export:!1},isResizing:{browser:!1,
export:!1},isRotating:{browser:!1,export:!1},lastPointerDownWith:{browser:!0,export:!1},multiElement:{browser:!1,export:!1},name:{browser:!0,export:!1},offsetLeft:{browser:!1,export:!1},offsetTop:{browser:!1,export:!1},openMenu:{browser:!0,export:!1},openPopup:{browser:!1,export:!1},pasteDialog:{browser:!1,export:!1},previousSelectedElementIds:{browser:!0,export:!1},resizingElement:{browser:!1,export:!1},scrolledOutside:{browser:!0,export:!1},scrollX:{browser:!0,export:!1},scrollY:{browser:!0,export:!1},
selectedElementIds:{browser:!0,export:!1},selectedGroupIds:{browser:!0,export:!1},selectionElement:{browser:!1,export:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1},showHelpDialog:{browser:!1,export:!1},showStats:{browser:!0,export:!1},startBoundElement:{browser:!1,export:!1},suggestedBindings:{browser:!1,export:!1},toastMessage:{browser:!1,export:!1},viewBackgroundColor:{browser:!0,export:!0},width:{browser:!1,export:!1},zenModeEnabled:{browser:!0,export:!1},zoom:{browser:!0,export:!1},viewModeEnabled:{browser:!1,
export:!1}},fk=function(ba,v){var C,U={},B=$c(Object.keys(ba));try{for(B.s();!(C=B.n()).done;){var oa=C.value,va=xl[oa];null!=va&&va[v]&&(U[oa]=ba[oa])}}catch(ja){B.e(ja)}finally{B.f()}return U},{min:Wl,PI:nn}=Math,Gm=nn+1E-4,zj=Ij(),Sl=function(ba,v,C){switch(C.globalAlpha=ba.opacity/100,ba.type){case "rectangle":case "diamond":case "ellipse":C.lineJoin="round";C.lineCap="round";v.draw(kh.get(ba));break;case "arrow":case "line":C.lineJoin="round";C.lineCap="round";kh.get(ba).forEach(function(xa){v.draw(xa)});
break;case "freedraw":C.save();C.fillStyle=ba.strokeColor;var U=Oh.get(ba);C.fillStyle=ba.strokeColor;C.fill(U);C.restore();break;default:if(!Xg(ba))throw Error("Unimplemented type ".concat(ba.type));var B=ik.test(ba.text);(U=B&&!C.canvas.isConnected)&&document.body.appendChild(C.canvas);C.canvas.setAttribute("dir",B?"rtl":"ltr");C.save();C.font=jk(ba);C.fillStyle=ba.strokeColor;C.textAlign=ba.textAlign;B=ba.text.replace(/\r\n?/g,"\n").split("\n");var oa=ba.height/B.length,va=ba.height-ba.baseline;
ba="center"===ba.textAlign?ba.width/2:"right"===ba.textAlign?ba.width:0;for(var ja=0;ja<B.length;ja++)C.fillText(B[ja],ba,(ja+1)*oa-va);C.restore();U&&C.canvas.remove()}C.globalAlpha=1},Xl=new WeakMap,kh=new WeakMap,Yf=function(ba){var v={seed:ba.seed,strokeLineDash:"dashed"===ba.strokeStyle?[8,8+ba.strokeWidth]:"dotted"===ba.strokeStyle?[1.5,6+ba.strokeWidth]:void 0,disableMultiStroke:"solid"!==ba.strokeStyle,strokeWidth:"solid"!==ba.strokeStyle?ba.strokeWidth+.5:ba.strokeWidth,fillWeight:ba.strokeWidth/
2,hachureGap:4*ba.strokeWidth,roughness:ba.roughness,stroke:ba.strokeColor,preserveVertices:1<arguments.length&&void 0!==arguments[1]&&arguments[1]};switch(ba.type){case "rectangle":case "diamond":case "ellipse":return v.fillStyle=ba.fillStyle,v.fill="transparent"===ba.backgroundColor?void 0:ba.backgroundColor,"ellipse"===ba.type&&(v.curveFitting=1),v;case "line":return qj(ba.points)&&(v.fillStyle=ba.fillStyle,v.fill="transparent"===ba.backgroundColor?void 0:ba.backgroundColor),v;case "freedraw":case "arrow":return v;
default:throw Error("Unimplemented type ".concat(ba.type));}},hi=function(ba,v){var C=kh.get(ba)||null;if(!C){switch(Xl.delete(ba),ba.type){case "rectangle":if("round"===ba.strokeSharpness){var U=ba.width;C=ba.height;var B=.25*Math.min(U,C);C=v.path("M ".concat(B," 0 L ").concat(U-B," 0 Q ").concat(U," 0, ").concat(U," ").concat(B," L ").concat(U," ").concat(C-B," Q ").concat(U," ").concat(C,", ").concat(U-B," ").concat(C," L ").concat(B," ").concat(C," Q 0 ").concat(C,", 0 ").concat(C-B," L 0 ").concat(B,
" Q 0 0, ").concat(B," 0"),Yf(ba,!0))}else C=v.rectangle(0,0,ba.width,ba.height,Yf(ba));break;case "diamond":U=ca(function(Aa){var Ca=Math.floor(Aa.width/2)+1,Ia=Math.floor(Aa.height/2)+1;return[Ca,0,Aa.width,Ia,Ca,Aa.height,0,Ia]}(ba),8);C=v.polygon([[U[0],U[1]],[U[2],U[3]],[U[4],U[5]],[U[6],U[7]]],Yf(ba));break;case "ellipse":C=v.ellipse(ba.width/2,ba.height/2,ba.width,ba.height,Yf(ba));break;case "line":case "arrow":var oa=Yf(ba);C=ba.points.length?ba.points:[[0,0]];if(C="sharp"===ba.strokeSharpness?
oa.fill?[v.polygon(C,oa)]:[v.linearPath(C,oa)]:[v.curve(C,oa)],"arrow"===ba.type){var va=ba.startArrowhead;va=void 0===va?null:va;var ja=ba.endArrowhead;ja=void 0===ja?"arrow":ja;var xa=function(Aa,Ca,Ia,Wa){Ca=function(Xb,jc,nc,Tc){jc=Ik(jc[0]);if(1>jc.length)return null;var Xc="start"===nc?1:jc.length-1,Pc=jc[Xc].data,Zc=[Pc[4],Pc[5]],Dd=[Pc[2],Pc[3]],Yd=[Pc[0],Pc[1]];jc=jc[Xc-1];var md=[0,0];"move"===jc.op?md=jc.data:"bcurveTo"===jc.op&&(md=[jc.data[4],jc.data[5]]);Xc=function(pf,Ae){return Math.pow(1-
pf,3)*Zc[Ae]+3*pf*Math.pow(1-pf,2)*Dd[Ae]+3*Math.pow(pf,2)*(1-pf)*Yd[Ae]+md[Ae]*Math.pow(pf,3)};jc=ca("start"===nc?md:Zc,2);nc=jc[0];jc=jc[1];Pc=[Xc(.3,0),Xc(.3,1)];Xc=Pc[0];Pc=Pc[1];var sd=Math.hypot(nc-Xc,jc-Pc);Xc=(nc-Xc)/sd;Pc=(jc-Pc)/sd;sd={arrow:30,bar:15,dot:15}[Tc];var Hd=0;if("arrow"===Tc){var He=ca(Xb.points[Xb.points.length-1],2);Hd=He[0];He=He[1];var Sg=ca(1<Xb.points.length?Xb.points[Xb.points.length-2]:[0,0],2);Hd=Math.hypot(Hd-Sg[0],He-Sg[1])}else for(He=0;He<Xb.points.length;He++){var ni=
ca(Xb.points[He-1]||[0,0],2);Sg=ni[0];ni=ni[1];var Ai=ca(Xb.points[He],2);Hd+=Math.hypot(Ai[0]-Sg,Ai[1]-ni)}sd=Math.min(sd,Hd/2);Xc=nc-Xc*sd;Pc=jc-Pc*sd;if("dot"===Tc)return[nc,jc,Math.hypot(Pc-jc,Xc-nc)+Xb.strokeWidth];Tc={arrow:20,bar:90}[Tc];sd=ca(Jf(Xc,Pc,nc,jc,-Tc*Math.PI/180),2);Xb=sd[0];sd=sd[1];Tc=ca(Jf(Xc,Pc,nc,jc,Tc*Math.PI/180),2);return[nc,jc,Xb,sd,Tc[0],Tc[1]]}(Aa,Ca,Ia,Wa);if(null===Ca)return[];if("dot"===Wa)return Wa=ca(Ca,3),[v.circle(Wa[0],Wa[1],Wa[2],yg(yg({},oa),{},{fill:Aa.strokeColor,
fillStyle:"solid",stroke:"none"}))];var $a=ca(Ca,6);Wa=$a[0];Ca=$a[1];Ia=$a[2];var rb=$a[3],Hb=$a[4];$a=$a[5];"dotted"===Aa.strokeStyle?(Aa=[1.5,6+(Aa.strokeWidth-1)],oa.strokeLineDash=[Aa[0],Aa[1]-1]):delete oa.strokeLineDash;return[v.line(Ia,rb,Wa,Ca,oa),v.line(Hb,$a,Wa,Ca,oa)]};null!==va&&(va=xa(ba,C,"start",va),(B=C).push.apply(B,O(va)));null!==ja&&(B=xa(ba,C,"end",ja),(U=C).push.apply(U,O(B)))}break;case "freedraw":xg(ba);C=[];break;case "text":C=[]}kh.set(ba,C)}},gh=function(ba,v){var C=v?v.zoom:
zj.zoom,U=Xl.get(ba);v=U&&U.canvasZoom!==C.value&&!(null!=v&&v.shouldCacheIgnoreZoom);if(!U||v){U=document.createElement("canvas");v=U.getContext("2d");var B="freedraw"===ba.type?12*ba.strokeWidth:20,oa=0,va=0;if(Dg(ba)||ki(ba)){var ja=ca(Vf(ba),4);oa=ja[0];va=ja[1];var xa=ja[2];ja=ja[3];oa=Math.floor(oa);xa=Math.ceil(xa);va=Math.floor(va);ja=Math.ceil(ja);U.width=Math.abs(oa-xa)*window.devicePixelRatio*C.value+B*C.value*2;U.height=Math.abs(va-ja)*window.devicePixelRatio*C.value+B*C.value*2;oa=ba.x>
oa?Math.floor(Math.abs(ba.x-oa))*window.devicePixelRatio*C.value:0;va=ba.y>va?Math.floor(Math.abs(ba.y-va))*window.devicePixelRatio*C.value:0;v.translate(oa,va)}else U.width=ba.width*window.devicePixelRatio*C.value+B*C.value*2,U.height=ba.height*window.devicePixelRatio*C.value+B*C.value*2;v.save();v.translate(B*C.value,B*C.value);v.scale(window.devicePixelRatio*C.value,window.devicePixelRatio*C.value);B=Bj.canvas(U);C=(Sl(ba,B,v),v.restore(),{element:ba,canvas:U,canvasZoom:C.value,canvasOffsetX:oa,
canvasOffsetY:va});return Xl.set(ba,C),C}return U},Dk=function(ba,v,C,U){v=ba.element;var B="freedraw"===v.type?12*v.strokeWidth:20,oa=ca(Vf(v),4),va=oa[0],ja=oa[1],xa=oa[2];oa=oa[3];ki(v)&&(va=Math.floor(va),xa=Math.ceil(xa),ja=Math.floor(ja),oa=Math.ceil(oa));var Aa=((va+xa)/2+U.scrollX)*window.devicePixelRatio;U=((ja+oa)/2+U.scrollY)*window.devicePixelRatio;C.save();C.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);C.translate(Aa,U);C.rotate(v.angle);C.drawImage(ba.canvas,-(xa-va)/2*
window.devicePixelRatio-B*ba.canvasZoom/ba.canvasZoom,-(oa-ja)/2*window.devicePixelRatio-B*ba.canvasZoom/ba.canvasZoom,ba.canvas.width/ba.canvasZoom,ba.canvas.height/ba.canvasZoom);C.restore()},lh=function(ba,v,C,U,B){var oa=v.generator;switch(ba.type){case "selection":C.save();C.translate(ba.x+B.scrollX,ba.y+B.scrollY);C.fillStyle="rgba(0, 0, 255, 0.10)";C.fillRect(0,0,ba.width,ba.height);C.restore();break;case "freedraw":if(hi(ba,oa),U)ba=gh(ba,B),Dk(ba,0,C,B);else{oa=ca(Vf(ba),4);var va=oa[0];
U=oa[1];var ja=oa[2],xa=oa[3];oa=(va+ja)/2+B.scrollX;B=(U+xa)/2+B.scrollY;va=(ja-va)/2-(ba.x-va);U=(xa-U)/2-(ba.y-U);C.save();C.translate(oa,B);C.rotate(ba.angle);C.translate(-va,-U);Sl(ba,v,C);C.restore()}break;case "rectangle":case "diamond":case "ellipse":case "line":case "arrow":case "text":(hi(ba,oa),U)?(ba=gh(ba,B),Dk(ba,0,C,B)):(oa=ca(Vf(ba),4),va=oa[0],U=oa[1],ja=oa[2],xa=oa[3],oa=(va+ja)/2+B.scrollX,B=(U+xa)/2+B.scrollY,va=(ja-va)/2-(ba.x-va),U=(xa-U)/2-(ba.y-U),C.save(),C.translate(oa,B),
C.rotate(ba.angle),C.translate(-va,-U),Sl(ba,v,C),C.restore());break;default:throw Error("Unimplemented type ".concat(ba.type));}},Li=function(ba,v,C){if(void 0===C)return ba.draw(v);v={sets:v.sets,shape:v.shape,options:yg(yg({},v.options),{},{fixedDecimalPlaceDigits:C})};return ba.draw(v)},Bf=function(ba,v,C,U,B){var oa=ca(Vf(ba),4),va=oa[0],ja=oa[1],xa=(oa[2]-va)/2-(ba.x-va),Aa=(oa[3]-ja)/2-(ba.y-ja),Ca=180*ba.angle/Math.PI;oa=v.generator;switch(ba.type){case "selection":throw Error("Selection rendering is not supported for SVG");
case "rectangle":case "diamond":case "ellipse":hi(ba,oa);oa=Li(v,kh.get(ba),Cc.zK);va=ba.opacity/100;1!==va&&(oa.setAttribute("stroke-opacity","".concat(va)),oa.setAttribute("fill-opacity","".concat(va)));oa.setAttribute("stroke-linecap","round");oa.setAttribute("transform","translate(".concat(U||0," ").concat(B||0,") rotate(").concat(Ca," ").concat(xa," ").concat(Aa,")"));C.appendChild(oa);break;case "line":case "arrow":hi(ba,oa);var Ia=C.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
"g"),Wa=ba.opacity/100;Ia.setAttribute("stroke-linecap","round");kh.get(ba).forEach(function(Tc){Tc=Li(v,Tc,Cc.zK);1!==Wa&&(Tc.setAttribute("stroke-opacity","".concat(Wa)),Tc.setAttribute("fill-opacity","".concat(Wa)));Tc.setAttribute("transform","translate(".concat(U||0," ").concat(B||0,") rotate(").concat(Ca," ").concat(xa," ").concat(Aa,")"));"line"===ba.type&&qj(ba.points)&&"transparent"!==ba.backgroundColor&&Tc.setAttribute("fill-rule","evenodd");Ia.appendChild(Tc)});C.appendChild(Ia);break;
case "freedraw":xg(ba);va=ba.opacity/100;oa=C.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");1!==va&&(oa.setAttribute("stroke-opacity","".concat(va)),oa.setAttribute("fill-opacity","".concat(va)));oa.setAttribute("transform","translate(".concat(U||0," ").concat(B||0,") rotate(").concat(Ca," ").concat(xa," ").concat(Aa,")"));va=C.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");oa.setAttribute("stroke","none");oa.setAttribute("fill",ba.strokeColor);va.setAttribute("d",
Se(ba));oa.appendChild(va);C.appendChild(oa);break;default:if(!Xg(ba))throw Error("Unimplemented type ".concat(ba.type));va=ba.opacity/100;oa=C.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");1!==va&&(oa.setAttribute("stroke-opacity","".concat(va)),oa.setAttribute("fill-opacity","".concat(va)));oa.setAttribute("transform","translate(".concat(U||0," ").concat(B||0,") rotate(").concat(Ca," ").concat(xa," ").concat(Aa,")"));va=ba.text.replace(/\r\n?/g,"\n").split("\n");ja=ba.height/va.length;
for(var $a=ba.height-ba.baseline,rb="center"===ba.textAlign?ba.width/2:"right"===ba.textAlign?ba.width:0,Hb=ik.test(ba.text)?"rtl":"ltr",Xb="center"===ba.textAlign?"middle":"right"===ba.textAlign||"rtl"===Hb?"end":"start",jc=0;jc<va.length;jc++){var nc=C.ownerDocument.createElementNS("http://www.w3.org/2000/svg","text");nc.textContent=va[jc];nc.setAttribute("x","".concat(rb));nc.setAttribute("y","".concat((jc+1)*ja-$a));nc.setAttribute("font-family",mm(ba));nc.setAttribute("font-size","".concat(ba.fontSize,
"px"));nc.setAttribute("fill",ba.strokeColor);nc.setAttribute("text-anchor",Xb);nc.setAttribute("style","white-space: pre;");nc.setAttribute("direction",Hb);oa.appendChild(nc)}C.appendChild(oa)}},Oh=new WeakMap([]),Ue=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g,Ph=function(){function ba(){k(this,ba);this.callbacks=new Set;this.nonDeletedElements=[];this.elements=[];this.elementsMap=new Map}return z(ba,[{key:"getElementsIncludingDeleted",value:function(){return this.elements}},{key:"getElements",
value:function(){return this.nonDeletedElements}},{key:"getElement",value:function(v){return this.elementsMap.get(v)||null}},{key:"getNonDeletedElement",value:function(v){return(v=this.getElement(v))&&!v.isDeleted?v:null}},{key:"getNonDeletedElements",value:function(v){var C=this,U=[];return v.forEach(function(B){B=C.getNonDeletedElement(B);null!=B&&U.push(B)}),U}},{key:"replaceAllElements",value:function(v){var C=this;this.elements=v;this.elementsMap.clear();v.forEach(function(U){C.elementsMap.set(U.id,
U);ba.mapElementToScene(U,C)});this.nonDeletedElements=pe(this.elements);this.informMutation()}},{key:"informMutation",value:function(){for(var v=0,C=Array.from(this.callbacks);v<C.length;v++)(0,C[v])()}},{key:"addCallback",value:function(v){var C=this;if(this.callbacks.has(v))throw Error();return this.callbacks.add(v),function(){if(!C.callbacks.has(v))throw Error();C.callbacks.delete(v)}}},{key:"destroy",value:function(){var v=this;ba.sceneMapById.forEach(function(C,U){C===v&&ba.sceneMapById.delete(U)});
this.callbacks.clear()}}],[{key:"mapElementToScene",value:function(v,C){"string"==typeof v?this.sceneMapById.set(v,C):this.sceneMapByElement.set(v,C)}},{key:"getScene",value:function(v){return"string"==typeof v?this.sceneMapById.get(v)||null:this.sceneMapByElement.get(v)||null}}]),ba}();Ph.sceneMapByElement=new WeakMap;Ph.sceneMapById=new Map;var Jj=new pi(Date.now()),yl=function(){return Math.floor(Jj.next()*Math.pow(2,31))},le=function(ba,v){var C,U=!1,B=v.points,oa;for(oa in void 0!==B&&(v=vb(vb({},
function($a){var rb=$a.map(function(Hb){return Hb[0]});$a=$a.map(function(Hb){return Hb[1]});return{width:Math.max.apply(Math,O(rb))-Math.min.apply(Math,O(rb)),height:Math.max.apply(Math,O($a))-Math.min.apply(Math,O($a))}}(B)),v)),v){var va=v[oa];if(void 0!==va&&(ba[oa]!==va||"object"===E(va)&&null!==va&&"groupIds"!==oa)){if("points"===oa){var ja=ba[oa],xa=va;if(ja.length===xa.length){for(var Aa=!1,Ca=ja.length;--Ca;){var Ia=ja[Ca],Wa=xa[Ca];if(Ia[0]!==Wa[0]||Ia[1]!==Wa[1]){Aa=!0;break}}if(!Aa)continue}}ba[oa]=
va;U=!0}}U&&(void 0===v.height&&void 0===v.width&&void 0===B||kh.delete(ba),ba.version++,ba.versionNonce=yl(),null===(C=Ph.getScene(ba))||void 0===C||C.informMutation())},cf=function(ba,v){var C=!1,U;for(U in v){var B=v[U];void 0!==B&&(ba[U]!==B||"object"===E(B)&&null!==B&&"groupIds"!==U)&&(C=!0)}return C?vb(vb(vb({},ba),v),{},{version:ba.version+1,versionNonce:yl()}):ba},vg=function(ba,v){return ba.version=(null!=v?v:ba.version)+1,ba.versionNonce=yl(),ba},Kj=function(ba){return Dg(ba)||ki(ba)?2>
ba.points.length:0===ba.width&&0===ba.height},mk=function(ba,v,C){var U=Math.abs(v),B=Math.abs(C);"line"===ba||"arrow"===ba||"freedraw"===ba?(ba=Math.round(Math.atan(B/U)/Cc.ay)*Cc.ay,0===ba?C=0:ba===Math.PI/2?v=0:C=Math.round(U*Math.tan(ba))*Math.sign(C)||C):"selection"!==ba&&(C=U*Math.sign(C));return{width:v,height:C}},Rj=function(ba){var v={width:ba.width,height:ba.height,x:ba.x,y:ba.y};if(0>ba.width){var C=Math.abs(ba.width);v.width=C;v.x=ba.x-C}0>ba.height&&(C=Math.abs(ba.height),v.height=C,
v.y=ba.y-C);return v},Pf=function(ba,v,C){C=C.filter(function(U){return U.groupIds.includes(ba)});return 2>C.length?v.selectedGroupIds[ba]||v.editingGroupId===ba?tc(tc({},v),{},{selectedGroupIds:tc(tc({},v.selectedGroupIds),{},T({},ba,!1)),editingGroupId:null}):v:tc(tc({},v),{},{selectedGroupIds:tc(tc({},v.selectedGroupIds),{},T({},ba,!0)),selectedElementIds:tc(tc({},v.selectedElementIds),Object.fromEntries(C.map(function(U){return[U.id,!0]})))})},dh=function(ba,v){return v.groupIds.filter(function(C){return C!==
ba.editingGroupId}).find(function(C){return ba.selectedGroupIds[C]})},vi=function(ba){return Object.entries(ba.selectedGroupIds).filter(function(v){v=ca(v,2);v[0];return v[1]}).map(function(v){v=ca(v,2);var C=v[0];v[1];return C})},Me=function(ba,v){var C=tc(tc({},ba),{},{selectedGroupIds:{}}),U=Sf(v,ba);if(!U.length)return tc(tc({},C),{},{editingGroupId:null});var B;U=nb(U);try{for(U.s();!(B=U.n()).done;){var oa=B.value.groupIds;if(ba.editingGroupId){var va=oa.indexOf(ba.editingGroupId);-1<va&&(oa=
oa.slice(0,va))}0<oa.length&&(C=Pf(oa[oa.length-1],C,v))}}catch(ja){U.e(ja)}finally{U.f()}return C},li=function(ba,v){return ba.filter(function(C){return C.groupIds.includes(v)})},gj="x y strokeColor backgroundColor fillStyle strokeWidth strokeStyle roughness opacity width height angle groupIds strokeSharpness boundElementIds".split(" "),xm=function(ba,v){var C,U,B=v.x,oa=v.y,va=v.strokeColor,ja=v.backgroundColor,xa=v.fillStyle,Aa=v.strokeWidth,Ca=v.strokeStyle,Ia=v.roughness,Wa=v.opacity,$a=v.width;
$a=void 0===$a?0:$a;var rb=v.height;rb=void 0===rb?0:rb;var Hb=v.angle;Hb=void 0===Hb?0:Hb;var Xb=v.groupIds;Xb=void 0===Xb?[]:Xb;var jc=v.strokeSharpness,nc=v.boundElementIds;nc=void 0===nc?null:nc;v=ab(v,gj);return{id:v.id||dk(),type:ba,x:B,y:oa,width:$a,height:rb,angle:Hb,strokeColor:va,backgroundColor:ja,fillStyle:xa,strokeWidth:Aa,strokeStyle:Ca,roughness:Ia,opacity:Wa,groupIds:Xb,strokeSharpness:jc,seed:null!==(C=v.seed)&&void 0!==C?C:yl(),version:v.version||1,versionNonce:null!==(U=v.versionNonce)&&
void 0!==U?U:0,isDeleted:!1,boundElementIds:nc}},xf=function(ba){return xm(ba.type,ba)},kl=function(ba,v){return{x:"center"===ba.textAlign?v.width/2:"right"===ba.textAlign?v.width:0,y:"middle"===ba.verticalAlign?v.height/2:0}},Eg=function(ba){var v=Vl(ba.text,jk(ba)),C=kl(ba,v);return cf(Rc(Rc({},xm("text",ba)),{},{text:ba.text,fontSize:ba.fontSize,fontFamily:ba.fontFamily,textAlign:ba.textAlign,verticalAlign:ba.verticalAlign,x:ba.x-C.x,y:ba.y-C.y,width:v.width,height:v.height,baseline:v.baseline}),
{})},Pg=function(ba){return Rc(Rc({},xm(ba.type,ba)),{},{points:ba.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:ba.startArrowhead,endArrowhead:ba.endArrowhead})},Wf=function C(v){var U=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;if(null==v||"object"!==E(v))return v;if("[object Object]"===Object.prototype.toString.call(v)){var B="function"==typeof v.constructor?Object.create(Object.getPrototypeOf(v)):{},oa;for(oa in v)v.hasOwnProperty(oa)&&(0!==U||
"shape"!==oa&&"canvas"!==oa)&&(B[oa]=C(v[oa],U+1));return B}if(Array.isArray(v)){B=v.length;for(oa=Array(B);B--;)oa[B]=C(v[B],U+1);return oa}return v},Xj=function(v,C,U,B){U=Wf(U);return U.id=dk(),U.seed=yl(),U.groupIds=function(oa,va,ja){var xa=O(oa);va=va?oa.indexOf(va):-1;oa=-1<va?va:oa.length;for(va=0;va<oa;va++)xa[va]=ja(xa[va]);return xa}(U.groupIds,v,function(oa){return C.has(oa)||C.set(oa,dk()),C.get(oa)}),B&&(U=Object.assign(U,B)),U},Qh={mouse:8,pen:16,touch:28},sj={e:!0,s:!0,n:!0,w:!0},
Nm={e:!0,s:!0,n:!0,w:!0},Qj={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Uf={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},af=function(v,C,U,B,oa,va,ja){v=ca(Jf(v+U/2,C+B/2,oa,va,ja),2);return[v[0]-U/2,v[1]-B/2,U,B]},Jg=function(v,C,U,B){var oa=ca(v,4),va=oa[0],ja=oa[1],xa=oa[2];oa=oa[3];var Aa=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},Ca=Qh[B],Ia=Ca/U.value,Wa=Ca/U.value,$a=Ca/U.value,rb=Ca/U.value,Hb=xa-va,Xb=oa-ja,jc=(va+xa)/2,nc=(ja+oa)/2,Tc=4/U.value;Ca=(Ca-8)/(2*U.value);var Xc={nw:Aa.nw?void 0:af(va-
Tc-$a+Ca,ja-Tc-rb+Ca,Ia,Wa,jc,nc,C),ne:Aa.ne?void 0:af(xa+Tc-Ca,ja-Tc-rb+Ca,Ia,Wa,jc,nc,C),sw:Aa.sw?void 0:af(va-Tc-$a+Ca,oa+Tc-Ca,Ia,Wa,jc,nc,C),se:Aa.se?void 0:af(xa+Tc-Ca,oa+Tc-Ca,Ia,Wa,jc,nc,C),rotation:Aa.rotation?void 0:af(va+Hb/2-Ia/2,ja-Tc-rb+Ca-16/U.value,Ia,Wa,jc,nc,C)},Pc=5*Qh.mouse/U.value;return Math.abs(Hb)>Pc&&(Aa.n||(Xc.n=af(va+Hb/2-Ia/2,ja-Tc-rb+Ca,Ia,Wa,jc,nc,C)),Aa.s||(Xc.s=af(va+Hb/2-Ia/2,oa+Tc-Ca,Ia,Wa,jc,nc,C))),Math.abs(Xb)>Pc&&(Aa.w||(Xc.w=af(va-Tc-$a+Ca,ja+Xb/2-Wa/2,Ia,Wa,
jc,nc,C)),Aa.e||(Xc.e=af(xa+Tc-Ca,ja+Xb/2-Wa/2,Ia,Wa,jc,nc,C))),Xc},Tk=function(v,C){var U=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"mouse",B={};if("arrow"===v.type||"line"===v.type||"freedraw"===v.type){if(2===v.points.length){var oa=ca(v.points,2)[1];0===oa[0]||0===oa[1]?B=Uf:0<oa[0]&&0>oa[1]?B=Qj:0<oa[0]&&0<oa[1]?B=Uf:0>oa[0]&&0<oa[1]?B=Qj:0>oa[0]&&0>oa[1]&&(B=Uf)}}else"text"===v.type&&(B=Nm);return Jg(Vf(v),v.angle,C,U,B)},th=function(v,C){return[0,0,0,0,C,v,1,0]},uh=function(){var v=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,C=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,U=[0,0,0,0,0,0,0,0];if(0>C||7<C)throw Error("Expected `index` betwen 0 and 7, got `".concat(C,"`"));return 0!==v&&(U[C]=v),U},uk=function(v){return[v[0],v[1],v[2],v[3],-v[4],-v[5],-v[6],-v[7]]},ll=function(v,C){return"number"==typeof C?[v[0]-C,v[1],v[2],v[3],v[4],v[5],v[6],v[7]]:[v[0]-C[0],v[1]-C[1],v[2]-C[2],v[3]-C[3],v[4]-C[4],v[5]-C[5],v[6]-C[6],v[7]-C[7]]},Ug=function(v,C){return"number"==
typeof C?[v[0]*C,v[1]*C,v[2]*C,v[3]*C,v[4]*C,v[5]*C,v[6]*C,v[7]*C]:[C[0]*v[0]+C[2]*v[2]+C[3]*v[3]-C[6]*v[6],C[1]*v[0]+C[0]*v[1]-C[4]*v[2]+C[5]*v[3]+C[2]*v[4]-C[3]*v[5]-C[7]*v[6]-C[6]*v[7],C[2]*v[0]+C[0]*v[2]-C[6]*v[3]+C[3]*v[6],C[3]*v[0]+C[6]*v[2]+C[0]*v[3]-C[2]*v[6],C[4]*v[0]+C[2]*v[1]-C[1]*v[2]+C[7]*v[3]+C[0]*v[4]+C[6]*v[5]-C[5]*v[6]+C[3]*v[7],C[5]*v[0]-C[3]*v[1]+C[7]*v[2]+C[1]*v[3]-C[6]*v[4]+C[0]*v[5]+C[4]*v[6]+C[2]*v[7],C[6]*v[0]+C[3]*v[2]-C[2]*v[3]+C[0]*v[6],C[7]*v[0]+C[6]*v[1]+C[5]*v[2]+C[4]*
v[3]+C[3]*v[4]+C[2]*v[5]+C[1]*v[6]+C[0]*v[7]]},Ki=function(v,C){return[ai(v,C),v[1]*C[7]+v[4]*C[5]-v[5]*C[4]+v[7]*C[1],v[2]*C[7]-v[4]*C[6]+v[6]*C[4]+v[7]*C[2],v[3]*C[7]+v[5]*C[6]-v[6]*C[5]+v[7]*C[3],v[4]*C[7]+v[7]*C[4],v[5]*C[7]+v[7]*C[5],v[6]*C[7]+v[7]*C[6],v[7]*C[7]]},ai=function(v,C){return v[0]*C[7]+v[1]*C[6]+v[2]*C[5]+v[3]*C[4]+v[4]*C[3]+v[5]*C[2]+v[6]*C[1]+v[7]*C[0]},lk=function(v){return Math.sqrt(Math.abs(v[0]*v[0]-v[2]*v[2]-v[3]*v[3]+v[6]*v[6]))},Lf=function(v){var C=lk(v);return 0===C||
1===C?v:Ug(v,(0>v[6]?-1:1)/C)},yf=(uh(1,1),uh(1,2),uh(1,3),uh(1,4),uh(1,5),uh(1,6),uh(1,7),function(v,C,U){return Lf([0,U,v,C,0,0,0,0])}),Ci=function(v,C){return U=v,[(B=C)[0]*U[0]+B[2]*U[2]+B[3]*U[3]-B[6]*U[6],B[1]*U[0]+B[0]*U[1]-B[4]*U[2]+B[5]*U[3]+B[2]*U[4]-B[3]*U[5]-B[7]*U[6]-B[6]*U[7],B[2]*U[0]+B[0]*U[2]-B[6]*U[3]+B[3]*U[6],B[3]*U[0]+B[6]*U[2]+B[0]*U[3]-B[2]*U[6],B[4]*U[0]+B[7]*U[3]+B[0]*U[4]+B[3]*U[7],B[5]*U[0]+B[7]*U[2]+B[0]*U[5]+B[2]*U[7],B[6]*U[0]+B[0]*U[6],B[7]*U[0]+B[0]*U[7]];var U,B},
Gh=function(v){v=ca(v,2);return[0,0,0,0,v[1],v[0],1,0]},Zh=function(v){return[v[5],v[4]]},Mk=function(v,C){return U=Ug(v,Math.sin(C/2)),B=Math.cos(C/2),"number"==typeof B?[U[0]+B,U[1],U[2],U[3],U[4],U[5],U[6],U[7]]:[U[0]+B[0],U[1]+B[1],U[2]+B[2],U[3]+B[3],U[4]+B[4],U[5]+B[5],U[6]+B[6],U[7]+B[7]];var U,B},Bh=function(v,C){return Lf(Ug(Ug(v,C),uk(v)))},Xi=function(v,C,U,B){var oa=10/C.zoom.value;return!Nk(v,C,[U,B])&&eg(v,[U,B],oa)},Nk=function(v,C,U){C=10/C.zoom.value;if("text"===v.type)var B=yk;else"arrow"===
v.type?B=!1:"freedraw"===v.type?B=!0:(B="transparent"!==v.backgroundColor,B="line"===v.type?B&&qj(v.points):B),B=B?vk:gm;return hj({element:v,point:U,threshold:C,check:B})},eg=function(v,C,U){C=ca(C,2);var B=C[0],oa=C[1],va=ca(Vf(v),4);C=va[0];var ja=va[1],xa=va[2];va=va[3];B=ca(Jf(B,oa,(C+xa)/2,(ja+va)/2,-v.angle),2);v=B[0];B=B[1];return v>C-U&&v<xa+U&&B>ja-U&&B<va+U},Uk=function(v,C){var U=C.x;C=C.y;var B=Rh(v,v.width,v.height);return hj({element:v,point:[U,C],threshold:B,check:bi})},Rh=function(v,
C,U){return Math.max(16,Math.min(.25*("diamond"===v.type?1/Math.sqrt(2):1)*Math.min(C,U),32))},hj=function(v){switch(v.element.type){case "rectangle":case "text":case "diamond":case "ellipse":var C=ml(v.element,v.point);return v.check(C,v.threshold);case "freedraw":if(C=!!v.check(wk(v.element,v.point),v.threshold))a:{C=v.element;var U=v.point;v=v.threshold;if(0===C.angle){var B=U[0]-C.x;U=U[1]-C.y}else{B=ca(Vf(C),4);var oa=B[0],va=B[1];U=Df(U,[oa+(B[2]-oa)/2,va+(B[3]-va)/2],-C.angle);B=U[0]-C.x;U=
U[1]-C.y}va=ca(C.points,2);oa=va[0];va=va[1];if(2===C.points.length)C=Math.hypot(B-oa[0],U-oa[1])<v||Math.hypot(B-va[0],U-va[1])<v;else{for(var ja=1;ja<C.points.length-1;ja++){var xa=[va[0]-oa[0],va[1]-oa[1]];var Aa=Math.hypot(xa[1],xa[0]);xa=[xa[0]/Aa,xa[1]/Aa];var Ca=[B-oa[0],U-oa[1]];Ca=(Ca[0]*xa[0]+Ca[1]*xa[1])/Math.hypot(xa[1],xa[0]);xa=[oa[0]+xa[0]*Ca,oa[1]+xa[1]*Ca];Ca=Math.hypot(oa[0]-xa[0],oa[1]-xa[1]);var Ia=Math.hypot(va[0]-xa[0],va[1]-xa[1]);if(xa=Ia<Ca&&Ca>Aa?va:Ca<Ia&&Ia>Aa?oa:xa,Math.hypot(U-
xa[1],B-xa[0])<v){C=!0;break a}oa=va;va=C.points[ja+1]}C=!1}}return C;case "arrow":case "line":return Ne(v);case "selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},ml=function(v,C){switch(v.type){case "rectangle":case "text":return wk(v,C);case "diamond":var U=ca(Jl(v,C),4);v=U[1];C=U[2];U=U[3];C=yf(U,C,-U*C);return ai(v,C);case "ellipse":return v=ca(nl(v,C),2),C=v[1],-Math.sign(C[1])*ai(v[0],C)}},yk=function(v,C){return 0>v},vk=function(v,C){return v<
C},gm=function(v,C){return Math.abs(v)<C},bi=function(v,C){return 0<=v&&v<C},wk=function(v,C){var U=ca(Jl(v,C),4),B=U[1],oa=U[2];v=Math;C=v.max;U=yf(0,1,-U[3]);U=ai(B,U);oa=yf(1,0,-oa);B=ai(B,oa);return C.call(v,U,B)},nl=function(v,C){C=ca(Jl(v,C),4);v=C[1];var U=C[2],B=C[3];C=ca(Zh(v),2);var oa=C[0],va=C[1],ja=.707,xa=.707;[0,1,2,3].forEach(function(Aa){Aa=(U*U-B*B)*Math.pow(ja,3)/U;var Ca=(B*B-U*U)*Math.pow(xa,3)/B,Ia=oa-Aa,Wa=va-Ca,$a=Math.hypot(B*xa-Ca,U*ja-Aa),rb=Math.hypot(Wa,Ia);ja=Math.min(1,
Math.max(0,(Ia*$a/rb+Aa)/U));xa=Math.min(1,Math.max(0,(Wa*$a/rb+Ca)/B));Aa=Math.hypot(xa,ja);ja/=Aa;xa/=Aa});C=th(U*ja,B*xa);return[v,Ci(Lf(Ki(C,v)),C)]},Ne=function(v){var C=v.element,U=v.threshold;if(!kh.get(C))return!1;var B=ca(Jl(v.element,v.point),4),oa=B[0],va=B[1],ja=B[2];B=yf(0,1,-B[3]);ja=yf(1,0,-ja);if(!vk(ai(va,B),U)||!vk(ai(va,ja),U))return!1;oa=ca(Zh(oa),2);var xa=oa[0],Aa=oa[1];oa=kh.get(C);return v.check===vk&&oa.some(function(Ca){var Ia=C.strokeSharpness;var Wa,$a=[],rb=!1;Ca=Gd(Ik(Ca));
try{for(Ca.s();!(Wa=Ca.n()).done;){var Hb=Wa.value;"move"===Hb.op?(rb=!rb)&&$a.push([Hb.data[0],Hb.data[1]]):"bcurveTo"===Hb.op&&rb&&($a.push([Hb.data[0],Hb.data[1]]),$a.push([Hb.data[2],Hb.data[3]]),$a.push([Hb.data[4],Hb.data[5]]))}}catch(Xb){Ca.e(Xb)}finally{Ca.f()}4<=$a.length?"sharp"===Ia?Ia=ek($a,xa,Aa):(Ia=xb($a,10,5),Ia=ek(Ia,xa,Aa)):Ia=!1;return Ia})?!0:oa.some(function(Ca){return tj(Ca,xa,Aa,U)})},Jl=function(v,C){var U=Gh(C);C=Vf(v);var B=uj(C),oa=Mk(B,v.angle);U=Bh(oa,U);B=ll(U,[0,0,0,
0,B[4],B[5],0,0]);B=[0,0,0,0,Math.abs(B[4]),Math.abs(B[5]),1,0];v=ll(U,[0,0,0,0,v.y,v.x,0,0]);C=ca(C,4);return[v,B,(C[2]-C[0])/2,(C[3]-C[1])/2]},fm=function(v){var C=Vf(v);C=uj(C);v=Mk(C,v.angle);C=[0,0,0,0,C[4],C[5],0,0];C=uk([1,0,0,0,-.5*C[5],.5*C[4],0,0]);return Ug(C,v)},uj=function(v){v=ca(v,4);return th((v[0]+v[2])/2,(v[1]+v[3])/2)},ij=function(v,C,U){var B=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;switch(v.type){case "rectangle":case "text":case "diamond":var oa=Sh(v);var va=
oa.flatMap(function(ja,xa){xa=ca([ja,oa[(xa+1)%4]],2);ja=xa[0];xa=xa[1];var Aa=[0,0,0,0,xa[4]-ja[4],xa[5]-ja[5],0,0];var Ca=Math.sqrt(Math.abs(Aa[7]*Aa[7]-Aa[5]*Aa[5]-Aa[4]*Aa[4]+Aa[1]*Aa[1]));Aa=0===Ca||1===Ca?Aa:Ug(Aa,1/Ca);Ca=.5*B;Aa=[1,0,0,0,Ca*Aa[4],Ca*Aa[5],0,0];ja=[Bh(Aa,ja),Bh(Aa,xa)];xa=ca(ja,2);ja=xa[0];xa=xa[1];if(0<=ai(ja,C)*ai(xa,C))var Ia=[];else{a:{xa=Lf(Ki(xa,ja));ja=Lf((Ia=C,[(Wa=xa)[0]*Ia[0],Wa[1]*Ia[0]+Wa[0]*Ia[1],Wa[2]*Ia[0]+Wa[0]*Ia[2],Wa[3]*Ia[0]+Wa[0]*Ia[3],Wa[4]*Ia[0]+Wa[2]*
Ia[1]-Wa[1]*Ia[2]+Wa[0]*Ia[4],Wa[5]*Ia[0]-Wa[3]*Ia[1]+Wa[1]*Ia[3]+Wa[0]*Ia[5],Wa[6]*Ia[0]+Wa[3]*Ia[2]-Wa[2]*Ia[3]+Wa[0]*Ia[6],Wa[7]*Ia[0]+Wa[6]*Ia[1]+Wa[5]*Ia[2]+Wa[4]*Ia[3]+Wa[3]*Ia[4]+Wa[2]*Ia[5]+Wa[1]*Ia[6]]));break a;var Wa}Ia=[ja]}return Ia}).concat(oa.flatMap(function(ja){if(0===B)var xa=0===ai(C,ja)?[ja]:[];else{xa=C[2];var Aa=C[3],Ca=C[1],Ia=ca(Zh(ja),2);ja=Ia[0];var Wa=Ia[1];Ia=xa*xa+Aa*Aa;var $a=B*B*Ia-Math.pow(xa*ja+Aa*Wa+Ca,2);if(0===Ia||0>=$a)xa=[];else{$a=Math.sqrt($a);var rb=ja*Aa*
Aa-Wa*xa*Aa-xa*Ca;Ca=Wa*xa*xa-ja*xa*Aa-Aa*Ca;xa=[th((rb+Aa*$a)/Ia,(Ca-xa*$a)/Ia),th((rb-Aa*$a)/Ia,(Ca+xa*$a)/Ia)]}}return xa}));break;case "ellipse":va=Hh(v,B,C)}if(2>va.length)return[];va=va.sort(function(ja,xa){return lk(Ki(ja,U))-lk(Ki(xa,U))});return[va[0],va[va.length-1]]},Sh=function(v){var C=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,U=C*v.width/2;C=C*v.height/2;switch(v.type){case "rectangle":case "text":return[th(U,C),th(U,-C),th(-U,-C),th(-U,C)];case "diamond":return[th(0,
C),th(U,0),th(0,-C),th(-U,0)]}},Hh=function(v,C,U){var B=v.width/2+C;v=v.height/2+C;C=U[2];var oa=U[3],va=U[1];U=B*B*C*C+v*v*oa*oa;var ja=U-va*va;if(0===U||0>=ja)return[];ja=Math.sqrt(ja);var xa=-B*B*C*va;va*=-v*v*oa;return[th((xa+B*v*oa*ja)/U,(va-B*v*C*ja)/U),th((xa-B*v*oa*ja)/U,(va+B*v*C*ja)/U)]},wi=function(v,C,U){var B=Math.sign(C),oa=0,va=null;return Sh(v,Math.abs(C)).forEach(function(ja){var xa=B*Lf(Ki(ja,U))[1];xa>oa&&(oa=xa,va=ja)}),va},tj=function(v,C,U,B){var oa=[0,0];return Ik(v).some(function(va,
ja){ja=va.op;var xa=va.data;if("move"===ja)oa=xa;else if("bcurveTo"===ja){va=[xa[0],xa[1]];ja=[xa[2],xa[3]];xa=[xa[4],xa[5]];var Aa=oa;return oa=xa,function(Ca,Ia,Wa,$a,rb,Hb){var Xb=ca(rb,2);rb=Xb[0];Xb=Xb[1];for(var jc=function(Pc,Zc){return Math.pow(1-Pc,3)*$a[Zc]+3*Pc*Math.pow(1-Pc,2)*Wa[Zc]+3*Math.pow(Pc,2)*(1-Pc)*Ia[Zc]+Ca[Zc]*Math.pow(Pc,3)},nc=0;1>=nc;){var Tc=jc(nc,0),Xc=jc(nc,1);if(Math.sqrt(Math.pow(Tc-rb,2)+Math.pow(Xc-Xb,2))<Hb)return!0;nc+=.01}return!1}(Aa,va,ja,xa,[C,U],B)}return!1})},
xk=["rotation"],Sj=function(v,C,U){return C>=v[0]&&C<=v[0]+v[2]&&U>=v[1]&&U<=v[1]+v[3]},fh=function(v,C,U,B,oa,va){return v.reduce(function(ja,xa){return ja?ja:(ja=function(Aa,Ca,Ia,Wa,$a,rb){if(!Ca.selectedElementIds[Aa.id])return!1;Aa=Tk(Aa,$a,rb);Ca=Aa.rotation;var Hb=ab(Aa,xk);if(Ca&&Sj(Ca,Ia,Wa))return"rotation";Aa=Object.keys(Hb).filter(function(Xb){Xb=Hb[Xb];return!!Xb&&Sj(Xb,Ia,Wa)});return 0<Aa.length&&Aa[0]}(xa,C,U,B,oa,va))?{element:xa,transformHandleType:ja}:null},null)},jj=function(v,
C,U,B,oa){v=ca(v,4);var va=Jg([v[0],v[1],v[2],v[3]],0,B,oa,sj);return Object.keys(va).find(function(ja){return(ja=va[ja])&&Sj(ja,C,U)})||!1},kd=["ns","nesw","ew","nwse"],me=function(v){var C=v.element,U=C&&-1==Math.sign(C.height)*Math.sign(C.width),B=null;switch(v.transformHandleType){case "n":case "s":B="ns";break;case "w":case "e":B="ew";break;case "nw":case "se":B=U?"nesw":"nwse";break;case "ne":case "sw":B=U?"nwse":"nesw";break;case "rotation":return"grab"}B&&C&&(v=B,C=C.angle,U=kd.indexOf(v),
0<=U&&(v=kd[(U+Math.round(C/(Math.PI/4)))%kd.length]),B=v);return B?"".concat(B,"-resize"):""},fd=function(){function v(C,U){k(this,v);this.elementId=C.id;Ph.mapElementToScene(this.elementId,U);v.normalizePoints(C);this.lastUncommittedPoint=this.activePointIndex=null;this.isDragging=!1;this.pointerOffset={x:0,y:0};this.endBindingElement=this.startBindingElement="keep"}return z(v,null,[{key:"getElement",value:function(C){var U;return(null===(U=Ph.getScene(C))||void 0===U?void 0:U.getNonDeletedElement(C))||
null}},{key:"handlePointDragging",value:function(C,U,B,oa,va){if(!C.editingLinearElement)return!1;var ja=C.editingLinearElement,xa=ja.activePointIndex,Aa=ja.isDragging,Ca=v.getElement(ja.elementId);return Ca?null!=xa&&-1<xa?(!1===Aa&&U({editingLinearElement:yc(yc({},ja),{},{isDragging:!0})}),C=v.createPointAt(Ca,B-ja.pointerOffset.x,oa-ja.pointerOffset.y,C.gridSize),v.movePoint(Ca,xa,C),Wg(Ca)&&va(Ca,0===xa?"start":"end"),!0):!1:!1}},{key:"handlePointerUp",value:function(C,U,B){C=U.activePointIndex;
var oa=U.isDragging,va=v.getElement(U.elementId);if(!va)return U;var ja={};!oa||0!==C&&C!==va.points.length-1||(qj(va.points,B.zoom.value)&&v.movePoint(va,C,0===C?va.points[va.points.length-1]:va.points[0]),ja=T({},0===C?"startBindingElement":"endBindingElement",B.isBindingEnabled?hg(Hj(v.getPointAtIndexGlobalCoordinates(va,C)),Ph.getScene(va)):null));return yc(yc(yc({},U),ja),{},{isDragging:!1,pointerOffset:{x:0,y:0}})}},{key:"handlePointerDown",value:function(C,U,B,oa,va){var ja={didAddPoint:!1,
hitElement:null};if(!U.editingLinearElement)return ja;var xa=v.getElement(U.editingLinearElement.elementId);if(!xa)return ja;if(C.altKey)return null==U.editingLinearElement.lastUncommittedPoint&&le(xa,{points:[].concat(O(xa.points),[v.createPointAt(xa,va.x,va.y,U.gridSize)])}),oa.resumeRecording(),B({editingLinearElement:yc(yc({},U.editingLinearElement),{},{activePointIndex:xa.points.length-1,lastUncommittedPoint:null,endBindingElement:hg(va,Ph.getScene(xa))})}),ja.didAddPoint=!0,ja;C=v.getPointIndexUnderCursor(xa,
U.zoom,va.x,va.y);if(-1<C)ja.hitElement=xa;else{var Aa=U.editingLinearElement;oa=Aa.startBindingElement;Aa=Aa.endBindingElement;U.isBindingEnabled&&Wg(xa)&&Nd(xa,oa,Aa)}Aa=ca(Vf(xa),4);oa=(Aa[0]+Aa[2])/2;Aa=(Aa[1]+Aa[3])/2;xa=-1<C&&Jf(xa.x+xa.points[C][0],xa.y+xa.points[C][1],oa,Aa,xa.angle);return B({editingLinearElement:yc(yc({},U.editingLinearElement),{},{activePointIndex:-1<C?C:null,pointerOffset:xa?{x:va.x-xa[0],y:va.y-xa[1]}:{x:0,y:0}})}),ja}},{key:"handlePointerMove",value:function(C,U,B,oa,
va){var ja=oa.lastUncommittedPoint,xa=v.getElement(oa.elementId);if(!xa)return oa;var Aa=xa.points,Ca=Aa[Aa.length-1];if(!C.altKey)return Ca===ja&&v.movePoint(xa,Aa.length-1,"delete"),yc(yc({},oa),{},{lastUncommittedPoint:null});C=v.createPointAt(xa,U-oa.pointerOffset.x,B-oa.pointerOffset.y,va);return Ca===ja?v.movePoint(xa,xa.points.length-1,C):v.movePoint(xa,"new",C),yc(yc({},oa),{},{lastUncommittedPoint:xa.points[xa.points.length-1]})}},{key:"getPointsGlobalCoordinates",value:function(C){var U=
ca(Vf(C),4),B=(U[0]+U[2])/2,oa=(U[1]+U[3])/2;return C.points.map(function(va){va=ca(Jf(C.x+va[0],C.y+va[1],B,oa,C.angle),2);return[va[0],va[1]]})}},{key:"getPointAtIndexGlobalCoordinates",value:function(C,U){var B=0>U?C.points.length+U:U;U=ca(Vf(C),4);B=C.points[B];return Jf(C.x+B[0],C.y+B[1],(U[0]+U[2])/2,(U[1]+U[3])/2,C.angle)}},{key:"pointFromAbsoluteCoords",value:function(C,U){var B=ca(Vf(C),4);U=ca(Jf(U[0],U[1],(B[0]+B[2])/2,(B[1]+B[3])/2,-C.angle),2);return[U[0]-C.x,U[1]-C.y]}},{key:"getPointIndexUnderCursor",
value:function(C,U,B,oa){C=this.getPointsGlobalCoordinates(C);for(var va=C.length;-1<--va;){var ja=C[va];if(Math.hypot(ja[0]-B,ja[1]-oa)*U.value<this.POINT_HANDLE_SIZE/2+1)return va}return-1}},{key:"createPointAt",value:function(C,U,B,oa){U=Ch(U,B,oa);B=ca(Vf(C),4);U=ca(Jf(U[0],U[1],(B[0]+B[2])/2,(B[1]+B[3])/2,-C.angle),2);return[U[0]-C.x,U[1]-C.y]}},{key:"getNormalizedPoints",value:function(C){var U=C.points,B=U[0][0],oa=U[0][1];return{points:U.map(function(va,ja){return[va[0]-B,va[1]-oa]}),x:C.x+
B,y:C.y+oa}}},{key:"normalizePoints",value:function(C){le(C,v.getNormalizedPoints(C))}},{key:"movePointByOffset",value:function(C,U,B){var oa=ca(C.points[U],2);v.movePoint(C,U,[oa[0]+B.x,oa[1]+B.y])}},{key:"movePoint",value:function(C,U,B,oa){var va=C.points,ja=0,xa=0;if("delete"===B){if("new"===U)throw Error("invalid args in movePoint");(B=va.slice()).splice(U,1);0===U&&(ja=B[0][0],xa=B[0][1],B=B.map(function(Wa,$a){return 0===$a?[0,0]:[Wa[0]-ja,Wa[1]-xa]}))}else if("new"===U)B=[].concat(O(va),[B]);
else{var Aa=B[0]-va[U][0],Ca=B[1]-va[U][1];B=va.map(function(Wa,$a){return $a===U?0===$a?(ja=Aa,xa=Ca,Wa):(ja=0,xa=0,[Wa[0]+Aa,Wa[1]+Ca]):ja||xa?[Wa[0]-ja,Wa[1]-xa]:Wa})}var Ia=ul(C,B,C.strokeSharpness||"round");va=ul(C,va,C.strokeSharpness||"round");va=Jf(ja,xa,(va[0]+va[2])/2-(Ia[0]+Ia[2])/2,(va[1]+va[3])/2-(Ia[1]+Ia[3])/2,C.angle);le(C,yc(yc({},oa),{},{points:B,x:C.x+va[0],y:C.y+va[1]}))}}]),v}();fd.POINT_HANDLE_SIZE=20;var Nd=function(v,C,U){var B=new Set,oa=new Set;fi(v,C,U,"start",B,oa);fi(v,
U,C,"end",B,oa);C=Array.from(oa).filter(function(va){return!B.has(va)});Ph.getScene(v).getNonDeletedElements(C).forEach(function(va){var ja;le(va,{boundElementIds:null===(ja=va.boundElementIds)||void 0===ja?void 0:ja.filter(function(xa){return xa!==v.id})})})},fi=function(v,C,U,B,oa,va){"keep"!==C&&(null!=C?null!=U&&("keep"===U?rd(v,C,B):"start"!==B&&U.id===C.id)||(Ti(v,C,B),oa.add(C.id)):(C="start"===B?"startBinding":"endBinding",U=v[C],v=null==U?null:(le(v,T({},C,null)),U.elementId),null!=v&&va.add(v)))},
If=function(v){v.forEach(function(C){Wg(C)?Nd(C,ee(C,"start"),ee(C,"end")):Ze(C)&&Th(C)})},Th=function(v){zf(v).forEach(function(C){C=ca(C,2);var U=C[1];return Nd(C[0],"end"===U?"keep":v,"start"===U?"keep":v)})},ng=function(v,C,U,B){null!=C.startBoundElement&&Ti(v,C.startBoundElement,"start");C=hg(B,U);null==C||rd(v,C,"end")||Ti(v,C,"end")},Ti=function(v,C,U){var B;le(v,T({},"start"===U?"startBinding":"endBinding",function(oa){for(var va=1;va<arguments.length;va++){var ja=null!=arguments[va]?arguments[va]:
{};va%2?cc(Object(ja),!0).forEach(function(xa){T(oa,xa,ja[xa])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ja)):cc(Object(ja)).forEach(function(xa){Object.defineProperty(oa,xa,Object.getOwnPropertyDescriptor(ja,xa))})}return oa}({elementId:C.id},hd(v,C,U))));le(C,{boundElementIds:Array.from(new Set([].concat(O(null!==(B=C.boundElementIds)&&void 0!==B?B:[]),[v.id])))})},rd=function(v,C,U){U=v["start"===U?"endBinding":"startBinding"];return(null==U?
void 0:U.elementId)===C.id&&3>v.points.length},Ad=function(v){v.forEach(function(C){Wg(C)&&Nd(C,null,null)})},hg=function(v,C){return la(C.getElements(),function(U){return Ze(U)&&Uk(U,v)})},hd=function(v,C,U){var B="start"===U?-1:1;U=-1===B?0:v.points.length-1;B=U-B;U=fd.getPointAtIndexGlobalCoordinates(v,U);B=fd.getPointAtIndexGlobalCoordinates(v,B);a:{v=fm(C);B=Bh(v,Gh(B));v=Bh(v,Gh(U));var oa=Lf(Ki(v,B));v=C.height/C.width;B=C.width/2;var va=C.height/2,ja=oa[2],xa=oa[3];oa=oa[1];var Aa=Math.abs(xa),
Ca=Math.abs(ja);switch(C.type){case "rectangle":case "text":v=oa/(B*(Ca+v*Aa));break a;case "diamond":v=Aa<Ca?oa/(Ca*B):oa/(Aa*va);break a;case "ellipse":v=oa/(B*Math.sqrt(Math.pow(ja,2)+Math.pow(v,2)*Math.pow(xa,2)));break a}v=void 0}return{focus:v,gap:Math.max(1,ml(C,U))}},Di=function(v,C){var U,B=null!==(U=v.boundElementIds)&&void 0!==U?U:[];if(0!==B.length){C=null!=C?C:{};var oa=C.newSize,va=Kl(C.simultaneouslyUpdated);Ph.getScene(v).getNonDeletedElements(B).forEach(function(ja){var xa,Aa;if((null===
(xa=ja.startBinding)||void 0===xa?void 0:xa.elementId)===v.id||(null===(Aa=ja.endBinding)||void 0===Aa?void 0:Aa.elementId)===v.id)xa=eh(v,ja.startBinding,oa),Aa=eh(v,ja.endBinding,oa),va.has(ja.id)?le(ja,{startBinding:xa,endBinding:Aa}):(vj(ja,"start",xa,v),vj(ja,"end",Aa,v))})}},Kl=function(v){return new Set((v||[]).map(function(C){return C.id}))},vj=function(v,C,U,B){if(!(null==U||U.elementId!==B.id&&2<v.points.length)){var oa=Ph.getScene(v).getElement(U.elementId);if(null!=oa){var va="start"===
C?-1:1;B=-1===va?0:v.points.length-1;var ja=fd.getPointAtIndexGlobalCoordinates(v,B-va);va=function(xa,Aa,Ca){if(0===Aa){var Ia=Vf(xa);Ia=uj(Ia);return Zh(Ia)}Ia=fm(xa);Ca=Bh(Ia,Gh(Ca));Ia=uk(Ia);switch(xa.type){case "rectangle":case "text":case "diamond":var Wa=wi(xa,Aa,Ca);break;case "ellipse":var $a=Math.abs(Aa);Wa=xa.width*$a/2;xa=xa.height*$a/2;Aa=Math.sign(Aa);$a=ca(Zh(Ca),2);Ca=$a[0];$a=$a[1];$a=0===$a?1E-4:$a;var rb=Math.pow(Ca,2)*Math.pow(xa,2)+Math.pow($a,2)*Math.pow(Wa,2);Aa=(-Ca*Math.pow(xa,
2)+Aa*$a*Math.sqrt(Math.max(0,rb-Math.pow(Wa,2)*Math.pow(xa,2))))/rb;Ca=(-Aa*Ca-1)/$a;Wa=-Math.pow(Wa,2)*Aa/(Math.pow(Ca,2)*Math.pow(xa,2)+Math.pow(Aa,2)*Math.pow(Wa,2));Wa=th(Wa,(-Aa*Wa-1)/Ca)}return Zh(Bh(Ia,Wa))}(oa,U.focus,ja);0===U.gap?oa=va:(oa=function(xa,Aa,Ca){var Ia=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,Wa=fm(xa),$a=Bh(Wa,Gh(Aa)),rb=Bh(Wa,Gh(Ca));rb=Lf(Ki(rb,$a));var Hb=uk(Wa);return ij(xa,rb,$a,Ia).map(function(Xb){return Zh(Bh(Hb,Xb))})}(oa,ja,va,U.gap),oa=0===oa.length?
va:oa[0]);fd.movePoint(v,B,fd.pointFromAbsoluteCoords(v,oa),T({},"start"===C?"startBinding":"endBinding",U))}}},eh=function(v,C,U){if(null==C||null==U)return C;var B=C.gap,oa=C.focus,va=U.width;U=U.height;var ja=v.width,xa=v.height;return{elementId:C.elementId,gap:Math.max(1,Math.min(Rh(v,va,U),B*(va<U?va/ja:U/xa))),focus:oa}},zg=function(v){return[ee(v,"start"),ee(v,"end")].filter(function(C){return null!=C})},ee=function(v,C){return hg(Hj(fd.getPointAtIndexGlobalCoordinates(v,"start"===C?0:-1)),
Ph.getScene(v))},zf=function(v){return Ph.getScene(v).getElements().map(function(C){if(!Wg(C))return null;var U=nk(C,"start",v),B=nk(C,"end",v);return U||B?[C,U&&B?"both":U?"start":"end",v]:null}).filter(function(C){return null!=C})},nk=function(v,C,U){return null==v["start"===C?"startBinding":"endBinding"]&&!rd(v,U,C)&&Uk(U,Hj(fd.getPointAtIndexGlobalCoordinates(v,"start"===C?0:-1)))},Tj=function(v,C,U,B){var oa=new Set,va=new Set,ja="duplicatesServeAsOld"===B;C.forEach(function(xa){var Aa=xa.boundElementIds;
if(null!=Aa&&0<Aa.length&&(Aa.forEach(function(Ca){ja&&!U.has(Ca)&&oa.add(Ca)}),va.add(U.get(xa.id))),Wg(xa))null!=xa.startBinding&&(Aa=xa.startBinding.elementId,ja&&!U.has(Aa)&&va.add(Aa)),null!=xa.endBinding&&(Aa=xa.endBinding.elementId,ja&&!U.has(Aa)&&va.add(Aa)),null==xa.startBinding&&null==xa.endBinding||oa.add(U.get(xa.id))});v.filter(function(xa){return oa.has(xa.id)}).forEach(function(xa){var Aa=xa.endBinding;le(xa,{startBinding:qe(xa.startBinding,U),endBinding:qe(Aa,U)})});v.filter(function(xa){return va.has(xa.id)}).forEach(function(xa){var Aa=
xa.boundElementIds;null!=Aa&&0<Aa.length&&le(xa,{boundElementIds:Aa.map(function(Ca){var Ia;return null!==(Ia=U.get(Ca))&&void 0!==Ia?Ia:Ca})})})},qe=function(v,C){var U;if(null==v)return null;var B=v.elementId;return{focus:v.focus,gap:v.gap,elementId:null!==(U=C.get(B))&&void 0!==U?U:B}},Ll=function(v,C){var U=new Set(C.map(function(oa){return oa.id})),B=new Set;C.forEach(function(oa){var va;Ze(oa)&&(null===(va=oa.boundElementIds)||void 0===va||va.forEach(function(ja){U.has(ja)||B.add(ja)}))});v.filter(function(oa){return B.has(oa.id)}).forEach(function(oa){var va=
oa.endBinding;le(oa,{startBinding:bj(oa.startBinding,U),endBinding:bj(va,U)})})},bj=function(v,C){return null==v||C.has(v.elementId)?null:v},fe=function(v){return v>=2*Math.PI?v-2*Math.PI:v},ok=function(v,C,U){return Dg(v)||ki(v)?{points:lm(0,C,lm(1,U,v.points))}:{}},fg=function(v,C,U){C=C/v.width*v.fontSize;if(1>C)return null;v=Vl(v.text,jk({fontSize:C,fontFamily:v.fontFamily}));return{size:C,baseline:v.baseline+(U-v.height)}},Fi=function(v,C,U,B,oa,va,ja){var xa=ca(Re(v,v.width,v.height),4),Aa=
[xa[0],xa[1]],Ca=[xa[2],xa[3]];xa=[(Aa[0]+Ca[0])/2,(Aa[1]+Ca[1])/2];var Ia=Df([va,ja],xa,-v.angle);va=ca(Re(U,U.width,U.height),4);var Wa=va[2]-va[0],$a=va[3]-va[1];va=(Ca[0]-Aa[0])/Wa;ja=(Ca[1]-Aa[1])/$a;B.includes("e")&&(va=(Ia[0]-Aa[0])/Wa);B.includes("s")&&(ja=(Ia[1]-Aa[1])/$a);B.includes("w")&&(va=(Ca[0]-Ia[0])/Wa);B.includes("n")&&(ja=(Ca[1]-Ia[1])/$a);Ia=v.width;Wa=v.height;va*=U.width;ja*=U.height;if(oa&&(va=2*va-Ia,ja=2*ja-Wa),C){$a=Math.abs(va)/Ia;var rb=Math.abs(ja)/Wa;if(1===B.length&&
(ja*=$a,va*=rb),2===B.length)$a=Math.max($a,rb),va=Ia*$a*Math.sign(va),ja=Wa*$a*Math.sign(ja)}rb=ca(Re(v,va,ja),4);Ia=rb[0];Wa=rb[1];$a=rb[2]-Ia;rb=rb[3]-Wa;var Hb=[].concat(Aa);if(["n","w","nw"].includes(B)&&(Hb=[Ca[0]-Math.abs($a),Ca[1]-Math.abs(rb)]),"ne"===B)Hb=[Aa[0],Ca[1]],Hb=[Hb[0],Hb[1]-Math.abs(rb)];"sw"===B&&(Aa=[Ca[0],Aa[1]],Hb=[Aa[0]-Math.abs($a),Aa[1]]);C&&(["s","n"].includes(B)&&(Hb[0]=xa[0]-$a/2),["e","w"].includes(B)&&(Hb[1]=xa[1]-rb/2));0>va&&(B.includes("e")&&(Hb[0]-=Math.abs($a)),
B.includes("w")&&(Hb[0]+=Math.abs($a)));0>ja&&(B.includes("s")&&(Hb[1]-=Math.abs(rb)),B.includes("n")&&(Hb[1]+=Math.abs(rb)));oa&&(Hb[0]=xa[0]-Math.abs($a)/2,Hb[1]=xa[1]-Math.abs(rb)/2);C=v.angle;B=Df(Hb,xa,C);xa=Df([Hb[0]+Math.abs($a)/2,Hb[1]+Math.abs(rb)/2],xa,C);Hb=Df(B,xa,-C);xa=ok(v,va,ja);C=O(Hb);C[0]+=v.x-Ia;C[1]+=v.y-Wa;v=jd({width:Math.abs(va),height:Math.abs(ja),x:C[0],y:C[1]},xa);0!==v.width&&0!==v.height&&Number.isFinite(v.x)&&Number.isFinite(v.y)&&(Di(U,{newSize:{width:v.width,height:v.height}}),
le(U,v))},Hm=function(v,C,U,B){var oa=ca(Bg(v),4),va=oa[0],ja=oa[1],xa=oa[2],Aa=oa[3];switch(C){case "se":var Ca=Math.max((U-va)/(xa-va),(B-ja)/(Aa-ja));var Ia=function($a,rb,Hb){var Xb=ca(rb,2);rb=Xb[0];Xb=Xb[1];Hb=ca(Hb,2);return{x:$a.x+(rb-va)*(Ca-1)+rb-Hb[0],y:$a.y+(Xb-ja)*(Ca-1)+Xb-Hb[1]}};break;case "nw":Ca=Math.max((xa-U)/(xa-va),(Aa-B)/(Aa-ja));Ia=function($a,rb,Hb){var Xb=ca(rb,4);rb=Xb[2];Xb=Xb[3];Hb=ca(Hb,4);return{x:$a.x-(xa-rb)*(Ca-1)+rb-Hb[2],y:$a.y-(Aa-Xb)*(Ca-1)+Xb-Hb[3]}};break;case "ne":Ca=
Math.max((U-va)/(xa-va),(Aa-B)/(Aa-ja));Ia=function($a,rb,Hb){var Xb=ca(rb,4);rb=Xb[0];Xb=Xb[3];Hb=ca(Hb,4);return{x:$a.x+(rb-va)*(Ca-1)+rb-Hb[0],y:$a.y-(Aa-Xb)*(Ca-1)+Xb-Hb[3]}};break;case "sw":Ca=Math.max((xa-U)/(xa-va),(B-ja)/(Aa-ja)),Ia=function($a,rb,Hb){var Xb=ca(rb,3);rb=Xb[1];Xb=Xb[2];Hb=ca(Hb,3);return{x:$a.x-(xa-Xb)*(Ca-1)+Xb-Hb[2],y:$a.y+(rb-ja)*(Ca-1)+rb-Hb[1]}}}if(0<Ca){var Wa=v.reduce(function($a,rb){if(!$a)return $a;var Hb=rb.width*Ca,Xb=rb.height*Ca,jc={};if("text"===rb.type){jc=fg(rb,
Hb,Xb);if(null===jc)return null;jc={fontSize:jc.size,baseline:jc.baseline}}var nc=Vf(rb),Tc=ok(rb,Hb,Xb);Di(rb,{newSize:{width:Hb,height:Xb},simultaneouslyUpdated:v});var Xc=Re(jd(jd({},rb),Tc),Hb,Xb);nc=Ia(rb,nc,Xc);rb=nc.x;nc=nc.y;return[].concat(O($a),[jd(jd({width:Hb,height:Xb,x:rb,y:nc},Tc),jc)])},[]);Wa&&v.forEach(function($a,rb){le($a,Wa[rb])})}},Bk=function(v,C,U,B,oa,va,ja){var xa=5*Math.PI/2+Math.atan2(B-ja,U-va);oa&&(xa+=Cc.ay/2,xa-=xa%Cc.ay);C.forEach(function(Aa,Ca){var Ia,Wa,$a=ca(Vf(Aa),
4);Ca=($a[0]+$a[2])/2;$a=($a[1]+$a[3])/2;var rb=null!==(Ia=null===(Wa=v.originalElements.get(Aa.id))||void 0===Wa?void 0:Wa.angle)&&void 0!==Ia?Ia:Aa.angle;Ia=ca(Jf(Ca,$a,va,ja,xa+rb-Aa.angle),2);le(Aa,{x:Aa.x+(Ia[0]-Ca),y:Aa.y+(Ia[1]-$a),angle:fe(xa+rb)})})},Ok=function(v,C,U,B,oa,va,ja,xa,Aa,Ca){Aa&&(C=mk(C,ja,va<B?-xa:xa),ja=C.width,0>(xa=C.height)&&(xa=-xa));oa=oa<U?U-ja:U;va=va<B?B-xa:B;Ca&&(oa=U-(ja+=ja)/2,va=B-(xa+=xa)/2);0!==ja&&0!==xa&&le(v,{x:oa,y:va,width:ja,height:xa})},Ak=function(v){return v.replace(/\t/g,
" ").replace(/\r?\n|\r/g,"\n")},Lj=function(v){var C=Vl(v.text,jk(v));le(v,{width:C.width,height:C.height,baseline:C.baseline})},wh=function(v,C){return!(v.viewModeEnabled||!v.editingElement&&!Sf(C,v).length&&"selection"===v.elementType)},al=function(v){return v.reduce(function(C,U){return C[U.id]=U,C},{})},Uj=function(v){return v.reduce(function(C,U){return C+U.version},0)},pe=function(v){return v.filter(function(C){return!C.isDeleted})},Ml=function(v){return pe(v).map(function(C){return oj(C.type)?
zb(zb({},C),{},{lastCommittedPoint:null}):C})},sh=function(v,C,U,B){var oa=B.scrollX,va=B.scrollY,ja=B.zoom;if(0===v.length)return{horizontal:null,vertical:null};B=ca(Bg(v),4);var xa=B[0],Aa=B[1];v=B[2];B=B[3];var Ca=C/ja.value,Ia=U/ja.value,Wa=C-Ca,$a=U-Ia;ja=parseInt(Gj("sat"));var rb=parseInt(Gj("sab")),Hb=parseInt(Gj("sal")),Xb=parseInt(Gj("sar")),jc=Cg.rtl;oa=Wa/2-oa+Hb;va=$a/2-va+ja;Ca=oa+Ca-Xb;Ia=va+Ia-rb;xa=Math.min(xa,oa);Aa=Math.min(Aa,va);v=Math.max(v,Ca);B=Math.max(B,Ia);return{horizontal:oa===
xa&&Ca===v?null:{x:Math.max(Hb,4)+(oa-xa)/(v-xa)*C,y:U-6-Math.max(4,rb),width:(Ca-oa)/(v-xa)*C-Math.max(8,Hb+Xb),height:6},vertical:va===Aa&&Ia===B?null:{x:jc?Math.max(Hb,4):C-6-Math.max(Xb,4),y:(va-Aa)/(B-Aa)*U+Math.max(ja,4),width:6,height:(Ia-va)/(B-Aa)*U-Math.max(8,ja+rb)}}},Yg=function(v,C,U){var B=ca([v.horizontal,v.vertical].map(function(oa){return null!=oa&&oa.x<=C&&C<=oa.x+oa.width&&oa.y<=U&&U<=oa.y+oa.height}),2);v=B[0];B=B[1];return{isOverEither:v||B,isOverHorizontal:v,isOverVertical:B}},
vh=function(v,C){return v.some(function(U){return C.selectedElementIds[U.id]})},Sf=function(v,C){return v.filter(function(U){return C.selectedElementIds[U.id]})},Kh=function(v,C){return C.editingElement?[C.editingElement]:Sf(v,C)},Ce=function(v){var C=v.scenePoint,U=v.viewportDimensions;v=v.zoom;return{scrollX:U.width/2*(1/v.value)-C.x-1/v.value*v.translation.x,scrollY:U.height/2*(1/v.value)-C.y-1/v.value*v.translation.y}},Fg=function(v,C,U){if(!(v=function(ja){return ja.filter(function(xa){return!xa.isDeleted&&
!Kj(xa)})}(v)).length)return{scrollX:0,scrollY:0};var B=ca(Bg(v),4);U=B[0];var oa=B[1],va=B[2];B=B[3];(function(ja,xa,Aa){xa=ca(Aa,4);Aa=xa[2];var Ca=xa[3],Ia=hk({sceneX:xa[0],sceneY:xa[1]},ja);xa=Ia.x;Ia=Ia.y;Aa=hk({sceneX:Aa,sceneY:Ca},ja);Ca=Aa.y;return Aa.x-xa>ja.width||Ca-Ia>ja.height})(C,0,[U,oa,va,B])&&(v=function(ja,xa){if(!ja.length)return[0,0,0,0];var Aa=1/0,Ca=ja[0];return ja.forEach(function(Ia){var Wa=ca(gk(Ia),4);Wa=Math.hypot(xa.x-(Wa[0]+Wa[2])/2,xa.y-(Wa[1]+Wa[3])/2);Wa<Aa&&(Aa=Wa,
Ca=Ia)}),gk(Ca)}(v,hh({clientX:C.scrollX,clientY:C.scrollY},C)),v=ca(v,4),U=v[0],oa=v[1],va=v[2],B=v[3]);return Ce({scenePoint:{x:(U+va)/2,y:(oa+B)/2},viewportDimensions:{width:C.width,height:C.height},zoom:C.zoom})},Pk=function(v){return"rectangle"===v||"ellipse"===v||"diamond"===v||"line"===v},Vk=function(v){return"rectangle"===v||"ellipse"===v||"diamond"===v||"freedraw"===v||"arrow"===v||"line"===v},q=function(v){return"rectangle"===v||"ellipse"===v||"diamond"===v||"arrow"===v||"line"===v},I=function(v){return"rectangle"===
v||"arrow"===v||"line"===v},la=function(v,C){for(var U=null,B=v.length-1;0<=B;--B){var oa=v[B];if(!oa.isDeleted&&C(oa)){U=oa;break}}return U},ha=function(v,C,U){var B=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:v,translation:{x:B.x-U.left-v/C.value*(B.x-U.left-C.translation.x),y:B.y-U.top-v/C.value*(B.y-U.top-C.translation.y)}}},ua=function(v){v=parseFloat(v.toFixed(2));return Math.max(.1,Math.min(v,10))},Ha=(e(5422),de().forwardRef(function(v,C){var U=Ip().id,B=
de().useRef(null);de().useImperativeHandle(C,function(){return B.current});C="ToolIcon_size_".concat(v.size);return"button"===v.type||"icon"===v.type?(0,Va.jsxs)("button",{className:oc("ToolIcon_type_button",C,v.className,v.visible&&!v.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!v.hidden,"ToolIcon--selected":v.selected,"ToolIcon--plain":"icon"===v.type}),"data-testid":v["data-testid"],hidden:v.hidden,title:v.title,"aria-label":v["aria-label"],type:"button",onClick:v.onClick,
ref:B,children:[(v.icon||v.label)&&(0,Va.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[v.icon||v.label,v.keyBindingLabel&&(0,Va.jsx)("span",{className:"ToolIcon__keybinding",children:v.keyBindingLabel})]}),v.showAriaLabel&&(0,Va.jsx)("div",{className:"ToolIcon__label",children:v["aria-label"]}),v.children]}):(0,Va.jsxs)("label",{className:oc("ToolIcon",v.className),title:v.title,children:[(0,Va.jsx)("input",{className:"ToolIcon_type_radio ".concat(C),type:"radio",name:v.name,
"aria-label":v["aria-label"],"aria-keyshortcuts":v["aria-keyshortcuts"],"data-testid":v["data-testid"],id:"".concat(U,"-").concat(v.id),onChange:v.onChange,checked:v.checked,ref:B}),(0,Va.jsxs)("div",{className:"ToolIcon__icon",children:[v.icon,v.keyBindingLabel&&(0,Va.jsx)("span",{className:"ToolIcon__keybinding",children:v.keyBindingLabel})]})]})}));Ha.defaultProps={visible:!0,className:"",size:"medium"};var Ta=function(v){return"light"===v?mf.orange[4]:mf.orange[9]},Sa=function(v){return"light"===
v?mf.black:mf.gray[4]},jb=function(v){var C=1<arguments.length&&void 0!==arguments[1]?arguments[1]:512;C="number"==typeof C?{width:C}:C;var U=C.width;U=void 0===U?512:U;var B=C.height;B=void 0===B?U:B;var oa=C.mirror;C=C.style;return(0,Va.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(U," ").concat(B),className:oc({"rtl-mirror":oa}),style:C,children:"string"==typeof v?(0,Va.jsx)("path",{fill:"currentColor",d:v}):v})},Nb=jb((0,Va.jsx)("polyline",{fill:"none",stroke:"currentColor",
points:"20 6 9 17 4 12"}),{width:24,height:24}),Ob=jb("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",
{mirror:!0}),Fc=jb("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),Gc=jb("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",
{width:448,height:512}),rc=jb("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),nd=jb("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",
{width:384,height:512}),ce=jb("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),df=jb("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),
Dh=jb("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),Le=jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"}),
(0,Va.jsx)("path",{d:"M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"})]}),{width:576,
height:512,mirror:!0}),Hf=jb("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512}),Ag=
jb("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),Gg=jb("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),rg=jb("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),
Ke=jb("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),ig=jb("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",
{mirror:!0}),Xf=jb("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",
{mirror:!0}),bg=jb("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",
{mirror:!0}),Eh=(jb("M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",{width:24,height:24}),jb("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",
{width:24,height:24}),jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{stroke:"currentColor",fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),(0,Va.jsx)("path",{stroke:"currentColor",fill:"currentColor",
d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64}),jb((0,Va.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),
{width:1024}),de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:Sa(v),stroke:Sa(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:Ta(v),stroke:Ta(v),strokeWidth:"2"})]}),{width:24,mirror:!0})})),
Og=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:Ta(v),stroke:Ta(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:Sa(v),stroke:Sa(v),strokeWidth:"2"})]}),
{width:24,mirror:!0})}),Ei=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:Sa(v),stroke:Sa(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:Ta(v),stroke:Ta(v),strokeWidth:"2"})]}),{width:24,
mirror:!0})}),zk=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:Ta(v),stroke:Ta(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:Sa(v),stroke:Sa(v),strokeWidth:"2"})]}),{width:24,mirror:!0})}),
Kk=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M 2,5 H 22",fill:Sa(v),stroke:Sa(v),strokeWidth:"2",strokeLinecap:"round"}),(0,Va.jsx)("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:Ta(v),stroke:Ta(v),
strokeWidth:"2"})]}),{width:24,mirror:!0})}),wl=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M 2,19 H 22",fill:Sa(v),stroke:Sa(v),strokeWidth:"2",strokeLinecap:"round"}),(0,Va.jsx)("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",
fill:Ta(v),stroke:Ta(v),strokeWidth:"2"})]}),{width:24,mirror:!0})}),Wo=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M 5,2 V 22",fill:Sa(v),stroke:Sa(v),strokeWidth:"2",strokeLinecap:"round"}),(0,Va.jsx)("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",
fill:Ta(v),stroke:Ta(v),strokeWidth:"2"})]}),{width:24})}),Fm=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M 19,2 V 22",fill:Sa(v),stroke:Sa(v),strokeWidth:"2",strokeLinecap:"round"}),(0,Va.jsx)("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",
fill:Ta(v),stroke:Ta(v),strokeWidth:"2"})]}),{width:24})}),Cf=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M19 5V19M5 5V19",stroke:Sa(v),strokeWidth:"2",strokeLinecap:"round"}),(0,Va.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:Ta(v),stroke:Ta(v),strokeWidth:"2"})]}),{width:24})}),Nn=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",
{d:"M5 5L19 5M5 19H19",fill:Sa(v),stroke:Sa(v),strokeWidth:"2",strokeLinecap:"round"}),(0,Va.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:Ta(v),stroke:Ta(v),strokeWidth:"2"})]}),{width:24})}),kj=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",
fill:Ta(v),stroke:Ta(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M 2,12 H 22",fill:Sa(v),stroke:Sa(v),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})}),xn=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",
fill:Ta(v),stroke:Ta(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M 12,2 V 22",fill:Sa(v),stroke:Sa(v),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})}),ym=jb("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",
{width:640,height:512,mirror:!0}),Om=(jb("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),jb("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),jb("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",
{width:352,height:512})),yn=jb("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),Wk=jb("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",
{mirror:!0}),hm=(jb("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),jb("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",
{width:384,height:512})),Yi=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M25 26H111V111H25",fill:Sa(v)}),(0,Va.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",
stroke:Sa(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M100 100H160V160H100",fill:Sa(v)}),(0,Va.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:Sa(v),strokeWidth:"2"}),(0,Va.jsxs)("g",
{fill:"light"===v?mf.white:"#1e1e1e",stroke:Sa(v),strokeWidth:"6",children:[(0,Va.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})}),wj=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{d:"M25 26H111V111H25",fill:Sa(v)}),(0,Va.jsx)("path",
{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:Sa(v),strokeWidth:"2"}),(0,Va.jsx)("path",{d:"M100 100H160V160H100",fill:Sa(v)}),(0,Va.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",
stroke:Sa(v),strokeWidth:"2"}),(0,Va.jsxs)("g",{fill:"light"===v?mf.white:"#1e1e1e",stroke:Sa(v),strokeWidth:"6",children:[(0,Va.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,Va.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),
{width:182,height:182,mirror:!0})}),im=de().memo(function(v){return jb((0,Va.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:Sa(v.theme)}),{width:40,height:20})}),Qm=de().memo(function(v){return jb((0,Va.jsxs)("g",{fill:Sa(v.theme),fillRule:"evenodd",clipRule:"evenodd",
children:[(0,Va.jsx)("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),(0,Va.jsx)("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})]}),
{width:40,height:20})}),Cm=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:Sa(v.theme)}),{width:40,height:20})}),bo=de().memo(function(v){var C=v.strokeWidth;return jb((0,Va.jsx)("path",{d:"M6 10H32",stroke:Sa(v.theme),strokeWidth:C,strokeLinecap:"round",fill:"none"}),{width:40,height:20})}),Bn=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M6 10H34",stroke:Sa(v.theme),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})}),co=de().memo(function(v){return jb((0,Va.jsx)("path",
{d:"M6 10H34",stroke:Sa(v.theme),strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})}),Fj=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M6 10H36",stroke:Sa(v.theme),strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})}),Zo=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",
stroke:Sa(v.theme),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),lo=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:Sa(v.theme),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,
mirror:!0})}),jm=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:Sa(v.theme),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),en=de().memo(function(v){return jb((0,Va.jsx)("path",
{d:"M10 17L10 5L35 5",stroke:Sa(v.theme),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),fn=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:Sa(v.theme),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),ao=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M6 10H34",stroke:Sa(v.theme),strokeWidth:2,fill:"none"}),{width:40,height:20})}),zn=de().memo(function(v){var C=v.flip;return jb((0,Va.jsxs)("g",
{transform:void 0!==C&&C?"translate(40, 0) scale(-1, 1)":"",stroke:Sa(v.theme),strokeWidth:2,fill:"none",children:[(0,Va.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,Va.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})}),An=de().memo(function(v){var C=v.theme;v=v.flip;v=void 0!==v&&v;return jb((0,Va.jsxs)("g",{stroke:Sa(C),fill:Sa(C),transform:v?"translate(40, 0) scale(-1, 1)":"",children:[(0,Va.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,Va.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),
{width:40,height:20})}),Kn=de().memo(function(v){var C=v.flip;return jb((0,Va.jsx)("g",{transform:void 0!==C&&C?"translate(40, 0) scale(-1, 1)":"",children:(0,Va.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:Sa(v.theme),strokeWidth:2,fill:"none"})}),{width:40,height:20})}),Lk=de().memo(function(v){return jb((0,Va.jsx)("path",{fill:Sa(v.theme),d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),
{width:47,height:77})}),Nl=de().memo(function(v){return jb((0,Va.jsx)("path",{fill:Sa(v.theme),d:"M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"}),
{width:77,height:75})}),Cn=de().memo(function(v){return jb((0,Va.jsx)("path",{fill:Sa(v.theme),d:"M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"}),{width:45,height:75})}),eo=de().memo(function(v){return jb((0,Va.jsx)("path",{fill:Sa(v.theme),d:"M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"}),
{width:120,height:75})}),On=de().memo(function(v){return jb((0,Va.jsx)("path",{fill:Sa(v.theme),d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"}),{width:448,height:512})}),pj=de().memo(function(v){v=v.theme;return jb((0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("path",{fill:Sa(v),d:"M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"}),
(0,Va.jsx)("path",{fill:Sa(v),d:"M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"})]}),{width:70,height:78})}),io=
de().memo(function(v){return jb((0,Va.jsx)(Va.Fragment,{children:(0,Va.jsx)("path",{fill:Sa(v.theme),d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),
{width:640,height:512})}),Dn=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z",
fill:Sa(v.theme),strokeLinecap:"round"}),{width:448,height:512})}),gn=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z",
fill:Sa(v.theme)}),{width:448,height:512})}),Am=de().memo(function(v){return jb((0,Va.jsx)("path",{d:"M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z",
fill:Sa(v.theme),strokeLinecap:"round"}),{width:448,height:512})}),zm=[],ye=function(v){return zm=zm.concat(v),v},Uo=function(v,C){return v.editingGroupId&&(C=li(pe(C),v.editingGroupId),C.length)?ob(ob({},v),{},{selectedElementIds:T({},C[0].id,!0)}):v},hn=ye({name:"deleteSelectedElements",perform:function(v,C){if(C.editingLinearElement){var U=C.editingLinearElement,B=U.activePointIndex,oa=U.startBindingElement,va=U.endBindingElement,ja=fd.getElement(U.elementId);if(!ja)return!1;if(null==B||-1===B||
2>ja.points.length)return v=v.filter(function(xa){return xa.id!==ja.id}),{elements:v,appState:ob(ob({},Uo(C,v)),{},{editingLinearElement:null}),commitToHistory:!1};U={startBindingElement:0===B?null:oa,endBindingElement:B===ja.points.length-1?null:va};return fd.movePoint(ja,B,"delete"),{elements:v,appState:ob(ob({},C),{},{editingLinearElement:ob(ob(ob({},C.editingLinearElement),U),{},{activePointIndex:0<B?B-1:0})}),commitToHistory:!0}}U=function(xa,Aa){return{elements:xa.map(function(Ca){return Aa.selectedElementIds[Ca.id]?
cf(Ca,{isDeleted:!0}):Ca}),appState:ob(ob({},Aa),{},{selectedElementIds:{}})}}(v,C);B=U.elements;U=U.appState;return Ll(B,v.filter(function(xa){return C.selectedElementIds[xa.id]})),{elements:B,appState:ob(ob({},U=Uo(U,B)),{},{elementType:"selection",multiElement:null}),commitToHistory:vh(pe(v),C)}},contextItemLabel:"labels.delete",keyTest:function(v){return"Backspace"===v.key||"Delete"===v.key},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsx)(Ha,{type:"button",
icon:ce,title:$b("labels.delete"),"aria-label":$b("labels.delete"),onClick:function(){return B(null)},visible:vh(pe(C),U)})}}),En=function(v,C){for(var U=[],B=[],oa=null,va=-1;++va<v.length;)C.selectedElementIds[v[va].id]?(B.length&&(U=U.concat(B),B=[]),U.push(va),oa=va+1):v[va].isDeleted&&oa===va?(oa=va+1,B.push(va)):B=[];return U},fo=function(v,C,U,B){var oa=C[U],va=function(ja){return!ja.isDeleted&&(!v.editingGroupId||ja.groupIds.includes(v.editingGroupId))};U="left"===B?function(ja,xa){var Aa=
2<arguments.length&&void 0!==arguments[2]?arguments[2]:ja.length-1;0>Aa&&(Aa=ja.length+Aa);for(Aa=Math.min(ja.length-1,Math.max(Aa,0))+1;-1<--Aa;)if(xa(ja[Aa],Aa,ja))return Aa;return-1}(C,va,Math.max(0,U-1)):function(ja,xa){var Aa=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;0>Aa&&(Aa=ja.length+Aa);for(Aa=Math.min(ja.length,Math.max(Aa,0))-1;++Aa<ja.length;)if(xa(ja[Aa],Aa,ja))return Aa;return-1}(C,va,U+1);va=C[U];if(!va)return-1;if(v.editingGroupId){if((null==oa?void 0:oa.groupIds.join(""))===
(null==va?void 0:va.groupIds.join("")))return U;if(null==va||!va.groupIds.includes(v.editingGroupId))return-1}if(!va.groupIds.length)return U;oa=v.editingGroupId?va.groupIds[va.groupIds.indexOf(v.editingGroupId)-1]:va.groupIds[va.groupIds.length-1];oa=li(C,oa);return oa.length?"left"===B?C.indexOf(oa[0]):C.indexOf(oa[oa.length-1]):U},Vo=function(v,C){return C.reduce(function(U,B){B=v[B];return U[B.id]=B,U},{})},kn=function(v,C,U){var B,oa=En(C,v),va=Vo(C,oa),ja=(B=0,oa.reduce(function(xa,Aa,Ca){return 0<
Ca&&oa[Ca-1]!==Aa-1&&(B=++B),(xa[B]||(xa[B]=[])).push(Aa),xa},[]));return"right"===U&&(ja=ja.reverse()),ja.forEach(function(xa,Aa){Aa=xa[0];xa=xa[xa.length-1];var Ca="left"===U?Aa:xa,Ia=fo(v,C,Ca,U);if(-1!==Ia&&Ca!==Ia){Ca="left"===U?C.slice(0,Ia):C.slice(0,Aa);var Wa=C.slice(Aa,xa+1);Aa="left"===U?C.slice(Ia,Aa):C.slice(xa+1,Ia+1);xa="left"===U?C.slice(xa+1):C.slice(Ia+1);C="left"===U?[].concat(O(Ca),O(Wa),O(Aa),O(xa)):[].concat(O(Ca),O(Aa),O(Wa),O(xa))}}),C.map(function(xa){return va[xa.id]?vg(xa):
xa})},pl=function(v,C,U){var B=En(v,C),oa=Vo(v,B),va=[];if("left"===U){if(C.editingGroupId){C=li(v,C.editingGroupId);if(!C.length)return v;var ja=v.indexOf(C[0])}else ja=0;C=B[B.length-1]}else{if(C.editingGroupId){C=li(v,C.editingGroupId);if(!C.length)return v;C=v.indexOf(C[C.length-1])}else C=v.length-1;ja=B[0]}for(var xa=ja;xa<C+1;xa++)B.includes(xa)||va.push(v[xa]);B=Object.values(oa).map(function(Aa){return vg(Aa)});oa=v.slice(0,ja);v=v.slice(C+1);return"left"===U?[].concat(O(oa),O(B),va,O(v)):
[].concat(O(oa),va,O(B),O(v))},Gn=ye({name:"sendBackward",perform:function(v,C){return{elements:kn(C,v,"left"),appState:C,commitToHistory:!0}},contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:function(v){return v[Af]&&!v.shiftKey&&"BracketLeft"===v.code},PanelComponent:function(v){var C=v.updateData;v=v.appState;return(0,Va.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return C(null)},title:"".concat($b("labels.sendBackward")," — ").concat(Vd("CtrlOrCmd+[")),
children:(0,Va.jsx)(Og,{theme:v.theme})})}}),Fn=ye({name:"bringForward",perform:function(v,C){return{elements:kn(C,v,"right"),appState:C,commitToHistory:!0}},contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:function(v){return v[Af]&&!v.shiftKey&&"BracketRight"===v.code},PanelComponent:function(v){var C=v.updateData;v=v.appState;return(0,Va.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return C(null)},title:"".concat($b("labels.bringForward")," — ").concat(Vd("CtrlOrCmd+]")),
children:(0,Va.jsx)(Eh,{theme:v.theme})})}}),ji=ye({name:"sendToBack",perform:function(v,C){return{elements:pl(v,C,"left"),appState:C,commitToHistory:!0}},contextItemLabel:"labels.sendToBack",keyTest:function(v){return xi?v[Af]&&v.altKey&&"BracketLeft"===v.code:v[Af]&&v.shiftKey&&"BracketLeft"===v.code},PanelComponent:function(v){var C=v.updateData;v=v.appState;return(0,Va.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return C(null)},title:"".concat($b("labels.sendToBack"),
" — ").concat(Vd(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,Va.jsx)(zk,{theme:v.theme})})}}),rl=ye({name:"bringToFront",perform:function(v,C){return{elements:pl(v,C,"right"),appState:C,commitToHistory:!0}},contextItemLabel:"labels.bringToFront",keyTest:function(v){return xi?v[Af]&&v.altKey&&"BracketRight"===v.code:v[Af]&&v.shiftKey&&"BracketRight"===v.code},PanelComponent:function(v){var C=v.updateData;v=v.appState;return(0,Va.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(U){return C(null)},
title:"".concat($b("labels.bringToFront")," — ").concat(Vd(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,Va.jsx)(Ei,{theme:v.theme})})}}),Ql=ye({name:"selectAll",perform:function(v,C){return!C.editingLinearElement&&{appState:Me(xd(xd({},C),{},{editingGroupId:null,selectedElementIds:v.reduce(function(U,B){return B.isDeleted||(U[B.id]=!0),U},{})}),pe(v)),commitToHistory:!0}},contextItemLabel:"labels.selectAll",keyTest:function(v){return v[Af]&&"a"===v.key}}),Zk=ye({name:"duplicateSelection",
perform:function(v,C){if(C.editingLinearElement){var U=C.editingLinearElement,B=U.activePointIndex;U=fd.getElement(U.elementId);if(!U||null===B)return!1;var oa=U.points,va=oa[B],ja=oa[B+1];return le(U,{points:[].concat(O(oa.slice(0,B+1)),[ja?[(va[0]+ja[0])/2,(va[1]+ja[1])/2]:[va[0]+30,va[1]+30]],O(oa.slice(B+1)))}),{appState:$d($d({},C),{},{editingLinearElement:$d($d({},C.editingLinearElement),{},{activePointIndex:B+1})}),elements:v,commitToHistory:!0}}return $d($d({},R(v,C)),{},{commitToHistory:!0})},
contextItemLabel:"labels.duplicateSelection",keyTest:function(v){return v[Af]&&"d"===v.key},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsx)(Ha,{type:"button",icon:Wk,title:"".concat($b("labels.duplicateSelection")," — ").concat(Vd("CtrlOrCmd+D")),"aria-label":$b("labels.duplicateSelection"),onClick:function(){return B(null)},visible:vh(pe(C),U)})}}),R=function(v,C){for(var U=new Map,B=[],oa=[],va=new Map,ja=function(Wa){var $a=Xj(C.editingGroupId,U,Wa,{x:Wa.x+
Cc.k/2,y:Wa.y+Cc.k/2});return va.set(Wa.id,$a.id),oa.push(Wa),B.push($a),$a},xa=[],Aa=0;Aa<v.length;){var Ca=v[Aa];if(C.selectedElementIds[Ca.id]){if(Ca.groupIds.length){var Ia=dh(C,Ca);if(Ia){Ca=li(v,Ia);xa.push.apply(xa,O(Ca).concat(O(Ca.map(function(Wa){return ja(Wa)}))));Aa+=Ca.length;continue}}xa.push(Ca,ja(Ca))}else xa.push(Ca);Aa++}return Tj(xa,oa,va),{elements:xa,appState:Me($d($d({},C),{},{selectedGroupIds:{},selectedElementIds:B.reduce(function(Wa,$a){return Wa[$a.id]=!0,Wa},{})}),pe(xa))}},
na=function(v){var C=v.value,U=v.onChange,B=v.group;return(0,Va.jsx)("div",{className:"buttonList buttonListIcon",children:v.options.map(function(oa){return(0,Va.jsxs)("label",{className:oc({active:C===oa.value}),title:oa.text,children:[(0,Va.jsx)("input",{type:"radio",name:B,onChange:function(){return U(oa.value)},checked:C===oa.value}),oa.icon]},oa.text)})})},Ga=(e(4301),function(v){var C=v.children,U=v.left,B=v.top,oa=v.onCloseRequest;v=v.fitInViewport;var va=void 0!==v&&v,ja=(0,ve.useRef)(null);
return(0,ve.useLayoutEffect)(function(){if(va&&ja.current){var xa=ja.current,Aa=xa.getBoundingClientRect(),Ca=Aa.y,Ia=Aa.width,Wa=Aa.height,$a=window.innerWidth;Aa.x+Ia>$a&&(xa.style.left="".concat($a-Ia,"px"));Aa=window.innerHeight;Ca+Wa>Aa&&(xa.style.top="".concat(Aa-Wa,"px"))}},[va]),(0,ve.useEffect)(function(){if(oa){var xa=function(Aa){var Ca;null!==(Ca=ja.current)&&void 0!==Ca&&Ca.contains(Aa.target)||(0,rh.unstable_batchedUpdates)(function(){return oa(Aa)})};return document.addEventListener("pointerdown",
xa,!1),function(){return document.removeEventListener("pointerdown",xa,!1)}}},[oa]),(0,Va.jsx)("div",{className:"popover",style:{top:B,left:U},ref:ja,children:C})}),kb=(e(4220),function(v){var C=(new Option).style;return C.color=v,!!C.color}),Gb=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Rb=function(v){var C=v.colors,U=v.color,B=v.onChange,oa=v.onClose,va=v.label,ja=v.showInput,xa=void 0===ja||ja;v=v.type;var Aa=de().useRef(),Ca=de().useRef(),Ia=de().useRef(),Wa=de().useRef();
de().useEffect(function(){Ca.current?Ca.current.focus():Wa.current?Wa.current.focus():Ia.current&&Ia.current.focus()},[]);return(0,Va.jsxs)("div",{className:"color-picker color-picker-type-".concat(v),role:"dialog","aria-modal":"true","aria-label":$b("labels.colorPicker"),onKeyDown:function($a){if("Tab"===$a.key){var rb,Hb=document.activeElement;if($a.shiftKey)Hb===Aa.current&&(null===(rb=Wa.current)||void 0===rb||rb.focus(),$a.preventDefault());else if(Hb===Wa.current){var Xb;null===(Xb=Aa.current)||
void 0===Xb||Xb.focus();$a.preventDefault()}}else oh($a.key)?(rb=Cg.rtl,Hb=Array.prototype.indexOf.call(Ia.current.children,document.activeElement),-1!==Hb&&(Xb=Ia.current.children.length-(xa?1:0),Ia.current.children[$a.key===(rb?"ArrowLeft":"ArrowRight")?(Hb+1)%Xb:$a.key===(rb?"ArrowRight":"ArrowLeft")?(Xb+Hb-1)%Xb:"ArrowDown"===$a.key?(Hb+5)%Xb:"ArrowUp"===$a.key?(Xb+Hb-5)%Xb:Hb].focus()),$a.preventDefault()):Gb.includes($a.key.toLowerCase())&&!Dj($a.target)?(rb=Gb.indexOf($a.key.toLowerCase()),
Ia.current.children[rb].focus(),$a.preventDefault()):"Escape"!==$a.key&&"Enter"!==$a.key||($a.preventDefault(),oa());$a.nativeEvent.stopImmediatePropagation();$a.stopPropagation()},children:[(0,Va.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,Va.jsx)("div",{className:"color-picker-triangle"}),(0,Va.jsxs)("div",{className:"color-picker-content",ref:function($a){$a&&(Ia.current=$a)},tabIndex:0,children:[C.map(function($a,rb){var Hb=$a.replace("#","");return(0,Va.jsxs)("button",
{className:"color-picker-swatch",onClick:function(Xb){Xb.currentTarget.focus();B($a)},title:"".concat($b("colors.".concat(Hb))).concat(Ri($a)?"":" (".concat($a,")")," — ").concat(Gb[rb].toUpperCase()),"aria-label":$b("colors.".concat(Hb)),"aria-keyshortcuts":Gb[rb],style:{color:$a},ref:function(Xb){Xb&&0===rb&&(Aa.current=Xb);Xb&&$a===U&&(Ca.current=Xb)},onFocus:function(){B($a)},children:[Ri($a)?(0,Va.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,Va.jsx)("span",{className:"color-picker-keybinding",
children:Gb[rb]})]},$a)}),xa&&(0,Va.jsx)(uc,{color:U,label:va,onChange:function($a){B($a)},ref:Wa})]})]})},uc=de().forwardRef(function(v,C){var U=v.color,B=v.onChange;v=v.label;var oa=ca(de().useState(U),2),va=oa[0],ja=oa[1],xa=de().useRef(null);de().useEffect(function(){ja(U)},[U]);de().useImperativeHandle(C,function(){return xa.current});var Aa=de().useCallback(function(Ca){Ca=Ca.toLowerCase();var Ia;(Ia=Ri(Ca)||kb(Ca)?Ca:kb("#".concat(Ca))?"#".concat(Ca):null)&&B(Ia);ja(Ca)},[B]);return(0,Va.jsxs)("label",
{className:"color-input-container",children:[(0,Va.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,Va.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":v,onChange:function(Ca){return Aa(Ca.target.value)},value:(va||"").replace(/^#/,""),onBlur:function(){return ja(U)},ref:xa})]})}),Ic=function(v){var C=v.type,U=v.color,B=v.onChange,oa=v.label,va=v.isActive,ja=v.setActive,xa=de().useRef(null);return(0,Va.jsxs)("div",{children:[(0,Va.jsxs)("div",{className:"color-picker-control-container",
children:[(0,Va.jsx)("button",{className:"color-picker-label-swatch","aria-label":oa,style:U?{"--swatch-color":U}:void 0,onClick:function(){return ja(!va)},ref:xa}),(0,Va.jsx)(uc,{color:U,label:oa,onChange:function(Aa){B(Aa)}})]}),(0,Va.jsx)(de().Suspense,{fallback:"",children:va?(0,Va.jsx)(Ga,{onCloseRequest:function(Aa){return Aa.target!==xa.current&&ja(!1)},children:(0,Va.jsx)(Rb,{colors:ri[C],color:U||null,onChange:function(Aa){B(Aa)},onClose:function(){var Aa;ja(!1);null===(Aa=xa.current)||void 0===
Aa||Aa.focus()},label:oa,showInput:!1,type:C})}):null})]})};e(7117);var Oc=function(v,C,U){return v.map(function(B){var oa;return C.selectedElementIds[B.id]||B.id===(null===(oa=C.editingElement)||void 0===oa?void 0:oa.id)?U(B):B})},cd=function(v,C,U,B){var oa,va,ja=C.editingElement;v=pe(v);return null!==(oa=null!==(va=ja&&U(ja))&&void 0!==va?va:vh(v,C)?function(xa,Aa,Ca){xa=Array.from(new Set(Sf(xa,Aa).map(function(Ia){return Ca(Ia)})));return 1===xa.length?xa[0]:null}(v,C,U):B)&&void 0!==oa?oa:null},
Bd=(ye({name:"changeStrokeColor",perform:function(v,C,U){return qd(qd({},U.currentItemStrokeColor&&{elements:Oc(v,C,function(B){return cf(B,{strokeColor:U.currentItemStrokeColor})})}),{},{appState:qd(qd({},C),U),commitToHistory:!!U.currentItemStrokeColor})},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("h3",{"aria-hidden":"true",children:$b("labels.stroke")}),(0,Va.jsx)(Ic,{type:"elementStroke",label:$b("labels.stroke"),
color:cd(C,U,function(oa){return oa.strokeColor},U.currentItemStrokeColor),onChange:function(oa){return B({currentItemStrokeColor:oa})},isActive:"strokeColorPicker"===U.openPopup,setActive:function(oa){return B({openPopup:oa?"strokeColorPicker":null})}})]})}}),ye({name:"changeBackgroundColor",perform:function(v,C,U){return qd(qd({},U.currentItemBackgroundColor&&{elements:Oc(v,C,function(B){return cf(B,{backgroundColor:U.currentItemBackgroundColor})})}),{},{appState:qd(qd({},C),U),commitToHistory:!!U.currentItemBackgroundColor})},
PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("h3",{"aria-hidden":"true",children:$b("labels.background")}),(0,Va.jsx)(Ic,{type:"elementBackground",label:$b("labels.background"),color:cd(C,U,function(oa){return oa.backgroundColor},U.currentItemBackgroundColor),onChange:function(oa){return B({currentItemBackgroundColor:oa})},isActive:"backgroundColorPicker"===U.openPopup,setActive:function(oa){return B({openPopup:oa?"backgroundColorPicker":
null})}})]})}}),ye({name:"changeFillStyle",perform:function(v,C,U){return{elements:Oc(v,C,function(B){return cf(B,{fillStyle:U})}),appState:qd(qd({},C),{},{currentItemFillStyle:U}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.fill")}),(0,Va.jsx)(na,{options:[{value:"hachure",text:$b("labels.hachure"),icon:(0,Va.jsx)(im,{theme:U.theme})},{value:"cross-hatch",text:$b("labels.crossHatch"),
icon:(0,Va.jsx)(Qm,{theme:U.theme})},{value:"solid",text:$b("labels.solid"),icon:(0,Va.jsx)(Cm,{theme:U.theme})}],group:"fill",value:cd(C,U,function(oa){return oa.fillStyle},U.currentItemFillStyle),onChange:function(oa){B(oa)}})]})}}),ye({name:"changeStrokeWidth",perform:function(v,C,U){return{elements:Oc(v,C,function(B){return cf(B,{strokeWidth:U})}),appState:qd(qd({},C),{},{currentItemStrokeWidth:U}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsxs)("fieldset",
{children:[(0,Va.jsx)("legend",{children:$b("labels.strokeWidth")}),(0,Va.jsx)(na,{group:"stroke-width",options:[{value:1,text:$b("labels.thin"),icon:(0,Va.jsx)(bo,{theme:U.theme,strokeWidth:2})},{value:2,text:$b("labels.bold"),icon:(0,Va.jsx)(bo,{theme:U.theme,strokeWidth:6})},{value:4,text:$b("labels.extraBold"),icon:(0,Va.jsx)(bo,{theme:U.theme,strokeWidth:10})}],value:cd(C,U,function(oa){return oa.strokeWidth},U.currentItemStrokeWidth),onChange:function(oa){return B(oa)}})]})}}),ye({name:"changeSloppiness",
perform:function(v,C,U){return{elements:Oc(v,C,function(B){return cf(B,{seed:yl(),roughness:U})}),appState:qd(qd({},C),{},{currentItemRoughness:U}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.sloppiness")}),(0,Va.jsx)(na,{group:"sloppiness",options:[{value:0,text:$b("labels.architect"),icon:(0,Va.jsx)(Zo,{theme:U.theme})},{value:1,text:$b("labels.artist"),icon:(0,Va.jsx)(lo,
{theme:U.theme})},{value:2,text:$b("labels.cartoonist"),icon:(0,Va.jsx)(jm,{theme:U.theme})}],value:cd(C,U,function(oa){return oa.roughness},U.currentItemRoughness),onChange:function(oa){return B(oa)}})]})}}),ye({name:"changeStrokeStyle",perform:function(v,C,U){return{elements:Oc(v,C,function(B){return cf(B,{strokeStyle:U})}),appState:qd(qd({},C),{},{currentItemStrokeStyle:U}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsxs)("fieldset",
{children:[(0,Va.jsx)("legend",{children:$b("labels.strokeStyle")}),(0,Va.jsx)(na,{group:"strokeStyle",options:[{value:"solid",text:$b("labels.strokeStyle_solid"),icon:(0,Va.jsx)(Bn,{theme:U.theme})},{value:"dashed",text:$b("labels.strokeStyle_dashed"),icon:(0,Va.jsx)(co,{theme:U.theme})},{value:"dotted",text:$b("labels.strokeStyle_dotted"),icon:(0,Va.jsx)(Fj,{theme:U.theme})}],value:cd(C,U,function(oa){return oa.strokeStyle},U.currentItemStrokeStyle),onChange:function(oa){return B(oa)}})]})}}),ye({name:"changeOpacity",
perform:function(v,C,U){return{elements:Oc(v,C,function(B){return cf(B,{opacity:U})}),appState:qd(qd({},C),{},{currentItemOpacity:U}),commitToHistory:!0}},PanelComponent:function(v){var C,U=v.elements,B=v.appState,oa=v.updateData;return(0,Va.jsxs)("label",{className:"control-label",children:[$b("labels.opacity"),(0,Va.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:function(va){return oa(+va.target.value)},onWheel:function(va){va.stopPropagation();var ja=+va.target.value;0>va.deltaY&&
100>ja?oa(ja+10):0<va.deltaY&&0<ja&&oa(ja-10)},value:null!==(C=cd(U,B,function(va){return va.opacity},B.currentItemOpacity))&&void 0!==C?C:void 0})]})}}),ye({name:"changeFontSize",perform:function(v,C,U){return{elements:Oc(v,C,function(B){return Xg(B)?(B=cf(B,{fontSize:U}),Lj(B),B):B}),appState:qd(qd({},C),{},{currentItemFontSize:U}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;return(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.fontSize")}),
(0,Va.jsx)(na,{group:"font-size",options:[{value:16,text:$b("labels.small"),icon:(0,Va.jsx)(Lk,{theme:U.theme})},{value:20,text:$b("labels.medium"),icon:(0,Va.jsx)(Nl,{theme:U.theme})},{value:28,text:$b("labels.large"),icon:(0,Va.jsx)(Cn,{theme:U.theme})},{value:36,text:$b("labels.veryLarge"),icon:(0,Va.jsx)(eo,{theme:U.theme})}],value:cd(C,U,function(oa){return Xg(oa)&&oa.fontSize},U.currentItemFontSize||Cc.n5),onChange:function(oa){return B(oa)}})]})}}),ye({name:"changeFontFamily",perform:function(v,
C,U){return{elements:Oc(v,C,function(B){return Xg(B)?(B=cf(B,{fontFamily:U}),Lj(B),B):B}),appState:qd(qd({},C),{},{currentItemFontFamily:U}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;v=[{value:Cc.ut.Virgil,text:$b("labels.handDrawn"),icon:(0,Va.jsx)(On,{theme:U.theme})},{value:Cc.ut.Helvetica,text:$b("labels.normal"),icon:(0,Va.jsx)(pj,{theme:U.theme})},{value:Cc.ut.Cascadia,text:$b("labels.code"),icon:(0,Va.jsx)(io,{theme:U.theme})}];return(0,Va.jsxs)("fieldset",
{children:[(0,Va.jsx)("legend",{children:$b("labels.fontFamily")}),(0,Va.jsx)(na,{group:"font-family",options:v,value:cd(C,U,function(oa){return Xg(oa)&&oa.fontFamily},U.currentItemFontFamily||Cc.rk),onChange:function(oa){return B(oa)}})]})}}),ye({name:"changeTextAlign",perform:function(v,C,U){return{elements:Oc(v,C,function(B){return Xg(B)?(B=cf(B,{textAlign:U}),Lj(B),B):B}),appState:qd(qd({},C),{},{currentItemTextAlign:U}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,
B=v.updateData;return(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.textAlign")}),(0,Va.jsx)(na,{group:"text-align",options:[{value:"left",text:$b("labels.left"),icon:(0,Va.jsx)(Dn,{theme:U.theme})},{value:"center",text:$b("labels.center"),icon:(0,Va.jsx)(gn,{theme:U.theme})},{value:"right",text:$b("labels.right"),icon:(0,Va.jsx)(Am,{theme:U.theme})}],value:cd(C,U,function(oa){return Xg(oa)&&oa.textAlign},U.currentItemTextAlign),onChange:function(oa){return B(oa)}})]})}}),
ye({name:"changeSharpness",perform:function(v,C,U){var B=Kh(pe(v),C),oa=B.length?B.every(function(va){return!Dg(va)}):!oj(C.elementType);B=B.length?B.every(Dg):oj(C.elementType);return{elements:Oc(v,C,function(va){return cf(va,{strokeSharpness:U})}),appState:qd(qd({},C),{},{currentItemStrokeSharpness:oa?U:C.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:B?U:C.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;
return(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.edges")}),(0,Va.jsx)(na,{group:"edges",options:[{value:"sharp",text:$b("labels.sharp"),icon:(0,Va.jsx)(en,{theme:U.theme})},{value:"round",text:$b("labels.round"),icon:(0,Va.jsx)(fn,{theme:U.theme})}],value:cd(C,U,function(oa){return oa.strokeSharpness},I(U.elementType)&&(oj(U.elementType)?U.currentItemLinearStrokeSharpness:U.currentItemStrokeSharpness)||null),onChange:function(oa){return B(oa)}})]})}}),ye({name:"changeArrowhead",
perform:function(v,C,U){return{elements:Oc(v,C,function(B){if(Dg(B)){var oa=U.position,va=U.type;if("start"===oa)return cf(B,{startArrowhead:va});if("end"===oa)return cf(B,{endArrowhead:va})}return B}),appState:qd(qd({},C),{},T({},"start"===U.position?"currentItemStartArrowhead":"currentItemEndArrowhead",U.type)),commitToHistory:!0}},PanelComponent:function(v){var C=v.elements,U=v.appState,B=v.updateData;v=Cg.rtl;return(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.arrowheads")}),
(0,Va.jsxs)("div",{className:"iconSelectList",children:[(0,Va.jsx)(sc,{label:"arrowhead_start",options:[{value:null,text:$b("labels.arrowhead_none"),icon:(0,Va.jsx)(ao,{theme:U.theme}),keyBinding:"q"},{value:"arrow",text:$b("labels.arrowhead_arrow"),icon:(0,Va.jsx)(zn,{theme:U.theme,flip:!v}),keyBinding:"w"},{value:"bar",text:$b("labels.arrowhead_bar"),icon:(0,Va.jsx)(Kn,{theme:U.theme,flip:!v}),keyBinding:"e"},{value:"dot",text:$b("labels.arrowhead_dot"),icon:(0,Va.jsx)(An,{theme:U.theme,flip:!v}),
keyBinding:"r"}],value:cd(C,U,function(oa){return Dg(oa)&&"arrow"===oa.type?oa.startArrowhead:U.currentItemStartArrowhead},U.currentItemStartArrowhead),onChange:function(oa){return B({position:"start",type:oa})}}),(0,Va.jsx)(sc,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:$b("labels.arrowhead_none"),keyBinding:"q",icon:(0,Va.jsx)(ao,{theme:U.theme})},{value:"arrow",text:$b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,Va.jsx)(zn,{theme:U.theme,flip:v})},{value:"bar",text:$b("labels.arrowhead_bar"),
keyBinding:"e",icon:(0,Va.jsx)(Kn,{theme:U.theme,flip:v})},{value:"dot",text:$b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,Va.jsx)(An,{theme:U.theme,flip:v})}],value:cd(C,U,function(oa){return Dg(oa)&&"arrow"===oa.type?oa.endArrowhead:U.currentItemEndArrowhead},U.currentItemEndArrowhead),onChange:function(oa){return B({position:"end",type:oa})}})]})]})}}),function(v){var C=v.title||("dark"===v.value?$b("buttons.lightMode"):$b("buttons.darkMode"));return(0,Va.jsx)(Ha,{type:"icon",icon:"light"===
v.value?ie.MOON:ie.SUN,title:C,"aria-label":C,onClick:function(){return v.onChange("dark"===v.value?"light":"dark")},"data-testid":"toggle-dark-mode"})}),ie={SUN:(0,Va.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,Va.jsx)("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),
MOON:(0,Va.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,Va.jsx)("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},se=(e(6781),function(){var v=document.querySelector(".excalidraw-tooltip");
if(v)return v;v=document.createElement("div");return document.body.appendChild(v),v.classList.add("excalidraw-tooltip"),v}),wf=function(v){var C=v.children,U=v.label;v=v.long;var B=void 0!==v&&v;return(0,ve.useEffect)(function(){return function(){return se().classList.remove("excalidraw-tooltip--visible")}},[]),(0,Va.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:function(oa){var va=oa.currentTarget;oa=se();oa.classList.add("excalidraw-tooltip--visible");oa.style.minWidth=B?"50ch":
"10ch";oa.style.maxWidth=B?"50ch":"15ch";oa.textContent=U;var ja=va.getBoundingClientRect(),xa=ja.x;va=ja.bottom;var Aa=ja.top,Ca=ja.width;ja=oa.getBoundingClientRect();var Ia=ja.width;ja=ja.height;var Wa=window.innerWidth;xa=xa+Ca/2-Ia/2;Ia=xa+Ia>=Wa?xa+Ia-Wa:0;Ca=va+5;Object.assign(oa.style,{top:"".concat(Ca-(Ca+ja>=window.innerHeight?va-Aa+ja+10:0),"px"),left:"".concat(xa-Ia,"px")})},onPointerLeave:function(){return se().classList.remove("excalidraw-tooltip--visible")},children:C})};ye({name:"changeViewBackgroundColor",
perform:function(v,C,U){return{appState:Sd(Sd({},C),U),commitToHistory:!!U.viewBackgroundColor}},PanelComponent:function(v){var C=v.appState,U=v.updateData;return(0,Va.jsx)("div",{style:{position:"relative"},children:(0,Va.jsx)(Ic,{label:$b("labels.canvasBackground"),type:"canvasBackground",color:C.viewBackgroundColor,onChange:function(B){return U({viewBackgroundColor:B})},isActive:"canvasColorPicker"===C.openPopup,setActive:function(B){return U({openPopup:B?"canvasColorPicker":null})},"data-testid":"canvas-background-picker"})})}});
ye({name:"clearCanvas",perform:function(v,C){return{elements:v.map(function(U){return cf(U,{isDeleted:!0})}),appState:Sd(Sd({},Ij()),{},{theme:C.theme,elementLocked:C.elementLocked,exportBackground:C.exportBackground,exportEmbedScene:C.exportEmbedScene,gridSize:C.gridSize,showStats:C.showStats,pasteDialog:C.pasteDialog}),commitToHistory:!0}},PanelComponent:function(v){var C=v.updateData;return(0,Va.jsx)(Ha,{type:"button",icon:ce,title:$b("buttons.clearReset"),"aria-label":$b("buttons.clearReset"),
showAriaLabel:om(),onClick:function(){window.confirm($b("alerts.clearReset"))&&C(null)},"data-testid":"clear-canvas-button"})}});ye({name:"zoomIn",perform:function(v,C){v=ha(ua(C.zoom.value+Cc.V4),C.zoom,{left:C.offsetLeft,top:C.offsetTop},{x:C.width/2,y:C.height/2});return{appState:Sd(Sd({},C),{},{zoom:v}),commitToHistory:!1}},PanelComponent:function(v){var C=v.updateData;return(0,Va.jsx)(Ha,{type:"button",icon:Ag,title:"".concat($b("buttons.zoomIn")," — ").concat(Vd("CtrlOrCmd++")),"aria-label":$b("buttons.zoomIn"),
onClick:function(){C(null)},size:"small"})},keyTest:function(v){return("Equal"===v.code||"NumpadAdd"===v.code)&&(v[Af]||v.shiftKey)}});ye({name:"zoomOut",perform:function(v,C){v=ha(ua(C.zoom.value-Cc.V4),C.zoom,{left:C.offsetLeft,top:C.offsetTop},{x:C.width/2,y:C.height/2});return{appState:Sd(Sd({},C),{},{zoom:v}),commitToHistory:!1}},PanelComponent:function(v){var C=v.updateData;return(0,Va.jsx)(Ha,{type:"button",icon:Gg,title:"".concat($b("buttons.zoomOut")," — ").concat(Vd("CtrlOrCmd+-")),"aria-label":$b("buttons.zoomOut"),
onClick:function(){C(null)},size:"small"})},keyTest:function(v){return("Minus"===v.code||"NumpadSubtract"===v.code)&&(v[Af]||v.shiftKey)}});ye({name:"resetZoom",perform:function(v,C){return{appState:Sd(Sd({},C),{},{zoom:ha(1,C.zoom,{left:C.offsetLeft,top:C.offsetTop},{x:C.width/2,y:C.height/2})}),commitToHistory:!1}},PanelComponent:function(v){var C=v.updateData;v=v.appState;return(0,Va.jsx)(wf,{label:$b("buttons.resetZoom"),children:(0,Va.jsxs)(Ha,{type:"button",className:"reset-zoom-button",title:$b("buttons.resetZoom"),
"aria-label":$b("buttons.resetZoom"),onClick:function(){C(null)},size:"small",children:[(100*v.zoom.value).toFixed(0),"%"]})})},keyTest:function(v){return("Digit0"===v.code||"Numpad0"===v.code)&&(v[Af]||v.shiftKey)}});var lf=function(v,C,U){v=pe(v);var B=Sf(v,C);U=U&&0<B.length?Bg(B):Bg(v);v=C.width;B=C.height;var oa=ca(U,4);v=ha(Math.min(Math.max(Math.floor(Math.min(v/(oa[2]-oa[0]),B/(oa[3]-oa[1]))/Cc.V4)*Cc.V4,Cc.V4),1),C.zoom,{left:C.offsetLeft,top:C.offsetTop});B=ca(U,4);U=(B[0]+B[2])/2;B=(B[1]+
B[3])/2;return{appState:Sd(Sd(Sd({},C),Ce({scenePoint:{x:U,y:B},viewportDimensions:{width:C.width,height:C.height},zoom:v})),{},{zoom:v}),commitToHistory:!1}};ye({name:"zoomToSelection",perform:function(v,C){return lf(v,C,!0)},keyTest:function(v){return"Digit2"===v.code&&v.shiftKey&&!v.altKey&&!v[Af]}});ye({name:"zoomToFit",perform:function(v,C){return lf(v,C,!1)},keyTest:function(v){return"Digit1"===v.code&&v.shiftKey&&!v.altKey&&!v[Af]}});ye({name:"toggleTheme",perform:function(v,C,U){return{appState:Sd(Sd({},
C),{},{theme:U||("light"===C.theme?"dark":"light")}),commitToHistory:!1}},PanelComponent:function(v){var C=v.updateData;return(0,Va.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,Va.jsx)(Bd,{value:v.appState.theme,onChange:function(U){C(U)}})})},keyTest:function(v){return v.altKey&&v.shiftKey&&"KeyD"===v.code}});var Yh,Tl,Ji,$f=ye({name:"finalize",perform:function(v,C,U,B){var oa;U=B.canvas;B=B.focusContainer;if(C.editingLinearElement){var va=C.editingLinearElement,ja=va.startBindingElement,
xa=va.endBindingElement,Aa=fd.getElement(va.elementId);if(Aa)return Wg(Aa)&&Nd(Aa,ja,xa),{elements:2>Aa.points.length||Kj(Aa)?v.filter(function(Wa){return Wa.id!==Aa.id}):void 0,appState:Ja(Ja({},C),{},{editingLinearElement:null}),commitToHistory:!0}}window.document.activeElement instanceof HTMLElement&&B();if(B=C.multiElement?C.multiElement:"freedraw"===(null===(oa=C.editingElement)||void 0===oa?void 0:oa.type)?C.editingElement:null){"freedraw"!==B.type&&"touch"!==C.lastPointerDownWith&&(oa=B.points,
(va=B.lastCommittedPoint)&&oa[oa.length-1]===va||le(B,{points:B.points.slice(0,-1)}));Kj(B)&&(v=v.slice(0,-1));oa=qj(B.points,C.zoom.value);if(("line"===B.type||"freedraw"===B.type)&&oa){var Ca=B.points,Ia=Ca[0];le(B,{points:Ca.map(function(Wa,$a){return $a===Ca.length-1?[Ia[0],Ia[1]]:Wa})})}Wg(B)&&!oa&&1<B.points.length&&(va=ca(fd.getPointAtIndexGlobalCoordinates(B,-1),2),oa=va[0],va=va[1],ng(B,C,Ph.getScene(B),{x:oa,y:va}));C.elementLocked||"freedraw"===C.elementType||(C.selectedElementIds[B.id]=
!0)}return(C.elementLocked||"freedraw"===C.elementType)&&B||Pi(U),{elements:v,appState:Ja(Ja({},C),{},{elementType:(C.elementLocked||"freedraw"===C.elementType)&&B?C.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:B&&!C.elementLocked&&"freedraw"!==C.elementType?Ja(Ja({},C.selectedElementIds),{},T({},B.id,!0)):C.selectedElementIds}),commitToHistory:"freedraw"===C.elementType}},keyTest:function(v,C){return"Escape"===
v.key&&(null!==C.editingLinearElement||!C.draggingElement&&null===C.multiElement)||("Escape"===v.key||"Enter"===v.key)&&null!==C.multiElement},PanelComponent:function(v){var C=v.appState;v=v.updateData;return(0,Va.jsx)(Ha,{type:"button",icon:rg,title:$b("buttons.done"),"aria-label":$b("buttons.done"),onClick:v,visible:null!=C.multiElement})}}),Lh="undefined"!=typeof m&&null!==(Yh=m.env)&&void 0!==Yh&&Yh.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?function(v,C,U,B){window.gtag("event",
C,{event_category:v,event_label:U,value:B})}:("undefined"!=typeof m&&null!==(Tl=m.env)&&void 0!==Tl&&Tl.JEST_WORKER_ID,function(v,C,U,B){}),Jk=(e(518),e(9966),function(v){var C=Ip().id,U=ca((0,ve.useState)(v.value),2),B=U[0],oa=U[1];return(0,Va.jsxs)("div",{className:"ProjectName",children:[(0,Va.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(v.label).concat(v.isNameEditable?"":":")}),v.isNameEditable?(0,Va.jsx)("input",{className:"TextInput",onBlur:function(va){var ja;
a:{for(ja=va.target.parentElement;ja;){if(-1<ja.tabIndex){ja=void ja.focus();break a}ja=ja.parentElement}ja=void 0}!ja;va=va.target.value;va!==v.value&&v.onChange(va)},onKeyDown:function(va){"Enter"!==va.key||(va.preventDefault(),va.nativeEvent.isComposing||229===va.keyCode)||va.currentTarget.blur()},id:"".concat(C,"-filename"),value:B,onChange:function(va){return oa(va.target.value)}}):(0,Va.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(C,"-filename"),children:v.value})]})}),
Dm=function(v,C){if(null!=C&&C.collaborators&&(C=C.collaborators.get(v),null!=C&&C.color))return C.color;v=v.split("").reduce(function(B,oa){return B+oa.charCodeAt(0)},0);C=ri.elementBackground.slice(1);var U=ri.elementStroke.slice(1);return{background:C[v%C.length],stroke:U[v%U.length]}};!function(v){v.ACTIVE="active";v.AWAY="away";v.IDLE="idle"}(Ji||={});var Ln=function(){var v=document.createElement("canvas").getContext("2d");return v?(v.fillStyle="#f00",v.textBaseline="top",v.font="32px Arial",
v.fillText("\ud83d\ude00",0,0),0!==v.getImageData(12,12,1,1).data[0]):!1}(),Rm=function(v,C,U,B,oa,va,ja,xa){var Aa=8<arguments.length&&void 0!==arguments[8]&&arguments[8];v.save();v.translate(va,ja);v.rotate(xa);Aa&&v.fillRect(C-va,U-ja,B,oa);v.strokeRect(C-va,U-ja,B,oa);v.restore()},on=function(v,C,U,B){v.beginPath();v.arc(C,U,B,0,2*Math.PI);v.fill();v.stroke()},Kf=function(v,C,U,B,oa,va){v.save();v.strokeStyle="rgba(0,0,0,0.1)";v.beginPath();for(var ja=U;ja<U+oa+2*C;ja+=C)v.moveTo(ja,B-C),v.lineTo(ja,
B+va+2*C);for(ja=B;ja<B+va+2*C;ja+=C)v.moveTo(U-C,ja),v.lineTo(U+oa+2*C,ja);v.stroke();v.restore()},Gk=function(v,C,U,B){v.save();v.translate(U.scrollX,U.scrollY);v.lineWidth=1/U.zoom.value;fd.getPointsGlobalCoordinates(B).forEach(function(oa,va){var ja;v.strokeStyle="red";v.setLineDash([]);v.fillStyle=(null===(ja=C.editingLinearElement)||void 0===ja?void 0:ja.activePointIndex)===va?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";on(v,oa[0],oa[1],fd.POINT_HANDLE_SIZE/2/U.zoom.value)});v.restore()},
Si=function(v,C,U,B,oa,va,ja){var xa=7<arguments.length&&void 0!==arguments[7]?arguments[7]:{},Aa=xa.renderScrollbars;Aa=void 0===Aa||Aa;var Ca=xa.renderSelection;Ca=void 0===Ca||Ca;var Ia=xa.renderOptimizations,Wa=void 0!==Ia&&Ia;xa=xa.renderGrid;xa=void 0===xa||xa;if(null===va)return{atLeastOneVisibleElement:!1};var $a=va.getContext("2d");$a.setTransform(1,0,0,1,0,0);$a.save();$a.scale(B,B);var rb=va.width/B,Hb=va.height/B;(ja.exportWithDarkMode&&($a.filter=Cc.ZF),"string"==typeof ja.viewBackgroundColor)?
(("transparent"===ja.viewBackgroundColor||5===ja.viewBackgroundColor.length||9===ja.viewBackgroundColor.length||/(hsla|rgba)\(/.test(ja.viewBackgroundColor))&&$a.clearRect(0,0,rb,Hb),$a.save(),$a.fillStyle=ja.viewBackgroundColor,$a.fillRect(0,0,rb,Hb),$a.restore()):$a.clearRect(0,0,rb,Hb);Ia=ja.zoom.translation.x;var Xb=ja.zoom.translation.y;$a.save();$a.translate(Ia,Xb);$a.scale(ja.zoom.value,ja.zoom.value);xa&&C.gridSize&&Kf($a,C.gridSize,-Math.ceil(Ia/ja.zoom.value/C.gridSize)*C.gridSize+ja.scrollX%
C.gridSize,-Math.ceil(Xb/ja.zoom.value/C.gridSize)*C.gridSize+ja.scrollY%C.gridSize,rb/ja.zoom.value,Hb/ja.zoom.value);var jc;xa=v.filter(function(md){var sd={zoom:ja.zoom,offsetLeft:C.offsetLeft,offsetTop:C.offsetTop,scrollX:ja.scrollX,scrollY:ja.scrollY},Hd=ca(gk(md),4);md=Hd[0];var He=Hd[1],Sg=Hd[2];Hd=Hd[3];var ni=hh({clientX:sd.offsetLeft,clientY:sd.offsetTop},sd);sd=hh({clientX:sd.offsetLeft+rb,clientY:sd.offsetTop+Hb},sd);return ni.x<=Sg&&ni.y<=Hd&&sd.x>=md&&sd.y>=He});(xa.forEach(function(md){try{lh(md,
oa,$a,Wa,ja)}catch(sd){console.error(sd)}}),C.editingLinearElement)&&(Ia=fd.getElement(C.editingLinearElement.elementId))&&Gk($a,C,ja,Ia);if(U)try{lh(U,oa,$a,Wa,ja)}catch(md){console.error(md)}if(C.isBindingEnabled&&C.suggestedBindings.filter(function(md){return null!=md}).forEach(function(md){var sd=Array.isArray(md)?zq:Mn;$a.save();$a.translate(ja.scrollX,ja.scrollY);sd($a,md);$a.restore()}),Ca&&!C.multiElement&&!C.editingLinearElement){var nc,Tc=v.reduce(function(md,sd){var Hd=[];if(C.selectedElementIds[sd.id]&&
null==dh(C,sd)&&Hd.push(mf.black),ja.remoteSelectedElementIds[sd.id]&&Hd.push.apply(Hd,O(ja.remoteSelectedElementIds[sd.id].map(function(Sg){return Dm(Sg,C).background}))),Hd.length){var He=ca(Vf(sd),4);md.push({angle:sd.angle,elementX1:He[0],elementY1:He[1],elementX2:He[2],elementY2:He[3],selectionColors:Hd})}return md},[]);Ca=function(md){md=li(v,md);md=ca(Bg(md),4);Tc.push({angle:0,elementX1:md[0],elementX2:md[2],elementY1:md[1],elementY2:md[3],selectionColors:[mf.black]})};Ia=fb(vi(C));try{for(Ia.s();!(nc=
Ia.n()).done;)Ca(nc.value)}catch(md){Ia.e(md)}finally{Ia.f()}C.editingGroupId&&Ca(C.editingGroupId);Tc.forEach(function(md){var sd=md.angle,Hd=md.elementX1,He=md.elementY1,Sg=md.selectionColors,ni=md.elementX2-Hd;md=md.elementY2-He;var Ai=4/ja.zoom.value,pf=8/ja.zoom.value,Ae=4/ja.zoom.value;$a.save();$a.translate(ja.scrollX,ja.scrollY);$a.lineWidth=1/ja.zoom.value;for(var ah=Sg.length,Wi=0;Wi<ah;++Wi)$a.strokeStyle=Sg[Wi],$a.setLineDash([pf,Ae+(pf+Ae)*(ah-1)]),$a.lineDashOffset=(pf+Ae)*Wi,Rm($a,
Hd-Ai,He-Ai,ni+2*Ai,md+2*Ai,Hd+ni/2,He+md/2,sd);$a.restore()});Ca=Sf(v,C);if($a.save(),$a.translate(ja.scrollX,ja.scrollY),1===Ca.length)$a.fillStyle=mf.white,nc=Tk(Ca[0],ja.zoom,"mouse"),C.viewModeEnabled||Ej($a,ja,nc,Ca[0].angle);else if(1<Ca.length&&!C.isRotating){nc=4/ja.zoom.value;$a.fillStyle=mf.white;Ca=Bg(Ca);var Xc=ca(Ca,4);Ca=Xc[0];Ia=Xc[1];Xb=Xc[2];Xc=Xc[3];var Pc=$a.getLineDash();$a.setLineDash([2/ja.zoom.value]);var Zc=$a.lineWidth;$a.lineWidth=1/ja.zoom.value;Rm($a,Ca-nc,Ia-nc,Xb-Ca+
2*nc,Xc-Ia+2*nc,(Ca+Xb)/2,(Ia+Xc)/2,0);$a.lineWidth=Zc;$a.setLineDash(Pc);nc=Jg([Ca,Ia,Xb,Xc],0,ja.zoom,"mouse",sj);Ej($a,ja,nc,0)}$a.restore()}for(var Dd in $a.restore(),ja.remotePointerViewportCoords){nc=ja.remotePointerViewportCoords[Dd];Ia=nc.x;Xb=nc.y;Ia-=C.offsetLeft;Xb-=C.offsetTop;Xc=0>Ia||Ia>rb-9||0>Xb||Xb>Hb-14;Ia=Math.max(Ia,0);Ia=Math.min(Ia,rb-9);Xb=Math.max(Xb,0);Xb=Math.min(Xb,Hb-14);Ca=Dm(Dd,C);nc=Ca.background;Ca=Ca.stroke;$a.save();$a.strokeStyle=Ca;$a.fillStyle=nc;Pc=ja.remotePointerUserStates[Dd];
(Xc||Pc===Ji.AWAY)&&($a.globalAlpha=.48);ja.remotePointerButton&&"down"===ja.remotePointerButton[Dd]&&($a.beginPath(),$a.arc(Ia,Xb,15,0,2*Math.PI,!1),$a.lineWidth=3,$a.strokeStyle="#ffffff88",$a.stroke(),$a.closePath(),$a.beginPath(),$a.arc(Ia,Xb,15,0,2*Math.PI,!1),$a.lineWidth=1,$a.strokeStyle=Ca,$a.stroke(),$a.closePath());$a.beginPath();$a.moveTo(Ia,Xb);$a.lineTo(Ia+1,Xb+14);$a.lineTo(Ia+4,Xb+9);$a.lineTo(Ia+9,Xb+10);$a.lineTo(Ia,Xb);$a.fill();$a.stroke();Zc=ja.remotePointerUsernames[Dd];var Yd=
"";Pc===Ji.AWAY?Yd=Ln?"⚫️":" (".concat(Ji.AWAY,")"):Pc===Ji.IDLE?Yd=Ln?"\ud83d\udca4":" (".concat(Ji.IDLE,")"):Pc===Ji.ACTIVE&&(Yd=Ln?"\ud83d\udfe2":"");Pc="".concat(Zc?"".concat(Zc," "):"").concat(Yd);!Xc&&Pc&&(Ia+=9,Xb+=14,Xc=$a.measureText(Pc),Zc=Xc.actualBoundingBoxDescent+Xc.actualBoundingBoxAscent,$a.fillStyle=Ca,$a.fillRect(Ia-1,Xb-1,Xc.width+8+2,Zc+8+2),$a.fillStyle=nc,$a.fillRect(Ia,Xb,Xc.width+8,Zc+8),$a.fillStyle=mf.white,$a.fillText(Pc,Ia+4,Xb+4+Xc.actualBoundingBoxAscent));$a.restore();
$a.closePath()}return Aa&&(jc=sh(v,rb,Hb,ja),$a.save(),$a.fillStyle="rgba(0,0,0,0.3)",$a.strokeStyle="rgba(255,255,255,0.8)",[jc.horizontal,jc.vertical].forEach(function(md){if(md){var sd=md.x,Hd=md.y,He=md.width;md=md.height;$a.beginPath();$a.moveTo(sd+3,Hd);$a.lineTo(sd+He-3,Hd);$a.quadraticCurveTo(sd+He,Hd,sd+He,Hd+3);$a.lineTo(sd+He,Hd+md-3);$a.quadraticCurveTo(sd+He,Hd+md,sd+He-3,Hd+md);$a.lineTo(sd+3,Hd+md);$a.quadraticCurveTo(sd,Hd+md,sd,Hd+md-3);$a.lineTo(sd,Hd+3);$a.quadraticCurveTo(sd,Hd,
sd+3,Hd);$a.closePath();$a.fill();$a.stroke()}}),$a.restore()),$a.restore(),{atLeastOneVisibleElement:0<xa.length,scrollBars:jc}},Ej=function(v,C,U,B){Object.keys(U).forEach(function(oa){var va=U[oa];void 0!==va&&(v.save(),v.lineWidth=1/C.zoom.value,"rotation"===oa?on(v,va[0]+va[2]/2,va[1]+va[3]/2,va[2]/2):Rm(v,va[0],va[1],va[2],va[3],va[0]+va[2]/2,va[1]+va[3]/2,B,!0),v.restore())})},Mn=function(v,C){var U=ca(Vf(C),4),B=U[0],oa=U[1],va=U[2]-B;U=U[3]-oa;var ja=Rh(C,va,U);v.strokeStyle="rgba(0,0,0,.05)";
v.lineWidth=ja-4;ja=2+ja/2;switch(C.type){case "rectangle":case "text":Rm(v,B-ja,oa-ja,va+2*ja,U+2*ja,B+va/2,oa+U/2,C.angle);break;case "diamond":var xa=Math.hypot(va,U);!function(Aa,Ca,Ia,Wa,$a,rb){Aa.save();Aa.translate(Wa,$a);Aa.rotate(rb);Aa.beginPath();Aa.moveTo(0,Ia/2);Aa.lineTo(Ca/2,0);Aa.lineTo(0,-Ia/2);Aa.lineTo(-Ca/2,0);Aa.closePath();Aa.stroke();Aa.restore()}(v,va+ja*xa/U*2,U+ja*xa/va*2,B+va/2,oa+U/2,C.angle);break;case "ellipse":!function(Aa,Ca,Ia,Wa,$a,rb){Aa.beginPath();Aa.ellipse(Wa,
$a,Ca/2,Ia/2,rb,0,2*Math.PI);Aa.stroke()}(v,va+2*ja,U+2*ja,B+va/2,oa+U/2,C.angle)}},zq=function(v,C){var U=ca(C,3),B=U[0];C=U[1];U=U[2];var oa=Rh(U,U.width,U.height);v.strokeStyle="rgba(0,0,0,0)";v.fillStyle="rgba(0,0,0,.05)";("both"===C?[0,-1]:"start"===C?[0]:[-1]).forEach(function(va){va=ca(fd.getPointAtIndexGlobalCoordinates(B,va),2);on(v,va[0],va[1],oa)})},Cj=function(v,C,U){var B=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},oa=B.offsetX,va=void 0===oa?0:oa;B=B.offsetY;var ja=void 0===
B?0:B;U&&v.forEach(function(xa){if(!xa.isDeleted)try{Bf(xa,C,U,xa.x+va,xa.y+ja)}catch(Aa){console.error(Aa)}})},nm=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})();const ho=nm?e.e(736).then(e.bind(e,6629)):e.e(736).then(e.bind(e,3112));nm?e.e(736).then(e.bind(e,5756)):e.e(736).then(e.bind(e,8396));const To=nm?e.e(736).then(e.bind(e,4868)):e.e(736).then(e.bind(e,6882));var mn=function(v){function C(){var B,
oa=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",va=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";return k(this,C),(B=U.call(this)).name=va,B.message=oa,B}K(C,v);var U=Ec(C);return C}(Bc(Error)),yq=function(v){function C(){var B=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"Request Aborted";return k(this,C),U.call(this,B,"AbortError")}K(C,v);var U=Ec(C);return C}(Bc(DOMException)),xq={jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",
json:"application/json",excalidraw:Cc.LO.excalidraw,excalidrawlib:Cc.LO.excalidrawlib},Bp=function(v){var C,U,B,oa=null===(C=v.extensions)||void 0===C?void 0:C.reduce(function(va,ja){return va.push(xq[ja]),va},[]);C=null===(U=v.extensions)||void 0===U?void 0:U.reduce(function(va,ja){return"jpg"===ja?va.concat(".jpg",".jpeg"):va.concat(".".concat(ja))},[]);return async function(...va){return(await ho).default(...va)}({description:v.description,extensions:C,mimeTypes:oa,multiple:null!==(B=v.multiple)&&
void 0!==B&&B,legacySetup:function(va,ja,xa){var Aa=Sm(ja,500),Ca=function(){Ia();document.addEventListener(Cc.Ks.KEYUP,Aa);document.addEventListener(Cc.Ks.POINTER_UP,Aa);Aa()},Ia=function(){var $a;null!==($a=xa.files)&&void 0!==$a&&$a.length&&($a=v.multiple?O(xa.files):xa.files[0],va($a))};requestAnimationFrame(function(){window.addEventListener(Cc.Ks.FOCUS,Ca)});var Wa=window.setInterval(function(){Ia()},500);return function($a){clearInterval(Wa);Aa.cancel();window.removeEventListener(Cc.Ks.FOCUS,
Ca);document.removeEventListener(Cc.Ks.KEYUP,Aa);document.removeEventListener(Cc.Ks.POINTER_UP,Aa);$a&&(console.warn("Opening the file was canceled (legacy-fs)."),$a(new yq))}}})},go=function(v,C){return async function(...U){return(await To).default(...U)}(v,{fileName:"".concat(C.name,".").concat(C.extension),description:C.description,extensions:[".".concat(C.extension)]},C.fileHandle)},Fe={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,arrow:!0,freedraw:!0},In=function(v,C){var U,
B,oa,va,ja,xa,Aa,Ca,Ia,Wa,$a,rb,Hb={type:C.type||v.type,version:v.version||1,versionNonce:null!==(U=v.versionNonce)&&void 0!==U?U:0,isDeleted:null!==(B=v.isDeleted)&&void 0!==B&&B,id:v.id||dk(),fillStyle:v.fillStyle||"hachure",strokeWidth:v.strokeWidth||1,strokeStyle:null!==(oa=v.strokeStyle)&&void 0!==oa?oa:"solid",roughness:null!==(va=v.roughness)&&void 0!==va?va:1,opacity:null==v.opacity?100:v.opacity,angle:v.angle||0,x:null!==(ja=null!==(xa=C.x)&&void 0!==xa?xa:v.x)&&void 0!==ja?ja:0,y:null!==
(Aa=null!==(Ca=C.y)&&void 0!==Ca?Ca:v.y)&&void 0!==Aa?Aa:0,strokeColor:v.strokeColor,backgroundColor:v.backgroundColor,width:v.width||0,height:v.height||0,seed:null!==(Ia=v.seed)&&void 0!==Ia?Ia:1,groupIds:null!==(Wa=v.groupIds)&&void 0!==Wa?Wa:[],strokeSharpness:null!==($a=v.strokeSharpness)&&void 0!==$a?$a:oj(v.type)?"round":"sharp",boundElementIds:null!==(rb=v.boundElementIds)&&void 0!==rb?rb:[]};return Ud(Ud(Ud({},Hb),Rj(Hb)),C)},wq=function(v){var C;switch(v.type){case "text":var U=v.fontSize,
B=v.fontFamily;"font"in v&&(U=ca(v.font.split(" "),2),B=U[1],U=parseInt(U[0],10),B=Object.keys(Cc.ut).includes(B)?Cc.ut[B]:Cc.rk);return In(v,{fontSize:U,fontFamily:B,text:null!==(C=v.text)&&void 0!==C?C:"",baseline:v.baseline,textAlign:v.textAlign||Cc.Hg,verticalAlign:v.verticalAlign||Cc.hs});case "freedraw":return In(v,{points:v.points,lastCommittedPoint:null,simulatePressure:v.simulatePressure,pressures:v.pressures});case "line":case "draw":case "arrow":C=v.startArrowhead;C=void 0===C?null:C;U=
v.endArrowhead;U=void 0===U?"arrow"===v.type?"arrow":null:U;B=v.x;var oa=v.y,va=!Array.isArray(v.points)||2>v.points.length?[[0,0],[v.width,v.height]]:v.points;if(0!==va[0][0]||0!==va[0][1])oa=fd.getNormalizedPoints(v),va=oa.points,B=oa.x,oa=oa.y;return In(v,{type:"draw"===v.type?"line":v.type,startBinding:v.startBinding,endBinding:v.endBinding,lastCommittedPoint:null,startArrowhead:C,endArrowhead:U,points:va,x:B,y:oa});case "ellipse":case "rectangle":case "diamond":return In(v,{})}},sl=function(v,
C){var U=C?al(C):null;return(v||[]).reduce(function(B,oa){if("selection"!==oa.type&&!Kj(oa)){var va=wq(oa);va&&((oa=null==U?void 0:U[oa.id])&&oa.version>va.version&&(va=vg(va,oa.version)),B.push(va))}return B},[])},Um=function(v,C){v=v||{};var U,B=Ij(),oa={},va=Nc(Object.entries(B));try{for(va.s();!(U=va.n()).done;){var ja=ca(U.value,2),xa=ja[0],Aa=ja[1],Ca=v[xa],Ia=C?C[xa]:void 0;oa[xa]=void 0!==Ca?Ca:void 0!==Ia?Ia:Aa}}catch(Wa){va.e(Wa)}finally{va.f()}return Ud(Ud({},oa),{},{elementType:Fe[oa.elementType]?
oa.elementType:"selection",zoom:"number"==typeof v.zoom?{value:v.zoom,translation:B.zoom.translation}:v.zoom||B.zoom})},Tm=function(v,C,U){return{elements:sl(null==v?void 0:v.elements,U),appState:Um(null==v?void 0:v.appState,C||null)}},ko=function(){var v=(0,ff.Z)(Zd().mark(function B(U){var oa;return Zd().wrap(function(va){for(;;)switch(va.prev=va.next){case 0:if("image/png"!==U.type){va.next=18;break}return va.prev=1,va.next=4,Promise.all([e.e(736),e.e(9)]).then(e.bind(e,8527));case 4:return va.next=
6,va.sent.decodePngMetadata(U);case 6:return va.abrupt("return",va.sent);case 9:if(va.prev=9,va.t0=va.catch(1),"INVALID"!==va.t0.message){va.next=15;break}throw Error($b("alerts.imageDoesNotContainScene"));case 15:throw Error($b("alerts.cannotRestoreFromImage"));case 16:va.next=43;break;case 18:if(!("text"in Blob)){va.next=24;break}return va.next=21,U.text();case 21:oa=va.sent;va.next=27;break;case 24:return va.next=26,new Promise(function(ja){var xa=new FileReader;xa.readAsText(U,"utf8");xa.onloadend=
function(){xa.readyState===FileReader.DONE&&ja(xa.result)}});case 26:oa=va.sent;case 27:if("image/svg+xml"!==U.type){va.next=43;break}return va.prev=28,va.next=31,Promise.all([e.e(736),e.e(9)]).then(e.bind(e,8527));case 31:return va.next=33,va.sent.decodeSvgMetadata({svg:oa});case 33:return va.abrupt("return",va.sent);case 36:if(va.prev=36,va.t1=va.catch(28),"INVALID"!==va.t1.message){va.next=42;break}throw Error($b("alerts.imageDoesNotContainScene"));case 42:throw Error($b("alerts.cannotRestoreFromImage"));
case 43:return va.abrupt("return",oa);case 44:case "end":return va.stop()}},B,null,[[1,9],[28,36]])}));return function(U){return v.apply(this,arguments)}}(),Fp=function(v){var C;return v&&(null===(C=v.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===C?void 0:C[1])||null},Yo=function(v){v=Fp(v);return"png"===v||"svg"===v},vl=function(){var v=(0,ff.Z)(Zd().mark(function va(U,B,oa){var ja,xa,Aa;return Zd().wrap(function(Ca){for(;;)switch(Ca.prev=Ca.next){case 0:return Ca.next=2,ko(U);case 2:ja=
Ca.sent;Ca.prev=3;var Ia=xa=JSON.parse(ja);if((null==Ia?void 0:Ia.type)===Cc.r8.excalidraw&&(!Ia.elements||Array.isArray(Ia.elements)&&(!Ia.appState||"object"===E(Ia.appState)))){Ca.next=7;break}throw Error($b("alerts.couldNotLoadInvalidFile"));case 7:return Aa=Tm({elements:Ml(xa.elements||[]),appState:ge(ge({theme:null==B?void 0:B.theme,fileHandle:U.handle||null},fk(xa.appState||{},"export")),B?Fg(xa.elements||[],B):{})},B,oa),Ca.abrupt("return",Aa);case 11:throw Ca.prev=11,Ca.t0=Ca.catch(3),console.error(Ca.t0.message),
Error($b("alerts.couldNotLoadInvalidFile"));case 15:case "end":return Ca.stop()}},va,null,[[3,11]])}));return function(U,B,oa){return v.apply(this,arguments)}}(),jo=function(){var v=(0,ff.Z)(Zd().mark(function B(U){var oa,va;return Zd().wrap(function(ja){for(;;)switch(ja.prev=ja.next){case 0:return ja.next=2,ko(U);case 2:if(oa=ja.sent,(va=JSON.parse(oa)).type===Cc.r8.excalidrawLibrary){ja.next=6;break}throw Error($b("alerts.couldNotLoadInvalidFile"));case 6:return ja.abrupt("return",va);case 7:case "end":return ja.stop()}},
B)}));return function(U){return v.apply(this,arguments)}}(),Dp=function(){var v=(0,ff.Z)(Zd().mark(function B(U){return Zd().wrap(function(oa){for(;;)switch(oa.prev=oa.next){case 0:return oa.abrupt("return",new Promise(function(va,ja){try{U.toBlob(function(xa){if(!xa)return ja(new mn($b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));va(xa)})}catch(xa){ja(xa)}}));case 1:case "end":return oa.stop()}},B)}));return function(U){return v.apply(this,arguments)}}(),Jn=function(v,C){v={type:Cc.r8.excalidraw,
version:2,source:Cc.pb,elements:Ml(v),appState:fk(C,"export")};return JSON.stringify(v,null,2)},Em=function(){var v=(0,ff.Z)(Zd().mark(function oa(U,B){var va,ja,xa;return Zd().wrap(function(Aa){for(;;)switch(Aa.prev=Aa.next){case 0:return va=Jn(U,B),ja=new Blob([va],{type:Cc.LO.excalidraw}),Aa.next=4,go(ja,{name:B.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Yo(B.fileHandle)?null:B.fileHandle});case 4:return xa=Aa.sent,Aa.abrupt("return",{fileHandle:xa});case 6:case "end":return Aa.stop()}},
oa)}));return function(U,B){return v.apply(this,arguments)}}(),Cp=function(){var v=(0,ff.Z)(Zd().mark(function oa(U,B){var va;return Zd().wrap(function(ja){for(;;)switch(ja.prev=ja.next){case 0:return ja.next=2,Bp({description:"Excalidraw files"});case 2:return va=ja.sent,ja.abrupt("return",vl(va,U,B));case 4:case "end":return ja.stop()}},oa)}));return function(U,B){return v.apply(this,arguments)}}(),Xo=function(){var v=(0,ff.Z)(Zd().mark(function B(U){var oa,va,ja;return Zd().wrap(function(xa){for(;;)switch(xa.prev=
xa.next){case 0:return xa.next=2,U.loadLibrary();case 2:return oa=xa.sent,va={type:Cc.r8.excalidrawLibrary,version:1,source:Cc.pb,library:oa},ja=JSON.stringify(va,null,2),xa.next=7,go(new Blob([ja],{type:Cc.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"});case 7:case "end":return xa.stop()}},B)}));return function(U){return v.apply(this,arguments)}}(),Ep=function(){var v=(0,ff.Z)(Zd().mark(function B(U){var oa;return Zd().wrap(function(va){for(;;)switch(va.prev=
va.next){case 0:return va.next=2,Bp({description:"Excalidraw library files"});case 2:return oa=va.sent,va.next=5,U.importLibrary(oa);case 5:case "end":return va.stop()}},B)}));return function(U){return v.apply(this,arguments)}}(),Aq=function(v,C,U){var B=U.exportBackground,oa=U.exportPadding;oa=void 0===oa?Cc.qy:oa;var va=U.viewBackgroundColor,ja=3<arguments.length&&void 0!==arguments[3]?arguments[3]:function(Ia,Wa){var $a=document.createElement("canvas");return $a.width=Ia*C.exportScale,$a.height=
Wa*C.exportScale,{canvas:$a,scale:C.exportScale}},xa=zp(v,oa),Aa=ca(xa,4);xa=Aa[0];var Ca=Aa[1];Aa=ja(Aa[2],Aa[3]);ja=Aa.canvas;Aa=Aa.scale;return Si(v,C,null,void 0===Aa?1:Aa,Bj.canvas(ja),ja,{viewBackgroundColor:B?va:null,exportWithDarkMode:C.exportWithDarkMode,scrollX:-xa+oa,scrollY:-Ca+oa,zoom:Ij().zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{}},{renderScrollbars:!1,renderSelection:!1,renderOptimizations:!1,
renderGrid:!1}),ja},Ap=function(){var v=(0,ff.Z)(Zd().mark(function oa(U,B){var va,ja,xa,Aa,Ca,Ia,Wa,$a,rb,Hb,Xb,jc,nc,Tc,Xc,Pc;return Zd().wrap(function(Zc){for(;;)switch(Zc.prev=Zc.next){case 0:if(va=B.exportPadding,ja=void 0===va?Cc.qy:va,xa=B.viewBackgroundColor,Aa=B.exportScale,Ca=void 0===Aa?1:Aa,Ia=B.exportEmbedScene,Wa="",!Ia){Zc.next=14;break}return Zc.prev=3,Zc.next=6,Promise.all([e.e(736),e.e(9)]).then(e.bind(e,8527));case 6:return Zc.next=8,Zc.sent.encodeSvgMetadata({text:Jn(U,B)});case 8:Wa=
Zc.sent;Zc.next=14;break;case 11:Zc.prev=11,Zc.t0=Zc.catch(3),console.error(Zc.t0);case 14:return $a=zp(U,ja),rb=ca($a,4),Hb=rb[0],Xb=rb[1],jc=rb[2],nc=rb[3],(Tc=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("version","1.1"),Tc.setAttribute("xmlns","http://www.w3.org/2000/svg"),Tc.setAttribute("viewBox","0 0 ".concat(jc," ").concat(nc)),Tc.setAttribute("width","".concat(jc*Ca)),Tc.setAttribute("height","".concat(nc*Ca)),B.exportWithDarkMode&&Tc.setAttribute("filter",Cc.ZF),
Tc.innerHTML="\n ".concat("\x3c!-- svg-source:excalidraw --\x3e","\n ").concat(Wa,'\n \x3cdefs\x3e\n \x3cstyle\x3e\n @font-face {\n font-family: "Virgil";\n src: url("https://excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://excalidraw.com/Cascadia.woff2");\n }\n \x3c/style\x3e\n \x3c/defs\x3e\n '),B.exportBackground&&xa&&((Xc=Tc.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute("x",
"0"),Xc.setAttribute("y","0"),Xc.setAttribute("width","".concat(jc)),Xc.setAttribute("height","".concat(nc)),Xc.setAttribute("fill",xa),Tc.appendChild(Xc)),Pc=Bj.svg(Tc),Cj(U,Pc,Tc,{offsetX:-Hb+ja,offsetY:-Xb+ja}),Zc.abrupt("return",Tc);case 27:case "end":return Zc.stop()}},oa,null,[[3,11]])}));return function(U,B){return v.apply(this,arguments)}}(),zp=function(v,C){v=ca(Bg(v),4);var U=v[0],B=v[1];return[U,B,Math.abs(U-v[2])+2*C,Math.abs(B-v[3])+C+C]},So=function(v){return(v=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(v))?
parseFloat(v[1].replace(/,/g,"")):null},vq=function(v,C){return v.slice(1).every(function(U){return null!==So(U[C])})},or=function(v){var C=v[0].length;if(2<C)return{type:"NOT_SPREADSHEET",reason:"More than 2 columns"};if(1===C){if(!vq(v,0))return{type:"NOT_SPREADSHEET",reason:"Value is not numeric"};C=null===So(v[0][0]);var U=(C?v.slice(1):v).map(function(va){return So(va[0])});return 2>U.length?{type:"NOT_SPREADSHEET",reason:"Less than two rows"}:{type:"VALID_SPREADSHEET",spreadsheet:{title:C?v[0][0]:
null,labels:null,values:U}}}var B=vq(v,0)?0:1;if(!vq(v,B))return{type:"NOT_SPREADSHEET",reason:"Value is not numeric"};var oa=(B+1)%2;U=(C=null===So(v[0][B]))?v.slice(1):v;return 2>U.length?{type:"NOT_SPREADSHEET",reason:"Less than 2 rows"}:{type:"VALID_SPREADSHEET",spreadsheet:{title:C?v[0][B]:null,labels:U.map(function(va){return va[oa]}),values:U.map(function(va){return So(va[B])})}}},pn=ri.elementBackground.slice(2,ri.elementBackground.length),Yl={fillStyle:"hachure",fontFamily:Cc.rk,fontSize:Cc.n5,
opacity:100,roughness:1,strokeColor:ri.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},$o=function(v){return{chartWidth:44*v.values.length+12,chartHeight:280}},H=function(v,C,U,B,oa,va){var ja=$o(v),xa=ja.chartWidth,Aa=ja.chartHeight;ja=v.title?Eg(ia(ia({backgroundColor:oa,groupIds:[B]},Yl),{},{text:v.title,x:C+xa/2,y:U-256-24-Cc.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null;va=va?xf(ia(ia({backgroundColor:oa,groupIds:[B]},
Yl),{},{type:"rectangle",x:C,y:U-Aa,width:xa,height:Aa,strokeColor:ri.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[].concat(O(va?[va]:[]),O(ja?[ja]:[]),O(function(Ca,Ia,Wa,$a,rb){var Hb;return(null===(Hb=Ca.labels)||void 0===Hb?void 0:Hb.map(function(Xb,jc){return Eg(ia(ia({groupIds:[$a],backgroundColor:rb},Yl),{},{text:8<Xb.length?"".concat(Xb.slice(0,5),"..."):Xb,x:Ia+44*jc+24,y:Wa+6,width:32,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))}))||[]}(v,C,U,B,oa)),O(function(Ca,
Ia,Wa,$a,rb){var Hb=Eg(ia(ia({groupIds:[$a],backgroundColor:rb},Yl),{},{x:Ia-12,y:Wa-12,text:"0",textAlign:"right"}));return[Hb,Eg(ia(ia({groupIds:[$a],backgroundColor:rb},Yl),{},{x:Ia-12,y:Wa-256-Hb.height/2,text:Math.max.apply(Math,O(Ca.values)).toLocaleString(),textAlign:"right"}))]}(v,C,U,B,oa)),O(function(Ca,Ia,Wa,$a,rb){var Hb=$o(Ca);Ca=Hb.chartWidth;Hb=Hb.chartHeight;return[Pg(ia(ia({backgroundColor:rb,groupIds:[$a]},Yl),{},{type:"line",x:Ia,y:Wa,startArrowhead:null,endArrowhead:null,width:Ca,
points:[[0,0],[Ca,0]]})),Pg(ia(ia({backgroundColor:rb,groupIds:[$a]},Yl),{},{type:"line",x:Ia,y:Wa,startArrowhead:null,endArrowhead:null,height:Hb,points:[[0,0],[0,-Hb]]})),Pg(ia(ia({backgroundColor:rb,groupIds:[$a]},Yl),{},{type:"line",x:Ia,y:Wa-256-12,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:Ca,opacity:50,points:[[0,0],[Ca,0]]}))]}(v,C,U,B,oa)))},X=function(v,C,U,B){return"line"===v?function(oa,va,ja){var xa,Aa=Math.max.apply(Math,O(oa.values)),Ca=dk(),Ia=pn[Math.floor(Math.random()*
pn.length)],Wa=0,$a=[],rb=kg(oa.values);try{for(rb.s();!(xa=rb.n()).done;)$a.push([44*Wa,-xa.value/Aa*256]),Wa++}catch(Xb){rb.e(Xb)}finally{rb.f()}xa=Math.max.apply(Math,O($a.map(function(Xb){return Xb[0]})));Wa=Math.max.apply(Math,O($a.map(function(Xb){return Xb[1]})));rb=Math.min.apply(Math,O($a.map(function(Xb){return Xb[0]})));var Hb=Math.min.apply(Math,O($a.map(function(Xb){return Xb[1]})));$a=Pg(ia(ia({backgroundColor:Ia,groupIds:[Ca]},Yl),{},{type:"line",x:va+12+16,y:ja-12,startArrowhead:null,
endArrowhead:null,height:Wa-Hb,width:xa-rb,strokeWidth:2,points:$a}));xa=oa.values.map(function(Xb,jc){jc=44*jc+6;Xb=-Xb/Aa*256+6;return xf(ia(ia({backgroundColor:Ia,groupIds:[Ca]},Yl),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:va+jc+16,y:ja+Xb-24,width:12,height:12}))});Wa=oa.values.map(function(Xb,jc){jc=44*jc+6;Xb=Xb/Aa*256+18;return Pg(ia(ia({backgroundColor:Ia,groupIds:[Ca]},Yl),{},{type:"line",x:va+jc+16+6,y:ja-Xb,startArrowhead:null,endArrowhead:null,height:Xb,strokeStyle:"dotted",
opacity:50,points:[[0,0],[0,Xb]]}))});return[].concat(O(H(oa,va,ja,Ca,Ia,"production"===Cc.Vi.DEVELOPMENT)),[$a],O(Wa),O(xa))}(C,U,B):function(oa,va,ja){var xa=Math.max.apply(Math,O(oa.values)),Aa=dk(),Ca=pn[Math.floor(Math.random()*pn.length)],Ia=oa.values.map(function(Wa,$a){Wa=Wa/xa*256;return xf(ia(ia({backgroundColor:Ca,groupIds:[Aa]},Yl),{},{type:"rectangle",x:va+44*$a+12,y:ja-Wa-12,width:32,height:Wa}))});return[].concat(O(Ia),O(H(oa,va,ja,Aa,Ca,"production"===Cc.Vi.DEVELOPMENT)))}(C,U,B)},
ra="",Oa=!1,eb="clipboard"in navigator&&"readText"in navigator.clipboard,Cb="clipboard"in navigator&&"writeText"in navigator.clipboard,Qb="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,hc=function(){var v=(0,ff.Z)(Zd().mark(function oa(U,B){var va,ja;return Zd().wrap(function(xa){for(;;)switch(xa.prev=xa.next){case 0:return va={type:Cc.r8.excalidrawClipboard,elements:Sf(U,B)},ja=JSON.stringify(va),ra=ja,xa.prev=3,Oa=!1,xa.next=
7,We(ja);case 7:xa.next=13;break;case 9:xa.prev=9,xa.t0=xa.catch(3),Oa=!0,console.error(xa.t0);case 13:case "end":return xa.stop()}},oa,null,[[3,9]])}));return function(U,B){return v.apply(this,arguments)}}(),Hc=function(){if(!ra)return{};try{return JSON.parse(ra)}catch(v){return console.error(v),{}}},pd=function(v){v=function(C){var U=C.trim().split("\n").map(function(oa){return oa.trim().split("\t")});if(U.length&&2!==U[0].length&&(U=C.trim().split("\n").map(function(oa){return oa.trim().split(",")})),
0===U.length)return{type:"NOT_SPREADSHEET",reason:"No values"};var B=U[0].length;if(!U.every(function(oa){return oa.length===B}))return{type:"NOT_SPREADSHEET",reason:"All rows don't have same number of columns"};C=or(U);return"VALID_SPREADSHEET"!==C.type&&(U=or(function(oa){for(var va=[],ja=0;ja<oa[0].length;ja++){for(var xa=[],Aa=0;Aa<oa.length;Aa++)xa.push(oa[Aa][ja]);va.push(xa)}return va}(U)),"VALID_SPREADSHEET"===U.type)?U:C}(v);return"VALID_SPREADSHEET"===v.type?{spreadsheet:v.spreadsheet}:
null},Ee=function(){var v=(0,ff.Z)(Zd().mark(function B(U){var oa,va;return Zd().wrap(function(ja){for(;;)switch(ja.prev=ja.next){case 0:if(ja.prev=0,!U){ja.next=5;break}ja.t0=null===(oa=U.clipboardData)||void 0===oa?void 0:oa.getData("text/plain").trim();ja.next=11;break;case 5:if(ja.t1=eb,!ja.t1){ja.next=10;break}return ja.next=9,navigator.clipboard.readText();case 9:ja.t1=ja.sent;case 10:ja.t0=ja.t1;case 11:return va=ja.t0,ja.abrupt("return",va||"");case 15:return ja.prev=15,ja.t2=ja.catch(0),
ja.abrupt("return","");case 18:case "end":return ja.stop()}},B,null,[[0,15]])}));return function(U){return v.apply(this,arguments)}}(),Nf=function(){var v=(0,ff.Z)(Zd().mark(function B(U){var oa,va,ja,xa;return Zd().wrap(function(Aa){for(;;)switch(Aa.prev=Aa.next){case 0:return Aa.next=2,Ee(U);case 2:if((oa=Aa.sent)&&!oa.includes("\x3c!-- svg-source:excalidraw --\x3e")){Aa.next=5;break}return Aa.abrupt("return",Hc());case 5:if(!(va=pd(oa))){Aa.next=8;break}return Aa.abrupt("return",va);case 8:if(ja=
Hc(),Aa.prev=9,xa=JSON.parse(oa),Ca=xa,![Cc.r8.excalidraw,Cc.r8.excalidrawClipboard].includes(null==Ca?void 0:Ca.type)||!Array.isArray(Ca.elements)){Aa.next=13;break}return Aa.abrupt("return",{elements:xa.elements});case 13:return Aa.abrupt("return",ja);case 16:return Aa.prev=16,Aa.t0=Aa.catch(9),Aa.abrupt("return",Oa&&ja.elements?ja:{text:oa});case 19:case "end":return Aa.stop()}var Ca},B,null,[[9,16]])}));return function(U){return v.apply(this,arguments)}}(),Qd=function(){var v=(0,ff.Z)(Zd().mark(function B(U){return Zd().wrap(function(oa){for(;;)switch(oa.prev=
oa.next){case 0:return oa.next=2,navigator.clipboard.write([new window.ClipboardItem({"image/png":U})]);case 2:case "end":return oa.stop()}},B)}));return function(U){return v.apply(this,arguments)}}(),We=function(){var v=(0,ff.Z)(Zd().mark(function B(U){var oa;return Zd().wrap(function(va){for(;;)switch(va.prev=va.next){case 0:if(oa=!1,!Cb){va.next=11;break}return va.prev=2,va.next=5,navigator.clipboard.writeText(U||"");case 5:oa=!0;va.next=11;break;case 8:va.prev=8,va.t0=va.catch(2),console.error(va.t0);
case 11:var ja;if(!(ja=oa)){var xa=U||" ",Aa="rtl"===document.documentElement.getAttribute("dir");ja=document.createElement("textarea");ja.style.border="0";ja.style.padding="0";ja.style.margin="0";ja.style.position="absolute";ja.style[Aa?"right":"left"]="-9999px";ja.style.top="".concat(window.pageYOffset||document.documentElement.scrollTop,"px");ja.style.fontSize="12pt";ja.setAttribute("readonly","");ja.value=xa;document.body.appendChild(ja);xa=!1;try{ja.select(),ja.setSelectionRange(0,ja.value.length),
xa=document.execCommand("copy")}catch(Ca){console.error(Ca)}ja=(ja.remove(),xa)}if(ja){va.next=13;break}throw Error("couldn't copy");case 13:case "end":return va.stop()}},B,null,[[2,8]])}));return function(U){return v.apply(this,arguments)}}(),uf=function(){var v=(0,ff.Z)(Zd().mark(function ja(U,B,oa,va){var xa,Aa,Ca,Ia,Wa,$a,rb,Hb,Xb,jc;return Zd().wrap(function(nc){for(;;)switch(nc.prev=nc.next){case 0:if(xa=va.exportBackground,Aa=va.exportPadding,Ca=void 0===Aa?Cc.qy:Aa,Ia=va.viewBackgroundColor,
Wa=va.name,$a=va.fileHandle,rb=void 0===$a?null:$a,0!==B.length){nc.next=3;break}throw Error($b("alerts.cannotExportEmptyCanvas"));case 3:if("svg"!==U&&"clipboard-svg"!==U){nc.next=17;break}return nc.next=6,Ap(B,{exportBackground:xa,exportWithDarkMode:oa.exportWithDarkMode,viewBackgroundColor:Ia,exportPadding:Ca,exportScale:oa.exportScale,exportEmbedScene:oa.exportEmbedScene&&"svg"===U});case 6:if(Hb=nc.sent,"svg"!==U){nc.next=13;break}return nc.next=10,go(new Blob([Hb.outerHTML],{type:"image/svg+xml"}),
{name:Wa,extension:"svg",fileHandle:rb});case 10:return nc.abrupt("return",nc.sent);case 13:if("clipboard-svg"!==U){nc.next=17;break}return nc.next=16,We(Hb.outerHTML);case 16:return nc.abrupt("return");case 17:return(Xb=Aq(B,oa,{exportBackground:xa,viewBackgroundColor:Ia,exportPadding:Ca})).style.display="none",document.body.appendChild(Xb),nc.next=22,Dp(Xb);case 22:if(jc=nc.sent,Xb.remove(),"png"!==U){nc.next=36;break}if(!oa.exportEmbedScene){nc.next=31;break}return nc.next=28,Promise.all([e.e(736),
e.e(9)]).then(e.bind(e,8527));case 28:return nc.next=30,nc.sent.encodePngMetadata({blob:jc,metadata:Jn(B,oa)});case 30:jc=nc.sent;case 31:return nc.next=33,go(jc,{name:Wa,extension:"png",fileHandle:rb});case 33:return nc.abrupt("return",nc.sent);case 36:if("clipboard"!==U){nc.next=47;break}return nc.prev=37,nc.next=40,Qd(jc);case 40:nc.next=47;break;case 42:if(nc.prev=42,nc.t0=nc.catch(37),"CANVAS_POSSIBLY_TOO_BIG"!==nc.t0.name){nc.next=46;break}throw nc.t0;case 46:throw Error($b("alerts.couldNotCopyToClipboard"));
case 47:case "end":return nc.stop()}},ja,null,[[37,42]])}));return function(U,B,oa,va){return v.apply(this,arguments)}}(),vf=function(){var v=(0,ff.Z)(Zd().mark(function oa(U,B){var va,ja,xa,Aa,Ca,Ia;return Zd().wrap(function(Wa){for(;;)switch(Wa.prev=Wa.next){case 0:if(ja=(va=B).exportBackground,xa=va.viewBackgroundColor,Aa=va.name,Ca=va.fileHandle,Ia=Fp(Ca),Ca&&("png"===($a=Ia)||"svg"===$a)){Wa.next=4;break}throw Error("fileHandle should exist and should be of type svg or png when resaving");case 4:return B=
ya(ya({},B),{},{exportEmbedScene:!0}),Wa.next=7,uf(Ia,pe(U),B,{exportBackground:ja,viewBackgroundColor:xa,name:Aa,fileHandle:Ca});case 7:return Wa.abrupt("return",{fileHandle:Ca});case 8:case "end":return Wa.stop()}var $a},oa)}));return function(U,B){return v.apply(this,arguments)}}(),Wc=(e(7225),function(v){var C=v.children,U=v.checked,B=v.onChange;return(0,Va.jsxs)("div",{className:oc("Checkbox",{"is-checked":U}),onClick:function(oa){B(!U);oa.currentTarget.querySelector(".Checkbox-box").focus()},
children:[(0,Va.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":U,children:Nb}),(0,Va.jsx)("div",{className:"Checkbox-label",children:C})]})});e(4623);var Jc=function(v){var C=v.children,U=v.gap,B=v.align,oa=v.justifyContent,va=v.style;return(0,Va.jsx)("div",{className:oc("Stack Stack_horizontal",v.className),style:mb({"--gap":U,alignItems:B,justifyContent:oa},va),children:C})},Sc=function(v){var C=v.children,U=v.gap,B=v.align,oa=v.justifyContent;return(0,Va.jsx)("div",{className:oc("Stack Stack_vertical",
v.className),style:{"--gap":U,justifyItems:B,justifyContent:oa},children:C})},Id=(e(554),function(v){var C=v.onSave;return(0,Va.jsxs)(Jc,{className:"ActiveFile",gap:1,align:"center",children:[(0,Va.jsxs)("span",{className:"ActiveFile__fileName",children:[hm,(0,Va.jsx)("span",{children:v.fileName})]}),(0,Va.jsx)(Ha,{type:"icon",icon:Fc,title:$b("buttons.save"),"aria-label":$b("buttons.save"),onClick:C,"data-testid":"save-button"})]})});ye({name:"changeProjectName",perform:function(v,C,U){return Lh("change",
"title"),{appState:ac(ac({},C),{},{name:U}),commitToHistory:!1}},PanelComponent:function(v){var C=v.appState,U=v.updateData;v=v.appProps;return(0,Va.jsx)(Jk,{label:$b("labels.fileTitle"),value:C.name||"Unnamed",onChange:function(B){return U(B)},isNameEditable:void 0===v.name&&!C.viewModeEnabled})}});ye({name:"changeExportScale",perform:function(v,C,U){return{appState:ac(ac({},C),{},{exportScale:U}),commitToHistory:!1}},PanelComponent:function(v){var C=v.appState,U=v.updateData;v=pe(v.elements);var B=
vh(v,C)?Sf(v,C):v;return(0,Va.jsx)(Va.Fragment,{children:Cc.ZB.map(function(oa){var va=function(xa,Aa,Ca){xa=ca(zp(xa,Aa).map(function(Ia){return Math.trunc(Ia*Ca)}),4);return[xa[2],xa[3]]}(B,Cc.qy,oa),ja=ca(va,2);va=ja[0];ja=ja[1];va="".concat($b("buttons.scale")," ").concat(oa,"x (").concat(va,"x").concat(ja,")");return(0,Va.jsx)(Ha,{size:"small",type:"radio",icon:"".concat(oa,"x"),name:"export-canvas-scale",title:va,"aria-label":va,id:"export-canvas-scale",checked:oa===C.exportScale,onChange:function(){return U(oa)}},
oa)})})}});ye({name:"changeExportBackground",perform:function(v,C,U){return{appState:ac(ac({},C),{},{exportBackground:U}),commitToHistory:!1}},PanelComponent:function(v){var C=v.updateData;return(0,Va.jsx)(Wc,{checked:v.appState.exportBackground,onChange:function(U){return C(U)},children:$b("labels.withBackground")})}});ye({name:"changeExportEmbedScene",perform:function(v,C,U){return{appState:ac(ac({},C),{},{exportEmbedScene:U}),commitToHistory:!1}},PanelComponent:function(v){var C=v.updateData;return(0,Va.jsxs)(Wc,
{checked:v.appState.exportEmbedScene,onChange:function(U){return C(U)},children:[$b("labels.exportEmbedScene"),(0,Va.jsx)(wf,{label:$b("labels.exportEmbedScene_details"),long:!0,children:(0,Va.jsx)("div",{className:"excalidraw-tooltip-icon",children:bg})})]})}});ye({name:"saveToActiveFile",perform:(Md=(0,ff.Z)(Zd().mark(function oa(C,U,B){var va,ja,xa;return Zd().wrap(function(Aa){for(;;)switch(Aa.prev=Aa.next){case 0:if(va=!!U.fileHandle,Aa.prev=1,!Yo(U.fileHandle)){Aa.next=8;break}return Aa.next=
5,vf(C,U);case 5:Aa.t0=Aa.sent;Aa.next=11;break;case 8:return Aa.next=10,Em(C,U);case 10:Aa.t0=Aa.sent;case 11:return ja=Aa.t0,xa=ja.fileHandle,Aa.abrupt("return",{commitToHistory:!1,appState:ac(ac({},U),{},{fileHandle:xa,toastMessage:va?null!=xa&&xa.name?$b("toast.fileSavedToFilename").replace("{filename}",'"'.concat(xa.name,'"')):$b("toast.fileSaved"):null})});case 16:return Aa.prev=16,Aa.t1=Aa.catch(1),"AbortError"!==(null===Aa.t1||void 0===Aa.t1?void 0:Aa.t1.name)&&console.error(Aa.t1),Aa.abrupt("return",
{commitToHistory:!1});case 20:case "end":return Aa.stop()}},oa,null,[[1,16]])})),function(C,U,B){return Md.apply(this,arguments)}),keyTest:function(C){return"s"===C.key&&C[Af]&&!C.shiftKey},PanelComponent:function(C){var U,B=C.updateData;return(0,Va.jsx)(Id,{onSave:function(){return B(null)},fileName:null===(U=C.appState.fileHandle)||void 0===U?void 0:U.name})}});var Md,Qf,Oe,Rf=ye({name:"saveFileToDisk",perform:(Qf=(0,ff.Z)(Zd().mark(function va(U,B,oa){var ja,xa;return Zd().wrap(function(Aa){for(;;)switch(Aa.prev=
Aa.next){case 0:return Aa.prev=0,Aa.next=3,Em(U,ac(ac({},B),{},{fileHandle:null}));case 3:return ja=Aa.sent,xa=ja.fileHandle,Aa.abrupt("return",{commitToHistory:!1,appState:ac(ac({},B),{},{fileHandle:xa})});case 8:return Aa.prev=8,Aa.t0=Aa.catch(0),"AbortError"!==(null===Aa.t0||void 0===Aa.t0?void 0:Aa.t0.name)&&console.error(Aa.t0),Aa.abrupt("return",{commitToHistory:!1});case 12:case "end":return Aa.stop()}},va,null,[[0,8]])})),function(U,B,oa){return Qf.apply(this,arguments)}),keyTest:function(U){return"s"===
U.key&&U.shiftKey&&U[Af]},PanelComponent:function(U){var B=U.updateData;return(0,Va.jsx)(Ha,{type:"button",icon:Gc,title:$b("buttons.saveAs"),"aria-label":$b("buttons.saveAs"),showAriaLabel:om(),hidden:!nm,onClick:function(){return B(null)},"data-testid":"save-as-button"})}});ye({name:"loadScene",perform:(Oe=(0,ff.Z)(Zd().mark(function va(B,oa){var ja,xa,Aa;return Zd().wrap(function(Ca){for(;;)switch(Ca.prev=Ca.next){case 0:return Ca.prev=0,Ca.next=3,Cp(oa,B);case 3:return ja=Ca.sent,xa=ja.elements,
Aa=ja.appState,Ca.abrupt("return",{elements:xa,appState:Aa,commitToHistory:!0});case 9:if(Ca.prev=9,Ca.t0=Ca.catch(0),"AbortError"!==(null===Ca.t0||void 0===Ca.t0?void 0:Ca.t0.name)){Ca.next=13;break}return Ca.abrupt("return",!1);case 13:return Ca.abrupt("return",{elements:B,appState:ac(ac({},oa),{},{errorMessage:Ca.t0.message}),commitToHistory:!1});case 14:case "end":return Ca.stop()}},va,null,[[0,9]])})),function(B,oa){return Oe.apply(this,arguments)}),keyTest:function(B){return B[Af]&&"o"===B.key},
PanelComponent:function(B){var oa=B.updateData;B.appState;return(0,Va.jsx)(Ha,{type:"button",icon:rc,title:$b("buttons.load"),"aria-label":$b("buttons.load"),showAriaLabel:om(),onClick:oa,"data-testid":"load-button"})}});ye({name:"exportWithDarkMode",perform:function(B,oa,va){return{appState:ac(ac({},oa),{},{exportWithDarkMode:va}),commitToHistory:!1}},PanelComponent:function(B){var oa=B.updateData;return(0,Va.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},
children:(0,Va.jsx)(Bd,{value:B.appState.exportWithDarkMode?"dark":"light",onChange:function(va){oa("dark"===va)},title:$b("labels.toggleExportColorScheme")})})}});var pg="{}",Zf=ye({name:"copyStyles",perform:function(B,oa){B=B.find(function(va){return oa.selectedElementIds[va.id]});return B&&(pg=JSON.stringify(B)),{appState:id(id({},oa),{},{toastMessage:$b("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(B){return B[Af]&&B.altKey&&"KeyC"===B.code}}),
jn=ye({name:"pasteStyles",perform:function(B,oa){var va=JSON.parse(pg);return"text"!==(null==va?void 0:va.type)&&"diamond"!==(null==va?void 0:va.type)&&"rectangle"!==(null==va?void 0:va.type)&&"ellipse"!==(null==va?void 0:va.type)&&"arrow"!==(null==va?void 0:va.type)&&"freedraw"!==(null==va?void 0:va.type)&&"line"!==(null==va?void 0:va.type)?{elements:B,commitToHistory:!1}:{elements:B.map(function(ja){return oa.selectedElementIds[ja.id]?(ja=cf(ja,{backgroundColor:null==va?void 0:va.backgroundColor,
strokeWidth:null==va?void 0:va.strokeWidth,strokeColor:null==va?void 0:va.strokeColor,strokeStyle:null==va?void 0:va.strokeStyle,fillStyle:null==va?void 0:va.fillStyle,opacity:null==va?void 0:va.opacity,roughness:null==va?void 0:va.roughness}),Xg(ja)&&(le(ja,{fontSize:(null==va?void 0:va.fontSize)||Cc.n5,fontFamily:(null==va?void 0:va.fontFamily)||Cc.rk,textAlign:(null==va?void 0:va.textAlign)||Cc.Hg}),Lj(ja)),ja):ja}),commitToHistory:!0}},contextItemLabel:"labels.pasteStyles",keyTest:function(B){return B[Af]&&
B.altKey&&"KeyV"===B.code}}),js=function(B){return(0,Va.jsx)("button",{className:"help-icon",onClick:B.onClick,type:"button",title:"".concat(B.title," — ?"),"aria-label":B.title,children:bg})};ye({name:"toggleCanvasMenu",perform:function(B,oa){return{appState:we(we({},oa),{},{openMenu:"canvas"===oa.openMenu?null:"canvas"}),commitToHistory:!1}},PanelComponent:function(B){var oa=B.appState;B=B.updateData;return(0,Va.jsx)(Ha,{type:"button",icon:Ke,"aria-label":$b("buttons.menu"),onClick:B,selected:"canvas"===
oa.openMenu})}});ye({name:"toggleEditMenu",perform:function(B,oa){return{appState:we(we({},oa),{},{openMenu:"shape"===oa.openMenu?null:"shape"}),commitToHistory:!1}},PanelComponent:function(B){var oa=B.appState,va=B.updateData;return(0,Va.jsx)(Ha,{visible:wh(oa,pe(B.elements)),type:"button",icon:df,"aria-label":$b("buttons.edit"),onClick:va,selected:"shape"===oa.openMenu})}});ye({name:"toggleFullScreen",perform:function(){return Ul()||document.documentElement.requestFullscreen(),Ul()&&document.exitFullscreen(),
{commitToHistory:!1}},keyTest:function(B){return"KeyF"===B.code&&!B[Af]}});ye({name:"toggleShortcuts",perform:function(B,oa,va,ja){B=ja.focusContainer;return oa.showHelpDialog&&B(),{appState:we(we({},oa),{},{showHelpDialog:!oa.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(B){B=B.updateData;return(0,Va.jsx)(js,{title:$b("helpDialog.title"),onClick:B})},keyTest:function(B){return"?"===B.key}});var Ct=function(B,oa){B=Sf(pe(B),oa);return 2<=B.length&&!function(va){if(2<=va.length){var ja,
xa=ke(va[0].groupIds);try{var Aa=function(){var Ia=ja.value;if(va.reduce(function(Wa,$a){return Wa&&$a.groupIds.includes(Ia)},!0))return{v:!0}};for(xa.s();!(ja=xa.n()).done;){var Ca=Aa();if("object"===E(Ca))return Ca.v}}catch(Ia){xa.e(Ia)}finally{xa.f()}}return!1}(B)},Dt=ye({name:"group",perform:function(B,oa){var va=Sf(pe(B),oa);if(2>va.length)return{appState:oa,elements:B,commitToHistory:!1};var ja=vi(oa);if(1===ja.length&&(ja=new Set(li(B,ja[0]).map(function(Ca){return Ca.id})),va=new Set(va.map(function(Ca){return Ca.id})),
(new Set([].concat(O(Array.from(ja)),O(Array.from(va))))).size===ja.size))return{appState:oa,elements:B,commitToHistory:!1};var xa=dk();ja=B.map(function(Ca){if(oa.selectedElementIds[Ca.id]){var Ia=oa.editingGroupId;var Wa=O(Ca.groupIds);Ia=Ia?Wa.indexOf(Ia):-1;Wa=(Wa.splice(-1<Ia?Ia:Wa.length,0,xa),Wa);Ca=cf(Ca,{groupIds:Wa})}return Ca});B=li(ja,xa);var Aa=ja.lastIndexOf(B[B.length-1]);va=ja.slice(Aa+1);ja=ja.slice(0,Aa).filter(function(Ca){return!Ca.groupIds.includes(xa)});B=[].concat(O(ja),O(B),
O(va));return{appState:Pf(xa,he(he({},oa),{},{selectedGroupIds:{}}),pe(B)),elements:B,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(B,oa){return Ct(B,oa)},keyTest:function(B){return!B.shiftKey&&B[Af]&&"KeyG"===B.code},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!Ct(oa,va),type:"button",icon:(0,Va.jsx)(Yi,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.group")," — ").concat(Vd("CtrlOrCmd+G")),
"aria-label":$b("labels.group"),visible:vh(pe(oa),va)})}}),Bt=ye({name:"ungroup",perform:function(B,oa){if(0===vi(oa).length)return{appState:oa,elements:B,commitToHistory:!1};B=B.map(function(va){var ja=function(xa,Aa){return xa.filter(function(Ca){return!Aa[Ca]})}(va.groupIds,oa.selectedGroupIds);return ja.length===va.groupIds.length?va:cf(va,{groupIds:ja})});return{appState:Me(he(he({},oa),{},{selectedGroupIds:{}}),pe(B)),elements:B,commitToHistory:!0}},keyTest:function(B){return B.shiftKey&&B[Af]&&
"KeyG"===B.code},contextItemLabel:"labels.ungroup",contextItemPredicate:function(B,oa){return 0<vi(oa).length},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{type:"button",hidden:0===vi(va).length,icon:(0,Va.jsx)(wj,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.ungroup")," — ").concat(Vd("CtrlOrCmd+Shift+G")),"aria-label":$b("labels.ungroup"),visible:vh(pe(oa),va)})}}),Cv=(e(2789),function(B){var oa=B.children,va=
B.onClick;return(0,Va.jsx)("div",{className:"Avatar",style:{background:B.color,border:"1px solid ".concat(B.border)},onClick:va,children:oa})});ye({name:"goToCollaborator",perform:function(B,oa,va){return va?{appState:Kg(Kg(Kg({},oa),Ce({scenePoint:va,viewportDimensions:{width:oa.width,height:oa.height},zoom:oa.zoom})),{},{openMenu:"canvas"===oa.openMenu?null:oa.openMenu}),commitToHistory:!1}:{appState:oa,commitToHistory:!1}},PanelComponent:function(B){var oa=B.appState,va=B.updateData;B=B.data;B=
null==B?void 0:B.id;if(!B)return null;var ja=oa.collaborators.get(B);if(!ja)return null;B=Dm(B,oa);oa=B.background;B=B.stroke;var xa=function(Aa){if(!Aa)return"?";Aa=Aa.trim().split(" ");return 2>Aa.length?Aa[0].substring(0,2).toUpperCase():(Aa[0][0]+Aa[Aa.length-1][0]).toUpperCase()}(ja.username);return(0,Va.jsx)(Cv,{color:oa,border:B,onClick:function(){return va(ja.pointer)},children:xa})}});var Dv=ye({name:"addToLibrary",perform:function(B,oa,va,ja){var xa=Sf(pe(B),oa);return ja.library.loadLibrary().then(function(Aa){ja.library.saveLibrary([].concat(O(Aa),
[xa.map(Wf)]))}),!1},contextItemLabel:"labels.addToLibrary"}),Av=function(B){var oa=new Map;return B.forEach(function(va){var ja=0===va.groupIds.length?va.id:va.groupIds[va.groupIds.length-1],xa=oa.get(ja)||[];oa.set(ja,[].concat(O(xa),[va]))}),Array.from(oa.values())},Bv=function(B,oa,va){var ja=va.axis;va=va.position;B=At(B);var xa=ca("x"===ja?["minX","maxX"]:["minY","maxY"],2),Aa=xa[0];xa=xa[1];return Vh(Vh({},{x:0,y:0}),{},T({},ja,"start"===va?oa[Aa]-B[Aa]:"end"===va?oa[xa]-B[xa]:(oa[Aa]+oa[xa])/
2-(B[Aa]+B[xa])/2))},At=function(B){B=ca(Bg(B),4);return{minX:B[0],minY:B[1],maxX:B[2],maxY:B[3]}},Np=function(B,oa){return 1<Sf(pe(B),oa).length},Up=function(B,oa,va){oa=function(xa,Aa){var Ca=Av(xa),Ia=At(xa);return Ca.flatMap(function(Wa){var $a=Bv(Wa,Ia,Aa);return Wa.map(function(rb){return cf(rb,{x:rb.x+$a.x,y:rb.y+$a.y})})})}(Sf(pe(B),oa),va);var ja=al(oa);return B.map(function(xa){return ja[xa.id]||xa})};ye({name:"alignTop",perform:function(B,oa){return{appState:oa,elements:Up(B,oa,{position:"start",
axis:"y"}),commitToHistory:!0}},keyTest:function(B){return B[Af]&&B.shiftKey&&"ArrowUp"===B.key},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!Np(oa,va),type:"button",icon:(0,Va.jsx)(Kk,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.alignTop")," — ").concat(Vd("CtrlOrCmd+Shift+Up")),"aria-label":$b("labels.alignTop"),visible:vh(pe(oa),va)})}});ye({name:"alignBottom",perform:function(B,oa){return{appState:oa,
elements:Up(B,oa,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(B){return B[Af]&&B.shiftKey&&"ArrowDown"===B.key},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!Np(oa,va),type:"button",icon:(0,Va.jsx)(wl,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.alignBottom")," — ").concat(Vd("CtrlOrCmd+Shift+Down")),"aria-label":$b("labels.alignBottom"),visible:vh(pe(oa),va)})}});ye({name:"alignLeft",
perform:function(B,oa){return{appState:oa,elements:Up(B,oa,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(B){return B[Af]&&B.shiftKey&&"ArrowLeft"===B.key},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!Np(oa,va),type:"button",icon:(0,Va.jsx)(Wo,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.alignLeft")," — ").concat(Vd("CtrlOrCmd+Shift+Left")),"aria-label":$b("labels.alignLeft"),visible:vh(pe(oa),
va)})}});ye({name:"alignRight",perform:function(B,oa){return{appState:oa,elements:Up(B,oa,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(B){return B[Af]&&B.shiftKey&&"ArrowRight"===B.key},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!Np(oa,va),type:"button",icon:(0,Va.jsx)(Fm,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.alignRight")," — ").concat(Vd("CtrlOrCmd+Shift+Right")),"aria-label":$b("labels.alignRight"),
visible:vh(pe(oa),va)})}});ye({name:"alignVerticallyCentered",perform:function(B,oa){return{appState:oa,elements:Up(B,oa,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!Np(oa,va),type:"button",icon:(0,Va.jsx)(kj,{theme:va.theme}),onClick:function(){return ja(null)},title:$b("labels.centerVertically"),"aria-label":$b("labels.centerVertically"),visible:vh(pe(oa),va)})}});ye({name:"alignHorizontallyCentered",
perform:function(B,oa){return{appState:oa,elements:Up(B,oa,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!Np(oa,va),type:"button",icon:(0,Va.jsx)(xn,{theme:va.theme}),onClick:function(){return ja(null)},title:$b("labels.centerHorizontally"),"aria-label":$b("labels.centerHorizontally"),visible:vh(pe(oa),va)})}});var Ev=function(B){var oa=new Map;return B.forEach(function(va){var ja=0===va.groupIds.length?
va.id:va.groupIds[va.groupIds.length-1],xa=oa.get(ja)||[];oa.set(ja,[].concat(O(xa),[va]))}),Array.from(oa.values())},Ht=function(B){var oa=ca(Bg(B),4);B=oa[0];var va=oa[1],ja=oa[2];oa=oa[3];return{minX:B,minY:va,maxX:ja,maxY:oa,width:ja-B,height:oa-va,midX:(B+ja)/2,midY:(va+oa)/2}},It=function(B,oa){return 1<Sf(pe(B),oa).length},Jt=function(B,oa,va){oa=function(xa,Aa){var Ca,Ia=ca("x"===Aa.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],4),Wa=Ia[0],$a=Ia[1],rb=Ia[2],Hb=Ia[3],
Xb=Ht(xa);xa=Ev(xa).map(function(Yd){return[Yd,Ht(Yd)]}).sort(function(Yd,md){return Yd[1][$a]-md[1][$a]});Ia=0;var jc=Lg(xa);try{for(jc.s();!(Ca=jc.n()).done;)Ia+=Ca.value[1][Hb]}catch(Yd){jc.e(Yd)}finally{jc.f()}var nc=(Xb[Hb]-Ia)/(xa.length-1);if(0>nc){var Tc=xa.findIndex(function(Yd){return Yd[1][Wa]===Xb[Wa]}),Xc=xa.findIndex(function(Yd){return Yd[1][rb]===Xb[rb]}),Pc=(xa[Xc][1][$a]-xa[Tc][1][$a])/(xa.length-1),Zc=xa[Tc][1][$a];return xa.flatMap(function(Yd,md){var sd=ca(Yd,2);Yd=sd[0];sd=sd[1];
var Hd={x:0,y:0};return md!==Tc&&md!==Xc&&(Zc+=Pc,Hd[Aa.axis]=Zc-sd[$a]),Yd.map(function(He){return cf(He,{x:He.x+Hd.x,y:He.y+Hd.y})})})}var Dd=Xb[Wa];return xa.flatMap(function(Yd){var md=ca(Yd,2);Yd=md[0];md=md[1];var sd={x:0,y:0};return sd[Aa.axis]=Dd-md[Wa],Dd+=nc,Dd+=md[Hb],Yd.map(function(Hd){return cf(Hd,{x:Hd.x+sd.x,y:Hd.y+sd.y})})})}(Sf(pe(B),oa),va);var ja=al(oa);return B.map(function(xa){return ja[xa.id]||xa})},Kt=(ye({name:"distributeHorizontally",perform:function(B,oa){return{appState:oa,
elements:Jt(B,oa,{space:"between",axis:"x"}),commitToHistory:!0}},keyTest:function(B){return B.altKey&&"KeyH"===B.code},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!It(oa,va),type:"button",icon:(0,Va.jsx)(Cf,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.distributeHorizontally")," — ").concat(Vd("Alt+H")),"aria-label":$b("labels.distributeHorizontally"),visible:vh(pe(oa),va)})}}),ye({name:"distributeVertically",
perform:function(B,oa){return{appState:oa,elements:Jt(B,oa,{space:"between",axis:"y"}),commitToHistory:!0}},keyTest:function(B){return B.altKey&&"KeyV"===B.code},PanelComponent:function(B){var oa=B.elements,va=B.appState,ja=B.updateData;return(0,Va.jsx)(Ha,{hidden:!It(oa,va),type:"button",icon:(0,Va.jsx)(Nn,{theme:va.theme}),onClick:function(){return ja(null)},title:"".concat($b("labels.distributeVertically")," — ").concat(Vd("Alt+V")),"aria-label":$b("labels.distributeVertically"),visible:vh(pe(oa),
va)})}}),ye({name:"flipHorizontal",perform:function(B,oa){return{elements:Mt(B,oa,"horizontal"),appState:oa,commitToHistory:!0}},keyTest:function(B){return B.shiftKey&&"KeyH"===B.code},contextItemLabel:"labels.flipHorizontal",contextItemPredicate:function(B,oa){B=Sf(pe(B),oa);return 1===B.length&&"text"!==B[0].type}})),Lt=ye({name:"flipVertical",perform:function(B,oa){return{elements:Mt(B,oa,"vertical"),appState:oa,commitToHistory:!0}},keyTest:function(B){return B.shiftKey&&"KeyV"===B.code},contextItemLabel:"labels.flipVertical",
contextItemPredicate:function(B,oa){return 1===Sf(pe(B),oa).length}}),Mt=function(B,oa,va){var ja=Sf(pe(B),oa);if(1<ja.length)return B;oa=Fv(ja,oa,va);var xa=al(oa);return B.map(function(Aa){return xa[Aa.id]||Aa})},Fv=function(B,oa,va){for(var ja=0;ja<B.length;ja++)if(Gv(B[ja],oa),"vertical"===va){var xa=B[ja],Aa=xa.x,Ca=xa.y,Ia=fe(xa.angle+Math.PI);0>Ia&&(Ia=fe(2*Math.PI+Ia));le(xa,{angle:Ia});le(xa,{x:Aa,y:Ca})}return B},Gv=function(B,oa){var va=B.x,ja=B.y,xa=B.width,Aa=B.height,Ca=fe(B.angle),
Ia=0;(Dg(B)||ki(B))&&(Ia=2*B.points.reduce(function(Hb,Xb){return Math.max(Hb,Xb[0])},0)-B.width);le(B,{angle:fe(0)});oa=Tk(B,oa.zoom);var Wa=!0,$a=0,rb=oa.nw;if(rb||(Wa=!1,rb=oa.ne)){if(Dg(B)){for(xa=1;xa<B.points.length;xa++)fd.movePoint(B,xa,[-B.points[xa][0],B.points[xa][1]]);fd.normalizePoints(B)}else $a=Wa?B.x+2*xa:B.x-2*xa,Fi(B,!0,B,Wa?"nw":"ne",!1,$a,rb[1]),le(B,{width:xa,height:Aa});Ca=fe(2*Math.PI-Ca);0>Ca&&(Ca=fe(Ca+2*Math.PI));le(B,{angle:Ca});le(B,{x:va+Ia,y:ja});Di(B)}else le(B,{angle:Ca})},
ts=ye({name:"copy",perform:function(B,oa){return hc(pe(B),oa),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),Hv=ye({name:"cut",perform:function(B,oa,va,ja){return ts.perform(B,oa,va,ja),hn.perform(B,oa,va,ja)},contextItemLabel:"labels.cut",keyTest:function(B){return B[Af]&&"KeyX"===B.code}}),Nt=ye({name:"copyAsSvg",perform:function(){var B=(0,ff.Z)(Zd().mark(function Ca(va,ja,xa,Aa){var Ia;return Zd().wrap(function(Wa){for(;;)switch(Wa.prev=Wa.next){case 0:if(Aa.canvas){Wa.next=
2;break}return Wa.abrupt("return",{commitToHistory:!1});case 2:return Ia=Sf(pe(va),ja),Wa.prev=3,Wa.next=6,uf("clipboard-svg",Ia.length?Ia:pe(va),ja,ja);case 6:return Wa.abrupt("return",{commitToHistory:!1});case 9:return Wa.prev=9,Wa.t0=Wa.catch(3),console.error(Wa.t0),Wa.abrupt("return",{appState:Jd(Jd({},ja),{},{errorMessage:Wa.t0.message}),commitToHistory:!1});case 13:case "end":return Wa.stop()}},Ca,null,[[3,9]])}));return function(va,ja,xa,Aa){return B.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsSvg"}),
Ot=ye({name:"copyAsPng",perform:function(){var B=(0,ff.Z)(Zd().mark(function Ca(va,ja,xa,Aa){var Ia;return Zd().wrap(function(Wa){for(;;)switch(Wa.prev=Wa.next){case 0:if(Aa.canvas){Wa.next=2;break}return Wa.abrupt("return",{commitToHistory:!1});case 2:return Ia=Sf(pe(va),ja),Wa.prev=3,Wa.next=6,uf("clipboard",Ia.length?Ia:pe(va),ja,ja);case 6:return Wa.abrupt("return",{appState:Jd(Jd({},ja),{},{toastMessage:$b("toast.copyToClipboardAsPng",{exportSelection:Ia.length?$b("toast.selection"):$b("toast.canvas"),
exportColorScheme:ja.exportWithDarkMode?$b("buttons.darkMode"):$b("buttons.lightMode")})}),commitToHistory:!1});case 9:return Wa.prev=9,Wa.t0=Wa.catch(3),console.error(Wa.t0),Wa.abrupt("return",{appState:Jd(Jd({},ja),{},{errorMessage:Wa.t0.message}),commitToHistory:!1});case 13:case "end":return Wa.stop()}},Ca,null,[[3,9]])}));return function(va,ja,xa,Aa){return B.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsPng",keyTest:function(B){return"KeyC"===B.code&&B.altKey&&B.shiftKey}}),Pt=ye({name:"gridMode",
perform:function(B,oa){return Lh("view","mode","grid"),{appState:oi(oi({},oa),{},{gridSize:this.checked(oa)?null:Cc.k}),commitToHistory:!1}},checked:function(B){return null!==B.gridSize},contextItemLabel:"labels.showGrid",keyTest:function(B){return B[Af]&&"Quote"===B.code}}),ss=ye({name:"zenMode",perform:function(B,oa){return Lh("view","mode","zen"),{appState:Ni(Ni({},oa),{},{zenModeEnabled:!this.checked(oa)}),commitToHistory:!1}},checked:function(B){return B.zenModeEnabled},contextItemLabel:"buttons.zenMode",
keyTest:function(B){return!B[Af]&&B.altKey&&"KeyZ"===B.code}}),rs=ye({name:"stats",perform:function(B,oa){return{appState:Ck(Ck({},oa),{},{showStats:!this.checked(oa)}),commitToHistory:!1}},checked:function(B){return B.showStats},contextItemLabel:"stats.title",keyTest:function(B){return!B[Af]&&B.altKey&&"Slash"===B.code}}),vt=function(B,oa,va){if(!(oa.multiElement||oa.resizingElement||oa.editingElement||oa.draggingElement)){va=va();if(null===va)return{commitToHistory:!1};var ja=al(B),xa=va.elements,
Aa=al(xa);B=B.filter(function(Ca){return!Aa.hasOwnProperty(Ca.id)});xa=xa.map(function(Ca){return cf(ja[Ca.id]||Ca,Ca)}).concat(B.map(function(Ca){return cf(Ca,{isDeleted:!0})}));return Ll(xa,B),{elements:xa,appState:xh(xh({},oa),va.appState),commitToHistory:!1,syncHistory:!0}}return{commitToHistory:!1}},vv=function(){function B(oa,va,ja,xa){var Aa=this;k(this,B);this.actions={};this.renderAction=function(Ca,Ia){var Wa=Aa.app.props.UIOptions.canvasActions;if(Aa.actions[Ca]&&"PanelComponent"in Aa.actions[Ca]&&
(!(Ca in Wa)||Wa[Ca])){var $a=Aa.actions[Ca];return(0,Va.jsx)($a.PanelComponent,{elements:Aa.getElementsIncludingDeleted(),appState:Aa.getAppState(),updateData:function(rb){Aa.updater($a.perform(Aa.getElementsIncludingDeleted(),Aa.getAppState(),rb,Aa.app))},appProps:Aa.app.props,data:Ia})}return null};this.updater=function(Ca){if(!(Ca&&"then"in Ca))return oa(Ca);Ca.then(function(Ia){return oa(Ia)})};this.getAppState=va;this.getElementsIncludingDeleted=ja;this.app=xa}return z(B,[{key:"registerAction",
value:function(oa){this.actions[oa.name]=oa}},{key:"registerAll",value:function(oa){var va=this;oa.forEach(function(ja){return va.registerAction(ja)})}},{key:"handleKeyDown",value:function(oa){var va=this,ja=this.app.props.UIOptions.canvasActions,xa=Object.values(this.actions).sort(function(Aa,Ca){return(Ca.keyPriority||0)-(Aa.keyPriority||0)}).filter(function(Aa){return(!(Aa.name in ja)||ja[Aa.name])&&Aa.keyTest&&Aa.keyTest(oa,va.getAppState(),va.getElementsIncludingDeleted())});return 0!==xa.length&&
!(this.getAppState().viewModeEnabled&&!Object.values(Cc.EH).includes(xa[0].name))&&(oa.preventDefault(),this.updater(xa[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0)}},{key:"executeAction",value:function(oa){this.updater(oa.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}]),B}(),zv=function(){function B(va){var ja=this;k(this,B);this.libraryCache=null;this.resetLibrary=(0,ff.Z)(Zd().mark(function Aa(){var Ca,Ia;return Zd().wrap(function(Wa){for(;;)switch(Wa.prev=
Wa.next){case 0:return Wa.next=2,null===(Ca=(Ia=ja.app.props).onLibraryChange)||void 0===Ca?void 0:Ca.call(Ia,[]);case 2:ja.libraryCache=[];case 3:case "end":return Wa.stop()}},Aa)}));this.restoreLibraryItem=function(Aa){Aa=pe(sl(Aa,null));return Aa.length?Aa:null};this.loadLibrary=function(){return new Promise(function(){var Aa=(0,ff.Z)(Zd().mark(function Wa(Ia){var $a,rb;return Zd().wrap(function(Hb){for(;;)switch(Hb.prev=Hb.next){case 0:if(!ja.libraryCache){Hb.next=2;break}return Hb.abrupt("return",
Ia(JSON.parse(JSON.stringify(ja.libraryCache))));case 2:if(Hb.prev=2,$a=ja.app.libraryItemsFromStorage){Hb.next=6;break}return Hb.abrupt("return",Ia([]));case 6:rb=$a.reduce(function(Xb,jc){return ja.restoreLibraryItem(jc)&&Xb.push(jc),Xb},[]);ja.libraryCache=JSON.parse(JSON.stringify(rb));Ia(rb);Hb.next=15;break;case 11:Hb.prev=11,Hb.t0=Hb.catch(2),console.error(Hb.t0),Ia([]);case 15:case "end":return Hb.stop()}},Wa,null,[[2,11]])}));return function(Ia){return Aa.apply(this,arguments)}}())};this.saveLibrary=
function(){var Aa=(0,ff.Z)(Zd().mark(function Wa(Ia){var $a,rb,Hb,Xb;return Zd().wrap(function(jc){for(;;)switch(jc.prev=jc.next){case 0:return $a=ja.libraryCache,jc.prev=1,Xb=JSON.stringify(Ia),ja.libraryCache=JSON.parse(Xb),jc.next=6,null===(rb=(Hb=ja.app.props).onLibraryChange)||void 0===rb?void 0:rb.call(Hb,Ia);case 6:jc.next=12;break;case 8:throw jc.prev=8,jc.t0=jc.catch(1),ja.libraryCache=$a,jc.t0;case 12:case "end":return jc.stop()}},Wa,null,[[1,8]])}));return function(Ia){return Aa.apply(this,
arguments)}}();this.app=va}var oa;return z(B,[{key:"importLibrary",value:(oa=(0,ff.Z)(Zd().mark(function xa(ja){var Aa,Ca,Ia,Wa,$a=this;return Zd().wrap(function(rb){for(;;)switch(rb.prev=rb.next){case 0:return rb.next=2,jo(ja);case 2:if((Aa=rb.sent)&&Aa.library){rb.next=5;break}return rb.abrupt("return");case 5:return Ca=function(Hb,Xb){return!Hb.find(function(jc){return jc.length===Xb.length&&jc.every(function(nc,Tc){return nc.id===Xb[Tc].id&&nc.versionNonce===Xb[Tc].versionNonce})})},rb.next=8,
this.loadLibrary();case 8:return Ia=rb.sent,Wa=Aa.library.reduce(function(Hb,Xb){Xb=$a.restoreLibraryItem(Xb);return Xb&&Ca(Ia,Xb)&&Hb.push(Xb),Hb},[]),rb.next=12,this.saveLibrary([].concat(O(Ia),O(Wa)));case 12:case "end":return rb.stop()}},xa,this)})),function(ja){return oa.apply(this,arguments)})}]),B}(),yt=function(B){B=Array.from(B.values());return{x:Ft(B,function(oa){return oa.x})/B.length,y:Ft(B,function(oa){return oa.y})/B.length}},zt=function(B){var oa=ca(B,2);B=oa[0];oa=oa[1];return Math.hypot(B.x-
oa.x,B.y-oa.y)},Ft=function(B,oa){return B.reduce(function(va,ja){return va+oa(ja)},0)},wv=function(){function B(){var oa=this;k(this,B);this.elementCache=new Map;this.recording=!0;this.stateHistory=[];this.redoStack=[];this.lastEntry=null;this.generateEntry=function(va,ja){return oa.dehydrateHistoryEntry({appState:{selectedElementIds:va.selectedElementIds,selectedGroupIds:va.selectedGroupIds,viewBackgroundColor:va.viewBackgroundColor,editingLinearElement:va.editingLinearElement,editingGroupId:va.editingGroupId,
name:va.name},elements:ja.reduce(function(xa,Aa){if(Dg(Aa)&&va.multiElement&&va.multiElement.id===Aa.id){if(va.multiElement&&va.multiElement.id===Aa.id&&2>Aa.points.length)return xa;xa.push(Ol(Ol({},Aa),{},{points:Aa.lastCommittedPoint!==Aa.points[Aa.points.length-1]?Aa.points.slice(0,-1):Aa.points}))}else xa.push(Aa);return xa},[])})}}return z(B,[{key:"hydrateHistoryEntry",value:function(oa){var va=this,ja=oa.elements;return{appState:JSON.parse(oa.appState),elements:ja.map(function(xa){var Aa,Ca=
null===(Aa=va.elementCache.get(xa.id))||void 0===Aa?void 0:Aa.get(xa.versionNonce);if(!Ca)throw Error("Element not found: ".concat(xa.id,":").concat(xa.versionNonce));return Ca})}}},{key:"dehydrateHistoryEntry",value:function(oa){var va=this,ja=oa.elements;return{appState:JSON.stringify(oa.appState),elements:ja.map(function(xa){va.elementCache.has(xa.id)||va.elementCache.set(xa.id,new Map);var Aa=va.elementCache.get(xa.id);return Aa.has(xa.versionNonce)||Aa.set(xa.versionNonce,Wf(xa)),{id:xa.id,versionNonce:xa.versionNonce}})}}},
{key:"getSnapshotForTest",value:function(){var oa=this;return{recording:this.recording,stateHistory:this.stateHistory.map(function(va){return oa.hydrateHistoryEntry(va)}),redoStack:this.redoStack.map(function(va){return oa.hydrateHistoryEntry(va)})}}},{key:"clear",value:function(){this.stateHistory.length=0;this.redoStack.length=0;this.lastEntry=null;this.elementCache.clear()}},{key:"shouldCreateEntry",value:function(oa){var va,ja=this.lastEntry;if(!ja||oa.elements.length!==ja.elements.length)return!0;
for(var xa=oa.elements.length-1;-1<xa;xa--){var Aa=oa.elements[xa],Ca=ja.elements[xa];if(!Aa||!Ca||Aa.id!==Ca.id||Aa.versionNonce!==Ca.versionNonce)return!0}for(va in oa.appState){var Ia,Wa;if(("editingLinearElement"!==va||(null===(Ia=oa.appState[va])||void 0===Ia?void 0:Ia.elementId)!==(null===(Wa=ja.appState[va])||void 0===Wa?void 0:Wa.elementId))&&"selectedElementIds"!==va&&"selectedGroupIds"!==va&&oa.appState[va]!==ja.appState[va])return!0}return!1}},{key:"pushEntry",value:function(oa,va){oa=
this.generateEntry(oa,va);(va=this.hydrateHistoryEntry(oa))&&this.shouldCreateEntry(va)&&(this.stateHistory.push(oa),this.lastEntry=va,this.clearRedoStack())}},{key:"clearRedoStack",value:function(){this.redoStack.splice(0,this.redoStack.length)}},{key:"redoOnce",value:function(){if(0===this.redoStack.length)return null;var oa=this.redoStack.pop();return void 0!==oa?(this.stateHistory.push(oa),this.hydrateHistoryEntry(oa)):null}},{key:"undoOnce",value:function(){if(1===this.stateHistory.length)return null;
var oa=this.stateHistory.pop(),va=this.stateHistory[this.stateHistory.length-1];return void 0!==oa?(this.redoStack.push(oa),this.hydrateHistoryEntry(va)):null}},{key:"setCurrentState",value:function(oa,va){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(oa,va))}},{key:"resumeRecording",value:function(){this.recording=!0}},{key:"record",value:function(oa,va){this.recording&&(this.pushEntry(oa,va),this.recording=!1)}}]),B}(),xt=[{icon:(0,Va.jsx)("svg",{viewBox:"0 0 320 512",className:"",
children:(0,Va.jsx)("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})}),value:"selection",key:"v"},{icon:(0,Va.jsx)("svg",{viewBox:"0 0 448 512",children:(0,Va.jsx)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})}),
value:"rectangle",key:"r"},{icon:(0,Va.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,Va.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:"d"},{icon:(0,Va.jsx)("svg",{viewBox:"0 0 512 512",children:(0,Va.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:"e"},{icon:(0,Va.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,Va.jsx)("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})}),
value:"arrow",key:"a"},{icon:(0,Va.jsx)("svg",{viewBox:"0 0 6 6",children:(0,Va.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:["p","l"]},{icon:(0,Va.jsx)("svg",{viewBox:"0 0 512 512",children:(0,Va.jsx)("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})}),
value:"freedraw",key:"x"},{icon:(0,Va.jsx)("svg",{viewBox:"0 0 448 512",children:(0,Va.jsx)("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})}),value:"text",key:"t"}],xv=(e(1292),{cut:[Vd("CtrlOrCmd+X")],copy:[Vd("CtrlOrCmd+C")],
paste:[Vd("CtrlOrCmd+V")],copyStyles:[Vd("CtrlOrCmd+Alt+C")],pasteStyles:[Vd("CtrlOrCmd+Alt+V")],selectAll:[Vd("CtrlOrCmd+A")],deleteSelectedElements:[Vd("Del")],duplicateSelection:[Vd("CtrlOrCmd+D"),Vd("Alt+".concat($b("helpDialog.drag")))],sendBackward:[Vd("CtrlOrCmd+[")],bringForward:[Vd("CtrlOrCmd+]")],sendToBack:[Vd(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Vd(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Vd("Shift+Alt+C")],copyAsSvg:[],group:[Vd("CtrlOrCmd+G")],ungroup:[Vd("CtrlOrCmd+Shift+G")],
gridMode:[Vd("CtrlOrCmd+'")],zenMode:[Vd("Alt+Z")],stats:[Vd("Alt+/")],addToLibrary:[],flipHorizontal:[Vd("Shift+H")],flipVertical:[Vd("Shift+V")],viewMode:[Vd("Alt+R")]}),yv=function(B){var oa=B.onCloseRequest,va=B.actionManager,ja=B.appState;return(0,Va.jsx)(Ga,{onCloseRequest:oa,top:B.top,left:B.left,fitInViewport:!0,children:(0,Va.jsx)("ul",{className:"context-menu",onContextMenu:function(xa){return xa.preventDefault()},children:B.options.map(function(xa,Aa){var Ca;if("separator"===xa)return(0,Va.jsx)("hr",
{className:"context-menu-option-separator"},Aa);var Ia,Wa=xa.name,$a=xa.contextItemLabel?$b(xa.contextItemLabel):"";return(0,Va.jsx)("li",{"data-testid":Wa,onClick:oa,children:(0,Va.jsxs)("button",{className:oc("context-menu-option",{dangerous:"deleteSelectedElements"===Wa,checkmark:null===(Ca=xa.checked)||void 0===Ca?void 0:Ca.call(xa,ja)}),onClick:function(){return va.executeAction(xa)},children:[(0,Va.jsx)("div",{className:"context-menu-option__label",children:$a}),(0,Va.jsx)("kbd",{className:"context-menu-option__shortcut",
children:Wa?(Ia=xv[Wa],Ia&&0<Ia.length?Ia[0]:""):""})]})},Aa)})})})},rr=new WeakMap,sr=function(B){var oa,va,ja=[];B.options.forEach(function(xa){xa&&ja.push(xa)});ja.length&&(0,rh.render)((0,Va.jsx)(yv,{top:B.top,left:B.left,options:ja,onCloseRequest:function(){return xa=B.container,void((Aa=rr.get(xa))&&((0,rh.unmountComponentAtNode)(Aa),Aa.remove(),rr.delete(xa)));var xa,Aa},actionManager:B.actionManager,appState:B.appState}),(oa=B.container,(va=rr.get(oa))||(va=document.createElement("div"),oa.querySelector(".excalidraw-contextMenuContainer").appendChild(va),
rr.set(oa,va),va)))},Gt=function(B){var oa=B.appState,va=B.renderAction,ja=B.elementType;B=Kh(pe(B.elements),oa);oa=!!oa.editingElement;var xa=om(),Aa="rtl"===document.documentElement.getAttribute("dir"),Ca=Pk(ja)||B.some(function(Wa){return Pk(Wa.type)&&!Ri(Wa.backgroundColor)}),Ia=Pk(ja)||B.some(function(Wa){return Pk(Wa.type)});return(0,Va.jsxs)("div",{className:"panelColumn",children:[va("changeStrokeColor"),Ia&&va("changeBackgroundColor"),Ca&&va("changeFillStyle"),(Vk(ja)||B.some(function(Wa){return Vk(Wa.type)}))&&
va("changeStrokeWidth"),("freedraw"===ja||B.some(function(Wa){return"freedraw"===Wa.type}))&&va("changeStrokeShape"),(q(ja)||B.some(function(Wa){return q(Wa.type)}))&&(0,Va.jsxs)(Va.Fragment,{children:[va("changeStrokeStyle"),va("changeSloppiness")]}),(I(ja)||B.some(function(Wa){return I(Wa.type)}))&&(0,Va.jsx)(Va.Fragment,{children:va("changeSharpness")}),("text"===ja||B.some(function(Wa){return"text"===Wa.type}))&&(0,Va.jsxs)(Va.Fragment,{children:[va("changeFontSize"),va("changeFontFamily"),va("changeTextAlign")]}),
("arrow"===ja||B.some(function(Wa){return"arrow"===Wa.type}))&&(0,Va.jsx)(Va.Fragment,{children:va("changeArrowhead")}),va("changeOpacity"),(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.layers")}),(0,Va.jsxs)("div",{className:"buttonList",children:[va("sendToBack"),va("sendBackward"),va("bringToFront"),va("bringForward")]})]}),1<B.length&&(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.align")}),(0,Va.jsxs)("div",{className:"buttonList",children:[Aa?
(0,Va.jsxs)(Va.Fragment,{children:[va("alignRight"),va("alignHorizontallyCentered"),va("alignLeft")]}):(0,Va.jsxs)(Va.Fragment,{children:[va("alignLeft"),va("alignHorizontallyCentered"),va("alignRight")]}),2<B.length&&va("distributeHorizontally"),(0,Va.jsxs)("div",{className:"iconRow",children:[va("alignTop"),va("alignVerticallyCentered"),va("alignBottom"),2<B.length&&va("distributeVertically")]})]})]}),!xa&&!oa&&0<B.length&&(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.actions")}),
(0,Va.jsxs)("div",{className:"buttonList",children:[va("duplicateSelection"),va("deleteSelectedElements"),va("group"),va("ungroup")]})]})]})},wt=function(B){var oa=B.canvas,va=B.elementType,ja=B.setAppState;return(0,Va.jsx)(Va.Fragment,{children:xt.map(function(xa,Aa){var Ca=xa.value,Ia=xa.icon,Wa=xa.key;xa=$b("toolBar.".concat(Ca));Wa="".concat(Nh("string"==typeof Wa?Wa:Wa[0])," ").concat($b("helpDialog.or")," ").concat(Aa+1);return(0,Va.jsx)(Ha,{className:"Shape",type:"radio",icon:Ia,checked:va===
Ca,name:"editor-current-shape",title:"".concat(Nh(xa)," — ").concat(Wa),keyBindingLabel:"".concat(Aa+1),"aria-label":Nh(xa),"aria-keyshortcuts":Wa,"data-testid":Ca,onChange:function(){ja({elementType:Ca,multiElement:null,selectedElementIds:{}});si(oa,Ca);ja({})}},Ca)})})},uv=function(B){var oa=B.renderAction;B.zoom;return(0,Va.jsx)(Sc,{gap:1,children:(0,Va.jsxs)(Jc,{gap:1,align:"center",children:[oa("zoomOut"),oa("zoomIn"),oa("resetZoom")]})})},ut=function(B){B.appState;B.setAppState;var oa=B.actionManager;
B=B.showThemeBtn;return(0,Va.jsxs)("div",{style:{display:"flex"},children:[oa.renderAction("changeViewBackgroundColor"),B&&oa.renderAction("toggleTheme")]})},Et=(e(778),function(B){var oa=B.collaboratorCount,va=B.onClick;return(0,Va.jsx)(Va.Fragment,{children:(0,Va.jsx)(Ha,{className:oc("CollabButton",{"is-collaborating":B.isCollaborating}),onClick:va,icon:ym,type:"button",title:$b("labels.liveCollaboration"),"aria-label":$b("labels.liveCollaboration"),showAriaLabel:om(),children:0<oa&&(0,Va.jsx)("div",
{className:"CollabButton-collaborators",children:oa})})})});e(196);e(1106);var qn=de().forwardRef(function(B,oa){var va=B.children,ja=B.padding,xa=B.style;return(0,Va.jsx)("div",{className:oc("Island",B.className),style:sg({"--padding":ja},xa),ref:oa,children:va})}),tv=(e(8328),function(B){var oa=B.theme;return(oa=rv(void 0===oa?"light":oa))?(0,rh.createPortal)((0,Va.jsxs)("div",{className:oc("Modal",B.className),role:"dialog","aria-modal":"true",onKeyDown:function(va){"Escape"===va.key&&(va.nativeEvent.stopImmediatePropagation(),
va.stopPropagation(),B.onCloseRequest())},"aria-labelledby":B.labelledBy,children:[(0,Va.jsx)("div",{className:"Modal__background",onClick:B.onCloseRequest}),(0,Va.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(B.maxWidth,"px")},tabIndex:0,children:B.children})]}),oa):null}),rv=function(B){var oa=ca((0,ve.useState)(null),2),va=oa[0],ja=oa[1],xa=om(),Aa=(0,ve.useRef)(xa);Aa.current=xa;var Ca=Ip().container;return(0,ve.useLayoutEffect)(function(){va&&va.classList.toggle("excalidraw--mobile",
xa)},[va,xa]),(0,ve.useLayoutEffect)(function(){var Ia=!(null==Ca||!Ca.classList.contains("theme--dark"))||"dark"===B,Wa=document.createElement("div");return Wa.classList.add("excalidraw","excalidraw-modal-container"),Wa.classList.toggle("excalidraw--mobile",Aa.current),Ia&&(Wa.classList.add("theme--dark"),Wa.classList.add("theme--dark-background-none")),document.body.appendChild(Wa),ja(Wa),function(){document.body.removeChild(Wa)}},[Ca,B]),va},Eq=function(B){var oa=function(){var Ia=ca((0,ve.useState)(null),
2),Wa=Ia[1];return[Ia[0],(0,ve.useCallback)(function($a){return Wa($a)},[])]}();oa=ca(oa,2);var va=oa[0];oa=oa[1];var ja=ca((0,ve.useState)(document.activeElement),1)[0],xa=Ip().id;(0,ve.useEffect)(function(){if(va){var Ia=Aa(va);0<Ia.length&&!1!==B.autofocus&&(Ia[1]||Ia[0]).focus();var Wa=function($a){if("Tab"===$a.key){var rb=Aa(va),Hb=document.activeElement,Xb=rb.findIndex(function(jc){return jc===Hb});0===Xb&&$a.shiftKey?(rb[rb.length-1].focus(),$a.preventDefault()):Xb!==rb.length-1||$a.shiftKey||
(rb[0].focus(),$a.preventDefault())}};return va.addEventListener("keydown",Wa),function(){return va.removeEventListener("keydown",Wa)}}},[va,B.autofocus]);var Aa=function(Ia){return(Ia=Ia.querySelectorAll("button, a, input, select, textarea, div[tabindex]"))?Array.from(Ia):[]},Ca=function(){ja.focus();B.onCloseRequest()};return(0,Va.jsx)(tv,{className:oc("Dialog",B.className),labelledBy:"dialog-title",maxWidth:B.small?550:800,onCloseRequest:Ca,theme:B.theme,children:(0,Va.jsxs)(qn,{ref:oa,children:[(0,Va.jsxs)("h2",
{id:"".concat(xa,"-dialog-title"),className:"Dialog__title",children:[(0,Va.jsx)("span",{className:"Dialog__titleContent",children:B.title}),(0,Va.jsx)("button",{className:"Modal__close",onClick:Ca,"aria-label":$b("buttons.close"),children:om()?yn:Om})]}),(0,Va.jsx)("div",{className:"Dialog__content",children:B.children})]})})},qv=function(B){var oa=B.message,va=B.onClose,ja=ca((0,ve.useState)(!!oa),2);B=ja[0];var xa=ja[1],Aa=Ip().container;ja=de().useCallback(function(){xa(!1);va&&va();null==Aa||
Aa.focus()},[va,Aa]);return(0,Va.jsx)(Va.Fragment,{children:B&&(0,Va.jsx)(Eq,{small:!0,onCloseRequest:ja,title:$b("errorDialog.title"),children:(0,Va.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:oa})})})},sv=(e(2205),"filter"in document.createElement("canvas").getContext("2d")),Zu=function(){return(0,Va.jsxs)("div",{children:[(0,Va.jsx)("h3",{children:$b("canvasError.cannotShowPreview")}),(0,Va.jsx)("p",{children:(0,Va.jsx)("span",{children:$b("canvasError.canvasTooBig")})}),(0,Va.jsxs)("em",
{children:["(",$b("canvasError.canvasTooBigTip"),")"]})]})},ps=function(B,oa){(0,rh.unmountComponentAtNode)(oa);oa.innerHTML="";B instanceof HTMLCanvasElement?oa.appendChild(B):(0,rh.render)((0,Va.jsx)(Zu,{}),oa)},qs=function(B){var oa,va=B.children,ja=B.title,xa=B.onClick,Aa=B.color;B=B.shade;B=void 0===B?6:B;return(0,Va.jsx)("button",{className:"ExportDialog-imageExportButton",style:(oa={},T(oa,"--button-color",mf[Aa][B]),T(oa,"--button-color-darker",mf[Aa][B+1]),T(oa,"--button-color-darkest",mf[Aa][B+
2]),oa),title:ja,"aria-label":ja,onClick:xa,children:va})},$u=function(B){var oa=B.elements,va=B.appState,ja=B.exportPadding,xa=void 0===ja?Cc.qy:ja;ja=B.actionManager;var Aa=B.onExportToPng,Ca=B.onExportToSvg,Ia=B.onExportToClipboard,Wa=vh(oa,va);B=ca((0,ve.useState)(Wa),2);var $a=B[0],rb=B[1],Hb=(0,ve.useRef)(null),Xb=va.exportBackground,jc=va.viewBackgroundColor,nc=$a?Sf(oa,va):oa;return(0,ve.useEffect)(function(){rb(Wa)},[Wa]),(0,ve.useEffect)(function(){var Tc=Hb.current;if(Tc)try{var Xc=Aq(nc,
va,{exportBackground:Xb,viewBackgroundColor:jc,exportPadding:xa});Dp(Xc).then(function(){ps(Xc,Tc)}).catch(function(Pc){console.error(Pc);ps(new mn,Tc)})}catch(Pc){console.error(Pc),ps(new mn,Tc)}},[va,nc,Xb,xa,jc]),(0,Va.jsxs)("div",{className:"ExportDialog",children:[(0,Va.jsx)("div",{className:"ExportDialog__preview",ref:Hb}),sv&&ja.renderAction("exportWithDarkMode"),(0,Va.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,Va.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",
overflow:"hidden"},children:[ja.renderAction("changeExportBackground"),Wa&&(0,Va.jsx)(Wc,{checked:$a,onChange:function(Tc){return rb(Tc)},children:$b("labels.onlySelected")}),ja.renderAction("changeExportEmbedScene")]})}),(0,Va.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,Va.jsx)(Jc,{gap:2,children:ja.renderAction("changeExportScale")}),(0,Va.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,Va.jsx)("div",{style:{display:"flex",
alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!nm&&ja.renderAction("changeProjectName")}),(0,Va.jsxs)(Jc,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,Va.jsx)(qs,{color:"indigo",title:$b("buttons.exportToPng"),"aria-label":$b("buttons.exportToPng"),onClick:function(){return Aa(nc)},children:"PNG"}),(0,Va.jsx)(qs,{color:"red",title:$b("buttons.exportToSvg"),"aria-label":$b("buttons.exportToSvg"),onClick:function(){return Ca(nc)},children:"SVG"}),Qb&&(0,Va.jsx)(qs,
{title:$b("buttons.copyPngToClipboard"),onClick:function(){return Ia(nc)},color:"gray",shade:7,children:nd})]})]})},av=function(B){var oa=B.elements,va=B.appState,ja=B.exportPadding;ja=void 0===ja?Cc.qy:ja;var xa=B.actionManager,Aa=B.onExportToPng,Ca=B.onExportToSvg;B=B.onExportToClipboard;var Ia=ca((0,ve.useState)(!1),2),Wa=Ia[0],$a=Ia[1];Ia=de().useCallback(function(){$a(!1)},[]);return(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)(Ha,{onClick:function(){$a(!0)},"data-testid":"image-export-button",
icon:Le,type:"button","aria-label":$b("buttons.exportImage"),showAriaLabel:om(),title:$b("buttons.exportImage")}),Wa&&(0,Va.jsx)(Eq,{onCloseRequest:Ia,title:$b("buttons.exportImage"),children:(0,Va.jsx)($u,{elements:oa,appState:va,exportPadding:ja,actionManager:xa,onExportToPng:Aa,onExportToSvg:Ca,onExportToClipboard:B,onCloseRequest:Ia})})]})},ot=(e(1310),function(B){var oa=B.children,va=B.className;return(0,Va.jsx)("div",{className:oc("FixedSideContainer","FixedSideContainer_side_".concat(B.side),
va),children:oa})}),pt=(e(7096),function(B){return(B=function(oa){var va=oa.appState,ja=oa.elements,xa=va.elementType;oa=va.isResizing;var Aa=va.isRotating,Ca=va.lastPointerDownWith,Ia=null!==va.multiElement;if("arrow"===xa||"line"===xa)return $b(Ia?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===xa)return $b("hints.freeDraw");if("text"===xa)return $b("hints.text");ja=Sf(ja,va);return oa&&"mouse"===Ca&&1===ja.length?(va=ja[0],Dg(va)&&2===va.points.length?$b("hints.lockAngle"):$b("hints.resize")):
Aa&&"mouse"===Ca?$b("hints.rotate"):1===ja.length&&Dg(ja[0])?va.editingLinearElement?va.editingLinearElement.activePointIndex?$b("hints.lineEditor_pointSelected"):$b("hints.lineEditor_nothingSelected"):$b("hints.lineEditor_info"):1===ja.length&&Xg(ja[0])?$b("hints.text_selected"):va.editingElement&&Xg(va.editingElement)?$b("hints.text_editing"):null}({appState:B.appState,elements:B.elements}))?(B=Vd(B),(0,Va.jsx)("div",{className:"HintViewer",children:(0,Va.jsx)("span",{children:B})})):null});e(3336);
e(694);var bv=(0,Va.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,Va.jsx)("path",{fill:"currentColor",d:"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"})}),cv=function(B){var oa=B.elements,va=B.pendingElements,ja=B.onRemoveFromLibrary;B=B.onClick;var xa=(0,ve.useRef)(null);(0,ve.useEffect)(function(){var $a=oa||va;if($a){var rb,Hb=xa.current;
return(0,ff.Z)(Zd().mark(function jc(){var nc,Tc,Xc;return Zd().wrap(function(Pc){for(;;)switch(Pc.prev=Pc.next){case 0:return Pc.next=2,Ap($a,{exportBackground:!1,viewBackgroundColor:mf.white});case 2:rb=Pc.sent,nc=yj(xa.current.children),Pc.prev=4,nc.s();case 6:if((Tc=nc.n()).done){Pc.next=13;break}if("svg"===(Xc=Tc.value).tagName){Pc.next=10;break}return Pc.abrupt("continue",11);case 10:Hb.removeChild(Xc);case 11:Pc.next=6;break;case 13:Pc.next=18;break;case 15:Pc.prev=15,Pc.t0=Pc.catch(4),nc.e(Pc.t0);
case 18:return Pc.prev=18,nc.f(),Pc.finish(18);case 21:Hb.appendChild(rb);case 22:case "end":return Pc.stop()}},jc,null,[[4,15,18,21]])}))(),function(){rb&&Hb.removeChild(rb)}}},[oa,va]);var Aa=ca((0,ve.useState)(!1),2),Ca=Aa[0],Ia=Aa[1];Aa=om();var Wa=(Ca||Aa)&&va&&(0,Va.jsx)("div",{className:"library-unit__adder",children:bv});return(0,Va.jsxs)("div",{className:oc("library-unit",{"library-unit__active":oa||va}),onMouseEnter:function(){return Ia(!0)},onMouseLeave:function(){return Ia(!1)},children:[(0,Va.jsx)("div",
{className:oc("library-unit__dragger",{"library-unit__pulse":!!va}),ref:xa,draggable:!!oa,onClick:oa||va?B:void 0,onDragStart:function($a){Ia(!1);$a.dataTransfer.setData(Cc.LO.excalidrawlib,JSON.stringify(oa))}}),Wa,oa&&(Ca||Aa)&&(0,Va.jsx)("button",{className:"library-unit__removeFromLibrary","aria-label":$b("labels.removeFromLibrary"),onClick:ja,children:Om})]})},dv=(0,Va.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,Va.jsx)("path",
{d:"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"})}),ev=(0,Va.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:(0,Va.jsx)("path",{d:"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z"})}),
qt=function(B){return(0,Va.jsxs)("label",{className:oc("ToolIcon ToolIcon__lock ToolIcon_type_floating zen-mode-visibility","ToolIcon_size_".concat("medium"),{"zen-mode-visibility--hidden":B.zenModeEnabled}),title:"".concat(B.title," — Q"),children:[(0,Va.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:B.name,onChange:B.onChange,checked:B.checked,"aria-label":B.title}),(0,Va.jsx)("div",{className:"ToolIcon__icon",children:B.checked?dv:ev})]})},fv=["heading","children"],oo=function(B){var oa=
B.heading,va=B.children;B=ab(B,fv);var ja=Ip().id,xa=(0,Va.jsx)("h2",{className:"visually-hidden",id:"".concat(ja,"-").concat(oa,"-title"),children:$b("headings.".concat(oa))});return(0,Va.jsx)("section",Wj(Wj({},B),{},{"aria-labelledby":"".concat(ja,"-").concat(oa,"-title"),children:"function"==typeof va?va(xa):(0,Va.jsxs)(Va.Fragment,{children:[xa,va]})}))},kt=(e(580),function(B){var oa=B.children;return(0,Va.jsx)("div",{className:oc("UserList",B.className,{UserList_mobile:B.mobile}),children:oa})}),
Tu=(0,Va.jsx)("svg",{viewBox:"0 0 576 512",children:(0,Va.jsx)("path",{fill:"currentColor",d:"M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"})}),
lt=function(B){var oa=B.appState,va=B.setAppState;return(0,Va.jsxs)("label",{className:oc("ToolIcon ToolIcon_type_floating ToolIcon__library zen-mode-visibility","ToolIcon_size_medium",{"zen-mode-visibility--hidden":oa.zenModeEnabled}),title:"".concat(Nh($b("toolBar.library"))," — 9"),style:{marginInlineStart:"var(--space-factor)"},children:[(0,Va.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:function(ja){va({isLibraryOpen:ja.target.checked})},checked:oa.isLibraryOpen,
"aria-label":Nh($b("toolBar.library")),"aria-keyshortcuts":"9"}),(0,Va.jsx)("div",{className:"ToolIcon__icon",children:Tu})]})},Uu=function(B){var oa=B.appState,va=B.elements,ja=B.libraryMenu,xa=B.actionManager,Aa=B.renderJSONExportDialog,Ca=B.renderImageExportDialog,Ia=B.setAppState,Wa=B.onCollabButtonClick,$a=B.onLockToggle,rb=B.canvas,Hb=B.isCollaborating,Xb=B.renderCustomFooter,jc=B.viewModeEnabled;B=B.showThemeBtn;return(0,Va.jsxs)(Va.Fragment,{children:[!jc&&(0,Va.jsxs)(ot,{side:"top",className:"App-top-bar",
children:[(0,Va.jsx)(oo,{heading:"shapes",children:function(nc){return(0,Va.jsxs)(Sc,{gap:4,align:"center",children:[(0,Va.jsxs)(Jc,{gap:1,children:[(0,Va.jsxs)(qn,{padding:1,children:[nc,(0,Va.jsx)(Jc,{gap:1,children:(0,Va.jsx)(wt,{canvas:rb,elementType:oa.elementType,setAppState:Ia})})]}),(0,Va.jsx)(qt,{checked:oa.elementLocked,onChange:$a,title:$b("toolBar.lock")}),(0,Va.jsx)(lt,{appState:oa,setAppState:Ia})]}),ja]})}}),(0,Va.jsx)(pt,{appState:oa,elements:va})]}),(0,Va.jsx)("div",{className:"App-bottom-bar",
style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,Va.jsxs)(qn,{padding:0,children:["canvas"===oa.openMenu?(0,Va.jsx)(oo,{className:"App-mobile-menu",heading:"canvasActions",children:(0,Va.jsx)("div",{className:"panelColumn",children:(0,Va.jsxs)(Sc,{gap:4,children:[jc?(0,Va.jsxs)(Va.Fragment,{children:[Aa(),Ca()]}):(0,Va.jsxs)(Va.Fragment,{children:[xa.renderAction("clearCanvas"),xa.renderAction("loadScene"),Aa(),Ca(),Wa&&(0,Va.jsx)(Et,{isCollaborating:Hb,collaboratorCount:oa.collaborators.size,
onClick:Wa}),(0,Va.jsx)(ut,{actionManager:xa,appState:oa,setAppState:Ia,showThemeBtn:B})]}),null==Xb?void 0:Xb(!0,oa),0<oa.collaborators.size&&(0,Va.jsxs)("fieldset",{children:[(0,Va.jsx)("legend",{children:$b("labels.collaborators")}),(0,Va.jsx)(kt,{mobile:!0,children:Array.from(oa.collaborators).filter(function(nc){nc=ca(nc,2);nc=(nc[0],nc[1]);return 0!==Object.keys(nc).length}).map(function(nc){nc=ca(nc,2);var Tc=nc[0];nc[1];return(0,Va.jsx)(de().Fragment,{children:xa.renderAction("goToCollaborator",
{id:Tc})},Tc)})})]})]})})}):"shape"===oa.openMenu&&!jc&&wh(oa,va)?(0,Va.jsx)(oo,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,Va.jsx)(Gt,{appState:oa,elements:va,renderAction:xa.renderAction,elementType:oa.elementType})}):null,(0,Va.jsxs)("footer",{className:"App-toolbar",children:[jc?(0,Va.jsx)("div",{className:"App-toolbar-content",children:xa.renderAction("toggleCanvasMenu")}):(0,Va.jsxs)("div",{className:"App-toolbar-content",children:[xa.renderAction("toggleCanvasMenu"),
xa.renderAction("toggleEditMenu"),xa.renderAction("undo"),xa.renderAction("redo"),xa.renderAction(oa.multiElement?"finalize":"duplicateSelection"),xa.renderAction("deleteSelectedElements")]}),oa.scrolledOutside&&!oa.openMenu&&(0,Va.jsx)("button",{className:"scroll-back-to-content",onClick:function(){Ia(function(nc){for(var Tc=1;Tc<arguments.length;Tc++){var Xc=null!=arguments[Tc]?arguments[Tc]:{};Tc%2?Yk(Object(Xc),!0).forEach(function(Pc){T(nc,Pc,Xc[Pc])}):Object.getOwnPropertyDescriptors?Object.defineProperties(nc,
Object.getOwnPropertyDescriptors(Xc)):Yk(Object(Xc)).forEach(function(Pc){Object.defineProperty(nc,Pc,Object.getOwnPropertyDescriptor(Xc,Pc))})}return nc}({},Fg(va,oa)))},children:$b("buttons.scrollBackToContent")})]})]})})]})},mt=(e(8051),function(B){var oa=(0,ve.useRef)(null),va=ca((0,ve.useState)(null),2),ja=va[0],xa=va[1];return(0,ve.useLayoutEffect)(function(){if(B.spreadsheet){var Aa,Ca=X(B.chartType,B.spreadsheet,0,0);xa(Ca);var Ia=oa.current;return(0,ff.Z)(Zd().mark(function $a(){return Zd().wrap(function(rb){for(;;)switch(rb.prev=
rb.next){case 0:return rb.next=2,Ap(Ca,{exportBackground:!1,viewBackgroundColor:mf.white});case 2:Aa=rb.sent,Ia.appendChild(Aa),B.selected&&Ia.parentNode.focus();case 5:case "end":return rb.stop()}},$a)}))(),function(){Ia.removeChild(Aa)}}},[B.spreadsheet,B.chartType,B.selected]),(0,Va.jsx)("button",{className:"ChartPreview",onClick:function(){ja&&B.onClick(B.chartType,ja)},children:(0,Va.jsx)("div",{ref:oa})})}),Vu=function(B){var oa=B.setAppState,va=B.appState,ja=B.onClose,xa=B.onInsertChart;B=
de().useCallback(function(){ja&&ja()},[ja]);var Aa=function(Ca,Ia){xa(Ia);Lh("magic","chart",Ca);oa({currentChartType:Ca,pasteDialog:{shown:!1,data:null}})};return(0,Va.jsx)(Eq,{small:!0,onCloseRequest:B,title:$b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,Va.jsxs)("div",{className:"container",children:[(0,Va.jsx)(mt,{chartType:"bar",spreadsheet:va.pasteDialog.data,selected:"bar"===va.currentChartType,onClick:Aa}),(0,Va.jsx)(mt,{chartType:"line",spreadsheet:va.pasteDialog.data,
selected:"line"===va.currentChartType,onClick:Aa})]})})};e(3922);var Wu=function(){return(0,Va.jsxs)("div",{className:"HelpDialog--header",children:[(0,Va.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:$b("helpDialog.documentation")}),(0,Va.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:$b("helpDialog.blog")}),(0,Va.jsx)("a",
{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:$b("helpDialog.github")})]})},Xu=function(B){return(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("h3",{children:B.title}),B.children]})},Yu=function(B){return(0,Va.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:B.children})},nt=function(B){return(0,Va.jsx)("div",{style:{width:"49%"},children:B.children})},
os=function(B){return(0,Va.jsxs)("div",{className:"HelpDialog--island",children:[(0,Va.jsx)("h3",{className:"HelpDialog--island-title",children:B.caption}),B.children]})},nf=function(B){return(0,Va.jsx)("div",{className:"HelpDialog--shortcut",children:(0,Va.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,Va.jsx)("div",{style:{lineHeight:1.4},children:B.label}),(0,Va.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",
minWidth:"30%"},children:B.shortcuts.map(function(oa,va){return(0,Va.jsxs)(de().Fragment,{children:[(0,Va.jsx)(gv,{children:oa}),B.isOr&&va!==B.shortcuts.length-1&&$b("helpDialog.or")]},va)})})]})})};nf.defaultProps={isOr:!0};var gv=function(B){return(0,Va.jsx)("kbd",function(oa){for(var va=1;va<arguments.length;va++){var ja=null!=arguments[va]?arguments[va]:{};va%2?Zi(Object(ja),!0).forEach(function(xa){T(oa,xa,ja[xa])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ja)):
Zi(Object(ja)).forEach(function(xa){Object.defineProperty(oa,xa,Object.getOwnPropertyDescriptor(ja,xa))})}return oa}({className:"HelpDialog--key"},B))},hv=function(B){var oa=B.onClose;B=de().useCallback(function(){oa&&oa()},[oa]);return(0,Va.jsx)(Va.Fragment,{children:(0,Va.jsxs)(Eq,{onCloseRequest:B,title:$b("helpDialog.title"),className:"HelpDialog",children:[(0,Va.jsx)(Wu,{}),(0,Va.jsx)(Xu,{title:$b("helpDialog.shortcuts"),children:(0,Va.jsxs)(Yu,{children:[(0,Va.jsxs)(nt,{children:[(0,Va.jsxs)(os,
{caption:$b("helpDialog.shapes"),children:[(0,Va.jsx)(nf,{label:$b("toolBar.selection"),shortcuts:["V","1"]}),(0,Va.jsx)(nf,{label:$b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,Va.jsx)(nf,{label:$b("toolBar.diamond"),shortcuts:["D","3"]}),(0,Va.jsx)(nf,{label:$b("toolBar.ellipse"),shortcuts:["E","4"]}),(0,Va.jsx)(nf,{label:$b("toolBar.arrow"),shortcuts:["A","5"]}),(0,Va.jsx)(nf,{label:$b("toolBar.line"),shortcuts:["P","6"]}),(0,Va.jsx)(nf,{label:$b("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),
(0,Va.jsx)(nf,{label:$b("toolBar.text"),shortcuts:["T","8"]}),(0,Va.jsx)(nf,{label:$b("helpDialog.editSelectedShape"),shortcuts:[Vd("Enter"),$b("helpDialog.doubleClick")]}),(0,Va.jsx)(nf,{label:$b("helpDialog.textNewLine"),shortcuts:[Vd("Enter"),Vd("Shift+Enter")]}),(0,Va.jsx)(nf,{label:$b("helpDialog.textFinish"),shortcuts:[Vd("Esc"),Vd("CtrlOrCmd+Enter")]}),(0,Va.jsx)(nf,{label:$b("helpDialog.curvedArrow"),shortcuts:["A",$b("helpDialog.click"),$b("helpDialog.click"),$b("helpDialog.click")],isOr:!1}),
(0,Va.jsx)(nf,{label:$b("helpDialog.curvedLine"),shortcuts:["L",$b("helpDialog.click"),$b("helpDialog.click"),$b("helpDialog.click")],isOr:!1}),(0,Va.jsx)(nf,{label:$b("toolBar.lock"),shortcuts:["Q"]}),(0,Va.jsx)(nf,{label:$b("helpDialog.preventBinding"),shortcuts:[Vd("CtrlOrCmd")]})]}),(0,Va.jsxs)(os,{caption:$b("helpDialog.view"),children:[(0,Va.jsx)(nf,{label:$b("buttons.zoomIn"),shortcuts:[Vd("CtrlOrCmd++")]}),(0,Va.jsx)(nf,{label:$b("buttons.zoomOut"),shortcuts:[Vd("CtrlOrCmd+-")]}),(0,Va.jsx)(nf,
{label:$b("buttons.resetZoom"),shortcuts:[Vd("CtrlOrCmd+0")]}),(0,Va.jsx)(nf,{label:$b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,Va.jsx)(nf,{label:$b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,Va.jsx)(nf,{label:$b("buttons.fullScreen"),shortcuts:["F"]}),(0,Va.jsx)(nf,{label:$b("buttons.zenMode"),shortcuts:[Vd("Alt+Z")]}),(0,Va.jsx)(nf,{label:$b("labels.showGrid"),shortcuts:[Vd("CtrlOrCmd+'")]}),(0,Va.jsx)(nf,{label:$b("labels.viewMode"),shortcuts:[Vd("Alt+R")]}),(0,Va.jsx)(nf,
{label:$b("labels.toggleTheme"),shortcuts:[Vd("Alt+Shift+D")]}),(0,Va.jsx)(nf,{label:$b("stats.title"),shortcuts:[Vd("Alt+/")]})]})]}),(0,Va.jsx)(nt,{children:(0,Va.jsxs)(os,{caption:$b("helpDialog.editor"),children:[(0,Va.jsx)(nf,{label:$b("labels.selectAll"),shortcuts:[Vd("CtrlOrCmd+A")]}),(0,Va.jsx)(nf,{label:$b("labels.multiSelect"),shortcuts:[Vd("Shift+".concat($b("helpDialog.click")))]}),(0,Va.jsx)(nf,{label:$b("labels.moveCanvas"),shortcuts:[Vd("Space+".concat($b("helpDialog.drag"))),Vd("Wheel+".concat($b("helpDialog.drag")))],
isOr:!0}),(0,Va.jsx)(nf,{label:$b("labels.cut"),shortcuts:[Vd("CtrlOrCmd+X")]}),(0,Va.jsx)(nf,{label:$b("labels.copy"),shortcuts:[Vd("CtrlOrCmd+C")]}),(0,Va.jsx)(nf,{label:$b("labels.paste"),shortcuts:[Vd("CtrlOrCmd+V")]}),(0,Va.jsx)(nf,{label:$b("labels.copyAsPng"),shortcuts:[Vd("Shift+Alt+C")]}),(0,Va.jsx)(nf,{label:$b("labels.copyStyles"),shortcuts:[Vd("CtrlOrCmd+Alt+C")]}),(0,Va.jsx)(nf,{label:$b("labels.pasteStyles"),shortcuts:[Vd("CtrlOrCmd+Alt+V")]}),(0,Va.jsx)(nf,{label:$b("labels.delete"),
shortcuts:[Vd("Del")]}),(0,Va.jsx)(nf,{label:$b("labels.sendToBack"),shortcuts:[Vd(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,Va.jsx)(nf,{label:$b("labels.bringToFront"),shortcuts:[Vd(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,Va.jsx)(nf,{label:$b("labels.sendBackward"),shortcuts:[Vd("CtrlOrCmd+[")]}),(0,Va.jsx)(nf,{label:$b("labels.bringForward"),shortcuts:[Vd("CtrlOrCmd+]")]}),(0,Va.jsx)(nf,{label:$b("labels.alignTop"),shortcuts:[Vd("CtrlOrCmd+Shift+Up")]}),(0,Va.jsx)(nf,{label:$b("labels.alignBottom"),
shortcuts:[Vd("CtrlOrCmd+Shift+Down")]}),(0,Va.jsx)(nf,{label:$b("labels.alignLeft"),shortcuts:[Vd("CtrlOrCmd+Shift+Left")]}),(0,Va.jsx)(nf,{label:$b("labels.alignRight"),shortcuts:[Vd("CtrlOrCmd+Shift+Right")]}),(0,Va.jsx)(nf,{label:$b("labels.duplicateSelection"),shortcuts:[Vd("CtrlOrCmd+D"),Vd("Alt+".concat($b("helpDialog.drag")))]}),(0,Va.jsx)(nf,{label:$b("buttons.undo"),shortcuts:[Vd("CtrlOrCmd+Z")]}),(0,Va.jsx)(nf,{label:$b("buttons.redo"),shortcuts:nj?[Vd("CtrlOrCmd+Y"),Vd("CtrlOrCmd+Shift+Z")]:
[Vd("CtrlOrCmd+Shift+Z")]}),(0,Va.jsx)(nf,{label:$b("labels.group"),shortcuts:[Vd("CtrlOrCmd+G")]}),(0,Va.jsx)(nf,{label:$b("labels.ungroup"),shortcuts:[Vd("CtrlOrCmd+Shift+G")]}),(0,Va.jsx)(nf,{label:$b("labels.flipHorizontal"),shortcuts:[Vd("Shift+H")]}),(0,Va.jsx)(nf,{label:$b("labels.flipVertical"),shortcuts:[Vd("Shift+V")]}),(0,Va.jsx)(nf,{label:$b("labels.showStroke"),shortcuts:[Vd("S")]}),(0,Va.jsx)(nf,{label:$b("labels.showBackground"),shortcuts:[Vd("G")]})]})})]})})]})})},rt=(e(5080),function(B){var oa,
va=B.children;B=B.color;return(0,Va.jsx)("div",{className:"Card",style:(oa={},T(oa,"--card-color",mf[B][7]),T(oa,"--card-color-darker",mf[B][8]),T(oa,"--card-color-darkest",mf[B][9]),oa),children:va})}),iv=function(B){var oa=B.elements,va=B.appState,ja=B.actionManager,xa=B.exportOpts,Aa=B.canvas,Ca=xa.onExportToBackend;return(0,Va.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,Va.jsxs)("div",{className:"ExportDialog-cards",children:[xa.saveFileToDisk&&(0,Va.jsxs)(rt,{color:"lime",
children:[(0,Va.jsx)("div",{className:"Card-icon",children:Hf}),(0,Va.jsx)("h2",{children:$b("exportDialog.disk_title")}),(0,Va.jsxs)("div",{className:"Card-details",children:[$b("exportDialog.disk_details"),!nm&&ja.renderAction("changeProjectName")]}),(0,Va.jsx)(Ha,{className:"Card-button",type:"button",title:$b("exportDialog.disk_button"),"aria-label":$b("exportDialog.disk_button"),showAriaLabel:!0,onClick:function(){ja.executeAction(Rf)}})]}),Ca&&(0,Va.jsxs)(rt,{color:"pink",children:[(0,Va.jsx)("div",
{className:"Card-icon",children:Ob}),(0,Va.jsx)("h2",{children:$b("exportDialog.link_title")}),(0,Va.jsx)("div",{className:"Card-details",children:$b("exportDialog.link_details")}),(0,Va.jsx)(Ha,{className:"Card-button",type:"button",title:$b("exportDialog.link_button"),"aria-label":$b("exportDialog.link_button"),showAriaLabel:!0,onClick:function(){return Ca(oa,va,Aa)}})]}),xa.renderCustomUI&&xa.renderCustomUI(oa,va,Aa)]})})},jv=function(B){var oa=B.elements,va=B.appState,ja=B.actionManager,xa=B.exportOpts;
B=B.canvas;var Aa=ca((0,ve.useState)(!1),2),Ca=Aa[0],Ia=Aa[1];Aa=de().useCallback(function(){Ia(!1)},[]);return(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)(Ha,{onClick:function(){Ia(!0)},"data-testid":"json-export-button",icon:Dh,type:"button","aria-label":$b("buttons.export"),showAriaLabel:om(),title:$b("buttons.export")}),Ca&&(0,Va.jsx)(Eq,{onCloseRequest:Aa,title:$b("buttons.export"),children:(0,Va.jsx)(iv,{elements:oa,appState:va,actionManager:ja,onCloseRequest:Aa,exportOpts:xa,canvas:B})})]})},
kv=["suggestedBindings","startBoundElement"],lv=function(B){var oa=B.libraryItems,va=B.onRemoveFromLibrary,ja=B.onAddToLibrary,xa=B.onInsertShape,Aa=B.pendingElements,Ca=B.theme,Ia=B.setAppState,Wa=B.setLibraryItems,$a=B.libraryReturnUrl,rb=B.focusContainer,Hb=B.library,Xb=B.id;B=om()?4:6;var jc=Math.max(1,Math.ceil((oa.length+(0<Aa.length?1:0))/B)),nc=[],Tc=!1;$a=$a||window.location.origin+window.location.pathname;nc.push((0,Va.jsxs)("div",{className:"layer-ui__library-header",children:[(0,Va.jsx)(Ha,
{type:"button",title:$b("buttons.load"),"aria-label":$b("buttons.load"),icon:rc,onClick:function(){Ep(Hb).then(function(){Ia({isLibraryOpen:!1});Ia({isLibraryOpen:!0})}).catch(kk).catch(function(Zc){Ia({errorMessage:Zc.message})})}},"import"),!!oa.length&&(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)(Ha,{type:"button",title:$b("buttons.export"),"aria-label":$b("buttons.export"),icon:Dh,onClick:function(){Xo(Hb).catch(kk).catch(function(Zc){Ia({errorMessage:Zc.message})})}},"export"),(0,Va.jsx)(Ha,
{type:"button",title:$b("buttons.resetLibrary"),"aria-label":$b("buttons.resetLibrary"),icon:ce,onClick:function(){window.confirm($b("alerts.resetLibrary"))&&(Hb.resetLibrary(),Wa([]),rb())}},"reset")]}),(0,Va.jsx)("a",{href:"https://libraries.excalidraw.com?target\x3d".concat(window.name||"_blank","\x26referrer\x3d").concat($a,"\x26useHash\x3dtrue\x26token\x3d").concat(Xb,"\x26theme\x3d").concat(Ca),target:"_excalidraw_libraries",children:$b("labels.libraries")})]},"library-header"));for(Ca=0;Ca<
jc;Ca++){$a=B*Ca;Xb=[];for(var Xc=0;Xc<B;Xc++){var Pc=0<Aa.length&&!Tc&&$a+Xc>=oa.length;Tc=Tc||Pc;Xb.push((0,Va.jsx)(Sc,{children:(0,Va.jsx)(cv,{elements:oa[$a+Xc],pendingElements:Pc?Aa:void 0,onRemoveFromLibrary:va.bind(null,$a+Xc),onClick:Pc?ja.bind(null,Aa):xa.bind(null,oa[$a+Xc])})},Xc))}nc.push((0,Va.jsx)(Jc,{align:"center",gap:1,children:Xb},Ca))}return(0,Va.jsx)(Sc,{align:"start",gap:1,className:"layer-ui__library-items",children:nc})},mv=function(B){var oa=B.onClickOutside,va=B.onInsertShape,
ja=B.pendingElements,xa=B.onAddToLibrary,Aa=B.theme,Ca=B.setAppState,Ia=B.libraryReturnUrl,Wa=B.focusContainer,$a=B.library;B=B.id;var rb=(0,ve.useRef)(null);!function(Zc,Dd){(0,ve.useEffect)(function(){var Yd=function(md){Zc.current&&(md.target instanceof Element&&(Zc.current.contains(md.target)||!document.body.contains(md.target))||Dd(md))};return document.addEventListener("pointerdown",Yd,!1),function(){document.removeEventListener("pointerdown",Yd)}},[Zc,Dd])}(rb,function(Zc){Zc.target.closest(".ToolIcon_type_button__library")||
oa(Zc)});var Hb=ca((0,ve.useState)([]),2),Xb=Hb[0],jc=Hb[1],nc=ca((0,ve.useState)("preloading"),2);Hb=nc[0];var Tc=nc[1],Xc=(0,ve.useRef)(null);(0,ve.useEffect)(function(){return Promise.race([new Promise(function(Zc){Xc.current=setTimeout(function(){Zc("loading")},100)}),$a.loadLibrary().then(function(Zc){jc(Zc);Tc("ready")})]).then(function(Zc){"loading"===Zc&&Tc("loading")}),function(){clearTimeout(Xc.current)}},[$a]);nc=(0,ve.useCallback)(function(){var Zc=(0,ff.Z)(Zd().mark(function md(Yd){var sd,
Hd;return Zd().wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return He.next=2,$a.loadLibrary();case 2:sd=He.sent,Hd=sd.filter(function(Sg,ni){return ni!==Yd}),$a.saveLibrary(Hd).catch(function(Sg){jc(sd);Ca({errorMessage:$b("alerts.errorRemovingFromLibrary")})}),jc(Hd);case 6:case "end":return He.stop()}},md)}));return function(Yd){return Zc.apply(this,arguments)}}(),[$a,Ca]);var Pc=(0,ve.useCallback)(function(){var Zc=(0,ff.Z)(Zd().mark(function md(Yd){var sd,Hd;return Zd().wrap(function(He){for(;;)switch(He.prev=
He.next){case 0:return He.next=2,$a.loadLibrary();case 2:sd=He.sent,Hd=[].concat(O(sd),[Yd]),xa(),$a.saveLibrary(Hd).catch(function(Sg){jc(sd);Ca({errorMessage:$b("alerts.errorAddingToLibrary")})}),jc(Hd);case 7:case "end":return He.stop()}},md)}));return function(Yd){return Zc.apply(this,arguments)}}(),[xa,$a,Ca]);return"preloading"===Hb?null:(0,Va.jsx)(qn,{padding:1,ref:rb,className:"layer-ui__library",children:"loading"===Hb?(0,Va.jsx)("div",{className:"layer-ui__library-message",children:$b("labels.libraryLoadingMessage")}):
(0,Va.jsx)(lv,{libraryItems:Xb,onRemoveFromLibrary:nc,onAddToLibrary:Pc,onInsertShape:va,pendingElements:ja,setAppState:Ca,setLibraryItems:jc,libraryReturnUrl:Ia,focusContainer:Wa,library:$a,theme:Aa,id:B})})},nv=de().memo(function(B){var oa,va=B.actionManager,ja=B.appState,xa=B.setAppState,Aa=B.canvas,Ca=B.elements,Ia=B.onCollabButtonClick,Wa=B.onLockToggle,$a=B.onInsertElements,rb=B.zenModeEnabled,Hb=B.showExitZenModeBtn,Xb=B.showThemeBtn,jc=B.toggleZenMode,nc=B.isCollaborating,Tc=B.renderTopRightUI,
Xc=B.renderCustomFooter,Pc=B.viewModeEnabled,Zc=B.libraryReturnUrl,Dd=B.UIOptions,Yd=B.focusContainer,md=B.library,sd=B.id;B=om();var Hd=function(){return Dd.canvasActions.export?(0,Va.jsx)(jv,{elements:Ca,appState:ja,actionManager:va,exportOpts:Dd.canvasActions.export,canvas:Aa}):null},He=function(){if(!Dd.canvasActions.saveAsImage)return null;var Ae=function(ah){return function(){var Wi=(0,ff.Z)(Zd().mark(function Fl(El){var Mf;return Zd().wrap(function(wg){for(;;)switch(wg.prev=wg.next){case 0:return wg.next=
2,uf(ah,El,ja,{exportBackground:ja.exportBackground,name:ja.name,viewBackgroundColor:ja.viewBackgroundColor}).catch(kk).catch(function(Gl){console.error(Gl);xa({errorMessage:Gl.message})});case 2:Mf=wg.sent,ja.exportEmbedScene&&Mf&&Yo(Mf)&&xa({fileHandle:Mf});case 4:case "end":return wg.stop()}},Fl)}));return function(El){return Wi.apply(this,arguments)}}()};return(0,Va.jsx)(av,{elements:Ca,appState:ja,actionManager:va,onExportToPng:Ae("png"),onExportToSvg:Ae("svg"),onExportToClipboard:Ae("clipboard")})},
Sg=function(){return(0,Va.jsx)("div",{style:{width:".625em"}})},ni=(0,ve.useCallback)(function(Ae){xa({isLibraryOpen:!1})},[xa]),Ai=(0,ve.useCallback)(function(){xa({selectedElementIds:{},selectedGroupIds:{}})},[xa]),pf=ja.isLibraryOpen?(0,Va.jsx)(mv,{pendingElements:Sf(Ca,ja),onClickOutside:ni,onInsertShape:$a,onAddToLibrary:Ai,setAppState:xa,libraryReturnUrl:Zc,focusContainer:Yd,library:md,theme:ja.theme,id:sd}):null;$a=(0,Va.jsxs)(Va.Fragment,{children:[ja.isLoading&&(0,Va.jsx)(Aj,{}),ja.errorMessage&&
(0,Va.jsx)(qv,{message:ja.errorMessage,onClose:function(){return xa({errorMessage:null})}}),ja.showHelpDialog&&(0,Va.jsx)(hv,{onClose:function(){xa({showHelpDialog:!1})}}),ja.pasteDialog.shown&&(0,Va.jsx)(Vu,{setAppState:xa,appState:ja,onInsertChart:$a,onClose:function(){return xa({pasteDialog:{shown:!1,data:null}})}})]});return B?(0,Va.jsxs)(Va.Fragment,{children:[$a,(0,Va.jsx)(Uu,{appState:ja,elements:Ca,actionManager:va,libraryMenu:pf,renderJSONExportDialog:Hd,renderImageExportDialog:He,setAppState:xa,
onCollabButtonClick:Ia,onLockToggle:Wa,canvas:Aa,isCollaborating:nc,renderCustomFooter:Xc,viewModeEnabled:Pc,showThemeBtn:Xb})]}):(0,Va.jsxs)("div",{className:oc("layer-ui__wrapper",{"disable-pointerEvents":ja.draggingElement||ja.resizingElement||ja.editingElement&&!Xg(ja.editingElement)}),children:[$a,(oa=wh(ja,Ca),(0,Va.jsx)(ot,{side:"top",children:(0,Va.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,Va.jsxs)(Sc,{gap:4,className:oc({"disable-pointerEvents":rb}),children:[Pc?(0,Va.jsx)(oo,
{heading:"canvasActions",className:oc("zen-mode-transition",{"transition-left":rb}),children:(0,Va.jsx)(qn,{padding:2,style:{zIndex:1},children:(0,Va.jsx)(Sc,{gap:4,children:(0,Va.jsxs)(Jc,{gap:1,justifyContent:"space-between",children:[Hd(),He()]})})})}):(0,Va.jsx)(oo,{heading:"canvasActions",className:oc("zen-mode-transition",{"transition-left":rb}),children:(0,Va.jsx)(qn,{padding:2,style:{zIndex:1},children:(0,Va.jsxs)(Sc,{gap:4,children:[(0,Va.jsxs)(Jc,{gap:1,justifyContent:"space-between",children:[va.renderAction("clearCanvas"),
(0,Va.jsx)(Sg,{}),va.renderAction("loadScene"),Hd(),He(),(0,Va.jsx)(Sg,{}),Ia&&(0,Va.jsx)(Et,{isCollaborating:nc,collaboratorCount:ja.collaborators.size,onClick:Ia})]}),(0,Va.jsx)(ut,{actionManager:va,appState:ja,setAppState:xa,showThemeBtn:Xb}),ja.fileHandle&&(0,Va.jsx)(Va.Fragment,{children:va.renderAction("saveToActiveFile")})]})})}),oa&&(0,Va.jsx)(oo,{heading:"selectedShapeActions",className:oc("zen-mode-transition",{"transition-left":rb}),children:(0,Va.jsx)(qn,{className:Cc.$C.SHAPE_ACTIONS_MENU,
padding:2,style:{maxHeight:"".concat(ja.height-(ja.fileHandle?248:200),"px")},children:(0,Va.jsx)(Gt,{appState:ja,elements:Ca,renderAction:va.renderAction,elementType:ja.elementType})})})]}),!Pc&&(0,Va.jsx)(oo,{heading:"shapes",children:function(Ae){return(0,Va.jsxs)(Sc,{gap:4,align:"start",children:[(0,Va.jsxs)(Jc,{gap:1,children:[(0,Va.jsx)(qt,{zenModeEnabled:rb,checked:ja.elementLocked,onChange:Wa,title:$b("toolBar.lock")}),(0,Va.jsxs)(qn,{padding:1,className:oc({"zen-mode":rb}),children:[(0,Va.jsx)(pt,
{appState:ja,elements:Ca}),Ae,(0,Va.jsx)(Jc,{gap:1,children:(0,Va.jsx)(wt,{canvas:Aa,elementType:ja.elementType,setAppState:xa})})]}),(0,Va.jsx)(lt,{appState:ja,setAppState:xa})]}),pf]})}}),(0,Va.jsxs)("div",{className:oc("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":rb}),children:[(0,Va.jsx)(kt,{children:0<ja.collaborators.size&&Array.from(ja.collaborators).filter(function(Ae){Ae=ca(Ae,2);Ae=(Ae[0],Ae[1]);return 0!==Object.keys(Ae).length}).map(function(Ae){Ae=ca(Ae,2);var ah=
Ae[0];return(0,Va.jsx)(wf,{label:Ae[1].username||"Unknown user",children:va.renderAction("goToCollaborator",{id:ah})},ah)})}),null==Tc?void 0:Tc(B,ja)]})]})})),(0,Va.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,Va.jsx)("div",{className:oc("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":rb}),children:(0,Va.jsx)(Sc,{gap:2,children:(0,Va.jsxs)(oo,{heading:"canvasActions",children:[(0,Va.jsx)(qn,
{padding:1,children:(0,Va.jsx)(uv,{renderAction:va.renderAction,zoom:ja.zoom})}),!Pc&&(0,Va.jsxs)("div",{className:oc("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":rb}),children:[va.renderAction("undo",{size:"small"}),va.renderAction("redo",{size:"small"})]})]})})}),(0,Va.jsx)("div",{className:oc("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":rb}),children:null==Xc?void 0:Xc(!1,ja)}),(0,Va.jsx)("div",
{className:oc("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":rb}),children:va.renderAction("toggleShortcuts")}),(0,Va.jsx)("button",{className:oc("disable-zen-mode",{"disable-zen-mode--visible":Hb}),onClick:jc,children:$b("buttons.exitZenMode")})]}),ja.scrolledOutside&&(0,Va.jsx)("button",{className:"scroll-back-to-content",onClick:function(){xa(function(Ae){for(var ah=1;ah<arguments.length;ah++){var Wi=null!=arguments[ah]?arguments[ah]:{};ah%2?Ek(Object(Wi),
!0).forEach(function(rk){T(Ae,rk,Wi[rk])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ae,Object.getOwnPropertyDescriptors(Wi)):Ek(Object(Wi)).forEach(function(rk){Object.defineProperty(Ae,rk,Object.getOwnPropertyDescriptor(Wi,rk))})}return Ae}({},Fg(Ca,ja)))},children:$b("buttons.scrollBackToContent")})]})},function(B,oa){var va=function(Aa){Aa.suggestedBindings;Aa.startBoundElement;return ab(Aa,kv)},ja=va(B.appState),xa=va(oa.appState);va=Object.keys(ja);return B.renderCustomFooter===
oa.renderCustomFooter&&B.langCode===oa.langCode&&B.elements===oa.elements&&va.every(function(Aa){return ja[Aa]===xa[Aa]})}),ov=(e(1528),function(B){var oa,va=om(),ja=Bg(B.elements),xa=Kh(B.elements,B.appState),Aa=Bg(xa);return va&&B.appState.openMenu?null:(0,Va.jsx)("div",{className:"Stats",children:(0,Va.jsxs)(qn,{padding:2,children:[(0,Va.jsx)("div",{className:"close",onClick:B.onClose,children:Om}),(0,Va.jsx)("h3",{children:$b("stats.title")}),(0,Va.jsx)("table",{children:(0,Va.jsxs)("tbody",{children:[(0,Va.jsx)("tr",
{children:(0,Va.jsx)("th",{colSpan:2,children:$b("stats.scene")})}),(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:$b("stats.elements")}),(0,Va.jsx)("td",{children:B.elements.length})]}),(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:$b("stats.width")}),(0,Va.jsx)("td",{children:Math.round(ja[2])-Math.round(ja[0])})]}),(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:$b("stats.height")}),(0,Va.jsx)("td",{children:Math.round(ja[3])-Math.round(ja[1])})]}),1===xa.length&&(0,Va.jsx)("tr",
{children:(0,Va.jsx)("th",{colSpan:2,children:$b("stats.element")})}),1<xa.length&&(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)("tr",{children:(0,Va.jsx)("th",{colSpan:2,children:$b("stats.selected")})}),(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:$b("stats.elements")}),(0,Va.jsx)("td",{children:xa.length})]})]}),0<xa.length&&(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:"x"}),(0,Va.jsx)("td",{children:Math.round(Aa[0])})]}),(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",
{children:"y"}),(0,Va.jsx)("td",{children:Math.round(Aa[1])})]}),(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:$b("stats.width")}),(0,Va.jsx)("td",{children:Math.round(Aa[2]-Aa[0])})]}),(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:$b("stats.height")}),(0,Va.jsx)("td",{children:Math.round(Aa[3]-Aa[1])})]})]}),1===xa.length&&(0,Va.jsxs)("tr",{children:[(0,Va.jsx)("td",{children:$b("stats.angle")}),(0,Va.jsx)("td",{children:"".concat(Math.round(180*xa[0].angle/Math.PI),"°")})]}),null===
(oa=B.renderCustomStats)||void 0===oa?void 0:oa.call(B,B.elements,B.appState)]})})]})})}),pv=(e(9757),function(B){var oa=B.message,va=B.clearToast,ja=(0,ve.useRef)(0),xa=(0,ve.useCallback)(function(){return ja.current=window.setTimeout(function(){return va()},Cc.Lg)},[va]);return(0,ve.useEffect)(function(){return xa(),function(){return clearTimeout(ja.current)}},[xa,oa]),(0,Va.jsx)("div",{className:"Toast",onMouseEnter:function(){return clearTimeout(null==ja?void 0:ja.current)},onMouseLeave:xa,children:(0,Va.jsx)("p",
{className:"Toast__message",children:oa})})}),st=ye({name:"viewMode",perform:function(B,oa){return Lh("view","mode","view"),{appState:ql(ql({},oa),{},{viewModeEnabled:!this.checked(oa)}),commitToHistory:!1}},checked:function(B){return B.viewModeEnabled},contextItemLabel:"labels.viewMode",keyTest:function(B){return!B[Af]&&B.altKey&&"KeyR"===B.code}}),tt=de().createContext(!1),om=function(){return(0,ve.useContext)(tt)},jt=de().createContext({container:null,id:null}),Ip=function(){return(0,ve.useContext)(jt)},
Bq=!1,ls=0,Jp=0,Kp=0,ap=!1,Cq=!1,ms=!1,ns={horizontal:null,vertical:null},no=0,Dq=!1,mo=null,zl=new Map,Gp=null,pr=null,Hp=null,ks=function(B){function oa(Aa){k(this,oa);var Ca=xa.call(this,Aa);Su.call(A(Ca));var Ia,Wa,$a,rb,Hb=Ij(),Xb=Aa.excalidrawRef,jc=Aa.viewModeEnabled;jc=void 0!==jc&&jc;var nc=Aa.zenModeEnabled;nc=void 0!==nc&&nc;var Tc=Aa.gridModeEnabled;Tc=void 0!==Tc&&Tc;var Xc=Aa.theme;Xc=void 0===Xc?Hb.theme:Xc;Aa=Aa.name;Aa=void 0===Aa?Hb.name:Aa;if(Ca.state=Wd(Wd(Wd({},Hb),{},{theme:Xc,
isLoading:!0},Ca.getCanvasOffsets()),{},{viewModeEnabled:jc,zenModeEnabled:nc,gridSize:Tc?Cc.k:null,name:Aa,width:window.innerWidth,height:window.innerHeight}),Ca.id=dk(),Xb){var Pc;Hb="current"in Xb&&(null===(Pc=Xb.current)||void 0===Pc?void 0:Pc.readyPromise)||(($a=new Promise(function(Zc,Dd){Ia=Zc;Wa=Dd})).resolve=Ia,$a.reject=Wa,$a);$a={ready:!0,readyPromise:Hb,updateScene:Ca.updateScene,resetScene:Ca.resetScene,getSceneElementsIncludingDeleted:Ca.getSceneElementsIncludingDeleted,history:{clear:Ca.resetHistory},
scrollToContent:Ca.scrollToContent,getSceneElements:Ca.getSceneElements,getAppState:function(){return Ca.state},refresh:Ca.refresh,importLibrary:Ca.importLibraryFromUrl,setToastMessage:Ca.setToastMessage,id:Ca.id};"function"==typeof Xb?Xb($a):Xb.current=$a;Hb.resolve($a)}return Ca.excalidrawContainerValue={container:Ca.excalidrawContainerRef.current,id:Ca.id},Ca.scene=new Ph,Ca.library=new zv(A(Ca)),Ca.history=new wv,Ca.actionManager=new vv(Ca.syncActionResult,function(){return Ca.state},function(){return Ca.scene.getElementsIncludingDeleted()},
A(Ca)),Ca.actionManager.registerAll(zm),Ca.actionManager.registerAction((rb=Ca.history,{name:"undo",perform:function(Zc,Dd){return vt(Zc,Dd,function(){return rb.undoOnce()})},keyTest:function(Zc){return Zc[Af]&&"z"===Zc.key.toLowerCase()&&!Zc.shiftKey},PanelComponent:function(Zc){var Dd=Zc.updateData;Zc=Zc.data;return(0,Va.jsx)(Ha,{type:"button",icon:ig,"aria-label":$b("buttons.undo"),onClick:Dd,size:(null==Zc?void 0:Zc.size)||"medium"})},commitToHistory:function(){return!1}})),Ca.actionManager.registerAction(function(Zc){return{name:"redo",
perform:function(Dd,Yd){return vt(Dd,Yd,function(){return Zc.redoOnce()})},keyTest:function(Dd){return Dd[Af]&&Dd.shiftKey&&"z"===Dd.key.toLowerCase()||nj&&Dd.ctrlKey&&!Dd.shiftKey&&"y"===Dd.key},PanelComponent:function(Dd){var Yd=Dd.updateData;Dd=Dd.data;return(0,Va.jsx)(Ha,{type:"button",icon:Xf,"aria-label":$b("buttons.redo"),onClick:Yd,size:(null==Dd?void 0:Dd.size)||"medium"})},commitToHistory:function(){return!1}}}(Ca.history)),Ca}K(oa,B);var va,ja,xa=Pe(oa);return z(oa,[{key:"renderCanvas",
value:function(){var Aa=window.devicePixelRatio,Ca=this.state,Ia=Ca.width,Wa=Ca.height,$a=Ia*Aa;Aa*=Wa;return Ca.viewModeEnabled?(0,Va.jsx)("canvas",{className:"excalidraw__canvas",style:{width:Ia,height:Wa,cursor:Cc.oc.GRAB},width:$a,height:Aa,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:$b("labels.drawingCanvas")}):
(0,Va.jsx)("canvas",{className:"excalidraw__canvas",style:{width:Ia,height:Wa},width:$a,height:Aa,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:$b("labels.drawingCanvas")})}},{key:"render",value:function(){var Aa,Ca,Ia=this,Wa=this.state,$a=Wa.zenModeEnabled;
Wa=Wa.viewModeEnabled;var rb=this.props,Hb=rb.onCollabButtonClick,Xb=rb.renderTopRightUI,jc=rb.renderFooter;rb=rb.renderCustomStats;return(0,Va.jsx)("div",{className:oc("excalidraw excalidraw-container",{"excalidraw--view-mode":Wa,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,Va.jsx)(jt.Provider,{value:this.excalidrawContainerValue,children:(0,Va.jsxs)(tt.Provider,
{value:this.isMobile,children:[(0,Va.jsx)(nv,{canvas:this.canvas,appState:this.state,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:Hb,onLockToggle:this.toggleLock,onInsertElements:function(nc){return Ia.addElementsFromPasteOrLibrary({elements:nc,position:"center"})},zenModeEnabled:$a,toggleZenMode:this.toggleZenMode,langCode:Cg.code,isCollaborating:this.props.isCollaborating||!1,renderTopRightUI:Xb,renderCustomFooter:jc,viewModeEnabled:Wa,
showExitZenModeBtn:void 0===(null===(Aa=this.props)||void 0===Aa?void 0:Aa.zenModeEnabled)&&$a,showThemeBtn:void 0===(null===(Ca=this.props)||void 0===Ca?void 0:Ca.theme)&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id}),(0,Va.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,Va.jsx)("div",{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&
(0,Va.jsx)(ov,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:rb}),null!==this.state.toastMessage&&(0,Va.jsx)(pv,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,Va.jsx)("main",{children:this.renderCanvas()})]})})})}},{key:"componentDidMount",value:(ja=(0,ff.Z)(Zd().mark(function Ca(){var Ia,Wa,$a,rb,Hb=this;return Zd().wrap(function(Xb){for(;;)switch(Xb.prev=Xb.next){case 0:this.excalidrawContainerValue.container=
this.excalidrawContainerRef.current,"production"!==Cc.Vi.TEST&&"production"!==Cc.Vi.DEVELOPMENT||(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:function(){return Hb.state}},setState:{configurable:!0,value:function(){return Hb.setState.apply(Hb,arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})),this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),
"ResizeObserver"in window&&null!==(Ia=this.excalidrawContainerRef)&&void 0!==Ia&&Ia.current?(this.resizeObserver=new ResizeObserver(function(){var jc=Hb.excalidrawContainerRef.current.getBoundingClientRect(),nc=jc.width;jc=jc.height;Hb.isMobile=nc<Cc.kV||jc<Cc.Yx&&nc<Cc.sS;Hb.updateDOMRect()}),null===(Wa=this.resizeObserver)||void 0===Wa||Wa.observe(this.excalidrawContainerRef.current)):window.matchMedia&&($a=window.matchMedia("(max-width: ".concat(Cc.kV,"px), (max-height: ").concat(Cc.Yx,"px) and (max-width: ").concat(Cc.sS,
"px)")),rb=function(){return Hb.isMobile=$a.matches},$a.addListener(rb),this.detachIsMobileMqHandler=function(){return $a.removeListener(rb)}),(new URLSearchParams(window.location.search.slice(1))).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene);case 8:case "end":return Xb.stop()}},Ca,this)})),function(){return ja.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){var Ca;null===(Ca=this.resizeObserver)||void 0===Ca||Ca.disconnect();this.unmounted=
!0;this.removeEventListeners();this.scene.destroy();clearTimeout(no);no=0}},{key:"removeEventListeners",value:function(){var Ca,Ia;document.removeEventListener(Cc.Ks.POINTER_UP,this.removePointer);document.removeEventListener(Cc.Ks.COPY,this.onCopy);document.removeEventListener(Cc.Ks.PASTE,this.pasteFromClipboard);document.removeEventListener(Cc.Ks.CUT,this.onCut);null===(Ca=this.nearestScrollableContainer)||void 0===Ca||Ca.removeEventListener(Cc.Ks.SCROLL,this.onScroll);document.removeEventListener(Cc.Ks.KEYDOWN,
this.onKeyDown,!1);document.removeEventListener(Cc.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1);document.removeEventListener(Cc.Ks.KEYUP,this.onKeyUp);window.removeEventListener(Cc.Ks.RESIZE,this.onResize,!1);window.removeEventListener(Cc.Ks.UNLOAD,this.onUnload,!1);window.removeEventListener(Cc.Ks.BLUR,this.onBlur,!1);window.removeEventListener(Cc.Ks.DRAG_OVER,this.disableEvent,!1);window.removeEventListener(Cc.Ks.DROP,this.disableEvent,!1);document.removeEventListener(Cc.Ks.GESTURE_START,
this.onGestureStart,!1);document.removeEventListener(Cc.Ks.GESTURE_CHANGE,this.onGestureChange,!1);document.removeEventListener(Cc.Ks.GESTURE_END,this.onGestureEnd,!1);null===(Ia=this.detachIsMobileMqHandler)||void 0===Ia||Ia.call(this)}},{key:"addEventListeners",value:function(){var Ca,Ia;this.removeEventListeners();document.addEventListener(Cc.Ks.POINTER_UP,this.removePointer);document.addEventListener(Cc.Ks.COPY,this.onCopy);this.props.handleKeyboardGlobally&&document.addEventListener(Cc.Ks.KEYDOWN,
this.onKeyDown,!1);document.addEventListener(Cc.Ks.KEYUP,this.onKeyUp,{passive:!0});document.addEventListener(Cc.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition);null===(Ca=document.fonts)||void 0===Ca||null===(Ia=Ca.addEventListener)||void 0===Ia||Ia.call(Ca,"loadingdone",this.onFontLoaded);document.addEventListener(Cc.Ks.GESTURE_START,this.onGestureStart,!1);document.addEventListener(Cc.Ks.GESTURE_CHANGE,this.onGestureChange,!1);document.addEventListener(Cc.Ks.GESTURE_END,this.onGestureEnd,!1);if(!this.state.viewModeEnabled){document.addEventListener(Cc.Ks.PASTE,
this.pasteFromClipboard);document.addEventListener(Cc.Ks.CUT,this.onCut);if(this.props.detectScroll){a:{for(Ca=this.excalidrawContainerRef.current.parentElement;Ca;){if(Ca===document.body){Ca=document;break a}Ia=window.getComputedStyle(Ca).overflowY;if(Ca.scrollHeight>Ca.clientHeight&&("auto"===Ia||"scroll"===Ia))break a;Ca=Ca.parentElement}Ca=document}this.nearestScrollableContainer=Ca;this.nearestScrollableContainer.addEventListener(Cc.Ks.SCROLL,this.onScroll)}window.addEventListener(Cc.Ks.RESIZE,
this.onResize,!1);window.addEventListener(Cc.Ks.UNLOAD,this.onUnload,!1);window.addEventListener(Cc.Ks.BLUR,this.onBlur,!1);window.addEventListener(Cc.Ks.DRAG_OVER,this.disableEvent,!1);window.addEventListener(Cc.Ks.DROP,this.disableEvent,!1)}}},{key:"componentDidUpdate",value:function(Ca,Ia){var Wa,$a,rb=this;Ca.langCode!==this.props.langCode&&this.updateLanguage();Ca.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled});Ia.viewModeEnabled!==
this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements());Ca.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled});Ca.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme});Ca.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?Cc.k:null});this.props.name&&Ca.name!==this.props.name&&this.setState({name:this.props.name});null===(Wa=this.excalidrawContainerRef.current)||
void 0===Wa||Wa.classList.toggle("theme--dark","dark"===this.state.theme);this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(function(){rb.actionManager.executeAction($f)});Ca=Ia.multiElement;Ia.elementType!==this.state.elementType&&null!=Ca&&this.state.isBindingEnabled&&Wg(Ca)&&ng(Ca,this.state,this.scene,Hj(fd.getPointAtIndexGlobalCoordinates(Ca,-1)));var Hb={},Xb={},jc={},nc={},Tc={};this.state.collaborators.forEach(function(Zc,
Dd){if(Zc.selectedElementIds)for(var Yd=0,md=Object.keys(Zc.selectedElementIds);Yd<md.length;Yd++){var sd=md[Yd];sd in jc||(jc[sd]=[]);jc[sd].push(Dd)}Zc.pointer&&(Zc.username&&(nc[Dd]=Zc.username),Zc.userState&&(Tc[Dd]=Zc.userState),Xb[Dd]=hk({sceneX:Zc.pointer.x,sceneY:Zc.pointer.y},rb.state),Hb[Dd]=Zc.button)});Ia=this.scene.getElements();Wa=Si(Ia.filter(function(Zc){return!rb.state.editingElement||"text"!==rb.state.editingElement.type||Zc.id!==rb.state.editingElement.id}),this.state,this.state.selectionElement,
window.devicePixelRatio,this.rc,this.canvas,{scrollX:this.state.scrollX,scrollY:this.state.scrollY,viewBackgroundColor:this.state.viewBackgroundColor,zoom:this.state.zoom,remotePointerViewportCoords:Xb,remotePointerButton:Hb,remoteSelectedElementIds:jc,remotePointerUsernames:nc,remotePointerUserStates:Tc,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom},{renderOptimizations:!0,renderScrollbars:!this.isMobile});Ca=Wa.atLeastOneVisibleElement;(Wa=Wa.scrollBars)&&(ns=Wa);var Xc,Pc;Wa="text"!==
(null===($a=this.state.editingElement)||void 0===$a?void 0:$a.type)&&!Ca&&0<Ia.length;(this.state.scrolledOutside!==Wa&&this.setState({scrolledOutside:Wa}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.state.isLoading)||null===(Xc=(Pc=this.props).onChange)||void 0===Xc||Xc.call(Pc,this.scene.getElementsIncludingDeleted(),this.state)}},{key:"addTextFromPaste",value:function(Ca){var Ia=hh({clientX:Jp,clientY:Kp},this.state);Ca=Eg({x:Ia.x,y:Ia.y,strokeColor:this.state.currentItemStrokeColor,
backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:Ca,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:Cc.hs});this.scene.replaceAllElements([].concat(O(this.scene.getElementsIncludingDeleted()),
[Ca]));this.setState({selectedElementIds:T({},Ca.id,!0)});this.history.resumeRecording()}},{key:"selectShapeTool",value:function(Ca){var Ia;ap||si(this.canvas,Ca);(Ia=document.activeElement)instanceof HTMLElement&&Ia.className.includes("ToolIcon")&&this.focusContainer();oj(Ca)||this.setState({suggestedBindings:[]});"selection"!==Ca?this.setState({elementType:Ca,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:Ca})}},{key:"handleTextWysiwyg",value:function(Ca,
Ia){var Wa=this;Ia=Ia.isExistingElement;var $a=void 0!==Ia&&Ia,rb=function(Hb){var Xb=1<arguments.length&&void 0!==arguments[1]&&arguments[1];Wa.scene.replaceAllElements(O(Wa.scene.getElementsIncludingDeleted().map(function(jc){if(jc.id===Ca.id&&Xg(jc)){var nc={text:Hb,isDeleted:null!=Xb?Xb:jc.isDeleted},Tc=Vl(Hb,jk(jc));var Xc=Tc.width;var Pc=Tc.height;Tc=Tc.baseline;var Zc=jc.textAlign;var Dd=jc.verticalAlign;if("center"===Zc&&"middle"===Dd)Zc=Vl(jc.text,jk(jc)),Dd=kl(jc,{width:Xc-Zc.width,height:Pc-
Zc.height}),Zc=jc.x-Dd.x,Dd=jc.y-Dd.y;else{var Yd=ca(Vf(jc),4);Dd=Yd[0];var md=Yd[1],sd=Yd[2];Yd=Yd[3];var Hd=ca(Re(jc,Xc,Pc),4);Dd=ca(qi({s:!0,e:"center"===Zc||"left"===Zc,w:"center"===Zc||"right"===Zc},jc.x,jc.y,jc.angle,(Dd-Hd[0])/2,(md-Hd[1])/2,(sd-Hd[2])/2,(Yd-Hd[3])/2),2);Zc=Dd[0];Dd=Dd[1]}Xc={width:Xc,height:Pc,x:Number.isFinite(Zc)?Zc:jc.x,y:Number.isFinite(Dd)?Dd:jc.y,baseline:Tc};jc=cf(jc,Rc(nc,Xc))}return jc})))};!function(Hb){var Xb=Hb.id,jc=Hb.appState,nc=Hb.onChange,Tc=Hb.onSubmit,Xc=
Hb.getViewportCoords,Pc=Hb.element,Zc=Hb.canvas,Dd=Hb.excalidrawContainer,Yd=function(){var Mf,wg=null===(Mf=Ph.getScene(Pc))||void 0===Mf?void 0:Mf.getElement(Xb);if(wg&&Xg(wg)){Mf=ca(Xc(wg.x,wg.y),2);var Gl=Mf[0],sk=Mf[1];Mf=wg.textAlign;var Sk=wg.angle;md.value=wg.text;var bm=wg.text.replace(/\r\n?/g,"\n").split("\n"),Lm=wg.height/bm.length;bm=(jc.offsetLeft+jc.width-Gl-8)/jc.zoom.value-Number(getComputedStyle(null==Dd?void 0:Dd.parentNode).marginRight.slice(0,-2));var Yp=Object,Wv=Yp.assign,Vv=
md.style,Tv=jk(wg);Lm="".concat(Lm,"px");var Uv="".concat(wg.width,"px"),Rv="".concat(wg.height,"px");Gl="".concat(Gl,"px");sk="".concat(sk,"px");var wr=wg.width;var Pq=jc.zoom;Sk=180*Sk/Math.PI;var Rt=(wr-2*jc.offsetLeft)*(Pq.value-1)/2,Qv=(wg.height-2*jc.offsetTop)*(Pq.value-1)/2;wr=(wr>bm&&1!==Pq.value&&(Rt=bm/2*(Pq.value-1)),"translate(".concat(Rt,"px, ").concat(Qv,"px) scale(").concat(Pq.value,") rotate(").concat(Sk,"deg)"));Wv.call(Yp,Vv,{font:Tv,lineHeight:Lm,width:Uv,height:Rv,left:Gl,top:sk,
transform:wr,textAlign:Mf,color:wg.strokeColor,opacity:wg.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(bm,"px")})}},md=document.createElement("textarea");md.dir="auto";md.tabIndex=0;md.dataset.type="wysiwyg";md.wrap="off";Object.assign(md.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",whiteSpace:"pre",zIndex:"var(--zIndex-wysiwyg)"});Yd();nc&&
(md.oninput=function(){nc(Ak(md.value))});md.onkeydown=function(Mf){(Mf.stopPropagation(),"Escape"===Mf.key)?(Mf.preventDefault(),pf=!0,Ae()):"Enter"===Mf.key&&Mf[Af]?(Mf.preventDefault(),Mf.isComposing||229===Mf.keyCode)||(pf=!0,Ae()):("Tab"===Mf.key||Mf[Af]&&("BracketLeft"===Mf.code||"BracketRight"===Mf.code))&&(Mf.preventDefault(),Mf.shiftKey||"BracketLeft"===Mf.code?Sg():He(),md.dispatchEvent(new Event("input")))};var sd=" ".repeat(4),Hd=new RegExp("^ {1,".concat(4,"}")),He=function(){var Mf=
md.selectionStart,wg=md.selectionEnd,Gl=ni(),sk=md.value;Gl.forEach(function(Sk){var bm=sk.slice(0,Sk);Sk=sk.slice(Sk);sk="".concat(bm).concat(sd).concat(Sk)});md.value=sk;md.selectionStart=Mf+4;md.selectionEnd=wg+4*Gl.length},Sg=function(){var Mf=md.selectionStart,wg=md.selectionEnd,Gl=ni(),sk=[],Sk=md.value;Gl.forEach(function(bm){var Lm=Sk.slice(bm,bm+4).match(Hd);if(Lm){var Yp=Sk.slice(0,bm);Lm=Sk.slice(bm+Lm[0].length);Sk="".concat(Yp).concat(Lm);sk.push(bm)}});md.value=Sk;sk.length&&(Mf>sk[sk.length-
1]?md.selectionStart=Math.max(Mf-4,sk[sk.length-1]):md.selectionStart=Mf,md.selectionEnd=Math.max(md.selectionStart,wg-4*sk.length))},ni=function(){var Mf=md.selectionStart,wg=md.selectionEnd,Gl=md.value,sk=Gl.slice(0,Mf).match(/[^\n]*$/)[0].length;return Mf-=sk,Gl.slice(Mf,wg).split("\n").reduce(function(Sk,bm,Lm,Yp){return Sk.concat(Lm?Sk[Lm-1]+Yp[Lm-1].length+1:Mf)},[]).reverse()},Ai=function(Mf){Mf.preventDefault();Mf.stopPropagation()},pf=!1,Ae=function(){El||(El=!0,md.onblur=null,md.oninput=
null,md.onkeydown=null,Fl&&Fl.disconnect(),window.removeEventListener("resize",Yd),window.removeEventListener("wheel",Ai,!0),window.removeEventListener("pointerdown",Wi),window.removeEventListener("pointerup",ah),window.removeEventListener("blur",Ae),rk(),md.remove());Tc({text:Ak(md.value),viaKeyboard:pf})},ah=function wg(){window.removeEventListener("pointerup",wg);setTimeout(function(){md.onblur=Ae;md.focus()})},Wi=function(wg){(wg.target instanceof HTMLElement||wg.target instanceof SVGElement)&&
wg.target.closest(".".concat(Cc.$C.SHAPE_ACTIONS_MENU))&&!Dj(wg.target)&&(md.onblur=null,window.addEventListener("pointerup",ah),window.addEventListener("blur",Ae))},rk=Ph.getScene(Pc).addCallback(function(){Yd();md.focus()}),El=!1;md.select();ah();var Fl=null;Zc&&"ResizeObserver"in window?(Fl=new window.ResizeObserver(function(){Yd()})).observe(Zc):window.addEventListener("resize",Yd);window.addEventListener("pointerdown",Wi);window.addEventListener("wheel",Ai,{passive:!1,capture:!0});null==Dd||
Dd.querySelector(".excalidraw-textEditorContainer").appendChild(md)}({id:Ca.id,appState:this.state,canvas:this.canvas,getViewportCoords:function(Hb,Xb){Hb=hk({sceneX:Hb,sceneY:Xb},Wa.state);return[Hb.x-Wa.state.offsetLeft,Hb.y-Wa.state.offsetTop]},onChange:ag(function(Hb){rb(Hb);!Ca.isDeleted&&Di(Ca)}),onSubmit:ag(function(Hb){var Xb=Hb.text;Hb=Hb.viaKeyboard;var jc=!Xb.trim();rb(Xb,jc);!jc&&Hb&&Wa.setState(function(nc){return{selectedElementIds:Wd(Wd({},nc.selectedElementIds),{},T({},Ca.id,!0))}});
jc&&Ll(Wa.scene.getElements(),[Ca]);jc&&!$a||Wa.history.resumeRecording();Wa.setState({draggingElement:null,editingElement:null});Wa.state.elementLocked&&si(Wa.canvas,Wa.state.elementType);Wa.focusContainer()}),element:Ca,excalidrawContainer:this.excalidrawContainerRef.current});this.deselectElements();rb(Ca.text)}},{key:"deselectElements",value:function(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}},{key:"getTextElementAtPosition",value:function(Ca,Ia){return(Ca=
this.getElementAtPosition(Ca,Ia))&&Xg(Ca)&&!Ca.isDeleted?Ca:null}},{key:"getElementAtPosition",value:function(Ca,Ia,Wa){var $a=this.getElementsAtPosition(Ca,Ia);if(1<$a.length){if(null!=Wa&&Wa.preferSelected)for(Wa=$a.length-1;-1<Wa;Wa--)if(this.state.selectedElementIds[$a[Wa].id])return $a[Wa];Wa=$a[$a.length-1];return Xi(Wa,this.state,Ca,Ia)?$a[$a.length-2]:Wa}return 1===$a.length?$a[0]:null}},{key:"getElementsAtPosition",value:function(Ca,Ia){var Wa,$a,rb=this;return Wa=this.scene.getElements(),
$a=function(Hb){var Xb=rb.state,jc=10/Xb.zoom.value,nc=[Ca,Ia];return Xb.selectedElementIds[Hb.id]?eg(Hb,nc,jc):Nk(Hb,Xb,nc)},Wa.filter(function(Hb){return!Hb.isDeleted&&$a(Hb)})}},{key:"maybeCleanupAfterMissingPointerUp",value:function(Ca){null!==mo&&mo(Ca)}},{key:"updateGestureOnPointerDown",value:function(Ca){zl.set(Ca.pointerId,{x:Ca.clientX,y:Ca.clientY});2===zl.size&&(Gp=yt(zl),Hp=this.state.zoom.value,pr=zt(Array.from(zl.values())))}},{key:"initialPointerDownState",value:function(Ca){var Ia=
hh(Ca,this.state),Wa=Sf(this.scene.getElements(),this.state),$a=ca(Bg(Wa),4),rb=$a[0],Hb=$a[1],Xb=$a[2];$a=$a[3];return{origin:Ia,withCmdOrCtrl:Ca[Af],originInGrid:Hj(Ch(Ia.x,Ia.y,this.state.gridSize)),scrollbars:Yg(ns,Ca.clientX-this.state.offsetLeft,Ca.clientY-this.state.offsetTop),lastCoords:Wd({},Ia),originalElements:this.scene.getElements().reduce(function(jc,nc){return jc.set(nc.id,Wf(nc)),jc},new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(Xb+
rb)/2,y:($a+Hb)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(Ia,Wa)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null}}}},{key:"handleDraggingScrollBar",value:function(Ca,Ia){var Wa=this;if(!Ia.scrollbars.isOverEither||this.state.multiElement)return!1;ms=!0;Ia.lastCoords.x=Ca.clientX;Ia.lastCoords.y=Ca.clientY;var $a=
ag(function(Hb){Hb.target instanceof HTMLElement&&Wa.handlePointerMoveOverScrollbars(Hb,Ia)}),rb=ag(function(){ms=!1;si(Wa.canvas,Wa.state.elementType);mo=null;Wa.setState({cursorButton:"up"});Wa.savePointer(Ca.clientX,Ca.clientY,"up");window.removeEventListener(Cc.Ks.POINTER_MOVE,$a);window.removeEventListener(Cc.Ks.POINTER_UP,rb)});return mo=rb,window.addEventListener(Cc.Ks.POINTER_MOVE,$a),window.addEventListener(Cc.Ks.POINTER_UP,rb),!0}},{key:"isASelectedElement",value:function(Ca){return null!=
Ca&&this.state.selectedElementIds[Ca.id]}},{key:"isHittingCommonBoundingBoxOfSelectedElements",value:function(Ca,Ia){if(2>Ia.length)return!1;var Wa=10/this.state.zoom.value;Ia=ca(Bg(Ia),4);var $a=Ia[1],rb=Ia[2],Hb=Ia[3];return Ca.x>Ia[0]-Wa&&Ca.x<rb+Wa&&Ca.y>$a-Wa&&Ca.y<Hb+Wa}},{key:"onKeyDownFromPointerDownHandler",value:function(Ca){var Ia=this;return ag(function(Wa){Ia.maybeHandleResize(Ca,Wa)||Ia.maybeDragNewGenericElement(Ca,Wa)})}},{key:"onKeyUpFromPointerDownHandler",value:function(Ca){var Ia=
this;return ag(function(Wa){"Alt"===Wa.key&&Wa.preventDefault();Ia.maybeHandleResize(Ca,Wa)||Ia.maybeDragNewGenericElement(Ca,Wa)})}},{key:"onPointerMoveFromPointerDownHandler",value:function(Ca){var Ia=this;return ag(function(Wa){if(null===Ca.drag.offset&&(Ca.drag.offset=Hj(function(sd,Hd,He){sd=ca(Bg(sd),2);return[Hd-sd[0],He-sd[1]]}(Sf(Ia.scene.getElements(),Ia.state),Ca.origin.x,Ca.origin.y))),Wa.target instanceof HTMLElement&&!Ia.handlePointerMoveOverScrollbars(Wa,Ca)){var $a=hh(Wa,Ia.state),
rb=ca(Ch($a.x,$a.y,Ia.state.gridSize),2),Hb=rb[0];rb=rb[1];if(Ca.drag.hasOccurred||"arrow"!==Ia.state.elementType&&"line"!==Ia.state.elementType||!(Math.hypot(Ca.origin.x-$a.x,Ca.origin.y-$a.y)<Cc.f)){if(Ca.resize.isResizing&&(Ca.lastCoords.x=$a.x,Ca.lastCoords.y=$a.y,Ia.maybeHandleResize(Ca,Wa)))return!0;if(Ia.state.editingLinearElement&&fd.handlePointDragging(Ia.state,function(sd){return Ia.setState(sd)},$a.x,$a.y,function(sd,Hd){Ia.maybeSuggestBindingForLinearElementAtCursor(sd,Hd,$a)}))return Ca.lastCoords.x=
$a.x,void(Ca.lastCoords.y=$a.y);if(Ca.hit.allHitElements.some(function(sd){return Ia.isASelectedElement(sd)})||Ca.hit.hasHitCommonBoundingBoxOfSelectedElements){Ca.drag.hasOccurred=!0;var Xb=Sf(Ia.scene.getElements(),Ia.state);if(0<Xb.length&&!Ca.withCmdOrCtrl){rb=ca(Ch($a.x-Ca.drag.offset.x,$a.y-Ca.drag.offset.y,Ia.state.gridSize),2);Hb=rb[0];rb=rb[1];var jc=[Math.abs($a.x-Ca.origin.x),Math.abs($a.y-Ca.origin.y)];if(function(sd,Hd,He,Sg,ni){var Ai=5<arguments.length&&void 0!==arguments[5]&&arguments[5],
pf=6<arguments.length&&void 0!==arguments[6]?arguments[6]:0,Ae=7<arguments.length&&void 0!==arguments[7]?arguments[7]:0,ah=ca(Bg(Hd),2),Wi=He-ah[0],rk=Sg-ah[1];Hd.forEach(function(El){if(Ai){var Fl=Ai&&pf<Ae;var Mf=Ai&&pf>Ae;var wg=sd.originalElements.get(El.id);Fl=Fl&&wg?wg.x:El.x+Wi;Mf=Mf&&wg?wg.y:El.y+rk}else Fl=El.x+Wi,Mf=El.y+rk;le(El,{x:Fl,y:Mf});Di(El,{simultaneouslyUpdated:Hd})})}(Ca,Xb,Hb,rb,Ia.scene,Wa.shiftKey,jc[0],jc[1]),Ia.maybeSuggestBindingForAll(Xb),Wa.altKey&&!Ca.hit.hasBeenDuplicated){Ca.hit.hasBeenDuplicated=
!0;var nc;jc=[];Wa=[];var Tc=new Map;Xb=new Map;var Xc=Ca.hit.element,Pc=lj(Ia.scene.getElementsIncludingDeleted());try{for(Pc.s();!(nc=Pc.n()).done;){var Zc=nc.value;if(Ia.state.selectedElementIds[Zc.id]||Zc.id===(null==Xc?void 0:Xc.id)&&Ca.hit.wasAddedToSelection){var Dd=Xj(Ia.state.editingGroupId,Tc,Zc),Yd=ca(Ch(Ca.origin.x-Ca.drag.offset.x,Ca.origin.y-Ca.drag.offset.y,Ia.state.gridSize),2);le(Dd,{x:Dd.x+(Yd[0]-Hb),y:Dd.y+(Yd[1]-rb)});jc.push(Dd);Wa.push(Zc);Xb.set(Zc.id,Dd.id)}else jc.push(Zc)}}catch(sd){Pc.e(sd)}finally{Pc.f()}nc=
[].concat(jc,Wa);Tj(nc,Wa,Xb,"duplicatesServeAsOld");Ia.scene.replaceAllElements(nc)}return}}if(nc=Ia.state.draggingElement)if("freedraw"===nc.type?(Zc=nc.points,Dd=$a.x-nc.x,Yd=$a.y-nc.y,Hb=nc.simulatePressure?nc.pressures:[].concat(O(nc.pressures),[Wa.pressure]),le(nc,{points:[].concat(O(Zc),[[Dd,Yd]]),pressures:Hb})):Dg(nc)?(Ca.drag.hasOccurred=!0,Zc=nc.points,Dd=Hb-nc.x,Yd=rb-nc.y,Wa.shiftKey&&2===Zc.length&&(Yd=mk(Ia.state.elementType,Dd,Yd),Dd=Yd.width,Yd=Yd.height),1===Zc.length?le(nc,{points:[].concat(O(Zc),
[[Dd,Yd]])}):1<Zc.length&&le(nc,{points:[].concat(O(Zc.slice(0,-1)),[[Dd,Yd]])}),Wg(nc)&&Ia.maybeSuggestBindingForLinearElementAtCursor(nc,"end",$a,Ia.state.startBoundElement)):(Ca.lastCoords.x=$a.x,Ca.lastCoords.y=$a.y,Ia.maybeDragNewGenericElement(Ca,Wa)),"selection"===Ia.state.elementType){Zc=Ia.scene.getElements();!Wa.shiftKey&&vh(Zc,Ia.state)&&(Ca.withCmdOrCtrl&&Ca.hit.element?Ia.setState(function(sd){return Me(Wd(Wd({},sd),{},{selectedElementIds:T({},Ca.hit.element.id,!0)}),Ia.scene.getElements())}):
Ia.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}));var md=function(sd,Hd){Hd=ca(Vf(Hd),4);var He=Hd[0],Sg=Hd[1],ni=Hd[2],Ai=Hd[3];return sd.filter(function(pf){var Ae=ca(gk(pf),4),ah=Ae[0],Wi=Ae[1],rk=Ae[2];Ae=Ae[3];return"selection"!==pf.type&&He<=ah&&Sg<=Wi&&ni>=rk&&Ai>=Ae})}(Zc,nc);Ia.setState(function(sd){return Me(Wd(Wd({},sd),{},{selectedElementIds:Wd(Wd(Wd({},sd.selectedElementIds),md.reduce(function(Hd,He){return Hd[He.id]=!0,Hd},{})),Ca.hit.element?T({},Ca.hit.element.id,
!md.length):null)}),Ia.scene.getElements())})}}}})}},{key:"handlePointerMoveOverScrollbars",value:function(Ca,Ia){return Ia.scrollbars.isOverHorizontal?(Ca=Ca.clientX,this.setState({scrollX:this.state.scrollX-(Ca-Ia.lastCoords.x)/this.state.zoom.value}),Ia.lastCoords.x=Ca,!0):Ia.scrollbars.isOverVertical?(Ca=Ca.clientY,this.setState({scrollY:this.state.scrollY-(Ca-Ia.lastCoords.y)/this.state.zoom.value}),Ia.lastCoords.y=Ca,!0):!1}},{key:"onPointerUpFromPointerDownHandler",value:function(Ca){var Ia=
this;return ag(function(Wa){var $a=Ia.state,rb=$a.draggingElement,Hb=$a.resizingElement,Xb=$a.multiElement,jc=$a.elementType,nc=$a.elementLocked,Tc=$a.isResizing;$a=$a.isRotating;if(Ia.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:Xb||Xg(Ia.state.editingElement)?Ia.state.editingElement:null}),Ia.savePointer(Wa.clientX,Wa.clientY,"up"),Ia.state.editingLinearElement){var Xc=fd.handlePointerUp(Wa,Ia.state.editingLinearElement,Ia.state);
Xc!==Ia.state.editingLinearElement&&Ia.setState({editingLinearElement:Xc,suggestedBindings:[]})}if(mo=null,window.removeEventListener(Cc.Ks.POINTER_MOVE,Ca.eventListeners.onMove),window.removeEventListener(Cc.Ks.POINTER_UP,Ca.eventListeners.onUp),window.removeEventListener(Cc.Ks.KEYDOWN,Ca.eventListeners.onKeyDown),window.removeEventListener(Cc.Ks.KEYUP,Ca.eventListeners.onKeyUp),"freedraw"===(null==rb?void 0:rb.type))return jc=hh(Wa,Ia.state),Xb=rb.points,nc=jc.x-rb.x,jc=jc.y-rb.y,nc===Xb[0][0]&&
jc===Xb[0][1]&&(jc+=1E-4,nc+=1E-4),Wa=rb.simulatePressure?[]:[].concat(O(rb.pressures),[Wa.pressure]),le(rb,{points:[].concat(O(Xb),[[nc,jc]]),pressures:Wa}),void Ia.actionManager.executeAction($f);if(Dg(rb))1<rb.points.length&&Ia.history.resumeRecording(),Wa=hh(Wa,Ia.state),Ca.drag.hasOccurred||!rb||Xb?Ca.drag.hasOccurred&&!Xb&&(Ia.state.isBindingEnabled&&Wg(rb)&&ng(rb,Ia.state,Ia.scene,Wa),Ia.setState({suggestedBindings:[],startBoundElement:null}),nc?Ia.setState(function(Dd){return{draggingElement:null,
selectedElementIds:Wd(Wd({},Dd.selectedElementIds),{},T({},Ia.state.draggingElement.id,!0))}}):(Pi(Ia.canvas),Ia.setState(function(Dd){return{draggingElement:null,elementType:"selection",selectedElementIds:Wd(Wd({},Dd.selectedElementIds),{},T({},Ia.state.draggingElement.id,!0))}}))):(le(rb,{points:[].concat(O(rb.points),[[Wa.x-rb.x,Wa.y-rb.y]])}),Ia.setState({multiElement:rb,editingElement:Ia.state.draggingElement}));else{if("selection"!==jc&&rb&&Kj(rb))return Ia.scene.replaceAllElements(Ia.scene.getElementsIncludingDeleted().slice(0,
-1)),void Ia.setState({draggingElement:null});rb&&le(rb,Rj(rb));Hb&&Ia.history.resumeRecording();Hb&&Kj(Hb)&&Ia.scene.replaceAllElements(Ia.scene.getElementsIncludingDeleted().filter(function(Dd){return Dd.id!==Hb.id}));var Pc=Ca.hit.element;if(Pc&&!Ca.drag.hasOccurred&&!Ca.hit.wasAddedToSelection)if(Wa.shiftKey)if(Ia.state.selectedElementIds[Pc.id])if(null!=dh(Ia.state,Pc)){var Zc=Pc.groupIds.flatMap(function(Dd){return li(Ia.scene.getElements(),Dd)}).map(function(Dd){return T({},Dd.id,!1)}).reduce(function(Dd,
Yd){return Wd(Wd({},Dd),Yd)},{});Ia.setState(function(Dd){return{selectedGroupIds:Wd(Wd({},Dd.selectedElementIds),Pc.groupIds.map(function(Yd){return T({},Yd,!1)}).reduce(function(Yd,md){return Wd(Wd({},Yd),md)},{})),selectedElementIds:Wd(Wd({},Dd.selectedElementIds),Zc)}})}else Ia.setState(function(Dd){return Me(Wd(Wd({},Dd),{},{selectedElementIds:Wd(Wd({},Dd.selectedElementIds),{},T({},Pc.id,!1))}),Ia.scene.getElements())});else Ia.setState(function(Dd){return{selectedElementIds:Wd(Wd({},Dd.selectedElementIds),
{},T({},Pc.id,!0))}});else Ia.setState(function(Dd){return Wd({},Me(Wd(Wd({},Dd),{},{selectedElementIds:T({},Pc.id,!0)}),Ia.scene.getElements()))});Ia.state.editingLinearElement||Ca.drag.hasOccurred||Ia.state.isResizing||!(Pc&&Xi(Pc,Ia.state,Ca.origin.x,Ca.origin.y)||!Pc&&Ca.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!nc&&"freedraw"!==jc&&rb&&Ia.setState(function(Dd){return{selectedElementIds:Wd(Wd({},Dd.selectedElementIds),{},T({},rb.id,!0))}}),("selection"!==jc||vh(Ia.scene.getElements(),Ia.state))&&
Ia.history.resumeRecording(),(Ca.drag.hasOccurred||Tc||$a)&&(Ia.state.isBindingEnabled?If:Ad)(Sf(Ia.scene.getElements(),Ia.state)),nc||"freedraw"===jc?Ia.setState({draggingElement:null,suggestedBindings:[]}):(Pi(Ia.canvas),Ia.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):Ia.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}})}},{key:"maybeSuggestBindingForAll",value:function(Ca){var Ia,Wa=(Ia=new Set(Ca.map(function($a){return $a.id})),Ca.flatMap(function($a){return Wg($a)?
zg($a).filter(function(rb){return!Ia.has(rb.id)}):Ze($a)?zf($a).filter(function(rb){return!Ia.has(rb[0].id)}):[]}));this.setState({suggestedBindings:Wa})}},{key:"clearSelection",value:function(Ca){this.setState(function(Ia){return{selectedElementIds:{},selectedGroupIds:{},editingGroupId:Ia.editingGroupId&&null!=Ca&&Ca.groupIds.includes(Ia.editingGroupId)?Ia.editingGroupId:null}});this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}},{key:"getTextWysiwygSnappedToCenterPosition",
value:function(Ca,Ia,Wa,$a,rb){if(rb=function(Hb,Xb,jc){for(var nc=null,Tc=Hb.length-1;0<=Tc;--Tc)if(!Hb[Tc].isDeleted){var Xc=ca(Vf(Hb[Tc]),4),Pc=Xc[1],Zc=Xc[2],Dd=Xc[3];if(Xc[0]<Xb&&Xb<Zc&&Pc<jc&&jc<Dd){nc=Hb[Tc];break}}return nc}(this.scene.getElementsIncludingDeleted().filter(function(Hb){return!Xg(Hb)}),Ca,Ia))if($a=rb.x+rb.width/2,rb=rb.y+rb.height/2,Math.hypot(Ca-$a,Ia-rb)<Cc.wZ)return Ca=hk({sceneX:$a,sceneY:rb},Wa),{viewportX:Ca.x,viewportY:Ca.y,elementCenterX:$a,elementCenterY:rb}}},{key:"getCanvasOffsets",
value:function(){var Ca;return null!==(Ca=this.excalidrawContainerRef)&&void 0!==Ca&&Ca.current?(Ca=this.excalidrawContainerRef.current.getBoundingClientRect(),{offsetLeft:Ca.left,offsetTop:Ca.top}):{offsetLeft:0,offsetTop:0}}},{key:"updateLanguage",value:(va=(0,ff.Z)(Zd().mark(function Ia(){var Wa,$a=this;return Zd().wrap(function(rb){for(;;)switch(rb.prev=rb.next){case 0:return Wa=bk.find(function(Hb){return Hb.code===$a.props.langCode})||Vg,rb.next=3,tg(Wa);case 3:this.setAppState({});case 4:case "end":return rb.stop()}},
Ia,this)})),function(){return va.apply(this,arguments)})}],[{key:"resetTapTwice",value:function(){Bq=!1}}]),oa}(de().Component);ks.defaultProps={UIOptions:Cc.cW};var Su=function(){var B=this;this.rc=this.canvas=null;this.isMobile=this.unmounted=!1;this.excalidrawContainerRef=de().createRef();this.focusContainer=function(){var oa;B.props.autoFocus&&(null===(oa=B.excalidrawContainerRef.current)||void 0===oa||oa.focus())};this.getSceneElementsIncludingDeleted=function(){return B.scene.getElementsIncludingDeleted()};
this.getSceneElements=function(){return B.scene.getElements()};this.syncActionResult=ag(function(oa){if(!B.unmounted&&!1!==oa){var va=null;if(oa.elements&&(oa.elements.forEach(function(nc){var Tc;(null===(Tc=B.state.editingElement)||void 0===Tc?void 0:Tc.id)===nc.id&&B.state.editingElement!==nc&&!nc.isDeleted&&(va=nc)}),B.scene.replaceAllElements(oa.elements),oa.commitToHistory&&B.history.resumeRecording()),oa.appState||va){var ja,xa,Aa,Ca,Ia,Wa;oa.commitToHistory&&B.history.resumeRecording();var $a=
(null==oa||null===(ja=oa.appState)||void 0===ja?void 0:ja.viewModeEnabled)||!1,rb=(null==oa||null===(xa=oa.appState)||void 0===xa?void 0:xa.zenModeEnabled)||!1,Hb=(null==oa||null===(Aa=oa.appState)||void 0===Aa?void 0:Aa.gridSize)||null,Xb=(null==oa||null===(Ca=oa.appState)||void 0===Ca?void 0:Ca.theme)||"light",jc=null!==(Ia=null==oa||null===(Wa=oa.appState)||void 0===Wa?void 0:Wa.name)&&void 0!==Ia?Ia:B.state.name;void 0!==B.props.viewModeEnabled&&($a=B.props.viewModeEnabled);void 0!==B.props.zenModeEnabled&&
(rb=B.props.zenModeEnabled);void 0!==B.props.gridModeEnabled&&(Hb=B.props.gridModeEnabled?Cc.k:null);void 0!==B.props.theme&&(Xb=B.props.theme);void 0!==B.props.name&&(jc=B.props.name);B.setState(function(nc){var Tc;return Object.assign(oa.appState||{},{editingElement:va||(null===(Tc=oa.appState)||void 0===Tc?void 0:Tc.editingElement)||null,viewModeEnabled:$a,zenModeEnabled:rb,gridSize:Hb,theme:Xb,name:jc})},function(){oa.syncHistory&&B.history.setCurrentState(B.state,B.scene.getElementsIncludingDeleted())})}}});
this.onBlur=ag(function(){ap=!1;B.setState({isBindingEnabled:!0})});this.onUnload=function(){B.onBlur()};this.disableEvent=function(oa){oa.preventDefault()};this.onFontLoaded=function(){B.scene.getElementsIncludingDeleted().forEach(function(oa){Xg(oa)&&kh.delete(oa)});B.onSceneUpdated()};this.importLibraryFromUrl=function(){var oa=(0,ff.Z)(Zd().mark(function Aa(ja,xa){var Ca,Ia,Wa,$a,rb;return Zd().wrap(function(Hb){for(;;)switch(Hb.prev=Hb.next){case 0:return window.location.hash.includes(Cc.ah.addLibrary)?
((Ca=new URLSearchParams(window.location.hash.slice(1))).delete(Cc.ah.addLibrary),window.history.replaceState({},Cc.iC,"#".concat(Ca.toString()))):window.location.search.includes(Cc.UO.addLibrary)&&((Ia=new URLSearchParams(window.location.search)).delete(Cc.UO.addLibrary),window.history.replaceState({},Cc.iC,"?".concat(Ia.toString()))),Hb.prev=1,Hb.next=4,fetch(decodeURIComponent(ja));case 4:return Wa=Hb.sent,Hb.next=7,Wa.blob();case 7:return $a=Hb.sent,Hb.t0=JSON,Hb.next=11,$a.text();case 11:Hb.t1=
Hb.sent;var Xb=rb=Hb.t0.parse.call(Hb.t0,Hb.t1);if("object"===E(Xb)&&Xb&&Xb.type===Cc.r8.excalidrawLibrary&&1===Xb.version){Hb.next=15;break}throw Error();case 15:if(xa!==B.id&&!window.confirm($b("alerts.confirmAddLibrary",{numShapes:rb.library.length}))){Hb.next=20;break}return Hb.next=18,B.library.importLibrary($a);case 18:B.state.isLibraryOpen&&B.setState({isLibraryOpen:!1}),B.setState({isLibraryOpen:!0});case 20:Hb.next=26;break;case 22:Hb.prev=22,Hb.t2=Hb.catch(1),window.alert($b("alerts.errorLoadingLibrary")),
console.error(Hb.t2);case 26:return Hb.prev=26,B.focusContainer(),Hb.finish(26);case 29:case "end":return Hb.stop()}},Aa,null,[[1,22,26,29]])}));return function(ja,xa){return oa.apply(this,arguments)}}();this.resetHistory=function(){B.history.clear()};this.resetScene=ag(function(oa){B.scene.replaceAllElements([]);B.setState(function(va){return Wd(Wd({},Ij()),{},{isLoading:(null==oa||!oa.resetLoadingState)&&va.isLoading,theme:B.state.theme})});B.resetHistory()});this.initializeScene=(0,ff.Z)(Zd().mark(function va(){var ja,
xa,Aa,Ca,Ia;return Zd().wrap(function(Wa){for(;;)switch(Wa.prev=Wa.next){case 0:return"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(function(){var $a=(0,ff.Z)(Zd().mark(function Xb(Hb){var jc,nc;return Zd().wrap(function(Tc){for(;;)switch(Tc.prev=Tc.next){case 0:if(Hb.files.length){Tc.next=2;break}return Tc.abrupt("return");case 2:return jc=Hb.files[0],Tc.next=5,jc.getFile();case 5:(nc=Tc.sent).handle=jc,vl(nc,B.state,B.scene.getElementsIncludingDeleted()).then(function(Xc){return B.syncActionResult({elements:Xc.elements,
appState:Wd(Wd({},Xc.appState||B.state),{},{isLoading:!1}),commitToHistory:!0})}).catch(function(Xc){B.setState({isLoading:!1,errorMessage:Xc.message})});case 8:case "end":return Tc.stop()}},Xb)}));return function(Hb){return $a.apply(this,arguments)}}()),B.state.isLoading||B.setState({isLoading:!0}),xa=null,Wa.prev=3,Wa.next=6,B.props.initialData;case 6:if(Wa.t0=Wa.sent,Wa.t0){Wa.next=9;break}Wa.t0=null;case 9:xa=Wa.t0;null!==(Aa=xa)&&void 0!==Aa&&Aa.libraryItems&&(B.libraryItemsFromStorage=xa.libraryItems);
Wa.next=17;break;case 13:Wa.prev=13,Wa.t1=Wa.catch(3),console.error(Wa.t1),xa={appState:{errorMessage:Wa.t1.message||"Encountered an error during importing or restoring scene data"}};case 17:if((Ca=Tm(xa,null,null)).appState=Wd(Wd({},Ca.appState),{},{isLoading:!1}),null!==(ja=xa)&&void 0!==ja&&ja.scrollToContent&&(Ca.appState=Wd(Wd({},Ca.appState),Fg(Ca.elements,Wd(Wd({},Ca.appState),{},{width:B.state.width,height:B.state.height,offsetTop:B.state.offsetTop,offsetLeft:B.state.offsetLeft})))),B.resetHistory(),
B.syncActionResult(Wd(Wd({},Ca),{},{commitToHistory:!0})),!(Ia=(new URLSearchParams(window.location.hash.slice(1))).get(Cc.ah.addLibrary)||(new URLSearchParams(window.location.search)).get(Cc.UO.addLibrary))){Wa.next=26;break}return Wa.next=26,B.importLibraryFromUrl(Ia);case 26:case "end":return Wa.stop()}},va,null,[[3,13]])}));this.onResize=ag(function(){B.scene.getElementsIncludingDeleted().forEach(function(va){return kh.delete(va)});B.setState({})});this.onScroll=Sm(function(){var va=B.getCanvasOffsets(),
ja=va.offsetTop,xa=va.offsetLeft;B.setState(function(Aa){return Aa.offsetLeft===xa&&Aa.offsetTop===ja?null:{offsetTop:ja,offsetLeft:xa}})},Cc.HM);this.onCut=ag(function(va){var ja;(null===(ja=B.excalidrawContainerRef.current)||void 0===ja?0:ja.contains(document.activeElement))&&!Dj(va.target)&&(B.cutAll(),va.preventDefault())});this.onCopy=ag(function(va){var ja;(null===(ja=B.excalidrawContainerRef.current)||void 0===ja?0:ja.contains(document.activeElement))&&!Dj(va.target)&&(B.copyAll(),va.preventDefault())});
this.cutAll=function(){B.copyAll();B.actionManager.executeAction(hn)};this.copyAll=function(){hc(B.scene.getElements(),B.state)};this.onTapStart=function(va){if(!Bq)return Bq=!0,clearTimeout(ls),void(ls=window.setTimeout(ks.resetTapTwice,Cc.Gj));if(Bq&&1===va.touches.length){var ja=ca(va.touches,1)[0];B.handleCanvasDoubleClick({clientX:ja.clientX,clientY:ja.clientY});Bq=!1;clearTimeout(ls)}va.preventDefault();2===va.touches.length&&B.setState({selectedElementIds:{}})};this.onTapEnd=function(va){0<
va.touches.length&&B.setState({previousSelectedElementIds:{},selectedElementIds:B.state.previousSelectedElementIds})};this.pasteFromClipboard=ag(function(){var va=(0,ff.Z)(Zd().mark(function Aa(xa){var Ca,Ia,Wa,$a;return Zd().wrap(function(rb){for(;;)switch(rb.prev=rb.next){case 0:if(Ia=document.activeElement,null===(Ca=B.excalidrawContainerRef.current)||void 0===Ca?void 0:Ca.contains(Ia)){rb.next=4;break}return rb.abrupt("return");case 4:if(Wa=document.elementFromPoint(Jp,Kp),!xa||Wa instanceof HTMLCanvasElement&&
!Dj(Ia)){rb.next=7;break}return rb.abrupt("return");case 7:return rb.next=9,Nf(xa);case 9:if($a=rb.sent,!B.props.onPaste){rb.next=22;break}return rb.prev=11,rb.next=14,B.props.onPaste($a,xa);case 14:if(rb.t0=rb.sent,!1!==rb.t0){rb.next=17;break}return rb.abrupt("return");case 17:rb.next=22;break;case 19:rb.prev=19,rb.t1=rb.catch(11),console.error(rb.t1);case 22:$a.errorMessage?B.setState({errorMessage:$a.errorMessage}):$a.spreadsheet?B.setState({pasteDialog:{data:$a.spreadsheet,shown:!0}}):$a.elements?
B.addElementsFromPasteOrLibrary({elements:$a.elements,position:"cursor"}):$a.text&&B.addTextFromPaste($a.text),B.selectShapeTool("selection"),null==xa||xa.preventDefault();case 25:case "end":return rb.stop()}},Aa,null,[[11,19]])}));return function(xa){return va.apply(this,arguments)}}());this.addElementsFromPasteOrLibrary=function(va){var ja=sl(va.elements,null),xa=ca(Bg(ja),4),Aa=xa[0],Ca=xa[1],Ia=Math.abs(Aa-xa[2])/2;xa=Math.abs(Ca-xa[3])/2;var Wa="object"===E(va.position)?va.position.clientX:"cursor"===
va.position?Jp:B.state.width/2+B.state.offsetLeft;va="object"===E(va.position)?va.position.clientY:"cursor"===va.position?Kp:B.state.height/2+B.state.offsetTop;va=hh({clientX:Wa,clientY:va},B.state);Ia=va.x-Ia;xa=va.y-xa;var $a=new Map;Ia=ca(Ch(Ia,xa,B.state.gridSize),2);var rb=Ia[0],Hb=Ia[1],Xb=new Map;Ia=ja.map(function(jc){var nc=Xj(B.state.editingGroupId,$a,jc,{x:jc.x+rb-Aa,y:jc.y+Hb-Ca});return Xb.set(jc.id,nc.id),nc});xa=[].concat(O(B.scene.getElementsIncludingDeleted()),O(Ia));Tj(xa,ja,Xb);
B.scene.replaceAllElements(xa);B.history.resumeRecording();B.setState(Me(Wd(Wd({},B.state),{},{isLibraryOpen:!1,selectedElementIds:Ia.reduce(function(jc,nc){return jc[nc.id]=!0,jc},{}),selectedGroupIds:{}}),B.scene.getElements()));B.selectShapeTool("selection")};this.setAppState=function(va){B.setState(va)};this.removePointer=function(va){"touch"===va.pointerType&&no&&(clearTimeout(no),no=0,Dq=!1);zl.delete(va.pointerId)};this.toggleLock=function(){B.setState(function(va){return{elementLocked:!va.elementLocked,
elementType:va.elementLocked?"selection":va.elementType}})};this.toggleZenMode=function(){B.actionManager.executeAction(ss)};this.toggleStats=function(){B.state.showStats||Lh("dialog","stats");B.actionManager.executeAction(rs)};this.scrollToContent=function(){var va=0<arguments.length&&void 0!==arguments[0]?arguments[0]:B.scene.getElements();B.setState(Wd({},Fg(Array.isArray(va)?va:[va],B.state,B.canvas)))};this.clearToast=function(){B.setState({toastMessage:null})};this.setToastMessage=function(va){B.setState({toastMessage:va})};
this.restoreFileFromShare=(0,ff.Z)(Zd().mark(function ja(){var xa,Aa,Ca;return Zd().wrap(function(Ia){for(;;)switch(Ia.prev=Ia.next){case 0:return Ia.prev=0,Ia.next=3,caches.open("web-share-target");case 3:return xa=Ia.sent,Ia.next=6,xa.match("shared-file");case 6:if(!(Aa=Ia.sent)){Ia.next=15;break}return Ia.next=10,Aa.blob();case 10:return Ca=Ia.sent,B.loadFileToCanvas(Ca),Ia.next=14,xa.delete("shared-file");case 14:window.history.replaceState(null,Cc.iC,window.location.pathname);case 15:Ia.next=
20;break;case 17:Ia.prev=17,Ia.t0=Ia.catch(0),B.setState({errorMessage:Ia.t0.message});case 20:case "end":return Ia.stop()}},ja,null,[[0,17]])}));this.updateScene=ag(function(ja){ja.commitToHistory&&B.history.resumeRecording();ja.appState&&B.setState(ja.appState);ja.elements&&B.scene.replaceAllElements(ja.elements);ja.collaborators&&B.setState({collaborators:ja.collaborators})});this.onSceneUpdated=function(){B.setState({})};this.updateCurrentCursorPosition=ag(function(ja){Jp=ja.clientX;Kp=ja.clientY});
this.onKeyDown=ag(function(ja){var xa;if(!(("Proxy"in window&&(!ja.shiftKey&&/^[A-Z]$/.test(ja.key)||ja.shiftKey&&/^[a-z]$/.test(ja.key))&&(ja=new Proxy(ja,{get:function(Wa,$a){var rb=Wa[$a];return"function"==typeof rb?rb.bind(Wa):"key"===$a?ja.shiftKey?Wa.key.toUpperCase():Wa.key.toLowerCase():rb}})),Dj(ja.target)&&"Escape"!==ja.key||oh(ja.key)&&(xa=ja.target,xa instanceof HTMLElement&&"wysiwyg"===xa.dataset.type||xa instanceof HTMLBRElement||xa instanceof HTMLInputElement||xa instanceof HTMLTextAreaElement||
xa instanceof HTMLSelectElement))||("?"===ja.key&&B.setState({showHelpDialog:!0}),B.actionManager.handleKeyDown(ja)||B.state.viewModeEnabled))){if(ja[Af]&&B.state.isBindingEnabled&&B.setState({isBindingEnabled:!1}),"Digit9"===ja.code&&B.setState({isLibraryOpen:!B.state.isLibraryOpen}),oh(ja.key)){xa=B.state.gridSize&&(ja.shiftKey?Cc.$e:B.state.gridSize)||(ja.shiftKey?Cc.Iw:Cc.$e);var Aa=B.scene.getElements().filter(function(Wa){return B.state.selectedElementIds[Wa.id]}),Ca=0,Ia=0;"ArrowLeft"===ja.key?
Ca=-xa:"ArrowRight"===ja.key?Ca=xa:"ArrowUp"===ja.key?Ia=-xa:"ArrowDown"===ja.key&&(Ia=xa);Aa.forEach(function(Wa){le(Wa,{x:Wa.x+Ca,y:Wa.y+Ia});Di(Wa,{simultaneouslyUpdated:Aa})});B.maybeSuggestBindingForAll(Aa);ja.preventDefault()}else if("Enter"===ja.key)if(xa=Sf(B.scene.getElements(),B.state),1===xa.length&&Dg(xa[0]))B.state.editingLinearElement&&B.state.editingLinearElement.elementId===xa[0].id||(B.history.resumeRecording(),B.setState({editingLinearElement:new fd(xa[0],B.scene)}));else{if(1===
xa.length&&!Dg(xa[0]))return xa=xa[0],B.startTextEditing({sceneX:xa.x+xa.width/2,sceneY:xa.y+xa.height/2}),void ja.preventDefault()}else ja.ctrlKey||ja.altKey||ja.metaKey||null!==B.state.draggingElement||((xa=function(Wa){var $a=xt.find(function(rb,Hb){return Wa===(Hb+1).toString()||("string"==typeof rb.key?rb.key===Wa:rb.key.includes(Wa))});return(null==$a?void 0:$a.value)||null}(ja.key))?B.selectShapeTool(xa):"q"===ja.key&&B.toggleLock());if(" "===ja.key&&0===zl.size&&(ap=!0,yi(B.canvas,Cc.oc.GRABBING)),
"g"===ja.key||"s"===ja.key)if(xa=Sf(B.scene.getElements(),B.state),"selection"!==B.state.elementType||xa.length)"g"===ja.key&&(Pk(B.state.elementType)||xa.some(function(Wa){return Pk(Wa.type)}))&&B.setState({openPopup:"backgroundColorPicker"}),"s"===ja.key&&B.setState({openPopup:"strokeColorPicker"})}});this.onKeyUp=ag(function(ja){if(" "===ja.key&&(B.state.viewModeEnabled?yi(B.canvas,Cc.oc.GRAB):"selection"===B.state.elementType?Pi(B.canvas):(si(B.canvas,B.state.elementType),B.setState({selectedElementIds:{},
selectedGroupIds:{},editingGroupId:null})),ap=!1),ja[Af]||B.state.isBindingEnabled||B.setState({isBindingEnabled:!0}),oh(ja.key))ja=Sf(B.scene.getElements(),B.state),B.state.isBindingEnabled?If(ja):Ad(ja),B.setState({suggestedBindings:[]})});this.onGestureStart=ag(function(ja){ja.preventDefault();B.setState({selectedElementIds:{}});Hp=B.state.zoom.value});this.onGestureChange=ag(function(ja){if(ja.preventDefault(),2!==zl.size){var xa=Hp;xa&&B.setState(function(Aa){var Ca=Aa.zoom,Ia=Aa.offsetLeft;
Aa=Aa.offsetTop;return{zoom:ha(ua(xa*ja.scale),Ca,{left:Ia,top:Aa},{x:Jp,y:Kp})}})}});this.onGestureEnd=ag(function(ja){ja.preventDefault();B.setState({previousSelectedElementIds:{},selectedElementIds:B.state.previousSelectedElementIds});Hp=null});this.startTextEditing=function(ja){var xa=ja.sceneX,Aa=ja.sceneY;ja=ja.insertAtParentCenter;var Ca=void 0===ja||ja;ja=B.getTextElementAtPosition(xa,Aa);Ca=Ca&&B.getTextWysiwygSnappedToCenterPosition(xa,Aa,B.state,B.canvas,window.devicePixelRatio);xa=ja||
Eg({x:Ca?Ca.elementCenterX:xa,y:Ca?Ca.elementCenterY:Aa,strokeColor:B.state.currentItemStrokeColor,backgroundColor:B.state.currentItemBackgroundColor,fillStyle:B.state.currentItemFillStyle,strokeWidth:B.state.currentItemStrokeWidth,strokeStyle:B.state.currentItemStrokeStyle,roughness:B.state.currentItemRoughness,opacity:B.state.currentItemOpacity,strokeSharpness:B.state.currentItemStrokeSharpness,text:"",fontSize:B.state.currentItemFontSize,fontFamily:B.state.currentItemFontFamily,textAlign:Ca?"center":
B.state.currentItemTextAlign,verticalAlign:Ca?"middle":Cc.hs});B.setState({editingElement:xa});ja?Ca&&"center"===xa.textAlign||le(xa,{verticalAlign:Cc.hs}):(B.scene.replaceAllElements([].concat(O(B.scene.getElementsIncludingDeleted()),[xa])),Ca||le(xa,{y:xa.y-xa.baseline/2}));B.setState({editingElement:xa});B.handleTextWysiwyg(xa,{isExistingElement:!!ja})};this.handleCanvasDoubleClick=function(ja){if(!B.state.multiElement&&"selection"===B.state.elementType){var xa=Sf(B.scene.getElements(),B.state);
if(1===xa.length&&Dg(xa[0]))B.state.editingLinearElement&&B.state.editingLinearElement.elementId===xa[0].id||(B.history.resumeRecording(),B.setState({editingLinearElement:new fd(xa[0],B.scene)}));else{Pi(B.canvas);var Aa=hh(ja,B.state);xa=Aa.x;Aa=Aa.y;if(0<vi(B.state).length){var Ca=B.getElementAtPosition(xa,Aa),Ia=Ca&&function(Wa,$a){return Wa.groupIds.find(function(rb){return $a[rb]})}(Ca,B.state.selectedGroupIds);if(Ia)return void B.setState(function(Wa){return Me(Wd(Wd({},Wa),{},{editingGroupId:Ia,
selectedElementIds:T({},Ca.id,!0),selectedGroupIds:{}}),B.scene.getElements())})}Pi(B.canvas);ja[Af]||B.state.viewModeEnabled||B.startTextEditing({sceneX:xa,sceneY:Aa,insertAtParentCenter:!ja.altKey})}}};this.handleCanvasPointerMove=function(ja){B.savePointer(ja.clientX,ja.clientY,B.state.cursorButton);zl.has(ja.pointerId)&&zl.set(ja.pointerId,{x:ja.clientX,y:ja.clientY});var xa=Hp;if(2===zl.size&&Gp&&xa&&pr){var Aa=yt(zl),Ca=Aa.x-Gp.x,Ia=Aa.y-Gp.y;Gp=Aa;var Wa=zt(Array.from(zl.values()))/pr;B.setState(function(Xc){var Pc=
Xc.zoom,Zc=Xc.offsetLeft,Dd=Xc.offsetTop;return{scrollX:Xc.scrollX+Ca/Pc.value,scrollY:Xc.scrollY+Ia/Pc.value,zoom:ha(ua(xa*Wa),Pc,{left:Zc,top:Dd},Aa),shouldCacheIgnoreZoom:!0}});B.resetShouldCacheIgnoreZoomDebounced()}else Gp=pr=Hp=null;if(!(ap||Cq||ms)){var $a=Yg(ns,ja.clientX-B.state.offsetLeft,ja.clientY-B.state.offsetTop).isOverEither;B.state.draggingElement||B.state.multiElement||($a?Pi(B.canvas):si(B.canvas,B.state.elementType));var rb=hh(ja,B.state),Hb=rb.x,Xb=rb.y;if(B.state.editingLinearElement&&
!B.state.editingLinearElement.isDragging){var jc=fd.handlePointerMove(ja,Hb,Xb,B.state.editingLinearElement,B.state.gridSize);jc!==B.state.editingLinearElement&&B.setState({editingLinearElement:jc});null!=jc.lastUncommittedPoint?B.maybeSuggestBindingAtCursor(rb):B.setState({suggestedBindings:[]})}"arrow"===B.state.elementType&&(jc=B.state.draggingElement,Wg(jc)?B.maybeSuggestBindingForLinearElementAtCursor(jc,"end",rb,B.state.startBoundElement):B.maybeSuggestBindingAtCursor(rb));if(B.state.multiElement){ja=
B.state.multiElement;$a=ja.x;rb=ja.y;jc=ja.points;var nc=ja.lastCommittedPoint,Tc=jc[jc.length-1];return si(B.canvas,B.state.elementType),void(Tc===nc?Math.hypot(Tc[0]-(Hb-$a),Tc[1]-(Xb-rb))>=Cc.qx?le(ja,{points:[].concat(O(jc),[[Hb-$a,Xb-rb]])}):yi(B.canvas,Cc.oc.POINTER):2<jc.length&&nc&&Math.hypot(nc[0]-(Hb-$a),nc[1]-(Xb-rb))<Cc.qx?(yi(B.canvas,Cc.oc.POINTER),le(ja,{points:jc.slice(0,-1)})):(qj(jc,B.state.zoom.value)&&yi(B.canvas,Cc.oc.POINTER),le(ja,{points:[].concat(O(jc.slice(0,-1)),[[Hb-$a,
Xb-rb]])})))}if(!(ja.buttons||"selection"!==B.state.elementType&&"text"!==B.state.elementType)){nc=B.scene.getElements();jc=Sf(nc,B.state);if(1!==jc.length||$a||B.state.editingLinearElement){if(1<jc.length&&!$a&&(Hb=jj(Bg(jc),Hb,Xb,B.state.zoom,ja.pointerType)))return void yi(B.canvas,me({transformHandleType:Hb}))}else if((Hb=fh(nc,B.state,Hb,Xb,B.state.zoom,ja.pointerType))&&Hb.transformHandleType)return void yi(B.canvas,me(Hb));Hb=B.getElementAtPosition(rb.x,rb.y);"text"===B.state.elementType?yi(B.canvas,
Xg(Hb)?Cc.oc.TEXT:Cc.oc.CROSSHAIR):B.state.viewModeEnabled?yi(B.canvas,Cc.oc.GRAB):$a||ja[Af]||!Hb&&!B.isHittingCommonBoundingBoxOfSelectedElements(rb,jc)?yi(B.canvas,Cc.oc.AUTO):yi(B.canvas,Cc.oc.MOVE)}}};this.handleTouchMove=function(ja){Dq=!0};this.handleCanvasPointerDown=function(ja){var xa=document.getSelection();if(null!=xa&&xa.anchorNode&&xa.removeAllRanges(),B.maybeOpenContextMenuAfterPointerDownOnTouchDevices(ja),B.maybeCleanupAfterMissingPointerUp(ja),!(Cq||(B.setState({lastPointerDownWith:ja.pointerType,
cursorButton:"down"}),B.savePointer(ja.clientX,ja.clientY,"down"),B.handleCanvasPanUsingWheelOrSpaceDrag(ja)||ja.button!==Cc.Oh.MAIN&&ja.button!==Cc.Oh.TOUCH||(B.updateGestureOnPointerDown(ja),1<zl.size))))if(xa=B.initialPointerDownState(ja),!B.handleDraggingScrollBar(ja,xa)&&(B.clearSelectionIfNotUsingSelection(),B.updateBindingEnabledOnPointerMove(ja),!B.handleSelectionOnPointerDown(ja,xa)))if("text"!==B.state.elementType){"arrow"===B.state.elementType||"line"===B.state.elementType?B.handleLinearElementOnPointerDown(ja,
B.state.elementType,xa):"freedraw"===B.state.elementType?B.handleFreeDrawElementOnPointerDown(ja,B.state.elementType,xa):B.createGenericElementOnPointerDown(B.state.elementType,xa);ja=B.onPointerMoveFromPointerDownHandler(xa);var Aa=B.onPointerUpFromPointerDownHandler(xa),Ca=B.onKeyDownFromPointerDownHandler(xa),Ia=B.onKeyUpFromPointerDownHandler(xa);mo=Aa;B.state.viewModeEnabled||(window.addEventListener(Cc.Ks.POINTER_MOVE,ja),window.addEventListener(Cc.Ks.POINTER_UP,Aa),window.addEventListener(Cc.Ks.KEYDOWN,
Ca),window.addEventListener(Cc.Ks.KEYUP,Ia),xa.eventListeners.onMove=ja,xa.eventListeners.onUp=Aa,xa.eventListeners.onKeyUp=Ia,xa.eventListeners.onKeyDown=Ca)}else B.handleTextOnPointerDown(ja,xa)};this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=function(ja){"touch"===ja.pointerType&&(Dq=!1,no?Dq=!0:no=window.setTimeout(function(){no=0;Dq||B.handleCanvasContextMenu(ja)},Cc.nM))};this.handleCanvasPanUsingWheelOrSpaceDrag=function(ja){if(0!==zl.size||!(ja.button===Cc.Oh.WHEEL||ja.button===Cc.Oh.MAIN&&
ap||B.state.viewModeEnabled))return!1;Cq=!0;var xa=!1,Aa=/Linux/.test(window.navigator.platform);yi(B.canvas,Cc.oc.GRABBING);var Ca=ja.clientX,Ia=ja.clientY,Wa=ag(function(rb){var Hb=Ca-rb.clientX,Xb=Ia-rb.clientY;if(Ca=rb.clientX,Ia=rb.clientY,Aa&&!xa&&(1<Math.abs(Hb)||1<Math.abs(Xb))){xa=!0;var jc=function Xc(Tc){document.body.removeEventListener(Cc.Ks.PASTE,Xc);Tc.stopPropagation()};document.body.addEventListener(Cc.Ks.PASTE,jc);window.addEventListener(Cc.Ks.POINTER_UP,function Xc(){setTimeout(function(){document.body.removeEventListener(Cc.Ks.PASTE,
jc);window.removeEventListener(Cc.Ks.POINTER_UP,Xc)},100)})}B.setState({scrollX:B.state.scrollX-Hb/B.state.zoom.value,scrollY:B.state.scrollY-Xb/B.state.zoom.value})}),$a=ag(mo=function(){mo=null;Cq=!1;ap||(B.state.viewModeEnabled?yi(B.canvas,Cc.oc.GRAB):si(B.canvas,B.state.elementType));B.setState({cursorButton:"up"});B.savePointer(ja.clientX,ja.clientY,"up");window.removeEventListener(Cc.Ks.POINTER_MOVE,Wa);window.removeEventListener(Cc.Ks.POINTER_UP,$a);window.removeEventListener(Cc.Ks.BLUR,$a)});
return window.addEventListener(Cc.Ks.BLUR,$a),window.addEventListener(Cc.Ks.POINTER_MOVE,Wa,{passive:!0}),window.addEventListener(Cc.Ks.POINTER_UP,$a),!0};this.clearSelectionIfNotUsingSelection=function(){"selection"!==B.state.elementType&&B.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})};this.handleSelectionOnPointerDown=function(ja,xa){if("selection"===B.state.elementType){var Aa=B.scene.getElements(),Ca=Sf(Aa,B.state);1!==Ca.length||B.state.editingLinearElement?1<Ca.length&&
(xa.resize.handleType=jj(Bg(Ca),xa.origin.x,xa.origin.y,B.state.zoom,ja.pointerType)):(Aa=fh(Aa,B.state,xa.origin.x,xa.origin.y,B.state.zoom,ja.pointerType),null!=Aa&&(B.setState({resizingElement:Aa.element}),xa.resize.handleType=Aa.transformHandleType));if(xa.resize.handleType)yi(B.canvas,me({transformHandleType:xa.resize.handleType})),xa.resize.isResizing=!0,xa.resize.offset=Hj(function(Tc,Xc,Pc,Zc){var Dd=ca(1===Xc.length?Vf(Xc[0]):Bg(Xc),4),Yd=Dd[0],md=Dd[1],sd=Dd[2];Dd=Dd[3];Xc=1===Xc.length?
Xc[0].angle:0;var Hd=ca(Jf(Pc,Zc,(Yd+sd)/2,(md+Dd)/2,-Xc),2);switch(Pc=Hd[0],Zc=Hd[1],Tc){case "n":return Jf(Pc-(Yd+sd)/2,Zc-md,0,0,Xc);case "s":return Jf(Pc-(Yd+sd)/2,Zc-Dd,0,0,Xc);case "w":return Jf(Pc-Yd,Zc-(md+Dd)/2,0,0,Xc);case "e":return Jf(Pc-sd,Zc-(md+Dd)/2,0,0,Xc);case "nw":return Jf(Pc-Yd,Zc-md,0,0,Xc);case "ne":return Jf(Pc-sd,Zc-md,0,0,Xc);case "sw":return Jf(Pc-Yd,Zc-Dd,0,0,Xc);case "se":return Jf(Pc-sd,Zc-Dd,0,0,Xc);default:return[0,0]}}(xa.resize.handleType,Ca,xa.origin.x,xa.origin.y)),
1===Ca.length&&Dg(Ca[0])&&2===Ca[0].points.length&&(xa.resize.arrowDirection=($a=xa.resize.handleType,rb=Ca[0],Hb=ca(rb.points,2),Xb=ca(Hb[1],2),jc=Xb[0],nc=Xb[1],"nw"===$a&&(0>jc||0>nc)||"ne"===$a&&0<=jc||"sw"===$a&&0>=jc||"se"===$a&&(0<jc||0<nc)?"end":"origin"));else{var Ia;if(B.state.editingLinearElement&&(Ca=fd.handlePointerDown(ja,B.state,function(Tc){return B.setState(Tc)},B.history,xa.origin),Ca.hitElement&&(xa.hit.element=Ca.hitElement),Ca.didAddPoint))return!0;xa.hit.element=null!==(Ia=xa.hit.element)&&
void 0!==Ia?Ia:B.getElementAtPosition(xa.origin.x,xa.origin.y);xa.hit.allHitElements=B.getElementsAtPosition(xa.origin.x,xa.origin.y);var Wa=xa.hit.element;Ia=xa.hit.allHitElements.some(function(Tc){return B.isASelectedElement(Tc)});if(null!==Wa&&Ia||ja.shiftKey||xa.hit.hasHitCommonBoundingBoxOfSelectedElements||B.clearSelection(Wa),null!=Wa){if(ja[Af])return B.state.selectedElementIds[Wa.id]||(xa.hit.wasAddedToSelection=!0),B.setState(function(Tc){Tc=tc(tc({},Tc),{},{editingGroupId:Wa.groupIds.length?
Wa.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:T({},Wa.id,!0)});return Wd(Wd({},Tc),{},{previousSelectedElementIds:B.state.selectedElementIds})}),!1;B.state.selectedElementIds[Wa.id]||(B.state.editingGroupId&&!Wa.groupIds.includes(B.state.editingGroupId)&&B.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),Ia||xa.hit.hasHitCommonBoundingBoxOfSelectedElements||(B.setState(function(Tc){return Me(Wd(Wd({},Tc),{},{selectedElementIds:Wd(Wd({},Tc.selectedElementIds),
{},T({},Wa.id,!0))}),B.scene.getElements())}),xa.hit.wasAddedToSelection=!0))}B.setState({previousSelectedElementIds:B.state.selectedElementIds})}}var $a,rb,Hb,Xb,jc,nc;return!1};this.handleTextOnPointerDown=function(ja,xa){var Aa;"text"!==(null===(Aa=B.state.editingElement)||void 0===Aa?void 0:Aa.type)&&(B.startTextEditing({sceneX:xa.origin.x,sceneY:xa.origin.y,insertAtParentCenter:!ja.altKey}),Pi(B.canvas),B.state.elementLocked||B.setState({elementType:"selection"}))};this.handleFreeDrawElementOnPointerDown=
function(ja,xa,Aa){var Ca,Ia=ca(Ch(Aa.origin.x,Aa.origin.y,null),2),Wa=(Ca={type:xa,x:Ia[0],y:Ia[1],strokeColor:B.state.currentItemStrokeColor,backgroundColor:B.state.currentItemBackgroundColor,fillStyle:B.state.currentItemFillStyle,strokeWidth:B.state.currentItemStrokeWidth,strokeStyle:B.state.currentItemStrokeStyle,roughness:B.state.currentItemRoughness,opacity:B.state.currentItemOpacity,strokeSharpness:B.state.currentItemLinearStrokeSharpness,simulatePressure:.5===ja.pressure},Rc(Rc({},xm(Ca.type,
Ca)),{},{points:Ca.points||[],pressures:[],simulatePressure:Ca.simulatePressure,lastCommittedPoint:null}));B.setState(function($a){return{selectedElementIds:Wd(Wd({},$a.selectedElementIds),{},T({},Wa.id,!1))}});ja=Wa.simulatePressure?Wa.pressures:[].concat(O(Wa.pressures),[ja.pressure]);le(Wa,{points:[[0,0]],pressures:ja});Aa=hg(Aa.origin,B.scene);B.scene.replaceAllElements([].concat(O(B.scene.getElementsIncludingDeleted()),[Wa]));B.setState({draggingElement:Wa,editingElement:Wa,startBoundElement:Aa,
suggestedBindings:[]})};this.handleLinearElementOnPointerDown=function(ja,xa,Aa){if(B.state.multiElement){var Ca=B.state.multiElement;if("line"===Ca.type&&qj(Ca.points,B.state.zoom.value))return le(Ca,{lastCommittedPoint:Ca.points[Ca.points.length-1]}),void B.actionManager.executeAction($f);xa=Ca.x;ja=Ca.y;var Ia=Ca.lastCommittedPoint;if(1<Ca.points.length&&Ia&&Math.hypot(Ia[0]-(Aa.origin.x-xa),Ia[1]-(Aa.origin.y-ja))<Cc.qx)return void B.actionManager.executeAction($f);B.setState(function(Hb){return{selectedElementIds:Wd(Wd({},
Hb.selectedElementIds),{},T({},Ca.id,!0))}});le(Ca,{lastCommittedPoint:Ca.points[Ca.points.length-1]});yi(B.canvas,Cc.oc.POINTER)}else{Ia=ca(Ch(Aa.origin.x,Aa.origin.y,B.state.gridSize),2);ja=Ia[0];Ia=Ia[1];var Wa=B.state,$a=Wa.currentItemStartArrowhead;Wa=Wa.currentItemEndArrowhead;$a=ca("arrow"===xa?[$a,Wa]:[null,null],2);var rb=Pg({type:xa,x:ja,y:Ia,strokeColor:B.state.currentItemStrokeColor,backgroundColor:B.state.currentItemBackgroundColor,fillStyle:B.state.currentItemFillStyle,strokeWidth:B.state.currentItemStrokeWidth,
strokeStyle:B.state.currentItemStrokeStyle,roughness:B.state.currentItemRoughness,opacity:B.state.currentItemOpacity,strokeSharpness:B.state.currentItemLinearStrokeSharpness,startArrowhead:$a[0],endArrowhead:$a[1]});B.setState(function(Hb){return{selectedElementIds:Wd(Wd({},Hb.selectedElementIds),{},T({},rb.id,!1))}});le(rb,{points:[].concat(O(rb.points),[[0,0]])});Aa=hg(Aa.origin,B.scene);B.scene.replaceAllElements([].concat(O(B.scene.getElementsIncludingDeleted()),[rb]));B.setState({draggingElement:rb,
editingElement:rb,startBoundElement:Aa,suggestedBindings:[]})}};this.createGenericElementOnPointerDown=function(ja,xa){xa=ca(Ch(xa.origin.x,xa.origin.y,B.state.gridSize),2);ja=xf({type:ja,x:xa[0],y:xa[1],strokeColor:B.state.currentItemStrokeColor,backgroundColor:B.state.currentItemBackgroundColor,fillStyle:B.state.currentItemFillStyle,strokeWidth:B.state.currentItemStrokeWidth,strokeStyle:B.state.currentItemStrokeStyle,roughness:B.state.currentItemRoughness,opacity:B.state.currentItemOpacity,strokeSharpness:B.state.currentItemStrokeSharpness});
"selection"===ja.type?B.setState({selectionElement:ja,draggingElement:ja}):(B.scene.replaceAllElements([].concat(O(B.scene.getElementsIncludingDeleted()),[ja])),B.setState({multiElement:null,draggingElement:ja,editingElement:ja}))};this.updateBindingEnabledOnPointerMove=function(ja){ja=!ja[Af];B.state.isBindingEnabled!==ja&&B.setState({isBindingEnabled:ja})};this.maybeSuggestBindingAtCursor=function(ja){ja=hg(ja,B.scene);B.setState({suggestedBindings:null!=ja?[ja]:[]})};this.maybeSuggestBindingForLinearElementAtCursor=
function(ja,xa,Aa,Ca){xa=hg(Aa,B.scene);B.setState({suggestedBindings:null==xa||(null==Ca?void 0:Ca.id)===xa.id&&3>ja.points.length?[]:[xa]})};this.handleCanvasRef=function(ja){var xa,Aa,Ca;null!==ja?(B.canvas=ja,B.rc=Bj.canvas(B.canvas),B.canvas.addEventListener(Cc.Ks.WHEEL,B.handleWheel,{passive:!1}),B.canvas.addEventListener(Cc.Ks.TOUCH_START,B.onTapStart),B.canvas.addEventListener(Cc.Ks.TOUCH_END,B.onTapEnd)):(null===(xa=B.canvas)||void 0===xa||xa.removeEventListener(Cc.Ks.WHEEL,B.handleWheel),
null===(Aa=B.canvas)||void 0===Aa||Aa.removeEventListener(Cc.Ks.TOUCH_START,B.onTapStart),null===(Ca=B.canvas)||void 0===Ca||Ca.removeEventListener(Cc.Ks.TOUCH_END,B.onTapEnd))};this.handleAppOnDrop=function(){var ja=(0,ff.Z)(Zd().mark(function Ca(Aa){var Ia,Wa,$a,rb,Hb,Xb,jc,nc,Tc,Xc;return Zd().wrap(function(Pc){for(;;)switch(Pc.prev=Pc.next){case 0:if(Pc.prev=0,"image/png"!==(null==($a=Aa.dataTransfer.files[0])?void 0:$a.type)&&"image/svg+xml"!==(null==$a?void 0:$a.type)){Pc.next=21;break}if(!nm){Pc.next=
14;break}return Pc.prev=4,rb=Aa.dataTransfer.items[0],Pc.next=8,rb.getAsFileSystemHandle();case 8:$a.handle=Pc.sent;Pc.next=14;break;case 11:Pc.prev=11,Pc.t0=Pc.catch(4),console.warn(Pc.t0.name,Pc.t0.message);case 14:return Pc.next=16,vl($a,B.state,B.scene.getElementsIncludingDeleted());case 16:return Hb=Pc.sent,Xb=Hb.elements,jc=Hb.appState,B.syncActionResult({elements:Xb,appState:Wd(Wd({},jc||B.state),{},{isLoading:!1}),commitToHistory:!0}),Pc.abrupt("return");case 21:Pc.next=26;break;case 23:return Pc.prev=
23,Pc.t1=Pc.catch(0),Pc.abrupt("return",B.setState({isLoading:!1,errorMessage:Pc.t1.message}));case 26:if(""===(nc=Aa.dataTransfer.getData(Cc.LO.excalidrawlib))){Pc.next=30;break}return B.addElementsFromPasteOrLibrary({elements:JSON.parse(nc),position:Aa}),Pc.abrupt("return");case 30:if(!((null==(Tc=null===(Ia=Aa.dataTransfer)||void 0===Ia?void 0:Ia.files[0])?void 0:Tc.type)===Cc.LO.excalidrawlib||null!=Tc&&null!==(Wa=Tc.name)&&void 0!==Wa&&Wa.endsWith(".excalidrawlib"))){Pc.next=35;break}B.library.importLibrary(Tc).then(function(){B.setState({isLibraryOpen:!1});
B.setState({isLibraryOpen:!0})}).catch(function(Zc){return B.setState({isLoading:!1,errorMessage:Zc.message})});Pc.next=49;break;case 35:if(B.setState({isLoading:!0}),!nm){Pc.next=47;break}return Pc.prev=37,Xc=Aa.dataTransfer.items[0],Pc.next=41,Xc.getAsFileSystemHandle();case 41:Tc.handle=Pc.sent;Pc.next=47;break;case 44:Pc.prev=44,Pc.t2=Pc.catch(37),console.warn(Pc.t2.name,Pc.t2.message);case 47:return Pc.next=49,B.loadFileToCanvas(Tc);case 49:case "end":return Pc.stop()}},Ca,null,[[0,23],[4,11],
[37,44]])}));return function(Aa){return ja.apply(this,arguments)}}();this.loadFileToCanvas=function(ja){vl(ja,B.state,B.scene.getElementsIncludingDeleted()).then(function(xa){return B.syncActionResult({elements:xa.elements,appState:Wd(Wd({},xa.appState||B.state),{},{isLoading:!1}),commitToHistory:!0})}).catch(function(xa){B.setState({isLoading:!1,errorMessage:xa.message})})};this.handleCanvasContextMenu=function(ja){ja.preventDefault();var xa=hh(ja,B.state),Aa=(xa=B.getElementAtPosition(xa.x,xa.y,
{preferSelected:!0}))?"element":"canvas",Ca=B.excalidrawContainerRef.current.getBoundingClientRect(),Ia=ja.clientX-Ca.left,Wa=ja.clientY-Ca.top;xa&&!B.state.selectedElementIds[xa.id]?B.setState({selectedElementIds:T({},xa.id,!0)},function(){B._openContextMenu({top:Wa,left:Ia},Aa)}):B._openContextMenu({top:Wa,left:Ia},Aa)};this.maybeDragNewGenericElement=function(ja,xa){var Aa=B.state.draggingElement,Ca=ja.lastCoords;if(Aa)if("selection"===Aa.type)Ok(Aa,B.state.elementType,ja.origin.x,ja.origin.y,
Ca.x,Ca.y,Math.abs(ja.origin.x-Ca.x),Math.abs(ja.origin.y-Ca.y),xa.shiftKey,xa.altKey);else{var Ia=ca(Ch(Ca.x,Ca.y,B.state.gridSize),2);Ca=Ia[0];Ia=Ia[1];Ok(Aa,B.state.elementType,ja.originInGrid.x,ja.originInGrid.y,Ca,Ia,Math.abs(ja.originInGrid.x-Ca),Math.abs(ja.originInGrid.y-Ia),xa.shiftKey,xa.altKey);B.maybeSuggestBindingForAll([Aa])}};this.maybeHandleResize=function(ja,xa){var Aa=Sf(B.scene.getElements(),B.state),Ca=ja.resize.handleType;B.setState({isResizing:Ca&&"rotation"!==Ca,isRotating:"rotation"===
Ca});var Ia=ja.lastCoords;Ia=ca(Ch(Ia.x-ja.resize.offset.x,Ia.y-ja.resize.offset.y,B.state.gridSize),2);a:{var Wa=ja.resize.arrowDirection,$a=xa.shiftKey,rb=xa.altKey,Hb=xa.shiftKey;xa=Ia[0];var Xb=Ia[1];Ia=ja.resize.center.x;var jc=ja.resize.center.y;if(1===Aa.length){Ia=ca(Aa,1)[0];if("rotation"===Ca)Ca=ca(Vf(Ia),4),Ca=5*Math.PI/2+Math.atan2(Xb-(Ca[1]+Ca[3])/2,xa-(Ca[0]+Ca[2])/2),$a&&(Ca+=Cc.ay/2,Ca-=Ca%Cc.ay),Ca=fe(Ca),le(Ia,{angle:Ca}),Di(Ia);else if(!Dg(Ia)||2!==Ia.points.length||"nw"!==Ca&&
"ne"!==Ca&&"sw"!==Ca&&"se"!==Ca)if(!Xg(Ia)||"nw"!==Ca&&"ne"!==Ca&&"sw"!==Ca&&"se"!==Ca)Ca&&Fi(ja.originalElements.get(Ia.id),Hb,Ia,Ca,rb,xa,Xb);else{$a=ca(Vf(Ia),4);Hb=$a[0];ja=$a[1];Wa=$a[2];$a=$a[3];Xb=ca(Jf(xa,Xb,(Hb+Wa)/2,(ja+$a)/2,-Ia.angle),2);xa=Xb[0];Xb=Xb[1];switch(Ca){case "se":var nc=Math.max((xa-Hb)/(Wa-Hb),(Xb-ja)/($a-ja));break;case "nw":nc=Math.max((Wa-xa)/(Wa-Hb),($a-Xb)/($a-ja));break;case "ne":nc=Math.max((xa-Hb)/(Wa-Hb),($a-Xb)/($a-ja));break;case "sw":nc=Math.max((Wa-xa)/(Wa-Hb),
(Xb-ja)/($a-ja))}0<nc&&(xa=Ia.width*nc,nc*=Ia.height,Xb=fg(Ia,xa,nc),null!==Xb&&(jc=ca(Re(Ia,xa,nc),4),Hb=(Hb-jc[0])/2,ja=(ja-jc[1])/2,Wa=(Wa-jc[2])/2,$a=($a-jc[3])/2,Ca={n:/^(n|ne|nw)$/.test(Ca)||rb&&/^(s|se|sw)$/.test(Ca),s:/^(s|se|sw)$/.test(Ca)||rb&&/^(n|ne|nw)$/.test(Ca),w:/^(w|nw|sw)$/.test(Ca)||rb&&/^(e|ne|se)$/.test(Ca),e:/^(e|ne|se)$/.test(Ca)||rb&&/^(w|nw|sw)$/.test(Ca)},Ca=ca(qi(Ca,Ia.x,Ia.y,Ia.angle,Hb,ja,Wa,$a),2),le(Ia,{fontSize:Xb.size,width:xa,height:nc,baseline:Xb.baseline,x:Ca[0],
y:Ca[1]})));Di(Ia)}else Ca=ca(Vf(Ia),4),rb=ca(Jf(xa,Xb,(Ca[0]+Ca[2])/2,(Ca[1]+Ca[3])/2,-Ia.angle),2),Ca=rb[0],rb=rb[1],rb=ca("end"===Wa?[Ca-Ia.x,rb-Ia.y]:[Ia.x+Ia.points[1][0]-Ca,Ia.y+Ia.points[1][1]-rb],2),Ca=rb[0],rb=rb[1],$a&&(nc=Ia.angle,Ca=mk.apply(void 0,[Ia.type].concat(O(Jf(Ca,rb,0,0,nc)))),Ca=Jf(Ca.width,Ca.height,0,0,-nc),rb=ca(Ca,2),Ca=rb[0],rb=rb[1]),Wa=ca(qi("end"===Wa?{s:!0,e:!0}:{n:!0,w:!0},Ia.x,Ia.y,Ia.angle,0,0,(Ia.points[1][0]-Ca)/2,(Ia.points[1][1]-rb)/2),2),le(Ia,{x:Wa[0],y:Wa[1],
points:[[0,0],[Ca,rb]]});Ia=!0}else{if(1<Aa.length){if("rotation"===Ca){Ia=(Bk(ja,Aa,xa,Xb,$a,Ia,jc),!0);break a}if("nw"===Ca||"ne"===Ca||"sw"===Ca||"se"===Ca){Ia=(Hm(Aa,Ca,xa,Xb),!0);break a}}Ia=!1}}return!!Ia&&(B.maybeSuggestBindingForAll(Aa),!0)};this._openContextMenu=function(ja,xa){var Aa=ja.left;ja=ja.top;var Ca=Dt.contextItemPredicate(B.actionManager.getElementsIncludingDeleted(),B.actionManager.getAppState()),Ia=Bt.contextItemPredicate(B.actionManager.getElementsIncludingDeleted(),B.actionManager.getAppState()),
Wa=Kt.contextItemPredicate(B.actionManager.getElementsIncludingDeleted(),B.actionManager.getAppState()),$a=Lt.contextItemPredicate(B.actionManager.getElementsIncludingDeleted(),B.actionManager.getAppState()),rb=B.scene.getElements(),Hb=[];(Qb&&0<rb.length&&Hb.push(Ot),Cb&&0<rb.length&&Hb.push(Nt),"canvas"===xa)?(xa=[].concat(Hb,[void 0===B.props.gridModeEnabled&&Pt,void 0===B.props.zenModeEnabled&&ss,void 0===B.props.viewModeEnabled&&st,rs]),B.state.viewModeEnabled?sr({options:xa,top:ja,left:Aa,actionManager:B.actionManager,
appState:B.state,container:B.excalidrawContainerRef.current}):sr({options:[B.isMobile&&navigator.clipboard&&{name:"paste",perform:function(Xb,jc){return B.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},B.isMobile&&navigator.clipboard&&"separator",Qb&&0<rb.length&&Ot,Cb&&0<rb.length&&Nt,(Qb&&0<rb.length||Cb&&0<rb.length)&&"separator",Ql,"separator",void 0===B.props.gridModeEnabled&&Pt,void 0===B.props.zenModeEnabled&&ss,void 0===B.props.viewModeEnabled&&st,rs],top:ja,
left:Aa,actionManager:B.actionManager,appState:B.state,container:B.excalidrawContainerRef.current})):"element"===xa&&(B.state.viewModeEnabled?sr({options:[navigator.clipboard&&ts].concat(Hb),top:ja,left:Aa,actionManager:B.actionManager,appState:B.state,container:B.excalidrawContainerRef.current}):sr({options:[B.isMobile&&Hv,B.isMobile&&navigator.clipboard&&ts,B.isMobile&&navigator.clipboard&&{name:"paste",perform:function(Xb,jc){return B.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},
B.isMobile&&"separator"].concat(Hb,["separator",Zf,jn,"separator",Ca&&Dt,Ia&&Bt,(Ca||Ia)&&"separator",Dv,"separator",Gn,Fn,ji,rl,"separator",Wa&&Kt,$a&&Lt,(Wa||$a)&&"separator",Zk,hn]),top:ja,left:Aa,actionManager:B.actionManager,appState:B.state,container:B.excalidrawContainerRef.current}))};this.handleWheel=ag(function(ja){if(ja.preventDefault(),!Cq){var xa=ja.deltaX,Aa=ja.deltaY,Ca=B.state,Ia=Ca.selectedElementIds,Wa=Ca.previousSelectedElementIds;if(ja.metaKey||ja.ctrlKey){ja=Math.sign(Aa);Ca=
Math.abs(Aa);10<Ca&&(Ca=10);Ca*=ja;0!==Object.keys(Wa).length&&setTimeout(function(){B.setState({selectedElementIds:Wa,previousSelectedElementIds:{}})},1E3);var $a=B.state.zoom.value-Ca/100;return $a+=Math.log10(Math.max(1,B.state.zoom.value))*-ja,$a=Math.round($a*Cc.V4*100)/(100*Cc.V4),B.setState(function(rb){var Hb=rb.zoom,Xb=rb.offsetLeft;rb=rb.offsetTop;return{zoom:ha(ua($a),Hb,{left:Xb,top:rb},{x:Jp,y:Kp}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(Ia).length?Ia:Wa,shouldCacheIgnoreZoom:!0}}),
void B.resetShouldCacheIgnoreZoomDebounced()}ja.shiftKey?B.setState(function(rb){return{scrollX:rb.scrollX-(Aa||xa)/rb.zoom.value}}):B.setState(function(rb){var Hb=rb.zoom;return{scrollX:rb.scrollX-xa/Hb.value,scrollY:rb.scrollY-Aa/Hb.value}})}});this.savePointer=function(ja,xa,Aa){var Ca,Ia;ja&&xa&&(ja=hh({clientX:ja,clientY:xa},B.state),isNaN(ja.x)||isNaN(ja.y),null===(Ca=(Ia=B.props).onPointerUpdate)||void 0===Ca||Ca.call(Ia,{pointer:ja,button:Aa,pointersMap:zl}))};this.resetShouldCacheIgnoreZoomDebounced=
Sm(function(){B.unmounted||B.setState({shouldCacheIgnoreZoom:!1})},300);this.updateDOMRect=function(ja){var xa;if(null!==(xa=B.excalidrawContainerRef)&&void 0!==xa&&xa.current){var Aa=B.excalidrawContainerRef.current.getBoundingClientRect();xa=Aa.width;var Ca=Aa.height,Ia=Aa.left;Aa=Aa.top;var Wa=B.state,$a=Wa.height,rb=Wa.offsetTop,Hb=Wa.offsetLeft;if(xa===Wa.width&&Ca===$a&&Ia===Hb&&Aa===rb)return void(ja&&ja());B.setState({width:xa,height:Ca,offsetLeft:Ia,offsetTop:Aa},function(){ja&&ja()})}};
this.refresh=function(){B.setState(Wd({},B.getCanvasOffsets()))}};"production"!==Cc.Vi.TEST&&"production"!==Cc.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){return this.app.scene.getElementsIncludingDeleted()},set:function(B){return this.app.scene.replaceAllElements(B)}}}));e(4285);e(3313);var it=function(B){var oa=B.getDimensions,va=void 0===oa?function(Aa,Ca){return{width:Aa,height:Ca,scale:1}}:oa;B=Tm({elements:B.elements,appState:B.appState},
null,null);oa=B.appState;var ja=oa.exportBackground,xa=oa.viewBackgroundColor;return Aq(pe(B.elements),qh(qh({},oa),{},{offsetTop:0,offsetLeft:0,width:0,height:0}),{exportBackground:ja,viewBackgroundColor:xa},function(Aa,Ca){var Ia=document.createElement("canvas");Aa=va(Aa,Ca);return Ia.width=Aa.width,Ia.height=Aa.height,{canvas:Ia,scale:Aa.scale}})},Ru=function(B){var oa=it(B),va=B.mimeType,ja=void 0===va?"image/png":va,xa=B.quality;return"image/png"===ja&&"number"==typeof xa&&console.warn('"quality" will be ignored for "image/png" mimeType'),
"image/jpg"===ja&&(ja="image/jpeg"),xa=xa||(/image\/jpe?g/.test(ja)?.92:.8),new Promise(function(Aa){oa.toBlob(function(Ca){Aa(Ca)},ja,xa)})},Yv=function(){var B=(0,ff.Z)(Zd().mark(function ja(va){var xa,Aa,Ca,Ia,Wa,$a,rb;return Zd().wrap(function(Hb){for(;;)switch(Hb.prev=Hb.next){case 0:return xa=va.elements,Aa=va.appState,Ca=void 0===Aa?Ij():Aa,Ia=va.exportPadding,Wa=Tm({elements:xa,appState:Ca},null,null),$a=Wa.elements,rb=Wa.appState,Hb.abrupt("return",Ap(pe($a),qh(qh({},rb),{},{exportPadding:Ia})));
case 3:case "end":return Hb.stop()}},ja)}));return function(va){return B.apply(this,arguments)}}(),Iv=["initialData","UIOptions"],Jv=["initialData","UIOptions"],Lv=function(B){var oa,va,ja=B.onChange,xa=B.initialData,Aa=B.excalidrawRef,Ca=B.onCollabButtonClick,Ia=B.isCollaborating,Wa=B.onPointerUpdate,$a=B.renderTopRightUI,rb=B.renderFooter,Hb=B.langCode;Hb=void 0===Hb?Vg.code:Hb;var Xb=B.viewModeEnabled,jc=B.zenModeEnabled,nc=B.gridModeEnabled,Tc=B.libraryReturnUrl,Xc=B.theme,Pc=B.name,Zc=B.renderCustomStats,
Dd=B.onPaste,Yd=B.detectScroll;Yd=void 0===Yd||Yd;var md=B.handleKeyboardGlobally;md=void 0!==md&&md;var sd=B.onLibraryChange,Hd=B.autoFocus;Hd=void 0!==Hd&&Hd;B=null===(oa=B.UIOptions)||void 0===oa?void 0:oa.canvasActions;oa={canvasActions:km(km({},Cc.cW.canvasActions),B)};null!=B&&B.export&&(oa.canvasActions.export.saveFileToDisk=(null===(va=B.export)||void 0===va?void 0:va.saveFileToDisk)||Cc.cW.canvasActions.export.saveFileToDisk);return(0,ve.useEffect)(function(){var He=function(Sg){"number"==
typeof Sg.scale&&1!==Sg.scale&&Sg.preventDefault()};return document.addEventListener("touchmove",He,{passive:!1}),function(){document.removeEventListener("touchmove",He)}},[]),(0,Va.jsx)(Rl,{langCode:Hb,children:(0,Va.jsx)(ks,{onChange:ja,initialData:xa,excalidrawRef:Aa,onCollabButtonClick:Ca,isCollaborating:Ia,onPointerUpdate:Wa,renderTopRightUI:$a,renderFooter:rb,langCode:Hb,viewModeEnabled:Xb,zenModeEnabled:jc,gridModeEnabled:nc,libraryReturnUrl:Tc,theme:Xc,name:Pc,renderCustomStats:Zc,UIOptions:oa,
onPaste:Dd,detectScroll:Yd,handleKeyboardGlobally:md,onLibraryChange:sd,autoFocus:Hd})})},Mv=(0,ve.forwardRef)(function(B,oa){return(0,Va.jsx)(Lv,km(km({},B),{},{excalidrawRef:oa}))}),Nv=de().memo(Mv,function(B,oa){B.initialData;var va=B.UIOptions,ja=void 0===va?{}:va,xa=Xh()(B,Iv);va=(oa.initialData,oa.UIOptions);var Aa=void 0===va?{}:va,Ca=Xh()(oa,Jv);va=Object.keys(ja);var Ia=Object.keys(Aa);if(va.length!==Ia.length)return!1;va=va.every(function(Wa){"canvasActions"===Wa&&Object.keys(ja.canvasActions).every(function($a){var rb,
Hb,Xb,jc;return"export"===$a&&null!=ja&&null!==(rb=ja.canvasActions)&&void 0!==rb&&rb.export&&null!=Aa&&null!==(Hb=Aa.canvasActions)&&void 0!==Hb&&Hb.export?ja.canvasActions.export.saveFileToDisk===Aa.canvasActions.export.saveFileToDisk:(null==ja||null===(Xb=ja.canvasActions)||void 0===Xb?void 0:Xb[$a])===(null==Aa||null===(jc=Aa.canvasActions)||void 0===jc?void 0:jc[$a])});return!0});B=Object.keys(B);oa=Object.keys(oa);return va&&B.length===oa.length&&B.every(function(Wa){return xa[Wa]===Ca[Wa]})}),
Ov=(e(8336),Nv)},4698:function(u){u.exports=G},6207:function(u){u.exports=p},8950:function(u,g,e){function k(z,y,K,E,A,D,r){try{var V=z[D](r),ea=V.value}catch(Q){return void K(Q)}V.done?y(ea):Promise.resolve(ea).then(E,A)}function x(z){return function(){var y=this,K=arguments;return new Promise(function(E,A){function D(ea){k(V,E,A,D,r,"next",ea)}function r(ea){k(V,E,A,D,r,"throw",ea)}var V=z.apply(y,K);D(void 0)})}}e.d(g,{Z:function(){return x}})},1463:function(u){u.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeShape":"Stroke shape","strokeShape_gel":"Gel pen","strokeShape_fountain":"Fountain pen","strokeShape_brush":"Brush pen","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme"},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save to current file","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary"
4451:function(u){u.exports=JSON.parse('{"ar-SA":100,"bg-BG":68,"ca-ES":84,"cs-CZ":29,"da-DK":20,"de-DE":100,"el-GR":74,"en":100,"es-ES":100,"fa-IR":77,"fi-FI":100,"fr-FR":100,"he-IL":99,"hi-IN":67,"hu-HU":60,"id-ID":100,"it-IT":100,"ja-JP":100,"kab-KAB":93,"kk-KZ":26,"ko-KR":68,"lv-LV":14,"my-MM":56,"nb-NO":100,"nl-NL":100,"nn-NO":74,"oc-FR":100,"pa-IN":99,"pl-PL":70,"pt-BR":100,"pt-PT":99,"ro-RO":100,"ru-RU":99,"sk-SK":100,"sv-SE":100,"tr-TR":78,"uk-UA":80,"zh-CN":100,"zh-TW":100}')}},a={};return l.m=
t,l.n=function(u){var g=u&&u.__esModule?function(){return u.default}:function(){return u};return l.d(g,{a:g}),g},h=Object.getPrototypeOf?function(u){return Object.getPrototypeOf(u)}:function(u){return u.__proto__},l.t=function(u,g){if((1&g&&(u=this(u)),8&g)||"object"==typeof u&&u&&(4&g&&u.__esModule||16&g&&"function"==typeof u.then))return u;var e=Object.create(null);l.r(e);var k={};c=c||[null,h({}),h([]),h(h)];for(g=2&g&&u;"object"==typeof g&&!~c.indexOf(g);g=h(g))Object.getOwnPropertyNames(g).forEach(function(x){k[x]=
function(){return u[x]}});return k.default=function(){return u},l.d(e,k),e},l.d=function(u,g){for(var e in g)l.o(g,e)&&!l.o(u,e)&&Object.defineProperty(u,e,{enumerable:!0,get:g[e]})},l.f={},l.e=function(u){return Promise.all(Object.keys(l.f).reduce(function(g,e){return l.f[e](u,g),g},[]))},l.u=function(u){return"excalidraw-assets/"+{9:"image",43:"i18n-de-DE-json",60:"i18n-ko-KR-json",62:"i18n-zh-TW-json",137:"i18n-ja-JP-json",149:"i18n-pt-PT-json",164:"i18n-kab-KAB-json",196:"i18n-nl-NL-json",213:"i18n-tr-TR-json",
242:"i18n-my-MM-json",246:"i18n-nb-NO-json",262:"i18n-he-IL-json",280:"i18n-pa-IN-json",304:"i18n-zh-CN-json",317:"i18n-es-ES-json",351:"i18n-ca-ES-json",364:"i18n-fr-FR-json",381:"i18n-pt-BR-json",384:"i18n-bg-BG-json",387:"i18n-cs-CZ-json",401:"i18n-sk-SK-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",565:"i18n-oc-FR-json",583:"i18n-uk-UA-json",617:"i18n-da-DK-json",649:"i18n-kk-KZ-json",661:"i18n-hu-HU-json",698:"i18n-sv-SE-json",
710:"i18n-fa-IR-json",736:"vendor",752:"i18n-ro-RO-json",852:"i18n-pl-PL-json",869:"i18n-ru-RU-json",899:"i18n-lv-LV-json",920:"i18n-nn-NO-json",933:"i18n-hi-IN-json"}[u]+"-"+{9:"02a1f3ecd6baf42daaa6",43:"2984c3ea70efb6a7673c",60:"530261d88e915f413822",62:"93a8203eb30054101fcc",137:"10da607a92dd9ee4b6b1",149:"fb8bc9b15f2d232ce452",164:"72dfe5e520fb843a911e",196:"220f20ddbd7092a3a948",213:"60da00067a54eacae6ea",242:"9c8f0251105b94363a8f",246:"102950eb1c0d17b2be82",262:"c22c852f5d1007b76cfd",280:"b7ad703689a54409b91a",
304:"9b20d01d442a9938174a",317:"770832e8199e76bcea31",351:"6f613ec62c184eed761c",364:"7e2c395dc072fbeb4dc8",381:"5eb00d985874b4016992",384:"63af3f6053ca50d0c1a3",387:"c485bdbc1ad44e51f1f1",401:"4fc55e97187d84b3e35f",465:"55de4a420bc2799d63ac",472:"1856fe5f0aa5f6733c71",491:"36ef4139fdc39bd473e9",526:"ef1babaff2ea7b0ca48c",558:"a98b3a07a69a56aa6ddc",565:"3fb584025bb45201012f",583:"3398bd8076ace43903a4",617:"fdc74fe43abb7f09253d",649:"72a00814a5ea1bc1bd4d",661:"2173dae4a84d3f943a3d",698:"5fd1ff062cab18b6c3ec",
710:"5d17bed42e8aa3e26778",736:"881ef50682618d9bd3d3",752:"dc651de2037f6a904212",852:"589514e9da02be71829e",869:"1620932d8cf3b49dbac7",899:"efdf3550b88b63639a73",920:"5b64fbe09ec2fdc5c686",933:"3577c3ff017e2af147ee"}[u]+".js"},l.o=function(u,g){return Object.prototype.hasOwnProperty.call(u,g)},n={},l.l=function(u,g,e,k){if(n[u])n[u].push(g);else{var x;if(void 0!==e){k=document.getElementsByTagName("script");for(var z=0;z<k.length;z++){var y=k[z];if(y.getAttribute("src")==u||y.getAttribute("data-webpack")==
"Excalidraw:"+e){var K=y;break}}}K||(x=!0,(K=document.createElement("script")).charset="utf-8",K.timeout=120,l.nc&&K.setAttribute("nonce",l.nc),K.setAttribute("data-webpack","Excalidraw:"+e),K.src=u);n[u]=[g];g=function(A,D){K.onerror=K.onload=null;clearTimeout(E);var r=n[u];if(delete n[u],K.parentNode&&K.parentNode.removeChild(K),r&&r.forEach(function(V){return V(D)}),A)return A(D)};var E=setTimeout(g.bind(null,void 0,{type:"timeout",target:K}),12E4);K.onerror=g.bind(null,K.onerror);K.onload=g.bind(null,
K.onload);x&&document.head.appendChild(K)}},l.r=function(u){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"});Object.defineProperty(u,"__esModule",{value:!0})},l.p="",function(){var u={388:0};l.f.j=function(k,x){var z=l.o(u,k)?u[k]:void 0;if(0!==z)if(z)x.push(z[2]);else{var y=new Promise(function(E,A){z=u[k]=[E,A]});x.push(z[2]=y);x=l.p+l.u(k);var K=Error();l.l(x,function(E){if(l.o(u,k)&&(0!==(z=u[k])&&(u[k]=void 0),z)){var A=E&&("load"===
E.type?"missing":E.type);E=E&&E.target&&E.target.src;K.message="Loading chunk "+k+" failed.\n("+A+": "+E+")";K.name="ChunkLoadError";K.type=A;K.request=E;z[1](K)}},"chunk-"+k,k)}};var g=function(k,x){var z,y=x[0],K=x[1],E=x[2],A=0;for(z in K)l.o(K,z)&&(l.m[z]=K[z]);E&&E(l);for(k&&k(x);A<y.length;A++)k=y[A],l.o(u,k)&&u[k]&&u[k][0](),u[y[A]]=0},e=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];e.forEach(g.bind(null,0));e.push=g.bind(null,e.push.bind(e))}(),l(21)}()})};
'use strict';var uIc=function(a,b){var c=$APP.vz();$APP.m(c)&&$APP.os($APP.a7a(c,a),function(d){return b.F?b.F(d):b.call(null,d)},function(d){return $APP.Wk.I($APP.G(["Error loading ",a,": ",d]))})},wIc=function(a){var b=$APP.$r(a);if($APP.m(b)){for(b=b.querySelector(".draw-wrap");;){if(null!=b&&void 0!==b&&void 0!==b.classList)if($APP.m(b.classList.contains("block-content")))b=b.clientWidth,$APP.Jf(vIc.F(a),b);else{b=b.parentNode;continue}break}return a}return null},xIc=new $APP.M(null,"view-mode-enabled",
"view-mode-enabled",-588220561),yIc=new $APP.M("frontend.extensions.excalidraw","grid-mode?","frontend.extensions.excalidraw/grid-mode?",-1189627787),zIc=new $APP.M("frontend.extensions.excalidraw","view-mode?","frontend.extensions.excalidraw/view-mode?",525380621),AIc=new $APP.M(null,"grid-mode-enabled","grid-mode-enabled",584978327),BIc=new $APP.M("frontend.extensions.excalidraw","elements","frontend.extensions.excalidraw/elements",1745667967),CIc=new $APP.M("frontend.extensions.excalidraw","loading?",
"frontend.extensions.excalidraw/loading?",-1335058663),DIc=new $APP.M("frontend.extensions.excalidraw","data","frontend.extensions.excalidraw/data",-1371036113),EIc=new $APP.M(null,"zen-mode-enabled","zen-mode-enabled",-955634269),FIc=new $APP.M("frontend.extensions.excalidraw","zen-mode?","frontend.extensions.excalidraw/zen-mode?",1559773511),GIc=new $APP.M(null,"initial-data","initial-data",-1315709804),vIc=new $APP.M("frontend.extensions.excalidraw","draw-width","frontend.extensions.excalidraw/draw-width",
-681100043);$APP.$ca("excalidraw");var HIc=$APP.Nm(595);var IIc,JIc,KIc,LIc;$APP.Cyc={};IIc=$APP.WQ($APP.Aa(HIc,"default"));JIc=$APP.Aa(HIc,"serializeAsJSON");
KIc=$APP.Qr($APP.Xr,function(a,b,c){var d=$APP.I.B(a,vIc),e=$APP.I.B(a,FIc),f=$APP.I.B(a,zIc),g=$APP.I.B(a,yIc),k=$APP.iz($APP.UZa),n=$APP.I.B(a,BIc);a=$APP.sf(c);var p=$APP.I.B(a,$APP.Lq),q=$APP.I.B(a,$APP.wO);return $APP.m(b)?$APP.X("div",{onMouseDown:function(u){return $APP.ys(u)},className:"overflow-hidden"},[$APP.X("div",{style:{fontSize:10},className:"my-1"},[$APP.X("a",{onClick:$APP.VZa,className:"mr-2"},[$APP.Cr($APP.ms("Wide Mode (%s)",$APP.G([$APP.m(k)?"ON":"OFF"])))]),$APP.X("a",{onClick:function(){return $APP.Uh.B(e,
$APP.Wb)},className:"mr-2"},[$APP.Cr($APP.ms("Zen Mode (%s)",$APP.G([$APP.m($APP.t(e))?"ON":"OFF"])))]),$APP.X("a",{onClick:function(){return $APP.Uh.B(f,$APP.Wb)},className:"mr-2"},[$APP.Cr($APP.ms("View Mode (%s)",$APP.G([$APP.m($APP.t(f))?"ON":"OFF"])))]),$APP.X("a",{onClick:function(){return $APP.Uh.B(g,$APP.Wb)},className:"mr-2"},[$APP.Cr($APP.ms("Grid Mode (%s)",$APP.G([$APP.m($APP.t(f))?"ON":"OFF"])))]),$APP.X("a",{onClick:function(){var u=new $APP.O(null,2,5,$APP.Q,[$APP.jA,q],null);u=$APP.kC?
$APP.kC(u):$APP.mC.call(null,u);return $APP.m(u)?$APP.pO(0,null):null},className:"mr-2"},["Edit Block"])]),$APP.X("div",{onMouseDown:function(u){$APP.ys(u);return $APP.sz($APP.VX,!0)},onBlur:function(){return $APP.sz($APP.VX,!1)},style:{width:$APP.t(d),height:$APP.m(k)?650:500},className:"draw-wrap"},[$APP.Cr(function(){var u=$APP.hm.I($APP.G([new $APP.l(null,6,[$APP.iR,function(v,y){if($APP.m(function(){var F=$APP.D.B("down",$APP.Aa(y,"cursorButton"));if(F)return F;F=$APP.Aa(y,"draggingElement");
if($APP.m(F))return F;F=$APP.Aa(y,"editingElement");if($APP.m(F))return F;F=$APP.Aa(y,"editingGroupId");return $APP.m(F)?F:$APP.Aa(y,"editingLinearElement")}()))return null;var B=$APP.bj(v);return $APP.x(B)&&$APP.bh.B(B,$APP.t(n))?($APP.Jf(n,B),$APP.N7a(p,JIc.B?JIc.B(v,y):JIc.call(null,v,y))):null},EIc,$APP.t(e),xIc,$APP.t(f),AIc,$APP.t(g),GIc,b,$APP.VA,$APP.iz($APP.mA)],null)]));return IIc.F?IIc.F(u):IIc.call(null,u)}())])]):null},new $APP.O(null,7,5,$APP.Q,[$APP.p7,$APP.as(800,vIc),$APP.as(!0,FIc),
$APP.as(!1,zIc),$APP.as(!1,yIc),$APP.as(null,BIc),new $APP.l(null,2,[$APP.Mr,wIc,$APP.Nr,wIc],null)],null),"frontend.extensions.excalidraw/draw-inner");
LIc=$APP.Qr($APP.Xr,function(a,b){var c=$APP.I.B(a,DIc);a=$APP.I.B(a,CIc);a=$APP.cs(a);c=$APP.cs(c);var d=$APP.iz($APP.Klb);return $APP.m($APP.Lq.F(b))?$APP.m(d)?(b=$APP.mR("Loading"),$APP.X("div",$APP.Kd(b)?$APP.Br($APP.xr($APP.G([new $APP.l(null,1,[$APP.vr,new $APP.O(null,1,5,$APP.Q,["ls-center"],null)],null),b]))):{className:"ls-center"},$APP.Kd(b)?null:[$APP.Cr(b)])):!1===a?KIc(c,b):null:null},new $APP.O(null,2,5,$APP.Q,[$APP.p7,new $APP.l(null,1,[$APP.Kr,function(a){var b=$APP.Rr.F(a);b=$APP.E.G(b,
0,null);b=$APP.Lq.F(b);var c=$APP.Th.F(null),d=$APP.Th.F(!0);$APP.m(b)&&uIc(b,function(e){if($APP.Yj(e))var f=null;else try{f=JSON.parse(e)}catch(g){if(g instanceof Error)e=g,$APP.Wk.I($APP.G(["from json error:"])),console.dir(e),f=$APP.Im($APP.Kva("Could not load this invalid excalidraw file"),$APP.zu);else throw g;}$APP.Jf(c,f);return $APP.Jf(d,!1)});return $APP.R.I(a,DIc,c,$APP.G([CIc,d]))}],null)],null),"frontend.extensions.excalidraw/draw-container");
$APP.Dyc=$APP.Qr($APP.Tr,function(a){var b=$APP.vz(),c=$APP.iz(new $APP.O(null,2,5,$APP.Q,[$APP.JYa,b],null));return $APP.iB(b)&&$APP.Wb(c)&&$APP.Wb($APP.ls())&&$APP.Wb($APP.ar())?null:LIc(a)},new $APP.O(null,1,5,$APP.Q,[$APP.p7],null),"frontend.extensions.excalidraw/draw");$APP.fb.gi();
}).call(this);